!function(e,t){"object"==typeofexports&&"object"==typeofmodule?module.exports=t():"function"==typeofdefine&&define.amd?define([],t):"object"==typeofexports?exports.dat=t():e.dat=t()}(this,function(){returnfunction(e){functiont(o){if(n[o])returnn[o].exports;vari=n[o]={exports:{},id:o,loaded:!1};returne[o].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}varn={};returnt.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";functiono(e){returne&&e.__esModule?e:{"default":e}}vari=n(1),r=o(i);e.exports=r["default"]},function(e,t,n){"use strict";functiono(e){returne&&e.__esModule?e:{"default":e}}t.__esModule=!0;vari=n(2),r=o(i),a=n(6),l=o(a),s=n(3),u=o(s),d=n(7),c=o(d),f=n(8),_=o(f),p=n(10),h=o(p),m=n(11),b=o(m),g=n(12),v=o(g),y=n(13),w=o(y),x=n(14),E=o(x),C=n(15),A=o(C),S=n(16),k=o(S),O=n(9),T=o(O),R=n(17),L=o(R);t["default"]={color:{Color:r["default"],math:l["default"],interpret:u["default"]},controllers:{Controller:c["default"],BooleanController:_["default"],OptionController:h["default"],StringController:b["default"],NumberController:v["default"],NumberControllerBox:w["default"],NumberControllerSlider:E["default"],FunctionController:A["default"],ColorController:k["default"]},dom:{dom:T["default"]},gui:{GUI:L["default"]},GUI:L["default"]}},function(e,t,n){"use strict";functiono(e){returne&&e.__esModule?e:{"default":e}}functioni(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}functionr(e,t,n){Object.defineProperty(e,t,{get:function(){return"RGB"===this.__state.space?this.__state[t]:(h.recalculateRGB(this,t,n),this.__state[t])},set:function(e){"RGB"!==this.__state.space&&(h.recalculateRGB(this,t,n),this.__state.space="RGB"),this.__state[t]=e}})}functiona(e,t){Object.defineProperty(e,t,{get:function(){return"HSV"===this.__state.space?this.__state[t]:(h.recalculateHSV(this),this.__state[t])},set:function(e){"HSV"!==this.__state.space&&(h.recalculateHSV(this),this.__state.space="HSV"),this.__state[t]=e}})}t.__esModule=!0;varl=n(3),s=o(l),u=n(6),d=o(u),c=n(4),f=o(c),_=n(5),p=o(_),h=function(){functione(){if(i(this,e),this.__state=s["default"].apply(this,arguments),this.__state===!1)thrownewError("Failed to interpret color arguments");this.__state.a=this.__state.a||1}returne.prototype.toString=function(){return(0,f["default"])(this)},e.prototype.toHexString=function(){return(0,f["default"])(this,!0)},e.prototype.toOriginal=function(){returnthis.__state.conversion.write(this)},e}();h.recalculateRGB=function(e,t,n){if("HEX"===e.__state.space)e.__state[t]=d["default"].component_from_hex(e.__state.hex,n);else{if("HSV"!==e.__state.space)thrownewError("Corrupted color state");p["default"].extend(e.__state,d["default"].hsv_to_rgb(e.__state.h,e.__state.s,e.__state.v))}},h.recalculateHSV=function(e){vart=d["default"].rgb_to_hsv(e.r,e.g,e.b);p["default"].extend(e.__state,{s:t.s,v:t.v}),p["default"].isNaN(t.h)?p["default"].isUndefined(e.__state.h)&&(e.__state.h=0):e.__state.h=t.h},h.COMPONENTS=["r","g","b","h","s","v","hex","a"],r(h.prototype,"r",2),r(h.prototype,"g",1),r(h.prototype,"b",0),a(h.prototype,"h"),a(h.prototype,"s"),a(h.prototype,"v"),Object.defineProperty(h.prototype,"a",{get:function(){returnthis.__state.a},set:function(e){this.__state.a=e}}),Object.defineProperty(h.prototype,"hex",{get:function(){return"HEX"!==!this.__state.space&&(this.__state.hex=d["default"].rgb_to_hex(this.r,this.g,this.b)),this.__state.hex},set:function(e){this.__state.space="HEX",this.__state.hex=e}}),t["default"]=h},function(e,t,n){"use strict";functiono(e){returne&&e.__esModule?e:{"default":e}}t.__esModule=!0;vari=n(4),r=o(i),a=n(5),l=o(a),s=[{litmus:l["default"].isString,conversions:{THREE_CHAR_HEX:{read:function(e){vart=e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);returnnull!==t&&{space:"HEX",hex:parseInt("0x"+t[1].toString()+t[1].toString()+t[2].toString()+t[2].toString()+t[3].toString()+t[3].toString(),0)}},write:r["default"]},SIX_CHAR_HEX:{read:function(e){vart=e.match(/^#([A-F0-9]{6})$/i);returnnull!==t&&{space:"HEX",hex:parseInt("0x"+t[1].toString(),0)}},write:r["defaul
n},listen:function(){returnn.__gui.listen(n),n},remove:function(){returnn.__gui.remove(n),n}}),ninstanceofM["default"])!function(){vare=newB["default"](n.object,n.property,{min:n.__min,max:n.__max,step:n.__step});U["default"].each(["updateDisplay","onChange","onFinishChange","step"],function(t){varo=n[t],i=e[t];n[t]=e[t]=function(){vart=Array.prototype.slice.call(arguments);returni.apply(e,t),o.apply(n,t)}}),z["default"].addClass(t,"has-slider"),n.domElement.insertBefore(e.domElement,n.domElement.firstElementChild)}();elseif(ninstanceofB["default"]){varo=function(t){if(U["default"].isNumber(n.__min)&&U["default"].isNumber(n.__max)){varo=n.__li.firstElementChild.firstElementChild.innerHTML,i=n.__gui.__listening.indexOf(n)>-1;n.remove();varr=s(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[n.__min,n.__max,n.__step]});returnr.name(o),i&&r.listen(),r}returnt};n.min=U["default"].compose(o,n.min),n.max=U["default"].compose(o,n.max)}elseninstanceofO["default"]?(z["default"].bind(t,"click",function(){z["default"].fakeEvent(n.__checkbox,"click")}),z["default"].bind(n.__checkbox,"click",function(e){e.stopPropagation()})):ninstanceofR["default"]?(z["default"].bind(t,"click",function(){z["default"].fakeEvent(n.__button,"click")}),z["default"].bind(t,"mouseover",function(){z["default"].addClass(n.__button,"hover")}),z["default"].bind(t,"mouseout",function(){z["default"].removeClass(n.__button,"hover")})):ninstanceofj["default"]&&(z["default"].addClass(t,"color"),n.updateDisplay=U["default"].compose(function(e){returnt.style.borderLeftColor=n.__color.toString(),e},n.updateDisplay),n.updateDisplay());n.setValue=U["default"].compose(function(t){returne.getRoot().__preset_select&&n.isModified()&&r(e.getRoot(),!0),t},n.setValue)}functionl(e,t){varn=e.getRoot(),o=n.__rememberedObjects.indexOf(t.object);if(o!==-1){vari=n.__rememberedObjectIndecesToControllers[o];if(void0===i&&(i={},n.__rememberedObjectIndecesToControllers[o]=i),i[t.property]=t,n.load&&n.load.remembered){varr=n.load.remembered,a=void0;if(r[e.preset])a=r[e.preset];else{if(!r[Q])return;a=r[Q]}if(a[o]&&void0!==a[o][t.property]){varl=a[o][t.property];t.initialValue=l,t.setValue(l)}}}}functions(e,t,n,o){if(void0===t[n])thrownewError('Object "'+t+'" has no property "'+n+'"');varr=void0;if(o.color)r=newj["default"](t,n);else{vars=[t,n].concat(o.factoryArgs);r=C["default"].apply(e,s)}o.beforeinstanceofS["default"]&&(o.before=o.before.__li),l(e,r),z["default"].addClass(r.domElement,"c");varu=document.createElement("span");z["default"].addClass(u,"property-name"),u.innerHTML=r.property;vard=document.createElement("div");d.appendChild(u),d.appendChild(r.domElement);varc=i(e,d,o.before);returnz["default"].addClass(c,oe.CLASS_CONTROLLER_ROW),rinstanceofj["default"]?z["default"].addClass(c,"color"):z["default"].addClass(c,g(r.getValue())),a(e,c,r),e.__controllers.push(r),r}functionu(e,t){returndocument.location.href+"."+t}functiond(e,t,n){varo=document.createElement("option");o.innerHTML=t,o.value=t,e.__preset_select.appendChild(o),n&&(e.__preset_select.selectedIndex=e.__preset_select.length-1)}functionc(e,t){t.style.display=e.useLocalStorage?"block":"none"}functionf(e){vart=e.__save_row=document.createElement("li");z["default"].addClass(e.domElement,"has-save"),e.__ul.insertBefore(t,e.__ul.firstChild),z["default"].addClass(t,"save-row");varn=document.createElement("span");n.innerHTML=" ",z["default"].addClass(n,"button gears");varo=document.createElement("span");o.innerHTML="Save",z["default"].addClass(o,"button"),z["default"].addClass(o,"save");vari=document.createElement("span");i.innerHTML="New",z["default"].addClass(i,"button"),z["default"].addClass(i,"save-as");varr=document.createElement("span");r.innerHTML="Revert",z["default"].addClass(r,"button"),z["default"].addClass(r,"revert");vara=e.__preset_select=document.createElement("select");e.load&&e.load.remembered?U["default"].each(e.load.remembered,function(t,n){d(e,n,n===e.preset)}):d(e,Q,!1),z["default"].bind(a,"change",function(){for(vart=