1
0
forked from sent/waves
waves/public/assets/g/stack/index.html
2025-04-09 17:11:14 -05:00

4 lines
609 KiB
HTML

<!doctypehtml><html lang=en><meta charset=UTF-8>
<script src="/js/all.min.js"></script>
<script>function disableselect(e){return!1}function reEnable(){return!0}document.onselectstart=new Function("return false"),document.oncontextmenu=new Function("return false"),window.sidebar&&(document.onmousedown=disableselect,document.onclick=reEnable)</script><style>@import url(https://fonts.googleapis.com/css?family=Comfortaa);body,html{margin:0;overflow:hidden;height:100%;width:100%;position:relative;font-family:Comfortaa,cursive}#container{width:100%;height:100%}#container #score{position:absolute;top:20px;width:100%;text-align:center;font-size:10vh;-webkit-transition:-webkit-transform .5s ease;transition:-webkit-transform .5s ease;transition:transform .5s ease;transition:transform .5s ease,-webkit-transform .5s ease;color:#334;-webkit-transform:translatey(-200px) scale(1);transform:translatey(-200px) scale(1)}#container #game{position:absolute;top:0;right:0;bottom:0;left:0}#container .game-over{position:absolute;top:0;left:0;width:100%;height:85%;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center}#container .game-over *{-webkit-transition:opacity .5s ease,-webkit-transform .5s ease;transition:opacity .5s ease,-webkit-transform .5s ease;transition:opacity .5s ease,transform .5s ease;transition:opacity .5s ease,transform .5s ease,-webkit-transform .5s ease;opacity:0;-webkit-transform:translatey(-50px);transform:translatey(-50px);color:#334}#container .game-over h2{margin:0;padding:0;font-size:40px}#container .game-ready{position:absolute;top:0;left:0;width:100%;height:100%;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-align:center;align-items:center;justify-content:space-around}#container .game-ready #start-button{-webkit-transition:opacity .5s ease,-webkit-transform .5s ease;transition:opacity .5s ease,-webkit-transform .5s ease;transition:opacity .5s ease,transform .5s ease;transition:opacity .5s ease,transform .5s ease,-webkit-transform .5s ease;opacity:0;-webkit-transform:translatey(-50px);transform:translatey(-50px);border:3px solid #334;padding:10px 20px;background-color:transparent;color:#334;font-size:30px}#container #instructions{position:absolute;width:100%;top:16vh;left:0;text-align:center;-webkit-transition:opacity .5s ease,-webkit-transform .5s ease;transition:opacity .5s ease,-webkit-transform .5s ease;transition:opacity .5s ease,transform .5s ease;transition:opacity .5s ease,transform .5s ease,-webkit-transform .5s ease;opacity:0}#container #instructions.hide{opacity:0!important}#container.playing #score,#container.resetting #score{-webkit-transform:translatey(0) scale(1);transform:translatey(0) scale(1)}#container.playing #instructions{opacity:1}#container.ready .game-ready #start-button{opacity:1;-webkit-transform:translatey(0);transform:translatey(0)}#container.ended #score{-webkit-transform:translatey(6vh) scale(1.5);transform:translatey(6vh) scale(1.5)}#container.ended .game-over *{opacity:1;-webkit-transform:translatey(0);transform:translatey(0)}#container.ended .game-over p{-webkit-transition-delay:.3s;transition-delay:.3s}</style><script>window.console=window.console||function(o){}</script><script>document.location.search.match(/type=embed/gi)&&window.parent.postMessage("resize","*")</script><body id=ancss oncontextmenu=return!1><meta content="width=device-width,user-scalable=no"name=viewport><div id=container><div id=game></div><div id=score>0</div><div id=instructions>Click (or press the spacebar) to place the block</div><div class=game-over><h2>Game Over</h2><p>You did great, you're the best.<p>Click or spacebar to start again</div><div class=game-ready><div id=start-button>Start</div><div></div></div></div><script>window.HUB_EVENTS={ASSET_ADDED:"ASSET_ADDED",ASSET_DELETED:"ASSET_DELETED",ASSET_DESELECTED:"ASSET_DESELECTED",ASSET_SELECTED:"ASSET_SELECTED",ASSET_UPDATED:"ASSET_UPDATED",CONSOLE_CHANGE:"CONSOLE_CHANGE",CONSOLE_CLOSED:"CONSOLE_CLOSED",CONSOLE_EVENT:"CONSOLE_EVENT",CONSOLE_OPENED:"CONSOLE_OPENED",CONSOLE_RUN_COMMAND:"CONSOLE_RUN_COMMAND",CONSOLE_SERVER_CHANGE:"CONSOLE_SERVER_CHANGE",EMBED_ACTIVE_PEN_CHANGE:"EMBED_ACTIVE_PEN_CHANGE",EMBED_ACTIVE_THEME_CHANGE:"EMBED_ACTIVE_THEME_CHANGE",EMBED_ATTRIBUTE_CHANGE:"EMBED_ATTRIBUTE_CHANGE",EMBED_RESHOWN:"EMBED_RESHOWN",FORMAT_FINISH:"FORMAT_FINISH",FORMAT_ERROR:"FORMAT_ERROR",FORMAT_START:"FORMAT_START",IFRAME_PREVIEW_RELOAD_CSS:"IFRAME_PREVIEW_RELOAD_CSS",IFRAME_PREVIEW_URL_CHANGE:"IFRAME_PREVIEW_URL_CHANGE",KEY_PRESS:"KEY_PRESS",LINTER_FINISH:"LINTER_FINISH",LINTER_START:"LINTER_START",PEN_CHANGE_SERVER:"PEN_CHANGE_SERVER",PEN_CHANGE:"PEN_CHANGE",PEN_EDITOR_CLOSE:"PEN_EDITOR_CLOSE",PEN_EDITOR_CODE_FOLD:"PEN_EDITOR_CODE_FOLD",PEN_EDITOR_ERRORS:"PEN_EDITOR_ERRORS",PEN_EDITOR_EXPAND:"PEN_EDITOR_EXPAND",PEN_EDITOR_FOLD_ALL:"PEN_EDITOR_FOLD_ALL",PEN_EDITOR_LOADED:"PEN_EDITOR_LOADED",PEN_EDITOR_REFRESH_REQUEST:"PEN_EDITOR_REFRESH_REQUEST",PEN_EDITOR_RESET_SIZES:"PEN_EDITOR_RESET_SIZES",PEN_EDITOR_SIZES_CHANGE:"PEN_EDITOR_SIZES_CHANGE",PEN_EDITOR_UI_CHANGE_SERVER:"PEN_EDITOR_UI_CHANGE_SERVER",PEN_EDITOR_UI_CHANGE:"PEN_EDITOR_UI_CHANGE",PEN_EDITOR_UI_DISABLE:"PEN_EDITOR_UI_DISABLE",PEN_EDITOR_UI_ENABLE:"PEN_EDITOR_UI_ENABLE",PEN_EDITOR_UNFOLD_ALL:"PEN_EDITOR_UNFOLD_ALL",PEN_ERROR_INFINITE_LOOP:"PEN_ERROR_INFINITE_LOOP",PEN_ERROR_RUNTIME:"PEN_ERROR_RUNTIME",PEN_ERRORS:"PEN_ERRORS",PEN_LIVE_CHANGE:"PEN_LIVE_CHANGE",PEN_LOGS:"PEN_LOGS",PEN_MANIFEST_CHANGE:"PEN_MANIFEST_CHANGE",PEN_MANIFEST_FULL:"PEN_MANIFEST_FULL",PEN_PREVIEW_FINISH:"PEN_PREVIEW_FINISH",PEN_PREVIEW_START:"PEN_PREVIEW_START",PEN_SAVED:"PEN_SAVED",POPUP_CLOSE:"POPUP_CLOSE",POPUP_OPEN:"POPUP_OPEN",POST_CHANGE:"POST_CHANGE",POST_SAVED:"POST_SAVED",PROCESSING_FINISH:"PROCESSING_FINISH",PROCESSING_START:"PROCESSED_STARTED"},"object"!=typeof window.CP&&(window.CP={}),window.CP.PenTimer={programNoLongerBeingMonitored:!1,timeOfFirstCallToShouldStopLoop:0,_loopExits:{},_loopTimers:{},START_MONITORING_AFTER:2e3,STOP_ALL_MONITORING_TIMEOUT:5e3,MAX_TIME_IN_LOOP_WO_EXIT:2200,exitedLoop:function(E){this._loopExits[E]=!0},shouldStopLoop:function(E){if(this.programKilledSoStopMonitoring)return!0;if(this.programNoLongerBeingMonitored)return!1;if(this._loopExits[E])return!1;var _=this._getTime();if(0===this.timeOfFirstCallToShouldStopLoop)return this.timeOfFirstCallToShouldStopLoop=_,!1;var o=_-this.timeOfFirstCallToShouldStopLoop;if(o<this.START_MONITORING_AFTER)return!1;if(o>this.STOP_ALL_MONITORING_TIMEOUT)return!(this.programNoLongerBeingMonitored=!0);try{this._checkOnInfiniteLoop(E,_)}catch(E){return this._sendErrorMessageToEditor(),this.programKilledSoStopMonitoring=!0}return!1},_sendErrorMessageToEditor:function(){try{if(this._shouldPostMessage()){var E={topic:HUB_EVENTS.PEN_ERROR_INFINITE_LOOP,data:{line:this._findAroundLineNumber()}};parent.postMessage(E,"*")}else this._throwAnErrorToStopPen()}catch(E){this._throwAnErrorToStopPen()}},_shouldPostMessage:function(){return document.location.href.match(/boomerang/)},_throwAnErrorToStopPen:function(){throw"We found an infinite loop in your Pen. We've stopped the Pen from running. Please correct it or contact support@codepen.io."},_findAroundLineNumber:function(){var E=new Error,_=0;if(E.stack){var o=E.stack.match(/boomerang\S+:(\d+):\d+/);o&&(_=o[1])}return _},_checkOnInfiniteLoop:function(E,_){if(!this._loopTimers[E])return this._loopTimers[E]=_,!1;if(_-this._loopTimers[E]>this.MAX_TIME_IN_LOOP_WO_EXIT)throw"Infinite Loop found on loop: "+E},_getTime:function(){return+new Date}},window.CP.shouldStopExecution=function(E){var _=window.CP.PenTimer.shouldStopLoop(E);return!0===_&&console.warn("[CodePen]: An infinite loop (or a loop taking too long) was detected, so we stopped its execution. Sorry!"),_},window.CP.exitedLoop=function(E){window.CP.PenTimer.exitedLoop(E)}</script><script>!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.THREE=t.THREE||{})}(this,function(t){function e(){}function V(t,e){this.x=t||0,this.y=e||0}function z(t,e,i,n,r,a,o,s,c,h){Object.defineProperty(this,"id",{value:wr++}),this.uuid=er.generateUUID(),this.name="",this.image=void 0!==t?t:z.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:z.DEFAULT_MAPPING,this.wrapS=void 0!==i?i:1001,this.wrapT=void 0!==n?n:1001,this.magFilter=void 0!==r?r:1006,this.minFilter=void 0!==a?a:1008,this.anisotropy=void 0!==c?c:1,this.format=void 0!==o?o:1023,this.type=void 0!==s?s:1009,this.offset=new V(0,0),this.repeat=new V(1,1),this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==h?h:3e3,this.version=0,this.onUpdate=null}function Pt(t,e,i,n){this.x=t||0,this.y=e||0,this.z=i||0,this.w=void 0!==n?n:1}function B(t,e,i){this.uuid=er.generateUUID(),this.width=t,this.height=e,this.scissor=new Pt(0,0,t,e),this.scissorTest=!1,this.viewport=new Pt(0,0,t,e),void 0===(i=i||{}).minFilter&&(i.minFilter=1006),this.texture=new z(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0===i.stencilBuffer||i.stencilBuffer,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null}function n(t,e,i){B.call(this,t,e,i),this.activeMipMapLevel=this.activeCubeFace=0}function s(t,e,i,n){this._x=t||0,this._y=e||0,this._z=i||0,this._w=void 0!==n?n:1}function Ct(t,e,i){this.x=t||0,this.y=e||0,this.z=i||0}function It(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function c(t,e,i,n,r,a,o,s,c,h){z.call(this,t=void 0!==t?t:[],void 0!==e?e:301,i,n,r,a,o,s,c,h),this.flipY=!1}function i(t,e,i){var n=t[0];if(n<=0||0<n)return t;var r=e*i,a=Tr[r];if(void 0===a&&(a=new Float32Array(r),Tr[r]=a),0!==e)for(n.toArray(a,0),n=1,r=0;n!==e;++n)r+=i,t[n].toArray(a,r);return a}function a(t,e){var i=Sr[e];void 0===i&&(i=new Int32Array(e),Sr[e]=i);for(var n=0;n!==e;++n)i[n]=t.allocTextureUnit();return i}function r(t,e){t.uniform1f(this.addr,e)}function o(t,e){t.uniform1i(this.addr,e)}function h(t,e){void 0===e.x?t.uniform2fv(this.addr,e):t.uniform2f(this.addr,e.x,e.y)}function l(t,e){void 0!==e.x?t.uniform3f(this.addr,e.x,e.y,e.z):void 0!==e.r?t.uniform3f(this.addr,e.r,e.g,e.b):t.uniform3fv(this.addr,e)}function u(t,e){void 0===e.x?t.uniform4fv(this.addr,e):t.uniform4f(this.addr,e.x,e.y,e.z,e.w)}function d(t,e){t.uniformMatrix2fv(this.addr,!1,e.elements||e)}function p(t,e){t.uniformMatrix3fv(this.addr,!1,e.elements||e)}function f(t,e){t.uniformMatrix4fv(this.addr,!1,e.elements||e)}function m(t,e,i){var n=i.allocTextureUnit();t.uniform1i(this.addr,n),i.setTexture2D(e||Mr,n)}function g(t,e,i){var n=i.allocTextureUnit();t.uniform1i(this.addr,n),i.setTextureCube(e||Er,n)}function v(t,e){t.uniform2iv(this.addr,e)}function y(t,e){t.uniform3iv(this.addr,e)}function x(t,e){t.uniform4iv(this.addr,e)}function _(t,e){t.uniform1fv(this.addr,e)}function b(t,e){t.uniform1iv(this.addr,e)}function w(t,e){t.uniform2fv(this.addr,i(e,this.size,2))}function M(t,e){t.uniform3fv(this.addr,i(e,this.size,3))}function E(t,e){t.uniform4fv(this.addr,i(e,this.size,4))}function T(t,e){t.uniformMatrix2fv(this.addr,!1,i(e,this.size,4))}function S(t,e){t.uniformMatrix3fv(this.addr,!1,i(e,this.size,9))}function A(t,e){t.uniformMatrix4fv(this.addr,!1,i(e,this.size,16))}function L(t,e,i){var n=e.length,r=a(i,n);for(t.uniform1iv(this.addr,r),t=0;t!==n;++t)i.setTexture2D(e[t]||Mr,r[t])}function R(t,e,i){var n=e.length,r=a(i,n);for(t.uniform1iv(this.addr,r),t=0;t!==n;++t)i.setTextureCube(e[t]||Er,r[t])}function P(t,e,i){this.id=t,this.addr=i,this.setValue=function(t){switch(t){case 5126:return r;case 35664:return h;case 35665:return l;case 35666:return u;case 35674:return d;case 35675:return p;case 35676:return f;case 35678:return m;case 35680:return g;case 5124:case 35670:return o;case 35667:case 35671:return v;case 35668:case 35672:return y;case 35669:case 35673:return x}}(e.type)}function C(t,e,i){this.id=t,this.addr=i,this.size=e.size,this.setValue=function(t){switch(t){case 5126:return _;case 35664:return w;case 35665:return M;case 35666:return E;case 35674:return T;case 35675:return S;case 35676:return A;case 35678:return L;case 35680:return R;case 5124:case 35670:return b;case 35667:case 35671:return v;case 35668:case 35672:return y;case 35669:case 35673:return x}}(e.type)}function I(t){this.id=t,this.seq=[],this.map={}}function Ut(t,e,i){this.seq=[],this.map={},this.renderer=i,i=t.getProgramParameter(e,t.ACTIVE_UNIFORMS);for(var n=0;n!==i;++n){var r=t.getActiveUniform(e,n),a=t.getUniformLocation(e,r.name),o=this,s=r.name,c=s.length;for(Ar.lastIndex=0;;){var h=Ar.exec(s),l=Ar.lastIndex,u=h[1],d=h[3];if("]"===h[2]&&(u|=0),void 0===d||"["===d&&l+2===c){s=o,r=void 0===d?new P(u,r,a):new C(u,r,a),s.seq.push(r),s.map[r.id]=r;break}void 0===(d=o.map[u])&&(d=new I(u),u=o,o=d,u.seq.push(o),u.map[o.id]=o),o=d}}}function Nt(t,e,i){return void 0===e&&void 0===i?this.set(t):this.setRGB(t,e,i)}function U(t,e,i,n,r,a,o,s,c,h,l,u){z.call(this,null,a,o,s,c,h,n,r,l,u),this.image={data:t,width:e,height:i},this.magFilter=void 0!==c?c:1003,this.minFilter=void 0!==h?h:1003,this.flipY=this.generateMipmaps=!1,this.unpackAlignment=1}function O(t,e){this.min=void 0!==t?t:new V(1/0,1/0),this.max=void 0!==e?e:new V(-1/0,-1/0)}function Dt(v,y){var x,_,b,w,M,E,T,S,A,L,R,P,C,I,U,N=v.context,D=v.state;this.render=function(t,e,i){if(0!==y.length){t=new Ct;var n=i.w/i.z,r=.5*i.z,a=.5*i.w,o=new V((l=16/i.w)*n,l),s=new Ct(1,1,0),c=new V(1,1),h=new O;if(h.min.set(i.x,i.y),h.max.set(i.x+(i.z-16),i.y+(i.w-16)),void 0===C){var l=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]),u=new Uint16Array([0,1,2,0,2,3]);R=N.createBuffer(),P=N.createBuffer(),N.bindBuffer(N.ARRAY_BUFFER,R),N.bufferData(N.ARRAY_BUFFER,l,N.STATIC_DRAW),N.bindBuffer(N.ELEMENT_ARRAY_BUFFER,P),N.bufferData(N.ELEMENT_ARRAY_BUFFER,u,N.STATIC_DRAW),I=N.createTexture(),U=N.createTexture(),D.bindTexture(N.TEXTURE_2D,I),N.texImage2D(N.TEXTURE_2D,0,N.RGB,16,16,0,N.RGB,N.UNSIGNED_BYTE,null),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_WRAP_S,N.CLAMP_TO_EDGE),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_WRAP_T,N.CLAMP_TO_EDGE),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_MAG_FILTER,N.NEAREST),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_MIN_FILTER,N.NEAREST),D.bindTexture(N.TEXTURE_2D,U),N.texImage2D(N.TEXTURE_2D,0,N.RGBA,16,16,0,N.RGBA,N.UNSIGNED_BYTE,null),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_WRAP_S,N.CLAMP_TO_EDGE),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_WRAP_T,N.CLAMP_TO_EDGE),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_MAG_FILTER,N.NEAREST),N.texParameteri(N.TEXTURE_2D,N.TEXTURE_MIN_FILTER,N.NEAREST);l={vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif ( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility = visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *= visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",fragmentShader:"uniform lowp int renderType;\nuniform sampler2D map;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif ( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if ( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},u=N.createProgram();var d=N.createShader(N.FRAGMENT_SHADER),p=N.createShader(N.VERTEX_SHADER),f="precision "+v.getPrecision()+" float;\n";N.shaderSource(d,f+l.fragmentShader),N.shaderSource(p,f+l.vertexShader),N.compileShader(d),N.compileShader(p),N.attachShader(u,d),N.attachShader(u,p),N.linkProgram(u),C=u,A=N.getAttribLocation(C,"position"),L=N.getAttribLocation(C,"uv"),x=N.getUniformLocation(C,"renderType"),_=N.getUniformLocation(C,"map"),b=N.getUniformLocation(C,"occlusionMap"),w=N.getUniformLocation(C,"opacity"),M=N.getUniformLocation(C,"color"),E=N.getUniformLocation(C,"scale"),T=N.getUniformLocation(C,"rotation"),S=N.getUniformLocation(C,"screenPosition")}for(N.useProgram(C),D.initAttributes(),D.enableAttribute(A),D.enableAttribute(L),D.disableUnusedAttributes(),N.uniform1i(b,0),N.uniform1i(_,1),N.bindBuffer(N.ARRAY_BUFFER,R),N.vertexAttribPointer(A,2,N.FLOAT,!1,16,0),N.vertexAttribPointer(L,2,N.FLOAT,!1,16,8),N.bindBuffer(N.ELEMENT_ARRAY_BUFFER,P),D.disable(N.CULL_FACE),D.setDepthWrite(!1),u=0,d=y.length;u<d;u++)if(l=16/i.w,o.set(l*n,l),p=y[u],t.set(p.matrixWorld.elements[12],p.matrixWorld.elements[13],p.matrixWorld.elements[14]),t.applyMatrix4(e.matrixWorldInverse),t.applyProjection(e.projectionMatrix),s.copy(t),c.x=i.x+s.x*r+r-8,c.y=i.y+s.y*a+a-8,!0===h.containsPoint(c)){D.activeTexture(N.TEXTURE0),D.bindTexture(N.TEXTURE_2D,null),D.activeTexture(N.TEXTURE1),D.bindTexture(N.TEXTURE_2D,I),N.copyTexImage2D(N.TEXTURE_2D,0,N.RGB,c.x,c.y,16,16,0),N.uniform1i(x,0),N.uniform2f(E,o.x,o.y),N.uniform3f(S,s.x,s.y,s.z),D.disable(N.BLEND),D.enable(N.DEPTH_TEST),N.drawElements(N.TRIANGLES,6,N.UNSIGNED_SHORT,0),D.activeTexture(N.TEXTURE0),D.bindTexture(N.TEXTURE_2D,U),N.copyTexImage2D(N.TEXTURE_2D,0,N.RGBA,c.x,c.y,16,16,0),N.uniform1i(x,1),D.disable(N.DEPTH_TEST),D.activeTexture(N.TEXTURE1),D.bindTexture(N.TEXTURE_2D,I),N.drawElements(N.TRIANGLES,6,N.UNSIGNED_SHORT,0),p.positionScreen.copy(s),p.customUpdateCallback?p.customUpdateCallback(p):p.updateLensFlares(),N.uniform1i(x,2),D.enable(N.BLEND);f=0;for(var m=p.lensFlares.length;f<m;f++){var g=p.lensFlares[f];.001<g.opacity&&.001<g.scale&&(s.x=g.x,s.y=g.y,s.z=g.z,l=g.size*g.scale/i.w,o.x=l*n,o.y=l,N.uniform3f(S,s.x,s.y,s.z),N.uniform2f(E,o.x,o.y),N.uniform1f(T,g.rotation),N.uniform1f(w,g.opacity),N.uniform3f(M,g.color.r,g.color.g,g.color.b),D.setBlending(g.blending,g.blendEquation,g.blendSrc,g.blendDst),v.setTexture2D(g.texture,1),N.drawElements(N.TRIANGLES,6,N.UNSIGNED_SHORT,0))}}D.enable(N.CULL_FACE),D.enable(N.DEPTH_TEST),D.setDepthWrite(!0),v.resetGLState()}}}function Ot(h,l){var u,d,p,f,m,g,v,y,x,_,b,w,M,E,T,S,A;function L(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:e.id-t.id}var R,P,C,I,U=h.context,N=h.state,D=new Ct,O=new s,F=new Ct;this.render=function(t,e){if(0!==l.length){if(void 0===C){var i=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),n=new Uint16Array([0,1,2,0,2,3]);R=U.createBuffer(),P=U.createBuffer(),U.bindBuffer(U.ARRAY_BUFFER,R),U.bufferData(U.ARRAY_BUFFER,i,U.STATIC_DRAW),U.bindBuffer(U.ELEMENT_ARRAY_BUFFER,P),U.bufferData(U.ELEMENT_ARRAY_BUFFER,n,U.STATIC_DRAW);i=U.createProgram(),n=U.createShader(U.VERTEX_SHADER);var r=U.createShader(U.FRAGMENT_SHADER);U.shaderSource(n,["precision "+h.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n")),U.shaderSource(r,["precision "+h.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n")),U.compileShader(n),U.compileShader(r),U.attachShader(i,n),U.attachShader(i,r),U.linkProgram(i),C=i,S=U.getAttribLocation(C,"position"),A=U.getAttribLocation(C,"uv"),u=U.getUniformLocation(C,"uvOffset"),d=U.getUniformLocation(C,"uvScale"),p=U.getUniformLocation(C,"rotation"),f=U.getUniformLocation(C,"scale"),m=U.getUniformLocation(C,"color"),g=U.getUniformLocation(C,"map"),v=U.getUniformLocation(C,"opacity"),y=U.getUniformLocation(C,"modelViewMatrix"),x=U.getUniformLocation(C,"projectionMatrix"),_=U.getUniformLocation(C,"fogType"),b=U.getUniformLocation(C,"fogDensity"),w=U.getUniformLocation(C,"fogNear"),M=U.getUniformLocation(C,"fogFar"),E=U.getUniformLocation(C,"fogColor"),T=U.getUniformLocation(C,"alphaTest"),(i=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")).width=8,i.height=8,(n=i.getContext("2d")).fillStyle="white",n.fillRect(0,0,8,8),(I=new z(i)).needsUpdate=!0}U.useProgram(C),N.initAttributes(),N.enableAttribute(S),N.enableAttribute(A),N.disableUnusedAttributes(),N.disable(U.CULL_FACE),N.enable(U.BLEND),U.bindBuffer(U.ARRAY_BUFFER,R),U.vertexAttribPointer(S,2,U.FLOAT,!1,16,0),U.vertexAttribPointer(A,2,U.FLOAT,!1,16,8),U.bindBuffer(U.ELEMENT_ARRAY_BUFFER,P),U.uniformMatrix4fv(x,!1,e.projectionMatrix.elements),N.activeTexture(U.TEXTURE0),U.uniform1i(g,0),n=i=0,(r=t.fog)?(U.uniform3f(E,r.color.r,r.color.g,r.color.b),r.isFog?(U.uniform1f(w,r.near),U.uniform1f(M,r.far),U.uniform1i(_,1),n=i=1):r.isFogExp2&&(U.uniform1f(b,r.density),U.uniform1i(_,2),n=i=2)):(U.uniform1i(_,0),n=i=0);r=0;for(var a=l.length;r<a;r++){(s=l[r]).modelViewMatrix.multiplyMatrices(e.matrixWorldInverse,s.matrixWorld),s.z=-s.modelViewMatrix.elements[14]}l.sort(L);var o=[];for(r=0,a=l.length;r<a;r++){var s,c=(s=l[r]).material;!1!==c.visible&&(U.uniform1f(T,c.alphaTest),U.uniformMatrix4fv(y,!1,s.modelViewMatrix.elements),s.matrixWorld.decompose(D,O,F),o[0]=F.x,o[1]=F.y,s=0,t.fog&&c.fog&&(s=n),i!==s&&(U.uniform1i(_,s),i=s),null!==c.map?(U.uniform2f(u,c.map.offset.x,c.map.offset.y),U.uniform2f(d,c.map.repeat.x,c.map.repeat.y)):(U.uniform2f(u,0,0),U.uniform2f(d,1,1)),U.uniform1f(v,c.opacity),U.uniform3f(m,c.color.r,c.color.g,c.color.b),U.uniform1f(p,c.rotation),U.uniform2fv(f,o),N.setBlending(c.blending,c.blendEquation,c.blendSrc,c.blendDst),N.setDepthTest(c.depthTest),N.setDepthWrite(c.depthWrite),c.map?h.setTexture2D(c.map,0):h.setTexture2D(I,0),U.drawElements(U.TRIANGLES,6,U.UNSIGNED_SHORT,0))}N.enable(U.CULL_FACE),h.resetGLState()}}}function N(){Object.defineProperty(this,"id",{value:da++}),this.uuid=er.generateUUID(),this.name="",this.type="Material",this.lights=this.fog=!0,this.blending=1,this.side=0,this.shading=2,this.vertexColors=0,this.opacity=1,this.transparent=!1,this.blendSrc=204,this.blendDst=205,this.blendEquation=100,this.blendEquationAlpha=this.blendDstAlpha=this.blendSrcAlpha=null,this.depthFunc=3,this.depthWrite=this.depthTest=!0,this.clippingPlanes=null,this.clipShadows=this.clipIntersection=!1,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0,this.premultipliedAlpha=!1,this.overdraw=0,this._needsUpdate=this.visible=!0}function Ft(t){N.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.morphNormals=this.morphTargets=this.skinning=this.clipping=this.lights=this.fog=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},(this.index0AttributeName=void 0)!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function G(t){N.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.morphTargets=this.skinning=!1,this.displacementMap=this.alphaMap=this.map=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.lights=this.fog=!1,this.setValues(t)}function D(t,e){this.min=void 0!==t?t:new Ct(1/0,1/0,1/0),this.max=void 0!==e?e:new Ct(-1/0,-1/0,-1/0)}function zt(t,e){this.center=void 0!==t?t:new Ct,this.radius=void 0!==e?e:0}function F(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]),0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}function H(t,e){this.normal=void 0!==t?t:new Ct(1,0,0),this.constant=void 0!==e?e:0}function Bt(t,e,i,n,r,a){this.planes=[void 0!==t?t:new H,void 0!==e?e:new H,void 0!==i?i:new H,void 0!==n?n:new H,void 0!==r?r:new H,void 0!==a?a:new H]}function Gt(_,t,b,e){function w(t,e,i,n){var r,a=t.geometry;r=s;var o=t.customDepthMaterial;return i&&(r=c,o=t.customDistanceMaterial),r=o||(o=!1,e.morphTargets&&(a&&a.isBufferGeometry?o=a.morphAttributes&&a.morphAttributes.position&&0<a.morphAttributes.position.length:a&&a.isGeometry&&(o=a.morphTargets&&0<a.morphTargets.length)),a=0,o&&(a|=1),(t=t.isSkinnedMesh&&e.skinning)&&(a|=2),r[a]),_.localClippingEnabled&&!0===e.clipShadows&&0!==e.clippingPlanes.length&&(a=r.uuid,o=e.uuid,void 0===(t=h[a])&&(t={},h[a]=t),void 0===(a=t[o])&&(a=r.clone(),t[o]=a),r=a),r.visible=e.visible,r.wireframe=e.wireframe,o=e.side,F.renderSingleSided&&2==o&&(o=0),F.renderReverseSided&&(0===o?o=1:1===o&&(o=0)),r.side=o,r.clipShadows=e.clipShadows,r.clippingPlanes=e.clippingPlanes,r.wireframeLinewidth=e.wireframeLinewidth,r.linewidth=e.linewidth,i&&void 0!==r.uniforms.lightPos&&r.uniforms.lightPos.value.copy(n),r}function M(t,e,i){if(!1!==t.visible){0!=(t.layers.mask&e.layers.mask)&&(t.isMesh||t.isLine||t.isPoints)&&t.castShadow&&(!1===t.frustumCulled||!0===S.intersectsObject(t))&&!0===t.material.visible&&(t.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,t.matrixWorld),U.push(t));for(var n=0,r=(t=t.children).length;n<r;n++)M(t[n],e,i)}}var E=_.context,T=_.state,S=new Bt,A=new It,L=t.shadows,R=new V,P=new V(e.maxTextureSize,e.maxTextureSize),C=new Ct,I=new Ct,U=[],s=Array(4),c=Array(4),h={},N=[new Ct(1,0,0),new Ct(-1,0,0),new Ct(0,0,1),new Ct(0,0,-1),new Ct(0,1,0),new Ct(0,-1,0)],D=[new Ct(0,1,0),new Ct(0,1,0),new Ct(0,1,0),new Ct(0,1,0),new Ct(0,0,1),new Ct(0,0,-1)],O=[new Pt,new Pt,new Pt,new Pt,new Pt,new Pt];(t=new G).depthPacking=3201,t.clipping=!0,e=Nr.distanceRGBA;for(var i=Lr.clone(e.uniforms),n=0;4!==n;++n){var r=0!=(1&n),a=0!=(2&n),o=t.clone();o.morphTargets=r,o.skinning=a,s[n]=o,r=new Ft({defines:{USE_SHADOWMAP:""},uniforms:i,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,morphTargets:r,skinning:a,clipping:!0}),c[n]=r}var F=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1,this.renderSingleSided=this.renderReverseSided=!0,this.render=function(t,e){if(!1!==F.enabled&&(!1!==F.autoUpdate||!1!==F.needsUpdate)&&0!==L.length){T.buffers.color.setClear(1,1,1,1),T.disable(E.BLEND),T.setDepthTest(!0),T.setScissorTest(!1);for(var i,n,r=0,a=L.length;r<a;r++){var o=L[r],s=o.shadow;if(void 0===s)console.warn("THREE.WebGLShadowMap:",o,"has no shadow.");else{var c=s.camera;if(R.copy(s.mapSize),R.min(P),o&&o.isPointLight){i=6,n=!0;var h=R.x,l=R.y;O[0].set(2*h,l,h,l),O[1].set(0,l,h,l),O[2].set(3*h,l,h,l),O[3].set(h,l,h,l),O[4].set(3*h,0,h,l),O[5].set(h,0,h,l),R.x*=4,R.y*=2}else n=!(i=1);for(null===s.map&&(s.map=new B(R.x,R.y,{minFilter:1003,magFilter:1003,format:1023}),c.updateProjectionMatrix()),s.isSpotLightShadow&&s.update(o),s&&s.isRectAreaLightShadow&&s.update(o),h=s.map,s=s.matrix,I.setFromMatrixPosition(o.matrixWorld),c.position.copy(I),_.setRenderTarget(h),_.clear(),h=0;h<i;h++){n?(C.copy(c.position),C.add(N[h]),c.up.copy(D[h]),c.lookAt(C),T.viewport(O[h])):(C.setFromMatrixPosition(o.target.matrixWorld),c.lookAt(C)),c.updateMatrixWorld(),c.matrixWorldInverse.getInverse(c.matrixWorld),s.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),s.multiply(c.projectionMatrix),s.multiply(c.matrixWorldInverse),A.multiplyMatrices(c.projectionMatrix,c.matrixWorldInverse),S.setFromMatrix(A),U.length=0,M(t,e,c);l=0;for(var u=U.length;l<u;l++){var d=U[l],p=b.update(d);if((m=d.material)&&m.isMultiMaterial)for(var f=p.groups,m=m.materials,g=0,v=f.length;g<v;g++){var y=f[g],x=m[y.materialIndex];!0===x.visible&&(x=w(d,x,n,I),_.renderBufferDirect(c,null,p,x,d,y))}else x=w(d,m,n,I),_.renderBufferDirect(c,null,p,x,d,null)}}}}i=_.getClearColor(),n=_.getClearAlpha(),_.setClearColor(i,n),F.needsUpdate=!1}}}function k(t,e){this.origin=void 0!==t?t:new Ct,this.direction=void 0!==e?e:new Ct}function j(t,e,i,n){this._x=t||0,this._y=e||0,this._z=i||0,this._order=n||j.DefaultOrder}function W(){this.mask=1}function X(){Object.defineProperty(this,"id",{value:qa++}),this.uuid=er.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=X.DefaultUp.clone();var t=new Ct,e=new j,i=new s,n=new Ct(1,1,1);e.onChange(function(){i.setFromEuler(e,!1)}),i.onChange(function(){e.setFromQuaternion(i,void 0,!1)}),Object.defineProperties(this,{position:{enumerable:!0,value:t},rotation:{enumerable:!0,value:e},quaternion:{enumerable:!0,value:i},scale:{enumerable:!0,value:n},modelViewMatrix:{value:new It},normalMatrix:{value:new F}}),this.matrix=new It,this.matrixWorld=new It,this.matrixAutoUpdate=X.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new W,this.visible=!0,this.receiveShadow=this.castShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={},this.onBeforeRender=function(){},this.onAfterRender=function(){}}function Y(t,e){this.start=void 0!==t?t:new Ct,this.end=void 0!==e?e:new Ct}function q(t,e,i){this.a=void 0!==t?t:new Ct,this.b=void 0!==e?e:new Ct,this.c=void 0!==i?i:new Ct}function Z(t,e,i,n,r,a){this.a=t,this.b=e,this.c=i,this.normal=n&&n.isVector3?n:new Ct,this.vertexNormals=Array.isArray(n)?n:[],this.color=r&&r.isColor?r:new Nt,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==a?a:0}function Ht(t){N.call(this),this.type="MeshBasicMaterial",this.color=new Nt(16777215),this.lightMap=this.map=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.envMap=this.alphaMap=this.specularMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.lights=this.morphTargets=this.skinning=!1,this.setValues(t)}function J(t,e,i){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.uuid=er.generateUUID(),this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===i,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function Q(t,e){J.call(this,new Int8Array(t),e)}function K(t,e){J.call(this,new Uint8Array(t),e)}function $(t,e){J.call(this,new Uint8ClampedArray(t),e)}function tt(t,e){J.call(this,new Int16Array(t),e)}function et(t,e){J.call(this,new Uint16Array(t),e)}function it(t,e){J.call(this,new Int32Array(t),e)}function nt(t,e){J.call(this,new Uint32Array(t),e)}function rt(t,e){J.call(this,new Float32Array(t),e)}function at(t,e){J.call(this,new Float64Array(t),e)}function ot(){this.indices=[],this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingSphere=this.boundingBox=null,this.groupsNeedUpdate=this.uvsNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.verticesNeedUpdate=!1}function st(){Object.defineProperty(this,"id",{value:ao++}),this.uuid=er.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingSphere=this.boundingBox=null,this.groupsNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=this.verticesNeedUpdate=this.elementsNeedUpdate=!1}function Vt(){Object.defineProperty(this,"id",{value:ao++}),this.uuid=er.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingSphere=this.boundingBox=null,this.drawRange={start:0,count:1/0}}function kt(t,e){X.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new Vt,this.material=void 0!==e?e:new Ht({color:16777215*Math.random()}),this.drawMode=0,this.updateMorphTargets()}function jt(t,e,i,n,r,a){function o(t,e,i,n,r,a,o,s,c,h,l){var u=a/c,d=o/h,p=a/2,f=o/2,m=s/2;o=c+1;for(var g=h+1,v=a=0,y=new Ct,x=0;x<g;x++)for(var _=x*d-f,b=0;b<o;b++)y[t]=(b*u-p)*n,y[e]=_*r,y[i]=m,E[A]=y.x,E[A+1]=y.y,E[A+2]=y.z,y[t]=0,y[e]=0,y[i]=0<s?1:-1,T[A]=y.x,T[A+1]=y.y,T[A+2]=y.z,S[L]=b/c,S[L+1]=1-x/h,A+=3,L+=2,a+=1;for(x=0;x<h;x++)for(b=0;b<c;b++)t=P+b+o*(x+1),e=P+(b+1)+o*(x+1),i=P+(b+1)+o*x,M[R]=P+b+o*x,M[R+1]=t,M[R+2]=i,M[R+3]=t,M[R+4]=e,M[R+5]=i,R+=6,v+=6;w.addGroup(C,v,l),C+=v,P+=a}Vt.call(this),this.type="BoxBufferGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:n,heightSegments:r,depthSegments:a};var s,w=this,c=0+((n=Math.floor(n)||1)+1)*((r=Math.floor(r)||1)+1)*2+(n+1)*((a=Math.floor(a)||1)+1)*2+(a+1)*(r+1)*2,h=6*(s=0+(s=n)*r*2+s*a*2+a*r*2),M=new(65535<h?Uint32Array:Uint16Array)(h),E=new Float32Array(3*c),T=new Float32Array(3*c),S=new Float32Array(2*c),A=0,L=0,R=0,P=0,C=0;o("z","y","x",-1,-1,i,e,t,a,r,0),o("z","y","x",1,-1,i,e,-t,a,r,1),o("x","z","y",1,1,t,i,e,n,a,2),o("x","z","y",1,-1,t,i,-e,n,a,3),o("x","y","z",1,-1,t,e,i,n,r,4),o("x","y","z",-1,-1,t,e,-i,n,r,5),this.setIndex(new J(M,1)),this.addAttribute("position",new J(E,3)),this.addAttribute("normal",new J(T,3)),this.addAttribute("uv",new J(S,2))}function Wt(t,e,i,n){Vt.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:n};var r=t/2,a=e/2,o=(i=Math.floor(i)||1)+1,s=(n=Math.floor(n)||1)+1,c=t/i,h=e/n;e=new Float32Array(o*s*3),t=new Float32Array(o*s*3);for(var l=new Float32Array(o*s*2),u=0,d=0,p=0;p<s;p++)for(var f=p*h-a,m=0;m<o;m++)e[u]=m*c-r,e[u+1]=-f,t[u+2]=1,l[d]=m/i,l[d+1]=1-p/n,u+=3,d+=2;for(u=0,r=new(65535<e.length/3?Uint32Array:Uint16Array)(i*n*6),p=0;p<n;p++)for(m=0;m<i;m++)a=m+o*(p+1),s=m+1+o*(p+1),c=m+1+o*p,r[u]=m+o*p,r[u+1]=a,r[u+2]=c,r[u+3]=a,r[u+4]=s,r[u+5]=c,u+=6;this.setIndex(new J(r,1)),this.addAttribute("position",new J(e,3)),this.addAttribute("normal",new J(t,3)),this.addAttribute("uv",new J(l,2))}function ct(){X.call(this),this.type="Camera",this.matrixWorldInverse=new It,this.projectionMatrix=new It}function Xt(t,e,i,n){ct.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==i?i:.1,this.far=void 0!==n?n:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function Yt(t,e,i,n,r,a){ct.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=i,this.bottom=n,this.near=void 0!==r?r:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()}function qt(r,a,o){var s,c,h;return{setMode:function(t){s=t},setIndex:function(t){h=t.array instanceof Uint32Array&&a.get("OES_element_index_uint")?(c=r.UNSIGNED_INT,4):t.array instanceof Uint16Array?(c=r.UNSIGNED_SHORT,2):(c=r.UNSIGNED_BYTE,1)},render:function(t,e){r.drawElements(s,e,c,t*h),o.calls++,o.vertices+=e,s===r.TRIANGLES&&(o.faces+=e/3)},renderInstances:function(t,e,i){var n=a.get("ANGLE_instanced_arrays");null===n?console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."):(n.drawElementsInstancedANGLE(s,i,c,e*h,t.maxInstancedCount),o.calls++,o.vertices+=i*t.maxInstancedCount,s===r.TRIANGLES&&(o.faces+=t.maxInstancedCount*i/3))}}}function Zt(n,r,a){var o;return{setMode:function(t){o=t},render:function(t,e){n.drawArrays(o,t,e),a.calls++,a.vertices+=e,o===n.TRIANGLES&&(a.faces+=e/3)},renderInstances:function(t){var e=r.get("ANGLE_instanced_arrays");if(null===e)console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");else{var i=(i=t.attributes.position).isInterleavedBufferAttribute?i.data.count:i.count;e.drawArraysInstancedANGLE(o,0,i,t.maxInstancedCount),a.calls++,a.vertices+=i*t.maxInstancedCount,o===n.TRIANGLES&&(a.faces+=t.maxInstancedCount*i/3)}}}}function Jt(){var i={};return{get:function(t){if(void 0!==i[t.id])return i[t.id];var e;switch(t.type){case"DirectionalLight":e={direction:new Ct,color:new Nt,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new V};break;case"SpotLight":e={position:new Ct,direction:new Ct,color:new Nt,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new V};break;case"PointLight":e={position:new Ct,color:new Nt,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new V};break;case"HemisphereLight":e={direction:new Ct,skyColor:new Nt,groundColor:new Nt};break;case"RectAreaLight":e={color:new Nt,position:new Ct,halfWidth:new Ct,halfHeight:new Ct}}return i[t.id]=e}}}function ht(t,e,i){var n=t.createShader(e);return t.shaderSource(n,i),t.compileShader(n),!1===t.getShaderParameter(n,t.COMPILE_STATUS)&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==t.getShaderInfoLog(n)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",e===t.VERTEX_SHADER?"vertex":"fragment",t.getShaderInfoLog(n),function(t){t=t.split("\n");for(var e=0;e<t.length;e++)t[e]=e+1+": "+t[e];return t.join("\n")}(i)),n}function lt(t){switch(t){case 3e3:return["Linear","( value )"];case 3001:return["sRGB","( value )"];case 3002:return["RGBE","( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case 3007:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw Error("unsupported encoding: "+t)}}function ut(t,e){var i=lt(e);return"vec4 "+t+"( vec4 value ) { return "+i[0]+"ToLinear"+i[1]+"; }"}function dt(t){return""!==t}function pt(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights)}function ft(t){return t.replace(/#include +<([\w\d.]+)>/g,function(t,e){var i=Rr[e];if(void 0===i)throw Error("Can not resolve #include <"+e+">");return ft(i)})}function mt(t){return t.replace(/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,function(t,e,i,n){for(t="",e=parseInt(e);e<parseInt(i);e++)t+=n.replace(/\[ i \]/g,"[ "+e+" ]");return t})}function gt(t,e,i,n){var r=t.context,a=i.extensions,o=i.defines,s=i.__webglShader.vertexShader,c=i.__webglShader.fragmentShader,h="SHADOWMAP_TYPE_BASIC";1===n.shadowMapType?h="SHADOWMAP_TYPE_PCF":2===n.shadowMapType&&(h="SHADOWMAP_TYPE_PCF_SOFT");var l="ENVMAP_TYPE_CUBE",u="ENVMAP_MODE_REFLECTION",d="ENVMAP_BLENDING_MULTIPLY";if(n.envMap){switch(i.envMap.mapping){case 301:case 302:l="ENVMAP_TYPE_CUBE";break;case 306:case 307:l="ENVMAP_TYPE_CUBE_UV";break;case 303:case 304:l="ENVMAP_TYPE_EQUIREC";break;case 305:l="ENVMAP_TYPE_SPHERE"}switch(i.envMap.mapping){case 302:case 304:u="ENVMAP_MODE_REFRACTION"}switch(i.combine){case 0:d="ENVMAP_BLENDING_MULTIPLY";break;case 1:d="ENVMAP_BLENDING_MIX";break;case 2:d="ENVMAP_BLENDING_ADD"}}var p,f,m=0<t.gammaFactor?t.gammaFactor:1,g=(a=function(t,e,i){return[(t=t||{}).derivatives||e.envMapCubeUV||e.bumpMap||e.normalMap||e.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(t.fragDepth||e.logarithmicDepthBuffer)&&i.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",t.drawBuffers&&i.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(t.shaderTextureLOD||e.envMap)&&i.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(dt).join("\n")}(a,n,t.extensions),function(t){var e,i=[];for(e in t){var n=t[e];!1!==n&&i.push("#define "+e+" "+n)}return i.join("\n")}(o)),v=r.createProgram();return h=i.isRawShaderMaterial?(o=[g,"\n"].filter(dt).join("\n"),[a,g,"\n"].filter(dt).join("\n")):(o=["precision "+n.precision+" float;","precision "+n.precision+" int;","#define SHADER_NAME "+i.__webglShader.name,g,n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+m,"#define MAX_BONES "+n.maxBones,n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.vertexColors?"#define USE_COLOR":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+n.numClippingPlanes,n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+h:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&t.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(dt).join("\n"),[a,"precision "+n.precision+" float;","precision "+n.precision+" int;","#define SHADER_NAME "+i.__webglShader.name,g,n.alphaTest?"#define ALPHATEST "+n.alphaTest:"","#define GAMMA_FACTOR "+m,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+l:"",n.envMap?"#define "+u:"",n.envMap?"#define "+d:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.vertexColors?"#define USE_COLOR":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"","#define NUM_CLIPPING_PLANES "+n.numClippingPlanes,"#define UNION_CLIPPING_PLANES "+(n.numClippingPlanes-n.numClipIntersection),n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+h:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&t.extensions.get("EXT_frag_depth")?"#define USE_LOGDEPTHBUF_EXT":"",n.envMap&&t.extensions.get("EXT_shader_texture_lod")?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?Rr.tonemapping_pars_fragment:"",0!==n.toneMapping?function(t,e){var i;switch(e){case 1:i="Linear";break;case 2:i="Reinhard";break;case 3:i="Uncharted2";break;case 4:i="OptimizedCineon";break;default:throw Error("unsupported toneMapping: "+e)}return"vec3 "+t+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}("toneMapping",n.toneMapping):"",n.outputEncoding||n.mapEncoding||n.envMapEncoding||n.emissiveMapEncoding?Rr.encodings_pars_fragment:"",n.mapEncoding?ut("mapTexelToLinear",n.mapEncoding):"",n.envMapEncoding?ut("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMapEncoding?ut("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.outputEncoding?function(t,e){var i=lt(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+i[0]+i[1]+"; }"}("linearToOutputTexel",n.outputEncoding):"",n.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(dt).join("\n")),s=pt(s=ft(s),n),c=pt(c=ft(c),n),i.isShaderMaterial||(s=mt(s),c=mt(c)),c=h+c,s=ht(r,r.VERTEX_SHADER,o+s),c=ht(r,r.FRAGMENT_SHADER,c),r.attachShader(v,s),r.attachShader(v,c),void 0!==i.index0AttributeName?r.bindAttribLocation(v,0,i.index0AttributeName):!0===n.morphTargets&&r.bindAttribLocation(v,0,"position"),r.linkProgram(v),n=r.getProgramInfoLog(v),l=r.getShaderInfoLog(s),u=r.getShaderInfoLog(c),m=d=!0,!1===r.getProgramParameter(v,r.LINK_STATUS)?(d=!1,console.error("THREE.WebGLProgram: shader error: ",r.getError(),"gl.VALIDATE_STATUS",r.getProgramParameter(v,r.VALIDATE_STATUS),"gl.getProgramInfoLog",n,l,u)):""!==n?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",n):""!==l&&""!==u||(m=!1),m&&(this.diagnostics={runnable:d,material:i,programLog:n,vertexShader:{log:l,prefix:o},fragmentShader:{log:u,prefix:h}}),r.deleteShader(s),r.deleteShader(c),this.getUniforms=function(){return void 0===p&&(p=new Ut(r,v,t)),p},this.getAttributes=function(){if(void 0===f){for(var t={},e=r.getProgramParameter(v,r.ACTIVE_ATTRIBUTES),i=0;i<e;i++){var n=r.getActiveAttrib(v,i).name;t[n]=r.getAttribLocation(v,n)}f=t}return f},this.destroy=function(){r.deleteProgram(v),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.id=yo++,this.code=e,this.usedTimes=1,this.program=v,this.vertexShader=s,this.fragmentShader=c,this}function Qt(l,u){function d(t,e){var i;return t?t.isTexture?i=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),i=t.texture.encoding):i=3e3,3e3===i&&e&&(i=3007),i}var s=[],p={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points"},r="precision supportsVertexTextures map mapEncoding envMap envMapMode envMapEncoding lightMap aoMap emissiveMap emissiveMapEncoding bumpMap normalMap displacementMap specularMap roughnessMap metalnessMap gradientMap alphaMap combine vertexColors fog useFog fogExp flatShading sizeAttenuation logarithmicDepthBuffer skinning maxBones useVertexTexture morphTargets morphNormals maxMorphTargets maxMorphNormals premultipliedAlpha numDirLights numPointLights numSpotLights numHemiLights numRectAreaLights shadowMapEnabled shadowMapType toneMapping physicallyCorrectLights alphaTest doubleSided flipSided numClippingPlanes numClipIntersection depthPacking".split(" ");this.getParameters=function(t,e,i,n,r,a){var o,s=p[t.type];u.floatVertexTextures&&a&&a.skeleton&&a.skeleton.useVertexTexture?o=1024:(o=Math.floor((u.maxVertexUniforms-20)/4),void 0!==a&&a&&a.isSkinnedMesh&&((o=Math.min(a.skeleton.bones.length,o))<a.skeleton.bones.length&&console.warn("WebGLRenderer: too many bones - "+a.skeleton.bones.length+", this GPU supports just "+o+" (try OpenGL instead of ANGLE)")));var c=l.getPrecision();null!==t.precision&&((c=u.getMaxPrecision(t.precision))!==t.precision&&console.warn("THREE.WebGLProgram.getParameters:",t.precision,"not supported, using",c,"instead."));var h=l.getCurrentRenderTarget();return{shaderID:s,precision:c,supportsVertexTextures:u.vertexTextures,outputEncoding:d(h?h.texture:null,l.gammaOutput),map:!!t.map,mapEncoding:d(t.map,l.gammaInput),envMap:!!t.envMap,envMapMode:t.envMap&&t.envMap.mapping,envMapEncoding:d(t.envMap,l.gammaInput),envMapCubeUV:!!t.envMap&&(306===t.envMap.mapping||307===t.envMap.mapping),lightMap:!!t.lightMap,aoMap:!!t.aoMap,emissiveMap:!!t.emissiveMap,emissiveMapEncoding:d(t.emissiveMap,l.gammaInput),bumpMap:!!t.bumpMap,normalMap:!!t.normalMap,displacementMap:!!t.displacementMap,roughnessMap:!!t.roughnessMap,metalnessMap:!!t.metalnessMap,specularMap:!!t.specularMap,alphaMap:!!t.alphaMap,gradientMap:!!t.gradientMap,combine:t.combine,vertexColors:t.vertexColors,fog:!!i,useFog:t.fog,fogExp:i&&i.isFogExp2,flatShading:1===t.shading,sizeAttenuation:t.sizeAttenuation,logarithmicDepthBuffer:u.logarithmicDepthBuffer,skinning:t.skinning,maxBones:o,useVertexTexture:u.floatVertexTextures&&a&&a.skeleton&&a.skeleton.useVertexTexture,morphTargets:t.morphTargets,morphNormals:t.morphNormals,maxMorphTargets:l.maxMorphTargets,maxMorphNormals:l.maxMorphNormals,numDirLights:e.directional.length,numPointLights:e.point.length,numSpotLights:e.spot.length,numRectAreaLights:e.rectArea.length,numHemiLights:e.hemi.length,numClippingPlanes:n,numClipIntersection:r,shadowMapEnabled:l.shadowMap.enabled&&a.receiveShadow&&0<e.shadows.length,shadowMapType:l.shadowMap.type,toneMapping:l.toneMapping,physicallyCorrectLights:l.physicallyCorrectLights,premultipliedAlpha:t.premultipliedAlpha,alphaTest:t.alphaTest,doubleSided:2===t.side,flipSided:1===t.side,depthPacking:void 0!==t.depthPacking&&t.depthPacking}},this.getProgramCode=function(t,e){var i=[];if(e.shaderID?i.push(e.shaderID):(i.push(t.fragmentShader),i.push(t.vertexShader)),void 0!==t.defines)for(var n in t.defines)i.push(n),i.push(t.defines[n]);for(n=0;n<r.length;n++)i.push(e[r[n]]);return i.join()},this.acquireProgram=function(t,e,i){for(var n,r=0,a=s.length;r<a;r++){var o=s[r];if(o.code===i){++(n=o).usedTimes;break}}return void 0===n&&(n=new gt(l,i,t,e),s.push(n)),n},this.releaseProgram=function(t){if(0==--t.usedTimes){var e=s.indexOf(t);s[e]=s[s.length-1],s.pop(),t.destroy()}},this.programs=s}function vt(i,r,a){function o(t){var e=t.target;null!==(t=c[e.id]).index&&s(t.index);var i,n=t.attributes;for(i in n)s(n[i]);e.removeEventListener("dispose",o),delete c[e.id],(i=r.get(e)).wireframe&&s(i.wireframe),r.delete(e),(e=r.get(t)).wireframe&&s(e.wireframe),r.delete(t),a.memory.geometries--}function s(t){var e;void 0!==(e=t.isInterleavedBufferAttribute?r.get(t.data).__webglBuffer:r.get(t).__webglBuffer)&&(i.deleteBuffer(e),t.isInterleavedBufferAttribute?r.delete(t.data):r.delete(t))}var c={};return{get:function(t){var e,i=t.geometry;return void 0!==c[i.id]?c[i.id]:(i.addEventListener("dispose",o),i.isBufferGeometry?e=i:i.isGeometry&&(void 0===i._bufferGeometry&&(i._bufferGeometry=(new Vt).setFromObject(t)),e=i._bufferGeometry),c[i.id]=e,a.memory.geometries++,e)}}}function Kt(h,l,t){function u(t,e){var i=t.isInterleavedBufferAttribute?t.data:t,n=l.get(i);if(void 0===n.__webglBuffer){n.__webglBuffer=h.createBuffer(),h.bindBuffer(e,n.__webglBuffer),h.bufferData(e,i.array,i.dynamic?h.DYNAMIC_DRAW:h.STATIC_DRAW);var r=h.FLOAT,a=i.array;a instanceof Float32Array?r=h.FLOAT:a instanceof Float64Array?console.warn("Unsupported data buffer format: Float64Array"):a instanceof Uint16Array?r=h.UNSIGNED_SHORT:a instanceof Int16Array?r=h.SHORT:a instanceof Uint32Array?r=h.UNSIGNED_INT:a instanceof Int32Array?r=h.INT:a instanceof Int8Array?r=h.BYTE:a instanceof Uint8Array&&(r=h.UNSIGNED_BYTE),n.bytesPerElement=a.BYTES_PER_ELEMENT,n.type=r,n.version=i.version,i.onUploadCallback()}else n.version!==i.version&&(h.bindBuffer(e,n.__webglBuffer),!1===i.dynamic?h.bufferData(e,i.array,h.STATIC_DRAW):-1===i.updateRange.count?h.bufferSubData(e,0,i.array):0===i.updateRange.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you're using set methods or updating manually."):(h.bufferSubData(e,i.updateRange.offset*i.array.BYTES_PER_ELEMENT,i.array.subarray(i.updateRange.offset,i.updateRange.offset+i.updateRange.count)),i.updateRange.count=0),n.version=i.version)}var o=new vt(h,l,t);return{getAttributeBuffer:function(t){return t.isInterleavedBufferAttribute?l.get(t.data).__webglBuffer:l.get(t).__webglBuffer},getAttributeProperties:function(t){return t.isInterleavedBufferAttribute?l.get(t.data):l.get(t)},getWireframeAttribute:function(t){var e=l.get(t);if(void 0!==e.wireframe)return e.wireframe;var i=[],n=t.index;if(t=(r=t.attributes).position,null!==n)for(var r=0,a=(n=n.array).length;r<a;r+=3){var o=n[r+0],s=n[r+1],c=n[r+2];i.push(o,s,s,c,c,o)}else for(n=r.position.array,r=0,a=n.length/3-1;r<a;r+=3)o=r+0,s=r+1,c=r+2,i.push(o,s,s,c,c,o);return u(i=new J(new(65535<t.count?Uint32Array:Uint16Array)(i),1),h.ELEMENT_ARRAY_BUFFER),e.wireframe=i},update:function(t){var e=o.get(t);t.geometry.isGeometry&&e.updateFromObject(t),t=e.index;var i=e.attributes;for(var n in null!==t&&u(t,h.ELEMENT_ARRAY_BUFFER),i)u(i[n],h.ARRAY_BUFFER);for(n in t=e.morphAttributes)for(var r=0,a=(i=t[n]).length;r<a;r++)u(i[r],h.ARRAY_BUFFER);return e}}}function $t(f,n,m,g,v,y,t){function x(t,e){if(t.width>e||t.height>e){var i=e/Math.max(t.width,t.height),n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return n.width=Math.floor(t.width*i),n.height=Math.floor(t.height*i),n.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,n.width,n.height),console.warn("THREE.WebGLRenderer: image is too big ("+t.width+"x"+t.height+"). Resized to "+n.width+"x"+n.height,t),n}return t}function _(t){return er.isPowerOfTwo(t.width)&&er.isPowerOfTwo(t.height)}function r(t){return 1003===t||1004===t||1005===t?f.NEAREST:f.LINEAR}function b(t){(t=t.target).removeEventListener("dispose",b);t:{var e=g.get(t);if(t.image&&e.__image__webglTextureCube)f.deleteTexture(e.__image__webglTextureCube);else{if(void 0===e.__webglInit)break t;f.deleteTexture(e.__webglTexture)}g.delete(t)}M.textures--}function o(t){(t=t.target).removeEventListener("dispose",o);var e=g.get(t),i=g.get(t.texture);if(t){if(void 0!==i.__webglTexture&&f.deleteTexture(i.__webglTexture),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLRenderTargetCube)for(i=0;i<6;i++)f.deleteFramebuffer(e.__webglFramebuffer[i]),e.__webglDepthbuffer&&f.deleteRenderbuffer(e.__webglDepthbuffer[i]);else f.deleteFramebuffer(e.__webglFramebuffer),e.__webglDepthbuffer&&f.deleteRenderbuffer(e.__webglDepthbuffer);g.delete(t.texture),g.delete(t)}M.textures--}function s(t,e){var i=g.get(t);if(0<t.version&&i.__version!==t.version)if(void 0===(r=t.image))console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",t);else{if(!1!==r.complete){void 0===i.__webglInit&&(i.__webglInit=!0,t.addEventListener("dispose",b),i.__webglTexture=f.createTexture(),M.textures++),m.activeTexture(f.TEXTURE0+e),m.bindTexture(f.TEXTURE_2D,i.__webglTexture),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,t.flipY),f.pixelStorei(f.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),f.pixelStorei(f.UNPACK_ALIGNMENT,t.unpackAlignment);var n=x(t.image,v.maxTextureSize);if((1001!==t.wrapS||1001!==t.wrapT||1003!==t.minFilter&&1006!==t.minFilter)&&!1===_(n))if((r=n)instanceof HTMLImageElement||r instanceof HTMLCanvasElement){(a=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")).width=er.nearestPowerOfTwo(r.width),a.height=er.nearestPowerOfTwo(r.height),a.getContext("2d").drawImage(r,0,0,a.width,a.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+r.width+"x"+r.height+"). Resized to "+a.width+"x"+a.height,r),n=a}else n=r;var r=_(n),a=y(t.format),o=y(t.type);w(f.TEXTURE_2D,t,r);var s=t.mipmaps;if(t.isDepthTexture){if(s=f.DEPTH_COMPONENT,1015===t.type){if(!l)throw Error("Float Depth Texture only supported in WebGL2.0");s=f.DEPTH_COMPONENT32F}else l&&(s=f.DEPTH_COMPONENT16);1026===t.format&&s===f.DEPTH_COMPONENT&&1012!==t.type&&1014!==t.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),t.type=1012,o=y(t.type)),1027===t.format&&(s=f.DEPTH_STENCIL,1020!==t.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),t.type=1020,o=y(t.type))),m.texImage2D(f.TEXTURE_2D,0,s,n.width,n.height,0,a,o,null)}else if(t.isDataTexture)if(0<s.length&&r){for(var c=0,h=s.length;c<h;c++)n=s[c],m.texImage2D(f.TEXTURE_2D,c,a,n.width,n.height,0,a,o,n.data);t.generateMipmaps=!1}else m.texImage2D(f.TEXTURE_2D,0,a,n.width,n.height,0,a,o,n.data);else if(t.isCompressedTexture)for(c=0,h=s.length;c<h;c++)n=s[c],1023!==t.format&&1022!==t.format?-1<m.getCompressedTextureFormats().indexOf(a)?m.compressedTexImage2D(f.TEXTURE_2D,c,a,n.width,n.height,0,n.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):m.texImage2D(f.TEXTURE_2D,c,a,n.width,n.height,0,a,o,n.data);else if(0<s.length&&r){for(c=0,h=s.length;c<h;c++)n=s[c],m.texImage2D(f.TEXTURE_2D,c,a,a,o,n);t.generateMipmaps=!1}else m.texImage2D(f.TEXTURE_2D,0,a,a,o,n);return t.generateMipmaps&&r&&f.generateMipmap(f.TEXTURE_2D),i.__version=t.version,void(t.onUpdate&&t.onUpdate(t))}console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",t)}m.activeTexture(f.TEXTURE0+e),m.bindTexture(f.TEXTURE_2D,i.__webglTexture)}function w(t,e,i){i?(f.texParameteri(t,f.TEXTURE_WRAP_S,y(e.wrapS)),f.texParameteri(t,f.TEXTURE_WRAP_T,y(e.wrapT)),f.texParameteri(t,f.TEXTURE_MAG_FILTER,y(e.magFilter)),f.texParameteri(t,f.TEXTURE_MIN_FILTER,y(e.minFilter))):(f.texParameteri(t,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(t,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),1001===e.wrapS&&1001===e.wrapT||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.",e),f.texParameteri(t,f.TEXTURE_MAG_FILTER,r(e.magFilter)),f.texParameteri(t,f.TEXTURE_MIN_FILTER,r(e.minFilter)),1003!==e.minFilter&&1006!==e.minFilter&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.",e)),!(i=n.get("EXT_texture_filter_anisotropic"))||1015===e.type&&null===n.get("OES_texture_float_linear")||1016===e.type&&null===n.get("OES_texture_half_float_linear")||!(1<e.anisotropy||g.get(e).__currentAnisotropy)||(f.texParameterf(t,i.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(e.anisotropy,v.getMaxAnisotropy())),g.get(e).__currentAnisotropy=e.anisotropy)}function c(t,e,i,n){var r=y(e.texture.format),a=y(e.texture.type);m.texImage2D(n,0,r,e.width,e.height,0,r,a,null),f.bindFramebuffer(f.FRAMEBUFFER,t),f.framebufferTexture2D(f.FRAMEBUFFER,i,n,g.get(e.texture).__webglTexture,0),f.bindFramebuffer(f.FRAMEBUFFER,null)}function h(t,e){f.bindRenderbuffer(f.RENDERBUFFER,t),e.depthBuffer&&!e.stencilBuffer?(f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_COMPONENT16,e.width,e.height),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_ATTACHMENT,f.RENDERBUFFER,t)):e.depthBuffer&&e.stencilBuffer?(f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_STENCIL,e.width,e.height),f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_STENCIL_ATTACHMENT,f.RENDERBUFFER,t)):f.renderbufferStorage(f.RENDERBUFFER,f.RGBA4,e.width,e.height),f.bindRenderbuffer(f.RENDERBUFFER,null)}var M=t.memory,l="undefined"!=typeof WebGL2RenderingContext&&f instanceof WebGL2RenderingContext;this.setTexture2D=s,this.setTextureCube=function(t,e){var i=g.get(t);if(6===t.image.length)if(0<t.version&&i.__version!==t.version){i.__image__webglTextureCube||(t.addEventListener("dispose",b),i.__image__webglTextureCube=f.createTexture(),M.textures++),m.activeTexture(f.TEXTURE0+e),m.bindTexture(f.TEXTURE_CUBE_MAP,i.__image__webglTextureCube),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,t.flipY);for(var n=t&&t.isCompressedTexture,r=t.image[0]&&t.image[0].isDataTexture,a=[],o=0;o<6;o++)a[o]=n||r?r?t.image[o].image:t.image[o]:x(t.image[o],v.maxCubemapSize);var s=_(a[0]),c=y(t.format),h=y(t.type);for(w(f.TEXTURE_CUBE_MAP,t,s),o=0;o<6;o++)if(n)for(var l,u=a[o].mipmaps,d=0,p=u.length;d<p;d++)l=u[d],1023!==t.format&&1022!==t.format?-1<m.getCompressedTextureFormats().indexOf(c)?m.compressedTexImage2D(f.TEXTURE_CUBE_MAP_POSITIVE_X+o,d,c,l.width,l.height,0,l.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):m.texImage2D(f.TEXTURE_CUBE_MAP_POSITIVE_X+o,d,c,l.width,l.height,0,c,h,l.data);else r?m.texImage2D(f.TEXTURE_CUBE_MAP_POSITIVE_X+o,0,c,a[o].width,a[o].height,0,c,h,a[o].data):m.texImage2D(f.TEXTURE_CUBE_MAP_POSITIVE_X+o,0,c,c,h,a[o]);t.generateMipmaps&&s&&f.generateMipmap(f.TEXTURE_CUBE_MAP),i.__version=t.version,t.onUpdate&&t.onUpdate(t)}else m.activeTexture(f.TEXTURE0+e),m.bindTexture(f.TEXTURE_CUBE_MAP,i.__image__webglTextureCube)},this.setTextureCubeDynamic=function(t,e){m.activeTexture(f.TEXTURE0+e),m.bindTexture(f.TEXTURE_CUBE_MAP,g.get(t).__webglTexture)},this.setupRenderTarget=function(t){var e=g.get(t),i=g.get(t.texture);t.addEventListener("dispose",o),i.__webglTexture=f.createTexture(),M.textures++;var n=!0===t.isWebGLRenderTargetCube,r=_(t);if(n){e.__webglFramebuffer=[];for(var a=0;a<6;a++)e.__webglFramebuffer[a]=f.createFramebuffer()}else e.__webglFramebuffer=f.createFramebuffer();if(n){for(m.bindTexture(f.TEXTURE_CUBE_MAP,i.__webglTexture),w(f.TEXTURE_CUBE_MAP,t.texture,r),a=0;a<6;a++)c(e.__webglFramebuffer[a],t,f.COLOR_ATTACHMENT0,f.TEXTURE_CUBE_MAP_POSITIVE_X+a);t.texture.generateMipmaps&&r&&f.generateMipmap(f.TEXTURE_CUBE_MAP),m.bindTexture(f.TEXTURE_CUBE_MAP,null)}else m.bindTexture(f.TEXTURE_2D,i.__webglTexture),w(f.TEXTURE_2D,t.texture,r),c(e.__webglFramebuffer,t,f.COLOR_ATTACHMENT0,f.TEXTURE_2D),t.texture.generateMipmaps&&r&&f.generateMipmap(f.TEXTURE_2D),m.bindTexture(f.TEXTURE_2D,null);if(t.depthBuffer){if(e=g.get(t),i=!0===t.isWebGLRenderTargetCube,t.depthTexture){if(i)throw Error("target.depthTexture not supported in Cube render targets");if(t&&t.isWebGLRenderTargetCube)throw Error("Depth Texture with cube render targets is not supported!");if(f.bindFramebuffer(f.FRAMEBUFFER,e.__webglFramebuffer),!t.depthTexture||!t.depthTexture.isDepthTexture)throw Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");if(g.get(t.depthTexture).__webglTexture&&t.depthTexture.image.width===t.width&&t.depthTexture.image.height===t.height||(t.depthTexture.image.width=t.width,t.depthTexture.image.height=t.height,t.depthTexture.needsUpdate=!0),s(t.depthTexture,0),e=g.get(t.depthTexture).__webglTexture,1026===t.depthTexture.format)f.framebufferTexture2D(f.FRAMEBUFFER,f.DEPTH_ATTACHMENT,f.TEXTURE_2D,e,0);else{if(1027!==t.depthTexture.format)throw Error("Unknown depthTexture format");f.framebufferTexture2D(f.FRAMEBUFFER,f.DEPTH_STENCIL_ATTACHMENT,f.TEXTURE_2D,e,0)}}else if(i)for(e.__webglDepthbuffer=[],i=0;i<6;i++)f.bindFramebuffer(f.FRAMEBUFFER,e.__webglFramebuffer[i]),e.__webglDepthbuffer[i]=f.createRenderbuffer(),h(e.__webglDepthbuffer[i],t);else f.bindFramebuffer(f.FRAMEBUFFER,e.__webglFramebuffer),e.__webglDepthbuffer=f.createRenderbuffer(),h(e.__webglDepthbuffer,t);f.bindFramebuffer(f.FRAMEBUFFER,null)}},this.updateRenderTargetMipmap=function(t){var e=t.texture;e.generateMipmaps&&_(t)&&1003!==e.minFilter&&1006!==e.minFilter&&(t=t&&t.isWebGLRenderTargetCube?f.TEXTURE_CUBE_MAP:f.TEXTURE_2D,e=g.get(e).__webglTexture,m.bindTexture(t,e),f.generateMipmap(t),m.bindTexture(t,null))}}function te(){var i={};return{get:function(t){t=t.uuid;var e=i[t];return void 0===e&&(e={},i[t]=e),e},delete:function(t){delete i[t.uuid]},clear:function(){i={}}}}function ee(l,i,c){function t(t,e,i){var n=new Uint8Array(4),r=l.createTexture();for(l.bindTexture(t,r),l.texParameteri(t,l.TEXTURE_MIN_FILTER,l.NEAREST),l.texParameteri(t,l.TEXTURE_MAG_FILTER,l.NEAREST),t=0;t<i;t++)l.texImage2D(e+t,0,l.RGBA,1,1,0,l.RGBA,l.UNSIGNED_BYTE,n);return r}function u(t){!0!==y[t]&&(l.enable(t),y[t]=!0)}function d(t){!1!==y[t]&&(l.disable(t),y[t]=!1)}function e(t,e,i,n,r,a,o,s){0!==t?u(l.BLEND):d(l.BLEND),t===_&&s===A||(2===t?s?(l.blendEquationSeparate(l.FUNC_ADD,l.FUNC_ADD),l.blendFuncSeparate(l.ONE,l.ONE,l.ONE,l.ONE)):(l.blendEquation(l.FUNC_ADD),l.blendFunc(l.SRC_ALPHA,l.ONE)):3===t?s?(l.blendEquationSeparate(l.FUNC_ADD,l.FUNC_ADD),l.blendFuncSeparate(l.ZERO,l.ZERO,l.ONE_MINUS_SRC_COLOR,l.ONE_MINUS_SRC_ALPHA)):(l.blendEquation(l.FUNC_ADD),l.blendFunc(l.ZERO,l.ONE_MINUS_SRC_COLOR)):4===t?s?(l.blendEquationSeparate(l.FUNC_ADD,l.FUNC_ADD),l.blendFuncSeparate(l.ZERO,l.SRC_COLOR,l.ZERO,l.SRC_ALPHA)):(l.blendEquation(l.FUNC_ADD),l.blendFunc(l.ZERO,l.SRC_COLOR)):s?(l.blendEquationSeparate(l.FUNC_ADD,l.FUNC_ADD),l.blendFuncSeparate(l.ONE,l.ONE_MINUS_SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA)):(l.blendEquationSeparate(l.FUNC_ADD,l.FUNC_ADD),l.blendFuncSeparate(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA)),_=t,A=s),5===t?(r=r||e,a=a||i,o=o||n,e===b&&r===E||(l.blendEquationSeparate(c(e),c(r)),b=e,E=r),i===w&&n===M&&a===T&&o===S||(l.blendFuncSeparate(c(i),c(n),c(a),c(o)),w=i,M=n,T=a,S=o)):S=T=E=M=w=b=null}function n(t){h.setFunc(t)}function r(t){L!==t&&(t?l.frontFace(l.CW):l.frontFace(l.CCW),L=t)}function a(t){0!==t?(u(l.CULL_FACE),t!==R&&(1===t?l.cullFace(l.BACK):2===t?l.cullFace(l.FRONT):l.cullFace(l.FRONT_AND_BACK))):d(l.CULL_FACE),R=t}function o(t){void 0===t&&(t=l.TEXTURE0+N-1),O!==t&&(l.activeTexture(t),O=t)}var s=new function(){var e=!1,a=new Pt,i=null,o=new Pt;return{setMask:function(t){i===t||e||(l.colorMask(t,t,t,t),i=t)},setLocked:function(t){e=t},setClear:function(t,e,i,n,r){!0===r&&(t*=n,e*=n,i*=n),a.set(t,e,i,n),!1===o.equals(a)&&(l.clearColor(t,e,i,n),o.copy(a))},reset:function(){e=!1,i=null,o.set(0,0,0,1)}}},h=new function(){var e=!1,i=null,n=null,r=null;return{setTest:function(t){t?u(l.DEPTH_TEST):d(l.DEPTH_TEST)},setMask:function(t){i===t||e||(l.depthMask(t),i=t)},setFunc:function(t){if(n!==t){if(t)switch(t){case 0:l.depthFunc(l.NEVER);break;case 1:l.depthFunc(l.ALWAYS);break;case 2:l.depthFunc(l.LESS);break;case 3:l.depthFunc(l.LEQUAL);break;case 4:l.depthFunc(l.EQUAL);break;case 5:l.depthFunc(l.GEQUAL);break;case 6:l.depthFunc(l.GREATER);break;case 7:l.depthFunc(l.NOTEQUAL);break;default:l.depthFunc(l.LEQUAL)}else l.depthFunc(l.LEQUAL);n=t}},setLocked:function(t){e=t},setClear:function(t){r!==t&&(l.clearDepth(t),r=t)},reset:function(){e=!1,r=n=i=null}}},p=new function(){var e=!1,i=null,n=null,r=null,a=null,o=null,s=null,c=null,h=null;return{setTest:function(t){t?u(l.STENCIL_TEST):d(l.STENCIL_TEST)},setMask:function(t){i===t||e||(l.stencilMask(t),i=t)},setFunc:function(t,e,i){n===t&&r===e&&a===i||(l.stencilFunc(t,e,i),n=t,r=e,a=i)},setOp:function(t,e,i){o===t&&s===e&&c===i||(l.stencilOp(t,e,i),o=t,s=e,c=i)},setLocked:function(t){e=t},setClear:function(t){h!==t&&(l.clearStencil(t),h=t)},reset:function(){e=!1,h=c=s=o=a=r=n=i=null}}},f=l.getParameter(l.MAX_VERTEX_ATTRIBS),m=new Uint8Array(f),g=new Uint8Array(f),v=new Uint8Array(f),y={},x=null,_=null,b=null,w=null,M=null,E=null,T=null,S=null,A=!1,L=null,R=null,P=null,C=null,I=null,U=null,N=l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS),D=(f=parseFloat(/^WebGL\ ([0-9])/.exec(l.getParameter(l.VERSION))[1]),1<=parseFloat(f)),O=null,F={},z=new Pt,B=new Pt,G={};return G[l.TEXTURE_2D]=t(l.TEXTURE_2D,l.TEXTURE_2D,1),G[l.TEXTURE_CUBE_MAP]=t(l.TEXTURE_CUBE_MAP,l.TEXTURE_CUBE_MAP_POSITIVE_X,6),{buffers:{color:s,depth:h,stencil:p},init:function(){s.setClear(0,0,0,1),h.setClear(1),p.setClear(0),u(l.DEPTH_TEST),n(3),r(!1),a(1),u(l.CULL_FACE),u(l.BLEND),e(1)},initAttributes:function(){for(var t=0,e=m.length;t<e;t++)m[t]=0},enableAttribute:function(t){m[t]=1,0===g[t]&&(l.enableVertexAttribArray(t),g[t]=1),0!==v[t]&&(i.get("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(t,0),v[t]=0)},enableAttributeAndDivisor:function(t,e,i){m[t]=1,0===g[t]&&(l.enableVertexAttribArray(t),g[t]=1),v[t]!==e&&(i.vertexAttribDivisorANGLE(t,e),v[t]=e)},disableUnusedAttributes:function(){for(var t=0,e=g.length;t!==e;++t)g[t]!==m[t]&&(l.disableVertexAttribArray(t),g[t]=0)},enable:u,disable:d,getCompressedTextureFormats:function(){if(null===x&&(x=[],i.get("WEBGL_compressed_texture_pvrtc")||i.get("WEBGL_compressed_texture_s3tc")||i.get("WEBGL_compressed_texture_etc1")))for(var t=l.getParameter(l.COMPRESSED_TEXTURE_FORMATS),e=0;e<t.length;e++)x.push(t[e]);return x},setBlending:e,setColorWrite:function(t){s.setMask(t)},setDepthTest:function(t){h.setTest(t)},setDepthWrite:function(t){h.setMask(t)},setDepthFunc:n,setStencilTest:function(t){p.setTest(t)},setStencilWrite:function(t){p.setMask(t)},setStencilFunc:function(t,e,i){p.setFunc(t,e,i)},setStencilOp:function(t,e,i){p.setOp(t,e,i)},setFlipSided:r,setCullFace:a,setLineWidth:function(t){t!==P&&(D&&l.lineWidth(t),P=t)},setPolygonOffset:function(t,e,i){t?(u(l.POLYGON_OFFSET_FILL),(C!==e||I!==i)&&(l.polygonOffset(e,i),C=e,I=i)):d(l.POLYGON_OFFSET_FILL)},getScissorTest:function(){return U},setScissorTest:function(t){(U=t)?u(l.SCISSOR_TEST):d(l.SCISSOR_TEST)},activeTexture:o,bindTexture:function(t,e){null===O&&o();var i=F[O];void 0===i&&(i={type:void 0,texture:void 0},F[O]=i),i.type===t&&i.texture===e||(l.bindTexture(t,e||G[t]),i.type=t,i.texture=e)},compressedTexImage2D:function(){try{l.compressedTexImage2D.apply(l,arguments)}catch(t){console.error(t)}},texImage2D:function(){try{l.texImage2D.apply(l,arguments)}catch(t){console.error(t)}},scissor:function(t){!1===z.equals(t)&&(l.scissor(t.x,t.y,t.z,t.w),z.copy(t))},viewport:function(t){!1===B.equals(t)&&(l.viewport(t.x,t.y,t.z,t.w),B.copy(t))},reset:function(){for(var t=0;t<g.length;t++)1===g[t]&&(l.disableVertexAttribArray(t),g[t]=0);y={},O=x=null,F={},R=L=_=null,s.reset(),h.reset(),p.reset()}}}function ie(e,i,t){function n(t){if("highp"===t){if(0<e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision&&0<e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision)return"highp";t="mediump"}return"mediump"===t&&0<e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision&&0<e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision?"mediump":"lowp"}var r,a=void 0!==t.precision?t.precision:"highp";(o=n(a))!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",o,"instead."),a=o),t=!0===t.logarithmicDepthBuffer&&!!i.get("EXT_frag_depth");var o=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),s=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),c=e.getParameter(e.MAX_TEXTURE_SIZE),h=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),l=e.getParameter(e.MAX_VERTEX_ATTRIBS),u=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),d=e.getParameter(e.MAX_VARYING_VECTORS),p=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),f=0<s,m=!!i.get("OES_texture_float");return{getMaxAnisotropy:function(){if(void 0!==r)return r;var t=i.get("EXT_texture_filter_anisotropic");return r=null!==t?e.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:n,precision:a,logarithmicDepthBuffer:t,maxTextures:o,maxVertexTextures:s,maxTextureSize:c,maxCubemapSize:h,maxAttributes:l,maxVertexUniforms:u,maxVaryings:d,maxFragmentUniforms:p,vertexTextures:f,floatFragmentTextures:m,floatVertexTextures:f&&m}}function ne(i){var n={};return{get:function(t){if(void 0!==n[t])return n[t];var e;switch(t){case"WEBGL_depth_texture":e=i.getExtension("WEBGL_depth_texture")||i.getExtension("MOZ_WEBGL_depth_texture")||i.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":e=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":e=i.getExtension("WEBGL_compressed_texture_s3tc")||i.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":e=i.getExtension("WEBGL_compressed_texture_pvrtc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":e=i.getExtension("WEBGL_compressed_texture_etc1");break;default:e=i.getExtension(t)}return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),n[t]=e}}}function re(){function c(){m.value!==l&&(m.value=l,m.needsUpdate=0<u),o.numPlanes=u,o.numIntersection=0}function h(t,e,i,n){var r=null!==t?t.length:0,a=null;if(0!==r){if(a=m.value,!0!==n||null===a)for(n=i+4*r,e=e.matrixWorldInverse,f.getNormalMatrix(e),(null===a||a.length<n)&&(a=new Float32Array(n)),n=0;n!==r;++n,i+=4)s.copy(t[n]).applyMatrix4(e,f),s.normal.toArray(a,i),a[i+3]=s.constant;m.value=a,m.needsUpdate=!0}return o.numPlanes=r,a}var o=this,l=null,u=0,d=!1,p=!1,s=new H,f=new F,m={value:null,needsUpdate:!1};this.uniform=m,this.numIntersection=this.numPlanes=0,this.init=function(t,e,i){var n=0!==t.length||e||0!==u||d;return d=e,l=h(t,i,0),u=t.length,n},this.beginShadows=function(){p=!0,h(null)},this.endShadows=function(){p=!1,c()},this.setState=function(t,e,i,n,r,a){if(!d||null===t||0===t.length||p&&!i)p?h(null):c();else{var o=4*(i=p?0:u),s=r.clippingState||null;for(m.value=s,s=h(t,n,o,a),t=0;t!==o;++t)s[t]=l[t];r.clippingState=s,this.numIntersection=e?this.numPlanes:0,this.numPlanes+=i}}}function yt(t){function e(){dt.init(),dt.scissor(y.copy(J).multiplyScalar(Z)),dt.viewport(W.copy(K).multiplyScalar(Z)),dt.buffers.color.setClear(X.r,X.g,X.b,Y,P)}function i(){j=g=null,k="",V=-1,dt.reset()}function n(t){t.preventDefault(),i(),e(),pt.clear()}function d(t){(t=t.target).removeEventListener("dispose",d),p(t),pt.delete(t)}function p(t){var e=pt.get(t).program;(t.program=void 0)!==e&&gt.releaseProgram(e)}function M(t,e){return Math.abs(e[0])-Math.abs(t[0])}function w(t,e){return t.object.renderOrder!==e.object.renderOrder?t.object.renderOrder-e.object.renderOrder:t.material.program&&e.material.program&&t.material.program!==e.material.program?t.material.program.id-e.material.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function E(t,e){return t.object.renderOrder!==e.object.renderOrder?t.object.renderOrder-e.object.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function T(t,e,i,n,r){var a;a=i.transparent?(n=N,++D):(n=I,++U),void 0!==(a=n[a])?(a.id=t.id,a.object=t,a.geometry=e,a.material=i,a.z=at.z,a.group=r):(a={id:t.id,object:t,geometry:e,material:i,z:at.z,group:r},n.push(a))}function S(t){if(!$.intersectsSphere(t))return!1;var e=tt.numPlanes;if(0===e)return!0;var i=G.clippingPlanes,n=t.center;t=-t.radius;var r=0;do{if(i[r].distanceToPoint(n)<t)return!1}while(++r!==e);return!0}function A(t,e,i,n){for(var r=0,a=t.length;r<a;r++){var o=(h=t[r]).object,s=h.geometry,c=void 0===n?h.material:n,h=h.group;if(o.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,o.matrixWorld),o.normalMatrix.getNormalMatrix(o.modelViewMatrix),o.onBeforeRender(G,e,i,s,c,h),o.isImmediateRenderObject){L(c);var l=R(i,e.fog,c,o);k="",o.render(function(t){G.renderBufferImmediate(t,l,c)})}else G.renderBufferDirect(i,e.fog,s,c,o,h);o.onAfterRender(G,e,i,s,c,h)}}function L(t){2===t.side?dt.disable(B.CULL_FACE):dt.enable(B.CULL_FACE),dt.setFlipSided(1===t.side),!0===t.transparent?dt.setBlending(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha):dt.setBlending(0),dt.setDepthFunc(t.depthFunc),dt.setDepthTest(t.depthTest),dt.setDepthWrite(t.depthWrite),dt.setColorWrite(t.colorWrite),dt.setPolygonOffset(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)}function R(t,e,i,n){_=0;var r=pt.get(i);if(et&&(it||t!==j)&&tt.setState(i.clippingPlanes,i.clipIntersection,i.clipShadows,t,r,t===j&&i.id===V),!1===i.needsUpdate&&(void 0===r.program?i.needsUpdate=!0:i.fog&&r.fog!==e?i.needsUpdate=!0:i.lights&&r.lightsHash!==ct.hash?i.needsUpdate=!0:void 0===r.numClippingPlanes||r.numClippingPlanes===tt.numPlanes&&r.numIntersection===tt.numIntersection||(i.needsUpdate=!0)),i.needsUpdate){t:{var a=pt.get(i),o=gt.getParameters(i,ct,e,tt.numPlanes,tt.numIntersection,n),s=gt.getProgramCode(i,o),c=a.program,h=!0;if(void 0===c)i.addEventListener("dispose",d);else if(c.code!==s)p(i);else{if(void 0!==o.shaderID)break t;h=!1}if(h&&(o.shaderID?(c=Nr[o.shaderID],a.__webglShader={name:i.type,uniforms:Lr.clone(c.uniforms),vertexShader:c.vertexShader,fragmentShader:c.fragmentShader}):a.__webglShader={name:i.type,uniforms:i.uniforms,vertexShader:i.vertexShader,fragmentShader:i.fragmentShader},i.__webglShader=a.__webglShader,c=gt.acquireProgram(i,o,s),a.program=c,i.program=c),o=c.getAttributes(),i.morphTargets)for(s=i.numSupportedMorphTargets=0;s<G.maxMorphTargets;s++)0<=o["morphTarget"+s]&&i.numSupportedMorphTargets++;if(i.morphNormals)for(s=i.numSupportedMorphNormals=0;s<G.maxMorphNormals;s++)0<=o["morphNormal"+s]&&i.numSupportedMorphNormals++;o=a.__webglShader.uniforms,(i.isShaderMaterial||i.isRawShaderMaterial)&&!0!==i.clipping||(a.numClippingPlanes=tt.numPlanes,a.numIntersection=tt.numIntersection,o.clippingPlanes=tt.uniform),a.fog=e,a.lightsHash=ct.hash,i.lights&&(o.ambientLightColor.value=ct.ambient,o.directionalLights.value=ct.directional,o.spotLights.value=ct.spot,o.rectAreaLights.value=ct.rectArea,o.pointLights.value=ct.point,o.hemisphereLights.value=ct.hemi,o.directionalShadowMap.value=ct.directionalShadowMap,o.directionalShadowMatrix.value=ct.directionalShadowMatrix,o.spotShadowMap.value=ct.spotShadowMap,o.spotShadowMatrix.value=ct.spotShadowMatrix,o.pointShadowMap.value=ct.pointShadowMap,o.pointShadowMatrix.value=ct.pointShadowMatrix),s=a.program.getUniforms(),o=Ut.seqWithValue(s.seq,o),a.uniformsList=o}i.needsUpdate=!1}var l=!1;h=c=!1,o=(a=r.program).getUniforms(),s=r.__webglShader.uniforms;if(a.id!==g&&(B.useProgram(a.program),g=a.id,h=c=l=!0),i.id!==V&&(V=i.id,c=!0),(l||t!==j)&&(o.set(B,t,"projectionMatrix"),ut.logarithmicDepthBuffer&&o.setValue(B,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),t!==j&&(j=t,h=c=!0),(i.isShaderMaterial||i.isMeshPhongMaterial||i.isMeshStandardMaterial||i.envMap)&&(void 0!==(l=o.map.cameraPosition)&&l.setValue(B,at.setFromMatrixPosition(t.matrixWorld))),(i.isMeshPhongMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial||i.skinning)&&o.setValue(B,"viewMatrix",t.matrixWorldInverse),o.set(B,G,"toneMappingExposure"),o.set(B,G,"toneMappingWhitePoint")),i.skinning&&(o.setOptional(B,n,"bindMatrix"),o.setOptional(B,n,"bindMatrixInverse"),t=n.skeleton)&&(ut.floatVertexTextures&&t.useVertexTexture?(o.set(B,t,"boneTexture"),o.set(B,t,"boneTextureWidth"),o.set(B,t,"boneTextureHeight")):o.setOptional(B,t,"boneMatrices")),c){var u;if(i.lights&&(t=h,s.ambientLightColor.needsUpdate=t,s.directionalLights.needsUpdate=t,s.pointLights.needsUpdate=t,s.spotLights.needsUpdate=t,s.rectAreaLights.needsUpdate=t,s.hemisphereLights.needsUpdate=t),e&&i.fog&&(s.fogColor.value=e.color,e.isFog?(s.fogNear.value=e.near,s.fogFar.value=e.far):e.isFogExp2&&(s.fogDensity.value=e.density)),i.isMeshBasicMaterial||i.isMeshLambertMaterial||i.isMeshPhongMaterial||i.isMeshStandardMaterial||i.isMeshNormalMaterial||i.isMeshDepthMaterial)s.opacity.value=i.opacity,s.diffuse.value=i.color,i.emissive&&s.emissive.value.copy(i.emissive).multiplyScalar(i.emissiveIntensity),s.map.value=i.map,s.specularMap.value=i.specularMap,s.alphaMap.value=i.alphaMap,i.lightMap&&(s.lightMap.value=i.lightMap,s.lightMapIntensity.value=i.lightMapIntensity),i.aoMap&&(s.aoMap.value=i.aoMap,s.aoMapIntensity.value=i.aoMapIntensity),i.map?u=i.map:i.specularMap?u=i.specularMap:i.displacementMap?u=i.displacementMap:i.normalMap?u=i.normalMap:i.bumpMap?u=i.bumpMap:i.roughnessMap?u=i.roughnessMap:i.metalnessMap?u=i.metalnessMap:i.alphaMap?u=i.alphaMap:i.emissiveMap&&(u=i.emissiveMap),void 0!==u&&(u.isWebGLRenderTarget&&(u=u.texture),e=u.offset,u=u.repeat,s.offsetRepeat.value.set(e.x,e.y,u.x,u.y)),s.envMap.value=i.envMap,s.flipEnvMap.value=i.envMap&&i.envMap.isCubeTexture?-1:1,s.reflectivity.value=i.reflectivity,s.refractionRatio.value=i.refractionRatio;i.isLineBasicMaterial?(s.diffuse.value=i.color,s.opacity.value=i.opacity):i.isLineDashedMaterial?(s.diffuse.value=i.color,s.opacity.value=i.opacity,s.dashSize.value=i.dashSize,s.totalSize.value=i.dashSize+i.gapSize,s.scale.value=i.scale):i.isPointsMaterial?(s.diffuse.value=i.color,s.opacity.value=i.opacity,s.size.value=i.size*Z,s.scale.value=.5*q,s.map.value=i.map,null!==i.map&&(u=i.map.offset,i=i.map.repeat,s.offsetRepeat.value.set(u.x,u.y,i.x,i.y))):i.isMeshLambertMaterial?i.emissiveMap&&(s.emissiveMap.value=i.emissiveMap):i.isMeshToonMaterial?(f(s,i),i.gradientMap&&(s.gradientMap.value=i.gradientMap)):i.isMeshPhongMaterial?f(s,i):i.isMeshPhysicalMaterial?(s.clearCoat.value=i.clearCoat,s.clearCoatRoughness.value=i.clearCoatRoughness,m(s,i)):i.isMeshStandardMaterial?m(s,i):i.isMeshDepthMaterial?i.displacementMap&&(s.displacementMap.value=i.displacementMap,s.displacementScale.value=i.displacementScale,s.displacementBias.value=i.displacementBias):i.isMeshNormalMaterial&&(i.bumpMap&&(s.bumpMap.value=i.bumpMap,s.bumpScale.value=i.bumpScale),i.normalMap&&(s.normalMap.value=i.normalMap,s.normalScale.value.copy(i.normalScale)),i.displacementMap&&(s.displacementMap.value=i.displacementMap,s.displacementScale.value=i.displacementScale,s.displacementBias.value=i.displacementBias)),void 0!==s.ltcMat&&(s.ltcMat.value=THREE.UniformsLib.LTC_MAT_TEXTURE),void 0!==s.ltcMag&&(s.ltcMag.value=THREE.UniformsLib.LTC_MAG_TEXTURE),Ut.upload(B,r.uniformsList,s,G)}return o.set(B,n,"modelViewMatrix"),o.set(B,n,"normalMatrix"),o.setValue(B,"modelMatrix",n.matrixWorld),a}function f(t,e){t.specular.value=e.specular,t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale)),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function m(t,e){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale)),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),e.envMap&&(t.envMapIntensity.value=e.envMapIntensity)}function u(t){var e;if(1e3===t)return B.REPEAT;if(1001===t)return B.CLAMP_TO_EDGE;if(1002===t)return B.MIRRORED_REPEAT;if(1003===t)return B.NEAREST;if(1004===t)return B.NEAREST_MIPMAP_NEAREST;if(1005===t)return B.NEAREST_MIPMAP_LINEAR;if(1006===t)return B.LINEAR;if(1007===t)return B.LINEAR_MIPMAP_NEAREST;if(1008===t)return B.LINEAR_MIPMAP_LINEAR;if(1009===t)return B.UNSIGNED_BYTE;if(1017===t)return B.UNSIGNED_SHORT_4_4_4_4;if(1018===t)return B.UNSIGNED_SHORT_5_5_5_1;if(1019===t)return B.UNSIGNED_SHORT_5_6_5;if(1010===t)return B.BYTE;if(1011===t)return B.SHORT;if(1012===t)return B.UNSIGNED_SHORT;if(1013===t)return B.INT;if(1014===t)return B.UNSIGNED_INT;if(1015===t)return B.FLOAT;if(1016===t&&null!==(e=lt.get("OES_texture_half_float")))return e.HALF_FLOAT_OES;if(1021===t)return B.ALPHA;if(1022===t)return B.RGB;if(1023===t)return B.RGBA;if(1024===t)return B.LUMINANCE;if(1025===t)return B.LUMINANCE_ALPHA;if(1026===t)return B.DEPTH_COMPONENT;if(1027===t)return B.DEPTH_STENCIL;if(100===t)return B.FUNC_ADD;if(101===t)return B.FUNC_SUBTRACT;if(102===t)return B.FUNC_REVERSE_SUBTRACT;if(200===t)return B.ZERO;if(201===t)return B.ONE;if(202===t)return B.SRC_COLOR;if(203===t)return B.ONE_MINUS_SRC_COLOR;if(204===t)return B.SRC_ALPHA;if(205===t)return B.ONE_MINUS_SRC_ALPHA;if(206===t)return B.DST_ALPHA;if(207===t)return B.ONE_MINUS_DST_ALPHA;if(208===t)return B.DST_COLOR;if(209===t)return B.ONE_MINUS_DST_COLOR;if(210===t)return B.SRC_ALPHA_SATURATE;if((2001===t||2002===t||2003===t||2004===t)&&null!==(e=lt.get("WEBGL_compressed_texture_s3tc"))){if(2001===t)return e.COMPRESSED_RGB_S3TC_DXT1_EXT;if(2002===t)return e.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(2003===t)return e.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(2004===t)return e.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((2100===t||2101===t||2102===t||2103===t)&&null!==(e=lt.get("WEBGL_compressed_texture_pvrtc"))){if(2100===t)return e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(2101===t)return e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(2102===t)return e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(2103===t)return e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(2151===t&&null!==(e=lt.get("WEBGL_compressed_texture_etc1")))return e.COMPRESSED_RGB_ETC1_WEBGL;if((103===t||104===t)&&null!==(e=lt.get("EXT_blend_minmax"))){if(103===t)return e.MIN_EXT;if(104===t)return e.MAX_EXT}return 1020===t&&null!==(e=lt.get("WEBGL_depth_texture"))?e.UNSIGNED_INT_24_8_WEBGL:0}console.log("THREE.WebGLRenderer","83");var r=void 0!==(t=t||{}).canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),a=void 0!==t.context?t.context:null,o=void 0!==t.alpha&&t.alpha,s=void 0===t.depth||t.depth,c=void 0===t.stencil||t.stencil,h=void 0!==t.antialias&&t.antialias,P=void 0===t.premultipliedAlpha||t.premultipliedAlpha,l=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,C=[],I=[],U=-1,N=[],D=-1,O=new Float32Array(8),F=[],z=[];this.domElement=r,this.context=null,this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.physicallyCorrectLights=this.gammaOutput=this.gammaInput=!1,this.toneMappingWhitePoint=this.toneMappingExposure=this.toneMapping=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var B,G=this,g=null,H=null,v=null,V=-1,k="",j=null,y=new Pt,x=null,W=new Pt,_=0,X=new Nt(0),Y=0,b=r.width,q=r.height,Z=1,J=new Pt(0,0,b,q),Q=!1,K=new Pt(0,0,b,q),$=new Bt,tt=new re,et=!1,it=!1,nt=new zt,rt=new It,at=new Ct,ot=new It,st=new It,ct={hash:"",ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],shadows:[]},ht={calls:0,vertices:0,faces:0,points:0};this.info={render:ht,memory:{geometries:0,textures:0},programs:null};try{if(o={alpha:o,depth:s,stencil:c,antialias:h,premultipliedAlpha:P,preserveDrawingBuffer:l},null===(B=a||r.getContext("webgl",o)||r.getContext("experimental-webgl",o))){if(null!==r.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context."}void 0===B.getShaderPrecisionFormat&&(B.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}}),r.addEventListener("webglcontextlost",n,!1)}catch(t){console.error("THREE.WebGLRenderer: "+t)}var lt=new ne(B);lt.get("WEBGL_depth_texture"),lt.get("OES_texture_float"),lt.get("OES_texture_float_linear"),lt.get("OES_texture_half_float"),lt.get("OES_texture_half_float_linear"),lt.get("OES_standard_derivatives"),lt.get("ANGLE_instanced_arrays"),lt.get("OES_element_index_uint")&&(Vt.MaxIndex=4294967296);var ut=new ie(B,lt,t),dt=new ee(B,lt,u),pt=new te,ft=new $t(B,lt,dt,pt,ut,u,this.info),mt=new Kt(B,pt,this.info),gt=new Qt(this,ut),vt=new Jt;this.info.programs=gt.programs;var yt=new Zt(B,lt,ht),xt=new qt(B,lt,ht),_t=new Yt(-1,1,1,-1,0,1),bt=new Xt,wt=new kt(new Wt(2,2),new Ht({depthTest:!1,depthWrite:!1,fog:!1}));t=Nr.cube;var Mt=new kt(new jt(5,5,5),new Ft({uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1}));e(),this.context=B,this.capabilities=ut,this.extensions=lt,this.properties=pt,this.state=dt;var Et=new Gt(this,ct,mt,ut);this.shadowMap=Et;var Tt,St,At,Lt=new Ot(this,F),Rt=new Dt(this,z);this.getContext=function(){return B},this.getContextAttributes=function(){return B.getContextAttributes()},this.forceContextLoss=function(){lt.get("WEBGL_lose_context").loseContext()},this.getMaxAnisotropy=function(){return ut.getMaxAnisotropy()},this.getPrecision=function(){return ut.precision},this.getPixelRatio=function(){return Z},this.setPixelRatio=function(t){void 0!==t&&(Z=t,this.setSize(K.z,K.w,!1))},this.getSize=function(){return{width:b,height:q}},this.setSize=function(t,e,i){b=t,q=e,r.width=t*Z,r.height=e*Z,!1!==i&&(r.style.width=t+"px",r.style.height=e+"px"),this.setViewport(0,0,t,e)},this.setViewport=function(t,e,i,n){dt.viewport(K.set(t,e,i,n))},this.setScissor=function(t,e,i,n){dt.scissor(J.set(t,e,i,n))},this.setScissorTest=function(t){dt.setScissorTest(Q=t)},this.getClearColor=function(){return X},this.setClearColor=function(t,e){X.set(t),Y=void 0!==e?e:1,dt.buffers.color.setClear(X.r,X.g,X.b,Y,P)},this.getClearAlpha=function(){return Y},this.setClearAlpha=function(t){Y=t,dt.buffers.color.setClear(X.r,X.g,X.b,Y,P)},this.clear=function(t,e,i){var n=0;(void 0===t||t)&&(n|=B.COLOR_BUFFER_BIT),(void 0===e||e)&&(n|=B.DEPTH_BUFFER_BIT),(void 0===i||i)&&(n|=B.STENCIL_BUFFER_BIT),B.clear(n)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.clearTarget=function(t,e,i,n){this.setRenderTarget(t),this.clear(e,i,n)},this.resetGLState=i,this.dispose=function(){N=[],I=[],U=D=-1,r.removeEventListener("webglcontextlost",n,!1)},this.renderBufferImmediate=function(t,e,i){dt.initAttributes();var n=pt.get(t);if(t.hasPositions&&!n.position&&(n.position=B.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=B.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=B.createBuffer()),t.hasColors&&!n.color&&(n.color=B.createBuffer()),e=e.getAttributes(),t.hasPositions&&(B.bindBuffer(B.ARRAY_BUFFER,n.position),B.bufferData(B.ARRAY_BUFFER,t.positionArray,B.DYNAMIC_DRAW),dt.enableAttribute(e.position),B.vertexAttribPointer(e.position,3,B.FLOAT,!1,0,0)),t.hasNormals){if(B.bindBuffer(B.ARRAY_BUFFER,n.normal),!i.isMeshPhongMaterial&&!i.isMeshStandardMaterial&&!i.isMeshNormalMaterial&&1===i.shading)for(var r=0,a=3*t.count;r<a;r+=9){var o=t.normalArray,s=(o[r+0]+o[r+3]+o[r+6])/3,c=(o[r+1]+o[r+4]+o[r+7])/3,h=(o[r+2]+o[r+5]+o[r+8])/3;o[r+0]=s,o[r+1]=c,o[r+2]=h,o[r+3]=s,o[r+4]=c,o[r+5]=h,o[r+6]=s,o[r+7]=c,o[r+8]=h}B.bufferData(B.ARRAY_BUFFER,t.normalArray,B.DYNAMIC_DRAW),dt.enableAttribute(e.normal),B.vertexAttribPointer(e.normal,3,B.FLOAT,!1,0,0)}t.hasUvs&&i.map&&(B.bindBuffer(B.ARRAY_BUFFER,n.uv),B.bufferData(B.ARRAY_BUFFER,t.uvArray,B.DYNAMIC_DRAW),dt.enableAttribute(e.uv),B.vertexAttribPointer(e.uv,2,B.FLOAT,!1,0,0)),t.hasColors&&0!==i.vertexColors&&(B.bindBuffer(B.ARRAY_BUFFER,n.color),B.bufferData(B.ARRAY_BUFFER,t.colorArray,B.DYNAMIC_DRAW),dt.enableAttribute(e.color),B.vertexAttribPointer(e.color,3,B.FLOAT,!1,0,0)),dt.disableUnusedAttributes(),B.drawArrays(B.TRIANGLES,0,t.count),t.count=0},this.renderBufferDirect=function(t,e,i,n,r,a){L(n);var o=R(t,e,n,r),s=!1;if((t=i.id+"_"+o.id+"_"+n.wireframe)!==k&&(k=t,s=!0),void 0!==(e=r.morphTargetInfluences)){var c=[];t=0;for(var h=e.length;t<h;t++)s=e[t],c.push([s,t]);c.sort(M),8<c.length&&(c.length=8);var l=i.morphAttributes;for(t=0,h=c.length;t<h;t++)s=c[t],O[t]=s[0],0!==s[0]?(e=s[1],!0===n.morphTargets&&l.position&&i.addAttribute("morphTarget"+t,l.position[e]),!0===n.morphNormals&&l.normal&&i.addAttribute("morphNormal"+t,l.normal[e])):(!0===n.morphTargets&&i.removeAttribute("morphTarget"+t),!0===n.morphNormals&&i.removeAttribute("morphNormal"+t));for(t=c.length,e=O.length;t<e;t++)O[t]=0;o.getUniforms().setValue(B,"morphTargetInfluences",O),s=!0}if(e=i.index,h=i.attributes.position,c=1,!0===n.wireframe&&(e=mt.getWireframeAttribute(i),c=2),null!==e?(t=xt).setIndex(e):t=yt,s){var u;s=void 0;if(i&&i.isInstancedBufferGeometry&&null===(u=lt.get("ANGLE_instanced_arrays")))console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");else{void 0===s&&(s=0),dt.initAttributes();l=i.attributes,o=o.getAttributes();var d,p=n.defaultAttributeValues;for(d in o){var f=o[d];if(0<=f)if(void 0!==(w=l[d])){var m=w.normalized,g=w.itemSize,v=(x=mt.getAttributeProperties(w)).__webglBuffer,y=x.type,x=x.bytesPerElement;if(w.isInterleavedBufferAttribute){var _=w.data,b=_.stride,w=w.offset;_&&_.isInstancedInterleavedBuffer?(dt.enableAttributeAndDivisor(f,_.meshPerAttribute,u),void 0===i.maxInstancedCount&&(i.maxInstancedCount=_.meshPerAttribute*_.count)):dt.enableAttribute(f),B.bindBuffer(B.ARRAY_BUFFER,v),B.vertexAttribPointer(f,g,y,m,b*x,(s*b+w)*x)}else w.isInstancedBufferAttribute?(dt.enableAttributeAndDivisor(f,w.meshPerAttribute,u),void 0===i.maxInstancedCount&&(i.maxInstancedCount=w.meshPerAttribute*w.count)):dt.enableAttribute(f),B.bindBuffer(B.ARRAY_BUFFER,v),B.vertexAttribPointer(f,g,y,m,0,s*g*x)}else if(void 0!==p&&void 0!==(m=p[d]))switch(m.length){case 2:B.vertexAttrib2fv(f,m);break;case 3:B.vertexAttrib3fv(f,m);break;case 4:B.vertexAttrib4fv(f,m);break;default:B.vertexAttrib1fv(f,m)}}dt.disableUnusedAttributes()}null!==e&&B.bindBuffer(B.ELEMENT_ARRAY_BUFFER,mt.getAttributeBuffer(e))}if(u=0,null!==e?u=e.count:void 0!==h&&(u=h.count),e=i.drawRange.start*c,h=null!==a?a.start*c:0,d=Math.max(e,h),0!==(a=Math.max(0,Math.min(u,e+i.drawRange.count*c,h+(null!==a?a.count*c:1/0))-1-d+1))){if(r.isMesh)if(!0===n.wireframe)dt.setLineWidth(n.wireframeLinewidth*(null===H?Z:1)),t.setMode(B.LINES);else switch(r.drawMode){case 0:t.setMode(B.TRIANGLES);break;case 1:t.setMode(B.TRIANGLE_STRIP);break;case 2:t.setMode(B.TRIANGLE_FAN)}else r.isLine?(void 0===(n=n.linewidth)&&(n=1),dt.setLineWidth(n*(null===H?Z:1)),r.isLineSegments?t.setMode(B.LINES):t.setMode(B.LINE_STRIP)):r.isPoints&&t.setMode(B.POINTS);i&&i.isInstancedBufferGeometry?0<i.maxInstancedCount&&t.renderInstances(i,d,a):t.render(d,a)}},this.render=function(t,e,i,n){if(void 0!==e&&!0!==e.isCamera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{k="",V=-1,!(j=null)===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),e.matrixWorldInverse.getInverse(e.matrixWorld),rt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),$.setFromMatrix(rt),C.length=0,D=U=-1,F.length=0,z.length=0,it=this.localClippingEnabled,et=tt.init(this.clippingPlanes,it,e),function t(e,i){if(!1!==e.visible){if(0!=(e.layers.mask&i.layers.mask))if(e.isLight)C.push(e);else if(e.isSprite){var n;(n=!1===e.frustumCulled)||(nt.center.set(0,0,0),nt.radius=.7071067811865476,nt.applyMatrix4(e.matrixWorld),n=!0===S(nt)),n&&F.push(e)}else if(e.isLensFlare)z.push(e);else if(e.isImmediateRenderObject)!0===G.sortObjects&&(at.setFromMatrixPosition(e.matrixWorld),at.applyProjection(rt)),T(e,null,e.material,at.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.update(),(n=!1===e.frustumCulled)||(null===(n=e.geometry).boundingSphere&&n.computeBoundingSphere(),nt.copy(n.boundingSphere).applyMatrix4(e.matrixWorld),n=!0===S(nt)),n)&&!0===(o=e.material).visible)if(!0===G.sortObjects&&(at.setFromMatrixPosition(e.matrixWorld),at.applyProjection(rt)),n=mt.update(e),o.isMultiMaterial)for(var r=n.groups,a=o.materials,o=0,s=r.length;o<s;o++){var c=r[o],h=a[c.materialIndex];!0===h.visible&&T(e,n,h,at.z,c)}else T(e,n,o,at.z,null);for(o=0,s=(n=e.children).length;o<s;o++)t(n[o],i)}}(t,e),I.length=U+1,N.length=D+1,!0===G.sortObjects&&(I.sort(w),N.sort(E)),et&&tt.beginShadows();for(var r=0,a=0,o=(d=C).length;a<o;a++){var s=d[a];s.castShadow&&(ct.shadows[r++]=s)}ct.shadows.length=r,Et.render(t,e);var c,h,l,u,d=C,p=s=0,f=0,m=e.matrixWorldInverse,g=0,v=0,y=0,x=0,_=0;for(r=0,a=d.length;r<a;r++)if(c=(o=d[r]).color,h=o.intensity,l=o.distance,u=o.shadow&&o.shadow.map?o.shadow.map.texture:null,o.isAmbientLight)s+=c.r*h,p+=c.g*h,f+=c.b*h;else if(o.isDirectionalLight){var b=vt.get(o);b.color.copy(o.color).multiplyScalar(o.intensity),b.direction.setFromMatrixPosition(o.matrixWorld),at.setFromMatrixPosition(o.target.matrixWorld),b.direction.sub(at),b.direction.transformDirection(m),(b.shadow=o.castShadow)&&(b.shadowBias=o.shadow.bias,b.shadowRadius=o.shadow.radius,b.shadowMapSize=o.shadow.mapSize),ct.directionalShadowMap[g]=u,ct.directionalShadowMatrix[g]=o.shadow.matrix,ct.directional[g++]=b}else o.isSpotLight?((b=vt.get(o)).position.setFromMatrixPosition(o.matrixWorld),b.position.applyMatrix4(m),b.color.copy(c).multiplyScalar(h),b.distance=l,b.direction.setFromMatrixPosition(o.matrixWorld),at.setFromMatrixPosition(o.target.matrixWorld),b.direction.sub(at),b.direction.transformDirection(m),b.coneCos=Math.cos(o.angle),b.penumbraCos=Math.cos(o.angle*(1-o.penumbra)),b.decay=0===o.distance?0:o.decay,(b.shadow=o.castShadow)&&(b.shadowBias=o.shadow.bias,b.shadowRadius=o.shadow.radius,b.shadowMapSize=o.shadow.mapSize),ct.spotShadowMap[y]=u,ct.spotShadowMatrix[y]=o.shadow.matrix,ct.spot[y++]=b):o.isRectAreaLight?((b=vt.get(o)).color.copy(c).multiplyScalar(h/(o.width*o.height)),b.position.setFromMatrixPosition(o.matrixWorld),b.position.applyMatrix4(m),st.identity(),ot.copy(o.matrixWorld),ot.premultiply(m),st.extractRotation(ot),b.halfWidth.set(.5*o.width,0,0),b.halfHeight.set(0,.5*o.height,0),b.halfWidth.applyMatrix4(st),b.halfHeight.applyMatrix4(st),ct.rectArea[x++]=b):o.isPointLight?((b=vt.get(o)).position.setFromMatrixPosition(o.matrixWorld),b.position.applyMatrix4(m),b.color.copy(o.color).multiplyScalar(o.intensity),b.distance=o.distance,b.decay=0===o.distance?0:o.decay,(b.shadow=o.castShadow)&&(b.shadowBias=o.shadow.bias,b.shadowRadius=o.shadow.radius,b.shadowMapSize=o.shadow.mapSize),ct.pointShadowMap[v]=u,void 0===ct.pointShadowMatrix[v]&&(ct.pointShadowMatrix[v]=new It),at.setFromMatrixPosition(o.matrixWorld).negate(),ct.pointShadowMatrix[v].identity().setPosition(at),ct.point[v++]=b):o.isHemisphereLight&&((b=vt.get(o)).direction.setFromMatrixPosition(o.matrixWorld),b.direction.transformDirection(m),b.direction.normalize(),b.skyColor.copy(o.color).multiplyScalar(h),b.groundColor.copy(o.groundColor).multiplyScalar(h),ct.hemi[_++]=b);ct.ambient[0]=s,ct.ambient[1]=p,ct.ambient[2]=f,ct.directional.length=g,ct.spot.length=y,ct.rectArea.length=x,ct.point.length=v,ct.hemi.length=_,ct.hash=g+","+v+","+y+","+x+","+_+","+ct.shadows.length,et&&tt.endShadows(),ht.calls=0,ht.vertices=0,ht.faces=0,void(ht.points=0)===i&&(i=null),this.setRenderTarget(i),null===(d=t.background)?dt.buffers.color.setClear(X.r,X.g,X.b,Y,P):d&&d.isColor&&(dt.buffers.color.setClear(d.r,d.g,d.b,1,P),n=!0),(this.autoClear||n)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil),d&&d.isCubeTexture?(bt.projectionMatrix.copy(e.projectionMatrix),bt.matrixWorld.extractRotation(e.matrixWorld),bt.matrixWorldInverse.getInverse(bt.matrixWorld),Mt.material.uniforms.tCube.value=d,Mt.modelViewMatrix.multiplyMatrices(bt.matrixWorldInverse,Mt.matrixWorld),mt.update(Mt),G.renderBufferDirect(bt,null,Mt.geometry,Mt.material,Mt,null)):d&&d.isTexture&&(wt.material.map=d,mt.update(wt),G.renderBufferDirect(_t,null,wt.geometry,wt.material,wt,null)),t.overrideMaterial?(n=t.overrideMaterial,A(I,t,e,n),A(N,t,e,n)):(dt.setBlending(0),A(I,t,e),A(N,t,e)),Lt.render(t,e),Rt.render(t,e,W),i&&ft.updateRenderTargetMipmap(i),dt.setDepthTest(!0),dt.setDepthWrite(!0),dt.setColorWrite(!0)}},this.setFaceCulling=function(t,e){dt.setCullFace(t),dt.setFlipSided(0===e)},this.allocTextureUnit=function(){var t=_;return t>=ut.maxTextures&&console.warn("WebGLRenderer: trying to use "+t+" texture units while this GPU supports only "+ut.maxTextures),_+=1,t},this.setTexture2D=(Tt=!1,function(t,e){t&&t.isWebGLRenderTarget&&(Tt||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),Tt=!0),t=t.texture),ft.setTexture2D(t,e)}),this.setTexture=(St=!1,function(t,e){St||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),St=!0),ft.setTexture2D(t,e)}),this.setTextureCube=(At=!1,function(t,e){t&&t.isWebGLRenderTargetCube&&(At||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),At=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?ft.setTextureCube(t,e):ft.setTextureCubeDynamic(t,e)}),this.getCurrentRenderTarget=function(){return H},this.setRenderTarget=function(t){(H=t)&&void 0===pt.get(t).__webglFramebuffer&&ft.setupRenderTarget(t);var e,i=t&&t.isWebGLRenderTargetCube;t?(e=pt.get(t),e=i?e.__webglFramebuffer[t.activeCubeFace]:e.__webglFramebuffer,y.copy(t.scissor),x=t.scissorTest,W.copy(t.viewport)):(e=null,y.copy(J).multiplyScalar(Z),x=Q,W.copy(K).multiplyScalar(Z)),v!==e&&(B.bindFramebuffer(B.FRAMEBUFFER,e),v=e),dt.scissor(y),dt.setScissorTest(x),dt.viewport(W),i&&(i=pt.get(t.texture),B.framebufferTexture2D(B.FRAMEBUFFER,B.COLOR_ATTACHMENT0,B.TEXTURE_CUBE_MAP_POSITIVE_X+t.activeCubeFace,i.__webglTexture,t.activeMipMapLevel))},this.readRenderTargetPixels=function(t,e,i,n,r,a){if(!1===(t&&t.isWebGLRenderTarget))console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");else{var o=pt.get(t).__webglFramebuffer;if(o){var s=!1;o!==v&&(B.bindFramebuffer(B.FRAMEBUFFER,o),s=!0);try{var c=t.texture,h=c.format,l=c.type;1023!==h&&u(h)!==B.getParameter(B.IMPLEMENTATION_COLOR_READ_FORMAT)?console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."):1009===l||u(l)===B.getParameter(B.IMPLEMENTATION_COLOR_READ_TYPE)||1015===l&&(lt.get("OES_texture_float")||lt.get("WEBGL_color_buffer_float"))||1016===l&&lt.get("EXT_color_buffer_half_float")?B.checkFramebufferStatus(B.FRAMEBUFFER)===B.FRAMEBUFFER_COMPLETE?0<=e&&e<=t.width-n&&0<=i&&i<=t.height-r&&B.readPixels(e,i,n,r,u(h),u(l),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."):console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.")}finally{s&&B.bindFramebuffer(B.FRAMEBUFFER,v)}}}}}function xt(t,e){this.name="",this.color=new Nt(t),this.density=void 0!==e?e:25e-5}function _t(t,e,i){this.name="",this.color=new Nt(t),this.near=void 0!==e?e:1,this.far=void 0!==i?i:1e3}function bt(){X.call(this),this.type="Scene",this.overrideMaterial=this.fog=this.background=null,this.autoUpdate=!0}function wt(t,e,i,n,r){X.call(this),this.lensFlares=[],this.positionScreen=new Ct,(this.customUpdateCallback=void 0)!==t&&this.add(t,e,i,n,r)}function Mt(t){N.call(this),this.type="SpriteMaterial",this.color=new Nt(16777215),this.map=null,this.rotation=0,this.lights=this.fog=!1,this.setValues(t)}function Et(t){X.call(this),this.type="Sprite",this.material=void 0!==t?t:new Mt}function Tt(){X.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function St(t,e,i){if(this.useVertexTexture=void 0===i||i,this.identityMatrix=new It,t=t||[],this.bones=t.slice(0),this.useVertexTexture?(t=Math.sqrt(4*this.bones.length),t=er.nextPowerOfTwo(Math.ceil(t)),this.boneTextureHeight=this.boneTextureWidth=t=Math.max(t,4),this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new U(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,1023,1015)):this.boneMatrices=new Float32Array(16*this.bones.length),void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else for(console.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[],e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new It)}function At(){X.call(this),this.type="Bone"}function Lt(t,e,i){if(kt.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new It,this.bindMatrixInverse=new It,t=[],this.geometry&&void 0!==this.geometry.bones){for(var n,r=0,a=this.geometry.bones.length;r<a;++r)n=this.geometry.bones[r],e=new At,t.push(e),e.name=n.name,e.position.fromArray(n.pos),e.quaternion.fromArray(n.rotq),void 0!==n.scl&&e.scale.fromArray(n.scl);for(r=0,a=this.geometry.bones.length;r<a;++r)-1!==(n=this.geometry.bones[r]).parent&&null!==n.parent&&void 0!==t[n.parent]?t[n.parent].add(t[r]):this.add(t[r])}this.normalizeSkinWeights(),this.updateMatrixWorld(!0),this.bind(new St(t,void 0,i),this.matrixWorld)}function Rt(t){N.call(this),this.type="LineBasicMaterial",this.color=new Nt(16777215),this.linewidth=1,this.linejoin=this.linecap="round",this.lights=!1,this.setValues(t)}function ae(t,e,i){if(1===i)return console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),new oe(t,e);X.call(this),this.type="Line",this.geometry=void 0!==t?t:new Vt,this.material=void 0!==e?e:new Rt({color:16777215*Math.random()})}function oe(t,e){ae.call(this,t,e),this.type="LineSegments"}function se(t){N.call(this),this.type="PointsMaterial",this.color=new Nt(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.lights=!1,this.setValues(t)}function ce(t,e){X.call(this),this.type="Points",this.geometry=void 0!==t?t:new Vt,this.material=void 0!==e?e:new se({color:16777215*Math.random()})}function he(){X.call(this),this.type="Group"}function le(e,t,i,n,r,a,o,s,c){z.call(this,e,t,i,n,r,a,o,s,c),this.generateMipmaps=!1;var h=this;!function t(){requestAnimationFrame(t),e.readyState>=e.HAVE_CURRENT_DATA&&(h.needsUpdate=!0)}()}function ue(t,e,i,n,r,a,o,s,c,h,l,u){z.call(this,null,a,o,s,c,h,n,r,l,u),this.image={width:e,height:i},this.mipmaps=t,this.generateMipmaps=this.flipY=!1}function de(t,e,i,n,r,a,o,s,c){z.call(this,t,e,i,n,r,a,o,s,c),this.needsUpdate=!0}function pe(t,e,i,n,r,a,o,s,c,h){if(1026!==(h=void 0!==h?h:1026)&&1027!==h)throw Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&1026===h&&(i=1012),void 0===i&&1027===h&&(i=1020),z.call(this,null,n,r,a,o,s,h,i,c),this.image={width:t,height:e},this.magFilter=void 0!==o?o:1003,this.minFilter=void 0!==s?s:1003,this.generateMipmaps=this.flipY=!1}function fe(t){function e(t,e){return t-e}Vt.call(this);var i=[0,0],n={},r=["a","b","c"];if(t&&t.isGeometry){var a=t.vertices,o=t.faces,s=0,c=new Uint32Array(6*o.length);t=0;for(var h=o.length;t<h;t++)for(var l=o[t],u=0;u<3;u++){i[0]=l[r[u]],i[1]=l[r[(u+1)%3]],i.sort(e);var d=i.toString();void 0===n[d]&&(c[2*s]=i[0],c[2*s+1]=i[1],n[d]=!0,s++)}for(i=new Float32Array(6*s),t=0,h=s;t<h;t++)for(u=0;u<2;u++)n=a[c[2*t+u]],i[(s=6*t+3*u)+0]=n.x,i[s+1]=n.y,i[s+2]=n.z;this.addAttribute("position",new J(i,3))}else if(t&&t.isBufferGeometry){if(null!==t.index){for(h=t.index.array,a=t.attributes.position,(s=0)===(r=t.groups).length&&t.addGroup(0,h.length),c=new Uint32Array(2*h.length),o=0,l=r.length;o<l;++o){u=(t=r[o]).start,d=t.count;for(var p=(t=u)+d;t<p;t+=3)for(u=0;u<3;u++)i[0]=h[t+u],i[1]=h[t+(u+1)%3],i.sort(e),void 0===n[d=i.toString()]&&(c[2*s]=i[0],c[2*s+1]=i[1],n[d]=!0,s++)}for(i=new Float32Array(6*s),t=0,h=s;t<h;t++)for(u=0;u<2;u++)s=6*t+3*u,n=c[2*t+u],i[s+0]=a.getX(n),i[s+1]=a.getY(n),i[s+2]=a.getZ(n)}else for(c=(s=(a=t.attributes.position.array).length/3)/3,i=new Float32Array(6*s),t=0,h=c;t<h;t++)for(u=0;u<3;u++)c=9*t+3*u,i[(s=18*t+6*u)+0]=a[c],i[s+1]=a[c+1],i[s+2]=a[c+2],n=9*t+(u+1)%3*3,i[s+3]=a[n],i[s+4]=a[n+1],i[s+5]=a[n+2];this.addAttribute("position",new J(i,3))}}function me(t,e,i){Vt.call(this),this.type="ParametricBufferGeometry",this.parameters={func:t,slices:e,stacks:i};var n,r,a,o,s,c,h=[],l=[],u=e+1;for(n=0;n<=i;n++)for(s=n/i,r=0;r<=e;r++)a=t(o=r/e,s),h.push(a.x,a.y,a.z),l.push(o,s);for(t=[],n=0;n<i;n++)for(r=0;r<e;r++)o=(a=n*u+r)+1,s=(n+1)*u+r+1,c=(n+1)*u+r,t.push(a,o,c),t.push(o,s,c);this.setIndex(new(65535<t.length?nt:et)(t,1)),this.addAttribute("position",new rt(h,3)),this.addAttribute("uv",new rt(l,2)),this.computeVertexNormals()}function ge(t,e,i){st.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:i},this.fromBufferGeometry(new me(t,e,i)),this.mergeVertices()}function ve(n,m,t,e){function g(t){u.push(t.x,t.y,t.z)}function v(t,e){var i=3*t;e.x=n[0+i],e.y=n[1+i],e.z=n[2+i]}function l(t,e,i,n){n<0&&1===t.x&&(d[e]=t.x-1),0===i.x&&0===i.z&&(d[e]=n/2/Math.PI+.5)}Vt.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:n,indices:m,radius:t,detail:e},t=t||1;var u=[],d=[];!function(t){for(var e=new Ct,i=new Ct,n=new Ct,r=0;r<m.length;r+=3){v(m[r+0],e),v(m[r+1],i),v(m[r+2],n);var a,o,s=e,c=i,h=n,l=Math.pow(2,t),u=[];for(a=0;a<=l;a++){u[a]=[];var d=s.clone().lerp(h,a/l),p=c.clone().lerp(h,a/l),f=l-a;for(o=0;o<=f;o++)u[a][o]=0===o&&a===l?d:d.clone().lerp(p,o/f)}for(a=0;a<l;a++)for(o=0;o<2*(l-a)-1;o++)s=Math.floor(o/2),0==o%2?(g(u[a][s+1]),g(u[a+1][s]),g(u[a][s])):(g(u[a][s+1]),g(u[a+1][s+1]),g(u[a+1][s]))}}(e||0),function(t){for(var e=new Ct,i=0;i<u.length;i+=3)e.x=u[i+0],e.y=u[i+1],e.z=u[i+2],e.normalize().multiplyScalar(t),u[i+0]=e.x,u[i+1]=e.y,u[i+2]=e.z}(t),function(){for(var t=new Ct,e=0;e<u.length;e+=3)t.x=u[e+0],t.y=u[e+1],t.z=u[e+2],d.push(Math.atan2(t.z,-t.x)/2/Math.PI+.5,1-(Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))/Math.PI+.5));t=new Ct,e=new Ct;for(var i=new Ct,n=new Ct,r=new V,a=new V,o=new V,s=0,c=0;s<u.length;s+=9,c+=6){t.set(u[s+0],u[s+1],u[s+2]),e.set(u[s+3],u[s+4],u[s+5]),i.set(u[s+6],u[s+7],u[s+8]),r.set(d[c+0],d[c+1]),a.set(d[c+2],d[c+3]),o.set(d[c+4],d[c+5]),n.copy(t).add(e).add(i).divideScalar(3);var h=Math.atan2(n.z,-n.x);l(r,c+0,t,h),l(a,c+2,e,h),l(o,c+4,i,h)}for(t=0;t<d.length;t+=6)e=d[t+0],i=d[t+2],n=d[t+4],r=Math.min(e,i,n),.9<Math.max(e,i,n)&&r<.1&&(e<.2&&(d[t+0]+=1),i<.2&&(d[t+2]+=1),n<.2&&(d[t+4]+=1))}(),this.addAttribute("position",new rt(u,3)),this.addAttribute("normal",new rt(u.slice(),3)),this.addAttribute("uv",new rt(d,2)),this.normalizeNormals(),this.boundingSphere=new zt(new Ct,t)}function ye(t,e){ve.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function xe(t,e){st.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new ye(t,e)),this.mergeVertices()}function _e(t,e){ve.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function be(t,e){st.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new _e(t,e)),this.mergeVertices()}function we(t,e){var i=(1+Math.sqrt(5))/2;ve.call(this,[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Me(t,e){st.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new we(t,e)),this.mergeVertices()}function Ee(t,e){var i=(1+Math.sqrt(5))/2,n=1/i;ve.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-i,0,-n,i,0,n,-i,0,n,i,-n,-i,0,-n,i,0,n,-i,0,n,i,0,-i,0,-n,i,0,-n,-i,0,n,i,0,n],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Te(t,e){st.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Ee(t,e)),this.mergeVertices()}function Se(t,e,i,n){st.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:i,detail:n},this.fromBufferGeometry(new ve(t,e,i,n)),this.mergeVertices()}function Ae(a,o,s,c,t){function e(t){var e=a.getPointAt(t/o),i=h.normals[t];for(t=h.binormals[t],l=0;l<=c;l++){var n=l/c*Math.PI*2,r=Math.sin(n);n=-Math.cos(n);d.x=n*i.x+r*t.x,d.y=n*i.y+r*t.y,d.z=n*i.z+r*t.z,d.normalize(),f.push(d.x,d.y,d.z),u.x=e.x+s*d.x,u.y=e.y+s*d.y,u.z=e.z+s*d.z,p.push(u.x,u.y,u.z)}}Vt.call(this),this.type="TubeBufferGeometry",this.parameters={path:a,tubularSegments:o,radius:s,radialSegments:c,closed:t},o=o||64,s=s||1,c=c||8,t=t||!1;var h=a.computeFrenetFrames(o,t);this.tangents=h.tangents,this.normals=h.normals,this.binormals=h.binormals;var n,l,u=new Ct,d=new Ct,i=new V,p=[],f=[],r=[],m=[];for(n=0;n<o;n++)e(n);for(e(!1===t?o:0),n=0;n<=o;n++)for(l=0;l<=c;l++)i.x=n/o,i.y=l/c,r.push(i.x,i.y);!function(){for(l=1;l<=o;l++)for(n=1;n<=c;n++){var t=(c+1)*l+(n-1),e=(c+1)*l+n,i=(c+1)*(l-1)+n;m.push((c+1)*(l-1)+(n-1),t,i),m.push(t,e,i)}}(),this.setIndex(new(65535<m.length?nt:et)(m,1)),this.addAttribute("position",new rt(p,3)),this.addAttribute("normal",new rt(f,3)),this.addAttribute("uv",new rt(r,2))}function Le(t,e,i,n,r,a){st.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:i,radialSegments:n,closed:r},void 0!==a&&console.warn("THREE.TubeGeometry: taper has been removed."),t=new Ae(t,e,i,n,r),this.tangents=t.tangents,this.normals=t.normals,this.binormals=t.binormals,this.fromBufferGeometry(t),this.mergeVertices()}function Re(t,e,i,n,r,a){function o(t,e,i,n,r){var a=Math.sin(t);e=i/e*t,i=Math.cos(e),r.x=n*(2+i)*.5*Math.cos(t),r.y=n*(2+i)*a*.5,r.z=n*Math.sin(e)*.5}Vt.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:i,radialSegments:n,p:r,q:a},t=t||100,e=e||40,i=Math.floor(i)||64,r=r||2,a=a||3;var s,c,h=((n=Math.floor(n)||8)+1)*(i+1),l=new J(new(65535<(l=n*i*6)?Uint32Array:Uint16Array)(l),1),u=new J(new Float32Array(3*h),3),d=new J(new Float32Array(3*h),3),p=(h=new J(new Float32Array(2*h),2),0),f=0,m=new Ct,g=new Ct,v=new V,y=new Ct,x=new Ct,_=new Ct,b=new Ct,w=new Ct;for(s=0;s<=i;++s)for(o(c=s/i*r*Math.PI*2,r,a,t,y),o(c+.01,r,a,t,x),b.subVectors(x,y),w.addVectors(x,y),_.crossVectors(b,w),w.crossVectors(_,b),_.normalize(),w.normalize(),c=0;c<=n;++c){var M=c/n*Math.PI*2,E=-e*Math.cos(M);M=e*Math.sin(M);m.x=y.x+(E*w.x+M*_.x),m.y=y.y+(E*w.y+M*_.y),m.z=y.z+(E*w.z+M*_.z),u.setXYZ(p,m.x,m.y,m.z),g.subVectors(m,y).normalize(),d.setXYZ(p,g.x,g.y,g.z),v.x=s/i,v.y=c/n,h.setXY(p,v.x,v.y),p++}for(c=1;c<=i;c++)for(s=1;s<=n;s++)t=(n+1)*c+(s-1),e=(n+1)*c+s,r=(n+1)*(c-1)+s,l.setX(f,(n+1)*(c-1)+(s-1)),f++,l.setX(f,t),f++,l.setX(f,r),f++,l.setX(f,t),f++,l.setX(f,e),f++,l.setX(f,r),f++;this.setIndex(l),this.addAttribute("position",u),this.addAttribute("normal",d),this.addAttribute("uv",h)}function Pe(t,e,i,n,r,a,o){st.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:i,radialSegments:n,p:r,q:a},void 0!==o&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new Re(t,e,i,n,r,a)),this.mergeVertices()}function Ce(t,e,i,n,r){Vt.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:i,tubularSegments:n,arc:r},t=t||100,e=e||40,i=Math.floor(i)||8,n=Math.floor(n)||6,r=r||2*Math.PI;var a,o,s=(i+1)*(n+1),c=new(65535<(c=i*n*6)?Uint32Array:Uint16Array)(c),h=new Float32Array(3*s),l=new Float32Array(3*s),u=(s=new Float32Array(2*s),0),d=0,p=0,f=new Ct,m=new Ct,g=new Ct;for(a=0;a<=i;a++)for(o=0;o<=n;o++){var v=o/n*r,y=a/i*Math.PI*2;m.x=(t+e*Math.cos(y))*Math.cos(v),m.y=(t+e*Math.cos(y))*Math.sin(v),m.z=e*Math.sin(y),h[u]=m.x,h[u+1]=m.y,h[u+2]=m.z,f.x=t*Math.cos(v),f.y=t*Math.sin(v),g.subVectors(m,f).normalize(),l[u]=g.x,l[u+1]=g.y,l[u+2]=g.z,s[d]=o/n,s[d+1]=a/i,u+=3,d+=2}for(a=1;a<=i;a++)for(o=1;o<=n;o++)t=(n+1)*(a-1)+o-1,e=(n+1)*(a-1)+o,r=(n+1)*a+o,c[p]=(n+1)*a+o-1,c[p+1]=t,c[p+2]=r,c[p+3]=t,c[p+4]=e,c[p+5]=r,p+=6;this.setIndex(new J(c,1)),this.addAttribute("position",new J(h,3)),this.addAttribute("normal",new J(l,3)),this.addAttribute("uv",new J(s,2))}function Ie(t,e,i,n,r){st.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:i,tubularSegments:n,arc:r},this.fromBufferGeometry(new Ce(t,e,i,n,r))}function Ue(t,e){void 0!==t&&(st.call(this),this.type="ExtrudeGeometry",t=Array.isArray(t)?t:[t],this.addShapeList(t,e),this.computeFaceNormals())}function Ne(t,e){var i=(e=e||{}).font;if(!1===(i&&i.isFont))return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new st;i=i.generateShapes(t,e.size,e.curveSegments),e.amount=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),Ue.call(this,i,e),this.type="TextGeometry"}function De(t,e,i,n,r,a,o){Vt.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:i,phiStart:n,phiLength:r,thetaStart:a,thetaLength:o},t=t||50,e=Math.max(3,Math.floor(e)||8),i=Math.max(2,Math.floor(i)||6),n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI;for(var s=(a=void 0!==a?a:0)+(o=void 0!==o?o:Math.PI),c=(e+1)*(i+1),h=new J(new Float32Array(3*c),3),l=new J(new Float32Array(3*c),3),u=(c=new J(new Float32Array(2*c),2),0),d=[],p=new Ct,f=0;f<=i;f++){for(var m=[],g=f/i,v=0;v<=e;v++){var y=v/e,x=-t*Math.cos(n+y*r)*Math.sin(a+g*o),_=t*Math.cos(a+g*o),b=t*Math.sin(n+y*r)*Math.sin(a+g*o);p.set(x,_,b).normalize(),h.setXYZ(u,x,_,b),l.setXYZ(u,p.x,p.y,p.z),c.setXY(u,y,1-g),m.push(u),u++}d.push(m)}for(n=[],f=0;f<i;f++)for(v=0;v<e;v++)r=d[f][v+1],o=d[f][v],u=d[f+1][v],p=d[f+1][v+1],(0!==f||0<a)&&n.push(r,o,p),(f!==i-1||s<Math.PI)&&n.push(o,u,p);this.setIndex(new(65535<h.count?nt:et)(n,1)),this.addAttribute("position",h),this.addAttribute("normal",l),this.addAttribute("uv",c),this.boundingSphere=new zt(new Ct,t)}function Oe(t,e,i,n,r,a,o){st.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:i,phiStart:n,phiLength:r,thetaStart:a,thetaLength:o},this.fromBufferGeometry(new De(t,e,i,n,r,a,o))}function Fe(t,e,i,n,r,a){Vt.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:i,phiSegments:n,thetaStart:r,thetaLength:a},t=t||20,e=e||50,r=void 0!==r?r:0,a=void 0!==a?a:2*Math.PI;var o,s,c=((i=void 0!==i?Math.max(3,i):8)+1)*((n=void 0!==n?Math.max(1,n):1)+1),h=new J(new(65535<(h=i*n*6)?Uint32Array:Uint16Array)(h),1),l=new J(new Float32Array(3*c),3),u=new J(new Float32Array(3*c),3),d=(c=new J(new Float32Array(2*c),2),0),p=0,f=t,m=(e-t)/n,g=new Ct,v=new V;for(t=0;t<=n;t++){for(s=0;s<=i;s++)o=r+s/i*a,g.x=f*Math.cos(o),g.y=f*Math.sin(o),l.setXYZ(d,g.x,g.y,g.z),u.setXYZ(d,0,0,1),v.x=(g.x/e+1)/2,v.y=(g.y/e+1)/2,c.setXY(d,v.x,v.y),d++;f+=m}for(t=0;t<n;t++)for(e=t*(i+1),s=0;s<i;s++)r=o=s+e,a=o+i+1,d=o+i+2,o+=1,h.setX(p,r),p++,h.setX(p,a),p++,h.setX(p,d),p++,h.setX(p,r),p++,h.setX(p,d),p++,h.setX(p,o),p++;this.setIndex(h),this.addAttribute("position",l),this.addAttribute("normal",u),this.addAttribute("uv",c)}function ze(t,e,i,n,r,a){st.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:i,phiSegments:n,thetaStart:r,thetaLength:a},this.fromBufferGeometry(new Fe(t,e,i,n,r,a))}function Be(t,e,i,n){st.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:n},this.fromBufferGeometry(new Wt(t,e,i,n))}function Ge(t,e,i,n){Vt.call(this),this.type="LatheBufferGeometry",this.parameters={points:t,segments:e,phiStart:i,phiLength:n},e=Math.floor(e)||12,i=i||0,n=n||2*Math.PI,n=er.clamp(n,0,2*Math.PI);var r=(e+1)*t.length,a=new J(new(65535<(p=e*t.length*6)?Uint32Array:Uint16Array)(p),1),o=new J(new Float32Array(3*r),3),s=new J(new Float32Array(2*r),2),c=0,h=0,l=1/e,u=new Ct,d=new V;for(r=0;r<=e;r++){var p=i+r*l*n,f=Math.sin(p),m=Math.cos(p);for(p=0;p<=t.length-1;p++)u.x=t[p].x*f,u.y=t[p].y,u.z=t[p].x*m,o.setXYZ(c,u.x,u.y,u.z),d.x=r/e,d.y=p/(t.length-1),s.setXY(c,d.x,d.y),c++}for(r=0;r<e;r++)for(p=0;p<t.length-1;p++)c=(i=p+r*t.length)+t.length,l=i+t.length+1,u=i+1,a.setX(h,i),h++,a.setX(h,c),h++,a.setX(h,u),h++,a.setX(h,c),h++,a.setX(h,l),h++,a.setX(h,u),h++;if(this.setIndex(a),this.addAttribute("position",o),this.addAttribute("uv",s),this.computeVertexNormals(),n===2*Math.PI)for(n=this.attributes.normal.array,a=new Ct,o=new Ct,s=new Ct,i=e*t.length*3,p=r=0;r<t.length;r++,p+=3)a.x=n[p+0],a.y=n[p+1],a.z=n[p+2],o.x=n[i+p+0],o.y=n[i+p+1],o.z=n[i+p+2],s.addVectors(a,o).normalize(),n[p+0]=n[i+p+0]=s.x,n[p+1]=n[i+p+1]=s.y,n[p+2]=n[i+p+2]=s.z}function He(t,e,i,n){st.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:i,phiLength:n},this.fromBufferGeometry(new Ge(t,e,i,n)),this.mergeVertices()}function Ve(t,s){function e(t){var e,i,n=c.length/3,r=(t=t.extractPoints(s)).shape,a=t.holes;if(!1===xo.isClockWise(r))for(r=r.reverse(),t=0,e=a.length;t<e;t++)i=a[t],!0===xo.isClockWise(i)&&(a[t]=i.reverse());var o=xo.triangulateShape(r,a);for(t=0,e=a.length;t<e;t++)i=a[t],r=r.concat(i);for(t=0,e=r.length;t<e;t++)i=r[t],c.push(i.x,i.y,0),h.push(0,0,1),l.push(i.x,i.y);for(t=0,e=o.length;t<e;t++)r=o[t],u.push(r[0]+n,r[1]+n,r[2]+n),d+=3}Vt.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:s},s=s||12;var c=[],h=[],l=[],u=[],i=0,d=0;if(!1===Array.isArray(t))e(t);else for(var n=0;n<t.length;n++)e(t[n]),this.addGroup(i,d,n),i+=d,d=0;this.setIndex(new(65535<u.length?nt:et)(u,1)),this.addAttribute("position",new rt(c,3)),this.addAttribute("normal",new rt(h,3)),this.addAttribute("uv",new rt(l,2))}function ke(t,e){st.call(this),this.type="ShapeGeometry","object"==typeof e&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),e=e.curveSegments),this.parameters={shapes:t,curveSegments:e},this.fromBufferGeometry(new Ve(t,e)),this.mergeVertices()}function je(t,e){function i(t,e){return t-e}Vt.call(this);var n,r=Math.cos(er.DEG2RAD*(void 0!==e?e:1)),a=[0,0],o={},s=["a","b","c"];t.isBufferGeometry?(n=new st).fromBufferGeometry(t):n=t.clone(),n.mergeVertices(),n.computeFaceNormals();for(var c=n.vertices,h=0,l=(n=n.faces).length;h<l;h++)for(var u=n[h],d=0;d<3;d++){a[0]=u[s[d]],a[1]=u[s[(d+1)%3]],a.sort(i);var p=a.toString();void 0===o[p]?o[p]={vert1:a[0],vert2:a[1],face1:h,face2:void 0}:o[p].face2=h}for(p in a=[],o)(void 0===(s=o[p]).face2||n[s.face1].normal.dot(n[s.face2].normal)<=r)&&(h=c[s.vert1],a.push(h.x),a.push(h.y),a.push(h.z),h=c[s.vert2],a.push(h.x),a.push(h.y),a.push(h.z));this.addAttribute("position",new rt(a,3))}function We(d,p,f,m,g,t,v,y){function e(t){var e,i,n,r=new V,a=new Ct,o=0,s=!0===t?d:p,c=!0===t?1:-1;for(i=E,e=1;e<=m;e++)b.setXYZ(E,0,A*c,0),w.setXYZ(E,0,c,0),r.x=.5,r.y=.5,M.setXY(E,r.x,r.y),E++;for(n=E,e=0;e<=m;e++){var h=e/m*y+v,l=Math.cos(h);h=Math.sin(h);a.x=s*h,a.y=A*c,a.z=s*l,b.setXYZ(E,a.x,a.y,a.z),w.setXYZ(E,0,c,0),r.x=.5*l+.5,r.y=.5*h*c+.5,M.setXY(E,r.x,r.y),E++}for(e=0;e<m;e++)r=i+e,a=n+e,!0===t?(_.setX(T,a),T++,_.setX(T,a+1)):(_.setX(T,a+1),T++,_.setX(T,a)),T++,_.setX(T,r),T++,o+=3;x.addGroup(L,o,!0===t?1:2),L+=o}Vt.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:d,radiusBottom:p,height:f,radialSegments:m,heightSegments:g,openEnded:t,thetaStart:v,thetaLength:y};var x=this;d=void 0!==d?d:20,p=void 0!==p?p:20,f=void 0!==f?f:100,m=Math.floor(m)||8,g=Math.floor(g)||1,t=void 0!==t&&t,v=void 0!==v?v:0,y=void 0!==y?y:2*Math.PI;var i=0;!1===t&&(0<d&&i++,0<p&&i++);var n,r,a=(r=(m+1)*(g+1),!1===t&&(r+=(m+1)*i+m*i),r),o=(n=m*g*6,!1===t&&(n+=m*i*3),n),_=new J(new(65535<o?Uint32Array:Uint16Array)(o),1),b=new J(new Float32Array(3*a),3),w=new J(new Float32Array(3*a),3),M=new J(new Float32Array(2*a),2),E=0,T=0,S=[],A=f/2,L=0;!function(){var t,e,i=new Ct,n=new Ct,r=0,a=(p-d)/f;for(e=0;e<=g;e++){var o=[],s=e/g,c=s*(p-d)+d;for(t=0;t<=m;t++){var h=t/m,l=h*y+v,u=Math.sin(l);l=Math.cos(l);n.x=c*u,n.y=-s*f+A,n.z=c*l,b.setXYZ(E,n.x,n.y,n.z),i.set(u,a,l).normalize(),w.setXYZ(E,i.x,i.y,i.z),M.setXY(E,h,1-s),o.push(E),E++}S.push(o)}for(t=0;t<m;t++)for(e=0;e<g;e++)i=S[e+1][t],n=S[e+1][t+1],a=S[e][t+1],_.setX(T,S[e][t]),T++,_.setX(T,i),T++,_.setX(T,a),T++,_.setX(T,i),T++,_.setX(T,n),T++,_.setX(T,a),T++,r+=6;x.addGroup(L,r,0),L+=r}(),!1===t&&(0<d&&e(!0),0<p&&e(!1)),this.setIndex(_),this.addAttribute("position",b),this.addAttribute("normal",w),this.addAttribute("uv",M)}function Xe(t,e,i,n,r,a,o,s){st.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:i,radialSegments:n,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new We(t,e,i,n,r,a,o,s)),this.mergeVertices()}function Ye(t,e,i,n,r,a,o){Xe.call(this,0,t,e,i,n,r,a,o),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:a,thetaLength:o}}function qe(t,e,i,n,r,a,o){We.call(this,0,t,e,i,n,r,a,o),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:a,thetaLength:o}}function Ze(t,e,i,n){Vt.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:i,thetaLength:n},t=t||50,e=void 0!==e?Math.max(3,e):8,i=void 0!==i?i:0,n=void 0!==n?n:2*Math.PI;var r=e+2,a=new Float32Array(3*r),o=new Float32Array(3*r);r=new Float32Array(2*r);o[2]=1,r[0]=.5,r[1]=.5;for(var s=0,c=3,h=2;s<=e;s++,c+=3,h+=2){var l=i+s/e*n;a[c]=t*Math.cos(l),a[c+1]=t*Math.sin(l),o[c+2]=1,r[h]=(a[c]/t+1)/2,r[h+1]=(a[c+1]/t+1)/2}for(i=[],c=1;c<=e;c++)i.push(c,c+1,0);this.setIndex(new J(new Uint16Array(i),1)),this.addAttribute("position",new J(a,3)),this.addAttribute("normal",new J(o,3)),this.addAttribute("uv",new J(r,2)),this.boundingSphere=new zt(new Ct,t)}function Je(t,e,i,n){st.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:i,thetaLength:n},this.fromBufferGeometry(new Ze(t,e,i,n))}function Qe(t,e,i,n,r,a){st.call(this),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:n,heightSegments:r,depthSegments:a},this.fromBufferGeometry(new jt(t,e,i,n,r,a)),this.mergeVertices()}function Ke(){Ft.call(this,{uniforms:Lr.merge([Ur.lights,{opacity:{value:1}}]),vertexShader:Rr.shadow_vert,fragmentShader:Rr.shadow_frag}),this.transparent=this.lights=!0,Object.defineProperties(this,{opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}}})}function $e(t){Ft.call(this,t),this.type="RawShaderMaterial"}function ti(t){this.uuid=er.generateUUID(),this.type="MultiMaterial",this.materials=Array.isArray(t)?t:[],this.visible=!0}function ei(t){N.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Nt(16777215),this.metalness=this.roughness=.5,this.lightMap=this.map=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Nt(0),this.emissiveIntensity=1,this.bumpMap=this.emissiveMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new V(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.envMap=this.alphaMap=this.metalnessMap=this.roughnessMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(t)}function ii(t){ei.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoatRoughness=this.clearCoat=0,this.setValues(t)}function ni(t){N.call(this),this.type="MeshPhongMaterial",this.color=new Nt(16777215),this.specular=new Nt(1118481),this.shininess=30,this.lightMap=this.map=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Nt(0),this.emissiveIntensity=1,this.bumpMap=this.emissiveMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new V(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.envMap=this.alphaMap=this.specularMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(t)}function ri(t){ni.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(t)}function ai(t){N.call(this,t),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new V(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.morphNormals=this.morphTargets=this.skinning=this.lights=this.fog=!1,this.setValues(t)}function oi(t){N.call(this),this.type="MeshLambertMaterial",this.color=new Nt(16777215),this.lightMap=this.map=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Nt(0),this.emissiveIntensity=1,this.envMap=this.alphaMap=this.specularMap=this.emissiveMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(t)}function si(t){N.call(this),this.type="LineDashedMaterial",this.color=new Nt(16777215),this.scale=this.linewidth=1,this.dashSize=3,this.gapSize=1,this.lights=!1,this.setValues(t)}function ci(t,e,i){var n=this,r=!1,a=0,o=0;this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this.itemStart=function(t){o++,!1===r&&void 0!==n.onStart&&n.onStart(t,a,o),r=!0},this.itemEnd=function(t){a++,void 0!==n.onProgress&&n.onProgress(t,a,o),a===o&&(r=!1,void 0!==n.onLoad)&&n.onLoad()},this.itemError=function(t){void 0!==n.onError&&n.onError(t)}}function hi(t){this.manager=void 0!==t?t:Mo}function li(t){this.manager=void 0!==t?t:Mo,this._parser=null}function ui(t){this.manager=void 0!==t?t:Mo,this._parser=null}function di(t){this.manager=void 0!==t?t:Mo}function pi(t){this.manager=void 0!==t?t:Mo}function fi(t){this.manager=void 0!==t?t:Mo}function mi(t,e){X.call(this),this.type="Light",this.color=new Nt(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function gi(t,e,i){mi.call(this,t,i),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(X.DefaultUp),this.updateMatrix(),this.groundColor=new Nt(e)}function vi(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new V(512,512),this.map=null,this.matrix=new It}function yi(){vi.call(this,new Xt(50,1,.5,500))}function xi(t,e,i,n,r,a){mi.call(this,t,e),this.type="SpotLight",this.position.copy(X.DefaultUp),this.updateMatrix(),this.target=new X,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==i?i:0,this.angle=void 0!==n?n:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==a?a:1,this.shadow=new yi}function _i(t,e,i,n){mi.call(this,t,e),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==i?i:0,this.decay=void 0!==n?n:1,this.shadow=new vi(new Xt(90,1,.5,500))}function bi(t){vi.call(this,new Yt(-5,5,5,-5,.5,500))}function wi(t,e){mi.call(this,t,e),this.type="DirectionalLight",this.position.copy(X.DefaultUp),this.updateMatrix(),this.target=new X,this.shadow=new bi}function Mi(t,e){mi.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function Ei(t,e,i,n){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new e.constructor(i),this.sampleValues=e,this.valueSize=i}function Ti(t,e,i,n){Ei.call(this,t,e,i,n),this._offsetNext=this._weightNext=this._offsetPrev=this._weightPrev=-0}function Si(t,e,i,n){Ei.call(this,t,e,i,n)}function Ai(t,e,i,n){Ei.call(this,t,e,i,n)}function Li(t,e,i,n){if(void 0===t)throw Error("track name is undefined");if(void 0===e||0===e.length)throw Error("no keyframes in track named "+t);this.name=t,this.times=Ro.convertArray(e,this.TimeBufferType),this.values=Ro.convertArray(i,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation),this.validate(),this.optimize()}function Ri(t,e,i,n){Li.call(this,t,e,i,n)}function Pi(t,e,i,n){Ei.call(this,t,e,i,n)}function Ci(t,e,i,n){Li.call(this,t,e,i,n)}function Ii(t,e,i,n){Li.call(this,t,e,i,n)}function Ui(t,e,i,n){Li.call(this,t,e,i,n)}function Ni(t,e,i){Li.call(this,t,e,i)}function Di(t,e,i,n){Li.call(this,t,e,i,n)}function Oi(t,e,i,n){Li.apply(this,arguments)}function Fi(t,e,i){this.name=t,this.tracks=i,this.duration=void 0!==e?e:-1,this.uuid=er.generateUUID(),this.duration<0&&this.resetDuration(),this.optimize()}function zi(t){this.manager=void 0!==t?t:Mo,this.textures={}}function Bi(t){this.manager=void 0!==t?t:Mo}function Gi(){this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}}function Hi(t){"boolean"==typeof t&&(console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),t=void 0),this.manager=void 0!==t?t:Mo,this.withCredentials=!1}function Vi(t){this.manager=void 0!==t?t:Mo,this.texturePath=""}function ki(){}function ji(t,e){this.v1=t,this.v2=e}function Wi(){this.curves=[],this.autoClose=!1}function Xi(t,e,i,n,r,a,o,s){this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=n,this.aStartAngle=r,this.aEndAngle=a,this.aClockwise=o,this.aRotation=s||0}function Yi(t){this.points=void 0===t?[]:t}function qi(t,e,i,n){this.v0=t,this.v1=e,this.v2=i,this.v3=n}function Zi(t,e,i){this.v0=t,this.v1=e,this.v2=i}function Ji(){Qi.apply(this,arguments),this.holes=[]}function Qi(t){Wi.call(this),this.currentPoint=new V,t&&this.fromPoints(t)}function Ki(){this.subPaths=[],this.currentPath=null}function $i(t){this.data=t}function tn(t){this.manager=void 0!==t?t:Mo}function en(t){this.manager=void 0!==t?t:Mo}function nn(t,e,i,n){mi.call(this,t,e),this.type="RectAreaLight",this.position.set(0,1,0),this.updateMatrix(),this.width=void 0!==i?i:10,this.height=void 0!==n?n:10}function rn(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Xt,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Xt,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}function an(t,e,i){X.call(this),this.type="CubeCamera";var r=new Xt(90,1,t,e);r.up.set(0,-1,0),r.lookAt(new Ct(1,0,0)),this.add(r);var a=new Xt(90,1,t,e);a.up.set(0,-1,0),a.lookAt(new Ct(-1,0,0)),this.add(a);var o=new Xt(90,1,t,e);o.up.set(0,0,1),o.lookAt(new Ct(0,1,0)),this.add(o);var s=new Xt(90,1,t,e);s.up.set(0,0,-1),s.lookAt(new Ct(0,-1,0)),this.add(s);var c=new Xt(90,1,t,e);c.up.set(0,-1,0),c.lookAt(new Ct(0,0,1)),this.add(c);var h=new Xt(90,1,t,e);h.up.set(0,-1,0),h.lookAt(new Ct(0,0,-1)),this.add(h),this.renderTarget=new n(i,i,{format:1022,magFilter:1006,minFilter:1006}),this.updateCubeMap=function(t,e){null===this.parent&&this.updateMatrixWorld();var i=this.renderTarget,n=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,i.activeCubeFace=0,t.render(e,r,i),i.activeCubeFace=1,t.render(e,a,i),i.activeCubeFace=2,t.render(e,o,i),i.activeCubeFace=3,t.render(e,s,i),i.activeCubeFace=4,t.render(e,c,i),i.texture.generateMipmaps=n,i.activeCubeFace=5,t.render(e,h,i),t.setRenderTarget(null)}}function on(){X.call(this),this.type="AudioListener",this.context=ps.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null}function sn(t){X.call(this),this.type="Audio",this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.loop=!1,this.startTime=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function cn(t){sn.call(this,t),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function hn(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}function ln(t,e,i){switch(this.binding=t,this.valueSize=i,t=Float64Array,e){case"quaternion":e=this._slerp;break;case"string":case"bool":t=Array,e=this._select;break;default:e=this._lerp}this.buffer=new t(4*i),this._mixBufferRegion=e,this.referenceCount=this.useCount=this.cumulativeWeight=0}function un(t,e,i){this.path=e,this.parsedPath=i||un.parseTrackName(e),this.node=un.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function dn(t){this.uuid=er.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var i=0,n=arguments.length;i!==n;++i)e[arguments[i].uuid]=i;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var r=this;this.stats={objects:{get total(){return r._objects.length},get inUse(){return this.total-r.nCachedObjects_}},get bindingsPerObject(){return r._bindings.length}}}function pn(t,e,i){this._mixer=t,this._clip=e,this._localRoot=i||null,e=(t=e.tracks).length,i=Array(e);for(var n={endingStart:2400,endingEnd:2400},r=0;r!==e;++r){var a=t[r].createInterpolant(null);(i[r]=a).settings=n}this._interpolantSettings=n,this._interpolants=i,this._propertyBindings=Array(e),this._weightInterpolant=this._timeScaleInterpolant=this._byClipCacheIndex=this._cacheIndex=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this._effectiveWeight=this.weight=this._effectiveTimeScale=this.timeScale=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtEnd=this.zeroSlopeAtStart=!0}function fn(t){this._root=t,this._initMemoryManager(),this.time=this._accuIndex=0,this.timeScale=1}function mn(t,e){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=e),this.value=t}function gn(){Vt.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function vn(t,e,i,n){this.uuid=er.generateUUID(),this.data=t,this.itemSize=e,this.offset=i,this.normalized=!0===n}function yn(t,e){this.uuid=er.generateUUID(),this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function xn(t,e,i){yn.call(this,t,e),this.meshPerAttribute=i||1}function _n(t,e,i){J.call(this,t,e),this.meshPerAttribute=i||1}function bn(t,e,i,n){this.ray=new k(t,e),this.near=i||0,this.far=n||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function wn(t,e){return t.distance-e.distance}function Mn(t,e,i,n){if(!1!==t.visible&&(t.raycast(e,i),!0===n)){n=0;for(var r=(t=t.children).length;n<r;n++)Mn(t[n],e,i,!0)}}function En(t){this.autoStart=void 0===t||t,this.elapsedTime=this.oldTime=this.startTime=0,this.running=!1}function Tn(t,e,i){return this.radius=void 0!==t?t:1,this.phi=void 0!==e?e:0,this.theta=void 0!==i?i:0,this}function Sn(t,e,i){return this.radius=void 0!==t?t:1,this.theta=void 0!==e?e:0,this.y=void 0!==i?i:0,this}function An(t,e){kt.call(this,t,e),this.animationsMap={},this.animationsList=[];var i=this.geometry.morphTargets.length;this.createAnimation("__default",0,i-1,i/1),this.setAnimationWeight("__default",1)}function Ln(t){X.call(this),this.material=t,this.render=function(t){}}function Rn(t,e,i,n){this.object=t,this.size=void 0!==e?e:1,t=void 0!==i?i:16711680,n=void 0!==n?n:1,e=0,(i=this.object.geometry)&&i.isGeometry?e=3*i.faces.length:i&&i.isBufferGeometry&&(e=i.attributes.normal.count),i=new Vt,e=new rt(6*e,3),i.addAttribute("position",e),oe.call(this,i,new Rt({color:t,linewidth:n})),this.matrixAutoUpdate=!1,this.update()}function Pn(t){X.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,t=new Vt;for(var e=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,n=1;i<32;i++,n++){var r=i/32*Math.PI*2,a=n/32*Math.PI*2;e.push(Math.cos(r),Math.sin(r),1,Math.cos(a),Math.sin(a),1)}t.addAttribute("position",new rt(e,3)),e=new Rt({fog:!1}),this.cone=new oe(t,e),this.add(this.cone),this.update()}function Cn(t){this.bones=this.getBoneList(t);for(var e=new Vt,i=[],n=[],r=new Nt(0,0,1),a=new Nt(0,1,0),o=0;o<this.bones.length;o++){var s=this.bones[o];s.parent&&s.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),n.push(r.r,r.g,r.b),n.push(a.r,a.g,a.b))}e.addAttribute("position",new rt(i,3)),e.addAttribute("color",new rt(n,3)),i=new Rt({vertexColors:2,depthTest:!1,depthWrite:!1,transparent:!0}),oe.call(this,e,i),this.root=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function In(t,e){this.light=t,this.light.updateMatrixWorld();var i=new De(e,4,2),n=new Ht({wireframe:!0,fog:!1});n.color.copy(this.light.color).multiplyScalar(this.light.intensity),kt.call(this,i,n),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1}function Un(t){X.call(this),this.light=t,this.light.updateMatrixWorld();var e=new Ht({color:t.color,fog:!1});t=new Ht({color:t.color,fog:!1,wireframe:!0});var i=new Vt;i.addAttribute("position",new J(new Float32Array(18),3)),this.add(new kt(i,e)),this.add(new kt(i,t)),this.update()}function Nn(t,e){X.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1;var i=new _e(e);i.rotateY(.5*Math.PI);var n=new Ht({vertexColors:2,wireframe:!0}),r=i.getAttribute("position");r=new Float32Array(3*r.count);i.addAttribute("color",new J(r,3)),this.add(new kt(i,n)),this.update()}function Dn(t,e,i,n){t=t||10,e=e||10,i=new Nt(void 0!==i?i:4473924),n=new Nt(void 0!==n?n:8947848);for(var r=e/2,a=2*t/e,o=[],s=[],c=0,h=0,l=-t;c<=e;c++,l+=a){o.push(-t,0,l,t,0,l),o.push(l,0,-t,l,0,t);var u=c===r?i:n;u.toArray(s,h),h+=3,u.toArray(s,h),h+=3,u.toArray(s,h),h+=3,u.toArray(s,h),h+=3}(t=new Vt).addAttribute("position",new rt(o,3)),t.addAttribute("color",new rt(s,3)),o=new Rt({vertexColors:2}),oe.call(this,t,o)}function On(t,e,i,n,r,a){t=t||10,e=e||16,i=i||8,n=n||64,r=new Nt(void 0!==r?r:4473924),a=new Nt(void 0!==a?a:8947848);var o,s,c,h,l,u=[],d=[];for(c=0;c<=e;c++)s=c/e*2*Math.PI,o=Math.sin(s)*t,s=Math.cos(s)*t,u.push(0,0,0),u.push(o,0,s),l=1&c?r:a,d.push(l.r,l.g,l.b),d.push(l.r,l.g,l.b);for(c=0;c<=i;c++)for(l=1&c?r:a,h=t-t/i*c,e=0;e<n;e++)s=e/n*2*Math.PI,o=Math.sin(s)*h,s=Math.cos(s)*h,u.push(o,0,s),d.push(l.r,l.g,l.b),s=(e+1)/n*2*Math.PI,o=Math.sin(s)*h,s=Math.cos(s)*h,u.push(o,0,s),d.push(l.r,l.g,l.b);(t=new Vt).addAttribute("position",new rt(u,3)),t.addAttribute("color",new rt(d,3)),u=new Rt({vertexColors:2}),oe.call(this,t,u)}function Fn(t,e,i,n){this.object=t,this.size=void 0!==e?e:1,t=void 0!==i?i:16776960,n=void 0!==n?n:1,e=0,(i=this.object.geometry)&&i.isGeometry?e=i.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead."),i=new Vt,e=new rt(6*e,3),i.addAttribute("position",e),oe.call(this,i,new Rt({color:t,linewidth:n})),this.matrixAutoUpdate=!1,this.update()}function zn(t,e){X.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,void 0===e&&(e=1);var i=new Vt;i.addAttribute("position",new rt([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));var n=new Rt({fog:!1});this.add(new ae(i,n)),(i=new Vt).addAttribute("position",new rt([0,0,0,0,0,1],3)),this.add(new ae(i,n)),this.update()}function Bn(t){function e(t,e,i){n(t,i),n(e,i)}function n(t,e){a.push(0,0,0),o.push(e.r,e.g,e.b),void 0===s[t]&&(s[t]=[]),s[t].push(a.length/3-1)}var i=new Vt,r=new Rt({color:16777215,vertexColors:1}),a=[],o=[],s={},c=new Nt(16755200),h=new Nt(16711680),l=new Nt(43775),u=new Nt(16777215),d=new Nt(3355443);e("n1","n2",c),e("n2","n4",c),e("n4","n3",c),e("n3","n1",c),e("f1","f2",c),e("f2","f4",c),e("f4","f3",c),e("f3","f1",c),e("n1","f1",c),e("n2","f2",c),e("n3","f3",c),e("n4","f4",c),e("p","n1",h),e("p","n2",h),e("p","n3",h),e("p","n4",h),e("u1","u2",l),e("u2","u3",l),e("u3","u1",l),e("c","t",u),e("p","c",d),e("cn1","cn2",d),e("cn3","cn4",d),e("cf1","cf2",d),e("cf3","cf4",d),i.addAttribute("position",new rt(a,3)),i.addAttribute("color",new rt(o,3)),oe.call(this,i,r),this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update()}function Gn(t,e){void 0===e&&(e=16776960);var i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new Float32Array(24),r=new Vt;r.setIndex(new J(i,1)),r.addAttribute("position",new J(n,3)),oe.call(this,r,new Rt({color:e})),void 0!==t&&this.update(t)}function Hn(t,e,i,n,r,a){X.call(this),void 0===n&&(n=16776960),void 0===i&&(i=1),void 0===r&&(r=.2*i),void 0===a&&(a=.2*r),this.position.copy(e),this.line=new ae(fs,new Rt({color:n})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new kt(vs,new Ht({color:n})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(i,r,a)}function Vn(t){var e=[0,0,0,t=t||1,0,0,0,0,0,0,t,0,0,0,0,0,0,t];(t=new Vt).addAttribute("position",new rt(e,3)),t.addAttribute("color",new rt([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3)),e=new Rt({vertexColors:2}),oe.call(this,t,e)}function kn(t,e,i,n,r,a){Xi.call(this,t,e,i,i,n,r,a)}function jn(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),xs.call(this,t),this.type="catmullrom",this.closed=!0}void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:0<t?1:+t}),void 0===Function.prototype.name&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}),Object.assign(e.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var i=this._listeners;return void 0!==i[t]&&-1!==i[t].indexOf(e)},removeEventListener:function(t,e){if(void 0!==this._listeners){var i=this._listeners[t];if(void 0!==i){var n=i.indexOf(e);-1!==n&&i.splice(n,1)}}},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners[t.type];if(void 0!==e){t.target=this;var i,n=[],r=e.length;for(i=0;i<r;i++)n[i]=e[i];for(i=0;i<r;i++)n[i].call(this,t)}}}});var Wn,Xn,Yn,qn,Zn,Jn,Qn={NoBlending:0,NormalBlending:1,AdditiveBlending:2,SubtractiveBlending:3,MultiplyBlending:4,CustomBlending:5},Kn={UVMapping:300,CubeReflectionMapping:301,CubeRefractionMapping:302,EquirectangularReflectionMapping:303,EquirectangularRefractionMapping:304,SphericalReflectionMapping:305,CubeUVReflectionMapping:306,CubeUVRefractionMapping:307},$n={RepeatWrapping:1e3,ClampToEdgeWrapping:1001,MirroredRepeatWrapping:1002},tr={NearestFilter:1003,NearestMipMapNearestFilter:1004,NearestMipMapLinearFilter:1005,LinearFilter:1006,LinearMipMapNearestFilter:1007,LinearMipMapLinearFilter:1008},er={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:(Xn="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),Yn=Array(36),qn=0,function(){for(var t=0;t<36;t++)8===t||13===t||18===t||23===t?Yn[t]="-":14===t?Yn[t]="4":(qn<=2&&(qn=33554432+16777216*Math.random()|0),Wn=15&qn,qn>>=4,Yn[t]=Xn[19===t?3&Wn|8:Wn]);return Yn.join("")}),clamp:function(t,e,i){return Math.max(e,Math.min(i,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,i,n,r){return n+(t-e)*(r-n)/(i-e)},lerp:function(t,e,i){return(1-i)*t+i*e},smoothstep:function(t,e,i){return t<=e?0:i<=t?1:(t=(t-e)/(i-e))*t*(3-2*t)},smootherstep:function(t,e,i){return t<=e?0:i<=t?1:(t=(t-e)/(i-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*er.DEG2RAD},radToDeg:function(t){return t*er.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}};V.prototype={constructor:V,isVector2:!0,get width(){return this.x},set width(t){this.x=t},get height(){return this.y},set height(t){this.y=t},set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.y=this.x=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return isFinite(t)?(this.x*=t,this.y*=t):this.y=this.x=0,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(t,e){return void 0===Zn&&(Zn=new V,Jn=new V),Zn.set(t,t),Jn.set(e,e),this.clamp(Zn,Jn)},clampLength:function(t,e){var i=this.length();return this.multiplyScalar(Math.max(t,Math.min(e,i))/i)},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length())},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x;return e*e+(t=this.y-t.y)*t},distanceToManhattan:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.multiplyScalar(t/this.length())},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,i){return this.subVectors(e,t).multiplyScalar(i).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromAttribute:function(t,e,i){return void 0!==i&&console.warn("THREE.Vector2: offset has been removed from .fromAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){var i=Math.cos(e),n=Math.sin(e),r=this.x-t.x,a=this.y-t.y;return this.x=r*i-a*n+t.x,this.y=r*n+a*i+t.y,this}};var ir,nr,rr,ar,or,sr,cr,hr,lr,ur,dr,pr,fr,mr,gr,vr,yr,xr,_r,br,wr=0;z.DEFAULT_IMAGE=void 0,z.DEFAULT_MAPPING=300,z.prototype={constructor:z,isTexture:!0,set needsUpdate(t){!0===t&&this.version++},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){if(void 0!==t.textures[this.uuid])return t.textures[this.uuid];var e={metadata:{version:4.4,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],wrap:[this.wrapS,this.wrapT],minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(void 0!==this.image){var i=this.image;if(void 0===i.uuid&&(i.uuid=er.generateUUID()),void 0===t.images[i.uuid]){var n,r=t.images,a=i.uuid,o=i.uuid;void 0!==i.toDataURL?n=i:((n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")).width=i.width,n.height=i.height,n.getContext("2d").drawImage(i,0,0,i.width,i.height)),n=2048<n.width||2048<n.height?n.toDataURL("image/jpeg",.6):n.toDataURL("image/png"),r[a]={uuid:o,url:n}}e.image=i.uuid}return t.textures[this.uuid]=e},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(300===this.mapping){if(t.multiply(this.repeat),t.add(this.offset),t.x<0||1<t.x)switch(this.wrapS){case 1e3:t.x-=Math.floor(t.x);break;case 1001:t.x=t.x<0?0:1;break;case 1002:t.x=1===Math.abs(Math.floor(t.x)%2)?Math.ceil(t.x)-t.x:t.x-Math.floor(t.x)}if(t.y<0||1<t.y)switch(this.wrapT){case 1e3:t.y-=Math.floor(t.y);break;case 1001:t.y=t.y<0?0:1;break;case 1002:t.y=1===Math.abs(Math.floor(t.y)%2)?Math.ceil(t.y)-t.y:t.y-Math.floor(t.y)}this.flipY&&(t.y=1-t.y)}}},Object.assign(z.prototype,e.prototype),Pt.prototype={constructor:Pt,isVector4:!0,set:function(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this},setScalar:function(t){return this.w=this.z=this.y=this.x=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t,this.w*=t):this.w=this.z=this.y=this.x=0,this},applyMatrix4:function(t){var e=this.x,i=this.y,n=this.z,r=this.w;return t=t.elements,this.x=t[0]*e+t[4]*i+t[8]*n+t[12]*r,this.y=t[1]*e+t[5]*i+t[9]*n+t[13]*r,this.z=t[2]*e+t[6]*i+t[10]*n+t[14]*r,this.w=t[3]*e+t[7]*i+t[11]*n+t[15]*r,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.z=this.y=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,i,n,r=(t=t.elements)[0];n=t[4];var a=t[8],o=t[1],s=t[5],c=t[9];i=t[2],e=t[6];var h=t[10];return Math.abs(n-o)<.01&&Math.abs(a-i)<.01&&Math.abs(c-e)<.01?Math.abs(n+o)<.1&&Math.abs(a+i)<.1&&Math.abs(c+e)<.1&&Math.abs(r+s+h-3)<.1?this.set(1,0,0,0):(t=Math.PI,h=(h+1)/2,n=(n+o)/4,a=(a+i)/4,c=(c+e)/4,(s=(s+1)/2)<(r=(r+1)/2)&&h<r?n=r<.01?(e=0,i=.707106781):(i=n/(e=Math.sqrt(r)),a/e):h<s?n=s<.01?(i=0,e=.707106781):(e=n/(i=Math.sqrt(s)),c/i):h<.01?(i=e=.707106781,n=0):(e=a/(n=Math.sqrt(h)),i=c/n),this.set(e,i,n,t)):(t=Math.sqrt((e-c)*(e-c)+(a-i)*(a-i)+(o-n)*(o-n)),Math.abs(t)<.001&&(t=1),this.x=(e-c)/t,this.y=(a-i)/t,this.z=(o-n)/t,this.w=Math.acos((r+s+h-1)/2)),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(t,e){return void 0===ir&&(ir=new Pt,nr=new Pt),ir.set(t,t,t,t),nr.set(e,e,e,e),this.clamp(ir,nr)},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())},setLength:function(t){return this.multiplyScalar(t/this.length())},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,i){return this.subVectors(e,t).multiplyScalar(i).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromAttribute:function(t,e,i){return void 0!==i&&console.warn("THREE.Vector4: offset has been removed from .fromAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}},Object.assign(B.prototype,e.prototype,{isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),((n.prototype=Object.create(B.prototype)).constructor=n).prototype.isWebGLRenderTargetCube=!0,s.prototype={constructor:s,get x(){return this._x},set x(t){this._x=t,this.onChangeCallback()},get y(){return this._y},set y(t){this._y=t,this.onChangeCallback()},get z(){return this._z},set z(t){this._z=t,this.onChangeCallback()},get w(){return this._w},set w(t){this._w=t,this.onChangeCallback()},set:function(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._w=n,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this.onChangeCallback(),this},setFromEuler:function(t,e){if(!1===(t&&t.isEuler))throw Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var i=Math.cos(t._x/2),n=Math.cos(t._y/2),r=Math.cos(t._z/2),a=Math.sin(t._x/2),o=Math.sin(t._y/2),s=Math.sin(t._z/2),c=t.order;return"XYZ"===c?(this._x=a*n*r+i*o*s,this._y=i*o*r-a*n*s,this._z=i*n*s+a*o*r,this._w=i*n*r-a*o*s):"YXZ"===c?(this._x=a*n*r+i*o*s,this._y=i*o*r-a*n*s,this._z=i*n*s-a*o*r,this._w=i*n*r+a*o*s):"ZXY"===c?(this._x=a*n*r-i*o*s,this._y=i*o*r+a*n*s,this._z=i*n*s+a*o*r,this._w=i*n*r-a*o*s):"ZYX"===c?(this._x=a*n*r-i*o*s,this._y=i*o*r+a*n*s,this._z=i*n*s-a*o*r,this._w=i*n*r+a*o*s):"YZX"===c?(this._x=a*n*r+i*o*s,this._y=i*o*r+a*n*s,this._z=i*n*s-a*o*r,this._w=i*n*r-a*o*s):"XZY"===c&&(this._x=a*n*r-i*o*s,this._y=i*o*r-a*n*s,this._z=i*n*s+a*o*r,this._w=i*n*r+a*o*s),!1!==e&&this.onChangeCallback(),this},setFromAxisAngle:function(t,e){var i=e/2,n=Math.sin(i);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(i),this.onChangeCallback(),this},setFromRotationMatrix:function(t){var e=(i=t.elements)[0];t=i[4];var i,n=i[8],r=i[1],a=i[5],o=i[9],s=i[2],c=i[6],h=e+a+(i=i[10]);return 0<h?(e=.5/Math.sqrt(h+1),this._w=.25/e,this._x=(c-o)*e,this._y=(n-s)*e,this._z=(r-t)*e):a<e&&i<e?(e=2*Math.sqrt(1+e-a-i),this._w=(c-o)/e,this._x=.25*e,this._y=(t+r)/e,this._z=(n+s)/e):i<a?(e=2*Math.sqrt(1+a-e-i),this._w=(n-s)/e,this._x=(t+r)/e,this._y=.25*e,this._z=(o+c)/e):(e=2*Math.sqrt(1+i-e-a),this._w=(r-t)/e,this._x=(n+s)/e,this._y=(o+c)/e,this._z=.25*e),this.onChangeCallback(),this},setFromUnitVectors:function(t,e){return void 0===rr&&(rr=new Ct),(ar=t.dot(e)+1)<1e-6?(ar=0,Math.abs(t.x)>Math.abs(t.z)?rr.set(-t.y,t.x,0):rr.set(0,-t.z,t.y)):rr.crossVectors(t,e),this._x=rr.x,this._y=rr.y,this._z=rr.z,this._w=ar,this.normalize()},inverse:function(){return this.conjugate().normalize()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._z=this._y=this._x=0,this._w=1):(t=1/t,this._x*=t,this._y*=t,this._z*=t,this._w*=t),this.onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var i=t._x,n=t._y,r=t._z,a=t._w,o=e._x,s=e._y,c=e._z,h=e._w;return this._x=i*h+a*o+n*c-r*s,this._y=n*h+a*s+r*o-i*c,this._z=r*h+a*c+i*s-n*o,this._w=a*h-i*o-n*s-r*c,this.onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var i=this._x,n=this._y,r=this._z,a=this._w;if((c=a*t._w+i*t._x+n*t._y+r*t._z)<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,c=-c):this.copy(t),1<=c)return this._w=a,this._x=i,this._y=n,this._z=r,this;var o=Math.sqrt(1-c*c);if(Math.abs(o)<.001)return this._w=.5*(a+this._w),this._x=.5*(i+this._x),this._y=.5*(n+this._y),this._z=.5*(r+this._z),this;var s=Math.atan2(o,c),c=Math.sin((1-e)*s)/o;o=Math.sin(e*s)/o;return this._w=a*c+this._w*o,this._x=i*c+this._x*o,this._y=n*c+this._y*o,this._z=r*c+this._z*o,this.onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}},Object.assign(s,{slerp:function(t,e,i,n){return i.copy(t).slerp(e,n)},slerpFlat:function(t,e,i,n,r,a,o){var s=i[n+0],c=i[n+1],h=i[n+2];i=i[n+3],n=r[a+0];var l=r[a+1],u=r[a+2];if(i!==(r=r[a+3])||s!==n||c!==l||h!==u){a=1-o;var d=s*n+c*l+h*u+i*r,p=0<=d?1:-1,f=1-d*d;f>Number.EPSILON&&(f=Math.sqrt(f),d=Math.atan2(f,d*p),a=Math.sin(a*d)/f,o=Math.sin(o*d)/f),s=s*a+n*(p*=o),c=c*a+l*p,h=h*a+u*p,i=i*a+r*p,a===1-o&&(s*=o=1/Math.sqrt(s*s+c*c+h*h+i*i),c*=o,h*=o,i*=o)}t[e]=s,t[e+1]=c,t[e+2]=h,t[e+3]=i}}),Ct.prototype={constructor:Ct,isVector3:!0,set:function(t,e,i){return this.x=t,this.y=e,this.z=i,this},setScalar:function(t){return this.z=this.y=this.x=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):this.z=this.y=this.x=0,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:function(t){return!1===(t&&t.isEuler)&&console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),void 0===pr&&(pr=new s),this.applyQuaternion(pr.setFromEuler(t))},applyAxisAngle:function(t,e){return void 0===dr&&(dr=new s),this.applyQuaternion(dr.setFromAxisAngle(t,e))},applyMatrix3:function(t){var e=this.x,i=this.y,n=this.z;return t=t.elements,this.x=t[0]*e+t[3]*i+t[6]*n,this.y=t[1]*e+t[4]*i+t[7]*n,this.z=t[2]*e+t[5]*i+t[8]*n,this},applyMatrix4:function(t){var e=this.x,i=this.y,n=this.z;return t=t.elements,this.x=t[0]*e+t[4]*i+t[8]*n+t[12],this.y=t[1]*e+t[5]*i+t[9]*n+t[13],this.z=t[2]*e+t[6]*i+t[10]*n+t[14],this},applyProjection:function(t){var e=this.x,i=this.y,n=this.z,r=1/((t=t.elements)[3]*e+t[7]*i+t[11]*n+t[15]);return this.x=(t[0]*e+t[4]*i+t[8]*n+t[12])*r,this.y=(t[1]*e+t[5]*i+t[9]*n+t[13])*r,this.z=(t[2]*e+t[6]*i+t[10]*n+t[14])*r,this},applyQuaternion:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,a=t.y,o=t.z,s=(t=t.w)*e+a*n-o*i,c=t*i+o*e-r*n,h=t*n+r*i-a*e;e=-r*e-a*i-o*n;return this.x=s*t+e*-r+c*-o-h*-a,this.y=c*t+e*-a+h*-r-s*-o,this.z=h*t+e*-o+s*-a-c*-r,this},project:function(t){return void 0===ur&&(ur=new It),ur.multiplyMatrices(t.projectionMatrix,ur.getInverse(t.matrixWorld)),this.applyProjection(ur)},unproject:function(t){return void 0===lr&&(lr=new It),lr.multiplyMatrices(t.matrixWorld,lr.getInverse(t.projectionMatrix)),this.applyProjection(lr)},transformDirection:function(t){var e=this.x,i=this.y,n=this.z;return t=t.elements,this.x=t[0]*e+t[4]*i+t[8]*n,this.y=t[1]*e+t[5]*i+t[9]*n,this.z=t[2]*e+t[6]*i+t[10]*n,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(t,e){return void 0===cr&&(cr=new Ct,hr=new Ct),cr.set(t,t,t),hr.set(e,e,e),this.clamp(cr,hr)},clampLength:function(t,e){var i=this.length();return this.multiplyScalar(Math.max(t,Math.min(e,i))/i)},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(t){return this.multiplyScalar(t/this.length())},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,i){return this.subVectors(e,t).multiplyScalar(i).add(t)},cross:function(t,e){if(void 0!==e)return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e);var i=this.x,n=this.y,r=this.z;return this.x=n*t.z-r*t.y,this.y=r*t.x-i*t.z,this.z=i*t.y-n*t.x,this},crossVectors:function(t,e){var i=t.x,n=t.y,r=t.z,a=e.x,o=e.y,s=e.z;return this.x=n*s-r*o,this.y=r*a-i*s,this.z=i*o-n*a,this},projectOnVector:function(t){var e=t.dot(this)/t.lengthSq();return this.copy(t).multiplyScalar(e)},projectOnPlane:function(t){return void 0===sr&&(sr=new Ct),sr.copy(this).projectOnVector(t),this.sub(sr)},reflect:function(t){return void 0===or&&(or=new Ct),this.sub(or.copy(t).multiplyScalar(2*this.dot(t)))},angleTo:function(t){return t=this.dot(t)/Math.sqrt(this.lengthSq()*t.lengthSq()),Math.acos(er.clamp(t,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,i=this.y-t.y;return e*e+i*i+(t=this.z-t.z)*t},distanceToManhattan:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){var e=Math.sin(t.phi)*t.radius;return this.x=e*Math.sin(t.theta),this.y=Math.cos(t.phi)*t.radius,this.z=e*Math.cos(t.theta),this},setFromCylindrical:function(t){return this.x=t.radius*Math.sin(t.theta),this.y=t.y,this.z=t.radius*Math.cos(t.theta),this},setFromMatrixPosition:function(t){return this.setFromMatrixColumn(t,3)},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length();return t=this.setFromMatrixColumn(t,2).length(),this.x=e,this.y=i,this.z=t,this},setFromMatrixColumn:function(t,e){if("number"==typeof t){console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index ).");var i=t;t=e,e=i}return this.fromArray(t.elements,4*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromAttribute:function(t,e,i){return void 0!==i&&console.warn("THREE.Vector3: offset has been removed from .fromAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}},It.prototype={constructor:It,isMatrix4:!0,set:function(t,e,i,n,r,a,o,s,c,h,l,u,d,p,f,m){var g=this.elements;return g[0]=t,g[4]=e,g[8]=i,g[12]=n,g[1]=r,g[5]=a,g[9]=o,g[13]=s,g[2]=c,g[6]=h,g[10]=l,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new It).fromArray(this.elements)},copy:function(t){return this.elements.set(t.elements),this},copyPosition:function(t){var e=this.elements;return t=t.elements,e[12]=t[12],e[13]=t[13],e[14]=t[14],this},extractBasis:function(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this},extractRotation:function(t){void 0===br&&(br=new Ct);var e=this.elements,i=t.elements,n=1/br.setFromMatrixColumn(t,0).length(),r=1/br.setFromMatrixColumn(t,1).length();return t=1/br.setFromMatrixColumn(t,2).length(),e[0]=i[0]*n,e[1]=i[1]*n,e[2]=i[2]*n,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[8]=i[8]*t,e[9]=i[9]*t,e[10]=i[10]*t,this},makeRotationFromEuler:function(t){!1===(t&&t.isEuler)&&console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,i=t.x,n=t.y,r=t.z,a=Math.cos(i),o=(i=Math.sin(i),Math.cos(n)),s=(n=Math.sin(n),Math.cos(r));r=Math.sin(r);if("XYZ"===t.order){t=a*s;var c=a*r,h=i*s,l=i*r;e[0]=o*s,e[4]=-o*r,e[8]=n,e[1]=c+h*n,e[5]=t-l*n,e[9]=-i*o,e[2]=l-t*n,e[6]=h+c*n,e[10]=a*o}else"YXZ"===t.order?(t=o*s,c=o*r,h=n*s,l=n*r,e[0]=t+l*i,e[4]=h*i-c,e[8]=a*n,e[1]=a*r,e[5]=a*s,e[9]=-i,e[2]=c*i-h,e[6]=l+t*i,e[10]=a*o):"ZXY"===t.order?(t=o*s,c=o*r,h=n*s,l=n*r,e[0]=t-l*i,e[4]=-a*r,e[8]=h+c*i,e[1]=c+h*i,e[5]=a*s,e[9]=l-t*i,e[2]=-a*n,e[6]=i,e[10]=a*o):"ZYX"===t.order?(t=a*s,c=a*r,h=i*s,l=i*r,e[0]=o*s,e[4]=h*n-c,e[8]=t*n+l,e[1]=o*r,e[5]=l*n+t,e[9]=c*n-h,e[2]=-n,e[6]=i*o,e[10]=a*o):"YZX"===t.order?(t=a*o,c=a*n,h=i*o,l=i*n,e[0]=o*s,e[4]=l-t*r,e[8]=h*r+c,e[1]=r,e[5]=a*s,e[9]=-i*s,e[2]=-n*s,e[6]=c*r+h,e[10]=t-l*r):"XZY"===t.order&&(t=a*o,c=a*n,h=i*o,l=i*n,e[0]=o*s,e[4]=-r,e[8]=n*s,e[1]=t*r+l,e[5]=a*s,e[9]=c*r-h,e[2]=h*r-c,e[6]=i*s,e[10]=l*r+t);return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(t){var e=this.elements,i=t.x,n=t.y,r=t.z,a=t.w,o=r+r;t=i*(h=i+i);var s=i*(l=n+n),c=(i=i*o,n*l),h=(n=n*o,r=r*o,a*h),l=a*l;a*=o;return e[0]=1-(c+r),e[4]=s-a,e[8]=i+l,e[1]=s+a,e[5]=1-(t+r),e[9]=n-h,e[2]=i-l,e[6]=n+h,e[10]=1-(t+c),e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},lookAt:function(t,e,i){void 0===yr&&(yr=new Ct,xr=new Ct,_r=new Ct);var n=this.elements;return _r.subVectors(t,e).normalize(),0===_r.lengthSq()&&(_r.z=1),yr.crossVectors(i,_r).normalize(),0===yr.lengthSq()&&(_r.z+=1e-4,yr.crossVectors(i,_r).normalize()),xr.crossVectors(_r,yr),n[0]=yr.x,n[4]=xr.x,n[8]=_r.x,n[1]=yr.y,n[5]=xr.y,n[9]=_r.y,n[2]=yr.z,n[6]=xr.z,n[10]=_r.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.elements,n=e.elements,r=this.elements,a=i[0],o=i[4],s=i[8],c=i[12],h=i[1],l=i[5],u=i[9],d=i[13],p=i[2],f=i[6],m=i[10],g=i[14],v=i[3],y=i[7],x=i[11],_=(i=i[15],n[0]),b=n[4],w=n[8],M=n[12],E=n[1],T=n[5],S=n[9],A=n[13],L=n[2],R=n[6],P=n[10],C=n[14],I=n[3],U=n[7],N=n[11];n=n[15];return r[0]=a*_+o*E+s*L+c*I,r[4]=a*b+o*T+s*R+c*U,r[8]=a*w+o*S+s*P+c*N,r[12]=a*M+o*A+s*C+c*n,r[1]=h*_+l*E+u*L+d*I,r[5]=h*b+l*T+u*R+d*U,r[9]=h*w+l*S+u*P+d*N,r[13]=h*M+l*A+u*C+d*n,r[2]=p*_+f*E+m*L+g*I,r[6]=p*b+f*T+m*R+g*U,r[10]=p*w+f*S+m*P+g*N,r[14]=p*M+f*A+m*C+g*n,r[3]=v*_+y*E+x*L+i*I,r[7]=v*b+y*T+x*R+i*U,r[11]=v*w+y*S+x*P+i*N,r[15]=v*M+y*A+x*C+i*n,this},multiplyToArray:function(t,e,i){var n=this.elements;return this.multiplyMatrices(t,e),i[0]=n[0],i[1]=n[1],i[2]=n[2],i[3]=n[3],i[4]=n[4],i[5]=n[5],i[6]=n[6],i[7]=n[7],i[8]=n[8],i[9]=n[9],i[10]=n[10],i[11]=n[11],i[12]=n[12],i[13]=n[13],i[14]=n[14],i[15]=n[15],this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},applyToVector3Array:function(t,e,i){void 0===vr&&(vr=new Ct),void 0===e&&(e=0),void 0===i&&(i=t.length);for(var n=0;n<i;n+=3,e+=3)vr.fromArray(t,e),vr.applyMatrix4(this),vr.toArray(t,e);return t},applyToBufferAttribute:function(t){void 0===gr&&(gr=new Ct);for(var e=0,i=t.count;e<i;e++)gr.x=t.getX(e),gr.y=t.getY(e),gr.z=t.getZ(e),gr.applyMatrix4(this),t.setXYZ(e,gr.x,gr.y,gr.z);return t},determinant:function(){var t=this.elements,e=t[0],i=t[4],n=t[8],r=t[12],a=t[1],o=t[5],s=t[9],c=t[13],h=t[2],l=t[6],u=t[10],d=t[14];return t[3]*(+r*s*l-n*c*l-r*o*u+i*c*u+n*o*d-i*s*d)+t[7]*(+e*s*d-e*c*u+r*a*u-n*a*d+n*c*h-r*s*h)+t[11]*(+e*c*l-e*o*d-r*a*l+i*a*d+r*o*h-i*c*h)+t[15]*(-n*o*h-e*s*l+e*o*u+n*a*l-i*a*u+i*s*h)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},setPosition:function(t){var e=this.elements;return e[12]=t.x,e[13]=t.y,e[14]=t.z,this},getInverse:function(t,e){var i,n=this.elements,r=(i=t.elements)[0],a=i[1],o=i[2],s=i[3],c=i[4],h=i[5],l=i[6],u=i[7],d=i[8],p=i[9],f=i[10],m=i[11],g=i[12],v=i[13],y=i[14],x=p*y*u-v*f*u+v*l*m-h*y*m-p*l*(i=i[15])+h*f*i,_=g*f*u-d*y*u-g*l*m+c*y*m+d*l*i-c*f*i,b=d*v*u-g*p*u+g*h*m-c*v*m-d*h*i+c*p*i,w=g*p*l-d*v*l-g*h*f+c*v*f+d*h*y-c*p*y,M=r*x+a*_+o*b+s*w;if(0!==M)return M=1/M,n[0]=x*M,n[1]=(v*f*s-p*y*s-v*o*m+a*y*m+p*o*i-a*f*i)*M,n[2]=(h*y*s-v*l*s+v*o*u-a*y*u-h*o*i+a*l*i)*M,n[3]=(p*l*s-h*f*s-p*o*u+a*f*u+h*o*m-a*l*m)*M,n[4]=_*M,n[5]=(d*y*s-g*f*s+g*o*m-r*y*m-d*o*i+r*f*i)*M,n[6]=(g*l*s-c*y*s-g*o*u+r*y*u+c*o*i-r*l*i)*M,n[7]=(c*f*s-d*l*s+d*o*u-r*f*u-c*o*m+r*l*m)*M,n[8]=b*M,n[9]=(g*p*s-d*v*s-g*a*m+r*v*m+d*a*i-r*p*i)*M,n[10]=(c*v*s-g*h*s+g*a*u-r*v*u-c*a*i+r*h*i)*M,n[11]=(d*h*s-c*p*s-d*a*u+r*p*u+c*a*m-r*h*m)*M,n[12]=w*M,n[13]=(d*v*o-g*p*o+g*a*f-r*v*f-d*a*y+r*p*y)*M,n[14]=(g*h*o-c*v*o-g*a*l+r*v*l+c*a*y-r*h*y)*M,n[15]=(c*p*o-d*h*o+d*a*l-r*p*l-c*a*f+r*h*f)*M,this;if(!0===e)throw Error("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");return console.warn("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0"),this.identity()},scale:function(t){var e=this.elements,i=t.x,n=t.y;return t=t.z,e[0]*=i,e[4]*=n,e[8]*=t,e[1]*=i,e[5]*=n,e[9]*=t,e[2]*=i,e[6]*=n,e[10]*=t,e[3]*=i,e[7]*=n,e[11]*=t,this},getMaxScaleOnAxis:function(){var t=this.elements;return Math.sqrt(Math.max(t[0]*t[0]+t[1]*t[1]+t[2]*t[2],t[4]*t[4]+t[5]*t[5]+t[6]*t[6],t[8]*t[8]+t[9]*t[9]+t[10]*t[10]))},makeTranslation:function(t,e,i){return this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t);return t=Math.sin(t),this.set(1,0,0,0,0,e,-t,0,0,t,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t);return t=Math.sin(t),this.set(e,0,t,0,0,1,0,0,-t,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t);return t=Math.sin(t),this.set(e,-t,0,0,t,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var i=Math.cos(e),n=Math.sin(e),r=1-i,a=t.x,o=t.y,s=t.z,c=r*a,h=r*o;return this.set(c*a+i,c*o-n*s,c*s+n*o,0,c*o+n*s,h*o+i,h*s-n*a,0,c*s-n*o,h*s+n*a,r*s*s+i,0,0,0,0,1),this},makeScale:function(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this},makeShear:function(t,e,i){return this.set(1,e,i,0,t,1,i,0,t,e,1,0,0,0,0,1),this},compose:function(t,e,i){return this.makeRotationFromQuaternion(e),this.scale(i),this.setPosition(t),this},decompose:function(t,e,i){void 0===fr&&(fr=new Ct,mr=new It);var n=this.elements,r=fr.set(n[0],n[1],n[2]).length(),a=fr.set(n[4],n[5],n[6]).length(),o=fr.set(n[8],n[9],n[10]).length();this.determinant()<0&&(r=-r),t.x=n[12],t.y=n[13],t.z=n[14],mr.elements.set(this.elements),t=1/r,n=1/a;var s=1/o;return mr.elements[0]*=t,mr.elements[1]*=t,mr.elements[2]*=t,mr.elements[4]*=n,mr.elements[5]*=n,mr.elements[6]*=n,mr.elements[8]*=s,mr.elements[9]*=s,mr.elements[10]*=s,e.setFromRotationMatrix(mr),i.x=r,i.y=a,i.z=o,this},makeFrustum:function(t,e,i,n,r,a){var o=this.elements;return o[0]=2*r/(e-t),o[4]=0,o[8]=(e+t)/(e-t),o[12]=0,o[1]=0,o[5]=2*r/(n-i),o[9]=(n+i)/(n-i),o[13]=0,o[2]=0,o[6]=0,o[10]=-(a+r)/(a-r),o[14]=-2*a*r/(a-r),o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makePerspective:function(t,e,i,n){var r=-(t=i*Math.tan(er.DEG2RAD*t*.5));return this.makeFrustum(r*e,t*e,r,t,i,n)},makeOrthographic:function(t,e,i,n,r,a){var o=this.elements,s=1/(e-t),c=1/(i-n),h=1/(a-r);return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-(e+t)*s,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-(i+n)*c,o[2]=0,o[6]=0,o[10]=-2*h,o[14]=-(a+r)*h,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},equals:function(t){var e=this.elements;t=t.elements;for(var i=0;i<16;i++)if(e[i]!==t[i])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var i=0;i<16;i++)this.elements[i]=t[i+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}},((c.prototype=Object.create(z.prototype)).constructor=c).prototype.isCubeTexture=!0,Object.defineProperty(c.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}});var Mr=new z,Er=new c,Tr=[],Sr=[];I.prototype.setValue=function(t,e){for(var i=this.seq,n=0,r=i.length;n!==r;++n){var a=i[n];a.setValue(t,e[a.id])}};var Ar=/([\w\d_]+)(\])?(\[|\.)?/g;Ut.prototype.setValue=function(t,e,i){void 0!==(e=this.map[e])&&e.setValue(t,i,this.renderer)},Ut.prototype.set=function(t,e,i){var n=this.map[i];void 0!==n&&n.setValue(t,e[i],this.renderer)},Ut.prototype.setOptional=function(t,e,i){void 0!==(e=e[i])&&this.setValue(t,i,e)},Ut.upload=function(t,e,i,n){for(var r=0,a=e.length;r!==a;++r){var o=e[r],s=i[o.id];!1!==s.needsUpdate&&o.setValue(t,s.value,n)}},Ut.seqWithValue=function(t,e){for(var i=[],n=0,r=t.length;n!==r;++n){var a=t[n];a.id in e&&i.push(a)}return i};var Lr={merge:function(t){for(var e={},i=0;i<t.length;i++){var n,r=this.clone(t[i]);for(n in r)e[n]=r[n]}return e},clone:function(t){var e,i={};for(e in t)for(var n in i[e]={},t[e]){var r=t[e][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?i[e][n]=r.clone():Array.isArray(r)?i[e][n]=r.slice():i[e][n]=r}return i}},Rr={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"\nvec3 transformed = vec3( position );\n",beginnormal_vertex:"\nvec3 objectNormal = vec3( normal );\n",bsdfs:"float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t\t}\n\t\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 ltcTextureCoords( const in GeometricContext geometry, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = (LUT_SIZE - 1.0)/LUT_SIZE;\n\tconst float LUT_BIAS = 0.5/LUT_SIZE;\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 P = geometry.position;\n\tfloat theta = acos( dot( N, V ) );\n\tvec2 uv = vec2(\n\t\tsqrt( saturate( roughness ) ),\n\t\tsaturate( theta / ( 0.5 * PI ) ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nvoid clipQuadToHorizon( inout vec3 L[5], out int n ) {\n\tint config = 0;\n\tif ( L[0].z > 0.0 ) config += 1;\n\tif ( L[1].z > 0.0 ) config += 2;\n\tif ( L[2].z > 0.0 ) config += 4;\n\tif ( L[3].z > 0.0 ) config += 8;\n\tn = 0;\n\tif ( config == 0 ) {\n\t} else if ( config == 1 ) {\n\t\tn = 3;\n\t\tL[1] = -L[1].z * L[0] + L[0].z * L[1];\n\t\tL[2] = -L[3].z * L[0] + L[0].z * L[3];\n\t} else if ( config == 2 ) {\n\t\tn = 3;\n\t\tL[0] = -L[0].z * L[1] + L[1].z * L[0];\n\t\tL[2] = -L[2].z * L[1] + L[1].z * L[2];\n\t} else if ( config == 3 ) {\n\t\tn = 4;\n\t\tL[2] = -L[2].z * L[1] + L[1].z * L[2];\n\t\tL[3] = -L[3].z * L[0] + L[0].z * L[3];\n\t} else if ( config == 4 ) {\n\t\tn = 3;\n\t\tL[0] = -L[3].z * L[2] + L[2].z * L[3];\n\t\tL[1] = -L[1].z * L[2] + L[2].z * L[1];\n\t} else if ( config == 5 ) {\n\t\tn = 0;\n\t} else if ( config == 6 ) {\n\t\tn = 4;\n\t\tL[0] = -L[0].z * L[1] + L[1].z * L[0];\n\t\tL[3] = -L[3].z * L[2] + L[2].z * L[3];\n\t} else if ( config == 7 ) {\n\t\tn = 5;\n\t\tL[4] = -L[3].z * L[0] + L[0].z * L[3];\n\t\tL[3] = -L[3].z * L[2] + L[2].z * L[3];\n\t} else if ( config == 8 ) {\n\t\tn = 3;\n\t\tL[0] = -L[0].z * L[3] + L[3].z * L[0];\n\t\tL[1] = -L[2].z * L[3] + L[3].z * L[2];\n\t\tL[2] = L[3];\n\t} else if ( config == 9 ) {\n\t\tn = 4;\n\t\tL[1] = -L[1].z * L[0] + L[0].z * L[1];\n\t\tL[2] = -L[2].z * L[3] + L[3].z * L[2];\n\t} else if ( config == 10 ) {\n\t\tn = 0;\n\t} else if ( config == 11 ) {\n\t\tn = 5;\n\t\tL[4] = L[3];\n\t\tL[3] = -L[2].z * L[3] + L[3].z * L[2];\n\t\tL[2] = -L[2].z * L[1] + L[1].z * L[2];\n\t} else if ( config == 12 ) {\n\t\tn = 4;\n\t\tL[1] = -L[1].z * L[2] + L[2].z * L[1];\n\t\tL[0] = -L[0].z * L[3] + L[3].z * L[0];\n\t} else if ( config == 13 ) {\n\t\tn = 5;\n\t\tL[4] = L[3];\n\t\tL[3] = L[2];\n\t\tL[2] = -L[1].z * L[2] + L[2].z * L[1];\n\t\tL[1] = -L[1].z * L[0] + L[0].z * L[1];\n\t} else if ( config == 14 ) {\n\t\tn = 5;\n\t\tL[4] = -L[0].z * L[3] + L[3].z * L[0];\n\t\tL[0] = -L[0].z * L[1] + L[1].z * L[0];\n\t} else if ( config == 15 ) {\n\t\tn = 4;\n\t}\n\tif ( n == 3 )\n\t\tL[3] = L[0];\n\tif ( n == 4 )\n\t\tL[4] = L[0];\n}\nfloat integrateLtcBrdfOverRectEdge( vec3 v1, vec3 v2 ) {\n\tfloat cosTheta = dot( v1, v2 );\n\tfloat theta = acos( cosTheta );\n\tfloat res = cross( v1, v2 ).z * ( ( theta > 0.001 ) ? theta / sin( theta ) : 1.0 );\n\treturn res;\n}\nvoid initRectPoints( const in vec3 pos, const in vec3 halfWidth, const in vec3 halfHeight, out vec3 rectPoints[4] ) {\n\trectPoints[0] = pos - halfWidth - halfHeight;\n\trectPoints[1] = pos + halfWidth - halfHeight;\n\trectPoints[2] = pos + halfWidth + halfHeight;\n\trectPoints[3] = pos - halfWidth + halfHeight;\n}\nvec3 integrateLtcBrdfOverRect( const in GeometricContext geometry, const in mat3 brdfMat, const in vec3 rectPoints[4] ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 P = geometry.position;\n\tvec3 T1, T2;\n\tT1 = normalize(V - N * dot( V, N ));\n\tT2 = - cross( N, T1 );\n\tmat3 brdfWrtSurface = brdfMat * transpose( mat3( T1, T2, N ) );\n\tvec3 clippedRect[5];\n\tclippedRect[0] = brdfWrtSurface * ( rectPoints[0] - P );\n\tclippedRect[1] = brdfWrtSurface * ( rectPoints[1] - P );\n\tclippedRect[2] = brdfWrtSurface * ( rectPoints[2] - P );\n\tclippedRect[3] = brdfWrtSurface * ( rectPoints[3] - P );\n\tint n;\n\tclipQuadToHorizon(clippedRect, n);\n\tif ( n == 0 )\n\t\treturn vec3( 0, 0, 0 );\n\tclippedRect[0] = normalize( clippedRect[0] );\n\tclippedRect[1] = normalize( clippedRect[1] );\n\tclippedRect[2] = normalize( clippedRect[2] );\n\tclippedRect[3] = normalize( clippedRect[3] );\n\tclippedRect[4] = normalize( clippedRect[4] );\n\tfloat sum = 0.0;\n\tsum += integrateLtcBrdfOverRectEdge( clippedRect[0], clippedRect[1] );\n\tsum += integrateLtcBrdfOverRectEdge( clippedRect[1], clippedRect[2] );\n\tsum += integrateLtcBrdfOverRectEdge( clippedRect[2], clippedRect[3] );\n\tif (n >= 4)\n\t\tsum += integrateLtcBrdfOverRectEdge( clippedRect[3], clippedRect[4] );\n\tif (n == 5)\n\t\tsum += integrateLtcBrdfOverRectEdge( clippedRect[4], clippedRect[0] );\n\tsum = max( 0.0, sum );\n\tvec3 Lo_i = vec3( sum, sum, sum );\n\treturn Lo_i;\n}\nvec3 Rect_Area_Light_Specular_Reflectance(\n\t\tconst in GeometricContext geometry,\n\t\tconst in vec3 lightPos, const in vec3 lightHalfWidth, const in vec3 lightHalfHeight,\n\t\tconst in float roughness,\n\t\tconst in sampler2D ltcMat, const in sampler2D ltcMag ) {\n\tvec3 rectPoints[4];\n\tinitRectPoints( lightPos, lightHalfWidth, lightHalfHeight, rectPoints );\n\tvec2 uv = ltcTextureCoords( geometry, roughness );\n\tvec4 brdfLtcApproxParams, t;\n\tbrdfLtcApproxParams = texture2D( ltcMat, uv );\n\tt = texture2D( ltcMat, uv );\n\tfloat brdfLtcScalar = texture2D( ltcMag, uv ).a;\n\tmat3 brdfLtcApproxMat = mat3(\n\t\tvec3( 1, 0, t.y ),\n\t\tvec3( 0, t.z, 0 ),\n\t\tvec3( t.w, 0, t.x )\n\t);\n\tvec3 specularReflectance = integrateLtcBrdfOverRect( geometry, brdfLtcApproxMat, rectPoints );\n\tspecularReflectance *= brdfLtcScalar;\n\treturn specularReflectance;\n}\nvec3 Rect_Area_Light_Diffuse_Reflectance(\n\t\tconst in GeometricContext geometry,\n\t\tconst in vec3 lightPos, const in vec3 lightHalfWidth, const in vec3 lightHalfHeight ) {\n\tvec3 rectPoints[4];\n\tinitRectPoints( lightPos, lightHalfWidth, lightHalfHeight, rectPoints );\n\tmat3 diffuseBrdfMat = mat3(1);\n\tvec3 diffuseReflectance = integrateLtcBrdfOverRect( geometry, diffuseBrdfMat, rectPoints );\n\treturn diffuseReflectance;\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; ++ i ) {\n\t\tvec4 plane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t\t\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; ++ i ) {\n\t\t\tvec4 plane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t\n\t#endif\n#endif\n",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif\n",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvarying vec3 vViewPosition;\n#endif\n",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transpose( const in mat3 v ) {\n\tmat3 tmp;\n\ttmp[0] = vec3(v[0].x, v[1].x, v[2].x);\n\ttmp[1] = vec3(v[0].y, v[1].y, v[2].y);\n\ttmp[2] = vec3(v[0].z, v[1].z, v[2].z);\n\treturn tmp;\n}\n",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif\n",defaultnormal_vertex:"#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",encodings_fragment:" gl_FragColor = linearToOutputTexel( gl_FragColor );\n",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n return value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n float maxComponent = max( max( value.r, value.g ), value.b );\n float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n M = ceil( M * 255.0 ) / 255.0;\n return vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float D = max( maxRange / maxRGB, 1.0 );\n D = min( floor( D ) / 255.0, 1.0 );\n return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n vec4 vResult;\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n vResult.w = fract(Le);\n vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n return vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n float Le = value.z * 255.0 + value.w;\n vec3 Xp_Y_XYZp;\n Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n return vec4( max(vRGB, 0.0), 1.0 );\n}\n",envmap_fragment:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",envmap_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif\n",envmap_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif\n",fog_fragment:"#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif\n",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",lights_pars:"uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltcMat;\tuniform sampler2D ltcMag;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\n#if NUM_RECT_AREA_LIGHTS > 0\n void RE_Direct_RectArea_BlinnPhong( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 matDiffColor = material.diffuseColor;\n vec3 matSpecColor = material.specularColor;\n vec3 lightColor = rectAreaLight.color;\n float roughness = BlinnExponentToGGXRoughness( material.specularShininess );\n vec3 spec = Rect_Area_Light_Specular_Reflectance(\n geometry,\n rectAreaLight.position, rectAreaLight.halfWidth, rectAreaLight.halfHeight,\n roughness,\n ltcMat, ltcMag );\n vec3 diff = Rect_Area_Light_Diffuse_Reflectance(\n geometry,\n rectAreaLight.position, rectAreaLight.halfWidth, rectAreaLight.halfHeight );\n reflectedLight.directSpecular += lightColor * matSpecColor * spec / PI2;\n reflectedLight.directDiffuse += lightColor * matDiffColor * diff / PI2;\n }\n#endif\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif\n",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n vec3 matDiffColor = material.diffuseColor;\n vec3 matSpecColor = material.specularColor;\n vec3 lightColor = rectAreaLight.color;\n float roughness = material.specularRoughness;\n vec3 spec = Rect_Area_Light_Specular_Reflectance(\n geometry,\n rectAreaLight.position, rectAreaLight.halfWidth, rectAreaLight.halfHeight,\n roughness,\n ltcMat, ltcMag );\n vec3 diff = Rect_Area_Light_Diffuse_Reflectance(\n geometry,\n rectAreaLight.position, rectAreaLight.halfWidth, rectAreaLight.halfHeight );\n reflectedLight.directSpecular += lightColor * matSpecColor * spec;\n reflectedLight.directDiffuse += lightColor * matDiffColor * diff;\n }\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",lights_template:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t \tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\t#ifndef STANDARD\n\t\tvec3 clearCoatRadiance = getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), 8 );\n\t#else\n\t\tvec3 clearCoatRadiance = vec3( 0.0 );\n\t#endif\n\t\t\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif\n",logdepthbuf_fragment:"#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#ifdef USE_LOGDEPTHBUF\n\tuniform float logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n#endif\n",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#endif\n\tuniform float logDepthBufFC;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",map_particle_fragment:"#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",map_particle_pars_fragment:"#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n",normal_flip:"#ifdef DOUBLE_SIDED\n\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n#else\n\tfloat flipNormal = 1.0;\n#endif\n",normal_fragment:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal ) * flipNormal;\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n return normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n return 1.0 - 2.0 * rgb.xyz;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n return ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n return linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n return (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n return ( near * far ) / ( ( far - near ) * invClipZ - far );\n}\n",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",project_vertex:"#ifdef USE_SKINNING\n\tvec4 mvPosition = modelViewMatrix * skinned;\n#else\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n #if NUM_RECT_AREA_LIGHTS > 0\n #endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 1.0;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n #if NUM_RECT_AREA_LIGHTS > 0\n #endif\n#endif\n",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n #if NUM_RECT_AREA_LIGHTS > 0\n #endif\n#endif\n",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_RECT_AREA_LIGHTS > 0\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n#endif\n",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",tonemapping_pars_fragment:"#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n",uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( PHYSICAL ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#else\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t#endif\n#endif\n",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\tgl_FragColor.a *= opacity;\n}\n",cube_vert:"varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}\n",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}\n",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}\n",distanceRGBA_frag:"uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include <common>\n#include <packing>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tgl_FragColor = packDepthToRGBA( length( vWorldPosition.xyz - lightPos.xyz ) / 1000.0 );\n}\n",distanceRGBA_vert:"varying vec4 vWorldPosition;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition;\n}\n",equirect_frag:"uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}\n",equirect_vert:"varying vec3 vWorldPosition;\n#include <common>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}\n",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}\n",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <normal_flip>\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n}\n",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <normal_flip>\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n}\n",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_flip>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n}\n",meshphysical_frag:"#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_flip>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",meshphysical_vert:"#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#include <normal_flip>\n\t#include <normal_fragment>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#include <premultiplied_alpha_fragment>\n\t#include <encodings_fragment>\n}\n",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}\n",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n",shadow_frag:"uniform float opacity;\n#include <common>\n#include <packing>\n#include <bsdfs>\n#include <lights_pars>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( 0.0, 0.0, 0.0, opacity * ( 1.0 - getShadowMask() ) );\n}\n",shadow_vert:"#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n"};Nt.prototype={constructor:Nt,isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.b=this.g=this.r=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,i){return this.r=t,this.g=e,this.b=i,this},setHSL:function(){function n(t,e,i){return i<0&&(i+=1),1<i&&--i,i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}return function(t,e,i){return t=er.euclideanModulo(t,1),e=er.clamp(e,0,1),i=er.clamp(i,0,1),0===e?this.r=this.g=this.b=i:(i=2*i-(e=i<=.5?i*(1+e):i+e-i*e),this.r=n(i,e,t+1/3),this.g=n(i,e,t),this.b=n(i,e,t-1/3)),this}}(),setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var i;if(i=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var n=i[2];switch(i[1]){case"rgb":case"rgba":if(i=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(n))return this.r=Math.min(255,parseInt(i[1],10))/255,this.g=Math.min(255,parseInt(i[2],10))/255,this.b=Math.min(255,parseInt(i[3],10))/255,t(i[5]),this;if(i=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(n))return this.r=Math.min(100,parseInt(i[1],10))/100,this.g=Math.min(100,parseInt(i[2],10))/100,this.b=Math.min(100,parseInt(i[3],10))/100,t(i[5]),this;break;case"hsl":case"hsla":if(i=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(n)){n=parseFloat(i[1])/360;var r=parseInt(i[2],10)/100,a=parseInt(i[3],10)/100;return t(i[5]),this.setHSL(n,r,a)}}}else if(i=/^\#([A-Fa-f0-9]+)$/.exec(e)){if(3===(n=(i=i[1]).length))return this.r=parseInt(i.charAt(0)+i.charAt(0),16)/255,this.g=parseInt(i.charAt(1)+i.charAt(1),16)/255,this.b=parseInt(i.charAt(2)+i.charAt(2),16)/255,this;if(6===n)return this.r=parseInt(i.charAt(0)+i.charAt(1),16)/255,this.g=parseInt(i.charAt(2)+i.charAt(3),16)/255,this.b=parseInt(i.charAt(4)+i.charAt(5),16)/255,this}return e&&0<e.length&&(void 0!==(i=Pr[e])?this.setHex(i):console.warn("THREE.Color: Unknown color "+e)),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var i=0<e?1/e:1;return this.r=Math.pow(t.r,i),this.g=Math.pow(t.g,i),this.b=Math.pow(t.b,i),this},convertGammaToLinear:function(){var t=this.r,e=this.g,i=this.b;return this.r=t*t,this.g=e*e,this.b=i*i,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){t=t||{h:0,s:0,l:0};var e,i=this.r,n=this.g,r=this.b,a=Math.max(i,n,r),o=((c=Math.min(i,n,r))+a)/2;if(c===a)c=e=0;else{var s=a-c,c=o<=.5?s/(a+c):s/(2-a-c);switch(a){case i:e=(n-r)/s+(n<r?6:0);break;case n:e=(r-i)/s+2;break;case r:e=(i-n)/s+4}e/=6}return t.h=e,t.s=c,t.l=o,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(t,e,i){var n=this.getHSL();return n.h+=t,n.s+=e,n.l+=i,this.setHSL(n.h,n.s,n.l),this},add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},sub:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t},toJSON:function(){return this.getHex()}};var Pr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};((U.prototype=Object.create(z.prototype)).constructor=U).prototype.isDataTexture=!0;var Cr,Ir,Ur={common:{diffuse:{value:new Nt(15658734)},opacity:{value:1},map:{value:null},offsetRepeat:{value:new Pt(0,0,1,1)},specularMap:{value:null},alphaMap:{value:null},envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new V(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Nt(16777215)}},lights:{ambientLightColor:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new Nt(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},offsetRepeat:{value:new Pt(0,0,1,1)}}},Nr={basic:{uniforms:Lr.merge([Ur.common,Ur.aomap,Ur.lightmap,Ur.fog]),vertexShader:Rr.meshbasic_vert,fragmentShader:Rr.meshbasic_frag},lambert:{uniforms:Lr.merge([Ur.common,Ur.aomap,Ur.lightmap,Ur.emissivemap,Ur.fog,Ur.lights,{emissive:{value:new Nt(0)}}]),vertexShader:Rr.meshlambert_vert,fragmentShader:Rr.meshlambert_frag},phong:{uniforms:Lr.merge([Ur.common,Ur.aomap,Ur.lightmap,Ur.emissivemap,Ur.bumpmap,Ur.normalmap,Ur.displacementmap,Ur.gradientmap,Ur.fog,Ur.lights,{emissive:{value:new Nt(0)},specular:{value:new Nt(1118481)},shininess:{value:30}}]),vertexShader:Rr.meshphong_vert,fragmentShader:Rr.meshphong_frag},standard:{uniforms:Lr.merge([Ur.common,Ur.aomap,Ur.lightmap,Ur.emissivemap,Ur.bumpmap,Ur.normalmap,Ur.displacementmap,Ur.roughnessmap,Ur.metalnessmap,Ur.fog,Ur.lights,{emissive:{value:new Nt(0)},roughness:{value:.5},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Rr.meshphysical_vert,fragmentShader:Rr.meshphysical_frag},points:{uniforms:Lr.merge([Ur.points,Ur.fog]),vertexShader:Rr.points_vert,fragmentShader:Rr.points_frag},dashed:{uniforms:Lr.merge([Ur.common,Ur.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Rr.linedashed_vert,fragmentShader:Rr.linedashed_frag},depth:{uniforms:Lr.merge([Ur.common,Ur.displacementmap]),vertexShader:Rr.depth_vert,fragmentShader:Rr.depth_frag},normal:{uniforms:Lr.merge([Ur.common,Ur.bumpmap,Ur.normalmap,Ur.displacementmap,{opacity:{value:1}}]),vertexShader:Rr.normal_vert,fragmentShader:Rr.normal_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Rr.cube_vert,fragmentShader:Rr.cube_frag},equirect:{uniforms:{tEquirect:{value:null},tFlip:{value:-1}},vertexShader:Rr.equirect_vert,fragmentShader:Rr.equirect_frag},distanceRGBA:{uniforms:{lightPos:{value:new Ct}},vertexShader:Rr.distanceRGBA_vert,fragmentShader:Rr.distanceRGBA_frag}};Nr.physical={uniforms:Lr.merge([Nr.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:Rr.meshphysical_vert,fragmentShader:Rr.meshphysical_frag},O.prototype={constructor:O,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:(Ir=new V,function(t,e){var i=Ir.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(t){return t=t||new V,this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return t=t||new V,this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return(e||new V).set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)},clampPoint:function(t,e){return(e||new V).copy(t).clamp(this.min,this.max)},distanceToPoint:(Cr=new V,function(t){return Cr.copy(t).clamp(this.min,this.max).sub(t).length()}),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}};var Dr,Or,Fr,zr,Br,Gr,Hr,Vr,kr,jr,Wr,Xr,Yr,qr,Zr,Jr,Qr,Kr,$r,ta,ea,ia,na,ra,aa,oa,sa,ca,ha,la,ua,da=0;N.prototype={constructor:N,isMaterial:!0,get needsUpdate(){return this._needsUpdate},set needsUpdate(t){!0===t&&this.update(),this._needsUpdate=t},setValues:function(t){if(void 0!==t)for(var e in t){var i=t[e];if(void 0===i)console.warn("THREE.Material: '"+e+"' parameter is undefined.");else{var n=this[e];void 0===n?console.warn("THREE."+this.type+": '"+e+"' is not a property of this material."):n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[e]="overdraw"===e?Number(i):i}}},toJSON:function(t){function e(t){var e,i=[];for(e in t){var n=t[e];delete n.metadata,i.push(n)}return i}var i=void 0===t;i&&(t={textures:{},images:{}});var n={metadata:{version:4.4,type:"Material",generator:"Material.toJSON"}};return n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearCoat&&(n.clearCoat=this.clearCoat),void 0!==this.clearCoatRoughness&&(n.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,n.reflectivity=this.reflectivity),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),2!==this.shading&&(n.shading=this.shading),0!==this.side&&(n.side=this.side),0!==this.vertexColors&&(n.vertexColors=this.vertexColors),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,0<this.alphaTest&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),1<this.wireframeLinewidth&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),n.skinning=this.skinning,n.morphTargets=this.morphTargets,i&&(i=e(t.textures),t=e(t.images),0<i.length&&(n.textures=i),0<t.length&&(n.images=t)),n},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.lights=t.lights,this.blending=t.blending,this.side=t.side,this.shading=t.shading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.overdraw=t.overdraw,this.visible=t.visible,this.clipShadows=t.clipShadows,this.clipIntersection=t.clipIntersection;var e=null;if(null!==(t=t.clippingPlanes))for(var i=t.length,n=(e=Array(i),0);n!==i;++n)e[n]=t[n].clone();return this.clippingPlanes=e,this},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}},Object.assign(N.prototype,e.prototype),((Ft.prototype=Object.create(N.prototype)).constructor=Ft).prototype.isShaderMaterial=!0,Ft.prototype.copy=function(t){return N.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Lr.clone(t.uniforms),this.defines=t.defines,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=t.extensions,this},Ft.prototype.toJSON=function(t){return(t=N.prototype.toJSON.call(this,t)).uniforms=this.uniforms,t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t},((G.prototype=Object.create(N.prototype)).constructor=G).prototype.isMeshDepthMaterial=!0,G.prototype.copy=function(t){return N.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},D.prototype={constructor:D,isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=1/0,i=1/0,n=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,c=t.length;s<c;s+=3){var h=t[s],l=t[s+1],u=t[s+2];h<e&&(e=h),l<i&&(i=l),u<n&&(n=u),r<h&&(r=h),a<l&&(a=l),o<u&&(o=u)}this.min.set(e,i,n),this.max.set(r,a,o)},setFromBufferAttribute:function(t){for(var e=1/0,i=1/0,n=1/0,r=-1/0,a=-1/0,o=-1/0,s=0,c=t.count;s<c;s++){var h=t.getX(s),l=t.getY(s),u=t.getZ(s);h<e&&(e=h),l<i&&(i=l),u<n&&(n=u),r<h&&(r=h),a<l&&(a=l),o<u&&(o=u)}this.min.set(e,i,n),this.max.set(r,a,o)},setFromPoints:function(t){this.makeEmpty();for(var e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:(Gr=new Ct,function(t,e){var i=Gr.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}),setFromObject:(Br=new Ct,function(t){var r=this;return t.updateMatrixWorld(!0),this.makeEmpty(),t.traverse(function(t){var e,i;if(void 0!==(e=t.geometry))if(e.isGeometry){var n=e.vertices;for(e=0,i=n.length;e<i;e++)Br.copy(n[e]),Br.applyMatrix4(t.matrixWorld),r.expandByPoint(Br)}else if(e.isBufferGeometry&&void 0!==(n=e.attributes.position))for(e=0,i=n.count;e<i;e++)Br.fromAttribute(n,e).applyMatrix4(t.matrixWorld),r.expandByPoint(Br)}),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(t){return t=t||new Ct,this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return t=t||new Ct,this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return(e||new Ct).set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere:function(t){return void 0===zr&&(zr=new Ct),this.clampPoint(t.center,zr),zr.distanceToSquared(t.center)<=t.radius*t.radius},intersectsPlane:function(t){var e,i;return i=0<t.normal.x?(e=t.normal.x*this.min.x,t.normal.x*this.max.x):(e=t.normal.x*this.max.x,t.normal.x*this.min.x),0<t.normal.y?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),0<t.normal.z?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=t.constant&&i>=t.constant},clampPoint:function(t,e){return(e||new Ct).copy(t).clamp(this.min,this.max)},distanceToPoint:(Fr=new Ct,function(t){return Fr.copy(t).clamp(this.min,this.max).sub(t).length()}),getBoundingSphere:(Or=new Ct,function(t){return t=t||new zt,this.getCenter(t.center),t.radius=.5*this.getSize(Or).length(),t}),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:(Dr=[new Ct,new Ct,new Ct,new Ct,new Ct,new Ct,new Ct,new Ct],function(t){return this.isEmpty()||(Dr[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Dr[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Dr[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Dr[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Dr[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Dr[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Dr[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Dr[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Dr)),this}),translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},zt.prototype={constructor:zt,set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:(Hr=new D,function(t,e){var i=this.center;void 0!==e?i.copy(e):Hr.setFromPoints(t).getCenter(i);for(var n=0,r=0,a=t.length;r<a;r++)n=Math.max(n,i.distanceToSquared(t[r]));return this.radius=Math.sqrt(n),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(this.center.dot(t.normal)-t.constant)<=this.radius},clampPoint:function(t,e){var i=this.center.distanceToSquared(t),n=e||new Ct;return n.copy(t),i>this.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n},getBoundingBox:function(t){return(t=t||new D).set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius*=t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}},F.prototype={constructor:F,isMatrix3:!0,set:function(t,e,i,n,r,a,o,s,c){var h=this.elements;return h[0]=t,h[1]=n,h[2]=o,h[3]=e,h[4]=r,h[5]=s,h[6]=i,h[7]=a,h[8]=c,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){return t=t.elements,this.set(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]),this},setFromMatrix4:function(t){return t=t.elements,this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},applyToVector3Array:function(t,e,i){void 0===kr&&(kr=new Ct),void 0===e&&(e=0),void 0===i&&(i=t.length);for(var n=0;n<i;n+=3,e+=3)kr.fromArray(t,e),kr.applyMatrix3(this),kr.toArray(t,e);return t},applyToBufferAttribute:function(t){void 0===Vr&&(Vr=new Ct);for(var e=0,i=t.count;e<i;e++)Vr.x=t.getX(e),Vr.y=t.getY(e),Vr.z=t.getZ(e),Vr.applyMatrix3(this),t.setXYZ(e,Vr.x,Vr.y,Vr.z);return t},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t,e=(t=this.elements)[0],i=t[1],n=t[2],r=t[3],a=t[4],o=t[5],s=t[6],c=t[7];return e*a*(t=t[8])-e*o*c-i*r*t+i*o*s+n*r*c-n*a*s},getInverse:function(t,e){t&&t.isMatrix4&&console.error("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");var i=t.elements,n=this.elements,r=i[0],a=i[1],o=i[2],s=i[3],c=i[4],h=i[5],l=i[6],u=i[7],d=(i=i[8])*c-h*u,p=h*l-i*s,f=u*s-c*l,m=r*d+a*p+o*f;if(0!==m)return m=1/m,n[0]=d*m,n[1]=(o*u-i*a)*m,n[2]=(h*a-o*c)*m,n[3]=p*m,n[4]=(i*r-o*l)*m,n[5]=(o*s-h*r)*m,n[6]=f*m,n[7]=(a*l-u*r)*m,n[8]=(c*r-a*s)*m,this;if(!0===e)throw Error("THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0");return console.warn("THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0"),this.identity()},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},fromArray:function(t,e){void 0===e&&(e=0);for(var i=0;i<9;i++)this.elements[i]=t[i+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}},H.prototype={constructor:H,set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,i,n){return this.normal.set(t,e,i),this.constant=n,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:(Yr=new Ct,qr=new Ct,function(t,e,i){return e=Yr.subVectors(i,e).cross(qr.subVectors(t,e)).normalize(),this.setFromNormalAndCoplanarPoint(e,t),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return this.orthoPoint(t,e).sub(t).negate()},orthoPoint:function(t,e){var i=this.distanceToPoint(t);return(e||new Ct).copy(this.normal).multiplyScalar(i)},intersectLine:(Xr=new Ct,function(t,e){var i=e||new Ct,n=t.delta(Xr),r=this.normal.dot(n);return 0!==r?(r=-(t.start.dot(this.normal)+this.constant)/r)<0||1<r?void 0:i.copy(n).multiplyScalar(r).add(t.start):0===this.distanceToPoint(t.start)?i.copy(t.start):void 0}),intersectsLine:function(t){var e=this.distanceToPoint(t.start);return t=this.distanceToPoint(t.end),e<0&&0<t||t<0&&0<e},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return(t||new Ct).copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:(jr=new Ct,Wr=new F,function(t,e){var i=this.coplanarPoint(jr).applyMatrix4(t),n=e||Wr.getNormalMatrix(t);return n=this.normal.applyMatrix3(n).normalize(),this.constant=-i.dot(n),this}),translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}},Bt.prototype={constructor:Bt,set:function(t,e,i,n,r,a){var o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(i),o[3].copy(n),o[4].copy(r),o[5].copy(a),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,i=0;i<6;i++)e[i].copy(t.planes[i]);return this},setFromMatrix:function(t){var e=this.planes;t=(g=t.elements)[0];var i=g[1],n=g[2],r=g[3],a=g[4],o=g[5],s=g[6],c=g[7],h=g[8],l=g[9],u=g[10],d=g[11],p=g[12],f=g[13],m=g[14],g=g[15];return e[0].setComponents(r-t,c-a,d-h,g-p).normalize(),e[1].setComponents(r+t,c+a,d+h,g+p).normalize(),e[2].setComponents(r+i,c+o,d+l,g+f).normalize(),e[3].setComponents(r-i,c-o,d-l,g-f).normalize(),e[4].setComponents(r-n,c-s,d-u,g-m).normalize(),e[5].setComponents(r+n,c+s,d+u,g+m).normalize(),this},intersectsObject:(Kr=new zt,function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),Kr.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Kr)}),intersectsSprite:(Qr=new zt,function(t){return Qr.center.set(0,0,0),Qr.radius=.7071067811865476,Qr.applyMatrix4(t.matrixWorld),this.intersectsSphere(Qr)}),intersectsSphere:function(t){var e=this.planes,i=t.center;t=-t.radius;for(var n=0;n<6;n++)if(e[n].distanceToPoint(i)<t)return!1;return!0},intersectsBox:(Zr=new Ct,Jr=new Ct,function(t){for(var e=this.planes,i=0;i<6;i++){var n=e[i];Zr.x=0<n.normal.x?t.min.x:t.max.x,Jr.x=0<n.normal.x?t.max.x:t.min.x,Zr.y=0<n.normal.y?t.min.y:t.max.y,Jr.y=0<n.normal.y?t.max.y:t.min.y,Zr.z=0<n.normal.z?t.min.z:t.max.z,Jr.z=0<n.normal.z?t.max.z:t.min.z;var r=n.distanceToPoint(Zr);if(n=n.distanceToPoint(Jr),r<0&&n<0)return!1}return!0}),containsPoint:function(t){for(var e=this.planes,i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}},k.prototype={constructor:k,set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return(e||new Ct).copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:(ha=new Ct,function(t){return this.origin.copy(this.at(t,ha)),this}),closestPointToPoint:function(t,e){var i=e||new Ct;i.subVectors(t,this.origin);var n=i.dot(this.direction);return n<0?i.copy(this.origin):i.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:(ca=new Ct,function(t){var e=ca.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(ca.copy(this.direction).multiplyScalar(e).add(this.origin),ca.distanceToSquared(t))}),distanceSqToSegment:(aa=new Ct,oa=new Ct,sa=new Ct,function(t,e,i,n){aa.copy(t).add(e).multiplyScalar(.5),oa.copy(e).sub(t).normalize(),sa.copy(this.origin).sub(aa);var r,a=.5*t.distanceTo(e),o=-this.direction.dot(oa),s=sa.dot(this.direction),c=-sa.dot(oa),h=sa.lengthSq(),l=Math.abs(1-o*o);return o=0<l?(e=o*s-c,r=a*l,0<=(t=o*c-s)?-r<=e?e<=r?(t*=a=1/l)*(t+o*(e*=a)+2*s)+e*(o*t+e+2*c)+h:(e=a,-(t=Math.max(0,-(o*e+s)))*t+e*(e+2*c)+h):(e=-a,-(t=Math.max(0,-(o*e+s)))*t+e*(e+2*c)+h):e<=-r?-(t=Math.max(0,-(-o*a+s)))*t+(e=0<t?-a:Math.min(Math.max(-a,-c),a))*(e+2*c)+h:e<=r?(t=0,(e=Math.min(Math.max(-a,-c),a))*(e+2*c)+h):-(t=Math.max(0,-(o*a+s)))*t+(e=0<t?a:Math.min(Math.max(-a,-c),a))*(e+2*c)+h):(e=0<o?-a:a,-(t=Math.max(0,-(o*e+s)))*t+e*(e+2*c)+h),i&&i.copy(this.direction).multiplyScalar(t).add(this.origin),n&&n.copy(oa).multiplyScalar(e).add(aa),o}),intersectSphere:(ra=new Ct,function(t,e){ra.subVectors(t.center,this.origin);var i=ra.dot(this.direction),n=ra.dot(ra)-i*i,r=t.radius*t.radius;return r<n?null:(n=i-(r=Math.sqrt(r-n)),i+=r,n<0&&i<0?null:n<0?this.at(i,e):this.at(n,e))}),intersectsSphere:function(t){return this.distanceToPoint(t.center)<=t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);return 0===e?0===t.distanceToPoint(this.origin)?0:null:0<=(t=-(this.origin.dot(t.normal)+t.constant)/e)?t:null},intersectPlane:function(t,e){var i=this.distanceToPlane(t);return null===i?null:this.at(i,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},intersectBox:function(t,e){var i,n,r,a,o;n=1/this.direction.x,a=1/this.direction.y,o=1/this.direction.z;var s=this.origin;return 0<=n?(i=(t.min.x-s.x)*n,n*=t.max.x-s.x):(i=(t.max.x-s.x)*n,n*=t.min.x-s.x),0<=a?(r=(t.min.y-s.y)*a,a*=t.max.y-s.y):(r=(t.max.y-s.y)*a,a*=t.min.y-s.y),a<i||n<r?null:((i<r||i!=i)&&(i=r),(a<n||n!=n)&&(n=a),0<=o?(r=(t.min.z-s.z)*o,o*=t.max.z-s.z):(r=(t.max.z-s.z)*o,o*=t.min.z-s.z),o<i||n<r?null:((i<r||i!=i)&&(i=r),(o<n||n!=n)&&(n=o),n<0?null:this.at(0<=i?i:n,e)))},intersectsBox:(na=new Ct,function(t){return null!==this.intersectBox(t,na)}),intersectTriangle:($r=new Ct,ta=new Ct,ea=new Ct,ia=new Ct,function(t,e,i,n,r){if(ta.subVectors(e,t),ea.subVectors(i,t),ia.crossVectors(ta,ea),0<(e=this.direction.dot(ia))){if(n)return null;n=1}else{if(!(e<0))return null;n=-1,e=-e}return $r.subVectors(this.origin,t),(t=n*this.direction.dot(ea.crossVectors($r,ea)))<0?null:(i=n*this.direction.dot(ta.cross($r)))<0||e<t+i?null:(t=-n*$r.dot(ia))<0?null:this.at(t/e,r)}),applyMatrix4:function(t){return this.direction.add(this.origin).applyMatrix4(t),this.origin.applyMatrix4(t),this.direction.sub(this.origin),this.direction.normalize(),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}},j.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" "),j.DefaultOrder="XYZ",j.prototype={constructor:j,isEuler:!0,get x(){return this._x},set x(t){this._x=t,this.onChangeCallback()},get y(){return this._y},set y(t){this._y=t,this.onChangeCallback()},get z(){return this._z},set z(t){this._z=t,this.onChangeCallback()},get order(){return this._order},set order(t){this._order=t,this.onChangeCallback()},set:function(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._order=n||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this.onChangeCallback(),this},setFromRotationMatrix:function(t,e,i){var n=er.clamp;t=(u=t.elements)[0];var r=u[4],a=u[8],o=u[1],s=u[5],c=u[9],h=u[2],l=u[6],u=u[10];return"XYZ"===(e=e||this._order)?(this._y=Math.asin(n(a,-1,1)),Math.abs(a)<.99999?(this._x=Math.atan2(-c,u),this._z=Math.atan2(-r,t)):(this._x=Math.atan2(l,s),this._z=0)):"YXZ"===e?(this._x=Math.asin(-n(c,-1,1)),Math.abs(c)<.99999?(this._y=Math.atan2(a,u),this._z=Math.atan2(o,s)):(this._y=Math.atan2(-h,t),this._z=0)):"ZXY"===e?(this._x=Math.asin(n(l,-1,1)),Math.abs(l)<.99999?(this._y=Math.atan2(-h,u),this._z=Math.atan2(-r,s)):(this._y=0,this._z=Math.atan2(o,t))):"ZYX"===e?(this._y=Math.asin(-n(h,-1,1)),Math.abs(h)<.99999?(this._x=Math.atan2(l,u),this._z=Math.atan2(o,t)):(this._x=0,this._z=Math.atan2(-r,s))):"YZX"===e?(this._z=Math.asin(n(o,-1,1)),Math.abs(o)<.99999?(this._x=Math.atan2(-c,s),this._y=Math.atan2(-h,t)):(this._x=0,this._y=Math.atan2(a,u))):"XZY"===e?(this._z=Math.asin(-n(r,-1,1)),Math.abs(r)<.99999?(this._x=Math.atan2(l,s),this._y=Math.atan2(a,t)):(this._x=Math.atan2(-c,u),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,!1!==i&&this.onChangeCallback(),this},setFromQuaternion:function(t,e,i){return void 0===ua&&(ua=new It),ua.makeRotationFromQuaternion(t),this.setFromRotationMatrix(ua,e,i)},setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:(la=new s,function(t){return la.setFromEuler(this),this.setFromQuaternion(la,t)}),equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new Ct(this._x,this._y,this._z)},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}},W.prototype={constructor:W,set:function(t){this.mask=1<<t},enable:function(t){this.mask|=1<<t},toggle:function(t){this.mask^=1<<t},disable:function(t){this.mask&=~(1<<t)},test:function(t){return 0!=(this.mask&t.mask)}};var pa,fa,ma,ga,va,ya,xa,_a,ba,wa,Ma,Ea,Ta,Sa,Aa,La,Ra,Pa,Ca,Ia,Ua,Na,Da,Oa,Fa,za,Ba,Ga,Ha,Va,ka,ja,Wa,Xa,Ya,qa=0;X.DefaultUp=new Ct(0,1,0),X.DefaultMatrixAutoUpdate=!0,Object.assign(X.prototype,e.prototype,{isObject3D:!0,applyMatrix:function(t){this.matrix.multiplyMatrices(t,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:(La=new s,function(t,e){return La.setFromAxisAngle(t,e),this.quaternion.multiply(La),this}),rotateX:(Aa=new Ct(1,0,0),function(t){return this.rotateOnAxis(Aa,t)}),rotateY:(Sa=new Ct(0,1,0),function(t){return this.rotateOnAxis(Sa,t)}),rotateZ:(Ta=new Ct(0,0,1),function(t){return this.rotateOnAxis(Ta,t)}),translateOnAxis:(Ea=new Ct,function(t,e){return Ea.copy(t).applyQuaternion(this.quaternion),this.position.add(Ea.multiplyScalar(e)),this}),translateX:(Ma=new Ct(1,0,0),function(t){return this.translateOnAxis(Ma,t)}),translateY:(wa=new Ct(0,1,0),function(t){return this.translateOnAxis(wa,t)}),translateZ:(ba=new Ct(0,0,1),function(t){return this.translateOnAxis(ba,t)}),localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:(_a=new It,function(t){return t.applyMatrix4(_a.getInverse(this.matrixWorld))}),lookAt:(xa=new It,function(t){xa.lookAt(t,this.position,this.up),this.quaternion.setFromRotationMatrix(xa)}),add:function(t){if(1<arguments.length){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?console.error("THREE.Object3D.add: object can't be added as a child of itself.",t):t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,t.dispatchEvent({type:"added"}),this.children.push(t)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this},remove:function(t){if(1<arguments.length)for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);-1!==(e=this.children.indexOf(t))&&(t.parent=null,t.dispatchEvent({type:"removed"}),this.children.splice(e,1))},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(var i=0,n=this.children.length;i<n;i++){var r=this.children[i].getObjectByProperty(t,e);if(void 0!==r)return r}},getWorldPosition:function(t){return t=t||new Ct,this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:(va=new Ct,ya=new Ct,function(t){return t=t||new s,this.updateMatrixWorld(!0),this.matrixWorld.decompose(va,t,ya),t}),getWorldRotation:(ga=new s,function(t){return t=t||new j,this.getWorldQuaternion(ga),t.setFromQuaternion(ga,this.rotation.order,!1)}),getWorldScale:(fa=new Ct,ma=new s,function(t){return t=t||new Ct,this.updateMatrixWorld(!0),this.matrixWorld.decompose(fa,ma,t),t}),getWorldDirection:(pa=new s,function(t){return t=t||new Ct,this.getWorldQuaternion(pa),t.set(0,0,1).applyQuaternion(pa)}),raycast:function(){},traverse:function(t){t(this);for(var e=this.children,i=0,n=e.length;i<n;i++)e[i].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var e=this.children,i=0,n=e.length;i<n;i++)e[i].traverseVisible(t)}},traverseAncestors:function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){!0===this.matrixAutoUpdate&&this.updateMatrix(),!0!==this.matrixWorldNeedsUpdate&&!0!==t||(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t=!(this.matrixWorldNeedsUpdate=!1));for(var e=this.children,i=0,n=e.length;i<n;i++)e[i].updateMatrixWorld(t)},toJSON:function(t){function e(t){var e,i=[];for(e in t){var n=t[e];delete n.metadata,i.push(n)}return i}var i={};(a=void 0===t||""===t)&&(t={geometries:{},materials:{},textures:{},images:{}},i.metadata={version:4.4,type:"Object",generator:"Object3D.toJSON"});var n={};if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),n.matrix=this.matrix.toArray(),void 0!==this.geometry&&(void 0===t.geometries[this.geometry.uuid]&&(t.geometries[this.geometry.uuid]=this.geometry.toJSON(t)),n.geometry=this.geometry.uuid),void 0!==this.material&&(void 0===t.materials[this.material.uuid]&&(t.materials[this.material.uuid]=this.material.toJSON(t)),n.material=this.material.uuid),0<this.children.length){n.children=[];for(var r=0;r<this.children.length;r++)n.children.push(this.children[r].toJSON(t).object)}if(a){var a=e(t.geometries),o=(r=e(t.materials),e(t.textures));t=e(t.images),0<a.length&&(i.geometries=a),0<r.length&&(i.materials=r),0<o.length&&(i.textures=o),0<t.length&&(i.images=t)}return i.object=n,i},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var i=0;i<t.children.length;i++)this.add(t.children[i].clone());return this}}),Y.prototype={constructor:Y,set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return(t||new Ct).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return(t||new Ct).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){var i=e||new Ct;return this.delta(i).multiplyScalar(t).add(this.start)},closestPointToPointParameter:(Ra=new Ct,Pa=new Ct,function(t,e){Ra.subVectors(t,this.start),Pa.subVectors(this.end,this.start);var i=Pa.dot(Pa);return i=Pa.dot(Ra)/i,e&&(i=er.clamp(i,0,1)),i}),closestPointToPoint:function(t,e,i){return t=this.closestPointToPointParameter(t,e),i=i||new Ct,this.delta(i).multiplyScalar(t).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}},q.normal=(Ca=new Ct,function(t,e,i,n){return(n=n||new Ct).subVectors(i,e),Ca.subVectors(t,e),n.cross(Ca),0<(t=n.lengthSq())?n.multiplyScalar(1/Math.sqrt(t)):n.set(0,0,0)}),q.barycoordFromPoint=(Ia=new Ct,Ua=new Ct,Na=new Ct,function(t,e,i,n,r){Ia.subVectors(n,e),Ua.subVectors(i,e),Na.subVectors(t,e),t=Ia.dot(Ia),e=Ia.dot(Ua),i=Ia.dot(Na);var a=Ua.dot(Ua);n=Ua.dot(Na);var o=t*a-e*e;return r=r||new Ct,0===o?r.set(-2,-1,-1):(a=(a*i-e*n)*(o=1/o),t=(t*n-e*i)*o,r.set(1-a-t,t,a))}),q.containsPoint=(Da=new Ct,function(t,e,i,n){return 0<=(t=q.barycoordFromPoint(t,e,i,n,Da)).x&&0<=t.y&&t.x+t.y<=1}),q.prototype={constructor:q,set:function(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this},setFromPointsAndIndices:function(t,e,i,n){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[n]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},area:(Ga=new Ct,Ha=new Ct,function(){return Ga.subVectors(this.c,this.b),Ha.subVectors(this.a,this.b),.5*Ga.cross(Ha).length()}),midpoint:function(t){return(t||new Ct).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(t){return q.normal(this.a,this.b,this.c,t)},plane:function(t){return(t||new H).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(t,e){return q.barycoordFromPoint(t,this.a,this.b,this.c,e)},containsPoint:function(t){return q.containsPoint(t,this.a,this.b,this.c)},closestPointToPoint:function(t,e){void 0===Oa&&(Oa=new H,Fa=[new Y,new Y,new Y],za=new Ct,Ba=new Ct);var i=e||new Ct,n=1/0;if(Oa.setFromCoplanarPoints(this.a,this.b,this.c),Oa.projectPoint(t,za),!0===this.containsPoint(za))i.copy(za);else{Fa[0].set(this.a,this.b),Fa[1].set(this.b,this.c),Fa[2].set(this.c,this.a);for(var r=0;r<Fa.length;r++){Fa[r].closestPointToPoint(za,!0,Ba);var a=za.distanceToSquared(Ba);a<n&&(n=a,i.copy(Ba))}}return i},equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},Z.prototype={constructor:Z,clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var e=0,i=t.vertexNormals.length;e<i;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(e=0,i=t.vertexColors.length;e<i;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}},((Ht.prototype=Object.create(N.prototype)).constructor=Ht).prototype.isMeshBasicMaterial=!0,Ht.prototype.copy=function(t){return N.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this},J.prototype={constructor:J,isBufferAttribute:!0,set needsUpdate(t){!0===t&&this.version++},setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==t?t.length/this.itemSize:0,this.array=t},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.dynamic=t.dynamic,this},copyAt:function(t,e,i){t*=this.itemSize,i*=e.itemSize;for(var n=0,r=this.itemSize;n<r;n++)this.array[t+n]=e.array[i+n];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var e=this.array,i=0,n=0,r=t.length;n<r;n++){var a=t[n];void 0===a&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",n),a=new Nt),e[i++]=a.r,e[i++]=a.g,e[i++]=a.b}return this},copyIndicesArray:function(t){for(var e=this.array,i=0,n=0,r=t.length;n<r;n++){var a=t[n];e[i++]=a.a,e[i++]=a.b,e[i++]=a.c}return this},copyVector2sArray:function(t){for(var e=this.array,i=0,n=0,r=t.length;n<r;n++){var a=t[n];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",n),a=new V),e[i++]=a.x,e[i++]=a.y}return this},copyVector3sArray:function(t){for(var e=this.array,i=0,n=0,r=t.length;n<r;n++){var a=t[n];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",n),a=new Ct),e[i++]=a.x,e[i++]=a.y,e[i++]=a.z}return this},copyVector4sArray:function(t){for(var e=this.array,i=0,n=0,r=t.length;n<r;n++){var a=t[n];void 0===a&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",n),a=new Pt),e[i++]=a.x,e[i++]=a.y,e[i++]=a.z,e[i++]=a.w}return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this},setXYZ:function(t,e,i,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this},setXYZW:function(t,e,i,n,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this.array[t+3]=r,this},onUpload:function(t){return this.onUploadCallback=t,this},clone:function(){return(new this.constructor).copy(this)}},(Q.prototype=Object.create(J.prototype)).constructor=Q,(K.prototype=Object.create(J.prototype)).constructor=K,($.prototype=Object.create(J.prototype)).constructor=$,(tt.prototype=Object.create(J.prototype)).constructor=tt,(et.prototype=Object.create(J.prototype)).constructor=et,(it.prototype=Object.create(J.prototype)).constructor=it,(nt.prototype=Object.create(J.prototype)).constructor=nt,(rt.prototype=Object.create(J.prototype)).constructor=rt,(at.prototype=Object.create(J.prototype)).constructor=at,Object.assign(ot.prototype,{computeGroups:function(t){var e,i=[],n=void 0;t=t.faces;for(var r=0;r<t.length;r++){var a=t[r];a.materialIndex!==n&&(n=a.materialIndex,void 0!==e&&(e.count=3*r-e.start,i.push(e)),e={start:3*r,materialIndex:n})}void 0!==e&&(e.count=3*r-e.start,i.push(e)),this.groups=i},fromGeometry:function(t){var e,i=t.faces,n=t.vertices,r=t.faceVertexUvs,a=r[0]&&0<r[0].length,o=r[1]&&0<r[1].length,s=t.morphTargets,c=s.length;if(0<c){e=[];for(var h=0;h<c;h++)e[h]=[];this.morphTargets.position=e}var l,u=t.morphNormals,d=u.length;if(0<d){for(l=[],h=0;h<d;h++)l[h]=[];this.morphTargets.normal=l}var p=t.skinIndices,f=t.skinWeights,m=p.length===n.length,g=f.length===n.length;for(h=0;h<i.length;h++){var v=i[h];this.vertices.push(n[v.a],n[v.b],n[v.c]);var y=v.vertexNormals;for(3===y.length?this.normals.push(y[0],y[1],y[2]):(y=v.normal,this.normals.push(y,y,y)),3===(y=v.vertexColors).length?this.colors.push(y[0],y[1],y[2]):(y=v.color,this.colors.push(y,y,y)),!0===a&&(void 0!==(y=r[0][h])?this.uvs.push(y[0],y[1],y[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",h),this.uvs.push(new V,new V,new V))),!0===o&&(void 0!==(y=r[1][h])?this.uvs2.push(y[0],y[1],y[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",h),this.uvs2.push(new V,new V,new V))),y=0;y<c;y++){var x=s[y].vertices;e[y].push(x[v.a],x[v.b],x[v.c])}for(y=0;y<d;y++)x=u[y].vertexNormals[h],l[y].push(x.a,x.b,x.c);m&&this.skinIndices.push(p[v.a],p[v.b],p[v.c]),g&&this.skinWeights.push(f[v.a],f[v.b],f[v.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this}}),Object.assign(st.prototype,e.prototype,{isGeometry:!0,applyMatrix:function(t){for(var e=(new F).getNormalMatrix(t),i=0,n=this.vertices.length;i<n;i++)this.vertices[i].applyMatrix4(t);for(i=0,n=this.faces.length;i<n;i++){(t=this.faces[i]).normal.applyMatrix3(e).normalize();for(var r=0,a=t.vertexNormals.length;r<a;r++)t.vertexNormals[r].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.normalsNeedUpdate=this.verticesNeedUpdate=!0,this},rotateX:function(t){return void 0===Ya&&(Ya=new It),Ya.makeRotationX(t),this.applyMatrix(Ya),this},rotateY:function(t){return void 0===Xa&&(Xa=new It),Xa.makeRotationY(t),this.applyMatrix(Xa),this},rotateZ:function(t){return void 0===Wa&&(Wa=new It),Wa.makeRotationZ(t),this.applyMatrix(Wa),this},translate:function(t,e,i){return void 0===ja&&(ja=new It),ja.makeTranslation(t,e,i),this.applyMatrix(ja),this},scale:function(t,e,i){return void 0===ka&&(ka=new It),ka.makeScale(t,e,i),this.applyMatrix(ka),this},lookAt:function(t){void 0===Va&&(Va=new X),Va.lookAt(t),Va.updateMatrix(),this.applyMatrix(Va.matrix)},fromBufferGeometry:function(t){function e(t,e,i,n){n=new Z(t,e,i,void 0!==o?[l[t].clone(),l[e].clone(),l[i].clone()]:[],void 0!==s?[r.colors[t].clone(),r.colors[e].clone(),r.colors[i].clone()]:[],n),r.faces.push(n),void 0!==c&&r.faceVertexUvs[0].push([u[t].clone(),u[e].clone(),u[i].clone()]),void 0!==h&&r.faceVertexUvs[1].push([d[t].clone(),d[e].clone(),d[i].clone()])}var r=this,i=null!==t.index?t.index.array:void 0,n=t.attributes,a=n.position.array,o=void 0!==n.normal?n.normal.array:void 0,s=void 0!==n.color?n.color.array:void 0,c=void 0!==n.uv?n.uv.array:void 0,h=void 0!==n.uv2?n.uv2.array:void 0;void 0!==h&&(this.faceVertexUvs[1]=[]);for(var l=[],u=[],d=[],p=n=0;n<a.length;n+=3,p+=2)r.vertices.push(new Ct(a[n],a[n+1],a[n+2])),void 0!==o&&l.push(new Ct(o[n],o[n+1],o[n+2])),void 0!==s&&r.colors.push(new Nt(s[n],s[n+1],s[n+2])),void 0!==c&&u.push(new V(c[p],c[p+1])),void 0!==h&&d.push(new V(h[p],h[p+1]));if(void 0!==i)if(0<(a=t.groups).length)for(n=0;n<a.length;n++)for(var f=a[n],m=(p=m=f.start,m+f.count);p<m;p+=3)e(i[p],i[p+1],i[p+2],f.materialIndex);else for(n=0;n<i.length;n+=3)e(i[n],i[n+1],i[n+2]);else for(n=0;n<a.length/3;n+=3)e(n,n+1,n+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var t=this.boundingBox.getCenter().negate();return this.translate(t.x,t.y,t.z),t},normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=0===(e=this.boundingSphere.radius)?1:1/e,i=new It;return i.set(e,0,0,-e*t.x,0,e,0,-e*t.y,0,0,e,-e*t.z,0,0,0,1),this.applyMatrix(i),this},computeFaceNormals:function(){for(var t=new Ct,e=new Ct,i=0,n=this.faces.length;i<n;i++){var r=this.faces[i],a=this.vertices[r.a],o=this.vertices[r.b];t.subVectors(this.vertices[r.c],o),e.subVectors(a,o),t.cross(e),t.normalize(),r.normal.copy(t)}},computeVertexNormals:function(t){var e,i,n;for(void 0===t&&(t=!0),n=Array(this.vertices.length),e=0,i=this.vertices.length;e<i;e++)n[e]=new Ct;if(t){var r,a,o,s=new Ct,c=new Ct;for(t=0,e=this.faces.length;t<e;t++)i=this.faces[t],r=this.vertices[i.a],a=this.vertices[i.b],o=this.vertices[i.c],s.subVectors(o,a),c.subVectors(r,a),s.cross(c),n[i.a].add(s),n[i.b].add(s),n[i.c].add(s)}else for(this.computeFaceNormals(),t=0,e=this.faces.length;t<e;t++)n[(i=this.faces[t]).a].add(i.normal),n[i.b].add(i.normal),n[i.c].add(i.normal);for(e=0,i=this.vertices.length;e<i;e++)n[e].normalize();for(t=0,e=this.faces.length;t<e;t++)3===(r=(i=this.faces[t]).vertexNormals).length?(r[0].copy(n[i.a]),r[1].copy(n[i.b]),r[2].copy(n[i.c])):(r[0]=n[i.a].clone(),r[1]=n[i.b].clone(),r[2]=n[i.c].clone());0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,e,i;for(this.computeFaceNormals(),t=0,e=this.faces.length;t<e;t++){var n=(i=this.faces[t]).vertexNormals;3===n.length?(n[0].copy(i.normal),n[1].copy(i.normal),n[2].copy(i.normal)):(n[0]=i.normal.clone(),n[1]=i.normal.clone(),n[2]=i.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,i,n,r;for(i=0,n=this.faces.length;i<n;i++)for((r=this.faces[i]).__originalFaceNormal?r.__originalFaceNormal.copy(r.normal):r.__originalFaceNormal=r.normal.clone(),r.__originalVertexNormals||(r.__originalVertexNormals=[]),t=0,e=r.vertexNormals.length;t<e;t++)r.__originalVertexNormals[t]?r.__originalVertexNormals[t].copy(r.vertexNormals[t]):r.__originalVertexNormals[t]=r.vertexNormals[t].clone();var a=new st;for(a.faces=this.faces,t=0,e=this.morphTargets.length;t<e;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[],r=this.morphNormals[t].faceNormals;var o,s,c=this.morphNormals[t].vertexNormals;for(i=0,n=this.faces.length;i<n;i++)o=new Ct,s={a:new Ct,b:new Ct,c:new Ct},r.push(o),c.push(s)}for(c=this.morphNormals[t],a.vertices=this.morphTargets[t].vertices,a.computeFaceNormals(),a.computeVertexNormals(),i=0,n=this.faces.length;i<n;i++)r=this.faces[i],o=c.faceNormals[i],s=c.vertexNormals[i],o.copy(r.normal),s.a.copy(r.vertexNormals[0]),s.b.copy(r.vertexNormals[1]),s.c.copy(r.vertexNormals[2])}for(i=0,n=this.faces.length;i<n;i++)(r=this.faces[i]).normal=r.__originalFaceNormal,r.vertexNormals=r.__originalVertexNormals},computeLineDistances:function(){for(var t=0,e=this.vertices,i=0,n=e.length;i<n;i++)0<i&&(t+=e[i].distanceTo(e[i-1])),this.lineDistances[i]=t},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new D),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new zt),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,i){if(!1===(t&&t.isGeometry))console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t);else{var n,r=this.vertices.length,a=this.vertices,o=t.vertices,s=this.faces,c=t.faces,h=this.faceVertexUvs[0],l=t.faceVertexUvs[0],u=this.colors,d=t.colors;void 0===i&&(i=0),void 0!==e&&(n=(new F).getNormalMatrix(e)),t=0;for(var p=o.length;t<p;t++){var f=o[t].clone();void 0!==e&&f.applyMatrix4(e),a.push(f)}for(t=0,p=d.length;t<p;t++)u.push(d[t].clone());for(t=0,p=c.length;t<p;t++){var m=(o=c[t]).vertexNormals;d=o.vertexColors;for((u=new Z(o.a+r,o.b+r,o.c+r)).normal.copy(o.normal),void 0!==n&&u.normal.applyMatrix3(n).normalize(),e=0,a=m.length;e<a;e++)f=m[e].clone(),void 0!==n&&f.applyMatrix3(n).normalize(),u.vertexNormals.push(f);for(u.color.copy(o.color),e=0,a=d.length;e<a;e++)f=d[e],u.vertexColors.push(f.clone());u.materialIndex=o.materialIndex+i,s.push(u)}for(t=0,p=l.length;t<p;t++)if(n=[],void 0!==(i=l[t])){for(e=0,a=i.length;e<a;e++)n.push(i[e].clone());h.push(n)}}},mergeMesh:function(t){!1===(t&&t.isMesh)?console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t):(t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix))},mergeVertices:function(){var t,e,i,n={},r=[],a=[],o=Math.pow(10,4);for(e=0,i=this.vertices.length;e<i;e++)t=this.vertices[e],void 0===n[t=Math.round(t.x*o)+"_"+Math.round(t.y*o)+"_"+Math.round(t.z*o)]?(n[t]=e,r.push(this.vertices[e]),a[e]=r.length-1):a[e]=a[n[t]];for(n=[],e=0,i=this.faces.length;e<i;e++)for((o=this.faces[e]).a=a[o.a],o.b=a[o.b],o.c=a[o.c],o=[o.a,o.b,o.c],t=0;t<3;t++)if(o[t]===o[(t+1)%3]){n.push(e);break}for(e=n.length-1;0<=e;e--)for(o=n[e],this.faces.splice(o,1),a=0,i=this.faceVertexUvs.length;a<i;a++)this.faceVertexUvs[a].splice(o,1);return e=this.vertices.length-r.length,this.vertices=r,e},sortFacesByMaterialIndex:function(){for(var t=this.faces,e=t.length,i=0;i<e;i++)t[i]._id=i;t.sort(function(t,e){return t.materialIndex-e.materialIndex});var n,r,a=this.faceVertexUvs[0],o=this.faceVertexUvs[1];for(a&&a.length===e&&(n=[]),o&&o.length===e&&(r=[]),i=0;i<e;i++){var s=t[i]._id;n&&n.push(a[s]),r&&r.push(o[s])}n&&(this.faceVertexUvs[0]=n),r&&(this.faceVertexUvs[1]=r)},toJSON:function(){function t(t,e,i){return i?t|1<<e:t&~(1<<e)}function e(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==h[e]||(h[e]=c.length/3,c.push(t.x,t.y,t.z)),h[e]}function i(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==u[e]||(u[e]=l.length,l.push(t.getHex())),u[e]}function n(t){var e=t.x.toString()+t.y.toString();return void 0!==p[e]||(p[e]=d.length/2,d.push(t.x,t.y)),p[e]}var r={metadata:{version:4.4,type:"Geometry",generator:"Geometry.toJSON"}};if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),void 0!==this.parameters){var a,o=this.parameters;for(a in o)void 0!==o[a]&&(r[a]=o[a]);return r}for(o=[],a=0;a<this.vertices.length;a++){var s=this.vertices[a];o.push(s.x,s.y,s.z)}s=[];var c=[],h={},l=[],u={},d=[],p={};for(a=0;a<this.faces.length;a++){var f=this.faces[a],m=void 0!==this.faceVertexUvs[0][a],g=0<f.normal.length(),v=0<f.vertexNormals.length,y=1!==f.color.r||1!==f.color.g||1!==f.color.b,x=0<f.vertexColors.length,_=t(_=t(_=t(_=t(_=t(_=t(_=t(_=t(_=0,0,0),1,!0),2,!1),3,m),4,g),5,v),6,y),7,x);s.push(_),s.push(f.a,f.b,f.c),s.push(f.materialIndex),m&&(m=this.faceVertexUvs[0][a],s.push(n(m[0]),n(m[1]),n(m[2]))),g&&s.push(e(f.normal)),v&&(g=f.vertexNormals,s.push(e(g[0]),e(g[1]),e(g[2]))),y&&s.push(i(f.color)),x&&(f=f.vertexColors,s.push(i(f[0]),i(f[1]),i(f[2])))}return r.data={},r.data.vertices=o,r.data.normals=c,0<l.length&&(r.data.colors=l),0<d.length&&(r.data.uvs=[d]),r.data.faces=s,r},clone:function(){return(new st).copy(this)},copy:function(t){this.vertices=[],this.faces=[],this.faceVertexUvs=[[]],this.colors=[];for(var e=t.vertices,i=0,n=e.length;i<n;i++)this.vertices.push(e[i].clone());for(i=0,n=(e=t.colors).length;i<n;i++)this.colors.push(e[i].clone());for(i=0,n=(e=t.faces).length;i<n;i++)this.faces.push(e[i].clone());for(i=0,n=t.faceVertexUvs.length;i<n;i++){e=t.faceVertexUvs[i],void 0===this.faceVertexUvs[i]&&(this.faceVertexUvs[i]=[]);for(var r=0,a=e.length;r<a;r++){for(var o=e[r],s=[],c=0,h=o.length;c<h;c++)s.push(o[c].clone());this.faceVertexUvs[i].push(s)}}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var Za,Ja,Qa,Ka,$a,to,eo,io,no,ro,ao=0;Object.assign(Vt.prototype,e.prototype,{isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){this.index=t},addAttribute:function(t,e,i){if(!1===(e&&e.isBufferAttribute)&&!1===(e&&e.isInterleavedBufferAttribute))console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.addAttribute(t,new J(e,i));else{if("index"!==t)return this.attributes[t]=e,this;console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e)}},getAttribute:function(t){return this.attributes[t]},removeAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,i){this.groups.push({start:t,count:e,materialIndex:void 0!==i?i:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix:function(t){var e=this.attributes.position;return void 0!==e&&(t.applyToVector3Array(e.array),e.needsUpdate=!0),void 0!==(e=this.attributes.normal)&&((new F).getNormalMatrix(t).applyToVector3Array(e.array),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return void 0===io&&(io=new It),io.makeRotationX(t),this.applyMatrix(io),this},rotateY:function(t){return void 0===eo&&(eo=new It),eo.makeRotationY(t),this.applyMatrix(eo),this},rotateZ:function(t){return void 0===to&&(to=new It),to.makeRotationZ(t),this.applyMatrix(to),this},translate:function(t,e,i){return void 0===$a&&($a=new It),$a.makeTranslation(t,e,i),this.applyMatrix($a),this},scale:function(t,e,i){return void 0===Ka&&(Ka=new It),Ka.makeScale(t,e,i),this.applyMatrix(Ka),this},lookAt:function(t){void 0===Qa&&(Qa=new X),Qa.lookAt(t),Qa.updateMatrix(),this.applyMatrix(Qa.matrix)},center:function(){this.computeBoundingBox();var t=this.boundingBox.getCenter().negate();return this.translate(t.x,t.y,t.z),t},setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){t=new rt(3*e.vertices.length,3);var i=new rt(3*e.colors.length,3);this.addAttribute("position",t.copyVector3sArray(e.vertices)),this.addAttribute("color",i.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length&&(t=new rt(e.lineDistances.length,1),this.addAttribute("lineDistance",t.copyArray(e.lineDistances))),null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},updateFromObject:function(t){var e=t.geometry;if(t.isMesh){var i=e.__directGeometry;if(!0===e.elementsNeedUpdate&&(i=void 0,e.elementsNeedUpdate=!1),void 0===i)return this.fromGeometry(e);i.verticesNeedUpdate=e.verticesNeedUpdate,i.normalsNeedUpdate=e.normalsNeedUpdate,i.colorsNeedUpdate=e.colorsNeedUpdate,i.uvsNeedUpdate=e.uvsNeedUpdate,i.groupsNeedUpdate=e.groupsNeedUpdate,e.verticesNeedUpdate=!1,e.normalsNeedUpdate=!1,e.colorsNeedUpdate=!1,e.uvsNeedUpdate=!1,e.groupsNeedUpdate=!1,e=i}return!0===e.verticesNeedUpdate&&(void 0!==(i=this.attributes.position)&&(i.copyVector3sArray(e.vertices),i.needsUpdate=!0),e.verticesNeedUpdate=!1),!0===e.normalsNeedUpdate&&(void 0!==(i=this.attributes.normal)&&(i.copyVector3sArray(e.normals),i.needsUpdate=!0),e.normalsNeedUpdate=!1),!0===e.colorsNeedUpdate&&(void 0!==(i=this.attributes.color)&&(i.copyColorsArray(e.colors),i.needsUpdate=!0),e.colorsNeedUpdate=!1),e.uvsNeedUpdate&&(void 0!==(i=this.attributes.uv)&&(i.copyVector2sArray(e.uvs),i.needsUpdate=!0),e.uvsNeedUpdate=!1),e.lineDistancesNeedUpdate&&(void 0!==(i=this.attributes.lineDistance)&&(i.copyArray(e.lineDistances),i.needsUpdate=!0),e.lineDistancesNeedUpdate=!1),e.groupsNeedUpdate&&(e.computeGroups(t.geometry),this.groups=e.groups,e.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new ot).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){var e=new Float32Array(3*t.vertices.length);for(var i in this.addAttribute("position",new J(e,3).copyVector3sArray(t.vertices)),0<t.normals.length&&(e=new Float32Array(3*t.normals.length),this.addAttribute("normal",new J(e,3).copyVector3sArray(t.normals))),0<t.colors.length&&(e=new Float32Array(3*t.colors.length),this.addAttribute("color",new J(e,3).copyColorsArray(t.colors))),0<t.uvs.length&&(e=new Float32Array(2*t.uvs.length),this.addAttribute("uv",new J(e,2).copyVector2sArray(t.uvs))),0<t.uvs2.length&&(e=new Float32Array(2*t.uvs2.length),this.addAttribute("uv2",new J(e,2).copyVector2sArray(t.uvs2))),0<t.indices.length&&(e=new(65535<t.vertices.length?Uint32Array:Uint16Array)(3*t.indices.length),this.setIndex(new J(e,1).copyIndicesArray(t.indices))),this.groups=t.groups,t.morphTargets){e=[];for(var n=t.morphTargets[i],r=0,a=n.length;r<a;r++){var o=n[r],s=new rt(3*o.length,3);e.push(s.copyVector3sArray(o))}this.morphAttributes[i]=e}return 0<t.skinIndices.length&&(i=new rt(4*t.skinIndices.length,4),this.addAttribute("skinIndex",i.copyVector4sArray(t.skinIndices))),0<t.skinWeights.length&&(i=new rt(4*t.skinWeights.length,4),this.addAttribute("skinWeight",i.copyVector4sArray(t.skinWeights))),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new D);var t=this.attributes.position;void 0!==t?this.boundingBox.setFromBufferAttribute(t):this.boundingBox.makeEmpty(),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:(Za=new D,Ja=new Ct,function(){null===this.boundingSphere&&(this.boundingSphere=new zt);var t=this.attributes.position;if(t){var e=this.boundingSphere.center;Za.setFromBufferAttribute(t),Za.getCenter(e);for(var i=0,n=0,r=t.count;n<r;n++)Ja.x=t.getX(n),Ja.y=t.getY(n),Ja.z=t.getZ(n),i=Math.max(i,e.distanceToSquared(Ja));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}),computeFaceNormals:function(){},computeVertexNormals:function(){var t=this.index,e=this.attributes,i=this.groups;if(e.position){var n=e.position.array;if(void 0===e.normal)this.addAttribute("normal",new J(new Float32Array(n.length),3));else for(var r=0,a=(h=e.normal.array).length;r<a;r++)h[r]=0;var o,s,c,h=e.normal.array,l=new Ct,u=new Ct,d=new Ct,p=new Ct,f=new Ct;if(t){t=t.array,0===i.length&&this.addGroup(0,t.length);for(var m=0,g=i.length;m<g;++m)for(a=(r=i[m]).start,o=r.count,r=a,a+=o;r<a;r+=3)o=3*t[r+0],s=3*t[r+1],c=3*t[r+2],l.fromArray(n,o),u.fromArray(n,s),d.fromArray(n,c),p.subVectors(d,u),f.subVectors(l,u),p.cross(f),h[o]+=p.x,h[o+1]+=p.y,h[o+2]+=p.z,h[s]+=p.x,h[1+s]+=p.y,h[2+s]+=p.z,h[c]+=p.x,h[1+c]+=p.y,h[2+c]+=p.z}else for(r=0,a=n.length;r<a;r+=9)l.fromArray(n,r),u.fromArray(n,r+3),d.fromArray(n,r+6),p.subVectors(d,u),f.subVectors(l,u),p.cross(f),h[r]=p.x,h[r+1]=p.y,h[r+2]=p.z,h[r+3]=p.x,h[r+4]=p.y,h[r+5]=p.z,h[r+6]=p.x,h[r+7]=p.y,h[r+8]=p.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(t,e){if(!1!==(t&&t.isBufferGeometry)){void 0===e&&(e=0);var i,n=this.attributes;for(i in n)if(void 0!==t.attributes[i])for(var r=n[i].array,a=(s=t.attributes[i]).array,o=0,s=s.itemSize*e;o<a.length;o++,s++)r[s]=a[o];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t)},normalizeNormals:function(){for(var t,e,i,n=this.attributes.normal.array,r=0,a=n.length;r<a;r+=3)t=n[r],e=n[r+1],i=n[r+2],t=1/Math.sqrt(t*t+e*e+i*i),n[r]*=t,n[r+1]*=t,n[r+2]*=t},toNonIndexed:function(){if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var t,e=new Vt,i=this.index.array,n=this.attributes;for(t in n){for(var r,a=(o=n[t]).array,o=o.itemSize,s=new a.constructor(i.length*o),c=0,h=0,l=i.length;h<l;h++){r=i[h]*o;for(var u=0;u<o;u++)s[c++]=a[r++]}e.addAttribute(t,new J(s,o))}return e},toJSON:function(){var t={metadata:{version:4.4,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){var e,i=this.parameters;for(e in i)void 0!==i[e]&&(t[e]=i[e]);return t}t.data={attributes:{}};var n=this.index;for(e in null!==n&&(i=Array.prototype.slice.call(n.array),t.data.index={type:n.array.constructor.name,array:i}),n=this.attributes){var r=n[e];i=Array.prototype.slice.call(r.array);t.data.attributes[e]={itemSize:r.itemSize,type:r.array.constructor.name,array:i,normalized:r.normalized}}return 0<(e=this.groups).length&&(t.data.groups=JSON.parse(JSON.stringify(e))),null!==(e=this.boundingSphere)&&(t.data.boundingSphere={center:e.center.toArray(),radius:e.radius}),t},clone:function(){return(new Vt).copy(this)},copy:function(t){null!==(i=t.index)&&this.setIndex(i.clone());var e,i=t.attributes;for(e in i)this.addAttribute(e,i[e].clone());for(e=0,i=(t=t.groups).length;e<i;e++){var n=t[e];this.addGroup(n.start,n.count,n.materialIndex)}return this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Vt.MaxIndex=65535,kt.prototype=Object.assign(Object.create(X.prototype),{constructor:kt,isMesh:!0,setDrawMode:function(t){this.drawMode=t},copy:function(t){return X.prototype.copy.call(this,t),this.drawMode=t.drawMode,this},updateMorphTargets:function(){var t=this.geometry.morphTargets;if(void 0!==t&&0<t.length){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var e=0,i=t.length;e<i;e++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[t[e].name]=e}},raycast:function(){function b(t,e,i,n,r,a,o){return q.barycoordFromPoint(t,e,i,n,s),r.multiplyScalar(s.x),a.multiplyScalar(s.y),o.multiplyScalar(s.z),r.add(a).add(o),r.clone()}function w(t,e,i,n,r,a,o){var s=t.material;return null===(1===s.side?i.intersectTriangle(a,r,n,!0,o):i.intersectTriangle(n,r,a,2!==s.side,o))?null:(c.copy(o),c.applyMatrix4(t.matrixWorld),(i=e.ray.origin.distanceTo(c))<e.near||i>e.far?null:{distance:i,point:c.clone(),object:t})}function M(t,e,i,n,r,a,o,s){return A.fromArray(n,3*a),L.fromArray(n,3*o),R.fromArray(n,3*s),(t=w(t,e,i,A,L,R,O))&&(r&&(U.fromArray(r,2*a),N.fromArray(r,2*o),D.fromArray(r,2*s),t.uv=b(O,A,L,R,U,N,D)),t.face=new Z(a,o,s,q.normal(A,L,R)),t.faceIndex=a),t}var E=new It,T=new k,S=new zt,A=new Ct,L=new Ct,R=new Ct,P=new Ct,C=new Ct,I=new Ct,U=new V,N=new V,D=new V,s=new Ct,O=new Ct,c=new Ct;return function(t,e){var i,n,r=this.geometry,a=this.material,o=this.matrixWorld;if(void 0!==a&&(null===r.boundingSphere&&r.computeBoundingSphere(),S.copy(r.boundingSphere),S.applyMatrix4(o),!1!==t.ray.intersectsSphere(S)&&(E.getInverse(o),T.copy(t.ray).applyMatrix4(E),null===r.boundingBox||!1!==T.intersectsBox(r.boundingBox))))if(r.isBufferGeometry){var s,c;a=r.index,r=(o=r.attributes).position.array;if(void 0!==o.uv&&(i=o.uv.array),null!==a)for(var h=0,l=(o=a.array).length;h<l;h+=3)a=o[h],s=o[h+1],c=o[h+2],(n=M(this,t,T,r,i,a,s,c))&&(n.faceIndex=Math.floor(h/3),e.push(n));else for(h=0,l=r.length;h<l;h+=9)(n=M(this,t,T,r,i,a=h/3,s=a+1,c=a+2))&&(n.index=a,e.push(n))}else if(r.isGeometry){var u,d;h=!0===(o=a&&a.isMultiMaterial)?a.materials:null,l=r.vertices;s=r.faces,0<(c=r.faceVertexUvs[0]).length&&(i=c);for(var p=0,f=s.length;p<f;p++){var m=s[p];if(void 0!==(n=!0===o?h[m.materialIndex]:a)){if(c=l[m.a],u=l[m.b],d=l[m.c],!0===n.morphTargets){n=r.morphTargets;var g=this.morphTargetInfluences;A.set(0,0,0),L.set(0,0,0),R.set(0,0,0);for(var v=0,y=n.length;v<y;v++){var x=g[v];if(0!==x){var _=n[v].vertices;A.addScaledVector(P.subVectors(_[m.a],c),x),L.addScaledVector(C.subVectors(_[m.b],u),x),R.addScaledVector(I.subVectors(_[m.c],d),x)}}A.add(c),L.add(u),R.add(d),c=A,u=L,d=R}(n=w(this,t,T,c,u,d,O))&&(i&&(g=i[p],U.copy(g[0]),N.copy(g[1]),D.copy(g[2]),n.uv=b(O,c,u,d,U,N,D)),n.face=m,n.faceIndex=p,e.push(n))}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),(jt.prototype=Object.create(Vt.prototype)).constructor=jt,(Wt.prototype=Object.create(Vt.prototype)).constructor=Wt,((ct.prototype=Object.create(X.prototype)).constructor=ct).prototype.isCamera=!0,ct.prototype.getWorldDirection=(no=new s,function(t){return t=t||new Ct,this.getWorldQuaternion(no),t.set(0,0,-1).applyQuaternion(no)}),ct.prototype.lookAt=(ro=new It,function(t){ro.lookAt(this.position,t,this.up),this.quaternion.setFromRotationMatrix(ro)}),ct.prototype.clone=function(){return(new this.constructor).copy(this)},ct.prototype.copy=function(t){return X.prototype.copy.call(this,t),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this},Xt.prototype=Object.assign(Object.create(ct.prototype),{constructor:Xt,isPerspectiveCamera:!0,copy:function(t){return ct.prototype.copy.call(this,t),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){t=.5*this.getFilmHeight()/t,this.fov=2*er.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*er.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*er.RAD2DEG*Math.atan(Math.tan(.5*er.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,i,n,r,a){this.aspect=t/e,this.view={fullWidth:t,fullHeight:e,offsetX:i,offsetY:n,width:r,height:a},this.updateProjectionMatrix()},clearViewOffset:function(){this.view=null,this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=2*(o=t*Math.tan(.5*er.DEG2RAD*this.fov)/this.zoom),i=-.5*(s=this.aspect*e),n=this.view;if(null!==n){var r=n.fullWidth,a=n.fullHeight,o=(i=i+n.offsetX*s/r,o-n.offsetY*e/a),s=n.width/r*s;e=n.height/a*e}0!==(n=this.filmOffset)&&(i+=t*n/this.getFilmWidth()),this.projectionMatrix.makeFrustum(i,i+s,o-e,o,t,this.far)},toJSON:function(t){return(t=X.prototype.toJSON.call(this,t)).object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}),Yt.prototype=Object.assign(Object.create(ct.prototype),{constructor:Yt,isOrthographicCamera:!0,copy:function(t){return ct.prototype.copy.call(this,t),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,e,i,n,r,a){this.view={fullWidth:t,fullHeight:e,offsetX:i,offsetY:n,width:r,height:a},this.updateProjectionMatrix()},clearViewOffset:function(){this.view=null,this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(n=(this.right+this.left)/2)-t,n=n+t;t=(a=(this.top+this.bottom)/2)+e,e=a-e;if(null!==this.view){n=this.zoom/(this.view.width/this.view.fullWidth),e=this.zoom/(this.view.height/this.view.fullHeight);var r=(this.right-this.left)/this.view.width,a=(this.top-this.bottom)/this.view.height;n=(i=i+this.view.offsetX/n*r)+this.view.width/n*r,e=(t=t-this.view.offsetY/e*a)-this.view.height/e*a}this.projectionMatrix.makeOrthographic(i,n,t,e,this.near,this.far)},toJSON:function(t){return(t=X.prototype.toJSON.call(this,t)).object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}});var oo,so,co,ho,lo,uo,po,fo,mo,go,vo,yo=0;xt.prototype.isFogExp2=!0,xt.prototype.clone=function(){return new xt(this.color.getHex(),this.density)},xt.prototype.toJSON=function(t){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},_t.prototype.isFog=!0,_t.prototype.clone=function(){return new _t(this.color.getHex(),this.near,this.far)},_t.prototype.toJSON=function(t){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},((bt.prototype=Object.create(X.prototype)).constructor=bt).prototype.copy=function(t,e){return X.prototype.copy.call(this,t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},bt.prototype.toJSON=function(t){var e=X.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e},wt.prototype=Object.assign(Object.create(X.prototype),{constructor:wt,isLensFlare:!0,copy:function(t){X.prototype.copy.call(this,t),this.positionScreen.copy(t.positionScreen),this.customUpdateCallback=t.customUpdateCallback;for(var e=0,i=t.lensFlares.length;e<i;e++)this.lensFlares.push(t.lensFlares[e]);return this},add:function(t,e,i,n,r,a){void 0===e&&(e=-1),void 0===i&&(i=0),void 0===a&&(a=1),void 0===r&&(r=new Nt(16777215)),void 0===n&&(n=1),i=Math.min(i,Math.max(0,i)),this.lensFlares.push({texture:t,size:e,distance:i,x:0,y:0,z:0,scale:1,rotation:0,opacity:a,color:r,blending:n})},updateLensFlares:function(){var t,e,i=this.lensFlares.length,n=2*-this.positionScreen.x,r=2*-this.positionScreen.y;for(t=0;t<i;t++)(e=this.lensFlares[t]).x=this.positionScreen.x+n*e.distance,e.y=this.positionScreen.y+r*e.distance,e.wantedRotation=e.x*Math.PI*.25,e.rotation+=.25*(e.wantedRotation-e.rotation)}}),((Mt.prototype=Object.create(N.prototype)).constructor=Mt).prototype.copy=function(t){return N.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.rotation=t.rotation,this},Et.prototype=Object.assign(Object.create(X.prototype),{constructor:Et,isSprite:!0,raycast:(oo=new Ct,function(t,e){oo.setFromMatrixPosition(this.matrixWorld);var i=t.ray.distanceSqToPoint(oo);i>this.scale.x*this.scale.y/4||e.push({distance:Math.sqrt(i),point:this.position,face:null,object:this})}),clone:function(){return new this.constructor(this.material).copy(this)}}),Tt.prototype=Object.assign(Object.create(X.prototype),{constructor:Tt,copy:function(t){X.prototype.copy.call(this,t,!1);for(var e=0,i=(t=t.levels).length;e<i;e++){var n=t[e];this.addLevel(n.object.clone(),n.distance)}return this},addLevel:function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var i=this.levels,n=0;n<i.length&&!(e<i[n].distance);n++);i.splice(n,0,{distance:e,object:t}),this.add(t)},getObjectForDistance:function(t){for(var e=this.levels,i=1,n=e.length;i<n&&!(t<e[i].distance);i++);return e[i-1].object},raycast:(ho=new Ct,function(t,e){ho.setFromMatrixPosition(this.matrixWorld);var i=t.ray.origin.distanceTo(ho);this.getObjectForDistance(i).raycast(t,e)}),update:(so=new Ct,co=new Ct,function(t){var e=this.levels;if(1<e.length){so.setFromMatrixPosition(t.matrixWorld),co.setFromMatrixPosition(this.matrixWorld),t=so.distanceTo(co),e[0].object.visible=!0;for(var i=1,n=e.length;i<n&&t>=e[i].distance;i++)e[i-1].object.visible=!1,e[i].object.visible=!0;for(;i<n;i++)e[i].object.visible=!1}}),toJSON:function(t){(t=X.prototype.toJSON.call(this,t)).object.levels=[];for(var e=this.levels,i=0,n=e.length;i<n;i++){var r=e[i];t.object.levels.push({object:r.object.uuid,distance:r.distance})}return t}}),Object.assign(St.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var i=new It;this.bones[t]&&i.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(i)}},pose:function(){for(var t,e=0,i=this.bones.length;e<i;e++)(t=this.bones[e])&&t.matrixWorld.getInverse(this.boneInverses[e]);for(e=0,i=this.bones.length;e<i;e++)(t=this.bones[e])&&(t.parent&&t.parent.isBone?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},update:(lo=new It,function(){for(var t=0,e=this.bones.length;t<e;t++)lo.multiplyMatrices(this.bones[t]?this.bones[t].matrixWorld:this.identityMatrix,this.boneInverses[t]),lo.toArray(this.boneMatrices,16*t);this.useVertexTexture&&(this.boneTexture.needsUpdate=!0)}),clone:function(){return new St(this.bones,this.boneInverses,this.useVertexTexture)}}),At.prototype=Object.assign(Object.create(X.prototype),{constructor:At,isBone:!0}),Lt.prototype=Object.assign(Object.create(kt.prototype),{constructor:Lt,isSkinnedMesh:!0,bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){if(this.geometry&&this.geometry.isGeometry)for(var t=0;t<this.geometry.skinWeights.length;t++){var e=1/(i=this.geometry.skinWeights[t]).lengthManhattan();1/0!==e?i.multiplyScalar(e):i.set(1,0,0,0)}else if(this.geometry&&this.geometry.isBufferGeometry){var i=new Pt,n=this.geometry.attributes.skinWeight;for(t=0;t<n.count;t++)i.x=n.getX(t),i.y=n.getY(t),i.z=n.getZ(t),i.w=n.getW(t),1/0!==(e=1/i.lengthManhattan())?i.multiplyScalar(e):i.set(1,0,0,0),n.setXYZW(t,i.x,i.y,i.z,i.w)}},updateMatrixWorld:function(t){kt.prototype.updateMatrixWorld.call(this,!0),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material,this.skeleton.useVertexTexture).copy(this)}}),((Rt.prototype=Object.create(N.prototype)).constructor=Rt).prototype.isLineBasicMaterial=!0,Rt.prototype.copy=function(t){return N.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this},ae.prototype=Object.assign(Object.create(X.prototype),{constructor:ae,isLine:!0,raycast:(uo=new It,po=new k,fo=new zt,function(t,e){var i=(i=t.linePrecision)*i,n=this.geometry,r=this.matrixWorld;if(null===n.boundingSphere&&n.computeBoundingSphere(),fo.copy(n.boundingSphere),fo.applyMatrix4(r),!1!==t.ray.intersectsSphere(fo)){uo.getInverse(r),po.copy(t.ray).applyMatrix4(uo);var a=new Ct,o=new Ct,s=(r=new Ct,new Ct),c=this&&this.isLineSegments?2:1;if(n.isBufferGeometry){var h=n.index,l=n.attributes.position.array;if(null!==h){n=0;for(var u=(h=h.array).length-1;n<u;n+=c){var d=h[n+1];a.fromArray(l,3*h[n]),o.fromArray(l,3*d),i<(d=po.distanceSqToSegment(a,o,s,r))||(s.applyMatrix4(this.matrixWorld),(d=t.ray.origin.distanceTo(s))<t.near||d>t.far||e.push({distance:d,point:r.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this}))}}else for(n=0,u=l.length/3-1;n<u;n+=c)a.fromArray(l,3*n),o.fromArray(l,3*n+3),i<(d=po.distanceSqToSegment(a,o,s,r))||(s.applyMatrix4(this.matrixWorld),(d=t.ray.origin.distanceTo(s))<t.near||d>t.far||e.push({distance:d,point:r.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this}))}else if(n.isGeometry)for(o=(a=n.vertices).length,n=0;n<o-1;n+=c)i<(d=po.distanceSqToSegment(a[n],a[n+1],s,r))||(s.applyMatrix4(this.matrixWorld),(d=t.ray.origin.distanceTo(s))<t.near||d>t.far||e.push({distance:d,point:r.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this}))}}),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),oe.prototype=Object.assign(Object.create(ae.prototype),{constructor:oe,isLineSegments:!0}),((se.prototype=Object.create(N.prototype)).constructor=se).prototype.isPointsMaterial=!0,se.prototype.copy=function(t){return N.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this},ce.prototype=Object.assign(Object.create(X.prototype),{constructor:ce,isPoints:!0,raycast:(mo=new It,go=new k,vo=new zt,function(a,o){function t(t,e){var i=go.distanceSqToPoint(t);if(i<h){var n=go.closestPointToPoint(t);n.applyMatrix4(c);var r=a.ray.origin.distanceTo(n);r<a.near||r>a.far||o.push({distance:r,distanceToRay:Math.sqrt(i),point:n.clone(),index:e,face:null,object:s})}}var s=this,e=this.geometry,c=this.matrixWorld,i=a.params.Points.threshold;if(null===e.boundingSphere&&e.computeBoundingSphere(),vo.copy(e.boundingSphere),vo.applyMatrix4(c),!1!==a.ray.intersectsSphere(vo)){mo.getInverse(c),go.copy(a.ray).applyMatrix4(mo);var h=(i/=(this.scale.x+this.scale.y+this.scale.z)/3)*i;if(i=new Ct,e.isBufferGeometry){var n=e.index;if(e=e.attributes.position.array,null!==n)for(var r=n.array,l=(n=0,r.length);n<l;n++){var u=r[n];i.fromArray(e,3*u),t(i,u)}else for(n=0,r=e.length/3;n<r;n++)i.fromArray(e,3*n),t(i,n)}else for(n=0,r=(i=e.vertices).length;n<r;n++)t(i[n],n)}}),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),he.prototype=Object.assign(Object.create(X.prototype),{constructor:he}),(le.prototype=Object.create(z.prototype)).constructor=le,((ue.prototype=Object.create(z.prototype)).constructor=ue).prototype.isCompressedTexture=!0,(de.prototype=Object.create(z.prototype)).constructor=de,((pe.prototype=Object.create(z.prototype)).constructor=pe).prototype.isDepthTexture=!0,(fe.prototype=Object.create(Vt.prototype)).constructor=fe,(me.prototype=Object.create(Vt.prototype)).constructor=me,(ge.prototype=Object.create(st.prototype)).constructor=ge,(ve.prototype=Object.create(Vt.prototype)).constructor=ve,(ye.prototype=Object.create(ve.prototype)).constructor=ye,(xe.prototype=Object.create(st.prototype)).constructor=xe,(_e.prototype=Object.create(ve.prototype)).constructor=_e,(be.prototype=Object.create(st.prototype)).constructor=be,(we.prototype=Object.create(ve.prototype)).constructor=we,(Me.prototype=Object.create(st.prototype)).constructor=Me,(Ee.prototype=Object.create(ve.prototype)).constructor=Ee,(Te.prototype=Object.create(st.prototype)).constructor=Te,(Se.prototype=Object.create(st.prototype)).constructor=Se,(Ae.prototype=Object.create(Vt.prototype)).constructor=Ae,(Le.prototype=Object.create(st.prototype)).constructor=Le,(Re.prototype=Object.create(Vt.prototype)).constructor=Re,(Pe.prototype=Object.create(st.prototype)).constructor=Pe,(Ce.prototype=Object.create(Vt.prototype)).constructor=Ce,(Ie.prototype=Object.create(st.prototype)).constructor=Ie;var xo={area:function(t){for(var e=t.length,i=0,n=e-1,r=0;r<e;n=r++)i+=t[n].x*t[r].y-t[r].x*t[n].y;return.5*i},triangulate:function(t,e){var i=t.length;if(i<3)return null;var n,r,a,o=[],s=[],c=[];if(0<xo.area(t))for(r=0;r<i;r++)s[r]=r;else for(r=0;r<i;r++)s[r]=i-1-r;var h=2*i;for(r=i-1;2<i;){if(h--<=0){console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()");break}var l;i<=(n=r)&&(n=0),i<=(r=n+1)&&(r=0),i<=(a=r+1)&&(a=0);t:{var u,d,p,f,m,g,v,y;if(u=t[s[n]].x,d=t[s[n]].y,p=t[s[r]].x,f=t[s[r]].y,m=t[s[a]].x,(p-u)*((g=t[s[a]].y)-d)-(f-d)*(m-u)<=0)l=!1;else{var x,_,b,w,M,E,T,S,A,L;for(x=m-p,_=g-f,b=u-m,w=d-g,M=p-u,E=f-d,l=0;l<i;l++)if(v=t[s[l]].x,y=t[s[l]].y,!(v===u&&y===d||v===p&&y===f||v===m&&y===g)&&(A=v-p,L=y-f,T=M*(S=y-d)-E*(T=v-u),S=b*(y-=g)-w*(v-=m),(A=x*L-_*A)>=-Number.EPSILON&&S>=-Number.EPSILON&&T>=-Number.EPSILON)){l=!1;break t}l=!0}}if(l){for(o.push([t[s[n]],t[s[r]],t[s[a]]]),c.push([s[n],s[r],s[a]]),a=(n=r)+1;a<i;n++,a++)s[n]=s[a];h=2*--i}}return e?c:o},triangulateShape:function(x,t){function e(t){var e=t.length;2<e&&t[e-1].equals(t[0])&&t.pop()}function p(t,e,i){return t.x!==e.x?t.x<e.x?t.x<=i.x&&i.x<=e.x:e.x<=i.x&&i.x<=t.x:t.y<e.y?t.y<=i.y&&i.y<=e.y:e.y<=i.y&&i.y<=t.y}function _(t,e,i,n,r){var a=e.x-t.x,o=e.y-t.y,s=n.x-i.x,c=n.y-i.y,h=t.x-i.x,l=t.y-i.y,u=o*s-a*c,d=o*h-a*l;if(Math.abs(u)>Number.EPSILON){if(0<u){if(d<0||u<d)return[];if((s=c*h-s*l)<0||u<s)return[]}else{if(0<d||d<u)return[];if(0<(s=c*h-s*l)||s<u)return[]}return 0===s?!r||0!=d&&d!==u?[t]:[]:s===u?!r||0!=d&&d!==u?[e]:[]:0==d?[i]:d===u?[n]:(r=s/u,[{x:t.x+r*a,y:t.y+r*o}])}return 0!=d||c*h!=s*l?[]:(s=0===s&&0===c,(o=0===a&&0===o)&&s?t.x!==i.x||t.y!==i.y?[]:[t]:o?p(i,n,t)?[t]:[]:s?p(t,e,i)?[i]:[]:(i=0!==a?(t=t.x<e.x?(s=(a=t).x,(o=e).x):(s=(a=e).x,(o=t).x),i.x<n.x?(u=(e=i).x,(c=n).x):(u=(e=n).x,(c=i).x)):(t=t.y<e.y?(s=(a=t).y,(o=e).y):(s=(a=e).y,(o=t).y),i.y<n.y?(u=(e=i).y,(c=n).y):(u=(e=n).y,(c=i).y)),s<=u?t<u?[]:t===u?r?[]:[e]:t<=i?[e,o]:[e,c]:i<s?[]:s===i?r?[]:[a]:t<=i?[a,o]:[a,c]))}function b(t,e,i,n){var r=e.x-t.x,a=e.y-t.y;e=i.x-t.x,i=i.y-t.y;var o=n.x-t.x;return n=n.y-t.y,t=r*i-a*e,r=r*n-a*o,Math.abs(t)>Number.EPSILON?(e=o*i-n*e,0<t?0<=r&&0<=e:0<=r||0<=e):0<r}e(x),t.forEach(e);var i,n,r,a,o,s={};for(r=x.concat(),i=0,n=t.length;i<n;i++)Array.prototype.push.apply(r,t[i]);for(i=0,n=r.length;i<n;i++)void 0!==s[o=r[i].x+":"+r[i].y]&&console.warn("THREE.ShapeUtils: Duplicate point",o,i),s[o]=i;i=function(t,o){function e(t,e){var i=f.length-1,n=t-1;n<0&&(n=i);var r=t+1;return i<r&&(r=0),!!(i=b(f[t],f[n],f[r],a[e]))&&(i=a.length-1,(n=e-1)<0&&(n=i),i<(r=e+1)&&(r=0),!!(i=b(a[e],a[n],a[r],f[t])))}function i(t,e){var i,n;for(i=0;i<f.length;i++)if(n=i+1,n%=f.length,0<(n=_(t,e,f[i],f[n],!0)).length)return!0;return!1}function n(t,e){var i,n,r,a;for(i=0;i<m.length;i++)for(n=o[m[i]],r=0;r<n.length;r++)if(a=r+1,a%=n.length,0<(a=_(t,e,n[r],n[a],!0)).length)return!0;return!1}var a,r,s,c,h,l,u,d,p,f=x.concat(),m=[],g=[],v=0;for(r=o.length;v<r;v++)m.push(v);u=0;for(var y=2*m.length;0<m.length;){if(--y<0){console.log("Infinite Loop! Holes left:"+m.length+", Probably Hole outside Shape!");break}for(s=u;s<f.length;s++){for(c=f[s],r=-1,v=0;v<m.length;v++)if(h=m[v],void 0===g[l=c.x+":"+c.y+":"+h]){for(a=o[h],d=0;d<a.length;d++)if(h=a[d],e(s,d)&&!i(c,h)&&!n(c,h)){r=d,m.splice(v,1),u=f.slice(0,s+1),h=f.slice(s),d=a.slice(r),p=a.slice(0,r+1),f=u.concat(d).concat(p).concat(h),u=s;break}if(0<=r)break;g[l]=!0}if(0<=r)break}}return f}(0,t);var c=xo.triangulate(i,!1);for(i=0,n=c.length;i<n;i++)for(a=c[i],r=0;r<3;r++)void 0!==(o=s[o=a[r].x+":"+a[r].y])&&(a[r]=o);return c.concat()},isClockWise:function(t){return xo.area(t)<0},b2:function(t,e,i,n){var r=1-t;return r*r*e+2*(1-t)*t*i+t*t*n},b3:function(t,e,i,n,r){var a=1-t,o=1-t;return a*a*a*e+3*o*o*t*i+3*(1-t)*t*t*n+t*t*t*r}};((Ue.prototype=Object.create(st.prototype)).constructor=Ue).prototype.addShapeList=function(t,e){for(var i=t.length,n=0;n<i;n++)this.addShape(t[n],e)},Ue.prototype.addShape=function(t,e){function i(t,e,i){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(i).add(t)}function n(t,e,i){var n,r,a;r=t.x-e.x,a=t.y-e.y,n=i.x-t.x;var o=i.y-t.y,s=r*r+a*a;if(Math.abs(r*o-a*n)>Number.EPSILON){var c=Math.sqrt(s),h=Math.sqrt(n*n+o*o);s=e.x-a/c;if(e=e.y+r/c,(a=(n=s+r*(o=((i.x-o/h-s)*o-(i.y+n/h-e)*n)/(r*o-a*n))-t.x)*n+(r=e+a*o-t.y)*r)<=2)return new V(n,r);a=Math.sqrt(a/2)}else t=!1,r>Number.EPSILON?n>Number.EPSILON&&(t=!0):r<-Number.EPSILON?n<-Number.EPSILON&&(t=!0):Math.sign(a)===Math.sign(o)&&(t=!0),a=t?(n=-a,Math.sqrt(s)):(n=r,r=a,Math.sqrt(s/2));return new V(n/a,r/a)}function r(t,e){var i,n;for(z=t.length;0<=--z;){(n=(i=z)-1)<0&&(n=t.length-1);var r,a=y+2*m;for(r=0;r<a;r++){var o=(o=e+i+(s=O*r))+S,s=(s=e+n+s)+S,c=(c=e+n+(h=O*(r+1)))+S,h=(h=e+i+h)+S;T.faces.push(new Z(o,s,h,null,null,1)),T.faces.push(new Z(s,c,h,null,null,1)),o=b.generateSideWallUV(T,o,s,c,h),T.faceVertexUvs[0].push([o[0],o[1],o[3]]),T.faceVertexUvs[0].push([o[1],o[2],o[3]])}}}function a(t,e,i){T.vertices.push(new Ct(t,e,i))}function o(t,e,i){t+=S,e+=S,i+=S,T.faces.push(new Z(t,e,i,null,null,0)),t=b.generateTopUV(T,t,e,i),T.faceVertexUvs[0].push(t)}var s,c,h,l,u,d=void 0!==e.amount?e.amount:100,p=void 0!==e.bevelThickness?e.bevelThickness:6,f=void 0!==e.bevelSize?e.bevelSize:p-2,m=void 0!==e.bevelSegments?e.bevelSegments:3,g=void 0===e.bevelEnabled||e.bevelEnabled,v=void 0!==e.curveSegments?e.curveSegments:12,y=void 0!==e.steps?e.steps:1,x=e.extrudePath,_=!1,b=void 0!==e.UVGenerator?e.UVGenerator:Ue.WorldUVGenerator;x&&(s=x.getSpacedPoints(y),g=!(_=!0),c=void 0!==e.frames?e.frames:x.computeFrenetFrames(y,!1),h=new Ct,l=new Ct,u=new Ct),g||(f=p=m=0);var w,M,E,T=this,S=this.vertices.length,A=(v=(x=t.extractPoints(v)).shape,x.holes);if(x=!xo.isClockWise(v)){for(v=v.reverse(),M=0,E=A.length;M<E;M++)w=A[M],xo.isClockWise(w)&&(A[M]=w.reverse());x=!1}var L=xo.triangulateShape(v,A),R=v;for(M=0,E=A.length;M<E;M++)w=A[M],v=v.concat(w);var P,C,I,U,N,D,O=v.length,F=L.length,z=(x=[],0);for(P=(I=R.length)-1,C=z+1;z<I;z++,P++,C++)P===I&&(P=0),C===I&&(C=0),x[z]=n(R[z],R[P],R[C]);var B,G=[],H=x.concat();for(M=0,E=A.length;M<E;M++){for(w=A[M],B=[],z=0,P=(I=w.length)-1,C=z+1;z<I;z++,P++,C++)P===I&&(P=0),C===I&&(C=0),B[z]=n(w[z],w[P],w[C]);G.push(B),H=H.concat(B)}for(P=0;P<m;P++){for(I=P/m,U=p*Math.cos(I*Math.PI/2),C=f*Math.sin(I*Math.PI/2),z=0,I=R.length;z<I;z++)a((N=i(R[z],x[z],C)).x,N.y,-U);for(M=0,E=A.length;M<E;M++)for(w=A[M],B=G[M],z=0,I=w.length;z<I;z++)a((N=i(w[z],B[z],C)).x,N.y,-U)}for(C=f,z=0;z<O;z++)N=g?i(v[z],H[z],C):v[z],_?(l.copy(c.normals[0]).multiplyScalar(N.x),h.copy(c.binormals[0]).multiplyScalar(N.y),u.copy(s[0]).add(l).add(h),a(u.x,u.y,u.z)):a(N.x,N.y,0);for(I=1;I<=y;I++)for(z=0;z<O;z++)N=g?i(v[z],H[z],C):v[z],_?(l.copy(c.normals[I]).multiplyScalar(N.x),h.copy(c.binormals[I]).multiplyScalar(N.y),u.copy(s[I]).add(l).add(h),a(u.x,u.y,u.z)):a(N.x,N.y,d/y*I);for(P=m-1;0<=P;P--){for(I=P/m,U=p*Math.cos(I*Math.PI/2),C=f*Math.sin(I*Math.PI/2),z=0,I=R.length;z<I;z++)a((N=i(R[z],x[z],C)).x,N.y,d+U);for(M=0,E=A.length;M<E;M++)for(w=A[M],B=G[M],z=0,I=w.length;z<I;z++)N=i(w[z],B[z],C),_?a(N.x,N.y+s[y-1].y,s[y-1].x+U):a(N.x,N.y,d+U)}!function(){if(g){var t=0*O;for(z=0;z<F;z++)o((D=L[z])[2]+t,D[1]+t,D[0]+t);for(t=O*(y+2*m),z=0;z<F;z++)o((D=L[z])[0]+t,D[1]+t,D[2]+t)}else{for(z=0;z<F;z++)o((D=L[z])[2],D[1],D[0]);for(z=0;z<F;z++)o((D=L[z])[0]+O*y,D[1]+O*y,D[2]+O*y)}}(),function(){var t=0;for(r(R,t),t+=R.length,M=0,E=A.length;M<E;M++)r(w=A[M],t),t+=w.length}()},Ue.WorldUVGenerator={generateTopUV:function(t,e,i,n){return e=(t=t.vertices)[e],i=t[i],n=t[n],[new V(e.x,e.y),new V(i.x,i.y),new V(n.x,n.y)]},generateSideWallUV:function(t,e,i,n,r){return e=(t=t.vertices)[e],i=t[i],n=t[n],r=t[r],Math.abs(e.y-i.y)<.01?[new V(e.x,1-e.z),new V(i.x,1-i.z),new V(n.x,1-n.z),new V(r.x,1-r.z)]:[new V(e.y,1-e.z),new V(i.y,1-i.z),new V(n.y,1-n.z),new V(r.y,1-r.z)]}},(Ne.prototype=Object.create(Ue.prototype)).constructor=Ne,(De.prototype=Object.create(Vt.prototype)).constructor=De,(Oe.prototype=Object.create(st.prototype)).constructor=Oe,(Fe.prototype=Object.create(Vt.prototype)).constructor=Fe,(ze.prototype=Object.create(st.prototype)).constructor=ze,(Be.prototype=Object.create(st.prototype)).constructor=Be,(Ge.prototype=Object.create(Vt.prototype)).constructor=Ge,(He.prototype=Object.create(st.prototype)).constructor=He,(Ve.prototype=Object.create(Vt.prototype)).constructor=Ve,(ke.prototype=Object.create(st.prototype)).constructor=ke,(je.prototype=Object.create(Vt.prototype)).constructor=je,(We.prototype=Object.create(Vt.prototype)).constructor=We,(Xe.prototype=Object.create(st.prototype)).constructor=Xe,(Ye.prototype=Object.create(Xe.prototype)).constructor=Ye,(qe.prototype=Object.create(We.prototype)).constructor=qe,(Ze.prototype=Object.create(Vt.prototype)).constructor=Ze,(Je.prototype=Object.create(st.prototype)).constructor=Je,(Qe.prototype=Object.create(st.prototype)).constructor=Qe;var _o=Object.freeze({WireframeGeometry:fe,ParametricGeometry:ge,ParametricBufferGeometry:me,TetrahedronGeometry:xe,TetrahedronBufferGeometry:ye,OctahedronGeometry:be,OctahedronBufferGeometry:_e,IcosahedronGeometry:Me,IcosahedronBufferGeometry:we,DodecahedronGeometry:Te,DodecahedronBufferGeometry:Ee,PolyhedronGeometry:Se,PolyhedronBufferGeometry:ve,TubeGeometry:Le,TubeBufferGeometry:Ae,TorusKnotGeometry:Pe,TorusKnotBufferGeometry:Re,TorusGeometry:Ie,TorusBufferGeometry:Ce,TextGeometry:Ne,SphereBufferGeometry:De,SphereGeometry:Oe,RingGeometry:ze,RingBufferGeometry:Fe,PlaneBufferGeometry:Wt,PlaneGeometry:Be,LatheGeometry:He,LatheBufferGeometry:Ge,ShapeGeometry:ke,ShapeBufferGeometry:Ve,ExtrudeGeometry:Ue,EdgesGeometry:je,ConeGeometry:Ye,ConeBufferGeometry:qe,CylinderGeometry:Xe,CylinderBufferGeometry:We,CircleBufferGeometry:Ze,CircleGeometry:Je,BoxBufferGeometry:jt,BoxGeometry:Qe});((Ke.prototype=Object.create(Ft.prototype)).constructor=Ke).prototype.isShadowMaterial=!0,$e.prototype=Object.create(Ft.prototype),ti.prototype={constructor:ti,isMultiMaterial:($e.prototype.constructor=$e).prototype.isRawShaderMaterial=!0,toJSON:function(t){for(var e={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type,materials:[]},i=this.materials,n=0,r=i.length;n<r;n++){var a=i[n].toJSON(t);delete a.metadata,e.materials.push(a)}return e.visible=this.visible,e},clone:function(){for(var t=new this.constructor,e=0;e<this.materials.length;e++)t.materials.push(this.materials[e].clone());return t.visible=this.visible,t}},((ei.prototype=Object.create(N.prototype)).constructor=ei).prototype.isMeshStandardMaterial=!0,ei.prototype.copy=function(t){return N.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((ii.prototype=Object.create(ei.prototype)).constructor=ii).prototype.isMeshPhysicalMaterial=!0,ii.prototype.copy=function(t){return ei.prototype.copy.call(this,t),this.defines={PHYSICAL:""},this.reflectivity=t.reflectivity,this.clearCoat=t.clearCoat,this.clearCoatRoughness=t.clearCoatRoughness,this},((ni.prototype=Object.create(N.prototype)).constructor=ni).prototype.isMeshPhongMaterial=!0,ni.prototype.copy=function(t){return N.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((ri.prototype=Object.create(ni.prototype)).constructor=ri).prototype.isMeshToonMaterial=!0,ri.prototype.copy=function(t){return ni.prototype.copy.call(this,t),this.gradientMap=t.gradientMap,this},((ai.prototype=Object.create(N.prototype)).constructor=ai).prototype.isMeshNormalMaterial=!0,ai.prototype.copy=function(t){return N.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((oi.prototype=Object.create(N.prototype)).constructor=oi).prototype.isMeshLambertMaterial=!0,oi.prototype.copy=function(t){return N.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((si.prototype=Object.create(N.prototype)).constructor=si).prototype.isLineDashedMaterial=!0,si.prototype.copy=function(t){return N.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var bo=Object.freeze({ShadowMaterial:Ke,SpriteMaterial:Mt,RawShaderMaterial:$e,ShaderMaterial:Ft,PointsMaterial:se,MultiMaterial:ti,MeshPhysicalMaterial:ii,MeshStandardMaterial:ei,MeshPhongMaterial:ni,MeshToonMaterial:ri,MeshNormalMaterial:ai,MeshLambertMaterial:oi,MeshDepthMaterial:G,MeshBasicMaterial:Ht,LineDashedMaterial:si,LineBasicMaterial:Rt,Material:N}),wo={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}},Mo=new ci;Object.assign(hi.prototype,{load:function(i,n,e,r){void 0===i&&(i=""),void 0!==this.path&&(i=this.path+i);var a=this,t=wo.get(i);if(void 0!==t)return a.manager.itemStart(i),setTimeout(function(){n&&n(t),a.manager.itemEnd(i)},0),t;if(c=i.match(/^data:(.*?)(;base64)?,(.*)$/)){var o=c[1],s=!!c[2],c=c[3];c=window.decodeURIComponent(c);s&&(c=window.atob(c));try{var h,l=(this.responseType||"").toLowerCase();switch(l){case"arraybuffer":case"blob":h=new ArrayBuffer(c.length);var u=new Uint8Array(h);for(s=0;s<c.length;s++)u[s]=c.charCodeAt(s);"blob"===l&&(h=new Blob([h],{type:o}));break;case"document":h=(new DOMParser).parseFromString(c,o);break;case"json":h=JSON.parse(c);break;default:h=c}window.setTimeout(function(){n&&n(h),a.manager.itemEnd(i)},0)}catch(t){window.setTimeout(function(){r&&r(t),a.manager.itemError(i)},0)}}else{var d=new XMLHttpRequest;d.open("GET",i,!0),d.addEventListener("load",function(t){var e=t.target.response;wo.add(i,e),200===this.status?(n&&n(e),a.manager.itemEnd(i)):0===this.status?(console.warn("THREE.FileLoader: HTTP Status 0 received."),n&&n(e),a.manager.itemEnd(i)):(r&&r(t),a.manager.itemError(i))},!1),void 0!==e&&d.addEventListener("progress",function(t){e(t)},!1),d.addEventListener("error",function(t){r&&r(t),a.manager.itemError(i)},!1),void 0!==this.responseType&&(d.responseType=this.responseType),void 0!==this.withCredentials&&(d.withCredentials=this.withCredentials),d.overrideMimeType&&d.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),d.send(null)}return a.manager.itemStart(i),d},setPath:function(t){return this.path=t,this},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this}}),Object.assign(li.prototype,{load:function(t,r,i,n){function e(e){c.load(t[e],function(t){t=a._parser(t,!0),o[e]={width:t.width,height:t.height,format:t.format,mipmaps:t.mipmaps},6===(h+=1)&&(1===t.mipmapCount&&(s.minFilter=1006),s.format=t.format,s.needsUpdate=!0,r&&r(s))},i,n)}var a=this,o=[],s=new ue;s.image=o;var c=new hi(this.manager);if(c.setPath(this.path),c.setResponseType("arraybuffer"),Array.isArray(t))for(var h=0,l=0,u=t.length;l<u;++l)e(l);else c.load(t,function(t){if((t=a._parser(t,!0)).isCubemap)for(var e=t.mipmaps.length/t.mipmapCount,i=0;i<e;i++){o[i]={mipmaps:[]};for(var n=0;n<t.mipmapCount;n++)o[i].mipmaps.push(t.mipmaps[i*t.mipmapCount+n]),o[i].format=t.format,o[i].width=t.width,o[i].height=t.height}else s.image.width=t.width,s.image.height=t.height,s.mipmaps=t.mipmaps;1===t.mipmapCount&&(s.minFilter=1006),s.format=t.format,s.needsUpdate=!0,r&&r(s)},i,n);return s},setPath:function(t){return this.path=t,this}}),Object.assign(ui.prototype,{load:function(t,e,i,n){var r=this,a=new U,o=new hi(this.manager);return o.setResponseType("arraybuffer"),o.load(t,function(t){(t=r._parser(t))&&(void 0!==t.image?a.image=t.image:void 0!==t.data&&(a.image.width=t.width,a.image.height=t.height,a.image.data=t.data),a.wrapS=void 0!==t.wrapS?t.wrapS:1001,a.wrapT=void 0!==t.wrapT?t.wrapT:1001,a.magFilter=void 0!==t.magFilter?t.magFilter:1006,a.minFilter=void 0!==t.minFilter?t.minFilter:1008,a.anisotropy=void 0!==t.anisotropy?t.anisotropy:1,void 0!==t.format&&(a.format=t.format),void 0!==t.type&&(a.type=t.type),void 0!==t.mipmaps&&(a.mipmaps=t.mipmaps),1===t.mipmapCount&&(a.minFilter=1006),a.needsUpdate=!0,e&&e(a,t))},i,n),a}}),Object.assign(di.prototype,{load:function(t,e,i,n){var r=this,a=document.createElementNS("http://www.w3.org/1999/xhtml","img");if(a.onload=function(){a.onload=null,URL.revokeObjectURL(a.src),e&&e(a),r.manager.itemEnd(t)},a.onerror=n,0===t.indexOf("data:"))a.src=t;else if(void 0!==this.crossOrigin)a.crossOrigin=this.crossOrigin,a.src=t;else{var o=new hi;o.setPath(this.path),o.setResponseType("blob"),o.setWithCredentials(this.withCredentials),o.load(t,function(t){a.src=URL.createObjectURL(t)},i,n)}return r.manager.itemStart(t),a},setCrossOrigin:function(t){return this.crossOrigin=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(pi.prototype,{load:function(t,i,e,n){function r(e){o.load(t[e],function(t){a.images[e]=t,6===++s&&(a.needsUpdate=!0,i&&i(a))},void 0,n)}var a=new c,o=new di(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);var s=0;for(e=0;e<t.length;++e)r(e);return a},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(fi.prototype,{load:function(i,n,t,e){var r=new z,a=new di(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setWithCredentials(this.withCredentials),a.setPath(this.path),a.load(i,function(t){var e=0<i.search(/\.(jpg|jpeg)$/)||0===i.search(/^data\:image\/jpeg/);r.format=e?1022:1023,r.image=t,r.needsUpdate=!0,void 0!==n&&n(r)},t,e),r},setCrossOrigin:function(t){return this.crossOrigin=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setPath:function(t){return this.path=t,this}}),mi.prototype=Object.assign(Object.create(X.prototype),{constructor:mi,isLight:!0,copy:function(t){return X.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){return(t=X.prototype.toJSON.call(this,t)).object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}),gi.prototype=Object.assign(Object.create(mi.prototype),{constructor:gi,isHemisphereLight:!0,copy:function(t){return mi.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(vi.prototype,{copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t={};return 0!==this.bias&&(t.bias=this.bias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}),yi.prototype=Object.assign(Object.create(vi.prototype),{constructor:yi,isSpotLightShadow:!0,update:function(t){var e=2*er.RAD2DEG*t.angle,i=this.mapSize.width/this.mapSize.height;t=t.distance||500;var n=this.camera;e===n.fov&&i===n.aspect&&t===n.far||(n.fov=e,n.aspect=i,n.far=t,n.updateProjectionMatrix())}}),xi.prototype=Object.assign(Object.create(mi.prototype),{constructor:xi,isSpotLight:!0,copy:function(t){return mi.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),_i.prototype=Object.assign(Object.create(mi.prototype),{constructor:_i,isPointLight:!0,copy:function(t){return mi.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),bi.prototype=Object.assign(Object.create(vi.prototype),{constructor:bi}),wi.prototype=Object.assign(Object.create(mi.prototype),{constructor:wi,isDirectionalLight:!0,copy:function(t){return mi.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Mi.prototype=Object.assign(Object.create(mi.prototype),{constructor:Mi,isAmbientLight:!0});var Eo,To,So,Ao,Lo,Ro={arraySlice:function(t,e,i){return Ro.isTypedArray(t)?new t.constructor(t.subarray(e,i)):t.slice(e,i)},convertArray:function(t,e,i){return!t||!i&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(i){for(var t=i.length,e=Array(t),n=0;n!==t;++n)e[n]=n;return e.sort(function(t,e){return i[t]-i[e]}),e},sortedArray:function(t,e,i){for(var n=t.length,r=new t.constructor(n),a=0,o=0;o!==n;++a)for(var s=i[a]*e,c=0;c!==e;++c)r[o++]=t[s+c];return r},flattenJSON:function(t,e,i,n){for(var r=1,a=t[0];void 0!==a&&void 0===a[n];)a=t[r++];if(void 0!==a){var o=a[n];if(void 0!==o)if(Array.isArray(o))for(;void 0!==(o=a[n])&&(e.push(a.time),i.push.apply(i,o)),void 0!==(a=t[r++]););else if(void 0!==o.toArray)for(;void 0!==(o=a[n])&&(e.push(a.time),o.toArray(i,i.length)),void 0!==(a=t[r++]););else for(;void 0!==(o=a[n])&&(e.push(a.time),i.push(o)),void 0!==(a=t[r++]););}}};Ei.prototype={constructor:Ei,evaluate:function(t){var e=this.parameterPositions,i=this._cachedIndex,n=e[i],r=e[i-1];t:{e:{i:{n:if(!(t<n)){for(var a=i+2;;){if(void 0===n){if(t<r)break n;return this._cachedIndex=i=e.length,this.afterEnd_(i-1,t,r)}if(i===a)break;if(r=n,t<(n=e[++i]))break e}n=e.length;break i}if(r<=t)break t;for(t<(a=e[1])&&(i=2,r=a),a=i-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,t,n);if(i===a)break;if(n=r,(r=e[--i-1])<=t)break e}n=i,i=0}for(;i<n;)t<e[r=i+n>>>1]?n=r:i=r+1;if(n=e[i],void 0===(r=e[i-1]))return this._cachedIndex=0,this.beforeStart_(0,t,n);if(void 0===n)return this._cachedIndex=i=e.length,this.afterEnd_(i-1,r,t)}this._cachedIndex=i,this.intervalChanged_(i,r,n)}return this.interpolate_(i,r,t,n)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){var e=this.resultBuffer,i=this.sampleValues,n=this.valueSize;t*=n;for(var r=0;r!==n;++r)e[r]=i[t+r];return e},interpolate_:function(t,e,i,n){throw Error("call to abstract method")},intervalChanged_:function(t,e,i){}},Object.assign(Ei.prototype,{beforeStart_:Ei.prototype.copySampleValue_,afterEnd_:Ei.prototype.copySampleValue_}),Ti.prototype=Object.assign(Object.create(Ei.prototype),{constructor:Ti,DefaultSettings_:{endingStart:2400,endingEnd:2400},intervalChanged_:function(t,e,i){var n=this.parameterPositions,r=t-2,a=t+1,o=n[r],s=n[a];if(void 0===o)switch(this.getSettings_().endingStart){case 2401:r=t,o=2*e-i;break;case 2402:o=e+n[r=n.length-2]-n[r+1];break;default:r=t,o=i}if(void 0===s)switch(this.getSettings_().endingEnd){case 2401:a=t,s=2*i-e;break;case 2402:s=i+n[a=1]-n[0];break;default:a=t-1,s=e}t=.5*(i-e),n=this.valueSize,this._weightPrev=t/(e-o),this._weightNext=t/(s-i),this._offsetPrev=r*n,this._offsetNext=a*n},interpolate_:function(t,e,i,n){var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(t*=o)-o,c=this._offsetPrev,h=this._offsetNext,l=this._weightPrev,u=this._weightNext,d=(i-e)/(n-e);for(e=-l*(n=(i=d*d)*d)+2*l*i-l*d,l=(1+l)*n+(-1.5-2*l)*i+(-.5+l)*d+1,d=(-1-u)*n+(1.5+u)*i+.5*d,u=u*n-u*i,i=0;i!==o;++i)r[i]=e*a[c+i]+l*a[s+i]+d*a[t+i]+u*a[h+i];return r}}),Si.prototype=Object.assign(Object.create(Ei.prototype),{constructor:Si,interpolate_:function(t,e,i,n){var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(t*=o)-o;for(i=1-(e=(i-e)/(n-e)),n=0;n!==o;++n)r[n]=a[s+n]*i+a[t+n]*e;return r}}),Ai.prototype=Object.assign(Object.create(Ei.prototype),{constructor:Ai,interpolate_:function(t,e,i,n){return this.copySampleValue_(t-1)}}),Eo={TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(t){return new Ai(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new Si(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new Ti(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e;switch(t){case 2300:e=this.InterpolantFactoryMethodDiscrete;break;case 2301:e=this.InterpolantFactoryMethodLinear;break;case 2302:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){if(e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name,void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw Error(e);this.setInterpolation(this.DefaultInterpolation)}console.warn(e)}else this.createInterpolant=e},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var e=this.times,i=0,n=e.length;i!==n;++i)e[i]+=t;return this},scale:function(t){if(1!==t)for(var e=this.times,i=0,n=e.length;i!==n;++i)e[i]*=t;return this},trim:function(t,e){for(var i=this.times,n=i.length,r=0,a=n-1;r!==n&&i[r]<t;)++r;for(;-1!==a&&i[a]>e;)--a;return++a,0===r&&a===n||(a<=r&&(r=(a=Math.max(a,1))-1),n=this.getValueSize(),this.times=Ro.arraySlice(i,r,a),this.values=Ro.arraySlice(this.values,r*n,a*n)),this},validate:function(){var t=!0;0!=(i=this.getValueSize())-Math.floor(i)&&(console.error("invalid value size in track",this),t=!1);var e=this.times,i=this.values,n=e.length;0===n&&(console.error("track is empty",this),t=!1);for(var r=null,a=0;a!==n;a++){var o=e[a];if("number"==typeof o&&isNaN(o)){console.error("time is not a valid number",this,a,o),t=!1;break}if(null!==r&&o<r){console.error("out of order keys",this,a,o,r),t=!1;break}r=o}if(void 0!==i&&Ro.isTypedArray(i))for(a=0,e=i.length;a!==e;++a)if(n=i[a],isNaN(n)){console.error("value is not a valid number",this,a,n),t=!1;break}return t},optimize:function(){for(var t=this.times,e=this.values,i=this.getValueSize(),n=2302===this.getInterpolation(),r=1,a=t.length-1,o=1;o<a;++o){var s=!1;if((u=t[o])!==t[o+1]&&(1!==o||u!==u[0]))if(n)s=!0;else for(var c=o*i,h=c-i,l=c+i,u=0;u!==i;++u){var d=e[c+u];if(d!==e[h+u]||d!==e[l+u]){s=!0;break}}if(s){if(o!==r)for(t[r]=t[o],s=o*i,c=r*i,u=0;u!==i;++u)e[c+u]=e[s+u];++r}}if(0<a){for(t[r]=t[a],s=a*i,c=r*i,u=0;u!==i;++u)e[c+u]=e[s+u];++r}return r!==t.length&&(this.times=Ro.arraySlice(t,0,r),this.values=Ro.arraySlice(e,0,r*i)),this}},Ri.prototype=Object.assign(Object.create(Eo),{constructor:Ri,ValueTypeName:"vector"}),Pi.prototype=Object.assign(Object.create(Ei.prototype),{constructor:Pi,interpolate_:function(t,e,i,n){var r=this.resultBuffer,a=this.sampleValues,o=this.valueSize;for(e=(i-e)/(n-e),i=(t*=o)+o;t!==i;t+=4)s.slerpFlat(r,0,a,t-o,a,t,e);return r}}),Ci.prototype=Object.assign(Object.create(Eo),{constructor:Ci,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(t){return new Pi(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),Ii.prototype=Object.assign(Object.create(Eo),{constructor:Ii,ValueTypeName:"number"}),Ui.prototype=Object.assign(Object.create(Eo),{constructor:Ui,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Ni.prototype=Object.assign(Object.create(Eo),{constructor:Ni,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Di.prototype=Object.assign(Object.create(Eo),{constructor:Di,ValueTypeName:"color"}),(Oi.prototype=Eo).constructor=Oi,Object.assign(Oi,{parse:function(t){if(void 0===t.type)throw Error("track type undefined, can not parse");var e=Oi._getTrackTypeForValueTypeName(t.type);if(void 0===t.times){var i=[],n=[];Ro.flattenJSON(t.keys,i,n,"value"),t.times=i,t.values=n}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)},toJSON:function(t){if(void 0!==(e=t.constructor).toJSON)e=e.toJSON(t);else{var e={name:t.name,times:Ro.convertArray(t.times,Array),values:Ro.convertArray(t.values,Array)},i=t.getInterpolation();i!==t.DefaultInterpolation&&(e.interpolation=i)}return e.type=t.ValueTypeName,e},_getTrackTypeForValueTypeName:function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Ii;case"vector":case"vector2":case"vector3":case"vector4":return Ri;case"color":return Di;case"quaternion":return Ci;case"bool":case"boolean":return Ni;case"string":return Ui}throw Error("Unsupported typeName: "+t)}}),Fi.prototype={constructor:Fi,resetDuration:function(){for(var t=0,e=0,i=this.tracks.length;e!==i;++e){var n=this.tracks[e];t=Math.max(t,n.times[n.times.length-1])}this.duration=t},trim:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}},Object.assign(Fi,{parse:function(t){for(var e=[],i=t.tracks,n=1/(t.fps||1),r=0,a=i.length;r!==a;++r)e.push(Oi.parse(i[r]).scale(n));return new Fi(t.name,t.duration,e)},toJSON:function(t){var e=[],i=t.tracks;t={name:t.name,duration:t.duration,tracks:e};for(var n=0,r=i.length;n!==r;++n)e.push(Oi.toJSON(i[n]));return t},CreateFromMorphTargetSequence:function(t,e,i,n){for(var r=e.length,a=[],o=0;o<r;o++){var s=[];(h=[]).push((o+r-1)%r,o,(o+1)%r),s.push(0,1,0);var c=Ro.getKeyframeOrder(h),h=Ro.sortedArray(h,1,c);s=Ro.sortedArray(s,1,c);n||0!==h[0]||(h.push(r),s.push(s[0])),a.push(new Ii(".morphTargetInfluences["+e[o].name+"]",h,s).scale(1/i))}return new Fi(t,-1,a)},findByName:function(t,e){var i=t;Array.isArray(t)||(i=t.geometry&&t.geometry.animations||t.animations);for(var n=0;n<i.length;n++)if(i[n].name===e)return i[n];return null},CreateClipsFromMorphTargetSequences:function(t,e,i){for(var n={},r=/^([\w-]*?)([\d]+)$/,a=0,o=t.length;a<o;a++){var s=t[a],c=s.name.match(r);if(c&&1<c.length){var h=c[1];(c=n[h])||(n[h]=c=[]),c.push(s)}}for(h in t=[],n)t.push(Fi.CreateFromMorphTargetSequence(h,n[h],e,i));return t},parseAnimation:function(t,e){if(!t)return console.error(" no animation in JSONLoader data"),null;for(var i=function(t,e,i,n,r){if(0!==i.length){var a=[],o=[];Ro.flattenJSON(i,a,o,n),0!==a.length&&r.push(new t(e,a,o))}},n=[],r=t.name||"default",a=t.length||-1,o=t.fps||30,s=t.hierarchy||[],c=0;c<s.length;c++){var h=s[c].keys;if(h&&0!==h.length)if(h[0].morphTargets){a={};for(var l=0;l<h.length;l++)if(h[l].morphTargets)for(var u=0;u<h[l].morphTargets.length;u++)a[h[l].morphTargets[u]]=-1;for(var d in a){var p=[],f=[];for(u=0;u!==h[l].morphTargets.length;++u){var m=h[l];p.push(m.time),f.push(m.morphTarget===d?1:0)}n.push(new Ii(".morphTargetInfluence["+d+"]",p,f))}a=a.length*(o||1)}else i(Ri,(l=".bones["+e[c].name+"]")+".position",h,"pos",n),i(Ci,l+".quaternion",h,"rot",n),i(Ri,l+".scale",h,"scl",n)}return 0===n.length?null:new Fi(r,a,n)}}),Object.assign(zi.prototype,{load:function(t,e,i,n){var r=this;new hi(r.manager).load(t,function(t){e(r.parse(JSON.parse(t)))},i,n)},setTextures:function(t){this.textures=t},parse:function(t){function e(t){return void 0===i[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),i[t]}var i=this.textures,n=new bo[t.type];if(void 0!==t.uuid&&(n.uuid=t.uuid),void 0!==t.name&&(n.name=t.name),void 0!==t.color&&n.color.setHex(t.color),void 0!==t.roughness&&(n.roughness=t.roughness),void 0!==t.metalness&&(n.metalness=t.metalness),void 0!==t.emissive&&n.emissive.setHex(t.emissive),void 0!==t.specular&&n.specular.setHex(t.specular),void 0!==t.shininess&&(n.shininess=t.shininess),void 0!==t.clearCoat&&(n.clearCoat=t.clearCoat),void 0!==t.clearCoatRoughness&&(n.clearCoatRoughness=t.clearCoatRoughness),void 0!==t.uniforms&&(n.uniforms=t.uniforms),void 0!==t.vertexShader&&(n.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(n.fragmentShader=t.fragmentShader),void 0!==t.vertexColors&&(n.vertexColors=t.vertexColors),void 0!==t.fog&&(n.fog=t.fog),void 0!==t.shading&&(n.shading=t.shading),void 0!==t.blending&&(n.blending=t.blending),void 0!==t.side&&(n.side=t.side),void 0!==t.opacity&&(n.opacity=t.opacity),void 0!==t.transparent&&(n.transparent=t.transparent),void 0!==t.alphaTest&&(n.alphaTest=t.alphaTest),void 0!==t.depthTest&&(n.depthTest=t.depthTest),void 0!==t.depthWrite&&(n.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(n.colorWrite=t.colorWrite),void 0!==t.wireframe&&(n.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(n.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(n.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(n.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.skinning&&(n.skinning=t.skinning),void 0!==t.morphTargets&&(n.morphTargets=t.morphTargets),void 0!==t.size&&(n.size=t.size),void 0!==t.sizeAttenuation&&(n.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(n.map=e(t.map)),void 0!==t.alphaMap&&(n.alphaMap=e(t.alphaMap),n.transparent=!0),void 0!==t.bumpMap&&(n.bumpMap=e(t.bumpMap)),void 0!==t.bumpScale&&(n.bumpScale=t.bumpScale),void 0!==t.normalMap&&(n.normalMap=e(t.normalMap)),void 0!==t.normalScale){var r=t.normalScale;!1===Array.isArray(r)&&(r=[r,r]),n.normalScale=(new V).fromArray(r)}if(void 0!==t.displacementMap&&(n.displacementMap=e(t.displacementMap)),void 0!==t.displacementScale&&(n.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(n.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(n.roughnessMap=e(t.roughnessMap)),void 0!==t.metalnessMap&&(n.metalnessMap=e(t.metalnessMap)),void 0!==t.emissiveMap&&(n.emissiveMap=e(t.emissiveMap)),void 0!==t.emissiveIntensity&&(n.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(n.specularMap=e(t.specularMap)),void 0!==t.envMap&&(n.envMap=e(t.envMap)),void 0!==t.reflectivity&&(n.reflectivity=t.reflectivity),void 0!==t.lightMap&&(n.lightMap=e(t.lightMap)),void 0!==t.lightMapIntensity&&(n.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(n.aoMap=e(t.aoMap)),void 0!==t.aoMapIntensity&&(n.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(n.gradientMap=e(t.gradientMap)),void 0!==t.materials){r=0;for(var a=t.materials.length;r<a;r++)n.materials.push(this.parse(t.materials[r]))}return n}}),Object.assign(Bi.prototype,{load:function(t,e,i,n){var r=this;new hi(r.manager).load(t,function(t){e(r.parse(JSON.parse(t)))},i,n)},parse:function(t){var e=new Vt,i=t.data.index,n={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};void 0!==i&&(i=new n[i.type](i.array),e.setIndex(new J(i,1)));var r,a=t.data.attributes;for(r in a){var o=a[r];i=new n[o.type](o.array);e.addAttribute(r,new J(i,o.itemSize,o.normalized))}if(void 0!==(n=t.data.groups||t.data.drawcalls||t.data.offsets))for(r=0,i=n.length;r!==i;++r)a=n[r],e.addGroup(a.start,a.count,a.materialIndex);return void 0!==(t=t.data.boundingSphere)&&(n=new Ct,void 0!==t.center&&n.fromArray(t.center),e.boundingSphere=new zt(n,t.radius)),e}}),Gi.prototype={constructor:Gi,crossOrigin:void 0,extractUrlBase:function(t){return 1===(t=t.split("/")).length?"./":(t.pop(),t.join("/")+"/")},initMaterials:function(t,e,i){for(var n=[],r=0;r<t.length;++r)n[r]=this.createMaterial(t[r],e,i);return n},createMaterial:function(t,o,s){function e(t,e,i,n,r){t=o+t;var a=Gi.Handlers.get(t);return t=null!==a?a.load(t):(So.setCrossOrigin(s),So.load(t)),void 0!==e&&(t.repeat.fromArray(e),1!==e[0]&&(t.wrapS=1e3),1!==e[1]&&(t.wrapT=1e3)),void 0!==i&&t.offset.fromArray(i),void 0!==n&&("repeat"===n[0]&&(t.wrapS=1e3),"mirror"===n[0]&&(t.wrapS=1002),"repeat"===n[1]&&(t.wrapT=1e3),"mirror"===n[1]&&(t.wrapT=1002)),void 0!==r&&(t.anisotropy=r),e=er.generateUUID(),c[e]=t,e}void 0===To&&(To=new Nt),void 0===So&&(So=new fi),void 0===Ao&&(Ao=new zi);var i,c={},n={uuid:er.generateUUID(),type:"MeshLambertMaterial"};for(i in t){var r=t[i];switch(i){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":n.name=r;break;case"blending":n.blending=Qn[r];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",i,"is no longer supported.");break;case"colorDiffuse":n.color=To.fromArray(r).getHex();break;case"colorSpecular":n.specular=To.fromArray(r).getHex();break;case"colorEmissive":n.emissive=To.fromArray(r).getHex();break;case"specularCoef":n.shininess=r;break;case"shading":"basic"===r.toLowerCase()&&(n.type="MeshBasicMaterial"),"phong"===r.toLowerCase()&&(n.type="MeshPhongMaterial"),"standard"===r.toLowerCase()&&(n.type="MeshStandardMaterial");break;case"mapDiffuse":n.map=e(r,t.mapDiffuseRepeat,t.mapDiffuseOffset,t.mapDiffuseWrap,t.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":n.emissiveMap=e(r,t.mapEmissiveRepeat,t.mapEmissiveOffset,t.mapEmissiveWrap,t.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":n.lightMap=e(r,t.mapLightRepeat,t.mapLightOffset,t.mapLightWrap,t.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":n.aoMap=e(r,t.mapAORepeat,t.mapAOOffset,t.mapAOWrap,t.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":n.bumpMap=e(r,t.mapBumpRepeat,t.mapBumpOffset,t.mapBumpWrap,t.mapBumpAnisotropy);break;case"mapBumpScale":n.bumpScale=r;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":n.normalMap=e(r,t.mapNormalRepeat,t.mapNormalOffset,t.mapNormalWrap,t.mapNormalAnisotropy);break;case"mapNormalFactor":n.normalScale=[r,r];break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":n.specularMap=e(r,t.mapSpecularRepeat,t.mapSpecularOffset,t.mapSpecularWrap,t.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":n.metalnessMap=e(r,t.mapMetalnessRepeat,t.mapMetalnessOffset,t.mapMetalnessWrap,t.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":n.roughnessMap=e(r,t.mapRoughnessRepeat,t.mapRoughnessOffset,t.mapRoughnessWrap,t.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":n.alphaMap=e(r,t.mapAlphaRepeat,t.mapAlphaOffset,t.mapAlphaWrap,t.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":n.side=1;break;case"doubleSided":n.side=2;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),n.opacity=r;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":n[i]=r;break;case"vertexColors":!0===r&&(n.vertexColors=2),"face"===r&&(n.vertexColors=1);break;default:console.error("THREE.Loader.createMaterial: Unsupported",i,r)}}return"MeshBasicMaterial"===n.type&&delete n.emissive,"MeshPhongMaterial"!==n.type&&delete n.specular,n.opacity<1&&(n.transparent=!0),Ao.setTextures(c),Ao.parse(n)}},Gi.Handlers={handlers:[],add:function(t,e){this.handlers.push(t,e)},get:function(t){for(var e=this.handlers,i=0,n=e.length;i<n;i+=2){var r=e[i+1];if(e[i].test(t))return r}return null}},Object.assign(Hi.prototype,{load:function(i,n,t,e){var r=this,a=this.texturePath&&"string"==typeof this.texturePath?this.texturePath:Gi.prototype.extractUrlBase(i),o=new hi(this.manager);o.setWithCredentials(this.withCredentials),o.load(i,function(t){var e=(t=JSON.parse(t)).metadata;if(void 0!==e&&void 0!==(e=e.type)){if("object"===e.toLowerCase())return void console.error("THREE.JSONLoader: "+i+" should be loaded with THREE.ObjectLoader instead.");if("scene"===e.toLowerCase())return void console.error("THREE.JSONLoader: "+i+" should be loaded with THREE.SceneLoader instead.")}t=r.parse(t,a),n(t.geometry,t.materials)},t,e)},setTexturePath:function(t){this.texturePath=t},parse:function(y,t){var x=new st,e=void 0!==y.scale?1/y.scale:1;return function(t){var e,i,n,r,a,o,s,c,h,l,u,d,p,f=y.faces;o=y.vertices;var m=y.normals,g=y.colors,v=0;if(void 0!==y.uvs){for(e=0;e<y.uvs.length;e++)y.uvs[e].length&&v++;for(e=0;e<v;e++)x.faceVertexUvs[e]=[]}for(r=0,a=o.length;r<a;)(e=new Ct).x=o[r++]*t,e.y=o[r++]*t,e.z=o[r++]*t,x.vertices.push(e);for(r=0,a=f.length;r<a;)if(h=1&(t=f[r++]),n=2&t,e=8&t,s=16&t,l=32&t,o=64&t,t&=128,h){if((h=new Z).a=f[r],h.b=f[r+1],h.c=f[r+3],(u=new Z).a=f[r+1],u.b=f[r+2],u.c=f[r+3],r+=4,n&&(n=f[r++],h.materialIndex=n,u.materialIndex=n),n=x.faces.length,e)for(e=0;e<v;e++)for(d=y.uvs[e],x.faceVertexUvs[e][n]=[],x.faceVertexUvs[e][n+1]=[],i=0;i<4;i++)p=new V(p=d[2*(c=f[r++])],c=d[2*c+1]),2!==i&&x.faceVertexUvs[e][n].push(p),0!==i&&x.faceVertexUvs[e][n+1].push(p);if(s&&(s=3*f[r++],h.normal.set(m[s++],m[s++],m[s]),u.normal.copy(h.normal)),l)for(e=0;e<4;e++)s=3*f[r++],l=new Ct(m[s++],m[s++],m[s]),2!==e&&h.vertexNormals.push(l),0!==e&&u.vertexNormals.push(l);if(o&&(o=g[o=f[r++]],h.color.setHex(o),u.color.setHex(o)),t)for(e=0;e<4;e++)o=g[o=f[r++]],2!==e&&h.vertexColors.push(new Nt(o)),0!==e&&u.vertexColors.push(new Nt(o));x.faces.push(h),x.faces.push(u)}else{if((h=new Z).a=f[r++],h.b=f[r++],h.c=f[r++],n&&(n=f[r++],h.materialIndex=n),n=x.faces.length,e)for(e=0;e<v;e++)for(d=y.uvs[e],x.faceVertexUvs[e][n]=[],i=0;i<3;i++)p=new V(p=d[2*(c=f[r++])],c=d[2*c+1]),x.faceVertexUvs[e][n].push(p);if(s&&(s=3*f[r++],h.normal.set(m[s++],m[s++],m[s])),l)for(e=0;e<3;e++)s=3*f[r++],l=new Ct(m[s++],m[s++],m[s]),h.vertexNormals.push(l);if(o&&(o=f[r++],h.color.setHex(g[o])),t)for(e=0;e<3;e++)o=f[r++],h.vertexColors.push(new Nt(g[o]));x.faces.push(h)}}(e),function(){var t=void 0!==y.influencesPerVertex?y.influencesPerVertex:2;if(y.skinWeights)for(var e=0,i=y.skinWeights.length;e<i;e+=t)x.skinWeights.push(new Pt(y.skinWeights[e],1<t?y.skinWeights[e+1]:0,2<t?y.skinWeights[e+2]:0,3<t?y.skinWeights[e+3]:0));if(y.skinIndices)for(e=0,i=y.skinIndices.length;e<i;e+=t)x.skinIndices.push(new Pt(y.skinIndices[e],1<t?y.skinIndices[e+1]:0,2<t?y.skinIndices[e+2]:0,3<t?y.skinIndices[e+3]:0));x.bones=y.bones,x.bones&&0<x.bones.length&&(x.skinWeights.length!==x.skinIndices.length||x.skinIndices.length!==x.vertices.length)&&console.warn("When skinning, number of vertices ("+x.vertices.length+"), skinIndices ("+x.skinIndices.length+"), and skinWeights ("+x.skinWeights.length+") should match.")}(),function(t){if(void 0!==y.morphTargets)for(var e=0,i=y.morphTargets.length;e<i;e++){x.morphTargets[e]={},x.morphTargets[e].name=y.morphTargets[e].name,x.morphTargets[e].vertices=[];for(var n=x.morphTargets[e].vertices,r=y.morphTargets[e].vertices,a=0,o=r.length;a<o;a+=3){var s=new Ct;s.x=r[a]*t,s.y=r[a+1]*t,s.z=r[a+2]*t,n.push(s)}}if(void 0!==y.morphColors&&0<y.morphColors.length)for(console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.'),t=x.faces,n=y.morphColors[0].colors,e=0,i=t.length;e<i;e++)t[e].color.fromArray(n,3*e)}(e),function(){var t=[],e=[];void 0!==y.animation&&e.push(y.animation),void 0!==y.animations&&(y.animations.length?e=e.concat(y.animations):e.push(y.animations));for(var i=0;i<e.length;i++){var n=Fi.parseAnimation(e[i],x.bones);n&&t.push(n)}x.morphTargets&&(e=Fi.CreateClipsFromMorphTargetSequences(x.morphTargets,10),t=t.concat(e)),0<t.length&&(x.animations=t)}(),x.computeFaceNormals(),x.computeBoundingSphere(),void 0===y.materials||0===y.materials.length?{geometry:x}:(e=Gi.prototype.initMaterials(y.materials,t,this.crossOrigin),{geometry:x,materials:e})}}),Object.assign(Vi.prototype,{load:function(i,n,t,e){""===this.texturePath&&(this.texturePath=i.substring(0,i.lastIndexOf("/")+1));var r=this;new hi(r.manager).load(i,function(t){var e=null;try{e=JSON.parse(t)}catch(t){return void console.error("THREE:ObjectLoader: Can't parse "+i+".",t.message)}void 0===(t=e.metadata)||void 0===t.type||"geometry"===t.type.toLowerCase()?console.error("THREE.ObjectLoader: Can't load "+i+". Use THREE.JSONLoader instead."):r.parse(e,n)},t,e)},setTexturePath:function(t){this.texturePath=t},setCrossOrigin:function(t){this.crossOrigin=t},parse:function(t,e){var i=this.parseGeometries(t.geometries),n=this.parseImages(t.images,function(){void 0!==e&&e(r)}),r=(n=this.parseTextures(t.textures,n),n=this.parseMaterials(t.materials,n),this.parseObject(t.object,i,n));return t.animations&&(r.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0===e||e(r),r},parseGeometries:function(t){var e={};if(void 0!==t)for(var i=new Hi,n=new Bi,r=0,a=t.length;r<a;r++){var o,s=t[r];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new _o[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":o=new _o[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":o=new _o[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":o=new _o[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":o=new _o[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":o=new _o[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"IcosahedronGeometry":case"OctahedronGeometry":case"TetrahedronGeometry":o=new _o[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":o=new _o[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":o=new _o[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":o=new _o[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"LatheGeometry":case"LatheBufferGeometry":o=new _o[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"BufferGeometry":o=n.parse(s);break;case"Geometry":o=i.parse(s.data,this.texturePath).geometry;break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),e[s.uuid]=o}return e},parseMaterials:function(t,e){var i={};if(void 0!==t){var n=new zi;n.setTextures(e);for(var r=0,a=t.length;r<a;r++){var o=n.parse(t[r]);i[o.uuid]=o}}return i},parseAnimations:function(t){for(var e=[],i=0;i<t.length;i++){var n=Fi.parse(t[i]);e.push(n)}return e},parseImages:function(t,e){function i(t){return n.manager.itemStart(t),a.load(t,function(){n.manager.itemEnd(t)},void 0,function(){n.manager.itemError(t)})}var n=this,r={};if(void 0!==t&&0<t.length){var a=new di(o=new ci(e));a.setCrossOrigin(this.crossOrigin);for(var o=0,s=t.length;o<s;o++){var c=t[o],h=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url)?c.url:n.texturePath+c.url;r[c.uuid]=i(h)}}return r},parseTextures:function(t,e){function i(t,e){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}var n={};if(void 0!==t)for(var r=0,a=t.length;r<a;r++){var o=t[r];void 0===o.image&&console.warn('THREE.ObjectLoader: No "image" specified for',o.uuid),void 0===e[o.image]&&console.warn("THREE.ObjectLoader: Undefined image",o.image);var s=new z(e[o.image]);s.needsUpdate=!0,s.uuid=o.uuid,void 0!==o.name&&(s.name=o.name),void 0!==o.mapping&&(s.mapping=i(o.mapping,Kn)),void 0!==o.offset&&s.offset.fromArray(o.offset),void 0!==o.repeat&&s.repeat.fromArray(o.repeat),void 0!==o.wrap&&(s.wrapS=i(o.wrap[0],$n),s.wrapT=i(o.wrap[1],$n)),void 0!==o.minFilter&&(s.minFilter=i(o.minFilter,tr)),void 0!==o.magFilter&&(s.magFilter=i(o.magFilter,tr)),void 0!==o.anisotropy&&(s.anisotropy=o.anisotropy),void 0!==o.flipY&&(s.flipY=o.flipY),n[o.uuid]=s}return n},parseObject:(Lo=new It,function(t,e,i){function n(t){return void 0===e[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]}function r(t){if(void 0!==t)return void 0===i[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),i[t]}var a;switch(t.type){case"Scene":a=new bt,void 0!==t.background&&Number.isInteger(t.background)&&(a.background=new Nt(t.background)),void 0!==t.fog&&("Fog"===t.fog.type?a.fog=new _t(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(a.fog=new xt(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":a=new Xt(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(a.focus=t.focus),void 0!==t.zoom&&(a.zoom=t.zoom),void 0!==t.filmGauge&&(a.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(a.filmOffset=t.filmOffset),void 0!==t.view&&(a.view=Object.assign({},t.view));break;case"OrthographicCamera":a=new Yt(t.left,t.right,t.top,t.bottom,t.near,t.far);break;case"AmbientLight":a=new Mi(t.color,t.intensity);break;case"DirectionalLight":a=new wi(t.color,t.intensity);break;case"PointLight":a=new _i(t.color,t.intensity,t.distance,t.decay);break;case"SpotLight":a=new xi(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":a=new gi(t.color,t.groundColor,t.intensity);break;case"Mesh":a=n(t.geometry);var o=r(t.material);a=a.bones&&0<a.bones.length?new Lt(a,o):new kt(a,o);break;case"LOD":a=new Tt;break;case"Line":a=new ae(n(t.geometry),r(t.material),t.mode);break;case"LineSegments":a=new oe(n(t.geometry),r(t.material));break;case"PointCloud":case"Points":a=new ce(n(t.geometry),r(t.material));break;case"Sprite":a=new Et(r(t.material));break;case"Group":a=new he;break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh type. Instantiates Object3D instead.");default:a=new X}if(a.uuid=t.uuid,void 0!==t.name&&(a.name=t.name),void 0!==t.matrix?(Lo.fromArray(t.matrix),Lo.decompose(a.position,a.quaternion,a.scale)):(void 0!==t.position&&a.position.fromArray(t.position),void 0!==t.rotation&&a.rotation.fromArray(t.rotation),void 0!==t.quaternion&&a.quaternion.fromArray(t.quaternion),void 0!==t.scale&&a.scale.fromArray(t.scale)),void 0!==t.castShadow&&(a.castShadow=t.castShadow),void 0!==t.receiveShadow&&(a.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(a.shadow.bias=t.shadow.bias),void 0!==t.shadow.radius&&(a.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&a.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(a.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(a.visible=t.visible),void 0!==t.userData&&(a.userData=t.userData),void 0!==t.children)for(var s in t.children)a.add(this.parseObject(t.children[s],e,i));if("LOD"===t.type)for(t=t.levels,o=0;o<t.length;o++){var c=t[o];void 0!==(s=a.getObjectByProperty("uuid",c.object))&&a.addLevel(s,c.distance)}return a})}),ki.prototype={constructor:ki,getPoint:function(t){return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),null},getPointAt:function(t){return t=this.getUtoTmapping(t),this.getPoint(t)},getPoints:function(t){t||(t=5);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},getSpacedPoints:function(t){t||(t=5);for(var e=[],i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(t||(t=this.__arcLengthDivisions?this.__arcLengthDivisions:200),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i,n=[],r=this.getPoint(0),a=0;for(n.push(0),i=1;i<=t;i++)a+=(e=this.getPoint(i/t)).distanceTo(r),n.push(a),r=e;return this.cacheArcLengths=n},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var i,n,r=this.getLengths(),a=r.length;n=e||t*r[a-1];for(var o,s=0,c=a-1;s<=c;)if((o=r[i=Math.floor(s+(c-s)/2)]-n)<0)s=i+1;else{if(!(0<o)){c=i;break}c=i-1}return r[i=c]===n?i/(a-1):(i+(n-(s=r[i]))/(r[i+1]-s))/(a-1)},getTangent:function(t){var e=t-1e-4;return e<0&&(e=0),1<(t+=1e-4)&&(t=1),e=this.getPoint(e),this.getPoint(t).clone().sub(e).normalize()},getTangentAt:function(t){return t=this.getUtoTmapping(t),this.getTangent(t)},computeFrenetFrames:function(t,e){var i,n,r=new Ct,a=[],o=[],s=[],c=new Ct,h=new It;for(i=0;i<=t;i++)n=i/t,a[i]=this.getTangentAt(n),a[i].normalize();o[0]=new Ct,s[0]=new Ct,i=Number.MAX_VALUE,n=Math.abs(a[0].x);var l=Math.abs(a[0].y),u=Math.abs(a[0].z);for(n<=i&&(i=n,r.set(1,0,0)),l<=i&&(i=l,r.set(0,1,0)),u<=i&&r.set(0,0,1),c.crossVectors(a[0],r).normalize(),o[0].crossVectors(a[0],c),s[0].crossVectors(a[0],o[0]),i=1;i<=t;i++)o[i]=o[i-1].clone(),s[i]=s[i-1].clone(),c.crossVectors(a[i-1],a[i]),c.length()>Number.EPSILON&&(c.normalize(),r=Math.acos(er.clamp(a[i-1].dot(a[i]),-1,1)),o[i].applyMatrix4(h.makeRotationAxis(c,r))),s[i].crossVectors(a[i],o[i]);if(!0===e)for(r=Math.acos(er.clamp(o[0].dot(o[t]),-1,1)),r/=t,0<a[0].dot(c.crossVectors(o[0],o[t]))&&(r=-r),i=1;i<=t;i++)o[i].applyMatrix4(h.makeRotationAxis(a[i],r*i)),s[i].crossVectors(a[i],o[i]);return{tangents:a,normals:o,binormals:s}}},ki.create=function(t,e){return t.prototype=Object.create(ki.prototype),(t.prototype.constructor=t).prototype.getPoint=e,t},((ji.prototype=Object.create(ki.prototype)).constructor=ji).prototype.isLineCurve=!0,ji.prototype.getPoint=function(t){if(1===t)return this.v2.clone();var e=this.v2.clone().sub(this.v1);return e.multiplyScalar(t).add(this.v1),e},ji.prototype.getPointAt=function(t){return this.getPoint(t)},ji.prototype.getTangent=function(t){return this.v2.clone().sub(this.v1).normalize()},Wi.prototype=Object.assign(Object.create(ki.prototype),{constructor:Wi,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new ji(e,t))},getPoint:function(t){var e=t*this.getLength(),i=this.getCurveLengths();for(t=0;t<i.length;){if(i[t]>=e)return e=i[t]-e,i=(t=this.curves[t]).getLength(),t.getPointAt(0===i?0:1-e/i);t++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,i=0,n=this.curves.length;i<n;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t},getSpacedPoints:function(t){t||(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getPoints:function(t){t=t||12;for(var e,i=[],n=0,r=this.curves;n<r.length;n++)for(var a=(a=r[n]).getPoints(a&&a.isEllipseCurve?2*t:a&&a.isLineCurve?1:a&&a.isSplineCurve?t*a.points.length:t),o=0;o<a.length;o++){var s=a[o];e&&e.equals(s)||(i.push(s),e=s)}return this.autoClose&&1<i.length&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},createPointsGeometry:function(t){return t=this.getPoints(t),this.createGeometry(t)},createSpacedPointsGeometry:function(t){return t=this.getSpacedPoints(t),this.createGeometry(t)},createGeometry:function(t){for(var e=new st,i=0,n=t.length;i<n;i++){var r=t[i];e.vertices.push(new Ct(r.x,r.y,r.z||0))}return e}}),((Xi.prototype=Object.create(ki.prototype)).constructor=Xi).prototype.isEllipseCurve=!0,Xi.prototype.getPoint=function(t){for(var e=2*Math.PI,i=this.aEndAngle-this.aStartAngle,n=Math.abs(i)<Number.EPSILON;i<0;)i+=e;for(;e<i;)i-=e;i<Number.EPSILON&&(i=n?0:e),!0!==this.aClockwise||n||(i=i===e?-e:i-e),e=this.aStartAngle+t*i,t=this.aX+this.xRadius*Math.cos(e);var r=this.aY+this.yRadius*Math.sin(e);return 0!==this.aRotation&&(e=Math.cos(this.aRotation),i=Math.sin(this.aRotation),t=(n=t-this.aX)*e-(r-=this.aY)*i+this.aX,r=n*i+r*e+this.aY),new V(t,r)};var Po={tangentQuadraticBezier:function(t,e,i,n){return 2*(1-t)*(i-e)+2*t*(n-i)},tangentCubicBezier:function(t,e,i,n,r){return-3*e*(1-t)*(1-t)+3*i*(1-t)*(1-t)-6*t*i*(1-t)+6*t*n*(1-t)-3*t*t*n+3*t*t*r},tangentSpline:function(t,e,i,n,r){return 6*t*t-6*t+(3*t*t-4*t+1)+(-6*t*t+6*t)+(3*t*t-2*t)},interpolate:function(t,e,i,n,r){var a=r*r;return(2*e-2*i+(t=.5*(i-t))+(n=.5*(n-e)))*r*a+(-3*e+3*i-2*t-n)*a+t*r+e}};((Yi.prototype=Object.create(ki.prototype)).constructor=Yi).prototype.isSplineCurve=!0,Yi.prototype.getPoint=function(t){t*=(a=this.points).length-1,t-=e=Math.floor(t);var e,i=a[0===e?e:e-1],n=a[e],r=a[e>a.length-2?a.length-1:e+1],a=a[e>a.length-3?a.length-1:e+2];return new V((e=Po.interpolate)(i.x,n.x,r.x,a.x,t),e(i.y,n.y,r.y,a.y,t))},((qi.prototype=Object.create(ki.prototype)).constructor=qi).prototype.getPoint=function(t){var e=xo.b3;return new V(e(t,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e(t,this.v0.y,this.v1.y,this.v2.y,this.v3.y))},qi.prototype.getTangent=function(t){var e=Po.tangentCubicBezier;return new V(e(t,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e(t,this.v0.y,this.v1.y,this.v2.y,this.v3.y)).normalize()},((Zi.prototype=Object.create(ki.prototype)).constructor=Zi).prototype.getPoint=function(t){var e=xo.b2;return new V(e(t,this.v0.x,this.v1.x,this.v2.x),e(t,this.v0.y,this.v1.y,this.v2.y))},Zi.prototype.getTangent=function(t){var e=Po.tangentQuadraticBezier;return new V(e(t,this.v0.x,this.v1.x,this.v2.x),e(t,this.v0.y,this.v1.y,this.v2.y)).normalize()};var Co=Object.assign(Object.create(Wi.prototype),{fromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,i=t.length;e<i;e++)this.lineTo(t[e].x,t[e].y)},moveTo:function(t,e){this.currentPoint.set(t,e)},lineTo:function(t,e){var i=new ji(this.currentPoint.clone(),new V(t,e));this.curves.push(i),this.currentPoint.set(t,e)},quadraticCurveTo:function(t,e,i,n){t=new Zi(this.currentPoint.clone(),new V(t,e),new V(i,n)),this.curves.push(t),this.currentPoint.set(i,n)},bezierCurveTo:function(t,e,i,n,r,a){t=new qi(this.currentPoint.clone(),new V(t,e),new V(i,n),new V(r,a)),this.curves.push(t),this.currentPoint.set(r,a)},splineThru:function(t){var e=new Yi(e=[this.currentPoint.clone()].concat(t));this.curves.push(e),this.currentPoint.copy(t[t.length-1])},arc:function(t,e,i,n,r,a){this.absarc(t+this.currentPoint.x,e+this.currentPoint.y,i,n,r,a)},absarc:function(t,e,i,n,r,a){this.absellipse(t,e,i,i,n,r,a)},ellipse:function(t,e,i,n,r,a,o,s){this.absellipse(t+this.currentPoint.x,e+this.currentPoint.y,i,n,r,a,o,s)},absellipse:function(t,e,i,n,r,a,o,s){t=new Xi(t,e,i,n,r,a,o,s),0<this.curves.length&&((e=t.getPoint(0)).equals(this.currentPoint)||this.lineTo(e.x,e.y)),this.curves.push(t),t=t.getPoint(1),this.currentPoint.copy(t)}});Ji.prototype=Object.assign(Object.create(Co),{constructor:Ji,getPointsHoles:function(t){for(var e=[],i=0,n=this.holes.length;i<n;i++)e[i]=this.holes[i].getPoints(t);return e},extractAllPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},extractPoints:function(t){return this.extractAllPoints(t)}}),(Qi.prototype=Co).constructor=Qi,Ki.prototype={moveTo:function(t,e){this.currentPath=new Qi,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e)},lineTo:function(t,e){this.currentPath.lineTo(t,e)},quadraticCurveTo:function(t,e,i,n){this.currentPath.quadraticCurveTo(t,e,i,n)},bezierCurveTo:function(t,e,i,n,r,a){this.currentPath.bezierCurveTo(t,e,i,n,r,a)},splineThru:function(t){this.currentPath.splineThru(t)},toShapes:function(t,e){function i(t){for(var e=[],i=0,n=t.length;i<n;i++){var r=t[i],a=new Ji;a.curves=r.curves,e.push(a)}return e}function n(t,e){for(var i=e.length,n=!1,r=i-1,a=0;a<i;r=a++){var o=e[r],s=e[a],c=s.x-o.x,h=s.y-o.y;if(Math.abs(h)>Number.EPSILON){if(h<0&&(o=e[a],c=-c,s=e[r],h=-h),!(t.y<o.y||t.y>s.y))if(t.y===o.y){if(t.x===o.x)return!0}else{if(0===(r=h*(t.x-o.x)-c*(t.y-o.y)))return!0;r<0||(n=!n)}}else if(t.y===o.y&&(s.x<=t.x&&t.x<=o.x||o.x<=t.x&&t.x<=s.x))return!0}return n}var r=xo.isClockWise,a=this.subPaths;if(0===a.length)return[];if(!0===e)return i(a);var o,s,c,h=[];if(1===a.length)return s=a[0],(c=new Ji).curves=s.curves,h.push(c),h;var l=!r(a[0].getPoints());l=t?!l:l;c=[];var u,d=[],p=[],f=0;d[f]=void 0,p[f]=[];for(var m=0,g=a.length;m<g;m++)o=r(u=(s=a[m]).getPoints()),(o=t?!o:o)?(!l&&d[f]&&f++,d[f]={s:new Ji,p:u},d[f].s.curves=s.curves,l&&f++,p[f]=[]):p[f].push({h:s,p:u[0]});if(!d[0])return i(a);if(1<d.length){for(m=!1,s=[],r=0,a=d.length;r<a;r++)c[r]=[];for(r=0,a=d.length;r<a;r++)for(o=p[r],l=0;l<o.length;l++){for(f=o[l],u=!0,g=0;g<d.length;g++)n(f.p,d[g].p)&&(r!==g&&s.push({froms:r,tos:g,hole:l}),u?(u=!1,c[g].push(f)):m=!0);u&&c[r].push(f)}0<s.length&&(m||(p=c))}for(m=0,r=d.length;m<r;m++)for(c=d[m].s,h.push(c),a=0,o=(s=p[m]).length;a<o;a++)c.holes.push(s[a].h);return h}},Object.assign($i.prototype,{isFont:!0,generateShapes:function(t,e,i){void 0===e&&(e=100),void 0===i&&(i=4);var n=this.data;t=String(t).split("");var r=e/n.resolution,a=0;e=[];for(var o=0;o<t.length;o++){var s;s=r;var c=a,h=n.glyphs[t[o]]||n.glyphs["?"];if(h){var l,u,d,p,f,m,g,v,y=new Ki,x=[],_=xo.b2,b=xo.b3;if(h.o)for(var w=h._cachedOutline||(h._cachedOutline=h.o.split(" ")),M=0,E=w.length;M<E;)switch(w[M++]){case"m":l=w[M++]*s+c,u=w[M++]*s,y.moveTo(l,u);break;case"l":l=w[M++]*s+c,u=w[M++]*s,y.lineTo(l,u);break;case"q":if(l=w[M++]*s+c,u=w[M++]*s,f=w[M++]*s+c,m=w[M++]*s,y.quadraticCurveTo(f,m,l,u),p=x[x.length-1]){d=p.x,p=p.y;for(var T=1;T<=i;T++){var S=T/i;_(S,d,f,l),_(S,p,m,u)}}break;case"b":if(l=w[M++]*s+c,u=w[M++]*s,f=w[M++]*s+c,m=w[M++]*s,g=w[M++]*s+c,v=w[M++]*s,y.bezierCurveTo(f,m,g,v,l,u),p=x[x.length-1])for(d=p.x,p=p.y,T=1;T<=i;T++)b(S=T/i,d,f,g,l),b(S,p,m,v,u)}s={offset:h.ha*s,path:y}}else s=void 0;a+=s.offset,e.push(s.path)}for(i=[],n=0,t=e.length;n<t;n++)Array.prototype.push.apply(i,e[n].toShapes());return i}}),Object.assign(tn.prototype,{load:function(t,n,e,i){var r=this;new hi(this.manager).load(t,function(e){var i;try{i=JSON.parse(e)}catch(t){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),i=JSON.parse(e.substring(65,e.length-2))}e=r.parse(i),n&&n(e)},e,i)},parse:function(t){return new $i(t)}});var Io,Uo,No,Do,Oo,Fo,zo,Bo,Go,Ho,Vo,ko,jo,Wo,Xo,Yo,qo,Zo,Jo,Qo,Ko,$o,ts,es,is,ns,rs,as,os,ss,cs,hs,ls,us,ds,ps={getContext:function(){return void 0===Io&&(Io=new(window.AudioContext||window.webkitAudioContext)),Io},setContext:function(t){Io=t}};Object.assign(en.prototype,{load:function(t,e,i,n){var r=new hi(this.manager);r.setResponseType("arraybuffer"),r.load(t,function(t){ps.getContext().decodeAudioData(t,function(t){e(t)})},i,n)}}),nn.prototype=Object.assign(Object.create(mi.prototype),{constructor:nn,isRectAreaLight:!0,copy:function(t){return mi.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this}}),Object.assign(rn.prototype,{update:(Go=new It,Ho=new It,function(t){if(Uo!==this||No!==t.focus||Do!==t.fov||Oo!==t.aspect*this.aspect||Fo!==t.near||zo!==t.far||Bo!==t.zoom){Uo=this,No=t.focus,Do=t.fov,Oo=t.aspect*this.aspect,Fo=t.near,zo=t.far,Bo=t.zoom;var e,i=t.projectionMatrix.clone(),n=this.eyeSep/2,r=n*Fo/No,a=Fo*Math.tan(er.DEG2RAD*Do*.5)/Bo;Ho.elements[12]=-n,Go.elements[12]=n,n=-a*Oo+r,e=a*Oo+r,i.elements[0]=2*Fo/(e-n),i.elements[8]=(e+n)/(e-n),this.cameraL.projectionMatrix.copy(i),n=-a*Oo-r,e=a*Oo-r,i.elements[0]=2*Fo/(e-n),i.elements[8]=(e+n)/(e-n),this.cameraR.projectionMatrix.copy(i)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(Ho),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(Go)})}),(an.prototype=Object.create(X.prototype)).constructor=an,on.prototype=Object.assign(Object.create(X.prototype),{constructor:on,getInput:function(){return this.gain},removeFilter:function(){null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null)},getFilter:function(){return this.filter},setFilter:function(t){null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination)},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(t){this.gain.gain.value=t},updateMatrixWorld:(Vo=new Ct,ko=new s,jo=new Ct,Wo=new Ct,function(t){X.prototype.updateMatrixWorld.call(this,t),t=this.context.listener;var e=this.up;this.matrixWorld.decompose(Vo,ko,jo),Wo.set(0,0,-1).applyQuaternion(ko),t.positionX?(t.positionX.setValueAtTime(Vo.x,this.context.currentTime),t.positionY.setValueAtTime(Vo.y,this.context.currentTime),t.positionZ.setValueAtTime(Vo.z,this.context.currentTime),t.forwardX.setValueAtTime(Wo.x,this.context.currentTime),t.forwardY.setValueAtTime(Wo.y,this.context.currentTime),t.forwardZ.setValueAtTime(Wo.z,this.context.currentTime),t.upX.setValueAtTime(e.x,this.context.currentTime),t.upY.setValueAtTime(e.y,this.context.currentTime),t.upZ.setValueAtTime(e.z,this.context.currentTime)):(t.setPosition(Vo.x,Vo.y,Vo.z),t.setOrientation(Wo.x,Wo.y,Wo.z,e.x,e.y,e.z))})}),sn.prototype=Object.assign(Object.create(X.prototype),{constructor:sn,getOutput:function(){return this.gain},setNodeSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},setBuffer:function(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(!0===this.isPlaying)console.warn("THREE.Audio: Audio is already playing.");else{if(!1!==this.hasPlaybackControl){var t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.onended=this.onEnded.bind(this),t.playbackRate.setValueAtTime(this.playbackRate,this.startTime),t.start(0,this.startTime),this.isPlaying=!0,this.source=t,this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}},pause:function(){if(!1!==this.hasPlaybackControl)return this.source.stop(),this.startTime=this.context.currentTime,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this.source.stop(),this.startTime=0,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(0<this.filters.length){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(0<this.filters.length){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(t){return t||(t=[]),!0===this.isPlaying?(this.disconnect(),this.filters=t,this.connect()):this.filters=t,this},getFilter:function(){return this.getFilters()[0]},setFilter:function(t){return this.setFilters(t?[t]:[])},setPlaybackRate:function(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setValueAtTime(this.playbackRate,this.context.currentTime),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},getVolume:function(){return this.gain.gain.value},setVolume:function(t){return this.gain.gain.value=t,this}}),cn.prototype=Object.assign(Object.create(sn.prototype),{constructor:cn,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(t){this.panner.refDistance=t},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(t){this.panner.rolloffFactor=t},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(t){this.panner.distanceModel=t},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(t){this.panner.maxDistance=t},updateMatrixWorld:(Xo=new Ct,function(t){X.prototype.updateMatrixWorld.call(this,t),Xo.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(Xo.x,Xo.y,Xo.z)})}),Object.assign(hn.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var t=0,e=this.getFrequencyData(),i=0;i<e.length;i++)t+=e[i];return t/e.length}}),ln.prototype={constructor:ln,accumulate:function(t,e){var i=this.buffer,n=this.valueSize,r=t*n+n,a=this.cumulativeWeight;if(0===a){for(a=0;a!==n;++a)i[r+a]=i[a];a=e}else a+=e,this._mixBufferRegion(i,r,0,e/a,n);this.cumulativeWeight=a},apply:function(t){var e=this.valueSize,i=this.buffer;t=t*e+e;var n=this.cumulativeWeight,r=this.binding;this.cumulativeWeight=0,n<1&&this._mixBufferRegion(i,t,3*e,1-n,e);n=e;for(var a=e+e;n!==a;++n)if(i[n]!==i[n+e]){r.setValue(i,t);break}},saveOriginalState:function(){var t=this.buffer,e=this.valueSize,i=3*e;this.binding.getValue(t,i);for(var n=e;n!==i;++n)t[n]=t[i+n%e];this.cumulativeWeight=0},restoreOriginalState:function(){this.binding.setValue(this.buffer,3*this.valueSize)},_select:function(t,e,i,n,r){if(.5<=n)for(n=0;n!==r;++n)t[e+n]=t[i+n]},_slerp:function(t,e,i,n,r){s.slerpFlat(t,e,t,e,t,i,n)},_lerp:function(t,e,i,n,r){for(var a=1-n,o=0;o!==r;++o){var s=e+o;t[s]=t[s]*a+t[i+o]*n}}},un.prototype={constructor:un,getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,i=e.objectName,n=e.propertyName,r=e.propertyIndex;if(t||(this.node=t=un.findNode(this.rootNode,e.nodeName)||this.rootNode),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(i){var a=e.objectIndex;switch(i){case"materials":if(!t.material)return void console.error(" can not bind to material as node does not have a material",this);if(!t.material.materials)return void console.error(" can not bind to material.materials as node.material does not have a materials array",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error(" can not bind to bones as node does not have a skeleton",this);for(t=t.skeleton.bones,i=0;i<t.length;i++)if(t[i].name===a){a=i;break}break;default:if(void 0===t[i])return void console.error(" can not bind to objectName of node, undefined",this);t=t[i]}if(void 0!==a){if(void 0===t[a])return void console.error(" trying to bind to objectIndex of objectName, but is undefined:",this,t);t=t[a]}}if(void 0===(a=t[n]))console.error(" trying to update property for track: "+e.nodeName+"."+n+" but it wasn't found.",t);else{if(e=this.Versioning.None,void 0!==t.needsUpdate?(e=this.Versioning.NeedsUpdate,this.targetObject=t):void 0!==t.matrixWorldNeedsUpdate&&(e=this.Versioning.MatrixWorldNeedsUpdate,this.targetObject=t),i=this.BindingType.Direct,void 0!==r){if("morphTargetInfluences"===n){if(!t.geometry)return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry",this);if(!t.geometry.morphTargets)return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets",this);for(i=0;i<this.node.geometry.morphTargets.length;i++)if(t.geometry.morphTargets[i].name===r){r=i;break}}i=this.BindingType.ArrayElement,this.resolvedProperty=a,this.propertyIndex=r}else void 0!==a.fromArray&&void 0!==a.toArray?(i=this.BindingType.HasFromToArray,this.resolvedProperty=a):void 0!==a.length?(i=this.BindingType.EntireArray,this.resolvedProperty=a):this.propertyName=n;this.getValue=this.GetterByBindingType[i],this.setValue=this.SetterByBindingTypeAndVersioning[i][e]}}else console.error(" trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}},Object.assign(un.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},_getValue_unbound:un.prototype.getValue,_setValue_unbound:un.prototype.setValue,BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var i=this.resolvedProperty,n=0,r=i.length;n!==r;++n)t[e++]=i[n]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.node[this.propertyName]=t[e]},function(t,e){this.node[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.node[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){for(var i=this.resolvedProperty,n=0,r=i.length;n!==r;++n)i[n]=t[e++]},function(t,e){for(var i=this.resolvedProperty,n=0,r=i.length;n!==r;++n)i[n]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var i=this.resolvedProperty,n=0,r=i.length;n!==r;++n)i[n]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]]}),(un.Composite=function(t,e,i){i=i||un.parseTrackName(e),this._targetGroup=t,this._bindings=t.subscribe_(e,i)}).prototype={constructor:un.Composite,getValue:function(t,e){this.bind();var i=this._bindings[this._targetGroup.nCachedObjects_];void 0!==i&&i.getValue(t,e)},setValue:function(t,e){for(var i=this._bindings,n=this._targetGroup.nCachedObjects_,r=i.length;n!==r;++n)i[n].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}},un.create=function(t,e,i){return t&&t.isAnimationObjectGroup?new un.Composite(t,e,i):new un(t,e,i)},un.parseTrackName=function(t){var e=/^((?:[\w-]+[\/:])*)([\w-]+)?(?:\.([\w-]+)(?:\[(.+)\])?)?\.([\w-]+)(?:\[(.+)\])?$/.exec(t);if(!e)throw Error("cannot parse trackName at all: "+t);if(null===(e={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]}).propertyName||0===e.propertyName.length)throw Error("can not parse propertyName from trackName: "+t);return e},un.findNode=function(t,n){if(!n||""===n||"root"===n||"."===n||-1===n||n===t.name||n===t.uuid)return t;if(t.skeleton){var e=function(t){for(var e=0;e<t.bones.length;e++){var i=t.bones[e];if(i.name===n)return i}return null}(t.skeleton);if(e)return e}if(t.children){var r=function(t){for(var e=0;e<t.length;e++){var i=t[e];if(i.name===n||i.uuid===n||(i=r(i.children)))return i}return null};if(e=r(t.children))return e}return null},dn.prototype={constructor:dn,isAnimationObjectGroup:!0,add:function(t){for(var e=this._objects,i=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,a=this._paths,o=this._parsedPaths,s=this._bindings,c=s.length,h=0,l=arguments.length;h!==l;++h){var u=arguments[h],d=r[p=u.uuid];if(void 0===d){d=i++,r[p]=d,e.push(u);for(var p=0,f=c;p!==f;++p)s[p].push(new un(u,a[p],o[p]))}else if(d<n){var m=--n;for(e[r[(f=e[m]).uuid]=d]=f,e[r[p]=m]=u,p=0,f=c;p!==f;++p){var g=s[p],v=g[d];g[d]=g[m],void 0===v&&(v=new un(u,a[p],o[p])),g[m]=v}}else void 0!==e[d]&&console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")}this.nCachedObjects_=n},remove:function(t){for(var e=this._objects,i=this.nCachedObjects_,n=this._indicesByUUID,r=this._bindings,a=r.length,o=0,s=arguments.length;o!==s;++o){var c=arguments[o],h=c.uuid,l=n[h];if(void 0!==l&&i<=l){var u=i++;for(e[n[(d=e[u]).uuid]=l]=d,e[n[h]=u]=c,c=0,h=a;c!==h;++c){var d,p=(d=r[c])[l];d[l]=d[u],d[u]=p}}}this.nCachedObjects_=i},uncache:function(t){for(var e=this._objects,i=e.length,n=this.nCachedObjects_,r=this._indicesByUUID,a=this._bindings,o=a.length,s=0,c=arguments.length;s!==c;++s){var h=r[l=arguments[s].uuid];if(void 0!==h)if(delete r[l],h<n){var l,u=e[l=--n],d=--i,p=e[d];for(e[r[u.uuid]=h]=u,e[r[p.uuid]=l]=p,e.pop(),u=0,p=o;u!==p;++u){var f=a[u],m=f[d];f[h]=f[l],f[l]=m,f.pop()}}else for(e[r[(p=e[d=--i]).uuid]=h]=p,e.pop(),u=0,p=o;u!==p;++u)(f=a[u])[h]=f[d],f.pop()}this.nCachedObjects_=n},subscribe_:function(t,e){var i=this._bindingsIndicesByPath,n=i[t],r=this._bindings;if(void 0!==n)return r[n];var a=this._paths,o=this._parsedPaths,s=this._objects,c=this.nCachedObjects_,h=Array(s.length);n=r.length;for(i[t]=n,a.push(t),o.push(e),r.push(h),i=c,n=s.length;i!==n;++i)h[i]=new un(s[i],t,e);return h},unsubscribe_:function(t){var e=this._bindingsIndicesByPath,i=e[t];if(void 0!==i){var n=this._paths,r=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];a[e[t[o]]=i]=s,a.pop(),r[i]=r[o],r.pop(),n[i]=n[o],n.pop()}}},pn.prototype={constructor:pn,play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,i){if(t.fadeOut(e),this.fadeIn(e),i){i=this._clip.duration;var n=t._clip.duration,r=i/n;t.warp(1,n/i,e),this.warp(r,1,e)}return this},crossFadeTo:function(t,e,i){return t.crossFadeFrom(this,e,i)},stopFading:function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this._effectiveTimeScale,0,t)},warp:function(t,e,i){var n=this._mixer,r=n.time,a=this._timeScaleInterpolant,o=this.timeScale;return null===a&&(this._timeScaleInterpolant=a=n._lendControlInterpolant()),n=a.parameterPositions,a=a.sampleValues,n[0]=r,n[1]=r+i,a[0]=t/o,a[1]=e/o,this},stopWarping:function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,i,n){if(null!==(r=this._startTime)){if((e=(t-r)*i)<0||0===i)return;this._startTime=null,e*=i}if(e*=this._updateTimeScale(t),i=this._updateTime(e),0<(t=this._updateWeight(t))){e=this._interpolants;for(var r=this._propertyBindings,a=0,o=e.length;a!==o;++a)e[a].evaluate(i),r[a].accumulate(n,t)}},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var i=this._weightInterpolant;if(null!==i){var n=i.evaluate(t)[0];e=e*n;t>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var i=this._timeScaleInterpolant;if(null!==i){e=e*i.evaluate(t)[0];t>i.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e},_updateTime:function(t){var e=this.time+t;if(0===t)return e;var i=this._clip.duration,n=this.loop,r=this._loopCount;if(2200===n)t:{if(-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1)),i<=e)e=i;else{if(!(e<0))break t;e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}else{if(n=2202===n,-1===r&&(0<=t?(r=0,this._setEndings(!0,0===this.repetitions,n)):this._setEndings(0===this.repetitions,!0,n)),i<=e||e<0){var a=Math.floor(e/i),o=(e=e-i*a,r=r+Math.abs(a),this.repetitions-r);o<0?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=0<t?i:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:0<t?1:-1})):(0==o?(t=t<0,this._setEndings(t,!t,n)):this._setEndings(!1,!1,n),this._loopCount=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a}))}if(n&&1==(1&r))return i-(this.time=e)}return this.time=e},_setEndings:function(t,e,i){var n=this._interpolantSettings;i?(n.endingStart=2401,n.endingEnd=2401):(n.endingStart=t?this.zeroSlopeAtStart?2401:2400:2402,n.endingEnd=e?this.zeroSlopeAtEnd?2401:2400:2402)},_scheduleFading:function(t,e,i){var n=this._mixer,r=n.time,a=this._weightInterpolant;return null===a&&(this._weightInterpolant=a=n._lendControlInterpolant()),n=a.parameterPositions,a=a.sampleValues,n[0]=r,a[0]=e,n[1]=r+t,a[1]=i,this}},Object.assign(fn.prototype,e.prototype,{clipAction:function(t,e){var i=(r=e||this._root).uuid,n="string"==typeof t?Fi.findByName(r,t):t,r=null!==n?n.uuid:t,a=this._actionsByClip[r],o=null;if(void 0!==a){if(void 0!==(o=a.actionByRoot[i]))return o;o=a.knownActions[0],null===n&&(n=o._clip)}return null===n?null:(n=new pn(this,n,e),this._bindAction(n,o),this._addInactiveAction(n,r,i),n)},existingAction:function(t,e){var i=(n=e||this._root).uuid,n="string"==typeof t?Fi.findByName(n,t):t;return void 0!==(n=this._actionsByClip[n?n.uuid:t])&&n.actionByRoot[i]||null},stopAllAction:function(){for(var t=this._actions,e=this._nActiveActions,i=this._bindings,n=this._nActiveBindings,r=this._nActiveBindings=this._nActiveActions=0;r!==e;++r)t[r].reset();for(r=0;r!==n;++r)i[r].useCount=0;return this},update:function(t){t*=this.timeScale;for(var e=this._actions,i=this._nActiveActions,n=this.time+=t,r=Math.sign(t),a=this._accuIndex^=1,o=0;o!==i;++o){var s=e[o];s.enabled&&s._update(n,t,r,a)}for(t=this._bindings,e=this._nActiveBindings,o=0;o!==e;++o)t[o].apply(a);return this},getRoot:function(){return this._root},uncacheClip:function(t){var e=this._actions;t=t.uuid;var i=this._actionsByClip;if(void 0!==(n=i[t])){for(var n,r=0,a=(n=n.knownActions).length;r!==a;++r){var o=n[r];this._deactivateAction(o);var s=o._cacheIndex,c=e[e.length-1];o._cacheIndex=null,o._byClipCacheIndex=null,e[c._cacheIndex=s]=c,e.pop(),this._removeInactiveBindingsForAction(o)}delete i[t]}},uncacheRoot:function(t){t=t.uuid;var e,i=this._actionsByClip;for(e in i){var n=i[e].actionByRoot[t];void 0!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}if(void 0!==(e=this._bindingsByRootAndName[t]))for(var r in e)(t=e[r]).restoreOriginalState(),this._removeInactiveBinding(t)},uncacheAction:function(t,e){var i=this.existingAction(t,e);null!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}}),Object.assign(fn.prototype,{_bindAction:function(t,e){var i=t._localRoot||this._root,n=t._clip.tracks,r=n.length,a=t._propertyBindings,o=t._interpolants,s=i.uuid,c=this._bindingsByRootAndName,h=c[s];for(void 0===h&&(h={},c[s]=h),c=0;c!==r;++c){var l=n[c],u=l.name,d=h[u];if(void 0===d){if(void 0!==(d=a[c])){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,u));continue}++(d=new ln(un.create(i,u,e&&e._propertyBindings[c].binding.parsedPath),l.ValueTypeName,l.getValueSize())).referenceCount,this._addInactiveBinding(d,s,u)}a[c]=d,o[c].resultBuffer=d.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,i=t._clip.uuid,n=this._actionsByClip[i];this._bindAction(t,n&&n.knownActions[0]),this._addInactiveAction(t,i,e)}for(i=0,n=(e=t._propertyBindings).length;i!==n;++i){var r=e[i];0==r.useCount++&&(this._lendBinding(r),r.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,i=0,n=e.length;i!==n;++i){var r=e[i];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){return null!==(t=t._cacheIndex)&&t<this._nActiveActions},_addInactiveAction:function(t,e,i){var n=this._actions,r=this._actionsByClip,a=r[e];void 0===a?(a={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,r[e]=a):(e=a.knownActions,t._byClipCacheIndex=e.length,e.push(t)),t._cacheIndex=n.length,n.push(t),a.actionByRoot[i]=t},_removeInactiveAction:function(t){var e=this._actions,i=e[e.length-1],n=t._cacheIndex;e[i._cacheIndex=n]=i,e.pop(),t._cacheIndex=null;i=t._clip.uuid;var r=(n=this._actionsByClip)[i],a=r.knownActions,o=a[a.length-1],s=t._byClipCacheIndex;a[o._byClipCacheIndex=s]=o,a.pop(),t._byClipCacheIndex=null,delete r.actionByRoot[(e._localRoot||this._root).uuid],0===a.length&&delete n[i],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){for(var e=0,i=(t=t._propertyBindings).length;e!==i;++e){var n=t[e];0==--n.referenceCount&&this._removeInactiveBinding(n)}},_lendAction:function(t){var e=this._actions,i=t._cacheIndex,n=this._nActiveActions++,r=e[n];e[t._cacheIndex=n]=t,e[r._cacheIndex=i]=r},_takeBackAction:function(t){var e=this._actions,i=t._cacheIndex,n=--this._nActiveActions,r=e[n];e[t._cacheIndex=n]=t,e[r._cacheIndex=i]=r},_addInactiveBinding:function(t,e,i){var n=this._bindingsByRootAndName,r=n[e],a=this._bindings;void 0===r&&(r={},n[e]=r),(r[i]=t)._cacheIndex=a.length,a.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,i=(n=t.binding).rootNode.uuid,n=n.path,r=this._bindingsByRootAndName,a=r[i],o=e[e.length-1];t=t._cacheIndex,e[o._cacheIndex=t]=o,e.pop(),delete a[n];t:{for(var s in a)break t;delete r[i]}},_lendBinding:function(t){var e=this._bindings,i=t._cacheIndex,n=this._nActiveBindings++,r=e[n];e[t._cacheIndex=n]=t,e[r._cacheIndex=i]=r},_takeBackBinding:function(t){var e=this._bindings,i=t._cacheIndex,n=--this._nActiveBindings,r=e[n];e[t._cacheIndex=n]=t,e[r._cacheIndex=i]=r},_lendControlInterpolant:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,i=t[e];return void 0===i&&(t[(i=new Si(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=e]=i),i},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,i=t.__cacheIndex,n=--this._nActiveControlInterpolants,r=e[n];e[t.__cacheIndex=n]=t,e[r.__cacheIndex=i]=r},_controlInterpolantsResultBuffer:new Float32Array(1)}),mn.prototype.clone=function(){return new mn(void 0===this.value.clone?this.value:this.value.clone())},((gn.prototype=Object.create(Vt.prototype)).constructor=gn).prototype.isInstancedBufferGeometry=!0,gn.prototype.addGroup=function(t,e,i){this.groups.push({start:t,count:e,materialIndex:i})},gn.prototype.copy=function(t){null!==(i=t.index)&&this.setIndex(i.clone());var e,i=t.attributes;for(e in i)this.addAttribute(e,i[e].clone());for(e=0,i=(t=t.groups).length;e<i;e++){var n=t[e];this.addGroup(n.start,n.count,n.materialIndex)}return this},vn.prototype={constructor:vn,isInterleavedBufferAttribute:!0,get count(){return this.data.count},get array(){return this.data.array},setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this},setXYZ:function(t,e,i,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=n,this},setXYZW:function(t,e,i,n,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=n,this.data.array[t+3]=r,this}},yn.prototype={constructor:yn,isInterleavedBuffer:!0,set needsUpdate(t){!0===t&&this.version++},setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.count=void 0!==t?t.length/this.stride:0,this.array=t},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.dynamic=t.dynamic,this},copyAt:function(t,e,i){t*=this.stride,i*=e.stride;for(var n=0,r=this.stride;n<r;n++)this.array[t+n]=e.array[i+n];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(t){return this.onUploadCallback=t,this}},((xn.prototype=Object.create(yn.prototype)).constructor=xn).prototype.isInstancedInterleavedBuffer=!0,xn.prototype.copy=function(t){return yn.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},((_n.prototype=Object.create(J.prototype)).constructor=_n).prototype.isInstancedBufferAttribute=!0,_n.prototype.copy=function(t){return J.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},bn.prototype={constructor:bn,linePrecision:1,set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize()):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,e){var i=[];return Mn(t,this,i,e),i.sort(wn),i},intersectObjects:function(t,e){var i=[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(var n=0,r=t.length;n<r;n++)Mn(t[n],this,i,e);return i.sort(wn),i}},En.prototype={constructor:En,start:function(){this.oldTime=this.startTime=(performance||Date).now(),this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var t=0;if(this.autoStart&&!this.running&&this.start(),this.running){var e=(performance||Date).now();t=(e-this.oldTime)/1e3;this.oldTime=e,this.elapsedTime+=t}return t}},Tn.prototype={constructor:Tn,set:function(t,e,i){return this.radius=t,this.phi=e,this.theta=i,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(t){return this.radius=t.length(),0===this.radius?this.phi=this.theta=0:(this.theta=Math.atan2(t.x,t.z),this.phi=Math.acos(er.clamp(t.y/this.radius,-1,1))),this}},Sn.prototype={constructor:Sn,set:function(t,e,i){return this.radius=t,this.theta=e,this.y=i,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this},setFromVector3:function(t){return this.radius=Math.sqrt(t.x*t.x+t.z*t.z),this.theta=Math.atan2(t.x,t.z),this.y=t.y,this}},((An.prototype=Object.create(kt.prototype)).constructor=An).prototype.createAnimation=function(t,e,i,n){e={start:e,end:i,length:i-e+1,fps:n,duration:(i-e)/n,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1},this.animationsMap[t]=e,this.animationsList.push(e)},An.prototype.autoCreateAnimations=function(t){for(var e,i=/([a-z]+)_?(\d+)/i,n={},r=this.geometry,a=0,o=r.morphTargets.length;a<o;a++){var s=r.morphTargets[a].name.match(i);if(s&&1<s.length){var c=s[1];n[c]||(n[c]={start:1/0,end:-1/0}),a<(s=n[c]).start&&(s.start=a),a>s.end&&(s.end=a),e||(e=c)}}for(c in n)s=n[c],this.createAnimation(c,s.start,s.end,t);this.firstAnimation=e},An.prototype.setAnimationDirectionForward=function(t){(t=this.animationsMap[t])&&(t.direction=1,t.directionBackwards=!1)},An.prototype.setAnimationDirectionBackward=function(t){(t=this.animationsMap[t])&&(t.direction=-1,t.directionBackwards=!0)},An.prototype.setAnimationFPS=function(t,e){var i=this.animationsMap[t];i&&(i.fps=e,i.duration=(i.end-i.start)/i.fps)},An.prototype.setAnimationDuration=function(t,e){var i=this.animationsMap[t];i&&(i.duration=e,i.fps=(i.end-i.start)/i.duration)},An.prototype.setAnimationWeight=function(t,e){var i=this.animationsMap[t];i&&(i.weight=e)},An.prototype.setAnimationTime=function(t,e){var i=this.animationsMap[t];i&&(i.time=e)},An.prototype.getAnimationTime=function(t){var e=0;return(t=this.animationsMap[t])&&(e=t.time),e},An.prototype.getAnimationDuration=function(t){var e=-1;return(t=this.animationsMap[t])&&(e=t.duration),e},An.prototype.playAnimation=function(t){var e=this.animationsMap[t];e?(e.time=0,e.active=!0):console.warn("THREE.MorphBlendMesh: animation["+t+"] undefined in .playAnimation()")},An.prototype.stopAnimation=function(t){(t=this.animationsMap[t])&&(t.active=!1)},An.prototype.update=function(t){for(var e=0,i=this.animationsList.length;e<i;e++){var n=this.animationsList[e];if(n.active){var r=n.duration/n.length;n.time+=n.direction*t,n.mirroredLoop?(n.time>n.duration||n.time<0)&&(n.direction*=-1,n.time>n.duration&&(n.time=n.duration,n.directionBackwards=!0),n.time<0&&(n.time=0,n.directionBackwards=!1)):(n.time%=n.duration,n.time<0&&(n.time+=n.duration));var a=n.start+er.clamp(Math.floor(n.time/r),0,n.length-1),o=n.weight;a!==n.currentFrame&&(this.morphTargetInfluences[n.lastFrame]=0,this.morphTargetInfluences[n.currentFrame]=1*o,this.morphTargetInfluences[a]=0,n.lastFrame=n.currentFrame,n.currentFrame=a),r=n.time%r/r,n.directionBackwards&&(r=1-r),n.currentFrame!==n.lastFrame?(this.morphTargetInfluences[n.currentFrame]=r*o,this.morphTargetInfluences[n.lastFrame]=(1-r)*o):this.morphTargetInfluences[n.currentFrame]=o}}},((Ln.prototype=Object.create(X.prototype)).constructor=Ln).prototype.isImmediateRenderObject=!0,((Rn.prototype=Object.create(oe.prototype)).constructor=Rn).prototype.update=(Yo=new Ct,qo=new Ct,Zo=new F,function(){var t=["a","b","c"];this.object.updateMatrixWorld(!0),Zo.getNormalMatrix(this.object.matrixWorld);var e=this.object.matrixWorld,i=this.geometry.attributes.position,n=this.object.geometry;if(n&&n.isGeometry)for(var r=n.vertices,a=n.faces,o=n=0,s=a.length;o<s;o++)for(var c=a[o],h=0,l=c.vertexNormals.length;h<l;h++){var u=c.vertexNormals[h];Yo.copy(r[c[t[h]]]).applyMatrix4(e),qo.copy(u).applyMatrix3(Zo).normalize().multiplyScalar(this.size).add(Yo),i.setXYZ(n,Yo.x,Yo.y,Yo.z),n+=1,i.setXYZ(n,qo.x,qo.y,qo.z),n+=1}else if(n&&n.isBufferGeometry)for(t=n.attributes.position,r=n.attributes.normal,h=n=0,l=t.count;h<l;h++)Yo.set(t.getX(h),t.getY(h),t.getZ(h)).applyMatrix4(e),qo.set(r.getX(h),r.getY(h),r.getZ(h)),qo.applyMatrix3(Zo).normalize().multiplyScalar(this.size).add(Yo),i.setXYZ(n,Yo.x,Yo.y,Yo.z),n+=1,i.setXYZ(n,qo.x,qo.y,qo.z),n+=1;return i.needsUpdate=!0,this}),((Pn.prototype=Object.create(X.prototype)).constructor=Pn).prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},Pn.prototype.update=(Jo=new Ct,Qo=new Ct,function(){var t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),Jo.setFromMatrixPosition(this.light.matrixWorld),Qo.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Qo.sub(Jo)),this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}),((Cn.prototype=Object.create(oe.prototype)).constructor=Cn).prototype.getBoneList=function(t){var e=[];t&&t.isBone&&e.push(t);for(var i=0;i<t.children.length;i++)e.push.apply(e,this.getBoneList(t.children[i]));return e},Cn.prototype.update=(Ko=new Ct,$o=new It,ts=new It,function(){var t=this.geometry,e=t.getAttribute("position");ts.getInverse(this.root.matrixWorld);for(var i=0,n=0;i<this.bones.length;i++){var r=this.bones[i];r.parent&&r.parent.isBone&&($o.multiplyMatrices(ts,r.matrixWorld),Ko.setFromMatrixPosition($o),e.setXYZ(n,Ko.x,Ko.y,Ko.z),$o.multiplyMatrices(ts,r.parent.matrixWorld),Ko.setFromMatrixPosition($o),e.setXYZ(n+1,Ko.x,Ko.y,Ko.z),n+=2)}t.getAttribute("position").needsUpdate=!0}),((In.prototype=Object.create(kt.prototype)).constructor=In).prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},In.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)},((Un.prototype=Object.create(X.prototype)).constructor=Un).prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose(),this.children[1].geometry.dispose(),this.children[1].material.dispose()},Un.prototype.update=(es=new Ct,is=new Ct,function(){var t=this.children[0],e=this.children[1];if(this.light.target){es.setFromMatrixPosition(this.light.matrixWorld),is.setFromMatrixPosition(this.light.target.matrixWorld);var i=is.clone().sub(es);t.lookAt(i),e.lookAt(i)}t.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),e.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),e=.5*this.light.width,i=.5*this.light.height;var n=(t=t.geometry.getAttribute("position")).array;n[0]=e,n[1]=-i,n[2]=0,n[3]=e,n[4]=i,n[5]=0,n[6]=-e,n[7]=i,n[8]=0,n[9]=-e,n[10]=i,n[11]=0,n[12]=-e,n[13]=-i,n[14]=0,n[15]=e,n[16]=-i,n[17]=0,t.needsUpdate=!0}),((Nn.prototype=Object.create(X.prototype)).constructor=Nn).prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},Nn.prototype.update=(ns=new Ct,rs=new Nt,as=new Nt,function(){var t=this.children[0],e=t.geometry.getAttribute("color");rs.copy(this.light.color).multiplyScalar(this.light.intensity),as.copy(this.light.groundColor).multiplyScalar(this.light.intensity);for(var i=0,n=e.count;i<n;i++){var r=i<n/2?rs:as;e.setXYZ(i,r.r,r.g,r.b)}t.lookAt(ns.setFromMatrixPosition(this.light.matrixWorld).negate()),e.needsUpdate=!0}),(Dn.prototype=Object.create(oe.prototype)).constructor=Dn,(On.prototype=Object.create(oe.prototype)).constructor=On,((Fn.prototype=Object.create(oe.prototype)).constructor=Fn).prototype.update=(os=new Ct,ss=new Ct,cs=new F,function(){this.object.updateMatrixWorld(!0),cs.getNormalMatrix(this.object.matrixWorld);for(var t,e=this.object.matrixWorld,i=this.geometry.attributes.position,n=(t=this.object.geometry).vertices,r=0,a=0,o=(t=t.faces).length;a<o;a++){var s=t[a],c=s.normal;os.copy(n[s.a]).add(n[s.b]).add(n[s.c]).divideScalar(3).applyMatrix4(e),ss.copy(c).applyMatrix3(cs).normalize().multiplyScalar(this.size).add(os),i.setXYZ(r,os.x,os.y,os.z),r+=1,i.setXYZ(r,ss.x,ss.y,ss.z),r+=1}return i.needsUpdate=!0,this}),((zn.prototype=Object.create(X.prototype)).constructor=zn).prototype.dispose=function(){var t=this.children[0],e=this.children[1];t.geometry.dispose(),t.material.dispose(),e.geometry.dispose(),e.material.dispose()},zn.prototype.update=(hs=new Ct,ls=new Ct,us=new Ct,function(){hs.setFromMatrixPosition(this.light.matrixWorld),ls.setFromMatrixPosition(this.light.target.matrixWorld),us.subVectors(ls,hs);var t=this.children[0],e=this.children[1];t.lookAt(us),t.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),e.lookAt(us),e.scale.z=us.length()}),((Bn.prototype=Object.create(oe.prototype)).constructor=Bn).prototype.update=function(){function t(t,e,i,n){if(o.set(e,i,n).unproject(s),void 0!==(t=a[t]))for(e=r.getAttribute("position"),i=0,n=t.length;i<n;i++)e.setXYZ(t[i],o.x,o.y,o.z)}var r,a,o=new Ct,s=new ct;return function(){r=this.geometry,a=this.pointMap,s.projectionMatrix.copy(this.camera.projectionMatrix),t("c",0,0,-1),t("t",0,0,1),t("n1",-1,-1,-1),t("n2",1,-1,-1),t("n3",-1,1,-1),t("n4",1,1,-1),t("f1",-1,-1,1),t("f2",1,-1,1),t("f3",-1,1,1),t("f4",1,1,1),t("u1",.7,1.1,-1),t("u2",-.7,1.1,-1),t("u3",0,2,-1),t("cf1",-1,0,1),t("cf2",1,0,1),t("cf3",0,-1,1),t("cf4",0,1,1),t("cn1",-1,0,-1),t("cn2",1,0,-1),t("cn3",0,-1,-1),t("cn4",0,1,-1),r.getAttribute("position").needsUpdate=!0}}(),((Gn.prototype=Object.create(oe.prototype)).constructor=Gn).prototype.update=(ds=new D,function(t){if(t&&t.isBox3?ds.copy(t):ds.setFromObject(t),!ds.isEmpty()){t=ds.min;var e=ds.max,i=this.geometry.attributes.position,n=i.array;n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=t.x,n[4]=e.y,n[5]=e.z,n[6]=t.x,n[7]=t.y,n[8]=e.z,n[9]=e.x,n[10]=t.y,n[11]=e.z,n[12]=e.x,n[13]=e.y,n[14]=t.z,n[15]=t.x,n[16]=e.y,n[17]=t.z,n[18]=t.x,n[19]=t.y,n[20]=t.z,n[21]=e.x,n[22]=t.y,n[23]=t.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}});var fs=new Vt;fs.addAttribute("position",new rt([0,0,0,0,1,0],3));var ms,gs,vs=new We(0,.5,1,5,1);vs.translate(0,-.5,0),((Hn.prototype=Object.create(X.prototype)).constructor=Hn).prototype.setDirection=(gs=new Ct,function(t){.99999<t.y?this.quaternion.set(0,0,0,1):t.y<-.99999?this.quaternion.set(1,0,0,0):(gs.set(t.z,0,-t.x).normalize(),ms=Math.acos(t.y),this.quaternion.setFromAxisAngle(gs,ms))}),Hn.prototype.setLength=function(t,e,i){void 0===e&&(e=.2*t),void 0===i&&(i=.2*e),this.line.scale.set(1,Math.max(0,t-e),1),this.line.updateMatrix(),this.cone.scale.set(i,e,i),this.cone.position.y=t,this.cone.updateMatrix()},Hn.prototype.setColor=function(t){this.line.material.color.copy(t),this.cone.material.color.copy(t)},(Vn.prototype=Object.create(oe.prototype)).constructor=Vn;var ys,xs=function(){function t(){}var c=new Ct,h=new t,l=new t,u=new t;return t.prototype.init=function(t,e,i,n){this.c0=t,this.c1=i,this.c2=-3*t+3*e-2*i-n,this.c3=2*t-2*e+i+n},t.prototype.initNonuniformCatmullRom=function(t,e,i,n,r,a,o){this.init(e,i,((e-t)/r-(i-t)/(r+a)+(i-e)/a)*a,((i-e)/a-(n-e)/(a+o)+(n-i)/o)*a)},t.prototype.initCatmullRom=function(t,e,i,n,r){this.init(e,i,r*(i-t),r*(n-e))},t.prototype.calc=function(t){var e=t*t;return this.c0+this.c1*t+this.c2*e+this.c3*e*t},ki.create(function(t){this.points=t||[],this.closed=!1},function(t){var e,i,n,r,a,o=this.points;if((i=o.length)<2&&console.log("duh, you need at least 2 points"),t*=i-(this.closed?0:1),t-=e=Math.floor(t),this.closed?e+=0<e?0:(Math.floor(Math.abs(e)/o.length)+1)*o.length:0===t&&e===i-1&&(e=i-2,t=1),n=this.closed||0<e?o[(e-1)%i]:(c.subVectors(o[0],o[1]).add(o[0]),c),r=o[e%i],a=o[(e+1)%i],o=this.closed||e+2<i?o[(e+2)%i]:(c.subVectors(o[i-1],o[i-2]).add(o[i-1]),c),void 0===this.type||"centripetal"===this.type||"chordal"===this.type){var s="chordal"===this.type?.5:.25;i=Math.pow(n.distanceToSquared(r),s),(e=Math.pow(r.distanceToSquared(a),s))<1e-4&&(e=1),i<1e-4&&(i=e),(s=Math.pow(a.distanceToSquared(o),s))<1e-4&&(s=e),h.initNonuniformCatmullRom(n.x,r.x,a.x,o.x,i,e,s),l.initNonuniformCatmullRom(n.y,r.y,a.y,o.y,i,e,s),u.initNonuniformCatmullRom(n.z,r.z,a.z,o.z,i,e,s)}else"catmullrom"===this.type&&(i=void 0!==this.tension?this.tension:.5,h.initCatmullRom(n.x,r.x,a.x,o.x,i),l.initCatmullRom(n.y,r.y,a.y,o.y,i),u.initCatmullRom(n.z,r.z,a.z,o.z,i));return new Ct(h.calc(t),l.calc(t),u.calc(t))})}(),_s=ki.create(function(t){console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),this.points=void 0===t?[]:t},function(t){t*=(a=this.points).length-1,t-=e=Math.floor(t);var e,i=a[0==e?e:e-1],n=a[e],r=a[e>a.length-2?a.length-1:e+1],a=a[e>a.length-3?a.length-1:e+2];return new Ct((e=Po.interpolate)(i.x,n.x,r.x,a.x,t),e(i.y,n.y,r.y,a.y,t),e(i.z,n.z,r.z,a.z,t))}),bs=ki.create(function(t,e,i,n){this.v0=t,this.v1=e,this.v2=i,this.v3=n},function(t){var e=xo.b3;return new Ct(e(t,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e(t,this.v0.y,this.v1.y,this.v2.y,this.v3.y),e(t,this.v0.z,this.v1.z,this.v2.z,this.v3.z))}),ws=ki.create(function(t,e,i){this.v0=t,this.v1=e,this.v2=i},function(t){var e=xo.b2;return new Ct(e(t,this.v0.x,this.v1.x,this.v2.x),e(t,this.v0.y,this.v1.y,this.v2.y),e(t,this.v0.z,this.v1.z,this.v2.z))}),Ms=ki.create(function(t,e){this.v1=t,this.v2=e},function(t){if(1===t)return this.v2.clone();var e=new Ct;return e.subVectors(this.v2,this.v1),e.multiplyScalar(t),e.add(this.v1),e});(kn.prototype=Object.create(Xi.prototype)).constructor=kn,jn.prototype=Object.create(xs.prototype),Dn.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Object.assign(O.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(D.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),Y.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},er.random16=function(){return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),Math.random()},Object.assign(F.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(t){return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(t)},applyToBuffer:function(t,e,i){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)}}),Object.assign(It.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){return void 0===ys&&(ys=new Ct),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),ys.setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),t.applyProjection(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(t){return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(t)},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBuffer:function(t,e,i){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)}}),H.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},s.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},Object.assign(k.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(Ji.prototype,{extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Ue(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new ke(this,t)}}),Object.assign(Ct.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)}}),st.prototype.computeTangents=function(){console.warn("THREE.Geometry: .computeTangents() has been removed.")},Object.assign(X.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)}}),Object.defineProperties(X.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.defineProperties(Tt.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Xt.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(mi.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(J.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}}}),Object.assign(Vt.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addDrawCall:function(t,e,i){void 0!==i&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}}),Object.defineProperties(Vt.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(mn.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(N.prototype,{wrapAround:{get:function(){console.warn("THREE."+this.type+": .wrapAround has been removed.")},set:function(){console.warn("THREE."+this.type+": .wrapAround has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE."+this.type+": .wrapRGB has been removed."),new Nt}}}),Object.defineProperties(ni.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(Ft.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),e.prototype=Object.assign(Object.create({constructor:e,apply:function(t){console.warn("THREE.EventDispatcher: .apply is deprecated, just inherit or Object.assign the prototype to mix-in."),Object.assign(t,this)}}),e.prototype),Object.assign(yt.prototype,{supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}}),Object.defineProperties(yt.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){return this.shadowMap.cullFace},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),this.shadowMap.cullFace=t}}}),Object.defineProperties(Gt.prototype,{cullFace:{get:function(){return this.renderReverseSided?2:1},set:function(t){t=1!==t,console.warn("WebGLRenderer: .shadowMap.cullFace is deprecated. Set .shadowMap.renderReverseSided to "+t+"."),this.renderReverseSided=t}}}),Object.defineProperties(B.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),sn.prototype.load=function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var e=this;return(new en).load(t,function(t){e.setBuffer(t)}),this},hn.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},t.WebGLRenderTargetCube=n,t.WebGLRenderTarget=B,t.WebGLRenderer=yt,t.ShaderLib=Nr,t.UniformsLib=Ur,t.UniformsUtils=Lr,t.ShaderChunk=Rr,t.FogExp2=xt,t.Fog=_t,t.Scene=bt,t.LensFlare=wt,t.Sprite=Et,t.LOD=Tt,t.SkinnedMesh=Lt,t.Skeleton=St,t.Bone=At,t.Mesh=kt,t.LineSegments=oe,t.Line=ae,t.Points=ce,t.Group=he,t.VideoTexture=le,t.DataTexture=U,t.CompressedTexture=ue,t.CubeTexture=c,t.CanvasTexture=de,t.DepthTexture=pe,t.Texture=z,t.CompressedTextureLoader=li,t.BinaryTextureLoader=ui,t.DataTextureLoader=ui,t.CubeTextureLoader=pi,t.TextureLoader=fi,t.ObjectLoader=Vi,t.MaterialLoader=zi,t.BufferGeometryLoader=Bi,t.DefaultLoadingManager=Mo,t.LoadingManager=ci,t.JSONLoader=Hi,t.ImageLoader=di,t.FontLoader=tn,t.FileLoader=hi,t.Loader=Gi,t.Cache=wo,t.AudioLoader=en,t.SpotLightShadow=yi,t.SpotLight=xi,t.PointLight=_i,t.RectAreaLight=nn,t.HemisphereLight=gi,t.DirectionalLightShadow=bi,t.DirectionalLight=wi,t.AmbientLight=Mi,t.LightShadow=vi,t.Light=mi,t.StereoCamera=rn,t.PerspectiveCamera=Xt,t.OrthographicCamera=Yt,t.CubeCamera=an,t.Camera=ct,t.AudioListener=on,t.PositionalAudio=cn,t.AudioContext=ps,t.AudioAnalyser=hn,t.Audio=sn,t.VectorKeyframeTrack=Ri,t.StringKeyframeTrack=Ui,t.QuaternionKeyframeTrack=Ci,t.NumberKeyframeTrack=Ii,t.ColorKeyframeTrack=Di,t.BooleanKeyframeTrack=Ni,t.PropertyMixer=ln,t.PropertyBinding=un,t.KeyframeTrack=Oi,t.AnimationUtils=Ro,t.AnimationObjectGroup=dn,t.AnimationMixer=fn,t.AnimationClip=Fi,t.Uniform=mn,t.InstancedBufferGeometry=gn,t.BufferGeometry=Vt,t.GeometryIdCount=function(){return ao++},t.Geometry=st,t.InterleavedBufferAttribute=vn,t.InstancedInterleavedBuffer=xn,t.InterleavedBuffer=yn,t.InstancedBufferAttribute=_n,t.Face3=Z,t.Object3D=X,t.Raycaster=bn,t.Layers=W,t.EventDispatcher=e,t.Clock=En,t.QuaternionLinearInterpolant=Pi,t.LinearInterpolant=Si,t.DiscreteInterpolant=Ai,t.CubicInterpolant=Ti,t.Interpolant=Ei,t.Triangle=q,t.Spline=function(t){function e(t,e,i,n,r,a,o){return(2*(e-i)+(t=.5*(i-t))+(n=.5*(n-e)))*o+(-3*(e-i)-2*t-n)*a+t*r+e}this.points=t;var i,n,r,a,o,s,c,h,l,u=[],d={x:0,y:0,z:0};this.initFromArray=function(t){this.points=[];for(var e=0;e<t.length;e++)this.points[e]={x:t[e][0],y:t[e][1],z:t[e][2]}},this.getPoint=function(t){return i=(this.points.length-1)*t,n=Math.floor(i),r=i-n,u[0]=0===n?n:n-1,u[1]=n,u[2]=n>this.points.length-2?this.points.length-1:n+1,u[3]=n>this.points.length-3?this.points.length-1:n+2,s=this.points[u[0]],c=this.points[u[1]],h=this.points[u[2]],l=this.points[u[3]],o=r*(a=r*r),d.x=e(s.x,c.x,h.x,l.x,r,a,o),d.y=e(s.y,c.y,h.y,l.y,r,a,o),d.z=e(s.z,c.z,h.z,l.z,r,a,o),d},this.getControlPointsArray=function(){var t,e,i=this.points.length,n=[];for(t=0;t<i;t++)e=this.points[t],n[t]=[e.x,e.y,e.z];return n},this.getLength=function(t){var e,i,n,r=0,a=new Ct,o=new Ct,s=[],c=0;for(s[0]=0,t||(t=100),i=this.points.length*t,a.copy(this.points[0]),t=1;t<i;t++)e=t/i,n=this.getPoint(e),o.copy(n),c+=o.distanceTo(a),a.copy(n),e*=this.points.length-1,(e=Math.floor(e))!==r&&(s[e]=c,r=e);return s[s.length]=c,{chunks:s,total:c}},this.reparametrizeByArcLength=function(t){var e,i,n,r,a,o,s=[],c=new Ct,h=this.getLength();for(s.push(c.copy(this.points[0]).clone()),e=1;e<this.points.length;e++){for(i=h.chunks[e]-h.chunks[e-1],o=Math.ceil(t*i/h.total),r=(e-1)/(this.points.length-1),a=e/(this.points.length-1),i=1;i<o-1;i++)n=r+1/o*i*(a-r),n=this.getPoint(n),s.push(c.copy(n).clone());s.push(c.copy(this.points[e]).clone())}this.points=s}},t.Math=er,t.Spherical=Tn,t.Cylindrical=Sn,t.Plane=H,t.Frustum=Bt,t.Sphere=zt,t.Ray=k,t.Matrix4=It,t.Matrix3=F,t.Box3=D,t.Box2=O,t.Line3=Y,t.Euler=j,t.Vector4=Pt,t.Vector3=Ct,t.Vector2=V,t.Quaternion=s,t.Color=Nt,t.MorphBlendMesh=An,t.ImmediateRenderObject=Ln,t.VertexNormalsHelper=Rn,t.SpotLightHelper=Pn,t.SkeletonHelper=Cn,t.PointLightHelper=In,t.RectAreaLightHelper=Un,t.HemisphereLightHelper=Nn,t.GridHelper=Dn,t.PolarGridHelper=On,t.FaceNormalsHelper=Fn,t.DirectionalLightHelper=zn,t.CameraHelper=Bn,t.BoxHelper=Gn,t.ArrowHelper=Hn,t.AxisHelper=Vn,t.CatmullRomCurve3=xs,t.SplineCurve3=_s,t.CubicBezierCurve3=bs,t.QuadraticBezierCurve3=ws,t.LineCurve3=Ms,t.ArcCurve=kn,t.EllipseCurve=Xi,t.SplineCurve=Yi,t.CubicBezierCurve=qi,t.QuadraticBezierCurve=Zi,t.LineCurve=ji,t.Shape=Ji,t.ShapePath=Ki,t.Path=Qi,t.Font=$i,t.CurvePath=Wi,t.Curve=ki,t.ShapeUtils=xo,t.SceneUtils={createMultiMaterialObject:function(t,e){for(var i=new he,n=0,r=e.length;n<r;n++)i.add(new kt(t,e[n]));return i},detach:function(t,e,i){t.applyMatrix(e.matrixWorld),e.remove(t),i.add(t)},attach:function(t,e,i){var n=new It;n.getInverse(i.matrixWorld),t.applyMatrix(n),e.remove(t),i.add(t)}},t.CurveUtils=Po,t.WireframeGeometry=fe,t.ParametricGeometry=ge,t.ParametricBufferGeometry=me,t.TetrahedronGeometry=xe,t.TetrahedronBufferGeometry=ye,t.OctahedronGeometry=be,t.OctahedronBufferGeometry=_e,t.IcosahedronGeometry=Me,t.IcosahedronBufferGeometry=we,t.DodecahedronGeometry=Te,t.DodecahedronBufferGeometry=Ee,t.PolyhedronGeometry=Se,t.PolyhedronBufferGeometry=ve,t.TubeGeometry=Le,t.TubeBufferGeometry=Ae,t.TorusKnotGeometry=Pe,t.TorusKnotBufferGeometry=Re,t.TorusGeometry=Ie,t.TorusBufferGeometry=Ce,t.TextGeometry=Ne,t.SphereBufferGeometry=De,t.SphereGeometry=Oe,t.RingGeometry=ze,t.RingBufferGeometry=Fe,t.PlaneBufferGeometry=Wt,t.PlaneGeometry=Be,t.LatheGeometry=He,t.LatheBufferGeometry=Ge,t.ShapeGeometry=ke,t.ShapeBufferGeometry=Ve,t.ExtrudeGeometry=Ue,t.EdgesGeometry=je,t.ConeGeometry=Ye,t.ConeBufferGeometry=qe,t.CylinderGeometry=Xe,t.CylinderBufferGeometry=We,t.CircleBufferGeometry=Ze,t.CircleGeometry=Je,t.BoxBufferGeometry=jt,t.BoxGeometry=Qe,t.ShadowMaterial=Ke,t.SpriteMaterial=Mt,t.RawShaderMaterial=$e,t.ShaderMaterial=Ft,t.PointsMaterial=se,t.MultiMaterial=ti,t.MeshPhysicalMaterial=ii,t.MeshStandardMaterial=ei,t.MeshPhongMaterial=ni,t.MeshToonMaterial=ri,t.MeshNormalMaterial=ai,t.MeshLambertMaterial=oi,t.MeshDepthMaterial=G,t.MeshBasicMaterial=Ht,t.LineDashedMaterial=si,t.LineBasicMaterial=Rt,t.Material=N,t.Float64BufferAttribute=at,t.Float32BufferAttribute=rt,t.Uint32BufferAttribute=nt,t.Int32BufferAttribute=it,t.Uint16BufferAttribute=et,t.Int16BufferAttribute=tt,t.Uint8ClampedBufferAttribute=$,t.Uint8BufferAttribute=K,t.Int8BufferAttribute=Q,t.BufferAttribute=J,t.REVISION="83",t.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2},t.CullFaceNone=0,t.CullFaceBack=1,t.CullFaceFront=2,t.CullFaceFrontBack=3,t.FrontFaceDirectionCW=0,t.FrontFaceDirectionCCW=1,t.BasicShadowMap=0,t.PCFShadowMap=1,t.PCFSoftShadowMap=2,t.FrontSide=0,t.BackSide=1,t.DoubleSide=2,t.FlatShading=1,t.SmoothShading=2,t.NoColors=0,t.FaceColors=1,t.VertexColors=2,t.NoBlending=0,t.NormalBlending=1,t.AdditiveBlending=2,t.SubtractiveBlending=3,t.MultiplyBlending=4,t.CustomBlending=5,t.BlendingMode=Qn,t.AddEquation=100,t.SubtractEquation=101,t.ReverseSubtractEquation=102,t.MinEquation=103,t.MaxEquation=104,t.ZeroFactor=200,t.OneFactor=201,t.SrcColorFactor=202,t.OneMinusSrcColorFactor=203,t.SrcAlphaFactor=204,t.OneMinusSrcAlphaFactor=205,t.DstAlphaFactor=206,t.OneMinusDstAlphaFactor=207,t.DstColorFactor=208,t.OneMinusDstColorFactor=209,t.SrcAlphaSaturateFactor=210,t.NeverDepth=0,t.AlwaysDepth=1,t.LessDepth=2,t.LessEqualDepth=3,t.EqualDepth=4,t.GreaterEqualDepth=5,t.GreaterDepth=6,t.NotEqualDepth=7,t.MultiplyOperation=0,t.MixOperation=1,t.AddOperation=2,t.NoToneMapping=0,t.LinearToneMapping=1,t.ReinhardToneMapping=2,t.Uncharted2ToneMapping=3,t.CineonToneMapping=4,t.UVMapping=300,t.CubeReflectionMapping=301,t.CubeRefractionMapping=302,t.EquirectangularReflectionMapping=303,t.EquirectangularRefractionMapping=304,t.SphericalReflectionMapping=305,t.CubeUVReflectionMapping=306,t.CubeUVRefractionMapping=307,t.TextureMapping=Kn,t.RepeatWrapping=1e3,t.ClampToEdgeWrapping=1001,t.MirroredRepeatWrapping=1002,t.TextureWrapping=$n,t.NearestFilter=1003,t.NearestMipMapNearestFilter=1004,t.NearestMipMapLinearFilter=1005,t.LinearFilter=1006,t.LinearMipMapNearestFilter=1007,t.LinearMipMapLinearFilter=1008,t.TextureFilter=tr,t.UnsignedByteType=1009,t.ByteType=1010,t.ShortType=1011,t.UnsignedShortType=1012,t.IntType=1013,t.UnsignedIntType=1014,t.FloatType=1015,t.HalfFloatType=1016,t.UnsignedShort4444Type=1017,t.UnsignedShort5551Type=1018,t.UnsignedShort565Type=1019,t.UnsignedInt248Type=1020,t.AlphaFormat=1021,t.RGBFormat=1022,t.RGBAFormat=1023,t.LuminanceFormat=1024,t.LuminanceAlphaFormat=1025,t.RGBEFormat=1023,t.DepthFormat=1026,t.DepthStencilFormat=1027,t.RGB_S3TC_DXT1_Format=2001,t.RGBA_S3TC_DXT1_Format=2002,t.RGBA_S3TC_DXT3_Format=2003,t.RGBA_S3TC_DXT5_Format=2004,t.RGB_PVRTC_4BPPV1_Format=2100,t.RGB_PVRTC_2BPPV1_Format=2101,t.RGBA_PVRTC_4BPPV1_Format=2102,t.RGBA_PVRTC_2BPPV1_Format=2103,t.RGB_ETC1_Format=2151,t.LoopOnce=2200,t.LoopRepeat=2201,t.LoopPingPong=2202,t.InterpolateDiscrete=2300,t.InterpolateLinear=2301,t.InterpolateSmooth=2302,t.ZeroCurvatureEnding=2400,t.ZeroSlopeEnding=2401,t.WrapAroundEnding=2402,t.TrianglesDrawMode=0,t.TriangleStripDrawMode=1,t.TriangleFanDrawMode=2,t.LinearEncoding=3e3,t.sRGBEncoding=3001,t.GammaEncoding=3007,t.RGBEEncoding=3002,t.LogLuvEncoding=3003,t.RGBM7Encoding=3004,t.RGBM16Encoding=3005,t.RGBDEncoding=3006,t.BasicDepthPacking=3200,t.RGBADepthPacking=3201,t.CubeGeometry=Qe,t.Face4=function(t,e,i,n,r,a,o){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new Z(t,e,i,r,a,o)},t.LineStrip=0,t.LinePieces=1,t.MeshFaceMaterial=function(t){return console.warn("THREE.MeshFaceMaterial has been renamed to THREE.MultiMaterial."),new ti(t)},t.PointCloud=function(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new ce(t,e)},t.Particle=function(t){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new Et(t)},t.ParticleSystem=function(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new ce(t,e)},t.PointCloudMaterial=function(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new se(t)},t.ParticleBasicMaterial=function(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new se(t)},t.ParticleSystemMaterial=function(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new se(t)},t.Vertex=function(t,e,i){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new Ct(t,e,i)},t.DynamicBufferAttribute=function(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new J(t,e).setDynamic(!0)},t.Int8Attribute=function(t,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new Q(t,e)},t.Uint8Attribute=function(t,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new K(t,e)},t.Uint8ClampedAttribute=function(t,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new $(t,e)},t.Int16Attribute=function(t,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new tt(t,e)},t.Uint16Attribute=function(t,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new et(t,e)},t.Int32Attribute=function(t,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new it(t,e)},t.Uint32Attribute=function(t,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new nt(t,e)},t.Float32Attribute=function(t,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new rt(t,e)},t.Float64Attribute=function(t,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new at(t,e)},t.ClosedSplineCurve3=jn,t.BoundingBoxHelper=function(t,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Gn(t,e)},t.EdgesHelper=function(t,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new oe(new je(t.geometry),new Rt({color:void 0!==e?e:16777215}))},t.WireframeHelper=function(t,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new oe(new fe(t.geometry),new Rt({color:void 0!==e?e:16777215}))},t.XHRLoader=function(t){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new hi(t)},t.GeometryUtils={merge:function(t,e,i){var n;console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),e.isMesh&&(e.matrixAutoUpdate&&e.updateMatrix(),n=e.matrix,e=e.geometry),t.merge(e,n,i)},center:function(t){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),t.center()}},t.ImageUtils={crossOrigin:void 0,loadTexture:function(t,e,i,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var r=new fi;return r.setCrossOrigin(this.crossOrigin),t=r.load(t,i,void 0,n),e&&(t.mapping=e),t},loadTextureCube:function(t,e,i,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var r=new pi;return r.setCrossOrigin(this.crossOrigin),t=r.load(t,i,void 0,n),e&&(t.mapping=e),t},loadCompressedTexture:function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")}},t.Projector=function(){console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(t,e){console.warn("THREE.Projector: .projectVector() is now vector.project()."),t.project(e)},this.unprojectVector=function(t,e){console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),t.unproject(e)},this.pickingRay=function(){console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}},t.CanvasRenderer=function(){console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),this.domElement=document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),this.clear=function(){},this.render=function(){},this.setClearColor=function(){},this.setSize=function(){}},Object.defineProperty(t,"__esModule",{value:!0})})</script><script>var _gsScope="undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window;(_gsScope._gsQueue||(_gsScope._gsQueue=[])).push(function(){"use strict";var t,l,e,w,x,b,P,g,i,v,O,y,T,f,p,m,s;_gsScope._gsDefine("TweenMax",["core.Animation","core.SimpleTimeline","TweenLite"],function(s,_,m){var g=function(t){var e,i=[],s=t.length;for(e=0;e!==s;i.push(t[e++]));return i},v=function(t,e,i){var s,r,n=t.cycle;for(s in n)r=n[s],t[s]="function"==typeof r?r.call(e[i],i):r[i%r.length];delete t.cycle},y=function(t,e,i){m.call(this,t,e,i),this._cycle=0,this._yoyo=!0===this.vars.yoyo,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._dirty=!0,this.render=y.prototype.render},T=1e-10,x=m._internals,b=x.isSelector,w=x.isArray,t=y.prototype=m.to({},.1,{}),P=[];y.version="1.18.0",t.constructor=y,t.kill()._gc=!1,y.killTweensOf=y.killDelayedCallsTo=m.killTweensOf,y.getTweensOf=m.getTweensOf,y.lagSmoothing=m.lagSmoothing,y.ticker=m.ticker,y.render=m.render,t.invalidate=function(){return this._yoyo=!0===this.vars.yoyo,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._uncache(!0),m.prototype.invalidate.call(this)},t.updateTo=function(t,e){var i,s=this.ratio,r=this.vars.immediateRender||t.immediateRender;for(i in e&&this._startTime<this._timeline._time&&(this._startTime=this._timeline._time,this._uncache(!1),this._gc?this._enabled(!0,!1):this._timeline.insert(this,this._startTime-this._delay)),t)this.vars[i]=t[i];if(this._initted||r)if(e)this._initted=!1,r&&this.render(0,!0,!0);else if(this._gc&&this._enabled(!0,!1),this._notifyPluginsOfEnabled&&this._firstPT&&m._onPluginEvent("_onDisable",this),.998<this._time/this._duration){var n=this._time;this.render(0,!0,!1),this._initted=!1,this.render(n,!0,!1)}else if(0<this._time||r){this._initted=!1,this._init();for(var a,o=1/(1-s),l=this._firstPT;l;)a=l.s+l.c,l.c*=o,l.s=a-l.c,l=l._next}return this},t.render=function(t,e,i){this._initted||0===this._duration&&this.vars.repeat&&this.invalidate();var s,r,n,a,o,l,h,_,u=this._dirty?this.totalDuration():this._totalDuration,c=this._time,f=this._totalTime,p=this._cycle,d=this._duration,m=this._rawPrevTime;if(u<=t?(this._totalTime=u,this._cycle=this._repeat,this._yoyo&&0!=(1&this._cycle)?(this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0):(this._time=d,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1),this._reversed||(s=!0,r="onComplete",i=i||this._timeline.autoRemoveChildren),0===d&&(this._initted||!this.vars.lazy||i)&&(this._startTime===this._timeline._duration&&(t=0),(0===t||m<0||m===T)&&m!==t&&(i=!0,T<m&&(r="onReverseComplete")),this._rawPrevTime=_=!e||t||m===t?t:T)):t<1e-7?(this._totalTime=this._time=this._cycle=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0,(0!==f||0===d&&0<m)&&(r="onReverseComplete",s=this._reversed),t<0&&(this._active=!1,0===d&&(this._initted||!this.vars.lazy||i)&&(0<=m&&(i=!0),this._rawPrevTime=_=!e||t||m===t?t:T)),this._initted||(i=!0)):(this._totalTime=this._time=t,0!==this._repeat&&(a=d+this._repeatDelay,this._cycle=this._totalTime/a>>0,0!==this._cycle&&this._cycle===this._totalTime/a&&this._cycle--,this._time=this._totalTime-this._cycle*a,this._yoyo&&0!=(1&this._cycle)&&(this._time=d-this._time),this._time>d?this._time=d:this._time<0&&(this._time=0)),this._easeType?(o=this._time/d,(1===(l=this._easeType)||3===l&&.5<=o)&&(o=1-o),3===l&&(o*=2),1===(h=this._easePower)?o*=o:2===h?o*=o*o:3===h?o*=o*o*o:4===h&&(o*=o*o*o*o),this.ratio=1===l?1-o:2===l?o:this._time/d<.5?o/2:1-o/2):this.ratio=this._ease.getRatio(this._time/d)),c!==this._time||i||p!==this._cycle){if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!i&&this._firstPT&&(!1!==this.vars.lazy&&this._duration||this.vars.lazy&&!this._duration))return this._time=c,this._totalTime=f,this._rawPrevTime=m,this._cycle=p,x.lazyTweens.push(this),void(this._lazy=[t,e]);this._time&&!s?this.ratio=this._ease.getRatio(this._time/d):s&&this._ease._calcEnd&&(this.ratio=this._ease.getRatio(0===this._time?0:1))}for(!1!==this._lazy&&(this._lazy=!1),this._active||!this._paused&&this._time!==c&&0<=t&&(this._active=!0),0===f&&(2===this._initted&&0<t&&this._init(),this._startAt&&(0<=t?this._startAt.render(t,e,i):r||(r="_dummyGS")),this.vars.onStart&&(0!==this._totalTime||0===d)&&(e||this._callback("onStart"))),n=this._firstPT;n;)n.f?n.t[n.p](n.c*this.ratio+n.s):n.t[n.p]=n.c*this.ratio+n.s,n=n._next;this._onUpdate&&(t<0&&this._startAt&&this._startTime&&this._startAt.render(t,e,i),e||(this._totalTime!==f||s)&&this._callback("onUpdate")),this._cycle!==p&&(e||this._gc||this.vars.onRepeat&&this._callback("onRepeat")),r&&(!this._gc||i)&&(t<0&&this._startAt&&!this._onUpdate&&this._startTime&&this._startAt.render(t,e,i),s&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[r]&&this._callback(r),0===d&&this._rawPrevTime===T&&_!==T&&(this._rawPrevTime=0))}else f!==this._totalTime&&this._onUpdate&&(e||this._callback("onUpdate"))},y.to=function(t,e,i){return new y(t,e,i)},y.from=function(t,e,i){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,new y(t,e,i)},y.fromTo=function(t,e,i,s){return s.startAt=i,s.immediateRender=0!=s.immediateRender&&0!=i.immediateRender,new y(t,e,s)},y.staggerTo=y.allTo=function(t,e,i,s,r,n,a){s=s||0;var o,l,h,_,u=i.delay||0,c=[],f=function(){i.onComplete&&i.onComplete.apply(i.onCompleteScope||this,arguments),r.apply(a||i.callbackScope||this,n||P)},p=i.cycle,d=i.startAt&&i.startAt.cycle;for(w(t)||("string"==typeof t&&(t=m.selector(t)||t),b(t)&&(t=g(t))),t=t||[],s<0&&((t=g(t)).reverse(),s*=-1),o=t.length-1,h=0;h<=o;h++){for(_ in l={},i)l[_]=i[_];if(p&&v(l,t,h),d){for(_ in d=l.startAt={},i.startAt)d[_]=i.startAt[_];v(l.startAt,t,h)}l.delay=u,h===o&&r&&(l.onComplete=f),c[h]=new y(t[h],e,l),u+=s}return c},y.staggerFrom=y.allFrom=function(t,e,i,s,r,n,a){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,y.staggerTo(t,e,i,s,r,n,a)},y.staggerFromTo=y.allFromTo=function(t,e,i,s,r,n,a,o){return s.startAt=i,s.immediateRender=0!=s.immediateRender&&0!=i.immediateRender,y.staggerTo(t,e,s,r,n,a,o)},y.delayedCall=function(t,e,i,s,r){return new y(e,0,{delay:t,onComplete:e,onCompleteParams:i,callbackScope:s,onReverseComplete:e,onReverseCompleteParams:i,immediateRender:!1,useFrames:r,overwrite:0})},y.set=function(t,e){return new y(t,0,e)},y.isTweening=function(t){return 0<m.getTweensOf(t,!0).length};var n=function(t,e){for(var i=[],s=0,r=t._first;r;)r instanceof m?i[s++]=r:(e&&(i[s++]=r),s=(i=i.concat(n(r,e))).length),r=r._next;return i},u=y.getAllTweens=function(t){return n(s._rootTimeline,t).concat(n(s._rootFramesTimeline,t))};y.killAll=function(t,e,i,s){null==e&&(e=!0),null==i&&(i=!0);var r,n,a,o=u(0!=s),l=o.length,h=e&&i&&s;for(a=0;a<l;a++)n=o[a],(h||n instanceof _||(r=n.target===n.vars.onComplete)&&i||e&&!r)&&(t?n.totalTime(n._reversed?0:n.totalDuration()):n._enabled(!1,!1))},y.killChildTweensOf=function(t,e){if(null!=t){var i,s,r,n,a,o=x.tweenLookup;if("string"==typeof t&&(t=m.selector(t)||t),b(t)&&(t=g(t)),w(t))for(n=t.length;-1<--n;)y.killChildTweensOf(t[n],e);else{for(r in i=[],o)for(s=o[r].target.parentNode;s;)s===t&&(i=i.concat(o[r].tweens)),s=s.parentNode;for(a=i.length,n=0;n<a;n++)e&&i[n].totalTime(i[n].totalDuration()),i[n]._enabled(!1,!1)}}};var r=function(t,e,i,s){e=!1!==e,i=!1!==i;for(var r,n,a=u(s=!1!==s),o=e&&i&&s,l=a.length;-1<--l;)n=a[l],(o||n instanceof _||(r=n.target===n.vars.onComplete)&&i||e&&!r)&&n.paused(t)};return y.pauseAll=function(t,e,i){r(!0,t,e,i)},y.resumeAll=function(t,e,i){r(!1,t,e,i)},y.globalTimeScale=function(t){var e=s._rootTimeline,i=m.ticker.time;return arguments.length?(t=t||T,e._startTime=i-(i-e._startTime)*e._timeScale/t,e=s._rootFramesTimeline,i=m.ticker.frame,e._startTime=i-(i-e._startTime)*e._timeScale/t,e._timeScale=s._rootTimeline._timeScale=t,t):e._timeScale},t.progress=function(t){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&0!=(1&this._cycle)?1-t:t)+this._cycle*(this._duration+this._repeatDelay),!1):this._time/this.duration()},t.totalProgress=function(t){return arguments.length?this.totalTime(this.totalDuration()*t,!1):this._totalTime/this.totalDuration()},t.time=function(t,e){return arguments.length?(this._dirty&&this.totalDuration(),t>this._duration&&(t=this._duration),this._yoyo&&0!=(1&this._cycle)?t=this._duration-t+this._cycle*(this._duration+this._repeatDelay):0!==this._repeat&&(t+=this._cycle*(this._duration+this._repeatDelay)),this.totalTime(t,e)):this._time},t.duration=function(t){return arguments.length?s.prototype.duration.call(this,t):this._duration},t.totalDuration=function(t){return arguments.length?-1===this._repeat?this:this.duration((t-this._repeat*this._repeatDelay)/(this._repeat+1)):(this._dirty&&(this._totalDuration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatDelay*this._repeat,this._dirty=!1),this._totalDuration)},t.repeat=function(t){return arguments.length?(this._repeat=t,this._uncache(!0)):this._repeat},t.repeatDelay=function(t){return arguments.length?(this._repeatDelay=t,this._uncache(!0)):this._repeatDelay},t.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},y},!0),_gsScope._gsDefine("TimelineLite",["core.Animation","core.SimpleTimeline","TweenLite"],function(_,u,c){var f=function(t){u.call(this,t),this._labels={},this.autoRemoveChildren=!0===this.vars.autoRemoveChildren,this.smoothChildTiming=!0===this.vars.smoothChildTiming,this._sortChildren=!0,this._onUpdate=this.vars.onUpdate;var e,i,s=this.vars;for(i in s)e=s[i],m(e)&&-1!==e.join("").indexOf("{self}")&&(s[i]=this._swapSelfInParams(e));m(s.tweens)&&this.add(s.tweens,0,s.align,s.stagger)},p=1e-10,t=c._internals,e=f._internals={},d=t.isSelector,m=t.isArray,g=t.lazyTweens,v=t.lazyRender,a=_gsScope._gsDefine.globals,y=function(t){var e,i={};for(e in t)i[e]=t[e];return i},T=function(t,e,i){var s,r,n=t.cycle;for(s in n)r=n[s],t[s]="function"==typeof r?r.call(e[i],i):r[i%r.length];delete t.cycle},n=e.pauseCallback=function(){},x=function(t){var e,i=[],s=t.length;for(e=0;e!==s;i.push(t[e++]));return i},i=f.prototype=new u;return f.version="1.18.0",i.constructor=f,i.kill()._gc=i._forcingPlayhead=i._hasPause=!1,i.to=function(t,e,i,s){var r=i.repeat&&a.TweenMax||c;return e?this.add(new r(t,e,i),s):this.set(t,i,s)},i.from=function(t,e,i,s){return this.add((i.repeat&&a.TweenMax||c).from(t,e,i),s)},i.fromTo=function(t,e,i,s,r){var n=s.repeat&&a.TweenMax||c;return e?this.add(n.fromTo(t,e,i,s),r):this.set(t,s,r)},i.staggerTo=function(t,e,i,s,r,n,a,o){var l,h,_=new f({onComplete:n,onCompleteParams:a,callbackScope:o,smoothChildTiming:this.smoothChildTiming}),u=i.cycle;for("string"==typeof t&&(t=c.selector(t)||t),d(t=t||[])&&(t=x(t)),(s=s||0)<0&&((t=x(t)).reverse(),s*=-1),h=0;t.length>h;h++)(l=y(i)).startAt&&(l.startAt=y(l.startAt),l.startAt.cycle&&T(l.startAt,t,h)),u&&T(l,t,h),_.to(t[h],e,l,h*s);return this.add(_,r)},i.staggerFrom=function(t,e,i,s,r,n,a,o){return i.immediateRender=0!=i.immediateRender,i.runBackwards=!0,this.staggerTo(t,e,i,s,r,n,a,o)},i.staggerFromTo=function(t,e,i,s,r,n,a,o,l){return s.startAt=i,s.immediateRender=0!=s.immediateRender&&0!=i.immediateRender,this.staggerTo(t,e,s,r,n,a,o,l)},i.call=function(t,e,i,s){return this.add(c.delayedCall(0,t,e,i),s)},i.set=function(t,e,i){return i=this._parseTimeOrLabel(i,0,!0),null==e.immediateRender&&(e.immediateRender=i===this._time&&!this._paused),this.add(new c(t,0,e),i)},f.exportRoot=function(t,e){null==(t=t||{}).smoothChildTiming&&(t.smoothChildTiming=!0);var i,s,r=new f(t),n=r._timeline;for(null==e&&(e=!0),n._remove(r,!0),r._startTime=0,r._rawPrevTime=r._time=r._totalTime=n._time,i=n._first;i;)s=i._next,e&&i instanceof c&&i.target===i.vars.onComplete||r.add(i,i._startTime-i._delay),i=s;return n.add(r,0),r},i.add=function(t,e,i,s){var r,n,a,o,l,h;if("number"!=typeof e&&(e=this._parseTimeOrLabel(e,0,!0,t)),!(t instanceof _)){if(t instanceof Array||t&&t.push&&m(t)){for(i=i||"normal",s=s||0,r=e,n=t.length,a=0;a<n;a++)m(o=t[a])&&(o=new f({tweens:o})),this.add(o,r),"string"!=typeof o&&"function"!=typeof o&&("sequence"===i?r=o._startTime+o.totalDuration()/o._timeScale:"start"===i&&(o._startTime-=o.delay())),r+=s;return this._uncache(!0)}if("string"==typeof t)return this.addLabel(t,e);if("function"!=typeof t)throw"Cannot add "+t+" into the timeline; it is not a tween, timeline, function, or string.";t=c.delayedCall(0,t)}if(u.prototype.add.call(this,t,e),(this._gc||this._time===this._duration)&&!this._paused&&this._duration<this.duration())for(h=(l=this).rawTime()>t._startTime;l._timeline;)h&&l._timeline.smoothChildTiming?l.totalTime(l._totalTime,!0):l._gc&&l._enabled(!0,!1),l=l._timeline;return this},i.remove=function(t){if(t instanceof _){this._remove(t,!1);var e=t._timeline=t.vars.useFrames?_._rootFramesTimeline:_._rootTimeline;return t._startTime=(t._paused?t._pauseTime:e._time)-(t._reversed?t.totalDuration()-t._totalTime:t._totalTime)/t._timeScale,this}if(t instanceof Array||t&&t.push&&m(t)){for(var i=t.length;-1<--i;)this.remove(t[i]);return this}return"string"==typeof t?this.removeLabel(t):this.kill(null,t)},i._remove=function(t,e){u.prototype._remove.call(this,t,e);var i=this._last;return i?this._time>i._startTime+i._totalDuration/i._timeScale&&(this._time=this.duration(),this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},i.append=function(t,e){return this.add(t,this._parseTimeOrLabel(null,e,!0,t))},i.insert=i.insertMultiple=function(t,e,i,s){return this.add(t,e||0,i,s)},i.appendMultiple=function(t,e,i,s){return this.add(t,this._parseTimeOrLabel(null,e,!0,t),i,s)},i.addLabel=function(t,e){return this._labels[t]=this._parseTimeOrLabel(e),this},i.addPause=function(t,e,i,s){var r=c.delayedCall(0,n,i,s||this);return r.vars.onComplete=r.vars.onReverseComplete=e,r.data="isPause",this._hasPause=!0,this.add(r,t)},i.removeLabel=function(t){return delete this._labels[t],this},i.getLabelTime=function(t){return null!=this._labels[t]?this._labels[t]:-1},i._parseTimeOrLabel=function(t,e,i,s){var r;if(s instanceof _&&s.timeline===this)this.remove(s);else if(s&&(s instanceof Array||s.push&&m(s)))for(r=s.length;-1<--r;)s[r]instanceof _&&s[r].timeline===this&&this.remove(s[r]);if("string"==typeof e)return this._parseTimeOrLabel(e,i&&"number"==typeof t&&null==this._labels[e]?t-this.duration():0,i);if(e=e||0,"string"!=typeof t||!isNaN(t)&&null==this._labels[t])null==t&&(t=this.duration());else{if(-1===(r=t.indexOf("=")))return null==this._labels[t]?i?this._labels[t]=this.duration()+e:e:this._labels[t]+e;e=parseInt(t.charAt(r-1)+"1",10)*Number(t.substr(r+1)),t=1<r?this._parseTimeOrLabel(t.substr(0,r-1),0,i):this.duration()}return Number(t)+e},i.seek=function(t,e){return this.totalTime("number"==typeof t?t:this._parseTimeOrLabel(t),!1!==e)},i.stop=function(){return this.paused(!0)},i.gotoAndPlay=function(t,e){return this.play(t,e)},i.gotoAndStop=function(t,e){return this.pause(t,e)},i.render=function(t,e,i){this._gc&&this._enabled(!0,!1);var s,r,n,a,o,l,h=this._dirty?this.totalDuration():this._totalDuration,_=this._time,u=this._startTime,c=this._timeScale,f=this._paused;if(h<=t)this._totalTime=this._time=h,this._reversed||this._hasPausedChild()||(r=!0,a="onComplete",o=!!this._timeline.autoRemoveChildren,0===this._duration&&(0===t||this._rawPrevTime<0||this._rawPrevTime===p)&&this._rawPrevTime!==t&&this._first&&(o=!0,this._rawPrevTime>p&&(a="onReverseComplete"))),this._rawPrevTime=this._duration||!e||t||this._rawPrevTime===t?t:p,t=h+1e-4;else if(t<1e-7)if(this._totalTime=this._time=0,(0!==_||0===this._duration&&this._rawPrevTime!==p&&(0<this._rawPrevTime||t<0&&0<=this._rawPrevTime))&&(a="onReverseComplete",r=this._reversed),t<0)this._active=!1,this._timeline.autoRemoveChildren&&this._reversed?(o=r=!0,a="onReverseComplete"):0<=this._rawPrevTime&&this._first&&(o=!0),this._rawPrevTime=t;else{if(this._rawPrevTime=this._duration||!e||t||this._rawPrevTime===t?t:p,0===t&&r)for(s=this._first;s&&0===s._startTime;)s._duration||(r=!1),s=s._next;t=0,this._initted||(o=!0)}else{if(this._hasPause&&!this._forcingPlayhead&&!e){if(_<=t)for(s=this._first;s&&t>=s._startTime&&!l;)s._duration||"isPause"!==s.data||s.ratio||0===s._startTime&&0===this._rawPrevTime||(l=s),s=s._next;else for(s=this._last;s&&s._startTime>=t&&!l;)s._duration||"isPause"===s.data&&0<s._rawPrevTime&&(l=s),s=s._prev;l&&(this._time=t=l._startTime,this._totalTime=t+this._cycle*(this._totalDuration+this._repeatDelay))}this._totalTime=this._time=this._rawPrevTime=t}if(this._time!==_&&this._first||i||o||l){if(this._initted||(this._initted=!0),this._active||!this._paused&&this._time!==_&&0<t&&(this._active=!0),0===_&&this.vars.onStart&&0!==this._time&&(e||this._callback("onStart")),this._time>=_)for(s=this._first;s&&(n=s._next,!this._paused||f);)(s._active||s._startTime<=this._time&&!s._paused&&!s._gc)&&(l===s&&this.pause(),s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)),s=n;else for(s=this._last;s&&(n=s._prev,!this._paused||f);){if(s._active||_>=s._startTime&&!s._paused&&!s._gc){if(l===s){for(l=s._prev;l&&l.endTime()>this._time;)l.render(l._reversed?l.totalDuration()-(t-l._startTime)*l._timeScale:(t-l._startTime)*l._timeScale,e,i),l=l._prev;l=null,this.pause()}s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)}s=n}this._onUpdate&&(e||(g.length&&v(),this._callback("onUpdate"))),a&&(this._gc||(u===this._startTime||c!==this._timeScale)&&(0===this._time||h>=this.totalDuration())&&(r&&(g.length&&v(),this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[a]&&this._callback(a)))}},i._hasPausedChild=function(){for(var t=this._first;t;){if(t._paused||t instanceof f&&t._hasPausedChild())return!0;t=t._next}return!1},i.getChildren=function(t,e,i,s){s=s||-9999999999;for(var r=[],n=this._first,a=0;n;)s>n._startTime||(n instanceof c?!1!==e&&(r[a++]=n):(!1!==i&&(r[a++]=n),!1!==t&&(a=(r=r.concat(n.getChildren(!0,e,i))).length))),n=n._next;return r},i.getTweensOf=function(t,e){var i,s,r=this._gc,n=[],a=0;for(r&&this._enabled(!0,!0),s=(i=c.getTweensOf(t)).length;-1<--s;)(i[s].timeline===this||e&&this._contains(i[s]))&&(n[a++]=i[s]);return r&&this._enabled(!1,!0),n},i.recent=function(){return this._recent},i._contains=function(t){for(var e=t.timeline;e;){if(e===this)return!0;e=e.timeline}return!1},i.shiftChildren=function(t,e,i){i=i||0;for(var s,r=this._first,n=this._labels;r;)r._startTime>=i&&(r._startTime+=t),r=r._next;if(e)for(s in n)n[s]>=i&&(n[s]+=t);return this._uncache(!0)},i._kill=function(t,e){if(!t&&!e)return this._enabled(!1,!1);for(var i=e?this.getTweensOf(e):this.getChildren(!0,!0,!1),s=i.length,r=!1;-1<--s;)i[s]._kill(t,e)&&(r=!0);return r},i.clear=function(t){var e=this.getChildren(!1,!0,!0),i=e.length;for(this._time=this._totalTime=0;-1<--i;)e[i]._enabled(!1,!1);return!1!==t&&(this._labels={}),this._uncache(!0)},i.invalidate=function(){for(var t=this._first;t;)t.invalidate(),t=t._next;return _.prototype.invalidate.call(this)},i._enabled=function(t,e){if(t===this._gc)for(var i=this._first;i;)i._enabled(t,!0),i=i._next;return u.prototype._enabled.call(this,t,e)},i.totalTime=function(){this._forcingPlayhead=!0;var t=_.prototype.totalTime.apply(this,arguments);return this._forcingPlayhead=!1,t},i.duration=function(t){return arguments.length?(0!==this.duration()&&0!==t&&this.timeScale(this._duration/t),this):(this._dirty&&this.totalDuration(),this._duration)},i.totalDuration=function(t){if(arguments.length)return 0!==this.totalDuration()&&0!==t&&this.timeScale(this._totalDuration/t),this;if(this._dirty){for(var e,i,s=0,r=this._last,n=999999999999;r;)e=r._prev,r._dirty&&r.totalDuration(),r._startTime>n&&this._sortChildren&&!r._paused?this.add(r,r._startTime-r._delay):n=r._startTime,r._startTime<0&&!r._paused&&(s-=r._startTime,this._timeline.smoothChildTiming&&(this._startTime+=r._startTime/this._timeScale),this.shiftChildren(-r._startTime,!1,-9999999999),n=0),s<(i=r._startTime+r._totalDuration/r._timeScale)&&(s=i),r=e;this._duration=this._totalDuration=s,this._dirty=!1}return this._totalDuration},i.paused=function(t){if(!t)for(var e=this._first,i=this._time;e;)e._startTime===i&&"isPause"===e.data&&(e._rawPrevTime=0),e=e._next;return _.prototype.paused.apply(this,arguments)},i.usesFrames=function(){for(var t=this._timeline;t._timeline;)t=t._timeline;return t===_._rootFramesTimeline},i.rawTime=function(){return this._paused?this._totalTime:(this._timeline.rawTime()-this._startTime)*this._timeScale},f},!0),_gsScope._gsDefine("TimelineMax",["TimelineLite","TweenLite","easing.Ease"],function(e,a,t){var i=function(t){e.call(this,t),this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._cycle=0,this._yoyo=!0===this.vars.yoyo,this._dirty=!0},O=1e-10,s=a._internals,S=s.lazyTweens,k=s.lazyRender,o=new t(null,null,1,0),r=i.prototype=new e;return r.constructor=i,r.kill()._gc=!1,i.version="1.18.0",r.invalidate=function(){return this._yoyo=!0===this.vars.yoyo,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._uncache(!0),e.prototype.invalidate.call(this)},r.addCallback=function(t,e,i,s){return this.add(a.delayedCall(0,t,i,s),e)},r.removeCallback=function(t,e){if(t)if(null==e)this._kill(null,t);else for(var i=this.getTweensOf(t,!1),s=i.length,r=this._parseTimeOrLabel(e);-1<--s;)i[s]._startTime===r&&i[s]._enabled(!1,!1);return this},r.removePause=function(t){return this.removeCallback(e._internals.pauseCallback,t)},r.tweenTo=function(t,e){e=e||{};var i,s,r,n={ease:o,useFrames:this.usesFrames(),immediateRender:!1};for(s in e)n[s]=e[s];return n.time=this._parseTimeOrLabel(t),i=Math.abs(Number(n.time)-this._time)/this._timeScale||.001,r=new a(this,i,n),n.onStart=function(){r.target.paused(!0),r.vars.time!==r.target.time()&&i===r.duration()&&r.duration(Math.abs(r.vars.time-r.target.time())/r.target._timeScale),e.onStart&&r._callback("onStart")},r},r.tweenFromTo=function(t,e,i){i=i||{},t=this._parseTimeOrLabel(t),i.startAt={onComplete:this.seek,onCompleteParams:[t],callbackScope:this},i.immediateRender=!1!==i.immediateRender;var s=this.tweenTo(e,i);return s.duration(Math.abs(s.vars.time-t)/this._timeScale||.001)},r.render=function(t,e,i){this._gc&&this._enabled(!0,!1);var s,r,n,a,o,l,h,_=this._dirty?this.totalDuration():this._totalDuration,u=this._duration,c=this._time,f=this._totalTime,p=this._startTime,d=this._timeScale,m=this._rawPrevTime,g=this._paused,v=this._cycle;if(_<=t)this._locked||(this._totalTime=_,this._cycle=this._repeat),this._reversed||this._hasPausedChild()||(r=!0,a="onComplete",o=!!this._timeline.autoRemoveChildren,0===this._duration&&(0===t||m<0||m===O)&&m!==t&&this._first&&(o=!0,O<m&&(a="onReverseComplete"))),this._rawPrevTime=this._duration||!e||t||this._rawPrevTime===t?t:O,this._yoyo&&0!=(1&this._cycle)?this._time=t=0:t=(this._time=u)+1e-4;else if(t<1e-7)if(this._locked||(this._totalTime=this._cycle=0),((this._time=0)!==c||0===u&&m!==O&&(0<m||t<0&&0<=m)&&!this._locked)&&(a="onReverseComplete",r=this._reversed),t<0)this._active=!1,this._timeline.autoRemoveChildren&&this._reversed?(o=r=!0,a="onReverseComplete"):0<=m&&this._first&&(o=!0),this._rawPrevTime=t;else{if(this._rawPrevTime=u||!e||t||this._rawPrevTime===t?t:O,0===t&&r)for(s=this._first;s&&0===s._startTime;)s._duration||(r=!1),s=s._next;t=0,this._initted||(o=!0)}else if(0===u&&m<0&&(o=!0),this._time=this._rawPrevTime=t,this._locked||(this._totalTime=t,0!==this._repeat&&(l=u+this._repeatDelay,this._cycle=this._totalTime/l>>0,0!==this._cycle&&this._cycle===this._totalTime/l&&this._cycle--,this._time=this._totalTime-this._cycle*l,this._yoyo&&0!=(1&this._cycle)&&(this._time=u-this._time),this._time>u?t=(this._time=u)+1e-4:this._time<0?this._time=t=0:t=this._time)),this._hasPause&&!this._forcingPlayhead&&!e){if(c<=(t=this._time))for(s=this._first;s&&t>=s._startTime&&!h;)s._duration||"isPause"!==s.data||s.ratio||0===s._startTime&&0===this._rawPrevTime||(h=s),s=s._next;else for(s=this._last;s&&s._startTime>=t&&!h;)s._duration||"isPause"===s.data&&0<s._rawPrevTime&&(h=s),s=s._prev;h&&(this._time=t=h._startTime,this._totalTime=t+this._cycle*(this._totalDuration+this._repeatDelay))}if(this._cycle!==v&&!this._locked){var y=this._yoyo&&0!=(1&v),T=y===(this._yoyo&&0!=(1&this._cycle)),x=this._totalTime,b=this._cycle,w=this._rawPrevTime,P=this._time;if(this._totalTime=v*u,v>this._cycle?y=!y:this._totalTime+=u,this._time=c,this._rawPrevTime=0===u?m-1e-4:m,this._cycle=v,this._locked=!0,c=y?0:u,this.render(c,e,0===u),e||this._gc||this.vars.onRepeat&&this._callback("onRepeat"),T&&(c=y?u+1e-4:-1e-4,this.render(c,!0,!1)),this._locked=!1,this._paused&&!g)return;this._time=P,this._totalTime=x,this._cycle=b,this._rawPrevTime=w}if(this._time!==c&&this._first||i||o||h){if(this._initted||(this._initted=!0),this._active||!this._paused&&this._totalTime!==f&&0<t&&(this._active=!0),0===f&&this.vars.onStart&&0!==this._totalTime&&(e||this._callback("onStart")),this._time>=c)for(s=this._first;s&&(n=s._next,!this._paused||g);)(s._active||s._startTime<=this._time&&!s._paused&&!s._gc)&&(h===s&&this.pause(),s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)),s=n;else for(s=this._last;s&&(n=s._prev,!this._paused||g);){if(s._active||c>=s._startTime&&!s._paused&&!s._gc){if(h===s){for(h=s._prev;h&&h.endTime()>this._time;)h.render(h._reversed?h.totalDuration()-(t-h._startTime)*h._timeScale:(t-h._startTime)*h._timeScale,e,i),h=h._prev;h=null,this.pause()}s._reversed?s.render((s._dirty?s.totalDuration():s._totalDuration)-(t-s._startTime)*s._timeScale,e,i):s.render((t-s._startTime)*s._timeScale,e,i)}s=n}this._onUpdate&&(e||(S.length&&k(),this._callback("onUpdate"))),a&&(this._locked||this._gc||(p===this._startTime||d!==this._timeScale)&&(0===this._time||_>=this.totalDuration())&&(r&&(S.length&&k(),this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[a]&&this._callback(a)))}else f!==this._totalTime&&this._onUpdate&&(e||this._callback("onUpdate"))},r.getActive=function(t,e,i){null==t&&(t=!0),null==e&&(e=!0),null==i&&(i=!1);var s,r,n=[],a=this.getChildren(t,e,i),o=0,l=a.length;for(s=0;s<l;s++)(r=a[s]).isActive()&&(n[o++]=r);return n},r.getLabelAfter=function(t){t||0!==t&&(t=this._time);var e,i=this.getLabelsArray(),s=i.length;for(e=0;e<s;e++)if(i[e].time>t)return i[e].name;return null},r.getLabelBefore=function(t){null==t&&(t=this._time);for(var e=this.getLabelsArray(),i=e.length;-1<--i;)if(t>e[i].time)return e[i].name;return null},r.getLabelsArray=function(){var t,e=[],i=0;for(t in this._labels)e[i++]={time:this._labels[t],name:t};return e.sort(function(t,e){return t.time-e.time}),e},r.progress=function(t,e){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&0!=(1&this._cycle)?1-t:t)+this._cycle*(this._duration+this._repeatDelay),e):this._time/this.duration()},r.totalProgress=function(t,e){return arguments.length?this.totalTime(this.totalDuration()*t,e):this._totalTime/this.totalDuration()},r.totalDuration=function(t){return arguments.length?-1===this._repeat?this:this.duration((t-this._repeat*this._repeatDelay)/(this._repeat+1)):(this._dirty&&(e.prototype.totalDuration.call(this),this._totalDuration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatDelay*this._repeat),this._totalDuration)},r.time=function(t,e){return arguments.length?(this._dirty&&this.totalDuration(),t>this._duration&&(t=this._duration),this._yoyo&&0!=(1&this._cycle)?t=this._duration-t+this._cycle*(this._duration+this._repeatDelay):0!==this._repeat&&(t+=this._cycle*(this._duration+this._repeatDelay)),this.totalTime(t,e)):this._time},r.repeat=function(t){return arguments.length?(this._repeat=t,this._uncache(!0)):this._repeat},r.repeatDelay=function(t){return arguments.length?(this._repeatDelay=t,this._uncache(!0)):this._repeatDelay},r.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},r.currentLabel=function(t){return arguments.length?this.seek(t,!0):this.getLabelBefore(this._time+1e-8)},i},!0),w=180/Math.PI,x=[],b=[],P=[],g={},i=_gsScope._gsDefine.globals,v=function(t,e,i,s){this.a=t,this.b=e,this.c=i,this.d=s,this.da=s-t,this.ca=i-t,this.ba=e-t},O=function(t,e,i,s){var r={a:t},n={},a={},o={c:s},l=(t+e)/2,h=(e+i)/2,_=(i+s)/2,u=(l+h)/2,c=(h+_)/2,f=(c-u)/8;return r.b=l+(t-l)/4,n.b=u+f,r.c=n.a=(r.b+n.b)/2,n.c=a.a=(u+c)/2,a.b=c-f,o.b=_+(s-_)/4,a.c=o.a=(a.b+o.b)/2,[r,n,a,o]},y=function(t,e,i,s,r){var n,a,o,l,h,_,u,c,f,p,d,m,g,v=t.length-1,y=0,T=t[0].a;for(n=0;n<v;n++)a=(h=t[y]).a,o=h.d,l=t[y+1].d,c=r?(d=x[n],g=.25*((m=b[n])+d)*e/(s?.5:P[n]||.5),o-((_=o-(o-a)*(s?.5*e:0!==d?g/d:0))+(((u=o+(l-o)*(s?.5*e:0!==m?g/m:0))-_)*(3*d/(d+m)+.5)/4||0))):o-((_=o-.5*(o-a)*e)+(u=o+.5*(l-o)*e))/2,_+=c,u+=c,h.c=f=_,h.b=0!==n?T:T=h.a+.6*(h.c-h.a),h.da=o-a,h.ca=f-a,h.ba=T-a,i?(p=O(a,T,f,o),t.splice(y,1,p[0],p[1],p[2],p[3]),y+=4):y++,T=u;(h=t[y]).b=T,h.c=T+.4*(h.d-T),h.da=h.d-h.a,h.ca=h.c-h.a,h.ba=T-h.a,i&&(p=O(h.a,T,h.c,h.d),t.splice(y,1,p[0],p[1],p[2],p[3]))},T=function(t,e,i,s){var r,n,a,o,l,h,_=[];if(s)for(n=(t=[s].concat(t)).length;-1<--n;)"string"==typeof(h=t[n][e])&&"="===h.charAt(1)&&(t[n][e]=s[e]+Number(h.charAt(0)+h.substr(2)));if((r=t.length-2)<0)return _[0]=new v(t[0][e],0,0,t[r<-1?0:1][e]),_;for(n=0;n<r;n++)a=t[n][e],o=t[n+1][e],_[n]=new v(a,0,0,o),i&&(l=t[n+2][e],x[n]=(x[n]||0)+(o-a)*(o-a),b[n]=(b[n]||0)+(l-o)*(l-o));return _[n]=new v(t[n][e],0,0,t[n+1][e]),_},f=function(t,e,i,s,r,n){var a,o,l,h,_,u,c,f,p={},d=[],m=n||t[0];for(o in r="string"==typeof r?","+r+",":",x,y,z,left,top,right,bottom,marginTop,marginLeft,marginRight,marginBottom,paddingLeft,paddingTop,paddingRight,paddingBottom,backgroundPosition,backgroundPosition_y,",null==e&&(e=1),t[0])d.push(o);if(1<t.length){for(f=t[t.length-1],c=!0,a=d.length;-1<--a;)if(o=d[a],.05<Math.abs(m[o]-f[o])){c=!1;break}c&&(t=t.concat(),n&&t.unshift(n),t.push(t[1]),n=t[t.length-3])}for(x.length=b.length=P.length=0,a=d.length;-1<--a;)o=d[a],g[o]=-1!==r.indexOf(","+o+","),p[o]=T(t,o,g[o],n);for(a=x.length;-1<--a;)x[a]=Math.sqrt(x[a]),b[a]=Math.sqrt(b[a]);if(!s){for(a=d.length;-1<--a;)if(g[o])for(u=(l=p[d[a]]).length-1,h=0;h<u;h++)_=l[h+1].da/b[h]+l[h].da/x[h],P[h]=(P[h]||0)+_*_;for(a=P.length;-1<--a;)P[a]=Math.sqrt(P[a])}for(a=d.length,h=i?4:1;-1<--a;)l=p[o=d[a]],y(l,e,i,s,g[o]),c&&(l.splice(0,h),l.splice(l.length-h,h));return p},p=function(t,e,i){for(var s,r,n,a,o,l,h,_,u,c,f,p=1/i,d=t.length;-1<--d;)for(n=(c=t[d]).a,a=c.d-n,o=c.c-n,l=c.b-n,s=r=0,_=1;_<=i;_++)s=r-(r=((h=p*_)*h*a+3*(u=1-h)*(h*o+u*l))*h),e[f=d*i+_-1]=(e[f]||0)+s*s},m=_gsScope._gsDefine.plugin({propName:"bezier",priority:-1,version:"1.3.4",API:2,global:!0,init:function(t,e,i){this._target=t,e instanceof Array&&(e={values:e}),this._func={},this._round={},this._props=[],this._timeRes=null==e.timeResolution?6:parseInt(e.timeResolution,10);var s,r,n,a,o,l=e.values||[],h={},_=l[0],u=e.autoRotate||i.vars.orientToBezier;for(s in this._autoRotate=u?u instanceof Array?u:[["x","y","rotation",!0===u?0:Number(u)||0]]:null,_)this._props.push(s);for(n=this._props.length;-1<--n;)s=this._props[n],this._overwriteProps.push(s),r=this._func[s]="function"==typeof t[s],h[s]=r?t[s.indexOf("set")||"function"!=typeof t["get"+s.substr(3)]?s:"get"+s.substr(3)]():parseFloat(t[s]),o||h[s]!==l[0][s]&&(o=h);if(this._beziers="cubic"!==e.type&&"quadratic"!==e.type&&"soft"!==e.type?f(l,isNaN(e.curviness)?1:e.curviness,!1,"thruBasic"===e.type,e.correlate,o):function(t,e,i){var s,r,n,a,o,l,h,_,u,c,f,p={},d="cubic"===(e=e||"soft")?3:2,m="soft"===e,g=[];if(m&&i&&(t=[i].concat(t)),null==t||1+d>t.length)throw"invalid Bezier data";for(u in t[0])g.push(u);for(l=g.length;-1<--l;){for(p[u=g[l]]=o=[],c=0,_=t.length,h=0;h<_;h++)s=null==i?t[h][u]:"string"==typeof(f=t[h][u])&&"="===f.charAt(1)?i[u]+Number(f.charAt(0)+f.substr(2)):Number(f),m&&1<h&&h<_-1&&(o[c++]=(s+o[c-2])/2),o[c++]=s;for(_=c-d+1,h=c=0;h<_;h+=d)s=o[h],r=o[h+1],n=o[h+2],a=2==d?0:o[h+3],o[c++]=f=3==d?new v(s,r,n,a):new v(s,(2*r+s)/3,(2*r+n)/3,n);o.length=c}return p}(l,e.type,h),this._segCount=this._beziers[s].length,this._timeRes){var c=function(t,e){var i,s,r,n,a=[],o=[],l=0,h=0,_=(e=e>>0||6)-1,u=[],c=[];for(i in t)p(t[i],a,e);for(r=a.length,s=0;s<r;s++)l+=Math.sqrt(a[s]),c[n=s%e]=l,n===_&&(h+=l,u[n=s/e>>0]=c,o[n]=h,l=0,c=[]);return{length:h,lengths:o,segments:u}}(this._beziers,this._timeRes);this._length=c.length,this._lengths=c.lengths,this._segments=c.segments,this._l1=this._li=this._s1=this._si=0,this._l2=this._lengths[0],this._curSeg=this._segments[0],this._s2=this._curSeg[0],this._prec=1/this._curSeg.length}if(u=this._autoRotate)for(this._initialRotations=[],u[0]instanceof Array||(this._autoRotate=u=[u]),n=u.length;-1<--n;){for(a=0;a<3;a++)s=u[n][a],this._func[s]="function"==typeof t[s]&&t[s.indexOf("set")||"function"!=typeof t["get"+s.substr(3)]?s:"get"+s.substr(3)];s=u[n][2],this._initialRotations[n]=this._func[s]?this._func[s].call(this._target):this._target[s]}return this._startRatio=i.vars.runBackwards?1:0,!0},set:function(t){var e,i,s,r,n,a,o,l,h,_,u=this._segCount,c=this._func,f=this._target,p=t!==this._startRatio;if(this._timeRes){if(h=this._lengths,_=this._curSeg,t*=this._length,s=this._li,t>this._l2&&s<u-1){for(l=u-1;s<l&&t>=(this._l2=h[++s]););this._l1=h[s-1],this._li=s,this._curSeg=_=this._segments[s],this._s2=_[this._s1=this._si=0]}else if(this._l1>t&&0<s){for(;0<s&&(this._l1=h[--s])>=t;);0===s&&this._l1>t?this._l1=0:s++,this._l2=h[s],this._li=s,this._curSeg=_=this._segments[s],this._s1=_[(this._si=_.length-1)-1]||0,this._s2=_[this._si]}if(e=s,t-=this._l1,s=this._si,t>this._s2&&_.length-1>s){for(l=_.length-1;s<l&&t>=(this._s2=_[++s]););this._s1=_[s-1],this._si=s}else if(this._s1>t&&0<s){for(;0<s&&(this._s1=_[--s])>=t;);0===s&&this._s1>t?this._s1=0:s++,this._s2=_[s],this._si=s}a=(s+(t-this._s1)/(this._s2-this._s1))*this._prec}else a=(t-(e=t<0?0:1<=t?u-1:u*t>>0)*(1/u))*u;for(i=1-a,s=this._props.length;-1<--s;)r=this._props[s],o=(a*a*(n=this._beziers[r][e]).da+3*i*(a*n.ca+i*n.ba))*a+n.a,this._round[r]&&(o=Math.round(o)),c[r]?f[r](o):f[r]=o;if(this._autoRotate){var d,m,g,v,y,T,x,b=this._autoRotate;for(s=b.length;-1<--s;)r=b[s][2],T=b[s][3]||0,x=!0===b[s][4]?1:w,n=this._beziers[b[s][0]],d=this._beziers[b[s][1]],n&&d&&(n=n[e],d=d[e],m=n.a+(n.b-n.a)*a,m+=((v=n.b+(n.c-n.b)*a)-m)*a,v+=(n.c+(n.d-n.c)*a-v)*a,g=d.a+(d.b-d.a)*a,g+=((y=d.b+(d.c-d.b)*a)-g)*a,y+=(d.c+(d.d-d.c)*a-y)*a,o=p?Math.atan2(y-g,v-m)*x+T:this._initialRotations[s],c[r]?f[r](o):f[r]=o)}}}),s=m.prototype,m.bezierThrough=f,m.cubicToQuadratic=O,m._autoCSS=!0,m.quadraticToCubic=function(t,e,i){return new v(t,(2*e+t)/3,(2*e+i)/3,i)},m._cssRegister=function(){var t=i.CSSPlugin;if(t){var e=t._internals,f=e._parseToProxy,p=e._setPluginRatio,d=e.CSSPropTween;e._registerComplexSpecialProp("bezier",{parser:function(t,e,i,s,r,n){e instanceof Array&&(e={values:e}),n=new m;var a,o,l,h=e.values,_=h.length-1,u=[],c={};if(_<0)return r;for(a=0;a<=_;a++)l=f(t,h[a],s,r,n,_!==a),u[a]=l.end;for(o in e)c[o]=e[o];return c.values=u,(r=new d(t,"bezier",0,0,l.pt,2)).data=l,r.plugin=n,r.setRatio=p,0===c.autoRotate&&(c.autoRotate=!0),!c.autoRotate||c.autoRotate instanceof Array||(a=!0===c.autoRotate?0:Number(c.autoRotate),c.autoRotate=null!=l.end.left?[["left","top","rotation",a,!1]]:null!=l.end.x&&[["x","y","rotation",a,!1]]),c.autoRotate&&(s._transform||s._enableTransforms(!1),l.autoRotate=s._target._gsTransform),n._onInitTween(l.proxy,c,s._tween),r}})}},s._roundProps=function(t,e){for(var i=this._overwriteProps,s=i.length;-1<--s;)(t[i[s]]||t.bezier||t.bezierThrough)&&(this._round[i[s]]=e)},s._kill=function(t){var e,i,s=this._props;for(e in this._beziers)if(e in t)for(delete this._beziers[e],delete this._func[e],i=s.length;-1<--i;)s[i]===e&&s.splice(i,1);return this._super._kill.call(this,t)},_gsScope._gsDefine("plugins.CSSPlugin",["plugins.TweenPlugin","TweenLite"],function(n,Y){var p,w,B,f,j=function(){n.call(this,"css"),this._overwriteProps.length=0,this.setRatio=j.prototype.setRatio},h=_gsScope._gsDefine.globals,d={},t=j.prototype=new n("css");(t.constructor=j).version="1.18.0",j.API=2,j.defaultTransformPerspective=0,j.defaultSkewType="compensated",j.defaultSmoothOrigin=!0,t="px",j.suffixMap={top:t,right:t,bottom:t,left:t,width:t,height:t,fontSize:t,padding:t,margin:t,perspective:t,lineHeight:""};var k,m,g,L,v,O,e,i,R=/(?:\d|\-\d|\.\d|\-\.\d)+/g,A=/(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,y=/(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi,_=/(?![+-]?\d*\.?\d+|[+-]|e[+-]\d+)[^0-9]/g,S=/(?:\d|\-|\+|=|#|\.)*/g,C=/opacity *= *([^)]*)/i,T=/opacity:([^;]*)/i,a=/alpha\(opacity *=.+?\)/i,x=/^(rgb|hsl)/,o=/([A-Z])/g,l=/-([a-z])/gi,b=/(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi,u=function(t,e){return e.toUpperCase()},c=/(?:Left|Right|Width)/i,P=/(M11|M12|M21|M22)=[\d\-\.e]+/gi,D=/progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i,M=/,(?=[^\)]*(?:\(|$))/gi,E=Math.PI/180,U=180/Math.PI,z={},F=document,s=function(t){return F.createElementNS?F.createElementNS("http://www.w3.org/1999/xhtml",t):F.createElement(t)},I=s("div"),X=s("img"),r=j._internals={_specialProps:d},N=navigator.userAgent,V=(e=N.indexOf("Android"),i=s("a"),g=-1!==N.indexOf("Safari")&&-1===N.indexOf("Chrome")&&(-1===e||3<Number(N.substr(e+8,1))),v=g&&Number(N.substr(N.indexOf("Version/")+8,1))<6,L=-1!==N.indexOf("Firefox"),(/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(N)||/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(N))&&(O=parseFloat(RegExp.$1)),!!i&&(i.style.cssText="top:1px;opacity:.55;",/^0.55/.test(i.style.opacity))),q=function(t){return C.test("string"==typeof t?t:(t.currentStyle?t.currentStyle.filter:t.style.filter)||"")?parseFloat(RegExp.$1)/100:1},W=function(t){window.console&&console.log(t)},Z="",G="",$=function(t,e){var i,s,r=(e=e||I).style;if(void 0!==r[t])return t;for(t=t.charAt(0).toUpperCase()+t.substr(1),i=["O","Moz","ms","Ms","Webkit"],s=5;-1<--s&&void 0===r[i[s]+t];);return 0<=s?(Z="-"+(G=3===s?"ms":i[s]).toLowerCase()+"-",G+t):null},Q=F.defaultView?F.defaultView.getComputedStyle:function(){},H=j.getStyle=function(t,e,i,s,r){var n;return V||"opacity"!==e?(!s&&t.style[e]?n=t.style[e]:(i=i||Q(t))?n=i[e]||i.getPropertyValue(e)||i.getPropertyValue(e.replace(o,"-$1").toLowerCase()):t.currentStyle&&(n=t.currentStyle[e]),null==r||n&&"none"!==n&&"auto"!==n&&"auto auto"!==n?n:r):q(t)},K=r.convertToPixels=function(t,e,i,s,r){if("px"===s||!s)return i;if("auto"===s||!i)return 0;var n,a,o,l=c.test(e),h=t,_=I.style,u=i<0;if(u&&(i=-i),"%"===s&&-1!==e.indexOf("border"))n=i/100*(l?t.clientWidth:t.clientHeight);else{if(_.cssText="border:0 solid red;position:"+H(t,"position")+";line-height:0;","%"!==s&&h.appendChild&&"v"!==s.charAt(0)&&"rem"!==s)_[l?"borderLeftWidth":"borderTopWidth"]=i+s;else{if(a=(h=t.parentNode||F.body)._gsCache,o=Y.ticker.frame,a&&l&&a.time===o)return a.width*i/100;_[l?"width":"height"]=i+s}h.appendChild(I),n=parseFloat(I[l?"offsetWidth":"offsetHeight"]),h.removeChild(I),l&&"%"===s&&!1!==j.cacheWidths&&((a=h._gsCache=h._gsCache||{}).time=o,a.width=n/i*100),0!==n||r||(n=K(t,e,i,s,!0))}return u?-n:n},J=r.calculateOffset=function(t,e,i){if("absolute"!==H(t,"position",i))return 0;var s="left"===e?"Left":"Top",r=H(t,"margin"+s,i);return t["offset"+s]-(K(t,e,parseFloat(r),r.replace(S,""))||0)},tt=function(t,e){var i,s,r,n={};if(e=e||Q(t,null))if(i=e.length)for(;-1<--i;)(-1===(r=e[i]).indexOf("-transform")||Dt===r)&&(n[r.replace(l,u)]=e.getPropertyValue(r));else for(i in e)(-1===i.indexOf("Transform")||Ct===i)&&(n[i]=e[i]);else if(e=t.currentStyle||t.style)for(i in e)"string"==typeof i&&void 0===n[i]&&(n[i.replace(l,u)]=e[i]);return V||(n.opacity=q(t)),s=Ut(t,e,!1),n.rotation=s.rotation,n.skewX=s.skewX,n.scaleX=s.scaleX,n.scaleY=s.scaleY,n.x=s.x,n.y=s.y,zt&&(n.z=s.z,n.rotationX=s.rotationX,n.rotationY=s.rotationY,n.scaleZ=s.scaleZ),n.filters&&delete n.filters,n},et=function(t,e,i,s,r){var n,a,o,l={},h=t.style;for(a in i)"cssText"!==a&&"length"!==a&&isNaN(a)&&(e[a]!==(n=i[a])||r&&r[a])&&-1===a.indexOf("Origin")&&("number"==typeof n||"string"==typeof n)&&(l[a]="auto"!==n||"left"!==a&&"top"!==a?""!==n&&"auto"!==n&&"none"!==n||"string"!=typeof e[a]||""===e[a].replace(_,"")?n:0:J(t,a),void 0!==h[a]&&(o=new mt(h,a,h[a],o)));if(s)for(a in s)"className"!==a&&(l[a]=s[a]);return{difs:l,firstMPT:o}},it={width:["Left","Right"],height:["Top","Bottom"]},st=["marginLeft","marginRight","marginTop","marginBottom"],rt=function(t,e,i){var s=parseFloat("width"===e?t.offsetWidth:t.offsetHeight),r=it[e],n=r.length;for(i=i||Q(t,null);-1<--n;)s-=parseFloat(H(t,"padding"+r[n],i,!0))||0,s-=parseFloat(H(t,"border"+r[n]+"Width",i,!0))||0;return s},nt=function(t,e){if("contain"===t||"auto"===t||"auto auto"===t)return t+" ";(null==t||""===t)&&(t="0 0");var i=t.split(" "),s=-1!==t.indexOf("left")?"0%":-1!==t.indexOf("right")?"100%":i[0],r=-1!==t.indexOf("top")?"0%":-1!==t.indexOf("bottom")?"100%":i[1];return null==r?r="center"===s?"50%":"0":"center"===r&&(r="50%"),("center"===s||isNaN(parseFloat(s))&&-1===(s+"").indexOf("="))&&(s="50%"),t=s+" "+r+(2<i.length?" "+i[2]:""),e&&(e.oxp=-1!==s.indexOf("%"),e.oyp=-1!==r.indexOf("%"),e.oxr="="===s.charAt(1),e.oyr="="===r.charAt(1),e.ox=parseFloat(s.replace(_,"")),e.oy=parseFloat(r.replace(_,"")),e.v=t),e||t},at=function(t,e){return"string"==typeof t&&"="===t.charAt(1)?parseInt(t.charAt(0)+"1",10)*parseFloat(t.substr(2)):parseFloat(t)-parseFloat(e)},ot=function(t,e){return null==t?e:"string"==typeof t&&"="===t.charAt(1)?parseInt(t.charAt(0)+"1",10)*parseFloat(t.substr(2))+e:parseFloat(t)},lt=function(t,e,i,s){var r,n,a,o,l;return(o=null==t?e:"number"==typeof t?t:(r=360,n=t.split("_"),a=((l="="===t.charAt(1))?parseInt(t.charAt(0)+"1",10)*parseFloat(n[0].substr(2)):parseFloat(n[0]))*(-1===t.indexOf("rad")?1:U)-(l?0:e),n.length&&(s&&(s[i]=e+a),-1!==t.indexOf("short")&&((a%=r)!==a%180&&(a=a<0?a+r:a-r)),-1!==t.indexOf("_cw")&&a<0?a=(a+3599999999640)%r-(0|a/r)*r:-1!==t.indexOf("ccw")&&0<a&&(a=(a-3599999999640)%r-(0|a/r)*r)),e+a))<1e-6&&-1e-6<o&&(o=0),o},ht={aqua:[0,255,255],lime:[0,255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],fuchsia:[255,0,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255,255,255,0]},_t=function(t,e,i){return 0|255*(6*(t=t<0?t+1:1<t?t-1:t)<1?e+6*(i-e)*t:t<.5?i:3*t<2?e+6*(i-e)*(2/3-t):e)+.5},ut=j.parseColor=function(t,e){var i,s,r,n,a,o,l,h,_,u,c;if(t)if("number"==typeof t)i=[t>>16,255&t>>8,255&t];else{if(","===t.charAt(t.length-1)&&(t=t.substr(0,t.length-1)),ht[t])i=ht[t];else if("#"===t.charAt(0))4===t.length&&(t="#"+(s=t.charAt(1))+s+(r=t.charAt(2))+r+(n=t.charAt(3))+n),i=[(t=parseInt(t.substr(1),16))>>16,255&t>>8,255&t];else if("hsl"===t.substr(0,3))if(i=c=t.match(R),e){if(-1!==t.indexOf("="))return t.match(A)}else a=Number(i[0])%360/360,o=Number(i[1])/100,s=2*(l=Number(i[2])/100)-(r=l<=.5?l*(o+1):l+o-l*o),3<i.length&&(i[3]=Number(t[3])),i[0]=_t(a+1/3,s,r),i[1]=_t(a,s,r),i[2]=_t(a-1/3,s,r);else i=t.match(R)||ht.transparent;i[0]=Number(i[0]),i[1]=Number(i[1]),i[2]=Number(i[2]),3<i.length&&(i[3]=Number(i[3]))}else i=ht.black;return e&&!c&&(s=i[0]/255,r=i[1]/255,n=i[2]/255,l=((h=Math.max(s,r,n))+(_=Math.min(s,r,n)))/2,h===_?a=o=0:(u=h-_,o=.5<l?u/(2-h-_):u/(h+_),a=h===s?(r-n)/u+(r<n?6:0):h===r?(n-s)/u+2:(s-r)/u+4,a*=60),i[0]=0|a+.5,i[1]=0|100*o+.5,i[2]=0|100*l+.5),i},ct=function(t,e){var i,s,r,n=t.match(ft)||[],a=0,o=n.length?"":t;for(i=0;n.length>i;i++)s=n[i],a+=(r=t.substr(a,t.indexOf(s,a)-a)).length+s.length,3===(s=ut(s,e)).length&&s.push(1),o+=r+(e?"hsla("+s[0]+","+s[1]+"%,"+s[2]+"%,"+s[3]:"rgba("+s.join(","))+")";return o},ft="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#.+?\\b";for(t in ht)ft+="|"+t+"\\b";ft=RegExp(ft+")","gi"),j.colorStringFilter=function(t){var e,i=t[0]+t[1];ft.lastIndex=0,ft.test(i)&&(e=-1!==i.indexOf("hsl(")||-1!==i.indexOf("hsla("),t[0]=ct(t[0],e),t[1]=ct(t[1],e))},Y.defaultStringFilter||(Y.defaultStringFilter=j.colorStringFilter);var pt=function(t,e,n,a){if(null==t)return function(t){return t};var o,l=e?(t.match(ft)||[""])[0]:"",h=t.split(l).join("").match(y)||[],_=t.substr(0,t.indexOf(h[0])),u=")"===t.charAt(t.length-1)?")":"",c=-1!==t.indexOf(" ")?" ":",",f=h.length,p=0<f?h[0].replace(R,""):"";return f?o=e?function(t){var e,i,s,r;if("number"==typeof t)t+=p;else if(a&&M.test(t)){for(r=t.replace(M,"|").split("|"),s=0;r.length>s;s++)r[s]=o(r[s]);return r.join(",")}if(e=(t.match(ft)||[l])[0],s=(i=t.split(e).join("").match(y)||[]).length,f>s--)for(;f>++s;)i[s]=n?i[0|(s-1)/2]:h[s];return _+i.join(c)+c+e+u+(-1!==t.indexOf("inset")?" inset":"")}:function(t){var e,i,s;if("number"==typeof t)t+=p;else if(a&&M.test(t)){for(i=t.replace(M,"|").split("|"),s=0;i.length>s;s++)i[s]=o(i[s]);return i.join(",")}if(s=(e=t.match(y)||[]).length,f>s--)for(;f>++s;)e[s]=n?e[0|(s-1)/2]:h[s];return _+e.join(c)+u}:function(t){return t}},dt=function(h){return h=h.split(","),function(t,e,i,s,r,n,a){var o,l=(e+"").split(" ");for(a={},o=0;o<4;o++)a[h[o]]=l[o]=l[o]||l[(o-1)/2>>0];return s.parse(t,a,r,n)}},mt=(r._setPluginRatio=function(t){this.plugin.setRatio(t);for(var e,i,s,r,n=this.data,a=n.proxy,o=n.firstMPT;o;)e=a[o.v],o.r?e=Math.round(e):e<1e-6&&-1e-6<e&&(e=0),o.t[o.p]=e,o=o._next;if(n.autoRotate&&(n.autoRotate.rotation=a.rotation),1===t)for(o=n.firstMPT;o;){if((i=o.t).type){if(1===i.type){for(r=i.xs0+i.s+i.xs1,s=1;i.l>s;s++)r+=i["xn"+s]+i["xs"+(s+1)];i.e=r}}else i.e=i.s+i.xs0;o=o._next}},function(t,e,i,s,r){this.t=t,this.p=e,this.v=i,this.r=r,s&&((s._prev=this)._next=s)}),gt=(r._parseToProxy=function(t,e,i,s,r,n){var a,o,l,h,_,u=s,c={},f={},p=i._transform,d=z;for(i._transform=null,z=e,s=_=i.parse(t,e,s,r),z=d,n&&(i._transform=p,u&&(u._prev=null,u._prev&&(u._prev._next=null)));s&&s!==u;){if(s.type<=1&&(f[o=s.p]=s.s+s.c,c[o]=s.s,n||(h=new mt(s,"s",o,h,s.r),s.c=0),1===s.type))for(a=s.l;0<--a;)l="xn"+a,f[o=s.p+"_"+l]=s.data[l],c[o]=s[l],n||(h=new mt(s,l,o,h,s.rxp[l]));s=s._next}return{proxy:c,end:f,firstMPT:h,pt:_}},r.CSSPropTween=function(t,e,i,s,r,n,a,o,l,h,_){this.t=t,this.p=e,this.s=i,this.c=s,this.n=a||e,t instanceof gt||f.push(this.n),this.r=o,this.type=n||0,l&&(this.pr=l,p=!0),this.b=void 0===h?i:h,this.e=void 0===_?i+s:_,r&&((this._next=r)._prev=this)}),vt=function(t,e,i,s,r,n){var a=new gt(t,e,i,s-i,r,-1,n);return a.b=i,a.e=a.xs0=s,a},yt=j.parseComplex=function(t,e,i,s,r,n,a,o,l,h){a=new gt(t,e,0,0,a,h?2:1,null,!1,o,i=i||n||"",s),s+="";var _,u,c,f,p,d,m,g,v,y,T,x,b,w=i.split(", ").join(",").split(" "),P=s.split(", ").join(",").split(" "),O=w.length,S=!1!==k;for((-1!==s.indexOf(",")||-1!==i.indexOf(","))&&(w=w.join(" ").replace(M,", ").split(" "),P=P.join(" ").replace(M,", ").split(" "),O=w.length),O!==P.length&&(O=(w=(n||"").split(" ")).length),a.plugin=l,a.setRatio=h,_=ft.lastIndex=0;_<O;_++)if(f=w[_],p=P[_],(g=parseFloat(f))||0===g)a.appendXtra("",g,at(p,g),p.replace(A,""),S&&-1!==p.indexOf("px"),!0);else if(r&&ft.test(f))x=","===p.charAt(p.length-1)?"),":")",b=-1!==p.indexOf("hsl")&&V,f=ut(f,b),p=ut(p,b),(v=6<f.length+p.length)&&!V&&0===p[3]?(a["xs"+a.l]+=a.l?" transparent":"transparent",a.e=a.e.split(P[_]).join("transparent")):(V||(v=!1),b?a.appendXtra(v?"hsla(":"hsl(",f[0],at(p[0],f[0]),",",!1,!0).appendXtra("",f[1],at(p[1],f[1]),"%,",!1).appendXtra("",f[2],at(p[2],f[2]),v?"%,":"%"+x,!1):a.appendXtra(v?"rgba(":"rgb(",f[0],p[0]-f[0],",",!0,!0).appendXtra("",f[1],p[1]-f[1],",",!0).appendXtra("",f[2],p[2]-f[2],v?",":x,!0),v&&(f=f.length<4?1:f[3],a.appendXtra("",f,(p.length<4?1:p[3])-f,x,!1))),ft.lastIndex=0;else if(d=f.match(R)){if(!(m=p.match(A))||m.length!==d.length)return a;for(u=c=0;d.length>u;u++)T=d[u],y=f.indexOf(T,c),a.appendXtra(f.substr(c,y-c),Number(T),at(m[u],T),"",S&&"px"===f.substr(y+T.length,2),0===u),c=y+T.length;a["xs"+a.l]+=f.substr(c)}else a["xs"+a.l]+=a.l?" "+f:f;if(-1!==s.indexOf("=")&&a.data){for(x=a.xs0+a.data.s,_=1;a.l>_;_++)x+=a["xs"+_]+a.data["xn"+_];a.e=x+a["xs"+_]}return a.l||(a.type=-1,a.xs0=a.e),a.xfirst||a},Tt=9;for((t=gt.prototype).l=t.pr=0;0<--Tt;)t["xn"+Tt]=0,t["xs"+Tt]="";t.xs0="",t._next=t._prev=t.xfirst=t.data=t.plugin=t.setRatio=t.rxp=null,t.appendXtra=function(t,e,i,s,r,n){var a=this,o=a.l;return a["xs"+o]+=n&&o?" "+t:t||"",i||0===o||a.plugin?(a.l++,a.type=a.setRatio?2:1,a["xs"+a.l]=s||"",0<o?(a.data["xn"+o]=e+i,a.rxp["xn"+o]=r,a["xn"+o]=e,a.plugin||(a.xfirst=new gt(a,"xn"+o,e,i,a.xfirst||a,0,a.n,r,a.pr),a.xfirst.xs0=0)):(a.data={s:e+i},a.rxp={},a.s=e,a.c=i,a.r=r)):a["xs"+o]+=e+(s||""),a};var xt=function(t,e){e=e||{},this.p=e.prefix&&$(t)||t,d[t]=d[this.p]=this,this.format=e.formatter||pt(e.defaultValue,e.color,e.collapsible,e.multi),e.parser&&(this.parse=e.parser),this.clrs=e.color,this.multi=e.multi,this.keyword=e.keyword,this.dflt=e.defaultValue,this.pr=e.priority||0},bt=r._registerComplexSpecialProp=function(t,e,i){"object"!=typeof e&&(e={parser:i});var s,r=t.split(","),n=e.defaultValue;for(i=i||[n],s=0;r.length>s;s++)e.prefix=0===s&&e.prefix,e.defaultValue=i[s]||n,new xt(r[s],e)},wt=function(t){if(!d[t]){var l=t.charAt(0).toUpperCase()+t.substr(1)+"Plugin";bt(t,{parser:function(t,e,i,s,r,n,a){var o=h.com.greensock.plugins[l];return o?(o._cssRegister(),d[i].parse(t,e,i,s,r,n,a)):(W("Error: "+l+" js file not loaded."),r)}})}};(t=xt.prototype).parseComplex=function(t,e,i,s,r,n){var a,o,l,h,_,u,c=this.keyword;if(this.multi&&(M.test(i)||M.test(e)?(o=e.replace(M,"|").split("|"),l=i.replace(M,"|").split("|")):c&&(o=[e],l=[i])),l){for(h=l.length>o.length?l.length:o.length,a=0;a<h;a++)e=o[a]=o[a]||this.dflt,i=l[a]=l[a]||this.dflt,c&&((_=e.indexOf(c))!==(u=i.indexOf(c))&&(-1===u?o[a]=o[a].split(c).join(""):-1===_&&(o[a]+=" "+c)));e=o.join(", "),i=l.join(", ")}return yt(t,this.p,e,i,this.clrs,this.dflt,s,this.pr,r,n)},t.parse=function(t,e,i,s,r,n){return this.parseComplex(t.style,this.format(H(t,this.p,B,!1,this.dflt)),this.format(e),r,n)},j.registerSpecialProp=function(t,o,l){bt(t,{parser:function(t,e,i,s,r,n){var a=new gt(t,i,0,0,r,2,i,!1,l);return a.plugin=n,a.setRatio=o(t,e,s._tween,i),a},priority:l})},j.useSVGTransformAttr=g||L;var Pt,Ot,St,kt,Rt,At="scaleX,scaleY,scaleZ,x,y,z,skewX,skewY,rotation,rotationX,rotationY,perspective,xPercent,yPercent".split(","),Ct=$("transform"),Dt=Z+"transform",Mt=$("transformOrigin"),zt=null!==$("perspective"),Ft=r.Transform=function(){this.perspective=parseFloat(j.defaultTransformPerspective)||0,this.force3D=!(!1===j.defaultForce3D||!zt)&&(j.defaultForce3D||"auto")},It=window.SVGElement,Xt=function(t,e,i){var s,r=F.createElementNS("http://www.w3.org/2000/svg",t),n=/([a-z])([A-Z])/g;for(s in i)r.setAttributeNS(null,s.replace(n,"$1-$2").toLowerCase(),i[s]);return e.appendChild(r),r},Nt=F.documentElement,Lt=(Rt=O||/Android/i.test(N)&&!window.chrome,F.createElementNS&&!Rt&&(Ot=Xt("svg",Nt),kt=(St=Xt("rect",Ot,{width:100,height:50,x:100})).getBoundingClientRect().width,St.style[Mt]="50% 50%",St.style[Ct]="scaleX(0.5)",Rt=kt===St.getBoundingClientRect().width&&!(L&&zt),Nt.removeChild(Ot)),Rt),Et=function(t,e,i,s,r){var n,a,o,l,h,_,u,c,f,p,d,m,g,v,y=t._gsTransform,T=jt(t,!0);y&&(g=y.xOrigin,v=y.yOrigin),(!s||(n=s.split(" ")).length<2)&&(u=t.getBBox(),n=[(-1!==(e=nt(e).split(" "))[0].indexOf("%")?parseFloat(e[0])/100*u.width:parseFloat(e[0]))+u.x,(-1!==e[1].indexOf("%")?parseFloat(e[1])/100*u.height:parseFloat(e[1]))+u.y]),i.xOrigin=l=parseFloat(n[0]),i.yOrigin=h=parseFloat(n[1]),s&&T!==Bt&&(_=T[0],u=T[1],c=T[2],f=T[3],p=T[4],a=l*(f/(m=_*f-u*c))+h*(-c/m)+(c*(d=T[5])-f*p)/m,o=l*(-u/m)+h*(_/m)-(_*d-u*p)/m,l=i.xOrigin=n[0]=a,h=i.yOrigin=n[1]=o),y&&(r||!1!==r&&!1!==j.defaultSmoothOrigin?(a=l-g,o=h-v,y.xOffset+=a*T[0]+o*T[2]-a,y.yOffset+=a*T[1]+o*T[3]-o):y.xOffset=y.yOffset=0),t.setAttribute("data-svg-origin",n.join(" "))},Yt=function(t){return!!(It&&"function"==typeof t.getBBox&&t.getCTM&&(!t.parentNode||t.parentNode.getBBox&&t.parentNode.getCTM))},Bt=[1,0,0,1,0,0],jt=function(t,e){var i,s,r,n,a,o=t._gsTransform||new Ft;if(Ct?s=H(t,Dt,null,!0):t.currentStyle&&(s=(s=t.currentStyle.filter.match(P))&&4===s.length?[s[0].substr(4),Number(s[2].substr(4)),Number(s[1].substr(4)),s[3].substr(4),o.x||0,o.y||0].join(","):""),i=!s||"none"===s||"matrix(1, 0, 0, 1, 0, 0)"===s,(o.svg||t.getBBox&&Yt(t))&&(i&&-1!==(t.style[Ct]+"").indexOf("matrix")&&(s=t.style[Ct],i=0),r=t.getAttribute("transform"),i&&r&&(-1!==r.indexOf("matrix")?(s=r,i=0):-1!==r.indexOf("translate")&&(s="matrix(1,0,0,1,"+r.match(/(?:\-|\b)[\d\-\.e]+\b/gi).join(",")+")",i=0))),i)return Bt;for(r=(s||"").match(/(?:\-|\b)[\d\-\.e]+\b/gi)||[],Tt=r.length;-1<--Tt;)n=Number(r[Tt]),r[Tt]=(a=n-(n|=0))?(0|1e5*a+(a<0?-.5:.5))/1e5+n:n;return e&&6<r.length?[r[0],r[1],r[4],r[5],r[12],r[13]]:r},Ut=r.getTransform=function(t,e,i,s){if(t._gsTransform&&i&&!s)return t._gsTransform;var r,n,a,o,l,h,_=i&&t._gsTransform||new Ft,u=_.scaleX<0,c=zt&&(parseFloat(H(t,Mt,e,!1,"0 0 0").split(" ")[2])||_.zOrigin)||0,f=parseFloat(j.defaultTransformPerspective)||0;if(_.svg=!(!t.getBBox||!Yt(t)),_.svg&&(Et(t,H(t,Mt,B,!1,"50% 50%")+"",_,t.getAttribute("data-svg-origin")),Pt=j.useSVGTransformAttr||Lt),(r=jt(t))!==Bt){if(16===r.length){var p,d,m,g,v,y=r[0],T=r[1],x=r[2],b=r[3],w=r[4],P=r[5],O=r[6],S=r[7],k=r[8],R=r[9],A=r[10],C=r[12],D=r[13],M=r[14],z=r[11],F=Math.atan2(O,A);_.zOrigin&&(C=k*(M=-_.zOrigin)-r[12],D=R*M-r[13],M=A*M+_.zOrigin-r[14]),_.rotationX=F*U,F&&(p=w*(g=Math.cos(-F))+k*(v=Math.sin(-F)),d=P*g+R*v,m=O*g+A*v,k=w*-v+k*g,R=P*-v+R*g,A=O*-v+A*g,z=S*-v+z*g,w=p,P=d,O=m),F=Math.atan2(k,A),_.rotationY=F*U,F&&(d=T*(g=Math.cos(-F))-R*(v=Math.sin(-F)),m=x*g-A*v,R=T*v+R*g,A=x*v+A*g,z=b*v+z*g,y=p=y*g-k*v,T=d,x=m),F=Math.atan2(T,y),_.rotation=F*U,F&&(y=y*(g=Math.cos(-F))+w*(v=Math.sin(-F)),d=T*g+P*v,P=T*-v+P*g,O=x*-v+O*g,T=d),_.rotationX&&359.9<Math.abs(_.rotationX)+Math.abs(_.rotation)&&(_.rotationX=_.rotation=0,_.rotationY+=180),_.scaleX=(0|1e5*Math.sqrt(y*y+T*T)+.5)/1e5,_.scaleY=(0|1e5*Math.sqrt(P*P+R*R)+.5)/1e5,_.scaleZ=(0|1e5*Math.sqrt(O*O+A*A)+.5)/1e5,_.skewX=0,_.perspective=z?1/(z<0?-z:z):0,_.x=C,_.y=D,_.z=M,_.svg&&(_.x-=_.xOrigin-(_.xOrigin*y-_.yOrigin*w),_.y-=_.yOrigin-(_.yOrigin*T-_.xOrigin*P))}else if(!(zt&&!s&&r.length&&_.x===r[4]&&_.y===r[5]&&(_.rotationX||_.rotationY)||void 0!==_.x&&"none"===H(t,"display",e))){var I=6<=r.length,X=I?r[0]:1,N=r[1]||0,L=r[2]||0,E=I?r[3]:1;_.x=r[4]||0,_.y=r[5]||0,a=Math.sqrt(X*X+N*N),o=Math.sqrt(E*E+L*L),l=X||N?Math.atan2(N,X)*U:_.rotation||0,h=L||E?Math.atan2(L,E)*U+l:_.skewX||0,90<Math.abs(h)&&Math.abs(h)<270&&(u?(a*=-1,h+=l<=0?180:-180,l+=l<=0?180:-180):(o*=-1,h+=h<=0?180:-180)),_.scaleX=a,_.scaleY=o,_.rotation=l,_.skewX=h,zt&&(_.rotationX=_.rotationY=_.z=0,_.perspective=f,_.scaleZ=1),_.svg&&(_.x-=_.xOrigin-(_.xOrigin*X+_.yOrigin*L),_.y-=_.yOrigin-(_.xOrigin*N+_.yOrigin*E))}for(n in _.zOrigin=c,_)_[n]<2e-5&&-2e-5<_[n]&&(_[n]=0)}return i&&((t._gsTransform=_).svg&&(Pt&&t.style[Ct]?Y.delayedCall(.001,function(){Zt(t.style,Ct)}):!Pt&&t.getAttribute("transform")&&Y.delayedCall(.001,function(){t.removeAttribute("transform")}))),_},Vt=function(t){var e,i,s=this.data,r=-s.rotation*E,n=r+s.skewX*E,a=1e5,o=(0|Math.cos(r)*s.scaleX*a)/a,l=(0|Math.sin(r)*s.scaleX*a)/a,h=(0|Math.sin(n)*-s.scaleY*a)/a,_=(0|Math.cos(n)*s.scaleY*a)/a,u=this.t.style,c=this.t.currentStyle;if(c){i=l,l=-h,h=-i,e=c.filter,u.filter="";var f,p,d=this.t.offsetWidth,m=this.t.offsetHeight,g="absolute"!==c.position,v="progid:DXImageTransform.Microsoft.Matrix(M11="+o+", M12="+l+", M21="+h+", M22="+_,y=s.x+d*s.xPercent/100,T=s.y+m*s.yPercent/100;if(null!=s.ox&&(y+=(f=(s.oxp?.01*d*s.ox:s.ox)-d/2)-(f*o+(p=(s.oyp?.01*m*s.oy:s.oy)-m/2)*l),T+=p-(f*h+p*_)),g?v+=", Dx="+((f=d/2)-(f*o+(p=m/2)*l)+y)+", Dy="+(p-(f*h+p*_)+T)+")":v+=", sizingMethod='auto expand')",u.filter=-1!==e.indexOf("DXImageTransform.Microsoft.Matrix(")?e.replace(D,v):v+" "+e,(0===t||1===t)&&1==o&&0===l&&0===h&&1==_&&(g&&-1===v.indexOf("Dx=0, Dy=0")||C.test(e)&&100!==parseFloat(RegExp.$1)||-1===e.indexOf(e.indexOf("Alpha"))&&u.removeAttribute("filter")),!g){var x,b,w,P=O<8?1:-1;for(f=s.ieOffsetX||0,p=s.ieOffsetY||0,s.ieOffsetX=Math.round((d-((o<0?-o:o)*d+(l<0?-l:l)*m))/2+y),s.ieOffsetY=Math.round((m-((_<0?-_:_)*m+(h<0?-h:h)*d))/2+T),Tt=0;Tt<4;Tt++)w=(i=-1!==(x=c[b=st[Tt]]).indexOf("px")?parseFloat(x):K(this.t,b,parseFloat(x),x.replace(S,""))||0)!==s[b]?Tt<2?-s.ieOffsetX:-s.ieOffsetY:Tt<2?f-s.ieOffsetX:p-s.ieOffsetY,u[b]=(s[b]=Math.round(i-w*(0===Tt||2===Tt?1:P)))+"px"}}},qt=r.set3DTransformRatio=r.setTransformRatio=function(t){var e,i,s,r,n,a,o,l,h,_,u,c,f,p,d,m,g,v,y,T,x,b,w,P=this.data,O=this.t.style,S=P.rotation,k=P.rotationX,R=P.rotationY,A=P.scaleX,C=P.scaleY,D=P.scaleZ,M=P.x,z=P.y,F=P.z,I=P.svg,X=P.perspective,N=P.force3D;if(!((1!==t&&0!==t||"auto"!==N||this.tween._totalTime!==this.tween._totalDuration&&this.tween._totalTime)&&N||F||X||R||k)||Pt&&I||!zt)S||P.skewX||I?(S*=E,b=P.skewX*E,w=1e5,e=Math.cos(S)*A,r=Math.sin(S)*A,i=Math.sin(S-b)*-C,n=Math.cos(S-b)*C,b&&"simple"===P.skewType&&(g=Math.tan(b),i*=g=Math.sqrt(1+g*g),n*=g,P.skewY&&(e*=g,r*=g)),I&&(M+=P.xOrigin-(P.xOrigin*e+P.yOrigin*i)+P.xOffset,z+=P.yOrigin-(P.xOrigin*r+P.yOrigin*n)+P.yOffset,Pt&&(P.xPercent||P.yPercent)&&(p=this.t.getBBox(),M+=.01*P.xPercent*p.width,z+=.01*P.yPercent*p.height),M<(p=1e-6)&&-p<M&&(M=0),z<p&&-p<z&&(z=0)),y=(0|e*w)/w+","+(0|r*w)/w+","+(0|i*w)/w+","+(0|n*w)/w+","+M+","+z+")",I&&Pt?this.t.setAttribute("transform","matrix("+y):O[Ct]=(P.xPercent||P.yPercent?"translate("+P.xPercent+"%,"+P.yPercent+"%) matrix(":"matrix(")+y):O[Ct]=(P.xPercent||P.yPercent?"translate("+P.xPercent+"%,"+P.yPercent+"%) matrix(":"matrix(")+A+",0,0,"+C+","+M+","+z+")";else{if(L&&(A<(p=1e-4)&&-p<A&&(A=D=2e-5),C<p&&-p<C&&(C=D=2e-5),!X||P.z||P.rotationX||P.rotationY||(X=0)),S||P.skewX)S*=E,d=e=Math.cos(S),m=r=Math.sin(S),P.skewX&&(S-=P.skewX*E,d=Math.cos(S),m=Math.sin(S),"simple"===P.skewType&&(g=Math.tan(P.skewX*E),d*=g=Math.sqrt(1+g*g),m*=g,P.skewY&&(e*=g,r*=g))),i=-m,n=d;else{if(!(R||k||1!==D||X||I))return void(O[Ct]=(P.xPercent||P.yPercent?"translate("+P.xPercent+"%,"+P.yPercent+"%) translate3d(":"translate3d(")+M+"px,"+z+"px,"+F+"px)"+(1!==A||1!==C?" scale("+A+","+C+")":""));e=n=1,i=r=0}h=1,s=a=o=l=_=u=0,c=X?-1/X:0,f=P.zOrigin,p=1e-6,T=",",x="0",(S=R*E)&&(d=Math.cos(S),_=c*(o=-(m=Math.sin(S))),s=e*m,a=r*m,c*=h=d,e*=d,r*=d),(S=k*E)&&(g=i*(d=Math.cos(S))+s*(m=Math.sin(S)),v=n*d+a*m,l=h*m,u=c*m,s=i*-m+s*d,a=n*-m+a*d,h*=d,c*=d,i=g,n=v),1!==D&&(s*=D,a*=D,h*=D,c*=D),1!==C&&(i*=C,n*=C,l*=C,u*=C),1!==A&&(e*=A,r*=A,o*=A,_*=A),(f||I)&&(f&&(M+=s*-f,z+=a*-f,F+=h*-f+f),I&&(M+=P.xOrigin-(P.xOrigin*e+P.yOrigin*i)+P.xOffset,z+=P.yOrigin-(P.xOrigin*r+P.yOrigin*n)+P.yOffset),M<p&&-p<M&&(M=x),z<p&&-p<z&&(z=x),F<p&&-p<F&&(F=0)),y=P.xPercent||P.yPercent?"translate("+P.xPercent+"%,"+P.yPercent+"%) matrix3d(":"matrix3d(",y+=(e<p&&-p<e?x:e)+T+(r<p&&-p<r?x:r)+T+(o<p&&-p<o?x:o),y+=T+(_<p&&-p<_?x:_)+T+(i<p&&-p<i?x:i)+T+(n<p&&-p<n?x:n),k||R?(y+=T+(l<p&&-p<l?x:l)+T+(u<p&&-p<u?x:u)+T+(s<p&&-p<s?x:s),y+=T+(a<p&&-p<a?x:a)+T+(h<p&&-p<h?x:h)+T+(c<p&&-p<c?x:c)+T):y+=",0,0,0,0,1,0,",y+=M+T+z+T+F+T+(X?1+-F/X:1)+")",O[Ct]=y}};(t=Ft.prototype).x=t.y=t.z=t.skewX=t.skewY=t.rotation=t.rotationX=t.rotationY=t.zOrigin=t.xPercent=t.yPercent=t.xOffset=t.yOffset=0,t.scaleX=t.scaleY=t.scaleZ=1,bt("transform,scale,scaleX,scaleY,scaleZ,x,y,z,rotation,rotationX,rotationY,rotationZ,skewX,skewY,shortRotation,shortRotationX,shortRotationY,shortRotationZ,transformOrigin,svgOrigin,transformPerspective,directionalRotation,parseTransform,force3D,skewType,xPercent,yPercent,smoothOrigin",{parser:function(t,e,i,s,r,n,a){if(s._lastParsedTransform===a)return r;s._lastParsedTransform=a;var o,l,h,_,u,c,f,p,d,m,g=t._gsTransform,v=t.style,y=At.length,T=a,x={},b="transformOrigin";if(a.display?(_=H(t,"display"),v.display="block",o=Ut(t,B,!0,a.parseTransform),v.display=_):o=Ut(t,B,!0,a.parseTransform),s._transform=o,"string"==typeof T.transform&&Ct)(_=I.style)[Ct]=T.transform,_.display="block",_.position="absolute",F.body.appendChild(I),l=Ut(I,null,!1),F.body.removeChild(I),l.perspective||(l.perspective=o.perspective),null!=T.xPercent&&(l.xPercent=ot(T.xPercent,o.xPercent)),null!=T.yPercent&&(l.yPercent=ot(T.yPercent,o.yPercent));else if("object"==typeof T){if(l={scaleX:ot(null!=T.scaleX?T.scaleX:T.scale,o.scaleX),scaleY:ot(null!=T.scaleY?T.scaleY:T.scale,o.scaleY),scaleZ:ot(T.scaleZ,o.scaleZ),x:ot(T.x,o.x),y:ot(T.y,o.y),z:ot(T.z,o.z),xPercent:ot(T.xPercent,o.xPercent),yPercent:ot(T.yPercent,o.yPercent),perspective:ot(T.transformPerspective,o.perspective)},null!=(p=T.directionalRotation))if("object"==typeof p)for(_ in p)T[_]=p[_];else T.rotation=p;"string"==typeof T.x&&-1!==T.x.indexOf("%")&&(l.x=0,l.xPercent=ot(T.x,o.xPercent)),"string"==typeof T.y&&-1!==T.y.indexOf("%")&&(l.y=0,l.yPercent=ot(T.y,o.yPercent)),l.rotation=lt("rotation"in T?T.rotation:"shortRotation"in T?T.shortRotation+"_short":"rotationZ"in T?T.rotationZ:o.rotation,o.rotation,"rotation",x),zt&&(l.rotationX=lt("rotationX"in T?T.rotationX:"shortRotationX"in T?T.shortRotationX+"_short":o.rotationX||0,o.rotationX,"rotationX",x),l.rotationY=lt("rotationY"in T?T.rotationY:"shortRotationY"in T?T.shortRotationY+"_short":o.rotationY||0,o.rotationY,"rotationY",x)),l.skewX=null==T.skewX?o.skewX:lt(T.skewX,o.skewX),l.skewY=null==T.skewY?o.skewY:lt(T.skewY,o.skewY),(h=l.skewY-o.skewY)&&(l.skewX+=h,l.rotation+=h)}for(zt&&null!=T.force3D&&(o.force3D=T.force3D,f=!0),o.skewType=T.skewType||o.skewType||j.defaultSkewType,(c=o.force3D||o.z||o.rotationX||o.rotationY||l.z||l.rotationX||l.rotationY||l.perspective)||null==T.scale||(l.scaleZ=1);-1<--y;)(1e-6<(u=l[i=At[y]]-o[i])||u<-1e-6||null!=T[i]||null!=z[i])&&(f=!0,r=new gt(o,i,o[i],u,r),i in x&&(r.e=x[i]),r.xs0=0,r.plugin=n,s._overwriteProps.push(r.n));return u=T.transformOrigin,o.svg&&(u||T.svgOrigin)&&(d=o.xOffset,m=o.yOffset,Et(t,nt(u),l,T.svgOrigin,T.smoothOrigin),r=vt(o,"xOrigin",(g?o:l).xOrigin,l.xOrigin,r,b),r=vt(o,"yOrigin",(g?o:l).yOrigin,l.yOrigin,r,b),(d!==o.xOffset||m!==o.yOffset)&&(r=vt(o,"xOffset",g?d:o.xOffset,o.xOffset,r,b),r=vt(o,"yOffset",g?m:o.yOffset,o.yOffset,r,b)),u=Pt?null:"0px 0px"),(u||zt&&c&&o.zOrigin)&&(Ct?(f=!0,i=Mt,u=(u||H(t,i,B,!1,"50% 50%"))+"",(r=new gt(v,i,0,0,r,-1,b)).b=v[i],r.plugin=n,zt?(_=o.zOrigin,u=u.split(" "),o.zOrigin=(2<u.length&&(0===_||"0px"!==u[2])?parseFloat(u[2]):_)||0,r.xs0=r.e=u[0]+" "+(u[1]||"50%")+" 0px",(r=new gt(o,"zOrigin",0,0,r,-1,r.n)).b=_,r.xs0=r.e=o.zOrigin):r.xs0=r.e=u):nt(u+"",o)),f&&(s._transformType=o.svg&&Pt||!c&&3!==this._transformType?2:3),r},prefix:!0}),bt("boxShadow",{defaultValue:"0px 0px 0px 0px #999",prefix:!0,color:!0,multi:!0,keyword:"inset"}),bt("borderRadius",{defaultValue:"0px",parser:function(t,e,i,s,r){e=this.format(e);var n,a,o,l,h,_,u,c,f,p,d,m,g,v,y,T,x=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],b=t.style;for(f=parseFloat(t.offsetWidth),p=parseFloat(t.offsetHeight),n=e.split(" "),a=0;x.length>a;a++)this.p.indexOf("border")&&(x[a]=$(x[a])),-1!==(h=l=H(t,x[a],B,!1,"0px")).indexOf(" ")&&(h=(l=h.split(" "))[0],l=l[1]),_=o=n[a],u=parseFloat(h),m=h.substr((u+"").length),""===(d=(g="="===_.charAt(1))?(c=parseInt(_.charAt(0)+"1",10),_=_.substr(2),c*=parseFloat(_),_.substr((c+"").length-(c<0?1:0))||""):(c=parseFloat(_),_.substr((c+"").length)))&&(d=w[i]||m),d!==m&&(v=K(t,"borderLeft",u,m),y=K(t,"borderTop",u,m),l="%"===d?(h=v/f*100+"%",y/p*100+"%"):"em"===d?(h=v/(T=K(t,"borderLeft",1,"em"))+"em",y/T+"em"):(h=v+"px",y+"px"),g&&(_=parseFloat(h)+c+d,o=parseFloat(l)+c+d)),r=yt(b,x[a],h+" "+l,_+" "+o,!1,"0px",r);return r},prefix:!0,formatter:pt("0px 0px 0px 0px",!1,!0)}),bt("backgroundPosition",{defaultValue:"0 0",parser:function(t,e,i,s,r,n){var a,o,l,h,_,u,c="background-position",f=B||Q(t,null),p=this.format((f?O?f.getPropertyValue(c+"-x")+" "+f.getPropertyValue(c+"-y"):f.getPropertyValue(c):t.currentStyle.backgroundPositionX+" "+t.currentStyle.backgroundPositionY)||"0 0"),d=this.format(e);if(-1!==p.indexOf("%")!=(-1!==d.indexOf("%"))&&((u=H(t,"backgroundImage").replace(b,""))&&"none"!==u)){for(a=p.split(" "),o=d.split(" "),X.setAttribute("src",u),l=2;-1<--l;)(h=-1!==(p=a[l]).indexOf("%"))!=(-1!==o[l].indexOf("%"))&&(_=0===l?t.offsetWidth-X.width:t.offsetHeight-X.height,a[l]=h?parseFloat(p)/100*_+"px":parseFloat(p)/_*100+"%");p=a.join(" ")}return this.parseComplex(t.style,p,d,r,n)},formatter:nt}),bt("backgroundSize",{defaultValue:"0 0",formatter:nt}),bt("perspective",{defaultValue:"0px",prefix:!0}),bt("perspectiveOrigin",{defaultValue:"50% 50%",prefix:!0}),bt("transformStyle",{prefix:!0}),bt("backfaceVisibility",{prefix:!0}),bt("userSelect",{prefix:!0}),bt("margin",{parser:dt("marginTop,marginRight,marginBottom,marginLeft")}),bt("padding",{parser:dt("paddingTop,paddingRight,paddingBottom,paddingLeft")}),bt("clip",{defaultValue:"rect(0px,0px,0px,0px)",parser:function(t,e,i,s,r,n){var a,o,l;return e=O<9?(o=t.currentStyle,l=O<8?" ":",",a="rect("+o.clipTop+l+o.clipRight+l+o.clipBottom+l+o.clipLeft+")",this.format(e).split(",").join(l)):(a=this.format(H(t,this.p,B,!1,this.dflt)),this.format(e)),this.parseComplex(t.style,a,e,r,n)}}),bt("textShadow",{defaultValue:"0px 0px 0px #999",color:!0,multi:!0}),bt("autoRound,strictUnits",{parser:function(t,e,i,s,r){return r}}),bt("border",{defaultValue:"0px solid #000",parser:function(t,e,i,s,r,n){return this.parseComplex(t.style,this.format(H(t,"borderTopWidth",B,!1,"0px")+" "+H(t,"borderTopStyle",B,!1,"solid")+" "+H(t,"borderTopColor",B,!1,"#000")),this.format(e),r,n)},color:!0,formatter:function(t){var e=t.split(" ");return e[0]+" "+(e[1]||"solid")+" "+(t.match(ft)||["#000"])[0]}}),bt("borderWidth",{parser:dt("borderTopWidth,borderRightWidth,borderBottomWidth,borderLeftWidth")}),bt("float,cssFloat,styleFloat",{parser:function(t,e,i,s,r){var n=t.style,a="cssFloat"in n?"cssFloat":"styleFloat";return new gt(n,a,0,0,r,-1,i,!1,0,n[a],e)}});var Wt=function(t){var e,i=this.t,s=i.filter||H(this.data,"filter")||"",r=0|this.s+this.c*t;100==r&&(e=-1===s.indexOf("atrix(")&&-1===s.indexOf("radient(")&&-1===s.indexOf("oader(")?(i.removeAttribute("filter"),!H(this.data,"filter")):(i.filter=s.replace(a,""),!0)),e||(this.xn1&&(i.filter=s=s||"alpha(opacity="+r+")"),-1===s.indexOf("pacity")?0==r&&this.xn1||(i.filter=s+" alpha(opacity="+r+")"):i.filter=s.replace(C,"opacity="+r))};bt("opacity,alpha,autoAlpha",{defaultValue:"1",parser:function(t,e,i,s,r,n){var a=parseFloat(H(t,"opacity",B,!1,"1")),o=t.style,l="autoAlpha"===i;return"string"==typeof e&&"="===e.charAt(1)&&(e=("-"===e.charAt(0)?-1:1)*parseFloat(e.substr(2))+a),l&&1===a&&"hidden"===H(t,"visibility",B)&&0!==e&&(a=0),V?r=new gt(o,"opacity",a,e-a,r):((r=new gt(o,"opacity",100*a,100*(e-a),r)).xn1=l?1:0,o.zoom=1,r.type=2,r.b="alpha(opacity="+r.s+")",r.e="alpha(opacity="+(r.s+r.c)+")",r.data=t,r.plugin=n,r.setRatio=Wt),l&&((r=new gt(o,"visibility",0,0,r,-1,null,!1,0,0!==a?"inherit":"hidden",0===e?"hidden":"inherit")).xs0="inherit",s._overwriteProps.push(r.n),s._overwriteProps.push(i)),r}});var Zt=function(t,e){e&&(t.removeProperty?(("ms"===e.substr(0,2)||"webkit"===e.substr(0,6))&&(e="-"+e),t.removeProperty(e.replace(o,"-$1").toLowerCase())):t.removeAttribute(e))},Gt=function(t){if(this.t._gsClassPT=this,1===t||0===t){this.t.setAttribute("class",0===t?this.b:this.e);for(var e=this.data,i=this.t.style;e;)e.v?i[e.p]=e.v:Zt(i,e.p),e=e._next;1===t&&this.t._gsClassPT===this&&(this.t._gsClassPT=null)}else this.t.getAttribute("class")!==this.e&&this.t.setAttribute("class",this.e)};bt("className",{parser:function(t,e,i,s,r,n,a){var o,l,h,_,u,c=t.getAttribute("class")||"",f=t.style.cssText;if((r=s._classNamePT=new gt(t,i,0,0,r,2)).setRatio=Gt,r.pr=-11,p=!0,r.b=c,l=tt(t,B),h=t._gsClassPT){for(_={},u=h.data;u;)_[u.p]=1,u=u._next;h.setRatio(1)}return(t._gsClassPT=r).e="="!==e.charAt(1)?e:c.replace(RegExp("\\s*\\b"+e.substr(2)+"\\b"),"")+("+"===e.charAt(0)?" "+e.substr(2):""),t.setAttribute("class",r.e),o=et(t,l,tt(t),a,_),t.setAttribute("class",c),r.data=o.firstMPT,t.style.cssText=f,r.xfirst=s.parse(t,o.difs,r,n)}});var $t=function(t){if((1===t||0===t)&&this.data._totalTime===this.data._totalDuration&&"isFromStart"!==this.data.data){var e,i,s,r,n,a=this.t.style,o=d.transform.parse;if("all"===this.e)r=!(a.cssText="");else for(s=(e=this.e.split(" ").join("").split(",")).length;-1<--s;)i=e[s],d[i]&&(d[i].parse===o?r=!0:i="transformOrigin"===i?Mt:d[i].p),Zt(a,i);r&&(Zt(a,Ct),(n=this.t._gsTransform)&&(n.svg&&this.t.removeAttribute("data-svg-origin"),delete this.t._gsTransform))}};for(bt("clearProps",{parser:function(t,e,i,s,r){return(r=new gt(t,i,0,0,r,2)).setRatio=$t,r.e=e,r.pr=-10,r.data=s._tween,p=!0,r}}),t="bezier,throwProps,physicsProps,physics2D".split(","),Tt=t.length;Tt--;)wt(t[Tt]);(t=j.prototype)._firstPT=t._lastParsedTransform=t._transform=null,t._onInitTween=function(t,e,i){if(!t.nodeType)return!1;this._target=t,this._tween=i,this._vars=e,k=e.autoRound,p=!1,w=e.suffixMap||j.suffixMap,B=Q(t,""),f=this._overwriteProps;var s,r,n,a,o,l,h,_,u,c=t.style;if(m&&""===c.zIndex&&(("auto"===(s=H(t,"zIndex",B))||""===s)&&this._addLazySet(c,"zIndex",0)),"string"==typeof e&&(a=c.cssText,s=tt(t,B),c.cssText=a+";"+e,s=et(t,s,tt(t)).difs,!V&&T.test(e)&&(s.opacity=parseFloat(RegExp.$1)),e=s,c.cssText=a),this._firstPT=r=e.className?d.className.parse(t,e.className,"className",this,null,null,e):this.parse(t,e,null),this._transformType){for(u=3===this._transformType,Ct?g&&(m=!0,""===c.zIndex&&(("auto"===(h=H(t,"zIndex",B))||""===h)&&this._addLazySet(c,"zIndex",0)),v&&this._addLazySet(c,"WebkitBackfaceVisibility",this._vars.WebkitBackfaceVisibility||(u?"visible":"hidden"))):c.zoom=1,n=r;n&&n._next;)n=n._next;_=new gt(t,"transform",0,0,null,2),this._linkCSSP(_,null,n),_.setRatio=Ct?qt:Vt,_.data=this._transform||Ut(t,B,!0),_.tween=i,_.pr=-1,f.pop()}if(p){for(;r;){for(l=r._next,n=a;n&&n.pr>r.pr;)n=n._next;(r._prev=n?n._prev:o)?r._prev._next=r:a=r,(r._next=n)?n._prev=r:o=r,r=l}this._firstPT=a}return!0},t.parse=function(t,e,i,s){var r,n,a,o,l,h,_,u,c,f,p=t.style;for(r in e)h=e[r],(n=d[r])?i=n.parse(t,h,r,this,i,s,e):(l=H(t,r,B)+"",c="string"==typeof h,"color"===r||"fill"===r||"stroke"===r||-1!==r.indexOf("Color")||c&&x.test(h)?(c||(h=(3<(h=ut(h)).length?"rgba(":"rgb(")+h.join(",")+")"),i=yt(p,r,l,h,!0,"transparent",i,0,s)):!c||-1===h.indexOf(" ")&&-1===h.indexOf(",")?(_=(a=parseFloat(l))||0===a?l.substr((a+"").length):"",(""===l||"auto"===l)&&(_="width"===r||"height"===r?(a=rt(t,r,B),"px"):"left"===r||"top"===r?(a=J(t,r,B),"px"):(a="opacity"!==r?0:1,"")),""===(u=(f=c&&"="===h.charAt(1))?(o=parseInt(h.charAt(0)+"1",10),h=h.substr(2),o*=parseFloat(h),h.replace(S,"")):(o=parseFloat(h),c?h.replace(S,""):""))&&(u=r in w?w[r]:_),h=o||0===o?(f?o+a:o)+u:e[r],_!==u&&""!==u&&(o||0===o)&&a&&(a=K(t,r,a,_),"%"===u?(a/=K(t,r,100,"%")/100,!0!==e.strictUnits&&(l=a+"%")):"em"===u||"rem"===u?a/=K(t,r,1,u):"px"!==u&&(o=K(t,r,o,u),u="px"),f&&(o||0===o)&&(h=o+a+u)),f&&(o+=a),!a&&0!==a||!o&&0!==o?void 0!==p[r]&&(h||"NaN"!=h+""&&null!=h)?(i=new gt(p,r,o||a||0,0,i,-1,r,!1,0,l,h)).xs0="none"!==h||"display"!==r&&-1===r.indexOf("Style")?h:l:W("invalid "+r+" tween value: "+e[r]):(i=new gt(p,r,a,o-a,i,0,r,!1!==k&&("px"===u||"zIndex"===r),0,l,h)).xs0=u):i=yt(p,r,l,h,!0,null,i,0,s)),s&&i&&!i.plugin&&(i.plugin=s);return i},t.setRatio=function(t){var e,i,s,r=this._firstPT;if(1!==t||this._tween._time!==this._tween._duration&&0!==this._tween._time)if(t||this._tween._time!==this._tween._duration&&0!==this._tween._time||-1e-6===this._tween._rawPrevTime)for(;r;){if(e=r.c*t+r.s,r.r?e=Math.round(e):e<1e-6&&-1e-6<e&&(e=0),r.type)if(1===r.type)if(2===(s=r.l))r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2;else if(3===s)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2+r.xn2+r.xs3;else if(4===s)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2+r.xn2+r.xs3+r.xn3+r.xs4;else if(5===s)r.t[r.p]=r.xs0+e+r.xs1+r.xn1+r.xs2+r.xn2+r.xs3+r.xn3+r.xs4+r.xn4+r.xs5;else{for(i=r.xs0+e+r.xs1,s=1;r.l>s;s++)i+=r["xn"+s]+r["xs"+(s+1)];r.t[r.p]=i}else-1===r.type?r.t[r.p]=r.xs0:r.setRatio&&r.setRatio(t);else r.t[r.p]=e+r.xs0;r=r._next}else for(;r;)2!==r.type?r.t[r.p]=r.b:r.setRatio(t),r=r._next;else for(;r;){if(2!==r.type)if(r.r&&-1!==r.type)if(e=Math.round(r.s+r.c),r.type){if(1===r.type){for(s=r.l,i=r.xs0+e+r.xs1,s=1;r.l>s;s++)i+=r["xn"+s]+r["xs"+(s+1)];r.t[r.p]=i}}else r.t[r.p]=e+r.xs0;else r.t[r.p]=r.e;else r.setRatio(t);r=r._next}},t._enableTransforms=function(t){this._transform=this._transform||Ut(this._target,B,!0),this._transformType=this._transform.svg&&Pt||!t&&3!==this._transformType?2:3};var Qt=function(){this.t[this.p]=this.e,this.data._linkCSSP(this,this._next,null,!0)};t._addLazySet=function(t,e,i){var s=this._firstPT=new gt(t,e,0,0,this._firstPT,2);s.e=i,s.setRatio=Qt,s.data=this},t._linkCSSP=function(t,e,i,s){return t&&(e&&(e._prev=t),t._next&&(t._next._prev=t._prev),t._prev?t._prev._next=t._next:this._firstPT===t&&(this._firstPT=t._next,s=!0),i?i._next=t:s||null!==this._firstPT||(this._firstPT=t),t._next=e,t._prev=i),t},t._kill=function(t){var e,i,s,r=t;if(t.autoAlpha||t.alpha){for(i in r={},t)r[i]=t[i];r.opacity=1,r.autoAlpha&&(r.visibility=1)}return t.className&&(e=this._classNamePT)&&((s=e.xfirst)&&s._prev?this._linkCSSP(s._prev,e._next,s._prev._prev):s===this._firstPT&&(this._firstPT=e._next),e._next&&this._linkCSSP(e._next,e._next._next,s._prev),this._classNamePT=null),n.prototype._kill.call(this,r)};var Ht=function(t,e,i){var s,r,n,a;if(t.slice)for(r=t.length;-1<--r;)Ht(t[r],e,i);else for(r=(s=t.childNodes).length;-1<--r;)a=(n=s[r]).type,n.style&&(e.push(tt(n)),i&&i.push(n)),1!==a&&9!==a&&11!==a||!n.childNodes.length||Ht(n,e,i)};return j.cascadeTo=function(t,e,i){var s,r,n,a,o=Y.to(t,e,i),l=[o],h=[],_=[],u=[],c=Y._internals.reservedProps;for(t=o._targets||o.target,Ht(t,h,u),o.render(e,!0,!0),Ht(t,_),o.render(0,!0,!0),o._enabled(!0),s=u.length;-1<--s;)if((r=et(u[s],h[s],_[s])).firstMPT){for(n in r=r.difs,i)c[n]&&(r[n]=i[n]);for(n in a={},r)a[n]=h[s][n];l.push(Y.fromTo(u[s],e,a,r))}return l},n.activate([j]),j},!0),t=_gsScope._gsDefine.plugin({propName:"roundProps",version:"1.5",priority:-1,API:2,init:function(t,e,i){return this._tween=i,!0}}),l=function(t){for(;t;)t.f||t.blob||(t.r=1),t=t._next},(e=t.prototype)._onInitAllProps=function(){for(var t,e,i,s=this._tween,r=s.vars.roundProps.join?s.vars.roundProps:s.vars.roundProps.split(","),n=r.length,a={},o=s._propLookup.roundProps;-1<--n;)a[r[n]]=1;for(n=r.length;-1<--n;)for(t=r[n],e=s._firstPT;e;)i=e._next,e.pg?e.t._roundProps(a,!0):e.n===t&&(2===e.f&&e.t?l(e.t._firstPT):(this._add(e.t,t,e.s,e.c),i&&(i._prev=e._prev),e._prev?e._prev._next=i:s._firstPT===e&&(s._firstPT=i),e._next=e._prev=null,s._propLookup[t]=o)),e=i;return!1},e._add=function(t,e,i,s){this._addTween(t,e,i,i+s,e,!0),this._overwriteProps.push(e)},_gsScope._gsDefine.plugin({propName:"attr",API:2,version:"0.5.0",init:function(t,e){var i;if("function"!=typeof t.setAttribute)return!1;for(i in e)this._addTween(t,"setAttribute",t.getAttribute(i)+"",e[i]+"",i,!1,i),this._overwriteProps.push(i);return!0}}),_gsScope._gsDefine.plugin({propName:"directionalRotation",version:"0.2.1",API:2,init:function(t,e){"object"!=typeof e&&(e={rotation:e}),this.finals={};var i,s,r,n,a,o=!0===e.useRadians?2*Math.PI:360;for(i in e)"useRadians"!==i&&(s=(a=(e[i]+"").split("_"))[0],r=parseFloat("function"!=typeof t[i]?t[i]:t[i.indexOf("set")||"function"!=typeof t["get"+i.substr(3)]?i:"get"+i.substr(3)]()),n=(this.finals[i]="string"==typeof s&&"="===s.charAt(1)?r+parseInt(s.charAt(0)+"1",10)*Number(s.substr(2)):Number(s)||0)-r,a.length&&(-1!==(s=a.join("_")).indexOf("short")&&((n%=o)!==n%(o/2)&&(n=n<0?n+o:n-o)),-1!==s.indexOf("_cw")&&n<0?n=(n+9999999999*o)%o-(0|n/o)*o:-1!==s.indexOf("ccw")&&0<n&&(n=(n-9999999999*o)%o-(0|n/o)*o)),(1e-6<n||n<-1e-6)&&(this._addTween(t,i,r,r+n,i),this._overwriteProps.push(i)));return!0},set:function(t){var e;if(1!==t)this._super.setRatio.call(this,t);else for(e=this._firstPT;e;)e.f?e.t[e.p](this.finals[e.p]):e.t[e.p]=this.finals[e.p],e=e._next}})._autoCSS=!0,_gsScope._gsDefine("easing.Back",["easing.Ease"],function(m){var e,i,t,s=_gsScope.GreenSockGlobals||_gsScope,r=s.com.greensock,n=2*Math.PI,a=Math.PI/2,o=r._class,l=function(t,e){var i=o("easing."+t,function(){},!0),s=i.prototype=new m;return s.constructor=i,s.getRatio=e,i},h=m.register||function(){},_=function(t,e,i,s){var r=o("easing."+t,{easeOut:new e,easeIn:new i,easeInOut:new s},!0);return h(r,t),r},g=function(t,e,i){this.t=t,this.v=e,i&&(((this.next=i).prev=this).c=i.v-e,this.gap=i.t-t)},u=function(t,e){var i=o("easing."+t,function(t){this._p1=t||0===t?t:1.70158,this._p2=1.525*this._p1},!0),s=i.prototype=new m;return s.constructor=i,s.getRatio=e,s.config=function(t){return new i(t)},i},c=_("Back",u("BackOut",function(t){return(t-=1)*t*((this._p1+1)*t+this._p1)+1}),u("BackIn",function(t){return t*t*((this._p1+1)*t-this._p1)}),u("BackInOut",function(t){return(t*=2)<1?.5*t*t*((this._p2+1)*t-this._p2):.5*((t-=2)*t*((this._p2+1)*t+this._p2)+2)})),f=o("easing.SlowMo",function(t,e,i){e=e||0===e?e:.7,null==t?t=.7:1<t&&(t=1),this._p=1!==t?e:0,this._p1=(1-t)/2,this._p2=t,this._p3=this._p1+this._p2,this._calcEnd=!0===i},!0),p=f.prototype=new m;return p.constructor=f,p.getRatio=function(t){var e=t+(.5-t)*this._p;return this._p1>t?this._calcEnd?1-(t=1-t/this._p1)*t:e-(t=1-t/this._p1)*t*t*t*e:t>this._p3?this._calcEnd?1-(t=(t-this._p3)/this._p1)*t:e+(t-e)*(t=(t-this._p3)/this._p1)*t*t*t:this._calcEnd?1:e},f.ease=new f(.7,.7),p.config=f.config=function(t,e,i){return new f(t,e,i)},(p=(e=o("easing.SteppedEase",function(t){t=t||1,this._p1=1/t,this._p2=t+1},!0)).prototype=new m).constructor=e,p.getRatio=function(t){return t<0?t=0:1<=t&&(t=.999999999),(this._p2*t>>0)*this._p1},p.config=e.config=function(t){return new e(t)},(p=(i=o("easing.RoughEase",function(t){for(var e,i,s,r,n,a,o=(t=t||{}).taper||"none",l=[],h=0,_=0|(t.points||20),u=_,c=!1!==t.randomize,f=!0===t.clamp,p=t.template instanceof m?t.template:null,d="number"==typeof t.strength?.4*t.strength:.4;-1<--u;)e=c?Math.random():1/_*u,i=p?p.getRatio(e):e,s="none"===o?d:"out"===o?(r=1-e)*r*d:"in"===o?e*e*d:.5*(r=e<.5?2*e:2*(1-e))*r*d,c?i+=Math.random()*s-.5*s:u%2?i+=.5*s:i-=.5*s,f&&(1<i?i=1:i<0&&(i=0)),l[h++]={x:e,y:i};for(l.sort(function(t,e){return t.x-e.x}),a=new g(1,1,null),u=_;-1<--u;)n=l[u],a=new g(n.x,n.y,a);this._prev=new g(0,0,0!==a.t?a:a.next)},!0)).prototype=new m).constructor=i,p.getRatio=function(t){var e=this._prev;if(t>e.t){for(;e.next&&t>=e.t;)e=e.next;e=e.prev}else for(;e.prev&&e.t>=t;)e=e.prev;return(this._prev=e).v+(t-e.t)/e.gap*e.c},p.config=function(t){return new i(t)},i.ease=new i,_("Bounce",l("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}),l("BounceIn",function(t){return 1/2.75>(t=1-t)?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}),l("BounceInOut",function(t){var e=t<.5;return t=(t=e?1-2*t:2*t-1)<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,e?.5*(1-t):.5*t+.5})),_("Circ",l("CircOut",function(t){return Math.sqrt(1-(t-=1)*t)}),l("CircIn",function(t){return-(Math.sqrt(1-t*t)-1)}),l("CircInOut",function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)})),_("Elastic",(t=function(t,e,i){var s=o("easing."+t,function(t,e){this._p1=1<=t?t:1,this._p2=(e||i)/(t<1?t:1),this._p3=this._p2/n*(Math.asin(1/this._p1)||0),this._p2=n/this._p2},!0),r=s.prototype=new m;return r.constructor=s,r.getRatio=e,r.config=function(t,e){return new s(t,e)},s})("ElasticOut",function(t){return this._p1*Math.pow(2,-10*t)*Math.sin((t-this._p3)*this._p2)+1},.3),t("ElasticIn",function(t){return-this._p1*Math.pow(2,10*(t-=1))*Math.sin((t-this._p3)*this._p2)},.3),t("ElasticInOut",function(t){return(t*=2)<1?-.5*this._p1*Math.pow(2,10*(t-=1))*Math.sin((t-this._p3)*this._p2):.5*this._p1*Math.pow(2,-10*(t-=1))*Math.sin((t-this._p3)*this._p2)+1},.45)),_("Expo",l("ExpoOut",function(t){return 1-Math.pow(2,-10*t)}),l("ExpoIn",function(t){return Math.pow(2,10*(t-1))-.001}),l("ExpoInOut",function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))})),_("Sine",l("SineOut",function(t){return Math.sin(t*a)}),l("SineIn",function(t){return 1-Math.cos(t*a)}),l("SineInOut",function(t){return-.5*(Math.cos(Math.PI*t)-1)})),o("easing.EaseLookup",{find:function(t){return m.map[t]}},!0),h(s.SlowMo,"SlowMo","ease,"),h(i,"RoughEase","ease,"),h(e,"SteppedEase","ease,"),c},!0)}),_gsScope._gsDefine&&_gsScope._gsQueue.pop()(),function(f,t){"use strict";var e,i,p=f.GreenSockGlobals=f.GreenSockGlobals||f;if(!p.TweenLite){var s,r,n,d,m,g=function(t){var e,i=t.split("."),s=p;for(e=0;i.length>e;e++)s[i[e]]=s=s[i[e]]||{};return s},u=g("com.greensock"),v=1e-10,l=function(t){var e,i=[],s=t.length;for(e=0;e!==s;i.push(t[e++]));return i},y=function(){},T=(e=Object.prototype.toString,i=e.call([]),function(t){return null!=t&&(t instanceof Array||"object"==typeof t&&!!t.push&&e.call(t)===i)}),x={},b=function(l,h,_,u){this.sc=x[l]?x[l].sc:[],(x[l]=this).gsClass=null,this.func=_;var c=[];this.check=function(t){for(var e,i,s,r,n,a=h.length,o=a;-1<--a;)(e=x[h[a]]||new b(h[a],[])).gsClass?(c[a]=e.gsClass,o--):t&&e.sc.push(this);if(0===o&&_)for(s=(i=("com.greensock."+l).split(".")).pop(),r=g(i.join("."))[s]=this.gsClass=_.apply(_,c),u&&(p[s]=r,!(n="undefined"!=typeof module&&module.exports)&&"function"==typeof define&&define.amd?define((f.GreenSockAMDPath?f.GreenSockAMDPath+"/":"")+l.split(".").pop(),[],function(){return r}):"TweenMax"===l&&n&&(module.exports=r)),a=0;this.sc.length>a;a++)this.sc[a].check()},this.check(!0)},a=f._gsDefine=function(t,e,i,s){return new b(t,e,i,s)},c=u._class=function(t,e,i){return e=e||function(){},a(t,[],function(){return e},i),e};a.globals=p;var o=[0,0,1,1],h=[],_=c("easing.Ease",function(t,e,i,s){this._func=t,this._type=i||0,this._power=s||0,this._params=e?o.concat(e):o},!0),w=_.map={},P=_.register=function(t,e,i,s){for(var r,n,a,o,l=e.split(","),h=l.length,_=(i||"easeIn,easeOut,easeInOut").split(",");-1<--h;)for(n=l[h],r=s?c("easing."+n,null,!0):u.easing[n]||{},a=_.length;-1<--a;)o=_[a],w[n+"."+o]=w[o+n]=r[o]=t.getRatio?t:t[o]||new t};for((n=_.prototype)._calcEnd=!1,n.getRatio=function(t){if(this._func)return this._params[0]=t,this._func.apply(null,this._params);var e=this._type,i=this._power,s=1===e?1-t:2===e?t:t<.5?2*t:2*(1-t);return 1===i?s*=s:2===i?s*=s*s:3===i?s*=s*s*s:4===i&&(s*=s*s*s*s),1===e?1-s:2===e?s:t<.5?s/2:1-s/2},r=(s=["Linear","Quad","Cubic","Quart","Quint,Strong"]).length;-1<--r;)n=s[r]+",Power"+r,P(new _(null,null,1,r),n,"easeOut",!0),P(new _(null,null,2,r),n,"easeIn"+(0===r?",easeNone":"")),P(new _(null,null,3,r),n,"easeInOut");w.linear=u.easing.Linear.easeIn,w.swing=u.easing.Quad.easeInOut;var O=c("events.EventDispatcher",function(t){this._listeners={},this._eventTarget=t||this});(n=O.prototype).addEventListener=function(t,e,i,s,r){r=r||0;var n,a,o=this._listeners[t],l=0;for(null==o&&(this._listeners[t]=o=[]),a=o.length;-1<--a;)(n=o[a]).c===e&&n.s===i?o.splice(a,1):0===l&&r>n.pr&&(l=a+1);o.splice(l,0,{c:e,s:i,up:s,pr:r}),this!==d||m||d.wake()},n.removeEventListener=function(t,e){var i,s=this._listeners[t];if(s)for(i=s.length;-1<--i;)if(s[i].c===e)return void s.splice(i,1)},n.dispatchEvent=function(t){var e,i,s,r=this._listeners[t];if(r)for(e=r.length,i=this._eventTarget;-1<--e;)(s=r[e])&&(s.up?s.c.call(s.s||i,{type:t,target:i}):s.c.call(s.s||i))};var S=f.requestAnimationFrame,k=f.cancelAnimationFrame,R=Date.now||function(){return(new Date).getTime()},A=R();for(r=(s=["ms","moz","webkit","o"]).length;-1<--r&&!S;)S=f[s[r]+"RequestAnimationFrame"],k=f[s[r]+"CancelAnimationFrame"]||f[s[r]+"CancelRequestAnimationFrame"];c("Ticker",function(t,e){var r,n,a,o,l,h=this,_=R(),i=!1!==e&&S,u=500,c=33,f=function(t){var e,i,s=R()-A;u<s&&(_+=s-c),A+=s,h.time=(A-_)/1e3,e=h.time-l,(!r||0<e||!0===t)&&(h.frame++,l+=e+(o<=e?.004:o-e),i=!0),!0!==t&&(a=n(f)),i&&h.dispatchEvent("tick")};O.call(h),h.time=h.frame=0,h.tick=function(){f(!0)},h.lagSmoothing=function(t,e){u=t||1e10,c=Math.min(e,u,0)},h.sleep=function(){null!=a&&(i&&k?k(a):clearTimeout(a),n=y,a=null,h===d&&(m=!1))},h.wake=function(){null!==a?h.sleep():10<h.frame&&(A=R()-u+5),n=0===r?y:i&&S?S:function(t){return setTimeout(t,0|1e3*(l-h.time)+1)},h===d&&(m=!0),f(2)},h.fps=function(t){return arguments.length?(o=1/((r=t)||60),l=this.time+o,void h.wake()):r},h.useRAF=function(t){return arguments.length?(h.sleep(),i=t,void h.fps(r)):i},h.fps(t),setTimeout(function(){i&&h.frame<5&&h.useRAF(!1)},1500)}),(n=u.Ticker.prototype=new u.events.EventDispatcher).constructor=u.Ticker;var C=c("core.Animation",function(t,e){if(this.vars=e=e||{},this._duration=this._totalDuration=t||0,this._delay=Number(e.delay)||0,this._timeScale=1,this._active=!0===e.immediateRender,this.data=e.data,this._reversed=!0===e.reversed,G){m||d.wake();var i=this.vars.useFrames?Z:G;i.add(this,i._time),this.vars.paused&&this.paused(!0)}});d=C.ticker=new u.Ticker,(n=C.prototype)._dirty=n._gc=n._initted=n._paused=!1,n._totalTime=n._time=0,n._rawPrevTime=-1,n._next=n._last=n._onUpdate=n._timeline=n.timeline=null,n._paused=!1;var D=function(){m&&2e3<R()-A&&d.wake(),setTimeout(D,2e3)};D(),n.play=function(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},n.pause=function(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},n.resume=function(t,e){return null!=t&&this.seek(t,e),this.paused(!1)},n.seek=function(t,e){return this.totalTime(Number(t),!1!==e)},n.restart=function(t,e){return this.reversed(!1).paused(!1).totalTime(t?-this._delay:0,!1!==e,!0)},n.reverse=function(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},n.render=function(){},n.invalidate=function(){return this._time=this._totalTime=0,this._initted=this._gc=!1,this._rawPrevTime=-1,(this._gc||!this.timeline)&&this._enabled(!0),this},n.isActive=function(){var t,e=this._timeline,i=this._startTime;return!e||!this._gc&&!this._paused&&e.isActive()&&(t=e.rawTime())>=i&&i+this.totalDuration()/this._timeScale>t},n._enabled=function(t,e){return m||d.wake(),this._gc=!t,this._active=this.isActive(),!0!==e&&(t&&!this.timeline?this._timeline.add(this,this._startTime-this._delay):!t&&this.timeline&&this._timeline._remove(this,!0)),!1},n._kill=function(){return this._enabled(!1,!1)},n.kill=function(t,e){return this._kill(t,e),this},n._uncache=function(t){for(var e=t?this:this.timeline;e;)e._dirty=!0,e=e.timeline;return this},n._swapSelfInParams=function(t){for(var e=t.length,i=t.concat();-1<--e;)"{self}"===t[e]&&(i[e]=this);return i},n._callback=function(t){var e=this.vars;e[t].apply(e[t+"Scope"]||e.callbackScope||this,e[t+"Params"]||h)},n.eventCallback=function(t,e,i,s){if("on"===(t||"").substr(0,2)){var r=this.vars;if(1===arguments.length)return r[t];null==e?delete r[t]:(r[t]=e,r[t+"Params"]=T(i)&&-1!==i.join("").indexOf("{self}")?this._swapSelfInParams(i):i,r[t+"Scope"]=s),"onUpdate"===t&&(this._onUpdate=e)}return this},n.delay=function(t){return arguments.length?(this._timeline.smoothChildTiming&&this.startTime(this._startTime+t-this._delay),this._delay=t,this):this._delay},n.duration=function(t){return arguments.length?(this._duration=this._totalDuration=t,this._uncache(!0),this._timeline.smoothChildTiming&&0<this._time&&this._time<this._duration&&0!==t&&this.totalTime(this._totalTime*(t/this._duration),!0),this):(this._dirty=!1,this._duration)},n.totalDuration=function(t){return this._dirty=!1,arguments.length?this.duration(t):this._totalDuration},n.time=function(t,e){return arguments.length?(this._dirty&&this.totalDuration(),this.totalTime(t>this._duration?this._duration:t,e)):this._time},n.totalTime=function(t,e,i){if(m||d.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(t<0&&!i&&(t+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var s=this._totalDuration,r=this._timeline;if(s<t&&!i&&(t=s),this._startTime=(this._paused?this._pauseTime:r._time)-(this._reversed?s-t:t)/this._timeScale,r._dirty||this._uncache(!1),r._timeline)for(;r._timeline;)r._timeline._time!==(r._startTime+r._totalTime)/r._timeScale&&r.totalTime(r._totalTime,!0),r=r._timeline}this._gc&&this._enabled(!0,!1),(this._totalTime!==t||0===this._duration)&&(I.length&&Q(),this.render(t,e,!1),I.length&&Q())}return this},n.progress=n.totalProgress=function(t,e){var i=this.duration();return arguments.length?this.totalTime(i*t,e):i?this._time/i:this.ratio},n.startTime=function(t){return arguments.length?(t!==this._startTime&&(this._startTime=t,this.timeline&&this.timeline._sortChildren&&this.timeline.add(this,t-this._delay)),this):this._startTime},n.endTime=function(t){return this._startTime+(0!=t?this.totalDuration():this.duration())/this._timeScale},n.timeScale=function(t){if(!arguments.length)return this._timeScale;if(t=t||v,this._timeline&&this._timeline.smoothChildTiming){var e=this._pauseTime,i=e||0===e?e:this._timeline.totalTime();this._startTime=i-(i-this._startTime)*this._timeScale/t}return this._timeScale=t,this._uncache(!1)},n.reversed=function(t){return arguments.length?(t!=this._reversed&&(this._reversed=t,this.totalTime(this._timeline&&!this._timeline.smoothChildTiming?this.totalDuration()-this._totalTime:this._totalTime,!0)),this):this._reversed},n.paused=function(t){if(!arguments.length)return this._paused;var e,i,s=this._timeline;return t!=this._paused&&s&&(m||t||d.wake(),i=(e=s.rawTime())-this._pauseTime,!t&&s.smoothChildTiming&&(this._startTime+=i,this._uncache(!1)),this._pauseTime=t?e:null,this._paused=t,this._active=this.isActive(),!t&&0!=i&&this._initted&&this.duration()&&(e=s.smoothChildTiming?this._totalTime:(e-this._startTime)/this._timeScale,this.render(e,e===this._totalTime,!0))),this._gc&&!t&&this._enabled(!0,!1),this};var M=c("core.SimpleTimeline",function(t){C.call(this,0,t),this.autoRemoveChildren=this.smoothChildTiming=!0});(n=M.prototype=new C).constructor=M,n.kill()._gc=!1,n._first=n._last=n._recent=null,n._sortChildren=!1,n.add=n.insert=function(t,e){var i,s;if(t._startTime=Number(e||0)+t._delay,t._paused&&this!==t._timeline&&(t._pauseTime=t._startTime+(this.rawTime()-t._startTime)/t._timeScale),t.timeline&&t.timeline._remove(t,!0),t.timeline=t._timeline=this,t._gc&&t._enabled(!0,!0),i=this._last,this._sortChildren)for(s=t._startTime;i&&i._startTime>s;)i=i._prev;return i?(t._next=i._next,i._next=t):(t._next=this._first,this._first=t),t._next?t._next._prev=t:this._last=t,t._prev=i,this._recent=t,this._timeline&&this._uncache(!0),this},n._remove=function(t,e){return t.timeline===this&&(e||t._enabled(!1,!0),t._prev?t._prev._next=t._next:this._first===t&&(this._first=t._next),t._next?t._next._prev=t._prev:this._last===t&&(this._last=t._prev),t._next=t._prev=t.timeline=null,t===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},n.render=function(t,e,i){var s,r=this._first;for(this._totalTime=this._time=this._rawPrevTime=t;r;)s=r._next,(r._active||t>=r._startTime&&!r._paused)&&(r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(t-r._startTime)*r._timeScale,e,i):r.render((t-r._startTime)*r._timeScale,e,i)),r=s},n.rawTime=function(){return m||d.wake(),this._totalTime};var z=c("TweenLite",function(t,e,i){if(C.call(this,e,i),this.render=z.prototype.render,null==t)throw"Cannot tween a null target.";this.target=t="string"!=typeof t?t:z.selector(t)||t;var s,r,n,a=t.jquery||t.length&&t!==f&&t[0]&&(t[0]===f||t[0].nodeType&&t[0].style&&!t.nodeType),o=this.vars.overwrite;if(this._overwrite=o=null==o?W[z.defaultOverwrite]:"number"==typeof o?o>>0:W[o],(a||t instanceof Array||t.push&&T(t))&&"number"!=typeof t[0])for(this._targets=n=l(t),this._propLookup=[],this._siblings=[],s=0;n.length>s;s++)(r=n[s])?"string"!=typeof r?r.length&&r!==f&&r[0]&&(r[0]===f||r[0].nodeType&&r[0].style&&!r.nodeType)?(n.splice(s--,1),this._targets=n=n.concat(l(r))):(this._siblings[s]=H(r,this,!1),1===o&&1<this._siblings[s].length&&J(r,this,null,1,this._siblings[s])):"string"==typeof(r=n[s--]=z.selector(r))&&n.splice(s+1,1):n.splice(s--,1);else this._propLookup={},this._siblings=H(t,this,!1),1===o&&1<this._siblings.length&&J(t,this,null,1,this._siblings);(this.vars.immediateRender||0===e&&0===this._delay&&!1!==this.vars.immediateRender)&&(this._time=-v,this.render(-this._delay))},!0),F=function(t){return t&&t.length&&t!==f&&t[0]&&(t[0]===f||t[0].nodeType&&t[0].style&&!t.nodeType)};(n=z.prototype=new C).constructor=z,n.kill()._gc=!1,n.ratio=0,n._firstPT=n._targets=n._overwrittenProps=n._startAt=null,n._notifyPluginsOfEnabled=n._lazy=!1,z.version="1.18.0",z.defaultEase=n._ease=new _(null,null,1,1),z.defaultOverwrite="auto",z.ticker=d,z.autoSleep=120,z.lagSmoothing=function(t,e){d.lagSmoothing(t,e)},z.selector=f.$||f.jQuery||function(t){var e=f.$||f.jQuery;return e?(z.selector=e)(t):"undefined"==typeof document?t:document.querySelectorAll?document.querySelectorAll(t):document.getElementById("#"===t.charAt(0)?t.substr(1):t)};var I=[],X={},N=/(?:(-|-=|\+=)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,L=function(t){for(var e,i=this._firstPT;i;)e=i.blob?t?this.join(""):this.start:i.c*t+i.s,i.r?e=Math.round(e):e<1e-6&&-1e-6<e&&(e=0),i.f?i.fp?i.t[i.p](i.fp,e):i.t[i.p](e):i.t[i.p]=e,i=i._next},E=function(t,e,i,s){var r,n,a,o,l,h,_,u=[t,e],c=0,f="",p=0;for(u.start=t,i&&(i(u),t=u[0],e=u[1]),u.length=0,r=t.match(N)||[],n=e.match(N)||[],s&&(s._next=null,s.blob=1,u._firstPT=s),l=n.length,o=0;o<l;o++)_=n[o],f+=(h=e.substr(c,e.indexOf(_,c)-c))||!o?h:",",c+=h.length,p?p=(p+1)%5:"rgba("===h.substr(-5)&&(p=1),_===r[o]||o>=r.length?f+=_:(f&&(u.push(f),f=""),a=parseFloat(r[o]),u.push(a),u._firstPT={_next:u._firstPT,t:u,p:u.length-1,s:a,c:("="===_.charAt(1)?parseInt(_.charAt(0)+"1",10)*parseFloat(_.substr(2)):parseFloat(_)-a)||0,f:0,r:p&&p<4}),c+=_.length;return(f+=e.substr(c))&&u.push(f),u.setRatio=L,u},Y=function(t,e,i,s,r,n,a,o){var l,h="get"===i?t[e]:i,_=typeof t[e],u="string"==typeof s&&"="===s.charAt(1),c={t:t,p:e,s:h,f:"function"==_,pg:0,n:r||e,r:n,pr:0,c:u?parseInt(s.charAt(0)+"1",10)*parseFloat(s.substr(2)):parseFloat(s)-h||0};return"number"!=_&&("function"==_&&"get"===i&&(l=e.indexOf("set")||"function"!=typeof t["get"+e.substr(3)]?e:"get"+e.substr(3),c.s=h=a?t[l](a):t[l]()),"string"==typeof h&&(a||isNaN(h))?(c.fp=a,c={t:E(h,s,o||z.defaultStringFilter,c),p:"setRatio",s:0,c:1,f:2,pg:0,n:r||e,pr:0}):u||(c.c=parseFloat(s)-parseFloat(h)||0)),c.c?((c._next=this._firstPT)&&(c._next._prev=c),this._firstPT=c):void 0},B=z._internals={isArray:T,isSelector:F,lazyTweens:I,blobDif:E},j=z._plugins={},U=B.tweenLookup={},V=0,q=B.reservedProps={ease:1,delay:1,overwrite:1,onComplete:1,onCompleteParams:1,onCompleteScope:1,useFrames:1,runBackwards:1,startAt:1,onUpdate:1,onUpdateParams:1,onUpdateScope:1,onStart:1,onStartParams:1,onStartScope:1,onReverseComplete:1,onReverseCompleteParams:1,onReverseCompleteScope:1,onRepeat:1,onRepeatParams:1,onRepeatScope:1,easeParams:1,yoyo:1,immediateRender:1,repeat:1,repeatDelay:1,data:1,paused:1,reversed:1,autoCSS:1,lazy:1,onOverwrite:1,callbackScope:1,stringFilter:1},W={none:0,all:1,auto:2,concurrent:3,allOnStart:4,preexisting:5,true:1,false:0},Z=C._rootFramesTimeline=new M,G=C._rootTimeline=new M,$=30,Q=B.lazyRender=function(){var t,e=I.length;for(X={};-1<--e;)(t=I[e])&&!1!==t._lazy&&(t.render(t._lazy[0],t._lazy[1],!0),t._lazy=!1);I.length=0};G._startTime=d.time,Z._startTime=d.frame,G._active=Z._active=!0,setTimeout(Q,1),C._updateRoot=z.render=function(){var t,e,i;if(I.length&&Q(),G.render((d.time-G._startTime)*G._timeScale,!1,!1),Z.render((d.frame-Z._startTime)*Z._timeScale,!1,!1),I.length&&Q(),d.frame>=$){for(i in $=d.frame+(parseInt(z.autoSleep,10)||120),U){for(t=(e=U[i].tweens).length;-1<--t;)e[t]._gc&&e.splice(t,1);0===e.length&&delete U[i]}if((!(i=G._first)||i._paused)&&z.autoSleep&&!Z._first&&1===d._listeners.tick.length){for(;i&&i._paused;)i=i._next;i||d.sleep()}}},d.addEventListener("tick",C._updateRoot);var H=function(t,e,i){var s,r,n=t._gsTweenID;if(U[n||(t._gsTweenID=n="t"+V++)]||(U[n]={target:t,tweens:[]}),e&&((s=U[n].tweens)[r=s.length]=e,i))for(;-1<--r;)s[r]===e&&s.splice(r,1);return U[n].tweens},K=function(t,e,i,s){var r,n,a=t.vars.onOverwrite;return a&&(r=a(t,e,i,s)),(a=z.onOverwrite)&&(n=a(t,e,i,s)),!1!==r&&!1!==n},J=function(t,e,i,s,r){var n,a,o,l;if(1===s||4<=s){for(l=r.length,n=0;n<l;n++)if((o=r[n])!==e)o._gc||o._kill(null,t,e)&&(a=!0);else if(5===s)break;return a}var h,_=e._startTime+v,u=[],c=0,f=0===e._duration;for(n=r.length;-1<--n;)(o=r[n])===e||o._gc||o._paused||(o._timeline!==e._timeline?(h=h||tt(e,0,f),0===tt(o,h,f)&&(u[c++]=o)):_>=o._startTime&&o._startTime+o.totalDuration()/o._timeScale>_&&((f||!o._initted)&&_-o._startTime<=2e-10||(u[c++]=o)));for(n=c;-1<--n;)if(o=u[n],2===s&&o._kill(i,t,e)&&(a=!0),2!==s||!o._firstPT&&o._initted){if(2!==s&&!K(o,e))continue;o._enabled(!1,!1)&&(a=!0)}return a},tt=function(t,e,i){for(var s=t._timeline,r=s._timeScale,n=t._startTime;s._timeline;){if(n+=s._startTime,r*=s._timeScale,s._paused)return-100;s=s._timeline}return e<(n/=r)?n-e:i&&n===e||!t._initted&&n-e<2*v?v:(n+=t.totalDuration()/t._timeScale/r)>e+v?0:n-e-v};n._init=function(){var t,e,i,s,r,n=this.vars,a=this._overwrittenProps,o=this._duration,l=!!n.immediateRender,h=n.ease;if(n.startAt){for(s in this._startAt&&(this._startAt.render(-1,!0),this._startAt.kill()),r={},n.startAt)r[s]=n.startAt[s];if(r.overwrite=!1,r.immediateRender=!0,r.lazy=l&&!1!==n.lazy,r.startAt=r.delay=null,this._startAt=z.to(this.target,0,r),l)if(0<this._time)this._startAt=null;else if(0!==o)return}else if(n.runBackwards&&0!==o)if(this._startAt)this._startAt.render(-1,!0),this._startAt.kill(),this._startAt=null;else{for(s in 0!==this._time&&(l=!1),i={},n)q[s]&&"autoCSS"!==s||(i[s]=n[s]);if(i.overwrite=0,i.data="isFromStart",i.lazy=l&&!1!==n.lazy,i.immediateRender=l,this._startAt=z.to(this.target,0,i),l){if(0===this._time)return}else this._startAt._init(),this._startAt._enabled(!1),this.vars.immediateRender&&(this._startAt=null)}if(this._ease=h=h?h instanceof _?h:"function"==typeof h?new _(h,n.easeParams):w[h]||z.defaultEase:z.defaultEase,n.easeParams instanceof Array&&h.config&&(this._ease=h.config.apply(h,n.easeParams)),this._easeType=this._ease._type,this._easePower=this._ease._power,this._firstPT=null,this._targets)for(t=this._targets.length;-1<--t;)this._initProps(this._targets[t],this._propLookup[t]={},this._siblings[t],a?a[t]:null)&&(e=!0);else e=this._initProps(this.target,this._propLookup,this._siblings,a);if(e&&z._onPluginEvent("_onInitAllProps",this),a&&(this._firstPT||"function"!=typeof this.target&&this._enabled(!1,!1)),n.runBackwards)for(i=this._firstPT;i;)i.s+=i.c,i.c=-i.c,i=i._next;this._onUpdate=n.onUpdate,this._initted=!0},n._initProps=function(t,e,i,s){var r,n,a,o,l,h;if(null==t)return!1;for(r in X[t._gsTweenID]&&Q(),this.vars.css||t.style&&t!==f&&t.nodeType&&j.css&&!1!==this.vars.autoCSS&&function(t,e){var i,s={};for(i in t)q[i]||i in e&&"transform"!==i&&"x"!==i&&"y"!==i&&"width"!==i&&"height"!==i&&"className"!==i&&"border"!==i||!(!j[i]||j[i]&&j[i]._autoCSS)||(s[i]=t[i],delete t[i]);t.css=s}(this.vars,t),this.vars)if(h=this.vars[r],q[r])h&&(h instanceof Array||h.push&&T(h))&&-1!==h.join("").indexOf("{self}")&&(this.vars[r]=h=this._swapSelfInParams(h,this));else if(j[r]&&(o=new j[r])._onInitTween(t,this.vars[r],this)){for(this._firstPT=l={_next:this._firstPT,t:o,p:"setRatio",s:0,c:1,f:1,n:r,pg:1,pr:o._priority},n=o._overwriteProps.length;-1<--n;)e[o._overwriteProps[n]]=this._firstPT;(o._priority||o._onInitAllProps)&&(a=!0),(o._onDisable||o._onEnable)&&(this._notifyPluginsOfEnabled=!0),l._next&&(l._next._prev=l)}else e[r]=Y.call(this,t,r,"get",h,r,0,null,this.vars.stringFilter);return s&&this._kill(s,t)?this._initProps(t,e,i,s):1<this._overwrite&&this._firstPT&&1<i.length&&J(t,this,e,this._overwrite,i)?(this._kill(e,t),this._initProps(t,e,i,s)):(this._firstPT&&(!1!==this.vars.lazy&&this._duration||this.vars.lazy&&!this._duration)&&(X[t._gsTweenID]=!0),a)},n.render=function(t,e,i){var s,r,n,a,o=this._time,l=this._duration,h=this._rawPrevTime;if(l<=t)this._totalTime=this._time=l,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1,this._reversed||(s=!0,r="onComplete",i=i||this._timeline.autoRemoveChildren),0===l&&(this._initted||!this.vars.lazy||i)&&(this._startTime===this._timeline._duration&&(t=0),(0===t||h<0||h===v&&"isPause"!==this.data)&&h!==t&&(i=!0,v<h&&(r="onReverseComplete")),this._rawPrevTime=a=!e||t||h===t?t:v);else if(t<1e-7)this._totalTime=this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0,(0!==o||0===l&&0<h)&&(r="onReverseComplete",s=this._reversed),t<0&&(this._active=!1,0===l&&(this._initted||!this.vars.lazy||i)&&(0<=h&&(h!==v||"isPause"!==this.data)&&(i=!0),this._rawPrevTime=a=!e||t||h===t?t:v)),this._initted||(i=!0);else if(this._totalTime=this._time=t,this._easeType){var _=t/l,u=this._easeType,c=this._easePower;(1===u||3===u&&.5<=_)&&(_=1-_),3===u&&(_*=2),1===c?_*=_:2===c?_*=_*_:3===c?_*=_*_*_:4===c&&(_*=_*_*_*_),this.ratio=1===u?1-_:2===u?_:t/l<.5?_/2:1-_/2}else this.ratio=this._ease.getRatio(t/l);if(this._time!==o||i){if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!i&&this._firstPT&&(!1!==this.vars.lazy&&this._duration||this.vars.lazy&&!this._duration))return this._time=this._totalTime=o,this._rawPrevTime=h,I.push(this),void(this._lazy=[t,e]);this._time&&!s?this.ratio=this._ease.getRatio(this._time/l):s&&this._ease._calcEnd&&(this.ratio=this._ease.getRatio(0===this._time?0:1))}for(!1!==this._lazy&&(this._lazy=!1),this._active||!this._paused&&this._time!==o&&0<=t&&(this._active=!0),0===o&&(this._startAt&&(0<=t?this._startAt.render(t,e,i):r||(r="_dummyGS")),this.vars.onStart&&(0!==this._time||0===l)&&(e||this._callback("onStart"))),n=this._firstPT;n;)n.f?n.t[n.p](n.c*this.ratio+n.s):n.t[n.p]=n.c*this.ratio+n.s,n=n._next;this._onUpdate&&(t<0&&this._startAt&&-1e-4!==t&&this._startAt.render(t,e,i),e||(this._time!==o||s)&&this._callback("onUpdate")),r&&(!this._gc||i)&&(t<0&&this._startAt&&!this._onUpdate&&-1e-4!==t&&this._startAt.render(t,e,i),s&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[r]&&this._callback(r),0===l&&this._rawPrevTime===v&&a!==v&&(this._rawPrevTime=0))}},n._kill=function(t,e,i){if("all"===t&&(t=null),null==t&&(null==e||e===this.target))return this._lazy=!1,this._enabled(!1,!1);e="string"!=typeof e?e||this._targets||this.target:z.selector(e)||e;var s,r,n,a,o,l,h,_,u,c=i&&this._time&&i._startTime===this._startTime&&this._timeline===i._timeline;if((T(e)||F(e))&&"number"!=typeof e[0])for(s=e.length;-1<--s;)this._kill(t,e[s],i)&&(l=!0);else{if(this._targets){for(s=this._targets.length;-1<--s;)if(e===this._targets[s]){o=this._propLookup[s]||{},this._overwrittenProps=this._overwrittenProps||[],r=this._overwrittenProps[s]=t?this._overwrittenProps[s]||{}:"all";break}}else{if(e!==this.target)return!1;o=this._propLookup,r=this._overwrittenProps=t?this._overwrittenProps||{}:"all"}if(o){if(h=t||o,_=t!==r&&"all"!==r&&t!==o&&("object"!=typeof t||!t._tempKill),i&&(z.onOverwrite||this.vars.onOverwrite)){for(n in h)o[n]&&(u||(u=[]),u.push(n));if((u||!t)&&!K(this,i,e,u))return!1}for(n in h)(a=o[n])&&(c&&(a.f?a.t[a.p](a.s):a.t[a.p]=a.s,l=!0),a.pg&&a.t._kill(h)&&(l=!0),a.pg&&0!==a.t._overwriteProps.length||(a._prev?a._prev._next=a._next:a===this._firstPT&&(this._firstPT=a._next),a._next&&(a._next._prev=a._prev),a._next=a._prev=null),delete o[n]),_&&(r[n]=1);!this._firstPT&&this._initted&&this._enabled(!1,!1)}}return l},n.invalidate=function(){return this._notifyPluginsOfEnabled&&z._onPluginEvent("_onDisable",this),this._firstPT=this._overwrittenProps=this._startAt=this._onUpdate=null,this._notifyPluginsOfEnabled=this._active=this._lazy=!1,this._propLookup=this._targets?{}:[],C.prototype.invalidate.call(this),this.vars.immediateRender&&(this._time=-v,this.render(-this._delay)),this},n._enabled=function(t,e){if(m||d.wake(),t&&this._gc){var i,s=this._targets;if(s)for(i=s.length;-1<--i;)this._siblings[i]=H(s[i],this,!0);else this._siblings=H(this.target,this,!0)}return C.prototype._enabled.call(this,t,e),!(!this._notifyPluginsOfEnabled||!this._firstPT)&&z._onPluginEvent(t?"_onEnable":"_onDisable",this)},z.to=function(t,e,i){return new z(t,e,i)},z.from=function(t,e,i){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,new z(t,e,i)},z.fromTo=function(t,e,i,s){return s.startAt=i,s.immediateRender=0!=s.immediateRender&&0!=i.immediateRender,new z(t,e,s)},z.delayedCall=function(t,e,i,s,r){return new z(e,0,{delay:t,onComplete:e,onCompleteParams:i,callbackScope:s,onReverseComplete:e,onReverseCompleteParams:i,immediateRender:!1,lazy:!1,useFrames:r,overwrite:0})},z.set=function(t,e){return new z(t,0,e)},z.getTweensOf=function(t,e){if(null==t)return[];var i,s,r,n;if(t="string"!=typeof t?t:z.selector(t)||t,(T(t)||F(t))&&"number"!=typeof t[0]){for(i=t.length,s=[];-1<--i;)s=s.concat(z.getTweensOf(t[i],e));for(i=s.length;-1<--i;)for(n=s[i],r=i;-1<--r;)n===s[r]&&s.splice(i,1)}else for(i=(s=H(t).concat()).length;-1<--i;)(s[i]._gc||e&&!s[i].isActive())&&s.splice(i,1);return s},z.killTweensOf=z.killDelayedCallsTo=function(t,e,i){"object"==typeof e&&(i=e,e=!1);for(var s=z.getTweensOf(t,e),r=s.length;-1<--r;)s[r]._kill(i,t)};var et=c("plugins.TweenPlugin",function(t,e){this._overwriteProps=(t||"").split(","),this._propName=this._overwriteProps[0],this._priority=e||0,this._super=et.prototype},!0);if(n=et.prototype,et.version="1.18.0",et.API=2,n._firstPT=null,n._addTween=Y,n.setRatio=L,n._kill=function(t){var e,i=this._overwriteProps,s=this._firstPT;if(null!=t[this._propName])this._overwriteProps=[];else for(e=i.length;-1<--e;)null!=t[i[e]]&&i.splice(e,1);for(;s;)null!=t[s.n]&&(s._next&&(s._next._prev=s._prev),s._prev?(s._prev._next=s._next,s._prev=null):this._firstPT===s&&(this._firstPT=s._next)),s=s._next;return!1},n._roundProps=function(t,e){for(var i=this._firstPT;i;)(t[this._propName]||null!=i.n&&t[i.n.split(this._propName+"_").join("")])&&(i.r=e),i=i._next},z._onPluginEvent=function(t,e){var i,s,r,n,a,o=e._firstPT;if("_onInitAllProps"===t){for(;o;){for(a=o._next,s=r;s&&s.pr>o.pr;)s=s._next;(o._prev=s?s._prev:n)?o._prev._next=o:r=o,(o._next=s)?s._prev=o:n=o,o=a}o=e._firstPT=r}for(;o;)o.pg&&"function"==typeof o.t[t]&&o.t[t]()&&(i=!0),o=o._next;return i},et.activate=function(t){for(var e=t.length;-1<--e;)t[e].API===et.API&&(j[(new t[e])._propName]=t[e]);return!0},a.plugin=function(t){if(!(t&&t.propName&&t.init&&t.API))throw"illegal plugin definition.";var e,i=t.propName,s=t.priority||0,r=t.overwriteProps,n={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_roundProps",initAll:"_onInitAllProps"},a=c("plugins."+i.charAt(0).toUpperCase()+i.substr(1)+"Plugin",function(){et.call(this,i,s),this._overwriteProps=r||[]},!0===t.global),o=a.prototype=new et(i);for(e in(o.constructor=a).API=t.API,n)"function"==typeof t[e]&&(o[n[e]]=t[e]);return a.version=t.version,et.activate([a]),a},s=f._gsQueue){for(r=0;s.length>r;r++)s[r]();for(n in x)x[n].func||f.console.log("GSAP encountered missing dependency: com.greensock."+n)}m=!1}}("undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window)</script><script id=rendered-js>"use strict";console.clear();var Stage=function(){function t(){var t=this;this.render=function(){this.renderer.render(this.scene,this.camera)},this.add=function(t){this.scene.add(t)},this.remove=function(t){this.scene.remove(t)},this.container=document.getElementById("game"),this.renderer=new THREE.WebGLRenderer({antialias:!0,alpha:!1}),this.renderer.setSize(window.innerWidth,window.innerHeight),this.renderer.setClearColor("#D0CBC7",1),this.container.appendChild(this.renderer.domElement),this.scene=new THREE.Scene;var i=window.innerWidth/window.innerHeight;this.camera=new THREE.OrthographicCamera(-20*i,20*i,20,-20,-100,1e3),this.camera.position.x=2,this.camera.position.y=2,this.camera.position.z=2,this.camera.lookAt(new THREE.Vector3(0,0,0)),this.light=new THREE.DirectionalLight(16777215,.5),this.light.position.set(0,499,0),this.scene.add(this.light),this.softLight=new THREE.AmbientLight(16777215,.4),this.scene.add(this.softLight),window.addEventListener("resize",function(){return t.onResize()}),this.onResize()}return t.prototype.setCamera=function(t,i){void 0===i&&(i=.3),TweenLite.to(this.camera.position,i,{y:t+4,ease:Power1.easeInOut}),TweenLite.to(this.camera.lookAt,i,{y:t,ease:Power1.easeInOut})},t.prototype.onResize=function(){this.renderer.setSize(window.innerWidth,window.innerHeight),this.camera.left=window.innerWidth/-30,this.camera.right=window.innerWidth/30,this.camera.top=window.innerHeight/30,this.camera.bottom=window.innerHeight/-30,this.camera.updateProjectionMatrix()},t}(),Block=function(){function t(t){if(this.STATES={ACTIVE:"active",STOPPED:"stopped",MISSED:"missed"},this.MOVE_AMOUNT=12,this.dimension={width:0,height:0,depth:0},this.position={x:0,y:0,z:0},this.targetBlock=t,this.index=(this.targetBlock?this.targetBlock.index:0)+1,this.workingPlane=this.index%2?"x":"z",this.workingDimension=this.index%2?"width":"depth",this.dimension.width=this.targetBlock?this.targetBlock.dimension.width:10,this.dimension.height=this.targetBlock?this.targetBlock.dimension.height:2,this.dimension.depth=this.targetBlock?this.targetBlock.dimension.depth:10,this.position.x=this.targetBlock?this.targetBlock.position.x:0,this.position.y=this.dimension.height*this.index,this.position.z=this.targetBlock?this.targetBlock.position.z:0,this.colorOffset=this.targetBlock?this.targetBlock.colorOffset:Math.round(100*Math.random()),this.targetBlock){var i=this.index+this.colorOffset,e=55*Math.sin(.3*i)+200,s=55*Math.sin(.3*i+2)+200,n=55*Math.sin(.3*i+4)+200;this.color=new THREE.Color(e/255,s/255,n/255)}else this.color=3355460;this.state=1<this.index?this.STATES.ACTIVE:this.STATES.STOPPED,this.speed=-.1-.005*this.index,this.speed<-4&&(this.speed=-4),this.direction=this.speed;var o=new THREE.BoxGeometry(this.dimension.width,this.dimension.height,this.dimension.depth);o.applyMatrix((new THREE.Matrix4).makeTranslation(this.dimension.width/2,this.dimension.height/2,this.dimension.depth/2)),this.material=new THREE.MeshToonMaterial({color:this.color,shading:THREE.FlatShading}),this.mesh=new THREE.Mesh(o,this.material),this.mesh.position.set(this.position.x,this.position.y+(this.state,this.STATES.ACTIVE,0),this.position.z),this.state==this.STATES.ACTIVE&&(this.position[this.workingPlane]=.5<Math.random()?-this.MOVE_AMOUNT:this.MOVE_AMOUNT)}return t.prototype.reverseDirection=function(){this.direction=0<this.direction?this.speed:Math.abs(this.speed)},t.prototype.place=function(){this.state=this.STATES.STOPPED;var t=this.targetBlock.dimension[this.workingDimension]-Math.abs(this.position[this.workingPlane]-this.targetBlock.position[this.workingPlane]),i={plane:this.workingPlane,direction:this.direction};if(this.dimension[this.workingDimension]-t<.3&&(t=this.dimension[this.workingDimension],i.bonus=!0,this.position.x=this.targetBlock.position.x,this.position.z=this.targetBlock.position.z,this.dimension.width=this.targetBlock.dimension.width,this.dimension.depth=this.targetBlock.dimension.depth),0<t){var e={width:this.dimension.width,height:this.dimension.height,depth:this.dimension.depth};e[this.workingDimension]-=t,this.dimension[this.workingDimension]=t;var s=new THREE.BoxGeometry(this.dimension.width,this.dimension.height,this.dimension.depth);s.applyMatrix((new THREE.Matrix4).makeTranslation(this.dimension.width/2,this.dimension.height/2,this.dimension.depth/2));var n=new THREE.Mesh(s,this.material),o=new THREE.BoxGeometry(e.width,e.height,e.depth);o.applyMatrix((new THREE.Matrix4).makeTranslation(e.width/2,e.height/2,e.depth/2));var h=new THREE.Mesh(o,this.material),a={x:this.position.x,y:this.position.y,z:this.position.z};this.position[this.workingPlane]<this.targetBlock.position[this.workingPlane]?this.position[this.workingPlane]=this.targetBlock.position[this.workingPlane]:a[this.workingPlane]+=t,n.position.set(this.position.x,this.position.y,this.position.z),h.position.set(a.x,a.y,a.z),i.placed=n,i.bonus||(i.chopped=h)}else this.state=this.STATES.MISSED;return this.dimension[this.workingDimension]=t,i},t.prototype.tick=function(){if(this.state==this.STATES.ACTIVE){var t=this.position[this.workingPlane];(t>this.MOVE_AMOUNT||t<-this.MOVE_AMOUNT)&&this.reverseDirection(),this.position[this.workingPlane]+=this.direction,this.mesh.position[this.workingPlane]=this.position[this.workingPlane]}},t}(),Game=function(){function t(){var i=this;this.STATES={LOADING:"loading",PLAYING:"playing",READY:"ready",ENDED:"ended",RESETTING:"resetting"},this.blocks=[],this.state=this.STATES.LOADING,this.stage=new Stage,this.mainContainer=document.getElementById("container"),this.scoreContainer=document.getElementById("score"),this.startButton=document.getElementById("start-button"),this.instructions=document.getElementById("instructions"),this.scoreContainer.innerHTML="0",this.newBlocks=new THREE.Group,this.placedBlocks=new THREE.Group,this.choppedBlocks=new THREE.Group,this.stage.add(this.newBlocks),this.stage.add(this.placedBlocks),this.stage.add(this.choppedBlocks),this.addBlock(),this.tick(),this.updateState(this.STATES.READY),document.addEventListener("keydown",function(t){32==t.keyCode&&i.onAction()}),document.addEventListener("click",function(t){i.onAction()}),document.addEventListener("touchstart",function(t){t.preventDefault()})}return t.prototype.updateState=function(t){for(var i in this.STATES)this.mainContainer.classList.remove(this.STATES[i]);this.mainContainer.classList.add(t),this.state=t},t.prototype.onAction=function(){switch(this.state){case this.STATES.READY:this.startGame();break;case this.STATES.PLAYING:this.placeBlock();break;case this.STATES.ENDED:this.restartGame()}},t.prototype.startGame=function(){this.state!=this.STATES.PLAYING&&(this.scoreContainer.innerHTML="0",this.updateState(this.STATES.PLAYING),this.addBlock())},t.prototype.restartGame=function(){var i=this;this.updateState(this.STATES.RESETTING);for(var e=this.placedBlocks.children,t=function(t){TweenLite.to(e[t].scale,.2,{x:0,y:0,z:0,delay:.02*(e.length-t),ease:Power1.easeIn,onComplete:function(){return i.placedBlocks.remove(e[t])}}),TweenLite.to(e[t].rotation,.2,{y:.5,delay:.02*(e.length-t),ease:Power1.easeIn})},s=0;s<e.length;s++)t(s);var n=.4+.02*e.length;this.stage.setCamera(2,n);var o={value:this.blocks.length-1};TweenLite.to(o,n,{value:0,onUpdate:function(){i.scoreContainer.innerHTML=String(Math.round(o.value))}}),this.blocks=this.blocks.slice(0,1),setTimeout(function(){i.startGame()},1e3*n)},t.prototype.placeBlock=function(){var t=this,i=this.blocks[this.blocks.length-1],e=i.place();if(this.newBlocks.remove(i.mesh),e.placed&&this.placedBlocks.add(e.placed),e.chopped){this.choppedBlocks.add(e.chopped);var s={y:"-=30",ease:Power1.easeIn,onComplete:function(){return t.choppedBlocks.remove(e.chopped)}},n={delay:.05,x:"z"==e.plane?10*Math.random()-5:.1,z:"x"==e.plane?10*Math.random()-5:.1,y:.1*Math.random()};e.chopped.position[e.plane]>e.placed.position[e.plane]?s[e.plane]="+="+40*Math.abs(e.direction):s[e.plane]="-="+40*Math.abs(e.direction),TweenLite.to(e.chopped.position,1,s),TweenLite.to(e.chopped.rotation,1,n)}this.addBlock()},t.prototype.addBlock=function(){var t=this.blocks[this.blocks.length-1];if(t&&t.state==t.STATES.MISSED)return this.endGame();this.scoreContainer.innerHTML=String(this.blocks.length-1);var i=new Block(t);this.newBlocks.add(i.mesh),this.blocks.push(i),this.stage.setCamera(2*this.blocks.length),5<=this.blocks.length&&this.instructions.classList.add("hide")},t.prototype.endGame=function(){this.updateState(this.STATES.ENDED)},t.prototype.tick=function(){var t=this;this.blocks[this.blocks.length-1].tick(),this.stage.render(),requestAnimationFrame(function(){t.tick()})},t}(),game=new Game</script>