text: !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Events=t()}(this,(function(){"use strict";var e=["Light","Mesh","Object3D"],t=function(e,t,o,a){var r={};r[o[0]]={r:255*e[o[0]].r,g:255*e[o[0]].g,b:255*e[o[0]].b},t.addColor(r,o[0],o[1]).onChange((function(t){e[o[0]].r=t.r/255,e[o[0]].g=t.g/255,e[o[0]].b=t.b/255,a&&a(t)}))},o=function(t,o,a){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(t&&o.children.length>0){var n=r?a:a.addFolder("children");o.children.forEach((function(t,o){for(var a=0;a<e.length;a++){var r=e[a];if(t["is".concat(r)]){var i=t.name?t.name+"-"+o:t.type+"-"+o;n["add".concat(r)](i,t,{recursive:!0});break}}}))}},a=[["aoMapIntensity",0,1],["bumpScale",0,1],["clearCoat",0,1],["clearCoatRoughness",0,1],["color","color"],["displacementScale",0,10],["emissive","color"],["emissiveIntensity",0,1],["envMapIntensity",0,1],["lightMapIntensity",0,1],["metalness",0,1],["opacity",0,1],["reflectivity",0,1],["refractionRatio",0,1],["roughness",0,1],["shininess",0,1],["specular","color"],["wireframe",!0]],r=[["angle",0,Math.PI/2],["color","color"],["decay",0,2],["distance",0,1e3],["groundColor","color"],["intensity",0,5],["penumbra",0,1],["power",0,8*Math.PI]],n=[["bottom",0],["far",0],["filmGauge",0],["filmOffset",0],["focus",0],["fov",0,180],["left",0],["near",0],["right",0],["top",0],["zoom",0]],i=[["background","color"],["fog","fog"],["overrideMaterial","material"]],d=[["color","color"],["far",0],["near",0],["density",0]],c={addVector:function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=o.step,r=void 0===a?.1:a,n=this.addFolder(e);return Math.abs(t.x)>=0&&n.add(t,"x").step(r),Math.abs(t.y)>=0&&n.add(t,"y").step(r),Math.abs(t.z)>=0&&n.add(t,"z").step(r),Math.abs(t.w)>=0&&n.add(t,"w").step(r),n},addObject3D:function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=a.recursive,n=void 0!==r&&r,i=a.inner,d=void 0!==i&&i,c=a.stepPosition,s=void 0===c?1:c,l=a.stepRotation,f=void 0===l?.02:l,u=a.stepScale,h=void 0===u?.01:u,v=!1===d?this.addFolder(e):this;return v.addVector("position",t.position,s),v.addVector("rotation",t.rotation,f),v.addVector("scale",t.scale,h),o(n,t,v),v},addMaterial:function(e,o){var r=this.addFolder(e);return a.forEach((function(e){o.hasOwnProperty(e[0])&&("color"===e[1]?t(o,r,e,(function(){return o.needsUpdate=!0})):r.add(o,e[0],e[1],e[2]).onChange((function(){return o.needsUpdate=!0})))})),r},addLight:function(e,o){var a=this.addFolder(e);return a.addObject3D(null,o,{inner:!0}),r.forEach((function(e){o.hasOwnProperty(e[0])&&("color"===e[1]?t(o,a,e):a.add(o,e[0],e[1],e[2]))})),a},addCamera:function(e,o){var a=this.addFolder(e);return a.addObject3D("object",o,{inner:!0}),n.forEach((function(e){o.hasOwnProperty(e[0])&&("color"===e[1]?t(o,a,e):a.add(o,e[0],e[1],e[2]).onChange((function(){o.updateProjectionMatrix&&o.updateProjectionMatrix()})))})),a},addScene:function(e,a){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.recursive,d=void 0!==n&&n,c=this.addFolder(e);return i.forEach((function(e){if(a.hasOwnProperty(e[0])&&null!==a[e[0]])switch(e[1]){case"color":t(a,c,e,(function(){return a.needsUpdate=!0}));break;case"fog":c.addFog(e[0],a[e[0]]);break;case"material":c.addMaterial(e[0],a[e[0]]);break;default:c.add(a[e[0]],e[0],e[1],e[2])}})),o(d,a,c,!0),c},addMesh:function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=o.recursive,r=void 0!==a&&a,n=this.addFolder(e);n.addMaterial("material",t.material),n.addObject3D("object",t,{inner:!0,recursive:r})},addFog:function(e,o){var a=this.addFolder(e);return d.forEach((function(e){o.hasOwnProperty(e[0])&&("color"===e[1]?t(o,a,e):a.add(o,e[0],e[1],e[2],e[3]))})),a}};return function(e){var t=e.GUI.prototype;Object.keys(c).forEach((function(e){var o=c[e];t[e]?console.warn('three-dat.gui: The method "'.concat(o.name,"\" already exist. Check compatibility or check if three-dat.gui hasn't been imported twice.")):t[e]=o}))}}));
  