diff --git a/README.md b/README.md index ec3c73b..4697da7 100755 --- a/README.md +++ b/README.md @@ -1,28 +1,119 @@ WebGL Clustered and Forward+ Shading ====================== -**University of Pennsylvania, CIS 565: GPU Programming and Architecture, Project 5** +## [Live Online](https://lanlou123.github.io/WebGL-Clustered-Deferred-Forward-Plus-Rendering/) -* (TODO) YOUR NAME HERE -* Tested on: (TODO) **Google Chrome 222.2** on - Windows 22, i7-2222 @ 2.22GHz 22GB, GTX 222 222MB (Moore 2222 Lab) +note : I only wrote the shading selection dropdown menu for clustered rendering -### Live Online +## Click this gif for video link -[![](img/thumb.png)](http://TODO.github.io/Project5B-WebGL-Deferred-Shading) +[![click this gif for video link](img/cluster.gif)](https://www.youtube.com/watch?v=FbcmS2m7nNE) -### Demo Video/GIF +due to gif capture sofware's limitation, the above gif which represent blinn-phong shading appear to have some ramp effects from toon. -[![](img/video.png)](TODO) +## Sample gifs -### (TODO: Your README) +blinn-phong|lambert|toon +----|----|---- +![](img/cluster.gif)|![](img/lambert.gif)|![](img/toon.gif) -*DO NOT* leave the README to the last minute! It is a crucial part of the -project, and we will not be able to grade you without a good README. +# Introduction: -This assignment has a considerable amount of performance analysis compared -to implementation work. Complete the implementation early to leave time! +### forward rendering +forward shading is the most straight forward shading method, basically, it first loops through each geomery in the scene, then, inside one sigle loop for the geometry, it will do another loop of all the lights in the scene to apply light influence on the current geometry, it is esay to tell that once the number of lights is really huge, this method can suffer from terrible performance issue, which makes this rendering technique impossible to be applied to current day games as most of them possess large amount use of lighting. +### forward plus(clustered) rendering +a better solution towards the issue brought by forward rendering is to use clustered structure for lighting, in forward plus, we will have the simmilar first step:loop all the geometry, but different second step, this time, we will catergorize lights into different clusters, and inside the fragment shader for each geometry loop, we will not check every light anymore, instead, we only accumulate light influence from lights that inside the cluster the geometry point is in. as a result, we will have a big improvement on performance, especially when there are a lot of lights. + +### clustered deferred rendering +we can further improve the performance by introducing an extra buffer:g-buffer which contains certain amounts of 2d textures(specified by user according to need), inside the textures, we will only store the geometry displacement "on the top" or in other words have the smaller depth value compared with other fragments at same NDC coordinate, apart from that, we can also store normal, depth, albedo, as long as it is required for our rendering. + +a graph for typical deferred rendering. + +![](img/deferred-v2.png) + +according to the image above, the reason this method is better is that the lighting loop will only check the 2d texture instead of checking every geometry, and the texture only store the toppest geometry, which ensures that we won't check the lighting inluence on those geometry "behind the walls" since we are not seeing it. + +### cluster structure + +![](img/clu.png) + +an example for the cluster structure would look like the above image, althogh it is simply drawed as a 2d frustum, it actually should be a 3d one, and this one can be taken as a simplified version of the 3d one looking along y axis direction, so, the orange sphere represents the light influence area, those clusters colored as red and orange are the ones we will consider storing into the buffer of this specific light, we will store the clusters in the form of cluster start index in x,y,z directions and end index respectively. + + +# Project Features: + +### Forward+ + - Build a data structure to keep track of how many lights are in each cluster and what their indices are + - Render the scene using only the lights that overlap a given cluster + + +### Clustered + - Reuse clustering logic from Forward+ + - Store vertex attributes in g-buffer + - Read g-buffer in a shader to produce final output + +### Effects + - Implemented deferred Blinn-Phong shading (diffuse + specular) for point lights + - for the blinn-phong effect, I simply used the half angle method and an extra inverse viewmatrix to compute the view point + position. + - Implemented toon shading (with ramp shading + simple depth-edge detection for outlines) + - toon is simple, just do an interpolation between the ramped value of lambert term and the original lambert term, the same goes for blinn-phong term ~ + +![](img/blinn.JPG) + +blinn-phong shading, you can notice the reflection on the floor and pillar quite clearly. + +![](img/toon.JPG) + +toon shading, the color is ramped based on the distance to the light center. + + +### Optimizations + - Optimized g-buffer format - reduce the number and size of g-buffers: + - Pack values together into vec4s + - I stored position and normal data in vec4s + - Use 2-component normals + - since the length of a normal will always be 1, we don't need all three of them, I choosed to pack the normal's x and y component into the former 2 vec4s, one thing to notice is I have to multiply viewmatrix before packing , and use inverse viemat in shader do unpacking... + + + + +# Performance & Analysis + +### Three methods comparision: + +![](img/comp1.JPG) + +this test is done with light radius being 4, cluster size = 15X15X15, and light number gradually increasing +as the diagram explicitly shown, when the light count increases, pure forward suffers from drastic performance drop while forward+ and clustered deferred shows better score, actually, the last one: deferred is really efficient , it's performance didn't change much even if there are up to 4k lights. + +### Cluster size influence: +![](img/clus.JPG) + +this test is done with 3500 light sources, light radius 4, renderer is clustered deferred. +from this image, we know that cluster size of 15X15X15 strikes the best performance, I guess this can only be aquired by fine tunning the renderer. + +### compressed g buffer vs not compressed: + +(the axis label should be compressed and uncompressed in the bottom of the image, just ignore it) + +![](img/pa.JPG) +this test is done with 1000 light sources, renderer is clustered deferred +this apparently shows the benefit of packing 3 floats g-buffer into 2 floats g-buffer, as we reduced the number of g buffers, therefore reduced the times we read and write to g buffers. + +### debug images: + +xslice view|yslice view +----|----- +![](img/xslice.JPG)|![](img/yslice.JPG) + +depth buffer| albedo buffer| surface normal buffer +---|---|--- +![](img/depth.JPG)|![](img/albedo.JPG)|![](img/surfacenor.JPG) + +pure light buffer +![](img/purecol.JPG) ### Credits diff --git a/build/bundle.js b/build/bundle.js new file mode 100644 index 0000000..4269d10 --- /dev/null +++ b/build/bundle.js @@ -0,0 +1,2 @@ +(function(e){function __webpack_require__(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,__webpack_require__),a.l=!0,a.exports}var t={};return __webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.d=function(e,t,n){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},__webpack_require__.n=function(e){var t=e&&e.__esModule?function getDefault(){return e['default']}:function getModuleExports(){return e};return __webpack_require__.d(t,'a',t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p='',__webpack_require__(__webpack_require__.s=1)})([function(e,t,n){'use strict';var a=Math.abs;n.d(t,'b',function(){return r}),n.d(t,'a',function(){return o}),n.d(t,'c',function(){return i});var r=1e-6,o='undefined'==typeof Float32Array?Array:Float32Array,i=Math.random,s=Math.PI/180},function(e,t,n){'use strict';function abort(e){throw h=!0,e}function setSize(e,t){f.width=e,f.height=t,T.aspect=e/t,T.updateProjectionMatrix()}Object.defineProperty(t,'__esModule',{value:!0}),n.d(t,'DEBUG',function(){return g}),n.d(t,'ABORTED',function(){return h}),t.abort=abort,n.d(t,'canvas',function(){return f}),n.d(t,'gl',function(){return _}),n.d(t,'WEBGL_draw_buffers',function(){return i}),n.d(t,'MAX_DRAW_BUFFERS_WEBGL',function(){return b}),n.d(t,'gui',function(){return x}),n.d(t,'camera',function(){return T}),n.d(t,'cameraControls',function(){return S}),t.makeRenderLoop=function makeRenderLoop(e){return function tick(){S.update(),v.begin(),e(),v.end(),h||requestAnimationFrame(tick)}};for(var a=n(14),r=n(15),o=n.n(r),s=n(17),l=n.n(s),d=n(7),c=n(18),p=n.n(c),u=n(19),m=n.n(u),g=!1,h=!1,f=document.getElementById('canvas'),E=f.getContext('webgl'),_=E,C=_.getSupportedExtensions(),y=['OES_texture_float','OES_texture_float_linear','OES_element_index_uint','WEBGL_depth_texture','WEBGL_draw_buffers'],A=0;AC.indexOf(y[A]))throw'Unable to load extension '+y[A];_.getExtension('OES_texture_float'),_.getExtension('OES_texture_float_linear'),_.getExtension('OES_element_index_uint'),_.getExtension('WEBGL_depth_texture');var i=_.getExtension('WEBGL_draw_buffers'),b=_.getParameter(i.MAX_DRAW_BUFFERS_WEBGL),x=new a.a.GUI,v=new l.a;v.setMode(1),v.domElement.style.position='absolute',v.domElement.style.left='0px',v.domElement.style.top='0px',document.body.appendChild(v.domElement);var T=new d.PerspectiveCamera(75,f.clientWidth/f.clientHeight,0.1,1e3),S=new p.a(T,f);S.enableDamping=!0,S.enableZoom=!0,S.rotateSpeed=0.3,S.zoomSpeed=1,S.panSpeed=2,setSize(f.clientWidth,f.clientHeight),window.addEventListener('resize',function(){return setSize(f.clientWidth,f.clientHeight)});n(20)},function(e,t,n){'use strict';var a=n(0),r=n(22),o=n(23),i=n(8),s=n(9),l=n(10),d=n(24),c=n(25),p=n(11),u=n(12);n.d(t,'a',function(){return s}),n.d(t,'b',function(){return l}),n.d(t,'c',function(){return c}),n.d(t,'d',function(){return p}),n.d(t,'e',function(){return u})},function(e,t,n){'use strict';function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}n.d(t,'a',function(){return l});var a=n(1),r=n(26),o=[-14,0,-6],s=[14,20,6],l=600,i=function(){function Scene(){_classCallCheck(this,Scene),this.lights=[],this.models=[];for(var e=0;ethis._zSlices-1||0>F)){R=o(0,R),F=Math.min(this._zSlices,F);for(var w=0;w<=this._xSlices;++w){var M=l.c.clone(getNormalComponents(E+g*w)),L=l.d.fromValues(M[0],0,M[1]);if(l.d.dot(y,L)=o||0 0 ) {','float depth = gl_FragCoord.z / gl_FragCoord.w;','float fogFactor = 0.0;','if ( fogType == 1 ) {','fogFactor = smoothstep( fogNear, fogFar, depth );','} else {','const float LOG2 = 1.442695;','fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );','fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );','}','gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );','}','}'].join('\n')),t.compileShader(n),t.compileShader(a),t.attachShader(e,n),t.attachShader(e,a),t.linkProgram(e),e}function painterSortStable(e,t){return e.renderOrder===t.renderOrder?e.z===t.z?t.id-e.id:t.z-e.z:e.renderOrder-t.renderOrder}var o=new Vector3,i=new Quaternion,s=new Vector3,d,c,p,u,m,l;this.render=function(r,g,h){if(0!==r.length){void 0===p&&init(),n.useProgram(p),n.initAttributes(),n.enableAttribute(u.position),n.enableAttribute(u.uv),n.disableUnusedAttributes(),n.disable(t.CULL_FACE),n.enable(t.BLEND),t.bindBuffer(t.ARRAY_BUFFER,d),t.vertexAttribPointer(u.position,2,t.FLOAT,!1,16,0),t.vertexAttribPointer(u.uv,2,t.FLOAT,!1,16,8),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,c),t.uniformMatrix4fv(m.projectionMatrix,!1,h.projectionMatrix.elements),n.activeTexture(t.TEXTURE0),t.uniform1i(m.map,0);var f=0,E=0,_=g.fog;_?(t.uniform3f(m.fogColor,_.color.r,_.color.g,_.color.b),_.isFog?(t.uniform1f(m.fogNear,_.near),t.uniform1f(m.fogFar,_.far),t.uniform1i(m.fogType,1),f=1,E=1):_.isFogExp2&&(t.uniform1f(m.fogDensity,_.density),t.uniform1i(m.fogType,2),f=2,E=2)):(t.uniform1i(m.fogType,0),f=0,E=0);for(var C=0,y=r.length,A;Ct&&(t=e[n]);return t}function BufferGeometry(){Object.defineProperty(this,'id',{value:GeometryIdCount()}),this.uuid=kt.generateUUID(),this.name='',this.type='BufferGeometry',this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:Infinity}}function BoxGeometry(e,t,n,a,r,o){Geometry.call(this),this.type='BoxGeometry',this.parameters={width:e,height:t,depth:n,widthSegments:a,heightSegments:r,depthSegments:o},this.fromBufferGeometry(new BoxBufferGeometry(e,t,n,a,r,o)),this.mergeVertices()}function BoxBufferGeometry(e,t,n,a,r,o){function buildPlane(e,t,n,r,o,u,g,h,f,E,_){var C=f+1,A=0,v=0,T=new Vector3,S,R;for(R=0;Rp;p++){if(m=c[p],m){var g=m[0],h=m[1];if(h){i&&r.addAttribute('morphTarget'+p,i[g]),u&&r.addAttribute('morphNormal'+p,u[g]),n[p]=h;continue}}n[p]=0}s.getUniforms().setValue(e,'morphTargetInfluences',n)}}}function WebGLIndexedBufferRenderer(e,t,n){var a,r,o;this.setMode=function setMode(e){a=e},this.setIndex=function setIndex(e){r=e.type,o=e.bytesPerElement},this.render=function render(t,i){e.drawElements(a,i,r,t*o),n.calls++,n.vertices+=i,a===e.TRIANGLES?n.faces+=i/3:a===e.POINTS&&(n.points+=i)},this.renderInstances=function renderInstances(i,s,l){var d=t.get('ANGLE_instanced_arrays');return null===d?void console.error('THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.'):void(d.drawElementsInstancedANGLE(a,l,r,s*o,i.maxInstancedCount),n.calls++,n.vertices+=l*i.maxInstancedCount,a===e.TRIANGLES?n.faces+=i.maxInstancedCount*l/3:a===e.POINTS&&(n.points+=i.maxInstancedCount*l))}}function WebGLBufferRenderer(e,t,n){var a;this.setMode=function setMode(e){a=e},this.render=function render(t,r){e.drawArrays(a,t,r),n.calls++,n.vertices+=r,a===e.TRIANGLES?n.faces+=r/3:a===e.POINTS&&(n.points+=r)},this.renderInstances=function renderInstances(r,o,i){var s=t.get('ANGLE_instanced_arrays');if(null===s)return void console.error('THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.');var l=r.attributes.position;l.isInterleavedBufferAttribute?(i=l.data.count,s.drawArraysInstancedANGLE(a,0,i,r.maxInstancedCount)):s.drawArraysInstancedANGLE(a,o,i,r.maxInstancedCount),n.calls++,n.vertices+=i*r.maxInstancedCount,a===e.TRIANGLES?n.faces+=r.maxInstancedCount*i/3:a===e.POINTS&&(n.points+=r.maxInstancedCount*i)}}function WebGLGeometries(e,t,n){function onGeometryDispose(e){var o=e.target,i=a[o.id];for(var s in null!==i.index&&t.remove(i.index),i.attributes)t.remove(i.attributes[s]);o.removeEventListener('dispose',onGeometryDispose),delete a[o.id];var l=r[o.id];l&&(t.remove(l),delete r[o.id]),l=r[i.id],l&&(t.remove(l),delete r[i.id]),n.geometries--}var a={},r={};return{get:function get(e,t){var r=a[t.id];return r?r:(t.addEventListener('dispose',onGeometryDispose),t.isBufferGeometry?r=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=new BufferGeometry().setFromObject(e)),r=t._bufferGeometry),a[t.id]=r,n.geometries++,r)},update:function update(n){var a=n.index,r=n.attributes;for(var o in null!==a&&t.update(a,e.ELEMENT_ARRAY_BUFFER),r)t.update(r[o],e.ARRAY_BUFFER);var s=n.morphAttributes;for(var o in s)for(var d=s[o],c=0,i=d.length;c');return parseIncludes(n)}var t=/^[ \t]*#include +<([\w\d.]+)>/gm;return e.replace(t,replace)}function unrollLoops(e){var t=/for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;return e.replace(t,function replace(e,t,n,a){for(var r='',o=parseInt(t);ot||e.height>t){var n=t/y(e.width,e.height),a=document.createElementNS('http://www.w3.org/1999/xhtml','canvas');a.width=h(e.width*n),a.height=h(e.height*n);var r=a.getContext('2d');return r.drawImage(e,0,0,e.width,e.height,0,0,a.width,a.height),console.warn('THREE.WebGLRenderer: image is too big ('+e.width+'x'+e.height+'). Resized to '+a.width+'x'+a.height,e),a}return e}function isPowerOfTwo(e){return kt.isPowerOfTwo(e.width)&&kt.isPowerOfTwo(e.height)}function makePowerOfTwo(e){if(e instanceof HTMLImageElement||e instanceof HTMLCanvasElement){var t=document.createElementNS('http://www.w3.org/1999/xhtml','canvas');t.width=kt.nearestPowerOfTwo(e.width),t.height=kt.nearestPowerOfTwo(e.height);var n=t.getContext('2d');return n.drawImage(e,0,0,t.width,t.height),console.warn('THREE.WebGLRenderer: image is not power of two ('+e.width+'x'+e.height+'). Resized to '+t.width+'x'+t.height,e),t}return e}function textureNeedsPowerOfTwo(e){return e.wrapS!==Ne||e.wrapT!==Ne||e.minFilter!==Oe&&e.minFilter!==ke}function textureNeedsGenerateMipmaps(e,t){return e.generateMipmaps&&t&&e.minFilter!==Oe&&e.minFilter!==ke}function filterFallback(t){return t===Oe||t===Ue||t===Ge?e.NEAREST:e.LINEAR}function onTextureDispose(e){var t=e.target;t.removeEventListener('dispose',onTextureDispose),deallocateTexture(t),s.textures--}function onRenderTargetDispose(e){var t=e.target;t.removeEventListener('dispose',onRenderTargetDispose),deallocateRenderTarget(t),s.textures--}function deallocateTexture(t){var n=a.get(t);if(t.image&&n.__image__webglTextureCube)e.deleteTexture(n.__image__webglTextureCube);else{if(n.__webglInit===void 0)return;e.deleteTexture(n.__webglTexture)}a.remove(t)}function deallocateRenderTarget(t){var n=a.get(t),r=a.get(t.texture);if(t){if(void 0!==r.__webglTexture&&e.deleteTexture(r.__webglTexture),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLRenderTargetCube)for(var o=0;6>o;o++)e.deleteFramebuffer(n.__webglFramebuffer[o]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[o]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer);a.remove(t.texture),a.remove(t)}}function setTexture2D(t,r){var o=a.get(t);if(0o;o++)e.bindFramebuffer(e.FRAMEBUFFER,n.__webglFramebuffer[o]),n.__webglDepthbuffer[o]=e.createRenderbuffer(),setupRenderBufferStorage(n.__webglDepthbuffer[o],t)}else e.bindFramebuffer(e.FRAMEBUFFER,n.__webglFramebuffer),n.__webglDepthbuffer=e.createRenderbuffer(),setupRenderBufferStorage(n.__webglDepthbuffer,t);e.bindFramebuffer(e.FRAMEBUFFER,null)}var i='undefined'!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext;this.setTexture2D=setTexture2D,this.setTextureCube=function setTextureCube(t,l){var d=a.get(t);if(6===t.image.length)if(0m;m++)u[m]=c||p?p?t.image[m].image:t.image[m]:clampToMaxSize(t.image[m],r.maxCubemapSize);var i=u[0],g=isPowerOfTwo(i),h=o.convert(t.format),f=o.convert(t.type);setTextureParameters(e.TEXTURE_CUBE_MAP,t,g);for(var m=0;6>m;m++)if(!c)p?n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+m,0,h,u[m].width,u[m].height,0,h,f,u[m].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+m,0,h,h,f,u[m]);else for(var E=u[m].mipmaps,_=0,C=E.length,y;_c;c++)r.__webglFramebuffer[c]=e.createFramebuffer()}else r.__webglFramebuffer=e.createFramebuffer();if(l){n.bindTexture(e.TEXTURE_CUBE_MAP,o.__webglTexture),setTextureParameters(e.TEXTURE_CUBE_MAP,t.texture,d);for(var c=0;6>c;c++)setupFrameBufferTexture(r.__webglFramebuffer[c],t,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+c);textureNeedsGenerateMipmaps(t.texture,d)&&e.generateMipmap(e.TEXTURE_CUBE_MAP),n.bindTexture(e.TEXTURE_CUBE_MAP,null)}else n.bindTexture(e.TEXTURE_2D,o.__webglTexture),setTextureParameters(e.TEXTURE_2D,t.texture,d),setupFrameBufferTexture(r.__webglFramebuffer,t,e.COLOR_ATTACHMENT0,e.TEXTURE_2D),textureNeedsGenerateMipmaps(t.texture,d)&&e.generateMipmap(e.TEXTURE_2D),n.bindTexture(e.TEXTURE_2D,null);t.depthBuffer&&setupDepthRenderbuffer(t)},this.updateRenderTargetMipmap=function updateRenderTargetMipmap(t){var r=t.texture,o=isPowerOfTwo(t);if(textureNeedsGenerateMipmaps(r,o)){var i=t.isWebGLRenderTargetCube?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,s=a.get(r).__webglTexture;n.bindTexture(i,s),e.generateMipmap(i),n.bindTexture(i,null)}}}function WebGLProperties(){var e={};return{get:function get(t){var n=t.uuid,a=e[n];return void 0===a&&(a={},e[n]=a),a},remove:function remove(t){delete e[t.uuid]},clear:function clear(){e={}}}}function WebGLState(e,t,n){function createTexture(t,n,a){var r=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(var s=0;s=Q.maxTextures&&console.warn('THREE.WebGLRenderer: Trying to use '+e+' texture units while this GPU supports only '+Q.maxTextures),D+=1,e},this.setTexture2D=function(){var e=!1;return function setTexture2D(t,n){t&&t.isWebGLRenderTarget&&(!e&&(console.warn('THREE.WebGLRenderer.setTexture2D: don\'t use render targets as textures. Use their .texture property instead.'),e=!0),t=t.texture),te.setTexture2D(t,n)}}(),this.setTexture=function(){var e=!1;return function setTexture(t,n){e||(console.warn('THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead.'),e=!0),te.setTexture2D(t,n)}}(),this.setTextureCube=function(){var e=!1;return function setTextureCube(t,n){t&&t.isWebGLRenderTargetCube&&(!e&&(console.warn('THREE.WebGLRenderer.setTextureCube: don\'t use cube render targets as textures. Use their .texture property instead.'),e=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?te.setTextureCube(t,n):te.setTextureCubeDynamic(t,n)}}(),this.getRenderTarget=function(){return x},this.setRenderTarget=function(e){x=e,e&&void 0===ee.get(e).__webglFramebuffer&&te.setupRenderTarget(e);var t=null,n=!1;if(e){var a=ee.get(e).__webglFramebuffer;e.isWebGLRenderTargetCube?(t=a[e.activeCubeFace],n=!0):t=a,M.copy(e.viewport),L.copy(e.scissor),B=e.scissorTest}else M.copy(O).multiplyScalar(P),L.copy(U).multiplyScalar(P),B=k;if(v!==t&&(K.bindFramebuffer(K.FRAMEBUFFER,t),v=t),J.viewport(M),J.scissor(L),J.setScissorTest(B),n){var r=ee.get(e.texture);K.framebufferTexture2D(K.FRAMEBUFFER,K.COLOR_ATTACHMENT0,K.TEXTURE_CUBE_MAP_POSITIVE_X+e.activeCubeFace,r.__webglTexture,e.activeMipMapLevel)}},this.readRenderTargetPixels=function(e,t,n,a,r,o){if(!(e&&e.isWebGLRenderTarget))return void console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.');var i=ee.get(e).__webglFramebuffer;if(i){var s=!1;i!==v&&(K.bindFramebuffer(K.FRAMEBUFFER,i),s=!0);try{var l=e.texture,d=l.format,c=l.type;if(d!==at&&ge.convert(d)!==K.getParameter(K.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.');if(c!==Ve&&ge.convert(c)!==K.getParameter(K.IMPLEMENTATION_COLOR_READ_TYPE)&&!(c===Ke&&(Z.get('OES_texture_float')||Z.get('WEBGL_color_buffer_float')))&&!(c===qe&&Z.get('EXT_color_buffer_half_float')))return void console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.');K.checkFramebufferStatus(K.FRAMEBUFFER)===K.FRAMEBUFFER_COMPLETE?0<=t&&t<=e.width-a&&0<=n&&n<=e.height-r&&K.readPixels(t,n,a,r,ge.convert(d),ge.convert(c),o):console.error('THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.')}finally{s&&K.bindFramebuffer(K.FRAMEBUFFER,v)}}}}function FogExp2(e,t){this.name='',this.color=new Color(e),this.density=t===void 0?2.5e-4:t}function Fog(e,t,n){this.name='',this.color=new Color(e),this.near=t===void 0?1:t,this.far=n===void 0?1e3:n}function Scene(){Object3D.call(this),this.type='Scene',this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function LensFlare(e,t,n,a,r){Object3D.call(this),this.lensFlares=[],this.positionScreen=new Vector3,this.customUpdateCallback=void 0,e!==void 0&&this.add(e,t,n,a,r)}function SpriteMaterial(e){Material.call(this),this.type='SpriteMaterial',this.color=new Color(16777215),this.map=null,this.rotation=0,this.fog=!1,this.lights=!1,this.setValues(e)}function Sprite(e){Object3D.call(this),this.type='Sprite',this.material=e===void 0?new SpriteMaterial:e}function LOD(){Object3D.call(this),this.type='LOD',Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function Skeleton(e,t){if(e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn('THREE.Skeleton boneInverses is the wrong length.'),this.boneInverses=[];for(var n=0,a=this.bones.length;n=e.HAVE_CURRENT_DATA&&(d.needsUpdate=!0)}Texture.call(this,e,t,n,a,r,o,i,s,l),this.generateMipmaps=!1;var d=this;update()}function CompressedTexture(e,t,n,a,r,o,i,s,l,d,c,p){Texture.call(this,null,o,i,s,l,d,a,r,c,p),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function DepthTexture(e,t,n,a,r,o,i,s,l,d){if(d=void 0===d?st:d,d!==st&&d!==lt)throw new Error('DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat');void 0===n&&d===st&&(n=Xe),void 0===n&&d===lt&&(n=et),Texture.call(this,null,a,r,o,i,s,d,n,l),this.image={width:e,height:t},this.magFilter=void 0===i?Oe:i,this.minFilter=void 0===s?Oe:s,this.flipY=!1,this.generateMipmaps=!1}function WireframeGeometry(t){BufferGeometry.call(this),this.type='WireframeGeometry';var n=[],a=[0,0],r={},s=['a','b','c'],d,i,c,l,o,p,e,u,m,g;if(t&&t.isGeometry){var h=t.faces;for(d=0,c=h.length;di;i++)e=E[s[i]],u=E[s[(i+1)%3]],a[0]=f(e,u),a[1]=y(e,u),m=a[0]+','+a[1],void 0===r[m]&&(r[m]={index1:a[0],index2:a[1]})}for(m in r)p=r[m],g=t.vertices[p.index1],n.push(g.x,g.y,g.z),g=t.vertices[p.index2],n.push(g.x,g.y,g.z)}else if(t&&t.isBufferGeometry){var _,C,A,b,x,v,T,S;if(g=new Vector3,null!==t.index){for(_=t.attributes.position,C=t.index,A=t.groups,0===A.length&&(A=[{start:0,count:C.count,materialIndex:0}]),(l=0,o=A.length);li;i++)e=C.getX(d+i),u=C.getX(d+(i+1)%3),a[0]=f(e,u),a[1]=y(e,u),m=a[0]+','+a[1],void 0===r[m]&&(r[m]={index1:a[0],index2:a[1]});for(m in r)p=r[m],g.fromBufferAttribute(_,p.index1),n.push(g.x,g.y,g.z),g.fromBufferAttribute(_,p.index2),n.push(g.x,g.y,g.z)}else for(_=t.attributes.position,d=0,c=_.count/3;di;i++)T=3*d+i,g.fromBufferAttribute(_,T),n.push(g.x,g.y,g.z),S=3*d+(i+1)%3,g.fromBufferAttribute(_,S),n.push(g.x,g.y,g.z)}this.addAttribute('position',new Float32BufferAttribute(n,3))}function ParametricGeometry(e,t,n){Geometry.call(this),this.type='ParametricGeometry',this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new ParametricBufferGeometry(e,t,n)),this.mergeVertices()}function ParametricBufferGeometry(e,t,n){BufferGeometry.call(this),this.type='ParametricBufferGeometry',this.parameters={func:e,slices:t,stacks:n};var r=[],o=[],s=[],l=[],p=1e-5,m=new Vector3,g=new Vector3,h=new Vector3,f=new Vector3,E=new Vector3,_=t+1,C,i;for(C=0;C<=n;C++){var y=C/n;for(i=0;i<=t;i++){var A=i/t;g=e(A,y,g),o.push(g.x,g.y,g.z),0<=A-p?(h=e(A-p,y,h),f.subVectors(g,h)):(h=e(A+p,y,h),f.subVectors(h,g)),0<=y-p?(h=e(A,y-p,h),E.subVectors(g,h)):(h=e(A,y+p,h),E.subVectors(h,g)),m.crossVectors(f,E).normalize(),s.push(m.x,m.y,m.z),l.push(A,y)}}for(C=0;Ci&&(0.2>t&&(o[e+0]+=1),0.2>n&&(o[e+2]+=1),0.2>a&&(o[e+4]+=1))}}function pushVertex(e){r.push(e.x,e.y,e.z)}function getVertexByIndex(t,n){var a=3*t;n.x=e[a+0],n.y=e[a+1],n.z=e[a+2]}function correctUVs(){for(var e=new Vector3,t=new Vector3,n=new Vector3,a=new Vector3,s=new Vector2,l=new Vector2,d=new Vector2,c=0,i=0;ca&&1===e.x&&(o[t]=e.x-1),0===n.x&&0===n.z&&(o[t]=a/2/S+0.5)}function azimuth(e){return i(e.z,-e.x)}function inclination(e){return i(-e.y,_(e.x*e.x+e.z*e.z))}BufferGeometry.call(this),this.type='PolyhedronBufferGeometry',this.parameters={vertices:e,indices:t,radius:n,detail:a},n=n||1,a=a||0;var r=[],o=[];(function subdivide(e){for(var n=new Vector3,a=new Vector3,r=new Vector3,o=0;oA;A++)c=l[d[A]],p=l[d[(A+1)%3]],o[0]=f(c,p),o[1]=y(c,p),u=o[0]+','+o[1],void 0===s[u]?s[u]={index1:o[0],index2:o[1],face1:_,face2:void 0}:s[u].face2=_}for(u in s){var b=s[u];if(b.face2===void 0||E[b.face1].normal.dot(E[b.face2].normal)<=r){var e=h[b.index1];a.push(e.x,e.y,e.z),e=h[b.index2],a.push(e.x,e.y,e.z)}}this.addAttribute('position',new Float32BufferAttribute(a,3))}function CylinderGeometry(e,t,n,a,r,o,i,s){Geometry.call(this),this.type='CylinderGeometry',this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:a,heightSegments:r,openEnded:o,thetaStart:i,thetaLength:s},this.fromBufferGeometry(new CylinderBufferGeometry(e,t,n,a,r,o,i,s)),this.mergeVertices()}function CylinderBufferGeometry(e,t,n,r,i,a,s,l){function generateCap(n){var a=new Vector2,h=new Vector3,E=0,y=!0===n?e:t,A=!0===n?1:-1,b,x,v;for(x=f,b=1;b<=r;b++)d.push(0,_*A,0),c.push(0,A,0),g.push(0.5,0.5),f++;for(v=f,b=0;b<=r;b++){var T=b/r,S=T*l+s,R=m(S),F=o(S);h.x=y*F,h.y=_*A,h.z=y*R,d.push(h.x,h.y,h.z),c.push(0,A,0),a.x=0.5*R+0.5,a.y=0.5*F*A+0.5,g.push(a.x,a.y),f++}for(b=0;bthis.duration&&this.resetDuration(),this.optimize()}function MaterialLoader(e){this.manager=e===void 0?dn:e,this.textures={}}function BufferGeometryLoader(e){this.manager=e===void 0?dn:e}function Loader(){this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}}function JSONLoader(e){'boolean'==typeof e&&(console.warn('THREE.JSONLoader: showStatus parameter has been removed from constructor.'),e=void 0),this.manager=e===void 0?dn:e,this.withCredentials=!1}function ObjectLoader(e){this.manager=e===void 0?dn:e,this.texturePath=''}function CatmullRom(e,t,n,a,r){var o=0.5*(a-t),i=0.5*(r-n),s=e*e;return(2*n-2*a+o+i)*(e*s)+(-3*n+3*a-2*o-i)*s+o*e+n}function QuadraticBezierP0(e,t){var n=1-e;return n*n*t}function QuadraticBezierP1(e,t){return 2*(1-e)*e*t}function QuadraticBezierP2(e,t){return e*e*t}function QuadraticBezier(e,t,n,a){return QuadraticBezierP0(e,t)+QuadraticBezierP1(e,n)+QuadraticBezierP2(e,a)}function CubicBezierP0(e,t){var n=1-e;return n*n*n*t}function CubicBezierP1(e,t){var n=1-e;return 3*n*n*e*t}function CubicBezierP2(e,t){return 3*(1-e)*e*e*t}function CubicBezierP3(e,t){return e*e*e*t}function CubicBezier(e,t,n,a,r){return CubicBezierP0(e,t)+CubicBezierP1(e,n)+CubicBezierP2(e,a)+CubicBezierP3(e,r)}function Curve(){this.arcLengthDivisions=200}function LineCurve(e,t){Curve.call(this),this.v1=e,this.v2=t}function CurvePath(){Curve.call(this),this.curves=[],this.autoClose=!1}function EllipseCurve(e,t,n,a,r,o,i,s){Curve.call(this),this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=a,this.aStartAngle=r,this.aEndAngle=o,this.aClockwise=i,this.aRotation=s||0}function SplineCurve(e){Curve.call(this),this.points=e===void 0?[]:e}function CubicBezierCurve(e,t,n,a){Curve.call(this),this.v0=e,this.v1=t,this.v2=n,this.v3=a}function QuadraticBezierCurve(e,t,n){Curve.call(this),this.v0=e,this.v1=t,this.v2=n}function Path(e){CurvePath.call(this),this.currentPoint=new Vector2,e&&this.fromPoints(e)}function Shape(){Path.apply(this,arguments),this.holes=[]}function ShapePath(){this.subPaths=[],this.currentPath=null}function Font(e){this.data=e}function FontLoader(e){this.manager=e===void 0?dn:e}function AudioLoader(e){this.manager=e===void 0?dn:e}function StereoCamera(){this.type='StereoCamera',this.aspect=1,this.eyeSep=0.064,this.cameraL=new PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}function CubeCamera(e,t,n){Object3D.call(this),this.type='CubeCamera';var a=90,r=1,o=new PerspectiveCamera(a,r,e,t);o.up.set(0,-1,0),o.lookAt(new Vector3(1,0,0)),this.add(o);var i=new PerspectiveCamera(a,r,e,t);i.up.set(0,-1,0),i.lookAt(new Vector3(-1,0,0)),this.add(i);var s=new PerspectiveCamera(a,r,e,t);s.up.set(0,0,1),s.lookAt(new Vector3(0,1,0)),this.add(s);var l=new PerspectiveCamera(a,r,e,t);l.up.set(0,0,-1),l.lookAt(new Vector3(0,-1,0)),this.add(l);var d=new PerspectiveCamera(a,r,e,t);d.up.set(0,-1,0),d.lookAt(new Vector3(0,0,1)),this.add(d);var c=new PerspectiveCamera(a,r,e,t);c.up.set(0,-1,0),c.lookAt(new Vector3(0,0,-1)),this.add(c);this.renderTarget=new WebGLRenderTargetCube(n,n,{format:nt,magFilter:ke,minFilter:ke}),this.renderTarget.texture.name='CubeCamera',this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var n=this.renderTarget,a=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,n.activeCubeFace=0,e.render(t,o,n),n.activeCubeFace=1,e.render(t,i,n),n.activeCubeFace=2,e.render(t,s,n),n.activeCubeFace=3,e.render(t,l,n),n.activeCubeFace=4,e.render(t,d,n),n.texture.generateMipmaps=a,n.activeCubeFace=5,e.render(t,c,n),e.setRenderTarget(null)},this.clear=function(e,t,n,a){for(var r=this.renderTarget,o=0;6>o;o++)r.activeCubeFace=o,e.setRenderTarget(r),e.clear(t,n,a);e.setRenderTarget(null)}}function AudioListener(){Object3D.call(this),this.type='AudioListener',this.context=En.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null}function Audio(e){Object3D.call(this),this.type='Audio',this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.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 PositionalAudio(e){Audio.call(this,e),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function AudioAnalyser(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t===void 0?2048:t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}function PropertyMixer(e,t,n){this.binding=e,this.valueSize=n;var a=Float64Array,r;'quaternion'===t?r=this._slerp:'string'===t||'bool'===t?(a=Array,r=this._select):r=this._lerp;this.buffer=new a(4*n),this._mixBufferRegion=r,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}function Composite(e,t,n){var a=n||PropertyBinding.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,a)}function PropertyBinding(e,t,n){this.path=t,this.parsedPath=n||PropertyBinding.parseTrackName(t),this.node=PropertyBinding.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function AnimationObjectGroup(){this.uuid=kt.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,a=arguments.length;t!==a;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var n=this;this.stats={objects:{get total(){return n._objects.length},get inUse(){return this.total-n.nCachedObjects_}},get bindingsPerObject(){return n._bindings.length}}}function AnimationAction(e,t,n){this._mixer=e,this._clip=t,this._localRoot=n||null;for(var a=t.tracks,r=a.length,o=Array(r),s={endingStart:vt,endingEnd:vt},l=0,i;l!==r;++l)i=a[l].createInterpolant(null),o[l]=i,i.settings=s;this._interpolantSettings=s,this._interpolants=o,this._propertyBindings=Array(r),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Ct,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=Infinity,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function AnimationMixer(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Uniform(e){'string'==typeof e&&(console.warn('THREE.Uniform: Type parameter is no longer needed.'),e=arguments[1]),this.value=e}function InstancedBufferGeometry(){BufferGeometry.call(this),this.type='InstancedBufferGeometry',this.maxInstancedCount=void 0}function InterleavedBufferAttribute(e,t,n,a){this.uuid=kt.generateUUID(),this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===a}function InterleavedBuffer(e,t){this.uuid=kt.generateUUID(),this.array=e,this.stride=t,this.count=e===void 0?0:e.length/t,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function InstancedInterleavedBuffer(e,t,n){InterleavedBuffer.call(this,e,t),this.meshPerAttribute=n||1}function InstancedBufferAttribute(e,t,n){BufferAttribute.call(this,e,t),this.meshPerAttribute=n||1}function Raycaster(e,t,n,a){this.ray=new Ray(e,t),this.near=n||0,this.far=a||Infinity,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 ascSort(e,t){return e.distance-t.distance}function intersectObject(e,t,n,a){if(!1!==e.visible&&(e.raycast(t,n),!0===a))for(var r=e.children,o=0,i=r.length;oe.length&&console.warn('THREE.CatmullRomCurve3: Points array needs at least two entries.'),this.points=e||[],this.closed=!1}function CubicBezierCurve3(e,t,n,a){Curve.call(this),this.v0=e,this.v1=t,this.v2=n,this.v3=a}function QuadraticBezierCurve3(e,t,n){Curve.call(this),this.v0=e,this.v1=t,this.v2=n}function LineCurve3(e,t){Curve.call(this),this.v1=e,this.v2=t}function ArcCurve(e,t,n,a,r,o){EllipseCurve.call(this,e,t,n,n,a,r,o)}function Face4(e,t,n,a,r,o,i){return console.warn('THREE.Face4 has been removed. A THREE.Face3 will be created instead.'),new Face3(e,t,n,r,o,i)}function MeshFaceMaterial(e){return console.warn('THREE.MeshFaceMaterial has been removed. Use an Array instead.'),e}function MultiMaterial(e){return void 0===e&&(e=[]),console.warn('THREE.MultiMaterial has been removed. Use an Array instead.'),e.isMultiMaterial=!0,e.materials=e,e.clone=function(){return e.slice()},e}function PointCloud(e,t){return console.warn('THREE.PointCloud has been renamed to THREE.Points.'),new Points(e,t)}function Particle(e){return console.warn('THREE.Particle has been renamed to THREE.Sprite.'),new Sprite(e)}function ParticleSystem(e,t){return console.warn('THREE.ParticleSystem has been renamed to THREE.Points.'),new Points(e,t)}function PointCloudMaterial(e){return console.warn('THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.'),new PointsMaterial(e)}function ParticleBasicMaterial(e){return console.warn('THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.'),new PointsMaterial(e)}function ParticleSystemMaterial(e){return console.warn('THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.'),new PointsMaterial(e)}function Vertex(e,t,n){return console.warn('THREE.Vertex has been removed. Use THREE.Vector3 instead.'),new Vector3(e,t,n)}function DynamicBufferAttribute(e,t){return console.warn('THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead.'),new BufferAttribute(e,t).setDynamic(!0)}function Int8Attribute(e,t){return console.warn('THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead.'),new Int8BufferAttribute(e,t)}function Uint8Attribute(e,t){return console.warn('THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead.'),new Uint8BufferAttribute(e,t)}function Uint8ClampedAttribute(e,t){return console.warn('THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead.'),new Uint8ClampedBufferAttribute(e,t)}function Int16Attribute(e,t){return console.warn('THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead.'),new Int16BufferAttribute(e,t)}function Uint16Attribute(e,t){return console.warn('THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead.'),new Uint16BufferAttribute(e,t)}function Int32Attribute(e,t){return console.warn('THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead.'),new Int32BufferAttribute(e,t)}function Uint32Attribute(e,t){return console.warn('THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead.'),new Uint32BufferAttribute(e,t)}function Float32Attribute(e,t){return console.warn('THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead.'),new Float32BufferAttribute(e,t)}function Float64Attribute(e,t){return console.warn('THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead.'),new Float64BufferAttribute(e,t)}function ClosedSplineCurve3(e){console.warn('THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.'),CatmullRomCurve3.call(this,e),this.type='catmullrom',this.closed=!0}function SplineCurve3(e){console.warn('THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.'),CatmullRomCurve3.call(this,e),this.type='catmullrom'}function Spline(e){console.warn('THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead.'),CatmullRomCurve3.call(this,e),this.type='catmullrom'}function BoundingBoxHelper(e,t){return console.warn('THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead.'),new BoxHelper(e,t)}function EdgesHelper(e,t){return console.warn('THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead.'),new LineSegments(new EdgesGeometry(e.geometry),new LineBasicMaterial({color:void 0===t?16777215:t}))}function WireframeHelper(e,t){return console.warn('THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead.'),new LineSegments(new WireframeGeometry(e.geometry),new LineBasicMaterial({color:void 0===t?16777215:t}))}function XHRLoader(e){return console.warn('THREE.XHRLoader has been renamed to THREE.FileLoader.'),new FileLoader(e)}function BinaryTextureLoader(e){return console.warn('THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader.'),new DataTextureLoader(e)}function Projector(){console.error('THREE.Projector has been moved to /examples/js/renderers/Projector.js.'),this.projectVector=function(e,t){console.warn('THREE.Projector: .projectVector() is now vector.project().'),e.project(t)},this.unprojectVector=function(e,t){console.warn('THREE.Projector: .unprojectVector() is now vector.unproject().'),e.unproject(t)},this.pickingRay=function(){console.error('THREE.Projector: .pickingRay() is now raycaster.setFromCamera().')}}function CanvasRenderer(){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(){}}var a=Math.atan,r=Math.acos,o=Math.sin,m=Math.cos,i=Math.atan2,s=Math.pow,l=Math.round,d=Math.LN2,c=Math.log,p=Math.sign,u=Number.isInteger,g=Number.EPSILON,f=Math.min,h=Math.floor,E=Math.tan,_=Math.sqrt,C=Math.ceil,y=Math.max,A=Math.abs,S=Math.PI;Object.defineProperty(t,'__esModule',{value:!0}),n.d(t,'WebGLRenderTargetCube',function(){return WebGLRenderTargetCube}),n.d(t,'WebGLRenderTarget',function(){return WebGLRenderTarget}),n.d(t,'WebGLRenderer',function(){return WebGLRenderer}),n.d(t,'ShaderLib',function(){return Jt}),n.d(t,'UniformsLib',function(){return qt}),n.d(t,'UniformsUtils',function(){return Zt}),n.d(t,'ShaderChunk',function(){return Qt}),n.d(t,'FogExp2',function(){return FogExp2}),n.d(t,'Fog',function(){return Fog}),n.d(t,'Scene',function(){return Scene}),n.d(t,'LensFlare',function(){return LensFlare}),n.d(t,'Sprite',function(){return Sprite}),n.d(t,'LOD',function(){return LOD}),n.d(t,'SkinnedMesh',function(){return SkinnedMesh}),n.d(t,'Skeleton',function(){return Skeleton}),n.d(t,'Bone',function(){return Bone}),n.d(t,'Mesh',function(){return Mesh}),n.d(t,'LineSegments',function(){return LineSegments}),n.d(t,'LineLoop',function(){return LineLoop}),n.d(t,'Line',function(){return Line}),n.d(t,'Points',function(){return Points}),n.d(t,'Group',function(){return Group}),n.d(t,'VideoTexture',function(){return VideoTexture}),n.d(t,'DataTexture',function(){return DataTexture}),n.d(t,'CompressedTexture',function(){return CompressedTexture}),n.d(t,'CubeTexture',function(){return CubeTexture}),n.d(t,'CanvasTexture',function(){return CanvasTexture}),n.d(t,'DepthTexture',function(){return DepthTexture}),n.d(t,'Texture',function(){return Texture}),n.d(t,'CompressedTextureLoader',function(){return CompressedTextureLoader}),n.d(t,'DataTextureLoader',function(){return DataTextureLoader}),n.d(t,'CubeTextureLoader',function(){return CubeTextureLoader}),n.d(t,'TextureLoader',function(){return TextureLoader}),n.d(t,'ObjectLoader',function(){return ObjectLoader}),n.d(t,'MaterialLoader',function(){return MaterialLoader}),n.d(t,'BufferGeometryLoader',function(){return BufferGeometryLoader}),n.d(t,'DefaultLoadingManager',function(){return dn}),n.d(t,'LoadingManager',function(){return LoadingManager}),n.d(t,'JSONLoader',function(){return JSONLoader}),n.d(t,'ImageLoader',function(){return ImageLoader}),n.d(t,'FontLoader',function(){return FontLoader}),n.d(t,'FileLoader',function(){return FileLoader}),n.d(t,'Loader',function(){return Loader}),n.d(t,'Cache',function(){return ln}),n.d(t,'AudioLoader',function(){return AudioLoader}),n.d(t,'SpotLightShadow',function(){return SpotLightShadow}),n.d(t,'SpotLight',function(){return SpotLight}),n.d(t,'PointLight',function(){return PointLight}),n.d(t,'RectAreaLight',function(){return RectAreaLight}),n.d(t,'HemisphereLight',function(){return HemisphereLight}),n.d(t,'DirectionalLightShadow',function(){return DirectionalLightShadow}),n.d(t,'DirectionalLight',function(){return DirectionalLight}),n.d(t,'AmbientLight',function(){return AmbientLight}),n.d(t,'LightShadow',function(){return LightShadow}),n.d(t,'Light',function(){return Light}),n.d(t,'StereoCamera',function(){return StereoCamera}),n.d(t,'PerspectiveCamera',function(){return PerspectiveCamera}),n.d(t,'OrthographicCamera',function(){return OrthographicCamera}),n.d(t,'CubeCamera',function(){return CubeCamera}),n.d(t,'ArrayCamera',function(){return ArrayCamera}),n.d(t,'Camera',function(){return Camera}),n.d(t,'AudioListener',function(){return AudioListener}),n.d(t,'PositionalAudio',function(){return PositionalAudio}),n.d(t,'AudioContext',function(){return En}),n.d(t,'AudioAnalyser',function(){return AudioAnalyser}),n.d(t,'Audio',function(){return Audio}),n.d(t,'VectorKeyframeTrack',function(){return VectorKeyframeTrack}),n.d(t,'StringKeyframeTrack',function(){return StringKeyframeTrack}),n.d(t,'QuaternionKeyframeTrack',function(){return QuaternionKeyframeTrack}),n.d(t,'NumberKeyframeTrack',function(){return NumberKeyframeTrack}),n.d(t,'ColorKeyframeTrack',function(){return ColorKeyframeTrack}),n.d(t,'BooleanKeyframeTrack',function(){return BooleanKeyframeTrack}),n.d(t,'PropertyMixer',function(){return PropertyMixer}),n.d(t,'PropertyBinding',function(){return PropertyBinding}),n.d(t,'KeyframeTrack',function(){return KeyframeTrack}),n.d(t,'AnimationUtils',function(){return cn}),n.d(t,'AnimationObjectGroup',function(){return AnimationObjectGroup}),n.d(t,'AnimationMixer',function(){return AnimationMixer}),n.d(t,'AnimationClip',function(){return AnimationClip}),n.d(t,'Uniform',function(){return Uniform}),n.d(t,'InstancedBufferGeometry',function(){return InstancedBufferGeometry}),n.d(t,'BufferGeometry',function(){return BufferGeometry}),n.d(t,'GeometryIdCount',function(){return GeometryIdCount}),n.d(t,'Geometry',function(){return Geometry}),n.d(t,'InterleavedBufferAttribute',function(){return InterleavedBufferAttribute}),n.d(t,'InstancedInterleavedBuffer',function(){return InstancedInterleavedBuffer}),n.d(t,'InterleavedBuffer',function(){return InterleavedBuffer}),n.d(t,'InstancedBufferAttribute',function(){return InstancedBufferAttribute}),n.d(t,'Face3',function(){return Face3}),n.d(t,'Object3D',function(){return Object3D}),n.d(t,'Raycaster',function(){return Raycaster}),n.d(t,'Layers',function(){return Layers}),n.d(t,'EventDispatcher',function(){return EventDispatcher}),n.d(t,'Clock',function(){return Clock}),n.d(t,'QuaternionLinearInterpolant',function(){return QuaternionLinearInterpolant}),n.d(t,'LinearInterpolant',function(){return LinearInterpolant}),n.d(t,'DiscreteInterpolant',function(){return DiscreteInterpolant}),n.d(t,'CubicInterpolant',function(){return CubicInterpolant}),n.d(t,'Interpolant',function(){return Interpolant}),n.d(t,'Triangle',function(){return Triangle}),n.d(t,'Math',function(){return kt}),n.d(t,'Spherical',function(){return Spherical}),n.d(t,'Cylindrical',function(){return Cylindrical}),n.d(t,'Plane',function(){return Plane}),n.d(t,'Frustum',function(){return Frustum}),n.d(t,'Sphere',function(){return Sphere}),n.d(t,'Ray',function(){return Ray}),n.d(t,'Matrix4',function(){return Matrix4}),n.d(t,'Matrix3',function(){return Matrix3}),n.d(t,'Box3',function(){return Box3}),n.d(t,'Box2',function(){return Box2}),n.d(t,'Line3',function(){return Line3}),n.d(t,'Euler',function(){return Euler}),n.d(t,'Vector4',function(){return Vector4}),n.d(t,'Vector3',function(){return Vector3}),n.d(t,'Vector2',function(){return Vector2}),n.d(t,'Quaternion',function(){return Quaternion}),n.d(t,'Color',function(){return Color}),n.d(t,'ImmediateRenderObject',function(){return ImmediateRenderObject}),n.d(t,'VertexNormalsHelper',function(){return VertexNormalsHelper}),n.d(t,'SpotLightHelper',function(){return SpotLightHelper}),n.d(t,'SkeletonHelper',function(){return SkeletonHelper}),n.d(t,'PointLightHelper',function(){return PointLightHelper}),n.d(t,'RectAreaLightHelper',function(){return RectAreaLightHelper}),n.d(t,'HemisphereLightHelper',function(){return HemisphereLightHelper}),n.d(t,'GridHelper',function(){return GridHelper}),n.d(t,'PolarGridHelper',function(){return PolarGridHelper}),n.d(t,'FaceNormalsHelper',function(){return FaceNormalsHelper}),n.d(t,'DirectionalLightHelper',function(){return DirectionalLightHelper}),n.d(t,'CameraHelper',function(){return CameraHelper}),n.d(t,'BoxHelper',function(){return BoxHelper}),n.d(t,'Box3Helper',function(){return Box3Helper}),n.d(t,'PlaneHelper',function(){return PlaneHelper}),n.d(t,'ArrowHelper',function(){return ArrowHelper}),n.d(t,'AxisHelper',function(){return AxisHelper}),n.d(t,'CatmullRomCurve3',function(){return CatmullRomCurve3}),n.d(t,'CubicBezierCurve3',function(){return CubicBezierCurve3}),n.d(t,'QuadraticBezierCurve3',function(){return QuadraticBezierCurve3}),n.d(t,'LineCurve3',function(){return LineCurve3}),n.d(t,'ArcCurve',function(){return ArcCurve}),n.d(t,'EllipseCurve',function(){return EllipseCurve}),n.d(t,'SplineCurve',function(){return SplineCurve}),n.d(t,'CubicBezierCurve',function(){return CubicBezierCurve}),n.d(t,'QuadraticBezierCurve',function(){return QuadraticBezierCurve}),n.d(t,'LineCurve',function(){return LineCurve}),n.d(t,'Shape',function(){return Shape}),n.d(t,'Path',function(){return Path}),n.d(t,'ShapePath',function(){return ShapePath}),n.d(t,'Font',function(){return Font}),n.d(t,'CurvePath',function(){return CurvePath}),n.d(t,'Curve',function(){return Curve}),n.d(t,'ShapeUtils',function(){return rn}),n.d(t,'SceneUtils',function(){return Tn}),n.d(t,'WebGLUtils',function(){return WebGLUtils}),n.d(t,'WireframeGeometry',function(){return WireframeGeometry}),n.d(t,'ParametricGeometry',function(){return ParametricGeometry}),n.d(t,'ParametricBufferGeometry',function(){return ParametricBufferGeometry}),n.d(t,'TetrahedronGeometry',function(){return TetrahedronGeometry}),n.d(t,'TetrahedronBufferGeometry',function(){return TetrahedronBufferGeometry}),n.d(t,'OctahedronGeometry',function(){return OctahedronGeometry}),n.d(t,'OctahedronBufferGeometry',function(){return OctahedronBufferGeometry}),n.d(t,'IcosahedronGeometry',function(){return IcosahedronGeometry}),n.d(t,'IcosahedronBufferGeometry',function(){return IcosahedronBufferGeometry}),n.d(t,'DodecahedronGeometry',function(){return DodecahedronGeometry}),n.d(t,'DodecahedronBufferGeometry',function(){return DodecahedronBufferGeometry}),n.d(t,'PolyhedronGeometry',function(){return PolyhedronGeometry}),n.d(t,'PolyhedronBufferGeometry',function(){return PolyhedronBufferGeometry}),n.d(t,'TubeGeometry',function(){return TubeGeometry}),n.d(t,'TubeBufferGeometry',function(){return TubeBufferGeometry}),n.d(t,'TorusKnotGeometry',function(){return TorusKnotGeometry}),n.d(t,'TorusKnotBufferGeometry',function(){return TorusKnotBufferGeometry}),n.d(t,'TorusGeometry',function(){return TorusGeometry}),n.d(t,'TorusBufferGeometry',function(){return TorusBufferGeometry}),n.d(t,'TextGeometry',function(){return TextGeometry}),n.d(t,'TextBufferGeometry',function(){return TextBufferGeometry}),n.d(t,'SphereGeometry',function(){return SphereGeometry}),n.d(t,'SphereBufferGeometry',function(){return SphereBufferGeometry}),n.d(t,'RingGeometry',function(){return RingGeometry}),n.d(t,'RingBufferGeometry',function(){return RingBufferGeometry}),n.d(t,'PlaneGeometry',function(){return PlaneGeometry}),n.d(t,'PlaneBufferGeometry',function(){return PlaneBufferGeometry}),n.d(t,'LatheGeometry',function(){return LatheGeometry}),n.d(t,'LatheBufferGeometry',function(){return LatheBufferGeometry}),n.d(t,'ShapeGeometry',function(){return ShapeGeometry}),n.d(t,'ShapeBufferGeometry',function(){return ShapeBufferGeometry}),n.d(t,'ExtrudeGeometry',function(){return ExtrudeGeometry}),n.d(t,'ExtrudeBufferGeometry',function(){return ExtrudeBufferGeometry}),n.d(t,'EdgesGeometry',function(){return EdgesGeometry}),n.d(t,'ConeGeometry',function(){return ConeGeometry}),n.d(t,'ConeBufferGeometry',function(){return ConeBufferGeometry}),n.d(t,'CylinderGeometry',function(){return CylinderGeometry}),n.d(t,'CylinderBufferGeometry',function(){return CylinderBufferGeometry}),n.d(t,'CircleGeometry',function(){return CircleGeometry}),n.d(t,'CircleBufferGeometry',function(){return CircleBufferGeometry}),n.d(t,'BoxGeometry',function(){return BoxGeometry}),n.d(t,'BoxBufferGeometry',function(){return BoxBufferGeometry}),n.d(t,'ShadowMaterial',function(){return ShadowMaterial}),n.d(t,'SpriteMaterial',function(){return SpriteMaterial}),n.d(t,'RawShaderMaterial',function(){return RawShaderMaterial}),n.d(t,'ShaderMaterial',function(){return ShaderMaterial}),n.d(t,'PointsMaterial',function(){return PointsMaterial}),n.d(t,'MeshPhysicalMaterial',function(){return MeshPhysicalMaterial}),n.d(t,'MeshStandardMaterial',function(){return MeshStandardMaterial}),n.d(t,'MeshPhongMaterial',function(){return MeshPhongMaterial}),n.d(t,'MeshToonMaterial',function(){return MeshToonMaterial}),n.d(t,'MeshNormalMaterial',function(){return MeshNormalMaterial}),n.d(t,'MeshLambertMaterial',function(){return MeshLambertMaterial}),n.d(t,'MeshDepthMaterial',function(){return MeshDepthMaterial}),n.d(t,'MeshDistanceMaterial',function(){return MeshDistanceMaterial}),n.d(t,'MeshBasicMaterial',function(){return MeshBasicMaterial}),n.d(t,'LineDashedMaterial',function(){return LineDashedMaterial}),n.d(t,'LineBasicMaterial',function(){return LineBasicMaterial}),n.d(t,'Material',function(){return Material}),n.d(t,'Float64BufferAttribute',function(){return Float64BufferAttribute}),n.d(t,'Float32BufferAttribute',function(){return Float32BufferAttribute}),n.d(t,'Uint32BufferAttribute',function(){return Uint32BufferAttribute}),n.d(t,'Int32BufferAttribute',function(){return Int32BufferAttribute}),n.d(t,'Uint16BufferAttribute',function(){return Uint16BufferAttribute}),n.d(t,'Int16BufferAttribute',function(){return Int16BufferAttribute}),n.d(t,'Uint8ClampedBufferAttribute',function(){return Uint8ClampedBufferAttribute}),n.d(t,'Uint8BufferAttribute',function(){return Uint8BufferAttribute}),n.d(t,'Int8BufferAttribute',function(){return Int8BufferAttribute}),n.d(t,'BufferAttribute',function(){return BufferAttribute}),n.d(t,'REVISION',function(){return b}),n.d(t,'MOUSE',function(){return x}),n.d(t,'CullFaceNone',function(){return v}),n.d(t,'CullFaceBack',function(){return T}),n.d(t,'CullFaceFront',function(){return R}),n.d(t,'CullFaceFrontBack',function(){return F}),n.d(t,'FrontFaceDirectionCW',function(){return w}),n.d(t,'FrontFaceDirectionCCW',function(){return M}),n.d(t,'BasicShadowMap',function(){return L}),n.d(t,'PCFShadowMap',function(){return B}),n.d(t,'PCFSoftShadowMap',function(){return D}),n.d(t,'FrontSide',function(){return I}),n.d(t,'BackSide',function(){return N}),n.d(t,'DoubleSide',function(){return P}),n.d(t,'FlatShading',function(){return O}),n.d(t,'SmoothShading',function(){return U}),n.d(t,'NoColors',function(){return G}),n.d(t,'FaceColors',function(){return k}),n.d(t,'VertexColors',function(){return W}),n.d(t,'NoBlending',function(){return H}),n.d(t,'NormalBlending',function(){return V}),n.d(t,'AdditiveBlending',function(){return $}),n.d(t,'SubtractiveBlending',function(){return z}),n.d(t,'MultiplyBlending',function(){return X}),n.d(t,'CustomBlending',function(){return j}),n.d(t,'AddEquation',function(){return Y}),n.d(t,'SubtractEquation',function(){return K}),n.d(t,'ReverseSubtractEquation',function(){return q}),n.d(t,'MinEquation',function(){return Z}),n.d(t,'MaxEquation',function(){return Q}),n.d(t,'ZeroFactor',function(){return J}),n.d(t,'OneFactor',function(){return ee}),n.d(t,'SrcColorFactor',function(){return te}),n.d(t,'OneMinusSrcColorFactor',function(){return ne}),n.d(t,'SrcAlphaFactor',function(){return ae}),n.d(t,'OneMinusSrcAlphaFactor',function(){return re}),n.d(t,'DstAlphaFactor',function(){return oe}),n.d(t,'OneMinusDstAlphaFactor',function(){return ie}),n.d(t,'DstColorFactor',function(){return se}),n.d(t,'OneMinusDstColorFactor',function(){return le}),n.d(t,'SrcAlphaSaturateFactor',function(){return de}),n.d(t,'NeverDepth',function(){return ce}),n.d(t,'AlwaysDepth',function(){return pe}),n.d(t,'LessDepth',function(){return ue}),n.d(t,'LessEqualDepth',function(){return me}),n.d(t,'EqualDepth',function(){return ge}),n.d(t,'GreaterEqualDepth',function(){return he}),n.d(t,'GreaterDepth',function(){return fe}),n.d(t,'NotEqualDepth',function(){return Ee}),n.d(t,'MultiplyOperation',function(){return _e}),n.d(t,'MixOperation',function(){return Ce}),n.d(t,'AddOperation',function(){return ye}),n.d(t,'NoToneMapping',function(){return Ae}),n.d(t,'LinearToneMapping',function(){return be}),n.d(t,'ReinhardToneMapping',function(){return xe}),n.d(t,'Uncharted2ToneMapping',function(){return ve}),n.d(t,'CineonToneMapping',function(){return Te}),n.d(t,'UVMapping',function(){return Se}),n.d(t,'CubeReflectionMapping',function(){return Re}),n.d(t,'CubeRefractionMapping',function(){return Fe}),n.d(t,'EquirectangularReflectionMapping',function(){return we}),n.d(t,'EquirectangularRefractionMapping',function(){return Me}),n.d(t,'SphericalReflectionMapping',function(){return Le}),n.d(t,'CubeUVReflectionMapping',function(){return Be}),n.d(t,'CubeUVRefractionMapping',function(){return De}),n.d(t,'RepeatWrapping',function(){return Ie}),n.d(t,'ClampToEdgeWrapping',function(){return Ne}),n.d(t,'MirroredRepeatWrapping',function(){return Pe}),n.d(t,'NearestFilter',function(){return Oe}),n.d(t,'NearestMipMapNearestFilter',function(){return Ue}),n.d(t,'NearestMipMapLinearFilter',function(){return Ge}),n.d(t,'LinearFilter',function(){return ke}),n.d(t,'LinearMipMapNearestFilter',function(){return We}),n.d(t,'LinearMipMapLinearFilter',function(){return He}),n.d(t,'UnsignedByteType',function(){return Ve}),n.d(t,'ByteType',function(){return $e}),n.d(t,'ShortType',function(){return ze}),n.d(t,'UnsignedShortType',function(){return Xe}),n.d(t,'IntType',function(){return je}),n.d(t,'UnsignedIntType',function(){return Ye}),n.d(t,'FloatType',function(){return Ke}),n.d(t,'HalfFloatType',function(){return qe}),n.d(t,'UnsignedShort4444Type',function(){return Ze}),n.d(t,'UnsignedShort5551Type',function(){return Qe}),n.d(t,'UnsignedShort565Type',function(){return Je}),n.d(t,'UnsignedInt248Type',function(){return et}),n.d(t,'AlphaFormat',function(){return tt}),n.d(t,'RGBFormat',function(){return nt}),n.d(t,'RGBAFormat',function(){return at}),n.d(t,'LuminanceFormat',function(){return rt}),n.d(t,'LuminanceAlphaFormat',function(){return ot}),n.d(t,'RGBEFormat',function(){return it}),n.d(t,'DepthFormat',function(){return st}),n.d(t,'DepthStencilFormat',function(){return lt}),n.d(t,'RGB_S3TC_DXT1_Format',function(){return dt}),n.d(t,'RGBA_S3TC_DXT1_Format',function(){return ct}),n.d(t,'RGBA_S3TC_DXT3_Format',function(){return pt}),n.d(t,'RGBA_S3TC_DXT5_Format',function(){return ut}),n.d(t,'RGB_PVRTC_4BPPV1_Format',function(){return mt}),n.d(t,'RGB_PVRTC_2BPPV1_Format',function(){return gt}),n.d(t,'RGBA_PVRTC_4BPPV1_Format',function(){return ht}),n.d(t,'RGBA_PVRTC_2BPPV1_Format',function(){return ft}),n.d(t,'RGB_ETC1_Format',function(){return Et}),n.d(t,'LoopOnce',function(){return _t}),n.d(t,'LoopRepeat',function(){return Ct}),n.d(t,'LoopPingPong',function(){return yt}),n.d(t,'InterpolateDiscrete',function(){return At}),n.d(t,'InterpolateLinear',function(){return bt}),n.d(t,'InterpolateSmooth',function(){return xt}),n.d(t,'ZeroCurvatureEnding',function(){return vt}),n.d(t,'ZeroSlopeEnding',function(){return Tt}),n.d(t,'WrapAroundEnding',function(){return St}),n.d(t,'TrianglesDrawMode',function(){return Rt}),n.d(t,'TriangleStripDrawMode',function(){return Ft}),n.d(t,'TriangleFanDrawMode',function(){return wt}),n.d(t,'LinearEncoding',function(){return Mt}),n.d(t,'sRGBEncoding',function(){return Lt}),n.d(t,'GammaEncoding',function(){return Bt}),n.d(t,'RGBEEncoding',function(){return Dt}),n.d(t,'LogLuvEncoding',function(){return It}),n.d(t,'RGBM7Encoding',function(){return Nt}),n.d(t,'RGBM16Encoding',function(){return Pt}),n.d(t,'RGBDEncoding',function(){return Ot}),n.d(t,'BasicDepthPacking',function(){return Ut}),n.d(t,'RGBADepthPacking',function(){return Gt}),n.d(t,'CubeGeometry',function(){return BoxGeometry}),n.d(t,'Face4',function(){return Face4}),n.d(t,'LineStrip',function(){return Sn}),n.d(t,'LinePieces',function(){return Rn}),n.d(t,'MeshFaceMaterial',function(){return MeshFaceMaterial}),n.d(t,'MultiMaterial',function(){return MultiMaterial}),n.d(t,'PointCloud',function(){return PointCloud}),n.d(t,'Particle',function(){return Particle}),n.d(t,'ParticleSystem',function(){return ParticleSystem}),n.d(t,'PointCloudMaterial',function(){return PointCloudMaterial}),n.d(t,'ParticleBasicMaterial',function(){return ParticleBasicMaterial}),n.d(t,'ParticleSystemMaterial',function(){return ParticleSystemMaterial}),n.d(t,'Vertex',function(){return Vertex}),n.d(t,'DynamicBufferAttribute',function(){return DynamicBufferAttribute}),n.d(t,'Int8Attribute',function(){return Int8Attribute}),n.d(t,'Uint8Attribute',function(){return Uint8Attribute}),n.d(t,'Uint8ClampedAttribute',function(){return Uint8ClampedAttribute}),n.d(t,'Int16Attribute',function(){return Int16Attribute}),n.d(t,'Uint16Attribute',function(){return Uint16Attribute}),n.d(t,'Int32Attribute',function(){return Int32Attribute}),n.d(t,'Uint32Attribute',function(){return Uint32Attribute}),n.d(t,'Float32Attribute',function(){return Float32Attribute}),n.d(t,'Float64Attribute',function(){return Float64Attribute}),n.d(t,'ClosedSplineCurve3',function(){return ClosedSplineCurve3}),n.d(t,'SplineCurve3',function(){return SplineCurve3}),n.d(t,'Spline',function(){return Spline}),n.d(t,'BoundingBoxHelper',function(){return BoundingBoxHelper}),n.d(t,'EdgesHelper',function(){return EdgesHelper}),n.d(t,'WireframeHelper',function(){return WireframeHelper}),n.d(t,'XHRLoader',function(){return XHRLoader}),n.d(t,'BinaryTextureLoader',function(){return BinaryTextureLoader}),n.d(t,'GeometryUtils',function(){return Fn}),n.d(t,'ImageUtils',function(){return wn}),n.d(t,'Projector',function(){return Projector}),n.d(t,'CanvasRenderer',function(){return CanvasRenderer}),g===void 0&&(g=2.220446049250313e-16),u===void 0&&(u=function(e){return'number'==typeof e&&isFinite(e)&&h(e)===e}),p===void 0&&(p=function(e){return 0>e?-1:0r;r++)8===r||13===r||18===r||23===r?t[r]='-':14===r?t[r]='4':(2>=n&&(n=0|33554432+16777216*Math.random()),a=15&n,n>>=4,t[r]=e[19===r?8|3&a:a]);return t.join('')}}(),clamp:function(e,t,n){return y(t,f(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,a,r){return a+(e-t)*(r-a)/(n-t)},lerp:function(e,n,a){return(1-a)*e+a*n},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*(3-2*e))},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*e*(e*(6*e-15)+10))},randInt:function(e,t){return e+h(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(0.5-Math.random())},degToRad:function(e){return e*kt.DEG2RAD},radToDeg:function(e){return e*kt.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},nearestPowerOfTwo:function(e){return s(2,l(c(e)/d))},nextPowerOfTwo:function(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,e}};Object.defineProperties(Vector2.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),Object.assign(Vector2.prototype,{isVector2:!0,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error('index is out of range: '+e);}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error('index is out of range: '+e);}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0===t?(this.x+=e.x,this.y+=e.y,this):(console.warn('THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'),this.addVectors(e,t))},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub:function(e,t){return void 0===t?(this.x-=e.x,this.y-=e.y,this):(console.warn('THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'),this.subVectors(e,t))},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=f(this.x,e.x),this.y=f(this.y,e.y),this},max:function(e){return this.x=y(this.x,e.x),this.y=y(this.y,e.y),this},clamp:function(e,t){return this.x=y(e.x,f(t.x,this.x)),this.y=y(e.y,f(t.y,this.y)),this},clampScalar:function(){var e=new Vector2,t=new Vector2;return function clampScalar(n,a){return e.set(n,n),t.set(a,a),this.clamp(e,t)}}(),clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(y(e,f(t,n)))},floor:function(){return this.x=h(this.x),this.y=h(this.y),this},ceil:function(){return this.x=C(this.x),this.y=C(this.y),this},round:function(){return this.x=l(this.x),this.y=l(this.y),this},roundToZero:function(){return this.x=0>this.x?C(this.x):h(this.x),this.y=0>this.y?C(this.y):h(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return _(this.x*this.x+this.y*this.y)},lengthManhattan:function(){return A(this.x)+A(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var e=i(this.y,this.x);return 0>e&&(e+=2*S),e},distanceTo:function(e){return _(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},distanceToManhattan:function(e){return A(this.x-e.x)+A(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn('THREE.Vector2: offset has been removed from .fromBufferAttribute().'),this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var n=m(t),a=o(t),r=this.x-e.x,i=this.y-e.y;return this.x=r*n-i*a+e.x,this.y=r*a+i*n+e.y,this}});var Wt=0;Texture.DEFAULT_IMAGE=void 0,Texture.DEFAULT_MAPPING=Se,Object.defineProperty(Texture.prototype,'needsUpdate',{set:function(e){!0===e&&this.version++}}),Object.assign(Texture.prototype,EventDispatcher.prototype,{constructor:Texture,isTexture:!0,clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){function getDataURL(e){var t;if(e instanceof HTMLCanvasElement)t=e;else{t=document.createElementNS('http://www.w3.org/1999/xhtml','canvas'),t.width=e.width,t.height=e.height;var n=t.getContext('2d');e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height)}return 2048e.x||1e.x?0:1;break;case Pe:1===A(h(e.x)%2)?e.x=C(e.x)-e.x:e.x-=h(e.x);}if(0>e.y||1e.y?0:1;break;case Pe:1===A(h(e.y)%2)?e.y=C(e.y)-e.y:e.y-=h(e.y);}this.flipY&&(e.y=1-e.y)}}}),Object.assign(Vector4.prototype,{isVector4:!0,set:function(e,t,n,a){return this.x=e,this.y=t,this.z=n,this.w=a,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error('index is out of range: '+e);}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error('index is out of range: '+e);}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0===e.w?1:e.w,this},add:function(e,t){return void 0===t?(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this):(console.warn('THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'),this.addVectors(e,t))},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this},sub:function(e,t){return void 0===t?(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this):(console.warn('THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'),this.subVectors(e,t))},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(t){var n=this.x,a=this.y,r=this.z,o=this.w,i=t.elements;return this.x=i[0]*n+i[4]*a+i[8]*r+i[12]*o,this.y=i[1]*n+i[5]*a+i[9]*r+i[13]*o,this.z=i[2]*n+i[6]*a+i[10]*r+i[14]*o,this.w=i[3]*n+i[7]*a+i[11]*r+i[15]*o,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*r(e.w);var t=_(1-e.w*e.w);return 1e-4>t?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t=0.01,n=0.1,a=e.elements,o=a[0],i=a[4],l=a[8],d=a[1],c=a[5],p=a[9],u=a[2],m=a[6],g=a[10],h,f,E,C;if(A(i-d)b&&y>x?yx?bA(F)&&(F=1),this.x=(m-p)/F,this.y=(l-u)/F,this.z=(d-i)/F,this.w=r((o+c+g-1)/2),this},min:function(e){return this.x=f(this.x,e.x),this.y=f(this.y,e.y),this.z=f(this.z,e.z),this.w=f(this.w,e.w),this},max:function(e){return this.x=y(this.x,e.x),this.y=y(this.y,e.y),this.z=y(this.z,e.z),this.w=y(this.w,e.w),this},clamp:function(e,t){return this.x=y(e.x,f(t.x,this.x)),this.y=y(e.y,f(t.y,this.y)),this.z=y(e.z,f(t.z,this.z)),this.w=y(e.w,f(t.w,this.w)),this},clampScalar:function(){var e,t;return function clampScalar(n,a){return void 0==e&&(e=new Vector4,t=new Vector4),e.set(n,n,n,n),t.set(a,a,a,a),this.clamp(e,t)}}(),clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(y(e,f(t,n)))},floor:function(){return this.x=h(this.x),this.y=h(this.y),this.z=h(this.z),this.w=h(this.w),this},ceil:function(){return this.x=C(this.x),this.y=C(this.y),this.z=C(this.z),this.w=C(this.w),this},round:function(){return this.x=l(this.x),this.y=l(this.y),this.z=l(this.z),this.w=l(this.w),this},roundToZero:function(){return this.x=0>this.x?C(this.x):h(this.x),this.y=0>this.y?C(this.y):h(this.y),this.z=0>this.z?C(this.z):h(this.z),this.w=0>this.w?C(this.w):h(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(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return _(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return A(this.x)+A(this.y)+A(this.z)+A(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn('THREE.Vector4: offset has been removed from .fromBufferAttribute().'),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}}),Object.assign(WebGLRenderTarget.prototype,EventDispatcher.prototype,{isWebGLRenderTarget:!0,setSize:function(e,t){(this.width!==e||this.height!==t)&&(this.width=e,this.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:'dispose'})}}),WebGLRenderTargetCube.prototype=Object.create(WebGLRenderTarget.prototype),WebGLRenderTargetCube.prototype.constructor=WebGLRenderTargetCube,WebGLRenderTargetCube.prototype.isWebGLRenderTargetCube=!0,Object.assign(Quaternion,{slerp:function(e,n,a,r){return a.copy(e).slerp(n,r)},slerpFlat:function(e,n,a,r,l,d,c){var t=a[r+0],p=a[r+1],u=a[r+2],m=a[r+3],h=l[d+0],E=l[d+1],C=l[d+2],y=l[d+3];if(m!==y||t!==h||p!==E||u!==C){var A=1-c,s=t*h+p*E+u*C+m*y,b=0<=s?1:-1,x=1-s*s;if(x>g){var v=_(x),T=i(v,s*b);A=o(A*T)/v,c=o(c*T)/v}var S=c*b;if(t=t*A+h*S,p=p*A+E*S,u=u*A+C*S,m=m*A+y*S,A==1-c){var R=1/_(t*t+p*p+u*u+m*m);t*=R,p*=R,u*=R,m*=R}}e[n]=t,e[n+1]=p,e[n+2]=u,e[n+3]=m}}),Object.defineProperties(Quaternion.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this.onChangeCallback()}}}),Object.assign(Quaternion.prototype,{set:function(e,t,n,a){return this._x=e,this._y=t,this._z=n,this._w=a,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this.onChangeCallback(),this},setFromEuler:function(e,t){if(!(e&&e.isEuler))throw new Error('THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.');var n=e._x,a=e._y,r=e._z,i=e.order,s=m,l=o,d=s(n/2),c=s(a/2),p=s(r/2),u=l(n/2),g=l(a/2),h=l(r/2);return'XYZ'===i?(this._x=u*c*p+d*g*h,this._y=d*g*p-u*c*h,this._z=d*c*h+u*g*p,this._w=d*c*p-u*g*h):'YXZ'===i?(this._x=u*c*p+d*g*h,this._y=d*g*p-u*c*h,this._z=d*c*h-u*g*p,this._w=d*c*p+u*g*h):'ZXY'===i?(this._x=u*c*p-d*g*h,this._y=d*g*p+u*c*h,this._z=d*c*h+u*g*p,this._w=d*c*p-u*g*h):'ZYX'===i?(this._x=u*c*p-d*g*h,this._y=d*g*p+u*c*h,this._z=d*c*h-u*g*p,this._w=d*c*p+u*g*h):'YZX'===i?(this._x=u*c*p+d*g*h,this._y=d*g*p+u*c*h,this._z=d*c*h-u*g*p,this._w=d*c*p-u*g*h):'XZY'===i&&(this._x=u*c*p-d*g*h,this._y=d*g*p-u*c*h,this._z=d*c*h+u*g*p,this._w=d*c*p+u*g*h),!1!==t&&this.onChangeCallback(),this},setFromAxisAngle:function(e,t){var n=t/2,a=o(n);return this._x=e.x*a,this._y=e.y*a,this._z=e.z*a,this._w=m(n),this.onChangeCallback(),this},setFromRotationMatrix:function(e){var t=e.elements,n=t[0],a=t[4],r=t[8],o=t[1],i=t[5],l=t[9],d=t[2],c=t[6],p=t[10],u=n+i+p,m;return 0i&&n>p?(m=2*_(1+n-i-p),this._w=(c-l)/m,this._x=0.25*m,this._y=(a+o)/m,this._z=(r+d)/m):i>p?(m=2*_(1+i-n-p),this._w=(r-d)/m,this._x=(a+o)/m,this._y=0.25*m,this._z=(l+c)/m):(m=2*_(1+p-n-i),this._w=(o-a)/m,this._x=(r+d)/m,this._y=(l+c)/m,this._z=0.25*m),this.onChangeCallback(),this},setFromUnitVectors:function(){var e=new Vector3,t;return function setFromUnitVectors(n,a){return void 0===e&&(e=new Vector3),t=n.dot(a)+1,t<1e-6?(t=0,A(n.x)>A(n.z)?e.set(-n.y,n.x,0):e.set(0,-n.z,n.y)):e.crossVectors(n,a),this._x=e.x,this._y=e.y,this._z=e.z,this._w=t,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(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return _(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x*=e,this._y*=e,this._z*=e,this._w*=e),this.onChangeCallback(),this},multiply:function(e,t){return void 0===t?this.multiplyQuaternions(this,e):(console.warn('THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.'),this.multiplyQuaternions(e,t))},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var n=e._x,a=e._y,r=e._z,o=e._w,i=t._x,s=t._y,l=t._z,d=t._w;return this._x=n*d+o*i+a*l-r*s,this._y=a*d+o*s+r*i-n*l,this._z=r*d+o*l+n*s-a*i,this._w=o*d-n*i-a*s-r*l,this.onChangeCallback(),this},slerp:function(e,n){if(0===n)return this;if(1===n)return this.copy(e);var t=this._x,a=this._y,r=this._z,s=this._w,l=s*e._w+t*e._x+a*e._y+r*e._z;if(0>l?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,l=-l):this.copy(e),1<=l)return this._w=s,this._x=t,this._y=a,this._z=r,this;var d=_(1-l*l);if(1e-3>A(d))return this._w=0.5*(s+this._w),this._x=0.5*(t+this._x),this._y=0.5*(a+this._y),this._z=0.5*(r+this._z),this;var c=i(d,l),p=o((1-n)*c)/d,u=o(n*c)/d;return this._w=s*p+this._w*u,this._x=t*p+this._x*u,this._y=a*p+this._y*u,this._z=r*p+this._z*u,this.onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),Object.assign(Vector3.prototype,{isVector3:!0,set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error('index is out of range: '+e);}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error('index is out of range: '+e);}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0===t?(this.x+=e.x,this.y+=e.y,this.z+=e.z,this):(console.warn('THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'),this.addVectors(e,t))},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0===t?(this.x-=e.x,this.y-=e.y,this.z-=e.z,this):(console.warn('THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'),this.subVectors(e,t))},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0===t?(this.x*=e.x,this.y*=e.y,this.z*=e.z,this):(console.warn('THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.'),this.multiplyVectors(e,t))},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:function(){var e=new Quaternion;return function applyEuler(t){return t&&t.isEuler||console.error('THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.'),this.applyQuaternion(e.setFromEuler(t))}}(),applyAxisAngle:function(){var e=new Quaternion;return function applyAxisAngle(t,n){return this.applyQuaternion(e.setFromAxisAngle(t,n))}}(),applyMatrix3:function(t){var n=this.x,a=this.y,r=this.z,o=t.elements;return this.x=o[0]*n+o[3]*a+o[6]*r,this.y=o[1]*n+o[4]*a+o[7]*r,this.z=o[2]*n+o[5]*a+o[8]*r,this},applyMatrix4:function(t){var n=this.x,a=this.y,r=this.z,o=t.elements,e=1/(o[3]*n+o[7]*a+o[11]*r+o[15]);return this.x=(o[0]*n+o[4]*a+o[8]*r+o[12])*e,this.y=(o[1]*n+o[5]*a+o[9]*r+o[13])*e,this.z=(o[2]*n+o[6]*a+o[10]*r+o[14])*e,this},applyQuaternion:function(e){var t=this.x,n=this.y,a=this.z,r=e.x,o=e.y,i=e.z,s=e.w,l=s*t+o*a-i*n,d=s*n+i*t-r*a,c=s*a+r*n-o*t,p=-r*t-o*n-i*a;return this.x=l*s+p*-r+d*-i-c*-o,this.y=d*s+p*-o+c*-r-l*-i,this.z=c*s+p*-i+l*-o-d*-r,this},project:function(){var e=new Matrix4;return function project(t){return e.multiplyMatrices(t.projectionMatrix,e.getInverse(t.matrixWorld)),this.applyMatrix4(e)}}(),unproject:function(){var e=new Matrix4;return function unproject(t){return e.multiplyMatrices(t.matrixWorld,e.getInverse(t.projectionMatrix)),this.applyMatrix4(e)}}(),transformDirection:function(t){var n=this.x,a=this.y,r=this.z,o=t.elements;return this.x=o[0]*n+o[4]*a+o[8]*r,this.y=o[1]*n+o[5]*a+o[9]*r,this.z=o[2]*n+o[6]*a+o[10]*r,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=f(this.x,e.x),this.y=f(this.y,e.y),this.z=f(this.z,e.z),this},max:function(e){return this.x=y(this.x,e.x),this.y=y(this.y,e.y),this.z=y(this.z,e.z),this},clamp:function(e,t){return this.x=y(e.x,f(t.x,this.x)),this.y=y(e.y,f(t.y,this.y)),this.z=y(e.z,f(t.z,this.z)),this},clampScalar:function(){var e=new Vector3,t=new Vector3;return function clampScalar(n,a){return e.set(n,n,n),t.set(a,a,a),this.clamp(e,t)}}(),clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(y(e,f(t,n)))},floor:function(){return this.x=h(this.x),this.y=h(this.y),this.z=h(this.z),this},ceil:function(){return this.x=C(this.x),this.y=C(this.y),this.z=C(this.z),this},round:function(){return this.x=l(this.x),this.y=l(this.y),this.z=l(this.z),this},roundToZero:function(){return this.x=0>this.x?C(this.x):h(this.x),this.y=0>this.y?C(this.y):h(this.y),this.z=0>this.z?C(this.z):h(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return _(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return A(this.x)+A(this.y)+A(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},cross:function(e,t){if(void 0!==t)return console.warn('THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.'),this.crossVectors(e,t);var n=this.x,a=this.y,r=this.z;return this.x=a*e.z-r*e.y,this.y=r*e.x-n*e.z,this.z=n*e.y-a*e.x,this},crossVectors:function(e,t){var n=e.x,a=e.y,r=e.z,o=t.x,i=t.y,s=t.z;return this.x=a*s-r*i,this.y=r*o-n*s,this.z=n*i-a*o,this},projectOnVector:function(e){var t=e.dot(this)/e.lengthSq();return this.copy(e).multiplyScalar(t)},projectOnPlane:function(){var e=new Vector3;return function projectOnPlane(t){return e.copy(this).projectOnVector(t),this.sub(e)}}(),reflect:function(){var e=new Vector3;return function reflect(t){return this.sub(e.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(e){var t=this.dot(e)/_(this.lengthSq()*e.lengthSq());return r(kt.clamp(t,-1,1))},distanceTo:function(e){return _(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y,a=this.z-e.z;return t*t+n*n+a*a},distanceToManhattan:function(e){return A(this.x-e.x)+A(this.y-e.y)+A(this.z-e.z)},setFromSpherical:function(e){var t=o(e.phi)*e.radius;return this.x=t*o(e.theta),this.y=m(e.phi)*e.radius,this.z=t*m(e.theta),this},setFromCylindrical:function(e){return this.x=e.radius*o(e.theta),this.y=e.y,this.z=e.radius*m(e.theta),this},setFromMatrixPosition:function(t){var n=t.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),a=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=a,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn('THREE.Vector3: offset has been removed from .fromBufferAttribute().'),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}}),Object.assign(Matrix4.prototype,{isMatrix4:!0,set:function(e,t,n,a,r,o,i,s,l,d,c,p,u,m,g,h){var f=this.elements;return f[0]=e,f[4]=t,f[8]=n,f[12]=a,f[1]=r,f[5]=o,f[9]=i,f[13]=s,f[2]=l,f[6]=d,f[10]=c,f[14]=p,f[3]=u,f[7]=m,f[11]=g,f[15]=h,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 Matrix4().fromArray(this.elements)},copy:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this},copyPosition:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this},extractBasis:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this},extractRotation:function(){var e=new Vector3;return function extractRotation(t){var n=this.elements,a=t.elements,r=1/e.setFromMatrixColumn(t,0).length(),o=1/e.setFromMatrixColumn(t,1).length(),i=1/e.setFromMatrixColumn(t,2).length();return n[0]=a[0]*r,n[1]=a[1]*r,n[2]=a[2]*r,n[4]=a[4]*o,n[5]=a[5]*o,n[6]=a[6]*o,n[8]=a[8]*i,n[9]=a[9]*i,n[10]=a[10]*i,this}}(),makeRotationFromEuler:function(t){t&&t.isEuler||console.error('THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.');var n=this.elements,r=t.x,i=t.y,s=t.z,l=m(r),p=o(r),u=m(i),g=o(i),h=m(s),e=o(s);if('XYZ'===t.order){var E=l*h,_=l*e,C=p*h,y=p*e;n[0]=u*h,n[4]=-u*e,n[8]=g,n[1]=_+C*g,n[5]=E-y*g,n[9]=-p*u,n[2]=y-E*g,n[6]=C+_*g,n[10]=l*u}else if('YXZ'===t.order){var A=u*h,x=u*e,v=g*h,T=g*e;n[0]=A+T*p,n[4]=v*p-x,n[8]=l*g,n[1]=l*e,n[5]=l*h,n[9]=-p,n[2]=x*p-v,n[6]=T+A*p,n[10]=l*u}else if('ZXY'===t.order){var A=u*h,x=u*e,v=g*h,T=g*e;n[0]=A-T*p,n[4]=-l*e,n[8]=v+x*p,n[1]=x+v*p,n[5]=l*h,n[9]=T-A*p,n[2]=-l*g,n[6]=p,n[10]=l*u}else if('ZYX'===t.order){var E=l*h,_=l*e,C=p*h,y=p*e;n[0]=u*h,n[4]=C*g-_,n[8]=E*g+y,n[1]=u*e,n[5]=y*g+E,n[9]=_*g-C,n[2]=-g,n[6]=p*u,n[10]=l*u}else if('YZX'===t.order){var S=l*u,R=l*g,F=p*u,w=p*g;n[0]=u*h,n[4]=w-S*e,n[8]=F*e+R,n[1]=e,n[5]=l*h,n[9]=-p*h,n[2]=-g*h,n[6]=R*e+F,n[10]=S-w*e}else if('XZY'===t.order){var S=l*u,R=l*g,F=p*u,w=p*g;n[0]=u*h,n[4]=-e,n[8]=g*h,n[1]=S*e+w,n[5]=l*h,n[9]=R*e-F,n[2]=F*e-R,n[6]=p*h,n[10]=w*e+S}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this},makeRotationFromQuaternion:function(e){var t=this.elements,n=e._x,a=e._y,r=e._z,o=e._w,i=n+n,s=a+a,l=r+r,d=n*i,c=n*s,p=n*l,u=a*s,m=a*l,g=r*l,h=o*i,f=o*s,E=o*l;return t[0]=1-(u+g),t[4]=c-E,t[8]=p+f,t[1]=c+E,t[5]=1-(d+g),t[9]=m-h,t[2]=p-f,t[6]=m+h,t[10]=1-(d+u),t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},lookAt:function(){var e=new Vector3,t=new Vector3,n=new Vector3;return function lookAt(a,r,o){var i=this.elements;return n.subVectors(a,r),0===n.lengthSq()&&(n.z=1),n.normalize(),e.crossVectors(o,n),0===e.lengthSq()&&(1===A(o.z)?n.x+=1e-4:n.z+=1e-4,n.normalize(),e.crossVectors(o,n)),e.normalize(),t.crossVectors(n,e),i[0]=e.x,i[4]=t.x,i[8]=n.x,i[1]=e.y,i[5]=t.y,i[9]=n.y,i[2]=e.z,i[6]=t.z,i[10]=n.z,this}}(),multiply:function(e,t){return void 0===t?this.multiplyMatrices(this,e):(console.warn('THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.'),this.multiplyMatrices(e,t))},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,a=t.elements,r=this.elements,o=n[0],i=n[4],s=n[8],l=n[12],d=n[1],c=n[5],p=n[9],u=n[13],m=n[2],g=n[6],h=n[10],f=n[14],E=n[3],_=n[7],C=n[11],y=n[15],A=a[0],b=a[4],x=a[8],v=a[12],T=a[1],S=a[5],R=a[9],F=a[13],w=a[2],M=a[6],L=a[10],B=a[14],D=a[3],I=a[7],N=a[11],P=a[15];return r[0]=o*A+i*T+s*w+l*D,r[4]=o*b+i*S+s*M+l*I,r[8]=o*x+i*R+s*L+l*N,r[12]=o*v+i*F+s*B+l*P,r[1]=d*A+c*T+p*w+u*D,r[5]=d*b+c*S+p*M+u*I,r[9]=d*x+c*R+p*L+u*N,r[13]=d*v+c*F+p*B+u*P,r[2]=m*A+g*T+h*w+f*D,r[6]=m*b+g*S+h*M+f*I,r[10]=m*x+g*R+h*L+f*N,r[14]=m*v+g*F+h*B+f*P,r[3]=E*A+_*T+C*w+y*D,r[7]=E*b+_*S+C*M+y*I,r[11]=E*x+_*R+C*L+y*N,r[15]=E*v+_*F+C*B+y*P,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},applyToBufferAttribute:function(){var e=new Vector3;return function applyToBufferAttribute(t){for(var n=0,a=t.count;nd&&(i=-i),n.x=o[12],n.y=o[13],n.z=o[14],t.copy(this);var c=1/i,p=1/s,u=1/l;return t.elements[0]*=c,t.elements[1]*=c,t.elements[2]*=c,t.elements[4]*=p,t.elements[5]*=p,t.elements[6]*=p,t.elements[8]*=u,t.elements[9]*=u,t.elements[10]*=u,a.setFromRotationMatrix(t),r.x=i,r.y=s,r.z=l,this}}(),makePerspective:function(e,t,n,a,r,o){void 0===o&&console.warn('THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.');var i=this.elements;return i[0]=2*r/(t-e),i[4]=0,i[8]=(t+e)/(t-e),i[12]=0,i[1]=0,i[5]=2*r/(n-a),i[9]=(n+a)/(n-a),i[13]=0,i[2]=0,i[6]=0,i[10]=-(o+r)/(o-r),i[14]=-2*o*r/(o-r),i[3]=0,i[7]=0,i[11]=-1,i[15]=0,this},makeOrthographic:function(e,t,n,a,r,o){var i=this.elements,s=1/(t-e),l=1/(n-a),d=1/(o-r);return i[0]=2*s,i[4]=0,i[8]=0,i[12]=-((t+e)*s),i[1]=0,i[5]=2*l,i[9]=0,i[13]=-((n+a)*l),i[2]=0,i[6]=0,i[10]=-2*d,i[14]=-((o+r)*d),i[3]=0,i[7]=0,i[11]=0,i[15]=1,this},equals:function(e){for(var t=this.elements,n=e.elements,a=0;16>a;a++)if(t[a]!==n[a])return!1;return!0},fromArray:function(e,t){t===void 0&&(t=0);for(var n=0;16>n;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}),DataTexture.prototype=Object.create(Texture.prototype),DataTexture.prototype.constructor=DataTexture,DataTexture.prototype.isDataTexture=!0,CubeTexture.prototype=Object.create(Texture.prototype),CubeTexture.prototype.constructor=CubeTexture,CubeTexture.prototype.isCubeTexture=!0,Object.defineProperty(CubeTexture.prototype,'images',{get:function(){return this.image},set:function(e){this.image=e}});var Ht=new Texture,Vt=new CubeTexture,$t=[],zt=[],Xt=new Float32Array(16),jt=new Float32Array(9);StructuredUniform.prototype.setValue=function(e,t){for(var a=this.seq,r=0,o=a.length,n;r!==o;++r)n=a[r],n.setValue(e,t[n.id])};var Yt=/([\w\d_]+)(\])?(\[|\.)?/g;WebGLUniforms.prototype.setValue=function(e,t,n){var a=this.map[t];a!==void 0&&a.setValue(e,n,this.renderer)},WebGLUniforms.prototype.setOptional=function(e,t,n){var a=t[n];a!==void 0&&this.setValue(e,n,a)},WebGLUniforms.upload=function(e,t,a,r){for(var o=0,i=t.length;o!==i;++o){var n=t[o],s=a[n.id];!1!==s.needsUpdate&&n.setValue(e,s.value,r)}},WebGLUniforms.seqWithValue=function(e,t){for(var a=[],r=0,o=e.length,n;r!==o;++r)n=e[r],n.id in t&&a.push(n);return a};var Kt={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,rebeccapurple:6697881,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};Object.assign(Color.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):'number'==typeof e?this.setHex(e):'string'==typeof e&&this.setStyle(e),this},setScalar:function(e){return this.r=e,this.g=e,this.b=e,this},setHex:function(e){return e=h(e),this.r=(255&e>>16)/255,this.g=(255&e>>8)/255,this.b=(255&e)/255,this},setRGB:function(e,t,n){return this.r=e,this.g=t,this.b=n,this},setHSL:function(){function hue2rgb(e,n,a){return 0>a&&(a+=1),1=n?n*(1+t):n+t-n*t,r=2*n-a;this.r=hue2rgb(r,a,e+1/3),this.g=hue2rgb(r,a,e),this.b=hue2rgb(r,a,e-1/3)}return this}}(),setStyle:function(e){function handleAlpha(t){void 0===t||1>parseFloat(t)&&console.warn('THREE.Color: Alpha component of '+e+' will be ignored.')}var t;if(t=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var n=t[1],a=t[2],r;switch(n){case'rgb':case'rgba':if(r=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=f(255,parseInt(r[1],10))/255,this.g=f(255,parseInt(r[2],10))/255,this.b=f(255,parseInt(r[3],10))/255,handleAlpha(r[5]),this;if(r=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))return this.r=f(100,parseInt(r[1],10))/100,this.g=f(100,parseInt(r[2],10))/100,this.b=f(100,parseInt(r[3],10))/100,handleAlpha(r[5]),this;break;case'hsl':case'hsla':if(r=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)){var o=parseFloat(r[1])/360,i=parseInt(r[2],10)/100,s=parseInt(r[3],10)/100;return handleAlpha(r[5]),this.setHSL(o,i,s)}}}else if(t=/^\#([A-Fa-f0-9]+)$/.exec(e)){var l=t[1],d=l.length;if(3===d)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===d)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}if(e&&0=s?c/(o+i):c/(2-o-i),o===n?l=(a-r)/c+(a 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t}\n\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 LTC_Uv( const in vec3 N, const in vec3 V, 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\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}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.86267 + (0.49788 + 0.01436 * y ) * y;\n\tfloat b = 3.45068 + (4.18814 + y) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = (x > 0.0) ? v : 0.5 * inversesqrt( 1.0 - x * x ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transpose( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tvec3 result = vec3( LTC_ClippedSphereFormFactor( vectorFormFactor ) );\n\treturn result;\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 = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\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:'vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\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 += normalize( objectNormal ) * ( 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\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn 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\treturn 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\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = min( floor( D ) / 255.0, 1.0 );\n\treturn 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\tvec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n\tXp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract(Le);\n\tvResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n\treturn 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\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n\treturn 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, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = 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_vertex:'\n#ifdef USE_FOG\nfogDepth = -mvPosition.z;\n#endif',fog_pars_vertex:'#ifdef USE_FOG\n varying float fogDepth;\n#endif\n',fog_fragment:'#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\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\tvarying float fogDepth;\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\n',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_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\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\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 = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 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};\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_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\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos - halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos + halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos + halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos - halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tfloat norm = texture2D( ltcMag, uv ).a;\n\t\tvec4 t = texture2D( ltcMat, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( 1, 0, t.y ),\n\t\t\tvec3( 0, t.z, 0 ),\n\t\t\tvec3( t.w, 0, t.x )\n\t\t);\n\t\treflectedLight.directSpecular += lightColor * material.specularColor * norm * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1 ), rectCoords );\n\t}\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 ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 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\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.b;\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_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 );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\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 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\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\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 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\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( 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:'vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;\n',dithering_fragment:'#if defined( DITHERING )\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif\n',dithering_pars_fragment:'#if defined( DITHERING )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif\n',roughnessmap_fragment:'float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\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\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\tfloat shadow = 1.0;\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\tshadow = (\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\tshadow = (\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\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\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, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\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#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#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 ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\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 boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\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\ttransformed = ( bindMatrixInverse * skinned ).xyz;\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\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn 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\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn 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( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif\n',cube_frag:'uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldPosition;\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 \nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}\n',depth_frag:'#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n',distanceRGBA_frag:'#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}\n',distanceRGBA_vert:'#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}\n',equirect_frag:'uniform sampler2D tEquirect;\nvarying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 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 \nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}\n',linedashed_frag:'uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n',linedashed_vert:'uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}\n',meshbasic_frag:'uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n',meshbasic_vert:'#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include \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 \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n',meshlambert_vert:'#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n',meshphong_frag:'#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n',meshphong_vert:'#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n',meshphysical_vert:'#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\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 \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n',points_vert:'uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n}\n',shadow_frag:'uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n}\n',shadow_vert:'#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n}\n'},Jt={basic:{uniforms:Zt.merge([qt.common,qt.specularmap,qt.envmap,qt.aomap,qt.lightmap,qt.fog]),vertexShader:Qt.meshbasic_vert,fragmentShader:Qt.meshbasic_frag},lambert:{uniforms:Zt.merge([qt.common,qt.specularmap,qt.envmap,qt.aomap,qt.lightmap,qt.emissivemap,qt.fog,qt.lights,{emissive:{value:new Color(0)}}]),vertexShader:Qt.meshlambert_vert,fragmentShader:Qt.meshlambert_frag},phong:{uniforms:Zt.merge([qt.common,qt.specularmap,qt.envmap,qt.aomap,qt.lightmap,qt.emissivemap,qt.bumpmap,qt.normalmap,qt.displacementmap,qt.gradientmap,qt.fog,qt.lights,{emissive:{value:new Color(0)},specular:{value:new Color(1118481)},shininess:{value:30}}]),vertexShader:Qt.meshphong_vert,fragmentShader:Qt.meshphong_frag},standard:{uniforms:Zt.merge([qt.common,qt.envmap,qt.aomap,qt.lightmap,qt.emissivemap,qt.bumpmap,qt.normalmap,qt.displacementmap,qt.roughnessmap,qt.metalnessmap,qt.fog,qt.lights,{emissive:{value:new Color(0)},roughness:{value:0.5},metalness:{value:0.5},envMapIntensity:{value:1}}]),vertexShader:Qt.meshphysical_vert,fragmentShader:Qt.meshphysical_frag},points:{uniforms:Zt.merge([qt.points,qt.fog]),vertexShader:Qt.points_vert,fragmentShader:Qt.points_frag},dashed:{uniforms:Zt.merge([qt.common,qt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Qt.linedashed_vert,fragmentShader:Qt.linedashed_frag},depth:{uniforms:Zt.merge([qt.common,qt.displacementmap]),vertexShader:Qt.depth_vert,fragmentShader:Qt.depth_frag},normal:{uniforms:Zt.merge([qt.common,qt.bumpmap,qt.normalmap,qt.displacementmap,{opacity:{value:1}}]),vertexShader:Qt.normal_vert,fragmentShader:Qt.normal_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Qt.cube_vert,fragmentShader:Qt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Qt.equirect_vert,fragmentShader:Qt.equirect_frag},distanceRGBA:{uniforms:Zt.merge([qt.common,qt.displacementmap,{referencePosition:{value:new Vector3},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Qt.distanceRGBA_vert,fragmentShader:Qt.distanceRGBA_frag},shadow:{uniforms:Zt.merge([qt.lights,{color:{value:new Color(0)},opacity:{value:1}}]),vertexShader:Qt.shadow_vert,fragmentShader:Qt.shadow_frag}};Jt.physical={uniforms:Zt.merge([Jt.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:Qt.meshphysical_vert,fragmentShader:Qt.meshphysical_frag},Object.assign(Box2.prototype,{set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;tthis.max.x||e.ythis.max.y?!1:!0},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},getParameter:function(e,t){var n=t||new Vector2;return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(e){return e.max.xthis.max.x||e.max.ythis.max.y?!1:!0},clampPoint:function(e,t){var n=t||new Vector2;return n.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new Vector2;return function distanceToPoint(t){var n=e.copy(t).clamp(this.min,this.max);return n.sub(t).length()}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),CanvasTexture.prototype=Object.create(Texture.prototype),CanvasTexture.prototype.constructor=CanvasTexture;var en=0;Object.assign(Material.prototype,EventDispatcher.prototype,{isMaterial:!0,onBeforeCompile:function(){},setValues:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0===n){console.warn('THREE.Material: \''+t+'\' parameter is undefined.');continue}if('shading'==t){console.warn('THREE.'+this.type+': .shading has been removed. Use the boolean .flatShading instead.'),this.flatShading=n===O;continue}var a=this[t];if(void 0===a){console.warn('THREE.'+this.type+': \''+t+'\' is not a property of this material.');continue}a&&a.isColor?a.set(n):a&&a.isVector3&&n&&n.isVector3?a.copy(n):'overdraw'==t?this[t]=+n:this[t]=n}},toJSON:function(e){function extractFromCache(e){var t=[];for(var n in e){var a=e[n];delete a.metadata,t.push(a)}return t}var t=void 0===e;t&&(e={textures:{},images:{}});var n={metadata:{version:4.5,type:'Material',generator:'Material.toJSON'}};if(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(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,n.reflectivity=this.reflectivity),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==V&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),this.side!==I&&(n.side=this.side),this.vertexColors!==G&&(n.vertexColors=this.vertexColors),1>this.opacity&&(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.dithering&&(n.dithering=!0),0r&&(r=l),c>o&&(o=c),p>s&&(s=p)}return this.min.set(t,n,a),this.max.set(r,o,s),this},setFromBufferAttribute:function(e){for(var t=+Infinity,n=+Infinity,a=+Infinity,r=-Infinity,o=-Infinity,s=-Infinity,d=0,i=e.count;dr&&(r=l),c>o&&(o=c),p>s&&(s=p)}return this.min.set(t,n,a),this.max.set(r,o,s),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z?!1:!0},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,t){var n=t||new Vector3;return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(e){return e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z?!1:!0},intersectsSphere:function(){var e=new Vector3;return function intersectsSphere(t){return this.clampPoint(t.center,e),e.distanceToSquared(t.center)<=t.radius*t.radius}}(),intersectsPlane:function(e){var t,n;return 0=e.constant},clampPoint:function(e,t){var n=t||new Vector3;return n.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new Vector3;return function distanceToPoint(t){var n=e.copy(t).clamp(this.min,this.max);return n.sub(t).length()}}(),getBoundingSphere:function(){var e=new Vector3;return function getBoundingSphere(t){var n=t||new Sphere;return this.getCenter(n.center),n.radius=0.5*this.getSize(e).length(),n}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(){var e=[new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3];return function applyMatrix4(t){return this.isEmpty()?this:(e[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),e[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),e[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),e[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),e[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),e[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),e[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),e[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(e),this)}}(),translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),Object.assign(Sphere.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(){var e=new Box3;return function setFromPoints(t,n){var a=this.center;void 0===n?e.setFromPoints(t).getCenter(a):a.copy(n);for(var r=0,o=0,i=t.length;o=this.radius},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return A(e.distanceToPoint(this.center))<=this.radius},clampPoint:function(e,t){var n=this.center.distanceToSquared(e),a=t||new Vector3;return a.copy(e),n>this.radius*this.radius&&(a.sub(this.center).normalize(),a.multiplyScalar(this.radius).add(this.center)),a},getBoundingBox:function(e){var t=e||new Box3;return t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius*=e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}}),Object.assign(Matrix3.prototype,{isMatrix3:!0,set:function(e,t,n,a,r,o,i,s,l){var d=this.elements;return d[0]=e,d[1]=a,d[2]=i,d[3]=t,d[4]=r,d[5]=s,d[6]=n,d[7]=o,d[8]=l,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(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this},setFromMatrix4:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},applyToBufferAttribute:function(){var e=new Vector3;return function applyToBufferAttribute(t){for(var n=0,a=t.count;na;a++)if(t[a]!==n[a])return!1;return!0},fromArray:function(e,t){t===void 0&&(t=0);for(var n=0;9>n;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}}),Object.assign(Plane.prototype,{set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,a){return this.normal.set(e,t,n),this.constant=a,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(){var e=new Vector3,t=new Vector3;return function setFromCoplanarPoints(n,a,r){var o=e.subVectors(r,a).cross(t.subVectors(n,a)).normalize();return this.setFromNormalAndCoplanarPoint(o,n),this}}(),clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){var n=t||new Vector3;return n.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(){var e=new Vector3;return function intersectLine(n,a){var r=a||new Vector3,o=n.delta(e),i=this.normal.dot(o);if(0===i)return 0===this.distanceToPoint(n.start)?r.copy(n.start):void 0;var s=-(n.start.dot(this.normal)+this.constant)/i;return 0>s||1t&&0n&&0n;n++)t[n].copy(e.planes[n]);return this},setFromMatrix:function(e){var t=this.planes,n=e.elements,a=n[0],r=n[1],o=n[2],i=n[3],s=n[4],l=n[5],d=n[6],c=n[7],p=n[8],u=n[9],m=n[10],g=n[11],h=n[12],f=n[13],E=n[14],_=n[15];return t[0].setComponents(i-a,c-s,g-p,_-h).normalize(),t[1].setComponents(i+a,c+s,g+p,_+h).normalize(),t[2].setComponents(i+r,c+l,g+u,_+f).normalize(),t[3].setComponents(i-r,c-l,g-u,_-f).normalize(),t[4].setComponents(i-o,c-d,g-m,_-E).normalize(),t[5].setComponents(i+o,c+d,g+m,_+E).normalize(),this},intersectsObject:function(){var e=new Sphere;return function intersectsObject(t){var n=t.geometry;return null===n.boundingSphere&&n.computeBoundingSphere(),e.copy(n.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(e)}}(),intersectsSprite:function(){var e=new Sphere;return function intersectsSprite(t){return e.center.set(0,0,0),e.radius=0.7071067811865476,e.applyMatrix4(t.matrixWorld),this.intersectsSphere(e)}}(),intersectsSphere:function(e){for(var t=this.planes,n=e.center,a=-e.radius,r=0,o;6>r;r++)if(o=t[r].distanceToPoint(n),or;r++){o=a[r],e.x=0i&&0>s)return!1}return!0}}(),containsPoint:function(e){for(var t=this.planes,n=0;6>n;n++)if(0>t[n].distanceToPoint(e))return!1;return!0}}),Euler.RotationOrders=['XYZ','YZX','ZXY','XZY','YXZ','ZYX'],Euler.DefaultOrder='XYZ',Object.defineProperties(Euler.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback()}},order:{get:function(){return this._order},set:function(e){this._order=e,this.onChangeCallback()}}}),Object.assign(Euler.prototype,{isEuler:!0,set:function(e,t,n,a){return this._x=e,this._y=t,this._z=n,this._order=a||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this.onChangeCallback(),this},setFromRotationMatrix:function(e,t,n){var a=Math.asin,r=kt.clamp,o=e.elements,s=o[0],l=o[4],d=o[8],c=o[1],p=o[5],u=o[9],m=o[2],g=o[6],h=o[10];return t=t||this._order,'XYZ'===t?(this._y=a(r(d,-1,1)),0.99999>A(d)?(this._x=i(-u,h),this._z=i(-l,s)):(this._x=i(g,p),this._z=0)):'YXZ'===t?(this._x=a(-r(u,-1,1)),0.99999>A(u)?(this._y=i(d,h),this._z=i(c,p)):(this._y=i(-m,s),this._z=0)):'ZXY'===t?(this._x=a(r(g,-1,1)),0.99999>A(g)?(this._y=i(-m,h),this._z=i(-l,p)):(this._y=0,this._z=i(c,s))):'ZYX'===t?(this._y=a(-r(m,-1,1)),0.99999>A(m)?(this._x=i(g,h),this._z=i(c,s)):(this._x=0,this._z=i(-l,p))):'YZX'===t?(this._z=a(r(c,-1,1)),0.99999>A(c)?(this._x=i(-u,p),this._y=i(-m,s)):(this._x=0,this._y=i(d,h))):'XZY'===t?(this._z=a(-r(l,-1,1)),0.99999>A(l)?(this._x=i(g,p),this._y=i(d,s)):(this._x=i(-u,h),this._y=0)):console.warn('THREE.Euler: .setFromRotationMatrix() given unsupported order: '+t),this._order=t,!1!==n&&this.onChangeCallback(),this},setFromQuaternion:function(){var e=new Matrix4;return function setFromQuaternion(t,n,a){return e.makeRotationFromQuaternion(t),this.setFromRotationMatrix(e,n,a)}}(),setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(){var e=new Quaternion;return function reorder(t){return e.setFromEuler(this),this.setFromQuaternion(e,t)}}(),equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new Vector3(this._x,this._y,this._z)},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),Object.assign(Layers.prototype,{set:function(e){this.mask=0|1<h;h++)if(p[h]===p[(h+1)%3]){g.push(d);break}}for(d=g.length-1;0<=d;d--){var n=g[d];for(this.faces.splice(n,1),u=0,m=this.faceVertexUvs.length;ua?n.copy(this.origin):n.copy(this.direction).multiplyScalar(a).add(this.origin)},distanceToPoint:function(e){return _(this.distanceSqToPoint(e))},distanceSqToPoint:function(){var e=new Vector3;return function distanceSqToPoint(t){var n=e.subVectors(t,this.origin).dot(this.direction);return 0>n?this.origin.distanceToSquared(t):(e.copy(this.direction).multiplyScalar(n).add(this.origin),e.distanceToSquared(t))}}(),distanceSqToSegment:function(){var e=new Vector3,t=new Vector3,n=new Vector3;return function distanceSqToSegment(a,r,o,i){e.copy(a).add(r).multiplyScalar(0.5),t.copy(r).sub(a).normalize(),n.copy(this.origin).sub(e);var s=0.5*a.distanceTo(r),l=-this.direction.dot(t),d=n.dot(this.direction),p=-n.dot(t),u=n.lengthSq(),c=A(1-l*l),m,g,h,E;if(!(0=-E))g=-s,m=y(0,-(l*g+d)),h=-m*m+g*(g+2*p)+u;else if(g<=E){var _=1/c;m*=_,g*=_,h=m*(m+l*g+2*d)+g*(l*m+g+2*p)+u}else g=s,m=y(0,-(l*g+d)),h=-m*m+g*(g+2*p)+u;return o&&o.copy(this.direction).multiplyScalar(m).add(this.origin),i&&i.copy(t).multiplyScalar(g).add(e),h}}(),intersectSphere:function(){var e=new Vector3;return function intersectSphere(t,n){e.subVectors(t.center,this.origin);var a=e.dot(this.direction),r=e.dot(e)-a*a,o=t.radius*t.radius;if(r>o)return null;var i=_(o-r),s=a-i,l=a+i;return 0>s&&0>l?null:0>s?this.at(l,n):this.at(s,n)}}(),intersectsSphere:function(e){return this.distanceToPoint(e.center)<=e.radius},distanceToPlane:function(e){var n=e.normal.dot(this.direction);if(0===n)return 0===e.distanceToPoint(this.origin)?0:null;var a=-(this.origin.dot(e.normal)+e.constant)/n;return 0<=a?a:null},intersectPlane:function(e,n){var a=this.distanceToPlane(e);return null===a?null:this.at(a,n)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);if(0===t)return!0;var n=e.normal.dot(this.direction);return!!(0>n*t)},intersectBox:function(e,t){var n=1/this.direction.x,a=1/this.direction.y,r=1/this.direction.z,o=this.origin,i,s,l,d,c,p;return(0<=n?(i=(e.min.x-o.x)*n,s=(e.max.x-o.x)*n):(i=(e.max.x-o.x)*n,s=(e.min.x-o.x)*n),0<=a?(l=(e.min.y-o.y)*a,d=(e.max.y-o.y)*a):(l=(e.max.y-o.y)*a,d=(e.min.y-o.y)*a),i>d||l>s)?null:((l>i||i!==i)&&(i=l),(dp||c>s)?null:((c>i||i!==i)&&(i=c),(ps?null:this.at(0<=i?i:s,t))},intersectsBox:function(){var e=new Vector3;return function intersectsBox(t){return null!==this.intersectBox(t,e)}}(),intersectTriangle:function(){var e=new Vector3,t=new Vector3,n=new Vector3,r=new Vector3;return function intersectTriangle(o,a,i,s,l){t.subVectors(a,o),n.subVectors(i,o),r.crossVectors(t,n);var d=this.direction.dot(r),c;if(0d)c=-1,d=-d;else return null;e.subVectors(this.origin,o);var p=c*this.direction.dot(n.crossVectors(e,n));if(0>p)return null;var u=c*this.direction.dot(t.cross(e));if(0>u)return null;if(p+u>d)return null;var m=-c*e.dot(r);return 0>m?null:this.at(m/d,l)}}(),applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}}),Object.assign(Line3.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){var t=e||new Vector3;return t.addVectors(this.start,this.end).multiplyScalar(0.5)},delta:function(e){var t=e||new Vector3;return t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){var n=t||new Vector3;return this.delta(n).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(){var e=new Vector3,n=new Vector3;return function closestPointToPointParameter(a,r){e.subVectors(a,this.start),n.subVectors(this.end,this.start);var o=n.dot(n),i=n.dot(e),s=i/o;return r&&(s=kt.clamp(s,0,1)),s}}(),closestPointToPoint:function(e,n,a){var r=this.closestPointToPointParameter(e,n),t=a||new Vector3;return this.delta(t).multiplyScalar(r).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),Object.assign(Triangle,{normal:function(){var e=new Vector3;return function normal(t,n,a,r){var o=r||new Vector3;o.subVectors(a,n),e.subVectors(t,n),o.cross(e);var i=o.lengthSq();return 0=o.x+o.y}}()}),Object.assign(Triangle.prototype,{set:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this},setFromPointsAndIndices:function(e,t,n,a){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[a]),this},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},area:function(){var e=new Vector3,t=new Vector3;return function area(){return e.subVectors(this.c,this.b),t.subVectors(this.a,this.b),0.5*e.cross(t).length()}}(),midpoint:function(e){var t=e||new Vector3;return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(e){return Triangle.normal(this.a,this.b,this.c,e)},plane:function(e){var t=e||new Plane;return t.setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(e,t){return Triangle.barycoordFromPoint(e,this.a,this.b,this.c,t)},containsPoint:function(e){return Triangle.containsPoint(e,this.a,this.b,this.c)},closestPointToPoint:function(){var e=new Plane,t=[new Line3,new Line3,new Line3],n=new Vector3,a=new Vector3;return function closestPointToPoint(r,o){var s=o||new Vector3,l=Infinity;if(e.setFromCoplanarPoints(this.a,this.b,this.c),e.projectPoint(r,n),!0===this.containsPoint(n))s.copy(n);else{t[0].set(this.a,this.b),t[1].set(this.b,this.c),t[2].set(this.c,this.a);for(var d=0;dn.far?null:{distance:d,point:g.clone(),object:e}}function checkBufferGeometryIntersection(e,n,r,l,d,g,a,h){o.fromBufferAttribute(l,g),i.fromBufferAttribute(l,a),s.fromBufferAttribute(l,h);var c=checkIntersection(e,e.material,n,r,o,i,s,m);return c&&(d&&(t.fromBufferAttribute(d,g),p.fromBufferAttribute(d,a),u.fromBufferAttribute(d,h),c.uv=uvIntersection(m,o,i,s,t,p,u)),c.face=new Face3(g,a,h,Triangle.normal(o,i,s)),c.faceIndex=g),c}var e=new Matrix4,n=new Ray,r=new Sphere,o=new Vector3,i=new Vector3,s=new Vector3,a=new Vector3,l=new Vector3,d=new Vector3,t=new Vector2,p=new Vector2,u=new Vector2,c=new Vector3,m=new Vector3,g=new Vector3;return function raycast(g,E){var _=this.geometry,C=this.material,y=this.matrixWorld;if(void 0!==C&&(null===_.boundingSphere&&_.computeBoundingSphere(),r.copy(_.boundingSphere),r.applyMatrix4(y),!1!==g.ray.intersectsSphere(r))&&(e.getInverse(y),n.copy(g.ray).applyMatrix4(e),null===_.boundingBox||!1!==n.intersectsBox(_.boundingBox))){var A;if(_.isBufferGeometry){var x=_.index,v=_.attributes.position,T=_.attributes.uv,S,R,b,c,F;if(null!==x)for(c=0,F=x.count;co)){var i=a.ray.origin.distanceTo(e);ia.far||r.push({distance:i,point:e.clone(),face:null,object:this})}}}(),clone:function(){return new this.constructor(this.material).copy(this)}}),LOD.prototype=Object.assign(Object.create(Object3D.prototype),{constructor:LOD,copy:function(e){Object3D.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,a=t.length,r;n=a[o].distance;o++)a[o-1].object.visible=!1,a[o].object.visible=!0;for(;od)){h.applyMatrix4(this.matrixWorld);var v=r.ray.origin.distanceTo(h);vr.far||o.push({distance:v,point:g.clone().applyMatrix4(this.matrixWorld),index:A,face:null,faceIndex:null,object:this})}}else for(var A=0,x=C.length/3-1;Ad)){h.applyMatrix4(this.matrixWorld);var v=r.ray.origin.distanceTo(h);vr.far||o.push({distance:v,point:g.clone().applyMatrix4(this.matrixWorld),index:A,face:null,faceIndex:null,object:this})}}}else if(c.isGeometry)for(var T=c.vertices,S=T.length,A=0,b;Ad)){h.applyMatrix4(this.matrixWorld);var v=r.ray.origin.distanceTo(h);vr.far||o.push({distance:v,point:g.clone().applyMatrix4(this.matrixWorld),index:A,face:null,faceIndex:null,object:this})}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),LineSegments.prototype=Object.assign(Object.create(Line.prototype),{constructor:LineSegments,isLineSegments:!0}),LineLoop.prototype=Object.assign(Object.create(Line.prototype),{constructor:LineLoop,isLineLoop:!0}),PointsMaterial.prototype=Object.create(Material.prototype),PointsMaterial.prototype.constructor=PointsMaterial,PointsMaterial.prototype.isPointsMaterial=!0,PointsMaterial.prototype.copy=function(e){return Material.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this},Points.prototype=Object.assign(Object.create(Object3D.prototype),{constructor:Points,isPoints:!0,raycast:function(){var e=new Matrix4,t=new Ray,n=new Sphere;return function raycast(r,o){function testPoint(e,n){var a=t.distanceSqToPoint(e);if(ar.far)return;o.push({distance:l,distanceToRay:_(a),point:i.clone(),index:n,face:null,object:s})}}var s=this,d=this.geometry,c=this.matrixWorld,p=r.params.Points.threshold;if(null===d.boundingSphere&&d.computeBoundingSphere(),n.copy(d.boundingSphere),n.applyMatrix4(c),n.radius+=p,!1!==r.ray.intersectsSphere(n)){e.getInverse(c),t.copy(r.ray).applyMatrix4(e);var u=p/((this.scale.x+this.scale.y+this.scale.z)/3),m=u*u,g=new Vector3;if(d.isBufferGeometry){var h=d.index,f=d.attributes,E=f.position.array;if(null!==h)for(var C=h.array,y=0,i=C.length,A;y=(d-s)*(u-l)-(c-l)*(p-s))return!1;var f,E,_,C,y,A,b,x,v,T,S,R,F,w,M;for(f=p-d,E=u-c,_=s-p,C=l-u,y=d-s,A=c-l,i=0;i=-g&&w>=-g&&F>=-g))return!1;return!0}return function triangulate(e,r){var o=e.length;if(3>o)return null;var n=[],i=[],l=[],d,p,u;if(0=g--)return console.warn('THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()'),r?l:n;if(d=p,m<=d&&(d=0),p=d+1,m<=p&&(p=0),u=p+1,m<=u&&(u=0),snip(e,d,p,u,m,i)){var h,a,f,c,s;for(h=i[d],a=i[p],f=i[u],n.push([e[h],e[a],e[f]]),l.push([i[d],i[p],i[u]]),(c=p,s=p+1);sg){var m;if(0u||u>p)return[];if(m=l*d-s*c,0>m||m>p)return[]}else{if(0S?[]:y===S?r?[]:[_]:b<=S?[_,C]:[_,v]}function isPointInsideAngle(e,t,n,a){var r=t.x-e.x,o=t.y-e.y,i=n.x-e.x,s=n.y-e.y,l=a.x-e.x,d=a.y-e.y,c=r*s-o*i,p=r*d-o*l;if(A(c)>g){var u=l*s-d*i;return 0r&&(r=a);var o=e+1;o>a&&(o=0);var i=isPointInsideAngle(n[e],n[r],n[o],s[t]);if(!i)return!1;var l=s.length-1,d=t-1;0>d&&(d=l);var c=t+1;return c>l&&(c=0),i=isPointInsideAngle(s[t],s[d],s[c],n[e]),!!i}function intersectsShapeEdge(e,t){var a,r,o;for(a=0;aC){console.log('THREE.ShapeUtils: Infinite Loop! Holes left:" + indepHoles.length + ", Probably Hole outside Shape!');break}for(d=_;dl;l++)c=d[l].x+':'+d[l].y,p=n[c],void 0!==p&&(d[l]=p);return m.concat()},isClockWise:function(e){return 0>rn.area(e)}};ExtrudeGeometry.prototype=Object.create(Geometry.prototype),ExtrudeGeometry.prototype.constructor=ExtrudeGeometry,ExtrudeBufferGeometry.prototype=Object.create(BufferGeometry.prototype),ExtrudeBufferGeometry.prototype.constructor=ExtrudeBufferGeometry,ExtrudeBufferGeometry.prototype.getArrays=function(){var e=this.getAttribute('position'),t=e?Array.prototype.slice.call(e.array):[],n=this.getAttribute('uv'),a=n?Array.prototype.slice.call(n.array):[],r=this.index,o=r?Array.prototype.slice.call(r.array):[];return{position:t,uv:a,index:o}},ExtrudeBufferGeometry.prototype.addShapeList=function(e,t){var n=e.length;t.arrays=this.getArrays();for(var a=0,r;ag){var u=_(s),m=_(o*o+i*i),h=t.x-r/u,f=t.y+a/u,E=n.x-i/m,C=n.y+o/m,y=((E-h)*i-(C-f)*o)/(a*i-r*o);l=h+a*y-e.x,d=f+r*y-e.y;var b=l*l+d*d;if(2>=b)return new Vector2(l,d);c=_(b/2)}else{var x=!1;a>g?o>g&&(x=!0):a<-g?o<-g&&(x=!0):p(r)===p(i)&&(x=!0),x?(l=-r,d=a,c=_(s)):(l=a,d=r,c=_(s/2))}return new Vector2(l/c,d/c)}function sidewalls(e,t){var n,r;for(q=e.length;0<=--q;){n=q,r=q-1,0>r&&(r=e.length-1);var o=0,i=T+2*C;for(o=0;oA(s-c)?[new Vector2(i,1-l),new Vector2(d,1-p),new Vector2(u,1-g),new Vector2(h,1-E)]:[new Vector2(s,1-l),new Vector2(c,1-p),new Vector2(m,1-g),new Vector2(f,1-E)]}},TextGeometry.prototype=Object.create(Geometry.prototype),TextGeometry.prototype.constructor=TextGeometry,TextBufferGeometry.prototype=Object.create(ExtrudeBufferGeometry.prototype),TextBufferGeometry.prototype.constructor=TextBufferGeometry,SphereGeometry.prototype=Object.create(Geometry.prototype),SphereGeometry.prototype.constructor=SphereGeometry,SphereBufferGeometry.prototype=Object.create(BufferGeometry.prototype),SphereBufferGeometry.prototype.constructor=SphereBufferGeometry,RingGeometry.prototype=Object.create(Geometry.prototype),RingGeometry.prototype.constructor=RingGeometry,RingBufferGeometry.prototype=Object.create(BufferGeometry.prototype),RingBufferGeometry.prototype.constructor=RingBufferGeometry,LatheGeometry.prototype=Object.create(Geometry.prototype),LatheGeometry.prototype.constructor=LatheGeometry,LatheBufferGeometry.prototype=Object.create(BufferGeometry.prototype),LatheBufferGeometry.prototype.constructor=LatheBufferGeometry,ShapeGeometry.prototype=Object.create(Geometry.prototype),ShapeGeometry.prototype.constructor=ShapeGeometry,ShapeBufferGeometry.prototype=Object.create(BufferGeometry.prototype),ShapeBufferGeometry.prototype.constructor=ShapeBufferGeometry,EdgesGeometry.prototype=Object.create(BufferGeometry.prototype),EdgesGeometry.prototype.constructor=EdgesGeometry,CylinderGeometry.prototype=Object.create(Geometry.prototype),CylinderGeometry.prototype.constructor=CylinderGeometry,CylinderBufferGeometry.prototype=Object.create(BufferGeometry.prototype),CylinderBufferGeometry.prototype.constructor=CylinderBufferGeometry,ConeGeometry.prototype=Object.create(CylinderGeometry.prototype),ConeGeometry.prototype.constructor=ConeGeometry,ConeBufferGeometry.prototype=Object.create(CylinderBufferGeometry.prototype),ConeBufferGeometry.prototype.constructor=ConeBufferGeometry,CircleGeometry.prototype=Object.create(Geometry.prototype),CircleGeometry.prototype.constructor=CircleGeometry,CircleBufferGeometry.prototype=Object.create(BufferGeometry.prototype),CircleBufferGeometry.prototype.constructor=CircleBufferGeometry;var on=Object.freeze({WireframeGeometry:WireframeGeometry,ParametricGeometry:ParametricGeometry,ParametricBufferGeometry:ParametricBufferGeometry,TetrahedronGeometry:TetrahedronGeometry,TetrahedronBufferGeometry:TetrahedronBufferGeometry,OctahedronGeometry:OctahedronGeometry,OctahedronBufferGeometry:OctahedronBufferGeometry,IcosahedronGeometry:IcosahedronGeometry,IcosahedronBufferGeometry:IcosahedronBufferGeometry,DodecahedronGeometry:DodecahedronGeometry,DodecahedronBufferGeometry:DodecahedronBufferGeometry,PolyhedronGeometry:PolyhedronGeometry,PolyhedronBufferGeometry:PolyhedronBufferGeometry,TubeGeometry:TubeGeometry,TubeBufferGeometry:TubeBufferGeometry,TorusKnotGeometry:TorusKnotGeometry,TorusKnotBufferGeometry:TorusKnotBufferGeometry,TorusGeometry:TorusGeometry,TorusBufferGeometry:TorusBufferGeometry,TextGeometry:TextGeometry,TextBufferGeometry:TextBufferGeometry,SphereGeometry:SphereGeometry,SphereBufferGeometry:SphereBufferGeometry,RingGeometry:RingGeometry,RingBufferGeometry:RingBufferGeometry,PlaneGeometry:PlaneGeometry,PlaneBufferGeometry:PlaneBufferGeometry,LatheGeometry:LatheGeometry,LatheBufferGeometry:LatheBufferGeometry,ShapeGeometry:ShapeGeometry,ShapeBufferGeometry:ShapeBufferGeometry,ExtrudeGeometry:ExtrudeGeometry,ExtrudeBufferGeometry:ExtrudeBufferGeometry,EdgesGeometry:EdgesGeometry,ConeGeometry:ConeGeometry,ConeBufferGeometry:ConeBufferGeometry,CylinderGeometry:CylinderGeometry,CylinderBufferGeometry:CylinderBufferGeometry,CircleGeometry:CircleGeometry,CircleBufferGeometry:CircleBufferGeometry,BoxGeometry:BoxGeometry,BoxBufferGeometry:BoxBufferGeometry});ShadowMaterial.prototype=Object.create(Material.prototype),ShadowMaterial.prototype.constructor=ShadowMaterial,ShadowMaterial.prototype.isShadowMaterial=!0,RawShaderMaterial.prototype=Object.create(ShaderMaterial.prototype),RawShaderMaterial.prototype.constructor=RawShaderMaterial,RawShaderMaterial.prototype.isRawShaderMaterial=!0,MeshStandardMaterial.prototype=Object.create(Material.prototype),MeshStandardMaterial.prototype.constructor=MeshStandardMaterial,MeshStandardMaterial.prototype.isMeshStandardMaterial=!0,MeshStandardMaterial.prototype.copy=function(e){return Material.prototype.copy.call(this,e),this.defines={STANDARD:''},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},MeshPhysicalMaterial.prototype=Object.create(MeshStandardMaterial.prototype),MeshPhysicalMaterial.prototype.constructor=MeshPhysicalMaterial,MeshPhysicalMaterial.prototype.isMeshPhysicalMaterial=!0,MeshPhysicalMaterial.prototype.copy=function(e){return MeshStandardMaterial.prototype.copy.call(this,e),this.defines={PHYSICAL:''},this.reflectivity=e.reflectivity,this.clearCoat=e.clearCoat,this.clearCoatRoughness=e.clearCoatRoughness,this},MeshPhongMaterial.prototype=Object.create(Material.prototype),MeshPhongMaterial.prototype.constructor=MeshPhongMaterial,MeshPhongMaterial.prototype.isMeshPhongMaterial=!0,MeshPhongMaterial.prototype.copy=function(e){return Material.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},MeshToonMaterial.prototype=Object.create(MeshPhongMaterial.prototype),MeshToonMaterial.prototype.constructor=MeshToonMaterial,MeshToonMaterial.prototype.isMeshToonMaterial=!0,MeshToonMaterial.prototype.copy=function(e){return MeshPhongMaterial.prototype.copy.call(this,e),this.gradientMap=e.gradientMap,this},MeshNormalMaterial.prototype=Object.create(Material.prototype),MeshNormalMaterial.prototype.constructor=MeshNormalMaterial,MeshNormalMaterial.prototype.isMeshNormalMaterial=!0,MeshNormalMaterial.prototype.copy=function(e){return Material.prototype.copy.call(this,e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},MeshLambertMaterial.prototype=Object.create(Material.prototype),MeshLambertMaterial.prototype.constructor=MeshLambertMaterial,MeshLambertMaterial.prototype.isMeshLambertMaterial=!0,MeshLambertMaterial.prototype.copy=function(e){return Material.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},LineDashedMaterial.prototype=Object.create(LineBasicMaterial.prototype),LineDashedMaterial.prototype.constructor=LineDashedMaterial,LineDashedMaterial.prototype.isLineDashedMaterial=!0,LineDashedMaterial.prototype.copy=function(e){return LineBasicMaterial.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var sn=Object.freeze({ShadowMaterial:ShadowMaterial,SpriteMaterial:SpriteMaterial,RawShaderMaterial:RawShaderMaterial,ShaderMaterial:ShaderMaterial,PointsMaterial:PointsMaterial,MeshPhysicalMaterial:MeshPhysicalMaterial,MeshStandardMaterial:MeshStandardMaterial,MeshPhongMaterial:MeshPhongMaterial,MeshToonMaterial:MeshToonMaterial,MeshNormalMaterial:MeshNormalMaterial,MeshLambertMaterial:MeshLambertMaterial,MeshDepthMaterial:MeshDepthMaterial,MeshDistanceMaterial:MeshDistanceMaterial,MeshBasicMaterial:MeshBasicMaterial,LineDashedMaterial:LineDashedMaterial,LineBasicMaterial:LineBasicMaterial,Material:Material}),ln={enabled:!1,files:{},add:function(e,t){!1===this.enabled||(this.files[e]=t)},get:function(e){return!1===this.enabled?void 0:this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},dn=new LoadingManager;Object.assign(FileLoader.prototype,{load:function(e,t,n,a){void 0===e&&(e=''),void 0!==this.path&&(e=this.path+e);var r=this,o=ln.get(e);if(void 0!==o)return r.manager.itemStart(e),setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o;var s=/^data:(.*?)(;base64)?,(.*)$/,l=e.match(s);if(l){var d=l[1],c=!!l[2],p=l[3];p=window.decodeURIComponent(p),c&&(p=window.atob(p));try{var u=(this.responseType||'').toLowerCase(),m;switch(u){case'arraybuffer':case'blob':m=new ArrayBuffer(p.length);for(var g=new Uint8Array(m),h=0;h=r)){var s=t[1];e=r)break seek}o=n,n=0;break linear_scan}break validate_interval}for(;n>>1;et;)--o;if(++o,0!=r||o!==a){r>=o&&(o=y(o,1),r=o-1);var i=this.getValueSize();this.times=cn.arraySlice(n,r,o),this.values=cn.arraySlice(this.values,r*i,o*i)}return this},validate:function(){var e=!0,t=this.getValueSize();0!=t-h(t)&&(console.error('THREE.KeyframeTrackPrototype: Invalid value size in track.',this),e=!1);var a=this.times,r=this.values,o=a.length;0===o&&(console.error('THREE.KeyframeTrackPrototype: Track is empty.',this),e=!1);for(var s=null,l=0,i;l!==o;l++){if(i=a[l],'number'==typeof i&&isNaN(i)){console.error('THREE.KeyframeTrackPrototype: Time is not a valid number.',this,l,i),e=!1;break}if(null!=s&&s>i){console.error('THREE.KeyframeTrackPrototype: Out of order keys.',this,l,i,s),e=!1;break}s=i}if(r!==void 0&&cn.isTypedArray(r))for(var l=0,d=r.length,n;l!==d;++l)if(n=r[l],isNaN(n)){console.error('THREE.KeyframeTrackPrototype: Value is not a valid number.',this,l,n),e=!1;break}return e},optimize:function(){for(var e=this.times,t=this.values,n=this.getValueSize(),a=this.getInterpolation()===xt,r=1,o=e.length-1,s=1;sl.opacity&&(l.transparent=!0),a.setTextures(s),a.parse(l)}}()}),Object.assign(JSONLoader.prototype,{load:function(e,t,n,a){var r=this,o=this.texturePath&&'string'==typeof this.texturePath?this.texturePath:Loader.prototype.extractUrlBase(e),i=new FileLoader(this.manager);i.setWithCredentials(this.withCredentials),i.load(e,function(n){var a=JSON.parse(n),i=a.metadata;if(i!==void 0){var s=i.type;if(s!==void 0){if('object'===s.toLowerCase())return void console.error('THREE.JSONLoader: '+e+' should be loaded with THREE.ObjectLoader instead.');if('scene'===s.toLowerCase())return void console.error('THREE.JSONLoader: '+e+' should be loaded with THREE.SceneLoader instead.')}}var l=r.parse(a,o);t(l.geometry,l.materials)},n,a)},setTexturePath:function(e){this.texturePath=e},parse:function(){function parseModel(e,t){function isBitSet(e,t){return e&1<i;i++)f=n[p++],N=D[2*f],u=D[2*f+1],I=new Vector2(N,u),2!==i&&t.faceVertexUvs[d][c].push(I),0!==i&&t.faceVertexUvs[d][c+1].push(I);if(b&&(h=3*n[p++],w.normal.set(r[h++],r[h++],r[h]),M.normal.copy(w.normal)),x)for(d=0;4>d;d++)h=3*n[p++],B=new Vector3(r[h++],r[h++],r[h]),2!==d&&w.vertexNormals.push(B),0!==d&&M.vertexNormals.push(B);if(T&&(g=n[p++],L=o[g],w.color.setHex(L),M.color.setHex(L)),S)for(d=0;4>d;d++)g=n[p++],L=o[g],2!==d&&w.vertexColors.push(new Color(L)),0!==d&&M.vertexColors.push(new Color(L));t.faces.push(w),t.faces.push(M)}else{if(F=new Face3,F.a=n[p++],F.b=n[p++],F.c=n[p++],y&&(E=n[p++],F.materialIndex=E),c=t.faces.length,A)for(d=0;di;i++)f=n[p++],N=D[2*f],u=D[2*f+1],I=new Vector2(N,u),t.faceVertexUvs[d][c].push(I);if(b&&(h=3*n[p++],F.normal.set(r[h++],r[h++],r[h])),x)for(d=0;3>d;d++)h=3*n[p++],B=new Vector3(r[h++],r[h++],r[h]),F.vertexNormals.push(B);if(T&&(g=n[p++],F.color.setHex(o[g])),S)for(d=0;3>d;d++)g=n[p++],F.vertexColors.push(new Color(o[g]));t.faces.push(F)}}function parseSkin(e,t){var n=e.influencesPerVertex===void 0?2:e.influencesPerVertex;if(e.skinWeights)for(var r=0,o=e.skinWeights.length;rd)s=r+1;else if(0n&&(n=0),1g&&(l.normalize(),p=r(kt.clamp(a[c-1].dot(a[c]),-1,1)),o[c].applyMatrix4(d.makeRotationAxis(l,p))),s[c].crossVectors(a[c],o[c]);if(!0===t)for(p=r(kt.clamp(o[0].dot(o[e]),-1,1)),p/=e,0=t){var r=n[a]-t,o=this.curves[a],i=o.getLength(),s=0===i?0:1-r/i;return o.getPointAt(s)}a++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,n=0,a=this.curves.length;nn;)n+=t;for(;n>t;)n-=t;nt.length-2?t.length-1:a+1],l=t[a>t.length-3?t.length-1:a+2];return new Vector2(CatmullRom(r,o.x,i.x,s.x,l.x),CatmullRom(r,o.y,i.y,s.y,l.y))},CubicBezierCurve.prototype=Object.create(Curve.prototype),CubicBezierCurve.prototype.constructor=CubicBezierCurve,CubicBezierCurve.prototype.getPoint=function(e){var t=this.v0,n=this.v1,a=this.v2,r=this.v3;return new Vector2(CubicBezier(e,t.x,n.x,a.x,r.x),CubicBezier(e,t.y,n.y,a.y,r.y))},QuadraticBezierCurve.prototype=Object.create(Curve.prototype),QuadraticBezierCurve.prototype.constructor=QuadraticBezierCurve,QuadraticBezierCurve.prototype.getPoint=function(e){var t=this.v0,n=this.v1,a=this.v2;return new Vector2(QuadraticBezier(e,t.x,n.x,a.x),QuadraticBezier(e,t.y,n.y,a.y))};var fn=Object.assign(Object.create(CurvePath.prototype),{fromPoints:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,n=e.length;tg){if(0>d&&(i=t[o],l=-l,s=t[r],d=-d),e.ys.y)continue;if(e.y!==i.y){var c=d*(e.x-i.x)-l*(e.y-i.y);if(0==c)return!0;if(0>c)continue;a=!a}else if(e.x===i.x)return!0}else{if(e.y!==i.y)continue;if(s.x<=e.x&&e.x<=i.x||i.x<=e.x&&e.x<=s.x)return!0}}return a}var n=rn.isClockWise,a=this.subPaths;if(0===a.length)return[];if(!0===t)return toShapesNoHoles(a);var r=[],o,s,d;if(1===a.length)return s=a[0],d=new Shape,d.curves=s.curves,r.push(d),r;var c=!n(a[0].getPoints());c=e?!c:c;var p=[],u=[],m=[],h=0,f;u[h]=void 0,m[h]=[];for(var E=0,i=a.length;Er){this._mixBufferRegion(n,a,3*t,1-r,t)}for(var s=t;s!==t+t;++s)if(n[s]!==n[s+t]){o.setValue(n,a);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,n=this.valueSize,a=3*n;e.getValue(t,a);for(var r=n;r!==a;++r)t[r]=t[a+r%n];this.cumulativeWeight=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_select:function(e,n,a,r,t){if(0.5<=r)for(var o=0;o!==t;++o)e[n+o]=e[a+o]},_slerp:function(e,n,a,r){Quaternion.slerpFlat(e,n,e,n,e,a,r)},_lerp:function(e,n,a,r,t){for(var o=0,i;o!==t;++o)i=n+o,e[i]=e[i]*(1-r)+e[a+o]*r}}),Object.assign(Composite.prototype,{getValue:function(e,t){this.bind();var n=this._targetGroup.nCachedObjects_,a=this._bindings[n];a!==void 0&&a.getValue(e,t)},setValue:function(e,t){for(var a=this._bindings,r=this._targetGroup.nCachedObjects_,o=a.length;r!==o;++r)a[r].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,a=e.length;t!==a;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,a=e.length;t!==a;++t)e[t].unbind()}}),Object.assign(PropertyBinding,{Composite:Composite,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new PropertyBinding.Composite(e,t,n):new PropertyBinding(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\s/g,'_').replace(/[^\w-]/g,'')},parseTrackName:function(){var e=/((?:[\w-]+[\/:])*)/,t=/([\w-\.]+)?/,n=/(?:\.([\w-]+)(?:\[(.+)\])?)?/,a=/\.([\w-]+)(?:\[(.+)\])?/,r=new RegExp('^'+e.source+t.source+n.source+a.source+'$'),o=['material','materials','bones'];return function(e){var t=r.exec(e);if(!t)throw new Error('PropertyBinding: Cannot parse trackName: '+e);var n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},a=n.nodeName&&n.nodeName.lastIndexOf('.');if(a!==void 0&&-1!==a){var i=n.nodeName.substring(a+1);-1!==o.indexOf(i)&&(n.nodeName=n.nodeName.substring(0,a),n.objectName=i)}if(null===n.propertyName||0===n.propertyName.length)throw new Error('PropertyBinding: can not parse propertyName from trackName: '+e);return n}}(),findNode:function(e,t){if(!t||''===t||'root'===t||'.'===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var n=function(e){for(var n=0,a;n=t){var c=t++,p=e[c];a[p.uuid]=d,e[d]=p,a[l]=c,e[c]=n;for(var u=0;u!==o;++u){var m=r[u],g=m[c],h=m[d];m[d]=g,m[c]=h}}}this.nCachedObjects_=t},uncache:function(){for(var e=this._objects,t=e.length,a=this.nCachedObjects_,r=this._indicesByUUID,o=this._bindings,s=o.length,l=0,i=arguments.length;l!==i;++l){var n=arguments[l],d=n.uuid,c=r[d];if(void 0!==c)if(delete r[d],co||0===n)return;this._startTime=null,t=n*o}t*=this._updateTimeScale(e);var i=this._updateTime(t),s=this._updateWeight(e);if(0n.parameterPositions[1]&&(this.stopFading(),0===a&&(this.enabled=!1))}}return this._effectiveWeight=t,t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n){var a=n.evaluate(e)[0];t*=a,e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t},_updateTime:function(e){var t=this.time+e;if(0===e)return t;var n=this._clip.duration,a=this.loop,r=this._loopCount;if(a===_t){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));handle_stop:{if(t>=n)t=n;else if(0>t)t=0;else break handle_stop;this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:'finished',action:this,direction:0>e?-1:1})}}else{var o=a===yt;if(-1===r&&(0<=e?(r=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),t>=n||0>t){var i=h(t/n);t-=n*i,r+=A(i);var s=this.repetitions-r;if(0>s)this.clampWhenFinished?this.paused=!0:this.enabled=!1,t=0e;this._setEndings(l,!l,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this._mixer.dispatchEvent({type:'loop',action:this,loopDelta:i})}}if(o&&1==(1&r))return this.time=t,n-t}return this.time=t,t},_setEndings:function(e,t,n){var a=this._interpolantSettings;n?(a.endingStart=Tt,a.endingEnd=Tt):(a.endingStart=e?this.zeroSlopeAtStart?Tt:vt:St,a.endingEnd=t?this.zeroSlopeAtEnd?Tt:vt:St)},_scheduleFading:function(e,t,n){var a=this._mixer,r=a.time,o=this._weightInterpolant;null===o&&(o=a._lendControlInterpolant(),this._weightInterpolant=o);var i=o.parameterPositions,s=o.sampleValues;return i[0]=r,s[0]=t,i[1]=r+e,s[1]=n,this}}),Object.assign(AnimationMixer.prototype,EventDispatcher.prototype,{_bindAction:function(e,t){var n=e._localRoot||this._root,a=e._clip.tracks,r=a.length,o=e._propertyBindings,s=e._interpolants,l=n.uuid,d=this._bindingsByRootAndName,c=d[l];c===void 0&&(c={},d[l]=c);for(var p=0;p!==r;++p){var i=a[p],u=i.name,m=c[u];if(void 0!==m)o[p]=m;else{if(m=o[p],void 0!==m){null===m._cacheIndex&&(++m.referenceCount,this._addInactiveBinding(m,l,u));continue}var g=t&&t._propertyBindings[p].binding.parsedPath;m=new PropertyMixer(PropertyBinding.create(n,u,g),i.ValueTypeName,i.getValueSize()),++m.referenceCount,this._addInactiveBinding(m,l,u),o[p]=m}s[p].resultBuffer=m.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,a=e._clip.uuid,r=this._actionsByClip[a];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,a,t)}for(var o=e._propertyBindings,s=0,i=o.length,n;s!==i;++s)n=o[s],0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState());this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,a=0,r=t.length,n;a!==r;++a)n=t[a],0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n));this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&tA(e)&&(e=1e-8),this.scale.set(0.5*this.size,0.5*this.size,e),this.lookAt(this.plane.normal),this.updateMatrixWorld()};var Cn,yn;ArrowHelper.prototype=Object.create(Object3D.prototype),ArrowHelper.prototype.constructor=ArrowHelper,ArrowHelper.prototype.setDirection=function(){var e=new Vector3,t;return function setDirection(n){0.99999n.y?this.quaternion.set(1,0,0,0):(e.set(n.z,0,-n.x).normalize(),t=r(n.y),this.quaternion.setFromAxisAngle(e,t))}}(),ArrowHelper.prototype.setLength=function(e,t,n){t===void 0&&(t=0.2*e),n===void 0&&(n=0.2*t),this.line.scale.set(1,y(0,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()},ArrowHelper.prototype.setColor=function(e){this.line.material.color.copy(e),this.cone.material.color.copy(e)},AxisHelper.prototype=Object.create(LineSegments.prototype),AxisHelper.prototype.constructor=AxisHelper;var An=new Vector3,bn=new CubicPoly,xn=new CubicPoly,vn=new CubicPoly;CatmullRomCurve3.prototype=Object.create(Curve.prototype),CatmullRomCurve3.prototype.constructor=CatmullRomCurve3,CatmullRomCurve3.prototype.getPoint=function(e){var t=this.points,n=t.length,a=(n-(this.closed?0:1))*e,r=h(a),o=a-r;this.closed?r+=0m&&(m=1),1e-4>u&&(u=m),1e-4>g&&(g=m),bn.initNonuniformCatmullRom(i.x,l.x,d.x,c.x,u,m,g),xn.initNonuniformCatmullRom(i.y,l.y,d.y,c.y,u,m,g),vn.initNonuniformCatmullRom(i.z,l.z,d.z,c.z,u,m,g)}else if('catmullrom'===this.type){var f=void 0===this.tension?0.5:this.tension;bn.initCatmullRom(i.x,l.x,d.x,c.x,f),xn.initCatmullRom(i.y,l.y,d.y,c.y,f),vn.initCatmullRom(i.z,l.z,d.z,c.z,f)}return new Vector3(bn.calc(o),xn.calc(o),vn.calc(o))},CubicBezierCurve3.prototype=Object.create(Curve.prototype),CubicBezierCurve3.prototype.constructor=CubicBezierCurve3,CubicBezierCurve3.prototype.getPoint=function(e){var t=this.v0,n=this.v1,a=this.v2,r=this.v3;return new Vector3(CubicBezier(e,t.x,n.x,a.x,r.x),CubicBezier(e,t.y,n.y,a.y,r.y),CubicBezier(e,t.z,n.z,a.z,r.z))},QuadraticBezierCurve3.prototype=Object.create(Curve.prototype),QuadraticBezierCurve3.prototype.constructor=QuadraticBezierCurve3,QuadraticBezierCurve3.prototype.getPoint=function(e){var t=this.v0,n=this.v1,a=this.v2;return new Vector3(QuadraticBezier(e,t.x,n.x,a.x),QuadraticBezier(e,t.y,n.y,a.y),QuadraticBezier(e,t.z,n.z,a.z))},LineCurve3.prototype=Object.create(Curve.prototype),LineCurve3.prototype.constructor=LineCurve3,LineCurve3.prototype.getPoint=function(e){if(1===e)return this.v2.clone();var t=new Vector3;return t.subVectors(this.v2,this.v1),t.multiplyScalar(e),t.add(this.v1),t},ArcCurve.prototype=Object.create(EllipseCurve.prototype),ArcCurve.prototype.constructor=ArcCurve;var Tn={createMultiMaterialObject:function(e,t){for(var n=new Group,a=0,r=t.length;at[5]&&t[0]>t[10]?(a=2*l(1+t[0]-t[5]-t[10]),e[3]=(t[6]-t[9])/a,e[0]=0.25*a,e[1]=(t[1]+t[4])/a,e[2]=(t[8]+t[2])/a):t[5]>t[10]?(a=2*l(1+t[5]-t[0]-t[10]),e[3]=(t[8]-t[2])/a,e[0]=(t[1]+t[4])/a,e[1]=0.25*a,e[2]=(t[6]+t[9])/a):(a=2*l(1+t[10]-t[0]-t[5]),e[3]=(t[1]-t[4])/a,e[0]=(t[8]+t[2])/a,e[1]=(t[6]+t[9])/a,e[2]=0.25*a),e},t.fromRotationTranslationScale=function fromRotationTranslationScale(e,t,n,a){var r=t[0],o=t[1],i=t[2],s=t[3],l=r+r,d=o+o,c=i+i,p=r*l,u=r*d,m=r*c,g=o*d,h=o*c,f=i*c,E=s*l,_=s*d,C=s*c,y=a[0],A=a[1],b=a[2];return e[0]=(1-(g+f))*y,e[1]=(u+C)*y,e[2]=(m-_)*y,e[3]=0,e[4]=(u-C)*A,e[5]=(1-(p+f))*A,e[6]=(h+E)*A,e[7]=0,e[8]=(m+_)*b,e[9]=(h-E)*b,e[10]=(1-(p+g))*b,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e},t.fromRotationTranslationScaleOrigin=function fromRotationTranslationScaleOrigin(e,t,n,a,r){var o=t[0],i=t[1],s=t[2],l=t[3],d=o+o,c=i+i,p=s+s,u=o*d,m=o*c,g=o*p,h=i*c,f=i*p,E=s*p,_=l*d,C=l*c,y=l*p,A=a[0],b=a[1],x=a[2],v=r[0],T=r[1],S=r[2],R=(1-(h+E))*A,F=(m+y)*A,w=(g-C)*A,M=(m-y)*b,L=(1-(u+E))*b,B=(f+_)*b,D=(g+C)*x,I=(f-_)*x,N=(1-(u+h))*x;return e[0]=R,e[1]=F,e[2]=w,e[3]=0,e[4]=M,e[5]=L,e[6]=B,e[7]=0,e[8]=D,e[9]=I,e[10]=N,e[11]=0,e[12]=n[0]+v-(R*v+M*T+D*S),e[13]=n[1]+T-(F*v+L*T+I*S),e[14]=n[2]+S-(w*v+B*T+N*S),e[15]=1,e},t.fromQuat=function fromQuat(e,t){var n=t[0],a=t[1],r=t[2],o=t[3],i=n+n,s=a+a,l=r+r,d=n*i,c=a*i,p=a*s,u=r*i,m=r*s,g=r*l,h=o*i,f=o*s,E=o*l;return e[0]=1-p-g,e[1]=c+E,e[2]=u-f,e[3]=0,e[4]=c-E,e[5]=1-d-g,e[6]=m+h,e[7]=0,e[8]=u+f,e[9]=m-h,e[10]=1-d-p,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},t.frustum=function frustum(e,t,n,a,r,o,i){var s=1/(n-t),l=1/(r-a),d=1/(o-i);return e[0]=2*o*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*o*l,e[6]=0,e[7]=0,e[8]=(n+t)*s,e[9]=(r+a)*l,e[10]=(i+o)*d,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*(i*o)*d,e[15]=0,e},t.perspective=function perspective(e,t,n,r,o){var i=1/a(t/2),s;return e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=o&&o!==Infinity?(s=1/(r-o),e[10]=(o+r)*s,e[14]=2*o*r*s):(e[10]=-1,e[14]=-2*r),e},t.perspectiveFromFieldOfView=function perspectiveFromFieldOfView(e,t,n,r){var o=a(t.upDegrees*c/180),i=a(t.downDegrees*c/180),s=a(t.leftDegrees*c/180),l=a(t.rightDegrees*c/180),d=2/(s+l),p=2/(o+i);return e[0]=d,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=p,e[6]=0,e[7]=0,e[8]=-(0.5*((s-l)*d)),e[9]=0.5*((o-i)*p),e[10]=r/(n-r),e[11]=-1,e[12]=0,e[13]=0,e[14]=r*n/(n-r),e[15]=0,e},t.ortho=function ortho(e,t,n,a,r,o,i){var s=1/(t-n),l=1/(a-r),d=1/(o-i);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*d,e[11]=0,e[12]=(t+n)*s,e[13]=(r+a)*l,e[14]=(i+o)*d,e[15]=1,e},t.lookAt=function lookAt(e,t,n,a){var r=void 0,o=void 0,i=void 0,s=void 0,c=void 0,u=void 0,m=void 0,g=void 0,h=void 0,f=void 0,E=t[0],_=t[1],C=t[2],y=a[0],A=a[1],b=a[2],x=n[0],v=n[1],T=n[2];return d(E-x)f&&(f=-f,p=-p,u=-u,m=-m,g=-g),1-f>l.b?(h=r(f),E=o(h),_=o((1-i)*h)/E,C=o(i*h)/E):(_=1-i,C=i),e[0]=_*t+C*p,e[1]=_*s+C*u,e[2]=_*d+C*m,e[3]=_*c+C*g,e}function fromMat3(e,t){var n=t[0]+t[4]+t[8],a=void 0;if(0t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);var o=(r+1)%3,i=(r+2)%3;a=s(t[3*r+r]-t[3*o+o]-t[3*i+i]+1),e[r]=0.5*a,a=0.5/a,e[3]=(t[3*o+i]-t[3*i+o])*a,e[o]=(t[3*o+r]+t[3*r+o])*a,e[i]=(t[3*i+r]+t[3*r+i])*a}return e}var r=Math.acos,o=Math.sin,i=Math.cos,s=Math.sqrt,a=Math.PI;Object.defineProperty(t,'__esModule',{value:!0}),t.create=create,t.identity=function identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},t.setAxisAngle=setAxisAngle,t.getAxisAngle=function getAxisAngle(e,t){var n=2*r(t[3]),a=o(n/2);return a>l.b?(e[0]=t[0]/a,e[1]=t[1]/a,e[2]=t[2]/a):(e[0]=1,e[1]=0,e[2]=0),n},t.multiply=multiply,t.rotateX=function rotateX(e,t,n){n*=0.5;var a=t[0],r=t[1],s=t[2],l=t[3],d=o(n),c=i(n);return e[0]=a*c+l*d,e[1]=r*c+s*d,e[2]=s*c-r*d,e[3]=l*c-a*d,e},t.rotateY=function rotateY(e,t,n){n*=0.5;var a=t[0],r=t[1],s=t[2],l=t[3],d=o(n),c=i(n);return e[0]=a*c-s*d,e[1]=r*c+l*d,e[2]=s*c+a*d,e[3]=l*c-r*d,e},t.rotateZ=function rotateZ(e,t,n){n*=0.5;var a=t[0],r=t[1],s=t[2],l=t[3],d=o(n),c=i(n);return e[0]=a*c+r*d,e[1]=r*c-a*d,e[2]=s*c+l*d,e[3]=l*c-s*d,e},t.calculateW=function calculateW(e,t){var n=t[0],a=t[1],r=t[2];return e[0]=n,e[1]=a,e[2]=r,e[3]=s(Math.abs(1-n*n-a*a-r*r)),e},t.slerp=slerp,t.random=function random(e){var t=l.c(),n=l.c(),r=l.c(),d=s(1-t),c=s(t);return e[0]=d*o(2*a*n),e[1]=d*i(2*a*n),e[2]=c*o(2*a*r),e[3]=c*i(2*a*r),e},t.invert=function invert(e,t){var n=t[0],a=t[1],r=t[2],o=t[3],i=n*n+a*a+r*r+o*o,s=i?1/i:0;return e[0]=-n*s,e[1]=-a*s,e[2]=-r*s,e[3]=o*s,e},t.conjugate=function conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},t.fromMat3=fromMat3,t.fromEuler=function fromEuler(e,t,n,r){var s=0.5*a/180;t*=s,n*=s,r*=s;var l=o(t),d=i(t),c=o(n),p=i(n),u=o(r),m=i(r);return e[0]=l*p*m-d*c*u,e[1]=d*c*m+l*p*u,e[2]=d*p*u-l*c*m,e[3]=d*p*m+l*c*u,e},t.str=function str(e){return'quat('+e[0]+', '+e[1]+', '+e[2]+', '+e[3]+')'},n.d(t,'clone',function(){return u}),n.d(t,'fromValues',function(){return m}),n.d(t,'copy',function(){return g}),n.d(t,'set',function(){return h}),n.d(t,'add',function(){return f}),n.d(t,'mul',function(){return E}),n.d(t,'scale',function(){return _}),n.d(t,'dot',function(){return C}),n.d(t,'lerp',function(){return y}),n.d(t,'length',function(){return A}),n.d(t,'len',function(){return b}),n.d(t,'squaredLength',function(){return x}),n.d(t,'sqrLen',function(){return v}),n.d(t,'normalize',function(){return T}),n.d(t,'exactEquals',function(){return S}),n.d(t,'equals',function(){return R}),n.d(t,'rotationTo',function(){return F}),n.d(t,'sqlerp',function(){return w}),n.d(t,'setAxes',function(){return M});var l=n(0),d=n(8),c=n(11),p=n(12),u=p.clone,m=p.fromValues,g=p.copy,h=p.set,f=p.add,E=multiply,_=p.scale,C=p.dot,y=p.lerp,A=p.length,b=A,x=p.squaredLength,v=x,T=p.normalize,S=p.exactEquals,R=p.equals,F=function(){var e=c.create(),t=c.fromValues(1,0,0),n=c.fromValues(0,1,0);return function(r,o,a){var i=c.dot(o,a);return-0.999999>i?(c.cross(e,t,o),1e-6>c.len(e)&&c.cross(e,n,o),c.normalize(e,e),setAxisAngle(r,e,Math.PI),r):0.999999r?m:Math.acos(r)},t.str=function str(e){return'vec3('+e[0]+', '+e[1]+', '+e[2]+')'},t.exactEquals=function exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},t.equals=function equals(e,t){var n=e[0],a=e[1],r=e[2],o=t[0],i=t[1],s=t[2];return u(n-o)<=g.b*p(1,u(n),u(o))&&u(a-i)<=g.b*p(1,u(a),u(i))&&u(r-s)<=g.b*p(1,u(r),u(s))},n.d(t,'sub',function(){return a}),n.d(t,'mul',function(){return h}),n.d(t,'div',function(){return f}),n.d(t,'dist',function(){return E}),n.d(t,'sqrDist',function(){return _}),n.d(t,'len',function(){return C}),n.d(t,'sqrLen',function(){return y}),n.d(t,'forEach',function(){return A});var g=n(0),a=subtract,h=multiply,f=divide,E=distance,_=squaredDistance,C=length,y=squaredLength,A=function(){var e=create();return function(t,n,a,r,o,d){var c,i;for(n||(n=3),a||(a=0),i=r?s(r*n+a,t.length):t.length,c=a;cp.length;)p='0'+p;return'#'+p}return'CSS_RGB'===n?'rgb('+i+','+r+','+l+')':'CSS_RGBA'===n?'rgba('+i+','+r+','+l+','+d+')':'HEX'===n?'0x'+e.hex.toString(16):'RGB_ARRAY'===n?'['+i+','+r+','+l+']':'RGBA_ARRAY'===n?'['+i+','+r+','+l+','+d+']':'RGB_OBJ'===n?'{r:'+i+',g:'+r+',b:'+l+'}':'RGBA_OBJ'===n?'{r:'+i+',g:'+r+',b:'+l+',a:'+d+'}':'HSV_OBJ'===n?'{h:'+a+',s:'+c+',v:'+s+'}':'HSVA_OBJ'===n?'{h:'+a+',s:'+c+',v:'+s+',a:'+d+'}':'unknown format'}function defineRGBComponent(e,t,n){Object.defineProperty(e,t,{get:function get$$1(){return'RGB'===this.__state.space?this.__state[t]:(y.recalculateRGB(this,t,n),this.__state[t])},set:function set$$1(e){'RGB'!==this.__state.space&&(y.recalculateRGB(this,t,n),this.__state.space='RGB'),this.__state[t]=e}})}function defineHSVComponent(e,t){Object.defineProperty(e,t,{get:function get$$1(){return'HSV'===this.__state.space?this.__state[t]:(y.recalculateHSV(this),this.__state[t])},set:function set$$1(e){'HSV'!==this.__state.space&&(y.recalculateHSV(this),this.__state.space='HSV'),this.__state[t]=e}})}function cssValueToPixels(e){if('0'===e||l.isUndefined(e))return 0;var t=e.match(x);return l.isNull(t)?0:parseFloat(t[1])}function numDecimals(e){var t=e.toString();return-1i&&(i+=1),{h:360*i,s:l,v:r/255}},rgb_to_hex:function rgb_to_hex(e,t,n){var a=this.hex_with_component(0,2,e);return a=this.hex_with_component(a,1,t),a=this.hex_with_component(a,0,n),a},component_from_hex:function component_from_hex(e,t){return 255&e>>8*t},hex_with_component:function hex_with_component(e,t,n){return n<<(u=8*t)|e&~(255<this.__max&&(t=this.__max),void 0!==this.__step&&0!=t%this.__step&&(t=o(t/this.__step)*this.__step),E(NumberController.prototype.__proto__||Object.getPrototypeOf(NumberController.prototype),'setValue',this).call(this,t)}},{key:'min',value:function min(e){return this.__min=e,this}},{key:'max',value:function max(e){return this.__max=e,this}},{key:'step',value:function step(e){return this.__step=e,this.__impliedStep=e,this.__precision=numDecimals(e),this}}]),NumberController}(A),w=function(e){function NumberControllerBox(e,t,n){function onFinish(){r.__onFinishChange&&r.__onFinishChange.call(r,r.getValue())}function onMouseDrag(t){var e=o-t.clientY;r.setValue(r.getValue()+e*r.__impliedStep),o=t.clientY}function onMouseUp(){T.unbind(window,'mousemove',onMouseDrag),T.unbind(window,'mouseup',onMouseUp),onFinish()}h(this,NumberControllerBox);var a=C(this,(NumberControllerBox.__proto__||Object.getPrototypeOf(NumberControllerBox)).call(this,e,t,n));a.__truncationSuspended=!1;var r=a,o=void 0;return a.__input=document.createElement('input'),a.__input.setAttribute('type','text'),T.bind(a.__input,'change',function onChange(){var e=parseFloat(r.__input.value);l.isNaN(e)||r.setValue(e)}),T.bind(a.__input,'blur',function onBlur(){onFinish()}),T.bind(a.__input,'mousedown',function onMouseDown(t){T.bind(window,'mousemove',onMouseDrag),T.bind(window,'mouseup',onMouseUp),o=t.clientY}),T.bind(a.__input,'keydown',function(t){13===t.keyCode&&(r.__truncationSuspended=!0,this.blur(),r.__truncationSuspended=!1,onFinish())}),a.updateDisplay(),a.domElement.appendChild(a.__input),a}return _(NumberControllerBox,e),f(NumberControllerBox,[{key:'updateDisplay',value:function updateDisplay(){return this.__input.value=this.__truncationSuspended?this.getValue():roundToDecimal(this.getValue(),this.__precision),E(NumberControllerBox.prototype.__proto__||Object.getPrototypeOf(NumberControllerBox.prototype),'updateDisplay',this).call(this)}}]),NumberControllerBox}(F),M=function(e){function NumberControllerSlider(e,t,n,a,r){function onMouseDrag(t){t.preventDefault();var e=i.__background.getBoundingClientRect();return i.setValue(map(t.clientX,e.left,e.right,i.__min,i.__max)),!1}function onMouseUp(){T.unbind(window,'mousemove',onMouseDrag),T.unbind(window,'mouseup',onMouseUp),i.__onFinishChange&&i.__onFinishChange.call(i,i.getValue())}function onTouchMove(t){var e=t.touches[0].clientX,n=i.__background.getBoundingClientRect();i.setValue(map(e,n.left,n.right,i.__min,i.__max))}function onTouchEnd(){T.unbind(window,'touchmove',onTouchMove),T.unbind(window,'touchend',onTouchEnd),i.__onFinishChange&&i.__onFinishChange.call(i,i.getValue())}h(this,NumberControllerSlider);var o=C(this,(NumberControllerSlider.__proto__||Object.getPrototypeOf(NumberControllerSlider)).call(this,e,t,{min:n,max:a,step:r})),i=o;return o.__background=document.createElement('div'),o.__foreground=document.createElement('div'),T.bind(o.__background,'mousedown',function onMouseDown(t){document.activeElement.blur(),T.bind(window,'mousemove',onMouseDrag),T.bind(window,'mouseup',onMouseUp),onMouseDrag(t)}),T.bind(o.__background,'touchstart',function onTouchStart(t){1!==t.touches.length||(T.bind(window,'touchmove',onTouchMove),T.bind(window,'touchend',onTouchEnd),onTouchMove(t))}),T.addClass(o.__background,'slider'),T.addClass(o.__foreground,'slider-fg'),o.updateDisplay(),o.__background.appendChild(o.__foreground),o.domElement.appendChild(o.__background),o}return _(NumberControllerSlider,e),f(NumberControllerSlider,[{key:'updateDisplay',value:function updateDisplay(){var e=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*e+'%',E(NumberControllerSlider.prototype.__proto__||Object.getPrototypeOf(NumberControllerSlider.prototype),'updateDisplay',this).call(this)}}]),NumberControllerSlider}(F),L=function(e){function FunctionController(e,t,n){h(this,FunctionController);var a=C(this,(FunctionController.__proto__||Object.getPrototypeOf(FunctionController)).call(this,e,t));return a.__button=document.createElement('div'),a.__button.innerHTML=void 0===n?'Fire':n,T.bind(a.__button,'click',function(t){return t.preventDefault(),a.fire(),!1}),T.addClass(a.__button,'button'),a.domElement.appendChild(a.__button),a}return _(FunctionController,e),f(FunctionController,[{key:'fire',value:function fire(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),FunctionController}(A),B=function(e){function ColorController(e,t){function fieldDown(t){setSV(t),T.bind(window,'mousemove',setSV),T.bind(window,'touchmove',setSV),T.bind(window,'mouseup',fieldUpSV),T.bind(window,'touchend',fieldUpSV)}function fieldDownH(t){setH(t),T.bind(window,'mousemove',setH),T.bind(window,'touchmove',setH),T.bind(window,'mouseup',fieldUpH),T.bind(window,'touchend',fieldUpH)}function fieldUpSV(){T.unbind(window,'mousemove',setSV),T.unbind(window,'touchmove',setSV),T.unbind(window,'mouseup',fieldUpSV),T.unbind(window,'touchend',fieldUpSV),onFinish()}function fieldUpH(){T.unbind(window,'mousemove',setH),T.unbind(window,'touchmove',setH),T.unbind(window,'mouseup',fieldUpH),T.unbind(window,'touchend',fieldUpH),onFinish()}function onBlur(){var e=p(this.value);!1===e?this.value=a.__color.toString():(a.__color.__state=e,a.setValue(a.__color.toOriginal()))}function onFinish(){a.__onFinishChange&&a.__onFinishChange.call(a,a.__color.toOriginal())}function setSV(t){-1===t.type.indexOf('touch')&&t.preventDefault();var e=a.__saturation_field.getBoundingClientRect(),n=t.touches&&t.touches[0]||t,r=n.clientX,o=n.clientY,i=(r-e.left)/(e.right-e.left),s=1-(o-e.top)/(e.bottom-e.top);return 1s&&(s=0),1i&&(i=0),a.__color.v=s,a.__color.s=i,a.setValue(a.__color.toOriginal()),!1}function setH(t){-1===t.type.indexOf('touch')&&t.preventDefault();var e=a.__hue_field.getBoundingClientRect(),n=t.touches&&t.touches[0]||t,r=n.clientY,o=1-(r-e.top)/(e.bottom-e.top);return 1o&&(o=0),a.__color.h=360*o,a.setValue(a.__color.toOriginal()),!1}h(this,ColorController);var n=C(this,(ColorController.__proto__||Object.getPrototypeOf(ColorController)).call(this,e,t));n.__color=new y(n.getValue()),n.__temp=new y(0);var a=n;n.domElement=document.createElement('div'),T.makeSelectable(n.domElement,!1),n.__selector=document.createElement('div'),n.__selector.className='selector',n.__saturation_field=document.createElement('div'),n.__saturation_field.className='saturation-field',n.__field_knob=document.createElement('div'),n.__field_knob.className='field-knob',n.__field_knob_border='2px solid ',n.__hue_knob=document.createElement('div'),n.__hue_knob.className='hue-knob',n.__hue_field=document.createElement('div'),n.__hue_field.className='hue-field',n.__input=document.createElement('input'),n.__input.type='text',n.__input_textShadow='0 1px 1px ',T.bind(n.__input,'keydown',function(t){13===t.keyCode&&onBlur.call(this)}),T.bind(n.__input,'blur',onBlur),T.bind(n.__selector,'mousedown',function(){T.addClass(this,'drag').bind(window,'mouseup',function(){T.removeClass(a.__selector,'drag')})}),T.bind(n.__selector,'touchstart',function(){T.addClass(this,'drag').bind(window,'touchend',function(){T.removeClass(a.__selector,'drag')})});var r=document.createElement('div');return l.extend(n.__selector.style,{width:'122px',height:'102px',padding:'3px',backgroundColor:'#222',boxShadow:'0px 1px 3px rgba(0,0,0,0.3)'}),l.extend(n.__field_knob.style,{position:'absolute',width:'12px',height:'12px',border:n.__field_knob_border+(0.5>n.__color.v?'#fff':'#000'),boxShadow:'0px 1px 3px rgba(0,0,0,0.5)',borderRadius:'12px',zIndex:1}),l.extend(n.__hue_knob.style,{position:'absolute',width:'15px',height:'2px',borderRight:'4px solid #fff',zIndex:1}),l.extend(n.__saturation_field.style,{width:'100px',height:'100px',border:'1px solid #555',marginRight:'3px',display:'inline-block',cursor:'pointer'}),l.extend(r.style,{width:'100%',height:'100%',background:'none'}),linearGradient(r,'top','rgba(0,0,0,0)','#000'),l.extend(n.__hue_field.style,{width:'15px',height:'100px',border:'1px solid #555',cursor:'ns-resize',position:'absolute',top:'3px',right:'3px'}),hueGradient(n.__hue_field),l.extend(n.__input.style,{outline:'none',textAlign:'center',color:'#fff',border:0,fontWeight:'bold',textShadow:n.__input_textShadow+'rgba(0,0,0,0.7)'}),T.bind(n.__saturation_field,'mousedown',fieldDown),T.bind(n.__saturation_field,'touchstart',fieldDown),T.bind(n.__field_knob,'mousedown',fieldDown),T.bind(n.__field_knob,'touchstart',fieldDown),T.bind(n.__hue_field,'mousedown',fieldDownH),T.bind(n.__hue_field,'touchstart',fieldDownH),n.__saturation_field.appendChild(r),n.__selector.appendChild(n.__field_knob),n.__selector.appendChild(n.__saturation_field),n.__selector.appendChild(n.__hue_field),n.__hue_field.appendChild(n.__hue_knob),n.domElement.appendChild(n.__input),n.domElement.appendChild(n.__selector),n.updateDisplay(),n}return _(ColorController,e),f(ColorController,[{key:'updateDisplay',value:function updateDisplay(){var e=p(this.getValue());if(!1!==e){var t=!1;l.each(y.COMPONENTS,function(n){if(!l.isUndefined(e[n])&&!l.isUndefined(this.__color.__state[n])&&e[n]!==this.__color.__state[n])return t=!0,{}},this),t&&l.extend(this.__color.__state,e)}l.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var n=0.5>this.__color.v||0.5ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px \'Lucida Grande\', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n');({load:function load(e,t){var n=t||document,a=n.createElement('link');a.type='text/css',a.rel='stylesheet',a.href=e,n.getElementsByTagName('head')[0].appendChild(a)},inject:function inject(e,t){var n=t||document,a=document.createElement('style');a.type='text/css',a.innerHTML=e;var r=n.getElementsByTagName('head')[0];try{r.appendChild(a)}catch(t){}}}).inject(O);var U='dg',G=72,k=20,W='Default',H=function(){try{return!!window.localStorage}catch(t){return!1}}(),V=void 0,$=!0,z=void 0,X=!1,j=[],Y=function GUI(e){var t=this,n=e||{};this.domElement=document.createElement('div'),this.__ul=document.createElement('ul'),this.domElement.appendChild(this.__ul),T.addClass(this.domElement,U),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],n=l.defaults(n,{closeOnTop:!1,autoPlace:!0,width:GUI.DEFAULT_WIDTH}),n=l.defaults(n,{resizable:n.autoPlace,hideable:n.autoPlace}),l.isUndefined(n.load)?n.load={preset:W}:n.preset&&(n.load.preset=n.preset),l.isUndefined(n.parent)&&n.hideable&&j.push(this),n.resizable=l.isUndefined(n.parent)&&n.resizable,n.autoPlace&&l.isUndefined(n.scrollable)&&(n.scrollable=!0);var a=H&&'true'===localStorage.getItem(getLocalStorageHash(this,'isLocal')),r=void 0,o=void 0;if(Object.defineProperties(this,{parent:{get:function get$$1(){return n.parent}},scrollable:{get:function get$$1(){return n.scrollable}},autoPlace:{get:function get$$1(){return n.autoPlace}},closeOnTop:{get:function get$$1(){return n.closeOnTop}},preset:{get:function get$$1(){return t.parent?t.getRoot().preset:n.load.preset},set:function set$$1(e){t.parent?t.getRoot().preset=e:n.load.preset=e,setPresetSelectIndex(this),t.revert()}},width:{get:function get$$1(){return n.width},set:function set$$1(e){n.width=e,setWidth(t,e)}},name:{get:function get$$1(){return n.name},set:function set$$1(e){n.name=e,o&&(o.innerHTML=n.name)}},closed:{get:function get$$1(){return n.closed},set:function set$$1(e){n.closed=e,n.closed?T.addClass(t.__ul,GUI.CLASS_CLOSED):T.removeClass(t.__ul,GUI.CLASS_CLOSED),this.onResize(),t.__closeButton&&(t.__closeButton.innerHTML=e?GUI.TEXT_OPEN:GUI.TEXT_CLOSED)}},load:{get:function get$$1(){return n.load}},useLocalStorage:{get:function get$$1(){return a},set:function set$$1(e){H&&(a=e,e?T.bind(window,'unload',r):T.unbind(window,'unload',r),localStorage.setItem(getLocalStorageHash(t,'isLocal'),e))}}}),l.isUndefined(n.parent)){if(n.closed=!1,T.addClass(this.domElement,GUI.CLASS_MAIN),T.makeSelectable(this.domElement,!1),H&&a){t.useLocalStorage=!0;var i=localStorage.getItem(getLocalStorageHash(this,'gui'));i&&(n.load=JSON.parse(i))}this.__closeButton=document.createElement('div'),this.__closeButton.innerHTML=GUI.TEXT_CLOSED,T.addClass(this.__closeButton,GUI.CLASS_CLOSE_BUTTON),n.closeOnTop?(T.addClass(this.__closeButton,GUI.CLASS_CLOSE_TOP),this.domElement.insertBefore(this.__closeButton,this.domElement.childNodes[0])):(T.addClass(this.__closeButton,GUI.CLASS_CLOSE_BOTTOM),this.domElement.appendChild(this.__closeButton)),T.bind(this.__closeButton,'click',function(){t.closed=!t.closed})}else{void 0===n.closed&&(n.closed=!0);var s=document.createTextNode(n.name);T.addClass(s,'controller-name'),o=addRow(t,s);var d=function onClickTitle(n){return n.preventDefault(),t.closed=!t.closed,!1};T.addClass(this.__ul,GUI.CLASS_CLOSED),T.addClass(o,'title'),T.bind(o,'click',d),n.closed||(this.closed=!1)}n.autoPlace&&(l.isUndefined(n.parent)&&($&&(z=document.createElement('div'),T.addClass(z,U),T.addClass(z,GUI.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(z),$=!1),z.appendChild(this.domElement),T.addClass(this.domElement,GUI.CLASS_AUTO_PLACE)),!this.parent&&setWidth(t,n.width)),this.__resizeHandler=function(){t.onResizeDebounced()},T.bind(window,'resize',this.__resizeHandler),T.bind(this.__ul,'webkitTransitionEnd',this.__resizeHandler),T.bind(this.__ul,'transitionend',this.__resizeHandler),T.bind(this.__ul,'oTransitionEnd',this.__resizeHandler),this.onResize(),n.resizable&&addResizeHandle(this),r=function saveToLocalStorage(){H&&'true'===localStorage.getItem(getLocalStorageHash(t,'isLocal'))&&localStorage.setItem(getLocalStorageHash(t,'gui'),JSON.stringify(t.getSaveObject()))},this.saveToLocalStorageIfPossible=r,n.parent||function resetWidth(){var e=t.getRoot();e.width+=1,l.defer(function(){e.width-=1})}()};Y.toggleHide=function(){X=!X,l.each(j,function(e){e.domElement.style.display=X?'none':''})},Y.CLASS_AUTO_PLACE='a',Y.CLASS_AUTO_PLACE_CONTAINER='ac',Y.CLASS_MAIN='main',Y.CLASS_CONTROLLER_ROW='cr',Y.CLASS_TOO_TALL='taller-than-window',Y.CLASS_CLOSED='closed',Y.CLASS_CLOSE_BUTTON='close-button',Y.CLASS_CLOSE_TOP='close-top',Y.CLASS_CLOSE_BOTTOM='close-bottom',Y.CLASS_DRAG='drag',Y.DEFAULT_WIDTH=245,Y.TEXT_CLOSED='Close Controls',Y.TEXT_OPEN='Open Controls',Y._keydownHandler=function(t){'text'!==document.activeElement.type&&(t.which===G||t.keyCode===G)&&Y.toggleHide()},T.bind(window,'keydown',Y._keydownHandler,!1),l.extend(Y.prototype,{add:function add(e,t){return _add(this,e,t,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function addColor(e,t){return _add(this,e,t,{color:!0})},remove:function remove(e){this.__ul.removeChild(e.__li),this.__controllers.splice(this.__controllers.indexOf(e),1);var t=this;l.defer(function(){t.onResize()})},destroy:function destroy(){if(this.parent)throw new Error('Only the root GUI should be removed with .destroy(). For subfolders, use gui.removeFolder(folder) instead.');this.autoPlace&&z.removeChild(this.domElement);var e=this;l.each(this.__folders,function(t){e.removeFolder(t)}),T.unbind(window,'keydown',Y._keydownHandler,!1),removeListeners(this)},addFolder:function addFolder(e){if(void 0!==this.__folders[e])throw new Error('You already have a folder in this GUI by the name "'+e+'"');var t={name:e,parent:this};t.autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[e]&&(t.closed=this.load.folders[e].closed,t.load=this.load.folders[e]);var n=new Y(t);this.__folders[e]=n;var a=addRow(this,n.domElement);return T.addClass(a,'folder'),n},removeFolder:function removeFolder(e){this.__ul.removeChild(e.domElement.parentElement),delete this.__folders[e.name],this.load&&this.load.folders&&this.load.folders[e.name]&&delete this.load.folders[e.name],removeListeners(e);var t=this;l.each(e.__folders,function(t){e.removeFolder(t)}),l.defer(function(){t.onResize()})},open:function open(){this.closed=!1},close:function close(){this.closed=!0},onResize:function onResize(){var e=this.getRoot();if(e.scrollable){var t=T.getOffset(e.__ul).top,n=0;l.each(e.__ul.childNodes,function(t){e.autoPlace&&t===e.__save_row||(n+=T.getHeight(t))}),window.innerHeight-t-kGUI\'s constructor:\n\n \n\n
\n\n Automatically save\n values to localStorage on exit.\n\n
The values saved to localStorage will\n override those passed to dat.GUI\'s constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n\n
\n\n
\n\n'),this.parent)throw new Error('You can only call remember on a top level GUI.');var e=this;l.each(Array.prototype.slice.call(arguments),function(t){0===e.__rememberedObjects.length&&addSaveMenu(e),-1===e.__rememberedObjects.indexOf(t)&&e.__rememberedObjects.push(t)}),this.autoPlace&&setWidth(this,this.width)},getRoot:function getRoot(){for(var e=this;e.parent;)e=e.parent;return e},getSaveObject:function getSaveObject(){var e=this.load;return e.closed=this.closed,0i.children.length;){var a=document.createElement('span');a.style.cssText='width:1px;height:30px;float:left;background-color:#113',i.appendChild(a)}var c=document.createElement('div');c.id='ms',c.style.cssText='padding:0 0 3px 3px;text-align:left;background-color:#020;display:none',_.appendChild(c);var d=document.createElement('div');d.id='msText',d.style.cssText='color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px',d.innerHTML='MS',c.appendChild(d);var A=document.createElement('div');for(A.id='msGraph',A.style.cssText='position:relative;width:74px;height:30px;background-color:#0f0',c.appendChild(A);74>A.children.length;)a=document.createElement('span'),a.style.cssText='width:1px;height:30px;float:left;background-color:#131',A.appendChild(a);var e=function(e){r=e;0===r?(C.style.display='block',c.style.display='none'):1===r?(C.style.display='none',c.style.display='block'):void 0};return{REVISION:12,domElement:_,setMode:e,begin:function(){u=Date.now()},end:function(){var e=Date.now();m=e-u,g=t(g,m),n=s(n,m),d.textContent=m+' MS ('+g+'-'+n+')';var r=t(30,30-30*(m/200));return A.appendChild(A.firstChild).style.height=r+'px',E++,e>l+1E3&&(o=Math.round(1E3*E/(e-l)),h=t(h,o),p=s(p,o),y.textContent=o+' FPS ('+h+'-'+p+')',r=t(30,30-30*(o/100)),i.appendChild(i.firstChild).style.height=r+'px',l=e,E=0),e},update:function(){u=this.end()}}})},function(e,t,n){function OrbitControls(e,t){function getAutoRotationAngle(){return 2*i/60/60*n.autoRotateSpeed}function getZoomScale(){return Math.pow(0.95,n.zoomSpeed)}function rotateLeft(e){h.theta-=e}function rotateUp(e){h.phi-=e}function dollyIn(e){n.object instanceof s.PerspectiveCamera?f/=e:n.object instanceof s.OrthographicCamera?(n.object.zoom=o(n.minZoom,a(n.maxZoom,n.object.zoom*e)),n.object.updateProjectionMatrix(),_=!0):(console.warn('WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.'),n.enableZoom=!1)}function dollyOut(e){n.object instanceof s.PerspectiveCamera?f*=e:n.object instanceof s.OrthographicCamera?(n.object.zoom=o(n.minZoom,a(n.maxZoom,n.object.zoom/e)),n.object.updateProjectionMatrix(),_=!0):(console.warn('WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.'),n.enableZoom=!1)}function handleMouseDownRotate(e){C.set(e.clientX,e.clientY)}function handleMouseDownDolly(e){T.set(e.clientX,e.clientY)}function handleMouseDownPan(e){b.set(e.clientX,e.clientY)}function handleMouseMoveRotate(e){y.set(e.clientX,e.clientY),A.subVectors(y,C);var t=n.domElement===document?n.domElement.body:n.domElement;rotateLeft(2*i*A.x/t.clientWidth*n.rotateSpeed),rotateUp(2*i*A.y/t.clientHeight*n.rotateSpeed),C.copy(y),n.update()}function handleMouseMoveDolly(e){S.set(e.clientX,e.clientY),R.subVectors(S,T),0R.y&&dollyOut(getZoomScale()),T.copy(S),n.update()}function handleMouseMovePan(e){x.set(e.clientX,e.clientY),v.subVectors(x,b),M(v.x,v.y),b.copy(x),n.update()}function handleMouseUp(){}function handleMouseWheel(e){0>e.deltaY?dollyOut(getZoomScale()):0R.y&&dollyIn(getZoomScale()),T.copy(S),n.update()}function handleTouchMovePan(e){x.set(e.touches[0].pageX,e.touches[0].pageY),v.subVectors(x,b),M(v.x,v.y),b.copy(x),n.update()}function handleTouchEnd(){}function onMouseDown(e){if(!1!==n.enabled){switch(e.preventDefault(),e.button){case n.mouseButtons.ORBIT:if(!1===n.enableRotate)return;handleMouseDownRotate(e),u=p.ROTATE;break;case n.mouseButtons.ZOOM:if(!1===n.enableZoom)return;handleMouseDownDolly(e),u=p.DOLLY;break;case n.mouseButtons.PAN:if(!1===n.enablePan)return;handleMouseDownPan(e),u=p.PAN;}u!==p.NONE&&(document.addEventListener('mousemove',onMouseMove,!1),document.addEventListener('mouseup',onMouseUp,!1),n.dispatchEvent(d))}}function onMouseMove(e){if(!1!==n.enabled)switch(e.preventDefault(),u){case p.ROTATE:if(!1===n.enableRotate)return;handleMouseMoveRotate(e);break;case p.DOLLY:if(!1===n.enableZoom)return;handleMouseMoveDolly(e);break;case p.PAN:if(!1===n.enablePan)return;handleMouseMovePan(e);}}function onMouseUp(e){!1===n.enabled||(handleMouseUp(e),document.removeEventListener('mousemove',onMouseMove,!1),document.removeEventListener('mouseup',onMouseUp,!1),n.dispatchEvent(c),u=p.NONE)}function onMouseWheel(e){!1===n.enabled||!1===n.enableZoom||u!==p.NONE&&u!==p.ROTATE||(e.preventDefault(),e.stopPropagation(),handleMouseWheel(e),n.dispatchEvent(d),n.dispatchEvent(c))}function onKeyDown(e){!1===n.enabled||!1===n.enableKeys||!1===n.enablePan||handleKeyDown(e)}function onTouchStart(e){if(!1!==n.enabled){switch(e.touches.length){case 1:if(!1===n.enableRotate)return;handleTouchStartRotate(e),u=p.TOUCH_ROTATE;break;case 2:if(!1===n.enableZoom)return;handleTouchStartDolly(e),u=p.TOUCH_DOLLY;break;case 3:if(!1===n.enablePan)return;handleTouchStartPan(e),u=p.TOUCH_PAN;break;default:u=p.NONE;}u!==p.NONE&&n.dispatchEvent(d)}}function onTouchMove(e){if(!1!==n.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===n.enableRotate)return;if(u!==p.TOUCH_ROTATE)return;handleTouchMoveRotate(e);break;case 2:if(!1===n.enableZoom)return;if(u!==p.TOUCH_DOLLY)return;handleTouchMoveDolly(e);break;case 3:if(!1===n.enablePan)return;if(u!==p.TOUCH_PAN)return;handleTouchMovePan(e);break;default:u=p.NONE;}}function onTouchEnd(e){!1===n.enabled||(handleTouchEnd(e),n.dispatchEvent(c),u=p.NONE)}function onContextMenu(e){!1===n.enabled||e.preventDefault()}this.object=e,this.domElement=t===void 0?document:t,this.enabled=!0,this.target=new s.Vector3,this.minDistance=0,this.maxDistance=Infinity,this.minZoom=0,this.maxZoom=Infinity,this.minPolarAngle=0,this.maxPolarAngle=i,this.minAzimuthAngle=-Infinity,this.maxAzimuthAngle=Infinity,this.enableDamping=!1,this.dampingFactor=0.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:s.MOUSE.LEFT,ZOOM:s.MOUSE.MIDDLE,PAN:s.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return g.phi},this.getAzimuthalAngle=function(){return g.theta},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(l),n.update(),u=p.NONE},this.update=function(){var t=new s.Vector3,r=new s.Quaternion().setFromUnitVectors(e.up,new s.Vector3(0,1,0)),i=r.clone().inverse(),d=new s.Vector3,c=new s.Quaternion;return function update(){var e=n.object.position;return t.copy(e).sub(n.target),t.applyQuaternion(r),g.setFromVector3(t),n.autoRotate&&u===p.NONE&&rotateLeft(getAutoRotationAngle()),g.theta+=h.theta,g.phi+=h.phi,g.theta=o(n.minAzimuthAngle,a(n.maxAzimuthAngle,g.theta)),g.phi=o(n.minPolarAngle,a(n.maxPolarAngle,g.phi)),g.makeSafe(),g.radius*=f,g.radius=o(n.minDistance,a(n.maxDistance,g.radius)),n.target.add(E),t.setFromSpherical(g),t.applyQuaternion(i),e.copy(n.target).add(t),n.object.lookAt(n.target),!0===n.enableDamping?(h.theta*=1-n.dampingFactor,h.phi*=1-n.dampingFactor):h.set(0,0,0),f=1,E.set(0,0,0),(_||d.distanceToSquared(n.object.position)>m||8*(1-c.dot(n.object.quaternion))>m)&&(n.dispatchEvent(l),d.copy(n.object.position),c.copy(n.object.quaternion),_=!1,!0)}}(),this.dispose=function(){n.domElement.removeEventListener('contextmenu',onContextMenu,!1),n.domElement.removeEventListener('mousedown',onMouseDown,!1),n.domElement.removeEventListener('wheel',onMouseWheel,!1),n.domElement.removeEventListener('touchstart',onTouchStart,!1),n.domElement.removeEventListener('touchend',onTouchEnd,!1),n.domElement.removeEventListener('touchmove',onTouchMove,!1),document.removeEventListener('mousemove',onMouseMove,!1),document.removeEventListener('mouseup',onMouseUp,!1),window.removeEventListener('keydown',onKeyDown,!1)};var n=this,l={type:'change'},d={type:'start'},c={type:'end'},p={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},u=p.NONE,m=1e-6,g=new s.Spherical,h=new s.Spherical,f=1,E=new s.Vector3,_=!1,C=new s.Vector2,y=new s.Vector2,A=new s.Vector2,b=new s.Vector2,x=new s.Vector2,v=new s.Vector2,T=new s.Vector2,S=new s.Vector2,R=new s.Vector2,F=function(){var e=new s.Vector3;return function panLeft(t,n){e.setFromMatrixColumn(n,0),e.multiplyScalar(-t),E.add(e)}}(),w=function(){var e=new s.Vector3;return function panUp(t,n){e.setFromMatrixColumn(n,1),e.multiplyScalar(t),E.add(e)}}(),M=function(){var e=new s.Vector3;return function pan(t,a){var r=n.domElement===document?n.domElement.body:n.domElement;if(n.object instanceof s.PerspectiveCamera){var o=n.object.position;e.copy(o).sub(n.target);var l=e.length();l*=Math.tan(n.object.fov/2*i/180),F(2*t*l/r.clientHeight,n.object.matrix),w(2*a*l/r.clientHeight,n.object.matrix)}else n.object instanceof s.OrthographicCamera?(F(t*(n.object.right-n.object.left)/n.object.zoom/r.clientWidth,n.object.matrix),w(a*(n.object.top-n.object.bottom)/n.object.zoom/r.clientHeight,n.object.matrix)):(console.warn('WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.'),n.enablePan=!1)}}();n.domElement.addEventListener('contextmenu',onContextMenu,!1),n.domElement.addEventListener('mousedown',onMouseDown,!1),n.domElement.addEventListener('wheel',onMouseWheel,!1),n.domElement.addEventListener('touchstart',onTouchStart,!1),n.domElement.addEventListener('touchend',onTouchEnd,!1),n.domElement.addEventListener('touchmove',onTouchMove,!1),window.addEventListener('keydown',onKeyDown,!1),this.update()}var a=Math.min,r=Math.sqrt,o=Math.max,i=Math.PI,s=n(7);OrbitControls.prototype=Object.create(s.EventDispatcher.prototype),OrbitControls.prototype.constructor=OrbitControls,Object.defineProperties(OrbitControls.prototype,{center:{get:function(){return console.warn('THREE.OrbitControls: .center has been renamed to .target'),this.target}},noZoom:{get:function(){return console.warn('THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.'),!this.enableZoom},set:function(e){console.warn('THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.'),this.enableZoom=!e}},noRotate:{get:function(){return console.warn('THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.'),!this.enableRotate},set:function(e){console.warn('THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.'),this.enableRotate=!e}},noPan:{get:function(){return console.warn('THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.'),!this.enablePan},set:function(e){console.warn('THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.'),this.enablePan=!e}},noKeys:{get:function(){return console.warn('THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.'),!this.enableKeys},set:function(e){console.warn('THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.'),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn('THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.'),!this.enableDamping},set:function(e){console.warn('THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.'),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn('THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.'),this.dampingFactor},set:function(e){console.warn('THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.'),this.dampingFactor=e}}}),e.exports=OrbitControls},function(n,e){var d=Number.MAX_VALUE,p=Math.pow,y=Math.round,b=Math.min,x=Math.floor,a=Math.sqrt,T=Math.ceil,S=Math.max,g=Math.abs;!function(a,e){n.exports=e()}(window,function(){return function(a){function n(t){if(e[t])return e[t].exports;var r=e[t]={i:t,l:!1,exports:{}};return a[t].call(r.exports,r,r.exports,n),r.l=!0,r.exports}var e={};return n.m=a,n.c=e,n.d=function(a,e,t){n.o(a,e)||Object.defineProperty(a,e,{configurable:!1,enumerable:!0,get:t})},n.r=function(t){Object.defineProperty(t,'__esModule',{value:!0})},n.n=function(a){var e=a&&a.__esModule?function(){return a.default}:function(){return a};return n.d(e,'a',e),e},n.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},n.p='',n(n.s=12)}([function(t){t.exports=function(){throw new Error('define cannot be used indirect')}},function(y,e,t){function d(r,e){for(var t=0;ti?e:null===n?n=Object.getOwnPropertyDescriptor(e,t):n,s;if('object'==typeof Reflect&&'function'==typeof Reflect.decorate)r=Reflect.decorate(l,e,t,n);else for(var o=l.length-1;0<=o;o--)(s=l[o])&&(r=(3>i?s(r):3s;s++)t.push(e[s]);return(e[8]&d.WebGlConstants.DEPTH_BUFFER_BIT.value)===d.WebGlConstants.DEPTH_BUFFER_BIT.value&&t.push(d.WebGlConstants.DEPTH_BUFFER_BIT.name),(e[8]&d.WebGlConstants.STENCIL_BUFFER_BIT.value)===d.WebGlConstants.STENCIL_BUFFER_BIT.value&&t.push(d.WebGlConstants.STENCIL_BUFFER_BIT.name),(e[8]&d.WebGlConstants.COLOR_BUFFER_BIT.value)===d.WebGlConstants.COLOR_BUFFER_BIT.value&&t.push(d.WebGlConstants.COLOR_BUFFER_BIT.name),t.push(d.WebGlConstants.stringifyWebGlConstant(e[9],'blitFrameBuffer')),t},n=i([d.Decorators.command('blitFrameBuffer')],n)}(e.BaseCommand);e.BlitFrameBuffer=t}(d.Commands||(d.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.stringifyArgs=function(e){var t=[];return t.push(e[0]),t.push(e[1]),t.push(a.WebGlConstants.stringifyWebGlConstant(e[2],'vertexAttribPointer')),t.push(e[3]),t.push(e[4]),t.push(e[5]),t},n=i([a.Decorators.command('vertexAttribPointer')],n)}(e.BaseCommand);e.VertexAttribPointer=t}(a.Commands||(a.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.stringifyResult=function(t){if(t)return'name: '+t.name+', size: '+t.size+', type: '+t.type},n=i([a.Decorators.command('getActiveAttrib')],n)}(e.BaseCommand);e.GetActiveAttrib=t}(a.Commands||(a.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.stringifyResult=function(t){if(t)return'name: '+t.name+', size: '+t.size+', type: '+t.type},n=i([a.Decorators.command('getActiveUniform')],n)}(e.BaseCommand);e.GetActiveUniform=t}(a.Commands||(a.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.stringifyResult=function(t){if(t)return'name: '+t.name+', size: '+t.size+', type: '+t.type},n=i([a.Decorators.command('getTransformFeedbackVarying')],n)}(e.BaseCommand);e.GetTransformFeedbackVarying=t}(a.Commands||(a.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.stringifyResult=function(t){return t?'true':'false'},n=i([a.Decorators.command('getExtension')],n)}(e.BaseCommand);e.GetExtension=t}(a.Commands||(a.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.stringifyResult=function(t){if(t)return'min: '+t.rangeMin+', max: '+t.rangeMax+', precision: '+t.precision},n=i([a.Decorators.command('getShaderPrecisionFormat')],n)}(e.BaseCommand);e.GetShaderPrecisionFormat=t}(a.Commands||(a.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.stringifyResult=function(e){if(!e)return'null';var r=a.WebGlObjects.getWebGlObjectTag(e);return r?r.displayText:e},n=i([a.Decorators.command('getParameter')],n)}(e.BaseCommand);e.GetParameter=t}(a.Commands||(a.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.stringifyArgs=function(e){var t=[];return t.push(a.WebGlConstants.stringifyWebGlConstant(e[0],'drawArrays')),t.push(e[1]),t.push(e[2]),t},n=i([a.Decorators.command('drawArrays')],n)}(e.BaseCommand);e.DrawArrays=t}(a.Commands||(a.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.stringifyArgs=function(e){var t=[];return t.push(a.WebGlConstants.stringifyWebGlConstant(e[0],'drawArraysInstanced')),t.push(e[1]),t.push(e[2]),t.push(e[3]),t},n=i([a.Decorators.command('drawArraysInstanced')],n)}(e.BaseCommand);e.DrawArraysInstanced=t}(a.Commands||(a.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.stringifyArgs=function(e){for(var t=[],n=0;nt;t++)e.push(a[t].toFixed(0));return e},n=i([a.Decorators.command('scissor')],n)}(e.BaseCommand);e.Scissor=t}(a.Commands||(a.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.stringifyArgs=function(a){for(var e=[],t=0;4>t;t++)e.push(a[t].toFixed(0));return e},n=i([a.Decorators.command('viewport')],n)}(e.BaseCommand);e.Viewport=t}(a.Commands||(a.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.stringifyArgs=function(n){var e=[];return e.push(n[0]),e},n=i([a.Decorators.command('disableVertexAttribArray')],n)}(e.BaseCommand);e.DisableVertexAttribArray=t}(a.Commands||(a.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.stringifyArgs=function(n){var e=[];return e.push(n[0]),e},n=i([a.Decorators.command('enableVertexAttribArray')],n)}(e.BaseCommand);e.EnableVertexAttribArray=t}(a.Commands||(a.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(){function t(a,e){this.options=a,this.logger=e,this.objectName=a.objectName,this.createCommandNames=this.getCreateCommandNames(),this.updateCommandNames=this.getUpdateCommandNames(),this.deleteCommandNames=this.getDeleteCommandNames(),this.startTime=this.options.time.now,this.memoryPerSecond={},this.totalMemory=0,this.frameMemory=0,this.capturing=!1,t.initializeByteSizeFormat()}return t.initializeByteSizeFormat=function(){var e;this.byteSizePerInternalFormat||(this.byteSizePerInternalFormat=((e={})[a.WebGlConstants.R8.value]=1,e[a.WebGlConstants.R16F.value]=2,e[a.WebGlConstants.R32F.value]=4,e[a.WebGlConstants.R8UI.value]=1,e[a.WebGlConstants.RG8.value]=2,e[a.WebGlConstants.RG16F.value]=4,e[a.WebGlConstants.RG32F.value]=8,e[a.WebGlConstants.ALPHA.value]=1,e[a.WebGlConstants.RGB.value]=3,e[a.WebGlConstants.RGBA.value]=4,e[a.WebGlConstants.LUMINANCE.value]=1,e[a.WebGlConstants.LUMINANCE_ALPHA.value]=2,e[a.WebGlConstants.DEPTH_COMPONENT.value]=1,e[a.WebGlConstants.DEPTH_STENCIL.value]=2,e[a.WebGlConstants.SRGB_EXT.value]=3,e[a.WebGlConstants.SRGB_ALPHA_EXT.value]=4,e[a.WebGlConstants.RGB8.value]=3,e[a.WebGlConstants.SRGB8.value]=3,e[a.WebGlConstants.RGB565.value]=2,e[a.WebGlConstants.R11F_G11F_B10F.value]=4,e[a.WebGlConstants.RGB9_E5.value]=2,e[a.WebGlConstants.RGB16F.value]=6,e[a.WebGlConstants.RGB32F.value]=12,e[a.WebGlConstants.RGB8UI.value]=3,e[a.WebGlConstants.RGBA8.value]=4,e[a.WebGlConstants.RGB5_A1.value]=2,e[a.WebGlConstants.RGBA16F.value]=8,e[a.WebGlConstants.RGBA32F.value]=16,e[a.WebGlConstants.RGBA8UI.value]=4,e[a.WebGlConstants.COMPRESSED_R11_EAC.value]=4,e[a.WebGlConstants.COMPRESSED_SIGNED_R11_EAC.value]=4,e[a.WebGlConstants.COMPRESSED_RG11_EAC.value]=4,e[a.WebGlConstants.COMPRESSED_SIGNED_RG11_EAC.value]=4,e[a.WebGlConstants.COMPRESSED_RGB8_ETC2.value]=4,e[a.WebGlConstants.COMPRESSED_RGBA8_ETC2_EAC.value]=4,e[a.WebGlConstants.COMPRESSED_SRGB8_ETC2.value]=4,e[a.WebGlConstants.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC.value]=4,e[a.WebGlConstants.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]=4,e[a.WebGlConstants.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]=4,e))},t.prototype.registerCallbacks=function(l){for(var e=0,t=this.createCommandNames;ea.arguments.length)){var e=a.arguments[0];if(e){this.options.toggleCapture(!1);var t=this.delete(e);this.changeMemorySize(-t),this.options.toggleCapture(!0)}}},t.prototype.changeMemorySize=function(a){this.totalMemory+=a,this.capturing&&(this.frameMemory+=a);var e=this.options.time.now-this.startTime,t=y(e/1e3);this.memoryPerSecond[t]=this.totalMemory},t.prototype.getWebGlConstant=function(e){var t=a.WebGlConstantsByValue[e];return t?t.name:e+''},t.prototype.getByteSizeForInternalFormat=function(n){return t.byteSizePerInternalFormat[n]||4},t}();e.BaseRecorder=t}(a.Recorders||(a.Recorders={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.getCreateCommandNames=function(){return['createTexture']},n.prototype.getUpdateCommandNames=function(){return['texImage2D','compressedTexImage2D','texStorage2D']},n.prototype.getDeleteCommandNames=function(){return['deleteTexture']},n.prototype.getBoundInstance=function(e){var t=this.options.context;return e===a.WebGlConstants.TEXTURE_2D.value?t.getParameter(a.WebGlConstants.TEXTURE_BINDING_2D.value):e===a.WebGlConstants.TEXTURE_CUBE_MAP_POSITIVE_X.value||e===a.WebGlConstants.TEXTURE_CUBE_MAP_POSITIVE_Y.value||e===a.WebGlConstants.TEXTURE_CUBE_MAP_POSITIVE_Z.value||e===a.WebGlConstants.TEXTURE_CUBE_MAP_NEGATIVE_X.value||e===a.WebGlConstants.TEXTURE_CUBE_MAP_NEGATIVE_Y.value||e===a.WebGlConstants.TEXTURE_CUBE_MAP_NEGATIVE_Z.value?t.getParameter(a.WebGlConstants.TEXTURE_BINDING_CUBE_MAP.value):void 0},n.prototype.delete=function(e){var t=e.__SPECTOR_Object_CustomData;return t?t.target===a.WebGlConstants.TEXTURE_2D_ARRAY.name||t.target===a.WebGlConstants.TEXTURE_3D.name?0:t.length:0},n.prototype.update=function(a,e,t){if(2<=a.arguments.length&&0!==a.arguments[1])return 0;var n=this.getCustomData(a,e,t);if(!n)return 0;var s=t.__SPECTOR_Object_CustomData?t.__SPECTOR_Object_CustomData.length:0,o='TEXTURE_2D'===e?1:6;return n.length=n.width*n.height*o*this.getByteSizeForInternalFormat(n.internalFormat),t.__SPECTOR_Object_CustomData=n,n.length-s},n.prototype.getCustomData=function(a,e,t){return'texImage2D'===a.name?this.getTexImage2DCustomData(a,e,t):'compressedTexImage2D'===a.name?this.getCompressedTexImage2DCustomData(a,e,t):'texStorage2D'===a.name?this.getTexStorage2DCustomData(a,e,t):void 0},n.prototype.getTexStorage2DCustomData=function(n,e){var a;return 5===n.arguments.length&&(a={target:e,internalFormat:n.arguments[2],width:n.arguments[3],height:n.arguments[4],length:0}),a},n.prototype.getCompressedTexImage2DCustomData=function(n,e){var a;if(0===n.arguments[1])return 7<=n.arguments.length&&(a={target:e,internalFormat:n.arguments[2],width:n.arguments[3],height:n.arguments[4],length:0}),a},n.prototype.getTexImage2DCustomData=function(n,e){var a;if(0===n.arguments[1])return 8<=n.arguments.length?a={target:e,internalFormat:n.arguments[2],width:n.arguments[3],height:n.arguments[4],format:n.arguments[6],type:n.arguments[7],length:0}:6===n.arguments.length&&(a={target:e,internalFormat:n.arguments[2],width:n.arguments[5].width,height:n.arguments[5].height,format:n.arguments[3],type:n.arguments[4],length:0}),a},n=i([a.Decorators.recorder('Texture2d')],n)}(e.BaseRecorder);e.Texture2DRecorder=t}(a.Recorders||(a.Recorders={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.getCreateCommandNames=function(){return['createTexture']},n.prototype.getUpdateCommandNames=function(){return['texImage3D','compressedTexImage3D','texStorage3D']},n.prototype.getDeleteCommandNames=function(){return['deleteTexture']},n.prototype.getBoundInstance=function(e){var t=this.options.context;return e===a.WebGlConstants.TEXTURE_2D_ARRAY.value?t.getParameter(a.WebGlConstants.TEXTURE_BINDING_2D_ARRAY.value):e===a.WebGlConstants.TEXTURE_3D.value?t.getParameter(a.WebGlConstants.TEXTURE_BINDING_3D.value):void 0},n.prototype.delete=function(e){var t=e.__SPECTOR_Object_CustomData;return t?t.target!==a.WebGlConstants.TEXTURE_2D_ARRAY.name&&t.target!==a.WebGlConstants.TEXTURE_3D.name?0:t.length:0},n.prototype.update=function(a,e,t){if(2<=a.arguments.length&&0!==a.arguments[1])return 0;var n=this.getCustomData(a,e,t);if(!n)return 0;var r=t.__SPECTOR_Object_CustomData?t.__SPECTOR_Object_CustomData.length:0;return n.length=n.width*n.height*n.depth*this.getByteSizeForInternalFormat(n.internalFormat),n&&(t.__SPECTOR_Object_CustomData=n),n.length-r},n.prototype.getCustomData=function(a,e,t){return'texImage3D'===a.name?this.getTexImage3DCustomData(a,e,t):'compressedTexImage3D'===a.name?this.getCompressedTexImage3DCustomData(a,e,t):'texStorage3D'===a.name?this.getTexStorage3DCustomData(a,e,t):void 0},n.prototype.getTexStorage3DCustomData=function(n,e){var a;return 6===n.arguments.length&&(a={target:e,internalFormat:n.arguments[2],width:n.arguments[3],height:n.arguments[4],depth:n.arguments[5],length:0}),a},n.prototype.getCompressedTexImage3DCustomData=function(n,e){var a;if(0===n.arguments[1])return 8<=n.arguments.length&&(a={target:e,internalFormat:n.arguments[2],width:n.arguments[3],height:n.arguments[4],depth:n.arguments[5],length:0}),a},n.prototype.getTexImage3DCustomData=function(n,e){var a;if(0===n.arguments[1])return 9<=n.arguments.length&&(a={target:e,internalFormat:n.arguments[2],width:n.arguments[3],height:n.arguments[4],depth:n.arguments[5],format:n.arguments[7],type:n.arguments[8],length:0}),a},n=i([a.Decorators.recorder('Texture3d')],n)}(e.BaseRecorder);e.Texture3DRecorder=t}(a.Recorders||(a.Recorders={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.getCreateCommandNames=function(){return['createBuffer']},n.prototype.getUpdateCommandNames=function(){return['bufferData']},n.prototype.getDeleteCommandNames=function(){return['deleteBuffer']},n.prototype.getBoundInstance=function(e){var t=this.options.context;return e===a.WebGlConstants.ARRAY_BUFFER.value?t.getParameter(a.WebGlConstants.ARRAY_BUFFER_BINDING.value):e===a.WebGlConstants.ELEMENT_ARRAY_BUFFER.value?t.getParameter(a.WebGlConstants.ELEMENT_ARRAY_BUFFER_BINDING.value):e===a.WebGlConstants.COPY_READ_BUFFER.value?t.getParameter(a.WebGlConstants.COPY_READ_BUFFER_BINDING.value):e===a.WebGlConstants.COPY_WRITE_BUFFER.value?t.getParameter(a.WebGlConstants.COPY_WRITE_BUFFER_BINDING.value):e===a.WebGlConstants.TRANSFORM_FEEDBACK_BUFFER.value?t.getParameter(a.WebGlConstants.TRANSFORM_FEEDBACK_BUFFER_BINDING.value):e===a.WebGlConstants.UNIFORM_BUFFER.value?t.getParameter(a.WebGlConstants.UNIFORM_BUFFER_BINDING.value):e===a.WebGlConstants.PIXEL_PACK_BUFFER.value?t.getParameter(a.WebGlConstants.PIXEL_PACK_BUFFER_BINDING.value):e===a.WebGlConstants.PIXEL_UNPACK_BUFFER.value?t.getParameter(a.WebGlConstants.PIXEL_UNPACK_BUFFER_BINDING.value):void 0},n.prototype.delete=function(n){var e=n.__SPECTOR_Object_CustomData;return e?e.length:0},n.prototype.update=function(a,e,t){var n=this.getCustomData(e,a);if(!n)return 0;var r=t.__SPECTOR_Object_CustomData?t.__SPECTOR_Object_CustomData.length:0;return t.__SPECTOR_Object_CustomData=n,n.length-r},n.prototype.getCustomData=function(a,r){var t=this.getLength(r);return 4<=r.arguments.length?{target:a,length:t,usage:r.arguments[2],offset:r.arguments[3],sourceLength:r.arguments[1]?r.arguments[1].length:-1}:3===r.arguments.length?{target:a,length:t,usage:r.arguments[2]}:void 0},n.prototype.getLength=function(a){var e=-1,t=0;return 5===a.arguments.length&&(e=a.arguments[4],t=a.arguments[3]),0>=e&&(e='number'==typeof a.arguments[1]?a.arguments[1]:a.arguments[1]&&(a.arguments[1].byteLength||a.arguments[1].length)||0),e-t},n=i([a.Decorators.recorder('Buffer')],n)}(e.BaseRecorder);e.BufferRecorder=t}(a.Recorders||(a.Recorders={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.getCreateCommandNames=function(){return['createRenderbuffer']},n.prototype.getUpdateCommandNames=function(){return['renderbufferStorage','renderbufferStorageMultisample']},n.prototype.getDeleteCommandNames=function(){return['deleteRenderbuffer']},n.prototype.getBoundInstance=function(e){var t=this.options.context;if(e===a.WebGlConstants.RENDERBUFFER.value)return t.getParameter(a.WebGlConstants.RENDERBUFFER_BINDING.value)},n.prototype.delete=function(n){var e=n.__SPECTOR_Object_CustomData;return e?e.length:0},n.prototype.update=function(a,e,t){var n=this.getCustomData(a,e);if(!n)return 0;var r=t.__SPECTOR_Object_CustomData?t.__SPECTOR_Object_CustomData.length:0;return n.length=n.width*n.height*this.getByteSizeForInternalFormat(n.internalFormat),t.__SPECTOR_Object_CustomData=n,n.length-r},n.prototype.getCustomData=function(n,e){return 4===n.arguments.length?{target:e,internalFormat:n.arguments[1],width:n.arguments[2],height:n.arguments[3],length:0,samples:0}:{target:e,internalFormat:n.arguments[2],width:n.arguments[3],height:n.arguments[4],length:0,samples:n.arguments[1]}},n=i([a.Decorators.recorder('Renderbuffer')],n)}(e.BaseRecorder);e.RenderBufferRecorder=t}(a.Recorders||(a.Recorders={}))}(e||(e={})),function(a){!function(e){var t=function(){function t(n,e){this.options=n,this.logger=e,this.recorders={},this.recorderConstructors={},this.onCommandCallbacks={},this.contextInformation=n.contextInformation,this.time=new n.timeConstructor,this.initAvailableRecorders(),this.initRecorders()}return t.prototype.recordCommand=function(a){var e=this.onCommandCallbacks[a.name];if(e)for(var t=0,n=e;tthis.parameters.length);e++)if(this.parameters[e-1])for(var t=0,n=this.parameters[e-1],i;tthis.parameters.length);e++)for(var t=0,n=this.parameters[e-1];tm?(this.captureCanvas.width=t.captureBaseSize*m,this.captureCanvas.height=t.captureBaseSize):1c?(this.captureCanvas.width=e.VisualState.captureBaseSize*c,this.captureCanvas.height=e.VisualState.captureBaseSize):1n.bottom&&a.scrollIntoView(!1)}},e}();n.ScrollIntoViewHelper=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(a){var e=function(){function e(n,a){this.eventConstructor=n,this.logger=a,this.dummyTextGeneratorElement=document.createElement('div')}return e.prototype.createFromHtml=function(n){var e=document.createElement('div');return e.innerHTML=n,e.firstElementChild},e.prototype.htmlTemplate=function(a){for(var s=this,e=[],t=1;t=l.children.length)l.appendChild(i),this.cachedCurrentDomNode&&40===t&&(this.cachedCurrentDomNode.remove?this.cachedCurrentDomNode.remove():this.cachedCurrentDomNode.parentNode&&this.cachedCurrentDomNode.parentNode.removeChild(this.cachedCurrentDomNode));else{var s=l.children[e];l.insertBefore(i,s),40===t&&l.removeChild(s)}return this.cachedCurrentDomNode=this.domNode,o},e.prototype.removeNode=function(){this.domNode&&this.domNode.parentElement&&(this.domNode.remove?this.domNode.remove():this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode)),this.cachedCurrentDomNode&&this.cachedCurrentDomNode.parentElement&&(this.cachedCurrentDomNode.remove?this.cachedCurrentDomNode.remove():this.cachedCurrentDomNode.parentNode&&this.cachedCurrentDomNode.parentNode.removeChild(this.cachedCurrentDomNode))},e.idGenerator=0,e}();n.ComponentInstance=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(){function e(t){this.logger=t,this.store={},this.idGenerator=0,this.pendingOperation={}}return e.prototype.getLastOperation=function(t){return this.store[t].lastOperation},e.prototype.getData=function(t){return this.store[t].data},e.prototype.getComponentInstance=function(t){return this.store[t].componentInstance},e.prototype.getParentId=function(t){return this.store[t].parent?this.store[t].parent.id:-1},e.prototype.getChildrenIds=function(a){for(var e=[],t=0,n=this.store[a].children,r;t=i.children.length?i.children.push(r):0<=e?i.children.splice(e,0,r):i.children.unshift(r),o},e.prototype.removeChildById=function(a,e){for(var t=this.store[a],n=t.children.length-1;0<=n;n--)if(t.children[n].id===e){this.removeChildAt(a,n);break}},e.prototype.removeChildAt=function(a,e){var t=this.store[a],r;e>t.children.length-1?(r=t.children[t.children.length-1],t.children[t.children.length-1].parent=null,t.children.splice(t.children.length-1,1)):0<=e?(r=t.children[e],t.children[e].parent=null,t.children.splice(e,1)):(r=t.children[0],t.children[0].parent=null,t.children.splice(0,1)),r.parent=null,this.remove(r.id)},e.prototype.remove=function(n){var e=this.store[n];e.parent?(this.store[e.parent.id],this.removeChildById(e.parent.id,n)):(this.removeChildren(n),this.store[n].lastOperation=50,this.pendingOperation[n]=n)},e.prototype.removeChildren=function(n){for(var e=this.store[n];e.children.length;)this.remove(e.children[0].id)},e.prototype.getStatesToProcess=function(){return this.pendingOperation},e.prototype.flushPendingOperations=function(){for(var t in this.pendingOperation)this.pendingOperation[t]&&(50===this.store[t].lastOperation?delete this.store[t]:this.store[t].lastOperation=0);this.pendingOperation={}},e.prototype.getNewId=function(){return++this.idGenerator},e}();n.StateStore=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={}));var c=this&&this.__makeTemplateObject||function(n,e){return Object.defineProperty?Object.defineProperty(n,'raw',{value:e}):n.raw=e,n},e;!function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.render=function(e,t){var n=this.htmlTemplate(c(['
\n
\n
\n
\n ','\n
\n
'],['
\n
\n
\n
\n ','\n
\n
']),e?'active':'',e.logVisible?'active':'',e.logLevel===a.LogLevel.error?'error':'',e.logText);return this.renderElementFromTemplate(n,e,t)},n}(e.BaseComponent);e.CaptureMenuComponent=t}(a.EmbeddedFrontend||(a.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(a){function t(e,r){var n=a.call(this,e,r)||this;return n.onCaptureRequested=n.createEvent('onCaptureRequested'),n.onPlayRequested=n.createEvent('onPlayRequested'),n.onPauseRequested=n.createEvent('onPauseRequested'),n.onPlayNextFrameRequested=n.createEvent('onPlayNextFrameRequested'),n}return l(t,a),t.prototype.render=function(a,e){var t=this.htmlTemplate(c(['\n
\n
\n
\n $','\n
'],['\n
\n
\n
\n $','\n
']),a?'
\n
':'
\n
\n
\n
');return this.renderElementFromTemplate(t,a,e)},t}(n.BaseComponent);n.CaptureMenuActionsComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(a){function t(e,r){var n=a.call(this,e,r)||this;return n.onCanvasSelection=n.createEvent('onCanvasSelection'),n}return l(t,a),t.prototype.render=function(a,e){var t=this.htmlTemplate(c(['\n
\n \n ','\n \n
    \n
    '],['\n
    \n \n ','\n \n
      \n
      ']),a.currentCanvasInformation?a.currentCanvasInformation.id+' ('+a.currentCanvasInformation.width+'*'+a.currentCanvasInformation.height+')':'Choose Canvas...',a.showList?'display:block;visibility:visible':'display:none;visibility:hidden');return this.renderElementFromTemplate(t,a,e)},t}(n.BaseComponent);n.CanvasListComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(a){function t(e,r){var n=a.call(this,e,r)||this;return n.onCanvasSelected=n.createEvent('onCanvasSelected'),n}return l(t,a),t.prototype.render=function(a,e){var t=document.createElement('li'),n=document.createElement('span');return n.innerText='Id: '+a.id+' - Size: '+a.width+'*'+a.height,t.appendChild(n),this.mapEventListener(t,'click','onCanvasSelected',a,e),t},t}(n.BaseComponent);n.CanvasListItemComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return l(t,n),t.prototype.render=function(t){var e=document.createElement('span');return e.className='fpsCounterComponent',e.innerText=t.toFixed(2)+' Fps',e},t}(n.BaseComponent);n.FpsCounterComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(d){!function(e){var t=function(){function n(t,a){var o=this;this.options=t,this.logger=a,this.rootPlaceHolder=t.rootPlaceHolder||document.body,this.mvx=new e.MVX(this.rootPlaceHolder,a),this.isTrackingCanvas=!1,this.onCanvasSelected=new t.eventConstructor,this.onCaptureRequested=new t.eventConstructor,this.onPauseRequested=new t.eventConstructor,this.onPlayRequested=new t.eventConstructor,this.onPlayNextFrameRequested=new t.eventConstructor,this.captureMenuComponent=new e.CaptureMenuComponent(t.eventConstructor,a),this.canvasListComponent=new e.CanvasListComponent(t.eventConstructor,a),this.canvasListItemComponent=new e.CanvasListItemComponent(this.options.eventConstructor,this.logger),this.actionsComponent=new e.CaptureMenuActionsComponent(t.eventConstructor,a),this.fpsCounterComponent=new e.FpsCounterComponent(t.eventConstructor,a),this.rootStateId=this.mvx.addRootState({visible:!0,logLevel:d.LogLevel.info,logText:n.SelectCanvasHelpText,logVisible:!this.options.hideLog},this.captureMenuComponent),this.canvasListStateId=this.mvx.addChildState(this.rootStateId,{currentCanvasInformation:null,showList:!1},this.canvasListComponent),this.actionsStateId=this.mvx.addChildState(this.rootStateId,!0,this.actionsComponent),this.fpsStateId=this.mvx.addChildState(this.rootStateId,0,this.fpsCounterComponent),this.actionsComponent.onCaptureRequested.add(function(){var e=o.getSelectedCanvasInformation();e&&o.updateMenuStateLog(d.LogLevel.info,n.PleaseWaitHelpText,!0),setTimeout(function(){o.onCaptureRequested.trigger(e)},200)}),this.actionsComponent.onPauseRequested.add(function(){o.onPauseRequested.trigger(o.getSelectedCanvasInformation()),o.mvx.updateState(o.actionsStateId,!1)}),this.actionsComponent.onPlayRequested.add(function(){o.onPlayRequested.trigger(o.getSelectedCanvasInformation()),o.mvx.updateState(o.actionsStateId,!0)}),this.actionsComponent.onPlayNextFrameRequested.add(function(){o.onPlayNextFrameRequested.trigger(o.getSelectedCanvasInformation())}),this.canvasListComponent.onCanvasSelection.add(function(e){o.mvx.updateState(o.canvasListStateId,{currentCanvasInformation:null,showList:!e.state.showList}),o.updateMenuStateLog(d.LogLevel.info,n.SelectCanvasHelpText),o.onCanvasSelected.trigger(null),o.isTrackingCanvas&&o.trackPageCanvases(),e.state.showList?o.showMenuStateLog():o.hideMenuStateLog()}),this.canvasListItemComponent.onCanvasSelected.add(function(e){o.mvx.updateState(o.canvasListStateId,{currentCanvasInformation:e.state,showList:!1}),o.onCanvasSelected.trigger(e.state),o.updateMenuStateLog(d.LogLevel.info,n.ActionsHelpText),o.showMenuStateLog()})}return n.prototype.getSelectedCanvasInformation=function(){return this.mvx.getGenericState(this.canvasListStateId).currentCanvasInformation},n.prototype.trackPageCanvases=function(){if(this.isTrackingCanvas=!0,document.body){var t=document.body.querySelectorAll('canvas');this.updateCanvasesList(t)}},n.prototype.updateCanvasesList=function(t){this.updateCanvasesListInformationInternal(t,function(t){return{id:t.id,width:t.width,height:t.height,ref:t}})},n.prototype.updateCanvasesListInformation=function(t){this.updateCanvasesListInformationInternal(t,function(t){return{id:t.id,width:t.width,height:t.height,ref:t.ref}})},n.prototype.display=function(){this.updateMenuStateVisibility(!0)},n.prototype.hide=function(){this.updateMenuStateVisibility(!1)},n.prototype.captureComplete=function(e){e?this.updateMenuStateLog(d.LogLevel.error,e):this.updateMenuStateLog(d.LogLevel.info,n.ActionsHelpText)},n.prototype.setFPS=function(t){this.mvx.updateState(this.fpsStateId,t)},n.prototype.updateCanvasesListInformationInternal=function(e,t){this.mvx.removeChildrenStates(this.canvasListStateId);for(var i=[],o=0,r;o\n
      \n Drag files here to open a previously saved capture.\n
      \n
        \n '],['\n
        \n
        \n Drag files here to open a previously saved capture.\n
        \n
          \n
          ']),a?'active':''),i=this.renderElementFromTemplate(n,a,e),o=i.querySelector('.openCaptureFile');return o.addEventListener('dragenter',function(n){return t.drag(n),!1},!1),o.addEventListener('dragover',function(n){return t.drag(n),!1},!1),o.addEventListener('drop',function(n){t.drop(n)},!1),i},t.prototype.drag=function(t){t.stopPropagation(),t.preventDefault()},t.prototype.drop=function(t){t.stopPropagation(),t.preventDefault(),this.loadFiles(t)},t.prototype.loadFiles=function(a){var r=this,t=null;if(a&&a.dataTransfer&&a.dataTransfer.files&&(t=a.dataTransfer.files),a&&a.target&&a.target.files&&(t=a.target.files),t&&0\n
            \n '],['\n
            \n
              \n
              ']));return this.renderElementFromTemplate(t,a,e)},t}(n.BaseComponent);n.VisualStateListComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(a){function n(t,e){var r=a.call(this,t,e)||this;return r.onVisualStateSelected=r.createEvent('onVisualStateSelected'),r}return l(n,a),n.prototype.render=function(e,t){var p=document.createElement('li');if(e.active&&(p.className='active',setTimeout(function(){n.ScrollIntoViewHelper.scrollIntoView(p)},1)),e.VisualState.Attachments){for(var i=0,o=e.VisualState.Attachments,r;i\n
                \n '],['\n
                \n
                  \n
                  ']));return this.renderElementFromTemplate(t,a,e)},t}(n.BaseComponent);n.CommandListComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(a){function n(t,e){var r=a.call(this,t,e)||this;return r.onCommandSelected=r.createEvent('onCommandSelected'),r.onVertexSelected=r.createEvent('onVertexSelected'),r.onFragmentSelected=r.createEvent('onFragmentSelected'),r}return l(n,a),n.prototype.render=function(e,t){var d=document.createElement('li'),i='unknown';switch(e.capture.status){case 50:i='deprecated';break;case 10:i='unused';break;case 20:i='disabled';break;case 30:i='redundant';break;case 40:i='valid';}if(e.capture.VisualState&&(d.className=' drawCall'),e.active&&(d.className=' active',setTimeout(function(){n.ScrollIntoViewHelper.scrollIntoView(d)},1)),e.capture.marker){var o=document.createElement('span');o.className=i+' marker important',o.innerText=e.capture.marker+' ',o.style.fontWeight='1000',d.appendChild(o)}var r=document.createElement('span'),s=e.capture.text;if(s=s.replace(e.capture.name,''+e.capture.name+''),r.innerHTML=s,d.appendChild(r),e.capture.VisualState&&'clear'!==e.capture.name)try{var a=e.capture.DrawCall.shaders[0],l=e.capture.DrawCall.shaders[1],c=document.createElement('a');c.innerText=a.name,c.href='#',d.appendChild(c),this.mapEventListener(c,'click','onVertexSelected',e,t);var p=document.createElement('a');p.innerText=l.name,p.href='#',d.appendChild(p),this.mapEventListener(p,'click','onFragmentSelected',e,t)}catch(t){}return this.mapEventListener(d,'click','onCommandSelected',e,t),d},n}(n.BaseComponent);n.CommandListItemComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return l(t,n),t.prototype.render=function(a,e){var t=this.htmlTemplate(c(['\n
                  \n
                  '],['\n
                  \n
                  ']));return this.renderElementFromTemplate(t,a,e)},t}(n.BaseComponent);n.CommandDetailComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(){function e(){}return e.getMDNLink=function(a){var t=e.WebGL2Functions[a];if(t)return e.WebGL2RootUrl+t;var n=e.WebGLFunctions[a];return n?e.WebGLRootUrl+n:e.WebGLRootUrl+a},e.WebGL2RootUrl='https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/',e.WebGLRootUrl='https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/',e.WebGL2Functions={beginQuery:'beginQuery',beginTransformFeedback:'beginTransformFeedback',bindBufferBase:'bindBufferBase',bindBufferRange:'bindBufferRange',bindSampler:'bindSampler',bindTransformFeedback:'bindTransformFeedback',bindVertexArray:'bindVertexArray',blitFramebuffer:'blitFramebuffer',clearBufferfv:'clearBuffer',clearBufferiv:'clearBuffer',clearBufferuiv:'clearBuffer',clearBufferfi:'clearBuffer',clientWaitSync:'clientWaitSync',compressedTexImage3D:'compressedTexImage3D',compressedTexSubImage3D:'compressedTexSubImage3D',copyBufferSubData:'copyBufferSubData',copyTexSubImage3D:'copyTexSubImage3D',createQuery:'createQuery',createSampler:'createSampler',createTransformFeedback:'createTransformFeedback',createVertexArray:'createVertexArray',deleteQuery:'deleteQuery',deleteSampler:'deleteSampler',deleteSync:'deleteSync',deleteTransformFeedback:'deleteTransformFeedback',deleteVertexArray:'deleteVertexArray',drawArraysInstanced:'drawArraysInstanced',drawBuffers:'drawBuffers',drawElementsInstanced:'drawElementsInstanced',drawRangeElements:'drawRangeElements',endQuery:'endQuery',endTransformFeedback:'endTransformFeedback',fenceSync:'fenceSync',framebufferTextureLayer:'framebufferTextureLayer',getActiveUniformBlockName:'getActiveUniformBlockName',getActiveUniformBlockParameter:'getActiveUniformBlockParameter',getActiveUniforms:'getActiveUniforms',getBufferSubData:'getBufferSubData',getFragDataLocation:'getFragDataLocation',getIndexedParameter:'getIndexedParameter',getInternalformatParameter:'getInternalformatParameter',getQuery:'getQuery',getQueryParameter:'getQueryParameter',getSamplerParameter:'getSamplerParameter',getSyncParameter:'getSyncParameter',getTransformFeedbackVarying:'getTransformFeedbackVarying',getUniformBlockIndex:'getUniformBlockIndex',getUniformIndices:'getUniformIndices',invalidateFramebuffer:'invalidateFramebuffer',invalidateSubFramebuffer:'invalidateSubFramebuffer',isQuery:'isQuery',isSampler:'isSampler',isSync:'isSync',isTransformFeedback:'isTransformFeedback',isVertexArray:'isVertexArray',pauseTransformFeedback:'pauseTransformFeedback',readBuffer:'readBuffer',renderbufferStorageMultisample:'renderbufferStorageMultisample',resumeTransformFeedback:'resumeTransformFeedback',samplerParameteri:'samplerParameter',samplerParameterf:'samplerParameter',texImage3D:'texImage3D',texStorage2D:'texStorage2D',texStorage3D:'texStorage3D',texSubImage3D:'texSubImage3D',transformFeedbackVaryings:'transformFeedbackVaryings',uniform1ui:'uniform',uniform2ui:'uniform',uniform3ui:'uniform',uniform4ui:'uniform',uniform1fv:'uniform',uniform2fv:'uniform',uniform3fv:'uniform',uniform4fv:'uniform',uniform1iv:'uniform',uniform2iv:'uniform',uniform3iv:'uniform',uniform4iv:'uniform',uniform1uiv:'uniform',uniform2uiv:'uniform',uniform3uiv:'uniform',uniform4uiv:'uniform',uniformBlockBinding:'uniformBlockBinding',uniformMatrix2fv:'uniformMatrix',uniformMatrix3x2fv:'uniformMatrix',uniformMatrix4x2fv:'uniformMatrix',uniformMatrix2x3fv:'uniformMatrix',uniformMatrix3fv:'uniformMatrix',uniformMatrix4x3fv:'uniformMatrix',uniformMatrix2x4fv:'uniformMatrix',uniformMatrix3x4fv:'uniformMatrix',uniformMatrix4fv:'uniformMatrix',vertexAttribDivisor:'vertexAttribDivisor',vertexAttribI4i:'vertexAttribI',vertexAttribI4ui:'vertexAttribI',vertexAttribI4iv:'vertexAttribI',vertexAttribI4uiv:'vertexAttribI',vertexAttribIPointer:'vertexAttribIPointer',waitSync:'waitSync'},e.WebGLFunctions={uniform1f:'uniform',uniform1fv:'uniform',uniform1i:'uniform',uniform1iv:'uniform',uniform2f:'uniform',uniform2fv:'uniform',uniform2i:'uniform',uniform2iv:'uniform',uniform3f:'uniform',uniform3i:'uniform',uniform3iv:'uniform',uniform4f:'uniform',uniform4fv:'uniform',uniform4i:'uniform',uniform4iv:'uniform',uniformMatrix2fv:'uniformMatrix',uniformMatrix3fv:'uniformMatrix',uniformMatrix4fv:'uniformMatrix',vertexAttrib1f:'vertexAttrib',vertexAttrib2f:'vertexAttrib',vertexAttrib3f:'vertexAttrib',vertexAttrib4f:'vertexAttrib',vertexAttrib1fv:'vertexAttrib',vertexAttrib2fv:'vertexAttrib',vertexAttrib3fv:'vertexAttrib',vertexAttrib4fv:'vertexAttrib'},e}();n.MDNCommandLinkHelper=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return l(t,n),t.prototype.render=function(a,e){var t=this.htmlTemplate(c(['\n
                  \n
                  '],['\n
                  \n
                  ']));return this.renderElementFromTemplate(t,a,e)},t}(n.BaseComponent);n.JSONContentComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return l(t,n),t.prototype.render=function(a,e){var t=this.htmlTemplate(c(['\n
                  \n
                  ','
                  \n
                    \n
                    '],['\n
                    \n
                    ','
                    \n
                      \n
                      ']),a?a.replace(/([A-Z])/g,' $1').trim():'');return this.renderElementFromTemplate(t,a,e)},t}(n.BaseComponent);n.JSONGroupComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return l(t,n),t.prototype.render=function(a,e){var t=this.htmlTemplate(c(['\n
                    • ',': ','
                    • '],['\n
                    • ',': ','
                    • ']),a.key,a.value);return this.renderElementFromTemplate(t,a,e)},t}(n.BaseComponent);n.JSONItemComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return l(t,n),t.prototype.render=function(a,e){var t=this.htmlTemplate(c(['\n
                    • ','
                    • '],['\n
                    • ','
                    • ']),a.value,a.key);return this.renderElementFromTemplate(t,a,e)},t}(n.BaseComponent);n.JSONImageItemComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(a){function t(e,r){var n=a.call(this,e,r)||this;return n.onOpenSourceClicked=n.createEvent('onOpenSourceClicked'),n}return l(t,a),t.prototype.render=function(a,e){var t=this.htmlTemplate(c(['\n
                    • ',': Click to Open.
                    • '],['\n
                    • ',': Click to Open.
                    • ']),a.key);return this.renderElementFromTemplate(t,a,e)},t}(n.BaseComponent);n.JSONSourceItemComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return l(t,n),t.prototype.render=function(a,e){var t=this.htmlTemplate(c(['\n
                    • ',': \n ',' (Open help page)\n \n
                    • '],['\n
                    • ',': \n ',' (Open help page)\n \n
                    • ']),a.key,a.value,a.help);return this.renderElementFromTemplate(t,a,e)},t}(n.BaseComponent);n.JSONHelpItemComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return l(t,n),t.prototype.render=function(t){var e=document.createElement('div');if(e.className='jsonVisualStateItemComponent',t.Attachments){for(var n=0,i=t.Attachments,o;n\n
                    • Menu
                    • \n\n
                    • \n \n X\n
                    • \n
                    • Captures
                    • \n
                    • Information
                    • \n
                    • Init State
                    • \n
                    • \n \n Commands','\n \n
                    • \n
                    • End State
                    • \n
                    • Close
                    • \n '],['']),a.searchText,0===a.status?'active':'',10===a.status?'active':'',20===a.status?'active':'',40===a.status?'active':'',0',n,e)},t}(n.BaseComponent);n.ResultViewContentComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(a){function t(e,r){return a.call(this,e,r)||this}return l(t,a),t.prototype.render=function(a,e){var t=this.htmlTemplate(c(['\n
                      '],['\n
                      ']),a?'informationColumnLeftComponent':'informationColumnRightComponent');return this.renderElementFromTemplate(t,a,e)},t}(n.BaseComponent);n.InformationColumnComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(a){function t(e,r){return a.call(this,e,r)||this}return l(t,a),t.prototype.render=function(a,e){var t=this.htmlTemplate(c(['\n
                      \n
                      '],['\n
                      \n
                      ']),a?'active':'');return this.renderElementFromTemplate(t,a,e)},t}(n.BaseComponent);n.ResultViewComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(a){function t(e,r){var n=a.call(this,e,r)||this;return n.onVertexSourceClicked=n.createEvent('onVertexSourceClicked'),n.onFragmentSourceClicked=n.createEvent('onFragmentSourceClicked'),n.onSourceCodeCloseClicked=n.createEvent('onSourceCodeCloseClicked'),n.onSourceCodeChanged=n.createEvent('onSourceCodeChanged'),n}return l(t,a),t.prototype.showError=function(a){if(this.editor){var e=[];if(a=a||'')for(var t=/^.*ERROR:\W([0-9]+):([0-9]+):(.*)$/gm,n=t.exec(a);null!=n;)e.push({row:+n[2]-1,column:n[1],text:n[3]||'Error',type:'error'}),n=t.exec(a);this.editor.getSession().setAnnotations(e)}},t.prototype.render=function(s,e){var t=this,n=s.fragment?s.sourceFragment:s.sourceVertex,i=n?this._indentIfdef(this._beautify(n)):'',o=this.htmlTemplate(c(['\n
                      \n
                      \n \n
                      \n $','\n
                      '],['\n
                      \n
                      \n \n
                      \n $','\n
                      ']),s.fragment?'':'active',s.fragment?'active':'',s.editable?this.htmlTemplate(c(['
                      ','
                      '],['
                      ','
                      ']),i):this.htmlTemplate(c(['
                      \n
                      ','
                      \n
                      '],['
                      \n
                      ','
                      \n
                      ']),i)),r=this.renderElementFromTemplate(o.replace(/
                      /g,'\n'),s,e);if(s.editable){this.editor=ace.edit(r.querySelector('.sourceCodeComponentEditable')),this.editor.setTheme('ace/theme/monokai'),this.editor.getSession().setMode('ace/mode/glsl'),this.editor.setShowPrintMargin(!1);var a=-1;this.editor.getSession().on('change',function(){-1!=a&&clearTimeout(a),a=setTimeout(function(){t._triggerCompilation(t.editor,s,r,e)},1500)})}else Prism.highlightElement(r.querySelector('pre'));return r},t.prototype._triggerCompilation=function(a,e,t,n){e.fragment?e.sourceFragment=a.getValue():e.sourceVertex=a.getValue(),this.triggerEvent('onSourceCodeChanged',t,e,n)},t.prototype._beautify=function(p,e){void 0===e&&(e=0),p=p.trim(),p=this._removeReturnInComments(p);for(var n=this._getBracket(p),o=n.firstIteration,r=n.lastIteration,s='',a=0,l;a<\s]*=)\s*/g,function(t){return' '+t.trim()+' '})).replace(/\s*(,)\s*/g,function(t){return t.trim()+' '})).replace(/\n[ \t]+/g,'\n')).replace(/\n/g,'\n'+s)).replace(/\s+$/g,'')).replace(/\n+$/g,'');else{var i=p.substr(0,o),c=p.substr(r+1,p.length),u=p.substr(o+1,r-o-1).trim(),m=this._beautify(u,e+1);l=(l=(l=this._beautify(i,e)+' {\n'+m+'\n'+s+'}\n'+this._beautify(c,e)).replace(/\s*\n+\s*;/g,';')).replace(/#endif[\t \f\v]*{/g,'\n {')}return l=l.replace(t.semicolonReplacementKey,';')},t.prototype._removeReturnInComments=function(a){for(var e=!1,n=!1,i=0,o;it.previousCommandStateId||this.selectCommand(t.previousCommandStateId)},t.prototype.selectNextCommand=function(){var t=this.mvx.getGenericState(this.currentCommandStateId);0>t.nextCommandStateId||this.selectCommand(t.nextCommandStateId)},t.prototype.selectPreviousVisualState=function(){var t=this.mvx.getGenericState(this.currentVisualStateId);0>t.previousVisualStateId||this.selectVisualState(t.previousVisualStateId)},t.prototype.selectNextVisualState=function(){var t=this.mvx.getGenericState(this.currentVisualStateId);0>t.nextVisualStateId||this.selectVisualState(t.nextVisualStateId)},t.prototype.initMenuComponent=function(){var n=this;this.mvx.updateState(this.menuStateId,{status:0,searchText:this.searchText,commandCount:0}),this.resultViewMenuComponent.onCloseClicked.add(function(){n.hide()}),this.resultViewMenuComponent.onCapturesClicked.add(function(){n.displayCaptures()}),this.resultViewMenuComponent.onCommandsClicked.add(function(){n.displayCurrentCapture()}),this.resultViewMenuComponent.onInformationClicked.add(function(){n.displayInformation()}),this.resultViewMenuComponent.onInitStateClicked.add(function(){n.displayInitState()}),this.resultViewMenuComponent.onEndStateClicked.add(function(){n.displayEndState()}),this.resultViewMenuComponent.onSearchTextChanged.add(function(e){n.search(e.sender.value)}),this.resultViewMenuComponent.onSearchTextCleared.add(function(e){n.mvx.updateState(n.menuStateId,{status:e.state.status,searchText:'',commandCount:e.state.commandCount}),n.search('')})},t.prototype.onCaptureRelatedAction=function(n){var a=this.mvx.getGenericState(this.currentCaptureStateId);return this.commandCount=a.capture.commands.length,this.mvx.removeChildrenStates(this.contentStateId),this.mvx.updateState(this.menuStateId,{status:n,searchText:this.searchText,commandCount:this.commandCount}),this.mvx.getGenericState(this.captureListStateId)&&this.mvx.updateState(this.captureListStateId,!1),a.capture},t.prototype.displayCaptures=function(){this.mvx.updateState(this.menuStateId,{status:0,searchText:this.searchText,commandCount:this.commandCount}),this.mvx.updateState(this.captureListStateId,!0)},t.prototype.displayInformation=function(){var l=this.onCaptureRelatedAction(10),e=this.mvx.addChildState(this.contentStateId,!0,this.informationColumnComponent),t=this.mvx.addChildState(this.contentStateId,!1,this.informationColumnComponent),n=this.mvx.addChildState(e,null,this.jsonContentComponent);this.displayJSONGroup(n,'Canvas',l.canvas),this.displayJSONGroup(n,'Context',l.context);for(var i=this.mvx.addChildState(t,null,this.jsonContentComponent),o=0,r=l.analyses,s;ou.index&&this.lastIndex--}return u},c||(RegExp.prototype.test=function(n){var e=d.exec.call(this,n);return e&&this.global&&!e[0].length&&this.lastIndex>e.index&&this.lastIndex--,!!e}))}),ace.define('ace/lib/es5-shim',['require','exports','module'],function(){function i(){}function v(t){try{return Object.defineProperty(t,'sentinel',{}),'sentinel'in t}catch(t){}}function D(t){return(t=+t)==t?0!==t&&t!==1/0&&t!==-1/0&&(t=(0>>0;if('[object Function]'!=d(a))throw new TypeError;for(;++i>>0,i=Array(n),o=arguments[1];if('[object Function]'!=d(a))throw new TypeError(a+' is not a function');for(var r=0;r>>0,o=[],r=arguments[1],s;if('[object Function]'!=d(l))throw new TypeError(l+' is not a function');for(var t=0;t>>0,i=arguments[1];if('[object Function]'!=d(a))throw new TypeError(a+' is not a function');for(var o=0;o>>0,i=arguments[1];if('[object Function]'!=d(a))throw new TypeError(a+' is not a function');for(var o=0;o>>0;if('[object Function]'!=d(a))throw new TypeError(a+' is not a function');if(!n&&1==arguments.length)throw new TypeError('reduce of empty array with no initial value');var s=0,r;if(2<=arguments.length)r=arguments[1];else for(;;){if(s in t){r=t[s++];break}if(++s>=n)throw new TypeError('reduce of empty array with no initial value')}for(;s>>0;if('[object Function]'!=d(a))throw new TypeError(a+' is not a function');if(!n&&1==arguments.length)throw new TypeError('reduceRight of empty array with no initial value');var s=n-1,r;if(2<=arguments.length)r=arguments[1];else for(;;){if(s in t){r=t[s--];break}if(0>--s)throw new TypeError('reduceRight of empty array with no initial value')}do s in this&&(r=a.call(void 0,r,t[s],s,e));while(s--);return r}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(a){var e=f&&'[object String]'==d(this)?this.split(''):O(this),t=e.length>>>0;if(!t)return-1;var r=0;for(1>>0;if(!t)return-1;var r=t-1;for(1e.isIE,e.isGecko=e.isMozilla=(window.Controllers||window.controllers)&&'Gecko'===window.navigator.product,e.isOldGecko=e.isGecko&&4>parseInt((a.match(/rv:(\d+)/)||[])[1],10),e.isOpera=window.opera&&'[object Opera]'==Object.prototype.toString.call(window.opera),e.isWebKit=parseFloat(a.split('WebKit/')[1])||void 0,e.isChrome=parseFloat(a.split(' Chrome/')[1])||void 0,e.isAIR=0<=a.indexOf('AdobeAIR'),e.isIPad=0<=a.indexOf('iPad'),e.isChromeOS=0<=a.indexOf(' CrOS '),e.isIOS=/iPad|iPhone|iPod/.test(a)&&!window.MSStream,e.isIOS&&(e.isMac=!0)}}),ace.define('ace/lib/event',['require','exports','module','ace/lib/keys','ace/lib/useragent'],function(n,p){'use strict';function l(a,i,t){var s=r(i);if(!m.isMac&&o){if(i.getModifierState&&(i.getModifierState('OS')||i.getModifierState('Win'))&&(s|=8),o.altGr){if(3==(3&s))return;o.altGr=0}if(18===t||17===t){var p='location'in i?i.location:i.keyLocation;17===t&&1===p?1==o[t]&&(e=i.timeStamp):18===t&&3===s&&2===p&&50>i.timeStamp-e&&(o.altGr=!0)}}if(!((t in d.MODIFIER_KEYS&&(t=-1),8&s&&91<=t&&93>=t&&(t=-1),!s&&13===t)&&3===(p='location'in i?i.location:i.keyLocation)&&(a(i,s,-t),i.defaultPrevented))){if(m.isChromeOS&&8&s){if(a(i,s,t),i.defaultPrevented)return;s&=-9}return!!(s||t in d.FUNCTION_KEYS||t in d.PRINTABLE_KEYS)&&a(i,s,t)}}function c(){o=Object.create(null)}var d=n('./keys'),m=n('./useragent'),o=null,e=0;p.addListener=function(a,e,t){if(a.addEventListener)return a.addEventListener(e,t,!1);if(a.attachEvent){var n=function(){t.call(a,window.event)};t._wrapper=n,a.attachEvent('on'+e,n)}},p.removeListener=function(a,e,t){return a.removeEventListener?a.removeEventListener(e,t,!1):void(a.detachEvent&&a.detachEvent('on'+e,t._wrapper||t))},p.stopEvent=function(t){return p.stopPropagation(t),p.preventDefault(t),!1},p.stopPropagation=function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},p.preventDefault=function(t){t.preventDefault?t.preventDefault():t.returnValue=!1},p.getButton=function(t){return'dblclick'==t.type?0:'contextmenu'==t.type||m.isMac&&t.ctrlKey&&!t.altKey&&!t.shiftKey?2:t.preventDefault?t.button:{1:0,2:2,4:1}[t.button]},p.capture=function(t,a,n){function o(t){a&&a(t),n&&n(t),p.removeListener(document,'mousemove',a,!0),p.removeListener(document,'mouseup',o,!0),p.removeListener(document,'dragstart',o,!0)}return p.addListener(document,'mousemove',a,!0),p.addListener(document,'mouseup',o,!0),p.addListener(document,'dragstart',o,!0),o},p.addTouchMoveListener=function(t,a){var n,r;'ontouchmove'in t&&(p.addListener(t,'touchstart',function(a){var e=a.changedTouches[0];n=e.clientX,r=e.clientY}),p.addListener(t,'touchmove',function(o){var e=o.changedTouches[0];o.wheelX=-(e.clientX-n)/1,o.wheelY=-(e.clientY-r)/1,n=e.clientX,r=e.clientY,a(o)}))},p.addMouseWheelListener=function(t,a){'onmousewheel'in t?p.addListener(t,'mousewheel',function(t){void 0===t.wheelDeltaX?(t.wheelX=0,t.wheelY=-t.wheelDelta/8):(t.wheelX=-t.wheelDeltaX/8,t.wheelY=-t.wheelDeltaY/8),a(t)}):'onwheel'in t?p.addListener(t,'wheel',function(t){switch(t.deltaMode){case t.DOM_DELTA_PIXEL:t.wheelX=.35*t.deltaX||0,t.wheelY=.35*t.deltaY||0;break;case t.DOM_DELTA_LINE:case t.DOM_DELTA_PAGE:t.wheelX=5*(t.deltaX||0),t.wheelY=5*(t.deltaY||0);}a(t)}):p.addListener(t,'DOMMouseScroll',function(t){t.axis&&t.axis==t.HORIZONTAL_AXIS?(t.wheelX=5*(t.detail||0),t.wheelY=0):(t.wheelX=0,t.wheelY=5*(t.detail||0)),a(t)})},p.addMultiMouseDownListener=function(t,o,n,i){function h(t){if(0===p.getButton(t)?1>=1)&&(a+=a);return t};var t=/^\s\s*/,a=/\s\s*$/;e.stringTrimLeft=function(n){return n.replace(t,'')},e.stringTrimRight=function(t){return t.replace(a,'')},e.copyObject=function(a){var e={};for(var t in a)e[t]=a[t];return e},e.copyArray=function(a){for(var e=[],t=0,n=a.length;tU.isChrome,d=U.isIE;e.TextInput=function(i,G){function _(n){if(!p){if(p=!0,v)e=0,t=n?0:W.value.length-1;else var e=4,t=5;try{W.setSelectionRange(e,t)}catch(t){}p=!1}}function F(){p||(W.value=n,U.isWebKit&&A.schedule())}function I(){clearTimeout(L),L=setTimeout(function(){H&&(W.style.cssText=H,H=''),null==G.renderer.$keepTextAreaAtCursor&&(G.renderer.$keepTextAreaAtCursor=!0,G.renderer.$moveTextAreaToCursor())},0)}var W=o.createElement('textarea');W.className=U.isIOS?'ace_text-input ace_text-input-ios':'ace_text-input',U.isTouchPad&&W.setAttribute('x-palm-disable-auto-cap',!0),W.setAttribute('wrap','off'),W.setAttribute('autocorrect','off'),W.setAttribute('autocapitalize','off'),W.setAttribute('spellcheck',!1),W.style.opacity='0',i.insertBefore(W,i.firstChild);var n='\n aaaa a\n',u=!1,h=!1,m=!1,p=!1,H='',e=!0;try{var g=document.activeElement===W}catch(t){}P.addListener(W,'blur',function(t){G.onBlur(t),g=!1}),P.addListener(W,'focus',function(t){g=!0,G.onFocus(t),_()}),this.focus=function(){return H?W.focus():void(W.style.position='fixed',W.focus())},this.blur=function(){W.blur()},this.isFocused=function(){return g};var E=r.delayedCall(function(){g&&_(e)}),A=r.delayedCall(function(){p||(W.value=n,g&&_())});U.isWebKit||G.addEventListener('changeSelection',function(){G.selection.isEmpty()!=e&&(e=!e,E.schedule())}),F(),g&&G.onFocus();var v=null;this.setInputHandler=function(t){v=t},this.getInputHandler=function(){return v};var V=!1,S=function(t){4===W.selectionStart&&5===W.selectionEnd||(v&&(t=v(t),v=null),m?(_(),t&&G.onPaste(t),m=!1):t==n.substr(0)&&4===W.selectionStart?V?G.execCommand('del',{source:'ace'}):G.execCommand('backspace',{source:'ace'}):u||(t.substring(0,9)==n&&t.length>n.length?t=t.substr(9):t.substr(0,4)==n.substr(0,4)?t=t.substr(4,t.length-n.length+1):t.charAt(t.length-1)==n.charAt(0)&&(t=t.slice(0,-1)),t==n.charAt(0)||t.charAt(t.length-1)==n.charAt(0)&&(t=t.slice(0,-1)),t&&G.onTextInput(t)),u&&(u=!1),V&&(V=!1))},R=function(){if(!p){var e=W.value;S(e),F()}},T=function(a,r,t){var e=a.clipboardData||window.clipboardData;if(e&&!l){var i=d||t?'Text':'text/plain';try{return r?!1!==e.setData(i,r):e.getData(i)}catch(a){if(!t)return T(a,r,!0)}}},y=function(t,e){var n=G.getCopyText();return n?void(T(t,n)?(U.isIOS&&(h=e,W.value='\n aa'+n+'a a\n',W.setSelectionRange(4,4+n.length),u={value:n}),e?G.onCut():G.onCopy(),U.isIOS||P.preventDefault(t)):(u=!0,W.value=n,W.select(),setTimeout(function(){u=!1,F(),_(),e?G.onCut():G.onCopy()}))):P.preventDefault(t)};P.addCommandKeyListener(W,G.onCommandKey.bind(G)),P.addListener(W,'select',function(){(function(t){return 0===t.selectionStart&&t.selectionEnd===t.value.length})(W)?(G.selectAll(),_()):v&&_(G.selection.isEmpty())}),P.addListener(W,'input',R),P.addListener(W,'cut',function(t){y(t,!0)}),P.addListener(W,'copy',function(t){y(t,!1)}),P.addListener(W,'paste',function(t){var e=T(t);'string'==typeof e?(e&&G.onPaste(e,t),U.isIE&&setTimeout(_),P.preventDefault(t)):(W.value='',m=!0)});var w=function(){if(p&&G.onCompositionUpdate&&!G.$readOnly){var t=W.value.replace(/\x01/g,'');if(p.lastValue!==t&&(G.onCompositionUpdate(t),p.lastValue&&G.undo(),p.canUndo&&(p.lastValue=t),p.lastValue)){var e=G.selection.getRange();G.insert(p.lastValue),G.session.markUndoGroup(),p.range=G.selection.getRange(),G.selection.setRange(e),G.selection.clearSelection()}}},x=function(t){if(G.onCompositionEnd&&!G.$readOnly){var n=p;p=!1;var a=setTimeout(function(){a=null;var t=W.value.replace(/\x01/g,'');p||(t==n.lastValue?F():!n.lastValue&&t&&(F(),S(t)))});v=function(t){return a&&clearTimeout(a),(t=t.replace(/\x01/g,''))==n.lastValue?'':(n.lastValue&&a&&G.undo(),t)},G.onCompositionEnd(),G.removeListener('mousedown',x),'compositionend'==t.type&&n.range&&G.selection.setRange(n.range),(U.isChrome&&53<=U.isChrome||U.isWebKit&&603<=U.isWebKit)&&R()}},D=r.delayedCall(w,50),L;P.addListener(W,'compositionstart',function(){p||!G.onCompositionStart||G.$readOnly||((p={}).canUndo=G.session.$undoManager,G.onCompositionStart(),setTimeout(w,0),G.on('mousedown',x),p.canUndo&&!G.selection.isEmpty()&&(G.insert(''),G.session.markUndoGroup(),G.selection.clearSelection()),G.session.markUndoGroup())}),U.isGecko?P.addListener(W,'text',function(){D.schedule()}):(P.addListener(W,'keyup',function(){D.schedule()}),P.addListener(W,'keydown',function(){D.schedule()})),P.addListener(W,'compositionend',x),this.getElement=function(){return W},this.setReadOnly=function(t){W.readOnly=t},this.onContextMenu=function(n){V=!0,_(G.selection.isEmpty()),G._emit('nativecontextmenu',{target:G,domEvent:n}),this.moveToMouse(n,!0)},this.moveToMouse=function(t,e){H||(H=W.style.cssText),W.style.cssText=(e?'z-index:100000;':'')+'height:'+W.style.height+';'+(U.isIE?'opacity:0.1;':'');var n=G.container.getBoundingClientRect(),a=o.computedStyle(G.container),r=n.top+(parseInt(a.borderTopWidth)||0),i=n.left+(parseInt(n.borderLeftWidth)||0),s=n.bottom-r-W.clientHeight-2,l=function(t){W.style.left=t.clientX-i-2+'px',W.style.top=b(t.clientY-r-2,s)+'px'};l(t),'mousedown'==t.type&&(G.renderer.$keepTextAreaAtCursor&&(G.renderer.$keepTextAreaAtCursor=null),clearTimeout(L),U.isWin&&P.capture(G.container,l,I))},this.onContextMenuClose=I;var B=function(t){G.textInput.onContextMenu(t),I()};if(P.addListener(W,'mouseup',B),P.addListener(W,'mousedown',function(t){t.preventDefault(),I()}),P.addListener(G.renderer.scroller,'contextmenu',B),P.addListener(W,'contextmenu',B),U.isIOS){var M=null,N=!1;i.addEventListener('keydown',function(){M&&clearTimeout(M),N=!0}),i.addEventListener('keyup',function(){M=setTimeout(function(){N=!1},100)});var $=function(){if(document.activeElement===W&&!N){if(h)return setTimeout(function(){h=!1},100);var e=W.selectionStart,t=W.selectionEnd;(W.setSelectionRange(4,5),e==t)?0===e?G.onCommandKey(null,0,s.up):1===e?G.onCommandKey(null,0,s.home):2===e?G.onCommandKey(null,a.option,s.left):4===e?G.onCommandKey(null,0,s.left):5===e?G.onCommandKey(null,0,s.right):7===e?G.onCommandKey(null,a.option,s.right):8===e?G.onCommandKey(null,0,s.end):9===e?G.onCommandKey(null,0,s.down):void 0:(6===t?G.onCommandKey(null,a.shift,s.right):7===t?G.onCommandKey(null,a.shift|a.option,s.right):8===t?G.onCommandKey(null,a.shift,s.end):9===t?G.onCommandKey(null,a.shift,s.down):void 0,0===e?G.onCommandKey(null,a.shift,s.up):1===e?G.onCommandKey(null,a.shift,s.home):2===e?G.onCommandKey(null,a.shift|a.option,s.left):3===e?G.onCommandKey(null,a.shift,s.left):void 0)}};document.addEventListener('selectionchange',$),G.on('destroy',function(){document.removeEventListener('selectionchange',$)})}}}),ace.define('ace/keyboard/textinput',['require','exports','module','ace/lib/event','ace/lib/useragent','ace/lib/dom','ace/lib/lang','ace/keyboard/textinput_ios'],function(n,e){'use strict';var P=n('../lib/event'),O=n('../lib/useragent'),o=n('../lib/dom'),r=n('../lib/lang'),s=18>O.isChrome,d=O.isIE,i=n('./textinput_ios').TextInput;e.TextInput=function(l,U){function A(n){if(!h){if(h=!0,E)e=0,t=n?0:G.value.length-1;else var e=n?2:1,t=2;try{G.setSelectionRange(e,t)}catch(t){}h=!1}}function v(){h||(G.value=n,O.isWebKit&&C.schedule())}function M(){clearTimeout(I),I=setTimeout(function(){k&&(G.style.cssText=k,k=''),null==U.renderer.$keepTextAreaAtCursor&&(U.renderer.$keepTextAreaAtCursor=!0,U.renderer.$moveTextAreaToCursor())},0)}if(O.isIOS)return i.call(this,l,U);var G=o.createElement('textarea');G.className='ace_text-input',G.setAttribute('wrap','off'),G.setAttribute('autocorrect','off'),G.setAttribute('autocapitalize','off'),G.setAttribute('spellcheck',!1),G.style.opacity='0',l.insertBefore(G,l.firstChild);var n='\u2028\u2028',c=!1,u=!1,h=!1,k='',e=!0;try{var p=document.activeElement===G}catch(t){}P.addListener(G,'blur',function(t){U.onBlur(t),p=!1}),P.addListener(G,'focus',function(t){p=!0,U.onFocus(t),A()}),this.focus=function(){if(k)return G.focus();var t=G.style.top;G.style.position='fixed',G.style.top='0px',G.focus(),setTimeout(function(){G.style.position='','0px'==G.style.top&&(G.style.top=t)},0)},this.blur=function(){G.blur()},this.isFocused=function(){return p};var g=r.delayedCall(function(){p&&A(e)}),C=r.delayedCall(function(){h||(G.value=n,p&&A())});O.isWebKit||U.addEventListener('changeSelection',function(){U.selection.isEmpty()!=e&&(e=!e,g.schedule())}),v(),p&&U.onFocus();var E=null;this.setInputHandler=function(t){E=t},this.getInputHandler=function(){return E};var _=!1,F=function(t){E&&(t=E(t),E=null),u?(A(),t&&U.onPaste(t),u=!1):t==n.charAt(0)?_?U.execCommand('del',{source:'ace'}):U.execCommand('backspace',{source:'ace'}):(t.substring(0,2)==n?t=t.substr(2):t.charAt(0)==n.charAt(0)?t=t.substr(1):t.charAt(t.length-1)==n.charAt(0)&&(t=t.slice(0,-1)),t.charAt(t.length-1)==n.charAt(0)&&(t=t.slice(0,-1)),t&&U.onTextInput(t)),_&&(_=!1)},W=function(){if(!h){var e=G.value;F(e),v()}},S=function(r,l,t){var e=r.clipboardData||window.clipboardData;if(e&&!s){var i=d||t?'Text':'text/plain';try{return l?!1!==e.setData(i,l):e.getData(i)}catch(a){if(!t)return S(a,l,!0)}}},R=function(t,e){var n=U.getCopyText();return n?void(S(t,n)?(e?U.onCut():U.onCopy(),P.preventDefault(t)):(c=!0,G.value=n,G.select(),setTimeout(function(){c=!1,v(),A(),e?U.onCut():U.onCopy()}))):P.preventDefault(t)},T=function(t){R(t,!0)},y=function(t){R(t,!1)},w=function(t){var e=S(t);'string'==typeof e?(e&&U.onPaste(e,t),O.isIE&&setTimeout(A),P.preventDefault(t)):(G.value='',u=!0)};P.addCommandKeyListener(G,U.onCommandKey.bind(U)),P.addListener(G,'select',function(){c?c=!1:function(t){return 0===t.selectionStart&&t.selectionEnd===t.value.length}(G)?(U.selectAll(),A()):E&&A(U.selection.isEmpty())}),P.addListener(G,'input',W),P.addListener(G,'cut',T),P.addListener(G,'copy',y),P.addListener(G,'paste',w),'oncut'in G&&'oncopy'in G&&'onpaste'in G||P.addListener(l,'keydown',function(t){if((!O.isMac||t.metaKey)&&t.ctrlKey)switch(t.keyCode){case 67:y(t);break;case 86:w(t);break;case 88:T(t);}});var B=function(){if(h&&U.onCompositionUpdate&&!U.$readOnly){var t=G.value.replace(/\u2028/g,'');if(h.lastValue!==t&&(U.onCompositionUpdate(t),h.lastValue&&U.undo(),h.canUndo&&(h.lastValue=t),h.lastValue)){var e=U.selection.getRange();U.insert(h.lastValue),U.session.markUndoGroup(),h.range=U.selection.getRange(),U.selection.setRange(e),U.selection.clearSelection()}}},D=function(t){if(U.onCompositionEnd&&!U.$readOnly){var n=h;h=!1;var a=setTimeout(function(){a=null;var t=G.value.replace(/\u2028/g,'');h||(t==n.lastValue?v():!n.lastValue&&t&&(v(),F(t)))});E=function(t){return a&&clearTimeout(a),(t=t.replace(/\u2028/g,''))==n.lastValue?'':(n.lastValue&&a&&U.undo(),t)},U.onCompositionEnd(),U.removeListener('mousedown',D),'compositionend'==t.type&&n.range&&U.selection.setRange(n.range),(O.isChrome&&53<=O.isChrome||O.isWebKit&&603<=O.isWebKit)&&W()}},L=r.delayedCall(B,50),I;P.addListener(G,'compositionstart',function(){h||!U.onCompositionStart||U.$readOnly||((h={}).canUndo=U.session.$undoManager,U.onCompositionStart(),setTimeout(B,0),U.on('mousedown',D),h.canUndo&&!U.selection.isEmpty()&&(U.insert(''),U.session.markUndoGroup(),U.selection.clearSelection()),U.session.markUndoGroup())}),O.isGecko?P.addListener(G,'text',function(){L.schedule()}):(P.addListener(G,'keyup',function(){L.schedule()}),P.addListener(G,'keydown',function(){L.schedule()})),P.addListener(G,'compositionend',D),this.getElement=function(){return G},this.setReadOnly=function(t){G.readOnly=t},this.onContextMenu=function(n){_=!0,A(U.selection.isEmpty()),U._emit('nativecontextmenu',{target:U,domEvent:n}),this.moveToMouse(n,!0)},this.moveToMouse=function(t,e){k||(k=G.style.cssText),G.style.cssText=(e?'z-index:100000;':'')+'height:'+G.style.height+';'+(O.isIE?'opacity:0.1;':'');var n=U.container.getBoundingClientRect(),a=o.computedStyle(U.container),r=n.top+(parseInt(a.borderTopWidth)||0),i=n.left+(parseInt(n.borderLeftWidth)||0),s=n.bottom-r-G.clientHeight-2,l=function(t){G.style.left=t.clientX-i-2+'px',G.style.top=b(t.clientY-r-2,s)+'px'};l(t),'mousedown'==t.type&&(U.renderer.$keepTextAreaAtCursor&&(U.renderer.$keepTextAreaAtCursor=null),clearTimeout(I),O.isWin&&P.capture(U.container,l,M))},this.onContextMenuClose=M;var x=function(t){U.textInput.onContextMenu(t),M()};P.addListener(G,'mouseup',x),P.addListener(G,'mousedown',function(t){t.preventDefault(),M()}),P.addListener(U.renderer.scroller,'contextmenu',x),P.addListener(G,'contextmenu',x)}}),ace.define('ace/mouse/default_handlers',['require','exports','module','ace/lib/dom','ace/lib/event','ace/lib/useragent'],function(n,e){'use strict';function o(n){n.$clickSelection=null;var e=n.editor;e.setDefaultHandler('mousedown',this.onMouseDown.bind(n)),e.setDefaultHandler('dblclick',this.onDoubleClick.bind(n)),e.setDefaultHandler('tripleclick',this.onTripleClick.bind(n)),e.setDefaultHandler('quadclick',this.onQuadClick.bind(n)),e.setDefaultHandler('mousewheel',this.onMouseWheel.bind(n)),e.setDefaultHandler('touchmove',this.onTouchMove.bind(n)),['select','startSelect','selectEnd','selectAllEnd','selectByWordsEnd','selectByLinesEnd','dragWait','dragWaitEnd','focusWait'].forEach(function(e){n[e]=this[e]},this),n.selectByLines=this.extendSelectionBy.bind(n,'getLineRange'),n.selectByWords=this.extendSelectionBy.bind(n,'getWordRange')}function r(a,e){if(a.start.row==a.end.row)var t=2*e.column-a.start.column-a.end.column;else if(a.start.row!=a.end.row-1||a.start.column||a.end.column)t=2*e.row-a.start.row-a.end.row;else var t=e.column-4;return 0>t?{cursor:a.start,anchor:a.end}:{cursor:a.end,anchor:a.start}}n('../lib/dom'),n('../lib/event');var t=n('../lib/useragent');(function(){this.onMouseDown=function(a){var e=a.inSelection(),i=a.getDocumentPosition();this.mousedownEvent=a;var n=this.editor,o=a.getButton();if(0!==o){var r=n.getSelectionRange().isEmpty();return n.$blockScrolling++,(r||1==o)&&n.selection.moveToPosition(i),n.$blockScrolling--,void(2==o&&(n.textInput.onContextMenu(a.domEvent),t.isMozilla||a.preventDefault()))}return this.mousedownEvent.time=Date.now(),!e||n.isFocused()||(n.focus(),!this.$focusTimout||this.$clickSelection||n.inMultiSelectMode)?(this.captureMouse(a),this.startSelect(i,1=s)o=this.$clickSelection.end,i.end.row==n.row&&i.end.column==n.column||(n=i.start);else if(1==s&&0<=t)o=this.$clickSelection.start,i.start.row==n.row&&i.start.column==n.column||(n=i.end);else if(-1==t&&1==s)n=i.end,o=i.start;else{var a=r(this.$clickSelection,n);n=a.cursor,o=a.anchor}e.selection.setSelectionAnchor(o.row,o.column)}e.selection.selectToPosition(n),e.$blockScrolling--,e.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle('ace_selecting'),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var s=(r=this.mousedownEvent.x,e=this.mousedownEvent.y,t=this.x,n=this.y,a(p(t-r,2)+p(n-e,2))),o=Date.now(),r,e,t,n;(0this.$focusTimout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(a){var e=a.getDocumentPosition(),t=this.editor,n=t.session.getBracketRange(e);n?(n.isEmpty()&&(n.start.column--,n.end.column++),this.setState('select')):(n=t.selection.getWordRange(e.row,e.column),this.setState('selectByWords')),this.$clickSelection=n,this.select()},this.onTripleClick=function(a){var e=a.getDocumentPosition(),t=this.editor;this.setState('selectByLines');var n=t.getSelectionRange();n.isMultiLine()&&n.contains(e.row,e.column)?(this.$clickSelection=t.selection.getLineRange(n.start.row),this.$clickSelection.end=t.selection.getLineRange(n.end.row).end):this.$clickSelection=t.selection.getLineRange(e.row),this.select()},this.onQuadClick=function(){var e=this.editor;e.selectAll(),this.$clickSelection=e.getSelectionRange(),this.setState('selectAll')},this.onMouseWheel=function(a){if(!a.getAccelKey()){a.getShiftKey()&&a.wheelY&&!a.wheelX&&(a.wheelX=a.wheelY,a.wheelY=0);var e=a.domEvent.timeStamp,t=e-(this.$lastScrollTime||0),n=this.editor;return n.renderer.isScrollableBy(a.wheelX*a.speed,a.wheelY*a.speed)||200>t?(this.$lastScrollTime=e,n.renderer.scrollBy(a.wheelX*a.speed,a.wheelY*a.speed),a.stop()):void 0}},this.onTouchMove=function(a){var e=a.domEvent.timeStamp,t=e-(this.$lastScrollTime||0),n=this.editor;if(n.renderer.isScrollableBy(a.wheelX*a.speed,a.wheelY*a.speed)||200>t)return this.$lastScrollTime=e,n.renderer.scrollBy(a.wheelX*a.speed,a.wheelY*a.speed),a.stop()}}).call(o.prototype),e.DefaultHandlers=o}),ace.define('ace/tooltip',['require','exports','module','ace/lib/oop','ace/lib/dom'],function(n,e){'use strict';function o(t){this.isOpen=!1,this.$element=null,this.$parentNode=t}n('./lib/oop');var t=n('./lib/dom');(function(){this.$init=function(){return this.$element=t.createElement('div'),this.$element.className='ace_tooltip',this.$element.style.display='none',this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(n){t.setInnerText(this.getElement(),n)},this.setHtml=function(t){this.getElement().innerHTML=t},this.setPosition=function(n,e){this.getElement().style.left=n+'px',this.getElement().style.top=e+'px'},this.setClassName=function(n){t.addCssClass(this.getElement(),n)},this.show=function(a,e,t){null!=a&&this.setText(a),null!=e&&null!=t&&this.setPosition(e,t),this.isOpen||(this.getElement().style.display='block',this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display='none',this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(o.prototype),e.Tooltip=o}),ace.define('ace/mouse/default_gutter_handler',['require','exports','module','ace/lib/dom','ace/lib/oop','ace/lib/event','ace/tooltip'],function(n,e){'use strict';function a(t){l.call(this,t)}var d=n('../lib/dom'),t=n('../lib/oop'),i=n('../lib/event'),l=n('../tooltip').Tooltip;t.inherits(a,l),function(){this.setPosition=function(a,e){var t=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,i=this.getWidth(),o=this.getHeight();e+=15,(a+=15)+i>t&&(a-=a+i-t),e+o>n&&(e-=20+o),l.prototype.setPosition.call(this,a,e)}}.call(a.prototype),e.GutterHandler=function(p){function u(){c&&(c=clearTimeout(c)),n&&(l.hide(),n=null,e._signal('hideGutterTooltip',l),e.removeEventListener('mousewheel',u))}function h(t){l.setPosition(t.x,t.y)}var e=p.editor,s=e.renderer.$gutterLayer,l=new a(e.container),c,g,n;p.editor.setDefaultHandler('guttermousedown',function(a){if(e.isFocused()&&0==a.getButton()&&'foldWidgets'!=s.getRegion(a)){var t=a.getDocumentPosition().row,n=e.session.selection;if(a.getShiftKey())n.selectTo(t,0);else{if(2==a.domEvent.detail)return e.selectAll(),a.preventDefault();p.$clickSelection=e.selection.getLineRange(t)}return p.setState('selectByLines'),p.captureMouse(a),a.preventDefault()}}),p.editor.setDefaultHandler('guttermousemove',function(t){var r=t.domEvent.target||t.domEvent.srcElement;return d.hasCssClass(r,'ace_fold-widget')?u():void(n&&p.$tooltipFollowsMouse&&h(t),g=t,c||(c=setTimeout(function(){c=null,g&&!p.isMousePressed?function(){var o=g.getDocumentPosition().row,t=s.$annotations[o];if(!t)return u();if(o==e.session.getLength()){var c=e.renderer.pixelToScreenCoordinates(0,g.y).row,r=g.$pos;if(c>e.session.documentToScreenRow(r.row,r.column))return u()}if(n!=t)if(n=t.text.join('
                      '),l.setHtml(n),l.show(),e._signal('showGutterTooltip',l),e.on('mousewheel',u),p.$tooltipFollowsMouse)h(g);else{var a=g.domEvent.target.getBoundingClientRect(),d=l.getElement().style;d.left=a.right+'px',d.top=a.bottom+'px'}}():u()},50)))}),i.addListener(e.renderer.$gutter,'mouseout',function(){g=null,n&&!c&&(c=setTimeout(function(){c=null,u()},50))}),e.on('changeSession',u)}}),ace.define('ace/mouse/mouse_event',['require','exports','module','ace/lib/event','ace/lib/useragent'],function(n,e){'use strict';var t=n('../lib/event'),a=n('../lib/useragent'),o=e.MouseEvent=function(n,e){this.domEvent=n,this.editor=e,this.x=this.clientX=n.clientX,this.y=this.clientY=n.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){t.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){t.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var n=this.editor.getSelectionRange();if(n.isEmpty())this.$inSelection=!1;else{var e=this.getDocumentPosition();this.$inSelection=n.contains(e.row,e.column)}return this.$inSelection},this.getButton=function(){return t.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=a.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(o.prototype)}),ace.define('ace/mouse/dragdrop_handler',['require','exports','module','ace/lib/dom','ace/lib/event','ace/lib/useragent'],function(n,e){'use strict';function c(a){function b(){var t=p;(function(t,e){var a=Date.now(),i=!e||t.row!=e.row,o=!e||t.column!=e.column;!E||i||o?(D.$blockScrolling+=1,D.moveCursorToPosition(t),D.$blockScrolling-=1,E=a,O={x:F,y:I}):u(O.x,O.y,F,I)>m?E=null:a-E>=s&&(D.renderer.scrollCursorIntoView(),E=null)})(p=D.renderer.screenToTextCoordinates(F,I),t),function(t,e){var s=Date.now(),i=D.renderer.layerConfig.lineHeight,o=D.renderer.layerConfig.characterWidth,r=D.renderer.scroller.getBoundingClientRect(),a={x:{left:F-r.left,right:r.right-F},y:{top:I-r.top,bottom:r.bottom-I}},l=b(a.x.left,a.x.right),d=b(a.y.top,a.y.bottom),c={row:t.row,column:t.column};2>=l/o&&(c.column+=a.x.left=d/i&&(c.row+=a.y.top=_&&D.renderer.scrollCursorIntoView(c):P=s:P=null}(p,t)}function S(){l=D.selection.toOrientedRange(),o=D.session.addMarker(l,'ace_selection',D.getSelectionStyle()),D.clearSelection(),D.isFocused()&&D.renderer.$cursorLayer.setBlinking(!1),clearInterval(e),b(),e=setInterval(b,20),n=0,M.addListener(document,'mousemove',y)}function R(){clearInterval(e),D.session.removeMarker(o),o=null,D.$blockScrolling+=1,D.selection.fromOrientedRange(l),D.$blockScrolling-=1,D.isFocused()&&!g&&D.renderer.$cursorLayer.setBlinking(!D.getReadOnly()),l=null,p=null,n=0,P=null,E=null,M.removeListener(document,'mousemove',y)}function y(){null==i&&(i=setTimeout(function(){null!=i&&o&&R()},20))}function w(n){var e=n.types;return!e||Array.prototype.some.call(e,function(t){return'text/plain'==t||'Text'==t})}function B(a){var e=['copy','copymove','all','uninitialized'],t=L.isMac?a.altKey:a.ctrlKey,n='uninitialized';try{n=a.dataTransfer.effectAllowed.toLowerCase()}catch(t){}var r='none';return t&&0<=e.indexOf(n)?r='copy':0<=['move','copymove','linkmove','all','uninitialized'].indexOf(n)?r='move':0<=e.indexOf(n)&&(r='copy'),r}var D=a.editor,t=x.createElement('img');t.src='data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==',L.isOpera&&(t.style.cssText='width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;'),['dragWait','dragWaitEnd','startDrag','dragReadyEnd','onMouseDrag'].forEach(function(e){a[e]=this[e]},this),D.addEventListener('mousedown',this.onMouseDown.bind(a));var r=D.container,n=0,o,F,I,e,l,p,N,g,P,E,O;this.onDragStart=function(n){if(this.cancelDrag||!r.draggable){var e=this;return setTimeout(function(){e.startSelect(),e.captureMouse(n)},0),n.preventDefault()}l=D.getSelectionRange();var a=n.dataTransfer;a.effectAllowed=D.getReadOnly()?'copy':'copyMove',L.isOpera&&(D.container.appendChild(t),t.scrollTop=0),a.setDragImage&&a.setDragImage(t,0,0),L.isOpera&&D.container.removeChild(t),a.clearData(),a.setData('Text',D.session.getTextRange()),g=!0,this.setState('drag')},this.onDragEnd=function(t){if(r.draggable=!1,g=!1,this.setState(null),!D.getReadOnly()){var e=t.dataTransfer.dropEffect;N||'move'!=e||D.session.remove(D.getSelectionRange()),D.renderer.$cursorLayer.setBlinking(!0)}this.editor.unsetStyle('ace_dragging'),this.editor.renderer.setCursorStyle('')},this.onDragEnter=function(t){if(!D.getReadOnly()&&w(t.dataTransfer))return F=t.clientX,I=t.clientY,o||S(),n++,t.dataTransfer.dropEffect=N=B(t),M.preventDefault(t)},this.onDragOver=function(t){if(!D.getReadOnly()&&w(t.dataTransfer))return F=t.clientX,I=t.clientY,o||(S(),n++),null!==i&&(i=null),t.dataTransfer.dropEffect=N=B(t),M.preventDefault(t)},this.onDragLeave=function(t){if(0>=--n&&o)return R(),N=null,M.preventDefault(t)},this.onDrop=function(t){if(p){var e=t.dataTransfer;if(g)'move'===N?l=l.contains(p.row,p.column)?{start:p,end:p}:D.moveText(l,p):'copy'===N?l=D.moveText(l,p,!0):void 0;else{var n=e.getData('Text');l={start:p,end:D.session.insert(p,n)},D.focus(),N=null}return R(),M.preventDefault(t)}},M.addListener(r,'dragstart',this.onDragStart.bind(a)),M.addListener(r,'dragend',this.onDragEnd.bind(a)),M.addListener(r,'dragenter',this.onDragEnter.bind(a)),M.addListener(r,'dragover',this.onDragOver.bind(a)),M.addListener(r,'dragleave',this.onDragLeave.bind(a)),M.addListener(r,'drop',this.onDrop.bind(a));var i=null}function u(r,e,t,n){return a(p(t-r,2)+p(n-e,2))}var x=n('../lib/dom'),M=n('../lib/event'),L=n('../lib/useragent'),_=200,s=200,m=5;(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(){this.editor.renderer.$cursorLayer.setBlinking(!this.editor.getReadOnly()),this.editor.unsetStyle('ace_dragging'),this.editor.renderer.setCursorStyle(''),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var n=this.editor;n.container.draggable=!0,n.renderer.$cursorLayer.setBlinking(!1),n.setStyle('ace_dragging');var e=L.isWin?'default':'move';n.renderer.setCursorStyle(e),this.setState('dragReady')},this.onMouseDrag=function(){var e=this.editor.container;L.isIE&&'dragReady'==this.state&&3 ['+this.end.row+'/'+this.end.column+']'},this.contains=function(n,e){return 0==this.compare(n,e)},this.compareRange=function(a){var e=a.end,n=a.start,r;return 1==(r=this.compare(e.row,e.column))?1==(r=this.compare(n.row,n.column))?2:0==r?1:0:-1==r?-2:-1==(r=this.compare(n.row,n.column))?-1:1==r?42:0},this.comparePoint=function(t){return this.compare(t.row,t.column)},this.containsRange=function(t){return 0==this.comparePoint(t.start)&&0==this.comparePoint(t.end)},this.intersects=function(n){var e=this.compareRange(n);return-1==e||0==e||1==e},this.isEnd=function(n,e){return this.end.row==n&&this.end.column==e},this.isStart=function(n,e){return this.start.row==n&&this.start.column==e},this.setStart=function(n,a){'object'==typeof n?(this.start.column=n.column,this.start.row=n.row):(this.start.row=n,this.start.column=a)},this.setEnd=function(n,a){'object'==typeof n?(this.end.column=n.column,this.end.row=n.row):(this.end.row=n,this.end.column=a)},this.inside=function(n,e){return 0==this.compare(n,e)&&!this.isEnd(n,e)&&!this.isStart(n,e)},this.insideStart=function(n,e){return 0==this.compare(n,e)&&!this.isEnd(n,e)},this.insideEnd=function(n,e){return 0==this.compare(n,e)&&!this.isStart(n,e)},this.compare=function(n,e){return this.isMultiLine()||n!==this.start.row?nthis.end.row?1:this.start.row===n?e>=this.start.column?0:-1:this.end.row===n?e<=this.end.column?0:1:0:ethis.end.column?1:0},this.compareStart=function(n,e){return this.start.row==n&&this.start.column==e?-1:this.compare(n,e)},this.compareEnd=function(n,e){return this.end.row==n&&this.end.column==e?1:this.compare(n,e)},this.compareInside=function(n,e){return this.end.row==n&&this.end.column==e?1:this.start.row==n&&this.start.column==e?-1:this.compare(n,e)},this.clipRows=function(r,i){if(this.end.row>i)var t={row:i+1,column:0};else this.end.rowi)var n={row:i+1,column:0};else this.start.rowe.row||n.row==e.row&&n.column>e.column},this.getRange=function(){var n=this.anchor,e=this.lead;return this.isEmpty()?r.fromPoints(e,e):this.isBackwards()?r.fromPoints(e,n):r.fromPoints(n,e)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit('changeSelection'))},this.selectAll=function(){var t=this.doc.getLength()-1;this.setSelectionAnchor(0,0),this.moveCursorTo(t,this.doc.getLine(t).length)},this.setRange=this.setSelectionRange=function(n,e){e?(this.setSelectionAnchor(n.end.row,n.end.column),this.selectTo(n.start.row,n.start.column)):(this.setSelectionAnchor(n.start.row,n.start.column),this.selectTo(n.end.row,n.end.column)),this.getRange().isEmpty()&&(this.$isEmpty=!0),this.$desiredColumn=null},this.$moveSelection=function(n){var e=this.lead;this.$isEmpty&&this.setSelectionAnchor(e.row,e.column),n.call(this)},this.selectTo=function(n,e){this.$moveSelection(function(){this.moveCursorTo(n,e)})},this.selectToPosition=function(t){this.$moveSelection(function(){this.moveCursorToPosition(t)})},this.moveTo=function(n,e){this.clearSelection(),this.moveCursorTo(n,e)},this.moveToPosition=function(t){this.clearSelection(),this.moveCursorToPosition(t)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(a,e){if(void 0===e){var t=a||this.lead;a=t.row,e=t.column}return this.session.getWordRange(a,e)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var n=this.getCursor(),e=this.session.getAWordRange(n.row,n.column);this.setSelectionRange(e)},this.getLineRange=function(a,s){var t='number'==typeof a?a:this.lead.row,i=this.session.getFoldLine(t),o;return i?(t=i.start.row,o=i.end.row):o=t,!0===s?new r(t,0,o,this.session.getLine(o).length):new r(t,0,o+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(a,e,t){var n=a.column,r=a.column+e;return 0>t&&(n=a.column-e,r=a.column),this.session.isTabStop(a)&&this.doc.getLine(a.row).slice(n,r).split(' ').length-1==e},this.moveCursorLeft=function(){var a=this.lead.getPosition(),t;if(t=this.session.getFoldAt(a.row,a.column,-1))this.moveCursorTo(t.start.row,t.start.column);else if(0===a.column)0=t.length)return this.moveCursorTo(a,t.length),this.moveCursorRight(),void(a=t)return this.moveCursorTo(a,0),this.moveCursorLeft(),void(0e)for(r.lastIndex=0;(o=a[e])&&!r.test(o);)if(r.lastIndex=0,e++,n.test(o)){if(2b){var g=o.substring(b,v-p.length);h.type==l?h.value+=g:(h.type&&a.push(h),h={type:l,value:g})}for(var T=0;T_){for(u>2*o.length&&this.reportError('infinite loop with in ace tokenizer',{startState:y,line:o});bthis.$tokenIndex;){if(this.$row-=1,0>this.$row)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},this.stepForward=function(){var t;for(this.$tokenIndex+=1;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,t||(t=this.$session.getLength()),this.$row>=t)return this.$row=t-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var a=this.$rowTokens,e=this.$tokenIndex,t=a[e].start;if(void 0!==t)return t;for(t=0;0a.length&&(C=a.length):(tthis.row)){var t=function(d,t,n){var c='insert'==d.action,o=(c?1:-1)*(d.end.row-d.start.row),r=(c?1:-1)*(d.end.column-d.start.column),s=d.start,a=c?s:d.end;return e(t,s,n)?{row:t.row,column:t.column}:e(a,t,!n)?{row:t.row+o,column:t.column+(t.row==a.row?r:0)}:{row:s.row,column:s.column}}(a,{row:this.row,column:this.column},this.$insertRight);this.setPosition(t.row,t.column,!0)}},this.setPosition=function(a,r,s){var n;if(n=s?{row:a,column:r}:this.$clipPositionToDocument(a,r),this.row!=n.row||this.column!=n.column){var l={row:this.row,column:this.column};this.row=n.row,this.column=n.column,this._signal('change',{old:l,value:n})}},this.detach=function(){this.document.removeEventListener('change',this.$onChange)},this.attach=function(t){this.document=t||this.document,this.document.on('change',this.$onChange)},this.$clipPositionToDocument=function(a,e){var t={};return a>=this.document.getLength()?(t.row=S(0,this.document.getLength()-1),t.column=this.document.getLine(t.row).length):0>a?(t.row=0,t.column=0):(t.row=a,t.column=b(this.document.getLine(t.row).length,S(0,e))),0>e&&(t.column=0),t}}).call(o.prototype)}),ace.define('ace/document',['require','exports','module','ace/lib/oop','ace/apply_delta','ace/lib/event_emitter','ace/range','ace/anchor'],function(n,e){'use strict';var t=n('./lib/oop'),i=n('./apply_delta').applyDelta,o=n('./lib/event_emitter').EventEmitter,d=n('./range').Range,r=n('./anchor').Anchor,a=function(t){this.$lines=[''],0===t.length?this.$lines=['']:Array.isArray(t)?this.insertMergedLines({row:0,column:0},t):this.insert({row:0,column:0},t)};(function(){t.implement(this,o),this.setValue=function(n){var e=this.getLength()-1;this.remove(new d(0,0,e,this.getLine(e).length)),this.insert({row:0,column:0},n)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(n,e){return new r(this,n,e)},this.$split=0==='aaa'.split(/a/).length?function(t){return t.replace(/\r\n|\r/g,'\n').split('\n')}:function(t){return t.split(/\r\n|\r|\n/)},this.$detectNewLine=function(n){var e=n.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=e?e[1]:'\n',this._signal('changeNewLineMode')},this.getNewLineCharacter=function(){switch(this.$newLineMode){case'windows':return'\r\n';case'unix':return'\n';default:return this.$autoNewLine||'\n';}},this.$autoNewLine='',this.$newLineMode='auto',this.setNewLineMode=function(t){this.$newLineMode!==t&&(this.$newLineMode=t,this._signal('changeNewLineMode'))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(t){return'\r\n'==t||'\r'==t||'\n'==t},this.getLine=function(t){return this.$lines[t]||''},this.getLines=function(n,e){return this.$lines.slice(n,e+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(t){return this.getLinesForRange(t).join(this.getNewLineCharacter())},this.getLinesForRange=function(a){var e;if(a.start.row===a.end.row)e=[this.getLine(a.start.row).substring(a.start.column,a.end.column)];else{(e=this.getLines(a.start.row,a.end.row))[0]=(e[0]||'').substring(a.start.column);var t=e.length-1;a.end.row-a.start.row==t&&(e[t]=e[t].substring(0,a.end.column))}return e},this.insertLines=function(n,e){return console.warn('Use of document.insertLines is deprecated. Use the insertFullLines method instead.'),this.insertFullLines(n,e)},this.removeLines=function(n,e){return console.warn('Use of document.removeLines is deprecated. Use the removeFullLines method instead.'),this.removeFullLines(n,e)},this.insertNewLine=function(t){return console.warn('Use of document.insertNewLine is deprecated. Use insertMergedLines(position, [\'\', \'\']) instead.'),this.insertMergedLines(t,['',''])},this.insert=function(n,e){return 1>=this.getLength()&&this.$detectNewLine(e),this.insertMergedLines(n,this.$split(e))},this.insertInLine=function(a,e){var t=this.clippedPos(a.row,a.column),r=this.pos(a.row,a.column+e.length);return this.applyDelta({start:t,end:r,action:'insert',lines:[e]},!0),this.clonePos(r)},this.clippedPos=function(a,r){var t=this.getLength();void 0===a?a=t:0>a?a=0:a>=t&&(a=t-1,r=void 0);var n=this.getLine(a);return void 0==r&&(r=n.length),{row:a,column:r=b(S(r,0),n.length)}},this.clonePos=function(t){return{row:t.row,column:t.column}},this.pos=function(n,a){return{row:n,column:a}},this.$clipPosition=function(n){var e=this.getLength();return n.row>=e?(n.row=S(0,e-1),n.column=this.getLine(e-1).length):(n.row=S(0,n.row),n.column=b(S(n.column,0),this.getLine(n.row).length)),n},this.insertFullLines=function(a,r){var t=0;(a=b(S(a,0),this.getLength()))=a.lines.length&&!a.lines[0]:!d.comparePoints(a.start,a.end))||(t&&2e4n){d.lines=a,d.start.row=i+r,d.start.column=o;break}a.push(''),this.applyDelta({start:this.pos(i+r,o),end:this.pos(i+s,o=0),action:d.action,lines:a},!0)}},this.revertDelta=function(t){this.applyDelta({start:this.clonePos(t.start),end:this.clonePos(t.end),action:'insert'==t.action?'remove':'insert',lines:t.lines.slice()})},this.indexToPosition=function(a,e){for(var t=this.$lines||this.getAllLines(),n=this.getNewLineCharacter().length,i=e||0,s=t.length;i(a-=t[i].length+n))return{row:i,column:a+t[i].length+n};return{row:s-1,column:t[s-1].length}},this.positionToIndex=function(a,e){for(var t=this.$lines||this.getAllLines(),n=this.getNewLineCharacter().length,i=0,o=b(a.row,t.length),r=e||0;ra+1&&(this.currentLine=a+1)),this.lines[a]=n.tokens}}).call(o.prototype),e.BackgroundTokenizer=o}),ace.define('ace/search_highlight',['require','exports','module','ace/lib/lang','ace/lib/oop','ace/range'],function(n,e){'use strict';var a=n('./lib/lang'),t=(n('./lib/oop'),n('./range').Range),o=function(a,e,t){this.setRegexp(a),this.clazz=e,this.type=t||'text'};(function(){this.MAX_RANGES=500,this.setRegexp=function(t){this.regExp+''!=t+''&&(this.regExp=t,this.cache=[])},this.update=function(o,e,i,n){if(this.regExp)for(var r=n.firstRow,s=n.lastRow,d=r,l;d<=s;d++){l=this.cache[d],null==l&&((l=a.getMatchOffsets(i.getLine(d),this.regExp)).length>this.MAX_RANGES&&(l=l.slice(0,this.MAX_RANGES)),l=l.map(function(n){return new t(d,n.offset,d,n.offset+n.length)}),this.cache[d]=l.length?l:'');for(var c=l.length;c--;)e.drawSingleLineMarker(o,l[c].toScreenRange(i),this.clazz,n)}}}).call(o.prototype),e.SearchHighlight=o}),ace.define('ace/edit_session/fold_line',['require','exports','module','ace/range'],function(n,e){'use strict';function o(r,e){this.foldData=r,Array.isArray(e)?this.folds=e:e=this.folds=[e];var t=e[e.length-1];this.range=new a(e[0].start.row,e[0].start.column,t.end.row,t.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(t){t.setFoldLine(this)},this)}var a=n('../range').Range;(function(){this.shiftRow=function(n){this.start.row+=n,this.end.row+=n,this.folds.forEach(function(e){e.start.row+=n,e.end.row+=n})},this.addFold=function(t){if(t.sameRow){if(t.start.rowthis.endRow)throw new Error('Can\'t add a fold to this FoldLine as it has no connection');this.folds.push(t),this.folds.sort(function(n,e){return-n.range.compareEnd(e.start.row,e.start.column)}),0this.range.compareStart(t.end.row,t.end.column)&&(this.start.row=t.start.row,this.start.column=t.start.column)}else if(t.start.row==this.end.row)this.folds.push(t),this.end.row=t.end.row,this.end.column=t.end.column;else{if(t.end.row!=this.start.row)throw new Error('Trying to add fold to FoldRow that doesn\'t have a matching row');this.folds.unshift(t),this.start.row=t.start.row,this.start.column=t.start.column}t.foldLine=this},this.containsRow=function(t){return t>=this.start.row&&t<=this.end.row},this.walk=function(d,e,t){var n=0,r=this.folds,s=!0,a,i;null==e&&(e=this.end.row,t=this.end.column);for(var o=0;o(a-=n.start.column-e))return{row:n.start.row,column:n.start.column+a};if(0>(a-=n.placeholder.length))return n.start;e=n.end.column}return{row:this.end.row,column:this.end.column+a}}}).call(o.prototype),e.FoldLine=o}),ace.define('ace/range_list',['require','exports','module','ace/range'],function(n,e){'use strict';var d=n('./range').Range.comparePoints,t=function(){this.ranges=[]};(function(){this.comparePoints=d,this.pointIndex=function(i,e,c){for(var n=this.ranges,o=c||0;ot&&(t=-t-1);var r=this.pointIndex(a.end,e,t);return 0>r?r=-r-1:r++,this.ranges.splice(t,r-t,a)},this.addList=function(a){for(var e=[],t=a.length;t--;)e.push.apply(e,this.add(a[t]));return e},this.substractPoint=function(n){var e=this.pointIndex(n);if(0<=e)return this.ranges.splice(e,1)},this.merge=function(){for(var a=[],t=this.ranges,n=(t=t.sort(function(n,e){return d(n.start,e.start)}))[0],o=1,r;oe||(0!=e||r.isEmpty()||n.isEmpty())&&(0>d(r.end,n.end)&&(r.end.row=n.end.row,r.end.column=n.end.column),t.splice(o,1),a.push(n),n=r,o--)}return this.ranges=t,a},this.contains=function(n,a){return 0<=this.pointIndex({row:n,column:a})},this.containsPoint=function(t){return 0<=this.pointIndex(t)},this.rangeAtPoint=function(n){var e=this.pointIndex(n);if(0<=e)return this.ranges[e]},this.clipRows=function(a,l){var d=this.ranges;if(d[0].start.row>l||d[d.length-1].start.rown&&(n=-n-1);var c=this.pointIndex({row:l,column:0},n);0>c&&(c=-c-1);for(var p=[],r=n;rn)break;if(l.start.row==n&&l.start.column>=e.column&&(l.start.column==e.column&&this.$insertRight||(l.start.column+=o,l.start.row+=i)),l.end.row==n&&l.end.column>=e.column){if(l.end.column==e.column&&this.$insertRight)continue;l.end.column==e.column&&0l.start.column&&l.end.column==r[s+1].start.column&&(l.end.column-=o),l.end.column+=o,l.end.row+=i}}if(0!=i&&s=a)return r;if(r.end.row>a)return null}return null},this.getNextFoldLine=function(a,e){var t=this.$foldData,n=0;for(e&&(n=t.indexOf(e)),-1==n&&(n=0);n=a)return r}return null},this.getFoldedRowCount=function(l,e){for(var t=this.$foldData,n=e-l+1,i=0;i=e){s=l?n-=e-s:n=0);break}r>=l&&(n-=s>=l?r-s:r-l+1)}return n},this.$addFoldLine=function(t){return this.$foldData.push(t),this.$foldData.sort(function(n,e){return n.start.row-e.start.row}),t},this.addFold=function(r,e){var t=this.$foldData,i=!1,s;r instanceof o?s=r:(s=new o(e,r)).collapseChildren=e.collapseChildren,this.$clipRangeToDocument(s.range);var _=s.start.row,a=s.start.column,l=s.end.row,c=s.end.column;if(!(_(r=this.getTextRange(e)).length)return;r=r.trim().substring(0,2)+'..'}this.addFold(r,e)}},this.getCommentFoldRange=function(s,e,t){var n=new i(this,s,e),o=n.getCurrentToken(),r=o.type;if(o&&/^comment|string/.test(r)){'comment'==(r=r.match(/comment|string/)[0])&&(r+='|doc-start');var a=new RegExp(r),l=new d;if(1!=t){do o=n.stepBackward();while(o&&a.test(o.type));n.stepForward()}if(l.start.row=n.getCurrentTokenRow(),l.start.column=n.getCurrentTokenColumn()+2,n=new i(this,s,e),-1!=t){var c=-1;do if(o=n.stepForward(),-1==c){var p=this.getState(n.$row);a.test(p)||(c=n.$row)}else if(n.$row>c)break;while(o&&a.test(o.type));o=n.stepBackward()}else o=n.getCurrentToken();return l.end.row=n.getCurrentTokenRow(),l.end.column=n.getCurrentTokenColumn()+o.value.length-2,l}},this.foldAll=function(a,e,t){void 0==t&&(t=1e5);var n=this.foldWidgets;if(n){e=e||this.getLength();for(var i=a=a||0;i=a){i=o.end.row;try{var r=this.addFold('...',o);r&&(r.collapseChildren=t)}catch(t){}}}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle='markbegin',this.setFoldStyle=function(n){if(!this.$foldStyles[n])throw new Error('invalid fold style: '+n+'['+Object.keys(this.$foldStyles).join(', ')+']');if(this.$foldStyle!=n){this.$foldStyle=n,'manual'==n&&this.unfold();var e=this.$foldMode;this.$setFolding(null),this.$setFolding(e)}},this.$setFolding=function(t){this.$foldMode!=t&&(this.$foldMode=t,this.off('change',this.$updateFoldWidgets),this.off('tokenizerUpdate',this.$tokenizerUpdateFoldWidgets),this._signal('changeAnnotation'),t&&'manual'!=this.$foldStyle?(this.foldWidgets=[],this.getFoldWidget=t.getFoldWidget.bind(t,this,this.$foldStyle),this.getFoldWidgetRange=t.getFoldWidgetRange.bind(t,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on('change',this.$updateFoldWidgets),this.on('tokenizerUpdate',this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(a,e){var t=this.foldWidgets;if(!t||e&&t[a])return{};for(var l=a-1,o,d;0<=l;){if(d=t[l],null==d&&(d=t[l]=this.getFoldWidget(l)),'start'==d){var r=this.getFoldWidgetRange(l);if(o||(o=r),r&&r.end.row>=a)break}l--}return{range:-1!=l&&r,firstRange:o}},this.onFoldWidgetClick=function(a,e){var t={children:(e=e.domEvent).shiftKey,all:e.ctrlKey||e.metaKey,siblings:e.altKey};if(!this.$toggleFoldWidget(a,t)){var n=e.target||e.srcElement;n&&/ace_fold-widget/.test(n.className)&&(n.className+=' ace_invalid')}},this.$toggleFoldWidget=function(d,e){if(this.getFoldWidget){var t=this.getFoldWidget(d),n=this.getLine(d),i='end'===t?-1:1,o=this.getFoldAt(d,-1==i?0:n.length,i);if(o)return e.children||e.all?this.removeFold(o):this.expandFold(o),o;var r=this.getFoldWidgetRange(d,!0);if(r&&!r.isMultiLine()&&(o=this.getFoldAt(r.start.row,r.start.column,1))&&r.isEqual(o.range))return this.removeFold(o),o;if(e.siblings){var s=this.getParentFoldRangeData(d);if(s.range)var a=s.range.start.row+1,l=s.range.end.row;this.foldAll(a,l,e.all?1e4:0)}else e.children?(l=r?r.end.row:this.getLength(),this.foldAll(d+1,l,e.all?1e4:0)):r&&(e.all&&(r.collapseChildren=1e4),this.addFold('...',r));return r}},this.toggleFoldWidget=function(){var e=this.selection.getCursor().row;e=this.getRowFoldStart(e);var t=this.$toggleFoldWidget(e,{});if(!t){var a=this.getParentFoldRangeData(e,!0);if(t=a.range||a.firstRange){e=t.start.row;var r=this.getFoldAt(e,this.getLine(e).length,1);r?this.removeFold(r):this.addFold('...',t)}}},this.updateFoldWidgets=function(a){var e=a.start.row,t=a.end.row-e;if(0==t)this.foldWidgets[e]=null;else if('remove'==a.action)this.foldWidgets.splice(e,t+1,null);else{var n=Array(t+1);n.unshift(e,1),this.foldWidgets.splice.apply(this.foldWidgets,n)}},this.tokenizerUpdateFoldWidgets=function(n){var e=n.data;e.first!=e.last&&this.foldWidgets.length>e.first&&this.foldWidgets.splice(e.first,this.foldWidgets.length)}}}),ace.define('ace/edit_session/bracket_match',['require','exports','module','ace/token_iterator','ace/range'],function(n,e){'use strict';var d=n('../token_iterator').TokenIterator,r=n('../range').Range;e.BracketMatch=function(){this.findMatchingBracket=function(a,e){if(0==a.column)return null;var t=e||this.getLine(a.row).charAt(a.column-1);if(''==t)return null;var n=t.match(/([\(\[\{])|([\)\]\}])/);return n?n[1]?this.$findClosingBracket(n[1],a):this.$findOpeningBracket(n[2],a):null},this.getBracketRange=function(o){var e=this.getLine(o.row),n=!0,i=e.charAt(o.column-1),l=i&&i.match(/([\(\[\{])|([\)\]\}])/),d;if(l||(i=e.charAt(o.column),o={row:o.row,column:o.column+1},l=i&&i.match(/([\(\[\{])|([\)\]\}])/),n=!1),!l)return null;if(l[1]){if(!(t=this.$findClosingBracket(l[1],o)))return null;d=r.fromPoints(o,t),n||(d.end.column++,d.start.column--),d.cursor=d.end}else{var t;if(!(t=this.$findOpeningBracket(l[2],o)))return null;d=r.fromPoints(t,o),n||(d.start.column++,d.end.column--),d.cursor=d.start}return d},this.$brackets={")":'(',"(":')',"]":'[',"[":']',"{":'}',"}":'{'},this.$findOpeningBracket=function(i,e,t){var n=this.$brackets[i],o=1,r=new d(this,e.row,e.column),s=r.getCurrentToken();if(s||(s=r.stepForward()),s){t||(t=new RegExp('(\\.?'+s.type.replace('.','\\.').replace('rparen','.paren').replace(/\b(?:end)\b/,'(?:start|begin|end)')+')+'));for(var a=e.column-r.getCurrentTokenColumn()-2,l=s.value;;){for(;0<=a;){var c=l.charAt(a);if(!(c==n))c==i&&(o+=1);else if(0==(o-=1))return{row:r.getCurrentTokenRow(),column:a+r.getCurrentTokenColumn()};a-=1}do s=r.stepBackward();while(s&&!t.test(s.type));if(null==s)break;a=(l=s.value).length-1}return null}},this.$findClosingBracket=function(i,e,t){var n=this.$brackets[i],o=1,r=new d(this,e.row,e.column),s=r.getCurrentToken();if(s||(s=r.stepForward()),s){t||(t=new RegExp('(\\.?'+s.type.replace('.','\\.').replace('lparen','.paren').replace(/\b(?:start|begin)\b/,'(?:start|begin|end)')+')+'));for(var a=e.column-r.getCurrentTokenColumn();;){for(var l=s.value,c=l.length,p;at)&&(4352<=t&&4447>=t||4515<=t&&4519>=t||4602<=t&&4607>=t||9001<=t&&9002>=t||11904<=t&&11929>=t||11931<=t&&12019>=t||12032<=t&&12245>=t||12272<=t&&12283>=t||12288<=t&&12350>=t||12353<=t&&12438>=t||12441<=t&&12543>=t||12549<=t&&12589>=t||12593<=t&&12686>=t||12688<=t&&12730>=t||12736<=t&&12771>=t||12784<=t&&12830>=t||12832<=t&&12871>=t||12880<=t&&13054>=t||13056<=t&&19903>=t||19968<=t&&42124>=t||42128<=t&&42182>=t||43360<=t&&43388>=t||44032<=t&&55203>=t||55216<=t&&55238>=t||55243<=t&&55291>=t||63744<=t&&64255>=t||65040<=t&&65049>=t||65072<=t&&65106>=t||65108<=t&&65126>=t||65128<=t&&65131>=t||65281<=t&&65376>=t||65504<=t&&65510>=t)}p.implement(this,r),this.setDocument=function(t){this.doc&&this.doc.removeListener('change',this.$onChange),this.doc=t,t.on('change',this.$onChange),this.bgTokenizer&&this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},this.getDocument=function(){return this.doc},this.$resetRowCache=function(a){if(!a)return this.$docRowCache=[],void(this.$screenRowCache=[]);var r=this.$docRowCache.length,t=this.$getRowCacheIndex(this.$docRowCache,a)+1;r>t&&(this.$docRowCache.splice(t,r),this.$screenRowCache.splice(t,r))},this.$getRowCacheIndex=function(a,e){for(var t=0,n=a.length-1;t<=n;){var i=t+n>>1,o=a[i];if(e>o)t=i+1;else{if(!(e=e);n++);return(o=t[n])?(o.index=n,o.start=i-o.value.length,o):null},this.setUndoManager=function(n){if(this.$undoManager=n,this.$deltas=[],this.$deltasDoc=[],this.$deltasFold=[],this.$informUndoManager&&this.$informUndoManager.cancel(),n){var e=this;this.$syncInformUndoManager=function(){e.$informUndoManager.cancel(),e.$deltasFold.length&&(e.$deltas.push({group:'fold',deltas:e.$deltasFold}),e.$deltasFold=[]),e.$deltasDoc.length&&(e.$deltas.push({group:'doc',deltas:e.$deltasDoc}),e.$deltasDoc=[]),0n&&(n=e.screenWidth)}),this.lineWidgetWidth=n},this.$computeWidth=function(d){if(this.$modified||d){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var e=this.doc.getAllLines(),t=this.$rowLengthCache,n=0,i=0,o=this.$foldData[i],r=o?o.start.row:1/0,s=e.length,a=0;ar){if((a=o.end.row+1)>=s)break;r=(o=this.$foldData[i++])?o.start.row:1/0}null==t[a]&&(t[a]=this.$getStringScreenWidth(e[a])[0]),t[a]>n&&(n=t[a])}this.screenWidth=n}},this.getLine=function(t){return this.doc.getLine(t)},this.getLines=function(n,e){return this.doc.getLines(n,e)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(t){return this.doc.getTextRange(t||this.selection.getRange())},this.insert=function(n,e){return this.doc.insert(n,e)},this.remove=function(t){return this.doc.remove(t)},this.removeFullLines=function(n,e){return this.doc.removeFullLines(n,e)},this.undoChanges=function(a,e){if(a.length){this.$fromUndo=!0;for(var r=null,n=a.length-1,i;-1!=n;n--)i=a[n],'doc'==i.group?(this.doc.revertDeltas(i.deltas),r=this.$getUndoSelection(i.deltas,!0,r)):i.deltas.forEach(function(t){this.addFolds(t.folds)},this);return this.$fromUndo=!1,r&&this.$undoSelect&&!e&&this.selection.setSelectionRange(r),r}},this.redoChanges=function(a,e){if(a.length){this.$fromUndo=!0;for(var r=null,n=0,i;nd.end.column&&(o.start.column+=l),o.end.row==d.end.row&&o.end.column>d.end.column&&(o.end.column+=l)),r&&o.start.row>=d.end.row&&(o.start.row+=r,o.end.row+=r)}if(o.end=this.insert(o.start,c),i.length){var s=d.start,a=o.start,l=(r=a.row-s.row,a.column-s.column);this.addFolds(i.map(function(t){return(t=t.clone()).start.row==s.row&&(t.start.column+=l),t.end.row==s.row&&(t.end.column+=l),t.start.row+=r,t.end.row+=r,t}))}return o},this.indentRows=function(a,e,t){t=t.replace(/\t/g,this.getTabString());for(var n=a;n<=e;n++)this.doc.insertInLine({row:n,column:0},t)},this.outdentRows=function(a){for(var e=a.collapseRows(),t=new f(0,0,0,0),n=this.getTabSize(),i=e.start.row,o;i<=e.end.row;++i){o=this.getLine(i),t.start.row=i,t.end.row=i;for(var r=0;rt){if(0>(i=this.getRowFoldStart(l+t)))return 0;var n=i-l}else if(0this.doc.getLength()-1)return 0;n=i-e}else l=this.$clipRowToDocument(l),n=(e=this.$clipRowToDocument(e))-l+1;var o=new f(l,0,e,d),r=this.getFoldsInRange(o).map(function(t){return(t=t.clone()).start.row+=n,t.end.row+=n,t}),s=0==t?this.doc.getLines(l,e):this.doc.removeFullLines(l,e);return this.doc.insertFullLines(l+n,s),r.length&&this.addFolds(r),n},this.moveLinesUp=function(n,e){return this.$moveLines(n,e,-1)},this.moveLinesDown=function(n,e){return this.$moveLines(n,e,1)},this.duplicateLines=function(n,e){return this.$moveLines(n,e,0)},this.$clipRowToDocument=function(t){return S(0,b(t,this.doc.getLength()-1))},this.$clipColumnToRow=function(n,e){return 0>e?0:b(this.doc.getLine(n).length,e)},this.$clipPositionToDocument=function(a,r){if(r=S(0,r),0>a)a=0,r=0;else{var o=this.doc.getLength();a>=o?(a=o-1,r=this.doc.getLine(o-1).length):r=b(this.doc.getLine(a).length,r)}return{row:a,column:r}},this.$clipRangeToDocument=function(n){0>n.start.row?(n.start.row=0,n.start.column=0):n.start.column=this.$clipColumnToRow(n.start.row,n.start.column);var e=this.doc.getLength()-1;return n.end.row>e?(n.end.row=e,n.end.column=this.doc.getLine(e).length):n.end.column=this.$clipColumnToRow(n.end.row,n.end.column),n},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(n){if(n!=this.$useWrapMode){if(this.$useWrapMode=n,this.$modified=!0,this.$resetRowCache(0),n){var e=this.getLength();this.$wrapData=Array(e),this.$updateWrapData(0,e-1)}this._signal('changeWrapMode')}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(n,a){this.$wrapLimitRange.min===n&&this.$wrapLimitRange.max===a||(this.$wrapLimitRange={min:n,max:a},this.$modified=!0,this.$useWrapMode&&this._signal('changeWrapMode'))},this.adjustWrapLimit=function(a,e){var r=this.$wrapLimitRange;0>r.max&&(r={min:e,max:e});var n=this.$constrainWrapLimit(a,r.min,r.max);return n!=this.$wrapLimit&&1=i.row&&p.shiftRow(-s);r=o}else{var h=Array(s);h.unshift(o,0);var d=e?this.$wrapData:this.$rowLengthCache;if(d.splice.apply(d,h),l=this.$foldData,c=0,p=this.getFoldLine(o)){var m=p.range.compareInside(n.row,n.column);0==m?(p=p.split(n.row,n.column))&&(p.shiftRow(s),p.addRemoveChars(r,0,i.column-n.column)):-1==m&&(p.addRemoveChars(o,0,i.column-n.column),p.shiftRow(s)),c=l.indexOf(p)+1}for(;c=o&&p.shiftRow(s)}}return e&&this.$wrapData.length!=this.doc.getLength()&&console.error('doc.getLength() and $wrapData.length have to be the same!'),this.$updating=!1,e?this.$updateWrapData(o,r):this.$updateRowLengthCache(o,r),_},this.$updateRowLengthCache=function(n,e){this.$rowLengthCache[n]=null,this.$rowLengthCache[e]=null},this.$updateWrapData=function(t,n){var d=this.doc.getAllLines(),i=this.getTabSize(),a=this.$wrapData,l=this.$wrapLimit,c=t,p,o;for(n=b(n,d.length-1);c<=n;)(o=this.getFoldLine(c,o))?(p=[],o.walk(function(t,n,o,r){var a;if(null!=t){(a=this.$getDisplayTokens(t,p.length))[0]=s;for(var i=1;it-p;)if(g=l+t-p,a[g-1]>=h&&a[g]>=h)f(g);else if(a[g]!=s&&a[g]!=e){for(var _=S(g-(t-(t>>2)),l-1);g>_&&a[g]_&&a[g]_&&9==a[g];)g--}else for(;g>_&&a[g]_?f(++g):(2==a[g=l+t]&&g--,f(g-p))}else{for(;g!=l-1&&a[g]!=s;g--);if(g>l){f(g);continue}for(g=l+t;gr||57r?t.push(9):4352<=r&&m(r)?t.push(1,2):t.push(1);return t},this.$getStringScreenWidth=function(a,e,t){if(0==e)return[0,0];var n,r;for(null==e&&(e=1/0),t=t||0,r=0;re));r++);return[t,r]},this.lineWidgets=null,this.getRowLength=function(n){if(this.lineWidgets)var e=this.lineWidgets[n]&&this.lineWidgets[n].rowCount||0;else e=0;return this.$useWrapMode&&this.$wrapData[n]?this.$wrapData[n].length+1+e:1+e},this.getRowLineCount=function(t){return this.$useWrapMode&&this.$wrapData[t]?this.$wrapData[t].length+1:1},this.getRowWrapIndent=function(a){if(this.$useWrapMode){var e=this.screenToDocumentPosition(a,Number.MAX_VALUE),t=this.$wrapData[e.row];return t.length&&t[0]E)return{row:0,column:0};var t=0,_=0,y=0,s=0,a=this.$screenRowCache,l=this.$getRowCacheIndex(a,E),c=a.length,A,n;if(c&&0<=l){y=a[l],t=this.$docRowCache[l];var i=E>a[c-1]}else i=!c;for(var h=this.getLength()-1,b=this.getNextFoldLine(t),m=b?b.start.row:1/0;y<=E&&!(y+(s=this.getRowLength(t))>E||t>=h);)y+=s,++t>m&&(t=b.end.row+1,m=(b=this.getNextFoldLine(t,b))?b.start.row:1/0),i&&(this.$docRowCache.push(t),this.$screenRowCache.push(y));if(b&&b.start.row<=t)A=this.getFoldDisplayLine(b),t=b.start.row;else{if(y+s<=E||t>h)return{row:h,column:this.getLine(h).length};A=this.getLine(t),b=null}var p=0;if(this.$useWrapMode){var f=this.$wrapData[t];if(f){var g=x(E-y);n=f[g],0=n&&(_=n-1),b?b.idxToPosition(_):{row:t,column:_}},this.documentToScreenPosition=function(E,e){if(void 0===e)var t=this.$clipPositionToDocument(E.row,E.column);else t=this.$clipPositionToDocument(E,e);E=t.row,e=t.column;var n=0,_=null,r;(r=this.getFoldAt(E,e,1))&&(E=r.start.row,e=r.start.column);var i=0,a=this.$docRowCache,l=this.$getRowCacheIndex(a,E),c=a.length,y;if(c&&0<=l){i=a[l],n=this.$screenRowCache[l];var s=E>a[c-1]}else s=!c;for(var h=this.getNextFoldLine(i),d=h?h.start.row:1/0;i=d){if((y=h.end.row+1)>E)break;d=(h=this.getNextFoldLine(y,h))?h.start.row:1/0}else y=i+1;n+=this.getRowLength(i),i=y,s&&(this.$docRowCache.push(i),this.$screenRowCache.push(n))}var m='';h&&i>=d?(m=this.getFoldDisplayLine(h,E,e),_=h.start.row):(m=this.getLine(E).substring(0,e),_=E);var p=0;if(this.$useWrapMode){var f=this.$wrapData[_];if(f){for(var g=0;m.length>=f[g];)n++,g++;m=m.substring(f[g-1]||0,m.length),p=0i&&(n=e.end.row+1,i=(e=this.$foldData[s++])?e.start.row:1/0);else{l=this.getLength();for(var r=this.$foldData,s=0;st);o++);return[n,o]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker()}}.call(u.prototype),n('./edit_session/folding').Folding.call(u.prototype),n('./edit_session/bracket_match').BracketMatch.call(u.prototype),o.defineOptions(u.prototype,'session',{wrap:{set:function(n){if(n&&'off'!=n?'free'==n?n=!0:'printMargin'==n?n=-1:'string'==typeof n&&(n=parseInt(n,10)||!1):n=!1,this.$wrap!=n)if(this.$wrap=n,n){var a='number'==typeof n?n:null;this.setWrapLimitRange(a,a),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?'printMargin':this.getWrapLimitRange().min?this.$wrap:'free':'off'},handlesSet:!0},wrapMethod:{set:function(t){(t='auto'==t?'text'!=this.$mode.type:'text'!=t)!=this.$wrapAsCode&&(this.$wrapAsCode=t,this.$useWrapMode&&(this.$modified=!0,this.$resetRowCache(0),this.$updateWrapData(0,this.getLength()-1)))},initialValue:'auto'},indentedSoftWrap:{initialValue:!0},firstLineNumber:{set:function(){this._signal('changeBreakpoint')},initialValue:1},useWorker:{set:function(t){this.$useWorker=t,this.$stopWorker(),t&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(t){isNaN(t)||this.$tabSize===t||(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=t,this._signal('changeTabSize'))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},overwrite:{set:function(){this._signal('changeOverwrite')},initialValue:!1},newLineMode:{set:function(t){this.doc.setNewLineMode(t)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(t){this.setMode(t)},get:function(){return this.$modeId}}}),e.EditSession=u}),ace.define('ace/search',['require','exports','module','ace/lib/lang','ace/lib/oop','ace/range'],function(n,e){'use strict';var l=n('./lib/lang'),t=n('./lib/oop'),u=n('./range').Range,a=function(){this.$options={}};(function(){this.set=function(n){return t.mixin(this.$options,n),this},this.getOptions=function(){return l.copyObject(this.$options)},this.setOptions=function(t){this.$options=t},this.find=function(a){var r=this.$options,e=this.$matchIterator(a,r);if(!e)return!1;var t=null;return e.forEach(function(a,e,n,o){return t=new u(a,e,n,o),!(e==o&&r.start&&r.start.start&&0!=r.skipCurrent&&t.isEqual(r.start))||(t=null,!1)}),t},this.findAll=function(r){var e=this.$options;if(!e.needle)return[];this.$assembleRegExp(e);var t=e.range,n=t?r.getLines(t.start.row,t.end.row):r.doc.getAllLines(),o=[],i=e.re;if(e.$isMultiLine){var a=i.length,s=n.length-a,c;e:for(var y=i.offset||0;y<=s;y++){for(var h=0;hp||(o.push(c=new u(y,p,y+a-1,f)),2b&&o[h].end.row==t.end.row;)h--;for(o=o.slice(g,h+1),g=0,h=o.length;g=i;e--)if(l(e,Number.MAX_VALUE,t))return;if(0!=p.wrap)for(e=a,i=r.row;e>=i;e--)if(l(e,Number.MAX_VALUE,t))return}};else s=function(t){var e=r.row;if(!l(e,r.column,t)){for(e+=1;e<=a;e++)if(l(e,0,t))return;if(0!=p.wrap)for(e=i,a=r.row;e<=a;e++)if(l(e,0,t))return}};if(p.$isMultiLine)var g=e.length,l=function(n,t,o){var r=m?n-g+1:n;if(!(0>r)){var i=d.getLine(r),a=i.search(e[0]);if((m||!(at))return!!o(r,a,r+g-1,l)||void 0}}};else l=m?function(n,t,i){var o=d.getLine(n),s=[],a=0,l;for(e.lastIndex=0;l=e.exec(o);){var r=l[0].length;if(a=l.index,!r){if(a>=o.length)break;e.lastIndex=a+=1}if(l.index+r>t)break;s.push(l.index,r)}for(var p=s.length-1,u;0<=p;p-=2)if(u=s[p-1],i(n,u,n,u+(r=s[p])))return!0}:function(n,t,i){var o=d.getLine(n),s=t,a;for(e.lastIndex=t;a=e.exec(o);){var r=a[0].length;if(i(n,s=a.index,n,s+r))return!0;if(!r&&(e.lastIndex=s+=1,s>=o.length))return!1}};return{forEach:s}}}).call(a.prototype),e.Search=a}),ace.define('ace/keyboard/hash_handler',['require','exports','module','ace/lib/keys','ace/lib/useragent'],function(n,e){'use strict';function s(n,e){this.platform=e||(i.isMac?'mac':'win'),this.commands={},this.commandKeyBinding={},this.addCommands(n),this.$singleCommand=!0}function a(n,e){s.call(this,n,e),this.$singleCommand=!1}var l=n('../lib/keys'),i=n('../lib/useragent'),d=l.KEY_MODS;a.prototype=s.prototype,function(){function e(t){return'object'==typeof t&&t.bindKey&&t.bindKey.position||(t.isDefault?-100:0)}this.addCommand=function(t){this.commands[t.name]&&this.removeCommand(t),this.commands[t.name]=t,t.bindKey&&this._buildKeyHash(t)},this.removeCommand=function(a,l){var t=a&&('string'==typeof a?a:a.name);a=this.commands[t],l||delete this.commands[t];var n=this.commandKeyBinding;for(var i in n){var o=n[i];if(o==a)delete n[i];else if(Array.isArray(o)){var r=o.indexOf(a);-1!=r&&(o.splice(r,1),1==o.length&&(n[i]=o[0]))}}},this.bindKey=function(a,r,l){if('object'==typeof a&&a&&(void 0==l&&(l=a.position),a=a[this.platform]),a)return'function'==typeof r?this.addCommand({exec:r,bindKey:a,name:r.name||a}):void a.split('|').forEach(function(t){var c='';if(-1!=t.indexOf(' ')){var e=t.split(/\s+/);t=e.pop(),e.forEach(function(a){var e=this.parseKeys(a),t=d[e.hashId]+e.key;c+=(c?' ':'')+t,this._addCommandToBinding(c,'chainKeys')},this),c+=' '}var n=this.parseKeys(t),o=d[n.hashId]+n.key;this._addCommandToBinding(c+o,r,l)},this)},this._addCommandToBinding=function(a,t,l){var d=this.commandKeyBinding,r;if(!t)delete d[a];else if(!d[a]||this.$singleCommand)d[a]=t;else{Array.isArray(d[a])?-1!=(r=d[a].indexOf(t))&&d[a].splice(r,1):d[a]=[d[a]],'number'!=typeof l&&(l=e(t));var o=d[a];for(r=0;rl);r++);o.splice(r,0,t)}},this.addCommands=function(a){a&&Object.keys(a).forEach(function(e){var t=a[e];if(t){if('string'==typeof t)return this.bindKey(t,e);'function'==typeof t&&(t={exec:t}),'object'==typeof t&&(t.name||(t.name=e),this.addCommand(t))}},this)},this.removeCommands=function(n){Object.keys(n).forEach(function(e){this.removeCommand(n[e])},this)},this.bindKeys=function(n){Object.keys(n).forEach(function(e){this.bindKey(e,n[e])},this)},this._buildKeyHash=function(t){this.bindKey(t.bindKey,t)},this.parseKeys=function(i){var e=i.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(t){return t}),t=e.pop(),d=l[t];if(l.FUNCTION_KEYS[d])t=l.FUNCTION_KEYS[d].toLowerCase();else{if(!e.length)return{key:t,hashId:-1};if(1==e.length&&'shift'==e[0])return{key:t.toUpperCase(),hashId:-1}}for(var o=0,c=e.length,s;c--;){if(s=l.KEY_MODS[e[c]],null==s)return'undefined'!=typeof console&&console.error('invalid modifier '+e[c]+' in '+i),!1;o|=s}return{key:t,hashId:o}},this.findKeyCommand=function(a,e){var t=d[a]+e;return this.commandKeyBinding[t]},this.handleKeyboard=function(a,e,t,n){if(!(0>n)){var r=d[e]+t,o=this.commandKeyBinding[r];return a.$keyChain&&(a.$keyChain+=' '+r,o=this.commandKeyBinding[a.$keyChain]||o),o&&('chainKeys'==o||'chainKeys'==o[o.length-1])?(a.$keyChain=a.$keyChain||r,{command:'null'}):(a.$keyChain&&(e&&4!=e||1!=t.length?(-1==e||0o?o+1:o,r.selection.moveCursorTo(t.row,o))},multiSelectAction:'forEach',readOnly:!0},{name:'invertSelection',bindKey:s(null,null),exec:function(a){var e=a.session.doc.getLength()-1,t=a.session.doc.getLine(e).length,n=a.selection.rangeList.ranges,r=[];1>n.length&&(n=[a.selection.getRange()]);for(var o=0;o=r.lastRow||n.end.row<=r.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);}'animate'==t&&this.renderer.animateScrolling(this.curOp.scrollTop)}this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=['backspace','del','insertstring'],this.$historyTracker=function(a){if(this.$mergeUndoDeltas){var e=this.prevOp,t=this.$mergeableCommands,n=e.command&&a.command.name==e.command.name;if('insertstring'==a.command.name){var r=a.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),n=n&&this.mergeNextCommand&&(!/\s/.test(r)||/\s/.test(e.args)),this.mergeNextCommand=!0}else n=n&&-1!==t.indexOf(a.command.name);'always'!=this.$mergeUndoDeltas&&2e3=r);n.stepForward()}if(!i)return e.removeMarker(e.$tagHighlight),void(e.$tagHighlight=null);var a=n.getCurrentTokenRow(),l=n.getCurrentTokenColumn(),c=new v(a,l,a,l+i.value.length),u=e.$backMarkers[e.$tagHighlight];e.$tagHighlight&&void 0!=u&&0!==c.compareRange(u.range)&&(e.removeMarker(e.$tagHighlight),e.$tagHighlight=null),c&&!e.$tagHighlight&&(e.$tagHighlight=e.addMarker(c,'ace_bracket','text'))}}},50)}},this.focus=function(){var t=this;setTimeout(function(){t.textInput.focus()}),this.textInput.focus()},this.isFocused=function(){return this.textInput.isFocused()},this.blur=function(){this.textInput.blur()},this.onFocus=function(t){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit('focus',t))},this.onBlur=function(t){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit('blur',t))},this.$cursorChange=function(){this.renderer.updateCursor()},this.onDocumentChange=function(a){var e=this.session.$useWrapMode,t=a.start.row==a.end.row?a.end.row:1/0;this.renderer.updateLines(a.start.row,t,e),this._signal('change',a),this.$cursorChange(),this.$updateHighlightActiveLine()},this.onTokenizerUpdate=function(n){var e=n.data;this.renderer.updateLines(e.first,e.last)},this.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},this.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},this.onCursorChange=function(){this.$cursorChange(),this.$blockScrolling||(h.warn('Automatically scrolling cursor into view after selection change','this will be disabled in the next version','set editor.$blockScrolling = Infinity to disable this message'),this.renderer.scrollCursorIntoView()),this.$highlightBrackets(),this.$highlightTags(),this.$updateHighlightActiveLine(),this._signal('changeSelection')},this.$updateHighlightActiveLine=function(){var a=this.getSession(),t;if(this.$highlightActiveLine&&('line'==this.$selectionStyle&&this.selection.isMultiLine()||(t=this.getCursorPosition()),!this.renderer.$maxLines||1!==this.session.getLength()||1n.length||2>t.length||!t[1])return this.commands.exec('insertstring',this,s);for(var i=n.length,o;i--;)o=n[i],o.isEmpty()||this.session.remove(o),this.session.insert(o.start,t[i])}},this.execCommand=function(n,e){return this.commands.exec(n,this,e)},this.insert=function(p,e){var m=this.session,n=m.getMode(),i=this.getCursorPosition();if(this.getBehavioursEnabled()&&!e){var o=n.transformAction(m.getState(i.row),'insertion',this,m,p);o&&(p!==o.text&&(this.session.mergeUndoDeltas=!1,this.$mergeNextCommand=!1),p=o.text)}if('\t'==p&&(p=this.session.getTabString()),this.selection.isEmpty())this.session.getOverwrite()&&-1==p.indexOf('\n')&&((r=new v.fromPoints(i,i)).end.column+=p.length,this.session.remove(r));else{var r=this.getSelectionRange();i=this.session.remove(r),this.clearSelection()}if('\n'==p||'\r\n'==p){var s=m.getLine(i.row);if(i.column>s.search(/\S|$/)){var a=s.substr(i.column).search(/\S|$/);m.doc.removeInLine(i.row,i.column,i.column+a)}}this.clearSelection();var l=i.column,c=m.getState(i.row),u=(s=m.getLine(i.row),n.checkOutdent(c,s,p));if(m.insert(i,p),o&&o.selection&&(2==o.selection.length?this.selection.setSelectionRange(new v(i.row,l+o.selection[0],i.row,l+o.selection[1])):this.selection.setSelectionRange(new v(i.row+o.selection[0],o.selection[1],i.row+o.selection[2],o.selection[3]))),m.getDocument().isNewLine(p)){var g=n.getNextLineIndent(c,s.slice(0,i.column),m.getTabString());m.insert({row:i.row+1,column:0},g)}u&&n.autoOutdent(c,m,i.row)},this.onTextInput=function(t){this.keyBinding.onTextInput(t)},this.onCommandKey=function(a,e,t){this.keyBinding.onCommandKey(a,e,t)},this.setOverwrite=function(t){this.session.setOverwrite(t)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(t){this.setOption('scrollSpeed',t)},this.getScrollSpeed=function(){return this.getOption('scrollSpeed')},this.setDragDelay=function(t){this.setOption('dragDelay',t)},this.getDragDelay=function(){return this.getOption('dragDelay')},this.setSelectionStyle=function(t){this.setOption('selectionStyle',t)},this.getSelectionStyle=function(){return this.getOption('selectionStyle')},this.setHighlightActiveLine=function(t){this.setOption('highlightActiveLine',t)},this.getHighlightActiveLine=function(){return this.getOption('highlightActiveLine')},this.setHighlightGutterLine=function(t){this.setOption('highlightGutterLine',t)},this.getHighlightGutterLine=function(){return this.getOption('highlightGutterLine')},this.setHighlightSelectedWord=function(t){this.setOption('highlightSelectedWord',t)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(t){this.renderer.setAnimatedScroll(t)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(t){this.renderer.setShowInvisibles(t)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(t){this.renderer.setDisplayIndentGuides(t)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(t){this.renderer.setShowPrintMargin(t)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(t){this.renderer.setPrintMarginColumn(t)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(t){this.setOption('readOnly',t)},this.getReadOnly=function(){return this.getOption('readOnly')},this.setBehavioursEnabled=function(t){this.setOption('behavioursEnabled',t)},this.getBehavioursEnabled=function(){return this.getOption('behavioursEnabled')},this.setWrapBehavioursEnabled=function(t){this.setOption('wrapBehavioursEnabled',t)},this.getWrapBehavioursEnabled=function(){return this.getOption('wrapBehavioursEnabled')},this.setShowFoldWidgets=function(t){this.setOption('showFoldWidgets',t)},this.getShowFoldWidgets=function(){return this.getOption('showFoldWidgets')},this.setFadeFoldWidgets=function(t){this.setOption('fadeFoldWidgets',t)},this.getFadeFoldWidgets=function(){return this.getOption('fadeFoldWidgets')},this.remove=function(a){this.selection.isEmpty()&&('left'==a?this.selection.selectLeft():this.selection.selectRight());var e=this.getSelectionRange();if(this.getBehavioursEnabled()){var t=this.session,n=t.getState(e.start.row),i=t.getMode().transformAction(n,'deletion',this,t,e);if(0===e.end.column){var o=t.getTextRange(e);if('\n'==o[o.length-1]){var r=t.getLine(e.end.row);/^\s+$/.test(r)&&(e.end.column=r.length)}}i&&(e=i)}this.session.remove(e),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var t=this.getSelectionRange();t.start.column==t.end.column&&t.start.row==t.end.row&&(t.end.column=0,t.end.row++),this.session.remove(t),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var t=this.getCursorPosition();this.insert('\n'),this.moveCursorToPosition(t)},this.transposeLetters=function(){if(this.selection.isEmpty()){var a=this.getCursorPosition(),e=a.column;if(0!==e){var t=this.session.getLine(a.row),r,n;ee.toLowerCase()?1:0});for(var n=new v(0,0,0,0),i=a.first,o;i<=a.last;i++)o=e.getLine(i),n.start.row=i,n.end.row=i,n.end.column=o.length,e.replace(n,t[i-a.first])},this.toggleCommentLines=function(){var n=this.session.getState(this.getCursorPosition().row),e=this.$getSelectedRows();this.session.getMode().toggleCommentLines(n,this.session,e.first,e.last)},this.toggleBlockComment=function(){var a=this.getCursorPosition(),e=this.session.getState(a.row),t=this.getSelectionRange();this.session.getMode().toggleBlockComment(e,this.session,t,a)},this.getNumberAt=function(a,e){var t=/[\-]?[0-9]+(?:\.[0-9]+)?/g;t.lastIndex=0;for(var n=this.session.getLine(a),r;t.lastIndex=e)return{value:r[0],start:r.index,end:r.index+r[0].length};return null},this.modifyNumber=function(d){var e=this.selection.getCursor().row,t=this.selection.getCursor().column,n=new v(e,t-1,e,t),i=this.session.getTextRange(n);if(!isNaN(parseFloat(i))&&isFinite(i)){var o=this.getNumberAt(e,t);if(o){var r=0<=o.value.indexOf('.')?o.start+o.value.indexOf('.')+1:o.end,s=o.start+o.value.length-r,a=parseFloat(o.value);a*=p(10,s),d*=r!==o.end&&td+1)break;d=m.last}for(c--,s=this.session.$moveLines(h,d,e?0:g),e&&-1==g&&(u=c+1);u<=c;)r[u].moveBy(s,0),u++;e||(s=0),a+=s}f.fromOrientedRange(f.ranges[0]),f.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(t){return t=(t||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(t.start.row),last:this.session.getRowFoldEnd(t.end.row)}},this.onCompositionStart=function(){this.renderer.showComposition(this.getCursorPosition())},this.onCompositionUpdate=function(t){this.renderer.setCompositionText(t)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(t){return t>=this.getFirstVisibleRow()&&t<=this.getLastVisibleRow()},this.isRowFullyVisible=function(t){return t>=this.renderer.getFirstFullyVisibleRow()&&t<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(a,e){var t=this.renderer,n=this.renderer.layerConfig,i=a*x(n.height/n.lineHeight);this.$blockScrolling++,!0===e?this.selection.$moveSelection(function(){this.moveCursorBy(i,0)}):!1==e&&(this.selection.moveCursorBy(i,0),this.selection.clearSelection()),this.$blockScrolling--;var o=t.scrollTop;t.scrollBy(0,i*n.lineHeight),null!=e&&t.scrollCursorIntoView(null,.5),t.animateScrolling(o)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(t){this.renderer.scrollToRow(t)},this.scrollToLine=function(a,e,t,n){this.renderer.scrollToLine(a,e,t,n)},this.centerSelection=function(){var n=this.getSelectionRange(),e={row:x(n.start.row+(n.end.row-n.start.row)/2),column:x(n.start.column+(n.end.column-n.start.column)/2)};this.renderer.alignCursor(e,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.$blockScrolling+=1,this.selection.selectAll(),this.$blockScrolling-=1},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(n,e){this.selection.moveCursorTo(n,e)},this.moveCursorToPosition=function(t){this.selection.moveCursorToPosition(t)},this.jumpToMatching=function(m,e){var t=this.getCursorPosition(),n=new C(this.session,t.row,t.column),i=n.getCurrentToken(),o=i||n.stepForward();if(o){var E=!1,_={},c=t.column-o.start,u={")":'(',"(":'(',"]":'[',"[":'[',"{":'{',"}":'{'},h,s;do{if(o.value.match(/[{}()\[\]]/g)){for(;cg(d.column-t.column))&&(a=this.session.getBracketRange(d)));else if('tag'===h){if(!o||-1===o.type.indexOf('tag-name'))return;var p=o.value;if(0===(a=new v(n.getCurrentTokenRow(),n.getCurrentTokenColumn()-2,n.getCurrentTokenRow(),n.getCurrentTokenColumn()-2)).compare(t.row,t.column)){E=!1;do o=i,(i=n.stepBackward())&&(-1!==i.type.indexOf('tag-close')&&a.setEnd(n.getCurrentTokenRow(),n.getCurrentTokenColumn()+1),o.value===p&&-1!==o.type.indexOf('tag-name')&&('<'===i.value?_[p]++:'g(d.column-t.column)&&(d=a.end)}(d=a&&a.cursor||d)&&(m?a&&e?this.selection.setRange(a):a&&a.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(d.row,d.column):this.selection.moveTo(d.row,d.column))}}},this.gotoLine=function(a,e,t){this.selection.clearSelection(),this.session.unfold({row:a-1,column:e||0}),this.$blockScrolling+=1,this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(a-1,e||0),this.$blockScrolling-=1,this.isRowFullyVisible(a-1)||this.scrollToLine(a-1,!0,t)},this.navigateTo=function(n,e){this.selection.moveTo(n,e)},this.navigateUp=function(n){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var a=this.selection.anchor.getPosition();return this.moveCursorToPosition(a)}this.selection.clearSelection(),this.selection.moveCursorBy(-n||-1,0)},this.navigateDown=function(n){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var e=this.selection.anchor.getPosition();return this.moveCursorToPosition(e)}this.selection.clearSelection(),this.selection.moveCursorBy(n||1,0)},this.navigateLeft=function(n){if(this.selection.isEmpty())for(n=n||1;n--;)this.selection.moveCursorLeft();else{var e=this.getSelectionRange().start;this.moveCursorToPosition(e)}this.clearSelection()},this.navigateRight=function(n){if(this.selection.isEmpty())for(n=n||1;n--;)this.selection.moveCursorRight();else{var e=this.getSelectionRange().end;this.moveCursorToPosition(e)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(a,e){e&&this.$search.set(e);var t=this.$search.find(this.session),n=0;return t?(this.$tryReplace(t,a)&&(n=1),null!==t&&(this.selection.setSelectionRange(t),this.renderer.scrollSelectionIntoView(t.start,t.end)),n):n},this.replaceAll=function(a,e){e&&this.$search.set(e);var t=this.$search.findAll(this.session),n=0;if(!t.length)return n;this.$blockScrolling+=1;var i=this.getSelectionRange();this.selection.moveTo(0,0);for(var o=t.length-1;0<=o;--o)this.$tryReplace(t[o],a)&&n++;return this.selection.setSelectionRange(i),this.$blockScrolling-=1,n},this.$tryReplace=function(a,e){var t=this.session.getTextRange(a);return null===(e=this.$search.replace(t,e))?null:(a.end=this.session.replace(a,e),a)},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(a,i,t){i||(i={}),'string'==typeof a||a instanceof RegExp?i.needle=a:'object'==typeof a&&_.mixin(i,a);var n=this.selection.getRange();null==i.needle&&((a=this.session.getTextRange(n)||this.$search.$options.needle)||(n=this.session.getWordRange(n.start.row,n.start.column),a=this.session.getTextRange(n)),this.$search.set({needle:a})),this.$search.set(i),i.start||this.$search.set({start:n});var s=this.$search.find(this.session);return i.preventScroll?s:s?(this.revealRange(s,t),s):(i.backwards?n.start=n.end:n.end=n.start,void this.selection.setRange(n))},this.findNext=function(n,e){this.find({skipCurrent:!0,backwards:!1},n,e)},this.findPrevious=function(n,e){this.find(n,{skipCurrent:!0,backwards:!0},e)},this.revealRange=function(a,e){this.$blockScrolling+=1,this.session.unfold(a),this.selection.setSelectionRange(a),this.$blockScrolling-=1;var t=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(a.start,a.end,.5),!1!==e&&this.renderer.animateScrolling(t)},this.undo=function(){this.$blockScrolling++,this.session.getUndoManager().undo(),this.$blockScrolling--,this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.$blockScrolling++,this.session.getUndoManager().redo(),this.$blockScrolling--,this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy(),this._signal('destroy',this),this.session&&this.session.destroy()},this.setAutoScrollEditorIntoView=function(l){if(l){var d=this,n=!1,i;this.$scrollAnchor||(this.$scrollAnchor=document.createElement('div'));var t=this.$scrollAnchor;t.style.cssText='position:absolute',this.container.insertBefore(t,this.container.firstChild);var o=this.on('changeSelection',function(){n=!0}),r=this.renderer.on('beforeRender',function(){n&&(i=d.renderer.container.getBoundingClientRect())}),s=this.renderer.on('afterRender',function(){if(n&&i&&(d.isFocused()||d.searchBox&&d.searchBox.isFocused())){var o=d.renderer,e=o.$cursorLayer.$pixelPos,r=o.layerConfig,s=e.top-r.offset;null!=(n=0<=e.top&&0>s+i.top||!(e.topwindow.innerHeight)&&null)&&(t.style.top=s+'px',t.style.left=e.left+'px',t.style.height=r.lineHeight+'px',t.scrollIntoView(n)),n=i=null}});this.setAutoScrollEditorIntoView=function(t){t||(delete this.setAutoScrollEditorIntoView,this.off('changeSelection',o),this.renderer.off('afterRender',s),this.renderer.off('beforeRender',r))}}},this.$resetCursorStyle=function(){var n=this.$cursorStyle||'ace',e=this.renderer.$cursorLayer;e&&(e.setSmoothBlinking(/smooth/.test(n)),e.isBlinking=!this.$readOnly&&'wide'!=n,i.setCssClass(e.element,'ace_slim-cursors',/slim/.test(n)))}}.call(f.prototype),h.defineOptions(f.prototype,'editor',{selectionStyle:{set:function(t){this.onSelectionChange(),this._signal('changeSelectionStyle',{data:t})},initialValue:'line'},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(){this.$resetCursorStyle()},initialValue:!1},cursorStyle:{set:function(){this.$resetCursorStyle()},values:['ace','slim','smooth','wide'],initialValue:'ace'},mergeUndoDeltas:{values:[!1,!0,'always'],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},autoScrollEditorIntoView:{set:function(t){this.setAutoScrollEditorIntoView(t)}},keyboardHandler:{set:function(t){this.setKeyboardHandler(t)},get:function(){return this.keybindingId},handlesSet:!0},hScrollBarAlwaysVisible:'renderer',vScrollBarAlwaysVisible:'renderer',highlightGutterLine:'renderer',animatedScroll:'renderer',showInvisibles:'renderer',showPrintMargin:'renderer',printMarginColumn:'renderer',printMargin:'renderer',fadeFoldWidgets:'renderer',showFoldWidgets:'renderer',showLineNumbers:'renderer',showGutter:'renderer',displayIndentGuides:'renderer',fontSize:'renderer',fontFamily:'renderer',maxLines:'renderer',minLines:'renderer',scrollPastEnd:'renderer',fixedWidthGutter:'renderer',theme:'renderer',scrollSpeed:'$mouseHandler',dragDelay:'$mouseHandler',dragEnabled:'$mouseHandler',focusTimout:'$mouseHandler',tooltipFollowsMouse:'$mouseHandler',firstLineNumber:'session',overwrite:'session',newLineMode:'session',useWorker:'session',useSoftTabs:'session',tabSize:'session',wrap:'session',indentedSoftWrap:'session',foldStyle:'session',mode:'session'}),e.Editor=f}),ace.define('ace/undomanager',['require','exports','module'],function(n,e){'use strict';var t=function(){this.reset()};(function(){function e(t){return{action:t.action,start:t.start,end:t.end,lines:1==t.lines.length?null:t.lines,text:1==t.lines.length?t.lines[0]:null}}function t(t){return{action:t.action,start:t.start,end:t.end,lines:t.lines||[t.text]}}function n(l,e){for(var t=Array(l.length),d=0;dthis.dirtyCounter&&(this.dirtyCounter=NaN),this.dirtyCounter++},this.undo=function(a){var e=this.$undoStack.pop(),t=null;return e&&(t=this.$doc.undoChanges(e,a),this.$redoStack.push(e),this.dirtyCounter--),t},this.redo=function(a){var e=this.$redoStack.pop(),t=null;return e&&(t=this.$doc.redoChanges(this.$deserializeDeltas(e),a),this.$undoStack.push(e),this.dirtyCounter++),t},this.reset=function(){this.$undoStack=[],this.$redoStack=[],this.dirtyCounter=0},this.hasUndo=function(){return 0r&&(p=o.end.row+1,r=(o=e.getNextFoldLine(p,o))?o.start.row:1/0),p>n){for(;this.$cells.length>m+1;)d=this.$cells.pop(),this.element.removeChild(d.element);break}(d=this.$cells[++m])||((d={element:null,textNode:null,foldWidget:null}).element=_.createElement('div'),d.textNode=document.createTextNode(''),d.element.appendChild(d.textNode),this.element.appendChild(d.element),this.$cells[m]=d);var f='ace_gutter-cell ';if(a[p]&&(f+=a[p]),l[p]&&(f+=l[p]),this.$annotations[p]&&(f+=this.$annotations[p].className),d.element.className!=f&&(d.element.className=f),(C=e.getRowLength(p)*i.lineHeight+'px')!=d.element.style.height&&(d.element.style.height=C),s){var g=s[p];null==g&&(g=s[p]=e.getFoldWidget(p))}if(g){d.foldWidget||(d.foldWidget=_.createElement('span'),d.element.appendChild(d.foldWidget)),f='ace_fold-widget ace_'+g,f+='start'==g&&p==r&&pt.right-e.right?'foldWidgets':void 0}}).call(o.prototype),e.Gutter=o}),ace.define('ace/layer/marker',['require','exports','module','ace/range','ace/lib/dom'],function(n,e){'use strict';var p=n('../range').Range,t=n('../lib/dom'),a=function(n){this.element=t.createElement('div'),this.element.className='ace_layer ace_marker-layer',n.appendChild(this.element)};(function(){this.$padding=0,this.setPadding=function(t){this.$padding=t},this.setSession=function(t){this.session=t},this.setMarkers=function(t){this.markers=t},this.update=function(a){if(a){this.config=a;var e=[];for(var t in this.markers){var n=this.markers[t];if(n.range){var i=n.range.clipRows(a.firstRow,a.lastRow);if(!i.isEmpty())if(i=i.toScreenRange(this.session),n.renderer){var o=this.$getTop(i.start.row,a),r=this.$padding+i.start.column*a.characterWidth;n.renderer(e,i,r,o,a)}else'fullLine'==n.type?this.drawFullLineMarker(e,i,n.clazz,a):'screenLine'==n.type?this.drawScreenLineMarker(e,i,n.clazz,a):i.isMultiLine()?'text'==n.type?this.drawTextMarker(e,i,n.clazz,a):this.drawMultiLineMarker(e,i,n.clazz,a):this.drawSingleLineMarker(e,i,n.clazz+' ace_start ace_br15',a)}else n.update(e,this,this.session,a)}this.element.innerHTML=e.join('')}},this.$getTop=function(n,e){return(n-e.firstRowScreen)*e.lineHeight},this.drawTextMarker=function(i,e,t,n,o){for(var r=this.session,s=e.start.row,a=e.end.row,l=s,c=0,u=0,g=r.getScreenLastRowColumn(l),d=new p(l,e.start.column,l,u);l<=a;l++)d.start.row=d.end.row=l,d.start.column=l==s?e.start.column:r.getRowWrapIndent(l),d.end.column=g,c=u,u=g,g=l+1g?4:0)|(l==a?8:0)),n,l==a?0:1,o)},this.drawMultiLineMarker=function(d,e,t,n,i){var o=this.$padding,r=n.lineHeight,s=this.$getTop(e.start.row,n),a=o+e.start.column*n.characterWidth;i=i||'',d.push('
                      '),s=this.$getTop(e.end.row,n);var l=e.end.column*n.characterWidth;if(d.push('
                      '),!(0>=(r=(e.end.row-e.start.row-1)*n.lineHeight))){s=this.$getTop(e.start.row+1,n);var c=(e.start.column?1:0)|(e.end.column?0:8);d.push('
                      ')}},this.drawSingleLineMarker=function(d,e,t,n,i,o){var r=n.lineHeight,s=(e.end.column+(i||0)-e.start.column)*n.characterWidth,a=this.$getTop(e.start.row,n),l=this.$padding+e.start.column*n.characterWidth;d.push('
                      ')},this.drawFullLineMarker=function(a,e,t,n,i){var o=this.$getTop(e.start.row,n),r=n.lineHeight;e.start.row!=e.end.row&&(r+=this.$getTop(e.end.row,n)-o),a.push('
                      ')},this.drawScreenLineMarker=function(a,e,t,n,i){var o=this.$getTop(e.start.row,n),r=n.lineHeight;a.push('
                      ')}}).call(a.prototype),e.Marker=a}),ace.define('ace/layer/text',['require','exports','module','ace/lib/oop','ace/lib/dom','ace/lib/lang','ace/lib/useragent','ace/lib/event_emitter'],function(n,e){'use strict';var t=n('../lib/oop'),p=n('../lib/dom'),m=n('../lib/lang'),r=(n('../lib/useragent'),n('../lib/event_emitter').EventEmitter),o=function(t){this.element=p.createElement('div'),this.element.className='ace_layer ace_text-layer',t.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this)};(function(){t.implement(this,r),this.EOF_CHAR='\xB6',this.EOL_CHAR_LF='\xAC',this.EOL_CHAR_CRLF='\xA4',this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR='\u2014',this.SPACE_CHAR='\xB7',this.$padding=0,this.$updateEolChar=function(){var t='\n'==this.session.doc.getNewLineCharacter()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},this.setPadding=function(t){this.$padding=t,this.element.style.padding='0 '+t+'px'},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(t){this.$fontMetrics=t,this.$fontMetrics.on('changeCharacterSize',function(t){this._signal('changeCharacterSize',t)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(t){this.session=t,t&&this.$computeTabString()},this.showInvisibles=!1,this.setShowInvisibles=function(t){return this.showInvisibles!=t&&(this.showInvisibles=t,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(t){return this.displayIndentGuides!=t&&(this.displayIndentGuides=t,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var r=this.session.getTabSize();this.tabSize=r;for(var e=this.$tabStrings=[0],t=1;t'+m.stringRepeat(this.TAB_CHAR,t)+''):e.push(m.stringRepeat(' ',t));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var n='ace_indent-guide',i='',o='';if(this.showInvisibles){n+=' ace_invisible',i=' ace_invisible_space',o=' ace_invisible_tab';var s=m.stringRepeat(this.SPACE_CHAR,this.tabSize),a=m.stringRepeat(this.TAB_CHAR,this.tabSize)}else a=s=m.stringRepeat(' ',this.tabSize);this.$tabStrings[' ']=''+s+'',this.$tabStrings['\t']=''+a+''}},this.updateLines=function(d,e,t){this.config.lastRow==d.lastRow&&this.config.firstRow==d.firstRow||this.scrollLines(d),this.config=d;for(var n=S(e,d.firstRow),i=b(t,d.lastRow),o=this.element.childNodes,r=0,s=d.firstRow;sa&&(s=c.end.row+1,a=(c=this.session.getNextFoldLine(s,c))?c.start.row:1/0),!(s>i);){if(l=o[r++],l){var p=[];this.$renderLine(p,s,!this.$useLineGroups(),s==a&&c),l.style.height=d.lineHeight*this.session.getRowLength(s)+'px',l.innerHTML=p.join('')}s++}},this.scrollLines=function(a){var e=this.config;if(this.config=a,!e||e.lastRowa.lastRow)for(n=this.session.getFoldedRowCount(a.lastRow+1,e.lastRow);0e.lastRow&&(i=this.$renderLinesFragment(a,e.lastRow+1,a.lastRow),r.appendChild(i))},this.$renderLinesFragment=function(o,e,t){for(var n=this.element.ownerDocument.createDocumentFragment(),i=e,r=this.session.getNextFoldLine(i),s=r?r.start.row:1/0;i>s&&(i=r.end.row+1,s=(r=this.session.getNextFoldLine(i,r))?r.start.row:1/0),!(i>t);){var a=p.createElement('div'),l=[];if(this.$renderLine(l,i,!1,i==s&&r),a.innerHTML=l.join(''),this.$useLineGroups())a.className='ace_line_group',n.appendChild(a),a.style.height=o.lineHeight*this.session.getRowLength(i)+'px';else for(;a.firstChild;)n.appendChild(a.firstChild);i++}return n},this.update=function(a){this.config=a;for(var e=[],t=a.firstRow,n=a.lastRow,i=t,o=this.session.getNextFoldLine(i),r=o?o.start.row:1/0;i>r&&(i=o.end.row+1,r=(o=this.session.getNextFoldLine(i,o))?o.start.row:1/0),!(i>n);)this.$useLineGroups()&&e.push('
                      '),this.$renderLine(e,i,!1,i==r&&o),this.$useLineGroups()&&e.push('
                      '),i++;this.element.innerHTML=e.join('')},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(r,d,e,t){var p=this,n=t.replace(/\t|&|<|>|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\u3000\uFEFF\uFFF9-\uFFFC])|[\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]/g,function(t,e,n,a){if(e)return p.showInvisibles?''+m.stringRepeat(p.SPACE_CHAR,t.length)+'':t;if('&'==t)return'&';if('<'==t)return'<';if('>'==t)return'>';if('\t'==t){var r=p.session.getScreenTabSize(d+a);return d+=r-1,p.$tabStrings[r]}if('\u3000'==t){var o=p.showInvisibles?'ace_cjk ace_invisible ace_invisible_space':'ace_cjk',i=p.showInvisibles?p.SPACE_CHAR:'';return d+=1,''+i+''}return n?''+p.SPACE_CHAR+'':(d+=1,''+t+'')});if(this.$textToken[e.type])r.push(n);else{var o='ace_'+e.type.replace(/\./g,' ace_'),a='';'fold'==e.type&&(a=' style=\'width:'+e.value.length*this.config.characterWidth+'px;\' '),r.push('',n,'')}return d+t.length},this.renderIndentGuide=function(a,e,t){var n=e.search(this.$indentGuideRe);return 0>=n||n>=t?e:' '==e[0]?(n-=n%this.tabSize,a.push(m.stringRepeat(this.$tabStrings[' '],n/this.tabSize)),e.substr(n)):'\t'==e[0]?(a.push(m.stringRepeat(this.$tabStrings['\t'],n)),e.substr(n)):e},this.$renderWrappedLine=function(r,e,t,n){for(var i=0,o=0,s=t[0],a=0,l=0;l=s;)a=this.$renderToken(r,a,c,p.substring(0,s-i)),p=p.substring(s-i),i=s,n||r.push('','
                      '),r.push(m.stringRepeat('\xA0',t.indent)),a=0,s=t[++o]||d;0!=p.length&&(i+=p.length,a=this.$renderToken(r,a,c,p))}}},this.$renderSimpleLine=function(a,e){var t=0,n=e[0],i=n.value;this.displayIndentGuides&&(i=this.renderIndentGuide(a,i)),i&&(t=this.$renderToken(a,t,n,i));for(var o=1;o'),i.length){var o=this.session.getRowSplitData(e);o&&o.length?this.$renderWrappedLine(a,i,o,t):this.$renderSimpleLine(a,i)}this.showInvisibles&&(n&&(e=n.end.row),a.push('',e==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,'')),t||a.push('
                      ')},this.$getFoldLineTokens=function(a,e){var l=this.session,d=[],n=l.getTokens(a);return e.walk(function(o,i,t,r,s){null==o?(s&&(n=l.getTokens(i)),n.length&&function(a,e,t){for(var n=0,o=0;o+a[n].value.lengtht-e&&(r=r.substring(0,t-e)),d.push({type:a[n].type,value:r}),o=e+r.length,n+=1);ot?d.push({type:a[n].type,value:r.substring(0,t-o)}):d.push(a[n]),o+=r.length,n+=1}}(n,r,t)):d.push({type:'fold',value:o})},e.end.row,this.session.getLine(e.end.row).length),d},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$measureNode&&this.$measureNode.parentNode.removeChild(this.$measureNode),delete this.$measureNode}}).call(o.prototype),e.Text=o}),ace.define('ace/layer/cursor',['require','exports','module','ace/lib/dom'],function(n,e){'use strict';var a=n('../lib/dom'),t=function(t){this.element=a.createElement('div'),this.element.className='ace_layer ace_cursor-layer',t.appendChild(this.element),void 0==r&&(r=!('opacity'in this.element.style)),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),a.addCssClass(this.element,'ace_hidden-cursors'),this.$updateCursors=(r?this.$updateVisibility:this.$updateOpacity).bind(this)},r;(function(){this.$updateVisibility=function(a){for(var e=this.cursors,t=e.length;t--;)e[t].style.visibility=a?'':'hidden'},this.$updateOpacity=function(a){for(var e=this.cursors,t=e.length;t--;)e[t].style.opacity=a?'':'0'},this.$padding=0,this.setPadding=function(t){this.$padding=t},this.setSession=function(t){this.session=t},this.setBlinking=function(t){t!=this.isBlinking&&(this.isBlinking=t,this.restartTimer())},this.setBlinkInterval=function(t){t!=this.blinkInterval&&(this.blinkInterval=t,this.restartTimer())},this.setSmoothBlinking=function(t){t==this.smoothBlinking||r||(this.smoothBlinking=t,a.setCssClass(this.element,'ace_smooth-blinking',t),this.$updateCursors(!0),this.$updateCursors=this.$updateOpacity.bind(this),this.restartTimer())},this.addCursor=function(){var t=a.createElement('div');return t.className='ace_cursor',this.element.appendChild(t),this.cursors.push(t),t},this.removeCursor=function(){if(1l.height+l.offset||0>o.top)&&1n;)this.removeCursor();var s=this.session.getOverwrite();this.$setOverwrite(s),this.$pixelPos=o,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(t){t!=this.overwrite&&(this.overwrite=t,t?a.addCssClass(this.element,'ace_overwrite-cursors'):a.removeCssClass(this.element,'ace_overwrite-cursors'))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(t.prototype),e.Cursor=t}),ace.define('ace/scrollbar',['require','exports','module','ace/lib/oop','ace/lib/dom','ace/lib/event','ace/lib/event_emitter'],function(n,e){'use strict';var t=n('./lib/oop'),i=n('./lib/dom'),o=n('./lib/event'),r=n('./lib/event_emitter').EventEmitter,s=function(t){this.element=i.createElement('div'),this.element.className='ace_scrollbar ace_scrollbar'+this.classSuffix,this.inner=i.createElement('div'),this.inner.className='ace_scrollbar-inner',this.element.appendChild(this.inner),t.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,o.addListener(this.element,'scroll',this.onScroll.bind(this)),o.addListener(this.element,'mousedown',o.preventDefault)};(function(){t.implement(this,r),this.setVisible=function(t){this.element.style.display=t?'':'none',this.isVisible=t,this.coeff=1}}).call(s.prototype);var a=function(n,e){s.call(this,n),this.scrollTop=0,this.scrollHeight=0,e.$scrollbarWidth=this.width=i.scrollbarWidth(n.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+'px',this.$minWidth=0};t.inherits(a,s),function(){this.classSuffix='-v',this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var t=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-t)/(this.coeff-t)}this._emit('scroll',{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return S(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(t){this.element.style.height=t+'px'},this.setInnerHeight=this.setScrollHeight=function(t){this.scrollHeight=t,32768e?50:100,n.parentNode.removeChild(n)},this.$setMeasureNodeStyles=function(n,e){n.width=n.height='auto',n.left=n.top='0px',n.visibility='hidden',n.position='absolute',n.whiteSpace='pre',8>r.isIE?n['font-family']='inherit':n.font='inherit',n.overflow=e?'hidden':'visible'},this.checkForSizeChanges=function(){var n=this.$measureSizes();if(n&&(this.$characterSize.width!==n.width||this.$characterSize.height!==n.height)){this.$measureNode.style.fontWeight='bold';var a=this.$measureSizes();this.$measureNode.style.fontWeight='',this.$characterSize=n,this.charSizes=Object.create(null),this.allowBoldFonts=a&&a.width===n.width&&a.height===n.height,this._emit('changeCharacterSize',{data:n})}},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer)return this.$pollSizeChangesTimer;var t=this;return this.$pollSizeChangesTimer=setInterval(function(){t.checkForSizeChanges()},500)},this.setPolling=function(t){t?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(){if(50==a){var n=null;try{n=this.$measureNode.getBoundingClientRect()}catch(e){n={width:0,height:0}}var e={height:n.height,width:n.width/a}}else e={height:this.$measureNode.clientHeight,width:this.$measureNode.clientWidth/a};return 0===e.width||0===e.height?null:e},this.$measureCharWidth=function(t){return this.$main.innerHTML=o.stringRepeat(t,a),this.$main.getBoundingClientRect().width/a},this.getCharacterWidth=function(n){var e=this.charSizes[n];return void 0===e&&(e=this.charSizes[n]=this.$measureCharWidth(n)/this.$characterSize.width),e},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)}}).call(l.prototype)}),ace.define('ace/virtual_renderer',['require','exports','module','ace/lib/oop','ace/lib/dom','ace/config','ace/lib/useragent','ace/layer/gutter','ace/layer/marker','ace/layer/text','ace/layer/cursor','ace/scrollbar','ace/scrollbar','ace/renderloop','ace/layer/font_metrics','ace/lib/event_emitter'],function(n,e){'use strict';var t=n('./lib/oop'),E=n('./lib/dom'),o=n('./config'),r=n('./lib/useragent'),s=n('./layer/gutter').Gutter,a=n('./layer/marker').Marker,l=n('./layer/text').Text,c=n('./layer/cursor').Cursor,u=n('./scrollbar').HScrollBar,h=n('./scrollbar').VScrollBar,d=n('./renderloop').RenderLoop,m=n('./layer/font_metrics').FontMetrics,i=n('./lib/event_emitter').EventEmitter;E.importCssString('.ace_editor {position: relative;overflow: hidden;font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'source-code-pro\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;min-width: 100%;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \'\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");}.ace_scrollbar {position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;text-indent: -1em;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: inherit;color: inherit;z-index: 1000;opacity: 1;text-indent: 0;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;}.ace_text-layer {font: inherit !important;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_smooth-blinking .ace_cursor {-webkit-transition: opacity 0.18s;transition: opacity 0.18s;}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;}.ace_line .ace_fold {-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");}.ace_tooltip {background-color: #FFF;background-image: -webkit-linear-gradient(top, transparent, rgba(0, 0, 0, 0.1));background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");}.ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");}.ace_dark .ace_fold-widget.ace_end {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget.ace_closed {background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {-webkit-transition: opacity 0.4s ease 0.05s;transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {-webkit-transition: opacity 0.05s ease 0.05s;transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_text-input-ios {position: absolute !important;top: -100000px !important;left: -100000px !important;}','ace_editor.css');var f=function(p,e){var t=this;this.container=p||E.createElement('div'),this.$keepTextAreaAtCursor=!r.isOldIE,E.addCssClass(this.container,'ace_editor'),this.setTheme(e),this.$gutter=E.createElement('div'),this.$gutter.className='ace_gutter',this.container.appendChild(this.$gutter),this.scroller=E.createElement('div'),this.scroller.className='ace_scroller',this.container.appendChild(this.scroller),this.content=E.createElement('div'),this.content.className='ace_content',this.scroller.appendChild(this.content),this.$gutterLayer=new s(this.$gutter),this.$gutterLayer.on('changeGutterWidth',this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var n=this.$textLayer=new l(this.content);this.canvas=n.element,this.$markerFront=new a(this.content),this.$cursorLayer=new c(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new h(this.container,this),this.scrollBarH=new u(this.container,this),this.scrollBarV.addEventListener('scroll',function(n){t.$scrollAnimation||t.session.setScrollTop(n.data-t.scrollMargin.top)}),this.scrollBarH.addEventListener('scroll',function(n){t.$scrollAnimation||t.session.setScrollLeft(n.data-t.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new m(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.addEventListener('changeCharacterSize',function(n){t.updateCharacterSize(),t.onResize(!0,t.gutterWidth,t.$size.width,t.$size.height),t._signal('changeCharacterSize',n)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),o.resetOptions(this),o._emit('renderer',this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,t.implement(this,i),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle('ace_nobold',!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin()},this.setSession=function(t){this.session&&this.session.doc.off('changeNewLineMode',this.onChangeNewLineMode),this.session=t,t&&this.scrollMargin.top&&0>=t.getScrollTop()&&t.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(t),this.$markerBack.setSession(t),this.$markerFront.setSession(t),this.$gutterLayer.setSession(t),this.$textLayer.setSession(t),t&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on('changeNewLineMode',this.onChangeNewLineMode))},this.updateLines=function(a,r,o){if(void 0===r&&(r=1/0),this.$changedLines?(this.$changedLines.firstRow>a&&(this.$changedLines.firstRow=a),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar()},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(t){t?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(a,e,t,s){if(!(2e||e>a.height-i)n.top=n.left='0';else{var o=this.characterWidth;if(this.$composition){var r=this.textarea.value.replace(/^\x01+/,'');o*=this.session.$getStringScreenWidth(r)[0]+2,i+=2}(t-=this.scrollLeft)>this.$size.scrollerWidth-o&&(t=this.$size.scrollerWidth-o),t+=this.gutterWidth,n.height=i+'px',n.width=o+'px',n.left=b(t,this.$size.scrollerWidth-o)+'px',n.top=b(e,this.$size.height-i)+'px'}}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var n=this.layerConfig,e=n.lastRow;return this.session.documentToScreenRow(e,0)*n.lineHeight-this.session.getScrollTop()>n.height-n.lineHeight?e-1:e},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(t){this.$padding=t,this.$textLayer.setPadding(t),this.$cursorLayer.setPadding(t),this.$markerFront.setPadding(t),this.$markerBack.setPadding(t),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(a,e,t,n){var r=this.scrollMargin;r.top=0|a,r.bottom=0|e,r.right=0|n,r.left=0|t,r.v=r.top+r.bottom,r.h=r.left+r.right,r.top&&0>=this.scrollTop&&this.session&&this.session.setScrollTop(-r.top),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(t){this.setOption('hScrollBarAlwaysVisible',t)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(t){this.setOption('vScrollBarAlwaysVisible',t)},this.$updateScrollBarV=function(){var n=this.layerConfig.maxHeight,e=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(n-=(e-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>n-e&&(n=this.scrollTop+e,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(n+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(a,e){if(this.$changes&&(a|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(a||e)){if(this.$size.$dirty)return this.$changes|=a,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal('beforeRender');var t=this.layerConfig;if(a&this.CHANGE_FULL||a&this.CHANGE_SIZE||a&this.CHANGE_TEXT||a&this.CHANGE_LINES||a&this.CHANGE_SCROLL||a&this.CHANGE_H_SCROLL){if(a|=this.$computeLayerConfig(),t.firstRow!=this.layerConfig.firstRow&&t.firstRowScreen==this.layerConfig.firstRowScreen){var n=this.scrollTop+(t.firstRow-this.layerConfig.firstRow)*this.lineHeight;0=this.scrollLeft?'ace_scroller':'ace_scroller ace_scroll-left'),a&this.CHANGE_FULL)return this.$textLayer.update(t),this.$showGutter&&this.$gutterLayer.update(t),this.$markerBack.update(t),this.$markerFront.update(t),this.$cursorLayer.update(t),this.$moveTextAreaToCursor(),this.$highlightGutterLine&&this.$updateGutterLineHighlight(),void this._signal('afterRender');if(a&this.CHANGE_SCROLL)return a&this.CHANGE_TEXT||a&this.CHANGE_LINES?this.$textLayer.update(t):this.$textLayer.scrollLines(t),this.$showGutter&&this.$gutterLayer.update(t),this.$markerBack.update(t),this.$markerFront.update(t),this.$cursorLayer.update(t),this.$highlightGutterLine&&this.$updateGutterLineHighlight(),this.$moveTextAreaToCursor(),void this._signal('afterRender');a&this.CHANGE_TEXT?(this.$textLayer.update(t),this.$showGutter&&this.$gutterLayer.update(t)):a&this.CHANGE_LINES?(this.$updateLines()||a&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(t):(a&this.CHANGE_TEXT||a&this.CHANGE_GUTTER)&&this.$showGutter&&this.$gutterLayer.update(t),a&this.CHANGE_CURSOR&&(this.$cursorLayer.update(t),this.$moveTextAreaToCursor(),this.$highlightGutterLine&&this.$updateGutterLineHighlight()),a&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(t),a&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(t),this._signal('afterRender')}else this.$changes|=a},this.$autosize=function(){var a=this.session.getScreenLength()*this.lineHeight,e=this.$maxLines*this.lineHeight,t=b(e,S((this.$minLines||1)*this.lineHeight,a))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(t+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&t>this.$maxPixelHeight&&(t=this.$maxPixelHeight);var n=a>e;if(t!=this.desiredHeight||this.$size.height!=this.desiredHeight||n!=this.$vScroll){n!=this.$vScroll&&(this.$vScroll=n,this.scrollBarV.setVisible(n));var r=this.container.clientWidth;this.container.style.height=t+'px',this.$updateCachedSize(!0,this.$gutterWidth,r,t),this.desiredHeight=t,this._signal('autosize')}},this.$computeLayerConfig=function(){var x=this.session,e=this.$size,t=e.height<=2*this.lineHeight,R=this.session.getScreenLength()*this.lineHeight,F=this.$getLongestLine(),w=!t&&(this.$hScrollBarAlwaysVisible||0>e.scrollerWidth-F-2*this.$padding),r=this.$horizScroll!==w;r&&(this.$horizScroll=w,this.scrollBarH.setVisible(w));var s=this.$vScroll;this.$maxLines&&1e.scrollerHeight-R+L||this.scrollTop>u.top),d=s!==h;d&&(this.$vScroll=h,this.scrollBarV.setVisible(h));var m=T(M/this.lineHeight)-1,g=S(0,y((this.scrollTop-a)/this.lineHeight)),B=g+m,D=this.lineHeight,I,N;g=x.screenToDocumentRow(g,0);var f=x.getFoldLine(g);f&&(g=f.start.row),I=x.documentToScreenRow(g,0),N=x.getRowLength(g)*D,B=b(x.screenToDocumentRow(B,0),x.getLength()-1),M=e.scrollerHeight+x.getRowLength(B)*D+N,a=this.scrollTop-I*D;var v=0;return this.layerConfig.width!=F&&(v=this.CHANGE_H_SCROLL),(r||d)&&(v=this.$updateCachedSize(!0,this.gutterWidth,e.width,e.height),this._signal('scrollbarVisibilityChanged'),d&&(F=this.$getLongestLine())),this.layerConfig={width:F,padding:this.$padding,firstRow:g,firstRowScreen:I,lastRow:B,lineHeight:D,characterWidth:this.characterWidth,minHeight:M,maxHeight:R,offset:a,gutterOffset:D?S(0,T((a+e.height-e.scrollerHeight)/D)):0,height:this.$size.scrollerHeight},v},this.$updateLines=function(){if(this.$changedLines){var a=this.$changedLines.firstRow,e=this.$changedLines.lastRow;this.$changedLines=null;var t=this.layerConfig;if(!(a>t.lastRow+1||eo?(e&&a+r>o+this.lineHeight&&(o-=e*this.$size.scrollerHeight),0==o&&(o=-this.scrollMargin.top),this.session.setScrollTop(o)):a+this.$size.scrollerHeight-si?(ie&&this.session.getScrollTop()>=1-this.scrollMargin.top||0n&&this.session.getScrollLeft()>=1-this.scrollMargin.left||0this.$doc.getLength()>>1?this.call('setValue',[this.$doc.getValue()]):this.emit('change',{data:t}))}}).call(n.prototype);var r=function(r,e,t){this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.callbackId=1,this.callbacks={},this.messageBuffer=[];var n=null,i=!1,o=Object.create(p),a=this;this.$worker={},this.$worker.terminate=function(){},this.$worker.postMessage=function(t){a.messageBuffer.push(t),n&&(i?setTimeout(s):s())},this.setEmitSync=function(t){i=t};var s=function(){var t=a.messageBuffer.shift();t.command?n[t.command].apply(n,t.args):t.event&&o._signal(t.event,t.data)};o.postMessage=function(t){a.onMessage({data:t})},o.callback=function(n,a){this.postMessage({type:'call',id:a,data:n})},o.emit=function(n,a){this.postMessage({type:'event',name:n,data:a})},u.loadModule(['worker',e],function(r){for(n=new r[t](o);a.messageBuffer.length;)s()})};r.prototype=n.prototype,e.UIWorkerClient=r,e.WorkerClient=n,e.createWorker=a}),ace.define('ace/placeholder',['require','exports','module','ace/range','ace/lib/event_emitter','ace/lib/oop'],function(n,e){'use strict';var d=n('./range').Range,t=n('./lib/event_emitter').EventEmitter,a=n('./lib/oop'),r=function(l,e,t,n,i,o){var r=this;this.length=e,this.session=l,this.doc=l.getDocument(),this.mainClass=i,this.othersClass=o,this.$onUpdate=this.onUpdate.bind(this),this.doc.on('change',this.$onUpdate),this.$others=n,this.$onCursorChange=function(){setTimeout(function(){r.onCursorChange()})},this.$pos=t;var s=l.getUndoManager().$undoStack||l.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=s.length,this.setup(),l.selection.on('changeCursor',this.$onCursorChange)};(function(){a.implement(this,t),this.setup=function(){var a=this,e=this.doc,t=this.session;this.selectionBefore=t.selection.toJSON(),t.selection.inMultiSelectMode&&t.selection.toSingleRange(),this.pos=e.createAnchor(this.$pos.row,this.$pos.column);var n=this.pos;n.$insertRight=!0,n.detach(),n.markerId=t.addMarker(new d(n.row,n.column,n.row,n.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(t){var n=e.createAnchor(t.row,t.column);n.$insertRight=!0,n.detach(),a.others.push(n)}),t.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var a=this.session,e=this;this.othersActive=!0,this.others.forEach(function(t){t.markerId=a.addMarker(new d(t.row,t.column,t.row,t.column+e.length),e.othersClass,null,!1)})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var t=0;t=this.pos.column&&e.start.column<=this.pos.column+this.length+1,o=e.start.column-this.pos.column;if(this.updateAnchors(i),n&&(this.length+=t),n&&!this.session.$fromUndo)if('insert'===i.action)for(var r=this.others.length-1,s;0<=r;r--)s={row:(a=this.others[r]).row,column:a.column+o},this.doc.insertMergedLines(s,i.lines);else if('remove'===i.action)for(r=this.others.length-1;0<=r;r--){var a;s={row:(a=this.others[r]).row,column:a.column+o},this.doc.remove(new d(s.row,s.column,s.row,s.column-t))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(n){this.pos.onChange(n);for(var e=this.others.length;e--;)this.others[e].onChange(n);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var a=this,e=this.session,t=function(t,n){e.removeMarker(t.markerId),t.markerId=e.addMarker(new d(t.row,t.column,t.row,t.column+a.length),n,null,!1)};t(this.pos,this.mainClass);for(var n=this.others.length;n--;)t(this.others[n],this.othersClass)}},this.onCursorChange=function(n){if(!this.$updating&&this.session){var e=this.session.selection.getCursor();e.row===this.pos.row&&e.column>=this.pos.column&&e.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit('cursorEnter',n)):(this.hideOtherMarkers(),this._emit('cursorLeave',n))}},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.removeEventListener('change',this.$onUpdate),this.session.selection.removeEventListener('changeCursor',this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var a=this.session.getUndoManager(),e=(a.$undoStack||a.$undostack).length-this.$undoStackDepth,t=0;tr&&(r=0),0>c&&(c=0),c==h&&(t=!0);for(var d=c,m;d<=h;d++){if(m=g.fromPoints(this.session.screenToDocumentPosition(d,r),this.session.screenToDocumentPosition(d,s)),m.isEmpty()){if(p&&(u=m.end,l=p,u.row==l.row&&u.column==l.column))break;var p=m.end}m.cursor=i?m.start:m.end,_.push(m)}if(a&&_.reverse(),!t){for(var f=_.length-1;_[f].isEmpty()&&0=y;C--)_[C].isEmpty()&&_.splice(C,1)}return _}}.call(E.prototype);var l=n('./editor').Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(n){n.cursor||(n.cursor=n.end);var e=this.getSelectionStyle();return n.marker=this.session.addMarker(n,'ace_selection',e),this.session.$selectionMarkers.push(n),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,n},this.removeSelectionMarker=function(n){if(n.marker){this.session.removeMarker(n.marker);var e=this.session.$selectionMarkers.indexOf(n);-1!=e&&this.session.$selectionMarkers.splice(e,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(a){for(var e=this.session.$selectionMarkers,t=a.length,n;t--;)if(n=a[t],n.marker){this.session.removeMarker(n.marker);var r=e.indexOf(n);-1!=r&&e.splice(r,1)}this.session.selectionMarkerCount=e.length},this.$onAddRange=function(t){this.addSelectionMarker(t.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(t){this.removeSelectionMarkers(t.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle('ace_multiselect'),this.keyBinding.addKeyboardHandler(a.keyboardHandler),this.commands.setDefaultHandler('exec',this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle('ace_multiselect'),this.keyBinding.removeKeyboardHandler(a.keyboardHandler),this.commands.removeDefaultHandler('exec',this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit('changeSelection'))},this.$onMultiSelectExec=function(a){var e=a.command,t=a.editor;if(t.multiSelect){if(e.multiSelectAction)'forEach'==e.multiSelectAction?n=t.forEachSelection(e,a.args):'forEachLine'==e.multiSelectAction?n=t.forEachSelection(e,a.args,!0):'single'==e.multiSelectAction?(t.exitMultiSelectMode(),n=e.exec(t,a.args||{})):n=e.multiSelectAction(t,a.args||{});else{var n=e.exec(t,a.args||{});t.multiSelect.addRange(t.multiSelect.toOrientedRange()),t.multiSelect.mergeOverlappingRanges()}return n}},this.forEachSelection=function(r,e,t){if(!this.inVirtualSelectionMode){var n=t&&t.keepOrder,o=1==t||t&&t.$byLines,s=this.session,a=this.selection,l=a.rangeList,c=(n?a:l).ranges,u;if(!c.length)return r.exec?r.exec(this,e||{}):r(this,e||{});var i=a._eventRegistry;a._eventRegistry={};var g=new E(s);this.inVirtualSelectionMode=!0;for(var d=c.length;d--;){if(o)for(;0l?r.unshift(r.pop()):r.push(r.shift()),i=n.length;i--;)o=(s=n[i]).clone(),e.replace(s,r[i]),s.start.row=o.start.row,s.start.column=o.start.column},this.selectMore=function(a,e,t){var s=this.session,l=s.multiSelect.toOrientedRange();if(!l.isEmpty()||((l=s.getWordRange(l.start.row,l.start.column)).cursor=-1==a?l.start:l.end,this.multiSelect.addRange(l),!t)){var o=function(a,e,t){return i.$options.wrap=!0,i.$options.needle=e,i.$options.backwards=-1==t,i.find(a)}(s,s.getTextRange(l),a);o&&(o.cursor=-1==a?o.start:o.end,this.$blockScrolling+=1,this.session.unfold(o),this.multiSelect.addRange(o),this.$blockScrolling-=1,this.renderer.scrollCursorIntoView(null,.5)),e&&this.multiSelect.substractPoint(l.cursor)}},this.alignCursors=function(){var l=this.session,E=l.multiSelect,e=E.ranges,t=-1,n=e.filter(function(n){return!(n.cursor.row!=t)||void(t=n.cursor.row)});if(e.length&&n.length!=e.length-1){n.forEach(function(t){E.substractPoint(t.cursor)});var _=0,s=1/0,a=e.map(function(e){var t=e.cursor,n=l.getLine(t.row).substr(t.column).search(/\S/g);return-1==n&&(n=0),t.column>_&&(_=t.column),nr?l.insert(n,o.stringRepeat(' ',i-r)):l.remove(new g(n.row,n.column,n.row,n.column-i+r)),e.start.column=e.end.column=_,e.start.row=e.end.row=n.row,e.cursor=e.end}),E.fromOrientedRange(e[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var r=this.selection.getRange(),i=r.start.row,c=r.end.row,d=i==c;if(d){var u=this.session.getLength(),m;do m=this.session.getLine(c);while(/[=:]/.test(m)&&++ci&&(i=0),c>=u&&(c=u-1)}var p=this.session.removeFullLines(i,c);p=this.$reAlignText(p,d),this.session.insert({row:i,column:0},p.join('\n')+'\n'),d||(r.start.column=0,r.end.column=p[p.length-1].length),this.selection.setRange(r)}},this.$reAlignText=function(l,e){function a(t){return o.stringRepeat(' ',t)}function c(t){return t[2]?a(s)+t[2]+a(n-t[2].length+i)+t[4].replace(/^([=:])\s+/,'$1 '):t[0]}var d=!0,r=!0,s,n,i;return l.map(function(a){var e=a.match(/(\s*)(.*?)(\s*)([=:].*)/);return e?null==s?(s=e[1].length,n=e[2].length,i=e[3].length,e):(s+n+i!=e[1].length+e[2].length+e[3].length&&(r=!1),s!=e[1].length&&(d=!1),s>e[1].length&&(s=e[1].length),ne[3].length&&(i=e[3].length),e):[a]}).map(e?c:d?r?function(t){return t[2]?a(s+n-t[2].length)+t[2]+a(i)+t[4].replace(/^([=:])\s+/,'$1 '):t[0]}:c:function(t){return t[2]?a(s)+t[2]+a(i)+t[4].replace(/^([=:])\s+/,'$1 '):t[0]})}}).call(l.prototype),p.onSessionChange=function(a){var e=a.session;e&&!e.multiSelect&&(e.$selectionMarkers=[],e.selection.$initRangeList(),e.multiSelect=e.selection),this.multiSelect=e&&e.multiSelect;var t=a.oldSession;t&&(t.multiSelect.off('addRange',this.$onAddRange),t.multiSelect.off('removeRange',this.$onRemoveRange),t.multiSelect.off('multiSelect',this.$onMultiSelect),t.multiSelect.off('singleSelect',this.$onSingleSelect),t.multiSelect.lead.off('change',this.$checkMultiselectChange),t.multiSelect.anchor.off('change',this.$checkMultiselectChange)),e&&(e.multiSelect.on('addRange',this.$onAddRange),e.multiSelect.on('removeRange',this.$onRemoveRange),e.multiSelect.on('multiSelect',this.$onMultiSelect),e.multiSelect.on('singleSelect',this.$onSingleSelect),e.multiSelect.lead.on('change',this.$checkMultiselectChange),e.multiSelect.anchor.on('change',this.$checkMultiselectChange)),e&&this.inMultiSelectMode!=e.selection.inMultiSelectMode&&(e.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},p.MultiSelect=m,n('./config').defineOptions(l.prototype,'editor',{enableMultiselect:{set:function(n){m(this),n?(this.on('changeSession',this.$multiselectOnSessionChange),this.on('mousedown',t)):(this.off('changeSession',this.$multiselectOnSessionChange),this.off('mousedown',t))},value:!0},enableBlockSelect:{set:function(t){this.$blockSelectEnabled=t},value:!0}})}),ace.define('ace/mode/folding/fold_mode',['require','exports','module','ace/range'],function(n,e){'use strict';var r=n('../../range').Range,t=e.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(a,e,t){var n=a.getLine(t);return this.foldingStartMarker.test(n)?'start':'markbeginend'==e&&this.foldingStopMarker&&this.foldingStopMarker.test(n)?'end':''},this.getFoldWidgetRange=function(){return null},this.indentationBlock=function(i,e,t){var n=/\S/,o=i.getLine(e),p=o.search(n);if(-1!=p){for(var s=t||o.length,a=i.getLength(),l=e,c=e,u;++el){var m=i.getLine(c).length;return new r(l,s,c,m)}}},this.openingBracketBlock=function(i,e,t,d,o){var c={row:t,column:d+1},s=i.$findClosingBracket(e,c,o);if(s){var a=i.foldWidgets[s.row];return null==a&&(a=i.getFoldWidget(s.row)),'start'==a&&s.row>c.row&&(s.row--,s.column=i.getLine(s.row).length),r.fromPoints(c,s)}},this.closingBracketBlock=function(i,e,t,l){var d={row:t,column:l},s=i.$findOpeningBracket(e,d);if(s)return s.column++,d.column--,r.fromPoints(s,d)}}).call(t.prototype)}),ace.define('ace/theme/textmate',['require','exports','module','ace/lib/dom'],function(n,e){'use strict';e.isDark=!1,e.cssClass='ace-tm',e.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;}',n('../lib/dom').importCssString(e.cssText,e.cssClass)}),ace.define('ace/line_widgets',['require','exports','module','ace/lib/oop','ace/lib/dom','ace/range'],function(n,e){'use strict';function o(t){this.session=t,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on('change',this.updateOnChange),this.session.on('changeFold',this.updateOnFold),this.session.on('changeEditor',this.$onChangeEditor)}n('./lib/oop');var a=n('./lib/dom');n('./range').Range,function(){this.getRowLength=function(n){var e;return e=this.lineWidgets&&this.lineWidgets[n]&&this.lineWidgets[n].rowCount||0,this.$useWrapMode&&this.$wrapData[n]?this.$wrapData[n].length+1+e:1+e},this.$getWidgetScreenLength=function(){var n=0;return this.lineWidgets.forEach(function(e){e&&e.rowCount&&!e.hidden&&(n+=e.rowCount)}),n},this.$onChangeEditor=function(t){this.attach(t.editor)},this.attach=function(t){t&&t.widgetManager&&t.widgetManager!=this&&t.widgetManager.detach(),this.editor!=t&&(this.detach(),this.editor=t,t&&(t.widgetManager=this,t.renderer.on('beforeRender',this.measureWidgets),t.renderer.on('afterRender',this.renderWidgets)))},this.detach=function(){var e=this.editor;if(e){this.editor=null,e.widgetManager=null,e.renderer.off('beforeRender',this.measureWidgets),e.renderer.off('afterRender',this.renderWidgets);var t=this.session.lineWidgets;t&&t.forEach(function(t){t&&t.el&&t.el.parentNode&&(t._inDocument=!1,t.el.parentNode.removeChild(t.el))})}},this.updateOnFold=function(l,e){var t=e.lineWidgets;if(t&&l.action){for(var n=l.data,i=n.start.row,o=n.end.row,r='add'==l.action,s=i+1;s(s-=this.session.getRowLineCount(r.row))&&(s=0),r.rowCount!=s&&(r.rowCount=s,r.row>1,r=t(e,a[o]);if(0r))return o;i=o-1}}return-(n+1)}(n,{row:e,column:-1},l.comparePoints);0>i&&(i=-i-1),i>=n.length?i=0d&&(i=n.length-1);var c=n[i];if(c&&d){if(c.row===e){do c=n[i+=d];while(c&&c.row===e);if(!c)return n.slice()}var p=[];e=c.row;do p[0>d?'unshift':'push'](c),c=n[i+=d];while(c&&c.row==e);return p.length&&p}}}(t,o,e),u;if(s){var c=s[0];n.column=(c.pos&&'number'!=typeof c.column?c.pos.sc:c.column)||0,n.row=c.row,u=r.renderer.$gutterLayer.$annotations[n.row]}else{if(a)return;u={text:['Looks good!'],className:'ace_ok'}}r.session.unfold(n.row),r.selection.moveToPosition(n);var h={row:n.row,fixedWidth:!0,coverGutter:!0,el:i.createElement('div'),type:'errorMarker'},d=h.el.appendChild(i.createElement('div')),m=h.el.appendChild(i.createElement('div'));m.className='error_widget_arrow '+u.className;var p=r.renderer.$cursorLayer.getPixelPosition(n).left;m.style.left=p+r.renderer.gutterWidth-5+'px',h.el.className='error_widget_wrapper',d.className='error_widget '+u.className,d.innerHTML=u.text.join('
                      '),d.appendChild(i.createElement('div'));var f=function(a,e,t){if(0===e&&('esc'===t||'return'===t))return h.destroy(),{command:'null'}};h.destroy=function(){r.$mouseHandler.isMousePressed||(r.keyBinding.removeKeyboardHandler(f),t.widgetManager.removeLineWidget(h),r.off('changeSelection',h.destroy),r.off('changeSession',h.destroy),r.off('mouseup',h.destroy),r.off('change',h.destroy))},r.keyBinding.addKeyboardHandler(f),r.on('changeSelection',h.destroy),r.on('changeSession',h.destroy),r.on('mouseup',h.destroy),r.on('change',h.destroy),r.session.widgetManager.addLineWidget(h),h.el.onmousedown=r.focus.bind(r),r.renderer.scrollCursorIntoView(null,.5,{bottom:h.el.offsetHeight})},i.importCssString(' .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }','')}),ace.define('ace/ace',['require','exports','module','ace/lib/fixoldbrowsers','ace/lib/dom','ace/lib/event','ace/editor','ace/edit_session','ace/undomanager','ace/virtual_renderer','ace/worker/worker_client','ace/keyboard/hash_handler','ace/placeholder','ace/multi_select','ace/mode/folding/fold_mode','ace/theme/textmate','ace/ext/error_marker','ace/config'],function(n,d){'use strict';n('./lib/fixoldbrowsers');var t=n('./lib/dom'),o=n('./lib/event'),r=n('./editor').Editor,i=n('./edit_session').EditSession,a=n('./undomanager').UndoManager,s=n('./virtual_renderer').VirtualRenderer;n('./worker/worker_client'),n('./keyboard/hash_handler'),n('./placeholder'),n('./multi_select'),n('./mode/folding/fold_mode'),n('./theme/textmate'),n('./ext/error_marker'),d.config=n('./config'),d.require=n,d.define=_(0),d.edit=function(c){if('string'==typeof c){var p=c;if(!(c=document.getElementById(p)))throw new Error('ace.edit can\'t find div #'+p)}if(c&&c.env&&c.env.editor instanceof r)return c.env.editor;var n='';if(c&&/input|textarea/i.test(c.tagName)){var i=c;n=i.value,c=t.createElement('pre'),i.parentNode.replaceChild(c,i)}else c&&(n=t.getInnerText(c),c.innerHTML='');var a=d.createEditSession(n),m=new r(new s(c));m.setSession(a);var g={document:a,editor:m,onResize:m.resize.bind(m,null)};return i&&(g.textarea=i),o.addListener(window,'resize',g.onResize),m.on('destroy',function(){o.removeListener(window,'resize',g.onResize),g.editor.container.env=null}),m.container.env=m.env=g,m},d.createEditSession=function(r,e){var t=new i(r,e);return t.setUndoManager(new a),t},d.EditSession=i,d.UndoManager=a,d.version='1.2.8'}),ace.require(['ace/ace'],function(n){for(var e in n&&(n.config.init(!0),n.define=ace.define),window.ace||(window.ace=n),n)n.hasOwnProperty(e)&&(window.ace[e]=n[e])}),ace.define('ace/theme/monokai',['require','exports','module','ace/lib/dom'],function(n,e){e.isDark=!0,e.cssClass='ace-monokai',e.cssText='.ace-monokai .ace_gutter { background: #222; color: #8F908A } .ace-monokai .ace_print-margin { width: 1px; background: #555651 } .ace-monokai { background-color: #222; color: #f9f9f9; font-size: 14px; } .ace-monokai .ace_cursor { color: #F8F8F0 } .ace-monokai .ace_marker-layer .ace_selection { background: #a6e22e } .ace-monokai.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px #272822; } .ace-monokai .ace_marker-layer .ace_step { background: rgb(102, 82, 0) } .ace-monokai .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #a6e22e } .ace-monokai .ace_marker-layer .ace_active-line { background: #2c2c2c } .ace-monokai .ace_gutter-active-line { background-color: #2c2c2c } .ace-monokai .ace_marker-layer .ace_selected-word { border: 1px solid #a6e22e } .ace-monokai .ace_invisible { color: #52524d } .ace-monokai .ace_entity.ace_name.ace_tag, .ace-monokai .ace_keyword, .ace-monokai .ace_meta.ace_tag, .ace-monokai .ace_storage { color: #F0640D } .ace-monokai .ace_punctuation, .ace-monokai .ace_punctuation.ace_tag { color: #fff } .ace-monokai .ace_constant.ace_character, .ace-monokai .ace_constant.ace_other { color: #5db0d7 } .ace-monokai .ace_constant.ace_language { color: #e6db74 } .ace-monokai .ace_constant.ace_numeric { color: #ae81ff } .ace-monokai .ace_invalid { color: #F8F8F0; background-color: #F0640D } .ace-monokai .ace_invalid.ace_deprecated { color: #F8F8F0; background-color: #5db0d7 } .ace-monokai .ace_support.ace_constant, .ace-monokai .ace_support.ace_function { color: #5db0d7 } .ace-monokai .ace_fold { background-color: #A6E22E; border-color: #F8F8F2 } .ace-monokai .ace_storage.ace_type, .ace-monokai .ace_support.ace_class, .ace-monokai .ace_support.ace_type { font-style: italic; color: #5db0d7 } .ace-monokai .ace_entity.ace_name.ace_function, .ace-monokai .ace_entity.ace_other, .ace-monokai .ace_entity.ace_other.ace_attribute-name, .ace-monokai .ace_variable { color: #A6E22E } .ace-monokai .ace_variable.ace_parameter { font-style: italic; color: #FD971F } .ace-monokai .ace_string { color: #E6DB74 } .ace-monokai .ace_comment { color: #75715E } .ace-monokai .ace_indent-guide { background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y }',n('../lib/dom').importCssString(e.cssText,e.cssClass)}),ace.define('ace/ext/searchbox',['require','exports','module','ace/lib/dom','ace/lib/lang','ace/lib/event','ace/keyboard/hash_handler','ace/lib/keys'],function(n,e){'use strict';var d=n('../lib/dom'),i=n('../lib/lang'),p=n('../lib/event'),t=n('../keyboard/hash_handler').HashHandler,r=n('../lib/keys');d.importCssString(' .ace_search { background-color: #ddd; color: #666; border: 1px solid #cbcbcb; border-top: 0 none; overflow: hidden; margin: 0; padding: 4px 6px 0 4px; position: absolute; top: 0; z-index: 99; white-space: normal; } .ace_search.left { border-left: 0 none; border-radius: 0px 0px 5px 0px; left: 0; } .ace_search.right { border-radius: 0px 0px 0px 5px; border-right: 0 none; right: 0; } .ace_search_form, .ace_replace_form { margin: 0 20px 4px 0; overflow: hidden; line-height: 1.9; } .ace_replace_form { margin-right: 0; } .ace_search_form.ace_nomatch { outline: 1px solid red; } .ace_search_field { border-radius: 3px 0 0 3px; background-color: white; color: black; border: 1px solid #cbcbcb; border-right: 0 none; box-sizing: border-box!important; outline: 0; padding: 0; font-size: inherit; margin: 0; line-height: inherit; padding: 0 6px; min-width: 17em; vertical-align: top; } .ace_searchbtn { border: 1px solid #cbcbcb; line-height: inherit; display: inline-block; padding: 0 6px; background: #fff; border-right: 0 none; border-left: 1px solid #dcdcdc; cursor: pointer; margin: 0; position: relative; box-sizing: content-box!important; color: #666; } .ace_searchbtn:last-child { border-radius: 0 3px 3px 0; border-right: 1px solid #cbcbcb; } .ace_searchbtn:disabled { background: none; cursor: default; } .ace_searchbtn:hover { background-color: #eef1f6; } .ace_searchbtn.prev, .ace_searchbtn.next { padding: 0px 0.7em } .ace_searchbtn.prev:after, .ace_searchbtn.next:after { content: ""; border: solid 2px #888; width: 0.5em; height: 0.5em; border-width: 2px 0 0 2px; display:inline-block; transform: rotate(-45deg); } .ace_searchbtn.next:after { border-width: 0 2px 2px 0 ; } .ace_searchbtn_close { background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0; border-radius: 50%; border: 0 none; color: #656565; cursor: pointer; font: 16px/16px Arial; padding: 0; height: 14px; width: 14px; top: 9px; right: 7px; position: absolute; } .ace_searchbtn_close:hover { background-color: #656565; background-position: 50% 100%; color: white; } .ace_button { margin-left: 2px; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -o-user-select: none; -ms-user-select: none; user-select: none; overflow: hidden; opacity: 0.7; border: 1px solid rgba(100,100,100,0.23); padding: 1px; box-sizing: border-box!important; color: black; } .ace_button:hover { background-color: #eee; opacity:1; } .ace_button:active { background-color: #ddd; } .ace_button.checked { border-color: #3399ff; opacity:1; } .ace_search_options{ margin-bottom: 3px; text-align: right; -webkit-user-select: none; -moz-user-select: none; -o-user-select: none; -ms-user-select: none; user-select: none; clear: both; } .ace_search_counter { float: left; font-family: arial; padding: 0 8px; }','ace_searchbox');var a=''.replace(/> +/g,'>'),o=function(t){var e=d.createElement('div');e.innerHTML=a,this.element=e.firstChild,this.setSession=this.setSession.bind(this),this.$init(),this.setEditor(t)};(function(){this.setEditor=function(t){t.searchBox=this,t.renderer.scroller.appendChild(this.element),this.editor=t},this.setSession=function(){this.searchRange=null,this.$syncOptions(!0)},this.$initElements=function(t){this.searchBox=t.querySelector('.ace_search_form'),this.replaceBox=t.querySelector('.ace_replace_form'),this.searchOption=t.querySelector('[action=searchInSelection]'),this.replaceOption=t.querySelector('[action=toggleReplace]'),this.regExpOption=t.querySelector('[action=toggleRegexpMode]'),this.caseSensitiveOption=t.querySelector('[action=toggleCaseSensitive]'),this.wholeWordOption=t.querySelector('[action=toggleWholeWords]'),this.searchInput=this.searchBox.querySelector('.ace_search_field'),this.replaceInput=this.replaceBox.querySelector('.ace_search_field'),this.searchCounter=t.querySelector('.ace_search_counter')},this.$init=function(){var n=this.element;this.$initElements(n);var a=this;p.addListener(n,'mousedown',function(t){setTimeout(function(){a.activeInput.focus()},0),p.stopPropagation(t)}),p.addListener(n,'click',function(t){var e=(t.target||t.srcElement).getAttribute('action');e&&a[e]?a[e]():a.$searchBarKb.commands[e]&&a.$searchBarKb.commands[e].exec(a),p.stopPropagation(t)}),p.addCommandKeyListener(n,function(t,e,n){var i=r.keyCodeToString(n),o=a.$searchBarKb.findKeyCommand(e,i);o&&o.exec&&(o.exec(a),p.stopEvent(t))}),this.$onChange=i.delayedCall(function(){a.find(!1,!1)}),p.addListener(this.searchInput,'input',function(){a.$onChange.schedule(20)}),p.addListener(this.searchInput,'focus',function(){a.activeInput=a.searchInput,a.searchInput.value&&a.highlight()}),p.addListener(this.replaceInput,'focus',function(){a.activeInput=a.replaceInput,a.searchInput.value&&a.highlight()})},this.$closeSearchBarKb=new t([{bindKey:'Esc',name:'closeSearchBar',exec:function(t){t.searchBox.hide()}}]),this.$searchBarKb=new t,this.$searchBarKb.bindKeys({"Ctrl-f|Command-f":function(n){var e=n.isReplace=!n.isReplace;n.replaceBox.style.display=e?'':'none',n.replaceOption.checked=!1,n.$syncOptions(),n.searchInput.focus()},"Ctrl-H|Command-Option-F":function(t){t.replaceOption.checked=!0,t.$syncOptions(),t.replaceInput.focus()},"Ctrl-G|Command-G":function(t){t.findNext()},"Ctrl-Shift-G|Command-Shift-G":function(t){t.findPrev()},esc:function(t){setTimeout(function(){t.hide()})},Return:function(t){t.activeInput==t.replaceInput&&t.replace(),t.findNext()},"Shift-Return":function(t){t.activeInput==t.replaceInput&&t.replace(),t.findPrev()},"Alt-Return":function(t){t.activeInput==t.replaceInput&&t.replaceAll(),t.findAll()},Tab:function(t){(t.activeInput==t.replaceInput?t.searchInput:t.replaceInput).focus()}}),this.$searchBarKb.addCommands([{name:'toggleRegexpMode',bindKey:{win:'Alt-R|Alt-/',mac:'Ctrl-Alt-R|Ctrl-Alt-/'},exec:function(t){t.regExpOption.checked=!t.regExpOption.checked,t.$syncOptions()}},{name:'toggleCaseSensitive',bindKey:{win:'Alt-C|Alt-I',mac:'Ctrl-Alt-R|Ctrl-Alt-I'},exec:function(t){t.caseSensitiveOption.checked=!t.caseSensitiveOption.checked,t.$syncOptions()}},{name:'toggleWholeWords',bindKey:{win:'Alt-B|Alt-W',mac:'Ctrl-Alt-B|Ctrl-Alt-W'},exec:function(t){t.wholeWordOption.checked=!t.wholeWordOption.checked,t.$syncOptions()}},{name:'toggleReplace',exec:function(t){t.replaceOption.checked=!t.replaceOption.checked,t.$syncOptions()}},{name:'searchInSelection',exec:function(t){t.searchOption.checked=!t.searchRange,t.setSearchRange(t.searchOption.checked&&t.editor.getSelectionRange()),t.$syncOptions()}}]),this.setSearchRange=function(t){this.searchRange=t,t?this.searchRangeMarker=this.editor.session.addMarker(t,'ace_active-line'):this.searchRangeMarker&&(this.editor.session.removeMarker(this.searchRangeMarker),this.searchRangeMarker=null)},this.$syncOptions=function(t){d.setCssClass(this.replaceOption,'checked',this.searchRange),d.setCssClass(this.searchOption,'checked',this.searchOption.checked),this.replaceOption.textContent=this.replaceOption.checked?'-':'+',d.setCssClass(this.regExpOption,'checked',this.regExpOption.checked),d.setCssClass(this.wholeWordOption,'checked',this.wholeWordOption.checked),d.setCssClass(this.caseSensitiveOption,'checked',this.caseSensitiveOption.checked),this.replaceBox.style.display=this.replaceOption.checked?'':'none',this.find(!1,!1,t)},this.highlight=function(t){this.editor.session.highlight(t||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},this.find=function(a,r,i){var s=!this.editor.find(this.searchInput.value,{skipCurrent:a,backwards:r,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked,preventScroll:i,range:this.searchRange})&&this.searchInput.value;d.setCssClass(this.searchBox,'ace_nomatch',s),this.editor._emit('findSearchBox',{match:!s}),this.highlight(),this.updateCounter()},this.updateCounter=function(){var l=this.editor,e=l.$search.$options.re,t=0,n=0;if(e){var i=this.searchRange?l.session.getTextRange(this.searchRange):l.getValue(),o=l.session.doc.positionToIndex(l.selection.anchor);this.searchRange&&(o-=l.session.doc.positionToIndex(this.searchRange.start));for(var r=e.lastIndex=0,a;(a=e.exec(i))&&(t++,(r=a.index)<=o&&n++,!(999=i.length))););}this.searchCounter.textContent=n+' of '+(999>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/},{token:'punctuation.operator',regex:'\\?|\\:|\\,|\\;|\\.'},{token:'paren.lparen',regex:'[[({]'},{token:'paren.rparen',regex:'[\\])}]'},{token:'text',regex:'\\s+'}],comment:[{token:'comment',regex:'\\*\\/',next:'start'},{defaultToken:'comment'}],singleLineComment:[{token:'comment',regex:/\\$/,next:'singleLineComment'},{token:'comment',regex:/$/,next:'start'},{defaultToken:'comment'}],directive:[{token:'constant.other.multiline',regex:/\\/},{token:'constant.other.multiline',regex:/.*\\/},{token:'constant.other',regex:'\\s*<.+?>',next:'start'},{token:'constant.other',regex:'\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]',next:'start'},{token:'constant.other',regex:'\\s*[\'](?:(?:\\\\.)|(?:[^\'\\\\]))*?[\']',next:'start'},{token:'constant.other',regex:/[^\\\/]+/,next:'start'}]},this.embedRules(i,'doc-',[i.getEndRule('start')]),this.normalizeRules()};t.inherits(l,o),e.c_cppHighlightRules=l}),ace.define('ace/mode/matching_brace_outdent',['require','exports','module','ace/range'],function(n,e){'use strict';var a=n('../range').Range,t=function(){};(function(){this.checkOutdent=function(n,e){return!!/^\s+$/.test(n)&&/^\s*\}/.test(e)},this.autoOutdent=function(i,e){var l=i.getLine(e).match(/^(\s*\})/);if(!l)return 0;var d=l[1].length,c=i.findMatchingBracket({row:e,column:d});if(!c||c.row==e)return 0;var p=this.$getIndent(i.getLine(c.row));i.replace(new a(e,0,e,d-1),p)},this.$getIndent=function(t){return t.match(/^\s*/)[0]}}).call(t.prototype),e.MatchingBraceOutdent=t}),ace.define('ace/mode/folding/cstyle',['require','exports','module','ace/lib/oop','ace/range','ace/mode/folding/fold_mode'],function(n,e){'use strict';var t=n('../../lib/oop'),d=n('../../range').Range,a=n('./fold_mode').FoldMode,r=e.FoldMode=function(t){t&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,'|'+t.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,'|'+t.end)))};t.inherits(r,a),function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(a,e,t){var n=a.getLine(t);if(this.singleLineBlockCommentRe.test(n)&&!this.startRegionRe.test(n)&&!this.tripleStarBlockCommentRe.test(n))return'';var r=this._getFoldWidgetBase(a,e,t);return!r&&this.startRegionRe.test(n)?'start':r},this.getFoldWidgetRange=function(l,e,t,n){var i=l.getLine(t),r;if(this.startRegionRe.test(i))return this.getCommentRegionBlock(l,i,t);if(r=i.match(this.foldingStartMarker)){var o=r.index;if(r[1])return this.openingBracketBlock(l,r[1],t,o);var s=l.getCommentFoldRange(t,o+r[0].length,1);return s&&!s.isMultiLine()&&(n?s=this.getSectionRange(l,t):'all'!=e&&(s=null)),s}return'markbegin'!==e&&(r=i.match(this.foldingStopMarker))?(o=r.index+r[0].length,r[1]?this.closingBracketBlock(l,r[1],t,o):l.getCommentFoldRange(t,o,-1)):void 0},this.getSectionRange=function(o,e){for(var t=o.getLine(e),n=t.search(/\S/),i=e,r=t.length,s=e+=1,a=o.getLength(),l;++el)break;var c=this.getFoldWidgetRange(o,'all',e);if(c){if(c.start.row<=i)break;if(c.isMultiLine())e=c.end.row;else if(n==l)break}s=e}return new d(i,r,s,o.getLine(s).length)},this.getCommentRegionBlock=function(o,e,t){for(var n=e.search(/\s*$/),i=o.getLength(),r=t,s=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,a=1;++tr)return new d(r,n,t,e.length)}}.call(r.prototype)}),ace.define('ace/mode/c_cpp',['require','exports','module','ace/lib/oop','ace/mode/text','ace/mode/c_cpp_highlight_rules','ace/mode/matching_brace_outdent','ace/range','ace/mode/behaviour/cstyle','ace/mode/folding/cstyle'],function(n,e){'use strict';var t=n('../lib/oop'),i=n('./text').Mode,o=n('./c_cpp_highlight_rules').c_cppHighlightRules,r=n('./matching_brace_outdent').MatchingBraceOutdent,s=(n('../range').Range,n('./behaviour/cstyle').CstyleBehaviour),a=n('./folding/cstyle').FoldMode,l=function(){this.HighlightRules=o,this.$outdent=new r,this.$behaviour=new s,this.foldingRules=new a};t.inherits(l,i),function(){this.lineCommentStart='//',this.blockComment={start:'/*',end:'*/'},this.getNextLineIndent=function(l,e,t){var n=this.$getIndent(e),i=this.getTokenizer().getLineTokens(e,l),o=i.tokens,r=i.state;if(o.length&&'comment'==o[o.length-1].type)return n;if('start'==l)(s=e.match(/^.*[\{\(\[]\s*$/))&&(n+=t);else if('doc-start'==l){if('start'==r)return'';var s;(s=e.match(/^\s*(\/?)\*/))&&(s[1]&&(n+=' '),n+='* ')}return n},this.checkOutdent=function(a,e,t){return this.$outdent.checkOutdent(e,t)},this.autoOutdent=function(a,e,t){this.$outdent.autoOutdent(e,t)},this.$id='ace/mode/c_cpp'}.call(l.prototype),e.Mode=l}),ace.define('ace/mode/glsl_highlight_rules',['require','exports','module','ace/lib/oop','ace/mode/c_cpp_highlight_rules'],function(n,e){'use strict';var t=n('../lib/oop'),a=n('./c_cpp_highlight_rules').c_cppHighlightRules,o=function(){var n=this.createKeywordMapper({"variable.language":'this',keyword:'layout|attribute|const|uniform|varying|break|continue|do|for|while|if|else|in|out|inout|float|int|void|bool|true|false|lowp|mediump|highp|precision|invariant|discard|return|mat2|mat3|mat4|vec2|vec3|vec4|ivec2|ivec3|ivec4|bvec2|bvec3|bvec4|sampler2D|samplerCube|struct',"constant.language":'radians|degrees|sin|cos|tan|asin|acos|atan|pow|exp|log|exp2|log2|sqrt|inversesqrt|abs|sign|floor|ceil|fract|mod|min|max|clamp|mix|step|smoothstep|length|distance|dot|cross|normalize|faceforward|reflect|refract|matrixCompMult|lessThan|lessThanEqual|greaterThan|greaterThanEqual|equal|notEqual|any|all|not|dFdx|dFdy|fwidth|texture2D|texture2DProj|texture2DLod|texture2DProjLod|textureCube|textureCubeLod|gl_MaxVertexAttribs|gl_MaxVertexUniformVectors|gl_MaxVaryingVectors|gl_MaxVertexTextureImageUnits|gl_MaxCombinedTextureImageUnits|gl_MaxTextureImageUnits|gl_MaxFragmentUniformVectors|gl_MaxDrawBuffers|gl_DepthRangeParameters|gl_DepthRange|gl_Position|gl_PointSize|gl_FragCoord|gl_FrontFacing|gl_PointCoord|gl_FragColor|gl_FragData'},'identifier');this.$rules=new a().$rules,this.$rules.start.forEach(function(e){'function'==typeof e.token&&(e.token=n)})};t.inherits(o,a),e.glslHighlightRules=o}),ace.define('ace/mode/glsl',['require','exports','module','ace/lib/oop','ace/mode/c_cpp','ace/mode/glsl_highlight_rules','ace/mode/matching_brace_outdent','ace/range','ace/mode/behaviour/cstyle','ace/mode/folding/cstyle'],function(n,e){'use strict';var t=n('../lib/oop'),i=n('./c_cpp').Mode,o=n('./glsl_highlight_rules').glslHighlightRules,r=n('./matching_brace_outdent').MatchingBraceOutdent,s=(n('../range').Range,n('./behaviour/cstyle').CstyleBehaviour),a=n('./folding/cstyle').FoldMode,l=function(){this.HighlightRules=o,this.$outdent=new r,this.$behaviour=new s,this.foldingRules=new a};t.inherits(l,i),function(){this.$id='ace/mode/glsl'}.call(l.prototype),e.Mode=l}),r.exports=ace},function(t){var e=function(){return this}();try{e=e||Function('return this')()||(0,eval)('this')}catch(t){'object'==typeof window&&(e=window)}t.exports=e},function(a,e,t){(function(e){var d='undefined'==typeof window?'undefined'!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{}:window,t=function(){var n=/\blang(?:uage)?-(\w+)\b/i,a=0,x=d.Prism={manual:d.Prism&&d.Prism.manual,util:{encode:function(t){return t instanceof i?new i(t.type,x.util.encode(t.content),t.alias):'Array'===x.util.type(t)?t.map(x.util.encode):t.replace(/&/g,'&').replace(/i.length)break e;if(!(C instanceof t)){l.lastIndex=0;var E=1;if(!(w=l.exec(C))&&h&&f!=n.length-1){if(l.lastIndex=g,!(w=l.exec(i)))break;for(var A=w.index+(u?w[1].length:0),v=w.index+w[0].length,_=f,F=g,b=n.length;b>_&&v>F;++_)A>=(F+=n[_].length)&&(++f,g=F);if(n[f]instanceof t||n[_-1].greedy)continue;E=_-f,C=i.slice(g,F),w.index-=g}if(w){u&&(d=w[1].length),v=(A=w.index+d)+(w=w[0].slice(d)).length;var S=C.slice(0,A),T=C.slice(v),y=[f,E],w;S&&y.push(S);var R=new t(r,c?x.tokenize(w,c):w,m,w,h);y.push(R),T&&y.push(T),Array.prototype.splice.apply(n,y)}}}}}return n},hooks:{all:{},add:function(a,e){var t=x.hooks.all;t[a]=t[a]||[],t[a].push(e)},run:function(a,e){var t=x.hooks.all[a];if(t&&t.length)for(var n=0,r;r=t[n++];)r(e)}}},i=x.Token=function(a,e,t,n,r){this.type=a,this.content=e,this.alias=t,this.length=0|(n||'').length,this.greedy=!!r};if(i.stringify=function(o,l,d){if('string'==typeof o)return o;if('Array'===x.util.type(o))return o.map(function(e){return i.stringify(e,l,o)}).join('');var c={type:o.type,content:i.stringify(o.content,l,d),tag:'span',classes:['token',o.type],attributes:{},language:l,parent:d};if('comment'==c.type&&(c.attributes.spellcheck='true'),o.alias){var r='Array'===x.util.type(o.alias)?o.alias:[o.alias];Array.prototype.push.apply(c.classes,r)}x.hooks.run('wrap',c);var s=Object.keys(c.attributes).map(function(t){return t+'="'+(c.attributes[t]||'').replace(/"/g,'"')+'"'}).join(' ');return'<'+c.tag+' class="'+c.classes.join(' ')+'"'+(s?' '+s:'')+'>'+c.content+''},!d.document)return d.addEventListener?(d.addEventListener('message',function(n){var e=JSON.parse(n.data),t=e.language,a=e.code,r=e.immediateClose;d.postMessage(x.highlight(a,x.languages[t],t)),r&&d.close()},!1),d.Prism):d.Prism;var e=document.currentScript||[].slice.call(document.getElementsByTagName('script')).pop();return e&&(x.filename=e.src,!document.addEventListener||x.manual||e.hasAttribute('data-manual')||('loading'===document.readyState?document.addEventListener('DOMContentLoaded',x.highlightAll):window.requestAnimationFrame?window.requestAnimationFrame(x.highlightAll):window.setTimeout(x.highlightAll,16))),d.Prism}();void 0!==a&&a.exports&&(a.exports=t),void 0!==e&&(e.Prism=t),t.languages.markup={comment://,prolog:/<\?[\w\W]+?\?>/,doctype://i,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},t.hooks.add('wrap',function(t){'entity'===t.type&&(t.attributes.title=t.content.replace(/&/,'&'))}),t.languages.xml=t.languages.markup,t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:{pattern:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},t.languages.css.atrule.inside.rest=t.util.clone(t.languages.css),t.languages.markup&&(t.languages.insertBefore('markup','tag',{style:{pattern:/()[\w\W]*?(?=<\/style>)/i,lookbehind:!0,inside:t.languages.css,alias:'language-css'}}),t.languages.insertBefore('inside','attr-value',{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:t.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:t.languages.css}},alias:'language-css'}},t.languages.markup.tag)),t.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:{pattern:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,boolean:/\b(true|false)\b/,function:/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/},t.languages.javascript=t.languages.extend('clike',{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,function:/[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*\*?|\/|~|\^|%|\.{3}/}),t.languages.insertBefore('javascript','keyword',{regex:{pattern:/(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0,greedy:!0}}),t.languages.insertBefore('javascript','string',{"template-string":{pattern:/`(?:\\\\|\\?[^\\])*?`/,greedy:!0,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:'punctuation'},rest:t.languages.javascript}},string:/[\s\S]+/}}}),t.languages.markup&&t.languages.insertBefore('markup','tag',{script:{pattern:/()[\w\W]*?(?=<\/script>)/i,lookbehind:!0,inside:t.languages.javascript,alias:'language-javascript'}}),t.languages.js=t.languages.javascript,t.languages.glsl=t.languages.extend('clike',{comment:[/\/\*[\w\W]*?\*\//,/\/\/(?:\\(?:\r\n|[\s\S])|.)*/],number:/\b(?:0x[\da-f]+|(?:\.\d+|\d+\.?\d*)(?:e[+-]?\d+)?)[ulf]*\b/i,keyword:/\b(?:attribute|const|uniform|varying|buffer|shared|coherent|volatile|restrict|readonly|writeonly|atomic_uint|layout|centroid|flat|smooth|noperspective|patch|sample|break|continue|do|for|while|switch|case|default|if|else|subroutine|in|out|inout|float|double|int|void|bool|true|false|invariant|precise|discard|return|d?mat[234](?:x[234])?|[ibdu]?vec[234]|uint|lowp|mediump|highp|precision|[iu]?sampler[123]D|[iu]?samplerCube|sampler[12]DShadow|samplerCubeShadow|[iu]?sampler[12]DArray|sampler[12]DArrayShadow|[iu]?sampler2DRect|sampler2DRectShadow|[iu]?samplerBuffer|[iu]?sampler2DMS(?:Array)?|[iu]?samplerCubeArray|samplerCubeArrayShadow|[iu]?image[123]D|[iu]?image2DRect|[iu]?imageCube|[iu]?imageBuffer|[iu]?image[12]DArray|[iu]?imageCubeArray|[iu]?image2DMS(?:Array)?|struct|common|partition|active|asm|class|union|enum|typedef|template|this|resource|goto|inline|noinline|public|static|extern|external|interface|long|short|half|fixed|unsigned|superp|input|output|hvec[234]|fvec[234]|sampler3DRect|filter|sizeof|cast|namespace|using)\b/}),t.languages.insertBefore('glsl','comment',{preprocessor:{pattern:/(^[ \t]*)#(?:(?:define|undef|if|ifdef|ifndef|else|elif|endif|error|pragma|extension|version|line)\b)?/m,lookbehind:!0,alias:'builtin'}}),a.exports=t}).call(this,t(5))},function(a,e,t){(a.exports=t(2)(!1)).push([a.i,'code[class*=language-],pre[class*=language-]{color:#f8f8f2;background:none;text-shadow:0 1px rgba(0,0,0,.3);font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto;border-radius:.3em}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#f8f8f2}.namespace{opacity:.7}.token.constant,.token.deleted,.token.property,.token.symbol,.token.tag{color:#f92672}.token.boolean,.token.number{color:#ae81ff}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#a6e22e}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url,.token.variable{color:#f8f8f2}.token.atrule,.token.attr-value,.token.function{color:#e6db74}.token.keyword{color:#66d9ef}.token.important,.token.regex{color:#fd971f}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}',''])},function(a,e,t){var n=t(7);'string'==typeof n&&(n=[[a.i,n,'']]);t(1)(n,{insertInto:'html',hmr:!0,transform:void 0,insertInto:'html'}),n.locals&&(a.exports=n.locals)},function(t){t.exports=function(a){var r='undefined'!=typeof window&&window.location;if(!r)throw new Error('fixUrls requires window.location');if(!a||'string'!=typeof a)return a;var s=r.protocol+'//'+r.host,n=s+r.pathname.replace(/\/[^\/]*$/,'/');return a.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(a,e){var t=e.trim().replace(/^"(.*)"$/,function(n,e){return e}).replace(/^'(.*)'$/,function(n,e){return e}),r;return /^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(t)?a:(r=0===t.indexOf('//')?t:0===t.indexOf('/')?s+t:n+t.replace(/^\.\//,''),'url('+JSON.stringify(r)+')')})}},function(a,e,t){(e=a.exports=t(2)(!1)).push([a.i,'@import url(https://fonts.googleapis.com/css?family=Montserrat:300,400);','']),e.push([a.i,'.resultViewComponent{position:absolute;z-index:99999;border:1px solid #000;top:0;left:0;bottom:0;right:0;background-color:#222;opacity:1;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.resultViewComponent.active{visibility:visible;display:block}.resultViewComponent,.resultViewComponent:after,.resultViewComponent:before{box-sizing:content-box}.resultViewMenuComponent{font-family:Montserrat,sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.resultViewMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.resultViewMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.resultViewMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.resultViewMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.resultViewMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.resultViewMenuComponent a.clearSearch{display:inline-block;padding:0;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.resultViewMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}@media (max-width:1024px){.resultViewMenuComponent{padding:0;position:absolute;overflow-y:visible;top:0;left:0;right:0;bottom:0;z-index:999999;display:block}.resultViewMenuComponent .resultViewMenuOpen{display:block;visibility:visible}.resultViewMenuComponent li:not(.resultViewMenuSmall){display:none;visibility:hidden}.resultViewMenuComponent li{background:#2c2c2c}.resultViewMenuComponent li.searchContainer{background:#464646}.resultViewMenuComponent a.active{background:#2c2c2c}}.resultViewMenuComponent input{border:0;font-family:Montserrat,sans-serif;font-weight:300;padding:0 20px;background:#464646;color:#f9f9f9;height:100%;position:relative;top:-1px;box-sizing:border-box}.resultViewMenuComponent input:focus{border:0;outline:0 none}.resultViewMenuComponent .clearSearch{position:relative;background:transparent;display:inline;padding:0;margin-left:-30px;z-index:9000;color:#f0640d}.resultViewMenuComponent .clearSearch:hover{background:transparent!important}.resultViewMenuComponent ::-webkit-input-placeholder{color:#ccc}.resultViewMenuComponent :-moz-placeholder,.resultViewMenuComponent ::-moz-placeholder{color:#ccc}.resultViewMenuComponent :-ms-input-placeholder{color:#ccc}.resultViewContentComponent{position:absolute;top:40px;left:0;bottom:0;right:0}.informationColumnLeftComponent{left:0;right:50%}.informationColumnLeftComponent,.informationColumnRightComponent{position:absolute;top:0;bottom:0;overflow:auto;overflow-x:hidden;overflow-y:visible}.informationColumnRightComponent{left:50%;right:0}.captureListComponent{position:absolute;top:40px;left:0;bottom:0;right:0;background:#222;z-index:9000;display:none;visibility:hidden;overflow-y:visible;overflow-x:hidden}.captureListComponent.active{display:block;visibility:visible}.captureListComponent .openCaptureFile{border:1px dashed #f9f9f9;display:block;margin:5px;padding:5px;text-align:center;font-style:italic}.captureListComponent .openCaptureFile span{line-height:100%;vertical-align:middle}.captureListComponent ul{margin:0;padding:0;list-style:none;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-start}.captureListComponent ul li{margin:5px;border:1px solid #606060}.captureListComponent ul li img{width:295px;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(.25,#c9c9c9),color-stop(.25,transparent)),-webkit-gradient(linear,0 0,100% 100%,color-stop(.25,#c9c9c9),color-stop(.25,transparent)),-webkit-gradient(linear,0 100%,100% 0,color-stop(.75,transparent),color-stop(.75,#c9c9c9)),-webkit-gradient(linear,0 0,100% 100%,color-stop(.75,transparent),color-stop(.75,#c9c9c9));background-image:-moz-linear-gradient(45deg,#d9d9d9 25%,transparent 25%),-moz-linear-gradient(-45deg,#d9d9d9 25%,transparent 25%),-moz-linear-gradient(45deg,transparent 75%,#d9d9d9 75%),-moz-linear-gradient(-45deg,transparent 75%,#d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0 25px;display:block}.captureListComponent ul li span{display:block;text-align:center;border:5px solid #222}.captureListComponent ul li span .captureListItemSave{color:#f9f9f9;font-size:16px;margin-left:10px;position:relative;padding:3px 8px 3px 32px}.captureListComponent ul li span .captureListItemSave:after,.captureListComponent ul li span .captureListItemSave:before{box-sizing:border-box;content:"";position:absolute}.captureListComponent ul li span .captureListItemSave:before{background:#d9d9d9;border-color:#f9f9f9;border-style:solid;border-width:7px 2px 1px;border-radius:1px;height:16px;left:8px;top:5px;width:16px}.captureListComponent ul li span .captureListItemSave:after{background:#f9f9f9;border-color:#d9d9d9;border-style:solid;border-width:1px 1px 1px 4px;height:5px;left:13px;top:5px;width:7px}.captureListComponent ul li:hover{cursor:pointer}.captureListComponent ul li.active span{background:#f0640d;border:5px solid #f0640d}.captureListComponent ul li.active span .captureListItemSave:before{background:#f0640d}.captureListComponent ul li.active span .captureListItemSave:after{border-color:#f0640d}.visualStateListComponent{position:absolute;top:0;left:0;bottom:0;padding:5px;right:80%;overflow-y:visible;overflow-x:hidden}.visualStateListComponent ul{margin:0;padding:0;list-style:none}.visualStateListComponent ul li{margin:20px 15px 0;border:1px solid #606060}.visualStateListComponent ul li img{display:block;width:100%;margin:0;padding:0;box-sizing:border-box;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(.25,#c9c9c9),color-stop(.25,transparent)),-webkit-gradient(linear,0 0,100% 100%,color-stop(.25,#c9c9c9),color-stop(.25,transparent)),-webkit-gradient(linear,0 100%,100% 0,color-stop(.75,transparent),color-stop(.75,#c9c9c9)),-webkit-gradient(linear,0 0,100% 100%,color-stop(.75,transparent),color-stop(.75,#c9c9c9));background-image:-moz-linear-gradient(45deg,#d9d9d9 25%,transparent 25%),-moz-linear-gradient(-45deg,#d9d9d9 25%,transparent 25%),-moz-linear-gradient(45deg,transparent 75%,#d9d9d9 75%),-moz-linear-gradient(-45deg,transparent 75%,#d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0 25px}.visualStateListComponent ul li:hover{cursor:pointer}.visualStateListComponent ul li span{border:5px solid #222;background:#222;box-sizing:border-box;display:inline-block;width:100%;margin:0;padding:5px;word-wrap:break-word}.visualStateListComponent ul li.active{border:2px solid #f0640d}.commandListComponent{position:absolute;top:0;left:20%;right:40%;bottom:0;color:#d3d3d3}.commandListComponent ul{margin:0;padding:0;list-style:none;overflow-y:visible;overflow-x:hidden;height:100%}.commandListComponent ul li{padding:8px}.commandListComponent ul li span{word-wrap:break-word;line-height:22px}.commandListComponent ul li:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.commandListComponent ul li:nth-child(2n){background:#2c2c2c}.commandListComponent ul li:nth-child(odd){background:#222}.commandListComponent ul li .important{font-weight:800}.commandListComponent ul li .important.deprecated{color:red}.commandListComponent ul li .important.unused{color:#ff0}.commandListComponent ul li .important.disabled{color:gray}.commandListComponent ul li .important.redundant{color:orange}.commandListComponent ul li .important.valid{color:#adff2f}.commandListComponent ul li .marker{font-size:16px;font-weight:900;color:#adff2f}.commandListComponent ul li.active{background:#f37628;color:#222}.commandListComponent ul li.drawCall{background:#5db0d7;color:#222}.commandListComponent ul li a{margin-left:5px;margin-right:5px;color:#5db0d7;background:#222;padding:5px;font-weight:900;display:inline-block}.commandDetailComponent{position:absolute;top:0;left:60%;right:0;bottom:0;overflow-y:visible;overflow-x:hidden}.jsonGroupComponent{display:block;margin:10px;padding:10px;padding-bottom:5px}.jsonGroupComponent .jsonGroupComponentTitle{display:block;font-size:16px;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:5px;margin-bottom:5px;text-transform:capitalize}.jsonGroupComponent ul{margin:0;padding:0;list-style:none}.jsonGroupComponent ul li:nth-child(2n),.jsonGroupComponent ul li:nth-child(odd){background:#222}.jsonItemComponentKey{color:#f0640d}.jsonItemComponentValue{white-space:pre-wrap}.jsonItemImageHolder{width:50%;margin:auto}.jsonItemImageHolder .jsonItemImage{margin:5px;display:block;border:1px solid #606060;width:100%}.jsonItemImageHolder .jsonItemImage img{width:100%;display:block;margin:auto;max-width:256px;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(.25,#c9c9c9),color-stop(.25,transparent)),-webkit-gradient(linear,0 0,100% 100%,color-stop(.25,#c9c9c9),color-stop(.25,transparent)),-webkit-gradient(linear,0 100%,100% 0,color-stop(.75,transparent),color-stop(.75,#c9c9c9)),-webkit-gradient(linear,0 0,100% 100%,color-stop(.75,transparent),color-stop(.75,#c9c9c9));background-image:-moz-linear-gradient(45deg,#d9d9d9 25%,transparent 25%),-moz-linear-gradient(-45deg,#d9d9d9 25%,transparent 25%),-moz-linear-gradient(45deg,transparent 75%,#d9d9d9 75%),-moz-linear-gradient(-45deg,transparent 75%,#d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0 25px}.jsonItemImageHolder .jsonItemImage span{margin:0;padding:5px;word-wrap:break-word;display:inline-block;width:100%;box-sizing:border-box}[commandName=onOpenSourceClicked]:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.jsonVisualStateItemComponent{text-align:center;padding:10px}.jsonVisualStateItemComponent img{border:1px solid #606060;margin:5px;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(.25,#c9c9c9),color-stop(.25,transparent)),-webkit-gradient(linear,0 0,100% 100%,color-stop(.25,#c9c9c9),color-stop(.25,transparent)),-webkit-gradient(linear,0 100%,100% 0,color-stop(.75,transparent),color-stop(.75,#c9c9c9)),-webkit-gradient(linear,0 0,100% 100%,color-stop(.75,transparent),color-stop(.75,#c9c9c9));background-image:-moz-linear-gradient(45deg,#d9d9d9 25%,transparent 25%),-moz-linear-gradient(-45deg,#d9d9d9 25%,transparent 25%),-moz-linear-gradient(45deg,transparent 75%,#d9d9d9 75%),-moz-linear-gradient(-45deg,transparent 75%,#d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0 25px;width:100%;max-width:512px}.jsonVisualStateItemComponent span{display:block}.jsonContentComponent{position:absolute;top:0;left:0;right:0;bottom:0;padding:10px;overflow-y:visible;overflow-x:hidden}.jsonItemComponentValue{word-break:break-all;white-space:normal}.jsonSourceItemComponentOpen{font-weight:700;color:#5db0d7;text-decoration:underline}.sourceCodeMenuComponentContainer{position:absolute;left:0;top:0;right:40%}.sourceCodeMenuComponent{font-family:Montserrat,sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.sourceCodeMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.sourceCodeMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.sourceCodeMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.sourceCodeMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.sourceCodeMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.sourceCodeMenuComponent a.clearSearch{display:inline-block;padding:0;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.sourceCodeMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}.sourceCodeMenuComponent input{border:0;font-family:Montserrat,sans-serif;font-weight:300;padding:0 20px;background:#464646;color:#f9f9f9;height:100%;position:relative;top:-1px;box-sizing:border-box}.sourceCodeMenuComponent input:focus{border:0;outline:0 none}.sourceCodeMenuComponent .clearSearch{position:relative;background:transparent;display:inline;padding:0;margin-left:-30px;z-index:9000;color:#f0640d}.sourceCodeMenuComponent .clearSearch:hover{background:transparent!important}.sourceCodeMenuComponent ::-webkit-input-placeholder{color:#ccc}.sourceCodeMenuComponent :-moz-placeholder,.sourceCodeMenuComponent ::-moz-placeholder{color:#ccc}.sourceCodeMenuComponent :-ms-input-placeholder{color:#ccc}.sourceCodeComponent,.sourceCodeComponentEditable{position:absolute;top:42px;left:0;bottom:0;right:40%;background:#222;z-index:9000;overflow-x:visible;overflow:auto}.sourceCodeComponent .sourceCodeComponentTitle,.sourceCodeComponentEditable .sourceCodeComponentTitle{font-size:16px;font-weight:800;line-height:50px;color:#f0640d;padding:1em;margin:.5em 0}.captureMenuComponent{position:absolute;padding:7px;z-index:99999;top:10px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuComponent.active{visibility:visible;display:block}.captureMenuComponent,.captureMenuComponent:after,.captureMenuComponent:before{box-sizing:content-box}.captureMenuLogComponent{position:absolute;padding:7px;z-index:80000;top:66px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuLogComponent.active{visibility:visible;display:block}.captureMenuLogComponent,.captureMenuLogComponent:after,.captureMenuLogComponent:before{box-sizing:content-box}.captureMenuLogComponent span.error{color:red}.canvasListComponent{float:left;width:50%;height:100%}.canvasListComponent [commandName=onCanvasSelection]{vertical-align:center;line-height:40px;white-space:nowrap;text-overflow:ellipsis;width:190px;display:inline-block;overflow:hidden;margin:0 5px}.canvasListComponent [commandName=onCanvasSelection]:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.canvasListComponent ul{margin:0;padding:7px;list-style:none;position:absolute;top:54px;left:-2px;width:400px;border:2px solid #222;background-color:#2c2c2c}.canvasListComponent ul li{margin:5px}.canvasListComponent ul li:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.captureMenuActionsComponent{float:left;width:30%;height:100%;margin-top:7.5px}.captureMenuActionsComponent div{float:left}.captureMenuActionsComponent [commandName=onCaptureRequested]{border-radius:50%;background:#2c2c2c;border:2px solid red;width:21px;height:21px}.captureMenuActionsComponent [commandName=onCaptureRequested]:hover{background:red;cursor:pointer;transition:background .3s;-webkit-transition:background .3s;-moz-transition:background .3s}.captureMenuActionsComponent [commandName=onPlayNextFrameRequested],.captureMenuActionsComponent [commandName=onPlayRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before,.captureMenuActionsComponent [commandName=onPlayRequested]:before{content:"";position:absolute;display:inline-block;margin-top:6px;margin-left:4px;width:7px;height:7px;border-top:2px solid #f9f9f9;border-right:2px solid #f9f9f9;background-color:#f9f9f9;-moz-transform:rotate(45deg);-webkit-transform:rotate(45deg);transform:rotate(45deg);z-index:-20}.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:after,.captureMenuActionsComponent [commandName=onPlayRequested]:after{content:"";position:absolute;display:inline-block;width:8px;height:20px;background-color:#2c2c2c;z-index:-10}.captureMenuActionsComponent :hover[commandName=onPlayNextFrameRequested],.captureMenuActionsComponent [commandName=onPlayRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPauseRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPauseRequested]:before{content:"";position:absolute;display:inline-block;width:2px;height:13px;margin-left:12px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:after{content:"";position:absolute;display:inline-block;width:2px;height:13px;margin-left:7px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{background-color:#2c2c2c}.fpsCounterComponent{float:left;width:20%;vertical-align:center;line-height:40px;white-space:nowrap}',''])},function(a,e,t){var n=t(10);'string'==typeof n&&(n=[[a.i,n,'']]);t(1)(n,{insertInto:'html',hmr:!0,transform:void 0,insertInto:'html'}),n.locals&&(a.exports=n.locals)},function(a,e,t){t(11),t(8),t(6),t(4),a.exports=t(3)}])})},function(e,t,n){'use strict';function setRenderer(e){'lambert'==m.shadingmode?u=0:'blinnphong'==m.shadingmode?u=1:'toon'==m.shadingmode&&(u=2);e===l?m._renderer=new r.a:e===d?m._renderer=new o.a(15,15,15):e===c?m._renderer=new i.a(15,15,15,u):void 0}Object.defineProperty(t,'__esModule',{value:!0});var a=n(1),r=n(21),o=n(29),i=n(32),s=n(3),l='Forward',d='Forward+',c='Clustered',p='lambert',u=0,m={renderer:l,shadingmode:p,_renderer:null};setRenderer(m.renderer),a.gui.add(m,'renderer',[l,d,c]).onChange(setRenderer),a.gui.add(m,'shadingmode',['blinnphong',p,'toon']).onChange(function(){setRenderer(m.renderer)});var g=new s.b;g.loadGLTF('models/sponza/sponza.gltf'),a.camera.position.set(-10,8,0),a.cameraControls.target.set(0,2,0),a.gl.enable(a.gl.DEPTH_TEST),Object(a.makeRenderLoop)(function render(){g.update(),m._renderer.render(a.camera,g)})()},function(e,t,n){'use strict';function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}var a=n(1),r=n(2),o=n(6),s=n(3),i=n(27),l=n.n(i),d=n(28),c=n(4),p=function(){function ForwardRenderer(e){_classCallCheck(this,ForwardRenderer),this._lightTexture=new c.a(s.a,8),this._shaderProgram=Object(o.a)(l.a,Object(d.a)({numLights:s.a}),{uniforms:['u_viewProjectionMatrix','u_colmap','u_normap','u_lightbuffer','u_shadingtype'],attribs:['a_position','a_normal','a_uv']}),this.shadingtype=e,this._projectionMatrix=r.a.create(),this._viewMatrix=r.a.create(),this._viewProjectionMatrix=r.a.create()}return ForwardRenderer.prototype.render=function render(e,t){e.updateMatrixWorld(),r.a.invert(this._viewMatrix,e.matrixWorld.elements),r.a.copy(this._projectionMatrix,e.projectionMatrix.elements),r.a.multiply(this._viewProjectionMatrix,this._projectionMatrix,this._viewMatrix);for(var n=0;nl?m:Math.acos(l)},t.str=function str(e){return'vec2('+e[0]+', '+e[1]+')'},t.exactEquals=function exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]},t.equals=function equals(e,t){var n=e[0],a=e[1],r=t[0],o=t[1];return u(n-r)<=g.b*p(1,u(n),u(r))&&u(a-o)<=g.b*p(1,u(a),u(o))},n.d(t,'len',function(){return a}),n.d(t,'sub',function(){return h}),n.d(t,'mul',function(){return f}),n.d(t,'div',function(){return E}),n.d(t,'dist',function(){return _}),n.d(t,'sqrDist',function(){return C}),n.d(t,'sqrLen',function(){return y}),n.d(t,'forEach',function(){return A});var g=n(0),a=length,h=subtract,f=multiply,E=divide,_=distance,C=squaredDistance,y=squaredLength,A=function(){var e=create();return function(t,n,a,r,o,d){var c,i;for(n||(n=2),a||(a=0),i=r?s(r*n+a,t.length):t.length,c=a;cd;++d)l[d]=o.matrix[d];a.a.multiply(l,r,l)}else a.d.set(u,o.translation[0],o.translation[1],o.translation[2]),a.b.set(g,o.rotation[0],o.rotation[1],o.rotation[2],o.rotation[3]),a.a.fromRotationTranslation(f,g,u),a.a.multiply(l,l,f),a.d.set(h,o.scale[0],o.scale[1],o.scale[2]),a.a.scale(l,l,h);this.glTF.nodeMatrix[t]=l;var E=o.meshes;if(!!E)for(var _=E.length,C=0,m;C<_;++C){m=new i,n.meshes.push(m);var y=E[C],A=e.meshes[y];m.meshID=y;for(var b=A.primitives,x=b.length,v=0,p;v= clusterLightCount) { break; } \n int texelIdx = int(float(i+1) * 0.25);\n float V = float(texelIdx+1) / float(texelsPerCol+1);\n vec4 texel = texture2D(u_clusterbuffer, vec2(U,V));\n \n int lightIdx;\n int texelComponent = (i+1) - (texelIdx * 4);\n \n if (texelComponent == 0) {\n lightIdx = int(texel[0]);\n } else if (texelComponent == 1) {\n lightIdx = int(texel[1]);\n } else if (texelComponent == 2) {\n lightIdx = int(texel[2]);\n } else if (texelComponent == 3) {\n lightIdx = int(texel[3]);\n }\n Light light = UnpackLight(lightIdx);\n\n float lightDistance = distance(light.position, v_position);\n vec3 L = (light.position - v_position) / lightDistance;\n\n float lightIntensity = cubicGaussian(2.0 * lightDistance / light.radius);\n float lambertTerm = max(dot(L, normal), 0.0);\n\n fragColor += albedo * lambertTerm * light.color * vec3(lightIntensity);\n }\n\n const vec3 ambientLight = vec3(0.025);\n fragColor += albedo * ambientLight;\n\n gl_FragColor = vec4(fragColor, 1.0);\n }\n '}},function(e,t,n){'use strict';function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError('this hasn\'t been initialised - super() hasn\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function _inherits(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(1),r=n(2),o=n(6),s=n(3),i=n(33),l=n.n(i),d=n(34),c=n.n(d),p=n(13),u=n.n(p),m=n(35),g=n(4),h=n(5),f=2,E=function(e){function ClusteredRenderer(t,n,i,d){_classCallCheck(this,ClusteredRenderer);var p=_possibleConstructorReturn(this,e.call(this,t,n,i));return p.setupDrawBuffers(a.canvas.width,a.canvas.height),p._lightTexture=new g.a(s.a,8),p._progCopy=Object(o.a)(l.a,c.a,{uniforms:['u_viewProjectionMatrix','u_viewMatrix','u_colmap','u_normap'],attribs:['a_position','a_normal','a_uv']}),p._progShade=Object(o.a)(u.a,Object(m.a)({numLights:s.a,numGBuffers:f,xSlices:t,ySlices:n,zSlices:i,maxLightsPerCluster:h.a}),{uniforms:['u_gbuffers[0]','u_gbuffers[1]','u_gbuffers[2]','u_viewMatrix','u_invviewMatrix','u_shadingtype','u_clusterbuffer','u_lightbuffer','u_screenwidth','u_screenheight','u_near','u_far'],attribs:['a_uv']}),p.shadingtype=d,p._projectionMatrix=r.a.create(),p._viewMatrix=r.a.create(),p._viewProjectionMatrix=r.a.create(),p}return _inherits(ClusteredRenderer,e),ClusteredRenderer.prototype.setupDrawBuffers=function setupDrawBuffers(e,t){this._width=e,this._height=t,this._fbo=a.gl.createFramebuffer(),this._depthTex=a.gl.createTexture(),a.gl.bindTexture(a.gl.TEXTURE_2D,this._depthTex),a.gl.texParameteri(a.gl.TEXTURE_2D,a.gl.TEXTURE_MAG_FILTER,a.gl.NEAREST),a.gl.texParameteri(a.gl.TEXTURE_2D,a.gl.TEXTURE_MIN_FILTER,a.gl.NEAREST),a.gl.texParameteri(a.gl.TEXTURE_2D,a.gl.TEXTURE_WRAP_S,a.gl.CLAMP_TO_EDGE),a.gl.texParameteri(a.gl.TEXTURE_2D,a.gl.TEXTURE_WRAP_T,a.gl.CLAMP_TO_EDGE),a.gl.texImage2D(a.gl.TEXTURE_2D,0,a.gl.DEPTH_COMPONENT,e,t,0,a.gl.DEPTH_COMPONENT,a.gl.UNSIGNED_SHORT,null),a.gl.bindTexture(a.gl.TEXTURE_2D,null),a.gl.bindFramebuffer(a.gl.FRAMEBUFFER,this._fbo),a.gl.framebufferTexture2D(a.gl.FRAMEBUFFER,a.gl.DEPTH_ATTACHMENT,a.gl.TEXTURE_2D,this._depthTex,0),this._gbuffers=[,,];for(var n=[,,],r=0;r= clusterLightCount) { break; } \n int texelIdx = int(float(i+1) * 0.25);\n float V = float(texelIdx+1) / float(texelsPerCol+1);\n vec4 texel = texture2D(u_clusterbuffer, vec2(U,V));\n int lightIdx;\n int texelComponent = (i+1) - (texelIdx * 4);\n if (texelComponent == 0) {\n lightIdx = int(texel[0]);\n } else if (texelComponent == 1) {\n lightIdx = int(texel[1]);\n } else if (texelComponent == 2) {\n lightIdx = int(texel[2]);\n } else if (texelComponent == 3) {\n lightIdx = int(texel[3]);\n }\n Light light = UnpackLight(lightIdx);\n float lightDistance = distance(light.position, v_position);\n vec3 L = (light.position - v_position) / lightDistance;\n float lightIntensity = 0.6*cubicGaussian(2.0 * lightDistance / light.radius);\n \n //blinn-phon shading\n vec3 viewdir = normalize(vec3(viewpos) - v_position);\n vec3 lightdir = normalize(L);\n vec3 halfv = normalize(lightdir+viewdir);\n float theta = max(0.0,dot(halfv,normal));\n float specterm;\n if(u_shadingtype == 1)\n {\n specterm = pow(theta,1000.0);\n }\n else\n {\n specterm = 0.0;\n }\n \n //lambert shading\n float lambertTerm = max(dot(L, normal), 0.0);\n \n //toon shading:\n float toonnum = 3.3;\n float toonnumspec = 0.3;\n float toonmag = 0.7;\n float toonlamb = floor(lambertTerm*toonnum)/toonnum;\n float toonspec = floor(specterm*toonnumspec)/toonnumspec;\n if(u_shadingtype==2)\n {\n lambertTerm = lambertTerm*(1.0-toonmag)+toonlamb*toonmag;\n specterm = specterm*(1.0-toonmag)+toonspec*toonmag;\n }\n \n fragColor += albedo * (lambertTerm + 3.0*specterm)* light.color * vec3(lightIntensity);\n }//lightloop\n float depthval = -viewPosRaw.z; \n const vec3 ambientLight = vec3(0.025);\n fragColor += albedo * ambientLight;\n //fragColor = 0.04*vec3(depthval);\n gl_FragColor = vec4(fragColor, 1.0);\n }\n '}}]); +//# sourceMappingURL=bundle.js.map \ No newline at end of file diff --git a/build/bundle.js.map b/build/bundle.js.map new file mode 100644 index 0000000..7552fd1 --- /dev/null +++ b/build/bundle.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bundle.js","sources":["webpack:///bundle.js"],"sourcesContent":["(function(e){function __webpack_require__(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,__webpack_require__),a.l=!0,a.exports}var t={};return __webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.d=function(e,t,n){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},__webpack_require__.n=function(e){var t=e&&e.__esModule?function getDefault(){return e['default']}:function getModuleExports(){return e};return __webpack_require__.d(t,'a',t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p='',__webpack_require__(__webpack_require__.s=1)})([function(e,t,n){'use strict';var a=Math.abs;n.d(t,'b',function(){return r}),n.d(t,'a',function(){return o}),n.d(t,'c',function(){return i});var r=1e-6,o='undefined'==typeof Float32Array?Array:Float32Array,i=Math.random,s=Math.PI/180},function(e,t,n){'use strict';function abort(e){throw h=!0,e}function setSize(e,t){f.width=e,f.height=t,T.aspect=e/t,T.updateProjectionMatrix()}Object.defineProperty(t,'__esModule',{value:!0}),n.d(t,'DEBUG',function(){return g}),n.d(t,'ABORTED',function(){return h}),t.abort=abort,n.d(t,'canvas',function(){return f}),n.d(t,'gl',function(){return _}),n.d(t,'WEBGL_draw_buffers',function(){return i}),n.d(t,'MAX_DRAW_BUFFERS_WEBGL',function(){return b}),n.d(t,'gui',function(){return x}),n.d(t,'camera',function(){return T}),n.d(t,'cameraControls',function(){return S}),t.makeRenderLoop=function makeRenderLoop(e){return function tick(){S.update(),v.begin(),e(),v.end(),h||requestAnimationFrame(tick)}};for(var a=n(14),r=n(15),o=n.n(r),s=n(17),l=n.n(s),d=n(7),c=n(18),p=n.n(c),u=n(19),m=n.n(u),g=!1,h=!1,f=document.getElementById('canvas'),E=f.getContext('webgl'),_=E,C=_.getSupportedExtensions(),y=['OES_texture_float','OES_texture_float_linear','OES_element_index_uint','WEBGL_depth_texture','WEBGL_draw_buffers'],A=0;AC.indexOf(y[A]))throw'Unable to load extension '+y[A];_.getExtension('OES_texture_float'),_.getExtension('OES_texture_float_linear'),_.getExtension('OES_element_index_uint'),_.getExtension('WEBGL_depth_texture');var i=_.getExtension('WEBGL_draw_buffers'),b=_.getParameter(i.MAX_DRAW_BUFFERS_WEBGL),x=new a.a.GUI,v=new l.a;v.setMode(1),v.domElement.style.position='absolute',v.domElement.style.left='0px',v.domElement.style.top='0px',document.body.appendChild(v.domElement);var T=new d.PerspectiveCamera(75,f.clientWidth/f.clientHeight,0.1,1e3),S=new p.a(T,f);S.enableDamping=!0,S.enableZoom=!0,S.rotateSpeed=0.3,S.zoomSpeed=1,S.panSpeed=2,setSize(f.clientWidth,f.clientHeight),window.addEventListener('resize',function(){return setSize(f.clientWidth,f.clientHeight)});n(20)},function(e,t,n){'use strict';var a=n(0),r=n(22),o=n(23),i=n(8),s=n(9),l=n(10),d=n(24),c=n(25),p=n(11),u=n(12);n.d(t,'a',function(){return s}),n.d(t,'b',function(){return l}),n.d(t,'c',function(){return c}),n.d(t,'d',function(){return p}),n.d(t,'e',function(){return u})},function(e,t,n){'use strict';function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}n.d(t,'a',function(){return l});var a=n(1),r=n(26),o=[-14,0,-6],s=[14,20,6],l=600,i=function(){function Scene(){_classCallCheck(this,Scene),this.lights=[],this.models=[];for(var e=0;ethis._zSlices-1||0>F)){R=o(0,R),F=Math.min(this._zSlices,F);for(var w=0;w<=this._xSlices;++w){var M=l.c.clone(getNormalComponents(E+g*w)),L=l.d.fromValues(M[0],0,M[1]);if(l.d.dot(y,L)=o||0 0 ) {','float depth = gl_FragCoord.z / gl_FragCoord.w;','float fogFactor = 0.0;','if ( fogType == 1 ) {','fogFactor = smoothstep( fogNear, fogFar, depth );','} else {','const float LOG2 = 1.442695;','fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );','fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );','}','gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );','}','}'].join('\\n')),t.compileShader(n),t.compileShader(a),t.attachShader(e,n),t.attachShader(e,a),t.linkProgram(e),e}function painterSortStable(e,t){return e.renderOrder===t.renderOrder?e.z===t.z?t.id-e.id:t.z-e.z:e.renderOrder-t.renderOrder}var o=new Vector3,i=new Quaternion,s=new Vector3,d,c,p,u,m,l;this.render=function(r,g,h){if(0!==r.length){void 0===p&&init(),n.useProgram(p),n.initAttributes(),n.enableAttribute(u.position),n.enableAttribute(u.uv),n.disableUnusedAttributes(),n.disable(t.CULL_FACE),n.enable(t.BLEND),t.bindBuffer(t.ARRAY_BUFFER,d),t.vertexAttribPointer(u.position,2,t.FLOAT,!1,16,0),t.vertexAttribPointer(u.uv,2,t.FLOAT,!1,16,8),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,c),t.uniformMatrix4fv(m.projectionMatrix,!1,h.projectionMatrix.elements),n.activeTexture(t.TEXTURE0),t.uniform1i(m.map,0);var f=0,E=0,_=g.fog;_?(t.uniform3f(m.fogColor,_.color.r,_.color.g,_.color.b),_.isFog?(t.uniform1f(m.fogNear,_.near),t.uniform1f(m.fogFar,_.far),t.uniform1i(m.fogType,1),f=1,E=1):_.isFogExp2&&(t.uniform1f(m.fogDensity,_.density),t.uniform1i(m.fogType,2),f=2,E=2)):(t.uniform1i(m.fogType,0),f=0,E=0);for(var C=0,y=r.length,A;Ct&&(t=e[n]);return t}function BufferGeometry(){Object.defineProperty(this,'id',{value:GeometryIdCount()}),this.uuid=kt.generateUUID(),this.name='',this.type='BufferGeometry',this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:Infinity}}function BoxGeometry(e,t,n,a,r,o){Geometry.call(this),this.type='BoxGeometry',this.parameters={width:e,height:t,depth:n,widthSegments:a,heightSegments:r,depthSegments:o},this.fromBufferGeometry(new BoxBufferGeometry(e,t,n,a,r,o)),this.mergeVertices()}function BoxBufferGeometry(e,t,n,a,r,o){function buildPlane(e,t,n,r,o,u,g,h,f,E,_){var C=f+1,A=0,v=0,T=new Vector3,S,R;for(R=0;Rp;p++){if(m=c[p],m){var g=m[0],h=m[1];if(h){i&&r.addAttribute('morphTarget'+p,i[g]),u&&r.addAttribute('morphNormal'+p,u[g]),n[p]=h;continue}}n[p]=0}s.getUniforms().setValue(e,'morphTargetInfluences',n)}}}function WebGLIndexedBufferRenderer(e,t,n){var a,r,o;this.setMode=function setMode(e){a=e},this.setIndex=function setIndex(e){r=e.type,o=e.bytesPerElement},this.render=function render(t,i){e.drawElements(a,i,r,t*o),n.calls++,n.vertices+=i,a===e.TRIANGLES?n.faces+=i/3:a===e.POINTS&&(n.points+=i)},this.renderInstances=function renderInstances(i,s,l){var d=t.get('ANGLE_instanced_arrays');return null===d?void console.error('THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.'):void(d.drawElementsInstancedANGLE(a,l,r,s*o,i.maxInstancedCount),n.calls++,n.vertices+=l*i.maxInstancedCount,a===e.TRIANGLES?n.faces+=i.maxInstancedCount*l/3:a===e.POINTS&&(n.points+=i.maxInstancedCount*l))}}function WebGLBufferRenderer(e,t,n){var a;this.setMode=function setMode(e){a=e},this.render=function render(t,r){e.drawArrays(a,t,r),n.calls++,n.vertices+=r,a===e.TRIANGLES?n.faces+=r/3:a===e.POINTS&&(n.points+=r)},this.renderInstances=function renderInstances(r,o,i){var s=t.get('ANGLE_instanced_arrays');if(null===s)return void console.error('THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.');var l=r.attributes.position;l.isInterleavedBufferAttribute?(i=l.data.count,s.drawArraysInstancedANGLE(a,0,i,r.maxInstancedCount)):s.drawArraysInstancedANGLE(a,o,i,r.maxInstancedCount),n.calls++,n.vertices+=i*r.maxInstancedCount,a===e.TRIANGLES?n.faces+=r.maxInstancedCount*i/3:a===e.POINTS&&(n.points+=r.maxInstancedCount*i)}}function WebGLGeometries(e,t,n){function onGeometryDispose(e){var o=e.target,i=a[o.id];for(var s in null!==i.index&&t.remove(i.index),i.attributes)t.remove(i.attributes[s]);o.removeEventListener('dispose',onGeometryDispose),delete a[o.id];var l=r[o.id];l&&(t.remove(l),delete r[o.id]),l=r[i.id],l&&(t.remove(l),delete r[i.id]),n.geometries--}var a={},r={};return{get:function get(e,t){var r=a[t.id];return r?r:(t.addEventListener('dispose',onGeometryDispose),t.isBufferGeometry?r=t:t.isGeometry&&(void 0===t._bufferGeometry&&(t._bufferGeometry=new BufferGeometry().setFromObject(e)),r=t._bufferGeometry),a[t.id]=r,n.geometries++,r)},update:function update(n){var a=n.index,r=n.attributes;for(var o in null!==a&&t.update(a,e.ELEMENT_ARRAY_BUFFER),r)t.update(r[o],e.ARRAY_BUFFER);var s=n.morphAttributes;for(var o in s)for(var d=s[o],c=0,i=d.length;c');return parseIncludes(n)}var t=/^[ \\t]*#include +<([\\w\\d.]+)>/gm;return e.replace(t,replace)}function unrollLoops(e){var t=/for \\( int i \\= (\\d+)\\; i < (\\d+)\\; i \\+\\+ \\) \\{([\\s\\S]+?)(?=\\})\\}/g;return e.replace(t,function replace(e,t,n,a){for(var r='',o=parseInt(t);ot||e.height>t){var n=t/y(e.width,e.height),a=document.createElementNS('http://www.w3.org/1999/xhtml','canvas');a.width=h(e.width*n),a.height=h(e.height*n);var r=a.getContext('2d');return r.drawImage(e,0,0,e.width,e.height,0,0,a.width,a.height),console.warn('THREE.WebGLRenderer: image is too big ('+e.width+'x'+e.height+'). Resized to '+a.width+'x'+a.height,e),a}return e}function isPowerOfTwo(e){return kt.isPowerOfTwo(e.width)&&kt.isPowerOfTwo(e.height)}function makePowerOfTwo(e){if(e instanceof HTMLImageElement||e instanceof HTMLCanvasElement){var t=document.createElementNS('http://www.w3.org/1999/xhtml','canvas');t.width=kt.nearestPowerOfTwo(e.width),t.height=kt.nearestPowerOfTwo(e.height);var n=t.getContext('2d');return n.drawImage(e,0,0,t.width,t.height),console.warn('THREE.WebGLRenderer: image is not power of two ('+e.width+'x'+e.height+'). Resized to '+t.width+'x'+t.height,e),t}return e}function textureNeedsPowerOfTwo(e){return e.wrapS!==Ne||e.wrapT!==Ne||e.minFilter!==Oe&&e.minFilter!==ke}function textureNeedsGenerateMipmaps(e,t){return e.generateMipmaps&&t&&e.minFilter!==Oe&&e.minFilter!==ke}function filterFallback(t){return t===Oe||t===Ue||t===Ge?e.NEAREST:e.LINEAR}function onTextureDispose(e){var t=e.target;t.removeEventListener('dispose',onTextureDispose),deallocateTexture(t),s.textures--}function onRenderTargetDispose(e){var t=e.target;t.removeEventListener('dispose',onRenderTargetDispose),deallocateRenderTarget(t),s.textures--}function deallocateTexture(t){var n=a.get(t);if(t.image&&n.__image__webglTextureCube)e.deleteTexture(n.__image__webglTextureCube);else{if(n.__webglInit===void 0)return;e.deleteTexture(n.__webglTexture)}a.remove(t)}function deallocateRenderTarget(t){var n=a.get(t),r=a.get(t.texture);if(t){if(void 0!==r.__webglTexture&&e.deleteTexture(r.__webglTexture),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLRenderTargetCube)for(var o=0;6>o;o++)e.deleteFramebuffer(n.__webglFramebuffer[o]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[o]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer);a.remove(t.texture),a.remove(t)}}function setTexture2D(t,r){var o=a.get(t);if(0o;o++)e.bindFramebuffer(e.FRAMEBUFFER,n.__webglFramebuffer[o]),n.__webglDepthbuffer[o]=e.createRenderbuffer(),setupRenderBufferStorage(n.__webglDepthbuffer[o],t)}else e.bindFramebuffer(e.FRAMEBUFFER,n.__webglFramebuffer),n.__webglDepthbuffer=e.createRenderbuffer(),setupRenderBufferStorage(n.__webglDepthbuffer,t);e.bindFramebuffer(e.FRAMEBUFFER,null)}var i='undefined'!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext;this.setTexture2D=setTexture2D,this.setTextureCube=function setTextureCube(t,l){var d=a.get(t);if(6===t.image.length)if(0m;m++)u[m]=c||p?p?t.image[m].image:t.image[m]:clampToMaxSize(t.image[m],r.maxCubemapSize);var i=u[0],g=isPowerOfTwo(i),h=o.convert(t.format),f=o.convert(t.type);setTextureParameters(e.TEXTURE_CUBE_MAP,t,g);for(var m=0;6>m;m++)if(!c)p?n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+m,0,h,u[m].width,u[m].height,0,h,f,u[m].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+m,0,h,h,f,u[m]);else for(var E=u[m].mipmaps,_=0,C=E.length,y;_c;c++)r.__webglFramebuffer[c]=e.createFramebuffer()}else r.__webglFramebuffer=e.createFramebuffer();if(l){n.bindTexture(e.TEXTURE_CUBE_MAP,o.__webglTexture),setTextureParameters(e.TEXTURE_CUBE_MAP,t.texture,d);for(var c=0;6>c;c++)setupFrameBufferTexture(r.__webglFramebuffer[c],t,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+c);textureNeedsGenerateMipmaps(t.texture,d)&&e.generateMipmap(e.TEXTURE_CUBE_MAP),n.bindTexture(e.TEXTURE_CUBE_MAP,null)}else n.bindTexture(e.TEXTURE_2D,o.__webglTexture),setTextureParameters(e.TEXTURE_2D,t.texture,d),setupFrameBufferTexture(r.__webglFramebuffer,t,e.COLOR_ATTACHMENT0,e.TEXTURE_2D),textureNeedsGenerateMipmaps(t.texture,d)&&e.generateMipmap(e.TEXTURE_2D),n.bindTexture(e.TEXTURE_2D,null);t.depthBuffer&&setupDepthRenderbuffer(t)},this.updateRenderTargetMipmap=function updateRenderTargetMipmap(t){var r=t.texture,o=isPowerOfTwo(t);if(textureNeedsGenerateMipmaps(r,o)){var i=t.isWebGLRenderTargetCube?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,s=a.get(r).__webglTexture;n.bindTexture(i,s),e.generateMipmap(i),n.bindTexture(i,null)}}}function WebGLProperties(){var e={};return{get:function get(t){var n=t.uuid,a=e[n];return void 0===a&&(a={},e[n]=a),a},remove:function remove(t){delete e[t.uuid]},clear:function clear(){e={}}}}function WebGLState(e,t,n){function createTexture(t,n,a){var r=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(var s=0;s=Q.maxTextures&&console.warn('THREE.WebGLRenderer: Trying to use '+e+' texture units while this GPU supports only '+Q.maxTextures),D+=1,e},this.setTexture2D=function(){var e=!1;return function setTexture2D(t,n){t&&t.isWebGLRenderTarget&&(!e&&(console.warn('THREE.WebGLRenderer.setTexture2D: don\\'t use render targets as textures. Use their .texture property instead.'),e=!0),t=t.texture),te.setTexture2D(t,n)}}(),this.setTexture=function(){var e=!1;return function setTexture(t,n){e||(console.warn('THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead.'),e=!0),te.setTexture2D(t,n)}}(),this.setTextureCube=function(){var e=!1;return function setTextureCube(t,n){t&&t.isWebGLRenderTargetCube&&(!e&&(console.warn('THREE.WebGLRenderer.setTextureCube: don\\'t use cube render targets as textures. Use their .texture property instead.'),e=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?te.setTextureCube(t,n):te.setTextureCubeDynamic(t,n)}}(),this.getRenderTarget=function(){return x},this.setRenderTarget=function(e){x=e,e&&void 0===ee.get(e).__webglFramebuffer&&te.setupRenderTarget(e);var t=null,n=!1;if(e){var a=ee.get(e).__webglFramebuffer;e.isWebGLRenderTargetCube?(t=a[e.activeCubeFace],n=!0):t=a,M.copy(e.viewport),L.copy(e.scissor),B=e.scissorTest}else M.copy(O).multiplyScalar(P),L.copy(U).multiplyScalar(P),B=k;if(v!==t&&(K.bindFramebuffer(K.FRAMEBUFFER,t),v=t),J.viewport(M),J.scissor(L),J.setScissorTest(B),n){var r=ee.get(e.texture);K.framebufferTexture2D(K.FRAMEBUFFER,K.COLOR_ATTACHMENT0,K.TEXTURE_CUBE_MAP_POSITIVE_X+e.activeCubeFace,r.__webglTexture,e.activeMipMapLevel)}},this.readRenderTargetPixels=function(e,t,n,a,r,o){if(!(e&&e.isWebGLRenderTarget))return void console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.');var i=ee.get(e).__webglFramebuffer;if(i){var s=!1;i!==v&&(K.bindFramebuffer(K.FRAMEBUFFER,i),s=!0);try{var l=e.texture,d=l.format,c=l.type;if(d!==at&&ge.convert(d)!==K.getParameter(K.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.');if(c!==Ve&&ge.convert(c)!==K.getParameter(K.IMPLEMENTATION_COLOR_READ_TYPE)&&!(c===Ke&&(Z.get('OES_texture_float')||Z.get('WEBGL_color_buffer_float')))&&!(c===qe&&Z.get('EXT_color_buffer_half_float')))return void console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.');K.checkFramebufferStatus(K.FRAMEBUFFER)===K.FRAMEBUFFER_COMPLETE?0<=t&&t<=e.width-a&&0<=n&&n<=e.height-r&&K.readPixels(t,n,a,r,ge.convert(d),ge.convert(c),o):console.error('THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.')}finally{s&&K.bindFramebuffer(K.FRAMEBUFFER,v)}}}}function FogExp2(e,t){this.name='',this.color=new Color(e),this.density=t===void 0?2.5e-4:t}function Fog(e,t,n){this.name='',this.color=new Color(e),this.near=t===void 0?1:t,this.far=n===void 0?1e3:n}function Scene(){Object3D.call(this),this.type='Scene',this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function LensFlare(e,t,n,a,r){Object3D.call(this),this.lensFlares=[],this.positionScreen=new Vector3,this.customUpdateCallback=void 0,e!==void 0&&this.add(e,t,n,a,r)}function SpriteMaterial(e){Material.call(this),this.type='SpriteMaterial',this.color=new Color(16777215),this.map=null,this.rotation=0,this.fog=!1,this.lights=!1,this.setValues(e)}function Sprite(e){Object3D.call(this),this.type='Sprite',this.material=e===void 0?new SpriteMaterial:e}function LOD(){Object3D.call(this),this.type='LOD',Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function Skeleton(e,t){if(e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn('THREE.Skeleton boneInverses is the wrong length.'),this.boneInverses=[];for(var n=0,a=this.bones.length;n=e.HAVE_CURRENT_DATA&&(d.needsUpdate=!0)}Texture.call(this,e,t,n,a,r,o,i,s,l),this.generateMipmaps=!1;var d=this;update()}function CompressedTexture(e,t,n,a,r,o,i,s,l,d,c,p){Texture.call(this,null,o,i,s,l,d,a,r,c,p),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function DepthTexture(e,t,n,a,r,o,i,s,l,d){if(d=void 0===d?st:d,d!==st&&d!==lt)throw new Error('DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat');void 0===n&&d===st&&(n=Xe),void 0===n&&d===lt&&(n=et),Texture.call(this,null,a,r,o,i,s,d,n,l),this.image={width:e,height:t},this.magFilter=void 0===i?Oe:i,this.minFilter=void 0===s?Oe:s,this.flipY=!1,this.generateMipmaps=!1}function WireframeGeometry(t){BufferGeometry.call(this),this.type='WireframeGeometry';var n=[],a=[0,0],r={},s=['a','b','c'],d,i,c,l,o,p,e,u,m,g;if(t&&t.isGeometry){var h=t.faces;for(d=0,c=h.length;di;i++)e=E[s[i]],u=E[s[(i+1)%3]],a[0]=f(e,u),a[1]=y(e,u),m=a[0]+','+a[1],void 0===r[m]&&(r[m]={index1:a[0],index2:a[1]})}for(m in r)p=r[m],g=t.vertices[p.index1],n.push(g.x,g.y,g.z),g=t.vertices[p.index2],n.push(g.x,g.y,g.z)}else if(t&&t.isBufferGeometry){var _,C,A,b,x,v,T,S;if(g=new Vector3,null!==t.index){for(_=t.attributes.position,C=t.index,A=t.groups,0===A.length&&(A=[{start:0,count:C.count,materialIndex:0}]),(l=0,o=A.length);li;i++)e=C.getX(d+i),u=C.getX(d+(i+1)%3),a[0]=f(e,u),a[1]=y(e,u),m=a[0]+','+a[1],void 0===r[m]&&(r[m]={index1:a[0],index2:a[1]});for(m in r)p=r[m],g.fromBufferAttribute(_,p.index1),n.push(g.x,g.y,g.z),g.fromBufferAttribute(_,p.index2),n.push(g.x,g.y,g.z)}else for(_=t.attributes.position,d=0,c=_.count/3;di;i++)T=3*d+i,g.fromBufferAttribute(_,T),n.push(g.x,g.y,g.z),S=3*d+(i+1)%3,g.fromBufferAttribute(_,S),n.push(g.x,g.y,g.z)}this.addAttribute('position',new Float32BufferAttribute(n,3))}function ParametricGeometry(e,t,n){Geometry.call(this),this.type='ParametricGeometry',this.parameters={func:e,slices:t,stacks:n},this.fromBufferGeometry(new ParametricBufferGeometry(e,t,n)),this.mergeVertices()}function ParametricBufferGeometry(e,t,n){BufferGeometry.call(this),this.type='ParametricBufferGeometry',this.parameters={func:e,slices:t,stacks:n};var r=[],o=[],s=[],l=[],p=1e-5,m=new Vector3,g=new Vector3,h=new Vector3,f=new Vector3,E=new Vector3,_=t+1,C,i;for(C=0;C<=n;C++){var y=C/n;for(i=0;i<=t;i++){var A=i/t;g=e(A,y,g),o.push(g.x,g.y,g.z),0<=A-p?(h=e(A-p,y,h),f.subVectors(g,h)):(h=e(A+p,y,h),f.subVectors(h,g)),0<=y-p?(h=e(A,y-p,h),E.subVectors(g,h)):(h=e(A,y+p,h),E.subVectors(h,g)),m.crossVectors(f,E).normalize(),s.push(m.x,m.y,m.z),l.push(A,y)}}for(C=0;Ci&&(0.2>t&&(o[e+0]+=1),0.2>n&&(o[e+2]+=1),0.2>a&&(o[e+4]+=1))}}function pushVertex(e){r.push(e.x,e.y,e.z)}function getVertexByIndex(t,n){var a=3*t;n.x=e[a+0],n.y=e[a+1],n.z=e[a+2]}function correctUVs(){for(var e=new Vector3,t=new Vector3,n=new Vector3,a=new Vector3,s=new Vector2,l=new Vector2,d=new Vector2,c=0,i=0;ca&&1===e.x&&(o[t]=e.x-1),0===n.x&&0===n.z&&(o[t]=a/2/S+0.5)}function azimuth(e){return i(e.z,-e.x)}function inclination(e){return i(-e.y,_(e.x*e.x+e.z*e.z))}BufferGeometry.call(this),this.type='PolyhedronBufferGeometry',this.parameters={vertices:e,indices:t,radius:n,detail:a},n=n||1,a=a||0;var r=[],o=[];(function subdivide(e){for(var n=new Vector3,a=new Vector3,r=new Vector3,o=0;oA;A++)c=l[d[A]],p=l[d[(A+1)%3]],o[0]=f(c,p),o[1]=y(c,p),u=o[0]+','+o[1],void 0===s[u]?s[u]={index1:o[0],index2:o[1],face1:_,face2:void 0}:s[u].face2=_}for(u in s){var b=s[u];if(b.face2===void 0||E[b.face1].normal.dot(E[b.face2].normal)<=r){var e=h[b.index1];a.push(e.x,e.y,e.z),e=h[b.index2],a.push(e.x,e.y,e.z)}}this.addAttribute('position',new Float32BufferAttribute(a,3))}function CylinderGeometry(e,t,n,a,r,o,i,s){Geometry.call(this),this.type='CylinderGeometry',this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:a,heightSegments:r,openEnded:o,thetaStart:i,thetaLength:s},this.fromBufferGeometry(new CylinderBufferGeometry(e,t,n,a,r,o,i,s)),this.mergeVertices()}function CylinderBufferGeometry(e,t,n,r,i,a,s,l){function generateCap(n){var a=new Vector2,h=new Vector3,E=0,y=!0===n?e:t,A=!0===n?1:-1,b,x,v;for(x=f,b=1;b<=r;b++)d.push(0,_*A,0),c.push(0,A,0),g.push(0.5,0.5),f++;for(v=f,b=0;b<=r;b++){var T=b/r,S=T*l+s,R=m(S),F=o(S);h.x=y*F,h.y=_*A,h.z=y*R,d.push(h.x,h.y,h.z),c.push(0,A,0),a.x=0.5*R+0.5,a.y=0.5*F*A+0.5,g.push(a.x,a.y),f++}for(b=0;bthis.duration&&this.resetDuration(),this.optimize()}function MaterialLoader(e){this.manager=e===void 0?dn:e,this.textures={}}function BufferGeometryLoader(e){this.manager=e===void 0?dn:e}function Loader(){this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}}function JSONLoader(e){'boolean'==typeof e&&(console.warn('THREE.JSONLoader: showStatus parameter has been removed from constructor.'),e=void 0),this.manager=e===void 0?dn:e,this.withCredentials=!1}function ObjectLoader(e){this.manager=e===void 0?dn:e,this.texturePath=''}function CatmullRom(e,t,n,a,r){var o=0.5*(a-t),i=0.5*(r-n),s=e*e;return(2*n-2*a+o+i)*(e*s)+(-3*n+3*a-2*o-i)*s+o*e+n}function QuadraticBezierP0(e,t){var n=1-e;return n*n*t}function QuadraticBezierP1(e,t){return 2*(1-e)*e*t}function QuadraticBezierP2(e,t){return e*e*t}function QuadraticBezier(e,t,n,a){return QuadraticBezierP0(e,t)+QuadraticBezierP1(e,n)+QuadraticBezierP2(e,a)}function CubicBezierP0(e,t){var n=1-e;return n*n*n*t}function CubicBezierP1(e,t){var n=1-e;return 3*n*n*e*t}function CubicBezierP2(e,t){return 3*(1-e)*e*e*t}function CubicBezierP3(e,t){return e*e*e*t}function CubicBezier(e,t,n,a,r){return CubicBezierP0(e,t)+CubicBezierP1(e,n)+CubicBezierP2(e,a)+CubicBezierP3(e,r)}function Curve(){this.arcLengthDivisions=200}function LineCurve(e,t){Curve.call(this),this.v1=e,this.v2=t}function CurvePath(){Curve.call(this),this.curves=[],this.autoClose=!1}function EllipseCurve(e,t,n,a,r,o,i,s){Curve.call(this),this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=a,this.aStartAngle=r,this.aEndAngle=o,this.aClockwise=i,this.aRotation=s||0}function SplineCurve(e){Curve.call(this),this.points=e===void 0?[]:e}function CubicBezierCurve(e,t,n,a){Curve.call(this),this.v0=e,this.v1=t,this.v2=n,this.v3=a}function QuadraticBezierCurve(e,t,n){Curve.call(this),this.v0=e,this.v1=t,this.v2=n}function Path(e){CurvePath.call(this),this.currentPoint=new Vector2,e&&this.fromPoints(e)}function Shape(){Path.apply(this,arguments),this.holes=[]}function ShapePath(){this.subPaths=[],this.currentPath=null}function Font(e){this.data=e}function FontLoader(e){this.manager=e===void 0?dn:e}function AudioLoader(e){this.manager=e===void 0?dn:e}function StereoCamera(){this.type='StereoCamera',this.aspect=1,this.eyeSep=0.064,this.cameraL=new PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}function CubeCamera(e,t,n){Object3D.call(this),this.type='CubeCamera';var a=90,r=1,o=new PerspectiveCamera(a,r,e,t);o.up.set(0,-1,0),o.lookAt(new Vector3(1,0,0)),this.add(o);var i=new PerspectiveCamera(a,r,e,t);i.up.set(0,-1,0),i.lookAt(new Vector3(-1,0,0)),this.add(i);var s=new PerspectiveCamera(a,r,e,t);s.up.set(0,0,1),s.lookAt(new Vector3(0,1,0)),this.add(s);var l=new PerspectiveCamera(a,r,e,t);l.up.set(0,0,-1),l.lookAt(new Vector3(0,-1,0)),this.add(l);var d=new PerspectiveCamera(a,r,e,t);d.up.set(0,-1,0),d.lookAt(new Vector3(0,0,1)),this.add(d);var c=new PerspectiveCamera(a,r,e,t);c.up.set(0,-1,0),c.lookAt(new Vector3(0,0,-1)),this.add(c);this.renderTarget=new WebGLRenderTargetCube(n,n,{format:nt,magFilter:ke,minFilter:ke}),this.renderTarget.texture.name='CubeCamera',this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();var n=this.renderTarget,a=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,n.activeCubeFace=0,e.render(t,o,n),n.activeCubeFace=1,e.render(t,i,n),n.activeCubeFace=2,e.render(t,s,n),n.activeCubeFace=3,e.render(t,l,n),n.activeCubeFace=4,e.render(t,d,n),n.texture.generateMipmaps=a,n.activeCubeFace=5,e.render(t,c,n),e.setRenderTarget(null)},this.clear=function(e,t,n,a){for(var r=this.renderTarget,o=0;6>o;o++)r.activeCubeFace=o,e.setRenderTarget(r),e.clear(t,n,a);e.setRenderTarget(null)}}function AudioListener(){Object3D.call(this),this.type='AudioListener',this.context=En.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null}function Audio(e){Object3D.call(this),this.type='Audio',this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.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 PositionalAudio(e){Audio.call(this,e),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function AudioAnalyser(e,t){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t===void 0?2048:t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}function PropertyMixer(e,t,n){this.binding=e,this.valueSize=n;var a=Float64Array,r;'quaternion'===t?r=this._slerp:'string'===t||'bool'===t?(a=Array,r=this._select):r=this._lerp;this.buffer=new a(4*n),this._mixBufferRegion=r,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}function Composite(e,t,n){var a=n||PropertyBinding.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,a)}function PropertyBinding(e,t,n){this.path=t,this.parsedPath=n||PropertyBinding.parseTrackName(t),this.node=PropertyBinding.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function AnimationObjectGroup(){this.uuid=kt.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,a=arguments.length;t!==a;++t)e[arguments[t].uuid]=t;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var n=this;this.stats={objects:{get total(){return n._objects.length},get inUse(){return this.total-n.nCachedObjects_}},get bindingsPerObject(){return n._bindings.length}}}function AnimationAction(e,t,n){this._mixer=e,this._clip=t,this._localRoot=n||null;for(var a=t.tracks,r=a.length,o=Array(r),s={endingStart:vt,endingEnd:vt},l=0,i;l!==r;++l)i=a[l].createInterpolant(null),o[l]=i,i.settings=s;this._interpolantSettings=s,this._interpolants=o,this._propertyBindings=Array(r),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Ct,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=Infinity,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function AnimationMixer(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Uniform(e){'string'==typeof e&&(console.warn('THREE.Uniform: Type parameter is no longer needed.'),e=arguments[1]),this.value=e}function InstancedBufferGeometry(){BufferGeometry.call(this),this.type='InstancedBufferGeometry',this.maxInstancedCount=void 0}function InterleavedBufferAttribute(e,t,n,a){this.uuid=kt.generateUUID(),this.data=e,this.itemSize=t,this.offset=n,this.normalized=!0===a}function InterleavedBuffer(e,t){this.uuid=kt.generateUUID(),this.array=e,this.stride=t,this.count=e===void 0?0:e.length/t,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.onUploadCallback=function(){},this.version=0}function InstancedInterleavedBuffer(e,t,n){InterleavedBuffer.call(this,e,t),this.meshPerAttribute=n||1}function InstancedBufferAttribute(e,t,n){BufferAttribute.call(this,e,t),this.meshPerAttribute=n||1}function Raycaster(e,t,n,a){this.ray=new Ray(e,t),this.near=n||0,this.far=a||Infinity,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 ascSort(e,t){return e.distance-t.distance}function intersectObject(e,t,n,a){if(!1!==e.visible&&(e.raycast(t,n),!0===a))for(var r=e.children,o=0,i=r.length;oe.length&&console.warn('THREE.CatmullRomCurve3: Points array needs at least two entries.'),this.points=e||[],this.closed=!1}function CubicBezierCurve3(e,t,n,a){Curve.call(this),this.v0=e,this.v1=t,this.v2=n,this.v3=a}function QuadraticBezierCurve3(e,t,n){Curve.call(this),this.v0=e,this.v1=t,this.v2=n}function LineCurve3(e,t){Curve.call(this),this.v1=e,this.v2=t}function ArcCurve(e,t,n,a,r,o){EllipseCurve.call(this,e,t,n,n,a,r,o)}function Face4(e,t,n,a,r,o,i){return console.warn('THREE.Face4 has been removed. A THREE.Face3 will be created instead.'),new Face3(e,t,n,r,o,i)}function MeshFaceMaterial(e){return console.warn('THREE.MeshFaceMaterial has been removed. Use an Array instead.'),e}function MultiMaterial(e){return void 0===e&&(e=[]),console.warn('THREE.MultiMaterial has been removed. Use an Array instead.'),e.isMultiMaterial=!0,e.materials=e,e.clone=function(){return e.slice()},e}function PointCloud(e,t){return console.warn('THREE.PointCloud has been renamed to THREE.Points.'),new Points(e,t)}function Particle(e){return console.warn('THREE.Particle has been renamed to THREE.Sprite.'),new Sprite(e)}function ParticleSystem(e,t){return console.warn('THREE.ParticleSystem has been renamed to THREE.Points.'),new Points(e,t)}function PointCloudMaterial(e){return console.warn('THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.'),new PointsMaterial(e)}function ParticleBasicMaterial(e){return console.warn('THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.'),new PointsMaterial(e)}function ParticleSystemMaterial(e){return console.warn('THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.'),new PointsMaterial(e)}function Vertex(e,t,n){return console.warn('THREE.Vertex has been removed. Use THREE.Vector3 instead.'),new Vector3(e,t,n)}function DynamicBufferAttribute(e,t){return console.warn('THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead.'),new BufferAttribute(e,t).setDynamic(!0)}function Int8Attribute(e,t){return console.warn('THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead.'),new Int8BufferAttribute(e,t)}function Uint8Attribute(e,t){return console.warn('THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead.'),new Uint8BufferAttribute(e,t)}function Uint8ClampedAttribute(e,t){return console.warn('THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead.'),new Uint8ClampedBufferAttribute(e,t)}function Int16Attribute(e,t){return console.warn('THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead.'),new Int16BufferAttribute(e,t)}function Uint16Attribute(e,t){return console.warn('THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead.'),new Uint16BufferAttribute(e,t)}function Int32Attribute(e,t){return console.warn('THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead.'),new Int32BufferAttribute(e,t)}function Uint32Attribute(e,t){return console.warn('THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead.'),new Uint32BufferAttribute(e,t)}function Float32Attribute(e,t){return console.warn('THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead.'),new Float32BufferAttribute(e,t)}function Float64Attribute(e,t){return console.warn('THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead.'),new Float64BufferAttribute(e,t)}function ClosedSplineCurve3(e){console.warn('THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.'),CatmullRomCurve3.call(this,e),this.type='catmullrom',this.closed=!0}function SplineCurve3(e){console.warn('THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead.'),CatmullRomCurve3.call(this,e),this.type='catmullrom'}function Spline(e){console.warn('THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead.'),CatmullRomCurve3.call(this,e),this.type='catmullrom'}function BoundingBoxHelper(e,t){return console.warn('THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead.'),new BoxHelper(e,t)}function EdgesHelper(e,t){return console.warn('THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead.'),new LineSegments(new EdgesGeometry(e.geometry),new LineBasicMaterial({color:void 0===t?16777215:t}))}function WireframeHelper(e,t){return console.warn('THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead.'),new LineSegments(new WireframeGeometry(e.geometry),new LineBasicMaterial({color:void 0===t?16777215:t}))}function XHRLoader(e){return console.warn('THREE.XHRLoader has been renamed to THREE.FileLoader.'),new FileLoader(e)}function BinaryTextureLoader(e){return console.warn('THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader.'),new DataTextureLoader(e)}function Projector(){console.error('THREE.Projector has been moved to /examples/js/renderers/Projector.js.'),this.projectVector=function(e,t){console.warn('THREE.Projector: .projectVector() is now vector.project().'),e.project(t)},this.unprojectVector=function(e,t){console.warn('THREE.Projector: .unprojectVector() is now vector.unproject().'),e.unproject(t)},this.pickingRay=function(){console.error('THREE.Projector: .pickingRay() is now raycaster.setFromCamera().')}}function CanvasRenderer(){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(){}}var a=Math.atan,r=Math.acos,o=Math.sin,m=Math.cos,i=Math.atan2,s=Math.pow,l=Math.round,d=Math.LN2,c=Math.log,p=Math.sign,u=Number.isInteger,g=Number.EPSILON,f=Math.min,h=Math.floor,E=Math.tan,_=Math.sqrt,C=Math.ceil,y=Math.max,A=Math.abs,S=Math.PI;Object.defineProperty(t,'__esModule',{value:!0}),n.d(t,'WebGLRenderTargetCube',function(){return WebGLRenderTargetCube}),n.d(t,'WebGLRenderTarget',function(){return WebGLRenderTarget}),n.d(t,'WebGLRenderer',function(){return WebGLRenderer}),n.d(t,'ShaderLib',function(){return Jt}),n.d(t,'UniformsLib',function(){return qt}),n.d(t,'UniformsUtils',function(){return Zt}),n.d(t,'ShaderChunk',function(){return Qt}),n.d(t,'FogExp2',function(){return FogExp2}),n.d(t,'Fog',function(){return Fog}),n.d(t,'Scene',function(){return Scene}),n.d(t,'LensFlare',function(){return LensFlare}),n.d(t,'Sprite',function(){return Sprite}),n.d(t,'LOD',function(){return LOD}),n.d(t,'SkinnedMesh',function(){return SkinnedMesh}),n.d(t,'Skeleton',function(){return Skeleton}),n.d(t,'Bone',function(){return Bone}),n.d(t,'Mesh',function(){return Mesh}),n.d(t,'LineSegments',function(){return LineSegments}),n.d(t,'LineLoop',function(){return LineLoop}),n.d(t,'Line',function(){return Line}),n.d(t,'Points',function(){return Points}),n.d(t,'Group',function(){return Group}),n.d(t,'VideoTexture',function(){return VideoTexture}),n.d(t,'DataTexture',function(){return DataTexture}),n.d(t,'CompressedTexture',function(){return CompressedTexture}),n.d(t,'CubeTexture',function(){return CubeTexture}),n.d(t,'CanvasTexture',function(){return CanvasTexture}),n.d(t,'DepthTexture',function(){return DepthTexture}),n.d(t,'Texture',function(){return Texture}),n.d(t,'CompressedTextureLoader',function(){return CompressedTextureLoader}),n.d(t,'DataTextureLoader',function(){return DataTextureLoader}),n.d(t,'CubeTextureLoader',function(){return CubeTextureLoader}),n.d(t,'TextureLoader',function(){return TextureLoader}),n.d(t,'ObjectLoader',function(){return ObjectLoader}),n.d(t,'MaterialLoader',function(){return MaterialLoader}),n.d(t,'BufferGeometryLoader',function(){return BufferGeometryLoader}),n.d(t,'DefaultLoadingManager',function(){return dn}),n.d(t,'LoadingManager',function(){return LoadingManager}),n.d(t,'JSONLoader',function(){return JSONLoader}),n.d(t,'ImageLoader',function(){return ImageLoader}),n.d(t,'FontLoader',function(){return FontLoader}),n.d(t,'FileLoader',function(){return FileLoader}),n.d(t,'Loader',function(){return Loader}),n.d(t,'Cache',function(){return ln}),n.d(t,'AudioLoader',function(){return AudioLoader}),n.d(t,'SpotLightShadow',function(){return SpotLightShadow}),n.d(t,'SpotLight',function(){return SpotLight}),n.d(t,'PointLight',function(){return PointLight}),n.d(t,'RectAreaLight',function(){return RectAreaLight}),n.d(t,'HemisphereLight',function(){return HemisphereLight}),n.d(t,'DirectionalLightShadow',function(){return DirectionalLightShadow}),n.d(t,'DirectionalLight',function(){return DirectionalLight}),n.d(t,'AmbientLight',function(){return AmbientLight}),n.d(t,'LightShadow',function(){return LightShadow}),n.d(t,'Light',function(){return Light}),n.d(t,'StereoCamera',function(){return StereoCamera}),n.d(t,'PerspectiveCamera',function(){return PerspectiveCamera}),n.d(t,'OrthographicCamera',function(){return OrthographicCamera}),n.d(t,'CubeCamera',function(){return CubeCamera}),n.d(t,'ArrayCamera',function(){return ArrayCamera}),n.d(t,'Camera',function(){return Camera}),n.d(t,'AudioListener',function(){return AudioListener}),n.d(t,'PositionalAudio',function(){return PositionalAudio}),n.d(t,'AudioContext',function(){return En}),n.d(t,'AudioAnalyser',function(){return AudioAnalyser}),n.d(t,'Audio',function(){return Audio}),n.d(t,'VectorKeyframeTrack',function(){return VectorKeyframeTrack}),n.d(t,'StringKeyframeTrack',function(){return StringKeyframeTrack}),n.d(t,'QuaternionKeyframeTrack',function(){return QuaternionKeyframeTrack}),n.d(t,'NumberKeyframeTrack',function(){return NumberKeyframeTrack}),n.d(t,'ColorKeyframeTrack',function(){return ColorKeyframeTrack}),n.d(t,'BooleanKeyframeTrack',function(){return BooleanKeyframeTrack}),n.d(t,'PropertyMixer',function(){return PropertyMixer}),n.d(t,'PropertyBinding',function(){return PropertyBinding}),n.d(t,'KeyframeTrack',function(){return KeyframeTrack}),n.d(t,'AnimationUtils',function(){return cn}),n.d(t,'AnimationObjectGroup',function(){return AnimationObjectGroup}),n.d(t,'AnimationMixer',function(){return AnimationMixer}),n.d(t,'AnimationClip',function(){return AnimationClip}),n.d(t,'Uniform',function(){return Uniform}),n.d(t,'InstancedBufferGeometry',function(){return InstancedBufferGeometry}),n.d(t,'BufferGeometry',function(){return BufferGeometry}),n.d(t,'GeometryIdCount',function(){return GeometryIdCount}),n.d(t,'Geometry',function(){return Geometry}),n.d(t,'InterleavedBufferAttribute',function(){return InterleavedBufferAttribute}),n.d(t,'InstancedInterleavedBuffer',function(){return InstancedInterleavedBuffer}),n.d(t,'InterleavedBuffer',function(){return InterleavedBuffer}),n.d(t,'InstancedBufferAttribute',function(){return InstancedBufferAttribute}),n.d(t,'Face3',function(){return Face3}),n.d(t,'Object3D',function(){return Object3D}),n.d(t,'Raycaster',function(){return Raycaster}),n.d(t,'Layers',function(){return Layers}),n.d(t,'EventDispatcher',function(){return EventDispatcher}),n.d(t,'Clock',function(){return Clock}),n.d(t,'QuaternionLinearInterpolant',function(){return QuaternionLinearInterpolant}),n.d(t,'LinearInterpolant',function(){return LinearInterpolant}),n.d(t,'DiscreteInterpolant',function(){return DiscreteInterpolant}),n.d(t,'CubicInterpolant',function(){return CubicInterpolant}),n.d(t,'Interpolant',function(){return Interpolant}),n.d(t,'Triangle',function(){return Triangle}),n.d(t,'Math',function(){return kt}),n.d(t,'Spherical',function(){return Spherical}),n.d(t,'Cylindrical',function(){return Cylindrical}),n.d(t,'Plane',function(){return Plane}),n.d(t,'Frustum',function(){return Frustum}),n.d(t,'Sphere',function(){return Sphere}),n.d(t,'Ray',function(){return Ray}),n.d(t,'Matrix4',function(){return Matrix4}),n.d(t,'Matrix3',function(){return Matrix3}),n.d(t,'Box3',function(){return Box3}),n.d(t,'Box2',function(){return Box2}),n.d(t,'Line3',function(){return Line3}),n.d(t,'Euler',function(){return Euler}),n.d(t,'Vector4',function(){return Vector4}),n.d(t,'Vector3',function(){return Vector3}),n.d(t,'Vector2',function(){return Vector2}),n.d(t,'Quaternion',function(){return Quaternion}),n.d(t,'Color',function(){return Color}),n.d(t,'ImmediateRenderObject',function(){return ImmediateRenderObject}),n.d(t,'VertexNormalsHelper',function(){return VertexNormalsHelper}),n.d(t,'SpotLightHelper',function(){return SpotLightHelper}),n.d(t,'SkeletonHelper',function(){return SkeletonHelper}),n.d(t,'PointLightHelper',function(){return PointLightHelper}),n.d(t,'RectAreaLightHelper',function(){return RectAreaLightHelper}),n.d(t,'HemisphereLightHelper',function(){return HemisphereLightHelper}),n.d(t,'GridHelper',function(){return GridHelper}),n.d(t,'PolarGridHelper',function(){return PolarGridHelper}),n.d(t,'FaceNormalsHelper',function(){return FaceNormalsHelper}),n.d(t,'DirectionalLightHelper',function(){return DirectionalLightHelper}),n.d(t,'CameraHelper',function(){return CameraHelper}),n.d(t,'BoxHelper',function(){return BoxHelper}),n.d(t,'Box3Helper',function(){return Box3Helper}),n.d(t,'PlaneHelper',function(){return PlaneHelper}),n.d(t,'ArrowHelper',function(){return ArrowHelper}),n.d(t,'AxisHelper',function(){return AxisHelper}),n.d(t,'CatmullRomCurve3',function(){return CatmullRomCurve3}),n.d(t,'CubicBezierCurve3',function(){return CubicBezierCurve3}),n.d(t,'QuadraticBezierCurve3',function(){return QuadraticBezierCurve3}),n.d(t,'LineCurve3',function(){return LineCurve3}),n.d(t,'ArcCurve',function(){return ArcCurve}),n.d(t,'EllipseCurve',function(){return EllipseCurve}),n.d(t,'SplineCurve',function(){return SplineCurve}),n.d(t,'CubicBezierCurve',function(){return CubicBezierCurve}),n.d(t,'QuadraticBezierCurve',function(){return QuadraticBezierCurve}),n.d(t,'LineCurve',function(){return LineCurve}),n.d(t,'Shape',function(){return Shape}),n.d(t,'Path',function(){return Path}),n.d(t,'ShapePath',function(){return ShapePath}),n.d(t,'Font',function(){return Font}),n.d(t,'CurvePath',function(){return CurvePath}),n.d(t,'Curve',function(){return Curve}),n.d(t,'ShapeUtils',function(){return rn}),n.d(t,'SceneUtils',function(){return Tn}),n.d(t,'WebGLUtils',function(){return WebGLUtils}),n.d(t,'WireframeGeometry',function(){return WireframeGeometry}),n.d(t,'ParametricGeometry',function(){return ParametricGeometry}),n.d(t,'ParametricBufferGeometry',function(){return ParametricBufferGeometry}),n.d(t,'TetrahedronGeometry',function(){return TetrahedronGeometry}),n.d(t,'TetrahedronBufferGeometry',function(){return TetrahedronBufferGeometry}),n.d(t,'OctahedronGeometry',function(){return OctahedronGeometry}),n.d(t,'OctahedronBufferGeometry',function(){return OctahedronBufferGeometry}),n.d(t,'IcosahedronGeometry',function(){return IcosahedronGeometry}),n.d(t,'IcosahedronBufferGeometry',function(){return IcosahedronBufferGeometry}),n.d(t,'DodecahedronGeometry',function(){return DodecahedronGeometry}),n.d(t,'DodecahedronBufferGeometry',function(){return DodecahedronBufferGeometry}),n.d(t,'PolyhedronGeometry',function(){return PolyhedronGeometry}),n.d(t,'PolyhedronBufferGeometry',function(){return PolyhedronBufferGeometry}),n.d(t,'TubeGeometry',function(){return TubeGeometry}),n.d(t,'TubeBufferGeometry',function(){return TubeBufferGeometry}),n.d(t,'TorusKnotGeometry',function(){return TorusKnotGeometry}),n.d(t,'TorusKnotBufferGeometry',function(){return TorusKnotBufferGeometry}),n.d(t,'TorusGeometry',function(){return TorusGeometry}),n.d(t,'TorusBufferGeometry',function(){return TorusBufferGeometry}),n.d(t,'TextGeometry',function(){return TextGeometry}),n.d(t,'TextBufferGeometry',function(){return TextBufferGeometry}),n.d(t,'SphereGeometry',function(){return SphereGeometry}),n.d(t,'SphereBufferGeometry',function(){return SphereBufferGeometry}),n.d(t,'RingGeometry',function(){return RingGeometry}),n.d(t,'RingBufferGeometry',function(){return RingBufferGeometry}),n.d(t,'PlaneGeometry',function(){return PlaneGeometry}),n.d(t,'PlaneBufferGeometry',function(){return PlaneBufferGeometry}),n.d(t,'LatheGeometry',function(){return LatheGeometry}),n.d(t,'LatheBufferGeometry',function(){return LatheBufferGeometry}),n.d(t,'ShapeGeometry',function(){return ShapeGeometry}),n.d(t,'ShapeBufferGeometry',function(){return ShapeBufferGeometry}),n.d(t,'ExtrudeGeometry',function(){return ExtrudeGeometry}),n.d(t,'ExtrudeBufferGeometry',function(){return ExtrudeBufferGeometry}),n.d(t,'EdgesGeometry',function(){return EdgesGeometry}),n.d(t,'ConeGeometry',function(){return ConeGeometry}),n.d(t,'ConeBufferGeometry',function(){return ConeBufferGeometry}),n.d(t,'CylinderGeometry',function(){return CylinderGeometry}),n.d(t,'CylinderBufferGeometry',function(){return CylinderBufferGeometry}),n.d(t,'CircleGeometry',function(){return CircleGeometry}),n.d(t,'CircleBufferGeometry',function(){return CircleBufferGeometry}),n.d(t,'BoxGeometry',function(){return BoxGeometry}),n.d(t,'BoxBufferGeometry',function(){return BoxBufferGeometry}),n.d(t,'ShadowMaterial',function(){return ShadowMaterial}),n.d(t,'SpriteMaterial',function(){return SpriteMaterial}),n.d(t,'RawShaderMaterial',function(){return RawShaderMaterial}),n.d(t,'ShaderMaterial',function(){return ShaderMaterial}),n.d(t,'PointsMaterial',function(){return PointsMaterial}),n.d(t,'MeshPhysicalMaterial',function(){return MeshPhysicalMaterial}),n.d(t,'MeshStandardMaterial',function(){return MeshStandardMaterial}),n.d(t,'MeshPhongMaterial',function(){return MeshPhongMaterial}),n.d(t,'MeshToonMaterial',function(){return MeshToonMaterial}),n.d(t,'MeshNormalMaterial',function(){return MeshNormalMaterial}),n.d(t,'MeshLambertMaterial',function(){return MeshLambertMaterial}),n.d(t,'MeshDepthMaterial',function(){return MeshDepthMaterial}),n.d(t,'MeshDistanceMaterial',function(){return MeshDistanceMaterial}),n.d(t,'MeshBasicMaterial',function(){return MeshBasicMaterial}),n.d(t,'LineDashedMaterial',function(){return LineDashedMaterial}),n.d(t,'LineBasicMaterial',function(){return LineBasicMaterial}),n.d(t,'Material',function(){return Material}),n.d(t,'Float64BufferAttribute',function(){return Float64BufferAttribute}),n.d(t,'Float32BufferAttribute',function(){return Float32BufferAttribute}),n.d(t,'Uint32BufferAttribute',function(){return Uint32BufferAttribute}),n.d(t,'Int32BufferAttribute',function(){return Int32BufferAttribute}),n.d(t,'Uint16BufferAttribute',function(){return Uint16BufferAttribute}),n.d(t,'Int16BufferAttribute',function(){return Int16BufferAttribute}),n.d(t,'Uint8ClampedBufferAttribute',function(){return Uint8ClampedBufferAttribute}),n.d(t,'Uint8BufferAttribute',function(){return Uint8BufferAttribute}),n.d(t,'Int8BufferAttribute',function(){return Int8BufferAttribute}),n.d(t,'BufferAttribute',function(){return BufferAttribute}),n.d(t,'REVISION',function(){return b}),n.d(t,'MOUSE',function(){return x}),n.d(t,'CullFaceNone',function(){return v}),n.d(t,'CullFaceBack',function(){return T}),n.d(t,'CullFaceFront',function(){return R}),n.d(t,'CullFaceFrontBack',function(){return F}),n.d(t,'FrontFaceDirectionCW',function(){return w}),n.d(t,'FrontFaceDirectionCCW',function(){return M}),n.d(t,'BasicShadowMap',function(){return L}),n.d(t,'PCFShadowMap',function(){return B}),n.d(t,'PCFSoftShadowMap',function(){return D}),n.d(t,'FrontSide',function(){return I}),n.d(t,'BackSide',function(){return N}),n.d(t,'DoubleSide',function(){return P}),n.d(t,'FlatShading',function(){return O}),n.d(t,'SmoothShading',function(){return U}),n.d(t,'NoColors',function(){return G}),n.d(t,'FaceColors',function(){return k}),n.d(t,'VertexColors',function(){return W}),n.d(t,'NoBlending',function(){return H}),n.d(t,'NormalBlending',function(){return V}),n.d(t,'AdditiveBlending',function(){return $}),n.d(t,'SubtractiveBlending',function(){return z}),n.d(t,'MultiplyBlending',function(){return X}),n.d(t,'CustomBlending',function(){return j}),n.d(t,'AddEquation',function(){return Y}),n.d(t,'SubtractEquation',function(){return K}),n.d(t,'ReverseSubtractEquation',function(){return q}),n.d(t,'MinEquation',function(){return Z}),n.d(t,'MaxEquation',function(){return Q}),n.d(t,'ZeroFactor',function(){return J}),n.d(t,'OneFactor',function(){return ee}),n.d(t,'SrcColorFactor',function(){return te}),n.d(t,'OneMinusSrcColorFactor',function(){return ne}),n.d(t,'SrcAlphaFactor',function(){return ae}),n.d(t,'OneMinusSrcAlphaFactor',function(){return re}),n.d(t,'DstAlphaFactor',function(){return oe}),n.d(t,'OneMinusDstAlphaFactor',function(){return ie}),n.d(t,'DstColorFactor',function(){return se}),n.d(t,'OneMinusDstColorFactor',function(){return le}),n.d(t,'SrcAlphaSaturateFactor',function(){return de}),n.d(t,'NeverDepth',function(){return ce}),n.d(t,'AlwaysDepth',function(){return pe}),n.d(t,'LessDepth',function(){return ue}),n.d(t,'LessEqualDepth',function(){return me}),n.d(t,'EqualDepth',function(){return ge}),n.d(t,'GreaterEqualDepth',function(){return he}),n.d(t,'GreaterDepth',function(){return fe}),n.d(t,'NotEqualDepth',function(){return Ee}),n.d(t,'MultiplyOperation',function(){return _e}),n.d(t,'MixOperation',function(){return Ce}),n.d(t,'AddOperation',function(){return ye}),n.d(t,'NoToneMapping',function(){return Ae}),n.d(t,'LinearToneMapping',function(){return be}),n.d(t,'ReinhardToneMapping',function(){return xe}),n.d(t,'Uncharted2ToneMapping',function(){return ve}),n.d(t,'CineonToneMapping',function(){return Te}),n.d(t,'UVMapping',function(){return Se}),n.d(t,'CubeReflectionMapping',function(){return Re}),n.d(t,'CubeRefractionMapping',function(){return Fe}),n.d(t,'EquirectangularReflectionMapping',function(){return we}),n.d(t,'EquirectangularRefractionMapping',function(){return Me}),n.d(t,'SphericalReflectionMapping',function(){return Le}),n.d(t,'CubeUVReflectionMapping',function(){return Be}),n.d(t,'CubeUVRefractionMapping',function(){return De}),n.d(t,'RepeatWrapping',function(){return Ie}),n.d(t,'ClampToEdgeWrapping',function(){return Ne}),n.d(t,'MirroredRepeatWrapping',function(){return Pe}),n.d(t,'NearestFilter',function(){return Oe}),n.d(t,'NearestMipMapNearestFilter',function(){return Ue}),n.d(t,'NearestMipMapLinearFilter',function(){return Ge}),n.d(t,'LinearFilter',function(){return ke}),n.d(t,'LinearMipMapNearestFilter',function(){return We}),n.d(t,'LinearMipMapLinearFilter',function(){return He}),n.d(t,'UnsignedByteType',function(){return Ve}),n.d(t,'ByteType',function(){return $e}),n.d(t,'ShortType',function(){return ze}),n.d(t,'UnsignedShortType',function(){return Xe}),n.d(t,'IntType',function(){return je}),n.d(t,'UnsignedIntType',function(){return Ye}),n.d(t,'FloatType',function(){return Ke}),n.d(t,'HalfFloatType',function(){return qe}),n.d(t,'UnsignedShort4444Type',function(){return Ze}),n.d(t,'UnsignedShort5551Type',function(){return Qe}),n.d(t,'UnsignedShort565Type',function(){return Je}),n.d(t,'UnsignedInt248Type',function(){return et}),n.d(t,'AlphaFormat',function(){return tt}),n.d(t,'RGBFormat',function(){return nt}),n.d(t,'RGBAFormat',function(){return at}),n.d(t,'LuminanceFormat',function(){return rt}),n.d(t,'LuminanceAlphaFormat',function(){return ot}),n.d(t,'RGBEFormat',function(){return it}),n.d(t,'DepthFormat',function(){return st}),n.d(t,'DepthStencilFormat',function(){return lt}),n.d(t,'RGB_S3TC_DXT1_Format',function(){return dt}),n.d(t,'RGBA_S3TC_DXT1_Format',function(){return ct}),n.d(t,'RGBA_S3TC_DXT3_Format',function(){return pt}),n.d(t,'RGBA_S3TC_DXT5_Format',function(){return ut}),n.d(t,'RGB_PVRTC_4BPPV1_Format',function(){return mt}),n.d(t,'RGB_PVRTC_2BPPV1_Format',function(){return gt}),n.d(t,'RGBA_PVRTC_4BPPV1_Format',function(){return ht}),n.d(t,'RGBA_PVRTC_2BPPV1_Format',function(){return ft}),n.d(t,'RGB_ETC1_Format',function(){return Et}),n.d(t,'LoopOnce',function(){return _t}),n.d(t,'LoopRepeat',function(){return Ct}),n.d(t,'LoopPingPong',function(){return yt}),n.d(t,'InterpolateDiscrete',function(){return At}),n.d(t,'InterpolateLinear',function(){return bt}),n.d(t,'InterpolateSmooth',function(){return xt}),n.d(t,'ZeroCurvatureEnding',function(){return vt}),n.d(t,'ZeroSlopeEnding',function(){return Tt}),n.d(t,'WrapAroundEnding',function(){return St}),n.d(t,'TrianglesDrawMode',function(){return Rt}),n.d(t,'TriangleStripDrawMode',function(){return Ft}),n.d(t,'TriangleFanDrawMode',function(){return wt}),n.d(t,'LinearEncoding',function(){return Mt}),n.d(t,'sRGBEncoding',function(){return Lt}),n.d(t,'GammaEncoding',function(){return Bt}),n.d(t,'RGBEEncoding',function(){return Dt}),n.d(t,'LogLuvEncoding',function(){return It}),n.d(t,'RGBM7Encoding',function(){return Nt}),n.d(t,'RGBM16Encoding',function(){return Pt}),n.d(t,'RGBDEncoding',function(){return Ot}),n.d(t,'BasicDepthPacking',function(){return Ut}),n.d(t,'RGBADepthPacking',function(){return Gt}),n.d(t,'CubeGeometry',function(){return BoxGeometry}),n.d(t,'Face4',function(){return Face4}),n.d(t,'LineStrip',function(){return Sn}),n.d(t,'LinePieces',function(){return Rn}),n.d(t,'MeshFaceMaterial',function(){return MeshFaceMaterial}),n.d(t,'MultiMaterial',function(){return MultiMaterial}),n.d(t,'PointCloud',function(){return PointCloud}),n.d(t,'Particle',function(){return Particle}),n.d(t,'ParticleSystem',function(){return ParticleSystem}),n.d(t,'PointCloudMaterial',function(){return PointCloudMaterial}),n.d(t,'ParticleBasicMaterial',function(){return ParticleBasicMaterial}),n.d(t,'ParticleSystemMaterial',function(){return ParticleSystemMaterial}),n.d(t,'Vertex',function(){return Vertex}),n.d(t,'DynamicBufferAttribute',function(){return DynamicBufferAttribute}),n.d(t,'Int8Attribute',function(){return Int8Attribute}),n.d(t,'Uint8Attribute',function(){return Uint8Attribute}),n.d(t,'Uint8ClampedAttribute',function(){return Uint8ClampedAttribute}),n.d(t,'Int16Attribute',function(){return Int16Attribute}),n.d(t,'Uint16Attribute',function(){return Uint16Attribute}),n.d(t,'Int32Attribute',function(){return Int32Attribute}),n.d(t,'Uint32Attribute',function(){return Uint32Attribute}),n.d(t,'Float32Attribute',function(){return Float32Attribute}),n.d(t,'Float64Attribute',function(){return Float64Attribute}),n.d(t,'ClosedSplineCurve3',function(){return ClosedSplineCurve3}),n.d(t,'SplineCurve3',function(){return SplineCurve3}),n.d(t,'Spline',function(){return Spline}),n.d(t,'BoundingBoxHelper',function(){return BoundingBoxHelper}),n.d(t,'EdgesHelper',function(){return EdgesHelper}),n.d(t,'WireframeHelper',function(){return WireframeHelper}),n.d(t,'XHRLoader',function(){return XHRLoader}),n.d(t,'BinaryTextureLoader',function(){return BinaryTextureLoader}),n.d(t,'GeometryUtils',function(){return Fn}),n.d(t,'ImageUtils',function(){return wn}),n.d(t,'Projector',function(){return Projector}),n.d(t,'CanvasRenderer',function(){return CanvasRenderer}),g===void 0&&(g=2.220446049250313e-16),u===void 0&&(u=function(e){return'number'==typeof e&&isFinite(e)&&h(e)===e}),p===void 0&&(p=function(e){return 0>e?-1:0r;r++)8===r||13===r||18===r||23===r?t[r]='-':14===r?t[r]='4':(2>=n&&(n=0|33554432+16777216*Math.random()),a=15&n,n>>=4,t[r]=e[19===r?8|3&a:a]);return t.join('')}}(),clamp:function(e,t,n){return y(t,f(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,a,r){return a+(e-t)*(r-a)/(n-t)},lerp:function(e,n,a){return(1-a)*e+a*n},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*(3-2*e))},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t),e*e*e*(e*(6*e-15)+10))},randInt:function(e,t){return e+h(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(0.5-Math.random())},degToRad:function(e){return e*kt.DEG2RAD},radToDeg:function(e){return e*kt.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},nearestPowerOfTwo:function(e){return s(2,l(c(e)/d))},nextPowerOfTwo:function(e){return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e++,e}};Object.defineProperties(Vector2.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),Object.assign(Vector2.prototype,{isVector2:!0,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error('index is out of range: '+e);}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error('index is out of range: '+e);}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0===t?(this.x+=e.x,this.y+=e.y,this):(console.warn('THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'),this.addVectors(e,t))},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub:function(e,t){return void 0===t?(this.x-=e.x,this.y-=e.y,this):(console.warn('THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'),this.subVectors(e,t))},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=f(this.x,e.x),this.y=f(this.y,e.y),this},max:function(e){return this.x=y(this.x,e.x),this.y=y(this.y,e.y),this},clamp:function(e,t){return this.x=y(e.x,f(t.x,this.x)),this.y=y(e.y,f(t.y,this.y)),this},clampScalar:function(){var e=new Vector2,t=new Vector2;return function clampScalar(n,a){return e.set(n,n),t.set(a,a),this.clamp(e,t)}}(),clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(y(e,f(t,n)))},floor:function(){return this.x=h(this.x),this.y=h(this.y),this},ceil:function(){return this.x=C(this.x),this.y=C(this.y),this},round:function(){return this.x=l(this.x),this.y=l(this.y),this},roundToZero:function(){return this.x=0>this.x?C(this.x):h(this.x),this.y=0>this.y?C(this.y):h(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(e){return this.x*e.x+this.y*e.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return _(this.x*this.x+this.y*this.y)},lengthManhattan:function(){return A(this.x)+A(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var e=i(this.y,this.x);return 0>e&&(e+=2*S),e},distanceTo:function(e){return _(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},distanceToManhattan:function(e){return A(this.x-e.x)+A(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn('THREE.Vector2: offset has been removed from .fromBufferAttribute().'),this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var n=m(t),a=o(t),r=this.x-e.x,i=this.y-e.y;return this.x=r*n-i*a+e.x,this.y=r*a+i*n+e.y,this}});var Wt=0;Texture.DEFAULT_IMAGE=void 0,Texture.DEFAULT_MAPPING=Se,Object.defineProperty(Texture.prototype,'needsUpdate',{set:function(e){!0===e&&this.version++}}),Object.assign(Texture.prototype,EventDispatcher.prototype,{constructor:Texture,isTexture:!0,clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){function getDataURL(e){var t;if(e instanceof HTMLCanvasElement)t=e;else{t=document.createElementNS('http://www.w3.org/1999/xhtml','canvas'),t.width=e.width,t.height=e.height;var n=t.getContext('2d');e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height)}return 2048e.x||1e.x?0:1;break;case Pe:1===A(h(e.x)%2)?e.x=C(e.x)-e.x:e.x-=h(e.x);}if(0>e.y||1e.y?0:1;break;case Pe:1===A(h(e.y)%2)?e.y=C(e.y)-e.y:e.y-=h(e.y);}this.flipY&&(e.y=1-e.y)}}}),Object.assign(Vector4.prototype,{isVector4:!0,set:function(e,t,n,a){return this.x=e,this.y=t,this.z=n,this.w=a,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error('index is out of range: '+e);}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error('index is out of range: '+e);}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0===e.w?1:e.w,this},add:function(e,t){return void 0===t?(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this):(console.warn('THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'),this.addVectors(e,t))},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this},sub:function(e,t){return void 0===t?(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this):(console.warn('THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'),this.subVectors(e,t))},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(t){var n=this.x,a=this.y,r=this.z,o=this.w,i=t.elements;return this.x=i[0]*n+i[4]*a+i[8]*r+i[12]*o,this.y=i[1]*n+i[5]*a+i[9]*r+i[13]*o,this.z=i[2]*n+i[6]*a+i[10]*r+i[14]*o,this.w=i[3]*n+i[7]*a+i[11]*r+i[15]*o,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*r(e.w);var t=_(1-e.w*e.w);return 1e-4>t?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t=0.01,n=0.1,a=e.elements,o=a[0],i=a[4],l=a[8],d=a[1],c=a[5],p=a[9],u=a[2],m=a[6],g=a[10],h,f,E,C;if(A(i-d)b&&y>x?yx?bA(F)&&(F=1),this.x=(m-p)/F,this.y=(l-u)/F,this.z=(d-i)/F,this.w=r((o+c+g-1)/2),this},min:function(e){return this.x=f(this.x,e.x),this.y=f(this.y,e.y),this.z=f(this.z,e.z),this.w=f(this.w,e.w),this},max:function(e){return this.x=y(this.x,e.x),this.y=y(this.y,e.y),this.z=y(this.z,e.z),this.w=y(this.w,e.w),this},clamp:function(e,t){return this.x=y(e.x,f(t.x,this.x)),this.y=y(e.y,f(t.y,this.y)),this.z=y(e.z,f(t.z,this.z)),this.w=y(e.w,f(t.w,this.w)),this},clampScalar:function(){var e,t;return function clampScalar(n,a){return void 0==e&&(e=new Vector4,t=new Vector4),e.set(n,n,n,n),t.set(a,a,a,a),this.clamp(e,t)}}(),clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(y(e,f(t,n)))},floor:function(){return this.x=h(this.x),this.y=h(this.y),this.z=h(this.z),this.w=h(this.w),this},ceil:function(){return this.x=C(this.x),this.y=C(this.y),this.z=C(this.z),this.w=C(this.w),this},round:function(){return this.x=l(this.x),this.y=l(this.y),this.z=l(this.z),this.w=l(this.w),this},roundToZero:function(){return this.x=0>this.x?C(this.x):h(this.x),this.y=0>this.y?C(this.y):h(this.y),this.z=0>this.z?C(this.z):h(this.z),this.w=0>this.w?C(this.w):h(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(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return _(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return A(this.x)+A(this.y)+A(this.z)+A(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn('THREE.Vector4: offset has been removed from .fromBufferAttribute().'),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}}),Object.assign(WebGLRenderTarget.prototype,EventDispatcher.prototype,{isWebGLRenderTarget:!0,setSize:function(e,t){(this.width!==e||this.height!==t)&&(this.width=e,this.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:'dispose'})}}),WebGLRenderTargetCube.prototype=Object.create(WebGLRenderTarget.prototype),WebGLRenderTargetCube.prototype.constructor=WebGLRenderTargetCube,WebGLRenderTargetCube.prototype.isWebGLRenderTargetCube=!0,Object.assign(Quaternion,{slerp:function(e,n,a,r){return a.copy(e).slerp(n,r)},slerpFlat:function(e,n,a,r,l,d,c){var t=a[r+0],p=a[r+1],u=a[r+2],m=a[r+3],h=l[d+0],E=l[d+1],C=l[d+2],y=l[d+3];if(m!==y||t!==h||p!==E||u!==C){var A=1-c,s=t*h+p*E+u*C+m*y,b=0<=s?1:-1,x=1-s*s;if(x>g){var v=_(x),T=i(v,s*b);A=o(A*T)/v,c=o(c*T)/v}var S=c*b;if(t=t*A+h*S,p=p*A+E*S,u=u*A+C*S,m=m*A+y*S,A==1-c){var R=1/_(t*t+p*p+u*u+m*m);t*=R,p*=R,u*=R,m*=R}}e[n]=t,e[n+1]=p,e[n+2]=u,e[n+3]=m}}),Object.defineProperties(Quaternion.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this.onChangeCallback()}}}),Object.assign(Quaternion.prototype,{set:function(e,t,n,a){return this._x=e,this._y=t,this._z=n,this._w=a,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this.onChangeCallback(),this},setFromEuler:function(e,t){if(!(e&&e.isEuler))throw new Error('THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.');var n=e._x,a=e._y,r=e._z,i=e.order,s=m,l=o,d=s(n/2),c=s(a/2),p=s(r/2),u=l(n/2),g=l(a/2),h=l(r/2);return'XYZ'===i?(this._x=u*c*p+d*g*h,this._y=d*g*p-u*c*h,this._z=d*c*h+u*g*p,this._w=d*c*p-u*g*h):'YXZ'===i?(this._x=u*c*p+d*g*h,this._y=d*g*p-u*c*h,this._z=d*c*h-u*g*p,this._w=d*c*p+u*g*h):'ZXY'===i?(this._x=u*c*p-d*g*h,this._y=d*g*p+u*c*h,this._z=d*c*h+u*g*p,this._w=d*c*p-u*g*h):'ZYX'===i?(this._x=u*c*p-d*g*h,this._y=d*g*p+u*c*h,this._z=d*c*h-u*g*p,this._w=d*c*p+u*g*h):'YZX'===i?(this._x=u*c*p+d*g*h,this._y=d*g*p+u*c*h,this._z=d*c*h-u*g*p,this._w=d*c*p-u*g*h):'XZY'===i&&(this._x=u*c*p-d*g*h,this._y=d*g*p-u*c*h,this._z=d*c*h+u*g*p,this._w=d*c*p+u*g*h),!1!==t&&this.onChangeCallback(),this},setFromAxisAngle:function(e,t){var n=t/2,a=o(n);return this._x=e.x*a,this._y=e.y*a,this._z=e.z*a,this._w=m(n),this.onChangeCallback(),this},setFromRotationMatrix:function(e){var t=e.elements,n=t[0],a=t[4],r=t[8],o=t[1],i=t[5],l=t[9],d=t[2],c=t[6],p=t[10],u=n+i+p,m;return 0i&&n>p?(m=2*_(1+n-i-p),this._w=(c-l)/m,this._x=0.25*m,this._y=(a+o)/m,this._z=(r+d)/m):i>p?(m=2*_(1+i-n-p),this._w=(r-d)/m,this._x=(a+o)/m,this._y=0.25*m,this._z=(l+c)/m):(m=2*_(1+p-n-i),this._w=(o-a)/m,this._x=(r+d)/m,this._y=(l+c)/m,this._z=0.25*m),this.onChangeCallback(),this},setFromUnitVectors:function(){var e=new Vector3,t;return function setFromUnitVectors(n,a){return void 0===e&&(e=new Vector3),t=n.dot(a)+1,t<1e-6?(t=0,A(n.x)>A(n.z)?e.set(-n.y,n.x,0):e.set(0,-n.z,n.y)):e.crossVectors(n,a),this._x=e.x,this._y=e.y,this._z=e.z,this._w=t,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(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return _(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x*=e,this._y*=e,this._z*=e,this._w*=e),this.onChangeCallback(),this},multiply:function(e,t){return void 0===t?this.multiplyQuaternions(this,e):(console.warn('THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.'),this.multiplyQuaternions(e,t))},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var n=e._x,a=e._y,r=e._z,o=e._w,i=t._x,s=t._y,l=t._z,d=t._w;return this._x=n*d+o*i+a*l-r*s,this._y=a*d+o*s+r*i-n*l,this._z=r*d+o*l+n*s-a*i,this._w=o*d-n*i-a*s-r*l,this.onChangeCallback(),this},slerp:function(e,n){if(0===n)return this;if(1===n)return this.copy(e);var t=this._x,a=this._y,r=this._z,s=this._w,l=s*e._w+t*e._x+a*e._y+r*e._z;if(0>l?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,l=-l):this.copy(e),1<=l)return this._w=s,this._x=t,this._y=a,this._z=r,this;var d=_(1-l*l);if(1e-3>A(d))return this._w=0.5*(s+this._w),this._x=0.5*(t+this._x),this._y=0.5*(a+this._y),this._z=0.5*(r+this._z),this;var c=i(d,l),p=o((1-n)*c)/d,u=o(n*c)/d;return this._w=s*p+this._w*u,this._x=t*p+this._x*u,this._y=a*p+this._y*u,this._z=r*p+this._z*u,this.onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),Object.assign(Vector3.prototype,{isVector3:!0,set:function(e,t,n){return this.x=e,this.y=t,this.z=n,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error('index is out of range: '+e);}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error('index is out of range: '+e);}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0===t?(this.x+=e.x,this.y+=e.y,this.z+=e.z,this):(console.warn('THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'),this.addVectors(e,t))},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0===t?(this.x-=e.x,this.y-=e.y,this.z-=e.z,this):(console.warn('THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'),this.subVectors(e,t))},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0===t?(this.x*=e.x,this.y*=e.y,this.z*=e.z,this):(console.warn('THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.'),this.multiplyVectors(e,t))},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:function(){var e=new Quaternion;return function applyEuler(t){return t&&t.isEuler||console.error('THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.'),this.applyQuaternion(e.setFromEuler(t))}}(),applyAxisAngle:function(){var e=new Quaternion;return function applyAxisAngle(t,n){return this.applyQuaternion(e.setFromAxisAngle(t,n))}}(),applyMatrix3:function(t){var n=this.x,a=this.y,r=this.z,o=t.elements;return this.x=o[0]*n+o[3]*a+o[6]*r,this.y=o[1]*n+o[4]*a+o[7]*r,this.z=o[2]*n+o[5]*a+o[8]*r,this},applyMatrix4:function(t){var n=this.x,a=this.y,r=this.z,o=t.elements,e=1/(o[3]*n+o[7]*a+o[11]*r+o[15]);return this.x=(o[0]*n+o[4]*a+o[8]*r+o[12])*e,this.y=(o[1]*n+o[5]*a+o[9]*r+o[13])*e,this.z=(o[2]*n+o[6]*a+o[10]*r+o[14])*e,this},applyQuaternion:function(e){var t=this.x,n=this.y,a=this.z,r=e.x,o=e.y,i=e.z,s=e.w,l=s*t+o*a-i*n,d=s*n+i*t-r*a,c=s*a+r*n-o*t,p=-r*t-o*n-i*a;return this.x=l*s+p*-r+d*-i-c*-o,this.y=d*s+p*-o+c*-r-l*-i,this.z=c*s+p*-i+l*-o-d*-r,this},project:function(){var e=new Matrix4;return function project(t){return e.multiplyMatrices(t.projectionMatrix,e.getInverse(t.matrixWorld)),this.applyMatrix4(e)}}(),unproject:function(){var e=new Matrix4;return function unproject(t){return e.multiplyMatrices(t.matrixWorld,e.getInverse(t.projectionMatrix)),this.applyMatrix4(e)}}(),transformDirection:function(t){var n=this.x,a=this.y,r=this.z,o=t.elements;return this.x=o[0]*n+o[4]*a+o[8]*r,this.y=o[1]*n+o[5]*a+o[9]*r,this.z=o[2]*n+o[6]*a+o[10]*r,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=f(this.x,e.x),this.y=f(this.y,e.y),this.z=f(this.z,e.z),this},max:function(e){return this.x=y(this.x,e.x),this.y=y(this.y,e.y),this.z=y(this.z,e.z),this},clamp:function(e,t){return this.x=y(e.x,f(t.x,this.x)),this.y=y(e.y,f(t.y,this.y)),this.z=y(e.z,f(t.z,this.z)),this},clampScalar:function(){var e=new Vector3,t=new Vector3;return function clampScalar(n,a){return e.set(n,n,n),t.set(a,a,a),this.clamp(e,t)}}(),clampLength:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(y(e,f(t,n)))},floor:function(){return this.x=h(this.x),this.y=h(this.y),this.z=h(this.z),this},ceil:function(){return this.x=C(this.x),this.y=C(this.y),this.z=C(this.z),this},round:function(){return this.x=l(this.x),this.y=l(this.y),this.z=l(this.z),this},roundToZero:function(){return this.x=0>this.x?C(this.x):h(this.x),this.y=0>this.y?C(this.y):h(this.y),this.z=0>this.z?C(this.z):h(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(e){return this.x*e.x+this.y*e.y+this.z*e.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return _(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return A(this.x)+A(this.y)+A(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,n){return this.subVectors(t,e).multiplyScalar(n).add(e)},cross:function(e,t){if(void 0!==t)return console.warn('THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.'),this.crossVectors(e,t);var n=this.x,a=this.y,r=this.z;return this.x=a*e.z-r*e.y,this.y=r*e.x-n*e.z,this.z=n*e.y-a*e.x,this},crossVectors:function(e,t){var n=e.x,a=e.y,r=e.z,o=t.x,i=t.y,s=t.z;return this.x=a*s-r*i,this.y=r*o-n*s,this.z=n*i-a*o,this},projectOnVector:function(e){var t=e.dot(this)/e.lengthSq();return this.copy(e).multiplyScalar(t)},projectOnPlane:function(){var e=new Vector3;return function projectOnPlane(t){return e.copy(this).projectOnVector(t),this.sub(e)}}(),reflect:function(){var e=new Vector3;return function reflect(t){return this.sub(e.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(e){var t=this.dot(e)/_(this.lengthSq()*e.lengthSq());return r(kt.clamp(t,-1,1))},distanceTo:function(e){return _(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,n=this.y-e.y,a=this.z-e.z;return t*t+n*n+a*a},distanceToManhattan:function(e){return A(this.x-e.x)+A(this.y-e.y)+A(this.z-e.z)},setFromSpherical:function(e){var t=o(e.phi)*e.radius;return this.x=t*o(e.theta),this.y=m(e.phi)*e.radius,this.z=t*m(e.theta),this},setFromCylindrical:function(e){return this.x=e.radius*o(e.theta),this.y=e.y,this.z=e.radius*m(e.theta),this},setFromMatrixPosition:function(t){var n=t.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),a=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=a,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,n){return void 0!==n&&console.warn('THREE.Vector3: offset has been removed from .fromBufferAttribute().'),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}}),Object.assign(Matrix4.prototype,{isMatrix4:!0,set:function(e,t,n,a,r,o,i,s,l,d,c,p,u,m,g,h){var f=this.elements;return f[0]=e,f[4]=t,f[8]=n,f[12]=a,f[1]=r,f[5]=o,f[9]=i,f[13]=s,f[2]=l,f[6]=d,f[10]=c,f[14]=p,f[3]=u,f[7]=m,f[11]=g,f[15]=h,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 Matrix4().fromArray(this.elements)},copy:function(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this},copyPosition:function(e){var t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this},extractBasis:function(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this},extractRotation:function(){var e=new Vector3;return function extractRotation(t){var n=this.elements,a=t.elements,r=1/e.setFromMatrixColumn(t,0).length(),o=1/e.setFromMatrixColumn(t,1).length(),i=1/e.setFromMatrixColumn(t,2).length();return n[0]=a[0]*r,n[1]=a[1]*r,n[2]=a[2]*r,n[4]=a[4]*o,n[5]=a[5]*o,n[6]=a[6]*o,n[8]=a[8]*i,n[9]=a[9]*i,n[10]=a[10]*i,this}}(),makeRotationFromEuler:function(t){t&&t.isEuler||console.error('THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.');var n=this.elements,r=t.x,i=t.y,s=t.z,l=m(r),p=o(r),u=m(i),g=o(i),h=m(s),e=o(s);if('XYZ'===t.order){var E=l*h,_=l*e,C=p*h,y=p*e;n[0]=u*h,n[4]=-u*e,n[8]=g,n[1]=_+C*g,n[5]=E-y*g,n[9]=-p*u,n[2]=y-E*g,n[6]=C+_*g,n[10]=l*u}else if('YXZ'===t.order){var A=u*h,x=u*e,v=g*h,T=g*e;n[0]=A+T*p,n[4]=v*p-x,n[8]=l*g,n[1]=l*e,n[5]=l*h,n[9]=-p,n[2]=x*p-v,n[6]=T+A*p,n[10]=l*u}else if('ZXY'===t.order){var A=u*h,x=u*e,v=g*h,T=g*e;n[0]=A-T*p,n[4]=-l*e,n[8]=v+x*p,n[1]=x+v*p,n[5]=l*h,n[9]=T-A*p,n[2]=-l*g,n[6]=p,n[10]=l*u}else if('ZYX'===t.order){var E=l*h,_=l*e,C=p*h,y=p*e;n[0]=u*h,n[4]=C*g-_,n[8]=E*g+y,n[1]=u*e,n[5]=y*g+E,n[9]=_*g-C,n[2]=-g,n[6]=p*u,n[10]=l*u}else if('YZX'===t.order){var S=l*u,R=l*g,F=p*u,w=p*g;n[0]=u*h,n[4]=w-S*e,n[8]=F*e+R,n[1]=e,n[5]=l*h,n[9]=-p*h,n[2]=-g*h,n[6]=R*e+F,n[10]=S-w*e}else if('XZY'===t.order){var S=l*u,R=l*g,F=p*u,w=p*g;n[0]=u*h,n[4]=-e,n[8]=g*h,n[1]=S*e+w,n[5]=l*h,n[9]=R*e-F,n[2]=F*e-R,n[6]=p*h,n[10]=w*e+S}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this},makeRotationFromQuaternion:function(e){var t=this.elements,n=e._x,a=e._y,r=e._z,o=e._w,i=n+n,s=a+a,l=r+r,d=n*i,c=n*s,p=n*l,u=a*s,m=a*l,g=r*l,h=o*i,f=o*s,E=o*l;return t[0]=1-(u+g),t[4]=c-E,t[8]=p+f,t[1]=c+E,t[5]=1-(d+g),t[9]=m-h,t[2]=p-f,t[6]=m+h,t[10]=1-(d+u),t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},lookAt:function(){var e=new Vector3,t=new Vector3,n=new Vector3;return function lookAt(a,r,o){var i=this.elements;return n.subVectors(a,r),0===n.lengthSq()&&(n.z=1),n.normalize(),e.crossVectors(o,n),0===e.lengthSq()&&(1===A(o.z)?n.x+=1e-4:n.z+=1e-4,n.normalize(),e.crossVectors(o,n)),e.normalize(),t.crossVectors(n,e),i[0]=e.x,i[4]=t.x,i[8]=n.x,i[1]=e.y,i[5]=t.y,i[9]=n.y,i[2]=e.z,i[6]=t.z,i[10]=n.z,this}}(),multiply:function(e,t){return void 0===t?this.multiplyMatrices(this,e):(console.warn('THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.'),this.multiplyMatrices(e,t))},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var n=e.elements,a=t.elements,r=this.elements,o=n[0],i=n[4],s=n[8],l=n[12],d=n[1],c=n[5],p=n[9],u=n[13],m=n[2],g=n[6],h=n[10],f=n[14],E=n[3],_=n[7],C=n[11],y=n[15],A=a[0],b=a[4],x=a[8],v=a[12],T=a[1],S=a[5],R=a[9],F=a[13],w=a[2],M=a[6],L=a[10],B=a[14],D=a[3],I=a[7],N=a[11],P=a[15];return r[0]=o*A+i*T+s*w+l*D,r[4]=o*b+i*S+s*M+l*I,r[8]=o*x+i*R+s*L+l*N,r[12]=o*v+i*F+s*B+l*P,r[1]=d*A+c*T+p*w+u*D,r[5]=d*b+c*S+p*M+u*I,r[9]=d*x+c*R+p*L+u*N,r[13]=d*v+c*F+p*B+u*P,r[2]=m*A+g*T+h*w+f*D,r[6]=m*b+g*S+h*M+f*I,r[10]=m*x+g*R+h*L+f*N,r[14]=m*v+g*F+h*B+f*P,r[3]=E*A+_*T+C*w+y*D,r[7]=E*b+_*S+C*M+y*I,r[11]=E*x+_*R+C*L+y*N,r[15]=E*v+_*F+C*B+y*P,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},applyToBufferAttribute:function(){var e=new Vector3;return function applyToBufferAttribute(t){for(var n=0,a=t.count;nd&&(i=-i),n.x=o[12],n.y=o[13],n.z=o[14],t.copy(this);var c=1/i,p=1/s,u=1/l;return t.elements[0]*=c,t.elements[1]*=c,t.elements[2]*=c,t.elements[4]*=p,t.elements[5]*=p,t.elements[6]*=p,t.elements[8]*=u,t.elements[9]*=u,t.elements[10]*=u,a.setFromRotationMatrix(t),r.x=i,r.y=s,r.z=l,this}}(),makePerspective:function(e,t,n,a,r,o){void 0===o&&console.warn('THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.');var i=this.elements;return i[0]=2*r/(t-e),i[4]=0,i[8]=(t+e)/(t-e),i[12]=0,i[1]=0,i[5]=2*r/(n-a),i[9]=(n+a)/(n-a),i[13]=0,i[2]=0,i[6]=0,i[10]=-(o+r)/(o-r),i[14]=-2*o*r/(o-r),i[3]=0,i[7]=0,i[11]=-1,i[15]=0,this},makeOrthographic:function(e,t,n,a,r,o){var i=this.elements,s=1/(t-e),l=1/(n-a),d=1/(o-r);return i[0]=2*s,i[4]=0,i[8]=0,i[12]=-((t+e)*s),i[1]=0,i[5]=2*l,i[9]=0,i[13]=-((n+a)*l),i[2]=0,i[6]=0,i[10]=-2*d,i[14]=-((o+r)*d),i[3]=0,i[7]=0,i[11]=0,i[15]=1,this},equals:function(e){for(var t=this.elements,n=e.elements,a=0;16>a;a++)if(t[a]!==n[a])return!1;return!0},fromArray:function(e,t){t===void 0&&(t=0);for(var n=0;16>n;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}),DataTexture.prototype=Object.create(Texture.prototype),DataTexture.prototype.constructor=DataTexture,DataTexture.prototype.isDataTexture=!0,CubeTexture.prototype=Object.create(Texture.prototype),CubeTexture.prototype.constructor=CubeTexture,CubeTexture.prototype.isCubeTexture=!0,Object.defineProperty(CubeTexture.prototype,'images',{get:function(){return this.image},set:function(e){this.image=e}});var Ht=new Texture,Vt=new CubeTexture,$t=[],zt=[],Xt=new Float32Array(16),jt=new Float32Array(9);StructuredUniform.prototype.setValue=function(e,t){for(var a=this.seq,r=0,o=a.length,n;r!==o;++r)n=a[r],n.setValue(e,t[n.id])};var Yt=/([\\w\\d_]+)(\\])?(\\[|\\.)?/g;WebGLUniforms.prototype.setValue=function(e,t,n){var a=this.map[t];a!==void 0&&a.setValue(e,n,this.renderer)},WebGLUniforms.prototype.setOptional=function(e,t,n){var a=t[n];a!==void 0&&this.setValue(e,n,a)},WebGLUniforms.upload=function(e,t,a,r){for(var o=0,i=t.length;o!==i;++o){var n=t[o],s=a[n.id];!1!==s.needsUpdate&&n.setValue(e,s.value,r)}},WebGLUniforms.seqWithValue=function(e,t){for(var a=[],r=0,o=e.length,n;r!==o;++r)n=e[r],n.id in t&&a.push(n);return a};var Kt={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,rebeccapurple:6697881,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};Object.assign(Color.prototype,{isColor:!0,r:1,g:1,b:1,set:function(e){return e&&e.isColor?this.copy(e):'number'==typeof e?this.setHex(e):'string'==typeof e&&this.setStyle(e),this},setScalar:function(e){return this.r=e,this.g=e,this.b=e,this},setHex:function(e){return e=h(e),this.r=(255&e>>16)/255,this.g=(255&e>>8)/255,this.b=(255&e)/255,this},setRGB:function(e,t,n){return this.r=e,this.g=t,this.b=n,this},setHSL:function(){function hue2rgb(e,n,a){return 0>a&&(a+=1),1=n?n*(1+t):n+t-n*t,r=2*n-a;this.r=hue2rgb(r,a,e+1/3),this.g=hue2rgb(r,a,e),this.b=hue2rgb(r,a,e-1/3)}return this}}(),setStyle:function(e){function handleAlpha(t){void 0===t||1>parseFloat(t)&&console.warn('THREE.Color: Alpha component of '+e+' will be ignored.')}var t;if(t=/^((?:rgb|hsl)a?)\\(\\s*([^\\)]*)\\)/.exec(e)){var n=t[1],a=t[2],r;switch(n){case'rgb':case'rgba':if(r=/^(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(,\\s*([0-9]*\\.?[0-9]+)\\s*)?$/.exec(a))return this.r=f(255,parseInt(r[1],10))/255,this.g=f(255,parseInt(r[2],10))/255,this.b=f(255,parseInt(r[3],10))/255,handleAlpha(r[5]),this;if(r=/^(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(,\\s*([0-9]*\\.?[0-9]+)\\s*)?$/.exec(a))return this.r=f(100,parseInt(r[1],10))/100,this.g=f(100,parseInt(r[2],10))/100,this.b=f(100,parseInt(r[3],10))/100,handleAlpha(r[5]),this;break;case'hsl':case'hsla':if(r=/^([0-9]*\\.?[0-9]+)\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(,\\s*([0-9]*\\.?[0-9]+)\\s*)?$/.exec(a)){var o=parseFloat(r[1])/360,i=parseInt(r[2],10)/100,s=parseInt(r[3],10)/100;return handleAlpha(r[5]),this.setHSL(o,i,s)}}}else if(t=/^\\#([A-Fa-f0-9]+)$/.exec(e)){var l=t[1],d=l.length;if(3===d)return this.r=parseInt(l.charAt(0)+l.charAt(0),16)/255,this.g=parseInt(l.charAt(1)+l.charAt(1),16)/255,this.b=parseInt(l.charAt(2)+l.charAt(2),16)/255,this;if(6===d)return this.r=parseInt(l.charAt(0)+l.charAt(1),16)/255,this.g=parseInt(l.charAt(2)+l.charAt(3),16)/255,this.b=parseInt(l.charAt(4)+l.charAt(5),16)/255,this}if(e&&0=s?c/(o+i):c/(2-o-i),o===n?l=(a-r)/c+(a 0.0 ) {\\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\\n\\t\\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\\n\\t\\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\\n\\t\\treturn distanceFalloff * maxDistanceCutoffFactor;\\n#else\\n\\t\\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\\n#endif\\n\\t}\\n\\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 LTC_Uv( const in vec3 N, const in vec3 V, 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\\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}\\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\\n\\tfloat l = length( f );\\n\\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\\n}\\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\\n\\tfloat x = dot( v1, v2 );\\n\\tfloat y = abs( x );\\n\\tfloat a = 0.86267 + (0.49788 + 0.01436 * y ) * y;\\n\\tfloat b = 3.45068 + (4.18814 + y) * y;\\n\\tfloat v = a / b;\\n\\tfloat theta_sintheta = (x > 0.0) ? v : 0.5 * inversesqrt( 1.0 - x * x ) - v;\\n\\treturn cross( v1, v2 ) * theta_sintheta;\\n}\\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\\n\\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\\n\\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\\n\\tvec3 lightNormal = cross( v1, v2 );\\n\\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\\n\\tvec3 T1, T2;\\n\\tT1 = normalize( V - N * dot( V, N ) );\\n\\tT2 = - cross( N, T1 );\\n\\tmat3 mat = mInv * transpose( mat3( T1, T2, N ) );\\n\\tvec3 coords[ 4 ];\\n\\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\\n\\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\\n\\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\\n\\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\\n\\tcoords[ 0 ] = normalize( coords[ 0 ] );\\n\\tcoords[ 1 ] = normalize( coords[ 1 ] );\\n\\tcoords[ 2 ] = normalize( coords[ 2 ] );\\n\\tcoords[ 3 ] = normalize( coords[ 3 ] );\\n\\tvec3 vectorFormFactor = vec3( 0.0 );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\\n\\tvec3 result = vec3( LTC_ClippedSphereFormFactor( vectorFormFactor ) );\\n\\treturn result;\\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 = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\\n\\t\\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\\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:'vec3 transformedNormal = normalMatrix * objectNormal;\\n#ifdef FLIP_SIDED\\n\\ttransformedNormal = - transformedNormal;\\n#endif\\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 += normalize( objectNormal ) * ( 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\\treturn value;\\n}\\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\\n\\treturn vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\\n}\\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\\n\\treturn vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\\n}\\nvec4 sRGBToLinear( in vec4 value ) {\\n\\treturn 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\\treturn 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\\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\\n}\\nvec4 LinearToRGBE( in vec4 value ) {\\n\\tfloat maxComponent = max( max( value.r, value.g ), value.b );\\n\\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\\n\\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\\n}\\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\\n\\treturn vec4( value.xyz * value.w * maxRange, 1.0 );\\n}\\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\\n\\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\\n\\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\\n\\tM = ceil( M * 255.0 ) / 255.0;\\n\\treturn vec4( value.rgb / ( M * maxRange ), M );\\n}\\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\\n\\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\\n}\\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\\n\\tfloat maxRGB = max( value.x, max( value.g, value.b ) );\\n\\tfloat D = max( maxRange / maxRGB, 1.0 );\\n\\tD = min( floor( D ) / 255.0, 1.0 );\\n\\treturn 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\\tvec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\\n\\tXp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\\n\\tvec4 vResult;\\n\\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\\n\\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\\n\\tvResult.w = fract(Le);\\n\\tvResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\\n\\treturn 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\\tfloat Le = value.z * 255.0 + value.w;\\n\\tvec3 Xp_Y_XYZp;\\n\\tXp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\\n\\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\\n\\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\\n\\tvec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\\n\\treturn 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, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\\n\\t#elif defined( ENVMAP_TYPE_EQUIREC )\\n\\t\\tvec2 sampleUV;\\n\\t\\treflectVec = normalize( reflectVec );\\n\\t\\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\\n\\t\\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\\n\\t\\tvec4 envColor = texture2D( envMap, sampleUV );\\n\\t#elif defined( ENVMAP_TYPE_SPHERE )\\n\\t\\treflectVec = normalize( reflectVec );\\n\\t\\tvec3 reflectView = 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_vertex:'\\n#ifdef USE_FOG\\nfogDepth = -mvPosition.z;\\n#endif',fog_pars_vertex:'#ifdef USE_FOG\\n varying float fogDepth;\\n#endif\\n',fog_fragment:'#ifdef USE_FOG\\n\\t#ifdef FOG_EXP2\\n\\t\\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\\n\\t#else\\n\\t\\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\\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\\tvarying float fogDepth;\\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\\n',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_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\\tfloat shadowCameraNear;\\n\\t\\tfloat shadowCameraFar;\\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 = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 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};\\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_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\\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\t\\tvec3 normal = geometry.normal;\\n\\t\\tvec3 viewDir = geometry.viewDir;\\n\\t\\tvec3 position = geometry.position;\\n\\t\\tvec3 lightPos = rectAreaLight.position;\\n\\t\\tvec3 halfWidth = rectAreaLight.halfWidth;\\n\\t\\tvec3 halfHeight = rectAreaLight.halfHeight;\\n\\t\\tvec3 lightColor = rectAreaLight.color;\\n\\t\\tfloat roughness = material.specularRoughness;\\n\\t\\tvec3 rectCoords[ 4 ];\\n\\t\\trectCoords[ 0 ] = lightPos - halfWidth - halfHeight;\\t\\trectCoords[ 1 ] = lightPos + halfWidth - halfHeight;\\n\\t\\trectCoords[ 2 ] = lightPos + halfWidth + halfHeight;\\n\\t\\trectCoords[ 3 ] = lightPos - halfWidth + halfHeight;\\n\\t\\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\\n\\t\\tfloat norm = texture2D( ltcMag, uv ).a;\\n\\t\\tvec4 t = texture2D( ltcMat, uv );\\n\\t\\tmat3 mInv = mat3(\\n\\t\\t\\tvec3( 1, 0, t.y ),\\n\\t\\t\\tvec3( 0, t.z, 0 ),\\n\\t\\t\\tvec3( t.w, 0, t.x )\\n\\t\\t);\\n\\t\\treflectedLight.directSpecular += lightColor * material.specularColor * norm * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\\n\\t\\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1 ), rectCoords );\\n\\t}\\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 ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 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\\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.b;\\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_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 );\\n\\t#ifdef DOUBLE_SIDED\\n\\t\\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\\n\\t#endif\\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 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\\n\\t\\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\\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\\treturn normalize( normal ) * 0.5 + 0.5;\\n}\\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\\n\\treturn 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\\treturn ( viewZ + near ) / ( near - far );\\n}\\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\\n\\treturn linearClipZ * ( near - far ) - near;\\n}\\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\\n\\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\\n}\\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\\n\\treturn ( 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:'vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\\ngl_Position = projectionMatrix * mvPosition;\\n',dithering_fragment:'#if defined( DITHERING )\\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\\n#endif\\n',dithering_pars_fragment:'#if defined( DITHERING )\\n\\tvec3 dithering( vec3 color ) {\\n\\t\\tfloat grid_position = rand( gl_FragCoord.xy );\\n\\t\\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\\n\\t\\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\\n\\t\\treturn color + dither_shift_RGB;\\n\\t}\\n#endif\\n',roughnessmap_fragment:'float roughnessFactor = roughness;\\n#ifdef USE_ROUGHNESSMAP\\n\\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\\n\\troughnessFactor *= texelRoughness.g;\\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\\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\\tfloat shadow = 1.0;\\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\\tshadow = (\\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\\tshadow = (\\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\\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\\n\\t\\t#endif\\n\\t\\t}\\n\\t\\treturn shadow;\\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, float shadowCameraNear, float shadowCameraFar ) {\\n\\t\\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\\n\\t\\tvec3 lightToPosition = shadowCoord.xyz;\\n\\t\\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\\t\\tdp += shadowBias;\\n\\t\\tvec3 bd3D = normalize( lightToPosition );\\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#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#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 ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\\n\\t}\\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 boneTextureSize;\\n\\t\\tmat4 getBoneMatrix( const in float i ) {\\n\\t\\t\\tfloat j = i * 4.0;\\n\\t\\t\\tfloat x = mod( j, float( boneTextureSize ) );\\n\\t\\t\\tfloat y = floor( j / float( boneTextureSize ) );\\n\\t\\t\\tfloat dx = 1.0 / float( boneTextureSize );\\n\\t\\t\\tfloat dy = 1.0 / float( boneTextureSize );\\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\\ttransformed = ( bindMatrixInverse * skinned ).xyz;\\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\\treturn toneMappingExposure * color;\\n}\\nvec3 ReinhardToneMapping( vec3 color ) {\\n\\tcolor *= toneMappingExposure;\\n\\treturn 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\\tcolor *= toneMappingExposure;\\n\\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\\n}\\nvec3 OptimizedCineonToneMapping( vec3 color ) {\\n\\tcolor *= toneMappingExposure;\\n\\tcolor = max( vec3( 0.0 ), color - 0.004 );\\n\\treturn 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( DISTANCE ) || defined ( USE_SHADOWMAP )\\n\\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\\n#endif\\n',cube_frag:'uniform samplerCube tCube;\\nuniform float tFlip;\\nuniform float opacity;\\nvarying vec3 vWorldPosition;\\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 \\nvoid main() {\\n\\tvWorldPosition = transformDirection( position, modelMatrix );\\n\\t#include \\n\\t#include \\n}\\n',depth_frag:'#if DEPTH_PACKING == 3200\\n\\tuniform float opacity;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\tvec4 diffuseColor = vec4( 1.0 );\\n\\t#if DEPTH_PACKING == 3200\\n\\t\\tdiffuseColor.a = opacity;\\n\\t#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\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 \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#ifdef USE_DISPLACEMENTMAP\\n\\t\\t#include \\n\\t\\t#include \\n\\t\\t#include \\n\\t#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\\n',distanceRGBA_frag:'#define DISTANCE\\nuniform vec3 referencePosition;\\nuniform float nearDistance;\\nuniform float farDistance;\\nvarying vec3 vWorldPosition;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main () {\\n\\t#include \\n\\tvec4 diffuseColor = vec4( 1.0 );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\tfloat dist = length( vWorldPosition - referencePosition );\\n\\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\\n\\tdist = saturate( dist );\\n\\tgl_FragColor = packDepthToRGBA( dist );\\n}\\n',distanceRGBA_vert:'#define DISTANCE\\nvarying vec3 vWorldPosition;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#ifdef USE_DISPLACEMENTMAP\\n\\t\\t#include \\n\\t\\t#include \\n\\t\\t#include \\n\\t#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvWorldPosition = worldPosition.xyz;\\n}\\n',equirect_frag:'uniform sampler2D tEquirect;\\nvarying vec3 vWorldPosition;\\n#include \\nvoid main() {\\n\\tvec3 direction = normalize( vWorldPosition );\\n\\tvec2 sampleUV;\\n\\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 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 \\nvoid main() {\\n\\tvWorldPosition = transformDirection( position, modelMatrix );\\n\\t#include \\n\\t#include \\n}\\n',linedashed_frag:'uniform vec3 diffuse;\\nuniform float opacity;\\nuniform float dashSize;\\nuniform float totalSize;\\nvarying float vLineDistance;\\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\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 \\n\\t#include \\n\\toutgoingLight = diffuseColor.rgb;\\n\\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\\n',linedashed_vert:'uniform float scale;\\nattribute float lineDistance;\\nvarying float vLineDistance;\\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\tvLineDistance = scale * lineDistance;\\n\\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\\n\\tgl_Position = projectionMatrix * mvPosition;\\n\\t#include \\n\\t#include \\n\\t#include \\n}\\n',meshbasic_frag:'uniform vec3 diffuse;\\nuniform float opacity;\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\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 \\n\\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\\n\\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\\n\\t#include \\n\\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\\n',meshbasic_vert:'#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#ifdef USE_ENVMAP\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\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 \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\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 \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\\n\\t#include \\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 \\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\\n\\t#include \\n\\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\\n',meshlambert_vert:'#define LAMBERT\\nvarying vec3 vLightFront;\\n#ifdef DOUBLE_SIDED\\n\\tvarying vec3 vLightBack;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\\n',meshphong_frag:'#define PHONG\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform vec3 specular;\\nuniform float shininess;\\nuniform float opacity;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\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 \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\\n\\t#include \\n\\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\\n',meshphong_vert:'#define PHONG\\nvarying vec3 vViewPosition;\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n#ifndef FLAT_SHADED\\n\\tvNormal = normalize( transformedNormal );\\n#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\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 \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\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 \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\\n\\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\\n',meshphysical_vert:'#define PHYSICAL\\nvarying vec3 vViewPosition;\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n#ifndef FLAT_SHADED\\n\\tvNormal = normalize( transformedNormal );\\n#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include \\n\\t#include \\n\\t#include \\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 \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\\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 \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n#ifndef FLAT_SHADED\\n\\tvNormal = normalize( transformedNormal );\\n#endif\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\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 \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n\\toutgoingLight = diffuseColor.rgb;\\n\\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\\n',points_vert:'uniform float size;\\nuniform float scale;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\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 \\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\\n',shadow_frag:'uniform vec3 color;\\nuniform float opacity;\\n#include \\n#include \\n#include \\n#include \\n#include \\n#include \\nvoid main() {\\n\\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\\n}\\n',shadow_vert:'#include \\nvoid main() {\\n\\t#include \\n\\t#include \\n\\t#include \\n\\t#include \\n}\\n'},Jt={basic:{uniforms:Zt.merge([qt.common,qt.specularmap,qt.envmap,qt.aomap,qt.lightmap,qt.fog]),vertexShader:Qt.meshbasic_vert,fragmentShader:Qt.meshbasic_frag},lambert:{uniforms:Zt.merge([qt.common,qt.specularmap,qt.envmap,qt.aomap,qt.lightmap,qt.emissivemap,qt.fog,qt.lights,{emissive:{value:new Color(0)}}]),vertexShader:Qt.meshlambert_vert,fragmentShader:Qt.meshlambert_frag},phong:{uniforms:Zt.merge([qt.common,qt.specularmap,qt.envmap,qt.aomap,qt.lightmap,qt.emissivemap,qt.bumpmap,qt.normalmap,qt.displacementmap,qt.gradientmap,qt.fog,qt.lights,{emissive:{value:new Color(0)},specular:{value:new Color(1118481)},shininess:{value:30}}]),vertexShader:Qt.meshphong_vert,fragmentShader:Qt.meshphong_frag},standard:{uniforms:Zt.merge([qt.common,qt.envmap,qt.aomap,qt.lightmap,qt.emissivemap,qt.bumpmap,qt.normalmap,qt.displacementmap,qt.roughnessmap,qt.metalnessmap,qt.fog,qt.lights,{emissive:{value:new Color(0)},roughness:{value:0.5},metalness:{value:0.5},envMapIntensity:{value:1}}]),vertexShader:Qt.meshphysical_vert,fragmentShader:Qt.meshphysical_frag},points:{uniforms:Zt.merge([qt.points,qt.fog]),vertexShader:Qt.points_vert,fragmentShader:Qt.points_frag},dashed:{uniforms:Zt.merge([qt.common,qt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Qt.linedashed_vert,fragmentShader:Qt.linedashed_frag},depth:{uniforms:Zt.merge([qt.common,qt.displacementmap]),vertexShader:Qt.depth_vert,fragmentShader:Qt.depth_frag},normal:{uniforms:Zt.merge([qt.common,qt.bumpmap,qt.normalmap,qt.displacementmap,{opacity:{value:1}}]),vertexShader:Qt.normal_vert,fragmentShader:Qt.normal_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Qt.cube_vert,fragmentShader:Qt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Qt.equirect_vert,fragmentShader:Qt.equirect_frag},distanceRGBA:{uniforms:Zt.merge([qt.common,qt.displacementmap,{referencePosition:{value:new Vector3},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Qt.distanceRGBA_vert,fragmentShader:Qt.distanceRGBA_frag},shadow:{uniforms:Zt.merge([qt.lights,{color:{value:new Color(0)},opacity:{value:1}}]),vertexShader:Qt.shadow_vert,fragmentShader:Qt.shadow_frag}};Jt.physical={uniforms:Zt.merge([Jt.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:Qt.meshphysical_vert,fragmentShader:Qt.meshphysical_frag},Object.assign(Box2.prototype,{set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;tthis.max.x||e.ythis.max.y?!1:!0},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},getParameter:function(e,t){var n=t||new Vector2;return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(e){return e.max.xthis.max.x||e.max.ythis.max.y?!1:!0},clampPoint:function(e,t){var n=t||new Vector2;return n.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new Vector2;return function distanceToPoint(t){var n=e.copy(t).clamp(this.min,this.max);return n.sub(t).length()}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),CanvasTexture.prototype=Object.create(Texture.prototype),CanvasTexture.prototype.constructor=CanvasTexture;var en=0;Object.assign(Material.prototype,EventDispatcher.prototype,{isMaterial:!0,onBeforeCompile:function(){},setValues:function(e){if(void 0!==e)for(var t in e){var n=e[t];if(void 0===n){console.warn('THREE.Material: \\''+t+'\\' parameter is undefined.');continue}if('shading'==t){console.warn('THREE.'+this.type+': .shading has been removed. Use the boolean .flatShading instead.'),this.flatShading=n===O;continue}var a=this[t];if(void 0===a){console.warn('THREE.'+this.type+': \\''+t+'\\' is not a property of this material.');continue}a&&a.isColor?a.set(n):a&&a.isVector3&&n&&n.isVector3?a.copy(n):'overdraw'==t?this[t]=+n:this[t]=n}},toJSON:function(e){function extractFromCache(e){var t=[];for(var n in e){var a=e[n];delete a.metadata,t.push(a)}return t}var t=void 0===e;t&&(e={textures:{},images:{}});var n={metadata:{version:4.5,type:'Material',generator:'Material.toJSON'}};if(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(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,n.reflectivity=this.reflectivity),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==V&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),this.side!==I&&(n.side=this.side),this.vertexColors!==G&&(n.vertexColors=this.vertexColors),1>this.opacity&&(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.dithering&&(n.dithering=!0),0r&&(r=l),c>o&&(o=c),p>s&&(s=p)}return this.min.set(t,n,a),this.max.set(r,o,s),this},setFromBufferAttribute:function(e){for(var t=+Infinity,n=+Infinity,a=+Infinity,r=-Infinity,o=-Infinity,s=-Infinity,d=0,i=e.count;dr&&(r=l),c>o&&(o=c),p>s&&(s=p)}return this.min.set(t,n,a),this.max.set(r,o,s),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z?!1:!0},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,t){var n=t||new Vector3;return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(e){return e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z?!1:!0},intersectsSphere:function(){var e=new Vector3;return function intersectsSphere(t){return this.clampPoint(t.center,e),e.distanceToSquared(t.center)<=t.radius*t.radius}}(),intersectsPlane:function(e){var t,n;return 0=e.constant},clampPoint:function(e,t){var n=t||new Vector3;return n.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new Vector3;return function distanceToPoint(t){var n=e.copy(t).clamp(this.min,this.max);return n.sub(t).length()}}(),getBoundingSphere:function(){var e=new Vector3;return function getBoundingSphere(t){var n=t||new Sphere;return this.getCenter(n.center),n.radius=0.5*this.getSize(e).length(),n}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(){var e=[new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3,new Vector3];return function applyMatrix4(t){return this.isEmpty()?this:(e[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),e[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),e[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),e[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),e[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),e[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),e[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),e[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(e),this)}}(),translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),Object.assign(Sphere.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(){var e=new Box3;return function setFromPoints(t,n){var a=this.center;void 0===n?e.setFromPoints(t).getCenter(a):a.copy(n);for(var r=0,o=0,i=t.length;o=this.radius},containsPoint:function(e){return e.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(e){return e.distanceTo(this.center)-this.radius},intersectsSphere:function(e){var t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t},intersectsBox:function(e){return e.intersectsSphere(this)},intersectsPlane:function(e){return A(e.distanceToPoint(this.center))<=this.radius},clampPoint:function(e,t){var n=this.center.distanceToSquared(e),a=t||new Vector3;return a.copy(e),n>this.radius*this.radius&&(a.sub(this.center).normalize(),a.multiplyScalar(this.radius).add(this.center)),a},getBoundingBox:function(e){var t=e||new Box3;return t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius*=e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}}),Object.assign(Matrix3.prototype,{isMatrix3:!0,set:function(e,t,n,a,r,o,i,s,l){var d=this.elements;return d[0]=e,d[1]=a,d[2]=i,d[3]=t,d[4]=r,d[5]=s,d[6]=n,d[7]=o,d[8]=l,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(e){var t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this},setFromMatrix4:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},applyToBufferAttribute:function(){var e=new Vector3;return function applyToBufferAttribute(t){for(var n=0,a=t.count;na;a++)if(t[a]!==n[a])return!1;return!0},fromArray:function(e,t){t===void 0&&(t=0);for(var n=0;9>n;n++)this.elements[n]=e[n+t];return this},toArray:function(e,t){void 0===e&&(e=[]),void 0===t&&(t=0);var n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}}),Object.assign(Plane.prototype,{set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,n,a){return this.normal.set(e,t,n),this.constant=a,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(){var e=new Vector3,t=new Vector3;return function setFromCoplanarPoints(n,a,r){var o=e.subVectors(r,a).cross(t.subVectors(n,a)).normalize();return this.setFromNormalAndCoplanarPoint(o,n),this}}(),clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){var n=t||new Vector3;return n.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(){var e=new Vector3;return function intersectLine(n,a){var r=a||new Vector3,o=n.delta(e),i=this.normal.dot(o);if(0===i)return 0===this.distanceToPoint(n.start)?r.copy(n.start):void 0;var s=-(n.start.dot(this.normal)+this.constant)/i;return 0>s||1t&&0n&&0n;n++)t[n].copy(e.planes[n]);return this},setFromMatrix:function(e){var t=this.planes,n=e.elements,a=n[0],r=n[1],o=n[2],i=n[3],s=n[4],l=n[5],d=n[6],c=n[7],p=n[8],u=n[9],m=n[10],g=n[11],h=n[12],f=n[13],E=n[14],_=n[15];return t[0].setComponents(i-a,c-s,g-p,_-h).normalize(),t[1].setComponents(i+a,c+s,g+p,_+h).normalize(),t[2].setComponents(i+r,c+l,g+u,_+f).normalize(),t[3].setComponents(i-r,c-l,g-u,_-f).normalize(),t[4].setComponents(i-o,c-d,g-m,_-E).normalize(),t[5].setComponents(i+o,c+d,g+m,_+E).normalize(),this},intersectsObject:function(){var e=new Sphere;return function intersectsObject(t){var n=t.geometry;return null===n.boundingSphere&&n.computeBoundingSphere(),e.copy(n.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(e)}}(),intersectsSprite:function(){var e=new Sphere;return function intersectsSprite(t){return e.center.set(0,0,0),e.radius=0.7071067811865476,e.applyMatrix4(t.matrixWorld),this.intersectsSphere(e)}}(),intersectsSphere:function(e){for(var t=this.planes,n=e.center,a=-e.radius,r=0,o;6>r;r++)if(o=t[r].distanceToPoint(n),or;r++){o=a[r],e.x=0i&&0>s)return!1}return!0}}(),containsPoint:function(e){for(var t=this.planes,n=0;6>n;n++)if(0>t[n].distanceToPoint(e))return!1;return!0}}),Euler.RotationOrders=['XYZ','YZX','ZXY','XZY','YXZ','ZYX'],Euler.DefaultOrder='XYZ',Object.defineProperties(Euler.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback()}},order:{get:function(){return this._order},set:function(e){this._order=e,this.onChangeCallback()}}}),Object.assign(Euler.prototype,{isEuler:!0,set:function(e,t,n,a){return this._x=e,this._y=t,this._z=n,this._order=a||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this.onChangeCallback(),this},setFromRotationMatrix:function(e,t,n){var a=Math.asin,r=kt.clamp,o=e.elements,s=o[0],l=o[4],d=o[8],c=o[1],p=o[5],u=o[9],m=o[2],g=o[6],h=o[10];return t=t||this._order,'XYZ'===t?(this._y=a(r(d,-1,1)),0.99999>A(d)?(this._x=i(-u,h),this._z=i(-l,s)):(this._x=i(g,p),this._z=0)):'YXZ'===t?(this._x=a(-r(u,-1,1)),0.99999>A(u)?(this._y=i(d,h),this._z=i(c,p)):(this._y=i(-m,s),this._z=0)):'ZXY'===t?(this._x=a(r(g,-1,1)),0.99999>A(g)?(this._y=i(-m,h),this._z=i(-l,p)):(this._y=0,this._z=i(c,s))):'ZYX'===t?(this._y=a(-r(m,-1,1)),0.99999>A(m)?(this._x=i(g,h),this._z=i(c,s)):(this._x=0,this._z=i(-l,p))):'YZX'===t?(this._z=a(r(c,-1,1)),0.99999>A(c)?(this._x=i(-u,p),this._y=i(-m,s)):(this._x=0,this._y=i(d,h))):'XZY'===t?(this._z=a(-r(l,-1,1)),0.99999>A(l)?(this._x=i(g,p),this._y=i(d,s)):(this._x=i(-u,h),this._y=0)):console.warn('THREE.Euler: .setFromRotationMatrix() given unsupported order: '+t),this._order=t,!1!==n&&this.onChangeCallback(),this},setFromQuaternion:function(){var e=new Matrix4;return function setFromQuaternion(t,n,a){return e.makeRotationFromQuaternion(t),this.setFromRotationMatrix(e,n,a)}}(),setFromVector3:function(e,t){return this.set(e.x,e.y,e.z,t||this._order)},reorder:function(){var e=new Quaternion;return function reorder(t){return e.setFromEuler(this),this.setFromQuaternion(e,t)}}(),equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order},fromArray:function(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e},toVector3:function(e){return e?e.set(this._x,this._y,this._z):new Vector3(this._x,this._y,this._z)},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),Object.assign(Layers.prototype,{set:function(e){this.mask=0|1<h;h++)if(p[h]===p[(h+1)%3]){g.push(d);break}}for(d=g.length-1;0<=d;d--){var n=g[d];for(this.faces.splice(n,1),u=0,m=this.faceVertexUvs.length;ua?n.copy(this.origin):n.copy(this.direction).multiplyScalar(a).add(this.origin)},distanceToPoint:function(e){return _(this.distanceSqToPoint(e))},distanceSqToPoint:function(){var e=new Vector3;return function distanceSqToPoint(t){var n=e.subVectors(t,this.origin).dot(this.direction);return 0>n?this.origin.distanceToSquared(t):(e.copy(this.direction).multiplyScalar(n).add(this.origin),e.distanceToSquared(t))}}(),distanceSqToSegment:function(){var e=new Vector3,t=new Vector3,n=new Vector3;return function distanceSqToSegment(a,r,o,i){e.copy(a).add(r).multiplyScalar(0.5),t.copy(r).sub(a).normalize(),n.copy(this.origin).sub(e);var s=0.5*a.distanceTo(r),l=-this.direction.dot(t),d=n.dot(this.direction),p=-n.dot(t),u=n.lengthSq(),c=A(1-l*l),m,g,h,E;if(!(0=-E))g=-s,m=y(0,-(l*g+d)),h=-m*m+g*(g+2*p)+u;else if(g<=E){var _=1/c;m*=_,g*=_,h=m*(m+l*g+2*d)+g*(l*m+g+2*p)+u}else g=s,m=y(0,-(l*g+d)),h=-m*m+g*(g+2*p)+u;return o&&o.copy(this.direction).multiplyScalar(m).add(this.origin),i&&i.copy(t).multiplyScalar(g).add(e),h}}(),intersectSphere:function(){var e=new Vector3;return function intersectSphere(t,n){e.subVectors(t.center,this.origin);var a=e.dot(this.direction),r=e.dot(e)-a*a,o=t.radius*t.radius;if(r>o)return null;var i=_(o-r),s=a-i,l=a+i;return 0>s&&0>l?null:0>s?this.at(l,n):this.at(s,n)}}(),intersectsSphere:function(e){return this.distanceToPoint(e.center)<=e.radius},distanceToPlane:function(e){var n=e.normal.dot(this.direction);if(0===n)return 0===e.distanceToPoint(this.origin)?0:null;var a=-(this.origin.dot(e.normal)+e.constant)/n;return 0<=a?a:null},intersectPlane:function(e,n){var a=this.distanceToPlane(e);return null===a?null:this.at(a,n)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);if(0===t)return!0;var n=e.normal.dot(this.direction);return!!(0>n*t)},intersectBox:function(e,t){var n=1/this.direction.x,a=1/this.direction.y,r=1/this.direction.z,o=this.origin,i,s,l,d,c,p;return(0<=n?(i=(e.min.x-o.x)*n,s=(e.max.x-o.x)*n):(i=(e.max.x-o.x)*n,s=(e.min.x-o.x)*n),0<=a?(l=(e.min.y-o.y)*a,d=(e.max.y-o.y)*a):(l=(e.max.y-o.y)*a,d=(e.min.y-o.y)*a),i>d||l>s)?null:((l>i||i!==i)&&(i=l),(dp||c>s)?null:((c>i||i!==i)&&(i=c),(ps?null:this.at(0<=i?i:s,t))},intersectsBox:function(){var e=new Vector3;return function intersectsBox(t){return null!==this.intersectBox(t,e)}}(),intersectTriangle:function(){var e=new Vector3,t=new Vector3,n=new Vector3,r=new Vector3;return function intersectTriangle(o,a,i,s,l){t.subVectors(a,o),n.subVectors(i,o),r.crossVectors(t,n);var d=this.direction.dot(r),c;if(0d)c=-1,d=-d;else return null;e.subVectors(this.origin,o);var p=c*this.direction.dot(n.crossVectors(e,n));if(0>p)return null;var u=c*this.direction.dot(t.cross(e));if(0>u)return null;if(p+u>d)return null;var m=-c*e.dot(r);return 0>m?null:this.at(m/d,l)}}(),applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}}),Object.assign(Line3.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){var t=e||new Vector3;return t.addVectors(this.start,this.end).multiplyScalar(0.5)},delta:function(e){var t=e||new Vector3;return t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){var n=t||new Vector3;return this.delta(n).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(){var e=new Vector3,n=new Vector3;return function closestPointToPointParameter(a,r){e.subVectors(a,this.start),n.subVectors(this.end,this.start);var o=n.dot(n),i=n.dot(e),s=i/o;return r&&(s=kt.clamp(s,0,1)),s}}(),closestPointToPoint:function(e,n,a){var r=this.closestPointToPointParameter(e,n),t=a||new Vector3;return this.delta(t).multiplyScalar(r).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),Object.assign(Triangle,{normal:function(){var e=new Vector3;return function normal(t,n,a,r){var o=r||new Vector3;o.subVectors(a,n),e.subVectors(t,n),o.cross(e);var i=o.lengthSq();return 0=o.x+o.y}}()}),Object.assign(Triangle.prototype,{set:function(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this},setFromPointsAndIndices:function(e,t,n,a){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[a]),this},clone:function(){return new this.constructor().copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},area:function(){var e=new Vector3,t=new Vector3;return function area(){return e.subVectors(this.c,this.b),t.subVectors(this.a,this.b),0.5*e.cross(t).length()}}(),midpoint:function(e){var t=e||new Vector3;return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(e){return Triangle.normal(this.a,this.b,this.c,e)},plane:function(e){var t=e||new Plane;return t.setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(e,t){return Triangle.barycoordFromPoint(e,this.a,this.b,this.c,t)},containsPoint:function(e){return Triangle.containsPoint(e,this.a,this.b,this.c)},closestPointToPoint:function(){var e=new Plane,t=[new Line3,new Line3,new Line3],n=new Vector3,a=new Vector3;return function closestPointToPoint(r,o){var s=o||new Vector3,l=Infinity;if(e.setFromCoplanarPoints(this.a,this.b,this.c),e.projectPoint(r,n),!0===this.containsPoint(n))s.copy(n);else{t[0].set(this.a,this.b),t[1].set(this.b,this.c),t[2].set(this.c,this.a);for(var d=0;dn.far?null:{distance:d,point:g.clone(),object:e}}function checkBufferGeometryIntersection(e,n,r,l,d,g,a,h){o.fromBufferAttribute(l,g),i.fromBufferAttribute(l,a),s.fromBufferAttribute(l,h);var c=checkIntersection(e,e.material,n,r,o,i,s,m);return c&&(d&&(t.fromBufferAttribute(d,g),p.fromBufferAttribute(d,a),u.fromBufferAttribute(d,h),c.uv=uvIntersection(m,o,i,s,t,p,u)),c.face=new Face3(g,a,h,Triangle.normal(o,i,s)),c.faceIndex=g),c}var e=new Matrix4,n=new Ray,r=new Sphere,o=new Vector3,i=new Vector3,s=new Vector3,a=new Vector3,l=new Vector3,d=new Vector3,t=new Vector2,p=new Vector2,u=new Vector2,c=new Vector3,m=new Vector3,g=new Vector3;return function raycast(g,E){var _=this.geometry,C=this.material,y=this.matrixWorld;if(void 0!==C&&(null===_.boundingSphere&&_.computeBoundingSphere(),r.copy(_.boundingSphere),r.applyMatrix4(y),!1!==g.ray.intersectsSphere(r))&&(e.getInverse(y),n.copy(g.ray).applyMatrix4(e),null===_.boundingBox||!1!==n.intersectsBox(_.boundingBox))){var A;if(_.isBufferGeometry){var x=_.index,v=_.attributes.position,T=_.attributes.uv,S,R,b,c,F;if(null!==x)for(c=0,F=x.count;co)){var i=a.ray.origin.distanceTo(e);ia.far||r.push({distance:i,point:e.clone(),face:null,object:this})}}}(),clone:function(){return new this.constructor(this.material).copy(this)}}),LOD.prototype=Object.assign(Object.create(Object3D.prototype),{constructor:LOD,copy:function(e){Object3D.prototype.copy.call(this,e,!1);for(var t=e.levels,n=0,a=t.length,r;n=a[o].distance;o++)a[o-1].object.visible=!1,a[o].object.visible=!0;for(;od)){h.applyMatrix4(this.matrixWorld);var v=r.ray.origin.distanceTo(h);vr.far||o.push({distance:v,point:g.clone().applyMatrix4(this.matrixWorld),index:A,face:null,faceIndex:null,object:this})}}else for(var A=0,x=C.length/3-1;Ad)){h.applyMatrix4(this.matrixWorld);var v=r.ray.origin.distanceTo(h);vr.far||o.push({distance:v,point:g.clone().applyMatrix4(this.matrixWorld),index:A,face:null,faceIndex:null,object:this})}}}else if(c.isGeometry)for(var T=c.vertices,S=T.length,A=0,b;Ad)){h.applyMatrix4(this.matrixWorld);var v=r.ray.origin.distanceTo(h);vr.far||o.push({distance:v,point:g.clone().applyMatrix4(this.matrixWorld),index:A,face:null,faceIndex:null,object:this})}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),LineSegments.prototype=Object.assign(Object.create(Line.prototype),{constructor:LineSegments,isLineSegments:!0}),LineLoop.prototype=Object.assign(Object.create(Line.prototype),{constructor:LineLoop,isLineLoop:!0}),PointsMaterial.prototype=Object.create(Material.prototype),PointsMaterial.prototype.constructor=PointsMaterial,PointsMaterial.prototype.isPointsMaterial=!0,PointsMaterial.prototype.copy=function(e){return Material.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this},Points.prototype=Object.assign(Object.create(Object3D.prototype),{constructor:Points,isPoints:!0,raycast:function(){var e=new Matrix4,t=new Ray,n=new Sphere;return function raycast(r,o){function testPoint(e,n){var a=t.distanceSqToPoint(e);if(ar.far)return;o.push({distance:l,distanceToRay:_(a),point:i.clone(),index:n,face:null,object:s})}}var s=this,d=this.geometry,c=this.matrixWorld,p=r.params.Points.threshold;if(null===d.boundingSphere&&d.computeBoundingSphere(),n.copy(d.boundingSphere),n.applyMatrix4(c),n.radius+=p,!1!==r.ray.intersectsSphere(n)){e.getInverse(c),t.copy(r.ray).applyMatrix4(e);var u=p/((this.scale.x+this.scale.y+this.scale.z)/3),m=u*u,g=new Vector3;if(d.isBufferGeometry){var h=d.index,f=d.attributes,E=f.position.array;if(null!==h)for(var C=h.array,y=0,i=C.length,A;y=(d-s)*(u-l)-(c-l)*(p-s))return!1;var f,E,_,C,y,A,b,x,v,T,S,R,F,w,M;for(f=p-d,E=u-c,_=s-p,C=l-u,y=d-s,A=c-l,i=0;i=-g&&w>=-g&&F>=-g))return!1;return!0}return function triangulate(e,r){var o=e.length;if(3>o)return null;var n=[],i=[],l=[],d,p,u;if(0=g--)return console.warn('THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()'),r?l:n;if(d=p,m<=d&&(d=0),p=d+1,m<=p&&(p=0),u=p+1,m<=u&&(u=0),snip(e,d,p,u,m,i)){var h,a,f,c,s;for(h=i[d],a=i[p],f=i[u],n.push([e[h],e[a],e[f]]),l.push([i[d],i[p],i[u]]),(c=p,s=p+1);sg){var m;if(0u||u>p)return[];if(m=l*d-s*c,0>m||m>p)return[]}else{if(0S?[]:y===S?r?[]:[_]:b<=S?[_,C]:[_,v]}function isPointInsideAngle(e,t,n,a){var r=t.x-e.x,o=t.y-e.y,i=n.x-e.x,s=n.y-e.y,l=a.x-e.x,d=a.y-e.y,c=r*s-o*i,p=r*d-o*l;if(A(c)>g){var u=l*s-d*i;return 0r&&(r=a);var o=e+1;o>a&&(o=0);var i=isPointInsideAngle(n[e],n[r],n[o],s[t]);if(!i)return!1;var l=s.length-1,d=t-1;0>d&&(d=l);var c=t+1;return c>l&&(c=0),i=isPointInsideAngle(s[t],s[d],s[c],n[e]),!!i}function intersectsShapeEdge(e,t){var a,r,o;for(a=0;aC){console.log('THREE.ShapeUtils: Infinite Loop! Holes left:\" + indepHoles.length + \", Probably Hole outside Shape!');break}for(d=_;dl;l++)c=d[l].x+':'+d[l].y,p=n[c],void 0!==p&&(d[l]=p);return m.concat()},isClockWise:function(e){return 0>rn.area(e)}};ExtrudeGeometry.prototype=Object.create(Geometry.prototype),ExtrudeGeometry.prototype.constructor=ExtrudeGeometry,ExtrudeBufferGeometry.prototype=Object.create(BufferGeometry.prototype),ExtrudeBufferGeometry.prototype.constructor=ExtrudeBufferGeometry,ExtrudeBufferGeometry.prototype.getArrays=function(){var e=this.getAttribute('position'),t=e?Array.prototype.slice.call(e.array):[],n=this.getAttribute('uv'),a=n?Array.prototype.slice.call(n.array):[],r=this.index,o=r?Array.prototype.slice.call(r.array):[];return{position:t,uv:a,index:o}},ExtrudeBufferGeometry.prototype.addShapeList=function(e,t){var n=e.length;t.arrays=this.getArrays();for(var a=0,r;ag){var u=_(s),m=_(o*o+i*i),h=t.x-r/u,f=t.y+a/u,E=n.x-i/m,C=n.y+o/m,y=((E-h)*i-(C-f)*o)/(a*i-r*o);l=h+a*y-e.x,d=f+r*y-e.y;var b=l*l+d*d;if(2>=b)return new Vector2(l,d);c=_(b/2)}else{var x=!1;a>g?o>g&&(x=!0):a<-g?o<-g&&(x=!0):p(r)===p(i)&&(x=!0),x?(l=-r,d=a,c=_(s)):(l=a,d=r,c=_(s/2))}return new Vector2(l/c,d/c)}function sidewalls(e,t){var n,r;for(q=e.length;0<=--q;){n=q,r=q-1,0>r&&(r=e.length-1);var o=0,i=T+2*C;for(o=0;oA(s-c)?[new Vector2(i,1-l),new Vector2(d,1-p),new Vector2(u,1-g),new Vector2(h,1-E)]:[new Vector2(s,1-l),new Vector2(c,1-p),new Vector2(m,1-g),new Vector2(f,1-E)]}},TextGeometry.prototype=Object.create(Geometry.prototype),TextGeometry.prototype.constructor=TextGeometry,TextBufferGeometry.prototype=Object.create(ExtrudeBufferGeometry.prototype),TextBufferGeometry.prototype.constructor=TextBufferGeometry,SphereGeometry.prototype=Object.create(Geometry.prototype),SphereGeometry.prototype.constructor=SphereGeometry,SphereBufferGeometry.prototype=Object.create(BufferGeometry.prototype),SphereBufferGeometry.prototype.constructor=SphereBufferGeometry,RingGeometry.prototype=Object.create(Geometry.prototype),RingGeometry.prototype.constructor=RingGeometry,RingBufferGeometry.prototype=Object.create(BufferGeometry.prototype),RingBufferGeometry.prototype.constructor=RingBufferGeometry,LatheGeometry.prototype=Object.create(Geometry.prototype),LatheGeometry.prototype.constructor=LatheGeometry,LatheBufferGeometry.prototype=Object.create(BufferGeometry.prototype),LatheBufferGeometry.prototype.constructor=LatheBufferGeometry,ShapeGeometry.prototype=Object.create(Geometry.prototype),ShapeGeometry.prototype.constructor=ShapeGeometry,ShapeBufferGeometry.prototype=Object.create(BufferGeometry.prototype),ShapeBufferGeometry.prototype.constructor=ShapeBufferGeometry,EdgesGeometry.prototype=Object.create(BufferGeometry.prototype),EdgesGeometry.prototype.constructor=EdgesGeometry,CylinderGeometry.prototype=Object.create(Geometry.prototype),CylinderGeometry.prototype.constructor=CylinderGeometry,CylinderBufferGeometry.prototype=Object.create(BufferGeometry.prototype),CylinderBufferGeometry.prototype.constructor=CylinderBufferGeometry,ConeGeometry.prototype=Object.create(CylinderGeometry.prototype),ConeGeometry.prototype.constructor=ConeGeometry,ConeBufferGeometry.prototype=Object.create(CylinderBufferGeometry.prototype),ConeBufferGeometry.prototype.constructor=ConeBufferGeometry,CircleGeometry.prototype=Object.create(Geometry.prototype),CircleGeometry.prototype.constructor=CircleGeometry,CircleBufferGeometry.prototype=Object.create(BufferGeometry.prototype),CircleBufferGeometry.prototype.constructor=CircleBufferGeometry;var on=Object.freeze({WireframeGeometry:WireframeGeometry,ParametricGeometry:ParametricGeometry,ParametricBufferGeometry:ParametricBufferGeometry,TetrahedronGeometry:TetrahedronGeometry,TetrahedronBufferGeometry:TetrahedronBufferGeometry,OctahedronGeometry:OctahedronGeometry,OctahedronBufferGeometry:OctahedronBufferGeometry,IcosahedronGeometry:IcosahedronGeometry,IcosahedronBufferGeometry:IcosahedronBufferGeometry,DodecahedronGeometry:DodecahedronGeometry,DodecahedronBufferGeometry:DodecahedronBufferGeometry,PolyhedronGeometry:PolyhedronGeometry,PolyhedronBufferGeometry:PolyhedronBufferGeometry,TubeGeometry:TubeGeometry,TubeBufferGeometry:TubeBufferGeometry,TorusKnotGeometry:TorusKnotGeometry,TorusKnotBufferGeometry:TorusKnotBufferGeometry,TorusGeometry:TorusGeometry,TorusBufferGeometry:TorusBufferGeometry,TextGeometry:TextGeometry,TextBufferGeometry:TextBufferGeometry,SphereGeometry:SphereGeometry,SphereBufferGeometry:SphereBufferGeometry,RingGeometry:RingGeometry,RingBufferGeometry:RingBufferGeometry,PlaneGeometry:PlaneGeometry,PlaneBufferGeometry:PlaneBufferGeometry,LatheGeometry:LatheGeometry,LatheBufferGeometry:LatheBufferGeometry,ShapeGeometry:ShapeGeometry,ShapeBufferGeometry:ShapeBufferGeometry,ExtrudeGeometry:ExtrudeGeometry,ExtrudeBufferGeometry:ExtrudeBufferGeometry,EdgesGeometry:EdgesGeometry,ConeGeometry:ConeGeometry,ConeBufferGeometry:ConeBufferGeometry,CylinderGeometry:CylinderGeometry,CylinderBufferGeometry:CylinderBufferGeometry,CircleGeometry:CircleGeometry,CircleBufferGeometry:CircleBufferGeometry,BoxGeometry:BoxGeometry,BoxBufferGeometry:BoxBufferGeometry});ShadowMaterial.prototype=Object.create(Material.prototype),ShadowMaterial.prototype.constructor=ShadowMaterial,ShadowMaterial.prototype.isShadowMaterial=!0,RawShaderMaterial.prototype=Object.create(ShaderMaterial.prototype),RawShaderMaterial.prototype.constructor=RawShaderMaterial,RawShaderMaterial.prototype.isRawShaderMaterial=!0,MeshStandardMaterial.prototype=Object.create(Material.prototype),MeshStandardMaterial.prototype.constructor=MeshStandardMaterial,MeshStandardMaterial.prototype.isMeshStandardMaterial=!0,MeshStandardMaterial.prototype.copy=function(e){return Material.prototype.copy.call(this,e),this.defines={STANDARD:''},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},MeshPhysicalMaterial.prototype=Object.create(MeshStandardMaterial.prototype),MeshPhysicalMaterial.prototype.constructor=MeshPhysicalMaterial,MeshPhysicalMaterial.prototype.isMeshPhysicalMaterial=!0,MeshPhysicalMaterial.prototype.copy=function(e){return MeshStandardMaterial.prototype.copy.call(this,e),this.defines={PHYSICAL:''},this.reflectivity=e.reflectivity,this.clearCoat=e.clearCoat,this.clearCoatRoughness=e.clearCoatRoughness,this},MeshPhongMaterial.prototype=Object.create(Material.prototype),MeshPhongMaterial.prototype.constructor=MeshPhongMaterial,MeshPhongMaterial.prototype.isMeshPhongMaterial=!0,MeshPhongMaterial.prototype.copy=function(e){return Material.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},MeshToonMaterial.prototype=Object.create(MeshPhongMaterial.prototype),MeshToonMaterial.prototype.constructor=MeshToonMaterial,MeshToonMaterial.prototype.isMeshToonMaterial=!0,MeshToonMaterial.prototype.copy=function(e){return MeshPhongMaterial.prototype.copy.call(this,e),this.gradientMap=e.gradientMap,this},MeshNormalMaterial.prototype=Object.create(Material.prototype),MeshNormalMaterial.prototype.constructor=MeshNormalMaterial,MeshNormalMaterial.prototype.isMeshNormalMaterial=!0,MeshNormalMaterial.prototype.copy=function(e){return Material.prototype.copy.call(this,e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},MeshLambertMaterial.prototype=Object.create(Material.prototype),MeshLambertMaterial.prototype.constructor=MeshLambertMaterial,MeshLambertMaterial.prototype.isMeshLambertMaterial=!0,MeshLambertMaterial.prototype.copy=function(e){return Material.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},LineDashedMaterial.prototype=Object.create(LineBasicMaterial.prototype),LineDashedMaterial.prototype.constructor=LineDashedMaterial,LineDashedMaterial.prototype.isLineDashedMaterial=!0,LineDashedMaterial.prototype.copy=function(e){return LineBasicMaterial.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var sn=Object.freeze({ShadowMaterial:ShadowMaterial,SpriteMaterial:SpriteMaterial,RawShaderMaterial:RawShaderMaterial,ShaderMaterial:ShaderMaterial,PointsMaterial:PointsMaterial,MeshPhysicalMaterial:MeshPhysicalMaterial,MeshStandardMaterial:MeshStandardMaterial,MeshPhongMaterial:MeshPhongMaterial,MeshToonMaterial:MeshToonMaterial,MeshNormalMaterial:MeshNormalMaterial,MeshLambertMaterial:MeshLambertMaterial,MeshDepthMaterial:MeshDepthMaterial,MeshDistanceMaterial:MeshDistanceMaterial,MeshBasicMaterial:MeshBasicMaterial,LineDashedMaterial:LineDashedMaterial,LineBasicMaterial:LineBasicMaterial,Material:Material}),ln={enabled:!1,files:{},add:function(e,t){!1===this.enabled||(this.files[e]=t)},get:function(e){return!1===this.enabled?void 0:this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}},dn=new LoadingManager;Object.assign(FileLoader.prototype,{load:function(e,t,n,a){void 0===e&&(e=''),void 0!==this.path&&(e=this.path+e);var r=this,o=ln.get(e);if(void 0!==o)return r.manager.itemStart(e),setTimeout(function(){t&&t(o),r.manager.itemEnd(e)},0),o;var s=/^data:(.*?)(;base64)?,(.*)$/,l=e.match(s);if(l){var d=l[1],c=!!l[2],p=l[3];p=window.decodeURIComponent(p),c&&(p=window.atob(p));try{var u=(this.responseType||'').toLowerCase(),m;switch(u){case'arraybuffer':case'blob':m=new ArrayBuffer(p.length);for(var g=new Uint8Array(m),h=0;h=r)){var s=t[1];e=r)break seek}o=n,n=0;break linear_scan}break validate_interval}for(;n>>1;et;)--o;if(++o,0!=r||o!==a){r>=o&&(o=y(o,1),r=o-1);var i=this.getValueSize();this.times=cn.arraySlice(n,r,o),this.values=cn.arraySlice(this.values,r*i,o*i)}return this},validate:function(){var e=!0,t=this.getValueSize();0!=t-h(t)&&(console.error('THREE.KeyframeTrackPrototype: Invalid value size in track.',this),e=!1);var a=this.times,r=this.values,o=a.length;0===o&&(console.error('THREE.KeyframeTrackPrototype: Track is empty.',this),e=!1);for(var s=null,l=0,i;l!==o;l++){if(i=a[l],'number'==typeof i&&isNaN(i)){console.error('THREE.KeyframeTrackPrototype: Time is not a valid number.',this,l,i),e=!1;break}if(null!=s&&s>i){console.error('THREE.KeyframeTrackPrototype: Out of order keys.',this,l,i,s),e=!1;break}s=i}if(r!==void 0&&cn.isTypedArray(r))for(var l=0,d=r.length,n;l!==d;++l)if(n=r[l],isNaN(n)){console.error('THREE.KeyframeTrackPrototype: Value is not a valid number.',this,l,n),e=!1;break}return e},optimize:function(){for(var e=this.times,t=this.values,n=this.getValueSize(),a=this.getInterpolation()===xt,r=1,o=e.length-1,s=1;sl.opacity&&(l.transparent=!0),a.setTextures(s),a.parse(l)}}()}),Object.assign(JSONLoader.prototype,{load:function(e,t,n,a){var r=this,o=this.texturePath&&'string'==typeof this.texturePath?this.texturePath:Loader.prototype.extractUrlBase(e),i=new FileLoader(this.manager);i.setWithCredentials(this.withCredentials),i.load(e,function(n){var a=JSON.parse(n),i=a.metadata;if(i!==void 0){var s=i.type;if(s!==void 0){if('object'===s.toLowerCase())return void console.error('THREE.JSONLoader: '+e+' should be loaded with THREE.ObjectLoader instead.');if('scene'===s.toLowerCase())return void console.error('THREE.JSONLoader: '+e+' should be loaded with THREE.SceneLoader instead.')}}var l=r.parse(a,o);t(l.geometry,l.materials)},n,a)},setTexturePath:function(e){this.texturePath=e},parse:function(){function parseModel(e,t){function isBitSet(e,t){return e&1<i;i++)f=n[p++],N=D[2*f],u=D[2*f+1],I=new Vector2(N,u),2!==i&&t.faceVertexUvs[d][c].push(I),0!==i&&t.faceVertexUvs[d][c+1].push(I);if(b&&(h=3*n[p++],w.normal.set(r[h++],r[h++],r[h]),M.normal.copy(w.normal)),x)for(d=0;4>d;d++)h=3*n[p++],B=new Vector3(r[h++],r[h++],r[h]),2!==d&&w.vertexNormals.push(B),0!==d&&M.vertexNormals.push(B);if(T&&(g=n[p++],L=o[g],w.color.setHex(L),M.color.setHex(L)),S)for(d=0;4>d;d++)g=n[p++],L=o[g],2!==d&&w.vertexColors.push(new Color(L)),0!==d&&M.vertexColors.push(new Color(L));t.faces.push(w),t.faces.push(M)}else{if(F=new Face3,F.a=n[p++],F.b=n[p++],F.c=n[p++],y&&(E=n[p++],F.materialIndex=E),c=t.faces.length,A)for(d=0;di;i++)f=n[p++],N=D[2*f],u=D[2*f+1],I=new Vector2(N,u),t.faceVertexUvs[d][c].push(I);if(b&&(h=3*n[p++],F.normal.set(r[h++],r[h++],r[h])),x)for(d=0;3>d;d++)h=3*n[p++],B=new Vector3(r[h++],r[h++],r[h]),F.vertexNormals.push(B);if(T&&(g=n[p++],F.color.setHex(o[g])),S)for(d=0;3>d;d++)g=n[p++],F.vertexColors.push(new Color(o[g]));t.faces.push(F)}}function parseSkin(e,t){var n=e.influencesPerVertex===void 0?2:e.influencesPerVertex;if(e.skinWeights)for(var r=0,o=e.skinWeights.length;rd)s=r+1;else if(0n&&(n=0),1g&&(l.normalize(),p=r(kt.clamp(a[c-1].dot(a[c]),-1,1)),o[c].applyMatrix4(d.makeRotationAxis(l,p))),s[c].crossVectors(a[c],o[c]);if(!0===t)for(p=r(kt.clamp(o[0].dot(o[e]),-1,1)),p/=e,0=t){var r=n[a]-t,o=this.curves[a],i=o.getLength(),s=0===i?0:1-r/i;return o.getPointAt(s)}a++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var e=[],t=0,n=0,a=this.curves.length;nn;)n+=t;for(;n>t;)n-=t;nt.length-2?t.length-1:a+1],l=t[a>t.length-3?t.length-1:a+2];return new Vector2(CatmullRom(r,o.x,i.x,s.x,l.x),CatmullRom(r,o.y,i.y,s.y,l.y))},CubicBezierCurve.prototype=Object.create(Curve.prototype),CubicBezierCurve.prototype.constructor=CubicBezierCurve,CubicBezierCurve.prototype.getPoint=function(e){var t=this.v0,n=this.v1,a=this.v2,r=this.v3;return new Vector2(CubicBezier(e,t.x,n.x,a.x,r.x),CubicBezier(e,t.y,n.y,a.y,r.y))},QuadraticBezierCurve.prototype=Object.create(Curve.prototype),QuadraticBezierCurve.prototype.constructor=QuadraticBezierCurve,QuadraticBezierCurve.prototype.getPoint=function(e){var t=this.v0,n=this.v1,a=this.v2;return new Vector2(QuadraticBezier(e,t.x,n.x,a.x),QuadraticBezier(e,t.y,n.y,a.y))};var fn=Object.assign(Object.create(CurvePath.prototype),{fromPoints:function(e){this.moveTo(e[0].x,e[0].y);for(var t=1,n=e.length;tg){if(0>d&&(i=t[o],l=-l,s=t[r],d=-d),e.ys.y)continue;if(e.y!==i.y){var c=d*(e.x-i.x)-l*(e.y-i.y);if(0==c)return!0;if(0>c)continue;a=!a}else if(e.x===i.x)return!0}else{if(e.y!==i.y)continue;if(s.x<=e.x&&e.x<=i.x||i.x<=e.x&&e.x<=s.x)return!0}}return a}var n=rn.isClockWise,a=this.subPaths;if(0===a.length)return[];if(!0===t)return toShapesNoHoles(a);var r=[],o,s,d;if(1===a.length)return s=a[0],d=new Shape,d.curves=s.curves,r.push(d),r;var c=!n(a[0].getPoints());c=e?!c:c;var p=[],u=[],m=[],h=0,f;u[h]=void 0,m[h]=[];for(var E=0,i=a.length;Er){this._mixBufferRegion(n,a,3*t,1-r,t)}for(var s=t;s!==t+t;++s)if(n[s]!==n[s+t]){o.setValue(n,a);break}},saveOriginalState:function(){var e=this.binding,t=this.buffer,n=this.valueSize,a=3*n;e.getValue(t,a);for(var r=n;r!==a;++r)t[r]=t[a+r%n];this.cumulativeWeight=0},restoreOriginalState:function(){var e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_select:function(e,n,a,r,t){if(0.5<=r)for(var o=0;o!==t;++o)e[n+o]=e[a+o]},_slerp:function(e,n,a,r){Quaternion.slerpFlat(e,n,e,n,e,a,r)},_lerp:function(e,n,a,r,t){for(var o=0,i;o!==t;++o)i=n+o,e[i]=e[i]*(1-r)+e[a+o]*r}}),Object.assign(Composite.prototype,{getValue:function(e,t){this.bind();var n=this._targetGroup.nCachedObjects_,a=this._bindings[n];a!==void 0&&a.getValue(e,t)},setValue:function(e,t){for(var a=this._bindings,r=this._targetGroup.nCachedObjects_,o=a.length;r!==o;++r)a[r].setValue(e,t)},bind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,a=e.length;t!==a;++t)e[t].bind()},unbind:function(){for(var e=this._bindings,t=this._targetGroup.nCachedObjects_,a=e.length;t!==a;++t)e[t].unbind()}}),Object.assign(PropertyBinding,{Composite:Composite,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new PropertyBinding.Composite(e,t,n):new PropertyBinding(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\\s/g,'_').replace(/[^\\w-]/g,'')},parseTrackName:function(){var e=/((?:[\\w-]+[\\/:])*)/,t=/([\\w-\\.]+)?/,n=/(?:\\.([\\w-]+)(?:\\[(.+)\\])?)?/,a=/\\.([\\w-]+)(?:\\[(.+)\\])?/,r=new RegExp('^'+e.source+t.source+n.source+a.source+'$'),o=['material','materials','bones'];return function(e){var t=r.exec(e);if(!t)throw new Error('PropertyBinding: Cannot parse trackName: '+e);var n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},a=n.nodeName&&n.nodeName.lastIndexOf('.');if(a!==void 0&&-1!==a){var i=n.nodeName.substring(a+1);-1!==o.indexOf(i)&&(n.nodeName=n.nodeName.substring(0,a),n.objectName=i)}if(null===n.propertyName||0===n.propertyName.length)throw new Error('PropertyBinding: can not parse propertyName from trackName: '+e);return n}}(),findNode:function(e,t){if(!t||''===t||'root'===t||'.'===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){var n=function(e){for(var n=0,a;n=t){var c=t++,p=e[c];a[p.uuid]=d,e[d]=p,a[l]=c,e[c]=n;for(var u=0;u!==o;++u){var m=r[u],g=m[c],h=m[d];m[d]=g,m[c]=h}}}this.nCachedObjects_=t},uncache:function(){for(var e=this._objects,t=e.length,a=this.nCachedObjects_,r=this._indicesByUUID,o=this._bindings,s=o.length,l=0,i=arguments.length;l!==i;++l){var n=arguments[l],d=n.uuid,c=r[d];if(void 0!==c)if(delete r[d],co||0===n)return;this._startTime=null,t=n*o}t*=this._updateTimeScale(e);var i=this._updateTime(t),s=this._updateWeight(e);if(0n.parameterPositions[1]&&(this.stopFading(),0===a&&(this.enabled=!1))}}return this._effectiveWeight=t,t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var n=this._timeScaleInterpolant;if(null!==n){var a=n.evaluate(e)[0];t*=a,e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t},_updateTime:function(e){var t=this.time+e;if(0===e)return t;var n=this._clip.duration,a=this.loop,r=this._loopCount;if(a===_t){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));handle_stop:{if(t>=n)t=n;else if(0>t)t=0;else break handle_stop;this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:'finished',action:this,direction:0>e?-1:1})}}else{var o=a===yt;if(-1===r&&(0<=e?(r=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),t>=n||0>t){var i=h(t/n);t-=n*i,r+=A(i);var s=this.repetitions-r;if(0>s)this.clampWhenFinished?this.paused=!0:this.enabled=!1,t=0e;this._setEndings(l,!l,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this._mixer.dispatchEvent({type:'loop',action:this,loopDelta:i})}}if(o&&1==(1&r))return this.time=t,n-t}return this.time=t,t},_setEndings:function(e,t,n){var a=this._interpolantSettings;n?(a.endingStart=Tt,a.endingEnd=Tt):(a.endingStart=e?this.zeroSlopeAtStart?Tt:vt:St,a.endingEnd=t?this.zeroSlopeAtEnd?Tt:vt:St)},_scheduleFading:function(e,t,n){var a=this._mixer,r=a.time,o=this._weightInterpolant;null===o&&(o=a._lendControlInterpolant(),this._weightInterpolant=o);var i=o.parameterPositions,s=o.sampleValues;return i[0]=r,s[0]=t,i[1]=r+e,s[1]=n,this}}),Object.assign(AnimationMixer.prototype,EventDispatcher.prototype,{_bindAction:function(e,t){var n=e._localRoot||this._root,a=e._clip.tracks,r=a.length,o=e._propertyBindings,s=e._interpolants,l=n.uuid,d=this._bindingsByRootAndName,c=d[l];c===void 0&&(c={},d[l]=c);for(var p=0;p!==r;++p){var i=a[p],u=i.name,m=c[u];if(void 0!==m)o[p]=m;else{if(m=o[p],void 0!==m){null===m._cacheIndex&&(++m.referenceCount,this._addInactiveBinding(m,l,u));continue}var g=t&&t._propertyBindings[p].binding.parsedPath;m=new PropertyMixer(PropertyBinding.create(n,u,g),i.ValueTypeName,i.getValueSize()),++m.referenceCount,this._addInactiveBinding(m,l,u),o[p]=m}s[p].resultBuffer=m.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,a=e._clip.uuid,r=this._actionsByClip[a];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,a,t)}for(var o=e._propertyBindings,s=0,i=o.length,n;s!==i;++s)n=o[s],0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState());this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,a=0,r=t.length,n;a!==r;++a)n=t[a],0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n));this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&tA(e)&&(e=1e-8),this.scale.set(0.5*this.size,0.5*this.size,e),this.lookAt(this.plane.normal),this.updateMatrixWorld()};var Cn,yn;ArrowHelper.prototype=Object.create(Object3D.prototype),ArrowHelper.prototype.constructor=ArrowHelper,ArrowHelper.prototype.setDirection=function(){var e=new Vector3,t;return function setDirection(n){0.99999n.y?this.quaternion.set(1,0,0,0):(e.set(n.z,0,-n.x).normalize(),t=r(n.y),this.quaternion.setFromAxisAngle(e,t))}}(),ArrowHelper.prototype.setLength=function(e,t,n){t===void 0&&(t=0.2*e),n===void 0&&(n=0.2*t),this.line.scale.set(1,y(0,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()},ArrowHelper.prototype.setColor=function(e){this.line.material.color.copy(e),this.cone.material.color.copy(e)},AxisHelper.prototype=Object.create(LineSegments.prototype),AxisHelper.prototype.constructor=AxisHelper;var An=new Vector3,bn=new CubicPoly,xn=new CubicPoly,vn=new CubicPoly;CatmullRomCurve3.prototype=Object.create(Curve.prototype),CatmullRomCurve3.prototype.constructor=CatmullRomCurve3,CatmullRomCurve3.prototype.getPoint=function(e){var t=this.points,n=t.length,a=(n-(this.closed?0:1))*e,r=h(a),o=a-r;this.closed?r+=0m&&(m=1),1e-4>u&&(u=m),1e-4>g&&(g=m),bn.initNonuniformCatmullRom(i.x,l.x,d.x,c.x,u,m,g),xn.initNonuniformCatmullRom(i.y,l.y,d.y,c.y,u,m,g),vn.initNonuniformCatmullRom(i.z,l.z,d.z,c.z,u,m,g)}else if('catmullrom'===this.type){var f=void 0===this.tension?0.5:this.tension;bn.initCatmullRom(i.x,l.x,d.x,c.x,f),xn.initCatmullRom(i.y,l.y,d.y,c.y,f),vn.initCatmullRom(i.z,l.z,d.z,c.z,f)}return new Vector3(bn.calc(o),xn.calc(o),vn.calc(o))},CubicBezierCurve3.prototype=Object.create(Curve.prototype),CubicBezierCurve3.prototype.constructor=CubicBezierCurve3,CubicBezierCurve3.prototype.getPoint=function(e){var t=this.v0,n=this.v1,a=this.v2,r=this.v3;return new Vector3(CubicBezier(e,t.x,n.x,a.x,r.x),CubicBezier(e,t.y,n.y,a.y,r.y),CubicBezier(e,t.z,n.z,a.z,r.z))},QuadraticBezierCurve3.prototype=Object.create(Curve.prototype),QuadraticBezierCurve3.prototype.constructor=QuadraticBezierCurve3,QuadraticBezierCurve3.prototype.getPoint=function(e){var t=this.v0,n=this.v1,a=this.v2;return new Vector3(QuadraticBezier(e,t.x,n.x,a.x),QuadraticBezier(e,t.y,n.y,a.y),QuadraticBezier(e,t.z,n.z,a.z))},LineCurve3.prototype=Object.create(Curve.prototype),LineCurve3.prototype.constructor=LineCurve3,LineCurve3.prototype.getPoint=function(e){if(1===e)return this.v2.clone();var t=new Vector3;return t.subVectors(this.v2,this.v1),t.multiplyScalar(e),t.add(this.v1),t},ArcCurve.prototype=Object.create(EllipseCurve.prototype),ArcCurve.prototype.constructor=ArcCurve;var Tn={createMultiMaterialObject:function(e,t){for(var n=new Group,a=0,r=t.length;at[5]&&t[0]>t[10]?(a=2*l(1+t[0]-t[5]-t[10]),e[3]=(t[6]-t[9])/a,e[0]=0.25*a,e[1]=(t[1]+t[4])/a,e[2]=(t[8]+t[2])/a):t[5]>t[10]?(a=2*l(1+t[5]-t[0]-t[10]),e[3]=(t[8]-t[2])/a,e[0]=(t[1]+t[4])/a,e[1]=0.25*a,e[2]=(t[6]+t[9])/a):(a=2*l(1+t[10]-t[0]-t[5]),e[3]=(t[1]-t[4])/a,e[0]=(t[8]+t[2])/a,e[1]=(t[6]+t[9])/a,e[2]=0.25*a),e},t.fromRotationTranslationScale=function fromRotationTranslationScale(e,t,n,a){var r=t[0],o=t[1],i=t[2],s=t[3],l=r+r,d=o+o,c=i+i,p=r*l,u=r*d,m=r*c,g=o*d,h=o*c,f=i*c,E=s*l,_=s*d,C=s*c,y=a[0],A=a[1],b=a[2];return e[0]=(1-(g+f))*y,e[1]=(u+C)*y,e[2]=(m-_)*y,e[3]=0,e[4]=(u-C)*A,e[5]=(1-(p+f))*A,e[6]=(h+E)*A,e[7]=0,e[8]=(m+_)*b,e[9]=(h-E)*b,e[10]=(1-(p+g))*b,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e},t.fromRotationTranslationScaleOrigin=function fromRotationTranslationScaleOrigin(e,t,n,a,r){var o=t[0],i=t[1],s=t[2],l=t[3],d=o+o,c=i+i,p=s+s,u=o*d,m=o*c,g=o*p,h=i*c,f=i*p,E=s*p,_=l*d,C=l*c,y=l*p,A=a[0],b=a[1],x=a[2],v=r[0],T=r[1],S=r[2],R=(1-(h+E))*A,F=(m+y)*A,w=(g-C)*A,M=(m-y)*b,L=(1-(u+E))*b,B=(f+_)*b,D=(g+C)*x,I=(f-_)*x,N=(1-(u+h))*x;return e[0]=R,e[1]=F,e[2]=w,e[3]=0,e[4]=M,e[5]=L,e[6]=B,e[7]=0,e[8]=D,e[9]=I,e[10]=N,e[11]=0,e[12]=n[0]+v-(R*v+M*T+D*S),e[13]=n[1]+T-(F*v+L*T+I*S),e[14]=n[2]+S-(w*v+B*T+N*S),e[15]=1,e},t.fromQuat=function fromQuat(e,t){var n=t[0],a=t[1],r=t[2],o=t[3],i=n+n,s=a+a,l=r+r,d=n*i,c=a*i,p=a*s,u=r*i,m=r*s,g=r*l,h=o*i,f=o*s,E=o*l;return e[0]=1-p-g,e[1]=c+E,e[2]=u-f,e[3]=0,e[4]=c-E,e[5]=1-d-g,e[6]=m+h,e[7]=0,e[8]=u+f,e[9]=m-h,e[10]=1-d-p,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},t.frustum=function frustum(e,t,n,a,r,o,i){var s=1/(n-t),l=1/(r-a),d=1/(o-i);return e[0]=2*o*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*o*l,e[6]=0,e[7]=0,e[8]=(n+t)*s,e[9]=(r+a)*l,e[10]=(i+o)*d,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*(i*o)*d,e[15]=0,e},t.perspective=function perspective(e,t,n,r,o){var i=1/a(t/2),s;return e[0]=i/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=o&&o!==Infinity?(s=1/(r-o),e[10]=(o+r)*s,e[14]=2*o*r*s):(e[10]=-1,e[14]=-2*r),e},t.perspectiveFromFieldOfView=function perspectiveFromFieldOfView(e,t,n,r){var o=a(t.upDegrees*c/180),i=a(t.downDegrees*c/180),s=a(t.leftDegrees*c/180),l=a(t.rightDegrees*c/180),d=2/(s+l),p=2/(o+i);return e[0]=d,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=p,e[6]=0,e[7]=0,e[8]=-(0.5*((s-l)*d)),e[9]=0.5*((o-i)*p),e[10]=r/(n-r),e[11]=-1,e[12]=0,e[13]=0,e[14]=r*n/(n-r),e[15]=0,e},t.ortho=function ortho(e,t,n,a,r,o,i){var s=1/(t-n),l=1/(a-r),d=1/(o-i);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*d,e[11]=0,e[12]=(t+n)*s,e[13]=(r+a)*l,e[14]=(i+o)*d,e[15]=1,e},t.lookAt=function lookAt(e,t,n,a){var r=void 0,o=void 0,i=void 0,s=void 0,c=void 0,u=void 0,m=void 0,g=void 0,h=void 0,f=void 0,E=t[0],_=t[1],C=t[2],y=a[0],A=a[1],b=a[2],x=n[0],v=n[1],T=n[2];return d(E-x)f&&(f=-f,p=-p,u=-u,m=-m,g=-g),1-f>l.b?(h=r(f),E=o(h),_=o((1-i)*h)/E,C=o(i*h)/E):(_=1-i,C=i),e[0]=_*t+C*p,e[1]=_*s+C*u,e[2]=_*d+C*m,e[3]=_*c+C*g,e}function fromMat3(e,t){var n=t[0]+t[4]+t[8],a=void 0;if(0t[0]&&(r=1),t[8]>t[3*r+r]&&(r=2);var o=(r+1)%3,i=(r+2)%3;a=s(t[3*r+r]-t[3*o+o]-t[3*i+i]+1),e[r]=0.5*a,a=0.5/a,e[3]=(t[3*o+i]-t[3*i+o])*a,e[o]=(t[3*o+r]+t[3*r+o])*a,e[i]=(t[3*i+r]+t[3*r+i])*a}return e}var r=Math.acos,o=Math.sin,i=Math.cos,s=Math.sqrt,a=Math.PI;Object.defineProperty(t,'__esModule',{value:!0}),t.create=create,t.identity=function identity(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},t.setAxisAngle=setAxisAngle,t.getAxisAngle=function getAxisAngle(e,t){var n=2*r(t[3]),a=o(n/2);return a>l.b?(e[0]=t[0]/a,e[1]=t[1]/a,e[2]=t[2]/a):(e[0]=1,e[1]=0,e[2]=0),n},t.multiply=multiply,t.rotateX=function rotateX(e,t,n){n*=0.5;var a=t[0],r=t[1],s=t[2],l=t[3],d=o(n),c=i(n);return e[0]=a*c+l*d,e[1]=r*c+s*d,e[2]=s*c-r*d,e[3]=l*c-a*d,e},t.rotateY=function rotateY(e,t,n){n*=0.5;var a=t[0],r=t[1],s=t[2],l=t[3],d=o(n),c=i(n);return e[0]=a*c-s*d,e[1]=r*c+l*d,e[2]=s*c+a*d,e[3]=l*c-r*d,e},t.rotateZ=function rotateZ(e,t,n){n*=0.5;var a=t[0],r=t[1],s=t[2],l=t[3],d=o(n),c=i(n);return e[0]=a*c+r*d,e[1]=r*c-a*d,e[2]=s*c+l*d,e[3]=l*c-s*d,e},t.calculateW=function calculateW(e,t){var n=t[0],a=t[1],r=t[2];return e[0]=n,e[1]=a,e[2]=r,e[3]=s(Math.abs(1-n*n-a*a-r*r)),e},t.slerp=slerp,t.random=function random(e){var t=l.c(),n=l.c(),r=l.c(),d=s(1-t),c=s(t);return e[0]=d*o(2*a*n),e[1]=d*i(2*a*n),e[2]=c*o(2*a*r),e[3]=c*i(2*a*r),e},t.invert=function invert(e,t){var n=t[0],a=t[1],r=t[2],o=t[3],i=n*n+a*a+r*r+o*o,s=i?1/i:0;return e[0]=-n*s,e[1]=-a*s,e[2]=-r*s,e[3]=o*s,e},t.conjugate=function conjugate(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},t.fromMat3=fromMat3,t.fromEuler=function fromEuler(e,t,n,r){var s=0.5*a/180;t*=s,n*=s,r*=s;var l=o(t),d=i(t),c=o(n),p=i(n),u=o(r),m=i(r);return e[0]=l*p*m-d*c*u,e[1]=d*c*m+l*p*u,e[2]=d*p*u-l*c*m,e[3]=d*p*m+l*c*u,e},t.str=function str(e){return'quat('+e[0]+', '+e[1]+', '+e[2]+', '+e[3]+')'},n.d(t,'clone',function(){return u}),n.d(t,'fromValues',function(){return m}),n.d(t,'copy',function(){return g}),n.d(t,'set',function(){return h}),n.d(t,'add',function(){return f}),n.d(t,'mul',function(){return E}),n.d(t,'scale',function(){return _}),n.d(t,'dot',function(){return C}),n.d(t,'lerp',function(){return y}),n.d(t,'length',function(){return A}),n.d(t,'len',function(){return b}),n.d(t,'squaredLength',function(){return x}),n.d(t,'sqrLen',function(){return v}),n.d(t,'normalize',function(){return T}),n.d(t,'exactEquals',function(){return S}),n.d(t,'equals',function(){return R}),n.d(t,'rotationTo',function(){return F}),n.d(t,'sqlerp',function(){return w}),n.d(t,'setAxes',function(){return M});var l=n(0),d=n(8),c=n(11),p=n(12),u=p.clone,m=p.fromValues,g=p.copy,h=p.set,f=p.add,E=multiply,_=p.scale,C=p.dot,y=p.lerp,A=p.length,b=A,x=p.squaredLength,v=x,T=p.normalize,S=p.exactEquals,R=p.equals,F=function(){var e=c.create(),t=c.fromValues(1,0,0),n=c.fromValues(0,1,0);return function(r,o,a){var i=c.dot(o,a);return-0.999999>i?(c.cross(e,t,o),1e-6>c.len(e)&&c.cross(e,n,o),c.normalize(e,e),setAxisAngle(r,e,Math.PI),r):0.999999r?m:Math.acos(r)},t.str=function str(e){return'vec3('+e[0]+', '+e[1]+', '+e[2]+')'},t.exactEquals=function exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},t.equals=function equals(e,t){var n=e[0],a=e[1],r=e[2],o=t[0],i=t[1],s=t[2];return u(n-o)<=g.b*p(1,u(n),u(o))&&u(a-i)<=g.b*p(1,u(a),u(i))&&u(r-s)<=g.b*p(1,u(r),u(s))},n.d(t,'sub',function(){return a}),n.d(t,'mul',function(){return h}),n.d(t,'div',function(){return f}),n.d(t,'dist',function(){return E}),n.d(t,'sqrDist',function(){return _}),n.d(t,'len',function(){return C}),n.d(t,'sqrLen',function(){return y}),n.d(t,'forEach',function(){return A});var g=n(0),a=subtract,h=multiply,f=divide,E=distance,_=squaredDistance,C=length,y=squaredLength,A=function(){var e=create();return function(t,n,a,r,o,d){var c,i;for(n||(n=3),a||(a=0),i=r?s(r*n+a,t.length):t.length,c=a;cp.length;)p='0'+p;return'#'+p}return'CSS_RGB'===n?'rgb('+i+','+r+','+l+')':'CSS_RGBA'===n?'rgba('+i+','+r+','+l+','+d+')':'HEX'===n?'0x'+e.hex.toString(16):'RGB_ARRAY'===n?'['+i+','+r+','+l+']':'RGBA_ARRAY'===n?'['+i+','+r+','+l+','+d+']':'RGB_OBJ'===n?'{r:'+i+',g:'+r+',b:'+l+'}':'RGBA_OBJ'===n?'{r:'+i+',g:'+r+',b:'+l+',a:'+d+'}':'HSV_OBJ'===n?'{h:'+a+',s:'+c+',v:'+s+'}':'HSVA_OBJ'===n?'{h:'+a+',s:'+c+',v:'+s+',a:'+d+'}':'unknown format'}function defineRGBComponent(e,t,n){Object.defineProperty(e,t,{get:function get$$1(){return'RGB'===this.__state.space?this.__state[t]:(y.recalculateRGB(this,t,n),this.__state[t])},set:function set$$1(e){'RGB'!==this.__state.space&&(y.recalculateRGB(this,t,n),this.__state.space='RGB'),this.__state[t]=e}})}function defineHSVComponent(e,t){Object.defineProperty(e,t,{get:function get$$1(){return'HSV'===this.__state.space?this.__state[t]:(y.recalculateHSV(this),this.__state[t])},set:function set$$1(e){'HSV'!==this.__state.space&&(y.recalculateHSV(this),this.__state.space='HSV'),this.__state[t]=e}})}function cssValueToPixels(e){if('0'===e||l.isUndefined(e))return 0;var t=e.match(x);return l.isNull(t)?0:parseFloat(t[1])}function numDecimals(e){var t=e.toString();return-1i&&(i+=1),{h:360*i,s:l,v:r/255}},rgb_to_hex:function rgb_to_hex(e,t,n){var a=this.hex_with_component(0,2,e);return a=this.hex_with_component(a,1,t),a=this.hex_with_component(a,0,n),a},component_from_hex:function component_from_hex(e,t){return 255&e>>8*t},hex_with_component:function hex_with_component(e,t,n){return n<<(u=8*t)|e&~(255<this.__max&&(t=this.__max),void 0!==this.__step&&0!=t%this.__step&&(t=o(t/this.__step)*this.__step),E(NumberController.prototype.__proto__||Object.getPrototypeOf(NumberController.prototype),'setValue',this).call(this,t)}},{key:'min',value:function min(e){return this.__min=e,this}},{key:'max',value:function max(e){return this.__max=e,this}},{key:'step',value:function step(e){return this.__step=e,this.__impliedStep=e,this.__precision=numDecimals(e),this}}]),NumberController}(A),w=function(e){function NumberControllerBox(e,t,n){function onFinish(){r.__onFinishChange&&r.__onFinishChange.call(r,r.getValue())}function onMouseDrag(t){var e=o-t.clientY;r.setValue(r.getValue()+e*r.__impliedStep),o=t.clientY}function onMouseUp(){T.unbind(window,'mousemove',onMouseDrag),T.unbind(window,'mouseup',onMouseUp),onFinish()}h(this,NumberControllerBox);var a=C(this,(NumberControllerBox.__proto__||Object.getPrototypeOf(NumberControllerBox)).call(this,e,t,n));a.__truncationSuspended=!1;var r=a,o=void 0;return a.__input=document.createElement('input'),a.__input.setAttribute('type','text'),T.bind(a.__input,'change',function onChange(){var e=parseFloat(r.__input.value);l.isNaN(e)||r.setValue(e)}),T.bind(a.__input,'blur',function onBlur(){onFinish()}),T.bind(a.__input,'mousedown',function onMouseDown(t){T.bind(window,'mousemove',onMouseDrag),T.bind(window,'mouseup',onMouseUp),o=t.clientY}),T.bind(a.__input,'keydown',function(t){13===t.keyCode&&(r.__truncationSuspended=!0,this.blur(),r.__truncationSuspended=!1,onFinish())}),a.updateDisplay(),a.domElement.appendChild(a.__input),a}return _(NumberControllerBox,e),f(NumberControllerBox,[{key:'updateDisplay',value:function updateDisplay(){return this.__input.value=this.__truncationSuspended?this.getValue():roundToDecimal(this.getValue(),this.__precision),E(NumberControllerBox.prototype.__proto__||Object.getPrototypeOf(NumberControllerBox.prototype),'updateDisplay',this).call(this)}}]),NumberControllerBox}(F),M=function(e){function NumberControllerSlider(e,t,n,a,r){function onMouseDrag(t){t.preventDefault();var e=i.__background.getBoundingClientRect();return i.setValue(map(t.clientX,e.left,e.right,i.__min,i.__max)),!1}function onMouseUp(){T.unbind(window,'mousemove',onMouseDrag),T.unbind(window,'mouseup',onMouseUp),i.__onFinishChange&&i.__onFinishChange.call(i,i.getValue())}function onTouchMove(t){var e=t.touches[0].clientX,n=i.__background.getBoundingClientRect();i.setValue(map(e,n.left,n.right,i.__min,i.__max))}function onTouchEnd(){T.unbind(window,'touchmove',onTouchMove),T.unbind(window,'touchend',onTouchEnd),i.__onFinishChange&&i.__onFinishChange.call(i,i.getValue())}h(this,NumberControllerSlider);var o=C(this,(NumberControllerSlider.__proto__||Object.getPrototypeOf(NumberControllerSlider)).call(this,e,t,{min:n,max:a,step:r})),i=o;return o.__background=document.createElement('div'),o.__foreground=document.createElement('div'),T.bind(o.__background,'mousedown',function onMouseDown(t){document.activeElement.blur(),T.bind(window,'mousemove',onMouseDrag),T.bind(window,'mouseup',onMouseUp),onMouseDrag(t)}),T.bind(o.__background,'touchstart',function onTouchStart(t){1!==t.touches.length||(T.bind(window,'touchmove',onTouchMove),T.bind(window,'touchend',onTouchEnd),onTouchMove(t))}),T.addClass(o.__background,'slider'),T.addClass(o.__foreground,'slider-fg'),o.updateDisplay(),o.__background.appendChild(o.__foreground),o.domElement.appendChild(o.__background),o}return _(NumberControllerSlider,e),f(NumberControllerSlider,[{key:'updateDisplay',value:function updateDisplay(){var e=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*e+'%',E(NumberControllerSlider.prototype.__proto__||Object.getPrototypeOf(NumberControllerSlider.prototype),'updateDisplay',this).call(this)}}]),NumberControllerSlider}(F),L=function(e){function FunctionController(e,t,n){h(this,FunctionController);var a=C(this,(FunctionController.__proto__||Object.getPrototypeOf(FunctionController)).call(this,e,t));return a.__button=document.createElement('div'),a.__button.innerHTML=void 0===n?'Fire':n,T.bind(a.__button,'click',function(t){return t.preventDefault(),a.fire(),!1}),T.addClass(a.__button,'button'),a.domElement.appendChild(a.__button),a}return _(FunctionController,e),f(FunctionController,[{key:'fire',value:function fire(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),FunctionController}(A),B=function(e){function ColorController(e,t){function fieldDown(t){setSV(t),T.bind(window,'mousemove',setSV),T.bind(window,'touchmove',setSV),T.bind(window,'mouseup',fieldUpSV),T.bind(window,'touchend',fieldUpSV)}function fieldDownH(t){setH(t),T.bind(window,'mousemove',setH),T.bind(window,'touchmove',setH),T.bind(window,'mouseup',fieldUpH),T.bind(window,'touchend',fieldUpH)}function fieldUpSV(){T.unbind(window,'mousemove',setSV),T.unbind(window,'touchmove',setSV),T.unbind(window,'mouseup',fieldUpSV),T.unbind(window,'touchend',fieldUpSV),onFinish()}function fieldUpH(){T.unbind(window,'mousemove',setH),T.unbind(window,'touchmove',setH),T.unbind(window,'mouseup',fieldUpH),T.unbind(window,'touchend',fieldUpH),onFinish()}function onBlur(){var e=p(this.value);!1===e?this.value=a.__color.toString():(a.__color.__state=e,a.setValue(a.__color.toOriginal()))}function onFinish(){a.__onFinishChange&&a.__onFinishChange.call(a,a.__color.toOriginal())}function setSV(t){-1===t.type.indexOf('touch')&&t.preventDefault();var e=a.__saturation_field.getBoundingClientRect(),n=t.touches&&t.touches[0]||t,r=n.clientX,o=n.clientY,i=(r-e.left)/(e.right-e.left),s=1-(o-e.top)/(e.bottom-e.top);return 1s&&(s=0),1i&&(i=0),a.__color.v=s,a.__color.s=i,a.setValue(a.__color.toOriginal()),!1}function setH(t){-1===t.type.indexOf('touch')&&t.preventDefault();var e=a.__hue_field.getBoundingClientRect(),n=t.touches&&t.touches[0]||t,r=n.clientY,o=1-(r-e.top)/(e.bottom-e.top);return 1o&&(o=0),a.__color.h=360*o,a.setValue(a.__color.toOriginal()),!1}h(this,ColorController);var n=C(this,(ColorController.__proto__||Object.getPrototypeOf(ColorController)).call(this,e,t));n.__color=new y(n.getValue()),n.__temp=new y(0);var a=n;n.domElement=document.createElement('div'),T.makeSelectable(n.domElement,!1),n.__selector=document.createElement('div'),n.__selector.className='selector',n.__saturation_field=document.createElement('div'),n.__saturation_field.className='saturation-field',n.__field_knob=document.createElement('div'),n.__field_knob.className='field-knob',n.__field_knob_border='2px solid ',n.__hue_knob=document.createElement('div'),n.__hue_knob.className='hue-knob',n.__hue_field=document.createElement('div'),n.__hue_field.className='hue-field',n.__input=document.createElement('input'),n.__input.type='text',n.__input_textShadow='0 1px 1px ',T.bind(n.__input,'keydown',function(t){13===t.keyCode&&onBlur.call(this)}),T.bind(n.__input,'blur',onBlur),T.bind(n.__selector,'mousedown',function(){T.addClass(this,'drag').bind(window,'mouseup',function(){T.removeClass(a.__selector,'drag')})}),T.bind(n.__selector,'touchstart',function(){T.addClass(this,'drag').bind(window,'touchend',function(){T.removeClass(a.__selector,'drag')})});var r=document.createElement('div');return l.extend(n.__selector.style,{width:'122px',height:'102px',padding:'3px',backgroundColor:'#222',boxShadow:'0px 1px 3px rgba(0,0,0,0.3)'}),l.extend(n.__field_knob.style,{position:'absolute',width:'12px',height:'12px',border:n.__field_knob_border+(0.5>n.__color.v?'#fff':'#000'),boxShadow:'0px 1px 3px rgba(0,0,0,0.5)',borderRadius:'12px',zIndex:1}),l.extend(n.__hue_knob.style,{position:'absolute',width:'15px',height:'2px',borderRight:'4px solid #fff',zIndex:1}),l.extend(n.__saturation_field.style,{width:'100px',height:'100px',border:'1px solid #555',marginRight:'3px',display:'inline-block',cursor:'pointer'}),l.extend(r.style,{width:'100%',height:'100%',background:'none'}),linearGradient(r,'top','rgba(0,0,0,0)','#000'),l.extend(n.__hue_field.style,{width:'15px',height:'100px',border:'1px solid #555',cursor:'ns-resize',position:'absolute',top:'3px',right:'3px'}),hueGradient(n.__hue_field),l.extend(n.__input.style,{outline:'none',textAlign:'center',color:'#fff',border:0,fontWeight:'bold',textShadow:n.__input_textShadow+'rgba(0,0,0,0.7)'}),T.bind(n.__saturation_field,'mousedown',fieldDown),T.bind(n.__saturation_field,'touchstart',fieldDown),T.bind(n.__field_knob,'mousedown',fieldDown),T.bind(n.__field_knob,'touchstart',fieldDown),T.bind(n.__hue_field,'mousedown',fieldDownH),T.bind(n.__hue_field,'touchstart',fieldDownH),n.__saturation_field.appendChild(r),n.__selector.appendChild(n.__field_knob),n.__selector.appendChild(n.__saturation_field),n.__selector.appendChild(n.__hue_field),n.__hue_field.appendChild(n.__hue_knob),n.domElement.appendChild(n.__input),n.domElement.appendChild(n.__selector),n.updateDisplay(),n}return _(ColorController,e),f(ColorController,[{key:'updateDisplay',value:function updateDisplay(){var e=p(this.getValue());if(!1!==e){var t=!1;l.each(y.COMPONENTS,function(n){if(!l.isUndefined(e[n])&&!l.isUndefined(this.__color.__state[n])&&e[n]!==this.__color.__state[n])return t=!0,{}},this),t&&l.extend(this.__color.__state,e)}l.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var n=0.5>this.__color.v||0.5ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px \\'Lucida Grande\\', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\\n');({load:function load(e,t){var n=t||document,a=n.createElement('link');a.type='text/css',a.rel='stylesheet',a.href=e,n.getElementsByTagName('head')[0].appendChild(a)},inject:function inject(e,t){var n=t||document,a=document.createElement('style');a.type='text/css',a.innerHTML=e;var r=n.getElementsByTagName('head')[0];try{r.appendChild(a)}catch(t){}}}).inject(O);var U='dg',G=72,k=20,W='Default',H=function(){try{return!!window.localStorage}catch(t){return!1}}(),V=void 0,$=!0,z=void 0,X=!1,j=[],Y=function GUI(e){var t=this,n=e||{};this.domElement=document.createElement('div'),this.__ul=document.createElement('ul'),this.domElement.appendChild(this.__ul),T.addClass(this.domElement,U),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],n=l.defaults(n,{closeOnTop:!1,autoPlace:!0,width:GUI.DEFAULT_WIDTH}),n=l.defaults(n,{resizable:n.autoPlace,hideable:n.autoPlace}),l.isUndefined(n.load)?n.load={preset:W}:n.preset&&(n.load.preset=n.preset),l.isUndefined(n.parent)&&n.hideable&&j.push(this),n.resizable=l.isUndefined(n.parent)&&n.resizable,n.autoPlace&&l.isUndefined(n.scrollable)&&(n.scrollable=!0);var a=H&&'true'===localStorage.getItem(getLocalStorageHash(this,'isLocal')),r=void 0,o=void 0;if(Object.defineProperties(this,{parent:{get:function get$$1(){return n.parent}},scrollable:{get:function get$$1(){return n.scrollable}},autoPlace:{get:function get$$1(){return n.autoPlace}},closeOnTop:{get:function get$$1(){return n.closeOnTop}},preset:{get:function get$$1(){return t.parent?t.getRoot().preset:n.load.preset},set:function set$$1(e){t.parent?t.getRoot().preset=e:n.load.preset=e,setPresetSelectIndex(this),t.revert()}},width:{get:function get$$1(){return n.width},set:function set$$1(e){n.width=e,setWidth(t,e)}},name:{get:function get$$1(){return n.name},set:function set$$1(e){n.name=e,o&&(o.innerHTML=n.name)}},closed:{get:function get$$1(){return n.closed},set:function set$$1(e){n.closed=e,n.closed?T.addClass(t.__ul,GUI.CLASS_CLOSED):T.removeClass(t.__ul,GUI.CLASS_CLOSED),this.onResize(),t.__closeButton&&(t.__closeButton.innerHTML=e?GUI.TEXT_OPEN:GUI.TEXT_CLOSED)}},load:{get:function get$$1(){return n.load}},useLocalStorage:{get:function get$$1(){return a},set:function set$$1(e){H&&(a=e,e?T.bind(window,'unload',r):T.unbind(window,'unload',r),localStorage.setItem(getLocalStorageHash(t,'isLocal'),e))}}}),l.isUndefined(n.parent)){if(n.closed=!1,T.addClass(this.domElement,GUI.CLASS_MAIN),T.makeSelectable(this.domElement,!1),H&&a){t.useLocalStorage=!0;var i=localStorage.getItem(getLocalStorageHash(this,'gui'));i&&(n.load=JSON.parse(i))}this.__closeButton=document.createElement('div'),this.__closeButton.innerHTML=GUI.TEXT_CLOSED,T.addClass(this.__closeButton,GUI.CLASS_CLOSE_BUTTON),n.closeOnTop?(T.addClass(this.__closeButton,GUI.CLASS_CLOSE_TOP),this.domElement.insertBefore(this.__closeButton,this.domElement.childNodes[0])):(T.addClass(this.__closeButton,GUI.CLASS_CLOSE_BOTTOM),this.domElement.appendChild(this.__closeButton)),T.bind(this.__closeButton,'click',function(){t.closed=!t.closed})}else{void 0===n.closed&&(n.closed=!0);var s=document.createTextNode(n.name);T.addClass(s,'controller-name'),o=addRow(t,s);var d=function onClickTitle(n){return n.preventDefault(),t.closed=!t.closed,!1};T.addClass(this.__ul,GUI.CLASS_CLOSED),T.addClass(o,'title'),T.bind(o,'click',d),n.closed||(this.closed=!1)}n.autoPlace&&(l.isUndefined(n.parent)&&($&&(z=document.createElement('div'),T.addClass(z,U),T.addClass(z,GUI.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(z),$=!1),z.appendChild(this.domElement),T.addClass(this.domElement,GUI.CLASS_AUTO_PLACE)),!this.parent&&setWidth(t,n.width)),this.__resizeHandler=function(){t.onResizeDebounced()},T.bind(window,'resize',this.__resizeHandler),T.bind(this.__ul,'webkitTransitionEnd',this.__resizeHandler),T.bind(this.__ul,'transitionend',this.__resizeHandler),T.bind(this.__ul,'oTransitionEnd',this.__resizeHandler),this.onResize(),n.resizable&&addResizeHandle(this),r=function saveToLocalStorage(){H&&'true'===localStorage.getItem(getLocalStorageHash(t,'isLocal'))&&localStorage.setItem(getLocalStorageHash(t,'gui'),JSON.stringify(t.getSaveObject()))},this.saveToLocalStorageIfPossible=r,n.parent||function resetWidth(){var e=t.getRoot();e.width+=1,l.defer(function(){e.width-=1})}()};Y.toggleHide=function(){X=!X,l.each(j,function(e){e.domElement.style.display=X?'none':''})},Y.CLASS_AUTO_PLACE='a',Y.CLASS_AUTO_PLACE_CONTAINER='ac',Y.CLASS_MAIN='main',Y.CLASS_CONTROLLER_ROW='cr',Y.CLASS_TOO_TALL='taller-than-window',Y.CLASS_CLOSED='closed',Y.CLASS_CLOSE_BUTTON='close-button',Y.CLASS_CLOSE_TOP='close-top',Y.CLASS_CLOSE_BOTTOM='close-bottom',Y.CLASS_DRAG='drag',Y.DEFAULT_WIDTH=245,Y.TEXT_CLOSED='Close Controls',Y.TEXT_OPEN='Open Controls',Y._keydownHandler=function(t){'text'!==document.activeElement.type&&(t.which===G||t.keyCode===G)&&Y.toggleHide()},T.bind(window,'keydown',Y._keydownHandler,!1),l.extend(Y.prototype,{add:function add(e,t){return _add(this,e,t,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function addColor(e,t){return _add(this,e,t,{color:!0})},remove:function remove(e){this.__ul.removeChild(e.__li),this.__controllers.splice(this.__controllers.indexOf(e),1);var t=this;l.defer(function(){t.onResize()})},destroy:function destroy(){if(this.parent)throw new Error('Only the root GUI should be removed with .destroy(). For subfolders, use gui.removeFolder(folder) instead.');this.autoPlace&&z.removeChild(this.domElement);var e=this;l.each(this.__folders,function(t){e.removeFolder(t)}),T.unbind(window,'keydown',Y._keydownHandler,!1),removeListeners(this)},addFolder:function addFolder(e){if(void 0!==this.__folders[e])throw new Error('You already have a folder in this GUI by the name \"'+e+'\"');var t={name:e,parent:this};t.autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[e]&&(t.closed=this.load.folders[e].closed,t.load=this.load.folders[e]);var n=new Y(t);this.__folders[e]=n;var a=addRow(this,n.domElement);return T.addClass(a,'folder'),n},removeFolder:function removeFolder(e){this.__ul.removeChild(e.domElement.parentElement),delete this.__folders[e.name],this.load&&this.load.folders&&this.load.folders[e.name]&&delete this.load.folders[e.name],removeListeners(e);var t=this;l.each(e.__folders,function(t){e.removeFolder(t)}),l.defer(function(){t.onResize()})},open:function open(){this.closed=!1},close:function close(){this.closed=!0},onResize:function onResize(){var e=this.getRoot();if(e.scrollable){var t=T.getOffset(e.__ul).top,n=0;l.each(e.__ul.childNodes,function(t){e.autoPlace&&t===e.__save_row||(n+=T.getHeight(t))}),window.innerHeight-t-kGUI\\'s constructor:\\n\\n \\n\\n
                      \\n\\n Automatically save\\n values to localStorage on exit.\\n\\n
                      The values saved to localStorage will\\n override those passed to dat.GUI\\'s constructor. This makes it\\n easier to work incrementally, but localStorage is fragile,\\n and your friends may not see the same values you do.\\n\\n
                      \\n\\n
                      \\n\\n'),this.parent)throw new Error('You can only call remember on a top level GUI.');var e=this;l.each(Array.prototype.slice.call(arguments),function(t){0===e.__rememberedObjects.length&&addSaveMenu(e),-1===e.__rememberedObjects.indexOf(t)&&e.__rememberedObjects.push(t)}),this.autoPlace&&setWidth(this,this.width)},getRoot:function getRoot(){for(var e=this;e.parent;)e=e.parent;return e},getSaveObject:function getSaveObject(){var e=this.load;return e.closed=this.closed,0i.children.length;){var a=document.createElement('span');a.style.cssText='width:1px;height:30px;float:left;background-color:#113',i.appendChild(a)}var c=document.createElement('div');c.id='ms',c.style.cssText='padding:0 0 3px 3px;text-align:left;background-color:#020;display:none',_.appendChild(c);var d=document.createElement('div');d.id='msText',d.style.cssText='color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px',d.innerHTML='MS',c.appendChild(d);var A=document.createElement('div');for(A.id='msGraph',A.style.cssText='position:relative;width:74px;height:30px;background-color:#0f0',c.appendChild(A);74>A.children.length;)a=document.createElement('span'),a.style.cssText='width:1px;height:30px;float:left;background-color:#131',A.appendChild(a);var e=function(e){r=e;0===r?(C.style.display='block',c.style.display='none'):1===r?(C.style.display='none',c.style.display='block'):void 0};return{REVISION:12,domElement:_,setMode:e,begin:function(){u=Date.now()},end:function(){var e=Date.now();m=e-u,g=t(g,m),n=s(n,m),d.textContent=m+' MS ('+g+'-'+n+')';var r=t(30,30-30*(m/200));return A.appendChild(A.firstChild).style.height=r+'px',E++,e>l+1E3&&(o=Math.round(1E3*E/(e-l)),h=t(h,o),p=s(p,o),y.textContent=o+' FPS ('+h+'-'+p+')',r=t(30,30-30*(o/100)),i.appendChild(i.firstChild).style.height=r+'px',l=e,E=0),e},update:function(){u=this.end()}}})},function(e,t,n){function OrbitControls(e,t){function getAutoRotationAngle(){return 2*i/60/60*n.autoRotateSpeed}function getZoomScale(){return Math.pow(0.95,n.zoomSpeed)}function rotateLeft(e){h.theta-=e}function rotateUp(e){h.phi-=e}function dollyIn(e){n.object instanceof s.PerspectiveCamera?f/=e:n.object instanceof s.OrthographicCamera?(n.object.zoom=o(n.minZoom,a(n.maxZoom,n.object.zoom*e)),n.object.updateProjectionMatrix(),_=!0):(console.warn('WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.'),n.enableZoom=!1)}function dollyOut(e){n.object instanceof s.PerspectiveCamera?f*=e:n.object instanceof s.OrthographicCamera?(n.object.zoom=o(n.minZoom,a(n.maxZoom,n.object.zoom/e)),n.object.updateProjectionMatrix(),_=!0):(console.warn('WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.'),n.enableZoom=!1)}function handleMouseDownRotate(e){C.set(e.clientX,e.clientY)}function handleMouseDownDolly(e){T.set(e.clientX,e.clientY)}function handleMouseDownPan(e){b.set(e.clientX,e.clientY)}function handleMouseMoveRotate(e){y.set(e.clientX,e.clientY),A.subVectors(y,C);var t=n.domElement===document?n.domElement.body:n.domElement;rotateLeft(2*i*A.x/t.clientWidth*n.rotateSpeed),rotateUp(2*i*A.y/t.clientHeight*n.rotateSpeed),C.copy(y),n.update()}function handleMouseMoveDolly(e){S.set(e.clientX,e.clientY),R.subVectors(S,T),0R.y&&dollyOut(getZoomScale()),T.copy(S),n.update()}function handleMouseMovePan(e){x.set(e.clientX,e.clientY),v.subVectors(x,b),M(v.x,v.y),b.copy(x),n.update()}function handleMouseUp(){}function handleMouseWheel(e){0>e.deltaY?dollyOut(getZoomScale()):0R.y&&dollyIn(getZoomScale()),T.copy(S),n.update()}function handleTouchMovePan(e){x.set(e.touches[0].pageX,e.touches[0].pageY),v.subVectors(x,b),M(v.x,v.y),b.copy(x),n.update()}function handleTouchEnd(){}function onMouseDown(e){if(!1!==n.enabled){switch(e.preventDefault(),e.button){case n.mouseButtons.ORBIT:if(!1===n.enableRotate)return;handleMouseDownRotate(e),u=p.ROTATE;break;case n.mouseButtons.ZOOM:if(!1===n.enableZoom)return;handleMouseDownDolly(e),u=p.DOLLY;break;case n.mouseButtons.PAN:if(!1===n.enablePan)return;handleMouseDownPan(e),u=p.PAN;}u!==p.NONE&&(document.addEventListener('mousemove',onMouseMove,!1),document.addEventListener('mouseup',onMouseUp,!1),n.dispatchEvent(d))}}function onMouseMove(e){if(!1!==n.enabled)switch(e.preventDefault(),u){case p.ROTATE:if(!1===n.enableRotate)return;handleMouseMoveRotate(e);break;case p.DOLLY:if(!1===n.enableZoom)return;handleMouseMoveDolly(e);break;case p.PAN:if(!1===n.enablePan)return;handleMouseMovePan(e);}}function onMouseUp(e){!1===n.enabled||(handleMouseUp(e),document.removeEventListener('mousemove',onMouseMove,!1),document.removeEventListener('mouseup',onMouseUp,!1),n.dispatchEvent(c),u=p.NONE)}function onMouseWheel(e){!1===n.enabled||!1===n.enableZoom||u!==p.NONE&&u!==p.ROTATE||(e.preventDefault(),e.stopPropagation(),handleMouseWheel(e),n.dispatchEvent(d),n.dispatchEvent(c))}function onKeyDown(e){!1===n.enabled||!1===n.enableKeys||!1===n.enablePan||handleKeyDown(e)}function onTouchStart(e){if(!1!==n.enabled){switch(e.touches.length){case 1:if(!1===n.enableRotate)return;handleTouchStartRotate(e),u=p.TOUCH_ROTATE;break;case 2:if(!1===n.enableZoom)return;handleTouchStartDolly(e),u=p.TOUCH_DOLLY;break;case 3:if(!1===n.enablePan)return;handleTouchStartPan(e),u=p.TOUCH_PAN;break;default:u=p.NONE;}u!==p.NONE&&n.dispatchEvent(d)}}function onTouchMove(e){if(!1!==n.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===n.enableRotate)return;if(u!==p.TOUCH_ROTATE)return;handleTouchMoveRotate(e);break;case 2:if(!1===n.enableZoom)return;if(u!==p.TOUCH_DOLLY)return;handleTouchMoveDolly(e);break;case 3:if(!1===n.enablePan)return;if(u!==p.TOUCH_PAN)return;handleTouchMovePan(e);break;default:u=p.NONE;}}function onTouchEnd(e){!1===n.enabled||(handleTouchEnd(e),n.dispatchEvent(c),u=p.NONE)}function onContextMenu(e){!1===n.enabled||e.preventDefault()}this.object=e,this.domElement=t===void 0?document:t,this.enabled=!0,this.target=new s.Vector3,this.minDistance=0,this.maxDistance=Infinity,this.minZoom=0,this.maxZoom=Infinity,this.minPolarAngle=0,this.maxPolarAngle=i,this.minAzimuthAngle=-Infinity,this.maxAzimuthAngle=Infinity,this.enableDamping=!1,this.dampingFactor=0.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:s.MOUSE.LEFT,ZOOM:s.MOUSE.MIDDLE,PAN:s.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return g.phi},this.getAzimuthalAngle=function(){return g.theta},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(l),n.update(),u=p.NONE},this.update=function(){var t=new s.Vector3,r=new s.Quaternion().setFromUnitVectors(e.up,new s.Vector3(0,1,0)),i=r.clone().inverse(),d=new s.Vector3,c=new s.Quaternion;return function update(){var e=n.object.position;return t.copy(e).sub(n.target),t.applyQuaternion(r),g.setFromVector3(t),n.autoRotate&&u===p.NONE&&rotateLeft(getAutoRotationAngle()),g.theta+=h.theta,g.phi+=h.phi,g.theta=o(n.minAzimuthAngle,a(n.maxAzimuthAngle,g.theta)),g.phi=o(n.minPolarAngle,a(n.maxPolarAngle,g.phi)),g.makeSafe(),g.radius*=f,g.radius=o(n.minDistance,a(n.maxDistance,g.radius)),n.target.add(E),t.setFromSpherical(g),t.applyQuaternion(i),e.copy(n.target).add(t),n.object.lookAt(n.target),!0===n.enableDamping?(h.theta*=1-n.dampingFactor,h.phi*=1-n.dampingFactor):h.set(0,0,0),f=1,E.set(0,0,0),(_||d.distanceToSquared(n.object.position)>m||8*(1-c.dot(n.object.quaternion))>m)&&(n.dispatchEvent(l),d.copy(n.object.position),c.copy(n.object.quaternion),_=!1,!0)}}(),this.dispose=function(){n.domElement.removeEventListener('contextmenu',onContextMenu,!1),n.domElement.removeEventListener('mousedown',onMouseDown,!1),n.domElement.removeEventListener('wheel',onMouseWheel,!1),n.domElement.removeEventListener('touchstart',onTouchStart,!1),n.domElement.removeEventListener('touchend',onTouchEnd,!1),n.domElement.removeEventListener('touchmove',onTouchMove,!1),document.removeEventListener('mousemove',onMouseMove,!1),document.removeEventListener('mouseup',onMouseUp,!1),window.removeEventListener('keydown',onKeyDown,!1)};var n=this,l={type:'change'},d={type:'start'},c={type:'end'},p={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},u=p.NONE,m=1e-6,g=new s.Spherical,h=new s.Spherical,f=1,E=new s.Vector3,_=!1,C=new s.Vector2,y=new s.Vector2,A=new s.Vector2,b=new s.Vector2,x=new s.Vector2,v=new s.Vector2,T=new s.Vector2,S=new s.Vector2,R=new s.Vector2,F=function(){var e=new s.Vector3;return function panLeft(t,n){e.setFromMatrixColumn(n,0),e.multiplyScalar(-t),E.add(e)}}(),w=function(){var e=new s.Vector3;return function panUp(t,n){e.setFromMatrixColumn(n,1),e.multiplyScalar(t),E.add(e)}}(),M=function(){var e=new s.Vector3;return function pan(t,a){var r=n.domElement===document?n.domElement.body:n.domElement;if(n.object instanceof s.PerspectiveCamera){var o=n.object.position;e.copy(o).sub(n.target);var l=e.length();l*=Math.tan(n.object.fov/2*i/180),F(2*t*l/r.clientHeight,n.object.matrix),w(2*a*l/r.clientHeight,n.object.matrix)}else n.object instanceof s.OrthographicCamera?(F(t*(n.object.right-n.object.left)/n.object.zoom/r.clientWidth,n.object.matrix),w(a*(n.object.top-n.object.bottom)/n.object.zoom/r.clientHeight,n.object.matrix)):(console.warn('WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.'),n.enablePan=!1)}}();n.domElement.addEventListener('contextmenu',onContextMenu,!1),n.domElement.addEventListener('mousedown',onMouseDown,!1),n.domElement.addEventListener('wheel',onMouseWheel,!1),n.domElement.addEventListener('touchstart',onTouchStart,!1),n.domElement.addEventListener('touchend',onTouchEnd,!1),n.domElement.addEventListener('touchmove',onTouchMove,!1),window.addEventListener('keydown',onKeyDown,!1),this.update()}var a=Math.min,r=Math.sqrt,o=Math.max,i=Math.PI,s=n(7);OrbitControls.prototype=Object.create(s.EventDispatcher.prototype),OrbitControls.prototype.constructor=OrbitControls,Object.defineProperties(OrbitControls.prototype,{center:{get:function(){return console.warn('THREE.OrbitControls: .center has been renamed to .target'),this.target}},noZoom:{get:function(){return console.warn('THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.'),!this.enableZoom},set:function(e){console.warn('THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.'),this.enableZoom=!e}},noRotate:{get:function(){return console.warn('THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.'),!this.enableRotate},set:function(e){console.warn('THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.'),this.enableRotate=!e}},noPan:{get:function(){return console.warn('THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.'),!this.enablePan},set:function(e){console.warn('THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead.'),this.enablePan=!e}},noKeys:{get:function(){return console.warn('THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.'),!this.enableKeys},set:function(e){console.warn('THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.'),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn('THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.'),!this.enableDamping},set:function(e){console.warn('THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.'),this.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn('THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.'),this.dampingFactor},set:function(e){console.warn('THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.'),this.dampingFactor=e}}}),e.exports=OrbitControls},function(n,e){var d=Number.MAX_VALUE,p=Math.pow,y=Math.round,b=Math.min,x=Math.floor,a=Math.sqrt,T=Math.ceil,S=Math.max,g=Math.abs;!function(a,e){n.exports=e()}(window,function(){return function(a){function n(t){if(e[t])return e[t].exports;var r=e[t]={i:t,l:!1,exports:{}};return a[t].call(r.exports,r,r.exports,n),r.l=!0,r.exports}var e={};return n.m=a,n.c=e,n.d=function(a,e,t){n.o(a,e)||Object.defineProperty(a,e,{configurable:!1,enumerable:!0,get:t})},n.r=function(t){Object.defineProperty(t,'__esModule',{value:!0})},n.n=function(a){var e=a&&a.__esModule?function(){return a.default}:function(){return a};return n.d(e,'a',e),e},n.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},n.p='',n(n.s=12)}([function(t){t.exports=function(){throw new Error('define cannot be used indirect')}},function(y,e,t){function d(r,e){for(var t=0;ti?e:null===n?n=Object.getOwnPropertyDescriptor(e,t):n,s;if('object'==typeof Reflect&&'function'==typeof Reflect.decorate)r=Reflect.decorate(l,e,t,n);else for(var o=l.length-1;0<=o;o--)(s=l[o])&&(r=(3>i?s(r):3s;s++)t.push(e[s]);return(e[8]&d.WebGlConstants.DEPTH_BUFFER_BIT.value)===d.WebGlConstants.DEPTH_BUFFER_BIT.value&&t.push(d.WebGlConstants.DEPTH_BUFFER_BIT.name),(e[8]&d.WebGlConstants.STENCIL_BUFFER_BIT.value)===d.WebGlConstants.STENCIL_BUFFER_BIT.value&&t.push(d.WebGlConstants.STENCIL_BUFFER_BIT.name),(e[8]&d.WebGlConstants.COLOR_BUFFER_BIT.value)===d.WebGlConstants.COLOR_BUFFER_BIT.value&&t.push(d.WebGlConstants.COLOR_BUFFER_BIT.name),t.push(d.WebGlConstants.stringifyWebGlConstant(e[9],'blitFrameBuffer')),t},n=i([d.Decorators.command('blitFrameBuffer')],n)}(e.BaseCommand);e.BlitFrameBuffer=t}(d.Commands||(d.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.stringifyArgs=function(e){var t=[];return t.push(e[0]),t.push(e[1]),t.push(a.WebGlConstants.stringifyWebGlConstant(e[2],'vertexAttribPointer')),t.push(e[3]),t.push(e[4]),t.push(e[5]),t},n=i([a.Decorators.command('vertexAttribPointer')],n)}(e.BaseCommand);e.VertexAttribPointer=t}(a.Commands||(a.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.stringifyResult=function(t){if(t)return'name: '+t.name+', size: '+t.size+', type: '+t.type},n=i([a.Decorators.command('getActiveAttrib')],n)}(e.BaseCommand);e.GetActiveAttrib=t}(a.Commands||(a.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.stringifyResult=function(t){if(t)return'name: '+t.name+', size: '+t.size+', type: '+t.type},n=i([a.Decorators.command('getActiveUniform')],n)}(e.BaseCommand);e.GetActiveUniform=t}(a.Commands||(a.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.stringifyResult=function(t){if(t)return'name: '+t.name+', size: '+t.size+', type: '+t.type},n=i([a.Decorators.command('getTransformFeedbackVarying')],n)}(e.BaseCommand);e.GetTransformFeedbackVarying=t}(a.Commands||(a.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.stringifyResult=function(t){return t?'true':'false'},n=i([a.Decorators.command('getExtension')],n)}(e.BaseCommand);e.GetExtension=t}(a.Commands||(a.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.stringifyResult=function(t){if(t)return'min: '+t.rangeMin+', max: '+t.rangeMax+', precision: '+t.precision},n=i([a.Decorators.command('getShaderPrecisionFormat')],n)}(e.BaseCommand);e.GetShaderPrecisionFormat=t}(a.Commands||(a.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.stringifyResult=function(e){if(!e)return'null';var r=a.WebGlObjects.getWebGlObjectTag(e);return r?r.displayText:e},n=i([a.Decorators.command('getParameter')],n)}(e.BaseCommand);e.GetParameter=t}(a.Commands||(a.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.stringifyArgs=function(e){var t=[];return t.push(a.WebGlConstants.stringifyWebGlConstant(e[0],'drawArrays')),t.push(e[1]),t.push(e[2]),t},n=i([a.Decorators.command('drawArrays')],n)}(e.BaseCommand);e.DrawArrays=t}(a.Commands||(a.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.stringifyArgs=function(e){var t=[];return t.push(a.WebGlConstants.stringifyWebGlConstant(e[0],'drawArraysInstanced')),t.push(e[1]),t.push(e[2]),t.push(e[3]),t},n=i([a.Decorators.command('drawArraysInstanced')],n)}(e.BaseCommand);e.DrawArraysInstanced=t}(a.Commands||(a.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.stringifyArgs=function(e){for(var t=[],n=0;nt;t++)e.push(a[t].toFixed(0));return e},n=i([a.Decorators.command('scissor')],n)}(e.BaseCommand);e.Scissor=t}(a.Commands||(a.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.stringifyArgs=function(a){for(var e=[],t=0;4>t;t++)e.push(a[t].toFixed(0));return e},n=i([a.Decorators.command('viewport')],n)}(e.BaseCommand);e.Viewport=t}(a.Commands||(a.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.stringifyArgs=function(n){var e=[];return e.push(n[0]),e},n=i([a.Decorators.command('disableVertexAttribArray')],n)}(e.BaseCommand);e.DisableVertexAttribArray=t}(a.Commands||(a.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.stringifyArgs=function(n){var e=[];return e.push(n[0]),e},n=i([a.Decorators.command('enableVertexAttribArray')],n)}(e.BaseCommand);e.EnableVertexAttribArray=t}(a.Commands||(a.Commands={}))}(e||(e={})),function(a){!function(e){var t=function(){function t(a,e){this.options=a,this.logger=e,this.objectName=a.objectName,this.createCommandNames=this.getCreateCommandNames(),this.updateCommandNames=this.getUpdateCommandNames(),this.deleteCommandNames=this.getDeleteCommandNames(),this.startTime=this.options.time.now,this.memoryPerSecond={},this.totalMemory=0,this.frameMemory=0,this.capturing=!1,t.initializeByteSizeFormat()}return t.initializeByteSizeFormat=function(){var e;this.byteSizePerInternalFormat||(this.byteSizePerInternalFormat=((e={})[a.WebGlConstants.R8.value]=1,e[a.WebGlConstants.R16F.value]=2,e[a.WebGlConstants.R32F.value]=4,e[a.WebGlConstants.R8UI.value]=1,e[a.WebGlConstants.RG8.value]=2,e[a.WebGlConstants.RG16F.value]=4,e[a.WebGlConstants.RG32F.value]=8,e[a.WebGlConstants.ALPHA.value]=1,e[a.WebGlConstants.RGB.value]=3,e[a.WebGlConstants.RGBA.value]=4,e[a.WebGlConstants.LUMINANCE.value]=1,e[a.WebGlConstants.LUMINANCE_ALPHA.value]=2,e[a.WebGlConstants.DEPTH_COMPONENT.value]=1,e[a.WebGlConstants.DEPTH_STENCIL.value]=2,e[a.WebGlConstants.SRGB_EXT.value]=3,e[a.WebGlConstants.SRGB_ALPHA_EXT.value]=4,e[a.WebGlConstants.RGB8.value]=3,e[a.WebGlConstants.SRGB8.value]=3,e[a.WebGlConstants.RGB565.value]=2,e[a.WebGlConstants.R11F_G11F_B10F.value]=4,e[a.WebGlConstants.RGB9_E5.value]=2,e[a.WebGlConstants.RGB16F.value]=6,e[a.WebGlConstants.RGB32F.value]=12,e[a.WebGlConstants.RGB8UI.value]=3,e[a.WebGlConstants.RGBA8.value]=4,e[a.WebGlConstants.RGB5_A1.value]=2,e[a.WebGlConstants.RGBA16F.value]=8,e[a.WebGlConstants.RGBA32F.value]=16,e[a.WebGlConstants.RGBA8UI.value]=4,e[a.WebGlConstants.COMPRESSED_R11_EAC.value]=4,e[a.WebGlConstants.COMPRESSED_SIGNED_R11_EAC.value]=4,e[a.WebGlConstants.COMPRESSED_RG11_EAC.value]=4,e[a.WebGlConstants.COMPRESSED_SIGNED_RG11_EAC.value]=4,e[a.WebGlConstants.COMPRESSED_RGB8_ETC2.value]=4,e[a.WebGlConstants.COMPRESSED_RGBA8_ETC2_EAC.value]=4,e[a.WebGlConstants.COMPRESSED_SRGB8_ETC2.value]=4,e[a.WebGlConstants.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC.value]=4,e[a.WebGlConstants.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]=4,e[a.WebGlConstants.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2.value]=4,e))},t.prototype.registerCallbacks=function(l){for(var e=0,t=this.createCommandNames;ea.arguments.length)){var e=a.arguments[0];if(e){this.options.toggleCapture(!1);var t=this.delete(e);this.changeMemorySize(-t),this.options.toggleCapture(!0)}}},t.prototype.changeMemorySize=function(a){this.totalMemory+=a,this.capturing&&(this.frameMemory+=a);var e=this.options.time.now-this.startTime,t=y(e/1e3);this.memoryPerSecond[t]=this.totalMemory},t.prototype.getWebGlConstant=function(e){var t=a.WebGlConstantsByValue[e];return t?t.name:e+''},t.prototype.getByteSizeForInternalFormat=function(n){return t.byteSizePerInternalFormat[n]||4},t}();e.BaseRecorder=t}(a.Recorders||(a.Recorders={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.getCreateCommandNames=function(){return['createTexture']},n.prototype.getUpdateCommandNames=function(){return['texImage2D','compressedTexImage2D','texStorage2D']},n.prototype.getDeleteCommandNames=function(){return['deleteTexture']},n.prototype.getBoundInstance=function(e){var t=this.options.context;return e===a.WebGlConstants.TEXTURE_2D.value?t.getParameter(a.WebGlConstants.TEXTURE_BINDING_2D.value):e===a.WebGlConstants.TEXTURE_CUBE_MAP_POSITIVE_X.value||e===a.WebGlConstants.TEXTURE_CUBE_MAP_POSITIVE_Y.value||e===a.WebGlConstants.TEXTURE_CUBE_MAP_POSITIVE_Z.value||e===a.WebGlConstants.TEXTURE_CUBE_MAP_NEGATIVE_X.value||e===a.WebGlConstants.TEXTURE_CUBE_MAP_NEGATIVE_Y.value||e===a.WebGlConstants.TEXTURE_CUBE_MAP_NEGATIVE_Z.value?t.getParameter(a.WebGlConstants.TEXTURE_BINDING_CUBE_MAP.value):void 0},n.prototype.delete=function(e){var t=e.__SPECTOR_Object_CustomData;return t?t.target===a.WebGlConstants.TEXTURE_2D_ARRAY.name||t.target===a.WebGlConstants.TEXTURE_3D.name?0:t.length:0},n.prototype.update=function(a,e,t){if(2<=a.arguments.length&&0!==a.arguments[1])return 0;var n=this.getCustomData(a,e,t);if(!n)return 0;var s=t.__SPECTOR_Object_CustomData?t.__SPECTOR_Object_CustomData.length:0,o='TEXTURE_2D'===e?1:6;return n.length=n.width*n.height*o*this.getByteSizeForInternalFormat(n.internalFormat),t.__SPECTOR_Object_CustomData=n,n.length-s},n.prototype.getCustomData=function(a,e,t){return'texImage2D'===a.name?this.getTexImage2DCustomData(a,e,t):'compressedTexImage2D'===a.name?this.getCompressedTexImage2DCustomData(a,e,t):'texStorage2D'===a.name?this.getTexStorage2DCustomData(a,e,t):void 0},n.prototype.getTexStorage2DCustomData=function(n,e){var a;return 5===n.arguments.length&&(a={target:e,internalFormat:n.arguments[2],width:n.arguments[3],height:n.arguments[4],length:0}),a},n.prototype.getCompressedTexImage2DCustomData=function(n,e){var a;if(0===n.arguments[1])return 7<=n.arguments.length&&(a={target:e,internalFormat:n.arguments[2],width:n.arguments[3],height:n.arguments[4],length:0}),a},n.prototype.getTexImage2DCustomData=function(n,e){var a;if(0===n.arguments[1])return 8<=n.arguments.length?a={target:e,internalFormat:n.arguments[2],width:n.arguments[3],height:n.arguments[4],format:n.arguments[6],type:n.arguments[7],length:0}:6===n.arguments.length&&(a={target:e,internalFormat:n.arguments[2],width:n.arguments[5].width,height:n.arguments[5].height,format:n.arguments[3],type:n.arguments[4],length:0}),a},n=i([a.Decorators.recorder('Texture2d')],n)}(e.BaseRecorder);e.Texture2DRecorder=t}(a.Recorders||(a.Recorders={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.getCreateCommandNames=function(){return['createTexture']},n.prototype.getUpdateCommandNames=function(){return['texImage3D','compressedTexImage3D','texStorage3D']},n.prototype.getDeleteCommandNames=function(){return['deleteTexture']},n.prototype.getBoundInstance=function(e){var t=this.options.context;return e===a.WebGlConstants.TEXTURE_2D_ARRAY.value?t.getParameter(a.WebGlConstants.TEXTURE_BINDING_2D_ARRAY.value):e===a.WebGlConstants.TEXTURE_3D.value?t.getParameter(a.WebGlConstants.TEXTURE_BINDING_3D.value):void 0},n.prototype.delete=function(e){var t=e.__SPECTOR_Object_CustomData;return t?t.target!==a.WebGlConstants.TEXTURE_2D_ARRAY.name&&t.target!==a.WebGlConstants.TEXTURE_3D.name?0:t.length:0},n.prototype.update=function(a,e,t){if(2<=a.arguments.length&&0!==a.arguments[1])return 0;var n=this.getCustomData(a,e,t);if(!n)return 0;var r=t.__SPECTOR_Object_CustomData?t.__SPECTOR_Object_CustomData.length:0;return n.length=n.width*n.height*n.depth*this.getByteSizeForInternalFormat(n.internalFormat),n&&(t.__SPECTOR_Object_CustomData=n),n.length-r},n.prototype.getCustomData=function(a,e,t){return'texImage3D'===a.name?this.getTexImage3DCustomData(a,e,t):'compressedTexImage3D'===a.name?this.getCompressedTexImage3DCustomData(a,e,t):'texStorage3D'===a.name?this.getTexStorage3DCustomData(a,e,t):void 0},n.prototype.getTexStorage3DCustomData=function(n,e){var a;return 6===n.arguments.length&&(a={target:e,internalFormat:n.arguments[2],width:n.arguments[3],height:n.arguments[4],depth:n.arguments[5],length:0}),a},n.prototype.getCompressedTexImage3DCustomData=function(n,e){var a;if(0===n.arguments[1])return 8<=n.arguments.length&&(a={target:e,internalFormat:n.arguments[2],width:n.arguments[3],height:n.arguments[4],depth:n.arguments[5],length:0}),a},n.prototype.getTexImage3DCustomData=function(n,e){var a;if(0===n.arguments[1])return 9<=n.arguments.length&&(a={target:e,internalFormat:n.arguments[2],width:n.arguments[3],height:n.arguments[4],depth:n.arguments[5],format:n.arguments[7],type:n.arguments[8],length:0}),a},n=i([a.Decorators.recorder('Texture3d')],n)}(e.BaseRecorder);e.Texture3DRecorder=t}(a.Recorders||(a.Recorders={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.getCreateCommandNames=function(){return['createBuffer']},n.prototype.getUpdateCommandNames=function(){return['bufferData']},n.prototype.getDeleteCommandNames=function(){return['deleteBuffer']},n.prototype.getBoundInstance=function(e){var t=this.options.context;return e===a.WebGlConstants.ARRAY_BUFFER.value?t.getParameter(a.WebGlConstants.ARRAY_BUFFER_BINDING.value):e===a.WebGlConstants.ELEMENT_ARRAY_BUFFER.value?t.getParameter(a.WebGlConstants.ELEMENT_ARRAY_BUFFER_BINDING.value):e===a.WebGlConstants.COPY_READ_BUFFER.value?t.getParameter(a.WebGlConstants.COPY_READ_BUFFER_BINDING.value):e===a.WebGlConstants.COPY_WRITE_BUFFER.value?t.getParameter(a.WebGlConstants.COPY_WRITE_BUFFER_BINDING.value):e===a.WebGlConstants.TRANSFORM_FEEDBACK_BUFFER.value?t.getParameter(a.WebGlConstants.TRANSFORM_FEEDBACK_BUFFER_BINDING.value):e===a.WebGlConstants.UNIFORM_BUFFER.value?t.getParameter(a.WebGlConstants.UNIFORM_BUFFER_BINDING.value):e===a.WebGlConstants.PIXEL_PACK_BUFFER.value?t.getParameter(a.WebGlConstants.PIXEL_PACK_BUFFER_BINDING.value):e===a.WebGlConstants.PIXEL_UNPACK_BUFFER.value?t.getParameter(a.WebGlConstants.PIXEL_UNPACK_BUFFER_BINDING.value):void 0},n.prototype.delete=function(n){var e=n.__SPECTOR_Object_CustomData;return e?e.length:0},n.prototype.update=function(a,e,t){var n=this.getCustomData(e,a);if(!n)return 0;var r=t.__SPECTOR_Object_CustomData?t.__SPECTOR_Object_CustomData.length:0;return t.__SPECTOR_Object_CustomData=n,n.length-r},n.prototype.getCustomData=function(a,r){var t=this.getLength(r);return 4<=r.arguments.length?{target:a,length:t,usage:r.arguments[2],offset:r.arguments[3],sourceLength:r.arguments[1]?r.arguments[1].length:-1}:3===r.arguments.length?{target:a,length:t,usage:r.arguments[2]}:void 0},n.prototype.getLength=function(a){var e=-1,t=0;return 5===a.arguments.length&&(e=a.arguments[4],t=a.arguments[3]),0>=e&&(e='number'==typeof a.arguments[1]?a.arguments[1]:a.arguments[1]&&(a.arguments[1].byteLength||a.arguments[1].length)||0),e-t},n=i([a.Decorators.recorder('Buffer')],n)}(e.BaseRecorder);e.BufferRecorder=t}(a.Recorders||(a.Recorders={}))}(e||(e={})),function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.getCreateCommandNames=function(){return['createRenderbuffer']},n.prototype.getUpdateCommandNames=function(){return['renderbufferStorage','renderbufferStorageMultisample']},n.prototype.getDeleteCommandNames=function(){return['deleteRenderbuffer']},n.prototype.getBoundInstance=function(e){var t=this.options.context;if(e===a.WebGlConstants.RENDERBUFFER.value)return t.getParameter(a.WebGlConstants.RENDERBUFFER_BINDING.value)},n.prototype.delete=function(n){var e=n.__SPECTOR_Object_CustomData;return e?e.length:0},n.prototype.update=function(a,e,t){var n=this.getCustomData(a,e);if(!n)return 0;var r=t.__SPECTOR_Object_CustomData?t.__SPECTOR_Object_CustomData.length:0;return n.length=n.width*n.height*this.getByteSizeForInternalFormat(n.internalFormat),t.__SPECTOR_Object_CustomData=n,n.length-r},n.prototype.getCustomData=function(n,e){return 4===n.arguments.length?{target:e,internalFormat:n.arguments[1],width:n.arguments[2],height:n.arguments[3],length:0,samples:0}:{target:e,internalFormat:n.arguments[2],width:n.arguments[3],height:n.arguments[4],length:0,samples:n.arguments[1]}},n=i([a.Decorators.recorder('Renderbuffer')],n)}(e.BaseRecorder);e.RenderBufferRecorder=t}(a.Recorders||(a.Recorders={}))}(e||(e={})),function(a){!function(e){var t=function(){function t(n,e){this.options=n,this.logger=e,this.recorders={},this.recorderConstructors={},this.onCommandCallbacks={},this.contextInformation=n.contextInformation,this.time=new n.timeConstructor,this.initAvailableRecorders(),this.initRecorders()}return t.prototype.recordCommand=function(a){var e=this.onCommandCallbacks[a.name];if(e)for(var t=0,n=e;tthis.parameters.length);e++)if(this.parameters[e-1])for(var t=0,n=this.parameters[e-1],i;tthis.parameters.length);e++)for(var t=0,n=this.parameters[e-1];tm?(this.captureCanvas.width=t.captureBaseSize*m,this.captureCanvas.height=t.captureBaseSize):1c?(this.captureCanvas.width=e.VisualState.captureBaseSize*c,this.captureCanvas.height=e.VisualState.captureBaseSize):1n.bottom&&a.scrollIntoView(!1)}},e}();n.ScrollIntoViewHelper=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(a){var e=function(){function e(n,a){this.eventConstructor=n,this.logger=a,this.dummyTextGeneratorElement=document.createElement('div')}return e.prototype.createFromHtml=function(n){var e=document.createElement('div');return e.innerHTML=n,e.firstElementChild},e.prototype.htmlTemplate=function(a){for(var s=this,e=[],t=1;t=l.children.length)l.appendChild(i),this.cachedCurrentDomNode&&40===t&&(this.cachedCurrentDomNode.remove?this.cachedCurrentDomNode.remove():this.cachedCurrentDomNode.parentNode&&this.cachedCurrentDomNode.parentNode.removeChild(this.cachedCurrentDomNode));else{var s=l.children[e];l.insertBefore(i,s),40===t&&l.removeChild(s)}return this.cachedCurrentDomNode=this.domNode,o},e.prototype.removeNode=function(){this.domNode&&this.domNode.parentElement&&(this.domNode.remove?this.domNode.remove():this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode)),this.cachedCurrentDomNode&&this.cachedCurrentDomNode.parentElement&&(this.cachedCurrentDomNode.remove?this.cachedCurrentDomNode.remove():this.cachedCurrentDomNode.parentNode&&this.cachedCurrentDomNode.parentNode.removeChild(this.cachedCurrentDomNode))},e.idGenerator=0,e}();n.ComponentInstance=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(){function e(t){this.logger=t,this.store={},this.idGenerator=0,this.pendingOperation={}}return e.prototype.getLastOperation=function(t){return this.store[t].lastOperation},e.prototype.getData=function(t){return this.store[t].data},e.prototype.getComponentInstance=function(t){return this.store[t].componentInstance},e.prototype.getParentId=function(t){return this.store[t].parent?this.store[t].parent.id:-1},e.prototype.getChildrenIds=function(a){for(var e=[],t=0,n=this.store[a].children,r;t=i.children.length?i.children.push(r):0<=e?i.children.splice(e,0,r):i.children.unshift(r),o},e.prototype.removeChildById=function(a,e){for(var t=this.store[a],n=t.children.length-1;0<=n;n--)if(t.children[n].id===e){this.removeChildAt(a,n);break}},e.prototype.removeChildAt=function(a,e){var t=this.store[a],r;e>t.children.length-1?(r=t.children[t.children.length-1],t.children[t.children.length-1].parent=null,t.children.splice(t.children.length-1,1)):0<=e?(r=t.children[e],t.children[e].parent=null,t.children.splice(e,1)):(r=t.children[0],t.children[0].parent=null,t.children.splice(0,1)),r.parent=null,this.remove(r.id)},e.prototype.remove=function(n){var e=this.store[n];e.parent?(this.store[e.parent.id],this.removeChildById(e.parent.id,n)):(this.removeChildren(n),this.store[n].lastOperation=50,this.pendingOperation[n]=n)},e.prototype.removeChildren=function(n){for(var e=this.store[n];e.children.length;)this.remove(e.children[0].id)},e.prototype.getStatesToProcess=function(){return this.pendingOperation},e.prototype.flushPendingOperations=function(){for(var t in this.pendingOperation)this.pendingOperation[t]&&(50===this.store[t].lastOperation?delete this.store[t]:this.store[t].lastOperation=0);this.pendingOperation={}},e.prototype.getNewId=function(){return++this.idGenerator},e}();n.StateStore=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={}));var c=this&&this.__makeTemplateObject||function(n,e){return Object.defineProperty?Object.defineProperty(n,'raw',{value:e}):n.raw=e,n},e;!function(a){!function(e){var t=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return l(n,e),n.prototype.render=function(e,t){var n=this.htmlTemplate(c(['
                      \\n
                      \\n
                      \\n
                      \\n ','\\n
                      \\n
                      '],['
                      \\n
                      \\n
                      \\n
                      \\n ','\\n
                      \\n
                      ']),e?'active':'',e.logVisible?'active':'',e.logLevel===a.LogLevel.error?'error':'',e.logText);return this.renderElementFromTemplate(n,e,t)},n}(e.BaseComponent);e.CaptureMenuComponent=t}(a.EmbeddedFrontend||(a.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(a){function t(e,r){var n=a.call(this,e,r)||this;return n.onCaptureRequested=n.createEvent('onCaptureRequested'),n.onPlayRequested=n.createEvent('onPlayRequested'),n.onPauseRequested=n.createEvent('onPauseRequested'),n.onPlayNextFrameRequested=n.createEvent('onPlayNextFrameRequested'),n}return l(t,a),t.prototype.render=function(a,e){var t=this.htmlTemplate(c(['\\n
                      \\n
                      \\n
                      \\n $','\\n
                      '],['\\n
                      \\n
                      \\n
                      \\n $','\\n
                      ']),a?'
                      \\n
                      ':'
                      \\n
                      \\n
                      \\n
                      ');return this.renderElementFromTemplate(t,a,e)},t}(n.BaseComponent);n.CaptureMenuActionsComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(a){function t(e,r){var n=a.call(this,e,r)||this;return n.onCanvasSelection=n.createEvent('onCanvasSelection'),n}return l(t,a),t.prototype.render=function(a,e){var t=this.htmlTemplate(c(['\\n
                      \\n \\n ','\\n \\n
                        \\n
                        '],['\\n
                        \\n \\n ','\\n \\n
                          \\n
                          ']),a.currentCanvasInformation?a.currentCanvasInformation.id+' ('+a.currentCanvasInformation.width+'*'+a.currentCanvasInformation.height+')':'Choose Canvas...',a.showList?'display:block;visibility:visible':'display:none;visibility:hidden');return this.renderElementFromTemplate(t,a,e)},t}(n.BaseComponent);n.CanvasListComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(a){function t(e,r){var n=a.call(this,e,r)||this;return n.onCanvasSelected=n.createEvent('onCanvasSelected'),n}return l(t,a),t.prototype.render=function(a,e){var t=document.createElement('li'),n=document.createElement('span');return n.innerText='Id: '+a.id+' - Size: '+a.width+'*'+a.height,t.appendChild(n),this.mapEventListener(t,'click','onCanvasSelected',a,e),t},t}(n.BaseComponent);n.CanvasListItemComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return l(t,n),t.prototype.render=function(t){var e=document.createElement('span');return e.className='fpsCounterComponent',e.innerText=t.toFixed(2)+' Fps',e},t}(n.BaseComponent);n.FpsCounterComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(d){!function(e){var t=function(){function n(t,a){var o=this;this.options=t,this.logger=a,this.rootPlaceHolder=t.rootPlaceHolder||document.body,this.mvx=new e.MVX(this.rootPlaceHolder,a),this.isTrackingCanvas=!1,this.onCanvasSelected=new t.eventConstructor,this.onCaptureRequested=new t.eventConstructor,this.onPauseRequested=new t.eventConstructor,this.onPlayRequested=new t.eventConstructor,this.onPlayNextFrameRequested=new t.eventConstructor,this.captureMenuComponent=new e.CaptureMenuComponent(t.eventConstructor,a),this.canvasListComponent=new e.CanvasListComponent(t.eventConstructor,a),this.canvasListItemComponent=new e.CanvasListItemComponent(this.options.eventConstructor,this.logger),this.actionsComponent=new e.CaptureMenuActionsComponent(t.eventConstructor,a),this.fpsCounterComponent=new e.FpsCounterComponent(t.eventConstructor,a),this.rootStateId=this.mvx.addRootState({visible:!0,logLevel:d.LogLevel.info,logText:n.SelectCanvasHelpText,logVisible:!this.options.hideLog},this.captureMenuComponent),this.canvasListStateId=this.mvx.addChildState(this.rootStateId,{currentCanvasInformation:null,showList:!1},this.canvasListComponent),this.actionsStateId=this.mvx.addChildState(this.rootStateId,!0,this.actionsComponent),this.fpsStateId=this.mvx.addChildState(this.rootStateId,0,this.fpsCounterComponent),this.actionsComponent.onCaptureRequested.add(function(){var e=o.getSelectedCanvasInformation();e&&o.updateMenuStateLog(d.LogLevel.info,n.PleaseWaitHelpText,!0),setTimeout(function(){o.onCaptureRequested.trigger(e)},200)}),this.actionsComponent.onPauseRequested.add(function(){o.onPauseRequested.trigger(o.getSelectedCanvasInformation()),o.mvx.updateState(o.actionsStateId,!1)}),this.actionsComponent.onPlayRequested.add(function(){o.onPlayRequested.trigger(o.getSelectedCanvasInformation()),o.mvx.updateState(o.actionsStateId,!0)}),this.actionsComponent.onPlayNextFrameRequested.add(function(){o.onPlayNextFrameRequested.trigger(o.getSelectedCanvasInformation())}),this.canvasListComponent.onCanvasSelection.add(function(e){o.mvx.updateState(o.canvasListStateId,{currentCanvasInformation:null,showList:!e.state.showList}),o.updateMenuStateLog(d.LogLevel.info,n.SelectCanvasHelpText),o.onCanvasSelected.trigger(null),o.isTrackingCanvas&&o.trackPageCanvases(),e.state.showList?o.showMenuStateLog():o.hideMenuStateLog()}),this.canvasListItemComponent.onCanvasSelected.add(function(e){o.mvx.updateState(o.canvasListStateId,{currentCanvasInformation:e.state,showList:!1}),o.onCanvasSelected.trigger(e.state),o.updateMenuStateLog(d.LogLevel.info,n.ActionsHelpText),o.showMenuStateLog()})}return n.prototype.getSelectedCanvasInformation=function(){return this.mvx.getGenericState(this.canvasListStateId).currentCanvasInformation},n.prototype.trackPageCanvases=function(){if(this.isTrackingCanvas=!0,document.body){var t=document.body.querySelectorAll('canvas');this.updateCanvasesList(t)}},n.prototype.updateCanvasesList=function(t){this.updateCanvasesListInformationInternal(t,function(t){return{id:t.id,width:t.width,height:t.height,ref:t}})},n.prototype.updateCanvasesListInformation=function(t){this.updateCanvasesListInformationInternal(t,function(t){return{id:t.id,width:t.width,height:t.height,ref:t.ref}})},n.prototype.display=function(){this.updateMenuStateVisibility(!0)},n.prototype.hide=function(){this.updateMenuStateVisibility(!1)},n.prototype.captureComplete=function(e){e?this.updateMenuStateLog(d.LogLevel.error,e):this.updateMenuStateLog(d.LogLevel.info,n.ActionsHelpText)},n.prototype.setFPS=function(t){this.mvx.updateState(this.fpsStateId,t)},n.prototype.updateCanvasesListInformationInternal=function(e,t){this.mvx.removeChildrenStates(this.canvasListStateId);for(var i=[],o=0,r;o\\n
                          \\n Drag files here to open a previously saved capture.\\n
                          \\n
                            \\n '],['\\n
                            \\n
                            \\n Drag files here to open a previously saved capture.\\n
                            \\n
                              \\n
                              ']),a?'active':''),i=this.renderElementFromTemplate(n,a,e),o=i.querySelector('.openCaptureFile');return o.addEventListener('dragenter',function(n){return t.drag(n),!1},!1),o.addEventListener('dragover',function(n){return t.drag(n),!1},!1),o.addEventListener('drop',function(n){t.drop(n)},!1),i},t.prototype.drag=function(t){t.stopPropagation(),t.preventDefault()},t.prototype.drop=function(t){t.stopPropagation(),t.preventDefault(),this.loadFiles(t)},t.prototype.loadFiles=function(a){var r=this,t=null;if(a&&a.dataTransfer&&a.dataTransfer.files&&(t=a.dataTransfer.files),a&&a.target&&a.target.files&&(t=a.target.files),t&&0\\n
                                \\n '],['\\n
                                \\n
                                  \\n
                                  ']));return this.renderElementFromTemplate(t,a,e)},t}(n.BaseComponent);n.VisualStateListComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(a){function n(t,e){var r=a.call(this,t,e)||this;return r.onVisualStateSelected=r.createEvent('onVisualStateSelected'),r}return l(n,a),n.prototype.render=function(e,t){var p=document.createElement('li');if(e.active&&(p.className='active',setTimeout(function(){n.ScrollIntoViewHelper.scrollIntoView(p)},1)),e.VisualState.Attachments){for(var i=0,o=e.VisualState.Attachments,r;i\\n
                                    \\n '],['\\n
                                    \\n
                                      \\n
                                      ']));return this.renderElementFromTemplate(t,a,e)},t}(n.BaseComponent);n.CommandListComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(a){function n(t,e){var r=a.call(this,t,e)||this;return r.onCommandSelected=r.createEvent('onCommandSelected'),r.onVertexSelected=r.createEvent('onVertexSelected'),r.onFragmentSelected=r.createEvent('onFragmentSelected'),r}return l(n,a),n.prototype.render=function(e,t){var d=document.createElement('li'),i='unknown';switch(e.capture.status){case 50:i='deprecated';break;case 10:i='unused';break;case 20:i='disabled';break;case 30:i='redundant';break;case 40:i='valid';}if(e.capture.VisualState&&(d.className=' drawCall'),e.active&&(d.className=' active',setTimeout(function(){n.ScrollIntoViewHelper.scrollIntoView(d)},1)),e.capture.marker){var o=document.createElement('span');o.className=i+' marker important',o.innerText=e.capture.marker+' ',o.style.fontWeight='1000',d.appendChild(o)}var r=document.createElement('span'),s=e.capture.text;if(s=s.replace(e.capture.name,''+e.capture.name+''),r.innerHTML=s,d.appendChild(r),e.capture.VisualState&&'clear'!==e.capture.name)try{var a=e.capture.DrawCall.shaders[0],l=e.capture.DrawCall.shaders[1],c=document.createElement('a');c.innerText=a.name,c.href='#',d.appendChild(c),this.mapEventListener(c,'click','onVertexSelected',e,t);var p=document.createElement('a');p.innerText=l.name,p.href='#',d.appendChild(p),this.mapEventListener(p,'click','onFragmentSelected',e,t)}catch(t){}return this.mapEventListener(d,'click','onCommandSelected',e,t),d},n}(n.BaseComponent);n.CommandListItemComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return l(t,n),t.prototype.render=function(a,e){var t=this.htmlTemplate(c(['\\n
                                      \\n
                                      '],['\\n
                                      \\n
                                      ']));return this.renderElementFromTemplate(t,a,e)},t}(n.BaseComponent);n.CommandDetailComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(){function e(){}return e.getMDNLink=function(a){var t=e.WebGL2Functions[a];if(t)return e.WebGL2RootUrl+t;var n=e.WebGLFunctions[a];return n?e.WebGLRootUrl+n:e.WebGLRootUrl+a},e.WebGL2RootUrl='https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/',e.WebGLRootUrl='https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/',e.WebGL2Functions={beginQuery:'beginQuery',beginTransformFeedback:'beginTransformFeedback',bindBufferBase:'bindBufferBase',bindBufferRange:'bindBufferRange',bindSampler:'bindSampler',bindTransformFeedback:'bindTransformFeedback',bindVertexArray:'bindVertexArray',blitFramebuffer:'blitFramebuffer',clearBufferfv:'clearBuffer',clearBufferiv:'clearBuffer',clearBufferuiv:'clearBuffer',clearBufferfi:'clearBuffer',clientWaitSync:'clientWaitSync',compressedTexImage3D:'compressedTexImage3D',compressedTexSubImage3D:'compressedTexSubImage3D',copyBufferSubData:'copyBufferSubData',copyTexSubImage3D:'copyTexSubImage3D',createQuery:'createQuery',createSampler:'createSampler',createTransformFeedback:'createTransformFeedback',createVertexArray:'createVertexArray',deleteQuery:'deleteQuery',deleteSampler:'deleteSampler',deleteSync:'deleteSync',deleteTransformFeedback:'deleteTransformFeedback',deleteVertexArray:'deleteVertexArray',drawArraysInstanced:'drawArraysInstanced',drawBuffers:'drawBuffers',drawElementsInstanced:'drawElementsInstanced',drawRangeElements:'drawRangeElements',endQuery:'endQuery',endTransformFeedback:'endTransformFeedback',fenceSync:'fenceSync',framebufferTextureLayer:'framebufferTextureLayer',getActiveUniformBlockName:'getActiveUniformBlockName',getActiveUniformBlockParameter:'getActiveUniformBlockParameter',getActiveUniforms:'getActiveUniforms',getBufferSubData:'getBufferSubData',getFragDataLocation:'getFragDataLocation',getIndexedParameter:'getIndexedParameter',getInternalformatParameter:'getInternalformatParameter',getQuery:'getQuery',getQueryParameter:'getQueryParameter',getSamplerParameter:'getSamplerParameter',getSyncParameter:'getSyncParameter',getTransformFeedbackVarying:'getTransformFeedbackVarying',getUniformBlockIndex:'getUniformBlockIndex',getUniformIndices:'getUniformIndices',invalidateFramebuffer:'invalidateFramebuffer',invalidateSubFramebuffer:'invalidateSubFramebuffer',isQuery:'isQuery',isSampler:'isSampler',isSync:'isSync',isTransformFeedback:'isTransformFeedback',isVertexArray:'isVertexArray',pauseTransformFeedback:'pauseTransformFeedback',readBuffer:'readBuffer',renderbufferStorageMultisample:'renderbufferStorageMultisample',resumeTransformFeedback:'resumeTransformFeedback',samplerParameteri:'samplerParameter',samplerParameterf:'samplerParameter',texImage3D:'texImage3D',texStorage2D:'texStorage2D',texStorage3D:'texStorage3D',texSubImage3D:'texSubImage3D',transformFeedbackVaryings:'transformFeedbackVaryings',uniform1ui:'uniform',uniform2ui:'uniform',uniform3ui:'uniform',uniform4ui:'uniform',uniform1fv:'uniform',uniform2fv:'uniform',uniform3fv:'uniform',uniform4fv:'uniform',uniform1iv:'uniform',uniform2iv:'uniform',uniform3iv:'uniform',uniform4iv:'uniform',uniform1uiv:'uniform',uniform2uiv:'uniform',uniform3uiv:'uniform',uniform4uiv:'uniform',uniformBlockBinding:'uniformBlockBinding',uniformMatrix2fv:'uniformMatrix',uniformMatrix3x2fv:'uniformMatrix',uniformMatrix4x2fv:'uniformMatrix',uniformMatrix2x3fv:'uniformMatrix',uniformMatrix3fv:'uniformMatrix',uniformMatrix4x3fv:'uniformMatrix',uniformMatrix2x4fv:'uniformMatrix',uniformMatrix3x4fv:'uniformMatrix',uniformMatrix4fv:'uniformMatrix',vertexAttribDivisor:'vertexAttribDivisor',vertexAttribI4i:'vertexAttribI',vertexAttribI4ui:'vertexAttribI',vertexAttribI4iv:'vertexAttribI',vertexAttribI4uiv:'vertexAttribI',vertexAttribIPointer:'vertexAttribIPointer',waitSync:'waitSync'},e.WebGLFunctions={uniform1f:'uniform',uniform1fv:'uniform',uniform1i:'uniform',uniform1iv:'uniform',uniform2f:'uniform',uniform2fv:'uniform',uniform2i:'uniform',uniform2iv:'uniform',uniform3f:'uniform',uniform3i:'uniform',uniform3iv:'uniform',uniform4f:'uniform',uniform4fv:'uniform',uniform4i:'uniform',uniform4iv:'uniform',uniformMatrix2fv:'uniformMatrix',uniformMatrix3fv:'uniformMatrix',uniformMatrix4fv:'uniformMatrix',vertexAttrib1f:'vertexAttrib',vertexAttrib2f:'vertexAttrib',vertexAttrib3f:'vertexAttrib',vertexAttrib4f:'vertexAttrib',vertexAttrib1fv:'vertexAttrib',vertexAttrib2fv:'vertexAttrib',vertexAttrib3fv:'vertexAttrib',vertexAttrib4fv:'vertexAttrib'},e}();n.MDNCommandLinkHelper=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return l(t,n),t.prototype.render=function(a,e){var t=this.htmlTemplate(c(['\\n
                                      \\n
                                      '],['\\n
                                      \\n
                                      ']));return this.renderElementFromTemplate(t,a,e)},t}(n.BaseComponent);n.JSONContentComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return l(t,n),t.prototype.render=function(a,e){var t=this.htmlTemplate(c(['\\n
                                      \\n
                                      ','
                                      \\n
                                        \\n
                                        '],['\\n
                                        \\n
                                        ','
                                        \\n
                                          \\n
                                          ']),a?a.replace(/([A-Z])/g,' $1').trim():'');return this.renderElementFromTemplate(t,a,e)},t}(n.BaseComponent);n.JSONGroupComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return l(t,n),t.prototype.render=function(a,e){var t=this.htmlTemplate(c(['\\n
                                        • ',': ','
                                        • '],['\\n
                                        • ',': ','
                                        • ']),a.key,a.value);return this.renderElementFromTemplate(t,a,e)},t}(n.BaseComponent);n.JSONItemComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return l(t,n),t.prototype.render=function(a,e){var t=this.htmlTemplate(c(['\\n
                                        • ','
                                        • '],['\\n
                                        • ','
                                        • ']),a.value,a.key);return this.renderElementFromTemplate(t,a,e)},t}(n.BaseComponent);n.JSONImageItemComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(a){function t(e,r){var n=a.call(this,e,r)||this;return n.onOpenSourceClicked=n.createEvent('onOpenSourceClicked'),n}return l(t,a),t.prototype.render=function(a,e){var t=this.htmlTemplate(c(['\\n
                                        • ',': Click to Open.
                                        • '],['\\n
                                        • ',': Click to Open.
                                        • ']),a.key);return this.renderElementFromTemplate(t,a,e)},t}(n.BaseComponent);n.JSONSourceItemComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return l(t,n),t.prototype.render=function(a,e){var t=this.htmlTemplate(c(['\\n
                                        • ',': \\n ',' (Open help page)\\n \\n
                                        • '],['\\n
                                        • ',': \\n ',' (Open help page)\\n \\n
                                        • ']),a.key,a.value,a.help);return this.renderElementFromTemplate(t,a,e)},t}(n.BaseComponent);n.JSONHelpItemComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(n){function t(){return null!==n&&n.apply(this,arguments)||this}return l(t,n),t.prototype.render=function(t){var e=document.createElement('div');if(e.className='jsonVisualStateItemComponent',t.Attachments){for(var n=0,i=t.Attachments,o;n\\n
                                        • Menu
                                        • \\n\\n
                                        • \\n \\n X\\n
                                        • \\n
                                        • Captures
                                        • \\n
                                        • Information
                                        • \\n
                                        • Init State
                                        • \\n
                                        • \\n \\n Commands','\\n \\n
                                        • \\n
                                        • End State
                                        • \\n
                                        • Close
                                        • \\n '],['']),a.searchText,0===a.status?'active':'',10===a.status?'active':'',20===a.status?'active':'',40===a.status?'active':'',0',n,e)},t}(n.BaseComponent);n.ResultViewContentComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(a){function t(e,r){return a.call(this,e,r)||this}return l(t,a),t.prototype.render=function(a,e){var t=this.htmlTemplate(c(['\\n
                                          '],['\\n
                                          ']),a?'informationColumnLeftComponent':'informationColumnRightComponent');return this.renderElementFromTemplate(t,a,e)},t}(n.BaseComponent);n.InformationColumnComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(a){function t(e,r){return a.call(this,e,r)||this}return l(t,a),t.prototype.render=function(a,e){var t=this.htmlTemplate(c(['\\n
                                          \\n
                                          '],['\\n
                                          \\n
                                          ']),a?'active':'');return this.renderElementFromTemplate(t,a,e)},t}(n.BaseComponent);n.ResultViewComponent=e}(t.EmbeddedFrontend||(t.EmbeddedFrontend={}))}(e||(e={})),function(t){!function(n){var e=function(a){function t(e,r){var n=a.call(this,e,r)||this;return n.onVertexSourceClicked=n.createEvent('onVertexSourceClicked'),n.onFragmentSourceClicked=n.createEvent('onFragmentSourceClicked'),n.onSourceCodeCloseClicked=n.createEvent('onSourceCodeCloseClicked'),n.onSourceCodeChanged=n.createEvent('onSourceCodeChanged'),n}return l(t,a),t.prototype.showError=function(a){if(this.editor){var e=[];if(a=a||'')for(var t=/^.*ERROR:\\W([0-9]+):([0-9]+):(.*)$/gm,n=t.exec(a);null!=n;)e.push({row:+n[2]-1,column:n[1],text:n[3]||'Error',type:'error'}),n=t.exec(a);this.editor.getSession().setAnnotations(e)}},t.prototype.render=function(s,e){var t=this,n=s.fragment?s.sourceFragment:s.sourceVertex,i=n?this._indentIfdef(this._beautify(n)):'',o=this.htmlTemplate(c(['\\n
                                          \\n
                                          \\n \\n
                                          \\n $','\\n
                                          '],['\\n
                                          \\n
                                          \\n \\n
                                          \\n $','\\n
                                          ']),s.fragment?'':'active',s.fragment?'active':'',s.editable?this.htmlTemplate(c(['
                                          ','
                                          '],['
                                          ','
                                          ']),i):this.htmlTemplate(c(['
                                          \\n
                                          ','
                                          \\n
                                          '],['
                                          \\n
                                          ','
                                          \\n
                                          ']),i)),r=this.renderElementFromTemplate(o.replace(/
                                          /g,'\\n'),s,e);if(s.editable){this.editor=ace.edit(r.querySelector('.sourceCodeComponentEditable')),this.editor.setTheme('ace/theme/monokai'),this.editor.getSession().setMode('ace/mode/glsl'),this.editor.setShowPrintMargin(!1);var a=-1;this.editor.getSession().on('change',function(){-1!=a&&clearTimeout(a),a=setTimeout(function(){t._triggerCompilation(t.editor,s,r,e)},1500)})}else Prism.highlightElement(r.querySelector('pre'));return r},t.prototype._triggerCompilation=function(a,e,t,n){e.fragment?e.sourceFragment=a.getValue():e.sourceVertex=a.getValue(),this.triggerEvent('onSourceCodeChanged',t,e,n)},t.prototype._beautify=function(p,e){void 0===e&&(e=0),p=p.trim(),p=this._removeReturnInComments(p);for(var n=this._getBracket(p),o=n.firstIteration,r=n.lastIteration,s='',a=0,l;a<\\s]*=)\\s*/g,function(t){return' '+t.trim()+' '})).replace(/\\s*(,)\\s*/g,function(t){return t.trim()+' '})).replace(/\\n[ \\t]+/g,'\\n')).replace(/\\n/g,'\\n'+s)).replace(/\\s+$/g,'')).replace(/\\n+$/g,'');else{var i=p.substr(0,o),c=p.substr(r+1,p.length),u=p.substr(o+1,r-o-1).trim(),m=this._beautify(u,e+1);l=(l=(l=this._beautify(i,e)+' {\\n'+m+'\\n'+s+'}\\n'+this._beautify(c,e)).replace(/\\s*\\n+\\s*;/g,';')).replace(/#endif[\\t \\f\\v]*{/g,'\\n {')}return l=l.replace(t.semicolonReplacementKey,';')},t.prototype._removeReturnInComments=function(a){for(var e=!1,n=!1,i=0,o;it.previousCommandStateId||this.selectCommand(t.previousCommandStateId)},t.prototype.selectNextCommand=function(){var t=this.mvx.getGenericState(this.currentCommandStateId);0>t.nextCommandStateId||this.selectCommand(t.nextCommandStateId)},t.prototype.selectPreviousVisualState=function(){var t=this.mvx.getGenericState(this.currentVisualStateId);0>t.previousVisualStateId||this.selectVisualState(t.previousVisualStateId)},t.prototype.selectNextVisualState=function(){var t=this.mvx.getGenericState(this.currentVisualStateId);0>t.nextVisualStateId||this.selectVisualState(t.nextVisualStateId)},t.prototype.initMenuComponent=function(){var n=this;this.mvx.updateState(this.menuStateId,{status:0,searchText:this.searchText,commandCount:0}),this.resultViewMenuComponent.onCloseClicked.add(function(){n.hide()}),this.resultViewMenuComponent.onCapturesClicked.add(function(){n.displayCaptures()}),this.resultViewMenuComponent.onCommandsClicked.add(function(){n.displayCurrentCapture()}),this.resultViewMenuComponent.onInformationClicked.add(function(){n.displayInformation()}),this.resultViewMenuComponent.onInitStateClicked.add(function(){n.displayInitState()}),this.resultViewMenuComponent.onEndStateClicked.add(function(){n.displayEndState()}),this.resultViewMenuComponent.onSearchTextChanged.add(function(e){n.search(e.sender.value)}),this.resultViewMenuComponent.onSearchTextCleared.add(function(e){n.mvx.updateState(n.menuStateId,{status:e.state.status,searchText:'',commandCount:e.state.commandCount}),n.search('')})},t.prototype.onCaptureRelatedAction=function(n){var a=this.mvx.getGenericState(this.currentCaptureStateId);return this.commandCount=a.capture.commands.length,this.mvx.removeChildrenStates(this.contentStateId),this.mvx.updateState(this.menuStateId,{status:n,searchText:this.searchText,commandCount:this.commandCount}),this.mvx.getGenericState(this.captureListStateId)&&this.mvx.updateState(this.captureListStateId,!1),a.capture},t.prototype.displayCaptures=function(){this.mvx.updateState(this.menuStateId,{status:0,searchText:this.searchText,commandCount:this.commandCount}),this.mvx.updateState(this.captureListStateId,!0)},t.prototype.displayInformation=function(){var l=this.onCaptureRelatedAction(10),e=this.mvx.addChildState(this.contentStateId,!0,this.informationColumnComponent),t=this.mvx.addChildState(this.contentStateId,!1,this.informationColumnComponent),n=this.mvx.addChildState(e,null,this.jsonContentComponent);this.displayJSONGroup(n,'Canvas',l.canvas),this.displayJSONGroup(n,'Context',l.context);for(var i=this.mvx.addChildState(t,null,this.jsonContentComponent),o=0,r=l.analyses,s;ou.index&&this.lastIndex--}return u},c||(RegExp.prototype.test=function(n){var e=d.exec.call(this,n);return e&&this.global&&!e[0].length&&this.lastIndex>e.index&&this.lastIndex--,!!e}))}),ace.define('ace/lib/es5-shim',['require','exports','module'],function(){function i(){}function v(t){try{return Object.defineProperty(t,'sentinel',{}),'sentinel'in t}catch(t){}}function D(t){return(t=+t)==t?0!==t&&t!==1/0&&t!==-1/0&&(t=(0>>0;if('[object Function]'!=d(a))throw new TypeError;for(;++i>>0,i=Array(n),o=arguments[1];if('[object Function]'!=d(a))throw new TypeError(a+' is not a function');for(var r=0;r>>0,o=[],r=arguments[1],s;if('[object Function]'!=d(l))throw new TypeError(l+' is not a function');for(var t=0;t>>0,i=arguments[1];if('[object Function]'!=d(a))throw new TypeError(a+' is not a function');for(var o=0;o>>0,i=arguments[1];if('[object Function]'!=d(a))throw new TypeError(a+' is not a function');for(var o=0;o>>0;if('[object Function]'!=d(a))throw new TypeError(a+' is not a function');if(!n&&1==arguments.length)throw new TypeError('reduce of empty array with no initial value');var s=0,r;if(2<=arguments.length)r=arguments[1];else for(;;){if(s in t){r=t[s++];break}if(++s>=n)throw new TypeError('reduce of empty array with no initial value')}for(;s>>0;if('[object Function]'!=d(a))throw new TypeError(a+' is not a function');if(!n&&1==arguments.length)throw new TypeError('reduceRight of empty array with no initial value');var s=n-1,r;if(2<=arguments.length)r=arguments[1];else for(;;){if(s in t){r=t[s--];break}if(0>--s)throw new TypeError('reduceRight of empty array with no initial value')}do s in this&&(r=a.call(void 0,r,t[s],s,e));while(s--);return r}),Array.prototype.indexOf&&-1==[0,1].indexOf(1,2)||(Array.prototype.indexOf=function(a){var e=f&&'[object String]'==d(this)?this.split(''):O(this),t=e.length>>>0;if(!t)return-1;var r=0;for(1>>0;if(!t)return-1;var r=t-1;for(1e.isIE,e.isGecko=e.isMozilla=(window.Controllers||window.controllers)&&'Gecko'===window.navigator.product,e.isOldGecko=e.isGecko&&4>parseInt((a.match(/rv:(\\d+)/)||[])[1],10),e.isOpera=window.opera&&'[object Opera]'==Object.prototype.toString.call(window.opera),e.isWebKit=parseFloat(a.split('WebKit/')[1])||void 0,e.isChrome=parseFloat(a.split(' Chrome/')[1])||void 0,e.isAIR=0<=a.indexOf('AdobeAIR'),e.isIPad=0<=a.indexOf('iPad'),e.isChromeOS=0<=a.indexOf(' CrOS '),e.isIOS=/iPad|iPhone|iPod/.test(a)&&!window.MSStream,e.isIOS&&(e.isMac=!0)}}),ace.define('ace/lib/event',['require','exports','module','ace/lib/keys','ace/lib/useragent'],function(n,p){'use strict';function l(a,i,t){var s=r(i);if(!m.isMac&&o){if(i.getModifierState&&(i.getModifierState('OS')||i.getModifierState('Win'))&&(s|=8),o.altGr){if(3==(3&s))return;o.altGr=0}if(18===t||17===t){var p='location'in i?i.location:i.keyLocation;17===t&&1===p?1==o[t]&&(e=i.timeStamp):18===t&&3===s&&2===p&&50>i.timeStamp-e&&(o.altGr=!0)}}if(!((t in d.MODIFIER_KEYS&&(t=-1),8&s&&91<=t&&93>=t&&(t=-1),!s&&13===t)&&3===(p='location'in i?i.location:i.keyLocation)&&(a(i,s,-t),i.defaultPrevented))){if(m.isChromeOS&&8&s){if(a(i,s,t),i.defaultPrevented)return;s&=-9}return!!(s||t in d.FUNCTION_KEYS||t in d.PRINTABLE_KEYS)&&a(i,s,t)}}function c(){o=Object.create(null)}var d=n('./keys'),m=n('./useragent'),o=null,e=0;p.addListener=function(a,e,t){if(a.addEventListener)return a.addEventListener(e,t,!1);if(a.attachEvent){var n=function(){t.call(a,window.event)};t._wrapper=n,a.attachEvent('on'+e,n)}},p.removeListener=function(a,e,t){return a.removeEventListener?a.removeEventListener(e,t,!1):void(a.detachEvent&&a.detachEvent('on'+e,t._wrapper||t))},p.stopEvent=function(t){return p.stopPropagation(t),p.preventDefault(t),!1},p.stopPropagation=function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},p.preventDefault=function(t){t.preventDefault?t.preventDefault():t.returnValue=!1},p.getButton=function(t){return'dblclick'==t.type?0:'contextmenu'==t.type||m.isMac&&t.ctrlKey&&!t.altKey&&!t.shiftKey?2:t.preventDefault?t.button:{1:0,2:2,4:1}[t.button]},p.capture=function(t,a,n){function o(t){a&&a(t),n&&n(t),p.removeListener(document,'mousemove',a,!0),p.removeListener(document,'mouseup',o,!0),p.removeListener(document,'dragstart',o,!0)}return p.addListener(document,'mousemove',a,!0),p.addListener(document,'mouseup',o,!0),p.addListener(document,'dragstart',o,!0),o},p.addTouchMoveListener=function(t,a){var n,r;'ontouchmove'in t&&(p.addListener(t,'touchstart',function(a){var e=a.changedTouches[0];n=e.clientX,r=e.clientY}),p.addListener(t,'touchmove',function(o){var e=o.changedTouches[0];o.wheelX=-(e.clientX-n)/1,o.wheelY=-(e.clientY-r)/1,n=e.clientX,r=e.clientY,a(o)}))},p.addMouseWheelListener=function(t,a){'onmousewheel'in t?p.addListener(t,'mousewheel',function(t){void 0===t.wheelDeltaX?(t.wheelX=0,t.wheelY=-t.wheelDelta/8):(t.wheelX=-t.wheelDeltaX/8,t.wheelY=-t.wheelDeltaY/8),a(t)}):'onwheel'in t?p.addListener(t,'wheel',function(t){switch(t.deltaMode){case t.DOM_DELTA_PIXEL:t.wheelX=.35*t.deltaX||0,t.wheelY=.35*t.deltaY||0;break;case t.DOM_DELTA_LINE:case t.DOM_DELTA_PAGE:t.wheelX=5*(t.deltaX||0),t.wheelY=5*(t.deltaY||0);}a(t)}):p.addListener(t,'DOMMouseScroll',function(t){t.axis&&t.axis==t.HORIZONTAL_AXIS?(t.wheelX=5*(t.detail||0),t.wheelY=0):(t.wheelX=0,t.wheelY=5*(t.detail||0)),a(t)})},p.addMultiMouseDownListener=function(t,o,n,i){function h(t){if(0===p.getButton(t)?1>=1)&&(a+=a);return t};var t=/^\\s\\s*/,a=/\\s\\s*$/;e.stringTrimLeft=function(n){return n.replace(t,'')},e.stringTrimRight=function(t){return t.replace(a,'')},e.copyObject=function(a){var e={};for(var t in a)e[t]=a[t];return e},e.copyArray=function(a){for(var e=[],t=0,n=a.length;tU.isChrome,d=U.isIE;e.TextInput=function(i,G){function _(n){if(!p){if(p=!0,v)e=0,t=n?0:W.value.length-1;else var e=4,t=5;try{W.setSelectionRange(e,t)}catch(t){}p=!1}}function F(){p||(W.value=n,U.isWebKit&&A.schedule())}function I(){clearTimeout(L),L=setTimeout(function(){H&&(W.style.cssText=H,H=''),null==G.renderer.$keepTextAreaAtCursor&&(G.renderer.$keepTextAreaAtCursor=!0,G.renderer.$moveTextAreaToCursor())},0)}var W=o.createElement('textarea');W.className=U.isIOS?'ace_text-input ace_text-input-ios':'ace_text-input',U.isTouchPad&&W.setAttribute('x-palm-disable-auto-cap',!0),W.setAttribute('wrap','off'),W.setAttribute('autocorrect','off'),W.setAttribute('autocapitalize','off'),W.setAttribute('spellcheck',!1),W.style.opacity='0',i.insertBefore(W,i.firstChild);var n='\\n aaaa a\\n',u=!1,h=!1,m=!1,p=!1,H='',e=!0;try{var g=document.activeElement===W}catch(t){}P.addListener(W,'blur',function(t){G.onBlur(t),g=!1}),P.addListener(W,'focus',function(t){g=!0,G.onFocus(t),_()}),this.focus=function(){return H?W.focus():void(W.style.position='fixed',W.focus())},this.blur=function(){W.blur()},this.isFocused=function(){return g};var E=r.delayedCall(function(){g&&_(e)}),A=r.delayedCall(function(){p||(W.value=n,g&&_())});U.isWebKit||G.addEventListener('changeSelection',function(){G.selection.isEmpty()!=e&&(e=!e,E.schedule())}),F(),g&&G.onFocus();var v=null;this.setInputHandler=function(t){v=t},this.getInputHandler=function(){return v};var V=!1,S=function(t){4===W.selectionStart&&5===W.selectionEnd||(v&&(t=v(t),v=null),m?(_(),t&&G.onPaste(t),m=!1):t==n.substr(0)&&4===W.selectionStart?V?G.execCommand('del',{source:'ace'}):G.execCommand('backspace',{source:'ace'}):u||(t.substring(0,9)==n&&t.length>n.length?t=t.substr(9):t.substr(0,4)==n.substr(0,4)?t=t.substr(4,t.length-n.length+1):t.charAt(t.length-1)==n.charAt(0)&&(t=t.slice(0,-1)),t==n.charAt(0)||t.charAt(t.length-1)==n.charAt(0)&&(t=t.slice(0,-1)),t&&G.onTextInput(t)),u&&(u=!1),V&&(V=!1))},R=function(){if(!p){var e=W.value;S(e),F()}},T=function(a,r,t){var e=a.clipboardData||window.clipboardData;if(e&&!l){var i=d||t?'Text':'text/plain';try{return r?!1!==e.setData(i,r):e.getData(i)}catch(a){if(!t)return T(a,r,!0)}}},y=function(t,e){var n=G.getCopyText();return n?void(T(t,n)?(U.isIOS&&(h=e,W.value='\\n aa'+n+'a a\\n',W.setSelectionRange(4,4+n.length),u={value:n}),e?G.onCut():G.onCopy(),U.isIOS||P.preventDefault(t)):(u=!0,W.value=n,W.select(),setTimeout(function(){u=!1,F(),_(),e?G.onCut():G.onCopy()}))):P.preventDefault(t)};P.addCommandKeyListener(W,G.onCommandKey.bind(G)),P.addListener(W,'select',function(){(function(t){return 0===t.selectionStart&&t.selectionEnd===t.value.length})(W)?(G.selectAll(),_()):v&&_(G.selection.isEmpty())}),P.addListener(W,'input',R),P.addListener(W,'cut',function(t){y(t,!0)}),P.addListener(W,'copy',function(t){y(t,!1)}),P.addListener(W,'paste',function(t){var e=T(t);'string'==typeof e?(e&&G.onPaste(e,t),U.isIE&&setTimeout(_),P.preventDefault(t)):(W.value='',m=!0)});var w=function(){if(p&&G.onCompositionUpdate&&!G.$readOnly){var t=W.value.replace(/\\x01/g,'');if(p.lastValue!==t&&(G.onCompositionUpdate(t),p.lastValue&&G.undo(),p.canUndo&&(p.lastValue=t),p.lastValue)){var e=G.selection.getRange();G.insert(p.lastValue),G.session.markUndoGroup(),p.range=G.selection.getRange(),G.selection.setRange(e),G.selection.clearSelection()}}},x=function(t){if(G.onCompositionEnd&&!G.$readOnly){var n=p;p=!1;var a=setTimeout(function(){a=null;var t=W.value.replace(/\\x01/g,'');p||(t==n.lastValue?F():!n.lastValue&&t&&(F(),S(t)))});v=function(t){return a&&clearTimeout(a),(t=t.replace(/\\x01/g,''))==n.lastValue?'':(n.lastValue&&a&&G.undo(),t)},G.onCompositionEnd(),G.removeListener('mousedown',x),'compositionend'==t.type&&n.range&&G.selection.setRange(n.range),(U.isChrome&&53<=U.isChrome||U.isWebKit&&603<=U.isWebKit)&&R()}},D=r.delayedCall(w,50),L;P.addListener(W,'compositionstart',function(){p||!G.onCompositionStart||G.$readOnly||((p={}).canUndo=G.session.$undoManager,G.onCompositionStart(),setTimeout(w,0),G.on('mousedown',x),p.canUndo&&!G.selection.isEmpty()&&(G.insert(''),G.session.markUndoGroup(),G.selection.clearSelection()),G.session.markUndoGroup())}),U.isGecko?P.addListener(W,'text',function(){D.schedule()}):(P.addListener(W,'keyup',function(){D.schedule()}),P.addListener(W,'keydown',function(){D.schedule()})),P.addListener(W,'compositionend',x),this.getElement=function(){return W},this.setReadOnly=function(t){W.readOnly=t},this.onContextMenu=function(n){V=!0,_(G.selection.isEmpty()),G._emit('nativecontextmenu',{target:G,domEvent:n}),this.moveToMouse(n,!0)},this.moveToMouse=function(t,e){H||(H=W.style.cssText),W.style.cssText=(e?'z-index:100000;':'')+'height:'+W.style.height+';'+(U.isIE?'opacity:0.1;':'');var n=G.container.getBoundingClientRect(),a=o.computedStyle(G.container),r=n.top+(parseInt(a.borderTopWidth)||0),i=n.left+(parseInt(n.borderLeftWidth)||0),s=n.bottom-r-W.clientHeight-2,l=function(t){W.style.left=t.clientX-i-2+'px',W.style.top=b(t.clientY-r-2,s)+'px'};l(t),'mousedown'==t.type&&(G.renderer.$keepTextAreaAtCursor&&(G.renderer.$keepTextAreaAtCursor=null),clearTimeout(L),U.isWin&&P.capture(G.container,l,I))},this.onContextMenuClose=I;var B=function(t){G.textInput.onContextMenu(t),I()};if(P.addListener(W,'mouseup',B),P.addListener(W,'mousedown',function(t){t.preventDefault(),I()}),P.addListener(G.renderer.scroller,'contextmenu',B),P.addListener(W,'contextmenu',B),U.isIOS){var M=null,N=!1;i.addEventListener('keydown',function(){M&&clearTimeout(M),N=!0}),i.addEventListener('keyup',function(){M=setTimeout(function(){N=!1},100)});var $=function(){if(document.activeElement===W&&!N){if(h)return setTimeout(function(){h=!1},100);var e=W.selectionStart,t=W.selectionEnd;(W.setSelectionRange(4,5),e==t)?0===e?G.onCommandKey(null,0,s.up):1===e?G.onCommandKey(null,0,s.home):2===e?G.onCommandKey(null,a.option,s.left):4===e?G.onCommandKey(null,0,s.left):5===e?G.onCommandKey(null,0,s.right):7===e?G.onCommandKey(null,a.option,s.right):8===e?G.onCommandKey(null,0,s.end):9===e?G.onCommandKey(null,0,s.down):void 0:(6===t?G.onCommandKey(null,a.shift,s.right):7===t?G.onCommandKey(null,a.shift|a.option,s.right):8===t?G.onCommandKey(null,a.shift,s.end):9===t?G.onCommandKey(null,a.shift,s.down):void 0,0===e?G.onCommandKey(null,a.shift,s.up):1===e?G.onCommandKey(null,a.shift,s.home):2===e?G.onCommandKey(null,a.shift|a.option,s.left):3===e?G.onCommandKey(null,a.shift,s.left):void 0)}};document.addEventListener('selectionchange',$),G.on('destroy',function(){document.removeEventListener('selectionchange',$)})}}}),ace.define('ace/keyboard/textinput',['require','exports','module','ace/lib/event','ace/lib/useragent','ace/lib/dom','ace/lib/lang','ace/keyboard/textinput_ios'],function(n,e){'use strict';var P=n('../lib/event'),O=n('../lib/useragent'),o=n('../lib/dom'),r=n('../lib/lang'),s=18>O.isChrome,d=O.isIE,i=n('./textinput_ios').TextInput;e.TextInput=function(l,U){function A(n){if(!h){if(h=!0,E)e=0,t=n?0:G.value.length-1;else var e=n?2:1,t=2;try{G.setSelectionRange(e,t)}catch(t){}h=!1}}function v(){h||(G.value=n,O.isWebKit&&C.schedule())}function M(){clearTimeout(I),I=setTimeout(function(){k&&(G.style.cssText=k,k=''),null==U.renderer.$keepTextAreaAtCursor&&(U.renderer.$keepTextAreaAtCursor=!0,U.renderer.$moveTextAreaToCursor())},0)}if(O.isIOS)return i.call(this,l,U);var G=o.createElement('textarea');G.className='ace_text-input',G.setAttribute('wrap','off'),G.setAttribute('autocorrect','off'),G.setAttribute('autocapitalize','off'),G.setAttribute('spellcheck',!1),G.style.opacity='0',l.insertBefore(G,l.firstChild);var n='\\u2028\\u2028',c=!1,u=!1,h=!1,k='',e=!0;try{var p=document.activeElement===G}catch(t){}P.addListener(G,'blur',function(t){U.onBlur(t),p=!1}),P.addListener(G,'focus',function(t){p=!0,U.onFocus(t),A()}),this.focus=function(){if(k)return G.focus();var t=G.style.top;G.style.position='fixed',G.style.top='0px',G.focus(),setTimeout(function(){G.style.position='','0px'==G.style.top&&(G.style.top=t)},0)},this.blur=function(){G.blur()},this.isFocused=function(){return p};var g=r.delayedCall(function(){p&&A(e)}),C=r.delayedCall(function(){h||(G.value=n,p&&A())});O.isWebKit||U.addEventListener('changeSelection',function(){U.selection.isEmpty()!=e&&(e=!e,g.schedule())}),v(),p&&U.onFocus();var E=null;this.setInputHandler=function(t){E=t},this.getInputHandler=function(){return E};var _=!1,F=function(t){E&&(t=E(t),E=null),u?(A(),t&&U.onPaste(t),u=!1):t==n.charAt(0)?_?U.execCommand('del',{source:'ace'}):U.execCommand('backspace',{source:'ace'}):(t.substring(0,2)==n?t=t.substr(2):t.charAt(0)==n.charAt(0)?t=t.substr(1):t.charAt(t.length-1)==n.charAt(0)&&(t=t.slice(0,-1)),t.charAt(t.length-1)==n.charAt(0)&&(t=t.slice(0,-1)),t&&U.onTextInput(t)),_&&(_=!1)},W=function(){if(!h){var e=G.value;F(e),v()}},S=function(r,l,t){var e=r.clipboardData||window.clipboardData;if(e&&!s){var i=d||t?'Text':'text/plain';try{return l?!1!==e.setData(i,l):e.getData(i)}catch(a){if(!t)return S(a,l,!0)}}},R=function(t,e){var n=U.getCopyText();return n?void(S(t,n)?(e?U.onCut():U.onCopy(),P.preventDefault(t)):(c=!0,G.value=n,G.select(),setTimeout(function(){c=!1,v(),A(),e?U.onCut():U.onCopy()}))):P.preventDefault(t)},T=function(t){R(t,!0)},y=function(t){R(t,!1)},w=function(t){var e=S(t);'string'==typeof e?(e&&U.onPaste(e,t),O.isIE&&setTimeout(A),P.preventDefault(t)):(G.value='',u=!0)};P.addCommandKeyListener(G,U.onCommandKey.bind(U)),P.addListener(G,'select',function(){c?c=!1:function(t){return 0===t.selectionStart&&t.selectionEnd===t.value.length}(G)?(U.selectAll(),A()):E&&A(U.selection.isEmpty())}),P.addListener(G,'input',W),P.addListener(G,'cut',T),P.addListener(G,'copy',y),P.addListener(G,'paste',w),'oncut'in G&&'oncopy'in G&&'onpaste'in G||P.addListener(l,'keydown',function(t){if((!O.isMac||t.metaKey)&&t.ctrlKey)switch(t.keyCode){case 67:y(t);break;case 86:w(t);break;case 88:T(t);}});var B=function(){if(h&&U.onCompositionUpdate&&!U.$readOnly){var t=G.value.replace(/\\u2028/g,'');if(h.lastValue!==t&&(U.onCompositionUpdate(t),h.lastValue&&U.undo(),h.canUndo&&(h.lastValue=t),h.lastValue)){var e=U.selection.getRange();U.insert(h.lastValue),U.session.markUndoGroup(),h.range=U.selection.getRange(),U.selection.setRange(e),U.selection.clearSelection()}}},D=function(t){if(U.onCompositionEnd&&!U.$readOnly){var n=h;h=!1;var a=setTimeout(function(){a=null;var t=G.value.replace(/\\u2028/g,'');h||(t==n.lastValue?v():!n.lastValue&&t&&(v(),F(t)))});E=function(t){return a&&clearTimeout(a),(t=t.replace(/\\u2028/g,''))==n.lastValue?'':(n.lastValue&&a&&U.undo(),t)},U.onCompositionEnd(),U.removeListener('mousedown',D),'compositionend'==t.type&&n.range&&U.selection.setRange(n.range),(O.isChrome&&53<=O.isChrome||O.isWebKit&&603<=O.isWebKit)&&W()}},L=r.delayedCall(B,50),I;P.addListener(G,'compositionstart',function(){h||!U.onCompositionStart||U.$readOnly||((h={}).canUndo=U.session.$undoManager,U.onCompositionStart(),setTimeout(B,0),U.on('mousedown',D),h.canUndo&&!U.selection.isEmpty()&&(U.insert(''),U.session.markUndoGroup(),U.selection.clearSelection()),U.session.markUndoGroup())}),O.isGecko?P.addListener(G,'text',function(){L.schedule()}):(P.addListener(G,'keyup',function(){L.schedule()}),P.addListener(G,'keydown',function(){L.schedule()})),P.addListener(G,'compositionend',D),this.getElement=function(){return G},this.setReadOnly=function(t){G.readOnly=t},this.onContextMenu=function(n){_=!0,A(U.selection.isEmpty()),U._emit('nativecontextmenu',{target:U,domEvent:n}),this.moveToMouse(n,!0)},this.moveToMouse=function(t,e){k||(k=G.style.cssText),G.style.cssText=(e?'z-index:100000;':'')+'height:'+G.style.height+';'+(O.isIE?'opacity:0.1;':'');var n=U.container.getBoundingClientRect(),a=o.computedStyle(U.container),r=n.top+(parseInt(a.borderTopWidth)||0),i=n.left+(parseInt(n.borderLeftWidth)||0),s=n.bottom-r-G.clientHeight-2,l=function(t){G.style.left=t.clientX-i-2+'px',G.style.top=b(t.clientY-r-2,s)+'px'};l(t),'mousedown'==t.type&&(U.renderer.$keepTextAreaAtCursor&&(U.renderer.$keepTextAreaAtCursor=null),clearTimeout(I),O.isWin&&P.capture(U.container,l,M))},this.onContextMenuClose=M;var x=function(t){U.textInput.onContextMenu(t),M()};P.addListener(G,'mouseup',x),P.addListener(G,'mousedown',function(t){t.preventDefault(),M()}),P.addListener(U.renderer.scroller,'contextmenu',x),P.addListener(G,'contextmenu',x)}}),ace.define('ace/mouse/default_handlers',['require','exports','module','ace/lib/dom','ace/lib/event','ace/lib/useragent'],function(n,e){'use strict';function o(n){n.$clickSelection=null;var e=n.editor;e.setDefaultHandler('mousedown',this.onMouseDown.bind(n)),e.setDefaultHandler('dblclick',this.onDoubleClick.bind(n)),e.setDefaultHandler('tripleclick',this.onTripleClick.bind(n)),e.setDefaultHandler('quadclick',this.onQuadClick.bind(n)),e.setDefaultHandler('mousewheel',this.onMouseWheel.bind(n)),e.setDefaultHandler('touchmove',this.onTouchMove.bind(n)),['select','startSelect','selectEnd','selectAllEnd','selectByWordsEnd','selectByLinesEnd','dragWait','dragWaitEnd','focusWait'].forEach(function(e){n[e]=this[e]},this),n.selectByLines=this.extendSelectionBy.bind(n,'getLineRange'),n.selectByWords=this.extendSelectionBy.bind(n,'getWordRange')}function r(a,e){if(a.start.row==a.end.row)var t=2*e.column-a.start.column-a.end.column;else if(a.start.row!=a.end.row-1||a.start.column||a.end.column)t=2*e.row-a.start.row-a.end.row;else var t=e.column-4;return 0>t?{cursor:a.start,anchor:a.end}:{cursor:a.end,anchor:a.start}}n('../lib/dom'),n('../lib/event');var t=n('../lib/useragent');(function(){this.onMouseDown=function(a){var e=a.inSelection(),i=a.getDocumentPosition();this.mousedownEvent=a;var n=this.editor,o=a.getButton();if(0!==o){var r=n.getSelectionRange().isEmpty();return n.$blockScrolling++,(r||1==o)&&n.selection.moveToPosition(i),n.$blockScrolling--,void(2==o&&(n.textInput.onContextMenu(a.domEvent),t.isMozilla||a.preventDefault()))}return this.mousedownEvent.time=Date.now(),!e||n.isFocused()||(n.focus(),!this.$focusTimout||this.$clickSelection||n.inMultiSelectMode)?(this.captureMouse(a),this.startSelect(i,1=s)o=this.$clickSelection.end,i.end.row==n.row&&i.end.column==n.column||(n=i.start);else if(1==s&&0<=t)o=this.$clickSelection.start,i.start.row==n.row&&i.start.column==n.column||(n=i.end);else if(-1==t&&1==s)n=i.end,o=i.start;else{var a=r(this.$clickSelection,n);n=a.cursor,o=a.anchor}e.selection.setSelectionAnchor(o.row,o.column)}e.selection.selectToPosition(n),e.$blockScrolling--,e.renderer.scrollCursorIntoView()},this.selectEnd=this.selectAllEnd=this.selectByWordsEnd=this.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle('ace_selecting'),this.editor.renderer.scroller.releaseCapture&&this.editor.renderer.scroller.releaseCapture()},this.focusWait=function(){var s=(r=this.mousedownEvent.x,e=this.mousedownEvent.y,t=this.x,n=this.y,a(p(t-r,2)+p(n-e,2))),o=Date.now(),r,e,t,n;(0this.$focusTimout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},this.onDoubleClick=function(a){var e=a.getDocumentPosition(),t=this.editor,n=t.session.getBracketRange(e);n?(n.isEmpty()&&(n.start.column--,n.end.column++),this.setState('select')):(n=t.selection.getWordRange(e.row,e.column),this.setState('selectByWords')),this.$clickSelection=n,this.select()},this.onTripleClick=function(a){var e=a.getDocumentPosition(),t=this.editor;this.setState('selectByLines');var n=t.getSelectionRange();n.isMultiLine()&&n.contains(e.row,e.column)?(this.$clickSelection=t.selection.getLineRange(n.start.row),this.$clickSelection.end=t.selection.getLineRange(n.end.row).end):this.$clickSelection=t.selection.getLineRange(e.row),this.select()},this.onQuadClick=function(){var e=this.editor;e.selectAll(),this.$clickSelection=e.getSelectionRange(),this.setState('selectAll')},this.onMouseWheel=function(a){if(!a.getAccelKey()){a.getShiftKey()&&a.wheelY&&!a.wheelX&&(a.wheelX=a.wheelY,a.wheelY=0);var e=a.domEvent.timeStamp,t=e-(this.$lastScrollTime||0),n=this.editor;return n.renderer.isScrollableBy(a.wheelX*a.speed,a.wheelY*a.speed)||200>t?(this.$lastScrollTime=e,n.renderer.scrollBy(a.wheelX*a.speed,a.wheelY*a.speed),a.stop()):void 0}},this.onTouchMove=function(a){var e=a.domEvent.timeStamp,t=e-(this.$lastScrollTime||0),n=this.editor;if(n.renderer.isScrollableBy(a.wheelX*a.speed,a.wheelY*a.speed)||200>t)return this.$lastScrollTime=e,n.renderer.scrollBy(a.wheelX*a.speed,a.wheelY*a.speed),a.stop()}}).call(o.prototype),e.DefaultHandlers=o}),ace.define('ace/tooltip',['require','exports','module','ace/lib/oop','ace/lib/dom'],function(n,e){'use strict';function o(t){this.isOpen=!1,this.$element=null,this.$parentNode=t}n('./lib/oop');var t=n('./lib/dom');(function(){this.$init=function(){return this.$element=t.createElement('div'),this.$element.className='ace_tooltip',this.$element.style.display='none',this.$parentNode.appendChild(this.$element),this.$element},this.getElement=function(){return this.$element||this.$init()},this.setText=function(n){t.setInnerText(this.getElement(),n)},this.setHtml=function(t){this.getElement().innerHTML=t},this.setPosition=function(n,e){this.getElement().style.left=n+'px',this.getElement().style.top=e+'px'},this.setClassName=function(n){t.addCssClass(this.getElement(),n)},this.show=function(a,e,t){null!=a&&this.setText(a),null!=e&&null!=t&&this.setPosition(e,t),this.isOpen||(this.getElement().style.display='block',this.isOpen=!0)},this.hide=function(){this.isOpen&&(this.getElement().style.display='none',this.isOpen=!1)},this.getHeight=function(){return this.getElement().offsetHeight},this.getWidth=function(){return this.getElement().offsetWidth},this.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)}}).call(o.prototype),e.Tooltip=o}),ace.define('ace/mouse/default_gutter_handler',['require','exports','module','ace/lib/dom','ace/lib/oop','ace/lib/event','ace/tooltip'],function(n,e){'use strict';function a(t){l.call(this,t)}var d=n('../lib/dom'),t=n('../lib/oop'),i=n('../lib/event'),l=n('../tooltip').Tooltip;t.inherits(a,l),function(){this.setPosition=function(a,e){var t=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,i=this.getWidth(),o=this.getHeight();e+=15,(a+=15)+i>t&&(a-=a+i-t),e+o>n&&(e-=20+o),l.prototype.setPosition.call(this,a,e)}}.call(a.prototype),e.GutterHandler=function(p){function u(){c&&(c=clearTimeout(c)),n&&(l.hide(),n=null,e._signal('hideGutterTooltip',l),e.removeEventListener('mousewheel',u))}function h(t){l.setPosition(t.x,t.y)}var e=p.editor,s=e.renderer.$gutterLayer,l=new a(e.container),c,g,n;p.editor.setDefaultHandler('guttermousedown',function(a){if(e.isFocused()&&0==a.getButton()&&'foldWidgets'!=s.getRegion(a)){var t=a.getDocumentPosition().row,n=e.session.selection;if(a.getShiftKey())n.selectTo(t,0);else{if(2==a.domEvent.detail)return e.selectAll(),a.preventDefault();p.$clickSelection=e.selection.getLineRange(t)}return p.setState('selectByLines'),p.captureMouse(a),a.preventDefault()}}),p.editor.setDefaultHandler('guttermousemove',function(t){var r=t.domEvent.target||t.domEvent.srcElement;return d.hasCssClass(r,'ace_fold-widget')?u():void(n&&p.$tooltipFollowsMouse&&h(t),g=t,c||(c=setTimeout(function(){c=null,g&&!p.isMousePressed?function(){var o=g.getDocumentPosition().row,t=s.$annotations[o];if(!t)return u();if(o==e.session.getLength()){var c=e.renderer.pixelToScreenCoordinates(0,g.y).row,r=g.$pos;if(c>e.session.documentToScreenRow(r.row,r.column))return u()}if(n!=t)if(n=t.text.join('
                                          '),l.setHtml(n),l.show(),e._signal('showGutterTooltip',l),e.on('mousewheel',u),p.$tooltipFollowsMouse)h(g);else{var a=g.domEvent.target.getBoundingClientRect(),d=l.getElement().style;d.left=a.right+'px',d.top=a.bottom+'px'}}():u()},50)))}),i.addListener(e.renderer.$gutter,'mouseout',function(){g=null,n&&!c&&(c=setTimeout(function(){c=null,u()},50))}),e.on('changeSession',u)}}),ace.define('ace/mouse/mouse_event',['require','exports','module','ace/lib/event','ace/lib/useragent'],function(n,e){'use strict';var t=n('../lib/event'),a=n('../lib/useragent'),o=e.MouseEvent=function(n,e){this.domEvent=n,this.editor=e,this.x=this.clientX=n.clientX,this.y=this.clientY=n.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1};(function(){this.stopPropagation=function(){t.stopPropagation(this.domEvent),this.propagationStopped=!0},this.preventDefault=function(){t.preventDefault(this.domEvent),this.defaultPrevented=!0},this.stop=function(){this.stopPropagation(),this.preventDefault()},this.getDocumentPosition=function(){return this.$pos?this.$pos:(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY),this.$pos)},this.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var n=this.editor.getSelectionRange();if(n.isEmpty())this.$inSelection=!1;else{var e=this.getDocumentPosition();this.$inSelection=n.contains(e.row,e.column)}return this.$inSelection},this.getButton=function(){return t.getButton(this.domEvent)},this.getShiftKey=function(){return this.domEvent.shiftKey},this.getAccelKey=a.isMac?function(){return this.domEvent.metaKey}:function(){return this.domEvent.ctrlKey}}).call(o.prototype)}),ace.define('ace/mouse/dragdrop_handler',['require','exports','module','ace/lib/dom','ace/lib/event','ace/lib/useragent'],function(n,e){'use strict';function c(a){function b(){var t=p;(function(t,e){var a=Date.now(),i=!e||t.row!=e.row,o=!e||t.column!=e.column;!E||i||o?(D.$blockScrolling+=1,D.moveCursorToPosition(t),D.$blockScrolling-=1,E=a,O={x:F,y:I}):u(O.x,O.y,F,I)>m?E=null:a-E>=s&&(D.renderer.scrollCursorIntoView(),E=null)})(p=D.renderer.screenToTextCoordinates(F,I),t),function(t,e){var s=Date.now(),i=D.renderer.layerConfig.lineHeight,o=D.renderer.layerConfig.characterWidth,r=D.renderer.scroller.getBoundingClientRect(),a={x:{left:F-r.left,right:r.right-F},y:{top:I-r.top,bottom:r.bottom-I}},l=b(a.x.left,a.x.right),d=b(a.y.top,a.y.bottom),c={row:t.row,column:t.column};2>=l/o&&(c.column+=a.x.left=d/i&&(c.row+=a.y.top=_&&D.renderer.scrollCursorIntoView(c):P=s:P=null}(p,t)}function S(){l=D.selection.toOrientedRange(),o=D.session.addMarker(l,'ace_selection',D.getSelectionStyle()),D.clearSelection(),D.isFocused()&&D.renderer.$cursorLayer.setBlinking(!1),clearInterval(e),b(),e=setInterval(b,20),n=0,M.addListener(document,'mousemove',y)}function R(){clearInterval(e),D.session.removeMarker(o),o=null,D.$blockScrolling+=1,D.selection.fromOrientedRange(l),D.$blockScrolling-=1,D.isFocused()&&!g&&D.renderer.$cursorLayer.setBlinking(!D.getReadOnly()),l=null,p=null,n=0,P=null,E=null,M.removeListener(document,'mousemove',y)}function y(){null==i&&(i=setTimeout(function(){null!=i&&o&&R()},20))}function w(n){var e=n.types;return!e||Array.prototype.some.call(e,function(t){return'text/plain'==t||'Text'==t})}function B(a){var e=['copy','copymove','all','uninitialized'],t=L.isMac?a.altKey:a.ctrlKey,n='uninitialized';try{n=a.dataTransfer.effectAllowed.toLowerCase()}catch(t){}var r='none';return t&&0<=e.indexOf(n)?r='copy':0<=['move','copymove','linkmove','all','uninitialized'].indexOf(n)?r='move':0<=e.indexOf(n)&&(r='copy'),r}var D=a.editor,t=x.createElement('img');t.src='data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==',L.isOpera&&(t.style.cssText='width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;'),['dragWait','dragWaitEnd','startDrag','dragReadyEnd','onMouseDrag'].forEach(function(e){a[e]=this[e]},this),D.addEventListener('mousedown',this.onMouseDown.bind(a));var r=D.container,n=0,o,F,I,e,l,p,N,g,P,E,O;this.onDragStart=function(n){if(this.cancelDrag||!r.draggable){var e=this;return setTimeout(function(){e.startSelect(),e.captureMouse(n)},0),n.preventDefault()}l=D.getSelectionRange();var a=n.dataTransfer;a.effectAllowed=D.getReadOnly()?'copy':'copyMove',L.isOpera&&(D.container.appendChild(t),t.scrollTop=0),a.setDragImage&&a.setDragImage(t,0,0),L.isOpera&&D.container.removeChild(t),a.clearData(),a.setData('Text',D.session.getTextRange()),g=!0,this.setState('drag')},this.onDragEnd=function(t){if(r.draggable=!1,g=!1,this.setState(null),!D.getReadOnly()){var e=t.dataTransfer.dropEffect;N||'move'!=e||D.session.remove(D.getSelectionRange()),D.renderer.$cursorLayer.setBlinking(!0)}this.editor.unsetStyle('ace_dragging'),this.editor.renderer.setCursorStyle('')},this.onDragEnter=function(t){if(!D.getReadOnly()&&w(t.dataTransfer))return F=t.clientX,I=t.clientY,o||S(),n++,t.dataTransfer.dropEffect=N=B(t),M.preventDefault(t)},this.onDragOver=function(t){if(!D.getReadOnly()&&w(t.dataTransfer))return F=t.clientX,I=t.clientY,o||(S(),n++),null!==i&&(i=null),t.dataTransfer.dropEffect=N=B(t),M.preventDefault(t)},this.onDragLeave=function(t){if(0>=--n&&o)return R(),N=null,M.preventDefault(t)},this.onDrop=function(t){if(p){var e=t.dataTransfer;if(g)'move'===N?l=l.contains(p.row,p.column)?{start:p,end:p}:D.moveText(l,p):'copy'===N?l=D.moveText(l,p,!0):void 0;else{var n=e.getData('Text');l={start:p,end:D.session.insert(p,n)},D.focus(),N=null}return R(),M.preventDefault(t)}},M.addListener(r,'dragstart',this.onDragStart.bind(a)),M.addListener(r,'dragend',this.onDragEnd.bind(a)),M.addListener(r,'dragenter',this.onDragEnter.bind(a)),M.addListener(r,'dragover',this.onDragOver.bind(a)),M.addListener(r,'dragleave',this.onDragLeave.bind(a)),M.addListener(r,'drop',this.onDrop.bind(a));var i=null}function u(r,e,t,n){return a(p(t-r,2)+p(n-e,2))}var x=n('../lib/dom'),M=n('../lib/event'),L=n('../lib/useragent'),_=200,s=200,m=5;(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(){this.editor.renderer.$cursorLayer.setBlinking(!this.editor.getReadOnly()),this.editor.unsetStyle('ace_dragging'),this.editor.renderer.setCursorStyle(''),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var n=this.editor;n.container.draggable=!0,n.renderer.$cursorLayer.setBlinking(!1),n.setStyle('ace_dragging');var e=L.isWin?'default':'move';n.renderer.setCursorStyle(e),this.setState('dragReady')},this.onMouseDrag=function(){var e=this.editor.container;L.isIE&&'dragReady'==this.state&&3 ['+this.end.row+'/'+this.end.column+']'},this.contains=function(n,e){return 0==this.compare(n,e)},this.compareRange=function(a){var e=a.end,n=a.start,r;return 1==(r=this.compare(e.row,e.column))?1==(r=this.compare(n.row,n.column))?2:0==r?1:0:-1==r?-2:-1==(r=this.compare(n.row,n.column))?-1:1==r?42:0},this.comparePoint=function(t){return this.compare(t.row,t.column)},this.containsRange=function(t){return 0==this.comparePoint(t.start)&&0==this.comparePoint(t.end)},this.intersects=function(n){var e=this.compareRange(n);return-1==e||0==e||1==e},this.isEnd=function(n,e){return this.end.row==n&&this.end.column==e},this.isStart=function(n,e){return this.start.row==n&&this.start.column==e},this.setStart=function(n,a){'object'==typeof n?(this.start.column=n.column,this.start.row=n.row):(this.start.row=n,this.start.column=a)},this.setEnd=function(n,a){'object'==typeof n?(this.end.column=n.column,this.end.row=n.row):(this.end.row=n,this.end.column=a)},this.inside=function(n,e){return 0==this.compare(n,e)&&!this.isEnd(n,e)&&!this.isStart(n,e)},this.insideStart=function(n,e){return 0==this.compare(n,e)&&!this.isEnd(n,e)},this.insideEnd=function(n,e){return 0==this.compare(n,e)&&!this.isStart(n,e)},this.compare=function(n,e){return this.isMultiLine()||n!==this.start.row?nthis.end.row?1:this.start.row===n?e>=this.start.column?0:-1:this.end.row===n?e<=this.end.column?0:1:0:ethis.end.column?1:0},this.compareStart=function(n,e){return this.start.row==n&&this.start.column==e?-1:this.compare(n,e)},this.compareEnd=function(n,e){return this.end.row==n&&this.end.column==e?1:this.compare(n,e)},this.compareInside=function(n,e){return this.end.row==n&&this.end.column==e?1:this.start.row==n&&this.start.column==e?-1:this.compare(n,e)},this.clipRows=function(r,i){if(this.end.row>i)var t={row:i+1,column:0};else this.end.rowi)var n={row:i+1,column:0};else this.start.rowe.row||n.row==e.row&&n.column>e.column},this.getRange=function(){var n=this.anchor,e=this.lead;return this.isEmpty()?r.fromPoints(e,e):this.isBackwards()?r.fromPoints(e,n):r.fromPoints(n,e)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit('changeSelection'))},this.selectAll=function(){var t=this.doc.getLength()-1;this.setSelectionAnchor(0,0),this.moveCursorTo(t,this.doc.getLine(t).length)},this.setRange=this.setSelectionRange=function(n,e){e?(this.setSelectionAnchor(n.end.row,n.end.column),this.selectTo(n.start.row,n.start.column)):(this.setSelectionAnchor(n.start.row,n.start.column),this.selectTo(n.end.row,n.end.column)),this.getRange().isEmpty()&&(this.$isEmpty=!0),this.$desiredColumn=null},this.$moveSelection=function(n){var e=this.lead;this.$isEmpty&&this.setSelectionAnchor(e.row,e.column),n.call(this)},this.selectTo=function(n,e){this.$moveSelection(function(){this.moveCursorTo(n,e)})},this.selectToPosition=function(t){this.$moveSelection(function(){this.moveCursorToPosition(t)})},this.moveTo=function(n,e){this.clearSelection(),this.moveCursorTo(n,e)},this.moveToPosition=function(t){this.clearSelection(),this.moveCursorToPosition(t)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(a,e){if(void 0===e){var t=a||this.lead;a=t.row,e=t.column}return this.session.getWordRange(a,e)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var n=this.getCursor(),e=this.session.getAWordRange(n.row,n.column);this.setSelectionRange(e)},this.getLineRange=function(a,s){var t='number'==typeof a?a:this.lead.row,i=this.session.getFoldLine(t),o;return i?(t=i.start.row,o=i.end.row):o=t,!0===s?new r(t,0,o,this.session.getLine(o).length):new r(t,0,o+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(a,e,t){var n=a.column,r=a.column+e;return 0>t&&(n=a.column-e,r=a.column),this.session.isTabStop(a)&&this.doc.getLine(a.row).slice(n,r).split(' ').length-1==e},this.moveCursorLeft=function(){var a=this.lead.getPosition(),t;if(t=this.session.getFoldAt(a.row,a.column,-1))this.moveCursorTo(t.start.row,t.start.column);else if(0===a.column)0=t.length)return this.moveCursorTo(a,t.length),this.moveCursorRight(),void(a=t)return this.moveCursorTo(a,0),this.moveCursorLeft(),void(0e)for(r.lastIndex=0;(o=a[e])&&!r.test(o);)if(r.lastIndex=0,e++,n.test(o)){if(2b){var g=o.substring(b,v-p.length);h.type==l?h.value+=g:(h.type&&a.push(h),h={type:l,value:g})}for(var T=0;T_){for(u>2*o.length&&this.reportError('infinite loop with in ace tokenizer',{startState:y,line:o});bthis.$tokenIndex;){if(this.$row-=1,0>this.$row)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},this.stepForward=function(){var t;for(this.$tokenIndex+=1;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,t||(t=this.$session.getLength()),this.$row>=t)return this.$row=t-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},this.getCurrentTokenRow=function(){return this.$row},this.getCurrentTokenColumn=function(){var a=this.$rowTokens,e=this.$tokenIndex,t=a[e].start;if(void 0!==t)return t;for(t=0;0a.length&&(C=a.length):(tthis.row)){var t=function(d,t,n){var c='insert'==d.action,o=(c?1:-1)*(d.end.row-d.start.row),r=(c?1:-1)*(d.end.column-d.start.column),s=d.start,a=c?s:d.end;return e(t,s,n)?{row:t.row,column:t.column}:e(a,t,!n)?{row:t.row+o,column:t.column+(t.row==a.row?r:0)}:{row:s.row,column:s.column}}(a,{row:this.row,column:this.column},this.$insertRight);this.setPosition(t.row,t.column,!0)}},this.setPosition=function(a,r,s){var n;if(n=s?{row:a,column:r}:this.$clipPositionToDocument(a,r),this.row!=n.row||this.column!=n.column){var l={row:this.row,column:this.column};this.row=n.row,this.column=n.column,this._signal('change',{old:l,value:n})}},this.detach=function(){this.document.removeEventListener('change',this.$onChange)},this.attach=function(t){this.document=t||this.document,this.document.on('change',this.$onChange)},this.$clipPositionToDocument=function(a,e){var t={};return a>=this.document.getLength()?(t.row=S(0,this.document.getLength()-1),t.column=this.document.getLine(t.row).length):0>a?(t.row=0,t.column=0):(t.row=a,t.column=b(this.document.getLine(t.row).length,S(0,e))),0>e&&(t.column=0),t}}).call(o.prototype)}),ace.define('ace/document',['require','exports','module','ace/lib/oop','ace/apply_delta','ace/lib/event_emitter','ace/range','ace/anchor'],function(n,e){'use strict';var t=n('./lib/oop'),i=n('./apply_delta').applyDelta,o=n('./lib/event_emitter').EventEmitter,d=n('./range').Range,r=n('./anchor').Anchor,a=function(t){this.$lines=[''],0===t.length?this.$lines=['']:Array.isArray(t)?this.insertMergedLines({row:0,column:0},t):this.insert({row:0,column:0},t)};(function(){t.implement(this,o),this.setValue=function(n){var e=this.getLength()-1;this.remove(new d(0,0,e,this.getLine(e).length)),this.insert({row:0,column:0},n)},this.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},this.createAnchor=function(n,e){return new r(this,n,e)},this.$split=0==='aaa'.split(/a/).length?function(t){return t.replace(/\\r\\n|\\r/g,'\\n').split('\\n')}:function(t){return t.split(/\\r\\n|\\r|\\n/)},this.$detectNewLine=function(n){var e=n.match(/^.*?(\\r\\n|\\r|\\n)/m);this.$autoNewLine=e?e[1]:'\\n',this._signal('changeNewLineMode')},this.getNewLineCharacter=function(){switch(this.$newLineMode){case'windows':return'\\r\\n';case'unix':return'\\n';default:return this.$autoNewLine||'\\n';}},this.$autoNewLine='',this.$newLineMode='auto',this.setNewLineMode=function(t){this.$newLineMode!==t&&(this.$newLineMode=t,this._signal('changeNewLineMode'))},this.getNewLineMode=function(){return this.$newLineMode},this.isNewLine=function(t){return'\\r\\n'==t||'\\r'==t||'\\n'==t},this.getLine=function(t){return this.$lines[t]||''},this.getLines=function(n,e){return this.$lines.slice(n,e+1)},this.getAllLines=function(){return this.getLines(0,this.getLength())},this.getLength=function(){return this.$lines.length},this.getTextRange=function(t){return this.getLinesForRange(t).join(this.getNewLineCharacter())},this.getLinesForRange=function(a){var e;if(a.start.row===a.end.row)e=[this.getLine(a.start.row).substring(a.start.column,a.end.column)];else{(e=this.getLines(a.start.row,a.end.row))[0]=(e[0]||'').substring(a.start.column);var t=e.length-1;a.end.row-a.start.row==t&&(e[t]=e[t].substring(0,a.end.column))}return e},this.insertLines=function(n,e){return console.warn('Use of document.insertLines is deprecated. Use the insertFullLines method instead.'),this.insertFullLines(n,e)},this.removeLines=function(n,e){return console.warn('Use of document.removeLines is deprecated. Use the removeFullLines method instead.'),this.removeFullLines(n,e)},this.insertNewLine=function(t){return console.warn('Use of document.insertNewLine is deprecated. Use insertMergedLines(position, [\\'\\', \\'\\']) instead.'),this.insertMergedLines(t,['',''])},this.insert=function(n,e){return 1>=this.getLength()&&this.$detectNewLine(e),this.insertMergedLines(n,this.$split(e))},this.insertInLine=function(a,e){var t=this.clippedPos(a.row,a.column),r=this.pos(a.row,a.column+e.length);return this.applyDelta({start:t,end:r,action:'insert',lines:[e]},!0),this.clonePos(r)},this.clippedPos=function(a,r){var t=this.getLength();void 0===a?a=t:0>a?a=0:a>=t&&(a=t-1,r=void 0);var n=this.getLine(a);return void 0==r&&(r=n.length),{row:a,column:r=b(S(r,0),n.length)}},this.clonePos=function(t){return{row:t.row,column:t.column}},this.pos=function(n,a){return{row:n,column:a}},this.$clipPosition=function(n){var e=this.getLength();return n.row>=e?(n.row=S(0,e-1),n.column=this.getLine(e-1).length):(n.row=S(0,n.row),n.column=b(S(n.column,0),this.getLine(n.row).length)),n},this.insertFullLines=function(a,r){var t=0;(a=b(S(a,0),this.getLength()))=a.lines.length&&!a.lines[0]:!d.comparePoints(a.start,a.end))||(t&&2e4n){d.lines=a,d.start.row=i+r,d.start.column=o;break}a.push(''),this.applyDelta({start:this.pos(i+r,o),end:this.pos(i+s,o=0),action:d.action,lines:a},!0)}},this.revertDelta=function(t){this.applyDelta({start:this.clonePos(t.start),end:this.clonePos(t.end),action:'insert'==t.action?'remove':'insert',lines:t.lines.slice()})},this.indexToPosition=function(a,e){for(var t=this.$lines||this.getAllLines(),n=this.getNewLineCharacter().length,i=e||0,s=t.length;i(a-=t[i].length+n))return{row:i,column:a+t[i].length+n};return{row:s-1,column:t[s-1].length}},this.positionToIndex=function(a,e){for(var t=this.$lines||this.getAllLines(),n=this.getNewLineCharacter().length,i=0,o=b(a.row,t.length),r=e||0;ra+1&&(this.currentLine=a+1)),this.lines[a]=n.tokens}}).call(o.prototype),e.BackgroundTokenizer=o}),ace.define('ace/search_highlight',['require','exports','module','ace/lib/lang','ace/lib/oop','ace/range'],function(n,e){'use strict';var a=n('./lib/lang'),t=(n('./lib/oop'),n('./range').Range),o=function(a,e,t){this.setRegexp(a),this.clazz=e,this.type=t||'text'};(function(){this.MAX_RANGES=500,this.setRegexp=function(t){this.regExp+''!=t+''&&(this.regExp=t,this.cache=[])},this.update=function(o,e,i,n){if(this.regExp)for(var r=n.firstRow,s=n.lastRow,d=r,l;d<=s;d++){l=this.cache[d],null==l&&((l=a.getMatchOffsets(i.getLine(d),this.regExp)).length>this.MAX_RANGES&&(l=l.slice(0,this.MAX_RANGES)),l=l.map(function(n){return new t(d,n.offset,d,n.offset+n.length)}),this.cache[d]=l.length?l:'');for(var c=l.length;c--;)e.drawSingleLineMarker(o,l[c].toScreenRange(i),this.clazz,n)}}}).call(o.prototype),e.SearchHighlight=o}),ace.define('ace/edit_session/fold_line',['require','exports','module','ace/range'],function(n,e){'use strict';function o(r,e){this.foldData=r,Array.isArray(e)?this.folds=e:e=this.folds=[e];var t=e[e.length-1];this.range=new a(e[0].start.row,e[0].start.column,t.end.row,t.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach(function(t){t.setFoldLine(this)},this)}var a=n('../range').Range;(function(){this.shiftRow=function(n){this.start.row+=n,this.end.row+=n,this.folds.forEach(function(e){e.start.row+=n,e.end.row+=n})},this.addFold=function(t){if(t.sameRow){if(t.start.rowthis.endRow)throw new Error('Can\\'t add a fold to this FoldLine as it has no connection');this.folds.push(t),this.folds.sort(function(n,e){return-n.range.compareEnd(e.start.row,e.start.column)}),0this.range.compareStart(t.end.row,t.end.column)&&(this.start.row=t.start.row,this.start.column=t.start.column)}else if(t.start.row==this.end.row)this.folds.push(t),this.end.row=t.end.row,this.end.column=t.end.column;else{if(t.end.row!=this.start.row)throw new Error('Trying to add fold to FoldRow that doesn\\'t have a matching row');this.folds.unshift(t),this.start.row=t.start.row,this.start.column=t.start.column}t.foldLine=this},this.containsRow=function(t){return t>=this.start.row&&t<=this.end.row},this.walk=function(d,e,t){var n=0,r=this.folds,s=!0,a,i;null==e&&(e=this.end.row,t=this.end.column);for(var o=0;o(a-=n.start.column-e))return{row:n.start.row,column:n.start.column+a};if(0>(a-=n.placeholder.length))return n.start;e=n.end.column}return{row:this.end.row,column:this.end.column+a}}}).call(o.prototype),e.FoldLine=o}),ace.define('ace/range_list',['require','exports','module','ace/range'],function(n,e){'use strict';var d=n('./range').Range.comparePoints,t=function(){this.ranges=[]};(function(){this.comparePoints=d,this.pointIndex=function(i,e,c){for(var n=this.ranges,o=c||0;ot&&(t=-t-1);var r=this.pointIndex(a.end,e,t);return 0>r?r=-r-1:r++,this.ranges.splice(t,r-t,a)},this.addList=function(a){for(var e=[],t=a.length;t--;)e.push.apply(e,this.add(a[t]));return e},this.substractPoint=function(n){var e=this.pointIndex(n);if(0<=e)return this.ranges.splice(e,1)},this.merge=function(){for(var a=[],t=this.ranges,n=(t=t.sort(function(n,e){return d(n.start,e.start)}))[0],o=1,r;oe||(0!=e||r.isEmpty()||n.isEmpty())&&(0>d(r.end,n.end)&&(r.end.row=n.end.row,r.end.column=n.end.column),t.splice(o,1),a.push(n),n=r,o--)}return this.ranges=t,a},this.contains=function(n,a){return 0<=this.pointIndex({row:n,column:a})},this.containsPoint=function(t){return 0<=this.pointIndex(t)},this.rangeAtPoint=function(n){var e=this.pointIndex(n);if(0<=e)return this.ranges[e]},this.clipRows=function(a,l){var d=this.ranges;if(d[0].start.row>l||d[d.length-1].start.rown&&(n=-n-1);var c=this.pointIndex({row:l,column:0},n);0>c&&(c=-c-1);for(var p=[],r=n;rn)break;if(l.start.row==n&&l.start.column>=e.column&&(l.start.column==e.column&&this.$insertRight||(l.start.column+=o,l.start.row+=i)),l.end.row==n&&l.end.column>=e.column){if(l.end.column==e.column&&this.$insertRight)continue;l.end.column==e.column&&0l.start.column&&l.end.column==r[s+1].start.column&&(l.end.column-=o),l.end.column+=o,l.end.row+=i}}if(0!=i&&s=a)return r;if(r.end.row>a)return null}return null},this.getNextFoldLine=function(a,e){var t=this.$foldData,n=0;for(e&&(n=t.indexOf(e)),-1==n&&(n=0);n=a)return r}return null},this.getFoldedRowCount=function(l,e){for(var t=this.$foldData,n=e-l+1,i=0;i=e){s=l?n-=e-s:n=0);break}r>=l&&(n-=s>=l?r-s:r-l+1)}return n},this.$addFoldLine=function(t){return this.$foldData.push(t),this.$foldData.sort(function(n,e){return n.start.row-e.start.row}),t},this.addFold=function(r,e){var t=this.$foldData,i=!1,s;r instanceof o?s=r:(s=new o(e,r)).collapseChildren=e.collapseChildren,this.$clipRangeToDocument(s.range);var _=s.start.row,a=s.start.column,l=s.end.row,c=s.end.column;if(!(_(r=this.getTextRange(e)).length)return;r=r.trim().substring(0,2)+'..'}this.addFold(r,e)}},this.getCommentFoldRange=function(s,e,t){var n=new i(this,s,e),o=n.getCurrentToken(),r=o.type;if(o&&/^comment|string/.test(r)){'comment'==(r=r.match(/comment|string/)[0])&&(r+='|doc-start');var a=new RegExp(r),l=new d;if(1!=t){do o=n.stepBackward();while(o&&a.test(o.type));n.stepForward()}if(l.start.row=n.getCurrentTokenRow(),l.start.column=n.getCurrentTokenColumn()+2,n=new i(this,s,e),-1!=t){var c=-1;do if(o=n.stepForward(),-1==c){var p=this.getState(n.$row);a.test(p)||(c=n.$row)}else if(n.$row>c)break;while(o&&a.test(o.type));o=n.stepBackward()}else o=n.getCurrentToken();return l.end.row=n.getCurrentTokenRow(),l.end.column=n.getCurrentTokenColumn()+o.value.length-2,l}},this.foldAll=function(a,e,t){void 0==t&&(t=1e5);var n=this.foldWidgets;if(n){e=e||this.getLength();for(var i=a=a||0;i=a){i=o.end.row;try{var r=this.addFold('...',o);r&&(r.collapseChildren=t)}catch(t){}}}}},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle='markbegin',this.setFoldStyle=function(n){if(!this.$foldStyles[n])throw new Error('invalid fold style: '+n+'['+Object.keys(this.$foldStyles).join(', ')+']');if(this.$foldStyle!=n){this.$foldStyle=n,'manual'==n&&this.unfold();var e=this.$foldMode;this.$setFolding(null),this.$setFolding(e)}},this.$setFolding=function(t){this.$foldMode!=t&&(this.$foldMode=t,this.off('change',this.$updateFoldWidgets),this.off('tokenizerUpdate',this.$tokenizerUpdateFoldWidgets),this._signal('changeAnnotation'),t&&'manual'!=this.$foldStyle?(this.foldWidgets=[],this.getFoldWidget=t.getFoldWidget.bind(t,this,this.$foldStyle),this.getFoldWidgetRange=t.getFoldWidgetRange.bind(t,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on('change',this.$updateFoldWidgets),this.on('tokenizerUpdate',this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(a,e){var t=this.foldWidgets;if(!t||e&&t[a])return{};for(var l=a-1,o,d;0<=l;){if(d=t[l],null==d&&(d=t[l]=this.getFoldWidget(l)),'start'==d){var r=this.getFoldWidgetRange(l);if(o||(o=r),r&&r.end.row>=a)break}l--}return{range:-1!=l&&r,firstRange:o}},this.onFoldWidgetClick=function(a,e){var t={children:(e=e.domEvent).shiftKey,all:e.ctrlKey||e.metaKey,siblings:e.altKey};if(!this.$toggleFoldWidget(a,t)){var n=e.target||e.srcElement;n&&/ace_fold-widget/.test(n.className)&&(n.className+=' ace_invalid')}},this.$toggleFoldWidget=function(d,e){if(this.getFoldWidget){var t=this.getFoldWidget(d),n=this.getLine(d),i='end'===t?-1:1,o=this.getFoldAt(d,-1==i?0:n.length,i);if(o)return e.children||e.all?this.removeFold(o):this.expandFold(o),o;var r=this.getFoldWidgetRange(d,!0);if(r&&!r.isMultiLine()&&(o=this.getFoldAt(r.start.row,r.start.column,1))&&r.isEqual(o.range))return this.removeFold(o),o;if(e.siblings){var s=this.getParentFoldRangeData(d);if(s.range)var a=s.range.start.row+1,l=s.range.end.row;this.foldAll(a,l,e.all?1e4:0)}else e.children?(l=r?r.end.row:this.getLength(),this.foldAll(d+1,l,e.all?1e4:0)):r&&(e.all&&(r.collapseChildren=1e4),this.addFold('...',r));return r}},this.toggleFoldWidget=function(){var e=this.selection.getCursor().row;e=this.getRowFoldStart(e);var t=this.$toggleFoldWidget(e,{});if(!t){var a=this.getParentFoldRangeData(e,!0);if(t=a.range||a.firstRange){e=t.start.row;var r=this.getFoldAt(e,this.getLine(e).length,1);r?this.removeFold(r):this.addFold('...',t)}}},this.updateFoldWidgets=function(a){var e=a.start.row,t=a.end.row-e;if(0==t)this.foldWidgets[e]=null;else if('remove'==a.action)this.foldWidgets.splice(e,t+1,null);else{var n=Array(t+1);n.unshift(e,1),this.foldWidgets.splice.apply(this.foldWidgets,n)}},this.tokenizerUpdateFoldWidgets=function(n){var e=n.data;e.first!=e.last&&this.foldWidgets.length>e.first&&this.foldWidgets.splice(e.first,this.foldWidgets.length)}}}),ace.define('ace/edit_session/bracket_match',['require','exports','module','ace/token_iterator','ace/range'],function(n,e){'use strict';var d=n('../token_iterator').TokenIterator,r=n('../range').Range;e.BracketMatch=function(){this.findMatchingBracket=function(a,e){if(0==a.column)return null;var t=e||this.getLine(a.row).charAt(a.column-1);if(''==t)return null;var n=t.match(/([\\(\\[\\{])|([\\)\\]\\}])/);return n?n[1]?this.$findClosingBracket(n[1],a):this.$findOpeningBracket(n[2],a):null},this.getBracketRange=function(o){var e=this.getLine(o.row),n=!0,i=e.charAt(o.column-1),l=i&&i.match(/([\\(\\[\\{])|([\\)\\]\\}])/),d;if(l||(i=e.charAt(o.column),o={row:o.row,column:o.column+1},l=i&&i.match(/([\\(\\[\\{])|([\\)\\]\\}])/),n=!1),!l)return null;if(l[1]){if(!(t=this.$findClosingBracket(l[1],o)))return null;d=r.fromPoints(o,t),n||(d.end.column++,d.start.column--),d.cursor=d.end}else{var t;if(!(t=this.$findOpeningBracket(l[2],o)))return null;d=r.fromPoints(t,o),n||(d.start.column++,d.end.column--),d.cursor=d.start}return d},this.$brackets={\")\":'(',\"(\":')',\"]\":'[',\"[\":']',\"{\":'}',\"}\":'{'},this.$findOpeningBracket=function(i,e,t){var n=this.$brackets[i],o=1,r=new d(this,e.row,e.column),s=r.getCurrentToken();if(s||(s=r.stepForward()),s){t||(t=new RegExp('(\\\\.?'+s.type.replace('.','\\\\.').replace('rparen','.paren').replace(/\\b(?:end)\\b/,'(?:start|begin|end)')+')+'));for(var a=e.column-r.getCurrentTokenColumn()-2,l=s.value;;){for(;0<=a;){var c=l.charAt(a);if(!(c==n))c==i&&(o+=1);else if(0==(o-=1))return{row:r.getCurrentTokenRow(),column:a+r.getCurrentTokenColumn()};a-=1}do s=r.stepBackward();while(s&&!t.test(s.type));if(null==s)break;a=(l=s.value).length-1}return null}},this.$findClosingBracket=function(i,e,t){var n=this.$brackets[i],o=1,r=new d(this,e.row,e.column),s=r.getCurrentToken();if(s||(s=r.stepForward()),s){t||(t=new RegExp('(\\\\.?'+s.type.replace('.','\\\\.').replace('lparen','.paren').replace(/\\b(?:start|begin)\\b/,'(?:start|begin|end)')+')+'));for(var a=e.column-r.getCurrentTokenColumn();;){for(var l=s.value,c=l.length,p;at)&&(4352<=t&&4447>=t||4515<=t&&4519>=t||4602<=t&&4607>=t||9001<=t&&9002>=t||11904<=t&&11929>=t||11931<=t&&12019>=t||12032<=t&&12245>=t||12272<=t&&12283>=t||12288<=t&&12350>=t||12353<=t&&12438>=t||12441<=t&&12543>=t||12549<=t&&12589>=t||12593<=t&&12686>=t||12688<=t&&12730>=t||12736<=t&&12771>=t||12784<=t&&12830>=t||12832<=t&&12871>=t||12880<=t&&13054>=t||13056<=t&&19903>=t||19968<=t&&42124>=t||42128<=t&&42182>=t||43360<=t&&43388>=t||44032<=t&&55203>=t||55216<=t&&55238>=t||55243<=t&&55291>=t||63744<=t&&64255>=t||65040<=t&&65049>=t||65072<=t&&65106>=t||65108<=t&&65126>=t||65128<=t&&65131>=t||65281<=t&&65376>=t||65504<=t&&65510>=t)}p.implement(this,r),this.setDocument=function(t){this.doc&&this.doc.removeListener('change',this.$onChange),this.doc=t,t.on('change',this.$onChange),this.bgTokenizer&&this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},this.getDocument=function(){return this.doc},this.$resetRowCache=function(a){if(!a)return this.$docRowCache=[],void(this.$screenRowCache=[]);var r=this.$docRowCache.length,t=this.$getRowCacheIndex(this.$docRowCache,a)+1;r>t&&(this.$docRowCache.splice(t,r),this.$screenRowCache.splice(t,r))},this.$getRowCacheIndex=function(a,e){for(var t=0,n=a.length-1;t<=n;){var i=t+n>>1,o=a[i];if(e>o)t=i+1;else{if(!(e=e);n++);return(o=t[n])?(o.index=n,o.start=i-o.value.length,o):null},this.setUndoManager=function(n){if(this.$undoManager=n,this.$deltas=[],this.$deltasDoc=[],this.$deltasFold=[],this.$informUndoManager&&this.$informUndoManager.cancel(),n){var e=this;this.$syncInformUndoManager=function(){e.$informUndoManager.cancel(),e.$deltasFold.length&&(e.$deltas.push({group:'fold',deltas:e.$deltasFold}),e.$deltasFold=[]),e.$deltasDoc.length&&(e.$deltas.push({group:'doc',deltas:e.$deltasDoc}),e.$deltasDoc=[]),0n&&(n=e.screenWidth)}),this.lineWidgetWidth=n},this.$computeWidth=function(d){if(this.$modified||d){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var e=this.doc.getAllLines(),t=this.$rowLengthCache,n=0,i=0,o=this.$foldData[i],r=o?o.start.row:1/0,s=e.length,a=0;ar){if((a=o.end.row+1)>=s)break;r=(o=this.$foldData[i++])?o.start.row:1/0}null==t[a]&&(t[a]=this.$getStringScreenWidth(e[a])[0]),t[a]>n&&(n=t[a])}this.screenWidth=n}},this.getLine=function(t){return this.doc.getLine(t)},this.getLines=function(n,e){return this.doc.getLines(n,e)},this.getLength=function(){return this.doc.getLength()},this.getTextRange=function(t){return this.doc.getTextRange(t||this.selection.getRange())},this.insert=function(n,e){return this.doc.insert(n,e)},this.remove=function(t){return this.doc.remove(t)},this.removeFullLines=function(n,e){return this.doc.removeFullLines(n,e)},this.undoChanges=function(a,e){if(a.length){this.$fromUndo=!0;for(var r=null,n=a.length-1,i;-1!=n;n--)i=a[n],'doc'==i.group?(this.doc.revertDeltas(i.deltas),r=this.$getUndoSelection(i.deltas,!0,r)):i.deltas.forEach(function(t){this.addFolds(t.folds)},this);return this.$fromUndo=!1,r&&this.$undoSelect&&!e&&this.selection.setSelectionRange(r),r}},this.redoChanges=function(a,e){if(a.length){this.$fromUndo=!0;for(var r=null,n=0,i;nd.end.column&&(o.start.column+=l),o.end.row==d.end.row&&o.end.column>d.end.column&&(o.end.column+=l)),r&&o.start.row>=d.end.row&&(o.start.row+=r,o.end.row+=r)}if(o.end=this.insert(o.start,c),i.length){var s=d.start,a=o.start,l=(r=a.row-s.row,a.column-s.column);this.addFolds(i.map(function(t){return(t=t.clone()).start.row==s.row&&(t.start.column+=l),t.end.row==s.row&&(t.end.column+=l),t.start.row+=r,t.end.row+=r,t}))}return o},this.indentRows=function(a,e,t){t=t.replace(/\\t/g,this.getTabString());for(var n=a;n<=e;n++)this.doc.insertInLine({row:n,column:0},t)},this.outdentRows=function(a){for(var e=a.collapseRows(),t=new f(0,0,0,0),n=this.getTabSize(),i=e.start.row,o;i<=e.end.row;++i){o=this.getLine(i),t.start.row=i,t.end.row=i;for(var r=0;rt){if(0>(i=this.getRowFoldStart(l+t)))return 0;var n=i-l}else if(0this.doc.getLength()-1)return 0;n=i-e}else l=this.$clipRowToDocument(l),n=(e=this.$clipRowToDocument(e))-l+1;var o=new f(l,0,e,d),r=this.getFoldsInRange(o).map(function(t){return(t=t.clone()).start.row+=n,t.end.row+=n,t}),s=0==t?this.doc.getLines(l,e):this.doc.removeFullLines(l,e);return this.doc.insertFullLines(l+n,s),r.length&&this.addFolds(r),n},this.moveLinesUp=function(n,e){return this.$moveLines(n,e,-1)},this.moveLinesDown=function(n,e){return this.$moveLines(n,e,1)},this.duplicateLines=function(n,e){return this.$moveLines(n,e,0)},this.$clipRowToDocument=function(t){return S(0,b(t,this.doc.getLength()-1))},this.$clipColumnToRow=function(n,e){return 0>e?0:b(this.doc.getLine(n).length,e)},this.$clipPositionToDocument=function(a,r){if(r=S(0,r),0>a)a=0,r=0;else{var o=this.doc.getLength();a>=o?(a=o-1,r=this.doc.getLine(o-1).length):r=b(this.doc.getLine(a).length,r)}return{row:a,column:r}},this.$clipRangeToDocument=function(n){0>n.start.row?(n.start.row=0,n.start.column=0):n.start.column=this.$clipColumnToRow(n.start.row,n.start.column);var e=this.doc.getLength()-1;return n.end.row>e?(n.end.row=e,n.end.column=this.doc.getLine(e).length):n.end.column=this.$clipColumnToRow(n.end.row,n.end.column),n},this.$wrapLimit=80,this.$useWrapMode=!1,this.$wrapLimitRange={min:null,max:null},this.setUseWrapMode=function(n){if(n!=this.$useWrapMode){if(this.$useWrapMode=n,this.$modified=!0,this.$resetRowCache(0),n){var e=this.getLength();this.$wrapData=Array(e),this.$updateWrapData(0,e-1)}this._signal('changeWrapMode')}},this.getUseWrapMode=function(){return this.$useWrapMode},this.setWrapLimitRange=function(n,a){this.$wrapLimitRange.min===n&&this.$wrapLimitRange.max===a||(this.$wrapLimitRange={min:n,max:a},this.$modified=!0,this.$useWrapMode&&this._signal('changeWrapMode'))},this.adjustWrapLimit=function(a,e){var r=this.$wrapLimitRange;0>r.max&&(r={min:e,max:e});var n=this.$constrainWrapLimit(a,r.min,r.max);return n!=this.$wrapLimit&&1=i.row&&p.shiftRow(-s);r=o}else{var h=Array(s);h.unshift(o,0);var d=e?this.$wrapData:this.$rowLengthCache;if(d.splice.apply(d,h),l=this.$foldData,c=0,p=this.getFoldLine(o)){var m=p.range.compareInside(n.row,n.column);0==m?(p=p.split(n.row,n.column))&&(p.shiftRow(s),p.addRemoveChars(r,0,i.column-n.column)):-1==m&&(p.addRemoveChars(o,0,i.column-n.column),p.shiftRow(s)),c=l.indexOf(p)+1}for(;c=o&&p.shiftRow(s)}}return e&&this.$wrapData.length!=this.doc.getLength()&&console.error('doc.getLength() and $wrapData.length have to be the same!'),this.$updating=!1,e?this.$updateWrapData(o,r):this.$updateRowLengthCache(o,r),_},this.$updateRowLengthCache=function(n,e){this.$rowLengthCache[n]=null,this.$rowLengthCache[e]=null},this.$updateWrapData=function(t,n){var d=this.doc.getAllLines(),i=this.getTabSize(),a=this.$wrapData,l=this.$wrapLimit,c=t,p,o;for(n=b(n,d.length-1);c<=n;)(o=this.getFoldLine(c,o))?(p=[],o.walk(function(t,n,o,r){var a;if(null!=t){(a=this.$getDisplayTokens(t,p.length))[0]=s;for(var i=1;it-p;)if(g=l+t-p,a[g-1]>=h&&a[g]>=h)f(g);else if(a[g]!=s&&a[g]!=e){for(var _=S(g-(t-(t>>2)),l-1);g>_&&a[g]_&&a[g]_&&9==a[g];)g--}else for(;g>_&&a[g]_?f(++g):(2==a[g=l+t]&&g--,f(g-p))}else{for(;g!=l-1&&a[g]!=s;g--);if(g>l){f(g);continue}for(g=l+t;gr||57r?t.push(9):4352<=r&&m(r)?t.push(1,2):t.push(1);return t},this.$getStringScreenWidth=function(a,e,t){if(0==e)return[0,0];var n,r;for(null==e&&(e=1/0),t=t||0,r=0;re));r++);return[t,r]},this.lineWidgets=null,this.getRowLength=function(n){if(this.lineWidgets)var e=this.lineWidgets[n]&&this.lineWidgets[n].rowCount||0;else e=0;return this.$useWrapMode&&this.$wrapData[n]?this.$wrapData[n].length+1+e:1+e},this.getRowLineCount=function(t){return this.$useWrapMode&&this.$wrapData[t]?this.$wrapData[t].length+1:1},this.getRowWrapIndent=function(a){if(this.$useWrapMode){var e=this.screenToDocumentPosition(a,Number.MAX_VALUE),t=this.$wrapData[e.row];return t.length&&t[0]E)return{row:0,column:0};var t=0,_=0,y=0,s=0,a=this.$screenRowCache,l=this.$getRowCacheIndex(a,E),c=a.length,A,n;if(c&&0<=l){y=a[l],t=this.$docRowCache[l];var i=E>a[c-1]}else i=!c;for(var h=this.getLength()-1,b=this.getNextFoldLine(t),m=b?b.start.row:1/0;y<=E&&!(y+(s=this.getRowLength(t))>E||t>=h);)y+=s,++t>m&&(t=b.end.row+1,m=(b=this.getNextFoldLine(t,b))?b.start.row:1/0),i&&(this.$docRowCache.push(t),this.$screenRowCache.push(y));if(b&&b.start.row<=t)A=this.getFoldDisplayLine(b),t=b.start.row;else{if(y+s<=E||t>h)return{row:h,column:this.getLine(h).length};A=this.getLine(t),b=null}var p=0;if(this.$useWrapMode){var f=this.$wrapData[t];if(f){var g=x(E-y);n=f[g],0=n&&(_=n-1),b?b.idxToPosition(_):{row:t,column:_}},this.documentToScreenPosition=function(E,e){if(void 0===e)var t=this.$clipPositionToDocument(E.row,E.column);else t=this.$clipPositionToDocument(E,e);E=t.row,e=t.column;var n=0,_=null,r;(r=this.getFoldAt(E,e,1))&&(E=r.start.row,e=r.start.column);var i=0,a=this.$docRowCache,l=this.$getRowCacheIndex(a,E),c=a.length,y;if(c&&0<=l){i=a[l],n=this.$screenRowCache[l];var s=E>a[c-1]}else s=!c;for(var h=this.getNextFoldLine(i),d=h?h.start.row:1/0;i=d){if((y=h.end.row+1)>E)break;d=(h=this.getNextFoldLine(y,h))?h.start.row:1/0}else y=i+1;n+=this.getRowLength(i),i=y,s&&(this.$docRowCache.push(i),this.$screenRowCache.push(n))}var m='';h&&i>=d?(m=this.getFoldDisplayLine(h,E,e),_=h.start.row):(m=this.getLine(E).substring(0,e),_=E);var p=0;if(this.$useWrapMode){var f=this.$wrapData[_];if(f){for(var g=0;m.length>=f[g];)n++,g++;m=m.substring(f[g-1]||0,m.length),p=0i&&(n=e.end.row+1,i=(e=this.$foldData[s++])?e.start.row:1/0);else{l=this.getLength();for(var r=this.$foldData,s=0;st);o++);return[n,o]})},this.destroy=function(){this.bgTokenizer&&(this.bgTokenizer.setDocument(null),this.bgTokenizer=null),this.$stopWorker()}}.call(u.prototype),n('./edit_session/folding').Folding.call(u.prototype),n('./edit_session/bracket_match').BracketMatch.call(u.prototype),o.defineOptions(u.prototype,'session',{wrap:{set:function(n){if(n&&'off'!=n?'free'==n?n=!0:'printMargin'==n?n=-1:'string'==typeof n&&(n=parseInt(n,10)||!1):n=!1,this.$wrap!=n)if(this.$wrap=n,n){var a='number'==typeof n?n:null;this.setWrapLimitRange(a,a),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?'printMargin':this.getWrapLimitRange().min?this.$wrap:'free':'off'},handlesSet:!0},wrapMethod:{set:function(t){(t='auto'==t?'text'!=this.$mode.type:'text'!=t)!=this.$wrapAsCode&&(this.$wrapAsCode=t,this.$useWrapMode&&(this.$modified=!0,this.$resetRowCache(0),this.$updateWrapData(0,this.getLength()-1)))},initialValue:'auto'},indentedSoftWrap:{initialValue:!0},firstLineNumber:{set:function(){this._signal('changeBreakpoint')},initialValue:1},useWorker:{set:function(t){this.$useWorker=t,this.$stopWorker(),t&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(t){isNaN(t)||this.$tabSize===t||(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=t,this._signal('changeTabSize'))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},overwrite:{set:function(){this._signal('changeOverwrite')},initialValue:!1},newLineMode:{set:function(t){this.doc.setNewLineMode(t)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(t){this.setMode(t)},get:function(){return this.$modeId}}}),e.EditSession=u}),ace.define('ace/search',['require','exports','module','ace/lib/lang','ace/lib/oop','ace/range'],function(n,e){'use strict';var l=n('./lib/lang'),t=n('./lib/oop'),u=n('./range').Range,a=function(){this.$options={}};(function(){this.set=function(n){return t.mixin(this.$options,n),this},this.getOptions=function(){return l.copyObject(this.$options)},this.setOptions=function(t){this.$options=t},this.find=function(a){var r=this.$options,e=this.$matchIterator(a,r);if(!e)return!1;var t=null;return e.forEach(function(a,e,n,o){return t=new u(a,e,n,o),!(e==o&&r.start&&r.start.start&&0!=r.skipCurrent&&t.isEqual(r.start))||(t=null,!1)}),t},this.findAll=function(r){var e=this.$options;if(!e.needle)return[];this.$assembleRegExp(e);var t=e.range,n=t?r.getLines(t.start.row,t.end.row):r.doc.getAllLines(),o=[],i=e.re;if(e.$isMultiLine){var a=i.length,s=n.length-a,c;e:for(var y=i.offset||0;y<=s;y++){for(var h=0;hp||(o.push(c=new u(y,p,y+a-1,f)),2b&&o[h].end.row==t.end.row;)h--;for(o=o.slice(g,h+1),g=0,h=o.length;g=i;e--)if(l(e,Number.MAX_VALUE,t))return;if(0!=p.wrap)for(e=a,i=r.row;e>=i;e--)if(l(e,Number.MAX_VALUE,t))return}};else s=function(t){var e=r.row;if(!l(e,r.column,t)){for(e+=1;e<=a;e++)if(l(e,0,t))return;if(0!=p.wrap)for(e=i,a=r.row;e<=a;e++)if(l(e,0,t))return}};if(p.$isMultiLine)var g=e.length,l=function(n,t,o){var r=m?n-g+1:n;if(!(0>r)){var i=d.getLine(r),a=i.search(e[0]);if((m||!(at))return!!o(r,a,r+g-1,l)||void 0}}};else l=m?function(n,t,i){var o=d.getLine(n),s=[],a=0,l;for(e.lastIndex=0;l=e.exec(o);){var r=l[0].length;if(a=l.index,!r){if(a>=o.length)break;e.lastIndex=a+=1}if(l.index+r>t)break;s.push(l.index,r)}for(var p=s.length-1,u;0<=p;p-=2)if(u=s[p-1],i(n,u,n,u+(r=s[p])))return!0}:function(n,t,i){var o=d.getLine(n),s=t,a;for(e.lastIndex=t;a=e.exec(o);){var r=a[0].length;if(i(n,s=a.index,n,s+r))return!0;if(!r&&(e.lastIndex=s+=1,s>=o.length))return!1}};return{forEach:s}}}).call(a.prototype),e.Search=a}),ace.define('ace/keyboard/hash_handler',['require','exports','module','ace/lib/keys','ace/lib/useragent'],function(n,e){'use strict';function s(n,e){this.platform=e||(i.isMac?'mac':'win'),this.commands={},this.commandKeyBinding={},this.addCommands(n),this.$singleCommand=!0}function a(n,e){s.call(this,n,e),this.$singleCommand=!1}var l=n('../lib/keys'),i=n('../lib/useragent'),d=l.KEY_MODS;a.prototype=s.prototype,function(){function e(t){return'object'==typeof t&&t.bindKey&&t.bindKey.position||(t.isDefault?-100:0)}this.addCommand=function(t){this.commands[t.name]&&this.removeCommand(t),this.commands[t.name]=t,t.bindKey&&this._buildKeyHash(t)},this.removeCommand=function(a,l){var t=a&&('string'==typeof a?a:a.name);a=this.commands[t],l||delete this.commands[t];var n=this.commandKeyBinding;for(var i in n){var o=n[i];if(o==a)delete n[i];else if(Array.isArray(o)){var r=o.indexOf(a);-1!=r&&(o.splice(r,1),1==o.length&&(n[i]=o[0]))}}},this.bindKey=function(a,r,l){if('object'==typeof a&&a&&(void 0==l&&(l=a.position),a=a[this.platform]),a)return'function'==typeof r?this.addCommand({exec:r,bindKey:a,name:r.name||a}):void a.split('|').forEach(function(t){var c='';if(-1!=t.indexOf(' ')){var e=t.split(/\\s+/);t=e.pop(),e.forEach(function(a){var e=this.parseKeys(a),t=d[e.hashId]+e.key;c+=(c?' ':'')+t,this._addCommandToBinding(c,'chainKeys')},this),c+=' '}var n=this.parseKeys(t),o=d[n.hashId]+n.key;this._addCommandToBinding(c+o,r,l)},this)},this._addCommandToBinding=function(a,t,l){var d=this.commandKeyBinding,r;if(!t)delete d[a];else if(!d[a]||this.$singleCommand)d[a]=t;else{Array.isArray(d[a])?-1!=(r=d[a].indexOf(t))&&d[a].splice(r,1):d[a]=[d[a]],'number'!=typeof l&&(l=e(t));var o=d[a];for(r=0;rl);r++);o.splice(r,0,t)}},this.addCommands=function(a){a&&Object.keys(a).forEach(function(e){var t=a[e];if(t){if('string'==typeof t)return this.bindKey(t,e);'function'==typeof t&&(t={exec:t}),'object'==typeof t&&(t.name||(t.name=e),this.addCommand(t))}},this)},this.removeCommands=function(n){Object.keys(n).forEach(function(e){this.removeCommand(n[e])},this)},this.bindKeys=function(n){Object.keys(n).forEach(function(e){this.bindKey(e,n[e])},this)},this._buildKeyHash=function(t){this.bindKey(t.bindKey,t)},this.parseKeys=function(i){var e=i.toLowerCase().split(/[\\-\\+]([\\-\\+])?/).filter(function(t){return t}),t=e.pop(),d=l[t];if(l.FUNCTION_KEYS[d])t=l.FUNCTION_KEYS[d].toLowerCase();else{if(!e.length)return{key:t,hashId:-1};if(1==e.length&&'shift'==e[0])return{key:t.toUpperCase(),hashId:-1}}for(var o=0,c=e.length,s;c--;){if(s=l.KEY_MODS[e[c]],null==s)return'undefined'!=typeof console&&console.error('invalid modifier '+e[c]+' in '+i),!1;o|=s}return{key:t,hashId:o}},this.findKeyCommand=function(a,e){var t=d[a]+e;return this.commandKeyBinding[t]},this.handleKeyboard=function(a,e,t,n){if(!(0>n)){var r=d[e]+t,o=this.commandKeyBinding[r];return a.$keyChain&&(a.$keyChain+=' '+r,o=this.commandKeyBinding[a.$keyChain]||o),o&&('chainKeys'==o||'chainKeys'==o[o.length-1])?(a.$keyChain=a.$keyChain||r,{command:'null'}):(a.$keyChain&&(e&&4!=e||1!=t.length?(-1==e||0o?o+1:o,r.selection.moveCursorTo(t.row,o))},multiSelectAction:'forEach',readOnly:!0},{name:'invertSelection',bindKey:s(null,null),exec:function(a){var e=a.session.doc.getLength()-1,t=a.session.doc.getLine(e).length,n=a.selection.rangeList.ranges,r=[];1>n.length&&(n=[a.selection.getRange()]);for(var o=0;o=r.lastRow||n.end.row<=r.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead);}'animate'==t&&this.renderer.animateScrolling(this.curOp.scrollTop)}this.prevOp=this.curOp,this.curOp=null}},this.$mergeableCommands=['backspace','del','insertstring'],this.$historyTracker=function(a){if(this.$mergeUndoDeltas){var e=this.prevOp,t=this.$mergeableCommands,n=e.command&&a.command.name==e.command.name;if('insertstring'==a.command.name){var r=a.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),n=n&&this.mergeNextCommand&&(!/\\s/.test(r)||/\\s/.test(e.args)),this.mergeNextCommand=!0}else n=n&&-1!==t.indexOf(a.command.name);'always'!=this.$mergeUndoDeltas&&2e3=r);n.stepForward()}if(!i)return e.removeMarker(e.$tagHighlight),void(e.$tagHighlight=null);var a=n.getCurrentTokenRow(),l=n.getCurrentTokenColumn(),c=new v(a,l,a,l+i.value.length),u=e.$backMarkers[e.$tagHighlight];e.$tagHighlight&&void 0!=u&&0!==c.compareRange(u.range)&&(e.removeMarker(e.$tagHighlight),e.$tagHighlight=null),c&&!e.$tagHighlight&&(e.$tagHighlight=e.addMarker(c,'ace_bracket','text'))}}},50)}},this.focus=function(){var t=this;setTimeout(function(){t.textInput.focus()}),this.textInput.focus()},this.isFocused=function(){return this.textInput.isFocused()},this.blur=function(){this.textInput.blur()},this.onFocus=function(t){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit('focus',t))},this.onBlur=function(t){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit('blur',t))},this.$cursorChange=function(){this.renderer.updateCursor()},this.onDocumentChange=function(a){var e=this.session.$useWrapMode,t=a.start.row==a.end.row?a.end.row:1/0;this.renderer.updateLines(a.start.row,t,e),this._signal('change',a),this.$cursorChange(),this.$updateHighlightActiveLine()},this.onTokenizerUpdate=function(n){var e=n.data;this.renderer.updateLines(e.first,e.last)},this.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},this.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},this.onCursorChange=function(){this.$cursorChange(),this.$blockScrolling||(h.warn('Automatically scrolling cursor into view after selection change','this will be disabled in the next version','set editor.$blockScrolling = Infinity to disable this message'),this.renderer.scrollCursorIntoView()),this.$highlightBrackets(),this.$highlightTags(),this.$updateHighlightActiveLine(),this._signal('changeSelection')},this.$updateHighlightActiveLine=function(){var a=this.getSession(),t;if(this.$highlightActiveLine&&('line'==this.$selectionStyle&&this.selection.isMultiLine()||(t=this.getCursorPosition()),!this.renderer.$maxLines||1!==this.session.getLength()||1n.length||2>t.length||!t[1])return this.commands.exec('insertstring',this,s);for(var i=n.length,o;i--;)o=n[i],o.isEmpty()||this.session.remove(o),this.session.insert(o.start,t[i])}},this.execCommand=function(n,e){return this.commands.exec(n,this,e)},this.insert=function(p,e){var m=this.session,n=m.getMode(),i=this.getCursorPosition();if(this.getBehavioursEnabled()&&!e){var o=n.transformAction(m.getState(i.row),'insertion',this,m,p);o&&(p!==o.text&&(this.session.mergeUndoDeltas=!1,this.$mergeNextCommand=!1),p=o.text)}if('\\t'==p&&(p=this.session.getTabString()),this.selection.isEmpty())this.session.getOverwrite()&&-1==p.indexOf('\\n')&&((r=new v.fromPoints(i,i)).end.column+=p.length,this.session.remove(r));else{var r=this.getSelectionRange();i=this.session.remove(r),this.clearSelection()}if('\\n'==p||'\\r\\n'==p){var s=m.getLine(i.row);if(i.column>s.search(/\\S|$/)){var a=s.substr(i.column).search(/\\S|$/);m.doc.removeInLine(i.row,i.column,i.column+a)}}this.clearSelection();var l=i.column,c=m.getState(i.row),u=(s=m.getLine(i.row),n.checkOutdent(c,s,p));if(m.insert(i,p),o&&o.selection&&(2==o.selection.length?this.selection.setSelectionRange(new v(i.row,l+o.selection[0],i.row,l+o.selection[1])):this.selection.setSelectionRange(new v(i.row+o.selection[0],o.selection[1],i.row+o.selection[2],o.selection[3]))),m.getDocument().isNewLine(p)){var g=n.getNextLineIndent(c,s.slice(0,i.column),m.getTabString());m.insert({row:i.row+1,column:0},g)}u&&n.autoOutdent(c,m,i.row)},this.onTextInput=function(t){this.keyBinding.onTextInput(t)},this.onCommandKey=function(a,e,t){this.keyBinding.onCommandKey(a,e,t)},this.setOverwrite=function(t){this.session.setOverwrite(t)},this.getOverwrite=function(){return this.session.getOverwrite()},this.toggleOverwrite=function(){this.session.toggleOverwrite()},this.setScrollSpeed=function(t){this.setOption('scrollSpeed',t)},this.getScrollSpeed=function(){return this.getOption('scrollSpeed')},this.setDragDelay=function(t){this.setOption('dragDelay',t)},this.getDragDelay=function(){return this.getOption('dragDelay')},this.setSelectionStyle=function(t){this.setOption('selectionStyle',t)},this.getSelectionStyle=function(){return this.getOption('selectionStyle')},this.setHighlightActiveLine=function(t){this.setOption('highlightActiveLine',t)},this.getHighlightActiveLine=function(){return this.getOption('highlightActiveLine')},this.setHighlightGutterLine=function(t){this.setOption('highlightGutterLine',t)},this.getHighlightGutterLine=function(){return this.getOption('highlightGutterLine')},this.setHighlightSelectedWord=function(t){this.setOption('highlightSelectedWord',t)},this.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},this.setAnimatedScroll=function(t){this.renderer.setAnimatedScroll(t)},this.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},this.setShowInvisibles=function(t){this.renderer.setShowInvisibles(t)},this.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},this.setDisplayIndentGuides=function(t){this.renderer.setDisplayIndentGuides(t)},this.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},this.setShowPrintMargin=function(t){this.renderer.setShowPrintMargin(t)},this.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},this.setPrintMarginColumn=function(t){this.renderer.setPrintMarginColumn(t)},this.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},this.setReadOnly=function(t){this.setOption('readOnly',t)},this.getReadOnly=function(){return this.getOption('readOnly')},this.setBehavioursEnabled=function(t){this.setOption('behavioursEnabled',t)},this.getBehavioursEnabled=function(){return this.getOption('behavioursEnabled')},this.setWrapBehavioursEnabled=function(t){this.setOption('wrapBehavioursEnabled',t)},this.getWrapBehavioursEnabled=function(){return this.getOption('wrapBehavioursEnabled')},this.setShowFoldWidgets=function(t){this.setOption('showFoldWidgets',t)},this.getShowFoldWidgets=function(){return this.getOption('showFoldWidgets')},this.setFadeFoldWidgets=function(t){this.setOption('fadeFoldWidgets',t)},this.getFadeFoldWidgets=function(){return this.getOption('fadeFoldWidgets')},this.remove=function(a){this.selection.isEmpty()&&('left'==a?this.selection.selectLeft():this.selection.selectRight());var e=this.getSelectionRange();if(this.getBehavioursEnabled()){var t=this.session,n=t.getState(e.start.row),i=t.getMode().transformAction(n,'deletion',this,t,e);if(0===e.end.column){var o=t.getTextRange(e);if('\\n'==o[o.length-1]){var r=t.getLine(e.end.row);/^\\s+$/.test(r)&&(e.end.column=r.length)}}i&&(e=i)}this.session.remove(e),this.clearSelection()},this.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.session.remove(this.getSelectionRange()),this.clearSelection()},this.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var t=this.getSelectionRange();t.start.column==t.end.column&&t.start.row==t.end.row&&(t.end.column=0,t.end.row++),this.session.remove(t),this.clearSelection()},this.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var t=this.getCursorPosition();this.insert('\\n'),this.moveCursorToPosition(t)},this.transposeLetters=function(){if(this.selection.isEmpty()){var a=this.getCursorPosition(),e=a.column;if(0!==e){var t=this.session.getLine(a.row),r,n;ee.toLowerCase()?1:0});for(var n=new v(0,0,0,0),i=a.first,o;i<=a.last;i++)o=e.getLine(i),n.start.row=i,n.end.row=i,n.end.column=o.length,e.replace(n,t[i-a.first])},this.toggleCommentLines=function(){var n=this.session.getState(this.getCursorPosition().row),e=this.$getSelectedRows();this.session.getMode().toggleCommentLines(n,this.session,e.first,e.last)},this.toggleBlockComment=function(){var a=this.getCursorPosition(),e=this.session.getState(a.row),t=this.getSelectionRange();this.session.getMode().toggleBlockComment(e,this.session,t,a)},this.getNumberAt=function(a,e){var t=/[\\-]?[0-9]+(?:\\.[0-9]+)?/g;t.lastIndex=0;for(var n=this.session.getLine(a),r;t.lastIndex=e)return{value:r[0],start:r.index,end:r.index+r[0].length};return null},this.modifyNumber=function(d){var e=this.selection.getCursor().row,t=this.selection.getCursor().column,n=new v(e,t-1,e,t),i=this.session.getTextRange(n);if(!isNaN(parseFloat(i))&&isFinite(i)){var o=this.getNumberAt(e,t);if(o){var r=0<=o.value.indexOf('.')?o.start+o.value.indexOf('.')+1:o.end,s=o.start+o.value.length-r,a=parseFloat(o.value);a*=p(10,s),d*=r!==o.end&&td+1)break;d=m.last}for(c--,s=this.session.$moveLines(h,d,e?0:g),e&&-1==g&&(u=c+1);u<=c;)r[u].moveBy(s,0),u++;e||(s=0),a+=s}f.fromOrientedRange(f.ranges[0]),f.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},this.$getSelectedRows=function(t){return t=(t||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(t.start.row),last:this.session.getRowFoldEnd(t.end.row)}},this.onCompositionStart=function(){this.renderer.showComposition(this.getCursorPosition())},this.onCompositionUpdate=function(t){this.renderer.setCompositionText(t)},this.onCompositionEnd=function(){this.renderer.hideComposition()},this.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},this.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},this.isRowVisible=function(t){return t>=this.getFirstVisibleRow()&&t<=this.getLastVisibleRow()},this.isRowFullyVisible=function(t){return t>=this.renderer.getFirstFullyVisibleRow()&&t<=this.renderer.getLastFullyVisibleRow()},this.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},this.$moveByPage=function(a,e){var t=this.renderer,n=this.renderer.layerConfig,i=a*x(n.height/n.lineHeight);this.$blockScrolling++,!0===e?this.selection.$moveSelection(function(){this.moveCursorBy(i,0)}):!1==e&&(this.selection.moveCursorBy(i,0),this.selection.clearSelection()),this.$blockScrolling--;var o=t.scrollTop;t.scrollBy(0,i*n.lineHeight),null!=e&&t.scrollCursorIntoView(null,.5),t.animateScrolling(o)},this.selectPageDown=function(){this.$moveByPage(1,!0)},this.selectPageUp=function(){this.$moveByPage(-1,!0)},this.gotoPageDown=function(){this.$moveByPage(1,!1)},this.gotoPageUp=function(){this.$moveByPage(-1,!1)},this.scrollPageDown=function(){this.$moveByPage(1)},this.scrollPageUp=function(){this.$moveByPage(-1)},this.scrollToRow=function(t){this.renderer.scrollToRow(t)},this.scrollToLine=function(a,e,t,n){this.renderer.scrollToLine(a,e,t,n)},this.centerSelection=function(){var n=this.getSelectionRange(),e={row:x(n.start.row+(n.end.row-n.start.row)/2),column:x(n.start.column+(n.end.column-n.start.column)/2)};this.renderer.alignCursor(e,.5)},this.getCursorPosition=function(){return this.selection.getCursor()},this.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},this.getSelectionRange=function(){return this.selection.getRange()},this.selectAll=function(){this.$blockScrolling+=1,this.selection.selectAll(),this.$blockScrolling-=1},this.clearSelection=function(){this.selection.clearSelection()},this.moveCursorTo=function(n,e){this.selection.moveCursorTo(n,e)},this.moveCursorToPosition=function(t){this.selection.moveCursorToPosition(t)},this.jumpToMatching=function(m,e){var t=this.getCursorPosition(),n=new C(this.session,t.row,t.column),i=n.getCurrentToken(),o=i||n.stepForward();if(o){var E=!1,_={},c=t.column-o.start,u={\")\":'(',\"(\":'(',\"]\":'[',\"[\":'[',\"{\":'{',\"}\":'{'},h,s;do{if(o.value.match(/[{}()\\[\\]]/g)){for(;cg(d.column-t.column))&&(a=this.session.getBracketRange(d)));else if('tag'===h){if(!o||-1===o.type.indexOf('tag-name'))return;var p=o.value;if(0===(a=new v(n.getCurrentTokenRow(),n.getCurrentTokenColumn()-2,n.getCurrentTokenRow(),n.getCurrentTokenColumn()-2)).compare(t.row,t.column)){E=!1;do o=i,(i=n.stepBackward())&&(-1!==i.type.indexOf('tag-close')&&a.setEnd(n.getCurrentTokenRow(),n.getCurrentTokenColumn()+1),o.value===p&&-1!==o.type.indexOf('tag-name')&&('<'===i.value?_[p]++:'g(d.column-t.column)&&(d=a.end)}(d=a&&a.cursor||d)&&(m?a&&e?this.selection.setRange(a):a&&a.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(d.row,d.column):this.selection.moveTo(d.row,d.column))}}},this.gotoLine=function(a,e,t){this.selection.clearSelection(),this.session.unfold({row:a-1,column:e||0}),this.$blockScrolling+=1,this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(a-1,e||0),this.$blockScrolling-=1,this.isRowFullyVisible(a-1)||this.scrollToLine(a-1,!0,t)},this.navigateTo=function(n,e){this.selection.moveTo(n,e)},this.navigateUp=function(n){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var a=this.selection.anchor.getPosition();return this.moveCursorToPosition(a)}this.selection.clearSelection(),this.selection.moveCursorBy(-n||-1,0)},this.navigateDown=function(n){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var e=this.selection.anchor.getPosition();return this.moveCursorToPosition(e)}this.selection.clearSelection(),this.selection.moveCursorBy(n||1,0)},this.navigateLeft=function(n){if(this.selection.isEmpty())for(n=n||1;n--;)this.selection.moveCursorLeft();else{var e=this.getSelectionRange().start;this.moveCursorToPosition(e)}this.clearSelection()},this.navigateRight=function(n){if(this.selection.isEmpty())for(n=n||1;n--;)this.selection.moveCursorRight();else{var e=this.getSelectionRange().end;this.moveCursorToPosition(e)}this.clearSelection()},this.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},this.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},this.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},this.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},this.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},this.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},this.replace=function(a,e){e&&this.$search.set(e);var t=this.$search.find(this.session),n=0;return t?(this.$tryReplace(t,a)&&(n=1),null!==t&&(this.selection.setSelectionRange(t),this.renderer.scrollSelectionIntoView(t.start,t.end)),n):n},this.replaceAll=function(a,e){e&&this.$search.set(e);var t=this.$search.findAll(this.session),n=0;if(!t.length)return n;this.$blockScrolling+=1;var i=this.getSelectionRange();this.selection.moveTo(0,0);for(var o=t.length-1;0<=o;--o)this.$tryReplace(t[o],a)&&n++;return this.selection.setSelectionRange(i),this.$blockScrolling-=1,n},this.$tryReplace=function(a,e){var t=this.session.getTextRange(a);return null===(e=this.$search.replace(t,e))?null:(a.end=this.session.replace(a,e),a)},this.getLastSearchOptions=function(){return this.$search.getOptions()},this.find=function(a,i,t){i||(i={}),'string'==typeof a||a instanceof RegExp?i.needle=a:'object'==typeof a&&_.mixin(i,a);var n=this.selection.getRange();null==i.needle&&((a=this.session.getTextRange(n)||this.$search.$options.needle)||(n=this.session.getWordRange(n.start.row,n.start.column),a=this.session.getTextRange(n)),this.$search.set({needle:a})),this.$search.set(i),i.start||this.$search.set({start:n});var s=this.$search.find(this.session);return i.preventScroll?s:s?(this.revealRange(s,t),s):(i.backwards?n.start=n.end:n.end=n.start,void this.selection.setRange(n))},this.findNext=function(n,e){this.find({skipCurrent:!0,backwards:!1},n,e)},this.findPrevious=function(n,e){this.find(n,{skipCurrent:!0,backwards:!0},e)},this.revealRange=function(a,e){this.$blockScrolling+=1,this.session.unfold(a),this.selection.setSelectionRange(a),this.$blockScrolling-=1;var t=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(a.start,a.end,.5),!1!==e&&this.renderer.animateScrolling(t)},this.undo=function(){this.$blockScrolling++,this.session.getUndoManager().undo(),this.$blockScrolling--,this.renderer.scrollCursorIntoView(null,.5)},this.redo=function(){this.$blockScrolling++,this.session.getUndoManager().redo(),this.$blockScrolling--,this.renderer.scrollCursorIntoView(null,.5)},this.destroy=function(){this.renderer.destroy(),this._signal('destroy',this),this.session&&this.session.destroy()},this.setAutoScrollEditorIntoView=function(l){if(l){var d=this,n=!1,i;this.$scrollAnchor||(this.$scrollAnchor=document.createElement('div'));var t=this.$scrollAnchor;t.style.cssText='position:absolute',this.container.insertBefore(t,this.container.firstChild);var o=this.on('changeSelection',function(){n=!0}),r=this.renderer.on('beforeRender',function(){n&&(i=d.renderer.container.getBoundingClientRect())}),s=this.renderer.on('afterRender',function(){if(n&&i&&(d.isFocused()||d.searchBox&&d.searchBox.isFocused())){var o=d.renderer,e=o.$cursorLayer.$pixelPos,r=o.layerConfig,s=e.top-r.offset;null!=(n=0<=e.top&&0>s+i.top||!(e.topwindow.innerHeight)&&null)&&(t.style.top=s+'px',t.style.left=e.left+'px',t.style.height=r.lineHeight+'px',t.scrollIntoView(n)),n=i=null}});this.setAutoScrollEditorIntoView=function(t){t||(delete this.setAutoScrollEditorIntoView,this.off('changeSelection',o),this.renderer.off('afterRender',s),this.renderer.off('beforeRender',r))}}},this.$resetCursorStyle=function(){var n=this.$cursorStyle||'ace',e=this.renderer.$cursorLayer;e&&(e.setSmoothBlinking(/smooth/.test(n)),e.isBlinking=!this.$readOnly&&'wide'!=n,i.setCssClass(e.element,'ace_slim-cursors',/slim/.test(n)))}}.call(f.prototype),h.defineOptions(f.prototype,'editor',{selectionStyle:{set:function(t){this.onSelectionChange(),this._signal('changeSelectionStyle',{data:t})},initialValue:'line'},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(){this.$resetCursorStyle()},initialValue:!1},cursorStyle:{set:function(){this.$resetCursorStyle()},values:['ace','slim','smooth','wide'],initialValue:'ace'},mergeUndoDeltas:{values:[!1,!0,'always'],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},autoScrollEditorIntoView:{set:function(t){this.setAutoScrollEditorIntoView(t)}},keyboardHandler:{set:function(t){this.setKeyboardHandler(t)},get:function(){return this.keybindingId},handlesSet:!0},hScrollBarAlwaysVisible:'renderer',vScrollBarAlwaysVisible:'renderer',highlightGutterLine:'renderer',animatedScroll:'renderer',showInvisibles:'renderer',showPrintMargin:'renderer',printMarginColumn:'renderer',printMargin:'renderer',fadeFoldWidgets:'renderer',showFoldWidgets:'renderer',showLineNumbers:'renderer',showGutter:'renderer',displayIndentGuides:'renderer',fontSize:'renderer',fontFamily:'renderer',maxLines:'renderer',minLines:'renderer',scrollPastEnd:'renderer',fixedWidthGutter:'renderer',theme:'renderer',scrollSpeed:'$mouseHandler',dragDelay:'$mouseHandler',dragEnabled:'$mouseHandler',focusTimout:'$mouseHandler',tooltipFollowsMouse:'$mouseHandler',firstLineNumber:'session',overwrite:'session',newLineMode:'session',useWorker:'session',useSoftTabs:'session',tabSize:'session',wrap:'session',indentedSoftWrap:'session',foldStyle:'session',mode:'session'}),e.Editor=f}),ace.define('ace/undomanager',['require','exports','module'],function(n,e){'use strict';var t=function(){this.reset()};(function(){function e(t){return{action:t.action,start:t.start,end:t.end,lines:1==t.lines.length?null:t.lines,text:1==t.lines.length?t.lines[0]:null}}function t(t){return{action:t.action,start:t.start,end:t.end,lines:t.lines||[t.text]}}function n(l,e){for(var t=Array(l.length),d=0;dthis.dirtyCounter&&(this.dirtyCounter=NaN),this.dirtyCounter++},this.undo=function(a){var e=this.$undoStack.pop(),t=null;return e&&(t=this.$doc.undoChanges(e,a),this.$redoStack.push(e),this.dirtyCounter--),t},this.redo=function(a){var e=this.$redoStack.pop(),t=null;return e&&(t=this.$doc.redoChanges(this.$deserializeDeltas(e),a),this.$undoStack.push(e),this.dirtyCounter++),t},this.reset=function(){this.$undoStack=[],this.$redoStack=[],this.dirtyCounter=0},this.hasUndo=function(){return 0r&&(p=o.end.row+1,r=(o=e.getNextFoldLine(p,o))?o.start.row:1/0),p>n){for(;this.$cells.length>m+1;)d=this.$cells.pop(),this.element.removeChild(d.element);break}(d=this.$cells[++m])||((d={element:null,textNode:null,foldWidget:null}).element=_.createElement('div'),d.textNode=document.createTextNode(''),d.element.appendChild(d.textNode),this.element.appendChild(d.element),this.$cells[m]=d);var f='ace_gutter-cell ';if(a[p]&&(f+=a[p]),l[p]&&(f+=l[p]),this.$annotations[p]&&(f+=this.$annotations[p].className),d.element.className!=f&&(d.element.className=f),(C=e.getRowLength(p)*i.lineHeight+'px')!=d.element.style.height&&(d.element.style.height=C),s){var g=s[p];null==g&&(g=s[p]=e.getFoldWidget(p))}if(g){d.foldWidget||(d.foldWidget=_.createElement('span'),d.element.appendChild(d.foldWidget)),f='ace_fold-widget ace_'+g,f+='start'==g&&p==r&&pt.right-e.right?'foldWidgets':void 0}}).call(o.prototype),e.Gutter=o}),ace.define('ace/layer/marker',['require','exports','module','ace/range','ace/lib/dom'],function(n,e){'use strict';var p=n('../range').Range,t=n('../lib/dom'),a=function(n){this.element=t.createElement('div'),this.element.className='ace_layer ace_marker-layer',n.appendChild(this.element)};(function(){this.$padding=0,this.setPadding=function(t){this.$padding=t},this.setSession=function(t){this.session=t},this.setMarkers=function(t){this.markers=t},this.update=function(a){if(a){this.config=a;var e=[];for(var t in this.markers){var n=this.markers[t];if(n.range){var i=n.range.clipRows(a.firstRow,a.lastRow);if(!i.isEmpty())if(i=i.toScreenRange(this.session),n.renderer){var o=this.$getTop(i.start.row,a),r=this.$padding+i.start.column*a.characterWidth;n.renderer(e,i,r,o,a)}else'fullLine'==n.type?this.drawFullLineMarker(e,i,n.clazz,a):'screenLine'==n.type?this.drawScreenLineMarker(e,i,n.clazz,a):i.isMultiLine()?'text'==n.type?this.drawTextMarker(e,i,n.clazz,a):this.drawMultiLineMarker(e,i,n.clazz,a):this.drawSingleLineMarker(e,i,n.clazz+' ace_start ace_br15',a)}else n.update(e,this,this.session,a)}this.element.innerHTML=e.join('')}},this.$getTop=function(n,e){return(n-e.firstRowScreen)*e.lineHeight},this.drawTextMarker=function(i,e,t,n,o){for(var r=this.session,s=e.start.row,a=e.end.row,l=s,c=0,u=0,g=r.getScreenLastRowColumn(l),d=new p(l,e.start.column,l,u);l<=a;l++)d.start.row=d.end.row=l,d.start.column=l==s?e.start.column:r.getRowWrapIndent(l),d.end.column=g,c=u,u=g,g=l+1g?4:0)|(l==a?8:0)),n,l==a?0:1,o)},this.drawMultiLineMarker=function(d,e,t,n,i){var o=this.$padding,r=n.lineHeight,s=this.$getTop(e.start.row,n),a=o+e.start.column*n.characterWidth;i=i||'',d.push('
                                          '),s=this.$getTop(e.end.row,n);var l=e.end.column*n.characterWidth;if(d.push('
                                          '),!(0>=(r=(e.end.row-e.start.row-1)*n.lineHeight))){s=this.$getTop(e.start.row+1,n);var c=(e.start.column?1:0)|(e.end.column?0:8);d.push('
                                          ')}},this.drawSingleLineMarker=function(d,e,t,n,i,o){var r=n.lineHeight,s=(e.end.column+(i||0)-e.start.column)*n.characterWidth,a=this.$getTop(e.start.row,n),l=this.$padding+e.start.column*n.characterWidth;d.push('
                                          ')},this.drawFullLineMarker=function(a,e,t,n,i){var o=this.$getTop(e.start.row,n),r=n.lineHeight;e.start.row!=e.end.row&&(r+=this.$getTop(e.end.row,n)-o),a.push('
                                          ')},this.drawScreenLineMarker=function(a,e,t,n,i){var o=this.$getTop(e.start.row,n),r=n.lineHeight;a.push('
                                          ')}}).call(a.prototype),e.Marker=a}),ace.define('ace/layer/text',['require','exports','module','ace/lib/oop','ace/lib/dom','ace/lib/lang','ace/lib/useragent','ace/lib/event_emitter'],function(n,e){'use strict';var t=n('../lib/oop'),p=n('../lib/dom'),m=n('../lib/lang'),r=(n('../lib/useragent'),n('../lib/event_emitter').EventEmitter),o=function(t){this.element=p.createElement('div'),this.element.className='ace_layer ace_text-layer',t.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this)};(function(){t.implement(this,r),this.EOF_CHAR='\\xB6',this.EOL_CHAR_LF='\\xAC',this.EOL_CHAR_CRLF='\\xA4',this.EOL_CHAR=this.EOL_CHAR_LF,this.TAB_CHAR='\\u2014',this.SPACE_CHAR='\\xB7',this.$padding=0,this.$updateEolChar=function(){var t='\\n'==this.session.doc.getNewLineCharacter()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},this.setPadding=function(t){this.$padding=t,this.element.style.padding='0 '+t+'px'},this.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},this.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},this.$setFontMetrics=function(t){this.$fontMetrics=t,this.$fontMetrics.on('changeCharacterSize',function(t){this._signal('changeCharacterSize',t)}.bind(this)),this.$pollSizeChanges()},this.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},this.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},this.setSession=function(t){this.session=t,t&&this.$computeTabString()},this.showInvisibles=!1,this.setShowInvisibles=function(t){return this.showInvisibles!=t&&(this.showInvisibles=t,this.$computeTabString(),!0)},this.displayIndentGuides=!0,this.setDisplayIndentGuides=function(t){return this.displayIndentGuides!=t&&(this.displayIndentGuides=t,this.$computeTabString(),!0)},this.$tabStrings=[],this.onChangeTabSize=this.$computeTabString=function(){var r=this.session.getTabSize();this.tabSize=r;for(var e=this.$tabStrings=[0],t=1;t'+m.stringRepeat(this.TAB_CHAR,t)+''):e.push(m.stringRepeat(' ',t));if(this.displayIndentGuides){this.$indentGuideRe=/\\s\\S| \\t|\\t |\\s$/;var n='ace_indent-guide',i='',o='';if(this.showInvisibles){n+=' ace_invisible',i=' ace_invisible_space',o=' ace_invisible_tab';var s=m.stringRepeat(this.SPACE_CHAR,this.tabSize),a=m.stringRepeat(this.TAB_CHAR,this.tabSize)}else a=s=m.stringRepeat(' ',this.tabSize);this.$tabStrings[' ']=''+s+'',this.$tabStrings['\\t']=''+a+''}},this.updateLines=function(d,e,t){this.config.lastRow==d.lastRow&&this.config.firstRow==d.firstRow||this.scrollLines(d),this.config=d;for(var n=S(e,d.firstRow),i=b(t,d.lastRow),o=this.element.childNodes,r=0,s=d.firstRow;sa&&(s=c.end.row+1,a=(c=this.session.getNextFoldLine(s,c))?c.start.row:1/0),!(s>i);){if(l=o[r++],l){var p=[];this.$renderLine(p,s,!this.$useLineGroups(),s==a&&c),l.style.height=d.lineHeight*this.session.getRowLength(s)+'px',l.innerHTML=p.join('')}s++}},this.scrollLines=function(a){var e=this.config;if(this.config=a,!e||e.lastRowa.lastRow)for(n=this.session.getFoldedRowCount(a.lastRow+1,e.lastRow);0e.lastRow&&(i=this.$renderLinesFragment(a,e.lastRow+1,a.lastRow),r.appendChild(i))},this.$renderLinesFragment=function(o,e,t){for(var n=this.element.ownerDocument.createDocumentFragment(),i=e,r=this.session.getNextFoldLine(i),s=r?r.start.row:1/0;i>s&&(i=r.end.row+1,s=(r=this.session.getNextFoldLine(i,r))?r.start.row:1/0),!(i>t);){var a=p.createElement('div'),l=[];if(this.$renderLine(l,i,!1,i==s&&r),a.innerHTML=l.join(''),this.$useLineGroups())a.className='ace_line_group',n.appendChild(a),a.style.height=o.lineHeight*this.session.getRowLength(i)+'px';else for(;a.firstChild;)n.appendChild(a.firstChild);i++}return n},this.update=function(a){this.config=a;for(var e=[],t=a.firstRow,n=a.lastRow,i=t,o=this.session.getNextFoldLine(i),r=o?o.start.row:1/0;i>r&&(i=o.end.row+1,r=(o=this.session.getNextFoldLine(i,o))?o.start.row:1/0),!(i>n);)this.$useLineGroups()&&e.push('
                                          '),this.$renderLine(e,i,!1,i==r&&o),this.$useLineGroups()&&e.push('
                                          '),i++;this.element.innerHTML=e.join('')},this.$textToken={text:!0,rparen:!0,lparen:!0},this.$renderToken=function(r,d,e,t){var p=this,n=t.replace(/\\t|&|<|>|( +)|([\\x00-\\x1f\\x80-\\xa0\\xad\\u1680\\u180E\\u2000-\\u200f\\u2028\\u2029\\u202F\\u205F\\u3000\\uFEFF\\uFFF9-\\uFFFC])|[\\u1100-\\u115F\\u11A3-\\u11A7\\u11FA-\\u11FF\\u2329-\\u232A\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u2FFB\\u3000-\\u303E\\u3041-\\u3096\\u3099-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u3190-\\u31BA\\u31C0-\\u31E3\\u31F0-\\u321E\\u3220-\\u3247\\u3250-\\u32FE\\u3300-\\u4DBF\\u4E00-\\uA48C\\uA490-\\uA4C6\\uA960-\\uA97C\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFAFF\\uFE10-\\uFE19\\uFE30-\\uFE52\\uFE54-\\uFE66\\uFE68-\\uFE6B\\uFF01-\\uFF60\\uFFE0-\\uFFE6]/g,function(t,e,n,a){if(e)return p.showInvisibles?''+m.stringRepeat(p.SPACE_CHAR,t.length)+'':t;if('&'==t)return'&';if('<'==t)return'<';if('>'==t)return'>';if('\\t'==t){var r=p.session.getScreenTabSize(d+a);return d+=r-1,p.$tabStrings[r]}if('\\u3000'==t){var o=p.showInvisibles?'ace_cjk ace_invisible ace_invisible_space':'ace_cjk',i=p.showInvisibles?p.SPACE_CHAR:'';return d+=1,''+i+''}return n?''+p.SPACE_CHAR+'':(d+=1,''+t+'')});if(this.$textToken[e.type])r.push(n);else{var o='ace_'+e.type.replace(/\\./g,' ace_'),a='';'fold'==e.type&&(a=' style=\\'width:'+e.value.length*this.config.characterWidth+'px;\\' '),r.push('',n,'')}return d+t.length},this.renderIndentGuide=function(a,e,t){var n=e.search(this.$indentGuideRe);return 0>=n||n>=t?e:' '==e[0]?(n-=n%this.tabSize,a.push(m.stringRepeat(this.$tabStrings[' '],n/this.tabSize)),e.substr(n)):'\\t'==e[0]?(a.push(m.stringRepeat(this.$tabStrings['\\t'],n)),e.substr(n)):e},this.$renderWrappedLine=function(r,e,t,n){for(var i=0,o=0,s=t[0],a=0,l=0;l=s;)a=this.$renderToken(r,a,c,p.substring(0,s-i)),p=p.substring(s-i),i=s,n||r.push('','
                                          '),r.push(m.stringRepeat('\\xA0',t.indent)),a=0,s=t[++o]||d;0!=p.length&&(i+=p.length,a=this.$renderToken(r,a,c,p))}}},this.$renderSimpleLine=function(a,e){var t=0,n=e[0],i=n.value;this.displayIndentGuides&&(i=this.renderIndentGuide(a,i)),i&&(t=this.$renderToken(a,t,n,i));for(var o=1;o'),i.length){var o=this.session.getRowSplitData(e);o&&o.length?this.$renderWrappedLine(a,i,o,t):this.$renderSimpleLine(a,i)}this.showInvisibles&&(n&&(e=n.end.row),a.push('',e==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,'')),t||a.push('
                                          ')},this.$getFoldLineTokens=function(a,e){var l=this.session,d=[],n=l.getTokens(a);return e.walk(function(o,i,t,r,s){null==o?(s&&(n=l.getTokens(i)),n.length&&function(a,e,t){for(var n=0,o=0;o+a[n].value.lengtht-e&&(r=r.substring(0,t-e)),d.push({type:a[n].type,value:r}),o=e+r.length,n+=1);ot?d.push({type:a[n].type,value:r.substring(0,t-o)}):d.push(a[n]),o+=r.length,n+=1}}(n,r,t)):d.push({type:'fold',value:o})},e.end.row,this.session.getLine(e.end.row).length),d},this.$useLineGroups=function(){return this.session.getUseWrapMode()},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$measureNode&&this.$measureNode.parentNode.removeChild(this.$measureNode),delete this.$measureNode}}).call(o.prototype),e.Text=o}),ace.define('ace/layer/cursor',['require','exports','module','ace/lib/dom'],function(n,e){'use strict';var a=n('../lib/dom'),t=function(t){this.element=a.createElement('div'),this.element.className='ace_layer ace_cursor-layer',t.appendChild(this.element),void 0==r&&(r=!('opacity'in this.element.style)),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),a.addCssClass(this.element,'ace_hidden-cursors'),this.$updateCursors=(r?this.$updateVisibility:this.$updateOpacity).bind(this)},r;(function(){this.$updateVisibility=function(a){for(var e=this.cursors,t=e.length;t--;)e[t].style.visibility=a?'':'hidden'},this.$updateOpacity=function(a){for(var e=this.cursors,t=e.length;t--;)e[t].style.opacity=a?'':'0'},this.$padding=0,this.setPadding=function(t){this.$padding=t},this.setSession=function(t){this.session=t},this.setBlinking=function(t){t!=this.isBlinking&&(this.isBlinking=t,this.restartTimer())},this.setBlinkInterval=function(t){t!=this.blinkInterval&&(this.blinkInterval=t,this.restartTimer())},this.setSmoothBlinking=function(t){t==this.smoothBlinking||r||(this.smoothBlinking=t,a.setCssClass(this.element,'ace_smooth-blinking',t),this.$updateCursors(!0),this.$updateCursors=this.$updateOpacity.bind(this),this.restartTimer())},this.addCursor=function(){var t=a.createElement('div');return t.className='ace_cursor',this.element.appendChild(t),this.cursors.push(t),t},this.removeCursor=function(){if(1l.height+l.offset||0>o.top)&&1n;)this.removeCursor();var s=this.session.getOverwrite();this.$setOverwrite(s),this.$pixelPos=o,this.restartTimer()},this.drawCursor=null,this.$setOverwrite=function(t){t!=this.overwrite&&(this.overwrite=t,t?a.addCssClass(this.element,'ace_overwrite-cursors'):a.removeCssClass(this.element,'ace_overwrite-cursors'))},this.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)}}).call(t.prototype),e.Cursor=t}),ace.define('ace/scrollbar',['require','exports','module','ace/lib/oop','ace/lib/dom','ace/lib/event','ace/lib/event_emitter'],function(n,e){'use strict';var t=n('./lib/oop'),i=n('./lib/dom'),o=n('./lib/event'),r=n('./lib/event_emitter').EventEmitter,s=function(t){this.element=i.createElement('div'),this.element.className='ace_scrollbar ace_scrollbar'+this.classSuffix,this.inner=i.createElement('div'),this.inner.className='ace_scrollbar-inner',this.element.appendChild(this.inner),t.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,o.addListener(this.element,'scroll',this.onScroll.bind(this)),o.addListener(this.element,'mousedown',o.preventDefault)};(function(){t.implement(this,r),this.setVisible=function(t){this.element.style.display=t?'':'none',this.isVisible=t,this.coeff=1}}).call(s.prototype);var a=function(n,e){s.call(this,n),this.scrollTop=0,this.scrollHeight=0,e.$scrollbarWidth=this.width=i.scrollbarWidth(n.ownerDocument),this.inner.style.width=this.element.style.width=(this.width||15)+5+'px',this.$minWidth=0};t.inherits(a,s),function(){this.classSuffix='-v',this.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var t=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-t)/(this.coeff-t)}this._emit('scroll',{data:this.scrollTop})}this.skipEvent=!1},this.getWidth=function(){return S(this.isVisible?this.width:0,this.$minWidth||0)},this.setHeight=function(t){this.element.style.height=t+'px'},this.setInnerHeight=this.setScrollHeight=function(t){this.scrollHeight=t,32768e?50:100,n.parentNode.removeChild(n)},this.$setMeasureNodeStyles=function(n,e){n.width=n.height='auto',n.left=n.top='0px',n.visibility='hidden',n.position='absolute',n.whiteSpace='pre',8>r.isIE?n['font-family']='inherit':n.font='inherit',n.overflow=e?'hidden':'visible'},this.checkForSizeChanges=function(){var n=this.$measureSizes();if(n&&(this.$characterSize.width!==n.width||this.$characterSize.height!==n.height)){this.$measureNode.style.fontWeight='bold';var a=this.$measureSizes();this.$measureNode.style.fontWeight='',this.$characterSize=n,this.charSizes=Object.create(null),this.allowBoldFonts=a&&a.width===n.width&&a.height===n.height,this._emit('changeCharacterSize',{data:n})}},this.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer)return this.$pollSizeChangesTimer;var t=this;return this.$pollSizeChangesTimer=setInterval(function(){t.checkForSizeChanges()},500)},this.setPolling=function(t){t?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},this.$measureSizes=function(){if(50==a){var n=null;try{n=this.$measureNode.getBoundingClientRect()}catch(e){n={width:0,height:0}}var e={height:n.height,width:n.width/a}}else e={height:this.$measureNode.clientHeight,width:this.$measureNode.clientWidth/a};return 0===e.width||0===e.height?null:e},this.$measureCharWidth=function(t){return this.$main.innerHTML=o.stringRepeat(t,a),this.$main.getBoundingClientRect().width/a},this.getCharacterWidth=function(n){var e=this.charSizes[n];return void 0===e&&(e=this.charSizes[n]=this.$measureCharWidth(n)/this.$characterSize.width),e},this.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)}}).call(l.prototype)}),ace.define('ace/virtual_renderer',['require','exports','module','ace/lib/oop','ace/lib/dom','ace/config','ace/lib/useragent','ace/layer/gutter','ace/layer/marker','ace/layer/text','ace/layer/cursor','ace/scrollbar','ace/scrollbar','ace/renderloop','ace/layer/font_metrics','ace/lib/event_emitter'],function(n,e){'use strict';var t=n('./lib/oop'),E=n('./lib/dom'),o=n('./config'),r=n('./lib/useragent'),s=n('./layer/gutter').Gutter,a=n('./layer/marker').Marker,l=n('./layer/text').Text,c=n('./layer/cursor').Cursor,u=n('./scrollbar').HScrollBar,h=n('./scrollbar').VScrollBar,d=n('./renderloop').RenderLoop,m=n('./layer/font_metrics').FontMetrics,i=n('./lib/event_emitter').EventEmitter;E.importCssString('.ace_editor {position: relative;overflow: hidden;font: 12px/normal \\'Monaco\\', \\'Menlo\\', \\'Ubuntu Mono\\', \\'Consolas\\', \\'source-code-pro\\', monospace;direction: ltr;text-align: left;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.ace_scroller {position: absolute;overflow: hidden;top: 0;bottom: 0;background-color: inherit;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;cursor: text;}.ace_content {position: absolute;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;min-width: 100%;}.ace_dragging .ace_scroller:before{position: absolute;top: 0;left: 0;right: 0;bottom: 0;content: \\'\\';background: rgba(250, 250, 250, 0.01);z-index: 1000;}.ace_dragging.ace_dark .ace_scroller:before{background: rgba(0, 0, 0, 0.01);}.ace_selecting, .ace_selecting * {cursor: text !important;}.ace_gutter {position: absolute;overflow : hidden;width: auto;top: 0;bottom: 0;left: 0;cursor: default;z-index: 4;-ms-user-select: none;-moz-user-select: none;-webkit-user-select: none;user-select: none;}.ace_gutter-active-line {position: absolute;left: 0;right: 0;}.ace_scroller.ace_scroll-left {box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;}.ace_gutter-cell {padding-left: 19px;padding-right: 6px;background-repeat: no-repeat;}.ace_gutter-cell.ace_error {background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==\");background-repeat: no-repeat;background-position: 2px center;}.ace_gutter-cell.ace_warning {background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==\");background-position: 2px center;}.ace_gutter-cell.ace_info {background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=\");background-position: 2px center;}.ace_dark .ace_gutter-cell.ace_info {background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC\");}.ace_scrollbar {position: absolute;right: 0;bottom: 0;z-index: 6;}.ace_scrollbar-inner {position: absolute;cursor: text;left: 0;top: 0;}.ace_scrollbar-v{overflow-x: hidden;overflow-y: scroll;top: 0;}.ace_scrollbar-h {overflow-x: scroll;overflow-y: hidden;left: 0;}.ace_print-margin {position: absolute;height: 100%;}.ace_text-input {position: absolute;z-index: 0;width: 0.5em;height: 1em;opacity: 0;background: transparent;-moz-appearance: none;appearance: none;border: none;resize: none;outline: none;overflow: hidden;font: inherit;padding: 0 1px;margin: 0 -1px;text-indent: -1em;-ms-user-select: text;-moz-user-select: text;-webkit-user-select: text;user-select: text;white-space: pre!important;}.ace_text-input.ace_composition {background: inherit;color: inherit;z-index: 1000;opacity: 1;text-indent: 0;}.ace_layer {z-index: 1;position: absolute;overflow: hidden;word-wrap: normal;white-space: pre;height: 100%;width: 100%;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;pointer-events: none;}.ace_gutter-layer {position: relative;width: auto;text-align: right;pointer-events: auto;}.ace_text-layer {font: inherit !important;}.ace_cjk {display: inline-block;text-align: center;}.ace_cursor-layer {z-index: 4;}.ace_cursor {z-index: 4;position: absolute;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;border-left: 2px solid;transform: translatez(0);}.ace_multiselect .ace_cursor {border-left-width: 1px;}.ace_slim-cursors .ace_cursor {border-left-width: 1px;}.ace_overwrite-cursors .ace_cursor {border-left-width: 0;border-bottom: 1px solid;}.ace_hidden-cursors .ace_cursor {opacity: 0.2;}.ace_smooth-blinking .ace_cursor {-webkit-transition: opacity 0.18s;transition: opacity 0.18s;}.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {position: absolute;z-index: 3;}.ace_marker-layer .ace_selection {position: absolute;z-index: 5;}.ace_marker-layer .ace_bracket {position: absolute;z-index: 6;}.ace_marker-layer .ace_active-line {position: absolute;z-index: 2;}.ace_marker-layer .ace_selected-word {position: absolute;z-index: 4;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;}.ace_line .ace_fold {-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;display: inline-block;height: 11px;margin-top: -2px;vertical-align: middle;background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\"),url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=\");background-repeat: no-repeat, repeat-x;background-position: center center, top left;color: transparent;border: 1px solid black;border-radius: 2px;cursor: pointer;pointer-events: auto;}.ace_dark .ace_fold {}.ace_fold:hover{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII=\"),url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC\");}.ace_tooltip {background-color: #FFF;background-image: -webkit-linear-gradient(top, transparent, rgba(0, 0, 0, 0.1));background-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.1));border: 1px solid gray;border-radius: 1px;box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);color: black;max-width: 100%;padding: 3px 4px;position: fixed;z-index: 999999;-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;cursor: default;white-space: pre;word-wrap: break-word;line-height: normal;font-style: normal;font-weight: normal;letter-spacing: normal;pointer-events: none;}.ace_folding-enabled > .ace_gutter-cell {padding-right: 13px;}.ace_fold-widget {-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;margin: 0 -12px 0 1px;display: none;width: 11px;vertical-align: top;background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==\");background-repeat: no-repeat;background-position: center;border-radius: 3px;border: 1px solid transparent;cursor: pointer;}.ace_folding-enabled .ace_fold-widget {display: inline-block; }.ace_fold-widget.ace_end {background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==\");}.ace_fold-widget.ace_closed {background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==\");}.ace_fold-widget:hover {border: 1px solid rgba(0, 0, 0, 0.3);background-color: rgba(255, 255, 255, 0.2);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);}.ace_fold-widget:active {border: 1px solid rgba(0, 0, 0, 0.4);background-color: rgba(0, 0, 0, 0.05);box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);}.ace_dark .ace_fold-widget {background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC\");}.ace_dark .ace_fold-widget.ace_end {background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==\");}.ace_dark .ace_fold-widget.ace_closed {background-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==\");}.ace_dark .ace_fold-widget:hover {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);background-color: rgba(255, 255, 255, 0.1);}.ace_dark .ace_fold-widget:active {box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);}.ace_fold-widget.ace_invalid {background-color: #FFB4B4;border-color: #DE5555;}.ace_fade-fold-widgets .ace_fold-widget {-webkit-transition: opacity 0.4s ease 0.05s;transition: opacity 0.4s ease 0.05s;opacity: 0;}.ace_fade-fold-widgets:hover .ace_fold-widget {-webkit-transition: opacity 0.05s ease 0.05s;transition: opacity 0.05s ease 0.05s;opacity:1;}.ace_underline {text-decoration: underline;}.ace_bold {font-weight: bold;}.ace_nobold .ace_bold {font-weight: normal;}.ace_italic {font-style: italic;}.ace_error-marker {background-color: rgba(255, 0, 0,0.2);position: absolute;z-index: 9;}.ace_highlight-marker {background-color: rgba(255, 255, 0,0.2);position: absolute;z-index: 8;}.ace_br1 {border-top-left-radius : 3px;}.ace_br2 {border-top-right-radius : 3px;}.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}.ace_br4 {border-bottom-right-radius: 3px;}.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}.ace_br8 {border-bottom-left-radius : 3px;}.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}.ace_text-input-ios {position: absolute !important;top: -100000px !important;left: -100000px !important;}','ace_editor.css');var f=function(p,e){var t=this;this.container=p||E.createElement('div'),this.$keepTextAreaAtCursor=!r.isOldIE,E.addCssClass(this.container,'ace_editor'),this.setTheme(e),this.$gutter=E.createElement('div'),this.$gutter.className='ace_gutter',this.container.appendChild(this.$gutter),this.scroller=E.createElement('div'),this.scroller.className='ace_scroller',this.container.appendChild(this.scroller),this.content=E.createElement('div'),this.content.className='ace_content',this.scroller.appendChild(this.content),this.$gutterLayer=new s(this.$gutter),this.$gutterLayer.on('changeGutterWidth',this.onGutterResize.bind(this)),this.$markerBack=new a(this.content);var n=this.$textLayer=new l(this.content);this.canvas=n.element,this.$markerFront=new a(this.content),this.$cursorLayer=new c(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new h(this.container,this),this.scrollBarH=new u(this.container,this),this.scrollBarV.addEventListener('scroll',function(n){t.$scrollAnimation||t.session.setScrollTop(n.data-t.scrollMargin.top)}),this.scrollBarH.addEventListener('scroll',function(n){t.$scrollAnimation||t.session.setScrollLeft(n.data-t.scrollMargin.left)}),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new m(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.addEventListener('changeCharacterSize',function(n){t.updateCharacterSize(),t.onResize(!0,t.gutterWidth,t.$size.width,t.$size.height),t._signal('changeCharacterSize',n)}),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$loop=new d(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),o.resetOptions(this),o._emit('renderer',this)};(function(){this.CHANGE_CURSOR=1,this.CHANGE_MARKER=2,this.CHANGE_GUTTER=4,this.CHANGE_SCROLL=8,this.CHANGE_LINES=16,this.CHANGE_TEXT=32,this.CHANGE_SIZE=64,this.CHANGE_MARKER_BACK=128,this.CHANGE_MARKER_FRONT=256,this.CHANGE_FULL=512,this.CHANGE_H_SCROLL=1024,t.implement(this,i),this.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle('ace_nobold',!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin()},this.setSession=function(t){this.session&&this.session.doc.off('changeNewLineMode',this.onChangeNewLineMode),this.session=t,t&&this.scrollMargin.top&&0>=t.getScrollTop()&&t.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(t),this.$markerBack.setSession(t),this.$markerFront.setSession(t),this.$gutterLayer.setSession(t),this.$textLayer.setSession(t),t&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on('changeNewLineMode',this.onChangeNewLineMode))},this.updateLines=function(a,r,o){if(void 0===r&&(r=1/0),this.$changedLines?(this.$changedLines.firstRow>a&&(this.$changedLines.firstRow=a),this.$changedLines.lastRowthis.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},this.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar()},this.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},this.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},this.updateFull=function(t){t?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},this.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},this.$changes=0,this.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},this.onResize=function(a,e,t,s){if(!(2e||e>a.height-i)n.top=n.left='0';else{var o=this.characterWidth;if(this.$composition){var r=this.textarea.value.replace(/^\\x01+/,'');o*=this.session.$getStringScreenWidth(r)[0]+2,i+=2}(t-=this.scrollLeft)>this.$size.scrollerWidth-o&&(t=this.$size.scrollerWidth-o),t+=this.gutterWidth,n.height=i+'px',n.width=o+'px',n.left=b(t,this.$size.scrollerWidth-o)+'px',n.top=b(e,this.$size.height-i)+'px'}}},this.getFirstVisibleRow=function(){return this.layerConfig.firstRow},this.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},this.getLastFullyVisibleRow=function(){var n=this.layerConfig,e=n.lastRow;return this.session.documentToScreenRow(e,0)*n.lineHeight-this.session.getScrollTop()>n.height-n.lineHeight?e-1:e},this.getLastVisibleRow=function(){return this.layerConfig.lastRow},this.$padding=null,this.setPadding=function(t){this.$padding=t,this.$textLayer.setPadding(t),this.$cursorLayer.setPadding(t),this.$markerFront.setPadding(t),this.$markerBack.setPadding(t),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},this.setScrollMargin=function(a,e,t,n){var r=this.scrollMargin;r.top=0|a,r.bottom=0|e,r.right=0|n,r.left=0|t,r.v=r.top+r.bottom,r.h=r.left+r.right,r.top&&0>=this.scrollTop&&this.session&&this.session.setScrollTop(-r.top),this.updateFull()},this.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},this.setHScrollBarAlwaysVisible=function(t){this.setOption('hScrollBarAlwaysVisible',t)},this.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},this.setVScrollBarAlwaysVisible=function(t){this.setOption('vScrollBarAlwaysVisible',t)},this.$updateScrollBarV=function(){var n=this.layerConfig.maxHeight,e=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(n-=(e-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>n-e&&(n=this.scrollTop+e,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(n+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},this.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},this.$frozen=!1,this.freeze=function(){this.$frozen=!0},this.unfreeze=function(){this.$frozen=!1},this.$renderChanges=function(a,e){if(this.$changes&&(a|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(a||e)){if(this.$size.$dirty)return this.$changes|=a,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal('beforeRender');var t=this.layerConfig;if(a&this.CHANGE_FULL||a&this.CHANGE_SIZE||a&this.CHANGE_TEXT||a&this.CHANGE_LINES||a&this.CHANGE_SCROLL||a&this.CHANGE_H_SCROLL){if(a|=this.$computeLayerConfig(),t.firstRow!=this.layerConfig.firstRow&&t.firstRowScreen==this.layerConfig.firstRowScreen){var n=this.scrollTop+(t.firstRow-this.layerConfig.firstRow)*this.lineHeight;0=this.scrollLeft?'ace_scroller':'ace_scroller ace_scroll-left'),a&this.CHANGE_FULL)return this.$textLayer.update(t),this.$showGutter&&this.$gutterLayer.update(t),this.$markerBack.update(t),this.$markerFront.update(t),this.$cursorLayer.update(t),this.$moveTextAreaToCursor(),this.$highlightGutterLine&&this.$updateGutterLineHighlight(),void this._signal('afterRender');if(a&this.CHANGE_SCROLL)return a&this.CHANGE_TEXT||a&this.CHANGE_LINES?this.$textLayer.update(t):this.$textLayer.scrollLines(t),this.$showGutter&&this.$gutterLayer.update(t),this.$markerBack.update(t),this.$markerFront.update(t),this.$cursorLayer.update(t),this.$highlightGutterLine&&this.$updateGutterLineHighlight(),this.$moveTextAreaToCursor(),void this._signal('afterRender');a&this.CHANGE_TEXT?(this.$textLayer.update(t),this.$showGutter&&this.$gutterLayer.update(t)):a&this.CHANGE_LINES?(this.$updateLines()||a&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(t):(a&this.CHANGE_TEXT||a&this.CHANGE_GUTTER)&&this.$showGutter&&this.$gutterLayer.update(t),a&this.CHANGE_CURSOR&&(this.$cursorLayer.update(t),this.$moveTextAreaToCursor(),this.$highlightGutterLine&&this.$updateGutterLineHighlight()),a&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(t),a&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(t),this._signal('afterRender')}else this.$changes|=a},this.$autosize=function(){var a=this.session.getScreenLength()*this.lineHeight,e=this.$maxLines*this.lineHeight,t=b(e,S((this.$minLines||1)*this.lineHeight,a))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(t+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&t>this.$maxPixelHeight&&(t=this.$maxPixelHeight);var n=a>e;if(t!=this.desiredHeight||this.$size.height!=this.desiredHeight||n!=this.$vScroll){n!=this.$vScroll&&(this.$vScroll=n,this.scrollBarV.setVisible(n));var r=this.container.clientWidth;this.container.style.height=t+'px',this.$updateCachedSize(!0,this.$gutterWidth,r,t),this.desiredHeight=t,this._signal('autosize')}},this.$computeLayerConfig=function(){var x=this.session,e=this.$size,t=e.height<=2*this.lineHeight,R=this.session.getScreenLength()*this.lineHeight,F=this.$getLongestLine(),w=!t&&(this.$hScrollBarAlwaysVisible||0>e.scrollerWidth-F-2*this.$padding),r=this.$horizScroll!==w;r&&(this.$horizScroll=w,this.scrollBarH.setVisible(w));var s=this.$vScroll;this.$maxLines&&1e.scrollerHeight-R+L||this.scrollTop>u.top),d=s!==h;d&&(this.$vScroll=h,this.scrollBarV.setVisible(h));var m=T(M/this.lineHeight)-1,g=S(0,y((this.scrollTop-a)/this.lineHeight)),B=g+m,D=this.lineHeight,I,N;g=x.screenToDocumentRow(g,0);var f=x.getFoldLine(g);f&&(g=f.start.row),I=x.documentToScreenRow(g,0),N=x.getRowLength(g)*D,B=b(x.screenToDocumentRow(B,0),x.getLength()-1),M=e.scrollerHeight+x.getRowLength(B)*D+N,a=this.scrollTop-I*D;var v=0;return this.layerConfig.width!=F&&(v=this.CHANGE_H_SCROLL),(r||d)&&(v=this.$updateCachedSize(!0,this.gutterWidth,e.width,e.height),this._signal('scrollbarVisibilityChanged'),d&&(F=this.$getLongestLine())),this.layerConfig={width:F,padding:this.$padding,firstRow:g,firstRowScreen:I,lastRow:B,lineHeight:D,characterWidth:this.characterWidth,minHeight:M,maxHeight:R,offset:a,gutterOffset:D?S(0,T((a+e.height-e.scrollerHeight)/D)):0,height:this.$size.scrollerHeight},v},this.$updateLines=function(){if(this.$changedLines){var a=this.$changedLines.firstRow,e=this.$changedLines.lastRow;this.$changedLines=null;var t=this.layerConfig;if(!(a>t.lastRow+1||eo?(e&&a+r>o+this.lineHeight&&(o-=e*this.$size.scrollerHeight),0==o&&(o=-this.scrollMargin.top),this.session.setScrollTop(o)):a+this.$size.scrollerHeight-si?(ie&&this.session.getScrollTop()>=1-this.scrollMargin.top||0n&&this.session.getScrollLeft()>=1-this.scrollMargin.left||0this.$doc.getLength()>>1?this.call('setValue',[this.$doc.getValue()]):this.emit('change',{data:t}))}}).call(n.prototype);var r=function(r,e,t){this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.callbackId=1,this.callbacks={},this.messageBuffer=[];var n=null,i=!1,o=Object.create(p),a=this;this.$worker={},this.$worker.terminate=function(){},this.$worker.postMessage=function(t){a.messageBuffer.push(t),n&&(i?setTimeout(s):s())},this.setEmitSync=function(t){i=t};var s=function(){var t=a.messageBuffer.shift();t.command?n[t.command].apply(n,t.args):t.event&&o._signal(t.event,t.data)};o.postMessage=function(t){a.onMessage({data:t})},o.callback=function(n,a){this.postMessage({type:'call',id:a,data:n})},o.emit=function(n,a){this.postMessage({type:'event',name:n,data:a})},u.loadModule(['worker',e],function(r){for(n=new r[t](o);a.messageBuffer.length;)s()})};r.prototype=n.prototype,e.UIWorkerClient=r,e.WorkerClient=n,e.createWorker=a}),ace.define('ace/placeholder',['require','exports','module','ace/range','ace/lib/event_emitter','ace/lib/oop'],function(n,e){'use strict';var d=n('./range').Range,t=n('./lib/event_emitter').EventEmitter,a=n('./lib/oop'),r=function(l,e,t,n,i,o){var r=this;this.length=e,this.session=l,this.doc=l.getDocument(),this.mainClass=i,this.othersClass=o,this.$onUpdate=this.onUpdate.bind(this),this.doc.on('change',this.$onUpdate),this.$others=n,this.$onCursorChange=function(){setTimeout(function(){r.onCursorChange()})},this.$pos=t;var s=l.getUndoManager().$undoStack||l.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=s.length,this.setup(),l.selection.on('changeCursor',this.$onCursorChange)};(function(){a.implement(this,t),this.setup=function(){var a=this,e=this.doc,t=this.session;this.selectionBefore=t.selection.toJSON(),t.selection.inMultiSelectMode&&t.selection.toSingleRange(),this.pos=e.createAnchor(this.$pos.row,this.$pos.column);var n=this.pos;n.$insertRight=!0,n.detach(),n.markerId=t.addMarker(new d(n.row,n.column,n.row,n.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach(function(t){var n=e.createAnchor(t.row,t.column);n.$insertRight=!0,n.detach(),a.others.push(n)}),t.setUndoSelect(!1)},this.showOtherMarkers=function(){if(!this.othersActive){var a=this.session,e=this;this.othersActive=!0,this.others.forEach(function(t){t.markerId=a.addMarker(new d(t.row,t.column,t.row,t.column+e.length),e.othersClass,null,!1)})}},this.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var t=0;t=this.pos.column&&e.start.column<=this.pos.column+this.length+1,o=e.start.column-this.pos.column;if(this.updateAnchors(i),n&&(this.length+=t),n&&!this.session.$fromUndo)if('insert'===i.action)for(var r=this.others.length-1,s;0<=r;r--)s={row:(a=this.others[r]).row,column:a.column+o},this.doc.insertMergedLines(s,i.lines);else if('remove'===i.action)for(r=this.others.length-1;0<=r;r--){var a;s={row:(a=this.others[r]).row,column:a.column+o},this.doc.remove(new d(s.row,s.column,s.row,s.column-t))}this.$updating=!1,this.updateMarkers()}},this.updateAnchors=function(n){this.pos.onChange(n);for(var e=this.others.length;e--;)this.others[e].onChange(n);this.updateMarkers()},this.updateMarkers=function(){if(!this.$updating){var a=this,e=this.session,t=function(t,n){e.removeMarker(t.markerId),t.markerId=e.addMarker(new d(t.row,t.column,t.row,t.column+a.length),n,null,!1)};t(this.pos,this.mainClass);for(var n=this.others.length;n--;)t(this.others[n],this.othersClass)}},this.onCursorChange=function(n){if(!this.$updating&&this.session){var e=this.session.selection.getCursor();e.row===this.pos.row&&e.column>=this.pos.column&&e.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit('cursorEnter',n)):(this.hideOtherMarkers(),this._emit('cursorLeave',n))}},this.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.removeEventListener('change',this.$onUpdate),this.session.selection.removeEventListener('changeCursor',this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},this.cancel=function(){if(-1!==this.$undoStackDepth){for(var a=this.session.getUndoManager(),e=(a.$undoStack||a.$undostack).length-this.$undoStackDepth,t=0;tr&&(r=0),0>c&&(c=0),c==h&&(t=!0);for(var d=c,m;d<=h;d++){if(m=g.fromPoints(this.session.screenToDocumentPosition(d,r),this.session.screenToDocumentPosition(d,s)),m.isEmpty()){if(p&&(u=m.end,l=p,u.row==l.row&&u.column==l.column))break;var p=m.end}m.cursor=i?m.start:m.end,_.push(m)}if(a&&_.reverse(),!t){for(var f=_.length-1;_[f].isEmpty()&&0=y;C--)_[C].isEmpty()&&_.splice(C,1)}return _}}.call(E.prototype);var l=n('./editor').Editor;(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(n){n.cursor||(n.cursor=n.end);var e=this.getSelectionStyle();return n.marker=this.session.addMarker(n,'ace_selection',e),this.session.$selectionMarkers.push(n),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,n},this.removeSelectionMarker=function(n){if(n.marker){this.session.removeMarker(n.marker);var e=this.session.$selectionMarkers.indexOf(n);-1!=e&&this.session.$selectionMarkers.splice(e,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(a){for(var e=this.session.$selectionMarkers,t=a.length,n;t--;)if(n=a[t],n.marker){this.session.removeMarker(n.marker);var r=e.indexOf(n);-1!=r&&e.splice(r,1)}this.session.selectionMarkerCount=e.length},this.$onAddRange=function(t){this.addSelectionMarker(t.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(t){this.removeSelectionMarkers(t.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle('ace_multiselect'),this.keyBinding.addKeyboardHandler(a.keyboardHandler),this.commands.setDefaultHandler('exec',this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle('ace_multiselect'),this.keyBinding.removeKeyboardHandler(a.keyboardHandler),this.commands.removeDefaultHandler('exec',this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit('changeSelection'))},this.$onMultiSelectExec=function(a){var e=a.command,t=a.editor;if(t.multiSelect){if(e.multiSelectAction)'forEach'==e.multiSelectAction?n=t.forEachSelection(e,a.args):'forEachLine'==e.multiSelectAction?n=t.forEachSelection(e,a.args,!0):'single'==e.multiSelectAction?(t.exitMultiSelectMode(),n=e.exec(t,a.args||{})):n=e.multiSelectAction(t,a.args||{});else{var n=e.exec(t,a.args||{});t.multiSelect.addRange(t.multiSelect.toOrientedRange()),t.multiSelect.mergeOverlappingRanges()}return n}},this.forEachSelection=function(r,e,t){if(!this.inVirtualSelectionMode){var n=t&&t.keepOrder,o=1==t||t&&t.$byLines,s=this.session,a=this.selection,l=a.rangeList,c=(n?a:l).ranges,u;if(!c.length)return r.exec?r.exec(this,e||{}):r(this,e||{});var i=a._eventRegistry;a._eventRegistry={};var g=new E(s);this.inVirtualSelectionMode=!0;for(var d=c.length;d--;){if(o)for(;0l?r.unshift(r.pop()):r.push(r.shift()),i=n.length;i--;)o=(s=n[i]).clone(),e.replace(s,r[i]),s.start.row=o.start.row,s.start.column=o.start.column},this.selectMore=function(a,e,t){var s=this.session,l=s.multiSelect.toOrientedRange();if(!l.isEmpty()||((l=s.getWordRange(l.start.row,l.start.column)).cursor=-1==a?l.start:l.end,this.multiSelect.addRange(l),!t)){var o=function(a,e,t){return i.$options.wrap=!0,i.$options.needle=e,i.$options.backwards=-1==t,i.find(a)}(s,s.getTextRange(l),a);o&&(o.cursor=-1==a?o.start:o.end,this.$blockScrolling+=1,this.session.unfold(o),this.multiSelect.addRange(o),this.$blockScrolling-=1,this.renderer.scrollCursorIntoView(null,.5)),e&&this.multiSelect.substractPoint(l.cursor)}},this.alignCursors=function(){var l=this.session,E=l.multiSelect,e=E.ranges,t=-1,n=e.filter(function(n){return!(n.cursor.row!=t)||void(t=n.cursor.row)});if(e.length&&n.length!=e.length-1){n.forEach(function(t){E.substractPoint(t.cursor)});var _=0,s=1/0,a=e.map(function(e){var t=e.cursor,n=l.getLine(t.row).substr(t.column).search(/\\S/g);return-1==n&&(n=0),t.column>_&&(_=t.column),nr?l.insert(n,o.stringRepeat(' ',i-r)):l.remove(new g(n.row,n.column,n.row,n.column-i+r)),e.start.column=e.end.column=_,e.start.row=e.end.row=n.row,e.cursor=e.end}),E.fromOrientedRange(e[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var r=this.selection.getRange(),i=r.start.row,c=r.end.row,d=i==c;if(d){var u=this.session.getLength(),m;do m=this.session.getLine(c);while(/[=:]/.test(m)&&++ci&&(i=0),c>=u&&(c=u-1)}var p=this.session.removeFullLines(i,c);p=this.$reAlignText(p,d),this.session.insert({row:i,column:0},p.join('\\n')+'\\n'),d||(r.start.column=0,r.end.column=p[p.length-1].length),this.selection.setRange(r)}},this.$reAlignText=function(l,e){function a(t){return o.stringRepeat(' ',t)}function c(t){return t[2]?a(s)+t[2]+a(n-t[2].length+i)+t[4].replace(/^([=:])\\s+/,'$1 '):t[0]}var d=!0,r=!0,s,n,i;return l.map(function(a){var e=a.match(/(\\s*)(.*?)(\\s*)([=:].*)/);return e?null==s?(s=e[1].length,n=e[2].length,i=e[3].length,e):(s+n+i!=e[1].length+e[2].length+e[3].length&&(r=!1),s!=e[1].length&&(d=!1),s>e[1].length&&(s=e[1].length),ne[3].length&&(i=e[3].length),e):[a]}).map(e?c:d?r?function(t){return t[2]?a(s+n-t[2].length)+t[2]+a(i)+t[4].replace(/^([=:])\\s+/,'$1 '):t[0]}:c:function(t){return t[2]?a(s)+t[2]+a(i)+t[4].replace(/^([=:])\\s+/,'$1 '):t[0]})}}).call(l.prototype),p.onSessionChange=function(a){var e=a.session;e&&!e.multiSelect&&(e.$selectionMarkers=[],e.selection.$initRangeList(),e.multiSelect=e.selection),this.multiSelect=e&&e.multiSelect;var t=a.oldSession;t&&(t.multiSelect.off('addRange',this.$onAddRange),t.multiSelect.off('removeRange',this.$onRemoveRange),t.multiSelect.off('multiSelect',this.$onMultiSelect),t.multiSelect.off('singleSelect',this.$onSingleSelect),t.multiSelect.lead.off('change',this.$checkMultiselectChange),t.multiSelect.anchor.off('change',this.$checkMultiselectChange)),e&&(e.multiSelect.on('addRange',this.$onAddRange),e.multiSelect.on('removeRange',this.$onRemoveRange),e.multiSelect.on('multiSelect',this.$onMultiSelect),e.multiSelect.on('singleSelect',this.$onSingleSelect),e.multiSelect.lead.on('change',this.$checkMultiselectChange),e.multiSelect.anchor.on('change',this.$checkMultiselectChange)),e&&this.inMultiSelectMode!=e.selection.inMultiSelectMode&&(e.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},p.MultiSelect=m,n('./config').defineOptions(l.prototype,'editor',{enableMultiselect:{set:function(n){m(this),n?(this.on('changeSession',this.$multiselectOnSessionChange),this.on('mousedown',t)):(this.off('changeSession',this.$multiselectOnSessionChange),this.off('mousedown',t))},value:!0},enableBlockSelect:{set:function(t){this.$blockSelectEnabled=t},value:!0}})}),ace.define('ace/mode/folding/fold_mode',['require','exports','module','ace/range'],function(n,e){'use strict';var r=n('../../range').Range,t=e.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(a,e,t){var n=a.getLine(t);return this.foldingStartMarker.test(n)?'start':'markbeginend'==e&&this.foldingStopMarker&&this.foldingStopMarker.test(n)?'end':''},this.getFoldWidgetRange=function(){return null},this.indentationBlock=function(i,e,t){var n=/\\S/,o=i.getLine(e),p=o.search(n);if(-1!=p){for(var s=t||o.length,a=i.getLength(),l=e,c=e,u;++el){var m=i.getLine(c).length;return new r(l,s,c,m)}}},this.openingBracketBlock=function(i,e,t,d,o){var c={row:t,column:d+1},s=i.$findClosingBracket(e,c,o);if(s){var a=i.foldWidgets[s.row];return null==a&&(a=i.getFoldWidget(s.row)),'start'==a&&s.row>c.row&&(s.row--,s.column=i.getLine(s.row).length),r.fromPoints(c,s)}},this.closingBracketBlock=function(i,e,t,l){var d={row:t,column:l},s=i.$findOpeningBracket(e,d);if(s)return s.column++,d.column--,r.fromPoints(s,d)}}).call(t.prototype)}),ace.define('ace/theme/textmate',['require','exports','module','ace/lib/dom'],function(n,e){'use strict';e.isDark=!1,e.cssClass='ace-tm',e.cssText='.ace-tm .ace_gutter {background: #f0f0f0;color: #333;}.ace-tm .ace_print-margin {width: 1px;background: #e8e8e8;}.ace-tm .ace_fold {background-color: #6B72E6;}.ace-tm {background-color: #FFFFFF;color: black;}.ace-tm .ace_cursor {color: black;}.ace-tm .ace_invisible {color: rgb(191, 191, 191);}.ace-tm .ace_storage,.ace-tm .ace_keyword {color: blue;}.ace-tm .ace_constant {color: rgb(197, 6, 11);}.ace-tm .ace_constant.ace_buildin {color: rgb(88, 72, 246);}.ace-tm .ace_constant.ace_language {color: rgb(88, 92, 246);}.ace-tm .ace_constant.ace_library {color: rgb(6, 150, 14);}.ace-tm .ace_invalid {background-color: rgba(255, 0, 0, 0.1);color: red;}.ace-tm .ace_support.ace_function {color: rgb(60, 76, 114);}.ace-tm .ace_support.ace_constant {color: rgb(6, 150, 14);}.ace-tm .ace_support.ace_type,.ace-tm .ace_support.ace_class {color: rgb(109, 121, 222);}.ace-tm .ace_keyword.ace_operator {color: rgb(104, 118, 135);}.ace-tm .ace_string {color: rgb(3, 106, 7);}.ace-tm .ace_comment {color: rgb(76, 136, 107);}.ace-tm .ace_comment.ace_doc {color: rgb(0, 102, 255);}.ace-tm .ace_comment.ace_doc.ace_tag {color: rgb(128, 159, 191);}.ace-tm .ace_constant.ace_numeric {color: rgb(0, 0, 205);}.ace-tm .ace_variable {color: rgb(49, 132, 149);}.ace-tm .ace_xml-pe {color: rgb(104, 104, 91);}.ace-tm .ace_entity.ace_name.ace_function {color: #0000A2;}.ace-tm .ace_heading {color: rgb(12, 7, 255);}.ace-tm .ace_list {color:rgb(185, 6, 144);}.ace-tm .ace_meta.ace_tag {color:rgb(0, 22, 142);}.ace-tm .ace_string.ace_regex {color: rgb(255, 0, 0)}.ace-tm .ace_marker-layer .ace_selection {background: rgb(181, 213, 255);}.ace-tm.ace_multiselect .ace_selection.ace_start {box-shadow: 0 0 3px 0px white;}.ace-tm .ace_marker-layer .ace_step {background: rgb(252, 255, 0);}.ace-tm .ace_marker-layer .ace_stack {background: rgb(164, 229, 101);}.ace-tm .ace_marker-layer .ace_bracket {margin: -1px 0 0 -1px;border: 1px solid rgb(192, 192, 192);}.ace-tm .ace_marker-layer .ace_active-line {background: rgba(0, 0, 0, 0.07);}.ace-tm .ace_gutter-active-line {background-color : #dcdcdc;}.ace-tm .ace_marker-layer .ace_selected-word {background: rgb(250, 250, 255);border: 1px solid rgb(200, 200, 250);}.ace-tm .ace_indent-guide {background: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==\") right repeat-y;}',n('../lib/dom').importCssString(e.cssText,e.cssClass)}),ace.define('ace/line_widgets',['require','exports','module','ace/lib/oop','ace/lib/dom','ace/range'],function(n,e){'use strict';function o(t){this.session=t,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on('change',this.updateOnChange),this.session.on('changeFold',this.updateOnFold),this.session.on('changeEditor',this.$onChangeEditor)}n('./lib/oop');var a=n('./lib/dom');n('./range').Range,function(){this.getRowLength=function(n){var e;return e=this.lineWidgets&&this.lineWidgets[n]&&this.lineWidgets[n].rowCount||0,this.$useWrapMode&&this.$wrapData[n]?this.$wrapData[n].length+1+e:1+e},this.$getWidgetScreenLength=function(){var n=0;return this.lineWidgets.forEach(function(e){e&&e.rowCount&&!e.hidden&&(n+=e.rowCount)}),n},this.$onChangeEditor=function(t){this.attach(t.editor)},this.attach=function(t){t&&t.widgetManager&&t.widgetManager!=this&&t.widgetManager.detach(),this.editor!=t&&(this.detach(),this.editor=t,t&&(t.widgetManager=this,t.renderer.on('beforeRender',this.measureWidgets),t.renderer.on('afterRender',this.renderWidgets)))},this.detach=function(){var e=this.editor;if(e){this.editor=null,e.widgetManager=null,e.renderer.off('beforeRender',this.measureWidgets),e.renderer.off('afterRender',this.renderWidgets);var t=this.session.lineWidgets;t&&t.forEach(function(t){t&&t.el&&t.el.parentNode&&(t._inDocument=!1,t.el.parentNode.removeChild(t.el))})}},this.updateOnFold=function(l,e){var t=e.lineWidgets;if(t&&l.action){for(var n=l.data,i=n.start.row,o=n.end.row,r='add'==l.action,s=i+1;s(s-=this.session.getRowLineCount(r.row))&&(s=0),r.rowCount!=s&&(r.rowCount=s,r.row>1,r=t(e,a[o]);if(0r))return o;i=o-1}}return-(n+1)}(n,{row:e,column:-1},l.comparePoints);0>i&&(i=-i-1),i>=n.length?i=0d&&(i=n.length-1);var c=n[i];if(c&&d){if(c.row===e){do c=n[i+=d];while(c&&c.row===e);if(!c)return n.slice()}var p=[];e=c.row;do p[0>d?'unshift':'push'](c),c=n[i+=d];while(c&&c.row==e);return p.length&&p}}}(t,o,e),u;if(s){var c=s[0];n.column=(c.pos&&'number'!=typeof c.column?c.pos.sc:c.column)||0,n.row=c.row,u=r.renderer.$gutterLayer.$annotations[n.row]}else{if(a)return;u={text:['Looks good!'],className:'ace_ok'}}r.session.unfold(n.row),r.selection.moveToPosition(n);var h={row:n.row,fixedWidth:!0,coverGutter:!0,el:i.createElement('div'),type:'errorMarker'},d=h.el.appendChild(i.createElement('div')),m=h.el.appendChild(i.createElement('div'));m.className='error_widget_arrow '+u.className;var p=r.renderer.$cursorLayer.getPixelPosition(n).left;m.style.left=p+r.renderer.gutterWidth-5+'px',h.el.className='error_widget_wrapper',d.className='error_widget '+u.className,d.innerHTML=u.text.join('
                                          '),d.appendChild(i.createElement('div'));var f=function(a,e,t){if(0===e&&('esc'===t||'return'===t))return h.destroy(),{command:'null'}};h.destroy=function(){r.$mouseHandler.isMousePressed||(r.keyBinding.removeKeyboardHandler(f),t.widgetManager.removeLineWidget(h),r.off('changeSelection',h.destroy),r.off('changeSession',h.destroy),r.off('mouseup',h.destroy),r.off('change',h.destroy))},r.keyBinding.addKeyboardHandler(f),r.on('changeSelection',h.destroy),r.on('changeSession',h.destroy),r.on('mouseup',h.destroy),r.on('change',h.destroy),r.session.widgetManager.addLineWidget(h),h.el.onmousedown=r.focus.bind(r),r.renderer.scrollCursorIntoView(null,.5,{bottom:h.el.offsetHeight})},i.importCssString(' .error_widget_wrapper { background: inherit; color: inherit; border:none } .error_widget { border-top: solid 2px; border-bottom: solid 2px; margin: 5px 0; padding: 10px 40px; white-space: pre-wrap; } .error_widget.ace_error, .error_widget_arrow.ace_error{ border-color: #ff5a5a } .error_widget.ace_warning, .error_widget_arrow.ace_warning{ border-color: #F1D817 } .error_widget.ace_info, .error_widget_arrow.ace_info{ border-color: #5a5a5a } .error_widget.ace_ok, .error_widget_arrow.ace_ok{ border-color: #5aaa5a } .error_widget_arrow { position: absolute; border: solid 5px; border-top-color: transparent!important; border-right-color: transparent!important; border-left-color: transparent!important; top: -5px; }','')}),ace.define('ace/ace',['require','exports','module','ace/lib/fixoldbrowsers','ace/lib/dom','ace/lib/event','ace/editor','ace/edit_session','ace/undomanager','ace/virtual_renderer','ace/worker/worker_client','ace/keyboard/hash_handler','ace/placeholder','ace/multi_select','ace/mode/folding/fold_mode','ace/theme/textmate','ace/ext/error_marker','ace/config'],function(n,d){'use strict';n('./lib/fixoldbrowsers');var t=n('./lib/dom'),o=n('./lib/event'),r=n('./editor').Editor,i=n('./edit_session').EditSession,a=n('./undomanager').UndoManager,s=n('./virtual_renderer').VirtualRenderer;n('./worker/worker_client'),n('./keyboard/hash_handler'),n('./placeholder'),n('./multi_select'),n('./mode/folding/fold_mode'),n('./theme/textmate'),n('./ext/error_marker'),d.config=n('./config'),d.require=n,d.define=_(0),d.edit=function(c){if('string'==typeof c){var p=c;if(!(c=document.getElementById(p)))throw new Error('ace.edit can\\'t find div #'+p)}if(c&&c.env&&c.env.editor instanceof r)return c.env.editor;var n='';if(c&&/input|textarea/i.test(c.tagName)){var i=c;n=i.value,c=t.createElement('pre'),i.parentNode.replaceChild(c,i)}else c&&(n=t.getInnerText(c),c.innerHTML='');var a=d.createEditSession(n),m=new r(new s(c));m.setSession(a);var g={document:a,editor:m,onResize:m.resize.bind(m,null)};return i&&(g.textarea=i),o.addListener(window,'resize',g.onResize),m.on('destroy',function(){o.removeListener(window,'resize',g.onResize),g.editor.container.env=null}),m.container.env=m.env=g,m},d.createEditSession=function(r,e){var t=new i(r,e);return t.setUndoManager(new a),t},d.EditSession=i,d.UndoManager=a,d.version='1.2.8'}),ace.require(['ace/ace'],function(n){for(var e in n&&(n.config.init(!0),n.define=ace.define),window.ace||(window.ace=n),n)n.hasOwnProperty(e)&&(window.ace[e]=n[e])}),ace.define('ace/theme/monokai',['require','exports','module','ace/lib/dom'],function(n,e){e.isDark=!0,e.cssClass='ace-monokai',e.cssText='.ace-monokai .ace_gutter { background: #222; color: #8F908A } .ace-monokai .ace_print-margin { width: 1px; background: #555651 } .ace-monokai { background-color: #222; color: #f9f9f9; font-size: 14px; } .ace-monokai .ace_cursor { color: #F8F8F0 } .ace-monokai .ace_marker-layer .ace_selection { background: #a6e22e } .ace-monokai.ace_multiselect .ace_selection.ace_start { box-shadow: 0 0 3px 0px #272822; } .ace-monokai .ace_marker-layer .ace_step { background: rgb(102, 82, 0) } .ace-monokai .ace_marker-layer .ace_bracket { margin: -1px 0 0 -1px; border: 1px solid #a6e22e } .ace-monokai .ace_marker-layer .ace_active-line { background: #2c2c2c } .ace-monokai .ace_gutter-active-line { background-color: #2c2c2c } .ace-monokai .ace_marker-layer .ace_selected-word { border: 1px solid #a6e22e } .ace-monokai .ace_invisible { color: #52524d } .ace-monokai .ace_entity.ace_name.ace_tag, .ace-monokai .ace_keyword, .ace-monokai .ace_meta.ace_tag, .ace-monokai .ace_storage { color: #F0640D } .ace-monokai .ace_punctuation, .ace-monokai .ace_punctuation.ace_tag { color: #fff } .ace-monokai .ace_constant.ace_character, .ace-monokai .ace_constant.ace_other { color: #5db0d7 } .ace-monokai .ace_constant.ace_language { color: #e6db74 } .ace-monokai .ace_constant.ace_numeric { color: #ae81ff } .ace-monokai .ace_invalid { color: #F8F8F0; background-color: #F0640D } .ace-monokai .ace_invalid.ace_deprecated { color: #F8F8F0; background-color: #5db0d7 } .ace-monokai .ace_support.ace_constant, .ace-monokai .ace_support.ace_function { color: #5db0d7 } .ace-monokai .ace_fold { background-color: #A6E22E; border-color: #F8F8F2 } .ace-monokai .ace_storage.ace_type, .ace-monokai .ace_support.ace_class, .ace-monokai .ace_support.ace_type { font-style: italic; color: #5db0d7 } .ace-monokai .ace_entity.ace_name.ace_function, .ace-monokai .ace_entity.ace_other, .ace-monokai .ace_entity.ace_other.ace_attribute-name, .ace-monokai .ace_variable { color: #A6E22E } .ace-monokai .ace_variable.ace_parameter { font-style: italic; color: #FD971F } .ace-monokai .ace_string { color: #E6DB74 } .ace-monokai .ace_comment { color: #75715E } .ace-monokai .ace_indent-guide { background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ0FD0ZXBzd/wPAAjVAoxeSgNeAAAAAElFTkSuQmCC) right repeat-y }',n('../lib/dom').importCssString(e.cssText,e.cssClass)}),ace.define('ace/ext/searchbox',['require','exports','module','ace/lib/dom','ace/lib/lang','ace/lib/event','ace/keyboard/hash_handler','ace/lib/keys'],function(n,e){'use strict';var d=n('../lib/dom'),i=n('../lib/lang'),p=n('../lib/event'),t=n('../keyboard/hash_handler').HashHandler,r=n('../lib/keys');d.importCssString(' .ace_search { background-color: #ddd; color: #666; border: 1px solid #cbcbcb; border-top: 0 none; overflow: hidden; margin: 0; padding: 4px 6px 0 4px; position: absolute; top: 0; z-index: 99; white-space: normal; } .ace_search.left { border-left: 0 none; border-radius: 0px 0px 5px 0px; left: 0; } .ace_search.right { border-radius: 0px 0px 0px 5px; border-right: 0 none; right: 0; } .ace_search_form, .ace_replace_form { margin: 0 20px 4px 0; overflow: hidden; line-height: 1.9; } .ace_replace_form { margin-right: 0; } .ace_search_form.ace_nomatch { outline: 1px solid red; } .ace_search_field { border-radius: 3px 0 0 3px; background-color: white; color: black; border: 1px solid #cbcbcb; border-right: 0 none; box-sizing: border-box!important; outline: 0; padding: 0; font-size: inherit; margin: 0; line-height: inherit; padding: 0 6px; min-width: 17em; vertical-align: top; } .ace_searchbtn { border: 1px solid #cbcbcb; line-height: inherit; display: inline-block; padding: 0 6px; background: #fff; border-right: 0 none; border-left: 1px solid #dcdcdc; cursor: pointer; margin: 0; position: relative; box-sizing: content-box!important; color: #666; } .ace_searchbtn:last-child { border-radius: 0 3px 3px 0; border-right: 1px solid #cbcbcb; } .ace_searchbtn:disabled { background: none; cursor: default; } .ace_searchbtn:hover { background-color: #eef1f6; } .ace_searchbtn.prev, .ace_searchbtn.next { padding: 0px 0.7em } .ace_searchbtn.prev:after, .ace_searchbtn.next:after { content: \"\"; border: solid 2px #888; width: 0.5em; height: 0.5em; border-width: 2px 0 0 2px; display:inline-block; transform: rotate(-45deg); } .ace_searchbtn.next:after { border-width: 0 2px 2px 0 ; } .ace_searchbtn_close { background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAcCAYAAABRVo5BAAAAZ0lEQVR42u2SUQrAMAhDvazn8OjZBilCkYVVxiis8H4CT0VrAJb4WHT3C5xU2a2IQZXJjiQIRMdkEoJ5Q2yMqpfDIo+XY4k6h+YXOyKqTIj5REaxloNAd0xiKmAtsTHqW8sR2W5f7gCu5nWFUpVjZwAAAABJRU5ErkJggg==) no-repeat 50% 0; border-radius: 50%; border: 0 none; color: #656565; cursor: pointer; font: 16px/16px Arial; padding: 0; height: 14px; width: 14px; top: 9px; right: 7px; position: absolute; } .ace_searchbtn_close:hover { background-color: #656565; background-position: 50% 100%; color: white; } .ace_button { margin-left: 2px; cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -o-user-select: none; -ms-user-select: none; user-select: none; overflow: hidden; opacity: 0.7; border: 1px solid rgba(100,100,100,0.23); padding: 1px; box-sizing: border-box!important; color: black; } .ace_button:hover { background-color: #eee; opacity:1; } .ace_button:active { background-color: #ddd; } .ace_button.checked { border-color: #3399ff; opacity:1; } .ace_search_options{ margin-bottom: 3px; text-align: right; -webkit-user-select: none; -moz-user-select: none; -o-user-select: none; -ms-user-select: none; user-select: none; clear: both; } .ace_search_counter { float: left; font-family: arial; padding: 0 8px; }','ace_searchbox');var a=''.replace(/> +/g,'>'),o=function(t){var e=d.createElement('div');e.innerHTML=a,this.element=e.firstChild,this.setSession=this.setSession.bind(this),this.$init(),this.setEditor(t)};(function(){this.setEditor=function(t){t.searchBox=this,t.renderer.scroller.appendChild(this.element),this.editor=t},this.setSession=function(){this.searchRange=null,this.$syncOptions(!0)},this.$initElements=function(t){this.searchBox=t.querySelector('.ace_search_form'),this.replaceBox=t.querySelector('.ace_replace_form'),this.searchOption=t.querySelector('[action=searchInSelection]'),this.replaceOption=t.querySelector('[action=toggleReplace]'),this.regExpOption=t.querySelector('[action=toggleRegexpMode]'),this.caseSensitiveOption=t.querySelector('[action=toggleCaseSensitive]'),this.wholeWordOption=t.querySelector('[action=toggleWholeWords]'),this.searchInput=this.searchBox.querySelector('.ace_search_field'),this.replaceInput=this.replaceBox.querySelector('.ace_search_field'),this.searchCounter=t.querySelector('.ace_search_counter')},this.$init=function(){var n=this.element;this.$initElements(n);var a=this;p.addListener(n,'mousedown',function(t){setTimeout(function(){a.activeInput.focus()},0),p.stopPropagation(t)}),p.addListener(n,'click',function(t){var e=(t.target||t.srcElement).getAttribute('action');e&&a[e]?a[e]():a.$searchBarKb.commands[e]&&a.$searchBarKb.commands[e].exec(a),p.stopPropagation(t)}),p.addCommandKeyListener(n,function(t,e,n){var i=r.keyCodeToString(n),o=a.$searchBarKb.findKeyCommand(e,i);o&&o.exec&&(o.exec(a),p.stopEvent(t))}),this.$onChange=i.delayedCall(function(){a.find(!1,!1)}),p.addListener(this.searchInput,'input',function(){a.$onChange.schedule(20)}),p.addListener(this.searchInput,'focus',function(){a.activeInput=a.searchInput,a.searchInput.value&&a.highlight()}),p.addListener(this.replaceInput,'focus',function(){a.activeInput=a.replaceInput,a.searchInput.value&&a.highlight()})},this.$closeSearchBarKb=new t([{bindKey:'Esc',name:'closeSearchBar',exec:function(t){t.searchBox.hide()}}]),this.$searchBarKb=new t,this.$searchBarKb.bindKeys({\"Ctrl-f|Command-f\":function(n){var e=n.isReplace=!n.isReplace;n.replaceBox.style.display=e?'':'none',n.replaceOption.checked=!1,n.$syncOptions(),n.searchInput.focus()},\"Ctrl-H|Command-Option-F\":function(t){t.replaceOption.checked=!0,t.$syncOptions(),t.replaceInput.focus()},\"Ctrl-G|Command-G\":function(t){t.findNext()},\"Ctrl-Shift-G|Command-Shift-G\":function(t){t.findPrev()},esc:function(t){setTimeout(function(){t.hide()})},Return:function(t){t.activeInput==t.replaceInput&&t.replace(),t.findNext()},\"Shift-Return\":function(t){t.activeInput==t.replaceInput&&t.replace(),t.findPrev()},\"Alt-Return\":function(t){t.activeInput==t.replaceInput&&t.replaceAll(),t.findAll()},Tab:function(t){(t.activeInput==t.replaceInput?t.searchInput:t.replaceInput).focus()}}),this.$searchBarKb.addCommands([{name:'toggleRegexpMode',bindKey:{win:'Alt-R|Alt-/',mac:'Ctrl-Alt-R|Ctrl-Alt-/'},exec:function(t){t.regExpOption.checked=!t.regExpOption.checked,t.$syncOptions()}},{name:'toggleCaseSensitive',bindKey:{win:'Alt-C|Alt-I',mac:'Ctrl-Alt-R|Ctrl-Alt-I'},exec:function(t){t.caseSensitiveOption.checked=!t.caseSensitiveOption.checked,t.$syncOptions()}},{name:'toggleWholeWords',bindKey:{win:'Alt-B|Alt-W',mac:'Ctrl-Alt-B|Ctrl-Alt-W'},exec:function(t){t.wholeWordOption.checked=!t.wholeWordOption.checked,t.$syncOptions()}},{name:'toggleReplace',exec:function(t){t.replaceOption.checked=!t.replaceOption.checked,t.$syncOptions()}},{name:'searchInSelection',exec:function(t){t.searchOption.checked=!t.searchRange,t.setSearchRange(t.searchOption.checked&&t.editor.getSelectionRange()),t.$syncOptions()}}]),this.setSearchRange=function(t){this.searchRange=t,t?this.searchRangeMarker=this.editor.session.addMarker(t,'ace_active-line'):this.searchRangeMarker&&(this.editor.session.removeMarker(this.searchRangeMarker),this.searchRangeMarker=null)},this.$syncOptions=function(t){d.setCssClass(this.replaceOption,'checked',this.searchRange),d.setCssClass(this.searchOption,'checked',this.searchOption.checked),this.replaceOption.textContent=this.replaceOption.checked?'-':'+',d.setCssClass(this.regExpOption,'checked',this.regExpOption.checked),d.setCssClass(this.wholeWordOption,'checked',this.wholeWordOption.checked),d.setCssClass(this.caseSensitiveOption,'checked',this.caseSensitiveOption.checked),this.replaceBox.style.display=this.replaceOption.checked?'':'none',this.find(!1,!1,t)},this.highlight=function(t){this.editor.session.highlight(t||this.editor.$search.$options.re),this.editor.renderer.updateBackMarkers()},this.find=function(a,r,i){var s=!this.editor.find(this.searchInput.value,{skipCurrent:a,backwards:r,wrap:!0,regExp:this.regExpOption.checked,caseSensitive:this.caseSensitiveOption.checked,wholeWord:this.wholeWordOption.checked,preventScroll:i,range:this.searchRange})&&this.searchInput.value;d.setCssClass(this.searchBox,'ace_nomatch',s),this.editor._emit('findSearchBox',{match:!s}),this.highlight(),this.updateCounter()},this.updateCounter=function(){var l=this.editor,e=l.$search.$options.re,t=0,n=0;if(e){var i=this.searchRange?l.session.getTextRange(this.searchRange):l.getValue(),o=l.session.doc.positionToIndex(l.selection.anchor);this.searchRange&&(o-=l.session.doc.positionToIndex(this.searchRange.start));for(var r=e.lastIndex=0,a;(a=e.exec(i))&&(t++,(r=a.index)<=o&&n++,!(999=i.length))););}this.searchCounter.textContent=n+' of '+(999>=|>>>=|<>|&&|\\|\\||\\?:|[*%\\/+\\-&\\^|~!<>=]=?/},{token:'punctuation.operator',regex:'\\\\?|\\\\:|\\\\,|\\\\;|\\\\.'},{token:'paren.lparen',regex:'[[({]'},{token:'paren.rparen',regex:'[\\\\])}]'},{token:'text',regex:'\\\\s+'}],comment:[{token:'comment',regex:'\\\\*\\\\/',next:'start'},{defaultToken:'comment'}],singleLineComment:[{token:'comment',regex:/\\\\$/,next:'singleLineComment'},{token:'comment',regex:/$/,next:'start'},{defaultToken:'comment'}],directive:[{token:'constant.other.multiline',regex:/\\\\/},{token:'constant.other.multiline',regex:/.*\\\\/},{token:'constant.other',regex:'\\\\s*<.+?>',next:'start'},{token:'constant.other',regex:'\\\\s*[\"](?:(?:\\\\\\\\.)|(?:[^\"\\\\\\\\]))*?[\"]',next:'start'},{token:'constant.other',regex:'\\\\s*[\\'](?:(?:\\\\\\\\.)|(?:[^\\'\\\\\\\\]))*?[\\']',next:'start'},{token:'constant.other',regex:/[^\\\\\\/]+/,next:'start'}]},this.embedRules(i,'doc-',[i.getEndRule('start')]),this.normalizeRules()};t.inherits(l,o),e.c_cppHighlightRules=l}),ace.define('ace/mode/matching_brace_outdent',['require','exports','module','ace/range'],function(n,e){'use strict';var a=n('../range').Range,t=function(){};(function(){this.checkOutdent=function(n,e){return!!/^\\s+$/.test(n)&&/^\\s*\\}/.test(e)},this.autoOutdent=function(i,e){var l=i.getLine(e).match(/^(\\s*\\})/);if(!l)return 0;var d=l[1].length,c=i.findMatchingBracket({row:e,column:d});if(!c||c.row==e)return 0;var p=this.$getIndent(i.getLine(c.row));i.replace(new a(e,0,e,d-1),p)},this.$getIndent=function(t){return t.match(/^\\s*/)[0]}}).call(t.prototype),e.MatchingBraceOutdent=t}),ace.define('ace/mode/folding/cstyle',['require','exports','module','ace/lib/oop','ace/range','ace/mode/folding/fold_mode'],function(n,e){'use strict';var t=n('../../lib/oop'),d=n('../../range').Range,a=n('./fold_mode').FoldMode,r=e.FoldMode=function(t){t&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\\|[^|]*?$/,'|'+t.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\\|[^|]*?$/,'|'+t.end)))};t.inherits(r,a),function(){this.foldingStartMarker=/(\\{|\\[)[^\\}\\]]*$|^\\s*(\\/\\*)/,this.foldingStopMarker=/^[^\\[\\{]*(\\}|\\])|^[\\s\\*]*(\\*\\/)/,this.singleLineBlockCommentRe=/^\\s*(\\/\\*).*\\*\\/\\s*$/,this.tripleStarBlockCommentRe=/^\\s*(\\/\\*\\*\\*).*\\*\\/\\s*$/,this.startRegionRe=/^\\s*(\\/\\*|\\/\\/)#?region\\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(a,e,t){var n=a.getLine(t);if(this.singleLineBlockCommentRe.test(n)&&!this.startRegionRe.test(n)&&!this.tripleStarBlockCommentRe.test(n))return'';var r=this._getFoldWidgetBase(a,e,t);return!r&&this.startRegionRe.test(n)?'start':r},this.getFoldWidgetRange=function(l,e,t,n){var i=l.getLine(t),r;if(this.startRegionRe.test(i))return this.getCommentRegionBlock(l,i,t);if(r=i.match(this.foldingStartMarker)){var o=r.index;if(r[1])return this.openingBracketBlock(l,r[1],t,o);var s=l.getCommentFoldRange(t,o+r[0].length,1);return s&&!s.isMultiLine()&&(n?s=this.getSectionRange(l,t):'all'!=e&&(s=null)),s}return'markbegin'!==e&&(r=i.match(this.foldingStopMarker))?(o=r.index+r[0].length,r[1]?this.closingBracketBlock(l,r[1],t,o):l.getCommentFoldRange(t,o,-1)):void 0},this.getSectionRange=function(o,e){for(var t=o.getLine(e),n=t.search(/\\S/),i=e,r=t.length,s=e+=1,a=o.getLength(),l;++el)break;var c=this.getFoldWidgetRange(o,'all',e);if(c){if(c.start.row<=i)break;if(c.isMultiLine())e=c.end.row;else if(n==l)break}s=e}return new d(i,r,s,o.getLine(s).length)},this.getCommentRegionBlock=function(o,e,t){for(var n=e.search(/\\s*$/),i=o.getLength(),r=t,s=/^\\s*(?:\\/\\*|\\/\\/|--)#?(end)?region\\b/,a=1;++tr)return new d(r,n,t,e.length)}}.call(r.prototype)}),ace.define('ace/mode/c_cpp',['require','exports','module','ace/lib/oop','ace/mode/text','ace/mode/c_cpp_highlight_rules','ace/mode/matching_brace_outdent','ace/range','ace/mode/behaviour/cstyle','ace/mode/folding/cstyle'],function(n,e){'use strict';var t=n('../lib/oop'),i=n('./text').Mode,o=n('./c_cpp_highlight_rules').c_cppHighlightRules,r=n('./matching_brace_outdent').MatchingBraceOutdent,s=(n('../range').Range,n('./behaviour/cstyle').CstyleBehaviour),a=n('./folding/cstyle').FoldMode,l=function(){this.HighlightRules=o,this.$outdent=new r,this.$behaviour=new s,this.foldingRules=new a};t.inherits(l,i),function(){this.lineCommentStart='//',this.blockComment={start:'/*',end:'*/'},this.getNextLineIndent=function(l,e,t){var n=this.$getIndent(e),i=this.getTokenizer().getLineTokens(e,l),o=i.tokens,r=i.state;if(o.length&&'comment'==o[o.length-1].type)return n;if('start'==l)(s=e.match(/^.*[\\{\\(\\[]\\s*$/))&&(n+=t);else if('doc-start'==l){if('start'==r)return'';var s;(s=e.match(/^\\s*(\\/?)\\*/))&&(s[1]&&(n+=' '),n+='* ')}return n},this.checkOutdent=function(a,e,t){return this.$outdent.checkOutdent(e,t)},this.autoOutdent=function(a,e,t){this.$outdent.autoOutdent(e,t)},this.$id='ace/mode/c_cpp'}.call(l.prototype),e.Mode=l}),ace.define('ace/mode/glsl_highlight_rules',['require','exports','module','ace/lib/oop','ace/mode/c_cpp_highlight_rules'],function(n,e){'use strict';var t=n('../lib/oop'),a=n('./c_cpp_highlight_rules').c_cppHighlightRules,o=function(){var n=this.createKeywordMapper({\"variable.language\":'this',keyword:'layout|attribute|const|uniform|varying|break|continue|do|for|while|if|else|in|out|inout|float|int|void|bool|true|false|lowp|mediump|highp|precision|invariant|discard|return|mat2|mat3|mat4|vec2|vec3|vec4|ivec2|ivec3|ivec4|bvec2|bvec3|bvec4|sampler2D|samplerCube|struct',\"constant.language\":'radians|degrees|sin|cos|tan|asin|acos|atan|pow|exp|log|exp2|log2|sqrt|inversesqrt|abs|sign|floor|ceil|fract|mod|min|max|clamp|mix|step|smoothstep|length|distance|dot|cross|normalize|faceforward|reflect|refract|matrixCompMult|lessThan|lessThanEqual|greaterThan|greaterThanEqual|equal|notEqual|any|all|not|dFdx|dFdy|fwidth|texture2D|texture2DProj|texture2DLod|texture2DProjLod|textureCube|textureCubeLod|gl_MaxVertexAttribs|gl_MaxVertexUniformVectors|gl_MaxVaryingVectors|gl_MaxVertexTextureImageUnits|gl_MaxCombinedTextureImageUnits|gl_MaxTextureImageUnits|gl_MaxFragmentUniformVectors|gl_MaxDrawBuffers|gl_DepthRangeParameters|gl_DepthRange|gl_Position|gl_PointSize|gl_FragCoord|gl_FrontFacing|gl_PointCoord|gl_FragColor|gl_FragData'},'identifier');this.$rules=new a().$rules,this.$rules.start.forEach(function(e){'function'==typeof e.token&&(e.token=n)})};t.inherits(o,a),e.glslHighlightRules=o}),ace.define('ace/mode/glsl',['require','exports','module','ace/lib/oop','ace/mode/c_cpp','ace/mode/glsl_highlight_rules','ace/mode/matching_brace_outdent','ace/range','ace/mode/behaviour/cstyle','ace/mode/folding/cstyle'],function(n,e){'use strict';var t=n('../lib/oop'),i=n('./c_cpp').Mode,o=n('./glsl_highlight_rules').glslHighlightRules,r=n('./matching_brace_outdent').MatchingBraceOutdent,s=(n('../range').Range,n('./behaviour/cstyle').CstyleBehaviour),a=n('./folding/cstyle').FoldMode,l=function(){this.HighlightRules=o,this.$outdent=new r,this.$behaviour=new s,this.foldingRules=new a};t.inherits(l,i),function(){this.$id='ace/mode/glsl'}.call(l.prototype),e.Mode=l}),r.exports=ace},function(t){var e=function(){return this}();try{e=e||Function('return this')()||(0,eval)('this')}catch(t){'object'==typeof window&&(e=window)}t.exports=e},function(a,e,t){(function(e){var d='undefined'==typeof window?'undefined'!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{}:window,t=function(){var n=/\\blang(?:uage)?-(\\w+)\\b/i,a=0,x=d.Prism={manual:d.Prism&&d.Prism.manual,util:{encode:function(t){return t instanceof i?new i(t.type,x.util.encode(t.content),t.alias):'Array'===x.util.type(t)?t.map(x.util.encode):t.replace(/&/g,'&').replace(/i.length)break e;if(!(C instanceof t)){l.lastIndex=0;var E=1;if(!(w=l.exec(C))&&h&&f!=n.length-1){if(l.lastIndex=g,!(w=l.exec(i)))break;for(var A=w.index+(u?w[1].length:0),v=w.index+w[0].length,_=f,F=g,b=n.length;b>_&&v>F;++_)A>=(F+=n[_].length)&&(++f,g=F);if(n[f]instanceof t||n[_-1].greedy)continue;E=_-f,C=i.slice(g,F),w.index-=g}if(w){u&&(d=w[1].length),v=(A=w.index+d)+(w=w[0].slice(d)).length;var S=C.slice(0,A),T=C.slice(v),y=[f,E],w;S&&y.push(S);var R=new t(r,c?x.tokenize(w,c):w,m,w,h);y.push(R),T&&y.push(T),Array.prototype.splice.apply(n,y)}}}}}return n},hooks:{all:{},add:function(a,e){var t=x.hooks.all;t[a]=t[a]||[],t[a].push(e)},run:function(a,e){var t=x.hooks.all[a];if(t&&t.length)for(var n=0,r;r=t[n++];)r(e)}}},i=x.Token=function(a,e,t,n,r){this.type=a,this.content=e,this.alias=t,this.length=0|(n||'').length,this.greedy=!!r};if(i.stringify=function(o,l,d){if('string'==typeof o)return o;if('Array'===x.util.type(o))return o.map(function(e){return i.stringify(e,l,o)}).join('');var c={type:o.type,content:i.stringify(o.content,l,d),tag:'span',classes:['token',o.type],attributes:{},language:l,parent:d};if('comment'==c.type&&(c.attributes.spellcheck='true'),o.alias){var r='Array'===x.util.type(o.alias)?o.alias:[o.alias];Array.prototype.push.apply(c.classes,r)}x.hooks.run('wrap',c);var s=Object.keys(c.attributes).map(function(t){return t+'=\"'+(c.attributes[t]||'').replace(/\"/g,'"')+'\"'}).join(' ');return'<'+c.tag+' class=\"'+c.classes.join(' ')+'\"'+(s?' '+s:'')+'>'+c.content+''},!d.document)return d.addEventListener?(d.addEventListener('message',function(n){var e=JSON.parse(n.data),t=e.language,a=e.code,r=e.immediateClose;d.postMessage(x.highlight(a,x.languages[t],t)),r&&d.close()},!1),d.Prism):d.Prism;var e=document.currentScript||[].slice.call(document.getElementsByTagName('script')).pop();return e&&(x.filename=e.src,!document.addEventListener||x.manual||e.hasAttribute('data-manual')||('loading'===document.readyState?document.addEventListener('DOMContentLoaded',x.highlightAll):window.requestAnimationFrame?window.requestAnimationFrame(x.highlightAll):window.setTimeout(x.highlightAll,16))),d.Prism}();void 0!==a&&a.exports&&(a.exports=t),void 0!==e&&(e.Prism=t),t.languages.markup={comment://,prolog:/<\\?[\\w\\W]+?\\?>/,doctype://i,cdata://i,tag:{pattern:/<\\/?(?!\\d)[^\\s>\\/=$<]+(?:\\s+[^\\s>\\/=]+(?:=(?:(\"|')(?:\\\\\\1|\\\\?(?!\\1)[\\w\\W])*\\1|[^\\s'\">=]+))?)*\\s*\\/?>/i,inside:{tag:{pattern:/^<\\/?[^\\s>\\/]+/i,inside:{punctuation:/^<\\/?/,namespace:/^[^\\s>\\/:]+:/}},\"attr-value\":{pattern:/=(?:('|\")[\\w\\W]*?(\\1)|[^\\s>]+)/i,inside:{punctuation:/[=>\"']/}},punctuation:/\\/?>/,\"attr-name\":{pattern:/[^\\s>\\/]+/,inside:{namespace:/^[^\\s>\\/:]+:/}}}},entity:/&#?[\\da-z]{1,8};/i},t.hooks.add('wrap',function(t){'entity'===t.type&&(t.attributes.title=t.content.replace(/&/,'&'))}),t.languages.xml=t.languages.markup,t.languages.html=t.languages.markup,t.languages.mathml=t.languages.markup,t.languages.svg=t.languages.markup,t.languages.css={comment:/\\/\\*[\\w\\W]*?\\*\\//,atrule:{pattern:/@[\\w-]+?.*?(;|(?=\\s*\\{))/i,inside:{rule:/@[\\w-]+/}},url:/url\\((?:([\"'])(\\\\(?:\\r\\n|[\\w\\W])|(?!\\1)[^\\\\\\r\\n])*\\1|.*?)\\)/i,selector:/[^\\{\\}\\s][^\\{\\};]*?(?=\\s*\\{)/,string:{pattern:/(\"|')(\\\\(?:\\r\\n|[\\w\\W])|(?!\\1)[^\\\\\\r\\n])*\\1/,greedy:!0},property:/(\\b|\\B)[\\w-]+(?=\\s*:)/i,important:/\\B!important\\b/i,function:/[-a-z0-9]+(?=\\()/i,punctuation:/[(){};:]/},t.languages.css.atrule.inside.rest=t.util.clone(t.languages.css),t.languages.markup&&(t.languages.insertBefore('markup','tag',{style:{pattern:/()[\\w\\W]*?(?=<\\/style>)/i,lookbehind:!0,inside:t.languages.css,alias:'language-css'}}),t.languages.insertBefore('inside','attr-value',{\"style-attr\":{pattern:/\\s*style=(\"|').*?\\1/i,inside:{\"attr-name\":{pattern:/^\\s*style/i,inside:t.languages.markup.tag.inside},punctuation:/^\\s*=\\s*['\"]|['\"]\\s*$/,\"attr-value\":{pattern:/.+/i,inside:t.languages.css}},alias:'language-css'}},t.languages.markup.tag)),t.languages.clike={comment:[{pattern:/(^|[^\\\\])\\/\\*[\\w\\W]*?\\*\\//,lookbehind:!0},{pattern:/(^|[^\\\\:])\\/\\/.*/,lookbehind:!0}],string:{pattern:/([\"'])(\\\\(?:\\r\\n|[\\s\\S])|(?!\\1)[^\\\\\\r\\n])*\\1/,greedy:!0},\"class-name\":{pattern:/((?:\\b(?:class|interface|extends|implements|trait|instanceof|new)\\s+)|(?:catch\\s+\\())[a-z0-9_\\.\\\\]+/i,lookbehind:!0,inside:{punctuation:/(\\.|\\\\)/}},keyword:/\\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\\b/,boolean:/\\b(true|false)\\b/,function:/[a-z0-9_]+(?=\\()/i,number:/\\b-?(?:0x[\\da-f]+|\\d*\\.?\\d+(?:e[+-]?\\d+)?)\\b/i,operator:/--?|\\+\\+?|!=?=?|<=?|>=?|==?=?|&&?|\\|\\|?|\\?|\\*|\\/|~|\\^|%/,punctuation:/[{}[\\];(),.:]/},t.languages.javascript=t.languages.extend('clike',{keyword:/\\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\\b/,number:/\\b-?(0x[\\dA-Fa-f]+|0b[01]+|0o[0-7]+|\\d*\\.?\\d+([Ee][+-]?\\d+)?|NaN|Infinity)\\b/,function:/[_$a-zA-Z\\xA0-\\uFFFF][_$a-zA-Z0-9\\xA0-\\uFFFF]*(?=\\()/i,operator:/--?|\\+\\+?|!=?=?|<=?|>=?|==?=?|&&?|\\|\\|?|\\?|\\*\\*?|\\/|~|\\^|%|\\.{3}/}),t.languages.insertBefore('javascript','keyword',{regex:{pattern:/(^|[^\\/])\\/(?!\\/)(\\[.+?]|\\\\.|[^\\/\\\\\\r\\n])+\\/[gimyu]{0,5}(?=\\s*($|[\\r\\n,.;})]))/,lookbehind:!0,greedy:!0}}),t.languages.insertBefore('javascript','string',{\"template-string\":{pattern:/`(?:\\\\\\\\|\\\\?[^\\\\])*?`/,greedy:!0,inside:{interpolation:{pattern:/\\$\\{[^}]+\\}/,inside:{\"interpolation-punctuation\":{pattern:/^\\$\\{|\\}$/,alias:'punctuation'},rest:t.languages.javascript}},string:/[\\s\\S]+/}}}),t.languages.markup&&t.languages.insertBefore('markup','tag',{script:{pattern:/()[\\w\\W]*?(?=<\\/script>)/i,lookbehind:!0,inside:t.languages.javascript,alias:'language-javascript'}}),t.languages.js=t.languages.javascript,t.languages.glsl=t.languages.extend('clike',{comment:[/\\/\\*[\\w\\W]*?\\*\\//,/\\/\\/(?:\\\\(?:\\r\\n|[\\s\\S])|.)*/],number:/\\b(?:0x[\\da-f]+|(?:\\.\\d+|\\d+\\.?\\d*)(?:e[+-]?\\d+)?)[ulf]*\\b/i,keyword:/\\b(?:attribute|const|uniform|varying|buffer|shared|coherent|volatile|restrict|readonly|writeonly|atomic_uint|layout|centroid|flat|smooth|noperspective|patch|sample|break|continue|do|for|while|switch|case|default|if|else|subroutine|in|out|inout|float|double|int|void|bool|true|false|invariant|precise|discard|return|d?mat[234](?:x[234])?|[ibdu]?vec[234]|uint|lowp|mediump|highp|precision|[iu]?sampler[123]D|[iu]?samplerCube|sampler[12]DShadow|samplerCubeShadow|[iu]?sampler[12]DArray|sampler[12]DArrayShadow|[iu]?sampler2DRect|sampler2DRectShadow|[iu]?samplerBuffer|[iu]?sampler2DMS(?:Array)?|[iu]?samplerCubeArray|samplerCubeArrayShadow|[iu]?image[123]D|[iu]?image2DRect|[iu]?imageCube|[iu]?imageBuffer|[iu]?image[12]DArray|[iu]?imageCubeArray|[iu]?image2DMS(?:Array)?|struct|common|partition|active|asm|class|union|enum|typedef|template|this|resource|goto|inline|noinline|public|static|extern|external|interface|long|short|half|fixed|unsigned|superp|input|output|hvec[234]|fvec[234]|sampler3DRect|filter|sizeof|cast|namespace|using)\\b/}),t.languages.insertBefore('glsl','comment',{preprocessor:{pattern:/(^[ \\t]*)#(?:(?:define|undef|if|ifdef|ifndef|else|elif|endif|error|pragma|extension|version|line)\\b)?/m,lookbehind:!0,alias:'builtin'}}),a.exports=t}).call(this,t(5))},function(a,e,t){(a.exports=t(2)(!1)).push([a.i,'code[class*=language-],pre[class*=language-]{color:#f8f8f2;background:none;text-shadow:0 1px rgba(0,0,0,.3);font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto;border-radius:.3em}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#f8f8f2}.namespace{opacity:.7}.token.constant,.token.deleted,.token.property,.token.symbol,.token.tag{color:#f92672}.token.boolean,.token.number{color:#ae81ff}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#a6e22e}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url,.token.variable{color:#f8f8f2}.token.atrule,.token.attr-value,.token.function{color:#e6db74}.token.keyword{color:#66d9ef}.token.important,.token.regex{color:#fd971f}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}',''])},function(a,e,t){var n=t(7);'string'==typeof n&&(n=[[a.i,n,'']]);t(1)(n,{insertInto:'html',hmr:!0,transform:void 0,insertInto:'html'}),n.locals&&(a.exports=n.locals)},function(t){t.exports=function(a){var r='undefined'!=typeof window&&window.location;if(!r)throw new Error('fixUrls requires window.location');if(!a||'string'!=typeof a)return a;var s=r.protocol+'//'+r.host,n=s+r.pathname.replace(/\\/[^\\/]*$/,'/');return a.replace(/url\\s*\\(((?:[^)(]|\\((?:[^)(]+|\\([^)(]*\\))*\\))*)\\)/gi,function(a,e){var t=e.trim().replace(/^\"(.*)\"$/,function(n,e){return e}).replace(/^'(.*)'$/,function(n,e){return e}),r;return /^(#|data:|http:\\/\\/|https:\\/\\/|file:\\/\\/\\/|\\s*$)/i.test(t)?a:(r=0===t.indexOf('//')?t:0===t.indexOf('/')?s+t:n+t.replace(/^\\.\\//,''),'url('+JSON.stringify(r)+')')})}},function(a,e,t){(e=a.exports=t(2)(!1)).push([a.i,'@import url(https://fonts.googleapis.com/css?family=Montserrat:300,400);','']),e.push([a.i,'.resultViewComponent{position:absolute;z-index:99999;border:1px solid #000;top:0;left:0;bottom:0;right:0;background-color:#222;opacity:1;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.resultViewComponent.active{visibility:visible;display:block}.resultViewComponent,.resultViewComponent:after,.resultViewComponent:before{box-sizing:content-box}.resultViewMenuComponent{font-family:Montserrat,sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.resultViewMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.resultViewMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.resultViewMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.resultViewMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.resultViewMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.resultViewMenuComponent a.clearSearch{display:inline-block;padding:0;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.resultViewMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}@media (max-width:1024px){.resultViewMenuComponent{padding:0;position:absolute;overflow-y:visible;top:0;left:0;right:0;bottom:0;z-index:999999;display:block}.resultViewMenuComponent .resultViewMenuOpen{display:block;visibility:visible}.resultViewMenuComponent li:not(.resultViewMenuSmall){display:none;visibility:hidden}.resultViewMenuComponent li{background:#2c2c2c}.resultViewMenuComponent li.searchContainer{background:#464646}.resultViewMenuComponent a.active{background:#2c2c2c}}.resultViewMenuComponent input{border:0;font-family:Montserrat,sans-serif;font-weight:300;padding:0 20px;background:#464646;color:#f9f9f9;height:100%;position:relative;top:-1px;box-sizing:border-box}.resultViewMenuComponent input:focus{border:0;outline:0 none}.resultViewMenuComponent .clearSearch{position:relative;background:transparent;display:inline;padding:0;margin-left:-30px;z-index:9000;color:#f0640d}.resultViewMenuComponent .clearSearch:hover{background:transparent!important}.resultViewMenuComponent ::-webkit-input-placeholder{color:#ccc}.resultViewMenuComponent :-moz-placeholder,.resultViewMenuComponent ::-moz-placeholder{color:#ccc}.resultViewMenuComponent :-ms-input-placeholder{color:#ccc}.resultViewContentComponent{position:absolute;top:40px;left:0;bottom:0;right:0}.informationColumnLeftComponent{left:0;right:50%}.informationColumnLeftComponent,.informationColumnRightComponent{position:absolute;top:0;bottom:0;overflow:auto;overflow-x:hidden;overflow-y:visible}.informationColumnRightComponent{left:50%;right:0}.captureListComponent{position:absolute;top:40px;left:0;bottom:0;right:0;background:#222;z-index:9000;display:none;visibility:hidden;overflow-y:visible;overflow-x:hidden}.captureListComponent.active{display:block;visibility:visible}.captureListComponent .openCaptureFile{border:1px dashed #f9f9f9;display:block;margin:5px;padding:5px;text-align:center;font-style:italic}.captureListComponent .openCaptureFile span{line-height:100%;vertical-align:middle}.captureListComponent ul{margin:0;padding:0;list-style:none;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-start}.captureListComponent ul li{margin:5px;border:1px solid #606060}.captureListComponent ul li img{width:295px;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(.25,#c9c9c9),color-stop(.25,transparent)),-webkit-gradient(linear,0 0,100% 100%,color-stop(.25,#c9c9c9),color-stop(.25,transparent)),-webkit-gradient(linear,0 100%,100% 0,color-stop(.75,transparent),color-stop(.75,#c9c9c9)),-webkit-gradient(linear,0 0,100% 100%,color-stop(.75,transparent),color-stop(.75,#c9c9c9));background-image:-moz-linear-gradient(45deg,#d9d9d9 25%,transparent 25%),-moz-linear-gradient(-45deg,#d9d9d9 25%,transparent 25%),-moz-linear-gradient(45deg,transparent 75%,#d9d9d9 75%),-moz-linear-gradient(-45deg,transparent 75%,#d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0 25px;display:block}.captureListComponent ul li span{display:block;text-align:center;border:5px solid #222}.captureListComponent ul li span .captureListItemSave{color:#f9f9f9;font-size:16px;margin-left:10px;position:relative;padding:3px 8px 3px 32px}.captureListComponent ul li span .captureListItemSave:after,.captureListComponent ul li span .captureListItemSave:before{box-sizing:border-box;content:\"\";position:absolute}.captureListComponent ul li span .captureListItemSave:before{background:#d9d9d9;border-color:#f9f9f9;border-style:solid;border-width:7px 2px 1px;border-radius:1px;height:16px;left:8px;top:5px;width:16px}.captureListComponent ul li span .captureListItemSave:after{background:#f9f9f9;border-color:#d9d9d9;border-style:solid;border-width:1px 1px 1px 4px;height:5px;left:13px;top:5px;width:7px}.captureListComponent ul li:hover{cursor:pointer}.captureListComponent ul li.active span{background:#f0640d;border:5px solid #f0640d}.captureListComponent ul li.active span .captureListItemSave:before{background:#f0640d}.captureListComponent ul li.active span .captureListItemSave:after{border-color:#f0640d}.visualStateListComponent{position:absolute;top:0;left:0;bottom:0;padding:5px;right:80%;overflow-y:visible;overflow-x:hidden}.visualStateListComponent ul{margin:0;padding:0;list-style:none}.visualStateListComponent ul li{margin:20px 15px 0;border:1px solid #606060}.visualStateListComponent ul li img{display:block;width:100%;margin:0;padding:0;box-sizing:border-box;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(.25,#c9c9c9),color-stop(.25,transparent)),-webkit-gradient(linear,0 0,100% 100%,color-stop(.25,#c9c9c9),color-stop(.25,transparent)),-webkit-gradient(linear,0 100%,100% 0,color-stop(.75,transparent),color-stop(.75,#c9c9c9)),-webkit-gradient(linear,0 0,100% 100%,color-stop(.75,transparent),color-stop(.75,#c9c9c9));background-image:-moz-linear-gradient(45deg,#d9d9d9 25%,transparent 25%),-moz-linear-gradient(-45deg,#d9d9d9 25%,transparent 25%),-moz-linear-gradient(45deg,transparent 75%,#d9d9d9 75%),-moz-linear-gradient(-45deg,transparent 75%,#d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0 25px}.visualStateListComponent ul li:hover{cursor:pointer}.visualStateListComponent ul li span{border:5px solid #222;background:#222;box-sizing:border-box;display:inline-block;width:100%;margin:0;padding:5px;word-wrap:break-word}.visualStateListComponent ul li.active{border:2px solid #f0640d}.commandListComponent{position:absolute;top:0;left:20%;right:40%;bottom:0;color:#d3d3d3}.commandListComponent ul{margin:0;padding:0;list-style:none;overflow-y:visible;overflow-x:hidden;height:100%}.commandListComponent ul li{padding:8px}.commandListComponent ul li span{word-wrap:break-word;line-height:22px}.commandListComponent ul li:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.commandListComponent ul li:nth-child(2n){background:#2c2c2c}.commandListComponent ul li:nth-child(odd){background:#222}.commandListComponent ul li .important{font-weight:800}.commandListComponent ul li .important.deprecated{color:red}.commandListComponent ul li .important.unused{color:#ff0}.commandListComponent ul li .important.disabled{color:gray}.commandListComponent ul li .important.redundant{color:orange}.commandListComponent ul li .important.valid{color:#adff2f}.commandListComponent ul li .marker{font-size:16px;font-weight:900;color:#adff2f}.commandListComponent ul li.active{background:#f37628;color:#222}.commandListComponent ul li.drawCall{background:#5db0d7;color:#222}.commandListComponent ul li a{margin-left:5px;margin-right:5px;color:#5db0d7;background:#222;padding:5px;font-weight:900;display:inline-block}.commandDetailComponent{position:absolute;top:0;left:60%;right:0;bottom:0;overflow-y:visible;overflow-x:hidden}.jsonGroupComponent{display:block;margin:10px;padding:10px;padding-bottom:5px}.jsonGroupComponent .jsonGroupComponentTitle{display:block;font-size:16px;color:#5db0d7;border-bottom:1px solid #5db0d7;padding-bottom:5px;margin-bottom:5px;text-transform:capitalize}.jsonGroupComponent ul{margin:0;padding:0;list-style:none}.jsonGroupComponent ul li:nth-child(2n),.jsonGroupComponent ul li:nth-child(odd){background:#222}.jsonItemComponentKey{color:#f0640d}.jsonItemComponentValue{white-space:pre-wrap}.jsonItemImageHolder{width:50%;margin:auto}.jsonItemImageHolder .jsonItemImage{margin:5px;display:block;border:1px solid #606060;width:100%}.jsonItemImageHolder .jsonItemImage img{width:100%;display:block;margin:auto;max-width:256px;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(.25,#c9c9c9),color-stop(.25,transparent)),-webkit-gradient(linear,0 0,100% 100%,color-stop(.25,#c9c9c9),color-stop(.25,transparent)),-webkit-gradient(linear,0 100%,100% 0,color-stop(.75,transparent),color-stop(.75,#c9c9c9)),-webkit-gradient(linear,0 0,100% 100%,color-stop(.75,transparent),color-stop(.75,#c9c9c9));background-image:-moz-linear-gradient(45deg,#d9d9d9 25%,transparent 25%),-moz-linear-gradient(-45deg,#d9d9d9 25%,transparent 25%),-moz-linear-gradient(45deg,transparent 75%,#d9d9d9 75%),-moz-linear-gradient(-45deg,transparent 75%,#d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0 25px}.jsonItemImageHolder .jsonItemImage span{margin:0;padding:5px;word-wrap:break-word;display:inline-block;width:100%;box-sizing:border-box}[commandName=onOpenSourceClicked]:hover{color:#f9f9f9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.jsonVisualStateItemComponent{text-align:center;padding:10px}.jsonVisualStateItemComponent img{border:1px solid #606060;margin:5px;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(.25,#c9c9c9),color-stop(.25,transparent)),-webkit-gradient(linear,0 0,100% 100%,color-stop(.25,#c9c9c9),color-stop(.25,transparent)),-webkit-gradient(linear,0 100%,100% 0,color-stop(.75,transparent),color-stop(.75,#c9c9c9)),-webkit-gradient(linear,0 0,100% 100%,color-stop(.75,transparent),color-stop(.75,#c9c9c9));background-image:-moz-linear-gradient(45deg,#d9d9d9 25%,transparent 25%),-moz-linear-gradient(-45deg,#d9d9d9 25%,transparent 25%),-moz-linear-gradient(45deg,transparent 75%,#d9d9d9 75%),-moz-linear-gradient(-45deg,transparent 75%,#d9d9d9 75%);-webkit-background-size:50px 51px;-moz-background-size:50px 50px;background-size:50px 50px;background-position:0 0,25px 0,25px -25px,0 25px;width:100%;max-width:512px}.jsonVisualStateItemComponent span{display:block}.jsonContentComponent{position:absolute;top:0;left:0;right:0;bottom:0;padding:10px;overflow-y:visible;overflow-x:hidden}.jsonItemComponentValue{word-break:break-all;white-space:normal}.jsonSourceItemComponentOpen{font-weight:700;color:#5db0d7;text-decoration:underline}.sourceCodeMenuComponentContainer{position:absolute;left:0;top:0;right:40%}.sourceCodeMenuComponent{font-family:Montserrat,sans-serif;font-size:13px;font-weight:300;line-height:40px;flex:1 100%;height:42px;outline:0 none;border-bottom:2px solid #222;box-sizing:border-box;list-style:none;margin:0;background:#2c2c2c;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;justify-content:flex-end}.sourceCodeMenuComponent .resultViewMenuOpen{display:none;visibility:hidden}.sourceCodeMenuComponent a{outline:0 none;text-decoration:none;display:block;padding:0 20px;color:#ccc;background:#2c2c2c;box-sizing:border-box;height:100%}.sourceCodeMenuComponent a.active{background:#222;color:#fff;font-weight:400;border-bottom:2px solid #f0640d}.sourceCodeMenuComponent a:hover{background:#222;color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.sourceCodeMenuComponent a:hover.active{color:#f0640d;transition:color 0;-webkit-transition:color 0;-moz-transition:color 0}.sourceCodeMenuComponent a.clearSearch{display:inline-block;padding:0;margin-left:-30px;margin-right:20px;z-index:9000;color:#f9f9f9}.sourceCodeMenuComponent a.clearSearch:hover{background:#2c2c2c;color:#f0640d}.sourceCodeMenuComponent input{border:0;font-family:Montserrat,sans-serif;font-weight:300;padding:0 20px;background:#464646;color:#f9f9f9;height:100%;position:relative;top:-1px;box-sizing:border-box}.sourceCodeMenuComponent input:focus{border:0;outline:0 none}.sourceCodeMenuComponent .clearSearch{position:relative;background:transparent;display:inline;padding:0;margin-left:-30px;z-index:9000;color:#f0640d}.sourceCodeMenuComponent .clearSearch:hover{background:transparent!important}.sourceCodeMenuComponent ::-webkit-input-placeholder{color:#ccc}.sourceCodeMenuComponent :-moz-placeholder,.sourceCodeMenuComponent ::-moz-placeholder{color:#ccc}.sourceCodeMenuComponent :-ms-input-placeholder{color:#ccc}.sourceCodeComponent,.sourceCodeComponentEditable{position:absolute;top:42px;left:0;bottom:0;right:40%;background:#222;z-index:9000;overflow-x:visible;overflow:auto}.sourceCodeComponent .sourceCodeComponentTitle,.sourceCodeComponentEditable .sourceCodeComponentTitle{font-size:16px;font-weight:800;line-height:50px;color:#f0640d;padding:1em;margin:.5em 0}.captureMenuComponent{position:absolute;padding:7px;z-index:99999;top:10px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuComponent.active{visibility:visible;display:block}.captureMenuComponent,.captureMenuComponent:after,.captureMenuComponent:before{box-sizing:content-box}.captureMenuLogComponent{position:absolute;padding:7px;z-index:80000;top:66px;left:50%;margin-left:-209px;height:40px;width:400px;border:2px solid #222;background-color:#2c2c2c;visibility:hidden;display:none;color:#f9f9f9;font-family:Consolas,monaco,monospace;font-size:14px;font-weight:500}.captureMenuLogComponent.active{visibility:visible;display:block}.captureMenuLogComponent,.captureMenuLogComponent:after,.captureMenuLogComponent:before{box-sizing:content-box}.captureMenuLogComponent span.error{color:red}.canvasListComponent{float:left;width:50%;height:100%}.canvasListComponent [commandName=onCanvasSelection]{vertical-align:center;line-height:40px;white-space:nowrap;text-overflow:ellipsis;width:190px;display:inline-block;overflow:hidden;margin:0 5px}.canvasListComponent [commandName=onCanvasSelection]:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.canvasListComponent ul{margin:0;padding:7px;list-style:none;position:absolute;top:54px;left:-2px;width:400px;border:2px solid #222;background-color:#2c2c2c}.canvasListComponent ul li{margin:5px}.canvasListComponent ul li:hover{color:#c9c9c9;cursor:pointer;transition:color .3s;-webkit-transition:color .3s;-moz-transition:color .3s}.captureMenuActionsComponent{float:left;width:30%;height:100%;margin-top:7.5px}.captureMenuActionsComponent div{float:left}.captureMenuActionsComponent [commandName=onCaptureRequested]{border-radius:50%;background:#2c2c2c;border:2px solid red;width:21px;height:21px}.captureMenuActionsComponent [commandName=onCaptureRequested]:hover{background:red;cursor:pointer;transition:background .3s;-webkit-transition:background .3s;-moz-transition:background .3s}.captureMenuActionsComponent [commandName=onPlayNextFrameRequested],.captureMenuActionsComponent [commandName=onPlayRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before,.captureMenuActionsComponent [commandName=onPlayRequested]:before{content:\"\";position:absolute;display:inline-block;margin-top:6px;margin-left:4px;width:7px;height:7px;border-top:2px solid #f9f9f9;border-right:2px solid #f9f9f9;background-color:#f9f9f9;-moz-transform:rotate(45deg);-webkit-transform:rotate(45deg);transform:rotate(45deg);z-index:-20}.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:after,.captureMenuActionsComponent [commandName=onPlayRequested]:after{content:\"\";position:absolute;display:inline-block;width:8px;height:20px;background-color:#2c2c2c;z-index:-10}.captureMenuActionsComponent :hover[commandName=onPlayNextFrameRequested],.captureMenuActionsComponent [commandName=onPlayRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPauseRequested]{width:21px;height:21px;border:2px solid #f9f9f9;border-radius:50%;margin-left:9px}.captureMenuActionsComponent [commandName=onPauseRequested]:before{content:\"\";position:absolute;display:inline-block;width:2px;height:13px;margin-left:12px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:after{content:\"\";position:absolute;display:inline-block;width:2px;height:13px;margin-left:7px;margin-top:4px;background-color:#f9f9f9}.captureMenuActionsComponent [commandName=onPauseRequested]:hover{cursor:pointer;border:2px solid #c9c9c9;transition:border .3s;-webkit-transition:border .3s;-moz-transition:border .3s}.captureMenuActionsComponent [commandName=onPlayNextFrameRequested]:before{background-color:#2c2c2c}.fpsCounterComponent{float:left;width:20%;vertical-align:center;line-height:40px;white-space:nowrap}',''])},function(a,e,t){var n=t(10);'string'==typeof n&&(n=[[a.i,n,'']]);t(1)(n,{insertInto:'html',hmr:!0,transform:void 0,insertInto:'html'}),n.locals&&(a.exports=n.locals)},function(a,e,t){t(11),t(8),t(6),t(4),a.exports=t(3)}])})},function(e,t,n){'use strict';function setRenderer(e){'lambert'==m.shadingmode?u=0:'blinnphong'==m.shadingmode?u=1:'toon'==m.shadingmode&&(u=2);e===l?m._renderer=new r.a:e===d?m._renderer=new o.a(15,15,15):e===c?m._renderer=new i.a(15,15,15,u):void 0}Object.defineProperty(t,'__esModule',{value:!0});var a=n(1),r=n(21),o=n(29),i=n(32),s=n(3),l='Forward',d='Forward+',c='Clustered',p='lambert',u=0,m={renderer:l,shadingmode:p,_renderer:null};setRenderer(m.renderer),a.gui.add(m,'renderer',[l,d,c]).onChange(setRenderer),a.gui.add(m,'shadingmode',['blinnphong',p,'toon']).onChange(function(){setRenderer(m.renderer)});var g=new s.b;g.loadGLTF('models/sponza/sponza.gltf'),a.camera.position.set(-10,8,0),a.cameraControls.target.set(0,2,0),a.gl.enable(a.gl.DEPTH_TEST),Object(a.makeRenderLoop)(function render(){g.update(),m._renderer.render(a.camera,g)})()},function(e,t,n){'use strict';function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}var a=n(1),r=n(2),o=n(6),s=n(3),i=n(27),l=n.n(i),d=n(28),c=n(4),p=function(){function ForwardRenderer(e){_classCallCheck(this,ForwardRenderer),this._lightTexture=new c.a(s.a,8),this._shaderProgram=Object(o.a)(l.a,Object(d.a)({numLights:s.a}),{uniforms:['u_viewProjectionMatrix','u_colmap','u_normap','u_lightbuffer','u_shadingtype'],attribs:['a_position','a_normal','a_uv']}),this.shadingtype=e,this._projectionMatrix=r.a.create(),this._viewMatrix=r.a.create(),this._viewProjectionMatrix=r.a.create()}return ForwardRenderer.prototype.render=function render(e,t){e.updateMatrixWorld(),r.a.invert(this._viewMatrix,e.matrixWorld.elements),r.a.copy(this._projectionMatrix,e.projectionMatrix.elements),r.a.multiply(this._viewProjectionMatrix,this._projectionMatrix,this._viewMatrix);for(var n=0;nl?m:Math.acos(l)},t.str=function str(e){return'vec2('+e[0]+', '+e[1]+')'},t.exactEquals=function exactEquals(e,t){return e[0]===t[0]&&e[1]===t[1]},t.equals=function equals(e,t){var n=e[0],a=e[1],r=t[0],o=t[1];return u(n-r)<=g.b*p(1,u(n),u(r))&&u(a-o)<=g.b*p(1,u(a),u(o))},n.d(t,'len',function(){return a}),n.d(t,'sub',function(){return h}),n.d(t,'mul',function(){return f}),n.d(t,'div',function(){return E}),n.d(t,'dist',function(){return _}),n.d(t,'sqrDist',function(){return C}),n.d(t,'sqrLen',function(){return y}),n.d(t,'forEach',function(){return A});var g=n(0),a=length,h=subtract,f=multiply,E=divide,_=distance,C=squaredDistance,y=squaredLength,A=function(){var e=create();return function(t,n,a,r,o,d){var c,i;for(n||(n=2),a||(a=0),i=r?s(r*n+a,t.length):t.length,c=a;cd;++d)l[d]=o.matrix[d];a.a.multiply(l,r,l)}else a.d.set(u,o.translation[0],o.translation[1],o.translation[2]),a.b.set(g,o.rotation[0],o.rotation[1],o.rotation[2],o.rotation[3]),a.a.fromRotationTranslation(f,g,u),a.a.multiply(l,l,f),a.d.set(h,o.scale[0],o.scale[1],o.scale[2]),a.a.scale(l,l,h);this.glTF.nodeMatrix[t]=l;var E=o.meshes;if(!!E)for(var _=E.length,C=0,m;C<_;++C){m=new i,n.meshes.push(m);var y=E[C],A=e.meshes[y];m.meshID=y;for(var b=A.primitives,x=b.length,v=0,p;v= clusterLightCount) { break; } \\n int texelIdx = int(float(i+1) * 0.25);\\n float V = float(texelIdx+1) / float(texelsPerCol+1);\\n vec4 texel = texture2D(u_clusterbuffer, vec2(U,V));\\n \\n int lightIdx;\\n int texelComponent = (i+1) - (texelIdx * 4);\\n \\n if (texelComponent == 0) {\\n lightIdx = int(texel[0]);\\n } else if (texelComponent == 1) {\\n lightIdx = int(texel[1]);\\n } else if (texelComponent == 2) {\\n lightIdx = int(texel[2]);\\n } else if (texelComponent == 3) {\\n lightIdx = int(texel[3]);\\n }\\n Light light = UnpackLight(lightIdx);\\n\\n float lightDistance = distance(light.position, v_position);\\n vec3 L = (light.position - v_position) / lightDistance;\\n\\n float lightIntensity = cubicGaussian(2.0 * lightDistance / light.radius);\\n float lambertTerm = max(dot(L, normal), 0.0);\\n\\n fragColor += albedo * lambertTerm * light.color * vec3(lightIntensity);\\n }\\n\\n const vec3 ambientLight = vec3(0.025);\\n fragColor += albedo * ambientLight;\\n\\n gl_FragColor = vec4(fragColor, 1.0);\\n }\\n '}},function(e,t,n){'use strict';function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')}function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError('this hasn\\'t been initialised - super() hasn\\'t been called');return t&&('object'==typeof t||'function'==typeof t)?t:e}function _inherits(e,t){if('function'!=typeof t&&null!==t)throw new TypeError('Super expression must either be null or a function, not '+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=n(1),r=n(2),o=n(6),s=n(3),i=n(33),l=n.n(i),d=n(34),c=n.n(d),p=n(13),u=n.n(p),m=n(35),g=n(4),h=n(5),f=2,E=function(e){function ClusteredRenderer(t,n,i,d){_classCallCheck(this,ClusteredRenderer);var p=_possibleConstructorReturn(this,e.call(this,t,n,i));return p.setupDrawBuffers(a.canvas.width,a.canvas.height),p._lightTexture=new g.a(s.a,8),p._progCopy=Object(o.a)(l.a,c.a,{uniforms:['u_viewProjectionMatrix','u_viewMatrix','u_colmap','u_normap'],attribs:['a_position','a_normal','a_uv']}),p._progShade=Object(o.a)(u.a,Object(m.a)({numLights:s.a,numGBuffers:f,xSlices:t,ySlices:n,zSlices:i,maxLightsPerCluster:h.a}),{uniforms:['u_gbuffers[0]','u_gbuffers[1]','u_gbuffers[2]','u_viewMatrix','u_invviewMatrix','u_shadingtype','u_clusterbuffer','u_lightbuffer','u_screenwidth','u_screenheight','u_near','u_far'],attribs:['a_uv']}),p.shadingtype=d,p._projectionMatrix=r.a.create(),p._viewMatrix=r.a.create(),p._viewProjectionMatrix=r.a.create(),p}return _inherits(ClusteredRenderer,e),ClusteredRenderer.prototype.setupDrawBuffers=function setupDrawBuffers(e,t){this._width=e,this._height=t,this._fbo=a.gl.createFramebuffer(),this._depthTex=a.gl.createTexture(),a.gl.bindTexture(a.gl.TEXTURE_2D,this._depthTex),a.gl.texParameteri(a.gl.TEXTURE_2D,a.gl.TEXTURE_MAG_FILTER,a.gl.NEAREST),a.gl.texParameteri(a.gl.TEXTURE_2D,a.gl.TEXTURE_MIN_FILTER,a.gl.NEAREST),a.gl.texParameteri(a.gl.TEXTURE_2D,a.gl.TEXTURE_WRAP_S,a.gl.CLAMP_TO_EDGE),a.gl.texParameteri(a.gl.TEXTURE_2D,a.gl.TEXTURE_WRAP_T,a.gl.CLAMP_TO_EDGE),a.gl.texImage2D(a.gl.TEXTURE_2D,0,a.gl.DEPTH_COMPONENT,e,t,0,a.gl.DEPTH_COMPONENT,a.gl.UNSIGNED_SHORT,null),a.gl.bindTexture(a.gl.TEXTURE_2D,null),a.gl.bindFramebuffer(a.gl.FRAMEBUFFER,this._fbo),a.gl.framebufferTexture2D(a.gl.FRAMEBUFFER,a.gl.DEPTH_ATTACHMENT,a.gl.TEXTURE_2D,this._depthTex,0),this._gbuffers=[,,];for(var n=[,,],r=0;r= clusterLightCount) { break; } \\n int texelIdx = int(float(i+1) * 0.25);\\n float V = float(texelIdx+1) / float(texelsPerCol+1);\\n vec4 texel = texture2D(u_clusterbuffer, vec2(U,V));\\n int lightIdx;\\n int texelComponent = (i+1) - (texelIdx * 4);\\n if (texelComponent == 0) {\\n lightIdx = int(texel[0]);\\n } else if (texelComponent == 1) {\\n lightIdx = int(texel[1]);\\n } else if (texelComponent == 2) {\\n lightIdx = int(texel[2]);\\n } else if (texelComponent == 3) {\\n lightIdx = int(texel[3]);\\n }\\n Light light = UnpackLight(lightIdx);\\n float lightDistance = distance(light.position, v_position);\\n vec3 L = (light.position - v_position) / lightDistance;\\n float lightIntensity = 0.6*cubicGaussian(2.0 * lightDistance / light.radius);\\n \\n //blinn-phon shading\\n vec3 viewdir = normalize(vec3(viewpos) - v_position);\\n vec3 lightdir = normalize(L);\\n vec3 halfv = normalize(lightdir+viewdir);\\n float theta = max(0.0,dot(halfv,normal));\\n float specterm;\\n if(u_shadingtype == 1)\\n {\\n specterm = pow(theta,1000.0);\\n }\\n else\\n {\\n specterm = 0.0;\\n }\\n \\n //lambert shading\\n float lambertTerm = max(dot(L, normal), 0.0);\\n \\n //toon shading:\\n float toonnum = 3.3;\\n float toonnumspec = 0.3;\\n float toonmag = 0.7;\\n float toonlamb = floor(lambertTerm*toonnum)/toonnum;\\n float toonspec = floor(specterm*toonnumspec)/toonnumspec;\\n if(u_shadingtype==2)\\n {\\n lambertTerm = lambertTerm*(1.0-toonmag)+toonlamb*toonmag;\\n specterm = specterm*(1.0-toonmag)+toonspec*toonmag;\\n }\\n \\n fragColor += albedo * (lambertTerm + 3.0*specterm)* light.color * vec3(lightIntensity);\\n }//lightloop\\n float depthval = -viewPosRaw.z; \\n const vec3 ambientLight = vec3(0.025);\\n fragColor += albedo * ambientLight;\\n //fragColor = 0.04*vec3(depthval);\\n gl_FragColor = vec4(fragColor, 1.0);\\n }\\n '}}]);\n\n\n// WEBPACK FOOTER //\n// bundle.js"],"mappings":"AAAA","sourceRoot":""} \ No newline at end of file diff --git a/img/albedo.JPG b/img/albedo.JPG new file mode 100644 index 0000000..7cdd241 Binary files /dev/null and b/img/albedo.JPG differ diff --git a/img/blinn.JPG b/img/blinn.JPG new file mode 100644 index 0000000..017a855 Binary files /dev/null and b/img/blinn.JPG differ diff --git a/img/clu.png b/img/clu.png new file mode 100644 index 0000000..a8dabb4 Binary files /dev/null and b/img/clu.png differ diff --git a/img/clus.JPG b/img/clus.JPG new file mode 100644 index 0000000..6bd48a9 Binary files /dev/null and b/img/clus.JPG differ diff --git a/img/cluster.gif b/img/cluster.gif new file mode 100644 index 0000000..b7ba711 Binary files /dev/null and b/img/cluster.gif differ diff --git a/img/comp1.JPG b/img/comp1.JPG new file mode 100644 index 0000000..fb74bda Binary files /dev/null and b/img/comp1.JPG differ diff --git a/img/deferred-v2.png b/img/deferred-v2.png new file mode 100644 index 0000000..48755ac Binary files /dev/null and b/img/deferred-v2.png differ diff --git a/img/depth.JPG b/img/depth.JPG new file mode 100644 index 0000000..ab6f1d5 Binary files /dev/null and b/img/depth.JPG differ diff --git a/img/init b/img/init new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/img/init @@ -0,0 +1 @@ + diff --git a/img/lambert.gif b/img/lambert.gif new file mode 100644 index 0000000..c972c0e Binary files /dev/null and b/img/lambert.gif differ diff --git a/img/pa.JPG b/img/pa.JPG new file mode 100644 index 0000000..223c3a7 Binary files /dev/null and b/img/pa.JPG differ diff --git a/img/purecol.JPG b/img/purecol.JPG new file mode 100644 index 0000000..882e606 Binary files /dev/null and b/img/purecol.JPG differ diff --git a/img/sc1.JPG b/img/sc1.JPG new file mode 100644 index 0000000..5b935b0 Binary files /dev/null and b/img/sc1.JPG differ diff --git a/img/surfacenor.JPG b/img/surfacenor.JPG new file mode 100644 index 0000000..69d7e67 Binary files /dev/null and b/img/surfacenor.JPG differ diff --git a/img/toon.JPG b/img/toon.JPG new file mode 100644 index 0000000..0b76746 Binary files /dev/null and b/img/toon.JPG differ diff --git a/img/toon.gif b/img/toon.gif new file mode 100644 index 0000000..46c6cc5 Binary files /dev/null and b/img/toon.gif differ diff --git a/img/xslice.JPG b/img/xslice.JPG new file mode 100644 index 0000000..25a667b Binary files /dev/null and b/img/xslice.JPG differ diff --git a/img/yslice.JPG b/img/yslice.JPG new file mode 100644 index 0000000..0c2d580 Binary files /dev/null and b/img/yslice.JPG differ diff --git a/src/main.js b/src/main.js index 0438a6d..8b94441 100755 --- a/src/main.js +++ b/src/main.js @@ -7,15 +7,33 @@ import Scene from './scene'; const FORWARD = 'Forward'; const FORWARD_PLUS = 'Forward+'; const CLUSTERED = 'Clustered'; +const lambert = 'lambert'; +const blinnphong = 'blinnphong'; +const toon = 'toon'; + +var shadingtype = 0; const params = { - renderer: FORWARD_PLUS, + renderer: FORWARD, + shadingmode:lambert, _renderer: null, }; setRenderer(params.renderer); function setRenderer(renderer) { + if(params.shadingmode == 'lambert') + { + shadingtype = 0; + } + else if(params.shadingmode == 'blinnphong') + { + shadingtype = 1; + } + else if(params.shadingmode == 'toon') + { + shadingtype = 2; + } switch(renderer) { case FORWARD: params._renderer = new ForwardRenderer(); @@ -24,13 +42,15 @@ function setRenderer(renderer) { params._renderer = new ForwardPlusRenderer(15, 15, 15); break; case CLUSTERED: - params._renderer = new ClusteredRenderer(15, 15, 15); + params._renderer = new ClusteredRenderer(15, 15, 15,shadingtype); break; } } gui.add(params, 'renderer', [FORWARD, FORWARD_PLUS, CLUSTERED]).onChange(setRenderer); +gui.add(params, 'shadingmode', [blinnphong, lambert,toon]).onChange(function (x) {setRenderer(params.renderer);}); + const scene = new Scene(); scene.loadGLTF('models/sponza/sponza.gltf'); diff --git a/src/renderers/base.js b/src/renderers/base.js index 8a975b9..64474b7 100755 --- a/src/renderers/base.js +++ b/src/renderers/base.js @@ -1,6 +1,32 @@ import TextureBuffer from './textureBuffer'; +import { NUM_LIGHTS } from '../scene'; +import { mat4, vec4, vec3, vec2 } from 'gl-matrix'; -export const MAX_LIGHTS_PER_CLUSTER = 100; +export const MAX_LIGHTS_PER_CLUSTER = 700; + +function getNormalComponents(angle) { + + let bigHypot = Math.sqrt(1 + angle*angle); + let normSide1 = 1 / bigHypot; + let normSide2 = -angle*normSide1; + return vec2.fromValues(normSide1, normSide2); +} + +function findPlanePointDis(planePos, Pt, XY) { + let interval = Math.sqrt(planePos*planePos+1); + let lightp = vec3.fromValues(Pt[0],Pt[1],Pt[2]); + let res = vec3.fromValues(0,0,0); + if(XY == 1) { + let planenor = vec3.fromValues(1.0/interval,0.0,-planePos/interval); + res = vec3.dot(lightp,planenor); + } + if(XY==2) + { + let planenor = vec3.fromValues(0.0,1.0/interval,-planePos/interval); + res = vec3.dot(lightp,planenor); + } + return res; +} export default class BaseRenderer { constructor(xSlices, ySlices, zSlices) { @@ -25,6 +51,95 @@ export default class BaseRenderer { } } - this._clusterTexture.update(); + const halfY = Math.tan((camera.fov*0.5) * (Math.PI/180.0)); + const ylengthPerCluster = (halfY * 2.0 / this._ySlices); + const xlengthPerCluster = (halfY * 2.0 / this._xSlices) * camera.aspect; + const zlengthPerCluster = (camera.far - camera.near) / this._zSlices; + const ystart = -halfY; + const xstart = -halfY * camera.aspect; + + for(let i = 0; i < NUM_LIGHTS; ++i) { + let lightRadius = scene.lights[i].radius; + let lightPos = vec4.fromValues(scene.lights[i].position[0], scene.lights[i].position[1], scene.lights[i].position[2], 1.0); + vec4.transformMat4(lightPos, lightPos, viewMatrix); + lightPos[2] *= -1.0; + + + let xminidx = this._xSlices; + let xmaxidx = this._xSlices; + let yminidx = this._ySlices; + let ymaxidx = this._ySlices; + let minposz = lightPos[2] - camera.near - lightRadius; + let maxposz = lightPos[2] - camera.near + lightRadius; + let zminidx = Math.floor(minposz / zlengthPerCluster); + let zmaxidx = Math.floor(maxposz / zlengthPerCluster)+1; + if(zminidx > this._zSlices-1 || zmaxidx < 0) { continue; } + zminidx = Math.max(0, zminidx); + zmaxidx = Math.min(this._zSlices, zmaxidx); + + for(let j = 0; j <= this._xSlices; ++j) { + let norm2 = vec2.clone(getNormalComponents(xstart+xlengthPerCluster*j)); + let norm3 = vec3.fromValues(norm2[0], 0, norm2[1]); + if(vec3.dot(lightPos, norm3) < lightRadius) { + xminidx = Math.max(0, j-1); + break; + } + } + + + for(let j = xminidx+1; j<=this.xSlices; ++j) { + let norm2 = vec2.clone(getNormalComponents(xstart+xlengthPerCluster*j)); + let norm3 = vec3.fromValues(norm2[0], 0, norm2[1]); + if(vec3.dot(lightPos, norm3) < -lightRadius) { + xmaxidx = Math.max(0, j-1); + break; + } + } + + + for(let j = 0; j <= this._ySlices; ++j) { + let norm2 = vec2.clone(getNormalComponents(ystart+ylengthPerCluster*j)); + let norm3 = vec3.fromValues(0, norm2[0], norm2[1]); + if(vec3.dot(lightPos, norm3) < lightRadius) { + yminidx = Math.max(0, j-1); + break; + } + } + + + for(let j = yminidx+1; j<=this.ySlices; ++j) { + let norm2 = vec2.clone(getNormalComponents(ystart+ylengthPerCluster*j)); + let norm3 = vec3.fromValues(0, norm2[0], norm2[1]); + if(vec3.dot(lightPos, norm3) < -lightRadius) { + ymaxidx = Math.max(0, j-1); + break; + } + } + + + + for(let z = zminidx; z < zmaxidx; ++z) { + for(let y = yminidx; y < ymaxidx; ++y) { + for(let x = xminidx; x < xmaxidx; ++x) { + let clusterIdx = x + y*this._xSlices + z*this._xSlices*this._ySlices; + let lightCountIdx = this._clusterTexture.bufferIndex(clusterIdx, 0); + let lightCount = 1 + this._clusterTexture.buffer[lightCountIdx]; + + if(lightCount <= MAX_LIGHTS_PER_CLUSTER) { + this._clusterTexture.buffer[lightCountIdx] = lightCount; + let texel = Math.floor(lightCount*0.25); + let texelIdx = this._clusterTexture.bufferIndex(clusterIdx, texel); + let componentIdx = lightCount - texel*4; + this._clusterTexture.buffer[texelIdx+componentIdx] = i; + } + } + } + } + + + + }//end light loop + + this._clusterTexture.update(); } } \ No newline at end of file diff --git a/src/renderers/clustered.js b/src/renderers/clustered.js index 46b8278..11dceb9 100755 --- a/src/renderers/clustered.js +++ b/src/renderers/clustered.js @@ -1,5 +1,5 @@ import { gl, WEBGL_draw_buffers, canvas } from '../init'; -import { mat4, vec4 } from 'gl-matrix'; +import { mat4, vec4 ,vec3, vec2} from 'gl-matrix'; import { loadShaderProgram, renderFullscreenQuad } from '../utils'; import { NUM_LIGHTS } from '../scene'; import toTextureVert from '../shaders/deferredToTexture.vert.glsl'; @@ -8,31 +8,36 @@ import QuadVertSource from '../shaders/quad.vert.glsl'; import fsSource from '../shaders/deferred.frag.glsl.js'; import TextureBuffer from './textureBuffer'; import BaseRenderer from './base'; +import {MAX_LIGHTS_PER_CLUSTER} from "./base"; -export const NUM_GBUFFERS = 4; +export const NUM_GBUFFERS = 2; export default class ClusteredRenderer extends BaseRenderer { - constructor(xSlices, ySlices, zSlices) { + constructor(xSlices, ySlices, zSlices,_shadingtype) { super(xSlices, ySlices, zSlices); - + this.setupDrawBuffers(canvas.width, canvas.height); - + // Create a texture to store light data this._lightTexture = new TextureBuffer(NUM_LIGHTS, 8); - + this._progCopy = loadShaderProgram(toTextureVert, toTextureFrag, { - uniforms: ['u_viewProjectionMatrix', 'u_colmap', 'u_normap'], + uniforms: ['u_viewProjectionMatrix','u_viewMatrix', 'u_colmap', 'u_normap'], attribs: ['a_position', 'a_normal', 'a_uv'], }); this._progShade = loadShaderProgram(QuadVertSource, fsSource({ numLights: NUM_LIGHTS, numGBuffers: NUM_GBUFFERS, + xSlices: xSlices, ySlices: ySlices, zSlices: zSlices, + maxLightsPerCluster: MAX_LIGHTS_PER_CLUSTER, + }), { - uniforms: ['u_gbuffers[0]', 'u_gbuffers[1]', 'u_gbuffers[2]', 'u_gbuffers[3]'], + uniforms: ['u_gbuffers[0]', 'u_gbuffers[1]', 'u_gbuffers[2]', 'u_viewMatrix','u_invviewMatrix','u_shadingtype','u_clusterbuffer','u_lightbuffer','u_screenwidth', 'u_screenheight','u_near','u_far'], attribs: ['a_uv'], }); + this.shadingtype = _shadingtype; this._projectionMatrix = mat4.create(); this._viewMatrix = mat4.create(); this._viewProjectionMatrix = mat4.create(); @@ -43,7 +48,7 @@ export default class ClusteredRenderer extends BaseRenderer { this._height = height; this._fbo = gl.createFramebuffer(); - + //Create, bind, and store a depth target texture for the FBO this._depthTex = gl.createTexture(); gl.bindTexture(gl.TEXTURE_2D, this._depthTex); @@ -71,7 +76,7 @@ export default class ClusteredRenderer extends BaseRenderer { gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.FLOAT, null); gl.bindTexture(gl.TEXTURE_2D, null); - gl.framebufferTexture2D(gl.FRAMEBUFFER, attachments[i], gl.TEXTURE_2D, this._gbuffers[i], 0); + gl.framebufferTexture2D(gl.FRAMEBUFFER, attachments[i], gl.TEXTURE_2D, this._gbuffers[i], 0); } if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) { @@ -106,6 +111,8 @@ export default class ClusteredRenderer extends BaseRenderer { // Update the camera matrices camera.updateMatrixWorld(); mat4.invert(this._viewMatrix, camera.matrixWorld.elements); + let invviewMatrix = mat4.create(); + mat4.invert(invviewMatrix,this._viewMatrix) mat4.copy(this._projectionMatrix, camera.projectionMatrix.elements); mat4.multiply(this._viewProjectionMatrix, this._projectionMatrix, this._viewMatrix); @@ -123,10 +130,10 @@ export default class ClusteredRenderer extends BaseRenderer { // Upload the camera matrix gl.uniformMatrix4fv(this._progCopy.u_viewProjectionMatrix, false, this._viewProjectionMatrix); - + gl.uniformMatrix4fv(this._progCopy.u_viewMatrix,false,this._viewMatrix); // Draw the scene. This function takes the shader program so that the model's textures can be bound to the right inputs scene.draw(this._progCopy); - + // Update the buffer used to populate the texture packed with light data for (let i = 0; i < NUM_LIGHTS; ++i) { this._lightTexture.buffer[this._lightTexture.bufferIndex(i, 0) + 0] = scene.lights[i].position[0]; @@ -152,9 +159,24 @@ export default class ClusteredRenderer extends BaseRenderer { // Use this shader program gl.useProgram(this._progShade.glShaderProgram); - + gl.uniformMatrix4fv(this._progShade.u_viewMatrix,false,this._viewMatrix); + gl.uniformMatrix4fv(this._progShade.u_invviewMatrix,false,invviewMatrix); // TODO: Bind any other shader inputs + gl.activeTexture(gl.TEXTURE3); + gl.bindTexture(gl.TEXTURE_2D, this._clusterTexture.glTexture); + gl.uniform1i(this._progShade.u_clusterbuffer, 3); + + gl.activeTexture(gl.TEXTURE4); + gl.bindTexture(gl.TEXTURE_2D,this._lightTexture.glTexture); + gl.uniform1i(this._progShade.u_lightbuffer,4); + + gl.uniform1f(this._progShade.u_screenwidth, canvas.width); + gl.uniform1f(this._progShade.u_screenheight, canvas.height); + + gl.uniform1f(this._progShade.u_far,camera.far); + gl.uniform1f(this._progShade.u_near,camera.near); + gl.uniform1i(this._progShade.u_shadingtype,this.shadingtype); // Bind g-buffers const firstGBufferBinding = 0; // You may have to change this if you use other texture slots for (let i = 0; i < NUM_GBUFFERS; i++) { diff --git a/src/renderers/forward.js b/src/renderers/forward.js index ac044f9..d285fc8 100644 --- a/src/renderers/forward.js +++ b/src/renderers/forward.js @@ -7,18 +7,18 @@ import fsSource from '../shaders/forward.frag.glsl.js'; import TextureBuffer from './textureBuffer'; export default class ForwardRenderer { - constructor() { + constructor(_shadingtype) { // Create a texture to store light data this._lightTexture = new TextureBuffer(NUM_LIGHTS, 8); - // Initialize a shader program. The fragment shader source is compiled based on the number of lights this._shaderProgram = loadShaderProgram(vsSource, fsSource({ numLights: NUM_LIGHTS, + }), { - uniforms: ['u_viewProjectionMatrix', 'u_colmap', 'u_normap', 'u_lightbuffer'], + uniforms: ['u_viewProjectionMatrix', 'u_colmap', 'u_normap', 'u_lightbuffer','u_shadingtype'], attribs: ['a_position', 'a_normal', 'a_uv'], }); - + this.shadingtype = _shadingtype; this._projectionMatrix = mat4.create(); this._viewMatrix = mat4.create(); this._viewProjectionMatrix = mat4.create(); @@ -64,6 +64,7 @@ export default class ForwardRenderer { gl.activeTexture(gl.TEXTURE2); gl.bindTexture(gl.TEXTURE_2D, this._lightTexture.glTexture); gl.uniform1i(this._shaderProgram.u_lightbuffer, 2); + gl.uniform1i(this._shaderProgram.u_shadingtype,this.shadingtype); // Draw the scene. This function takes the shader program so that the model's textures can be bound to the right inputs scene.draw(this._shaderProgram); diff --git a/src/renderers/forwardPlus.js b/src/renderers/forwardPlus.js index a02649c..cde3822 100755 --- a/src/renderers/forwardPlus.js +++ b/src/renderers/forwardPlus.js @@ -6,6 +6,7 @@ import vsSource from '../shaders/forwardPlus.vert.glsl'; import fsSource from '../shaders/forwardPlus.frag.glsl.js'; import TextureBuffer from './textureBuffer'; import BaseRenderer from './base'; +import { MAX_LIGHTS_PER_CLUSTER} from "./base"; export default class ForwardPlusRenderer extends BaseRenderer { constructor(xSlices, ySlices, zSlices) { @@ -16,8 +17,10 @@ export default class ForwardPlusRenderer extends BaseRenderer { this._shaderProgram = loadShaderProgram(vsSource, fsSource({ numLights: NUM_LIGHTS, + xSlices: xSlices,ySlices: ySlices,zSlices: zSlices,maxLightsPerCluster: MAX_LIGHTS_PER_CLUSTER, }), { - uniforms: ['u_viewProjectionMatrix', 'u_colmap', 'u_normap', 'u_lightbuffer', 'u_clusterbuffer'], + uniforms: ['u_viewProjectionMatrix', 'u_colmap', 'u_normap', 'u_lightbuffer', 'u_clusterbuffer','u_viewMatrix', + 'u_near','u_far','u_screenwidth', 'u_screenheight'], attribs: ['a_position', 'a_normal', 'a_uv'], }); @@ -64,7 +67,7 @@ export default class ForwardPlusRenderer extends BaseRenderer { // Upload the camera matrix gl.uniformMatrix4fv(this._shaderProgram.u_viewProjectionMatrix, false, this._viewProjectionMatrix); - + gl.uniformMatrix4fv(this._shaderProgram.u_viewMatrix,false,this._viewMatrix); // Set the light texture as a uniform input to the shader gl.activeTexture(gl.TEXTURE2); gl.bindTexture(gl.TEXTURE_2D, this._lightTexture.glTexture); @@ -76,7 +79,10 @@ export default class ForwardPlusRenderer extends BaseRenderer { gl.uniform1i(this._shaderProgram.u_clusterbuffer, 3); // TODO: Bind any other shader inputs - + gl.uniform1f(this._shaderProgram.u_screenwidth, canvas.width); + gl.uniform1f(this._shaderProgram.u_screenheight,canvas.height); + gl.uniform1f(this._shaderProgram.u_near,camera.near); + gl.uniform1f(this._shaderProgram.u_far,camera.far); // Draw the scene. This function takes the shader program so that the model's textures can be bound to the right inputs scene.draw(this._shaderProgram); } diff --git a/src/scene.js b/src/scene.js index 35f6700..51aee6d 100644 --- a/src/scene.js +++ b/src/scene.js @@ -4,11 +4,11 @@ import { gl } from './init'; // TODO: Edit if you want to change the light initial positions export const LIGHT_MIN = [-14, 0, -6]; export const LIGHT_MAX = [14, 20, 6]; -export const LIGHT_RADIUS = 5.0; -export const LIGHT_DT = -0.03; +export const LIGHT_RADIUS = 4.0; +export const LIGHT_DT = -0.07; // TODO: This controls the number of lights -export const NUM_LIGHTS = 100; +export const NUM_LIGHTS = 600; class Scene { constructor() { @@ -23,9 +23,9 @@ class Scene { Math.random() * (LIGHT_MAX[2] - LIGHT_MIN[2]) + LIGHT_MIN[2], ]), color: new Float32Array([ - 0.5 + 0.5 * Math.random(), - 0.5 + 0.5 * Math.random(), - 0.5 + Math.random(), + 0.1 + 0.9 * Math.random(), + 0.1 + 0.9 * Math.random(), + 0.1 + 0.9 * Math.random(), ]), radius: LIGHT_RADIUS, }); diff --git a/src/shaders/deferred.frag.glsl.js b/src/shaders/deferred.frag.glsl.js index 50f1e75..70f17fe 100644 --- a/src/shaders/deferred.frag.glsl.js +++ b/src/shaders/deferred.frag.glsl.js @@ -4,17 +4,157 @@ export default function(params) { precision highp float; uniform sampler2D u_gbuffers[${params.numGBuffers}]; + uniform sampler2D u_clusterbuffer; + uniform sampler2D u_lightbuffer; + uniform mat4 u_viewMatrix; + uniform mat4 u_invviewMatrix; + uniform float u_near; + uniform float u_far; + uniform float u_screenwidth; + uniform float u_screenheight; + uniform int u_shadingtype; varying vec2 v_uv; + struct Light { + vec3 position; + float radius; + vec3 color; + }; + + float ExtractFloat(sampler2D texture, int textureWidth, int textureHeight, int index, int component) { + float u = float(index + 1) / float(textureWidth + 1); + int pixel = component / 4; + float v = float(pixel + 1) / float(textureHeight + 1); + vec4 texel = texture2D(texture, vec2(u, v)); + int texelComponent = component - pixel * 4; + if (texelComponent == 0) { + return texel[0]; + } else if (texelComponent == 1) { + return texel[1]; + } else if (texelComponent == 2) { + return texel[2]; + } else if (texelComponent == 3) { + return texel[3]; + } + } + + Light UnpackLight(int index) { + Light light; + float u = float(index + 1) / float(${params.numLights + 1}); + vec4 v1 = texture2D(u_lightbuffer, vec2(u, 0.3)); + vec4 v2 = texture2D(u_lightbuffer, vec2(u, 0.6)); + light.position = v1.xyz; + // LOOK: This extracts the 4th float (radius) of the (index)th light in the buffer + // Note that this is just an example implementation to extract one float. + // There are more efficient ways if you need adjacent values + light.radius = v1.w;//ExtractFloat(u_lightbuffer, ${params.numLights}, 2, index, 3); + light.color = v2.rgb; + return light; + } + + // Cubic approximation of gaussian curve so we falloff to exactly 0 at the light radius + float cubicGaussian(float h) { + if (h < 1.0) { + return 0.25 * pow(2.0 - h, 3.0) - pow(1.0 - h, 3.0); + } else if (h < 2.0) { + return 0.25 * pow(2.0 - h, 3.0); + } else { + return 0.0; + } + } + void main() { // TODO: extract data from g buffers and do lighting - // vec4 gb0 = texture2D(u_gbuffers[0], v_uv); - // vec4 gb1 = texture2D(u_gbuffers[1], v_uv); - // vec4 gb2 = texture2D(u_gbuffers[2], v_uv); - // vec4 gb3 = texture2D(u_gbuffers[3], v_uv); - - gl_FragColor = vec4(v_uv, 0.0, 1.0); - } - `; + vec4 gbuffer0 = texture2D(u_gbuffers[0], v_uv); + vec4 gbuffer1 = texture2D(u_gbuffers[1], v_uv); + //vec4 gbuffer2 = texture2D(u_gbuffers[2], v_uv); + //vec3 normal = gbuffer2.xyz; + vec3 normal; + vec3 v_position = gbuffer1.xyz; + + vec2 snor = vec2(gbuffer0.w,gbuffer1.w); + float ival = sqrt(1.0 - gbuffer0.w *gbuffer0.w-gbuffer1.w*gbuffer1.w); + vec4 normdecompressed = u_invviewMatrix*vec4(snor,ival,0.0); + normal = normalize(normdecompressed.xyz); + + + vec3 albedo = gbuffer0.rgb; + int clusterXidx = int( gl_FragCoord.x / (float(u_screenwidth) / float(${params.xSlices})) ); + int clusterYidx = int( gl_FragCoord.y / (float(u_screenheight) / float(${params.ySlices})) ); + + + vec4 viewPosRaw = u_viewMatrix * vec4(v_position,1.0); + vec4 viewpos = u_invviewMatrix*vec4(0.0,0.0,0.0,1.0); + + + int clusterZidx = int( (-viewPosRaw.z-u_near) / (float(u_far-u_near) / float(${params.zSlices})) ); + int clusterIdx = clusterXidx + clusterYidx*${params.xSlices} + clusterZidx*${params.xSlices}*${params.ySlices}; + int clusterCount = ${params.xSlices}*${params.ySlices}*${params.zSlices}; + + float U = float(clusterIdx+1) / float(clusterCount+1); + int clusterLightCount = int(texture2D(u_clusterbuffer, vec2(U,0)).r); + int texelsPerCol = int(float(${params.maxLightsPerCluster}+1)/4.0) + 1; + + vec3 fragColor = vec3(0.0); + for (int i = 0; i < ${params.numLights}; ++i) { + if(i >= clusterLightCount) { break; } + int texelIdx = int(float(i+1) * 0.25); + float V = float(texelIdx+1) / float(texelsPerCol+1); + vec4 texel = texture2D(u_clusterbuffer, vec2(U,V)); + int lightIdx; + int texelComponent = (i+1) - (texelIdx * 4); + if (texelComponent == 0) { + lightIdx = int(texel[0]); + } else if (texelComponent == 1) { + lightIdx = int(texel[1]); + } else if (texelComponent == 2) { + lightIdx = int(texel[2]); + } else if (texelComponent == 3) { + lightIdx = int(texel[3]); + } + Light light = UnpackLight(lightIdx); + float lightDistance = distance(light.position, v_position); + vec3 L = (light.position - v_position) / lightDistance; + float lightIntensity = 0.6*cubicGaussian(2.0 * lightDistance / light.radius); + + //blinn-phon shading + vec3 viewdir = normalize(vec3(viewpos) - v_position); + vec3 lightdir = normalize(L); + vec3 halfv = normalize(lightdir+viewdir); + float theta = max(0.0,dot(halfv,normal)); + float specterm; + if(u_shadingtype == 1) + { + specterm = pow(theta,1000.0); + } + else + { + specterm = 0.0; + } + + //lambert shading + float lambertTerm = max(dot(L, normal), 0.0); + + //toon shading: + float toonnum = 3.3; + float toonnumspec = 0.3; + float toonmag = 0.7; + float toonlamb = floor(lambertTerm*toonnum)/toonnum; + float toonspec = floor(specterm*toonnumspec)/toonnumspec; + if(u_shadingtype==2) + { + lambertTerm = lambertTerm*(1.0-toonmag)+toonlamb*toonmag; + specterm = specterm*(1.0-toonmag)+toonspec*toonmag; + } + + fragColor += albedo * (lambertTerm + 3.0*specterm)* light.color * vec3(lightIntensity); + }//lightloop + float depthval = -viewPosRaw.z; + const vec3 ambientLight = vec3(0.025); + fragColor += albedo * ambientLight; + //fragColor = 0.04*vec3(depthval); + gl_FragColor = vec4(fragColor, 1.0); + } + `; } \ No newline at end of file diff --git a/src/shaders/deferredToTexture.frag.glsl b/src/shaders/deferredToTexture.frag.glsl index bafc086..4624fd0 100644 --- a/src/shaders/deferredToTexture.frag.glsl +++ b/src/shaders/deferredToTexture.frag.glsl @@ -4,6 +4,7 @@ precision highp float; uniform sampler2D u_colmap; uniform sampler2D u_normap; +uniform mat4 u_viewMatrix; varying vec3 v_position; varying vec3 v_normal; @@ -21,6 +22,10 @@ void main() { vec3 norm = applyNormalMap(v_normal, vec3(texture2D(u_normap, v_uv))); vec3 col = vec3(texture2D(u_colmap, v_uv)); + vec3 compressednorm = normalize(vec3(u_viewMatrix * vec4(norm,0.0))); + gl_FragData[0] = vec4(col, compressednorm.x); + gl_FragData[1] = vec4(v_position, compressednorm.y); + //gl_FragData[2] = vec4(norm, 0.0); // TODO: populate your g buffer // gl_FragData[0] = ?? // gl_FragData[1] = ?? diff --git a/src/shaders/forward.frag.glsl.js b/src/shaders/forward.frag.glsl.js index 47f40a1..14fa93e 100644 --- a/src/shaders/forward.frag.glsl.js +++ b/src/shaders/forward.frag.glsl.js @@ -6,6 +6,7 @@ export default function(params) { uniform sampler2D u_colmap; uniform sampler2D u_normap; uniform sampler2D u_lightbuffer; + uniform int u_shadingtype; varying vec3 v_position; varying vec3 v_normal; diff --git a/src/shaders/forwardPlus.frag.glsl.js b/src/shaders/forwardPlus.frag.glsl.js index 022fda7..eca9ebb 100644 --- a/src/shaders/forwardPlus.frag.glsl.js +++ b/src/shaders/forwardPlus.frag.glsl.js @@ -11,6 +11,12 @@ export default function(params) { // TODO: Read this buffer to determine the lights influencing a cluster uniform sampler2D u_clusterbuffer; + + uniform mat4 u_viewMatrix; + uniform float u_screenwidth; + uniform float u_screenheight; + uniform float u_near; + uniform float u_far; varying vec3 v_position; varying vec3 v_normal; @@ -78,11 +84,42 @@ export default function(params) { vec3 albedo = texture2D(u_colmap, v_uv).rgb; vec3 normap = texture2D(u_normap, v_uv).xyz; vec3 normal = applyNormalMap(v_normal, normap); - + + int clusterXidx = int( gl_FragCoord.x / (float(u_screenwidth) / float(${params.xSlices})) ); + int clusterYidx = int( gl_FragCoord.y / (float(u_screenheight) / float(${params.ySlices})) ); + vec4 fragCamPos = u_viewMatrix * vec4(v_position,1.0); + int clusterZidx = int( (-fragCamPos.z-u_near) / (float(u_far-u_near) / float(${params.zSlices})) ); + + int clusterIdx = clusterXidx + clusterYidx*${params.xSlices} + clusterZidx*${params.xSlices}*${params.ySlices}; + int clusterCount = ${params.xSlices}*${params.ySlices}*${params.zSlices}; + float U = float(clusterIdx+1) / float(clusterCount+1); + int clusterLightCount = int(texture2D(u_clusterbuffer, vec2(U,0)).r); + + int texelsPerCol = int(float(${params.maxLightsPerCluster}+1) * 0.25) + 1; vec3 fragColor = vec3(0.0); + + for (int i = 0; i < ${params.numLights}; ++i) { - Light light = UnpackLight(i); + if(i >= clusterLightCount) { break; } + int texelIdx = int(float(i+1) * 0.25); + float V = float(texelIdx+1) / float(texelsPerCol+1); + vec4 texel = texture2D(u_clusterbuffer, vec2(U,V)); + + int lightIdx; + int texelComponent = (i+1) - (texelIdx * 4); + + if (texelComponent == 0) { + lightIdx = int(texel[0]); + } else if (texelComponent == 1) { + lightIdx = int(texel[1]); + } else if (texelComponent == 2) { + lightIdx = int(texel[2]); + } else if (texelComponent == 3) { + lightIdx = int(texel[3]); + } + Light light = UnpackLight(lightIdx); + float lightDistance = distance(light.position, v_position); vec3 L = (light.position - v_position) / lightDistance; diff --git a/webpack.config.js b/webpack.config.js index be99a75..d8af47b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -44,9 +44,9 @@ module.exports = function(env) { } }), ].filter(p => p), - devtool: 'source-map', + devtool: 'cheap-source-map', devServer: { - port: 5650, + port: 5660, publicPath: '/build/' }, };