From 64ec106e8e3506e9d24eeed0188eeafc6e63716e Mon Sep 17 00:00:00 2001 From: c0d3ster Date: Sun, 15 Oct 2023 00:26:58 -0700 Subject: [PATCH] Updates --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index d86f3c9..8678e08 100644 --- a/app.js +++ b/app.js @@ -40,7 +40,7 @@ object-assign * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var r="function"==typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,a=r?Symbol.for("react.portal"):60106,o=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,l=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,u=r?Symbol.for("react.context"):60110,d=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,h=r?Symbol.for("react.forward_ref"):60112,f=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.suspense_list"):60120,g=r?Symbol.for("react.memo"):60115,A=r?Symbol.for("react.lazy"):60116,v=r?Symbol.for("react.block"):60121,y=r?Symbol.for("react.fundamental"):60117,b=r?Symbol.for("react.responder"):60118,x=r?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case i:switch(e=e.type){case d:case p:case o:case l:case s:case f:return e;default:switch(e=e&&e.$$typeof){case u:case h:case A:case g:case c:return e;default:return t}}case a:return t}}}function E(e){return w(e)===p}t.AsyncMode=d,t.ConcurrentMode=p,t.ContextConsumer=u,t.ContextProvider=c,t.Element=i,t.ForwardRef=h,t.Fragment=o,t.Lazy=A,t.Memo=g,t.Portal=a,t.Profiler=l,t.StrictMode=s,t.Suspense=f,t.isAsyncMode=function(e){return E(e)||w(e)===d},t.isConcurrentMode=E,t.isContextConsumer=function(e){return w(e)===u},t.isContextProvider=function(e){return w(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},t.isForwardRef=function(e){return w(e)===h},t.isFragment=function(e){return w(e)===o},t.isLazy=function(e){return w(e)===A},t.isMemo=function(e){return w(e)===g},t.isPortal=function(e){return w(e)===a},t.isProfiler=function(e){return w(e)===l},t.isStrictMode=function(e){return w(e)===s},t.isSuspense=function(e){return w(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===p||e===l||e===s||e===f||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===A||e.$$typeof===g||e.$$typeof===c||e.$$typeof===u||e.$$typeof===h||e.$$typeof===y||e.$$typeof===b||e.$$typeof===x||e.$$typeof===v)},t.typeOf=w},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){function t(t,n,r,i,a,o){var s=i||"<>",l=o||r;if(null==n[r])return t?new Error("Required "+a+" `"+l+"` was not specified in `"+s+"`."):null;for(var c=arguments.length,u=Array(c>6?c-6:0),d=6;du;)n=l[u++],r&&!o.call(s,n)||d.push(e?[n,s[n]]:s[n]);return d}}},function(e,t,n){var r=n(407);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n(44)(r,i);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(43)(!1)).push([e.i,".category-container {\r\n margin: 0 1rem;\r\n}\r\n\r\n.category-title {\r\n margin: 1rem 0 0 0;\r\n font-weight: bold;\r\n padding: 10px;\r\n color: rgba(220, 220, 220,.9);\r\n background: rgba(40, 40, 40, .9);\r\n border: none;\r\n outline: none;\r\n cursor: pointer;\r\n border-radius: .5rem .5rem 0 0;\r\n}\r\n\r\n.category-title:active,\r\n.category-title:focus,\r\n.category-title:hover {\r\n outline: none;\r\n color: white;\r\n background: #555;\r\n border: none !important;\r\n}\r\n\r\n.category-content {\r\n padding: .5rem;\r\n background: rgba(220, 220, 220, .9);\r\n border-radius: 0 0 .5rem .5rem;\r\n overflow: hidden;\r\n}\r\n\r\n.hide-content {\r\n height: 0;\r\n background: #555;\r\n}\r\n",""])},function(e,t,n){var r=n(409);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n(44)(r,i);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(43)(!1)).push([e.i,".slider-info {\r\n width: 100%;\r\n padding: 0 1rem;\r\n overflow: auto;\r\n}\r\n\r\n.slider-name {\r\n float: left;\r\n color: #333;\r\n}\r\n\r\n.slider-value {\r\n float: right;\r\n color: #333;\r\n}\r\n\r\n.slider-input {\r\n -webkit-appearance: none;\r\n -moz-appearance: none;\r\n appearance: none;\r\n position: relative;\r\n vertical-align: middle;\r\n height: 3rem;\r\n border-radius: 2rem;\r\n background: #555;\r\n box-shadow: 0 1px 0 rgb(0, 0, 0, .75);\r\n overflow: hidden;\r\n margin: 0 0 2.5rem 0;\r\n}\r\n\r\n.slider-input:active::-webkit-slider-thumb {\r\n cursor: -webkit-grabbing;\r\n cursor: grabbing;\r\n background: darkgreen;\r\n}\r\n\r\n.slider-input:focus {\r\n outline: none;\r\n}\r\n\r\n.slider-input::-webkit-slider-thumb {\r\n -webkit-appearance: none;\r\n border: none;\r\n height: 2.5rem;\r\n width: 4rem;\r\n border-radius: 2rem;\r\n background: rgba(220, 220, 220, .9);\r\n cursor: pointer;\r\n}\r\n\r\n\r\n.slider-input:active::-webkit-slider-thumb,\r\n.slider-input:active::slider-thumb {\r\n border: 0px solid hsl(0,0%,80%);\r\n transition-duration: .1;\r\n outline: none;\r\n}\r\n",""])},function(e,t,n){var r=n(411);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n(44)(r,i);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(43)(!1)).push([e.i,".config-checkbox-container {\r\n display: block;\r\n margin: 1rem;\r\n text-align: center;\r\n}\r\n\r\n.config-checkbox-container label {\r\n margin: 0;\r\n width: 100%;\r\n padding: .5rem 1rem;\r\n border-radius: .5rem;\r\n background: #EEE;\r\n color: #555;\r\n cursor: pointer;\r\n font-size: 16px;\r\n}\r\n\r\n.config-checkbox-container input:checked + label {\r\n background: #060;\r\n color: white;\r\n}\r\n\r\n.config-checkbox-container input {\r\n display: none;\r\n}\r\n",""])},function(e,t,n){var r=n(413);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n(44)(r,i);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(43)(!1)).push([e.i,".sidebar-container {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n height: 100vh;\r\n width: 20px;\r\n}\r\n\r\n.tab:hover {\r\n background: #222;\r\n}\r\n\r\n.sidebar-content {\r\n transform: translate(-100%, 0);\r\n width: 33vw;\r\n height: 100vh;\r\n background-color: black;\r\n color: rgba(220,220,220,.9);\r\n border-right: 3px solid rgba(20,20,20,.9);\r\n opacity: .9;\r\n padding: 10px 20px;\r\n}\r\n\r\n@media only screen and (max-width: 600px) {\r\n .sidebar-content {\r\n width: 60vw;\r\n }\r\n \r\n .expand-config {\r\n display: none;\r\n }\r\n}\r\n\r\n.sidebar-title {\r\n display: inline-block;\r\n font-weight: bold;\r\n overflow: hidden;\r\n margin: 1rem 2rem;\r\n}\r\n\r\n.sidebar-content:not(.slide-in) > .row > .sidebar-title {\r\n display: none;\r\n}\r\n\r\n.expand-config {\r\n float: right;\r\n margin: 1.5rem 1rem 0 0;\r\n vertical-align: top;\r\n border-radius: .25rem;\r\n color: #333;\r\n}\r\n\r\n.expand-config:focus {\r\n outline: none;\r\n}\r\n\r\n.expand-config:hover, .expanded {\r\n background: green;\r\n color: #ccc;\r\n}\r\n\r\n.slide-in {\r\n transform: translate(0, 0);\r\n -webkit-animation: slide-in .5s;\r\n animation: slide-in .5s;\r\n}\r\n@-webkit-keyframes slide-in {\r\n from {\r\n transform: translate(-100%, 0);\r\n }\r\n to {\r\n transform: translate(0, 0);\r\n }\r\n}\r\n@keyframes slide-in {\r\n from {\r\n transform: translate(-100%, 0);\r\n }\r\n to {\r\n transform: translate(0, 0);\r\n }\r\n}\r\n\r\n.slide-out {\r\n -webkit-animation: slide-out .5s;\r\n animation: slide-out .5s;\r\n}\r\n@-webkit-keyframes slide-out {\r\n from {\r\n transform: translate(0, 0);\r\n }\r\n to {\r\n transform: translate(-100%, 0);\r\n }\r\n}\r\n@keyframes slide-out {\r\n from {\r\n transform: translate(0, 0);\r\n }\r\n to {\r\n transform: translate(-100%, 0);\r\n }\r\n}\r\n\r\n.tab {\r\n position: absolute;\r\n top: 50%;\r\n left: 100%;\r\n transform: translate(0, -50%);\r\n color: rgba(220, 220, 220, .9);\r\n background-color: black;\r\n padding: 50px 5px;\r\n border: 3px solid rgba(20, 20, 20, .9);\r\n border-left: none;\r\n border-radius: 0 50px 50px 0;\r\n cursor: pointer;\r\n outline: none;\r\n}\r\n\r\n.tab:hover {\r\n border-color: rgba(60, 60, 60, .9);\r\n color: white;\r\n}\r\n\r\n.tab-new:hover {\r\n border-color: rgba(60, 60, 60, .9);\r\n color: white;\r\n}\r\n\r\n.tab-fade-in {\r\n -webkit-animation: tab-fade-in .3s;\r\n animation: tab-fade-in .3s;\r\n}\r\n@-webkit-keyframes tab-fade-in {\r\n from {\r\n opacity: 0;\r\n transform: translate(-20%, -50%);\r\n }\r\n to {\r\n opacity: 1;\r\n transform: translate(0, -50%);\r\n }\r\n}\r\n@keyframes tab-fade-in {\r\n from {\r\n opacity: 0;\r\n transform: translate(-20%, -50%);\r\n }\r\n to {\r\n opacity: 1;\r\n transform: translate(0, -50%);\r\n }\r\n}\r\n\r\n.tab-fade-out {\r\n opacity: 0;\r\n -webkit-animation: tab-fade-out .3s;\r\n animation: tab-fade-out .3s;\r\n}\r\n@-webkit-keyframes tab-fade-out {\r\n from {\r\n opacity: 1;\r\n transform: translate(0, -50%);\r\n }\r\n to {\r\n opacity: 0;\r\n transform: translate(-20%, -50%);\r\n }\r\n}\r\n@keyframes tab-fade-out {\r\n from {\r\n opacity: 1;\r\n transform: translate(0, -50%);\r\n }\r\n to {\r\n opacity: 0;\r\n transform: translate(-20%, -50%);\r\n }\r\n}\r\n",""])},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r),a=n(73),o=n.n(a),s=n(2),l=n.n(s),c=n(156),u=n.n(c),d={linear:function(e){return e},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1}},p={options:{peakDetection:{enabled:!0,options:{threshold_DEFAULT:2,threshold_MIN:0,threshold_MAX:5,threshold_STEP_SIZE:.1,ignoreTime_DEFAULT:250,ignoreTime_MIN:0,ignoreTime_MAX:2500,ignoreTime_STEP_SIZE:50,energyPersistence:2e3,peakPersistency:300,easing:d.linear}},multibandPeakDetection:{enabled:!0,options:{bands:8,threshold:1.2,ignoreTime:300,energyPersistence:1200,peakPersistency:300,easing:d.linear}},returns:{timedomainData:!0,frequenciesData:!0,energy:!0,energyHistory:!0,energyAverage:!0,peak:!0,peakHistory:!0,multibandEnergy:!0,multibandEnergyHistory:!0,multibandEnergyAverage:!0,multibandPeak:!0,multibandPeakHistory:!0}}},h={showerrors:!0,showloginfos:!0,hudToggleKey:"h",hudDisplayed:!0,volume:.5,speed_DEFAULT:2,speed_MIN:0,speed_MAX:40,speed_STEP_SIZE:.5,rotationSpeed_DEFAULT:2,rotationSpeed_MIN:-50,rotationSpeed_MAX:50,rotationSpeed_STEP_SIZE:.25,scaleFactor_DEFAULT:1500,scaleFactor_MIN:100,scaleFactor_MAX:2e3,scaleFactor_STEP_SIZE:100,cameraBound_DEFAULT:100,cameraBound_MIN:0,cameraBound_MAX:500,cameraBound_SEP_SIZE:20},f=!0,m=!0,g=!0,A=!0,v=!0,y=!0,b=1,x=10,w=2.5,E=.1,S=0,M=1,T=.5,B=.01,R=5,C=6,I=5.5,k=.1,P=0,D=1,F=.5,_=.1,U=0,L=1,V=.5,N=.1,O={sprites_DEFAULT:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],sprites_MIN:1,sprites_MAX:5,saturation_DEFAULT:1,saturation_MIN:0,saturation_MAX:1,saturation_STEP_SIZE:.1,particles_DEFAULT:7500,particles_MIN:1,particles_MAX:15e3,particles_STEP_SIZE:1,layers_DEFAULT:4,layers_MIN:1,layers_MAX:20,layers_STEP_SIZE:1,levels_DEFAULT:3,levels_MIN:1,levels_MAX:20,levels_STEP_SIZE:1,size_DEFAULT:10,size_MIN:1,size_MAX:200,size_STEP_SIZE:1},H={clips:["galaxy.mp4","earth.mp4"],index:0},z={user:{speed:{name:"Speed",type:"slider",defaultValue:h.speed_DEFAULT,value:h.speed_DEFAULT,min:h.speed_MIN,max:h.speed_MAX,step:h.speed_STEP_SIZE},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:h.rotationSpeed_DEFAULT,value:h.rotationSpeed_DEFAULT,min:h.rotationSpeed_MIN,max:h.rotationSpeed_MAX,step:h.rotationSpeed_STEP_SIZE},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:h.scaleFactor_DEFAULT,value:h.scaleFactor_DEFAULT,min:h.scaleFactor_MIN,max:h.scaleFactor_MAX,step:h.scaleFactor_STEP_SIZE},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:h.cameraBound_DEFAULT,value:h.cameraBound_DEFAULT,min:h.cameraBound_MIN,max:h.cameraBound_MAX,step:h.cameraBound_SEP_SIZE}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:p.options.peakDetection.options.threshold_DEFAULT,value:p.options.peakDetection.options.threshold_DEFAULT,min:p.options.peakDetection.options.threshold_MIN,max:p.options.peakDetection.options.threshold_MAX,step:p.options.peakDetection.options.threshold_STEP_SIZE},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:p.options.peakDetection.options.ignoreTime_DEFAULT,value:p.options.peakDetection.options.ignoreTime_DEFAULT,min:p.options.peakDetection.options.ignoreTime_MIN,max:p.options.peakDetection.options.ignoreTime_MAX,step:p.options.peakDetection.options.ignoreTime_STEP_SIZE}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:f,value:f},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:m,value:m},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:g,value:g},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:A,value:A},glow:{name:"Glow",type:"checkbox",defaultValue:v,value:v},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:y,value:y}},orbit:{a:{name:"A",type:"slider",defaultValue:w,value:w,min:b,max:x,step:E},b:{name:"B",type:"slider",defaultValue:T,value:T,min:S,max:M,step:B},c:{name:"C",type:"slider",defaultValue:I,value:I,min:R,max:C,step:k},d:{name:"D",type:"slider",defaultValue:F,value:F,min:P,max:D,step:_},e:{name:"E",type:"slider",defaultValue:V,value:V,min:U,max:L,step:N}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:O.size_DEFAULT,value:O.size_DEFAULT,min:O.size_MIN,max:O.size_MAX,step:O.size_STEP_SIZE},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:O.particles_DEFAULT,value:O.particles_DEFAULT,min:O.particles_MIN,max:O.particles_MAX,step:O.particles_STEP_SIZE},layers:{name:"Layers",type:"slider",defaultValue:O.layers_DEFAULT,value:O.layers_DEFAULT,min:O.layers_MIN,max:O.layers_MAX,step:O.layers_STEP_SIZE},levels:{name:"Levels",type:"slider",defaultValue:O.levels_DEFAULT,value:O.levels_DEFAULT,min:O.levels_MIN,max:O.levels_MAX,step:O.levels_STEP_SIZE},saturation:{name:"Saturation",type:"slider",defaultValue:O.saturation_DEFAULT,value:O.saturation_DEFAULT,min:O.saturation_MIN,max:O.saturation_MAX,step:O.saturation_STEP_SIZE},sprites:{name:"Sprites",type:"multiselect",defaultValue:O.sprites_DEFAULT,value:O.sprites_DEFAULT,min:O.sprites_MIN,max:O.sprites_MAX}},video:{clips:H.clips,index:H.index}},Q={default:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:2,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:2,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:1500,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.5,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.5,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:10,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:7500,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:5,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:5,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],min:1,max:5}},video:{clips:["galaxy.mp4","earth.mp4"],index:0}},galaxySpace:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:1,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:3.25,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:2e3,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:1.8,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.5,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:50,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:166,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:3,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],min:1,max:5}}},galaxySalad:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:1,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:-2.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:600,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:3,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.7,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:12,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],min:1,max:5}}},galaxyPortal:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:10,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:4,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:900,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:3.2,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.65,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.5,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:187,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:166,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:3,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],min:1,max:5}}},galaxySpiral:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:4,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:-2.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:300,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:3,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.7,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:12,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:8,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:6,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:.3,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],min:1,max:5}}},sideSwirl:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:6,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:14.75,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:200,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:500,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:100,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!1},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.5,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.5,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:15,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:2634,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:8,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:5,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],min:1,max:5}}},eyeChase:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:2.5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:4,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:800,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.6,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.8,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:175,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:20,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["fractaleye.png"],min:1,max:5}}},crossheirSpin:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:1.5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:2,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:900,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:6.9,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.02,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.9,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:7,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:9578,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:8,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:5,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],min:1,max:5}}},pointerz:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:6,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:2,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:1300,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:4.7,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.27,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.1,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:7,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:9578,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:8,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:7,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],min:1,max:5}}},dispersionTunnelSpin:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:.5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:-2.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:1e3,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!1},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:5,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.93,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.8,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.2,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:4,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:10139,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:14,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],min:1,max:5}}},colorPortal:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:3,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:12.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:600,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!0}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:9,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.35,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.1,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:7,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:5e3,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:20,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:6,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],min:1,max:5}}},edgeChaseSpin:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:2,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:1800,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:3.2,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.08,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.2,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.7,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:35,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:2921,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:6,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],min:1,max:5}}},ohSprite:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:2,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:4,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:800,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:185,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:10,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["ohSprite.png"],min:1,max:5}}},circles:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:3.5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:2,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:1300,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:7.7,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.2,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:7,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:9578,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:8,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:5,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],min:1,max:5}}},squareMandala:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:7.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:900,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.5,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.06,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.9,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:7,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:4832,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:20,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:5,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],min:1,max:5}}},notes:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:3,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:3.25,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:600,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.7,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.1,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.6,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:149,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:35,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["musicNotes.png","musicNotes2.png","musicNotes3.png"],min:1,max:5}}},noteExplosion:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:2.5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:4,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:800,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.6,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.8,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:175,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:20,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:.7,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["musicNoteExplosion.png","musicNoteExplosion2.png","musicNoteExplosion.png"],min:1,max:5}}},fire:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:-2.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:600,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:3,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.7,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:12,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["fire.png","fire2.png","fire3.png"],min:1,max:5}}},tapeFire:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:-2.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:600,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:100,min:1,max:100,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.7,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:12,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["fire.png","fire2.png","fire3.png"],min:1,max:5}},video:{clips:["tape14.mp4","tape13.mp4"],index:0}},weed:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:4.5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:4,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:800,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.2,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.6,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.8,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:175,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:20,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:.5,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["weed.png"],min:1,max:5}}},garbageMonsters:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:7,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:6.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:800,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.24,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.6,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.8,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:165,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:20,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["garbageMonster.png","garbageMonster2.png","garbageMonster.png"],min:1,max:5}}},garbageMan:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:8,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:11,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:600,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.8,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.81,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.6,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.8,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:20,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["garbageMan.png"],min:1,max:5}}},choppingMen:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:7,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:6.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:800,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.24,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.6,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.8,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:165,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:20,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["choppingMan.png","choppingMan2.png","choppingMan.png"],min:1,max:5}}},choppingHands:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:8,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:11,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:600,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.8,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.81,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.6,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.8,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:20,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["chopHand.png","chopHand2.png"],min:1,max:5}}},slimeHands:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:3.5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:6.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:800,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.2,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.24,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.6,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.8,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:175,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:20,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:.1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["slimeHand3.png","slimeHand2.png","slimeHand.png"],min:1,max:5}}},honeycomb:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:2,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:-2.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:500,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!1},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.97,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.2,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.7,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:12,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:8,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:8,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:.3,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["honeycomb.png"],min:1,max:5}}},kaiber:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:.5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:800,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!1},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.7,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:20,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:.5,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["kaiber.png"],min:1,max:5}}},blackout:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:3.5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:-5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:1e3,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:10,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.5,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:4,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:3,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["barbwire.png"],min:1,max:5}}},tapeIntroJumpy:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:3.5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:-5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:1e3,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:10,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.5,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:4,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:3,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["cassetteLogo.png"],min:1,max:5}}},vzn:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:1,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:800,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!1},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.7,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:20,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:.1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["vzn.jpeg"],min:1,max:5}}},vznSpace:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:1,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:3.25,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:2e3,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:1.8,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.5,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:50,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:166,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:3,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["vzn.jpeg","cassette.png","galaxy2Sprite.png"],min:1,max:5}}},vznCassette:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:2,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:2,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:1500,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:100,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!0}},orbit:{a:{name:"A",type:"slider",defaultValue:2.8,value:2.8,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.16,value:.16,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.8,value:5.8,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.8,value:.8,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.1,value:.1,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:200,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:6,value:6,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:10,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:2,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:0,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["cassette.png"],value:["vzn.jpeg"],min:1,max:5}}},tape:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:1,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:800,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!1},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.7,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:20,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:.1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["tape.png"],min:1,max:5}}},tapeSpace:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:1,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:3.25,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:2e3,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:1.8,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.5,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:50,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:166,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:3,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["tape.png","cassette.png","cassetteLogo.png"],min:1,max:5}}},tapeCassette:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:2,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:2,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:1500,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:100,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!0}},orbit:{a:{name:"A",type:"slider",defaultValue:2.8,value:2.8,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.16,value:.16,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.8,value:5.8,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.8,value:.8,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.1,value:.1,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:200,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:6,value:6,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:10,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:2,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:0,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["cassette.png"],value:["cassette.png"],min:1,max:5}}},tapeWireWhite:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:7,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:4,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:900,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.6,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.79,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.8,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:30,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:3,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["vzn.jpeg"],min:1,max:5}}},tapeWire:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:7,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:4,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:900,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.6,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.79,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.8,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:130,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:30,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:3,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:.2,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["tape.png"],min:1,max:5}}},tapeWireLogo:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:7,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:4,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:900,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.6,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.79,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.8,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:130,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:30,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:3,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:.4,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["cassetteLogo.png"],min:1,max:5}}},tapeSkull:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:7,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:4,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:900,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.6,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.79,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.8,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:150,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:30,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:3,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["skull.png","barbwire.png"],min:1,max:5}}},tapeSkullVid:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:7,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:4,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:900,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.6,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.79,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.8,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:114,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:30,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:3,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["cassetteLogo.png"],min:1,max:5}}},tapeSaladColor:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:1,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:-2.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:600,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:3,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.9,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:12,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["skull.png","barbwire.png","tape.png","cassetteLogo.png"],min:1,max:5}}},tapeSalad:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:1,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:-2.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:600,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:3,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.9,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:12,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["skull.png","barbwire.png","tape.png"],min:1,max:5}}},hyperTape:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:2.5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:3.75,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:200,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:5.4,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.78,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.5,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:175,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:5,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:3,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["tape.png"],min:1,max:5}}},tapeSpin:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:2,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:-5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:1500,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.8,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.16,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.8,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.8,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.1,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:6,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["tape.png"],min:1,max:5}}}};function j(e){return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function G(e,t,n,r,i,a,o){try{var s=e[a](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function W(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){G(a,r,i,o,s,"next",e)}function s(e){G(a,r,i,o,s,"throw",e)}o(void 0)}))}}function Y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function J(e){for(var t=1;te.length)&&localStorage.setItem("presets",JSON.stringify(Q))}},{key:"render",value:function(){return i.a.createElement(re.Provider,{value:this.state},this.props.children)}}])&&Z(n.prototype,r),a&&Z(n,a),s}(r.Component);ae.propTypes={config:l.a.object,updateConfigItem:l.a.func,updateConfigPreset:l.a.func};n(368),n(371);function oe(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;"audiofile"===this.sourceType?this.source.start(e,t):h.showerrors&&console.error("Couldn't start the audio source. Source is a microphone.")}},{key:"isThereFeedback",value:function(){return"microphone"!==this.sourceType||this.audioFeedback}},{key:"getAudioContext",value:function(){return this.audioContext}},{key:"getSourceNode",value:function(){return h.showerrors&&!this.source&&console.error("Audio source has not bet set up"),this.source}}])&&oe(t.prototype,n),r&&oe(t,r),e}();var le=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bufferSize=r,this.timedomainData=t,this.frequencyData=n};function ce(e,t){for(var n=0;n=0;r--)if((n+=this.energyHistoryDeltaTime[r])>=p.options.peakDetection.options.energyPersistence){this.energyHistoryDeltaTime.splice(0,r-1),this.energyHistory.splice(0,r-1);break}}},{key:"getEnergyHistory",value:function(){return this.energyHistory}},{key:"getMultibandEnergyHistory",value:function(){return this.multibandEnergyHistory}},{key:"pushNewMultibandEnergy",value:function(e,t){this.setMultibandEnergy(e),this.multibandEnergyHistory.push(e),this.multibandEnergyHistoryDeltaTime.push(t);for(var n=0,r=this.multibandEnergyHistory.length-1;r>=0;r--)if((n+=this.multibandEnergyHistoryDeltaTime[r])>=p.options.multibandPeakDetection.options.energyPersistence){this.multibandEnergyHistory.splice(0,r-1),this.multibandEnergyHistoryDeltaTime.splice(0,r-1);break}}}]),e}(),me=function e(t){de(this,e),this.bufferSize=t.bufferSize,p.options.returns.frequenciesData&&(this.frequenciesData=t.frequenciesData),p.options.returns.timedomainData&&(this.timedomainData=t.timedomainData),p.options.returns.energy&&(this.energy=t.energy),p.options.returns.energyHistory&&(this.energyHistory=t.energyHistory,this.energyHistoryDeltaTime=t.energyHistoryDeltaTime),p.options.returns.energyAverage&&(this.energyAverage=t.energyAverage),p.options.returns.peak&&(this.peak=t.peak),p.options.returns.peakHistory&&(this.peakHistory=t.peakHistory),p.options.returns.multibandEnergy&&(this.multibandEnergy=t.multibandEnergy),p.options.returns.multibandEnergyHistory&&(this.multibandEnergyHistory=t.multibandEnergyHistory,this.multibandEnergyHistoryDeltaTime=t.multibandEnergyHistoryDeltaTime),p.options.returns.multibandEnergyAverage&&(this.multibandEnergyAverage=t.multibandEnergyAverage),p.options.returns.multibandPeak&&(this.multibandPeak=t.multibandPeak),p.options.returns.multibandPeakHistory&&(this.multibandPeakHistory=t.multibandPeakHistory)},ge=function(){function e(t,n,r){de(this,e),this.value=t,this.timer=n,this.energy=r}return he(e,[{key:"copy",value:function(e){this.value=e.value,this.timer=e.timer,this.energy=e.energy}}]),e}();function Ae(e,t){for(var n=0;n0&&(n.value=this.peakInterpolation(i,n.timer,o,l));else if(e/t>a){var c=new ge(1,i,e);p.options.returns.peakHistory&&r.push(c),n.copy(c)}else n.value>0&&(n.value=this.peakInterpolation(i,n.timer,o,l));else if(e/t>a){var u=new ge(1,i,e);p.options.returns.peakHistory&&r.push(u),n.copy(u)}}},{key:"computeMultibandEnergy",value:function(e,t){for(var n=e.length,r=new Array(t),i=0;i>8&255]+be[e>>16&255]+be[e>>24&255]+"-"+be[255&t]+be[t>>8&255]+"-"+be[t>>16&15|64]+be[t>>24&255]+"-"+be[63&n|128]+be[n>>8&255]+"-"+be[n>>16&255]+be[n>>24&255]+be[255&r]+be[r>>8&255]+be[r>>16&255]+be[r>>24&255]).toUpperCase()},clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},damp:function(e,t,n,r){return we.lerp(e,t,1-Math.exp(-n*r))},pingpong:function(e,t=1){return t-Math.abs(we.euclideanModulo(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){return void 0!==e&&(xe=e%2147483647),xe=16807*xe%2147483647,(xe-1)/2147483646},degToRad:function(e){return e*we.DEG2RAD},radToDeg:function(e){return e*we.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,r,i){const a=Math.cos,o=Math.sin,s=a(n/2),l=o(n/2),c=a((t+r)/2),u=o((t+r)/2),d=a((t-r)/2),p=o((t-r)/2),h=a((r-t)/2),f=o((r-t)/2);switch(i){case"XYX":e.set(s*u,l*d,l*p,s*c);break;case"YZY":e.set(l*p,s*u,l*d,s*c);break;case"ZXZ":e.set(l*d,l*p,s*u,s*c);break;case"XZX":e.set(s*u,l*f,l*h,s*c);break;case"YXY":e.set(l*h,s*u,l*f,s*c);break;case"ZYZ":e.set(l*f,l*h,s*u,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}};class Ee{constructor(e=0,t=0){Object.defineProperty(this,"isVector2",{value:!0}),this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}class Se{constructor(){Object.defineProperty(this,"isMatrix3",{value:!0}),this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,r,i,a,o,s,l){const c=this.elements;return c[0]=e,c[1]=r,c[2]=o,c[3]=t,c[4]=i,c[5]=s,c[6]=n,c[7]=a,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}clone(){return(new this.constructor).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],l=n[1],c=n[4],u=n[7],d=n[2],p=n[5],h=n[8],f=r[0],m=r[3],g=r[6],A=r[1],v=r[4],y=r[7],b=r[2],x=r[5],w=r[8];return i[0]=a*f+o*A+s*b,i[3]=a*m+o*v+s*x,i[6]=a*g+o*y+s*w,i[1]=l*f+c*A+u*b,i[4]=l*m+c*v+u*x,i[7]=l*g+c*y+u*w,i[2]=d*f+p*A+h*b,i[5]=d*m+p*v+h*x,i[8]=d*g+p*y+h*w,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8];return t*a*c-t*o*l-n*i*c+n*o*s+r*i*l-r*a*s}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=c*a-o*l,d=o*s-c*i,p=l*i-a*s,h=t*u+n*d+r*p;if(0===h)return this.set(0,0,0,0,0,0,0,0,0);const f=1/h;return e[0]=u*f,e[1]=(r*l-c*n)*f,e[2]=(o*n-r*a)*f,e[3]=d*f,e[4]=(c*t-r*s)*f,e[5]=(r*i-o*t)*f,e[6]=p*f,e[7]=(n*s-l*t)*f,e[8]=(a*t-n*i)*f,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).copy(this).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,a,o){const s=Math.cos(i),l=Math.sin(i);return this.set(n*s,n*l,-n*(s*a+l*o)+a+e,-r*l,r*s,-r*(-l*a+s*o)+o+t,0,0,1),this}scale(e,t){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){const t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],a=r[3],o=r[6],s=r[1],l=r[4],c=r[7];return r[0]=t*i+n*s,r[3]=t*a+n*l,r[6]=t*o+n*c,r[1]=-n*i+t*s,r[4]=-n*a+t*l,r[7]=-n*o+t*c,this}translate(e,t){const n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}}let Me;const Te={getDataURL:function(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===Me&&(Me=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Me.width=e.width,Me.height=e.height;const n=Me.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Me}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}};let Be=0;function Re(e=Re.DEFAULT_IMAGE,t=Re.DEFAULT_MAPPING,n=1001,r=1001,i=1006,a=1008,o=1023,s=1009,l=1,c=3e3){Object.defineProperty(this,"id",{value:Be++}),this.uuid=we.generateUUID(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=a,this.anisotropy=l,this.format=o,this.internalFormat=null,this.type=s,this.offset=new Ee(0,0),this.repeat=new Ee(1,1),this.center=new Ee(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Se,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=c,this.version=0,this.onUpdate=null}function Ce(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?Te.getDataURL(e):e.data?{data:Array.prototype.slice.call(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}Re.DEFAULT_IMAGE=void 0,Re.DEFAULT_MAPPING=300,Re.prototype=Object.assign(Object.create(ye.prototype),{constructor:Re,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){const r=this.image;if(void 0===r.uuid&&(r.uuid=we.generateUUID()),!t&&void 0===e.images[r.uuid]){let t;if(Array.isArray(r)){t=[];for(let e=0,n=r.length;e1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(Re.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}});class Ie{constructor(e=0,t=0,n=0,r=1){Object.defineProperty(this,"isVector4",{value:!0}),this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i;const a=e.elements,o=a[0],s=a[4],l=a[8],c=a[1],u=a[5],d=a[9],p=a[2],h=a[6],f=a[10];if(Math.abs(s-c)<.01&&Math.abs(l-p)<.01&&Math.abs(d-h)<.01){if(Math.abs(s+c)<.1&&Math.abs(l+p)<.1&&Math.abs(d+h)<.1&&Math.abs(o+u+f-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const e=(o+1)/2,a=(u+1)/2,m=(f+1)/2,g=(s+c)/4,A=(l+p)/4,v=(d+h)/4;return e>a&&e>m?e<.01?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=g/n,i=A/n):a>m?a<.01?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(a),n=g/r,i=v/r):m<.01?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(m),n=A/i,r=v/i),this.set(n,r,i,t),this}let m=Math.sqrt((h-d)*(h-d)+(l-p)*(l-p)+(c-s)*(c-s));return Math.abs(m)<.001&&(m=1),this.x=(h-d)/m,this.y=(l-p)/m,this.z=(c-s)/m,this.w=Math.acos((o+u+f-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}class ke extends ye{constructor(e,t,n){super(),Object.defineProperty(this,"isWebGLRenderTarget",{value:!0}),this.width=e,this.height=t,this.scissor=new Ie(0,0,e,t),this.scissorTest=!1,this.viewport=new Ie(0,0,e,t),n=n||{},this.texture=new Re(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=e,this.texture.image.height=t,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:1006,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0!==n.stencilBuffer&&n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}setSize(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.texture.image.width=e,this.texture.image.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Pe extends ke{constructor(e,t,n){super(e,t,n),Object.defineProperty(this,"isWebGLMultisampleRenderTarget",{value:!0}),this.samples=4}copy(e){return super.copy.call(this,e),this.samples=e.samples,this}}class De{constructor(e=0,t=0,n=0,r=1){Object.defineProperty(this,"isQuaternion",{value:!0}),this._x=e,this._y=t,this._z=n,this._w=r}static slerp(e,t,n,r){return n.copy(e).slerp(t,r)}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],l=n[r+1],c=n[r+2],u=n[r+3];const d=i[a+0],p=i[a+1],h=i[a+2],f=i[a+3];if(u!==f||s!==d||l!==p||c!==h){let e=1-o;const t=s*d+l*p+c*h+u*f,n=t>=0?1:-1,r=1-t*t;if(r>Number.EPSILON){const i=Math.sqrt(r),a=Math.atan2(i,t*n);e=Math.sin(e*a)/i,o=Math.sin(o*a)/i}const i=o*n;if(s=s*e+d*i,l=l*e+p*i,c=c*e+h*i,u=u*e+f*i,e===1-o){const e=1/Math.sqrt(s*s+l*l+c*c+u*u);s*=e,l*=e,c*=e,u*=e}}e[t]=s,e[t+1]=l,e[t+2]=c,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,a){const o=n[r],s=n[r+1],l=n[r+2],c=n[r+3],u=i[a],d=i[a+1],p=i[a+2],h=i[a+3];return e[t]=o*h+c*u+s*p-l*d,e[t+1]=s*h+c*d+l*u-o*p,e[t+2]=l*h+c*p+o*d-s*u,e[t+3]=c*h-o*u-s*d-l*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,l=o(n/2),c=o(r/2),u=o(i/2),d=s(n/2),p=s(r/2),h=s(i/2);switch(a){case"XYZ":this._x=d*c*u+l*p*h,this._y=l*p*u-d*c*h,this._z=l*c*h+d*p*u,this._w=l*c*u-d*p*h;break;case"YXZ":this._x=d*c*u+l*p*h,this._y=l*p*u-d*c*h,this._z=l*c*h-d*p*u,this._w=l*c*u+d*p*h;break;case"ZXY":this._x=d*c*u-l*p*h,this._y=l*p*u+d*c*h,this._z=l*c*h+d*p*u,this._w=l*c*u-d*p*h;break;case"ZYX":this._x=d*c*u-l*p*h,this._y=l*p*u+d*c*h,this._z=l*c*h-d*p*u,this._w=l*c*u+d*p*h;break;case"YZX":this._x=d*c*u+l*p*h,this._y=l*p*u+d*c*h,this._z=l*c*h-d*p*u,this._w=l*c*u-d*p*h;break;case"XZY":this._x=d*c*u-l*p*h,this._y=l*p*u-d*c*h,this._z=l*c*h+d*p*u,this._w=l*c*u+d*p*h;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],l=t[2],c=t[6],u=t[10],d=n+o+u;if(d>0){const e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(c-s)*e,this._y=(i-l)*e,this._z=(a-r)*e}else if(n>o&&n>u){const e=2*Math.sqrt(1+n-o-u);this._w=(c-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+l)/e}else if(o>u){const e=2*Math.sqrt(1+o-n-u);this._w=(i-l)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+c)/e}else{const e=2*Math.sqrt(1+u-n-o);this._w=(a-r)/e,this._x=(i+l)/e,this._y=(s+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-6?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(we.clamp(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,l=t._z,c=t._w;return this._x=n*c+a*o+r*l-i*s,this._y=r*c+a*s+i*o-n*l,this._z=i*c+a*l+n*s-r*o,this._w=a*c-n*o-r*s-i*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,r=this._y,i=this._z,a=this._w;let o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=r,this._z=i,this;const s=1-o*o;if(s<=Number.EPSILON){const e=1-t;return this._w=e*a+t*this._w,this._x=e*n+t*this._x,this._y=e*r+t*this._y,this._z=e*i+t*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(s),c=Math.atan2(l,o),u=Math.sin((1-t)*c)/l,d=Math.sin(t*c)/l;return this._w=a*u+this._w*d,this._x=n*u+this._x*d,this._y=r*u+this._y*d,this._z=i*u+this._z*d,this._onChangeCallback(),this}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}class Fe{constructor(e=0,t=0,n=0){Object.defineProperty(this,"isVector3",{value:!0}),this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Ue.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Ue.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,l=s*t+a*r-o*n,c=s*n+o*t-i*r,u=s*r+i*n-a*t,d=-i*t-a*n-o*r;return this.x=l*s+d*-i+c*-o-u*-a,this.y=c*s+d*-a+u*-i-l*-o,this.z=u*s+d*-o+l*-a-c*-i,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return _e.copy(this).projectOnVector(e),this.sub(_e)}reflect(e){return this.sub(_e.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(we.clamp(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}const _e=new Fe,Ue=new De;class Le{constructor(e,t){Object.defineProperty(this,"isBox3",{value:!0}),this.min=void 0!==e?e:new Fe(1/0,1/0,1/0),this.max=void 0!==t?t:new Fe(-1/0,-1/0,-1/0)}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0;for(let s=0,l=e.length;si&&(i=l),c>a&&(a=c),u>o&&(o=u)}return this.min.set(t,n,r),this.max.set(i,a,o),this}setFromBufferAttribute(e){let t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0;for(let s=0,l=e.count;si&&(i=l),c>a&&(a=c),u>o&&(o=u)}return this.min.set(t,n,r),this.max.set(i,a,o),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new Fe),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Oe),Oe.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Je),Ze.subVectors(this.max,Je),ze.subVectors(e.a,Je),Qe.subVectors(e.b,Je),je.subVectors(e.c,Je),Ge.subVectors(Qe,ze),We.subVectors(je,Qe),Ye.subVectors(ze,je);let t=[0,-Ge.z,Ge.y,0,-We.z,We.y,0,-Ye.z,Ye.y,Ge.z,0,-Ge.x,We.z,0,-We.x,Ye.z,0,-Ye.x,-Ge.y,Ge.x,0,-We.y,We.x,0,-Ye.y,Ye.x,0];return!!Ve(t,ze,Qe,je,Ze)&&(t=[1,0,0,0,1,0,0,0,1],!!Ve(t,ze,Qe,je,Ze)&&(Ke.crossVectors(Ge,We),t=[Ke.x,Ke.y,Ke.z],Ve(t,ze,Qe,je,Ze)))}clampPoint(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new Fe),t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Oe.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(Oe).length(),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(Ne[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ne[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ne[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ne[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ne[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ne[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ne[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ne[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ne)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}function Ve(e,t,n,r,i){for(let a=0,o=e.length-3;a<=o;a+=3){Xe.fromArray(e,a);const o=i.x*Math.abs(Xe.x)+i.y*Math.abs(Xe.y)+i.z*Math.abs(Xe.z),s=t.dot(Xe),l=n.dot(Xe),c=r.dot(Xe);if(Math.max(-Math.max(s,l,c),Math.min(s,l,c))>o)return!1}return!0}const Ne=[new Fe,new Fe,new Fe,new Fe,new Fe,new Fe,new Fe,new Fe],Oe=new Fe,He=new Le,ze=new Fe,Qe=new Fe,je=new Fe,Ge=new Fe,We=new Fe,Ye=new Fe,Je=new Fe,Ze=new Fe,Ke=new Fe,Xe=new Fe,qe=new Le;class $e{constructor(e,t){this.center=void 0!==e?e:new Fe,this.radius=void 0!==t?t:-1}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;void 0!==t?n.copy(t):qe.setFromPoints(e).getCenter(n);let r=0;for(let t=0,i=e.length;tthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new Le),this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}}const et=new Fe,tt=new Fe,nt=new Fe,rt=new Fe,it=new Fe,at=new Fe,ot=new Fe;class st{constructor(e,t){this.origin=void 0!==e?e:new Fe,this.direction=void 0!==t?t:new Fe(0,0,-1)}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new Fe),t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,et)),this}closestPointToPoint(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new Fe),t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=et.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(et.copy(this.direction).multiplyScalar(t).add(this.origin),et.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){tt.copy(e).add(t).multiplyScalar(.5),nt.copy(t).sub(e).normalize(),rt.copy(this.origin).sub(tt);const i=.5*e.distanceTo(t),a=-this.direction.dot(nt),o=rt.dot(this.direction),s=-rt.dot(nt),l=rt.lengthSq(),c=Math.abs(1-a*a);let u,d,p,h;if(c>0)if(u=a*s-o,d=a*o-s,h=i*c,u>=0)if(d>=-h)if(d<=h){const e=1/c;u*=e,d*=e,p=u*(u+a*d+2*o)+d*(a*u+d+2*s)+l}else d=i,u=Math.max(0,-(a*d+o)),p=-u*u+d*(d+2*s)+l;else d=-i,u=Math.max(0,-(a*d+o)),p=-u*u+d*(d+2*s)+l;else d<=-h?(u=Math.max(0,-(-a*i+o)),d=u>0?-i:Math.min(Math.max(-i,-s),i),p=-u*u+d*(d+2*s)+l):d<=h?(u=0,d=Math.min(Math.max(-i,-s),i),p=d*(d+2*s)+l):(u=Math.max(0,-(a*i+o)),d=u>0?i:Math.min(Math.max(-i,-s),i),p=-u*u+d*(d+2*s)+l);else d=a>0?-i:i,u=Math.max(0,-(a*d+o)),p=-u*u+d*(d+2*s)+l;return n&&n.copy(this.direction).multiplyScalar(u).add(this.origin),r&&r.copy(nt).multiplyScalar(d).add(tt),p}intersectSphere(e,t){et.subVectors(e.center,this.origin);const n=et.dot(this.direction),r=et.dot(et)-n*n,i=e.radius*e.radius;if(r>i)return null;const a=Math.sqrt(i-r),o=n-a,s=n+a;return o<0&&s<0?null:o<0?this.at(s,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);if(0===t)return!0;return e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,a,o,s;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,d=this.origin;return l>=0?(n=(e.min.x-d.x)*l,r=(e.max.x-d.x)*l):(n=(e.max.x-d.x)*l,r=(e.min.x-d.x)*l),c>=0?(i=(e.min.y-d.y)*c,a=(e.max.y-d.y)*c):(i=(e.max.y-d.y)*c,a=(e.min.y-d.y)*c),n>a||i>r?null:((i>n||n!=n)&&(n=i),(a=0?(o=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,s=(e.min.z-d.z)*u),n>s||o>r?null:((o>n||n!=n)&&(n=o),(s=0?n:r,t)))}intersectsBox(e){return null!==this.intersectBox(e,et)}intersectTriangle(e,t,n,r,i){it.subVectors(t,e),at.subVectors(n,e),ot.crossVectors(it,at);let a,o=this.direction.dot(ot);if(o>0){if(r)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}rt.subVectors(this.origin,e);const s=a*this.direction.dot(at.crossVectors(rt,at));if(s<0)return null;const l=a*this.direction.dot(it.cross(rt));if(l<0)return null;if(s+l>o)return null;const c=-a*rt.dot(ot);return c<0?null:this.at(c/o,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}}class lt{constructor(){Object.defineProperty(this,"isMatrix4",{value:!0}),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,r,i,a,o,s,l,c,u,d,p,h,f,m){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=l,g[6]=c,g[10]=u,g[14]=d,g[3]=p,g[7]=h,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new lt).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,r=1/ct.setFromMatrixColumn(e,0).length(),i=1/ct.setFromMatrixColumn(e,1).length(),a=1/ct.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),l=Math.sin(r),c=Math.cos(i),u=Math.sin(i);if("XYZ"===e.order){const e=a*c,n=a*u,r=o*c,i=o*u;t[0]=s*c,t[4]=-s*u,t[8]=l,t[1]=n+r*l,t[5]=e-i*l,t[9]=-o*s,t[2]=i-e*l,t[6]=r+n*l,t[10]=a*s}else if("YXZ"===e.order){const e=s*c,n=s*u,r=l*c,i=l*u;t[0]=e+i*o,t[4]=r*o-n,t[8]=a*l,t[1]=a*u,t[5]=a*c,t[9]=-o,t[2]=n*o-r,t[6]=i+e*o,t[10]=a*s}else if("ZXY"===e.order){const e=s*c,n=s*u,r=l*c,i=l*u;t[0]=e-i*o,t[4]=-a*u,t[8]=r+n*o,t[1]=n+r*o,t[5]=a*c,t[9]=i-e*o,t[2]=-a*l,t[6]=o,t[10]=a*s}else if("ZYX"===e.order){const e=a*c,n=a*u,r=o*c,i=o*u;t[0]=s*c,t[4]=r*l-n,t[8]=e*l+i,t[1]=s*u,t[5]=i*l+e,t[9]=n*l-r,t[2]=-l,t[6]=o*s,t[10]=a*s}else if("YZX"===e.order){const e=a*s,n=a*l,r=o*s,i=o*l;t[0]=s*c,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=a*c,t[9]=-o*c,t[2]=-l*c,t[6]=n*u+r,t[10]=e-i*u}else if("XZY"===e.order){const e=a*s,n=a*l,r=o*s,i=o*l;t[0]=s*c,t[4]=-u,t[8]=l*c,t[1]=e*u+i,t[5]=a*c,t[9]=n*u-r,t[2]=r*u-n,t[6]=o*c,t[10]=i*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(dt,e,pt)}lookAt(e,t,n){const r=this.elements;return mt.subVectors(e,t),0===mt.lengthSq()&&(mt.z=1),mt.normalize(),ht.crossVectors(n,mt),0===ht.lengthSq()&&(1===Math.abs(n.z)?mt.x+=1e-4:mt.z+=1e-4,mt.normalize(),ht.crossVectors(n,mt)),ht.normalize(),ft.crossVectors(mt,ht),r[0]=ht.x,r[4]=ft.x,r[8]=mt.x,r[1]=ht.y,r[5]=ft.y,r[9]=mt.y,r[2]=ht.z,r[6]=ft.z,r[10]=mt.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],l=n[12],c=n[1],u=n[5],d=n[9],p=n[13],h=n[2],f=n[6],m=n[10],g=n[14],A=n[3],v=n[7],y=n[11],b=n[15],x=r[0],w=r[4],E=r[8],S=r[12],M=r[1],T=r[5],B=r[9],R=r[13],C=r[2],I=r[6],k=r[10],P=r[14],D=r[3],F=r[7],_=r[11],U=r[15];return i[0]=a*x+o*M+s*C+l*D,i[4]=a*w+o*T+s*I+l*F,i[8]=a*E+o*B+s*k+l*_,i[12]=a*S+o*R+s*P+l*U,i[1]=c*x+u*M+d*C+p*D,i[5]=c*w+u*T+d*I+p*F,i[9]=c*E+u*B+d*k+p*_,i[13]=c*S+u*R+d*P+p*U,i[2]=h*x+f*M+m*C+g*D,i[6]=h*w+f*T+m*I+g*F,i[10]=h*E+f*B+m*k+g*_,i[14]=h*S+f*R+m*P+g*U,i[3]=A*x+v*M+y*C+b*D,i[7]=A*w+v*T+y*I+b*F,i[11]=A*E+v*B+y*k+b*_,i[15]=A*S+v*R+y*P+b*U,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],l=e[13],c=e[2],u=e[6],d=e[10],p=e[14];return e[3]*(+i*s*u-r*l*u-i*o*d+n*l*d+r*o*p-n*s*p)+e[7]*(+t*s*p-t*l*d+i*a*d-r*a*p+r*l*c-i*s*c)+e[11]*(+t*l*u-t*o*p-i*a*u+n*a*p+i*o*c-n*l*c)+e[15]*(-r*o*c-t*s*u+t*o*d+r*a*u-n*a*d+n*s*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=e[9],d=e[10],p=e[11],h=e[12],f=e[13],m=e[14],g=e[15],A=u*m*l-f*d*l+f*s*p-o*m*p-u*s*g+o*d*g,v=h*d*l-c*m*l-h*s*p+a*m*p+c*s*g-a*d*g,y=c*f*l-h*u*l+h*o*p-a*f*p-c*o*g+a*u*g,b=h*u*s-c*f*s-h*o*d+a*f*d+c*o*m-a*u*m,x=t*A+n*v+r*y+i*b;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/x;return e[0]=A*w,e[1]=(f*d*i-u*m*i-f*r*p+n*m*p+u*r*g-n*d*g)*w,e[2]=(o*m*i-f*s*i+f*r*l-n*m*l-o*r*g+n*s*g)*w,e[3]=(u*s*i-o*d*i-u*r*l+n*d*l+o*r*p-n*s*p)*w,e[4]=v*w,e[5]=(c*m*i-h*d*i+h*r*p-t*m*p-c*r*g+t*d*g)*w,e[6]=(h*s*i-a*m*i-h*r*l+t*m*l+a*r*g-t*s*g)*w,e[7]=(a*d*i-c*s*i+c*r*l-t*d*l-a*r*p+t*s*p)*w,e[8]=y*w,e[9]=(h*u*i-c*f*i-h*n*p+t*f*p+c*n*g-t*u*g)*w,e[10]=(a*f*i-h*o*i+h*n*l-t*f*l-a*n*g+t*o*g)*w,e[11]=(c*o*i-a*u*i-c*n*l+t*u*l+a*n*p-t*o*p)*w,e[12]=b*w,e[13]=(c*f*r-h*u*r+h*n*d-t*f*d-c*n*m+t*u*m)*w,e[14]=(h*o*r-a*f*r-h*n*s+t*f*s+a*n*m-t*o*m)*w,e[15]=(a*u*r-c*o*r+c*n*s-t*u*s-a*n*d+t*o*d)*w,this}scale(e){const t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,l=i*a,c=i*o;return this.set(l*a+n,l*o-r*s,l*s+r*o,0,l*o+r*s,c*o+n,c*s-r*a,0,l*s-r*o,c*s+r*a,i*s*s+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,l=i+i,c=a+a,u=o+o,d=i*l,p=i*c,h=i*u,f=a*c,m=a*u,g=o*u,A=s*l,v=s*c,y=s*u,b=n.x,x=n.y,w=n.z;return r[0]=(1-(f+g))*b,r[1]=(p+y)*b,r[2]=(h-v)*b,r[3]=0,r[4]=(p-y)*x,r[5]=(1-(d+g))*x,r[6]=(m+A)*x,r[7]=0,r[8]=(h+v)*w,r[9]=(m-A)*w,r[10]=(1-(d+f))*w,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let i=ct.set(r[0],r[1],r[2]).length();const a=ct.set(r[4],r[5],r[6]).length(),o=ct.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],ut.copy(this);const s=1/i,l=1/a,c=1/o;return ut.elements[0]*=s,ut.elements[1]*=s,ut.elements[2]*=s,ut.elements[4]*=l,ut.elements[5]*=l,ut.elements[6]*=l,ut.elements[8]*=c,ut.elements[9]*=c,ut.elements[10]*=c,t.setFromRotationMatrix(ut),n.x=i,n.y=a,n.z=o,this}makePerspective(e,t,n,r,i,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const o=this.elements,s=2*i/(t-e),l=2*i/(n-r),c=(t+e)/(t-e),u=(n+r)/(n-r),d=-(a+i)/(a-i),p=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=c,o[12]=0,o[1]=0,o[5]=l,o[9]=u,o[13]=0,o[2]=0,o[6]=0,o[10]=d,o[14]=p,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(e,t,n,r,i,a){const o=this.elements,s=1/(t-e),l=1/(n-r),c=1/(a-i),u=(t+e)*s,d=(n+r)*l,p=(a+i)*c;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-u,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-d,o[2]=0,o[6]=0,o[10]=-2*c,o[14]=-p,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const ct=new Fe,ut=new lt,dt=new Fe(0,0,0),pt=new Fe(1,1,1),ht=new Fe,ft=new Fe,mt=new Fe;class gt{constructor(e=0,t=0,n=0,r=gt.DefaultOrder){Object.defineProperty(this,"isEuler",{value:!0}),this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._order=r||this._order,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t,n){const r=we.clamp,i=e.elements,a=i[0],o=i[4],s=i[8],l=i[1],c=i[5],u=i[9],d=i[2],p=i[6],h=i[10];switch(t=t||this._order){case"XYZ":this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-r(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(s,h),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,a),this._z=0);break;case"ZXY":this._x=Math.asin(r(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-d,h),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,a));break;case"ZYX":this._y=Math.asin(-r(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(p,h),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(r(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-d,a)):(this._x=0,this._y=Math.atan2(s,h));break;case"XZY":this._z=Math.asin(-r(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-u,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!1!==n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return At.makeRotationFromQuaternion(e),this.setFromRotationMatrix(At,t,n)}setFromVector3(e,t){return this.set(e.x,e.y,e.z,t||this._order)}reorder(e){return vt.setFromEuler(this),this.setFromQuaternion(vt,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new Fe(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}gt.DefaultOrder="XYZ",gt.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];const At=new lt,vt=new De;class yt{constructor(){this.mask=1}set(e){this.mask=1<1){for(let e=0;e1){for(let e=0;e0){r.children=[];for(let t=0;t0){r.animations=[];for(let t=0;t0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c)}return n.object=r,n;function a(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t1?void 0:t.copy(n).multiplyScalar(i).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new Fe),e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||Ut.getNormalMatrix(e),r=this.coplanarPoint(Ft).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}}const Vt=new Fe,Nt=new Fe,Ot=new Fe,Ht=new Fe,zt=new Fe,Qt=new Fe,jt=new Fe,Gt=new Fe,Wt=new Fe,Yt=new Fe;class Jt{constructor(e,t,n){this.a=void 0!==e?e:new Fe,this.b=void 0!==t?t:new Fe,this.c=void 0!==n?n:new Fe}static getNormal(e,t,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new Fe),r.subVectors(n,t),Vt.subVectors(e,t),r.cross(Vt);const i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){Vt.subVectors(r,t),Nt.subVectors(n,t),Ot.subVectors(e,t);const a=Vt.dot(Vt),o=Vt.dot(Nt),s=Vt.dot(Ot),l=Nt.dot(Nt),c=Nt.dot(Ot),u=a*l-o*o;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new Fe),0===u)return i.set(-2,-1,-1);const d=1/u,p=(l*s-o*c)*d,h=(a*c-o*s)*d;return i.set(1-p-h,h,p)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,Ht),Ht.x>=0&&Ht.y>=0&&Ht.x+Ht.y<=1}static getUV(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,Ht),s.set(0,0),s.addScaledVector(i,Ht.x),s.addScaledVector(a,Ht.y),s.addScaledVector(o,Ht.z),s}static isFrontFacing(e,t,n,r){return Vt.subVectors(n,t),Nt.subVectors(e,t),Vt.cross(Nt).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Vt.subVectors(this.c,this.b),Nt.subVectors(this.a,this.b),.5*Vt.cross(Nt).length()}getMidpoint(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new Fe),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Jt.getNormal(this.a,this.b,this.c,e)}getPlane(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new Lt),e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Jt.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,r,i){return Jt.getUV(e,this.a,this.b,this.c,t,n,r,i)}containsPoint(e){return Jt.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Jt.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new Fe);const n=this.a,r=this.b,i=this.c;let a,o;zt.subVectors(r,n),Qt.subVectors(i,n),Gt.subVectors(e,n);const s=zt.dot(Gt),l=Qt.dot(Gt);if(s<=0&&l<=0)return t.copy(n);Wt.subVectors(e,r);const c=zt.dot(Wt),u=Qt.dot(Wt);if(c>=0&&u<=c)return t.copy(r);const d=s*u-c*l;if(d<=0&&s>=0&&c<=0)return a=s/(s-c),t.copy(n).addScaledVector(zt,a);Yt.subVectors(e,i);const p=zt.dot(Yt),h=Qt.dot(Yt);if(h>=0&&p<=h)return t.copy(i);const f=p*l-s*h;if(f<=0&&l>=0&&h<=0)return o=l/(l-h),t.copy(n).addScaledVector(Qt,o);const m=c*h-p*u;if(m<=0&&u-c>=0&&p-h>=0)return jt.subVectors(i,r),o=(u-c)/(u-c+(p-h)),t.copy(r).addScaledVector(jt,o);const g=1/(m+f+d);return a=f*g,o=d*g,t.copy(n).addScaledVector(zt,a).addScaledVector(Qt,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Zt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Kt={h:0,s:0,l:0},Xt={h:0,s:0,l:0};function qt(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function $t(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function en(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class tn{constructor(e,t,n){return Object.defineProperty(this,"isColor",{value:!0}),void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=we.euclideanModulo(e,1),t=we.clamp(t,0,1),n=we.clamp(n,0,1),0===t)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=qt(i,r,e+1/3),this.g=qt(i,r,e),this.b=qt(i,r,e-1/3)}return this}setStyle(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let e;const r=n[1],i=n[2];switch(r){case"rgb":case"rgba":if(e=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))return this.r=Math.min(255,parseInt(e[1],10))/255,this.g=Math.min(255,parseInt(e[2],10))/255,this.b=Math.min(255,parseInt(e[3],10))/255,t(e[4]),this;if(e=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))return this.r=Math.min(100,parseInt(e[1],10))/100,this.g=Math.min(100,parseInt(e[2],10))/100,this.b=Math.min(100,parseInt(e[3],10))/100,t(e[4]),this;break;case"hsl":case"hsla":if(e=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i)){const n=parseFloat(e[1])/360,r=parseInt(e[2],10)/100,i=parseInt(e[3],10)/100;return t(e[4]),this.setHSL(n,r,i)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){const e=n[1],t=e.length;if(3===t)return this.r=parseInt(e.charAt(0)+e.charAt(0),16)/255,this.g=parseInt(e.charAt(1)+e.charAt(1),16)/255,this.b=parseInt(e.charAt(2)+e.charAt(2),16)/255,this;if(6===t)return this.r=parseInt(e.charAt(0)+e.charAt(1),16)/255,this.g=parseInt(e.charAt(2)+e.charAt(3),16)/255,this.b=parseInt(e.charAt(4)+e.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){const t=Zt[e];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){const n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=$t(e.r),this.g=$t(e.g),this.b=$t(e.b),this}copyLinearToSRGB(e){return this.r=en(e.r),this.g=en(e.g),this.b=en(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});const t=this.r,n=this.g,r=this.b,i=Math.max(t,n,r),a=Math.min(t,n,r);let o,s;const l=(a+i)/2;if(a===i)o=0,s=0;else{const e=i-a;switch(s=l<=.5?e/(i+a):e/(2-i-a),i){case t:o=(n-r)/e+(n0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){const t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(null!==t){const e=t.length;n=new Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(an.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),on.prototype=Object.create(an.prototype),on.prototype.constructor=on,on.prototype.isMeshBasicMaterial=!0,on.prototype.copy=function(e){return an.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this};const sn=new Fe,ln=new Ee;function cn(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}function un(e,t,n){cn.call(this,new Int8Array(e),t,n)}function dn(e,t,n){cn.call(this,new Uint8Array(e),t,n)}function pn(e,t,n){cn.call(this,new Uint8ClampedArray(e),t,n)}function hn(e,t,n){cn.call(this,new Int16Array(e),t,n)}function fn(e,t,n){cn.call(this,new Uint16Array(e),t,n)}function mn(e,t,n){cn.call(this,new Int32Array(e),t,n)}function gn(e,t,n){cn.call(this,new Uint32Array(e),t,n)}function An(e,t,n){cn.call(this,new Uint16Array(e),t,n)}function vn(e,t,n){cn.call(this,new Float32Array(e),t,n)}function yn(e,t,n){cn.call(this,new Float64Array(e),t,n)}function bn(e){if(0===e.length)return-1/0;let t=e[0];for(let n=1,r=e.length;nt&&(t=e[n]);return t}Object.defineProperty(cn.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(cn.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;r65535?gn:fn)(e,1):this.index=e,this},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,t){return this.attributes[e]=t,this},deleteAttribute:function(e){return delete this.attributes[e],this},hasAttribute:function(e){return void 0!==this.attributes[e]},addGroup:function(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix4:function(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const t=(new Se).getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}const r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(e),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(e){return Sn.makeRotationX(e),this.applyMatrix4(Sn),this},rotateY:function(e){return Sn.makeRotationY(e),this.applyMatrix4(Sn),this},rotateZ:function(e){return Sn.makeRotationZ(e),this.applyMatrix4(Sn),this},translate:function(e,t,n){return Sn.makeTranslation(e,t,n),this.applyMatrix4(Sn),this},scale:function(e,t,n){return Sn.makeScale(e,t,n),this.applyMatrix4(Sn),this},lookAt:function(e){return Mn.lookAt(e),Mn.updateMatrix(),this.applyMatrix4(Mn.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Tn).negate(),this.translate(Tn.x,Tn.y,Tn.z),this},setFromPoints:function(e){const t=[];for(let n=0,r=e.length;n0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const t in n){const r=n[t],i=r.toJSON(e.data);""!==r.name&&(i.name=r.name),e.data.attributes[t]=i}const r={};let i=!1;for(const t in this.morphAttributes){const n=this.morphAttributes[t],a=[];for(let t=0,r=n.length;t0&&(r[t]=a,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return null!==o&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e},clone:function(){return(new In).copy(this)},copy:function(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;null!==n&&this.setIndex(n.clone(t));const r=e.attributes;for(const e in r){const n=r[e];this.setAttribute(e,n.clone(t))}const i=e.morphAttributes;for(const e in i){const n=[],r=i[e];for(let e=0,i=r.length;en.far?null:{distance:c,point:Yn.clone(),object:e}}(e,t,n,r,Fn,_n,Un,Wn);if(h){s&&(Qn.fromBufferAttribute(s,c),jn.fromBufferAttribute(s,u),Gn.fromBufferAttribute(s,d),h.uv=Jt.getUV(Wn,Fn,_n,Un,Qn,jn,Gn,new Ee)),l&&(Qn.fromBufferAttribute(l,c),jn.fromBufferAttribute(l,u),Gn.fromBufferAttribute(l,d),h.uv2=Jt.getUV(Wn,Fn,_n,Un,Qn,jn,Gn,new Ee));const e=new nn(c,u,d);Jt.getNormal(Fn,_n,Un,e.normal),h.face=e}return h}Jn.prototype=Object.assign(Object.create(Dt.prototype),{constructor:Jn,isMesh:!0,copy:function(e){return Dt.prototype.copy.call(this,e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this},updateMorphTargets:function(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,t){const n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0===r)return;if(null===n.boundingSphere&&n.computeBoundingSphere(),Dn.copy(n.boundingSphere),Dn.applyMatrix4(i),!1===e.ray.intersectsSphere(Dn))return;if(kn.copy(i).invert(),Pn.copy(e.ray).applyMatrix4(kn),null!==n.boundingBox&&!1===Pn.intersectsBox(n.boundingBox))return;let a;if(n.isBufferGeometry){const i=n.index,o=n.attributes.position,s=n.morphAttributes.position,l=n.morphTargetsRelative,c=n.attributes.uv,u=n.attributes.uv2,d=n.groups,p=n.drawRange;if(null!==i)if(Array.isArray(r))for(let n=0,h=d.length;n0?1:-1,c.push(B.x,B.y,B.z),u.push(s/m),u.push(1-a/g),M+=1}}for(let e=0;e0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const n={};for(const e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t},tr.prototype=Object.assign(Object.create(Dt.prototype),{constructor:tr,isCamera:!0,copy:function(e,t){return Dt.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new Fe),this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){Dt.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()},updateWorldMatrix:function(e,t){Dt.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()},clone:function(){return(new this.constructor).copy(this)}}),nr.prototype=Object.assign(Object.create(tr.prototype),{constructor:nr,isPerspectiveCamera:!0,copy:function(e,t){return tr.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){const t=.5*this.getFilmHeight()/e;this.fov=2*we.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){const e=Math.tan(.5*we.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*we.RAD2DEG*Math.atan(Math.tan(.5*we.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,n,r,i,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){const e=this.near;let t=e*Math.tan(.5*we.DEG2RAD*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r;const a=this.view;if(null!==this.view&&this.view.enabled){const e=a.fullWidth,o=a.fullHeight;i+=a.offsetX*r/e,t-=a.offsetY*n/o,r*=a.width/e,n*=a.height/o}const o=this.filmOffset;0!==o&&(i+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()},toJSON:function(e){const t=Dt.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}});function rr(e,t,n){if(Dt.call(this),this.type="CubeCamera",!0!==n.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=n;const r=new nr(90,1,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new Fe(1,0,0)),this.add(r);const i=new nr(90,1,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new Fe(-1,0,0)),this.add(i);const a=new nr(90,1,e,t);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(new Fe(0,1,0)),this.add(a);const o=new nr(90,1,e,t);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new Fe(0,-1,0)),this.add(o);const s=new nr(90,1,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new Fe(0,0,1)),this.add(s);const l=new nr(90,1,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new Fe(0,0,-1)),this.add(l),this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();const c=e.xr.enabled,u=e.getRenderTarget();e.xr.enabled=!1;const d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,r),e.setRenderTarget(n,1),e.render(t,i),e.setRenderTarget(n,2),e.render(t,a),e.setRenderTarget(n,3),e.render(t,o),e.setRenderTarget(n,4),e.render(t,s),n.texture.generateMipmaps=d,e.setRenderTarget(n,5),e.render(t,l),e.setRenderTarget(u),e.xr.enabled=c}}function ir(e,t,n,r,i,a,o,s,l,c){e=void 0!==e?e:[],t=void 0!==t?t:301,o=void 0!==o?o:1022,Re.call(this,e,t,n,r,i,a,o,s,l,c),this.flipY=!1,this._needsFlipEnvMap=!0}rr.prototype=Object.create(Dt.prototype),rr.prototype.constructor=rr,ir.prototype=Object.create(Re.prototype),ir.prototype.constructor=ir,ir.prototype.isCubeTexture=!0,Object.defineProperty(ir.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}});class ar extends ke{constructor(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n),super(e,e,t),Object.defineProperty(this,"isWebGLCubeRenderTarget",{value:!0}),t=t||{},this.texture=new ir(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=1023,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},r=new Kn(5,5,5),i=new er({name:"CubemapFromEquirect",uniforms:Xn(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=t;const a=new Jn(r,i),o=t.minFilter;1008===t.minFilter&&(t.minFilter=1006);return new rr(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t,n,r){const i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,r);e.setRenderTarget(i)}}function or(e,t,n,r,i,a,o,s,l,c,u,d){Re.call(this,null,a,o,s,l,c,r,i,u,d),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=void 0!==l?l:1003,this.minFilter=void 0!==c?c:1003,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}or.prototype=Object.create(Re.prototype),or.prototype.constructor=or,or.prototype.isDataTexture=!0;const sr=new $e,lr=new Fe;class cr{constructor(e,t,n,r,i,a){this.planes=[void 0!==e?e:new Lt,void 0!==t?t:new Lt,void 0!==n?n:new Lt,void 0!==r?r:new Lt,void 0!==i?i:new Lt,void 0!==a?a:new Lt]}set(e,t,n,r,i,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}clone(){return(new this.constructor).copy(this)}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){const t=this.planes,n=e.elements,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],l=n[5],c=n[6],u=n[7],d=n[8],p=n[9],h=n[10],f=n[11],m=n[12],g=n[13],A=n[14],v=n[15];return t[0].setComponents(o-r,u-s,f-d,v-m).normalize(),t[1].setComponents(o+r,u+s,f+d,v+m).normalize(),t[2].setComponents(o+i,u+l,f+p,v+g).normalize(),t[3].setComponents(o-i,u-l,f-p,v-g).normalize(),t[4].setComponents(o-a,u-c,f-h,v-A).normalize(),t[5].setComponents(o+a,u+c,f+h,v+A).normalize(),this}intersectsObject(e){const t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),sr.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(sr)}intersectsSprite(e){return sr.center.set(0,0,0),sr.radius=.7071067811865476,sr.applyMatrix4(e.matrixWorld),this.intersectsSphere(sr)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++){if(t[e].distanceToPoint(n)0?e.max.x:e.min.x,lr.y=r.normal.y>0?e.max.y:e.min.y,lr.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(lr)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}}function ur(){let e=null,t=!1,n=null,r=null;function i(t,a){n(t,a),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function dr(e,t){const n=t.isWebGL2,r=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);const n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))},update:function(t,i){if(t.isGLBufferAttribute){const e=r.get(t);return void((!e||e.version 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor.xyz *= color.xyz;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmissionmap_fragment:"#ifdef USE_TRANSMISSIONMAP\n\ttotalTransmission *= texture2D( transmissionMap, vUv ).r;\n#endif",transmissionmap_pars_fragment:"#ifdef USE_TRANSMISSIONMAP\n\tuniform sampler2D transmissionMap;\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSMISSION\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSMISSION\n\tuniform float transmission;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#ifdef TRANSMISSION\n\t\tfloat totalTransmission = transmission;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSMISSION\n\t\tdiffuseColor.a *= mix( saturate( 1. - totalTransmission + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) ), 1.0, metalness );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"},fr={common:{diffuse:{value:new tn(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new Se},uv2Transform:{value:new Se},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Ee(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new tn(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new tn(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Se}},sprite:{diffuse:{value:new tn(15658734)},opacity:{value:1},center:{value:new Ee(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Se}}},mr={basic:{uniforms:qn([fr.common,fr.specularmap,fr.envmap,fr.aomap,fr.lightmap,fr.fog]),vertexShader:hr.meshbasic_vert,fragmentShader:hr.meshbasic_frag},lambert:{uniforms:qn([fr.common,fr.specularmap,fr.envmap,fr.aomap,fr.lightmap,fr.emissivemap,fr.fog,fr.lights,{emissive:{value:new tn(0)}}]),vertexShader:hr.meshlambert_vert,fragmentShader:hr.meshlambert_frag},phong:{uniforms:qn([fr.common,fr.specularmap,fr.envmap,fr.aomap,fr.lightmap,fr.emissivemap,fr.bumpmap,fr.normalmap,fr.displacementmap,fr.fog,fr.lights,{emissive:{value:new tn(0)},specular:{value:new tn(1118481)},shininess:{value:30}}]),vertexShader:hr.meshphong_vert,fragmentShader:hr.meshphong_frag},standard:{uniforms:qn([fr.common,fr.envmap,fr.aomap,fr.lightmap,fr.emissivemap,fr.bumpmap,fr.normalmap,fr.displacementmap,fr.roughnessmap,fr.metalnessmap,fr.fog,fr.lights,{emissive:{value:new tn(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:hr.meshphysical_vert,fragmentShader:hr.meshphysical_frag},toon:{uniforms:qn([fr.common,fr.aomap,fr.lightmap,fr.emissivemap,fr.bumpmap,fr.normalmap,fr.displacementmap,fr.gradientmap,fr.fog,fr.lights,{emissive:{value:new tn(0)}}]),vertexShader:hr.meshtoon_vert,fragmentShader:hr.meshtoon_frag},matcap:{uniforms:qn([fr.common,fr.bumpmap,fr.normalmap,fr.displacementmap,fr.fog,{matcap:{value:null}}]),vertexShader:hr.meshmatcap_vert,fragmentShader:hr.meshmatcap_frag},points:{uniforms:qn([fr.points,fr.fog]),vertexShader:hr.points_vert,fragmentShader:hr.points_frag},dashed:{uniforms:qn([fr.common,fr.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:hr.linedashed_vert,fragmentShader:hr.linedashed_frag},depth:{uniforms:qn([fr.common,fr.displacementmap]),vertexShader:hr.depth_vert,fragmentShader:hr.depth_frag},normal:{uniforms:qn([fr.common,fr.bumpmap,fr.normalmap,fr.displacementmap,{opacity:{value:1}}]),vertexShader:hr.normal_vert,fragmentShader:hr.normal_frag},sprite:{uniforms:qn([fr.sprite,fr.fog]),vertexShader:hr.sprite_vert,fragmentShader:hr.sprite_frag},background:{uniforms:{uvTransform:{value:new Se},t2D:{value:null}},vertexShader:hr.background_vert,fragmentShader:hr.background_frag},cube:{uniforms:qn([fr.envmap,{opacity:{value:1}}]),vertexShader:hr.cube_vert,fragmentShader:hr.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:hr.equirect_vert,fragmentShader:hr.equirect_frag},distanceRGBA:{uniforms:qn([fr.common,fr.displacementmap,{referencePosition:{value:new Fe},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:hr.distanceRGBA_vert,fragmentShader:hr.distanceRGBA_frag},shadow:{uniforms:qn([fr.lights,fr.fog,{color:{value:new tn(0)},opacity:{value:1}}]),vertexShader:hr.shadow_vert,fragmentShader:hr.shadow_frag}};function gr(e,t,n,r,i){const a=new tn(0);let o,s,l=0,c=null,u=0,d=null;function p(e,t){n.buffers.color.setClear(e.r,e.g,e.b,t,i)}return{getClearColor:function(){return a},setClearColor:function(e,t=1){a.set(e),l=t,p(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(e){l=e,p(a,l)},render:function(n,i,h,f){let m=!0===i.isScene?i.background:null;m&&m.isTexture&&(m=t.get(m));const g=e.xr,A=g.getSession&&g.getSession();A&&"additive"===A.environmentBlendMode&&(m=null),null===m?p(a,l):m&&m.isColor&&(p(m,1),f=!0),(e.autoClear||f)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),m&&(m.isCubeTexture||m.isWebGLCubeRenderTarget||306===m.mapping)?(void 0===s&&(s=new Jn(new Kn(1,1,1),new er({name:"BackgroundCubeMaterial",uniforms:Xn(mr.cube.uniforms),vertexShader:mr.cube.vertexShader,fragmentShader:mr.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),s.geometry.deleteAttribute("normal"),s.geometry.deleteAttribute("uv"),s.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(s.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(s)),m.isWebGLCubeRenderTarget&&(m=m.texture),s.material.uniforms.envMap.value=m,s.material.uniforms.flipEnvMap.value=m.isCubeTexture&&m._needsFlipEnvMap?-1:1,c===m&&u===m.version&&d===e.toneMapping||(s.material.needsUpdate=!0,c=m,u=m.version,d=e.toneMapping),n.unshift(s,s.geometry,s.material,0,0,null)):m&&m.isTexture&&(void 0===o&&(o=new Jn(new pr(2,2),new er({name:"BackgroundMaterial",uniforms:Xn(mr.background.uniforms),vertexShader:mr.background.vertexShader,fragmentShader:mr.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),o.geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(o)),o.material.uniforms.t2D.value=m,!0===m.matrixAutoUpdate&&m.updateMatrix(),o.material.uniforms.uvTransform.value.copy(m.matrix),c===m&&u===m.version&&d===e.toneMapping||(o.material.needsUpdate=!0,c=m,u=m.version,d=e.toneMapping),n.unshift(o,o.geometry,o.material,0,0,null))}}}function Ar(e,t,n,r){const i=e.getParameter(34921),a=r.isWebGL2?null:t.get("OES_vertex_array_object"),o=r.isWebGL2||null!==a,s={},l=p(null);let c=l;function u(t){return r.isWebGL2?e.bindVertexArray(t):a.bindVertexArrayOES(t)}function d(t){return r.isWebGL2?e.deleteVertexArray(t):a.deleteVertexArrayOES(t)}function p(e){const t=[],n=[],r=[];for(let e=0;e=0){const a=l[t];if(void 0!==a){const t=a.normalized,i=a.itemSize,o=n.get(a);if(void 0===o)continue;const l=o.buffer,c=o.type,u=o.bytesPerElement;if(a.isInterleavedBufferAttribute){const n=a.data,o=n.stride,d=a.offset;n&&n.isInstancedInterleavedBuffer?(m(r,n.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=n.meshPerAttribute*n.count)):f(r),e.bindBuffer(34962,l),A(r,i,c,t,o*u,d*u)}else a.isInstancedBufferAttribute?(m(r,a.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=a.meshPerAttribute*a.count)):f(r),e.bindBuffer(34962,l),A(r,i,c,t,0,0)}else if("instanceMatrix"===t){const t=n.get(i.instanceMatrix);if(void 0===t)continue;const a=t.buffer,o=t.type;m(r+0,1),m(r+1,1),m(r+2,1),m(r+3,1),e.bindBuffer(34962,a),e.vertexAttribPointer(r+0,4,o,!1,64,0),e.vertexAttribPointer(r+1,4,o,!1,64,16),e.vertexAttribPointer(r+2,4,o,!1,64,32),e.vertexAttribPointer(r+3,4,o,!1,64,48)}else if("instanceColor"===t){const t=n.get(i.instanceColor);if(void 0===t)continue;const a=t.buffer,o=t.type;m(r,1),e.bindBuffer(34962,a),e.vertexAttribPointer(r,3,o,!1,12,0)}else if(void 0!==u){const n=u[t];if(void 0!==n)switch(n.length){case 2:e.vertexAttrib2fv(r,n);break;case 3:e.vertexAttrib3fv(r,n);break;case 4:e.vertexAttrib4fv(r,n);break;default:e.vertexAttrib1fv(r,n)}}}}g()}(i,l,d,v),null!==y&&e.bindBuffer(34963,n.get(y).buffer))},reset:v,resetDefaultState:y,dispose:function(){v();for(const e in s){const t=s[e];for(const e in t){const n=t[e];for(const e in n)d(n[e].object),delete n[e];delete t[e]}delete s[e]}},releaseStatesOfGeometry:function(e){if(void 0===s[e.id])return;const t=s[e.id];for(const e in t){const n=t[e];for(const e in n)d(n[e].object),delete n[e];delete t[e]}delete s[e.id]},releaseStatesOfProgram:function(e){for(const t in s){const n=s[t];if(void 0===n[e.id])continue;const r=n[e.id];for(const e in r)d(r[e].object),delete r[e];delete n[e.id]}},initAttributes:h,enableAttribute:f,disableUnusedAttributes:g}}function vr(e,t,n,r){const i=r.isWebGL2;let a;this.setMode=function(e){a=e},this.render=function(t,r){e.drawArrays(a,t,r),n.update(r,a,1)},this.renderInstances=function(r,o,s){if(0===s)return;let l,c;if(i)l=e,c="drawArraysInstanced";else if(l=t.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](a,r,o,s),n.update(o,a,s)}}function yr(e,t,n){let r;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const a="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext;let o=void 0!==n.precision?n.precision:"highp";const s=i(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);const l=!0===n.logarithmicDepthBuffer,c=e.getParameter(34930),u=e.getParameter(35660),d=e.getParameter(3379),p=e.getParameter(34076),h=e.getParameter(34921),f=e.getParameter(36347),m=e.getParameter(36348),g=e.getParameter(36349),A=u>0,v=a||!!t.get("OES_texture_float");return{isWebGL2:a,getMaxAnisotropy:function(){if(void 0!==r)return r;const n=t.get("EXT_texture_filter_anisotropic");return r=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,r},getMaxPrecision:i,precision:o,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:p,maxAttributes:h,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:A,floatFragmentTextures:v,floatVertexTextures:A&&v,maxSamples:a?e.getParameter(36183):0}}function br(e){const t=this;let n=null,r=0,i=!1,a=!1;const o=new Lt,s=new Se,l={value:null,needsUpdate:!1};function c(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function u(e,n,r,i){const a=null!==e?e.length:0;let c=null;if(0!==a){if(c=l.value,!0!==i||null===c){const t=r+4*a,i=n.matrixWorldInverse;s.getNormalMatrix(i),(null===c||c.length0){const o=e.getRenderList(),s=e.getRenderTarget(),l=new ar(a.height/2);return l.fromEquirectangularTexture(e,i),t.set(i,l),e.setRenderTarget(s),e.setRenderList(o),i.addEventListener("dispose",r),n(l.texture,i.mapping)}return null}}}return i},dispose:function(){t=new WeakMap}}}function wr(e){const t={};function n(n){if(void 0!==t[n])return t[n];let r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return t[n]=r,r}return{has:function(e){return null!==n(e)},init:function(e){e.isWebGL2?n("EXT_color_buffer_float"):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float")},get:function(e){const t=n(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function Er(e,t,n,r){const i={},a=new WeakMap;function o(e){const s=e.target;null!==s.index&&t.remove(s.index);for(const e in s.attributes)t.remove(s.attributes[e]);s.removeEventListener("dispose",o),delete i[s.id];const l=a.get(s);l&&(t.remove(l),a.delete(s)),r.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(e){const n=[],r=e.index,i=e.attributes.position;let o=0;if(null!==r){const e=r.array;o=r.version;for(let t=0,r=e.length;t65535?gn:fn)(n,1);s.version=o;const l=a.get(e);l&&t.remove(l),a.set(e,s)}return{get:function(e,t){return!0===i[t.id]||(t.addEventListener("dispose",o),i[t.id]=!0,n.memory.geometries++),t},update:function(e){const n=e.attributes;for(const e in n)t.update(n[e],34962);const r=e.morphAttributes;for(const e in r){const n=r[e];for(let e=0,r=n.length;e0)return e;const i=t*n;let a=Ur[i];if(void 0===a&&(a=new Float32Array(i),Ur[i]=a),0!==t){r.toArray(a,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(a,i)}return a}function zr(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n/gm;function Vi(e){return e.replace(Li,Ni)}function Ni(e,t){const n=hr[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return Vi(n)}const Oi=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Hi=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function zi(e){return e.replace(Hi,ji).replace(Oi,Qi)}function Qi(e,t,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),ji(e,t,n,r)}function ji(e,t,n,r){let i="";for(let e=parseInt(t);e0?e.gammaFactor:1,h=n.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Fi).join("\n")}(n),f=function(e){const t=[];for(const n in e){const r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(a),m=i.createProgram();let g,A,v=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(g=[f].filter(Fi).join("\n"),g.length>0&&(g+="\n"),A=[h,f].filter(Fi).join("\n"),A.length>0&&(A+="\n")):(g=[Gi(n),"#define SHADER_NAME "+n.shaderName,f,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+p,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Fi).join("\n"),A=[h,Gi(n),"#define SHADER_NAME "+n.shaderName,f,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+d:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?hr.tonemapping_pars_fragment:"",0!==n.toneMapping?Di("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",hr.encodings_pars_fragment,n.map?ki("mapTexelToLinear",n.mapEncoding):"",n.matcap?ki("matcapTexelToLinear",n.matcapEncoding):"",n.envMap?ki("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?ki("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMap?ki("lightMapTexelToLinear",n.lightMapEncoding):"",Pi("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Fi).join("\n")),o=Vi(o),o=_i(o,n),o=Ui(o,n),s=Vi(s),s=_i(s,n),s=Ui(s,n),o=zi(o),s=zi(s),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(v="#version 300 es\n",g=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,A=["#define varying in","300 es"===n.glslVersion?"":"out highp vec4 pc_fragColor;","300 es"===n.glslVersion?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+A);const y=v+A+s,b=Bi(i,35633,v+g+o),x=Bi(i,35632,y);if(i.attachShader(m,b),i.attachShader(m,x),void 0!==n.index0AttributeName?i.bindAttribLocation(m,0,n.index0AttributeName):!0===n.morphTargets&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),e.debug.checkShaderErrors){const e=i.getProgramInfoLog(m).trim(),t=i.getShaderInfoLog(b).trim(),n=i.getShaderInfoLog(x).trim();let r=!0,a=!0;if(!1===i.getProgramParameter(m,35714)){r=!1;const t=Ii(i,b,"vertex"),n=Ii(i,x,"fragment");console.error("THREE.WebGLProgram: shader error: ",i.getError(),"35715",i.getProgramParameter(m,35715),"gl.getProgramInfoLog",e,t,n)}else""!==e?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",e):""!==t&&""!==n||(a=!1);a&&(this.diagnostics={runnable:r,programLog:e,vertexShader:{log:t,prefix:g},fragmentShader:{log:n,prefix:A}})}let w,E;return i.deleteShader(b),i.deleteShader(x),this.getUniforms=function(){return void 0===w&&(w=new Ti(i,m)),w},this.getAttributes=function(){return void 0===E&&(E=function(e,t){const n={},r=e.getProgramParameter(t,35721);for(let i=0;i0,maxBones:w,useVertexTexture:c,morphTargets:i.morphTargets,morphNormals:i.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:i.dithering,shadowMapEnabled:e.shadowMap.enabled&&f.length>0,shadowMapType:e.shadowMap.type,toneMapping:i.toneMapped?e.toneMapping:0,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:i.premultipliedAlpha,alphaTest:i.alphaTest,doubleSided:2===i.side,flipSided:1===i.side,depthPacking:void 0!==i.depthPacking&&i.depthPacking,index0AttributeName:i.index0AttributeName,extensionDerivatives:i.extensions&&i.extensions.derivatives,extensionFragDepth:i.extensions&&i.extensions.fragDepth,extensionDrawBuffers:i.extensions&&i.extensions.drawBuffers,extensionShaderTextureLOD:i.extensions&&i.extensions.shaderTextureLOD,rendererExtensionFragDepth:s||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:s||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:s||n.has("EXT_shader_texture_lod"),customProgramCacheKey:i.customProgramCacheKey()}},getProgramCacheKey:function(t){const n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(const e in t.defines)n.push(e),n.push(t.defines[e]);if(!1===t.isRawShaderMaterial){for(let e=0;e1&&r.sort(e||Zi),i.length>1&&i.sort(t||Ki)}}}function qi(e){let t=new WeakMap;return{get:function(n,r){const i=t.get(n);let a;return void 0===i?(a=new Xi(e),t.set(n,new WeakMap),t.get(n).set(r,a)):(a=i.get(r),void 0===a&&(a=new Xi(e),i.set(r,a))),a},dispose:function(){t=new WeakMap}}}function $i(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new Fe,color:new tn};break;case"SpotLight":n={position:new Fe,direction:new Fe,color:new tn,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Fe,color:new tn,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Fe,skyColor:new tn,groundColor:new tn};break;case"RectAreaLight":n={color:new tn,position:new Fe,halfWidth:new Fe,halfHeight:new Fe}}return e[t.id]=n,n}}}let ea=0;function ta(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function na(e,t){const n=new $i,r=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ee};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ee,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let e=0;e<9;e++)i.probe.push(new Fe);const a=new Fe,o=new lt,s=new lt;return{setup:function(a){let o=0,s=0,l=0;for(let e=0;e<9;e++)i.probe[e].set(0,0,0);let c=0,u=0,d=0,p=0,h=0,f=0,m=0,g=0;a.sort(ta);for(let e=0,t=a.length;e0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=fr.LTC_FLOAT_1,i.rectAreaLTC2=fr.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=fr.LTC_HALF_1,i.rectAreaLTC2=fr.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=o,i.ambient[1]=s,i.ambient[2]=l;const A=i.hash;A.directionalLength===c&&A.pointLength===u&&A.spotLength===d&&A.rectAreaLength===p&&A.hemiLength===h&&A.numDirectionalShadows===f&&A.numPointShadows===m&&A.numSpotShadows===g||(i.directional.length=c,i.spot.length=d,i.rectArea.length=p,i.point.length=u,i.hemi.length=h,i.directionalShadow.length=f,i.directionalShadowMap.length=f,i.pointShadow.length=m,i.pointShadowMap.length=m,i.spotShadow.length=g,i.spotShadowMap.length=g,i.directionalShadowMatrix.length=f,i.pointShadowMatrix.length=m,i.spotShadowMatrix.length=g,A.directionalLength=c,A.pointLength=u,A.spotLength=d,A.rectAreaLength=p,A.hemiLength=h,A.numDirectionalShadows=f,A.numPointShadows=m,A.numSpotShadows=g,i.version=ea++)},setupView:function(e,t){let n=0,r=0,l=0,c=0,u=0;const d=t.matrixWorldInverse;for(let t=0,p=e.length;t=n.get(r).length?(a=new ra(e,t),n.get(r).push(a)):a=n.get(r)[i],a},dispose:function(){n=new WeakMap}}}function aa(e){an.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}function oa(e){an.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Fe,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}aa.prototype=Object.create(an.prototype),aa.prototype.constructor=aa,aa.prototype.isMeshDepthMaterial=!0,aa.prototype.copy=function(e){return an.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},oa.prototype=Object.create(an.prototype),oa.prototype.constructor=oa,oa.prototype.isMeshDistanceMaterial=!0,oa.prototype.copy=function(e){return an.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this};function sa(e,t,n){let r=new cr;const i=new Ee,a=new Ee,o=new Ie,s=[],l=[],c={},u={0:1,1:0,2:2},d=new er({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ee},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),p=d.clone();p.defines.HORIZONTAL_PASS=1;const h=new In;h.setAttribute("position",new cn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const f=new Jn(h,d),m=this;function g(n,r){const i=t.update(f);d.uniforms.shadow_pass.value=n.map.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,i,d,f,null),p.uniforms.shadow_pass.value=n.mapPass.texture,p.uniforms.resolution.value=n.mapSize,p.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,i,p,f,null)}function A(e,t,n){const r=e<<0|t<<1|n<<2;let i=s[r];return void 0===i&&(i=new aa({depthPacking:3201,morphTargets:e,skinning:t}),s[r]=i),i}function v(e,t,n){const r=e<<0|t<<1|n<<2;let i=l[r];return void 0===i&&(i=new oa({morphTargets:e,skinning:t}),l[r]=i),i}function y(t,n,r,i,a,o,s){let l=null,d=A,p=t.customDepthMaterial;if(!0===i.isPointLight&&(d=v,p=t.customDistanceMaterial),void 0===p){let e=!1;!0===r.morphTargets&&(e=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);let i=!1;!0===t.isSkinnedMesh&&(!0===r.skinning?i=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t));l=d(e,i,!0===t.isInstancedMesh)}else l=p;if(e.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length){const e=l.uuid,t=r.uuid;let n=c[e];void 0===n&&(n={},c[e]=n);let i=n[t];void 0===i&&(i=l.clone(),n[t]=i),l=i}return l.visible=r.visible,l.wireframe=r.wireframe,l.side=3===s?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:u[r.side],l.clipShadows=r.clipShadows,l.clippingPlanes=r.clippingPlanes,l.clipIntersection=r.clipIntersection,l.wireframeLinewidth=r.wireframeLinewidth,l.linewidth=r.linewidth,!0===i.isPointLight&&!0===l.isMeshDistanceMaterial&&(l.referencePosition.setFromMatrixPosition(i.matrixWorld),l.nearDistance=a,l.farDistance=o),l}function b(n,i,a,o,s){if(!1===n.visible)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===s)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);const r=t.update(n),i=n.material;if(Array.isArray(i)){const t=r.groups;for(let l=0,c=t.length;ln||i.y>n)&&(i.x>n&&(a.x=Math.floor(n/h.x),i.x=a.x*h.x,d.mapSize.x=a.x),i.y>n&&(a.y=Math.floor(n/h.y),i.y=a.y*h.y,d.mapSize.y=a.y)),null===d.map&&!d.isPointLightShadow&&3===this.type){const e={minFilter:1006,magFilter:1006,format:1023};d.map=new ke(i.x,i.y,e),d.map.texture.name=u.name+".shadowMap",d.mapPass=new ke(i.x,i.y,e),d.camera.updateProjectionMatrix()}if(null===d.map){const e={minFilter:1003,magFilter:1003,format:1023};d.map=new ke(i.x,i.y,e),d.map.texture.name=u.name+".shadowMap",d.camera.updateProjectionMatrix()}e.setRenderTarget(d.map),e.clear();const f=d.getViewportCount();for(let e=0;e=1):-1!==T.indexOf("OpenGL ES")&&(M=parseFloat(/^OpenGL ES (\d)/.exec(T)[1]),S=M>=2);let B=null,R={};const C=new Ie,I=new Ie;function k(t,n,r){const i=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(let t=0;tr||e.height>r)&&(i=r/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const r=t?we.floorPowerOfTwo:Math.floor,a=r(i*e.width),o=r(i*e.height);void 0===h&&(h=m(a,o));const s=n?m(a,o):h;s.width=a,s.height=o;return s.getContext("2d").drawImage(e,0,0,a,o),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+a+"x"+o+")."),s}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function A(e){return we.isPowerOfTwo(e.width)&&we.isPowerOfTwo(e.height)}function v(e,t){return e.generateMipmaps&&t&&1003!==e.minFilter&&1006!==e.minFilter}function y(t,n,i,a){e.generateMipmap(t);r.get(n).__maxMipLevel=Math.log(Math.max(i,a))*Math.LOG2E}function b(n,r,i){if(!1===s)return r;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let a=r;return 6403===r&&(5126===i&&(a=33326),5131===i&&(a=33325),5121===i&&(a=33321)),6407===r&&(5126===i&&(a=34837),5131===i&&(a=34843),5121===i&&(a=32849)),6408===r&&(5126===i&&(a=34836),5131===i&&(a=34842),5121===i&&(a=32856)),33325!==a&&33326!==a&&34842!==a&&34836!==a||t.get("EXT_color_buffer_float"),a}function x(e){return 1003===e||1004===e||1005===e?9728:9729}function w(t){const n=t.target;n.removeEventListener("dispose",w),function(t){const n=r.get(t);if(void 0===n.__webglInit)return;e.deleteTexture(n.__webglTexture),r.remove(t)}(n),n.isVideoTexture&&p.delete(n),o.memory.textures--}function E(t){const n=t.target;n.removeEventListener("dispose",E),function(t){const n=r.get(t),i=r.get(t.texture);if(!t)return;void 0!==i.__webglTexture&&e.deleteTexture(i.__webglTexture);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++)e.deleteFramebuffer(n.__webglFramebuffer[t]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[t]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&e.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer);r.remove(t.texture),r.remove(t)}(n),o.memory.textures--}let S=0;function M(e,t){const i=r.get(e);if(e.isVideoTexture&&function(e){const t=o.render.frame;p.get(e)!==t&&(p.set(e,t),e.update())}(e),e.version>0&&i.__version!==e.version){const n=e.image;if(void 0===n)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==n.complete)return void k(i,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+t),n.bindTexture(3553,i.__webglTexture)}function T(t,i){const o=r.get(t);t.version>0&&o.__version!==t.version?function(t,r,i){if(6!==r.image.length)return;I(t,r),n.activeTexture(33984+i),n.bindTexture(34067,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment);const o=r&&(r.isCompressedTexture||r.image[0].isCompressedTexture),l=r.image[0]&&r.image[0].isDataTexture,u=[];for(let e=0;e<6;e++)u[e]=o||l?l?r.image[e].image:r.image[e]:g(r.image[e],!1,!0,c);const d=u[0],p=A(d)||s,h=a.convert(r.format),f=a.convert(r.type),m=b(r.internalFormat,h,f);let x;if(C(34067,r,p),o){for(let e=0;e<6;e++){x=u[e].mipmaps;for(let t=0;t1||r.get(a).__currentAnisotropy)&&(e.texParameterf(n,l.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy)}}function I(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",w),t.__webglTexture=e.createTexture(),o.memory.textures++)}function k(t,r,i){let o=3553;r.isDataTexture2DArray&&(o=35866),r.isDataTexture3D&&(o=32879),I(t,r),n.activeTexture(33984+i),n.bindTexture(o,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment);const l=function(e){return!s&&(1001!==e.wrapS||1001!==e.wrapT||1003!==e.minFilter&&1006!==e.minFilter)}(r)&&!1===A(r.image),c=g(r.image,l,!1,u),d=A(c)||s,p=a.convert(r.format);let h,f=a.convert(r.type),m=b(r.internalFormat,p,f);C(o,r,d);const x=r.mipmaps;if(r.isDepthTexture)m=6402,s?m=1015===r.type?36012:1014===r.type?33190:1020===r.type?35056:33189:1015===r.type&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),1026===r.format&&6402===m&&1012!==r.type&&1014!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=1012,f=a.convert(r.type)),1027===r.format&&6402===m&&(m=34041,1020!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=1020,f=a.convert(r.type))),n.texImage2D(3553,0,m,c.width,c.height,0,p,f,null);else if(r.isDataTexture)if(x.length>0&&d){for(let e=0,t=x.length;e0&&d){for(let e=0,t=x.length;e=l&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+l),S+=1,e},this.resetTextureUnits=function(){S=0},this.setTexture2D=M,this.setTexture2DArray=function(e,t){const i=r.get(e);e.version>0&&i.__version!==e.version?k(i,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(e,t){const i=r.get(e);e.version>0&&i.__version!==e.version?k(i,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=T,this.setupRenderTarget=function(t){const i=r.get(t),l=r.get(t.texture);t.addEventListener("dispose",E),l.__webglTexture=e.createTexture(),o.memory.textures++;const c=!0===t.isWebGLCubeRenderTarget,u=!0===t.isWebGLMultisampleRenderTarget,d=A(t)||s;if(!s||1022!==t.texture.format||1015!==t.texture.type&&1016!==t.texture.type||(t.texture.format=1023,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),c){i.__webglFramebuffer=[];for(let t=0;t<6;t++)i.__webglFramebuffer[t]=e.createFramebuffer()}else if(i.__webglFramebuffer=e.createFramebuffer(),u)if(s){i.__webglMultisampledFramebuffer=e.createFramebuffer(),i.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,i.__webglColorRenderbuffer);const n=a.convert(t.texture.format),r=a.convert(t.texture.type),o=b(t.texture.internalFormat,n,r),s=_(t);e.renderbufferStorageMultisample(36161,s,o,t.width,t.height),e.bindFramebuffer(36160,i.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,i.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(i.__webglDepthRenderbuffer=e.createRenderbuffer(),D(i.__webglDepthRenderbuffer,t,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(c){n.bindTexture(34067,l.__webglTexture),C(34067,t.texture,d);for(let e=0;e<6;e++)P(i.__webglFramebuffer[e],t,36064,34069+e);v(t.texture,d)&&y(34067,t.texture,t.width,t.height),n.bindTexture(34067,null)}else n.bindTexture(3553,l.__webglTexture),C(3553,t.texture,d),P(i.__webglFramebuffer,t,36064,3553),v(t.texture,d)&&y(3553,t.texture,t.width,t.height),n.bindTexture(3553,null);t.depthBuffer&&F(t)},this.updateRenderTargetMipmap=function(e){const t=e.texture;if(v(t,A(e)||s)){const i=e.isWebGLCubeRenderTarget?34067:3553,a=r.get(t).__webglTexture;n.bindTexture(i,a),y(i,t,e.width,e.height),n.bindTexture(i,null)}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(s){const n=r.get(t);e.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,n.__webglFramebuffer);const i=t.width,a=t.height;let o=16384;t.depthBuffer&&(o|=256),t.stencilBuffer&&(o|=1024),e.blitFramebuffer(0,0,i,a,0,0,i,a,o,9728),e.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===U&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),U=!0),e=e.texture),M(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===L&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),L=!0),e=e.texture),T(e,t)}}function ua(e,t,n){const r=n.isWebGL2;return{convert:function(e){let n;if(1009===e)return 5121;if(1017===e)return 32819;if(1018===e)return 32820;if(1019===e)return 33635;if(1010===e)return 5120;if(1011===e)return 5122;if(1012===e)return 5123;if(1013===e)return 5124;if(1014===e)return 5125;if(1015===e)return 5126;if(1016===e)return r?5131:(n=t.get("OES_texture_half_float"),null!==n?n.HALF_FLOAT_OES:null);if(1021===e)return 6406;if(1022===e)return 6407;if(1023===e)return 6408;if(1024===e)return 6409;if(1025===e)return 6410;if(1026===e)return 6402;if(1027===e)return 34041;if(1028===e)return 6403;if(1029===e)return 36244;if(1030===e)return 33319;if(1031===e)return 33320;if(1032===e)return 36248;if(1033===e)return 36249;if(33776===e||33777===e||33778===e||33779===e){if(n=t.get("WEBGL_compressed_texture_s3tc"),null===n)return null;if(33776===e)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===e)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===e)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===e)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===e||35841===e||35842===e||35843===e){if(n=t.get("WEBGL_compressed_texture_pvrtc"),null===n)return null;if(35840===e)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===e)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===e)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===e)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===e)return n=t.get("WEBGL_compressed_texture_etc1"),null!==n?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((37492===e||37496===e)&&(n=t.get("WEBGL_compressed_texture_etc"),null!==n)){if(37492===e)return n.COMPRESSED_RGB8_ETC2;if(37496===e)return n.COMPRESSED_RGBA8_ETC2_EAC}return 37808===e||37809===e||37810===e||37811===e||37812===e||37813===e||37814===e||37815===e||37816===e||37817===e||37818===e||37819===e||37820===e||37821===e||37840===e||37841===e||37842===e||37843===e||37844===e||37845===e||37846===e||37847===e||37848===e||37849===e||37850===e||37851===e||37852===e||37853===e?(n=t.get("WEBGL_compressed_texture_astc"),null!==n?e:null):36492===e?(n=t.get("EXT_texture_compression_bptc"),null!==n?e:null):1020===e?r?34042:(n=t.get("WEBGL_depth_texture"),null!==n?n.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}function da(e=[]){nr.call(this),this.cameras=e}function pa(){Dt.call(this),this.type="Group"}function ha(){this._targetRay=null,this._grip=null,this._hand=null}function fa(e,t){const n=this;let r=null,i=1,a=null,o="local-floor",s=null;const l=[],c=new Map,u=new nr;u.layers.enable(1),u.viewport=new Ie;const d=new nr;d.layers.enable(2),d.viewport=new Ie;const p=[u,d],h=new da;h.layers.enable(1),h.layers.enable(2);let f=null,m=null;function g(e){const t=c.get(e.inputSource);t&&t.dispatchEvent({type:e.type,data:e.inputSource})}function A(){c.forEach((function(e,t){e.disconnect(t)})),c.clear(),f=null,m=null,e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),E.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function v(e){const t=r.inputSources;for(let e=0;e0&&be(a,e,t),o.length>0&&be(o,e,t),!0===e.isScene&&e.onAfterRender(f,e,t),null!==y&&(W.updateRenderTargetMipmap(y),W.updateMultisampleRenderTarget(y)),Q.buffers.depth.setTest(!0),Q.buffers.depth.setMask(!0),Q.buffers.color.setMask(!0),Q.setPolygonOffset(!1),h.pop(),p=h.length>0?h[h.length-1]:null,d=null},this.setFramebuffer=function(e){g!==e&&null===y&&le.bindFramebuffer(36160,e),g=e},this.getActiveCubeFace=function(){return A},this.getActiveMipmapLevel=function(){return v},this.getRenderList=function(){return d},this.setRenderList=function(e){d=e},this.getRenderTarget=function(){return y},this.setRenderTarget=function(e,t=0,n=0){y=e,A=t,v=n,e&&void 0===G.get(e).__webglFramebuffer&&W.setupRenderTarget(e);let r=g,i=!1;if(e){const n=G.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=n[t],i=!0):r=e.isWebGLMultisampleRenderTarget?G.get(e).__webglMultisampledFramebuffer:n,E.copy(e.viewport),S.copy(e.scissor),M=e.scissorTest}else E.copy(k).multiplyScalar(R).floor(),S.copy(P).multiplyScalar(R).floor(),M=D;if(b!==r&&(le.bindFramebuffer(36160,r),b=r),Q.viewport(E),Q.scissor(S),Q.setScissorTest(M),i){const r=G.get(e.texture);le.framebufferTexture2D(36160,36064,34069+t,r.__webglTexture,n)}},this.readRenderTargetPixels=function(e,t,n,r,i,a,o){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let s=G.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){let o=!1;s!==b&&(le.bindFramebuffer(36160,s),o=!0);try{const s=e.texture,l=s.format,c=s.type;if(1023!==l&&oe.convert(l)!==le.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const u=1016===c&&(H.has("EXT_color_buffer_half_float")||z.isWebGL2&&H.has("EXT_color_buffer_float"));if(!(1009===c||oe.convert(c)===le.getParameter(35738)||1015===c&&(z.isWebGL2||H.has("OES_texture_float")||H.has("WEBGL_color_buffer_float"))||u))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===le.checkFramebufferStatus(36160)?t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&le.readPixels(t,n,r,i,oe.convert(l),oe.convert(c),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{o&&le.bindFramebuffer(36160,b)}}},this.copyFramebufferToTexture=function(e,t,n=0){const r=Math.pow(2,-n),i=Math.floor(t.image.width*r),a=Math.floor(t.image.height*r),o=oe.convert(t.format);W.setTexture2D(t,0),le.copyTexImage2D(3553,n,o,e.x,e.y,i,a,0),Q.unbindTexture()},this.copyTextureToTexture=function(e,t,n,r=0){const i=t.image.width,a=t.image.height,o=oe.convert(n.format),s=oe.convert(n.type);W.setTexture2D(n,0),le.pixelStorei(37440,n.flipY),le.pixelStorei(37441,n.premultiplyAlpha),le.pixelStorei(3317,n.unpackAlignment),t.isDataTexture?le.texSubImage2D(3553,r,e.x,e.y,i,a,o,s,t.image.data):t.isCompressedTexture?le.compressedTexSubImage2D(3553,r,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,o,t.mipmaps[0].data):le.texSubImage2D(3553,r,e.x,e.y,o,s,t.image),0===r&&n.generateMipmaps&&le.generateMipmap(3553),Q.unbindTexture()},this.initTexture=function(e){W.setTexture2D(e,0),Q.unbindTexture()},this.resetState=function(){Q.reset(),se.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function Aa(e){ga.call(this,e)}da.prototype=Object.assign(Object.create(nr.prototype),{constructor:da,isArrayCamera:!0}),pa.prototype=Object.assign(Object.create(Dt.prototype),{constructor:pa,isGroup:!0}),Object.assign(ha.prototype,{constructor:ha,getHandSpace:function(){return null===this._hand&&(this._hand=new pa,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new pa,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new pa,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this},disconnect:function(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this},update:function(e,t,n){let r=null,i=null,a=null;const o=this._targetRay,s=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState)if(l&&e.hand){a=!0;for(const r of e.hand.values()){const e=t.getJointPose(r,n);if(void 0===l.joints[r.jointName]){const e=new pa;e.matrixAutoUpdate=!1,e.visible=!1,l.joints[r.jointName]=e,l.add(e)}const i=l.joints[r.jointName];null!==e&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.jointRadius=e.radius),i.visible=null!==e}const r=l.joints["index-finger-tip"],i=l.joints["thumb-tip"],o=r.position.distanceTo(i.position),s=.02,c=.005;l.inputState.pinching&&o>s+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&o<=s-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&(r=t.getPose(e.targetRaySpace,n),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale))),null!==s&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),null!==i&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale)));return null!==o&&(o.visible=null!==r),null!==s&&(s.visible=null!==i),null!==l&&(l.visible=null!==a),this}}),Object.assign(fa.prototype,ye.prototype),Aa.prototype=Object.assign(Object.create(ga.prototype),{constructor:Aa,isWebGL1Renderer:!0});class va{constructor(e,t){Object.defineProperty(this,"isFogExp2",{value:!0}),this.name="",this.color=new tn(e),this.density=void 0!==t?t:25e-5}clone(){return new va(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class ya extends Dt{constructor(){super(),Object.defineProperty(this,"isScene",{value:!0}),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.environment&&(t.object.environment=this.environment.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}function ba(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=we.generateUUID()}Object.defineProperty(ba.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(ba.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;re.far||t.push({distance:s,point:Ma.clone(),uv:Jt.getUV(Ma,ka,Pa,Da,Fa,_a,Ua,new Ee),face:null,object:this})},copy:function(e){return Dt.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}});const Na=new Fe,Oa=new Fe;function Ha(){Dt.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}Ha.prototype=Object.assign(Object.create(Dt.prototype),{constructor:Ha,isLOD:!0,copy:function(e){Dt.prototype.copy.call(this,e,!1);const t=e.levels;for(let e=0,n=t.length;e0){let n,r;for(n=1,r=t.length;n0){Na.setFromMatrixPosition(this.matrixWorld);const n=e.ray.origin.distanceTo(Na);this.getObjectForDistance(n).raycast(e,t)}},update:function(e){const t=this.levels;if(t.length>1){Na.setFromMatrixPosition(e.matrixWorld),Oa.setFromMatrixPosition(this.matrixWorld);const n=Na.distanceTo(Oa)/e.zoom;let r,i;for(t[0].object.visible=!0,r=1,i=t.length;r=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(this._currentLevel=r-1;ro)continue;u.applyMatrix4(this.matrixWorld);const p=e.ray.origin.distanceTo(u);pe.far||t.push({distance:p,point:c.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}}else for(let n=0,r=i.count-1;no)continue;u.applyMatrix4(this.matrixWorld);const r=e.ray.origin.distanceTo(u);re.far||t.push({distance:r,point:c.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")},updateMorphTargets:function(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}});const uo=new Fe,po=new Fe;function ho(e,t){co.call(this,e,t),this.type="LineSegments"}function fo(e,t){co.call(this,e,t),this.type="LineLoop"}function mo(e){an.call(this),this.type="PointsMaterial",this.color=new tn(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}ho.prototype=Object.assign(Object.create(co.prototype),{constructor:ho,isLineSegments:!0,computeLineDistances:function(){const e=this.geometry;if(e.isBufferGeometry)if(null===e.index){const t=e.attributes.position,n=[];for(let e=0,r=t.count;ei.far)return;a.push({distance:l,distanceToRay:Math.sqrt(s),point:n,index:t,face:null,object:o})}}function wo(e,t,n,r,i,a,o,s,l){Re.call(this,e,t,n,r,i,a,o,s,l),this.format=void 0!==o?o:1022,this.minFilter=void 0!==a?a:1006,this.magFilter=void 0!==i?i:1006,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){c.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}function Eo(e,t,n,r,i,a,o,s,l,c,u,d){Re.call(this,null,a,o,s,l,c,r,i,u,d),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function So(e,t,n,r,i,a,o,s,l){Re.call(this,e,t,n,r,i,a,o,s,l),this.needsUpdate=!0}function Mo(e,t,n,r,i,a,o,s,l,c){if(1026!==(c=void 0!==c?c:1026)&&1027!==c)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&1026===c&&(n=1012),void 0===n&&1027===c&&(n=1020),Re.call(this,null,r,i,a,o,s,c,n,l),this.image={width:e,height:t},this.magFilter=void 0!==o?o:1003,this.minFilter=void 0!==s?s:1003,this.flipY=!1,this.generateMipmaps=!1}bo.prototype=Object.assign(Object.create(Dt.prototype),{constructor:bo,isPoints:!0,copy:function(e){return Dt.prototype.copy.call(this,e),this.material=e.material,this.geometry=e.geometry,this},raycast:function(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),vo.copy(n.boundingSphere),vo.applyMatrix4(r),vo.radius+=i,!1===e.ray.intersectsSphere(vo))return;go.copy(r).invert(),Ao.copy(e.ray).applyMatrix4(go);const a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a;if(n.isBufferGeometry){const i=n.index,a=n.attributes.position;if(null!==i){const n=i.array;for(let i=0,s=n.length;i0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}),wo.prototype=Object.assign(Object.create(Re.prototype),{constructor:wo,clone:function(){return new this.constructor(this.image).copy(this)},isVideoTexture:!0,update:function(){const e=this.image;!1==="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Eo.prototype=Object.create(Re.prototype),Eo.prototype.constructor=Eo,Eo.prototype.isCompressedTexture=!0,So.prototype=Object.create(Re.prototype),So.prototype.constructor=So,So.prototype.isCanvasTexture=!0,Mo.prototype=Object.create(Re.prototype),Mo.prototype.constructor=Mo,Mo.prototype.isDepthTexture=!0;new Fe,new Fe,new Fe,new Jt;const To=function(e,t,n){n=n||2;const r=t&&t.length,i=r?t[0]*n:e.length;let a=Bo(e,0,i,n,!0);const o=[];if(!a||a.next===a.prev)return o;let s,l,c,u,d,p,h;if(r&&(a=function(e,t,n,r){const i=[];let a,o,s,l,c;for(a=0,o=t.length;a80*n){s=c=e[0],l=u=e[1];for(let t=n;tc&&(c=d),p>u&&(u=p);h=Math.max(c-s,u-l),h=0!==h?1/h:0}return Co(a,o,n,s,l,h),o};function Bo(e,t,n,r,i){let a,o;if(i===function(e,t,n,r){let i=0;for(let a=t,o=n-r;a0)for(a=t;a=t;a-=r)o=Jo(a,e[a],e[a+1],o);return o&&zo(o,o.next)&&(Zo(o),o=o.next),o}function Ro(e,t){if(!e)return e;t||(t=e);let n,r=e;do{if(n=!1,r.steiner||!zo(r,r.next)&&0!==Ho(r.prev,r,r.next))r=r.next;else{if(Zo(r),r=t=r.prev,r===r.next)break;n=!0}}while(n||r!==t);return t}function Co(e,t,n,r,i,a,o){if(!e)return;!o&&a&&function(e,t,n,r){let i=e;do{null===i.z&&(i.z=Lo(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,n,r,i,a,o,s,l,c=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t0||l>0&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,c*=2}while(o>1)}(i)}(e,r,i,a);let s,l,c=e;for(;e.prev!==e.next;)if(s=e.prev,l=e.next,a?ko(e,r,i,a):Io(e))t.push(s.i/n),t.push(e.i/n),t.push(l.i/n),Zo(e),e=l.next,c=l.next;else if((e=l)===c){o?1===o?Co(e=Po(Ro(e),t,n),t,n,r,i,a,2):2===o&&Do(e,t,n,r,i,a):Co(Ro(e),t,n,r,i,a,1);break}}function Io(e){const t=e.prev,n=e,r=e.next;if(Ho(t,n,r)>=0)return!1;let i=e.next.next;for(;i!==e.prev;){if(No(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Ho(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function ko(e,t,n,r){const i=e.prev,a=e,o=e.next;if(Ho(i,a,o)>=0)return!1;const s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,d=Lo(s,l,t,n,r),p=Lo(c,u,t,n,r);let h=e.prevZ,f=e.nextZ;for(;h&&h.z>=d&&f&&f.z<=p;){if(h!==e.prev&&h!==e.next&&No(i.x,i.y,a.x,a.y,o.x,o.y,h.x,h.y)&&Ho(h.prev,h,h.next)>=0)return!1;if(h=h.prevZ,f!==e.prev&&f!==e.next&&No(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Ho(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;h&&h.z>=d;){if(h!==e.prev&&h!==e.next&&No(i.x,i.y,a.x,a.y,o.x,o.y,h.x,h.y)&&Ho(h.prev,h,h.next)>=0)return!1;h=h.prevZ}for(;f&&f.z<=p;){if(f!==e.prev&&f!==e.next&&No(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Ho(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Po(e,t,n){let r=e;do{const i=r.prev,a=r.next.next;!zo(i,a)&&Qo(i,r,r.next,a)&&Wo(i,a)&&Wo(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),Zo(r),Zo(r.next),r=e=a),r=r.next}while(r!==e);return Ro(r)}function Do(e,t,n,r,i,a){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&Oo(o,e)){let s=Yo(o,e);return o=Ro(o,o.next),s=Ro(s,s.next),Co(o,t,n,r,i,a),void Co(s,t,n,r,i,a)}e=e.next}o=o.next}while(o!==e)}function Fo(e,t){return e.x-t.x}function _o(e,t){if(t=function(e,t){let n=t;const r=e.x,i=e.y;let a,o=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){const e=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>o){if(o=e,e===r){if(i===n.y)return n;if(i===n.next.y)return n.next}a=n.x=n.x&&n.x>=l&&r!==n.x&&No(ia.x||n.x===a.x&&Uo(a,n)))&&(a=n,d=u)),n=n.next}while(n!==s);return a}(e,t)){const n=Yo(t,e);Ro(t,t.next),Ro(n,n.next)}}function Uo(e,t){return Ho(e.prev,e,t.prev)<0&&Ho(t.next,e,e.next)<0}function Lo(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Vo(e){let t=e,n=e;do{(t.x=0&&(e-o)*(r-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(i-o)*(r-s)>=0}function Oo(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Qo(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(Wo(e,t)&&Wo(t,e)&&function(e,t){let n=e,r=!1;const i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(Ho(e.prev,e,t.prev)||Ho(e,t.prev,t))||zo(e,t)&&Ho(e.prev,e,e.next)>0&&Ho(t.prev,t,t.next)>0)}function Ho(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function zo(e,t){return e.x===t.x&&e.y===t.y}function Qo(e,t,n,r){const i=Go(Ho(e,t,n)),a=Go(Ho(e,t,r)),o=Go(Ho(n,r,e)),s=Go(Ho(n,r,t));return i!==a&&o!==s||(!(0!==i||!jo(e,n,t))||(!(0!==a||!jo(e,r,t))||(!(0!==o||!jo(n,e,r))||!(0!==s||!jo(n,t,r)))))}function jo(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Go(e){return e>0?1:e<0?-1:0}function Wo(e,t){return Ho(e.prev,e,e.next)<0?Ho(e,t,e.next)>=0&&Ho(e,e.prev,t)>=0:Ho(e,t,e.prev)<0||Ho(e,e.next,t)<0}function Yo(e,t){const n=new Ko(e.i,e.x,e.y),r=new Ko(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function Jo(e,t,n,r){const i=new Ko(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Zo(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Ko(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}const Xo={area:function(e){const t=e.length;let n=0;for(let r=t-1,i=0;i2&&e[t-1].equals(e[0])&&e.pop()}function $o(e,t){for(let n=0;nNumber.EPSILON){const d=Math.sqrt(u),p=Math.sqrt(l*l+c*c),h=t.x-s/d,f=t.y+o/d,m=((n.x-c/p-h)*c-(n.y+l/p-f)*l)/(o*c-s*l);r=h+o*m-e.x,i=f+s*m-e.y;const g=r*r+i*i;if(g<=2)return new Ee(r,i);a=Math.sqrt(g/2)}else{let e=!1;o>Number.EPSILON?l>Number.EPSILON&&(e=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(s)===Math.sign(c)&&(e=!0),e?(r=-s,i=o,a=Math.sqrt(u)):(r=o,i=s,a=Math.sqrt(u/2))}return new Ee(r/a,i/a)}const k=[];for(let e=0,t=T.length,n=t-1,r=e+1;e=0;e--){const t=e/h,n=u*Math.cos(t*Math.PI/2),r=d*Math.sin(t*Math.PI/2)+p;for(let e=0,t=T.length;e=0;){const r=n;let i=n-1;i<0&&(i=e.length-1);for(let e=0,n=s+2*h;e=0?(e(r-s,h,u),d.subVectors(c,u)):(e(r+s,h,u),d.subVectors(u,c)),h-s>=0?(e(r,h-s,u),p.subVectors(c,u)):(e(r,h+s,u),p.subVectors(u,c)),l.crossVectors(d,p).normalize(),a.push(l.x,l.y,l.z),o.push(r,h)}}for(let e=0;e=r)){l.push(t.times[e]);for(let n=0;na.tracks[e].times[0]&&(s=a.tracks[e].times[0]);for(let e=0;e=r.times[d]){const e=d*l+s,t=e+l-s;p=ms.arraySlice(r.values,e,t)}else{const e=r.createInterpolant(),t=s,n=l-s;e.evaluate(a),p=ms.arraySlice(e.resultBuffer,t,n)}if("quaternion"===i){(new De).fromArray(p).normalize().conjugate().toArray(p)}const h=o.times.length;for(let e=0;e=i)break e;{const o=t[1];e=i)break t}a=n,n=0}}for(;n>>1;et;)--a;if(++a,0!==i||a!==r){i>=a&&(a=Math.max(a,1),i=a-1);const e=this.getValueSize();this.times=ms.arraySlice(n,i,a),this.values=ms.arraySlice(this.values,i*e,a*e)}return this},validate:function(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let t=0;t!==i;t++){const r=n[t];if("number"==typeof r&&isNaN(r)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,t,r),e=!1;break}if(null!==a&&a>r){console.error("THREE.KeyframeTrack: Out of order keys.",this,t,r,a),e=!1;break}a=r}if(void 0!==r&&ms.isTypedArray(r))for(let t=0,n=r.length;t!==n;++t){const n=r[t];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,t,n),e=!1;break}}return e},optimize:function(){const e=ms.arraySlice(this.times),t=ms.arraySlice(this.values),n=this.getValueSize(),r=2302===this.getInterpolation(),i=e.length-1;let a=1;for(let o=1;o0){e[a]=e[i];for(let e=i*n,r=a*n,o=0;o!==n;++o)t[r+o]=t[e+o];++a}return a!==e.length?(this.times=ms.arraySlice(e,0,a),this.values=ms.arraySlice(t,0,a*n)):(this.times=e,this.values=t),this},clone:function(){const e=ms.arraySlice(this.times,0),t=ms.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}),xs.prototype=Object.assign(Object.create(bs.prototype),{constructor:xs,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),ws.prototype=Object.assign(Object.create(bs.prototype),{constructor:ws,ValueTypeName:"color"}),Es.prototype=Object.assign(Object.create(bs.prototype),{constructor:Es,ValueTypeName:"number"}),Ss.prototype=Object.assign(Object.create(gs.prototype),{constructor:Ss,interpolate_:function(e,t,n,r){const i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(n-t)/(r-t);let l=e*o;for(let e=l+o;l!==e;l+=4)De.slerpFlat(i,0,a,l-o,a,l,s);return i}}),Ms.prototype=Object.assign(Object.create(bs.prototype),{constructor:Ms,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(e){return new Ss(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),Ts.prototype=Object.assign(Object.create(bs.prototype),{constructor:Ts,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Bs.prototype=Object.assign(Object.create(bs.prototype),{constructor:Bs,ValueTypeName:"vector"}),Object.assign(Rs,{parse:function(e){const t=[],n=e.tracks,r=1/(e.fps||1);for(let e=0,i=n.length;e!==i;++e)t.push(Cs(n[e]).scale(r));const i=new Rs(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i},toJSON:function(e){const t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,r=n.length;e!==r;++e)t.push(bs.toJSON(n[e]));return r},CreateFromMorphTargetSequence:function(e,t,n,r){const i=t.length,a=[];for(let e=0;e1){const e=a[1];let t=r[e];t||(r[e]=t=[]),t.push(n)}}const a=[];for(const e in r)a.push(Rs.CreateFromMorphTargetSequence(e,r[e],t,n));return a},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(e,t,n,r,i){if(0!==n.length){const a=[],o=[];ms.flattenJSON(n,a,o,r),0!==a.length&&i.push(new e(t,a,o))}},r=[],i=e.name||"default",a=e.fps||30,o=e.blendMode;let s=e.length||-1;const l=e.hierarchy||[];for(let e=0;e0||0===e.search(/^data\:image\/jpeg/);i.format=r?1022:1023,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i}}),Object.assign(zs.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){const e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,r=this.getPoint(0),i=0;t.push(0);for(let a=1;a<=e;a++)n=this.getPoint(a/e),i+=n.distanceTo(r),t.push(i),r=n;return this.cacheArcLengths=t,t},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){const n=this.getLengths();let r=0;const i=n.length;let a;a=t||e*n[i-1];let o,s=0,l=i-1;for(;s<=l;)if(r=Math.floor(s+(l-s)/2),o=n[r]-a,o<0)s=r+1;else{if(!(o>0)){l=r;break}l=r-1}if(r=l,n[r]===a)return r/(i-1);const c=n[r];return(r+(a-c)/(n[r+1]-c))/(i-1)},getTangent:function(e,t){let n=e-1e-4,r=e+1e-4;n<0&&(n=0),r>1&&(r=1);const i=this.getPoint(n),a=this.getPoint(r),o=t||(i.isVector2?new Ee:new Fe);return o.copy(a).sub(i).normalize(),o},getTangentAt:function(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)},computeFrenetFrames:function(e,t){const n=new Fe,r=[],i=[],a=[],o=new Fe,s=new lt;for(let t=0;t<=e;t++){const n=t/e;r[t]=this.getTangentAt(n,new Fe),r[t].normalize()}i[0]=new Fe,a[0]=new Fe;let l=Number.MAX_VALUE;const c=Math.abs(r[0].x),u=Math.abs(r[0].y),d=Math.abs(r[0].z);c<=l&&(l=c,n.set(1,0,0)),u<=l&&(l=u,n.set(0,1,0)),d<=l&&n.set(0,0,1),o.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],o),a[0].crossVectors(r[0],i[0]);for(let t=1;t<=e;t++){if(i[t]=i[t-1].clone(),a[t]=a[t-1].clone(),o.crossVectors(r[t-1],r[t]),o.length()>Number.EPSILON){o.normalize();const e=Math.acos(we.clamp(r[t-1].dot(r[t]),-1,1));i[t].applyMatrix4(s.makeRotationAxis(o,e))}a[t].crossVectors(r[t],i[t])}if(!0===t){let t=Math.acos(we.clamp(i[0].dot(i[e]),-1,1));t/=e,r[0].dot(o.crossVectors(i[0],i[e]))>0&&(t=-t);for(let n=1;n<=e;n++)i[n].applyMatrix4(s.makeRotationAxis(r[n],t*n)),a[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:a}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),Qs.prototype=Object.create(zs.prototype),Qs.prototype.constructor=Qs,Qs.prototype.isEllipseCurve=!0,Qs.prototype.getPoint=function(e,t){const n=t||new Ee,r=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const a=Math.abs(i)r;)i-=r;i0?0:(Math.floor(Math.abs(l)/i)+1)*i:0===c&&l===i-1&&(l=i-2,c=1),this.closed||l>0?o=r[(l-1)%i]:(Ws.subVectors(r[0],r[1]).add(r[0]),o=Ws);const u=r[l%i],d=r[(l+1)%i];if(this.closed||l+2r.length-2?r.length-1:a+1],u=r[a>r.length-3?r.length-1:a+2];return n.set(Xs(o,s.x,l.x,c.x,u.x),Xs(o,s.y,l.y,c.y,u.y)),n},ol.prototype.copy=function(e){zs.prototype.copy.call(this,e),this.points=[];for(let t=0,n=e.points.length;t=t){const e=n[r]-t,i=this.curves[r],a=i.getLength(),o=0===a?0:1-e/a;return i.getPointAt(o)}r++}return null},getLength:function(){const e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,r=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t},copy:function(e){zs.prototype.copy.call(this,e),this.curves=[];for(let t=0,n=e.curves.length;t0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this},copy:function(e){return ll.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){const e=ll.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return ll.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),ul.prototype=Object.assign(Object.create(cl.prototype),{constructor:ul,getPointsHoles:function(e){const t=[];for(let n=0,r=this.holes.length;n0:r.vertexColors=e.vertexColors),void 0!==e.uniforms)for(const t in e.uniforms){const i=e.uniforms[t];switch(r.uniforms[t]={},i.type){case"t":r.uniforms[t].value=n(i.value);break;case"c":r.uniforms[t].value=(new tn).setHex(i.value);break;case"v2":r.uniforms[t].value=(new Ee).fromArray(i.value);break;case"v3":r.uniforms[t].value=(new Fe).fromArray(i.value);break;case"v4":r.uniforms[t].value=(new Ie).fromArray(i.value);break;case"m3":r.uniforms[t].value=(new Se).fromArray(i.value);break;case"m4":r.uniforms[t].value=(new lt).fromArray(i.value);break;default:r.uniforms[t].value=i.value}}if(void 0!==e.defines&&(r.defines=e.defines),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(const t in e.extensions)r.extensions[t]=e.extensions[t];if(void 0!==e.shading&&(r.flatShading=1===e.shading),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.matcap&&(r.matcap=n(e.matcap)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(r.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),r.normalScale=(new Ee).fromArray(t)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(r.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(r.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(r.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(r.clearcoatNormalScale=(new Ee).fromArray(e.clearcoatNormalScale)),void 0!==e.transmission&&(r.transmission=e.transmission),void 0!==e.transmissionMap&&(r.transmissionMap=n(e.transmissionMap)),r},setTextures:function(e){return this.textures=e,this}});const Tl=function(e){const t=e.lastIndexOf("/");return-1===t?"./":e.substr(0,t+1)};function Bl(){In.call(this),this.type="InstancedBufferGeometry",this.instanceCount=1/0}function Rl(e,t,n,r){"number"==typeof n&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),cn.call(this,e,t,n),this.meshPerAttribute=r||1}function Cl(e){Ds.call(this,e)}Bl.prototype=Object.assign(Object.create(In.prototype),{constructor:Bl,isInstancedBufferGeometry:!0,copy:function(e){return In.prototype.copy.call(this,e),this.instanceCount=e.instanceCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){const e=In.prototype.toJSON.call(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}),Rl.prototype=Object.assign(Object.create(cn.prototype),{constructor:Rl,isInstancedBufferAttribute:!0,copy:function(e){return cn.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},toJSON:function(){const e=cn.prototype.toJSON.call(this);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}),Cl.prototype=Object.assign(Object.create(Ds.prototype),{constructor:Cl,load:function(e,t,n,r){const i=this,a=new _s(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)},parse:function(e){const t={},n={};function r(e,r){if(void 0!==t[r])return t[r];const i=e.interleavedBuffers[r],a=function(e,t){if(void 0!==n[t])return n[t];const r=e.arrayBuffers[t],i=new Uint32Array(r).buffer;return n[t]=i,i}(e,i.buffer),o=new ba(wn(i.type,a),i.stride);return o.uuid=i.uuid,t[r]=o,o}const i=e.isInstancedBufferGeometry?new Bl:new In,a=e.data.index;if(void 0!==a){const e=wn(a.type,a.array);i.setIndex(new cn(e,1))}const o=e.data.attributes;for(const t in o){const n=o[t];let a;if(n.isInterleavedBufferAttribute){a=new wa(r(e.data,n.data),n.itemSize,n.offset,n.normalized)}else{const e=wn(n.type,n.array);a=new(n.isInstancedBufferAttribute?Rl:cn)(e,n.itemSize,n.normalized)}void 0!==n.name&&(a.name=n.name),i.setAttribute(t,a)}const s=e.data.morphAttributes;if(s)for(const t in s){const n=s[t],a=[];for(let t=0,i=n.length;tNumber.EPSILON){if(l<0&&(n=t[a],s=-s,o=t[i],l=-l),e.yo.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{const t=l*(e.x-n.x)-s*(e.y-n.y);if(0===t)return!0;if(t<0)continue;r=!r}}else{if(e.y!==n.y)continue;if(o.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=o.x)return!0}}return r}const i=Xo.isClockWise,a=this.subPaths;if(0===a.length)return[];if(!0===t)return n(a);let o,s,l;const c=[];if(1===a.length)return s=a[0],l=new ul,l.curves=s.curves,c.push(l),c;let u=!i(a[0].getPoints());u=e?!u:u;const d=[],p=[];let h,f,m=[],g=0;p[g]=void 0,m[g]=[];for(let t=0,n=a.length;t1){let e=!1;const t=[];for(let e=0,t=p.length;e0&&(e||(m=d))}for(let e=0,t=p.length;e0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(let e=t,i=t+t;e!==i;++e)if(n[e]!==n[e+t]){o.setValue(n,r);break}},saveOriginalState:function(){const e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(let e=n,i=r;e!==i;++e)t[e]=t[r+e%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){const e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_setAdditiveIdentityNumeric:function(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let r=0;r!==i;++r)e[t+r]=e[n+r]},_slerp:function(e,t,n,r){De.slerpFlat(e,t,e,t,e,n,r)},_slerpAdditive:function(e,t,n,r,i){const a=this._workIndex*i;De.multiplyQuaternionsFlat(e,a,e,t,e,n),De.slerpFlat(e,t,e,t,e,a,r)},_lerp:function(e,t,n,r,i){const a=1-r;for(let o=0;o!==i;++o){const i=t+o;e[i]=e[i]*a+e[n+o]*r}},_lerpAdditive:function(e,t,n,r,i){for(let a=0;a!==i;++a){const i=t+a;e[i]=e[i]+e[n+a]*r}}});const Wl=new RegExp("[\\[\\]\\.:\\/]","g"),Yl="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Jl=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Zl=/(WCOD+)?/.source.replace("WCOD",Yl),Kl=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Xl=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),ql=new RegExp("^"+Jl+Zl+Kl+Xl+"$"),$l=["material","materials","bones"];function ec(e,t,n){const r=n||tc.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}function tc(e,t,n){this.path=t,this.parsedPath=n||tc.parseTrackName(t),this.node=tc.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}Object.assign(ec.prototype,{getValue:function(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)},setValue:function(e,t){const n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)},bind:function(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),Object.assign(tc,{Composite:ec,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new tc.Composite(e,t,n):new tc(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace(Wl,"")},parseTrackName:function(e){const t=ql.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){const e=n.nodeName.substring(r+1);-1!==$l.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n},findNode:function(e,t){if(!t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){const n=function(e){for(let r=0;r=i){const a=i++,c=e[a];t[c.uuid]=l,e[l]=c,t[s]=a,e[a]=o;for(let e=0,t=r;e!==t;++e){const t=n[e],r=t[a],i=t[l];t[l]=r,t[a]=i}}}this.nCachedObjects_=i},uncache:function(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length;let i=this.nCachedObjects_,a=e.length;for(let o=0,s=arguments.length;o!==s;++o){const s=arguments[o].uuid,l=t[s];if(void 0!==l)if(delete t[s],l0&&(t[o.uuid]=l),e[l]=o,e.pop();for(let e=0,t=r;e!==t;++e){const t=n[e];t[l]=t[i],t.pop()}}}this.nCachedObjects_=i},subscribe_:function(e,t){const n=this._bindingsIndicesByPath;let r=n[e];const i=this._bindings;if(void 0!==r)return i[r];const a=this._paths,o=this._parsedPaths,s=this._objects,l=s.length,c=this.nCachedObjects_,u=new Array(l);r=i.length,n[e]=r,a.push(e),o.push(t),i.push(u);for(let n=c,r=s.length;n!==r;++n){const r=s[n];u[n]=new tc(r,e,t)}return u},unsubscribe_:function(e){const t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){const r=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];t[e[o]]=n,a[n]=s,a.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}});class nc{constructor(e,t,n=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=r;const i=t.tracks,a=i.length,o=new Array(a),s={endingStart:2400,endingEnd:2400};for(let e=0;e!==a;++e){const t=i[e].createInterpolant(null);o[e]=t,t.settings=s}this._interpolantSettings=s,this._interpolants=o,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){const n=this._clip.duration,r=e._clip.duration,i=r/n,a=n/r;e.warp(1,i,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const r=this._mixer,i=r.time,a=this.timeScale;let o=this._timeScaleInterpolant;null===o&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);const s=o.parameterPositions,l=o.sampleValues;return s[0]=i,s[1]=i+n,l[0]=e/a,l[1]=t/a,this}stopWarping(){const e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,r){if(!this.enabled)return void this._updateWeight(e);const i=this._startTime;if(null!==i){const r=(e-i)*n;if(r<0||0===n)return;this._startTime=null,t=n*r}t*=this._updateTimeScale(e);const a=this._updateTime(t),o=this._updateWeight(e);if(o>0){const e=this._interpolants,t=this._propertyBindings;switch(this.blendMode){case 2501:for(let n=0,r=e.length;n!==r;++n)e[n].evaluate(a),t[n].accumulateAdditive(o);break;case 2500:default:for(let n=0,i=e.length;n!==i;++n)e[n].evaluate(a),t[n].accumulate(r,o)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(null!==n){const r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(null!==n){t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let r=this.time+e,i=this._loopCount;const a=2202===n;if(0===e)return-1===i?r:a&&1==(1&i)?t-r:r;if(2200===n){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else{if(!(r<0)){this.time=r;break e}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),r>=t||r<0){const n=Math.floor(r/t);r-=t*n,i+=Math.abs(n);const o=this.repetitions-i;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===o){const t=e<0;this._setEndings(t,!t,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=r;if(a&&1==(1&i))return t-r}return r}_setEndings(e,t,n){const r=this._interpolantSettings;n?(r.endingStart=2401,r.endingEnd=2401):(r.endingStart=e?this.zeroSlopeAtStart?2401:2400:2402,r.endingEnd=t?this.zeroSlopeAtEnd?2401:2400:2402)}_scheduleFading(e,t,n){const r=this._mixer,i=r.time;let a=this._weightInterpolant;null===a&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);const o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=t,o[1]=i+e,s[1]=n,this}}function rc(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}rc.prototype=Object.assign(Object.create(ye.prototype),{constructor:rc,_bindAction:function(e,t){const n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,l=this._bindingsByRootAndName;let c=l[s];void 0===c&&(c={},l[s]=c);for(let e=0;e!==i;++e){const i=r[e],l=i.name;let u=c[l];if(void 0!==u)a[e]=u;else{if(u=a[e],void 0!==u){null===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,s,l));continue}const r=t&&t._propertyBindings[e].binding.parsedPath;u=new Gl(tc.create(n,l,r),i.ValueTypeName,i.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,s,l),a[e]=u}o[e].resultBuffer=u.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){const t=e._cacheIndex;return null!==t&&t=0;--t)e[t].stop();return this},update:function(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1;for(let o=0;o!==n;++o){t[o]._update(r,e,i,a)}const o=this._bindings,s=this._nActiveBindings;for(let e=0;e!==s;++e)o[e].apply(a);return this},setTime:function(e){this.time=0;for(let e=0;e4?o=vc[i-8+4-1]:0==i&&(o=0),n.push(o);const s=1/(a-1),l=-s/2,c=1+s/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],d=6,p=6,h=3,f=2,m=1,g=new Float32Array(h*p*d),A=new Float32Array(f*p*d),v=new Float32Array(m*p*d);for(let e=0;e2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];g.set(r,h*p*e),A.set(u,f*p*e);const i=[e,e,e,e,e,e];v.set(i,m*p*e)}const y=new In;y.setAttribute("position",new cn(g,h)),y.setAttribute("uv",new cn(A,f)),y.setAttribute("faceIndex",new cn(v,m)),e.push(y),r>4&&r--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}function Mc(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Ks.call(this,e),this.type="catmullrom"}zs.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(zs.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(cl.prototype,{fromPoints:function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),Object.create(Ks.prototype),Object.create(Ks.prototype),Mc.prototype=Object.create(Ks.prototype),Object.assign(Mc.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),class extends ho{constructor(e=10,t=10,n=4473924,r=8947848){n=new tn(n),r=new tn(r);const i=t/2,a=e/t,o=e/2,s=[],l=[];for(let e=0,c=0,u=-o;e<=t;e++,u+=a){s.push(-o,0,u,o,0,u),s.push(u,0,-o,u,0,o);const t=e===i?n:r;t.toArray(l,c),c+=3,t.toArray(l,c),c+=3,t.toArray(l,c),c+=3,t.toArray(l,c),c+=3}const c=new In;c.setAttribute("position",new vn(s,3)),c.setAttribute("color",new vn(l,3));super(c,new ro({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},class extends ho{constructor(e){const t=function e(t){const n=[];t&&t.isBone&&n.push(t);for(let r=0;rthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new Ee),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new Ee),t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return uc.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(Le.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign($e.prototype,{empty:function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()}}),cr.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},class{constructor(e,t){this.start=void 0!==e?e:new Fe,this.end=void 0!==t?t:new Fe}set(e,t){return this.start.copy(e),this.end.copy(t),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return void 0===e&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new Fe),e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return void 0===e&&(console.warn("THREE.Line3: .delta() target is now required"),e=new Fe),e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return void 0===t&&(console.warn("THREE.Line3: .at() target is now required"),t=new Fe),this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){dc.subVectors(e,this.start),pc.subVectors(this.end,this.start);const n=pc.dot(pc);let r=pc.dot(dc)/n;return t&&(r=we.clamp(r,0,1)),r}closestPointToPoint(e,t,n){const r=this.closestPointToPointParameter(e,t);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new Fe),this.delta(n).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Object.assign(we,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),we.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),we.ceilPowerOfTwo(e)}}),Object.assign(Se.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},getInverse:function(e){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()}}),Object.assign(lt.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new Fe).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,r,i,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,r,n,i,a)},getInverse:function(e){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()}}),Lt.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},Object.assign(De.prototype,{multiplyVector3:function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},inverse:function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()}}),Object.assign(st.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(Jt.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},midpoint:function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},normal:function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},plane:function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)}}),Object.assign(Jt,{barycoordFromPoint:function(e,t,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Jt.getBarycoord(e,t,n,r,i)},normal:function(e,t,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Jt.getNormal(e,t,n,r)}}),Object.assign(ul.prototype,{extractAllPoints:function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new es(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new rs(this,e)}}),Object.assign(Ee.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Fe.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Ie.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Dt.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(Dt.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(Jn.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(Jn.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(Ha.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Xa.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Ya.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(zs.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),nr.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(dl.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(cn.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),35048===this.usage},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(35048)}}}),Object.assign(cn.prototype,{setDynamic:function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?35048:35044),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(In.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addAttribute:function(e,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new cn(arguments[1],arguments[2])))},addDrawCall:function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},applyMatrix:function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(In.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(Bl.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(e){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=e}}}),Object.defineProperties(sc.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(e){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=e}}}),Object.defineProperties(ba.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),35048===this.usage},set:function(e){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(e)}}}),Object.assign(ba.prototype,{setDynamic:function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?35048:35044),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(es.prototype,{getArrays:function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")}}),Object.assign(ya.prototype,{dispose:function(){console.error("THREE.Scene: .dispose() has been removed.")}}),Object.defineProperties(ic.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(an.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new tn}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===e}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}}}),Object.defineProperties(ls.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(ss.prototype,{transparency:{get:function(){return console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission},set:function(e){console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission=e}}}),Object.defineProperties(er.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.assign(ga.prototype,{clearTarget:function(e,t,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,r)},animate:function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(ga.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?3001:3e3}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(sa.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(ke.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Object.defineProperties(jl.prototype,{load:{value:function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const t=this;return(new Ll).load(e,(function(e){t.setBuffer(e)})),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),class{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let n=0;n>",l=o||r;if(null==n[r])return t?new Error("Required "+a+" `"+l+"` was not specified in `"+s+"`."):null;for(var c=arguments.length,u=Array(c>6?c-6:0),d=6;du;)n=l[u++],r&&!o.call(s,n)||d.push(e?[n,s[n]]:s[n]);return d}}},function(e,t,n){var r=n(407);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n(44)(r,i);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(43)(!1)).push([e.i,".category-container {\r\n margin: 0 1rem;\r\n}\r\n\r\n.category-title {\r\n margin: 1rem 0 0 0;\r\n font-weight: bold;\r\n padding: 10px;\r\n color: rgba(220, 220, 220,.9);\r\n background: rgba(40, 40, 40, .9);\r\n border: none;\r\n outline: none;\r\n cursor: pointer;\r\n border-radius: .5rem .5rem 0 0;\r\n}\r\n\r\n.category-title:active,\r\n.category-title:focus,\r\n.category-title:hover {\r\n outline: none;\r\n color: white;\r\n background: #555;\r\n border: none !important;\r\n}\r\n\r\n.category-content {\r\n padding: .5rem;\r\n background: rgba(220, 220, 220, .9);\r\n border-radius: 0 0 .5rem .5rem;\r\n overflow: hidden;\r\n}\r\n\r\n.hide-content {\r\n height: 0;\r\n background: #555;\r\n}\r\n",""])},function(e,t,n){var r=n(409);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n(44)(r,i);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(43)(!1)).push([e.i,".slider-info {\r\n width: 100%;\r\n padding: 0 1rem;\r\n overflow: auto;\r\n}\r\n\r\n.slider-name {\r\n float: left;\r\n color: #333;\r\n}\r\n\r\n.slider-value {\r\n float: right;\r\n color: #333;\r\n}\r\n\r\n.slider-input {\r\n -webkit-appearance: none;\r\n -moz-appearance: none;\r\n appearance: none;\r\n position: relative;\r\n vertical-align: middle;\r\n height: 3rem;\r\n border-radius: 2rem;\r\n background: #555;\r\n box-shadow: 0 1px 0 rgb(0, 0, 0, .75);\r\n overflow: hidden;\r\n margin: 0 0 2.5rem 0;\r\n}\r\n\r\n.slider-input:active::-webkit-slider-thumb {\r\n cursor: -webkit-grabbing;\r\n cursor: grabbing;\r\n background: darkgreen;\r\n}\r\n\r\n.slider-input:focus {\r\n outline: none;\r\n}\r\n\r\n.slider-input::-webkit-slider-thumb {\r\n -webkit-appearance: none;\r\n border: none;\r\n height: 2.5rem;\r\n width: 4rem;\r\n border-radius: 2rem;\r\n background: rgba(220, 220, 220, .9);\r\n cursor: pointer;\r\n}\r\n\r\n\r\n.slider-input:active::-webkit-slider-thumb,\r\n.slider-input:active::slider-thumb {\r\n border: 0px solid hsl(0,0%,80%);\r\n transition-duration: .1;\r\n outline: none;\r\n}\r\n",""])},function(e,t,n){var r=n(411);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n(44)(r,i);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(43)(!1)).push([e.i,".config-checkbox-container {\r\n display: block;\r\n margin: 1rem;\r\n text-align: center;\r\n}\r\n\r\n.config-checkbox-container label {\r\n margin: 0;\r\n width: 100%;\r\n padding: .5rem 1rem;\r\n border-radius: .5rem;\r\n background: #EEE;\r\n color: #555;\r\n cursor: pointer;\r\n font-size: 16px;\r\n}\r\n\r\n.config-checkbox-container input:checked + label {\r\n background: #060;\r\n color: white;\r\n}\r\n\r\n.config-checkbox-container input {\r\n display: none;\r\n}\r\n",""])},function(e,t,n){var r=n(413);"string"==typeof r&&(r=[[e.i,r,""]]);var i={hmr:!0,transform:void 0,insertInto:void 0};n(44)(r,i);r.locals&&(e.exports=r.locals)},function(e,t,n){(e.exports=n(43)(!1)).push([e.i,".sidebar-container {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n height: 100vh;\r\n width: 20px;\r\n}\r\n\r\n.tab:hover {\r\n background: #222;\r\n}\r\n\r\n.sidebar-content {\r\n transform: translate(-100%, 0);\r\n width: 33vw;\r\n height: 100vh;\r\n background-color: black;\r\n color: rgba(220,220,220,.9);\r\n border-right: 3px solid rgba(20,20,20,.9);\r\n opacity: .9;\r\n padding: 10px 20px;\r\n}\r\n\r\n@media only screen and (max-width: 600px) {\r\n .sidebar-content {\r\n width: 60vw;\r\n }\r\n \r\n .expand-config {\r\n display: none;\r\n }\r\n}\r\n\r\n.sidebar-title {\r\n display: inline-block;\r\n font-weight: bold;\r\n overflow: hidden;\r\n margin: 1rem 2rem;\r\n}\r\n\r\n.sidebar-content:not(.slide-in) > .row > .sidebar-title {\r\n display: none;\r\n}\r\n\r\n.expand-config {\r\n float: right;\r\n margin: 1.5rem 1rem 0 0;\r\n vertical-align: top;\r\n border-radius: .25rem;\r\n color: #333;\r\n}\r\n\r\n.expand-config:focus {\r\n outline: none;\r\n}\r\n\r\n.expand-config:hover, .expanded {\r\n background: green;\r\n color: #ccc;\r\n}\r\n\r\n.slide-in {\r\n transform: translate(0, 0);\r\n -webkit-animation: slide-in .5s;\r\n animation: slide-in .5s;\r\n}\r\n@-webkit-keyframes slide-in {\r\n from {\r\n transform: translate(-100%, 0);\r\n }\r\n to {\r\n transform: translate(0, 0);\r\n }\r\n}\r\n@keyframes slide-in {\r\n from {\r\n transform: translate(-100%, 0);\r\n }\r\n to {\r\n transform: translate(0, 0);\r\n }\r\n}\r\n\r\n.slide-out {\r\n -webkit-animation: slide-out .5s;\r\n animation: slide-out .5s;\r\n}\r\n@-webkit-keyframes slide-out {\r\n from {\r\n transform: translate(0, 0);\r\n }\r\n to {\r\n transform: translate(-100%, 0);\r\n }\r\n}\r\n@keyframes slide-out {\r\n from {\r\n transform: translate(0, 0);\r\n }\r\n to {\r\n transform: translate(-100%, 0);\r\n }\r\n}\r\n\r\n.tab {\r\n position: absolute;\r\n top: 50%;\r\n left: 100%;\r\n transform: translate(0, -50%);\r\n color: rgba(220, 220, 220, .9);\r\n background-color: black;\r\n padding: 50px 5px;\r\n border: 3px solid rgba(20, 20, 20, .9);\r\n border-left: none;\r\n border-radius: 0 50px 50px 0;\r\n cursor: pointer;\r\n outline: none;\r\n}\r\n\r\n.tab:hover {\r\n border-color: rgba(60, 60, 60, .9);\r\n color: white;\r\n}\r\n\r\n.tab-new:hover {\r\n border-color: rgba(60, 60, 60, .9);\r\n color: white;\r\n}\r\n\r\n.tab-fade-in {\r\n -webkit-animation: tab-fade-in .3s;\r\n animation: tab-fade-in .3s;\r\n}\r\n@-webkit-keyframes tab-fade-in {\r\n from {\r\n opacity: 0;\r\n transform: translate(-20%, -50%);\r\n }\r\n to {\r\n opacity: 1;\r\n transform: translate(0, -50%);\r\n }\r\n}\r\n@keyframes tab-fade-in {\r\n from {\r\n opacity: 0;\r\n transform: translate(-20%, -50%);\r\n }\r\n to {\r\n opacity: 1;\r\n transform: translate(0, -50%);\r\n }\r\n}\r\n\r\n.tab-fade-out {\r\n opacity: 0;\r\n -webkit-animation: tab-fade-out .3s;\r\n animation: tab-fade-out .3s;\r\n}\r\n@-webkit-keyframes tab-fade-out {\r\n from {\r\n opacity: 1;\r\n transform: translate(0, -50%);\r\n }\r\n to {\r\n opacity: 0;\r\n transform: translate(-20%, -50%);\r\n }\r\n}\r\n@keyframes tab-fade-out {\r\n from {\r\n opacity: 1;\r\n transform: translate(0, -50%);\r\n }\r\n to {\r\n opacity: 0;\r\n transform: translate(-20%, -50%);\r\n }\r\n}\r\n",""])},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r),a=n(73),o=n.n(a),s=n(2),l=n.n(s),c=n(156),u=n.n(c),d={linear:function(e){return e},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1}},p={options:{peakDetection:{enabled:!0,options:{threshold_DEFAULT:2,threshold_MIN:0,threshold_MAX:5,threshold_STEP_SIZE:.1,ignoreTime_DEFAULT:250,ignoreTime_MIN:0,ignoreTime_MAX:2500,ignoreTime_STEP_SIZE:50,energyPersistence:2e3,peakPersistency:300,easing:d.linear}},multibandPeakDetection:{enabled:!0,options:{bands:8,threshold:1.2,ignoreTime:300,energyPersistence:1200,peakPersistency:300,easing:d.linear}},returns:{timedomainData:!0,frequenciesData:!0,energy:!0,energyHistory:!0,energyAverage:!0,peak:!0,peakHistory:!0,multibandEnergy:!0,multibandEnergyHistory:!0,multibandEnergyAverage:!0,multibandPeak:!0,multibandPeakHistory:!0}}},h={showerrors:!0,showloginfos:!0,hudToggleKey:"h",hudDisplayed:!0,volume:.5,speed_DEFAULT:2,speed_MIN:0,speed_MAX:40,speed_STEP_SIZE:.5,rotationSpeed_DEFAULT:2,rotationSpeed_MIN:-50,rotationSpeed_MAX:50,rotationSpeed_STEP_SIZE:.25,scaleFactor_DEFAULT:1500,scaleFactor_MIN:100,scaleFactor_MAX:2e3,scaleFactor_STEP_SIZE:100,cameraBound_DEFAULT:100,cameraBound_MIN:0,cameraBound_MAX:500,cameraBound_SEP_SIZE:20},f=!0,m=!0,g=!0,A=!0,v=!0,y=!0,b=1,x=10,w=2.5,E=.1,S=0,M=1,T=.5,B=.01,R=5,C=6,I=5.5,k=.1,P=0,D=1,F=.5,_=.1,U=0,L=1,V=.5,N=.1,O={sprites_DEFAULT:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],sprites_MIN:1,sprites_MAX:5,saturation_DEFAULT:1,saturation_MIN:0,saturation_MAX:1,saturation_STEP_SIZE:.1,particles_DEFAULT:7500,particles_MIN:1,particles_MAX:15e3,particles_STEP_SIZE:1,layers_DEFAULT:4,layers_MIN:1,layers_MAX:20,layers_STEP_SIZE:1,levels_DEFAULT:3,levels_MIN:1,levels_MAX:20,levels_STEP_SIZE:1,size_DEFAULT:10,size_MIN:1,size_MAX:200,size_STEP_SIZE:1},H={clips:["galaxy.mp4","earth.mp4"],index:0},z={user:{speed:{name:"Speed",type:"slider",defaultValue:h.speed_DEFAULT,value:h.speed_DEFAULT,min:h.speed_MIN,max:h.speed_MAX,step:h.speed_STEP_SIZE},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:h.rotationSpeed_DEFAULT,value:h.rotationSpeed_DEFAULT,min:h.rotationSpeed_MIN,max:h.rotationSpeed_MAX,step:h.rotationSpeed_STEP_SIZE},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:h.scaleFactor_DEFAULT,value:h.scaleFactor_DEFAULT,min:h.scaleFactor_MIN,max:h.scaleFactor_MAX,step:h.scaleFactor_STEP_SIZE},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:h.cameraBound_DEFAULT,value:h.cameraBound_DEFAULT,min:h.cameraBound_MIN,max:h.cameraBound_MAX,step:h.cameraBound_SEP_SIZE}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:p.options.peakDetection.options.threshold_DEFAULT,value:p.options.peakDetection.options.threshold_DEFAULT,min:p.options.peakDetection.options.threshold_MIN,max:p.options.peakDetection.options.threshold_MAX,step:p.options.peakDetection.options.threshold_STEP_SIZE},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:p.options.peakDetection.options.ignoreTime_DEFAULT,value:p.options.peakDetection.options.ignoreTime_DEFAULT,min:p.options.peakDetection.options.ignoreTime_MIN,max:p.options.peakDetection.options.ignoreTime_MAX,step:p.options.peakDetection.options.ignoreTime_STEP_SIZE}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:f,value:f},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:m,value:m},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:g,value:g},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:A,value:A},glow:{name:"Glow",type:"checkbox",defaultValue:v,value:v},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:y,value:y}},orbit:{a:{name:"A",type:"slider",defaultValue:w,value:w,min:b,max:x,step:E},b:{name:"B",type:"slider",defaultValue:T,value:T,min:S,max:M,step:B},c:{name:"C",type:"slider",defaultValue:I,value:I,min:R,max:C,step:k},d:{name:"D",type:"slider",defaultValue:F,value:F,min:P,max:D,step:_},e:{name:"E",type:"slider",defaultValue:V,value:V,min:U,max:L,step:N}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:O.size_DEFAULT,value:O.size_DEFAULT,min:O.size_MIN,max:O.size_MAX,step:O.size_STEP_SIZE},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:O.particles_DEFAULT,value:O.particles_DEFAULT,min:O.particles_MIN,max:O.particles_MAX,step:O.particles_STEP_SIZE},layers:{name:"Layers",type:"slider",defaultValue:O.layers_DEFAULT,value:O.layers_DEFAULT,min:O.layers_MIN,max:O.layers_MAX,step:O.layers_STEP_SIZE},levels:{name:"Levels",type:"slider",defaultValue:O.levels_DEFAULT,value:O.levels_DEFAULT,min:O.levels_MIN,max:O.levels_MAX,step:O.levels_STEP_SIZE},saturation:{name:"Saturation",type:"slider",defaultValue:O.saturation_DEFAULT,value:O.saturation_DEFAULT,min:O.saturation_MIN,max:O.saturation_MAX,step:O.saturation_STEP_SIZE},sprites:{name:"Sprites",type:"multiselect",defaultValue:O.sprites_DEFAULT,value:O.sprites_DEFAULT,min:O.sprites_MIN,max:O.sprites_MAX}},video:{clips:H.clips,index:H.index}},Q={default:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:2,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:2,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:1500,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.5,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.5,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:10,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:7500,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:5,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:5,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],min:1,max:5}},video:{clips:["galaxy.mp4","earth.mp4"],index:0}},galaxySpace:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:1,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:3.25,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:2e3,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:1.8,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.5,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:50,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:166,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:3,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],min:1,max:5}}},galaxySalad:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:1,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:-2.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:600,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:3,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.7,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:12,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],min:1,max:5}}},galaxyPortal:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:10,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:4,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:900,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:3.2,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.65,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.5,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:187,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:166,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:3,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],min:1,max:5}}},galaxySpiral:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:4,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:-2.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:300,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:3,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.7,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:12,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:8,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:6,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:.3,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],min:1,max:5}}},sideSwirl:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:6,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:14.75,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:200,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:500,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:100,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!1},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.5,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.5,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:15,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:2634,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:8,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:5,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],min:1,max:5}}},eyeChase:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:2.5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:4,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:800,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.6,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.8,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:175,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:20,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["fractaleye.png"],min:1,max:5}}},crossheirSpin:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:1.5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:2,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:900,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:6.9,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.02,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.9,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:7,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:9578,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:8,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:5,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],min:1,max:5}}},pointerz:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:6,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:2,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:1300,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:4.7,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.27,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.1,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:7,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:9578,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:8,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:7,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],min:1,max:5}}},dispersionTunnelSpin:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:.5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:-2.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:1e3,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!1},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:5,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.93,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.8,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.2,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:4,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:10139,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:14,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],min:1,max:5}}},colorPortal:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:3,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:12.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:600,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!0}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:9,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.35,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.1,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:7,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:5e3,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:20,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:6,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],min:1,max:5}}},edgeChaseSpin:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:2,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:1800,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:3.2,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.08,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.2,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.7,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:35,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:2921,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:6,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],min:1,max:5}}},ohSprite:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:2,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:4,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:800,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:185,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:10,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["ohSprite.png"],min:1,max:5}}},circles:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:3.5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:2,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:1300,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:7.7,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.2,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:7,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:9578,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:8,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:5,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],min:1,max:5}}},squareMandala:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:7.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:900,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.5,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.06,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.9,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:7,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:4832,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:20,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:5,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],min:1,max:5}}},notes:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:3,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:3.25,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:600,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.7,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.1,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.6,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:149,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:35,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["musicNotes.png","musicNotes2.png","musicNotes3.png"],min:1,max:5}}},noteExplosion:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:2.5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:4,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:800,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.6,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.8,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:175,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:20,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:.7,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["musicNoteExplosion.png","musicNoteExplosion2.png","musicNoteExplosion.png"],min:1,max:5}}},fire:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:-2.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:600,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:3,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.7,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:12,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["fire.png","fire2.png","fire3.png"],min:1,max:5}}},tapeFire:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:-2.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:600,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:100,min:1,max:100,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.7,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:12,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["fire.png","fire2.png","fire3.png"],min:1,max:5}},video:{clips:["tape14.mp4","tape13.mp4"],index:0}},weed:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:4.5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:4,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:800,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.2,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.6,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.8,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:175,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:20,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:.5,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["weed.png"],min:1,max:5}}},garbageMonsters:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:7,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:6.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:800,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.24,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.6,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.8,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:165,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:20,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["garbageMonster.png","garbageMonster2.png","garbageMonster.png"],min:1,max:5}}},garbageMan:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:8,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:11,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:600,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.8,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.81,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.6,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.8,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:20,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["garbageMan.png"],min:1,max:5}}},choppingMen:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:7,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:6.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:800,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.24,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.6,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.8,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:165,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:20,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["choppingMan.png","choppingMan2.png","choppingMan.png"],min:1,max:5}}},choppingHands:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:8,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:11,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:600,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.8,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.81,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.6,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.8,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:20,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["chopHand.png","chopHand2.png"],min:1,max:5}}},slimeHands:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:3.5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:6.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:800,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.2,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.24,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.6,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.8,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:175,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:20,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:.1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["slimeHand3.png","slimeHand2.png","slimeHand.png"],min:1,max:5}}},honeycomb:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:2,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:-2.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:500,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!1},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.97,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.2,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.7,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:12,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:8,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:8,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:.3,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["honeycomb.png"],min:1,max:5}}},kaiber:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:.5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:800,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!1},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.7,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:20,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:.5,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["kaiber.png"],min:1,max:5}}},blackout:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:3.5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:-5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:1e3,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:10,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.5,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:4,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:3,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["barbwire.png"],min:1,max:5}}},tapeIntroJumpy:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:3.5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:-5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:1e3,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:10,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.5,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:4,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:3,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["cassetteLogo.png"],min:1,max:5}}},vzn:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:1,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:800,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!1},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.7,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:20,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:.1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["vzn.jpeg"],min:1,max:5}}},vznSpace:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:1,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:3.25,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:2e3,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:1.8,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.5,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:50,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:166,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:3,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["vzn.jpeg","cassette.png","galaxy2Sprite.png"],min:1,max:5}}},vznCassette:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:2,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:2,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:1500,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:100,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!0}},orbit:{a:{name:"A",type:"slider",defaultValue:2.8,value:2.8,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.16,value:.16,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.8,value:5.8,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.8,value:.8,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.1,value:.1,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:200,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:6,value:6,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:10,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:2,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:0,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["cassette.png"],value:["vzn.jpeg"],min:1,max:5}}},tape:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:1,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:800,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!1},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.7,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:20,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:.1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["tape.png"],min:1,max:5}}},tapeSpace:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:1,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:3.25,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:2e3,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:1.8,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.5,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:50,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:166,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:3,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:1,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["tape.png","cassette.png","cassetteLogo.png"],min:1,max:5}}},tapeCassette:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:2,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:2,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:1500,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:100,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!0}},orbit:{a:{name:"A",type:"slider",defaultValue:2.8,value:2.8,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.16,value:.16,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.8,value:5.8,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.8,value:.8,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.1,value:.1,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:200,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:6,value:6,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:10,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:2,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:0,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["cassette.png"],value:["cassette.png"],min:1,max:5}}},tapeWireWhite:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:7,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:4,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:900,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.6,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.79,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.8,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:30,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:3,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["vzn.jpeg"],min:1,max:5}}},tapeWire:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:7,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:4,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:900,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.6,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.79,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.8,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:130,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:30,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:3,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:.2,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["tape.png"],min:1,max:5}}},tapeWireLogo:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:7,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:4,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:900,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.6,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.79,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.8,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:130,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:30,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:3,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:.4,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["cassetteLogo.png"],min:1,max:5}}},tapeSkull:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:7,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:4,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:900,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.6,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.79,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.8,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:150,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:30,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:3,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["skull.png","barbwire.png"],min:1,max:5}}},tapeSkullVid:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:7,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:4,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:900,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!1},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.6,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.79,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.8,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:0,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:114,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:30,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:4,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:3,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["cassetteLogo.png"],min:1,max:5}}},tapeSaladColor:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:1,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:-2.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:600,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:3,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.9,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:12,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["tape.png","cassetteLogo.png"],min:1,max:5}}},tapeSalad:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:1,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:-2.5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:600,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:3,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.69,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.6,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.9,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:12,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["skull.png","barbwire.png","tape.png"],min:1,max:5}}},hyperTape:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:2.5,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:3.75,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:200,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:5.4,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.78,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.5,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.1,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.5,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:175,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:5,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:3,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["tape.png"],min:1,max:5}}},tapeSpin:{user:{speed:{name:"Speed",type:"slider",defaultValue:2,value:2,min:0,max:40,step:.5},rotationSpeed:{name:"Rotation Speed",type:"slider",defaultValue:2,value:-5,min:-50,max:50,step:.25},scaleFactor:{name:"Scale Factor",type:"slider",defaultValue:1500,value:1500,min:100,max:2e3,step:100},cameraBound:{name:"Camera Bound",type:"slider",defaultValue:100,value:0,min:0,max:500,step:20}},audio:{soundThreshold:{name:"Sound Threshold",type:"slider",defaultValue:2,value:2,min:0,max:5,step:.1},ignoreTime:{name:"Ignore Time",type:"slider",defaultValue:250,value:250,min:0,max:2500,step:50}},effects:{cyclone:{name:"Cyclone",type:"checkbox",defaultValue:!0,value:!0},wobWob:{name:"Wob Wob",type:"checkbox",defaultValue:!0,value:!0},switcheroo:{name:"Switcheroo",type:"checkbox",defaultValue:!0,value:!0},colorShift:{name:"Color Shift",type:"checkbox",defaultValue:!0,value:!0},glow:{name:"Glow",type:"checkbox",defaultValue:!0,value:!0},shockwave:{name:"Shockwave",type:"checkbox",defaultValue:!0,value:!1}},orbit:{a:{name:"A",type:"slider",defaultValue:2.5,value:2.8,min:1,max:10,step:.1},b:{name:"B",type:"slider",defaultValue:.5,value:.16,min:0,max:1,step:.01},c:{name:"C",type:"slider",defaultValue:5.5,value:5.8,min:5,max:6,step:.1},d:{name:"D",type:"slider",defaultValue:.5,value:.8,min:0,max:1,step:.1},e:{name:"E",type:"slider",defaultValue:.5,value:.1,min:0,max:1,step:.1}},particle:{particleSize:{name:"Particle Size",type:"slider",defaultValue:10,value:200,min:1,max:200,step:1},particlesPerLayer:{name:"Particles Per Layer",type:"slider",defaultValue:7500,value:6,min:1,max:15e3,step:1},layers:{name:"Layers",type:"slider",defaultValue:5,value:10,min:1,max:20,step:1},levels:{name:"Levels",type:"slider",defaultValue:5,value:2,min:1,max:20,step:1},saturation:{name:"Saturation",type:"slider",defaultValue:1,value:0,min:0,max:1,step:.1},sprites:{name:"Sprites",type:"multiselect",defaultValue:["galaxySprite.png","galaxy2Sprite.png","galaxy3Sprite.png"],value:["tape.png"],min:1,max:5}}}};function j(e){return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function G(e,t,n,r,i,a,o){try{var s=e[a](o),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function W(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function o(e){G(a,r,i,o,s,"next",e)}function s(e){G(a,r,i,o,s,"throw",e)}o(void 0)}))}}function Y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function J(e){for(var t=1;te.length)&&localStorage.setItem("presets",JSON.stringify(Q))}},{key:"render",value:function(){return i.a.createElement(re.Provider,{value:this.state},this.props.children)}}])&&Z(n.prototype,r),a&&Z(n,a),s}(r.Component);ae.propTypes={config:l.a.object,updateConfigItem:l.a.func,updateConfigPreset:l.a.func};n(368),n(371);function oe(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;"audiofile"===this.sourceType?this.source.start(e,t):h.showerrors&&console.error("Couldn't start the audio source. Source is a microphone.")}},{key:"isThereFeedback",value:function(){return"microphone"!==this.sourceType||this.audioFeedback}},{key:"getAudioContext",value:function(){return this.audioContext}},{key:"getSourceNode",value:function(){return h.showerrors&&!this.source&&console.error("Audio source has not bet set up"),this.source}}])&&oe(t.prototype,n),r&&oe(t,r),e}();var le=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bufferSize=r,this.timedomainData=t,this.frequencyData=n};function ce(e,t){for(var n=0;n=0;r--)if((n+=this.energyHistoryDeltaTime[r])>=p.options.peakDetection.options.energyPersistence){this.energyHistoryDeltaTime.splice(0,r-1),this.energyHistory.splice(0,r-1);break}}},{key:"getEnergyHistory",value:function(){return this.energyHistory}},{key:"getMultibandEnergyHistory",value:function(){return this.multibandEnergyHistory}},{key:"pushNewMultibandEnergy",value:function(e,t){this.setMultibandEnergy(e),this.multibandEnergyHistory.push(e),this.multibandEnergyHistoryDeltaTime.push(t);for(var n=0,r=this.multibandEnergyHistory.length-1;r>=0;r--)if((n+=this.multibandEnergyHistoryDeltaTime[r])>=p.options.multibandPeakDetection.options.energyPersistence){this.multibandEnergyHistory.splice(0,r-1),this.multibandEnergyHistoryDeltaTime.splice(0,r-1);break}}}]),e}(),me=function e(t){de(this,e),this.bufferSize=t.bufferSize,p.options.returns.frequenciesData&&(this.frequenciesData=t.frequenciesData),p.options.returns.timedomainData&&(this.timedomainData=t.timedomainData),p.options.returns.energy&&(this.energy=t.energy),p.options.returns.energyHistory&&(this.energyHistory=t.energyHistory,this.energyHistoryDeltaTime=t.energyHistoryDeltaTime),p.options.returns.energyAverage&&(this.energyAverage=t.energyAverage),p.options.returns.peak&&(this.peak=t.peak),p.options.returns.peakHistory&&(this.peakHistory=t.peakHistory),p.options.returns.multibandEnergy&&(this.multibandEnergy=t.multibandEnergy),p.options.returns.multibandEnergyHistory&&(this.multibandEnergyHistory=t.multibandEnergyHistory,this.multibandEnergyHistoryDeltaTime=t.multibandEnergyHistoryDeltaTime),p.options.returns.multibandEnergyAverage&&(this.multibandEnergyAverage=t.multibandEnergyAverage),p.options.returns.multibandPeak&&(this.multibandPeak=t.multibandPeak),p.options.returns.multibandPeakHistory&&(this.multibandPeakHistory=t.multibandPeakHistory)},ge=function(){function e(t,n,r){de(this,e),this.value=t,this.timer=n,this.energy=r}return he(e,[{key:"copy",value:function(e){this.value=e.value,this.timer=e.timer,this.energy=e.energy}}]),e}();function Ae(e,t){for(var n=0;n0&&(n.value=this.peakInterpolation(i,n.timer,o,l));else if(e/t>a){var c=new ge(1,i,e);p.options.returns.peakHistory&&r.push(c),n.copy(c)}else n.value>0&&(n.value=this.peakInterpolation(i,n.timer,o,l));else if(e/t>a){var u=new ge(1,i,e);p.options.returns.peakHistory&&r.push(u),n.copy(u)}}},{key:"computeMultibandEnergy",value:function(e,t){for(var n=e.length,r=new Array(t),i=0;i>8&255]+be[e>>16&255]+be[e>>24&255]+"-"+be[255&t]+be[t>>8&255]+"-"+be[t>>16&15|64]+be[t>>24&255]+"-"+be[63&n|128]+be[n>>8&255]+"-"+be[n>>16&255]+be[n>>24&255]+be[255&r]+be[r>>8&255]+be[r>>16&255]+be[r>>24&255]).toUpperCase()},clamp:function(e,t,n){return Math.max(t,Math.min(n,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},lerp:function(e,t,n){return(1-n)*e+n*t},damp:function(e,t,n,r){return we.lerp(e,t,1-Math.exp(-n*r))},pingpong:function(e,t=1){return t-Math.abs(we.euclideanModulo(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){return void 0!==e&&(xe=e%2147483647),xe=16807*xe%2147483647,(xe-1)/2147483646},degToRad:function(e){return e*we.DEG2RAD},radToDeg:function(e){return e*we.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,r,i){const a=Math.cos,o=Math.sin,s=a(n/2),l=o(n/2),c=a((t+r)/2),u=o((t+r)/2),d=a((t-r)/2),p=o((t-r)/2),h=a((r-t)/2),f=o((r-t)/2);switch(i){case"XYX":e.set(s*u,l*d,l*p,s*c);break;case"YZY":e.set(l*p,s*u,l*d,s*c);break;case"ZXZ":e.set(l*d,l*p,s*u,s*c);break;case"XZX":e.set(s*u,l*f,l*h,s*c);break;case"YXY":e.set(l*h,s*u,l*f,s*c);break;case"ZYZ":e.set(l*f,l*h,s*u,s*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}};class Ee{constructor(e=0,t=0){Object.defineProperty(this,"isVector2",{value:!0}),this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,a=this.y-e.y;return this.x=i*n-a*r+e.x,this.y=i*r+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}class Se{constructor(){Object.defineProperty(this,"isMatrix3",{value:!0}),this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,r,i,a,o,s,l){const c=this.elements;return c[0]=e,c[1]=r,c[2]=o,c[3]=t,c[4]=i,c[5]=s,c[6]=n,c[7]=a,c[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}clone(){return(new this.constructor).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[3],s=n[6],l=n[1],c=n[4],u=n[7],d=n[2],p=n[5],h=n[8],f=r[0],m=r[3],g=r[6],A=r[1],v=r[4],y=r[7],b=r[2],x=r[5],w=r[8];return i[0]=a*f+o*A+s*b,i[3]=a*m+o*v+s*x,i[6]=a*g+o*y+s*w,i[1]=l*f+c*A+u*b,i[4]=l*m+c*v+u*x,i[7]=l*g+c*y+u*w,i[2]=d*f+p*A+h*b,i[5]=d*m+p*v+h*x,i[8]=d*g+p*y+h*w,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8];return t*a*c-t*o*l-n*i*c+n*o*s+r*i*l-r*a*s}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=c*a-o*l,d=o*s-c*i,p=l*i-a*s,h=t*u+n*d+r*p;if(0===h)return this.set(0,0,0,0,0,0,0,0,0);const f=1/h;return e[0]=u*f,e[1]=(r*l-c*n)*f,e[2]=(o*n-r*a)*f,e[3]=d*f,e[4]=(c*t-r*s)*f,e[5]=(r*i-o*t)*f,e[6]=p*f,e[7]=(n*s-l*t)*f,e[8]=(a*t-n*i)*f,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).copy(this).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,a,o){const s=Math.cos(i),l=Math.sin(i);return this.set(n*s,n*l,-n*(s*a+l*o)+a+e,-r*l,r*s,-r*(-l*a+s*o)+o+t,0,0,1),this}scale(e,t){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=t,n[4]*=t,n[7]*=t,this}rotate(e){const t=Math.cos(e),n=Math.sin(e),r=this.elements,i=r[0],a=r[3],o=r[6],s=r[1],l=r[4],c=r[7];return r[0]=t*i+n*s,r[3]=t*a+n*l,r[6]=t*o+n*c,r[1]=-n*i+t*s,r[4]=-n*a+t*l,r[7]=-n*o+t*c,this}translate(e,t){const n=this.elements;return n[0]+=e*n[2],n[3]+=e*n[5],n[6]+=e*n[8],n[1]+=t*n[2],n[4]+=t*n[5],n[7]+=t*n[8],this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}}let Me;const Te={getDataURL:function(e){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{void 0===Me&&(Me=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Me.width=e.width,Me.height=e.height;const n=Me.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Me}return t.width>2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}};let Be=0;function Re(e=Re.DEFAULT_IMAGE,t=Re.DEFAULT_MAPPING,n=1001,r=1001,i=1006,a=1008,o=1023,s=1009,l=1,c=3e3){Object.defineProperty(this,"id",{value:Be++}),this.uuid=we.generateUUID(),this.name="",this.image=e,this.mipmaps=[],this.mapping=t,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=a,this.anisotropy=l,this.format=o,this.internalFormat=null,this.type=s,this.offset=new Ee(0,0),this.repeat=new Ee(1,1),this.center=new Ee(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Se,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=c,this.version=0,this.onUpdate=null}function Ce(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?Te.getDataURL(e):e.data?{data:Array.prototype.slice.call(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}Re.DEFAULT_IMAGE=void 0,Re.DEFAULT_MAPPING=300,Re.prototype=Object.assign(Object.create(ye.prototype),{constructor:Re,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){const r=this.image;if(void 0===r.uuid&&(r.uuid=we.generateUUID()),!t&&void 0===e.images[r.uuid]){let t;if(Array.isArray(r)){t=[];for(let e=0,n=r.length;e1)switch(this.wrapS){case 1e3:e.x=e.x-Math.floor(e.x);break;case 1001:e.x=e.x<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case 1e3:e.y=e.y-Math.floor(e.y);break;case 1001:e.y=e.y<0?0:1;break;case 1002:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(Re.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}});class Ie{constructor(e=0,t=0,n=0,r=1){Object.defineProperty(this,"isVector4",{value:!0}),this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,i=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*r+a[12]*i,this.y=a[1]*t+a[5]*n+a[9]*r+a[13]*i,this.z=a[2]*t+a[6]*n+a[10]*r+a[14]*i,this.w=a[3]*t+a[7]*n+a[11]*r+a[15]*i,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i;const a=e.elements,o=a[0],s=a[4],l=a[8],c=a[1],u=a[5],d=a[9],p=a[2],h=a[6],f=a[10];if(Math.abs(s-c)<.01&&Math.abs(l-p)<.01&&Math.abs(d-h)<.01){if(Math.abs(s+c)<.1&&Math.abs(l+p)<.1&&Math.abs(d+h)<.1&&Math.abs(o+u+f-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const e=(o+1)/2,a=(u+1)/2,m=(f+1)/2,g=(s+c)/4,A=(l+p)/4,v=(d+h)/4;return e>a&&e>m?e<.01?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=g/n,i=A/n):a>m?a<.01?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(a),n=g/r,i=v/r):m<.01?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(m),n=A/i,r=v/i),this.set(n,r,i,t),this}let m=Math.sqrt((h-d)*(h-d)+(l-p)*(l-p)+(c-s)*(c-s));return Math.abs(m)<.001&&(m=1),this.x=(h-d)/m,this.y=(l-p)/m,this.z=(c-s)/m,this.w=Math.acos((o+u+f-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}class ke extends ye{constructor(e,t,n){super(),Object.defineProperty(this,"isWebGLRenderTarget",{value:!0}),this.width=e,this.height=t,this.scissor=new Ie(0,0,e,t),this.scissorTest=!1,this.viewport=new Ie(0,0,e,t),n=n||{},this.texture=new Re(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=e,this.texture.image.height=t,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:1006,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0!==n.stencilBuffer&&n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}setSize(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.texture.image.width=e,this.texture.image.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Pe extends ke{constructor(e,t,n){super(e,t,n),Object.defineProperty(this,"isWebGLMultisampleRenderTarget",{value:!0}),this.samples=4}copy(e){return super.copy.call(this,e),this.samples=e.samples,this}}class De{constructor(e=0,t=0,n=0,r=1){Object.defineProperty(this,"isQuaternion",{value:!0}),this._x=e,this._y=t,this._z=n,this._w=r}static slerp(e,t,n,r){return n.copy(e).slerp(t,r)}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],l=n[r+1],c=n[r+2],u=n[r+3];const d=i[a+0],p=i[a+1],h=i[a+2],f=i[a+3];if(u!==f||s!==d||l!==p||c!==h){let e=1-o;const t=s*d+l*p+c*h+u*f,n=t>=0?1:-1,r=1-t*t;if(r>Number.EPSILON){const i=Math.sqrt(r),a=Math.atan2(i,t*n);e=Math.sin(e*a)/i,o=Math.sin(o*a)/i}const i=o*n;if(s=s*e+d*i,l=l*e+p*i,c=c*e+h*i,u=u*e+f*i,e===1-o){const e=1/Math.sqrt(s*s+l*l+c*c+u*u);s*=e,l*=e,c*=e,u*=e}}e[t]=s,e[t+1]=l,e[t+2]=c,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,a){const o=n[r],s=n[r+1],l=n[r+2],c=n[r+3],u=i[a],d=i[a+1],p=i[a+2],h=i[a+3];return e[t]=o*h+c*u+s*p-l*d,e[t+1]=s*h+c*d+l*u-o*p,e[t+2]=l*h+c*p+o*d-s*u,e[t+3]=c*h-o*u-s*d-l*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,l=o(n/2),c=o(r/2),u=o(i/2),d=s(n/2),p=s(r/2),h=s(i/2);switch(a){case"XYZ":this._x=d*c*u+l*p*h,this._y=l*p*u-d*c*h,this._z=l*c*h+d*p*u,this._w=l*c*u-d*p*h;break;case"YXZ":this._x=d*c*u+l*p*h,this._y=l*p*u-d*c*h,this._z=l*c*h-d*p*u,this._w=l*c*u+d*p*h;break;case"ZXY":this._x=d*c*u-l*p*h,this._y=l*p*u+d*c*h,this._z=l*c*h+d*p*u,this._w=l*c*u-d*p*h;break;case"ZYX":this._x=d*c*u-l*p*h,this._y=l*p*u+d*c*h,this._z=l*c*h-d*p*u,this._w=l*c*u+d*p*h;break;case"YZX":this._x=d*c*u+l*p*h,this._y=l*p*u+d*c*h,this._z=l*c*h-d*p*u,this._w=l*c*u-d*p*h;break;case"XZY":this._x=d*c*u-l*p*h,this._y=l*p*u-d*c*h,this._z=l*c*h+d*p*u,this._w=l*c*u+d*p*h;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return!1!==t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],l=t[2],c=t[6],u=t[10],d=n+o+u;if(d>0){const e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(c-s)*e,this._y=(i-l)*e,this._z=(a-r)*e}else if(n>o&&n>u){const e=2*Math.sqrt(1+n-o-u);this._w=(c-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+l)/e}else if(o>u){const e=2*Math.sqrt(1+o-n-u);this._w=(i-l)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+c)/e}else{const e=2*Math.sqrt(1+u-n-o);this._w=(a-r)/e,this._x=(i+l)/e,this._y=(s+c)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-6?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(we.clamp(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,l=t._z,c=t._w;return this._x=n*c+a*o+r*l-i*s,this._y=r*c+a*s+i*o-n*l,this._z=i*c+a*l+n*s-r*o,this._w=a*c-n*o-r*s-i*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,r=this._y,i=this._z,a=this._w;let o=a*e._w+n*e._x+r*e._y+i*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=r,this._z=i,this;const s=1-o*o;if(s<=Number.EPSILON){const e=1-t;return this._w=e*a+t*this._w,this._x=e*n+t*this._x,this._y=e*r+t*this._y,this._z=e*i+t*this._z,this.normalize(),this._onChangeCallback(),this}const l=Math.sqrt(s),c=Math.atan2(l,o),u=Math.sin((1-t)*c)/l,d=Math.sin(t*c)/l;return this._w=a*u+this._w*d,this._x=n*u+this._x*d,this._y=r*u+this._y*d,this._z=i*u+this._z*d,this._onChangeCallback(),this}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}class Fe{constructor(e=0,t=0,n=0){Object.defineProperty(this,"isVector3",{value:!0}),this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return e&&e.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Ue.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Ue.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,l=s*t+a*r-o*n,c=s*n+o*t-i*r,u=s*r+i*n-a*t,d=-i*t-a*n-o*r;return this.x=l*s+d*-i+c*-o-u*-a,this.y=c*s+d*-a+u*-i-l*-o,this.z=u*s+d*-o+l*-a-c*-i,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return _e.copy(this).projectOnVector(e),this.sub(_e)}reflect(e){return this.sub(_e.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(we.clamp(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}const _e=new Fe,Ue=new De;class Le{constructor(e,t){Object.defineProperty(this,"isBox3",{value:!0}),this.min=void 0!==e?e:new Fe(1/0,1/0,1/0),this.max=void 0!==t?t:new Fe(-1/0,-1/0,-1/0)}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){let t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0;for(let s=0,l=e.length;si&&(i=l),c>a&&(a=c),u>o&&(o=u)}return this.min.set(t,n,r),this.max.set(i,a,o),this}setFromBufferAttribute(e){let t=1/0,n=1/0,r=1/0,i=-1/0,a=-1/0,o=-1/0;for(let s=0,l=e.count;si&&(i=l),c>a&&(a=c),u>o&&(o=u)}return this.min.set(t,n,r),this.max.set(i,a,o),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new Fe),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Oe),Oe.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Je),Ze.subVectors(this.max,Je),ze.subVectors(e.a,Je),Qe.subVectors(e.b,Je),je.subVectors(e.c,Je),Ge.subVectors(Qe,ze),We.subVectors(je,Qe),Ye.subVectors(ze,je);let t=[0,-Ge.z,Ge.y,0,-We.z,We.y,0,-Ye.z,Ye.y,Ge.z,0,-Ge.x,We.z,0,-We.x,Ye.z,0,-Ye.x,-Ge.y,Ge.x,0,-We.y,We.x,0,-Ye.y,Ye.x,0];return!!Ve(t,ze,Qe,je,Ze)&&(t=[1,0,0,0,1,0,0,0,1],!!Ve(t,ze,Qe,je,Ze)&&(Ke.crossVectors(Ge,We),t=[Ke.x,Ke.y,Ke.z],Ve(t,ze,Qe,je,Ze)))}clampPoint(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new Fe),t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return Oe.copy(e).clamp(this.min,this.max).sub(e).length()}getBoundingSphere(e){return void 0===e&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(e.center),e.radius=.5*this.getSize(Oe).length(),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(Ne[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ne[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ne[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ne[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ne[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ne[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ne[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ne[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ne)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}function Ve(e,t,n,r,i){for(let a=0,o=e.length-3;a<=o;a+=3){Xe.fromArray(e,a);const o=i.x*Math.abs(Xe.x)+i.y*Math.abs(Xe.y)+i.z*Math.abs(Xe.z),s=t.dot(Xe),l=n.dot(Xe),c=r.dot(Xe);if(Math.max(-Math.max(s,l,c),Math.min(s,l,c))>o)return!1}return!0}const Ne=[new Fe,new Fe,new Fe,new Fe,new Fe,new Fe,new Fe,new Fe],Oe=new Fe,He=new Le,ze=new Fe,Qe=new Fe,je=new Fe,Ge=new Fe,We=new Fe,Ye=new Fe,Je=new Fe,Ze=new Fe,Ke=new Fe,Xe=new Fe,qe=new Le;class $e{constructor(e,t){this.center=void 0!==e?e:new Fe,this.radius=void 0!==t?t:-1}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;void 0!==t?n.copy(t):qe.setFromPoints(e).getCenter(n);let r=0;for(let t=0,i=e.length;tthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new Le),this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}}const et=new Fe,tt=new Fe,nt=new Fe,rt=new Fe,it=new Fe,at=new Fe,ot=new Fe;class st{constructor(e,t){this.origin=void 0!==e?e:new Fe,this.direction=void 0!==t?t:new Fe(0,0,-1)}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new Fe),t.copy(this.direction).multiplyScalar(e).add(this.origin)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,et)),this}closestPointToPoint(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new Fe),t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(n).add(this.origin)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=et.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(et.copy(this.direction).multiplyScalar(t).add(this.origin),et.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){tt.copy(e).add(t).multiplyScalar(.5),nt.copy(t).sub(e).normalize(),rt.copy(this.origin).sub(tt);const i=.5*e.distanceTo(t),a=-this.direction.dot(nt),o=rt.dot(this.direction),s=-rt.dot(nt),l=rt.lengthSq(),c=Math.abs(1-a*a);let u,d,p,h;if(c>0)if(u=a*s-o,d=a*o-s,h=i*c,u>=0)if(d>=-h)if(d<=h){const e=1/c;u*=e,d*=e,p=u*(u+a*d+2*o)+d*(a*u+d+2*s)+l}else d=i,u=Math.max(0,-(a*d+o)),p=-u*u+d*(d+2*s)+l;else d=-i,u=Math.max(0,-(a*d+o)),p=-u*u+d*(d+2*s)+l;else d<=-h?(u=Math.max(0,-(-a*i+o)),d=u>0?-i:Math.min(Math.max(-i,-s),i),p=-u*u+d*(d+2*s)+l):d<=h?(u=0,d=Math.min(Math.max(-i,-s),i),p=d*(d+2*s)+l):(u=Math.max(0,-(a*i+o)),d=u>0?i:Math.min(Math.max(-i,-s),i),p=-u*u+d*(d+2*s)+l);else d=a>0?-i:i,u=Math.max(0,-(a*d+o)),p=-u*u+d*(d+2*s)+l;return n&&n.copy(this.direction).multiplyScalar(u).add(this.origin),r&&r.copy(nt).multiplyScalar(d).add(tt),p}intersectSphere(e,t){et.subVectors(e.center,this.origin);const n=et.dot(this.direction),r=et.dot(et)-n*n,i=e.radius*e.radius;if(r>i)return null;const a=Math.sqrt(i-r),o=n-a,s=n+a;return o<0&&s<0?null:o<0?this.at(s,t):this.at(o,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);if(0===t)return!0;return e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,a,o,s;const l=1/this.direction.x,c=1/this.direction.y,u=1/this.direction.z,d=this.origin;return l>=0?(n=(e.min.x-d.x)*l,r=(e.max.x-d.x)*l):(n=(e.max.x-d.x)*l,r=(e.min.x-d.x)*l),c>=0?(i=(e.min.y-d.y)*c,a=(e.max.y-d.y)*c):(i=(e.max.y-d.y)*c,a=(e.min.y-d.y)*c),n>a||i>r?null:((i>n||n!=n)&&(n=i),(a=0?(o=(e.min.z-d.z)*u,s=(e.max.z-d.z)*u):(o=(e.max.z-d.z)*u,s=(e.min.z-d.z)*u),n>s||o>r?null:((o>n||n!=n)&&(n=o),(s=0?n:r,t)))}intersectsBox(e){return null!==this.intersectBox(e,et)}intersectTriangle(e,t,n,r,i){it.subVectors(t,e),at.subVectors(n,e),ot.crossVectors(it,at);let a,o=this.direction.dot(ot);if(o>0){if(r)return null;a=1}else{if(!(o<0))return null;a=-1,o=-o}rt.subVectors(this.origin,e);const s=a*this.direction.dot(at.crossVectors(rt,at));if(s<0)return null;const l=a*this.direction.dot(it.cross(rt));if(l<0)return null;if(s+l>o)return null;const c=-a*rt.dot(ot);return c<0?null:this.at(c/o,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}}class lt{constructor(){Object.defineProperty(this,"isMatrix4",{value:!0}),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(e,t,n,r,i,a,o,s,l,c,u,d,p,h,f,m){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=r,g[1]=i,g[5]=a,g[9]=o,g[13]=s,g[2]=l,g[6]=c,g[10]=u,g[14]=d,g[3]=p,g[7]=h,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new lt).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,r=1/ct.setFromMatrixColumn(e,0).length(),i=1/ct.setFromMatrixColumn(e,1).length(),a=1/ct.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const t=this.elements,n=e.x,r=e.y,i=e.z,a=Math.cos(n),o=Math.sin(n),s=Math.cos(r),l=Math.sin(r),c=Math.cos(i),u=Math.sin(i);if("XYZ"===e.order){const e=a*c,n=a*u,r=o*c,i=o*u;t[0]=s*c,t[4]=-s*u,t[8]=l,t[1]=n+r*l,t[5]=e-i*l,t[9]=-o*s,t[2]=i-e*l,t[6]=r+n*l,t[10]=a*s}else if("YXZ"===e.order){const e=s*c,n=s*u,r=l*c,i=l*u;t[0]=e+i*o,t[4]=r*o-n,t[8]=a*l,t[1]=a*u,t[5]=a*c,t[9]=-o,t[2]=n*o-r,t[6]=i+e*o,t[10]=a*s}else if("ZXY"===e.order){const e=s*c,n=s*u,r=l*c,i=l*u;t[0]=e-i*o,t[4]=-a*u,t[8]=r+n*o,t[1]=n+r*o,t[5]=a*c,t[9]=i-e*o,t[2]=-a*l,t[6]=o,t[10]=a*s}else if("ZYX"===e.order){const e=a*c,n=a*u,r=o*c,i=o*u;t[0]=s*c,t[4]=r*l-n,t[8]=e*l+i,t[1]=s*u,t[5]=i*l+e,t[9]=n*l-r,t[2]=-l,t[6]=o*s,t[10]=a*s}else if("YZX"===e.order){const e=a*s,n=a*l,r=o*s,i=o*l;t[0]=s*c,t[4]=i-e*u,t[8]=r*u+n,t[1]=u,t[5]=a*c,t[9]=-o*c,t[2]=-l*c,t[6]=n*u+r,t[10]=e-i*u}else if("XZY"===e.order){const e=a*s,n=a*l,r=o*s,i=o*l;t[0]=s*c,t[4]=-u,t[8]=l*c,t[1]=e*u+i,t[5]=a*c,t[9]=n*u-r,t[2]=r*u-n,t[6]=o*c,t[10]=i*u+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(dt,e,pt)}lookAt(e,t,n){const r=this.elements;return mt.subVectors(e,t),0===mt.lengthSq()&&(mt.z=1),mt.normalize(),ht.crossVectors(n,mt),0===ht.lengthSq()&&(1===Math.abs(n.z)?mt.x+=1e-4:mt.z+=1e-4,mt.normalize(),ht.crossVectors(n,mt)),ht.normalize(),ft.crossVectors(mt,ht),r[0]=ht.x,r[4]=ft.x,r[8]=mt.x,r[1]=ht.y,r[5]=ft.y,r[9]=mt.y,r[2]=ht.z,r[6]=ft.z,r[10]=mt.z,this}multiply(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,a=n[0],o=n[4],s=n[8],l=n[12],c=n[1],u=n[5],d=n[9],p=n[13],h=n[2],f=n[6],m=n[10],g=n[14],A=n[3],v=n[7],y=n[11],b=n[15],x=r[0],w=r[4],E=r[8],S=r[12],M=r[1],T=r[5],B=r[9],R=r[13],C=r[2],I=r[6],k=r[10],P=r[14],D=r[3],F=r[7],_=r[11],U=r[15];return i[0]=a*x+o*M+s*C+l*D,i[4]=a*w+o*T+s*I+l*F,i[8]=a*E+o*B+s*k+l*_,i[12]=a*S+o*R+s*P+l*U,i[1]=c*x+u*M+d*C+p*D,i[5]=c*w+u*T+d*I+p*F,i[9]=c*E+u*B+d*k+p*_,i[13]=c*S+u*R+d*P+p*U,i[2]=h*x+f*M+m*C+g*D,i[6]=h*w+f*T+m*I+g*F,i[10]=h*E+f*B+m*k+g*_,i[14]=h*S+f*R+m*P+g*U,i[3]=A*x+v*M+y*C+b*D,i[7]=A*w+v*T+y*I+b*F,i[11]=A*E+v*B+y*k+b*_,i[15]=A*S+v*R+y*P+b*U,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],a=e[1],o=e[5],s=e[9],l=e[13],c=e[2],u=e[6],d=e[10],p=e[14];return e[3]*(+i*s*u-r*l*u-i*o*d+n*l*d+r*o*p-n*s*p)+e[7]*(+t*s*p-t*l*d+i*a*d-r*a*p+r*l*c-i*s*c)+e[11]*(+t*l*u-t*o*p-i*a*u+n*a*p+i*o*c-n*l*c)+e[15]*(-r*o*c-t*s*u+t*o*d+r*a*u-n*a*d+n*s*c)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=e[9],d=e[10],p=e[11],h=e[12],f=e[13],m=e[14],g=e[15],A=u*m*l-f*d*l+f*s*p-o*m*p-u*s*g+o*d*g,v=h*d*l-c*m*l-h*s*p+a*m*p+c*s*g-a*d*g,y=c*f*l-h*u*l+h*o*p-a*f*p-c*o*g+a*u*g,b=h*u*s-c*f*s-h*o*d+a*f*d+c*o*m-a*u*m,x=t*A+n*v+r*y+i*b;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const w=1/x;return e[0]=A*w,e[1]=(f*d*i-u*m*i-f*r*p+n*m*p+u*r*g-n*d*g)*w,e[2]=(o*m*i-f*s*i+f*r*l-n*m*l-o*r*g+n*s*g)*w,e[3]=(u*s*i-o*d*i-u*r*l+n*d*l+o*r*p-n*s*p)*w,e[4]=v*w,e[5]=(c*m*i-h*d*i+h*r*p-t*m*p-c*r*g+t*d*g)*w,e[6]=(h*s*i-a*m*i-h*r*l+t*m*l+a*r*g-t*s*g)*w,e[7]=(a*d*i-c*s*i+c*r*l-t*d*l-a*r*p+t*s*p)*w,e[8]=y*w,e[9]=(h*u*i-c*f*i-h*n*p+t*f*p+c*n*g-t*u*g)*w,e[10]=(a*f*i-h*o*i+h*n*l-t*f*l-a*n*g+t*o*g)*w,e[11]=(c*o*i-a*u*i-c*n*l+t*u*l+a*n*p-t*o*p)*w,e[12]=b*w,e[13]=(c*f*r-h*u*r+h*n*d-t*f*d-c*n*m+t*u*m)*w,e[14]=(h*o*r-a*f*r-h*n*s+t*f*s+a*n*m-t*o*m)*w,e[15]=(a*u*r-c*o*r+c*n*s-t*u*s-a*n*d+t*o*d)*w,this}scale(e){const t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),i=1-n,a=e.x,o=e.y,s=e.z,l=i*a,c=i*o;return this.set(l*a+n,l*o-r*s,l*s+r*o,0,l*o+r*s,c*o+n,c*s-r*a,0,l*s-r*o,c*s+r*a,i*s*s+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n){return this.set(1,t,n,0,e,1,n,0,e,t,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,i=t._x,a=t._y,o=t._z,s=t._w,l=i+i,c=a+a,u=o+o,d=i*l,p=i*c,h=i*u,f=a*c,m=a*u,g=o*u,A=s*l,v=s*c,y=s*u,b=n.x,x=n.y,w=n.z;return r[0]=(1-(f+g))*b,r[1]=(p+y)*b,r[2]=(h-v)*b,r[3]=0,r[4]=(p-y)*x,r[5]=(1-(d+g))*x,r[6]=(m+A)*x,r[7]=0,r[8]=(h+v)*w,r[9]=(m-A)*w,r[10]=(1-(d+f))*w,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let i=ct.set(r[0],r[1],r[2]).length();const a=ct.set(r[4],r[5],r[6]).length(),o=ct.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],ut.copy(this);const s=1/i,l=1/a,c=1/o;return ut.elements[0]*=s,ut.elements[1]*=s,ut.elements[2]*=s,ut.elements[4]*=l,ut.elements[5]*=l,ut.elements[6]*=l,ut.elements[8]*=c,ut.elements[9]*=c,ut.elements[10]*=c,t.setFromRotationMatrix(ut),n.x=i,n.y=a,n.z=o,this}makePerspective(e,t,n,r,i,a){void 0===a&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const o=this.elements,s=2*i/(t-e),l=2*i/(n-r),c=(t+e)/(t-e),u=(n+r)/(n-r),d=-(a+i)/(a-i),p=-2*a*i/(a-i);return o[0]=s,o[4]=0,o[8]=c,o[12]=0,o[1]=0,o[5]=l,o[9]=u,o[13]=0,o[2]=0,o[6]=0,o[10]=d,o[14]=p,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(e,t,n,r,i,a){const o=this.elements,s=1/(t-e),l=1/(n-r),c=1/(a-i),u=(t+e)*s,d=(n+r)*l,p=(a+i)*c;return o[0]=2*s,o[4]=0,o[8]=0,o[12]=-u,o[1]=0,o[5]=2*l,o[9]=0,o[13]=-d,o[2]=0,o[6]=0,o[10]=-2*c,o[14]=-p,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const ct=new Fe,ut=new lt,dt=new Fe(0,0,0),pt=new Fe(1,1,1),ht=new Fe,ft=new Fe,mt=new Fe;class gt{constructor(e=0,t=0,n=0,r=gt.DefaultOrder){Object.defineProperty(this,"isEuler",{value:!0}),this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._order=r||this._order,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t,n){const r=we.clamp,i=e.elements,a=i[0],o=i[4],s=i[8],l=i[1],c=i[5],u=i[9],d=i[2],p=i[6],h=i[10];switch(t=t||this._order){case"XYZ":this._y=Math.asin(r(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(-u,h),this._z=Math.atan2(-o,a)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-r(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(s,h),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,a),this._z=0);break;case"ZXY":this._x=Math.asin(r(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-d,h),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,a));break;case"ZYX":this._y=Math.asin(-r(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(p,h),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(r(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-d,a)):(this._x=0,this._y=Math.atan2(s,h));break;case"XZY":this._z=Math.asin(-r(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(s,a)):(this._x=Math.atan2(-u,h),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,!1!==n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return At.makeRotationFromQuaternion(e),this.setFromRotationMatrix(At,t,n)}setFromVector3(e,t){return this.set(e.x,e.y,e.z,t||this._order)}reorder(e){return vt.setFromEuler(this),this.setFromQuaternion(vt,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}toVector3(e){return e?e.set(this._x,this._y,this._z):new Fe(this._x,this._y,this._z)}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}}gt.DefaultOrder="XYZ",gt.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];const At=new lt,vt=new De;class yt{constructor(){this.mask=1}set(e){this.mask=1<1){for(let e=0;e1){for(let e=0;e0){r.children=[];for(let t=0;t0){r.animations=[];for(let t=0;t0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),o.length>0&&(n.images=o),s.length>0&&(n.shapes=s),l.length>0&&(n.skeletons=l),c.length>0&&(n.animations=c)}return n.object=r,n;function a(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t1?void 0:t.copy(n).multiplyScalar(i).add(e.start)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new Fe),e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||Ut.getNormalMatrix(e),r=this.coplanarPoint(Ft).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}}const Vt=new Fe,Nt=new Fe,Ot=new Fe,Ht=new Fe,zt=new Fe,Qt=new Fe,jt=new Fe,Gt=new Fe,Wt=new Fe,Yt=new Fe;class Jt{constructor(e,t,n){this.a=void 0!==e?e:new Fe,this.b=void 0!==t?t:new Fe,this.c=void 0!==n?n:new Fe}static getNormal(e,t,n,r){void 0===r&&(console.warn("THREE.Triangle: .getNormal() target is now required"),r=new Fe),r.subVectors(n,t),Vt.subVectors(e,t),r.cross(Vt);const i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){Vt.subVectors(r,t),Nt.subVectors(n,t),Ot.subVectors(e,t);const a=Vt.dot(Vt),o=Vt.dot(Nt),s=Vt.dot(Ot),l=Nt.dot(Nt),c=Nt.dot(Ot),u=a*l-o*o;if(void 0===i&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),i=new Fe),0===u)return i.set(-2,-1,-1);const d=1/u,p=(l*s-o*c)*d,h=(a*c-o*s)*d;return i.set(1-p-h,h,p)}static containsPoint(e,t,n,r){return this.getBarycoord(e,t,n,r,Ht),Ht.x>=0&&Ht.y>=0&&Ht.x+Ht.y<=1}static getUV(e,t,n,r,i,a,o,s){return this.getBarycoord(e,t,n,r,Ht),s.set(0,0),s.addScaledVector(i,Ht.x),s.addScaledVector(a,Ht.y),s.addScaledVector(o,Ht.z),s}static isFrontFacing(e,t,n,r){return Vt.subVectors(n,t),Nt.subVectors(e,t),Vt.cross(Nt).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Vt.subVectors(this.c,this.b),Nt.subVectors(this.a,this.b),.5*Vt.cross(Nt).length()}getMidpoint(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new Fe),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Jt.getNormal(this.a,this.b,this.c,e)}getPlane(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new Lt),e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Jt.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,r,i){return Jt.getUV(e,this.a,this.b,this.c,t,n,r,i)}containsPoint(e){return Jt.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Jt.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){void 0===t&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),t=new Fe);const n=this.a,r=this.b,i=this.c;let a,o;zt.subVectors(r,n),Qt.subVectors(i,n),Gt.subVectors(e,n);const s=zt.dot(Gt),l=Qt.dot(Gt);if(s<=0&&l<=0)return t.copy(n);Wt.subVectors(e,r);const c=zt.dot(Wt),u=Qt.dot(Wt);if(c>=0&&u<=c)return t.copy(r);const d=s*u-c*l;if(d<=0&&s>=0&&c<=0)return a=s/(s-c),t.copy(n).addScaledVector(zt,a);Yt.subVectors(e,i);const p=zt.dot(Yt),h=Qt.dot(Yt);if(h>=0&&p<=h)return t.copy(i);const f=p*l-s*h;if(f<=0&&l>=0&&h<=0)return o=l/(l-h),t.copy(n).addScaledVector(Qt,o);const m=c*h-p*u;if(m<=0&&u-c>=0&&p-h>=0)return jt.subVectors(i,r),o=(u-c)/(u-c+(p-h)),t.copy(r).addScaledVector(jt,o);const g=1/(m+f+d);return a=f*g,o=d*g,t.copy(n).addScaledVector(zt,a).addScaledVector(Qt,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const Zt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Kt={h:0,s:0,l:0},Xt={h:0,s:0,l:0};function qt(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}function $t(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}function en(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}class tn{constructor(e,t,n){return Object.defineProperty(this,"isColor",{value:!0}),void 0===t&&void 0===n?this.set(e):this.setRGB(e,t,n)}set(e){return e&&e.isColor?this.copy(e):"number"==typeof e?this.setHex(e):"string"==typeof e&&this.setStyle(e),this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this}setRGB(e,t,n){return this.r=e,this.g=t,this.b=n,this}setHSL(e,t,n){if(e=we.euclideanModulo(e,1),t=we.clamp(t,0,1),n=we.clamp(n,0,1),0===t)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=qt(i,r,e+1/3),this.g=qt(i,r,e),this.b=qt(i,r,e-1/3)}return this}setStyle(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(e)){let e;const r=n[1],i=n[2];switch(r){case"rgb":case"rgba":if(e=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))return this.r=Math.min(255,parseInt(e[1],10))/255,this.g=Math.min(255,parseInt(e[2],10))/255,this.b=Math.min(255,parseInt(e[3],10))/255,t(e[4]),this;if(e=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i))return this.r=Math.min(100,parseInt(e[1],10))/100,this.g=Math.min(100,parseInt(e[2],10))/100,this.b=Math.min(100,parseInt(e[3],10))/100,t(e[4]),this;break;case"hsl":case"hsla":if(e=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(i)){const n=parseFloat(e[1])/360,r=parseInt(e[2],10)/100,i=parseInt(e[3],10)/100;return t(e[4]),this.setHSL(n,r,i)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){const e=n[1],t=e.length;if(3===t)return this.r=parseInt(e.charAt(0)+e.charAt(0),16)/255,this.g=parseInt(e.charAt(1)+e.charAt(1),16)/255,this.b=parseInt(e.charAt(2)+e.charAt(2),16)/255,this;if(6===t)return this.r=parseInt(e.charAt(0)+e.charAt(1),16)/255,this.g=parseInt(e.charAt(2)+e.charAt(3),16)/255,this.b=parseInt(e.charAt(4)+e.charAt(5),16)/255,this}return e&&e.length>0?this.setColorName(e):this}setColorName(e){const t=Zt[e];return void 0!==t?this.setHex(t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copyGammaToLinear(e,t=2){return this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this}copyLinearToGamma(e,t=2){const n=t>0?1/t:1;return this.r=Math.pow(e.r,n),this.g=Math.pow(e.g,n),this.b=Math.pow(e.b,n),this}convertGammaToLinear(e){return this.copyGammaToLinear(this,e),this}convertLinearToGamma(e){return this.copyLinearToGamma(this,e),this}copySRGBToLinear(e){return this.r=$t(e.r),this.g=$t(e.g),this.b=$t(e.b),this}copyLinearToSRGB(e){return this.r=en(e.r),this.g=en(e.g),this.b=en(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});const t=this.r,n=this.g,r=this.b,i=Math.max(t,n,r),a=Math.min(t,n,r);let o,s;const l=(a+i)/2;if(a===i)o=0,s=0;else{const e=i-a;switch(s=l<=.5?e/(i+a):e/(2-i-a),i){case t:o=(n-r)/e+(n0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),t){const t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(null!==t){const e=t.length;n=new Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(an.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),on.prototype=Object.create(an.prototype),on.prototype.constructor=on,on.prototype.isMeshBasicMaterial=!0,on.prototype.copy=function(e){return an.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this};const sn=new Fe,ln=new Ee;function cn(e,t,n){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=!0===n,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0}function un(e,t,n){cn.call(this,new Int8Array(e),t,n)}function dn(e,t,n){cn.call(this,new Uint8Array(e),t,n)}function pn(e,t,n){cn.call(this,new Uint8ClampedArray(e),t,n)}function hn(e,t,n){cn.call(this,new Int16Array(e),t,n)}function fn(e,t,n){cn.call(this,new Uint16Array(e),t,n)}function mn(e,t,n){cn.call(this,new Int32Array(e),t,n)}function gn(e,t,n){cn.call(this,new Uint32Array(e),t,n)}function An(e,t,n){cn.call(this,new Uint16Array(e),t,n)}function vn(e,t,n){cn.call(this,new Float32Array(e),t,n)}function yn(e,t,n){cn.call(this,new Float64Array(e),t,n)}function bn(e){if(0===e.length)return-1/0;let t=e[0];for(let n=1,r=e.length;nt&&(t=e[n]);return t}Object.defineProperty(cn.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(cn.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;r65535?gn:fn)(e,1):this.index=e,this},getAttribute:function(e){return this.attributes[e]},setAttribute:function(e,t){return this.attributes[e]=t,this},deleteAttribute:function(e){return delete this.attributes[e],this},hasAttribute:function(e){return void 0!==this.attributes[e]},addGroup:function(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix4:function(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const t=(new Se).getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}const r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(e),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(e){return Sn.makeRotationX(e),this.applyMatrix4(Sn),this},rotateY:function(e){return Sn.makeRotationY(e),this.applyMatrix4(Sn),this},rotateZ:function(e){return Sn.makeRotationZ(e),this.applyMatrix4(Sn),this},translate:function(e,t,n){return Sn.makeTranslation(e,t,n),this.applyMatrix4(Sn),this},scale:function(e,t,n){return Sn.makeScale(e,t,n),this.applyMatrix4(Sn),this},lookAt:function(e){return Mn.lookAt(e),Mn.updateMatrix(),this.applyMatrix4(Mn.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Tn).negate(),this.translate(Tn.x,Tn.y,Tn.z),this},setFromPoints:function(e){const t=[];for(let n=0,r=e.length;n0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const t in n){const r=n[t],i=r.toJSON(e.data);""!==r.name&&(i.name=r.name),e.data.attributes[t]=i}const r={};let i=!1;for(const t in this.morphAttributes){const n=this.morphAttributes[t],a=[];for(let t=0,r=n.length;t0&&(r[t]=a,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return null!==o&&(e.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),e},clone:function(){return(new In).copy(this)},copy:function(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;null!==n&&this.setIndex(n.clone(t));const r=e.attributes;for(const e in r){const n=r[e];this.setAttribute(e,n.clone(t))}const i=e.morphAttributes;for(const e in i){const n=[],r=i[e];for(let e=0,i=r.length;en.far?null:{distance:c,point:Yn.clone(),object:e}}(e,t,n,r,Fn,_n,Un,Wn);if(h){s&&(Qn.fromBufferAttribute(s,c),jn.fromBufferAttribute(s,u),Gn.fromBufferAttribute(s,d),h.uv=Jt.getUV(Wn,Fn,_n,Un,Qn,jn,Gn,new Ee)),l&&(Qn.fromBufferAttribute(l,c),jn.fromBufferAttribute(l,u),Gn.fromBufferAttribute(l,d),h.uv2=Jt.getUV(Wn,Fn,_n,Un,Qn,jn,Gn,new Ee));const e=new nn(c,u,d);Jt.getNormal(Fn,_n,Un,e.normal),h.face=e}return h}Jn.prototype=Object.assign(Object.create(Dt.prototype),{constructor:Jn,isMesh:!0,copy:function(e){return Dt.prototype.copy.call(this,e),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=e.material,this.geometry=e.geometry,this},updateMorphTargets:function(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(e,t){const n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0===r)return;if(null===n.boundingSphere&&n.computeBoundingSphere(),Dn.copy(n.boundingSphere),Dn.applyMatrix4(i),!1===e.ray.intersectsSphere(Dn))return;if(kn.copy(i).invert(),Pn.copy(e.ray).applyMatrix4(kn),null!==n.boundingBox&&!1===Pn.intersectsBox(n.boundingBox))return;let a;if(n.isBufferGeometry){const i=n.index,o=n.attributes.position,s=n.morphAttributes.position,l=n.morphTargetsRelative,c=n.attributes.uv,u=n.attributes.uv2,d=n.groups,p=n.drawRange;if(null!==i)if(Array.isArray(r))for(let n=0,h=d.length;n0?1:-1,c.push(B.x,B.y,B.z),u.push(s/m),u.push(1-a/g),M+=1}}for(let e=0;e0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader;const n={};for(const e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t},tr.prototype=Object.assign(Object.create(Dt.prototype),{constructor:tr,isCamera:!0,copy:function(e,t){return Dt.prototype.copy.call(this,e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this},getWorldDirection:function(e){void 0===e&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),e=new Fe),this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()},updateMatrixWorld:function(e){Dt.prototype.updateMatrixWorld.call(this,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()},updateWorldMatrix:function(e,t){Dt.prototype.updateWorldMatrix.call(this,e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()},clone:function(){return(new this.constructor).copy(this)}}),nr.prototype=Object.assign(Object.create(tr.prototype),{constructor:nr,isPerspectiveCamera:!0,copy:function(e,t){return tr.prototype.copy.call(this,e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this},setFocalLength:function(e){const t=.5*this.getFilmHeight()/e;this.fov=2*we.RAD2DEG*Math.atan(t),this.updateProjectionMatrix()},getFocalLength:function(){const e=Math.tan(.5*we.DEG2RAD*this.fov);return.5*this.getFilmHeight()/e},getEffectiveFOV:function(){return 2*we.RAD2DEG*Math.atan(Math.tan(.5*we.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(e,t,n,r,i,a){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){const e=this.near;let t=e*Math.tan(.5*we.DEG2RAD*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r;const a=this.view;if(null!==this.view&&this.view.enabled){const e=a.fullWidth,o=a.fullHeight;i+=a.offsetX*r/e,t-=a.offsetY*n/o,r*=a.width/e,n*=a.height/o}const o=this.filmOffset;0!==o&&(i+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()},toJSON:function(e){const t=Dt.prototype.toJSON.call(this,e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}});function rr(e,t,n){if(Dt.call(this),this.type="CubeCamera",!0!==n.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=n;const r=new nr(90,1,e,t);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new Fe(1,0,0)),this.add(r);const i=new nr(90,1,e,t);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new Fe(-1,0,0)),this.add(i);const a=new nr(90,1,e,t);a.layers=this.layers,a.up.set(0,0,1),a.lookAt(new Fe(0,1,0)),this.add(a);const o=new nr(90,1,e,t);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new Fe(0,-1,0)),this.add(o);const s=new nr(90,1,e,t);s.layers=this.layers,s.up.set(0,-1,0),s.lookAt(new Fe(0,0,1)),this.add(s);const l=new nr(90,1,e,t);l.layers=this.layers,l.up.set(0,-1,0),l.lookAt(new Fe(0,0,-1)),this.add(l),this.update=function(e,t){null===this.parent&&this.updateMatrixWorld();const c=e.xr.enabled,u=e.getRenderTarget();e.xr.enabled=!1;const d=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,r),e.setRenderTarget(n,1),e.render(t,i),e.setRenderTarget(n,2),e.render(t,a),e.setRenderTarget(n,3),e.render(t,o),e.setRenderTarget(n,4),e.render(t,s),n.texture.generateMipmaps=d,e.setRenderTarget(n,5),e.render(t,l),e.setRenderTarget(u),e.xr.enabled=c}}function ir(e,t,n,r,i,a,o,s,l,c){e=void 0!==e?e:[],t=void 0!==t?t:301,o=void 0!==o?o:1022,Re.call(this,e,t,n,r,i,a,o,s,l,c),this.flipY=!1,this._needsFlipEnvMap=!0}rr.prototype=Object.create(Dt.prototype),rr.prototype.constructor=rr,ir.prototype=Object.create(Re.prototype),ir.prototype.constructor=ir,ir.prototype.isCubeTexture=!0,Object.defineProperty(ir.prototype,"images",{get:function(){return this.image},set:function(e){this.image=e}});class ar extends ke{constructor(e,t,n){Number.isInteger(t)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),t=n),super(e,e,t),Object.defineProperty(this,"isWebGLCubeRenderTarget",{value:!0}),t=t||{},this.texture=new ir(void 0,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.encoding),this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.format=1023,this.texture.encoding=t.encoding,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},r=new Kn(5,5,5),i=new er({name:"CubemapFromEquirect",uniforms:Xn(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:1,blending:0});i.uniforms.tEquirect.value=t;const a=new Jn(r,i),o=t.minFilter;1008===t.minFilter&&(t.minFilter=1006);return new rr(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t,n,r){const i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,r);e.setRenderTarget(i)}}function or(e,t,n,r,i,a,o,s,l,c,u,d){Re.call(this,null,a,o,s,l,c,r,i,u,d),this.image={data:e||null,width:t||1,height:n||1},this.magFilter=void 0!==l?l:1003,this.minFilter=void 0!==c?c:1003,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}or.prototype=Object.create(Re.prototype),or.prototype.constructor=or,or.prototype.isDataTexture=!0;const sr=new $e,lr=new Fe;class cr{constructor(e,t,n,r,i,a){this.planes=[void 0!==e?e:new Lt,void 0!==t?t:new Lt,void 0!==n?n:new Lt,void 0!==r?r:new Lt,void 0!==i?i:new Lt,void 0!==a?a:new Lt]}set(e,t,n,r,i,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(r),o[4].copy(i),o[5].copy(a),this}clone(){return(new this.constructor).copy(this)}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e){const t=this.planes,n=e.elements,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],l=n[5],c=n[6],u=n[7],d=n[8],p=n[9],h=n[10],f=n[11],m=n[12],g=n[13],A=n[14],v=n[15];return t[0].setComponents(o-r,u-s,f-d,v-m).normalize(),t[1].setComponents(o+r,u+s,f+d,v+m).normalize(),t[2].setComponents(o+i,u+l,f+p,v+g).normalize(),t[3].setComponents(o-i,u-l,f-p,v-g).normalize(),t[4].setComponents(o-a,u-c,f-h,v-A).normalize(),t[5].setComponents(o+a,u+c,f+h,v+A).normalize(),this}intersectsObject(e){const t=e.geometry;return null===t.boundingSphere&&t.computeBoundingSphere(),sr.copy(t.boundingSphere).applyMatrix4(e.matrixWorld),this.intersectsSphere(sr)}intersectsSprite(e){return sr.center.set(0,0,0),sr.radius=.7071067811865476,sr.applyMatrix4(e.matrixWorld),this.intersectsSphere(sr)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++){if(t[e].distanceToPoint(n)0?e.max.x:e.min.x,lr.y=r.normal.y>0?e.max.y:e.min.y,lr.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(lr)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}}function ur(){let e=null,t=!1,n=null,r=null;function i(t,a){n(t,a),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function dr(e,t){const n=t.isWebGL2,r=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),r.get(e)},remove:function(t){t.isInterleavedBufferAttribute&&(t=t.data);const n=r.get(t);n&&(e.deleteBuffer(n.buffer),r.delete(t))},update:function(t,i){if(t.isGLBufferAttribute){const e=r.get(t);return void((!e||e.version 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor.xyz *= color.xyz;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmissionmap_fragment:"#ifdef USE_TRANSMISSIONMAP\n\ttotalTransmission *= texture2D( transmissionMap, vUv ).r;\n#endif",transmissionmap_pars_fragment:"#ifdef USE_TRANSMISSIONMAP\n\tuniform sampler2D transmissionMap;\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvHighPrecisionZW = gl_Position.zw;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSMISSION\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSMISSION\n\tuniform float transmission;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#ifdef TRANSMISSION\n\t\tfloat totalTransmission = transmission;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSMISSION\n\t\tdiffuseColor.a *= mix( saturate( 1. - totalTransmission + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) ), 1.0, metalness );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n\t#include \n\t#include \n}",shadow_vert:"#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"},fr={common:{diffuse:{value:new tn(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new Se},uv2Transform:{value:new Se},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Ee(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new tn(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new tn(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Se}},sprite:{diffuse:{value:new tn(15658734)},opacity:{value:1},center:{value:new Ee(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Se}}},mr={basic:{uniforms:qn([fr.common,fr.specularmap,fr.envmap,fr.aomap,fr.lightmap,fr.fog]),vertexShader:hr.meshbasic_vert,fragmentShader:hr.meshbasic_frag},lambert:{uniforms:qn([fr.common,fr.specularmap,fr.envmap,fr.aomap,fr.lightmap,fr.emissivemap,fr.fog,fr.lights,{emissive:{value:new tn(0)}}]),vertexShader:hr.meshlambert_vert,fragmentShader:hr.meshlambert_frag},phong:{uniforms:qn([fr.common,fr.specularmap,fr.envmap,fr.aomap,fr.lightmap,fr.emissivemap,fr.bumpmap,fr.normalmap,fr.displacementmap,fr.fog,fr.lights,{emissive:{value:new tn(0)},specular:{value:new tn(1118481)},shininess:{value:30}}]),vertexShader:hr.meshphong_vert,fragmentShader:hr.meshphong_frag},standard:{uniforms:qn([fr.common,fr.envmap,fr.aomap,fr.lightmap,fr.emissivemap,fr.bumpmap,fr.normalmap,fr.displacementmap,fr.roughnessmap,fr.metalnessmap,fr.fog,fr.lights,{emissive:{value:new tn(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:hr.meshphysical_vert,fragmentShader:hr.meshphysical_frag},toon:{uniforms:qn([fr.common,fr.aomap,fr.lightmap,fr.emissivemap,fr.bumpmap,fr.normalmap,fr.displacementmap,fr.gradientmap,fr.fog,fr.lights,{emissive:{value:new tn(0)}}]),vertexShader:hr.meshtoon_vert,fragmentShader:hr.meshtoon_frag},matcap:{uniforms:qn([fr.common,fr.bumpmap,fr.normalmap,fr.displacementmap,fr.fog,{matcap:{value:null}}]),vertexShader:hr.meshmatcap_vert,fragmentShader:hr.meshmatcap_frag},points:{uniforms:qn([fr.points,fr.fog]),vertexShader:hr.points_vert,fragmentShader:hr.points_frag},dashed:{uniforms:qn([fr.common,fr.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:hr.linedashed_vert,fragmentShader:hr.linedashed_frag},depth:{uniforms:qn([fr.common,fr.displacementmap]),vertexShader:hr.depth_vert,fragmentShader:hr.depth_frag},normal:{uniforms:qn([fr.common,fr.bumpmap,fr.normalmap,fr.displacementmap,{opacity:{value:1}}]),vertexShader:hr.normal_vert,fragmentShader:hr.normal_frag},sprite:{uniforms:qn([fr.sprite,fr.fog]),vertexShader:hr.sprite_vert,fragmentShader:hr.sprite_frag},background:{uniforms:{uvTransform:{value:new Se},t2D:{value:null}},vertexShader:hr.background_vert,fragmentShader:hr.background_frag},cube:{uniforms:qn([fr.envmap,{opacity:{value:1}}]),vertexShader:hr.cube_vert,fragmentShader:hr.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:hr.equirect_vert,fragmentShader:hr.equirect_frag},distanceRGBA:{uniforms:qn([fr.common,fr.displacementmap,{referencePosition:{value:new Fe},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:hr.distanceRGBA_vert,fragmentShader:hr.distanceRGBA_frag},shadow:{uniforms:qn([fr.lights,fr.fog,{color:{value:new tn(0)},opacity:{value:1}}]),vertexShader:hr.shadow_vert,fragmentShader:hr.shadow_frag}};function gr(e,t,n,r,i){const a=new tn(0);let o,s,l=0,c=null,u=0,d=null;function p(e,t){n.buffers.color.setClear(e.r,e.g,e.b,t,i)}return{getClearColor:function(){return a},setClearColor:function(e,t=1){a.set(e),l=t,p(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(e){l=e,p(a,l)},render:function(n,i,h,f){let m=!0===i.isScene?i.background:null;m&&m.isTexture&&(m=t.get(m));const g=e.xr,A=g.getSession&&g.getSession();A&&"additive"===A.environmentBlendMode&&(m=null),null===m?p(a,l):m&&m.isColor&&(p(m,1),f=!0),(e.autoClear||f)&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),m&&(m.isCubeTexture||m.isWebGLCubeRenderTarget||306===m.mapping)?(void 0===s&&(s=new Jn(new Kn(1,1,1),new er({name:"BackgroundCubeMaterial",uniforms:Xn(mr.cube.uniforms),vertexShader:mr.cube.vertexShader,fragmentShader:mr.cube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1})),s.geometry.deleteAttribute("normal"),s.geometry.deleteAttribute("uv"),s.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(s.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),r.update(s)),m.isWebGLCubeRenderTarget&&(m=m.texture),s.material.uniforms.envMap.value=m,s.material.uniforms.flipEnvMap.value=m.isCubeTexture&&m._needsFlipEnvMap?-1:1,c===m&&u===m.version&&d===e.toneMapping||(s.material.needsUpdate=!0,c=m,u=m.version,d=e.toneMapping),n.unshift(s,s.geometry,s.material,0,0,null)):m&&m.isTexture&&(void 0===o&&(o=new Jn(new pr(2,2),new er({name:"BackgroundMaterial",uniforms:Xn(mr.background.uniforms),vertexShader:mr.background.vertexShader,fragmentShader:mr.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1})),o.geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),r.update(o)),o.material.uniforms.t2D.value=m,!0===m.matrixAutoUpdate&&m.updateMatrix(),o.material.uniforms.uvTransform.value.copy(m.matrix),c===m&&u===m.version&&d===e.toneMapping||(o.material.needsUpdate=!0,c=m,u=m.version,d=e.toneMapping),n.unshift(o,o.geometry,o.material,0,0,null))}}}function Ar(e,t,n,r){const i=e.getParameter(34921),a=r.isWebGL2?null:t.get("OES_vertex_array_object"),o=r.isWebGL2||null!==a,s={},l=p(null);let c=l;function u(t){return r.isWebGL2?e.bindVertexArray(t):a.bindVertexArrayOES(t)}function d(t){return r.isWebGL2?e.deleteVertexArray(t):a.deleteVertexArrayOES(t)}function p(e){const t=[],n=[],r=[];for(let e=0;e=0){const a=l[t];if(void 0!==a){const t=a.normalized,i=a.itemSize,o=n.get(a);if(void 0===o)continue;const l=o.buffer,c=o.type,u=o.bytesPerElement;if(a.isInterleavedBufferAttribute){const n=a.data,o=n.stride,d=a.offset;n&&n.isInstancedInterleavedBuffer?(m(r,n.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=n.meshPerAttribute*n.count)):f(r),e.bindBuffer(34962,l),A(r,i,c,t,o*u,d*u)}else a.isInstancedBufferAttribute?(m(r,a.meshPerAttribute),void 0===s._maxInstanceCount&&(s._maxInstanceCount=a.meshPerAttribute*a.count)):f(r),e.bindBuffer(34962,l),A(r,i,c,t,0,0)}else if("instanceMatrix"===t){const t=n.get(i.instanceMatrix);if(void 0===t)continue;const a=t.buffer,o=t.type;m(r+0,1),m(r+1,1),m(r+2,1),m(r+3,1),e.bindBuffer(34962,a),e.vertexAttribPointer(r+0,4,o,!1,64,0),e.vertexAttribPointer(r+1,4,o,!1,64,16),e.vertexAttribPointer(r+2,4,o,!1,64,32),e.vertexAttribPointer(r+3,4,o,!1,64,48)}else if("instanceColor"===t){const t=n.get(i.instanceColor);if(void 0===t)continue;const a=t.buffer,o=t.type;m(r,1),e.bindBuffer(34962,a),e.vertexAttribPointer(r,3,o,!1,12,0)}else if(void 0!==u){const n=u[t];if(void 0!==n)switch(n.length){case 2:e.vertexAttrib2fv(r,n);break;case 3:e.vertexAttrib3fv(r,n);break;case 4:e.vertexAttrib4fv(r,n);break;default:e.vertexAttrib1fv(r,n)}}}}g()}(i,l,d,v),null!==y&&e.bindBuffer(34963,n.get(y).buffer))},reset:v,resetDefaultState:y,dispose:function(){v();for(const e in s){const t=s[e];for(const e in t){const n=t[e];for(const e in n)d(n[e].object),delete n[e];delete t[e]}delete s[e]}},releaseStatesOfGeometry:function(e){if(void 0===s[e.id])return;const t=s[e.id];for(const e in t){const n=t[e];for(const e in n)d(n[e].object),delete n[e];delete t[e]}delete s[e.id]},releaseStatesOfProgram:function(e){for(const t in s){const n=s[t];if(void 0===n[e.id])continue;const r=n[e.id];for(const e in r)d(r[e].object),delete r[e];delete n[e.id]}},initAttributes:h,enableAttribute:f,disableUnusedAttributes:g}}function vr(e,t,n,r){const i=r.isWebGL2;let a;this.setMode=function(e){a=e},this.render=function(t,r){e.drawArrays(a,t,r),n.update(r,a,1)},this.renderInstances=function(r,o,s){if(0===s)return;let l,c;if(i)l=e,c="drawArraysInstanced";else if(l=t.get("ANGLE_instanced_arrays"),c="drawArraysInstancedANGLE",null===l)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");l[c](a,r,o,s),n.update(o,a,s)}}function yr(e,t,n){let r;function i(t){if("highp"===t){if(e.getShaderPrecisionFormat(35633,36338).precision>0&&e.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(35633,36337).precision>0&&e.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const a="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&e instanceof WebGL2ComputeRenderingContext;let o=void 0!==n.precision?n.precision:"highp";const s=i(o);s!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",s,"instead."),o=s);const l=!0===n.logarithmicDepthBuffer,c=e.getParameter(34930),u=e.getParameter(35660),d=e.getParameter(3379),p=e.getParameter(34076),h=e.getParameter(34921),f=e.getParameter(36347),m=e.getParameter(36348),g=e.getParameter(36349),A=u>0,v=a||!!t.get("OES_texture_float");return{isWebGL2:a,getMaxAnisotropy:function(){if(void 0!==r)return r;const n=t.get("EXT_texture_filter_anisotropic");return r=null!==n?e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,r},getMaxPrecision:i,precision:o,logarithmicDepthBuffer:l,maxTextures:c,maxVertexTextures:u,maxTextureSize:d,maxCubemapSize:p,maxAttributes:h,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:A,floatFragmentTextures:v,floatVertexTextures:A&&v,maxSamples:a?e.getParameter(36183):0}}function br(e){const t=this;let n=null,r=0,i=!1,a=!1;const o=new Lt,s=new Se,l={value:null,needsUpdate:!1};function c(){l.value!==n&&(l.value=n,l.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0}function u(e,n,r,i){const a=null!==e?e.length:0;let c=null;if(0!==a){if(c=l.value,!0!==i||null===c){const t=r+4*a,i=n.matrixWorldInverse;s.getNormalMatrix(i),(null===c||c.length0){const o=e.getRenderList(),s=e.getRenderTarget(),l=new ar(a.height/2);return l.fromEquirectangularTexture(e,i),t.set(i,l),e.setRenderTarget(s),e.setRenderList(o),i.addEventListener("dispose",r),n(l.texture,i.mapping)}return null}}}return i},dispose:function(){t=new WeakMap}}}function wr(e){const t={};function n(n){if(void 0!==t[n])return t[n];let r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return t[n]=r,r}return{has:function(e){return null!==n(e)},init:function(e){e.isWebGL2?n("EXT_color_buffer_float"):(n("WEBGL_depth_texture"),n("OES_texture_float"),n("OES_texture_half_float"),n("OES_texture_half_float_linear"),n("OES_standard_derivatives"),n("OES_element_index_uint"),n("OES_vertex_array_object"),n("ANGLE_instanced_arrays")),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float")},get:function(e){const t=n(e);return null===t&&console.warn("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function Er(e,t,n,r){const i={},a=new WeakMap;function o(e){const s=e.target;null!==s.index&&t.remove(s.index);for(const e in s.attributes)t.remove(s.attributes[e]);s.removeEventListener("dispose",o),delete i[s.id];const l=a.get(s);l&&(t.remove(l),a.delete(s)),r.releaseStatesOfGeometry(s),!0===s.isInstancedBufferGeometry&&delete s._maxInstanceCount,n.memory.geometries--}function s(e){const n=[],r=e.index,i=e.attributes.position;let o=0;if(null!==r){const e=r.array;o=r.version;for(let t=0,r=e.length;t65535?gn:fn)(n,1);s.version=o;const l=a.get(e);l&&t.remove(l),a.set(e,s)}return{get:function(e,t){return!0===i[t.id]||(t.addEventListener("dispose",o),i[t.id]=!0,n.memory.geometries++),t},update:function(e){const n=e.attributes;for(const e in n)t.update(n[e],34962);const r=e.morphAttributes;for(const e in r){const n=r[e];for(let e=0,r=n.length;e0)return e;const i=t*n;let a=Ur[i];if(void 0===a&&(a=new Float32Array(i),Ur[i]=a),0!==t){r.toArray(a,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(a,i)}return a}function zr(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n/gm;function Vi(e){return e.replace(Li,Ni)}function Ni(e,t){const n=hr[t];if(void 0===n)throw new Error("Can not resolve #include <"+t+">");return Vi(n)}const Oi=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Hi=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function zi(e){return e.replace(Hi,ji).replace(Oi,Qi)}function Qi(e,t,n,r){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),ji(e,t,n,r)}function ji(e,t,n,r){let i="";for(let e=parseInt(t);e0?e.gammaFactor:1,h=n.isWebGL2?"":function(e){return[e.extensionDerivatives||e.envMapCubeUV||e.bumpMap||e.tangentSpaceNormalMap||e.clearcoatNormalMap||e.flatShading||"physical"===e.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(e.extensionFragDepth||e.logarithmicDepthBuffer)&&e.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",e.extensionDrawBuffers&&e.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(e.extensionShaderTextureLOD||e.envMap)&&e.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Fi).join("\n")}(n),f=function(e){const t=[];for(const n in e){const r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(a),m=i.createProgram();let g,A,v=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(g=[f].filter(Fi).join("\n"),g.length>0&&(g+="\n"),A=[h,f].filter(Fi).join("\n"),A.length>0&&(A+="\n")):(g=[Gi(n),"#define SHADER_NAME "+n.shaderName,f,n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+p,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Fi).join("\n"),A=[h,Gi(n),"#define SHADER_NAME "+n.shaderName,f,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+c:"",n.envMap?"#define "+u:"",n.envMap?"#define "+d:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?hr.tonemapping_pars_fragment:"",0!==n.toneMapping?Di("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",hr.encodings_pars_fragment,n.map?ki("mapTexelToLinear",n.mapEncoding):"",n.matcap?ki("matcapTexelToLinear",n.matcapEncoding):"",n.envMap?ki("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?ki("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMap?ki("lightMapTexelToLinear",n.lightMapEncoding):"",Pi("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Fi).join("\n")),o=Vi(o),o=_i(o,n),o=Ui(o,n),s=Vi(s),s=_i(s,n),s=Ui(s,n),o=zi(o),s=zi(s),n.isWebGL2&&!0!==n.isRawShaderMaterial&&(v="#version 300 es\n",g=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,A=["#define varying in","300 es"===n.glslVersion?"":"out highp vec4 pc_fragColor;","300 es"===n.glslVersion?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+A);const y=v+A+s,b=Bi(i,35633,v+g+o),x=Bi(i,35632,y);if(i.attachShader(m,b),i.attachShader(m,x),void 0!==n.index0AttributeName?i.bindAttribLocation(m,0,n.index0AttributeName):!0===n.morphTargets&&i.bindAttribLocation(m,0,"position"),i.linkProgram(m),e.debug.checkShaderErrors){const e=i.getProgramInfoLog(m).trim(),t=i.getShaderInfoLog(b).trim(),n=i.getShaderInfoLog(x).trim();let r=!0,a=!0;if(!1===i.getProgramParameter(m,35714)){r=!1;const t=Ii(i,b,"vertex"),n=Ii(i,x,"fragment");console.error("THREE.WebGLProgram: shader error: ",i.getError(),"35715",i.getProgramParameter(m,35715),"gl.getProgramInfoLog",e,t,n)}else""!==e?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",e):""!==t&&""!==n||(a=!1);a&&(this.diagnostics={runnable:r,programLog:e,vertexShader:{log:t,prefix:g},fragmentShader:{log:n,prefix:A}})}let w,E;return i.deleteShader(b),i.deleteShader(x),this.getUniforms=function(){return void 0===w&&(w=new Ti(i,m)),w},this.getAttributes=function(){return void 0===E&&(E=function(e,t){const n={},r=e.getProgramParameter(t,35721);for(let i=0;i0,maxBones:w,useVertexTexture:c,morphTargets:i.morphTargets,morphNormals:i.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:i.dithering,shadowMapEnabled:e.shadowMap.enabled&&f.length>0,shadowMapType:e.shadowMap.type,toneMapping:i.toneMapped?e.toneMapping:0,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:i.premultipliedAlpha,alphaTest:i.alphaTest,doubleSided:2===i.side,flipSided:1===i.side,depthPacking:void 0!==i.depthPacking&&i.depthPacking,index0AttributeName:i.index0AttributeName,extensionDerivatives:i.extensions&&i.extensions.derivatives,extensionFragDepth:i.extensions&&i.extensions.fragDepth,extensionDrawBuffers:i.extensions&&i.extensions.drawBuffers,extensionShaderTextureLOD:i.extensions&&i.extensions.shaderTextureLOD,rendererExtensionFragDepth:s||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:s||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:s||n.has("EXT_shader_texture_lod"),customProgramCacheKey:i.customProgramCacheKey()}},getProgramCacheKey:function(t){const n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(const e in t.defines)n.push(e),n.push(t.defines[e]);if(!1===t.isRawShaderMaterial){for(let e=0;e1&&r.sort(e||Zi),i.length>1&&i.sort(t||Ki)}}}function qi(e){let t=new WeakMap;return{get:function(n,r){const i=t.get(n);let a;return void 0===i?(a=new Xi(e),t.set(n,new WeakMap),t.get(n).set(r,a)):(a=i.get(r),void 0===a&&(a=new Xi(e),i.set(r,a))),a},dispose:function(){t=new WeakMap}}}function $i(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new Fe,color:new tn};break;case"SpotLight":n={position:new Fe,direction:new Fe,color:new tn,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Fe,color:new tn,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Fe,skyColor:new tn,groundColor:new tn};break;case"RectAreaLight":n={color:new tn,position:new Fe,halfWidth:new Fe,halfHeight:new Fe}}return e[t.id]=n,n}}}let ea=0;function ta(e,t){return(t.castShadow?1:0)-(e.castShadow?1:0)}function na(e,t){const n=new $i,r=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ee};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ee,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let e=0;e<9;e++)i.probe.push(new Fe);const a=new Fe,o=new lt,s=new lt;return{setup:function(a){let o=0,s=0,l=0;for(let e=0;e<9;e++)i.probe[e].set(0,0,0);let c=0,u=0,d=0,p=0,h=0,f=0,m=0,g=0;a.sort(ta);for(let e=0,t=a.length;e0&&(t.isWebGL2||!0===e.has("OES_texture_float_linear")?(i.rectAreaLTC1=fr.LTC_FLOAT_1,i.rectAreaLTC2=fr.LTC_FLOAT_2):!0===e.has("OES_texture_half_float_linear")?(i.rectAreaLTC1=fr.LTC_HALF_1,i.rectAreaLTC2=fr.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=o,i.ambient[1]=s,i.ambient[2]=l;const A=i.hash;A.directionalLength===c&&A.pointLength===u&&A.spotLength===d&&A.rectAreaLength===p&&A.hemiLength===h&&A.numDirectionalShadows===f&&A.numPointShadows===m&&A.numSpotShadows===g||(i.directional.length=c,i.spot.length=d,i.rectArea.length=p,i.point.length=u,i.hemi.length=h,i.directionalShadow.length=f,i.directionalShadowMap.length=f,i.pointShadow.length=m,i.pointShadowMap.length=m,i.spotShadow.length=g,i.spotShadowMap.length=g,i.directionalShadowMatrix.length=f,i.pointShadowMatrix.length=m,i.spotShadowMatrix.length=g,A.directionalLength=c,A.pointLength=u,A.spotLength=d,A.rectAreaLength=p,A.hemiLength=h,A.numDirectionalShadows=f,A.numPointShadows=m,A.numSpotShadows=g,i.version=ea++)},setupView:function(e,t){let n=0,r=0,l=0,c=0,u=0;const d=t.matrixWorldInverse;for(let t=0,p=e.length;t=n.get(r).length?(a=new ra(e,t),n.get(r).push(a)):a=n.get(r)[i],a},dispose:function(){n=new WeakMap}}}function aa(e){an.call(this),this.type="MeshDepthMaterial",this.depthPacking=3200,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(e)}function oa(e){an.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Fe,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(e)}aa.prototype=Object.create(an.prototype),aa.prototype.constructor=aa,aa.prototype.isMeshDepthMaterial=!0,aa.prototype.copy=function(e){return an.prototype.copy.call(this,e),this.depthPacking=e.depthPacking,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this},oa.prototype=Object.create(an.prototype),oa.prototype.constructor=oa,oa.prototype.isMeshDistanceMaterial=!0,oa.prototype.copy=function(e){return an.prototype.copy.call(this,e),this.referencePosition.copy(e.referencePosition),this.nearDistance=e.nearDistance,this.farDistance=e.farDistance,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this};function sa(e,t,n){let r=new cr;const i=new Ee,a=new Ee,o=new Ie,s=[],l=[],c={},u={0:1,1:0,2:2},d=new er({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ee},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),p=d.clone();p.defines.HORIZONTAL_PASS=1;const h=new In;h.setAttribute("position",new cn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const f=new Jn(h,d),m=this;function g(n,r){const i=t.update(f);d.uniforms.shadow_pass.value=n.map.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,i,d,f,null),p.uniforms.shadow_pass.value=n.mapPass.texture,p.uniforms.resolution.value=n.mapSize,p.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,i,p,f,null)}function A(e,t,n){const r=e<<0|t<<1|n<<2;let i=s[r];return void 0===i&&(i=new aa({depthPacking:3201,morphTargets:e,skinning:t}),s[r]=i),i}function v(e,t,n){const r=e<<0|t<<1|n<<2;let i=l[r];return void 0===i&&(i=new oa({morphTargets:e,skinning:t}),l[r]=i),i}function y(t,n,r,i,a,o,s){let l=null,d=A,p=t.customDepthMaterial;if(!0===i.isPointLight&&(d=v,p=t.customDistanceMaterial),void 0===p){let e=!1;!0===r.morphTargets&&(e=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);let i=!1;!0===t.isSkinnedMesh&&(!0===r.skinning?i=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t));l=d(e,i,!0===t.isInstancedMesh)}else l=p;if(e.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length){const e=l.uuid,t=r.uuid;let n=c[e];void 0===n&&(n={},c[e]=n);let i=n[t];void 0===i&&(i=l.clone(),n[t]=i),l=i}return l.visible=r.visible,l.wireframe=r.wireframe,l.side=3===s?null!==r.shadowSide?r.shadowSide:r.side:null!==r.shadowSide?r.shadowSide:u[r.side],l.clipShadows=r.clipShadows,l.clippingPlanes=r.clippingPlanes,l.clipIntersection=r.clipIntersection,l.wireframeLinewidth=r.wireframeLinewidth,l.linewidth=r.linewidth,!0===i.isPointLight&&!0===l.isMeshDistanceMaterial&&(l.referencePosition.setFromMatrixPosition(i.matrixWorld),l.nearDistance=a,l.farDistance=o),l}function b(n,i,a,o,s){if(!1===n.visible)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===s)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(a.matrixWorldInverse,n.matrixWorld);const r=t.update(n),i=n.material;if(Array.isArray(i)){const t=r.groups;for(let l=0,c=t.length;ln||i.y>n)&&(i.x>n&&(a.x=Math.floor(n/h.x),i.x=a.x*h.x,d.mapSize.x=a.x),i.y>n&&(a.y=Math.floor(n/h.y),i.y=a.y*h.y,d.mapSize.y=a.y)),null===d.map&&!d.isPointLightShadow&&3===this.type){const e={minFilter:1006,magFilter:1006,format:1023};d.map=new ke(i.x,i.y,e),d.map.texture.name=u.name+".shadowMap",d.mapPass=new ke(i.x,i.y,e),d.camera.updateProjectionMatrix()}if(null===d.map){const e={minFilter:1003,magFilter:1003,format:1023};d.map=new ke(i.x,i.y,e),d.map.texture.name=u.name+".shadowMap",d.camera.updateProjectionMatrix()}e.setRenderTarget(d.map),e.clear();const f=d.getViewportCount();for(let e=0;e=1):-1!==T.indexOf("OpenGL ES")&&(M=parseFloat(/^OpenGL ES (\d)/.exec(T)[1]),S=M>=2);let B=null,R={};const C=new Ie,I=new Ie;function k(t,n,r){const i=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,10241,9728),e.texParameteri(t,10240,9728);for(let t=0;tr||e.height>r)&&(i=r/Math.max(e.width,e.height)),i<1||!0===t){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const r=t?we.floorPowerOfTwo:Math.floor,a=r(i*e.width),o=r(i*e.height);void 0===h&&(h=m(a,o));const s=n?m(a,o):h;s.width=a,s.height=o;return s.getContext("2d").drawImage(e,0,0,a,o),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+e.width+"x"+e.height+") to ("+a+"x"+o+")."),s}return"data"in e&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+e.width+"x"+e.height+")."),e}return e}function A(e){return we.isPowerOfTwo(e.width)&&we.isPowerOfTwo(e.height)}function v(e,t){return e.generateMipmaps&&t&&1003!==e.minFilter&&1006!==e.minFilter}function y(t,n,i,a){e.generateMipmap(t);r.get(n).__maxMipLevel=Math.log(Math.max(i,a))*Math.LOG2E}function b(n,r,i){if(!1===s)return r;if(null!==n){if(void 0!==e[n])return e[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let a=r;return 6403===r&&(5126===i&&(a=33326),5131===i&&(a=33325),5121===i&&(a=33321)),6407===r&&(5126===i&&(a=34837),5131===i&&(a=34843),5121===i&&(a=32849)),6408===r&&(5126===i&&(a=34836),5131===i&&(a=34842),5121===i&&(a=32856)),33325!==a&&33326!==a&&34842!==a&&34836!==a||t.get("EXT_color_buffer_float"),a}function x(e){return 1003===e||1004===e||1005===e?9728:9729}function w(t){const n=t.target;n.removeEventListener("dispose",w),function(t){const n=r.get(t);if(void 0===n.__webglInit)return;e.deleteTexture(n.__webglTexture),r.remove(t)}(n),n.isVideoTexture&&p.delete(n),o.memory.textures--}function E(t){const n=t.target;n.removeEventListener("dispose",E),function(t){const n=r.get(t),i=r.get(t.texture);if(!t)return;void 0!==i.__webglTexture&&e.deleteTexture(i.__webglTexture);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLCubeRenderTarget)for(let t=0;t<6;t++)e.deleteFramebuffer(n.__webglFramebuffer[t]),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[t]);else e.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&e.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer);r.remove(t.texture),r.remove(t)}(n),o.memory.textures--}let S=0;function M(e,t){const i=r.get(e);if(e.isVideoTexture&&function(e){const t=o.render.frame;p.get(e)!==t&&(p.set(e,t),e.update())}(e),e.version>0&&i.__version!==e.version){const n=e.image;if(void 0===n)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==n.complete)return void k(i,e,t);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+t),n.bindTexture(3553,i.__webglTexture)}function T(t,i){const o=r.get(t);t.version>0&&o.__version!==t.version?function(t,r,i){if(6!==r.image.length)return;I(t,r),n.activeTexture(33984+i),n.bindTexture(34067,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment);const o=r&&(r.isCompressedTexture||r.image[0].isCompressedTexture),l=r.image[0]&&r.image[0].isDataTexture,u=[];for(let e=0;e<6;e++)u[e]=o||l?l?r.image[e].image:r.image[e]:g(r.image[e],!1,!0,c);const d=u[0],p=A(d)||s,h=a.convert(r.format),f=a.convert(r.type),m=b(r.internalFormat,h,f);let x;if(C(34067,r,p),o){for(let e=0;e<6;e++){x=u[e].mipmaps;for(let t=0;t1||r.get(a).__currentAnisotropy)&&(e.texParameterf(n,l.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),r.get(a).__currentAnisotropy=a.anisotropy)}}function I(t,n){void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",w),t.__webglTexture=e.createTexture(),o.memory.textures++)}function k(t,r,i){let o=3553;r.isDataTexture2DArray&&(o=35866),r.isDataTexture3D&&(o=32879),I(t,r),n.activeTexture(33984+i),n.bindTexture(o,t.__webglTexture),e.pixelStorei(37440,r.flipY),e.pixelStorei(37441,r.premultiplyAlpha),e.pixelStorei(3317,r.unpackAlignment);const l=function(e){return!s&&(1001!==e.wrapS||1001!==e.wrapT||1003!==e.minFilter&&1006!==e.minFilter)}(r)&&!1===A(r.image),c=g(r.image,l,!1,u),d=A(c)||s,p=a.convert(r.format);let h,f=a.convert(r.type),m=b(r.internalFormat,p,f);C(o,r,d);const x=r.mipmaps;if(r.isDepthTexture)m=6402,s?m=1015===r.type?36012:1014===r.type?33190:1020===r.type?35056:33189:1015===r.type&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),1026===r.format&&6402===m&&1012!==r.type&&1014!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),r.type=1012,f=a.convert(r.type)),1027===r.format&&6402===m&&(m=34041,1020!==r.type&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),r.type=1020,f=a.convert(r.type))),n.texImage2D(3553,0,m,c.width,c.height,0,p,f,null);else if(r.isDataTexture)if(x.length>0&&d){for(let e=0,t=x.length;e0&&d){for(let e=0,t=x.length;e=l&&console.warn("THREE.WebGLTextures: Trying to use "+e+" texture units while this GPU supports only "+l),S+=1,e},this.resetTextureUnits=function(){S=0},this.setTexture2D=M,this.setTexture2DArray=function(e,t){const i=r.get(e);e.version>0&&i.__version!==e.version?k(i,e,t):(n.activeTexture(33984+t),n.bindTexture(35866,i.__webglTexture))},this.setTexture3D=function(e,t){const i=r.get(e);e.version>0&&i.__version!==e.version?k(i,e,t):(n.activeTexture(33984+t),n.bindTexture(32879,i.__webglTexture))},this.setTextureCube=T,this.setupRenderTarget=function(t){const i=r.get(t),l=r.get(t.texture);t.addEventListener("dispose",E),l.__webglTexture=e.createTexture(),o.memory.textures++;const c=!0===t.isWebGLCubeRenderTarget,u=!0===t.isWebGLMultisampleRenderTarget,d=A(t)||s;if(!s||1022!==t.texture.format||1015!==t.texture.type&&1016!==t.texture.type||(t.texture.format=1023,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),c){i.__webglFramebuffer=[];for(let t=0;t<6;t++)i.__webglFramebuffer[t]=e.createFramebuffer()}else if(i.__webglFramebuffer=e.createFramebuffer(),u)if(s){i.__webglMultisampledFramebuffer=e.createFramebuffer(),i.__webglColorRenderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(36161,i.__webglColorRenderbuffer);const n=a.convert(t.texture.format),r=a.convert(t.texture.type),o=b(t.texture.internalFormat,n,r),s=_(t);e.renderbufferStorageMultisample(36161,s,o,t.width,t.height),e.bindFramebuffer(36160,i.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(36160,36064,36161,i.__webglColorRenderbuffer),e.bindRenderbuffer(36161,null),t.depthBuffer&&(i.__webglDepthRenderbuffer=e.createRenderbuffer(),D(i.__webglDepthRenderbuffer,t,!0)),e.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(c){n.bindTexture(34067,l.__webglTexture),C(34067,t.texture,d);for(let e=0;e<6;e++)P(i.__webglFramebuffer[e],t,36064,34069+e);v(t.texture,d)&&y(34067,t.texture,t.width,t.height),n.bindTexture(34067,null)}else n.bindTexture(3553,l.__webglTexture),C(3553,t.texture,d),P(i.__webglFramebuffer,t,36064,3553),v(t.texture,d)&&y(3553,t.texture,t.width,t.height),n.bindTexture(3553,null);t.depthBuffer&&F(t)},this.updateRenderTargetMipmap=function(e){const t=e.texture;if(v(t,A(e)||s)){const i=e.isWebGLCubeRenderTarget?34067:3553,a=r.get(t).__webglTexture;n.bindTexture(i,a),y(i,t,e.width,e.height),n.bindTexture(i,null)}},this.updateMultisampleRenderTarget=function(t){if(t.isWebGLMultisampleRenderTarget)if(s){const n=r.get(t);e.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),e.bindFramebuffer(36009,n.__webglFramebuffer);const i=t.width,a=t.height;let o=16384;t.depthBuffer&&(o|=256),t.stencilBuffer&&(o|=1024),e.blitFramebuffer(0,0,i,a,0,0,i,a,o,9728),e.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(e,t){e&&e.isWebGLRenderTarget&&(!1===U&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),U=!0),e=e.texture),M(e,t)},this.safeSetTextureCube=function(e,t){e&&e.isWebGLCubeRenderTarget&&(!1===L&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),L=!0),e=e.texture),T(e,t)}}function ua(e,t,n){const r=n.isWebGL2;return{convert:function(e){let n;if(1009===e)return 5121;if(1017===e)return 32819;if(1018===e)return 32820;if(1019===e)return 33635;if(1010===e)return 5120;if(1011===e)return 5122;if(1012===e)return 5123;if(1013===e)return 5124;if(1014===e)return 5125;if(1015===e)return 5126;if(1016===e)return r?5131:(n=t.get("OES_texture_half_float"),null!==n?n.HALF_FLOAT_OES:null);if(1021===e)return 6406;if(1022===e)return 6407;if(1023===e)return 6408;if(1024===e)return 6409;if(1025===e)return 6410;if(1026===e)return 6402;if(1027===e)return 34041;if(1028===e)return 6403;if(1029===e)return 36244;if(1030===e)return 33319;if(1031===e)return 33320;if(1032===e)return 36248;if(1033===e)return 36249;if(33776===e||33777===e||33778===e||33779===e){if(n=t.get("WEBGL_compressed_texture_s3tc"),null===n)return null;if(33776===e)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(33777===e)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(33778===e)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(33779===e)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(35840===e||35841===e||35842===e||35843===e){if(n=t.get("WEBGL_compressed_texture_pvrtc"),null===n)return null;if(35840===e)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(35841===e)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(35842===e)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(35843===e)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(36196===e)return n=t.get("WEBGL_compressed_texture_etc1"),null!==n?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((37492===e||37496===e)&&(n=t.get("WEBGL_compressed_texture_etc"),null!==n)){if(37492===e)return n.COMPRESSED_RGB8_ETC2;if(37496===e)return n.COMPRESSED_RGBA8_ETC2_EAC}return 37808===e||37809===e||37810===e||37811===e||37812===e||37813===e||37814===e||37815===e||37816===e||37817===e||37818===e||37819===e||37820===e||37821===e||37840===e||37841===e||37842===e||37843===e||37844===e||37845===e||37846===e||37847===e||37848===e||37849===e||37850===e||37851===e||37852===e||37853===e?(n=t.get("WEBGL_compressed_texture_astc"),null!==n?e:null):36492===e?(n=t.get("EXT_texture_compression_bptc"),null!==n?e:null):1020===e?r?34042:(n=t.get("WEBGL_depth_texture"),null!==n?n.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}function da(e=[]){nr.call(this),this.cameras=e}function pa(){Dt.call(this),this.type="Group"}function ha(){this._targetRay=null,this._grip=null,this._hand=null}function fa(e,t){const n=this;let r=null,i=1,a=null,o="local-floor",s=null;const l=[],c=new Map,u=new nr;u.layers.enable(1),u.viewport=new Ie;const d=new nr;d.layers.enable(2),d.viewport=new Ie;const p=[u,d],h=new da;h.layers.enable(1),h.layers.enable(2);let f=null,m=null;function g(e){const t=c.get(e.inputSource);t&&t.dispatchEvent({type:e.type,data:e.inputSource})}function A(){c.forEach((function(e,t){e.disconnect(t)})),c.clear(),f=null,m=null,e.setFramebuffer(null),e.setRenderTarget(e.getRenderTarget()),E.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function v(e){const t=r.inputSources;for(let e=0;e0&&be(a,e,t),o.length>0&&be(o,e,t),!0===e.isScene&&e.onAfterRender(f,e,t),null!==y&&(W.updateRenderTargetMipmap(y),W.updateMultisampleRenderTarget(y)),Q.buffers.depth.setTest(!0),Q.buffers.depth.setMask(!0),Q.buffers.color.setMask(!0),Q.setPolygonOffset(!1),h.pop(),p=h.length>0?h[h.length-1]:null,d=null},this.setFramebuffer=function(e){g!==e&&null===y&&le.bindFramebuffer(36160,e),g=e},this.getActiveCubeFace=function(){return A},this.getActiveMipmapLevel=function(){return v},this.getRenderList=function(){return d},this.setRenderList=function(e){d=e},this.getRenderTarget=function(){return y},this.setRenderTarget=function(e,t=0,n=0){y=e,A=t,v=n,e&&void 0===G.get(e).__webglFramebuffer&&W.setupRenderTarget(e);let r=g,i=!1;if(e){const n=G.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(r=n[t],i=!0):r=e.isWebGLMultisampleRenderTarget?G.get(e).__webglMultisampledFramebuffer:n,E.copy(e.viewport),S.copy(e.scissor),M=e.scissorTest}else E.copy(k).multiplyScalar(R).floor(),S.copy(P).multiplyScalar(R).floor(),M=D;if(b!==r&&(le.bindFramebuffer(36160,r),b=r),Q.viewport(E),Q.scissor(S),Q.setScissorTest(M),i){const r=G.get(e.texture);le.framebufferTexture2D(36160,36064,34069+t,r.__webglTexture,n)}},this.readRenderTargetPixels=function(e,t,n,r,i,a,o){if(!e||!e.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let s=G.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==o&&(s=s[o]),s){let o=!1;s!==b&&(le.bindFramebuffer(36160,s),o=!0);try{const s=e.texture,l=s.format,c=s.type;if(1023!==l&&oe.convert(l)!==le.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const u=1016===c&&(H.has("EXT_color_buffer_half_float")||z.isWebGL2&&H.has("EXT_color_buffer_float"));if(!(1009===c||oe.convert(c)===le.getParameter(35738)||1015===c&&(z.isWebGL2||H.has("OES_texture_float")||H.has("WEBGL_color_buffer_float"))||u))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===le.checkFramebufferStatus(36160)?t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&le.readPixels(t,n,r,i,oe.convert(l),oe.convert(c),a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{o&&le.bindFramebuffer(36160,b)}}},this.copyFramebufferToTexture=function(e,t,n=0){const r=Math.pow(2,-n),i=Math.floor(t.image.width*r),a=Math.floor(t.image.height*r),o=oe.convert(t.format);W.setTexture2D(t,0),le.copyTexImage2D(3553,n,o,e.x,e.y,i,a,0),Q.unbindTexture()},this.copyTextureToTexture=function(e,t,n,r=0){const i=t.image.width,a=t.image.height,o=oe.convert(n.format),s=oe.convert(n.type);W.setTexture2D(n,0),le.pixelStorei(37440,n.flipY),le.pixelStorei(37441,n.premultiplyAlpha),le.pixelStorei(3317,n.unpackAlignment),t.isDataTexture?le.texSubImage2D(3553,r,e.x,e.y,i,a,o,s,t.image.data):t.isCompressedTexture?le.compressedTexSubImage2D(3553,r,e.x,e.y,t.mipmaps[0].width,t.mipmaps[0].height,o,t.mipmaps[0].data):le.texSubImage2D(3553,r,e.x,e.y,o,s,t.image),0===r&&n.generateMipmaps&&le.generateMipmap(3553),Q.unbindTexture()},this.initTexture=function(e){W.setTexture2D(e,0),Q.unbindTexture()},this.resetState=function(){Q.reset(),se.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function Aa(e){ga.call(this,e)}da.prototype=Object.assign(Object.create(nr.prototype),{constructor:da,isArrayCamera:!0}),pa.prototype=Object.assign(Object.create(Dt.prototype),{constructor:pa,isGroup:!0}),Object.assign(ha.prototype,{constructor:ha,getHandSpace:function(){return null===this._hand&&(this._hand=new pa,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new pa,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new pa,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this},disconnect:function(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this},update:function(e,t,n){let r=null,i=null,a=null;const o=this._targetRay,s=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState)if(l&&e.hand){a=!0;for(const r of e.hand.values()){const e=t.getJointPose(r,n);if(void 0===l.joints[r.jointName]){const e=new pa;e.matrixAutoUpdate=!1,e.visible=!1,l.joints[r.jointName]=e,l.add(e)}const i=l.joints[r.jointName];null!==e&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.jointRadius=e.radius),i.visible=null!==e}const r=l.joints["index-finger-tip"],i=l.joints["thumb-tip"],o=r.position.distanceTo(i.position),s=.02,c=.005;l.inputState.pinching&&o>s+c?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&o<=s-c&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&(r=t.getPose(e.targetRaySpace,n),null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale))),null!==s&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),null!==i&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale)));return null!==o&&(o.visible=null!==r),null!==s&&(s.visible=null!==i),null!==l&&(l.visible=null!==a),this}}),Object.assign(fa.prototype,ye.prototype),Aa.prototype=Object.assign(Object.create(ga.prototype),{constructor:Aa,isWebGL1Renderer:!0});class va{constructor(e,t){Object.defineProperty(this,"isFogExp2",{value:!0}),this.name="",this.color=new tn(e),this.density=void 0!==t?t:25e-5}clone(){return new va(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class ya extends Dt{constructor(){super(),Object.defineProperty(this,"isScene",{value:!0}),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.autoUpdate=e.autoUpdate,this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.background&&(t.object.background=this.background.toJSON(e)),null!==this.environment&&(t.object.environment=this.environment.toJSON(e)),null!==this.fog&&(t.object.fog=this.fog.toJSON()),t}}function ba(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=35044,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=we.generateUUID()}Object.defineProperty(ba.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(ba.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(e){return this.usage=e,this},copy:function(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this},copyAt:function(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;re.far||t.push({distance:s,point:Ma.clone(),uv:Jt.getUV(Ma,ka,Pa,Da,Fa,_a,Ua,new Ee),face:null,object:this})},copy:function(e){return Dt.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this.material=e.material,this}});const Na=new Fe,Oa=new Fe;function Ha(){Dt.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}Ha.prototype=Object.assign(Object.create(Dt.prototype),{constructor:Ha,isLOD:!0,copy:function(e){Dt.prototype.copy.call(this,e,!1);const t=e.levels;for(let e=0,n=t.length;e0){let n,r;for(n=1,r=t.length;n0){Na.setFromMatrixPosition(this.matrixWorld);const n=e.ray.origin.distanceTo(Na);this.getObjectForDistance(n).raycast(e,t)}},update:function(e){const t=this.levels;if(t.length>1){Na.setFromMatrixPosition(e.matrixWorld),Oa.setFromMatrixPosition(this.matrixWorld);const n=Na.distanceTo(Oa)/e.zoom;let r,i;for(t[0].object.visible=!0,r=1,i=t.length;r=t[r].distance;r++)t[r-1].object.visible=!1,t[r].object.visible=!0;for(this._currentLevel=r-1;ro)continue;u.applyMatrix4(this.matrixWorld);const p=e.ray.origin.distanceTo(u);pe.far||t.push({distance:p,point:c.clone().applyMatrix4(this.matrixWorld),index:r,face:null,faceIndex:null,object:this})}}else for(let n=0,r=i.count-1;no)continue;u.applyMatrix4(this.matrixWorld);const r=e.ray.origin.distanceTo(u);re.far||t.push({distance:r,point:c.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else n.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")},updateMorphTargets:function(){const e=this.geometry;if(e.isBufferGeometry){const t=e.morphAttributes,n=Object.keys(t);if(n.length>0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}});const uo=new Fe,po=new Fe;function ho(e,t){co.call(this,e,t),this.type="LineSegments"}function fo(e,t){co.call(this,e,t),this.type="LineLoop"}function mo(e){an.call(this),this.type="PointsMaterial",this.color=new tn(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(e)}ho.prototype=Object.assign(Object.create(co.prototype),{constructor:ho,isLineSegments:!0,computeLineDistances:function(){const e=this.geometry;if(e.isBufferGeometry)if(null===e.index){const t=e.attributes.position,n=[];for(let e=0,r=t.count;ei.far)return;a.push({distance:l,distanceToRay:Math.sqrt(s),point:n,index:t,face:null,object:o})}}function wo(e,t,n,r,i,a,o,s,l){Re.call(this,e,t,n,r,i,a,o,s,l),this.format=void 0!==o?o:1022,this.minFilter=void 0!==a?a:1006,this.magFilter=void 0!==i?i:1006,this.generateMipmaps=!1;const c=this;"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback((function t(){c.needsUpdate=!0,e.requestVideoFrameCallback(t)}))}function Eo(e,t,n,r,i,a,o,s,l,c,u,d){Re.call(this,null,a,o,s,l,c,r,i,u,d),this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}function So(e,t,n,r,i,a,o,s,l){Re.call(this,e,t,n,r,i,a,o,s,l),this.needsUpdate=!0}function Mo(e,t,n,r,i,a,o,s,l,c){if(1026!==(c=void 0!==c?c:1026)&&1027!==c)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&1026===c&&(n=1012),void 0===n&&1027===c&&(n=1020),Re.call(this,null,r,i,a,o,s,c,n,l),this.image={width:e,height:t},this.magFilter=void 0!==o?o:1003,this.minFilter=void 0!==s?s:1003,this.flipY=!1,this.generateMipmaps=!1}bo.prototype=Object.assign(Object.create(Dt.prototype),{constructor:bo,isPoints:!0,copy:function(e){return Dt.prototype.copy.call(this,e),this.material=e.material,this.geometry=e.geometry,this},raycast:function(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),vo.copy(n.boundingSphere),vo.applyMatrix4(r),vo.radius+=i,!1===e.ray.intersectsSphere(vo))return;go.copy(r).invert(),Ao.copy(e.ray).applyMatrix4(go);const a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a;if(n.isBufferGeometry){const i=n.index,a=n.attributes.position;if(null!==i){const n=i.array;for(let i=0,s=n.length;i0){const e=t[n[0]];if(void 0!==e){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let t=0,n=e.length;t0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}),wo.prototype=Object.assign(Object.create(Re.prototype),{constructor:wo,clone:function(){return new this.constructor(this.image).copy(this)},isVideoTexture:!0,update:function(){const e=this.image;!1==="requestVideoFrameCallback"in e&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Eo.prototype=Object.create(Re.prototype),Eo.prototype.constructor=Eo,Eo.prototype.isCompressedTexture=!0,So.prototype=Object.create(Re.prototype),So.prototype.constructor=So,So.prototype.isCanvasTexture=!0,Mo.prototype=Object.create(Re.prototype),Mo.prototype.constructor=Mo,Mo.prototype.isDepthTexture=!0;new Fe,new Fe,new Fe,new Jt;const To=function(e,t,n){n=n||2;const r=t&&t.length,i=r?t[0]*n:e.length;let a=Bo(e,0,i,n,!0);const o=[];if(!a||a.next===a.prev)return o;let s,l,c,u,d,p,h;if(r&&(a=function(e,t,n,r){const i=[];let a,o,s,l,c;for(a=0,o=t.length;a80*n){s=c=e[0],l=u=e[1];for(let t=n;tc&&(c=d),p>u&&(u=p);h=Math.max(c-s,u-l),h=0!==h?1/h:0}return Co(a,o,n,s,l,h),o};function Bo(e,t,n,r,i){let a,o;if(i===function(e,t,n,r){let i=0;for(let a=t,o=n-r;a0)for(a=t;a=t;a-=r)o=Jo(a,e[a],e[a+1],o);return o&&zo(o,o.next)&&(Zo(o),o=o.next),o}function Ro(e,t){if(!e)return e;t||(t=e);let n,r=e;do{if(n=!1,r.steiner||!zo(r,r.next)&&0!==Ho(r.prev,r,r.next))r=r.next;else{if(Zo(r),r=t=r.prev,r===r.next)break;n=!0}}while(n||r!==t);return t}function Co(e,t,n,r,i,a,o){if(!e)return;!o&&a&&function(e,t,n,r){let i=e;do{null===i.z&&(i.z=Lo(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,n,r,i,a,o,s,l,c=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,s=0,t=0;t0||l>0&&r;)0!==s&&(0===l||!r||n.z<=r.z)?(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,c*=2}while(o>1)}(i)}(e,r,i,a);let s,l,c=e;for(;e.prev!==e.next;)if(s=e.prev,l=e.next,a?ko(e,r,i,a):Io(e))t.push(s.i/n),t.push(e.i/n),t.push(l.i/n),Zo(e),e=l.next,c=l.next;else if((e=l)===c){o?1===o?Co(e=Po(Ro(e),t,n),t,n,r,i,a,2):2===o&&Do(e,t,n,r,i,a):Co(Ro(e),t,n,r,i,a,1);break}}function Io(e){const t=e.prev,n=e,r=e.next;if(Ho(t,n,r)>=0)return!1;let i=e.next.next;for(;i!==e.prev;){if(No(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&Ho(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function ko(e,t,n,r){const i=e.prev,a=e,o=e.next;if(Ho(i,a,o)>=0)return!1;const s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,d=Lo(s,l,t,n,r),p=Lo(c,u,t,n,r);let h=e.prevZ,f=e.nextZ;for(;h&&h.z>=d&&f&&f.z<=p;){if(h!==e.prev&&h!==e.next&&No(i.x,i.y,a.x,a.y,o.x,o.y,h.x,h.y)&&Ho(h.prev,h,h.next)>=0)return!1;if(h=h.prevZ,f!==e.prev&&f!==e.next&&No(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Ho(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;h&&h.z>=d;){if(h!==e.prev&&h!==e.next&&No(i.x,i.y,a.x,a.y,o.x,o.y,h.x,h.y)&&Ho(h.prev,h,h.next)>=0)return!1;h=h.prevZ}for(;f&&f.z<=p;){if(f!==e.prev&&f!==e.next&&No(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&Ho(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Po(e,t,n){let r=e;do{const i=r.prev,a=r.next.next;!zo(i,a)&&Qo(i,r,r.next,a)&&Wo(i,a)&&Wo(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),Zo(r),Zo(r.next),r=e=a),r=r.next}while(r!==e);return Ro(r)}function Do(e,t,n,r,i,a){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&Oo(o,e)){let s=Yo(o,e);return o=Ro(o,o.next),s=Ro(s,s.next),Co(o,t,n,r,i,a),void Co(s,t,n,r,i,a)}e=e.next}o=o.next}while(o!==e)}function Fo(e,t){return e.x-t.x}function _o(e,t){if(t=function(e,t){let n=t;const r=e.x,i=e.y;let a,o=-1/0;do{if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){const e=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>o){if(o=e,e===r){if(i===n.y)return n;if(i===n.next.y)return n.next}a=n.x=n.x&&n.x>=l&&r!==n.x&&No(ia.x||n.x===a.x&&Uo(a,n)))&&(a=n,d=u)),n=n.next}while(n!==s);return a}(e,t)){const n=Yo(t,e);Ro(t,t.next),Ro(n,n.next)}}function Uo(e,t){return Ho(e.prev,e,t.prev)<0&&Ho(t.next,e,e.next)<0}function Lo(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Vo(e){let t=e,n=e;do{(t.x=0&&(e-o)*(r-s)-(n-o)*(t-s)>=0&&(n-o)*(a-s)-(i-o)*(r-s)>=0}function Oo(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Qo(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(Wo(e,t)&&Wo(t,e)&&function(e,t){let n=e,r=!1;const i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(Ho(e.prev,e,t.prev)||Ho(e,t.prev,t))||zo(e,t)&&Ho(e.prev,e,e.next)>0&&Ho(t.prev,t,t.next)>0)}function Ho(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function zo(e,t){return e.x===t.x&&e.y===t.y}function Qo(e,t,n,r){const i=Go(Ho(e,t,n)),a=Go(Ho(e,t,r)),o=Go(Ho(n,r,e)),s=Go(Ho(n,r,t));return i!==a&&o!==s||(!(0!==i||!jo(e,n,t))||(!(0!==a||!jo(e,r,t))||(!(0!==o||!jo(n,e,r))||!(0!==s||!jo(n,t,r)))))}function jo(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Go(e){return e>0?1:e<0?-1:0}function Wo(e,t){return Ho(e.prev,e,e.next)<0?Ho(e,t,e.next)>=0&&Ho(e,e.prev,t)>=0:Ho(e,t,e.prev)<0||Ho(e,e.next,t)<0}function Yo(e,t){const n=new Ko(e.i,e.x,e.y),r=new Ko(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function Jo(e,t,n,r){const i=new Ko(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Zo(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Ko(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}const Xo={area:function(e){const t=e.length;let n=0;for(let r=t-1,i=0;i2&&e[t-1].equals(e[0])&&e.pop()}function $o(e,t){for(let n=0;nNumber.EPSILON){const d=Math.sqrt(u),p=Math.sqrt(l*l+c*c),h=t.x-s/d,f=t.y+o/d,m=((n.x-c/p-h)*c-(n.y+l/p-f)*l)/(o*c-s*l);r=h+o*m-e.x,i=f+s*m-e.y;const g=r*r+i*i;if(g<=2)return new Ee(r,i);a=Math.sqrt(g/2)}else{let e=!1;o>Number.EPSILON?l>Number.EPSILON&&(e=!0):o<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(s)===Math.sign(c)&&(e=!0),e?(r=-s,i=o,a=Math.sqrt(u)):(r=o,i=s,a=Math.sqrt(u/2))}return new Ee(r/a,i/a)}const k=[];for(let e=0,t=T.length,n=t-1,r=e+1;e=0;e--){const t=e/h,n=u*Math.cos(t*Math.PI/2),r=d*Math.sin(t*Math.PI/2)+p;for(let e=0,t=T.length;e=0;){const r=n;let i=n-1;i<0&&(i=e.length-1);for(let e=0,n=s+2*h;e=0?(e(r-s,h,u),d.subVectors(c,u)):(e(r+s,h,u),d.subVectors(u,c)),h-s>=0?(e(r,h-s,u),p.subVectors(c,u)):(e(r,h+s,u),p.subVectors(u,c)),l.crossVectors(d,p).normalize(),a.push(l.x,l.y,l.z),o.push(r,h)}}for(let e=0;e=r)){l.push(t.times[e]);for(let n=0;na.tracks[e].times[0]&&(s=a.tracks[e].times[0]);for(let e=0;e=r.times[d]){const e=d*l+s,t=e+l-s;p=ms.arraySlice(r.values,e,t)}else{const e=r.createInterpolant(),t=s,n=l-s;e.evaluate(a),p=ms.arraySlice(e.resultBuffer,t,n)}if("quaternion"===i){(new De).fromArray(p).normalize().conjugate().toArray(p)}const h=o.times.length;for(let e=0;e=i)break e;{const o=t[1];e=i)break t}a=n,n=0}}for(;n>>1;et;)--a;if(++a,0!==i||a!==r){i>=a&&(a=Math.max(a,1),i=a-1);const e=this.getValueSize();this.times=ms.arraySlice(n,i,a),this.values=ms.arraySlice(this.values,i*e,a*e)}return this},validate:function(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,r=this.values,i=n.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let t=0;t!==i;t++){const r=n[t];if("number"==typeof r&&isNaN(r)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,t,r),e=!1;break}if(null!==a&&a>r){console.error("THREE.KeyframeTrack: Out of order keys.",this,t,r,a),e=!1;break}a=r}if(void 0!==r&&ms.isTypedArray(r))for(let t=0,n=r.length;t!==n;++t){const n=r[t];if(isNaN(n)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,t,n),e=!1;break}}return e},optimize:function(){const e=ms.arraySlice(this.times),t=ms.arraySlice(this.values),n=this.getValueSize(),r=2302===this.getInterpolation(),i=e.length-1;let a=1;for(let o=1;o0){e[a]=e[i];for(let e=i*n,r=a*n,o=0;o!==n;++o)t[r+o]=t[e+o];++a}return a!==e.length?(this.times=ms.arraySlice(e,0,a),this.values=ms.arraySlice(t,0,a*n)):(this.times=e,this.values=t),this},clone:function(){const e=ms.arraySlice(this.times,0),t=ms.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,e,t);return n.createInterpolant=this.createInterpolant,n}}),xs.prototype=Object.assign(Object.create(bs.prototype),{constructor:xs,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),ws.prototype=Object.assign(Object.create(bs.prototype),{constructor:ws,ValueTypeName:"color"}),Es.prototype=Object.assign(Object.create(bs.prototype),{constructor:Es,ValueTypeName:"number"}),Ss.prototype=Object.assign(Object.create(gs.prototype),{constructor:Ss,interpolate_:function(e,t,n,r){const i=this.resultBuffer,a=this.sampleValues,o=this.valueSize,s=(n-t)/(r-t);let l=e*o;for(let e=l+o;l!==e;l+=4)De.slerpFlat(i,0,a,l-o,a,l,s);return i}}),Ms.prototype=Object.assign(Object.create(bs.prototype),{constructor:Ms,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(e){return new Ss(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),Ts.prototype=Object.assign(Object.create(bs.prototype),{constructor:Ts,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Bs.prototype=Object.assign(Object.create(bs.prototype),{constructor:Bs,ValueTypeName:"vector"}),Object.assign(Rs,{parse:function(e){const t=[],n=e.tracks,r=1/(e.fps||1);for(let e=0,i=n.length;e!==i;++e)t.push(Cs(n[e]).scale(r));const i=new Rs(e.name,e.duration,t,e.blendMode);return i.uuid=e.uuid,i},toJSON:function(e){const t=[],n=e.tracks,r={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let e=0,r=n.length;e!==r;++e)t.push(bs.toJSON(n[e]));return r},CreateFromMorphTargetSequence:function(e,t,n,r){const i=t.length,a=[];for(let e=0;e1){const e=a[1];let t=r[e];t||(r[e]=t=[]),t.push(n)}}const a=[];for(const e in r)a.push(Rs.CreateFromMorphTargetSequence(e,r[e],t,n));return a},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(e,t,n,r,i){if(0!==n.length){const a=[],o=[];ms.flattenJSON(n,a,o,r),0!==a.length&&i.push(new e(t,a,o))}},r=[],i=e.name||"default",a=e.fps||30,o=e.blendMode;let s=e.length||-1;const l=e.hierarchy||[];for(let e=0;e0||0===e.search(/^data\:image\/jpeg/);i.format=r?1022:1023,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i}}),Object.assign(zs.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)},getPoints:function(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t},getSpacedPoints:function(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t},getLength:function(){const e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,r=this.getPoint(0),i=0;t.push(0);for(let a=1;a<=e;a++)n=this.getPoint(a/e),i+=n.distanceTo(r),t.push(i),r=n;return this.cacheArcLengths=t,t},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){const n=this.getLengths();let r=0;const i=n.length;let a;a=t||e*n[i-1];let o,s=0,l=i-1;for(;s<=l;)if(r=Math.floor(s+(l-s)/2),o=n[r]-a,o<0)s=r+1;else{if(!(o>0)){l=r;break}l=r-1}if(r=l,n[r]===a)return r/(i-1);const c=n[r];return(r+(a-c)/(n[r+1]-c))/(i-1)},getTangent:function(e,t){let n=e-1e-4,r=e+1e-4;n<0&&(n=0),r>1&&(r=1);const i=this.getPoint(n),a=this.getPoint(r),o=t||(i.isVector2?new Ee:new Fe);return o.copy(a).sub(i).normalize(),o},getTangentAt:function(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)},computeFrenetFrames:function(e,t){const n=new Fe,r=[],i=[],a=[],o=new Fe,s=new lt;for(let t=0;t<=e;t++){const n=t/e;r[t]=this.getTangentAt(n,new Fe),r[t].normalize()}i[0]=new Fe,a[0]=new Fe;let l=Number.MAX_VALUE;const c=Math.abs(r[0].x),u=Math.abs(r[0].y),d=Math.abs(r[0].z);c<=l&&(l=c,n.set(1,0,0)),u<=l&&(l=u,n.set(0,1,0)),d<=l&&n.set(0,0,1),o.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],o),a[0].crossVectors(r[0],i[0]);for(let t=1;t<=e;t++){if(i[t]=i[t-1].clone(),a[t]=a[t-1].clone(),o.crossVectors(r[t-1],r[t]),o.length()>Number.EPSILON){o.normalize();const e=Math.acos(we.clamp(r[t-1].dot(r[t]),-1,1));i[t].applyMatrix4(s.makeRotationAxis(o,e))}a[t].crossVectors(r[t],i[t])}if(!0===t){let t=Math.acos(we.clamp(i[0].dot(i[e]),-1,1));t/=e,r[0].dot(o.crossVectors(i[0],i[e]))>0&&(t=-t);for(let n=1;n<=e;n++)i[n].applyMatrix4(s.makeRotationAxis(r[n],t*n)),a[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:a}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){const e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),Qs.prototype=Object.create(zs.prototype),Qs.prototype.constructor=Qs,Qs.prototype.isEllipseCurve=!0,Qs.prototype.getPoint=function(e,t){const n=t||new Ee,r=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const a=Math.abs(i)r;)i-=r;i0?0:(Math.floor(Math.abs(l)/i)+1)*i:0===c&&l===i-1&&(l=i-2,c=1),this.closed||l>0?o=r[(l-1)%i]:(Ws.subVectors(r[0],r[1]).add(r[0]),o=Ws);const u=r[l%i],d=r[(l+1)%i];if(this.closed||l+2r.length-2?r.length-1:a+1],u=r[a>r.length-3?r.length-1:a+2];return n.set(Xs(o,s.x,l.x,c.x,u.x),Xs(o,s.y,l.y,c.y,u.y)),n},ol.prototype.copy=function(e){zs.prototype.copy.call(this,e),this.points=[];for(let t=0,n=e.points.length;t=t){const e=n[r]-t,i=this.curves[r],a=i.getLength(),o=0===a?0:1-e/a;return i.getPointAt(o)}r++}return null},getLength:function(){const e=this.getCurveLengths();return e[e.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,r=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t},copy:function(e){zs.prototype.copy.call(this,e),this.curves=[];for(let t=0,n=e.curves.length;t0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const c=l.getPoint(1);return this.currentPoint.copy(c),this},copy:function(e){return ll.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){const e=ll.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return ll.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),ul.prototype=Object.assign(Object.create(cl.prototype),{constructor:ul,getPointsHoles:function(e){const t=[];for(let n=0,r=this.holes.length;n0:r.vertexColors=e.vertexColors),void 0!==e.uniforms)for(const t in e.uniforms){const i=e.uniforms[t];switch(r.uniforms[t]={},i.type){case"t":r.uniforms[t].value=n(i.value);break;case"c":r.uniforms[t].value=(new tn).setHex(i.value);break;case"v2":r.uniforms[t].value=(new Ee).fromArray(i.value);break;case"v3":r.uniforms[t].value=(new Fe).fromArray(i.value);break;case"v4":r.uniforms[t].value=(new Ie).fromArray(i.value);break;case"m3":r.uniforms[t].value=(new Se).fromArray(i.value);break;case"m4":r.uniforms[t].value=(new lt).fromArray(i.value);break;default:r.uniforms[t].value=i.value}}if(void 0!==e.defines&&(r.defines=e.defines),void 0!==e.vertexShader&&(r.vertexShader=e.vertexShader),void 0!==e.fragmentShader&&(r.fragmentShader=e.fragmentShader),void 0!==e.extensions)for(const t in e.extensions)r.extensions[t]=e.extensions[t];if(void 0!==e.shading&&(r.flatShading=1===e.shading),void 0!==e.size&&(r.size=e.size),void 0!==e.sizeAttenuation&&(r.sizeAttenuation=e.sizeAttenuation),void 0!==e.map&&(r.map=n(e.map)),void 0!==e.matcap&&(r.matcap=n(e.matcap)),void 0!==e.alphaMap&&(r.alphaMap=n(e.alphaMap)),void 0!==e.bumpMap&&(r.bumpMap=n(e.bumpMap)),void 0!==e.bumpScale&&(r.bumpScale=e.bumpScale),void 0!==e.normalMap&&(r.normalMap=n(e.normalMap)),void 0!==e.normalMapType&&(r.normalMapType=e.normalMapType),void 0!==e.normalScale){let t=e.normalScale;!1===Array.isArray(t)&&(t=[t,t]),r.normalScale=(new Ee).fromArray(t)}return void 0!==e.displacementMap&&(r.displacementMap=n(e.displacementMap)),void 0!==e.displacementScale&&(r.displacementScale=e.displacementScale),void 0!==e.displacementBias&&(r.displacementBias=e.displacementBias),void 0!==e.roughnessMap&&(r.roughnessMap=n(e.roughnessMap)),void 0!==e.metalnessMap&&(r.metalnessMap=n(e.metalnessMap)),void 0!==e.emissiveMap&&(r.emissiveMap=n(e.emissiveMap)),void 0!==e.emissiveIntensity&&(r.emissiveIntensity=e.emissiveIntensity),void 0!==e.specularMap&&(r.specularMap=n(e.specularMap)),void 0!==e.envMap&&(r.envMap=n(e.envMap)),void 0!==e.envMapIntensity&&(r.envMapIntensity=e.envMapIntensity),void 0!==e.reflectivity&&(r.reflectivity=e.reflectivity),void 0!==e.refractionRatio&&(r.refractionRatio=e.refractionRatio),void 0!==e.lightMap&&(r.lightMap=n(e.lightMap)),void 0!==e.lightMapIntensity&&(r.lightMapIntensity=e.lightMapIntensity),void 0!==e.aoMap&&(r.aoMap=n(e.aoMap)),void 0!==e.aoMapIntensity&&(r.aoMapIntensity=e.aoMapIntensity),void 0!==e.gradientMap&&(r.gradientMap=n(e.gradientMap)),void 0!==e.clearcoatMap&&(r.clearcoatMap=n(e.clearcoatMap)),void 0!==e.clearcoatRoughnessMap&&(r.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),void 0!==e.clearcoatNormalMap&&(r.clearcoatNormalMap=n(e.clearcoatNormalMap)),void 0!==e.clearcoatNormalScale&&(r.clearcoatNormalScale=(new Ee).fromArray(e.clearcoatNormalScale)),void 0!==e.transmission&&(r.transmission=e.transmission),void 0!==e.transmissionMap&&(r.transmissionMap=n(e.transmissionMap)),r},setTextures:function(e){return this.textures=e,this}});const Tl=function(e){const t=e.lastIndexOf("/");return-1===t?"./":e.substr(0,t+1)};function Bl(){In.call(this),this.type="InstancedBufferGeometry",this.instanceCount=1/0}function Rl(e,t,n,r){"number"==typeof n&&(r=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),cn.call(this,e,t,n),this.meshPerAttribute=r||1}function Cl(e){Ds.call(this,e)}Bl.prototype=Object.assign(Object.create(In.prototype),{constructor:Bl,isInstancedBufferGeometry:!0,copy:function(e){return In.prototype.copy.call(this,e),this.instanceCount=e.instanceCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){const e=In.prototype.toJSON.call(this);return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}),Rl.prototype=Object.assign(Object.create(cn.prototype),{constructor:Rl,isInstancedBufferAttribute:!0,copy:function(e){return cn.prototype.copy.call(this,e),this.meshPerAttribute=e.meshPerAttribute,this},toJSON:function(){const e=cn.prototype.toJSON.call(this);return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}),Cl.prototype=Object.assign(Object.create(Ds.prototype),{constructor:Cl,load:function(e,t,n,r){const i=this,a=new _s(i.manager);a.setPath(i.path),a.setRequestHeader(i.requestHeader),a.setWithCredentials(i.withCredentials),a.load(e,(function(n){try{t(i.parse(JSON.parse(n)))}catch(t){r?r(t):console.error(t),i.manager.itemError(e)}}),n,r)},parse:function(e){const t={},n={};function r(e,r){if(void 0!==t[r])return t[r];const i=e.interleavedBuffers[r],a=function(e,t){if(void 0!==n[t])return n[t];const r=e.arrayBuffers[t],i=new Uint32Array(r).buffer;return n[t]=i,i}(e,i.buffer),o=new ba(wn(i.type,a),i.stride);return o.uuid=i.uuid,t[r]=o,o}const i=e.isInstancedBufferGeometry?new Bl:new In,a=e.data.index;if(void 0!==a){const e=wn(a.type,a.array);i.setIndex(new cn(e,1))}const o=e.data.attributes;for(const t in o){const n=o[t];let a;if(n.isInterleavedBufferAttribute){a=new wa(r(e.data,n.data),n.itemSize,n.offset,n.normalized)}else{const e=wn(n.type,n.array);a=new(n.isInstancedBufferAttribute?Rl:cn)(e,n.itemSize,n.normalized)}void 0!==n.name&&(a.name=n.name),i.setAttribute(t,a)}const s=e.data.morphAttributes;if(s)for(const t in s){const n=s[t],a=[];for(let t=0,i=n.length;tNumber.EPSILON){if(l<0&&(n=t[a],s=-s,o=t[i],l=-l),e.yo.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{const t=l*(e.x-n.x)-s*(e.y-n.y);if(0===t)return!0;if(t<0)continue;r=!r}}else{if(e.y!==n.y)continue;if(o.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=o.x)return!0}}return r}const i=Xo.isClockWise,a=this.subPaths;if(0===a.length)return[];if(!0===t)return n(a);let o,s,l;const c=[];if(1===a.length)return s=a[0],l=new ul,l.curves=s.curves,c.push(l),c;let u=!i(a[0].getPoints());u=e?!u:u;const d=[],p=[];let h,f,m=[],g=0;p[g]=void 0,m[g]=[];for(let t=0,n=a.length;t1){let e=!1;const t=[];for(let e=0,t=p.length;e0&&(e||(m=d))}for(let e=0,t=p.length;e0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,r,this._addIndex*t,1,t);for(let e=t,i=t+t;e!==i;++e)if(n[e]!==n[e+t]){o.setValue(n,r);break}},saveOriginalState:function(){const e=this.binding,t=this.buffer,n=this.valueSize,r=n*this._origIndex;e.getValue(t,r);for(let e=n,i=r;e!==i;++e)t[e]=t[r+e%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){const e=3*this.valueSize;this.binding.setValue(this.buffer,e)},_setAdditiveIdentityNumeric:function(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let r=0;r!==i;++r)e[t+r]=e[n+r]},_slerp:function(e,t,n,r){De.slerpFlat(e,t,e,t,e,n,r)},_slerpAdditive:function(e,t,n,r,i){const a=this._workIndex*i;De.multiplyQuaternionsFlat(e,a,e,t,e,n),De.slerpFlat(e,t,e,t,e,a,r)},_lerp:function(e,t,n,r,i){const a=1-r;for(let o=0;o!==i;++o){const i=t+o;e[i]=e[i]*a+e[n+o]*r}},_lerpAdditive:function(e,t,n,r,i){for(let a=0;a!==i;++a){const i=t+a;e[i]=e[i]+e[n+a]*r}}});const Wl=new RegExp("[\\[\\]\\.:\\/]","g"),Yl="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Jl=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Zl=/(WCOD+)?/.source.replace("WCOD",Yl),Kl=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Xl=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),ql=new RegExp("^"+Jl+Zl+Kl+Xl+"$"),$l=["material","materials","bones"];function ec(e,t,n){const r=n||tc.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,r)}function tc(e,t,n){this.path=t,this.parsedPath=n||tc.parseTrackName(t),this.node=tc.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}Object.assign(ec.prototype,{getValue:function(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,r=this._bindings[n];void 0!==r&&r.getValue(e,t)},setValue:function(e,t){const n=this._bindings;for(let r=this._targetGroup.nCachedObjects_,i=n.length;r!==i;++r)n[r].setValue(e,t)},bind:function(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()},unbind:function(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}),Object.assign(tc,{Composite:ec,create:function(e,t,n){return e&&e.isAnimationObjectGroup?new tc.Composite(e,t,n):new tc(e,t,n)},sanitizeNodeName:function(e){return e.replace(/\s/g,"_").replace(Wl,"")},parseTrackName:function(e){const t=ql.exec(e);if(!t)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},r=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==r&&-1!==r){const e=n.nodeName.substring(r+1);-1!==$l.indexOf(e)&&(n.nodeName=n.nodeName.substring(0,r),n.objectName=e)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n},findNode:function(e,t){if(!t||""===t||"."===t||-1===t||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(void 0!==n)return n}if(e.children){const n=function(e){for(let r=0;r=i){const a=i++,c=e[a];t[c.uuid]=l,e[l]=c,t[s]=a,e[a]=o;for(let e=0,t=r;e!==t;++e){const t=n[e],r=t[a],i=t[l];t[l]=r,t[a]=i}}}this.nCachedObjects_=i},uncache:function(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,r=n.length;let i=this.nCachedObjects_,a=e.length;for(let o=0,s=arguments.length;o!==s;++o){const s=arguments[o].uuid,l=t[s];if(void 0!==l)if(delete t[s],l0&&(t[o.uuid]=l),e[l]=o,e.pop();for(let e=0,t=r;e!==t;++e){const t=n[e];t[l]=t[i],t.pop()}}}this.nCachedObjects_=i},subscribe_:function(e,t){const n=this._bindingsIndicesByPath;let r=n[e];const i=this._bindings;if(void 0!==r)return i[r];const a=this._paths,o=this._parsedPaths,s=this._objects,l=s.length,c=this.nCachedObjects_,u=new Array(l);r=i.length,n[e]=r,a.push(e),o.push(t),i.push(u);for(let n=c,r=s.length;n!==r;++n){const r=s[n];u[n]=new tc(r,e,t)}return u},unsubscribe_:function(e){const t=this._bindingsIndicesByPath,n=t[e];if(void 0!==n){const r=this._paths,i=this._parsedPaths,a=this._bindings,o=a.length-1,s=a[o];t[e[o]]=n,a[n]=s,a.pop(),i[n]=i[o],i.pop(),r[n]=r[o],r.pop()}}});class nc{constructor(e,t,n=null,r=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=r;const i=t.tracks,a=i.length,o=new Array(a),s={endingStart:2400,endingEnd:2400};for(let e=0;e!==a;++e){const t=i[e].createInterpolant(null);o[e]=t,t.settings=s}this._interpolantSettings=s,this._interpolants=o,this._propertyBindings=new Array(a),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){const n=this._clip.duration,r=e._clip.duration,i=r/n,a=n/r;e.warp(1,i,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return null!==e&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const r=this._mixer,i=r.time,a=this.timeScale;let o=this._timeScaleInterpolant;null===o&&(o=r._lendControlInterpolant(),this._timeScaleInterpolant=o);const s=o.parameterPositions,l=o.sampleValues;return s[0]=i,s[1]=i+n,l[0]=e/a,l[1]=t/a,this}stopWarping(){const e=this._timeScaleInterpolant;return null!==e&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,r){if(!this.enabled)return void this._updateWeight(e);const i=this._startTime;if(null!==i){const r=(e-i)*n;if(r<0||0===n)return;this._startTime=null,t=n*r}t*=this._updateTimeScale(e);const a=this._updateTime(t),o=this._updateWeight(e);if(o>0){const e=this._interpolants,t=this._propertyBindings;switch(this.blendMode){case 2501:for(let n=0,r=e.length;n!==r;++n)e[n].evaluate(a),t[n].accumulateAdditive(o);break;case 2500:default:for(let n=0,i=e.length;n!==i;++n)e[n].evaluate(a),t[n].accumulate(r,o)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(null!==n){const r=n.evaluate(e)[0];t*=r,e>n.parameterPositions[1]&&(this.stopFading(),0===r&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(null!==n){t*=n.evaluate(e)[0],e>n.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let r=this.time+e,i=this._loopCount;const a=2202===n;if(0===e)return-1===i?r:a&&1==(1&i)?t-r:r;if(2200===n){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(r>=t)r=t;else{if(!(r<0)){this.time=r;break e}r=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,a)):this._setEndings(0===this.repetitions,!0,a)),r>=t||r<0){const n=Math.floor(r/t);r-=t*n,i+=Math.abs(n);const o=this.repetitions-i;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,r=e>0?t:0,this.time=r,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===o){const t=e<0;this._setEndings(t,!t,a)}else this._setEndings(!1,!1,a);this._loopCount=i,this.time=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=r;if(a&&1==(1&i))return t-r}return r}_setEndings(e,t,n){const r=this._interpolantSettings;n?(r.endingStart=2401,r.endingEnd=2401):(r.endingStart=e?this.zeroSlopeAtStart?2401:2400:2402,r.endingEnd=t?this.zeroSlopeAtEnd?2401:2400:2402)}_scheduleFading(e,t,n){const r=this._mixer,i=r.time;let a=this._weightInterpolant;null===a&&(a=r._lendControlInterpolant(),this._weightInterpolant=a);const o=a.parameterPositions,s=a.sampleValues;return o[0]=i,s[0]=t,o[1]=i+e,s[1]=n,this}}function rc(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}rc.prototype=Object.assign(Object.create(ye.prototype),{constructor:rc,_bindAction:function(e,t){const n=e._localRoot||this._root,r=e._clip.tracks,i=r.length,a=e._propertyBindings,o=e._interpolants,s=n.uuid,l=this._bindingsByRootAndName;let c=l[s];void 0===c&&(c={},l[s]=c);for(let e=0;e!==i;++e){const i=r[e],l=i.name;let u=c[l];if(void 0!==u)a[e]=u;else{if(u=a[e],void 0!==u){null===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,s,l));continue}const r=t&&t._propertyBindings[e].binding.parsedPath;u=new Gl(tc.create(n,l,r),i.ValueTypeName,i.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,s,l),a[e]=u}o[e].resultBuffer=u.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){const t=(e._localRoot||this._root).uuid,n=e._clip.uuid,r=this._actionsByClip[n];this._bindAction(e,r&&r.knownActions[0]),this._addInactiveAction(e,n,t)}const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let e=0,n=t.length;e!==n;++e){const n=t[e];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){const t=e._cacheIndex;return null!==t&&t=0;--t)e[t].stop();return this},update:function(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,r=this.time+=e,i=Math.sign(e),a=this._accuIndex^=1;for(let o=0;o!==n;++o){t[o]._update(r,e,i,a)}const o=this._bindings,s=this._nActiveBindings;for(let e=0;e!==s;++e)o[e].apply(a);return this},setTime:function(e){this.time=0;for(let e=0;e4?o=vc[i-8+4-1]:0==i&&(o=0),n.push(o);const s=1/(a-1),l=-s/2,c=1+s/2,u=[l,l,c,l,c,c,l,l,c,c,l,c],d=6,p=6,h=3,f=2,m=1,g=new Float32Array(h*p*d),A=new Float32Array(f*p*d),v=new Float32Array(m*p*d);for(let e=0;e2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];g.set(r,h*p*e),A.set(u,f*p*e);const i=[e,e,e,e,e,e];v.set(i,m*p*e)}const y=new In;y.setAttribute("position",new cn(g,h)),y.setAttribute("uv",new cn(A,f)),y.setAttribute("faceIndex",new cn(v,m)),e.push(y),r>4&&r--}return{_lodPlanes:e,_sizeLods:t,_sigmas:n}}function Mc(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Ks.call(this,e),this.type="catmullrom"}zs.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(zs.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(cl.prototype,{fromPoints:function(e){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(e)}}),Object.create(Ks.prototype),Object.create(Ks.prototype),Mc.prototype=Object.create(Ks.prototype),Object.assign(Mc.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),class extends ho{constructor(e=10,t=10,n=4473924,r=8947848){n=new tn(n),r=new tn(r);const i=t/2,a=e/t,o=e/2,s=[],l=[];for(let e=0,c=0,u=-o;e<=t;e++,u+=a){s.push(-o,0,u,o,0,u),s.push(u,0,-o,u,0,o);const t=e===i?n:r;t.toArray(l,c),c+=3,t.toArray(l,c),c+=3,t.toArray(l,c),c+=3,t.toArray(l,c),c+=3}const c=new In;c.setAttribute("position",new vn(s,3)),c.setAttribute("color",new vn(l,3));super(c,new ro({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},class extends ho{constructor(e){const t=function e(t){const n=[];t&&t.isBone&&n.push(t);for(let r=0;rthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new Ee),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new Ee),t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return uc.copy(e).clamp(this.min,this.max).sub(e).length()}intersect(e){return this.min.max(e.min),this.max.min(e.max),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}.prototype,{center:function(e){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},size:function(e){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign(Le.prototype,{center:function(e){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(e)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(e){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionSphere:function(e){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)},size:function(e){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(e)}}),Object.assign($e.prototype,{empty:function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()}}),cr.prototype.setFromMatrix=function(e){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(e)},class{constructor(e,t){this.start=void 0!==e?e:new Fe,this.end=void 0!==t?t:new Fe}set(e,t){return this.start.copy(e),this.end.copy(t),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return void 0===e&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new Fe),e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return void 0===e&&(console.warn("THREE.Line3: .delta() target is now required"),e=new Fe),e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return void 0===t&&(console.warn("THREE.Line3: .at() target is now required"),t=new Fe),this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){dc.subVectors(e,this.start),pc.subVectors(this.end,this.start);const n=pc.dot(pc);let r=pc.dot(dc)/n;return t&&(r=we.clamp(r,0,1)),r}closestPointToPoint(e,t,n){const r=this.closestPointToPointParameter(e,t);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new Fe),this.delta(n).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}.prototype.center=function(e){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(e)},Object.assign(we,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(e){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),we.floorPowerOfTwo(e)},nextPowerOfTwo:function(e){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),we.ceilPowerOfTwo(e)}}),Object.assign(Se.prototype,{flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},multiplyVector3:function(e){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),e.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},getInverse:function(e){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()}}),Object.assign(lt.prototype,{extractPosition:function(e){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(e)},flattenToArrayOffset:function(e,t){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(e,t)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new Fe).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(e){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(e)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(e){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector4:function(e){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(e){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),e.transformDirection(this)},crossVector:function(e){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(e){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),e.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(e,t,n,r,i,a){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(e,t,r,n,i,a)},getInverse:function(e){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(e).invert()}}),Lt.prototype.isIntersectionLine=function(e){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(e)},Object.assign(De.prototype,{multiplyVector3:function(e){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),e.applyQuaternion(this)},inverse:function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()}}),Object.assign(st.prototype,{isIntersectionBox:function(e){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(e)},isIntersectionPlane:function(e){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(e)},isIntersectionSphere:function(e){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(e)}}),Object.assign(Jt.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(e,t){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(e,t)},midpoint:function(e){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(e)},normal:function(e){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(e)},plane:function(e){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(e)}}),Object.assign(Jt,{barycoordFromPoint:function(e,t,n,r,i){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),Jt.getBarycoord(e,t,n,r,i)},normal:function(e,t,n,r){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),Jt.getNormal(e,t,n,r)}}),Object.assign(ul.prototype,{extractAllPoints:function(e){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(e)},extrude:function(e){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new es(this,e)},makeGeometry:function(e){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new rs(this,e)}}),Object.assign(Ee.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Fe.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(e){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(e)},getScaleFromMatrix:function(e){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(e)},getColumnFromMatrix:function(e,t){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},applyProjection:function(e){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(e)},fromAttribute:function(e,t,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},distanceToManhattan:function(e){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(e)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Ie.prototype,{fromAttribute:function(e,t,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(e,t,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Dt.prototype,{getChildByName:function(e){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(e)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(e,t){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(t,e)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(e){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(Dt.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(e){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=e}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(Jn.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(Jn.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(Ha.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(Xa.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Ya.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(zs.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(e){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=e}}),nr.prototype.setLens=function(e,t){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==t&&(this.filmGauge=t),this.setFocalLength(e)},Object.defineProperties(dl.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(e){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=e}},shadowCameraLeft:{set:function(e){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=e}},shadowCameraRight:{set:function(e){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=e}},shadowCameraTop:{set:function(e){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=e}},shadowCameraBottom:{set:function(e){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=e}},shadowCameraNear:{set:function(e){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=e}},shadowCameraFar:{set:function(e){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=e}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(e){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=e}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(e){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=e}},shadowMapHeight:{set:function(e){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=e}}}),Object.defineProperties(cn.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),35048===this.usage},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(35048)}}}),Object.assign(cn.prototype,{setDynamic:function(e){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?35048:35044),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(In.prototype,{addIndex:function(e){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(e)},addAttribute:function(e,t){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):this.setAttribute(e,t):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(e,new cn(arguments[1],arguments[2])))},addDrawCall:function(e,t,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(e,t)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(e){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(e)},applyMatrix:function(e){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(e)}}),Object.defineProperties(In.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(Bl.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(e){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=e}}}),Object.defineProperties(sc.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(e){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=e}}}),Object.defineProperties(ba.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),35048===this.usage},set:function(e){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(e)}}}),Object.assign(ba.prototype,{setDynamic:function(e){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===e?35048:35044),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(es.prototype,{getArrays:function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")}}),Object.assign(ya.prototype,{dispose:function(){console.error("THREE.Scene: .dispose() has been removed.")}}),Object.defineProperties(ic.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(an.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new tn}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===e}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(e){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=e}}}),Object.defineProperties(ls.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(ss.prototype,{transparency:{get:function(){return console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission},set:function(e){console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission=e}}}),Object.defineProperties(er.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(e){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=e}}}),Object.assign(ga.prototype,{clearTarget:function(e,t,n,r){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(e),this.clear(t,n,r)},animate:function(e){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(e)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(e){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(e)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(ga.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=e}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(e){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=e}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(e){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===e?3001:3e3}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(sa.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(ke.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=e}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(e){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=e}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=e}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(e){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=e}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(e){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=e}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(e){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=e}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(e){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=e}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(e){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=e}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(e){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=e}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(e){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=e}}}),Object.defineProperties(jl.prototype,{load:{value:function(e){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const t=this;return(new Ll).load(e,(function(e){t.setBuffer(e)})),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),class{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let n=0;n