UNPKG

@meese-os/website

Version:

meeseOS, implemented in OS.js

2 lines 1.37 MB
/*! For license information please see hexells.20a29a0967bb5a74fbcd.bundle.js.LICENSE.txt */ (self.webpackChunk_meese_os_website=self.webpackChunk_meese_os_website||[]).push([[516],{588:(e,t,n)=>{"use strict";function r(e,t){var n=e.__state.conversionName.toString(),r=Math.round(e.r),i=Math.round(e.g),o=Math.round(e.b),a=e.a,s=Math.round(e.h),u=e.s.toFixed(1),f=e.v.toFixed(1);if(t||"THREE_CHAR_HEX"===n||"SIX_CHAR_HEX"===n){for(var l=e.hex.toString(16);l.length<6;)l="0"+l;return"#"+l}return"CSS_RGB"===n?"rgb("+r+","+i+","+o+")":"CSS_RGBA"===n?"rgba("+r+","+i+","+o+","+a+")":"HEX"===n?"0x"+e.hex.toString(16):"RGB_ARRAY"===n?"["+r+","+i+","+o+"]":"RGBA_ARRAY"===n?"["+r+","+i+","+o+","+a+"]":"RGB_OBJ"===n?"{r:"+r+",g:"+i+",b:"+o+"}":"RGBA_OBJ"===n?"{r:"+r+",g:"+i+",b:"+o+",a:"+a+"}":"HSV_OBJ"===n?"{h:"+s+",s:"+u+",v:"+f+"}":"HSVA_OBJ"===n?"{h:"+s+",s:"+u+",v:"+f+",a:"+a+"}":"unknown format"}n.r(t),n.d(t,{GUI:()=>ze,color:()=>xe,controllers:()=>ye,default:()=>Xe,dom:()=>ge,gui:()=>we});var i,o=Array.prototype.forEach,a=Array.prototype.slice,s={BREAK:{},extend:function(e){return this.each(a.call(arguments,1),(function(t){(this.isObject(t)?Object.keys(t):[]).forEach(function(n){this.isUndefined(t[n])||(e[n]=t[n])}.bind(this))}),this),e},defaults:function(e){return this.each(a.call(arguments,1),(function(t){(this.isObject(t)?Object.keys(t):[]).forEach(function(n){this.isUndefined(e[n])&&(e[n]=t[n])}.bind(this))}),this),e},compose:function(){var e=a.call(arguments);return function(){for(var t=a.call(arguments),n=e.length-1;0<=n;n--)t=[e[n].apply(this,t)];return t[0]}},each:function(e,t,n){if(e)if(o&&e.forEach&&e.forEach===o)e.forEach(t,n);else if(e.length===e.length+0){for(var r=void 0,i=(r=0,e.length);r<i;r++)if(r in e&&t.call(n,e[r],r)===this.BREAK)return}else for(var a in e)if(t.call(n,e[a],a)===this.BREAK)return},defer:function(e){setTimeout(e,0)},debounce:function(e,t,n){var r=void 0;return function(){var i=this,o=arguments,a=n||!r;clearTimeout(r),r=setTimeout((function(){r=null,n||e.apply(i,o)}),t),a&&e.apply(i,o)}},toArray:function(e){return e.toArray?e.toArray():a.call(e)},isUndefined:function(e){return void 0===e},isNull:function(e){return null===e},isNaN:(i=function(e){return isNaN(e)},u.toString=function(){return i.toString()},u),isArray:Array.isArray||function(e){return e.constructor===Array},isObject:function(e){return e===Object(e)},isNumber:function(e){return e===e+0},isString:function(e){return e===e+""},isBoolean:function(e){return!1===e||!0===e},isFunction:function(e){return e instanceof Function}};function u(e){return i.apply(this,arguments)}function f(){m=!1;var e=1<arguments.length?s.toArray(arguments):arguments[0];return s.each(c,(function(t){if(t.litmus(e))return s.each(t.conversions,(function(t,n){if(h=t.read(e),!1===m&&!1!==h)return(m=h).conversionName=n,h.conversion=t,s.BREAK})),s.BREAK})),m}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var d,c=[{litmus:s.isString,conversions:{THREE_CHAR_HEX:{read:function(e){return null!==(e=e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i))&&{space:"HEX",hex:parseInt("0x"+e[1].toString()+e[1].toString()+e[2].toString()+e[2].toString()+e[3].toString()+e[3].toString(),0)}},write:r},SIX_CHAR_HEX:{read:function(e){return null!==(e=e.match(/^#([A-F0-9]{6})$/i))&&{space:"HEX",hex:parseInt("0x"+e[1].toString(),0)}},write:r},CSS_RGB:{read:function(e){return null!==(e=e.match(/^rgb\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/))&&{space:"RGB",r:parseFloat(e[1]),g:parseFloat(e[2]),b:parseFloat(e[3])}},write:r},CSS_RGBA:{read:function(e){return null!==(e=e.match(/^rgba\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/))&&{space:"RGB",r:parseFloat(e[1]),g:parseFloat(e[2]),b:parseFloat(e[3]),a:parseFloat(e[4])}},write:r}}},{litmus:s.isNumber,conversions:{HEX:{read:function(e){return{space:"HEX",hex:e,conversionName:"HEX"}},write:function(e){return e.hex}}}},{litmus:s.isArray,conversions:{RGB_ARRAY:{read:function(e){return 3===e.length&&{space:"RGB",r:e[0],g:e[1],b:e[2]}},write:function(e){return[e.r,e.g,e.b]}},RGBA_ARRAY:{read:function(e){return 4===e.length&&{space:"RGB",r:e[0],g:e[1],b:e[2],a:e[3]}},write:function(e){return[e.r,e.g,e.b,e.a]}}}},{litmus:s.isObject,conversions:{RGBA_OBJ:{read:function(e){return!!(s.isNumber(e.r)&&s.isNumber(e.g)&&s.isNumber(e.b)&&s.isNumber(e.a))&&{space:"RGB",r:e.r,g:e.g,b:e.b,a:e.a}},write:function(e){return{r:e.r,g:e.g,b:e.b,a:e.a}}},RGB_OBJ:{read:function(e){return!!(s.isNumber(e.r)&&s.isNumber(e.g)&&s.isNumber(e.b))&&{space:"RGB",r:e.r,g:e.g,b:e.b}},write:function(e){return{r:e.r,g:e.g,b:e.b}}},HSVA_OBJ:{read:function(e){return!!(s.isNumber(e.h)&&s.isNumber(e.s)&&s.isNumber(e.v)&&s.isNumber(e.a))&&{space:"HSV",h:e.h,s:e.s,v:e.v,a:e.a}},write:function(e){return{h:e.h,s:e.s,v:e.v,a:e.a}}},HSV_OBJ:{read:function(e){return!!(s.isNumber(e.h)&&s.isNumber(e.s)&&s.isNumber(e.v))&&{space:"HSV",h:e.h,s:e.s,v:e.v}},write:function(e){return{h:e.h,s:e.s,v:e.v}}}}}],h=void 0,m=void 0,v={hsv_to_rgb:function(e,t,n){var r=Math.floor(e/60)%6,i=n*(1-t),o=n*(1-(e=e/60-Math.floor(e/60))*t);return{r:255*(t=[[n,e=n*(1-(1-e)*t),i],[o,n,i],[i,n,e],[i,o,n],[e,i,n],[n,i,o]][r])[0],g:255*t[1],b:255*t[2]}},rgb_to_hsv:function(e,t,n){var r=Math.min(e,t,n),i=Math.max(e,t,n),o=void(r=i-r);return 0===i?{h:NaN,s:0,v:0}:(o=e===i?(t-n)/r:t===i?2+(n-e)/r:4+(e-t)/r,(o/=6)<0&&(o+=1),{h:360*o,s:r/i,v:i/255})},rgb_to_hex:function(e,t,n){return e=this.hex_with_component(0,2,e),e=this.hex_with_component(e,1,t),this.hex_with_component(e,0,n)},component_from_hex:function(e,t){return e>>8*t&255},hex_with_component:function(e,t,n){return n<<(d=8*t)|e&~(255<<d)}},b="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};function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function x(e,t,n){null===e&&(e=Function.prototype);var r=Object.getOwnPropertyDescriptor(e,t);return void 0!==r?"value"in r?r.value:void 0!==(r=r.get)?r.call(n):void 0:null!==(r=Object.getPrototypeOf(e))?x(r,t,n):void 0}function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function g(e,t){if(e)return!t||"object"!=typeof t&&"function"!=typeof t?e:t;throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}n=function(e,t,n){return t&&p(e.prototype,t),n&&p(e,n),e},n(z,[{key:"toString",value:function(){return r(this)}},{key:"toHexString",value:function(){return r(this,!0)}},{key:"toOriginal",value:function(){return this.__state.conversion.write(this)}}]);var w=z;function z(){if(l(this,z),this.__state=f.apply(this,arguments),!1===this.__state)throw new Error("Failed to interpret color arguments");this.__state.a=this.__state.a||1}function X(e,t,n){Object.defineProperty(e,t,{get:function(){return"RGB"!==this.__state.space&&w.recalculateRGB(this,t,n),this.__state[t]},set:function(e){"RGB"!==this.__state.space&&(w.recalculateRGB(this,t,n),this.__state.space="RGB"),this.__state[t]=e}})}function A(e,t){Object.defineProperty(e,t,{get:function(){return"HSV"!==this.__state.space&&w.recalculateHSV(this),this.__state[t]},set:function(e){"HSV"!==this.__state.space&&(w.recalculateHSV(this),this.__state.space="HSV"),this.__state[t]=e}})}w.recalculateRGB=function(e,t,n){if("HEX"===e.__state.space)e.__state[t]=v.component_from_hex(e.__state.hex,n);else{if("HSV"!==e.__state.space)throw new Error("Corrupted color state");s.extend(e.__state,v.hsv_to_rgb(e.__state.h,e.__state.s,e.__state.v))}},w.recalculateHSV=function(e){var t=v.rgb_to_hsv(e.r,e.g,e.b);s.extend(e.__state,{s:t.s,v:t.v}),s.isNaN(t.h)?s.isUndefined(e.__state.h)&&(e.__state.h=0):e.__state.h=t.h},w.COMPONENTS=["r","g","b","h","s","v","hex","a"],X(w.prototype,"r",2),X(w.prototype,"g",1),X(w.prototype,"b",0),A(w.prototype,"h"),A(w.prototype,"s"),A(w.prototype,"v"),Object.defineProperty(w.prototype,"a",{get:function(){return this.__state.a},set:function(e){this.__state.a=e}}),Object.defineProperty(w.prototype,"hex",{get:function(){return"HEX"!==this.__state.space&&(this.__state.hex=v.rgb_to_hex(this.r,this.g,this.b),this.__state.space="HEX"),this.__state.hex},set:function(e){this.__state.space="HEX",this.__state.hex=e}}),n(E,[{key:"onChange",value:function(e){return this.__onChange=e,this}},{key:"onFinishChange",value:function(e){return this.__onFinishChange=e,this}},{key:"setValue",value:function(e){return this.object[this.property]=e,this.__onChange&&this.__onChange.call(this,e),this.updateDisplay(),this}},{key:"getValue",value:function(){return this.object[this.property]}},{key:"updateDisplay",value:function(){return this}},{key:"isModified",value:function(){return this.initialValue!==this.getValue()}}]);var O=E;function E(e,t){l(this,E),this.initialValue=e[t],this.domElement=document.createElement("div"),this.object=e,this.property=t,this.__onChange=void 0,this.__onFinishChange=void 0}var T={},P=(s.each({HTMLEvents:["change"],MouseEvents:["click","mousemove","mousedown","mouseup","mouseover"],KeyboardEvents:["keydown"]},(function(e,t){s.each(e,(function(e){T[e]=t}))})),/(\d+(\.\d+)?)px/);function k(e){return"0"===e||s.isUndefined(e)||(e=e.match(P),s.isNull(e))?0:parseFloat(e[1])}var L={makeSelectable:function(e,t){void 0!==e&&void 0!==e.style&&(e.onselectstart=t?function(){return!1}:function(){},e.style.MozUserSelect=t?"auto":"none",e.style.KhtmlUserSelect=t?"auto":"none",e.unselectable=t?"on":"off")},makeFullscreen:function(e,t,n){s.isUndefined(t)&&(t=!0),s.isUndefined(n)&&(n=!0),e.style.position="absolute",t&&(e.style.left=0,e.style.right=0),n&&(e.style.top=0,e.style.bottom=0)},fakeEvent:function(e,t,n,r){var i=n||{};if(!(n=T[t]))throw new Error("Event type "+t+" not supported.");var o=document.createEvent(n);switch(n){case"MouseEvents":var a=i.x||i.clientX||0,u=i.y||i.clientY||0;o.initMouseEvent(t,i.bubbles||!1,i.cancelable||!0,window,i.clickCount||1,0,0,a,u,!1,!1,!1,!1,0,null);break;case"KeyboardEvents":a=o.initKeyboardEvent||o.initKeyEvent,s.defaults(i,{cancelable:!0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:void 0,charCode:void 0}),a(t,i.bubbles||!1,i.cancelable,window,i.ctrlKey,i.altKey,i.shiftKey,i.metaKey,i.keyCode,i.charCode);break;default:o.initEvent(t,i.bubbles||!1,i.cancelable||!0)}s.defaults(o,r),e.dispatchEvent(o)},bind:function(e,t,n,r){return e.addEventListener?e.addEventListener(t,n,r||!1):e.attachEvent&&e.attachEvent("on"+t,n),L},unbind:function(e,t,n,r){return e.removeEventListener?e.removeEventListener(t,n,r||!1):e.detachEvent&&e.detachEvent("on"+t,n),L},addClass:function(e,t){var n;return void 0===e.className?e.className=t:e.className!==t&&-1===(n=e.className.split(/ +/)).indexOf(t)&&(n.push(t),e.className=n.join(" ").replace(/^\s+/,"").replace(/\s+$/,"")),L},removeClass:function(e,t){var n;return t?e.className===t?e.removeAttribute("class"):-1!==(t=(n=e.className.split(/ +/)).indexOf(t))&&(n.splice(t,1),e.className=n.join(" ")):e.className=void 0,L},hasClass:function(e,t){return new RegExp("(?:^|\\s+)"+t+"(?:\\s+|$)").test(e.className)||!1},getWidth:function(e){return k((e=getComputedStyle(e))["border-left-width"])+k(e["border-right-width"])+k(e["padding-left"])+k(e["padding-right"])+k(e.width)},getHeight:function(e){return k((e=getComputedStyle(e))["border-top-width"])+k(e["border-bottom-width"])+k(e["padding-top"])+k(e["padding-bottom"])+k(e.height)},getOffset:function(e){var t=e,n={left:0,top:0};if(t.offsetParent)for(;n.left+=t.offsetLeft,n.top+=t.offsetTop,t=t.offsetParent;);return n},isActive:function(e){return e===document.activeElement&&(e.type||e.href)}},C=(y(N,O),n(N,[{key:"setValue",value:function(e){return e=x(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"setValue",this).call(this,e),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.__prev=this.getValue(),e}},{key:"updateDisplay",value:function(){return!0===this.getValue()?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0,this.__prev=!0):(this.__checkbox.checked=!1,this.__prev=!1),x(N.prototype.__proto__||Object.getPrototypeOf(N.prototype),"updateDisplay",this).call(this)}}]),N);function N(e,t){l(this,N);var n=e=g(this,(N.__proto__||Object.getPrototypeOf(N)).call(this,e,t));return e.__prev=e.getValue(),e.__checkbox=document.createElement("input"),e.__checkbox.setAttribute("type","checkbox"),L.bind(e.__checkbox,"change",(function(){n.setValue(!n.__prev)}),!1),e.domElement.appendChild(e.__checkbox),e.updateDisplay(),e}y(M,O),n(M,[{key:"setValue",value:function(e){return e=x(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"setValue",this).call(this,e),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),e}},{key:"updateDisplay",value:function(){return L.isActive(this.__select)?this:(this.__select.value=this.getValue(),x(M.prototype.__proto__||Object.getPrototypeOf(M.prototype),"updateDisplay",this).call(this))}}]);var D=M;function M(e,t,n){l(this,M),e=g(this,(M.__proto__||Object.getPrototypeOf(M)).call(this,e,t)),t=n;var r,i=e;return e.__select=document.createElement("select"),s.isArray(t)&&(r={},s.each(t,(function(e){r[e]=e})),t=r),s.each(t,(function(e,t){var n=document.createElement("option");n.innerHTML=t,n.setAttribute("value",e),i.__select.appendChild(n)})),e.updateDisplay(),L.bind(e.__select,"change",(function(){var e=this.options[this.selectedIndex].value;i.setValue(e)})),e.domElement.appendChild(e.__select),e}y(I,O),n(I,[{key:"updateDisplay",value:function(){return L.isActive(this.__input)||(this.__input.value=this.getValue()),x(I.prototype.__proto__||Object.getPrototypeOf(I.prototype),"updateDisplay",this).call(this)}}]);var F=I;function I(e,t){l(this,I);var n=e=g(this,(I.__proto__||Object.getPrototypeOf(I)).call(this,e,t));function r(){n.setValue(n.__input.value)}return e.__input=document.createElement("input"),e.__input.setAttribute("type","text"),L.bind(e.__input,"keyup",r),L.bind(e.__input,"change",r),L.bind(e.__input,"blur",(function(){n.__onFinishChange&&n.__onFinishChange.call(n,n.getValue())})),L.bind(e.__input,"keydown",(function(e){13===e.keyCode&&this.blur()})),e.updateDisplay(),e.domElement.appendChild(e.__input),e}function H(e){return-1<(e=e.toString()).indexOf(".")?e.length-e.indexOf(".")-1:0}function S(e,t,n){return l(this,S),e=g(this,(S.__proto__||Object.getPrototypeOf(S)).call(this,e,t)),t=n||{},e.__min=t.min,e.__max=t.max,e.__step=t.step,s.isUndefined(e.__step)?0===e.initialValue?e.__impliedStep=1:e.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(e.initialValue))/Math.LN10))/10:e.__impliedStep=e.__step,e.__precision=H(e.__impliedStep),e}y(S,O),n(S,[{key:"setValue",value:function(e){return void 0!==this.__min&&e<this.__min?e=this.__min:void 0!==this.__max&&e>this.__max&&(e=this.__max),void 0!==this.__step&&e%this.__step!=0&&(e=Math.round(e/this.__step)*this.__step),x(S.prototype.__proto__||Object.getPrototypeOf(S.prototype),"setValue",this).call(this,e)}},{key:"min",value:function(e){return this.__min=e,this}},{key:"max",value:function(e){return this.__max=e,this}},{key:"step",value:function(e){return this.__step=e,this.__impliedStep=e,this.__precision=H(e),this}}]),y(W,t=S),n(W,[{key:"updateDisplay",value:function(){var e,t;return this.__input.value=this.__truncationSuspended?this.getValue():(e=this.getValue(),t=this.__precision,t=Math.pow(10,t),Math.round(e*t)/t),x(W.prototype.__proto__||Object.getPrototypeOf(W.prototype),"updateDisplay",this).call(this)}}]);var Z=W;function W(e,t,n){l(this,W);var r=((e=g(this,(W.__proto__||Object.getPrototypeOf(W)).call(this,e,t,n))).__truncationSuspended=!1,e),i=void 0;function o(){r.__onFinishChange&&r.__onFinishChange.call(r,r.getValue())}function a(e){var t=i-e.clientY;r.setValue(r.getValue()+t*r.__impliedStep),i=e.clientY}function u(){L.unbind(window,"mousemove",a),L.unbind(window,"mouseup",u),o()}return e.__input=document.createElement("input"),e.__input.setAttribute("type","text"),L.bind(e.__input,"change",(function(){var e=parseFloat(r.__input.value);s.isNaN(e)||r.setValue(e)})),L.bind(e.__input,"blur",(function(){o()})),L.bind(e.__input,"mousedown",(function(e){L.bind(window,"mousemove",a),L.bind(window,"mouseup",u),i=e.clientY})),L.bind(e.__input,"keydown",(function(e){13===e.keyCode&&(r.__truncationSuspended=!0,this.blur(),r.__truncationSuspended=!1,o())})),e.updateDisplay(),e.domElement.appendChild(e.__input),e}function j(e,t,n,r,i){return r+(e-t)/(n-t)*(i-r)}y(G,t),n(G,[{key:"updateDisplay",value:function(){var e=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*e+"%",x(G.prototype.__proto__||Object.getPrototypeOf(G.prototype),"updateDisplay",this).call(this)}}]);var B=G;function G(e,t,n,r,i){l(this,G);var o=e=g(this,(G.__proto__||Object.getPrototypeOf(G)).call(this,e,t,{min:n,max:r,step:i}));function a(e){e.preventDefault();var t=o.__background.getBoundingClientRect();return o.setValue(j(e.clientX,t.left,t.right,o.__min,o.__max)),!1}function s(){L.unbind(window,"mousemove",a),L.unbind(window,"mouseup",s),o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}function u(e){e=e.touches[0].clientX;var t=o.__background.getBoundingClientRect();o.setValue(j(e,t.left,t.right,o.__min,o.__max))}function f(){L.unbind(window,"touchmove",u),L.unbind(window,"touchend",f),o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}return e.__background=document.createElement("div"),e.__foreground=document.createElement("div"),L.bind(e.__background,"mousedown",(function(e){document.activeElement.blur(),L.bind(window,"mousemove",a),L.bind(window,"mouseup",s),a(e)})),L.bind(e.__background,"touchstart",(function(e){1===e.touches.length&&(L.bind(window,"touchmove",u),L.bind(window,"touchend",f),u(e))})),L.addClass(e.__background,"slider"),L.addClass(e.__foreground,"slider-fg"),e.updateDisplay(),e.__background.appendChild(e.__foreground),e.domElement.appendChild(e.__background),e}y(R,O),n(R,[{key:"fire",value:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]);var J=R;function R(e,t,n){l(this,R);var r=e=g(this,(R.__proto__||Object.getPrototypeOf(R)).call(this,e,t));return e.__button=document.createElement("div"),e.__button.innerHTML=void 0===n?"Fire":n,L.bind(e.__button,"click",(function(e){return e.preventDefault(),r.fire(),!1})),L.addClass(e.__button,"button"),e.domElement.appendChild(e.__button),e}y(V,O),n(V,[{key:"updateDisplay",value:function(){var e,t=f(this.getValue()),n=(!1!==t&&(e=!1,s.each(w.COMPONENTS,(function(n){if(!s.isUndefined(t[n])&&!s.isUndefined(this.__color.__state[n])&&t[n]!==this.__color.__state[n])return e=!0,{}}),this),e)&&s.extend(this.__color.__state,t),s.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1,this.__color.v<.5||.5<this.__color.s?255:0),r=255-n;s.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+n+","+n+","+n+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,Y(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),s.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+n+","+n+","+n+")",textShadow:this.__input_textShadow+"rgba("+r+","+r+","+r+",.7)"})}}]);var K=V;function V(e,t){l(this,V);var n,r=((e=g(this,(V.__proto__||Object.getPrototypeOf(V)).call(this,e,t))).__color=new w(e.getValue()),e.__temp=new w(0),e);function i(e){h(e),L.bind(window,"mousemove",h),L.bind(window,"touchmove",h),L.bind(window,"mouseup",a),L.bind(window,"touchend",a)}function o(e){m(e),L.bind(window,"mousemove",m),L.bind(window,"touchmove",m),L.bind(window,"mouseup",u),L.bind(window,"touchend",u)}function a(){L.unbind(window,"mousemove",h),L.unbind(window,"touchmove",h),L.unbind(window,"mouseup",a),L.unbind(window,"touchend",a),c()}function u(){L.unbind(window,"mousemove",m),L.unbind(window,"touchmove",m),L.unbind(window,"mouseup",u),L.unbind(window,"touchend",u),c()}function d(){var e=f(this.value);!1!==e?(r.__color.__state=e,r.setValue(r.__color.toOriginal())):this.value=r.__color.toString()}function c(){r.__onFinishChange&&r.__onFinishChange.call(r,r.__color.toOriginal())}function h(e){-1===e.type.indexOf("touch")&&e.preventDefault();var t=r.__saturation_field.getBoundingClientRect(),n=(e=e.touches&&e.touches[0]||e).clientX;return e=e.clientY,n=(n-t.left)/(t.right-t.left),1<(e=1-(e-t.top)/(t.bottom-t.top))?e=1:e<0&&(e=0),1<n?n=1:n<0&&(n=0),r.__color.v=e,r.__color.s=n,r.setValue(r.__color.toOriginal()),!1}function m(e){-1===e.type.indexOf("touch")&&e.preventDefault();var t=r.__hue_field.getBoundingClientRect();return 1<(e=1-((e.touches&&e.touches[0]||e).clientY-t.top)/(t.bottom-t.top))?e=1:e<0&&(e=0),r.__color.h=360*e,r.setValue(r.__color.toOriginal()),!1}return e.domElement=document.createElement("div"),L.makeSelectable(e.domElement,!1),e.__selector=document.createElement("div"),e.__selector.className="selector",e.__saturation_field=document.createElement("div"),e.__saturation_field.className="saturation-field",e.__field_knob=document.createElement("div"),e.__field_knob.className="field-knob",e.__field_knob_border="2px solid ",e.__hue_knob=document.createElement("div"),e.__hue_knob.className="hue-knob",e.__hue_field=document.createElement("div"),e.__hue_field.className="hue-field",e.__input=document.createElement("input"),e.__input.type="text",e.__input_textShadow="0 1px 1px ",L.bind(e.__input,"keydown",(function(e){13===e.keyCode&&d.call(this)})),L.bind(e.__input,"blur",d),L.bind(e.__selector,"mousedown",(function(){L.addClass(this,"drag").bind(window,"mouseup",(function(){L.removeClass(r.__selector,"drag")}))})),L.bind(e.__selector,"touchstart",(function(){L.addClass(this,"drag").bind(window,"touchend",(function(){L.removeClass(r.__selector,"drag")}))})),t=document.createElement("div"),s.extend(e.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),s.extend(e.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:e.__field_knob_border+(e.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),s.extend(e.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),s.extend(e.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),s.extend(t.style,{width:"100%",height:"100%",background:"none"}),Y(t,"top","rgba(0,0,0,0)","#000"),s.extend(e.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),(n=e.__hue_field).style.background="",n.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",n.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",n.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",n.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",n.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",s.extend(e.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:e.__input_textShadow+"rgba(0,0,0,0.7)"}),L.bind(e.__saturation_field,"mousedown",i),L.bind(e.__saturation_field,"touchstart",i),L.bind(e.__field_knob,"mousedown",i),L.bind(e.__field_knob,"touchstart",i),L.bind(e.__hue_field,"mousedown",o),L.bind(e.__hue_field,"touchstart",o),e.__saturation_field.appendChild(t),e.__selector.appendChild(e.__field_knob),e.__selector.appendChild(e.__saturation_field),e.__selector.appendChild(e.__hue_field),e.__hue_field.appendChild(e.__hue_knob),e.domElement.appendChild(e.__input),e.domElement.appendChild(e.__selector),e.updateDisplay(),e}var Q=["-moz-","-o-","-webkit-","-ms-",""];function Y(e,t,n,r){e.style.background="",s.each(Q,(function(i){e.style.cssText+="background: "+i+"linear-gradient("+t+", "+n+" 0%, "+r+" 100%); "}))}function U(e,t){var n=e[t];return s.isArray(arguments[2])||s.isObject(arguments[2])?new D(e,t,arguments[2]):s.isNumber(n)?s.isNumber(arguments[2])&&s.isNumber(arguments[3])?s.isNumber(arguments[4])?new B(e,t,arguments[2],arguments[3],arguments[4]):new B(e,t,arguments[2],arguments[3]):s.isNumber(arguments[4])?new Z(e,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new Z(e,t,{min:arguments[2],max:arguments[3]}):s.isString(n)?new F(e,t):s.isFunction(n)?new J(e,t,""):s.isBoolean(n)?new C(e,t):null}var q=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)},_=(n($,[{key:"show",value:function(){var e=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),s.defer((function(){e.backgroundElement.style.opacity=1,e.domElement.style.opacity=1,e.domElement.style.webkitTransform="scale(1)"}))}},{key:"hide",value:function(){var e,t=this;L.bind(this.domElement,"webkitTransitionEnd",e=function e(){t.domElement.style.display="none",t.backgroundElement.style.display="none",L.unbind(t.domElement,"webkitTransitionEnd",e),L.unbind(t.domElement,"transitionend",e),L.unbind(t.domElement,"oTransitionEnd",e)}),L.bind(this.domElement,"transitionend",e),L.bind(this.domElement,"oTransitionEnd",e),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"}},{key:"layout",value:function(){this.domElement.style.left=window.innerWidth/2-L.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-L.getHeight(this.domElement)/2+"px"}}]),$);function $(){l(this,$),this.backgroundElement=document.createElement("div"),s.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),L.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),s.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var e=this;L.bind(this.backgroundElement,"click",(function(){e.hide()}))}!function(e,t){t=t||document;var n=document.createElement("style");n.type="text/css",n.innerHTML=e,e=t.getElementsByTagName("head")[0];try{e.appendChild(n)}catch(e){}}(function(e){var t;if(e&&"undefined"!=typeof window)return(t=document.createElement("style")).setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t),e}(".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .cr.function .property-name{width:100%}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n"));var ee="Default",te=function(){try{return!!window.localStorage}catch(e){return!1}}(),ne=void 0,re=!0,ie=void 0,oe=!1,ae=[],se=function e(t){var n,r,i,o=this,a=t||{},u=(this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),L.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],a=s.defaults(a,{closeOnTop:!1,autoPlace:!0,width:e.DEFAULT_WIDTH}),a=s.defaults(a,{resizable:a.autoPlace,hideable:a.autoPlace}),s.isUndefined(a.load)?a.load={preset:ee}:a.preset&&(a.load.preset=a.preset),s.isUndefined(a.parent)&&a.hideable&&ae.push(this),a.resizable=s.isUndefined(a.parent)&&a.resizable,a.autoPlace&&s.isUndefined(a.scrollable)&&(a.scrollable=!0),te&&"true"===localStorage.getItem(he(0,"isLocal"))),f=void 0,l=void 0;function d(e){return e.preventDefault(),n.width+=r-e.clientX,n.onResize(),r=e.clientX,!1}function c(){L.removeClass(n.__closeButton,se.CLASS_DRAG),L.unbind(window,"mousemove",d),L.unbind(window,"mouseup",c)}function h(e){return e.preventDefault(),r=e.clientX,L.addClass(n.__closeButton,se.CLASS_DRAG),L.bind(window,"mousemove",d),L.bind(window,"mouseup",c),!1}Object.defineProperties(this,{parent:{get:function(){return a.parent}},scrollable:{get:function(){return a.scrollable}},autoPlace:{get:function(){return a.autoPlace}},closeOnTop:{get:function(){return a.closeOnTop}},preset:{get:function(){return(o.parent?o.getRoot():a.load).preset},set:function(e){o.parent?o.getRoot().preset=e:a.load.preset=e;for(var t=this,n=0;n<t.__preset_select.length;n++)t.__preset_select[n].value===t.preset&&(t.__preset_select.selectedIndex=n);o.revert()}},width:{get:function(){return a.width},set:function(e){a.width=e,be(o,e)}},name:{get:function(){return a.name},set:function(e){a.name=e,l&&(l.innerHTML=a.name)}},closed:{get:function(){return a.closed},set:function(t){a.closed=t,a.closed?L.addClass(o.__ul,e.CLASS_CLOSED):L.removeClass(o.__ul,e.CLASS_CLOSED),this.onResize(),o.__closeButton&&(o.__closeButton.innerHTML=t?e.TEXT_OPEN:e.TEXT_CLOSED)}},load:{get:function(){return a.load}},useLocalStorage:{get:function(){return u},set:function(e){te&&((u=e)?L.bind(window,"unload",f):L.unbind(window,"unload",f),localStorage.setItem(he(0,"isLocal"),e))}}}),s.isUndefined(a.parent)?(this.closed=a.closed||!1,L.addClass(this.domElement,e.CLASS_MAIN),L.makeSelectable(this.domElement,!1),te&&u&&(o.useLocalStorage=!0,t=localStorage.getItem(he(0,"gui")))&&(a.load=JSON.parse(t)),this.__closeButton=document.createElement("div"),this.__closeButton.innerHTML=e.TEXT_CLOSED,L.addClass(this.__closeButton,e.CLASS_CLOSE_BUTTON),a.closeOnTop?(L.addClass(this.__closeButton,e.CLASS_CLOSE_TOP),this.domElement.insertBefore(this.__closeButton,this.domElement.childNodes[0])):(L.addClass(this.__closeButton,e.CLASS_CLOSE_BOTTOM),this.domElement.appendChild(this.__closeButton)),L.bind(this.__closeButton,"click",(function(){o.closed=!o.closed}))):(void 0===a.closed&&(a.closed=!0),t=document.createTextNode(a.name),L.addClass(t,"controller-name"),l=ue(o,t),L.addClass(this.__ul,e.CLASS_CLOSED),L.addClass(l,"title"),L.bind(l,"click",(function(e){return e.preventDefault(),o.closed=!o.closed,!1})),a.closed||(this.closed=!1)),a.autoPlace&&(s.isUndefined(a.parent)&&(re&&(ie=document.createElement("div"),L.addClass(ie,"dg"),L.addClass(ie,e.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(ie),re=!1),ie.appendChild(this.domElement),L.addClass(this.domElement,e.CLASS_AUTO_PLACE)),this.parent||be(o,a.width)),this.__resizeHandler=function(){o.onResizeDebounced()},L.bind(window,"resize",this.__resizeHandler),L.bind(this.__ul,"webkitTransitionEnd",this.__resizeHandler),L.bind(this.__ul,"transitionend",this.__resizeHandler),L.bind(this.__ul,"oTransitionEnd",this.__resizeHandler),this.onResize(),a.resizable&&(r=void 0,(n=this).__resize_handle=document.createElement("div"),s.extend(n.__resize_handle.style,{width:"6px",marginLeft:"-3px",height:"200px",cursor:"ew-resize",position:"absolute"}),L.bind(n.__resize_handle,"mousedown",h),L.bind(n.__closeButton,"mousedown",h),n.domElement.insertBefore(n.__resize_handle,n.domElement.firstElementChild)),f=function(){te&&"true"===localStorage.getItem(he(0,"isLocal"))&&localStorage.setItem(he(0,"gui"),JSON.stringify(o.getSaveObject()))},this.saveToLocalStorageIfPossible=f,a.parent||((i=o.getRoot()).width+=1,s.defer((function(){--i.width})))};function ue(e,t,n){var r=document.createElement("li");return t&&r.appendChild(t),n?e.__ul.insertBefore(r,n):e.__ul.appendChild(r),e.onResize(),r}function fe(e){L.unbind(window,"resize",e.__resizeHandler),e.saveToLocalStorageIfPossible&&L.unbind(window,"unload",e.saveToLocalStorageIfPossible)}function le(e,t){(e=e.__preset_select[e.__preset_select.selectedIndex]).innerHTML=t?e.value+"*":e.value}function de(e,t){var n=e.getRoot(),r=n.__rememberedObjects.indexOf(t.object);if(-1!==r){var i=n.__rememberedObjectIndecesToControllers[r];if(void 0===i&&(n.__rememberedObjectIndecesToControllers[r]=i={}),i[t.property]=t,n.load&&n.load.remembered){if(i=n.load.remembered,n=void 0,i[e.preset])n=i[e.preset];else{if(!i[ee])return;n=i[ee]}n[r]&&void 0!==n[r][t.property]&&(e=n[r][t.property],t.initialValue=e,t.setValue(e))}}}function ce(e,t,n,r){if(void 0===t[n])throw new Error('Object "'+t+'" has no property "'+n+'"');var i,o,a,u,f=void 0;return f=r.color?new K(t,n):(t=[t,n].concat(r.factoryArgs),U.apply(e,t)),r.before instanceof O&&(r.before=r.before.__li),de(e,f),L.addClass(f.domElement,"c"),n=document.createElement("span"),(L.addClass(n,"property-name"),n.innerHTML=f.property,t=document.createElement("div")).appendChild(n),t.appendChild(f.domElement),n=ue(e,t,r.before),L.addClass(n,se.CLASS_CONTROLLER_ROW),f instanceof K?L.addClass(n,"color"):L.addClass(n,b(f.getValue())),i=e,o=n,(a=f).__li=o,a.__gui=i,s.extend(a,{options:function(e){var t;return 1<arguments.length?(t=a.__li.nextElementSibling,a.remove(),ce(i,a.object,a.property,{before:t,factoryArgs:[s.toArray(arguments)]})):s.isArray(e)||s.isObject(e)?(t=a.__li.nextElementSibling,a.remove(),ce(i,a.object,a.property,{before:t,factoryArgs:[e]})):void 0},name:function(e){return a.__li.firstElementChild.firstElementChild.innerHTML=e,a},listen:function(){return a.__gui.listen(a),a},remove:function(){return a.__gui.remove(a),a}}),a instanceof B?(u=new Z(a.object,a.property,{min:a.__min,max:a.__max,step:a.__step}),s.each(["updateDisplay","onChange","onFinishChange","step","min","max"],(function(e){var t=a[e],n=u[e];a[e]=u[e]=function(){var e=Array.prototype.slice.call(arguments);return n.apply(u,e),t.apply(a,e)}})),L.addClass(o,"has-slider"),a.domElement.insertBefore(u.domElement,a.domElement.firstElementChild)):a instanceof Z?(a.min=s.compose(t=function(e){var t,n,r;return s.isNumber(a.__min)&&s.isNumber(a.__max)?(t=a.__li.firstElementChild.firstElementChild.innerHTML,n=-1<a.__gui.__listening.indexOf(a),a.remove(),(r=ce(i,a.object,a.property,{before:a.__li.nextElementSibling,factoryArgs:[a.__min,a.__max,a.__step]})).name(t),n&&r.listen(),r):e},a.min),a.max=s.compose(t,a.max)):a instanceof C?(L.bind(o,"click",(function(){L.fakeEvent(a.__checkbox,"click")})),L.bind(a.__checkbox,"click",(function(e){e.stopPropagation()}))):a instanceof J?(L.bind(o,"click",(function(){L.fakeEvent(a.__button,"click")})),L.bind(o,"mouseover",(function(){L.addClass(a.__button,"hover")})),L.bind(o,"mouseout",(function(){L.removeClass(a.__button,"hover")}))):a instanceof K&&(L.addClass(o,"color"),a.updateDisplay=s.compose((function(e){return o.style.borderLeftColor=a.__color.toString(),e}),a.updateDisplay),a.updateDisplay()),a.setValue=s.compose((function(e){return i.getRoot().__preset_select&&a.isModified()&&le(i.getRoot(),!0),e}),a.setValue),e.__controllers.push(f),f}function he(e,t){return document.location.href+"."+t}function me(e,t,n){var r=document.createElement("option");r.innerHTML=t,r.value=t,e.__preset_select.appendChild(r),n&&(e.__preset_select.selectedIndex=e.__preset_select.length-1)}function ve(e,t){t.style.display=e.useLocalStorage?"block":"none"}function be(e,t){e.domElement.style.width=t+"px",e.__save_row&&e.autoPlace&&(e.__save_row.style.width=t+"px"),e.__closeButton&&(e.__closeButton.style.width=t+"px")}function pe(e,t){var n={};return s.each(e.__rememberedObjects,(function(r,i){var o={},a=e.__rememberedObjectIndecesToControllers[i];s.each(a,(function(e,n){o[n]=t?e.initialValue:e.getValue()})),n[i]=o})),n}se.toggleHide=function(){oe=!oe,s.each(ae,(function(e){e.domElement.style.display=oe?"none":""}))},se.CLASS_AUTO_PLACE="a",se.CLASS_AUTO_PLACE_CONTAINER="ac",se.CLASS_MAIN="main",se.CLASS_CONTROLLER_ROW="cr",se.CLASS_TOO_TALL="taller-than-window",se.CLASS_CLOSED="closed",se.CLASS_CLOSE_BUTTON="close-button",se.CLASS_CLOSE_TOP="close-top",se.CLASS_CLOSE_BOTTOM="close-bottom",se.CLASS_DRAG="drag",se.DEFAULT_WIDTH=245,se.TEXT_CLOSED="Close Controls",se.TEXT_OPEN="Open Controls",se._keydownHandler=function(e){"text"===document.activeElement.type||72!==e.which&&72!==e.keyCode||se.toggleHide()},L.bind(window,"keydown",se._keydownHandler,!1),s.extend(se.prototype,{add:function(e,t){return ce(this,e,t,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(e,t){return ce(this,e,t,{color:!0})},remove:function(e){this.__ul.removeChild(e.__li),this.__controllers.splice(this.__controllers.indexOf(e),1);var t=this;s.defer((function(){t.onResize()}))},destroy:function(){if(this.parent)throw new Error("Only the root GUI should be removed with .destroy(). For subfolders, use gui.removeFolder(folder) instead.");this.autoPlace&&ie.removeChild(this.domElement);var e=this;s.each(this.__folders,(function(t){e.removeFolder(t)})),L.unbind(window,"keydown",se._keydownHandler,!1),fe(this)},addFolder:function(e){if(void 0!==this.__folders[e])throw new Error('You already have a folder in this GUI by the name "'+e+'"');var t=((t={name:e,parent:this}).autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[e]&&(t.closed=this.load.folders[e].closed,t.load=this.load.folders[e]),new se(t));return this.__folders[e]=t,e=ue(this,t.domElement),L.addClass(e,"folder"),t},removeFolder:function(e){this.__ul.removeChild(e.domElement.parentElement),delete this.__folders[e.name],this.load&&this.load.folders&&this.load.folders[e.name]&&delete this.load.folders[e.name],fe(e);var t=this;s.each(e.__folders,(function(t){e.removeFolder(t)})),s.defer((function(){t.onResize()}))},open:function(){this.closed=!1},close:function(){this.closed=!0},hide:function(){this.domElement.style.display="none"},show:function(){this.domElement.style.display=""},onResize:function(){var e,t,n=this.getRoot();n.scrollable&&(e=L.getOffset(n.__ul).top,t=0,s.each(n.__ul.childNodes,(function(e){n.autoPlace&&e===n.__save_row||(t+=L.getHeight(e))})),window.innerHeight-e-20<t?(L.addClass(n.domElement,se.CLASS_TOO_TALL),n.__ul.style.height=window.innerHeight-e-20+"px"):(L.removeClass(n.domElement,se.CLASS_TOO_TALL),n.__ul.style.height="auto")),n.__resize_handle&&s.defer((function(){n.__resize_handle.style.height=n.__ul.offsetHeight+"px"})),n.__closeButton&&(n.__closeButton.style.width=n.width+"px")},onResizeDebounced:s.debounce((function(){this.onResize()}),50),remember:function(){if(s.isUndefined(ne)&&((ne=new _).domElement.innerHTML='<div id="dg-save" class="dg dialogue">\n\n Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n <textarea id="dg-new-constructor"></textarea>\n\n <div id="dg-save-locally">\n\n <input id="dg-local-storage" type="checkbox"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n\n </div>\n\n </div>\n\n</div>'),this.parent)throw new Error("You can only call remember on a top level GUI.");var e=this;s.each(Array.prototype.slice.call(arguments),(function(t){var n,r,i,o,a,u,f,l,d;0===e.__rememberedObjects.length&&(r=(n=e).__save_row=document.createElement("li"),L.addClass(n.domElement,"has-save"),n.__ul.insertBefore(r,n.__ul.firstChild),L.addClass(r,"save-row"),(i=document.createElement("span")).innerHTML="&nbsp;",L.addClass(i,"button gears"),(o=document.createElement("span")).innerHTML="Save",L.addClass(o,"button"),L.addClass(o,"save"),(a=document.createElement("span")).innerHTML="New",L.addClass(a,"button"),L.addClass(a,"save-as"),(u=document.createElement("span")).innerHTML="Revert",L.addClass(u,"button"),L.addClass(u,"revert"),f=n.__preset_select=document.createElement("select"),n.load&&n.load.remembered?s.each(n.load.remembered,(function(e,t){me(n,t,t===n.preset)})):me(n,ee,!1),L.bind(f,"change",(function(){for(var e=0;e<n.__preset_select.length;e++)n.__preset_select[e].innerHTML=n.__preset_select[e].value;n.preset=this.value})),r.appendChild(f),r.appendChild(i),r.appendChild(o),r.appendChild(a),r.appendChild(u),te&&(l=document.getElementById("dg-local-explain"),f=document.getElementById("dg-local-storage"),document.getElementById("dg-save-locally").style.display="block","true"===localStorage.getItem(he(0,"isLocal"))&&f.setAttribute("checked","checked"),ve(n,l),L.bind(f,"change",(function(){n.useLocalStorage=!n.useLocalStorage,ve(n,l)}))),d=document.getElementById("dg-new-constructor"),L.bind(d,"keydown",(function(e){!e.metaKey||67!==e.which&&67!==e.keyCode||ne.hide()})),L.bind(i,"click",(function(){d.innerHTML=JSON.stringify(n.getSaveObject(),void 0,2),ne.show(),d.focus(),d.select()})),L.bind(o,"click",(function(){n.save()})),L.bind(a,"click",(function(){var e=prompt("Enter a new preset name.");e&&n.saveAs(e)})),L.bind(u,"click",(function(){n.revert()}))),-1===e.__rememberedObjects.indexOf(t)&&e.__rememberedObjects.push(t)})),this.autoPlace&&be(this,this.width)},getRoot:function(){for(var e=this;e.parent;)e=e.parent;return e},getSaveObject:function(){var e=this.load;return e.closed=this.closed,0<this.__rememberedObjects.length&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=pe(this)),e.folders={},s.each(this.__folders,(function(t,n){e.folders[n]=t.getSaveObject()})),e},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=pe(this),le(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered[ee]=pe(this,!0)),this.load.remembered[e]=pe(this),this.preset=e,me(this,e,!0),this.saveToLocalStorageIfPossible()},revert:function(e){s.each(this.__controllers,(function(t){this.getRoot().load.remembered?de(e||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())}),this),s.each(this.__folders,(function(e){e.revert(e)})),e||le(this.getRoot(),!1)},listen:function(e){var t=0===this.__listening.length;this.__listening.push(e),t&&function e(t){0!==t.length&&q.call(window,(function(){e(t)})),s.each(t,(function(e){e.updateDisplay()}))}(this.__listening)},updateDisplay:function(){s.each(this.__controllers,(function(e){e.updateDisplay()})),s.each(this.__folders,(function(e){e.updateDisplay()}))}});var xe={Color:w,math:v,interpret:f},ye={Controller:O,BooleanController:C,OptionController:D,StringController:F,NumberController:t,NumberControllerBox:Z,NumberControllerSlider:B,FunctionController:J,ColorController:K},ge={dom:L},we={GUI:se},ze=se;const Xe={color:xe,controllers:ye,dom:ge,gui:we,GUI:se}},462:(e,t,n)=>{const r=n(14),i=n(408);let o=[],a=!1;n=e=>`\n\tuniform Tensor ${e};\n\tuniform sampler2D ${e}_tex;\n\n\tvec4 ${e}_read(vec2 pos, float ch) {\n\t\treturn _read(${e}, ${e}_tex, pos, ch);\n\t}\n\tvec4 ${e}_read01(vec2 pos, float ch) {\n\t\treturn _read01(${e}, ${e}_tex, pos, ch);\n\t}\n\tvec4 ${e}_readUV(vec2 uv) {\n\t\treturn _readUV(${e}, ${e}_tex, uv);\n\t}\n`,n("u_input"),n("u_alignTex");const s={paint:"\n\t\tuniform vec2 u_pos;\n\t\tuniform float u_r;\n\t\tuniform vec4 u_brush;\n\n\t\tvoid main() {\n\t\t\tif (u_r > 0.0 && calcMouseDist(u_pos) >= 80.0)\n\t\t\t\tdiscard;\n\t\t\tsetOutput(u_brush);\n\t\t}\n\t",peek:"\n\t\tuniform vec2 u_pos;\n\n\t\tvec2 getPeekPos(float i) {\n\t\t\tfloat a = i * 0.61803398875 * 2.0 * PI;\n\t\t\tfloat r = (u_view