dat.gui/build/dat.gui.module.js.map
2023-05-28 12:23:34 +03:00

1 line
218 KiB
Plaintext

{"version":3,"file":"dat.gui.module.js","sources":["../src/dat/color/toString.js","../src/dat/utils/common.js","../src/dat/color/interpret.js","../src/dat/color/math.js","../src/dat/color/Color.js","../src/dat/controllers/Controller.js","../src/dat/dom/dom.js","../src/dat/controllers/BooleanController.js","../src/dat/controllers/OptionController.js","../src/dat/controllers/StringController.js","../src/dat/controllers/NumberController.js","../src/dat/controllers/NumberControllerBox.js","../src/dat/controllers/NumberControllerSlider.js","../src/dat/controllers/FunctionController.js","../src/dat/controllers/ColorController.js","../src/dat/utils/css.js","../src/dat/gui/saveDialogue.html.js","../src/dat/controllers/ControllerFactory.js","../src/dat/utils/requestAnimationFrame.js","../src/dat/dom/CenteredDiv.js","../src/dat/gui/GUI.js","../src/dat/index.js"],"sourcesContent":["/**\n * dat-gui JavaScript Controller Library\n * https://github.com/dataarts/dat.gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nexport default function(color, forceCSSHex) {\n const colorFormat = color.__state.conversionName.toString();\n\n const r = Math.round(color.r);\n const g = Math.round(color.g);\n const b = Math.round(color.b);\n const a = color.a;\n const h = Math.round(color.h);\n const s = color.s.toFixed(1);\n const v = color.v.toFixed(1);\n\n if (forceCSSHex || (colorFormat === 'THREE_CHAR_HEX') || (colorFormat === 'SIX_CHAR_HEX')) {\n let str = color.hex.toString(16);\n while (str.length < 6) {\n str = '0' + str;\n }\n return '#' + str;\n } else if (colorFormat === 'CSS_RGB') {\n return 'rgb(' + r + ',' + g + ',' + b + ')';\n } else if (colorFormat === 'CSS_RGBA') {\n return 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';\n } else if (colorFormat === 'HEX') {\n return '0x' + color.hex.toString(16);\n } else if (colorFormat === 'RGB_ARRAY') {\n return '[' + r + ',' + g + ',' + b + ']';\n } else if (colorFormat === 'RGBA_ARRAY') {\n return '[' + r + ',' + g + ',' + b + ',' + a + ']';\n } else if (colorFormat === 'RGB_OBJ') {\n return '{r:' + r + ',g:' + g + ',b:' + b + '}';\n } else if (colorFormat === 'RGBA_OBJ') {\n return '{r:' + r + ',g:' + g + ',b:' + b + ',a:' + a + '}';\n } else if (colorFormat === 'HSV_OBJ') {\n return '{h:' + h + ',s:' + s + ',v:' + v + '}';\n } else if (colorFormat === 'HSVA_OBJ') {\n return '{h:' + h + ',s:' + s + ',v:' + v + ',a:' + a + '}';\n }\n\n return 'unknown format';\n}\n","/**\n * dat-gui JavaScript Controller Library\n * https://github.com/dataarts/dat.gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nconst ARR_EACH = Array.prototype.forEach;\nconst ARR_SLICE = Array.prototype.slice;\n\n/**\n * Band-aid methods for things that should be a lot easier in JavaScript.\n * Implementation and structure inspired by underscore.js\n * http://documentcloud.github.com/underscore/\n */\n\nconst Common = {\n BREAK: {},\n\n extend: function(target) {\n this.each(ARR_SLICE.call(arguments, 1), function(obj) {\n const keys = this.isObject(obj) ? Object.keys(obj) : [];\n keys.forEach(function(key) {\n if (!this.isUndefined(obj[key])) {\n target[key] = obj[key];\n }\n }.bind(this));\n }, this);\n\n return target;\n },\n\n defaults: function(target) {\n this.each(ARR_SLICE.call(arguments, 1), function(obj) {\n const keys = this.isObject(obj) ? Object.keys(obj) : [];\n keys.forEach(function(key) {\n if (this.isUndefined(target[key])) {\n target[key] = obj[key];\n }\n }.bind(this));\n }, this);\n\n return target;\n },\n\n compose: function() {\n const toCall = ARR_SLICE.call(arguments);\n return function() {\n let args = ARR_SLICE.call(arguments);\n for (let i = toCall.length - 1; i >= 0; i--) {\n args = [toCall[i].apply(this, args)];\n }\n return args[0];\n };\n },\n\n each: function(obj, itr, scope) {\n if (!obj) {\n return;\n }\n\n if (ARR_EACH && obj.forEach && obj.forEach === ARR_EACH) {\n obj.forEach(itr, scope);\n } else if (obj.length === obj.length + 0) { // Is number but not NaN\n let key;\n let l;\n for (key = 0, l = obj.length; key < l; key++) {\n if (key in obj && itr.call(scope, obj[key], key) === this.BREAK) {\n return;\n }\n }\n } else {\n for (const key in obj) {\n if (itr.call(scope, obj[key], key) === this.BREAK) {\n return;\n }\n }\n }\n },\n\n defer: function(fnc) {\n setTimeout(fnc, 0);\n },\n\n // if the function is called repeatedly, wait until threshold passes until we execute the function\n debounce: function(func, threshold, callImmediately) {\n let timeout;\n\n return function() {\n const obj = this;\n const args = arguments;\n function delayed() {\n timeout = null;\n if (!callImmediately) func.apply(obj, args);\n }\n\n const callNow = callImmediately || !timeout;\n\n clearTimeout(timeout);\n timeout = setTimeout(delayed, threshold);\n\n if (callNow) {\n func.apply(obj, args);\n }\n };\n },\n\n toArray: function(obj) {\n if (obj.toArray) return obj.toArray();\n return ARR_SLICE.call(obj);\n },\n\n isUndefined: function(obj) {\n return obj === undefined;\n },\n\n isNull: function(obj) {\n return obj === null;\n },\n\n isNaN: function(obj) {\n return isNaN(obj);\n },\n\n isArray: Array.isArray || function(obj) {\n return obj.constructor === Array;\n },\n\n isObject: function(obj) {\n return obj === Object(obj);\n },\n\n isNumber: function(obj) {\n return obj === obj + 0;\n },\n\n isString: function(obj) {\n return obj === obj + '';\n },\n\n isBoolean: function(obj) {\n return obj === false || obj === true;\n },\n\n isFunction: function(obj) {\n return obj instanceof Function;\n }\n\n};\n\nexport default Common;\n","/**\n * dat-gui JavaScript Controller Library\n * https://github.com/dataarts/dat.gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport toString from './toString';\nimport common from '../utils/common';\n\nconst INTERPRETATIONS = [\n // Strings\n {\n litmus: common.isString,\n conversions: {\n THREE_CHAR_HEX: {\n read: function(original) {\n const test = original.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);\n if (test === null) {\n return false;\n }\n\n return {\n space: 'HEX',\n hex: parseInt('0x' +\n test[1].toString() + test[1].toString() +\n test[2].toString() + test[2].toString() +\n test[3].toString() + test[3].toString(), 16)\n };\n },\n\n write: toString\n },\n\n SIX_CHAR_HEX: {\n read: function(original) {\n const test = original.match(/^#([A-F0-9]{6})$/i);\n if (test === null) {\n return false;\n }\n\n return {\n space: 'HEX',\n hex: parseInt('0x' + test[1].toString(), 16)\n };\n },\n\n write: toString\n },\n\n CSS_RGB: {\n read: function(original) {\n const test = original.match(/^rgb\\(\\s*(\\S+)\\s*,\\s*(\\S+)\\s*,\\s*(\\S+)\\s*\\)/);\n if (test === null) {\n return false;\n }\n\n return {\n space: 'RGB',\n r: parseFloat(test[1]),\n g: parseFloat(test[2]),\n b: parseFloat(test[3])\n };\n },\n\n write: toString\n },\n\n CSS_RGBA: {\n read: function(original) {\n const test = original.match(/^rgba\\(\\s*(\\S+)\\s*,\\s*(\\S+)\\s*,\\s*(\\S+)\\s*,\\s*(\\S+)\\s*\\)/);\n if (test === null) {\n return false;\n }\n\n return {\n space: 'RGB',\n r: parseFloat(test[1]),\n g: parseFloat(test[2]),\n b: parseFloat(test[3]),\n a: parseFloat(test[4])\n };\n },\n\n write: toString\n }\n }\n },\n\n // Numbers\n {\n litmus: common.isNumber,\n\n conversions: {\n\n HEX: {\n read: function(original) {\n return {\n space: 'HEX',\n hex: original,\n conversionName: 'HEX'\n };\n },\n\n write: function(color) {\n return color.hex;\n }\n }\n\n }\n\n },\n\n // Arrays\n {\n litmus: common.isArray,\n conversions: {\n RGB_ARRAY: {\n read: function(original) {\n if (original.length !== 3) {\n return false;\n }\n\n return {\n space: 'RGB',\n r: original[0],\n g: original[1],\n b: original[2]\n };\n },\n\n write: function(color) {\n return [color.r, color.g, color.b];\n }\n },\n\n RGBA_ARRAY: {\n read: function(original) {\n if (original.length !== 4) return false;\n return {\n space: 'RGB',\n r: original[0],\n g: original[1],\n b: original[2],\n a: original[3]\n };\n },\n\n write: function(color) {\n return [color.r, color.g, color.b, color.a];\n }\n }\n }\n },\n\n // Objects\n {\n litmus: common.isObject,\n conversions: {\n\n RGBA_OBJ: {\n read: function(original) {\n if (common.isNumber(original.r) &&\n common.isNumber(original.g) &&\n common.isNumber(original.b) &&\n common.isNumber(original.a)) {\n return {\n space: 'RGB',\n r: original.r,\n g: original.g,\n b: original.b,\n a: original.a\n };\n }\n return false;\n },\n\n write: function(color) {\n return {\n r: color.r,\n g: color.g,\n b: color.b,\n a: color.a\n };\n }\n },\n\n RGB_OBJ: {\n read: function(original) {\n if (common.isNumber(original.r) &&\n common.isNumber(original.g) &&\n common.isNumber(original.b)) {\n return {\n space: 'RGB',\n r: original.r,\n g: original.g,\n b: original.b\n };\n }\n return false;\n },\n\n write: function(color) {\n return {\n r: color.r,\n g: color.g,\n b: color.b\n };\n }\n },\n\n HSVA_OBJ: {\n read: function(original) {\n if (common.isNumber(original.h) &&\n common.isNumber(original.s) &&\n common.isNumber(original.v) &&\n common.isNumber(original.a)) {\n return {\n space: 'HSV',\n h: original.h,\n s: original.s,\n v: original.v,\n a: original.a\n };\n }\n return false;\n },\n\n write: function(color) {\n return {\n h: color.h,\n s: color.s,\n v: color.v,\n a: color.a\n };\n }\n },\n\n HSV_OBJ: {\n read: function(original) {\n if (common.isNumber(original.h) &&\n common.isNumber(original.s) &&\n common.isNumber(original.v)) {\n return {\n space: 'HSV',\n h: original.h,\n s: original.s,\n v: original.v\n };\n }\n return false;\n },\n\n write: function(color) {\n return {\n h: color.h,\n s: color.s,\n v: color.v\n };\n }\n }\n }\n }\n];\n\nlet result;\nlet toReturn;\n\nconst interpret = function() {\n toReturn = false;\n\n const original = arguments.length > 1 ? common.toArray(arguments) : arguments[0];\n common.each(INTERPRETATIONS, function(family) {\n if (family.litmus(original)) {\n common.each(family.conversions, function(conversion, conversionName) {\n result = conversion.read(original);\n\n if (toReturn === false && result !== false) {\n toReturn = result;\n result.conversionName = conversionName;\n result.conversion = conversion;\n return common.BREAK;\n }\n });\n\n return common.BREAK;\n }\n });\n\n return toReturn;\n};\n\nexport default interpret;\n","/**\n * dat-gui JavaScript Controller Library\n * https://github.com/dataarts/dat.gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nlet tmpComponent;\n\nconst ColorMath = {\n hsv_to_rgb: function(h, s, v) {\n const hi = Math.floor(h / 60) % 6;\n\n const f = h / 60 - Math.floor(h / 60);\n const p = v * (1.0 - s);\n const q = v * (1.0 - (f * s));\n const t = v * (1.0 - ((1.0 - f) * s));\n\n const c = [\n [v, t, p],\n [q, v, p],\n [p, v, t],\n [p, q, v],\n [t, p, v],\n [v, p, q]\n ][hi];\n\n return {\n r: c[0] * 255,\n g: c[1] * 255,\n b: c[2] * 255\n };\n },\n\n rgb_to_hsv: function(r, g, b) {\n const min = Math.min(r, g, b);\n const max = Math.max(r, g, b);\n const delta = max - min;\n let h;\n let s;\n\n if (max !== 0) {\n s = delta / max;\n } else {\n return {\n h: NaN,\n s: 0,\n v: 0\n };\n }\n\n if (r === max) {\n h = (g - b) / delta;\n } else if (g === max) {\n h = 2 + (b - r) / delta;\n } else {\n h = 4 + (r - g) / delta;\n }\n h /= 6;\n if (h < 0) {\n h += 1;\n }\n\n return {\n h: h * 360,\n s: s,\n v: max / 255\n };\n },\n\n rgb_to_hex: function(r, g, b) {\n let hex = this.hex_with_component(0, 2, r);\n hex = this.hex_with_component(hex, 1, g);\n hex = this.hex_with_component(hex, 0, b);\n return hex;\n },\n\n component_from_hex: function(hex, componentIndex) {\n return (hex >> (componentIndex * 8)) & 0xFF;\n },\n\n hex_with_component: function(hex, componentIndex, value) {\n return value << (tmpComponent = componentIndex * 8) | (hex & ~(0xFF << tmpComponent));\n }\n};\n\nexport default ColorMath;\n","/**\n * dat-gui JavaScript Controller Library\n * https://github.com/dataarts/dat.gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport interpret from './interpret';\nimport math from './math';\nimport colorToString from './toString';\nimport common from '../utils/common';\n\nclass Color {\n constructor() {\n this.__state = interpret.apply(this, arguments);\n\n if (this.__state === false) {\n throw new Error('Failed to interpret color arguments');\n }\n\n this.__state.a = this.__state.a || 1;\n }\n\n toString() {\n return colorToString(this);\n }\n\n toHexString() {\n return colorToString(this, true);\n }\n\n toOriginal() {\n return this.__state.conversion.write(this);\n }\n}\n\nfunction defineRGBComponent(target, component, componentHexIndex) {\n Object.defineProperty(target, component, {\n get: function() {\n if (this.__state.space === 'RGB') {\n return this.__state[component];\n }\n\n Color.recalculateRGB(this, component, componentHexIndex);\n\n return this.__state[component];\n },\n\n set: function(v) {\n if (this.__state.space !== 'RGB') {\n Color.recalculateRGB(this, component, componentHexIndex);\n this.__state.space = 'RGB';\n }\n\n this.__state[component] = v;\n }\n });\n}\n\nfunction defineHSVComponent(target, component) {\n Object.defineProperty(target, component, {\n get: function() {\n if (this.__state.space === 'HSV') {\n return this.__state[component];\n }\n\n Color.recalculateHSV(this);\n\n return this.__state[component];\n },\n\n set: function(v) {\n if (this.__state.space !== 'HSV') {\n Color.recalculateHSV(this);\n this.__state.space = 'HSV';\n }\n\n this.__state[component] = v;\n }\n });\n}\n\nColor.recalculateRGB = function(color, component, componentHexIndex) {\n if (color.__state.space === 'HEX') {\n color.__state[component] = math.component_from_hex(color.__state.hex, componentHexIndex);\n } else if (color.__state.space === 'HSV') {\n common.extend(color.__state, math.hsv_to_rgb(color.__state.h, color.__state.s, color.__state.v));\n } else {\n throw new Error('Corrupted color state');\n }\n};\n\nColor.recalculateHSV = function(color) {\n const result = math.rgb_to_hsv(color.r, color.g, color.b);\n\n common.extend(\n color.__state,\n {\n s: result.s,\n v: result.v\n }\n );\n\n if (!common.isNaN(result.h)) {\n color.__state.h = result.h;\n } else if (common.isUndefined(color.__state.h)) {\n color.__state.h = 0;\n }\n};\n\nColor.COMPONENTS = ['r', 'g', 'b', 'h', 's', 'v', 'hex', 'a'];\n\ndefineRGBComponent(Color.prototype, 'r', 2);\ndefineRGBComponent(Color.prototype, 'g', 1);\ndefineRGBComponent(Color.prototype, 'b', 0);\n\ndefineHSVComponent(Color.prototype, 'h');\ndefineHSVComponent(Color.prototype, 's');\ndefineHSVComponent(Color.prototype, 'v');\n\nObject.defineProperty(Color.prototype, 'a', {\n get: function() {\n return this.__state.a;\n },\n\n set: function(v) {\n this.__state.a = v;\n }\n});\n\nObject.defineProperty(Color.prototype, 'hex', {\n get: function() {\n if (this.__state.space !== 'HEX') {\n this.__state.hex = math.rgb_to_hex(this.r, this.g, this.b);\n this.__state.space = 'HEX';\n }\n\n return this.__state.hex;\n },\n\n set: function(v) {\n this.__state.space = 'HEX';\n this.__state.hex = v;\n }\n});\n\nexport default Color;\n","/**\n * dat-gui JavaScript Controller Library\n * https://github.com/dataarts/dat.gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n/**\n * @class An \"abstract\" class that represents a given property of an object.\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n */\nclass Controller {\n constructor(object, property) {\n this.initialValue = object[property];\n\n /**\n * Those who extend this class will put their DOM elements in here.\n * @type {DOMElement}\n */\n this.domElement = document.createElement('div');\n\n /**\n * The object to manipulate\n * @type {Object}\n */\n this.object = object;\n\n /**\n * The name of the property to manipulate\n * @type {String}\n */\n this.property = property;\n\n /**\n * The function to be called on change.\n * @type {Function}\n * @ignore\n */\n this.__onChange = undefined;\n\n /**\n * The function to be called on finishing change.\n * @type {Function}\n * @ignore\n */\n this.__onFinishChange = undefined;\n }\n\n /**\n * Specify that a function fire every time someone changes the value with\n * this Controller.\n *\n * @param {Function} fnc This function will be called whenever the value\n * is modified via this Controller.\n * @returns {Controller} this\n */\n onChange(fnc) {\n this.__onChange = fnc;\n return this;\n }\n\n /**\n * Specify that a function fire every time someone \"finishes\" changing\n * the value wih this Controller. Useful for values that change\n * incrementally like numbers or strings.\n *\n * @param {Function} fnc This function will be called whenever\n * someone \"finishes\" changing the value via this Controller.\n * @returns {Controller} this\n */\n onFinishChange(fnc) {\n this.__onFinishChange = fnc;\n return this;\n }\n\n /**\n * Change the value of <code>object[property]</code>\n *\n * @param {Object} newValue The new value of <code>object[property]</code>\n */\n setValue(newValue) {\n this.object[this.property] = newValue;\n if (this.__onChange) {\n this.__onChange.call(this, newValue);\n }\n\n this.updateDisplay();\n return this;\n }\n\n /**\n * Gets the value of <code>object[property]</code>\n *\n * @returns {Object} The current value of <code>object[property]</code>\n */\n getValue() {\n return this.object[this.property];\n }\n\n /**\n * Refreshes the visual display of a Controller in order to keep sync\n * with the object's current value.\n * @returns {Controller} this\n */\n updateDisplay() {\n return this;\n }\n\n /**\n * @returns {boolean} true if the value has deviated from initialValue\n */\n isModified() {\n return this.initialValue !== this.getValue();\n }\n}\n\nexport default Controller;\n","/**\n * dat-gui JavaScript Controller Library\n * https://github.com/dataarts/dat.gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport common from '../utils/common';\n\nconst EVENT_MAP = {\n HTMLEvents: ['change'],\n MouseEvents: ['click', 'mousemove', 'mousedown', 'mouseup', 'mouseover'],\n KeyboardEvents: ['keydown']\n};\n\nconst EVENT_MAP_INV = {};\ncommon.each(EVENT_MAP, function(v, k) {\n common.each(v, function(e) {\n EVENT_MAP_INV[e] = k;\n });\n});\n\nconst CSS_VALUE_PIXELS = /(\\d+(\\.\\d+)?)px/;\n\nfunction cssValueToPixels(val) {\n if (val === '0' || common.isUndefined(val)) {\n return 0;\n }\n\n const match = val.match(CSS_VALUE_PIXELS);\n\n if (!common.isNull(match)) {\n return parseFloat(match[1]);\n }\n\n // TODO ...ems? %?\n\n return 0;\n}\n\n/**\n * @namespace\n * @member dat.dom\n */\nconst dom = {\n\n /**\n *\n * @param elem\n * @param selectable\n */\n makeSelectable: function(elem, selectable) {\n if (elem === undefined || elem.style === undefined) return;\n\n elem.onselectstart = selectable ? function() {\n return false;\n } : function() {\n };\n\n elem.style.MozUserSelect = selectable ? 'auto' : 'none';\n elem.style.KhtmlUserSelect = selectable ? 'auto' : 'none';\n elem.unselectable = selectable ? 'on' : 'off';\n },\n\n /**\n *\n * @param elem\n * @param horizontal\n * @param vert\n */\n makeFullscreen: function(elem, hor, vert) {\n let vertical = vert;\n let horizontal = hor;\n\n if (common.isUndefined(horizontal)) {\n horizontal = true;\n }\n\n if (common.isUndefined(vertical)) {\n vertical = true;\n }\n\n elem.style.position = 'absolute';\n\n if (horizontal) {\n elem.style.left = 0;\n elem.style.right = 0;\n }\n if (vertical) {\n elem.style.top = 0;\n elem.style.bottom = 0;\n }\n },\n\n /**\n *\n * @param elem\n * @param eventType\n * @param params\n */\n fakeEvent: function(elem, eventType, pars, aux) {\n const params = pars || {};\n const className = EVENT_MAP_INV[eventType];\n if (!className) {\n throw new Error('Event type ' + eventType + ' not supported.');\n }\n const evt = document.createEvent(className);\n switch (className) {\n case 'MouseEvents':\n {\n const clientX = params.x || params.clientX || 0;\n const clientY = params.y || params.clientY || 0;\n evt.initMouseEvent(\n eventType,\n params.bubbles || false,\n params.cancelable || true,\n window,\n params.clickCount || 1,\n 0, // screen X\n 0, // screen Y\n clientX, // client X\n clientY, // client Y\n false,\n false,\n false,\n false,\n 0,\n null\n );\n break;\n }\n case 'KeyboardEvents':\n {\n const init = evt.initKeyboardEvent || evt.initKeyEvent; // webkit || moz\n common.defaults(params, {\n cancelable: true,\n ctrlKey: false,\n altKey: false,\n shiftKey: false,\n metaKey: false,\n keyCode: undefined,\n charCode: undefined\n });\n init(\n eventType,\n params.bubbles || false,\n params.cancelable,\n window,\n params.ctrlKey,\n params.altKey,\n params.shiftKey,\n params.metaKey,\n params.keyCode,\n params.charCode\n );\n break;\n }\n default:\n {\n evt.initEvent(eventType, params.bubbles || false, params.cancelable || true);\n break;\n }\n }\n common.defaults(evt, aux);\n elem.dispatchEvent(evt);\n },\n\n /**\n *\n * @param elem\n * @param event\n * @param func\n * @param bool\n */\n bind: function(elem, event, func, newBool) {\n const bool = newBool || false;\n if (elem.addEventListener) {\n elem.addEventListener(event, func, bool);\n } else if (elem.attachEvent) {\n elem.attachEvent('on' + event, func);\n }\n return dom;\n },\n\n /**\n *\n * @param elem\n * @param event\n * @param func\n * @param bool\n */\n unbind: function(elem, event, func, newBool) {\n const bool = newBool || false;\n if (elem.removeEventListener) {\n elem.removeEventListener(event, func, bool);\n } else if (elem.detachEvent) {\n elem.detachEvent('on' + event, func);\n }\n return dom;\n },\n\n /**\n *\n * @param elem\n * @param className\n */\n addClass: function(elem, className) {\n if (elem.className === undefined) {\n elem.className = className;\n } else if (elem.className !== className) {\n const classes = elem.className.split(/ +/);\n if (classes.indexOf(className) === -1) {\n classes.push(className);\n elem.className = classes.join(' ').replace(/^\\s+/, '').replace(/\\s+$/, '');\n }\n }\n return dom;\n },\n\n /**\n *\n * @param elem\n * @param className\n */\n removeClass: function(elem, className) {\n if (className) {\n if (elem.className === className) {\n elem.removeAttribute('class');\n } else {\n const classes = elem.className.split(/ +/);\n const index = classes.indexOf(className);\n if (index !== -1) {\n classes.splice(index, 1);\n elem.className = classes.join(' ');\n }\n }\n } else {\n elem.className = undefined;\n }\n return dom;\n },\n\n hasClass: function(elem, className) {\n return new RegExp('(?:^|\\\\s+)' + className + '(?:\\\\s+|$)').test(elem.className) || false;\n },\n\n /**\n *\n * @param elem\n */\n getWidth: function(elem) {\n const style = getComputedStyle(elem);\n\n return cssValueToPixels(style['border-left-width']) +\n cssValueToPixels(style['border-right-width']) +\n cssValueToPixels(style['padding-left']) +\n cssValueToPixels(style['padding-right']) +\n cssValueToPixels(style.width);\n },\n\n /**\n *\n * @param elem\n */\n getHeight: function(elem) {\n const style = getComputedStyle(elem);\n\n return cssValueToPixels(style['border-top-width']) +\n cssValueToPixels(style['border-bottom-width']) +\n cssValueToPixels(style['padding-top']) +\n cssValueToPixels(style['padding-bottom']) +\n cssValueToPixels(style.height);\n },\n\n /**\n *\n * @param el\n */\n getOffset: function(el) {\n let elem = el;\n const offset = { left: 0, top: 0 };\n if (elem.offsetParent) {\n do {\n offset.left += elem.offsetLeft;\n offset.top += elem.offsetTop;\n elem = elem.offsetParent;\n } while (elem);\n }\n return offset;\n },\n\n // http://stackoverflow.com/posts/2684561/revisions\n /**\n *\n * @param elem\n */\n isActive: function(elem) {\n return elem === document.activeElement && (elem.type || elem.href);\n }\n\n};\n\nexport default dom;\n","/**\n * dat-gui JavaScript Controller Library\n * https://github.com/dataarts/dat.gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\n\n/**\n * @class Provides a checkbox input to alter the boolean property of an object.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n */\nclass BooleanController extends Controller {\n constructor(object, property) {\n super(object, property);\n\n const _this = this;\n this.__prev = this.getValue();\n\n this.__checkbox = document.createElement('input');\n this.__checkbox.setAttribute('type', 'checkbox');\n\n function onChange() {\n _this.setValue(!_this.__prev);\n }\n\n dom.bind(this.__checkbox, 'change', onChange, false);\n\n this.domElement.appendChild(this.__checkbox);\n\n // Match original value\n this.updateDisplay();\n }\n\n setValue(v) {\n const toReturn = super.setValue(v);\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n this.__prev = this.getValue();\n return toReturn;\n }\n\n updateDisplay() {\n if (this.getValue() === true) {\n this.__checkbox.setAttribute('checked', 'checked');\n this.__checkbox.checked = true;\n this.__prev = true;\n } else {\n this.__checkbox.checked = false;\n this.__prev = false;\n }\n\n return super.updateDisplay();\n }\n}\n\nexport default BooleanController;\n","/**\n * dat-gui JavaScript Controller Library\n * https://github.com/dataarts/dat.gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\nimport common from '../utils/common';\n\n/**\n * @class Provides a select input to alter the property of an object, using a\n * list of accepted values.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Object|string[]} options A map of labels to acceptable values, or\n * a list of acceptable string values.\n */\nclass OptionController extends Controller {\n constructor(object, property, opts) {\n super(object, property);\n\n let options = opts;\n\n const _this = this;\n\n /**\n * The drop down menu\n * @ignore\n */\n this.__select = document.createElement('select');\n\n if (common.isArray(options)) {\n const map = {};\n common.each(options, function(element) {\n map[element] = element;\n });\n options = map;\n }\n\n common.each(options, function(value, key) {\n const opt = document.createElement('option');\n opt.innerHTML = key;\n opt.setAttribute('value', value);\n _this.__select.appendChild(opt);\n });\n\n // Acknowledge original value\n this.updateDisplay();\n\n dom.bind(this.__select, 'change', function() {\n const desiredValue = this.options[this.selectedIndex].value;\n _this.setValue(desiredValue);\n });\n\n this.domElement.appendChild(this.__select);\n }\n\n setValue(v) {\n const toReturn = super.setValue(v);\n\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n return toReturn;\n }\n\n updateDisplay() {\n if (dom.isActive(this.__select)) return this; // prevent number from updating if user is trying to manually update\n this.__select.value = this.getValue();\n return super.updateDisplay();\n }\n}\n\nexport default OptionController;\n","/**\n * dat-gui JavaScript Controller Library\n * https://github.com/dataarts/dat.gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\n\n/**\n * @class Provides a text input to alter the string property of an object.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n */\nclass StringController extends Controller {\n constructor(object, property) {\n super(object, property);\n\n const _this = this;\n\n function onChange() {\n _this.setValue(_this.__input.value);\n }\n\n function onBlur() {\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n\n this.__input = document.createElement('input');\n this.__input.setAttribute('type', 'text');\n\n dom.bind(this.__input, 'keyup', onChange);\n dom.bind(this.__input, 'change', onChange);\n dom.bind(this.__input, 'blur', onBlur);\n dom.bind(this.__input, 'keydown', function(e) {\n if (e.keyCode === 13) {\n this.blur();\n }\n });\n\n this.updateDisplay();\n\n this.domElement.appendChild(this.__input);\n }\n\n updateDisplay() {\n // Stops the caret from moving on account of:\n // keyup -> setValue -> updateDisplay\n if (!dom.isActive(this.__input)) {\n this.__input.value = this.getValue();\n }\n return super.updateDisplay();\n }\n}\n\nexport default StringController;\n","/**\n * dat-gui JavaScript Controller Library\n * https://github.com/dataarts/dat.gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport common from '../utils/common';\n\nfunction numDecimals(x) {\n const _x = x.toString();\n if (_x.indexOf('.') > -1) {\n return _x.length - _x.indexOf('.') - 1;\n }\n\n return 0;\n}\n\n/**\n * @class Represents a given property of an object that is a number.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Object} [params] Optional parameters\n * @param {Number} [params.min] Minimum allowed value\n * @param {Number} [params.max] Maximum allowed value\n * @param {Number} [params.step] Increment by which to change value\n */\nclass NumberController extends Controller {\n constructor(object, property, params) {\n super(object, property);\n\n const _params = params || {};\n\n this.__min = _params.min;\n this.__max = _params.max;\n this.__step = _params.step;\n\n if (common.isUndefined(this.__step)) {\n if (this.initialValue === 0) {\n this.__impliedStep = 1; // What are we, psychics?\n } else {\n // Hey Doug, check this out.\n this.__impliedStep = 10 ** Math.floor(Math.log(Math.abs(this.initialValue)) / Math.LN10) / 10;\n }\n } else {\n this.__impliedStep = this.__step;\n }\n\n this.__precision = numDecimals(this.__impliedStep);\n }\n\n setValue(v) {\n let _v = v;\n\n if (this.__min !== undefined && _v < this.__min) {\n _v = this.__min;\n } else if (this.__max !== undefined && _v > this.__max) {\n _v = this.__max;\n }\n\n if (this.__step !== undefined && _v % this.__step !== 0) {\n _v = Math.round(_v / this.__step) * this.__step;\n }\n\n return super.setValue(_v);\n }\n\n /**\n * Specify a minimum value for <code>object[property]</code>.\n *\n * @param {Number} minValue The minimum value for\n * <code>object[property]</code>\n * @returns {dat.controllers.NumberController} this\n */\n min(minValue) {\n this.__min = minValue;\n return this;\n }\n\n /**\n * Specify a maximum value for <code>object[property]</code>.\n *\n * @param {Number} maxValue The maximum value for\n * <code>object[property]</code>\n * @returns {dat.controllers.NumberController} this\n */\n max(maxValue) {\n this.__max = maxValue;\n return this;\n }\n\n /**\n * Specify a step value that dat.controllers.NumberController\n * increments by.\n *\n * @param {Number} stepValue The step value for\n * dat.controllers.NumberController\n * @default if minimum and maximum specified increment is 1% of the\n * difference otherwise stepValue is 1\n * @returns {dat.controllers.NumberController} this\n */\n step(stepValue) {\n this.__step = stepValue;\n this.__impliedStep = stepValue;\n this.__precision = numDecimals(stepValue);\n return this;\n }\n}\n\nexport default NumberController;\n","/**\n * dat-gui JavaScript Controller Library\n * https://github.com/dataarts/dat.gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport NumberController from './NumberController';\nimport dom from '../dom/dom';\nimport common from '../utils/common';\n\nfunction roundToDecimal(value, decimals) {\n const tenTo = 10 ** decimals;\n return Math.round(value * tenTo) / tenTo;\n}\n\n/**\n * @class Represents a given property of an object that is a number and\n * provides an input element with which to manipulate it.\n *\n * @extends dat.controllers.Controller\n * @extends dat.controllers.NumberController\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Object} [params] Optional parameters\n * @param {Number} [params.min] Minimum allowed value\n * @param {Number} [params.max] Maximum allowed value\n * @param {Number} [params.step] Increment by which to change value\n */\nclass NumberControllerBox extends NumberController {\n constructor(object, property, params) {\n super(object, property, params);\n\n this.__truncationSuspended = false;\n\n const _this = this;\n\n /**\n * {Number} Previous mouse y position\n * @ignore\n */\n let prevY;\n\n function onChange() {\n const attempted = parseFloat(_this.__input.value);\n if (!common.isNaN(attempted)) {\n _this.setValue(attempted);\n }\n }\n\n function onFinish() {\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n\n function onBlur() {\n onFinish();\n }\n\n function onMouseDrag(e) {\n const diff = prevY - e.clientY;\n _this.setValue(_this.getValue() + diff * _this.__impliedStep);\n\n prevY = e.clientY;\n }\n\n function onMouseUp() {\n dom.unbind(window, 'mousemove', onMouseDrag);\n dom.unbind(window, 'mouseup', onMouseUp);\n onFinish();\n }\n\n function onMouseDown(e) {\n dom.bind(window, 'mousemove', onMouseDrag);\n dom.bind(window, 'mouseup', onMouseUp);\n prevY = e.clientY;\n }\n\n this.__input = document.createElement('input');\n this.__input.setAttribute('type', 'text');\n\n // Makes it so manually specified values are not truncated.\n\n dom.bind(this.__input, 'change', onChange);\n dom.bind(this.__input, 'blur', onBlur);\n dom.bind(this.__input, 'mousedown', onMouseDown);\n dom.bind(this.__input, 'keydown', function(e) {\n // When pressing enter, you can be as precise as you want.\n if (e.keyCode === 13) {\n _this.__truncationSuspended = true;\n this.blur();\n _this.__truncationSuspended = false;\n onFinish();\n }\n });\n\n this.updateDisplay();\n\n this.domElement.appendChild(this.__input);\n }\n\n updateDisplay() {\n this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision);\n return super.updateDisplay();\n }\n}\n\nexport default NumberControllerBox;\n","/**\n * dat-gui JavaScript Controller Library\n * https://github.com/dataarts/dat.gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport NumberController from './NumberController';\nimport dom from '../dom/dom';\n\nfunction map(v, i1, i2, o1, o2) {\n return o1 + (o2 - o1) * ((v - i1) / (i2 - i1));\n}\n\n/**\n * @class Represents a given property of an object that is a number, contains\n * a minimum and maximum, and provides a slider element with which to\n * manipulate it. It should be noted that the slider element is made up of\n * <code>&lt;div&gt;</code> tags, <strong>not</strong> the html5\n * <code>&lt;slider&gt;</code> element.\n *\n * @extends dat.controllers.Controller\n * @extends dat.controllers.NumberController\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n * @param {Number} minValue Minimum allowed value\n * @param {Number} maxValue Maximum allowed value\n * @param {Number} stepValue Increment by which to change value\n */\nclass NumberControllerSlider extends NumberController {\n constructor(object, property, min, max, step) {\n super(object, property, { min: min, max: max, step: step });\n\n const _this = this;\n\n this.__background = document.createElement('div');\n this.__foreground = document.createElement('div');\n\n dom.bind(this.__background, 'mousedown', onMouseDown);\n dom.bind(this.__background, 'touchstart', onTouchStart);\n\n dom.addClass(this.__background, 'slider');\n dom.addClass(this.__foreground, 'slider-fg');\n\n function onMouseDown(e) {\n document.activeElement.blur();\n\n dom.bind(window, 'mousemove', onMouseDrag);\n dom.bind(window, 'mouseup', onMouseUp);\n\n onMouseDrag(e);\n }\n\n function onMouseDrag(e) {\n e.preventDefault();\n\n const bgRect = _this.__background.getBoundingClientRect();\n\n _this.setValue(\n map(e.clientX, bgRect.left, bgRect.right, _this.__min, _this.__max)\n );\n\n return false;\n }\n\n function onMouseUp() {\n dom.unbind(window, 'mousemove', onMouseDrag);\n dom.unbind(window, 'mouseup', onMouseUp);\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n\n function onTouchStart(e) {\n if (e.touches.length !== 1) { return; }\n dom.bind(window, 'touchmove', onTouchMove);\n dom.bind(window, 'touchend', onTouchEnd);\n onTouchMove(e);\n }\n\n function onTouchMove(e) {\n const clientX = e.touches[0].clientX;\n const bgRect = _this.__background.getBoundingClientRect();\n\n _this.setValue(\n map(clientX, bgRect.left, bgRect.right, _this.__min, _this.__max)\n );\n }\n\n function onTouchEnd() {\n dom.unbind(window, 'touchmove', onTouchMove);\n dom.unbind(window, 'touchend', onTouchEnd);\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.getValue());\n }\n }\n\n this.updateDisplay();\n\n this.__background.appendChild(this.__foreground);\n this.domElement.appendChild(this.__background);\n }\n\n updateDisplay() {\n const pct = (this.getValue() - this.__min) / (this.__max - this.__min);\n this.__foreground.style.width = pct * 100 + '%';\n return super.updateDisplay();\n }\n}\n\nexport default NumberControllerSlider;\n","/**\n * dat-gui JavaScript Controller Library\n * https://github.com/dataarts/dat.gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\n\n/**\n * @class Provides a GUI interface to fire a specified method, a property of an object.\n *\n * @extends dat.controllers.Controller\n *\n * @param {Object} object The object to be manipulated\n * @param {string} property The name of the property to be manipulated\n */\nclass FunctionController extends Controller {\n constructor(object, property, text) {\n super(object, property);\n\n const _this = this;\n\n this.__button = document.createElement('div');\n this.__button.innerHTML = text === undefined ? 'Fire' : text;\n\n dom.bind(this.__button, 'click', function(e) {\n e.preventDefault();\n _this.fire();\n return false;\n });\n\n dom.addClass(this.__button, 'button');\n\n this.domElement.appendChild(this.__button);\n }\n\n fire() {\n if (this.__onChange) {\n this.__onChange.call(this);\n }\n this.getValue().call(this.object);\n if (this.__onFinishChange) {\n this.__onFinishChange.call(this, this.getValue());\n }\n }\n}\n\nexport default FunctionController;\n","/**\n * dat-gui JavaScript Controller Library\n * https://github.com/dataarts/dat.gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Controller from './Controller';\nimport dom from '../dom/dom';\nimport Color from '../color/Color';\nimport interpret from '../color/interpret';\nimport common from '../utils/common';\n\n/**\n * @class Represents a given property of an object that is a color.\n * @param {Object} object\n * @param {string} property\n */\nclass ColorController extends Controller {\n constructor(object, property) {\n super(object, property);\n\n this.__color = new Color(this.getValue());\n this.__temp = new Color(0);\n\n const _this = this;\n\n this.domElement = document.createElement('div');\n\n dom.makeSelectable(this.domElement, false);\n\n this.__selector = document.createElement('div');\n this.__selector.className = 'selector';\n\n this.__saturation_field = document.createElement('div');\n this.__saturation_field.className = 'saturation-field';\n\n this.__field_knob = document.createElement('div');\n this.__field_knob.className = 'field-knob';\n this.__field_knob_border = '2px solid ';\n\n this.__hue_knob = document.createElement('div');\n this.__hue_knob.className = 'hue-knob';\n\n this.__hue_field = document.createElement('div');\n this.__hue_field.className = 'hue-field';\n\n this.__input = document.createElement('input');\n this.__input.type = 'text';\n this.__input_textShadow = '0 1px 1px ';\n\n dom.bind(this.__input, 'keydown', function(e) {\n if (e.keyCode === 13) { // on enter\n onBlur.call(this);\n }\n });\n\n dom.bind(this.__input, 'blur', onBlur);\n\n dom.bind(this.__selector, 'mousedown', function(/* e */) {\n dom\n .addClass(this, 'drag')\n .bind(window, 'mouseup', function(/* e */) {\n dom.removeClass(_this.__selector, 'drag');\n });\n });\n\n dom.bind(this.__selector, 'touchstart', function(/* e */) {\n dom\n .addClass(this, 'drag')\n .bind(window, 'touchend', function(/* e */) {\n dom.removeClass(_this.__selector, 'drag');\n });\n });\n\n const valueField = document.createElement('div');\n\n common.extend(this.__selector.style, {\n width: '122px',\n height: '102px',\n padding: '3px',\n backgroundColor: '#222',\n boxShadow: '0px 1px 3px rgba(0,0,0,0.3)'\n });\n\n common.extend(this.__field_knob.style, {\n position: 'absolute',\n width: '12px',\n height: '12px',\n border: this.__field_knob_border + (this.__color.v < 0.5 ? '#fff' : '#000'),\n boxShadow: '0px 1px 3px rgba(0,0,0,0.5)',\n borderRadius: '12px',\n zIndex: 1\n });\n\n common.extend(this.__hue_knob.style, {\n position: 'absolute',\n width: '15px',\n height: '2px',\n borderRight: '4px solid #fff',\n zIndex: 1\n });\n\n common.extend(this.__saturation_field.style, {\n width: '100px',\n height: '100px',\n border: '1px solid #555',\n marginRight: '3px',\n display: 'inline-block',\n cursor: 'pointer'\n });\n\n common.extend(valueField.style, {\n width: '100%',\n height: '100%',\n background: 'none'\n });\n\n linearGradient(valueField, 'top', 'rgba(0,0,0,0)', '#000');\n\n common.extend(this.__hue_field.style, {\n width: '15px',\n height: '100px',\n border: '1px solid #555',\n cursor: 'ns-resize',\n position: 'absolute',\n top: '3px',\n right: '3px'\n });\n\n hueGradient(this.__hue_field);\n\n common.extend(this.__input.style, {\n outline: 'none',\n // width: '120px',\n textAlign: 'center',\n // padding: '4px',\n // marginBottom: '6px',\n color: '#fff',\n border: 0,\n fontWeight: 'bold',\n textShadow: this.__input_textShadow + 'rgba(0,0,0,0.7)'\n });\n\n dom.bind(this.__saturation_field, 'mousedown', fieldDown);\n dom.bind(this.__saturation_field, 'touchstart', fieldDown);\n\n dom.bind(this.__field_knob, 'mousedown', fieldDown);\n dom.bind(this.__field_knob, 'touchstart', fieldDown);\n\n dom.bind(this.__hue_field, 'mousedown', fieldDownH);\n dom.bind(this.__hue_field, 'touchstart', fieldDownH);\n\n function fieldDown(e) {\n setSV(e);\n dom.bind(window, 'mousemove', setSV);\n dom.bind(window, 'touchmove', setSV);\n dom.bind(window, 'mouseup', fieldUpSV);\n dom.bind(window, 'touchend', fieldUpSV);\n }\n\n function fieldDownH(e) {\n setH(e);\n dom.bind(window, 'mousemove', setH);\n dom.bind(window, 'touchmove', setH);\n dom.bind(window, 'mouseup', fieldUpH);\n dom.bind(window, 'touchend', fieldUpH);\n }\n\n function fieldUpSV() {\n dom.unbind(window, 'mousemove', setSV);\n dom.unbind(window, 'touchmove', setSV);\n dom.unbind(window, 'mouseup', fieldUpSV);\n dom.unbind(window, 'touchend', fieldUpSV);\n onFinish();\n }\n\n function fieldUpH() {\n dom.unbind(window, 'mousemove', setH);\n dom.unbind(window, 'touchmove', setH);\n dom.unbind(window, 'mouseup', fieldUpH);\n dom.unbind(window, 'touchend', fieldUpH);\n onFinish();\n }\n\n function onBlur() {\n const i = interpret(this.value);\n if (i !== false) {\n _this.__color.__state = i;\n _this.setValue(_this.__color.toOriginal());\n } else {\n this.value = _this.__color.toString();\n }\n }\n\n function onFinish() {\n if (_this.__onFinishChange) {\n _this.__onFinishChange.call(_this, _this.__color.toOriginal());\n }\n }\n\n this.__saturation_field.appendChild(valueField);\n this.__selector.appendChild(this.__field_knob);\n this.__selector.appendChild(this.__saturation_field);\n this.__selector.appendChild(this.__hue_field);\n this.__hue_field.appendChild(this.__hue_knob);\n\n this.domElement.appendChild(this.__input);\n this.domElement.appendChild(this.__selector);\n\n this.updateDisplay();\n\n function setSV(e) {\n if (e.type.indexOf('touch') === -1) { e.preventDefault(); }\n\n const fieldRect = _this.__saturation_field.getBoundingClientRect();\n const { clientX, clientY } = (e.touches && e.touches[0]) || e;\n let s = (clientX - fieldRect.left) / (fieldRect.right - fieldRect.left);\n let v = 1 - (clientY - fieldRect.top) / (fieldRect.bottom - fieldRect.top);\n\n if (v > 1) {\n v = 1;\n } else if (v < 0) {\n v = 0;\n }\n\n if (s > 1) {\n s = 1;\n } else if (s < 0) {\n s = 0;\n }\n\n _this.__color.v = v;\n _this.__color.s = s;\n\n _this.setValue(_this.__color.toOriginal());\n\n return false;\n }\n\n function setH(e) {\n if (e.type.indexOf('touch') === -1) { e.preventDefault(); }\n\n const fieldRect = _this.__hue_field.getBoundingClientRect();\n const { clientY } = (e.touches && e.touches[0]) || e;\n let h = 1 - (clientY - fieldRect.top) / (fieldRect.bottom - fieldRect.top);\n\n if (h > 1) {\n h = 1;\n } else if (h < 0) {\n h = 0;\n }\n\n _this.__color.h = h * 360;\n\n _this.setValue(_this.__color.toOriginal());\n\n return false;\n }\n }\n\n updateDisplay() {\n const i = interpret(this.getValue());\n\n if (i !== false) {\n let mismatch = false;\n\n // Check for mismatch on the interpreted value.\n\n common.each(Color.COMPONENTS, function(component) {\n if (!common.isUndefined(i[component]) && !common.isUndefined(this.__color.__state[component]) &&\n i[component] !== this.__color.__state[component]) {\n mismatch = true;\n return {}; // break\n }\n }, this);\n\n // If nothing diverges, we keep our previous values\n // for statefulness, otherwise we recalculate fresh\n if (mismatch) {\n common.extend(this.__color.__state, i);\n }\n }\n\n common.extend(this.__temp.__state, this.__color.__state);\n\n this.__temp.a = 1;\n\n const flip = (this.__color.v < 0.5 || this.__color.s > 0.5) ? 255 : 0;\n const _flip = 255 - flip;\n\n common.extend(this.__field_knob.style, {\n marginLeft: 100 * this.__color.s - 7 + 'px',\n marginTop: 100 * (1 - this.__color.v) - 7 + 'px',\n backgroundColor: this.__temp.toHexString(),\n border: this.__field_knob_border + 'rgb(' + flip + ',' + flip + ',' + flip + ')'\n });\n\n this.__hue_knob.style.marginTop = (1 - this.__color.h / 360) * 100 + 'px';\n\n this.__temp.s = 1;\n this.__temp.v = 1;\n\n linearGradient(this.__saturation_field, 'left', '#fff', this.__temp.toHexString());\n\n this.__input.value = this.__color.toString();\n\n common.extend(this.__input.style, {\n backgroundColor: this.__color.toHexString(),\n color: 'rgb(' + flip + ',' + flip + ',' + flip + ')',\n textShadow: this.__input_textShadow + 'rgba(' + _flip + ',' + _flip + ',' + _flip + ',.7)'\n });\n }\n}\n\nconst vendors = ['-moz-', '-o-', '-webkit-', '-ms-', ''];\n\nfunction linearGradient(elem, x, a, b) {\n elem.style.background = '';\n common.each(vendors, function(vendor) {\n elem.style.cssText += 'background: ' + vendor + 'linear-gradient(' + x + ', ' + a + ' 0%, ' + b + ' 100%); ';\n });\n}\n\nfunction hueGradient(elem) {\n elem.style.background = '';\n elem.style.cssText += 'background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);';\n elem.style.cssText += 'background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n elem.style.cssText += 'background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n elem.style.cssText += 'background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n elem.style.cssText += 'background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);';\n}\n\nexport default ColorController;\n","/**\n * dat-gui JavaScript Controller Library\n * https://github.com/dataarts/dat.gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nconst css = {\n load: function(url, indoc) {\n const doc = indoc || document;\n const link = doc.createElement('link');\n link.type = 'text/css';\n link.rel = 'stylesheet';\n link.href = url;\n doc.getElementsByTagName('head')[0].appendChild(link);\n },\n\n inject: function(cssContent, indoc) {\n const doc = indoc || document;\n const injected = document.createElement('style');\n injected.type = 'text/css';\n injected.innerHTML = cssContent;\n const head = doc.getElementsByTagName('head')[0];\n try {\n head.appendChild(injected);\n } catch (e) { // Unable to inject CSS, probably because of a Content Security Policy\n }\n }\n};\n\nexport default css;\n","const saveDialogContents = `<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>`;\n\nexport default saveDialogContents;\n","/**\n * dat-gui JavaScript Controller Library\n * https://github.com/dataarts/dat.gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport OptionController from './OptionController';\nimport NumberControllerBox from './NumberControllerBox';\nimport NumberControllerSlider from './NumberControllerSlider';\nimport StringController from './StringController';\nimport FunctionController from './FunctionController';\nimport BooleanController from './BooleanController';\nimport common from '../utils/common';\n\nconst ControllerFactory = function(object, property) {\n const initialValue = object[property];\n\n // Providing options?\n if (common.isArray(arguments[2]) || common.isObject(arguments[2])) {\n return new OptionController(object, property, arguments[2]);\n }\n\n // Providing a map?\n if (common.isNumber(initialValue)) {\n // Has min and max? (slider)\n if (common.isNumber(arguments[2]) && common.isNumber(arguments[3])) {\n // has step?\n if (common.isNumber(arguments[4])) {\n return new NumberControllerSlider(\n object,\n property,\n arguments[2],\n arguments[3],\n arguments[4]\n );\n }\n\n return new NumberControllerSlider(object, property, arguments[2], arguments[3]);\n }\n\n // number box\n if (common.isNumber(arguments[4])) { // has step\n return new NumberControllerBox(\n object,\n property,\n { min: arguments[2], max: arguments[3], step: arguments[4] }\n );\n }\n return new NumberControllerBox(object, property, { min: arguments[2], max: arguments[3] });\n }\n\n if (common.isString(initialValue)) {\n return new StringController(object, property);\n }\n\n if (common.isFunction(initialValue)) {\n return new FunctionController(object, property, '');\n }\n\n if (common.isBoolean(initialValue)) {\n return new BooleanController(object, property);\n }\n\n return null;\n};\n\nexport default ControllerFactory;\n","/**\n * dat-gui JavaScript Controller Library\n * https://github.com/dataarts/dat.gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nfunction requestAnimationFrame(callback) {\n setTimeout(callback, 1000 / 60);\n}\n\nexport default window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n window.oRequestAnimationFrame ||\n window.msRequestAnimationFrame ||\n requestAnimationFrame;\n","/**\n * dat-gui JavaScript Controller Library\n * https://github.com/dataarts/dat.gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport dom from './dom';\nimport common from '../utils/common';\n\nclass CenteredDiv {\n constructor() {\n this.backgroundElement = document.createElement('div');\n common.extend(this.backgroundElement.style, {\n backgroundColor: 'rgba(0,0,0,0.8)',\n top: 0,\n left: 0,\n display: 'none',\n zIndex: '1000',\n opacity: 0,\n WebkitTransition: 'opacity 0.2s linear',\n transition: 'opacity 0.2s linear'\n });\n\n dom.makeFullscreen(this.backgroundElement);\n this.backgroundElement.style.position = 'fixed';\n\n this.domElement = document.createElement('div');\n common.extend(this.domElement.style, {\n position: 'fixed',\n display: 'none',\n zIndex: '1001',\n opacity: 0,\n WebkitTransition: '-webkit-transform 0.2s ease-out, opacity 0.2s linear',\n transition: 'transform 0.2s ease-out, opacity 0.2s linear'\n });\n\n document.body.appendChild(this.backgroundElement);\n document.body.appendChild(this.domElement);\n\n const _this = this;\n dom.bind(this.backgroundElement, 'click', function() {\n _this.hide();\n });\n }\n\n show() {\n const _this = this;\n\n this.backgroundElement.style.display = 'block';\n\n this.domElement.style.display = 'block';\n this.domElement.style.opacity = 0;\n // this.domElement.style.top = '52%';\n this.domElement.style.webkitTransform = 'scale(1.1)';\n\n this.layout();\n\n common.defer(function() {\n _this.backgroundElement.style.opacity = 1;\n _this.domElement.style.opacity = 1;\n _this.domElement.style.webkitTransform = 'scale(1)';\n });\n }\n\n /**\n * Hide centered div\n */\n hide() {\n const _this = this;\n\n const hide = function() {\n _this.domElement.style.display = 'none';\n _this.backgroundElement.style.display = 'none';\n\n dom.unbind(_this.domElement, 'webkitTransitionEnd', hide);\n dom.unbind(_this.domElement, 'transitionend', hide);\n dom.unbind(_this.domElement, 'oTransitionEnd', hide);\n };\n\n dom.bind(this.domElement, 'webkitTransitionEnd', hide);\n dom.bind(this.domElement, 'transitionend', hide);\n dom.bind(this.domElement, 'oTransitionEnd', hide);\n\n this.backgroundElement.style.opacity = 0;\n // this.domElement.style.top = '48%';\n this.domElement.style.opacity = 0;\n this.domElement.style.webkitTransform = 'scale(1.1)';\n }\n\n layout() {\n this.domElement.style.left = window.innerWidth / 2 - dom.getWidth(this.domElement) / 2 + 'px';\n this.domElement.style.top = window.innerHeight / 2 - dom.getHeight(this.domElement) / 2 + 'px';\n }\n}\n\nexport default CenteredDiv;\n","/**\n * dat-gui JavaScript Controller Library\n * https://github.com/dataarts/dat.gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport css from '../utils/css';\nimport saveDialogueContents from './saveDialogue.html';\nimport ControllerFactory from '../controllers/ControllerFactory';\nimport Controller from '../controllers/Controller';\nimport BooleanController from '../controllers/BooleanController';\nimport FunctionController from '../controllers/FunctionController';\nimport NumberControllerBox from '../controllers/NumberControllerBox';\nimport NumberControllerSlider from '../controllers/NumberControllerSlider';\nimport ColorController from '../controllers/ColorController';\nimport requestAnimationFrame from '../utils/requestAnimationFrame';\nimport CenteredDiv from '../dom/CenteredDiv';\nimport dom from '../dom/dom';\nimport common from '../utils/common';\n\nimport styleSheet from './style.scss'; // CSS to embed in build\n\ncss.inject(styleSheet);\n\n/** @ignore Outer-most className for GUI's */\nconst CSS_NAMESPACE = 'dg';\n\nconst HIDE_KEY_CODE = 72;\n\n/** @ignore The only value shared between the JS and SCSS. Use caution. */\nconst CLOSE_BUTTON_HEIGHT = 20;\n\nconst DEFAULT_DEFAULT_PRESET_NAME = 'Default';\n\nconst SUPPORTS_LOCAL_STORAGE = (function() {\n try {\n return !!window.localStorage;\n } catch (e) {\n return false;\n }\n}());\n\nlet SAVE_DIALOGUE;\n\n/** @ignore Have we yet to create an autoPlace GUI? */\nlet autoPlaceVirgin = true;\n\n/** @ignore Fixed position div that auto place GUI's go inside */\nlet autoPlaceContainer;\n\n/** @ignore Are we hiding the GUI's ? */\nlet hide = false;\n\n/** @private GUI's which should be hidden */\nconst hideableGuis = [];\n\n/**\n * @class A lightweight controller library for JavaScript. It allows you to easily\n * manipulate variables and fire functions on the fly.\n *\n * @typicalname gui\n *\n * @example\n * // Creating a GUI with options.\n * var gui = new dat.GUI({name: 'My GUI'});\n *\n * @example\n * // Creating a GUI and a subfolder.\n * var gui = new dat.GUI();\n * var folder1 = gui.addFolder('Flow Field');\n *\n * @param {Object} [params]\n * @param {String} [params.name] The name of this GUI.\n * @param {Object} [params.load] JSON object representing the saved state of\n * this GUI.\n * @param {dat.gui.GUI} [params.parent] The GUI I'm nested in.\n * @param {Boolean} [params.autoPlace=true]\n * @param {Boolean} [params.hideable=true] If true, GUI is shown/hidden by <kbd>h</kbd> keypress.\n * @param {Boolean} [params.closed=false] If true, starts closed\n * @param {Boolean} [params.closeOnTop=false] If true, close/open button shows on top of the GUI\n */\nconst GUI = function(pars) {\n const _this = this;\n\n let params = pars || {};\n\n /**\n * Outermost DOM Element\n * @type {DOMElement}\n */\n this.domElement = document.createElement('div');\n this.__ul = document.createElement('ul');\n this.domElement.appendChild(this.__ul);\n\n dom.addClass(this.domElement, CSS_NAMESPACE);\n\n /**\n * Nested GUI's by name\n * @ignore\n */\n this.__folders = {};\n\n this.__controllers = [];\n\n /**\n * List of objects I'm remembering for save, only used in top level GUI\n * @ignore\n */\n this.__rememberedObjects = [];\n\n /**\n * Maps the index of remembered objects to a map of controllers, only used\n * in top level GUI.\n *\n * @private\n * @ignore\n *\n * @example\n * [\n * {\n * propertyName: Controller,\n * anotherPropertyName: Controller\n * },\n * {\n * propertyName: Controller\n * }\n * ]\n */\n this.__rememberedObjectIndecesToControllers = [];\n\n this.__listening = [];\n\n // Default parameters\n params = common.defaults(params, {\n closeOnTop: false,\n autoPlace: true,\n width: GUI.DEFAULT_WIDTH\n });\n\n params = common.defaults(params, {\n resizable: params.autoPlace,\n hideable: params.autoPlace\n });\n\n if (!common.isUndefined(params.load)) {\n // Explicit preset\n if (params.preset) {\n params.load.preset = params.preset;\n }\n } else {\n params.load = { preset: DEFAULT_DEFAULT_PRESET_NAME };\n }\n\n if (common.isUndefined(params.parent) && params.hideable) {\n hideableGuis.push(this);\n }\n\n // Only root level GUI's are resizable.\n params.resizable = common.isUndefined(params.parent) && params.resizable;\n\n if (params.autoPlace && common.isUndefined(params.scrollable)) {\n params.scrollable = true;\n }\n // params.scrollable = common.isUndefined(params.parent) && params.scrollable === true;\n\n // Not part of params because I don't want people passing this in via\n // constructor. Should be a 'remembered' value.\n let useLocalStorage =\n SUPPORTS_LOCAL_STORAGE &&\n localStorage.getItem(getLocalStorageHash(this, 'isLocal')) === 'true';\n\n let saveToLocalStorage;\n let titleRow;\n\n Object.defineProperties(\n this,\n /** @lends GUI.prototype */\n {\n /**\n * The parent <code>GUI</code>\n * @type dat.gui.GUI\n */\n parent: {\n get: function() {\n return params.parent;\n }\n },\n\n scrollable: {\n get: function() {\n return params.scrollable;\n }\n },\n\n /**\n * Handles <code>GUI</code>'s element placement for you\n * @type Boolean\n */\n autoPlace: {\n get: function() {\n return params.autoPlace;\n }\n },\n\n /**\n * Handles <code>GUI</code>'s position of open/close button\n * @type Boolean\n */\n closeOnTop: {\n get: function() {\n return params.closeOnTop;\n }\n },\n\n /**\n * The identifier for a set of saved values\n * @type String\n */\n preset: {\n get: function() {\n if (_this.parent) {\n return _this.getRoot().preset;\n }\n\n return params.load.preset;\n },\n\n set: function(v) {\n if (_this.parent) {\n _this.getRoot().preset = v;\n } else {\n params.load.preset = v;\n }\n setPresetSelectIndex(this);\n _this.revert();\n }\n },\n\n /**\n * The width of <code>GUI</code> element\n * @type Number\n */\n width: {\n get: function() {\n return params.width;\n },\n set: function(v) {\n params.width = v;\n setWidth(_this, v);\n }\n },\n\n /**\n * The name of <code>GUI</code>. Used for folders. i.e\n * a folder's name\n * @type String\n */\n name: {\n get: function() {\n return params.name;\n },\n set: function(v) {\n // TODO Check for collisions among sibling folders\n params.name = v;\n if (titleRow) {\n titleRow.innerHTML = params.name;\n }\n }\n },\n\n /**\n * Whether the <code>GUI</code> is collapsed or not\n * @type Boolean\n */\n closed: {\n get: function() {\n return params.closed;\n },\n set: function(v) {\n params.closed = v;\n if (params.closed) {\n dom.addClass(_this.__ul, GUI.CLASS_CLOSED);\n } else {\n dom.removeClass(_this.__ul, GUI.CLASS_CLOSED);\n }\n // For browsers that aren't going to respect the CSS transition,\n // Lets just check our height against the window height right off\n // the bat.\n this.onResize();\n\n if (_this.__closeButton) {\n _this.__closeButton.innerHTML = v ? GUI.TEXT_OPEN : GUI.TEXT_CLOSED;\n }\n }\n },\n\n /**\n * Contains all presets\n * @type Object\n */\n load: {\n get: function() {\n return params.load;\n }\n },\n\n /**\n * Determines whether or not to use <a href=\"https://developer.mozilla.org/en/DOM/Storage#localStorage\">localStorage</a> as the means for\n * <code>remember</code>ing\n * @type Boolean\n */\n useLocalStorage: {\n\n get: function() {\n return useLocalStorage;\n },\n set: function(bool) {\n if (SUPPORTS_LOCAL_STORAGE) {\n useLocalStorage = bool;\n if (bool) {\n dom.bind(window, 'unload', saveToLocalStorage);\n } else {\n dom.unbind(window, 'unload', saveToLocalStorage);\n }\n localStorage.setItem(getLocalStorageHash(_this, 'isLocal'), bool);\n }\n }\n }\n }\n );\n\n // Are we a root level GUI?\n if (common.isUndefined(params.parent)) {\n this.closed = params.closed || false;\n\n dom.addClass(this.domElement, GUI.CLASS_MAIN);\n dom.makeSelectable(this.domElement, false);\n\n // Are we supposed to be loading locally?\n if (SUPPORTS_LOCAL_STORAGE) {\n if (useLocalStorage) {\n _this.useLocalStorage = true;\n\n const savedGui = localStorage.getItem(getLocalStorageHash(this, 'gui'));\n\n if (savedGui) {\n params.load = JSON.parse(savedGui);\n }\n }\n }\n\n this.__closeButton = document.createElement('div');\n this.__closeButton.innerHTML = GUI.TEXT_CLOSED;\n dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_BUTTON);\n if (params.closeOnTop) {\n dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_TOP);\n this.domElement.insertBefore(this.__closeButton, this.domElement.childNodes[0]);\n } else {\n dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_BOTTOM);\n this.domElement.appendChild(this.__closeButton);\n }\n\n dom.bind(this.__closeButton, 'click', function() {\n _this.closed = !_this.closed;\n });\n // Oh, you're a nested GUI!\n } else {\n if (params.closed === undefined) {\n params.closed = true;\n }\n\n const titleRowName = document.createTextNode(params.name);\n dom.addClass(titleRowName, 'controller-name');\n\n titleRow = addRow(_this, titleRowName);\n\n const onClickTitle = function(e) {\n e.preventDefault();\n _this.closed = !_this.closed;\n return false;\n };\n\n dom.addClass(this.__ul, GUI.CLASS_CLOSED);\n\n dom.addClass(titleRow, 'title');\n dom.bind(titleRow, 'click', onClickTitle);\n\n if (!params.closed) {\n this.closed = false;\n }\n }\n\n if (params.autoPlace) {\n if (common.isUndefined(params.parent)) {\n if (autoPlaceVirgin) {\n autoPlaceContainer = document.createElement('div');\n dom.addClass(autoPlaceContainer, CSS_NAMESPACE);\n dom.addClass(autoPlaceContainer, GUI.CLASS_AUTO_PLACE_CONTAINER);\n document.body.appendChild(autoPlaceContainer);\n autoPlaceVirgin = false;\n }\n\n // Put it in the dom for you.\n autoPlaceContainer.appendChild(this.domElement);\n\n // Apply the auto styles\n dom.addClass(this.domElement, GUI.CLASS_AUTO_PLACE);\n }\n\n // Make it not elastic.\n if (!this.parent) {\n setWidth(_this, params.width);\n }\n }\n\n this.__resizeHandler = function() {\n _this.onResizeDebounced();\n };\n\n dom.bind(window, 'resize', this.__resizeHandler);\n dom.bind(this.__ul, 'webkitTransitionEnd', this.__resizeHandler);\n dom.bind(this.__ul, 'transitionend', this.__resizeHandler);\n dom.bind(this.__ul, 'oTransitionEnd', this.__resizeHandler);\n this.onResize();\n\n if (params.resizable) {\n addResizeHandle(this);\n }\n\n saveToLocalStorage = function() {\n if (SUPPORTS_LOCAL_STORAGE && localStorage.getItem(getLocalStorageHash(_this, 'isLocal')) === 'true') {\n localStorage.setItem(getLocalStorageHash(_this, 'gui'), JSON.stringify(_this.getSaveObject()));\n }\n };\n\n // expose this method publicly\n this.saveToLocalStorageIfPossible = saveToLocalStorage;\n\n function resetWidth() {\n const root = _this.getRoot();\n root.width += 1;\n common.defer(function() {\n root.width -= 1;\n });\n }\n\n if (!params.parent) {\n resetWidth();\n }\n};\n\nGUI.toggleHide = function() {\n hide = !hide;\n common.each(hideableGuis, function(gui) {\n gui.domElement.style.display = hide ? 'none' : '';\n });\n};\n\nGUI.CLASS_AUTO_PLACE = 'a';\nGUI.CLASS_AUTO_PLACE_CONTAINER = 'ac';\nGUI.CLASS_MAIN = 'main';\nGUI.CLASS_CONTROLLER_ROW = 'cr';\nGUI.CLASS_TOO_TALL = 'taller-than-window';\nGUI.CLASS_CLOSED = 'closed';\nGUI.CLASS_CLOSE_BUTTON = 'close-button';\nGUI.CLASS_CLOSE_TOP = 'close-top';\nGUI.CLASS_CLOSE_BOTTOM = 'close-bottom';\nGUI.CLASS_DRAG = 'drag';\n\nGUI.DEFAULT_WIDTH = 245;\nGUI.TEXT_CLOSED = 'Close Controls';\nGUI.TEXT_OPEN = 'Open Controls';\n\nGUI._keydownHandler = function(e) {\n if (document.activeElement.type !== 'text' &&\n (e.which === HIDE_KEY_CODE || e.keyCode === HIDE_KEY_CODE)) {\n GUI.toggleHide();\n }\n};\ndom.bind(window, 'keydown', GUI._keydownHandler, false);\n\ncommon.extend(\n GUI.prototype,\n\n /** @lends GUI.prototype */\n {\n\n /**\n * Adds a new {@link Controller} to the GUI. The type of controller created\n * is inferred from the initial value of <code>object[property]</code>. For\n * color properties, see {@link addColor}.\n *\n * @param {Object} object The object to be manipulated\n * @param {String} property The name of the property to be manipulated\n * @param {Number} [min] Minimum allowed value\n * @param {Number} [max] Maximum allowed value\n * @param {Number} [step] Increment by which to change value\n * @returns {Controller} The controller that was added to the GUI.\n * @instance\n *\n * @example\n * // Add a string controller.\n * var person = {name: 'Sam'};\n * gui.add(person, 'name');\n *\n * @example\n * // Add a number controller slider.\n * var person = {age: 45};\n * gui.add(person, 'age', 0, 100);\n */\n add: function(object, property) {\n return add(\n this,\n object,\n property,\n {\n factoryArgs: Array.prototype.slice.call(arguments, 2)\n }\n );\n },\n\n /**\n * Adds a new color controller to the GUI.\n *\n * @param object\n * @param property\n * @returns {Controller} The controller that was added to the GUI.\n * @instance\n *\n * @example\n * var palette = {\n * color1: '#FF0000', // CSS string\n * color2: [ 0, 128, 255 ], // RGB array\n * color3: [ 0, 128, 255, 0.3 ], // RGB with alpha\n * color4: { h: 350, s: 0.9, v: 0.3 } // Hue, saturation, value\n * };\n * gui.addColor(palette, 'color1');\n * gui.addColor(palette, 'color2');\n * gui.addColor(palette, 'color3');\n * gui.addColor(palette, 'color4');\n */\n addColor: function(object, property) {\n return add(\n this,\n object,\n property,\n {\n color: true\n }\n );\n },\n\n /**\n * Removes the given controller from the GUI.\n * @param {Controller} controller\n * @instance\n */\n remove: function(controller) {\n // TODO listening?\n this.__ul.removeChild(controller.__li);\n this.__controllers.splice(this.__controllers.indexOf(controller), 1);\n const _this = this;\n common.defer(function() {\n _this.onResize();\n });\n },\n\n /**\n * Removes the root GUI from the document and unbinds all event listeners.\n * For subfolders, use `gui.removeFolder(folder)` instead.\n * @instance\n */\n destroy: function() {\n if (this.parent) {\n throw new Error(\n 'Only the root GUI should be removed with .destroy(). ' +\n 'For subfolders, use gui.removeFolder(folder) instead.'\n );\n }\n\n if (this.autoPlace) {\n autoPlaceContainer.removeChild(this.domElement);\n }\n\n const _this = this;\n common.each(this.__folders, function(subfolder) {\n _this.removeFolder(subfolder);\n });\n\n dom.unbind(window, 'keydown', GUI._keydownHandler, false);\n\n removeListeners(this);\n },\n\n /**\n * Creates a new subfolder GUI instance.\n * @param name\n * @returns {dat.gui.GUI} The new folder.\n * @throws {Error} if this GUI already has a folder by the specified\n * name\n * @instance\n */\n addFolder: function(name) {\n // We have to prevent collisions on names in order to have a key\n // by which to remember saved values\n if (this.__folders[name] !== undefined) {\n throw new Error('You already have a folder in this GUI by the' +\n ' name \"' + name + '\"');\n }\n\n const newGuiParams = { name: name, parent: this };\n\n // We need to pass down the autoPlace trait so that we can\n // attach event listeners to open/close folder actions to\n // ensure that a scrollbar appears if the window is too short.\n newGuiParams.autoPlace = this.autoPlace;\n\n // Do we have saved appearance data for this folder?\n if (this.load && // Anything loaded?\n this.load.folders && // Was my parent a dead-end?\n this.load.folders[name]) { // Did daddy remember me?\n // Start me closed if I was closed\n newGuiParams.closed = this.load.folders[name].closed;\n\n // Pass down the loaded data\n newGuiParams.load = this.load.folders[name];\n }\n\n const gui = new GUI(newGuiParams);\n this.__folders[name] = gui;\n\n const li = addRow(this, gui.domElement);\n dom.addClass(li, 'folder');\n return gui;\n },\n\n /**\n * Removes a subfolder GUI instance.\n * @param {dat.gui.GUI} folder The folder to remove.\n * @instance\n */\n removeFolder: function(folder) {\n this.__ul.removeChild(folder.domElement.parentElement);\n\n delete this.__folders[folder.name];\n\n // Do we have saved appearance data for this folder?\n if (this.load && // Anything loaded?\n this.load.folders && // Was my parent a dead-end?\n this.load.folders[folder.name]) {\n delete this.load.folders[folder.name];\n }\n\n removeListeners(folder);\n\n const _this = this;\n\n common.each(folder.__folders, function(subfolder) {\n folder.removeFolder(subfolder);\n });\n\n common.defer(function() {\n _this.onResize();\n });\n },\n\n /**\n * Opens the GUI.\n */\n open: function() {\n this.closed = false;\n },\n\n /**\n * Closes the GUI.\n */\n close: function() {\n this.closed = true;\n },\n\n /**\n * Hides the GUI.\n */\n hide: function() {\n this.domElement.style.display = 'none';\n },\n\n /**\n * Shows the GUI.\n */\n show: function() {\n this.domElement.style.display = '';\n },\n\n onResize: function() {\n // we debounce this function to prevent performance issues when rotating on tablet/mobile\n const root = this.getRoot();\n if (root.scrollable) {\n const top = dom.getOffset(root.__ul).top;\n let h = 0;\n\n common.each(root.__ul.childNodes, function(node) {\n if (!(root.autoPlace && node === root.__save_row)) {\n h += dom.getHeight(node);\n }\n });\n\n if (window.innerHeight - top - CLOSE_BUTTON_HEIGHT < h) {\n dom.addClass(root.domElement, GUI.CLASS_TOO_TALL);\n root.__ul.style.height = window.innerHeight - top - CLOSE_BUTTON_HEIGHT + 'px';\n } else {\n dom.removeClass(root.domElement, GUI.CLASS_TOO_TALL);\n root.__ul.style.height = 'auto';\n }\n }\n\n if (root.__resize_handle) {\n common.defer(function() {\n root.__resize_handle.style.height = root.__ul.offsetHeight + 'px';\n });\n }\n\n if (root.__closeButton) {\n root.__closeButton.style.width = root.width + 'px';\n }\n },\n\n onResizeDebounced: common.debounce(function() { this.onResize(); }, 50),\n\n /**\n * Mark objects for saving. The order of these objects cannot change as\n * the GUI grows. When remembering new objects, append them to the end\n * of the list.\n *\n * @param {...Object} objects\n * @throws {Error} if not called on a top level GUI.\n * @instance\n * @ignore\n */\n remember: function() {\n if (common.isUndefined(SAVE_DIALOGUE)) {\n SAVE_DIALOGUE = new CenteredDiv();\n SAVE_DIALOGUE.domElement.innerHTML = saveDialogueContents;\n }\n\n if (this.parent) {\n throw new Error('You can only call remember on a top level GUI.');\n }\n\n const _this = this;\n\n common.each(Array.prototype.slice.call(arguments), function(object) {\n if (_this.__rememberedObjects.length === 0) {\n addSaveMenu(_this);\n }\n if (_this.__rememberedObjects.indexOf(object) === -1) {\n _this.__rememberedObjects.push(object);\n }\n });\n\n if (this.autoPlace) {\n // Set save row width\n setWidth(this, this.width);\n }\n },\n\n /**\n * @returns {dat.gui.GUI} the topmost parent GUI of a nested GUI.\n * @instance\n */\n getRoot: function() {\n let gui = this;\n while (gui.parent) {\n gui = gui.parent;\n }\n return gui;\n },\n\n /**\n * @returns {Object} a JSON object representing the current state of\n * this GUI as well as its remembered properties.\n * @instance\n */\n getSaveObject: function() {\n const toReturn = this.load;\n toReturn.closed = this.closed;\n\n // Am I remembering any values?\n if (this.__rememberedObjects.length > 0) {\n toReturn.preset = this.preset;\n\n if (!toReturn.remembered) {\n toReturn.remembered = {};\n }\n\n toReturn.remembered[this.preset] = getCurrentPreset(this);\n }\n\n toReturn.folders = {};\n common.each(this.__folders, function(element, key) {\n toReturn.folders[key] = element.getSaveObject();\n });\n\n return toReturn;\n },\n\n save: function() {\n if (!this.load.remembered) {\n this.load.remembered = {};\n }\n\n this.load.remembered[this.preset] = getCurrentPreset(this);\n markPresetModified(this, false);\n this.saveToLocalStorageIfPossible();\n },\n\n saveAs: function(presetName) {\n if (!this.load.remembered) {\n // Retain default values upon first save\n this.load.remembered = {};\n this.load.remembered[DEFAULT_DEFAULT_PRESET_NAME] = getCurrentPreset(this, true);\n }\n\n this.load.remembered[presetName] = getCurrentPreset(this);\n this.preset = presetName;\n addPresetOption(this, presetName, true);\n this.saveToLocalStorageIfPossible();\n },\n\n revert: function(gui) {\n common.each(this.__controllers, function(controller) {\n // Make revert work on Default.\n if (!this.getRoot().load.remembered) {\n controller.setValue(controller.initialValue);\n } else {\n recallSavedValue(gui || this.getRoot(), controller);\n }\n\n // fire onFinishChange callback\n if (controller.__onFinishChange) {\n controller.__onFinishChange.call(controller, controller.getValue());\n }\n }, this);\n\n common.each(this.__folders, function(folder) {\n folder.revert(folder);\n });\n\n if (!gui) {\n markPresetModified(this.getRoot(), false);\n }\n },\n\n listen: function(controller) {\n const init = this.__listening.length === 0;\n this.__listening.push(controller);\n if (init) {\n updateDisplays(this.__listening);\n }\n },\n\n updateDisplay: function() {\n common.each(this.__controllers, function(controller) {\n controller.updateDisplay();\n });\n common.each(this.__folders, function(folder) {\n folder.updateDisplay();\n });\n }\n }\n);\n\n/**\n * Add a row to the end of the GUI or before another row.\n *\n * @param gui\n * @param [newDom] If specified, inserts the dom content in the new row\n * @param [liBefore] If specified, places the new row before another row\n *\n * @ignore\n */\nfunction addRow(gui, newDom, liBefore) {\n const li = document.createElement('li');\n if (newDom) {\n li.appendChild(newDom);\n }\n\n if (liBefore) {\n gui.__ul.insertBefore(li, liBefore);\n } else {\n gui.__ul.appendChild(li);\n }\n gui.onResize();\n return li;\n}\n\nfunction removeListeners(gui) {\n dom.unbind(window, 'resize', gui.__resizeHandler);\n\n if (gui.saveToLocalStorageIfPossible) {\n dom.unbind(window, 'unload', gui.saveToLocalStorageIfPossible);\n }\n}\n\nfunction markPresetModified(gui, modified) {\n const opt = gui.__preset_select[gui.__preset_select.selectedIndex];\n\n if (modified) {\n opt.innerHTML = opt.value + '*';\n } else {\n opt.innerHTML = opt.value;\n }\n}\n\nfunction augmentController(gui, li, controller) {\n controller.__li = li;\n controller.__gui = gui;\n\n common.extend(controller, /** @lends Controller.prototype */ {\n /**\n * @param {Array|Object} options\n * @return {Controller}\n */\n options: function(options) {\n if (arguments.length > 1) {\n const nextSibling = controller.__li.nextElementSibling;\n controller.remove();\n\n return add(\n gui,\n controller.object,\n controller.property,\n {\n before: nextSibling,\n factoryArgs: [common.toArray(arguments)]\n }\n );\n }\n\n if (common.isArray(options) || common.isObject(options)) {\n const nextSibling = controller.__li.nextElementSibling;\n controller.remove();\n\n return add(\n gui,\n controller.object,\n controller.property,\n {\n before: nextSibling,\n factoryArgs: [options]\n }\n );\n }\n },\n\n /**\n * Sets the name of the controller.\n * @param {string} name\n * @return {Controller}\n */\n name: function(name) {\n controller.__li.firstElementChild.firstElementChild.innerHTML = name;\n return controller;\n },\n\n /**\n * Sets controller to listen for changes on its underlying object.\n * @return {Controller}\n */\n listen: function() {\n controller.__gui.listen(controller);\n return controller;\n },\n\n /**\n * Removes the controller from its parent GUI.\n * @return {Controller}\n */\n remove: function() {\n controller.__gui.remove(controller);\n return controller;\n }\n });\n\n // All sliders should be accompanied by a box.\n if (controller instanceof NumberControllerSlider) {\n const box = new NumberControllerBox(\n controller.object,\n controller.property,\n { min: controller.__min, max: controller.__max, step: controller.__step }\n );\n\n common.each(['updateDisplay', 'onChange', 'onFinishChange', 'step', 'min', 'max'], function(method) {\n const pc = controller[method];\n const pb = box[method];\n controller[method] = box[method] = function() {\n const args = Array.prototype.slice.call(arguments);\n pb.apply(box, args);\n return pc.apply(controller, args);\n };\n });\n\n dom.addClass(li, 'has-slider');\n controller.domElement.insertBefore(box.domElement, controller.domElement.firstElementChild);\n } else if (controller instanceof NumberControllerBox) {\n const r = function(returned) {\n // Have we defined both boundaries?\n if (common.isNumber(controller.__min) && common.isNumber(controller.__max)) {\n // Well, then lets just replace this with a slider.\n\n // lets remember if the old controller had a specific name or was listening\n const oldName = controller.__li.firstElementChild.firstElementChild.innerHTML;\n const wasListening = controller.__gui.__listening.indexOf(controller) > -1;\n\n controller.remove();\n const newController = add(\n gui,\n controller.object,\n controller.property,\n {\n before: controller.__li.nextElementSibling,\n factoryArgs: [controller.__min, controller.__max, controller.__step]\n }\n );\n\n newController.name(oldName);\n if (wasListening) newController.listen();\n\n return newController;\n }\n\n return returned;\n };\n\n controller.min = common.compose(r, controller.min);\n controller.max = common.compose(r, controller.max);\n } else if (controller instanceof BooleanController) {\n dom.bind(li, 'click', function() {\n dom.fakeEvent(controller.__checkbox, 'click');\n });\n\n dom.bind(controller.__checkbox, 'click', function(e) {\n e.stopPropagation(); // Prevents double-toggle\n });\n } else if (controller instanceof FunctionController) {\n dom.bind(li, 'click', function() {\n dom.fakeEvent(controller.__button, 'click');\n });\n\n dom.bind(li, 'mouseover', function() {\n dom.addClass(controller.__button, 'hover');\n });\n\n dom.bind(li, 'mouseout', function() {\n dom.removeClass(controller.__button, 'hover');\n });\n } else if (controller instanceof ColorController) {\n dom.addClass(li, 'color');\n controller.updateDisplay = common.compose(function(val) {\n li.style.borderLeftColor = controller.__color.toString();\n return val;\n }, controller.updateDisplay);\n\n controller.updateDisplay();\n }\n\n controller.setValue = common.compose(function(val) {\n if (gui.getRoot().__preset_select && controller.isModified()) {\n markPresetModified(gui.getRoot(), true);\n }\n\n return val;\n }, controller.setValue);\n}\n\nfunction recallSavedValue(gui, controller) {\n // Find the topmost GUI, that's where remembered objects live.\n const root = gui.getRoot();\n\n // Does the object we're controlling match anything we've been told to\n // remember?\n const matchedIndex = root.__rememberedObjects.indexOf(controller.object);\n\n // Why yes, it does!\n if (matchedIndex !== -1) {\n // Let me fetch a map of controllers for thcommon.isObject.\n let controllerMap = root.__rememberedObjectIndecesToControllers[matchedIndex];\n\n // Ohp, I believe this is the first controller we've created for this\n // object. Lets make the map fresh.\n if (controllerMap === undefined) {\n controllerMap = {};\n root.__rememberedObjectIndecesToControllers[matchedIndex] =\n controllerMap;\n }\n\n // Keep track of this controller\n controllerMap[controller.property] = controller;\n\n // Okay, now have we saved any values for this controller?\n if (root.load && root.load.remembered) {\n const presetMap = root.load.remembered;\n\n // Which preset are we trying to load?\n let preset;\n\n if (presetMap[gui.preset]) {\n preset = presetMap[gui.preset];\n } else if (presetMap[DEFAULT_DEFAULT_PRESET_NAME]) {\n // Uhh, you can have the default instead?\n preset = presetMap[DEFAULT_DEFAULT_PRESET_NAME];\n } else {\n // Nada.\n return;\n }\n\n // Did the loaded object remember thcommon.isObject? && Did we remember this particular property?\n if (preset[matchedIndex] && preset[matchedIndex][controller.property] !== undefined) {\n // We did remember something for this guy ...\n const value = preset[matchedIndex][controller.property];\n\n // And that's what it is.\n controller.initialValue = value;\n controller.setValue(value);\n }\n }\n }\n}\n\nfunction add(gui, object, property, params) {\n if (object[property] === undefined) {\n throw new Error(`Object \"${object}\" has no property \"${property}\"`);\n }\n\n let controller;\n\n if (params.color) {\n controller = new ColorController(object, property);\n } else {\n const factoryArgs = [object, property].concat(params.factoryArgs);\n controller = ControllerFactory.apply(gui, factoryArgs);\n }\n\n if (params.before instanceof Controller) {\n params.before = params.before.__li;\n }\n\n recallSavedValue(gui, controller);\n\n dom.addClass(controller.domElement, 'c');\n\n const name = document.createElement('span');\n dom.addClass(name, 'property-name');\n name.innerHTML = controller.property;\n\n const container = document.createElement('div');\n container.appendChild(name);\n container.appendChild(controller.domElement);\n\n const li = addRow(gui, container, params.before);\n\n dom.addClass(li, GUI.CLASS_CONTROLLER_ROW);\n if (controller instanceof ColorController) {\n dom.addClass(li, 'color');\n } else {\n dom.addClass(li, typeof controller.getValue());\n }\n\n augmentController(gui, li, controller);\n\n gui.__controllers.push(controller);\n\n return controller;\n}\n\nfunction getLocalStorageHash(gui, key) {\n // TODO how does this deal with multiple GUI's?\n return document.location.href + '.' + key;\n}\n\nfunction addPresetOption(gui, name, setSelected) {\n const opt = document.createElement('option');\n opt.innerHTML = name;\n opt.value = name;\n gui.__preset_select.appendChild(opt);\n if (setSelected) {\n gui.__preset_select.selectedIndex = gui.__preset_select.length - 1;\n }\n}\n\nfunction showHideExplain(gui, explain) {\n explain.style.display = gui.useLocalStorage ? 'block' : 'none';\n}\n\nfunction addSaveMenu(gui) {\n const div = gui.__save_row = document.createElement('li');\n\n dom.addClass(gui.domElement, 'has-save');\n\n gui.__ul.insertBefore(div, gui.__ul.firstChild);\n\n dom.addClass(div, 'save-row');\n\n const gears = document.createElement('span');\n gears.innerHTML = '&nbsp;';\n dom.addClass(gears, 'button gears');\n\n // TODO replace with FunctionController\n const button = document.createElement('span');\n button.innerHTML = 'Save';\n dom.addClass(button, 'button');\n dom.addClass(button, 'save');\n\n const button2 = document.createElement('span');\n button2.innerHTML = 'New';\n dom.addClass(button2, 'button');\n dom.addClass(button2, 'save-as');\n\n const button3 = document.createElement('span');\n button3.innerHTML = 'Revert';\n dom.addClass(button3, 'button');\n dom.addClass(button3, 'revert');\n\n const select = gui.__preset_select = document.createElement('select');\n\n if (gui.load && gui.load.remembered) {\n common.each(gui.load.remembered, function(value, key) {\n addPresetOption(gui, key, key === gui.preset);\n });\n } else {\n addPresetOption(gui, DEFAULT_DEFAULT_PRESET_NAME, false);\n }\n\n dom.bind(select, 'change', function() {\n for (let index = 0; index < gui.__preset_select.length; index++) {\n gui.__preset_select[index].innerHTML = gui.__preset_select[index].value;\n }\n\n gui.preset = this.value;\n });\n\n div.appendChild(select);\n div.appendChild(gears);\n div.appendChild(button);\n div.appendChild(button2);\n div.appendChild(button3);\n\n if (SUPPORTS_LOCAL_STORAGE) {\n const explain = document.getElementById('dg-local-explain');\n const localStorageCheckBox = document.getElementById('dg-local-storage');\n const saveLocally = document.getElementById('dg-save-locally');\n\n saveLocally.style.display = 'block';\n\n if (localStorage.getItem(getLocalStorageHash(gui, 'isLocal')) === 'true') {\n localStorageCheckBox.setAttribute('checked', 'checked');\n }\n\n showHideExplain(gui, explain);\n\n // TODO: Use a boolean controller, fool!\n dom.bind(localStorageCheckBox, 'change', function() {\n gui.useLocalStorage = !gui.useLocalStorage;\n showHideExplain(gui, explain);\n });\n }\n\n const newConstructorTextArea = document.getElementById('dg-new-constructor');\n\n dom.bind(newConstructorTextArea, 'keydown', function(e) {\n if (e.metaKey && (e.which === 67 || e.keyCode === 67)) {\n SAVE_DIALOGUE.hide();\n }\n });\n\n dom.bind(gears, 'click', function() {\n newConstructorTextArea.innerHTML = JSON.stringify(gui.getSaveObject(), undefined, 2);\n SAVE_DIALOGUE.show();\n newConstructorTextArea.focus();\n newConstructorTextArea.select();\n });\n\n dom.bind(button, 'click', function() {\n gui.save();\n });\n\n dom.bind(button2, 'click', function() {\n const presetName = prompt('Enter a new preset name.');\n if (presetName) {\n gui.saveAs(presetName);\n }\n });\n\n dom.bind(button3, 'click', function() {\n gui.revert();\n });\n\n // div.appendChild(button2);\n}\n\nfunction addResizeHandle(gui) {\n let pmouseX;\n\n gui.__resize_handle = document.createElement('div');\n\n common.extend(gui.__resize_handle.style, {\n\n width: '6px',\n marginLeft: '-3px',\n height: '200px',\n cursor: 'ew-resize',\n position: 'absolute'\n // border: '1px solid blue'\n\n });\n\n function drag(e) {\n e.preventDefault();\n\n gui.width += pmouseX - e.clientX;\n gui.onResize();\n pmouseX = e.clientX;\n\n return false;\n }\n\n function dragStop() {\n dom.removeClass(gui.__closeButton, GUI.CLASS_DRAG);\n dom.unbind(window, 'mousemove', drag);\n dom.unbind(window, 'mouseup', dragStop);\n }\n\n function dragStart(e) {\n e.preventDefault();\n\n pmouseX = e.clientX;\n\n dom.addClass(gui.__closeButton, GUI.CLASS_DRAG);\n dom.bind(window, 'mousemove', drag);\n dom.bind(window, 'mouseup', dragStop);\n\n return false;\n }\n\n dom.bind(gui.__resize_handle, 'mousedown', dragStart);\n dom.bind(gui.__closeButton, 'mousedown', dragStart);\n\n gui.domElement.insertBefore(gui.__resize_handle, gui.domElement.firstElementChild);\n}\n\nfunction setWidth(gui, w) {\n gui.domElement.style.width = w + 'px';\n // Auto placed save-rows are position fixed, so we have to\n // set the width manually if we want it to bleed to the edge\n if (gui.__save_row && gui.autoPlace) {\n gui.__save_row.style.width = w + 'px';\n }\n if (gui.__closeButton) {\n gui.__closeButton.style.width = w + 'px';\n }\n}\n\nfunction getCurrentPreset(gui, useInitialValues) {\n const toReturn = {};\n\n // For each object I'm remembering\n common.each(gui.__rememberedObjects, function(val, index) {\n const savedValues = {};\n\n // The controllers I've made for thcommon.isObject by property\n const controllerMap =\n gui.__rememberedObjectIndecesToControllers[index];\n\n // Remember each value for each property\n common.each(controllerMap, function(controller, property) {\n savedValues[property] = useInitialValues ? controller.initialValue : controller.getValue();\n });\n\n // Save the values for thcommon.isObject\n toReturn[index] = savedValues;\n });\n\n return toReturn;\n}\n\nfunction setPresetSelectIndex(gui) {\n for (let index = 0; index < gui.__preset_select.length; index++) {\n if (gui.__preset_select[index].value === gui.preset) {\n gui.__preset_select.selectedIndex = index;\n }\n }\n}\n\nfunction updateDisplays(controllerArray) {\n if (controllerArray.length !== 0) {\n requestAnimationFrame.call(window, function() {\n updateDisplays(controllerArray);\n });\n }\n\n common.each(controllerArray, function(c) {\n c.updateDisplay();\n });\n}\n\nexport default GUI;\n","/**\n * dat-gui JavaScript Controller Library\n * https://github.com/dataarts/dat.gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\nimport Color from './color/Color';\nimport math from './color/math';\nimport interpret from './color/interpret';\n\nimport Controller from './controllers/Controller';\nimport BooleanController from './controllers/BooleanController';\nimport OptionController from './controllers/OptionController';\nimport StringController from './controllers/StringController';\nimport NumberController from './controllers/NumberController';\nimport NumberControllerBox from './controllers/NumberControllerBox';\nimport NumberControllerSlider from './controllers/NumberControllerSlider';\nimport FunctionController from './controllers/FunctionController';\nimport ColorController from './controllers/ColorController';\n\nimport domImport from './dom/dom';\nimport GUIImport from './gui/GUI';\n\nexport const color = {\n Color: Color,\n math: math,\n interpret: interpret\n};\n\nexport const controllers = {\n Controller: Controller,\n BooleanController: BooleanController,\n OptionController: OptionController,\n StringController: StringController,\n NumberController: NumberController,\n NumberControllerBox: NumberControllerBox,\n NumberControllerSlider: NumberControllerSlider,\n FunctionController: FunctionController,\n ColorController: ColorController\n};\n\nexport const dom = { dom: domImport };\n\nexport const gui = { GUI: GUIImport };\n\nexport const GUI = GUIImport;\n\nexport default {\n color,\n controllers,\n dom,\n gui,\n GUI\n};\n"],"names":["color","forceCSSHex","colorFormat","__state","conversionName","toString","r","Math","round","g","b","a","h","s","toFixed","v","str","hex","length","ARR_EACH","Array","prototype","forEach","ARR_SLICE","slice","Common","BREAK","extend","target","each","call","arguments","obj","keys","isObject","Object","key","isUndefined","bind","defaults","compose","toCall","args","i","apply","itr","scope","l","defer","fnc","setTimeout","debounce","func","threshold","callImmediately","timeout","delayed","callNow","clearTimeout","toArray","undefined","isNull","isNaN","isArray","constructor","isNumber","isString","isBoolean","isFunction","Function","INTERPRETATIONS","litmus","common","conversions","THREE_CHAR_HEX","read","original","test","match","space","parseInt","write","SIX_CHAR_HEX","CSS_RGB","parseFloat","CSS_RGBA","HEX","RGB_ARRAY","RGBA_ARRAY","RGBA_OBJ","RGB_OBJ","HSVA_OBJ","HSV_OBJ","result","toReturn","interpret","family","conversion","tmpComponent","ColorMath","hsv_to_rgb","hi","floor","f","p","q","t","c","rgb_to_hsv","min","max","delta","NaN","rgb_to_hex","hex_with_component","component_from_hex","componentIndex","value","Color","babelHelpers.classCallCheck","Error","colorToString","defineRGBComponent","component","componentHexIndex","defineProperty","get","recalculateRGB","set","defineHSVComponent","recalculateHSV","math","COMPONENTS","Controller","object","property","initialValue","domElement","document","createElement","__onChange","__onFinishChange","newValue","updateDisplay","getValue","EVENT_MAP","HTMLEvents","MouseEvents","KeyboardEvents","EVENT_MAP_INV","k","e","CSS_VALUE_PIXELS","cssValueToPixels","val","dom","makeSelectable","elem","selectable","style","onselectstart","MozUserSelect","KhtmlUserSelect","unselectable","makeFullscreen","hor","vert","vertical","horizontal","position","left","right","top","bottom","fakeEvent","eventType","pars","aux","params","className","evt","createEvent","clientX","x","clientY","y","initMouseEvent","bubbles","cancelable","window","clickCount","init","initKeyboardEvent","initKeyEvent","ctrlKey","altKey","shiftKey","metaKey","keyCode","charCode","initEvent","dispatchEvent","event","newBool","bool","addEventListener","attachEvent","unbind","removeEventListener","detachEvent","addClass","classes","split","indexOf","push","join","replace","removeClass","removeAttribute","index","splice","hasClass","RegExp","getWidth","getComputedStyle","width","getHeight","height","getOffset","el","offset","offsetParent","offsetLeft","offsetTop","isActive","activeElement","type","href","BooleanController","_this","__prev","__checkbox","setAttribute","onChange","setValue","appendChild","checked","babelHelpers.get","OptionController","opts","options","__select","map","element","opt","innerHTML","desiredValue","selectedIndex","StringController","__input","onBlur","blur","numDecimals","_x","NumberController","_params","__min","__max","__step","step","__impliedStep","log","abs","LN10","__precision","_v","minValue","maxValue","stepValue","roundToDecimal","decimals","tenTo","NumberControllerBox","babelHelpers.possibleConstructorReturn","__truncationSuspended","prevY","attempted","onFinish","onMouseDrag","diff","onMouseUp","onMouseDown","i1","i2","o1","o2","NumberControllerSlider","__background","__foreground","onTouchStart","preventDefault","bgRect","getBoundingClientRect","touches","onTouchMove","onTouchEnd","pct","FunctionController","text","__button","fire","ColorController","__color","__temp","__selector","__saturation_field","__field_knob","__field_knob_border","__hue_knob","__hue_field","__input_textShadow","valueField","padding","backgroundColor","boxShadow","border","borderRadius","zIndex","borderRight","marginRight","display","cursor","background","linearGradient","hueGradient","outline","textAlign","fontWeight","textShadow","fieldDown","fieldDownH","setSV","fieldUpSV","setH","fieldUpH","toOriginal","fieldRect","mismatch","flip","_flip","marginLeft","marginTop","toHexString","vendors","vendor","cssText","css","load","url","indoc","doc","link","rel","getElementsByTagName","inject","cssContent","injected","head","saveDialogContents","ControllerFactory","requestAnimationFrame","callback","webkitRequestAnimationFrame","mozRequestAnimationFrame","oRequestAnimationFrame","msRequestAnimationFrame","CenteredDiv","backgroundElement","opacity","WebkitTransition","transition","body","hide","webkitTransform","layout","innerWidth","innerHeight","styleSheet","CSS_NAMESPACE","HIDE_KEY_CODE","CLOSE_BUTTON_HEIGHT","DEFAULT_DEFAULT_PRESET_NAME","SUPPORTS_LOCAL_STORAGE","localStorage","SAVE_DIALOGUE","autoPlaceVirgin","autoPlaceContainer","hideableGuis","GUI","__ul","__folders","__controllers","__rememberedObjects","__rememberedObjectIndecesToControllers","__listening","closeOnTop","autoPlace","DEFAULT_WIDTH","resizable","hideable","preset","parent","scrollable","useLocalStorage","getItem","getLocalStorageHash","saveToLocalStorage","titleRow","defineProperties","getRoot","setPresetSelectIndex","revert","setWidth","name","closed","CLASS_CLOSED","onResize","__closeButton","TEXT_OPEN","TEXT_CLOSED","setItem","CLASS_MAIN","savedGui","JSON","parse","CLASS_CLOSE_BUTTON","CLASS_CLOSE_TOP","insertBefore","childNodes","CLASS_CLOSE_BOTTOM","titleRowName","createTextNode","addRow","onClickTitle","CLASS_AUTO_PLACE_CONTAINER","CLASS_AUTO_PLACE","__resizeHandler","onResizeDebounced","addResizeHandle","stringify","getSaveObject","saveToLocalStorageIfPossible","resetWidth","root","toggleHide","gui","CLASS_CONTROLLER_ROW","CLASS_TOO_TALL","CLASS_DRAG","_keydownHandler","which","add","factoryArgs","addColor","remove","controller","removeChild","__li","destroy","subfolder","removeFolder","removeListeners","addFolder","newGuiParams","folders","li","folder","parentElement","open","close","show","node","__save_row","__resize_handle","offsetHeight","remember","saveDialogueContents","addSaveMenu","remembered","getCurrentPreset","save","markPresetModified","saveAs","presetName","addPresetOption","recallSavedValue","listen","updateDisplays","newDom","liBefore","modified","__preset_select","augmentController","__gui","nextSibling","nextElementSibling","before","firstElementChild","box","method","pc","pb","returned","oldName","wasListening","newController","stopPropagation","borderLeftColor","isModified","matchedIndex","controllerMap","presetMap","concat","container","location","setSelected","showHideExplain","explain","div","firstChild","gears","button","button2","button3","select","getElementById","localStorageCheckBox","saveLocally","newConstructorTextArea","focus","prompt","pmouseX","drag","dragStop","dragStart","w","useInitialValues","savedValues","controllerArray","controllers","domImport","GUIImport"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAae,sBAASA,EAAAA,KAAT,EAAgBC,WAAhB,EAA6B;AAC1C,EAAA,IAAMC,cAAcF,KAAMG,CAAAA,OAAN,CAAcC,cAAd,CAA6BC,QAA7B,EAApB,CAAA;AAEA,EAAA,IAAMC,IAAIC,IAAKC,CAAAA,KAAL,CAAWR,KAAAA,CAAMM,CAAjB,CAAV,CAAA;AACA,EAAA,IAAMG,IAAIF,IAAKC,CAAAA,KAAL,CAAWR,KAAAA,CAAMS,CAAjB,CAAV,CAAA;AACA,EAAA,IAAMC,IAAIH,IAAKC,CAAAA,KAAL,CAAWR,KAAAA,CAAMU,CAAjB,CAAV,CAAA;AACA,EAAMC,IAAAA,CAAAA,GAAIX,MAAMW,CAAhB,CAAA;AACA,EAAA,IAAMC,IAAIL,IAAKC,CAAAA,KAAL,CAAWR,KAAAA,CAAMY,CAAjB,CAAV,CAAA;AACA,EAAA,IAAMC,IAAIb,KAAMa,CAAAA,CAAN,CAAQC,OAAR,CAAgB,CAAhB,CAAV,CAAA;AACA,EAAA,IAAMC,IAAIf,KAAMe,CAAAA,CAAN,CAAQD,OAAR,CAAgB,CAAhB,CAAV,CAAA;AAEA,EAAA,IAAIb,eAAgBC,WAAgB,KAAA,gBAAhC,IAAsDA,WAAAA,KAAgB,cAA1E,EAA2F;AACzF,IAAA,IAAIc,MAAMhB,KAAMiB,CAAAA,GAAN,CAA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