bytev-charts
Version:
基于echarts和JavaScript及ES6封装的一个可以直接调用的图表组件库,内置主题设计,简单快捷,且支持用户自定义配置; npm 安装方式: npm install bytev-charts 若启动提示还需额外install插件,则运行 npm install @babel/runtime-corejs2 即可;
2 lines • 658 kB
JavaScript
import _typeof from"@babel/runtime-corejs2/helpers/typeof";import"core-js/modules/es.function.name.js";import"core-js/modules/es.string.repeat.js";import"core-js/modules/es.array.map.js";import"core-js/modules/es.array.iterator.js";import"core-js/modules/es.array-buffer.slice.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.typed-array.int8-array.js";import"core-js/modules/es.typed-array.copy-within.js";import"core-js/modules/es.typed-array.every.js";import"core-js/modules/es.typed-array.fill.js";import"core-js/modules/es.typed-array.filter.js";import"core-js/modules/es.typed-array.find.js";import"core-js/modules/es.typed-array.find-index.js";import"core-js/modules/es.typed-array.for-each.js";import"core-js/modules/es.typed-array.includes.js";import"core-js/modules/es.typed-array.index-of.js";import"core-js/modules/es.typed-array.iterator.js";import"core-js/modules/es.typed-array.join.js";import"core-js/modules/es.typed-array.last-index-of.js";import"core-js/modules/es.typed-array.map.js";import"core-js/modules/es.typed-array.reduce.js";import"core-js/modules/es.typed-array.reduce-right.js";import"core-js/modules/es.typed-array.reverse.js";import"core-js/modules/es.typed-array.set.js";import"core-js/modules/es.typed-array.slice.js";import"core-js/modules/es.typed-array.some.js";import"core-js/modules/es.typed-array.sort.js";import"core-js/modules/es.typed-array.subarray.js";import"core-js/modules/es.typed-array.to-locale-string.js";import"core-js/modules/es.typed-array.to-string.js";import"core-js/modules/es.typed-array.uint8-array.js";import"core-js/modules/es.typed-array.uint8-clamped-array.js";import"core-js/modules/es.typed-array.int16-array.js";import"core-js/modules/es.typed-array.uint16-array.js";import"core-js/modules/es.typed-array.int32-array.js";import"core-js/modules/es.typed-array.uint32-array.js";import"core-js/modules/es.typed-array.float32-array.js";import"core-js/modules/es.typed-array.float64-array.js";import"core-js/modules/es.string.sub.js";import"core-js/modules/es.array.slice.js";import"core-js/modules/es.promise.js";import"core-js/modules/es.array.sort.js";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.trim.js";import"core-js/modules/es.string.split.js";import"core-js/modules/es.array.join.js";import"core-js/modules/es.string.replace.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.array.index-of.js";import"core-js/modules/es.array.for-each.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.math.sign.js";import"core-js/modules/es.array.reverse.js";import"core-js/modules/es.array.concat.js";import"core-js/modules/es.date.to-json.js";import"core-js/modules/web.url.to-json.js";import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.array.splice.js";import"core-js/modules/es.number.epsilon.js";import"core-js/modules/es.number.constructor.js";import"core-js/modules/es.number.is-integer.js";import"core-js/modules/es.string.match.js";import"core-js/modules/es.date.to-string.js";import"core-js/modules/es.regexp.to-string.js";import"core-js/modules/es.object.assign.js";import"core-js/modules/es.array-buffer.is-view.js";import"core-js/modules/es.array-buffer.constructor.js";import"core-js/modules/es.data-view.js";import"core-js/modules/es.array.find.js";import"core-js/modules/web.timers.js";import"core-js/modules/es.string.search.js";import"core-js/modules/es.array.last-index-of.js";import"core-js/modules/es.function.bind.js";import"core-js/modules/es.regexp.constructor.js";import"core-js/modules/es.math.log2.js";import _Object$defineProperty from"@babel/runtime-corejs2/core-js/object/define-property";import _Object$defineProperties from"@babel/runtime-corejs2/core-js/object/define-properties";import _Array$isArray from"@babel/runtime-corejs2/core-js/array/is-array";import _Number$isInteger from"@babel/runtime-corejs2/core-js/number/is-integer";import _WeakMap from"@babel/runtime-corejs2/core-js/weak-map";import _Object$keys from"@babel/runtime-corejs2/core-js/object/keys";import _Number$MAX_SAFE_INTEGER from"@babel/runtime-corejs2/core-js/number/max-safe-integer";import _parseInt from"@babel/runtime-corejs2/core-js/parse-int";import _parseFloat from"@babel/runtime-corejs2/core-js/parse-float";import _Map from"@babel/runtime-corejs2/core-js/map";import _Number$EPSILON from"@babel/runtime-corejs2/core-js/number/epsilon";import _Object$assign from"@babel/runtime-corejs2/core-js/object/assign";import _Object$create from"@babel/runtime-corejs2/core-js/object/create";import _JSON$stringify from"@babel/runtime-corejs2/core-js/json/stringify";import _Object$freeze from"@babel/runtime-corejs2/core-js/object/freeze";import _Promise from"@babel/runtime-corejs2/core-js/promise";import _Array$from from"@babel/runtime-corejs2/core-js/array/from";// threejs.org/license
(function(k,La){"object"===(typeof exports==="undefined"?"undefined":_typeof(exports))&&"undefined"!==typeof module?La(exports):"function"===typeof define&&define.amd?define(["exports"],La):(k=k||self,La(k.THREE={}));})(this,function(k){function La(){}function fa(c,a,b,d,e,f,g,h,l,n){_Object$defineProperty(this,"id",{value:gj++});this.uuid=T.generateUUID();this.name="";this.image=void 0!==c?c:fa.DEFAULT_IMAGE;this.mipmaps=[];this.mapping=void 0!==a?a:fa.DEFAULT_MAPPING;this.wrapS=void 0!==b?b:1001;this.wrapT=void 0!==d?d:1001;this.magFilter=void 0!==e?e:1006;this.minFilter=void 0!==f?f:1008;this.anisotropy=void 0!==l?l:1;this.format=void 0!==g?g:1023;this.internalFormat=null;this.type=void 0!==h?h:1009;this.offset=new p(0,0);this.repeat=new p(1,1);this.center=new p(0,0);this.rotation=0;this.matrixAutoUpdate=!0;this.matrix=new X();this.generateMipmaps=!0;this.premultiplyAlpha=!1;this.flipY=!0;this.unpackAlignment=4;this.encoding=void 0!==n?n:3E3;this.version=0;this.onUpdate=null;}function Sa(c,a,b){this.width=c;this.height=a;this.scissor=new B(0,0,c,a);this.scissorTest=!1;this.viewport=new B(0,0,c,a);b=b||{};this.texture=new fa(void 0,b.mapping,b.wrapS,b.wrapT,b.magFilter,b.minFilter,b.format,b.type,b.anisotropy,b.encoding);this.texture.image={};this.texture.image.width=c;this.texture.image.height=a;this.texture.generateMipmaps=void 0!==b.generateMipmaps?b.generateMipmaps:!1;this.texture.minFilter=void 0!==b.minFilter?b.minFilter:1006;this.depthBuffer=void 0!==b.depthBuffer?b.depthBuffer:!0;this.stencilBuffer=void 0!==b.stencilBuffer?b.stencilBuffer:!1;this.depthTexture=void 0!==b.depthTexture?b.depthTexture:null;}function lg(c,a,b){Sa.call(this,c,a,b);this.samples=4;}function mg(c,a,b,d,e){for(var f=0,g=c.length-3;f<=g;f+=3){jc.fromArray(c,f);var h=e.x*Math.abs(jc.x)+e.y*Math.abs(jc.y)+e.z*Math.abs(jc.z),l=a.dot(jc),n=b.dot(jc),r=d.dot(jc);if(Math.max(-Math.max(l,n,r),Math.min(l,n,r))>h)return!1;}return!0;}function F(){_Object$defineProperty(this,"id",{value:hj++});this.uuid=T.generateUUID();this.name="";this.type="Object3D";this.parent=null;this.children=[];this.up=F.DefaultUp.clone();var c=new m(),a=new ra(),b=new O(),d=new m(1,1,1);a._onChange(function(){b.setFromEuler(a,!1);});b._onChange(function(){a.setFromQuaternion(b,void 0,!1);});_Object$defineProperties(this,{position:{configurable:!0,enumerable:!0,value:c},rotation:{configurable:!0,enumerable:!0,value:a},quaternion:{configurable:!0,enumerable:!0,value:b},scale:{configurable:!0,enumerable:!0,value:d},modelViewMatrix:{value:new z()},normalMatrix:{value:new X()}});this.matrix=new z();this.matrixWorld=new z();this.matrixAutoUpdate=F.DefaultMatrixAutoUpdate;this.matrixWorldNeedsUpdate=!1;this.layers=new nb();this.visible=!0;this.receiveShadow=this.castShadow=!1;this.frustumCulled=!0;this.renderOrder=0;this.userData={};}function ng(c,a,b){0>b&&(b+=1);1<b&&--b;return b<1/6?c+6*(a-c)*b:.5>b?a:b<2/3?c+6*(a-c)*(2/3-b):c;}function og(c){return .04045>c?.0773993808*c:Math.pow(.9478672986*c+.0521327014,2.4);}function pg(c){return .0031308>c?12.92*c:1.055*Math.pow(c,.41666)-.055;}function L(){_Object$defineProperty(this,"id",{value:ij++});this.uuid=T.generateUUID();this.name="";this.type="Material";this.fog=!0;this.blending=1;this.side=0;this.vertexColors=this.flatShading=!1;this.opacity=1;this.transparent=!1;this.blendSrc=204;this.blendDst=205;this.blendEquation=100;this.blendEquationAlpha=this.blendDstAlpha=this.blendSrcAlpha=null;this.depthFunc=3;this.depthWrite=this.depthTest=!0;this.stencilWriteMask=255;this.stencilFunc=519;this.stencilRef=0;this.stencilFuncMask=255;this.stencilZPass=this.stencilZFail=this.stencilFail=7680;this.stencilWrite=!1;this.clippingPlanes=null;this.clipShadows=this.clipIntersection=!1;this.shadowSide=null;this.colorWrite=!0;this.precision=null;this.polygonOffset=!1;this.polygonOffsetUnits=this.polygonOffsetFactor=0;this.dithering=!1;this.alphaTest=0;this.premultipliedAlpha=!1;this.toneMapped=this.visible=!0;this.userData={};this.version=0;}function Za(c){L.call(this);this.type="MeshBasicMaterial";this.color=new x(16777215);this.lightMap=this.map=null;this.lightMapIntensity=1;this.aoMap=null;this.aoMapIntensity=1;this.envMap=this.alphaMap=this.specularMap=null;this.combine=0;this.reflectivity=1;this.refractionRatio=.98;this.wireframe=!1;this.wireframeLinewidth=1;this.wireframeLinejoin=this.wireframeLinecap="round";this.morphTargets=this.skinning=!1;this.setValues(c);}function N(c,a,b){if(_Array$isArray(c))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="";this.array=c;this.itemSize=a;this.count=void 0!==c?c.length/a:0;this.normalized=!0===b;this.usage=35044;this.updateRange={offset:0,count:-1};this.version=0;}function Nd(c,a,b){N.call(this,new Int8Array(c),a,b);}function Od(c,a,b){N.call(this,new Uint8Array(c),a,b);}function Pd(c,a,b){N.call(this,new Uint8ClampedArray(c),a,b);}function Qd(c,a,b){N.call(this,new Int16Array(c),a,b);}function kc(c,a,b){N.call(this,new Uint16Array(c),a,b);}function Rd(c,a,b){N.call(this,new Int32Array(c),a,b);}function lc(c,a,b){N.call(this,new Uint32Array(c),a,b);}function I(c,a,b){N.call(this,new Float32Array(c),a,b);}function Sd(c,a,b){N.call(this,new Float64Array(c),a,b);}function yh(c){if(0===c.length)return-Infinity;for(var a=c[0],b=1,d=c.length;b<d;++b){c[b]>a&&(a=c[b]);}return a;}function G(){_Object$defineProperty(this,"id",{value:jj+=2});this.uuid=T.generateUUID();this.name="";this.type="BufferGeometry";this.index=null;this.attributes={};this.morphAttributes={};this.morphTargetsRelative=!1;this.groups=[];this.boundingSphere=this.boundingBox=null;this.drawRange={start:0,count:Infinity};this.userData={};}function na(c,a){F.call(this);this.type="Mesh";this.geometry=void 0!==c?c:new G();this.material=void 0!==a?a:new Za();this.updateMorphTargets();}function zh(c,a,b,d,e,f,g,h){if(null===(1===a.side?d.intersectTriangle(g,f,e,!0,h):d.intersectTriangle(e,f,g,2!==a.side,h)))return null;Ve.copy(h);Ve.applyMatrix4(c.matrixWorld);a=b.ray.origin.distanceTo(Ve);return a<b.near||a>b.far?null:{distance:a,point:Ve.clone(),object:c};}function We(c,a,b,d,e,f,g,h,l,n,r,u){Mb.fromBufferAttribute(e,n);Nb.fromBufferAttribute(e,r);Ob.fromBufferAttribute(e,u);e=c.morphTargetInfluences;if(a.morphTargets&&f&&e){Xe.set(0,0,0);Ye.set(0,0,0);Ze.set(0,0,0);for(var q=0,k=f.length;q<k;q++){var t=e[q],w=f[q];0!==t&&(qg.fromBufferAttribute(w,n),rg.fromBufferAttribute(w,r),sg.fromBufferAttribute(w,u),g?(Xe.addScaledVector(qg,t),Ye.addScaledVector(rg,t),Ze.addScaledVector(sg,t)):(Xe.addScaledVector(qg.sub(Mb),t),Ye.addScaledVector(rg.sub(Nb),t),Ze.addScaledVector(sg.sub(Ob),t)));}Mb.add(Xe);Nb.add(Ye);Ob.add(Ze);}c.isSkinnedMesh&&(c.boneTransform(n,Mb),c.boneTransform(r,Nb),c.boneTransform(u,Ob));if(c=zh(c,a,b,d,Mb,Nb,Ob,Td))h&&(Nc.fromBufferAttribute(h,n),Oc.fromBufferAttribute(h,r),Pc.fromBufferAttribute(h,u),c.uv=S.getUV(Td,Mb,Nb,Ob,Nc,Oc,Pc,new p())),l&&(Nc.fromBufferAttribute(l,n),Oc.fromBufferAttribute(l,r),Pc.fromBufferAttribute(l,u),c.uv2=S.getUV(Td,Mb,Nb,Ob,Nc,Oc,Pc,new p())),h=new mc(n,r,u),S.getNormal(Mb,Nb,Ob,h.normal),c.face=h;return c;}function P(){_Object$defineProperty(this,"id",{value:kj+=2});this.uuid=T.generateUUID();this.name="";this.type="Geometry";this.vertices=[];this.colors=[];this.faces=[];this.faceVertexUvs=[[]];this.morphTargets=[];this.morphNormals=[];this.skinWeights=[];this.skinIndices=[];this.lineDistances=[];this.boundingSphere=this.boundingBox=null;this.groupsNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=this.verticesNeedUpdate=this.elementsNeedUpdate=!1;}function Qc(c,a,b,d,e,f){P.call(this);this.type="BoxGeometry";this.parameters={width:c,height:a,depth:b,widthSegments:d,heightSegments:e,depthSegments:f};this.fromBufferGeometry(new Pb(c,a,b,d,e,f));this.mergeVertices();}function Pb(c,a,b,d,e,f){function g(a,b,c,d,e,f,g,v,A,M,p){var t=f/A,C=g/M,w=f/2,y=g/2,E=v/2;g=A+1;for(var D=M+1,Ga=f=0,H=new m(),Q=0;Q<D;Q++){for(var x=Q*C-y,B=0;B<g;B++){H[a]=(B*t-w)*d,H[b]=x*e,H[c]=E,n.push(H.x,H.y,H.z),H[a]=0,H[b]=0,H[c]=0<v?1:-1,r.push(H.x,H.y,H.z),u.push(B/A),u.push(1-Q/M),f+=1;}}for(a=0;a<M;a++){for(b=0;b<A;b++){c=q+b+g*(a+1),d=q+(b+1)+g*(a+1),e=q+(b+1)+g*a,l.push(q+b+g*a,c,e),l.push(c,d,e),Ga+=6;}}h.addGroup(k,Ga,p);k+=Ga;q+=f;}void 0===c&&(c=1);void 0===a&&(a=1);void 0===b&&(b=1);void 0===d&&(d=1);void 0===e&&(e=1);void 0===f&&(f=1);G.call(this);this.type="BoxBufferGeometry";this.parameters={width:c,height:a,depth:b,widthSegments:d,heightSegments:e,depthSegments:f};var h=this;d=Math.floor(d);e=Math.floor(e);f=Math.floor(f);var l=[],n=[],r=[],u=[],q=0,k=0;g("z","y","x",-1,-1,b,a,c,f,e,0);g("z","y","x",1,-1,b,a,-c,f,e,1);g("x","z","y",1,1,c,b,a,d,f,2);g("x","z","y",1,-1,c,b,-a,d,f,3);g("x","y","z",1,-1,c,a,b,d,e,4);g("x","y","z",-1,-1,c,a,-b,d,e,5);this.setIndex(l);this.setAttribute("position",new I(n,3));this.setAttribute("normal",new I(r,3));this.setAttribute("uv",new I(u,2));}function Rc(c){var a={},b;for(b in c){a[b]={};for(var d in c[b]){var e=c[b][d];e&&(e.isColor||e.isMatrix3||e.isMatrix4||e.isVector2||e.isVector3||e.isVector4||e.isTexture)?a[b][d]=e.clone():_Array$isArray(e)?a[b][d]=e.slice():a[b][d]=e;}}return a;}function oa(c){for(var a={},b=0;b<c.length;b++){var d=Rc(c[b]),e;for(e in d){a[e]=d[e];}}return a;}function Aa(c){L.call(this);this.type="ShaderMaterial";this.defines={};this.uniforms={};this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}";this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";this.linewidth=1;this.wireframe=!1;this.wireframeLinewidth=1;this.morphNormals=this.morphTargets=this.skinning=this.clipping=this.lights=this.fog=!1;this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1};this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]};this.index0AttributeName=void 0;this.uniformsNeedUpdate=!1;this.glslVersion=null;void 0!==c&&(void 0!==c.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(c));}function ob(){F.call(this);this.type="Camera";this.matrixWorldInverse=new z();this.projectionMatrix=new z();this.projectionMatrixInverse=new z();}function ta(c,a,b,d){ob.call(this);this.type="PerspectiveCamera";this.fov=void 0!==c?c:50;this.zoom=1;this.near=void 0!==b?b:.1;this.far=void 0!==d?d:2E3;this.focus=10;this.aspect=void 0!==a?a:1;this.view=null;this.filmGauge=35;this.filmOffset=0;this.updateProjectionMatrix();}function Sc(c,a,b){F.call(this);this.type="CubeCamera";if(!0!==b.isWebGLCubeRenderTarget)console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");else{this.renderTarget=b;var d=new ta(90,1,c,a);d.layers=this.layers;d.up.set(0,-1,0);d.lookAt(new m(1,0,0));this.add(d);var e=new ta(90,1,c,a);e.layers=this.layers;e.up.set(0,-1,0);e.lookAt(new m(-1,0,0));this.add(e);var f=new ta(90,1,c,a);f.layers=this.layers;f.up.set(0,0,1);f.lookAt(new m(0,1,0));this.add(f);var g=new ta(90,1,c,a);g.layers=this.layers;g.up.set(0,0,-1);g.lookAt(new m(0,-1,0));this.add(g);var h=new ta(90,1,c,a);h.layers=this.layers;h.up.set(0,-1,0);h.lookAt(new m(0,0,1));this.add(h);var l=new ta(90,1,c,a);l.layers=this.layers;l.up.set(0,-1,0);l.lookAt(new m(0,0,-1));this.add(l);this.update=function(a,c){null===this.parent&&this.updateMatrixWorld();var n=a.xr.enabled,r=a.getRenderTarget();a.xr.enabled=!1;var k=b.texture.generateMipmaps;b.texture.generateMipmaps=!1;a.setRenderTarget(b,0);a.render(c,d);a.setRenderTarget(b,1);a.render(c,e);a.setRenderTarget(b,2);a.render(c,f);a.setRenderTarget(b,3);a.render(c,g);a.setRenderTarget(b,4);a.render(c,h);b.texture.generateMipmaps=k;a.setRenderTarget(b,5);a.render(c,l);a.setRenderTarget(r);a.xr.enabled=n;};this.clear=function(a,c,d,e){for(var f=a.getRenderTarget(),g=0;6>g;g++){a.setRenderTarget(b,g),a.clear(c,d,e);}a.setRenderTarget(f);};}}function Qb(c,a,b){_Number$isInteger(a)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),a=b);Sa.call(this,c,c,a);this.texture.isWebGLCubeRenderTargetTexture=!0;}function nc(c,a,b,d,e,f,g,h,l,n,r,u){fa.call(this,null,f,g,h,l,n,d,e,r,u);this.image={data:c||null,width:a||1,height:b||1};this.magFilter=void 0!==l?l:1003;this.minFilter=void 0!==n?n:1003;this.flipY=this.generateMipmaps=!1;this.unpackAlignment=1;this.needsUpdate=!0;}function Ah(){function c(b,g){d(b,g);e=a.requestAnimationFrame(c);}var a=null,b=!1,d=null,e=null;return{start:function start(){!0!==b&&null!==d&&(e=a.requestAnimationFrame(c),b=!0);},stop:function stop(){a.cancelAnimationFrame(e);b=!1;},setAnimationLoop:function setAnimationLoop(a){d=a;},setContext:function setContext(b){a=b;}};}function lj(c,a){function b(a,b){var d=a.array,e=a.usage,f=c.createBuffer();c.bindBuffer(b,f);c.bufferData(b,d,e);a.onUploadCallback();b=5126;d instanceof Float32Array?b=5126:d instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):d instanceof Uint16Array?b=5123:d instanceof Int16Array?b=5122:d instanceof Uint32Array?b=5125:d instanceof Int32Array?b=5124:d instanceof Int8Array?b=5120:d instanceof Uint8Array&&(b=5121);return{buffer:f,type:b,bytesPerElement:d.BYTES_PER_ELEMENT,version:a.version};}var d=a.isWebGL2,e=new _WeakMap();return{get:function get(a){a.isInterleavedBufferAttribute&&(a=a.data);return e.get(a);},remove:function remove(a){a.isInterleavedBufferAttribute&&(a=a.data);var b=e.get(a);b&&(c.deleteBuffer(b.buffer),e["delete"](a));},update:function update(a,g){if(a.isGLBufferAttribute)g=e.get(a),(!g||g.version<a.version)&&e.set(a,{buffer:a.buffer,type:a.type,bytesPerElement:a.elementSize,version:a.version});else{a.isInterleavedBufferAttribute&&(a=a.data);var f=e.get(a);if(void 0===f)e.set(a,b(a,g));else if(f.version<a.version){var l=a.array,n=a.updateRange;c.bindBuffer(g,f.buffer);-1===n.count?c.bufferSubData(g,0,l):(d?c.bufferSubData(g,n.offset*l.BYTES_PER_ELEMENT,l,n.offset,n.count):c.bufferSubData(g,n.offset*l.BYTES_PER_ELEMENT,l.subarray(n.offset,n.offset+n.count)),n.count=-1);f.version=a.version;}}}};}function Ud(c,a,b,d){P.call(this);this.type="PlaneGeometry";this.parameters={width:c,height:a,widthSegments:b,heightSegments:d};this.fromBufferGeometry(new oc(c,a,b,d));this.mergeVertices();}function oc(c,a,b,d){G.call(this);this.type="PlaneBufferGeometry";this.parameters={width:c,height:a,widthSegments:b,heightSegments:d};c=c||1;a=a||1;var e=c/2,f=a/2;b=Math.floor(b)||1;d=Math.floor(d)||1;var g=b+1,h=d+1,l=c/b,n=a/d;a=[];c=[];for(var r=[],u=[],q=0;q<h;q++){for(var k=q*n-f,t=0;t<g;t++){c.push(t*l-e,-k,0),r.push(0,0,1),u.push(t/b),u.push(1-q/d);}}for(e=0;e<d;e++){for(f=0;f<b;f++){h=f+g*(e+1),l=f+1+g*(e+1),n=f+1+g*e,a.push(f+g*e,h,n),a.push(h,l,n);}}this.setIndex(a);this.setAttribute("position",new I(c,3));this.setAttribute("normal",new I(r,3));this.setAttribute("uv",new I(u,2));}function mj(c,a,b,d,e){function f(a,c){b.buffers.color.setClear(a.r,a.g,a.b,c,e);}var g=new x(0),h=0,l,n,r=null,u=0,q=null;return{getClearColor:function getClearColor(){return g;},setClearColor:function setClearColor(a,b){g.set(a);h=void 0!==b?b:1;f(g,h);},getClearAlpha:function getClearAlpha(){return h;},setClearAlpha:function setClearAlpha(a){h=a;f(g,h);},render:function render(b,e,k,C){(e=!0===e.isScene?e.background:null)&&e.isTexture&&(e=a.get(e));k=c.xr;(k=k.getSession&&k.getSession())&&"additive"===k.environmentBlendMode&&(e=null);null===e?f(g,h):e&&e.isColor&&(f(e,1),C=!0);(c.autoClear||C)&&c.clear(c.autoClearColor,c.autoClearDepth,c.autoClearStencil);if(e&&(e.isCubeTexture||e.isWebGLCubeRenderTarget||e.isWebGLCubeRenderTargetTexture||306===e.mapping)){void 0===n&&(n=new na(new Pb(1,1,1),new Aa({name:"BackgroundCubeMaterial",uniforms:Rc(db.cube.uniforms),vertexShader:db.cube.vertexShader,fragmentShader:db.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),n.geometry.deleteAttribute("normal"),n.geometry.deleteAttribute("uv"),n.onBeforeRender=function(a,b,c){this.matrixWorld.copyPosition(c.matrixWorld);},_Object$defineProperty(n.material,"envMap",{get:function get(){return this.uniforms.envMap.value;}}),d.update(n));e.isWebGLCubeRenderTarget&&(e=e.texture);n.material.uniforms.envMap.value=e;n.material.uniforms.flipEnvMap.value=e.isCubeTexture?-1:1;if(r!==e||u!==e.version||q!==c.toneMapping)n.material.needsUpdate=!0,r=e,u=e.version,q=c.toneMapping;b.unshift(n,n.geometry,n.material,0,0,null);}else if(e&&e.isTexture){void 0===l&&(l=new na(new oc(2,2),new Aa({name:"BackgroundMaterial",uniforms:Rc(db.background.uniforms),vertexShader:db.background.vertexShader,fragmentShader:db.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),l.geometry.deleteAttribute("normal"),_Object$defineProperty(l.material,"map",{get:function get(){return this.uniforms.t2D.value;}}),d.update(l));l.material.uniforms.t2D.value=e;!0===e.matrixAutoUpdate&&e.updateMatrix();l.material.uniforms.uvTransform.value.copy(e.matrix);if(r!==e||u!==e.version||q!==c.toneMapping)l.material.needsUpdate=!0,r=e,u=e.version,q=c.toneMapping;b.unshift(l,l.geometry,l.material,0,0,null);}}};}function nj(c,a,b,d){function e(a){return d.isWebGL2?c.bindVertexArray(a):t.bindVertexArrayOES(a);}function f(a){return d.isWebGL2?c.deleteVertexArray(a):t.deleteVertexArrayOES(a);}function g(a){for(var b=[],c=[],d=[],e=0;e<k;e++){b[e]=0,c[e]=0,d[e]=0;}return{geometry:null,program:null,wireframe:!1,newAttributes:b,enabledAttributes:c,attributeDivisors:d,object:a,attributes:{},index:null};}function h(){for(var a=E.newAttributes,b=0,c=a.length;b<c;b++){a[b]=0;}}function l(a){n(a,0);}function n(b,e){var f=E.enabledAttributes,g=E.attributeDivisors;E.newAttributes[b]=1;0===f[b]&&(c.enableVertexAttribArray(b),f[b]=1);g[b]!==e&&((d.isWebGL2?c:a.get("ANGLE_instanced_arrays"))[d.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](b,e),g[b]=e);}function r(){for(var a=E.newAttributes,b=E.enabledAttributes,d=0,e=b.length;d<e;d++){b[d]!==a[d]&&(c.disableVertexAttribArray(d),b[d]=0);}}function u(){q();E!==m&&(E=m,e(E.object));}function q(){m.geometry=null;m.program=null;m.wireframe=!1;}var k=c.getParameter(34921),t=d.isWebGL2?null:a.get("OES_vertex_array_object"),w=d.isWebGL2||null!==t,C={},m=g(null),E=m;return{setup:function setup(f,u,q,k,v){var m=!1;if(w){m=!0===u.wireframe;var y=C[k.id];void 0===y&&(y={},C[k.id]=y);var A=y[q.id];void 0===A&&(A={},y[q.id]=A);y=A[m];void 0===y&&(y=g(d.isWebGL2?c.createVertexArray():t.createVertexArrayOES()),A[m]=y);m=y;E!==m&&(E=m,e(E.object));a:if(m=E.attributes,A=k.attributes,_Object$keys(m).length!==_Object$keys(A).length)m=!0;else{for(var D in A){y=m[D];var M=A[D];if(M.isGLBufferAttribute||void 0===y||y.attribute!==M||y.data!==M.data){m=!0;break a;}}m=E.index!==v?!0:!1;}if(m){D={};A=k.attributes;for(var Ga in A){y=A[Ga],M={},M.attribute=y,y.data&&(M.data=y.data),D[Ga]=M;}E.attributes=D;E.index=v;}}else if(Ga=!0===u.wireframe,E.geometry!==k.id||E.program!==q.id||E.wireframe!==Ga)E.geometry=k.id,E.program=q.id,E.wireframe=Ga,m=!0;!0===f.isInstancedMesh&&(m=!0);null!==v&&b.update(v,34963);if(m){if(!1!==d.isWebGL2||!f.isInstancedMesh&&!k.isInstancedBufferGeometry||null!==a.get("ANGLE_instanced_arrays")){h();Ga=k.attributes;q=q.getAttributes();u=u.defaultAttributeValues;for(var H in q){if(m=q[H],0<=m){var p=Ga[H];if(void 0!==p){if(D=p.normalized,M=p.itemSize,y=b.get(p),void 0!==y){var x=y.buffer;A=y.type;y=y.bytesPerElement;if(p.isInterleavedBufferAttribute){var B=p.data,z=B.stride;p=p.offset;B&&B.isInstancedInterleavedBuffer?(n(m,B.meshPerAttribute),void 0===k._maxInstanceCount&&(k._maxInstanceCount=B.meshPerAttribute*B.count)):l(m);c.bindBuffer(34962,x);z*=y;y*=p;!0!==d.isWebGL2||5124!==A&&5125!==A?c.vertexAttribPointer(m,M,A,D,z,y):c.vertexAttribIPointer(m,M,A,z,y);}else p.isInstancedBufferAttribute?(n(m,p.meshPerAttribute),void 0===k._maxInstanceCount&&(k._maxInstanceCount=p.meshPerAttribute*p.count)):l(m),c.bindBuffer(34962,x),y=M,!0!==d.isWebGL2||5124!==A&&5125!==A?c.vertexAttribPointer(m,y,A,D,0,0):c.vertexAttribIPointer(m,y,A,0,0);}}else if("instanceMatrix"===H)A=b.get(f.instanceMatrix),void 0!==A&&(D=A.buffer,A=A.type,n(m+0,1),n(m+1,1),n(m+2,1),n(m+3,1),c.bindBuffer(34962,D),c.vertexAttribPointer(m+0,4,A,!1,64,0),c.vertexAttribPointer(m+1,4,A,!1,64,16),c.vertexAttribPointer(m+2,4,A,!1,64,32),c.vertexAttribPointer(m+3,4,A,!1,64,48));else if("instanceColor"===H)A=b.get(f.instanceColor),void 0!==A&&(D=A.buffer,A=A.type,n(m,1),c.bindBuffer(34962,D),c.vertexAttribPointer(m,3,A,!1,12,0));else if(void 0!==u&&(D=u[H],void 0!==D))switch(D.length){case 2:c.vertexAttrib2fv(m,D);break;case 3:c.vertexAttrib3fv(m,D);break;case 4:c.vertexAttrib4fv(m,D);break;default:c.vertexAttrib1fv(m,D);}}}r();}null!==v&&c.bindBuffer(34963,b.get(v).buffer);}},reset:u,resetDefaultState:q,dispose:function dispose(){u();for(var a in C){var b=C[a],c;for(c in b){var d=b[c],e;for(e in d){f(d[e].object),delete d[e];}delete b[c];}delete C[a];}},releaseStatesOfGeometry:function releaseStatesOfGeometry(a){if(void 0!==C[a.id]){var b=C[a.id],c;for(c in b){var d=b[c],e;for(e in d){f(d[e].object),delete d[e];}delete b[c];}delete C[a.id];}},releaseStatesOfProgram:function releaseStatesOfProgram(a){for(var b in C){var c=C[b];if(void 0!==c[a.id]){var d=c[a.id],e;for(e in d){f(d[e].object),delete d[e];}delete c[a.id];}}},initAttributes:h,enableAttribute:l,disableUnusedAttributes:r};}function oj(c,a,b,d){var e=d.isWebGL2,f;this.setMode=function(a){f=a;};this.render=function(a,d){c.drawArrays(f,a,d);b.update(d,f,1);};this.renderInstances=function(d,h,l){if(0!==l){if(e){var g=c;var r="drawArraysInstanced";}else if(g=a.get("ANGLE_instanced_arrays"),r="drawArraysInstancedANGLE",null===g){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return;}g[r](f,d,h,l);b.update(h,f,l);}};}function pj(c,a,b){function d(a){if("highp"===a){if(0<c.getShaderPrecisionFormat(35633,36338).precision&&0<c.getShaderPrecisionFormat(35632,36338).precision)return"highp";a="mediump";}return"mediump"===a&&0<c.getShaderPrecisionFormat(35633,36337).precision&&0<c.getShaderPrecisionFormat(35632,36337).precision?"mediump":"lowp";}var e,f="undefined"!==typeof WebGL2RenderingContext&&c instanceof WebGL2RenderingContext||"undefined"!==typeof WebGL2ComputeRenderingContext&&c instanceof WebGL2ComputeRenderingContext,g=void 0!==b.precision?b.precision:"highp",h=d(g);h!==g&&(console.warn("THREE.WebGLRenderer:",g,"not supported, using",h,"instead."),g=h);b=!0===b.logarithmicDepthBuffer;h=c.getParameter(34930);var l=c.getParameter(35660),n=c.getParameter(3379),r=c.getParameter(34076),u=c.getParameter(34921),q=c.getParameter(36347),k=c.getParameter(36348),t=c.getParameter(36349),m=0<l,C=f||!!a.get("OES_texture_float"),y=m&&C,E=f?c.getParameter(36183):0;return{isWebGL2:f,getMaxAnisotropy:function getMaxAnisotropy(){if(void 0!==e)return e;var b=a.get("EXT_texture_filter_anisotropic");return e=null!==b?c.getParameter(b.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0;},getMaxPrecision:d,precision:g,logarithmicDepthBuffer:b,maxTextures:h,maxVertexTextures:l,maxTextureSize:n,maxCubemapSize:r,maxAttributes:u,maxVertexUniforms:q,maxVaryings:k,maxFragmentUniforms:t,vertexTextures:m,floatFragmentTextures:C,floatVertexTextures:y,maxSamples:E};}function qj(c){function a(){r.value!==e&&(r.value=e,r.needsUpdate=0<f);d.numPlanes=f;d.numIntersection=0;}function b(a,b,c,e){var f=null!==a?a.length:0,g=null;if(0!==f){g=r.value;if(!0!==e||null===g){e=c+4*f;b=b.matrixWorldInverse;n.getNormalMatrix(b);if(null===g||g.length<e)g=new Float32Array(e);for(e=0;e!==f;++e,c+=4){l.copy(a[e]).applyMatrix4(b,n),l.normal.toArray(g,c),g[c+3]=l.constant;}}r.value=g;r.needsUpdate=!0;}d.numPlanes=f;d.numIntersection=0;return g;}var d=this,e=null,f=0,g=!1,h=!1,l=new W(),n=new X(),r={value:null,needsUpdate:!1};this.uniform=r;this.numIntersection=this.numPlanes=0;this.init=function(a,c,d){var h=0!==a.length||c||0!==f||g;g=c;e=b(a,d,0);f=a.length;return h;};this.beginShadows=function(){h=!0;b(null);};this.endShadows=function(){h=!1;a();};this.setState=function(d,l,n){var u=d.clippingPlanes,q=d.clipIntersection,k=d.clipShadows;d=c.get(d);if(!g||null===u||0===u.length||h&&!k)h?b(null):a();else{k=h?0:f;var v=4*k,m=d.clippingState||null;r.value=m;m=b(u,l,v,n);for(l=0;l!==v;++l){m[l]=e[l];}d.clippingState=m;this.numIntersection=q?this.numPlanes:0;this.numPlanes+=k;}};}function rj(c){function a(a,b){303===b?a.mapping=301:304===b&&(a.mapping=302);return a;}var b=new _WeakMap();return{get:function get(d){if(d&&d.isTexture){var e=d.mapping;if(303===e||304===e)return b.has(d)?(e=b.get(d).texture,a(e,d.mapping)):(e=d.image)&&0<e.height?(e=new Qb(e.height/2),e.fromEquirectangularTexture(c,d),b.set(d,e),a(e.texture,d.mapping)):null;}return d;},dispose:function dispose(){b=new _WeakMap();}};}function sj(c){var a={};return{has:function has(b){if(void 0!==a[b])return a[b];switch(b){case"WEBGL_depth_texture":var d=c.getExtension("WEBGL_depth_texture")||c.getExtension("MOZ_WEBGL_depth_texture")||c.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":d=c.getExtension("EXT_texture_filter_anisotropic")||c.getExtension("MOZ_EXT_texture_filter_anisotropic")||c.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":d=c.getExtension("WEBGL_compressed_texture_s3tc")||c.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||c.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":d=c.getExtension("WEBGL_compressed_texture_pvrtc")||c.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:d=c.getExtension(b);}a[b]=d;return!!d;},get:function get(b){this.has(b)||console.warn("THREE.WebGLRenderer: "+b+" extension not supported.");return a[b];}};}function tj(c,a,b,d){function e(c){c=c.target;var f=g.get(c);null!==f.index&&a.remove(f.index);for(var l in f.attributes){a.remove(f.attributes[l]);}c.removeEventListener("dispose",e);g["delete"](c);if(l=h.get(f))a.remove(l),h["delete"](f);d.releaseStatesOfGeometry(c);!0===c.isInstancedBufferGeometry&&delete c._maxInstanceCount;b.memory.geometries--;}function f(b){var c=[],d=b.index,e=b.attributes.position;if(null!==d){e=d.array;d=d.version;for(var f=0,g=e.length;f<g;f+=3){var l=e[f+0],k=e[f+1],m=e[f+2];c.push(l,k,k,m,m,l);}}else for(f=e.array,d=e.version,e=0,f=f.length/3-1;e<f;e+=3){g=e+0,l=e+1,k=e+2,c.push(g,l,l,k,k,g);}c=new(65535<yh(c)?lc:kc)(c,1);c.version=d;(d=h.get(b))&&a.remove(d);h.set(b,c);}var g=new _WeakMap(),h=new _WeakMap();return{get:function get(a,c){var d=g.get(c);if(d)return d;c.addEventListener("dispose",e);c.isBufferGeometry?d=c:c.isGeometry&&(void 0===c._bufferGeometry&&(c._bufferGeometry=new G().setFromObject(a)),d=c._bufferGeometry);g.set(c,d);b.memory.geometries++;return d;},update:function update(b){var c=b.attributes;for(e in c){a.update(c[e],34962);}b=b.morphAttributes;for(var d in b){c=b[d];var e=0;for(var f=c.length;e<f;e++){a.update(c[e],34962);}}},getWireframeAttribute:function getWireframeAttribute(a){var b=h.get(a);if(b){var c=a.index;null!==c&&b.version<c.version&&f(a);}else f(a);return h.get(a);}};}function uj(c,a,b,d){var e=d.isWebGL2,f,g,h;this.setMode=function(a){f=a;};this.setIndex=function(a){g=a.type;h=a.bytesPerElement;};this.render=function(a,d){c.drawElements(f,d,g,a*h);b.update(d,f,1);};this.renderInstances=function(d,n,r){if(0!==r){if(e){var l=c;var q="drawElementsInstanced";}else if(l=a.get("ANGLE_instanced_arrays"),q="drawElementsInstancedANGLE",null===l){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return;}l[q](f,n,g,d*h,r);b.update(n,f,r);}};}function vj(c){var a={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:a,programs:null,autoReset:!0,reset:function reset(){a.frame++;a.calls=0;a.triangles=0;a.points=0;a.lines=0;},update:function update(b,c,e){a.calls++;switch(c){case 4:a.triangles+=b/3*e;break;case 1:a.lines+=b/2*e;break;case 3:a.lines+=e*(b-1);break;case 2:a.lines+=e*b;break;case 0:a.points+=e*b;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",c);}}};}function wj(c,a){return c[0]-a[0];}function xj(c,a){return Math.abs(a[1])-Math.abs(c[1]);}function yj(c){for(var a={},b=new Float32Array(8),d=[],e=0;8>e;e++){d[e]=[e,0];}return{update:function update(e,g,h,l){var f=e.morphTargetInfluences;e=void 0===f?0:f.length;var r=a[g.id];if(void 0===r){r=[];for(var u=0;u<e;u++){r[u]=[u,0];}a[g.id]=r;}for(u=0;u<e;u++){var q=r[u];q[0]=u;q[1]=f[u];}r.sort(xj);for(f=0;8>f;f++){f<e&&r[f][1]?(d[f][0]=r[f][0],d[f][1]=r[f][1]):(d[f][0]=_Number$MAX_SAFE_INTEGER,d[f][1]=0);}d.sort(wj);e=h.morphTargets&&g.morphAttributes.position;h=h.morphNormals&&g.morphAttributes.normal;for(f=r=0;8>f;f++){q=d[f],u=q[0],q=q[1],u!==_Number$MAX_SAFE_INTEGER&&q?(e&&g.getAttribute("morphTarget"+f)!==e[u]&&g.setAttribute("morphTarget"+f,e[u]),h&&g.getAttribute("morphNormal"+f)!==h[u]&&g.setAttribute("morphNormal"+f,h[u]),b[f]=q,r+=q):(e&&void 0!==g.getAttribute("morphTarget"+f)&&g.deleteAttribute("morphTarget"+f),h&&void 0!==g.getAttribute("morphNormal"+f)&&g.deleteAttribute("morphNormal"+f),b[f]=0);}g=g.morphTargetsRelative?1:1-r;l.getUniforms().setValue(c,"morphTargetBaseInfluence",g);l.getUniforms().setValue(c,"morphTargetInfluences",b);}};}function zj(c,a,b,d){var e=new _WeakMap();return{update:function update(c){var f=d.render.frame,h=c.geometry,l=a.get(c,h);e.get(l)!==f&&(h.isGeometry&&l.updateFromObject(c),a.update(l),e.set(l,f));c.isInstancedMesh&&(b.update(c.instanceMatrix,34962),null!==c.instanceColor&&b.update(c.instanceColor,34962));return l;},dispose:function dispose(){e=new _WeakMap();}};}function zb(c,a,b,d,e,f,g,h,l,n){c=void 0!==c?c:[];fa.call(this,c,void 0!==a?a:301,b,d,e,f,void 0!==g?g:1022,h,l,n);this.flipY=!1;}function Tc(c,a,b,d){fa.call(this,null);this.image={data:c||null,width:a||1,height:b||1,depth:d||1};this.minFilter=this.magFilter=1003;this.wrapR=1001;this.flipY=this.generateMipmaps=!1;this.needsUpdate=!0;}function Uc(c,a,b,d){fa.call(this,null);this.image={data:c||null,width:a||1,height:b||1,depth:d||1};this.minFilter=this.magFilter=1003;this.wrapR=1001;this.flipY=this.generateMipmaps=!1;this.needsUpdate=!0;}function Vc(c,a,b){var d=c[0];if(0>=d||0<d)return c;var e=a*b,f=Bh[e];void 0===f&&(f=new Float32Array(e),Bh[e]=f);if(0!==a)for(d.toArray(f,0),d=1,e=0;d!==a;++d){e+=b,c[d].toArray(f,e);}return f;}function $a(c,a){if(c.length!==a.length)return!1;for(var b=0,d=c.length;b<d;b++){if(c[b]!==a[b])return!1;}return!0;}function Ta(c,a){for(var b=0,d=a.length;b<d;b++){c[b]=a[b];}}function Ch(c,a){var b=Dh[a];void 0===b&&(b=new Int32Array(a),Dh[a]=b);for(var d=0;d!==a;++d){b[d]=c.allocateTextureUnit();}return b;}function Aj(c,a){var b=this.cache;b[0]!==a&&(c.uniform1f(this.addr,a),b[0]=a);}function Bj(c,a){var b=this.cache;if(void 0!==a.x){if(b[0]!==a.x||b[1]!==a.y)c.uniform2f(this.addr,a.x,a.y),b[0]=a.x,b[1]=a.y;}else $a(b,a)||(c.uniform2fv(this.addr,a),Ta(b,a));}function Cj(c,a){var b=this.cache;if(void 0!==a.x){if(b[0]!==a.x||b[1]!==a.y||b[2]!==a.z)c.uniform3f(this.addr,a.x,a.y,a.z),b[0]=a.x,b[1]=a.y,b[2]=a.z;}else if(void 0!==a.r){if(b[0]!==a.r||b[1]!==a.g||b[2]!==a.b)c.uniform3f(this.addr,a.r,a.g,a.b),b[0]=a.r,b[1]=a.g,b[2]=a.b;}else $a(b,a)||(c.uniform3fv(this.addr,a),Ta(b,a));}function Dj(c,a){var b=this.cache;if(void 0!==a.x){if(b[0]!==a.x||b[1]!==a.y||b[2]!==a.z||b[3]!==a.w)c.uniform4f(this.addr,a.x,a.y,a.z,a.w),b[0]=a.x,b[1]=a.y,b[2]=a.z,b[3]=a.w;}else $a(b,a)||(c.uniform4fv(this.addr,a),Ta(b,a));}function Ej(c,a){var b=this.cache,d=a.elements;void 0===d?$a(b,a)||(c.uniformMatrix2fv(this.addr,!1,a),Ta(b,a)):$a(b,d)||(Eh.set(d),c.uniformMatrix2fv(this.addr,!1,Eh),Ta(b,d));}function Fj(c,a){var b=this.cache,d=a.elements;void 0===d?$a(b,a)||(c.uniformMatrix3fv(this.addr,!1,a),Ta(b,a)):$a(b,d)||(Fh.set(d),c.uniformMatrix3fv(this.addr,!1,Fh),Ta(b,d));}function Gj(c,a){var b=this.cache,d=a.elements;void 0===d?$a(b,a)||(c.uniformMatrix4fv(this.addr,!1,a),Ta(b,a)):$a(b,d)||(Gh.set(d),c.uniformMatrix4fv(this.addr,!1,Gh),Ta(b,d));}function Hj(c,a,b){var d=this.cache,e=b.allocateTextureUnit();d[0]!==e&&(c.uniform1i(this.addr,e),d[0]=e);b.safeSetTexture2D(a||Hh,e);}function Ij(c,a,b){var d=this.cache,e=b.allocateTextureUnit();d[0]!==e&&(c.uniform1i(this.addr,e),d[0]=e);b.setTexture2DArray(a||Jj,e);}function Kj(c,a,b){var d=this.cache,e=b.allocateTextureUnit();d[0]!==e&&(c.uniform1i(this.addr,e),d[0]=e);b.setTexture3D(a||Lj,e);}function Mj(c,a,b){var d=this.cache,e=b.allocateTextureUnit();d[0]!==e&&(c.uniform1i(this.addr,e),d[0]=e);b.safeSetTextureCube(a||Ih,e);}function Nj(c,a){var b=this.cache;b[0]!==a&&(c.uniform1i(this.addr,a),b[0]=a);}function Oj(c,a){var b=this.cache;$a(b,a)||(c.uniform2iv(this.addr,a),Ta(b,a));}function Pj(c,a){var b=this.cache;$a(b,a)||(c.uniform3iv(this.addr,a),Ta(b,a));}function Qj(c,a){var b=this.cache;$a(b,a)||(c.uniform4iv(this.addr,a),Ta(b,a));}function Rj(c,a){var b=this.cache;b[0]!==a&&(c.uniform1ui(this.addr,a),b[0]=a);}function Sj(c){switch(c){case 5126:return Aj;case 35664:return Bj;case 35665:return Cj;case 35666:return Dj;case 35674:return Ej;case 35675:return Fj;case 35676:return Gj;case 5124:case 35670:return Nj;case 35667:case 35671:return Oj;case 35668:case 35672:return Pj;case 35669:case 35673:return Qj;case 5125:return Rj;case 35678:case 36198:case 36298:case 36306:case 35682:return Hj;case 35679:case 36299:case 36307:return Kj;case 35680:case 36300:case 36308:case 36293:return Mj;case 36289:case 36303:case 36311:case 36292:return Ij;}}function Tj(c,a){c.uniform1fv(this.addr,a);}function Uj(c,a){c.uniform1iv(this.addr,a);}function Vj(c,a){c.uniform2iv(this.addr,a);}function Wj(c,a){c.uniform3iv(this.addr,a);}function Xj(c,a){c.uniform4iv(this.addr,a);}function Yj(c,a){a=Vc(a,this.size,2);c.uniform2fv(this.addr,a);}function Zj(c,a){a=Vc(a,this.size,3);c.uniform3fv(this.addr,a);}function ak(c,a){a=Vc(a,this.size,4);c.uniform4fv(this.addr,a);}function bk(c,a){a=Vc(a,this.size,4);c.uniformMatrix2fv(this.addr,!1,a);}function ck(c,a){a=Vc(a,this.size,9);c.uniformMatrix3fv(this.addr,!1,a);}function dk(c,a){a=Vc(a,this.size,16);c.uniformMatrix4fv(this.addr,!1,a);}function ek(c,a,b){var d=a.length,e=Ch(b,d);c.uniform1iv(this.addr,e);for(c=0;c!==d;++c){b.safeSetTexture2D(a[c]||Hh,e[c]);}}function fk(c,a,b){var d=a.length,e=Ch(b,d);c.uniform1iv(this.addr,e);for(c=0;c!==d;++c){b.safeSetTextureCube(a[c]||Ih,e[c]);}}function gk(c){switch(c){case 5126:return Tj;case 35664:return Yj;case 35665:return Zj;case 35666:return ak;case 35674:return bk;case 35675:return ck;case 35676:return dk;case 5124:case 35670:return Uj;case 35667:case 35671:return Vj;case 35668:case 35672:return Wj;case 35669:case 35673:return Xj;case 35678:case 36198:case 36298:case 36306:case 35682:return ek;case 35680:case 36300:case 36308:case 36293:return fk;}}function hk(c,a,b){this.id=c;this.addr=b;this.cache=[];this.setValue=Sj(a.type);}function Jh(c,a,b){this.id=c;this.addr=b;this.cache=[];this.size=a.size;this.setValue=gk(a.type);}function Kh(c){this.id=c;this.seq=[];this.map={};}function Rb(c,a){this.seq=[];this.map={};for(var b=c.getProgramParameter(a,35718),d=0;d<b;++d){var e=c.getActiveUniform(a,d),f=c.getUniformLocation(a,e.name),g=this,h=e.name,l=h.length;for(tg.lastIndex=0;;){var n=tg.exec(h),r=tg.lastIndex,u=n[1],q=n[3];"]"===n[2]&&(u|=0);if(void 0===q||"["===q&&r+2===l){h=g;e=void 0===q?new hk(u,e,f):new Jh(u,e,f);h.seq.push(e);h.map[e.id]=e;break;}else q=g.map[u],void 0===q&&(q=new Kh(u),u=g,g=q,u.seq.push(g),u.map[g.id]=g),g=q;}}}function Lh(c,a,b){a=c.createShader(a);c.shaderSource(a,b);c.compileShader(a);return a;}function Mh(c){switch(c){case 3E3:return["Linear","( value )"];case 3001:return["sRGB","( value )"];case 3002:return["RGBE","( value )"];case 3004:return["RGBM","( value, 7.0 )"];case 3005:return["RGBM","( value, 16.0 )"];case 3006:return["RGBD","( value, 256.0 )"];case 3007:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case 3003:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",c),["Linear","( value )"];}}function Nh(c,a,b){var d=c.getShaderParameter(a,35713),e=c.getShaderInfoLog(a).trim();if(d&&""===e)return"";c=c.getShaderSource(a).split("\n");for(a=0;a<c.length;a++){c[a]=a+1+": "+c[a];}c=c.join("\n");return"THREE.WebGLShader: gl.getShaderInfoLog() "+b+"\n"+e+c;}function Vd(c,a){a=Mh(a);return"vec4 "+c+"( vec4 value ) { return "+a[0]+"ToLinear"+a[1]+"; }";}function ik(c,a){a=Mh(a);return"vec4 "+c+"( vec4 value ) { return LinearTo"+a[0]+a[1]+"; }";}function jk(c,a){switch(a){case 1:a="Linear";break;case 2:a="Reinhard";break;case 3:a="OptimizedCineon";break;case 4:a="ACESFilmic";break;case 5:a="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",a),a="Linear";}return"vec3 "+c+"( vec3 color ) { return "+a+"ToneMapping( color ); }";}function kk(c){var a=[],b;for(b in c){var d=c[b];!1!==d&&a.push("#define "+b+" "+d);}return a.join("\n");}function Wd(c){return""!==c;}function Oh(c,a){return c.replace(/NUM_DIR_LIGHTS/g,a.numDirLights).replace(/NUM_SPOT_LIGHTS/g,a.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,a.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,a.numPointLights).replace(/NUM_HEMI_LIGHTS/g,a.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,a.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,a.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,a.numPointLightShadows);}function Ph(c,a){return c.replace(/NUM_CLIPPING_PLANES/g,a.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,a.numClippingPlanes-a.numClipIntersection);}function ug(c,a){c=U[a];if(void 0===c)throw Error("Can not resolve #include <"+a+">");return c.replace(vg,ug);}function Qh(c,a,b,d){console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead.");return wg(c,a,b,d);}function wg(c,a,b,d){c="";for(a=_parseInt(a);a<_parseInt(b);a++){c+=d.replace(/\[ i \]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);}return c;}function Rh(c){var a="precision "+c.precision+" float;\nprecision "+c.precision+" int;";"highp"===c.precision?a+="\n#define HIGH_PRECISION":"mediump"===c.precision?a+="\n#define MEDIUM_PRECISION":"lowp"===c.precision&&(a+="\n#define LOW_PRECISION");return a;}function lk(c){var a="SHADOWMAP_TYPE_BASIC";1===c.shadowMapType?a="SHADOWMAP_TYPE_PCF":2===c.shadowMapType?a="SHADOWMAP_TYPE_PCF_SOFT":3===c.shadowMapType&&(a="SHADOWMAP_TYPE_VSM");return a;}function mk(c){var a="ENVMAP_TYPE_CUBE";if(c.envMap)switch(c.envMapMode){case 301:case 302:a="ENVMAP_TYPE_CUBE";break;case 306:case 307:a="ENVMAP_TYPE_CUBE_UV";}return a;}function nk(c){var a="ENVMAP_MODE_REFLECTION";if(c.envMap)switch(c.envMapMode){case 302:case 307:a="ENVMAP_MODE_REFRACTION";}return a;}function ok(c){var a="ENVMAP_BLENDING_NONE";if(c.envMap)switch(c.combine){case 0:a="ENVMAP_BLENDING_MULTIPLY";break;case 1:a="ENVMAP_BLENDING_MIX";break;case 2:a="ENVMAP_BLENDING_ADD";}return a;}function pk(c,a,b,d){var e=c.getContext(),f=b.defines,g=b.vertexShader,h=b.fragmentShader,l=lk(b),n=mk(b),r=nk(b),u=ok(b),q=0<c.gammaFactor?c.gammaFactor:1,k=b.isWebGL2?"":[b.extensionDerivatives||b.envMapCubeUV||b.bumpMap||b.tangentSpaceNormalMap||b.clearcoatNormalMap||b.flatShading||"physical"===b.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(b.extensionFragDepth||b.logarithmicDepthBuffer)&&b.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",b.extensionDrawBuffers&&b.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(b.extensionShaderTextureLOD||b.envMap)&&b.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Wd).join("\n"),m=kk(f),w=e.createProgram(),C=b.glslVersion?"#version "+b.glslVersion+"\n":"";b.isRawShaderMaterial?(f=[m].filter(Wd).join("\n"),0<f.length&&(f+="\n"),l=[k,m].filter(Wd).join("\n"),0<l.length&&(l+="\n")):(f=[Rh(b),"#define SHADER_NAME "+b.shaderName,m,b.instancing?"#define USE_INSTANCING":"",b.instancingColor?"#define USE_INSTANCING_COLOR":"",b.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+q,"#define MAX_BONES "+b.maxBones,b.useFog&&b.fog?"#define USE_FOG":"",b.useFog&&b.fogExp2?"#define FOG_EXP2":"",b.map?"#define USE_MAP":"",b.envMap?"#define USE_ENVMAP":"",b.envMap?"#define "+r:"",b.lightMap?"#define USE_LIGHTMAP":"",b.aoMap?"#define USE_AOMAP":"",b.emissiveMap?"#define USE_EMISSIVEMAP":"",b.bumpMap?"#define USE_BUMPMAP":"",b.normalMap?"#define USE_NORMALMAP":"",b.normalMap&&b.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",b.normalMap&&b.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",b.clearcoatMap?"#define USE_CLEARCOATMAP":"",b.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",b.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",b.displacementMap&&b.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",b.specularMap?"#define USE_SPECULARMAP":"",b.roughnessMap?"#define USE_ROUGHNESSMAP":"",b.metalnessMap?"#define USE_METALNESSMAP":"",b.alphaMap?"#define USE_ALPHAMAP":"",b.transmissionMap?"#define USE_TRANSMISSIONMAP":"",b.vertexTangents?"#define USE_TANGENT":"",b.vertexColors?"#define USE_COLOR":"",b.vertexUvs?"#define USE_UV":"",b.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",b.flatShading?"#define FLAT_SHADED":"",b.skinning?"#define USE_SKINNING":"",b.useVertexTexture?"#define BONE_TEXTURE":"",b.morphTargets?"#define USE_MORPHTARGETS":"",b.morphNormals&&!1===b.flatShading?"#define USE_MORPHNORMALS":"",b.doubleSided?"#define DOUBLE_SIDED":"",b.flipSided?"#define FLIP_SIDED":"",b.shadowMapEnabled?"#define USE_SHADOWMAP":"",b.shadowMapEnabled?"#define "+l:"",b.sizeAttenuation?"#define USE_SIZEATTENUATION":"",b.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",b.logarithmicDepthBuffer&&b.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Wd).join("\n"),l=[k,Rh(b),"#define SHADER_NAME "+b.shaderName,m,b.alphaTest?"#define ALPHATEST "+b.alphaTest+(b.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+q,b.useFog&&b.fog?"#define USE_FOG":"",b.useFog&&b.fogExp2?"#define FOG_EXP2":"",b.map?"#define USE_MAP":"",b.matcap?"#define USE_MATCAP":"",b.envMap?"#define USE_ENVMAP":"",b.envMap?"#define "+n:"",b.envMap?"#define "+r:"",b.envMap?"#define "+u:"",b.lightMap?"#define USE_LIGHTMAP":"",b.aoMap?"#define USE_AOMAP":"",b.emissiveMap?"#define USE_EMISSIVEMAP":"",b.bumpMap?"#define USE_BUMPMAP":"",b.normalMap?"#define USE_NORMALMAP":"",b.normalMap&&b.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",b.normalMap&&b.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",b.clearcoatMap?"#define USE_CLEARCOATMAP":"",b.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",b.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",b.specularMap?"#define USE_SPECULARMAP":"",b.roughnessMap?"#define USE_ROUGHNESSMAP":"",b.metalnessMap?"#define USE_METALNESSMAP":"",b.alphaMap?"#define USE_ALPHAMAP":"",b.sheen?"#define USE_SHEEN":"",b.transmissionMap?"#define USE_TRANSMISSIONMAP":"",b.vertexTangents?"#define USE_TANGENT":"",b.vertexColors||b.instancingColor?"#define USE_COLOR":"",b.vertexUvs?"#define USE_UV":"",b.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",b.gradientMap?"#define USE_GRADIENTMAP":"",b.flatShading?"#define FLAT_SHADED":"",b.doubleSided?"#define DOUBLE_SIDED":"",b.flipSided?"#define FLIP_SIDED":"",b.shadowMapEnabled?"#define USE_SHADOWMAP":"",b.shadowMapEnabled?"#define "+l:"",b.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",b.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",b.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",b.logarithmicDepthBuffer&&b.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(b.extensionShaderTextureLOD||b.envMap)&&b.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatri