AlkantarClanX12

Your IP : 216.73.217.24


Current Path : /www/capitalgmcbuickregina_830/public/wp-content/themes/lbx-egypt/resources/scripts/
Upload File :
Current File : /www/capitalgmcbuickregina_830/public/wp-content/themes/lbx-egypt/resources/scripts/panolens.min.js

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("vue")):"function"==typeof define&&define.amd?define(["vue"],e):"object"==typeof exports?exports.VueVR=e(require("vue")):t.VueVR=e(t.Vue)}(this,function(n){return o={},i.m=r=[function(t,e){t=t.exports={version:"2.5.3"};"number"==typeof __e&&(__e=t)},function(t,e){t=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=t)},function(t,e,n){var i=n(39)("wks"),r=n(43),o=n(1).Symbol,a="function"==typeof o;(t.exports=function(t){return i[t]||(i[t]=a&&o[t]||(a?o:r)("Symbol."+t))}).store=i},function(t,e,n){var m=n(1),v=n(0),g=n(11),y=n(5),x=function(t,e,n){var i,r,o,a=t&x.F,s=t&x.G,c=t&x.S,h=t&x.P,l=t&x.B,u=t&x.W,d=s?v:v[e]||(v[e]={}),p=d.prototype,f=s?m:c?m[e]:(m[e]||{}).prototype;for(i in s&&(n=e),n)(r=!a&&f&&void 0!==f[i])&&i in d||(o=(r?f:n)[i],d[i]=s&&"function"!=typeof f[i]?n[i]:l&&r?g(o,m):u&&f[i]==o?function(i){function t(t,e,n){if(this instanceof i){switch(arguments.length){case 0:return new i;case 1:return new i(t);case 2:return new i(t,e)}return new i(t,e,n)}return i.apply(this,arguments)}return t.prototype=i.prototype,t}(o):h&&"function"==typeof o?g(Function.call,o):o,h&&((d.virtual||(d.virtual={}))[i]=o,t&x.R&&p&&!p[i]&&y(p,i,o)))};x.F=1,x.G=2,x.S=4,x.P=8,x.B=16,x.W=32,x.U=64,x.R=128,t.exports=x},function(t,e,n){var i=n(7);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){var i=n(14),r=n(38);t.exports=n(6)?function(t,e,n){return i.f(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){t.exports=!n(12)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){t.exports={}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var o=n(9);t.exports=function(i,r,t){if(o(i),void 0===r)return i;switch(t){case 1:return function(t){return i.call(r,t)};case 2:return function(t,e){return i.call(r,t,e)};case 3:return function(t,e,n){return i.call(r,t,e,n)}}return function(){return i.apply(r,arguments)}}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var i=n(4),r=n(66),o=n(86),a=Object.defineProperty;e.f=n(6)?Object.defineProperty:function(t,e,n){if(i(t),e=o(e,!0),i(n),r)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){"use strict";function i(){}function wt(t,e){this.x=t||0,this.y=e||0}function S(t,e,n,i){this._x=t||0,this._y=e||0,this._z=n||0,this._w=void 0!==i?i:1}function Mt(t,e,n){this.x=t||0,this.y=e||0,this.z=n||0}function T(){this.elements=[1,0,0,0,1,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}function d(t,e,n,i,r,o,a,s,c,h){Object.defineProperty(this,"id",{value:pc++}),this.uuid=As.generateUUID(),this.name="",this.image=void 0!==t?t:d.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:d.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:pa,this.wrapT=void 0!==i?i:pa,this.magFilter=void 0!==r?r:ya,this.minFilter=void 0!==o?o:ba,this.anisotropy=void 0!==c?c:1,this.format=void 0!==a?a:Na,this.type=void 0!==s?s:wa,this.offset=new wt(0,0),this.repeat=new wt(1,1),this.center=new wt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new T,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==h?h:fs,this.version=0,this.onUpdate=null}function _t(t,e,n,i){this.x=t||0,this.y=e||0,this.z=n||0,this.w=void 0!==i?i:1}function I(t,e,n){this.width=t,this.height=e,this.scissor=new _t(0,0,t,e),this.scissorTest=!1,this.viewport=new _t(0,0,t,e),n=n||{},this.texture=new d(void 0,void 0,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:ya,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function r(t,e,n){I.call(this,t,e,n),this.samples=4}function u(t,e,n){I.call(this,t,e,n)}function Et(t,e,n,i,r,o,a,s,c,h,l,u){d.call(this,null,o,a,s,c,h,i,r,l,u),this.image={data:t,width:e,height:n},this.magFilter=void 0!==c?c:ma,this.minFilter=void 0!==h?h:ma,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function o(t,e){this.min=void 0!==t?t:new Mt(1/0,1/0,1/0),this.max=void 0!==e?e:new Mt(-1/0,-1/0,-1/0)}function g(t,e){this.center=void 0!==t?t:new Mt,this.radius=void 0!==e?e:0}function a(t,e){this.normal=void 0!==t?t:new Mt(1,0,0),this.constant=void 0!==e?e:0}function At(t,e,n,i,r,o){this.planes=[void 0!==t?t:new a,void 0!==e?e:new a,void 0!==n?n:new a,void 0!==i?i:new a,void 0!==r?r:new a,void 0!==o?o:new a]}function St(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0<arguments.length&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function Tt(t){var e,n={};for(e in t)for(var i in n[e]={},t[e]){var r=t[e][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?n[e][i]=r.clone():Array.isArray(r)?n[e][i]=r.slice():n[e][i]=r}return n}function s(t){for(var e={},n=0;n<t.length;n++){var i,r=Tt(t[n]);for(i in r)e[i]=r[i]}return e}function y(t,e,n){return void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}function Lt(){function n(t,e){!1!==r&&(o(t,e),i.requestAnimationFrame(n))}var i=null,r=!1,o=null;return{start:function(){!0!==r&&null!==o&&(i.requestAnimationFrame(n),r=!0)},stop:function(){r=!1},setAnimationLoop:function(t){o=t},setContext:function(t){i=t}}}function Rt(c){var h=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),h.get(t)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);var e=h.get(t);e&&(c.deleteBuffer(e.buffer),h.delete(t))},update:function(t,e){t.isInterleavedBufferAttribute&&(t=t.data);var n,i,r,o,a,s=h.get(t);void 0===s?h.set(t,(i=e,r=(n=t).array,o=n.dynamic?35048:35044,a=c.createBuffer(),c.bindBuffer(i,a),c.bufferData(i,r,o),n.onUploadCallback(),o=5126,r instanceof Float32Array?o=5126:r instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):r instanceof Uint16Array?o=5123:r instanceof Int16Array?o=5122:r instanceof Uint32Array?o=5125:r instanceof Int32Array?o=5124:r instanceof Int8Array?o=5120:r instanceof Uint8Array&&(o=5121),{buffer:a,type:o,bytesPerElement:r.BYTES_PER_ELEMENT,version:n.version})):s.version<t.version&&(a=s.buffer,o=e,n=(r=t).array,e=r.updateRange,c.bindBuffer(o,a),!1===r.dynamic?c.bufferData(o,n,35044):-1===e.count?c.bufferSubData(o,0,n):0===e.count?console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually."):(c.bufferSubData(o,e.offset*n.BYTES_PER_ELEMENT,n.subarray(e.offset,e.offset+e.count)),e.count=-1),s.version=t.version)}}}function L(t,e,n,i,r,o){this.a=t,this.b=e,this.c=n,this.normal=i&&i.isVector3?i:new Mt,this.vertexNormals=Array.isArray(i)?i:[],this.color=r&&r.isColor?r:new y,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==o?o:0}function c(t,e,n,i){this._x=t||0,this._y=e||0,this._z=n||0,this._order=i||c.DefaultOrder}function h(){this.mask=1}function f(){Object.defineProperty(this,"id",{value:Xc++}),this.uuid=As.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=f.DefaultUp.clone();var t=new Mt,e=new c,n=new S,i=new Mt(1,1,1);e.onChange(function(){n.setFromEuler(e,!1)}),n.onChange(function(){e.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new St},normalMatrix:{value:new T}}),this.matrix=new St,this.matrixWorld=new St,this.matrixAutoUpdate=f.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new h,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function x(){Object.defineProperty(this,"id",{value:eh+=2}),this.uuid=As.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.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}function b(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===n,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function l(t,e,n){b.call(this,new Int8Array(t),e,n)}function p(t,e,n){b.call(this,new Uint8Array(t),e,n)}function m(t,e,n){b.call(this,new Uint8ClampedArray(t),e,n)}function v(t,e,n){b.call(this,new Int16Array(t),e,n)}function w(t,e,n){b.call(this,new Uint16Array(t),e,n)}function M(t,e,n){b.call(this,new Int32Array(t),e,n)}function _(t,e,n){b.call(this,new Uint32Array(t),e,n)}function z(t,e,n){b.call(this,new Float32Array(t),e,n)}function E(t,e,n){b.call(this,new Float64Array(t),e,n)}function A(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function R(t){if(0===t.length)return-1/0;for(var e=t[0],n=1,i=t.length;n<i;++n)t[n]>e&&(e=t[n]);return e}function U(){Object.defineProperty(this,"id",{value:fh+=2}),this.uuid=As.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:1/0},this.userData={}}function C(t,e,n,i,r,o){x.call(this),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:o},this.fromBufferGeometry(new P(t,e,n,i,r,o)),this.mergeVertices()}function P(t,e,n,i,r,o){function a(t,e,n,i,r,o,a,s,c,h,l){for(var u=o/c,d=a/h,p=o/2,f=a/2,m=s/2,v=c+1,g=h+1,y=0,x=0,b=new Mt,w=0;w<g;w++)for(var M=w*d-f,_=0;_<v;_++){var E=_*u-p;b[t]=E*i,b[e]=M*r,b[n]=m,P.push(b.x,b.y,b.z),b[t]=0,b[e]=0,b[n]=0<s?1:-1,I.push(b.x,b.y,b.z),O.push(_/c),O.push(1-w/h),y+=1}for(w=0;w<h;w++)for(_=0;_<c;_++){var A=D+_+v*w,S=D+_+v*(w+1),T=D+(_+1)+v*(w+1),L=D+(_+1)+v*w;C.push(A,S,L),C.push(S,T,L),x+=6}R.addGroup(N,x,l),N+=x,D+=y}U.call(this),this.type="BoxBufferGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:o};var R=this;t=t||1,e=e||1,n=n||1,i=Math.floor(i)||1,r=Math.floor(r)||1,o=Math.floor(o)||1;var C=[],P=[],I=[],O=[],D=0,N=0;a("z","y","x",-1,-1,n,e,t,o,r,0),a("z","y","x",1,-1,n,e,-t,o,r,1),a("x","z","y",1,1,t,n,e,i,o,2),a("x","z","y",1,-1,t,n,-e,i,o,3),a("x","y","z",1,-1,t,e,n,i,r,4),a("x","y","z",-1,-1,t,e,-n,i,r,5),this.setIndex(C),this.addAttribute("position",new z(P,3)),this.addAttribute("normal",new z(I,3)),this.addAttribute("uv",new z(O,2))}function O(t,e,n,i){x.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i},this.fromBufferGeometry(new D(t,e,n,i)),this.mergeVertices()}function D(t,e,n,i){U.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i};for(var r=(t=t||1)/2,o=(e=e||1)/2,a=Math.floor(n)||1,s=Math.floor(i)||1,c=a+1,h=s+1,l=t/a,u=e/s,d=[],p=[],f=[],m=[],v=0;v<h;v++)for(var g=v*u-o,y=0;y<c;y++){var x=y*l-r;p.push(x,-g,0),f.push(0,0,1),m.push(y/a),m.push(1-v/s)}for(v=0;v<s;v++)for(y=0;y<a;y++){var b=y+c*v,w=y+c*(v+1),M=y+1+c*(v+1),_=y+1+c*v;d.push(b,w,_),d.push(w,M,_)}this.setIndex(d),this.addAttribute("position",new z(p,3)),this.addAttribute("normal",new z(f,3)),this.addAttribute("uv",new z(m,2))}function N(){Object.defineProperty(this,"id",{value:mh++}),this.uuid=As.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=wo,this.side=vo,this.flatShading=!1,this.vertexTangents=!1,this.vertexColors=xo,this.opacity=1,this.transparent=!1,this.blendSrc=No,this.blendDst=zo,this.blendEquation=So,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Wo,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.userData={},this.needsUpdate=!0}function B(t){N.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=al,this.fragmentShader=sl,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!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,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function k(t,e){this.origin=void 0!==t?t:new Mt,this.direction=void 0!==e?e:new Mt}function F(t,e,n){this.a=void 0!==t?t:new Mt,this.b=void 0!==e?e:new Mt,this.c=void 0!==n?n:new Mt}function G(t){N.call(this),this.type="MeshBasicMaterial",this.color=new y(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Jo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.lights=!1,this.setValues(t)}function H(t,e){f.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new U,this.material=void 0!==e?e:new G({color:16777215*Math.random()}),this.drawMode=us,this.updateMorphTargets()}function Ct(o,n,a,i){function s(t,e){n.buffers.color.setClear(t.r,t.g,t.b,e,i)}var c,h,l=new y(0),u=0,d=null,p=0;return{getClearColor:function(){return l},setClearColor:function(t,e){l.set(t),s(l,u=void 0!==e?e:1)},getClearAlpha:function(){return u},setClearAlpha:function(t){s(l,u=t)},render:function(t,e,n,i){var r=e.background;(e=(e=o.vr).getSession&&e.getSession())&&"additive"===e.environmentBlendMode&&(r=null),null===r?(s(l,u),d=null,p=0):r&&r.isColor&&(s(r,1),i=!0,d=null,p=0),(o.autoClear||i)&&o.clear(o.autoClearColor,o.autoClearDepth,o.autoClearStencil),r&&(r.isCubeTexture||r.isWebGLRenderTargetCube)?(void 0===h&&((h=new H(new P(1,1,1),new B({type:"BackgroundCubeMaterial",uniforms:Tt(Tc.cube.uniforms),vertexShader:Tc.cube.vertexShader,fragmentShader:Tc.cube.fragmentShader,side:go,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.removeAttribute("normal"),h.geometry.removeAttribute("uv"),h.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(h.material,"map",{get:function(){return this.uniforms.tCube.value}}),a.update(h)),i=r.isWebGLRenderTargetCube?r.texture:r,h.material.uniforms.tCube.value=i,h.material.uniforms.tFlip.value=r.isWebGLRenderTargetCube?1:-1,d===r&&p===i.version||(h.material.needsUpdate=!0,d=r,p=i.version),t.unshift(h,h.geometry,h.material,0,0,null)):r&&r.isTexture&&(void 0===c&&((c=new H(new D(2,2),new B({type:"BackgroundMaterial",uniforms:Tt(Tc.background.uniforms),vertexShader:Tc.background.vertexShader,fragmentShader:Tc.background.fragmentShader,side:vo,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.removeAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),a.update(c)),!0===(c.material.uniforms.t2D.value=r).matrixAutoUpdate&&r.updateMatrix(),c.material.uniforms.uvTransform.value.copy(r.matrix),d===r&&p===r.version||(c.material.needsUpdate=!0,p=(d=r).version),t.unshift(c,c.geometry,c.material,0,0,null))}}}function Pt(r,o,a,s){var c;this.setMode=function(t){c=t},this.render=function(t,e){r.drawArrays(c,t,e),a.update(e,c)},this.renderInstances=function(t,e,n){var i;if(s.isWebGL2)i=r;else if(null===(i=o.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");i[s.isWebGL2?"drawArraysInstanced":"drawArraysInstancedANGLE"](c,e,n,t.maxInstancedCount),a.update(n,c,t.maxInstancedCount)}}function It(e,n,t){function i(t){if("highp"===t){if(0<e.getShaderPrecisionFormat(35633,36338).precision&&0<e.getShaderPrecisionFormat(35632,36338).precision)return"highp";t="mediump"}return"mediump"===t&&0<e.getShaderPrecisionFormat(35633,36337).precision&&0<e.getShaderPrecisionFormat(35632,36337).precision?"mediump":"lowp"}var r,o="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext,a=void 0!==t.precision?t.precision:"highp",s=i(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);var c=!0===t.logarithmicDepthBuffer,h=e.getParameter(34930),l=e.getParameter(35660),u=e.getParameter(3379),d=e.getParameter(34076),p=e.getParameter(34921),f=e.getParameter(36347),m=e.getParameter(36348),v=e.getParameter(36349),s=0<l,t=o||!!n.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){if(void 0!==r)return r;var t=n.get("EXT_texture_filter_anisotropic");return r=null!==t?e.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:l,maxTextureSize:u,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:v,vertexTextures:s,floatFragmentTextures:t,floatVertexTextures:s&&t,maxSamples:o?e.getParameter(36183):0}}function Ot(){function h(){y.value!==d&&(y.value=d,y.needsUpdate=0<p),u.numPlanes=p,u.numIntersection=0}function l(t,e,n,i){var r=null!==t?t.length:0,o=null;if(0!==r){if(o=y.value,!0!==i||null===o){var i=n+4*r,a=e.matrixWorldInverse;g.getNormalMatrix(a),(null===o||o.length<i)&&(o=new Float32Array(i));for(var s=0,c=n;s!==r;++s,c+=4)v.copy(t[s]).applyMatrix4(a,g),v.normal.toArray(o,c),o[c+3]=v.constant}y.value=o,y.needsUpdate=!0}return u.numPlanes=r,o}var u=this,d=null,p=0,f=!1,m=!1,v=new a,g=new T,y={value:null,needsUpdate:!1};this.uniform=y,this.numPlanes=0,this.numIntersection=0,this.init=function(t,e,n){var i=0!==t.length||e||0!==p||f;return f=e,d=l(t,n,0),p=t.length,i},this.beginShadows=function(){m=!0,l(null)},this.endShadows=function(){m=!1,h()},this.setState=function(t,e,n,i,r,o){if(!f||null===t||0===t.length||m&&!n)m?l(null):h();else{var n=m?0:p,a=4*n,s=r.clippingState||null;y.value=s,s=l(t,i,a,o);for(var c=0;c!==a;++c)s[c]=d[c];r.clippingState=s,this.numIntersection=e?this.numPlanes:0,this.numPlanes+=n}}}function Dt(n){var i={};return{get:function(t){if(void 0!==i[t])return i[t];var e;switch(t){case"WEBGL_depth_texture":e=n.getExtension("WEBGL_depth_texture")||n.getExtension("MOZ_WEBGL_depth_texture")||n.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":e=n.getExtension("EXT_texture_filter_anisotropic")||n.getExtension("MOZ_EXT_texture_filter_anisotropic")||n.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":e=n.getExtension("WEBGL_compressed_texture_s3tc")||n.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":e=n.getExtension("WEBGL_compressed_texture_pvrtc")||n.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:e=n.getExtension(t)}return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),i[t]=e}}}function Nt(t,u,i){function r(t){var e,t=t.target,n=o[t.id];for(e in null!==n.index&&u.remove(n.index),n.attributes)u.remove(n.attributes[e]);t.removeEventListener("dispose",r),delete o[t.id];t=d[n.id];t&&(u.remove(t),delete d[n.id]),i.memory.geometries--}var o={},d={};return{get:function(t,e){var n=o[e.id];return n||(e.addEventListener("dispose",r),e.isBufferGeometry?n=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new U).setFromObject(t)),n=e._bufferGeometry),o[e.id]=n,i.memory.geometries++,n)},update:function(t){var e=t.index,n=t.attributes;for(i in null!==e&&u.update(e,34963),n)u.update(n[i],34962);var i,r=t.morphAttributes;for(i in r)for(var o=r[i],a=0,s=o.length;a<s;a++)u.update(o[a],34962)},getWireframeAttribute:function(t){var e=d[t.id];if(e)return e;var n=[],i=t.index,r=t.attributes;if(null!==i)for(var o=i.array,a=0,s=o.length;a<s;a+=3){var c=o[a+0],h=o[a+1],l=o[a+2];n.push(c,h,h,l,l,c)}else for(a=0,s=(o=r.position.array).length/3-1;a<s;a+=3){c=a+0,h=a+1,l=a+2;n.push(c,h,h,l,l,c)}return e=new(65535<R(n)?_:w)(n,1),u.update(e,34963),d[t.id]=e}}}function zt(r,o,a,s){var c,h,l;this.setMode=function(t){c=t},this.setIndex=function(t){h=t.type,l=t.bytesPerElement},this.render=function(t,e){r.drawElements(c,e,h,t*l),a.update(e,c)},this.renderInstances=function(t,e,n){var i;if(s.isWebGL2)i=r;else if(null===(i=o.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");i[s.isWebGL2?"drawElementsInstanced":"drawElementsInstancedANGLE"](c,n,h,e*l,t.maxInstancedCount),a.update(n,c,t.maxInstancedCount)}}function Ut(t){var i={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:i,programs:null,autoReset:!0,reset:function(){i.frame++,i.calls=0,i.triangles=0,i.points=0,i.lines=0},update:function(t,e,n){switch(n=n||1,i.calls++,e){case 4:i.triangles+=n*(t/3);break;case 5:case 6:i.triangles+=n*(t-2);break;case 1:i.lines+=n*(t/2);break;case 3:i.lines+=n*(t-1);break;case 2:i.lines+=n*t;break;case 0:i.points+=n*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",e)}}}}function j(t,e){return Math.abs(e[1])-Math.abs(t[1])}function Bt(p){var f={},m=new Float32Array(8);return{update:function(t,e,n,i){var r=t.morphTargetInfluences,o=r.length,a=f[e.id];if(void 0===a){a=[];for(var s=0;s<o;s++)a[s]=[s,0];f[e.id]=a}for(var c=n.morphTargets&&e.morphAttributes.position,h=n.morphNormals&&e.morphAttributes.normal,s=0;s<o;s++)0!==(l=a[s])[1]&&(c&&e.removeAttribute("morphTarget"+s),h&&e.removeAttribute("morphNormal"+s));for(s=0;s<o;s++)(l=a[s])[0]=s,l[1]=r[s];a.sort(j);for(var l,s=0;s<8;s++){if(l=a[s]){var u=l[0],d=l[1];if(d){c&&e.addAttribute("morphTarget"+s,c[u]),h&&e.addAttribute("morphNormal"+s,h[u]),m[s]=d;continue}}m[s]=0}i.getUniforms().setValue(p,"morphTargetInfluences",m)}}}function kt(r,o){var a={};return{update:function(t){var e=o.render.frame,n=t.geometry,i=r.get(t,n);return a[i.id]!==e&&(n.isGeometry&&i.updateFromObject(t),r.update(i),a[i.id]=e),i},dispose:function(){a={}}}}function V(t,e,n,i,r,o,a,s,c,h){d.call(this,t=void 0!==t?t:[],e=void 0!==e?e:oa,n,i,r,o,a=void 0!==a?a:Da,s,c,h),this.flipY=!1}function W(t,e,n,i){d.call(this,null),this.image={data:t,width:e,height:n,depth:i},this.magFilter=ma,this.minFilter=ma,this.wrapR=pa,this.generateMipmaps=!1,this.flipY=!1}function q(t,e,n,i){d.call(this,null),this.image={data:t,width:e,height:n,depth:i},this.magFilter=ma,this.minFilter=ma,this.wrapR=pa,this.generateMipmaps=!1,this.flipY=!1}function X(t,e,n){var i=t[0];if(i<=0||0<i)return t;var r=e*n,o=fl[r];if(void 0===o&&(o=new Float32Array(r),fl[r]=o),0!==e){i.toArray(o,0);for(var a=1,s=0;a!==e;++a)s+=n,t[a].toArray(o,s)}return o}function Y(t,e){if(t.length===e.length){for(var n=0,i=t.length;n<i;n++)if(t[n]!==e[n])return;return 1}}function Z(t,e){for(var n=0,i=e.length;n<i;n++)t[n]=e[n]}function J(t,e){var n=ml[e];void 0===n&&(n=new Int32Array(e),ml[e]=n);for(var i=0;i!==e;++i)n[i]=t.allocateTextureUnit();return n}function Q(t,e){var n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function K(t,e){var n=this.cache;void 0!==e.x?n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y):Y(n,e)||(t.uniform2fv(this.addr,e),Z(n,e))}function $(t,e){var n=this.cache;void 0!==e.x?n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z):void 0!==e.r?n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b):Y(n,e)||(t.uniform3fv(this.addr,e),Z(n,e))}function tt(t,e){var n=this.cache;void 0!==e.x?n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w):Y(n,e)||(t.uniform4fv(this.addr,e),Z(n,e))}function et(t,e){var n=this.cache,i=e.elements;void 0===i?Y(n,e)||(t.uniformMatrix2fv(this.addr,!1,e),Z(n,e)):Y(n,i)||(yl.set(i),t.uniformMatrix2fv(this.addr,!1,yl),Z(n,i))}function nt(t,e){var n=this.cache,i=e.elements;void 0===i?Y(n,e)||(t.uniformMatrix3fv(this.addr,!1,e),Z(n,e)):Y(n,i)||(gl.set(i),t.uniformMatrix3fv(this.addr,!1,gl),Z(n,i))}function it(t,e){var n=this.cache,i=e.elements;void 0===i?Y(n,e)||(t.uniformMatrix4fv(this.addr,!1,e),Z(n,e)):Y(n,i)||(vl.set(i),t.uniformMatrix4fv(this.addr,!1,vl),Z(n,i))}function rt(t,e,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.safeSetTexture2D(e||ll,r)}function ot(t,e,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(e||ul,r)}function at(t,e,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(e||dl,r)}function st(t,e,n){var i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.safeSetTextureCube(e||pl,r)}function ct(t,e){var n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function ht(t,e){var n=this.cache;Y(n,e)||(t.uniform2iv(this.addr,e),Z(n,e))}function lt(t,e){var n=this.cache;Y(n,e)||(t.uniform3iv(this.addr,e),Z(n,e))}function ut(t,e){var n=this.cache;Y(n,e)||(t.uniform4iv(this.addr,e),Z(n,e))}function dt(t,e){t.uniform1fv(this.addr,e)}function pt(t,e){t.uniform1iv(this.addr,e)}function ft(t,e){t.uniform2iv(this.addr,e)}function mt(t,e){t.uniform3iv(this.addr,e)}function vt(t,e){t.uniform4iv(this.addr,e)}function gt(t,e){e=X(e,this.size,2);t.uniform2fv(this.addr,e)}function yt(t,e){e=X(e,this.size,3);t.uniform3fv(this.addr,e)}function xt(t,e){e=X(e,this.size,4);t.uniform4fv(this.addr,e)}function bt(t,e){e=X(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,e)}function Ft(t,e){e=X(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,e)}function Gt(t,e){e=X(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,e)}function Ht(t,e,n){var i=e.length,r=J(n,i);t.uniform1iv(this.addr,r);for(var o=0;o!==i;++o)n.safeSetTexture2D(e[o]||ll,r[o])}function jt(t,e,n){var i=e.length,r=J(n,i);t.uniform1iv(this.addr,r);for(var o=0;o!==i;++o)n.safeSetTextureCube(e[o]||pl,r[o])}function Vt(t,e,n){this.id=t,this.addr=n,this.cache=[],this.setValue=function(t){switch(t){case 5126:return Q;case 35664:return K;case 35665:return $;case 35666:return tt;case 35674:return et;case 35675:return nt;case 35676:return it;case 35678:case 36198:return rt;case 35679:return at;case 35680:return st;case 36289:return ot;case 5124:case 35670:return ct;case 35667:case 35671:return ht;case 35668:case 35672:return lt;case 35669:case 35673:return ut}}(e.type)}function Wt(t,e,n){this.id=t,this.addr=n,this.cache=[],this.size=e.size,this.setValue=function(t){switch(t){case 5126:return dt;case 35664:return gt;case 35665:return yt;case 35666:return xt;case 35674:return bt;case 35675:return Ft;case 35676:return Gt;case 35678:return Ht;case 35680:return jt;case 5124:case 35670:return pt;case 35667:case 35671:return ft;case 35668:case 35672:return mt;case 35669:case 35673:return vt}}(e.type)}function qt(t){this.id=t,this.seq=[],this.map={}}function Xt(t,e){t.seq.push(e),t.map[e.id]=e}function Yt(t,e){this.seq=[],this.map={};for(var n=t.getProgramParameter(e,35718),i=0;i<n;++i){var r=t.getActiveUniform(e,i);!function(t,e,n){var i=t.name,r=i.length;for(xl.lastIndex=0;;){var o=xl.exec(i),a=xl.lastIndex,s=o[1],c="]"===o[2],o=o[3];if(c&&(s|=0),void 0===o||"["===o&&a+2===r){Xt(n,new(void 0===o?Vt:Wt)(s,t,e));break}o=n.map[s];void 0===o&&Xt(n,o=new qt(s)),n=o}}(r,t.getUniformLocation(e,r.name),this)}}function Zt(t,e,n,i){var r=t.createShader(e);return t.shaderSource(r,n),t.compileShader(r),!0===i&&(!1===t.getShaderParameter(r,35713)&&console.error("THREE.WebGLShader: Shader couldn't compile."),""!==t.getShaderInfoLog(r)&&console.warn("THREE.WebGLShader: gl.getShaderInfoLog()",35633===e?"vertex":"fragment",t.getShaderInfoLog(r),function(t){for(var e=t.split("\n"),n=0;n<e.length;n++)e[n]=n+1+": "+e[n];return e.join("\n")}(n))),r}function Jt(t){switch(t){case fs:return["Linear","( value )"];case ms:return["sRGB","( value )"];case gs:return["RGBE","( value )"];case ys:return["RGBM","( value, 7.0 )"];case xs:return["RGBM","( value, 16.0 )"];case bs:return["RGBD","( value, 256.0 )"];case vs:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+t)}}function Qt(t,e){e=Jt(e);return"vec4 "+t+"( vec4 value ) { return "+e[0]+"ToLinear"+e[1]+"; }"}function Kt(t){return""!==t}function $t(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights)}function te(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}function ee(t){return t.replace(/^[ \t]*#include +<([\w\d.\/]+)>/gm,function(t,e){var n=xc[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return ee(n)})}function ne(t){return t.replace(/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,function(t,e,n,i){for(var r="",o=parseInt(e);o<parseInt(n);o++)r+=i.replace(/\[ i \]/g,"[ "+o+" ]");return r})}function ie(t,e,n,i,r,o,a,s){var c=t.context,h=i.defines,l=r.vertexShader,u=r.fragmentShader,d="SHADOWMAP_TYPE_BASIC";o.shadowMapType===fo?d="SHADOWMAP_TYPE_PCF":o.shadowMapType===mo&&(d="SHADOWMAP_TYPE_PCF_SOFT");var p="ENVMAP_TYPE_CUBE",f="ENVMAP_MODE_REFLECTION",m="ENVMAP_BLENDING_MULTIPLY";if(o.envMap){switch(i.envMap.mapping){case oa:case aa:p="ENVMAP_TYPE_CUBE";break;case la:case ua:p="ENVMAP_TYPE_CUBE_UV";break;case sa:case ca:p="ENVMAP_TYPE_EQUIREC";break;case ha:p="ENVMAP_TYPE_SPHERE"}switch(i.envMap.mapping){case aa:case ca:f="ENVMAP_MODE_REFRACTION"}switch(i.combine){case Jo:m="ENVMAP_BLENDING_MULTIPLY";break;case Qo:m="ENVMAP_BLENDING_MIX";break;case Ko:m="ENVMAP_BLENDING_ADD"}}var v,g,y,x,b,w=0<t.gammaFactor?t.gammaFactor:1,b=a.isWebGL2?"":(y=i.extensions,x=o,b=e,[(y=y||{}).derivatives||x.envMapCubeUV||x.bumpMap||x.normalMap&&!x.objectSpaceNormalMap||x.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(y.fragDepth||x.logarithmicDepthBuffer)&&b.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",y.drawBuffers&&b.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(y.shaderTextureLOD||x.envMap)&&b.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Kt).join("\n")),h=function(t){var e,n=[];for(e in t){var i=t[e];!1!==i&&n.push("#define "+e+" "+i)}return n.join("\n")}(h),M=c.createProgram();i.isRawShaderMaterial?(0<(v=[h].filter(Kt).join("\n")).length&&(v+="\n"),0<(g=[b,h].filter(Kt).join("\n")).length&&(g+="\n")):(v=["precision "+o.precision+" float;","precision "+o.precision+" int;","#define SHADER_NAME "+r.name,h,o.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+w,"#define MAX_BONES "+o.maxBones,o.useFog&&o.fog?"#define USE_FOG":"",o.useFog&&o.fogExp?"#define FOG_EXP2":"",o.map?"#define USE_MAP":"",o.envMap?"#define USE_ENVMAP":"",o.envMap?"#define "+f:"",o.lightMap?"#define USE_LIGHTMAP":"",o.aoMap?"#define USE_AOMAP":"",o.emissiveMap?"#define USE_EMISSIVEMAP":"",o.bumpMap?"#define USE_BUMPMAP":"",o.normalMap?"#define USE_NORMALMAP":"",o.normalMap&&o.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",o.displacementMap&&o.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",o.specularMap?"#define USE_SPECULARMAP":"",o.roughnessMap?"#define USE_ROUGHNESSMAP":"",o.metalnessMap?"#define USE_METALNESSMAP":"",o.alphaMap?"#define USE_ALPHAMAP":"",o.vertexTangents?"#define USE_TANGENT":"",o.vertexColors?"#define USE_COLOR":"",o.flatShading?"#define FLAT_SHADED":"",o.skinning?"#define USE_SKINNING":"",o.useVertexTexture?"#define BONE_TEXTURE":"",o.morphTargets?"#define USE_MORPHTARGETS":"",o.morphNormals&&!1===o.flatShading?"#define USE_MORPHNORMALS":"",o.doubleSided?"#define DOUBLE_SIDED":"",o.flipSided?"#define FLIP_SIDED":"",o.shadowMapEnabled?"#define USE_SHADOWMAP":"",o.shadowMapEnabled?"#define "+d:"",o.sizeAttenuation?"#define USE_SIZEATTENUATION":"",o.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",o.logarithmicDepthBuffer&&(a.isWebGL2||e.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_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(Kt).join("\n"),g=[b,"precision "+o.precision+" float;","precision "+o.precision+" int;","#define SHADER_NAME "+r.name,h,o.alphaTest?"#define ALPHATEST "+o.alphaTest+(o.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+w,o.useFog&&o.fog?"#define USE_FOG":"",o.useFog&&o.fogExp?"#define FOG_EXP2":"",o.map?"#define USE_MAP":"",o.matcap?"#define USE_MATCAP":"",o.envMap?"#define USE_ENVMAP":"",o.envMap?"#define "+p:"",o.envMap?"#define "+f:"",o.envMap?"#define "+m:"",o.lightMap?"#define USE_LIGHTMAP":"",o.aoMap?"#define USE_AOMAP":"",o.emissiveMap?"#define USE_EMISSIVEMAP":"",o.bumpMap?"#define USE_BUMPMAP":"",o.normalMap?"#define USE_NORMALMAP":"",o.normalMap&&o.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",o.specularMap?"#define USE_SPECULARMAP":"",o.roughnessMap?"#define USE_ROUGHNESSMAP":"",o.metalnessMap?"#define USE_METALNESSMAP":"",o.alphaMap?"#define USE_ALPHAMAP":"",o.vertexTangents?"#define USE_TANGENT":"",o.vertexColors?"#define USE_COLOR":"",o.gradientMap?"#define USE_GRADIENTMAP":"",o.flatShading?"#define FLAT_SHADED":"",o.doubleSided?"#define DOUBLE_SIDED":"",o.flipSided?"#define FLIP_SIDED":"",o.shadowMapEnabled?"#define USE_SHADOWMAP":"",o.shadowMapEnabled?"#define "+d:"",o.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",o.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",o.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",o.logarithmicDepthBuffer&&(a.isWebGL2||e.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"",o.envMap&&(a.isWebGL2||e.get("EXT_shader_texture_lod"))?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",o.toneMapping!==$o?"#define TONE_MAPPING":"",o.toneMapping!==$o?xc.tonemapping_pars_fragment:"",o.toneMapping!==$o?function(t,e){var n;switch(e){case ta:n="Linear";break;case ea:n="Reinhard";break;case na:n="Uncharted2";break;case ia:n="OptimizedCineon";break;case ra:n="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+e)}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}("toneMapping",o.toneMapping):"",o.dithering?"#define DITHERING":"",o.outputEncoding||o.mapEncoding||o.matcapEncoding||o.envMapEncoding||o.emissiveMapEncoding?xc.encodings_pars_fragment:"",o.mapEncoding?Qt("mapTexelToLinear",o.mapEncoding):"",o.matcapEncoding?Qt("matcapTexelToLinear",o.matcapEncoding):"",o.envMapEncoding?Qt("envMapTexelToLinear",o.envMapEncoding):"",o.emissiveMapEncoding?Qt("emissiveMapTexelToLinear",o.emissiveMapEncoding):"",o.outputEncoding?(d="linearToOutputTexel",e=Jt(e=o.outputEncoding),"vec4 "+d+"( vec4 value ) { return LinearTo"+e[0]+e[1]+"; }"):"",o.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(Kt).join("\n")),l=te(l=$t(l=ee(l),o),o),u=te(u=$t(u=ee(u),o),o),l=ne(l),u=ne(u),a.isWebGL2&&!i.isRawShaderMaterial&&(S=!1,A=/^\s*#version\s+300\s+es\s*\n/,i.isShaderMaterial&&null!==l.match(A)&&null!==u.match(A)&&(S=!0,l=l.replace(A,""),u=u.replace(A,"")),v=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+v,g=["#version 300 es\n","#define varying in",S?"":"out highp vec4 pc_fragColor;",S?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+g);var _,E,a=g+u,A=Zt(c,35633,v+l,t.debug.checkShaderErrors),S=Zt(c,35632,a,t.debug.checkShaderErrors);return c.attachShader(M,A),c.attachShader(M,S),void 0!==i.index0AttributeName?c.bindAttribLocation(M,0,i.index0AttributeName):!0===o.morphTargets&&c.bindAttribLocation(M,0,"position"),c.linkProgram(M),t.debug.checkShaderErrors&&(u=c.getProgramInfoLog(M).trim(),l=c.getShaderInfoLog(A).trim(),a=c.getShaderInfoLog(S).trim(),!(t=o=!0)===c.getProgramParameter(M,35714)?(o=!1,console.error("THREE.WebGLProgram: shader error: ",c.getError(),"35715",c.getProgramParameter(M,35715),"gl.getProgramInfoLog",u,l,a)):""!==u?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",u):""!==l&&""!==a||(t=!1),t&&(this.diagnostics={runnable:o,material:i,programLog:u,vertexShader:{log:l,prefix:v},fragmentShader:{log:a,prefix:g}})),c.deleteShader(A),c.deleteShader(S),this.getUniforms=function(){return void 0===_&&(_=new Yt(c,M)),_},this.getAttributes=function(){return void 0===E&&(E=function(t,e){for(var n={},i=t.getProgramParameter(e,35721),r=0;r<i;r++){var o=t.getActiveAttrib(e,r).name;n[o]=t.getAttribLocation(e,o)}return n}(c,M)),E},this.destroy=function(){c.deleteProgram(M),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),this.getUniforms()}},attributes:{get:function(){return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),this.getAttributes()}}}),this.name=r.name,this.id=bl++,this.code=n,this.usedTimes=1,this.program=M,this.vertexShader=A,this.fragmentShader=S,this}function re(u,c,d,h){function p(t,e){var n;return t?t.isTexture?n=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),n=t.texture.encoding):n=fs,n===fs&&e&&(n=vs),n}var l=[],f={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},o=["precision","supportsVertexTextures","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering"];this.getParameters=function(t,e,n,i,r,o,a){var s,c=f[t.type],h=a.isSkinnedMesh?(s=(l=a).skeleton.bones,d.floatVertexTextures?1024:(l=d.maxVertexUniforms,l=Math.floor((l-20)/4),(l=Math.min(l,s.length))<s.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+s.length+" bones. This GPU supports "+l+"."),0):l)):0,s=d.precision;null!==t.precision&&(s=d.getMaxPrecision(t.precision))!==t.precision&&console.warn("THREE.WebGLProgram.getParameters:",t.precision,"not supported, using",s,"instead.");var l=u.getRenderTarget();return{shaderID:c,precision:s,supportsVertexTextures:d.vertexTextures,outputEncoding:p(l?l.texture:null,u.gammaOutput),map:!!t.map,mapEncoding:p(t.map,u.gammaInput),matcap:!!t.matcap,matcapEncoding:p(t.matcap,u.gammaInput),envMap:!!t.envMap,envMapMode:t.envMap&&t.envMap.mapping,envMapEncoding:p(t.envMap,u.gammaInput),envMapCubeUV:!!t.envMap&&(t.envMap.mapping===la||t.envMap.mapping===ua),lightMap:!!t.lightMap,aoMap:!!t.aoMap,emissiveMap:!!t.emissiveMap,emissiveMapEncoding:p(t.emissiveMap,u.gammaInput),bumpMap:!!t.bumpMap,normalMap:!!t.normalMap,objectSpaceNormalMap:t.normalMapType===Es,displacementMap:!!t.displacementMap,roughnessMap:!!t.roughnessMap,metalnessMap:!!t.metalnessMap,specularMap:!!t.specularMap,alphaMap:!!t.alphaMap,gradientMap:!!t.gradientMap,combine:t.combine,vertexTangents:t.normalMap&&t.vertexTangents,vertexColors:t.vertexColors,fog:!!i,useFog:t.fog,fogExp:i&&i.isFogExp2,flatShading:t.flatShading,sizeAttenuation:t.sizeAttenuation,logarithmicDepthBuffer:d.logarithmicDepthBuffer,skinning:t.skinning&&0<h,maxBones:h,useVertexTexture:d.floatVertexTextures,morphTargets:t.morphTargets,morphNormals:t.morphNormals,maxMorphTargets:u.maxMorphTargets,maxMorphNormals:u.maxMorphNormals,numDirLights:e.directional.length,numPointLights:e.point.length,numSpotLights:e.spot.length,numRectAreaLights:e.rectArea.length,numHemiLights:e.hemi.length,numClippingPlanes:r,numClipIntersection:o,dithering:t.dithering,shadowMapEnabled:u.shadowMap.enabled&&a.receiveShadow&&0<n.length,shadowMapType:u.shadowMap.type,toneMapping:u.toneMapping,physicallyCorrectLights:u.physicallyCorrectLights,premultipliedAlpha:t.premultipliedAlpha,alphaTest:t.alphaTest,doubleSided:t.side===yo,flipSided:t.side===go,depthPacking:void 0!==t.depthPacking&&t.depthPacking}},this.getProgramCode=function(t,e){var n=[];if(e.shaderID?n.push(e.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(var i in t.defines)n.push(i),n.push(t.defines[i]);for(var r=0;r<o.length;r++)n.push(e[o[r]]);return n.push(t.onBeforeCompile.toString()),n.push(u.gammaOutput),n.push(u.gammaFactor),n.join()},this.acquireProgram=function(t,e,n,i){for(var r,o=0,a=l.length;o<a;o++){var s=l[o];if(s.code===i){++(r=s).usedTimes;break}}return void 0===r&&(r=new ie(u,c,i,t,e,n,d,h),l.push(r)),r},this.releaseProgram=function(t){var e;0==--t.usedTimes&&(e=l.indexOf(t),l[e]=l[l.length-1],l.pop(),t.destroy())},this.programs=l}function oe(){var i=new WeakMap;return{get:function(t){var e=i.get(t);return void 0===e&&(e={},i.set(t,e)),e},remove:function(t){i.delete(t)},update:function(t,e,n){i.get(t)[e]=n},dispose:function(){i=new WeakMap}}}function ae(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program!==e.program?t.program.id-e.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function se(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function ce(){function a(t,e,n,i,r,o){var a=s[c];return void 0===a?(a={id:t.id,object:t,geometry:e,material:n,program:n.program||u,groupOrder:i,renderOrder:t.renderOrder,z:r,group:o},s[c]=a):(a.id=t.id,a.object=t,a.geometry=e,a.material=n,a.program=n.program||u,a.groupOrder=i,a.renderOrder=t.renderOrder,a.z=r,a.group=o),c++,a}var s=[],c=0,h=[],l=[],u={id:-1};return{opaque:h,transparent:l,init:function(){c=0,h.length=0,l.length=0},push:function(t,e,n,i,r,o){o=a(t,e,n,i,r,o),(!0===n.transparent?l:h).push(o)},unshift:function(t,e,n,i,r,o){o=a(t,e,n,i,r,o),(!0===n.transparent?l:h).unshift(o)},sort:function(){1<h.length&&h.sort(ae),1<l.length&&l.sort(se)}}}function he(){function r(t){t=t.target;t.removeEventListener("dispose",r),delete o[t.id]}var o={};return{get:function(t,e){var n,i=o[t.id];return void 0===i?(n=new ce,o[t.id]={},o[t.id][e.id]=n,t.addEventListener("dispose",r)):void 0===(n=i[e.id])&&(n=new ce,i[e.id]=n),n},dispose:function(){o={}}}}function le(){var n={};return{get:function(t){if(void 0!==n[t.id])return n[t.id];var e;switch(t.type){case"DirectionalLight":e={direction:new Mt,color:new y,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new wt};break;case"SpotLight":e={position:new Mt,direction:new Mt,color:new y,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new wt};break;case"PointLight":e={position:new Mt,color:new y,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new wt,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":e={direction:new Mt,skyColor:new y,groundColor:new y};break;case"RectAreaLight":e={color:new y,position:new Mt,halfWidth:new Mt,halfHeight:new Mt}}return n[t.id]=e}}}function ue(){for(var M=new le,_={id:wl++,hash:{stateID:-1,directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,shadowsLength:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},t=0;t<9;t++)_.probe.push(new Mt);var E=new Mt,A=new St,S=new St;return{setup:function(t,e,n){for(var i=0,r=0,o=0,a=0;a<9;a++)_.probe[a].set(0,0,0);for(var s=0,c=0,h=0,l=0,u=0,d=n.matrixWorldInverse,a=0,p=t.length;a<p;a++){var f,m,v=t[a],g=v.color,y=v.intensity,x=v.distance,b=v.shadow&&v.shadow.map?v.shadow.map.texture:null;if(v.isAmbientLight)i+=g.r*y,r+=g.g*y,o+=g.b*y;else if(v.isLightProbe)for(var w=0;w<9;w++)_.probe[w].addScaledVector(v.sh.coefficients[w],y);else v.isDirectionalLight?((m=M.get(v)).color.copy(v.color).multiplyScalar(v.intensity),m.direction.setFromMatrixPosition(v.matrixWorld),E.setFromMatrixPosition(v.target.matrixWorld),m.direction.sub(E),m.direction.transformDirection(d),m.shadow=v.castShadow,v.castShadow&&(f=v.shadow,m.shadowBias=f.bias,m.shadowRadius=f.radius,m.shadowMapSize=f.mapSize),_.directionalShadowMap[s]=b,_.directionalShadowMatrix[s]=v.shadow.matrix,_.directional[s]=m,s++):v.isSpotLight?((m=M.get(v)).position.setFromMatrixPosition(v.matrixWorld),m.position.applyMatrix4(d),m.color.copy(g).multiplyScalar(y),m.distance=x,m.direction.setFromMatrixPosition(v.matrixWorld),E.setFromMatrixPosition(v.target.matrixWorld),m.direction.sub(E),m.direction.transformDirection(d),m.coneCos=Math.cos(v.angle),m.penumbraCos=Math.cos(v.angle*(1-v.penumbra)),m.decay=v.decay,m.shadow=v.castShadow,v.castShadow&&(f=v.shadow,m.shadowBias=f.bias,m.shadowRadius=f.radius,m.shadowMapSize=f.mapSize),_.spotShadowMap[h]=b,_.spotShadowMatrix[h]=v.shadow.matrix,_.spot[h]=m,h++):v.isRectAreaLight?((m=M.get(v)).color.copy(g).multiplyScalar(y),m.position.setFromMatrixPosition(v.matrixWorld),m.position.applyMatrix4(d),S.identity(),A.copy(v.matrixWorld),A.premultiply(d),S.extractRotation(A),m.halfWidth.set(.5*v.width,0,0),m.halfHeight.set(0,.5*v.height,0),m.halfWidth.applyMatrix4(S),m.halfHeight.applyMatrix4(S),_.rectArea[l]=m,l++):v.isPointLight?((m=M.get(v)).position.setFromMatrixPosition(v.matrixWorld),m.position.applyMatrix4(d),m.color.copy(v.color).multiplyScalar(v.intensity),m.distance=v.distance,m.decay=v.decay,m.shadow=v.castShadow,v.castShadow&&(f=v.shadow,m.shadowBias=f.bias,m.shadowRadius=f.radius,m.shadowMapSize=f.mapSize,m.shadowCameraNear=f.camera.near,m.shadowCameraFar=f.camera.far),_.pointShadowMap[c]=b,_.pointShadowMatrix[c]=v.shadow.matrix,_.point[c]=m,c++):v.isHemisphereLight&&((m=M.get(v)).direction.setFromMatrixPosition(v.matrixWorld),m.direction.transformDirection(d),m.direction.normalize(),m.skyColor.copy(v.color).multiplyScalar(y),m.groundColor.copy(v.groundColor).multiplyScalar(y),_.hemi[u]=m,u++)}_.ambient[0]=i,_.ambient[1]=r,_.ambient[2]=o,_.directional.length=s,_.spot.length=h,_.rectArea.length=l,_.point.length=c,_.hemi.length=u,_.hash.stateID=_.id,_.hash.directionalLength=s,_.hash.pointLength=c,_.hash.spotLength=h,_.hash.rectAreaLength=l,_.hash.hemiLength=u,_.hash.shadowsLength=e.length},state:_}}function de(){var e=new ue,n=[],i=[];return{init:function(){n.length=0,i.length=0},state:{lightsArray:n,shadowsArray:i,lights:e},setupLights:function(t){e.setup(n,i,t)},pushLight:function(t){n.push(t)},pushShadow:function(t){i.push(t)}}}function pe(){function i(t){t=t.target;t.removeEventListener("dispose",i),delete r[t.id]}var r={};return{get:function(t,e){var n;return void 0===r[t.id]?(n=new de,r[t.id]={},r[t.id][e.id]=n,t.addEventListener("dispose",i)):void 0===r[t.id][e.id]?(n=new de,r[t.id][e.id]=n):n=r[t.id][e.id],n},dispose:function(){r={}}}}function fe(t){N.call(this),this.type="MeshDepthMaterial",this.depthPacking=ws,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.setValues(t)}function me(t){N.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Mt,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.lights=!1,this.setValues(t)}function ve(x,b,t){function w(t,e,n,i,r,o){var a,s,c=t.geometry,h=null,l=f,u=t.customDepthMaterial;return n&&(l=m,u=t.customDistanceMaterial),h=u||(u=!1,e.morphTargets&&(c&&c.isBufferGeometry?u=c.morphAttributes&&c.morphAttributes.position&&0<c.morphAttributes.position.length:c&&c.isGeometry&&(u=c.morphTargets&&0<c.morphTargets.length)),t.isSkinnedMesh&&!1===e.skinning&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t),s=t.isSkinnedMesh&&e.skinning,a=0,u&&(a|=d),s&&(a|=p),l[a]),x.localClippingEnabled&&!0===e.clipShadows&&0!==e.clippingPlanes.length&&(s=h.uuid,l=e.uuid,void 0===(a=v[s])&&(a={},v[s]=a),void 0===(s=a[l])&&(s=h.clone(),a[l]=s),h=s),h.visible=e.visible,h.wireframe=e.wireframe,h.side=null!=e.shadowSide?e.shadowSide:g[e.side],h.clipShadows=e.clipShadows,h.clippingPlanes=e.clippingPlanes,h.clipIntersection=e.clipIntersection,h.wireframeLinewidth=e.wireframeLinewidth,h.linewidth=e.linewidth,n&&h.isMeshDistanceMaterial&&(h.referencePosition.copy(i),h.nearDistance=r,h.farDistance=o),h}for(var M=new At,_=new St,E=new wt,A=new wt(t,t),S=new Mt,T=new Mt,d=1,p=2,e=1+(d|p),f=new Array(e),m=new Array(e),v={},g={0:go,1:vo,2:yo},L=[new Mt(1,0,0),new Mt(-1,0,0),new Mt(0,0,1),new Mt(0,0,-1),new Mt(0,1,0),new Mt(0,-1,0)],R=[new Mt(0,1,0),new Mt(0,1,0),new Mt(0,1,0),new Mt(0,1,0),new Mt(0,0,1),new Mt(0,0,-1)],C=[new _t,new _t,new _t,new _t,new _t,new _t],n=0;n!==e;++n){var i=0!=(n&d),r=0!=(n&p),o=new fe({depthPacking:Ms,morphTargets:i,skinning:r});f[n]=o;r=new me({morphTargets:i,skinning:r});m[n]=r}var P=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=fo,this.render=function(t,e,n){if(!1!==P.enabled&&(!1!==P.autoUpdate||!1!==P.needsUpdate)&&0!==t.length){var i=x.getRenderTarget(),r=x.getActiveCubeFace(),o=x.getActiveMipMapLevel(),a=x.state;a.setBlending(bo),a.buffers.color.setClear(1,1,1,1),a.buffers.depth.setTest(!0),a.setScissorTest(!1);for(var s,c=0,h=t.length;c<h;c++){var l=t[c],u=l.shadow,d=l&&l.isPointLight;if(void 0!==u){var p,f,m=u.camera;E.copy(u.mapSize),E.min(A),d&&(p=E.x,f=E.y,C[0].set(2*p,f,p,f),C[1].set(0,f,p,f),C[2].set(3*p,f,p,f),C[3].set(p,f,p,f),C[4].set(3*p,0,p,f),C[5].set(p,0,p,f),E.x*=4,E.y*=2),null===u.map&&(v={minFilter:ma,magFilter:ma,format:Na},u.map=new I(E.x,E.y,v),u.map.texture.name=l.name+".shadowMap",m.updateProjectionMatrix()),u.isSpotLightShadow&&u.update(l);var v=u.map,u=u.matrix;T.setFromMatrixPosition(l.matrixWorld),m.position.copy(T),d?(s=6,u.makeTranslation(-T.x,-T.y,-T.z)):(s=1,S.setFromMatrixPosition(l.target.matrixWorld),m.lookAt(S),m.updateMatrixWorld(),u.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),u.multiply(m.projectionMatrix),u.multiply(m.matrixWorldInverse)),x.setRenderTarget(v),x.clear();for(var g,y=0;y<s;y++)d&&(S.copy(m.position),S.add(L[y]),m.up.copy(R[y]),m.lookAt(S),m.updateMatrixWorld(),g=C[y],a.viewport(g)),_.multiplyMatrices(m.projectionMatrix,m.matrixWorldInverse),M.setFromMatrix(_),function t(e,n,i,r){if(!1!==e.visible){if(e.layers.test(n.layers)&&(e.isMesh||e.isLine||e.isPoints)&&e.castShadow&&(!e.frustumCulled||M.intersectsObject(e))){e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,e.matrixWorld);var o=b.update(e),a=e.material;if(Array.isArray(a))for(var s=o.groups,c=0,h=s.length;c<h;c++){var l,u=s[c],d=a[u.materialIndex];d&&d.visible&&(l=w(e,d,r,T,i.near,i.far),x.renderBufferDirect(i,null,o,l,e,u))}else a.visible&&(l=w(e,a,r,T,i.near,i.far),x.renderBufferDirect(i,null,o,l,e,null))}for(var p=e.children,f=0,m=p.length;f<m;f++)t(p[f],n,i,r)}}(e,n,m,d)}else console.warn("THREE.WebGLShadowMap:",l,"has no shadow.")}P.needsUpdate=!1,x.setRenderTarget(i,r,o)}}}function ge(l,n,c,i){function t(t,e,n){var i=new Uint8Array(4),r=l.createTexture();l.bindTexture(t,r),l.texParameteri(t,10241,9728),l.texParameteri(t,10240,9728);for(var o=0;o<n;o++)l.texImage2D(e+o,0,6408,1,1,0,6408,5121,i);return r}function e(t,e){g[t]=1,0===y[t]&&(l.enableVertexAttribArray(t),y[t]=1),x[t]!==e&&((i.isWebGL2?l:n.get("ANGLE_instanced_arrays"))[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](t,e),x[t]=e)}function u(t){!0!==b[t]&&(l.enable(t),b[t]=!0)}function d(t){!1!==b[t]&&(l.disable(t),b[t]=!1)}function r(t,e,n,i,r,o,a,s){if(t!==bo){if(_||(u(3042),_=!0),t===Ao)r=r||e,o=o||n,a=a||i,e===A&&r===L||(l.blendEquationSeparate(c.convert(e),c.convert(r)),A=e,L=r),n===S&&i===T&&o===R&&a===C||(l.blendFuncSeparate(c.convert(n),c.convert(i),c.convert(o),c.convert(a)),S=n,T=i,R=o,C=a),E=t,P=null;else if(t!==E||s!==P){if(A===So&&L===So||(l.blendEquation(32774),L=A=So),s)switch(t){case wo:l.blendFuncSeparate(1,771,1,771);break;case Mo:l.blendFunc(1,1);break;case _o:l.blendFuncSeparate(0,0,769,771);break;case Eo:l.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}else switch(t){case wo:l.blendFuncSeparate(770,771,1,771);break;case Mo:l.blendFunc(770,1);break;case _o:l.blendFunc(0,769);break;case Eo:l.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",t)}C=R=T=S=null,E=t,P=s}}else _&&(d(3042),_=!1)}function o(t){I!==t&&(t?l.frontFace(2304):l.frontFace(2305),I=t)}function a(t){t!==lo?(u(2884),t!==O&&(t===uo?l.cullFace(1029):t===po?l.cullFace(1028):l.cullFace(1032))):d(2884),O=t}function s(t,e,n){t?(u(32823),N===e&&z===n||(l.polygonOffset(e,n),N=e,z=n)):d(32823)}function h(t){void 0===t&&(t=33984+U-1),F!==t&&(l.activeTexture(t),F=t)}var p=new function(){var e=!1,o=new _t,n=null,a=new _t(0,0,0,0);return{setMask:function(t){n===t||e||(l.colorMask(t,t,t,t),n=t)},setLocked:function(t){e=t},setClear:function(t,e,n,i,r){!0===r&&(t*=i,e*=i,n*=i),o.set(t,e,n,i),!1===a.equals(o)&&(l.clearColor(t,e,n,i),a.copy(o))},reset:function(){e=!1,n=null,a.set(-1,0,0,0)}}},f=new function(){var e=!1,n=null,i=null,r=null;return{setTest:function(t){(t?u:d)(2929)},setMask:function(t){n===t||e||(l.depthMask(t),n=t)},setFunc:function(t){if(i!==t){if(t)switch(t){case Ho:l.depthFunc(512);break;case jo:l.depthFunc(519);break;case Vo:l.depthFunc(513);break;case Wo:l.depthFunc(515);break;case qo:l.depthFunc(514);break;case Xo:l.depthFunc(518);break;case Yo:l.depthFunc(516);break;case Zo:l.depthFunc(517);break;default:l.depthFunc(515)}else l.depthFunc(515);i=t}},setLocked:function(t){e=t},setClear:function(t){r!==t&&(l.clearDepth(t),r=t)},reset:function(){e=!1,r=i=n=null}}},m=new function(){var e=!1,n=null,i=null,r=null,o=null,a=null,s=null,c=null,h=null;return{setTest:function(t){(t?u:d)(2960)},setMask:function(t){n===t||e||(l.stencilMask(t),n=t)},setFunc:function(t,e,n){i===t&&r===e&&o===n||(l.stencilFunc(t,e,n),i=t,r=e,o=n)},setOp:function(t,e,n){a===t&&s===e&&c===n||(l.stencilOp(t,e,n),a=t,s=e,c=n)},setLocked:function(t){e=t},setClear:function(t){h!==t&&(l.clearStencil(t),h=t)},reset:function(){e=!1,h=c=s=a=o=r=i=n=null}}},v=l.getParameter(34921),g=new Uint8Array(v),y=new Uint8Array(v),x=new Uint8Array(v),b={},w=null,M=null,_=null,E=null,A=null,S=null,T=null,L=null,R=null,C=null,P=!1,I=null,O=null,D=null,N=null,z=null,U=l.getParameter(35661),B=!1,k=0,v=l.getParameter(7938);-1!==v.indexOf("WebGL")?(k=parseFloat(/^WebGL\ ([0-9])/.exec(v)[1]),B=1<=k):-1!==v.indexOf("OpenGL ES")&&(k=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(v)[1]),B=2<=k);var F=null,G={},H=new _t,j=new _t,V={};return V[3553]=t(3553,3553,1),V[34067]=t(34067,34069,6),p.setClear(0,0,0,1),f.setClear(1),m.setClear(0),u(2929),f.setFunc(Wo),o(!1),a(uo),u(2884),r(bo),{buffers:{color:p,depth:f,stencil:m},initAttributes:function(){for(var t=0,e=g.length;t<e;t++)g[t]=0},enableAttribute:function(t){e(t,0)},enableAttributeAndDivisor:e,disableUnusedAttributes:function(){for(var t=0,e=y.length;t!==e;++t)y[t]!==g[t]&&(l.disableVertexAttribArray(t),y[t]=0)},enable:u,disable:d,getCompressedTextureFormats:function(){if(null===w&&(w=[],n.get("WEBGL_compressed_texture_pvrtc")||n.get("WEBGL_compressed_texture_s3tc")||n.get("WEBGL_compressed_texture_etc1")||n.get("WEBGL_compressed_texture_astc")))for(var t=l.getParameter(34467),e=0;e<t.length;e++)w.push(t[e]);return w},useProgram:function(t){return M!==t&&(l.useProgram(t),M=t,!0)},setBlending:r,setMaterial:function(t,e){(t.side===yo?d:u)(2884);var n=t.side===go;e&&(n=!n),o(n),t.blending===wo&&!1===t.transparent?r(bo):r(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),f.setFunc(t.depthFunc),f.setTest(t.depthTest),f.setMask(t.depthWrite),p.setMask(t.colorWrite),s(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:o,setCullFace:a,setLineWidth:function(t){t!==D&&(B&&l.lineWidth(t),D=t)},setPolygonOffset:s,setScissorTest:function(t){(t?u:d)(3089)},activeTexture:h,bindTexture:function(t,e){null===F&&h();var n=G[F];void 0===n&&(n={type:void 0,texture:void 0},G[F]=n),n.type===t&&n.texture===e||(l.bindTexture(t,e||V[t]),n.type=t,n.texture=e)},compressedTexImage2D:function(){try{l.compressedTexImage2D.apply(l,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage2D:function(){try{l.texImage2D.apply(l,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},texImage3D:function(){try{l.texImage3D.apply(l,arguments)}catch(t){console.error("THREE.WebGLState:",t)}},scissor:function(t){!1===H.equals(t)&&(l.scissor(t.x,t.y,t.z,t.w),H.copy(t))},viewport:function(t){!1===j.equals(t)&&(l.viewport(t.x,t.y,t.z,t.w),j.copy(t))},reset:function(){for(var t=0;t<y.length;t++)1===y[t]&&(l.disableVertexAttribArray(t),y[t]=0);b={},G={},O=I=E=M=F=w=null,p.reset(),f.reset(),m.reset()}}}function ye(v,i,g,y,x,b,c){function o(t,e){return C?new OffscreenCanvas(t,e):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function w(t,e,n,i){var r=1;if((t.width>i||t.height>i)&&(r=i/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){i=e?As.floorPowerOfTwo:Math.floor,e=i(r*t.width),r=i(r*t.height);void 0===L&&(L=o(e,r));n=n?o(e,r):L;return n.width=e,n.height=r,n.getContext("2d").drawImage(t,0,0,e,r),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+e+"x"+r+")."),n}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function M(t){return As.isPowerOfTwo(t.width)&&As.isPowerOfTwo(t.height)}function _(t,e){return t.generateMipmaps&&e&&t.minFilter!==ma&&t.minFilter!==ya}function E(t,e,n,i){v.generateMipmap(t),y.get(e).__maxMipLevel=Math.log(Math.max(n,i))*Math.LOG2E}function A(t,e){if(!x.isWebGL2)return t;var n=t;return 6403===t&&(5126===e&&(n=33326),5131===e&&(n=33325),5121===e&&(n=33321)),6407===t&&(5126===e&&(n=34837),5131===e&&(n=34843),5121===e&&(n=32849)),6408===t&&(5126===e&&(n=34836),5131===e&&(n=34842),5121===e&&(n=32856)),33325===n||33326===n||34842===n||34836===n?i.get("EXT_color_buffer_float"):34843!==n&&34837!==n||console.warn("THREE.WebGLRenderer: Floating point textures with RGB format not supported. Please use RGBA instead."),n}function r(t){return t===ma||t===va||t===ga?9728:9729}function a(t){var e,n=t.target;n.removeEventListener("dispose",a),e=n,void 0!==(t=y.get(e)).__webglInit&&(v.deleteTexture(t.__webglTexture),y.remove(e)),n.isVideoTexture&&delete R[n.id],c.memory.textures--}function h(t){t=t.target;t.removeEventListener("dispose",h),function(t){var e=y.get(t),n=y.get(t.texture);if(t){if(void 0!==n.__webglTexture&&v.deleteTexture(n.__webglTexture),t.depthTexture&&t.depthTexture.dispose(),t.isWebGLRenderTargetCube)for(var i=0;i<6;i++)v.deleteFramebuffer(e.__webglFramebuffer[i]),e.__webglDepthbuffer&&v.deleteRenderbuffer(e.__webglDepthbuffer[i]);else v.deleteFramebuffer(e.__webglFramebuffer),e.__webglDepthbuffer&&v.deleteRenderbuffer(e.__webglDepthbuffer);y.remove(t.texture),y.remove(t)}}(t),c.memory.textures--}function s(t,e){var n,i,r=y.get(t);if(t.isVideoTexture&&(n=(o=t).id,i=c.render.frame,R[n]!==i&&(R[n]=i,o.update())),0<t.version&&r.__version!==t.version){var o=t.image;if(void 0===o)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==o.complete)return void u(r,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}g.activeTexture(33984+e),g.bindTexture(3553,r.__webglTexture)}function n(t,e){var n=y.get(t);if(6===t.image.length)if(0<t.version&&n.__version!==t.version){T(n,t),g.activeTexture(33984+e),g.bindTexture(34067,n.__webglTexture),v.pixelStorei(37440,t.flipY);for(var i=t&&t.isCompressedTexture,r=t.image[0]&&t.image[0].isDataTexture,o=[],a=0;a<6;a++)o[a]=i||r?r?t.image[a].image:t.image[a]:w(t.image[a],!1,!0,x.maxCubemapSize);var s=o[0],c=M(s)||x.isWebGL2,h=b.convert(t.format),l=b.convert(t.type),u=A(h,l);S(34067,t,c);for(a=0;a<6;a++)if(i)for(var d,p=o[a].mipmaps,f=0,m=p.length;f<m;f++)d=p[f],t.format!==Na&&t.format!==Da?-1<g.getCompressedTextureFormats().indexOf(h)?g.compressedTexImage2D(34069+a,f,u,d.width,d.height,0,d.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):g.texImage2D(34069+a,f,u,d.width,d.height,0,h,l,d.data);else r?g.texImage2D(34069+a,0,u,o[a].width,o[a].height,0,h,l,o[a].data):g.texImage2D(34069+a,0,u,h,l,o[a]);n.__maxMipLevel=i?p.length-1:0,_(t,c)&&E(34067,t,s.width,s.height),n.__version=t.version,t.onUpdate&&t.onUpdate(t)}else g.activeTexture(33984+e),g.bindTexture(34067,n.__webglTexture)}function l(t,e){g.activeTexture(33984+e),g.bindTexture(34067,y.get(t).__webglTexture)}function S(t,e,n){n?(v.texParameteri(t,10242,b.convert(e.wrapS)),v.texParameteri(t,10243,b.convert(e.wrapT)),32879!==t&&35866!==t||v.texParameteri(t,32882,b.convert(e.wrapR)),v.texParameteri(t,10240,b.convert(e.magFilter)),v.texParameteri(t,10241,b.convert(e.minFilter))):(v.texParameteri(t,10242,33071),v.texParameteri(t,10243,33071),32879!==t&&35866!==t||v.texParameteri(t,32882,33071),e.wrapS===pa&&e.wrapT===pa||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),v.texParameteri(t,10240,r(e.magFilter)),v.texParameteri(t,10241,r(e.minFilter)),e.minFilter!==ma&&e.minFilter!==ya&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),(n=i.get("EXT_texture_filter_anisotropic"))&&(e.type===Ta&&null===i.get("OES_texture_float_linear")||e.type===La&&null===(x.isWebGL2||i.get("OES_texture_half_float_linear"))||(1<e.anisotropy||y.get(e).__currentAnisotropy)&&(v.texParameterf(t,n.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(e.anisotropy,x.getMaxAnisotropy())),y.get(e).__currentAnisotropy=e.anisotropy))}function T(t,e){void 0===t.__webglInit&&(t.__webglInit=!0,e.addEventListener("dispose",a),t.__webglTexture=v.createTexture(),c.memory.textures++)}function u(t,e,n){var i=3553;e.isDataTexture2DArray&&(i=35866),e.isDataTexture3D&&(i=32879),T(t,e),g.activeTexture(33984+n),g.bindTexture(i,t.__webglTexture),v.pixelStorei(37440,e.flipY),v.pixelStorei(37441,e.premultiplyAlpha),v.pixelStorei(3317,e.unpackAlignment);var r,n=(r=e,!x.isWebGL2&&(r.wrapS!==pa||r.wrapT!==pa||r.minFilter!==ma&&r.minFilter!==ya)&&!1===M(e.image)),r=w(e.image,n,!1,x.maxTextureSize),n=M(r)||x.isWebGL2,o=b.convert(e.format),a=b.convert(e.type),s=A(o,a);S(i,e,n);var c,h=e.mipmaps;if(e.isDepthTexture){if(s=6402,e.type===Ta){if(!x.isWebGL2)throw new Error("Float Depth Texture only supported in WebGL2.0");s=36012}else x.isWebGL2&&(s=33189);e.format===Ba&&6402===s&&e.type!==Ea&&e.type!==Sa&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),e.type=Ea,a=b.convert(e.type)),e.format===ka&&(s=34041,e.type!==Ia&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),e.type=Ia,a=b.convert(e.type))),g.texImage2D(3553,0,s,r.width,r.height,0,o,a,null)}else if(e.isDataTexture)if(0<h.length&&n){for(var l=0,u=h.length;l<u;l++)c=h[l],g.texImage2D(3553,l,s,c.width,c.height,0,o,a,c.data);e.generateMipmaps=!1,t.__maxMipLevel=h.length-1}else g.texImage2D(3553,0,s,r.width,r.height,0,o,a,r.data),t.__maxMipLevel=0;else if(e.isCompressedTexture){for(l=0,u=h.length;l<u;l++)c=h[l],e.format!==Na&&e.format!==Da?-1<g.getCompressedTextureFormats().indexOf(o)?g.compressedTexImage2D(3553,l,s,c.width,c.height,0,c.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):g.texImage2D(3553,l,s,c.width,c.height,0,o,a,c.data);t.__maxMipLevel=h.length-1}else if(e.isDataTexture2DArray)g.texImage3D(35866,0,s,r.width,r.height,r.depth,0,o,a,r.data),t.__maxMipLevel=0;else if(e.isDataTexture3D)g.texImage3D(32879,0,s,r.width,r.height,r.depth,0,o,a,r.data),t.__maxMipLevel=0;else if(0<h.length&&n){for(l=0,u=h.length;l<u;l++)c=h[l],g.texImage2D(3553,l,s,o,a,c);e.generateMipmaps=!1,t.__maxMipLevel=h.length-1}else g.texImage2D(3553,0,s,o,a,r),t.__maxMipLevel=0;_(e,n)&&E(3553,e,r.width,r.height),t.__version=e.version,e.onUpdate&&e.onUpdate(e)}function d(t,e,n,i){var r=b.convert(e.texture.format),o=b.convert(e.texture.type),a=A(r,o);g.texImage2D(i,0,a,e.width,e.height,0,r,o,null),v.bindFramebuffer(36160,t),v.framebufferTexture2D(36160,n,i,y.get(e.texture).__webglTexture,0),v.bindFramebuffer(36160,null)}function p(t,e,n){var i;v.bindRenderbuffer(36161,t),e.depthBuffer&&!e.stencilBuffer?(n?(i=m(e),v.renderbufferStorageMultisample(36161,i,33189,e.width,e.height)):v.renderbufferStorage(36161,33189,e.width,e.height),v.framebufferRenderbuffer(36160,36096,36161,t)):e.depthBuffer&&e.stencilBuffer?(n?(i=m(e),v.renderbufferStorageMultisample(36161,i,34041,e.width,e.height)):v.renderbufferStorage(36161,34041,e.width,e.height),v.framebufferRenderbuffer(36160,33306,36161,t)):(t=A(b.convert(e.texture.format),b.convert(e.texture.type)),n?(i=m(e),v.renderbufferStorageMultisample(36161,i,t,e.width,e.height)):v.renderbufferStorage(36161,t,e.width,e.height)),v.bindRenderbuffer(36161,null)}function f(t){var e=y.get(t),n=!0===t.isWebGLRenderTargetCube;if(t.depthTexture){if(n)throw new Error("target.depthTexture not supported in Cube render targets");!function(t,e){if(e&&e.isWebGLRenderTargetCube)throw new Error("Depth Texture with cube render targets is not supported");if(v.bindFramebuffer(36160,t),!e.depthTexture||!e.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");if(y.get(e.depthTexture).__webglTexture&&e.depthTexture.image.width===e.width&&e.depthTexture.image.height===e.height||(e.depthTexture.image.width=e.width,e.depthTexture.image.height=e.height,e.depthTexture.needsUpdate=!0),s(e.depthTexture,0),t=y.get(e.depthTexture).__webglTexture,e.depthTexture.format===Ba)v.framebufferTexture2D(36160,36096,3553,t,0);else{if(e.depthTexture.format!==ka)throw new Error("Unknown depthTexture format");v.framebufferTexture2D(36160,33306,3553,t,0)}}(e.__webglFramebuffer,t)}else if(n){e.__webglDepthbuffer=[];for(var i=0;i<6;i++)v.bindFramebuffer(36160,e.__webglFramebuffer[i]),e.__webglDepthbuffer[i]=v.createRenderbuffer(),p(e.__webglDepthbuffer[i],t)}else v.bindFramebuffer(36160,e.__webglFramebuffer),e.__webglDepthbuffer=v.createRenderbuffer(),p(e.__webglDepthbuffer,t);v.bindFramebuffer(36160,null)}function m(t){return x.isWebGL2&&t.isWebGLMultisampleRenderTarget?Math.min(x.maxSamples,t.samples):0}var L,R={},C="undefined"!=typeof OffscreenCanvas,e=0,P=!1,I=!1;this.allocateTextureUnit=function(){var t=e;return t>=x.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+x.maxTextures),e+=1,t},this.resetTextureUnits=function(){e=0},this.setTexture2D=s,this.setTexture2DArray=function(t,e){var n=y.get(t);0<t.version&&n.__version!==t.version?u(n,t,e):(g.activeTexture(33984+e),g.bindTexture(35866,n.__webglTexture))},this.setTexture3D=function(t,e){var n=y.get(t);0<t.version&&n.__version!==t.version?u(n,t,e):(g.activeTexture(33984+e),g.bindTexture(32879,n.__webglTexture))},this.setTextureCube=n,this.setTextureCubeDynamic=l,this.setupRenderTarget=function(t){var e=y.get(t),n=y.get(t.texture);t.addEventListener("dispose",h),n.__webglTexture=v.createTexture(),c.memory.textures++;var i,r=!0===t.isWebGLRenderTargetCube,o=!0===t.isWebGLMultisampleRenderTarget,a=M(t)||x.isWebGL2;if(r){e.__webglFramebuffer=[];for(var s=0;s<6;s++)e.__webglFramebuffer[s]=v.createFramebuffer()}else e.__webglFramebuffer=v.createFramebuffer(),o&&(x.isWebGL2?(e.__webglMultisampledFramebuffer=v.createFramebuffer(),e.__webglColorRenderbuffer=v.createRenderbuffer(),v.bindRenderbuffer(36161,e.__webglColorRenderbuffer),i=A(b.convert(t.texture.format),b.convert(t.texture.type)),o=m(t),v.renderbufferStorageMultisample(36161,o,i,t.width,t.height),v.bindFramebuffer(36160,e.__webglMultisampledFramebuffer),v.framebufferRenderbuffer(36160,36064,36161,e.__webglColorRenderbuffer),v.bindRenderbuffer(36161,null),t.depthBuffer&&(e.__webglDepthRenderbuffer=v.createRenderbuffer(),p(e.__webglDepthRenderbuffer,t,!0)),v.bindFramebuffer(36160,null)):console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2."));if(r){g.bindTexture(34067,n.__webglTexture),S(34067,t.texture,a);for(s=0;s<6;s++)d(e.__webglFramebuffer[s],t,36064,34069+s);_(t.texture,a)&&E(34067,t.texture,t.width,t.height),g.bindTexture(34067,null)}else g.bindTexture(3553,n.__webglTexture),S(3553,t.texture,a),d(e.__webglFramebuffer,t,36064,3553),_(t.texture,a)&&E(3553,t.texture,t.width,t.height),g.bindTexture(3553,null);t.depthBuffer&&f(t)},this.updateRenderTargetMipmap=function(t){var e,n,i=t.texture;_(i,M(t)||x.isWebGL2)&&(e=t.isWebGLRenderTargetCube?34067:3553,n=y.get(i).__webglTexture,g.bindTexture(e,n),E(e,i,t.width,t.height),g.bindTexture(e,null))},this.updateMultisampleRenderTarget=function(t){var e,n,i;t.isWebGLMultisampleRenderTarget&&(x.isWebGL2?(i=y.get(t),v.bindFramebuffer(36008,i.__webglMultisampledFramebuffer),v.bindFramebuffer(36009,i.__webglFramebuffer),e=t.width,n=t.height,i=16384,t.depthBuffer&&(i|=256),t.stencilBuffer&&(i|=1024),v.blitFramebuffer(0,0,e,n,0,0,e,n,i,9728)):console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2."))},this.safeSetTexture2D=function(t,e){t&&t.isWebGLRenderTarget&&(!1===P&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),P=!0),t=t.texture),s(t,e)},this.safeSetTextureCube=function(t,e){t&&t.isWebGLRenderTargetCube&&(!1===I&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),I=!0),t=t.texture),(t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?n:l)(t,e)}}function xe(t,n,i){return{convert:function(t){var e;if(t===da)return 10497;if(t===pa)return 33071;if(t===fa)return 33648;if(t===ma)return 9728;if(t===va)return 9984;if(t===ga)return 9986;if(t===ya)return 9729;if(t===xa)return 9985;if(t===ba)return 9987;if(t===wa)return 5121;if(t===Ra)return 32819;if(t===Ca)return 32820;if(t===Pa)return 33635;if(t===Ma)return 5120;if(t===_a)return 5122;if(t===Ea)return 5123;if(t===Aa)return 5124;if(t===Sa)return 5125;if(t===Ta)return 5126;if(t===La){if(i.isWebGL2)return 5131;if(null!==(e=n.get("OES_texture_half_float")))return e.HALF_FLOAT_OES}if(t===Oa)return 6406;if(t===Da)return 6407;if(t===Na)return 6408;if(t===za)return 6409;if(t===Ua)return 6410;if(t===Ba)return 6402;if(t===ka)return 34041;if(t===Fa)return 6403;if(t===So)return 32774;if(t===To)return 32778;if(t===Lo)return 32779;if(t===Po)return 0;if(t===Io)return 1;if(t===Oo)return 768;if(t===Do)return 769;if(t===No)return 770;if(t===zo)return 771;if(t===Uo)return 772;if(t===Bo)return 773;if(t===ko)return 774;if(t===Fo)return 775;if(t===Go)return 776;if((t===Ga||t===Ha||t===ja||t===Va)&&null!==(e=n.get("WEBGL_compressed_texture_s3tc"))){if(t===Ga)return e.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===Ha)return e.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===ja)return e.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===Va)return e.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((t===Wa||t===qa||t===Xa||t===Ya)&&null!==(e=n.get("WEBGL_compressed_texture_pvrtc"))){if(t===Wa)return e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===qa)return e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===Xa)return e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===Ya)return e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t===Za&&null!==(e=n.get("WEBGL_compressed_texture_etc1")))return e.COMPRESSED_RGB_ETC1_WEBGL;if((t===Ja||t===Qa||t===Ka||t===$a||t===ts||t===es||t===ns||t===is||t===rs||t===os||t===as||t===ss||t===cs||t===hs)&&null!==(e=n.get("WEBGL_compressed_texture_astc")))return t;if(t===Ro||t===Co){if(i.isWebGL2){if(t===Ro)return 32775;if(t===Co)return 32776}if(null!==(e=n.get("EXT_blend_minmax"))){if(t===Ro)return e.MIN_EXT;if(t===Co)return e.MAX_EXT}}if(t===Ia){if(i.isWebGL2)return 34042;if(null!==(e=n.get("WEBGL_depth_texture")))return e.UNSIGNED_INT_24_8_WEBGL}return 0}}}function be(){f.call(this),this.type="Group"}function we(){f.call(this),this.type="Camera",this.matrixWorldInverse=new St,this.projectionMatrix=new St,this.projectionMatrixInverse=new St}function Me(t,e,n,i){we.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==i?i:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function _e(t){Me.call(this),this.cameras=t||[]}function Ee(t,e,n){Jl.setFromMatrixPosition(e.matrixWorld),Ql.setFromMatrixPosition(n.matrixWorld);var i=Jl.distanceTo(Ql),r=e.projectionMatrix.elements,o=n.projectionMatrix.elements,a=r[14]/(r[10]-1),s=r[14]/(r[10]+1),c=(r[9]+1)/r[5],h=(r[9]-1)/r[5],l=(r[8]-1)/r[0],n=(o[8]+1)/o[0],r=a*l,o=a*n,n=i/(n-l),l=n*-l;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(l),t.translateZ(n),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);a+=n,n=s+n,r-=l,o=i-l+o,c=c*s/n*a,s=h*s/n*a;t.projectionMatrix.makePerspective(r,o,c,s,a,n)}function Ae(e){function i(){return null!==c&&!0===c.isPresenting}function t(){var t;i()?(t=c.getEyeParameters("left"),n=2*t.renderWidth*f,a=t.renderHeight*f,M=e.getPixelRatio(),e.getSize(_),e.setDrawingBufferSize(n,a,1),x.viewport.set(0,0,n/2,a),b.viewport.set(n/2,0,n/2,a),A.start()):(s.enabled&&e.setDrawingBufferSize(_.width,_.height,M),A.stop())}function r(){for(var t=0;t<u.length;t++){var e=u[t],n=function(t){for(var e=navigator.getGamepads&&navigator.getGamepads(),n=0,i=0,r=e.length;n<r;n++){var o=e[n];if(o&&("Daydream Controller"===o.id||"Gear VR Controller"===o.id||"Oculus Go Controller"===o.id||"OpenVR Gamepad"===o.id||o.id.startsWith("Oculus Touch")||o.id.startsWith("Spatial Controller"))){if(i===t)return o;i++}}}(t);if(void 0!==n&&void 0!==n.pose){if(null===n.pose)return;var i=n.pose;!1===i.hasPosition&&e.position.set(.2,-.6,-.05),null!==i.position&&e.position.fromArray(i.position),null!==i.orientation&&e.quaternion.fromArray(i.orientation),e.matrix.compose(e.position,e.quaternion,e.scale),e.matrix.premultiply(d),e.matrix.decompose(e.position,e.quaternion,e.scale),e.matrixWorldNeedsUpdate=!0,e.visible=!0;i="Daydream Controller"===n.id?0:1;void 0===E[t]&&(E[t]=!1),E[t]!==n.buttons[i].pressed&&(E[t]=n.buttons[i].pressed,!0===E[t]?e.dispatchEvent({type:"selectstart"}):(e.dispatchEvent({type:"selectend"}),e.dispatchEvent({type:"select"})))}else e.visible=!1}}function o(t,e){null!==e&&4===e.length&&t.set(e[0]*n,e[1]*a,e[2]*n,e[3]*a)}var n,a,s=this,c=null,h=null,l=null,u=[],d=new St,p=new St,f=1,m="local-floor";"undefined"!=typeof window&&"VRFrameData"in window&&(h=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",t,!1));var v=new St,g=new S,y=new Mt,x=new Me;x.viewport=new _t,x.layers.enable(1);var b=new Me;b.viewport=new _t,b.layers.enable(2);var w=new _e([x,b]);w.layers.enable(1),w.layers.enable(2);var M,_=new wt,E=[];this.enabled=!1,this.getController=function(t){var e=u[t];return void 0===e&&((e=new be).matrixAutoUpdate=!1,e.visible=!1,u[t]=e),e},this.getDevice=function(){return c},this.setDevice=function(t){void 0!==t&&(c=t),A.setContext(t)},this.setFramebufferScaleFactor=function(t){f=t},this.setReferenceSpaceType=function(t){m=t},this.setPoseTarget=function(t){void 0!==t&&(l=t)},this.getCamera=function(t){var e="local-floor"===m?1.6:0;if(!1===i())return t.position.set(0,e,0),t.rotation.set(0,0,0),t;c.depthNear=t.near,c.depthFar=t.far,c.getFrameData(h),"local-floor"===m&&((n=c.stageParameters)?d.fromArray(n.sittingToStandingTransform):d.makeTranslation(0,e,0));var n=h.pose,e=null!==l?l:t;e.matrix.copy(d),e.matrix.decompose(e.position,e.quaternion,e.scale),null!==n.orientation&&(g.fromArray(n.orientation),e.quaternion.multiply(g)),null!==n.position&&(g.setFromRotationMatrix(d),y.fromArray(n.position),y.applyQuaternion(g),e.position.add(y)),e.updateMatrixWorld(),x.near=t.near,b.near=t.near,x.far=t.far,b.far=t.far,x.matrixWorldInverse.fromArray(h.leftViewMatrix),b.matrixWorldInverse.fromArray(h.rightViewMatrix),p.getInverse(d),"local-floor"===m&&(x.matrixWorldInverse.multiply(p),b.matrixWorldInverse.multiply(p));e=e.parent;null!==e&&(v.getInverse(e.matrixWorld),x.matrixWorldInverse.multiply(v),b.matrixWorldInverse.multiply(v)),x.matrixWorld.getInverse(x.matrixWorldInverse),b.matrixWorld.getInverse(b.matrixWorldInverse),x.projectionMatrix.fromArray(h.leftProjectionMatrix),b.projectionMatrix.fromArray(h.rightProjectionMatrix),Ee(w,x,b);e=c.getLayers();return e.length&&(e=e[0],o(x.viewport,e.leftBounds),o(b.viewport,e.rightBounds)),r(),w},this.getStandingMatrix=function(){return d},this.isPresenting=i;var A=new Lt;this.setAnimationLoop=function(t){A.setAnimationLoop(t),i()&&A.start()},this.submitFrame=function(){i()&&c.submitFrame()},this.dispose=function(){"undefined"!=typeof window&&window.removeEventListener("vrdisplaypresentchange",t)},this.setFrameOfReferenceType=function(){console.warn("THREE.WebVRManager: setFrameOfReferenceType() has been deprecated.")}}function Se(u){function a(){return null!==d&&null!==p}function e(t){for(var e=0;e<m.length;e++)v[e]===t.inputSource&&m[e].dispatchEvent({type:t.type})}function n(){u.setFramebuffer(null),u.setRenderTarget(u.getRenderTarget()),l.stop()}function i(t){p=t,l.setContext(d),l.start()}function s(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)}var r=u.context,d=null,p=null,o="local-floor",f=null,m=[],v=[],c=new Me;c.layers.enable(1),c.viewport=new _t;var h=new Me;h.layers.enable(2),h.viewport=new _t;var g=new _e([c,h]);g.layers.enable(1),g.layers.enable(2),this.enabled=!1,this.getController=function(t){var e=m[t];return void 0===e&&((e=new be).matrixAutoUpdate=!1,e.visible=!1,m[t]=e),e},this.setFramebufferScaleFactor=function(t){},this.setReferenceSpaceType=function(t){o=t},this.getSession=function(){return d},this.setSession=function(t){null!==(d=t)&&(d.addEventListener("select",e),d.addEventListener("selectstart",e),d.addEventListener("selectend",e),d.addEventListener("end",n),d.updateRenderState({baseLayer:new XRWebGLLayer(d,r)}),d.requestReferenceSpace(o).then(i),v=d.inputSources,d.addEventListener("inputsourceschange",function(){v=d.inputSources,console.log(v);for(var t=0;t<m.length;t++)m[t].userData.inputSource=v[t]}))},this.getCamera=function(t){if(a()){var e=t.parent,n=g.cameras;s(g,e);for(var i=0;i<n.length;i++)s(n[i],e);t.matrixWorld.copy(g.matrixWorld);for(var r=t.children,i=0,o=r.length;i<o;i++)r[i].updateMatrixWorld(!0);return Ee(g,c,h),g}return t},this.isPresenting=a;var y=null,l=new Lt;l.setAnimationLoop(function(t,e){if(null!==(f=e.getViewerPose(p))){var n=f.views,i=d.renderState.baseLayer;u.setFramebuffer(i.framebuffer);for(var r=0;r<n.length;r++){var o=n[r],a=i.getViewport(o),s=o.transform.inverse.matrix,c=g.cameras[r];c.matrix.fromArray(s).getInverse(c.matrix),c.projectionMatrix.fromArray(o.projectionMatrix),c.viewport.set(a.x,a.y,a.width,a.height),0===r&&g.matrix.copy(c.matrix)}}for(r=0;r<m.length;r++){var h=m[r],l=v[r];if(l){l=e.getPose(l.targetRaySpace,p);if(null!==l){h.matrix.fromArray(l.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale),h.visible=!0;continue}}h.visible=!1}y&&y(t)}),this.setAnimationLoop=function(t){y=t},this.dispose=function(){},this.getStandingMatrix=function(){return console.warn("THREE.WebXRManager: getStandingMatrix() is no longer needed."),new St},this.getDevice=function(){console.warn("THREE.WebXRManager: getDevice() has been deprecated.")},this.setDevice=function(){console.warn("THREE.WebXRManager: setDevice() has been deprecated.")},this.setFrameOfReferenceType=function(){console.warn("THREE.WebXRManager: setFrameOfReferenceType() has been deprecated.")},this.submitFrame=function(){}}function Te(t){function u(){return null===Z?at:1}function e(){w=new Dt(R),(C=new It(R,w,t)).isWebGL2||(w.get("WEBGL_depth_texture"),w.get("OES_texture_float"),w.get("OES_texture_half_float"),w.get("OES_texture_half_float_linear"),w.get("OES_standard_derivatives"),w.get("OES_element_index_uint"),w.get("ANGLE_instanced_arrays")),w.get("OES_texture_float_linear"),j=new xe(0,w,C),(P=new ge(R,w,j,C)).scissor(nt.copy(ct).multiplyScalar(at)),P.viewport(et.copy(st).multiplyScalar(at)),M=new Ut,I=new oe,O=new ye(R,w,P,I,C,j,M),_=new Rt(R),D=new Nt(0,_,M),N=new kt(D,M),F=new Bt(R),z=new re(V,w,C,O),U=new he,B=new pe,k=new Ct(V,P,N,v),G=new Pt(R,w,M,C),H=new zt(R,w,M,C),M.programs=z.programs,V.context=R,V.capabilities=C,V.extensions=w,V.properties=I,V.renderLists=U,V.state=P,V.info=M}function n(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),W=!0}function i(){console.log("THREE.WebGLRenderer: Context Restored."),W=!1,e()}function d(t){t=t.target;t.removeEventListener("dispose",d),p(t=t),I.remove(t)}function p(t){var e=I.get(t).program;(t.program=void 0)!==e&&z.releaseProgram(e)}function o(t,e,n,i){for(var r=0,o=t.length;r<o;r++){var a=t[r],s=a.object,c=a.geometry,h=void 0===i?a.material:i,l=a.group;if(n.isArrayCamera)for(var u=(tt=n).cameras,d=0,p=u.length;d<p;d++){var f=u[d];s.layers.test(f.layers)&&(P.viewport(et.copy(f.viewport)),L.setupLights(f),m(s,e,f,c,h,l))}else tt=null,m(s,e,n,c,h,l)}}function m(t,e,n,i,r,o){var a,s;t.onBeforeRender(V,e,n,i,r,o),L=B.get(e,tt||n),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject?(P.setMaterial(r),a=f(n,e.fog,r,t),K.geometry=null,K.program=null,K.wireframe=!1,s=a,t.render(function(t){V.renderBufferImmediate(t,s)})):V.renderBufferDirect(n,e.fog,i,r,t,o),t.onAfterRender(V,e,n,i,r,o),L=B.get(e,tt||n)}function E(t,e,n){var i=I.get(t),r=L.state.lights,o=L.state.shadowsArray,a=i.lightsHash,s=r.state.hash,c=z.getParameters(t,r.state,o,e,ut.numPlanes,ut.numIntersection,n),h=z.getProgramCode(t,c),o=i.program,n=!0;if(void 0===o)t.addEventListener("dispose",d);else if(o.code!==h)p(t);else if(a.stateID!==s.stateID||a.directionalLength!==s.directionalLength||a.pointLength!==s.pointLength||a.spotLength!==s.spotLength||a.rectAreaLength!==s.rectAreaLength||a.hemiLength!==s.hemiLength||a.shadowsLength!==s.shadowsLength)a.stateID=s.stateID,a.directionalLength=s.directionalLength,a.pointLength=s.pointLength,a.spotLength=s.spotLength,a.rectAreaLength=s.rectAreaLength,a.hemiLength=s.hemiLength,a.shadowsLength=s.shadowsLength,n=!1;else{if(void 0!==c.shaderID)return;n=!1}n&&(c.shaderID?(n=Tc[c.shaderID],i.shader={name:t.type,uniforms:Tt(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader}):i.shader={name:t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader},t.onBeforeCompile(i.shader,V),h=z.getProgramCode(t,c),o=z.acquireProgram(t,i.shader,c,h),i.program=o,t.program=o);var l=o.getAttributes();if(t.morphTargets)for(var u=t.numSupportedMorphTargets=0;u<V.maxMorphTargets;u++)0<=l["morphTarget"+u]&&t.numSupportedMorphTargets++;if(t.morphNormals)for(u=t.numSupportedMorphNormals=0;u<V.maxMorphNormals;u++)0<=l["morphNormal"+u]&&t.numSupportedMorphNormals++;o=i.shader.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(i.numClippingPlanes=ut.numPlanes,i.numIntersection=ut.numIntersection,o.clippingPlanes=ut.uniform),i.fog=e,void 0===a&&(i.lightsHash=a={}),a.stateID=s.stateID,a.directionalLength=s.directionalLength,a.pointLength=s.pointLength,a.spotLength=s.spotLength,a.rectAreaLength=s.rectAreaLength,a.hemiLength=s.hemiLength,a.shadowsLength=s.shadowsLength,t.lights&&(o.ambientLightColor.value=r.state.ambient,o.lightProbe.value=r.state.probe,o.directionalLights.value=r.state.directional,o.spotLights.value=r.state.spot,o.rectAreaLights.value=r.state.rectArea,o.pointLights.value=r.state.point,o.hemisphereLights.value=r.state.hemi,o.directionalShadowMap.value=r.state.directionalShadowMap,o.directionalShadowMatrix.value=r.state.directionalShadowMatrix,o.spotShadowMap.value=r.state.spotShadowMap,o.spotShadowMatrix.value=r.state.spotShadowMatrix,o.pointShadowMap.value=r.state.pointShadowMap,o.pointShadowMatrix.value=r.state.pointShadowMatrix);r=i.program.getUniforms(),o=Yt.seqWithValue(r.seq,o);i.uniformsList=o}function f(t,e,n,i){O.resetTextureUnits();var r=I.get(n),o=L.state.lights,a=r.lightsHash,s=o.state.hash;dt&&(pt||t!==$)&&(_=t===$&&n.id===Q,ut.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,t,r,_)),!1!==n.needsUpdate||(void 0===r.program||n.fog&&r.fog!==e||n.lights&&(a.stateID!==s.stateID||a.directionalLength!==s.directionalLength||a.pointLength!==s.pointLength||a.spotLength!==s.spotLength||a.rectAreaLength!==s.rectAreaLength||a.hemiLength!==s.hemiLength||a.shadowsLength!==s.shadowsLength)||void 0!==r.numClippingPlanes&&(r.numClippingPlanes!==ut.numPlanes||r.numIntersection!==ut.numIntersection))&&(n.needsUpdate=!0),n.needsUpdate&&(E(n,e,i),n.needsUpdate=!1);var c,h,l,u,d,p,f,m,v,g,y,x,b=!1,w=!1,M=!1,o=r.program,_=o.getUniforms(),a=r.shader.uniforms;return P.useProgram(o.program)&&(M=w=b=!0),n.id!==Q&&(Q=n.id,w=!0),!b&&$===t||(_.setValue(R,"projectionMatrix",t.projectionMatrix),C.logarithmicDepthBuffer&&_.setValue(R,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),$!==t&&($=t,M=w=!0),(n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshStandardMaterial||n.envMap)&&void 0!==(c=_.map.cameraPosition)&&c.setValue(R,mt.setFromMatrixPosition(t.matrixWorld)),(n.isMeshPhongMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.skinning)&&_.setValue(R,"viewMatrix",t.matrixWorldInverse)),n.skinning&&(_.setOptional(R,i,"bindMatrix"),_.setOptional(R,i,"bindMatrixInverse"),(s=i.skeleton)&&(b=s.bones,C.floatVertexTextures?(void 0===s.boneTexture&&(c=Math.sqrt(4*b.length),c=As.ceilPowerOfTwo(c),c=Math.max(c,4),(t=new Float32Array(c*c*4)).set(s.boneMatrices),(b=new Et(t,c,c,Na,Ta)).needsUpdate=!0,s.boneMatrices=t,s.boneTexture=b,s.boneTextureSize=c),_.setValue(R,"boneTexture",s.boneTexture,O),_.setValue(R,"boneTextureSize",s.boneTextureSize)):_.setOptional(R,s,"boneMatrices"))),w&&(_.setValue(R,"toneMappingExposure",V.toneMappingExposure),_.setValue(R,"toneMappingWhitePoint",V.toneMappingWhitePoint),n.lights&&(x=M,(M=a).ambientLightColor.needsUpdate=x,M.lightProbe.needsUpdate=x,M.directionalLights.needsUpdate=x,M.pointLights.needsUpdate=x,M.spotLights.needsUpdate=x,M.rectAreaLights.needsUpdate=x,M.hemisphereLights.needsUpdate=x),e&&n.fog&&(x=e,(e=a).fogColor.value.copy(x.color),x.isFog?(e.fogNear.value=x.near,e.fogFar.value=x.far):x.isFogExp2&&(e.fogDensity.value=x.density)),n.isMeshBasicMaterial?A(a,n):n.isMeshLambertMaterial?(A(a,n),g=a,(y=n).emissiveMap&&(g.emissiveMap.value=y.emissiveMap)):n.isMeshPhongMaterial?(A(a,n),n.isMeshToonMaterial?(S(g=a,y=n),y.gradientMap&&(g.gradientMap.value=y.gradientMap)):S(a,n)):n.isMeshStandardMaterial?(A(a,n),n.isMeshPhysicalMaterial?(T(m=a,v=n),m.reflectivity.value=v.reflectivity,m.clearCoat.value=v.clearCoat,m.clearCoatRoughness.value=v.clearCoatRoughness):T(a,n)):n.isMeshMatcapMaterial?(A(a,n),m=a,(v=n).matcap&&(m.matcap.value=v.matcap),v.bumpMap&&(m.bumpMap.value=v.bumpMap,m.bumpScale.value=v.bumpScale,v.side===go&&(m.bumpScale.value*=-1)),v.normalMap&&(m.normalMap.value=v.normalMap,m.normalScale.value.copy(v.normalScale),v.side===go&&m.normalScale.value.negate()),v.displacementMap&&(m.displacementMap.value=v.displacementMap,m.displacementScale.value=v.displacementScale,m.displacementBias.value=v.displacementBias)):n.isMeshDepthMaterial?(A(a,n),p=a,(f=n).displacementMap&&(p.displacementMap.value=f.displacementMap,p.displacementScale.value=f.displacementScale,p.displacementBias.value=f.displacementBias)):n.isMeshDistanceMaterial?(A(a,n),p=a,(f=n).displacementMap&&(p.displacementMap.value=f.displacementMap,p.displacementScale.value=f.displacementScale,p.displacementBias.value=f.displacementBias),p.referencePosition.value.copy(f.referencePosition),p.nearDistance.value=f.nearDistance,p.farDistance.value=f.farDistance):n.isMeshNormalMaterial?(A(a,n),u=a,(d=n).bumpMap&&(u.bumpMap.value=d.bumpMap,u.bumpScale.value=d.bumpScale,d.side===go&&(u.bumpScale.value*=-1)),d.normalMap&&(u.normalMap.value=d.normalMap,u.normalScale.value.copy(d.normalScale),d.side===go&&u.normalScale.value.negate()),d.displacementMap&&(u.displacementMap.value=d.displacementMap,u.displacementScale.value=d.displacementScale,u.displacementBias.value=d.displacementBias)):n.isLineBasicMaterial?(u=n,(d=a).diffuse.value.copy(u.color),d.opacity.value=u.opacity,n.isLineDashedMaterial&&(d=n,(u=a).dashSize.value=d.dashSize,u.totalSize.value=d.dashSize+d.gapSize,u.scale.value=d.scale)):n.isPointsMaterial?(l=n,(h=a).diffuse.value.copy(l.color),h.opacity.value=l.opacity,h.size.value=l.size*at,h.scale.value=.5*ot,h.map.value=l.map,null!==l.map&&(!0===l.map.matrixAutoUpdate&&l.map.updateMatrix(),h.uvTransform.value.copy(l.map.matrix))):n.isSpriteMaterial?(h=n,(l=a).diffuse.value.copy(h.color),l.opacity.value=h.opacity,l.rotation.value=h.rotation,l.map.value=h.map,null!==h.map&&(!0===h.map.matrixAutoUpdate&&h.map.updateMatrix(),l.uvTransform.value.copy(h.map.matrix))):n.isShadowMaterial&&(a.color.value.copy(n.color),a.opacity.value=n.opacity),void 0!==a.ltc_1&&(a.ltc_1.value=Sc.LTC_1),void 0!==a.ltc_2&&(a.ltc_2.value=Sc.LTC_2),Yt.upload(R,r.uniformsList,a,O)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(Yt.upload(R,r.uniformsList,a,O),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&_.setValue(R,"center",i.center),_.setValue(R,"modelViewMatrix",i.modelViewMatrix),_.setValue(R,"normalMatrix",i.normalMatrix),_.setValue(R,"modelMatrix",i.matrixWorld),o}function A(t,e){var n;t.opacity.value=e.opacity,e.color&&t.diffuse.value.copy(e.color),e.emissive&&t.emissive.value.copy(e.emissive).multiplyScalar(e.emissiveIntensity),e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.specularMap&&(t.specularMap.value=e.specularMap),e.envMap&&(t.envMap.value=e.envMap,t.flipEnvMap.value=e.envMap.isCubeTexture?-1:1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio,t.maxMipLevel.value=I.get(e.envMap).__maxMipLevel),e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.aoMap&&(t.aoMap.value=e.aoMap,t.aoMapIntensity.value=e.aoMapIntensity),e.map?n=e.map:e.specularMap?n=e.specularMap:e.displacementMap?n=e.displacementMap:e.normalMap?n=e.normalMap:e.bumpMap?n=e.bumpMap:e.roughnessMap?n=e.roughnessMap:e.metalnessMap?n=e.metalnessMap:e.alphaMap?n=e.alphaMap:e.emissiveMap&&(n=e.emissiveMap),void 0!==n&&(n.isWebGLRenderTarget&&(n=n.texture),!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}function S(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===go&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===go&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function T(t,e){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===go&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===go&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),e.envMap&&(t.envMapIntensity.value=e.envMapIntensity)}console.log("THREE.WebGLRenderer",co);var r=void 0!==(t=t||{}).canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),a=void 0!==t.context?t.context:null,s=void 0!==t.alpha&&t.alpha,c=void 0===t.depth||t.depth,h=void 0===t.stencil||t.stencil,l=void 0!==t.antialias&&t.antialias,v=void 0===t.premultipliedAlpha||t.premultipliedAlpha,g=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,y=void 0!==t.powerPreference?t.powerPreference:"default",x=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat,b=null,L=null;this.domElement=r,this.context=null,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=ta,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var R,w,C,P,M,I,O,_,D,N,z,U,B,k,F,G,H,j,V=this,W=!1,q=null,X=0,Y=0,Z=null,J=null,Q=-1,K={geometry:null,program:null,wireframe:!1},$=null,tt=null,et=new _t,nt=new _t,it=null,rt=r.width,ot=r.height,at=1,st=new _t(0,0,rt,ot),ct=new _t(0,0,rt,ot),ht=!1,lt=new At,ut=new Ot,dt=!1,pt=!1,ft=new St,mt=new Mt;try{var vt={alpha:s,depth:c,stencil:h,antialias:l,premultipliedAlpha:v,preserveDrawingBuffer:g,powerPreference:y,failIfMajorPerformanceCaveat:x,xrCompatible:!0};if(r.addEventListener("webglcontextlost",n,!1),r.addEventListener("webglcontextrestored",i,!1),null===(R=a||r.getContext("webgl",vt)||r.getContext("experimental-webgl",vt)))throw null!==r.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===R.getShaderPrecisionFormat&&(R.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw console.error("THREE.WebGLRenderer: "+t.message),t}e();var gt=new("undefined"!=typeof navigator&&"xr"in navigator&&"supportsSession"in navigator.xr?Se:Ae)(V);this.vr=gt;var yt=new ve(V,N,C.maxTextureSize);this.shadowMap=yt,this.getContext=function(){return R},this.getContextAttributes=function(){return R.getContextAttributes()},this.forceContextLoss=function(){var t=w.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){var t=w.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return at},this.setPixelRatio=function(t){void 0!==t&&(at=t,this.setSize(rt,ot,!1))},this.getSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),t=new wt),t.set(rt,ot)},this.setSize=function(t,e,n){gt.isPresenting()?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(rt=t,ot=e,r.width=t*at,r.height=e*at,!1!==n&&(r.style.width=t+"px",r.style.height=e+"px"),this.setViewport(0,0,t,e))},this.getDrawingBufferSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),t=new wt),t.set(rt*at,ot*at)},this.setDrawingBufferSize=function(t,e,n){rt=t,ot=e,at=n,r.width=t*n,r.height=e*n,this.setViewport(0,0,t,e)},this.getCurrentViewport=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),t=new _t),t.copy(et)},this.getViewport=function(t){return t.copy(st)},this.setViewport=function(t,e,n,i){t.isVector4?st.set(t.x,t.y,t.z,t.w):st.set(t,e,n,i),P.viewport(et.copy(st).multiplyScalar(at))},this.getScissor=function(t){return t.copy(ct)},this.setScissor=function(t,e,n,i){t.isVector4?ct.set(t.x,t.y,t.z,t.w):ct.set(t,e,n,i),P.scissor(nt.copy(ct).multiplyScalar(at))},this.getScissorTest=function(){return ht},this.setScissorTest=function(t){P.setScissorTest(ht=t)},this.getClearColor=function(){return k.getClearColor()},this.setClearColor=function(){k.setClearColor.apply(k,arguments)},this.getClearAlpha=function(){return k.getClearAlpha()},this.setClearAlpha=function(){k.setClearAlpha.apply(k,arguments)},this.clear=function(t,e,n){var i=0;void 0!==t&&!t||(i|=16384),void 0!==e&&!e||(i|=256),void 0!==n&&!n||(i|=1024),R.clear(i)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){r.removeEventListener("webglcontextlost",n,!1),r.removeEventListener("webglcontextrestored",i,!1),U.dispose(),B.dispose(),I.dispose(),N.dispose(),gt.dispose(),bt.stop()},this.renderBufferImmediate=function(t,e){P.initAttributes();var n=I.get(t);t.hasPositions&&!n.position&&(n.position=R.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=R.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=R.createBuffer()),t.hasColors&&!n.color&&(n.color=R.createBuffer());e=e.getAttributes();t.hasPositions&&(R.bindBuffer(34962,n.position),R.bufferData(34962,t.positionArray,35048),P.enableAttribute(e.position),R.vertexAttribPointer(e.position,3,5126,!1,0,0)),t.hasNormals&&(R.bindBuffer(34962,n.normal),R.bufferData(34962,t.normalArray,35048),P.enableAttribute(e.normal),R.vertexAttribPointer(e.normal,3,5126,!1,0,0)),t.hasUvs&&(R.bindBuffer(34962,n.uv),R.bufferData(34962,t.uvArray,35048),P.enableAttribute(e.uv),R.vertexAttribPointer(e.uv,2,5126,!1,0,0)),t.hasColors&&(R.bindBuffer(34962,n.color),R.bufferData(34962,t.colorArray,35048),P.enableAttribute(e.color),R.vertexAttribPointer(e.color,3,5126,!1,0,0)),P.disableUnusedAttributes(),R.drawArrays(4,0,t.count),t.count=0},this.renderBufferDirect=function(t,e,n,i,r,o){var a=r.isMesh&&r.matrixWorld.determinant()<0;P.setMaterial(i,a);var s=f(t,e,i,r),c=!1;K.geometry===n.id&&K.program===s.id&&K.wireframe===(!0===i.wireframe)||(K.geometry=n.id,K.program=s.id,K.wireframe=!0===i.wireframe,c=!0),r.morphTargetInfluences&&(F.update(r,n,i,s),c=!0);a=n.index,t=n.attributes.position,e=1;!0===i.wireframe&&(a=D.getWireframeAttribute(n),e=2);var h=G;null!==a&&(l=_.get(a),(h=H).setIndex(l)),c&&(function(t,e,n){if(n&&n.isInstancedBufferGeometry&&!C.isWebGL2&&null===w.get("ANGLE_instanced_arrays"))return console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");P.initAttributes();var i,r=n.attributes,o=e.getAttributes(),a=t.defaultAttributeValues;for(i in o){var s=o[i];if(0<=s){var c=r[i];if(void 0!==c){var h,l,u,d,p,f=c.normalized,m=c.itemSize,v=_.get(c);void 0!==v&&(h=v.buffer,l=v.type,u=v.bytesPerElement,c.isInterleavedBufferAttribute?(p=(d=c.data).stride,v=c.offset,d&&d.isInstancedInterleavedBuffer?(P.enableAttributeAndDivisor(s,d.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=d.meshPerAttribute*d.count)):P.enableAttribute(s),R.bindBuffer(34962,h),R.vertexAttribPointer(s,m,l,f,p*u,v*u)):(c.isInstancedBufferAttribute?(P.enableAttributeAndDivisor(s,c.meshPerAttribute),void 0===n.maxInstancedCount&&(n.maxInstancedCount=c.meshPerAttribute*c.count)):P.enableAttribute(s),R.bindBuffer(34962,h),R.vertexAttribPointer(s,m,l,f,0,0)))}else if(void 0!==a){var g=a[i];if(void 0!==g)switch(g.length){case 2:R.vertexAttrib2fv(s,g);break;case 3:R.vertexAttrib3fv(s,g);break;case 4:R.vertexAttrib4fv(s,g);break;default:R.vertexAttrib1fv(s,g)}}}}P.disableUnusedAttributes()}(i,s,n),null!==a&&R.bindBuffer(34963,l.buffer));s=1/0;null!==a?s=a.count:void 0!==t&&(s=t.count);var l=n.drawRange.start*e,a=n.drawRange.count*e,t=null!==o?o.start*e:0,o=null!==o?o.count*e:1/0,e=Math.max(l,t),o=Math.min(s,l+a,t+o)-1,o=Math.max(0,o-e+1);if(0!==o){if(r.isMesh)if(!0===i.wireframe)P.setLineWidth(i.wireframeLinewidth*u()),h.setMode(1);else switch(r.drawMode){case us:h.setMode(4);break;case ds:h.setMode(5);break;case ps:h.setMode(6)}else r.isLine?(void 0===(i=i.linewidth)&&(i=1),P.setLineWidth(i*u()),r.isLineSegments?h.setMode(1):r.isLineLoop?h.setMode(2):h.setMode(3)):r.isPoints?h.setMode(0):r.isSprite&&h.setMode(4);n&&n.isInstancedBufferGeometry?0<n.maxInstancedCount&&h.renderInstances(n,e,o):h.render(e,o)}},this.compile=function(n,t){(L=B.get(n,t)).init(),n.traverse(function(t){t.isLight&&(L.pushLight(t),t.castShadow&&L.pushShadow(t))}),L.setupLights(t),n.traverse(function(t){if(t.material)if(Array.isArray(t.material))for(var e=0;e<t.material.length;e++)E(t.material[e],n.fog,t);else E(t.material,n.fog,t)})};var xt=null,bt=new Lt;bt.setAnimationLoop(function(t){gt.isPresenting()||xt&&xt(t)}),"undefined"!=typeof window&&bt.setContext(window),this.setAnimationLoop=function(t){xt=t,gt.setAnimationLoop(t),bt.start()},this.render=function(t,e){var n,i,r;void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),i=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),r=arguments[3]),e&&e.isCamera?W||(K.geometry=null,K.program=null,K.wireframe=!1,Q=-1,!($=null)===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),gt.enabled&&(e=gt.getCamera(e)),(L=B.get(t,e)).init(),t.onBeforeRender(V,t,e,i||Z),ft.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),lt.setFromMatrix(ft),pt=this.localClippingEnabled,dt=ut.init(this.clippingPlanes,pt,e),(b=U.get(t,e)).init(),function t(e,n,i,r){if(!1!==e.visible){if(e.layers.test(n.layers))if(e.isGroup)i=e.renderOrder;else if(e.isLight)L.pushLight(e),e.castShadow&&L.pushShadow(e);else if(e.isSprite)e.frustumCulled&&!lt.intersectsSprite(e)||(r&&mt.setFromMatrixPosition(e.matrixWorld).applyMatrix4(ft),o=N.update(e),(a=e.material).visible&&b.push(e,o,a,i,mt.z,null));else if(e.isImmediateRenderObject)r&&mt.setFromMatrixPosition(e.matrixWorld).applyMatrix4(ft),b.push(e,null,e.material,i,mt.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.update(),!e.frustumCulled||lt.intersectsObject(e))){r&&mt.setFromMatrixPosition(e.matrixWorld).applyMatrix4(ft);var o=N.update(e),a=e.material;if(Array.isArray(a))for(var s=o.groups,c=0,h=s.length;c<h;c++){var l=s[c],u=a[l.materialIndex];u&&u.visible&&b.push(e,o,u,i,mt.z,l)}else a.visible&&b.push(e,o,a,i,mt.z,null)}for(var d=e.children,c=0,h=d.length;c<h;c++)t(d[c],n,i,r)}}(t,e,0,V.sortObjects),!0===V.sortObjects&&b.sort(),dt&&ut.beginShadows(),n=L.state.shadowsArray,yt.render(n,t,e),L.setupLights(e),dt&&ut.endShadows(),this.info.autoReset&&this.info.reset(),void 0!==i&&this.setRenderTarget(i),k.render(b,t,e,r),n=b.opaque,i=b.transparent,t.overrideMaterial?(r=t.overrideMaterial,n.length&&o(n,t,e,r),i.length&&o(i,t,e,r)):(n.length&&o(n,t,e),i.length&&o(i,t,e)),t.onAfterRender(V,t,e),null!==Z&&(O.updateRenderTargetMipmap(Z),O.updateMultisampleRenderTarget(Z)),P.buffers.depth.setTest(!0),P.buffers.depth.setMask(!0),P.buffers.color.setMask(!0),P.setPolygonOffset(!1),gt.enabled&&gt.submitFrame(),L=b=null):console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.")},this.setFramebuffer=function(t){q!==t&&R.bindFramebuffer(36160,t),q=t},this.getActiveCubeFace=function(){return X},this.getActiveMipMapLevel=function(){return Y},this.getRenderTarget=function(){return Z},this.setRenderTarget=function(t,e,n){X=e,Y=n,(Z=t)&&void 0===I.get(t).__webglFramebuffer&&O.setupRenderTarget(t);var i,r=q,o=!1;it=t?(i=I.get(t).__webglFramebuffer,t.isWebGLRenderTargetCube?(r=i[e||0],o=!0):r=t.isWebGLMultisampleRenderTarget?I.get(t).__webglMultisampledFramebuffer:i,et.copy(t.viewport),nt.copy(t.scissor),t.scissorTest):(et.copy(st).multiplyScalar(at),nt.copy(ct).multiplyScalar(at),ht),J!==r&&(R.bindFramebuffer(36160,r),J=r),P.viewport(et),P.scissor(nt),P.setScissorTest(it),o&&(t=I.get(t.texture),R.framebufferTexture2D(36160,36064,34069+(e||0),t.__webglTexture,n||0))},this.readRenderTargetPixels=function(t,e,n,i,r,o,a){if(t&&t.isWebGLRenderTarget){var s=I.get(t).__webglFramebuffer;if(t.isWebGLRenderTargetCube&&void 0!==a&&(s=s[a]),s){a=!1;s!==J&&(R.bindFramebuffer(36160,s),a=!0);try{var c=t.texture,h=c.format,c=c.type;if(h!==Na&&j.convert(h)!==R.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(c===wa||j.convert(c)===R.getParameter(35738)||c===Ta&&(C.isWebGL2||w.get("OES_texture_float")||w.get("WEBGL_color_buffer_float"))||c===La&&(C.isWebGL2?w.get("EXT_color_buffer_float"):w.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===R.checkFramebufferStatus(36160)?0<=e&&e<=t.width-i&&0<=n&&n<=t.height-r&&R.readPixels(e,n,i,r,j.convert(h),j.convert(c),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{a&&R.bindFramebuffer(36160,J)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(t,e,n){var i=e.image.width,r=e.image.height,o=j.convert(e.format);O.setTexture2D(e,0),R.copyTexImage2D(3553,n||0,o,t.x,t.y,i,r,0)},this.copyTextureToTexture=function(t,e,n,i){var r=e.image.width,o=e.image.height,a=j.convert(n.format),s=j.convert(n.type);O.setTexture2D(n,0),e.isDataTexture?R.texSubImage2D(3553,i||0,t.x,t.y,r,o,a,s,e.image.data):R.texSubImage2D(3553,i||0,t.x,t.y,a,s,e.image)}}function Le(t,e){this.name="",this.color=new y(t),this.density=void 0!==e?e:25e-5}function Re(t,e,n){this.name="",this.color=new y(t),this.near=void 0!==e?e:1,this.far=void 0!==n?n:1e3}function Ce(){f.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function Pe(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function Ie(t,e,n,i){this.data=t,this.itemSize=e,this.offset=n,this.normalized=!0===i}function Oe(t){N.call(this),this.type="SpriteMaterial",this.color=new y(16777215),this.map=null,this.rotation=0,this.sizeAttenuation=!0,this.lights=!1,this.transparent=!0,this.setValues(t)}function De(t){var e;f.call(this),this.type="Sprite",void 0===Ml&&(Ml=new U,e=new Pe(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5),Ml.setIndex([0,1,2,0,2,3]),Ml.addAttribute("position",new Ie(e,3,0,!1)),Ml.addAttribute("uv",new Ie(e,2,3,!1))),this.geometry=Ml,this.material=void 0!==t?t:new Oe,this.center=new wt(.5,.5)}function Ne(){f.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function ze(t,e){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),H.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new St,this.bindMatrixInverse=new St}function Ue(t,e){if(t=t||[],this.bones=t.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new St)}}function Be(){f.call(this),this.type="Bone"}function ke(t){N.call(this),this.type="LineBasicMaterial",this.color=new y(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(t)}function Fe(t,e,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),f.call(this),this.type="Line",this.geometry=void 0!==t?t:new U,this.material=void 0!==e?e:new ke({color:16777215*Math.random()})}function Ge(t,e){Fe.call(this,t,e),this.type="LineSegments"}function He(t,e){Fe.call(this,t,e),this.type="LineLoop"}function je(t){N.call(this),this.type="PointsMaterial",this.color=new y(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.lights=!1,this.setValues(t)}function Ve(t,e){f.call(this),this.type="Points",this.geometry=void 0!==t?t:new U,this.material=void 0!==e?e:new je({color:16777215*Math.random()})}function We(t,e,n,i,r,o,a,s,c){d.call(this,t,e,n,i,r,o,a,s,c),this.format=void 0!==a?a:Da,this.minFilter=void 0!==o?o:ya,this.magFilter=void 0!==r?r:ya,this.generateMipmaps=!1}function qe(t,e,n,i,r,o,a,s,c,h,l,u){d.call(this,null,o,a,s,c,h,i,r,l,u),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function Xe(t,e,n,i,r,o,a,s,c){d.call(this,t,e,n,i,r,o,a,s,c),this.needsUpdate=!0}function Ye(t,e,n,i,r,o,a,s,c,h){if((h=void 0!==h?h:Ba)!==Ba&&h!==ka)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&h===Ba&&(n=Ea),void 0===n&&h===ka&&(n=Ia),d.call(this,null,i,r,o,a,s,h,n,c),this.image={width:t,height:e},this.magFilter=void 0!==a?a:ma,this.minFilter=void 0!==s?s:ma,this.flipY=!1,this.generateMipmaps=!1}function Ze(t){U.call(this),this.type="WireframeGeometry";var e,n,i,r,o,a,s=[],c=[0,0],h={},l=["a","b","c"];if(t&&t.isGeometry){for(var u=t.faces,d=0,p=u.length;d<p;d++)for(var f=u[d],m=0;m<3;m++)r=f[l[m]],o=f[l[(m+1)%3]],c[0]=Math.min(r,o),c[1]=Math.max(r,o),void 0===h[a=c[0]+","+c[1]]&&(h[a]={index1:c[0],index2:c[1]});for(a in h)i=h[a],w=t.vertices[i.index1],s.push(w.x,w.y,w.z),w=t.vertices[i.index2],s.push(w.x,w.y,w.z)}else if(t&&t.isBufferGeometry){var v,g,y,x,b,w=new Mt;if(null!==t.index){for(v=t.attributes.position,g=t.index,0===(y=t.groups).length&&(y=[{start:0,count:g.count,materialIndex:0}]),e=0,n=y.length;e<n;++e)for(p=(d=(x=y[e]).start)+x.count;d<p;d+=3)for(m=0;m<3;m++)r=g.getX(d+m),o=g.getX(d+(m+1)%3),c[0]=Math.min(r,o),c[1]=Math.max(r,o),void 0===h[a=c[0]+","+c[1]]&&(h[a]={index1:c[0],index2:c[1]});for(a in h)i=h[a],w.fromBufferAttribute(v,i.index1),s.push(w.x,w.y,w.z),w.fromBufferAttribute(v,i.index2),s.push(w.x,w.y,w.z)}else for(d=0,p=(v=t.attributes.position).count/3;d<p;d++)for(m=0;m<3;m++)b=3*d+m,w.fromBufferAttribute(v,b),s.push(w.x,w.y,w.z),b=3*d+(m+1)%3,w.fromBufferAttribute(v,b),s.push(w.x,w.y,w.z)}this.addAttribute("position",new z(s,3))}function Je(t,e,n){x.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:n},this.fromBufferGeometry(new Qe(t,e,n)),this.mergeVertices()}function Qe(t,e,n){U.call(this),this.type="ParametricBufferGeometry",this.parameters={func:t,slices:e,stacks:n};var i=[],r=[],o=[],a=[],s=new Mt,c=new Mt,h=new Mt,l=new Mt,u=new Mt;t.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");for(var d=e+1,p=0;p<=n;p++)for(var f=p/n,m=0;m<=e;m++){var v=m/e;t(v,f,c),r.push(c.x,c.y,c.z),0<=v-1e-5?(t(v-1e-5,f,h),l.subVectors(c,h)):(t(1e-5+v,f,h),l.subVectors(h,c)),0<=f-1e-5?(t(v,f-1e-5,h),u.subVectors(c,h)):(t(v,1e-5+f,h),u.subVectors(h,c)),s.crossVectors(l,u).normalize(),o.push(s.x,s.y,s.z),a.push(v,f)}for(p=0;p<n;p++)for(m=0;m<e;m++){var g=p*d+m,y=p*d+m+1,x=(p+1)*d+m+1,b=(p+1)*d+m;i.push(g,y,b),i.push(y,x,b)}this.setIndex(i),this.addAttribute("position",new z(r,3)),this.addAttribute("normal",new z(o,3)),this.addAttribute("uv",new z(a,2))}function Ke(t,e,n,i){x.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:i},this.fromBufferGeometry(new $e(t,e,n,i)),this.mergeVertices()}function $e(n,r,t,e){function d(t){p.push(t.x,t.y,t.z)}function o(t,e){t*=3;e.x=n[0+t],e.y=n[1+t],e.z=n[2+t]}function l(t,e,n,i){i<0&&1===t.x&&(f[e]=t.x-1),0===n.x&&0===n.z&&(f[e]=i/2/Math.PI+.5)}function u(t){return Math.atan2(t.z,-t.x)}U.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:n,indices:r,radius:t,detail:e},t=t||1;var p=[],f=[];!function(u){for(var t=new Mt,e=new Mt,n=new Mt,i=0;i<r.length;i+=3)o(r[i+0],t),o(r[i+1],e),o(r[i+2],n),function(t,e,n){for(var i=Math.pow(2,u),r=[],o=0;o<=i;o++){r[o]=[];for(var a=t.clone().lerp(n,o/i),s=e.clone().lerp(n,o/i),c=i-o,h=0;h<=c;h++)r[o][h]=0===h&&o===i?a:a.clone().lerp(s,h/c)}for(o=0;o<i;o++)for(h=0;h<2*(i-o)-1;h++){var l=Math.floor(h/2);h%2==0?(d(r[o][l+1]),d(r[o+1][l]),d(r[o][l])):(d(r[o][l+1]),d(r[o+1][l+1]),d(r[o+1][l]))}}(t,e,n)}(e=e||0),function(t){for(var e=new Mt,n=0;n<p.length;n+=3)e.x=p[n+0],e.y=p[n+1],e.z=p[n+2],e.normalize().multiplyScalar(t),p[n+0]=e.x,p[n+1]=e.y,p[n+2]=e.z}(t),function(){for(var t=new Mt,e=0;e<p.length;e+=3){t.x=p[e+0],t.y=p[e+1],t.z=p[e+2];var n=u(t)/2/Math.PI+.5,i=(i=t,Math.atan2(-i.y,Math.sqrt(i.x*i.x+i.z*i.z))/Math.PI+.5);f.push(n,1-i)}(function(){for(var t=new Mt,e=new Mt,n=new Mt,i=new Mt,r=new wt,o=new wt,a=new wt,s=0,c=0;s<p.length;s+=9,c+=6){t.set(p[s+0],p[s+1],p[s+2]),e.set(p[s+3],p[s+4],p[s+5]),n.set(p[s+6],p[s+7],p[s+8]),r.set(f[c+0],f[c+1]),o.set(f[c+2],f[c+3]),a.set(f[c+4],f[c+5]),i.copy(t).add(e).add(n).divideScalar(3);var h=u(i);l(r,c+0,t,h),l(o,c+2,e,h),l(a,c+4,n,h)}})(),function(){for(var t=0;t<f.length;t+=6){var e=f[t+0],n=f[t+2],i=f[t+4],r=Math.max(e,n,i),o=Math.min(e,n,i);.9<r&&o<.1&&(e<.2&&(f[t+0]+=1),n<.2&&(f[t+2]+=1),i<.2&&(f[t+4]+=1))}}()}(),this.addAttribute("position",new z(p,3)),this.addAttribute("normal",new z(p.slice(),3)),this.addAttribute("uv",new z(f,2)),0===e?this.computeVertexNormals():this.normalizeNormals()}function tn(t,e){x.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new en(t,e)),this.mergeVertices()}function en(t,e){$e.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function nn(t,e){x.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new rn(t,e)),this.mergeVertices()}function rn(t,e){$e.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function on(t,e){x.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new an(t,e)),this.mergeVertices()}function an(t,e){var n=(1+Math.sqrt(5))/2;$e.call(this,[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function sn(t,e){x.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new cn(t,e)),this.mergeVertices()}function cn(t,e){var n=(1+Math.sqrt(5))/2,i=1/n;$e.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function hn(t,e,n,i,r,o){x.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:i,closed:r},void 0!==o&&console.warn("THREE.TubeGeometry: taper has been removed.");r=new ln(t,e,n,i,r);this.tangents=r.tangents,this.normals=r.normals,this.binormals=r.binormals,this.fromBufferGeometry(r),this.mergeVertices()}function ln(o,a,s,c,t){function e(t){p=o.getPointAt(t/a,p);var e=h.normals[t],n=h.binormals[t];for(l=0;l<=c;l++){var i=l/c*Math.PI*2,r=Math.sin(i),i=-Math.cos(i);d.x=i*e.x+r*n.x,d.y=i*e.y+r*n.y,d.z=i*e.z+r*n.z,d.normalize(),m.push(d.x,d.y,d.z),u.x=p.x+s*d.x,u.y=p.y+s*d.y,u.z=p.z+s*d.z,f.push(u.x,u.y,u.z)}}U.call(this),this.type="TubeBufferGeometry",this.parameters={path:o,tubularSegments:a,radius:s,radialSegments:c,closed:t},a=a||64,s=s||1,c=c||8,t=t||!1;var h=o.computeFrenetFrames(a,t);this.tangents=h.tangents,this.normals=h.normals,this.binormals=h.binormals;var r,l,u=new Mt,d=new Mt,n=new wt,p=new Mt,f=[],m=[],i=[],v=[];!function(){for(r=0;r<a;r++)e(r);e(!1===t?a:0),function(){for(r=0;r<=a;r++)for(l=0;l<=c;l++)n.x=r/a,n.y=l/c,i.push(n.x,n.y)}(),function(){for(l=1;l<=a;l++)for(r=1;r<=c;r++){var t=(c+1)*(l-1)+(r-1),e=(c+1)*l+(r-1),n=(c+1)*l+r,i=(c+1)*(l-1)+r;v.push(t,e,i),v.push(e,n,i)}}()}(),this.setIndex(v),this.addAttribute("position",new z(f,3)),this.addAttribute("normal",new z(m,3)),this.addAttribute("uv",new z(i,2))}function un(t,e,n,i,r,o,a){x.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:i,p:r,q:o},void 0!==a&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new dn(t,e,n,i,r,o)),this.mergeVertices()}function dn(t,e,n,i,r,o){function a(t,e,n,i,r){var o=Math.cos(t),a=Math.sin(t),e=n/e*t,t=Math.cos(e);r.x=i*(2+t)*.5*o,r.y=i*(2+t)*a*.5,r.z=i*Math.sin(e)*.5}U.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:i,p:r,q:o},t=t||1,e=e||.4,n=Math.floor(n)||64,i=Math.floor(i)||8,r=r||2,o=o||3;for(var s,c=[],h=[],l=[],u=[],d=new Mt,p=new Mt,f=new Mt,m=new Mt,v=new Mt,g=new Mt,y=new Mt,x=0;x<=n;++x){var b=x/n*r*Math.PI*2;for(a(b,r,o,t,f),a(.01+b,r,o,t,m),g.subVectors(m,f),y.addVectors(m,f),v.crossVectors(g,y),y.crossVectors(v,g),v.normalize(),y.normalize(),s=0;s<=i;++s){var w=s/i*Math.PI*2,M=-e*Math.cos(w),w=e*Math.sin(w);d.x=f.x+(M*y.x+w*v.x),d.y=f.y+(M*y.y+w*v.y),d.z=f.z+(M*y.z+w*v.z),h.push(d.x,d.y,d.z),p.subVectors(d,f).normalize(),l.push(p.x,p.y,p.z),u.push(x/n),u.push(s/i)}}for(s=1;s<=n;s++)for(x=1;x<=i;x++){var _=(i+1)*(s-1)+(x-1),E=(i+1)*s+(x-1),A=(i+1)*s+x,S=(i+1)*(s-1)+x;c.push(_,E,S),c.push(E,A,S)}this.setIndex(c),this.addAttribute("position",new z(h,3)),this.addAttribute("normal",new z(l,3)),this.addAttribute("uv",new z(u,2))}function pn(t,e,n,i,r){x.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:i,arc:r},this.fromBufferGeometry(new fn(t,e,n,i,r)),this.mergeVertices()}function fn(t,e,n,i,r){U.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:i,arc:r},t=t||1,e=e||.4,n=Math.floor(n)||8,i=Math.floor(i)||6,r=r||2*Math.PI;for(var o,a=[],s=[],c=[],h=[],l=new Mt,u=new Mt,d=new Mt,p=0;p<=n;p++)for(o=0;o<=i;o++){var f=o/i*r,m=p/n*Math.PI*2;u.x=(t+e*Math.cos(m))*Math.cos(f),u.y=(t+e*Math.cos(m))*Math.sin(f),u.z=e*Math.sin(m),s.push(u.x,u.y,u.z),l.x=t*Math.cos(f),l.y=t*Math.sin(f),d.subVectors(u,l).normalize(),c.push(d.x,d.y,d.z),h.push(o/i),h.push(p/n)}for(p=1;p<=n;p++)for(o=1;o<=i;o++){var v=(i+1)*p+o-1,g=(i+1)*(p-1)+o-1,y=(i+1)*(p-1)+o,x=(i+1)*p+o;a.push(v,g,x),a.push(g,y,x)}this.setIndex(a),this.addAttribute("position",new z(s,3)),this.addAttribute("normal",new z(c,3)),this.addAttribute("uv",new z(h,2))}function mn(t,e,n,i,r){var o,a;if(r===0<function(t,e,n,i){for(var r=0,o=e,a=n-i;o<n;o+=i)r+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return r}(t,e,n,i))for(o=e;o<n;o+=i)a=Tn(o,t[o],t[o+1],a);else for(o=n-i;e<=o;o-=i)a=Tn(o,t[o],t[o+1],a);return a&&_n(a,a.next)&&(Ln(a),a=a.next),a}function vn(t,e){if(!t)return t;e=e||t;var n,i=t;do{if(n=!1,i.steiner||!_n(i,i.next)&&0!==Mn(i.prev,i,i.next))i=i.next;else{if(Ln(i),(i=e=i.prev)===i.next)break;n=!0}}while(n||i!==e);return e}function gn(t,e,n,i,r,o,a){if(t){!a&&o&&function(t,e,n,i){for(var r=t;null===r.z&&(r.z=bn(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next,r!==t;);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,n,i,r,o,a,s,c,h=1;do{for(n=t,o=t=null,a=0;n;){for(a++,i=n,e=s=0;e<h&&(s++,i=i.nextZ);e++);for(c=h;0<s||0<c&&i;)0!==s&&(0===c||!i||n.z<=i.z)?(n=(r=n).nextZ,s--):(i=(r=i).nextZ,c--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;n=i}}while(o.nextZ=null,h*=2,1<a)}(r)}(t,i,r,o);for(var s,c,h=t;t.prev!==t.next;)if(s=t.prev,c=t.next,o?function(t,e,n,i){var r=t.prev,o=t,a=t.next;if(0<=Mn(r,o,a))return!1;for(var s=(r.x<o.x?r.x<a.x?r:a:o.x<a.x?o:a).x,c=(r.y<o.y?r.y<a.y?r:a:o.y<a.y?o:a).y,h=(r.x>o.x?r.x>a.x?r:a:o.x>a.x?o:a).x,l=(r.y>o.y?r.y>a.y?r:a:o.y>a.y?o:a).y,u=bn(s,c,e,n,i),d=bn(h,l,e,n,i),p=t.nextZ;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&wn(r.x,r.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=Mn(p.prev,p,p.next))return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=u;){if(p!==t.prev&&p!==t.next&&wn(r.x,r.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=Mn(p.prev,p,p.next))return!1;p=p.prevZ}return!0}(t,i,r,o):function(t){var e=t.prev,n=t,i=t.next;if(0<=Mn(e,n,i))return!1;for(var r=t.next.next;r!==t.prev;){if(wn(e.x,e.y,n.x,n.y,i.x,i.y,r.x,r.y)&&0<=Mn(r.prev,r,r.next))return!1;r=r.next}return!0}(t))e.push(s.i/n),e.push(t.i/n),e.push(c.i/n),Ln(t),t=c.next,h=c.next;else if((t=c)===h){a?1===a?gn(t=function(t,e,n){var i=t;do{var r=i.prev,o=i.next.next}while(!_n(r,o)&&En(r,i,i.next,o)&&An(r,o)&&An(o,r)&&(e.push(r.i/n),e.push(i.i/n),e.push(o.i/n),Ln(i),Ln(i.next),i=t=o),i=i.next,i!==t);return i}(t,e,n),e,n,i,r,o,2):2===a&&function(t,e,n,i,r,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&function(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&En(n,n.next,t,e))return!0}while(n=n.next,n!==t);return!1}(t,e)&&An(t,e)&&An(e,t)&&function(t,e){var n=t,i=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;for(;n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next,n!==t;);return i}(t,e)}(a,s)){var c=Sn(a,s);return a=vn(a,a.next),c=vn(c,c.next),gn(a,e,n,i,r,o),gn(c,e,n,i,r,o)}s=s.next}}while((a=a.next)!==t)}(t,e,n,i,r,o):gn(vn(t),e,n,i,r,o,1);break}}}function yn(t,e,n,i){for(var r,o,a,s=[],c=0,h=e.length;c<h;c++)(r=mn(t,e[c]*i,c<h-1?e[c+1]*i:t.length,i,!1))===r.next&&(r.steiner=!0),s.push(function(t){var e=t,n=t;for(;e.x<n.x&&(n=e),e=e.next,e!==t;);return n}(r));for(s.sort(xn),c=0;c<s.length;c++)o=s[c],(a=function(t,e){var n,i=e,r=t.x,o=t.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&a<s){if((a=s)===r){if(o===i.y)return i;if(o===i.next.y)return i.next}n=i.x<i.next.x?i:i.next}}}while(i=i.next,i!==e);if(!n)return null;if(r===a)return n.prev;var c,h=n,l=n.x,u=n.y,d=1/0;for(i=n.next;i!==h;)r>=i.x&&i.x>=l&&r!==i.x&&wn(o<u?r:a,o,l,u,o<u?a:r,o,i.x,i.y)&&((c=Math.abs(o-i.y)/(r-i.x))<d||c===d&&i.x>n.x)&&An(i,t)&&(n=i,d=c),i=i.next;return n}(o,a=n))&&vn(o=Sn(a,o),o.next),n=vn(n,n.next);return n}function xn(t,e){return t.x-e.x}function bn(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function wn(t,e,n,i,r,o,a,s){return 0<=(r-a)*(e-s)-(t-a)*(o-s)&&0<=(t-a)*(i-s)-(n-a)*(e-s)&&0<=(n-a)*(o-s)-(r-a)*(i-s)}function Mn(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function _n(t,e){return t.x===e.x&&t.y===e.y}function En(t,e,n,i){return _n(t,e)&&_n(n,i)||_n(t,i)&&_n(n,e)||0<Mn(t,e,n)!=0<Mn(t,e,i)&&0<Mn(n,i,t)!=0<Mn(n,i,e)}function An(t,e){return Mn(t.prev,t,t.next)<0?0<=Mn(t,e,t.next)&&0<=Mn(t,t.prev,e):Mn(t,e,t.prev)<0||Mn(t,t.next,e)<0}function Sn(t,e){var n=new Rn(t.i,t.x,t.y),i=new Rn(e.i,e.x,e.y),r=t.next,o=e.prev;return(t.next=e).prev=t,(n.next=r).prev=n,(i.next=n).prev=i,(o.next=i).prev=o,i}function Tn(t,e,n,i){n=new Rn(t,e,n);return i?(n.next=i.next,(n.prev=i).next.prev=n,i.next=n):(n.prev=n).next=n,n}function Ln(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Rn(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Cn(t){var e=t.length;2<e&&t[e-1].equals(t[0])&&t.pop()}function Pn(t,e){for(var n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}function In(t,e){x.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},this.fromBufferGeometry(new On(t,e)),this.mergeVertices()}function On(t,Z){U.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:t,options:Z},t=Array.isArray(t)?t:[t];for(var J=this,Q=[],K=[],e=0,n=t.length;e<n;e++)!function(t){function e(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(n).add(t)}function n(t,e,n){var i=t.x-e.x,r=t.y-e.y,o=n.x-t.x,a=n.y-t.y,s=i*i+r*r,c=i*a-r*o;if(Math.abs(c)>Number.EPSILON){var h=Math.sqrt(s),l=Math.sqrt(o*o+a*a),u=e.x-r/h,d=e.y+i/h,h=((n.x-a/l-u)*a-(n.y+o/l-d)*o)/(i*a-r*o),d=(l=u+i*h-t.x)*l+(u=d+r*h-t.y)*u;if(d<=2)return new wt(l,u);h=Math.sqrt(d/2)}else{d=!1;i>Number.EPSILON?o>Number.EPSILON&&(d=!0):i<-Number.EPSILON?o<-Number.EPSILON&&(d=!0):Math.sign(r)===Math.sign(a)&&(d=!0),h=d?(l=-r,u=i,Math.sqrt(s)):(l=i,u=r,Math.sqrt(s/2))}return new wt(l/h,u/h)}function i(t,e){var n,i,r,o;for(G=t.length;0<=--G;){(i=(n=G)-1)<0&&(i=t.length-1);for(var a=0,s=d+2*v,a=0;a<s;a++){var c=B*a,h=B*(a+1);r=e+i+c,o=e+i+h,h=e+n+h,l(e+n+c),l(r),l(h),l(r),l(o),l(h),h=Q.length/3,u((h=y.generateSideWallUV(J,Q,h-6,h-3,h-2,h-1))[0]),u(h[1]),u(h[3]),u(h[1]),u(h[2]),!void u(h[3])}}}function r(t,e,n){a.push(t),a.push(e),a.push(n)}function o(t,e,n){l(t),l(e),l(n);n=Q.length/3,n=y.generateTopUV(J,Q,n-3,n-2,n-1);u(n[0]),u(n[1]),u(n[2])}function l(t){Q.push(a[3*t+0]),Q.push(a[3*t+1]),Q.push(a[3*t+2])}function u(t){K.push(t.x),K.push(t.y)}var a=[],s=void 0!==Z.curveSegments?Z.curveSegments:12,d=void 0!==Z.steps?Z.steps:1,c=void 0!==Z.depth?Z.depth:100,h=void 0===Z.bevelEnabled||Z.bevelEnabled,p=void 0!==Z.bevelThickness?Z.bevelThickness:6,f=void 0!==Z.bevelSize?Z.bevelSize:p-2,m=void 0!==Z.bevelOffset?Z.bevelOffset:0,v=void 0!==Z.bevelSegments?Z.bevelSegments:3,g=Z.extrudePath,y=void 0!==Z.UVGenerator?Z.UVGenerator:eu;void 0!==Z.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),c=Z.amount);var x,b,w,M,_,E=!1;g&&(x=g.getSpacedPoints(d),h=!(E=!0),b=g.computeFrenetFrames(d,!1),w=new Mt,M=new Mt,_=new Mt),h||(m=f=p=v=0);var A,S=(s=t.extractPoints(s)).shape,T=s.holes;if(!tu.isClockWise(S))for(S=S.reverse(),C=0,P=T.length;C<P;C++)A=T[C],tu.isClockWise(A)&&(T[C]=A.reverse());for(var L=tu.triangulateShape(S,T),R=S,C=0,P=T.length;C<P;C++)A=T[C],S=S.concat(A);for(var I,O,D,N,z,U,B=S.length,k=L.length,F=[],G=0,H=R.length,j=H-1,V=G+1;G<H;G++,j++,V++)j===H&&(j=0),V===H&&(V=0),F[G]=n(R[G],R[j],R[V]);var W,q,X=[],Y=F.concat();for(C=0,P=T.length;C<P;C++){for(A=T[C],W=[],G=0,j=(H=A.length)-1,V=G+1;G<H;G++,j++,V++)j===H&&(j=0),V===H&&(V=0),W[G]=n(A[G],A[j],A[V]);X.push(W),Y=Y.concat(W)}for(I=0;I<v;I++){for(D=I/v,N=p*Math.cos(D*Math.PI/2),O=f*Math.sin(D*Math.PI/2)+m,G=0,H=R.length;G<H;G++)r((z=e(R[G],F[G],O)).x,z.y,-N);for(C=0,P=T.length;C<P;C++)for(A=T[C],W=X[C],G=0,H=A.length;G<H;G++)r((z=e(A[G],W[G],O)).x,z.y,-N)}for(O=f+m,G=0;G<B;G++)z=h?e(S[G],Y[G],O):S[G],E?(M.copy(b.normals[0]).multiplyScalar(z.x),w.copy(b.binormals[0]).multiplyScalar(z.y),_.copy(x[0]).add(M).add(w),r(_.x,_.y,_.z)):r(z.x,z.y,0);for(q=1;q<=d;q++)for(G=0;G<B;G++)z=h?e(S[G],Y[G],O):S[G],E?(M.copy(b.normals[q]).multiplyScalar(z.x),w.copy(b.binormals[q]).multiplyScalar(z.y),_.copy(x[q]).add(M).add(w),r(_.x,_.y,_.z)):r(z.x,z.y,c/d*q);for(I=v-1;0<=I;I--){for(D=I/v,N=p*Math.cos(D*Math.PI/2),O=f*Math.sin(D*Math.PI/2)+m,G=0,H=R.length;G<H;G++)r((z=e(R[G],F[G],O)).x,z.y,c+N);for(C=0,P=T.length;C<P;C++)for(A=T[C],W=X[C],G=0,H=A.length;G<H;G++)z=e(A[G],W[G],O),E?r(z.x,z.y+x[d-1].y,x[d-1].x+N):r(z.x,z.y,c+N)}!function(){var t=Q.length/3;if(h){var e=0*B;for(G=0;G<k;G++)o((U=L[G])[2]+e,U[1]+e,U[0]+e);for(e=B*(d+2*v),G=0;G<k;G++)o((U=L[G])[0]+e,U[1]+e,U[2]+e)}else{for(G=0;G<k;G++)o((U=L[G])[2],U[1],U[0]);for(G=0;G<k;G++)o((U=L[G])[0]+B*d,U[1]+B*d,U[2]+B*d)}J.addGroup(t,Q.length/3-t,0)}(),function(){var t=Q.length/3,e=0;for(i(R,e),e+=R.length,C=0,P=T.length;C<P;C++)i(A=T[C],e),e+=A.length;J.addGroup(t,Q.length/3-t,1)}()}(t[e]);this.addAttribute("position",new z(Q,3)),this.addAttribute("uv",new z(K,2)),this.computeVertexNormals()}function Dn(t,e,n){if(n.shapes=[],Array.isArray(t))for(var i=0,r=t.length;i<r;i++){var o=t[i];n.shapes.push(o.uuid)}else n.shapes.push(t.uuid);return void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON()),n}function Nn(t,e){x.call(this),this.type="TextGeometry",this.parameters={text:t,parameters:e},this.fromBufferGeometry(new zn(t,e)),this.mergeVertices()}function zn(t,e){var n=(e=e||{}).font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new x;t=n.generateShapes(t,e.size);e.depth=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),On.call(this,t,e),this.type="TextBufferGeometry"}function Un(t,e,n,i,r,o,a){x.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:o,thetaLength:a},this.fromBufferGeometry(new Bn(t,e,n,i,r,o,a)),this.mergeVertices()}function Bn(t,e,n,i,r,o,a){U.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:o,thetaLength:a},t=t||1,e=Math.max(3,Math.floor(e)||8),n=Math.max(2,Math.floor(n)||6),i=void 0!==i?i:0,r=void 0!==r?r:2*Math.PI,o=void 0!==o?o:0,a=void 0!==a?a:Math.PI;for(var s,c=Math.min(o+a,Math.PI),h=0,l=[],u=new Mt,d=new Mt,p=[],f=[],m=[],v=[],g=0;g<=n;g++){var y=[],x=g/n,b=0;for(0==g&&0==o?b=.5/e:g==n&&c==Math.PI&&(b=-.5/e),s=0;s<=e;s++){var w=s/e;u.x=-t*Math.cos(i+w*r)*Math.sin(o+x*a),u.y=t*Math.cos(o+x*a),u.z=t*Math.sin(i+w*r)*Math.sin(o+x*a),f.push(u.x,u.y,u.z),d.copy(u).normalize(),m.push(d.x,d.y,d.z),v.push(w+b,1-x),y.push(h++)}l.push(y)}for(g=0;g<n;g++)for(s=0;s<e;s++){var M=l[g][s+1],_=l[g][s],E=l[g+1][s],A=l[g+1][s+1];(0!==g||0<o)&&p.push(M,_,A),(g!==n-1||c<Math.PI)&&p.push(_,E,A)}this.setIndex(p),this.addAttribute("position",new z(f,3)),this.addAttribute("normal",new z(m,3)),this.addAttribute("uv",new z(v,2))}function kn(t,e,n,i,r,o){x.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:o},this.fromBufferGeometry(new Fn(t,e,n,i,r,o)),this.mergeVertices()}function Fn(t,e,n,i,r,o){U.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:o},t=t||.5,e=e||1,r=void 0!==r?r:0,o=void 0!==o?o:2*Math.PI,n=void 0!==n?Math.max(3,n):8;for(var a,s=[],c=[],h=[],l=[],u=t,d=(e-t)/(i=void 0!==i?Math.max(1,i):1),p=new Mt,f=new wt,m=0;m<=i;m++){for(g=0;g<=n;g++)a=r+g/n*o,p.x=u*Math.cos(a),p.y=u*Math.sin(a),c.push(p.x,p.y,p.z),h.push(0,0,1),f.x=(p.x/e+1)/2,f.y=(p.y/e+1)/2,l.push(f.x,f.y);u+=d}for(m=0;m<i;m++)for(var v=m*(n+1),g=0;g<n;g++){var y=(a=g+v)+n+1,x=a+n+2,b=a+1;s.push(a,y,b),s.push(y,x,b)}this.setIndex(s),this.addAttribute("position",new z(c,3)),this.addAttribute("normal",new z(h,3)),this.addAttribute("uv",new z(l,2))}function Gn(t,e,n,i){x.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},this.fromBufferGeometry(new Hn(t,e,n,i)),this.mergeVertices()}function Hn(t,e,n,i){U.call(this),this.type="LatheBufferGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},e=Math.floor(e)||12,n=n||0,i=i||2*Math.PI,i=As.clamp(i,0,2*Math.PI);var r=[],o=[],a=[],s=1/e,c=new Mt,h=new wt;for(M=0;M<=e;M++)for(var l=n+M*s*i,u=Math.sin(l),d=Math.cos(l),p=0;p<=t.length-1;p++)c.x=t[p].x*u,c.y=t[p].y,c.z=t[p].x*d,o.push(c.x,c.y,c.z),h.x=M/e,h.y=p/(t.length-1),a.push(h.x,h.y);for(M=0;M<e;M++)for(p=0;p<t.length-1;p++){var f=(w=p+M*t.length)+t.length,m=w+t.length+1,v=w+1;r.push(w,f,v),r.push(f,m,v)}if(this.setIndex(r),this.addAttribute("position",new z(o,3)),this.addAttribute("uv",new z(a,2)),this.computeVertexNormals(),i===2*Math.PI){var g=this.attributes.normal.array,y=new Mt,x=new Mt,b=new Mt,w=e*t.length*3,M=0;for(p=0;M<t.length;M++,p+=3)y.x=g[p+0],y.y=g[p+1],y.z=g[p+2],x.x=g[w+p+0],x.y=g[w+p+1],x.z=g[w+p+2],b.addVectors(y,x).normalize(),g[p+0]=g[w+p+0]=b.x,g[p+1]=g[w+p+1]=b.y,g[p+2]=g[w+p+2]=b.z}}function jn(t,e){x.call(this),this.type="ShapeGeometry","object"==typeof e&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),e=e.curveSegments),this.parameters={shapes:t,curveSegments:e},this.fromBufferGeometry(new Vn(t,e)),this.mergeVertices()}function Vn(t,d){function e(t){var e,n=f.length/3,t=t.extractPoints(d),i=t.shape,r=t.holes;for(!1===tu.isClockWise(i)&&(i=i.reverse()),a=0,s=r.length;a<s;a++)e=r[a],!0===tu.isClockWise(e)&&(r[a]=e.reverse());for(var o=tu.triangulateShape(i,r),a=0,s=r.length;a<s;a++)e=r[a],i=i.concat(e);for(a=0,s=i.length;a<s;a++){var c=i[a];f.push(c.x,c.y,0),m.push(0,0,1),v.push(c.x,c.y)}for(a=0,s=o.length;a<s;a++){var h=o[a],l=h[0]+n,u=h[1]+n,h=h[2]+n;p.push(l,u,h),g+=3}}U.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:d},d=d||12;var p=[],f=[],m=[],v=[],n=0,g=0;if(!1===Array.isArray(t))e(t);else for(var i=0;i<t.length;i++)e(t[i]),this.addGroup(n,g,i),n+=g,g=0;this.setIndex(p),this.addAttribute("position",new z(f,3)),this.addAttribute("normal",new z(m,3)),this.addAttribute("uv",new z(v,2))}function Wn(t,e){if(e.shapes=[],Array.isArray(t))for(var n=0,i=t.length;n<i;n++){var r=t[n];e.shapes.push(r.uuid)}else e.shapes.push(t.uuid);return e}function qn(t,e){U.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1;var n,i,r,o,a=[],s=Math.cos(As.DEG2RAD*e),c=[0,0],h={},l=["a","b","c"];t.isBufferGeometry?(o=new x).fromBufferGeometry(t):o=t.clone(),o.mergeVertices(),o.computeFaceNormals();for(var u=o.vertices,d=o.faces,p=0,f=d.length;p<f;p++)for(var m=d[p],v=0;v<3;v++)n=m[l[v]],i=m[l[(v+1)%3]],c[0]=Math.min(n,i),c[1]=Math.max(n,i),void 0===h[r=c[0]+","+c[1]]?h[r]={index1:c[0],index2:c[1],face1:p,face2:void 0}:h[r].face2=p;for(r in h){var g,y=h[r];(void 0===y.face2||d[y.face1].normal.dot(d[y.face2].normal)<=s)&&(g=u[y.index1],a.push(g.x,g.y,g.z),g=u[y.index2],a.push(g.x,g.y,g.z))}this.addAttribute("position",new z(a,3))}function Xn(t,e,n,i,r,o,a,s){x.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:i,heightSegments:r,openEnded:o,thetaStart:a,thetaLength:s},this.fromBufferGeometry(new Yn(t,e,n,i,r,o,a,s)),this.mergeVertices()}function Yn(v,g,y,x,b,t,w,M){function e(t){for(var e,n=new wt,i=new Mt,r=0,o=!0===t?v:g,a=!0===t?1:-1,s=L,c=1;c<=x;c++)A.push(0,C*a,0),S.push(0,a,0),T.push(.5,.5),L++;for(e=L,c=0;c<=x;c++){var h=c/x*M+w,l=Math.cos(h),h=Math.sin(h);i.x=o*h,i.y=C*a,i.z=o*l,A.push(i.x,i.y,i.z),S.push(0,a,0),n.x=.5*l+.5,n.y=.5*h*a+.5,T.push(n.x,n.y),L++}for(c=0;c<x;c++){var u=s+c,d=e+c;!0===t?E.push(d,d+1,u):E.push(d+1,d,u),r+=3}_.addGroup(P,r,!0===t?1:2),P+=r}U.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:v,radiusBottom:g,height:y,radialSegments:x,heightSegments:b,openEnded:t,thetaStart:w,thetaLength:M};var _=this;v=void 0!==v?v:1,g=void 0!==g?g:1,y=y||1,x=Math.floor(x)||8,b=Math.floor(b)||1,t=void 0!==t&&t,w=void 0!==w?w:0,M=void 0!==M?M:2*Math.PI;var E=[],A=[],S=[],T=[],L=0,R=[],C=y/2,P=0;!function(){for(var t=new Mt,e=new Mt,n=0,i=(g-v)/y,r=0;r<=b;r++){for(var o=[],a=r/b,s=a*(g-v)+v,c=0;c<=x;c++){var h=c/x,l=h*M+w,u=Math.sin(l),l=Math.cos(l);e.x=s*u,e.y=-a*y+C,e.z=s*l,A.push(e.x,e.y,e.z),t.set(u,i,l).normalize(),S.push(t.x,t.y,t.z),T.push(h,1-a),o.push(L++)}R.push(o)}for(c=0;c<x;c++)for(r=0;r<b;r++){var d=R[r][c],p=R[r+1][c],f=R[r+1][c+1],m=R[r][c+1];E.push(d,p,m),E.push(p,f,m),n+=6}_.addGroup(P,n,0),P+=n}(),!1===t&&(0<v&&e(!0),0<g&&e(!1)),this.setIndex(E),this.addAttribute("position",new z(A,3)),this.addAttribute("normal",new z(S,3)),this.addAttribute("uv",new z(T,2))}function Zn(t,e,n,i,r,o,a){Xn.call(this,0,t,e,n,i,r,o,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:o,thetaLength:a}}function Jn(t,e,n,i,r,o,a){Yn.call(this,0,t,e,n,i,r,o,a),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:o,thetaLength:a}}function Qn(t,e,n,i){x.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},this.fromBufferGeometry(new Kn(t,e,n,i)),this.mergeVertices()}function Kn(t,e,n,i){U.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},t=t||1,e=void 0!==e?Math.max(3,e):8,n=void 0!==n?n:0,i=void 0!==i?i:2*Math.PI;var r,o,a=[],s=[],c=[],h=[],l=new Mt,u=new wt;for(s.push(0,0,0),c.push(0,0,1),h.push(.5,.5),o=0,r=3;o<=e;o++,r+=3){var d=n+o/e*i;l.x=t*Math.cos(d),l.y=t*Math.sin(d),s.push(l.x,l.y,l.z),c.push(0,0,1),u.x=(s[r]/t+1)/2,u.y=(s[r+1]/t+1)/2,h.push(u.x,u.y)}for(r=1;r<=e;r++)a.push(r,r+1,0);this.setIndex(a),this.addAttribute("position",new z(s,3)),this.addAttribute("normal",new z(c,3)),this.addAttribute("uv",new z(h,2))}function $n(t){N.call(this),this.type="ShadowMaterial",this.color=new y(0),this.transparent=!0,this.setValues(t)}function ti(t){B.call(this,t),this.type="RawShaderMaterial"}function ei(t){N.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new y(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new y(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=_s,this.normalScale=new wt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function ni(t){ei.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(t)}function ii(t){N.call(this),this.type="MeshPhongMaterial",this.color=new y(16777215),this.specular=new y(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new y(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=_s,this.normalScale=new wt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Jo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function ri(t){ii.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(t)}function oi(t){N.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=_s,this.normalScale=new wt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function ai(t){N.call(this),this.type="MeshLambertMaterial",this.color=new y(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new y(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Jo,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function si(t){N.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new y(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=_s,this.normalScale=new wt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.lights=!1,this.setValues(t)}function ci(t){ke.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}function hi(t,e,n,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new e.constructor(n),this.sampleValues=e,this.valueSize=n}function li(t,e,n,i){hi.call(this,t,e,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function ui(t,e,n,i){hi.call(this,t,e,n,i)}function di(t,e,n,i){hi.call(this,t,e,n,i)}function pi(t,e,n,i){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=ru.convertArray(e,this.TimeBufferType),this.values=ru.convertArray(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}function fi(t,e,n){pi.call(this,t,e,n)}function mi(t,e,n,i){pi.call(this,t,e,n,i)}function vi(t,e,n,i){pi.call(this,t,e,n,i)}function gi(t,e,n,i){hi.call(this,t,e,n,i)}function yi(t,e,n,i){pi.call(this,t,e,n,i)}function xi(t,e,n,i){pi.call(this,t,e,n,i)}function bi(t,e,n,i){pi.call(this,t,e,n,i)}function wi(t,e,n){this.name=t,this.tracks=n,this.duration=void 0!==e?e:-1,this.uuid=As.generateUUID(),this.duration<0&&this.resetDuration()}function Mi(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var e,n,i=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return vi;case"vector":case"vector2":case"vector3":case"vector4":return bi;case"color":return mi;case"quaternion":return yi;case"bool":case"boolean":return fi;case"string":return xi}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);return void 0===t.times&&(e=[],n=[],ru.flattenJSON(t.keys,e,n,"value"),t.times=e,t.values=n),void 0!==i.parse?i.parse(t):new i(t.name,t.times,t.values,t.interpolation)}function _i(t,e,n){var i=this,r=!1,o=0,a=0,s=void 0;this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){a++,!1===r&&void 0!==i.onStart&&i.onStart(t,o,a),r=!0},this.itemEnd=function(t){o++,void 0!==i.onProgress&&i.onProgress(t,o,a),o===a&&(r=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(t){void 0!==i.onError&&i.onError(t)},this.resolveURL=function(t){return s?s(t):t},this.setURLModifier=function(t){return s=t,this}}function Ei(t){this.manager=void 0!==t?t:au}function Ai(t){this.manager=void 0!==t?t:au}function Si(t){this.manager=void 0!==t?t:au}function Ti(t){this.manager=void 0!==t?t:au}function Li(){this.type="Curve",this.arcLengthDivisions=200}function Ri(t,e,n,i,r,o,a,s){Li.call(this),this.type="EllipseCurve",this.aX=t||0,this.aY=e||0,this.xRadius=n||1,this.yRadius=i||1,this.aStartAngle=r||0,this.aEndAngle=o||2*Math.PI,this.aClockwise=a||!1,this.aRotation=s||0}function Ci(t,e,n,i,r,o){Ri.call(this,t,e,n,n,i,r,o),this.type="ArcCurve"}function Pi(){function s(t,e,n,i){a=-3*(r=t)+3*e-2*(o=n)-i,c=2*t-2*e+n+i}var r=0,o=0,a=0,c=0;return{initCatmullRom:function(t,e,n,i,r){s(e,n,r*(n-t),r*(i-e))},initNonuniformCatmullRom:function(t,e,n,i,r,o,a){r=(e-t)/r-(n-t)/(r+o)+(n-e)/o,a=(n-e)/o-(i-e)/(o+a)+(i-n)/a;s(e,n,r*=o,a*=o)},calc:function(t){var e=t*t;return r+o*t+a*e+c*(e*t)}}}function Ii(t,e,n,i){Li.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=e||!1,this.curveType=n||"centripetal",this.tension=i||.5}function Oi(t,e,n,i,r){var o=.5*(i-e),e=.5*(r-n),r=t*t;return t*r*(2*n-2*i+o+e)+(-3*n+3*i-2*o-e)*r+o*t+n}function Di(t,e,n,i){return(r=1-(r=t))*r*e+2*(1-(e=t))*e*n+(t=t)*t*i;var r}function Ni(t,e,n,i,r){return(o=1-(o=t))*o*o*e+3*(e=1-(o=t))*e*o*n+3*(1-(n=t))*n*n*i+(t=t)*t*t*r;var o}function zi(t,e,n,i){Li.call(this),this.type="CubicBezierCurve",this.v0=t||new wt,this.v1=e||new wt,this.v2=n||new wt,this.v3=i||new wt}function Ui(t,e,n,i){Li.call(this),this.type="CubicBezierCurve3",this.v0=t||new Mt,this.v1=e||new Mt,this.v2=n||new Mt,this.v3=i||new Mt}function Bi(t,e){Li.call(this),this.type="LineCurve",this.v1=t||new wt,this.v2=e||new wt}function ki(t,e){Li.call(this),this.type="LineCurve3",this.v1=t||new Mt,this.v2=e||new Mt}function Fi(t,e,n){Li.call(this),this.type="QuadraticBezierCurve",this.v0=t||new wt,this.v1=e||new wt,this.v2=n||new wt}function Gi(t,e,n){Li.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new Mt,this.v1=e||new Mt,this.v2=n||new Mt}function Hi(t){Li.call(this),this.type="SplineCurve",this.points=t||[]}function ji(){Li.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function Vi(t){ji.call(this),this.type="Path",this.currentPoint=new wt,t&&this.setFromPoints(t)}function Wi(t){Vi.call(this,t),this.uuid=As.generateUUID(),this.type="Shape",this.holes=[]}function qi(t,e){f.call(this),this.type="Light",this.color=new y(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function Xi(t,e,n){qi.call(this,t,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(f.DefaultUp),this.updateMatrix(),this.groundColor=new y(e)}function Yi(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new wt(512,512),this.map=null,this.matrix=new St}function Zi(){Yi.call(this,new Me(50,1,.5,500))}function Ji(t,e,n,i,r,o){qi.call(this,t,e),this.type="SpotLight",this.position.copy(f.DefaultUp),this.updateMatrix(),this.target=new f,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==i?i:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==o?o:1,this.shadow=new Zi}function Qi(t,e,n,i){qi.call(this,t,e),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==i?i:1,this.shadow=new Yi(new Me(90,1,.5,500))}function Ki(t,e,n,i,r,o){we.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==t?t:-1,this.right=void 0!==e?e:1,this.top=void 0!==n?n:1,this.bottom=void 0!==i?i:-1,this.near=void 0!==r?r:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()}function $i(){Yi.call(this,new Ki(-5,5,5,-5,.5,500))}function tr(t,e){qi.call(this,t,e),this.type="DirectionalLight",this.position.copy(f.DefaultUp),this.updateMatrix(),this.target=new f,this.shadow=new $i}function er(t,e){qi.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function nr(t,e,n,i){qi.call(this,t,e),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==i?i:10}function ir(t){this.manager=void 0!==t?t:au,this.textures={}}function rr(){U.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function or(t,e,n,i){"number"==typeof n&&(i=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),b.call(this,t,e,n),this.meshPerAttribute=i||1}function ar(t){this.manager=void 0!==t?t:au}function sr(t){this.manager=void 0!==t?t:au,this.resourcePath=""}function cr(){this.type="ShapePath",this.color=new y,this.subPaths=[],this.currentPath=null}function hr(t){this.type="Font",this.data=t}function lr(t,e,n){for(var i=Array.from?Array.from(t):String(t).split(""),r=e/n.resolution,o=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*r,a=[],s=0,c=0,h=0;h<i.length;h++){var l=i[h];"\n"===l?(s=0,c-=o):(s+=(l=function(t,e,n,i,r){r=r.glyphs[t]||r.glyphs["?"];if(r){var o,a,s,c,h,l,u,d,p=new cr;if(r.o)for(var f=r._cachedOutline||(r._cachedOutline=r.o.split(" ")),m=0,v=f.length;m<v;)switch(f[m++]){case"m":o=f[m++]*e+n,a=f[m++]*e+i,p.moveTo(o,a);break;case"l":o=f[m++]*e+n,a=f[m++]*e+i,p.lineTo(o,a);break;case"q":s=f[m++]*e+n,c=f[m++]*e+i,h=f[m++]*e+n,l=f[m++]*e+i,p.quadraticCurveTo(h,l,s,c);break;case"b":s=f[m++]*e+n,c=f[m++]*e+i,h=f[m++]*e+n,l=f[m++]*e+i,u=f[m++]*e+n,d=f[m++]*e+i,p.bezierCurveTo(h,l,u,d,s,c)}return{offsetX:r.ha*e,path:p}}}(l,r,s,c,n)).offsetX,a.push(l.path))}return a}function ur(){}function dr(t){this.manager=void 0!==t?t:au}function pr(){this.coefficients=[];for(var t=0;t<9;t++)this.coefficients.push(new Mt)}function fr(t,e){qi.call(this,void 0,e),this.sh=void 0!==t?t:new pr}function mr(t,e,n){fr.call(this,void 0,n);var i=(new y).set(t),n=(new y).set(e),t=new Mt(i.r,i.g,i.b),e=new Mt(n.r,n.g,n.b),i=Math.sqrt(Math.PI),n=i*Math.sqrt(.75);this.sh.coefficients[0].copy(t).add(e).multiplyScalar(i),this.sh.coefficients[1].copy(t).sub(e).multiplyScalar(n)}function vr(t,e){fr.call(this,void 0,e);t=(new y).set(t);this.sh.coefficients[0].set(t.r,t.g,t.b).multiplyScalar(2*Math.sqrt(Math.PI))}function gr(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Me,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Me,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}function yr(t,e,n,i){f.call(this),this.type="CubeCamera";var o=new Me(90,1,t,e);o.up.set(0,-1,0),o.lookAt(new Mt(1,0,0)),this.add(o);var a=new Me(90,1,t,e);a.up.set(0,-1,0),a.lookAt(new Mt(-1,0,0)),this.add(a);var s=new Me(90,1,t,e);s.up.set(0,0,1),s.lookAt(new Mt(0,1,0)),this.add(s);var c=new Me(90,1,t,e);c.up.set(0,0,-1),c.lookAt(new Mt(0,-1,0)),this.add(c);var h=new Me(90,1,t,e);h.up.set(0,-1,0),h.lookAt(new Mt(0,0,1)),this.add(h);var l=new Me(90,1,t,e);l.up.set(0,-1,0),l.lookAt(new Mt(0,0,-1)),this.add(l),i=i||{format:Da,magFilter:ya,minFilter:ya},this.renderTarget=new u(n,n,i),this.renderTarget.texture.name="CubeCamera",this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();var n=t.getRenderTarget(),i=this.renderTarget,r=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0),t.render(e,o),t.setRenderTarget(i,1),t.render(e,a),t.setRenderTarget(i,2),t.render(e,s),t.setRenderTarget(i,3),t.render(e,c),t.setRenderTarget(i,4),t.render(e,h),i.texture.generateMipmaps=r,t.setRenderTarget(i,5),t.render(e,l),t.setRenderTarget(n)},this.clear=function(t,e,n,i){for(var r=t.getRenderTarget(),o=this.renderTarget,a=0;a<6;a++)t.setRenderTarget(o,a),t.clear(e,n,i);t.setRenderTarget(r)}}function xr(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function br(){f.call(this),this.type="AudioListener",this.context=Ou(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0}function wr(t){f.call(this),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.startTime=0,this.offset=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function Mr(t){wr.call(this,t),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function _r(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}function Er(t,e,n){this.binding=t,this.valueSize=n;var i,r=Float64Array;switch(e){case"quaternion":i=this._slerp;break;case"string":case"bool":r=Array,i=this._select;break;default:i=this._lerp}this.buffer=new r(4*n),this._mixBufferRegion=i,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}function Ar(t,e,n){n=n||Sr.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,n)}function Sr(t,e,n){this.path=e,this.parsedPath=n||Sr.parseTrackName(e),this.node=Sr.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function Tr(t,e,n){this._mixer=t,this._clip=e,this._localRoot=n||null;for(var i=e.tracks,r=i.length,o=new Array(r),a={endingStart:ls,endingEnd:ls},s=0;s!==r;++s){var c=i[s].createInterpolant(null);(o[s]=c).settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(r),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function Lr(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Rr(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function Cr(t,e,n){Pe.call(this,t,e),this.meshPerAttribute=n||1}function Pr(t,e,n,i){this.ray=new k(t,e),this.near=n||0,this.far=i||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function Ir(t,e){return t.distance-e.distance}function Or(t,e,n,i){if(!1!==t.visible&&(t.raycast(e,n),!0===i))for(var r=t.children,o=0,a=r.length;o<a;o++)Or(r[o],e,n,!0)}function Dr(t,e){this.min=void 0!==t?t:new wt(1/0,1/0),this.max=void 0!==e?e:new wt(-1/0,-1/0)}function Nr(t,e){this.start=void 0!==t?t:new Mt,this.end=void 0!==e?e:new Mt}function zr(t){f.call(this),this.material=t,this.render=function(){}}function Ur(t,e,n,i){this.object=t,this.size=void 0!==e?e:1;t=void 0!==n?n:16711680,e=void 0!==i?i:1,n=0,i=this.object.geometry;i&&i.isGeometry?n=3*i.faces.length:i&&i.isBufferGeometry&&(n=i.attributes.normal.count);i=new U,n=new z(2*n*3,3);i.addAttribute("position",n),Ge.call(this,i,new ke({color:t,linewidth:e})),this.matrixAutoUpdate=!1,this.update()}function Br(t,e){f.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;for(var t=new U,n=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1],i=0,r=1;i<32;i++,r++){var o=i/32*Math.PI*2,a=r/32*Math.PI*2;n.push(Math.cos(o),Math.sin(o),1,Math.cos(a),Math.sin(a),1)}t.addAttribute("position",new z(n,3));e=new ke({fog:!1});this.cone=new Ge(t,e),this.add(this.cone),this.update()}function kr(t){for(var e=function t(e){var n=[];e&&e.isBone&&n.push(e);for(var i=0;i<e.children.length;i++)n.push.apply(n,t(e.children[i]));return n}(t),n=new U,i=[],r=[],o=new y(0,0,1),a=new y(0,1,0),s=0;s<e.length;s++){var c=e[s];c.parent&&c.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),r.push(o.r,o.g,o.b),r.push(a.r,a.g,a.b))}n.addAttribute("position",new z(i,3)),n.addAttribute("color",new z(r,3));var h=new ke({vertexColors:2,depthTest:!1,depthWrite:!1,transparent:!0});Ge.call(this,n,h),this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}function Fr(t,e,n){this.light=t,this.light.updateMatrixWorld(),this.color=n;n=new Bn(e,4,2),e=new G({wireframe:!0,fog:!1});H.call(this,n,e),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function Gr(t,e){this.type="RectAreaLightHelper",this.light=t,this.color=e;t=new U;t.addAttribute("position",new z([1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),t.computeBoundingSphere();e=new ke({fog:!1});Fe.call(this,t,e);e=new U;e.addAttribute("position",new z([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),e.computeBoundingSphere(),this.add(new H(e,new G({side:go,fog:!1}))),this.update()}function Hr(t,e,n){f.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;n=new rn(e);n.rotateY(.5*Math.PI),this.material=new G({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=2);e=n.getAttribute("position"),e=new Float32Array(3*e.count);n.addAttribute("color",new b(e,3)),this.add(new H(n,this.material)),this.update()}function jr(t,e){this.lightProbe=t,this.size=e;t={GAMMA_OUTPUT:""},e=new B({defines:t,uniforms:{sh:{value:this.lightProbe.sh.coefficients},intensity:{value:this.lightProbe.intensity}},vertexShader:["varying vec3 vNormal;","void main() {","\tvNormal = normalize( normalMatrix * normal );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define RECIPROCAL_PI 0.318309886","vec3 inverseTransformDirection( in vec3 normal, in mat4 matrix ) {","\t// matrix is assumed to be orthogonal","\treturn normalize( ( vec4( normal, 0.0 ) * matrix ).xyz );","}","vec3 linearToOutput( in vec3 a ) {","\t#ifdef GAMMA_OUTPUT","\t\treturn pow( a, vec3( 1.0 / float( GAMMA_FACTOR ) ) );","\t#else","\t\treturn a;","\t#endif","}","// source: https://graphics.stanford.edu/papers/envmap/envmap.pdf","vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {","\t// normal is assumed to have unit length","\tfloat x = normal.x, y = normal.y, z = normal.z;","\t// band 0","\tvec3 result = shCoefficients[ 0 ] * 0.886227;","\t// band 1","\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;","\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;","\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;","\t// band 2","\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;","\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;","\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );","\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;","\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );","\treturn result;","}","uniform vec3 sh[ 9 ]; // sh coefficients","uniform float intensity; // light probe intensity","varying vec3 vNormal;","void main() {","\tvec3 normal = normalize( vNormal );","\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );","\tvec3 irradiance = shGetIrradianceAt( worldNormal, sh );","\tvec3 outgoingLight = RECIPROCAL_PI * irradiance * intensity;","\toutgoingLight = linearToOutput( outgoingLight );","\tgl_FragColor = vec4( outgoingLight, 1.0 );","}"].join("\n")}),t=new Bn(1,32,16);H.call(this,t,e),this.onBeforeRender()}function Vr(t,e,n,i){t=t||10,e=e||10,n=new y(void 0!==n?n:4473924),i=new y(void 0!==i?i:8947848);for(var r=e/2,o=t/e,a=t/2,s=[],c=[],h=0,l=0,u=-a;h<=e;h++,u+=o){s.push(-a,0,u,a,0,u),s.push(u,0,-a,u,0,a);var d=h===r?n:i;d.toArray(c,l),l+=3,d.toArray(c,l),l+=3,d.toArray(c,l),l+=3,d.toArray(c,l),l+=3}var p=new U;p.addAttribute("position",new z(s,3)),p.addAttribute("color",new z(c,3));t=new ke({vertexColors:2});Ge.call(this,p,t)}function Wr(t,e,n,i,r,o){t=t||10,e=e||16,n=n||8,i=i||64,r=new y(void 0!==r?r:4473924),o=new y(void 0!==o?o:8947848);for(var a,s,c,h,l,u,d=[],p=[],f=0;f<=e;f++)c=f/e*(2*Math.PI),a=Math.sin(c)*t,s=Math.cos(c)*t,d.push(0,0,0),d.push(a,0,s),u=1&f?r:o,p.push(u.r,u.g,u.b),p.push(u.r,u.g,u.b);for(f=0;f<=n;f++)for(u=1&f?r:o,l=t-t/n*f,h=0;h<i;h++)c=h/i*(2*Math.PI),a=Math.sin(c)*l,s=Math.cos(c)*l,d.push(a,0,s),p.push(u.r,u.g,u.b),c=(h+1)/i*(2*Math.PI),a=Math.sin(c)*l,s=Math.cos(c)*l,d.push(a,0,s),p.push(u.r,u.g,u.b);var m=new U;m.addAttribute("position",new z(d,3)),m.addAttribute("color",new z(p,3));var v=new ke({vertexColors:2});Ge.call(this,m,v)}function qr(t,e,n,i){this.audio=t,this.range=e||1,this.divisionsInnerAngle=n||16,this.divisionsOuterAngle=i||2;e=new U,n=this.divisionsInnerAngle+2*this.divisionsOuterAngle,i=new Float32Array(3*(3*n+3));e.addAttribute("position",new b(i,3));n=new ke({color:65280}),i=new ke({color:16776960});Fe.call(this,e,[i,n]),this.update()}function Xr(t,e,n,i){this.object=t,this.size=void 0!==e?e:1;t=void 0!==n?n:16776960,e=void 0!==i?i:1,n=0,i=this.object.geometry;i&&i.isGeometry?n=i.faces.length:console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");i=new U,n=new z(2*n*3,3);i.addAttribute("position",n),Ge.call(this,i,new ke({color:t,linewidth:e})),this.matrixAutoUpdate=!1,this.update()}function Yr(t,e,n){f.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===e&&(e=1);n=new U;n.addAttribute("position",new z([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));e=new ke({fog:!1});this.lightPlane=new Fe(n,e),this.add(this.lightPlane),(n=new U).addAttribute("position",new z([0,0,0,0,0,1],3)),this.targetLine=new Fe(n,e),this.add(this.targetLine),this.update()}function Zr(t){function e(t,e,n){i(t,n),i(e,n)}function i(t,e){o.push(0,0,0),a.push(e.r,e.g,e.b),void 0===s[t]&&(s[t]=[]),s[t].push(o.length/3-1)}var n=new U,r=new ke({color:16777215,vertexColors:1}),o=[],a=[],s={},c=new y(16755200),h=new y(16711680),l=new y(43775),u=new y(16777215),d=new y(3355443);e("n1","n2",c),e("n2","n4",c),e("n4","n3",c),e("n3","n1",c),e("f1","f2",c),e("f2","f4",c),e("f4","f3",c),e("f3","f1",c),e("n1","f1",c),e("n2","f2",c),e("n3","f3",c),e("n4","f4",c),e("p","n1",h),e("p","n2",h),e("p","n3",h),e("p","n4",h),e("u1","u2",l),e("u2","u3",l),e("u3","u1",l),e("c","t",u),e("p","c",d),e("cn1","cn2",d),e("cn3","cn4",d),e("cf1","cf2",d),e("cf3","cf4",d),n.addAttribute("position",new z(o,3)),n.addAttribute("color",new z(a,3)),Ge.call(this,n,r),this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update()}function Jr(t,e){this.object=t,void 0===e&&(e=16776960);var n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),t=new U;t.setIndex(new b(n,1)),t.addAttribute("position",new b(i,3)),Ge.call(this,t,new ke({color:e})),this.matrixAutoUpdate=!1,this.update()}function Qr(t,e){this.type="Box3Helper",this.box=t;var n=void 0!==e?e:16776960,t=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),e=new U;e.setIndex(new b(t,1)),e.addAttribute("position",new z([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),Ge.call(this,e,new ke({color:n})),this.geometry.computeBoundingSphere()}function Kr(t,e,n){this.type="PlaneHelper",this.plane=t,this.size=void 0===e?1:e;e=void 0!==n?n:16776960,n=new U;n.addAttribute("position",new z([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),n.computeBoundingSphere(),Fe.call(this,n,new ke({color:e}));n=new U;n.addAttribute("position",new z([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),n.computeBoundingSphere(),this.add(new H(n,new G({color:e,opacity:.2,transparent:!0,depthWrite:!1})))}function $r(t,e,n,i,r,o){f.call(this),void 0===t&&(t=new Mt(0,0,1)),void 0===e&&(e=new Mt(0,0,0)),void 0===n&&(n=1),void 0===i&&(i=16776960),void 0===r&&(r=.2*n),void 0===o&&(o=.2*r),void 0===yd&&((yd=new U).addAttribute("position",new z([0,0,0,0,1,0],3)),(xd=new Yn(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(e),this.line=new Fe(yd,new ke({color:i})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new H(xd,new G({color:i})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(n,r,o)}function to(t){var e=[0,0,0,t=t||1,0,0,0,0,0,0,t,0,0,0,0,0,0,t],t=new U;t.addAttribute("position",new z(e,3)),t.addAttribute("color",new z([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));e=new ke({vertexColors:2});Ge.call(this,t,e)}function eo(t){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),t}function no(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Ii.call(this,t),this.type="catmullrom"}n.d(e,"B",function(){return go}),n.d(e,"G",function(){return P}),n.d(e,"E",function(){return b}),n.d(e,"D",function(){return U}),n.d(e,"p",function(){return ou}),n.d(e,"A",function(){return Xe}),n.d(e,"g",function(){return Qn}),n.d(e,"z",function(){return y}),n.d(e,"t",function(){return V}),n.d(e,"f",function(){return yo}),n.d(e,"O",function(){return c}),n.d(e,"u",function(){return i}),n.d(e,"U",function(){return At}),n.d(e,"i",function(){return x}),n.d(e,"w",function(){return ya}),n.d(e,"L",function(){return ho}),n.d(e,"l",function(){return As}),n.d(e,"I",function(){return St}),n.d(e,"h",function(){return H}),n.d(e,"k",function(){return G}),n.d(e,"j",function(){return eo}),n.d(e,"e",function(){return ii}),n.d(e,"R",function(){return ma}),n.d(e,"a",function(){return f}),n.d(e,"N",function(){return Ki}),n.d(e,"M",function(){return Me}),n.d(e,"K",function(){return D}),n.d(e,"J",function(){return S}),n.d(e,"V",function(){return co}),n.d(e,"s",function(){return Na}),n.d(e,"r",function(){return Da}),n.d(e,"b",function(){return Pr}),n.d(e,"d",function(){return kn}),n.d(e,"P",function(){return Ce}),n.d(e,"F",function(){return Tc}),n.d(e,"H",function(){return B}),n.d(e,"m",function(){return Wi}),n.d(e,"n",function(){return jn}),n.d(e,"C",function(){return Bn}),n.d(e,"y",function(){return De}),n.d(e,"x",function(){return Oe}),n.d(e,"Q",function(){return gr}),n.d(e,"q",function(){return d}),n.d(e,"c",function(){return wt}),n.d(e,"o",function(){return Mt}),n.d(e,"v",function(){return We}),n.d(e,"S",function(){return I}),n.d(e,"T",function(){return Te}),void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:0<t?1:+t}),"name"in Function.prototype==0&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}),Object.assign(i.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)},removeEventListener:function(t,e){void 0!==this._listeners&&(void 0===(t=this._listeners[t])||-1!==(e=t.indexOf(e))&&t.splice(e,1))},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners[t.type];if(void 0!==e){t.target=this;for(var n=e.slice(0),i=0,r=n.length;i<r;i++)n[i].call(this,t)}}}});var io,ro,oo,ao,so,co="105",ho={LEFT:0,MIDDLE:1,RIGHT:2},lo=0,uo=1,po=2,fo=1,mo=2,vo=0,go=1,yo=2,xo=0,bo=0,wo=1,Mo=2,_o=3,Eo=4,Ao=5,So=100,To=101,Lo=102,Ro=103,Co=104,Po=200,Io=201,Oo=202,Do=203,No=204,zo=205,Uo=206,Bo=207,ko=208,Fo=209,Go=210,Ho=0,jo=1,Vo=2,Wo=3,qo=4,Xo=5,Yo=6,Zo=7,Jo=0,Qo=1,Ko=2,$o=0,ta=1,ea=2,na=3,ia=4,ra=5,oa=301,aa=302,sa=303,ca=304,ha=305,la=306,ua=307,da=1e3,pa=1001,fa=1002,ma=1003,va=1004,ga=1005,ya=1006,xa=1007,ba=1008,wa=1009,Ma=1010,_a=1011,Ea=1012,Aa=1013,Sa=1014,Ta=1015,La=1016,Ra=1017,Ca=1018,Pa=1019,Ia=1020,Oa=1021,Da=1022,Na=1023,za=1024,Ua=1025,Ba=1026,ka=1027,Fa=1028,Ga=33776,Ha=33777,ja=33778,Va=33779,Wa=35840,qa=35841,Xa=35842,Ya=35843,Za=36196,Ja=37808,Qa=37809,Ka=37810,$a=37811,ts=37812,es=37813,ns=37814,is=37815,rs=37816,os=37817,as=37818,ss=37819,cs=37820,hs=37821,ls=2400,us=0,ds=1,ps=2,fs=3e3,ms=3001,vs=3007,gs=3002,ys=3004,xs=3005,bs=3006,ws=3200,Ms=3201,_s=0,Es=1,As={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){for(var r=[],t=0;t<256;t++)r[t]=(t<16?"0":"")+t.toString(16);return function(){var t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(r[255&t]+r[t>>8&255]+r[t>>16&255]+r[t>>24&255]+"-"+r[255&e]+r[e>>8&255]+"-"+r[e>>16&15|64]+r[e>>24&255]+"-"+r[63&n|128]+r[n>>8&255]+"-"+r[n>>16&255]+r[n>>24&255]+r[255&i]+r[i>>8&255]+r[i>>16&255]+r[i>>24&255]).toUpperCase()}}(),clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)},lerp:function(t,e,n){return(1-n)*t+n*e},smoothstep:function(t,e,n){return t<=e?0:n<=t?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:n<=t?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*As.DEG2RAD},radToDeg:function(t){return t*As.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}};Object.defineProperties(wt.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(wt.prototype,{isVector2:!0,set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){var e=this.x,n=this.y,t=t.elements;return this.x=t[0]*e+t[3]*n+t[6],this.y=t[1]*e+t[4]*n+t[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,t=this.y-t.y;return e*e+t*t},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){var n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,e=this.y-t.y;return this.x=r*n-e*i+t.x,this.y=r*i+e*n+t.y,this}}),Object.assign(S,{slerp:function(t,e,n,i){return n.copy(t).slerp(e,i)},slerpFlat:function(t,e,n,i,r,o,a){var s=n[i+0],c=n[i+1],h=n[i+2],l=n[i+3],u=r[o+0],d=r[o+1],p=r[o+2],f=r[o+3];l===f&&s===u&&c===d&&h===p||(n=1-a,r=0<=(i=s*u+c*d+h*p+l*f)?1:-1,(o=1-i*i)>Number.EPSILON&&(o=Math.sqrt(o),i=Math.atan2(o,i*r),n=Math.sin(n*i)/o,a=Math.sin(a*i)/o),s=s*n+u*(r=a*r),c=c*n+d*r,h=h*n+p*r,l=l*n+f*r,n===1-a&&(s*=a=1/Math.sqrt(s*s+c*c+h*h+l*l),c*=a,h*=a,l*=a)),t[e]=s,t[e+1]=c,t[e+2]=h,t[e+3]=l}}),Object.defineProperties(S.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback()}}}),Object.assign(S.prototype,{isQuaternion:!0,set:function(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this.onChangeCallback(),this},setFromEuler:function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var n=t._x,i=t._y,r=t._z,o=t.order,a=Math.cos,s=Math.sin,c=a(n/2),t=a(i/2),a=a(r/2),n=s(n/2),i=s(i/2),r=s(r/2);return"XYZ"===o?(this._x=n*t*a+c*i*r,this._y=c*i*a-n*t*r,this._z=c*t*r+n*i*a,this._w=c*t*a-n*i*r):"YXZ"===o?(this._x=n*t*a+c*i*r,this._y=c*i*a-n*t*r,this._z=c*t*r-n*i*a,this._w=c*t*a+n*i*r):"ZXY"===o?(this._x=n*t*a-c*i*r,this._y=c*i*a+n*t*r,this._z=c*t*r+n*i*a,this._w=c*t*a-n*i*r):"ZYX"===o?(this._x=n*t*a-c*i*r,this._y=c*i*a+n*t*r,this._z=c*t*r-n*i*a,this._w=c*t*a+n*i*r):"YZX"===o?(this._x=n*t*a+c*i*r,this._y=c*i*a+n*t*r,this._z=c*t*r-n*i*a,this._w=c*t*a-n*i*r):"XZY"===o&&(this._x=n*t*a-c*i*r,this._y=c*i*a-n*t*r,this._z=c*t*r+n*i*a,this._w=c*t*a+n*i*r),!1!==e&&this.onChangeCallback(),this},setFromAxisAngle:function(t,e){var n=e/2,e=Math.sin(n);return this._x=t.x*e,this._y=t.y*e,this._z=t.z*e,this._w=Math.cos(n),this.onChangeCallback(),this},setFromRotationMatrix:function(t){var e,n=t.elements,i=n[0],r=n[4],o=n[8],a=n[1],s=n[5],c=n[9],h=n[2],l=n[6],t=n[10],n=i+s+t;return 0<n?(e=.5/Math.sqrt(n+1),this._w=.25/e,this._x=(l-c)*e,this._y=(o-h)*e,this._z=(a-r)*e):s<i&&t<i?(e=2*Math.sqrt(1+i-s-t),this._w=(l-c)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(o+h)/e):t<s?(e=2*Math.sqrt(1+s-i-t),this._w=(o-h)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(c+l)/e):(e=2*Math.sqrt(1+t-i-s),this._w=(a-r)/e,this._x=(o+h)/e,this._y=(c+l)/e,this._z=.25*e),this.onChangeCallback(),this},setFromUnitVectors:function(t,e){var n=t.dot(e)+1;return n<1e-6?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0):(this._x=0,this._y=-t.z,this._z=t.y)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x),this._w=n,this.normalize()},angleTo:function(t){return 2*Math.acos(Math.abs(As.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,e){var n=this.angleTo(t);if(0===n)return this;n=Math.min(1,e/n);return this.slerp(t,n),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this.onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var n=t._x,i=t._y,r=t._z,o=t._w,a=e._x,s=e._y,t=e._z,e=e._w;return this._x=n*e+o*a+i*t-r*s,this._y=i*e+o*s+r*a-n*t,this._z=r*e+o*t+n*s-i*a,this._w=o*e-n*a-i*s-r*t,this.onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var n=this._x,i=this._y,r=this._z,o=this._w,a=o*t._w+n*t._x+i*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),1<=a)return this._w=o,this._x=n,this._y=i,this._z=r,this;t=1-a*a;if(t<=Number.EPSILON){var s=1-e;return this._w=s*o+e*this._w,this._x=s*n+e*this._x,this._y=s*i+e*this._y,this._z=s*r+e*this._z,this.normalize()}s=Math.sqrt(t),t=Math.atan2(s,a),a=Math.sin((1-e)*t)/s,s=Math.sin(e*t)/s;return this._w=o*a+this._w*s,this._x=n*a+this._x*s,this._y=i*a+this._y*s,this._z=r*a+this._z*s,this.onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(Mt.prototype,{isVector3:!0,set:function(t,e,n){return this.x=t,this.y=e,this.z=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:(so=new S,function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(so.setFromEuler(t))}),applyAxisAngle:(ao=new S,function(t,e){return this.applyQuaternion(ao.setFromAxisAngle(t,e))}),applyMatrix3:function(t){var e=this.x,n=this.y,i=this.z,t=t.elements;return this.x=t[0]*e+t[3]*n+t[6]*i,this.y=t[1]*e+t[4]*n+t[7]*i,this.z=t[2]*e+t[5]*n+t[8]*i,this},applyMatrix4:function(t){var e=this.x,n=this.y,i=this.z,r=t.elements,t=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*t,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*t,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*t,this},applyQuaternion:function(t){var e=this.x,n=this.y,i=this.z,r=t.x,o=t.y,a=t.z,s=t.w,c=s*e+o*i-a*n,h=s*n+a*e-r*i,t=s*i+r*n-o*e,i=-r*e-o*n-a*i;return this.x=c*s+i*-r+h*-a-t*-o,this.y=h*s+i*-o+t*-r-c*-a,this.z=t*s+i*-a+c*-o-h*-r,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)},transformDirection:function(t){var e=this.x,n=this.y,i=this.z,t=t.elements;return this.x=t[0]*e+t[4]*n+t[8]*i,this.y=t[1]*e+t[5]*n+t[9]*i,this.z=t[2]*e+t[6]*n+t[10]*i,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},cross:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)},crossVectors:function(t,e){var n=t.x,i=t.y,r=t.z,o=e.x,t=e.y,e=e.z;return this.x=i*e-r*t,this.y=r*o-n*e,this.z=n*t-i*o,this},projectOnVector:function(t){var e=t.dot(this)/t.lengthSq();return this.copy(t).multiplyScalar(e)},projectOnPlane:(oo=new Mt,function(t){return oo.copy(this).projectOnVector(t),this.sub(oo)}),reflect:(ro=new Mt,function(t){return this.sub(ro.copy(t).multiplyScalar(2*this.dot(t)))}),angleTo:function(t){t=this.dot(t)/Math.sqrt(this.lengthSq()*t.lengthSq());return Math.acos(As.clamp(t,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y,t=this.z-t.z;return e*e+n*n+t*t},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},setFromSphericalCoords:function(t,e,n){var i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this},setFromMatrixPosition:function(t){t=t.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),t=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=t,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}}),Object.assign(T.prototype,{isMatrix3:!0,set:function(t,e,n,i,r,o,a,s,c){var h=this.elements;return h[0]=t,h[1]=i,h[2]=a,h[3]=e,h[4]=r,h[5]=s,h[6]=n,h[7]=o,h[8]=c,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var e=this.elements,t=t.elements;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},setFromMatrix4:function(t){t=t.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},applyToBufferAttribute:(io=new Mt,function(t){for(var e=0,n=t.count;e<n;e++)io.x=t.getX(e),io.y=t.getY(e),io.z=t.getZ(e),io.applyMatrix3(this),t.setXYZ(e,io.x,io.y,io.z);return t}),multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,i=e.elements,r=this.elements,o=n[0],a=n[3],s=n[6],c=n[1],h=n[4],l=n[7],u=n[2],d=n[5],p=n[8],f=i[0],m=i[3],v=i[6],g=i[1],y=i[4],t=i[7],e=i[2],n=i[5],i=i[8];return r[0]=o*f+a*g+s*e,r[3]=o*m+a*y+s*n,r[6]=o*v+a*t+s*i,r[1]=c*f+h*g+l*e,r[4]=c*m+h*y+l*n,r[7]=c*v+h*t+l*i,r[2]=u*f+d*g+p*e,r[5]=u*m+d*y+p*n,r[8]=u*v+d*t+p*i,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],a=t[5],s=t[6],c=t[7],t=t[8];return e*o*t-e*a*c-n*r*t+n*a*s+i*r*c-i*o*s},getInverse:function(t,e){t&&t.isMatrix4&&console.error("THREE.Matrix3: .getInverse() no longer takes a Matrix4 argument.");var n=t.elements,i=this.elements,r=n[0],o=n[1],a=n[2],s=n[3],c=n[4],h=n[5],l=n[6],u=n[7],d=n[8],p=d*c-h*u,f=h*l-d*s,m=u*s-c*l,t=r*p+o*f+a*m;if(0==t){n="THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(n);return console.warn(n),this.identity()}t=1/t;return i[0]=p*t,i[1]=(a*u-d*o)*t,i[2]=(h*o-a*c)*t,i[3]=f*t,i[4]=(d*r-a*l)*t,i[5]=(a*s-h*r)*t,i[6]=m*t,i[7]=(o*l-u*r)*t,i[8]=(c*r-o*s)*t,this},transpose:function(){var t=this.elements,e=t[1];return t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},setUvTransform:function(t,e,n,i,r,o,a){var s=Math.cos(r),r=Math.sin(r);this.set(n*s,n*r,-n*(s*o+r*a)+o+t,-i*r,i*s,-i*(-r*o+s*a)+a+e,0,0,1)},scale:function(t,e){var n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this},rotate:function(t){var e=Math.cos(t),n=Math.sin(t),i=this.elements,r=i[0],o=i[3],a=i[6],s=i[1],c=i[4],t=i[7];return i[0]=e*r+n*s,i[3]=e*o+n*c,i[6]=e*a+n*t,i[1]=-n*r+e*s,i[4]=-n*o+e*c,i[7]=-n*a+e*t,this},translate:function(t,e){var n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this},equals:function(t){for(var e=this.elements,n=t.elements,i=0;i<9;i++)if(e[i]!==n[i])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<9;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}});var Ss,Ts,Ls,Rs,Cs,Ps,Is,Os,Ds,Ns,zs,Us,Bs,ks,Fs,Gs,Hs,js,Vs,Ws,qs,Xs,Ys,Zs,Js,Qs,Ks,$s,tc,ec,nc,ic,rc,oc,ac,sc,cc,hc,lc,uc,dc={getDataURL:function(t){var e;return"undefined"==typeof HTMLCanvasElement?t.src:2048<(t=t instanceof HTMLCanvasElement?t:(void 0===Ss&&(Ss=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Ss.width=t.width,Ss.height=t.height,e=Ss.getContext("2d"),t instanceof ImageData?e.putImageData(t,0,0):e.drawImage(t,0,0,t.width,t.height),Ss)).width||2048<t.height?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}},pc=0;function fc(t){for(var e=0,n=t.length-3;e<=n;e+=3){tc.fromArray(t,e);var i=nc.x*Math.abs(tc.x)+nc.y*Math.abs(tc.y)+nc.z*Math.abs(tc.z),r=Ys.dot(tc),o=Zs.dot(tc),a=Js.dot(tc);if(Math.max(-Math.max(r,o,a),Math.min(r,o,a))>i)return!1}return!0}function mc(t){var e=t.geometry;if(void 0!==e)if(e.isGeometry){var n=e.vertices;for(ac=0,sc=n.length;ac<sc;ac++)cc.copy(n[ac]),cc.applyMatrix4(t.matrixWorld),oc.expandByPoint(cc)}else if(e.isBufferGeometry){var i=e.attributes.position;if(void 0!==i)for(ac=0,sc=i.count;ac<sc;ac++)cc.fromBufferAttribute(i,ac).applyMatrix4(t.matrixWorld),oc.expandByPoint(cc)}}d.DEFAULT_IMAGE=void 0,d.DEFAULT_MAPPING=300,d.prototype=Object.assign(Object.create(i.prototype),{constructor:d,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];var n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var i,r=this.image;if(void 0===r.uuid&&(r.uuid=As.generateUUID()),!e&&void 0===t.images[r.uuid]){if(Array.isArray(r)){i=[];for(var o=0,a=r.length;o<a;o++)i.push(dc.getDataURL(r[o]))}else i=dc.getDataURL(r);t.images[r.uuid]={uuid:r.uuid,url:i}}n.image=r.uuid}return e||(t.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||1<t.x)switch(this.wrapS){case da:t.x=t.x-Math.floor(t.x);break;case pa:t.x=t.x<0?0:1;break;case fa:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||1<t.y)switch(this.wrapT){case da:t.y=t.y-Math.floor(t.y);break;case pa:t.y=t.y<0?0:1;break;case fa:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(d.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(_t.prototype,{isVector4:!0,set:function(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var e=this.x,n=this.y,i=this.z,r=this.w,t=t.elements;return this.x=t[0]*e+t[4]*n+t[8]*i+t[12]*r,this.y=t[1]*e+t[5]*n+t[9]*i+t[13]*r,this.z=t[2]*e+t[6]*n+t[10]*i+t[14]*r,this.w=t[3]*e+t[7]*n+t[11]*i+t[15]*r,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,n,i,r=t.elements,o=r[0],a=r[4],s=r[8],c=r[1],h=r[5],l=r[9],u=r[2],d=r[6],p=r[10];if(Math.abs(a-c)<.01&&Math.abs(s-u)<.01&&Math.abs(l-d)<.01){if(Math.abs(a+c)<.1&&Math.abs(s+u)<.1&&Math.abs(l+d)<.1&&Math.abs(o+h+p-3)<.1)return this.set(1,0,0,0),this;y=Math.PI;var f=(o+1)/2,m=(h+1)/2,v=(p+1)/2,g=(a+c)/4,t=(s+u)/4,r=(l+d)/4;return m<f&&v<f?i=f<.01?(e=0,n=.707106781):(n=g/(e=Math.sqrt(f)),t/e):v<m?i=m<.01?(n=0,e=.707106781):(e=g/(n=Math.sqrt(m)),r/n):v<.01?(n=e=.707106781,i=0):(e=t/(i=Math.sqrt(v)),n=r/i),this.set(e,n,i,y),this}var y=Math.sqrt((d-l)*(d-l)+(s-u)*(s-u)+(c-a)*(c-a));return Math.abs(y)<.001&&(y=1),this.x=(d-l)/y,this.y=(s-u)/y,this.z=(c-a)/y,this.w=Math.acos((o+h+p-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(t,e){return void 0===lc&&(lc=new _t,uc=new _t),lc.set(t,t,t,t),uc.set(e,e,e,e),this.clamp(lc,uc)},clampLength:function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,n){return this.subVectors(e,t).multiplyScalar(n).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}}),I.prototype=Object.assign(Object.create(i.prototype),{constructor:I,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),r.prototype=Object.assign(Object.create(I.prototype),{constructor:r,isWebGLMultisampleRenderTarget:!0,copy:function(t){return I.prototype.copy.call(this,t),this.samples=t.samples,this}}),((u.prototype=Object.create(I.prototype)).constructor=u).prototype.isWebGLRenderTargetCube=!0,((Et.prototype=Object.create(d.prototype)).constructor=Et).prototype.isDataTexture=!0,Object.assign(o.prototype,{isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=1/0,n=1/0,i=1/0,r=-1/0,o=-1/0,a=-1/0,s=0,c=t.length;s<c;s+=3){var h=t[s],l=t[s+1],u=t[s+2];h<e&&(e=h),l<n&&(n=l),u<i&&(i=u),r<h&&(r=h),o<l&&(o=l),a<u&&(a=u)}return this.min.set(e,n,i),this.max.set(r,o,a),this},setFromBufferAttribute:function(t){for(var e=1/0,n=1/0,i=1/0,r=-1/0,o=-1/0,a=-1/0,s=0,c=t.count;s<c;s++){var h=t.getX(s),l=t.getY(s),u=t.getZ(s);h<e&&(e=h),l<n&&(n=l),u<i&&(i=u),r<h&&(r=h),o<l&&(o=l),a<u&&(a=u)}return this.min.set(e,n,i),this.max.set(r,o,a),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:(hc=new Mt,function(t,e){e=hc.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(e),this.max.copy(t).add(e),this}),setFromObject:function(t){return this.makeEmpty(),this.expandByObject(t)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box3: .getCenter() target is now required"),t=new Mt),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box3: .getSize() target is now required"),t=new Mt),this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},expandByObject:(cc=new Mt,function(t){return oc=this,t.updateMatrixWorld(!0),t.traverse(mc),this}),containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new Mt),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere:(rc=new Mt,function(t){return this.clampPoint(t.center,rc),rc.distanceToSquared(t.center)<=t.radius*t.radius}),intersectsPlane:function(t){var e,n=0<t.normal.x?(e=t.normal.x*this.min.x,t.normal.x*this.max.x):(e=t.normal.x*this.max.x,t.normal.x*this.min.x);return 0<t.normal.y?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),0<t.normal.z?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant},intersectsTriangle:(Ys=new Mt,Zs=new Mt,Js=new Mt,Qs=new Mt,Ks=new Mt,$s=new Mt,tc=new Mt,ec=new Mt,nc=new Mt,ic=new Mt,function(t){if(this.isEmpty())return!1;this.getCenter(ec),nc.subVectors(this.max,ec),Ys.subVectors(t.a,ec),Zs.subVectors(t.b,ec),Js.subVectors(t.c,ec),Qs.subVectors(Zs,Ys),Ks.subVectors(Js,Zs),$s.subVectors(Ys,Js);t=[0,-Qs.z,Qs.y,0,-Ks.z,Ks.y,0,-$s.z,$s.y,Qs.z,0,-Qs.x,Ks.z,0,-Ks.x,$s.z,0,-$s.x,-Qs.y,Qs.x,0,-Ks.y,Ks.x,0,-$s.y,$s.x,0];return!!fc(t)&&(!!fc(t=[1,0,0,0,1,0,0,0,1])&&(ic.crossVectors(Qs,Ks),fc(t=[ic.x,ic.y,ic.z])))}),clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new Mt),e.copy(t).clamp(this.min,this.max)},distanceToPoint:(Xs=new Mt,function(t){return Xs.copy(t).clamp(this.min,this.max).sub(t).length()}),getBoundingSphere:(qs=new Mt,function(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(qs).length(),t}),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:(Ws=[new Mt,new Mt,new Mt,new Mt,new Mt,new Mt,new Mt,new Mt],function(t){return this.isEmpty()||(Ws[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Ws[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Ws[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Ws[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Ws[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Ws[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Ws[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Ws[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Ws)),this}),translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}),Object.assign(g.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:(Vs=new o,function(t,e){var n=this.center;void 0!==e?n.copy(e):Vs.setFromPoints(t).getCenter(n);for(var i=0,r=0,o=t.length;r<o;r++)i=Math.max(i,n.distanceToSquared(t[r]));return this.radius=Math.sqrt(i),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,e){var n=this.center.distanceToSquared(t);return void 0===e&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),e=new Mt),e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},getBoundingBox:function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new o),t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}}),Object.assign(a.prototype,{set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:(Hs=new Mt,js=new Mt,function(t,e,n){e=Hs.subVectors(n,e).cross(js.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(e,t),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return void 0===e&&(console.warn("THREE.Plane: .projectPoint() target is now required"),e=new Mt),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:(Gs=new Mt,function(t,e){void 0===e&&(console.warn("THREE.Plane: .intersectLine() target is now required"),e=new Mt);var n=t.delta(Gs),i=this.normal.dot(n);if(0!==i){i=-(t.start.dot(this.normal)+this.constant)/i;if(!(i<0||1<i))return e.copy(n).multiplyScalar(i).add(t.start)}else if(0===this.distanceToPoint(t.start))return e.copy(t.start)}),intersectsLine:function(t){var e=this.distanceToPoint(t.start),t=this.distanceToPoint(t.end);return e<0&&0<t||t<0&&0<e},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new Mt),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:(ks=new Mt,Fs=new T,function(t,e){e=e||Fs.getNormalMatrix(t),t=this.coplanarPoint(ks).applyMatrix4(t),e=this.normal.applyMatrix3(e).normalize();return this.constant=-t.dot(e),this}),translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}}),Object.assign(At.prototype,{set:function(t,e,n,i,r,o){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(n),a[3].copy(i),a[4].copy(r),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,n=0;n<6;n++)e[n].copy(t.planes[n]);return this},setFromMatrix:function(t){var e=this.planes,n=t.elements,i=n[0],r=n[1],o=n[2],a=n[3],s=n[4],c=n[5],h=n[6],l=n[7],u=n[8],d=n[9],p=n[10],f=n[11],m=n[12],v=n[13],t=n[14],n=n[15];return e[0].setComponents(a-i,l-s,f-u,n-m).normalize(),e[1].setComponents(a+i,l+s,f+u,n+m).normalize(),e[2].setComponents(a+r,l+c,f+d,n+v).normalize(),e[3].setComponents(a-r,l-c,f-d,n-v).normalize(),e[4].setComponents(a-o,l-h,f-p,n-t).normalize(),e[5].setComponents(a+o,l+h,f+p,n+t).normalize(),this},intersectsObject:(Bs=new g,function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),Bs.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Bs)}),intersectsSprite:(Us=new g,function(t){return Us.center.set(0,0,0),Us.radius=.7071067811865476,Us.applyMatrix4(t.matrixWorld),this.intersectsSphere(Us)}),intersectsSphere:function(t){for(var e=this.planes,n=t.center,i=-t.radius,r=0;r<6;r++)if(e[r].distanceToPoint(n)<i)return!1;return!0},intersectsBox:(zs=new Mt,function(t){for(var e=this.planes,n=0;n<6;n++){var i=e[n];if(zs.x=(0<i.normal.x?t.max:t.min).x,zs.y=(0<i.normal.y?t.max:t.min).y,zs.z=(0<i.normal.z?t.max:t.min).z,i.distanceToPoint(zs)<0)return!1}return!0}),containsPoint:function(t){for(var e=this.planes,n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}}),Object.assign(St.prototype,{isMatrix4:!0,set:function(t,e,n,i,r,o,a,s,c,h,l,u,d,p,f,m){var v=this.elements;return v[0]=t,v[4]=e,v[8]=n,v[12]=i,v[1]=r,v[5]=o,v[9]=a,v[13]=s,v[2]=c,v[6]=h,v[10]=l,v[14]=u,v[3]=d,v[7]=p,v[11]=f,v[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new St).fromArray(this.elements)},copy:function(t){var e=this.elements,t=t.elements;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this},copyPosition:function(t){var e=this.elements,t=t.elements;return e[12]=t[12],e[13]=t[13],e[14]=t[14],this},extractBasis:function(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this},extractRotation:(Ns=new Mt,function(t){var e=this.elements,n=t.elements,i=1/Ns.setFromMatrixColumn(t,0).length(),r=1/Ns.setFromMatrixColumn(t,1).length(),t=1/Ns.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*t,e[9]=n[9]*t,e[10]=n[10]*t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}),makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e,n,i,r,o,a,s,c,h,l,u,d,p=this.elements,f=t.x,m=t.y,v=t.z,g=Math.cos(f),y=Math.sin(f),x=Math.cos(m),f=Math.sin(m),m=Math.cos(v),v=Math.sin(v);return"XYZ"===t.order?(o=g*m,a=g*v,s=y*m,c=y*v,p[0]=x*m,p[4]=-x*v,p[8]=f,p[1]=a+s*f,p[5]=o-c*f,p[9]=-y*x,p[2]=c-o*f,p[6]=s+a*f,p[10]=g*x):"YXZ"===t.order?(e=x*m,n=x*v,i=f*m,r=f*v,p[0]=e+r*y,p[4]=i*y-n,p[8]=g*f,p[1]=g*v,p[5]=g*m,p[9]=-y,p[2]=n*y-i,p[6]=r+e*y,p[10]=g*x):"ZXY"===t.order?(e=x*m,n=x*v,i=f*m,r=f*v,p[0]=e-r*y,p[4]=-g*v,p[8]=i+n*y,p[1]=n+i*y,p[5]=g*m,p[9]=r-e*y,p[2]=-g*f,p[6]=y,p[10]=g*x):"ZYX"===t.order?(o=g*m,a=g*v,s=y*m,c=y*v,p[0]=x*m,p[4]=s*f-a,p[8]=o*f+c,p[1]=x*v,p[5]=c*f+o,p[9]=a*f-s,p[2]=-f,p[6]=y*x,p[10]=g*x):"YZX"===t.order?(h=g*x,l=g*f,u=y*x,d=y*f,p[0]=x*m,p[4]=d-h*v,p[8]=u*v+l,p[1]=v,p[5]=g*m,p[9]=-y*m,p[2]=-f*m,p[6]=l*v+u,p[10]=h-d*v):"XZY"===t.order&&(h=g*x,l=g*f,u=y*x,d=y*f,p[0]=x*m,p[4]=-v,p[8]=f*m,p[1]=h*v+d,p[5]=g*m,p[9]=l*v-u,p[2]=u*v-l,p[6]=y*m,p[10]=d*v+h),p[3]=0,p[7]=0,p[11]=0,p[12]=0,p[13]=0,p[14]=0,p[15]=1,this},makeRotationFromQuaternion:(Os=new Mt(0,0,0),Ds=new Mt(1,1,1),function(t){return this.compose(Os,t,Ds)}),lookAt:(Cs=new Mt,Ps=new Mt,Is=new Mt,function(t,e,n){var i=this.elements;return Is.subVectors(t,e),0===Is.lengthSq()&&(Is.z=1),Is.normalize(),Cs.crossVectors(n,Is),0===Cs.lengthSq()&&(1===Math.abs(n.z)?Is.x+=1e-4:Is.z+=1e-4,Is.normalize(),Cs.crossVectors(n,Is)),Cs.normalize(),Ps.crossVectors(Is,Cs),i[0]=Cs.x,i[4]=Ps.x,i[8]=Is.x,i[1]=Cs.y,i[5]=Ps.y,i[9]=Is.y,i[2]=Cs.z,i[6]=Ps.z,i[10]=Is.z,this}),multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var n=t.elements,i=e.elements,r=this.elements,o=n[0],a=n[4],s=n[8],c=n[12],h=n[1],l=n[5],u=n[9],d=n[13],p=n[2],f=n[6],m=n[10],v=n[14],g=n[3],y=n[7],x=n[11],b=n[15],w=i[0],M=i[4],_=i[8],E=i[12],A=i[1],S=i[5],T=i[9],L=i[13],R=i[2],C=i[6],P=i[10],I=i[14],t=i[3],e=i[7],n=i[11],i=i[15];return r[0]=o*w+a*A+s*R+c*t,r[4]=o*M+a*S+s*C+c*e,r[8]=o*_+a*T+s*P+c*n,r[12]=o*E+a*L+s*I+c*i,r[1]=h*w+l*A+u*R+d*t,r[5]=h*M+l*S+u*C+d*e,r[9]=h*_+l*T+u*P+d*n,r[13]=h*E+l*L+u*I+d*i,r[2]=p*w+f*A+m*R+v*t,r[6]=p*M+f*S+m*C+v*e,r[10]=p*_+f*T+m*P+v*n,r[14]=p*E+f*L+m*I+v*i,r[3]=g*w+y*A+x*R+b*t,r[7]=g*M+y*S+x*C+b*e,r[11]=g*_+y*T+x*P+b*n,r[15]=g*E+y*L+x*I+b*i,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},applyToBufferAttribute:(Rs=new Mt,function(t){for(var e=0,n=t.count;e<n;e++)Rs.x=t.getX(e),Rs.y=t.getY(e),Rs.z=t.getZ(e),Rs.applyMatrix4(this),t.setXYZ(e,Rs.x,Rs.y,Rs.z);return t}),determinant:function(){var t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],o=t[1],a=t[5],s=t[9],c=t[13],h=t[2],l=t[6],u=t[10],d=t[14];return t[3]*(+r*s*l-i*c*l-r*a*u+n*c*u+i*a*d-n*s*d)+t[7]*(+e*s*d-e*c*u+r*o*u-i*o*d+i*c*h-r*s*h)+t[11]*(+e*c*l-e*a*d-r*o*l+n*o*d+r*a*h-n*c*h)+t[15]*(-i*a*h-e*s*l+e*a*u+i*o*l-n*o*u+n*s*h)},transpose:function(){var t=this.elements,e=t[1];return t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},setPosition:function(t,e,n){var i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this},getInverse:function(t,e){var n=this.elements,i=t.elements,r=i[0],o=i[1],a=i[2],s=i[3],c=i[4],h=i[5],l=i[6],u=i[7],d=i[8],p=i[9],f=i[10],m=i[11],v=i[12],g=i[13],y=i[14],x=i[15],b=p*y*u-g*f*u+g*l*m-h*y*m-p*l*x+h*f*x,w=v*f*u-d*y*u-v*l*m+c*y*m+d*l*x-c*f*x,M=d*g*u-v*p*u+v*h*m-c*g*m-d*h*x+c*p*x,_=v*p*l-d*g*l-v*h*f+c*g*f+d*h*y-c*p*y,t=r*b+o*w+a*M+s*_;if(0==t){i="THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0";if(!0===e)throw new Error(i);return console.warn(i),this.identity()}t=1/t;return n[0]=b*t,n[1]=(g*f*s-p*y*s-g*a*m+o*y*m+p*a*x-o*f*x)*t,n[2]=(h*y*s-g*l*s+g*a*u-o*y*u-h*a*x+o*l*x)*t,n[3]=(p*l*s-h*f*s-p*a*u+o*f*u+h*a*m-o*l*m)*t,n[4]=w*t,n[5]=(d*y*s-v*f*s+v*a*m-r*y*m-d*a*x+r*f*x)*t,n[6]=(v*l*s-c*y*s-v*a*u+r*y*u+c*a*x-r*l*x)*t,n[7]=(c*f*s-d*l*s+d*a*u-r*f*u-c*a*m+r*l*m)*t,n[8]=M*t,n[9]=(v*p*s-d*g*s-v*o*m+r*g*m+d*o*x-r*p*x)*t,n[10]=(c*g*s-v*h*s+v*o*u-r*g*u-c*o*x+r*h*x)*t,n[11]=(d*h*s-c*p*s-d*o*u+r*p*u+c*o*m-r*h*m)*t,n[12]=_*t,n[13]=(d*g*a-v*p*a+v*o*f-r*g*f-d*o*y+r*p*y)*t,n[14]=(v*h*a-c*g*a-v*o*l+r*g*l+c*o*y-r*h*y)*t,n[15]=(c*p*a-d*h*a+d*o*l-r*p*l-c*o*f+r*h*f)*t,this},scale:function(t){var e=this.elements,n=t.x,i=t.y,t=t.z;return e[0]*=n,e[4]*=i,e[8]*=t,e[1]*=n,e[5]*=i,e[9]*=t,e[2]*=n,e[6]*=i,e[10]*=t,e[3]*=n,e[7]*=i,e[11]*=t,this},getMaxScaleOnAxis:function(){var t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],t=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,t))},makeTranslation:function(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t),t=Math.sin(t);return this.set(1,0,0,0,0,e,-t,0,0,t,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t),t=Math.sin(t);return this.set(e,0,t,0,0,1,0,0,-t,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t),t=Math.sin(t);return this.set(e,-t,0,0,t,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var n=Math.cos(e),i=Math.sin(e),r=1-n,o=t.x,a=t.y,s=t.z,e=r*o,t=r*a;return this.set(e*o+n,e*a-i*s,e*s+i*a,0,e*a+i*s,t*a+n,t*s-i*o,0,e*s-i*a,t*s+i*o,r*s*s+n,0,0,0,0,1),this},makeScale:function(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(t,e,n){return this.set(1,e,n,0,t,1,n,0,t,e,1,0,0,0,0,1),this},compose:function(t,e,n){var i=this.elements,r=e._x,o=e._y,a=e._z,s=e._w,c=r+r,h=o+o,l=a+a,u=r*c,d=r*h,p=r*l,e=o*h,r=o*l,o=a*l,a=s*c,c=s*h,h=s*l,s=n.x,l=n.y,n=n.z;return i[0]=(1-(e+o))*s,i[1]=(d+h)*s,i[2]=(p-c)*s,i[3]=0,i[4]=(d-h)*l,i[5]=(1-(u+o))*l,i[6]=(r+a)*l,i[7]=0,i[8]=(p+c)*n,i[9]=(r-a)*n,i[10]=(1-(u+e))*n,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this},decompose:(Ts=new Mt,Ls=new St,function(t,e,n){var i=this.elements,r=Ts.set(i[0],i[1],i[2]).length(),o=Ts.set(i[4],i[5],i[6]).length(),a=Ts.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],Ls.copy(this);var s=1/r,t=1/o,i=1/a;return Ls.elements[0]*=s,Ls.elements[1]*=s,Ls.elements[2]*=s,Ls.elements[4]*=t,Ls.elements[5]*=t,Ls.elements[6]*=t,Ls.elements[8]*=i,Ls.elements[9]*=i,Ls.elements[10]*=i,e.setFromRotationMatrix(Ls),n.x=r,n.y=o,n.z=a,this}),makePerspective:function(t,e,n,i,r,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");var a=this.elements,s=2*r/(e-t),c=2*r/(n-i),t=(e+t)/(e-t),n=(n+i)/(n-i),i=-(o+r)/(o-r),r=-2*o*r/(o-r);return a[0]=s,a[4]=0,a[8]=t,a[12]=0,a[1]=0,a[5]=c,a[9]=n,a[13]=0,a[2]=0,a[6]=0,a[10]=i,a[14]=r,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makeOrthographic:function(t,e,n,i,r,o){var a=this.elements,s=1/(e-t),c=1/(n-i),h=1/(o-r),t=(e+t)*s,i=(n+i)*c,r=(o+r)*h;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-t,a[1]=0,a[5]=2*c,a[9]=0,a[13]=-i,a[2]=0,a[6]=0,a[10]=-2*h,a[14]=-r,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},equals:function(t){for(var e=this.elements,n=t.elements,i=0;i<16;i++)if(e[i]!==n[i])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var n=0;n<16;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}});var vc,gc,yc,xc={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\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\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\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}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\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 dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\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.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - 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 * transposeMat3( 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\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( 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\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\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}",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\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\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",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",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 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\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( sampler2D envMap, 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",defaultnormal_vertex:"vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = normalMatrix * objectTangent;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",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.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\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.a );\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.a );\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.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, 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.r, 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 = cLogLuvM * value.rgb;\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 = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\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",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\tuniform int maxMipLevel;\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",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",envmap_physical_pars_fragment:"#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( envMap, 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( envMap, 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",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",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",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",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",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",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif",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 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\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\t#pragma unroll_loop\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\t#pragma unroll_loop\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\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif",lights_pars_begin:"uniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\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 ltc_1;\tuniform sampler2D ltc_2;\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",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",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)",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",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\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3(    0, 1,    0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), 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\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#endif\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, 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\tfloat clearCoatInv = 1.0 - clearCoatDHR;\n\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec3 singleScattering = vec3( 0.0 );\n\t\tvec3 multiScattering = vec3( 0.0 );\n\t\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\t\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\t\treflectedLight.indirectSpecular += clearCoatInv * radiance * singleScattering;\n\t\treflectedLight.indirectDiffuse += multiScattering * cosineWeightedIrradiance;\n\t\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n\t#else\n\t\treflectedLight.indirectSpecular += clearCoatInv * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#endif\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}",lights_fragment_begin:"\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\t#pragma unroll_loop\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\t#pragma unroll_loop\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\t#pragma unroll_loop\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\t#pragma unroll_loop\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\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\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#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearCoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\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 defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), maxMipLevel );\n\t#ifndef STANDARD\n\t\tclearCoatRadiance += getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, irradiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\tgl_Position.z *= gl_Position.w;\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#ifdef USE_MAP\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif",map_particle_pars_fragment:"#ifdef USE_MAP\n\tuniform mat3 uvTransform;\n\tuniform sampler2D map;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",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",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",normal_fragment_begin:"#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\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t#endif\n#endif",normal_fragment_maps:"#ifdef USE_NORMALMAP\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t#ifdef FLIP_SIDED\n\t\t\tnormal = - normal;\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\tnormal = normalize( normalMatrix * normal );\n\t#else\n\t\t#ifdef USE_TANGENT\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t\tmapN.xy = normalScale * mapN.xy;\n\t\t\tnormal = normalize( vTBN * mapN );\n\t\t#else\n\t\t\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n\t\t#endif\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tuniform mat3 normalMatrix;\n\t#else\n\t\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\t\tvec2 st0 = dFdx( vUv.st );\n\t\t\tvec2 st1 = dFdy( vUv.st );\n\t\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\t\tvec3 N = normalize( surf_norm );\n\t\t\tmat3 tsn = mat3( S, T, N );\n\t\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t\tmapN.xy *= normalScale;\n\t\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\treturn normalize( tsn * mapN );\n\t\t}\n\t#endif\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\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}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#if defined( DITHERING )\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",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",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",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",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",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\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\t#pragma unroll_loop\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\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif",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\t#pragma unroll_loop\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\t#pragma unroll_loop\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\t#pragma unroll_loop\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}",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",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",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\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",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\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\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}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\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 mat3 uvTransform;\n#endif",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 = ( uvTransform * vec3( uv, 1 ) ).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( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\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\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\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\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <fog_fragment>\n}",shadow_vert:"#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}"},bc={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};function wc(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}function Mc(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function _c(t,e,n){return n<0&&(n+=1),1<n&&--n,n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}Object.assign(y.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,n){return this.r=t,this.g=e,this.b=n,this},setHSL:function(t,e,n){return t=As.euclideanModulo(t,1),e=As.clamp(e,0,1),n=As.clamp(n,0,1),0===e?this.r=this.g=this.b=n:(e=2*n-(n=n<=.5?n*(1+e):n+e-n*e),this.r=_c(e,n,t+1/3),this.g=_c(e,n,t),this.b=_c(e,n,t-1/3)),this},setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}if(h=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var n,i=h[1],r=h[2];switch(i){case"rgb":case"rgba":if(n=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,t(n[5]),this;if(n=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,t(n[5]),this;break;case"hsl":case"hsla":if(n=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r)){var o=parseFloat(n[1])/360,a=parseInt(n[2],10)/100,s=parseInt(n[3],10)/100;return t(n[5]),this.setHSL(o,a,s)}}}else if(h=/^\#([A-Fa-f0-9]+)$/.exec(e)){var c,h=(c=h[1]).length;if(3===h)return this.r=parseInt(c.charAt(0)+c.charAt(0),16)/255,this.g=parseInt(c.charAt(1)+c.charAt(1),16)/255,this.b=parseInt(c.charAt(2)+c.charAt(2),16)/255,this;if(6===h)return this.r=parseInt(c.charAt(0)+c.charAt(1),16)/255,this.g=parseInt(c.charAt(2)+c.charAt(3),16)/255,this.b=parseInt(c.charAt(4)+c.charAt(5),16)/255,this}return e&&0<e.length&&(void 0!==(c=bc[e])?this.setHex(c):console.warn("THREE.Color: Unknown color "+e)),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);e=0<e?1/e:1;return this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},convertGammaToLinear:function(t){return this.copyGammaToLinear(this,t),this},convertLinearToGamma:function(t){return this.copyLinearToGamma(this,t),this},copySRGBToLinear:function(t){return this.r=Mc(t.r),this.g=Mc(t.g),this.b=Mc(t.b),this},copyLinearToSRGB:function(t){return this.r=wc(t.r),this.g=wc(t.g),this.b=wc(t.b),this},convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});var e,n=this.r,i=this.g,r=this.b,o=Math.max(n,i,r),a=Math.min(n,i,r),s=(a+o)/2;if(a===o)h=e=0;else{var c=o-a,h=s<=.5?c/(o+a):c/(2-o-a);switch(o){case n:e=(i-r)/c+(i<r?6:0);break;case i:e=(r-n)/c+2;break;case r:e=(n-i)/c+4}e/=6}return t.h=e,t.s=h,t.l=s,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:(yc={},function(t,e,n){return this.getHSL(yc),yc.h+=t,yc.s+=e,yc.l+=n,this.setHSL(yc.h,yc.s,yc.l),this}),add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},sub:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},lerpHSL:(vc={h:0,s:0,l:0},gc={h:0,s:0,l:0},function(t,e){this.getHSL(vc),t.getHSL(gc);var n=As.lerp(vc.h,gc.h,e),t=As.lerp(vc.s,gc.s,e),e=As.lerp(vc.l,gc.l,e);return this.setHSL(n,t,e),this}),equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t},toJSON:function(){return this.getHex()}});var Ec,Ac,Sc={common:{diffuse:{value:new y(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new T},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new wt(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new y(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new y(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new T}},sprite:{diffuse:{value:new y(15658734)},opacity:{value:1},center:{value:new wt(.5,.5)},rotation:{value:0},map:{value:null},uvTransform:{value:new T}}},Tc={basic:{uniforms:s([Sc.common,Sc.specularmap,Sc.envmap,Sc.aomap,Sc.lightmap,Sc.fog]),vertexShader:xc.meshbasic_vert,fragmentShader:xc.meshbasic_frag},lambert:{uniforms:s([Sc.common,Sc.specularmap,Sc.envmap,Sc.aomap,Sc.lightmap,Sc.emissivemap,Sc.fog,Sc.lights,{emissive:{value:new y(0)}}]),vertexShader:xc.meshlambert_vert,fragmentShader:xc.meshlambert_frag},phong:{uniforms:s([Sc.common,Sc.specularmap,Sc.envmap,Sc.aomap,Sc.lightmap,Sc.emissivemap,Sc.bumpmap,Sc.normalmap,Sc.displacementmap,Sc.gradientmap,Sc.fog,Sc.lights,{emissive:{value:new y(0)},specular:{value:new y(1118481)},shininess:{value:30}}]),vertexShader:xc.meshphong_vert,fragmentShader:xc.meshphong_frag},standard:{uniforms:s([Sc.common,Sc.envmap,Sc.aomap,Sc.lightmap,Sc.emissivemap,Sc.bumpmap,Sc.normalmap,Sc.displacementmap,Sc.roughnessmap,Sc.metalnessmap,Sc.fog,Sc.lights,{emissive:{value:new y(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:xc.meshphysical_vert,fragmentShader:xc.meshphysical_frag},matcap:{uniforms:s([Sc.common,Sc.bumpmap,Sc.normalmap,Sc.displacementmap,Sc.fog,{matcap:{value:null}}]),vertexShader:xc.meshmatcap_vert,fragmentShader:xc.meshmatcap_frag},points:{uniforms:s([Sc.points,Sc.fog]),vertexShader:xc.points_vert,fragmentShader:xc.points_frag},dashed:{uniforms:s([Sc.common,Sc.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:xc.linedashed_vert,fragmentShader:xc.linedashed_frag},depth:{uniforms:s([Sc.common,Sc.displacementmap]),vertexShader:xc.depth_vert,fragmentShader:xc.depth_frag},normal:{uniforms:s([Sc.common,Sc.bumpmap,Sc.normalmap,Sc.displacementmap,{opacity:{value:1}}]),vertexShader:xc.normal_vert,fragmentShader:xc.normal_frag},sprite:{uniforms:s([Sc.sprite,Sc.fog]),vertexShader:xc.sprite_vert,fragmentShader:xc.sprite_frag},background:{uniforms:{uvTransform:{value:new T},t2D:{value:null}},vertexShader:xc.background_vert,fragmentShader:xc.background_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:xc.cube_vert,fragmentShader:xc.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:xc.equirect_vert,fragmentShader:xc.equirect_frag},distanceRGBA:{uniforms:s([Sc.common,Sc.displacementmap,{referencePosition:{value:new Mt},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:xc.distanceRGBA_vert,fragmentShader:xc.distanceRGBA_frag},shadow:{uniforms:s([Sc.lights,Sc.fog,{color:{value:new y(0)},opacity:{value:1}}]),vertexShader:xc.shadow_vert,fragmentShader:xc.shadow_frag}};Tc.physical={uniforms:s([Tc.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:xc.meshphysical_vert,fragmentShader:xc.meshphysical_frag},Object.assign(L.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var e=0,n=t.vertexNormals.length;e<n;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(e=0,n=t.vertexColors.length;e<n;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}}),c.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],c.DefaultOrder="XYZ",Object.defineProperties(c.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback()}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback()}}}),Object.assign(c.prototype,{isEuler:!0,set:function(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._order=i||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this.onChangeCallback(),this},setFromRotationMatrix:function(t,e,n){var i=As.clamp,r=t.elements,o=r[0],a=r[4],s=r[8],c=r[1],h=r[5],l=r[9],u=r[2],t=r[6],r=r[10];return"XYZ"===(e=e||this._order)?(this._y=Math.asin(i(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-l,r),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(t,h),this._z=0)):"YXZ"===e?(this._x=Math.asin(-i(l,-1,1)),Math.abs(l)<.99999?(this._y=Math.atan2(s,r),this._z=Math.atan2(c,h)):(this._y=Math.atan2(-u,o),this._z=0)):"ZXY"===e?(this._x=Math.asin(i(t,-1,1)),Math.abs(t)<.99999?(this._y=Math.atan2(-u,r),this._z=Math.atan2(-a,h)):(this._y=0,this._z=Math.atan2(c,o))):"ZYX"===e?(this._y=Math.asin(-i(u,-1,1)),Math.abs(u)<.99999?(this._x=Math.atan2(t,r),this._z=Math.atan2(c,o)):(this._x=0,this._z=Math.atan2(-a,h))):"YZX"===e?(this._z=Math.asin(i(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(-l,h),this._y=Math.atan2(-u,o)):(this._x=0,this._y=Math.atan2(s,r))):"XZY"===e?(this._z=Math.asin(-i(a,-1,1)),Math.abs(a)<.99999?(this._x=Math.atan2(t,h),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-l,r),this._y=0)):console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,!1!==n&&this.onChangeCallback(),this},setFromQuaternion:(Ac=new St,function(t,e,n){return Ac.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Ac,e,n)}),setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:(Ec=new S,function(t){return Ec.setFromEuler(this),this.setFromQuaternion(Ec,t)}),equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new Mt(this._x,this._y,this._z)},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(h.prototype,{set:function(t){this.mask=1<<t|0},enable:function(t){this.mask|=1<<t|0},toggle:function(t){this.mask^=1<<t|0},disable:function(t){this.mask&=~(1<<t|0)},test:function(t){return 0!=(this.mask&t.mask)}});var Lc,Rc,Cc,Pc,Ic,Oc,Dc,Nc,zc,Uc,Bc,kc,Fc,Gc,Hc,jc,Vc,Wc,qc,Xc=0;f.DefaultUp=new Mt(0,1,0),f.DefaultMatrixAutoUpdate=!0,f.prototype=Object.assign(Object.create(i.prototype),{constructor:f,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:(qc=new S,function(t,e){return qc.setFromAxisAngle(t,e),this.quaternion.multiply(qc),this}),rotateOnWorldAxis:(Wc=new S,function(t,e){return Wc.setFromAxisAngle(t,e),this.quaternion.premultiply(Wc),this}),rotateX:(Vc=new Mt(1,0,0),function(t){return this.rotateOnAxis(Vc,t)}),rotateY:(jc=new Mt(0,1,0),function(t){return this.rotateOnAxis(jc,t)}),rotateZ:(Hc=new Mt(0,0,1),function(t){return this.rotateOnAxis(Hc,t)}),translateOnAxis:(Gc=new Mt,function(t,e){return Gc.copy(t).applyQuaternion(this.quaternion),this.position.add(Gc.multiplyScalar(e)),this}),translateX:(Fc=new Mt(1,0,0),function(t){return this.translateOnAxis(Fc,t)}),translateY:(kc=new Mt(0,1,0),function(t){return this.translateOnAxis(kc,t)}),translateZ:(Bc=new Mt(0,0,1),function(t){return this.translateOnAxis(Bc,t)}),localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:(Uc=new St,function(t){return t.applyMatrix4(Uc.getInverse(this.matrixWorld))}),lookAt:(Oc=new S,Dc=new St,Nc=new Mt,zc=new Mt,function(t,e,n){t.isVector3?Nc.copy(t):Nc.set(t,e,n);n=this.parent;this.updateWorldMatrix(!0,!1),zc.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Dc.lookAt(zc,Nc,this.up):Dc.lookAt(Nc,zc,this.up),this.quaternion.setFromRotationMatrix(Dc),n&&(Dc.extractRotation(n.matrixWorld),Oc.setFromRotationMatrix(Dc),this.quaternion.premultiply(Oc.inverse()))}),add:function(t){if(1<arguments.length){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?console.error("THREE.Object3D.add: object can't be added as a child of itself.",t):t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,t.dispatchEvent({type:"added"}),this.children.push(t)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this},remove:function(t){if(1<arguments.length){for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}var n=this.children.indexOf(t);return-1!==n&&(t.parent=null,t.dispatchEvent({type:"removed"}),this.children.splice(n,1)),this},attach:(Ic=new St,function(t){return this.updateWorldMatrix(!0,!1),Ic.getInverse(this.matrixWorld),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),Ic.multiply(t.parent.matrixWorld)),t.applyMatrix(Ic),t.updateWorldMatrix(!1,!1),this.add(t),this}),getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(var n=0,i=this.children.length;n<i;n++){var r=this.children[n].getObjectByProperty(t,e);if(void 0!==r)return r}},getWorldPosition:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new Mt),this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:(Cc=new Mt,Pc=new Mt,function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),t=new S),this.updateMatrixWorld(!0),this.matrixWorld.decompose(Cc,t,Pc),t}),getWorldScale:(Lc=new Mt,Rc=new S,function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),t=new Mt),this.updateMatrixWorld(!0),this.matrixWorld.decompose(Lc,Rc,t),t}),getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new Mt),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()},raycast:function(){},traverse:function(t){t(this);for(var e=this.children,n=0,i=e.length;n<i;n++)e[n].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var e=this.children,n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)}},traverseAncestors:function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t=!(this.matrixWorldNeedsUpdate=!1));for(var e=this.children,n=0,i=e.length;n<i;n++)e[n].updateMatrixWorld(t)},updateWorldMatrix:function(t,e){var n=this.parent;if(!0===t&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e)for(var i=this.children,r=0,o=i.length;r<o;r++)i[r].updateWorldMatrix(!1,!0)},toJSON:function(n){function t(t,e){return void 0===t[e.uuid]&&(t[e.uuid]=e.toJSON(n)),e.uuid}function e(t){var e,n=[];for(e in t){var i=t[e];delete i.metadata,n.push(i)}return n}var i=void 0===n||"string"==typeof n,r={};i&&(n={geometries:{},materials:{},textures:{},images:{},shapes:{}},r.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var o,a,s={};if(s.uuid=this.uuid,s.type=this.type,""!==this.name&&(s.name=this.name),!0===this.castShadow&&(s.castShadow=!0),!0===this.receiveShadow&&(s.receiveShadow=!0),!1===this.visible&&(s.visible=!1),!1===this.frustumCulled&&(s.frustumCulled=!1),0!==this.renderOrder&&(s.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(s.matrixAutoUpdate=!1),this.isMesh&&this.drawMode!==us&&(s.drawMode=this.drawMode),this.isMesh||this.isLine||this.isPoints){s.geometry=t(n.geometries,this.geometry);var c=this.geometry.parameters;if(void 0!==c&&void 0!==c.shapes){var h=c.shapes;if(Array.isArray(h))for(var l=0,u=h.length;l<u;l++){var d=h[l];t(n.shapes,d)}else t(n.shapes,h)}}if(void 0!==this.material)if(Array.isArray(this.material)){for(var p=[],l=0,u=this.material.length;l<u;l++)p.push(t(n.materials,this.material[l]));s.material=p}else s.material=t(n.materials,this.material);if(0<this.children.length){s.children=[];for(l=0;l<this.children.length;l++)s.children.push(this.children[l].toJSON(n).object)}return i&&(o=e(n.geometries),a=e(n.materials),c=e(n.textures),i=e(n.images),h=e(n.shapes),0<o.length&&(r.geometries=o),0<a.length&&(r.materials=a),0<c.length&&(r.textures=c),0<i.length&&(r.images=i),0<h.length&&(r.shapes=h)),r.object=s,r},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var n=0;n<t.children.length;n++){var i=t.children[n];this.add(i.clone())}return this}});var Yc,Zc,Jc,Qc,Kc,$c,th,eh=0;x.prototype=Object.assign(Object.create(i.prototype),{constructor:x,isGeometry:!0,applyMatrix:function(t){for(var e=(new T).getNormalMatrix(t),n=0,i=this.vertices.length;n<i;n++)this.vertices[n].applyMatrix4(t);for(n=0,i=this.faces.length;n<i;n++){var r=this.faces[n];r.normal.applyMatrix3(e).normalize();for(var o=0,a=r.vertexNormals.length;o<a;o++)r.vertexNormals[o].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:(th=new St,function(t){return th.makeRotationX(t),this.applyMatrix(th),this}),rotateY:($c=new St,function(t){return $c.makeRotationY(t),this.applyMatrix($c),this}),rotateZ:(Kc=new St,function(t){return Kc.makeRotationZ(t),this.applyMatrix(Kc),this}),translate:(Qc=new St,function(t,e,n){return Qc.makeTranslation(t,e,n),this.applyMatrix(Qc),this}),scale:(Jc=new St,function(t,e,n){return Jc.makeScale(t,e,n),this.applyMatrix(Jc),this}),lookAt:(Zc=new f,function(t){Zc.lookAt(t),Zc.updateMatrix(),this.applyMatrix(Zc.matrix)}),fromBufferGeometry:function(t){function e(t,e,n,i){var r=void 0===s?[]:[o.colors[t].clone(),o.colors[e].clone(),o.colors[n].clone()],i=new L(t,e,n,void 0===a?[]:[(new Mt).fromArray(a,3*t),(new Mt).fromArray(a,3*e),(new Mt).fromArray(a,3*n)],r,i);o.faces.push(i),void 0!==c&&o.faceVertexUvs[0].push([(new wt).fromArray(c,2*t),(new wt).fromArray(c,2*e),(new wt).fromArray(c,2*n)]),void 0!==h&&o.faceVertexUvs[1].push([(new wt).fromArray(h,2*t),(new wt).fromArray(h,2*e),(new wt).fromArray(h,2*n)])}var o=this,n=null!==t.index?t.index.array:void 0,i=t.attributes,r=i.position.array,a=void 0!==i.normal?i.normal.array:void 0,s=void 0!==i.color?i.color.array:void 0,c=void 0!==i.uv?i.uv.array:void 0,h=void 0!==i.uv2?i.uv2.array:void 0;void 0!==h&&(this.faceVertexUvs[1]=[]);for(var l=0;l<r.length;l+=3)o.vertices.push((new Mt).fromArray(r,l)),void 0!==s&&o.colors.push((new y).fromArray(s,l));var u=t.groups;if(0<u.length)for(l=0;l<u.length;l++)for(var d=u[l],p=d.start,f=p,m=p+d.count;f<m;f+=3)void 0!==n?e(n[f],n[f+1],n[f+2],d.materialIndex):e(f,f+1,f+2,d.materialIndex);else if(void 0!==n)for(l=0;l<n.length;l+=3)e(n[l],n[l+1],n[l+2]);else for(l=0;l<r.length/3;l+=3)e(l,l+1,l+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:(Yc=new Mt,function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Yc).negate(),this.translate(Yc.x,Yc.y,Yc.z),this}),normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,n=0===e?1:1/e,e=new St;return e.set(n,0,0,-n*t.x,0,n,0,-n*t.y,0,0,n,-n*t.z,0,0,0,1),this.applyMatrix(e),this},computeFaceNormals:function(){for(var t=new Mt,e=new Mt,n=0,i=this.faces.length;n<i;n++){var r=this.faces[n],o=this.vertices[r.a],a=this.vertices[r.b],s=this.vertices[r.c];t.subVectors(s,a),e.subVectors(o,a),t.cross(e),t.normalize(),r.normal.copy(t)}},computeVertexNormals:function(t){var e,n,i,r;for(void 0===t&&(t=!0),r=new Array(this.vertices.length),e=0,n=this.vertices.length;e<n;e++)r[e]=new Mt;if(t)for(var o,a,s,c=new Mt,h=new Mt,l=0,u=this.faces.length;l<u;l++)i=this.faces[l],o=this.vertices[i.a],a=this.vertices[i.b],s=this.vertices[i.c],c.subVectors(s,a),h.subVectors(o,a),c.cross(h),r[i.a].add(c),r[i.b].add(c),r[i.c].add(c);else for(this.computeFaceNormals(),l=0,u=this.faces.length;l<u;l++)r[(i=this.faces[l]).a].add(i.normal),r[i.b].add(i.normal),r[i.c].add(i.normal);for(e=0,n=this.vertices.length;e<n;e++)r[e].normalize();for(l=0,u=this.faces.length;l<u;l++){var d=(i=this.faces[l]).vertexNormals;3===d.length?(d[0].copy(r[i.a]),d[1].copy(r[i.b]),d[2].copy(r[i.c])):(d[0]=r[i.a].clone(),d[1]=r[i.b].clone(),d[2]=r[i.c].clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,e,n;for(this.computeFaceNormals(),t=0,e=this.faces.length;t<e;t++){var i=(n=this.faces[t]).vertexNormals;3===i.length?(i[0].copy(n.normal),i[1].copy(n.normal),i[2].copy(n.normal)):(i[0]=n.normal.clone(),i[1]=n.normal.clone(),i[2]=n.normal.clone())}0<this.faces.length&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,n;for(a=0,s=this.faces.length;a<s;a++)for((n=this.faces[a]).__originalFaceNormal?n.__originalFaceNormal.copy(n.normal):n.__originalFaceNormal=n.normal.clone(),n.__originalVertexNormals||(n.__originalVertexNormals=[]),t=0,e=n.vertexNormals.length;t<e;t++)n.__originalVertexNormals[t]?n.__originalVertexNormals[t].copy(n.vertexNormals[t]):n.__originalVertexNormals[t]=n.vertexNormals[t].clone();var i=new x;for(i.faces=this.faces,t=0,e=this.morphTargets.length;t<e;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];for(var r=this.morphNormals[t].faceNormals,o=this.morphNormals[t].vertexNormals,a=0,s=this.faces.length;a<s;a++)c=new Mt,h={a:new Mt,b:new Mt,c:new Mt},r.push(c),o.push(h)}var c,h,l=this.morphNormals[t];for(i.vertices=this.morphTargets[t].vertices,i.computeFaceNormals(),i.computeVertexNormals(),a=0,s=this.faces.length;a<s;a++)n=this.faces[a],c=l.faceNormals[a],h=l.vertexNormals[a],c.copy(n.normal),h.a.copy(n.vertexNormals[0]),h.b.copy(n.vertexNormals[1]),h.c.copy(n.vertexNormals[2])}for(a=0,s=this.faces.length;a<s;a++)(n=this.faces[a]).normal=n.__originalFaceNormal,n.vertexNormals=n.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new o),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new g),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,n){if(t&&t.isGeometry){var i,r=this.vertices.length,o=this.vertices,a=t.vertices,s=this.faces,c=t.faces,h=this.faceVertexUvs[0],l=t.faceVertexUvs[0],u=this.colors,d=t.colors;void 0===n&&(n=0),void 0!==e&&(i=(new T).getNormalMatrix(e));for(var p=0,f=a.length;p<f;p++){var m=a[p].clone();void 0!==e&&m.applyMatrix4(e),o.push(m)}for(p=0,f=d.length;p<f;p++)u.push(d[p].clone());for(p=0,f=c.length;p<f;p++){var v,g,y=c[p],x=y.vertexNormals,b=y.vertexColors,w=new L(y.a+r,y.b+r,y.c+r);w.normal.copy(y.normal),void 0!==i&&w.normal.applyMatrix3(i).normalize();for(var M=0,_=x.length;M<_;M++)v=x[M].clone(),void 0!==i&&v.applyMatrix3(i).normalize(),w.vertexNormals.push(v);w.color.copy(y.color);for(M=0,_=b.length;M<_;M++)g=b[M],w.vertexColors.push(g.clone());w.materialIndex=y.materialIndex+n,s.push(w)}for(p=0,f=l.length;p<f;p++){var E=l[p],A=[];if(void 0!==E){for(M=0,_=E.length;M<_;M++)A.push(E[M].clone());h.push(A)}}}else console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t)},mergeMesh:function(t){t&&t.isMesh?(t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t)},mergeVertices:function(){for(var t,e,n,i,r,o={},a=[],s=[],c=Math.pow(10,4),h=0,l=this.vertices.length;h<l;h++)t=this.vertices[h],void 0===o[t=Math.round(t.x*c)+"_"+Math.round(t.y*c)+"_"+Math.round(t.z*c)]?(o[t]=h,a.push(this.vertices[h]),s[h]=a.length-1):s[h]=s[o[t]];var u=[];for(h=0,l=this.faces.length;h<l;h++){(e=this.faces[h]).a=s[e.a],e.b=s[e.b],e.c=s[e.c],n=[e.a,e.b,e.c];for(var d=0;d<3;d++)if(n[d]===n[(d+1)%3]){u.push(h);break}}for(h=u.length-1;0<=h;h--){var p=u[h];for(this.faces.splice(p,1),i=0,r=this.faceVertexUvs.length;i<r;i++)this.faceVertexUvs[i].splice(p,1)}var f=this.vertices.length-a.length;return this.vertices=a,f},setFromPoints:function(t){this.vertices=[];for(var e=0,n=t.length;e<n;e++){var i=t[e];this.vertices.push(new Mt(i.x,i.y,i.z||0))}return this},sortFacesByMaterialIndex:function(){for(var t=this.faces,e=t.length,n=0;n<e;n++)t[n]._id=n;t.sort(function(t,e){return t.materialIndex-e.materialIndex});var i,r,o=this.faceVertexUvs[0],a=this.faceVertexUvs[1];o&&o.length===e&&(i=[]),a&&a.length===e&&(r=[]);for(n=0;n<e;n++){var s=t[n]._id;i&&i.push(o[s]),r&&r.push(a[s])}i&&(this.faceVertexUvs[0]=i),r&&(this.faceVertexUvs[1]=r)},toJSON:function(){function t(t,e,n){return n?t|1<<e:t&~(1<<e)}function e(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==d[e]||(d[e]=u.length/3,u.push(t.x,t.y,t.z)),d[e]}function n(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==f[e]||(f[e]=p.length,p.push(t.getHex())),f[e]}function i(t){var e=t.x.toString()+t.y.toString();return void 0!==v[e]||(v[e]=m.length/2,m.push(t.x,t.y)),v[e]}var r={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),void 0!==this.parameters){var o,a=this.parameters;for(o in a)void 0!==a[o]&&(r[o]=a[o]);return r}for(var s=[],c=0;c<this.vertices.length;c++){var h=this.vertices[c];s.push(h.x,h.y,h.z)}for(var l=[],u=[],d={},p=[],f={},m=[],v={},c=0;c<this.faces.length;c++){var g,y=this.faces[c],x=void 0!==this.faceVertexUvs[0][c],b=0<y.normal.length(),w=0<y.vertexNormals.length,M=1!==y.color.r||1!==y.color.g||1!==y.color.b,_=0<y.vertexColors.length;g=t(2,3,x),g=t(g,4,b),g=t(g,5,w),g=t(g,6,M),g=t(g,7,_),l.push(g),l.push(y.a,y.b,y.c),l.push(y.materialIndex),x&&(x=this.faceVertexUvs[0][c],l.push(i(x[0]),i(x[1]),i(x[2]))),b&&l.push(e(y.normal)),w&&(w=y.vertexNormals,l.push(e(w[0]),e(w[1]),e(w[2]))),M&&l.push(n(y.color)),_&&(y=y.vertexColors,l.push(n(y[0]),n(y[1]),n(y[2])))}return r.data={},r.data.vertices=s,r.data.normals=u,0<p.length&&(r.data.colors=p),0<m.length&&(r.data.uvs=[m]),r.data.faces=l,r},clone:function(){return(new x).copy(this)},copy:function(t){var e,n;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;for(var i=t.vertices,r=0,o=i.length;r<o;r++)this.vertices.push(i[r].clone());var a=t.colors;for(r=0,o=a.length;r<o;r++)this.colors.push(a[r].clone());var s=t.faces;for(r=0,o=s.length;r<o;r++)this.faces.push(s[r].clone());for(r=0,o=t.faceVertexUvs.length;r<o;r++){var c=t.faceVertexUvs[r];for(void 0===this.faceVertexUvs[r]&&(this.faceVertexUvs[r]=[]),e=0,n=c.length;e<n;e++){for(var h=c[e],l=[],u=0,d=h.length;u<d;u++){var p=h[u];l.push(p.clone())}this.faceVertexUvs[r].push(l)}}var f=t.morphTargets;for(r=0,o=f.length;r<o;r++){var m={};if(m.name=f[r].name,void 0!==f[r].vertices)for(m.vertices=[],e=0,n=f[r].vertices.length;e<n;e++)m.vertices.push(f[r].vertices[e].clone());if(void 0!==f[r].normals)for(m.normals=[],e=0,n=f[r].normals.length;e<n;e++)m.normals.push(f[r].normals[e].clone());this.morphTargets.push(m)}var v=t.morphNormals;for(r=0,o=v.length;r<o;r++){var g={};if(void 0!==v[r].vertexNormals)for(g.vertexNormals=[],e=0,n=v[r].vertexNormals.length;e<n;e++){var y=v[r].vertexNormals[e],x={};x.a=y.a.clone(),x.b=y.b.clone(),x.c=y.c.clone(),g.vertexNormals.push(x)}if(void 0!==v[r].faceNormals)for(g.faceNormals=[],e=0,n=v[r].faceNormals.length;e<n;e++)g.faceNormals.push(v[r].faceNormals[e].clone());this.morphNormals.push(g)}var b=t.skinWeights;for(r=0,o=b.length;r<o;r++)this.skinWeights.push(b[r].clone());var w=t.skinIndices;for(r=0,o=w.length;r<o;r++)this.skinIndices.push(w[r].clone());var M=t.lineDistances;for(r=0,o=M.length;r<o;r++)this.lineDistances.push(M[r]);var _=t.boundingBox;null!==_&&(this.boundingBox=_.clone());_=t.boundingSphere;return null!==_&&(this.boundingSphere=_.clone()),this.elementsNeedUpdate=t.elementsNeedUpdate,this.verticesNeedUpdate=t.verticesNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.lineDistancesNeedUpdate=t.lineDistancesNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(b.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(b.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==t?t.length/this.itemSize:0,this.array=t,this},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.dynamic=t.dynamic,this},copyAt:function(t,e,n){t*=this.itemSize,n*=e.itemSize;for(var i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[n+i];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),o=new y),e[n++]=o.r,e[n++]=o.g,e[n++]=o.b}return this},copyVector2sArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),o=new wt),e[n++]=o.x,e[n++]=o.y}return this},copyVector3sArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),o=new Mt),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z}return this},copyVector4sArray:function(t){for(var e=this.array,n=0,i=0,r=t.length;i<r;i++){var o=t[i];void 0===o&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),o=new _t),e[n++]=o.x,e[n++]=o.y,e[n++]=o.z,e[n++]=o.w}return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this},setXYZ:function(t,e,n,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this},setXYZW:function(t,e,n,i,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=r,this},onUpload:function(t){return this.onUploadCallback=t,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),(l.prototype=Object.create(b.prototype)).constructor=l,(p.prototype=Object.create(b.prototype)).constructor=p,(m.prototype=Object.create(b.prototype)).constructor=m,(v.prototype=Object.create(b.prototype)).constructor=v,(w.prototype=Object.create(b.prototype)).constructor=w,(M.prototype=Object.create(b.prototype)).constructor=M,(_.prototype=Object.create(b.prototype)).constructor=_,(z.prototype=Object.create(b.prototype)).constructor=z,(E.prototype=Object.create(b.prototype)).constructor=E,Object.assign(A.prototype,{computeGroups:function(t){for(var e,n=[],i=void 0,r=t.faces,o=0;o<r.length;o++){var a=r[o];a.materialIndex!==i&&(i=a.materialIndex,void 0!==e&&(e.count=3*o-e.start,n.push(e)),e={start:3*o,materialIndex:i})}void 0!==e&&(e.count=3*o-e.start,n.push(e)),this.groups=n},fromGeometry:function(t){var e,n=t.faces,i=t.vertices,r=t.faceVertexUvs,o=r[0]&&0<r[0].length,a=r[1]&&0<r[1].length,s=t.morphTargets,c=s.length;if(0<c){e=[];for(var h=0;h<c;h++)e[h]={name:s[h].name,data:[]};this.morphTargets.position=e}var l,u=t.morphNormals,d=u.length;if(0<d){l=[];for(h=0;h<d;h++)l[h]={name:u[h].name,data:[]};this.morphTargets.normal=l}var p=t.skinIndices,f=t.skinWeights,m=p.length===i.length,v=f.length===i.length;0<i.length&&0===n.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(h=0;h<n.length;h++){var g=n[h];this.vertices.push(i[g.a],i[g.b],i[g.c]);var y=g.vertexNormals;3===y.length?this.normals.push(y[0],y[1],y[2]):(b=g.normal,this.normals.push(b,b,b));var x,b=g.vertexColors;3===b.length?this.colors.push(b[0],b[1],b[2]):(b=g.color,this.colors.push(b,b,b)),!0===o&&(void 0!==(x=r[0][h])?this.uvs.push(x[0],x[1],x[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",h),this.uvs.push(new wt,new wt,new wt))),!0===a&&(void 0!==(x=r[1][h])?this.uvs2.push(x[0],x[1],x[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",h),this.uvs2.push(new wt,new wt,new wt)));for(var w=0;w<c;w++){var M=s[w].vertices;e[w].data.push(M[g.a],M[g.b],M[g.c])}for(w=0;w<d;w++){var _=u[w].vertexNormals[h];l[w].data.push(_.a,_.b,_.c)}m&&this.skinIndices.push(p[g.a],p[g.b],p[g.c]),v&&this.skinWeights.push(f[g.a],f[g.b],f[g.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this}});var nh,ih,rh,oh,ah,sh,ch,hh,lh,uh,dh,ph,fh=1;U.prototype=Object.assign(Object.create(i.prototype),{constructor:U,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(65535<R(t)?_:w)(t,1):this.index=t},addAttribute:function(t,e){return e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?("index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e)):this.attributes[t]=e,this):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.addAttribute(t,new b(e,arguments[2])))},getAttribute:function(t){return this.attributes[t]},removeAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,n){this.groups.push({start:t,count:e,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix:function(t){var e=this.attributes.position;void 0!==e&&(t.applyToBufferAttribute(e),e.needsUpdate=!0);e=this.attributes.normal;void 0!==e&&((new T).getNormalMatrix(t).applyToBufferAttribute(e),e.needsUpdate=!0);e=this.attributes.tangent;return void 0!==e&&((new T).getNormalMatrix(t).applyToBufferAttribute(e),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:(ph=new St,function(t){return ph.makeRotationX(t),this.applyMatrix(ph),this}),rotateY:(dh=new St,function(t){return dh.makeRotationY(t),this.applyMatrix(dh),this}),rotateZ:(uh=new St,function(t){return uh.makeRotationZ(t),this.applyMatrix(uh),this}),translate:(lh=new St,function(t,e,n){return lh.makeTranslation(t,e,n),this.applyMatrix(lh),this}),scale:(hh=new St,function(t,e,n){return hh.makeScale(t,e,n),this.applyMatrix(hh),this}),lookAt:(ch=new f,function(t){ch.lookAt(t),ch.updateMatrix(),this.applyMatrix(ch.matrix)}),center:(sh=new Mt,function(){return this.computeBoundingBox(),this.boundingBox.getCenter(sh).negate(),this.translate(sh.x,sh.y,sh.z),this}),setFromObject:function(t){var e,n,i=t.geometry;return t.isPoints||t.isLine?(e=new z(3*i.vertices.length,3),n=new z(3*i.colors.length,3),this.addAttribute("position",e.copyVector3sArray(i.vertices)),this.addAttribute("color",n.copyColorsArray(i.colors)),i.lineDistances&&i.lineDistances.length===i.vertices.length&&(n=new z(i.lineDistances.length,1),this.addAttribute("lineDistance",n.copyArray(i.lineDistances))),null!==i.boundingSphere&&(this.boundingSphere=i.boundingSphere.clone()),null!==i.boundingBox&&(this.boundingBox=i.boundingBox.clone())):t.isMesh&&i&&i.isGeometry&&this.fromGeometry(i),this},setFromPoints:function(t){for(var e=[],n=0,i=t.length;n<i;n++){var r=t[n];e.push(r.x,r.y,r.z||0)}return this.addAttribute("position",new z(e,3)),this},updateFromObject:function(t){var e,n=t.geometry;if(t.isMesh){var i=n.__directGeometry;if(!0===n.elementsNeedUpdate&&(i=void 0,n.elementsNeedUpdate=!1),void 0===i)return this.fromGeometry(n);i.verticesNeedUpdate=n.verticesNeedUpdate,i.normalsNeedUpdate=n.normalsNeedUpdate,i.colorsNeedUpdate=n.colorsNeedUpdate,i.uvsNeedUpdate=n.uvsNeedUpdate,i.groupsNeedUpdate=n.groupsNeedUpdate,n.verticesNeedUpdate=!1,n.normalsNeedUpdate=!1,n.colorsNeedUpdate=!1,n.uvsNeedUpdate=!1,n.groupsNeedUpdate=!1,n=i}return!0===n.verticesNeedUpdate&&(void 0!==(e=this.attributes.position)&&(e.copyVector3sArray(n.vertices),e.needsUpdate=!0),n.verticesNeedUpdate=!1),!0===n.normalsNeedUpdate&&(void 0!==(e=this.attributes.normal)&&(e.copyVector3sArray(n.normals),e.needsUpdate=!0),n.normalsNeedUpdate=!1),!0===n.colorsNeedUpdate&&(void 0!==(e=this.attributes.color)&&(e.copyColorsArray(n.colors),e.needsUpdate=!0),n.colorsNeedUpdate=!1),n.uvsNeedUpdate&&(void 0!==(e=this.attributes.uv)&&(e.copyVector2sArray(n.uvs),e.needsUpdate=!0),n.uvsNeedUpdate=!1),n.lineDistancesNeedUpdate&&(void 0!==(e=this.attributes.lineDistance)&&(e.copyArray(n.lineDistances),e.needsUpdate=!0),n.lineDistancesNeedUpdate=!1),n.groupsNeedUpdate&&(n.computeGroups(t.geometry),this.groups=n.groups,n.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new A).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){var e,n,i,r,o=new Float32Array(3*t.vertices.length);for(i in this.addAttribute("position",new b(o,3).copyVector3sArray(t.vertices)),0<t.normals.length&&(e=new Float32Array(3*t.normals.length),this.addAttribute("normal",new b(e,3).copyVector3sArray(t.normals))),0<t.colors.length&&(e=new Float32Array(3*t.colors.length),this.addAttribute("color",new b(e,3).copyColorsArray(t.colors))),0<t.uvs.length&&(n=new Float32Array(2*t.uvs.length),this.addAttribute("uv",new b(n,2).copyVector2sArray(t.uvs))),0<t.uvs2.length&&(n=new Float32Array(2*t.uvs2.length),this.addAttribute("uv2",new b(n,2).copyVector2sArray(t.uvs2))),this.groups=t.groups,t.morphTargets){for(var a=[],s=t.morphTargets[i],c=0,h=s.length;c<h;c++){var l=s[c],u=new z(3*l.data.length,3);u.name=l.name,a.push(u.copyVector3sArray(l.data))}this.morphAttributes[i]=a}return 0<t.skinIndices.length&&(r=new z(4*t.skinIndices.length,4),this.addAttribute("skinIndex",r.copyVector4sArray(t.skinIndices))),0<t.skinWeights.length&&(r=new z(4*t.skinWeights.length,4),this.addAttribute("skinWeight",r.copyVector4sArray(t.skinWeights))),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:(ah=new o,function(){null===this.boundingBox&&(this.boundingBox=new o);var t=this.attributes.position,e=this.morphAttributes.position;if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(var n=0,i=e.length;n<i;n++){var r=e[n];ah.setFromBufferAttribute(r),this.boundingBox.expandByPoint(ah.min),this.boundingBox.expandByPoint(ah.max)}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}),computeBoundingSphere:(ih=new o,rh=new o,oh=new Mt,function(){null===this.boundingSphere&&(this.boundingSphere=new g);var t=this.attributes.position,e=this.morphAttributes.position;if(t){var n=this.boundingSphere.center;if(ih.setFromBufferAttribute(t),e)for(var i=0,r=e.length;i<r;i++){var o=e[i];rh.setFromBufferAttribute(o),ih.expandByPoint(rh.min),ih.expandByPoint(rh.max)}ih.getCenter(n);for(var a=0,i=0,r=t.count;i<r;i++)oh.fromBufferAttribute(t,i),a=Math.max(a,n.distanceToSquared(oh));if(e)for(i=0,r=e.length;i<r;i++)for(var s=0,c=(o=e[i]).count;s<c;s++)oh.fromBufferAttribute(o,s),a=Math.max(a,n.distanceToSquared(oh));this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}),computeFaceNormals:function(){},computeVertexNormals:function(){var t=this.index,e=this.attributes;if(e.position){var n=e.position.array;if(void 0===e.normal)this.addAttribute("normal",new b(new Float32Array(n.length),3));else for(var i=e.normal.array,r=0,o=i.length;r<o;r++)i[r]=0;var a,s,c,h=e.normal.array,l=new Mt,u=new Mt,d=new Mt,p=new Mt,f=new Mt;if(t)for(var m=t.array,r=0,o=t.count;r<o;r+=3)a=3*m[r+0],s=3*m[r+1],c=3*m[r+2],l.fromArray(n,a),u.fromArray(n,s),d.fromArray(n,c),p.subVectors(d,u),f.subVectors(l,u),p.cross(f),h[a]+=p.x,h[1+a]+=p.y,h[2+a]+=p.z,h[s]+=p.x,h[1+s]+=p.y,h[2+s]+=p.z,h[c]+=p.x,h[1+c]+=p.y,h[2+c]+=p.z;else for(r=0,o=n.length;r<o;r+=9)l.fromArray(n,r),u.fromArray(n,r+3),d.fromArray(n,r+6),p.subVectors(d,u),f.subVectors(l,u),p.cross(f),h[r]=p.x,h[r+1]=p.y,h[r+2]=p.z,h[r+3]=p.x,h[r+4]=p.y,h[r+5]=p.z,h[r+6]=p.x,h[r+7]=p.y,h[r+8]=p.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(t,e){if(t&&t.isBufferGeometry){void 0===e&&(e=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));var n,i=this.attributes;for(n in i)if(void 0!==t.attributes[n])for(var r=i[n],o=r.array,r=t.attributes[n],a=r.array,r=r.itemSize*e,s=Math.min(a.length,o.length-r),c=0,h=r;c<s;c++,h++)o[h]=a[c];return this}console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t)},normalizeNormals:(nh=new Mt,function(){for(var t=this.attributes.normal,e=0,n=t.count;e<n;e++)nh.x=t.getX(e),nh.y=t.getY(e),nh.z=t.getZ(e),nh.normalize(),t.setXYZ(e,nh.x,nh.y,nh.z)}),toNonIndexed:function(){function t(t,e){for(var n=t.array,i=t.itemSize,r=new n.constructor(e.length*i),o=0,a=0,s=0,c=e.length;s<c;s++){o=e[s]*i;for(var h=0;h<i;h++)r[a++]=n[o++]}return new b(r,i)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;var e,n=new U,i=this.index.array,r=this.attributes;for(e in r){var o=t(r[e],i);n.addAttribute(e,o)}var a=this.morphAttributes;for(e in a){for(var s=[],c=a[e],h=0,l=c.length;h<l;h++){o=t(c[h],i);s.push(o)}n.morphAttributes[e]=s}for(var u=this.groups,h=0,d=u.length;h<d;h++){var p=u[h];n.addGroup(p.start,p.count,p.materialIndex)}return n},toJSON:function(){var t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),0<Object.keys(this.userData).length&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(o in e)void 0!==e[o]&&(t[o]=e[o]);return t}t.data={attributes:{}};var n=this.index;null!==n&&(t.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});var i=this.attributes;for(o in i){var r=(d=i[o]).toJSON();""!==d.name&&(r.name=d.name),t.data.attributes[o]=r}var o,a={},s=!1;for(o in this.morphAttributes){for(var c=this.morphAttributes[o],h=[],l=0,u=c.length;l<u;l++){var d,r=(d=c[l]).toJSON();""!==d.name&&(r.name=d.name),h.push(r)}0<h.length&&(a[o]=h,s=!0)}s&&(t.data.morphAttributes=a);n=this.groups;0<n.length&&(t.data.groups=JSON.parse(JSON.stringify(n)));n=this.boundingSphere;return null!==n&&(t.data.boundingSphere={center:n.center.toArray(),radius:n.radius}),t},clone:function(){return(new U).copy(this)},copy:function(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var e=t.index;null!==e&&this.setIndex(e.clone());var n=t.attributes;for(var i in n){var r=n[i];this.addAttribute(i,r.clone())}var o=t.morphAttributes;for(i in o){for(var a=[],s=o[i],c=0,h=s.length;c<h;c++)a.push(s[c].clone());this.morphAttributes[i]=a}var l=t.groups;for(c=0,h=l.length;c<h;c++){var u=l[c];this.addGroup(u.start,u.count,u.materialIndex)}e=t.boundingBox;null!==e&&(this.boundingBox=e.clone());e=t.boundingSphere;return null!==e&&(this.boundingSphere=e.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),(C.prototype=Object.create(x.prototype)).constructor=C,(P.prototype=Object.create(U.prototype)).constructor=P,(O.prototype=Object.create(x.prototype)).constructor=O,(D.prototype=Object.create(U.prototype)).constructor=D;var mh=0;N.prototype=Object.assign(Object.create(i.prototype),{constructor:N,isMaterial:!0,onBeforeCompile:function(){},setValues:function(t){if(void 0!==t)for(var e in t){var n,i=t[e];void 0!==i?"shading"!==e?void 0!==(n=this[e])?n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[e]=i:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material."):(console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===i):console.warn("THREE.Material: '"+e+"' parameter is undefined.")}},toJSON:function(t){function e(t){var e,n=[];for(e in t){var i=t[e];delete i.metadata,n.push(i)}return n}var n=void 0===t||"string"==typeof t;n&&(t={textures:{},images:{}});var i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};return i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearCoat&&(i.clearCoat=this.clearCoat),void 0!==this.clearCoatRoughness&&(i.clearCoatRoughness=this.clearCoatRoughness),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,i.reflectivity=this.reflectivity,void 0!==this.combine&&(i.combine=this.combine),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.size&&(i.size=this.size),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==wo&&(i.blending=this.blending),!0===this.flatShading&&(i.flatShading=this.flatShading),this.side!==vo&&(i.side=this.side),this.vertexColors!==xo&&(i.vertexColors=this.vertexColors),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),0<this.alphaTest&&(i.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(i.wireframe=this.wireframe),1<this.wireframeLinewidth&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(i.morphTargets=!0),!0===this.skinning&&(i.skinning=!0),!1===this.visible&&(i.visible=!1),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),n&&(n=e(t.textures),t=e(t.images),0<n.length&&(i.textures=n),0<t.length&&(i.images=t)),i},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.lights=t.lights,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.userData=JSON.parse(JSON.stringify(t.userData)),this.clipShadows=t.clipShadows,this.clipIntersection=t.clipIntersection;var e=t.clippingPlanes,n=null;if(null!==e)for(var i=e.length,n=new Array(i),r=0;r!==i;++r)n[r]=e[r].clone();return this.clippingPlanes=n,this.shadowSide=t.shadowSide,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});var vh,gh,yh,xh,bh,wh,Mh,_h,Eh,Ah,Sh,Th,Lh,Rh,Ch,Ph,Ih,Oh,Dh,Nh,zh,Uh,Bh,kh,Fh,Gh,Hh,jh,Vh,Wh,qh,Xh,Yh,Zh,Jh,Qh,Kh,$h,tl,el,nl,il,rl,ol,al="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",sl="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";function cl(t,e,n,i,r,o,a,s){if(null===(e.side===go?i.intersectTriangle(a,o,r,!0,s):i.intersectTriangle(r,o,a,e.side!==yo,s)))return null;Ih.copy(s),Ih.applyMatrix4(t.matrixWorld);s=n.ray.origin.distanceTo(Ih);return s<n.near||s>n.far?null:{distance:s,point:Ih.clone(),object:t}}function hl(t,e,n,i,r,o,a,s,c,h){xh.fromBufferAttribute(r,s),bh.fromBufferAttribute(r,c),wh.fromBufferAttribute(r,h);var l=t.morphTargetInfluences;if(e.morphTargets&&o&&l){Ah.set(0,0,0),Sh.set(0,0,0),Th.set(0,0,0);for(var u=0,d=o.length;u<d;u++){var p=l[u],f=o[u];0!==p&&(Mh.fromBufferAttribute(f,s),_h.fromBufferAttribute(f,c),Eh.fromBufferAttribute(f,h),Ah.addScaledVector(Mh.sub(xh),p),Sh.addScaledVector(_h.sub(bh),p),Th.addScaledVector(Eh.sub(wh),p))}xh.add(Ah),bh.add(Sh),wh.add(Th)}i=cl(t,e,n,i,xh,bh,wh,Ph);return i&&(a&&(Lh.fromBufferAttribute(a,s),Rh.fromBufferAttribute(a,c),Ch.fromBufferAttribute(a,h),i.uv=F.getUV(Ph,xh,bh,wh,Lh,Rh,Ch,new wt)),a=new L(s,c,h),F.getNormal(xh,bh,wh,a.normal),i.face=a),i}((B.prototype=Object.create(N.prototype)).constructor=B).prototype.isShaderMaterial=!0,B.prototype.copy=function(t){return N.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=Tt(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=t.extensions,this},B.prototype.toJSON=function(t){var e,n=N.prototype.toJSON.call(this,t);for(e in n.uniforms={},this.uniforms){var i=this.uniforms[e].value;i&&i.isTexture?n.uniforms[e]={type:"t",value:i.toJSON(t).uuid}:i&&i.isColor?n.uniforms[e]={type:"c",value:i.getHex()}:i&&i.isVector2?n.uniforms[e]={type:"v2",value:i.toArray()}:i&&i.isVector3?n.uniforms[e]={type:"v3",value:i.toArray()}:i&&i.isVector4?n.uniforms[e]={type:"v4",value:i.toArray()}:i&&i.isMatrix3?n.uniforms[e]={type:"m3",value:i.toArray()}:i&&i.isMatrix4?n.uniforms[e]={type:"m4",value:i.toArray()}:n.uniforms[e]={value:i}}0<Object.keys(this.defines).length&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader;var r,o={};for(r in this.extensions)!0===this.extensions[r]&&(o[r]=!0);return 0<Object.keys(o).length&&(n.extensions=o),n},Object.assign(k.prototype,{set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new Mt),e.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:(ol=new Mt,function(t){return this.origin.copy(this.at(t,ol)),this}),closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new Mt),e.subVectors(t,this.origin);t=e.dot(this.direction);return t<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(t).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:(rl=new Mt,function(t){var e=rl.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(rl.copy(this.direction).multiplyScalar(e).add(this.origin),rl.distanceToSquared(t))}),distanceSqToSegment:(el=new Mt,nl=new Mt,il=new Mt,function(t,e,n,i){el.copy(t).add(e).multiplyScalar(.5),nl.copy(e).sub(t).normalize(),il.copy(this.origin).sub(el);var r,o,a=.5*t.distanceTo(e),s=-this.direction.dot(nl),c=il.dot(this.direction),h=-il.dot(nl),l=il.lengthSq(),t=Math.abs(1-s*s);return l=0<t?(o=s*c-h,e=a*t,0<=(r=s*h-c)?-e<=o?o<=e?(r*=t=1/t)*(r+s*(o*=t)+2*c)+o*(s*r+o+2*h)+l:(o=a,-(r=Math.max(0,-(s*o+c)))*r+o*(o+2*h)+l):(o=-a,-(r=Math.max(0,-(s*o+c)))*r+o*(o+2*h)+l):o<=-e?-(r=Math.max(0,-(-s*a+c)))*r+(o=0<r?-a:Math.min(Math.max(-a,-h),a))*(o+2*h)+l:o<=e?(r=0,(o=Math.min(Math.max(-a,-h),a))*(o+2*h)+l):-(r=Math.max(0,-(s*a+c)))*r+(o=0<r?a:Math.min(Math.max(-a,-h),a))*(o+2*h)+l):(o=0<s?-a:a,-(r=Math.max(0,-(s*o+c)))*r+o*(o+2*h)+l),n&&n.copy(this.direction).multiplyScalar(r).add(this.origin),i&&i.copy(nl).multiplyScalar(o).add(el),l}),intersectSphere:(tl=new Mt,function(t,e){tl.subVectors(t.center,this.origin);var n=tl.dot(this.direction),i=tl.dot(tl)-n*n,t=t.radius*t.radius;if(t<i)return null;t=Math.sqrt(t-i),i=n-t,t=n+t;return i<0&&t<0?null:i<0?this.at(t,e):this.at(i,e)}),intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;e=-(this.origin.dot(t.normal)+t.constant)/e;return 0<=e?e:null},intersectPlane:function(t,e){t=this.distanceToPlane(t);return null===t?null:this.at(t,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},intersectBox:function(t,e){var n,i,r,o=1/this.direction.x,a=1/this.direction.y,s=1/this.direction.z,c=this.origin,o=0<=o?(n=(t.min.x-c.x)*o,(t.max.x-c.x)*o):(n=(t.max.x-c.x)*o,(t.min.x-c.x)*o),a=0<=a?(i=(t.min.y-c.y)*a,(t.max.y-c.y)*a):(i=(t.max.y-c.y)*a,(t.min.y-c.y)*a);return a<n||o<i?null:((n<i||n!=n)&&(n=i),(a<o||o!=o)&&(o=a),(s=0<=s?(r=(t.min.z-c.z)*s,(t.max.z-c.z)*s):(r=(t.max.z-c.z)*s,(t.min.z-c.z)*s))<n||o<r?null:((n<r||n!=n)&&(n=r),(s<o||o!=o)&&(o=s),o<0?null:this.at(0<=n?n:o,e)))},intersectsBox:($h=new Mt,function(t){return null!==this.intersectBox(t,$h)}),intersectTriangle:(Zh=new Mt,Jh=new Mt,Qh=new Mt,Kh=new Mt,function(t,e,n,i,r){Jh.subVectors(e,t),Qh.subVectors(n,t),Kh.crossVectors(Jh,Qh);n=this.direction.dot(Kh);if(0<n){if(i)return null;o=1}else{if(!(n<0))return null;o=-1,n=-n}Zh.subVectors(this.origin,t);i=o*this.direction.dot(Qh.crossVectors(Zh,Qh));if(i<0)return null;t=o*this.direction.dot(Jh.cross(Zh));if(t<0)return null;if(n<i+t)return null;var o=-o*Zh.dot(Kh);return o<0?null:this.at(o/n,r)}),applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}}),Object.assign(F,{getNormal:(Yh=new Mt,function(t,e,n,i){void 0===i&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new Mt),i.subVectors(n,e),Yh.subVectors(t,e),i.cross(Yh);e=i.lengthSq();return 0<e?i.multiplyScalar(1/Math.sqrt(e)):i.set(0,0,0)}),getBarycoord:(Wh=new Mt,qh=new Mt,Xh=new Mt,function(t,e,n,i,r){Wh.subVectors(i,e),qh.subVectors(n,e),Xh.subVectors(t,e);var o=Wh.dot(Wh),a=Wh.dot(qh),i=Wh.dot(Xh),n=qh.dot(qh),t=qh.dot(Xh),e=o*n-a*a;if(void 0===r&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new Mt),0==e)return r.set(-2,-1,-1);e=1/e,n=(n*i-a*t)*e,e*=o*t-a*i;return r.set(1-n-e,e,n)}),containsPoint:(Vh=new Mt,function(t,e,n,i){return F.getBarycoord(t,e,n,i,Vh),0<=Vh.x&&0<=Vh.y&&Vh.x+Vh.y<=1}),getUV:(jh=new Mt,function(t,e,n,i,r,o,a,s){return this.getBarycoord(t,e,n,i,jh),s.set(0,0),s.addScaledVector(r,jh.x),s.addScaledVector(o,jh.y),s.addScaledVector(a,jh.z),s}),isFrontFacing:(Gh=new Mt,Hh=new Mt,function(t,e,n,i){return Gh.subVectors(n,e),Hh.subVectors(t,e),Gh.cross(Hh).dot(i)<0})}),Object.assign(F.prototype,{set:function(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this},setFromPointsAndIndices:function(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},getArea:(kh=new Mt,Fh=new Mt,function(){return kh.subVectors(this.c,this.b),Fh.subVectors(this.a,this.b),.5*kh.cross(Fh).length()}),getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new Mt),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return F.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new Mt),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return F.getBarycoord(t,this.a,this.b,this.c,e)},getUV:function(t,e,n,i,r){return F.getUV(t,this.a,this.b,this.c,e,n,i,r)},containsPoint:function(t){return F.containsPoint(t,this.a,this.b,this.c)},isFrontFacing:function(t){return F.isFrontFacing(this.a,this.b,this.c,t)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:(Oh=new Mt,Dh=new Mt,Nh=new Mt,zh=new Mt,Uh=new Mt,Bh=new Mt,function(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new Mt);var n=this.a,i=this.b,r=this.c;Oh.subVectors(i,n),Dh.subVectors(r,n),zh.subVectors(t,n);var o=Oh.dot(zh),a=Dh.dot(zh);if(o<=0&&a<=0)return e.copy(n);Uh.subVectors(t,i);var s=Oh.dot(Uh),c=Dh.dot(Uh);if(0<=s&&c<=s)return e.copy(i);var h=o*c-s*a;if(h<=0&&0<=o&&s<=0)return u=o/(o-s),e.copy(n).addScaledVector(Oh,u);Bh.subVectors(t,r);var l=Oh.dot(Bh),t=Dh.dot(Bh);if(0<=t&&l<=t)return e.copy(r);o=l*a-o*t;if(o<=0&&0<=a&&t<=0)return d=a/(a-t),e.copy(n).addScaledVector(Dh,d);a=s*t-l*c;if(a<=0&&0<=c-s&&0<=l-t)return Nh.subVectors(r,i),d=(c-s)/(c-s+(l-t)),e.copy(i).addScaledVector(Nh,d);var a=1/(a+o+h),u=o*a,d=h*a;return e.copy(n).addScaledVector(Oh,u).addScaledVector(Dh,d)}),equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}),((G.prototype=Object.create(N.prototype)).constructor=G).prototype.isMeshBasicMaterial=!0,G.prototype.copy=function(t){return N.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this},H.prototype=Object.assign(Object.create(f.prototype),{constructor:H,isMesh:!0,setDrawMode:function(t){this.drawMode=t},copy:function(t){return f.prototype.copy.call(this,t),this.drawMode=t.drawMode,void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this},updateMorphTargets:function(){var t,e,n,i=this.geometry;if(i.isBufferGeometry){var r=i.morphAttributes,o=Object.keys(r);if(0<o.length){var a=r[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=a.length;t<e;t++)n=a[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=t}}else{i=i.morphTargets;void 0!==i&&0<i.length&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:(vh=new St,gh=new k,yh=new g,xh=new Mt,bh=new Mt,wh=new Mt,Mh=new Mt,_h=new Mt,Eh=new Mt,Ah=new Mt,Sh=new Mt,Th=new Mt,Lh=new wt,Rh=new wt,Ch=new wt,Ph=new Mt,Ih=new Mt,function(t,e){var n,i=this.geometry,r=this.material,o=this.matrixWorld;if(void 0!==r&&(null===i.boundingSphere&&i.computeBoundingSphere(),yh.copy(i.boundingSphere),yh.applyMatrix4(o),!1!==t.ray.intersectsSphere(yh)&&(vh.getInverse(o),gh.copy(t.ray).applyMatrix4(vh),null===i.boundingBox||!1!==gh.intersectsBox(i.boundingBox))))if(i.isBufferGeometry){var a,s,c,h,l,u,d,p,f,m=i.index,v=i.attributes.position,g=i.morphAttributes.position,y=i.attributes.uv,x=i.groups,b=i.drawRange;if(null!==m)if(Array.isArray(r))for(h=0,u=x.length;h<u;h++)for(f=r[(p=x[h]).materialIndex],l=Math.max(p.start,b.start),d=Math.min(p.start+p.count,b.start+b.count);l<d;l+=3)a=m.getX(l),s=m.getX(l+1),c=m.getX(l+2),(n=hl(this,f,t,gh,v,g,y,a,s,c))&&(n.faceIndex=Math.floor(l/3),n.face.materialIndex=p.materialIndex,e.push(n));else for(h=Math.max(0,b.start),u=Math.min(m.count,b.start+b.count);h<u;h+=3)a=m.getX(h),s=m.getX(h+1),c=m.getX(h+2),(n=hl(this,r,t,gh,v,g,y,a,s,c))&&(n.faceIndex=Math.floor(h/3),e.push(n));else if(void 0!==v)if(Array.isArray(r))for(h=0,u=x.length;h<u;h++)for(f=r[(p=x[h]).materialIndex],l=Math.max(p.start,b.start),d=Math.min(p.start+p.count,b.start+b.count);l<d;l+=3)(n=hl(this,f,t,gh,v,g,y,a=l,s=l+1,c=l+2))&&(n.faceIndex=Math.floor(l/3),n.face.materialIndex=p.materialIndex,e.push(n));else for(h=Math.max(0,b.start),u=Math.min(v.count,b.start+b.count);h<u;h+=3)(n=hl(this,r,t,gh,v,g,y,a=h,s=h+1,c=h+2))&&(n.faceIndex=Math.floor(h/3),e.push(n))}else if(i.isGeometry){var w,M,_,E,A=Array.isArray(r),S=i.vertices,T=i.faces,i=i.faceVertexUvs[0];0<i.length&&(E=i);for(var L=0,R=T.length;L<R;L++){var C=T[L],P=A?r[C.materialIndex]:r;void 0!==P&&(w=S[C.a],M=S[C.b],_=S[C.c],n=cl(this,P,t,gh,w,M,_,Ph))&&(E&&E[L]&&(P=E[L],Lh.copy(P[0]),Rh.copy(P[1]),Ch.copy(P[2]),n.uv=F.getUV(Ph,w,M,_,Lh,Rh,Ch,new wt)),n.face=C,n.faceIndex=L,e.push(n))}}}),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),((V.prototype=Object.create(d.prototype)).constructor=V).prototype.isCubeTexture=!0,Object.defineProperty(V.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}}),((W.prototype=Object.create(d.prototype)).constructor=W).prototype.isDataTexture2DArray=!0,((q.prototype=Object.create(d.prototype)).constructor=q).prototype.isDataTexture3D=!0;var ll=new d,ul=new W,dl=new q,pl=new V,fl=[],ml=[],vl=new Float32Array(16),gl=new Float32Array(9),yl=new Float32Array(4);Wt.prototype.updateCache=function(t){var e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),Z(e,t)},qt.prototype.setValue=function(t,e,n){for(var i=this.seq,r=0,o=i.length;r!==o;++r){var a=i[r];a.setValue(t,e[a.id],n)}};var xl=/([\w\d_]+)(\])?(\[|\.)?/g;Yt.prototype.setValue=function(t,e,n,i){e=this.map[e];void 0!==e&&e.setValue(t,n,i)},Yt.prototype.setOptional=function(t,e,n){e=e[n];void 0!==e&&this.setValue(t,n,e)},Yt.upload=function(t,e,n,i){for(var r=0,o=e.length;r!==o;++r){var a=e[r],s=n[a.id];!1!==s.needsUpdate&&a.setValue(t,s.value,i)}},Yt.seqWithValue=function(t,e){for(var n=[],i=0,r=t.length;i!==r;++i){var o=t[i];o.id in e&&n.push(o)}return n};var bl=0,wl=0;((fe.prototype=Object.create(N.prototype)).constructor=fe).prototype.isMeshDepthMaterial=!0,fe.prototype.copy=function(t){return N.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},((me.prototype=Object.create(N.prototype)).constructor=me).prototype.isMeshDistanceMaterial=!0,me.prototype.copy=function(t){return N.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this},be.prototype=Object.assign(Object.create(f.prototype),{constructor:be,isGroup:!0}),we.prototype=Object.assign(Object.create(f.prototype),{constructor:we,isCamera:!0,copy:function(t,e){return f.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new Mt),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){f.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),Me.prototype=Object.assign(Object.create(we.prototype),{constructor:Me,isPerspectiveCamera:!0,copy:function(t,e){return we.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){t=.5*this.getFilmHeight()/t;this.fov=2*As.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*As.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*As.RAD2DEG*Math.atan(Math.tan(.5*As.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,n,i,r,o){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t,e=this.near,n=e*Math.tan(.5*As.DEG2RAD*this.fov)/this.zoom,i=2*n,r=this.aspect*i,o=-.5*r,a=this.view;null!==this.view&&this.view.enabled&&(t=a.fullWidth,s=a.fullHeight,o+=a.offsetX*r/t,n-=a.offsetY*i/s,r*=a.width/t,i*=a.height/s);var s=this.filmOffset;0!==s&&(o+=e*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+r,n,n-i,e,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){t=f.prototype.toJSON.call(this,t);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}),_e.prototype=Object.assign(Object.create(Me.prototype),{constructor:_e,isArrayCamera:!0});var Ml,_l,El,Al,Sl,Tl,Ll,Rl,Cl,Pl,Il,Ol,Dl,Nl,zl,Ul,Bl,kl,Fl,Gl,Hl,jl,Vl,Wl,ql,Xl,Yl,Zl,Jl=new Mt,Ql=new Mt;function Kl(t,e,n,i,r,o){Gl.subVectors(t,n).addScalar(.5).multiply(i),void 0!==r?(Hl.x=o*Gl.x-r*Gl.y,Hl.y=r*Gl.x+o*Gl.y):Hl.copy(Gl),t.copy(e),t.x+=Hl.x,t.y+=Hl.y,t.applyMatrix4(jl)}Object.assign(Le.prototype,{isFogExp2:!0,clone:function(){return new Le(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(Re.prototype,{isFog:!0,clone:function(){return new Re(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Ce.prototype=Object.assign(Object.create(f.prototype),{constructor:Ce,isScene:!0,copy:function(t,e){return f.prototype.copy.call(this,t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},toJSON:function(t){var e=f.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Pe.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Pe.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==t?t.length/this.stride:0,this.array=t,this},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.dynamic=t.dynamic,this},copyAt:function(t,e,n){t*=this.stride,n*=e.stride;for(var i=0,r=this.stride;i<r;i++)this.array[t+i]=e.array[n+i];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(t){return this.onUploadCallback=t,this}}),Object.defineProperties(Ie.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(Ie.prototype,{isInterleavedBufferAttribute:!0,setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this},setXYZ:function(t,e,n,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this},setXYZW:function(t,e,n,i,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this.data.array[t+3]=r,this}}),((Oe.prototype=Object.create(N.prototype)).constructor=Oe).prototype.isSpriteMaterial=!0,Oe.prototype.copy=function(t){return N.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this},De.prototype=Object.assign(Object.create(f.prototype),{constructor:De,isSprite:!0,raycast:(Bl=new Mt,kl=new Mt,Fl=new Mt,Gl=new wt,Hl=new wt,jl=new St,Vl=new Mt,Wl=new Mt,ql=new Mt,Xl=new wt,Yl=new wt,Zl=new wt,function(t,e){kl.setFromMatrixScale(this.matrixWorld),jl.getInverse(this.modelViewMatrix).premultiply(this.matrixWorld),Fl.setFromMatrixPosition(this.modelViewMatrix);var n,i=this.material.rotation;0!==i&&(r=Math.cos(i),n=Math.sin(i));var r,i=this.center;Kl(Vl.set(-.5,-.5,0),Fl,i,kl,n,r),Kl(Wl.set(.5,-.5,0),Fl,i,kl,n,r),Kl(ql.set(.5,.5,0),Fl,i,kl,n,r),Xl.set(0,0),Yl.set(1,0),Zl.set(1,1),null===t.ray.intersectTriangle(Vl,Wl,ql,!1,Bl)&&(Kl(Wl.set(-.5,.5,0),Fl,i,kl,n,r),Yl.set(0,1),null===t.ray.intersectTriangle(Vl,ql,Wl,!1,Bl))||((r=t.ray.origin.distanceTo(Bl))<t.near||r>t.far||e.push({distance:r,point:Bl.clone(),uv:F.getUV(Bl,Vl,Wl,ql,Xl,Yl,Zl,new wt),face:null,object:this}))}),clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return f.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}}),Ne.prototype=Object.assign(Object.create(f.prototype),{constructor:Ne,isLOD:!0,copy:function(t){f.prototype.copy.call(this,t,!1);for(var e=t.levels,n=0,i=e.length;n<i;n++){var r=e[n];this.addLevel(r.object.clone(),r.distance)}return this},addLevel:function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var n=this.levels,i=0;i<n.length&&!(e<n[i].distance);i++);return n.splice(i,0,{distance:e,object:t}),this.add(t),this},getObjectForDistance:function(t){for(var e=this.levels,n=1,i=e.length;n<i&&!(t<e[n].distance);n++);return e[n-1].object},raycast:(Ul=new Mt,function(t,e){Ul.setFromMatrixPosition(this.matrixWorld);var n=t.ray.origin.distanceTo(Ul);this.getObjectForDistance(n).raycast(t,e)}),update:(Nl=new Mt,zl=new Mt,function(t){var e=this.levels;if(1<e.length){Nl.setFromMatrixPosition(t.matrixWorld),zl.setFromMatrixPosition(this.matrixWorld);var n=Nl.distanceTo(zl);e[0].object.visible=!0;for(var i=1,r=e.length;i<r&&n>=e[i].distance;i++)e[i-1].object.visible=!1,e[i].object.visible=!0;for(;i<r;i++)e[i].object.visible=!1}}),toJSON:function(t){var e=f.prototype.toJSON.call(this,t);e.object.levels=[];for(var n=this.levels,i=0,r=n.length;i<r;i++){var o=n[i];e.object.levels.push({object:o.object.uuid,distance:o.distance})}return e}}),ze.prototype=Object.assign(Object.create(H.prototype),{constructor:ze,isSkinnedMesh:!0,bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var t=new _t,e=this.geometry.attributes.skinWeight,n=0,i=e.count;n<i;n++){t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.w=e.getW(n);var r=1/t.manhattanLength();r!=1/0?t.multiplyScalar(r):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}},updateMatrixWorld:function(t){H.prototype.updateMatrixWorld.call(this,t),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Object.assign(Ue.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var n=new St;this.bones[t]&&n.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(n)}},pose:function(){for(var t,e=0,n=this.bones.length;e<n;e++)(t=this.bones[e])&&t.matrixWorld.getInverse(this.boneInverses[e]);for(e=0,n=this.bones.length;e<n;e++)(t=this.bones[e])&&(t.parent&&t.parent.isBone?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},update:(Ol=new St,Dl=new St,function(){for(var t=this.bones,e=this.boneInverses,n=this.boneMatrices,i=this.boneTexture,r=0,o=t.length;r<o;r++){var a=t[r]?t[r].matrixWorld:Dl;Ol.multiplyMatrices(a,e[r]),Ol.toArray(n,16*r)}void 0!==i&&(i.needsUpdate=!0)}),clone:function(){return new Ue(this.bones,this.boneInverses)},getBoneByName:function(t){for(var e=0,n=this.bones.length;e<n;e++){var i=this.bones[e];if(i.name===t)return i}}}),Be.prototype=Object.assign(Object.create(f.prototype),{constructor:Be,isBone:!0}),((ke.prototype=Object.create(N.prototype)).constructor=ke).prototype.isLineBasicMaterial=!0,ke.prototype.copy=function(t){return N.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this},Fe.prototype=Object.assign(Object.create(f.prototype),{constructor:Fe,isLine:!0,computeLineDistances:(Pl=new Mt,Il=new Mt,function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[0],i=1,r=e.count;i<r;i++)Pl.fromBufferAttribute(e,i-1),Il.fromBufferAttribute(e,i),n[i]=n[i-1],n[i]+=Pl.distanceTo(Il);t.addAttribute("lineDistance",new z(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){var o=t.vertices;(n=t.lineDistances)[0]=0;for(i=1,r=o.length;i<r;i++)n[i]=n[i-1],n[i]+=o[i-1].distanceTo(o[i])}return this}),raycast:(Ll=new St,Rl=new k,Cl=new g,function(t,e){var n=t.linePrecision,i=this.geometry,r=this.matrixWorld;if(null===i.boundingSphere&&i.computeBoundingSphere(),Cl.copy(i.boundingSphere),Cl.applyMatrix4(r),Cl.radius+=n,!1!==t.ray.intersectsSphere(Cl)){Ll.getInverse(r),Rl.copy(t.ray).applyMatrix4(Ll);var n=n/((this.scale.x+this.scale.y+this.scale.z)/3),o=n*n,a=new Mt,s=new Mt,c=new Mt,h=new Mt,l=this&&this.isLineSegments?2:1;if(i.isBufferGeometry){var n=i.index,u=i.attributes.position.array;if(null!==n)for(var d=n.array,p=0,f=d.length-1;p<f;p+=l){var m,v=d[p],g=d[p+1];a.fromArray(u,3*v),s.fromArray(u,3*g),o<Rl.distanceSqToSegment(a,s,h,c)||(h.applyMatrix4(this.matrixWorld),(m=t.ray.origin.distanceTo(h))<t.near||m>t.far||e.push({distance:m,point:c.clone().applyMatrix4(this.matrixWorld),index:p,face:null,faceIndex:null,object:this}))}else for(p=0,f=u.length/3-1;p<f;p+=l)a.fromArray(u,3*p),s.fromArray(u,3*p+3),o<Rl.distanceSqToSegment(a,s,h,c)||(h.applyMatrix4(this.matrixWorld),(m=t.ray.origin.distanceTo(h))<t.near||m>t.far||e.push({distance:m,point:c.clone().applyMatrix4(this.matrixWorld),index:p,face:null,faceIndex:null,object:this}))}else if(i.isGeometry)for(var y=i.vertices,x=y.length,p=0;p<x-1;p+=l)o<Rl.distanceSqToSegment(y[p],y[p+1],h,c)||(h.applyMatrix4(this.matrixWorld),(m=t.ray.origin.distanceTo(h))<t.near||m>t.far||e.push({distance:m,point:c.clone().applyMatrix4(this.matrixWorld),index:p,face:null,faceIndex:null,object:this}))}}),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Ge.prototype=Object.assign(Object.create(Fe.prototype),{constructor:Ge,isLineSegments:!0,computeLineDistances:(Sl=new Mt,Tl=new Mt,function(){var t=this.geometry;if(t.isBufferGeometry)if(null===t.index){for(var e=t.attributes.position,n=[],i=0,r=e.count;i<r;i+=2)Sl.fromBufferAttribute(e,i),Tl.fromBufferAttribute(e,i+1),n[i]=0===i?0:n[i-1],n[i+1]=n[i]+Sl.distanceTo(Tl);t.addAttribute("lineDistance",new z(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry)for(var o=t.vertices,n=t.lineDistances,i=0,r=o.length;i<r;i+=2)Sl.copy(o[i]),Tl.copy(o[i+1]),n[i]=0===i?0:n[i-1],n[i+1]=n[i]+Sl.distanceTo(Tl);return this})}),He.prototype=Object.assign(Object.create(Fe.prototype),{constructor:He,isLineLoop:!0}),((je.prototype=Object.create(N.prototype)).constructor=je).prototype.isPointsMaterial=!0,je.prototype.copy=function(t){return N.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this},Ve.prototype=Object.assign(Object.create(f.prototype),{constructor:Ve,isPoints:!0,raycast:(_l=new St,El=new k,Al=new g,function(i,r){function t(t,e){var n=El.distanceSqToPoint(t);n<s&&(El.closestPointToPoint(t,h),h.applyMatrix4(a),(t=i.ray.origin.distanceTo(h))<i.near||t>i.far||r.push({distance:t,distanceToRay:Math.sqrt(n),point:h.clone(),index:e,face:null,object:o}))}var o=this,e=this.geometry,a=this.matrixWorld,n=i.params.Points.threshold;if(null===e.boundingSphere&&e.computeBoundingSphere(),Al.copy(e.boundingSphere),Al.applyMatrix4(a),Al.radius+=n,!1!==i.ray.intersectsSphere(Al)){_l.getInverse(a),El.copy(i.ray).applyMatrix4(_l);var n=n/((this.scale.x+this.scale.y+this.scale.z)/3),s=n*n,c=new Mt,h=new Mt;if(e.isBufferGeometry){var n=e.index,l=e.attributes.position.array;if(null!==n)for(var u=n.array,d=0,p=u.length;d<p;d++){var f=u[d];c.fromArray(l,3*f),t(c,f)}else for(var d=0,m=l.length/3;d<m;d++)c.fromArray(l,3*d),t(c,d)}else for(var v=e.vertices,d=0,m=v.length;d<m;d++)t(v[d],d)}}),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),We.prototype=Object.assign(Object.create(d.prototype),{constructor:We,isVideoTexture:!0,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),((qe.prototype=Object.create(d.prototype)).constructor=qe).prototype.isCompressedTexture=!0,((Xe.prototype=Object.create(d.prototype)).constructor=Xe).prototype.isCanvasTexture=!0,((Ye.prototype=Object.create(d.prototype)).constructor=Ye).prototype.isDepthTexture=!0,(Ze.prototype=Object.create(U.prototype)).constructor=Ze,(Je.prototype=Object.create(x.prototype)).constructor=Je,(Qe.prototype=Object.create(U.prototype)).constructor=Qe,(Ke.prototype=Object.create(x.prototype)).constructor=Ke,($e.prototype=Object.create(U.prototype)).constructor=$e,(tn.prototype=Object.create(x.prototype)).constructor=tn,(en.prototype=Object.create($e.prototype)).constructor=en,(nn.prototype=Object.create(x.prototype)).constructor=nn,(rn.prototype=Object.create($e.prototype)).constructor=rn,(on.prototype=Object.create(x.prototype)).constructor=on,(an.prototype=Object.create($e.prototype)).constructor=an,(sn.prototype=Object.create(x.prototype)).constructor=sn,(cn.prototype=Object.create($e.prototype)).constructor=cn,(hn.prototype=Object.create(x.prototype)).constructor=hn,((ln.prototype=Object.create(U.prototype)).constructor=ln).prototype.toJSON=function(){var t=U.prototype.toJSON.call(this);return t.path=this.parameters.path.toJSON(),t},(un.prototype=Object.create(x.prototype)).constructor=un,(dn.prototype=Object.create(U.prototype)).constructor=dn,(pn.prototype=Object.create(x.prototype)).constructor=pn,(fn.prototype=Object.create(U.prototype)).constructor=fn;var $l=function(t,e,n){n=n||2;var i,r,o,a,s,c,h,l=e&&e.length,u=l?e[0]*n:t.length,d=mn(t,0,u,n,!0),p=[];if(!d)return p;if(l&&(d=yn(t,e,d,n)),t.length>80*n){i=o=t[0],r=a=t[1];for(var f=n;f<u;f+=n)(s=t[f])<i&&(i=s),(c=t[f+1])<r&&(r=c),o<s&&(o=s),a<c&&(a=c);h=0!==(h=Math.max(o-i,a-r))?1/h:0}return gn(d,p,n,i,r,h),p},tu={area:function(t){for(var e=t.length,n=0,i=e-1,r=0;r<e;i=r++)n+=t[i].x*t[r].y-t[r].x*t[i].y;return.5*n},isClockWise:function(t){return tu.area(t)<0},triangulateShape:function(t,e){var n=[],i=[],r=[];Cn(t),Pn(n,t);var o=t.length;e.forEach(Cn);for(var a=0;a<e.length;a++)i.push(o),o+=e[a].length,Pn(n,e[a]);for(var s=$l(n,i),a=0;a<s.length;a+=3)r.push(s.slice(a,a+3));return r}};((In.prototype=Object.create(x.prototype)).constructor=In).prototype.toJSON=function(){var t=x.prototype.toJSON.call(this);return Dn(this.parameters.shapes,this.parameters.options,t)},((On.prototype=Object.create(U.prototype)).constructor=On).prototype.toJSON=function(){var t=U.prototype.toJSON.call(this);return Dn(this.parameters.shapes,this.parameters.options,t)};var eu={generateTopUV:function(t,e,n,i,r){var o=e[3*n],a=e[3*n+1],s=e[3*i],n=e[3*i+1],i=e[3*r],r=e[3*r+1];return[new wt(o,a),new wt(s,n),new wt(i,r)]},generateSideWallUV:function(t,e,n,i,r,o){var a=e[3*n],s=e[3*n+1],c=e[3*n+2],h=e[3*i],l=e[3*i+1],u=e[3*i+2],d=e[3*r],p=e[3*r+1],n=e[3*r+2],i=e[3*o],r=e[3*o+1],o=e[3*o+2];return Math.abs(s-l)<.01?[new wt(a,1-c),new wt(h,1-u),new wt(d,1-n),new wt(i,1-o)]:[new wt(s,1-c),new wt(l,1-u),new wt(p,1-n),new wt(r,1-o)]}};(Nn.prototype=Object.create(x.prototype)).constructor=Nn,(zn.prototype=Object.create(On.prototype)).constructor=zn,(Un.prototype=Object.create(x.prototype)).constructor=Un,(Bn.prototype=Object.create(U.prototype)).constructor=Bn,(kn.prototype=Object.create(x.prototype)).constructor=kn,(Fn.prototype=Object.create(U.prototype)).constructor=Fn,(Gn.prototype=Object.create(x.prototype)).constructor=Gn,(Hn.prototype=Object.create(U.prototype)).constructor=Hn,((jn.prototype=Object.create(x.prototype)).constructor=jn).prototype.toJSON=function(){var t=x.prototype.toJSON.call(this);return Wn(this.parameters.shapes,t)},((Vn.prototype=Object.create(U.prototype)).constructor=Vn).prototype.toJSON=function(){var t=U.prototype.toJSON.call(this);return Wn(this.parameters.shapes,t)},(qn.prototype=Object.create(U.prototype)).constructor=qn,(Xn.prototype=Object.create(x.prototype)).constructor=Xn,(Yn.prototype=Object.create(U.prototype)).constructor=Yn,(Zn.prototype=Object.create(Xn.prototype)).constructor=Zn,(Jn.prototype=Object.create(Yn.prototype)).constructor=Jn,(Qn.prototype=Object.create(x.prototype)).constructor=Qn,(Kn.prototype=Object.create(U.prototype)).constructor=Kn;var nu=Object.freeze({WireframeGeometry:Ze,ParametricGeometry:Je,ParametricBufferGeometry:Qe,TetrahedronGeometry:tn,TetrahedronBufferGeometry:en,OctahedronGeometry:nn,OctahedronBufferGeometry:rn,IcosahedronGeometry:on,IcosahedronBufferGeometry:an,DodecahedronGeometry:sn,DodecahedronBufferGeometry:cn,PolyhedronGeometry:Ke,PolyhedronBufferGeometry:$e,TubeGeometry:hn,TubeBufferGeometry:ln,TorusKnotGeometry:un,TorusKnotBufferGeometry:dn,TorusGeometry:pn,TorusBufferGeometry:fn,TextGeometry:Nn,TextBufferGeometry:zn,SphereGeometry:Un,SphereBufferGeometry:Bn,RingGeometry:kn,RingBufferGeometry:Fn,PlaneGeometry:O,PlaneBufferGeometry:D,LatheGeometry:Gn,LatheBufferGeometry:Hn,ShapeGeometry:jn,ShapeBufferGeometry:Vn,ExtrudeGeometry:In,ExtrudeBufferGeometry:On,EdgesGeometry:qn,ConeGeometry:Zn,ConeBufferGeometry:Jn,CylinderGeometry:Xn,CylinderBufferGeometry:Yn,CircleGeometry:Qn,CircleBufferGeometry:Kn,BoxGeometry:C,BoxBufferGeometry:P});(($n.prototype=Object.create(N.prototype)).constructor=$n).prototype.isShadowMaterial=!0,$n.prototype.copy=function(t){return N.prototype.copy.call(this,t),this.color.copy(t.color),this},((ti.prototype=Object.create(B.prototype)).constructor=ti).prototype.isRawShaderMaterial=!0,((ei.prototype=Object.create(N.prototype)).constructor=ei).prototype.isMeshStandardMaterial=!0,ei.prototype.copy=function(t){return N.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((ni.prototype=Object.create(ei.prototype)).constructor=ni).prototype.isMeshPhysicalMaterial=!0,ni.prototype.copy=function(t){return ei.prototype.copy.call(this,t),this.defines={PHYSICAL:""},this.reflectivity=t.reflectivity,this.clearCoat=t.clearCoat,this.clearCoatRoughness=t.clearCoatRoughness,this},((ii.prototype=Object.create(N.prototype)).constructor=ii).prototype.isMeshPhongMaterial=!0,ii.prototype.copy=function(t){return N.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((ri.prototype=Object.create(ii.prototype)).constructor=ri).prototype.isMeshToonMaterial=!0,ri.prototype.copy=function(t){return ii.prototype.copy.call(this,t),this.gradientMap=t.gradientMap,this},((oi.prototype=Object.create(N.prototype)).constructor=oi).prototype.isMeshNormalMaterial=!0,oi.prototype.copy=function(t){return N.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((ai.prototype=Object.create(N.prototype)).constructor=ai).prototype.isMeshLambertMaterial=!0,ai.prototype.copy=function(t){return N.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((si.prototype=Object.create(N.prototype)).constructor=si).prototype.isMeshMatcapMaterial=!0,si.prototype.copy=function(t){return N.prototype.copy.call(this,t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},((ci.prototype=Object.create(ke.prototype)).constructor=ci).prototype.isLineDashedMaterial=!0,ci.prototype.copy=function(t){return ke.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var iu=Object.freeze({ShadowMaterial:$n,SpriteMaterial:Oe,RawShaderMaterial:ti,ShaderMaterial:B,PointsMaterial:je,MeshPhysicalMaterial:ni,MeshStandardMaterial:ei,MeshPhongMaterial:ii,MeshToonMaterial:ri,MeshNormalMaterial:oi,MeshLambertMaterial:ai,MeshDepthMaterial:fe,MeshDistanceMaterial:me,MeshBasicMaterial:G,MeshMatcapMaterial:si,LineDashedMaterial:ci,LineBasicMaterial:ke,Material:N}),ru={arraySlice:function(t,e,n){return ru.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)},convertArray:function(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(n){for(var t=n.length,e=new Array(t),i=0;i!==t;++i)e[i]=i;return e.sort(function(t,e){return n[t]-n[e]}),e},sortedArray:function(t,e,n){for(var i=t.length,r=new t.constructor(i),o=0,a=0;a!==i;++o)for(var s=n[o]*e,c=0;c!==e;++c)r[a++]=t[s+c];return r},flattenJSON:function(t,e,n,i){for(var r=1,o=t[0];void 0!==o&&void 0===o[i];)o=t[r++];if(void 0!==o){var a=o[i];if(void 0!==a)if(Array.isArray(a))for(;void 0!==(a=o[i])&&(e.push(o.time),n.push.apply(n,a)),o=t[r++],void 0!==o;);else if(void 0!==a.toArray)for(;void 0!==(a=o[i])&&(e.push(o.time),a.toArray(n,n.length)),o=t[r++],void 0!==o;);else for(;void 0!==(a=o[i])&&(e.push(o.time),n.push(a)),o=t[r++],void 0!==o;);}}};Object.assign(hi.prototype,{evaluate:function(t){var e,n=this.parameterPositions,i=this._cachedIndex,r=n[i],o=n[i-1];t:{e:{n:{i:if(!(t<r)){for(var a=i+2;;){if(void 0===r){if(t<o)break i;return i=n.length,this._cachedIndex=i,this.afterEnd_(i-1,t,o)}if(i===a)break;if(o=r,t<(r=n[++i]))break e}e=n.length;break n}if(o<=t)break t;var s=n[1];t<s&&(i=2,o=s);for(a=i-2;;){if(void 0===o)return this._cachedIndex=0,this.beforeStart_(0,t,r);if(i===a)break;if(r=o,(o=n[--i-1])<=t)break e}e=i,i=0}for(;i<e;){var c=i+e>>>1;t<n[c]?e=c:i=1+c}if(r=n[i],void 0===(o=n[i-1]))return this._cachedIndex=0,this.beforeStart_(0,t,r);if(void 0===r)return i=n.length,this._cachedIndex=i,this.afterEnd_(i-1,o,t)}this._cachedIndex=i,this.intervalChanged_(i,o,r)}return this.interpolate_(i,o,t,r)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=t*i,o=0;o!==i;++o)e[o]=n[r+o];return e},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(hi.prototype,{beforeStart_:hi.prototype.copySampleValue_,afterEnd_:hi.prototype.copySampleValue_}),li.prototype=Object.assign(Object.create(hi.prototype),{constructor:li,DefaultSettings_:{endingStart:ls,endingEnd:ls},intervalChanged_:function(t,e,n){var i=this.parameterPositions,r=t-2,o=t+1,a=i[r],s=i[o];if(void 0===a)switch(this.getSettings_().endingStart){case 2401:r=t,a=2*e-n;break;case 2402:a=e+i[r=i.length-2]-i[r+1];break;default:r=t,a=n}if(void 0===s)switch(this.getSettings_().endingEnd){case 2401:o=t,s=2*n-e;break;case 2402:s=n+i[o=1]-i[0];break;default:o=t-1,s=e}var c=.5*(n-e),h=this.valueSize;this._weightPrev=c/(e-a),this._weightNext=c/(s-n),this._offsetPrev=r*h,this._offsetNext=o*h},interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,c=s-a,h=this._offsetPrev,l=this._offsetNext,u=this._weightPrev,t=this._weightNext,n=(n-e)/(i-e),i=n*n,e=i*n,d=-u*e+2*u*i-u*n,p=(1+u)*e+(-1.5-2*u)*i+(-.5+u)*n+1,f=(-1-t)*e+(1.5+t)*i+.5*n,m=t*e-t*i,v=0;v!==a;++v)r[v]=d*o[h+v]+p*o[c+v]+f*o[s+v]+m*o[l+v];return r}}),ui.prototype=Object.assign(Object.create(hi.prototype),{constructor:ui,interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,c=s-a,h=(n-e)/(i-e),l=1-h,u=0;u!==a;++u)r[u]=o[c+u]*l+o[s+u]*h;return r}}),di.prototype=Object.assign(Object.create(hi.prototype),{constructor:di,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(pi,{toJSON:function(t){var e,n=t.constructor;return void 0!==n.toJSON?e=n.toJSON(t):(e={name:t.name,times:ru.convertArray(t.times,Array),values:ru.convertArray(t.values,Array)},(n=t.getInterpolation())!==t.DefaultInterpolation&&(e.interpolation=n)),e.type=t.ValueTypeName,e}}),Object.assign(pi.prototype,{constructor:pi,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(t){return new di(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new ui(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new li(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e;switch(t){case 2300:e=this.InterpolantFactoryMethodDiscrete;break;case 2301:e=this.InterpolantFactoryMethodLinear;break;case 2302:e=this.InterpolantFactoryMethodSmooth}if(void 0!==e)return this.createInterpolant=e,this;var n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(n);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",n),this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var e=this.times,n=0,i=e.length;n!==i;++n)e[n]+=t;return this},scale:function(t){if(1!==t)for(var e=this.times,n=0,i=e.length;n!==i;++n)e[n]*=t;return this},trim:function(t,e){for(var n,i=this.times,r=i.length,o=0,a=r-1;o!==r&&i[o]<t;)++o;for(;-1!==a&&i[a]>e;)--a;return++a,0===o&&a===r||(a<=o&&(o=(a=Math.max(a,1))-1),n=this.getValueSize(),this.times=ru.arraySlice(i,o,a),this.values=ru.arraySlice(this.values,o*n,a*n)),this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);var n=this.times,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);for(var o=null,a=0;a!==r;a++){var s=n[a];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,s),t=!1;break}if(null!==o&&s<o){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,s,o),t=!1;break}o=s}if(void 0!==i&&ru.isTypedArray(i))for(var a=0,c=i.length;a!==c;++a){var h=i[a];if(isNaN(h)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,h),t=!1;break}}return t},optimize:function(){for(var t=this.times,e=this.values,n=this.getValueSize(),i=2302===this.getInterpolation(),r=1,o=t.length-1,a=1;a<o;++a){var s=!1,c=t[a];if(c!==t[a+1]&&(1!==a||c!==c[0]))if(i)s=!0;else for(var h=a*n,l=h-n,u=h+n,d=0;d!==n;++d){var p=e[h+d];if(p!==e[l+d]||p!==e[u+d]){s=!0;break}}if(s){if(a!==r){t[r]=t[a];for(var f=a*n,m=r*n,d=0;d!==n;++d)e[m+d]=e[f+d]}++r}}if(0<o){t[r]=t[o];for(f=o*n,m=r*n,d=0;d!==n;++d)e[m+d]=e[f+d];++r}return r!==t.length&&(this.times=ru.arraySlice(t,0,r),this.values=ru.arraySlice(e,0,r*n)),this},clone:function(){var t=ru.arraySlice(this.times,0),e=ru.arraySlice(this.values,0),e=new this.constructor(this.name,t,e);return e.createInterpolant=this.createInterpolant,e}}),fi.prototype=Object.assign(Object.create(pi.prototype),{constructor:fi,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),mi.prototype=Object.assign(Object.create(pi.prototype),{constructor:mi,ValueTypeName:"color"}),vi.prototype=Object.assign(Object.create(pi.prototype),{constructor:vi,ValueTypeName:"number"}),gi.prototype=Object.assign(Object.create(hi.prototype),{constructor:gi,interpolate_:function(t,e,n,i){for(var r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,c=(n-e)/(i-e),h=s+a;s!==h;s+=4)S.slerpFlat(r,0,o,s-a,o,s,c);return r}}),yi.prototype=Object.assign(Object.create(pi.prototype),{constructor:yi,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(t){return new gi(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),xi.prototype=Object.assign(Object.create(pi.prototype),{constructor:xi,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),bi.prototype=Object.assign(Object.create(pi.prototype),{constructor:bi,ValueTypeName:"vector"}),Object.assign(wi,{parse:function(t){for(var e=[],n=t.tracks,i=1/(t.fps||1),r=0,o=n.length;r!==o;++r)e.push(Mi(n[r]).scale(i));return new wi(t.name,t.duration,e)},toJSON:function(t){for(var e=[],n=t.tracks,t={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid},i=0,r=n.length;i!==r;++i)e.push(pi.toJSON(n[i]));return t},CreateFromMorphTargetSequence:function(t,e,n,i){for(var r=e.length,o=[],a=0;a<r;a++){var s=[];(h=[]).push((a+r-1)%r,a,(a+1)%r),s.push(0,1,0);var c=ru.getKeyframeOrder(h),h=ru.sortedArray(h,1,c),s=ru.sortedArray(s,1,c);i||0!==h[0]||(h.push(r),s.push(s[0])),o.push(new vi(".morphTargetInfluences["+e[a].name+"]",h,s).scale(1/n))}return new wi(t,-1,o)},findByName:function(t,e){var n=t;Array.isArray(t)||(n=t.geometry&&t.geometry.animations||t.animations);for(var i=0;i<n.length;i++)if(n[i].name===e)return n[i];return null},CreateClipsFromMorphTargetSequences:function(t,e,n){for(var i={},r=/^([\w-]*?)([\d]+)$/,o=0,a=t.length;o<a;o++){var s=t[o],c=s.name.match(r);c&&1<c.length&&((c=i[h=c[1]])||(i[h]=c=[]),c.push(s))}var h,l=[];for(h in i)l.push(wi.CreateFromMorphTargetSequence(h,i[h],e,n));return l},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var n=function(t,e,n,i,r){var o,a;0!==n.length&&(o=[],a=[],ru.flattenJSON(n,o,a,i),0!==o.length&&r.push(new t(e,o,a)))},i=[],r=t.name||"default",o=t.length||-1,a=t.fps||30,s=t.hierarchy||[],c=0;c<s.length;c++){var h=s[c].keys;if(h&&0!==h.length)if(h[0].morphTargets){for(var l,u={},d=0;d<h.length;d++)if(h[d].morphTargets)for(var p=0;p<h[d].morphTargets.length;p++)u[h[d].morphTargets[p]]=-1;for(l in u){for(var f=[],m=[],p=0;p!==h[d].morphTargets.length;++p){var v=h[d];f.push(v.time),m.push(v.morphTarget===l?1:0)}i.push(new vi(".morphTargetInfluence["+l+"]",f,m))}o=u.length*(a||1)}else{var g=".bones["+e[c].name+"]";n(bi,g+".position",h,"pos",i),n(yi,g+".quaternion",h,"rot",i),n(bi,g+".scale",h,"scl",i)}}return 0===i.length?null:new wi(r,o,i)}}),Object.assign(wi.prototype,{resetDuration:function(){for(var t=0,e=0,n=this.tracks.length;e!==n;++e)var i=this.tracks[e],t=Math.max(t,i.times[i.times.length-1]);return this.duration=t,this},trim:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},validate:function(){for(var t=!0,e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this},clone:function(){for(var t=[],e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new wi(this.name,this.duration,t)}});var ou={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}},au=new _i,su={};Object.assign(Ei.prototype,{load:function(a,t,e,n){void 0===a&&(a=""),void 0!==this.path&&(a=this.path+a),a=this.manager.resolveURL(a);var s=this,i=ou.get(a);if(void 0!==i)return s.manager.itemStart(a),setTimeout(function(){t&&t(i),s.manager.itemEnd(a)},0),i;if(void 0===su[a]){var r=a.match(/^data:(.*?)(;base64)?,(.*)$/);if(r){var o=r[1],c=!!r[2],h=r[3],h=decodeURIComponent(h);c&&(h=atob(h));try{var l=(this.responseType||"").toLowerCase();switch(l){case"arraybuffer":case"blob":for(var u=new Uint8Array(h.length),d=0;d<h.length;d++)u[d]=h.charCodeAt(d);p="blob"===l?new Blob([u.buffer],{type:o}):u.buffer;break;case"document":var p=(new DOMParser).parseFromString(h,o);break;case"json":p=JSON.parse(h);break;default:p=h}setTimeout(function(){t&&t(p),s.manager.itemEnd(a)},0)}catch(t){setTimeout(function(){n&&n(t),s.manager.itemError(a),s.manager.itemEnd(a)},0)}}else{su[a]=[],su[a].push({onLoad:t,onProgress:e,onError:n});var f,m=new XMLHttpRequest;for(f in m.open("GET",a,!0),m.addEventListener("load",function(t){var e=this.response;ou.add(a,e);var n=su[a];if(delete su[a],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received.");for(var i=0,r=n.length;i<r;i++)(o=n[i]).onLoad&&o.onLoad(e);s.manager.itemEnd(a)}else{for(var o,i=0,r=n.length;i<r;i++)(o=n[i]).onError&&o.onError(t);s.manager.itemError(a),s.manager.itemEnd(a)}},!1),m.addEventListener("progress",function(t){for(var e=su[a],n=0,i=e.length;n<i;n++){var r=e[n];r.onProgress&&r.onProgress(t)}},!1),m.addEventListener("error",function(t){var e=su[a];delete su[a];for(var n=0,i=e.length;n<i;n++){var r=e[n];r.onError&&r.onError(t)}s.manager.itemError(a),s.manager.itemEnd(a)},!1),m.addEventListener("abort",function(t){var e=su[a];delete su[a];for(var n=0,i=e.length;n<i;n++){var r=e[n];r.onError&&r.onError(t)}s.manager.itemError(a),s.manager.itemEnd(a)},!1),void 0!==this.responseType&&(m.responseType=this.responseType),void 0!==this.withCredentials&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)m.setRequestHeader(f,this.requestHeader[f]);m.send(null)}return s.manager.itemStart(a),m}su[a].push({onLoad:t,onProgress:e,onError:n})},setPath:function(t){return this.path=t,this},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}}),Object.assign(function(t){this.manager=void 0!==t?t:au}.prototype,{load:function(t,e,n,i){var r=this,o=new Ei(r.manager);o.setPath(r.path),o.load(t,function(t){e(r.parse(JSON.parse(t)))},n,i)},parse:function(t){for(var e=[],n=0;n<t.length;n++){var i=wi.parse(t[n]);e.push(i)}return e},setPath:function(t){return this.path=t,this}}),Object.assign(function(t){this.manager=void 0!==t?t:au,this._parser=null}.prototype,{load:function(t,o,n,i){var a=this,s=[],c=new qe;c.image=s;var r=new Ei(this.manager);if(r.setPath(this.path),r.setResponseType("arraybuffer"),Array.isArray(t))for(var h=0,e=0,l=t.length;e<l;++e)!function(e){r.load(t[e],function(t){t=a._parser(t,!0);s[e]={width:t.width,height:t.height,format:t.format,mipmaps:t.mipmaps},6===(h+=1)&&(1===t.mipmapCount&&(c.minFilter=ya),c.format=t.format,c.needsUpdate=!0,o&&o(c))},n,i)}(e);else r.load(t,function(t){var e=a._parser(t,!0);if(e.isCubemap)for(var n=e.mipmaps.length/e.mipmapCount,i=0;i<n;i++){s[i]={mipmaps:[]};for(var r=0;r<e.mipmapCount;r++)s[i].mipmaps.push(e.mipmaps[i*e.mipmapCount+r]),s[i].format=e.format,s[i].width=e.width,s[i].height=e.height}else c.image.width=e.width,c.image.height=e.height,c.mipmaps=e.mipmaps;1===e.mipmapCount&&(c.minFilter=ya),c.format=e.format,c.needsUpdate=!0,o&&o(c)},n,i);return c},setPath:function(t){return this.path=t,this}}),Object.assign(function(t){this.manager=void 0!==t?t:au,this._parser=null}.prototype,{load:function(t,e,n,i){var r=this,o=new Et,a=new Ei(this.manager);return a.setResponseType("arraybuffer"),a.setPath(this.path),a.load(t,function(t){t=r._parser(t);t&&(void 0!==t.image?o.image=t.image:void 0!==t.data&&(o.image.width=t.width,o.image.height=t.height,o.image.data=t.data),o.wrapS=void 0!==t.wrapS?t.wrapS:pa,o.wrapT=void 0!==t.wrapT?t.wrapT:pa,o.magFilter=void 0!==t.magFilter?t.magFilter:ya,o.minFilter=void 0!==t.minFilter?t.minFilter:ba,o.anisotropy=void 0!==t.anisotropy?t.anisotropy:1,void 0!==t.format&&(o.format=t.format),void 0!==t.type&&(o.type=t.type),void 0!==t.mipmaps&&(o.mipmaps=t.mipmaps),1===t.mipmapCount&&(o.minFilter=ya),o.needsUpdate=!0,e&&e(o,t))},n,i),o},setPath:function(t){return this.path=t,this}}),Object.assign(Ai.prototype,{crossOrigin:"anonymous",load:function(e,t,n,i){function r(){c.removeEventListener("load",r,!1),c.removeEventListener("error",o,!1),ou.add(e,this),t&&t(this),a.manager.itemEnd(e)}function o(t){c.removeEventListener("load",r,!1),c.removeEventListener("error",o,!1),i&&i(t),a.manager.itemError(e),a.manager.itemEnd(e)}void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var a=this,s=ou.get(e);if(void 0!==s)return a.manager.itemStart(e),setTimeout(function(){t&&t(s),a.manager.itemEnd(e)},0),s;var c=document.createElementNS("http://www.w3.org/1999/xhtml","img");return c.addEventListener("load",r,!1),c.addEventListener("error",o,!1),"data:"!==e.substr(0,5)&&void 0!==this.crossOrigin&&(c.crossOrigin=this.crossOrigin),a.manager.itemStart(e),c.src=e,c},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(Si.prototype,{crossOrigin:"anonymous",load:function(t,n,e,i){var r=new V,o=new Ai(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);for(var a=0,s=0;s<t.length;++s)!function(e){o.load(t[e],function(t){r.images[e]=t,6==++a&&(r.needsUpdate=!0,n&&n(r))},void 0,i)}(s);return r},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(Ti.prototype,{crossOrigin:"anonymous",load:function(e,n,t,i){var r=new d,o=new Ai(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(e,function(t){r.image=t;t=0<e.search(/\.jpe?g($|\?)/i)||0===e.search(/^data\:image\/jpeg/);r.format=t?Da:Na,r.needsUpdate=!0,void 0!==n&&n(r)},t,i),r},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(Li.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){t=this.getUtoTmapping(t);return this.getPoint(t,e)},getPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,n,i=[],r=this.getPoint(0),o=0;for(i.push(0),n=1;n<=t;n++)o+=(e=this.getPoint(n/t)).distanceTo(r),i.push(o),r=e;return this.cacheArcLengths=i},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){for(var n,i=this.getLengths(),r=0,o=i.length,a=e||t*i[o-1],s=0,c=o-1;s<=c;)if((n=i[r=Math.floor(s+(c-s)/2)]-a)<0)s=r+1;else{if(!(0<n)){c=r;break}c=r-1}if(i[r=c]===a)return r/(o-1);t=i[r];return(r+(a-t)/(i[r+1]-t))/(o-1)},getTangent:function(t){var e=t-1e-4,t=t+1e-4;e<0&&(e=0),1<t&&(t=1);e=this.getPoint(e);return this.getPoint(t).clone().sub(e).normalize()},getTangentAt:function(t){t=this.getUtoTmapping(t);return this.getTangent(t)},computeFrenetFrames:function(t,e){for(var n,i,r=new Mt,o=[],a=[],s=[],c=new Mt,h=new St,l=0;l<=t;l++)n=l/t,o[l]=this.getTangentAt(n),o[l].normalize();a[0]=new Mt,s[0]=new Mt;var u=Number.MAX_VALUE,d=Math.abs(o[0].x),p=Math.abs(o[0].y),f=Math.abs(o[0].z);for(d<=u&&(u=d,r.set(1,0,0)),p<=u&&(u=p,r.set(0,1,0)),f<=u&&r.set(0,0,1),c.crossVectors(o[0],r).normalize(),a[0].crossVectors(o[0],c),s[0].crossVectors(o[0],a[0]),l=1;l<=t;l++)a[l]=a[l-1].clone(),s[l]=s[l-1].clone(),c.crossVectors(o[l-1],o[l]),c.length()>Number.EPSILON&&(c.normalize(),i=Math.acos(As.clamp(o[l-1].dot(o[l]),-1,1)),a[l].applyMatrix4(h.makeRotationAxis(c,i))),s[l].crossVectors(o[l],a[l]);if(!0===e)for(i=Math.acos(As.clamp(a[0].dot(a[t]),-1,1)),i/=t,0<o[0].dot(c.crossVectors(a[0],a[t]))&&(i=-i),l=1;l<=t;l++)a[l].applyMatrix4(h.makeRotationAxis(o[l],i*l)),s[l].crossVectors(o[l],a[l]);return{tangents:o,normals:a,binormals:s}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){var t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),((Ri.prototype=Object.create(Li.prototype)).constructor=Ri).prototype.isEllipseCurve=!0,Ri.prototype.getPoint=function(t,e){for(var n=e||new wt,i=2*Math.PI,r=this.aEndAngle-this.aStartAngle,o=Math.abs(r)<Number.EPSILON;r<0;)r+=i;for(;i<r;)r-=i;r<Number.EPSILON&&(r=o?0:i),!0!==this.aClockwise||o||(r===i?r=-i:r-=i);var a=this.aStartAngle+t*r,s=this.aX+this.xRadius*Math.cos(a),c=this.aY+this.yRadius*Math.sin(a);return 0!==this.aRotation&&(e=Math.cos(this.aRotation),o=Math.sin(this.aRotation),s=(t=s-this.aX)*e-(a=c-this.aY)*o+this.aX,c=t*o+a*e+this.aY),n.set(s,c)},Ri.prototype.copy=function(t){return Li.prototype.copy.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},Ri.prototype.toJSON=function(){var t=Li.prototype.toJSON.call(this);return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t},Ri.prototype.fromJSON=function(t){return Li.prototype.fromJSON.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},((Ci.prototype=Object.create(Ri.prototype)).constructor=Ci).prototype.isArcCurve=!0;var cu=new Mt,hu=new Pi,lu=new Pi,uu=new Pi;((Ii.prototype=Object.create(Li.prototype)).constructor=Ii).prototype.isCatmullRomCurve3=!0,Ii.prototype.getPoint=function(t,e){var n,i=e||new Mt,r=this.points,o=r.length,a=(o-(this.closed?0:1))*t,s=Math.floor(a),c=a-s;return this.closed?s+=0<s?0:(Math.floor(Math.abs(s)/o)+1)*o:0===c&&s===o-1&&(s=o-2,c=1),n=this.closed||0<s?r[(s-1)%o]:(cu.subVectors(r[0],r[1]).add(r[0]),cu),e=r[s%o],t=r[(s+1)%o],a=this.closed||s+2<o?r[(s+2)%o]:(cu.subVectors(r[o-1],r[o-2]).add(r[o-1]),cu),"centripetal"===this.curveType||"chordal"===this.curveType?(s="chordal"===this.curveType?.5:.25,r=Math.pow(n.distanceToSquared(e),s),(o=Math.pow(e.distanceToSquared(t),s))<1e-4&&(o=1),r<1e-4&&(r=o),(s=Math.pow(t.distanceToSquared(a),s))<1e-4&&(s=o),hu.initNonuniformCatmullRom(n.x,e.x,t.x,a.x,r,o,s),lu.initNonuniformCatmullRom(n.y,e.y,t.y,a.y,r,o,s),uu.initNonuniformCatmullRom(n.z,e.z,t.z,a.z,r,o,s)):"catmullrom"===this.curveType&&(hu.initCatmullRom(n.x,e.x,t.x,a.x,this.tension),lu.initCatmullRom(n.y,e.y,t.y,a.y,this.tension),uu.initCatmullRom(n.z,e.z,t.z,a.z,this.tension)),i.set(hu.calc(c),lu.calc(c),uu.calc(c)),i},Ii.prototype.copy=function(t){Li.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push(i.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},Ii.prototype.toJSON=function(){var t=Li.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var i=this.points[e];t.points.push(i.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t},Ii.prototype.fromJSON=function(t){Li.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push((new Mt).fromArray(i))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},((zi.prototype=Object.create(Li.prototype)).constructor=zi).prototype.isCubicBezierCurve=!0,zi.prototype.getPoint=function(t,e){var n=e||new wt,i=this.v0,r=this.v1,o=this.v2,e=this.v3;return n.set(Ni(t,i.x,r.x,o.x,e.x),Ni(t,i.y,r.y,o.y,e.y)),n},zi.prototype.copy=function(t){return Li.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},zi.prototype.toJSON=function(){var t=Li.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},zi.prototype.fromJSON=function(t){return Li.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},((Ui.prototype=Object.create(Li.prototype)).constructor=Ui).prototype.isCubicBezierCurve3=!0,Ui.prototype.getPoint=function(t,e){var n=e||new Mt,i=this.v0,r=this.v1,o=this.v2,e=this.v3;return n.set(Ni(t,i.x,r.x,o.x,e.x),Ni(t,i.y,r.y,o.y,e.y),Ni(t,i.z,r.z,o.z,e.z)),n},Ui.prototype.copy=function(t){return Li.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},Ui.prototype.toJSON=function(){var t=Li.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},Ui.prototype.fromJSON=function(t){return Li.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},((Bi.prototype=Object.create(Li.prototype)).constructor=Bi).prototype.isLineCurve=!0,Bi.prototype.getPoint=function(t,e){e=e||new wt;return 1===t?e.copy(this.v2):(e.copy(this.v2).sub(this.v1),e.multiplyScalar(t).add(this.v1)),e},Bi.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Bi.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},Bi.prototype.copy=function(t){return Li.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Bi.prototype.toJSON=function(){var t=Li.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Bi.prototype.fromJSON=function(t){return Li.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((ki.prototype=Object.create(Li.prototype)).constructor=ki).prototype.isLineCurve3=!0,ki.prototype.getPoint=function(t,e){e=e||new Mt;return 1===t?e.copy(this.v2):(e.copy(this.v2).sub(this.v1),e.multiplyScalar(t).add(this.v1)),e},ki.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},ki.prototype.copy=function(t){return Li.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},ki.prototype.toJSON=function(){var t=Li.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},ki.prototype.fromJSON=function(t){return Li.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((Fi.prototype=Object.create(Li.prototype)).constructor=Fi).prototype.isQuadraticBezierCurve=!0,Fi.prototype.getPoint=function(t,e){var n=e||new wt,i=this.v0,r=this.v1,e=this.v2;return n.set(Di(t,i.x,r.x,e.x),Di(t,i.y,r.y,e.y)),n},Fi.prototype.copy=function(t){return Li.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Fi.prototype.toJSON=function(){var t=Li.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Fi.prototype.fromJSON=function(t){return Li.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((Gi.prototype=Object.create(Li.prototype)).constructor=Gi).prototype.isQuadraticBezierCurve3=!0,Gi.prototype.getPoint=function(t,e){var n=e||new Mt,i=this.v0,r=this.v1,e=this.v2;return n.set(Di(t,i.x,r.x,e.x),Di(t,i.y,r.y,e.y),Di(t,i.z,r.z,e.z)),n},Gi.prototype.copy=function(t){return Li.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Gi.prototype.toJSON=function(){var t=Li.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Gi.prototype.fromJSON=function(t){return Li.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},((Hi.prototype=Object.create(Li.prototype)).constructor=Hi).prototype.isSplineCurve=!0,Hi.prototype.getPoint=function(t,e){var n=e||new wt,i=this.points,r=(i.length-1)*t,o=Math.floor(r),a=r-o,e=i[0===o?o:o-1],t=i[o],r=i[o>i.length-2?i.length-1:o+1],o=i[o>i.length-3?i.length-1:o+2];return n.set(Oi(a,e.x,t.x,r.x,o.x),Oi(a,e.y,t.y,r.y,o.y)),n},Hi.prototype.copy=function(t){Li.prototype.copy.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push(i.clone())}return this},Hi.prototype.toJSON=function(){var t=Li.prototype.toJSON.call(this);t.points=[];for(var e=0,n=this.points.length;e<n;e++){var i=this.points[e];t.points.push(i.toArray())}return t},Hi.prototype.fromJSON=function(t){Li.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,n=t.points.length;e<n;e++){var i=t.points[e];this.points.push((new wt).fromArray(i))}return this};var du=Object.freeze({ArcCurve:Ci,CatmullRomCurve3:Ii,CubicBezierCurve:zi,CubicBezierCurve3:Ui,EllipseCurve:Ri,LineCurve:Bi,LineCurve3:ki,QuadraticBezierCurve:Fi,QuadraticBezierCurve3:Gi,SplineCurve:Hi});ji.prototype=Object.assign(Object.create(Li.prototype),{constructor:ji,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new Bi(e,t))},getPoint:function(t){for(var e=t*this.getLength(),n=this.getCurveLengths(),i=0;i<n.length;){if(n[i]>=e){var r=n[i]-e,o=this.curves[i],a=o.getLength(),a=0===a?0:1-r/a;return o.getPointAt(a)}i++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.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 t=[],e=0,n=0,i=this.curves.length;n<i;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e},getPoints:function(t){t=t||12;for(var e,n=[],i=0,r=this.curves;i<r.length;i++)for(var o=r[i],a=o&&o.isEllipseCurve?2*t:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?t*o.points.length:t,s=o.getPoints(a),c=0;c<s.length;c++){var h=s[c];e&&e.equals(h)||(n.push(h),e=h)}return this.autoClose&&1<n.length&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n},copy:function(t){Li.prototype.copy.call(this,t),this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var i=t.curves[e];this.curves.push(i.clone())}return this.autoClose=t.autoClose,this},toJSON:function(){var t=Li.prototype.toJSON.call(this);t.autoClose=this.autoClose,t.curves=[];for(var e=0,n=this.curves.length;e<n;e++){var i=this.curves[e];t.curves.push(i.toJSON())}return t},fromJSON:function(t){Li.prototype.fromJSON.call(this,t),this.autoClose=t.autoClose,this.curves=[];for(var e=0,n=t.curves.length;e<n;e++){var i=t.curves[e];this.curves.push((new du[i.type]).fromJSON(i))}return this}}),Vi.prototype=Object.assign(Object.create(ji.prototype),{constructor:Vi,setFromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y)},moveTo:function(t,e){this.currentPoint.set(t,e)},lineTo:function(t,e){var n=new Bi(this.currentPoint.clone(),new wt(t,e));this.curves.push(n),this.currentPoint.set(t,e)},quadraticCurveTo:function(t,e,n,i){e=new Fi(this.currentPoint.clone(),new wt(t,e),new wt(n,i));this.curves.push(e),this.currentPoint.set(n,i)},bezierCurveTo:function(t,e,n,i,r,o){i=new zi(this.currentPoint.clone(),new wt(t,e),new wt(n,i),new wt(r,o));this.curves.push(i),this.currentPoint.set(r,o)},splineThru:function(t){var e=new Hi([this.currentPoint.clone()].concat(t));this.curves.push(e),this.currentPoint.copy(t[t.length-1])},arc:function(t,e,n,i,r,o){var a=this.currentPoint.x,s=this.currentPoint.y;this.absarc(t+a,e+s,n,i,r,o)},absarc:function(t,e,n,i,r,o){this.absellipse(t,e,n,n,i,r,o)},ellipse:function(t,e,n,i,r,o,a,s){var c=this.currentPoint.x,h=this.currentPoint.y;this.absellipse(t+c,e+h,n,i,r,o,a,s)},absellipse:function(t,e,n,i,r,o,a,s){a=new Ri(t,e,n,i,r,o,a,s);0<this.curves.length&&((s=a.getPoint(0)).equals(this.currentPoint)||this.lineTo(s.x,s.y)),this.curves.push(a);a=a.getPoint(1);this.currentPoint.copy(a)},copy:function(t){return ji.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){var t=ji.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return ji.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),Wi.prototype=Object.assign(Object.create(Vi.prototype),{constructor:Wi,getPointsHoles:function(t){for(var e=[],n=0,i=this.holes.length;n<i;n++)e[n]=this.holes[n].getPoints(t);return e},extractPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},copy:function(t){Vi.prototype.copy.call(this,t),this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var i=t.holes[e];this.holes.push(i.clone())}return this},toJSON:function(){var t=Vi.prototype.toJSON.call(this);t.uuid=this.uuid,t.holes=[];for(var e=0,n=this.holes.length;e<n;e++){var i=this.holes[e];t.holes.push(i.toJSON())}return t},fromJSON:function(t){Vi.prototype.fromJSON.call(this,t),this.uuid=t.uuid,this.holes=[];for(var e=0,n=t.holes.length;e<n;e++){var i=t.holes[e];this.holes.push((new Vi).fromJSON(i))}return this}}),qi.prototype=Object.assign(Object.create(f.prototype),{constructor:qi,isLight:!0,copy:function(t){return f.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){t=f.prototype.toJSON.call(this,t);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),t}}),Xi.prototype=Object.assign(Object.create(qi.prototype),{constructor:Xi,isHemisphereLight:!0,copy:function(t){return qi.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(Yi.prototype,{copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t={};return 0!==this.bias&&(t.bias=this.bias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}),Zi.prototype=Object.assign(Object.create(Yi.prototype),{constructor:Zi,isSpotLightShadow:!0,update:function(t){var e=this.camera,n=2*As.RAD2DEG*t.angle,i=this.mapSize.width/this.mapSize.height,t=t.distance||e.far;n===e.fov&&i===e.aspect&&t===e.far||(e.fov=n,e.aspect=i,e.far=t,e.updateProjectionMatrix())}}),Ji.prototype=Object.assign(Object.create(qi.prototype),{constructor:Ji,isSpotLight:!0,copy:function(t){return qi.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),Qi.prototype=Object.assign(Object.create(qi.prototype),{constructor:Qi,isPointLight:!0,copy:function(t){return qi.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),Ki.prototype=Object.assign(Object.create(we.prototype),{constructor:Ki,isOrthographicCamera:!0,copy:function(t,e){return we.prototype.copy.call(this,t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,e,n,i,r,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2,r=n-t,o=n+t,a=i+e,s=i-e;null!==this.view&&this.view.enabled&&(n=this.zoom/(this.view.width/this.view.fullWidth),t=this.zoom/(this.view.height/this.view.fullHeight),i=(this.right-this.left)/this.view.width,e=(this.top-this.bottom)/this.view.height,o=(r+=i*(this.view.offsetX/n))+i*(this.view.width/n),s=(a-=e*(this.view.offsetY/t))-e*(this.view.height/t)),this.projectionMatrix.makeOrthographic(r,o,a,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){t=f.prototype.toJSON.call(this,t);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}),$i.prototype=Object.assign(Object.create(Yi.prototype),{constructor:$i}),tr.prototype=Object.assign(Object.create(qi.prototype),{constructor:tr,isDirectionalLight:!0,copy:function(t){return qi.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),er.prototype=Object.assign(Object.create(qi.prototype),{constructor:er,isAmbientLight:!0}),nr.prototype=Object.assign(Object.create(qi.prototype),{constructor:nr,isRectAreaLight:!0,copy:function(t){return qi.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},toJSON:function(t){t=qi.prototype.toJSON.call(this,t);return t.object.width=this.width,t.object.height=this.height,t}}),Object.assign(ir.prototype,{load:function(t,e,n,i){var r=this,o=new Ei(r.manager);o.setPath(r.path),o.load(t,function(t){e(r.parse(JSON.parse(t)))},n,i)},parse:function(t){function e(t){return void 0===i[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),i[t]}var n,i=this.textures,r=new iu[t.type];if(void 0!==t.uuid&&(r.uuid=t.uuid),void 0!==t.name&&(r.name=t.name),void 0!==t.color&&r.color.setHex(t.color),void 0!==t.roughness&&(r.roughness=t.roughness),void 0!==t.metalness&&(r.metalness=t.metalness),void 0!==t.emissive&&r.emissive.setHex(t.emissive),void 0!==t.specular&&r.specular.setHex(t.specular),void 0!==t.shininess&&(r.shininess=t.shininess),void 0!==t.clearCoat&&(r.clearCoat=t.clearCoat),void 0!==t.clearCoatRoughness&&(r.clearCoatRoughness=t.clearCoatRoughness),void 0!==t.vertexColors&&(r.vertexColors=t.vertexColors),void 0!==t.fog&&(r.fog=t.fog),void 0!==t.flatShading&&(r.flatShading=t.flatShading),void 0!==t.blending&&(r.blending=t.blending),void 0!==t.combine&&(r.combine=t.combine),void 0!==t.side&&(r.side=t.side),void 0!==t.opacity&&(r.opacity=t.opacity),void 0!==t.transparent&&(r.transparent=t.transparent),void 0!==t.alphaTest&&(r.alphaTest=t.alphaTest),void 0!==t.depthTest&&(r.depthTest=t.depthTest),void 0!==t.depthWrite&&(r.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(r.colorWrite=t.colorWrite),void 0!==t.wireframe&&(r.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(r.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(r.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(r.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(r.rotation=t.rotation),1!==t.linewidth&&(r.linewidth=t.linewidth),void 0!==t.dashSize&&(r.dashSize=t.dashSize),void 0!==t.gapSize&&(r.gapSize=t.gapSize),void 0!==t.scale&&(r.scale=t.scale),void 0!==t.polygonOffset&&(r.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(r.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(r.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.skinning&&(r.skinning=t.skinning),void 0!==t.morphTargets&&(r.morphTargets=t.morphTargets),void 0!==t.dithering&&(r.dithering=t.dithering),void 0!==t.visible&&(r.visible=t.visible),void 0!==t.userData&&(r.userData=t.userData),void 0!==t.uniforms)for(var o in t.uniforms){var a=t.uniforms[o];switch(r.uniforms[o]={},a.type){case"t":r.uniforms[o].value=e(a.value);break;case"c":r.uniforms[o].value=(new y).setHex(a.value);break;case"v2":r.uniforms[o].value=(new wt).fromArray(a.value);break;case"v3":r.uniforms[o].value=(new Mt).fromArray(a.value);break;case"v4":r.uniforms[o].value=(new _t).fromArray(a.value);break;case"m3":r.uniforms[o].value=(new T).fromArray(a.value);case"m4":r.uniforms[o].value=(new St).fromArray(a.value);break;default:r.uniforms[o].value=a.value}}if(void 0!==t.defines&&(r.defines=t.defines),void 0!==t.vertexShader&&(r.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(r.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(var s in t.extensions)r.extensions[s]=t.extensions[s];return void 0!==t.shading&&(r.flatShading=1===t.shading),void 0!==t.size&&(r.size=t.size),void 0!==t.sizeAttenuation&&(r.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(r.map=e(t.map)),void 0!==t.matcap&&(r.matcap=e(t.matcap)),void 0!==t.alphaMap&&(r.alphaMap=e(t.alphaMap),r.transparent=!0),void 0!==t.bumpMap&&(r.bumpMap=e(t.bumpMap)),void 0!==t.bumpScale&&(r.bumpScale=t.bumpScale),void 0!==t.normalMap&&(r.normalMap=e(t.normalMap)),void 0!==t.normalMapType&&(r.normalMapType=t.normalMapType),void 0!==t.normalScale&&(n=t.normalScale,!1===Array.isArray(n)&&(n=[n,n]),r.normalScale=(new wt).fromArray(n)),void 0!==t.displacementMap&&(r.displacementMap=e(t.displacementMap)),void 0!==t.displacementScale&&(r.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(r.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(r.roughnessMap=e(t.roughnessMap)),void 0!==t.metalnessMap&&(r.metalnessMap=e(t.metalnessMap)),void 0!==t.emissiveMap&&(r.emissiveMap=e(t.emissiveMap)),void 0!==t.emissiveIntensity&&(r.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(r.specularMap=e(t.specularMap)),void 0!==t.envMap&&(r.envMap=e(t.envMap)),void 0!==t.envMapIntensity&&(r.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(r.reflectivity=t.reflectivity),void 0!==t.lightMap&&(r.lightMap=e(t.lightMap)),void 0!==t.lightMapIntensity&&(r.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(r.aoMap=e(t.aoMap)),void 0!==t.aoMapIntensity&&(r.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(r.gradientMap=e(t.gradientMap)),r},setPath:function(t){return this.path=t,this},setTextures:function(t){return this.textures=t,this}});var pu=function(t){var e=t.lastIndexOf("/");return-1===e?"./":t.substr(0,e+1)};rr.prototype=Object.assign(Object.create(U.prototype),{constructor:rr,isInstancedBufferGeometry:!0,copy:function(t){return U.prototype.copy.call(this,t),this.maxInstancedCount=t.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t=U.prototype.toJSON.call(this);return t.maxInstancedCount=this.maxInstancedCount,t.isInstancedBufferGeometry=!0,t}}),or.prototype=Object.assign(Object.create(b.prototype),{constructor:or,isInstancedBufferAttribute:!0,copy:function(t){return b.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},toJSON:function(){var t=b.prototype.toJSON.call(this);return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}),Object.assign(ar.prototype,{load:function(t,e,n,i){var r=this,o=new Ei(r.manager);o.setPath(r.path),o.load(t,function(t){e(r.parse(JSON.parse(t)))},n,i)},parse:function(t){var e=new(t.isInstancedBufferGeometry?rr:U),n=t.data.index;void 0!==n&&(o=new fu[n.type](n.array),e.setIndex(new b(o,1)));var i=t.data.attributes;for(c in i){var r=i[c],o=new fu[r.type](r.array),a=new(r.isInstancedBufferAttribute?or:b)(o,r.itemSize,r.normalized);void 0!==r.name&&(a.name=r.name),e.addAttribute(c,a)}var s=t.data.morphAttributes;if(s)for(var c in s){for(var h=s[c],l=[],u=0,d=h.length;u<d;u++){r=h[u],a=new b(o=new fu[r.type](r.array),r.itemSize,r.normalized);void 0!==r.name&&(a.name=r.name),l.push(a)}e.morphAttributes[c]=l}var p=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==p)for(var u=0,f=p.length;u!==f;++u){var m=p[u];e.addGroup(m.start,m.count,m.materialIndex)}var v=t.data.boundingSphere;return void 0!==v&&(n=new Mt,void 0!==v.center&&n.fromArray(v.center),e.boundingSphere=new g(n,v.radius)),t.name&&(e.name=t.name),t.userData&&(e.userData=t.userData),e},setPath:function(t){return this.path=t,this}});var fu={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};Object.assign(sr.prototype,{crossOrigin:"anonymous",load:function(i,r,t,o){var a=this,e=void 0===this.path?pu(i):this.path;this.resourcePath=this.resourcePath||e;e=new Ei(a.manager);e.setPath(this.path),e.load(i,function(t){var e=null;try{e=JSON.parse(t)}catch(t){return void 0!==o&&o(t),void console.error("THREE:ObjectLoader: Can't parse "+i+".",t.message)}var n=e.metadata;void 0!==n&&void 0!==n.type&&"geometry"!==n.type.toLowerCase()?a.parse(e,r):console.error("THREE.ObjectLoader: Can't load "+i)},t,o)},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this},setCrossOrigin:function(t){return this.crossOrigin=t,this},parse:function(t,e){var n=this.parseShape(t.shapes),i=this.parseGeometries(t.geometries,n),n=this.parseImages(t.images,function(){void 0!==e&&e(r)}),n=this.parseTextures(t.textures,n),n=this.parseMaterials(t.materials,n),r=this.parseObject(t.object,i,n);return t.animations&&(r.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(r),r},parseShape:function(t){var e={};if(void 0!==t)for(var n=0,i=t.length;n<i;n++){var r=(new Wi).fromJSON(t[n]);e[r.uuid]=r}return e},parseGeometries:function(t,e){var n={};if(void 0!==t)for(var i=new ar,r=0,o=t.length;r<o;r++){var a,s=t[r];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":a=new nu[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":a=new nu[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":a=new nu[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":a=new nu[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":a=new nu[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":a=new nu[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":a=new nu[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":a=new nu[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":a=new nu[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":a=new nu[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"TubeGeometry":case"TubeBufferGeometry":a=new nu[s.type]((new du[s.path.type]).fromJSON(s.path),s.tubularSegments,s.radius,s.radialSegments,s.closed);break;case"LatheGeometry":case"LatheBufferGeometry":a=new nu[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":a=new nu[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var c=[],h=0,l=s.shapes.length;h<l;h++){var u=e[s.shapes[h]];c.push(u)}a=new nu[s.type](c,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(c=[],h=0,l=s.shapes.length;h<l;h++){u=e[s.shapes[h]];c.push(u)}var d=s.options.extrudePath;void 0!==d&&(s.options.extrudePath=(new du[d.type]).fromJSON(d)),a=new nu[s.type](c,s.options);break;case"BufferGeometry":case"InstancedBufferGeometry":a=i.parse(s);break;case"Geometry":"THREE"in window&&"LegacyJSONLoader"in THREE?a=(new THREE.LegacyJSONLoader).parse(s,this.resourcePath).geometry:console.error('THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type "Geometry".');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+s.type+'"');continue}a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),!0===a.isBufferGeometry&&void 0!==s.userData&&(a.userData=s.userData),n[s.uuid]=a}return n},parseMaterials:function(t,e){var n={},i={};if(void 0!==t){var r=new ir;r.setTextures(e);for(var o=0,a=t.length;o<a;o++){var s=t[o];if("MultiMaterial"===s.type){for(var c=[],h=0;h<s.materials.length;h++){var l=s.materials[h];void 0===n[l.uuid]&&(n[l.uuid]=r.parse(l)),c.push(n[l.uuid])}i[s.uuid]=c}else void 0===n[s.uuid]&&(n[s.uuid]=r.parse(s)),i[s.uuid]=n[s.uuid]}}return i},parseAnimations:function(t){for(var e=[],n=0;n<t.length;n++){var i=t[n],r=wi.parse(i);void 0!==i.uuid&&(r.uuid=i.uuid),e.push(r)}return e},parseImages:function(t,e){function n(t){return i.manager.itemStart(t),o.load(t,function(){i.manager.itemEnd(t)},void 0,function(){i.manager.itemError(t),i.manager.itemEnd(t)})}var i=this,r={};if(void 0!==t&&0<t.length){var o=new Ai(new _i(e));o.setCrossOrigin(this.crossOrigin);for(var a=0,s=t.length;a<s;a++){var c=t[a],h=c.url;if(Array.isArray(h)){r[c.uuid]=[];for(var l=0,u=h.length;l<u;l++){var d=h[l],p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(d)?d:i.resourcePath+d;r[c.uuid].push(n(p))}}else{p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(c.url)?c.url:i.resourcePath+c.url;r[c.uuid]=n(p)}}}return r},parseTextures:function(t,e){function n(t,e){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}var i={};if(void 0!==t)for(var r=0,o=t.length;r<o;r++){var a,s=t[r];void 0===s.image&&console.warn('THREE.ObjectLoader: No "image" specified for',s.uuid),void 0===e[s.image]&&console.warn("THREE.ObjectLoader: Undefined image",s.image),(a=new(Array.isArray(e[s.image])?V:d)(e[s.image])).needsUpdate=!0,a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),void 0!==s.mapping&&(a.mapping=n(s.mapping,xu)),void 0!==s.offset&&a.offset.fromArray(s.offset),void 0!==s.repeat&&a.repeat.fromArray(s.repeat),void 0!==s.center&&a.center.fromArray(s.center),void 0!==s.rotation&&(a.rotation=s.rotation),void 0!==s.wrap&&(a.wrapS=n(s.wrap[0],bu),a.wrapT=n(s.wrap[1],bu)),void 0!==s.format&&(a.format=s.format),void 0!==s.type&&(a.type=s.type),void 0!==s.encoding&&(a.encoding=s.encoding),void 0!==s.minFilter&&(a.minFilter=n(s.minFilter,wu)),void 0!==s.magFilter&&(a.magFilter=n(s.magFilter,wu)),void 0!==s.anisotropy&&(a.anisotropy=s.anisotropy),void 0!==s.flipY&&(a.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(a.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(a.unpackAlignment=s.unpackAlignment),i[s.uuid]=a}return i},parseObject:function(t,e,o){function n(t){return void 0===e[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]}function i(t){if(void 0!==t){if(Array.isArray(t)){for(var e=[],n=0,i=t.length;n<i;n++){var r=t[n];void 0===o[r]&&console.warn("THREE.ObjectLoader: Undefined material",r),e.push(o[r])}return e}return void 0===o[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),o[t]}}switch(t.type){case"Scene":s=new Ce,void 0!==t.background&&Number.isInteger(t.background)&&(s.background=new y(t.background)),void 0!==t.fog&&("Fog"===t.fog.type?s.fog=new Re(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(s.fog=new Le(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":s=new Me(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(s.focus=t.focus),void 0!==t.zoom&&(s.zoom=t.zoom),void 0!==t.filmGauge&&(s.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(s.filmOffset=t.filmOffset),void 0!==t.view&&(s.view=Object.assign({},t.view));break;case"OrthographicCamera":s=new Ki(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(s.zoom=t.zoom),void 0!==t.view&&(s.view=Object.assign({},t.view));break;case"AmbientLight":s=new er(t.color,t.intensity);break;case"DirectionalLight":s=new tr(t.color,t.intensity);break;case"PointLight":s=new Qi(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":s=new nr(t.color,t.intensity,t.width,t.height);break;case"SpotLight":s=new Ji(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":s=new Xi(t.color,t.groundColor,t.intensity);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":var r=n(t.geometry),a=i(t.material),s=new(r.bones&&0<r.bones.length?ze:H)(r,a);void 0!==t.drawMode&&s.setDrawMode(t.drawMode);break;case"LOD":s=new Ne;break;case"Line":s=new Fe(n(t.geometry),i(t.material),t.mode);break;case"LineLoop":s=new He(n(t.geometry),i(t.material));break;case"LineSegments":s=new Ge(n(t.geometry),i(t.material));break;case"PointCloud":case"Points":s=new Ve(n(t.geometry),i(t.material));break;case"Sprite":s=new De(i(t.material));break;case"Group":s=new be;break;default:s=new f}if(s.uuid=t.uuid,void 0!==t.name&&(s.name=t.name),void 0!==t.matrix?(s.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(s.matrixAutoUpdate=t.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(void 0!==t.position&&s.position.fromArray(t.position),void 0!==t.rotation&&s.rotation.fromArray(t.rotation),void 0!==t.quaternion&&s.quaternion.fromArray(t.quaternion),void 0!==t.scale&&s.scale.fromArray(t.scale)),void 0!==t.castShadow&&(s.castShadow=t.castShadow),void 0!==t.receiveShadow&&(s.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(s.shadow.bias=t.shadow.bias),void 0!==t.shadow.radius&&(s.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&s.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(s.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(s.visible=t.visible),void 0!==t.frustumCulled&&(s.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(s.renderOrder=t.renderOrder),void 0!==t.userData&&(s.userData=t.userData),void 0!==t.layers&&(s.layers.mask=t.layers),void 0!==t.children)for(var c=t.children,h=0;h<c.length;h++)s.add(this.parseObject(c[h],e,o));if("LOD"===t.type)for(var l=t.levels,u=0;u<l.length;u++){var d=l[u],p=s.getObjectByProperty("uuid",d.object);void 0!==p&&s.addLevel(p,d.distance)}return s}});var mu,vu,gu,yu,xu={UVMapping:300,CubeReflectionMapping:oa,CubeRefractionMapping:aa,EquirectangularReflectionMapping:sa,EquirectangularRefractionMapping:ca,SphericalReflectionMapping:ha,CubeUVReflectionMapping:la,CubeUVRefractionMapping:ua},bu={RepeatWrapping:da,ClampToEdgeWrapping:pa,MirroredRepeatWrapping:fa},wu={NearestFilter:ma,NearestMipMapNearestFilter:va,NearestMipMapLinearFilter:ga,LinearFilter:ya,LinearMipMapNearestFilter:xa,LinearMipMapLinearFilter:ba};Object.assign(cr.prototype,{moveTo:function(t,e){this.currentPath=new Vi,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e)},lineTo:function(t,e){this.currentPath.lineTo(t,e)},quadraticCurveTo:function(t,e,n,i){this.currentPath.quadraticCurveTo(t,e,n,i)},bezierCurveTo:function(t,e,n,i,r,o){this.currentPath.bezierCurveTo(t,e,n,i,r,o)},splineThru:function(t){this.currentPath.splineThru(t)},toShapes:function(t,e){function n(t){for(var e=[],n=0,i=t.length;n<i;n++){var r=t[n],o=new Wi;o.curves=r.curves,e.push(o)}return e}var i=tu.isClockWise,r=this.subPaths;if(0===r.length)return[];if(!0===e)return n(r);var o,a,s,c=[];if(1===r.length)return a=r[0],(s=new Wi).curves=a.curves,c.push(s),c;var h,l=!i(r[0].getPoints()),l=t?!l:l,u=[],d=[],p=[],f=0;d[f]=void 0,p[f]=[];for(var m=0,v=r.length;m<v;m++)o=i(h=(a=r[m]).getPoints()),(o=t?!o:o)?(!l&&d[f]&&f++,d[f]={s:new Wi,p:h},d[f].s.curves=a.curves,l&&f++,p[f]=[]):p[f].push({h:a,p:h[0]});if(!d[0])return n(r);if(1<d.length){for(var g=!1,y=[],x=0,b=d.length;x<b;x++)u[x]=[];for(x=0,b=d.length;x<b;x++)for(var w=p[x],M=0;M<w.length;M++){for(var _=w[M],E=!0,A=0;A<d.length;A++)!function(t,e){for(var n=e.length,i=!1,r=n-1,o=0;o<n;r=o++){var a=e[r],s=e[o],c=s.x-a.x,h=s.y-a.y;if(Math.abs(h)>Number.EPSILON){if(h<0&&(a=e[o],c=-c,s=e[r],h=-h),!(t.y<a.y||t.y>s.y))if(t.y===a.y){if(t.x===a.x)return 1}else{c=h*(t.x-a.x)-c*(t.y-a.y);if(0==c)return 1;c<0||(i=!i)}}else if(t.y===a.y&&(s.x<=t.x&&t.x<=a.x||a.x<=t.x&&t.x<=s.x))return 1}return i}(_.p,d[A].p)||(x!==A&&y.push({froms:x,tos:A,hole:M}),E?(E=!1,u[A].push(_)):g=!0);E&&u[x].push(_)}0<y.length&&(g||(p=u))}for(var S,m=0,T=d.length;m<T;m++){s=d[m].s,c.push(s);for(var L=0,R=(S=p[m]).length;L<R;L++)s.holes.push(S[L].h)}return c}}),Object.assign(hr.prototype,{isFont:!0,generateShapes:function(t,e){void 0===e&&(e=100);for(var n=[],i=lr(t,e,this.data),r=0,o=i.length;r<o;r++)Array.prototype.push.apply(n,i[r].toShapes());return n}}),Object.assign(function(t){this.manager=void 0!==t?t:au}.prototype,{load:function(t,i,e,n){var r=this,o=new Ei(this.manager);o.setPath(this.path),o.load(t,function(e){var n;try{n=JSON.parse(e)}catch(t){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(e.substring(65,e.length-2))}var t=r.parse(n);i&&i(t)},e,n)},parse:function(t){return new hr(t)},setPath:function(t){return this.path=t,this}}),ur.Handlers={handlers:[],add:function(t,e){this.handlers.push(t,e)},get:function(t){for(var e=this.handlers,n=0,i=e.length;n<i;n+=2){var r=e[n],o=e[n+1];if(r.test(t))return o}return null}},Object.assign(ur.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(t,e,n){for(var i=[],r=0;r<t.length;++r)i[r]=this.createMaterial(t[r],e,n);return i},createMaterial:(mu={NoBlending:bo,NormalBlending:wo,AdditiveBlending:Mo,SubtractiveBlending:_o,MultiplyBlending:Eo,CustomBlending:Ao},vu=new y,gu=new Ti,yu=new ir,function(t,a,s){function e(t,e,n,i,r){var o=a+t,t=ur.Handlers.get(o),o=null!==t?t.load(o):(gu.setCrossOrigin(s),gu.load(o));void 0!==e&&(o.repeat.fromArray(e),1!==e[0]&&(o.wrapS=da),1!==e[1]&&(o.wrapT=da)),void 0!==n&&o.offset.fromArray(n),void 0!==i&&("repeat"===i[0]&&(o.wrapS=da),"mirror"===i[0]&&(o.wrapS=fa),"repeat"===i[1]&&(o.wrapT=da),"mirror"===i[1]&&(o.wrapT=fa)),void 0!==r&&(o.anisotropy=r);r=As.generateUUID();return c[r]=o,r}var n,c={},i={uuid:As.generateUUID(),type:"MeshLambertMaterial"};for(n in t){var r=t[n];switch(n){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":i.name=r;break;case"blending":i.blending=mu[r];break;case"colorAmbient":case"mapAmbient":console.warn("THREE.Loader.createMaterial:",n,"is no longer supported.");break;case"colorDiffuse":i.color=vu.fromArray(r).getHex();break;case"colorSpecular":i.specular=vu.fromArray(r).getHex();break;case"colorEmissive":i.emissive=vu.fromArray(r).getHex();break;case"specularCoef":i.shininess=r;break;case"shading":"basic"===r.toLowerCase()&&(i.type="MeshBasicMaterial"),"phong"===r.toLowerCase()&&(i.type="MeshPhongMaterial"),"standard"===r.toLowerCase()&&(i.type="MeshStandardMaterial");break;case"mapDiffuse":i.map=e(r,t.mapDiffuseRepeat,t.mapDiffuseOffset,t.mapDiffuseWrap,t.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":i.emissiveMap=e(r,t.mapEmissiveRepeat,t.mapEmissiveOffset,t.mapEmissiveWrap,t.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":i.lightMap=e(r,t.mapLightRepeat,t.mapLightOffset,t.mapLightWrap,t.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":i.aoMap=e(r,t.mapAORepeat,t.mapAOOffset,t.mapAOWrap,t.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":i.bumpMap=e(r,t.mapBumpRepeat,t.mapBumpOffset,t.mapBumpWrap,t.mapBumpAnisotropy);break;case"mapBumpScale":i.bumpScale=r;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":i.normalMap=e(r,t.mapNormalRepeat,t.mapNormalOffset,t.mapNormalWrap,t.mapNormalAnisotropy);break;case"mapNormalFactor":i.normalScale=r;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":i.specularMap=e(r,t.mapSpecularRepeat,t.mapSpecularOffset,t.mapSpecularWrap,t.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":i.metalnessMap=e(r,t.mapMetalnessRepeat,t.mapMetalnessOffset,t.mapMetalnessWrap,t.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":i.roughnessMap=e(r,t.mapRoughnessRepeat,t.mapRoughnessOffset,t.mapRoughnessWrap,t.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":i.alphaMap=e(r,t.mapAlphaRepeat,t.mapAlphaOffset,t.mapAlphaWrap,t.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":i.side=go;break;case"doubleSided":i.side=yo;break;case"transparency":console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),i.opacity=r;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":i[n]=r;break;case"vertexColors":!0===r&&(i.vertexColors=2),"face"===r&&(i.vertexColors=1);break;default:console.error("THREE.Loader.createMaterial: Unsupported",n,r)}}return"MeshBasicMaterial"===i.type&&delete i.emissive,"MeshPhongMaterial"!==i.type&&delete i.specular,i.opacity<1&&(i.transparent=!0),yu.setTextures(c),yu.parse(i)})});var Mu,_u,Eu,Au,Su,Tu,Lu,Ru,Cu,Pu,Iu,Ou=function(){return void 0===Mu&&(Mu=new(window.AudioContext||window.webkitAudioContext)),Mu};Object.assign(dr.prototype,{load:function(t,e,n,i){var r=new Ei(this.manager);r.setResponseType("arraybuffer"),r.setPath(this.path),r.load(t,function(t){t=t.slice(0);Ou().decodeAudioData(t,function(t){e(t)})},n,i)},setPath:function(t){return this.path=t,this}}),Object.assign(pr.prototype,{isSphericalHarmonics3:!0,set:function(t){for(var e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this},zero:function(){for(var t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this},getAt:function(t,e){var n=t.x,i=t.y,r=t.z,t=this.coefficients;return e=.282095*t[0],e+=.488603*t[1]*i,e+=.488603*t[2]*r,e+=.488603*t[3]*n,e+=1.092548*t[4]*(n*i),e+=1.092548*t[5]*(i*r),e+=.315392*t[6]*(3*r*r-1),(e+=1.092548*t[7]*(n*r))+.546274*t[8]*(n*n-i*i)},getIrradianceAt:function(t,e){var n=t.x,i=t.y,r=t.z,t=this.coefficients;return e=.886227*t[0],e+=2*t[1]*.511664*i,e+=2*t[2]*.511664*r,e+=2*t[3]*.511664*n,e+=2*t[4]*.429043*n*i,e+=2*t[5]*.429043*i*r,e+=t[6]*(.743125*r*r-.247708),(e+=2*t[7]*.429043*n*r)+.429043*t[8]*(n*n-i*i)},add:function(t){for(var e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this},scale:function(t){for(var e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this},lerp:function(t,e){for(var n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this},equals:function(t){for(var e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0},copy:function(t){return this.set(t.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(t){for(var e=this.coefficients,n=0;n<9;n++)e[n].fromArray(t,3*n);return this},toArray:function(){for(var t=[],e=this.coefficients,n=0;n<9;n++)e[n].toArray(t,3*n);return t}}),Object.assign(pr,{getBasisAt:function(t,e){var n=t.x,i=t.y,t=t.z;e[0]=.282095,e[1]=.488603*i,e[2]=.488603*t,e[3]=.488603*n,e[4]=1.092548*n*i,e[5]=1.092548*i*t,e[6]=.315392*(3*t*t-1),e[7]=1.092548*n*t,e[8]=.546274*(n*n-i*i)}}),fr.prototype=Object.assign(Object.create(qi.prototype),{constructor:fr,isLightProbe:!0,copy:function(t){return qi.prototype.copy.call(this,t),this.sh.copy(t.sh),this.intensity=t.intensity,this},toJSON:function(t){return qi.prototype.toJSON.call(this,t)}}),mr.prototype=Object.assign(Object.create(fr.prototype),{constructor:mr,isHemisphereLightProbe:!0,copy:function(t){return fr.prototype.copy.call(this,t),this},toJSON:function(t){return fr.prototype.toJSON.call(this,t)}}),vr.prototype=Object.assign(Object.create(fr.prototype),{constructor:vr,isAmbientLightProbe:!0,copy:function(t){return fr.prototype.copy.call(this,t),this},toJSON:function(t){return fr.prototype.toJSON.call(this,t)}}),Object.assign(gr.prototype,{update:(Pu=new St,Iu=new St,function(t){var e,n,i,r,o;_u===this&&Eu===t.focus&&Au===t.fov&&Su===t.aspect*this.aspect&&Tu===t.near&&Lu===t.far&&Ru===t.zoom&&Cu===this.eyeSep||(_u=this,Eu=t.focus,Au=t.fov,Su=t.aspect*this.aspect,Tu=t.near,Lu=t.far,Ru=t.zoom,e=t.projectionMatrix.clone(),r=(Cu=this.eyeSep/2)*Tu/Eu,o=Tu*Math.tan(As.DEG2RAD*Au*.5)/Ru,Iu.elements[12]=-Cu,Pu.elements[12]=Cu,n=-o*Su+r,i=o*Su+r,e.elements[0]=2*Tu/(i-n),e.elements[8]=(i+n)/(i-n),this.cameraL.projectionMatrix.copy(e),n=-o*Su-r,i=o*Su-r,e.elements[0]=2*Tu/(i-n),e.elements[8]=(i+n)/(i-n),this.cameraR.projectionMatrix.copy(e)),this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(Iu),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(Pu)})});var Du,Nu,zu,Uu,Bu,ku,Fu,Gu,Hu;(yr.prototype=Object.create(f.prototype)).constructor=yr,Object.assign(xr.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var t,e=0;return this.autoStart&&!this.running?(this.start(),0):(this.running&&(e=((t=("undefined"==typeof performance?Date:performance).now())-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e),e)}}),br.prototype=Object.assign(Object.create(f.prototype),{constructor:br,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this},updateMatrixWorld:(Bu=new Mt,ku=new S,Fu=new Mt,Gu=new Mt,Hu=new xr,function(t){f.prototype.updateMatrixWorld.call(this,t);var e=this.context.listener,n=this.up;this.timeDelta=Hu.getDelta(),this.matrixWorld.decompose(Bu,ku,Fu),Gu.set(0,0,-1).applyQuaternion(ku),e.positionX?(t=this.context.currentTime+this.timeDelta,e.positionX.linearRampToValueAtTime(Bu.x,t),e.positionY.linearRampToValueAtTime(Bu.y,t),e.positionZ.linearRampToValueAtTime(Bu.z,t),e.forwardX.linearRampToValueAtTime(Gu.x,t),e.forwardY.linearRampToValueAtTime(Gu.y,t),e.forwardZ.linearRampToValueAtTime(Gu.z,t),e.upX.linearRampToValueAtTime(n.x,t),e.upY.linearRampToValueAtTime(n.y,t),e.upZ.linearRampToValueAtTime(n.z,t)):(e.setPosition(Bu.x,Bu.y,Bu.z),e.setOrientation(Gu.x,Gu.y,Gu.z,n.x,n.y,n.z))})}),wr.prototype=Object.assign(Object.create(f.prototype),{constructor:wr,getOutput:function(){return this.gain},setNodeSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},setMediaElementSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this},setBuffer:function(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(!0!==this.isPlaying){if(!1!==this.hasPlaybackControl){var t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.onended=this.onEnded.bind(this),this.startTime=this.context.currentTime,t.start(this.startTime,this.offset),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}console.warn("THREE.Audio: this Audio has no playback control.")}else console.warn("THREE.Audio: Audio is already playing.")},pause:function(){return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(!0===this.isPlaying&&(this.source.stop(),this.source.onended=null,this.offset+=(this.context.currentTime-this.startTime)*this.playbackRate,this.isPlaying=!1),this)},stop:function(){return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(this.source.stop(),this.source.onended=null,this.offset=0,this.isPlaying=!1,this)},connect:function(){if(0<this.filters.length){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(0<this.filters.length){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(t){return t=t||[],!0===this.isPlaying?(this.disconnect(),this.filters=t,this.connect()):this.filters=t,this},setDetune:function(t){if(this.detune=t,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(t){return this.setFilters(t?[t]:[])},setPlaybackRate:function(t){return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this)},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(t){return!1===this.hasPlaybackControl?void console.warn("THREE.Audio: this Audio has no playback control."):(this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this)},getVolume:function(){return this.gain.gain.value},setVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}}),Mr.prototype=Object.assign(Object.create(wr.prototype),{constructor:Mr,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(t){return this.panner.refDistance=t,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(t){return this.panner.rolloffFactor=t,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(t){return this.panner.distanceModel=t,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(t){return this.panner.maxDistance=t,this},setDirectionalCone:function(t,e,n){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=n,this},updateMatrixWorld:(Du=new Mt,Nu=new S,zu=new Mt,Uu=new Mt,function(t){var e;f.prototype.updateMatrixWorld.call(this,t),!0===this.hasPlaybackControl&&!1===this.isPlaying||(this.matrixWorld.decompose(Du,Nu,zu),Uu.set(0,0,1).applyQuaternion(Nu),(e=this.panner).positionX?(t=this.context.currentTime+this.listener.timeDelta,e.positionX.linearRampToValueAtTime(Du.x,t),e.positionY.linearRampToValueAtTime(Du.y,t),e.positionZ.linearRampToValueAtTime(Du.z,t),e.orientationX.linearRampToValueAtTime(Uu.x,t),e.orientationY.linearRampToValueAtTime(Uu.y,t),e.orientationZ.linearRampToValueAtTime(Uu.z,t)):(e.setPosition(Du.x,Du.y,Du.z),e.setOrientation(Uu.x,Uu.y,Uu.z)))})}),Object.assign(_r.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var t=0,e=this.getFrequencyData(),n=0;n<e.length;n++)t+=e[n];return t/e.length}}),Object.assign(Er.prototype,{accumulate:function(t,e){var n=this.buffer,i=this.valueSize,r=t*i+i,t=this.cumulativeWeight;if(0===t){for(var o=0;o!==i;++o)n[r+o]=n[o];t=e}else{e=e/(t+=e);this._mixBufferRegion(n,r,0,e,i)}this.cumulativeWeight=t},apply:function(t){var e=this.valueSize,n=this.buffer,i=t*e+e,r=this.cumulativeWeight,o=this.binding;this.cumulativeWeight=0,r<1&&(t=3*e,this._mixBufferRegion(n,i,t,1-r,e));for(var a=e,s=e+e;a!==s;++a)if(n[a]!==n[a+e]){o.setValue(n,i);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,n=this.valueSize,i=3*n;t.getValue(e,i);for(var r=n,o=i;r!==o;++r)e[r]=e[i+r%n];this.cumulativeWeight=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_select:function(t,e,n,i,r){if(.5<=i)for(var o=0;o!==r;++o)t[e+o]=t[n+o]},_slerp:function(t,e,n,i){S.slerpFlat(t,e,t,e,t,n,i)},_lerp:function(t,e,n,i,r){for(var o=1-i,a=0;a!==r;++a){var s=e+a;t[s]=t[s]*o+t[n+a]*i}}});var ju,Vu,Wu,qu,Xu,Yu,Zu,Ju,Qu,Ku,$u,td,ed,nd,id,rd,od,ad,sd,cd,hd,ld,ud,dd,pd,fd,md,vd,gd,yd,xd,bd,wd,Md,_d="\\[\\]\\.:\\/";function Ed(t,e,n,i){qu.set(e,n,i).unproject(Xu);var r=Wu[t];if(void 0!==r)for(var o=Vu.getAttribute("position"),a=0,s=r.length;a<s;a++)o.setXYZ(r[a],qu.x,qu.y,qu.z)}Object.assign(Ar.prototype,{getValue:function(t,e){this.bind();var n=this._targetGroup.nCachedObjects_,n=this._bindings[n];void 0!==n&&n.getValue(t,e)},setValue:function(t,e){for(var n=this._bindings,i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}),Object.assign(Sr,{Composite:Ar,create:function(t,e,n){return new(t&&t.isAnimationObjectGroup?Sr.Composite:Sr)(t,e,n)},sanitizeNodeName:(gd=new RegExp("["+_d+"]","g"),function(t){return t.replace(/\s/g,"_").replace(gd,"")}),parseTrackName:(fd="[^"+_d+"]",n="[^"+_d.replace("\\.","")+"]",e=/((?:WC+[\/:])*)/.source.replace("WC",fd),_d=/(WCOD+)?/.source.replace("WCOD",n),n=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",fd),fd=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",fd),md=new RegExp("^"+e+_d+n+fd+"$"),vd=["material","materials","bones"],function(t){var e=md.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i&&(e=n.nodeName.substring(i+1),-1!==vd.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=e)),null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n}),findNode:function(t,i){if(!i||""===i||"root"===i||"."===i||-1===i||i===t.name||i===t.uuid)return t;if(t.skeleton){var e=t.skeleton.getBoneByName(i);if(void 0!==e)return e}if(t.children){var r=function(t){for(var e=0;e<t.length;e++){var n=t[e];if(n.name===i||n.uuid===i)return n;n=r(n.children);if(n)return n}return null},t=r(t.children);if(t)return t}return null}}),Object.assign(Sr.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)t[e++]=n[i]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.targetObject[this.propertyName]=t[e]},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=t[e++]},function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var n=this.resolvedProperty,i=0,r=n.length;i!==r;++i)n[i]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,n=e.objectName,i=e.propertyName,r=e.propertyIndex;if(t||(t=Sr.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(n){var o=e.objectIndex;switch(n){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(var a=0;a<t.length;a++)if(t[a].name===o){o=a;break}break;default:if(void 0===t[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(void 0!==o){if(void 0===t[o])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[o]}}var s=t[i];if(void 0!==s){var c=this.Versioning.None;void 0!==(this.targetObject=t).needsUpdate?c=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(c=this.Versioning.MatrixWorldNeedsUpdate);var h=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===i){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(t.geometry.isBufferGeometry){if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);for(a=0;a<this.node.geometry.morphAttributes.position.length;a++)if(t.geometry.morphAttributes.position[a].name===r){r=a;break}}else{if(!t.geometry.morphTargets)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphTargets.",this);for(a=0;a<this.node.geometry.morphTargets.length;a++)if(t.geometry.morphTargets[a].name===r){r=a;break}}}h=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=r}else void 0!==s.fromArray&&void 0!==s.toArray?(h=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(h=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=i;this.getValue=this.GetterByBindingType[h],this.setValue=this.SetterByBindingTypeAndVersioning[h][c]}else{e=e.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+e+"."+i+" but it wasn't found.",t)}}else console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.")},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(Sr.prototype,{_getValue_unbound:Sr.prototype.getValue,_setValue_unbound:Sr.prototype.setValue}),Object.assign(function(){this.uuid=As.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var e=0,n=arguments.length;e!==n;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var i=this;this.stats={objects:{get total(){return i._objects.length},get inUse(){return this.total-i.nCachedObjects_}},get bindingsPerObject(){return i._bindings.length}}}.prototype,{isAnimationObjectGroup:!0,add:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=this._paths,o=this._parsedPaths,a=this._bindings,s=a.length,c=void 0,h=0,l=arguments.length;h!==l;++h){var u=arguments[h],d=u.uuid,p=i[d];if(void 0===p){p=e++,i[d]=p,t.push(u);for(var f=0,m=s;f!==m;++f)a[f].push(new Sr(u,r[f],o[f]))}else if(p<n){c=t[p];var v=--n,g=t[v];t[i[g.uuid]=p]=g,t[i[d]=v]=u;for(f=0,m=s;f!==m;++f){var y=a[f],x=y[v],b=y[p];y[p]=x,void 0===b&&(b=new Sr(u,r[f],o[f])),y[v]=b}}else t[p]!==c&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=n},remove:function(){for(var t=this._objects,e=this.nCachedObjects_,n=this._indicesByUUID,i=this._bindings,r=i.length,o=0,a=arguments.length;o!==a;++o){var s=arguments[o],c=s.uuid,h=n[c];if(void 0!==h&&e<=h){var l=e++,u=t[l];t[n[u.uuid]=h]=u,t[n[c]=l]=s;for(var d=0,p=r;d!==p;++d){var f=i[d],m=f[l],v=f[h];f[h]=m,f[l]=v}}}this.nCachedObjects_=e},uncache:function(){for(var t=this._objects,e=t.length,n=this.nCachedObjects_,i=this._indicesByUUID,r=this._bindings,o=r.length,a=0,s=arguments.length;a!==s;++a){var c=arguments[a].uuid,h=i[c];if(void 0!==h)if(delete i[c],h<n){var l,u=--n,c=t[u],d=t[l=--e];t[i[c.uuid]=h]=c,t[i[d.uuid]=u]=d,t.pop();for(var p=0,f=o;p!==f;++p){var m=(g=r[p])[u],v=g[l];g[h]=m,g[u]=v,g.pop()}}else{t[i[(d=t[l=--e]).uuid]=h]=d,t.pop();for(var g,p=0,f=o;p!==f;++p)(g=r[p])[h]=g[l],g.pop()}}this.nCachedObjects_=n},subscribe_:function(t,e){var n=this._bindingsIndicesByPath,i=n[t],r=this._bindings;if(void 0!==i)return r[i];var o=this._paths,a=this._parsedPaths,s=this._objects,c=s.length,h=this.nCachedObjects_,l=new Array(c),i=r.length;n[t]=i,o.push(t),a.push(e),r.push(l);for(var u=h,d=s.length;u!==d;++u){var p=s[u];l[u]=new Sr(p,t,e)}return l},unsubscribe_:function(t){var e,n,i,r,o,a=this._bindingsIndicesByPath,s=a[t];void 0!==s&&(e=this._paths,n=this._parsedPaths,o=(i=this._bindings)[r=i.length-1],i[a[t[r]]=s]=o,i.pop(),n[s]=n[r],n.pop(),e[s]=e[r],e.pop())}}),Object.assign(Tr.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,n){var i,r;return t.fadeOut(e),this.fadeIn(e),n&&(i=this._clip.duration,n=(r=t._clip.duration)/i,r=i/r,t.warp(1,n,e),this.warp(r,1,e)),this},crossFadeTo:function(t,e,n){return t.crossFadeFrom(this,e,n)},stopFading:function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this._effectiveTimeScale,0,t)},warp:function(t,e,n){var i=this._mixer,r=i.time,o=this._timeScaleInterpolant,a=this.timeScale;null===o&&(o=i._lendControlInterpolant(),this._timeScaleInterpolant=o);i=o.parameterPositions,o=o.sampleValues;return i[0]=r,i[1]=r+n,o[0]=t/a,o[1]=e/a,this},stopWarping:function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,n,i){if(this.enabled){var r=this._startTime;if(null!==r){r=(t-r)*n;if(r<0||0===n)return;this._startTime=null,e=n*r}e*=this._updateTimeScale(t);var o=this._updateTime(e),a=this._updateWeight(t);if(0<a)for(var s=this._interpolants,c=this._propertyBindings,h=0,l=s.length;h!==l;++h)s[h].evaluate(o),c[h].accumulate(i,a)}else this._updateWeight(t)},_updateWeight:function(t){var e,n,i=0;return this.enabled&&(i=this.weight,null!==(e=this._weightInterpolant)&&(i*=n=e.evaluate(t)[0],t>e.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1)))),this._effectiveWeight=i},_updateTimeScale:function(t){var e,n=0;return this.paused||(n=this.timeScale,null!==(e=this._timeScaleInterpolant)&&(n*=e.evaluate(t)[0],t>e.parameterPositions[1]&&(this.stopWarping(),0===n?this.paused=!0:this.timeScale=n))),this._effectiveTimeScale=n},_updateTime:function(t){var e,n=this.time+t,i=this._clip.duration,r=this.loop,o=this._loopCount,a=2202===r;if(0===t)return-1!==o&&a&&1==(1&o)?i-n:n;if(2200===r){-1===o&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(i<=n)n=i;else{if(!(n<0)){this.time=n;break t}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else if(-1===o&&(0<=t?(o=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),i<=n||n<0?(n-=i*(e=Math.floor(n/i)),o+=Math.abs(e),(r=this.repetitions-o)<=0?(this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=0<t?i:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:0<t?1:-1})):(1==r?(r=t<0,this._setEndings(r,!r,a)):this._setEndings(!1,!1,a),this._loopCount=o,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:e}))):this.time=n,a&&1==(1&o))return i-n;return n},_setEndings:function(t,e,n){var i=this._interpolantSettings;n?(i.endingStart=2401,i.endingEnd=2401):(i.endingStart=t?this.zeroSlopeAtStart?2401:ls:2402,i.endingEnd=e?this.zeroSlopeAtEnd?2401:ls:2402)},_scheduleFading:function(t,e,n){var i=this._mixer,r=i.time,o=this._weightInterpolant;null===o&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);i=o.parameterPositions,o=o.sampleValues;return i[0]=r,o[0]=e,i[1]=r+t,o[1]=n,this}}),Lr.prototype=Object.assign(Object.create(i.prototype),{constructor:Lr,_bindAction:function(t,e){var n=t._localRoot||this._root,i=t._clip.tracks,r=i.length,o=t._propertyBindings,a=t._interpolants,s=n.uuid,t=this._bindingsByRootAndName,c=t[s];void 0===c&&(c={},t[s]=c);for(var h=0;h!==r;++h){var l=i[h],u=l.name;if(void 0!==(d=c[u]))o[h]=d;else{if(void 0!==(d=o[h])){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,u));continue}var d,p=e&&e._propertyBindings[h].binding.parsedPath;++(d=new Er(Sr.create(n,u,p),l.ValueTypeName,l.getValueSize())).referenceCount,this._addInactiveBinding(d,s,u),o[h]=d}a[h].resultBuffer=d.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){var e,n,i;null===t._cacheIndex&&(e=(t._localRoot||this._root).uuid,n=t._clip.uuid,i=this._actionsByClip[n],this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,n,e));for(var r=t._propertyBindings,o=0,a=r.length;o!==a;++o){var s=r[o];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,n=0,i=e.length;n!==i;++n){var r=e[n];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){t=t._cacheIndex;return null!==t&&t<this._nActiveActions},_addInactiveAction:function(t,e,n){var i=this._actions,r=this._actionsByClip,o=r[e];void 0===o?(o={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,r[e]=o):(e=o.knownActions,t._byClipCacheIndex=e.length,e.push(t)),t._cacheIndex=i.length,i.push(t),o.actionByRoot[n]=t},_removeInactiveAction:function(t){var e=this._actions,n=e[e.length-1],i=t._cacheIndex;e[n._cacheIndex=i]=n,e.pop(),t._cacheIndex=null;var r=t._clip.uuid,o=this._actionsByClip,a=o[r],i=a.knownActions,n=i[i.length-1],e=t._byClipCacheIndex;i[n._byClipCacheIndex=e]=n,i.pop(),t._byClipCacheIndex=null,delete a.actionByRoot[(t._localRoot||this._root).uuid],0===i.length&&delete o[r],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){for(var e=t._propertyBindings,n=0,i=e.length;n!==i;++n){var r=e[n];0==--r.referenceCount&&this._removeInactiveBinding(r)}},_lendAction:function(t){var e=this._actions,n=t._cacheIndex,i=this._nActiveActions++,r=e[i];e[t._cacheIndex=i]=t,e[r._cacheIndex=n]=r},_takeBackAction:function(t){var e=this._actions,n=t._cacheIndex,i=--this._nActiveActions,r=e[i];e[t._cacheIndex=i]=t,e[r._cacheIndex=n]=r},_addInactiveBinding:function(t,e,n){var i=this._bindingsByRootAndName,r=i[e],o=this._bindings;void 0===r&&(r={},i[e]=r),(r[n]=t)._cacheIndex=o.length,o.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,n=t.binding,i=n.rootNode.uuid,r=n.path,o=this._bindingsByRootAndName,a=o[i],n=e[e.length-1],t=t._cacheIndex;e[n._cacheIndex=t]=n,e.pop(),delete a[r];t:{for(var s in a)break t;delete o[i]}},_lendBinding:function(t){var e=this._bindings,n=t._cacheIndex,i=this._nActiveBindings++,r=e[i];e[t._cacheIndex=i]=t,e[r._cacheIndex=n]=r},_takeBackBinding:function(t){var e=this._bindings,n=t._cacheIndex,i=--this._nActiveBindings,r=e[i];e[t._cacheIndex=i]=t,e[r._cacheIndex=n]=r},_lendControlInterpolant:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,n=t[e];return void 0===n&&(t[(n=new ui(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=e]=n),n},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,n=t.__cacheIndex,i=--this._nActiveControlInterpolants,r=e[i];e[t.__cacheIndex=i]=t,e[r.__cacheIndex=n]=r},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(t,e){var n=e||this._root,i=n.uuid,r="string"==typeof t?wi.findByName(n,t):t,o=null!==r?r.uuid:t,a=this._actionsByClip[o],n=null;if(void 0!==a){t=a.actionByRoot[i];if(void 0!==t)return t;n=a.knownActions[0],null===r&&(r=n._clip)}if(null===r)return null;e=new Tr(this,r,e);return this._bindAction(e,n),this._addInactiveAction(e,o,i),e},existingAction:function(t,e){var n=e||this._root,e=n.uuid,n="string"==typeof t?wi.findByName(n,t):t,t=n?n.uuid:t,t=this._actionsByClip[t];return void 0!==t&&t.actionByRoot[e]||null},stopAllAction:function(){var t=this._actions,e=this._nActiveActions,n=this._bindings,i=this._nActiveBindings;this._nActiveActions=0;for(var r=this._nActiveBindings=0;r!==e;++r)t[r].reset();for(r=0;r!==i;++r)n[r].useCount=0;return this},update:function(t){t*=this.timeScale;for(var e=this._actions,n=this._nActiveActions,i=this.time+=t,r=Math.sign(t),o=this._accuIndex^=1,a=0;a!==n;++a)e[a]._update(i,t,r,o);for(var s=this._bindings,c=this._nActiveBindings,a=0;a!==c;++a)s[a].apply(o);return this},getRoot:function(){return this._root},uncacheClip:function(t){var e=this._actions,n=t.uuid,i=this._actionsByClip,t=i[n];if(void 0!==t){for(var r=t.knownActions,o=0,a=r.length;o!==a;++o){var s=r[o];this._deactivateAction(s);var c=s._cacheIndex,h=e[e.length-1];s._cacheIndex=null,s._byClipCacheIndex=null,e[h._cacheIndex=c]=h,e.pop(),this._removeInactiveBindingsForAction(s)}delete i[n]}},uncacheRoot:function(t){var e,n=t.uuid,i=this._actionsByClip;for(e in i){var r=i[e].actionByRoot[n];void 0!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}var o=this._bindingsByRootAndName[n];if(void 0!==o)for(var a in o){var s=o[a];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(t,e){e=this.existingAction(t,e);null!==e&&(this._deactivateAction(e),this._removeInactiveAction(e))}}),Rr.prototype.clone=function(){return new Rr(void 0===this.value.clone?this.value:this.value.clone())},Cr.prototype=Object.assign(Object.create(Pe.prototype),{constructor:Cr,isInstancedInterleavedBuffer:!0,copy:function(t){return Pe.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),Object.assign(Pr.prototype,{linePrecision:1,set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize()):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld)):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,e,n){n=n||[];return Or(t,this,n,e),n.sort(Ir),n},intersectObjects:function(t,e,n){var i=n||[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(var r=0,o=t.length;r<o;r++)Or(t[r],this,i,e);return i.sort(Ir),i}}),Object.assign(function(t,e,n){return this.radius=void 0!==t?t:1,this.phi=void 0!==e?e:0,this.theta=void 0!==n?n:0,this}.prototype,{set:function(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(As.clamp(e/this.radius,-1,1))),this}}),Object.assign(function(t,e,n){return this.radius=void 0!==t?t:1,this.theta=void 0!==e?e:0,this.y=void 0!==n?n:0,this}.prototype,{set:function(t,e,n){return this.radius=t,this.theta=e,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){return this.radius=Math.sqrt(t*t+n*n),this.theta=Math.atan2(t,n),this.y=e,this}}),Object.assign(Dr.prototype,{set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:(pd=new wt,function(t,e){e=pd.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(e),this.max.copy(t).add(e),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box2: .getCenter() target is now required"),t=new wt),this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box2: .getSize() target is now required"),t=new wt),this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new wt),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new wt),e.copy(t).clamp(this.min,this.max)},distanceToPoint:(dd=new wt,function(t){return dd.copy(t).clamp(this.min,this.max).sub(t).length()}),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}),Object.assign(Nr.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new Mt),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new Mt),t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new Mt),this.delta(e).multiplyScalar(t).add(this.start)},closestPointToPointParameter:(ld=new Mt,ud=new Mt,function(t,e){ld.subVectors(t,this.start),ud.subVectors(this.end,this.start);t=ud.dot(ud),t=ud.dot(ld)/t;return e&&(t=As.clamp(t,0,1)),t}),closestPointToPoint:function(t,e,n){e=this.closestPointToPointParameter(t,e);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new Mt),this.delta(n).multiplyScalar(e).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}),((zr.prototype=Object.create(f.prototype)).constructor=zr).prototype.isImmediateRenderObject=!0,((Ur.prototype=Object.create(Ge.prototype)).constructor=Ur).prototype.update=(sd=new Mt,cd=new Mt,hd=new T,function(){var t=["a","b","c"];this.object.updateMatrixWorld(!0),hd.getNormalMatrix(this.object.matrixWorld);var e=this.object.matrixWorld,n=this.geometry.attributes.position,i=this.object.geometry;if(i&&i.isGeometry)for(var r=i.vertices,o=i.faces,a=0,s=0,c=o.length;s<c;s++)for(var h=o[s],l=0,u=h.vertexNormals.length;l<u;l++){var d=r[h[t[l]]],p=h.vertexNormals[l];sd.copy(d).applyMatrix4(e),cd.copy(p).applyMatrix3(hd).normalize().multiplyScalar(this.size).add(sd),n.setXYZ(a,sd.x,sd.y,sd.z),a+=1,n.setXYZ(a,cd.x,cd.y,cd.z),a+=1}else if(i&&i.isBufferGeometry)for(var f=i.attributes.position,m=i.attributes.normal,a=0,l=0,u=f.count;l<u;l++)sd.set(f.getX(l),f.getY(l),f.getZ(l)).applyMatrix4(e),cd.set(m.getX(l),m.getY(l),m.getZ(l)),cd.applyMatrix3(hd).normalize().multiplyScalar(this.size).add(sd),n.setXYZ(a,sd.x,sd.y,sd.z),a+=1,n.setXYZ(a,cd.x,cd.y,cd.z),a+=1;n.needsUpdate=!0}),((Br.prototype=Object.create(f.prototype)).constructor=Br).prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},Br.prototype.update=(ad=new Mt,function(){this.light.updateMatrixWorld();var t=this.light.distance||1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),ad.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(ad),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}),((kr.prototype=Object.create(Ge.prototype)).constructor=kr).prototype.updateMatrixWorld=(id=new Mt,rd=new St,od=new St,function(t){var e=this.bones,n=this.geometry,i=n.getAttribute("position");od.getInverse(this.root.matrixWorld);for(var r=0,o=0;r<e.length;r++){var a=e[r];a.parent&&a.parent.isBone&&(rd.multiplyMatrices(od,a.matrixWorld),id.setFromMatrixPosition(rd),i.setXYZ(o,id.x,id.y,id.z),rd.multiplyMatrices(od,a.parent.matrixWorld),id.setFromMatrixPosition(rd),i.setXYZ(o+1,id.x,id.y,id.z),o+=2)}n.getAttribute("position").needsUpdate=!0,f.prototype.updateMatrixWorld.call(this,t)}),((Fr.prototype=Object.create(H.prototype)).constructor=Fr).prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},Fr.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)},((Gr.prototype=Object.create(Fe.prototype)).constructor=Gr).prototype.update=function(){var t,e;this.scale.set(.5*this.light.width,.5*this.light.height,1),void 0!==this.color?(this.material.color.set(this.color),this.children[0].material.color.set(this.color)):(this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),t=this.material.color,1<(e=Math.max(t.r,t.g,t.b))&&t.multiplyScalar(1/e),this.children[0].material.color.copy(this.material.color))},Gr.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()},((Hr.prototype=Object.create(f.prototype)).constructor=Hr).prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},Hr.prototype.update=(td=new Mt,ed=new y,nd=new y,function(){var t=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var e=t.geometry.getAttribute("color");ed.copy(this.light.color),nd.copy(this.light.groundColor);for(var n=0,i=e.count;n<i;n++){var r=n<i/2?ed:nd;e.setXYZ(n,r.r,r.g,r.b)}e.needsUpdate=!0}t.lookAt(td.setFromMatrixPosition(this.light.matrixWorld).negate())}),((jr.prototype=Object.create(H.prototype)).constructor=jr).prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},jr.prototype.onBeforeRender=function(){this.position.copy(this.lightProbe.position),this.scale.set(1,1,1).multiplyScalar(this.size),this.material.uniforms.intensity.value=this.lightProbe.intensity},Vr.prototype=Object.assign(Object.create(Ge.prototype),{constructor:Vr,copy:function(t){return Ge.prototype.copy.call(this,t),this.geometry.copy(t.geometry),this.material.copy(t.material),this},clone:function(){return(new this.constructor).copy(this)}}),(Wr.prototype=Object.create(Ge.prototype)).constructor=Wr,((qr.prototype=Object.create(Fe.prototype)).constructor=qr).prototype.update=function(){function t(t,e,n,i){var r=(e-t)/n;for(p.setXYZ(l,0,0,0),u++,o=t;o<e;o+=r)a=l+u,p.setXYZ(a,Math.sin(o)*s,0,Math.cos(o)*s),p.setXYZ(a+1,Math.sin(Math.min(o+r,e))*s,0,Math.cos(Math.min(o+r,e))*s),p.setXYZ(a+2,0,0,0),u+=3;d.addGroup(l,u,i),l+=u,u=0}var o,a,e=this.audio,s=this.range,n=this.divisionsInnerAngle,i=this.divisionsOuterAngle,r=As.degToRad(e.panner.coneInnerAngle),c=As.degToRad(e.panner.coneOuterAngle),h=r/2,e=c/2,l=0,u=0,d=this.geometry,p=d.attributes.position;d.clearGroups(),t(-e,-h,i,0),t(-h,h,n,1),t(h,e,i,0),p.needsUpdate=!0,r===c&&(this.material[0].visible=!1)},qr.prototype.dispose=function(){this.geometry.dispose(),this.material[0].dispose(),this.material[1].dispose()},((Xr.prototype=Object.create(Ge.prototype)).constructor=Xr).prototype.update=(Qu=new Mt,Ku=new Mt,$u=new T,function(){this.object.updateMatrixWorld(!0),$u.getNormalMatrix(this.object.matrixWorld);for(var t=this.object.matrixWorld,e=this.geometry.attributes.position,n=this.object.geometry,i=n.vertices,r=n.faces,o=0,a=0,s=r.length;a<s;a++){var c=r[a],h=c.normal;Qu.copy(i[c.a]).add(i[c.b]).add(i[c.c]).divideScalar(3).applyMatrix4(t),Ku.copy(h).applyMatrix3($u).normalize().multiplyScalar(this.size).add(Qu),e.setXYZ(o,Qu.x,Qu.y,Qu.z),o+=1,e.setXYZ(o,Ku.x,Ku.y,Ku.z),o+=1}e.needsUpdate=!0}),((Yr.prototype=Object.create(f.prototype)).constructor=Yr).prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},Yr.prototype.update=(Yu=new Mt,Zu=new Mt,Ju=new Mt,function(){Yu.setFromMatrixPosition(this.light.matrixWorld),Zu.setFromMatrixPosition(this.light.target.matrixWorld),Ju.subVectors(Zu,Yu),this.lightPlane.lookAt(Zu),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Zu),this.targetLine.scale.z=Ju.length()}),((Zr.prototype=Object.create(Ge.prototype)).constructor=Zr).prototype.update=(qu=new Mt,Xu=new we,function(){Vu=this.geometry,Wu=this.pointMap,Xu.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),Ed("c",0,0,-1),Ed("t",0,0,1),Ed("n1",-1,-1,-1),Ed("n2",1,-1,-1),Ed("n3",-1,1,-1),Ed("n4",1,1,-1),Ed("f1",-1,-1,1),Ed("f2",1,-1,1),Ed("f3",-1,1,1),Ed("f4",1,1,1),Ed("u1",.7,1.1,-1),Ed("u2",-.7,1.1,-1),Ed("u3",0,2,-1),Ed("cf1",-1,0,1),Ed("cf2",1,0,1),Ed("cf3",0,-1,1),Ed("cf4",0,1,1),Ed("cn1",-1,0,-1),Ed("cn2",1,0,-1),Ed("cn3",0,-1,-1),Ed("cn4",0,1,-1),Vu.getAttribute("position").needsUpdate=!0}),((Jr.prototype=Object.create(Ge.prototype)).constructor=Jr).prototype.update=(ju=new o,function(t){var e,n,i;void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&ju.setFromObject(this.object),ju.isEmpty()||(e=ju.min,n=ju.max,(t=(i=this.geometry.attributes.position).array)[0]=n.x,t[1]=n.y,t[2]=n.z,t[3]=e.x,t[4]=n.y,t[5]=n.z,t[6]=e.x,t[7]=e.y,t[8]=n.z,t[9]=n.x,t[10]=e.y,t[11]=n.z,t[12]=n.x,t[13]=n.y,t[14]=e.z,t[15]=e.x,t[16]=n.y,t[17]=e.z,t[18]=e.x,t[19]=e.y,t[20]=e.z,t[21]=n.x,t[22]=e.y,t[23]=e.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere())}),Jr.prototype.setFromObject=function(t){return this.object=t,this.update(),this},Jr.prototype.copy=function(t){return Ge.prototype.copy.call(this,t),this.object=t.object,this},Jr.prototype.clone=function(){return(new this.constructor).copy(this)},((Qr.prototype=Object.create(Ge.prototype)).constructor=Qr).prototype.updateMatrixWorld=function(t){var e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),f.prototype.updateMatrixWorld.call(this,t))},((Kr.prototype=Object.create(Fe.prototype)).constructor=Kr).prototype.updateMatrixWorld=function(t){var e=-this.plane.constant;Math.abs(e)<1e-8&&(e=1e-8),this.scale.set(.5*this.size,.5*this.size,e),this.children[0].material.side=e<0?go:vo,this.lookAt(this.plane.normal),f.prototype.updateMatrixWorld.call(this,t)},(($r.prototype=Object.create(f.prototype)).constructor=$r).prototype.setDirection=(wd=new Mt,function(t){.99999<t.y?this.quaternion.set(0,0,0,1):t.y<-.99999?this.quaternion.set(1,0,0,0):(wd.set(t.z,0,-t.x).normalize(),bd=Math.acos(t.y),this.quaternion.setFromAxisAngle(wd,bd))}),$r.prototype.setLength=function(t,e,n){void 0===e&&(e=.2*t),void 0===n&&(n=.2*e),this.line.scale.set(1,Math.max(0,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()},$r.prototype.setColor=function(t){this.line.material.color.copy(t),this.cone.material.color.copy(t)},$r.prototype.copy=function(t){return f.prototype.copy.call(this,t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this},$r.prototype.clone=function(){return(new this.constructor).copy(this)},(to.prototype=Object.create(Ge.prototype)).constructor=to,Li.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(Li.prototype),(t.prototype.constructor=t).prototype.getPoint=e,t},Object.assign(ji.prototype,{createPointsGeometry:function(t){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");t=this.getPoints(t);return this.createGeometry(t)},createSpacedPointsGeometry:function(t){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");t=this.getSpacedPoints(t);return this.createGeometry(t)},createGeometry:function(t){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var e=new x,n=0,i=t.length;n<i;n++){var r=t[n];e.vertices.push(new Mt(r.x,r.y,r.z||0))}return e}}),Object.assign(Vi.prototype,{fromPoints:function(t){console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),Object.create(Ii.prototype),Object.create(Ii.prototype),no.prototype=Object.create(Ii.prototype),Object.assign(no.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),Vr.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},kr.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(ur.prototype,{extractUrlBase:function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),pu(t)}}),Object.assign(sr.prototype,{setTexturePath:function(t){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(t)}}),Object.assign(Dr.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(o.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),Nr.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Object.assign(As,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),As.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),As.ceilPowerOfTwo(t)}}),Object.assign(T.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBuffer:function(t){return console.warn("THREE.Matrix3: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(St.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){return void 0===Md&&(Md=new Mt),console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),Md.setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBuffer:function(t){return console.warn("THREE.Matrix4: .applyToBuffer() has been removed. Use matrix.applyToBufferAttribute( attribute ) instead."),this.applyToBufferAttribute(t)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,n,i,r,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,i,n,r,o)}}),a.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},S.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},Object.assign(k.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(F.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},midpoint:function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},normal:function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},plane:function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)}}),Object.assign(F,{barycoordFromPoint:function(t,e,n,i,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),F.getBarycoord(t,e,n,i,r)},normal:function(t,e,n,i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),F.getNormal(t,e,n,i)}}),Object.assign(Wi.prototype,{extractAllPoints:function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new In(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new jn(this,t)}}),Object.assign(wt.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Mt.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},applyProjection:function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},fromAttribute:function(t,e,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(_t.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(x.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}}),Object.assign(f.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")}}),Object.defineProperties(f.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.defineProperties(Ne.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Ue.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),ze.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Li.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),Me.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(qi.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(b.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")}}),Object.assign(U.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addDrawCall:function(t,e,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")}}),Object.defineProperties(U.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.assign(On.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.defineProperties(Rr.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(N.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new y}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===t}}}),Object.defineProperties(ii.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(B.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(Te.prototype,{clearTarget:function(t,e,n,i){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,n,i)},animate:function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")}}),Object.defineProperties(Te.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(ve.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(u.prototype,{activeCubeFace:{set:function(){console.warn("THREE.WebGLRenderTargetCube: .activeCubeFace has been removed. It is now the second parameter of WebGLRenderer.setRenderTarget().")}},activeMipMapLevel:{set:function(){console.warn("THREE.WebGLRenderTargetCube: .activeMipMapLevel has been removed. It is now the third parameter of WebGLRenderer.setRenderTarget().")}}}),Object.defineProperties(I.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties(Ae.prototype,{standing:{set:function(){console.warn("THREE.WebVRManager: .standing has been removed.")}},userHeight:{set:function(){console.warn("THREE.WebVRManager: .userHeight has been removed.")}}}),wr.prototype.load=function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");var e=this;return(new dr).load(t,function(t){e.setBuffer(t)}),this},_r.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},yr.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)},dc.crossOrigin=void 0,dc.loadTexture=function(t,e,n,i){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");var r=new Ti;r.setCrossOrigin(this.crossOrigin);i=r.load(t,n,void 0,i);return e&&(i.mapping=e),i},dc.loadTextureCube=function(t,e,n,i){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");var r=new Si;r.setCrossOrigin(this.crossOrigin);i=r.load(t,n,void 0,i);return e&&(i.mapping=e),i},dc.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},dc.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")}},function(t,z,U){"use strict";(function(n){function i(t){this.constraints=S()({video:{width:{ideal:1920},height:{ideal:1080},facingMode:{exact:"environment"}},audio:!1},t),this.container=null,this.scene=null,this.element=null,this.devices=[],this.stream=null,this.ratioScalar=1,this.videoDeviceIndex=0}function t(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:16777215,e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1500;this.dpr=window.devicePixelRatio;var i=this.createCanvas(),r=i.canvas,o=i.context,i=new Y.x({color:t,map:this.createCanvasTexture(r)});Y.y.call(this,i),this.canvasWidth=r.width,this.canvasHeight=r.height,this.context=o,this.color=t instanceof Y.z?t:new Y.z(t),this.autoSelect=e,this.dwellTime=n,this.rippleDuration=500,this.position.z=-10,this.center.set(.5,.5),this.scale.set(.5,.5,1),this.startTimestamp=null,this.timerId=null,this.callback=null,this.frustumCulled=!1,this.updateCanvasArcByProgress(0)}function a(){var i=0<arguments.length&&void 0!==arguments[0]?arguments[0]:300,t=arguments[1],e=arguments[2],t=t||R.Info;Y.y.call(this),this.type="infospot",this.animated=void 0===e||e,this.isHovering=!1,this.frustumCulled=!1,this.element=null,this.toPanorama=null,this.cursorStyle=null,this.mode=L.NORMAL,this.scale.set(i,i,1),this.rotation.y=Math.PI,this.container=null,this.originalRaycast=this.raycast,this.HANDLER_FOCUS=null,this.material.side=Y.f,this.material.depthTest=!1,this.material.transparent=!0,this.material.opacity=0,this.scaleUpAnimation=new O.Tween,this.scaleDownAnimation=new O.Tween;e=function(t){var e,n;this.material&&(e=t.image.width/t.image.height,n=new Y.o,t.image.width=t.image.naturalWidth||64,t.image.height=t.image.naturalHeight||64,this.scale.set(e*i,i,1),n.copy(this.scale),this.scaleUpAnimation=new O.Tween(this.scale).to({x:1.3*n.x,y:1.3*n.y},500).easing(O.Easing.Elastic.Out),this.scaleDownAnimation=new O.Tween(this.scale).to({x:n.x,y:n.y},500).easing(O.Easing.Elastic.Out),this.material.map=t,this.material.needsUpdate=!0)}.bind(this);this.showAnimation=new O.Tween(this.material).to({opacity:1},500).onStart(this.enableRaycast.bind(this,!0)).easing(O.Easing.Quartic.Out),this.hideAnimation=new O.Tween(this.material).to({opacity:0},500).onStart(this.enableRaycast.bind(this,!1)).easing(O.Easing.Quartic.Out),this.addEventListener("click",this.onClick),this.addEventListener("hover",this.onHover),this.addEventListener("hoverenter",this.onHoverStart),this.addEventListener("hoverleave",this.onHoverEnd),this.addEventListener("panolens-dual-eye-effect",this.onDualEyeEffect),this.addEventListener("panolens-container",this.setContainer.bind(this)),this.addEventListener("dismiss",this.onDismiss),this.addEventListener("panolens-infospot-focus",this.setFocusMethod),P.load(t,e)}function r(t){t||console.warn("PANOLENS.Widget: No container specified"),Y.u.call(this),this.DEFAULT_TRANSITION="all 0.27s ease",this.TOUCH_ENABLED=!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch),this.PREVENT_EVENT_HANDLER=function(t){t.preventDefault(),t.stopPropagation()},this.container=t,this.barElement=null,this.fullscreenElement=null,this.videoElement=null,this.settingElement=null,this.mainMenu=null,this.activeMainItem=null,this.activeSubMenu=null,this.mask=null}function o(t,e){Y.h.call(this,t,e),this.type="panorama",this.ImageQualityLow=1,this.ImageQualityFair=2,this.ImageQualityMedium=3,this.ImageQualityHigh=4,this.ImageQualitySuperHigh=5,this.animationDuration=1e3,this.defaultInfospotSize=350,this.container=void 0,this.loaded=!1,this.linkedSpots=[],this.isInfospotVisible=!1,this.linkingImageURL=void 0,this.linkingImageScale=void 0,this.material.side=Y.B,this.material.opacity=0,this.scale.x*=-1,this.renderOrder=-1,this.active=!1,this.infospotAnimation=new O.Tween(this).to({},this.animationDuration/2),this.addEventListener("load",this.fadeIn.bind(this)),this.addEventListener("panolens-container",this.setContainer.bind(this)),this.addEventListener("click",this.onClick.bind(this)),this.setupTransitions()}function s(t,e,n){e=e||new Y.C(5e3,60,40),n=n||new Y.k({opacity:0,transparent:!0});o.call(this,e,n),this.src=t,this.radius=5e3}function e(){var t=new Y.D,e=new Y.k({color:0,opacity:0,transparent:!0});t.addAttribute("position",new Y.E(new Float32Array,1)),o.call(this,t,e)}function c(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],e=S()({},Y.F.cube),n=new Y.G(1e4,1e4,1e4),e=new Y.H({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:e.uniforms,side:Y.B,transparent:!0});o.call(this,n,e),this.images=t,this.edgeLength=1e4,this.material.uniforms.opacity.value=0}function h(){for(var t=[],e=0;e<6;e++)t.push(R.WhiteTile);c.call(this,t)}function l(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=new Y.C(5e3,60,40),i=new Y.k({opacity:0,transparent:!0});o.call(this,n,i),this.src=t,this.options={videoElement:document.createElement("video"),loop:!0,muted:!0,autoplay:!1,playsinline:!0,crossOrigin:"anonymous"},S()(this.options,e),this.videoElement=this.options.videoElement,this.videoProgress=0,this.radius=5e3,this.addEventListener("leave",this.pauseVideo.bind(this)),this.addEventListener("enter-fade-start",this.resumeVideoProgress.bind(this)),this.addEventListener("video-toggle",this.toggleVideo.bind(this)),this.addEventListener("video-time",this.setVideoCurrentTime.bind(this))}function u(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this._parameters=t,this._zoom=null,this._panoId=null,this._panoClient=new google.maps.StreetViewService,this._count=0,this._total=0,this._canvas=[],this._ctx=[],this._wc=0,this._hc=0,this.result=null,this.rotation=0,this.copyright="",this.onSizeChange=null,this.onPanoramaLoad=null,this.levelsW=[1,2,4,7,13,26],this.levelsH=[1,1,2,4,7,13],this.widths=[416,832,1664,3328,6656,13312],this.heights=[416,416,832,1664,3328,6656],this.maxW=6656,this.maxH=6656;var e=void 0;try{var n=document.createElement("canvas");e=(e=n.getContext("experimental-webgl"))||n.getContext("webgl")}catch(t){}this.maxW=Math.max(e.getParameter(e.MAX_TEXTURE_SIZE),this.maxW),this.maxH=Math.max(e.getParameter(e.MAX_TEXTURE_SIZE),this.maxH)}function d(t,e){s.call(this),this.panoId=t,this.gsvLoader=null,this.loadRequested=!1,this.setupGoogleMapAPI(e)}function p(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"image",e=arguments[1],n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1e4,i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:.5;"image"===t&&s.call(this,e,this.createGeometry(n,i),this.createMaterial(n)),this.size=n,this.ratio=i,this.EPS=1e-6,this.frameId=null,this.dragging=!1,this.userMouse=new Y.c,this.quatA=new Y.J,this.quatB=new Y.J,this.quatCur=new Y.J,this.quatSlerp=new Y.J,this.vectorX=new Y.o(1,0,0),this.vectorY=new Y.o(0,1,0),this.addEventListener("window-resize",this.onWindowResize)}function f(t,e,n){p.call(this,"image",t,e,n)}function m(t){var e=new Y.C(5e3,60,40),n=new Y.k({visible:!1});o.call(this,e,n),this.media=new i(t),this.radius=5e3,this.addEventListener("enter",this.start.bind(this)),this.addEventListener("leave",this.stop.bind(this)),this.addEventListener("panolens-container",this.onPanolensContainer.bind(this)),this.addEventListener("panolens-scene",this.onPanolensScene.bind(this))}function v(t,e){function i(){return 2*Math.PI/60/60*y.autoRotateSpeed}function n(){return Math.pow(.95,y.zoomSpeed)}function r(t){if(B=k=0,(F=!1)!==y.enabled){if(t.preventDefault(),t.button===y.mouseButtons.ORBIT){if(!0===y.noRotate)return;H=G.ROTATE,x.set(t.clientX,t.clientY)}else if(t.button===y.mouseButtons.ZOOM){if(!0===y.noZoom)return;H=G.DOLLY,T.set(t.clientX,t.clientY)}else if(t.button===y.mouseButtons.PAN){if(!0===y.noPan)return;H=G.PAN,M.set(t.clientX,t.clientY)}H!==G.NONE&&(document.addEventListener("mousemove",o,!1),document.addEventListener("mouseup",a,!1),y.dispatchEvent(q)),y.update()}}function o(t){if(!1!==y.enabled){t.preventDefault();var e=y.domElement===document?y.domElement.body:y.domElement;if(H===G.ROTATE){if(!0===y.noRotate)return;b.set(t.clientX,t.clientY),w.subVectors(b,x),y.rotateLeft(2*Math.PI*w.x/e.clientWidth*y.rotateSpeed),y.rotateUp(2*Math.PI*w.y/e.clientHeight*y.rotateSpeed),x.copy(b),p&&(B=t.clientX-p.clientX,k=t.clientY-p.clientY),p=t}else if(H===G.DOLLY){if(!0===y.noZoom)return;L.set(t.clientX,t.clientY),R.subVectors(L,T),0<R.y?y.dollyIn():R.y<0&&y.dollyOut(),T.copy(L)}else if(H===G.PAN){if(!0===y.noPan)return;_.set(t.clientX,t.clientY),E.subVectors(_,M),y.pan(E.x,E.y),M.copy(_)}H!==G.NONE&&y.update()}}function a(){!(F=!(p=void 0))!==y.enabled&&(document.removeEventListener("mousemove",o,!1),document.removeEventListener("mouseup",a,!1),y.dispatchEvent(X),H=G.NONE)}function s(t){var e;!1!==y.enabled&&!0!==y.noZoom&&H===G.NONE&&(t.preventDefault(),t.stopPropagation(),void(e=0)!==t.wheelDelta?e=t.wheelDelta:void 0!==t.detail&&(e=-t.detail),0<e?(y.object.fov=y.object.fov<y.maxFov?y.object.fov+1:y.maxFov,y.object.updateProjectionMatrix()):e<0&&(y.object.fov=y.object.fov>y.minFov?y.object.fov-1:y.minFov,y.object.updateProjectionMatrix()),y.update(),y.dispatchEvent(W),y.dispatchEvent(q),y.dispatchEvent(X))}function c(t){switch(t.keyCode){case y.keys.UP:f=!1;break;case y.keys.BOTTOM:m=!1;break;case y.keys.LEFT:v=!1;break;case y.keys.RIGHT:g=!1}}function h(t){if(!1!==y.enabled&&!0!==y.noKeys&&!0!==y.noRotate){switch(t.keyCode){case y.keys.UP:f=!0;break;case y.keys.BOTTOM:m=!0;break;case y.keys.LEFT:v=!0;break;case y.keys.RIGHT:g=!0}(f||m||v||g)&&(F=!0,f&&(k=-y.rotateSpeed*y.momentumKeydownFactor),m&&(k=y.rotateSpeed*y.momentumKeydownFactor),v&&(B=-y.rotateSpeed*y.momentumKeydownFactor),g&&(B=y.rotateSpeed*y.momentumKeydownFactor))}}function l(t){if(B=k=0,(F=!1)!==y.enabled){switch(t.touches.length){case 1:if(!0===y.noRotate)return;H=G.TOUCH_ROTATE,x.set(t.touches[0].pageX,t.touches[0].pageY);break;case 2:if(!0===y.noZoom)return;H=G.TOUCH_DOLLY;var e=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY,n=Math.sqrt(e*e+n*n);T.set(0,n);break;case 3:if(!0===y.noPan)return;H=G.TOUCH_PAN,M.set(t.touches[0].pageX,t.touches[0].pageY);break;default:H=G.NONE}H!==G.NONE&&y.dispatchEvent(q)}}function u(t){if(!1!==y.enabled){t.preventDefault(),t.stopPropagation();var e=y.domElement===document?y.domElement.body:y.domElement;switch(t.touches.length){case 1:if(!0===y.noRotate)return;if(H!==G.TOUCH_ROTATE)return;b.set(t.touches[0].pageX,t.touches[0].pageY),w.subVectors(b,x),y.rotateLeft(2*Math.PI*w.x/e.clientWidth*y.rotateSpeed),y.rotateUp(2*Math.PI*w.y/e.clientHeight*y.rotateSpeed),x.copy(b),p&&(B=t.touches[0].pageX-p.pageX,k=t.touches[0].pageY-p.pageY),p={pageX:t.touches[0].pageX,pageY:t.touches[0].pageY},y.update();break;case 2:if(!0===y.noZoom)return;if(H!==G.TOUCH_DOLLY)return;var n=t.touches[0].pageX-t.touches[1].pageX,i=t.touches[0].pageY-t.touches[1].pageY,i=Math.sqrt(n*n+i*i);L.set(0,i),R.subVectors(L,T),R.y<0?(y.object.fov=y.object.fov<y.maxFov?y.object.fov+1:y.maxFov,y.object.updateProjectionMatrix()):0<R.y&&(y.object.fov=y.object.fov>y.minFov?y.object.fov-1:y.minFov,y.object.updateProjectionMatrix()),T.copy(L),y.update(),y.dispatchEvent(W);break;case 3:if(!0===y.noPan)return;if(H!==G.TOUCH_PAN)return;_.set(t.touches[0].pageX,t.touches[0].pageY),E.subVectors(_,M),y.pan(E.x,E.y),M.copy(_),y.update();break;default:H=G.NONE}}}function d(){!(F=!(p=void 0))!==y.enabled&&(y.dispatchEvent(X),H=G.NONE)}this.object=t,this.domElement=void 0!==e?e:document,this.frameId=null,this.enabled=!0,this.target=new Y.o,this.center=this.target,this.noZoom=!1,this.zoomSpeed=1,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.noRotate=!1,this.rotateSpeed=-.15,this.noPan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.momentumDampingFactor=.9,this.momentumScalingFactor=-.005,this.momentumKeydownFactor=20,this.minFov=30,this.maxFov=120,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.noKeys=!1,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={ORBIT:Y.L.LEFT,ZOOM:Y.L.MIDDLE,PAN:Y.L.RIGHT};var p,f,m,v,g,y=this,x=new Y.c,b=new Y.c,w=new Y.c,M=new Y.c,_=new Y.c,E=new Y.c,A=new Y.o,S=new Y.o,T=new Y.c,L=new Y.c,R=new Y.c,C=0,P=0,I=0,O=0,D=1,N=new Y.o,z=new Y.o,U=new Y.J,B=0,k=0,F=!1,G={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},H=G.NONE;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom;var j=(new Y.J).setFromUnitVectors(t.up,new Y.o(0,1,0)),V=j.clone().inverse(),W={type:"change"},q={type:"start"},X={type:"end"};this.setLastQuaternion=function(t){U.copy(t),y.object.quaternion.copy(t)},this.getLastPosition=function(){return z},this.rotateLeft=function(t){void 0===t&&(t=i()),O-=t},this.rotateUp=function(t){void 0===t&&(t=i()),I-=t},this.panLeft=function(t){var e=this.object.matrix.elements;A.set(e[0],e[1],e[2]),A.multiplyScalar(-t),N.add(A)},this.panUp=function(t){var e=this.object.matrix.elements;A.set(e[4],e[5],e[6]),A.multiplyScalar(t),N.add(A)},this.pan=function(t,e){var n,i=y.domElement===document?y.domElement.body:y.domElement;y.object instanceof Y.M?(n=y.object.position.clone().sub(y.target).length(),n*=Math.tan(y.object.fov/2*Math.PI/180),y.panLeft(2*t*n/i.clientHeight),y.panUp(2*e*n/i.clientHeight)):y.object instanceof Y.N?(y.panLeft(t*(y.object.right-y.object.left)/i.clientWidth),y.panUp(e*(y.object.top-y.object.bottom)/i.clientHeight)):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.")},this.momentum=function(){F&&(Math.abs(B)<1e-4&&Math.abs(k)<1e-4?F=!1:(k*=this.momentumDampingFactor,B*=this.momentumDampingFactor,O-=this.momentumScalingFactor*B,I-=this.momentumScalingFactor*k))},this.dollyIn=function(t){void 0===t&&(t=n()),y.object instanceof Y.M?D/=t:y.object instanceof Y.N?(y.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom*t)),y.object.updateProjectionMatrix(),y.dispatchEvent(W)):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.")},this.dollyOut=function(t){void 0===t&&(t=n()),y.object instanceof Y.M?D*=t:y.object instanceof Y.N?(y.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/t)),y.object.updateProjectionMatrix(),y.dispatchEvent(W)):console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.")},this.update=function(t){var e=this.object.position;S.copy(e).sub(this.target),S.applyQuaternion(j),C=Math.atan2(S.x,S.z),P=Math.atan2(Math.sqrt(S.x*S.x+S.z*S.z),S.y),this.autoRotate&&H===G.NONE&&this.rotateLeft(i()),this.momentum(),C+=O,P+=I,C=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,C)),P=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,P)),P=Math.max(1e-7,Math.min(Math.PI-1e-7,P));var n=S.length()*D,n=Math.max(this.minDistance,Math.min(this.maxDistance,n));this.target.add(N),S.x=n*Math.sin(P)*Math.sin(C),S.y=n*Math.cos(P),S.z=n*Math.sin(P)*Math.cos(C),S.applyQuaternion(V),e.copy(this.target).add(S),this.object.lookAt(this.target),I=O=0,D=1,N.set(0,0,0),(1e-7<z.distanceToSquared(this.object.position)||1e-7<8*(1-U.dot(this.object.quaternion)))&&(!0!==t&&this.dispatchEvent(W),z.copy(this.object.position),U.copy(this.object.quaternion))},this.reset=function(){H=G.NONE,this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(W),this.update()},this.getPolarAngle=function(){return P},this.getAzimuthalAngle=function(){return C},this.dispose=function(){this.domElement.removeEventListener("mousedown",r),this.domElement.removeEventListener("mousewheel",s),this.domElement.removeEventListener("DOMMouseScroll",s),this.domElement.removeEventListener("touchstart",l),this.domElement.removeEventListener("touchend",d),this.domElement.removeEventListener("touchmove",u),window.removeEventListener("keyup",c),window.removeEventListener("keydown",h)},this.domElement.addEventListener("mousedown",r,{passive:!1}),this.domElement.addEventListener("mousewheel",s,{passive:!1}),this.domElement.addEventListener("DOMMouseScroll",s,{passive:!1}),this.domElement.addEventListener("touchstart",l,{passive:!1}),this.domElement.addEventListener("touchend",d,{passive:!1}),this.domElement.addEventListener("touchmove",u,{passive:!1}),window.addEventListener("keyup",c,{passive:!1}),window.addEventListener("keydown",h,{passive:!1}),this.update()}function g(t,e){var f=this,m={type:"change"},n=0,v=0,i=0,r=0;this.camera=t,this.camera.rotation.reorder("YXZ"),this.domElement=void 0!==e?e:document,this.enabled=!0,this.deviceOrientation={},this.screenOrientation=0,this.alpha=0,this.alphaOffsetAngle=0;function o(t){f.deviceOrientation=t}function a(){f.screenOrientation=window.orientation||0}function s(t){t.preventDefault(),t.stopPropagation(),i=t.touches[0].pageX,r=t.touches[0].pageY}function c(t){t.preventDefault(),t.stopPropagation(),n+=Y.l.degToRad((t.touches[0].pageX-i)/4),v+=Y.l.degToRad((r-t.touches[0].pageY)/4),f.updateAlphaOffsetAngle(n),i=t.touches[0].pageX,r=t.touches[0].pageY}this.connect=function(){a(),window.addEventListener("orientationchange",a,{passive:!0}),window.addEventListener("deviceorientation",o,{passive:!0}),window.addEventListener("deviceorientation",this.update.bind(this),{passive:!0}),f.domElement.addEventListener("touchstart",s,{passive:!1}),f.domElement.addEventListener("touchmove",c,{passive:!1}),f.enabled=!0},this.disconnect=function(){window.removeEventListener("orientationchange",a,!1),window.removeEventListener("deviceorientation",o,!1),window.removeEventListener("deviceorientation",this.update.bind(this),!1),f.domElement.removeEventListener("touchstart",s,!1),f.domElement.removeEventListener("touchmove",c,!1),f.enabled=!1},this.update=function(t){var e,n,i,r,o,a,s,c,h,l,u,d,p;!1!==f.enabled&&(e=f.deviceOrientation.alpha?Y.l.degToRad(f.deviceOrientation.alpha)+f.alphaOffsetAngle:0,u=f.deviceOrientation.beta?Y.l.degToRad(f.deviceOrientation.beta):0,d=f.deviceOrientation.gamma?Y.l.degToRad(f.deviceOrientation.gamma):0,p=f.screenOrientation?Y.l.degToRad(f.screenOrientation):0,n=f.camera.quaternion,i=e,r=u,o=d,a=p,c=new Y.o(0,0,1),h=new Y.O,l=new Y.J,u=new Y.J(-Math.sqrt(.5),0,0,Math.sqrt(.5)),d=new Y.J,p=new Y.J,0==f.screenOrientation?(s=new Y.o(1,0,0),d.setFromAxisAngle(s,-v)):180==f.screenOrientation?(s=new Y.o(1,0,0),d.setFromAxisAngle(s,v)):90==f.screenOrientation?(s=new Y.o(0,1,0),d.setFromAxisAngle(s,v)):-90==f.screenOrientation&&(s=new Y.o(0,1,0),d.setFromAxisAngle(s,-v)),u.multiply(d),u.multiply(p),h.set(r,i,-o,"YXZ"),n.setFromEuler(h),n.multiply(u),n.multiply(l.setFromAxisAngle(c,-a)),f.alpha=e,!0!==t&&f.dispatchEvent(m))},this.updateAlphaOffsetAngle=function(t){this.alphaOffsetAngle=t,this.update()},this.dispose=function(){this.disconnect()},this.connect()}function y(i){var r=new Y.N(-1,1,1,-1,0,1),o=new Y.P,a=new Y.Q;a.aspect=.5;var t={minFilter:Y.w,magFilter:Y.R,format:Y.s},s=new Y.S(512,512,t);s.scissorTest=!0,s.texture.generateMipmaps=!1;var e=new Y.c(.441,.156),n=new Y.K(1,1,10,20).removeAttribute("normal").toNonIndexed(),c=n.attributes.position.array,t=n.attributes.uv.array;n.attributes.position.count*=2,n.attributes.uv.count*=2;var h=new Float32Array(2*c.length);h.set(c),h.set(c,c.length);var l=new Float32Array(2*t.length);l.set(t),l.set(t,t.length);for(var u=new Y.c,d=c.length/3,p=0,f=h.length/3;p<f;p++){u.x=h[3*p+0],u.y=h[3*p+1];var m=u.dot(u),v=1.5+(e.x+e.y*m)*m,m=p<d?0:1;h[3*p+0]=u.x/v*1.5-.5+m,h[3*p+1]=u.y/v*3,l[2*p]=.5*(l[2*p]+m)}n.attributes.position.array=h,n.attributes.uv.array=l;c=new Y.k({map:s.texture}),c=new Y.h(n,c);o.add(c),this.setSize=function(t,e){i.setSize(t,e);var n=i.getPixelRatio();s.setSize(t*n,e*n)},this.render=function(t,e){t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),a.update(e);var n=s.width/2,e=s.height;i.autoClear&&i.clear(),s.scissor.set(0,0,n,e),s.viewport.set(0,0,n,e),i.setRenderTarget(s),i.render(t,a.cameraL),i.clearDepth(),s.scissor.set(n,0,n,e),s.viewport.set(n,0,n,e),i.setRenderTarget(s),i.render(t,a.cameraR),i.clearDepth(),i.setRenderTarget(null),i.render(o,r)}}function x(t){var e=void 0;(t=t||{}).controlBar=void 0===t.controlBar||t.controlBar,t.controlButtons=t.controlButtons||["fullscreen","setting","video"],t.autoHideControlBar=void 0!==t.autoHideControlBar&&t.autoHideControlBar,t.autoHideInfospot=void 0===t.autoHideInfospot||t.autoHideInfospot,t.horizontalView=void 0!==t.horizontalView&&t.horizontalView,t.clickTolerance=t.clickTolerance||10,t.cameraFov=t.cameraFov||60,t.reverseDragging=t.reverseDragging||!1,t.enableReticle=t.enableReticle||!1,t.dwellTime=t.dwellTime||1500,t.autoReticleSelect=void 0===t.autoReticleSelect||t.autoReticleSelect,t.viewIndicator=void 0!==t.viewIndicator&&t.viewIndicator,t.indicatorSize=t.indicatorSize||30,t.output=t.output||"none",t.autoRotate=t.autoRotate||!1,t.autoRotateSpeed=t.autoRotateSpeed||2,t.autoRotateActivationDuration=t.autoRotateActivationDuration||5e3,(this.options=t).container?((e=t.container)._width=e.clientWidth,e._height=e.clientHeight):((e=document.createElement("div")).classList.add("panolens-container"),e.style.width="100%",e.style.height="100%",e._width=window.innerWidth,e._height=window.innerHeight,document.body.appendChild(e)),this.container=e,this.camera=t.camera||new Y.M(this.options.cameraFov,this.container.clientWidth/this.container.clientHeight,1,1e4),this.scene=t.scene||new Y.P,this.renderer=t.renderer||new Y.T({alpha:!0,antialias:!1}),this.sceneReticle=new Y.P,this.viewIndicatorSize=this.options.indicatorSize,this.reticle={},this.tempEnableReticle=this.options.enableReticle,this.mode=L.NORMAL,this.panorama=null,this.widget=null,this.hoverObject=null,this.infospot=null,this.pressEntityObject=null,this.pressObject=null,this.raycaster=new Y.b,this.raycasterPoint=new Y.c,this.userMouse=new Y.c,this.updateCallbacks=[],this.requestAnimationId=null,this.cameraFrustum=new Y.U,this.cameraViewProjectionMatrix=new Y.I,this.autoRotateRequestId=null,this.outputDivElement=null,this.touchSupported="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,this.HANDLER_MOUSE_DOWN=this.onMouseDown.bind(this),this.HANDLER_MOUSE_UP=this.onMouseUp.bind(this),this.HANDLER_MOUSE_MOVE=this.onMouseMove.bind(this),this.HANDLER_WINDOW_RESIZE=this.onWindowResize.bind(this),this.HANDLER_KEY_DOWN=this.onKeyDown.bind(this),this.HANDLER_KEY_UP=this.onKeyUp.bind(this),this.HANDLER_TAP=this.onTap.bind(this,{clientX:this.container.clientWidth/2,clientY:this.container.clientHeight/2}),this.OUTPUT_INFOSPOT=!1,this.tweenLeftAnimation=new O.Tween,this.tweenUpAnimation=new O.Tween,this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(this.container.clientWidth,this.container.clientHeight),this.renderer.setClearColor(0,0),this.renderer.autoClear=!1,this.renderer.domElement.classList.add("panolens-canvas"),this.renderer.domElement.style.display="block",this.container.style.backgroundColor="#000",this.container.appendChild(this.renderer.domElement),this.OrbitControls=new v(this.camera,this.container),this.OrbitControls.id="orbit",this.OrbitControls.minDistance=1,this.OrbitControls.noPan=!0,this.OrbitControls.autoRotate=this.options.autoRotate,this.OrbitControls.autoRotateSpeed=this.options.autoRotateSpeed,this.DeviceOrientationControls=new g(this.camera,this.container),this.DeviceOrientationControls.id="device-orientation",this.DeviceOrientationControls.enabled=!1,this.camera.position.z=1,this.options.passiveRendering&&console.warn("passiveRendering is now deprecated"),this.controls=[this.OrbitControls,this.DeviceOrientationControls],this.control=this.OrbitControls,this.CardboardEffect=new y(this.renderer),this.CardboardEffect.setSize(this.container.clientWidth,this.container.clientHeight),this.StereoEffect=new N(this.renderer),this.StereoEffect.setSize(this.container.clientWidth,this.container.clientHeight),this.effect=this.CardboardEffect,this.addReticle(),this.options.horizontalView&&(this.OrbitControls.minPolarAngle=Math.PI/2,this.OrbitControls.maxPolarAngle=Math.PI/2),!1!==this.options.controlBar&&this.addDefaultControlBar(this.options.controlButtons),this.options.viewIndicator&&this.addViewIndicator(),this.options.reverseDragging&&this.reverseDraggingDirection(),this.options.enableReticle?this.enableReticleControl():this.registerMouseAndTouchEvents(),"overlay"===this.options.output&&this.addOutputElement(),this.registerEventListeners(),this.animate.call(this)}U.d(z,"b",function(){return c}),U.d(z,"d",function(){return s}),U.d(z,"c",function(){return l}),U.d(z,"a",function(){return x});var b=U(52),w=U.n(b),M=U(55),_=U.n(M),b=U(56),E=U.n(b),M=U(54),A=U.n(M),b=U(53),S=U.n(b),Y=U(15),M={three:"^0.105.2"},b=("0.11.0".split(".")[1],M.three.split(".")[1]),T=(M.three.replace(/[^0-9.]/g,""),{ORBIT:0,DEVICEORIENTATION:1}),L={UNKNOWN:0,NORMAL:1,CARDBOARD:2,STEREO:3},R={Info:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAABIAAAASABGyWs+AAAACXZwQWcAAABAAAAAQADq8/hgAAADBklEQVR42u2bP08UQRiHnzFaSYCI/xoksdBIqGwIiYWRUBISExpCQ0ej38FWOmlIKKhoMPEbaCxsrrHiYrQgOSlQEaICrT+LHSPZzNzt3s3c3Hn7lHvLzvv82L2dm30XKioqKgYY062BJF0HpoA7wARwBbhsPz4DjoEG8AnYNcZ8Sx1Op8IXJM1KWpdUV3nq9m9nJV1I7VNGfEzSM0mNNqR9NOwxx1L7NRMflbQm6SSgeJ4TO8Zoat+8/LKkg4jieQ4kLaf2RtKwpJ0uiufZkTScSn5S0l5C+b/sSZrstvyMpKPU5uc4kjTTjkvpeYCkaeA1/+7hvcIZMGuMqUULQNIU8Aa4ltrWwyHwyBizGzwASSPAe+B2assW7AH3jTE/i+xcZoa12Qfy2Bo3i+5cKABl99zF1GYlWFTBeULLS0DZrOsDcDNggTXgc27bLWA64BhfgHvGmB8dHUXZ1DM0S45xliKMs9bKr+klIOkqsBrwv9JtVq1DewEAT4Ch1BYdMGQdygeg7Df4SmqDAKyoyXpCszPgITCeuvoAjFuX0gE8jljUdv7bCtiOOJ7XpdUZ8L/gdXHOA5QtYH5NXXVgbrgWWn1nwFTqaiPgdPIFcDd1tRFwOl307DwRuZgXwLvctgfA04hjOp18AcReZ6sZY16e3yDpUuQxnU6+S2AkcjEpcDr1zxOXSPgCKLSa0mc4nXwB/EpdbQScTr4AGqmrjYDTyRfAx9TVRsDp5Aug8LJyH+F0cgZg58z11BUHpO5ruGh2G3ybuuqAeF2aBfAqddUB8bq0OgP2U1cegH3aOQOMMb+BrdTVB2DLupQLwLIOnKY26IBT6+ClaQDGmO/ARmqLDtiwDn7HVkcY+EdjNoTlCI+tYhO2iUppm6HKslPUq2qQKHpUe8AFsjaUXuUQWCgqXyoAG8IuME/WkNRrnAHzZfqDSgdgQ6gBc2Td3b3CMTBXtkOsIzTIjZLnQhjcVtlcEIPZLJ0LoVvt8s/Va+3yuSAG84UJRxB98cpM9dJURUVFxSDzBxKde4Lk3/h2AAAAAElFTkSuQmCC",Arrow:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAABIAAAASABGyWs+AAAACXZwQWcAAABAAAAAQADq8/hgAAADPklEQVR42u2bMUscQRiG30/SRaJEI1ZKUiRErNIELRUbQYSAnX8hpVUgkDYp0wgWVjYW+QcJaQzYpLojJIXhtDDEKBpj65ti58ixmdmb2ZvZ7+T2AUHudmfmeXf2bnb3O6CmpqZmgJGqOiI5AWAWwEMA0wDuArht3r4CcAagBeAbgIaI/NQOp1fhIZKLJN+SbDKcptl3keSQtk+I+BjJVyRbJaRdtEybY9p+ReKjJN+QvIwonufS9DGq7ZuXXyd5nFA8zzHJdW1vkLxDcrdC8Ty7JO9oyc+QPFCUb3NAcqZq+TmSp9rmHZySnCvjErwOIPkUwHv8+w7vF64ALIrIfrIASM4C+ADgnratgxMACyLSiB4AyREAnwE80LbswgGAJyJy4bNxyApr6wbIw4xxy3djrwCYfeeuaZsFsEbPdULXU4DZqusLgMkEA21P05EEbf8A8FhEzos28pkBLxLKL5s/r/M1kEkz9vKQHGeatf05yfmOfubNa7G5JDle5NhtBjwHMBz5yFwAWBaRT+0XzP8pZsKwcQiH2fX8Ycojb+kzxUw4ZJn7CSQXqpRPHMKCq7+iZJ71Mvdy/DftXSQ6HcJdSDaqPPKW/mPOBO+lcbvzCU35RCFM2PpwnQKzZQfdgfe0dxH5dLA6uQJ4pC2fIASrkyuA6X6QjxyC1ckVQNn7bNHlI4ZgdXIFUObiJJl8pBCsTjGfuIwA2Cv4FN7xbYjkjqsRAHuIePXoCiDF1Zk2VidXAL+1R5sAq5MrgJb2aBNgdXIF8FV7tAmwOrkCCFs73wysTtYATHFCU3vEEWm6Ci6KvgY/ao86Ik6XogDeaY86Ik6XbjPgSHvkEThCwQy45XpDRK5JbgN4GWkgUyR9H65MRQxgW0SunZ5FezK7pfwd8e8MV8UfAPdF5Jdrg8JrAbPjprZFD2wWyQP6j8ZSEufRmGlgQ9umBBvd5IOgbjFUKLu+XnWBhG+rpsFVZGUo/coJgFVf+aAATAgNACvICpL6jSsAKyH1QcEBmBD2ASwhq+7uF84ALIVWiPUEB7lQsiOEwS2VzQUxmMXSuRCqKpd/zX4rl88FMZg/mLAEcSN+MlP/aKqmpqZmkPkL0hSjwOpNKxwAAAAASUVORK5CYII=",FullscreenEnter:"data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjRkZGRkZGIiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICAgIDxwYXRoIGQ9Ik0wIDBoMjR2MjRIMHoiIGZpbGw9Im5vbmUiLz4KICAgIDxwYXRoIGQ9Ik03IDE0SDV2NWg1di0ySDd2LTN6bS0yLTRoMlY3aDNWNUg1djV6bTEyIDdoLTN2Mmg1di01aC0ydjN6TTE0IDV2MmgzdjNoMlY1aC01eiIvPgo8L3N2Zz4=",FullscreenLeave:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggc3R5bGU9ImZpbGw6I2ZmZiIgZD0iTTE0LDE0SDE5VjE2SDE2VjE5SDE0VjE0TTUsMTRIMTBWMTlIOFYxNkg1VjE0TTgsNUgxMFYxMEg1VjhIOFY1TTE5LDhWMTBIMTRWNUgxNlY4SDE5WiIgLz48L3N2Zz4=",VideoPlay:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggc3R5bGU9ImZpbGw6I2ZmZiIgZD0iTTgsNS4xNFYxOS4xNEwxOSwxMi4xNEw4LDUuMTRaIiAvPjwvc3ZnPg==",VideoPause:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggc3R5bGU9ImZpbGw6I2ZmZiIgZD0iTTE0LDE5LjE0SDE4VjUuMTRIMTRNNiwxOS4xNEgxMFY1LjE0SDZWMTkuMTRaIiAvPjwvc3ZnPg==",WhiteTile:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIABAMAAAAGVsnJAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAB1WlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOkNvbXByZXNzaW9uPjE8L3RpZmY6Q29tcHJlc3Npb24+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgICAgIDx0aWZmOlBob3RvbWV0cmljSW50ZXJwcmV0YXRpb24+MjwvdGlmZjpQaG90b21ldHJpY0ludGVycHJldGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KAtiABQAAACRQTFRFAAAAAAAABgYGBwcHHh4eKysrx8fHy8vLzMzM7OzsAAAABgYG+q7SZgAAAAp0Uk5TAP7+/v7+/v7+/iJx/a8AAAOwSURBVHja7d0hbsNAEAVQo6SFI6XEcALDcgNLvUBvEBQVhpkWVYWlhSsVFS7t5QIshRt695lEASZP+8c7a1kzDL1fz+/zyuvzp6FbvoddrL6uDd1yGZ5eXldeb18N3fIx7A+58prmhm65DfvDcd0952lu6JabFbD/zVprZj1lzcys+fj9z8xTZtbT8rv8yWlu6BYAIgAAAAAAAAAAAABAM6QXEAEAAAAAAAAAgJ2gnaAIiIA3Q2qAGgAAAAAAAAAAAAAAAAAAAAAAAAAAQJsADkVFAAAAAAA8Bj0GRUAEREAEREAEREAEREAEAAAAAAAAAAB2gnaCIiACPplRA9QANUAERAAAAEVQERQBERCBVlfAcZ3aeZobusUKMGBhV6KUElHGKBERJR6/fxExRkQZl9/lT8S1oVsuhqyYMmPKjCkzvfcCpsxohrwY0Q06EAEAAAAAAAAAAACgGdILiAAAAAAAAAAAwE7QTlAERMCbITVADQAAAAAAAAAAAAAAAAAAAAAAAAAAwKmwQ1ERAAAAAACPQY9BERABERABERABERABERABAAAAAAAAAICdoJ2gCIiAT2bUADVADRABEQAAQBFUBEVABERgEyvAlJm+V4ApM6bMmDJjyowpM6bMdN0LmDKjGfJiRDfoQAQAAAAAAAAAAACAZkgvIAIAAAAAAAAAADtBO0EREAFvhtQANQAAAAAAAAAAAAAAAAAAAAAAAAAAAKfCDkVFAAAAAAA8Bj0GRUAEREAEREAEREAEREAEAAAAAAAAAAB2gnaCIiACPplRA9QANUAERAAAAEVQERQBERCBTawAU2b6XgGmzJgyY8qMKTOmzJgy03UvYMqMZsiLEd2gAxEAAAAAAAAAAAAAmiG9gAgAAAAAAAAAAOwE7QRFQAS8GVID1AAAAAAAAAAAAAAAAAAAAAAAAAAAAJwKOxQVAQAAAADwGPQYFAEREAEREAEREAEREAERAAAAAAAAAADYCdoJioAI+GRGDVAD1AAREAEAABRBRVAEREAENrECTJnpewWYMmPKjCkzpsyYMmPKTNe9gCkzmiEvRnSDDkQAAAAAAAAAAAAAaIb0AiIAAAAAAAAAALATtBMUARHwZkgNUAMAAAAAAAAAAAAAAAAAAAAAAAAAAHAq7FBUBAAAAADAY9BjUAREQAREQAREQAREQAREAAAAAAAAAABgJ2gnKAIi4JMZNUANUANEQAQAAFAEFUEREAER2MQKMGWm7xVgyowpM50PWen9ugNGXz1XaocAFgAAAABJRU5ErkJggg==",Setting:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAABIAAAASABGyWs+AAAACXZwQWcAAABAAAAAQADq8/hgAAADn0lEQVR42u2bzUsVURjGnyO6CPzAMnTjppAo3LTwH1CqTfaxbeOiRS37A0wXtROFVi1aRBs3LWohSIGbQAQXViBGRhG0UIRKUCpK7q/FnOB2uc6cOXNmRnGe3eW+H8/7zLln3vNxpQoVKlQ4wjBFJAFOSRqX1O7osivpvjHmU1nChBZglvSYLYJbS0EanCvIJzWK+gnsyH34/8OuMaYjb265jwCgz6N4SWq3vodbAEmnS/KtBDgoAgyU5BteAOAkMAPcBroc7PskDWfgN+wyDwBdltMMcDI3tYBnde/pHeARMNTErgd4APzweP834oeN1dMkz5DlsFNn/yyv4kdiSK4At4AO4CqwGaDwRmza2B0210qM7YhrXU59ANAq6bWkwQTTn5KO5fIE0uVYlXTeGLOXFMx1DrjlULwKKN41x6DlnIjEEQCckPRe0okCiguJr5LOGGO+xhm5jICJQ1i8LOeJJKPYEQAMKvrtt5ZdjSf2FM0Fq/sZJI2A6UNcvCz36TiDfUcAcE1SPu/U6Mm8k/TFfu6XdFb5iX3dGPM8lQfwNod3+TowBnQ3yddtv1vPIe+b1JIBiwEJ1IAJ208k5W21trWA+V/5CHAcmAtU/A2P/DcCiTAHHE8tgCVhgLvAXgYCk17Jo/yTGfLuWe7Zd72AC8CWB4n3OAz7mLytNkZabAEXMhfeQKYfWEpJZCxA3rGUOZeA/qDF15FpAz47EvlNk9neI2e3jeWCz0BbmvipNkSMMX8kuSZYM8Z8zyqAjbHmaN5mOeYjgIXrU93MWrxHrNQjrqiDkQMLHwG+OdqF3NN3jeXKzU8AoF1SzdH8XKhJUO7HZDXLMbwAwICkJUULFxe0SbqSVQAbw3Xi7Ze0ZLmGAzAKbHs0JGU1QtvAaIjCW4B7ZOvJy2qFa5a730RPtBiaz0CgnkiZi6F5fBZDVMvho7EhcuS3xJJ2hV9IupgTqaLw0hhzab8vq23xOG/r+LDsKjLgYVzxUnU0ltwK2wDezUyJmEwqXgp/PL4rvxthaeCSI+zxuA10J8ZkWdJNSb2SLkvayKHwDRu71+ZajrG941J8agALDQ3GU/a/IvMkYCPzmCbtLNEVmacNtgs5iP9fYVNEV1Q6Hez7yNZSL+J2SarTcpqiyV2iUkG0IvPFvbz5FbEn+KEk3wMjwMeSfCsBXFBdly9CAPk9ydyffpECuB5tZfVJjaKWueOSfinln6YK4lahQoUKRxd/AcRPGTcQCAUQAAAAAElFTkSuQmCC",ChevronRight:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTguNTksMTYuNThMMTMuMTcsMTJMOC41OSw3LjQxTDEwLDZMMTYsMTJMMTAsMThMOC41OSwxNi41OFoiIC8+PC9zdmc+",Check:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiPjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZD0iTTIxLDdMOSwxOUwzLjUsMTMuNUw0LjkxLDEyLjA5TDksMTYuMTdMMTkuNTksNS41OUwyMSw3WiIgLz48L3N2Zz4=",ViewIndicator:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBpZD0idmlldy1pbmRpY2F0b3IiIGhlaWdodD0iMzAiIHdpZHRoPSIzMCIgdmlld0JveD0iLTIuNSAtMSAzMCAzMCI+Cgk8c3R5bGUgdHlwZT0idGV4dC9jc3MiPi5zdDB7c3Ryb2tlLXdpZHRoOjI7c3Ryb2tlLW1pdGVybGltaXQ6MTA7ZmlsbDpub25lO30uc3Qxe3N0cm9rZS13aWR0aDo2O3N0cm9rZS1taXRlcmxpbWl0OjEwO30KCTwvc3R5bGU+Cgk8Zz4KCQk8cGF0aCBjbGFzcz0ic3QwIiBkPSJNIDEyLjUgMCBBIDEyLjUgMTIuNSAwIDAgMCAtMTIuNSAwIEEgMTIuNSAxMi41IDAgMCAwIDEyLjUgMCIgdHJhbnNmb3JtPSJtYXRyaXgoMSwwLDAsMSwxMywxNS41KSI+PC9wYXRoPgoJCTxwYXRoIGNsYXNzPSJzdDIiIGQ9Ik0gMTMgMCBMIDEwIDIgTCAxNiAyIFoiPjwvcGF0aD4KCQk8cGF0aCBjbGFzcz0ic3QyIiBkPSJNIDIgMCBBIDIgMiAwIDAgMCAtMiAwIEEgMiAyIDAgMCAwIDIgMCIgdHJhbnNmb3JtPSJtYXRyaXgoMSwwLDAsMSwxMywxNS41KSI+PC9wYXRoPgoJCTxwYXRoIGNsYXNzPSJzdDEiIGlkPSJpbmRpY2F0b3IiIHRyYW5zZm9ybT0ibWF0cml4KDEsMCwwLDEsMTMsMTUuNSkiPjwvcGF0aD4KCTwvZz4KPC9zdmc+"},C={load:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:function(){},i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:function(){},n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:function(){};Y.p.enabled=!0;var r,o,a,s,c=void 0,h=void 0,l=void 0,u=void 0;for(s in R)R.hasOwnProperty(s)&&t===R[s]&&(u=s);if(void 0!==(r=Y.p.get(u||t)))return e&&setTimeout(function(){i({loaded:1,total:1}),e(r)},0),r;h=window.URL||window.webkitURL,l=document.createElementNS("http://www.w3.org/1999/xhtml","img"),Y.p.add(u||t,l);function d(){h.revokeObjectURL(l.src),e(l)}if(0===t.indexOf("data:"))return l.addEventListener("load",d,!1),l.src=t,l;l.crossOrigin=void 0!==this.crossOrigin?this.crossOrigin:"",(c=new window.XMLHttpRequest).open("GET",t,!0),c.responseType="arraybuffer",c.addEventListener("error",n),c.addEventListener("progress",function(t){var e,n;t&&(e=t.loaded,n=t.total,t.lengthComputable&&i({loaded:e,total:n}))}),c.addEventListener("loadend",function(t){t&&(t=t.currentTarget.response,o=new Uint8Array(t),a=new window.Blob([o]),l.addEventListener("load",d,!1),l.src=h.createObjectURL(a))}),c.send(null)}},P={load:function(e){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:function(){},t=arguments[2],i=arguments[3],r=new Y.q;return C.load(e,function(t){r.image=t;t=0<e.search(/\.(jpg|jpeg)$/)||0===e.search(/^data\:image\/jpeg/);r.format=t?Y.r:Y.s,r.needsUpdate=!0,n(r)},t,i),r}},I=function(t){var i,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:function(){},r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:function(){},o=arguments[3],a=new Y.t([]),s=0,c={},h={};return t.map(function(t,n){C.load(t,function(t){a.images[n]=t,6==++s&&(a.needsUpdate=!0,e(a))},function(t){for(var e in c[n]={loaded:t.loaded,total:t.total},h.loaded=0,h.total=0,i=0,c)i++,h.loaded+=c[e].loaded,h.total+=c[e].total;i<6&&(h.total=h.total/i*6),r(h)},o)}),a};i.prototype=S()(A()(Y.u.prototype),{setContainer:function(t){this.container=t},setScene:function(t){this.scene=t},enumerateDevices:function(){var e=this.devices,t=new E.a(function(t){t(e)});return 0<e.length?t:window.navigator.mediaDevices.enumerateDevices()},switchNextVideoDevice:function(){var e=this.stop.bind(this),n=this.start.bind(this),i=this.setVideDeviceIndex.bind(this),r=this.videoDeviceIndex;this.getDevices("video").then(function(t){e(),++r>=t.length?(i(0),r--):i(r),n(t[r])})},getDevices:function(){var n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"video",e=this.devices;return this.enumerateDevices().then(function(t){return t.map(function(t){return e.includes(t)||e.push(t),t})}).then(function(t){var e=new RegExp(n,"i");return t.filter(function(t){return e.test(t.kind)})})},getUserMedia:function(t){var e=this.setMediaStream.bind(this),n=this.playVideo.bind(this);return window.navigator.mediaDevices.getUserMedia(t).then(e).then(n).catch(function(t){console.warn("PANOLENS.Media: "+t)})},setVideDeviceIndex:function(t){this.videoDeviceIndex=t},start:function(e){var n=this.constraints,i=this.getUserMedia.bind(this);return this.element=this.createVideoElement(),this.getDevices().then(function(t){if(!t||0===t.length)throw Error("no video device found");t=e||t[0];return n.video.deviceId=t.deviceId,i(n)})},stop:function(){var t=this.stream;t&&t.active&&(t.getTracks()[0].stop(),window.removeEventListener("resize",this.onWindowResize.bind(this)),this.element=null,this.stream=null)},setMediaStream:function(t){this.stream=t,this.element.srcObject=t,this.scene&&(this.scene.background=this.createVideoTexture()),window.addEventListener("resize",this.onWindowResize.bind(this))},playVideo:function(){var t=this.element;t&&(t.play(),this.dispatchEvent({type:"play"}))},pauseVideo:function(){var t=this.element;t&&(t.pause(),this.dispatchEvent({type:"pause"}))},createVideoTexture:function(){var t=this.element,e=new Y.v(t);return e.generateMipmaps=!1,e.minFilter=Y.w,e.magFilter=Y.w,e.format=Y.r,e.center.set(.5,.5),t.addEventListener("canplay",this.onWindowResize.bind(this)),e},createVideoElement:function(){var t=this.dispatchEvent.bind(this),e=document.createElement("video");return e.setAttribute("autoplay",""),e.setAttribute("muted",""),e.setAttribute("playsinline",""),e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.objectPosition="center",e.style.objectFit="cover",e.style.display=this.scene?"none":"",e.addEventListener("canplay",function(){return t({type:"canplay"})}),e},onWindowResize:function(){var t,e,n,i,r;this.element&&this.element.videoWidth&&this.element.videoHeight&&this.scene&&(t=(r=this.container).clientWidth,e=r.clientHeight,n=this.scene.background,r=(i=this.element).videoWidth,r=i.videoHeight/r*(this.container?t/e:1)*this.ratioScalar,e<t?n.repeat.set(r,1):n.repeat.set(1,1/r))}}),t.prototype=S()(A()(Y.y.prototype),{constructor:t,setColor:function(t){this.material.color.copy(t instanceof Y.z?t:new Y.z(t))},createCanvasTexture:function(t){t=new Y.A(t);return t.minFilter=Y.w,t.magFilter=Y.w,t.generateMipmaps=!1,t},createCanvas:function(){var t=document.createElement("canvas"),e=t.getContext("2d"),n=this.dpr;return t.width=32*n,t.height=32*n,e.scale(n,n),e.shadowBlur=5,e.shadowColor="rgba(200,200,200,0.9)",{canvas:t,context:e}},updateCanvasArcByProgress:function(t){var e=this.context,n=this.canvasWidth,i=this.canvasHeight,r=this.material,o=this.dpr,a=t*Math.PI*2,s=this.color.getStyle(),c=.5*n/o,o=.5*i/o;e.clearRect(0,0,n,i),e.beginPath(),0===t?(e.arc(c,o,n/16,0,2*Math.PI),e.fillStyle=s,e.fill()):(e.arc(c,o,n/4-3,-Math.PI/2,-Math.PI/2+a),e.strokeStyle=s,e.lineWidth=3,e.stroke()),e.closePath(),r.map.needsUpdate=!0},ripple:function(){var o=this,a=this.context,s=this.canvasWidth,c=this.canvasHeight,h=this.material,l=this.rippleDuration,u=performance.now(),d=this.color,p=this.dpr,f=.5*s/p,m=.5*c/p;this.dispatchEvent({type:"reticle-ripple-start"}),function t(){var e=window.requestAnimationFrame(t),n=(performance.now()-u)/l,i=0<1-n?1-n:0,r=n*s*.5/p;a.clearRect(0,0,s,c),a.beginPath(),a.arc(f,m,r,0,2*Math.PI),a.fillStyle="rgba("+255*d.r+", "+255*d.g+", "+255*d.b+", "+i+")",a.fill(),a.closePath(),1<=n&&(window.cancelAnimationFrame(e),o.updateCanvasArcByProgress(0),o.dispatchEvent({type:"reticle-ripple-end"})),h.map.needsUpdate=!0}()},show:function(){this.visible=!0},hide:function(){this.visible=!1},start:function(t){this.autoSelect&&(this.dispatchEvent({type:"reticle-start"}),this.startTimestamp=performance.now(),this.callback=t,this.update())},end:function(){this.startTimestamp&&(window.cancelAnimationFrame(this.timerId),this.updateCanvasArcByProgress(0),this.callback=null,this.timerId=null,this.startTimestamp=null,this.dispatchEvent({type:"reticle-end"}))},update:function(){this.timerId=window.requestAnimationFrame(this.update.bind(this));var t=(performance.now()-this.startTimestamp)/this.dwellTime;this.updateCanvasArcByProgress(t),this.dispatchEvent({type:"reticle-update",progress:t}),1<=t&&(window.cancelAnimationFrame(this.timerId),this.callback&&this.callback(),this.end(),this.ripple())}});var O=(function(e){var t=function(){this._tweens={},this._tweensAddedDuringUpdate={}};t.prototype={getAll:function(){return _()(this._tweens).map(function(t){return this._tweens[t]}.bind(this))},removeAll:function(){this._tweens={}},add:function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},remove:function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},update:function(t,e){var n=_()(this._tweens);if(0===n.length)return!1;for(t=void 0!==t?t:s.now();n.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<n.length;i++){var r=this._tweens[n[i]];r&&!1===r.update(t)&&(r._isPlaying=!1,e||delete this._tweens[n[i]])}n=_()(this._tweensAddedDuringUpdate)}return!0}};var s=new t;s.Group=t,s._nextId=0,s.nextId=function(){return s._nextId++},"undefined"==typeof self&&void 0!==n&&n.hrtime?s.now=function(){var t=n.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?s.now=self.performance.now.bind(self.performance):void 0!==Date.now?s.now=Date.now:s.now=function(){return(new Date).getTime()},s.Tween=function(t,e){this._object=t,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._repeat=0,this._repeatDelayTime=void 0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=null,this._easingFunction=s.Easing.Linear.None,this._interpolationFunction=s.Interpolation.Linear,this._chainedTweens=[],this._onStartCallback=null,this._onStartCallbackFired=!1,this._onUpdateCallback=null,this._onRepeatCallback=null,this._onCompleteCallback=null,this._onStopCallback=null,this._group=e||s,this._id=s.nextId()},s.Tween.prototype={getId:function(){return this._id},isPlaying:function(){return this._isPlaying},to:function(t,e){return this._valuesEnd=A()(t),void 0!==e&&(this._duration=e),this},duration:function(t){return this._duration=t,this},start:function(t){this._group.add(this),this._isPlaying=!0,this._onStartCallbackFired=!1,this._startTime=void 0!==t?"string"==typeof t?s.now()+parseFloat(t):t:s.now(),this._startTime+=this._delayTime;for(var e in this._valuesEnd){if(this._valuesEnd[e]instanceof Array){if(0===this._valuesEnd[e].length)continue;this._valuesEnd[e]=[this._object[e]].concat(this._valuesEnd[e])}void 0!==this._object[e]&&(this._valuesStart[e]=this._object[e],this._valuesStart[e]instanceof Array==!1&&(this._valuesStart[e]*=1),this._valuesStartRepeat[e]=this._valuesStart[e]||0)}return this},stop:function(){return this._isPlaying?(this._group.remove(this),this._isPlaying=!1,null!==this._onStopCallback&&this._onStopCallback(this._object),this.stopChainedTweens(),this):this},end:function(){return this.update(1/0),this},stopChainedTweens:function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop()},group:function(t){return this._group=t,this},delay:function(t){return this._delayTime=t,this},repeat:function(t){return this._repeat=t,this},repeatDelay:function(t){return this._repeatDelayTime=t,this},yoyo:function(t){return this._yoyo=t,this},easing:function(t){return this._easingFunction=t,this},interpolation:function(t){return this._interpolationFunction=t,this},chain:function(){return this._chainedTweens=arguments,this},onStart:function(t){return this._onStartCallback=t,this},onUpdate:function(t){return this._onUpdateCallback=t,this},onRepeat:function(t){return this._onRepeatCallback=t,this},onComplete:function(t){return this._onCompleteCallback=t,this},onStop:function(t){return this._onStopCallback=t,this},update:function(t){var e,n,i;if(t<this._startTime)return!0;!1===this._onStartCallbackFired&&(null!==this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),n=(t-this._startTime)/this._duration,n=0===this._duration||n>1?1:n,i=this._easingFunction(n);for(e in this._valuesEnd)if(void 0!==this._valuesStart[e]){var r=this._valuesStart[e]||0,o=this._valuesEnd[e];o instanceof Array?this._object[e]=this._interpolationFunction(o,i):("string"==typeof o&&(o="+"===o.charAt(0)||"-"===o.charAt(0)?r+parseFloat(o):parseFloat(o)),"number"==typeof o&&(this._object[e]=r+(o-r)*i))}if(null!==this._onUpdateCallback&&this._onUpdateCallback(this._object,n),1===n){if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(e in this._valuesStartRepeat){if("string"==typeof this._valuesEnd[e]&&(this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(this._valuesEnd[e])),this._yoyo){var a=this._valuesStartRepeat[e];this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=a}this._valuesStart[e]=this._valuesStartRepeat[e]}return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,null!==this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}null!==this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var s=0,c=this._chainedTweens.length;s<c;s++)this._chainedTweens[s].start(this._startTime+this._duration);return!1}return!0}},s.Easing={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2,t<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1)}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-s.Easing.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*s.Easing.Bounce.In(2*t):.5*s.Easing.Bounce.Out(2*t-1)+.5}}},s.Interpolation={Linear:function(t,e){var n=t.length-1,i=n*e,r=Math.floor(i),o=s.Interpolation.Utils.Linear;return e<0?o(t[0],t[1],i):e>1?o(t[n],t[n-1],n-i):o(t[r],t[r+1>n?n:r+1],i-r)},Bezier:function(t,e){for(var n=0,i=t.length-1,r=Math.pow,o=s.Interpolation.Utils.Bernstein,a=0;a<=i;a++)n+=r(1-e,i-a)*r(e,a)*t[a]*o(i,a);return n},CatmullRom:function(t,e){var n=t.length-1,i=n*e,r=Math.floor(i),o=s.Interpolation.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(r=Math.floor(i=n*(1+e))),o(t[(r-1+n)%n],t[r],t[(r+1)%n],t[(r+2)%n],i-r)):e<0?t[0]-(o(t[0],t[0],t[1],t[1],-i)-t[0]):e>1?t[n]-(o(t[n],t[n],t[n-1],t[n-1],i-n)-t[n]):o(t[r?r-1:0],t[r],t[n<r+1?n:r+1],t[n<r+2?n:r+2],i-r)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Bernstein:function(t,e){var n=s.Interpolation.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:function(){var i=[1];return function(t){var e=1;if(i[t])return i[t];for(var n=t;n>1;n--)e*=n;return i[t]=e,e}}(),CatmullRom:function(t,e,n,i,r){var o=.5*(n-t),a=.5*(i-e),s=r*r;return(2*e-2*n+o+a)*(r*s)+(-3*e+3*n-2*o-a)*s+o*r+e}}},function(t){e.exports=s}()}(M={exports:{}}),M.exports);a.prototype=S()(A()(Y.y.prototype),{constructor:a,setContainer:function(t){var e=void 0;t instanceof HTMLElement?e=t:t&&t.container&&(e=t.container),e&&this.element&&e.appendChild(this.element),this.container=e},getContainer:function(){return this.container},onClick:function(t){this.element&&this.getContainer()&&(this.onHoverStart(t),this.lockHoverElement())},onDismiss:function(){this.element&&(this.unlockHoverElement(),this.onHoverEnd())},onHover:function(){},onHoverStart:function(t){var e,n,i,r;this.getContainer()&&(e=this.cursorStyle||(this.mode===L.NORMAL?"pointer":"default"),i=this.scaleDownAnimation,r=this.scaleUpAnimation,n=this.element,this.isHovering=!0,this.container.style.cursor=e,this.animated&&(i.stop(),r.start()),n&&0<=t.mouseEvent.clientX&&0<=t.mouseEvent.clientY&&(i=n.left,r=n.right,t=n.style,this.mode===L.CARDBOARD||this.mode===L.STEREO?(t.display="none",i.style.display="block",r.style.display="block",n._width=i.clientWidth,n._height=i.clientHeight):(t.display="block",i&&(i.style.display="none"),r&&(r.style.display="none"),n._width=n.clientWidth,n._height=n.clientHeight)))},onHoverEnd:function(){var t,e,n;this.getContainer()&&(n=this.scaleDownAnimation,e=this.scaleUpAnimation,t=this.element,this.isHovering=!1,this.container.style.cursor="default",this.animated&&(e.stop(),n.start()),t&&!this.element.locked&&(e=t.left,n=t.right,t.style.display="none",e&&(e.style.display="none"),n&&(n.style.display="none"),this.unlockHoverElement()))},onDualEyeEffect:function(t){var e,n,i;this.getContainer()&&(i=n=e=void 0,this.mode=t.mode,e=this.element,n=this.container.clientWidth/2,i=this.container.clientHeight/2,e&&(e.left||e.right||(e.left=e.cloneNode(!0),e.right=e.cloneNode(!0)),this.mode===L.CARDBOARD||this.mode===L.STEREO?(e.left.style.display=e.style.display,e.right.style.display=e.style.display,e.style.display="none"):(e.style.display=e.left.style.display,e.left.style.display="none",e.right.style.display="none"),this.translateElement(n,i),this.container.appendChild(e.left),this.container.appendChild(e.right)))},translateElement:function(t,e){var n,i,r,o,a,s,c;this.element._width&&this.element._height&&this.getContainer()&&(n=a=o=r=i=c=s=void 0,n=this.container,s=t-(r=(i=this.element)._width/2),c=e-(o=i._height/2)-(a=void 0!==i.verticalDelta?i.verticalDelta:40),this.mode!==L.CARDBOARD&&this.mode!==L.STEREO||!i.left||!i.right||t===n.clientWidth/2&&e===n.clientHeight/2?this.setElementStyle("transform",i,"translate("+s+"px, "+c+"px)"):(s=n.clientWidth/4-r+(t-n.clientWidth/2),c=n.clientHeight/2-o-a+(e-n.clientHeight/2),this.setElementStyle("transform",i.left,"translate("+s+"px, "+c+"px)"),s+=n.clientWidth/2,this.setElementStyle("transform",i.right,"translate("+s+"px, "+c+"px)")))},setElementStyle:function(t,e,n){e=e.style;"transform"===t&&(e.webkitTransform=e.msTransform=e.transform=n)},setText:function(t){this.element&&(this.element.textContent=t)},setCursorHoverStyle:function(t){this.cursorStyle=t},addHoverText:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:40;this.element||(this.element=document.createElement("div"),this.element.style.display="none",this.element.style.color="#fff",this.element.style.top=0,this.element.style.maxWidth="50%",this.element.style.maxHeight="50%",this.element.style.textShadow="0 0 3px #000000",this.element.style.fontFamily='"Trebuchet MS", Helvetica, sans-serif',this.element.style.position="absolute",this.element.classList.add("panolens-infospot"),this.element.verticalDelta=e),this.setText(t)},addHoverElement:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:40;this.element||(this.element=t.cloneNode(!0),this.element.style.display="none",this.element.style.top=0,this.element.style.position="absolute",this.element.classList.add("panolens-infospot"),this.element.verticalDelta=e)},removeHoverElement:function(){this.element&&(this.element.left&&(this.container.removeChild(this.element.left),this.element.left=null),this.element.right&&(this.container.removeChild(this.element.right),this.element.right=null),this.container.removeChild(this.element),this.element=null)},lockHoverElement:function(){this.element&&(this.element.locked=!0)},unlockHoverElement:function(){this.element&&(this.element.locked=!1)},enableRaycast:function(){var t=!(0<arguments.length&&void 0!==arguments[0])||arguments[0];this.raycast=t?this.originalRaycast:function(){}},show:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,e=this.animated,n=this.hideAnimation,i=this.showAnimation,r=this.material;e?(n.stop(),i.delay(t).start()):(this.enableRaycast(!0),r.opacity=1)},hide:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,e=this.animated,n=this.hideAnimation,i=this.showAnimation,r=this.material;e?(i.stop(),n.delay(t).start()):(this.enableRaycast(!1),r.opacity=0)},setFocusMethod:function(t){t&&(this.HANDLER_FOCUS=t.method)},focus:function(t,e){this.HANDLER_FOCUS&&(this.HANDLER_FOCUS(this.position,t,e),this.onDismiss())},dispose:function(){var t=this.geometry,e=this.material,n=e.map;this.removeHoverElement(),this.parent&&this.parent.remove(this),n&&(n.dispose(),e.map=null),t&&(t.dispose(),this.geometry=null),e&&(e.dispose(),this.material=null)}}),r.prototype=S()(A()(Y.u.prototype),{constructor:r,addControlBar:function(){var t,e,n,i,r;this.container?(n=this,r="linear-gradient(bottom, rgba(0,0,0,0.2), rgba(0,0,0,0))",(i=document.createElement("div")).style.width="100%",i.style.height="44px",i.style.float="left",i.style.transform=i.style.webkitTransform=i.style.msTransform="translateY(-100%)",i.style.background="-webkit-"+r,i.style.background="-moz-"+r,i.style.background="-o-"+r,i.style.background="-ms-"+r,i.style.background=r,i.style.transition=this.DEFAULT_TRANSITION,i.style.pointerEvents="none",i.isHidden=!1,i.toggle=function(){i.isHidden=!i.isHidden,t=i.isHidden?"translateY(0)":"translateY(-100%)",e=i.isHidden?0:1,i.style.transform=i.style.webkitTransform=i.style.msTransform=t,i.style.opacity=e},r=this.createDefaultMenu(),this.mainMenu=this.createMainMenu(r),i.appendChild(this.mainMenu),r=this.createMask(),this.mask=r,this.container.appendChild(r),i.dispose=function(){n.fullscreenElement&&(i.removeChild(n.fullscreenElement),n.fullscreenElement.dispose(),n.fullscreenElement=null),n.settingElement&&(i.removeChild(n.settingElement),n.settingElement.dispose(),n.settingElement=null),n.videoElement&&(i.removeChild(n.videoElement),n.videoElement.dispose(),n.videoElement=null)},this.container.appendChild(i),this.mask.addEventListener("mousemove",this.PREVENT_EVENT_HANDLER,!0),this.mask.addEventListener("mouseup",this.PREVENT_EVENT_HANDLER,!0),this.mask.addEventListener("mousedown",this.PREVENT_EVENT_HANDLER,!0),this.mask.addEventListener(n.TOUCH_ENABLED?"touchend":"click",function(t){t.preventDefault(),t.stopPropagation(),n.mask.hide(),n.settingElement.deactivate()},!1),this.addEventListener("control-bar-toggle",i.toggle),this.barElement=i):console.warn("Widget container not set")},createDefaultMenu:function(){var n=this,t=function(t,e){return function(){n.dispatchEvent({type:"panolens-viewer-handler",method:t,data:e})}};return[{title:"Control",subMenu:[{title:this.TOUCH_ENABLED?"Touch":"Mouse",handler:t("enableControl",T.ORBIT)},{title:"Sensor",handler:t("enableControl",T.DEVICEORIENTATION)}]},{title:"Mode",subMenu:[{title:"Normal",handler:t("disableEffect")},{title:"Cardboard",handler:t("enableEffect",L.CARDBOARD)},{title:"Stereoscopic",handler:t("enableEffect",L.STEREO)}]}]},addControlButton:function(t){var e=void 0;switch(t){case"fullscreen":e=this.createFullscreenButton(),this.fullscreenElement=e;break;case"setting":e=this.createSettingButton(),this.settingElement=e;break;case"video":e=this.createVideoControl(),this.videoElement=e;break;default:return}e&&this.barElement.appendChild(e)},createMask:function(){var t=document.createElement("div");return t.style.position="absolute",t.style.top=0,t.style.left=0,t.style.width="100%",t.style.height="100%",t.style.background="transparent",t.style.display="none",t.show=function(){this.style.display="block"},t.hide=function(){this.style.display="none"},t},createSettingButton:function(){var e=this,t=void 0;return(t=this.createCustomItem({style:{backgroundImage:'url("'+R.Setting+'")',webkitTransition:this.DEFAULT_TRANSITION,transition:this.DEFAULT_TRANSITION},onTap:function(t){t.preventDefault(),t.stopPropagation(),e.mainMenu.toggle(),this.activated?this.deactivate():this.activate()}})).activate=function(){this.style.transform="rotate3d(0,0,1,90deg)",this.activated=!0,e.mask.show()},t.deactivate=function(){this.style.transform="rotate3d(0,0,0,0)",this.activated=!1,e.mask.hide(),e.mainMenu&&e.mainMenu.visible&&e.mainMenu.hide(),e.activeSubMenu&&e.activeSubMenu.visible&&e.activeSubMenu.hide(),e.mainMenu&&e.mainMenu._width&&(e.mainMenu.changeSize(e.mainMenu._width),e.mainMenu.unslideAll())},t.activated=!1,t},createFullscreenButton:function(){function t(){o&&(r=!r,i.style.backgroundImage=r?'url("'+R.FullscreenLeave+'")':'url("'+R.FullscreenEnter+'")'),n.dispatchEvent({type:"panolens-viewer-handler",method:"onWindowResize"}),o=!0}var e,n=this,i=void 0,r=!1,o=!0,a=this.container,s="panolens-style-addon";if(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)return document.addEventListener("fullscreenchange",t,!1),document.addEventListener("webkitfullscreenchange",t,!1),document.addEventListener("mozfullscreenchange",t,!1),document.addEventListener("MSFullscreenChange",t,!1),i=this.createCustomItem({style:{backgroundImage:'url("'+R.FullscreenEnter+'")'},onTap:function(t){t.preventDefault(),t.stopPropagation(),o=!1,r=r?(document.exitFullscreen&&document.exitFullscreen(),document.msExitFullscreen&&document.msExitFullscreen(),document.mozCancelFullScreen&&document.mozCancelFullScreen(),document.webkitExitFullscreen&&document.webkitExitFullscreen(),!1):(a.requestFullscreen&&a.requestFullscreen(),a.msRequestFullscreen&&a.msRequestFullscreen(),a.mozRequestFullScreen&&a.mozRequestFullScreen(),a.webkitRequestFullscreen&&a.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT),!0),this.style.backgroundImage=r?'url("'+R.FullscreenLeave+'")':'url("'+R.FullscreenEnter+'")'}}),document.querySelector(s)||((e=document.createElement("style")).id=s,e.innerHTML=":-webkit-full-screen { width: 100% !important; height: 100% !important }",document.body.appendChild(e)),i},createVideoControl:function(){var t=document.createElement("span");return t.style.display="none",t.show=function(){t.style.display=""},t.hide=function(){t.style.display="none",t.controlButton.paused=!0,t.controlButton.update()},t.controlButton=this.createVideoControlButton(),t.seekBar=this.createVideoControlSeekbar(),t.appendChild(t.controlButton),t.appendChild(t.seekBar),t.dispose=function(){t.removeChild(t.controlButton),t.removeChild(t.seekBar),t.controlButton.dispose(),t.controlButton=null,t.seekBar.dispose(),t.seekBar=null},this.addEventListener("video-control-show",t.show),this.addEventListener("video-control-hide",t.hide),t},createVideoControlButton:function(){var e=this,n=this.createCustomItem({style:{float:"left",backgroundImage:'url("'+R.VideoPlay+'")'},onTap:function(t){t.preventDefault(),t.stopPropagation(),e.dispatchEvent({type:"panolens-viewer-handler",method:"toggleVideoPlay",data:!this.paused}),this.paused=!this.paused,n.update()}});return n.paused=!0,n.update=function(t){this.paused=void 0!==t?t:this.paused,this.style.backgroundImage='url("'+(this.paused?R.VideoPlay:R.VideoPause)+'")'},n},createVideoControlSeekbar:function(){function t(t){t.stopPropagation(),c=!0,h=t.clientX||t.changedTouches&&t.changedTouches[0].clientX,l=parseInt(a.style.width)/100,r.container.addEventListener("mousemove",e,{passive:!0}),r.container.addEventListener("mouseup",n,{passive:!0}),r.container.addEventListener("touchmove",e,{passive:!0}),r.container.addEventListener("touchend",n,{passive:!0})}function e(t){c&&(t=t.clientX||t.changedTouches&&t.changedTouches[0].clientX,u=(t-h)/o.clientWidth,u=1<(u=l+u)?1:u<0?0:u,o.setProgress(u),r.dispatchEvent({type:"panolens-viewer-handler",method:"setVideoCurrentTime",data:u}))}function n(t){t.stopPropagation(),c=!1,i()}function i(){r.container.removeEventListener("mousemove",e,!1),r.container.removeEventListener("mouseup",n,!1),r.container.removeEventListener("touchmove",e,!1),r.container.removeEventListener("touchend",n,!1)}var r=this,o=void 0,a=void 0,s=void 0,c=!1,h=void 0,l=void 0,u=void 0;return(a=document.createElement("div")).style.width="0%",a.style.height="100%",a.style.backgroundColor="#fff",(s=document.createElement("div")).style.float="right",s.style.width="14px",s.style.height="14px",s.style.transform="translate(7px, -5px)",s.style.borderRadius="50%",s.style.backgroundColor="#ddd",s.addEventListener("mousedown",t,{passive:!0}),s.addEventListener("touchstart",t,{passive:!0}),a.appendChild(s),(o=this.createCustomItem({style:{float:"left",width:"30%",height:"4px",marginTop:"20px",backgroundColor:"rgba(188,188,188,0.8)"},onTap:function(t){var e;t.preventDefault(),t.stopPropagation(),t.target!==s&&(e=t.changedTouches&&0<t.changedTouches.length?(t.changedTouches[0].pageX-t.target.getBoundingClientRect().left)/this.clientWidth:t.offsetX/this.clientWidth,r.dispatchEvent({type:"panolens-viewer-handler",method:"setVideoCurrentTime",data:e}),o.setProgress(t.offsetX/this.clientWidth))},onDispose:function(){i(),s=a=null}})).appendChild(a),o.setProgress=function(t){a.style.width=100*t+"%"},this.addEventListener("video-update",function(t){o.setProgress(t.percentage)}),o.progressElement=a,o.progressElementControl=s,o},createMenuItem:function(t){var n=this,e=document.createElement("a");return e.textContent=t,e.style.display="block",e.style.padding="10px",e.style.textDecoration="none",e.style.cursor="pointer",e.style.pointerEvents="auto",e.style.transition=this.DEFAULT_TRANSITION,e.slide=function(t){this.style.transform="translateX("+(t?"":"-")+"100%)"},e.unslide=function(){this.style.transform="translateX(0)"},e.setIcon=function(t){this.icon&&(this.icon.style.backgroundImage="url("+t+")")},e.setSelectionTitle=function(t){this.selection&&(this.selection.textContent=t)},e.addSelection=function(t){var e=document.createElement("span");return e.style.fontSize="13px",e.style.fontWeight="300",e.style.float="right",this.selection=e,this.setSelectionTitle(t),this.appendChild(e),this},e.addIcon=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:R.ChevronRight,e=1<arguments.length&&void 0!==arguments[1]&&arguments[1],n=2<arguments.length&&void 0!==arguments[2]&&arguments[2],i=document.createElement("span");return i.style.float=e?"left":"right",i.style.width="17px",i.style.height="17px",i.style["margin"+(e?"Right":"Left")]="12px",i.style.backgroundSize="cover",n&&(i.style.transform="rotateZ(180deg)"),this.icon=i,this.setIcon(t),this.appendChild(i),this},e.addSubMenu=function(t,e){return this.subMenu=n.createSubMenu(t,e),this},e.addEventListener("mouseenter",function(){this.style.backgroundColor="#e0e0e0"},!1),e.addEventListener("mouseleave",function(){this.style.backgroundColor="#fafafa"},!1),e},createMenuItemHeader:function(t){t=this.createMenuItem(t);return t.style.borderBottom="1px solid #333",t.style.paddingBottom="15px",t},createMainMenu:function(t){function e(t){t.preventDefault(),t.stopPropagation();var e=i.mainMenu,n=this.subMenu;e.hide(),e.slideAll(),e.parentElement.appendChild(n),i.activeMainItem=this,i.activeSubMenu=n,window.requestAnimationFrame(function(){e.changeSize(n.clientWidth),n.show(),n.unslideAll()})}var i=this,n=this.createMenu();n._width=200,n.changeSize(n._width);for(var r=0;r<t.length;r++){var o,a=n.addItem(t[r].title);a.style.paddingLeft="20px",a.addIcon().addEventListener(i.TOUCH_ENABLED?"touchend":"click",e,!1),t[r].subMenu&&0<t[r].subMenu.length&&(o=t[r].subMenu[0].title,a.addSelection(o).addSubMenu(t[r].title,t[r].subMenu))}return n},createSubMenu:function(t,e){function n(t){t.preventDefault(),t.stopPropagation(),(r=i.mainMenu).changeSize(r._width),r.unslideAll(),r.show(),o.slideAll(!0),o.hide(),"header"!==this.type&&(o.setActiveItem(this),i.activeMainItem.setSelectionTitle(this.textContent),this.handler&&this.handler())}var i=this,r=void 0,o=this.createMenu();o.items=e,o.activeItem=null,o.addHeader(t).addIcon(void 0,!0,!0).addEventListener(i.TOUCH_ENABLED?"touchend":"click",n,!1);for(var a=0;a<e.length;a++){var s=o.addItem(e[a].title);s.style.fontWeight=300,s.handler=e[a].handler,s.addIcon(" ",!0),s.addEventListener(i.TOUCH_ENABLED?"touchend":"click",n,!1),o.activeItem||o.setActiveItem(s)}return o.slideAll(!0),o},createMenu:function(){var e=this,n=document.createElement("span"),t=n.style;return t.padding="5px 0",t.position="fixed",t.bottom="100%",t.right="14px",t.backgroundColor="#fafafa",t.fontFamily="Helvetica Neue",t.fontSize="14px",t.visibility="hidden",t.opacity=0,t.boxShadow="0 0 12pt rgba(0,0,0,0.25)",t.borderRadius="2px",t.overflow="hidden",t.willChange="width, height, opacity",t.pointerEvents="auto",t.transition=this.DEFAULT_TRANSITION,n.visible=!1,n.changeSize=function(t,e){t&&(this.style.width=t+"px"),e&&(this.style.height=e+"px")},n.show=function(){this.style.opacity=1,this.style.visibility="visible",this.visible=!0},n.hide=function(){this.style.opacity=0,this.style.visibility="hidden",this.visible=!1},n.toggle=function(){this.visible?this.hide():this.show()},n.slideAll=function(t){for(var e=0;e<n.children.length;e++)n.children[e].slide&&n.children[e].slide(t)},n.unslideAll=function(){for(var t=0;t<n.children.length;t++)n.children[t].unslide&&n.children[t].unslide()},n.addHeader=function(t){t=e.createMenuItemHeader(t);return t.type="header",this.appendChild(t),t},n.addItem=function(t){t=e.createMenuItem(t);return t.type="item",this.appendChild(t),t},n.setActiveItem=function(t){this.activeItem&&this.activeItem.setIcon(" "),t.setIcon(R.Check),this.activeItem=t},n.addEventListener("mousemove",this.PREVENT_EVENT_HANDLER,!0),n.addEventListener("mouseup",this.PREVENT_EVENT_HANDLER,!0),n.addEventListener("mousedown",this.PREVENT_EVENT_HANDLER,!0),n},createCustomItem:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=this,n=t.element||document.createElement("span"),i=t.onDispose;return n.style.cursor="pointer",n.style.float="right",n.style.width="44px",n.style.height="100%",n.style.backgroundSize="60%",n.style.backgroundRepeat="no-repeat",n.style.backgroundPosition="center",n.style.webkitUserSelect=n.style.MozUserSelect=n.style.userSelect="none",n.style.position="relative",n.style.pointerEvents="auto",n.addEventListener(e.TOUCH_ENABLED?"touchstart":"mouseenter",function(){n.style.filter=n.style.webkitFilter="drop-shadow(0 0 5px rgba(255,255,255,1))"},{passive:!0}),n.addEventListener(e.TOUCH_ENABLED?"touchend":"mouseleave",function(){n.style.filter=n.style.webkitFilter=""},{passive:!0}),this.mergeStyleOptions(n,t.style),t.onTap&&n.addEventListener(e.TOUCH_ENABLED?"touchend":"click",t.onTap,!1),n.dispose=function(){n.removeEventListener(e.TOUCH_ENABLED?"touchend":"click",t.onTap,!1),i&&t.onDispose()},n},mergeStyleOptions:function(t){var e,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};for(e in n)n.hasOwnProperty(e)&&(t.style[e]=n[e]);return t},dispose:function(){this.barElement&&(this.container.removeChild(this.barElement),this.barElement.dispose(),this.barElement=null)}}),o.prototype=S()(A()(Y.h.prototype),{constructor:o,add:function(t){var e,n=void 0;if(1<arguments.length){for(var i=0;i<arguments.length;i++)this.add(arguments[i]);return this}t instanceof a?(n=t).dispatchEvent&&((e=this.container)&&t.dispatchEvent({type:"panolens-container",container:e}),t.dispatchEvent({type:"panolens-infospot-focus",method:function(t,e,n){this.dispatchEvent({type:"panolens-viewer-handler",method:"tweenControlCenter",data:[t,e,n]})}.bind(this)})):((n=new Y.a).scale.x=-1,n.scalePlaceHolder=!0,n.add(t)),Y.a.prototype.add.call(this,n)},load:function(){this.onLoad()},onClick:function(t){t.intersects&&0===t.intersects.length&&this.traverse(function(t){t.dispatchEvent({type:"dismiss"})})},setContainer:function(t){var e=void 0;t instanceof HTMLElement?e=t:t&&t.container&&(e=t.container),e&&(this.children.forEach(function(t){t instanceof a&&t.dispatchEvent&&t.dispatchEvent({type:"panolens-container",container:e})}),this.container=e)},onLoad:function(){this.loaded=!0,this.dispatchEvent({type:"load"})},onProgress:function(t){this.dispatchEvent({type:"progress",progress:t})},onError:function(){this.dispatchEvent({type:"error"})},getZoomLevel:function(){return window.innerWidth<=800?this.ImageQualityFair:800<window.innerWidth&&window.innerWidth<=1280?this.ImageQualityMedium:1280<window.innerWidth&&window.innerWidth<=1920?this.ImageQualityHigh:1920<window.innerWidth?this.ImageQualitySuperHigh:this.ImageQualityLow},updateTexture:function(t){this.material.map=t,this.material.needsUpdate=!0},toggleInfospotVisibility:function(t,e){e=void 0!==e?e:0;var n=void 0!==t?t:!this.isInfospotVisible;this.traverse(function(t){t instanceof a&&(n?t.show(e):t.hide(e))}),this.isInfospotVisible=n,this.infospotAnimation.onComplete(function(){this.dispatchEvent({type:"infospot-animation-complete",visible:n})}.bind(this)).delay(e).start()},setLinkingImage:function(t,e){this.linkingImageURL=t,this.linkingImageScale=e},link:function(t,e,n,i){this.visible=!0,e?((i=new a(void 0!==n?n:void 0!==t.linkingImageScale?t.linkingImageScale:300,i||t.linkingImageURL||R.Arrow)).position.copy(e),i.toPanorama=t,i.addEventListener("click",function(){this.dispatchEvent({type:"panolens-viewer-handler",method:"setPanorama",data:t})}.bind(this)),this.linkedSpots.push(i),this.add(i),this.visible=!1):console.warn("Please specify infospot position for linking")},reset:function(){this.children.length=0},setupTransitions:function(){this.fadeInAnimation=new O.Tween(this.material).easing(O.Easing.Quartic.Out).onStart(function(){this.visible=!0,this.dispatchEvent({type:"enter-fade-start"})}.bind(this)),this.fadeOutAnimation=new O.Tween(this.material).easing(O.Easing.Quartic.Out).onComplete(function(){this.visible=!1,this.dispatchEvent({type:"leave-complete"})}.bind(this)),this.enterTransition=new O.Tween(this).easing(O.Easing.Quartic.Out).onComplete(function(){this.dispatchEvent({type:"enter-complete"})}.bind(this)).start(),this.leaveTransition=new O.Tween(this).easing(O.Easing.Quartic.Out)},onFadeAnimationUpdate:function(){var t=this.material.opacity,e=this.material.uniforms;e&&e.opacity&&(e.opacity.value=t)},fadeIn:function(t){t=0<=t?t:this.animationDuration,this.fadeOutAnimation.stop(),this.fadeInAnimation.to({opacity:1},t).onUpdate(this.onFadeAnimationUpdate.bind(this)).onComplete(function(){this.toggleInfospotVisibility(!0,t/2),this.dispatchEvent({type:"enter-fade-complete"})}.bind(this)).start()},fadeOut:function(t){t=0<=t?t:this.animationDuration,this.fadeInAnimation.stop(),this.fadeOutAnimation.to({opacity:0},t).onUpdate(this.onFadeAnimationUpdate.bind(this)).start()},onEnter:function(){var t=this.animationDuration;this.leaveTransition.stop(),this.enterTransition.to({},t).onStart(function(){this.dispatchEvent({type:"enter-start"}),this.loaded?this.fadeIn(t):this.load()}.bind(this)).start(),this.dispatchEvent({type:"enter"}),this.children.forEach(function(t){t.dispatchEvent({type:"panorama-enter"})}),this.active=!0},onLeave:function(){var t=this.animationDuration;this.enterTransition.stop(),this.leaveTransition.to({},t).onStart(function(){this.dispatchEvent({type:"leave-start"}),this.fadeOut(t),this.toggleInfospotVisibility(!1)}.bind(this)).start(),this.dispatchEvent({type:"leave"}),this.children.forEach(function(t){t.dispatchEvent({type:"panorama-leave"})}),this.active=!1},dispose:function(){this.infospotAnimation.stop(),this.fadeInAnimation.stop(),this.fadeOutAnimation.stop(),this.enterTransition.stop(),this.leaveTransition.stop(),this.dispatchEvent({type:"panolens-viewer-handler",method:"onPanoramaDispose",data:this}),function t(e){for(var n=e.geometry,i=e.material,r=e.children.length-1;0<=r;r--)t(e.children[r]),e.remove(e.children[r]);e instanceof a&&e.dispose(),n&&(n.dispose(),e.geometry=null),i&&(i.dispose(),e.material=null)}(this),this.parent&&this.parent.remove(this)}}),s.prototype=S()(A()(o.prototype),{constructor:s,load:function(t){(t=t||this.src)?"string"==typeof t?P.load(t,this.onLoad.bind(this),this.onProgress.bind(this),this.onError.bind(this)):t instanceof HTMLImageElement&&this.onLoad(new Y.q(t)):console.warn("Image source undefined")},onLoad:function(t){t.minFilter=t.magFilter=Y.w,t.needsUpdate=!0,this.updateTexture(t),window.requestAnimationFrame(o.prototype.onLoad.bind(this))},reset:function(){o.prototype.reset.call(this)},dispose:function(){var t=this.material.map;Y.p.remove(this.src),t&&t.dispose(),o.prototype.dispose.call(this)}}),e.prototype=S()(A()(o.prototype),{constructor:e}),c.prototype=S()(A()(o.prototype),{constructor:c,load:function(){I(this.images,this.onLoad.bind(this),this.onProgress.bind(this),this.onError.bind(this))},onLoad:function(t){this.material.uniforms.tCube.value=t,o.prototype.onLoad.call(this)},dispose:function(){var t=this.material.uniforms.tCube.value;this.images.forEach(function(t){Y.p.remove(t)}),t instanceof Y.t&&t.dispose(),o.prototype.dispose.call(this)}}),h.prototype=S()(A()(c.prototype),{constructor:h}),l.prototype=S()(A()(o.prototype),{constructor:l,isMobile:function(){var t,e=!1;return t=window.navigator.userAgent||window.navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(e=!0),e},load:function(){var t=this.options,e=t.muted,n=t.loop,i=t.autoplay,r=t.playsinline,t=t.crossOrigin,o=this.videoElement,a=this.material,s=this.onProgress.bind(this),c=this.onLoad.bind(this);o.loop=n,o.autoplay=i,o.playsinline=r,o.crossOrigin=t,o.muted=e,r&&(o.setAttribute("playsinline",""),o.setAttribute("webkit-playsinline",""));t=function(){this.setVideoTexture(o),i&&this.dispatchEvent({type:"panolens-viewer-handler",method:"updateVideoPlayButton",data:!1}),this.isMobile()&&(o.pause(),i&&e?this.dispatchEvent({type:"panolens-viewer-handler",method:"updateVideoPlayButton",data:!1}):this.dispatchEvent({type:"panolens-viewer-handler",method:"updateVideoPlayButton",data:!0}));window.requestAnimationFrame(function(){a.map.needsUpdate=!0,s({loaded:1,total:1}),c()})};2<o.readyState?t.call(this):(0===o.querySelectorAll("source").length&&((r=document.createElement("source")).src=this.src,o.appendChild(r)),o.load()),o.addEventListener("loadeddata",t.bind(this)),o.addEventListener("timeupdate",function(){this.videoProgress=0<=o.duration?o.currentTime/o.duration:0,this.dispatchEvent({type:"panolens-viewer-handler",method:"onVideoUpdate",data:this.videoProgress})}.bind(this)),o.addEventListener("ended",function(){n||(this.resetVideo(),this.dispatchEvent({type:"panolens-viewer-handler",method:"updateVideoPlayButton",data:!0}))}.bind(this),!1)},setVideoTexture:function(t){t&&((t=new Y.v(t)).minFilter=Y.w,t.magFilter=Y.w,t.format=Y.r,this.updateTexture(t))},reset:function(){this.videoElement=void 0,o.prototype.reset.call(this)},isVideoPaused:function(){return this.videoElement.paused},toggleVideo:function(){var t=this.videoElement;t&&t[t.paused?"play":"pause"]()},setVideoCurrentTime:function(t){var e=t.percentage,t=this.videoElement;t&&!w()(e)&&1!==e&&(t.currentTime=t.duration*e,this.dispatchEvent({type:"panolens-viewer-handler",method:"onVideoUpdate",data:e}))},playVideo:function(){var t=this.videoElement,e=this.playVideo.bind(this),n=this.dispatchEvent.bind(this);t&&t.paused&&t.play().then(function(){n({type:"play"})}).catch(function(t){window.requestAnimationFrame(e),n({type:"play-error",error:t})})},pauseVideo:function(){var t=this.videoElement;t&&!t.paused&&t.pause(),this.dispatchEvent({type:"pause"})},resumeVideoProgress:function(){var t=this.videoElement;4<=t.readyState&&t.autoplay&&!this.isMobile()?(this.playVideo(),this.dispatchEvent({type:"panolens-viewer-handler",method:"updateVideoPlayButton",data:!1})):(this.pauseVideo(),this.dispatchEvent({type:"panolens-viewer-handler",method:"updateVideoPlayButton",data:!0})),this.setVideoCurrentTime({percentage:this.videoProgress})},resetVideo:function(){this.videoElement&&this.setVideoCurrentTime({percentage:0})},isVideoMuted:function(){return this.videoElement.muted},muteVideo:function(){var t=this.videoElement;t&&!t.muted&&(t.muted=!0),this.dispatchEvent({type:"volumechange"})},unmuteVideo:function(){var t=this.videoElement;t&&this.isVideoMuted()&&(t.muted=!1),this.dispatchEvent({type:"volumechange"})},getVideoElement:function(){return this.videoElement},dispose:function(){var t=this.material.map;this.pauseVideo(),this.removeEventListener("leave",this.pauseVideo.bind(this)),this.removeEventListener("enter-fade-start",this.resumeVideoProgress.bind(this)),this.removeEventListener("video-toggle",this.toggleVideo.bind(this)),this.removeEventListener("video-time",this.setVideoCurrentTime.bind(this)),t&&t.dispose(),o.prototype.dispose.call(this)}}),S()(u.prototype,{constructor:u,setProgress:function(t,e){this.onProgress&&this.onProgress({loaded:t,total:e})},adaptTextureToZoom:function(){var t=this.widths[this._zoom],e=this.heights[this._zoom],n=this.maxW,i=this.maxH;this._wc=Math.ceil(t/n),this._hc=Math.ceil(e/i);for(var r=0;r<this._hc;r++)for(var o=0;o<this._wc;o++){var a=document.createElement("canvas");o<this._wc-1?a.width=n:a.width=t-n*o,r<this._hc-1?a.height=i:a.height=e-i*r,this._canvas.push(a),this._ctx.push(a.getContext("2d"))}},composeFromTile:function(t,e,n){var i=this.maxW,r=this.maxH;t*=512,e*=512;var o=Math.floor(t/i),a=Math.floor(e/r);t-=o*i,e-=a*r,this._ctx[a*this._wc+o].drawImage(n,0,0,n.width,n.height,t,e,512,512),this.progress()},progress:function(){this._count++,this.setProgress(this._count,this._total),this._count===this._total&&(this.canvas=this._canvas,this.panoId=this._panoId,this.zoom=this._zoom,this.onPanoramaLoad&&this.onPanoramaLoad(this._canvas[0]))},composePanorama:function(){var o=this;this.setProgress(0,1);var t=this.levelsW[this._zoom],e=this.levelsH[this._zoom],a=this;this._count=0,this._total=t*e;for(var s=this._parameters.useWebGL,c=0;c<e;c++)for(var h=0;h<t;h++)!function(){var t,e,n,i,r="https://geo0.ggpht.com/cbk?cb_client=maps_sv.tactile&authuser=0&hl=en&output=tile&zoom="+o._zoom+"&x="+h+"&y="+c+"&panoid="+o._panoId+"&nbt&fover=2";t=h,e=c,s?n=P.load(r,null,function(){a.composeFromTile(t,e,n)}):((i=new Image).addEventListener("load",function(){a.composeFromTile(t,e,this)}),i.crossOrigin="",i.src=r)}()},load:function(t){this.loadPano(t)},loadPano:function(t){var n=this;this._panoClient.getPanoramaById(t,function(t,e){e===google.maps.StreetViewStatus.OK&&(n.result=t,n.copyright=t.copyright,n._panoId=t.location.pano,n.composePanorama())})},setZoom:function(t){this._zoom=t,this.adaptTextureToZoom()}}),d.prototype=S()(A()(s.prototype),{constructor:d,load:function(t){this.loadRequested=!0,(t=t||this.panoId||{})&&this.gsvLoader&&this.loadGSVLoader(t)},setupGoogleMapAPI:function(t){var e=document.createElement("script");e.src="https://maps.googleapis.com/maps/api/js?",e.src+=t?"key="+t:"",e.onreadystatechange=this.setGSVLoader.bind(this),e.onload=this.setGSVLoader.bind(this),document.querySelector("head").appendChild(e)},setGSVLoader:function(){this.gsvLoader=new u,this.loadRequested&&this.load()},getGSVLoader:function(){return this.gsvLoader},loadGSVLoader:function(t){this.loadRequested=!1,this.gsvLoader.onProgress=this.onProgress.bind(this),this.gsvLoader.onPanoramaLoad=this.onLoad.bind(this),this.gsvLoader.setZoom(this.getZoomLevel()),this.gsvLoader.load(t),this.gsvLoader.loaded=!0},onLoad:function(t){s.prototype.onLoad.call(this,new Y.q(t))},reset:function(){this.gsvLoader=void 0,s.prototype.reset.call(this)}});var D={uniforms:{tDiffuse:{value:new Y.q},resolution:{value:1},transform:{value:new Y.I},zoom:{value:1},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float resolution;","uniform mat4 transform;","uniform float zoom;","uniform float opacity;","varying vec2 vUv;","const float PI = 3.141592653589793;","void main(){","vec2 position = -1.0 +  2.0 * vUv;","position *= vec2( zoom * resolution, zoom * 0.5 );","float x2y2 = position.x * position.x + position.y * position.y;","vec3 sphere_pnt = vec3( 2. * position, x2y2 - 1. ) / ( x2y2 + 1. );","sphere_pnt = vec3( transform * vec4( sphere_pnt, 1.0 ) );","vec2 sampleUV = vec2(","(atan(sphere_pnt.y, sphere_pnt.x) / PI + 1.0) * 0.5,","(asin(sphere_pnt.z) / PI + 0.5)",");","gl_FragColor = texture2D( tDiffuse, sampleUV );","gl_FragColor.a *= opacity;","}"].join("\n")};p.prototype=S()(A()(s.prototype),{constructor:p,add:function(t){if(1<arguments.length){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}t instanceof a&&(t.material.depthTest=!1),s.prototype.add.call(this,t)},createGeometry:function(t,e){return new Y.K(t,t*e)},createMaterial:function(t){var e=S()({},D),n=e.uniforms;return n.zoom.value=t,n.opacity.value=0,new Y.H({uniforms:n,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,side:Y.B,transparent:!0})},registerMouseEvents:function(){this.container.addEventListener("mousedown",this.onMouseDown.bind(this),{passive:!0}),this.container.addEventListener("mousemove",this.onMouseMove.bind(this),{passive:!0}),this.container.addEventListener("mouseup",this.onMouseUp.bind(this),{passive:!0}),this.container.addEventListener("touchstart",this.onMouseDown.bind(this),{passive:!0}),this.container.addEventListener("touchmove",this.onMouseMove.bind(this),{passive:!0}),this.container.addEventListener("touchend",this.onMouseUp.bind(this),{passive:!0}),this.container.addEventListener("mousewheel",this.onMouseWheel.bind(this),{passive:!1}),this.container.addEventListener("DOMMouseScroll",this.onMouseWheel.bind(this),{passive:!1}),this.container.addEventListener("contextmenu",this.onContextMenu.bind(this),{passive:!0})},unregisterMouseEvents:function(){this.container.removeEventListener("mousedown",this.onMouseDown.bind(this),!1),this.container.removeEventListener("mousemove",this.onMouseMove.bind(this),!1),this.container.removeEventListener("mouseup",this.onMouseUp.bind(this),!1),this.container.removeEventListener("touchstart",this.onMouseDown.bind(this),!1),this.container.removeEventListener("touchmove",this.onMouseMove.bind(this),!1),this.container.removeEventListener("touchend",this.onMouseUp.bind(this),!1),this.container.removeEventListener("mousewheel",this.onMouseWheel.bind(this),!1),this.container.removeEventListener("DOMMouseScroll",this.onMouseWheel.bind(this),!1),this.container.removeEventListener("contextmenu",this.onContextMenu.bind(this),!1)},onMouseDown:function(t){switch(t.touches&&t.touches.length||1){case 1:var e=(0<=t.clientX?t:t.touches[0]).clientX,n=(0<=t.clientY?t:t.touches[0]).clientY;this.dragging=!0,this.userMouse.set(e,n);break;case 2:e=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY,n=Math.sqrt(e*e+n*n);this.userMouse.pinchDistance=n}this.onUpdateCallback()},onMouseMove:function(t){switch(t.touches&&t.touches.length||1){case 1:var e=(0<=t.clientX?t:t.touches[0]).clientX,n=(0<=t.clientY?t:t.touches[0]).clientY,i=.4*Y.l.degToRad(e-this.userMouse.x),r=.4*Y.l.degToRad(n-this.userMouse.y);this.dragging&&(this.quatA.setFromAxisAngle(this.vectorY,i),this.quatB.setFromAxisAngle(this.vectorX,r),this.quatCur.multiply(this.quatA).multiply(this.quatB),this.userMouse.set(e,n));break;case 2:e=t.touches[0].pageX-t.touches[1].pageX,n=t.touches[0].pageY-t.touches[1].pageY,n=Math.sqrt(e*e+n*n);this.addZoomDelta(this.userMouse.pinchDistance-n)}},onMouseUp:function(){this.dragging=!1},onMouseWheel:function(t){t.preventDefault(),t.stopPropagation();var e=0;void 0!==t.wheelDelta?e=t.wheelDelta:void 0!==t.detail&&(e=-t.detail),this.addZoomDelta(e),this.onUpdateCallback()},addZoomDelta:function(t){var e=this.material.uniforms,n=.1*this.size,i=10*this.size;e.zoom.value+=t,e.zoom.value<=n?e.zoom.value=n:e.zoom.value>=i&&(e.zoom.value=i)},onUpdateCallback:function(){this.frameId=window.requestAnimationFrame(this.onUpdateCallback.bind(this)),this.quatSlerp.slerp(this.quatCur,.1),this.material&&this.material.uniforms.transform.value.makeRotationFromQuaternion(this.quatSlerp),!this.dragging&&1-this.quatSlerp.clone().dot(this.quatCur)<this.EPS&&window.cancelAnimationFrame(this.frameId)},reset:function(){this.quatCur.set(0,0,0,1),this.quatSlerp.set(0,0,0,1),this.onUpdateCallback()},onLoad:function(t){this.material.uniforms.resolution.value=this.container.clientWidth/this.container.clientHeight,this.registerMouseEvents(),this.onUpdateCallback(),this.dispatchEvent({type:"panolens-viewer-handler",method:"disableControl"}),s.prototype.onLoad.call(this,t)},onLeave:function(){this.unregisterMouseEvents(),this.dispatchEvent({type:"panolens-viewer-handler",method:"enableControl",data:T.ORBIT}),window.cancelAnimationFrame(this.frameId),s.prototype.onLeave.call(this)},onWindowResize:function(){this.material.uniforms.resolution.value=this.container.clientWidth/this.container.clientHeight},onContextMenu:function(){this.dragging=!1},dispose:function(){this.unregisterMouseEvents(),s.prototype.dispose.call(this)}}),f.prototype=S()(A()(p.prototype),{constructor:f,onLoad:function(t){this.updateTexture(t),p.prototype.onLoad.call(this,t)},updateTexture:function(t){t.minFilter=t.magFilter=Y.w,this.material.uniforms.tDiffuse.value=t},dispose:function(){var t=this.material.uniforms.tDiffuse;t&&t.value&&t.value.dispose(),p.prototype.dispose.call(this)}}),m.prototype=S()(A()(o.prototype),{constructor:m,onPanolensContainer:function(t){t=t.container;this.media.setContainer(t)},onPanolensScene:function(t){t=t.scene;this.media.setScene(t)},start:function(){return this.media.start()},stop:function(){this.media.stop()}}),v.prototype=S()(A()(Y.u.prototype),{constructor:v}),g.prototype=S()(A()(Y.u.prototype),{constructor:g});var N=function(n){var i=new Y.Q;i.aspect=.5;var r=new Y.c;this.setEyeSeparation=function(t){i.eyeSep=t},this.setSize=function(t,e){n.setSize(t,e)},this.render=function(t,e){t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),i.update(e),n.getSize(r),n.autoClear&&n.clear(),n.setScissorTest(!0),n.setScissor(0,0,r.width/2,r.height),n.setViewport(0,0,r.width/2,r.height),n.render(t,i.cameraL),n.setScissor(r.width/2,0,r.width/2,r.height),n.setViewport(r.width/2,0,r.width/2,r.height),n.render(t,i.cameraR),n.setScissorTest(!1)}};x.prototype=S()(A()(Y.u.prototype),{constructor:x,add:function(t){if(1<arguments.length){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}this.scene.add(t),t.addEventListener&&t.addEventListener("panolens-viewer-handler",this.eventHandler.bind(this)),t instanceof o&&t.dispatchEvent&&t.dispatchEvent({type:"panolens-container",container:this.container}),t instanceof m&&t.dispatchEvent({type:"panolens-scene",scene:this.scene}),"panorama"===t.type&&(this.addPanoramaEventListener(t),this.panorama||this.setPanorama(t))},remove:function(t){t.removeEventListener&&t.removeEventListener("panolens-viewer-handler",this.eventHandler.bind(this)),this.scene.remove(t)},addDefaultControlBar:function(t){var e;this.widget?console.warn("Default control bar exists"):((e=new r(this.container)).addEventListener("panolens-viewer-handler",this.eventHandler.bind(this)),e.addControlBar(),t.forEach(function(t){e.addControlButton(t)}),this.widget=e)},setPanorama:function(e){var t,n=this.panorama;"panorama"===e.type&&n!==e&&(this.hideInfospot(),t=function t(){n&&n.onLeave(),e.removeEventListener("enter-fade-start",t)},e.addEventListener("enter-fade-start",t),(this.panorama=e).onEnter())},eventHandler:function(t){t.method&&this[t.method]&&this[t.method](t.data)},dispatchEventToChildren:function(e){this.scene.traverse(function(t){t.dispatchEvent&&t.dispatchEvent(e)})},activateWidgetItem:function(t,e){var n=this.widget.mainMenu,i=n.children[0],r=n.children[1],o=void 0;if(void 0!==t){switch(t){case 0:o=i.subMenu.children[1];break;case 1:o=i.subMenu.children[2];break;default:o=i.subMenu.children[1]}i.subMenu.setActiveItem(o),i.setSelectionTitle(o.textContent)}if(void 0!==e){switch(e){case L.CARDBOARD:o=r.subMenu.children[2];break;case L.STEREO:o=r.subMenu.children[3];break;default:o=r.subMenu.children[1]}r.subMenu.setActiveItem(o),r.setSelectionTitle(o.textContent)}},enableEffect:function(t){if(this.mode!==t)if(t!==L.NORMAL){this.mode=t;var e=this.camera.fov;switch(t){case L.CARDBOARD:this.effect=this.CardboardEffect,this.enableReticleControl();break;case L.STEREO:this.effect=this.StereoEffect,this.enableReticleControl();break;default:this.effect=null,this.disableReticleControl()}this.activateWidgetItem(void 0,this.mode),this.dispatchEventToChildren({type:"panolens-dual-eye-effect",mode:this.mode}),this.camera.fov=e+.01,this.effect.setSize(this.container.clientWidth,this.container.clientHeight),this.render(),this.camera.fov=e,this.dispatchEvent({type:"mode-change",mode:this.mode})}else this.disableEffect()},disableEffect:function(){this.mode!==L.NORMAL&&(this.mode=L.NORMAL,this.disableReticleControl(),this.activateWidgetItem(void 0,this.mode),this.dispatchEventToChildren({type:"panolens-dual-eye-effect",mode:this.mode}),this.renderer.setSize(this.container.clientWidth,this.container.clientHeight),this.render(),this.dispatchEvent({type:"mode-change",mode:this.mode}))},enableReticleControl:function(){this.reticle.visible||(this.tempEnableReticle=!0,this.unregisterMouseAndTouchEvents(),this.reticle.show(),this.registerReticleEvent(),this.updateReticleEvent())},disableReticleControl:function(){this.tempEnableReticle=!1,this.options.enableReticle?this.updateReticleEvent():(this.reticle.hide(),this.unregisterReticleEvent(),this.registerMouseAndTouchEvents())},enableAutoRate:function(){this.options.autoRotate=!0,this.OrbitControls.autoRotate=!0},disableAutoRate:function(){clearTimeout(this.autoRotateRequestId),this.options.autoRotate=!1,this.OrbitControls.autoRotate=!1},toggleVideoPlay:function(t){this.panorama instanceof l&&this.panorama.dispatchEvent({type:"video-toggle",pause:t})},setVideoCurrentTime:function(t){this.panorama instanceof l&&this.panorama.dispatchEvent({type:"video-time",percentage:t})},onVideoUpdate:function(t){var e=this.widget;e&&e.dispatchEvent({type:"video-update",percentage:t})},addUpdateCallback:function(t){t&&this.updateCallbacks.push(t)},removeUpdateCallback:function(t){var e=this.updateCallbacks.indexOf(t);t&&0<=e&&this.updateCallbacks.splice(e,1)},showVideoWidget:function(){var t=this.widget;t&&t.dispatchEvent({type:"video-control-show"})},hideVideoWidget:function(){var t=this.widget;t&&t.dispatchEvent({type:"video-control-hide"})},updateVideoPlayButton:function(t){var e=this.widget;e&&e.videoElement&&e.videoElement.controlButton&&e.videoElement.controlButton.update(t)},addPanoramaEventListener:function(t){t.addEventListener("enter-fade-start",this.setCameraControl.bind(this)),t instanceof l&&(t.addEventListener("enter-fade-start",this.showVideoWidget.bind(this)),t.addEventListener("leave",function(){this.panorama instanceof l||this.hideVideoWidget.call(this)}.bind(this)))},setCameraControl:function(){this.OrbitControls.target.copy(this.panorama.position)},getControl:function(){return this.control},getScene:function(){return this.scene},getCamera:function(){return this.camera},getRenderer:function(){return this.renderer},getContainer:function(){return this.container},getControlId:function(){return this.control.id},getNextControlId:function(){return this.controls[this.getNextControlIndex()].id},getNextControlIndex:function(){var t=this.controls,e=this.control,e=t.indexOf(e)+1;return e>=t.length?0:e},setCameraFov:function(t){this.camera.fov=t,this.camera.updateProjectionMatrix()},enableControl:function(t){switch(t=0<=t&&t<this.controls.length?t:0,this.control.enabled=!1,this.control=this.controls[t],this.control.enabled=!0,t){case T.ORBIT:this.camera.position.copy(this.panorama.position),this.camera.position.z+=1;break;case T.DEVICEORIENTATION:this.camera.position.copy(this.panorama.position)}this.control.update(),this.activateWidgetItem(t,void 0)},disableControl:function(){this.control.enabled=!1},toggleNextControl:function(){this.enableControl(this.getNextControlIndex())},getScreenVector:function(t){var e=t.clone(),n=this.container.clientWidth/2,t=this.container.clientHeight/2;return e.project(this.camera),e.x=e.x*n+n,e.y=-e.y*t+t,e.z=0,e},checkSpriteInViewport:function(t){return this.camera.matrixWorldInverse.getInverse(this.camera.matrixWorld),this.cameraViewProjectionMatrix.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),this.cameraFrustum.setFromMatrix(this.cameraViewProjectionMatrix),t.visible&&this.cameraFrustum.intersectsSprite(t)},reverseDraggingDirection:function(){this.OrbitControls.rotateSpeed*=-1,this.OrbitControls.momentumScalingFactor*=-1},addReticle:function(){this.reticle=new t(16777215,!0,this.options.dwellTime),this.reticle.hide(),this.camera.add(this.reticle),this.sceneReticle.add(this.camera)},tweenControlCenter:function(t,e,n){var i,r,o,a,s,c,h,l,u,d;this.control===this.OrbitControls&&(t instanceof Array&&(e=t[1],n=t[2],t=t[0]),e=void 0!==e?e:1e3,n=n||O.Easing.Exponential.Out,s=a=u=o=d=l=h=r=i=c=void 0,l=(h=(c=this).camera.getWorldDirection(new Y.o)).clone(),u=this.panorama.getWorldPosition(new Y.o).sub(this.camera.getWorldPosition(new Y.o)),(d=t.clone()).x*=-1,d.add(u).normalize(),o=d.clone(),h.y=0,d.y=0,i=(i=(i=Math.atan2(d.z,d.x)-Math.atan2(h.z,h.x))>Math.PI?i-2*Math.PI:i)<-Math.PI?i+2*Math.PI:i,r=Math.abs(l.angleTo(h)+(l.y*o.y<=0?o.angleTo(d):-o.angleTo(d))),r*=o.y<l.y?1:-1,a={left:0,up:0},s={left:0,up:0},this.tweenLeftAnimation.stop(),this.tweenUpAnimation.stop(),this.tweenLeftAnimation=new O.Tween(a).to({left:i},e).easing(n).onUpdate(function(t){c.control.rotateLeft(t.left-s.left),s.left=t.left}).start(),this.tweenUpAnimation=new O.Tween(a).to({up:r},e).easing(n).onUpdate(function(t){c.control.rotateUp(t.up-s.up),s.up=t.up}).start())},tweenControlCenterByObject:function(t,e,n){var i,r=!1;t.traverseAncestors(function(t){t.scalePlaceHolder&&(r=!0)}),r?(i=new Y.o(-1,1,1),this.tweenControlCenter(t.getWorldPosition(new Y.o).multiply(i),e,n)):this.tweenControlCenter(t.getWorldPosition(new Y.o),e,n)},onWindowResize:function(t,e){var n=void 0,i=void 0,r=this.container.classList.contains("panolens-container")||this.container.isFullscreen;void 0!==t&&void 0!==e?(n=t,i=e,this.container._width=t,this.container._height=e):(e=(t=/(android)/i.test(window.navigator.userAgent))?Math.min(document.documentElement.clientWidth,window.innerWidth||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0),t=t?Math.min(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientHeight,window.innerHeight||0),n=r?e:this.container.clientWidth,i=r?t:this.container.clientHeight,this.container._width=n,this.container._height=i),this.camera.aspect=n/i,this.camera.updateProjectionMatrix(),this.renderer.setSize(n,i),(this.options.enableReticle||this.tempEnableReticle)&&this.updateReticleEvent(),this.dispatchEvent({type:"window-resize",width:n,height:i}),this.scene.traverse(function(t){t.dispatchEvent&&t.dispatchEvent({type:"window-resize",width:n,height:i})})},addOutputElement:function(){var t=document.createElement("div");t.style.position="absolute",t.style.right="10px",t.style.top="10px",t.style.color="#fff",this.container.appendChild(t),this.outputDivElement=t},outputPosition:function(){var t=this.raycaster.intersectObject(this.panorama,!0);if(0<t.length){var e=t[0].point.clone(),n=new Y.o(-1,1,1),t=this.panorama.getWorldPosition(new Y.o);e.sub(t).multiply(n);var i=e.x.toFixed(2)+", "+e.y.toFixed(2)+", "+e.z.toFixed(2);if(0!==e.length())switch(this.options.output){case"console":console.info(i);break;case"overlay":this.outputDivElement.textContent=i}}},onMouseDown:function(t){t.preventDefault(),this.userMouse.x=(0<=t.clientX?t:t.touches[0]).clientX,this.userMouse.y=(0<=t.clientY?t:t.touches[0]).clientY,this.userMouse.type="mousedown",this.onTap(t)},onMouseMove:function(t){t.preventDefault(),this.userMouse.type="mousemove",this.onTap(t)},onMouseUp:function(t){var e=!1;this.userMouse.type="mouseup";var n,i=this.userMouse.x>=t.clientX-this.options.clickTolerance&&this.userMouse.x<=t.clientX+this.options.clickTolerance&&this.userMouse.y>=t.clientY-this.options.clickTolerance&&this.userMouse.y<=t.clientY+this.options.clickTolerance||t.changedTouches&&this.userMouse.x>=t.changedTouches[0].clientX-this.options.clickTolerance&&this.userMouse.x<=t.changedTouches[0].clientX+this.options.clickTolerance&&this.userMouse.y>=t.changedTouches[0].clientY-this.options.clickTolerance&&this.userMouse.y<=t.changedTouches[0].clientY+this.options.clickTolerance?"click":void 0;t&&t.target&&!t.target.classList.contains("panolens-canvas")||(t.preventDefault(),e=t.changedTouches&&1===t.changedTouches.length?this.onTap({clientX:t.changedTouches[0].clientX,clientY:t.changedTouches[0].clientY},i):this.onTap(t,i),this.userMouse.type="none",e||"click"!==i)||(t=(n=this.options).autoHideInfospot,e=n.autoHideControlBar,i=this.panorama,n=this.toggleControlBar,t&&i&&i.toggleInfospotVisibility(),e&&n())},onTap:function(t,e){var n=this.container.getBoundingClientRect(),i=n.left,r=n.top,o=this.container,n=o.clientWidth,o=o.clientHeight;if(this.raycasterPoint.x=(t.clientX-i)/n*2-1,this.raycasterPoint.y=-(t.clientY-r)/o*2+1,this.raycaster.setFromCamera(this.raycasterPoint,this.camera),this.panorama){("mousedown"!==t.type&&this.touchSupported||this.OUTPUT_INFOSPOT)&&this.outputPosition();n=this.raycaster.intersectObjects(this.panorama.children,!0),r=this.getConvertedIntersect(n),o=0<n.length?n[0].object:void 0;if("mouseup"===this.userMouse.type&&(r&&this.pressEntityObject===r&&this.pressEntityObject.dispatchEvent&&this.pressEntityObject.dispatchEvent({type:"pressstop-entity",mouseEvent:t}),this.pressEntityObject=void 0),"mouseup"===this.userMouse.type&&(o&&this.pressObject===o&&this.pressObject.dispatchEvent&&this.pressObject.dispatchEvent({type:"pressstop",mouseEvent:t}),this.pressObject=void 0),"click"===e?(this.panorama.dispatchEvent({type:"click",intersects:n,mouseEvent:t}),r&&r.dispatchEvent&&r.dispatchEvent({type:"click-entity",mouseEvent:t}),o&&o.dispatchEvent&&o.dispatchEvent({type:"click",mouseEvent:t})):(this.panorama.dispatchEvent({type:"hover",intersects:n,mouseEvent:t}),(this.hoverObject&&0<n.length&&this.hoverObject!==r||this.hoverObject&&0===n.length)&&(this.hoverObject.dispatchEvent&&(this.hoverObject.dispatchEvent({type:"hoverleave",mouseEvent:t}),this.reticle.end()),this.hoverObject=void 0),r&&0<n.length&&(this.hoverObject!==r&&(this.hoverObject=r,this.hoverObject.dispatchEvent&&(this.hoverObject.dispatchEvent({type:"hoverenter",mouseEvent:t}),(this.options.autoReticleSelect&&this.options.enableReticle||this.tempEnableReticle)&&this.reticle.start(this.onTap.bind(this,t,"click")))),"mousedown"===this.userMouse.type&&this.pressEntityObject!=r&&(this.pressEntityObject=r,this.pressEntityObject.dispatchEvent&&this.pressEntityObject.dispatchEvent({type:"pressstart-entity",mouseEvent:t})),"mousedown"===this.userMouse.type&&this.pressObject!=o&&(this.pressObject=o,this.pressObject.dispatchEvent&&this.pressObject.dispatchEvent({type:"pressstart",mouseEvent:t})),"mousemove"!==this.userMouse.type&&!this.options.enableReticle||(o&&o.dispatchEvent&&o.dispatchEvent({type:"hover",mouseEvent:t}),this.pressEntityObject&&this.pressEntityObject.dispatchEvent&&this.pressEntityObject.dispatchEvent({type:"pressmove-entity",mouseEvent:t}),this.pressObject&&this.pressObject.dispatchEvent&&this.pressObject.dispatchEvent({type:"pressmove",mouseEvent:t}))),!r&&this.pressEntityObject&&this.pressEntityObject.dispatchEvent&&(this.pressEntityObject.dispatchEvent({type:"pressstop-entity",mouseEvent:t}),this.pressEntityObject=void 0),!o&&this.pressObject&&this.pressObject.dispatchEvent&&(this.pressObject.dispatchEvent({type:"pressstop",mouseEvent:t}),this.pressObject=void 0)),o&&o instanceof a){if(this.infospot=o,"click"===e)return!0}else this.infospot&&this.hideInfospot();this.options.autoRotate&&"mousemove"!==this.userMouse.type&&(clearTimeout(this.autoRotateRequestId),this.control===this.OrbitControls&&(this.OrbitControls.autoRotate=!1,this.autoRotateRequestId=window.setTimeout(this.enableAutoRate.bind(this),this.options.autoRotateActivationDuration)))}},getConvertedIntersect:function(t){for(var e=void 0,n=0;n<t.length;n++)if(0<=t[n].distance&&t[n].object&&!t[n].object.passThrough){if(t[n].object.entity&&t[n].object.entity.passThrough)continue;if(t[n].object.entity&&!t[n].object.entity.passThrough){e=t[n].object.entity;break}e=t[n].object;break}return e},hideInfospot:function(){this.infospot&&(this.infospot.onHoverEnd(),this.infospot=void 0)},toggleControlBar:function(){var t=this.widget;t&&t.dispatchEvent({type:"control-bar-toggle"})},onKeyDown:function(t){this.options.output&&"none"!==this.options.output&&"Control"===t.key&&(this.OUTPUT_INFOSPOT=!0)},onKeyUp:function(){this.OUTPUT_INFOSPOT=!1},update:function(){O.update(),this.updateCallbacks.forEach(function(t){t()}),this.control.update(),this.scene.traverse(function(t){var e,n;t instanceof a&&t.element&&(this.hoverObject===t||"none"!==t.element.style.display||t.element.left&&"none"!==t.element.left.style.display||t.element.right&&"none"!==t.element.right.style.display)&&(this.checkSpriteInViewport(t)?(e=(n=this.getScreenVector(t.getWorldPosition(new Y.o))).x,n=n.y,t.translateElement(e,n)):t.onDismiss())}.bind(this))},render:function(){this.mode===L.CARDBOARD||this.mode===L.STEREO?(this.renderer.clear(),this.effect.render(this.scene,this.camera),this.effect.render(this.sceneReticle,this.camera)):(this.renderer.clear(),this.renderer.render(this.scene,this.camera),this.renderer.clearDepth(),this.renderer.render(this.sceneReticle,this.camera))},animate:function(){this.requestAnimationId=window.requestAnimationFrame(this.animate.bind(this)),this.onChange()},onChange:function(){this.update(),this.render()},registerMouseAndTouchEvents:function(){var t={passive:!1};this.container.addEventListener("mousedown",this.HANDLER_MOUSE_DOWN,t),this.container.addEventListener("mousemove",this.HANDLER_MOUSE_MOVE,t),this.container.addEventListener("mouseup",this.HANDLER_MOUSE_UP,t),this.container.addEventListener("touchstart",this.HANDLER_MOUSE_DOWN,t),this.container.addEventListener("touchend",this.HANDLER_MOUSE_UP,t)},unregisterMouseAndTouchEvents:function(){this.container.removeEventListener("mousedown",this.HANDLER_MOUSE_DOWN,!1),this.container.removeEventListener("mousemove",this.HANDLER_MOUSE_MOVE,!1),this.container.removeEventListener("mouseup",this.HANDLER_MOUSE_UP,!1),this.container.removeEventListener("touchstart",this.HANDLER_MOUSE_DOWN,!1),this.container.removeEventListener("touchend",this.HANDLER_MOUSE_UP,!1)},registerReticleEvent:function(){this.addUpdateCallback(this.HANDLER_TAP)},unregisterReticleEvent:function(){this.removeUpdateCallback(this.HANDLER_TAP)},updateReticleEvent:function(){var t=this.container.clientWidth/2+this.container.offsetLeft,e=this.container.clientHeight/2;this.removeUpdateCallback(this.HANDLER_TAP),this.HANDLER_TAP=this.onTap.bind(this,{clientX:t,clientY:e}),this.addUpdateCallback(this.HANDLER_TAP)},registerEventListeners:function(){window.addEventListener("resize",this.HANDLER_WINDOW_RESIZE,!0),window.addEventListener("keydown",this.HANDLER_KEY_DOWN,!0),window.addEventListener("keyup",this.HANDLER_KEY_UP,!0)},unregisterEventListeners:function(){window.removeEventListener("resize",this.HANDLER_WINDOW_RESIZE,!0),window.removeEventListener("keydown",this.HANDLER_KEY_DOWN,!0),window.removeEventListener("keyup",this.HANDLER_KEY_UP,!0)},dispose:function(){this.tweenLeftAnimation.stop(),this.tweenUpAnimation.stop(),this.unregisterEventListeners(),function t(e){for(var n=e.children.length-1;0<=n;n--)t(e.children[n]),e.remove(e.children[n]);e instanceof o||e instanceof a?(e.dispose(),e=null):e.dispatchEvent&&e.dispatchEvent("dispose")}(this.scene),this.widget&&(this.widget.dispose(),this.widget=null),Y.p&&Y.p.enabled&&Y.p.clear()},destroy:function(){this.dispose(),this.render(),window.cancelAnimationFrame(this.requestAnimationId)},onPanoramaDispose:function(t){t instanceof l&&this.hideVideoWidget(),t===this.panorama&&(this.panorama=null)},loadAsyncRequest:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:function(){},n=new window.XMLHttpRequest;n.onloadend=function(t){e(t)},n.open("GET",t,!0),n.send(null)},addViewIndicator:function(){var n=this;this.loadAsyncRequest(R.ViewIndicator,function(t){var e;0!==t.loaded&&((t=t.target.responseXML.documentElement).style.width=n.viewIndicatorSize+"px",t.style.height=n.viewIndicatorSize+"px",t.style.position="absolute",t.style.top="10px",t.style.left="10px",t.style.opacity="0.5",t.style.cursor="pointer",t.id="panolens-view-indicator-container",n.container.appendChild(t),e=t.querySelector("#indicator"),n.addUpdateCallback(function(){n.radius=.225*n.viewIndicatorSize,n.currentPanoAngle=n.camera.rotation.y-Y.l.degToRad(90),n.fovAngle=Y.l.degToRad(n.camera.fov),n.leftAngle=-n.currentPanoAngle-n.fovAngle/2,n.rightAngle=-n.currentPanoAngle+n.fovAngle/2,n.leftX=n.radius*Math.cos(n.leftAngle),n.leftY=n.radius*Math.sin(n.leftAngle),n.rightX=n.radius*Math.cos(n.rightAngle),n.rightY=n.radius*Math.sin(n.rightAngle),n.indicatorD="M "+n.leftX+" "+n.leftY+" A "+n.radius+" "+n.radius+" 0 0 1 "+n.rightX+" "+n.rightY,n.leftX&&n.leftY&&n.rightX&&n.rightY&&n.radius&&e.setAttribute("d",n.indicatorD)}),t.addEventListener("mouseenter",function(){this.style.opacity="1"}),t.addEventListener("mouseleave",function(){this.style.opacity="0.5"}))})},appendControlItem:function(t){var e=this.widget.createCustomItem(t);return("video"===t.group?this.widget.videoElement:this.widget.barElement).appendChild(e),e},clearAllCache:function(){Y.p.clear()}}),Y.V!=b&&console.warn("three.js version is not matched. Please consider use the target revision "+b),window.TWEEN=O}).call(z,U(102))},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on  "+t);return t}},function(t,e,n){var i=n(7),r=n(1).document,o=i(r)&&i(r.createElement);t.exports=function(t){return o?r.createElement(t):{}}},function(t,e,n){"use strict";function i(t){var n,i;this.promise=new t(function(t,e){if(void 0!==n||void 0!==i)throw TypeError("Bad Promise constructor");n=t,i=e}),this.resolve=r(n),this.reject=r(i)}var r=n(9);t.exports.f=function(t){return new i(t)}},function(t,e,n){var i=n(78),r=n(30);t.exports=Object.keys||function(t){return i(t,r)}},function(t,e,n){var i=n(14).f,r=n(13),o=n(2)("toStringTag");t.exports=function(t,e,n){t&&!r(t=n?t:t.prototype,o)&&i(t,o,{configurable:!0,value:e})}},function(t,e,n){var i=n(39)("keys"),r=n(43);t.exports=function(t){return i[t]||(i[t]=r(t))}},function(t,e){var n=Math.ceil,i=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(0<t?i:n)(t)}},function(t,e,n){var i=n(32),r=n(17);t.exports=function(t){return i(r(t))}},function(t,e,n){var i=n(17);t.exports=function(t){return Object(i(t))}},function(t,e){function i(t,e){var n=t[1]||"",i=t[3];if(!i)return n;if(e&&"function"==typeof btoa){e=(e=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */");return[n].concat(i.sources.map(function(t){return"/*# sourceURL="+i.sourceRoot+t+" */"})).concat([e]).join("\n")}return[n].join("\n")}t.exports=function(n){var a=[];return a.toString=function(){return this.map(function(t){var e=i(t,n);return t[2]?"@media "+t[2]+"{"+e+"}":e}).join("")},a.i=function(t,e){"string"==typeof t&&(t=[[null,t,""]]);for(var n={},i=0;i<this.length;i++){var r=this[i][0];"number"==typeof r&&(n[r]=!0)}for(i=0;i<t.length;i++){var o=t[i];"number"==typeof o[0]&&n[o[0]]||(e&&!o[2]?o[2]=e:e&&(o[2]="("+o[2]+") and ("+e+")"),a.push(o))}},a}},function(t,e){t.exports=function(t,e,n,i){var r,o=t=t||{},a=typeof t.default;"object"!=a&&"function"!=a||(o=(r=t).default);var s,t="function"==typeof o?o.options:o;return e&&(t.render=e.render,t.staticRenderFns=e.staticRenderFns),n&&(t._scopeId=n),i&&(s=Object.create(t.computed||null),Object.keys(i).forEach(function(t){var e=i[t];s[t]=function(){return e}}),t.computed=s),{esModule:r,exports:o,options:t}}},function(t,e,n){function c(t){for(var e=0;e<t.length;e++){var n=t[e],i=l[n.id];if(i){i.refs++;for(var r=0;r<i.parts.length;r++)i.parts[r](n.parts[r]);for(;r<n.parts.length;r++)i.parts.push(a(n.parts[r]));i.parts.length>n.parts.length&&(i.parts.length=n.parts.length)}else{for(var o=[],r=0;r<n.parts.length;r++)o.push(a(n.parts[r]));l[n.id]={id:n.id,refs:1,parts:o}}}}function o(){var t=document.createElement("style");return t.type="text/css",r.appendChild(t),t}function a(e){var t,n,i,r=document.querySelector('style[data-vue-ssr-id~="'+e.id+'"]');if(r){if(p)return f;r.parentNode.removeChild(r)}return i=m?(t=d++,r=u=u||o(),n=s.bind(null,r,t,!1),s.bind(null,r,t,!0)):(r=o(),n=function(t,e){var n=e.css,i=e.media,e=e.sourceMap;if(i&&t.setAttribute("media",i),e&&(n+="\n/*# sourceURL="+e.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,r),function(){r.parentNode.removeChild(r)}),n(e),function(t){t?t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap||n(e=t):i()}}function s(t,e,n,i){n=n?"":i.css;t.styleSheet?t.styleSheet.cssText=g(e,n):(i=document.createTextNode(n),(n=t.childNodes)[e]&&t.removeChild(n[e]),n.length?t.insertBefore(i,n[e]):t.appendChild(i))}var i="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!i)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var h=n(109),l={},r=i&&(document.head||document.getElementsByTagName("head")[0]),u=null,d=0,p=!1,f=function(){},m="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());t.exports=function(a,t,e){p=e;var s=h(a,t);return c(s),function(t){for(var e=[],n=0;n<s.length;n++){var i=s[n];(r=l[i.id]).refs--,e.push(r)}t?c(s=h(a,t)):s=[];for(var r,n=0;n<e.length;n++)if(0===(r=e[n]).refs){for(var o=0;o<r.parts.length;o++)r.parts[o]();delete l[r.id]}}};var v,g=(v=[],function(t,e){return v[t]=e,v.filter(Boolean).join("\n")})},function(t,e,n){var i=n(10),r=n(2)("toStringTag"),o="Arguments"==i(function(){return arguments}());t.exports=function(t){var e;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(t=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),r))?t:o?i(e):"Object"==(t=i(e))&&"function"==typeof e.callee?"Arguments":t}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){n=n(1).document;t.exports=n&&n.documentElement},function(t,e,n){var i=n(10);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==i(t)?t.split(""):Object(t)}},function(t,e,n){"use strict";function y(){return this}var x=n(34),b=n(3),w=n(82),M=n(5),_=n(13),E=n(8),A=n(70),S=n(21),T=n(77),L=n(2)("iterator"),R=!([].keys&&"next"in[].keys());t.exports=function(t,e,n,i,r,o,a){A(n,e,i);function s(t){if(!R&&t in f)return f[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}}var c,h,l,u=e+" Iterator",d="values"==r,p=!1,f=t.prototype,m=f[L]||f["@@iterator"]||r&&f[r],v=!R&&m||s(r),g=r?d?s("entries"):v:void 0,i="Array"==e&&f.entries||m;if(i&&(l=T(i.call(new t)))!==Object.prototype&&l.next&&(S(l,u,!0),x||_(l,L)||M(l,L,y)),d&&m&&"values"!==m.name&&(p=!0,v=function(){return m.call(this)}),x&&!a||!R&&!p&&f[L]||M(f,L,v),E[e]=v,E[u]=y,r)if(c={values:d?v:s("values"),keys:o?v:s("keys"),entries:g},a)for(h in c)h in f||w(f,h,c[h]);else b(b.P+b.F*(R||p),e,c);return c}},function(t,e){t.exports=!0},function(t,e,n){function i(){}var r=n(4),o=n(75),a=n(30),s=n(22)("IE_PROTO"),c=function(){var t=n(18)("iframe"),e=a.length;for(t.style.display="none",n(31).appendChild(t),t.src="javascript:",(t=t.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),c=t.F;e--;)delete c.prototype[a[e]];return c()};t.exports=Object.create||function(t,e){var n;return null!==t?(i.prototype=r(t),n=new i,i.prototype=null,n[s]=t):n=c(),void 0===e?n:o(n,e)}},function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,e,n){var i=n(4),r=n(7),o=n(19);t.exports=function(t,e){if(i(t),r(e)&&e.constructor===t)return e;t=o.f(t);return(0,t.resolve)(e),t.promise}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var n=n(1),i=n["__core-js_shared__"]||(n["__core-js_shared__"]={});t.exports=function(t){return i[t]||(i[t]={})}},function(t,e,n){var i=n(4),r=n(9),o=n(2)("species");t.exports=function(t,e){var n,t=i(t).constructor;return void 0===t||null==(n=i(t)[o])?e:r(n)}},function(t,e,n){function i(){var t,e=+this;g.hasOwnProperty(e)&&(t=g[e],delete g[e],t())}function r(t){i.call(t.data)}var o,a=n(11),s=n(67),c=n(31),h=n(18),l=n(1),u=l.process,d=l.setImmediate,p=l.clearImmediate,f=l.MessageChannel,m=l.Dispatch,v=0,g={};d&&p||(d=function(t){for(var e=[],n=1;n<arguments.length;)e.push(arguments[n++]);return g[++v]=function(){s("function"==typeof t?t:Function(t),e)},o(v),v},p=function(t){delete g[t]},"process"==n(10)(u)?o=function(t){u.nextTick(a(i,t,1))}:m&&m.now?o=function(t){m.now(a(i,t,1))}:f?(f=(n=new f).port2,n.port1.onmessage=r,o=a(f.postMessage,f,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(o=function(t){l.postMessage(t+"","*")},l.addEventListener("message",r,!1)):o="onreadystatechange"in h("script")?function(t){c.appendChild(h("script")).onreadystatechange=function(){c.removeChild(this),i.call(t)}}:function(t){setTimeout(a(i,t,1),0)}),t.exports={set:d,clear:p}},function(t,e,n){var i=n(23),r=Math.min;t.exports=function(t){return 0<t?r(i(t),9007199254740991):0}},function(t,e){var n=0,i=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+i).toString(36))}},function(t,e,n){n(108);n=n(27)(n(48),n(105),null,null);t.exports=n.exports},function(t,e,n){n(107);n=n(27)(n(49),n(104),"data-v-66d382e3",null);t.exports=n.exports},function(t,e,n){n(106);n=n(27)(n(50),n(103),"data-v-09ad1f51",null);t.exports=n.exports},function(t,e){t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=n(16),c=console.log.bind(console);e.default={name:"Pano",props:{source:{type:String,default:""},type:{type:String,default:"image"},width:{type:Number,default:100},height:{type:Number,default:100}},data:function(){return{size:{width:this.width,height:this.height},viewer:null,panorama:null}},created:function(){window.addEventListener("resize",this.onResize,!1)},destroyed:function(){this.panorama&&this.panorama.dispose&&this.panorama.dispose()},mounted:function(){void 0!==this.width&&void 0!==this.height||(this.size={width:this.$el.offsetWidth,height:this.$el.offsetHeight}),this.viewer=new s.a({container:this.$el,cameraFov:100}),this.loadPano()},watch:{source:function(){this.viewer&&this.panorama&&this.loadPano()}},methods:{onResize:function(){var t=this;void 0!==this.width&&void 0!==this.height||this.$nextTick(function(){t.size={width:t.$el.offsetWidth,height:t.$el.offsetHeight}})},loadPano:function(){if(c("this.source = "+this.source),this.source){var t=void 0;switch(this.type){case"cube":var e=this.source.replace("%s","l"),n=this.source.replace("%s","f"),i=this.source.replace("%s","r"),r=this.source.replace("%s","b"),o=this.source.replace("%s","u"),a=this.source.replace("%s","d"),t=new s.b([i,e,o,a,n,r]);break;case"video":t=new s.c(this.source,{autoplay:!0});break;default:t=new s.d(this.source)}this.setPano(t)}},setPano:function(t){var e;t&&(this.panorama&&this.viewer.remove(this.panorama),this.panorama=t,this.viewer.add(this.panorama),this.viewer.setPanorama(this.panorama),(e=this).panorama.addEventListener("load",function(){e.$emit("on-load")}))}}}},function(t,e,n){"use strict";function d(t,e){var n,i,r=(o=.1*Math.cos(60*m.l.DEG2RAD),n=.1*Math.sin(60*m.l.DEG2RAD),(i=new m.m).moveTo(.2/3,0),i.lineTo(.2/3-o,n),i.lineTo(-o,n),i.lineTo(0,0),i.lineTo(-o,-n),i.lineTo(.2/3-o,-n),i.lineTo(.2/3,0),new m.n(i)),o=new m.k({transparent:!0,opacity:.8,color:1668818,emissive:16777215,side:m.f,polygonOffset:!0,polygonOffsetFactor:-4,polygonOffsetUnits:-4}),n=new m.h(r,o),i=e.x,r=e.z,o=t.x,t=t.z,o=180*Math.atan2(r-t,i-o)/Math.PI;n.rotation.set(p(90),0,p(o));var o=function(t,e){t+=90;var n=-.5*Math.sin(p(e)),i=-.5*Math.cos(p(e)),e=i*Math.sin(p(-t)),t=i*Math.cos(p(-t));return new m.o(e,n,t)}(o,0);return n.position.set(o.x,o.y,o.z),n.type="arrow",n.targetScene=e,n}function p(t){return t*Math.PI/180}Object.defineProperty(e,"__esModule",{value:!0});var f=n(16),m=n(15),v=console.log.bind(console);e.default={name:"Scene",props:{pano:{type:Object,default:function(){return{}}},position:{type:Object,default:function(){return{x:0,y:0,z:0}}},rotation:{type:Object,default:function(){return{x:0,y:0,z:0}}},links:{type:Array,default:function(){return[]}},width:{type:Number,default:void 0},height:{type:Number,default:void 0}},data:function(){return{size:{width:this.width,height:this.height},scene_index:-1,viewer:null,panorama:null,hotspots:[]}},created:function(){window.addEventListener("resize",this.onResize,!1)},mounted:function(){void 0!==this.width&&void 0!==this.height||(this.size={width:this.$el.offsetWidth,height:this.$el.offsetHeight}),this.viewer=new f.a({container:this.$el,cameraFov:100}),this.loadScene()},methods:{onResize:function(){var t=this;void 0!==this.width&&void 0!==this.height||this.$nextTick(function(){t.size={width:t.$el.offsetWidth,height:t.$el.offsetHeight}})},loadScene:function(){var n=this;if(v("this.pano = "+this.pano),this.pano){var t=this.pano.source;switch(this.pano.type){case"cube":var e=t.replace("%s","l"),i=t.replace("%s","f"),r=t.replace("%s","r"),o=t.replace("%s","b"),a=t.replace("%s","u"),s=t.replace("%s","d");this.panorama=new f.b([r,e,a,s,i,o]);break;case"video":this.panorama=new f.c(t,{autoplay:!0});break;default:this.panorama=new f.d(t)}this.initViewer();var c=new m.a;this.links.forEach(function(t,e){v(e);e=function(t){var e=new m.d(8,13,100,100),n=new m.e({color:1668818,emissive:16777215,transparent:!0,opacity:1,side:m.f,polygonOffset:!0,polygonOffsetFactor:-4,polygonOffsetUnits:-4}),i=new m.g(9,32,32),r=new m.e;r.copy(n),r.opacity=.5;var o=new m.h(i),i=new m.h(e),e=new m.i;return o.updateMatrix(),e.merge(o.geometry,o.matrix,0),i.updateMatrix(),e.merge(i.geometry,i.matrix,1),(r=new m.h(e,new m.j([n,r]))).rotation.set(p(90),0,0),r.position.set(t.position.x,t.position.y-100,t.position.z),r.type="hotspot",r.targetScene=t,r}(t);n.viewer.add(e),n.hotspots.push(e);t=d(n.position,t);t.addEventListener("mouseover",function(){v("hoverred")}),c.add(t)});var h=this,l=new m.b,u=null;this.viewer.container.addEventListener("click",function(t){u&&(v(u.targetScene),h.scene_index=h.getSceneIndexByKey(u.targetScene.key),h.viewer.remove(h.panorama),h.loadScene(),u=null)}),this.viewer.container.addEventListener("mousemove",function(t){var e=new m.c,n=h.viewer.camera;e.x=(t.clientX-h.$el.parentElement.offsetLeft)/h.viewer.container.offsetWidth*2-1,e.y=-(t.clientY-h.$el.parentElement.offsetTop)/h.viewer.container.offsetHeight*2+1,l.setFromCamera(e,n);var n=l.intersectObjects(h.viewer.scene.children,!0),i=null;0<=n.length&&n.forEach(function(t,e){"hotspot"!==t.object.type&&"arrow"!==t.object.type||(i=t.object)}),i?(u&&(u.material.color&&u.material.color.setHex(u.currentHex),u.scale.set(1,1,1)),(u=n[0].object).material.color&&(u.currentHex=u.material.color.getHex()),u.material.color&&u.material.color.setHex(16776960),u.scale.set(1.2,1.2,1.2)):(u&&(u.material.color&&u.material.color.setHex(u.currentHex),u.scale.set(1,1,1)),u=null)}),this.viewer.addUpdateCallback(function(){this.position.copy(h.viewer.control.target),this.rotation.z=h.viewer.camera.rotation.z,this.translateZ(0),this.translateX(0),this.translateY(-1),this.translateZ(0)}.bind(c)),this.viewer.add(c),this.panorama.addEventListener("load",function(){h.$emit("on-load")})}},initViewer:function(){this.viewer.add(this.panorama),this.viewer.camera.near=.001,this.viewer.camera.target=this.panorama.position,this.viewer.panorama.rotation.set(0,Math.PI,0),this.viewer.panorama.position.copy(this.position)}}}},function(t,e,n){"use strict";function u(t,e){var n,i,r=(o=.1*Math.cos(60*f.l.DEG2RAD),n=.1*Math.sin(60*f.l.DEG2RAD),(i=new f.m).moveTo(.2/3,0),i.lineTo(.2/3-o,n),i.lineTo(-o,n),i.lineTo(0,0),i.lineTo(-o,-n),i.lineTo(.2/3-o,-n),i.lineTo(.2/3,0),new f.n(i)),o=new f.k({transparent:!0,opacity:.8,color:1668818,emissive:16777215,side:f.f,polygonOffset:!0,polygonOffsetFactor:-4,polygonOffsetUnits:-4}),n=new f.h(r,o),i=e.x,r=e.z,o=t.x,t=t.z,o=180*Math.atan2(r-t,i-o)/Math.PI;n.rotation.set(d(90),0,d(o));var o=function(t,e){t+=90;var n=-.5*Math.sin(d(e)),i=-.5*Math.cos(d(e)),e=i*Math.sin(d(-t)),t=i*Math.cos(d(-t));return new f.o(e,n,t)}(o,0);return n.position.set(o.x,o.y,o.z),n.type="arrow",n.targetScene=e,n}function d(t){return t*Math.PI/180}Object.defineProperty(e,"__esModule",{value:!0});var p=n(16),f=n(15),m=console.log.bind(console);e.default={name:"Tour",props:{scenes:{type:Array,default:function(){return[]}},sceneIndex:{type:Number,default:0},width:{type:Number,default:void 0},height:{type:Number,default:void 0}},data:function(){return{size:{width:this.width,height:this.height},scene_index:-1,viewer:null,panorama:null,hotspots:[],arrowGroup:null}},created:function(){window.addEventListener("resize",this.onResize,!1)},mounted:function(){void 0!==this.width&&void 0!==this.height||(this.size={width:this.$el.offsetWidth,height:this.$el.offsetHeight}),this.viewer=new p.a({container:this.$el,cameraFov:100}),-1===this.scene_index&&this.loadScene(this.sceneIndex)},methods:{onResize:function(){var t=this;void 0!==this.width&&void 0!==this.height||this.$nextTick(function(){t.size={width:t.$el.offsetWidth,height:t.$el.offsetHeight}})},getSceneIndexByKey:function(t){for(var e=0;e<this.scenes.length;e++)if(this.scenes[e].key===t)return e;return-1},loadScene:function(t){var n=this;if(this.$emit("on-load-start"),m("this.scenes = "+this.scenes),this.scenes&&0!==this.scenes.length&&this.scene_index!==t){this.scene_index=t;var i=this.scenes[t],t=i.panorama,e=t.source;switch(t.type){case"cube":var r=e.replace("%s","l"),o=e.replace("%s","f"),a=e.replace("%s","r"),s=e.replace("%s","b"),c=e.replace("%s","u"),h=e.replace("%s","d");this.panorama=new p.b([a,r,c,h,o,s]);break;case"video":this.panorama=new p.c(e,{autoplay:!0}),m("this is video");break;default:this.panorama=new p.d(e)}this.viewer.camera.near=.001,this.viewer.camera.position.set(i.x,i.y,i.z),this.viewer.camera.translateZ(1),this.viewer.add(this.panorama),this.viewer.panorama.rotation.set(0,Math.PI,0),this.panorama.parent.rotation.set(0,Math.PI,0),this.viewer.panorama.position.set(i.x,i.y,i.z),this.viewer.control.target=this.viewer.panorama.position,m(this.viewer),m("panorama = ",this.panorama),this.arrowGroup&&this.viewer.remove(this.arrowGroup),this.hotspots&&this.hotspots.forEach(function(t){n.viewer.remove(t)}),this.arrowGroup=new f.a,i.connections.forEach(function(t){m("connections key = ",t);var e=n.getSceneIndexByKey(t);m("connections index = ",e),-1!==e&&(t=function(t){var e={x:t.x,y:t.y,z:t.z},n=new f.d(8,13,100,100),i=new f.e({color:1668818,emissive:16777215,transparent:!0,opacity:1,side:f.f,polygonOffset:!0,polygonOffsetFactor:-4,polygonOffsetUnits:-4}),r=new f.g(9,32,32),o=new f.e;o.copy(i),o.opacity=.5;var a=new f.h(r),r=new f.h(n),n=new f.i;return a.updateMatrix(),n.merge(a.geometry,a.matrix,0),r.updateMatrix(),n.merge(r.geometry,r.matrix,1),(o=new f.h(n,new f.j([i,o]))).rotation.set(d(90),0,0),o.position.set(e.x,e.y-100,e.z),o.type="hotspot",o.targetScene=t,o}(n.scenes[e]),n.viewer.add(t),n.hotspots.push(t),(e=u(i,n.scenes[e])).addEventListener("mouseover",function(){m("hoverred")}),n.arrowGroup.add(e))});var l=this;new f.b,this.viewer.container.addEventListener("click",function(t){Date.now()}),this.viewer.add(this.arrowGroup),this.panorama.addEventListener("load",function(){l.$emit("on-load")})}}}};Date.now()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n.d(e,"install",function(){return c});var i=n(47),i=(n.n(i),n(44)),r=n.n(i),i=n(45),o=n.n(i),i=n(46),a=n.n(i);n.d(e,"Pano",function(){return r.a}),n.d(e,"Scene",function(){return o.a}),n.d(e,"Tour",function(){return a.a});var s=[r.a,a.a,o.a],c=function(e){s.map(function(t){e.component(t.name,t)})};"undefined"!=typeof window&&window.Vue&&c(window.Vue)},function(t,e,n){t.exports={default:n(57),__esModule:!0}},function(t,e,n){t.exports={default:n(58),__esModule:!0}},function(t,e,n){t.exports={default:n(59),__esModule:!0}},function(t,e,n){t.exports={default:n(60),__esModule:!0}},function(t,e,n){t.exports={default:n(61),__esModule:!0}},function(t,e,n){n(89),t.exports=n(0).Number.isNaN},function(t,e,n){n(90),t.exports=n(0).Object.assign},function(t,e,n){n(91);var i=n(0).Object;t.exports=function(t,e){return i.create(t,e)}},function(t,e,n){n(92),t.exports=n(0).Object.keys},function(t,e,n){n(93),n(95),n(98),n(94),n(96),n(97),t.exports=n(0).Promise},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e,n,i){if(!(t instanceof e)||void 0!==i&&i in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){var c=n(24),h=n(42),l=n(85);t.exports=function(s){return function(t,e,n){var i,r=c(t),o=h(r.length),a=l(n,o);if(s&&e!=e){for(;a<o;)if((i=r[a++])!=i)return!0}else for(;a<o;a++)if((s||a in r)&&r[a]===e)return s||a||0;return!s&&-1}}},function(t,e,n){var u=n(11),d=n(69),p=n(68),f=n(4),m=n(42),v=n(87),g={},y={};(e=t.exports=function(t,e,n,i,r){var o,a,s,c,r=r?function(){return t}:v(t),h=u(n,i,e?2:1),l=0;if("function"!=typeof r)throw TypeError(t+" is not iterable!");if(p(r)){for(o=m(t.length);l<o;l++)if((c=e?h(f(a=t[l])[0],a[1]):h(t[l]))===g||c===y)return c}else for(s=r.call(t);!(a=s.next()).done;)if((c=d(s,h,a.value,e))===g||c===y)return c}).BREAK=g,e.RETURN=y},function(t,e,n){t.exports=!n(6)&&!n(12)(function(){return 7!=Object.defineProperty(n(18)("div"),"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t,e,n){var i=void 0===n;switch(e.length){case 0:return i?t():t.call(n);case 1:return i?t(e[0]):t.call(n,e[0]);case 2:return i?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return i?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return i?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){var i=n(8),r=n(2)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||o[r]===t)}},function(t,e,n){var o=n(4);t.exports=function(t,e,n,i){try{return i?e(o(n)[0],n[1]):e(n)}catch(e){var r=t.return;throw void 0!==r&&o(r.call(t)),e}}},function(t,e,n){"use strict";var i=n(35),r=n(38),o=n(21),a={};n(5)(a,n(2)("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=i(a,{next:r(1,n)}),o(t,e+" Iterator")}},function(t,e,n){var o=n(2)("iterator"),a=!1;try{var i=[7][o]();i.return=function(){a=!0},Array.from(i,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!a)return!1;var n=!1;try{var i=[7],r=i[o]();r.next=function(){return{done:n=!0}},i[o]=function(){return r},t(i)}catch(t){}return n}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,n){var s=n(1),c=n(41).set,h=s.MutationObserver||s.WebKitMutationObserver,l=s.process,u=s.Promise,d="process"==n(10)(l);t.exports=function(){function t(){var t,e;for(d&&(t=l.domain)&&t.exit();n;){e=n.fn,n=n.next;try{e()}catch(t){throw n?r():i=void 0,t}}i=void 0,t&&t.enter()}var n,i,e,r,o,a;return r=d?function(){l.nextTick(t)}:!h||s.navigator&&s.navigator.standalone?u&&u.resolve?(e=u.resolve(),function(){e.then(t)}):function(){c.call(s,t)}:(o=!0,a=document.createTextNode(""),new h(t).observe(a,{characterData:!0}),function(){a.data=o=!o}),function(t){t={fn:t,next:void 0};i&&(i.next=t),n||(n=t,r()),i=t}}},function(t,e,n){"use strict";var d=n(20),p=n(76),f=n(79),m=n(25),v=n(32),r=Object.assign;t.exports=!r||n(12)(function(){var t={},e={},n=Symbol(),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach(function(t){e[t]=t}),7!=r({},t)[n]||Object.keys(r({},e)).join("")!=i})?function(t,e){for(var n=m(t),i=arguments.length,r=1,o=p.f,a=f.f;r<i;)for(var s,c=v(arguments[r++]),h=o?d(c).concat(o(c)):d(c),l=h.length,u=0;u<l;)a.call(c,s=h[u++])&&(n[s]=c[s]);return n}:r},function(t,e,n){var a=n(14),s=n(4),c=n(20);t.exports=n(6)?Object.defineProperties:function(t,e){s(t);for(var n,i=c(e),r=i.length,o=0;o<r;)a.f(t,n=i[o++],e[n]);return t}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var i=n(13),r=n(25),o=n(22)("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=r(t),i(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},function(t,e,n){var a=n(13),s=n(24),c=n(64)(!1),h=n(22)("IE_PROTO");t.exports=function(t,e){var n,i=s(t),r=0,o=[];for(n in i)n!=h&&a(i,n)&&o.push(n);for(;e.length>r;)a(i,n=e[r++])&&(~c(o,n)||o.push(n));return o}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,n){var r=n(3),o=n(0),a=n(12);t.exports=function(t,e){var n=(o.Object||{})[t]||Object[t],i={};i[t]=e(n),r(r.S+r.F*a(function(){n(1)}),"Object",i)}},function(t,e,n){var r=n(5);t.exports=function(t,e,n){for(var i in e)n&&t[i]?t[i]=e[i]:r(t,i,e[i]);return t}},function(t,e,n){t.exports=n(5)},function(t,e,n){"use strict";var i=n(1),r=n(0),o=n(14),a=n(6),s=n(2)("species");t.exports=function(t){t=("function"==typeof r[t]?r:i)[t];a&&t&&!t[s]&&o.f(t,s,{configurable:!0,get:function(){return this}})}},function(t,e,n){var a=n(23),s=n(17);t.exports=function(o){return function(t,e){var n,i=String(s(t)),r=a(e),t=i.length;return r<0||t<=r?o?"":void 0:(e=i.charCodeAt(r))<55296||56319<e||r+1===t||(n=i.charCodeAt(r+1))<56320||57343<n?o?i.charAt(r):e:o?i.slice(r,r+2):n-56320+(e-55296<<10)+65536}}},function(t,e,n){var i=n(23),r=Math.max,o=Math.min;t.exports=function(t,e){return(t=i(t))<0?r(t+e,0):o(t,e)}},function(t,e,n){var r=n(7);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var i=n(29),r=n(2)("iterator"),o=n(8);t.exports=n(0).getIteratorMethod=function(t){if(null!=t)return t[r]||t["@@iterator"]||o[i(t)]}},function(t,e,n){"use strict";var i=n(62),r=n(72),o=n(8),a=n(24);t.exports=n(33)(Array,"Array",function(t,e){this._t=a(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,r(1)):r(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},function(t,e,n){n=n(3);n(n.S,"Number",{isNaN:function(t){return t!=t}})},function(t,e,n){var i=n(3);i(i.S+i.F,"Object",{assign:n(74)})},function(t,e,n){var i=n(3);i(i.S,"Object",{create:n(35)})},function(t,e,n){var i=n(25),r=n(20);n(80)("keys",function(){return function(t){return r(i(t))}})},function(t,e){},function(t,e,n){"use strict";function i(){}function l(t){var e;return!(!v(t)||"function"!=typeof(e=t.then))&&e}function r(h,e){var n;h._n||(h._n=!0,n=h._c,M(function(){for(var s=h._v,c=1==h._s,t=0;n.length>t;)!function(t){var e,n,i=c?t.ok:t.fail,r=t.resolve,o=t.reject,a=t.domain;try{i?(c||(2==h._h&&O(h),h._h=1),!0===i?e=s:(a&&a.enter(),e=i(s),a&&a.exit()),e===t.promise?o(S("Promise-chain cycle")):(n=l(e))?n.call(e,r,o):r(e)):o(s)}catch(t){o(t)}}(n[t++]);h._c=[],h._n=!1,e&&!h._h&&P(h)}))}function o(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),r(e,!0))}var a,s,c,h,u=n(34),d=n(1),p=n(11),f=n(29),m=n(3),v=n(7),g=n(9),y=n(63),x=n(65),b=n(40),w=n(41).set,M=n(73)(),_=n(19),E=n(36),A=n(37),S=d.TypeError,T=d.process,L=d.Promise,R="process"==f(T),C=s=_.f,f=!!function(){try{var t=L.resolve(1),e=(t.constructor={})[n(2)("species")]=function(t){t(i,i)};return(R||"function"==typeof PromiseRejectionEvent)&&t.then(i)instanceof e}catch(t){}}(),P=function(r){w.call(d,function(){var t,e,n=r._v,i=I(r);if(i&&(t=E(function(){R?T.emit("unhandledRejection",n,r):(e=d.onunhandledrejection)?e({promise:r,reason:n}):(e=d.console)&&e.error&&e.error("Unhandled promise rejection",n)}),r._h=R||I(r)?2:1),r._a=void 0,i&&t.e)throw t.v})},I=function(t){return 1!==t._h&&0===(t._a||t._c).length},O=function(e){w.call(d,function(){var t;R?T.emit("rejectionHandled",e):(t=d.onrejectionhandled)&&t({promise:e,reason:e._v})})},D=function(t){var n,i=this;if(!i._d){i._d=!0,i=i._w||i;try{if(i===t)throw S("Promise can't be resolved itself");(n=l(t))?M(function(){var e={_w:i,_d:!1};try{n.call(t,p(D,e,1),p(o,e,1))}catch(t){o.call(e,t)}}):(i._v=t,i._s=1,r(i,!1))}catch(t){o.call({_w:i,_d:!1},t)}}};f||(L=function(t){y(this,L,"Promise","_h"),g(t),a.call(this);try{t(p(D,this,1),p(o,this,1))}catch(t){o.call(this,t)}},(a=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(81)(L.prototype,{then:function(t,e){var n=C(b(this,L));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=R?T.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&r(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),c=function(){var t=new a;this.promise=t,this.resolve=p(D,t,1),this.reject=p(o,t,1)},_.f=C=function(t){return t===L||t===h?new c:s(t)}),m(m.G+m.W+m.F*!f,{Promise:L}),n(21)(L,"Promise"),n(83)("Promise"),h=n(0).Promise,m(m.S+m.F*!f,"Promise",{reject:function(t){var e=C(this);return(0,e.reject)(t),e.promise}}),m(m.S+m.F*(u||!f),"Promise",{resolve:function(t){return A(u&&this===h?L:this,t)}}),m(m.S+m.F*!(f&&n(71)(function(t){L.all(t).catch(i)})),"Promise",{all:function(t){var a=this,e=C(a),s=e.resolve,c=e.reject,n=E(function(){var i=[],r=0,o=1;x(t,!1,function(t){var e=r++,n=!1;i.push(void 0),o++,a.resolve(t).then(function(t){n||(n=!0,i[e]=t,--o||s(i))},c)}),--o||s(i)});return n.e&&c(n.v),e.promise},race:function(t){var e=this,n=C(e),i=n.reject,r=E(function(){x(t,!1,function(t){e.resolve(t).then(n.resolve,i)})});return r.e&&i(r.v),n.promise}})},function(t,e,n){"use strict";var i=n(84)(!0);n(33)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t=this._t,e=this._i;return e>=t.length?{value:void 0,done:!0}:(e=i(t,e),this._i+=e.length,{value:e,done:!1})})},function(t,e,n){"use strict";var i=n(3),r=n(0),o=n(1),a=n(40),s=n(37);i(i.P+i.R,"Promise",{finally:function(e){var n=a(this,r.Promise||o.Promise),t="function"==typeof e;return this.then(t?function(t){return s(n,e()).then(function(){return t})}:e,t?function(t){return s(n,e()).then(function(){throw t})}:e)}})},function(t,e,n){"use strict";var i=n(3),r=n(19),o=n(36);i(i.S,"Promise",{try:function(t){var e=r.f(this),t=o(t);return(t.e?e.reject:e.resolve)(t.v),e.promise}})},function(t,e,n){n(88);for(var i=n(1),r=n(5),o=n(8),a=n(2)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),c=0;c<s.length;c++){var h=s[c],l=i[h],l=l&&l.prototype;l&&!l[a]&&r(l,a,h),o[h]=o.Array}},function(t,e,n){(t.exports=n(26)(!1)).push([t.i,"div[data-v-09ad1f51]{cursor:pointer}",""])},function(t,e,n){(t.exports=n(26)(!1)).push([t.i,"div[data-v-66d382e3]{cursor:pointer}",""])},function(t,e,n){(t.exports=n(26)(!1)).push([t.i,".v-pano{width:100%;height:100%;margin:0;padding:0;border:0}",""])},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function r(e){if(h===setTimeout)return setTimeout(e,0);if((h===n||!h)&&setTimeout)return h=setTimeout,setTimeout(e,0);try{return h(e,0)}catch(t){try{return h.call(null,e,0)}catch(t){return h.call(this,e,0)}}}function o(){p&&u&&(p=!1,u.length?d=u.concat(d):f=-1,d.length&&a())}function a(){if(!p){var t=r(o);p=!0;for(var e=d.length;e;){for(u=d,d=[];++f<e;)u&&u[f].run();f=-1,e=d.length}u=null,p=!1,function(e){if(l===clearTimeout)return clearTimeout(e);if((l===i||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(e);try{l(e)}catch(t){try{return l.call(null,e)}catch(t){return l.call(this,e)}}}(t)}}function s(t,e){this.fun=t,this.array=e}function c(){}var h,l,t=t.exports={};!function(){try{h="function"==typeof setTimeout?setTimeout:n}catch(t){h=n}try{l="function"==typeof clearTimeout?clearTimeout:i}catch(t){l=i}}();var u,d=[],p=!1,f=-1;t.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];d.push(new s(t,e)),1!==d.length||p||r(a)},s.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=c,t.addListener=c,t.once=c,t.off=c,t.removeListener=c,t.removeAllListeners=c,t.emit=c,t.prependListener=c,t.prependOnceListener=c,t.listeners=function(t){return[]},t.binding=function(t){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(t){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},function(t,e){t.exports={render:function(){var t=this.$createElement;return(this._self._c||t)("div",{staticStyle:{width:"100%",height:"100%",margin:"0",border:"0",padding:"0"}})},staticRenderFns:[]}},function(t,e){t.exports={render:function(){var t=this.$createElement;return(this._self._c||t)("div",{staticStyle:{width:"100%",height:"100%",margin:"0",border:"0",padding:"0"}})},staticRenderFns:[]}},function(t,e){t.exports={render:function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"v-pano"})},staticRenderFns:[]}},function(t,e,n){var i=n(99);"string"==typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals),n(28)("4136a65b",i,!0)},function(t,e,n){var i=n(100);"string"==typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals),n(28)("356c544a",i,!0)},function(t,e,n){var i=n(101);"string"==typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals),n(28)("49e91b24",i,!0)},function(t,e){t.exports=function(t,e){for(var n=[],i={},r=0;r<e.length;r++){var o=e[r],a=o[0],o={id:t+":"+r,css:o[1],media:o[2],sourceMap:o[3]};i[a]?i[a].parts.push(o):n.push(i[a]={id:a,parts:[o]})}return n}}],i.c=o,i.i=function(t){return t},i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=51);function i(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return r[t].call(e.exports,e,e.exports,i),e.l=!0,e.exports}var r,o});

Home - Capital GMC Buick Regina

No data

Welcome to Capital GMC BUICK – REGINA

Thank you for choosing Capital GMC Buick | Regina, your premier certified Buick and GMC dealership proudly serving drivers in Regina and the surrounding communities. Whether you’re searching for a brand-new Buick or GMC vehicle or a meticulously inspected pre-owned model, we have a diverse selection to match your needs and lifestyle.

Beyond our impressive inventory, we offer a seamless and stress-free financing experience through our well-connected finance centre, where our team of experts is dedicated to securing the best loan or lease options for you, quickly, transparently, and hassle-free.

But our commitment to you doesn’t stop at the sale. Our state-of-the-art service centre is staffed with skilled Buick and GMC technicians who use the latest equipment and genuine OEM parts to keep your vehicle running at its best. From routine maintenance to complex repairs, we’ve got you covered.

Experience top-tier customer service, quality vehicles, and expert care, all in one place. Visit Capital GMC Buick | Regina today or call us at 306-205-8072 with any questions. We’re here to help!

Ask a Question