openwebrx-clone/htdocs/mathbox-bundle.min.js

33 lines
1013 KiB
JavaScript
Raw Permalink Normal View History

var THREE={REVISION:"71"};"object"==typeof module&&(module.exports=THREE),void 0===Math.sign&&(Math.sign=function(t){return 0>t?-1:t>0?1:+t}),THREE.log=function(){console.log.apply(console,arguments)},THREE.warn=function(){console.warn.apply(console,arguments)},THREE.error=function(){console.error.apply(console,arguments)},THREE.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2},THREE.CullFaceNone=0,THREE.CullFaceBack=1,THREE.CullFaceFront=2,THREE.CullFaceFrontBack=3,THREE.FrontFaceDirectionCW=0,THREE.FrontFaceDirectionCCW=1,THREE.BasicShadowMap=0,THREE.PCFShadowMap=1,THREE.PCFSoftShadowMap=2,THREE.FrontSide=0,THREE.BackSide=1,THREE.DoubleSide=2,THREE.NoShading=0,THREE.FlatShading=1,THREE.SmoothShading=2,THREE.NoColors=0,THREE.FaceColors=1,THREE.VertexColors=2,THREE.NoBlending=0,THREE.NormalBlending=1,THREE.AdditiveBlending=2,THREE.SubtractiveBlending=3,THREE.MultiplyBlending=4,THREE.CustomBlending=5,THREE.AddEquation=100,THREE.SubtractEquation=101,THREE.ReverseSubtractEquation=102,THREE.MinEquation=103,THREE.MaxEquation=104,THREE.ZeroFactor=200,THREE.OneFactor=201,THREE.SrcColorFactor=202,THREE.OneMinusSrcColorFactor=203,THREE.SrcAlphaFactor=204,THREE.OneMinusSrcAlphaFactor=205,THREE.DstAlphaFactor=206,THREE.OneMinusDstAlphaFactor=207,THREE.DstColorFactor=208,THREE.OneMinusDstColorFactor=209,THREE.SrcAlphaSaturateFactor=210,THREE.MultiplyOperation=0,THREE.MixOperation=1,THREE.AddOperation=2,THREE.UVMapping=300,THREE.CubeReflectionMapping=301,THREE.CubeRefractionMapping=302,THREE.EquirectangularReflectionMapping=303,THREE.EquirectangularRefractionMapping=304,THREE.SphericalReflectionMapping=305,THREE.RepeatWrapping=1e3,THREE.ClampToEdgeWrapping=1001,THREE.MirroredRepeatWrapping=1002,THREE.NearestFilter=1003,THREE.NearestMipMapNearestFilter=1004,THREE.NearestMipMapLinearFilter=1005,THREE.LinearFilter=1006,THREE.LinearMipMapNearestFilter=1007,THREE.LinearMipMapLinearFilter=1008,THREE.UnsignedByteType=1009,THREE.ByteType=1010,THREE.ShortType=1011,THREE.UnsignedShortType=1012,THREE.IntType=1013,THREE.UnsignedIntType=1014,THREE.FloatType=1015,THREE.HalfFloatType=1025,THREE.UnsignedShort4444Type=1016,THREE.UnsignedShort5551Type=1017,THREE.UnsignedShort565Type=1018,THREE.AlphaFormat=1019,THREE.RGBFormat=1020,THREE.RGBAFormat=1021,THREE.LuminanceFormat=1022,THREE.LuminanceAlphaFormat=1023,THREE.RGBEFormat=THREE.RGBAFormat,THREE.RGB_S3TC_DXT1_Format=2001,THREE.RGBA_S3TC_DXT1_Format=2002,THREE.RGBA_S3TC_DXT3_Format=2003,THREE.RGBA_S3TC_DXT5_Format=2004,THREE.RGB_PVRTC_4BPPV1_Format=2100,THREE.RGB_PVRTC_2BPPV1_Format=2101,THREE.RGBA_PVRTC_4BPPV1_Format=2102,THREE.RGBA_PVRTC_2BPPV1_Format=2103,THREE.Projector=function(){THREE.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(t,e){THREE.warn("THREE.Projector: .projectVector() is now vector.project()."),t.project(e)},this.unprojectVector=function(t,e){THREE.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),t.unproject(e)},this.pickingRay=function(t,e){THREE.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}},THREE.CanvasRenderer=function(){THREE.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),this.domElement=document.createElement("canvas"),this.clear=function(){},this.render=function(){},this.setClearColor=function(){},this.setSize=function(){}},THREE.Color=function(t){return 3===arguments.length?this.setRGB(arguments[0],arguments[1],arguments[2]):this.set(t)},THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,set:function(t){return t instanceof THREE.Color?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(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){if(0===e)this.r=this.g=this.b=n;else{var r=function(t,e,n){return 0>n&&(n+=1),n>1&&(n-=1),1/6>n?t+6*(e-t)*n:.5>n?e:2/3>n?t+6*(e-t)*(2/3-n):t},i=.5>=n?n*(1+e):n+e-n*e,o=2*n-i;this.r=r(o,i,t+1/3),this.g=r(o,i,t),this.b
},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}},THREE.Euler=function(t,e,n,r){this._x=t||0,this._y=e||0,this._z=n||0,this._order=r||THREE.Euler.DefaultOrder},THREE.Euler.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],THREE.Euler.DefaultOrder="XYZ",THREE.Euler.prototype={constructor:THREE.Euler,_x:0,_y:0,_z:0,_order:THREE.Euler.DefaultOrder,get x(){return this._x},set x(t){this._x=t,this.onChangeCallback()},get y(){return this._y},set y(t){this._y=t,this.onChangeCallback()},get z(){return this._z},set z(t){this._z=t,this.onChangeCallback()},get order(){return this._order},set order(t){this._order=t,this.onChangeCallback()},set:function(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._order=r||this._order,this.onChangeCallback(),this},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 r=THREE.Math.clamp,i=t.elements,o=i[0],s=i[4],a=i[8],u=i[1],h=i[5],l=i[9],c=i[2],p=i[6],f=i[10];return e=e||this._order,"XYZ"===e?(this._y=Math.asin(r(a,-1,1)),Math.abs(a)<.99999?(this._x=Math.atan2(-l,f),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(p,h),this._z=0)):"YXZ"===e?(this._x=Math.asin(-r(l,-1,1)),Math.abs(l)<.99999?(this._y=Math.atan2(a,f),this._z=Math.atan2(u,h)):(this._y=Math.atan2(-c,o),this._z=0)):"ZXY"===e?(this._x=Math.asin(r(p,-1,1)),Math.abs(p)<.99999?(this._y=Math.atan2(-c,f),this._z=Math.atan2(-s,h)):(this._y=0,this._z=Math.atan2(u,o))):"ZYX"===e?(this._y=Math.asin(-r(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(p,f),this._z=Math.atan2(u,o)):(this._x=0,this._z=Math.atan2(-s,h))):"YZX"===e?(this._z=Math.asin(r(u,-1,1)),Math.abs(u)<.99999?(this._x=Math.atan2(-l,h),this._y=Math.atan2(-c,o)):(this._x=0,this._y=Math.atan2(a,f))):"XZY"===e?(this._z=Math.asin(-r(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(p,h),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-l,f),this._y=0)):THREE.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,n!==!1&&this.onChangeCallback(),this},setFromQuaternion:function(){var t;return function(e,n,r){return void 0===t&&(t=new THREE.Matrix4),t.makeRotationFromQuaternion(e),this.setFromRotationMatrix(t,n,r),this}}(),setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(){var t=new THREE.Quaternion;return function(e){t.setFromEuler(this),this.setFromQuaternion(t,e)}}(),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 THREE.Vector3(this._x,this._y,this._z)},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){},clone:function(){return new THREE.Euler(this._x,this._y,this._z,this._order)}},THREE.Line3=function(t,e){this.start=void 0!==t?t:new THREE.Vector3,this.end=void 0!==e?e:new THREE.Vector3},THREE.Line3.prototype={constructor:THREE.Line3,set:function(t,e){return this.start.copy(t),this.end.copy(e),this},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},center:function(t){var e=t||new THREE.Vector3;return e.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){var e=t||new THREE.Vector3;return e.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){var n=e||new THREE.Vector3;return this.delta(n).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(){var t=new THREE.Vector3,e=new THREE.Vector3;return function(n,r){t.subVectors(n,this.start),e.subVectors(this.end,this.start);var i=e.dot(e),o=e.dot(t),s=o/i;return r&&(s=THREE.Math.clamp(s,0,1)),s}}(),closestPointToPoint:function(t,e,n){var r=this.closestPo
}},THREE.Plane=function(t,e){this.normal=void 0!==t?t:new THREE.Vector3(1,0,0),this.constant=void 0!==e?e:0},THREE.Plane.prototype={constructor:THREE.Plane,set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,n,r){return this.normal.set(t,e,n),this.constant=r,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(){var t=new THREE.Vector3,e=new THREE.Vector3;return function(n,r,i){var o=t.subVectors(i,r).cross(e.subVectors(n,r)).normalize();return this.setFromNormalAndCoplanarPoint(o,n),this}}(),copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return this.orthoPoint(t,e).sub(t).negate()},orthoPoint:function(t,e){var n=this.distanceToPoint(t),r=e||new THREE.Vector3;return r.copy(this.normal).multiplyScalar(n)},isIntersectionLine:function(t){var e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return 0>e&&n>0||0>n&&e>0},intersectLine:function(){var t=new THREE.Vector3;return function(e,n){var r=n||new THREE.Vector3,i=e.delta(t),o=this.normal.dot(i);if(0==o)return 0==this.distanceToPoint(e.start)?r.copy(e.start):void 0;var s=-(e.start.dot(this.normal)+this.constant)/o;return 0>s||s>1?void 0:r.copy(i).multiplyScalar(s).add(e.start)}}(),coplanarPoint:function(t){var e=t||new THREE.Vector3;return e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var t=new THREE.Vector3,e=new THREE.Vector3,n=new THREE.Matrix3;return function(r,i){var o=i||n.getNormalMatrix(r),s=t.copy(this.normal).applyMatrix3(o),a=this.coplanarPoint(e);return a.applyMatrix4(r),this.setFromNormalAndCoplanarPoint(s,a),this}}(),translate:function(t){return this.constant=this.constant-t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant==this.constant},clone:function(){return(new THREE.Plane).copy(this)}},THREE.Math={generateUUID:function(){var t,e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),n=new Array(36),r=0;return function(){for(var i=0;36>i;i++)8==i||13==i||18==i||23==i?n[i]="-":14==i?n[i]="4":(2>=r&&(r=33554432+16777216*Math.random()|0),t=15&r,r>>=4,n[i]=e[19==i?3&t|8:t]);return n.join("")}}(),clamp:function(t,e,n){return e>t?e:t>n?n:t},clampBottom:function(t,e){return e>t?e:t},mapLinear:function(t,e,n,r,i){return r+(t-e)*(i-r)/(n-e)},smoothstep:function(t,e,n){return e>=t?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))},smootherstep:function(t,e,n){return e>=t?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(6*t-15)+10))},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(t,e){return Math.floor(this.randFloat(t,e))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(){var t=Math.PI/180;return function(e){return e*t}}(),radToDeg:function(){var t=180/Math.PI;return function(e){return e*t}}(),isPowerOfTwo:function(t){return 0===(t&t-1)&&0!==t},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,t++,t}},THREE.Spline=function(t){function e(t,e,n,r,i,o,s){var a=.5*(n-t),u=.5*(r-e);return(2*(e-n)+a+u)*s+(-3*(e-n)-2*a-u)*o+a*i+e}this.points=t;var n,r,i,o,s,a,u,h,l,c=[],p={x:0,y:0,z:0};this.initFromArray=function(t){this.points=[];for(var e=0;e<t.length;e++)this.points[e]={x:t[e][0],y:t[e][1],z:t[e][2]}},this.getPoint=function(t){return n=(this.points.length-1)*t,r=Math.floor(n),i=n-r,c[0]=0===r?r:r-1,c[1]=r,c[2]=r>this.points.length-2?this.points.length-1:r+1,c[3]=r>this.points.length-3?this.points.length-1:r+2,a=this.points[c[0]],u=this.points[c[1]],h=this.points[c[2]],l=this.points[c[3]],o=i*i,s=i*o,p.x=e(a.x,u.x,h.x,l.x,i,o,s),p
for(var i in e){var o=e[i],s=Array.prototype.slice.call(o.array);t.data.attributes[i]={itemSize:o.itemSize,type:o.array.constructor.name,array:s}}return n.length>0&&(t.data.offsets=JSON.parse(JSON.stringify(n))),null!==r&&(t.data.boundingSphere={center:r.center.toArray(),radius:r.radius}),t},clone:function(){var t=new THREE.BufferGeometry;for(var e in this.attributes){var n=this.attributes[e];t.addAttribute(e,n.clone())}for(var r=0,i=this.offsets.length;i>r;r++){var o=this.offsets[r];t.offsets.push({start:o.start,index:o.index,count:o.count})}return t},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype),THREE.Geometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphColors=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.hasTangents=!1,this.dynamic=!0,this.verticesNeedUpdate=!1,this.elementsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.tangentsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1},THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(t){for(var e=(new THREE.Matrix3).getNormalMatrix(t),n=0,r=this.vertices.length;r>n;n++){var i=this.vertices[n];i.applyMatrix4(t)}for(var n=0,r=this.faces.length;r>n;n++){var o=this.faces[n];o.normal.applyMatrix3(e).normalize();for(var s=0,a=o.vertexNormals.length;a>s;s++)o.vertexNormals[s].applyMatrix3(e).normalize()}null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0},fromBufferGeometry:function(t){for(var e=this,n=t.attributes,r=n.position.array,i=void 0!==n.index?n.index.array:void 0,o=void 0!==n.normal?n.normal.array:void 0,s=void 0!==n.color?n.color.array:void 0,a=void 0!==n.uv?n.uv.array:void 0,u=[],h=[],l=0,c=0;l<r.length;l+=3,c+=2)e.vertices.push(new THREE.Vector3(r[l],r[l+1],r[l+2])),void 0!==o&&u.push(new THREE.Vector3(o[l],o[l+1],o[l+2])),void 0!==s&&e.colors.push(new THREE.Color(s[l],s[l+1],s[l+2])),void 0!==a&&h.push(new THREE.Vector2(a[c],a[c+1]));var p=function(t,n,r){var i=void 0!==o?[u[t].clone(),u[n].clone(),u[r].clone()]:[],l=void 0!==s?[e.colors[t].clone(),e.colors[n].clone(),e.colors[r].clone()]:[];e.faces.push(new THREE.Face3(t,n,r,i,l)),void 0!==a&&e.faceVertexUvs[0].push([h[t].clone(),h[n].clone(),h[r].clone()])};if(void 0!==i){var f=t.drawcalls;if(f.length>0)for(var l=0;l<f.length;l++)for(var d=f[l],m=d.start,v=d.count,g=d.index,c=m,E=m+v;E>c;c+=3)p(g+i[c],g+i[c+1],g+i[c+2]);else for(var l=0;l<i.length;l+=3)p(i[l],i[l+1],i[l+2])}else for(var l=0;l<r.length/3;l+=3)p(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:function(){this.computeBoundingBox();var t=this.boundingBox.center().negate();return this.applyMatrix((new THREE.Matrix4).setPosition(t)),t},computeFaceNormals:function(){for(var t=new THREE.Vector3,e=new THREE.Vector3,n=0,r=this.faces.length;r>n;n++){var i=this.faces[n],o=this.vertices[i.a],s=this.vertices[i.b],a=this.vertices[i.c];t.subVectors(a,s),e.subVectors(o,s),t.cross(e),t.normalize(),i.normal.copy(t)}},computeVertexNormals:function(t){var e,n,r,i,o,s;for(s=new Array(this.vertices.length),e=0,n=this.vertices.length;n>e;e++)s[e]=new THREE.Vector3;if(t){var a,u,h,l=new THREE.Vector3,c=new THREE.Vector3;for(r=0,i=this.faces.length;i>r;r++)o=this.faces[r],a=this.vertices[o.a],u=this.vertices[o.b],h=this.vertices[o.c],l.subVectors(h,u),c.subVectors(a,u),l.cross(c),s[o.a].add(l),s[o.b].add(l),s[o.c].add(l)}else for(r=0,i=this.faces.length;i>r;r++)o=this.faces[r],s[o.a].add(o.normal),s[o.b].add(o.normal),s[o.c].add(o.normal);for(e=0,n=this.vertices.length
o.morphColors[n].name=t.morphColors[n].name,o.morphColors[n].colors=[],p=o.morphColors[n].colors,f=t.morphColors[n].colors,l=0,c=f.length;c>l;l+=3)d=new THREE.Color(16755200),d.setRGB(f[l],f[l+1],f[l+2]),p.push(d)}}var o=new THREE.Geometry,s=void 0!==t.scale?1/t.scale:1;if(n(s),r(),i(s),o.computeFaceNormals(),o.computeBoundingSphere(),void 0===t.materials||0===t.materials.length)return{geometry:o};var a=this.initMaterials(t.materials,e);return this.needsTangents(a)&&o.computeTangents(),{geometry:o,materials:a}},THREE.LoadingManager=function(t,e,n){var r=this,i=0,o=0;this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){o++},this.itemEnd=function(t){i++,void 0!==r.onProgress&&r.onProgress(t,i,o),i===o&&void 0!==r.onLoad&&r.onLoad()}},THREE.DefaultLoadingManager=new THREE.LoadingManager,THREE.BufferGeometryLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager},THREE.BufferGeometryLoader.prototype={constructor:THREE.BufferGeometryLoader,load:function(t,e,n,r){var i=this,o=new THREE.XHRLoader(i.manager);o.setCrossOrigin(this.crossOrigin),o.load(t,function(t){e(i.parse(JSON.parse(t)))},n,r)},setCrossOrigin:function(t){this.crossOrigin=t},parse:function(t){var e=new THREE.BufferGeometry,n=t.data.attributes;for(var r in n){var i=n[r],o=new self[i.type](i.array);e.addAttribute(r,new THREE.BufferAttribute(o,i.itemSize))}var s=t.data.offsets;void 0!==s&&(e.offsets=JSON.parse(JSON.stringify(s)));var a=t.data.boundingSphere;if(void 0!==a){var u=new THREE.Vector3;void 0!==a.center&&u.fromArray(a.center),e.boundingSphere=new THREE.Sphere(u,a.radius)}return e}},THREE.MaterialLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager},THREE.MaterialLoader.prototype={constructor:THREE.MaterialLoader,load:function(t,e,n,r){var i=this,o=new THREE.XHRLoader(i.manager);o.setCrossOrigin(this.crossOrigin),o.load(t,function(t){e(i.parse(JSON.parse(t)))},n,r)},setCrossOrigin:function(t){this.crossOrigin=t},parse:function(t){var e=new THREE[t.type];if(void 0!==t.color&&e.color.setHex(t.color),void 0!==t.emissive&&e.emissive.setHex(t.emissive),void 0!==t.specular&&e.specular.setHex(t.specular),void 0!==t.shininess&&(e.shininess=t.shininess),void 0!==t.uniforms&&(e.uniforms=t.uniforms),void 0!==t.vertexShader&&(e.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(e.fragmentShader=t.fragmentShader),void 0!==t.vertexColors&&(e.vertexColors=t.vertexColors),void 0!==t.shading&&(e.shading=t.shading),void 0!==t.blending&&(e.blending=t.blending),void 0!==t.side&&(e.side=t.side),void 0!==t.opacity&&(e.opacity=t.opacity),void 0!==t.transparent&&(e.transparent=t.transparent),void 0!==t.wireframe&&(e.wireframe=t.wireframe),void 0!==t.size&&(e.size=t.size),void 0!==t.sizeAttenuation&&(e.sizeAttenuation=t.sizeAttenuation),void 0!==t.materials)for(var n=0,r=t.materials.length;r>n;n++)e.materials.push(this.parse(t.materials[n]));return e}},THREE.ObjectLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager,this.texturePath=""},THREE.ObjectLoader.prototype={constructor:THREE.ObjectLoader,load:function(t,e,n,r){""===this.texturePath&&(this.texturePath=t.substring(0,t.lastIndexOf("/")+1));var i=this,o=new THREE.XHRLoader(i.manager);o.setCrossOrigin(this.crossOrigin),o.load(t,function(t){i.parse(JSON.parse(t),e)},n,r)},setTexturePath:function(t){this.texturePath=t},setCrossOrigin:function(t){this.crossOrigin=t},parse:function(t,e){var n=this.parseGeometries(t.geometries),r=this.parseImages(t.images,function(){void 0!==e&&e(s)}),i=this.parseTextures(t.textures,r),o=this.parseMaterials(t.materials,i),s=this.parseObject(t.object,n,o);return(void 0===t.images||0===t.images.length)&&void 0!==e&&e(s),s},parseGeometries:function(t){var e={};if(void 0!==t)for(var n=new THREE.JSONLoader,r=new THREE.BufferGeometryLoader,i=0,o=t.length;o>i;i++){var s,a=t[i];switch(a.type){case"PlaneGeometry":case"PlaneBufferGeometry":s=new THREE[a.type](a.width,a.height,a.widthSegments,a.heightSegments);break;case"BoxGeometry":case"CubeGeometry":s=new THREE.BoxGeometry(a.width,a.height,a.depth,a.widthSegments,a.heightS
if(null===a.boundingSphere&&a.computeBoundingSphere(),n.copy(a.boundingSphere),n.applyMatrix4(this.matrixWorld),r.ray.isIntersectionSphere(n)!==!1){t.getInverse(this.matrixWorld),e.copy(r.ray).applyMatrix4(t);var u=new THREE.Vector3,h=new THREE.Vector3,l=new THREE.Vector3,c=new THREE.Vector3,p=this.mode===THREE.LineStrip?1:2;if(a instanceof THREE.BufferGeometry){var f=a.attributes;if(void 0!==f.index){var d=f.index.array,m=f.position.array,v=a.offsets;0===v.length&&(v=[{start:0,count:d.length,index:0}]);for(var g=0;g<v.length;g++)for(var E=v[g].start,y=v[g].count,_=v[g].index,b=E;E+y-1>b;b+=p){var T=_+d[b],x=_+d[b+1];u.fromArray(m,3*T),h.fromArray(m,3*x);var w=e.distanceSqToSegment(u,h,c,l);if(!(w>s)){var R=e.origin.distanceTo(c);R<r.near||R>r.far||i.push({distance:R,point:l.clone().applyMatrix4(this.matrixWorld),index:b,offsetIndex:g,face:null,faceIndex:null,object:this})}}}else for(var m=f.position.array,b=0;b<m.length/3-1;b+=p){u.fromArray(m,3*b),h.fromArray(m,3*b+3);var w=e.distanceSqToSegment(u,h,c,l);if(!(w>s)){var R=e.origin.distanceTo(c);R<r.near||R>r.far||i.push({distance:R,point:l.clone().applyMatrix4(this.matrixWorld),index:b,face:null,faceIndex:null,object:this})}}}else if(a instanceof THREE.Geometry)for(var H=a.vertices,M=H.length,b=0;M-1>b;b+=p){var w=e.distanceSqToSegment(H[b],H[b+1],c,l);if(!(w>s)){var R=e.origin.distanceTo(c);R<r.near||R>r.far||i.push({distance:R,point:l.clone().applyMatrix4(this.matrixWorld),index:b,face:null,faceIndex:null,object:this})}}}}}(),THREE.Line.prototype.clone=function(t){return void 0===t&&(t=new THREE.Line(this.geometry,this.material,this.mode)),THREE.Object3D.prototype.clone.call(this,t),t},THREE.Mesh=function(t,e){THREE.Object3D.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new THREE.Geometry,this.material=void 0!==e?e:new THREE.MeshBasicMaterial({color:16777215*Math.random()}),this.updateMorphTargets()},THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype),THREE.Mesh.prototype.constructor=THREE.Mesh,THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&this.geometry.morphTargets.length>0){this.morphTargetBase=-1,this.morphTargetForcedOrder=[],this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var t=0,e=this.geometry.morphTargets.length;e>t;t++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[t].name]=t}},THREE.Mesh.prototype.getMorphTargetIndexByName=function(t){return void 0!==this.morphTargetDictionary[t]?this.morphTargetDictionary[t]:(THREE.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+t+" does not exist. Returning 0."),0)},THREE.Mesh.prototype.raycast=function(){var t=new THREE.Matrix4,e=new THREE.Ray,n=new THREE.Sphere,r=new THREE.Vector3,i=new THREE.Vector3,o=new THREE.Vector3;return function(s,a){var u=this.geometry;if(null===u.boundingSphere&&u.computeBoundingSphere(),n.copy(u.boundingSphere),n.applyMatrix4(this.matrixWorld),s.ray.isIntersectionSphere(n)!==!1&&(t.getInverse(this.matrixWorld),e.copy(s.ray).applyMatrix4(t),null===u.boundingBox||e.isIntersectionBox(u.boundingBox)!==!1))if(u instanceof THREE.BufferGeometry){var h=this.material;if(void 0===h)return;var l,c,p,f=u.attributes,d=s.precision;if(void 0!==f.index){var m=f.index.array,v=f.position.array,g=u.offsets;0===g.length&&(g=[{start:0,count:m.length,index:0}]);for(var E=0,y=g.length;y>E;++E)for(var _=g[E].start,b=g[E].count,T=g[E].index,x=_,w=_+b;w>x;x+=3){if(l=T+m[x],c=T+m[x+1],p=T+m[x+2],r.fromArray(v,3*l),i.fromArray(v,3*c),o.fromArray(v,3*p),h.side===THREE.BackSide)var R=e.intersectTriangle(o,i,r,!0);else var R=e.intersectTriangle(r,i,o,h.side!==THREE.DoubleSide);if(null!==R){R.applyMatrix4(this.matrixWorld);var H=s.ray.origin.distanceTo(R);d>H||H<s.near||H>s.far||a.push({distance:H,point:R,face:new THREE.Face3(l,c,p,THREE.Triangle.normal(r,i,o)),faceIndex:null,object:this})}}}else for(var v=f.position.array,x=0,M=0,w=v.length;w>x;x+=3,M+=9){if(l=x,c=x+1,p=x+2,r.fromArray(v,M),i.fromArray(v,M+3),o.fromArray(v,M+6),h.side===THREE.BackSide)var R=e.intersectTriangle(o,i,r,!0);else va
THREE.ShaderChunk.fog_pars_fragment="#ifdef USE_FOG\n\n uniform vec3 fogColor;\n\n #ifdef FOG_EXP2\n\n uniform float fogDensity;\n\n #else\n\n uniform float fogNear;\n uniform float fogFar;\n #endif\n\n#endif",THREE.ShaderChunk.morphnormal_vertex="#ifdef USE_MORPHNORMALS\n\n vec3 morphedNormal = vec3( 0.0 );\n\n morphedNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n morphedNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n morphedNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n morphedNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n\n morphedNormal += normal;\n\n#endif",THREE.ShaderChunk.envmap_pars_fragment="#ifdef USE_ENVMAP\n\n uniform float reflectivity;\n #ifdef ENVMAP_TYPE_CUBE\n uniform samplerCube envMap;\n #else\n uniform sampler2D envMap;\n #endif\n uniform float flipEnvMap;\n\n #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n uniform float refractionRatio;\n\n #else\n\n varying vec3 vReflect;\n\n #endif\n\n#endif\n",THREE.ShaderChunk.logdepthbuf_fragment="#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\n gl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n\n#endif",THREE.ShaderChunk.normalmap_pars_fragment="#ifdef USE_NORMALMAP\n\n uniform sampler2D normalMap;\n uniform vec2 normalScale;\n\n // Per-Pixel Tangent Space Normal Mapping\n // http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\n\n vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\n vec3 q0 = dFdx( eye_pos.xyz );\n vec3 q1 = dFdy( eye_pos.xyz );\n vec2 st0 = dFdx( vUv.st );\n vec2 st1 = dFdy( vUv.st );\n\n vec3 S = normalize( q0 * st1.t - q1 * st0.t );\n vec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n vec3 N = normalize( surf_norm );\n\n vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n mapN.xy = normalScale * mapN.xy;\n mat3 tsn = mat3( S, T, N );\n return normalize( tsn * mapN );\n\n }\n\n#endif\n",THREE.ShaderChunk.lights_phong_pars_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n varying vec3 vWorldPosition;\n\n#endif\n",THREE.ShaderChunk.lightmap_pars_fragment="#ifdef USE_LIGHTMAP\n\n varying vec2 vUv2;\n uniform sampler2D lightMap;\n\n#endif",THREE.ShaderChunk.shadowmap_vertex="#ifdef USE_SHADOWMAP\n\n for( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n vShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;\n\n }\n\n#endif",THREE.ShaderChunk.lights_phong_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n vWorldPosition = worldPosition.xyz;\n\n#endif",THREE.ShaderChunk.map_fragment="#ifdef USE_MAP\n\n vec4 texelColor = texture2D( map, vUv );\n\n texelColor.xyz = inputToLinear( texelColor.xyz );\n\n diffuseColor *= texelColor;\n\n#endif",THREE.ShaderChunk.lightmap_vertex="#ifdef USE_LIGHTMAP\n\n vUv2 = uv2;\n\n#endif",THREE.ShaderChunk.map_particle_fragment="#ifdef USE_MAP\n\n diffuseColor *= texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\n#endif\n",THREE.ShaderChunk.color_pars_fragment="#ifdef USE_COLOR\n\n varying vec3 vColor;\n\n#endif\n",THREE.ShaderChunk.color_vertex="#ifdef USE_COLOR\n\n vColor.xyz = inputToLinear( color.xyz );\n\n#endif",THREE.ShaderChunk.skinning_vertex="#ifdef USE_SKINNING\n\n #ifdef USE_MORPHTARGETS\n\n vec4 skinVertex = bindMatrix * vec4( morphed, 1.0 );\n\n #else\n\n vec4 skinVertex = bindMatrix * vec4( position, 1.0 );\n\n #endif\n\n vec4 skinned = vec4( 0.0 );\n skinned += boneMatX * skinVertex * skinWeight.x;\n skinned += boneMatY * skinVertex * skinWeight.y;\n skinned += boneMatZ * skinVertex * skinWeight.z;\n skinned += boneMatW * skinVertex * skinWeight.w;\n skinned = bindMatrixInverse * skinned;\n\n#endif\n",THREE.ShaderChunk.envmap_pars_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n varying vec3 vReflect;\n\n uniform float refractionRatio;\n\n#endif\n",THREE.ShaderChunk.linear_to_gamma_fragment="\n outgoingLight = linearT
fragmentShader:["#define PHONG","uniform vec3 diffuse;","uniform vec3 emissive;","uniform vec3 specular;","uniform float shininess;","uniform float opacity;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.alphamap_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.lights_phong_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.bumpmap_pars_fragment,THREE.ShaderChunk.normalmap_pars_fragment,THREE.ShaderChunk.specularmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {"," vec3 outgoingLight = vec3( 0.0 );"," vec4 diffuseColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.alphamap_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.specularmap_fragment,THREE.ShaderChunk.lights_phong_fragment,THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment," gl_FragColor = vec4( outgoingLight, diffuseColor.a );","}"].join("\n")},particle_basic:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.particle,THREE.UniformsLib.shadowmap]),vertexShader:["uniform float size;","uniform float scale;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex," vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );"," #ifdef USE_SIZEATTENUATION"," gl_PointSize = size * ( scale / length( mvPosition.xyz ) );"," #else"," gl_PointSize = size;"," #endif"," gl_Position = projectionMatrix * mvPosition;",THREE.ShaderChunk.logdepthbuf_vertex,THREE.ShaderChunk.worldpos_vertex,THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 psColor;","uniform float opacity;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_particle_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {"," vec3 outgoingLight = vec3( 0.0 );"," vec4 diffuseColor = vec4( psColor, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.alphatest_fragment," outgoingLight = diffuseColor.rgb;",THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment," gl_FragColor = vec4( outgoingLight, diffuseColor.a );","}"].join("\n")},dashed:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.fog,{scale:{type:"f",value:1},dashSize:{type:"f",value:1},totalSize:{type:"f",value:2}}]),vertexShader:["uniform float scale;","attribute float lineDistance;","varying float vLineDistance;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex," vLineDistance = scale * lineDistance;"," vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );"," gl_Position = projectionMatrix * mvPosition;",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;","uniform float opacity;","uniform float dashSize;","uniform float totalSize;","varying float vLineDistance;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {"," if ( mod( vLineDistance, totalSize ) > dashSize ) {"," discard;"," }"," vec3 outgoingLight = vec3( 0.0 );"," vec4 diffuseColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.color_fragment," outgoingLight = diffuseColor.rgb;",THREE.ShaderChunk.fog_fragment," gl_FragColor = vec4( outgoingLight, diffuseColor.a );","}"].join("\n")},depth:{uniforms:{mNear:{type:"f",value:1},mFar:
shadowMapCascade:Ct.shadowMapCascade,alphaTest:t.alphaTest,metal:t.metal,wrapAround:t.wrapAround,doubleSided:t.side===THREE.DoubleSide,flipSided:t.side===THREE.BackSide},l=[];if(i?l.push(i):(l.push(t.fragmentShader),l.push(t.vertexShader)),void 0!==t.defines)for(var c in t.defines)l.push(c),l.push(t.defines[c]);for(var c in h)l.push(c),l.push(h[c]);for(var p,f=l.join(),d=0,m=Pt.length;m>d;d++){var v=Pt[d];if(v.code===f){p=v,p.usedTimes++;break}}void 0===p&&(p=new THREE.WebGLProgram(Ct,f,t,h),Pt.push(p),Ct.info.memory.programs=Pt.length),t.program=p;var g=p.attributes;if(t.morphTargets){t.numSupportedMorphTargets=0;for(var E,y="morphTarget",_=0;_<Ct.maxMorphTargets;_++)E=y+_,g[E]>=0&&t.numSupportedMorphTargets++}if(t.morphNormals){t.numSupportedMorphNormals=0;var E,y="morphNormal";for(_=0;_<Ct.maxMorphNormals;_++)E=y+_,g[E]>=0&&t.numSupportedMorphNormals++}t.uniformsList=[];for(var b in t.__webglShader.uniforms){var T=t.program.uniforms[b];T&&t.uniformsList.push([t.__webglShader.uniforms[b],T])}}function z(t){t.transparent===!0?$t.setBlending(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha):$t.setBlending(THREE.NoBlending),$t.setDepthTest(t.depthTest),$t.setDepthWrite(t.depthWrite),$t.setColorWrite(t.colorWrite),$t.setPolygonOffset(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)}function O(t,e,n,r,i){Ut=0,r.needsUpdate&&(r.program&&ke(r),L(r,e,n,i),r.needsUpdate=!1),r.morphTargets&&(i.__webglMorphTargetInfluences||(i.__webglMorphTargetInfluences=new Float32Array(Ct.maxMorphTargets)));var o=!1,s=!1,a=!1,u=r.program,h=u.uniforms,l=r.__webglShader.uniforms;if(u.id!==Lt&&(At.useProgram(u.program),Lt=u.id,o=!0,s=!0,a=!0),r.id!==Ot&&(-1===Ot&&(a=!0),Ot=r.id,s=!0),(o||t!==Ft)&&(At.uniformMatrix4fv(h.projectionMatrix,!1,t.projectionMatrix.elements),_t&&At.uniform1f(h.logDepthBufFC,2/(Math.log(t.far+1)/Math.LN2)),t!==Ft&&(Ft=t),(r instanceof THREE.ShaderMaterial||r instanceof THREE.MeshPhongMaterial||r.envMap)&&null!==h.cameraPosition&&(Xt.setFromMatrixPosition(t.matrixWorld),At.uniform3f(h.cameraPosition,Xt.x,Xt.y,Xt.z)),(r instanceof THREE.MeshPhongMaterial||r instanceof THREE.MeshLambertMaterial||r instanceof THREE.MeshBasicMaterial||r instanceof THREE.ShaderMaterial||r.skinning)&&null!==h.viewMatrix&&At.uniformMatrix4fv(h.viewMatrix,!1,t.matrixWorldInverse.elements)),r.skinning)if(i.bindMatrix&&null!==h.bindMatrix&&At.uniformMatrix4fv(h.bindMatrix,!1,i.bindMatrix.elements),i.bindMatrixInverse&&null!==h.bindMatrixInverse&&At.uniformMatrix4fv(h.bindMatrixInverse,!1,i.bindMatrixInverse.elements),he&&i.skeleton&&i.skeleton.useVertexTexture){if(null!==h.boneTexture){var c=X();At.uniform1i(h.boneTexture,c),Ct.setTexture(i.skeleton.boneTexture,c)}null!==h.boneTextureWidth&&At.uniform1i(h.boneTextureWidth,i.skeleton.boneTextureWidth),null!==h.boneTextureHeight&&At.uniform1i(h.boneTextureHeight,i.skeleton.boneTextureHeight)}else i.skeleton&&i.skeleton.boneMatrices&&null!==h.boneGlobalMatrices&&At.uniformMatrix4fv(h.boneGlobalMatrices,!1,i.skeleton.boneMatrices);return s&&(n&&r.fog&&N(l,n),(r instanceof THREE.MeshPhongMaterial||r instanceof THREE.MeshLambertMaterial||r.lights)&&(Zt&&(a=!0,Q(e),Zt=!1),a?(j(l,Kt),G(l,!0)):G(l,!1)),(r instanceof THREE.MeshBasicMaterial||r instanceof THREE.MeshLambertMaterial||r instanceof THREE.MeshPhongMaterial)&&D(l,r),r instanceof THREE.LineBasicMaterial?F(l,r):r instanceof THREE.LineDashedMaterial?(F(l,r),U(l,r)):r instanceof THREE.PointCloudMaterial?B(l,r):r instanceof THREE.MeshPhongMaterial?V(l,r):r instanceof THREE.MeshLambertMaterial?I(l,r):r instanceof THREE.MeshDepthMaterial?(l.mNear.value=t.near,l.mFar.value=t.far,l.opacity.value=r.opacity):r instanceof THREE.MeshNormalMaterial&&(l.opacity.value=r.opacity),i.receiveShadow&&!r._shadowPass&&W(l,e),Y(r.uniformsList)),q(h,i),null!==h.modelMatrix&&At.uniformMatrix4fv(h.modelMatrix,!1,i.matrixWorld.elements),u}function D(t,e){t.opacity.value=e.opacity,t.diffuse.value=e.color,t.map.value=e.map,t.lightMap.value=e.lightMap,t.specularMap.value=e.specularMap,t.alphaMap.value=e.alphaMap,e.b
var y=i.attributes.position;At.drawArrays(l,0,y.array.length/y.itemSize),Ct.info.render.calls++,Ct.info.render.vertices+=y.array.length/y.itemSize,Ct.info.render.faces+=y.array.length/(3*y.itemSize)}}else if(o instanceof THREE.PointCloud){var l=At.POINTS,c=i.attributes.index;if(c){var p,d;c.array instanceof Uint32Array&&te.get("OES_element_index_uint")?(p=At.UNSIGNED_INT,d=4):(p=At.UNSIGNED_SHORT,d=2);var m=i.offsets;if(0===m.length)a&&(f(r,s,i,0),At.bindBuffer(At.ELEMENT_ARRAY_BUFFER,c.buffer)),At.drawElements(l,c.array.length,p,0),Ct.info.render.calls++,Ct.info.render.points+=c.array.length;else{m.length>1&&(a=!0);for(var v=0,g=m.length;g>v;v++){var E=m[v].index;a&&(f(r,s,i,E),At.bindBuffer(At.ELEMENT_ARRAY_BUFFER,c.buffer)),At.drawElements(l,m[v].count,p,m[v].start*d),Ct.info.render.calls++,Ct.info.render.points+=m[v].count}}}else{a&&f(r,s,i,0);var y=i.attributes.position,m=i.offsets;if(0===m.length)At.drawArrays(l,0,y.array.length/3),Ct.info.render.calls++,Ct.info.render.points+=y.array.length/3;else for(var v=0,g=m.length;g>v;v++)At.drawArrays(l,m[v].index,m[v].count),Ct.info.render.calls++,Ct.info.render.points+=m[v].count}}else if(o instanceof THREE.Line){var l=o.mode===THREE.LineStrip?At.LINE_STRIP:At.LINES;$t.setLineWidth(r.linewidth*pt);var c=i.attributes.index;if(c){var p,d;c.array instanceof Uint32Array?(p=At.UNSIGNED_INT,d=4):(p=At.UNSIGNED_SHORT,d=2);var m=i.offsets;if(0===m.length)a&&(f(r,s,i,0),At.bindBuffer(At.ELEMENT_ARRAY_BUFFER,c.buffer)),At.drawElements(l,c.array.length,p,0),Ct.info.render.calls++,Ct.info.render.vertices+=c.array.length;else{m.length>1&&(a=!0);for(var v=0,g=m.length;g>v;v++){var E=m[v].index;a&&(f(r,s,i,E),At.bindBuffer(At.ELEMENT_ARRAY_BUFFER,c.buffer)),At.drawElements(l,m[v].count,p,m[v].start*d),Ct.info.render.calls++,Ct.info.render.vertices+=m[v].count}}}else{a&&f(r,s,i,0);var y=i.attributes.position,m=i.offsets;if(0===m.length)At.drawArrays(l,0,y.array.length/3),Ct.info.render.calls++,Ct.info.render.vertices+=y.array.length/3;else for(var v=0,g=m.length;g>v;v++)At.drawArrays(l,m[v].index,m[v].count),Ct.info.render.calls++,Ct.info.render.vertices+=m[v].count}}}},this.renderBuffer=function(t,e,n,r,i,o){if(r.visible!==!1){S(o);var s=O(t,e,n,r,o),a=s.attributes,u=!1,h=r.wireframe?1:0,l=i.id+"_"+s.id+"_"+h;if(l!==Dt&&(Dt=l,u=!0),u&&$t.initAttributes(),!r.morphTargets&&a.position>=0?u&&(At.bindBuffer(At.ARRAY_BUFFER,i.__webglVertexBuffer),$t.enableAttribute(a.position),At.vertexAttribPointer(a.position,3,At.FLOAT,!1,0,0)):o.morphTargetBase&&d(r,i,o),u){if(i.__webglCustomAttributesList)for(var c=0,p=i.__webglCustomAttributesList.length;p>c;c++){var f=i.__webglCustomAttributesList[c];a[f.buffer.belongsToAttribute]>=0&&(At.bindBuffer(At.ARRAY_BUFFER,f.buffer),$t.enableAttribute(a[f.buffer.belongsToAttribute]),At.vertexAttribPointer(a[f.buffer.belongsToAttribute],f.size,At.FLOAT,!1,0,0))}a.color>=0&&(o.geometry.colors.length>0||o.geometry.faces.length>0?(At.bindBuffer(At.ARRAY_BUFFER,i.__webglColorBuffer),$t.enableAttribute(a.color),At.vertexAttribPointer(a.color,3,At.FLOAT,!1,0,0)):void 0!==r.defaultAttributeValues&&At.vertexAttrib3fv(a.color,r.defaultAttributeValues.color)),a.normal>=0&&(At.bindBuffer(At.ARRAY_BUFFER,i.__webglNormalBuffer),$t.enableAttribute(a.normal),At.vertexAttribPointer(a.normal,3,At.FLOAT,!1,0,0)),a.tangent>=0&&(At.bindBuffer(At.ARRAY_BUFFER,i.__webglTangentBuffer),$t.enableAttribute(a.tangent),At.vertexAttribPointer(a.tangent,4,At.FLOAT,!1,0,0)),a.uv>=0&&(o.geometry.faceVertexUvs[0]?(At.bindBuffer(At.ARRAY_BUFFER,i.__webglUVBuffer),$t.enableAttribute(a.uv),At.vertexAttribPointer(a.uv,2,At.FLOAT,!1,0,0)):void 0!==r.defaultAttributeValues&&At.vertexAttrib2fv(a.uv,r.defaultAttributeValues.uv)),a.uv2>=0&&(o.geometry.faceVertexUvs[1]?(At.bindBuffer(At.ARRAY_BUFFER,i.__webglUV2Buffer),$t.enableAttribute(a.uv2),At.vertexAttribPointer(a.uv2,2,At.FLOAT,!1,0,0)):void 0!==r.defaultAttributeValues&&At.vertexAttrib2fv(a.uv2,r.defaultAttributeValues.uv2)),r.skinning&&a.skinIndex>=0&&a.skinWeight>=0&&(At.bindBuffer(At.ARRAY_BUFFER,i.__webglSkinIndicesBuffer),$t.enableAttribute(
n.shadowBias=t.shadowCascadeBias[e],n.shadowMapWidth=t.shadowCascadeWidth[e],n.shadowMapHeight=t.shadowCascadeHeight[e],n.pointsWorld=[],n.pointsFrustum=[];for(var r=n.pointsWorld,i=n.pointsFrustum,o=0;8>o;o++)r[o]=new THREE.Vector3,i[o]=new THREE.Vector3;var s=t.shadowCascadeNearZ[e],a=t.shadowCascadeFarZ[e];return i[0].set(-1,-1,s),i[1].set(1,-1,s),i[2].set(-1,1,s),i[3].set(1,1,s),i[4].set(-1,-1,a),i[5].set(1,-1,a),i[6].set(-1,1,a),i[7].set(1,1,a),n}function s(t,e){var n=t.shadowCascadeArray[e];n.position.copy(t.position),n.target.position.copy(t.target.position),n.lookAt(n.target),n.shadowCameraVisible=t.shadowCameraVisible,n.shadowDarkness=t.shadowDarkness,n.shadowBias=t.shadowCascadeBias[e];var r=t.shadowCascadeNearZ[e],i=t.shadowCascadeFarZ[e],o=n.pointsFrustum;o[0].z=r,o[1].z=r,o[2].z=r,o[3].z=r,o[4].z=i,o[5].z=i,o[6].z=i,o[7].z=i}function a(t,e){var n=e.shadowCamera,r=e.pointsFrustum,i=e.pointsWorld;v.set(1/0,1/0,1/0),g.set(-(1/0),-(1/0),-(1/0));for(var o=0;8>o;o++){var s=i[o];s.copy(r[o]),s.unproject(t),s.applyMatrix4(n.matrixWorldInverse),s.x<v.x&&(v.x=s.x),s.x>g.x&&(g.x=s.x),s.y<v.y&&(v.y=s.y),s.y>g.y&&(g.y=s.y),s.z<v.z&&(v.z=s.z),s.z>g.z&&(g.z=s.z)}n.left=v.x,n.right=g.x,n.top=g.y,n.bottom=v.y,n.updateProjectionMatrix()}function u(t){return t.material instanceof THREE.MeshFaceMaterial?t.material.materials[0]:t.material}var h,l,c,p,f=t.context,d=new THREE.Frustum,m=new THREE.Matrix4,v=new THREE.Vector3,g=new THREE.Vector3,E=new THREE.Vector3,y=[],_=THREE.ShaderLib.depthRGBA,b=THREE.UniformsUtils.clone(_.uniforms);h=new THREE.ShaderMaterial({uniforms:b,vertexShader:_.vertexShader,fragmentShader:_.fragmentShader}),l=new THREE.ShaderMaterial({uniforms:b,vertexShader:_.vertexShader,fragmentShader:_.fragmentShader,morphTargets:!0}),c=new THREE.ShaderMaterial({uniforms:b,vertexShader:_.vertexShader,fragmentShader:_.fragmentShader,skinning:!0}),p=new THREE.ShaderMaterial({uniforms:b,vertexShader:_.vertexShader,fragmentShader:_.fragmentShader,morphTargets:!0,skinning:!0}),h._shadowPass=!0,l._shadowPass=!0,c._shadowPass=!0,p._shadowPass=!0,this.render=function(n,v){if(t.shadowMapEnabled!==!1){var g,_,b,T,x,w,R,H,M,S,k,A,C,P=[],L=0,z=null;for(f.clearColor(1,1,1,1),f.disable(f.BLEND),f.enable(f.CULL_FACE),f.frontFace(f.CCW),t.shadowMapCullFace===THREE.CullFaceFront?f.cullFace(f.FRONT):f.cullFace(f.BACK),t.state.setDepthTest(!0),g=0,_=e.length;_>g;g++)if(C=e[g],C.castShadow)if(C instanceof THREE.DirectionalLight&&C.shadowCascade)for(x=0;x<C.shadowCascadeCount;x++){var O;if(C.shadowCascadeArray[x])O=C.shadowCascadeArray[x];else{O=o(C,x),O.originalCamera=v;var D=new THREE.Gyroscope;D.position.copy(C.shadowCascadeOffset),D.add(O),D.add(O.target),v.add(D),C.shadowCascadeArray[x]=O}s(C,x),P[L]=O,L++}else P[L]=C,L++;for(g=0,_=P.length;_>g;g++){if(C=P[g],!C.shadowMap){var F=THREE.LinearFilter;t.shadowMapType===THREE.PCFSoftShadowMap&&(F=THREE.NearestFilter);var U={minFilter:F,magFilter:F,format:THREE.RGBAFormat};C.shadowMap=new THREE.WebGLRenderTarget(C.shadowMapWidth,C.shadowMapHeight,U),C.shadowMapSize=new THREE.Vector2(C.shadowMapWidth,C.shadowMapHeight),C.shadowMatrix=new THREE.Matrix4}if(!C.shadowCamera){if(C instanceof THREE.SpotLight)C.shadowCamera=new THREE.PerspectiveCamera(C.shadowCameraFov,C.shadowMapWidth/C.shadowMapHeight,C.shadowCameraNear,C.shadowCameraFar);else{if(!(C instanceof THREE.DirectionalLight)){THREE.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",C);continue}C.shadowCamera=new THREE.OrthographicCamera(C.shadowCameraLeft,C.shadowCameraRight,C.shadowCameraTop,C.shadowCameraBottom,C.shadowCameraNear,C.shadowCameraFar)}n.add(C.shadowCamera),n.autoUpdate===!0&&n.updateMatrixWorld()}C.shadowCameraVisible&&!C.cameraHelper&&(C.cameraHelper=new THREE.CameraHelper(C.shadowCamera),n.add(C.cameraHelper)),C.isVirtual&&O.originalCamera==v&&a(v,C),w=C.shadowMap,R=C.shadowMatrix,H=C.shadowCamera,H.position.setFromMatrixPosition(C.matrixWorld),E.setFromMatrixPosition(C.target.matrixWorld),H.lookAt(E),H.updateMatrixWorld(),H.matrixWorldInverse.getInverse(H.matrixWorld),C.cameraHelper&&(C.cameraHelper.vi
var e,n=this.holes.length,r=[];for(e=0;n>e;e++)r[e]=this.holes[e].getTransformedSpacedPoints(t,this.bends);return r},THREE.Shape.prototype.extractAllPoints=function(t){return{shape:this.getTransformedPoints(t),holes:this.getPointsHoles(t)}},THREE.Shape.prototype.extractPoints=function(t){return this.useSpacedPoints?this.extractAllSpacedPoints(t):this.extractAllPoints(t)},THREE.Shape.prototype.extractAllSpacedPoints=function(t){return{shape:this.getTransformedSpacedPoints(t),holes:this.getSpacedPointsHoles(t)}},THREE.Shape.Utils={triangulateShape:function(t,e){function n(t,e,n){return t.x!=e.x?t.x<e.x?t.x<=n.x&&n.x<=e.x:e.x<=n.x&&n.x<=t.x:t.y<e.y?t.y<=n.y&&n.y<=e.y:e.y<=n.y&&n.y<=t.y}function r(t,e,r,i,o){var s=1e-10,a=e.x-t.x,u=e.y-t.y,h=i.x-r.x,l=i.y-r.y,c=t.x-r.x,p=t.y-r.y,f=u*h-a*l,d=u*c-a*p;if(Math.abs(f)>s){var m;if(f>0){if(0>d||d>f)return[];if(m=l*c-h*p,0>m||m>f)return[]}else{if(d>0||f>d)return[];if(m=l*c-h*p,m>0||f>m)return[]}if(0==m)return!o||0!=d&&d!=f?[t]:[];if(m==f)return!o||0!=d&&d!=f?[e]:[];if(0==d)return[r];if(d==f)return[i];var v=m/f;return[{x:t.x+v*a,y:t.y+v*u}]}if(0!=d||l*c!=h*p)return[];var g=0==a&&0==u,E=0==h&&0==l;if(g&&E)return t.x!=r.x||t.y!=r.y?[]:[t];if(g)return n(r,i,t)?[t]:[];if(E)return n(t,e,r)?[r]:[];var y,_,b,T,x,w,R,H;return 0!=a?(t.x<e.x?(y=t,b=t.x,_=e,T=e.x):(y=e,b=e.x,_=t,T=t.x),r.x<i.x?(x=r,R=r.x,w=i,H=i.x):(x=i,R=i.x,w=r,H=r.x)):(t.y<e.y?(y=t,b=t.y,_=e,T=e.y):(y=e,b=e.y,_=t,T=t.y),r.y<i.y?(x=r,R=r.y,w=i,H=i.y):(x=i,R=i.y,w=r,H=r.y)),R>=b?R>T?[]:T==R?o?[]:[x]:H>=T?[x,_]:[x,w]:b>H?[]:b==H?o?[]:[y]:H>=T?[y,_]:[y,w]}function i(t,e,n,r){var i=1e-10,o=e.x-t.x,s=e.y-t.y,a=n.x-t.x,u=n.y-t.y,h=r.x-t.x,l=r.y-t.y,c=o*u-s*a,p=o*l-s*h;if(Math.abs(c)>i){var f=h*u-l*a;return c>0?p>=0&&f>=0:p>=0||f>=0}return p>0}function o(t,e){function n(t,e){var n=E.length-1,r=t-1;0>r&&(r=n);var o=t+1;o>n&&(o=0);var s=i(E[t],E[r],E[o],a[e]);if(!s)return!1;var u=a.length-1,h=e-1;0>h&&(h=u);var l=e+1;return l>u&&(l=0),s=i(a[e],a[h],a[l],E[t]),s?!0:!1}function o(t,e){var n,i,o;for(n=0;n<E.length;n++)if(i=n+1,i%=E.length,o=r(t,e,E[n],E[i],!0),o.length>0)return!0;return!1}function s(t,n){var i,o,s,a,u;for(i=0;i<y.length;i++)for(o=e[y[i]],s=0;s<o.length;s++)if(a=s+1,a%=o.length,u=r(t,n,o[s],o[a],!0),u.length>0)return!0;return!1}for(var a,u,h,l,c,p,f,d,m,v,g,E=t.concat(),y=[],_=[],b=0,T=e.length;T>b;b++)y.push(b);for(var x=0,w=2*y.length;y.length>0;){if(w--,0>w){console.log("Infinite Loop! Holes left:"+y.length+", Probably Hole outside Shape!");break}for(h=x;h<E.length;h++){l=E[h],u=-1;for(var b=0;b<y.length;b++)if(p=y[b],f=l.x+":"+l.y+":"+p,void 0===_[f]){a=e[p];for(var R=0;R<a.length;R++)if(c=a[R],n(h,R)&&!o(l,c)&&!s(l,c)){u=R,y.splice(b,1),d=E.slice(0,h+1),m=E.slice(h),v=a.slice(u),g=a.slice(0,u+1),E=d.concat(v).concat(g).concat(m),x=h;break}if(u>=0)break;_[f]=!0}if(u>=0)break}}return E}for(var s,a,u,h,l,c,p={},f=t.concat(),d=0,m=e.length;m>d;d++)Array.prototype.push.apply(f,e[d]);for(s=0,a=f.length;a>s;s++)l=f[s].x+":"+f[s].y,void 0!==p[l]&&THREE.warn("THREE.Shape: Duplicate point",l),p[l]=s;var v=o(t,e),g=THREE.FontUtils.Triangulate(v,!1);for(s=0,a=g.length;a>s;s++)for(h=g[s],u=0;3>u;u++)l=h[u].x+":"+h[u].y,c=p[l],void 0!==c&&(h[u]=c);return g.concat()},isClockWise:function(t){return THREE.FontUtils.Triangulate.area(t)<0},b2p0:function(t,e){var n=1-t;return n*n*e},b2p1:function(t,e){return 2*(1-t)*t*e},b2p2:function(t,e){return t*t*e},b2:function(t,e,n,r){return this.b2p0(t,e)+this.b2p1(t,n)+this.b2p2(t,r)},b3p0:function(t,e){var n=1-t;return n*n*n*e},b3p1:function(t,e){var n=1-t;return 3*n*n*t*e},b3p2:function(t,e){var n=1-t;return 3*n*t*t*e},b3p3:function(t,e){return t*t*t*e},b3:function(t,e,n,r,i){return this.b3p0(t,e)+this.b3p1(t,n)+this.b3p2(t,r)+this.b3p3(t,i)}},THREE.LineCurve=function(t,e){this.v1=t,this.v2=e},THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype),THREE.LineCurve.prototype.constructor=THREE.LineCurve,THREE.LineCurve.prototype.getPoint=function(t){var e=this.v2.clone().sub(this.v1);return e.multiplyScalar(t).add(this.v1),e},THREE.LineCurve.prototype.getPointAt=function(t){return this.g
this.addAttribute("uv",new THREE.BufferAttribute(d,2))},THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype),THREE.PlaneBufferGeometry.prototype.constructor=THREE.PlaneBufferGeometry,THREE.RingGeometry=function(t,e,n,r,i,o){THREE.Geometry.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:r,thetaStart:i,thetaLength:o},t=t||0,e=e||50,i=void 0!==i?i:0,o=void 0!==o?o:2*Math.PI,n=void 0!==n?Math.max(3,n):8,r=void 0!==r?Math.max(1,r):8;var s,a,u=[],h=t,l=(e-t)/r;for(s=0;r+1>s;s++){for(a=0;n+1>a;a++){var c=new THREE.Vector3,p=i+a/n*o;c.x=h*Math.cos(p),c.y=h*Math.sin(p),this.vertices.push(c),u.push(new THREE.Vector2((c.x/e+1)/2,(c.y/e+1)/2))}h+=l}var f=new THREE.Vector3(0,0,1);for(s=0;r>s;s++){var d=s*(n+1);for(a=0;n>a;a++){var p=a+d,m=p,v=p+n+1,g=p+n+2;this.faces.push(new THREE.Face3(m,v,g,[f.clone(),f.clone(),f.clone()])),this.faceVertexUvs[0].push([u[m].clone(),u[v].clone(),u[g].clone()]),m=p,v=p+n+2,g=p+1,this.faces.push(new THREE.Face3(m,v,g,[f.clone(),f.clone(),f.clone()])),this.faceVertexUvs[0].push([u[m].clone(),u[v].clone(),u[g].clone()])}}this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,h)},THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.RingGeometry.prototype.constructor=THREE.RingGeometry,THREE.SphereGeometry=function(t,e,n,r,i,o,s){THREE.Geometry.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:r,phiLength:i,thetaStart:o,thetaLength:s},t=t||50,e=Math.max(3,Math.floor(e)||8),n=Math.max(2,Math.floor(n)||6),r=void 0!==r?r:0,i=void 0!==i?i:2*Math.PI,o=void 0!==o?o:0,s=void 0!==s?s:Math.PI;var a,u,h=[],l=[];for(u=0;n>=u;u++){var c=[],p=[];for(a=0;e>=a;a++){var f=a/e,d=u/n,m=new THREE.Vector3;m.x=-t*Math.cos(r+f*i)*Math.sin(o+d*s),m.y=t*Math.cos(o+d*s),m.z=t*Math.sin(r+f*i)*Math.sin(o+d*s),this.vertices.push(m),c.push(this.vertices.length-1),p.push(new THREE.Vector2(f,1-d))}h.push(c),l.push(p)}for(u=0;n>u;u++)for(a=0;e>a;a++){var v=h[u][a+1],g=h[u][a],E=h[u+1][a],y=h[u+1][a+1],_=this.vertices[v].clone().normalize(),b=this.vertices[g].clone().normalize(),T=this.vertices[E].clone().normalize(),x=this.vertices[y].clone().normalize(),w=l[u][a+1].clone(),R=l[u][a].clone(),H=l[u+1][a].clone(),M=l[u+1][a+1].clone();Math.abs(this.vertices[v].y)===t?(w.x=(w.x+R.x)/2,this.faces.push(new THREE.Face3(v,E,y,[_,T,x])),this.faceVertexUvs[0].push([w,H,M])):Math.abs(this.vertices[E].y)===t?(H.x=(H.x+M.x)/2,this.faces.push(new THREE.Face3(v,g,E,[_,b,T])),this.faceVertexUvs[0].push([w,R,H])):(this.faces.push(new THREE.Face3(v,g,y,[_,b,x])),this.faceVertexUvs[0].push([w,R,M]),this.faces.push(new THREE.Face3(g,E,y,[b.clone(),T,x.clone()])),this.faceVertexUvs[0].push([R.clone(),H,M.clone()]))}this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,t)},THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry,THREE.TextGeometry=function(t,e){e=e||{};var n=THREE.FontUtils.generateShapes(t,e);e.amount=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),THREE.ExtrudeGeometry.call(this,n,e),this.type="TextGeometry"},THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype),THREE.TextGeometry.prototype.constructor=THREE.TextGeometry,THREE.TorusGeometry=function(t,e,n,r,i){THREE.Geometry.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:r,arc:i},t=t||100,e=e||40,n=n||8,r=r||6,i=i||2*Math.PI;for(var o=new THREE.Vector3,s=[],a=[],u=0;n>=u;u++)for(var h=0;r>=h;h++){var l=h/r*i,c=u/n*Math.PI*2;o.x=t*Math.cos(l),o.y=t*Math.sin(l);var p=new THREE.Vector3;p.x=(t+e*Math.cos(c))*Math.cos(l),p.y=(t+e*Math.cos(c))*Math.sin(l),p.z=e*Math.sin(c),this.vertices.push(p),s.push(new THREE.Vector2(h/r,u/n)),a.push(p.clone().sub(o).normalize())}for(var u=1;n>=u;u++)for(var h=1;r>=h;h++){var
g[y+4]=u[M+1],g[y+5]=u[M+2]}a.addAttribute("position",new THREE.BufferAttribute(g,3))}THREE.Line.call(this,a,new THREE.LineBasicMaterial({color:n}),THREE.LinePieces),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1},THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype),THREE.WireframeHelper.prototype.constructor=THREE.WireframeHelper,THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this),this.render=function(t){}},THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype),THREE.ImmediateRenderObject.prototype.constructor=THREE.ImmediateRenderObject,THREE.MorphBlendMesh=function(t,e){THREE.Mesh.call(this,t,e),this.animationsMap={},this.animationsList=[];var n=this.geometry.morphTargets.length,r="__default",i=0,o=n-1,s=n/1;this.createAnimation(r,i,o,s),this.setAnimationWeight(r,1)},THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype),THREE.MorphBlendMesh.prototype.constructor=THREE.MorphBlendMesh,THREE.MorphBlendMesh.prototype.createAnimation=function(t,e,n,r){var i={startFrame:e,endFrame:n,length:n-e+1,fps:r,duration:(n-e)/r,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1};this.animationsMap[t]=i,this.animationsList.push(i)},THREE.MorphBlendMesh.prototype.autoCreateAnimations=function(t){for(var e,n=/([a-z]+)_?(\d+)/,r={},i=this.geometry,o=0,s=i.morphTargets.length;s>o;o++){var a=i.morphTargets[o],u=a.name.match(n);if(u&&u.length>1){var h=u[1];r[h]||(r[h]={start:1/0,end:-(1/0)});var l=r[h];o<l.start&&(l.start=o),o>l.end&&(l.end=o),e||(e=h)}}for(var h in r){var l=r[h];this.createAnimation(h,l.start,l.end,t)}this.firstAnimation=e},THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(t){var e=this.animationsMap[t];e&&(e.direction=1,e.directionBackwards=!1)},THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(t){var e=this.animationsMap[t];e&&(e.direction=-1,e.directionBackwards=!0)},THREE.MorphBlendMesh.prototype.setAnimationFPS=function(t,e){var n=this.animationsMap[t];n&&(n.fps=e,n.duration=(n.end-n.start)/n.fps)},THREE.MorphBlendMesh.prototype.setAnimationDuration=function(t,e){var n=this.animationsMap[t];n&&(n.duration=e,n.fps=(n.end-n.start)/n.duration)},THREE.MorphBlendMesh.prototype.setAnimationWeight=function(t,e){var n=this.animationsMap[t];n&&(n.weight=e)},THREE.MorphBlendMesh.prototype.setAnimationTime=function(t,e){var n=this.animationsMap[t];n&&(n.time=e)},THREE.MorphBlendMesh.prototype.getAnimationTime=function(t){var e=0,n=this.animationsMap[t];return n&&(e=n.time),e},THREE.MorphBlendMesh.prototype.getAnimationDuration=function(t){var e=-1,n=this.animationsMap[t];return n&&(e=n.duration),e},THREE.MorphBlendMesh.prototype.playAnimation=function(t){var e=this.animationsMap[t];e?(e.time=0,e.active=!0):THREE.warn("THREE.MorphBlendMesh: animation["+t+"] undefined in .playAnimation()")},THREE.MorphBlendMesh.prototype.stopAnimation=function(t){var e=this.animationsMap[t];e&&(e.active=!1)},THREE.MorphBlendMesh.prototype.update=function(t){for(var e=0,n=this.animationsList.length;n>e;e++){var r=this.animationsList[e];if(r.active){var i=r.duration/r.length;r.time+=r.direction*t,r.mirroredLoop?(r.time>r.duration||r.time<0)&&(r.direction*=-1,r.time>r.duration&&(r.time=r.duration,r.directionBackwards=!0),r.time<0&&(r.time=0,r.directionBackwards=!1)):(r.time=r.time%r.duration,r.time<0&&(r.time+=r.duration));var o=r.startFrame+THREE.Math.clamp(Math.floor(r.time/i),0,r.length-1),s=r.weight;o!==r.currentFrame&&(this.morphTargetInfluences[r.lastFrame]=0,this.morphTargetInfluences[r.currentFrame]=1*s,this.morphTargetInfluences[o]=0,r.lastFrame=r.currentFrame,r.currentFrame=o);var a=r.time%i/i;r.directionBackwards&&(a=1-a),this.morphTargetInfluences[r.currentFrame]=a*s,this.morphTargetInfluences[r.lastFrame]=(1-a)*s}}},function(){function t(t,e,n){for(var r=(n||0)-1,i=t?t.length:0;++r<i;)if(t[r]===e)return r;return-1}function e(e,n){var r=typeof n;if(e=e.cache,"boolean"==r||null==n)return e[n]?0:-1;"number"!=r&&"string"!=r&&(r="object");var i="number"==r?n:g+n;return e=(e=e[r])&&e[i]
!J||J.global!==J&&J.window!==J||(Y=J);var $=p();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Y._=$,define(function(){return $})):Z&&K?Q?(K.exports=$)._=$:Z._=$:Y._=$}.call(this),THREE.Binder={bind:function(t,e){return function(n,r){r.__binds||(r.__binds=[]);var i=t;_.isArray(n)&&(i=n[0],n=n[1]);for(var o=/^([^.:]*(?:\.[^.:]+)*)?(?:\:(.*))?$/.exec(n),s=o[1].split(/\./g),a=s.pop(),u=o[2]||a,h=s.shift(),l={"this":r}[h]||e[h]||t[h]||i;l&&(n=s.shift());)l=l[n];if(l&&(l.on||l.addEventListener)){var c=function(e){r[u]&&r[u](e,t)};THREE.Binder._polyfill(l,["addEventListener","on"],function(t){l[t](a,c)});var p={target:l,name:a,callback:c};return r.__binds.push(p),c}throw"Cannot bind '"+n+"' in "+this.__name}},unbind:function(){return function(t){t.__binds&&(t.__binds.forEach(function(t){THREE.Binder._polyfill(t.target,["removeEventListener","off"],function(e){t.target[e](t.name,t.callback)})}.bind(this)),t.__binds=[])}},apply:function(t){THREE.EventDispatcher.prototype.apply(t),t.trigger=THREE.Binder._trigger,t.triggerOnce=THREE.Binder._triggerOnce,t.on=t.addEventListener,t.off=t.removeEventListener,t.dispatchEvent=t.trigger},_triggerOnce:function(t){this.trigger(t),this._listeners&&delete this._listeners[t.type]},_trigger:function(t){if(void 0!==this._listeners){var e=t.type,n=this._listeners[e];if(void 0!==n){n=n.slice();var r=n.length;t.target=this;for(var i=0;r>i;i++)n[i].call(this,t,this)}}},_polyfill:function(t,e,n){e.map(function(e){return t.method}),e.length&&n(e[0])}},THREE.Api={apply:function(t){t.set=function(t){var e=this.options||{},n=_.reduce(t,function(t,n,r){return e[r]!==n&&(t[r]=n),t},{});this.options=_.extend(e,n),this.trigger({type:"change",options:t,changes:n})},t.get=function(){return this.options},t.api=function(t,e){return t=t||{},e&&_.each(t,function(t,n,r){_.isFunction(t)&&(r[n]=_.partialRight(t,e))}),t.set=this.set.bind(this),t.get=this.get.bind(this),t}}},THREE.Bootstrap=function(t){if(t){var e=[].slice.apply(arguments);t={},e[0]instanceof Node&&(node=e[0],e=e.slice(1),t.element=node),_.isString(e[0])&&(t.plugins=e),_.isArray(e[0])&&(t.plugins=e[0]),e[0]&&(t=_.defaults(t,e[0]))}if(!(this instanceof THREE.Bootstrap))return new THREE.Bootstrap(t);var n={init:!0,element:document.body,plugins:["core"],aliases:{},plugindb:THREE.Bootstrap.Plugins||{},aliasdb:THREE.Bootstrap.Aliases||{}};this.__options=_.defaults(t||{},n),this.__inited=!1,this.__destroyed=!1,this.__installed=[];var r=this.__options.element;r===""+r&&(r=document.querySelector(r)),this.plugins={},this.element=r,this.__options.init&&this.init()},THREE.Bootstrap.prototype={init:function(){return this.__inited?void 0:(this.__inited=!0,this.install(this.__options.plugins),this)},destroy:function(){return this.__inited&&!this.__destroyed?(this.__destroyed=!0,this.trigger({type:"destroy"}),this.uninstall(),this):void 0},resolve:function(t){function e(t,n,o){if(o>=256)throw"Plug-in alias recursion detected.";return t=_.filter(t,i),_.each(t,function(t){var i=r[t];i?n=n.concat(e(i,[],o+1)):n.push(t)}),n}t=_.isArray(t)?t:[t];var n=this.__options,r=_.extend({},n.aliasdb,n.aliases),i=function(t){var e=t.split(":");return e[1]?(r[e[0]]=[e[1]],!1):!0};return t=_.filter(t,i),_.each(r,function(t,e){r[e]=_.isArray(t)?t:[t]}),e(t,[],0)},install:function(t){t=_.isArray(t)?t:[t],t=this.resolve(t),_.each(t,this.__install,this),this.__ready()},uninstall:function(t){t&&(t=_.isArray(t)?t:[t],t=this.resolve(t)),_.eachRight(t||this.__installed,this.__uninstall,this)},__install:function(t){var e=this.__options.plugindb[t];if(!e)throw"[three.install] Cannot install. '"+t+"' is not registered.";if(this.plugins[t])return console.warn("[three.install] "+t+" is already installed.");var n=e,r=new n(this.__options[t]||{},t);return this.plugins[t]=r,flag=r.install(this),this.__installed.push(r),this.trigger({type:"install",plugin:r}),flag},__uninstall:function(t,e){return plugin=_.isString(t)?this.plugins[t]:t,plugin?(t=plugin.__name,plugin.uninstall(this),this.__installed=_.without(this.__installed,plugin),delete this.plugins[t],void this.trigger({type:
n.add(e.copy(c.object.up).setLength(t.y)),c.object.position.add(n),c.target.add(n),c.staticMoving?H.copy(M):H.add(t.subVectors(M,H).multiplyScalar(c.dynamicDampingFactor)))}}(),this.checkDistances=function(){c.noZoom&&c.noPan||(g.lengthSq()>c.maxDistance*c.maxDistance&&c.object.position.addVectors(c.target,g.setLength(c.maxDistance)),g.lengthSq()<c.minDistance*c.minDistance&&c.object.position.addVectors(c.target,g.setLength(c.minDistance)))},this.update=function(){g.subVectors(c.object.position,c.target),c.noRotate||c.rotateCamera(),c.noZoom||c.zoomCamera(),c.noPan||c.panCamera(),c.object.position.addVectors(c.target,g),c.checkDistances(),c.object.lookAt(c.target),d.distanceToSquared(c.object.position)>f&&(c.dispatchEvent(S),d.copy(c.object.position))},this.reset=function(){m=p.NONE,v=p.NONE,c.target.copy(c.target0),c.object.position.copy(c.position0),c.object.up.copy(c.up0),g.subVectors(c.object.position,c.target),c.object.lookAt(c.target),c.dispatchEvent(S),d.copy(c.object.position)},this.domElement.addEventListener("contextmenu",function(t){t.preventDefault()},!1),this.domElement.addEventListener("mousedown",i,!1),this.domElement.addEventListener("mousewheel",a,!1),this.domElement.addEventListener("DOMMouseScroll",a,!1),this.domElement.addEventListener("touchstart",u,!1),this.domElement.addEventListener("touchend",l,!1),this.domElement.addEventListener("touchmove",h,!1),window.addEventListener("keydown",n,!1),window.addEventListener("keyup",r,!1),this.handleResize(),this.update()},THREE.TrackballControls.prototype=Object.create(THREE.EventDispatcher.prototype),THREE.TrackballControls.prototype.constructor=THREE.TrackballControls,THREE.VRControls=function(t,e){var n=1e-5,r=this.dummy=new THREE.Object3D;this.object=t,this.device=new THREE.DeviceOrientationControls(r,e),this.orbit=new THREE.OrbitControls(r,e),this.orbit.target.copy(t.position),this.orbit.target.z+=n,this.orbit.rotateSpeed=-.25,this.supported=!1;var i=function(t){this.supported=t&&t.alpha==+t.alpha,window.removeEventListener("deviceorientation",i,!1)}.bind(this);window.addEventListener("deviceorientation",i,!1)},THREE.VRControls.prototype.vr=function(t){this.vrstate=t},THREE.VRControls.prototype.update=function(t){var e=!1;this.vrstate&&this.vrstate.orientation?(e=!0,this.object.quaternion.copy(this.vrstate.orientation),this.object.position.copy(this.vrstate.position),this.device.object=this.dummy,this.orbit.object=this.dummy):this.vrstate&&this.supported?(this.device.freeze&&this.device.connect(),this.device.object=this.object,this.orbit.object=this.dummy,this.device.update(t)):(e=!0,this.device.object=this.dummy,this.orbit.object=this.object,this.orbit.update(t)),e&&!this.device.freeze&&this.device.disconnect()},THREE.Bootstrap.registerPlugin("stats",{listen:["pre","post"],install:function(t){var e=this.stats=new THREE.Stats,n=e.domElement.style;n.position="absolute",n.top=n.left=0,t.element.appendChild(e.domElement),t.stats=e},uninstall:function(t){document.body.removeChild(this.stats.domElement),delete t.stats},pre:function(t,e){this.stats.begin()},post:function(t,e){this.stats.end()}}),THREE.Bootstrap.registerPlugin("controls",{listen:["update","resize","camera","this.change"],defaults:{klass:null,parameters:{}},install:function(t){if(!this.options.klass)throw"Must provide class for `controls.klass`";t.controls=null,this._camera=t.camera||new THREE.PerspectiveCamera,this.change(null,t)},uninstall:function(t){delete t.controls},change:function(t,e){this.options.klass?((!t||t.changes.klass)&&(e.controls=new this.options.klass(this._camera,e.renderer.domElement)),_.extend(e.controls,this.options.parameters)):e.controls=null},update:function(t,e){var n=e.Time&&e.Time.delta||1/60,r=e.VR&&e.VR.state;e.controls.vr&&e.controls.vr(r),e.controls.update(n)},camera:function(t,e){e.controls.object=this._camera=t.camera},resize:function(t,e){e.controls.handleResize&&e.controls.handleResize()}}),THREE.Bootstrap.registerPlugin("cursor",{listen:["update","this.change","install:change","uninstall:change","element.mousemove","vr"],defaults:{cursor:null,hide:!1,timeout
"float.encode":"/*\nFloat encoding technique by\nCarlos Scheidegger\nhttps://github.com/cscheid/lux/blob/master/src/shade/bits/encode_float.js\n\nConversion to GLSL by:\nhttp://concord-consortium.github.io/lab/experiments/webgl-gpgpu/script.js\n*/\n\nfloat shift_right(float v, float amt) { \n v = floor(v) + 0.5; \n return floor(v / exp2(amt)); \n}\n\nfloat shift_left(float v, float amt) { \n return floor(v * exp2(amt) + 0.5); \n}\n\nfloat mask_last(float v, float bits) { \n return mod(v, shift_left(1.0, bits)); \n}\n\nfloat extract_bits(float num, float from, float to) { \n from = floor(from + 0.5); to = floor(to + 0.5); \n return mask_last(shift_right(num, from), to - from); \n}\n\nvec4 encode_float(float val) { \n if (val == 0.0) return vec4(0, 0, 0, 0); \n float valuesign = val > 0.0 ? 0.0 : 1.0; \n val = abs(val); \n float exponent = floor(log2(val)); \n float biased_exponent = exponent + 127.0; \n float fraction = ((val / exp2(exponent)) - 1.0) * 8388608.0; \n float t = biased_exponent / 2.0; \n float last_bit_of_biased_exponent = fract(t) * 2.0; \n float remaining_bits_of_biased_exponent = floor(t); \n float byte4 = extract_bits(fraction, 0.0, 8.0) / 255.0; \n float byte3 = extract_bits(fraction, 8.0, 16.0) / 255.0; \n float byte2 = (last_bit_of_biased_exponent * 128.0 + extract_bits(fraction, 16.0, 23.0)) / 255.0; \n float byte1 = (valuesign * 128.0 + remaining_bits_of_biased_exponent) / 255.0; \n return vec4(byte4, byte3, byte2, byte1); \n}\n","float.index.pack":"uniform vec4 indexModulus;\n\nvec4 getSample(vec4 xyzw);\nvec4 getIndex(vec4 xyzw);\n\nvec4 floatPackIndex(vec4 xyzw) {\n vec4 value = getSample(xyzw);\n vec4 index = getIndex(xyzw);\n\n vec4 offset = floor(index + .5) * indexModulus;\n vec2 sum2 = offset.xy + offset.zw;\n float sum = sum2.x + sum2.y;\n return vec4(value.xyz, sum);\n}","float.stretch":"vec4 getSample(vec4 xyzw);\n\nfloat floatStretch(vec4 xyzw, float channelIndex) {\n vec4 sample = getSample(xyzw);\n vec2 xy = channelIndex > 1.5 ? sample.zw : sample.xy;\n return mod(channelIndex, 2.0) > .5 ? xy.y : xy.x;\n}","fragment.clip.dashed":"varying float vClipStrokeWidth;\nvarying float vClipStrokeIndex;\nvarying vec3 vClipStrokeEven;\nvarying vec3 vClipStrokeOdd;\nvarying vec3 vClipStrokePosition;\n\nvoid clipStrokeFragment() {\n bool odd = mod(vClipStrokeIndex, 2.0) >= 1.0;\n\n vec3 tangent;\n if (odd) {\n tangent = vClipStrokeOdd;\n }\n else {\n tangent = vClipStrokeEven;\n }\n\n float travel = dot(vClipStrokePosition, normalize(tangent)) / vClipStrokeWidth;\n if (mod(travel, 16.0) > 8.0) {\n discard;\n }\n}\n","fragment.clip.dotted":"varying float vClipStrokeWidth;\nvarying float vClipStrokeIndex;\nvarying vec3 vClipStrokeEven;\nvarying vec3 vClipStrokeOdd;\nvarying vec3 vClipStrokePosition;\n\nvoid clipStrokeFragment() {\n bool odd = mod(vClipStrokeIndex, 2.0) >= 1.0;\n\n vec3 tangent;\n if (odd) {\n tangent = vClipStrokeOdd;\n }\n else {\n tangent = vClipStrokeEven;\n }\n\n float travel = dot(vClipStrokePosition, normalize(tangent)) / vClipStrokeWidth;\n if (mod(travel, 4.0) > 2.0) {\n discard;\n }\n}\n","fragment.clip.ends":"varying vec2 vClipEnds;\n\nvoid clipEndsFragment() {\n if (vClipEnds.x < 0.0 || vClipEnds.y < 0.0) discard;\n}\n","fragment.clip.proximity":"varying float vClipProximity;\n\nvoid clipProximityFragment() {\n if (vClipProximity >= 0.5) discard;\n}","fragment.color":"void setFragmentColor(vec4 color) {\n gl_FragColor = color;\n}","fragment.map.rgba":"vec4 fragmentRGBA(vec4 rgba, vec4 stpq) {\n return rgba;\n}","fragment.solid":"void setFragmentColor(vec4 color) {\n if (color.a < 1.0) discard;\n gl_FragColor = color;\n}","fragment.transparent":"void setFragmentColor(vec4 color) {\n if (color.a >= 1.0) discard;\n gl_FragColor = color;\n}","grid.position":"uniform vec4 gridPosition;\nuniform vec4 gridStep;\nuniform vec4 gridAxis;\n\nvec4 sampleData(vec2 xy);\n\nvec4 getGridPosition(vec4 xyzw) {\n vec4 onAxis = gridAxis * sampleData(vec2(xyzw.y, 0.0)).x;\n vec4 offAxis = gridStep * xyzw.x + gri
"split.position":"uniform float splitStride;\n\nvec2 getIndices(vec4 xyzw);\nvec4 getRest(vec4 xyzw);\nvec4 injectIndex(float v);\n\nvec4 getSplitXYZW(vec4 xyzw) {\n vec2 uv = getIndices(xyzw);\n float offset = uv.x + uv.y * splitStride;\n return injectIndex(offset) + getRest(xyzw);\n}\n","spread.position":"uniform vec4 spreadOffset;\nuniform mat4 spreadMatrix;\n\n// External\nvec4 getSample(vec4 xyzw);\n\nvec4 getSpreadSample(vec4 xyzw) {\n vec4 sample = getSample(xyzw);\n return sample + spreadMatrix * (spreadOffset + xyzw);\n}\n","sprite.fragment":"varying vec2 vSprite;\n\nvec4 getSample(vec2 xy);\n\nvec4 getSpriteColor() {\n return getSample(vSprite);\n}","sprite.position":"uniform vec2 spriteOffset;\nuniform float spriteScale;\nuniform float spriteDepth;\nuniform float spriteSnap;\n\nuniform vec2 renderOdd;\nuniform float renderScale;\nuniform float renderScaleInv;\nuniform float pixelUnit;\nuniform float focusDepth;\n\nuniform vec4 geometryClip;\nattribute vec4 position4;\nattribute vec2 sprite;\n\nvarying float vPixelSize;\n\n// External\nvec3 getPosition(vec4 xyzw, float canonical);\nvec4 getSprite(vec4 xyzw);\n\nvec3 getSpritePosition() {\n // Clip points\n vec4 p = min(geometryClip, position4);\n float diff = length(position4 - p);\n if (diff > 0.0) {\n return vec3(0.0, 0.0, 1000.0);\n }\n\n // Make sprites\n vec3 center = getPosition(p, 1.0);\n vec4 atlas = getSprite(p);\n\n // Sprite goes from -1..1, width = 2.\n // -1..1 -> -0.5..0.5\n vec2 halfSprite = sprite * .5;\n vec2 halfFlipSprite = vec2(halfSprite.x, -halfSprite.y);\n\n#ifdef POSITION_UV\n // Assign UVs\n vUV = atlas.xy + atlas.zw * (halfFlipSprite + .5);\n#endif\n\n // Depth blending\n // TODO: orthographic camera\n // Workaround: set depth = 0\n float depth = focusDepth, z;\n z = -center.z;\n if (spriteDepth < 1.0) {\n depth = mix(z, focusDepth, spriteDepth);\n }\n \n // Match device/unit mapping \n float size = pixelUnit * spriteScale;\n float depthSize = depth * size;\n\n // Calculate pixelSize for anti-aliasing\n float pixelSize = (spriteDepth > 0.0 ? depthSize / z : size);\n vPixelSize = pixelSize;\n\n // Position sprite\n vec2 atlasOdd = fract(atlas.zw / 2.0);\n vec2 offset = (spriteOffset + halfSprite * atlas.zw) * depthSize;\n if (spriteSnap > 0.5) {\n // Snap to pixel (w/ epsilon shift to avoid jitter)\n return vec3(((floor(center.xy / center.z * renderScale + 0.001) + renderOdd + atlasOdd) * center.z + offset) * renderScaleInv, center.z);\n }\n else {\n // Place directly\n return center + vec3(offset * renderScaleInv, 0.0);\n }\n\n}\n","stereographic.position":"uniform float stereoBend;\n\nuniform mat4 viewMatrix;\n\nvec4 getStereoPosition(vec4 position, inout vec4 stpq) {\n if (stereoBend > 0.0001) {\n\n vec3 pos = position.xyz;\n float r = length(pos);\n float z = r + pos.z;\n vec3 project = vec3(pos.xy / z, r);\n \n vec3 lerped = mix(pos, project, stereoBend);\n\n return viewMatrix * vec4(lerped, 1.0);\n }\n else {\n return viewMatrix * vec4(position.xyz, 1.0);\n }\n}","stereographic4.position":"uniform float stereoBend;\nuniform vec4 basisScale;\nuniform vec4 basisOffset;\nuniform mat4 viewMatrix;\nuniform vec2 view4D;\n\nvec4 getStereographic4Position(vec4 position, inout vec4 stpq) {\n \n vec4 transformed;\n if (stereoBend > 0.0001) {\n\n float r = length(position);\n float w = r + position.w;\n vec4 project = vec4(position.xyz / w, r);\n \n transformed = mix(position, project, stereoBend);\n }\n else {\n transformed = position;\n }\n\n vec4 pos4 = transformed * basisScale - basisOffset;\n vec3 xyz = (viewMatrix * vec4(pos4.xyz, 1.0)).xyz;\n return vec4(xyz, pos4.w * view4D.y + view4D.x);\n}\n","stpq.sample.2d":"varying vec2 vST;\n\nvec4 getSample(vec2 st);\n\nvec4 getSTSample() {\n return getSample(vST);\n}\n","stpq.xyzw.2d":"varying vec2 vUV;\n\nvoid setRawUV(vec4 xyzw) {\n vUV = xyzw.xy;\n}\n","strip.position.normal":"uniform vec4 geometryClip;\nattribute vec4 position4;\nattribute vec3 strip;\n\n// External\nvec3 g
w(this,t,e,!1,n)},r.prototype.writeInt32LE=function(t,e,n){R(this,t,e,!0,n)},r.prototype.writeInt32BE=function(t,e,n){R(this,t,e,!1,n)},r.prototype.writeFloatLE=function(t,e,n){H(this,t,e,!0,n)},r.prototype.writeFloatBE=function(t,e,n){H(this,t,e,!1,n)},r.prototype.writeDoubleLE=function(t,e,n){M(this,t,e,!0,n)},r.prototype.writeDoubleBE=function(t,e,n){M(this,t,e,!1,n)},r.prototype.fill=function(t,e,n){if(t||(t=0),e||(e=0),n||(n=this.length),"string"==typeof t&&(t=t.charCodeAt(0)),j("number"==typeof t&&!isNaN(t),"value is not a number"),j(n>=e,"end < start"),n!==e&&0!==this.length){j(e>=0&&e<this.length,"start out of bounds"),j(n>=0&&n<=this.length,"end out of bounds");for(var r=e;n>r;r++)this[r]=t}},r.prototype.inspect=function(){for(var t=[],e=this.length,r=0;e>r;r++)if(t[r]=L(this[r]),r===n.INSPECT_MAX_BYTES){t[r+1]="...";break}return"<Buffer "+t.join(" ")+">"},r.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(r._useTypedArrays)return new r(this).buffer;for(var t=new Uint8Array(this.length),e=0,n=t.length;n>e;e+=1)t[e]=this[e];return t.buffer}throw new Error("Buffer.toArrayBuffer not supported in this browser")};var q=r.prototype;r._augment=function(t){return t._isBuffer=!0,t._get=t.get,t._set=t.set,t.get=q.get,t.set=q.set,t.write=q.write,t.toString=q.toString,t.toLocaleString=q.toString,t.toJSON=q.toJSON,t.copy=q.copy,t.slice=q.slice,t.readUInt8=q.readUInt8,t.readUInt16LE=q.readUInt16LE,t.readUInt16BE=q.readUInt16BE,t.readUInt32LE=q.readUInt32LE,t.readUInt32BE=q.readUInt32BE,t.readInt8=q.readInt8,t.readInt16LE=q.readInt16LE,t.readInt16BE=q.readInt16BE,t.readInt32LE=q.readInt32LE,t.readInt32BE=q.readInt32BE,t.readFloatLE=q.readFloatLE,t.readFloatBE=q.readFloatBE,t.readDoubleLE=q.readDoubleLE,t.readDoubleBE=q.readDoubleBE,t.writeUInt8=q.writeUInt8,t.writeUInt16LE=q.writeUInt16LE,t.writeUInt16BE=q.writeUInt16BE,t.writeUInt32LE=q.writeUInt32LE,t.writeUInt32BE=q.writeUInt32BE,t.writeInt8=q.writeInt8,t.writeInt16LE=q.writeInt16LE,t.writeInt16BE=q.writeInt16BE,t.writeInt32LE=q.writeInt32LE,t.writeInt32BE=q.writeInt32BE,t.writeFloatLE=q.writeFloatLE,t.writeFloatBE=q.writeFloatBE,t.writeDoubleLE=q.writeDoubleLE,t.writeDoubleBE=q.writeDoubleBE,t.fill=q.fill,t.inspect=q.inspect,t.toArrayBuffer=q.toArrayBuffer,t}},{"base64-js":6,ieee754:7}],6:[function(t,e,n){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(t){"use strict";function e(t){var e=t.charCodeAt(0);return e===s||e===c?62:e===a||e===p?63:u>e?-1:u+10>e?e-u+26+26:l+26>e?e-l:h+26>e?e-h+26:void 0}function n(t){function n(t){h[c++]=t}var r,i,s,a,u,h;if(t.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var l=t.length;u="="===t.charAt(l-2)?2:"="===t.charAt(l-1)?1:0,h=new o(3*t.length/4-u),s=u>0?t.length-4:t.length;var c=0;for(r=0,i=0;s>r;r+=4,i+=3)a=e(t.charAt(r))<<18|e(t.charAt(r+1))<<12|e(t.charAt(r+2))<<6|e(t.charAt(r+3)),n((16711680&a)>>16),n((65280&a)>>8),n(255&a);return 2===u?(a=e(t.charAt(r))<<2|e(t.charAt(r+1))>>4,n(255&a)):1===u&&(a=e(t.charAt(r))<<10|e(t.charAt(r+1))<<4|e(t.charAt(r+2))>>2,n(a>>8&255),n(255&a)),h}function i(t){function e(t){return r.charAt(t)}function n(t){return e(t>>18&63)+e(t>>12&63)+e(t>>6&63)+e(63&t)}var i,o,s,a=t.length%3,u="";for(i=0,s=t.length-a;s>i;i+=3)o=(t[i]<<16)+(t[i+1]<<8)+t[i+2],u+=n(o);switch(a){case 1:o=t[t.length-1],u+=e(o>>2),u+=e(o<<4&63),u+="==";break;case 2:o=(t[t.length-2]<<8)+t[t.length-1],u+=e(o>>10),u+=e(o>>4&63),u+=e(o<<2&63),u+="="}return u}var o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="+".charCodeAt(0),a="/".charCodeAt(0),u="0".charCodeAt(0),h="a".charCodeAt(0),l="A".charCodeAt(0),c="-".charCodeAt(0),p="_".charCodeAt(0);t.toByteArray=n,t.fromByteArray=i}("undefined"==typeof n?this.base64js={}:n)},{}],7:[function(t,e,n){n.read=function(t,e,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,h=u>>1,l=-7,c=n?i-1:0,p=n?-1:1,f=t[e+c];for(c+=p,o=f&(1<<-l)-1,f>>=-l,l+=a;l>0;o=256*o+t[e+c],c+=p,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=256*s+t[e+c],c+=p,l-=8);if(0===o)o=1-h;else{if(o===u)return s?NaN:(f?-1:1)*(1/0);s+=Math.pow(2,r),o-=h}return(f?-
a=null!=(i=R[l])?i:[]),o},S.reset=function(){var e,n;h=l=c=0,R=null!=(e=t[c])?e:[],a=null!=(n=R[l])?n:[]};break;case 4:h=l=c=p=0,M=null!=(E=t[p])?E:[],R=null!=(y=M[c])?y:[],a=null!=(_=R[l])?_:[],S=function(){var r,o,s,u;return u=a[h++],h===e&&(h=0,l++,l===n&&(l=0,c++,c===i&&(c=0,p++,M=null!=(r=t[p])?r:[]),R=null!=(o=M[c])?o:[]),a=null!=(s=R[l])?s:[]),u},S.reset=function(){var e,n,r;h=l=c=p=0,M=null!=(e=t[p])?e:[],R=null!=(n=M[c])?n:[],a=null!=(r=R[l])?r:[]};break;case 5:h=l=c=p=f=0,u=null!=(b=t[f])?b:[],M=null!=(T=u[p])?T:[],R=null!=(x=M[c])?x:[],a=null!=(w=R[l])?w:[],S=function(){var r,s,d,m,v;return v=a[h++],h===e&&(h=0,l++,l===n&&(l=0,c++,c===i&&(c=0,p++,p===o&&(p=0,f++,u=null!=(r=t[f])?r:[]),M=null!=(s=u[p])?s:[]),R=null!=(d=M[c])?d:[]),a=null!=(m=R[l])?m:[]),v},S.reset=function(){var e,n,r,i;h=l=c=p=f=0,u=null!=(e=t[f])?e:[],M=null!=(n=u[p])?n:[],R=null!=(r=M[c])?r:[],a=null!=(i=R[l])?i:[]}}return S.rebind=function(o){return t=o,H=r(t),H.length&&(e=H.pop()),H.length&&(n=H.pop()),H.length&&(i=H.pop()),H.length?o=H.pop():void 0},S},n.getStreamer=function(t,e,n,r){var i,o,s,a,u,h,l,c,p;return l=u=h=0,c=function(){return l=e*n*r,u=h=0},o=function(){return h},s=function(){return 0>=l-u},p=function(){switch(n){case 1:return function(t){u+=t,h+=t};case 2:return function(t){u+=2*t,h+=t};case 3:return function(t){u+=3*t,h+=t};case 4:return function(t){u+=4*t,h+=t}}}(),i=function(){switch(n){case 1:return function(e){e(t[u++]),++h};case 2:return function(e){e(t[u++],t[u++]),++h};case 3:return function(e){e(t[u++],t[u++],t[u++]),++h};case 4:return function(e){e(t[u++],t[u++],t[u++],t[u++]),++h}}}(),a=function(){switch(n){case 1:return function(e){t[u++]=e,++h};case 2:return function(e,n){t[u++]=e,t[u++]=n,++h};case 3:return function(e,n,r){t[u++]=e,t[u++]=n,t[u++]=r,++h};case 4:return function(e,n,r,i){t[u++]=e,t[u++]=n,t[u++]=r,t[u++]=i,++h}}}(),i.reset=c,a.reset=c,c(),{emit:a,consume:i,skip:p,count:o,done:s,reset:c}},n.getLerpEmitter=function(t,e){var n,r,i,o,s,a,u,h,l,c,p;return p=new Float32Array(4096),s=a=.5,u=h=l=c=0,r=function(t,e,n,r){return l++,p[u++]=t*s,p[u++]=e*s,p[u++]=n*s,p[u++]=r*s},i=function(t,e,n,r){return c++,p[h++]+=t*a,p[h++]+=e*a,p[h++]+=n*a,p[h++]+=r*a},n=Math.max(t.length,e.length),o=3>=n?function(n,o,s){var a,f,d,m,v,g;for(u=h=l=c=0,t(r,o,s),e(i,o,s),d=Math.min(l,c),f=0,g=[],a=m=0,v=d;v>=0?v>m:m>v;a=v>=0?++m:--m)g.push(n(p[f++],p[f++],p[f++],p[f++]));return g}:5>=n?function(n,o,s,a,f){var d,m,v,g,E,y;for(u=h=l=c=0,t(r,o,s,a,f),e(i,o,s,a,f),v=Math.min(l,c),m=0,y=[],d=g=0,E=v;E>=0?E>g:g>E;d=E>=0?++g:--g)y.push(n(p[m++],p[m++],p[m++],p[m++]));return y}:7>=n?function(n,o,s,a,f,d,m){var v,g,E,y,_;for(u=h=l=c=0,t(r,o,s,a,f,d,m),e(i,o,s,a,f,d,m),g=Math.min(l,c),v=0,_=[],m=E=0,y=g;y>=0?y>E:E>y;m=y>=0?++E:--E)_.push(n(p[v++],p[v++],p[v++],p[v++]));return _}:9>=n?function(n,o,s,a,f,d,m,v,g){var E,y,_,b;for(u=h=l=c=0,t(r,o,s,a,f,d,m,v,g),e(i,o,s,a,f,d,m,v,g),E=Math.min(l,c),g=0,b=[],v=y=0,_=E;_>=0?_>y:y>_;v=_>=0?++y:--y)b.push(n(p[g++],p[g++],p[g++],p[g++]));return b}:function(n,o,s,a,f,d,m,v,g,E,y){var _,b,T,x;for(u=h=0,t(r,o,s,a,f,d,m,v,g,E,y),e(i,o,s,a,f,d,m,v,g,E,y),_=Math.min(l,c),g=0,x=[],v=b=0,T=_;T>=0?T>b:b>T;v=T>=0?++b:--b)x.push(n(p[g++],p[g++],p[g++],p[g++]));return x},o.lerp=function(t){var e;return e=[1-t,t],s=e[0],a=e[1],e},o},n.getLerpThunk=function(t,e){var r,i,o,s,a,u;return i=n.getSizes(t).reduce(function(t,e){return t*e}),o=n.getSizes(e).reduce(function(t,e){return t*e}),r=Math.min(i,o),a=n.getThunk(t),u=n.getThunk(e),s=new Float32Array(r),s.lerp=function(t){var e,n,i,o;for(a.reset(),u.reset(),i=0,o=[];r>i;)e=a(),n=u(),o.push(s[i++]=e+(n-e)*t);return o},s}},{}],21:[function(t,e,n){var r,i;i=Math.PI,r={clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},cosine:function(t){return.5-.5*Math.cos(r.clamp(t,0,1)*i)},binary:function(t){return+(t>=.5)},hold:function(t){return+(t>=1)}},e.exports=r},{}],22:[function(t,e,n){var r,i,o,s,a,u=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};i="xyzw".split(""),r={0:-1,x:0,y:1,z:2,w:3},o=function(t){re
},s.push(y[r]=null!=(o=u.equals)?o:function(t,e){return t===e});return s},P=[],it={},k=0,C=J.length;C>k;k++)Q=J[k],G=Q.split(":"),Q=G[0],D=G[1],O=D?[D,Q].join("."):Q,X=n.getTrait(Q),P.push(Q),null!=X&&h(O,X);if(null!=I)for(D in I)X=I[D],h(D,X);if(tt=P.filter(function(t,e){return P.indexOf(t)===e}),t.traits=tt,null!=N&&t.set(N,!0,!0),null!=w)for(A in w)rt=w[A],d(A,rt,!0);null!=B&&t.set(B,!1,!0),null!=F&&t.bind(F,!0),null!=U&&t.bind(U,!1),this.dispose=function(){for(A in i)$(A,!0);for(A in a)$(A,!1);return I={},delete t.attributes,delete t.get,delete t.set}}return t}(),e.exports=r},{}],32:[function(t,e,n){var r,i,o=function(t,e){function n(){this.constructor=t}for(var r in e)s.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},s={}.hasOwnProperty;i=t("./node"),r=function(t){function e(t,n,r,i,o,s){e.__super__.constructor.call(this,t,n,r,i,o,s),this.children=[],this.on("reindex",function(t){return function(e){var n,r,i,o,s;for(o=t.children,s=[],r=0,i=o.length;i>r;r++)n=o[r],s.push(n.trigger(e));return s}}(this))}return o(e,t),e.prototype.add=function(t){var e;return null!=(e=t.parent)&&e.remove(t),t._index(this.children.length,this),this.children.push(t),t._added(this)},e.prototype.remove=function(t){var e,n,r,i,o,s;if((null!=(o=t.children)?o.length:void 0)&&t.empty(),n=this.children.indexOf(t),-1!==n)for(this.children.splice(n,1),t._index(null),t._removed(this),s=this.children,e=r=0,i=s.length;i>r;e=++r)t=s[e],e>=n&&t._index(e)},e.prototype.empty=function(){var t,e,n,r;for(t=this.children.slice().reverse(),e=0,n=t.length;n>e;e++)r=t[e],this.remove(r)},e}(i),e.exports=r},{"./node":36}],33:[function(t,e,n){var r;r=function(){function t(t){this.limit=null!=t?t:10}return t.prototype.iterate=function(t){var e,n,r,i;for(i=t.step,e=t.last,n=this.limit;r=i();)if(!--n)throw console.warn("Last iteration","function"==typeof e?e():void 0),new Error("Exceeded iteration limit.");return null},t}(),e.exports=r},{}],34:[function(t,e,n){n.Attributes=t("./attributes"),n.Group=t("./group"),n.Guard=t("./guard"),n.Model=t("./model"),n.Node=t("./node")},{"./attributes":31,"./group":32,"./guard":33,"./model":35,"./node":36}],35:[function(t,e,n){var r,i,o,s,a,u,h,l,c,p=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};l=t("cssauron"),r="*",s=/^#([A-Za-z0-9_])$/,o=/^\.([A-Za-z0-9_]+)$/,u=/^\[([A-Za-z0-9_]+)\]$/,h=/^[A-Za-z0-9_]+$/,i=/^<([0-9]+|<*)$/,c=null,a=function(){function t(t){var e,n,r,i,o,s,a,u,h,p,f,d,m,v,g,E,y,_,b,T,x,w;this.root=t,this.root.model=this,this.root.root=this.root,this.ids={},this.classes={},this.traits={},this.types={},this.nodes=[],this.watchers=[],this.fire=!1,this.lastNode=null,this.event={type:"update"},null==c&&(c=l({tag:"type",id:"id","class":"classes.join(' ')",parent:"parent",children:"children",attr:"traits.hash[attr]"})),e=function(t){return function(t){return u(t.node)}}(this),v=function(t){return function(t){return p(t.node)}}(this),this.root.on("add",e),this.root.on("remove",v),u=function(t){return function(t){return i(t),a(t),s(t),t.on("change:node",w),w(null,t,!0),f(t)}}(this),p=function(t){return function(t){return y(t),T(t),b(t),E(t.id,t),g(t.classes,t),t.off("change:node",w),f(t)}}(this),m=function(t){return function(e){var n,r,i,o;for(i=t.watchers,n=0,r=i.length;r>n;n++)o=i[n],o.match=o.matcher(e);return null}}(this),h=function(t){return function(e){var n,r,i,o,s;for(o=t.watchers,r=0,i=o.length;i>r;r++)s=o[r],n=s.fire||(s.fire=s.match!==s.matcher(e)),n&&(t.lastNode=e),t.fire||(t.fire=n);return null}}(this),f=function(t){return function(e){var n,r,i,o,s;for(o=t.watchers,r=0,i=o.length;i>r;r++)s=o[r],n=s.fire||(s.fire=s.matcher(e)),n&&(t.lastNode=e),t.fire||(t.fire=n);return null}}(this),this.digest=function(t){return function(){var e,n,r,i;if(!t.fire)return!1;for(r=t.watchers.slice(),e=0,n=r.length;n>e;e++)i=r[e],i.fire&&(i.fire=!1,i.handler());return t.fire=!1,!0}}(this),w=function(t){return function(t,e,i){var o,s,a,u,l,c,p,f;return o=i||t.changed["node.id"],s=i||t.changed["node.classes"],c=!1,o&&(u=e.get
var e;return e=this.getDimensions(),this.alignShader(e,t),this.buffer.shader(t)},e.prototype.getDimensions=function(){return{items:this.items,width:this.space.width,height:this.space.history,depth:1}},e.prototype.getActiveDimensions=function(){return{items:this.items,width:this.used.width,height:this.buffer.getFilled(),depth:1}},e.prototype.getFutureDimensions=function(){return{items:this.items,width:this.used.width,height:this.space.history,depth:1}},e.prototype.getRawDimensions=function(){return{items:this.items,width:space.width,height:1,depth:1}},e.prototype.make=function(){var t,n,r,i,s,a,u,h,l,c,p,f,d,m;return e.__super__.make.apply(this,arguments),u=null!=(h=this.minFilter)?h:this.props.minFilter,a=null!=(l=this.magFilter)?l:this.props.magFilter,d=null!=(c=this.type)?c:this.props.type,m=this.props.width,i=this.props.history,p=this.props.bufferWidth,t=this.props.channels,s=this.props.items,r=this.spec={channels:t,items:s,width:m},this.items=r.items,this.channels=r.channels,n=this.props.data,r=o.Data.getDimensions(n,r),f=this.space,f.width=Math.max(p,r.width||1),f.history=i,this.buffer=this._renderables.make(this.storage,{width:f.width,history:f.history,channels:t,items:s,minFilter:u,magFilter:a,type:d})},e.prototype.unmake=function(){return e.__super__.unmake.apply(this,arguments),this.buffer?(this.buffer.dispose(),this.buffer=this.spec=null):void 0},e.prototype.change=function(t,e,n){var r;if(e.texture||t["history.history"]||t["buffer.channels"]||t["buffer.items"]||t["array.bufferWidth"])return this.rebuild();if(this.buffer)return t["array.width"]&&(r=this.props.width,r>this.space.width)?this.rebuild():t["data.map"]||t["data.data"]||t["data.resolve"]||t["data.expr"]||n?this.buffer.setCallback(this.emitter()):void 0},e.prototype.callback=function(t){return t.length<=2?t:function(e){return function(n,r){return t(n,r,e.bufferClock,e.bufferStep)}}(this)},e.prototype.update=function(){var t,e,n,r,i;if(this.buffer)return t=this.props.data,r=this.space,i=this.used,n=i.width,e=this.buffer.getFilled(),this.syncBuffer(function(e){return function(n){var s,a,u;return null!=t?(a=o.Data.getDimensions(t,e.spec),a.width>r.width?(n(),e.rebuild()):(i.width=a.width,e.buffer.setActive(i.width),"function"==typeof(s=e.buffer.callback).rebind&&s.rebind(t),e.buffer.update())):(u=e.spec.width||1,e.buffer.setActive(u),u=e.buffer.update(),i.width=u)}}(this)),i.width!==n||e!==this.buffer.getFilled()?this.trigger({type:"source.resize"}):void 0},e}(i),e.exports=r},{"../../../util":175,"./buffer":55}],55:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;i=t("./data"),o=t("../../../util"),r=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.traits=["node","buffer","active","data","source","index","texture"],e.prototype.init=function(){return this.bufferSlack=0,this.bufferFrames=0,this.bufferTime=0,this.bufferDelta=0,this.bufferClock=0,this.bufferStep=0,e.__super__.init.apply(this,arguments)},e.prototype.make=function(){return e.__super__.make.apply(this,arguments),this.clockParent=this._inherit("clock")},e.prototype.unmake=function(){return e.__super__.unmake.apply(this,arguments)},e.prototype.rawBuffer=function(){return this.buffer},e.prototype.emitter=function(){var t,n,r;return r=this.props,t=r.channels,n=r.items,e.__super__.emitter.call(this,t,n)},e.prototype.change=function(t,e,n){var r;return t["buffer.fps"]||n?(r=this.props.fps,this.bufferSlack=r?.5/r:0):void 0},e.prototype.syncBuffer=function(t){var e,n,r,i,o,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_,b;if(this.buffer&&(d=this.props,c=d.live,i=d.fps,a=d.hurry,l=d.limit,f=d.realtime,p=d.observe,r=this.buffer.getFilled(),!r||c)){if(b=this.clockParent.getTime(),null!=i){for(g=this.bufferSlack,E=b.step/b.delta,n=f?b.delta:b.step,o=1/i,y=f&&p?E*o:o,this.bufferSlack=Math.min(l/i,g+n),this.bufferDelta=n,this.bufferStep=y,s=Math.min(a,Math.floor(g*i)),r||(s=Math.max(1,s)),_=!1,e=function(){return _=!0},v=[]
a=this._helpers.object.mask(),u=this._helpers.shade.pipeline()||!1,p=this.props.shape,r=this.props.fill,h=this.props.optical,m=o.JS.merge(v,l,d),this.point=this._renderables.make("point",{uniforms:m,width:g,height:i,depth:e,items:s,position:c,color:t,size:f,shape:p,optical:h,fill:r,mask:a,material:u}),this._helpers.visible.make(),this._helpers.object.make([this.point])):void 0},e.prototype.made=function(){return this.resize()},e.prototype.unmake=function(){return this._helpers.bind.unmake(),this._helpers.visible.unmake(),this._helpers.object.unmake(),this.point=null},e.prototype.change=function(t,e,n){return t["geometry.points"]||t["point.shape"]||t["point.fill"]?this.rebuild():void 0},e}(i),e.exports=r},{"../../../util":175,"../../primitive":44}],67:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;r=t("../../primitive"),o=t("../../../util"),i=function(t){function e(t,n,r){e.__super__.constructor.call(this,t,n,r),this.strip=null}return s(e,t),e.traits=["node","object","visible","style","line","mesh","strip","geometry","position","bind","shade"],e.prototype.resize=function(){var t,e,n,r,i,o;if(null!=this.bind.points)return e=this.bind.points.getActiveDimensions(),r=e.items,o=e.width,n=e.height,t=e.depth,this.strip&&this.strip.geometry.clip(o,n,t,r),this.line&&this.line.geometry.clip(r,o,n,t),null!=this.bind.map&&(i=this.bind.map.getActiveDimensions(),this.strip)?this.strip.geometry.map(i.width,i.height,i.depth,i.items):void 0},e.prototype.make=function(){var t,e,n,r,i,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_,b,T,x,w,R,H;return this._helpers.bind.make([{to:"geometry.points",trait:"source"},{to:"geometry.colors",trait:"source"},{to:"mesh.map",trait:"source"}]),null!=this.bind.points?(v=this._shaders.shader(),v=this.bind.points.sourceShader(v),v=this._helpers.position.pipeline(v),b=this._helpers.style.uniforms(),c=this._helpers.line.uniforms(),w=this._inherit("unit").getUnitUniforms(),h=this.props.line,y=this.props.shaded,i=this.props.fill,H={},H.styleZBias=this._attributes.make(this._types.number()),this.wireZBias=H.styleZBias,n=this.bind.points.getDimensions(),a=n.items,R=n.width,s=n.height,e=n.depth,g=this.props,h=g.line,y=g.shaded,i=g.fill,_=g.stroke,u=g.join,this.bind.colors&&(t=this._shaders.shader(),t=this.bind.colors.sourceShader(t)),f=this._helpers.object.mask(),p=this._helpers.shade.map(null!=(E=this.bind.map)?E.sourceShader(this._shaders.shader()):void 0),d=this._helpers.shade.pipeline(),r=d||y,l=d||!1,m=[],h&&(T=this._shaders.shader(),T.pipe(o.GLSL.swizzleVec4("yzwx")),T.pipe(v),x=o.JS.merge(w,c,b,H),this.line=this._renderables.make("line",{uniforms:x,samples:a,strips:R,ribbons:s,layers:e,position:T,color:t,stroke:_,join:u,mask:f,material:l}),m.push(this.line)),i&&(x=o.JS.merge(b,{}),this.strip=this._renderables.make("strip",{uniforms:x,width:R,height:s,depth:e,items:a,position:v,color:t,material:r}),m.push(this.strip)),this._helpers.visible.make(),this._helpers.object.make(m)):void 0},e.prototype.made=function(){return this.resize()},e.prototype.unmake=function(){return this._helpers.bind.unmake(),this._helpers.visible.unmake(),this._helpers.object.unmake(),this.strip=null},e.prototype.change=function(t,e,n){var r,i,o,s;return t["geometry.points"]||e.mesh?this.rebuild():t["style.zBias"]||t["mesh.lineBias"]||n?(o=this.props,r=o.fill,s=o.zBias,i=o.lineBias,this.wireZBias.value=s+(r?i:0)):void 0},e}(r),e.exports=i},{"../../../util":175,"../../primitive":44}],68:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;r=t("../../primitive"),o=t("../../../util"),i=function(t){function e(t,n,r){e.__super__.constructor.call(this,t,n,r),this.lineX=this.lineY=this.surface=null}return s(e,t),e.traits=["node","object","visible","style","line","mesh","geometry","surface","position","grid","bind","shade"],e.defaults={lineX:!
height:r,depth:t}),this.memo.adopt(this.compose),this.objects=[this.compose],this.renders=this.compose.renders):void 0},e.prototype.unmake=function(){return e.__super__.unmake.apply(this,arguments),null!=this.bind.source?(this._helpers.active.unmake(),this.memo.unadopt(this.compose),this.memo.dispose(),this.memo=this.compose=null):void 0},e.prototype.update=function(){var t;return null!=(t=this.memo)?t.render():void 0},e.prototype.resize=function(){var t,n,r,i;if(null!=this.bind.source)return n=this.bind.source.getActiveDimensions(),i=n.width,r=n.height,t=n.depth,this.compose.cover(i,r,t),e.__super__.resize.apply(this,arguments)},e.prototype.change=function(t,e,n){return e.texture||e.operator?this.rebuild():void 0},e}(i),e.exports=r},{"../../../util":175,"./operator":78}],78:[function(t,e,n){var r,i,o=function(t,e){function n(){this.constructor=t}for(var r in e)s.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},s={}.hasOwnProperty;i=t("../base/source"),r=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return o(e,t),e.traits=["node","bind","operator","source","index"],e.prototype.indexShader=function(t){var e;return null!=(e=this.bind.source)&&"function"==typeof e.indexShader?e.indexShader(t):void 0},e.prototype.sourceShader=function(t){var e;return null!=(e=this.bind.source)&&"function"==typeof e.sourceShader?e.sourceShader(t):void 0},e.prototype.getDimensions=function(){return this.bind.source.getDimensions()},e.prototype.getFutureDimensions=function(){return this.bind.source.getFutureDimensions()},e.prototype.getActiveDimensions=function(){return this.bind.source.getActiveDimensions()},e.prototype.getIndexDimensions=function(){return this.bind.source.getIndexDimensions()},e.prototype.init=function(){return this.sourceSpec=[{to:"operator.source",trait:"source"}]},e.prototype.make=function(){return e.__super__.make.apply(this,arguments),this._helpers.bind.make(this.sourceSpec)},e.prototype.made=function(){return this.resize(),e.__super__.made.apply(this,arguments)},e.prototype.unmake=function(){return this._helpers.bind.unmake()},e.prototype.resize=function(t){return this.trigger({type:"source.resize"})},e}(i),e.exports=r},{"../base/source":49}],79:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;r=t("../../primitive"),o=t("../../../util"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.traits=["node","bind","operator","readback","entity","active"],e.finals={channels:4},e.prototype.init=function(){return this.emitter=this.root=null,this.active={}},e.prototype.make=function(){var t,n,r,i,o,s,a,u,h,l;return e.__super__.make.apply(this,arguments),this._compute("readback.data",function(t){return function(){var e;return null!=(e=t.readback)?e.data:void 0}}(this)),this._compute("readback.items",function(t){return function(){var e;return null!=(e=t.readback)?e.items:void 0}}(this)),this._compute("readback.width",function(t){return function(){var e;return null!=(e=t.readback)?e.width:void 0}}(this)),this._compute("readback.height",function(t){return function(){var e;return null!=(e=t.readback)?e.height:void 0}}(this)),this._compute("readback.depth",function(t){return function(){var e;return null!=(e=t.readback)?e.depth:void 0}}(this)),this._helpers.bind.make([{to:"operator.source",trait:"source"}]),null!=this.bind.source?(s=this.props,h=s.type,t=s.channels,r=s.expr,this.root=this._inherit("root"),this._listen("root","root.update",this.update),a=this.bind.source.getDimensions(),o=a.items,l=a.width,i=a.height,n=a.depth,u=this.bind.source.sourceShader(this._shaders.shader()),this.readback=this._renderables.make("readback",{map:u,items:o,width:l,height:i,depth:n,channels:t,type:h}),null!=r&&this.readback.setCallback(r),this._helpers.active.make()):void 0},e.prototype.unmake=function(){return null!=this.readback&&(this.readback.dispose(),this.readb
this._listen("slide","slide.step",function(t){return function(e){var n;return n=t.props.trigger,null!=n&&e.index===n?t.reset():null!=n&&0===e.index?t.reset(!1):void 0}}(this)),this.props.trigger&&null!=this._inherit("slide")||this.reset(),t=this._inherit("clock"),this._listen(t,"clock.tick",function(e){return function(){var n,r,i,o,s,a,u,h,l,c,p,f;return l=e.props,i=l.from,f=l.to,c=l.speed,a=l.pace,n=l.delay,h=l.realtime,p=t.getTime(),null!=e.skew?(o=h?p.time:p.clock,r=h?p.delta:p.step,u=c/a,null==e.start&&(e.start=o),e.skew+=r*(u-1),s=Math.max(0,o-e.start+e.skew-n*u),e.props.loop&&(s%=f-i),e.playhead=Math.min(f,i+s)):e.playhead=0,e.update()}}(this))},e.prototype.update=function(){return e.__super__.update.apply(this,arguments)},e.prototype.change=function(t,n,r){return t["trigger.trigger"]||t["play.realtime"]?this.rebuild():e.__super__.change.call(this,t,n,r)},e}(i),e.exports=r},{"./track":96}],92:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;r=t("../base/parent"),o=t("../../../util"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.traits=["node","present"],e.prototype.init=function(){},e.prototype.make=function(){return this.nodes=[],this.steps=[],this.length=0,this.last=[],this.index=0,this.dirty=[],this._listen("root","root.update",this.update),this._compute("present.length",function(t){return function(){return t.length}}(this))},e.prototype.adopt=function(t){var e;return e=t.node,this.nodes.indexOf(t)<0&&this.nodes.push(e),this.dirty.push(t)},e.prototype.unadopt=function(t){var e;return e=t.node,this.nodes=this.nodes.filter(function(e){return e!==t}),this.dirty.push(t)},e.prototype.update=function(){var t,e,n,r,i;if(this.dirty.length){for(r=this.dirty,e=0,n=r.length;n>e;e++)t=r[e],this.slideReset(t);return i=this.process(this.nodes),this.steps=i[0],this.indices=i[1],this.length=this.steps.length,this.index=null,this.go(this.props.index),this.dirty=[]}},e.prototype.slideLatch=function(t,e,n){return t.slideLatch(e,n)},e.prototype.slideStep=function(t,e,n){return t.slideStep(this.mapIndex(t,e),n)},e.prototype.slideRelease=function(t,e){return t.slideRelease()},e.prototype.slideReset=function(t){return t.slideReset()},e.prototype.mapIndex=function(t,e){return e-this.indices[t.node._id]},e.prototype.process=function(t){var e,n,r,i,o,s,a,u,h,l,c,p;return h=function(t){var e,n,r,i;for(i=[],n=0,r=t.length;r>n;n++)e=t[n],i.push(a(e).filter(o));return i},p=function(t){return function(e){var n,r,i;for(i=[];e&&(r=[t(e),e],e=r[0],n=r[1],r);)i.push(n);return i}},a=p(function(t){return t.parent.traits.hash.present?null:t.parent}),o=function(e){return t.indexOf(e)>=0},i=function(t,e){var n,r,i,o,s,a;if(n=t.length,r=e.length,i=n-r,0!==i)return!1;for(i=Math.min(n,r),o=s=a=i-1;0>=a?0>s:s>0;o=0>=a?++s:--s)if(t[o]!==e[o])return!1;return!0},s=function(t){return t.sort(function(t,e){var n,r,i,o,s,a,u,h,l,c;for(n=t.length,r=e.length,i=Math.min(n,r),a=u=1,c=i;c>=1?c>=u:u>=c;a=c>=1?++u:--u){if(h=t[n-a],l=e[r-a],o=h.props.order,s=l.props.order,null!=o||null!=s){if(null!=o&&null!=s&&0!==(i=o-s))return i;if(null!=o)return-1;if(null!=s)return 1}if(l.order!==h.order)return l.order-h.order}return i=n-r,0!==i?i:0})},l=function(t){var e,n,r,i,o,s;for(o=[],e=[],n=0,r=t.length;r>n;n++)s=t[n],(null!=(i=s[0]).props.steps?o:e).push(s);return[o,e]},n=function(t){var n,i,o,s,a,u,h,l,c,p,f,d;for(c=t[0],n=t[1],l=100,o={},d=[],p=function(t,e){var n,r,i,s,a,u,h,c,p,f,m,v;for(p=(u=t[0]).props,h=t[1],c=null!=h?o[h._id]:0,n=e,r=null!=p.from?c+p.from:n-p.early,v=null!=p.to?c+p.to:n+p.steps+p.late,r=Math.max(0,r),v=Math.min(l,v),null==o[a=u._id]&&(o[a]=r),i=s=f=r,m=v;m>=f?m>s:s>m;i=m>=f?++s:--s)d[i]=(null!=d[i]?d[i]:d[i]=[]).concat(t);return p.steps},i=0,s=0,u=c.length;u>s;s++)f=c[s],i+=p(f,i);for(a=0,h=n.length;h>a;a++)f=n[a],p(f,0);return d=function(){var t,n,i;for(i=[],t=0,n=d.length;n>t;t++)f=d[t],i.push(r(e(f)));return i}(),[d,o]},e=function(t){var e
a={spriteDepth:this.node.attributes["attach.depth"],spriteOffset:this.node.attributes["attach.offset"],spriteSnap:this.node.attributes["attach.snap"],spriteScale:this._attributes.make(this._types.number()),outlineStep:this._attributes.make(this._types.number()),outlineExpand:this._attributes.make(this._types.number()),outlineColor:this.node.attributes["label.background"]},this.spriteScale=a.spriteScale,this.outlineStep=a.outlineStep,this.outlineExpand=a.outlineExpand,p=v?"label.outline":"label.alpha",n=this._shaders.shader().pipe(p,a),this.bind.colors&&(t=this._shaders.shader(),this.bind.colors.sourceShader(t)),h=this._helpers.object.mask(),d=this._helpers.style.uniforms(),E=this._inherit("unit").getUnitUniforms(),g=o.JS.merge(E,d,a),this.sprite=this._renderables.make("sprite",{uniforms:g,width:y,height:i,depth:r,items:s,position:c,sprite:f,map:u,combine:n,color:t,mask:h,linear:!0}),this._helpers.visible.make(),this._helpers.object.make([this.sprite])):void 0},e.prototype.unmake=function(){return this._helpers.bind.unmake(),this._helpers.visible.unmake(),this._helpers.object.unmake(),this.sprite=null},e.prototype.resize=function(){var t,e,n,r,i,o;return r=this.bind.points.getActiveDimensions(),i=this.bind.text.getActiveDimensions(),n=Math.min(r.items,i.items),o=Math.min(r.width,i.width),e=Math.min(r.height,i.height),t=Math.min(r.depth,i.depth),this.sprite.geometry.clip(o,e,t,n)},e.prototype.change=function(t,e,n){var r,i,o,s,a;if(e.geometry||t["label.text"])return this.rebuild();if(null!=this.bind.points)return a=this.props.size,o=this.props.outline,r=this.props.expand,i=this.bind.text.textHeight(),s=a/i,this.outlineExpand.value=r/s*16/255,this.outlineStep.value=o/s*16/255,this.spriteScale.value=s},e}(i),e.exports=r},{"../../../util":175,"../../primitive":44}],103:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;r=t("../operator/resample"),o=t("../../../util"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.traits=["node","bind","operator","resample","sampler:x","sampler:y","sampler:z","sampler:w","include","text"],e.prototype.init=function(){return this.sourceSpec=[{to:"operator.source",trait:"text"}]},e.prototype.textShader=function(t){return this.bind.source.textShader(t)},e.prototype.textIsSDF=function(){var t;return(null!=(t=this.bind.source)?t.props.sdf:void 0)>0},e.prototype.textHeight=function(){var t;return null!=(t=this.bind.source)?t.props.detail:void 0},e}(r),e.exports=i},{"../../../util":175,"../operator/resample":81}],104:[function(t,e,n){var r,i,o,s,a=function(t,e){function n(){this.constructor=t}for(var r in e)u.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},u={}.hasOwnProperty;r=t("../data/buffer"),s=t("../data/voxel"),o=t("../../../util"),i=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return a(e,t),e.traits=["node","buffer","active","data","texture","voxel","text","font"],e.defaults={minFilter:"linear",magFilter:"linear"},e.finals={channels:1},e.prototype.init=function(){return e.__super__.init.apply(this,arguments),this.atlas=null},e.prototype.textShader=function(t){return this.atlas.shader(t)},e.prototype.textIsSDF=function(){return this.props.sdf>0},e.prototype.textHeight=function(){return this.props.detail},e.prototype.make=function(){var t,e,n,i,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_,b,T,x,w,R,H,M,S;return d=this.props,f=d.minFilter,p=d.magFilter,R=d.type,m=this.props,h=m.font,w=m.style,H=m.variant,M=m.weight,s=m.detail,T=m.sdf,this.atlas=this._renderables.make("textAtlas",{font:h,size:s,style:w,variant:H,weight:M,outline:T,minFilter:f,magFilter:p,type:R}),this.minFilter=THREE.NearestFilter,this.magFilter=THREE.NearestFilter,this.type=THREE.FloatType,r.prototype.make.call(this),f=null!=(v=this.minFilter)?v:this.props.minFilter,p=null!=(g=this.magFilter)?g:this.props.magFilter,R=null!=(E=this.type)?E:this.props.type,S
e=r.letters(r.axis(null,!1),4,t),{make:function(){return e.make()},validate:function(t,r,i){var o,s,a,u,h;return u=[1,2,3,4],n.validate(t,u,i),u.length<4&&(a=[1,2,3,4].filter(function(t){return-1===u.indexOf(t)}),u=u.concat(a)),h=function(){var t,e,n;for(n=[],o=t=0,e=u.length;e>t;o=++t)s=u[o],n.push(u.indexOf(s)===o);return n}(),h.indexOf(!1)<0?e.validate(u,r,i):i()},equals:e.equals,clone:e.clone}},swizzle:function(t,e){var n,i;return null==t&&(t=[1,2,3,4]),null==e&&(e=null),null==e&&(e=t.length),t=t.slice(0,e),i=r.letters(r.axis(null,!1),0,t),n=r.letters(r.axis(null,!0),e,t),{make:function(){return n.make()},validate:function(r,o,s){var a;return a=t.slice(),i.validate(r,a,s),a.length<e&&(a=a.concat([0,0,0,0]).slice(0,e)),n.validate(a,o,s)},equals:n.equals,clone:n.clone}},classes:function(){var t;return t=r.array(r.string()),{make:function(){return t.make()},validate:function(e,n,r){return e===""+e&&(e=e.split(" ")),e=e.filter(function(t){return!!t.length}),t.validate(e,n,r)},equals:t.equals,clone:t.clone}},blending:function(t){var e;return null==t&&(t="normal"),e=["no","normal","add","subtract","multiply","custom"],r["enum"](t,e)},filter:function(t){var e;return null==t&&(t="nearest"),e={nearest:THREE.NearestFilter,nearestMipMapNearest:THREE.NearestMipMapNearestFilter,nearestMipMapLinear:THREE.NearestMipMapLinearFilter,linear:THREE.LinearFilter,linearMipMapNearest:THREE.LinearMipMapNearestFilter,linearMipmapLinear:THREE.LinearMipMapLinearFilter},r["enum"](t,[],e)},type:function(t){var e;return null==t&&(t="unsignedByte"),e={unsignedByte:THREE.UnsignedByteType,"byte":THREE.ByteType,"short":THREE.ShortType,unsignedShort:THREE.UnsignedShortType,"int":THREE.IntType,unsignedInt:THREE.UnsignedIntType,"float":THREE.FloatType},r["enum"](t,[],e)},scale:function(t){var e;return null==t&&(t="linear"),e=["linear","log"],r["enum"](t,e)},mapping:function(t){var e;return null==t&&(t="relative"),e=["relative","absolute"],r["enum"](t,e)},indexing:function(t){var e;return null==t&&(t="original"),e=["original","final"],r["enum"](t,e)},shape:function(t){var e;return null==t&&(t="circle"),e=["circle","square","diamond","up","down","left","right"],r["enum"](t,e)},join:function(t){var e;return null==t&&(t="miter"),e=["miter","round","bevel"],r["enum"](t,e)},stroke:function(t){var e;return null==t&&(t="solid"),e=["solid","dotted","dashed"],r["enum"](t,e)},vertexPass:function(t){var e;return null==t&&(t="view"),e=["data","view","world","eye"],r["enum"](t,e)},fragmentPass:function(t){var e;return null==t&&(t="light"),e=["color","light","rgba"],r["enum"](t,e)},ease:function(t){var e;return null==t&&(t="linear"),e=["linear","cosine","binary","hold"],r["enum"](t,e)},fit:function(t){var e;return null==t&&(t="contain"),e=["x","y","contain","cover"],r["enum"](t,e)},anchor:function(t){var e;return null==t&&(t="middle"),e={first:1,middle:0,last:-1},r.enumber(t,[],e)},transitionState:function(t){var e;return null==t&&(t="enter"),e={enter:-1,visible:0,exit:1},r.enumber(t,[],e)},font:function(t){var e,n;return null==t&&(t="sans-serif"),e=i.JS.parseQuoted,t instanceof Array||(t=e(t)),n=r.array(r.string(),0,t),{make:function(){return n.make()},validate:function(t,r,i){try{t instanceof Array||(t=e(t))}catch(o){return i()}return t=t.filter(function(t){return!!t.length}),n.validate(t,r,i)},equals:n.equals,clone:n.clone}},data:function(t){return null==t&&(t=[]),{make:function(){return[]},validate:function(t,e,n){return t instanceof Array?t:null!=(null!=t?t.length:void 0)?t:n()},emitter:function(t,e){return i.Data.getLerpThunk(t,e)}}}},o=function(t){var e,n;for(e in t)n=t[e],t[e]=function(t){return function(){var e;return e=t.apply(t,arguments),null==e.validate&&(e.validate=function(t){return null!=t}),null==e.equals&&(e.equals=function(t,e){return t===e}),null==e.clone&&(e.clone=function(t){var e;return null!=(e=null!=t&&"function"==typeof t.clone?t.clone():void 0)?e:t}),e}}(n);return t},e.exports=o(r)},{"../../util":175}],116:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.
this.active.width=o[1],this.active.height=o[2],this.active.depth=o[3],null!=(s=this.floatCompose)&&s.cover(e,n,r),null!=(a=this.byteCompose)&&a.cover(e*this.stretch,n,r),t=this.items,e=this.active.width,n=1===this.depth?this.active.height:this.height,r=this.active.depth,c=t*e*this.stretch,i=n*r,u=[t,e,n,r],this.sampled.items=u[0],this.sampled.width=u[1],this.sampled.height=u[2],this.sampled.depth=u[3],h=[c,i],this.rect.w=h[0],this.rect.h=h[1],l=[this.sampled.width-this.active.width,this.sampled.height-this.active.height,this.sampled.depth-this.active.depth,this.sampled.items-this.active.items],this.pad.x=l[0],this.pad.y=l[1],this.pad.z=l[2],this.pad.w=l[3],l},e.prototype.update=function(t){var e,n;return null!=(e=this.floatMemo)&&e.render(t),null!=(n=this.byteMemo)?n.render(t):void 0},e.prototype.post=function(){return this.renderer.setRenderTarget(this.byteMemo.target.write),this.gl.readPixels(0,0,this.rect.w,this.rect.h,gl.RGBA,gl.UNSIGNED_BYTE,this.bytes)},e.prototype.readFloat=function(t){var e;return null!=(e=this.floatMemo)?e.read(t):void 0},e.prototype.readByte=function(t){var e;return null!=(e=this.byteMemo)?e.read(t):void 0},e.prototype.setCallback=function(t){return this.emitter=this.callback(t)},e.prototype.callback=function(t){var e,n,r,i,o;return this.isIndexed?(r=this.width,n=this.height,i=this.depth,o=this.items,e=function(e,i,s,a){var u,h,l,c,p;return u=a,p=u%o,u=(u-p)/o,h=u%r,u=(u-h)/r,l=u%n,u=(u-l)/n,c=u,t(e,i,s,a,h,l,c,p)},e.reset=function(){return"function"==typeof t.reset?t.reset():void 0},e):t},e.prototype.iterate=function(){var t,e,n,r,i,o,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_,b;for(i=this.emitter,"function"==typeof i.reset&&i.reset(),E=this.streamer,e=E.consume,b=E.skip,n=E.count,r=E.done,_=E.reset,_(),c=0|this.sampled.width,l=0|this.sampled.height,p=0|this.sampled.depth,f=0|this.sampled.items,m=0|this.pad.x,v=0|this.pad.y,g=0|this.pad.z,d=0|this.pad.w,h=c*l*f*(p-g),this.isIndexed||(t=i,i=function(e,n,r,i){return t(e,n,r,i,o,s,a,u)}),o=s=a=u=l=0;!r()&&h>l&&(l++,y=e(i),++u===f-d&&(b(m),u=0,++o===c-m&&(b(f*m),o=0,++s===l-v&&(b(f*c*v),s=0,a++))),y!==!1););return Math.floor(n()/f)},e.prototype.dispose=function(){var t,e,n,r,i,o;return null!=(t=this.floatMemo)&&t.unadopt(this.floatCompose),null!=(e=this.floatMemo)&&e.dispose(),null!=(n=this.floatCompose)&&n.dispose(),null!=(r=this.byteMemo)&&r.unadopt(this.byteCompose),null!=(i=this.byteMemo)&&i.dispose(),null!=(o=this.byteCompose)&&o.dispose(),this.floatMemo=this.byteMemo=this.floatCompose=this.byteCompose=null},e}(a),e.exports=s},{"../../util":175,"../meshes/memoscreen":155,"../renderable":161,"./buffer":125,"./memo":128}],131:[function(t,e,n){var r,i,o,s,a=function(t,e){function n(){this.constructor=t}for(var r in e)u.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},u={}.hasOwnProperty;o=t("../renderable"),r=t("./texture/rendertarget"),s=t("../../util"),i=function(t){function e(t,n,r){var i;this.scene=null!=(i=r.scene)?i:new THREE.Scene,this.camera=r.camera,e.__super__.constructor.call(this,t,n),this.build(r)}return a(e,t),e.prototype.shaderRelative=function(t){return null==t&&(t=this.shaders.shader()),t.pipe("sample.2d",this.uniforms)},e.prototype.shaderAbsolute=function(t,e,n){var r;return null==e&&(e=1),null==n&&(n=4),null==t&&(t=this.shaders.shader()),1>=e?(n>2&&t.pipe(s.GLSL.truncateVec(n,2)),t.pipe("map.2d.data",this.uniforms),t.pipe("sample.2d",this.uniforms)):(r=s.GLSL.sample2DArray(Math.min(e,this.target.frames)),4>n&&t.pipe(s.GLSL.extendVec(n,4)),t.pipe("map.xyzw.2dv"),t.split(),t.pipe("map.2d.data",this.uniforms),t.pass(),t.pipe(r,this.uniforms))},e.prototype.build=function(t){var e;return this.camera||(this.camera=new THREE.PerspectiveCamera,this.camera.position.set(0,0,3),this.camera.lookAt(new THREE.Vector3)),"function"==typeof(e=this.scene).inject&&e.inject(),this.target=new r(this.gl,t.width,t.height,t.frames,t),this.target.warmup(function(t){return function(e){return t.renderer.setRenderTarget(e)}}(this)),this.renderer.setRenderTarget(null),this._adopt(this.target.uniforms),this._adopt({dat
for(e.__super__.constructor.call(this,t),this._clipUniforms(),this.closedX=r=t.closedX||!1,this.closedY=i=t.closedY||!1,this.width=U=(+t.width||2)+(r?1:0),this.height=h=(+t.height||2)+(i?1:0),this.surfaces=D=+t.surfaces||1,this.layers=m=+t.layers||1,B=U-(r?1:0),N=h-(i?1:0),this.segmentsX=L=Math.max(0,U-1),this.segmentsY=z=Math.max(0,h-1),_=U*h*D*m,x=L*z*D*m,F=2*x,this.addAttribute("index",new THREE.BufferAttribute(new Uint16Array(3*F),1)),this.addAttribute("position4",new THREE.BufferAttribute(new Float32Array(4*_),4)),this.addAttribute("surface",new THREE.BufferAttribute(new Float32Array(2*_),2)),this._autochunk(),c=this._emitter("index"),b=this._emitter("position4"),O=this._emitter("surface"),n=0,l=v=0,R=D*m;R>=0?R>v:v>R;l=R>=0?++v:--v){for(p=g=0,H=z;H>=0?H>g:g>H;p=H>=0?++g:--g){for(f=E=0,M=L;M>=0?M>E:E>M;f=M>=0?++E:--E)c(n),c(n+1),c(n+U),c(n+U),c(n+1),c(n+U+1),n++;n++}n+=U}for(a=r?function(){return 0}:function(t){return 0===t?-1:t===L?1:0},u=i?function(){return 0}:function(t){return 0===t?-1:t===z?1:0},d=y=0,S=m;S>=0?S>y:y>S;d=S>=0?++y:--y)for(j=T=0,k=D;k>=0?k>T:T>k;j=k>=0?++T:--T)for(I=w=0,A=h;A>=0?A>w:w>A;I=A>=0?++w:--w)for(i&&(I%=N),s=u(I),V=P=0,C=U;C>=0?C>P:P>C;V=C>=0?++P:--P)r&&(V%=B),o=a(V),b(V,I,j,d),O(o,s);this._finalize(),this.clip()}return o(e,t),e.prototype.clip=function(t,e,n,r){var i,o;return null==t&&(t=this.width),null==e&&(e=this.height),null==n&&(n=this.surfaces),null==r&&(r=this.layers),i=Math.max(0,t-1),o=Math.max(0,e-1),this._clipGeometry(t,e,n,r),this._clipOffsets(6,i,o,n,r,this.segmentsX,this.segmentsY,this.surfaces,this.layers)},e.prototype.map=function(t,e,n,r){return null==t&&(t=this.width),null==e&&(e=this.height),null==n&&(n=this.surfaces),null==r&&(r=this.layers),this._clipMap(t,e,n,r)},e}(r),e.exports=i},{"./clipgeometry":140}],149:[function(t,e,n){n.Scene=t("./scene"),n.Factory=t("./factory"),n.Renderable=t("./scene"),n.Classes=t("./classes")},{"./classes":137,"./factory":138,"./scene":162}],150:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;o=t("./base"),i=t("../geometry").ArrowGeometry,r=function(t){function e(t,n,r){var o,s,a,u,h,l,c,p,f,d,m,v,g,E;e.__super__.constructor.call(this,t,n,r),g=r.uniforms,f=r.material,m=r.position,o=r.color,p=r.mask,c=r.map,s=r.combine,v=r.stpq,l=r.linear,null==g&&(g={}),h=null!=g.styleColor,this.geometry=new i({sides:r.sides,samples:r.samples,strips:r.strips,ribbons:r.ribbons,layers:r.layers,anchor:r.anchor,flip:r.flip}),this._adopt(g),this._adopt(this.geometry.uniforms),u=n.material(),E=u.vertex,E.pipe(this._vertexColor(o,p)),E.require(this._vertexPosition(m,f,c,1,v)),E.pipe("arrow.position",this.uniforms),E.pipe("project.position",this.uniforms),u.fragment=a=this._fragmentColor(h,f,o,p,c,1,v,s,l),a.pipe("fragment.color",this.uniforms),this.material=this._material(u.link({})),d=new THREE.Mesh(this.geometry,this.material),d.frustumCulled=!1,d.matrixAutoUpdate=!1,this._raw(d),this.renders=[d]}return s(e,t),e.prototype.dispose=function(){return this.geometry.dispose(),this.material.dispose(),this.renders=this.geometry=this.material=null,e.__super__.dispose.apply(this,arguments)},e}(o),e.exports=r},{"../geometry":143,"./base":151}],151:[function(t,e,n){var r,i,o,s=function(t,e){function n(){this.constructor=t}for(var r in e)a.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty;i=t("../renderable"),o=t("../../util"),r=function(t){function e(t,n,r){var i;e.__super__.constructor.call(this,t,n,r),this.zUnits=null!=(i=r.zUnits)?i:0}return s(e,t),e.prototype.raw=function(){var t,e,n,r;for(r=this.renders,t=0,e=r.length;e>t;t++)n=r[t],this._raw(n);return null},e.prototype.depth=function(t,e){var n,r,i,o;for(o=this.renders,n=0,r=o.length;r>n;n++)i=o[n],this._depth(i,t,e);return null},e.prototype.polygonOffset=function(t,e){var n,r,i,o;for(o=this.renders,n=0,r=o.length;r>n;n++)i=o[n],this._polygonOffset(i,t,e);return null},e.prototype.show=f
},t.prototype._pop=function(){var t;return null!=(t=this._up)?t:this},t.prototype._reset=function(){var t,e;return null!=(t=null!=(e=this._up)?e.reset():void 0)?t:this},t.prototype.map=function(t){return this._targets.map(t)},t.prototype.on=function(){var t;return t=arguments,this._targets.map(function(e){return e.on.apply(e,t)}),this},t.prototype.off=function(){var t;return t=arguments,this._targets.map(function(e){return e.on.apply(e,t)}),this},t.prototype.toString=function(){var t;return t=this._targets.map(function(t){return t.toString()}),this._targets.length>1?"["+t.join(", ")+"]":t[0]},t.prototype.toMarkup=function(){var t;return t=this._targets.map(function(t){return t.toMarkup()}),t.join("\n\n")},t.prototype.print=function(){return i.Pretty.print(this._targets.map(function(t){return t.toMarkup()}).join("\n\n")),this},t.prototype.debug=function(){var t,e,n,r,i,o,s,a;for(e=this.inspect(),console.log("Renderables: ",e.renderables),console.log("Renders: ",e.renders),console.log("Shaders: ",e.shaders),t=function(t){return t.constructor.toString().match("function +([^(]*)")[1]},a=[],o=e.shaders,n=0,r=o.length;r>n;n++)s=o[n],i=t(s.owner),a.push(i+" - Vertex"),a.push(s.vertex),a.push(i+" - Fragment"),a.push(s.fragment);return ShaderGraph.inspect(a)},t.prototype.inspect=function(t,e,n){var r,i,o,s,a,u,h,l,c,p,f,d,m;for("boolean"==typeof e&&(n=e,e=null),null==n&&(n=!0),l=function(t){var e,n;return null!=(e=null!=(n=t.controller)?n.objects:void 0)?e:[]},c=d=function(t,n){var r,i,o,s;if(null==n&&(n=[]),(!e||t.traits.hash[e])&&n.push(l(t)),null!=t.children)for(s=t.children,i=0,o=s.length;o>i;i++)r=s[i],d(r,n);return n},i=function(t){return t=t.reduce(function(t,e){return t.concat(e)},[]),t=t.filter(function(e,n){return null!=e&&t.indexOf(e)===n})},h=function(t,e){var n;return n={},n.owner=t,n.geometry=e.geometry,n.material=e.material,n.vertex=e.material.vertexGraph,n.fragment=e.material.fragmentGraph,n},o={nodes:this._targets.slice(),renderables:[],renders:[],shaders:[]},p=this._targets,s=0,u=p.length;u>s;s++){m=p[s],n&&m.print(t,"info"),r={renderables:f=i(c(m)),renders:i(f.map(function(t){return t.renders})),shaders:i(f.map(function(t){var e;return null!=(e=t.renders)?e.map(function(e){return h(t,e)}):void 0}))};for(a in r)o[a]=o[a].concat(r[a])}return o},t}(),e.exports=r},{"../util":175}],168:[function(t,e,n){var r,i;i=t("../util"),r=function(){function t(t,e){this.model=t,this.primitives=e}return t.prototype.getRoot=function(){return this.model.getRoot()},t.prototype.getTypes=function(){return this.primitives.getTypes()},t.prototype.make=function(t,e,n){return this.primitives.make(t,e,n)},t.prototype.get=function(t,e){return t.get(e)},t.prototype.set=function(t,e,n){var r,i;try{return t.set(e,n)}catch(i){return r=i,t.print(null,"warn"),console.error(r)}},t.prototype.bind=function(t,e,n){var r,i;try{return t.bind(e,n)}catch(i){return r=i,t.print(null,"warn"),console.error(r)}},t.prototype.unbind=function(t,e){var n,r;try{return t.unbind(e)}catch(r){return n=r,t.print(null,"warn"),console.error(n)}},t.prototype.add=function(t,e){return null==e&&(e=this.model.getRoot()),e.add(t)},t.prototype.remove=function(t){var e;return e=t.parent,e?e.remove(t):void 0},t}(),e.exports=r},{"../util":175}],169:[function(t,e,n){n.Animator=t("./animator"),n.API=t("./api"),n.Controller=t("./controller")},{"./animator":166,"./api":167,"./controller":168}],170:[function(t,e,n){var r=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};n.setOrigin=function(t,e,n){var i,o,s,a;return+e===e&&(e=[e]),o=r.call(e,1)>=0?0:n.x,s=r.call(e,2)>=0?0:n.y,a=r.call(e,3)>=0?0:n.z,i=r.call(e,4)>=0?0:n.w,t.set(o,s,a,i)},n.addOrigin=function(){var t;return t=new THREE.Vector4,function(e,r,i){return n.setOrigin(t,r,i),e.add(t)}}(),n.setDimension=function(t,e){var n,r,i,o;return r=1===e?1:0,i=2===e?1:0,o=3===e?1:0,n=4===e?1:0,t.set(r,i,o,n)},n.setDimensionNormal=function(t,e){var n,r,i,o;return r=1===e?1:0,i=2===e?1:0,o=3===e?1:0,n=4===e?1:0,t.set(i,o+r,n,0)},n.recenterAxis=function(){var t;return t=[0,0],function(e,n
c[n(p)]=!0;f=this.outlets;for(a in f)p=f[a],a=n(p),c[a]?c[a]=p:this._remove(p);for(s=0,l=t.length;l>s;s++)p=t[s],e=c[n(p)],e instanceof o?this._morph(e,p):(p instanceof o||(p=o.make(p)),this._add(p))}return this.outlets},t.prototype.connect=function(t,e,n){var r,i,o,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_,b;for(d={},s={},b=function(t){return _+"/"+t.hint},m=t.inputs,a=0,l=m.length;l>a;a++)r=m[a],(n||!r.input)&&(_=r.type,o=b(r),s[o]||(s[o]=r),d[_]=f=d[_]||[],f.push(r));for(y=this.outputs,y=y.filter(function(t){return!(e&&t.output.length)}),v=y.slice(),u=0,c=v.length;c>u;u++)E=v[u],_=E.type,o=b(E),i=d[_],(r=s[o])&&(E.connect(r),delete s[o],i.splice(i.indexOf(r),1),y.splice(y.indexOf(E),1));if(!y.length)return this;for(g=y.slice(),h=0,p=g.length;p>h;h++)E=g[h],_=E.type,i=d[_],i&&i.length&&E.connect(i.shift());return this},t.prototype.disconnect=function(t){var e,n,r,i,o,s,a;for(s=this.inputs,e=0,r=s.length;r>e;e++)o=s[e],o.disconnect();for(a=this.outputs,n=0,i=a.length;i>n;n++)o=a[n],o.disconnect();return this},t.prototype._key=function(t){return[t.name,t.inout].join("-")},t.prototype._add=function(t){var e;if(e=this._key(t),t.node)throw new Error("Adding outlet to two nodes at once.");if(this.outlets[e])throw new Error("Adding two identical outlets to same node. ("+e+")");return t.node=this,t.inout===r.IN&&this.inputs.push(t),t.inout===r.OUT&&this.outputs.push(t),this.all.push(t),this.outlets[e]=t},t.prototype._morph=function(t,e){var n;return n=this._key(e),delete this.outlets[n],t.morph(e),n=this._key(e),this.outlets[n]=e},t.prototype._remove=function(t){var e,n;if(n=this._key(t),e=t.inout,t.node!==this)throw new Error("Removing outlet from wrong node.");return t.disconnect(),t.node=null,delete this.outlets[n],t.inout===r.IN&&this.inputs.splice(this.inputs.indexOf(t),1),t.inout===r.OUT&&this.outputs.splice(this.outputs.indexOf(t),1),this.all.splice(this.all.indexOf(t),1),this},t}(),e.exports=i},{"./graph":181,"./outlet":184}],184:[function(t,e,n){var r,i;r=t("./graph"),i=function(){function t(e,n,r,i,o,s){this.inout=e,this.name=n,this.hint=r,this.type=i,this.meta=null!=o?o:{},this.id=s,null==this.hint&&(this.hint=t.hint(this.name)),this.node=null,this.input=null,this.output=[],null==this.id&&(this.id=t.id(this.hint))}return t.make=function(e,n){var r,i,o,s;if(null==n&&(n={}),i=n,null!=e.meta){o=e.meta;for(r in o)s=o[r],i[r]=s}return new t(e.inout,e.name,e.hint,e.type,i)},t.index=0,t.id=function(e){return"_io_"+ ++t.index+"_"+e},t.hint=function(t){return t=t.replace(/^_io_[0-9]+_/,""),t=t.replace(/_i_o$/,""),t=t.replace(/(In|Out|Inout|InOut)$/,"")},t.prototype.morph=function(t){return this.inout=t.inout,this.name=t.name,this.hint=t.hint,this.type=t.type,this.meta=t.meta},t.prototype.dupe=function(e){var n;return null==e&&(e=this.id),n=t.make(this),n.name=e,n},t.prototype.connect=function(t){if(this.inout===r.IN&&t.inout===r.OUT)return t.connect(this);if(this.inout!==r.OUT||t.inout!==r.IN)throw new Error("Can only connect out to in.");if(t.input!==this)return t.disconnect(),t.input=this,this.output.push(t)},t.prototype.disconnect=function(t){var e,n,r,i;if(this.input&&this.input.disconnect(this),this.output.length){if(!t){for(i=this.output,e=0,r=i.length;r>e;e++)t=i[e],t.input=null;return this.output=[]}if(n=this.output.indexOf(t),n>=0)return this.output.splice(n,1),t.input=null}},t}(),e.exports=i},{"./graph":181}],185:[function(t,e,n){var r,i,o,s,a,u;i=t("../graph"),a=t("../linker").Program,o=t("../linker").Layout,u=!1,r=function(){function t(){var t;null==this.namespace&&(this.namespace=a.entry()),this.node=new i.Node(this,null!=(t="function"==typeof this.makeOutlets?this.makeOutlets():void 0)?t:{})}return t.previous=function(t){var e;return null!=(e=t.input)?e.node.owner:void 0},t.prototype.refresh=function(){var t;return this.node.setOutlets(null!=(t="function"==typeof this.makeOutlets?this.makeOutlets():void 0)?t:{})},t.prototype.clone=function(){return new t},t.prototype.compile=function(t,e){var n;return n=new a(t,null!=e?e:a.entry(),this.node.graph),this.call(n,0),n.assemble()},t.prototype.link=function(t,e){var n,r;return
},t.prototype.adopt=function(t){var e,n,r;{if(!t.length)return t.graph.remove(t,!0),this.add(t,!0);for(n=0,r=t.length;r>n;n++)e=t[n],this.adopt(e)}},t}(),e.exports=r},{}],205:[function(t,e,n){n.Graph=t("./graph"),n.Node=t("./node"),n.Outlet=t("./outlet"),n.IN=n.Graph.IN,n.OUT=n.Graph.OUT},{"./graph":204,"./node":206,"./outlet":207}],206:[function(t,e,n){var r,i,o;r=t("./graph"),o=t("./outlet"),i=function(){function t(e,n){this.owner=e,this.graph=null,this.inputs=[],this.outputs=[],this.all=[],this.outlets=null,this.id=t.id(),this.setOutlets(n)}return t.index=0,t.id=function(e){return++t.index},t.prototype.getIn=function(t){var e;return function(){var n,r,i,o;for(i=this.inputs,o=[],n=0,r=i.length;r>n;n++)e=i[n],e.name===t&&o.push(e);return o}.call(this)[0]},t.prototype.getOut=function(t){var e;return function(){var n,r,i,o;for(i=this.outputs,o=[],n=0,r=i.length;r>n;n++)e=i[n],e.name===t&&o.push(e);return o}.call(this)[0]},t.prototype.get=function(t){return this.getIn(t)||this.getOut(t)},t.prototype.setOutlets=function(t){var e,n,r,i,s,a,u,h,l,c,p,f;if(null!=t){if(null==this.outlets){for(this.outlets={},r=0,u=t.length;u>r;r++)p=t[r],p instanceof o||(p=o.make(p)),this._add(p);return}for(n=function(t){return[t.name,t.inout,t.type].join("-")},c={},i=0,h=t.length;h>i;i++)p=t[i],c[n(p)]=!0;f=this.outlets;for(a in f)p=f[a],a=n(p),c[a]?c[a]=p:this._remove(p);for(s=0,l=t.length;l>s;s++)p=t[s],e=c[n(p)],e instanceof o?this._morph(e,p):(p instanceof o||(p=o.make(p)),this._add(p))}return this.outlets},t.prototype.connect=function(t,e,n){var r,i,o,s,a,u,h,l,c,p,f,d,m,v,g,E,y,_,b;for(d={},s={},b=function(t){return _+"/"+t.hint},m=t.inputs,a=0,l=m.length;l>a;a++)r=m[a],(n||!r.input)&&(_=r.type,o=b(r),s[o]||(s[o]=r),d[_]=f=d[_]||[],f.push(r));for(y=this.outputs,y=y.filter(function(t){return!(e&&t.output.length)}),v=y.slice(),u=0,c=v.length;c>u;u++)E=v[u],_=E.type,o=b(E),i=d[_],(r=s[o])&&(E.connect(r),delete s[o],i.splice(i.indexOf(r),1),y.splice(y.indexOf(E),1));if(!y.length)return this;for(g=y.slice(),h=0,p=g.length;p>h;h++)E=g[h],_=E.type,i=d[_],i&&i.length&&E.connect(i.shift());return this},t.prototype.disconnect=function(t){var e,n,r,i,o,s,a;for(s=this.inputs,e=0,r=s.length;r>e;e++)o=s[e],o.disconnect();for(a=this.outputs,n=0,i=a.length;i>n;n++)o=a[n],o.disconnect();return this},t.prototype._key=function(t){return[t.name,t.inout].join("-")},t.prototype._add=function(t){var e;if(e=this._key(t),t.node)throw new Error("Adding outlet to two nodes at once.");if(this.outlets[e])throw new Error("Adding two identical outlets to same node. ("+e+")");return t.node=this,t.inout===r.IN&&this.inputs.push(t),t.inout===r.OUT&&this.outputs.push(t),this.all.push(t),this.outlets[e]=t},t.prototype._morph=function(t,e){var n;return n=this._key(e),delete this.outlets[n],t.morph(e),n=this._key(e),this.outlets[n]=e},t.prototype._remove=function(t){var e,n;if(n=this._key(t),e=t.inout,t.node!==this)throw new Error("Removing outlet from wrong node.");return t.disconnect(),t.node=null,delete this.outlets[n],t.inout===r.IN&&this.inputs.splice(this.inputs.indexOf(t),1),t.inout===r.OUT&&this.outputs.splice(this.outputs.indexOf(t),1),this.all.splice(this.all.indexOf(t),1),this},t}(),e.exports=i},{"./graph":204,"./outlet":207}],207:[function(t,e,n){var r,i;r=t("./graph"),i=function(){function t(e,n,r,i,o,s){this.inout=e,this.name=n,this.hint=r,this.type=i,this.meta=null!=o?o:{},this.id=s,null==this.hint&&(this.hint=t.hint(this.name)),this.node=null,this.input=null,this.output=[],null==this.id&&(this.id=t.id(this.hint))}return t.make=function(e,n){var r,i,o,s;if(null==n&&(n={}),i=n,null!=e.meta){o=e.meta;for(r in o)s=o[r],i[r]=s}return new t(e.inout,e.name,e.hint,e.type,i)},t.index=0,t.id=function(e){return"_io_"+ ++t.index+"_"+e},t.hint=function(t){return t=t.replace(/^_io_[0-9]+_/,""),t=t.replace(/_i_o$/,""),t=t.replace(/(In|Out|Inout|InOut)$/,"")},t.prototype.morph=function(t){return this.inout=t.inout,this.name=t.name,this.hint=t.hint,this.type=t.type,this.meta=t.meta},t.prototype.dupe=function(e){var n;return null==e&&(e=this.id),n=t.make(this),n.name=e,n},t.p
c}else if("builtin"===Ct.type||"keyword"===Ct.type)return Yt.unshift(ot(W)),c;return dt(";")()},ft(";"),dt(";"),ft(";"),dt(")"),ft(")"),gt(3),vt(),ft("}"),Et()),wt=pt(ft("if","keyword"),ft("("),dt(")"),ft(")"),gt(3),vt(),ft("}"),function(){return"else"===Ct.data?(Zt.shift(),Yt.unshift(zt()),c):Et()()},Et()),Rt=pt(ft("return","keyword"),function(){return";"===Ct.data?c:(Yt.unshift(at(";")),c)},function(){Zt.shift(),Et()()}),Ht=pt(ft("while","keyword"),ft("("),dt(")"),ft(")"),gt(3),vt(),ft("}"),Et()),Mt=pt(ft("do","keyword"),gt(3),vt(),ft("}"),ft("while","keyword"),ft("("),dt(")"),ft(")"),Et()),St=pt(function(){for(var t=1,e=Yt.length;e>t;++t)if(Yt[t].mode===E)return ht("function definition is not allowed within another function");return c},function(){if(lt("ident")){var t=Ct.data,e=Yt.scope.find(t);return Yt.unshift(Ft()),Yt.scope.define(t),Yt.scope.enter(e?e.scope:null),c}},ft("("),function(){return Yt.unshift(Bt()),c},ft(")"),function(){return";"===Ct.data?(Yt.scope.exit(),Yt.shift(),Yt.shift()):c},ft("{"),vt(),ft("}"),function(){return Yt.scope.exit(),c},function(){return Yt.shift(),Yt.shift(),Yt.shift()}),kt=pt(function(){return"void"===Ct.data?(Yt.fake(ut()),Zt.shift(),c):")"===Ct.data?void Yt.shift():"struct"===Ct.data?(Yt.unshift(st(Y,Z)),c):(Yt.unshift(ot(q)),c)},function(){return","===Ct.data?(Zt.shift(),0):")"===Ct.data?void Yt.shift():void ht("expected one of `,` or `)`, got "+Ct.data)})}var _t,bt,Tt,xt,wt,Rt,Ht,Mt,St,kt,At,Ct,Pt,Lt=rt(v),zt=rt(m),Ot=rt(b),Dt=rt(H),Ft=rt(d),Ut=(rt(A),rt(E)),Bt=rt(y),Nt=rt(T),Vt=rt(w),It=rt(x),jt=rt(C),Gt=rt(O),Wt=rt(F),qt=u(t,e),Xt=arguments.length?[].slice.call(arguments):[],Yt=[],Zt=[],Kt=[],Qt=!1;return Yt.shift=M,Yt.unshift=f,Yt.fake=r,Yt.unexpected=ht,Yt.scope=new l(Yt),Yt.create_node=function(){var t=i(d,Ct);return t.parent=qt.program,t},yt(),Pt=Lt(),Pt.expecting="(eof)",Pt.mode=v,Pt.token={type:"(program)",data:"(program)"},At=Pt,qt.program=At,qt.scope=function(t){return 1===arguments.length&&(Yt.scope=t),Yt.scope},Yt.unshift(Pt),qt}function i(t,e){return{mode:t,token:e,children:[],type:Q[t]}}function o(t){return"const"===t.data||"attribute"===t.data||"uniform"===t.data||"varying"===t.data}function s(t){return"in"===t.data||"inout"===t.data||"out"===t.data}function a(t){return"highp"===t.data||"mediump"===t.data||"lowp"===t.data}e.exports=r;var u=t("../../through"),h=t("./expr"),l=t("./scope"),c=new Object,p=!1,f=0,d=f++,m=f++,v=f++,g=f++,E=f++,y=f++,_=f++,b=f++,T=f++,x=f++,w=f++,R=f++,H=f++,M=f++,S=f++,k=f++,A=f++,C=f++,P=f++,L=f++,z=f++,O=f++,D=f++,F=f++,U=1,B=2,N=4,V=8,I=16,j=32,G=64,W=255,q=W&~(U|B|j|V|N),X=W&~(U|V|I|G),Y=!1,Z=!1,K={"block-comment":M,"line-comment":M,preprocessor:S},Q=f=["ident","stmt","stmtlist","struct","function","functionargs","decl","decllist","forloop","whileloop","if","expr","precision","comment","preprocessor","keyword","keyword_or_ident","return","break","continue","discard","do-while","placeholder","quantifier"]},{"../../through":227,"./expr":220,"./scope":222}],222:[function(t,e,n){function r(t){return this.constructor!==r?new r(t):(this.state=t,this.scopes=[],void(this.current=null))}e.exports=r;var i=r,o=i.prototype;o.enter=function(t){this.scopes.push(this.current=this.state[0].scope=t||{})},o.exit=function(){this.scopes.pop(),this.current=this.scopes[this.scopes.length-1]},o.define=function(t){this.current[t]=this.state[0]},o.find=function(t,e){for(var n=this.scopes.length-1;n>-1;--n)if(this.scopes[n].hasOwnProperty(t))return this.scopes[n][t];return null}},{}],223:[function(t,e,n){function r(){function t(t){t.length&&D.queue({type:T[B],data:t,position:I,line:V})}function e(t){for(F=0,W+=t.toString(),O=W.length;L=W[F],O>F;)switch(B){case l:F=H();break;case c:F=R();break;case p:F=w();break;case f:F=M();break;case d:F=A();break;case b:F=k();break;case m:F=C();break;case h:F=P();break;case y:F=x();break;case u:F=r()}U+=F,W=W.slice(F)}function n(e){N.length&&t(N.join("")),B=_,t("(eof)"),D.queue(null)}function r(){return N=N.length?[]:N,"/"===z&&"*"===L?(I=U+F-1,B=l,z=L,F+1):"/"===z&&"/"===L?(I=U+F-1,B=c,z=L,F+1):"#"===L?(B=p,I=U+F,F):/\s/