diff --git a/README.md b/README.md index a804d29..24d3774 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,8 @@ var colorPicker = new iro.ColorPicker("#color-picker-container", { | `handleSvg` | Custom handle SVG, used for [Custom Handles](https://iro.js.org/guide.html#custom-handles) | `null` | | `handleOrigin` | Custom handle origin point, used for [Custom Handles](https://iro.js.org/guide.html#custom-handles). | `{x:0,y:0}` | | `wheelLightness` | If set to `false`, the color wheel will not fade to black when the lightness decreases. | `true` | +| `wheelAngle` | Starting angle of the color wheel's hue gradient, measured in degrees. | `0` | +| `wheelDirection` | Direction of the color wheel's hue gradient, either `"clockwise"` or `"anticlockwise"` | `"anticlockwise"` | | `sliderHeight` | Slider control height. By default this will be calculated automatically | `undefined` | | `sliderMargin` | Distance between the wheel and the slider controls. | `12` | | `display` | CSS display value for the color picker root element. | `"block"` | diff --git a/dist/iro.es.js b/dist/iro.es.js index 977e41e..3ff17ae 100644 --- a/dist/iro.es.js +++ b/dist/iro.es.js @@ -1,5 +1,5 @@ /*! - * iro.js v4.3.3 + * iro.js v4.4.0 * 2016-2019 James Daniel * Licensed under MPL 2.0 * github.com/jaames/iro.js @@ -776,7 +776,7 @@ var IroComponent = /*@__PURE__*/(function (Component$$1) { }; // More info on handleEvent: - // http://download-cdn.miitomo.com/native/20180125111639/manifests/v2_20180405_3_android/manifest.json + // https://medium.com/@WebReflection/dom-handleevent-a-cross-platform-standard-since-year-2000-5bf17287fd38 // TL;DR this lets us have a single point of entry for multiple events, and we can avoid callback/binding hell IroComponent.prototype.handleEvent = function handleEvent (e) { e.preventDefault(); @@ -880,6 +880,8 @@ IroHandle.defaultProps = { origin: {x: 0, y: 0} }; +var HUE_STEPS = Array.apply(null, {length: 360}).map(function (_, index) { return index; }); + var IroWheel = /*@__PURE__*/(function (IroComponent$$1) { function IroWheel () { IroComponent$$1.apply(this, arguments); @@ -889,13 +891,28 @@ var IroWheel = /*@__PURE__*/(function (IroComponent$$1) { IroWheel.prototype = Object.create( IroComponent$$1 && IroComponent$$1.prototype ); IroWheel.prototype.constructor = IroWheel; + IroWheel.prototype._transformAngle = function _transformAngle (angle, handleFix) { + var wheelAngle = this.props.wheelAngle; + if (this.props.wheelDirection === 'clockwise') { + // im sure this math could be simplified... + angle = (-360 + angle - (handleFix ? -wheelAngle : wheelAngle)); + } else { + angle = wheelAngle - angle; + } + // javascript's modulo operator doesn't produce positive numbers with negative input + // https://dev.to/maurobringolf/a-neat-trick-to-compute-modulo-of-negative-numbers-111e + return (angle % 360 + 360) % 360; + }; + IroWheel.prototype.render = function render$$1 (props) { + var this$1 = this; + var width = props.width; var borderWidth = props.borderWidth; var handleRadius = props.handleRadius; var hsv = props.color.hsv; var radius = (width / 2) - borderWidth; - var handleAngle = (360 - hsv.h) * (Math.PI / 180); + var handleAngle = this._transformAngle(hsv.h, true) * (Math.PI / 180); var handleDist = (hsv.s / 100) * (radius - props.padding - handleRadius - borderWidth); var cX = radius + borderWidth; var cY = radius + borderWidth; @@ -913,9 +930,9 @@ var IroWheel = /*@__PURE__*/(function (IroComponent$$1) { ) ), h( 'g', { class: "iro__wheel__hue", 'stroke-width': radius, fill: "none" }, - Array.apply(null, { length: 360 }).map(function (_, hue) { return ( + HUE_STEPS.map(function (angle) { return ( h( 'path', { - key: hue, d: createArcPath(cX, cY, radius / 2, hue, hue + 1.5), stroke: ("hsl(" + (360 - hue) + ", 100%, 50%)") }) + key: angle, d: createArcPath(cX, cY, radius / 2, angle, angle + 1.5), stroke: ("hsl(" + (this$1._transformAngle(angle)) + ", 100%, 50%)") }) ); }) ), h( 'circle', { @@ -954,7 +971,7 @@ var IroWheel = /*@__PURE__*/(function (IroComponent$$1) { var handleAngle = Math.atan2(y, x); // Calculate the hue by converting the angle to radians - var hue = 360 - (Math.round(handleAngle * (180 / Math.PI)) + 180); + var hue = this._transformAngle(Math.round(handleAngle * (180 / Math.PI)) + 180); // Find the point's distance from the center of the wheel // This is used to show the saturation level var handleDist = Math.min(Math.sqrt(x * x + y * y), handleRange); @@ -1763,6 +1780,8 @@ ColorPicker.defaultProps = { borderWidth: 0, display: 'block', wheelLightness: true, + wheelAngle: 0, + wheelDirection: 'anticlockwise', sliderHeight: null, sliderMargin: 12, padding: 6, @@ -1818,7 +1837,7 @@ var iro = usePlugins({ parseHexInt: parseHexInt, intToHex: intToHex }, - version: "4.3.3", + version: "4.4.0", }); export default iro; diff --git a/dist/iro.es.js.map b/dist/iro.es.js.map index 2ae58ad..8b1e8e3 100644 --- a/dist/iro.es.js.map +++ b/dist/iro.es.js.map @@ -1 +1 @@ -{"version":3,"file":"iro.es.map","sources":["../node_modules/preact/dist/preact.mjs","../src/util/dom.js","../src/ui/component.js","../src/util/svg.js","../src/ui/handle.jsx","../src/ui/wheel.jsx","../src/util/colorUtils.js","../src/color.js","../src/ui/slider.jsx","../src/util/createWidget.js","../src/colorPicker.js","../src/util/usePlugins.js","../src/iro.js"],"sourcesContent":["var VNode = function VNode() {};\n\nvar options = {};\n\nvar stack = [];\n\nvar EMPTY_CHILDREN = [];\n\nfunction h(nodeName, attributes) {\n\tvar children = EMPTY_CHILDREN,\n\t lastSimple,\n\t child,\n\t simple,\n\t i;\n\tfor (i = arguments.length; i-- > 2;) {\n\t\tstack.push(arguments[i]);\n\t}\n\tif (attributes && attributes.children != null) {\n\t\tif (!stack.length) stack.push(attributes.children);\n\t\tdelete attributes.children;\n\t}\n\twhile (stack.length) {\n\t\tif ((child = stack.pop()) && child.pop !== undefined) {\n\t\t\tfor (i = child.length; i--;) {\n\t\t\t\tstack.push(child[i]);\n\t\t\t}\n\t\t} else {\n\t\t\tif (typeof child === 'boolean') child = null;\n\n\t\t\tif (simple = typeof nodeName !== 'function') {\n\t\t\t\tif (child == null) child = '';else if (typeof child === 'number') child = String(child);else if (typeof child !== 'string') simple = false;\n\t\t\t}\n\n\t\t\tif (simple && lastSimple) {\n\t\t\t\tchildren[children.length - 1] += child;\n\t\t\t} else if (children === EMPTY_CHILDREN) {\n\t\t\t\tchildren = [child];\n\t\t\t} else {\n\t\t\t\tchildren.push(child);\n\t\t\t}\n\n\t\t\tlastSimple = simple;\n\t\t}\n\t}\n\n\tvar p = new VNode();\n\tp.nodeName = nodeName;\n\tp.children = children;\n\tp.attributes = attributes == null ? undefined : attributes;\n\tp.key = attributes == null ? undefined : attributes.key;\n\n\tif (options.vnode !== undefined) options.vnode(p);\n\n\treturn p;\n}\n\nfunction extend(obj, props) {\n for (var i in props) {\n obj[i] = props[i];\n }return obj;\n}\n\nfunction applyRef(ref, value) {\n if (ref != null) {\n if (typeof ref == 'function') ref(value);else ref.current = value;\n }\n}\n\nvar defer = typeof Promise == 'function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;\n\nfunction cloneElement(vnode, props) {\n return h(vnode.nodeName, extend(extend({}, vnode.attributes), props), arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children);\n}\n\nvar IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\n\nvar items = [];\n\nfunction enqueueRender(component) {\n\tif (!component._dirty && (component._dirty = true) && items.push(component) == 1) {\n\t\t(options.debounceRendering || defer)(rerender);\n\t}\n}\n\nfunction rerender() {\n\tvar p;\n\twhile (p = items.pop()) {\n\t\tif (p._dirty) renderComponent(p);\n\t}\n}\n\nfunction isSameNodeType(node, vnode, hydrating) {\n\tif (typeof vnode === 'string' || typeof vnode === 'number') {\n\t\treturn node.splitText !== undefined;\n\t}\n\tif (typeof vnode.nodeName === 'string') {\n\t\treturn !node._componentConstructor && isNamedNode(node, vnode.nodeName);\n\t}\n\treturn hydrating || node._componentConstructor === vnode.nodeName;\n}\n\nfunction isNamedNode(node, nodeName) {\n\treturn node.normalizedNodeName === nodeName || node.nodeName.toLowerCase() === nodeName.toLowerCase();\n}\n\nfunction getNodeProps(vnode) {\n\tvar props = extend({}, vnode.attributes);\n\tprops.children = vnode.children;\n\n\tvar defaultProps = vnode.nodeName.defaultProps;\n\tif (defaultProps !== undefined) {\n\t\tfor (var i in defaultProps) {\n\t\t\tif (props[i] === undefined) {\n\t\t\t\tprops[i] = defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn props;\n}\n\nfunction createNode(nodeName, isSvg) {\n\tvar node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName);\n\tnode.normalizedNodeName = nodeName;\n\treturn node;\n}\n\nfunction removeNode(node) {\n\tvar parentNode = node.parentNode;\n\tif (parentNode) parentNode.removeChild(node);\n}\n\nfunction setAccessor(node, name, old, value, isSvg) {\n\tif (name === 'className') name = 'class';\n\n\tif (name === 'key') {} else if (name === 'ref') {\n\t\tapplyRef(old, null);\n\t\tapplyRef(value, node);\n\t} else if (name === 'class' && !isSvg) {\n\t\tnode.className = value || '';\n\t} else if (name === 'style') {\n\t\tif (!value || typeof value === 'string' || typeof old === 'string') {\n\t\t\tnode.style.cssText = value || '';\n\t\t}\n\t\tif (value && typeof value === 'object') {\n\t\t\tif (typeof old !== 'string') {\n\t\t\t\tfor (var i in old) {\n\t\t\t\t\tif (!(i in value)) node.style[i] = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var i in value) {\n\t\t\t\tnode.style[i] = typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false ? value[i] + 'px' : value[i];\n\t\t\t}\n\t\t}\n\t} else if (name === 'dangerouslySetInnerHTML') {\n\t\tif (value) node.innerHTML = value.__html || '';\n\t} else if (name[0] == 'o' && name[1] == 'n') {\n\t\tvar useCapture = name !== (name = name.replace(/Capture$/, ''));\n\t\tname = name.toLowerCase().substring(2);\n\t\tif (value) {\n\t\t\tif (!old) node.addEventListener(name, eventProxy, useCapture);\n\t\t} else {\n\t\t\tnode.removeEventListener(name, eventProxy, useCapture);\n\t\t}\n\t\t(node._listeners || (node._listeners = {}))[name] = value;\n\t} else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\n\t\ttry {\n\t\t\tnode[name] = value == null ? '' : value;\n\t\t} catch (e) {}\n\t\tif ((value == null || value === false) && name != 'spellcheck') node.removeAttribute(name);\n\t} else {\n\t\tvar ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''));\n\n\t\tif (value == null || value === false) {\n\t\t\tif (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase());else node.removeAttribute(name);\n\t\t} else if (typeof value !== 'function') {\n\t\t\tif (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value);else node.setAttribute(name, value);\n\t\t}\n\t}\n}\n\nfunction eventProxy(e) {\n\treturn this._listeners[e.type](options.event && options.event(e) || e);\n}\n\nvar mounts = [];\n\nvar diffLevel = 0;\n\nvar isSvgMode = false;\n\nvar hydrating = false;\n\nfunction flushMounts() {\n\tvar c;\n\twhile (c = mounts.shift()) {\n\t\tif (options.afterMount) options.afterMount(c);\n\t\tif (c.componentDidMount) c.componentDidMount();\n\t}\n}\n\nfunction diff(dom, vnode, context, mountAll, parent, componentRoot) {\n\tif (!diffLevel++) {\n\t\tisSvgMode = parent != null && parent.ownerSVGElement !== undefined;\n\n\t\thydrating = dom != null && !('__preactattr_' in dom);\n\t}\n\n\tvar ret = idiff(dom, vnode, context, mountAll, componentRoot);\n\n\tif (parent && ret.parentNode !== parent) parent.appendChild(ret);\n\n\tif (! --diffLevel) {\n\t\thydrating = false;\n\n\t\tif (!componentRoot) flushMounts();\n\t}\n\n\treturn ret;\n}\n\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n\tvar out = dom,\n\t prevSvgMode = isSvgMode;\n\n\tif (vnode == null || typeof vnode === 'boolean') vnode = '';\n\n\tif (typeof vnode === 'string' || typeof vnode === 'number') {\n\t\tif (dom && dom.splitText !== undefined && dom.parentNode && (!dom._component || componentRoot)) {\n\t\t\tif (dom.nodeValue != vnode) {\n\t\t\t\tdom.nodeValue = vnode;\n\t\t\t}\n\t\t} else {\n\t\t\tout = document.createTextNode(vnode);\n\t\t\tif (dom) {\n\t\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\t\t\t\trecollectNodeTree(dom, true);\n\t\t\t}\n\t\t}\n\n\t\tout['__preactattr_'] = true;\n\n\t\treturn out;\n\t}\n\n\tvar vnodeName = vnode.nodeName;\n\tif (typeof vnodeName === 'function') {\n\t\treturn buildComponentFromVNode(dom, vnode, context, mountAll);\n\t}\n\n\tisSvgMode = vnodeName === 'svg' ? true : vnodeName === 'foreignObject' ? false : isSvgMode;\n\n\tvnodeName = String(vnodeName);\n\tif (!dom || !isNamedNode(dom, vnodeName)) {\n\t\tout = createNode(vnodeName, isSvgMode);\n\n\t\tif (dom) {\n\t\t\twhile (dom.firstChild) {\n\t\t\t\tout.appendChild(dom.firstChild);\n\t\t\t}\n\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\n\t\t\trecollectNodeTree(dom, true);\n\t\t}\n\t}\n\n\tvar fc = out.firstChild,\n\t props = out['__preactattr_'],\n\t vchildren = vnode.children;\n\n\tif (props == null) {\n\t\tprops = out['__preactattr_'] = {};\n\t\tfor (var a = out.attributes, i = a.length; i--;) {\n\t\t\tprops[a[i].name] = a[i].value;\n\t\t}\n\t}\n\n\tif (!hydrating && vchildren && vchildren.length === 1 && typeof vchildren[0] === 'string' && fc != null && fc.splitText !== undefined && fc.nextSibling == null) {\n\t\tif (fc.nodeValue != vchildren[0]) {\n\t\t\tfc.nodeValue = vchildren[0];\n\t\t}\n\t} else if (vchildren && vchildren.length || fc != null) {\n\t\t\tinnerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML != null);\n\t\t}\n\n\tdiffAttributes(out, vnode.attributes, props);\n\n\tisSvgMode = prevSvgMode;\n\n\treturn out;\n}\n\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n\tvar originalChildren = dom.childNodes,\n\t children = [],\n\t keyed = {},\n\t keyedLen = 0,\n\t min = 0,\n\t len = originalChildren.length,\n\t childrenLen = 0,\n\t vlen = vchildren ? vchildren.length : 0,\n\t j,\n\t c,\n\t f,\n\t vchild,\n\t child;\n\n\tif (len !== 0) {\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tvar _child = originalChildren[i],\n\t\t\t props = _child['__preactattr_'],\n\t\t\t key = vlen && props ? _child._component ? _child._component.__key : props.key : null;\n\t\t\tif (key != null) {\n\t\t\t\tkeyedLen++;\n\t\t\t\tkeyed[key] = _child;\n\t\t\t} else if (props || (_child.splitText !== undefined ? isHydrating ? _child.nodeValue.trim() : true : isHydrating)) {\n\t\t\t\tchildren[childrenLen++] = _child;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (vlen !== 0) {\n\t\tfor (var i = 0; i < vlen; i++) {\n\t\t\tvchild = vchildren[i];\n\t\t\tchild = null;\n\n\t\t\tvar key = vchild.key;\n\t\t\tif (key != null) {\n\t\t\t\tif (keyedLen && keyed[key] !== undefined) {\n\t\t\t\t\tchild = keyed[key];\n\t\t\t\t\tkeyed[key] = undefined;\n\t\t\t\t\tkeyedLen--;\n\t\t\t\t}\n\t\t\t} else if (min < childrenLen) {\n\t\t\t\t\tfor (j = min; j < childrenLen; j++) {\n\t\t\t\t\t\tif (children[j] !== undefined && isSameNodeType(c = children[j], vchild, isHydrating)) {\n\t\t\t\t\t\t\tchild = c;\n\t\t\t\t\t\t\tchildren[j] = undefined;\n\t\t\t\t\t\t\tif (j === childrenLen - 1) childrenLen--;\n\t\t\t\t\t\t\tif (j === min) min++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\tchild = idiff(child, vchild, context, mountAll);\n\n\t\t\tf = originalChildren[i];\n\t\t\tif (child && child !== dom && child !== f) {\n\t\t\t\tif (f == null) {\n\t\t\t\t\tdom.appendChild(child);\n\t\t\t\t} else if (child === f.nextSibling) {\n\t\t\t\t\tremoveNode(f);\n\t\t\t\t} else {\n\t\t\t\t\tdom.insertBefore(child, f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (keyedLen) {\n\t\tfor (var i in keyed) {\n\t\t\tif (keyed[i] !== undefined) recollectNodeTree(keyed[i], false);\n\t\t}\n\t}\n\n\twhile (min <= childrenLen) {\n\t\tif ((child = children[childrenLen--]) !== undefined) recollectNodeTree(child, false);\n\t}\n}\n\nfunction recollectNodeTree(node, unmountOnly) {\n\tvar component = node._component;\n\tif (component) {\n\t\tunmountComponent(component);\n\t} else {\n\t\tif (node['__preactattr_'] != null) applyRef(node['__preactattr_'].ref, null);\n\n\t\tif (unmountOnly === false || node['__preactattr_'] == null) {\n\t\t\tremoveNode(node);\n\t\t}\n\n\t\tremoveChildren(node);\n\t}\n}\n\nfunction removeChildren(node) {\n\tnode = node.lastChild;\n\twhile (node) {\n\t\tvar next = node.previousSibling;\n\t\trecollectNodeTree(node, true);\n\t\tnode = next;\n\t}\n}\n\nfunction diffAttributes(dom, attrs, old) {\n\tvar name;\n\n\tfor (name in old) {\n\t\tif (!(attrs && attrs[name] != null) && old[name] != null) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = undefined, isSvgMode);\n\t\t}\n\t}\n\n\tfor (name in attrs) {\n\t\tif (name !== 'children' && name !== 'innerHTML' && (!(name in old) || attrs[name] !== (name === 'value' || name === 'checked' ? dom[name] : old[name]))) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode);\n\t\t}\n\t}\n}\n\nvar recyclerComponents = [];\n\nfunction createComponent(Ctor, props, context) {\n\tvar inst,\n\t i = recyclerComponents.length;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\twhile (i--) {\n\t\tif (recyclerComponents[i].constructor === Ctor) {\n\t\t\tinst.nextBase = recyclerComponents[i].nextBase;\n\t\t\trecyclerComponents.splice(i, 1);\n\t\t\treturn inst;\n\t\t}\n\t}\n\n\treturn inst;\n}\n\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n\nfunction setComponentProps(component, props, renderMode, context, mountAll) {\n\tif (component._disable) return;\n\tcomponent._disable = true;\n\n\tcomponent.__ref = props.ref;\n\tcomponent.__key = props.key;\n\tdelete props.ref;\n\tdelete props.key;\n\n\tif (typeof component.constructor.getDerivedStateFromProps === 'undefined') {\n\t\tif (!component.base || mountAll) {\n\t\t\tif (component.componentWillMount) component.componentWillMount();\n\t\t} else if (component.componentWillReceiveProps) {\n\t\t\tcomponent.componentWillReceiveProps(props, context);\n\t\t}\n\t}\n\n\tif (context && context !== component.context) {\n\t\tif (!component.prevContext) component.prevContext = component.context;\n\t\tcomponent.context = context;\n\t}\n\n\tif (!component.prevProps) component.prevProps = component.props;\n\tcomponent.props = props;\n\n\tcomponent._disable = false;\n\n\tif (renderMode !== 0) {\n\t\tif (renderMode === 1 || options.syncComponentUpdates !== false || !component.base) {\n\t\t\trenderComponent(component, 1, mountAll);\n\t\t} else {\n\t\t\tenqueueRender(component);\n\t\t}\n\t}\n\n\tapplyRef(component.__ref, component);\n}\n\nfunction renderComponent(component, renderMode, mountAll, isChild) {\n\tif (component._disable) return;\n\n\tvar props = component.props,\n\t state = component.state,\n\t context = component.context,\n\t previousProps = component.prevProps || props,\n\t previousState = component.prevState || state,\n\t previousContext = component.prevContext || context,\n\t isUpdate = component.base,\n\t nextBase = component.nextBase,\n\t initialBase = isUpdate || nextBase,\n\t initialChildComponent = component._component,\n\t skip = false,\n\t snapshot = previousContext,\n\t rendered,\n\t inst,\n\t cbase;\n\n\tif (component.constructor.getDerivedStateFromProps) {\n\t\tstate = extend(extend({}, state), component.constructor.getDerivedStateFromProps(props, state));\n\t\tcomponent.state = state;\n\t}\n\n\tif (isUpdate) {\n\t\tcomponent.props = previousProps;\n\t\tcomponent.state = previousState;\n\t\tcomponent.context = previousContext;\n\t\tif (renderMode !== 2 && component.shouldComponentUpdate && component.shouldComponentUpdate(props, state, context) === false) {\n\t\t\tskip = true;\n\t\t} else if (component.componentWillUpdate) {\n\t\t\tcomponent.componentWillUpdate(props, state, context);\n\t\t}\n\t\tcomponent.props = props;\n\t\tcomponent.state = state;\n\t\tcomponent.context = context;\n\t}\n\n\tcomponent.prevProps = component.prevState = component.prevContext = component.nextBase = null;\n\tcomponent._dirty = false;\n\n\tif (!skip) {\n\t\trendered = component.render(props, state, context);\n\n\t\tif (component.getChildContext) {\n\t\t\tcontext = extend(extend({}, context), component.getChildContext());\n\t\t}\n\n\t\tif (isUpdate && component.getSnapshotBeforeUpdate) {\n\t\t\tsnapshot = component.getSnapshotBeforeUpdate(previousProps, previousState);\n\t\t}\n\n\t\tvar childComponent = rendered && rendered.nodeName,\n\t\t toUnmount,\n\t\t base;\n\n\t\tif (typeof childComponent === 'function') {\n\n\t\t\tvar childProps = getNodeProps(rendered);\n\t\t\tinst = initialChildComponent;\n\n\t\t\tif (inst && inst.constructor === childComponent && childProps.key == inst.__key) {\n\t\t\t\tsetComponentProps(inst, childProps, 1, context, false);\n\t\t\t} else {\n\t\t\t\ttoUnmount = inst;\n\n\t\t\t\tcomponent._component = inst = createComponent(childComponent, childProps, context);\n\t\t\t\tinst.nextBase = inst.nextBase || nextBase;\n\t\t\t\tinst._parentComponent = component;\n\t\t\t\tsetComponentProps(inst, childProps, 0, context, false);\n\t\t\t\trenderComponent(inst, 1, mountAll, true);\n\t\t\t}\n\n\t\t\tbase = inst.base;\n\t\t} else {\n\t\t\tcbase = initialBase;\n\n\t\t\ttoUnmount = initialChildComponent;\n\t\t\tif (toUnmount) {\n\t\t\t\tcbase = component._component = null;\n\t\t\t}\n\n\t\t\tif (initialBase || renderMode === 1) {\n\t\t\t\tif (cbase) cbase._component = null;\n\t\t\t\tbase = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, true);\n\t\t\t}\n\t\t}\n\n\t\tif (initialBase && base !== initialBase && inst !== initialChildComponent) {\n\t\t\tvar baseParent = initialBase.parentNode;\n\t\t\tif (baseParent && base !== baseParent) {\n\t\t\t\tbaseParent.replaceChild(base, initialBase);\n\n\t\t\t\tif (!toUnmount) {\n\t\t\t\t\tinitialBase._component = null;\n\t\t\t\t\trecollectNodeTree(initialBase, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (toUnmount) {\n\t\t\tunmountComponent(toUnmount);\n\t\t}\n\n\t\tcomponent.base = base;\n\t\tif (base && !isChild) {\n\t\t\tvar componentRef = component,\n\t\t\t t = component;\n\t\t\twhile (t = t._parentComponent) {\n\t\t\t\t(componentRef = t).base = base;\n\t\t\t}\n\t\t\tbase._component = componentRef;\n\t\t\tbase._componentConstructor = componentRef.constructor;\n\t\t}\n\t}\n\n\tif (!isUpdate || mountAll) {\n\t\tmounts.push(component);\n\t} else if (!skip) {\n\n\t\tif (component.componentDidUpdate) {\n\t\t\tcomponent.componentDidUpdate(previousProps, previousState, snapshot);\n\t\t}\n\t\tif (options.afterUpdate) options.afterUpdate(component);\n\t}\n\n\twhile (component._renderCallbacks.length) {\n\t\tcomponent._renderCallbacks.pop().call(component);\n\t}if (!diffLevel && !isChild) flushMounts();\n}\n\nfunction buildComponentFromVNode(dom, vnode, context, mountAll) {\n\tvar c = dom && dom._component,\n\t originalComponent = c,\n\t oldDom = dom,\n\t isDirectOwner = c && dom._componentConstructor === vnode.nodeName,\n\t isOwner = isDirectOwner,\n\t props = getNodeProps(vnode);\n\twhile (c && !isOwner && (c = c._parentComponent)) {\n\t\tisOwner = c.constructor === vnode.nodeName;\n\t}\n\n\tif (c && isOwner && (!mountAll || c._component)) {\n\t\tsetComponentProps(c, props, 3, context, mountAll);\n\t\tdom = c.base;\n\t} else {\n\t\tif (originalComponent && !isDirectOwner) {\n\t\t\tunmountComponent(originalComponent);\n\t\t\tdom = oldDom = null;\n\t\t}\n\n\t\tc = createComponent(vnode.nodeName, props, context);\n\t\tif (dom && !c.nextBase) {\n\t\t\tc.nextBase = dom;\n\n\t\t\toldDom = null;\n\t\t}\n\t\tsetComponentProps(c, props, 1, context, mountAll);\n\t\tdom = c.base;\n\n\t\tif (oldDom && dom !== oldDom) {\n\t\t\toldDom._component = null;\n\t\t\trecollectNodeTree(oldDom, false);\n\t\t}\n\t}\n\n\treturn dom;\n}\n\nfunction unmountComponent(component) {\n\tif (options.beforeUnmount) options.beforeUnmount(component);\n\n\tvar base = component.base;\n\n\tcomponent._disable = true;\n\n\tif (component.componentWillUnmount) component.componentWillUnmount();\n\n\tcomponent.base = null;\n\n\tvar inner = component._component;\n\tif (inner) {\n\t\tunmountComponent(inner);\n\t} else if (base) {\n\t\tif (base['__preactattr_'] != null) applyRef(base['__preactattr_'].ref, null);\n\n\t\tcomponent.nextBase = base;\n\n\t\tremoveNode(base);\n\t\trecyclerComponents.push(component);\n\n\t\tremoveChildren(base);\n\t}\n\n\tapplyRef(component.__ref, null);\n}\n\nfunction Component(props, context) {\n\tthis._dirty = true;\n\n\tthis.context = context;\n\n\tthis.props = props;\n\n\tthis.state = this.state || {};\n\n\tthis._renderCallbacks = [];\n}\n\nextend(Component.prototype, {\n\tsetState: function setState(state, callback) {\n\t\tif (!this.prevState) this.prevState = this.state;\n\t\tthis.state = extend(extend({}, this.state), typeof state === 'function' ? state(this.state, this.props) : state);\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t},\n\tforceUpdate: function forceUpdate(callback) {\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\trenderComponent(this, 2);\n\t},\n\trender: function render() {}\n});\n\nfunction render(vnode, parent, merge) {\n return diff(merge, vnode, {}, false, parent, false);\n}\n\nfunction createRef() {\n\treturn {};\n}\n\nvar preact = {\n\th: h,\n\tcreateElement: h,\n\tcloneElement: cloneElement,\n\tcreateRef: createRef,\n\tComponent: Component,\n\trender: render,\n\trerender: rerender,\n\toptions: options\n};\n\nexport default preact;\nexport { h, h as createElement, cloneElement, createRef, Component, render, rerender, options };\n//# sourceMappingURL=preact.mjs.map\n","/**\n * @desc listen to one or more events on an element\n * @param {Element} el target element\n * @param {Array} eventList the events to listen to\n * @param {Function} callback\n * @param {Object} params params to pass to addEventListener\n */\nexport function listen(el, eventList, callback, params={}) {\n for (var i = 0; i < eventList.length; i++) {\n el.addEventListener(eventList[i], callback, params);\n }\n};\n\n/**\n * @desc remove an event listener on an element\n * @param {Element} el target element\n * @param {Array} eventList the events to remove\n * @param {Function} callback\n * @param {Object} params params to pass to removeEventListener\n */\nexport function unlisten(el, eventList, callback, params={}) {\n for (var i = 0; i < eventList.length; i++) {\n el.removeEventListener(eventList[i], callback, params);\n }\n};\n\n/**\n * @desc call fn callback when the page document has fully loaded\n * @param {Function} callback\n */\nexport function onDocumentReady(callback) {\n if (document.readyState !== 'loading') {\n callback();\n } else {\n listen(document, ['DOMContentLoaded'], callback);\n }\n};","import { Component } from 'preact';\nimport { listen, unlisten } from 'util/dom';\n\nconst EVENT_MOUSEDOWN = 'mousedown';\nconst EVENT_MOUSEMOVE = 'mousemove';\nconst EVENT_MOUSEUP = 'mouseup';\nconst EVENT_TOUCHSTART = 'touchstart';\nconst EVENT_TOUCHMOVE = 'touchmove';\nconst EVENT_TOUCHEND = 'touchend';\n\n/**\n * Base component class for iro UI components\n * This extends the Preact component class to allow them to react to mouse/touch input events by themselves\n */\nexport default class IroComponent extends Component {\n\n constructor(props) {\n super(props);\n // Generate unique ID for the component\n // This can be used to generate unique IDs for gradients, etc\n this.uid = (Math.random() + 1).toString(36).substring(5);\n }\n \n componentDidMount() {\n listen(this.base, [EVENT_MOUSEDOWN, EVENT_TOUCHSTART], this, { passive: false });\n }\n\n componentWillUnmount() {\n unlisten(this.base, [EVENT_MOUSEDOWN, EVENT_TOUCHSTART], this);\n }\n\n // More info on handleEvent:\n // http://download-cdn.miitomo.com/native/20180125111639/manifests/v2_20180405_3_android/manifest.json\n // TL;DR this lets us have a single point of entry for multiple events, and we can avoid callback/binding hell\n handleEvent(e) {\n e.preventDefault();\n // Detect if the event is a touch event by checking if it has the `touches` property\n // If it is a touch event, use the first touch input\n const point = e.touches ? e.changedTouches[0] : e;\n const x = point.clientX;\n const y = point.clientY;\n // Get the screen position of the component\n const bounds = this.base.getBoundingClientRect();\n\n switch (e.type) {\n case EVENT_MOUSEDOWN:\n case EVENT_TOUCHSTART:\n listen(document, [EVENT_MOUSEMOVE, EVENT_TOUCHMOVE, EVENT_MOUSEUP, EVENT_TOUCHEND], this, { passive: false });\n this.handleInput(x, y, bounds, 'START');\n break;\n case EVENT_MOUSEMOVE:\n case EVENT_TOUCHMOVE:\n this.handleInput(x, y, bounds, 'MOVE');\n break;\n case EVENT_MOUSEUP:\n case EVENT_TOUCHEND:\n this.handleInput(x, y, bounds, 'END');\n unlisten(document, [EVENT_MOUSEMOVE, EVENT_TOUCHMOVE, EVENT_MOUSEUP, EVENT_TOUCHEND], this, { passive: false });\n break;\n }\n }\n}","/**\n * @desc Resolve an SVG URL\n * This is required to work around how Safari handles gradient URLS under certain conditions\n * If a page is using a client-side routing library which makes use of the HTML tag, \n * Safari won't be able to render SVG gradients properly (as they are referenced by URLs)\n * More info on the problem: \n * https://stackoverflow.com/questions/19742805/angular-and-svg-filters/19753427#19753427\n * https://github.com/jaames/iro.js/issues/18\n * https://github.com/jaames/iro.js/issues/45\n * @param {String} url resource url (should be an id selector e.g \"#example\")\n * @returns {String} resolved url\n */\nexport function resolveUrl(url) {\n // Sniff useragent string to check if the user is running Safari\n const ua = window.navigator.userAgent;\n const isSafari = /^((?!chrome|android).)*safari/i.test(ua);\n const isIos = /iPhone|iPod|iPad/i.test(ua);\n const location = window.location;\n return (isSafari || isIos) ? `${location.protocol}//${location.host}${location.pathname}${location.search}${url}` : url;\n}\n\n/**\n * @desc create the path commands to draw an svg arc\n * @param {Number} cx center point x\n * @param {Number} cy center point y\n * @param {Number} radius arc radius\n * @param {Number} startAngle arc start angle (degrees)\n * @param {Number} endAngle arc end angle (degrees)\n * @returns {String} arc path commands\n */\nexport function createArcPath(cx, cy, radius, startAngle, endAngle) {\n const largeArcFlag = endAngle - startAngle <= 180 ? 0 : 1;\n startAngle *= Math.PI / 180;\n endAngle *= Math.PI / 180;\n const x1 = cx + radius * Math.cos(endAngle);\n const y1 = cy + radius * Math.sin(endAngle);\n const x2 = cx + radius * Math.cos(startAngle);\n const y2 = cy + radius * Math.sin(startAngle);\n return `M ${x1} ${y1} A ${radius} ${radius} 0 ${largeArcFlag} 0 ${x2} ${y2}`;\n}","import { h } from 'preact';\nimport { resolveUrl } from '../util/svg';\n\nfunction IroHandle(props) {\n \n const radius = props.r;\n const url = props.url;\n\n return (\n \n {url && (\n \n )}\n {!url && (\n \n )}\n {!url && (\n \n )}\n \n );\n}\n\nIroHandle.defaultProps = {\n x: 0,\n y: 0,\n r: 8,\n url: null,\n origin: {x: 0, y: 0}\n};\n\nexport default IroHandle;","import { h } from 'preact';\n\nimport IroComponent from 'ui/component';\nimport IroHandle from 'ui/handle';\nimport { resolveUrl, createArcPath } from '../util/svg';\n\n\nexport default class IroWheel extends IroComponent {\n\n render(props) {\n let { width, borderWidth, handleRadius } = props;\n const hsv = props.color.hsv;\n const radius = (width / 2) - borderWidth;\n const handleAngle = (360 - hsv.h) * (Math.PI / 180);\n const handleDist = (hsv.s / 100) * (radius - props.padding - handleRadius - borderWidth);\n const cX = radius + borderWidth;\n const cY = radius + borderWidth;\n \n return (\n \n \n \n \n \n \n \n \n {Array.apply(null, { length: 360 }).map((_, hue) => (\n \n ))}\n \n \n { props.wheelLightness && (\n \n )}\n \n \n \n );\n }\n\n /**\n * @desc handles mouse input for this component\n * @param {Number} x - point x coordinate\n * @param {Number} y - point y coordinate\n * @param {DOMRect} rect - bounding client rect for the component's base element\n * @param {String} type - input type: \"START\", \"MOVE\" or \"END\"\n */\n handleInput(x, y, { left, top }, type) {\n const props = this.props;\n const radius = props.width / 2;\n const handleRange = (radius - props.padding - props.handleRadius - props.borderWidth);\n const cX = radius;\n const cY = radius;\n\n x = cX - (x - left);\n y = cY - (y - top);\n\n let handleAngle = Math.atan2(y, x);\n // Calculate the hue by converting the angle to radians\n let hue = 360 - (Math.round(handleAngle * (180 / Math.PI)) + 180);\n // Find the point's distance from the center of the wheel\n // This is used to show the saturation level\n let handleDist = Math.min(Math.sqrt(x * x + y * y), handleRange);\n props.onInput(type, {\n h: hue,\n s: Math.round((100 / handleRange) * handleDist)\n });\n }\n}","/**\n * @desc Parse a css unit string - either regular int or a percentage number\n * @param {String} str input string\n * @param {String} max max number for converting percentages\n * @returns {Number} \n */\nexport function parseUnit(str, max) {\n const isPercentage = str.indexOf('%') > -1;\n const num = parseFloat(str);\n return isPercentage ? (max / 100) * num : num;\n}\n\n/**\n * @desc Parse hex str to an int\n * @param {String} str input string\n * @returns {Number} \n */\nexport function parseHexInt(str) {\n return parseInt(str, 16);\n}\n\n/**\n * @desc Convert into to 2-digit hex\n * @param {Number} int input number\n * @returns {String} \n */\nexport function intToHex(int) {\n return int.toString(16).padStart(2, '0');\n}","import { parseUnit, parseHexInt, intToHex } from './util/colorUtils';\n\n// Some regular expressions for rgb() and hsl() Colors are borrowed from tinyColor\n// https://github.com/bgrins/TinyColor\n\n// https://www.w3.org/TR/css3-values/#integers\nconst CSS_INTEGER = `[-\\\\+]?\\\\d+%?`;\n// http://www.w3.org/TR/css3-values/#number-value\nconst CSS_NUMBER = `[-\\\\+]?\\\\d*\\\\.\\\\d+%?`;\n// Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome\nconst CSS_UNIT = `(?:${ CSS_NUMBER })|(?:${ CSS_INTEGER })`;\n\n// Parse function params\n// Parens and commas are optional, and this also allows for whitespace between numbers\nconst PERMISSIVE_MATCH_3 = `[\\\\s|\\\\(]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })\\\\s*\\\\)?`;\nconst PERMISSIVE_MATCH_4 = `[\\\\s|\\\\(]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })\\\\s*\\\\)?`;\n\n// Regex patterns for functional colors\nconst REGEX_FUNCTIONAL_RGB = new RegExp(`rgb${ PERMISSIVE_MATCH_3 }`);\nconst REGEX_FUNCTIONAL_RGBA = new RegExp(`rgba${ PERMISSIVE_MATCH_4 }`);\nconst REGEX_FUNCTIONAL_HSL = new RegExp(`hsl${ PERMISSIVE_MATCH_3 }`);\nconst REGEX_FUNCTIONAL_HSLA = new RegExp(`hsla${ PERMISSIVE_MATCH_4 }`);\n\nconst HEX_START = `^(?:#?|0x?)`;\nconst HEX_INT_SINGLE = `([0-9a-fA-F]{1})`;\nconst HEX_INT_DOUBLE = `([0-9a-fA-F]{2})`;\nconst REGEX_HEX_3 = new RegExp(`${ HEX_START }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }$`);\nconst REGEX_HEX_4 = new RegExp(`${ HEX_START }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }$`);\nconst REGEX_HEX_6 = new RegExp(`${ HEX_START }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }$`);\nconst REGEX_HEX_8 = new RegExp(`${ HEX_START }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }$`);\n\nexport default class Color {\n /**\n * @constructor Color object\n * @param {Object | String | Color} value - Color instance, object (hsv, hsl or rgb), string (hsl, rgb, hex)\n */\n constructor(value) {\n // The watch callback function for this Color will be stored here\n this._onChange = false;\n // The default Color value\n this._value = {h: 0, s: 0, v: 0, a: 1};\n if (value) this.set(value);\n }\n\n /**\n * @desc set the Color from any valid value\n * @param {Object | String | Color} value - Color instance, object (hsv, hsl or rgb), string (hsl, rgb, hex)\n */\n set(value) {\n const isString = typeof value === 'string';\n const isObject = typeof value === 'object';\n if ((isString) && (/^(?:#?|0x?)[0-9a-fA-F]{3,8}$/.test(value))) {\n this.hexString = value;\n }\n else if ((isString) && (/^rgba?/.test(value))) {\n this.rgbString = value;\n }\n else if ((isString) && (/^hsla?/.test(value))) {\n this.hslString = value;\n }\n else if ((isObject) && (value instanceof Color)) {\n this.hsv = value.hsv;\n }\n else if ((isObject) && ('r' in value) && ('g' in value) && ('b' in value)) {\n this.rgb = value;\n }\n else if ((isObject) && ('h' in value) && ('s' in value) && ('v' in value)) {\n this.hsv = value;\n }\n else if ((isObject) && ('h' in value) && ('s' in value) && ('l' in value)) {\n this.hsl = value;\n }\n else {\n throw new Error('invalid color value');\n }\n }\n\n /**\n * @desc shortcut to set a specific channel value\n * @param {String} format - hsv | hsl | rgb\n * @param {String} channel - individual channel to set, for example if model = hsl, chanel = h | s | l\n * @param {Number} value - new value for the channel\n */\n setChannel(format, channel, value) {\n this[format] = {...this[format], [channel]: value};\n }\n\n /**\n * @desc make new Color instance with the same value as this one\n * @return {Color}\n */\n clone() {\n return new Color(this);\n }\n\n /**\n * @desc convert hsv object to rgb\n * @param {Object} hsv hsv object\n * @return {Object} rgb object\n */\n static hsvToRgb(hsv) {\n const h = hsv.h / 60;\n const s = hsv.s / 100;\n const v = hsv.v / 100;\n const i = Math.floor(h);\n const f = h - i;\n const p = v * (1 - s);\n const q = v * (1 - f * s);\n const t = v * (1 - (1 - f) * s);\n const mod = i % 6;\n const r = [v, q, p, p, t, v][mod];\n const g = [t, v, v, q, p, p][mod];\n const b = [p, p, t, v, v, q][mod];\n return {\n r: r * 255, \n g: g * 255, \n b: b * 255\n };\n }\n\n /**\n * @desc convert rgb object to hsv\n * @param {Object} rgb - rgb object\n * @return {Object} hsv object\n */\n static rgbToHsv(rgb) {\n const r = rgb.r / 255;\n const g = rgb.g / 255;\n const b = rgb.b / 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const delta = max - min;\n let hue;\n let value = max;\n let saturation = max === 0 ? 0 : delta / max;\n switch (max) {\n case min: \n hue = 0; // achromatic\n break;\n case r: \n hue = (g - b) / delta + (g < b ? 6 : 0);\n break;\n case g: \n hue = (b - r) / delta + 2;\n break;\n case b:\n hue = (r - g) / delta + 4;\n break;\n }\n return {\n h: hue * 60,\n s: saturation * 100,\n v: value * 100\n }\n }\n\n /**\n * @desc convert hsv object to hsl\n * @param {Object} hsv - hsv object\n * @return {Object} hsl object\n */\n static hsvToHsl(hsv) {\n const s = hsv.s / 100;\n const v = hsv.v / 100;\n const l = (2 - s) * v;\n const divisor = l <= 1 ? l : (2 - l);\n // Avoid division by zero when lightness is close to zero\n const saturation = divisor < 1e-9 ? 0 : (s * v) / divisor;\n return {\n h: hsv.h,\n s: saturation * 100,\n l: l * 50\n };\n }\n\n /**\n * @desc convert hsl object to hsv\n * @param {Object} hsl - hsl object\n * @return {Object} hsv object\n */\n static hslToHsv(hsl) {\n const l = hsl.l * 2;\n const s = (hsl.s * ((l <= 100) ? l : 200 - l)) / 100;\n // Avoid division by zero when l + s is near 0\n const saturation = (l + s < 1e-9) ? 0 : (2 * s) / (l + s);\n return {\n h: hsl.h,\n s: saturation * 100,\n v: (l + s) / 2\n };\n }\n\n get hsv() {\n // _value is cloned to allow changes to be made to the values before passing them back\n const value = this._value;\n return {h: value.h, s: value.s, v: value.v};\n }\n\n set hsv(newValue) {\n const oldValue = this._value;\n newValue = { ...oldValue, ...newValue };\n // If this Color is being watched for changes we need to compare the new and old values to check the difference\n // Otherwise we can just be lazy\n if (this._onChange) {\n // Compute changed values\n let changes = {};\n for (let key in oldValue) {\n changes[key] = newValue[key] != oldValue[key]\n };\n // Update the old value\n this._value = newValue;\n // If the value has changed, call hook callback\n if (changes.h || changes.s || changes.v || changes.a) this._onChange(this, changes);\n } else {\n this._value = newValue;\n }\n }\n\n get rgb() {\n const {r, g, b} = Color.hsvToRgb(this._value);\n return {\n r: Math.round(r),\n g: Math.round(g),\n b: Math.round(b),\n };\n }\n\n set rgb(value) {\n this.hsv = {...Color.rgbToHsv(value), a: (value.a === undefined) ? 1 : value.a};\n }\n\n get hsl() {\n const {h, s, l} = Color.hsvToHsl(this._value);\n return {\n h: Math.round(h),\n s: Math.round(s),\n l: Math.round(l),\n };\n }\n\n set hsl(value) {\n this.hsv = {...Color.hslToHsv(value), a: (value.a === undefined) ? 1 : value.a};\n }\n\n get rgbString() {\n const rgb = this.rgb;\n return `rgb(${rgb.r}, ${rgb.g}, ${rgb.b})`;\n }\n\n set rgbString(value) {\n let match;\n let r, g, b, a = 1;\n if (match = REGEX_FUNCTIONAL_RGB.exec(value)) {\n r = parseUnit(match[1], 255);\n g = parseUnit(match[2], 255);\n b = parseUnit(match[3], 255);\n }\n else if (match = REGEX_FUNCTIONAL_RGBA.exec(value)) {\n r = parseUnit(match[1], 255);\n g = parseUnit(match[2], 255);\n b = parseUnit(match[3], 255);\n a = parseUnit(match[4], 1);\n }\n if (match) {\n this.rgb = {r, g, b, a};\n } \n else {\n throw new Error('invalid rgb string');\n }\n }\n\n get hexString() {\n const rgb = this.rgb;\n return `#${ intToHex(rgb.r) }${ intToHex(rgb.g) }${ intToHex(rgb.b) }`;\n }\n\n set hexString(value) {\n let match;\n let r, g, b, a = 255;\n if (match = REGEX_HEX_3.exec(value)) {\n r = parseHexInt(match[1]) * 17;\n g = parseHexInt(match[2]) * 17;\n b = parseHexInt(match[3]) * 17;\n }\n else if (match = REGEX_HEX_4.exec(value)) {\n r = parseHexInt(match[1]) * 17;\n g = parseHexInt(match[2]) * 17;\n b = parseHexInt(match[3]) * 17;\n a = parseHexInt(match[4]) * 17;\n }\n else if (match = REGEX_HEX_6.exec(value)) {\n r = parseHexInt(match[1]);\n g = parseHexInt(match[2]);\n b = parseHexInt(match[3]);\n }\n else if (match = REGEX_HEX_8.exec(value)) {\n r = parseHexInt(match[1]);\n g = parseHexInt(match[2]);\n b = parseHexInt(match[3]);\n a = parseHexInt(match[4]);\n }\n if (match) {\n this.rgb = {r, g, b, a: a / 255};\n }\n else {\n throw new Error('invalid hex string');\n }\n }\n\n get hslString() {\n const hsl = this.hsl;\n return `hsl(${hsl.h}, ${hsl.s}%, ${hsl.l}%)`;\n }\n\n set hslString(value) {\n let match;\n let h, s, l, a = 1;\n if (match = REGEX_FUNCTIONAL_HSL.exec(value)) {\n h = parseUnit(match[1], 360);\n s = parseUnit(match[2], 100);\n l = parseUnit(match[3], 100);\n }\n else if (match = REGEX_FUNCTIONAL_HSLA.exec(value)) {\n h = parseUnit(match[1], 360);\n s = parseUnit(match[2], 100);\n l = parseUnit(match[3], 100);\n a = parseUnit(match[4], 1);\n }\n if (match) {\n this.hsl = {h, s, l, a};\n } \n else {\n throw new Error('invalid hsl string');\n }\n }\n}","import { h } from 'preact';\n\nimport IroComponent from 'ui/component';\nimport IroHandle from 'ui/handle';\nimport IroColor from '../color';\nimport { resolveUrl } from '../util/svg';\n\nexport default class IroSlider extends IroComponent {\n\n renderGradient(props) {\n const hsv = props.color.hsv;\n let stops = [];\n\n switch (props.sliderType) {\n case 'hue':\n stops = [\n {offset: '0', color: '#f00'},\n {offset: '16.666', color: '#ff0'},\n {offset: '33.333', color: '#0f0'},\n {offset: '50', color: '#0ff'},\n {offset: '66.666', color: '#00f'},\n {offset: '83.333', color: '#f0f'},\n {offset: '100', color: '#f00'},\n ];\n break;\n case 'saturation':\n var noSat = IroColor.hsvToHsl({h: hsv.h, s: 0, v: hsv.v});\n var fullSat = IroColor.hsvToHsl({h: hsv.h, s: 100, v: hsv.v});\n stops = [\n {offset: '0', color: `hsl(${noSat.h}, ${noSat.s}%, ${noSat.l}%)`},\n {offset: '100', color: `hsl(${fullSat.h}, ${fullSat.s}%, ${fullSat.l}%)`}\n ];\n break;\n case 'value':\n default:\n var hsl = IroColor.hsvToHsl({h: hsv.h, s: hsv.s, v: 100});\n stops = [\n {offset: '0', color: '#000'},\n {offset: '100', color: `hsl(${hsl.h}, ${hsl.s}%, ${hsl.l}%)`}\n ];\n break;\n }\n\n return (\n \n {stops.map(stop => (\n \n ))}\n \n )\n }\n\n render(props) {\n let { width, sliderHeight, borderWidth, handleRadius } = props;\n sliderHeight = sliderHeight ? sliderHeight : props.padding * 2 + handleRadius * 2 + borderWidth * 2;\n this.width = width;\n this.height = sliderHeight;\n const cornerRadius = sliderHeight / 2;\n const range = width - cornerRadius * 2\n const hsv = props.color.hsv;\n \n let sliderValue;\n switch (props.sliderType) {\n case 'hue':\n sliderValue = hsv.h /= 3.6;\n break;\n case 'saturation':\n sliderValue = hsv.s;\n break;\n case 'value':\n default:\n sliderValue = hsv.v;\n break;\n }\n\n return (\n \n \n { this.renderGradient(props) }\n \n \n \n \n );\n }\n\n getValueFromPoint(x, y, { left }) {\n const handleRange = this.width - this.height;\n const cornerRadius = this.height / 2;\n x = x - (left + cornerRadius);\n let dist = Math.max(Math.min(x, handleRange), 0);\n return Math.round((100 / handleRange) * dist);\n }\n\n /**\n * @desc handles mouse input for this component\n * @param {Number} x - point x coordinate\n * @param {Number} y - point y coordinate\n * @param {DOMRect} rect - bounding client rect for the component's base element\n * @param {String} type - input type: \"START\", \"MOVE\" or \"END\"\n */\n handleInput(x, y, bounds, type) {\n let value = this.getValueFromPoint(x, y, bounds);\n let channel;\n switch (this.props.sliderType) {\n case 'hue':\n channel = 'h';\n value *= 3.6;\n break;\n case 'saturation':\n channel = 's';\n break;\n case 'value':\n default:\n channel = 'v';\n break;\n }\n this.props.onInput(type, {\n [channel]: value\n });\n }\n}","import { h, render } from 'preact';\nimport { onDocumentReady } from './dom';\n\n/**\n * @desc Turn a component into a widget\n * This returns a factory function that can be used to create an instance of the widget component\n * The first function param is a DOM element or CSS selector for the element to mount to,\n * The second param is for config options which are passed to the component as props\n * This factory function can also delay mounting the element into the DOM until the page is ready\n * @param {Component} widgetComonpent ui component to turn into a widget\n * @returns {Function} widget factory\n */\nexport function createWidget(widgetComponent) {\n\n const widgetFactory = function (parent, props) {\n let widget = null; // will become an instance of the widget component class\n let widgetRoot = document.createElement('div');\n\n // Render widget into a temp DOM node\n render(\n h(widgetComponent, {\n ref: ref => widget = ref,\n ...props,\n }),\n widgetRoot\n );\n // Mount it into the DOM when the page document is ready\n onDocumentReady(() => {\n const container = parent instanceof Element ? parent : document.querySelector(parent);\n container.appendChild(widget.base);\n widget.onMount(container);\n });\n\n return widget;\n }\n\n // Allow the widget factory to inherit component prototype + static class methods\n // This makes it easier for plugin authors to extend the base widget component\n widgetFactory.prototype = widgetComponent.prototype;\n Object.assign(widgetFactory, widgetComponent);\n // Add reference to base component too\n widgetFactory.__component = widgetComponent; \n\n return widgetFactory;\n\n}","import { h, Component } from 'preact';\n\nimport IroWheel from 'ui/wheel';\nimport IroSlider from 'ui/slider';\nimport IroColor from './color';\nimport { createWidget } from 'util/createWidget';\n\nclass ColorPicker extends Component {\n constructor(props) {\n super(props);\n this.emitHook('init:before');\n this._events = {};\n this._deferredEvents = {};\n this._colorUpdateActive = false;\n this._colorUpdateSrc = null;\n this.color = new IroColor(props.color);\n this.deferredEmit('color:init', this.color, { h: false, s: false, v: false, a: false });\n // Whenever the color changes, update the color wheel\n this.color._onChange = this.updateColor.bind(this);\n this.state = {\n ...props,\n color: this.color,\n };\n this.emitHook('init:state');\n\n if (props.layout) {\n this.layout = props.layout;\n } else {\n this.layout = [\n {component: IroWheel, options: {}},\n {component: IroSlider, options: {}},\n ];\n }\n this.emitHook('init:after');\n }\n\n // Public ColorPicker events API\n\n /**\n * @desc Set a callback function for an event\n * @param {String | Array} eventList event(s) to listen to\n * @param {Function} callback\n */\n on(eventList, callback) {\n const events = this._events;\n // eventList can be an eventType string or an array of eventType strings\n (!Array.isArray(eventList) ? [eventList] : eventList).forEach(eventType => {\n // Emit plugin hook\n this.emitHook('event:on', eventType, callback);\n // Add event callback\n (events[eventType] || (events[eventType] = [])).push(callback);\n // Call deferred events\n // These are events that can be stored until a listener for them is added\n if (this._deferredEvents[eventType]) {\n // Deffered events store an array of arguments from when the event was called\n this._deferredEvents[eventType].forEach(args => {\n callback.apply(null, args); \n });\n // Clear deferred events\n this._deferredEvents[eventType] = [];\n }\n });\n }\n\n /**\n * @desc Remove a callback function for an event added with on()\n * @param {String | Array} eventList The name of the event\n * @param {Function} callback\n */\n off(eventList, callback) {\n (!Array.isArray(eventList) ? [eventList] : eventList).forEach(eventType => {\n const callbackList = this._events[eventType];\n this.emitHook('event:off', eventType, callback);\n if (callbackList) callbackList.splice(callbackList.indexOf(callback), 1);\n });\n }\n\n /**\n * @desc Emit an event\n * @param {String} eventType The name of the event to emit\n * @param {Array} args array of args to pass to callbacks\n */\n emit(eventType, ...args) {\n // Events are plugin hooks too\n this.emitHook(eventType, ...args);\n const callbackList = this._events[eventType] || [];\n for (let i = 0; i < callbackList.length; i++) {\n callbackList[i].apply(null, args); \n }\n }\n\n /**\n * @desc Emit an event now, or save it for when the relevent event listener is added\n * @param {String} eventType The name of the event to emit\n * @param {Array} args array of args to pass to callbacks\n */\n deferredEmit(eventType, ...args) {\n const deferredEvents = this._deferredEvents;\n this.emit(eventType, ...args);\n (deferredEvents[eventType] || (deferredEvents[eventType] = [])).push(args);\n }\n\n // Public utility methods\n\n /**\n * @desc Resize the color picker\n * @param {Number} width\n */\n resize(width) {\n this.setState({width});\n }\n\n /**\n * @desc Reset the color picker to the initial color provided in the color picker options\n */\n reset() {\n this.color.set(this.props.color);\n }\n\n // Plugin hooks API\n\n /**\n * @desc Set a callback function for a hook\n * @param {String} hookType The name of the hook to listen to\n * @param {Function} callback\n */\n static addHook(hookType, callback) {\n const pluginHooks = ColorPicker.pluginHooks;\n (pluginHooks[hookType] || (pluginHooks[hookType] = [])).push(callback);\n }\n\n /**\n * @desc Emit a callback hook\n * @access private\n * @param {String} hookType The type of hook event to emit\n */\n emitHook(hookType, ...args) {\n const callbackList = ColorPicker.pluginHooks[hookType] || [];\n for (let i = 0; i < callbackList.length; i++) {\n callbackList[i].apply(this, args); \n }\n }\n\n // Internal methods\n\n /**\n * @desc Called by the createWidget wrapper when the element is mounted into the page\n * @access private\n * @param {Element} container the container element for this ColorPicker instance\n */\n onMount(container) {\n this.el = container;\n this.deferredEmit('mount', this);\n }\n\n /**\n * @desc React to a color update\n * @access private\n * @param {IroColor} color current color\n * @param {Object} changes shows which h,s,v color channels changed\n */\n updateColor(color, changes) {\n this.emitHook('color:beforeUpdate', color, changes);\n this.setState({ color: color });\n this.emitHook('color:afterUpdate', color, changes);\n // Prevent infinite loops if the color is set inside a color:change or input:change callback\n if (!this._colorUpdateActive) {\n // While _colorUpdateActive == true, branch cannot be entered\n this._colorUpdateActive = true;\n // If the color change originates from user input, fire input:change\n if (this._colorUpdateSrc == 'input') { // colorUpdateSrc is cleared in handeInput()\n this.emit('input:change', color, changes);\n } \n // Always fire color:change event\n this.emit('color:change', color, changes);\n this._colorUpdateActive = false;\n }\n }\n\n /**\n * @desc Handle input from a UI control element\n * @access private\n * @param {String} type \"START\" | \"MOVE\" | \"END\"\n * @param {Object} hsv new hsv values for the color\n */\n handleInput(type, hsv) {\n // Fire input start and move events before color update\n if (type === 'START') this.emit('input:start', this.color);\n if (type === 'MOVE') this.emit('input:move', this.color);\n // Set the color update source\n this._colorUpdateSrc = 'input';\n // Setting the color HSV here will automatically update the UI\n // Since we bound the color's _onChange callback\n this.color.hsv = hsv;\n // Fire input end event after color update\n if (type === 'END') this.emit('input:end', this.color);\n // Reset color update source so it doesn't interfere with future color updates\n // Super important to do this here and not in updateColor()\n this._colorUpdateSrc = null;\n }\n\n render(props, state) {\n return (\n
\n {this.layout.map(({component: UiComponent, options: options}) => (\n this.handleInput(type, hsv) }\n parent={ this }\n />\n ))}\n
\n )\n }\n}\n\nColorPicker.pluginHooks = {};\n\nColorPicker.defaultProps = {\n width: 300,\n height: 300,\n handleRadius: 8,\n handleSvg: null,\n handleOrigin: {x: 0, y: 0},\n color: '#fff',\n borderColor: '#fff',\n borderWidth: 0,\n display: 'block',\n wheelLightness: true,\n sliderHeight: null,\n sliderMargin: 12,\n padding: 6,\n layout: null,\n}\n\nexport default createWidget(ColorPicker);\n","/**\n * iro.js plugins API\n * This provides the iro.use method, which can be used to register plugins which extend the iro.js core\n */\nexport function usePlugins(core) {\n const installedPlugins = [];\n \n /**\n * @desc Register iro.js plugin\n * @param {Function} plugin = plugin constructor\n * @param {Object} pluginOptions = plugin options passed to constructor\n */\n core.use = function(plugin, pluginOptions = {}) {\n // Check that the plugin hasn't already been registered\n if (!(installedPlugins.indexOf(plugin) > -1)) {\n // Init plugin\n // TODO: consider collection of plugin utils, which are passed as a thrid param\n plugin(core, pluginOptions);\n // Register plugin\n installedPlugins.push(plugin);\n }\n }\n\n core.installedPlugins = installedPlugins;\n\n return core;\n}","import { h } from 'preact';\n\nimport ColorPicker from './colorPicker';\nimport Color from './color';\n\nimport Component from 'ui/component';\nimport Handle from 'ui/handle';\nimport Slider from 'ui/slider';\nimport Wheel from 'ui/wheel';\nimport { usePlugins } from 'util/usePlugins';\nimport { resolveUrl, createArcPath } from 'util/svg';\nimport { parseUnit, parseHexInt, intToHex } from 'util/colorUtils';\n\nexport default usePlugins({\n Color,\n ColorPicker,\n ui: {\n h,\n Component,\n Handle,\n Slider,\n Wheel,\n },\n util: {\n resolveUrl, \n createArcPath,\n parseUnit,\n parseHexInt,\n intToHex\n },\n version: VERSION,\n});\n"],"names":["arguments","const","super","let","IroColor","this","options","ColorPicker","Component","Handle","Slider","Wheel"],"mappings":";;;;;;;AAAA,IAAI,KAAK,GAAG,SAAS,KAAK,GAAG,EAAE,CAAC;;AAEhC,IAAI,OAAO,GAAG,EAAE,CAAC;;AAEjB,IAAI,KAAK,GAAG,EAAE,CAAC;;AAEf,IAAI,cAAc,GAAG,EAAE,CAAC;;AAExB,SAAS,CAAC,CAAC,QAAQ,EAAE,UAAU,EAAE;;;CAChC,IAAI,QAAQ,GAAG,cAAc;KACzB,UAAU;KACV,KAAK;KACL,MAAM;KACN,CAAC,CAAC;CACN,KAAK,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG;EACpC,KAAK,CAAC,IAAI,CAACA,WAAS,CAAC,CAAC,CAAC,CAAC,CAAC;EACzB;CACD,IAAI,UAAU,IAAI,UAAU,CAAC,Q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M,EAAE,aAAkB,EAAE;iDAAP,GAAG;;;IAE1C,IAAI,EAAE,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;;;MAG5C,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;;MAE5B,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAC/B;IACF;;EAED,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;;EAEzC,OAAO,IAAI,CAAC;;;ACZd,UAAe,UAAU,CAAC;SACxB,KAAK;eACLM,aAAW;EACX,EAAE,EAAE;OACF,CAAC;eACDC,YAAS;YACTC,SAAM;YACNC,SAAM;WACNC,QAAK;GACN;EACD,IAAI,EAAE;gBACJ,UAAU;mBACV,aAAa;eACb,SAAS;iBACT,WAAW;cACX,QAAQ;GACT;EACD,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC;;;;"} \ No newline at end of file +{"version":3,"file":"iro.es.map","sources":["../node_modules/preact/dist/preact.mjs","../src/util/dom.js","../src/ui/component.js","../src/util/svg.js","../src/ui/handle.jsx","../src/ui/wheel.jsx","../src/util/colorUtils.js","../src/color.js","../src/ui/slider.jsx","../src/util/createWidget.js","../src/colorPicker.js","../src/util/usePlugins.js","../src/iro.js"],"sourcesContent":["var VNode = function VNode() {};\n\nvar options = {};\n\nvar stack = [];\n\nvar EMPTY_CHILDREN = [];\n\nfunction h(nodeName, attributes) {\n\tvar children = EMPTY_CHILDREN,\n\t lastSimple,\n\t child,\n\t simple,\n\t i;\n\tfor (i = arguments.length; i-- > 2;) {\n\t\tstack.push(arguments[i]);\n\t}\n\tif (attributes && attributes.children != null) {\n\t\tif (!stack.length) stack.push(attributes.children);\n\t\tdelete attributes.children;\n\t}\n\twhile (stack.length) {\n\t\tif ((child = stack.pop()) && child.pop !== undefined) {\n\t\t\tfor (i = child.length; i--;) {\n\t\t\t\tstack.push(child[i]);\n\t\t\t}\n\t\t} else {\n\t\t\tif (typeof child === 'boolean') child = null;\n\n\t\t\tif (simple = typeof nodeName !== 'function') {\n\t\t\t\tif (child == null) child = '';else if (typeof child === 'number') child = String(child);else if (typeof child !== 'string') simple = false;\n\t\t\t}\n\n\t\t\tif (simple && lastSimple) {\n\t\t\t\tchildren[children.length - 1] += child;\n\t\t\t} else if (children === EMPTY_CHILDREN) {\n\t\t\t\tchildren = [child];\n\t\t\t} else {\n\t\t\t\tchildren.push(child);\n\t\t\t}\n\n\t\t\tlastSimple = simple;\n\t\t}\n\t}\n\n\tvar p = new VNode();\n\tp.nodeName = nodeName;\n\tp.children = children;\n\tp.attributes = attributes == null ? undefined : attributes;\n\tp.key = attributes == null ? undefined : attributes.key;\n\n\tif (options.vnode !== undefined) options.vnode(p);\n\n\treturn p;\n}\n\nfunction extend(obj, props) {\n for (var i in props) {\n obj[i] = props[i];\n }return obj;\n}\n\nfunction applyRef(ref, value) {\n if (ref != null) {\n if (typeof ref == 'function') ref(value);else ref.current = value;\n }\n}\n\nvar defer = typeof Promise == 'function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;\n\nfunction cloneElement(vnode, props) {\n return h(vnode.nodeName, extend(extend({}, vnode.attributes), props), arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children);\n}\n\nvar IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\n\nvar items = [];\n\nfunction enqueueRender(component) {\n\tif (!component._dirty && (component._dirty = true) && items.push(component) == 1) {\n\t\t(options.debounceRendering || defer)(rerender);\n\t}\n}\n\nfunction rerender() {\n\tvar p;\n\twhile (p = items.pop()) {\n\t\tif (p._dirty) renderComponent(p);\n\t}\n}\n\nfunction isSameNodeType(node, vnode, hydrating) {\n\tif (typeof vnode === 'string' || typeof vnode === 'number') {\n\t\treturn node.splitText !== undefined;\n\t}\n\tif (typeof vnode.nodeName === 'string') {\n\t\treturn !node._componentConstructor && isNamedNode(node, vnode.nodeName);\n\t}\n\treturn hydrating || node._componentConstructor === vnode.nodeName;\n}\n\nfunction isNamedNode(node, nodeName) {\n\treturn node.normalizedNodeName === nodeName || node.nodeName.toLowerCase() === nodeName.toLowerCase();\n}\n\nfunction getNodeProps(vnode) {\n\tvar props = extend({}, vnode.attributes);\n\tprops.children = vnode.children;\n\n\tvar defaultProps = vnode.nodeName.defaultProps;\n\tif (defaultProps !== undefined) {\n\t\tfor (var i in defaultProps) {\n\t\t\tif (props[i] === undefined) {\n\t\t\t\tprops[i] = defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn props;\n}\n\nfunction createNode(nodeName, isSvg) {\n\tvar node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName);\n\tnode.normalizedNodeName = nodeName;\n\treturn node;\n}\n\nfunction removeNode(node) {\n\tvar parentNode = node.parentNode;\n\tif (parentNode) parentNode.removeChild(node);\n}\n\nfunction setAccessor(node, name, old, value, isSvg) {\n\tif (name === 'className') name = 'class';\n\n\tif (name === 'key') {} else if (name === 'ref') {\n\t\tapplyRef(old, null);\n\t\tapplyRef(value, node);\n\t} else if (name === 'class' && !isSvg) {\n\t\tnode.className = value || '';\n\t} else if (name === 'style') {\n\t\tif (!value || typeof value === 'string' || typeof old === 'string') {\n\t\t\tnode.style.cssText = value || '';\n\t\t}\n\t\tif (value && typeof value === 'object') {\n\t\t\tif (typeof old !== 'string') {\n\t\t\t\tfor (var i in old) {\n\t\t\t\t\tif (!(i in value)) node.style[i] = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var i in value) {\n\t\t\t\tnode.style[i] = typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false ? value[i] + 'px' : value[i];\n\t\t\t}\n\t\t}\n\t} else if (name === 'dangerouslySetInnerHTML') {\n\t\tif (value) node.innerHTML = value.__html || '';\n\t} else if (name[0] == 'o' && name[1] == 'n') {\n\t\tvar useCapture = name !== (name = name.replace(/Capture$/, ''));\n\t\tname = name.toLowerCase().substring(2);\n\t\tif (value) {\n\t\t\tif (!old) node.addEventListener(name, eventProxy, useCapture);\n\t\t} else {\n\t\t\tnode.removeEventListener(name, eventProxy, useCapture);\n\t\t}\n\t\t(node._listeners || (node._listeners = {}))[name] = value;\n\t} else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\n\t\ttry {\n\t\t\tnode[name] = value == null ? '' : value;\n\t\t} catch (e) {}\n\t\tif ((value == null || value === false) && name != 'spellcheck') node.removeAttribute(name);\n\t} else {\n\t\tvar ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''));\n\n\t\tif (value == null || value === false) {\n\t\t\tif (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase());else node.removeAttribute(name);\n\t\t} else if (typeof value !== 'function') {\n\t\t\tif (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value);else node.setAttribute(name, value);\n\t\t}\n\t}\n}\n\nfunction eventProxy(e) {\n\treturn this._listeners[e.type](options.event && options.event(e) || e);\n}\n\nvar mounts = [];\n\nvar diffLevel = 0;\n\nvar isSvgMode = false;\n\nvar hydrating = false;\n\nfunction flushMounts() {\n\tvar c;\n\twhile (c = mounts.shift()) {\n\t\tif (options.afterMount) options.afterMount(c);\n\t\tif (c.componentDidMount) c.componentDidMount();\n\t}\n}\n\nfunction diff(dom, vnode, context, mountAll, parent, componentRoot) {\n\tif (!diffLevel++) {\n\t\tisSvgMode = parent != null && parent.ownerSVGElement !== undefined;\n\n\t\thydrating = dom != null && !('__preactattr_' in dom);\n\t}\n\n\tvar ret = idiff(dom, vnode, context, mountAll, componentRoot);\n\n\tif (parent && ret.parentNode !== parent) parent.appendChild(ret);\n\n\tif (! --diffLevel) {\n\t\thydrating = false;\n\n\t\tif (!componentRoot) flushMounts();\n\t}\n\n\treturn ret;\n}\n\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n\tvar out = dom,\n\t prevSvgMode = isSvgMode;\n\n\tif (vnode == null || typeof vnode === 'boolean') vnode = '';\n\n\tif (typeof vnode === 'string' || typeof vnode === 'number') {\n\t\tif (dom && dom.splitText !== undefined && dom.parentNode && (!dom._component || componentRoot)) {\n\t\t\tif (dom.nodeValue != vnode) {\n\t\t\t\tdom.nodeValue = vnode;\n\t\t\t}\n\t\t} else {\n\t\t\tout = document.createTextNode(vnode);\n\t\t\tif (dom) {\n\t\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\t\t\t\trecollectNodeTree(dom, true);\n\t\t\t}\n\t\t}\n\n\t\tout['__preactattr_'] = true;\n\n\t\treturn out;\n\t}\n\n\tvar vnodeName = vnode.nodeName;\n\tif (typeof vnodeName === 'function') {\n\t\treturn buildComponentFromVNode(dom, vnode, context, mountAll);\n\t}\n\n\tisSvgMode = vnodeName === 'svg' ? true : vnodeName === 'foreignObject' ? false : isSvgMode;\n\n\tvnodeName = String(vnodeName);\n\tif (!dom || !isNamedNode(dom, vnodeName)) {\n\t\tout = createNode(vnodeName, isSvgMode);\n\n\t\tif (dom) {\n\t\t\twhile (dom.firstChild) {\n\t\t\t\tout.appendChild(dom.firstChild);\n\t\t\t}\n\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\n\t\t\trecollectNodeTree(dom, true);\n\t\t}\n\t}\n\n\tvar fc = out.firstChild,\n\t props = out['__preactattr_'],\n\t vchildren = vnode.children;\n\n\tif (props == null) {\n\t\tprops = out['__preactattr_'] = {};\n\t\tfor (var a = out.attributes, i = a.length; i--;) {\n\t\t\tprops[a[i].name] = a[i].value;\n\t\t}\n\t}\n\n\tif (!hydrating && vchildren && vchildren.length === 1 && typeof vchildren[0] === 'string' && fc != null && fc.splitText !== undefined && fc.nextSibling == null) {\n\t\tif (fc.nodeValue != vchildren[0]) {\n\t\t\tfc.nodeValue = vchildren[0];\n\t\t}\n\t} else if (vchildren && vchildren.length || fc != null) {\n\t\t\tinnerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML != null);\n\t\t}\n\n\tdiffAttributes(out, vnode.attributes, props);\n\n\tisSvgMode = prevSvgMode;\n\n\treturn out;\n}\n\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n\tvar originalChildren = dom.childNodes,\n\t children = [],\n\t keyed = {},\n\t keyedLen = 0,\n\t min = 0,\n\t len = originalChildren.length,\n\t childrenLen = 0,\n\t vlen = vchildren ? vchildren.length : 0,\n\t j,\n\t c,\n\t f,\n\t vchild,\n\t child;\n\n\tif (len !== 0) {\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tvar _child = originalChildren[i],\n\t\t\t props = _child['__preactattr_'],\n\t\t\t key = vlen && props ? _child._component ? _child._component.__key : props.key : null;\n\t\t\tif (key != null) {\n\t\t\t\tkeyedLen++;\n\t\t\t\tkeyed[key] = _child;\n\t\t\t} else if (props || (_child.splitText !== undefined ? isHydrating ? _child.nodeValue.trim() : true : isHydrating)) {\n\t\t\t\tchildren[childrenLen++] = _child;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (vlen !== 0) {\n\t\tfor (var i = 0; i < vlen; i++) {\n\t\t\tvchild = vchildren[i];\n\t\t\tchild = null;\n\n\t\t\tvar key = vchild.key;\n\t\t\tif (key != null) {\n\t\t\t\tif (keyedLen && keyed[key] !== undefined) {\n\t\t\t\t\tchild = keyed[key];\n\t\t\t\t\tkeyed[key] = undefined;\n\t\t\t\t\tkeyedLen--;\n\t\t\t\t}\n\t\t\t} else if (min < childrenLen) {\n\t\t\t\t\tfor (j = min; j < childrenLen; j++) {\n\t\t\t\t\t\tif (children[j] !== undefined && isSameNodeType(c = children[j], vchild, isHydrating)) {\n\t\t\t\t\t\t\tchild = c;\n\t\t\t\t\t\t\tchildren[j] = undefined;\n\t\t\t\t\t\t\tif (j === childrenLen - 1) childrenLen--;\n\t\t\t\t\t\t\tif (j === min) min++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\tchild = idiff(child, vchild, context, mountAll);\n\n\t\t\tf = originalChildren[i];\n\t\t\tif (child && child !== dom && child !== f) {\n\t\t\t\tif (f == null) {\n\t\t\t\t\tdom.appendChild(child);\n\t\t\t\t} else if (child === f.nextSibling) {\n\t\t\t\t\tremoveNode(f);\n\t\t\t\t} else {\n\t\t\t\t\tdom.insertBefore(child, f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (keyedLen) {\n\t\tfor (var i in keyed) {\n\t\t\tif (keyed[i] !== undefined) recollectNodeTree(keyed[i], false);\n\t\t}\n\t}\n\n\twhile (min <= childrenLen) {\n\t\tif ((child = children[childrenLen--]) !== undefined) recollectNodeTree(child, false);\n\t}\n}\n\nfunction recollectNodeTree(node, unmountOnly) {\n\tvar component = node._component;\n\tif (component) {\n\t\tunmountComponent(component);\n\t} else {\n\t\tif (node['__preactattr_'] != null) applyRef(node['__preactattr_'].ref, null);\n\n\t\tif (unmountOnly === false || node['__preactattr_'] == null) {\n\t\t\tremoveNode(node);\n\t\t}\n\n\t\tremoveChildren(node);\n\t}\n}\n\nfunction removeChildren(node) {\n\tnode = node.lastChild;\n\twhile (node) {\n\t\tvar next = node.previousSibling;\n\t\trecollectNodeTree(node, true);\n\t\tnode = next;\n\t}\n}\n\nfunction diffAttributes(dom, attrs, old) {\n\tvar name;\n\n\tfor (name in old) {\n\t\tif (!(attrs && attrs[name] != null) && old[name] != null) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = undefined, isSvgMode);\n\t\t}\n\t}\n\n\tfor (name in attrs) {\n\t\tif (name !== 'children' && name !== 'innerHTML' && (!(name in old) || attrs[name] !== (name === 'value' || name === 'checked' ? dom[name] : old[name]))) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode);\n\t\t}\n\t}\n}\n\nvar recyclerComponents = [];\n\nfunction createComponent(Ctor, props, context) {\n\tvar inst,\n\t i = recyclerComponents.length;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\twhile (i--) {\n\t\tif (recyclerComponents[i].constructor === Ctor) {\n\t\t\tinst.nextBase = recyclerComponents[i].nextBase;\n\t\t\trecyclerComponents.splice(i, 1);\n\t\t\treturn inst;\n\t\t}\n\t}\n\n\treturn inst;\n}\n\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n\nfunction setComponentProps(component, props, renderMode, context, mountAll) {\n\tif (component._disable) return;\n\tcomponent._disable = true;\n\n\tcomponent.__ref = props.ref;\n\tcomponent.__key = props.key;\n\tdelete props.ref;\n\tdelete props.key;\n\n\tif (typeof component.constructor.getDerivedStateFromProps === 'undefined') {\n\t\tif (!component.base || mountAll) {\n\t\t\tif (component.componentWillMount) component.componentWillMount();\n\t\t} else if (component.componentWillReceiveProps) {\n\t\t\tcomponent.componentWillReceiveProps(props, context);\n\t\t}\n\t}\n\n\tif (context && context !== component.context) {\n\t\tif (!component.prevContext) component.prevContext = component.context;\n\t\tcomponent.context = context;\n\t}\n\n\tif (!component.prevProps) component.prevProps = component.props;\n\tcomponent.props = props;\n\n\tcomponent._disable = false;\n\n\tif (renderMode !== 0) {\n\t\tif (renderMode === 1 || options.syncComponentUpdates !== false || !component.base) {\n\t\t\trenderComponent(component, 1, mountAll);\n\t\t} else {\n\t\t\tenqueueRender(component);\n\t\t}\n\t}\n\n\tapplyRef(component.__ref, component);\n}\n\nfunction renderComponent(component, renderMode, mountAll, isChild) {\n\tif (component._disable) return;\n\n\tvar props = component.props,\n\t state = component.state,\n\t context = component.context,\n\t previousProps = component.prevProps || props,\n\t previousState = component.prevState || state,\n\t previousContext = component.prevContext || context,\n\t isUpdate = component.base,\n\t nextBase = component.nextBase,\n\t initialBase = isUpdate || nextBase,\n\t initialChildComponent = component._component,\n\t skip = false,\n\t snapshot = previousContext,\n\t rendered,\n\t inst,\n\t cbase;\n\n\tif (component.constructor.getDerivedStateFromProps) {\n\t\tstate = extend(extend({}, state), component.constructor.getDerivedStateFromProps(props, state));\n\t\tcomponent.state = state;\n\t}\n\n\tif (isUpdate) {\n\t\tcomponent.props = previousProps;\n\t\tcomponent.state = previousState;\n\t\tcomponent.context = previousContext;\n\t\tif (renderMode !== 2 && component.shouldComponentUpdate && component.shouldComponentUpdate(props, state, context) === false) {\n\t\t\tskip = true;\n\t\t} else if (component.componentWillUpdate) {\n\t\t\tcomponent.componentWillUpdate(props, state, context);\n\t\t}\n\t\tcomponent.props = props;\n\t\tcomponent.state = state;\n\t\tcomponent.context = context;\n\t}\n\n\tcomponent.prevProps = component.prevState = component.prevContext = component.nextBase = null;\n\tcomponent._dirty = false;\n\n\tif (!skip) {\n\t\trendered = component.render(props, state, context);\n\n\t\tif (component.getChildContext) {\n\t\t\tcontext = extend(extend({}, context), component.getChildContext());\n\t\t}\n\n\t\tif (isUpdate && component.getSnapshotBeforeUpdate) {\n\t\t\tsnapshot = component.getSnapshotBeforeUpdate(previousProps, previousState);\n\t\t}\n\n\t\tvar childComponent = rendered && rendered.nodeName,\n\t\t toUnmount,\n\t\t base;\n\n\t\tif (typeof childComponent === 'function') {\n\n\t\t\tvar childProps = getNodeProps(rendered);\n\t\t\tinst = initialChildComponent;\n\n\t\t\tif (inst && inst.constructor === childComponent && childProps.key == inst.__key) {\n\t\t\t\tsetComponentProps(inst, childProps, 1, context, false);\n\t\t\t} else {\n\t\t\t\ttoUnmount = inst;\n\n\t\t\t\tcomponent._component = inst = createComponent(childComponent, childProps, context);\n\t\t\t\tinst.nextBase = inst.nextBase || nextBase;\n\t\t\t\tinst._parentComponent = component;\n\t\t\t\tsetComponentProps(inst, childProps, 0, context, false);\n\t\t\t\trenderComponent(inst, 1, mountAll, true);\n\t\t\t}\n\n\t\t\tbase = inst.base;\n\t\t} else {\n\t\t\tcbase = initialBase;\n\n\t\t\ttoUnmount = initialChildComponent;\n\t\t\tif (toUnmount) {\n\t\t\t\tcbase = component._component = null;\n\t\t\t}\n\n\t\t\tif (initialBase || renderMode === 1) {\n\t\t\t\tif (cbase) cbase._component = null;\n\t\t\t\tbase = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, true);\n\t\t\t}\n\t\t}\n\n\t\tif (initialBase && base !== initialBase && inst !== initialChildComponent) {\n\t\t\tvar baseParent = initialBase.parentNode;\n\t\t\tif (baseParent && base !== baseParent) {\n\t\t\t\tbaseParent.replaceChild(base, initialBase);\n\n\t\t\t\tif (!toUnmount) {\n\t\t\t\t\tinitialBase._component = null;\n\t\t\t\t\trecollectNodeTree(initialBase, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (toUnmount) {\n\t\t\tunmountComponent(toUnmount);\n\t\t}\n\n\t\tcomponent.base = base;\n\t\tif (base && !isChild) {\n\t\t\tvar componentRef = component,\n\t\t\t t = component;\n\t\t\twhile (t = t._parentComponent) {\n\t\t\t\t(componentRef = t).base = base;\n\t\t\t}\n\t\t\tbase._component = componentRef;\n\t\t\tbase._componentConstructor = componentRef.constructor;\n\t\t}\n\t}\n\n\tif (!isUpdate || mountAll) {\n\t\tmounts.push(component);\n\t} else if (!skip) {\n\n\t\tif (component.componentDidUpdate) {\n\t\t\tcomponent.componentDidUpdate(previousProps, previousState, snapshot);\n\t\t}\n\t\tif (options.afterUpdate) options.afterUpdate(component);\n\t}\n\n\twhile (component._renderCallbacks.length) {\n\t\tcomponent._renderCallbacks.pop().call(component);\n\t}if (!diffLevel && !isChild) flushMounts();\n}\n\nfunction buildComponentFromVNode(dom, vnode, context, mountAll) {\n\tvar c = dom && dom._component,\n\t originalComponent = c,\n\t oldDom = dom,\n\t isDirectOwner = c && dom._componentConstructor === vnode.nodeName,\n\t isOwner = isDirectOwner,\n\t props = getNodeProps(vnode);\n\twhile (c && !isOwner && (c = c._parentComponent)) {\n\t\tisOwner = c.constructor === vnode.nodeName;\n\t}\n\n\tif (c && isOwner && (!mountAll || c._component)) {\n\t\tsetComponentProps(c, props, 3, context, mountAll);\n\t\tdom = c.base;\n\t} else {\n\t\tif (originalComponent && !isDirectOwner) {\n\t\t\tunmountComponent(originalComponent);\n\t\t\tdom = oldDom = null;\n\t\t}\n\n\t\tc = createComponent(vnode.nodeName, props, context);\n\t\tif (dom && !c.nextBase) {\n\t\t\tc.nextBase = dom;\n\n\t\t\toldDom = null;\n\t\t}\n\t\tsetComponentProps(c, props, 1, context, mountAll);\n\t\tdom = c.base;\n\n\t\tif (oldDom && dom !== oldDom) {\n\t\t\toldDom._component = null;\n\t\t\trecollectNodeTree(oldDom, false);\n\t\t}\n\t}\n\n\treturn dom;\n}\n\nfunction unmountComponent(component) {\n\tif (options.beforeUnmount) options.beforeUnmount(component);\n\n\tvar base = component.base;\n\n\tcomponent._disable = true;\n\n\tif (component.componentWillUnmount) component.componentWillUnmount();\n\n\tcomponent.base = null;\n\n\tvar inner = component._component;\n\tif (inner) {\n\t\tunmountComponent(inner);\n\t} else if (base) {\n\t\tif (base['__preactattr_'] != null) applyRef(base['__preactattr_'].ref, null);\n\n\t\tcomponent.nextBase = base;\n\n\t\tremoveNode(base);\n\t\trecyclerComponents.push(component);\n\n\t\tremoveChildren(base);\n\t}\n\n\tapplyRef(component.__ref, null);\n}\n\nfunction Component(props, context) {\n\tthis._dirty = true;\n\n\tthis.context = context;\n\n\tthis.props = props;\n\n\tthis.state = this.state || {};\n\n\tthis._renderCallbacks = [];\n}\n\nextend(Component.prototype, {\n\tsetState: function setState(state, callback) {\n\t\tif (!this.prevState) this.prevState = this.state;\n\t\tthis.state = extend(extend({}, this.state), typeof state === 'function' ? state(this.state, this.props) : state);\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t},\n\tforceUpdate: function forceUpdate(callback) {\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\trenderComponent(this, 2);\n\t},\n\trender: function render() {}\n});\n\nfunction render(vnode, parent, merge) {\n return diff(merge, vnode, {}, false, parent, false);\n}\n\nfunction createRef() {\n\treturn {};\n}\n\nvar preact = {\n\th: h,\n\tcreateElement: h,\n\tcloneElement: cloneElement,\n\tcreateRef: createRef,\n\tComponent: Component,\n\trender: render,\n\trerender: rerender,\n\toptions: options\n};\n\nexport default preact;\nexport { h, h as createElement, cloneElement, createRef, Component, render, rerender, options };\n//# sourceMappingURL=preact.mjs.map\n","/**\n * @desc listen to one or more events on an element\n * @param {Element} el target element\n * @param {Array} eventList the events to listen to\n * @param {Function} callback\n * @param {Object} params params to pass to addEventListener\n */\nexport function listen(el, eventList, callback, params={}) {\n for (var i = 0; i < eventList.length; i++) {\n el.addEventListener(eventList[i], callback, params);\n }\n};\n\n/**\n * @desc remove an event listener on an element\n * @param {Element} el target element\n * @param {Array} eventList the events to remove\n * @param {Function} callback\n * @param {Object} params params to pass to removeEventListener\n */\nexport function unlisten(el, eventList, callback, params={}) {\n for (var i = 0; i < eventList.length; i++) {\n el.removeEventListener(eventList[i], callback, params);\n }\n};\n\n/**\n * @desc call fn callback when the page document has fully loaded\n * @param {Function} callback\n */\nexport function onDocumentReady(callback) {\n if (document.readyState !== 'loading') {\n callback();\n } else {\n listen(document, ['DOMContentLoaded'], callback);\n }\n};","import { Component } from 'preact';\nimport { listen, unlisten } from 'util/dom';\n\nconst EVENT_MOUSEDOWN = 'mousedown';\nconst EVENT_MOUSEMOVE = 'mousemove';\nconst EVENT_MOUSEUP = 'mouseup';\nconst EVENT_TOUCHSTART = 'touchstart';\nconst EVENT_TOUCHMOVE = 'touchmove';\nconst EVENT_TOUCHEND = 'touchend';\n\n/**\n * Base component class for iro UI components\n * This extends the Preact component class to allow them to react to mouse/touch input events by themselves\n */\nexport default class IroComponent extends Component {\n\n constructor(props) {\n super(props);\n // Generate unique ID for the component\n // This can be used to generate unique IDs for gradients, etc\n this.uid = (Math.random() + 1).toString(36).substring(5);\n }\n \n componentDidMount() {\n listen(this.base, [EVENT_MOUSEDOWN, EVENT_TOUCHSTART], this, { passive: false });\n }\n\n componentWillUnmount() {\n unlisten(this.base, [EVENT_MOUSEDOWN, EVENT_TOUCHSTART], this);\n }\n\n // More info on handleEvent:\n // https://medium.com/@WebReflection/dom-handleevent-a-cross-platform-standard-since-year-2000-5bf17287fd38\n // TL;DR this lets us have a single point of entry for multiple events, and we can avoid callback/binding hell\n handleEvent(e) {\n e.preventDefault();\n // Detect if the event is a touch event by checking if it has the `touches` property\n // If it is a touch event, use the first touch input\n const point = e.touches ? e.changedTouches[0] : e;\n const x = point.clientX;\n const y = point.clientY;\n // Get the screen position of the component\n const bounds = this.base.getBoundingClientRect();\n\n switch (e.type) {\n case EVENT_MOUSEDOWN:\n case EVENT_TOUCHSTART:\n listen(document, [EVENT_MOUSEMOVE, EVENT_TOUCHMOVE, EVENT_MOUSEUP, EVENT_TOUCHEND], this, { passive: false });\n this.handleInput(x, y, bounds, 'START');\n break;\n case EVENT_MOUSEMOVE:\n case EVENT_TOUCHMOVE:\n this.handleInput(x, y, bounds, 'MOVE');\n break;\n case EVENT_MOUSEUP:\n case EVENT_TOUCHEND:\n this.handleInput(x, y, bounds, 'END');\n unlisten(document, [EVENT_MOUSEMOVE, EVENT_TOUCHMOVE, EVENT_MOUSEUP, EVENT_TOUCHEND], this, { passive: false });\n break;\n }\n }\n}\n","/**\n * @desc Resolve an SVG URL\n * This is required to work around how Safari handles gradient URLS under certain conditions\n * If a page is using a client-side routing library which makes use of the HTML tag, \n * Safari won't be able to render SVG gradients properly (as they are referenced by URLs)\n * More info on the problem: \n * https://stackoverflow.com/questions/19742805/angular-and-svg-filters/19753427#19753427\n * https://github.com/jaames/iro.js/issues/18\n * https://github.com/jaames/iro.js/issues/45\n * @param {String} url resource url (should be an id selector e.g \"#example\")\n * @returns {String} resolved url\n */\nexport function resolveUrl(url) {\n // Sniff useragent string to check if the user is running Safari\n const ua = window.navigator.userAgent;\n const isSafari = /^((?!chrome|android).)*safari/i.test(ua);\n const isIos = /iPhone|iPod|iPad/i.test(ua);\n const location = window.location;\n return (isSafari || isIos) ? `${location.protocol}//${location.host}${location.pathname}${location.search}${url}` : url;\n}\n\n/**\n * @desc create the path commands to draw an svg arc\n * @param {Number} cx center point x\n * @param {Number} cy center point y\n * @param {Number} radius arc radius\n * @param {Number} startAngle arc start angle (degrees)\n * @param {Number} endAngle arc end angle (degrees)\n * @returns {String} arc path commands\n */\nexport function createArcPath(cx, cy, radius, startAngle, endAngle) {\n const largeArcFlag = endAngle - startAngle <= 180 ? 0 : 1;\n startAngle *= Math.PI / 180;\n endAngle *= Math.PI / 180;\n const x1 = cx + radius * Math.cos(endAngle);\n const y1 = cy + radius * Math.sin(endAngle);\n const x2 = cx + radius * Math.cos(startAngle);\n const y2 = cy + radius * Math.sin(startAngle);\n return `M ${x1} ${y1} A ${radius} ${radius} 0 ${largeArcFlag} 0 ${x2} ${y2}`;\n}","import { h } from 'preact';\nimport { resolveUrl } from '../util/svg';\n\nfunction IroHandle(props) {\n \n const radius = props.r;\n const url = props.url;\n\n return (\n \n {url && (\n \n )}\n {!url && (\n \n )}\n {!url && (\n \n )}\n \n );\n}\n\nIroHandle.defaultProps = {\n x: 0,\n y: 0,\n r: 8,\n url: null,\n origin: {x: 0, y: 0}\n};\n\nexport default IroHandle;","import { h } from 'preact';\n\nimport IroComponent from 'ui/component';\nimport IroHandle from 'ui/handle';\nimport { resolveUrl, createArcPath } from '../util/svg';\n\nconst HUE_STEPS = Array.apply(null, {length: 360}).map((_, index) => index);\n\nexport default class IroWheel extends IroComponent {\n\n _transformAngle(angle, handleFix) {\n const wheelAngle = this.props.wheelAngle;\n if (this.props.wheelDirection === 'clockwise') {\n // im sure this math could be simplified...\n angle = (-360 + angle - (handleFix ? -wheelAngle : wheelAngle));\n } else {\n angle = wheelAngle - angle\n }\n // javascript's modulo operator doesn't produce positive numbers with negative input\n // https://dev.to/maurobringolf/a-neat-trick-to-compute-modulo-of-negative-numbers-111e\n return (angle % 360 + 360) % 360;\n }\n\n render(props) {\n let { width, borderWidth, handleRadius } = props;\n const hsv = props.color.hsv;\n const radius = (width / 2) - borderWidth;\n const handleAngle = this._transformAngle(hsv.h, true) * (Math.PI / 180);\n const handleDist = (hsv.s / 100) * (radius - props.padding - handleRadius - borderWidth);\n const cX = radius + borderWidth;\n const cY = radius + borderWidth;\n \n return (\n \n \n \n \n \n \n \n \n { HUE_STEPS.map(angle => (\n \n ))}\n \n \n { props.wheelLightness && (\n \n )}\n \n \n \n );\n }\n\n /**\n * @desc handles mouse input for this component\n * @param {Number} x - point x coordinate\n * @param {Number} y - point y coordinate\n * @param {DOMRect} rect - bounding client rect for the component's base element\n * @param {String} type - input type: \"START\", \"MOVE\" or \"END\"\n */\n handleInput(x, y, { left, top }, type) {\n const props = this.props;\n const radius = props.width / 2;\n const handleRange = (radius - props.padding - props.handleRadius - props.borderWidth);\n const cX = radius;\n const cY = radius;\n\n x = cX - (x - left);\n y = cY - (y - top);\n\n let handleAngle = Math.atan2(y, x);\n // Calculate the hue by converting the angle to radians\n let hue = this._transformAngle(Math.round(handleAngle * (180 / Math.PI)) + 180);\n // Find the point's distance from the center of the wheel\n // This is used to show the saturation level\n let handleDist = Math.min(Math.sqrt(x * x + y * y), handleRange);\n props.onInput(type, {\n h: hue,\n s: Math.round((100 / handleRange) * handleDist)\n });\n }\n}","/**\n * @desc Parse a css unit string - either regular int or a percentage number\n * @param {String} str input string\n * @param {String} max max number for converting percentages\n * @returns {Number} \n */\nexport function parseUnit(str, max) {\n const isPercentage = str.indexOf('%') > -1;\n const num = parseFloat(str);\n return isPercentage ? (max / 100) * num : num;\n}\n\n/**\n * @desc Parse hex str to an int\n * @param {String} str input string\n * @returns {Number} \n */\nexport function parseHexInt(str) {\n return parseInt(str, 16);\n}\n\n/**\n * @desc Convert into to 2-digit hex\n * @param {Number} int input number\n * @returns {String} \n */\nexport function intToHex(int) {\n return int.toString(16).padStart(2, '0');\n}","import { parseUnit, parseHexInt, intToHex } from './util/colorUtils';\n\n// Some regular expressions for rgb() and hsl() Colors are borrowed from tinyColor\n// https://github.com/bgrins/TinyColor\n\n// https://www.w3.org/TR/css3-values/#integers\nconst CSS_INTEGER = `[-\\\\+]?\\\\d+%?`;\n// http://www.w3.org/TR/css3-values/#number-value\nconst CSS_NUMBER = `[-\\\\+]?\\\\d*\\\\.\\\\d+%?`;\n// Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome\nconst CSS_UNIT = `(?:${ CSS_NUMBER })|(?:${ CSS_INTEGER })`;\n\n// Parse function params\n// Parens and commas are optional, and this also allows for whitespace between numbers\nconst PERMISSIVE_MATCH_3 = `[\\\\s|\\\\(]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })\\\\s*\\\\)?`;\nconst PERMISSIVE_MATCH_4 = `[\\\\s|\\\\(]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })\\\\s*\\\\)?`;\n\n// Regex patterns for functional colors\nconst REGEX_FUNCTIONAL_RGB = new RegExp(`rgb${ PERMISSIVE_MATCH_3 }`);\nconst REGEX_FUNCTIONAL_RGBA = new RegExp(`rgba${ PERMISSIVE_MATCH_4 }`);\nconst REGEX_FUNCTIONAL_HSL = new RegExp(`hsl${ PERMISSIVE_MATCH_3 }`);\nconst REGEX_FUNCTIONAL_HSLA = new RegExp(`hsla${ PERMISSIVE_MATCH_4 }`);\n\nconst HEX_START = `^(?:#?|0x?)`;\nconst HEX_INT_SINGLE = `([0-9a-fA-F]{1})`;\nconst HEX_INT_DOUBLE = `([0-9a-fA-F]{2})`;\nconst REGEX_HEX_3 = new RegExp(`${ HEX_START }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }$`);\nconst REGEX_HEX_4 = new RegExp(`${ HEX_START }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }$`);\nconst REGEX_HEX_6 = new RegExp(`${ HEX_START }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }$`);\nconst REGEX_HEX_8 = new RegExp(`${ HEX_START }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }$`);\n\nexport default class Color {\n /**\n * @constructor Color object\n * @param {Object | String | Color} value - Color instance, object (hsv, hsl or rgb), string (hsl, rgb, hex)\n */\n constructor(value) {\n // The watch callback function for this Color will be stored here\n this._onChange = false;\n // The default Color value\n this._value = {h: 0, s: 0, v: 0, a: 1};\n if (value) this.set(value);\n }\n\n /**\n * @desc set the Color from any valid value\n * @param {Object | String | Color} value - Color instance, object (hsv, hsl or rgb), string (hsl, rgb, hex)\n */\n set(value) {\n const isString = typeof value === 'string';\n const isObject = typeof value === 'object';\n if ((isString) && (/^(?:#?|0x?)[0-9a-fA-F]{3,8}$/.test(value))) {\n this.hexString = value;\n }\n else if ((isString) && (/^rgba?/.test(value))) {\n this.rgbString = value;\n }\n else if ((isString) && (/^hsla?/.test(value))) {\n this.hslString = value;\n }\n else if ((isObject) && (value instanceof Color)) {\n this.hsv = value.hsv;\n }\n else if ((isObject) && ('r' in value) && ('g' in value) && ('b' in value)) {\n this.rgb = value;\n }\n else if ((isObject) && ('h' in value) && ('s' in value) && ('v' in value)) {\n this.hsv = value;\n }\n else if ((isObject) && ('h' in value) && ('s' in value) && ('l' in value)) {\n this.hsl = value;\n }\n else {\n throw new Error('invalid color value');\n }\n }\n\n /**\n * @desc shortcut to set a specific channel value\n * @param {String} format - hsv | hsl | rgb\n * @param {String} channel - individual channel to set, for example if model = hsl, chanel = h | s | l\n * @param {Number} value - new value for the channel\n */\n setChannel(format, channel, value) {\n this[format] = {...this[format], [channel]: value};\n }\n\n /**\n * @desc make new Color instance with the same value as this one\n * @return {Color}\n */\n clone() {\n return new Color(this);\n }\n\n /**\n * @desc convert hsv object to rgb\n * @param {Object} hsv hsv object\n * @return {Object} rgb object\n */\n static hsvToRgb(hsv) {\n const h = hsv.h / 60;\n const s = hsv.s / 100;\n const v = hsv.v / 100;\n const i = Math.floor(h);\n const f = h - i;\n const p = v * (1 - s);\n const q = v * (1 - f * s);\n const t = v * (1 - (1 - f) * s);\n const mod = i % 6;\n const r = [v, q, p, p, t, v][mod];\n const g = [t, v, v, q, p, p][mod];\n const b = [p, p, t, v, v, q][mod];\n return {\n r: r * 255, \n g: g * 255, \n b: b * 255\n };\n }\n\n /**\n * @desc convert rgb object to hsv\n * @param {Object} rgb - rgb object\n * @return {Object} hsv object\n */\n static rgbToHsv(rgb) {\n const r = rgb.r / 255;\n const g = rgb.g / 255;\n const b = rgb.b / 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const delta = max - min;\n let hue;\n let value = max;\n let saturation = max === 0 ? 0 : delta / max;\n switch (max) {\n case min: \n hue = 0; // achromatic\n break;\n case r: \n hue = (g - b) / delta + (g < b ? 6 : 0);\n break;\n case g: \n hue = (b - r) / delta + 2;\n break;\n case b:\n hue = (r - g) / delta + 4;\n break;\n }\n return {\n h: hue * 60,\n s: saturation * 100,\n v: value * 100\n }\n }\n\n /**\n * @desc convert hsv object to hsl\n * @param {Object} hsv - hsv object\n * @return {Object} hsl object\n */\n static hsvToHsl(hsv) {\n const s = hsv.s / 100;\n const v = hsv.v / 100;\n const l = (2 - s) * v;\n const divisor = l <= 1 ? l : (2 - l);\n // Avoid division by zero when lightness is close to zero\n const saturation = divisor < 1e-9 ? 0 : (s * v) / divisor;\n return {\n h: hsv.h,\n s: saturation * 100,\n l: l * 50\n };\n }\n\n /**\n * @desc convert hsl object to hsv\n * @param {Object} hsl - hsl object\n * @return {Object} hsv object\n */\n static hslToHsv(hsl) {\n const l = hsl.l * 2;\n const s = (hsl.s * ((l <= 100) ? l : 200 - l)) / 100;\n // Avoid division by zero when l + s is near 0\n const saturation = (l + s < 1e-9) ? 0 : (2 * s) / (l + s);\n return {\n h: hsl.h,\n s: saturation * 100,\n v: (l + s) / 2\n };\n }\n\n get hsv() {\n // _value is cloned to allow changes to be made to the values before passing them back\n const value = this._value;\n return {h: value.h, s: value.s, v: value.v};\n }\n\n set hsv(newValue) {\n const oldValue = this._value;\n newValue = { ...oldValue, ...newValue };\n // If this Color is being watched for changes we need to compare the new and old values to check the difference\n // Otherwise we can just be lazy\n if (this._onChange) {\n // Compute changed values\n let changes = {};\n for (let key in oldValue) {\n changes[key] = newValue[key] != oldValue[key]\n };\n // Update the old value\n this._value = newValue;\n // If the value has changed, call hook callback\n if (changes.h || changes.s || changes.v || changes.a) this._onChange(this, changes);\n } else {\n this._value = newValue;\n }\n }\n\n get rgb() {\n const {r, g, b} = Color.hsvToRgb(this._value);\n return {\n r: Math.round(r),\n g: Math.round(g),\n b: Math.round(b),\n };\n }\n\n set rgb(value) {\n this.hsv = {...Color.rgbToHsv(value), a: (value.a === undefined) ? 1 : value.a};\n }\n\n get hsl() {\n const {h, s, l} = Color.hsvToHsl(this._value);\n return {\n h: Math.round(h),\n s: Math.round(s),\n l: Math.round(l),\n };\n }\n\n set hsl(value) {\n this.hsv = {...Color.hslToHsv(value), a: (value.a === undefined) ? 1 : value.a};\n }\n\n get rgbString() {\n const rgb = this.rgb;\n return `rgb(${rgb.r}, ${rgb.g}, ${rgb.b})`;\n }\n\n set rgbString(value) {\n let match;\n let r, g, b, a = 1;\n if (match = REGEX_FUNCTIONAL_RGB.exec(value)) {\n r = parseUnit(match[1], 255);\n g = parseUnit(match[2], 255);\n b = parseUnit(match[3], 255);\n }\n else if (match = REGEX_FUNCTIONAL_RGBA.exec(value)) {\n r = parseUnit(match[1], 255);\n g = parseUnit(match[2], 255);\n b = parseUnit(match[3], 255);\n a = parseUnit(match[4], 1);\n }\n if (match) {\n this.rgb = {r, g, b, a};\n } \n else {\n throw new Error('invalid rgb string');\n }\n }\n\n get hexString() {\n const rgb = this.rgb;\n return `#${ intToHex(rgb.r) }${ intToHex(rgb.g) }${ intToHex(rgb.b) }`;\n }\n\n set hexString(value) {\n let match;\n let r, g, b, a = 255;\n if (match = REGEX_HEX_3.exec(value)) {\n r = parseHexInt(match[1]) * 17;\n g = parseHexInt(match[2]) * 17;\n b = parseHexInt(match[3]) * 17;\n }\n else if (match = REGEX_HEX_4.exec(value)) {\n r = parseHexInt(match[1]) * 17;\n g = parseHexInt(match[2]) * 17;\n b = parseHexInt(match[3]) * 17;\n a = parseHexInt(match[4]) * 17;\n }\n else if (match = REGEX_HEX_6.exec(value)) {\n r = parseHexInt(match[1]);\n g = parseHexInt(match[2]);\n b = parseHexInt(match[3]);\n }\n else if (match = REGEX_HEX_8.exec(value)) {\n r = parseHexInt(match[1]);\n g = parseHexInt(match[2]);\n b = parseHexInt(match[3]);\n a = parseHexInt(match[4]);\n }\n if (match) {\n this.rgb = {r, g, b, a: a / 255};\n }\n else {\n throw new Error('invalid hex string');\n }\n }\n\n get hslString() {\n const hsl = this.hsl;\n return `hsl(${hsl.h}, ${hsl.s}%, ${hsl.l}%)`;\n }\n\n set hslString(value) {\n let match;\n let h, s, l, a = 1;\n if (match = REGEX_FUNCTIONAL_HSL.exec(value)) {\n h = parseUnit(match[1], 360);\n s = parseUnit(match[2], 100);\n l = parseUnit(match[3], 100);\n }\n else if (match = REGEX_FUNCTIONAL_HSLA.exec(value)) {\n h = parseUnit(match[1], 360);\n s = parseUnit(match[2], 100);\n l = parseUnit(match[3], 100);\n a = parseUnit(match[4], 1);\n }\n if (match) {\n this.hsl = {h, s, l, a};\n } \n else {\n throw new Error('invalid hsl string');\n }\n }\n}","import { h } from 'preact';\n\nimport IroComponent from 'ui/component';\nimport IroHandle from 'ui/handle';\nimport IroColor from '../color';\nimport { resolveUrl } from '../util/svg';\n\nexport default class IroSlider extends IroComponent {\n\n renderGradient(props) {\n const hsv = props.color.hsv;\n let stops = [];\n\n switch (props.sliderType) {\n case 'hue':\n stops = [\n {offset: '0', color: '#f00'},\n {offset: '16.666', color: '#ff0'},\n {offset: '33.333', color: '#0f0'},\n {offset: '50', color: '#0ff'},\n {offset: '66.666', color: '#00f'},\n {offset: '83.333', color: '#f0f'},\n {offset: '100', color: '#f00'},\n ];\n break;\n case 'saturation':\n var noSat = IroColor.hsvToHsl({h: hsv.h, s: 0, v: hsv.v});\n var fullSat = IroColor.hsvToHsl({h: hsv.h, s: 100, v: hsv.v});\n stops = [\n {offset: '0', color: `hsl(${noSat.h}, ${noSat.s}%, ${noSat.l}%)`},\n {offset: '100', color: `hsl(${fullSat.h}, ${fullSat.s}%, ${fullSat.l}%)`}\n ];\n break;\n case 'value':\n default:\n var hsl = IroColor.hsvToHsl({h: hsv.h, s: hsv.s, v: 100});\n stops = [\n {offset: '0', color: '#000'},\n {offset: '100', color: `hsl(${hsl.h}, ${hsl.s}%, ${hsl.l}%)`}\n ];\n break;\n }\n\n return (\n \n {stops.map(stop => (\n \n ))}\n \n )\n }\n\n render(props) {\n let { width, sliderHeight, borderWidth, handleRadius } = props;\n sliderHeight = sliderHeight ? sliderHeight : props.padding * 2 + handleRadius * 2 + borderWidth * 2;\n this.width = width;\n this.height = sliderHeight;\n const cornerRadius = sliderHeight / 2;\n const range = width - cornerRadius * 2\n const hsv = props.color.hsv;\n \n let sliderValue;\n switch (props.sliderType) {\n case 'hue':\n sliderValue = hsv.h /= 3.6;\n break;\n case 'saturation':\n sliderValue = hsv.s;\n break;\n case 'value':\n default:\n sliderValue = hsv.v;\n break;\n }\n\n return (\n \n \n { this.renderGradient(props) }\n \n \n \n \n );\n }\n\n getValueFromPoint(x, y, { left }) {\n const handleRange = this.width - this.height;\n const cornerRadius = this.height / 2;\n x = x - (left + cornerRadius);\n let dist = Math.max(Math.min(x, handleRange), 0);\n return Math.round((100 / handleRange) * dist);\n }\n\n /**\n * @desc handles mouse input for this component\n * @param {Number} x - point x coordinate\n * @param {Number} y - point y coordinate\n * @param {DOMRect} rect - bounding client rect for the component's base element\n * @param {String} type - input type: \"START\", \"MOVE\" or \"END\"\n */\n handleInput(x, y, bounds, type) {\n let value = this.getValueFromPoint(x, y, bounds);\n let channel;\n switch (this.props.sliderType) {\n case 'hue':\n channel = 'h';\n value *= 3.6;\n break;\n case 'saturation':\n channel = 's';\n break;\n case 'value':\n default:\n channel = 'v';\n break;\n }\n this.props.onInput(type, {\n [channel]: value\n });\n }\n}","import { h, render } from 'preact';\nimport { onDocumentReady } from './dom';\n\n/**\n * @desc Turn a component into a widget\n * This returns a factory function that can be used to create an instance of the widget component\n * The first function param is a DOM element or CSS selector for the element to mount to,\n * The second param is for config options which are passed to the component as props\n * This factory function can also delay mounting the element into the DOM until the page is ready\n * @param {Component} widgetComonpent ui component to turn into a widget\n * @returns {Function} widget factory\n */\nexport function createWidget(widgetComponent) {\n\n const widgetFactory = function (parent, props) {\n let widget = null; // will become an instance of the widget component class\n let widgetRoot = document.createElement('div');\n\n // Render widget into a temp DOM node\n render(\n h(widgetComponent, {\n ref: ref => widget = ref,\n ...props,\n }),\n widgetRoot\n );\n // Mount it into the DOM when the page document is ready\n onDocumentReady(() => {\n const container = parent instanceof Element ? parent : document.querySelector(parent);\n container.appendChild(widget.base);\n widget.onMount(container);\n });\n\n return widget;\n }\n\n // Allow the widget factory to inherit component prototype + static class methods\n // This makes it easier for plugin authors to extend the base widget component\n widgetFactory.prototype = widgetComponent.prototype;\n Object.assign(widgetFactory, widgetComponent);\n // Add reference to base component too\n widgetFactory.__component = widgetComponent; \n\n return widgetFactory;\n\n}","import { h, Component } from 'preact';\n\nimport IroWheel from 'ui/wheel';\nimport IroSlider from 'ui/slider';\nimport IroColor from './color';\nimport { createWidget } from 'util/createWidget';\n\nclass ColorPicker extends Component {\n constructor(props) {\n super(props);\n this.emitHook('init:before');\n this._events = {};\n this._deferredEvents = {};\n this._colorUpdateActive = false;\n this._colorUpdateSrc = null;\n this.color = new IroColor(props.color);\n this.deferredEmit('color:init', this.color, { h: false, s: false, v: false, a: false });\n // Whenever the color changes, update the color wheel\n this.color._onChange = this.updateColor.bind(this);\n this.state = {\n ...props,\n color: this.color,\n };\n this.emitHook('init:state');\n\n if (props.layout) {\n this.layout = props.layout;\n } else {\n this.layout = [\n {component: IroWheel, options: {}},\n {component: IroSlider, options: {}},\n ];\n }\n this.emitHook('init:after');\n }\n\n // Public ColorPicker events API\n\n /**\n * @desc Set a callback function for an event\n * @param {String | Array} eventList event(s) to listen to\n * @param {Function} callback\n */\n on(eventList, callback) {\n const events = this._events;\n // eventList can be an eventType string or an array of eventType strings\n (!Array.isArray(eventList) ? [eventList] : eventList).forEach(eventType => {\n // Emit plugin hook\n this.emitHook('event:on', eventType, callback);\n // Add event callback\n (events[eventType] || (events[eventType] = [])).push(callback);\n // Call deferred events\n // These are events that can be stored until a listener for them is added\n if (this._deferredEvents[eventType]) {\n // Deffered events store an array of arguments from when the event was called\n this._deferredEvents[eventType].forEach(args => {\n callback.apply(null, args); \n });\n // Clear deferred events\n this._deferredEvents[eventType] = [];\n }\n });\n }\n\n /**\n * @desc Remove a callback function for an event added with on()\n * @param {String | Array} eventList The name of the event\n * @param {Function} callback\n */\n off(eventList, callback) {\n (!Array.isArray(eventList) ? [eventList] : eventList).forEach(eventType => {\n const callbackList = this._events[eventType];\n this.emitHook('event:off', eventType, callback);\n if (callbackList) callbackList.splice(callbackList.indexOf(callback), 1);\n });\n }\n\n /**\n * @desc Emit an event\n * @param {String} eventType The name of the event to emit\n * @param {Array} args array of args to pass to callbacks\n */\n emit(eventType, ...args) {\n // Events are plugin hooks too\n this.emitHook(eventType, ...args);\n const callbackList = this._events[eventType] || [];\n for (let i = 0; i < callbackList.length; i++) {\n callbackList[i].apply(null, args); \n }\n }\n\n /**\n * @desc Emit an event now, or save it for when the relevent event listener is added\n * @param {String} eventType The name of the event to emit\n * @param {Array} args array of args to pass to callbacks\n */\n deferredEmit(eventType, ...args) {\n const deferredEvents = this._deferredEvents;\n this.emit(eventType, ...args);\n (deferredEvents[eventType] || (deferredEvents[eventType] = [])).push(args);\n }\n\n // Public utility methods\n\n /**\n * @desc Resize the color picker\n * @param {Number} width\n */\n resize(width) {\n this.setState({width});\n }\n\n /**\n * @desc Reset the color picker to the initial color provided in the color picker options\n */\n reset() {\n this.color.set(this.props.color);\n }\n\n // Plugin hooks API\n\n /**\n * @desc Set a callback function for a hook\n * @param {String} hookType The name of the hook to listen to\n * @param {Function} callback\n */\n static addHook(hookType, callback) {\n const pluginHooks = ColorPicker.pluginHooks;\n (pluginHooks[hookType] || (pluginHooks[hookType] = [])).push(callback);\n }\n\n /**\n * @desc Emit a callback hook\n * @access private\n * @param {String} hookType The type of hook event to emit\n */\n emitHook(hookType, ...args) {\n const callbackList = ColorPicker.pluginHooks[hookType] || [];\n for (let i = 0; i < callbackList.length; i++) {\n callbackList[i].apply(this, args); \n }\n }\n\n // Internal methods\n\n /**\n * @desc Called by the createWidget wrapper when the element is mounted into the page\n * @access private\n * @param {Element} container the container element for this ColorPicker instance\n */\n onMount(container) {\n this.el = container;\n this.deferredEmit('mount', this);\n }\n\n /**\n * @desc React to a color update\n * @access private\n * @param {IroColor} color current color\n * @param {Object} changes shows which h,s,v color channels changed\n */\n updateColor(color, changes) {\n this.emitHook('color:beforeUpdate', color, changes);\n this.setState({ color: color });\n this.emitHook('color:afterUpdate', color, changes);\n // Prevent infinite loops if the color is set inside a color:change or input:change callback\n if (!this._colorUpdateActive) {\n // While _colorUpdateActive == true, branch cannot be entered\n this._colorUpdateActive = true;\n // If the color change originates from user input, fire input:change\n if (this._colorUpdateSrc == 'input') { // colorUpdateSrc is cleared in handeInput()\n this.emit('input:change', color, changes);\n } \n // Always fire color:change event\n this.emit('color:change', color, changes);\n this._colorUpdateActive = false;\n }\n }\n\n /**\n * @desc Handle input from a UI control element\n * @access private\n * @param {String} type \"START\" | \"MOVE\" | \"END\"\n * @param {Object} hsv new hsv values for the color\n */\n handleInput(type, hsv) {\n // Fire input start and move events before color update\n if (type === 'START') this.emit('input:start', this.color);\n if (type === 'MOVE') this.emit('input:move', this.color);\n // Set the color update source\n this._colorUpdateSrc = 'input';\n // Setting the color HSV here will automatically update the UI\n // Since we bound the color's _onChange callback\n this.color.hsv = hsv;\n // Fire input end event after color update\n if (type === 'END') this.emit('input:end', this.color);\n // Reset color update source so it doesn't interfere with future color updates\n // Super important to do this here and not in updateColor()\n this._colorUpdateSrc = null;\n }\n\n render(props, state) {\n return (\n
\n {this.layout.map(({component: UiComponent, options: options}) => (\n this.handleInput(type, hsv) }\n parent={ this }\n />\n ))}\n
\n )\n }\n}\n\nColorPicker.pluginHooks = {};\n\nColorPicker.defaultProps = {\n width: 300,\n height: 300,\n handleRadius: 8,\n handleSvg: null,\n handleOrigin: {x: 0, y: 0},\n color: '#fff',\n borderColor: '#fff',\n borderWidth: 0,\n display: 'block',\n wheelLightness: true,\n wheelAngle: 0,\n wheelDirection: 'anticlockwise',\n sliderHeight: null,\n sliderMargin: 12,\n padding: 6,\n layout: null,\n}\n\nexport default createWidget(ColorPicker);\n","/**\n * iro.js plugins API\n * This provides the iro.use method, which can be used to register plugins which extend the iro.js core\n */\nexport function usePlugins(core) {\n const installedPlugins = [];\n \n /**\n * @desc Register iro.js plugin\n * @param {Function} plugin = plugin constructor\n * @param {Object} pluginOptions = plugin options passed to constructor\n */\n core.use = function(plugin, pluginOptions = {}) {\n // Check that the plugin hasn't already been registered\n if (!(installedPlugins.indexOf(plugin) > -1)) {\n // Init plugin\n // TODO: consider collection of plugin utils, which are passed as a thrid param\n plugin(core, pluginOptions);\n // Register plugin\n installedPlugins.push(plugin);\n }\n }\n\n core.installedPlugins = installedPlugins;\n\n return core;\n}","import { h } from 'preact';\n\nimport ColorPicker from './colorPicker';\nimport Color from './color';\n\nimport Component from 'ui/component';\nimport Handle from 'ui/handle';\nimport Slider from 'ui/slider';\nimport Wheel from 'ui/wheel';\nimport { usePlugins } from 'util/usePlugins';\nimport { resolveUrl, createArcPath } from 'util/svg';\nimport { parseUnit, parseHexInt, intToHex } from 'util/colorUtils';\n\nexport default usePlugins({\n Color,\n ColorPicker,\n ui: {\n h,\n Component,\n Handle,\n Slider,\n Wheel,\n },\n util: {\n resolveUrl, \n createArcPath,\n parseUnit,\n parseHexInt,\n intToHex\n },\n version: VERSION,\n});\n"],"names":["arguments","const","super","this","let","IroColor","options","ColorPicker","Component","Handle","Slider","Wheel"],"mappings":";;;;;;;AAAA,IAAI,KAAK,GAAG,SAAS,KAAK,GAAG,EAAE,CAAC;;AAEhC,IAAI,OAAO,GAAG,EAAE,CAAC;;AAEjB,IAAI,KAAK,GAAG,EAAE,CAAC;;AAEf,IAAI,cAAc,GAAG,EAAE,CAAC;;AAExB,SAAS,CAAC,CAAC,QAAQ,EAAE,UAAU,EAAE;;;CAChC,IAAI,QAAQ,GAAG,cAAc;KACzB,UAAU;KACV,KAAK;KACL,MAAM;KACN,CAAC,CAAC;CACN,KAAK,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG;EACpC,KAAK,CAAC,IAAI,CAACA,WAAS,CAAC,CAAC,CAAC,CAAC,CAAC;EACzB;CACD,IAAI,UAAU,IAAI,UAAU,CAAC,QAAQ,IAAI,IAAI,EAAE;EAC9C,IAAI,CAAC,KAAK,CAAC,MAAM,IAAE,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAC;EACnD,OAAO,UAAU,CAAC,QAAQ,CAAC;EAC3B;CACD,OAAO,KAAK,CAAC,MAAM,EAAE;EACpB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,EAAE,KAAK,KAAK,CAAC,GAAG,KAAK,SAAS,EAAE;GACrD,KAAK,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG;IAC5B,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACrB;GACD,MAAM;GACN,IAAI,OAAO,KAAK,KAAK,SAAS,IAAE,KAAK,GAAG,IAAI,GAAC;;GAE7C,IAAI,MAAM,GAAG,OAAO,QAAQ,KAAK,UAAU,EAAE;IAC5C,IAAI,KAAK,IAAI,IAAI,IAAE,KAAK,GAAG,E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;IAE1C,IAAI,EAAE,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;;;MAG5C,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;;MAE5B,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAC/B;IACF;;EAED,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;;EAEzC,OAAO,IAAI,CAAC;;;ACZd,UAAe,UAAU,CAAC;SACxB,KAAK;eACLM,aAAW;EACX,EAAE,EAAE;OACF,CAAC;eACDC,YAAS;YACTC,SAAM;YACNC,SAAM;WACNC,QAAK;GACN;EACD,IAAI,EAAE;gBACJ,UAAU;mBACV,aAAa;eACb,SAAS;iBACT,WAAW;cACX,QAAQ;GACT;EACD,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC;;;;"} \ No newline at end of file diff --git a/dist/iro.js b/dist/iro.js index 8687b6e..422343b 100644 --- a/dist/iro.js +++ b/dist/iro.js @@ -1,5 +1,5 @@ /*! - * iro.js v4.3.3 + * iro.js v4.4.0 * 2016-2019 James Daniel * Licensed under MPL 2.0 * github.com/jaames/iro.js @@ -782,7 +782,7 @@ }; // More info on handleEvent: - // http://download-cdn.miitomo.com/native/20180125111639/manifests/v2_20180405_3_android/manifest.json + // https://medium.com/@WebReflection/dom-handleevent-a-cross-platform-standard-since-year-2000-5bf17287fd38 // TL;DR this lets us have a single point of entry for multiple events, and we can avoid callback/binding hell IroComponent.prototype.handleEvent = function handleEvent (e) { e.preventDefault(); @@ -886,6 +886,8 @@ origin: {x: 0, y: 0} }; + var HUE_STEPS = Array.apply(null, {length: 360}).map(function (_, index) { return index; }); + var IroWheel = /*@__PURE__*/(function (IroComponent$$1) { function IroWheel () { IroComponent$$1.apply(this, arguments); @@ -895,13 +897,28 @@ IroWheel.prototype = Object.create( IroComponent$$1 && IroComponent$$1.prototype ); IroWheel.prototype.constructor = IroWheel; + IroWheel.prototype._transformAngle = function _transformAngle (angle, handleFix) { + var wheelAngle = this.props.wheelAngle; + if (this.props.wheelDirection === 'clockwise') { + // im sure this math could be simplified... + angle = (-360 + angle - (handleFix ? -wheelAngle : wheelAngle)); + } else { + angle = wheelAngle - angle; + } + // javascript's modulo operator doesn't produce positive numbers with negative input + // https://dev.to/maurobringolf/a-neat-trick-to-compute-modulo-of-negative-numbers-111e + return (angle % 360 + 360) % 360; + }; + IroWheel.prototype.render = function render$$1 (props) { + var this$1 = this; + var width = props.width; var borderWidth = props.borderWidth; var handleRadius = props.handleRadius; var hsv = props.color.hsv; var radius = (width / 2) - borderWidth; - var handleAngle = (360 - hsv.h) * (Math.PI / 180); + var handleAngle = this._transformAngle(hsv.h, true) * (Math.PI / 180); var handleDist = (hsv.s / 100) * (radius - props.padding - handleRadius - borderWidth); var cX = radius + borderWidth; var cY = radius + borderWidth; @@ -919,9 +936,9 @@ ) ), h( 'g', { class: "iro__wheel__hue", 'stroke-width': radius, fill: "none" }, - Array.apply(null, { length: 360 }).map(function (_, hue) { return ( + HUE_STEPS.map(function (angle) { return ( h( 'path', { - key: hue, d: createArcPath(cX, cY, radius / 2, hue, hue + 1.5), stroke: ("hsl(" + (360 - hue) + ", 100%, 50%)") }) + key: angle, d: createArcPath(cX, cY, radius / 2, angle, angle + 1.5), stroke: ("hsl(" + (this$1._transformAngle(angle)) + ", 100%, 50%)") }) ); }) ), h( 'circle', { @@ -960,7 +977,7 @@ var handleAngle = Math.atan2(y, x); // Calculate the hue by converting the angle to radians - var hue = 360 - (Math.round(handleAngle * (180 / Math.PI)) + 180); + var hue = this._transformAngle(Math.round(handleAngle * (180 / Math.PI)) + 180); // Find the point's distance from the center of the wheel // This is used to show the saturation level var handleDist = Math.min(Math.sqrt(x * x + y * y), handleRange); @@ -1769,6 +1786,8 @@ borderWidth: 0, display: 'block', wheelLightness: true, + wheelAngle: 0, + wheelDirection: 'anticlockwise', sliderHeight: null, sliderMargin: 12, padding: 6, @@ -1824,7 +1843,7 @@ parseHexInt: parseHexInt, intToHex: intToHex }, - version: "4.3.3", + version: "4.4.0", }); return iro; diff --git a/dist/iro.js.map b/dist/iro.js.map index ff62137..3f060df 100644 --- a/dist/iro.js.map +++ b/dist/iro.js.map @@ -1 +1 @@ -{"version":3,"file":"iro.js.map","sources":["../node_modules/preact/dist/preact.mjs","../src/util/dom.js","../src/ui/component.js","../src/util/svg.js","../src/ui/handle.jsx","../src/ui/wheel.jsx","../src/util/colorUtils.js","../src/color.js","../src/ui/slider.jsx","../src/util/createWidget.js","../src/colorPicker.js","../src/util/usePlugins.js","../src/iro.js"],"sourcesContent":["var VNode = function VNode() {};\n\nvar options = {};\n\nvar stack = [];\n\nvar EMPTY_CHILDREN = [];\n\nfunction h(nodeName, attributes) {\n\tvar children = EMPTY_CHILDREN,\n\t lastSimple,\n\t child,\n\t simple,\n\t i;\n\tfor (i = arguments.length; i-- > 2;) {\n\t\tstack.push(arguments[i]);\n\t}\n\tif (attributes && attributes.children != null) {\n\t\tif (!stack.length) stack.push(attributes.children);\n\t\tdelete attributes.children;\n\t}\n\twhile (stack.length) {\n\t\tif ((child = stack.pop()) && child.pop !== undefined) {\n\t\t\tfor (i = child.length; i--;) {\n\t\t\t\tstack.push(child[i]);\n\t\t\t}\n\t\t} else {\n\t\t\tif (typeof child === 'boolean') child = null;\n\n\t\t\tif (simple = typeof nodeName !== 'function') {\n\t\t\t\tif (child == null) child = '';else if (typeof child === 'number') child = String(child);else if (typeof child !== 'string') simple = false;\n\t\t\t}\n\n\t\t\tif (simple && lastSimple) {\n\t\t\t\tchildren[children.length - 1] += child;\n\t\t\t} else if (children === EMPTY_CHILDREN) {\n\t\t\t\tchildren = [child];\n\t\t\t} else {\n\t\t\t\tchildren.push(child);\n\t\t\t}\n\n\t\t\tlastSimple = simple;\n\t\t}\n\t}\n\n\tvar p = new VNode();\n\tp.nodeName = nodeName;\n\tp.children = children;\n\tp.attributes = attributes == null ? undefined : attributes;\n\tp.key = attributes == null ? undefined : attributes.key;\n\n\tif (options.vnode !== undefined) options.vnode(p);\n\n\treturn p;\n}\n\nfunction extend(obj, props) {\n for (var i in props) {\n obj[i] = props[i];\n }return obj;\n}\n\nfunction applyRef(ref, value) {\n if (ref != null) {\n if (typeof ref == 'function') ref(value);else ref.current = value;\n }\n}\n\nvar defer = typeof Promise == 'function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;\n\nfunction cloneElement(vnode, props) {\n return h(vnode.nodeName, extend(extend({}, vnode.attributes), props), arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children);\n}\n\nvar IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\n\nvar items = [];\n\nfunction enqueueRender(component) {\n\tif (!component._dirty && (component._dirty = true) && items.push(component) == 1) {\n\t\t(options.debounceRendering || defer)(rerender);\n\t}\n}\n\nfunction rerender() {\n\tvar p;\n\twhile (p = items.pop()) {\n\t\tif (p._dirty) renderComponent(p);\n\t}\n}\n\nfunction isSameNodeType(node, vnode, hydrating) {\n\tif (typeof vnode === 'string' || typeof vnode === 'number') {\n\t\treturn node.splitText !== undefined;\n\t}\n\tif (typeof vnode.nodeName === 'string') {\n\t\treturn !node._componentConstructor && isNamedNode(node, vnode.nodeName);\n\t}\n\treturn hydrating || node._componentConstructor === vnode.nodeName;\n}\n\nfunction isNamedNode(node, nodeName) {\n\treturn node.normalizedNodeName === nodeName || node.nodeName.toLowerCase() === nodeName.toLowerCase();\n}\n\nfunction getNodeProps(vnode) {\n\tvar props = extend({}, vnode.attributes);\n\tprops.children = vnode.children;\n\n\tvar defaultProps = vnode.nodeName.defaultProps;\n\tif (defaultProps !== undefined) {\n\t\tfor (var i in defaultProps) {\n\t\t\tif (props[i] === undefined) {\n\t\t\t\tprops[i] = defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn props;\n}\n\nfunction createNode(nodeName, isSvg) {\n\tvar node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName);\n\tnode.normalizedNodeName = nodeName;\n\treturn node;\n}\n\nfunction removeNode(node) {\n\tvar parentNode = node.parentNode;\n\tif (parentNode) parentNode.removeChild(node);\n}\n\nfunction setAccessor(node, name, old, value, isSvg) {\n\tif (name === 'className') name = 'class';\n\n\tif (name === 'key') {} else if (name === 'ref') {\n\t\tapplyRef(old, null);\n\t\tapplyRef(value, node);\n\t} else if (name === 'class' && !isSvg) {\n\t\tnode.className = value || '';\n\t} else if (name === 'style') {\n\t\tif (!value || typeof value === 'string' || typeof old === 'string') {\n\t\t\tnode.style.cssText = value || '';\n\t\t}\n\t\tif (value && typeof value === 'object') {\n\t\t\tif (typeof old !== 'string') {\n\t\t\t\tfor (var i in old) {\n\t\t\t\t\tif (!(i in value)) node.style[i] = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var i in value) {\n\t\t\t\tnode.style[i] = typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false ? value[i] + 'px' : value[i];\n\t\t\t}\n\t\t}\n\t} else if (name === 'dangerouslySetInnerHTML') {\n\t\tif (value) node.innerHTML = value.__html || '';\n\t} else if (name[0] == 'o' && name[1] == 'n') {\n\t\tvar useCapture = name !== (name = name.replace(/Capture$/, ''));\n\t\tname = name.toLowerCase().substring(2);\n\t\tif (value) {\n\t\t\tif (!old) node.addEventListener(name, eventProxy, useCapture);\n\t\t} else {\n\t\t\tnode.removeEventListener(name, eventProxy, useCapture);\n\t\t}\n\t\t(node._listeners || (node._listeners = {}))[name] = value;\n\t} else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\n\t\ttry {\n\t\t\tnode[name] = value == null ? '' : value;\n\t\t} catch (e) {}\n\t\tif ((value == null || value === false) && name != 'spellcheck') node.removeAttribute(name);\n\t} else {\n\t\tvar ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''));\n\n\t\tif (value == null || value === false) {\n\t\t\tif (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase());else node.removeAttribute(name);\n\t\t} else if (typeof value !== 'function') {\n\t\t\tif (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value);else node.setAttribute(name, value);\n\t\t}\n\t}\n}\n\nfunction eventProxy(e) {\n\treturn this._listeners[e.type](options.event && options.event(e) || e);\n}\n\nvar mounts = [];\n\nvar diffLevel = 0;\n\nvar isSvgMode = false;\n\nvar hydrating = false;\n\nfunction flushMounts() {\n\tvar c;\n\twhile (c = mounts.shift()) {\n\t\tif (options.afterMount) options.afterMount(c);\n\t\tif (c.componentDidMount) c.componentDidMount();\n\t}\n}\n\nfunction diff(dom, vnode, context, mountAll, parent, componentRoot) {\n\tif (!diffLevel++) {\n\t\tisSvgMode = parent != null && parent.ownerSVGElement !== undefined;\n\n\t\thydrating = dom != null && !('__preactattr_' in dom);\n\t}\n\n\tvar ret = idiff(dom, vnode, context, mountAll, componentRoot);\n\n\tif (parent && ret.parentNode !== parent) parent.appendChild(ret);\n\n\tif (! --diffLevel) {\n\t\thydrating = false;\n\n\t\tif (!componentRoot) flushMounts();\n\t}\n\n\treturn ret;\n}\n\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n\tvar out = dom,\n\t prevSvgMode = isSvgMode;\n\n\tif (vnode == null || typeof vnode === 'boolean') vnode = '';\n\n\tif (typeof vnode === 'string' || typeof vnode === 'number') {\n\t\tif (dom && dom.splitText !== undefined && dom.parentNode && (!dom._component || componentRoot)) {\n\t\t\tif (dom.nodeValue != vnode) {\n\t\t\t\tdom.nodeValue = vnode;\n\t\t\t}\n\t\t} else {\n\t\t\tout = document.createTextNode(vnode);\n\t\t\tif (dom) {\n\t\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\t\t\t\trecollectNodeTree(dom, true);\n\t\t\t}\n\t\t}\n\n\t\tout['__preactattr_'] = true;\n\n\t\treturn out;\n\t}\n\n\tvar vnodeName = vnode.nodeName;\n\tif (typeof vnodeName === 'function') {\n\t\treturn buildComponentFromVNode(dom, vnode, context, mountAll);\n\t}\n\n\tisSvgMode = vnodeName === 'svg' ? true : vnodeName === 'foreignObject' ? false : isSvgMode;\n\n\tvnodeName = String(vnodeName);\n\tif (!dom || !isNamedNode(dom, vnodeName)) {\n\t\tout = createNode(vnodeName, isSvgMode);\n\n\t\tif (dom) {\n\t\t\twhile (dom.firstChild) {\n\t\t\t\tout.appendChild(dom.firstChild);\n\t\t\t}\n\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\n\t\t\trecollectNodeTree(dom, true);\n\t\t}\n\t}\n\n\tvar fc = out.firstChild,\n\t props = out['__preactattr_'],\n\t vchildren = vnode.children;\n\n\tif (props == null) {\n\t\tprops = out['__preactattr_'] = {};\n\t\tfor (var a = out.attributes, i = a.length; i--;) {\n\t\t\tprops[a[i].name] = a[i].value;\n\t\t}\n\t}\n\n\tif (!hydrating && vchildren && vchildren.length === 1 && typeof vchildren[0] === 'string' && fc != null && fc.splitText !== undefined && fc.nextSibling == null) {\n\t\tif (fc.nodeValue != vchildren[0]) {\n\t\t\tfc.nodeValue = vchildren[0];\n\t\t}\n\t} else if (vchildren && vchildren.length || fc != null) {\n\t\t\tinnerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML != null);\n\t\t}\n\n\tdiffAttributes(out, vnode.attributes, props);\n\n\tisSvgMode = prevSvgMode;\n\n\treturn out;\n}\n\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n\tvar originalChildren = dom.childNodes,\n\t children = [],\n\t keyed = {},\n\t keyedLen = 0,\n\t min = 0,\n\t len = originalChildren.length,\n\t childrenLen = 0,\n\t vlen = vchildren ? vchildren.length : 0,\n\t j,\n\t c,\n\t f,\n\t vchild,\n\t child;\n\n\tif (len !== 0) {\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tvar _child = originalChildren[i],\n\t\t\t props = _child['__preactattr_'],\n\t\t\t key = vlen && props ? _child._component ? _child._component.__key : props.key : null;\n\t\t\tif (key != null) {\n\t\t\t\tkeyedLen++;\n\t\t\t\tkeyed[key] = _child;\n\t\t\t} else if (props || (_child.splitText !== undefined ? isHydrating ? _child.nodeValue.trim() : true : isHydrating)) {\n\t\t\t\tchildren[childrenLen++] = _child;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (vlen !== 0) {\n\t\tfor (var i = 0; i < vlen; i++) {\n\t\t\tvchild = vchildren[i];\n\t\t\tchild = null;\n\n\t\t\tvar key = vchild.key;\n\t\t\tif (key != null) {\n\t\t\t\tif (keyedLen && keyed[key] !== undefined) {\n\t\t\t\t\tchild = keyed[key];\n\t\t\t\t\tkeyed[key] = undefined;\n\t\t\t\t\tkeyedLen--;\n\t\t\t\t}\n\t\t\t} else if (min < childrenLen) {\n\t\t\t\t\tfor (j = min; j < childrenLen; j++) {\n\t\t\t\t\t\tif (children[j] !== undefined && isSameNodeType(c = children[j], vchild, isHydrating)) {\n\t\t\t\t\t\t\tchild = c;\n\t\t\t\t\t\t\tchildren[j] = undefined;\n\t\t\t\t\t\t\tif (j === childrenLen - 1) childrenLen--;\n\t\t\t\t\t\t\tif (j === min) min++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\tchild = idiff(child, vchild, context, mountAll);\n\n\t\t\tf = originalChildren[i];\n\t\t\tif (child && child !== dom && child !== f) {\n\t\t\t\tif (f == null) {\n\t\t\t\t\tdom.appendChild(child);\n\t\t\t\t} else if (child === f.nextSibling) {\n\t\t\t\t\tremoveNode(f);\n\t\t\t\t} else {\n\t\t\t\t\tdom.insertBefore(child, f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (keyedLen) {\n\t\tfor (var i in keyed) {\n\t\t\tif (keyed[i] !== undefined) recollectNodeTree(keyed[i], false);\n\t\t}\n\t}\n\n\twhile (min <= childrenLen) {\n\t\tif ((child = children[childrenLen--]) !== undefined) recollectNodeTree(child, false);\n\t}\n}\n\nfunction recollectNodeTree(node, unmountOnly) {\n\tvar component = node._component;\n\tif (component) {\n\t\tunmountComponent(component);\n\t} else {\n\t\tif (node['__preactattr_'] != null) applyRef(node['__preactattr_'].ref, null);\n\n\t\tif (unmountOnly === false || node['__preactattr_'] == null) {\n\t\t\tremoveNode(node);\n\t\t}\n\n\t\tremoveChildren(node);\n\t}\n}\n\nfunction removeChildren(node) {\n\tnode = node.lastChild;\n\twhile (node) {\n\t\tvar next = node.previousSibling;\n\t\trecollectNodeTree(node, true);\n\t\tnode = next;\n\t}\n}\n\nfunction diffAttributes(dom, attrs, old) {\n\tvar name;\n\n\tfor (name in old) {\n\t\tif (!(attrs && attrs[name] != null) && old[name] != null) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = undefined, isSvgMode);\n\t\t}\n\t}\n\n\tfor (name in attrs) {\n\t\tif (name !== 'children' && name !== 'innerHTML' && (!(name in old) || attrs[name] !== (name === 'value' || name === 'checked' ? dom[name] : old[name]))) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode);\n\t\t}\n\t}\n}\n\nvar recyclerComponents = [];\n\nfunction createComponent(Ctor, props, context) {\n\tvar inst,\n\t i = recyclerComponents.length;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\twhile (i--) {\n\t\tif (recyclerComponents[i].constructor === Ctor) {\n\t\t\tinst.nextBase = recyclerComponents[i].nextBase;\n\t\t\trecyclerComponents.splice(i, 1);\n\t\t\treturn inst;\n\t\t}\n\t}\n\n\treturn inst;\n}\n\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n\nfunction setComponentProps(component, props, renderMode, context, mountAll) {\n\tif (component._disable) return;\n\tcomponent._disable = true;\n\n\tcomponent.__ref = props.ref;\n\tcomponent.__key = props.key;\n\tdelete props.ref;\n\tdelete props.key;\n\n\tif (typeof component.constructor.getDerivedStateFromProps === 'undefined') {\n\t\tif (!component.base || mountAll) {\n\t\t\tif (component.componentWillMount) component.componentWillMount();\n\t\t} else if (component.componentWillReceiveProps) {\n\t\t\tcomponent.componentWillReceiveProps(props, context);\n\t\t}\n\t}\n\n\tif (context && context !== component.context) {\n\t\tif (!component.prevContext) component.prevContext = component.context;\n\t\tcomponent.context = context;\n\t}\n\n\tif (!component.prevProps) component.prevProps = component.props;\n\tcomponent.props = props;\n\n\tcomponent._disable = false;\n\n\tif (renderMode !== 0) {\n\t\tif (renderMode === 1 || options.syncComponentUpdates !== false || !component.base) {\n\t\t\trenderComponent(component, 1, mountAll);\n\t\t} else {\n\t\t\tenqueueRender(component);\n\t\t}\n\t}\n\n\tapplyRef(component.__ref, component);\n}\n\nfunction renderComponent(component, renderMode, mountAll, isChild) {\n\tif (component._disable) return;\n\n\tvar props = component.props,\n\t state = component.state,\n\t context = component.context,\n\t previousProps = component.prevProps || props,\n\t previousState = component.prevState || state,\n\t previousContext = component.prevContext || context,\n\t isUpdate = component.base,\n\t nextBase = component.nextBase,\n\t initialBase = isUpdate || nextBase,\n\t initialChildComponent = component._component,\n\t skip = false,\n\t snapshot = previousContext,\n\t rendered,\n\t inst,\n\t cbase;\n\n\tif (component.constructor.getDerivedStateFromProps) {\n\t\tstate = extend(extend({}, state), component.constructor.getDerivedStateFromProps(props, state));\n\t\tcomponent.state = state;\n\t}\n\n\tif (isUpdate) {\n\t\tcomponent.props = previousProps;\n\t\tcomponent.state = previousState;\n\t\tcomponent.context = previousContext;\n\t\tif (renderMode !== 2 && component.shouldComponentUpdate && component.shouldComponentUpdate(props, state, context) === false) {\n\t\t\tskip = true;\n\t\t} else if (component.componentWillUpdate) {\n\t\t\tcomponent.componentWillUpdate(props, state, context);\n\t\t}\n\t\tcomponent.props = props;\n\t\tcomponent.state = state;\n\t\tcomponent.context = context;\n\t}\n\n\tcomponent.prevProps = component.prevState = component.prevContext = component.nextBase = null;\n\tcomponent._dirty = false;\n\n\tif (!skip) {\n\t\trendered = component.render(props, state, context);\n\n\t\tif (component.getChildContext) {\n\t\t\tcontext = extend(extend({}, context), component.getChildContext());\n\t\t}\n\n\t\tif (isUpdate && component.getSnapshotBeforeUpdate) {\n\t\t\tsnapshot = component.getSnapshotBeforeUpdate(previousProps, previousState);\n\t\t}\n\n\t\tvar childComponent = rendered && rendered.nodeName,\n\t\t toUnmount,\n\t\t base;\n\n\t\tif (typeof childComponent === 'function') {\n\n\t\t\tvar childProps = getNodeProps(rendered);\n\t\t\tinst = initialChildComponent;\n\n\t\t\tif (inst && inst.constructor === childComponent && childProps.key == inst.__key) {\n\t\t\t\tsetComponentProps(inst, childProps, 1, context, false);\n\t\t\t} else {\n\t\t\t\ttoUnmount = inst;\n\n\t\t\t\tcomponent._component = inst = createComponent(childComponent, childProps, context);\n\t\t\t\tinst.nextBase = inst.nextBase || nextBase;\n\t\t\t\tinst._parentComponent = component;\n\t\t\t\tsetComponentProps(inst, childProps, 0, context, false);\n\t\t\t\trenderComponent(inst, 1, mountAll, true);\n\t\t\t}\n\n\t\t\tbase = inst.base;\n\t\t} else {\n\t\t\tcbase = initialBase;\n\n\t\t\ttoUnmount = initialChildComponent;\n\t\t\tif (toUnmount) {\n\t\t\t\tcbase = component._component = null;\n\t\t\t}\n\n\t\t\tif (initialBase || renderMode === 1) {\n\t\t\t\tif (cbase) cbase._component = null;\n\t\t\t\tbase = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, true);\n\t\t\t}\n\t\t}\n\n\t\tif (initialBase && base !== initialBase && inst !== initialChildComponent) {\n\t\t\tvar baseParent = initialBase.parentNode;\n\t\t\tif (baseParent && base !== baseParent) {\n\t\t\t\tbaseParent.replaceChild(base, initialBase);\n\n\t\t\t\tif (!toUnmount) {\n\t\t\t\t\tinitialBase._component = null;\n\t\t\t\t\trecollectNodeTree(initialBase, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (toUnmount) {\n\t\t\tunmountComponent(toUnmount);\n\t\t}\n\n\t\tcomponent.base = base;\n\t\tif (base && !isChild) {\n\t\t\tvar componentRef = component,\n\t\t\t t = component;\n\t\t\twhile (t = t._parentComponent) {\n\t\t\t\t(componentRef = t).base = base;\n\t\t\t}\n\t\t\tbase._component = componentRef;\n\t\t\tbase._componentConstructor = componentRef.constructor;\n\t\t}\n\t}\n\n\tif (!isUpdate || mountAll) {\n\t\tmounts.push(component);\n\t} else if (!skip) {\n\n\t\tif (component.componentDidUpdate) {\n\t\t\tcomponent.componentDidUpdate(previousProps, previousState, snapshot);\n\t\t}\n\t\tif (options.afterUpdate) options.afterUpdate(component);\n\t}\n\n\twhile (component._renderCallbacks.length) {\n\t\tcomponent._renderCallbacks.pop().call(component);\n\t}if (!diffLevel && !isChild) flushMounts();\n}\n\nfunction buildComponentFromVNode(dom, vnode, context, mountAll) {\n\tvar c = dom && dom._component,\n\t originalComponent = c,\n\t oldDom = dom,\n\t isDirectOwner = c && dom._componentConstructor === vnode.nodeName,\n\t isOwner = isDirectOwner,\n\t props = getNodeProps(vnode);\n\twhile (c && !isOwner && (c = c._parentComponent)) {\n\t\tisOwner = c.constructor === vnode.nodeName;\n\t}\n\n\tif (c && isOwner && (!mountAll || c._component)) {\n\t\tsetComponentProps(c, props, 3, context, mountAll);\n\t\tdom = c.base;\n\t} else {\n\t\tif (originalComponent && !isDirectOwner) {\n\t\t\tunmountComponent(originalComponent);\n\t\t\tdom = oldDom = null;\n\t\t}\n\n\t\tc = createComponent(vnode.nodeName, props, context);\n\t\tif (dom && !c.nextBase) {\n\t\t\tc.nextBase = dom;\n\n\t\t\toldDom = null;\n\t\t}\n\t\tsetComponentProps(c, props, 1, context, mountAll);\n\t\tdom = c.base;\n\n\t\tif (oldDom && dom !== oldDom) {\n\t\t\toldDom._component = null;\n\t\t\trecollectNodeTree(oldDom, false);\n\t\t}\n\t}\n\n\treturn dom;\n}\n\nfunction unmountComponent(component) {\n\tif (options.beforeUnmount) options.beforeUnmount(component);\n\n\tvar base = component.base;\n\n\tcomponent._disable = true;\n\n\tif (component.componentWillUnmount) component.componentWillUnmount();\n\n\tcomponent.base = null;\n\n\tvar inner = component._component;\n\tif (inner) {\n\t\tunmountComponent(inner);\n\t} else if (base) {\n\t\tif (base['__preactattr_'] != null) applyRef(base['__preactattr_'].ref, null);\n\n\t\tcomponent.nextBase = base;\n\n\t\tremoveNode(base);\n\t\trecyclerComponents.push(component);\n\n\t\tremoveChildren(base);\n\t}\n\n\tapplyRef(component.__ref, null);\n}\n\nfunction Component(props, context) {\n\tthis._dirty = true;\n\n\tthis.context = context;\n\n\tthis.props = props;\n\n\tthis.state = this.state || {};\n\n\tthis._renderCallbacks = [];\n}\n\nextend(Component.prototype, {\n\tsetState: function setState(state, callback) {\n\t\tif (!this.prevState) this.prevState = this.state;\n\t\tthis.state = extend(extend({}, this.state), typeof state === 'function' ? state(this.state, this.props) : state);\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t},\n\tforceUpdate: function forceUpdate(callback) {\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\trenderComponent(this, 2);\n\t},\n\trender: function render() {}\n});\n\nfunction render(vnode, parent, merge) {\n return diff(merge, vnode, {}, false, parent, false);\n}\n\nfunction createRef() {\n\treturn {};\n}\n\nvar preact = {\n\th: h,\n\tcreateElement: h,\n\tcloneElement: cloneElement,\n\tcreateRef: createRef,\n\tComponent: Component,\n\trender: render,\n\trerender: rerender,\n\toptions: options\n};\n\nexport default preact;\nexport { h, h as createElement, cloneElement, createRef, Component, render, rerender, options };\n//# sourceMappingURL=preact.mjs.map\n","/**\n * @desc listen to one or more events on an element\n * @param {Element} el target element\n * @param {Array} eventList the events to listen to\n * @param {Function} callback\n * @param {Object} params params to pass to addEventListener\n */\nexport function listen(el, eventList, callback, params={}) {\n for (var i = 0; i < eventList.length; i++) {\n el.addEventListener(eventList[i], callback, params);\n }\n};\n\n/**\n * @desc remove an event listener on an element\n * @param {Element} el target element\n * @param {Array} eventList the events to remove\n * @param {Function} callback\n * @param {Object} params params to pass to removeEventListener\n */\nexport function unlisten(el, eventList, callback, params={}) {\n for (var i = 0; i < eventList.length; i++) {\n el.removeEventListener(eventList[i], callback, params);\n }\n};\n\n/**\n * @desc call fn callback when the page document has fully loaded\n * @param {Function} callback\n */\nexport function onDocumentReady(callback) {\n if (document.readyState !== 'loading') {\n callback();\n } else {\n listen(document, ['DOMContentLoaded'], callback);\n }\n};","import { Component } from 'preact';\nimport { listen, unlisten } from 'util/dom';\n\nconst EVENT_MOUSEDOWN = 'mousedown';\nconst EVENT_MOUSEMOVE = 'mousemove';\nconst EVENT_MOUSEUP = 'mouseup';\nconst EVENT_TOUCHSTART = 'touchstart';\nconst EVENT_TOUCHMOVE = 'touchmove';\nconst EVENT_TOUCHEND = 'touchend';\n\n/**\n * Base component class for iro UI components\n * This extends the Preact component class to allow them to react to mouse/touch input events by themselves\n */\nexport default class IroComponent extends Component {\n\n constructor(props) {\n super(props);\n // Generate unique ID for the component\n // This can be used to generate unique IDs for gradients, etc\n this.uid = (Math.random() + 1).toString(36).substring(5);\n }\n \n componentDidMount() {\n listen(this.base, [EVENT_MOUSEDOWN, EVENT_TOUCHSTART], this, { passive: false });\n }\n\n componentWillUnmount() {\n unlisten(this.base, [EVENT_MOUSEDOWN, EVENT_TOUCHSTART], this);\n }\n\n // More info on handleEvent:\n // http://download-cdn.miitomo.com/native/20180125111639/manifests/v2_20180405_3_android/manifest.json\n // TL;DR this lets us have a single point of entry for multiple events, and we can avoid callback/binding hell\n handleEvent(e) {\n e.preventDefault();\n // Detect if the event is a touch event by checking if it has the `touches` property\n // If it is a touch event, use the first touch input\n const point = e.touches ? e.changedTouches[0] : e;\n const x = point.clientX;\n const y = point.clientY;\n // Get the screen position of the component\n const bounds = this.base.getBoundingClientRect();\n\n switch (e.type) {\n case EVENT_MOUSEDOWN:\n case EVENT_TOUCHSTART:\n listen(document, [EVENT_MOUSEMOVE, EVENT_TOUCHMOVE, EVENT_MOUSEUP, EVENT_TOUCHEND], this, { passive: false });\n this.handleInput(x, y, bounds, 'START');\n break;\n case EVENT_MOUSEMOVE:\n case EVENT_TOUCHMOVE:\n this.handleInput(x, y, bounds, 'MOVE');\n break;\n case EVENT_MOUSEUP:\n case EVENT_TOUCHEND:\n this.handleInput(x, y, bounds, 'END');\n unlisten(document, [EVENT_MOUSEMOVE, EVENT_TOUCHMOVE, EVENT_MOUSEUP, EVENT_TOUCHEND], this, { passive: false });\n break;\n }\n }\n}","/**\n * @desc Resolve an SVG URL\n * This is required to work around how Safari handles gradient URLS under certain conditions\n * If a page is using a client-side routing library which makes use of the HTML tag, \n * Safari won't be able to render SVG gradients properly (as they are referenced by URLs)\n * More info on the problem: \n * https://stackoverflow.com/questions/19742805/angular-and-svg-filters/19753427#19753427\n * https://github.com/jaames/iro.js/issues/18\n * https://github.com/jaames/iro.js/issues/45\n * @param {String} url resource url (should be an id selector e.g \"#example\")\n * @returns {String} resolved url\n */\nexport function resolveUrl(url) {\n // Sniff useragent string to check if the user is running Safari\n const ua = window.navigator.userAgent;\n const isSafari = /^((?!chrome|android).)*safari/i.test(ua);\n const isIos = /iPhone|iPod|iPad/i.test(ua);\n const location = window.location;\n return (isSafari || isIos) ? `${location.protocol}//${location.host}${location.pathname}${location.search}${url}` : url;\n}\n\n/**\n * @desc create the path commands to draw an svg arc\n * @param {Number} cx center point x\n * @param {Number} cy center point y\n * @param {Number} radius arc radius\n * @param {Number} startAngle arc start angle (degrees)\n * @param {Number} endAngle arc end angle (degrees)\n * @returns {String} arc path commands\n */\nexport function createArcPath(cx, cy, radius, startAngle, endAngle) {\n const largeArcFlag = endAngle - startAngle <= 180 ? 0 : 1;\n startAngle *= Math.PI / 180;\n endAngle *= Math.PI / 180;\n const x1 = cx + radius * Math.cos(endAngle);\n const y1 = cy + radius * Math.sin(endAngle);\n const x2 = cx + radius * Math.cos(startAngle);\n const y2 = cy + radius * Math.sin(startAngle);\n return `M ${x1} ${y1} A ${radius} ${radius} 0 ${largeArcFlag} 0 ${x2} ${y2}`;\n}","import { h } from 'preact';\nimport { resolveUrl } from '../util/svg';\n\nfunction IroHandle(props) {\n \n const radius = props.r;\n const url = props.url;\n\n return (\n \n {url && (\n \n )}\n {!url && (\n \n )}\n {!url && (\n \n )}\n \n );\n}\n\nIroHandle.defaultProps = {\n x: 0,\n y: 0,\n r: 8,\n url: null,\n origin: {x: 0, y: 0}\n};\n\nexport default IroHandle;","import { h } from 'preact';\n\nimport IroComponent from 'ui/component';\nimport IroHandle from 'ui/handle';\nimport { resolveUrl, createArcPath } from '../util/svg';\n\n\nexport default class IroWheel extends IroComponent {\n\n render(props) {\n let { width, borderWidth, handleRadius } = props;\n const hsv = props.color.hsv;\n const radius = (width / 2) - borderWidth;\n const handleAngle = (360 - hsv.h) * (Math.PI / 180);\n const handleDist = (hsv.s / 100) * (radius - props.padding - handleRadius - borderWidth);\n const cX = radius + borderWidth;\n const cY = radius + borderWidth;\n \n return (\n \n \n \n \n \n \n \n \n {Array.apply(null, { length: 360 }).map((_, hue) => (\n \n ))}\n \n \n { props.wheelLightness && (\n \n )}\n \n \n \n );\n }\n\n /**\n * @desc handles mouse input for this component\n * @param {Number} x - point x coordinate\n * @param {Number} y - point y coordinate\n * @param {DOMRect} rect - bounding client rect for the component's base element\n * @param {String} type - input type: \"START\", \"MOVE\" or \"END\"\n */\n handleInput(x, y, { left, top }, type) {\n const props = this.props;\n const radius = props.width / 2;\n const handleRange = (radius - props.padding - props.handleRadius - props.borderWidth);\n const cX = radius;\n const cY = radius;\n\n x = cX - (x - left);\n y = cY - (y - top);\n\n let handleAngle = Math.atan2(y, x);\n // Calculate the hue by converting the angle to radians\n let hue = 360 - (Math.round(handleAngle * (180 / Math.PI)) + 180);\n // Find the point's distance from the center of the wheel\n // This is used to show the saturation level\n let handleDist = Math.min(Math.sqrt(x * x + y * y), handleRange);\n props.onInput(type, {\n h: hue,\n s: Math.round((100 / handleRange) * handleDist)\n });\n }\n}","/**\n * @desc Parse a css unit string - either regular int or a percentage number\n * @param {String} str input string\n * @param {String} max max number for converting percentages\n * @returns {Number} \n */\nexport function parseUnit(str, max) {\n const isPercentage = str.indexOf('%') > -1;\n const num = parseFloat(str);\n return isPercentage ? (max / 100) * num : num;\n}\n\n/**\n * @desc Parse hex str to an int\n * @param {String} str input string\n * @returns {Number} \n */\nexport function parseHexInt(str) {\n return parseInt(str, 16);\n}\n\n/**\n * @desc Convert into to 2-digit hex\n * @param {Number} int input number\n * @returns {String} \n */\nexport function intToHex(int) {\n return int.toString(16).padStart(2, '0');\n}","import { parseUnit, parseHexInt, intToHex } from './util/colorUtils';\n\n// Some regular expressions for rgb() and hsl() Colors are borrowed from tinyColor\n// https://github.com/bgrins/TinyColor\n\n// https://www.w3.org/TR/css3-values/#integers\nconst CSS_INTEGER = `[-\\\\+]?\\\\d+%?`;\n// http://www.w3.org/TR/css3-values/#number-value\nconst CSS_NUMBER = `[-\\\\+]?\\\\d*\\\\.\\\\d+%?`;\n// Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome\nconst CSS_UNIT = `(?:${ CSS_NUMBER })|(?:${ CSS_INTEGER })`;\n\n// Parse function params\n// Parens and commas are optional, and this also allows for whitespace between numbers\nconst PERMISSIVE_MATCH_3 = `[\\\\s|\\\\(]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })\\\\s*\\\\)?`;\nconst PERMISSIVE_MATCH_4 = `[\\\\s|\\\\(]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })\\\\s*\\\\)?`;\n\n// Regex patterns for functional colors\nconst REGEX_FUNCTIONAL_RGB = new RegExp(`rgb${ PERMISSIVE_MATCH_3 }`);\nconst REGEX_FUNCTIONAL_RGBA = new RegExp(`rgba${ PERMISSIVE_MATCH_4 }`);\nconst REGEX_FUNCTIONAL_HSL = new RegExp(`hsl${ PERMISSIVE_MATCH_3 }`);\nconst REGEX_FUNCTIONAL_HSLA = new RegExp(`hsla${ PERMISSIVE_MATCH_4 }`);\n\nconst HEX_START = `^(?:#?|0x?)`;\nconst HEX_INT_SINGLE = `([0-9a-fA-F]{1})`;\nconst HEX_INT_DOUBLE = `([0-9a-fA-F]{2})`;\nconst REGEX_HEX_3 = new RegExp(`${ HEX_START }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }$`);\nconst REGEX_HEX_4 = new RegExp(`${ HEX_START }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }$`);\nconst REGEX_HEX_6 = new RegExp(`${ HEX_START }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }$`);\nconst REGEX_HEX_8 = new RegExp(`${ HEX_START }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }$`);\n\nexport default class Color {\n /**\n * @constructor Color object\n * @param {Object | String | Color} value - Color instance, object (hsv, hsl or rgb), string (hsl, rgb, hex)\n */\n constructor(value) {\n // The watch callback function for this Color will be stored here\n this._onChange = false;\n // The default Color value\n this._value = {h: 0, s: 0, v: 0, a: 1};\n if (value) this.set(value);\n }\n\n /**\n * @desc set the Color from any valid value\n * @param {Object | String | Color} value - Color instance, object (hsv, hsl or rgb), string (hsl, rgb, hex)\n */\n set(value) {\n const isString = typeof value === 'string';\n const isObject = typeof value === 'object';\n if ((isString) && (/^(?:#?|0x?)[0-9a-fA-F]{3,8}$/.test(value))) {\n this.hexString = value;\n }\n else if ((isString) && (/^rgba?/.test(value))) {\n this.rgbString = value;\n }\n else if ((isString) && (/^hsla?/.test(value))) {\n this.hslString = value;\n }\n else if ((isObject) && (value instanceof Color)) {\n this.hsv = value.hsv;\n }\n else if ((isObject) && ('r' in value) && ('g' in value) && ('b' in value)) {\n this.rgb = value;\n }\n else if ((isObject) && ('h' in value) && ('s' in value) && ('v' in value)) {\n this.hsv = value;\n }\n else if ((isObject) && ('h' in value) && ('s' in value) && ('l' in value)) {\n this.hsl = value;\n }\n else {\n throw new Error('invalid color value');\n }\n }\n\n /**\n * @desc shortcut to set a specific channel value\n * @param {String} format - hsv | hsl | rgb\n * @param {String} channel - individual channel to set, for example if model = hsl, chanel = h | s | l\n * @param {Number} value - new value for the channel\n */\n setChannel(format, channel, value) {\n this[format] = {...this[format], [channel]: value};\n }\n\n /**\n * @desc make new Color instance with the same value as this one\n * @return {Color}\n */\n clone() {\n return new Color(this);\n }\n\n /**\n * @desc convert hsv object to rgb\n * @param {Object} hsv hsv object\n * @return {Object} rgb object\n */\n static hsvToRgb(hsv) {\n const h = hsv.h / 60;\n const s = hsv.s / 100;\n const v = hsv.v / 100;\n const i = Math.floor(h);\n const f = h - i;\n const p = v * (1 - s);\n const q = v * (1 - f * s);\n const t = v * (1 - (1 - f) * s);\n const mod = i % 6;\n const r = [v, q, p, p, t, v][mod];\n const g = [t, v, v, q, p, p][mod];\n const b = [p, p, t, v, v, q][mod];\n return {\n r: r * 255, \n g: g * 255, \n b: b * 255\n };\n }\n\n /**\n * @desc convert rgb object to hsv\n * @param {Object} rgb - rgb object\n * @return {Object} hsv object\n */\n static rgbToHsv(rgb) {\n const r = rgb.r / 255;\n const g = rgb.g / 255;\n const b = rgb.b / 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const delta = max - min;\n let hue;\n let value = max;\n let saturation = max === 0 ? 0 : delta / max;\n switch (max) {\n case min: \n hue = 0; // achromatic\n break;\n case r: \n hue = (g - b) / delta + (g < b ? 6 : 0);\n break;\n case g: \n hue = (b - r) / delta + 2;\n break;\n case b:\n hue = (r - g) / delta + 4;\n break;\n }\n return {\n h: hue * 60,\n s: saturation * 100,\n v: value * 100\n }\n }\n\n /**\n * @desc convert hsv object to hsl\n * @param {Object} hsv - hsv object\n * @return {Object} hsl object\n */\n static hsvToHsl(hsv) {\n const s = hsv.s / 100;\n const v = hsv.v / 100;\n const l = (2 - s) * v;\n const divisor = l <= 1 ? l : (2 - l);\n // Avoid division by zero when lightness is close to zero\n const saturation = divisor < 1e-9 ? 0 : (s * v) / divisor;\n return {\n h: hsv.h,\n s: saturation * 100,\n l: l * 50\n };\n }\n\n /**\n * @desc convert hsl object to hsv\n * @param {Object} hsl - hsl object\n * @return {Object} hsv object\n */\n static hslToHsv(hsl) {\n const l = hsl.l * 2;\n const s = (hsl.s * ((l <= 100) ? l : 200 - l)) / 100;\n // Avoid division by zero when l + s is near 0\n const saturation = (l + s < 1e-9) ? 0 : (2 * s) / (l + s);\n return {\n h: hsl.h,\n s: saturation * 100,\n v: (l + s) / 2\n };\n }\n\n get hsv() {\n // _value is cloned to allow changes to be made to the values before passing them back\n const value = this._value;\n return {h: value.h, s: value.s, v: value.v};\n }\n\n set hsv(newValue) {\n const oldValue = this._value;\n newValue = { ...oldValue, ...newValue };\n // If this Color is being watched for changes we need to compare the new and old values to check the difference\n // Otherwise we can just be lazy\n if (this._onChange) {\n // Compute changed values\n let changes = {};\n for (let key in oldValue) {\n changes[key] = newValue[key] != oldValue[key]\n };\n // Update the old value\n this._value = newValue;\n // If the value has changed, call hook callback\n if (changes.h || changes.s || changes.v || changes.a) this._onChange(this, changes);\n } else {\n this._value = newValue;\n }\n }\n\n get rgb() {\n const {r, g, b} = Color.hsvToRgb(this._value);\n return {\n r: Math.round(r),\n g: Math.round(g),\n b: Math.round(b),\n };\n }\n\n set rgb(value) {\n this.hsv = {...Color.rgbToHsv(value), a: (value.a === undefined) ? 1 : value.a};\n }\n\n get hsl() {\n const {h, s, l} = Color.hsvToHsl(this._value);\n return {\n h: Math.round(h),\n s: Math.round(s),\n l: Math.round(l),\n };\n }\n\n set hsl(value) {\n this.hsv = {...Color.hslToHsv(value), a: (value.a === undefined) ? 1 : value.a};\n }\n\n get rgbString() {\n const rgb = this.rgb;\n return `rgb(${rgb.r}, ${rgb.g}, ${rgb.b})`;\n }\n\n set rgbString(value) {\n let match;\n let r, g, b, a = 1;\n if (match = REGEX_FUNCTIONAL_RGB.exec(value)) {\n r = parseUnit(match[1], 255);\n g = parseUnit(match[2], 255);\n b = parseUnit(match[3], 255);\n }\n else if (match = REGEX_FUNCTIONAL_RGBA.exec(value)) {\n r = parseUnit(match[1], 255);\n g = parseUnit(match[2], 255);\n b = parseUnit(match[3], 255);\n a = parseUnit(match[4], 1);\n }\n if (match) {\n this.rgb = {r, g, b, a};\n } \n else {\n throw new Error('invalid rgb string');\n }\n }\n\n get hexString() {\n const rgb = this.rgb;\n return `#${ intToHex(rgb.r) }${ intToHex(rgb.g) }${ intToHex(rgb.b) }`;\n }\n\n set hexString(value) {\n let match;\n let r, g, b, a = 255;\n if (match = REGEX_HEX_3.exec(value)) {\n r = parseHexInt(match[1]) * 17;\n g = parseHexInt(match[2]) * 17;\n b = parseHexInt(match[3]) * 17;\n }\n else if (match = REGEX_HEX_4.exec(value)) {\n r = parseHexInt(match[1]) * 17;\n g = parseHexInt(match[2]) * 17;\n b = parseHexInt(match[3]) * 17;\n a = parseHexInt(match[4]) * 17;\n }\n else if (match = REGEX_HEX_6.exec(value)) {\n r = parseHexInt(match[1]);\n g = parseHexInt(match[2]);\n b = parseHexInt(match[3]);\n }\n else if (match = REGEX_HEX_8.exec(value)) {\n r = parseHexInt(match[1]);\n g = parseHexInt(match[2]);\n b = parseHexInt(match[3]);\n a = parseHexInt(match[4]);\n }\n if (match) {\n this.rgb = {r, g, b, a: a / 255};\n }\n else {\n throw new Error('invalid hex string');\n }\n }\n\n get hslString() {\n const hsl = this.hsl;\n return `hsl(${hsl.h}, ${hsl.s}%, ${hsl.l}%)`;\n }\n\n set hslString(value) {\n let match;\n let h, s, l, a = 1;\n if (match = REGEX_FUNCTIONAL_HSL.exec(value)) {\n h = parseUnit(match[1], 360);\n s = parseUnit(match[2], 100);\n l = parseUnit(match[3], 100);\n }\n else if (match = REGEX_FUNCTIONAL_HSLA.exec(value)) {\n h = parseUnit(match[1], 360);\n s = parseUnit(match[2], 100);\n l = parseUnit(match[3], 100);\n a = parseUnit(match[4], 1);\n }\n if (match) {\n this.hsl = {h, s, l, a};\n } \n else {\n throw new Error('invalid hsl string');\n }\n }\n}","import { h } from 'preact';\n\nimport IroComponent from 'ui/component';\nimport IroHandle from 'ui/handle';\nimport IroColor from '../color';\nimport { resolveUrl } from '../util/svg';\n\nexport default class IroSlider extends IroComponent {\n\n renderGradient(props) {\n const hsv = props.color.hsv;\n let stops = [];\n\n switch (props.sliderType) {\n case 'hue':\n stops = [\n {offset: '0', color: '#f00'},\n {offset: '16.666', color: '#ff0'},\n {offset: '33.333', color: '#0f0'},\n {offset: '50', color: '#0ff'},\n {offset: '66.666', color: '#00f'},\n {offset: '83.333', color: '#f0f'},\n {offset: '100', color: '#f00'},\n ];\n break;\n case 'saturation':\n var noSat = IroColor.hsvToHsl({h: hsv.h, s: 0, v: hsv.v});\n var fullSat = IroColor.hsvToHsl({h: hsv.h, s: 100, v: hsv.v});\n stops = [\n {offset: '0', color: `hsl(${noSat.h}, ${noSat.s}%, ${noSat.l}%)`},\n {offset: '100', color: `hsl(${fullSat.h}, ${fullSat.s}%, ${fullSat.l}%)`}\n ];\n break;\n case 'value':\n default:\n var hsl = IroColor.hsvToHsl({h: hsv.h, s: hsv.s, v: 100});\n stops = [\n {offset: '0', color: '#000'},\n {offset: '100', color: `hsl(${hsl.h}, ${hsl.s}%, ${hsl.l}%)`}\n ];\n break;\n }\n\n return (\n \n {stops.map(stop => (\n \n ))}\n \n )\n }\n\n render(props) {\n let { width, sliderHeight, borderWidth, handleRadius } = props;\n sliderHeight = sliderHeight ? sliderHeight : props.padding * 2 + handleRadius * 2 + borderWidth * 2;\n this.width = width;\n this.height = sliderHeight;\n const cornerRadius = sliderHeight / 2;\n const range = width - cornerRadius * 2\n const hsv = props.color.hsv;\n \n let sliderValue;\n switch (props.sliderType) {\n case 'hue':\n sliderValue = hsv.h /= 3.6;\n break;\n case 'saturation':\n sliderValue = hsv.s;\n break;\n case 'value':\n default:\n sliderValue = hsv.v;\n break;\n }\n\n return (\n \n \n { this.renderGradient(props) }\n \n \n \n \n );\n }\n\n getValueFromPoint(x, y, { left }) {\n const handleRange = this.width - this.height;\n const cornerRadius = this.height / 2;\n x = x - (left + cornerRadius);\n let dist = Math.max(Math.min(x, handleRange), 0);\n return Math.round((100 / handleRange) * dist);\n }\n\n /**\n * @desc handles mouse input for this component\n * @param {Number} x - point x coordinate\n * @param {Number} y - point y coordinate\n * @param {DOMRect} rect - bounding client rect for the component's base element\n * @param {String} type - input type: \"START\", \"MOVE\" or \"END\"\n */\n handleInput(x, y, bounds, type) {\n let value = this.getValueFromPoint(x, y, bounds);\n let channel;\n switch (this.props.sliderType) {\n case 'hue':\n channel = 'h';\n value *= 3.6;\n break;\n case 'saturation':\n channel = 's';\n break;\n case 'value':\n default:\n channel = 'v';\n break;\n }\n this.props.onInput(type, {\n [channel]: value\n });\n }\n}","import { h, render } from 'preact';\nimport { onDocumentReady } from './dom';\n\n/**\n * @desc Turn a component into a widget\n * This returns a factory function that can be used to create an instance of the widget component\n * The first function param is a DOM element or CSS selector for the element to mount to,\n * The second param is for config options which are passed to the component as props\n * This factory function can also delay mounting the element into the DOM until the page is ready\n * @param {Component} widgetComonpent ui component to turn into a widget\n * @returns {Function} widget factory\n */\nexport function createWidget(widgetComponent) {\n\n const widgetFactory = function (parent, props) {\n let widget = null; // will become an instance of the widget component class\n let widgetRoot = document.createElement('div');\n\n // Render widget into a temp DOM node\n render(\n h(widgetComponent, {\n ref: ref => widget = ref,\n ...props,\n }),\n widgetRoot\n );\n // Mount it into the DOM when the page document is ready\n onDocumentReady(() => {\n const container = parent instanceof Element ? parent : document.querySelector(parent);\n container.appendChild(widget.base);\n widget.onMount(container);\n });\n\n return widget;\n }\n\n // Allow the widget factory to inherit component prototype + static class methods\n // This makes it easier for plugin authors to extend the base widget component\n widgetFactory.prototype = widgetComponent.prototype;\n Object.assign(widgetFactory, widgetComponent);\n // Add reference to base component too\n widgetFactory.__component = widgetComponent; \n\n return widgetFactory;\n\n}","import { h, Component } from 'preact';\n\nimport IroWheel from 'ui/wheel';\nimport IroSlider from 'ui/slider';\nimport IroColor from './color';\nimport { createWidget } from 'util/createWidget';\n\nclass ColorPicker extends Component {\n constructor(props) {\n super(props);\n this.emitHook('init:before');\n this._events = {};\n this._deferredEvents = {};\n this._colorUpdateActive = false;\n this._colorUpdateSrc = null;\n this.color = new IroColor(props.color);\n this.deferredEmit('color:init', this.color, { h: false, s: false, v: false, a: false });\n // Whenever the color changes, update the color wheel\n this.color._onChange = this.updateColor.bind(this);\n this.state = {\n ...props,\n color: this.color,\n };\n this.emitHook('init:state');\n\n if (props.layout) {\n this.layout = props.layout;\n } else {\n this.layout = [\n {component: IroWheel, options: {}},\n {component: IroSlider, options: {}},\n ];\n }\n this.emitHook('init:after');\n }\n\n // Public ColorPicker events API\n\n /**\n * @desc Set a callback function for an event\n * @param {String | Array} eventList event(s) to listen to\n * @param {Function} callback\n */\n on(eventList, callback) {\n const events = this._events;\n // eventList can be an eventType string or an array of eventType strings\n (!Array.isArray(eventList) ? [eventList] : eventList).forEach(eventType => {\n // Emit plugin hook\n this.emitHook('event:on', eventType, callback);\n // Add event callback\n (events[eventType] || (events[eventType] = [])).push(callback);\n // Call deferred events\n // These are events that can be stored until a listener for them is added\n if (this._deferredEvents[eventType]) {\n // Deffered events store an array of arguments from when the event was called\n this._deferredEvents[eventType].forEach(args => {\n callback.apply(null, args); \n });\n // Clear deferred events\n this._deferredEvents[eventType] = [];\n }\n });\n }\n\n /**\n * @desc Remove a callback function for an event added with on()\n * @param {String | Array} eventList The name of the event\n * @param {Function} callback\n */\n off(eventList, callback) {\n (!Array.isArray(eventList) ? [eventList] : eventList).forEach(eventType => {\n const callbackList = this._events[eventType];\n this.emitHook('event:off', eventType, callback);\n if (callbackList) callbackList.splice(callbackList.indexOf(callback), 1);\n });\n }\n\n /**\n * @desc Emit an event\n * @param {String} eventType The name of the event to emit\n * @param {Array} args array of args to pass to callbacks\n */\n emit(eventType, ...args) {\n // Events are plugin hooks too\n this.emitHook(eventType, ...args);\n const callbackList = this._events[eventType] || [];\n for (let i = 0; i < callbackList.length; i++) {\n callbackList[i].apply(null, args); \n }\n }\n\n /**\n * @desc Emit an event now, or save it for when the relevent event listener is added\n * @param {String} eventType The name of the event to emit\n * @param {Array} args array of args to pass to callbacks\n */\n deferredEmit(eventType, ...args) {\n const deferredEvents = this._deferredEvents;\n this.emit(eventType, ...args);\n (deferredEvents[eventType] || (deferredEvents[eventType] = [])).push(args);\n }\n\n // Public utility methods\n\n /**\n * @desc Resize the color picker\n * @param {Number} width\n */\n resize(width) {\n this.setState({width});\n }\n\n /**\n * @desc Reset the color picker to the initial color provided in the color picker options\n */\n reset() {\n this.color.set(this.props.color);\n }\n\n // Plugin hooks API\n\n /**\n * @desc Set a callback function for a hook\n * @param {String} hookType The name of the hook to listen to\n * @param {Function} callback\n */\n static addHook(hookType, callback) {\n const pluginHooks = ColorPicker.pluginHooks;\n (pluginHooks[hookType] || (pluginHooks[hookType] = [])).push(callback);\n }\n\n /**\n * @desc Emit a callback hook\n * @access private\n * @param {String} hookType The type of hook event to emit\n */\n emitHook(hookType, ...args) {\n const callbackList = ColorPicker.pluginHooks[hookType] || [];\n for (let i = 0; i < callbackList.length; i++) {\n callbackList[i].apply(this, args); \n }\n }\n\n // Internal methods\n\n /**\n * @desc Called by the createWidget wrapper when the element is mounted into the page\n * @access private\n * @param {Element} container the container element for this ColorPicker instance\n */\n onMount(container) {\n this.el = container;\n this.deferredEmit('mount', this);\n }\n\n /**\n * @desc React to a color update\n * @access private\n * @param {IroColor} color current color\n * @param {Object} changes shows which h,s,v color channels changed\n */\n updateColor(color, changes) {\n this.emitHook('color:beforeUpdate', color, changes);\n this.setState({ color: color });\n this.emitHook('color:afterUpdate', color, changes);\n // Prevent infinite loops if the color is set inside a color:change or input:change callback\n if (!this._colorUpdateActive) {\n // While _colorUpdateActive == true, branch cannot be entered\n this._colorUpdateActive = true;\n // If the color change originates from user input, fire input:change\n if (this._colorUpdateSrc == 'input') { // colorUpdateSrc is cleared in handeInput()\n this.emit('input:change', color, changes);\n } \n // Always fire color:change event\n this.emit('color:change', color, changes);\n this._colorUpdateActive = false;\n }\n }\n\n /**\n * @desc Handle input from a UI control element\n * @access private\n * @param {String} type \"START\" | \"MOVE\" | \"END\"\n * @param {Object} hsv new hsv values for the color\n */\n handleInput(type, hsv) {\n // Fire input start and move events before color update\n if (type === 'START') this.emit('input:start', this.color);\n if (type === 'MOVE') this.emit('input:move', this.color);\n // Set the color update source\n this._colorUpdateSrc = 'input';\n // Setting the color HSV here will automatically update the UI\n // Since we bound the color's _onChange callback\n this.color.hsv = hsv;\n // Fire input end event after color update\n if (type === 'END') this.emit('input:end', this.color);\n // Reset color update source so it doesn't interfere with future color updates\n // Super important to do this here and not in updateColor()\n this._colorUpdateSrc = null;\n }\n\n render(props, state) {\n return (\n
\n {this.layout.map(({component: UiComponent, options: options}) => (\n this.handleInput(type, hsv) }\n parent={ this }\n />\n ))}\n
\n )\n }\n}\n\nColorPicker.pluginHooks = {};\n\nColorPicker.defaultProps = {\n width: 300,\n height: 300,\n handleRadius: 8,\n handleSvg: null,\n handleOrigin: {x: 0, y: 0},\n color: '#fff',\n borderColor: '#fff',\n borderWidth: 0,\n display: 'block',\n wheelLightness: true,\n sliderHeight: null,\n sliderMargin: 12,\n padding: 6,\n layout: null,\n}\n\nexport default createWidget(ColorPicker);\n","/**\n * iro.js plugins API\n * This provides the iro.use method, which can be used to register plugins which extend the iro.js core\n */\nexport function usePlugins(core) {\n const installedPlugins = [];\n \n /**\n * @desc Register iro.js plugin\n * @param {Function} plugin = plugin constructor\n * @param {Object} pluginOptions = plugin options passed to constructor\n */\n core.use = function(plugin, pluginOptions = {}) {\n // Check that the plugin hasn't already been registered\n if (!(installedPlugins.indexOf(plugin) > -1)) {\n // Init plugin\n // TODO: consider collection of plugin utils, which are passed as a thrid param\n plugin(core, pluginOptions);\n // Register plugin\n installedPlugins.push(plugin);\n }\n }\n\n core.installedPlugins = installedPlugins;\n\n return core;\n}","import { h } from 'preact';\n\nimport ColorPicker from './colorPicker';\nimport Color from './color';\n\nimport Component from 'ui/component';\nimport Handle from 'ui/handle';\nimport Slider from 'ui/slider';\nimport Wheel from 'ui/wheel';\nimport { usePlugins } from 'util/usePlugins';\nimport { resolveUrl, createArcPath } from 'util/svg';\nimport { parseUnit, parseHexInt, intToHex } from 'util/colorUtils';\n\nexport default usePlugins({\n Color,\n ColorPicker,\n ui: {\n h,\n Component,\n Handle,\n Slider,\n Wheel,\n },\n util: {\n resolveUrl, \n createArcPath,\n parseUnit,\n parseHexInt,\n intToHex\n },\n version: VERSION,\n});\n"],"names":["arguments","const","super","let","IroColor","this","options","ColorPicker","Component","Handle","Slider","Wheel"],"mappings":";;;;;;;;;;;;;CAAA,IAAI,KAAK,GAAG,SAAS,KAAK,GAAG,EAAE,CAAC;;CAEhC,IAAI,OAAO,GAAG,EAAE,CAAC;;CAEjB,IAAI,KAAK,GAAG,EAAE,CAAC;;CAEf,IAAI,cAAc,GAAG,EAAE,CAAC;;CAExB,SAAS,CAAC,CAAC,QAAQ,EAAE,UAAU,EAAE;;;EAChC,IAAI,QAAQ,GAAG,cAAc;MACzB,UAAU;MACV,KAAK;MACL,MAAM;MACN,CAAC,CAAC;EACN,KAAK,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG;GACpC,KAAK,CAAC,IAAI,CAACA,WAAS,CAAC,CAAC,CAAC,CAAC,CAAC;GACzB;EACD,IAAI,UAAU,IAAI,UAAU,CAAC,QAAQ,IAAI,IAAI,EAAE;GAC9C,IAAI,CAAC,KAAK,CAAC,MAAM,IAAE,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAC;GACnD,OAAO,UAAU,CAAC,QAAQ,CAAC;GAC3B;EACD,OAAO,K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,MAAM,EAAE,aAAkB,EAAE;kDAAP,GAAG;;;KAE1C,IAAI,EAAE,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;;;OAG5C,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;;OAE5B,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;MAC/B;KACF;;GAED,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;;GAEzC,OAAO,IAAI,CAAC;;;ACZd,WAAe,UAAU,CAAC;UACxB,KAAK;gBACLM,aAAW;GACX,EAAE,EAAE;QACF,CAAC;gBACDC,YAAS;aACTC,SAAM;aACNC,SAAM;YACNC,QAAK;IACN;GACD,IAAI,EAAE;iBACJ,UAAU;oBACV,aAAa;gBACb,SAAS;kBACT,WAAW;eACX,QAAQ;IACT;GACD,OAAO,EAAE,OAAO;EACjB,CAAC,CAAC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"iro.js.map","sources":["../node_modules/preact/dist/preact.mjs","../src/util/dom.js","../src/ui/component.js","../src/util/svg.js","../src/ui/handle.jsx","../src/ui/wheel.jsx","../src/util/colorUtils.js","../src/color.js","../src/ui/slider.jsx","../src/util/createWidget.js","../src/colorPicker.js","../src/util/usePlugins.js","../src/iro.js"],"sourcesContent":["var VNode = function VNode() {};\n\nvar options = {};\n\nvar stack = [];\n\nvar EMPTY_CHILDREN = [];\n\nfunction h(nodeName, attributes) {\n\tvar children = EMPTY_CHILDREN,\n\t lastSimple,\n\t child,\n\t simple,\n\t i;\n\tfor (i = arguments.length; i-- > 2;) {\n\t\tstack.push(arguments[i]);\n\t}\n\tif (attributes && attributes.children != null) {\n\t\tif (!stack.length) stack.push(attributes.children);\n\t\tdelete attributes.children;\n\t}\n\twhile (stack.length) {\n\t\tif ((child = stack.pop()) && child.pop !== undefined) {\n\t\t\tfor (i = child.length; i--;) {\n\t\t\t\tstack.push(child[i]);\n\t\t\t}\n\t\t} else {\n\t\t\tif (typeof child === 'boolean') child = null;\n\n\t\t\tif (simple = typeof nodeName !== 'function') {\n\t\t\t\tif (child == null) child = '';else if (typeof child === 'number') child = String(child);else if (typeof child !== 'string') simple = false;\n\t\t\t}\n\n\t\t\tif (simple && lastSimple) {\n\t\t\t\tchildren[children.length - 1] += child;\n\t\t\t} else if (children === EMPTY_CHILDREN) {\n\t\t\t\tchildren = [child];\n\t\t\t} else {\n\t\t\t\tchildren.push(child);\n\t\t\t}\n\n\t\t\tlastSimple = simple;\n\t\t}\n\t}\n\n\tvar p = new VNode();\n\tp.nodeName = nodeName;\n\tp.children = children;\n\tp.attributes = attributes == null ? undefined : attributes;\n\tp.key = attributes == null ? undefined : attributes.key;\n\n\tif (options.vnode !== undefined) options.vnode(p);\n\n\treturn p;\n}\n\nfunction extend(obj, props) {\n for (var i in props) {\n obj[i] = props[i];\n }return obj;\n}\n\nfunction applyRef(ref, value) {\n if (ref != null) {\n if (typeof ref == 'function') ref(value);else ref.current = value;\n }\n}\n\nvar defer = typeof Promise == 'function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;\n\nfunction cloneElement(vnode, props) {\n return h(vnode.nodeName, extend(extend({}, vnode.attributes), props), arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children);\n}\n\nvar IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\n\nvar items = [];\n\nfunction enqueueRender(component) {\n\tif (!component._dirty && (component._dirty = true) && items.push(component) == 1) {\n\t\t(options.debounceRendering || defer)(rerender);\n\t}\n}\n\nfunction rerender() {\n\tvar p;\n\twhile (p = items.pop()) {\n\t\tif (p._dirty) renderComponent(p);\n\t}\n}\n\nfunction isSameNodeType(node, vnode, hydrating) {\n\tif (typeof vnode === 'string' || typeof vnode === 'number') {\n\t\treturn node.splitText !== undefined;\n\t}\n\tif (typeof vnode.nodeName === 'string') {\n\t\treturn !node._componentConstructor && isNamedNode(node, vnode.nodeName);\n\t}\n\treturn hydrating || node._componentConstructor === vnode.nodeName;\n}\n\nfunction isNamedNode(node, nodeName) {\n\treturn node.normalizedNodeName === nodeName || node.nodeName.toLowerCase() === nodeName.toLowerCase();\n}\n\nfunction getNodeProps(vnode) {\n\tvar props = extend({}, vnode.attributes);\n\tprops.children = vnode.children;\n\n\tvar defaultProps = vnode.nodeName.defaultProps;\n\tif (defaultProps !== undefined) {\n\t\tfor (var i in defaultProps) {\n\t\t\tif (props[i] === undefined) {\n\t\t\t\tprops[i] = defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn props;\n}\n\nfunction createNode(nodeName, isSvg) {\n\tvar node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName);\n\tnode.normalizedNodeName = nodeName;\n\treturn node;\n}\n\nfunction removeNode(node) {\n\tvar parentNode = node.parentNode;\n\tif (parentNode) parentNode.removeChild(node);\n}\n\nfunction setAccessor(node, name, old, value, isSvg) {\n\tif (name === 'className') name = 'class';\n\n\tif (name === 'key') {} else if (name === 'ref') {\n\t\tapplyRef(old, null);\n\t\tapplyRef(value, node);\n\t} else if (name === 'class' && !isSvg) {\n\t\tnode.className = value || '';\n\t} else if (name === 'style') {\n\t\tif (!value || typeof value === 'string' || typeof old === 'string') {\n\t\t\tnode.style.cssText = value || '';\n\t\t}\n\t\tif (value && typeof value === 'object') {\n\t\t\tif (typeof old !== 'string') {\n\t\t\t\tfor (var i in old) {\n\t\t\t\t\tif (!(i in value)) node.style[i] = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var i in value) {\n\t\t\t\tnode.style[i] = typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false ? value[i] + 'px' : value[i];\n\t\t\t}\n\t\t}\n\t} else if (name === 'dangerouslySetInnerHTML') {\n\t\tif (value) node.innerHTML = value.__html || '';\n\t} else if (name[0] == 'o' && name[1] == 'n') {\n\t\tvar useCapture = name !== (name = name.replace(/Capture$/, ''));\n\t\tname = name.toLowerCase().substring(2);\n\t\tif (value) {\n\t\t\tif (!old) node.addEventListener(name, eventProxy, useCapture);\n\t\t} else {\n\t\t\tnode.removeEventListener(name, eventProxy, useCapture);\n\t\t}\n\t\t(node._listeners || (node._listeners = {}))[name] = value;\n\t} else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\n\t\ttry {\n\t\t\tnode[name] = value == null ? '' : value;\n\t\t} catch (e) {}\n\t\tif ((value == null || value === false) && name != 'spellcheck') node.removeAttribute(name);\n\t} else {\n\t\tvar ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''));\n\n\t\tif (value == null || value === false) {\n\t\t\tif (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase());else node.removeAttribute(name);\n\t\t} else if (typeof value !== 'function') {\n\t\t\tif (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value);else node.setAttribute(name, value);\n\t\t}\n\t}\n}\n\nfunction eventProxy(e) {\n\treturn this._listeners[e.type](options.event && options.event(e) || e);\n}\n\nvar mounts = [];\n\nvar diffLevel = 0;\n\nvar isSvgMode = false;\n\nvar hydrating = false;\n\nfunction flushMounts() {\n\tvar c;\n\twhile (c = mounts.shift()) {\n\t\tif (options.afterMount) options.afterMount(c);\n\t\tif (c.componentDidMount) c.componentDidMount();\n\t}\n}\n\nfunction diff(dom, vnode, context, mountAll, parent, componentRoot) {\n\tif (!diffLevel++) {\n\t\tisSvgMode = parent != null && parent.ownerSVGElement !== undefined;\n\n\t\thydrating = dom != null && !('__preactattr_' in dom);\n\t}\n\n\tvar ret = idiff(dom, vnode, context, mountAll, componentRoot);\n\n\tif (parent && ret.parentNode !== parent) parent.appendChild(ret);\n\n\tif (! --diffLevel) {\n\t\thydrating = false;\n\n\t\tif (!componentRoot) flushMounts();\n\t}\n\n\treturn ret;\n}\n\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n\tvar out = dom,\n\t prevSvgMode = isSvgMode;\n\n\tif (vnode == null || typeof vnode === 'boolean') vnode = '';\n\n\tif (typeof vnode === 'string' || typeof vnode === 'number') {\n\t\tif (dom && dom.splitText !== undefined && dom.parentNode && (!dom._component || componentRoot)) {\n\t\t\tif (dom.nodeValue != vnode) {\n\t\t\t\tdom.nodeValue = vnode;\n\t\t\t}\n\t\t} else {\n\t\t\tout = document.createTextNode(vnode);\n\t\t\tif (dom) {\n\t\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\t\t\t\trecollectNodeTree(dom, true);\n\t\t\t}\n\t\t}\n\n\t\tout['__preactattr_'] = true;\n\n\t\treturn out;\n\t}\n\n\tvar vnodeName = vnode.nodeName;\n\tif (typeof vnodeName === 'function') {\n\t\treturn buildComponentFromVNode(dom, vnode, context, mountAll);\n\t}\n\n\tisSvgMode = vnodeName === 'svg' ? true : vnodeName === 'foreignObject' ? false : isSvgMode;\n\n\tvnodeName = String(vnodeName);\n\tif (!dom || !isNamedNode(dom, vnodeName)) {\n\t\tout = createNode(vnodeName, isSvgMode);\n\n\t\tif (dom) {\n\t\t\twhile (dom.firstChild) {\n\t\t\t\tout.appendChild(dom.firstChild);\n\t\t\t}\n\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\n\t\t\trecollectNodeTree(dom, true);\n\t\t}\n\t}\n\n\tvar fc = out.firstChild,\n\t props = out['__preactattr_'],\n\t vchildren = vnode.children;\n\n\tif (props == null) {\n\t\tprops = out['__preactattr_'] = {};\n\t\tfor (var a = out.attributes, i = a.length; i--;) {\n\t\t\tprops[a[i].name] = a[i].value;\n\t\t}\n\t}\n\n\tif (!hydrating && vchildren && vchildren.length === 1 && typeof vchildren[0] === 'string' && fc != null && fc.splitText !== undefined && fc.nextSibling == null) {\n\t\tif (fc.nodeValue != vchildren[0]) {\n\t\t\tfc.nodeValue = vchildren[0];\n\t\t}\n\t} else if (vchildren && vchildren.length || fc != null) {\n\t\t\tinnerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML != null);\n\t\t}\n\n\tdiffAttributes(out, vnode.attributes, props);\n\n\tisSvgMode = prevSvgMode;\n\n\treturn out;\n}\n\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n\tvar originalChildren = dom.childNodes,\n\t children = [],\n\t keyed = {},\n\t keyedLen = 0,\n\t min = 0,\n\t len = originalChildren.length,\n\t childrenLen = 0,\n\t vlen = vchildren ? vchildren.length : 0,\n\t j,\n\t c,\n\t f,\n\t vchild,\n\t child;\n\n\tif (len !== 0) {\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tvar _child = originalChildren[i],\n\t\t\t props = _child['__preactattr_'],\n\t\t\t key = vlen && props ? _child._component ? _child._component.__key : props.key : null;\n\t\t\tif (key != null) {\n\t\t\t\tkeyedLen++;\n\t\t\t\tkeyed[key] = _child;\n\t\t\t} else if (props || (_child.splitText !== undefined ? isHydrating ? _child.nodeValue.trim() : true : isHydrating)) {\n\t\t\t\tchildren[childrenLen++] = _child;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (vlen !== 0) {\n\t\tfor (var i = 0; i < vlen; i++) {\n\t\t\tvchild = vchildren[i];\n\t\t\tchild = null;\n\n\t\t\tvar key = vchild.key;\n\t\t\tif (key != null) {\n\t\t\t\tif (keyedLen && keyed[key] !== undefined) {\n\t\t\t\t\tchild = keyed[key];\n\t\t\t\t\tkeyed[key] = undefined;\n\t\t\t\t\tkeyedLen--;\n\t\t\t\t}\n\t\t\t} else if (min < childrenLen) {\n\t\t\t\t\tfor (j = min; j < childrenLen; j++) {\n\t\t\t\t\t\tif (children[j] !== undefined && isSameNodeType(c = children[j], vchild, isHydrating)) {\n\t\t\t\t\t\t\tchild = c;\n\t\t\t\t\t\t\tchildren[j] = undefined;\n\t\t\t\t\t\t\tif (j === childrenLen - 1) childrenLen--;\n\t\t\t\t\t\t\tif (j === min) min++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\tchild = idiff(child, vchild, context, mountAll);\n\n\t\t\tf = originalChildren[i];\n\t\t\tif (child && child !== dom && child !== f) {\n\t\t\t\tif (f == null) {\n\t\t\t\t\tdom.appendChild(child);\n\t\t\t\t} else if (child === f.nextSibling) {\n\t\t\t\t\tremoveNode(f);\n\t\t\t\t} else {\n\t\t\t\t\tdom.insertBefore(child, f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (keyedLen) {\n\t\tfor (var i in keyed) {\n\t\t\tif (keyed[i] !== undefined) recollectNodeTree(keyed[i], false);\n\t\t}\n\t}\n\n\twhile (min <= childrenLen) {\n\t\tif ((child = children[childrenLen--]) !== undefined) recollectNodeTree(child, false);\n\t}\n}\n\nfunction recollectNodeTree(node, unmountOnly) {\n\tvar component = node._component;\n\tif (component) {\n\t\tunmountComponent(component);\n\t} else {\n\t\tif (node['__preactattr_'] != null) applyRef(node['__preactattr_'].ref, null);\n\n\t\tif (unmountOnly === false || node['__preactattr_'] == null) {\n\t\t\tremoveNode(node);\n\t\t}\n\n\t\tremoveChildren(node);\n\t}\n}\n\nfunction removeChildren(node) {\n\tnode = node.lastChild;\n\twhile (node) {\n\t\tvar next = node.previousSibling;\n\t\trecollectNodeTree(node, true);\n\t\tnode = next;\n\t}\n}\n\nfunction diffAttributes(dom, attrs, old) {\n\tvar name;\n\n\tfor (name in old) {\n\t\tif (!(attrs && attrs[name] != null) && old[name] != null) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = undefined, isSvgMode);\n\t\t}\n\t}\n\n\tfor (name in attrs) {\n\t\tif (name !== 'children' && name !== 'innerHTML' && (!(name in old) || attrs[name] !== (name === 'value' || name === 'checked' ? dom[name] : old[name]))) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode);\n\t\t}\n\t}\n}\n\nvar recyclerComponents = [];\n\nfunction createComponent(Ctor, props, context) {\n\tvar inst,\n\t i = recyclerComponents.length;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\twhile (i--) {\n\t\tif (recyclerComponents[i].constructor === Ctor) {\n\t\t\tinst.nextBase = recyclerComponents[i].nextBase;\n\t\t\trecyclerComponents.splice(i, 1);\n\t\t\treturn inst;\n\t\t}\n\t}\n\n\treturn inst;\n}\n\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n\nfunction setComponentProps(component, props, renderMode, context, mountAll) {\n\tif (component._disable) return;\n\tcomponent._disable = true;\n\n\tcomponent.__ref = props.ref;\n\tcomponent.__key = props.key;\n\tdelete props.ref;\n\tdelete props.key;\n\n\tif (typeof component.constructor.getDerivedStateFromProps === 'undefined') {\n\t\tif (!component.base || mountAll) {\n\t\t\tif (component.componentWillMount) component.componentWillMount();\n\t\t} else if (component.componentWillReceiveProps) {\n\t\t\tcomponent.componentWillReceiveProps(props, context);\n\t\t}\n\t}\n\n\tif (context && context !== component.context) {\n\t\tif (!component.prevContext) component.prevContext = component.context;\n\t\tcomponent.context = context;\n\t}\n\n\tif (!component.prevProps) component.prevProps = component.props;\n\tcomponent.props = props;\n\n\tcomponent._disable = false;\n\n\tif (renderMode !== 0) {\n\t\tif (renderMode === 1 || options.syncComponentUpdates !== false || !component.base) {\n\t\t\trenderComponent(component, 1, mountAll);\n\t\t} else {\n\t\t\tenqueueRender(component);\n\t\t}\n\t}\n\n\tapplyRef(component.__ref, component);\n}\n\nfunction renderComponent(component, renderMode, mountAll, isChild) {\n\tif (component._disable) return;\n\n\tvar props = component.props,\n\t state = component.state,\n\t context = component.context,\n\t previousProps = component.prevProps || props,\n\t previousState = component.prevState || state,\n\t previousContext = component.prevContext || context,\n\t isUpdate = component.base,\n\t nextBase = component.nextBase,\n\t initialBase = isUpdate || nextBase,\n\t initialChildComponent = component._component,\n\t skip = false,\n\t snapshot = previousContext,\n\t rendered,\n\t inst,\n\t cbase;\n\n\tif (component.constructor.getDerivedStateFromProps) {\n\t\tstate = extend(extend({}, state), component.constructor.getDerivedStateFromProps(props, state));\n\t\tcomponent.state = state;\n\t}\n\n\tif (isUpdate) {\n\t\tcomponent.props = previousProps;\n\t\tcomponent.state = previousState;\n\t\tcomponent.context = previousContext;\n\t\tif (renderMode !== 2 && component.shouldComponentUpdate && component.shouldComponentUpdate(props, state, context) === false) {\n\t\t\tskip = true;\n\t\t} else if (component.componentWillUpdate) {\n\t\t\tcomponent.componentWillUpdate(props, state, context);\n\t\t}\n\t\tcomponent.props = props;\n\t\tcomponent.state = state;\n\t\tcomponent.context = context;\n\t}\n\n\tcomponent.prevProps = component.prevState = component.prevContext = component.nextBase = null;\n\tcomponent._dirty = false;\n\n\tif (!skip) {\n\t\trendered = component.render(props, state, context);\n\n\t\tif (component.getChildContext) {\n\t\t\tcontext = extend(extend({}, context), component.getChildContext());\n\t\t}\n\n\t\tif (isUpdate && component.getSnapshotBeforeUpdate) {\n\t\t\tsnapshot = component.getSnapshotBeforeUpdate(previousProps, previousState);\n\t\t}\n\n\t\tvar childComponent = rendered && rendered.nodeName,\n\t\t toUnmount,\n\t\t base;\n\n\t\tif (typeof childComponent === 'function') {\n\n\t\t\tvar childProps = getNodeProps(rendered);\n\t\t\tinst = initialChildComponent;\n\n\t\t\tif (inst && inst.constructor === childComponent && childProps.key == inst.__key) {\n\t\t\t\tsetComponentProps(inst, childProps, 1, context, false);\n\t\t\t} else {\n\t\t\t\ttoUnmount = inst;\n\n\t\t\t\tcomponent._component = inst = createComponent(childComponent, childProps, context);\n\t\t\t\tinst.nextBase = inst.nextBase || nextBase;\n\t\t\t\tinst._parentComponent = component;\n\t\t\t\tsetComponentProps(inst, childProps, 0, context, false);\n\t\t\t\trenderComponent(inst, 1, mountAll, true);\n\t\t\t}\n\n\t\t\tbase = inst.base;\n\t\t} else {\n\t\t\tcbase = initialBase;\n\n\t\t\ttoUnmount = initialChildComponent;\n\t\t\tif (toUnmount) {\n\t\t\t\tcbase = component._component = null;\n\t\t\t}\n\n\t\t\tif (initialBase || renderMode === 1) {\n\t\t\t\tif (cbase) cbase._component = null;\n\t\t\t\tbase = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, true);\n\t\t\t}\n\t\t}\n\n\t\tif (initialBase && base !== initialBase && inst !== initialChildComponent) {\n\t\t\tvar baseParent = initialBase.parentNode;\n\t\t\tif (baseParent && base !== baseParent) {\n\t\t\t\tbaseParent.replaceChild(base, initialBase);\n\n\t\t\t\tif (!toUnmount) {\n\t\t\t\t\tinitialBase._component = null;\n\t\t\t\t\trecollectNodeTree(initialBase, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (toUnmount) {\n\t\t\tunmountComponent(toUnmount);\n\t\t}\n\n\t\tcomponent.base = base;\n\t\tif (base && !isChild) {\n\t\t\tvar componentRef = component,\n\t\t\t t = component;\n\t\t\twhile (t = t._parentComponent) {\n\t\t\t\t(componentRef = t).base = base;\n\t\t\t}\n\t\t\tbase._component = componentRef;\n\t\t\tbase._componentConstructor = componentRef.constructor;\n\t\t}\n\t}\n\n\tif (!isUpdate || mountAll) {\n\t\tmounts.push(component);\n\t} else if (!skip) {\n\n\t\tif (component.componentDidUpdate) {\n\t\t\tcomponent.componentDidUpdate(previousProps, previousState, snapshot);\n\t\t}\n\t\tif (options.afterUpdate) options.afterUpdate(component);\n\t}\n\n\twhile (component._renderCallbacks.length) {\n\t\tcomponent._renderCallbacks.pop().call(component);\n\t}if (!diffLevel && !isChild) flushMounts();\n}\n\nfunction buildComponentFromVNode(dom, vnode, context, mountAll) {\n\tvar c = dom && dom._component,\n\t originalComponent = c,\n\t oldDom = dom,\n\t isDirectOwner = c && dom._componentConstructor === vnode.nodeName,\n\t isOwner = isDirectOwner,\n\t props = getNodeProps(vnode);\n\twhile (c && !isOwner && (c = c._parentComponent)) {\n\t\tisOwner = c.constructor === vnode.nodeName;\n\t}\n\n\tif (c && isOwner && (!mountAll || c._component)) {\n\t\tsetComponentProps(c, props, 3, context, mountAll);\n\t\tdom = c.base;\n\t} else {\n\t\tif (originalComponent && !isDirectOwner) {\n\t\t\tunmountComponent(originalComponent);\n\t\t\tdom = oldDom = null;\n\t\t}\n\n\t\tc = createComponent(vnode.nodeName, props, context);\n\t\tif (dom && !c.nextBase) {\n\t\t\tc.nextBase = dom;\n\n\t\t\toldDom = null;\n\t\t}\n\t\tsetComponentProps(c, props, 1, context, mountAll);\n\t\tdom = c.base;\n\n\t\tif (oldDom && dom !== oldDom) {\n\t\t\toldDom._component = null;\n\t\t\trecollectNodeTree(oldDom, false);\n\t\t}\n\t}\n\n\treturn dom;\n}\n\nfunction unmountComponent(component) {\n\tif (options.beforeUnmount) options.beforeUnmount(component);\n\n\tvar base = component.base;\n\n\tcomponent._disable = true;\n\n\tif (component.componentWillUnmount) component.componentWillUnmount();\n\n\tcomponent.base = null;\n\n\tvar inner = component._component;\n\tif (inner) {\n\t\tunmountComponent(inner);\n\t} else if (base) {\n\t\tif (base['__preactattr_'] != null) applyRef(base['__preactattr_'].ref, null);\n\n\t\tcomponent.nextBase = base;\n\n\t\tremoveNode(base);\n\t\trecyclerComponents.push(component);\n\n\t\tremoveChildren(base);\n\t}\n\n\tapplyRef(component.__ref, null);\n}\n\nfunction Component(props, context) {\n\tthis._dirty = true;\n\n\tthis.context = context;\n\n\tthis.props = props;\n\n\tthis.state = this.state || {};\n\n\tthis._renderCallbacks = [];\n}\n\nextend(Component.prototype, {\n\tsetState: function setState(state, callback) {\n\t\tif (!this.prevState) this.prevState = this.state;\n\t\tthis.state = extend(extend({}, this.state), typeof state === 'function' ? state(this.state, this.props) : state);\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t},\n\tforceUpdate: function forceUpdate(callback) {\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\trenderComponent(this, 2);\n\t},\n\trender: function render() {}\n});\n\nfunction render(vnode, parent, merge) {\n return diff(merge, vnode, {}, false, parent, false);\n}\n\nfunction createRef() {\n\treturn {};\n}\n\nvar preact = {\n\th: h,\n\tcreateElement: h,\n\tcloneElement: cloneElement,\n\tcreateRef: createRef,\n\tComponent: Component,\n\trender: render,\n\trerender: rerender,\n\toptions: options\n};\n\nexport default preact;\nexport { h, h as createElement, cloneElement, createRef, Component, render, rerender, options };\n//# sourceMappingURL=preact.mjs.map\n","/**\n * @desc listen to one or more events on an element\n * @param {Element} el target element\n * @param {Array} eventList the events to listen to\n * @param {Function} callback\n * @param {Object} params params to pass to addEventListener\n */\nexport function listen(el, eventList, callback, params={}) {\n for (var i = 0; i < eventList.length; i++) {\n el.addEventListener(eventList[i], callback, params);\n }\n};\n\n/**\n * @desc remove an event listener on an element\n * @param {Element} el target element\n * @param {Array} eventList the events to remove\n * @param {Function} callback\n * @param {Object} params params to pass to removeEventListener\n */\nexport function unlisten(el, eventList, callback, params={}) {\n for (var i = 0; i < eventList.length; i++) {\n el.removeEventListener(eventList[i], callback, params);\n }\n};\n\n/**\n * @desc call fn callback when the page document has fully loaded\n * @param {Function} callback\n */\nexport function onDocumentReady(callback) {\n if (document.readyState !== 'loading') {\n callback();\n } else {\n listen(document, ['DOMContentLoaded'], callback);\n }\n};","import { Component } from 'preact';\nimport { listen, unlisten } from 'util/dom';\n\nconst EVENT_MOUSEDOWN = 'mousedown';\nconst EVENT_MOUSEMOVE = 'mousemove';\nconst EVENT_MOUSEUP = 'mouseup';\nconst EVENT_TOUCHSTART = 'touchstart';\nconst EVENT_TOUCHMOVE = 'touchmove';\nconst EVENT_TOUCHEND = 'touchend';\n\n/**\n * Base component class for iro UI components\n * This extends the Preact component class to allow them to react to mouse/touch input events by themselves\n */\nexport default class IroComponent extends Component {\n\n constructor(props) {\n super(props);\n // Generate unique ID for the component\n // This can be used to generate unique IDs for gradients, etc\n this.uid = (Math.random() + 1).toString(36).substring(5);\n }\n \n componentDidMount() {\n listen(this.base, [EVENT_MOUSEDOWN, EVENT_TOUCHSTART], this, { passive: false });\n }\n\n componentWillUnmount() {\n unlisten(this.base, [EVENT_MOUSEDOWN, EVENT_TOUCHSTART], this);\n }\n\n // More info on handleEvent:\n // https://medium.com/@WebReflection/dom-handleevent-a-cross-platform-standard-since-year-2000-5bf17287fd38\n // TL;DR this lets us have a single point of entry for multiple events, and we can avoid callback/binding hell\n handleEvent(e) {\n e.preventDefault();\n // Detect if the event is a touch event by checking if it has the `touches` property\n // If it is a touch event, use the first touch input\n const point = e.touches ? e.changedTouches[0] : e;\n const x = point.clientX;\n const y = point.clientY;\n // Get the screen position of the component\n const bounds = this.base.getBoundingClientRect();\n\n switch (e.type) {\n case EVENT_MOUSEDOWN:\n case EVENT_TOUCHSTART:\n listen(document, [EVENT_MOUSEMOVE, EVENT_TOUCHMOVE, EVENT_MOUSEUP, EVENT_TOUCHEND], this, { passive: false });\n this.handleInput(x, y, bounds, 'START');\n break;\n case EVENT_MOUSEMOVE:\n case EVENT_TOUCHMOVE:\n this.handleInput(x, y, bounds, 'MOVE');\n break;\n case EVENT_MOUSEUP:\n case EVENT_TOUCHEND:\n this.handleInput(x, y, bounds, 'END');\n unlisten(document, [EVENT_MOUSEMOVE, EVENT_TOUCHMOVE, EVENT_MOUSEUP, EVENT_TOUCHEND], this, { passive: false });\n break;\n }\n }\n}\n","/**\n * @desc Resolve an SVG URL\n * This is required to work around how Safari handles gradient URLS under certain conditions\n * If a page is using a client-side routing library which makes use of the HTML tag, \n * Safari won't be able to render SVG gradients properly (as they are referenced by URLs)\n * More info on the problem: \n * https://stackoverflow.com/questions/19742805/angular-and-svg-filters/19753427#19753427\n * https://github.com/jaames/iro.js/issues/18\n * https://github.com/jaames/iro.js/issues/45\n * @param {String} url resource url (should be an id selector e.g \"#example\")\n * @returns {String} resolved url\n */\nexport function resolveUrl(url) {\n // Sniff useragent string to check if the user is running Safari\n const ua = window.navigator.userAgent;\n const isSafari = /^((?!chrome|android).)*safari/i.test(ua);\n const isIos = /iPhone|iPod|iPad/i.test(ua);\n const location = window.location;\n return (isSafari || isIos) ? `${location.protocol}//${location.host}${location.pathname}${location.search}${url}` : url;\n}\n\n/**\n * @desc create the path commands to draw an svg arc\n * @param {Number} cx center point x\n * @param {Number} cy center point y\n * @param {Number} radius arc radius\n * @param {Number} startAngle arc start angle (degrees)\n * @param {Number} endAngle arc end angle (degrees)\n * @returns {String} arc path commands\n */\nexport function createArcPath(cx, cy, radius, startAngle, endAngle) {\n const largeArcFlag = endAngle - startAngle <= 180 ? 0 : 1;\n startAngle *= Math.PI / 180;\n endAngle *= Math.PI / 180;\n const x1 = cx + radius * Math.cos(endAngle);\n const y1 = cy + radius * Math.sin(endAngle);\n const x2 = cx + radius * Math.cos(startAngle);\n const y2 = cy + radius * Math.sin(startAngle);\n return `M ${x1} ${y1} A ${radius} ${radius} 0 ${largeArcFlag} 0 ${x2} ${y2}`;\n}","import { h } from 'preact';\nimport { resolveUrl } from '../util/svg';\n\nfunction IroHandle(props) {\n \n const radius = props.r;\n const url = props.url;\n\n return (\n \n {url && (\n \n )}\n {!url && (\n \n )}\n {!url && (\n \n )}\n \n );\n}\n\nIroHandle.defaultProps = {\n x: 0,\n y: 0,\n r: 8,\n url: null,\n origin: {x: 0, y: 0}\n};\n\nexport default IroHandle;","import { h } from 'preact';\n\nimport IroComponent from 'ui/component';\nimport IroHandle from 'ui/handle';\nimport { resolveUrl, createArcPath } from '../util/svg';\n\nconst HUE_STEPS = Array.apply(null, {length: 360}).map((_, index) => index);\n\nexport default class IroWheel extends IroComponent {\n\n _transformAngle(angle, handleFix) {\n const wheelAngle = this.props.wheelAngle;\n if (this.props.wheelDirection === 'clockwise') {\n // im sure this math could be simplified...\n angle = (-360 + angle - (handleFix ? -wheelAngle : wheelAngle));\n } else {\n angle = wheelAngle - angle\n }\n // javascript's modulo operator doesn't produce positive numbers with negative input\n // https://dev.to/maurobringolf/a-neat-trick-to-compute-modulo-of-negative-numbers-111e\n return (angle % 360 + 360) % 360;\n }\n\n render(props) {\n let { width, borderWidth, handleRadius } = props;\n const hsv = props.color.hsv;\n const radius = (width / 2) - borderWidth;\n const handleAngle = this._transformAngle(hsv.h, true) * (Math.PI / 180);\n const handleDist = (hsv.s / 100) * (radius - props.padding - handleRadius - borderWidth);\n const cX = radius + borderWidth;\n const cY = radius + borderWidth;\n \n return (\n \n \n \n \n \n \n \n \n { HUE_STEPS.map(angle => (\n \n ))}\n \n \n { props.wheelLightness && (\n \n )}\n \n \n \n );\n }\n\n /**\n * @desc handles mouse input for this component\n * @param {Number} x - point x coordinate\n * @param {Number} y - point y coordinate\n * @param {DOMRect} rect - bounding client rect for the component's base element\n * @param {String} type - input type: \"START\", \"MOVE\" or \"END\"\n */\n handleInput(x, y, { left, top }, type) {\n const props = this.props;\n const radius = props.width / 2;\n const handleRange = (radius - props.padding - props.handleRadius - props.borderWidth);\n const cX = radius;\n const cY = radius;\n\n x = cX - (x - left);\n y = cY - (y - top);\n\n let handleAngle = Math.atan2(y, x);\n // Calculate the hue by converting the angle to radians\n let hue = this._transformAngle(Math.round(handleAngle * (180 / Math.PI)) + 180);\n // Find the point's distance from the center of the wheel\n // This is used to show the saturation level\n let handleDist = Math.min(Math.sqrt(x * x + y * y), handleRange);\n props.onInput(type, {\n h: hue,\n s: Math.round((100 / handleRange) * handleDist)\n });\n }\n}","/**\n * @desc Parse a css unit string - either regular int or a percentage number\n * @param {String} str input string\n * @param {String} max max number for converting percentages\n * @returns {Number} \n */\nexport function parseUnit(str, max) {\n const isPercentage = str.indexOf('%') > -1;\n const num = parseFloat(str);\n return isPercentage ? (max / 100) * num : num;\n}\n\n/**\n * @desc Parse hex str to an int\n * @param {String} str input string\n * @returns {Number} \n */\nexport function parseHexInt(str) {\n return parseInt(str, 16);\n}\n\n/**\n * @desc Convert into to 2-digit hex\n * @param {Number} int input number\n * @returns {String} \n */\nexport function intToHex(int) {\n return int.toString(16).padStart(2, '0');\n}","import { parseUnit, parseHexInt, intToHex } from './util/colorUtils';\n\n// Some regular expressions for rgb() and hsl() Colors are borrowed from tinyColor\n// https://github.com/bgrins/TinyColor\n\n// https://www.w3.org/TR/css3-values/#integers\nconst CSS_INTEGER = `[-\\\\+]?\\\\d+%?`;\n// http://www.w3.org/TR/css3-values/#number-value\nconst CSS_NUMBER = `[-\\\\+]?\\\\d*\\\\.\\\\d+%?`;\n// Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome\nconst CSS_UNIT = `(?:${ CSS_NUMBER })|(?:${ CSS_INTEGER })`;\n\n// Parse function params\n// Parens and commas are optional, and this also allows for whitespace between numbers\nconst PERMISSIVE_MATCH_3 = `[\\\\s|\\\\(]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })\\\\s*\\\\)?`;\nconst PERMISSIVE_MATCH_4 = `[\\\\s|\\\\(]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })\\\\s*\\\\)?`;\n\n// Regex patterns for functional colors\nconst REGEX_FUNCTIONAL_RGB = new RegExp(`rgb${ PERMISSIVE_MATCH_3 }`);\nconst REGEX_FUNCTIONAL_RGBA = new RegExp(`rgba${ PERMISSIVE_MATCH_4 }`);\nconst REGEX_FUNCTIONAL_HSL = new RegExp(`hsl${ PERMISSIVE_MATCH_3 }`);\nconst REGEX_FUNCTIONAL_HSLA = new RegExp(`hsla${ PERMISSIVE_MATCH_4 }`);\n\nconst HEX_START = `^(?:#?|0x?)`;\nconst HEX_INT_SINGLE = `([0-9a-fA-F]{1})`;\nconst HEX_INT_DOUBLE = `([0-9a-fA-F]{2})`;\nconst REGEX_HEX_3 = new RegExp(`${ HEX_START }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }$`);\nconst REGEX_HEX_4 = new RegExp(`${ HEX_START }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }$`);\nconst REGEX_HEX_6 = new RegExp(`${ HEX_START }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }$`);\nconst REGEX_HEX_8 = new RegExp(`${ HEX_START }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }$`);\n\nexport default class Color {\n /**\n * @constructor Color object\n * @param {Object | String | Color} value - Color instance, object (hsv, hsl or rgb), string (hsl, rgb, hex)\n */\n constructor(value) {\n // The watch callback function for this Color will be stored here\n this._onChange = false;\n // The default Color value\n this._value = {h: 0, s: 0, v: 0, a: 1};\n if (value) this.set(value);\n }\n\n /**\n * @desc set the Color from any valid value\n * @param {Object | String | Color} value - Color instance, object (hsv, hsl or rgb), string (hsl, rgb, hex)\n */\n set(value) {\n const isString = typeof value === 'string';\n const isObject = typeof value === 'object';\n if ((isString) && (/^(?:#?|0x?)[0-9a-fA-F]{3,8}$/.test(value))) {\n this.hexString = value;\n }\n else if ((isString) && (/^rgba?/.test(value))) {\n this.rgbString = value;\n }\n else if ((isString) && (/^hsla?/.test(value))) {\n this.hslString = value;\n }\n else if ((isObject) && (value instanceof Color)) {\n this.hsv = value.hsv;\n }\n else if ((isObject) && ('r' in value) && ('g' in value) && ('b' in value)) {\n this.rgb = value;\n }\n else if ((isObject) && ('h' in value) && ('s' in value) && ('v' in value)) {\n this.hsv = value;\n }\n else if ((isObject) && ('h' in value) && ('s' in value) && ('l' in value)) {\n this.hsl = value;\n }\n else {\n throw new Error('invalid color value');\n }\n }\n\n /**\n * @desc shortcut to set a specific channel value\n * @param {String} format - hsv | hsl | rgb\n * @param {String} channel - individual channel to set, for example if model = hsl, chanel = h | s | l\n * @param {Number} value - new value for the channel\n */\n setChannel(format, channel, value) {\n this[format] = {...this[format], [channel]: value};\n }\n\n /**\n * @desc make new Color instance with the same value as this one\n * @return {Color}\n */\n clone() {\n return new Color(this);\n }\n\n /**\n * @desc convert hsv object to rgb\n * @param {Object} hsv hsv object\n * @return {Object} rgb object\n */\n static hsvToRgb(hsv) {\n const h = hsv.h / 60;\n const s = hsv.s / 100;\n const v = hsv.v / 100;\n const i = Math.floor(h);\n const f = h - i;\n const p = v * (1 - s);\n const q = v * (1 - f * s);\n const t = v * (1 - (1 - f) * s);\n const mod = i % 6;\n const r = [v, q, p, p, t, v][mod];\n const g = [t, v, v, q, p, p][mod];\n const b = [p, p, t, v, v, q][mod];\n return {\n r: r * 255, \n g: g * 255, \n b: b * 255\n };\n }\n\n /**\n * @desc convert rgb object to hsv\n * @param {Object} rgb - rgb object\n * @return {Object} hsv object\n */\n static rgbToHsv(rgb) {\n const r = rgb.r / 255;\n const g = rgb.g / 255;\n const b = rgb.b / 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const delta = max - min;\n let hue;\n let value = max;\n let saturation = max === 0 ? 0 : delta / max;\n switch (max) {\n case min: \n hue = 0; // achromatic\n break;\n case r: \n hue = (g - b) / delta + (g < b ? 6 : 0);\n break;\n case g: \n hue = (b - r) / delta + 2;\n break;\n case b:\n hue = (r - g) / delta + 4;\n break;\n }\n return {\n h: hue * 60,\n s: saturation * 100,\n v: value * 100\n }\n }\n\n /**\n * @desc convert hsv object to hsl\n * @param {Object} hsv - hsv object\n * @return {Object} hsl object\n */\n static hsvToHsl(hsv) {\n const s = hsv.s / 100;\n const v = hsv.v / 100;\n const l = (2 - s) * v;\n const divisor = l <= 1 ? l : (2 - l);\n // Avoid division by zero when lightness is close to zero\n const saturation = divisor < 1e-9 ? 0 : (s * v) / divisor;\n return {\n h: hsv.h,\n s: saturation * 100,\n l: l * 50\n };\n }\n\n /**\n * @desc convert hsl object to hsv\n * @param {Object} hsl - hsl object\n * @return {Object} hsv object\n */\n static hslToHsv(hsl) {\n const l = hsl.l * 2;\n const s = (hsl.s * ((l <= 100) ? l : 200 - l)) / 100;\n // Avoid division by zero when l + s is near 0\n const saturation = (l + s < 1e-9) ? 0 : (2 * s) / (l + s);\n return {\n h: hsl.h,\n s: saturation * 100,\n v: (l + s) / 2\n };\n }\n\n get hsv() {\n // _value is cloned to allow changes to be made to the values before passing them back\n const value = this._value;\n return {h: value.h, s: value.s, v: value.v};\n }\n\n set hsv(newValue) {\n const oldValue = this._value;\n newValue = { ...oldValue, ...newValue };\n // If this Color is being watched for changes we need to compare the new and old values to check the difference\n // Otherwise we can just be lazy\n if (this._onChange) {\n // Compute changed values\n let changes = {};\n for (let key in oldValue) {\n changes[key] = newValue[key] != oldValue[key]\n };\n // Update the old value\n this._value = newValue;\n // If the value has changed, call hook callback\n if (changes.h || changes.s || changes.v || changes.a) this._onChange(this, changes);\n } else {\n this._value = newValue;\n }\n }\n\n get rgb() {\n const {r, g, b} = Color.hsvToRgb(this._value);\n return {\n r: Math.round(r),\n g: Math.round(g),\n b: Math.round(b),\n };\n }\n\n set rgb(value) {\n this.hsv = {...Color.rgbToHsv(value), a: (value.a === undefined) ? 1 : value.a};\n }\n\n get hsl() {\n const {h, s, l} = Color.hsvToHsl(this._value);\n return {\n h: Math.round(h),\n s: Math.round(s),\n l: Math.round(l),\n };\n }\n\n set hsl(value) {\n this.hsv = {...Color.hslToHsv(value), a: (value.a === undefined) ? 1 : value.a};\n }\n\n get rgbString() {\n const rgb = this.rgb;\n return `rgb(${rgb.r}, ${rgb.g}, ${rgb.b})`;\n }\n\n set rgbString(value) {\n let match;\n let r, g, b, a = 1;\n if (match = REGEX_FUNCTIONAL_RGB.exec(value)) {\n r = parseUnit(match[1], 255);\n g = parseUnit(match[2], 255);\n b = parseUnit(match[3], 255);\n }\n else if (match = REGEX_FUNCTIONAL_RGBA.exec(value)) {\n r = parseUnit(match[1], 255);\n g = parseUnit(match[2], 255);\n b = parseUnit(match[3], 255);\n a = parseUnit(match[4], 1);\n }\n if (match) {\n this.rgb = {r, g, b, a};\n } \n else {\n throw new Error('invalid rgb string');\n }\n }\n\n get hexString() {\n const rgb = this.rgb;\n return `#${ intToHex(rgb.r) }${ intToHex(rgb.g) }${ intToHex(rgb.b) }`;\n }\n\n set hexString(value) {\n let match;\n let r, g, b, a = 255;\n if (match = REGEX_HEX_3.exec(value)) {\n r = parseHexInt(match[1]) * 17;\n g = parseHexInt(match[2]) * 17;\n b = parseHexInt(match[3]) * 17;\n }\n else if (match = REGEX_HEX_4.exec(value)) {\n r = parseHexInt(match[1]) * 17;\n g = parseHexInt(match[2]) * 17;\n b = parseHexInt(match[3]) * 17;\n a = parseHexInt(match[4]) * 17;\n }\n else if (match = REGEX_HEX_6.exec(value)) {\n r = parseHexInt(match[1]);\n g = parseHexInt(match[2]);\n b = parseHexInt(match[3]);\n }\n else if (match = REGEX_HEX_8.exec(value)) {\n r = parseHexInt(match[1]);\n g = parseHexInt(match[2]);\n b = parseHexInt(match[3]);\n a = parseHexInt(match[4]);\n }\n if (match) {\n this.rgb = {r, g, b, a: a / 255};\n }\n else {\n throw new Error('invalid hex string');\n }\n }\n\n get hslString() {\n const hsl = this.hsl;\n return `hsl(${hsl.h}, ${hsl.s}%, ${hsl.l}%)`;\n }\n\n set hslString(value) {\n let match;\n let h, s, l, a = 1;\n if (match = REGEX_FUNCTIONAL_HSL.exec(value)) {\n h = parseUnit(match[1], 360);\n s = parseUnit(match[2], 100);\n l = parseUnit(match[3], 100);\n }\n else if (match = REGEX_FUNCTIONAL_HSLA.exec(value)) {\n h = parseUnit(match[1], 360);\n s = parseUnit(match[2], 100);\n l = parseUnit(match[3], 100);\n a = parseUnit(match[4], 1);\n }\n if (match) {\n this.hsl = {h, s, l, a};\n } \n else {\n throw new Error('invalid hsl string');\n }\n }\n}","import { h } from 'preact';\n\nimport IroComponent from 'ui/component';\nimport IroHandle from 'ui/handle';\nimport IroColor from '../color';\nimport { resolveUrl } from '../util/svg';\n\nexport default class IroSlider extends IroComponent {\n\n renderGradient(props) {\n const hsv = props.color.hsv;\n let stops = [];\n\n switch (props.sliderType) {\n case 'hue':\n stops = [\n {offset: '0', color: '#f00'},\n {offset: '16.666', color: '#ff0'},\n {offset: '33.333', color: '#0f0'},\n {offset: '50', color: '#0ff'},\n {offset: '66.666', color: '#00f'},\n {offset: '83.333', color: '#f0f'},\n {offset: '100', color: '#f00'},\n ];\n break;\n case 'saturation':\n var noSat = IroColor.hsvToHsl({h: hsv.h, s: 0, v: hsv.v});\n var fullSat = IroColor.hsvToHsl({h: hsv.h, s: 100, v: hsv.v});\n stops = [\n {offset: '0', color: `hsl(${noSat.h}, ${noSat.s}%, ${noSat.l}%)`},\n {offset: '100', color: `hsl(${fullSat.h}, ${fullSat.s}%, ${fullSat.l}%)`}\n ];\n break;\n case 'value':\n default:\n var hsl = IroColor.hsvToHsl({h: hsv.h, s: hsv.s, v: 100});\n stops = [\n {offset: '0', color: '#000'},\n {offset: '100', color: `hsl(${hsl.h}, ${hsl.s}%, ${hsl.l}%)`}\n ];\n break;\n }\n\n return (\n \n {stops.map(stop => (\n \n ))}\n \n )\n }\n\n render(props) {\n let { width, sliderHeight, borderWidth, handleRadius } = props;\n sliderHeight = sliderHeight ? sliderHeight : props.padding * 2 + handleRadius * 2 + borderWidth * 2;\n this.width = width;\n this.height = sliderHeight;\n const cornerRadius = sliderHeight / 2;\n const range = width - cornerRadius * 2\n const hsv = props.color.hsv;\n \n let sliderValue;\n switch (props.sliderType) {\n case 'hue':\n sliderValue = hsv.h /= 3.6;\n break;\n case 'saturation':\n sliderValue = hsv.s;\n break;\n case 'value':\n default:\n sliderValue = hsv.v;\n break;\n }\n\n return (\n \n \n { this.renderGradient(props) }\n \n \n \n \n );\n }\n\n getValueFromPoint(x, y, { left }) {\n const handleRange = this.width - this.height;\n const cornerRadius = this.height / 2;\n x = x - (left + cornerRadius);\n let dist = Math.max(Math.min(x, handleRange), 0);\n return Math.round((100 / handleRange) * dist);\n }\n\n /**\n * @desc handles mouse input for this component\n * @param {Number} x - point x coordinate\n * @param {Number} y - point y coordinate\n * @param {DOMRect} rect - bounding client rect for the component's base element\n * @param {String} type - input type: \"START\", \"MOVE\" or \"END\"\n */\n handleInput(x, y, bounds, type) {\n let value = this.getValueFromPoint(x, y, bounds);\n let channel;\n switch (this.props.sliderType) {\n case 'hue':\n channel = 'h';\n value *= 3.6;\n break;\n case 'saturation':\n channel = 's';\n break;\n case 'value':\n default:\n channel = 'v';\n break;\n }\n this.props.onInput(type, {\n [channel]: value\n });\n }\n}","import { h, render } from 'preact';\nimport { onDocumentReady } from './dom';\n\n/**\n * @desc Turn a component into a widget\n * This returns a factory function that can be used to create an instance of the widget component\n * The first function param is a DOM element or CSS selector for the element to mount to,\n * The second param is for config options which are passed to the component as props\n * This factory function can also delay mounting the element into the DOM until the page is ready\n * @param {Component} widgetComonpent ui component to turn into a widget\n * @returns {Function} widget factory\n */\nexport function createWidget(widgetComponent) {\n\n const widgetFactory = function (parent, props) {\n let widget = null; // will become an instance of the widget component class\n let widgetRoot = document.createElement('div');\n\n // Render widget into a temp DOM node\n render(\n h(widgetComponent, {\n ref: ref => widget = ref,\n ...props,\n }),\n widgetRoot\n );\n // Mount it into the DOM when the page document is ready\n onDocumentReady(() => {\n const container = parent instanceof Element ? parent : document.querySelector(parent);\n container.appendChild(widget.base);\n widget.onMount(container);\n });\n\n return widget;\n }\n\n // Allow the widget factory to inherit component prototype + static class methods\n // This makes it easier for plugin authors to extend the base widget component\n widgetFactory.prototype = widgetComponent.prototype;\n Object.assign(widgetFactory, widgetComponent);\n // Add reference to base component too\n widgetFactory.__component = widgetComponent; \n\n return widgetFactory;\n\n}","import { h, Component } from 'preact';\n\nimport IroWheel from 'ui/wheel';\nimport IroSlider from 'ui/slider';\nimport IroColor from './color';\nimport { createWidget } from 'util/createWidget';\n\nclass ColorPicker extends Component {\n constructor(props) {\n super(props);\n this.emitHook('init:before');\n this._events = {};\n this._deferredEvents = {};\n this._colorUpdateActive = false;\n this._colorUpdateSrc = null;\n this.color = new IroColor(props.color);\n this.deferredEmit('color:init', this.color, { h: false, s: false, v: false, a: false });\n // Whenever the color changes, update the color wheel\n this.color._onChange = this.updateColor.bind(this);\n this.state = {\n ...props,\n color: this.color,\n };\n this.emitHook('init:state');\n\n if (props.layout) {\n this.layout = props.layout;\n } else {\n this.layout = [\n {component: IroWheel, options: {}},\n {component: IroSlider, options: {}},\n ];\n }\n this.emitHook('init:after');\n }\n\n // Public ColorPicker events API\n\n /**\n * @desc Set a callback function for an event\n * @param {String | Array} eventList event(s) to listen to\n * @param {Function} callback\n */\n on(eventList, callback) {\n const events = this._events;\n // eventList can be an eventType string or an array of eventType strings\n (!Array.isArray(eventList) ? [eventList] : eventList).forEach(eventType => {\n // Emit plugin hook\n this.emitHook('event:on', eventType, callback);\n // Add event callback\n (events[eventType] || (events[eventType] = [])).push(callback);\n // Call deferred events\n // These are events that can be stored until a listener for them is added\n if (this._deferredEvents[eventType]) {\n // Deffered events store an array of arguments from when the event was called\n this._deferredEvents[eventType].forEach(args => {\n callback.apply(null, args); \n });\n // Clear deferred events\n this._deferredEvents[eventType] = [];\n }\n });\n }\n\n /**\n * @desc Remove a callback function for an event added with on()\n * @param {String | Array} eventList The name of the event\n * @param {Function} callback\n */\n off(eventList, callback) {\n (!Array.isArray(eventList) ? [eventList] : eventList).forEach(eventType => {\n const callbackList = this._events[eventType];\n this.emitHook('event:off', eventType, callback);\n if (callbackList) callbackList.splice(callbackList.indexOf(callback), 1);\n });\n }\n\n /**\n * @desc Emit an event\n * @param {String} eventType The name of the event to emit\n * @param {Array} args array of args to pass to callbacks\n */\n emit(eventType, ...args) {\n // Events are plugin hooks too\n this.emitHook(eventType, ...args);\n const callbackList = this._events[eventType] || [];\n for (let i = 0; i < callbackList.length; i++) {\n callbackList[i].apply(null, args); \n }\n }\n\n /**\n * @desc Emit an event now, or save it for when the relevent event listener is added\n * @param {String} eventType The name of the event to emit\n * @param {Array} args array of args to pass to callbacks\n */\n deferredEmit(eventType, ...args) {\n const deferredEvents = this._deferredEvents;\n this.emit(eventType, ...args);\n (deferredEvents[eventType] || (deferredEvents[eventType] = [])).push(args);\n }\n\n // Public utility methods\n\n /**\n * @desc Resize the color picker\n * @param {Number} width\n */\n resize(width) {\n this.setState({width});\n }\n\n /**\n * @desc Reset the color picker to the initial color provided in the color picker options\n */\n reset() {\n this.color.set(this.props.color);\n }\n\n // Plugin hooks API\n\n /**\n * @desc Set a callback function for a hook\n * @param {String} hookType The name of the hook to listen to\n * @param {Function} callback\n */\n static addHook(hookType, callback) {\n const pluginHooks = ColorPicker.pluginHooks;\n (pluginHooks[hookType] || (pluginHooks[hookType] = [])).push(callback);\n }\n\n /**\n * @desc Emit a callback hook\n * @access private\n * @param {String} hookType The type of hook event to emit\n */\n emitHook(hookType, ...args) {\n const callbackList = ColorPicker.pluginHooks[hookType] || [];\n for (let i = 0; i < callbackList.length; i++) {\n callbackList[i].apply(this, args); \n }\n }\n\n // Internal methods\n\n /**\n * @desc Called by the createWidget wrapper when the element is mounted into the page\n * @access private\n * @param {Element} container the container element for this ColorPicker instance\n */\n onMount(container) {\n this.el = container;\n this.deferredEmit('mount', this);\n }\n\n /**\n * @desc React to a color update\n * @access private\n * @param {IroColor} color current color\n * @param {Object} changes shows which h,s,v color channels changed\n */\n updateColor(color, changes) {\n this.emitHook('color:beforeUpdate', color, changes);\n this.setState({ color: color });\n this.emitHook('color:afterUpdate', color, changes);\n // Prevent infinite loops if the color is set inside a color:change or input:change callback\n if (!this._colorUpdateActive) {\n // While _colorUpdateActive == true, branch cannot be entered\n this._colorUpdateActive = true;\n // If the color change originates from user input, fire input:change\n if (this._colorUpdateSrc == 'input') { // colorUpdateSrc is cleared in handeInput()\n this.emit('input:change', color, changes);\n } \n // Always fire color:change event\n this.emit('color:change', color, changes);\n this._colorUpdateActive = false;\n }\n }\n\n /**\n * @desc Handle input from a UI control element\n * @access private\n * @param {String} type \"START\" | \"MOVE\" | \"END\"\n * @param {Object} hsv new hsv values for the color\n */\n handleInput(type, hsv) {\n // Fire input start and move events before color update\n if (type === 'START') this.emit('input:start', this.color);\n if (type === 'MOVE') this.emit('input:move', this.color);\n // Set the color update source\n this._colorUpdateSrc = 'input';\n // Setting the color HSV here will automatically update the UI\n // Since we bound the color's _onChange callback\n this.color.hsv = hsv;\n // Fire input end event after color update\n if (type === 'END') this.emit('input:end', this.color);\n // Reset color update source so it doesn't interfere with future color updates\n // Super important to do this here and not in updateColor()\n this._colorUpdateSrc = null;\n }\n\n render(props, state) {\n return (\n
\n {this.layout.map(({component: UiComponent, options: options}) => (\n this.handleInput(type, hsv) }\n parent={ this }\n />\n ))}\n
\n )\n }\n}\n\nColorPicker.pluginHooks = {};\n\nColorPicker.defaultProps = {\n width: 300,\n height: 300,\n handleRadius: 8,\n handleSvg: null,\n handleOrigin: {x: 0, y: 0},\n color: '#fff',\n borderColor: '#fff',\n borderWidth: 0,\n display: 'block',\n wheelLightness: true,\n wheelAngle: 0,\n wheelDirection: 'anticlockwise',\n sliderHeight: null,\n sliderMargin: 12,\n padding: 6,\n layout: null,\n}\n\nexport default createWidget(ColorPicker);\n","/**\n * iro.js plugins API\n * This provides the iro.use method, which can be used to register plugins which extend the iro.js core\n */\nexport function usePlugins(core) {\n const installedPlugins = [];\n \n /**\n * @desc Register iro.js plugin\n * @param {Function} plugin = plugin constructor\n * @param {Object} pluginOptions = plugin options passed to constructor\n */\n core.use = function(plugin, pluginOptions = {}) {\n // Check that the plugin hasn't already been registered\n if (!(installedPlugins.indexOf(plugin) > -1)) {\n // Init plugin\n // TODO: consider collection of plugin utils, which are passed as a thrid param\n plugin(core, pluginOptions);\n // Register plugin\n installedPlugins.push(plugin);\n }\n }\n\n core.installedPlugins = installedPlugins;\n\n return core;\n}","import { h } from 'preact';\n\nimport ColorPicker from './colorPicker';\nimport Color from './color';\n\nimport Component from 'ui/component';\nimport Handle from 'ui/handle';\nimport Slider from 'ui/slider';\nimport Wheel from 'ui/wheel';\nimport { usePlugins } from 'util/usePlugins';\nimport { resolveUrl, createArcPath } from 'util/svg';\nimport { parseUnit, parseHexInt, intToHex } from 'util/colorUtils';\n\nexport default usePlugins({\n Color,\n ColorPicker,\n ui: {\n h,\n Component,\n Handle,\n Slider,\n Wheel,\n },\n util: {\n resolveUrl, \n createArcPath,\n parseUnit,\n parseHexInt,\n intToHex\n },\n version: VERSION,\n});\n"],"names":["arguments","const","super","this","let","IroColor","options","ColorPicker","Component","Handle","Slider","Wheel"],"mappings":";;;;;;;;;;;;;CAAA,IAAI,KAAK,GAAG,SAAS,KAAK,GAAG,EAAE,CAAC;;CAEhC,IAAI,OAAO,GAAG,EAAE,CAAC;;CAEjB,IAAI,KAAK,GAAG,EAAE,CAAC;;CAEf,IAAI,cAAc,GAAG,EAAE,CAAC;;CAExB,SAAS,CAAC,CAAC,QAAQ,EAAE,UAAU,EAAE;;;EAChC,IAAI,QAAQ,GAAG,cAAc;MACzB,UAAU;MACV,KAAK;MACL,MAAM;MACN,CAAC,CAAC;EACN,KAAK,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG,CAAC,GAAG;GACpC,KAAK,CAAC,IAAI,CAACA,WAAS,CAAC,CAAC,CAAC,CAAC,CAAC;GACzB;EACD,IAAI,UAAU,IAAI,UAAU,CAAC,QAAQ,IAAI,IAAI,EAAE;GAC9C,IAAI,CAAC,KAAK,CAAC,MAAM,IAAE,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAC;GACnD,OAAO,UAAU,CAAC,QAAQ,CAAC;GAC3B;EACD,OAAO,KAAK,CAAC,MAAM,EAAE;GACpB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,EAAE,KAAK,KAAK,CAAC,GAAG,KAAK,SAAS,EAAE;IACrD,KAAK,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG;KAC5B,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KACrB;IACD,MAAM;IACN,IAAI,OAAO,KAAK,KAAK,SAAS,IAAE,KAAK,GAAG,IAAI,GAAC;;IAE7C,IAAI,MAAM,GAAG,OAAO,QAAQ,KAAK,UAAU,EAAE;KAC5C,IAAI,KAAK,IAAI,IAAI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CAAC,WAAW,CAAC,CAAC;;CCpPzC;;;;AAIA,CAAO,SAAS,UAAU,CAAC,IAAI,EAAE;GAC/BF,IAAM,gBAAgB,GAAG,EAAE,CAAC;;;;;;;GAO5B,IAAI,CAAC,GAAG,GAAG,SAAS,MAAM,EAAE,aAAkB,EAAE;kDAAP,GAAG;;;KAE1C,IAAI,EAAE,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;;;OAG5C,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;;OAE5B,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;MAC/B;KACF;;GAED,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;;GAEzC,OAAO,IAAI,CAAC;;;ACZd,WAAe,UAAU,CAAC;UACxB,KAAK;gBACLM,aAAW;GACX,EAAE,EAAE;QACF,CAAC;gBACDC,YAAS;aACTC,SAAM;aACNC,SAAM;YACNC,QAAK;IACN;GACD,IAAI,EAAE;iBACJ,UAAU;oBACV,aAAa;gBACb,SAAS;kBACT,WAAW;eACX,QAAQ;IACT;GACD,OAAO,EAAE,OAAO;EACjB,CAAC,CAAC;;;;;;;;"} \ No newline at end of file diff --git a/dist/iro.min.js b/dist/iro.min.js index 8a3f07a..89c801b 100644 --- a/dist/iro.min.js +++ b/dist/iro.min.js @@ -1,8 +1,8 @@ /*! - * iro.js v4.3.3 + * iro.js v4.4.0 * 2016-2019 James Daniel * Licensed under MPL 2.0 * github.com/jaames/iro.js */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.iro=e()}(this,function(){"use strict";var c=function(){},i={},h=[],u=[];function p(t,e){var o,n,r,i,s=arguments,a=u;for(i=arguments.length;2 2;) {\n\t\tstack.push(arguments[i]);\n\t}\n\tif (attributes && attributes.children != null) {\n\t\tif (!stack.length) stack.push(attributes.children);\n\t\tdelete attributes.children;\n\t}\n\twhile (stack.length) {\n\t\tif ((child = stack.pop()) && child.pop !== undefined) {\n\t\t\tfor (i = child.length; i--;) {\n\t\t\t\tstack.push(child[i]);\n\t\t\t}\n\t\t} else {\n\t\t\tif (typeof child === 'boolean') child = null;\n\n\t\t\tif (simple = typeof nodeName !== 'function') {\n\t\t\t\tif (child == null) child = '';else if (typeof child === 'number') child = String(child);else if (typeof child !== 'string') simple = false;\n\t\t\t}\n\n\t\t\tif (simple && lastSimple) {\n\t\t\t\tchildren[children.length - 1] += child;\n\t\t\t} else if (children === EMPTY_CHILDREN) {\n\t\t\t\tchildren = [child];\n\t\t\t} else {\n\t\t\t\tchildren.push(child);\n\t\t\t}\n\n\t\t\tlastSimple = simple;\n\t\t}\n\t}\n\n\tvar p = new VNode();\n\tp.nodeName = nodeName;\n\tp.children = children;\n\tp.attributes = attributes == null ? undefined : attributes;\n\tp.key = attributes == null ? undefined : attributes.key;\n\n\tif (options.vnode !== undefined) options.vnode(p);\n\n\treturn p;\n}\n\nfunction extend(obj, props) {\n for (var i in props) {\n obj[i] = props[i];\n }return obj;\n}\n\nfunction applyRef(ref, value) {\n if (ref != null) {\n if (typeof ref == 'function') ref(value);else ref.current = value;\n }\n}\n\nvar defer = typeof Promise == 'function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;\n\nfunction cloneElement(vnode, props) {\n return h(vnode.nodeName, extend(extend({}, vnode.attributes), props), arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children);\n}\n\nvar IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\n\nvar items = [];\n\nfunction enqueueRender(component) {\n\tif (!component._dirty && (component._dirty = true) && items.push(component) == 1) {\n\t\t(options.debounceRendering || defer)(rerender);\n\t}\n}\n\nfunction rerender() {\n\tvar p;\n\twhile (p = items.pop()) {\n\t\tif (p._dirty) renderComponent(p);\n\t}\n}\n\nfunction isSameNodeType(node, vnode, hydrating) {\n\tif (typeof vnode === 'string' || typeof vnode === 'number') {\n\t\treturn node.splitText !== undefined;\n\t}\n\tif (typeof vnode.nodeName === 'string') {\n\t\treturn !node._componentConstructor && isNamedNode(node, vnode.nodeName);\n\t}\n\treturn hydrating || node._componentConstructor === vnode.nodeName;\n}\n\nfunction isNamedNode(node, nodeName) {\n\treturn node.normalizedNodeName === nodeName || node.nodeName.toLowerCase() === nodeName.toLowerCase();\n}\n\nfunction getNodeProps(vnode) {\n\tvar props = extend({}, vnode.attributes);\n\tprops.children = vnode.children;\n\n\tvar defaultProps = vnode.nodeName.defaultProps;\n\tif (defaultProps !== undefined) {\n\t\tfor (var i in defaultProps) {\n\t\t\tif (props[i] === undefined) {\n\t\t\t\tprops[i] = defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn props;\n}\n\nfunction createNode(nodeName, isSvg) {\n\tvar node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName);\n\tnode.normalizedNodeName = nodeName;\n\treturn node;\n}\n\nfunction removeNode(node) {\n\tvar parentNode = node.parentNode;\n\tif (parentNode) parentNode.removeChild(node);\n}\n\nfunction setAccessor(node, name, old, value, isSvg) {\n\tif (name === 'className') name = 'class';\n\n\tif (name === 'key') {} else if (name === 'ref') {\n\t\tapplyRef(old, null);\n\t\tapplyRef(value, node);\n\t} else if (name === 'class' && !isSvg) {\n\t\tnode.className = value || '';\n\t} else if (name === 'style') {\n\t\tif (!value || typeof value === 'string' || typeof old === 'string') {\n\t\t\tnode.style.cssText = value || '';\n\t\t}\n\t\tif (value && typeof value === 'object') {\n\t\t\tif (typeof old !== 'string') {\n\t\t\t\tfor (var i in old) {\n\t\t\t\t\tif (!(i in value)) node.style[i] = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var i in value) {\n\t\t\t\tnode.style[i] = typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false ? value[i] + 'px' : value[i];\n\t\t\t}\n\t\t}\n\t} else if (name === 'dangerouslySetInnerHTML') {\n\t\tif (value) node.innerHTML = value.__html || '';\n\t} else if (name[0] == 'o' && name[1] == 'n') {\n\t\tvar useCapture = name !== (name = name.replace(/Capture$/, ''));\n\t\tname = name.toLowerCase().substring(2);\n\t\tif (value) {\n\t\t\tif (!old) node.addEventListener(name, eventProxy, useCapture);\n\t\t} else {\n\t\t\tnode.removeEventListener(name, eventProxy, useCapture);\n\t\t}\n\t\t(node._listeners || (node._listeners = {}))[name] = value;\n\t} else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\n\t\ttry {\n\t\t\tnode[name] = value == null ? '' : value;\n\t\t} catch (e) {}\n\t\tif ((value == null || value === false) && name != 'spellcheck') node.removeAttribute(name);\n\t} else {\n\t\tvar ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''));\n\n\t\tif (value == null || value === false) {\n\t\t\tif (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase());else node.removeAttribute(name);\n\t\t} else if (typeof value !== 'function') {\n\t\t\tif (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value);else node.setAttribute(name, value);\n\t\t}\n\t}\n}\n\nfunction eventProxy(e) {\n\treturn this._listeners[e.type](options.event && options.event(e) || e);\n}\n\nvar mounts = [];\n\nvar diffLevel = 0;\n\nvar isSvgMode = false;\n\nvar hydrating = false;\n\nfunction flushMounts() {\n\tvar c;\n\twhile (c = mounts.shift()) {\n\t\tif (options.afterMount) options.afterMount(c);\n\t\tif (c.componentDidMount) c.componentDidMount();\n\t}\n}\n\nfunction diff(dom, vnode, context, mountAll, parent, componentRoot) {\n\tif (!diffLevel++) {\n\t\tisSvgMode = parent != null && parent.ownerSVGElement !== undefined;\n\n\t\thydrating = dom != null && !('__preactattr_' in dom);\n\t}\n\n\tvar ret = idiff(dom, vnode, context, mountAll, componentRoot);\n\n\tif (parent && ret.parentNode !== parent) parent.appendChild(ret);\n\n\tif (! --diffLevel) {\n\t\thydrating = false;\n\n\t\tif (!componentRoot) flushMounts();\n\t}\n\n\treturn ret;\n}\n\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n\tvar out = dom,\n\t prevSvgMode = isSvgMode;\n\n\tif (vnode == null || typeof vnode === 'boolean') vnode = '';\n\n\tif (typeof vnode === 'string' || typeof vnode === 'number') {\n\t\tif (dom && dom.splitText !== undefined && dom.parentNode && (!dom._component || componentRoot)) {\n\t\t\tif (dom.nodeValue != vnode) {\n\t\t\t\tdom.nodeValue = vnode;\n\t\t\t}\n\t\t} else {\n\t\t\tout = document.createTextNode(vnode);\n\t\t\tif (dom) {\n\t\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\t\t\t\trecollectNodeTree(dom, true);\n\t\t\t}\n\t\t}\n\n\t\tout['__preactattr_'] = true;\n\n\t\treturn out;\n\t}\n\n\tvar vnodeName = vnode.nodeName;\n\tif (typeof vnodeName === 'function') {\n\t\treturn buildComponentFromVNode(dom, vnode, context, mountAll);\n\t}\n\n\tisSvgMode = vnodeName === 'svg' ? true : vnodeName === 'foreignObject' ? false : isSvgMode;\n\n\tvnodeName = String(vnodeName);\n\tif (!dom || !isNamedNode(dom, vnodeName)) {\n\t\tout = createNode(vnodeName, isSvgMode);\n\n\t\tif (dom) {\n\t\t\twhile (dom.firstChild) {\n\t\t\t\tout.appendChild(dom.firstChild);\n\t\t\t}\n\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\n\t\t\trecollectNodeTree(dom, true);\n\t\t}\n\t}\n\n\tvar fc = out.firstChild,\n\t props = out['__preactattr_'],\n\t vchildren = vnode.children;\n\n\tif (props == null) {\n\t\tprops = out['__preactattr_'] = {};\n\t\tfor (var a = out.attributes, i = a.length; i--;) {\n\t\t\tprops[a[i].name] = a[i].value;\n\t\t}\n\t}\n\n\tif (!hydrating && vchildren && vchildren.length === 1 && typeof vchildren[0] === 'string' && fc != null && fc.splitText !== undefined && fc.nextSibling == null) {\n\t\tif (fc.nodeValue != vchildren[0]) {\n\t\t\tfc.nodeValue = vchildren[0];\n\t\t}\n\t} else if (vchildren && vchildren.length || fc != null) {\n\t\t\tinnerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML != null);\n\t\t}\n\n\tdiffAttributes(out, vnode.attributes, props);\n\n\tisSvgMode = prevSvgMode;\n\n\treturn out;\n}\n\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n\tvar originalChildren = dom.childNodes,\n\t children = [],\n\t keyed = {},\n\t keyedLen = 0,\n\t min = 0,\n\t len = originalChildren.length,\n\t childrenLen = 0,\n\t vlen = vchildren ? vchildren.length : 0,\n\t j,\n\t c,\n\t f,\n\t vchild,\n\t child;\n\n\tif (len !== 0) {\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tvar _child = originalChildren[i],\n\t\t\t props = _child['__preactattr_'],\n\t\t\t key = vlen && props ? _child._component ? _child._component.__key : props.key : null;\n\t\t\tif (key != null) {\n\t\t\t\tkeyedLen++;\n\t\t\t\tkeyed[key] = _child;\n\t\t\t} else if (props || (_child.splitText !== undefined ? isHydrating ? _child.nodeValue.trim() : true : isHydrating)) {\n\t\t\t\tchildren[childrenLen++] = _child;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (vlen !== 0) {\n\t\tfor (var i = 0; i < vlen; i++) {\n\t\t\tvchild = vchildren[i];\n\t\t\tchild = null;\n\n\t\t\tvar key = vchild.key;\n\t\t\tif (key != null) {\n\t\t\t\tif (keyedLen && keyed[key] !== undefined) {\n\t\t\t\t\tchild = keyed[key];\n\t\t\t\t\tkeyed[key] = undefined;\n\t\t\t\t\tkeyedLen--;\n\t\t\t\t}\n\t\t\t} else if (min < childrenLen) {\n\t\t\t\t\tfor (j = min; j < childrenLen; j++) {\n\t\t\t\t\t\tif (children[j] !== undefined && isSameNodeType(c = children[j], vchild, isHydrating)) {\n\t\t\t\t\t\t\tchild = c;\n\t\t\t\t\t\t\tchildren[j] = undefined;\n\t\t\t\t\t\t\tif (j === childrenLen - 1) childrenLen--;\n\t\t\t\t\t\t\tif (j === min) min++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\tchild = idiff(child, vchild, context, mountAll);\n\n\t\t\tf = originalChildren[i];\n\t\t\tif (child && child !== dom && child !== f) {\n\t\t\t\tif (f == null) {\n\t\t\t\t\tdom.appendChild(child);\n\t\t\t\t} else if (child === f.nextSibling) {\n\t\t\t\t\tremoveNode(f);\n\t\t\t\t} else {\n\t\t\t\t\tdom.insertBefore(child, f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (keyedLen) {\n\t\tfor (var i in keyed) {\n\t\t\tif (keyed[i] !== undefined) recollectNodeTree(keyed[i], false);\n\t\t}\n\t}\n\n\twhile (min <= childrenLen) {\n\t\tif ((child = children[childrenLen--]) !== undefined) recollectNodeTree(child, false);\n\t}\n}\n\nfunction recollectNodeTree(node, unmountOnly) {\n\tvar component = node._component;\n\tif (component) {\n\t\tunmountComponent(component);\n\t} else {\n\t\tif (node['__preactattr_'] != null) applyRef(node['__preactattr_'].ref, null);\n\n\t\tif (unmountOnly === false || node['__preactattr_'] == null) {\n\t\t\tremoveNode(node);\n\t\t}\n\n\t\tremoveChildren(node);\n\t}\n}\n\nfunction removeChildren(node) {\n\tnode = node.lastChild;\n\twhile (node) {\n\t\tvar next = node.previousSibling;\n\t\trecollectNodeTree(node, true);\n\t\tnode = next;\n\t}\n}\n\nfunction diffAttributes(dom, attrs, old) {\n\tvar name;\n\n\tfor (name in old) {\n\t\tif (!(attrs && attrs[name] != null) && old[name] != null) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = undefined, isSvgMode);\n\t\t}\n\t}\n\n\tfor (name in attrs) {\n\t\tif (name !== 'children' && name !== 'innerHTML' && (!(name in old) || attrs[name] !== (name === 'value' || name === 'checked' ? dom[name] : old[name]))) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode);\n\t\t}\n\t}\n}\n\nvar recyclerComponents = [];\n\nfunction createComponent(Ctor, props, context) {\n\tvar inst,\n\t i = recyclerComponents.length;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\twhile (i--) {\n\t\tif (recyclerComponents[i].constructor === Ctor) {\n\t\t\tinst.nextBase = recyclerComponents[i].nextBase;\n\t\t\trecyclerComponents.splice(i, 1);\n\t\t\treturn inst;\n\t\t}\n\t}\n\n\treturn inst;\n}\n\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n\nfunction setComponentProps(component, props, renderMode, context, mountAll) {\n\tif (component._disable) return;\n\tcomponent._disable = true;\n\n\tcomponent.__ref = props.ref;\n\tcomponent.__key = props.key;\n\tdelete props.ref;\n\tdelete props.key;\n\n\tif (typeof component.constructor.getDerivedStateFromProps === 'undefined') {\n\t\tif (!component.base || mountAll) {\n\t\t\tif (component.componentWillMount) component.componentWillMount();\n\t\t} else if (component.componentWillReceiveProps) {\n\t\t\tcomponent.componentWillReceiveProps(props, context);\n\t\t}\n\t}\n\n\tif (context && context !== component.context) {\n\t\tif (!component.prevContext) component.prevContext = component.context;\n\t\tcomponent.context = context;\n\t}\n\n\tif (!component.prevProps) component.prevProps = component.props;\n\tcomponent.props = props;\n\n\tcomponent._disable = false;\n\n\tif (renderMode !== 0) {\n\t\tif (renderMode === 1 || options.syncComponentUpdates !== false || !component.base) {\n\t\t\trenderComponent(component, 1, mountAll);\n\t\t} else {\n\t\t\tenqueueRender(component);\n\t\t}\n\t}\n\n\tapplyRef(component.__ref, component);\n}\n\nfunction renderComponent(component, renderMode, mountAll, isChild) {\n\tif (component._disable) return;\n\n\tvar props = component.props,\n\t state = component.state,\n\t context = component.context,\n\t previousProps = component.prevProps || props,\n\t previousState = component.prevState || state,\n\t previousContext = component.prevContext || context,\n\t isUpdate = component.base,\n\t nextBase = component.nextBase,\n\t initialBase = isUpdate || nextBase,\n\t initialChildComponent = component._component,\n\t skip = false,\n\t snapshot = previousContext,\n\t rendered,\n\t inst,\n\t cbase;\n\n\tif (component.constructor.getDerivedStateFromProps) {\n\t\tstate = extend(extend({}, state), component.constructor.getDerivedStateFromProps(props, state));\n\t\tcomponent.state = state;\n\t}\n\n\tif (isUpdate) {\n\t\tcomponent.props = previousProps;\n\t\tcomponent.state = previousState;\n\t\tcomponent.context = previousContext;\n\t\tif (renderMode !== 2 && component.shouldComponentUpdate && component.shouldComponentUpdate(props, state, context) === false) {\n\t\t\tskip = true;\n\t\t} else if (component.componentWillUpdate) {\n\t\t\tcomponent.componentWillUpdate(props, state, context);\n\t\t}\n\t\tcomponent.props = props;\n\t\tcomponent.state = state;\n\t\tcomponent.context = context;\n\t}\n\n\tcomponent.prevProps = component.prevState = component.prevContext = component.nextBase = null;\n\tcomponent._dirty = false;\n\n\tif (!skip) {\n\t\trendered = component.render(props, state, context);\n\n\t\tif (component.getChildContext) {\n\t\t\tcontext = extend(extend({}, context), component.getChildContext());\n\t\t}\n\n\t\tif (isUpdate && component.getSnapshotBeforeUpdate) {\n\t\t\tsnapshot = component.getSnapshotBeforeUpdate(previousProps, previousState);\n\t\t}\n\n\t\tvar childComponent = rendered && rendered.nodeName,\n\t\t toUnmount,\n\t\t base;\n\n\t\tif (typeof childComponent === 'function') {\n\n\t\t\tvar childProps = getNodeProps(rendered);\n\t\t\tinst = initialChildComponent;\n\n\t\t\tif (inst && inst.constructor === childComponent && childProps.key == inst.__key) {\n\t\t\t\tsetComponentProps(inst, childProps, 1, context, false);\n\t\t\t} else {\n\t\t\t\ttoUnmount = inst;\n\n\t\t\t\tcomponent._component = inst = createComponent(childComponent, childProps, context);\n\t\t\t\tinst.nextBase = inst.nextBase || nextBase;\n\t\t\t\tinst._parentComponent = component;\n\t\t\t\tsetComponentProps(inst, childProps, 0, context, false);\n\t\t\t\trenderComponent(inst, 1, mountAll, true);\n\t\t\t}\n\n\t\t\tbase = inst.base;\n\t\t} else {\n\t\t\tcbase = initialBase;\n\n\t\t\ttoUnmount = initialChildComponent;\n\t\t\tif (toUnmount) {\n\t\t\t\tcbase = component._component = null;\n\t\t\t}\n\n\t\t\tif (initialBase || renderMode === 1) {\n\t\t\t\tif (cbase) cbase._component = null;\n\t\t\t\tbase = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, true);\n\t\t\t}\n\t\t}\n\n\t\tif (initialBase && base !== initialBase && inst !== initialChildComponent) {\n\t\t\tvar baseParent = initialBase.parentNode;\n\t\t\tif (baseParent && base !== baseParent) {\n\t\t\t\tbaseParent.replaceChild(base, initialBase);\n\n\t\t\t\tif (!toUnmount) {\n\t\t\t\t\tinitialBase._component = null;\n\t\t\t\t\trecollectNodeTree(initialBase, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (toUnmount) {\n\t\t\tunmountComponent(toUnmount);\n\t\t}\n\n\t\tcomponent.base = base;\n\t\tif (base && !isChild) {\n\t\t\tvar componentRef = component,\n\t\t\t t = component;\n\t\t\twhile (t = t._parentComponent) {\n\t\t\t\t(componentRef = t).base = base;\n\t\t\t}\n\t\t\tbase._component = componentRef;\n\t\t\tbase._componentConstructor = componentRef.constructor;\n\t\t}\n\t}\n\n\tif (!isUpdate || mountAll) {\n\t\tmounts.push(component);\n\t} else if (!skip) {\n\n\t\tif (component.componentDidUpdate) {\n\t\t\tcomponent.componentDidUpdate(previousProps, previousState, snapshot);\n\t\t}\n\t\tif (options.afterUpdate) options.afterUpdate(component);\n\t}\n\n\twhile (component._renderCallbacks.length) {\n\t\tcomponent._renderCallbacks.pop().call(component);\n\t}if (!diffLevel && !isChild) flushMounts();\n}\n\nfunction buildComponentFromVNode(dom, vnode, context, mountAll) {\n\tvar c = dom && dom._component,\n\t originalComponent = c,\n\t oldDom = dom,\n\t isDirectOwner = c && dom._componentConstructor === vnode.nodeName,\n\t isOwner = isDirectOwner,\n\t props = getNodeProps(vnode);\n\twhile (c && !isOwner && (c = c._parentComponent)) {\n\t\tisOwner = c.constructor === vnode.nodeName;\n\t}\n\n\tif (c && isOwner && (!mountAll || c._component)) {\n\t\tsetComponentProps(c, props, 3, context, mountAll);\n\t\tdom = c.base;\n\t} else {\n\t\tif (originalComponent && !isDirectOwner) {\n\t\t\tunmountComponent(originalComponent);\n\t\t\tdom = oldDom = null;\n\t\t}\n\n\t\tc = createComponent(vnode.nodeName, props, context);\n\t\tif (dom && !c.nextBase) {\n\t\t\tc.nextBase = dom;\n\n\t\t\toldDom = null;\n\t\t}\n\t\tsetComponentProps(c, props, 1, context, mountAll);\n\t\tdom = c.base;\n\n\t\tif (oldDom && dom !== oldDom) {\n\t\t\toldDom._component = null;\n\t\t\trecollectNodeTree(oldDom, false);\n\t\t}\n\t}\n\n\treturn dom;\n}\n\nfunction unmountComponent(component) {\n\tif (options.beforeUnmount) options.beforeUnmount(component);\n\n\tvar base = component.base;\n\n\tcomponent._disable = true;\n\n\tif (component.componentWillUnmount) component.componentWillUnmount();\n\n\tcomponent.base = null;\n\n\tvar inner = component._component;\n\tif (inner) {\n\t\tunmountComponent(inner);\n\t} else if (base) {\n\t\tif (base['__preactattr_'] != null) applyRef(base['__preactattr_'].ref, null);\n\n\t\tcomponent.nextBase = base;\n\n\t\tremoveNode(base);\n\t\trecyclerComponents.push(component);\n\n\t\tremoveChildren(base);\n\t}\n\n\tapplyRef(component.__ref, null);\n}\n\nfunction Component(props, context) {\n\tthis._dirty = true;\n\n\tthis.context = context;\n\n\tthis.props = props;\n\n\tthis.state = this.state || {};\n\n\tthis._renderCallbacks = [];\n}\n\nextend(Component.prototype, {\n\tsetState: function setState(state, callback) {\n\t\tif (!this.prevState) this.prevState = this.state;\n\t\tthis.state = extend(extend({}, this.state), typeof state === 'function' ? state(this.state, this.props) : state);\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t},\n\tforceUpdate: function forceUpdate(callback) {\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\trenderComponent(this, 2);\n\t},\n\trender: function render() {}\n});\n\nfunction render(vnode, parent, merge) {\n return diff(merge, vnode, {}, false, parent, false);\n}\n\nfunction createRef() {\n\treturn {};\n}\n\nvar preact = {\n\th: h,\n\tcreateElement: h,\n\tcloneElement: cloneElement,\n\tcreateRef: createRef,\n\tComponent: Component,\n\trender: render,\n\trerender: rerender,\n\toptions: options\n};\n\nexport default preact;\nexport { h, h as createElement, cloneElement, createRef, Component, render, rerender, options };\n//# sourceMappingURL=preact.mjs.map\n","/**\n * @desc listen to one or more events on an element\n * @param {Element} el target element\n * @param {Array} eventList the events to listen to\n * @param {Function} callback\n * @param {Object} params params to pass to addEventListener\n */\nexport function listen(el, eventList, callback, params={}) {\n for (var i = 0; i < eventList.length; i++) {\n el.addEventListener(eventList[i], callback, params);\n }\n};\n\n/**\n * @desc remove an event listener on an element\n * @param {Element} el target element\n * @param {Array} eventList the events to remove\n * @param {Function} callback\n * @param {Object} params params to pass to removeEventListener\n */\nexport function unlisten(el, eventList, callback, params={}) {\n for (var i = 0; i < eventList.length; i++) {\n el.removeEventListener(eventList[i], callback, params);\n }\n};\n\n/**\n * @desc call fn callback when the page document has fully loaded\n * @param {Function} callback\n */\nexport function onDocumentReady(callback) {\n if (document.readyState !== 'loading') {\n callback();\n } else {\n listen(document, ['DOMContentLoaded'], callback);\n }\n};","import { Component } from 'preact';\nimport { listen, unlisten } from 'util/dom';\n\nconst EVENT_MOUSEDOWN = 'mousedown';\nconst EVENT_MOUSEMOVE = 'mousemove';\nconst EVENT_MOUSEUP = 'mouseup';\nconst EVENT_TOUCHSTART = 'touchstart';\nconst EVENT_TOUCHMOVE = 'touchmove';\nconst EVENT_TOUCHEND = 'touchend';\n\n/**\n * Base component class for iro UI components\n * This extends the Preact component class to allow them to react to mouse/touch input events by themselves\n */\nexport default class IroComponent extends Component {\n\n constructor(props) {\n super(props);\n // Generate unique ID for the component\n // This can be used to generate unique IDs for gradients, etc\n this.uid = (Math.random() + 1).toString(36).substring(5);\n }\n \n componentDidMount() {\n listen(this.base, [EVENT_MOUSEDOWN, EVENT_TOUCHSTART], this, { passive: false });\n }\n\n componentWillUnmount() {\n unlisten(this.base, [EVENT_MOUSEDOWN, EVENT_TOUCHSTART], this);\n }\n\n // More info on handleEvent:\n // http://download-cdn.miitomo.com/native/20180125111639/manifests/v2_20180405_3_android/manifest.json\n // TL;DR this lets us have a single point of entry for multiple events, and we can avoid callback/binding hell\n handleEvent(e) {\n e.preventDefault();\n // Detect if the event is a touch event by checking if it has the `touches` property\n // If it is a touch event, use the first touch input\n const point = e.touches ? e.changedTouches[0] : e;\n const x = point.clientX;\n const y = point.clientY;\n // Get the screen position of the component\n const bounds = this.base.getBoundingClientRect();\n\n switch (e.type) {\n case EVENT_MOUSEDOWN:\n case EVENT_TOUCHSTART:\n listen(document, [EVENT_MOUSEMOVE, EVENT_TOUCHMOVE, EVENT_MOUSEUP, EVENT_TOUCHEND], this, { passive: false });\n this.handleInput(x, y, bounds, 'START');\n break;\n case EVENT_MOUSEMOVE:\n case EVENT_TOUCHMOVE:\n this.handleInput(x, y, bounds, 'MOVE');\n break;\n case EVENT_MOUSEUP:\n case EVENT_TOUCHEND:\n this.handleInput(x, y, bounds, 'END');\n unlisten(document, [EVENT_MOUSEMOVE, EVENT_TOUCHMOVE, EVENT_MOUSEUP, EVENT_TOUCHEND], this, { passive: false });\n break;\n }\n }\n}","/**\n * @desc Resolve an SVG URL\n * This is required to work around how Safari handles gradient URLS under certain conditions\n * If a page is using a client-side routing library which makes use of the HTML tag, \n * Safari won't be able to render SVG gradients properly (as they are referenced by URLs)\n * More info on the problem: \n * https://stackoverflow.com/questions/19742805/angular-and-svg-filters/19753427#19753427\n * https://github.com/jaames/iro.js/issues/18\n * https://github.com/jaames/iro.js/issues/45\n * @param {String} url resource url (should be an id selector e.g \"#example\")\n * @returns {String} resolved url\n */\nexport function resolveUrl(url) {\n // Sniff useragent string to check if the user is running Safari\n const ua = window.navigator.userAgent;\n const isSafari = /^((?!chrome|android).)*safari/i.test(ua);\n const isIos = /iPhone|iPod|iPad/i.test(ua);\n const location = window.location;\n return (isSafari || isIos) ? `${location.protocol}//${location.host}${location.pathname}${location.search}${url}` : url;\n}\n\n/**\n * @desc create the path commands to draw an svg arc\n * @param {Number} cx center point x\n * @param {Number} cy center point y\n * @param {Number} radius arc radius\n * @param {Number} startAngle arc start angle (degrees)\n * @param {Number} endAngle arc end angle (degrees)\n * @returns {String} arc path commands\n */\nexport function createArcPath(cx, cy, radius, startAngle, endAngle) {\n const largeArcFlag = endAngle - startAngle <= 180 ? 0 : 1;\n startAngle *= Math.PI / 180;\n endAngle *= Math.PI / 180;\n const x1 = cx + radius * Math.cos(endAngle);\n const y1 = cy + radius * Math.sin(endAngle);\n const x2 = cx + radius * Math.cos(startAngle);\n const y2 = cy + radius * Math.sin(startAngle);\n return `M ${x1} ${y1} A ${radius} ${radius} 0 ${largeArcFlag} 0 ${x2} ${y2}`;\n}","import { h } from 'preact';\nimport { resolveUrl } from '../util/svg';\n\nfunction IroHandle(props) {\n \n const radius = props.r;\n const url = props.url;\n\n return (\n \n {url && (\n \n )}\n {!url && (\n \n )}\n {!url && (\n \n )}\n \n );\n}\n\nIroHandle.defaultProps = {\n x: 0,\n y: 0,\n r: 8,\n url: null,\n origin: {x: 0, y: 0}\n};\n\nexport default IroHandle;","import { h } from 'preact';\n\nimport IroComponent from 'ui/component';\nimport IroHandle from 'ui/handle';\nimport { resolveUrl, createArcPath } from '../util/svg';\n\n\nexport default class IroWheel extends IroComponent {\n\n render(props) {\n let { width, borderWidth, handleRadius } = props;\n const hsv = props.color.hsv;\n const radius = (width / 2) - borderWidth;\n const handleAngle = (360 - hsv.h) * (Math.PI / 180);\n const handleDist = (hsv.s / 100) * (radius - props.padding - handleRadius - borderWidth);\n const cX = radius + borderWidth;\n const cY = radius + borderWidth;\n \n return (\n \n \n \n \n \n \n \n \n {Array.apply(null, { length: 360 }).map((_, hue) => (\n \n ))}\n \n \n { props.wheelLightness && (\n \n )}\n \n \n \n );\n }\n\n /**\n * @desc handles mouse input for this component\n * @param {Number} x - point x coordinate\n * @param {Number} y - point y coordinate\n * @param {DOMRect} rect - bounding client rect for the component's base element\n * @param {String} type - input type: \"START\", \"MOVE\" or \"END\"\n */\n handleInput(x, y, { left, top }, type) {\n const props = this.props;\n const radius = props.width / 2;\n const handleRange = (radius - props.padding - props.handleRadius - props.borderWidth);\n const cX = radius;\n const cY = radius;\n\n x = cX - (x - left);\n y = cY - (y - top);\n\n let handleAngle = Math.atan2(y, x);\n // Calculate the hue by converting the angle to radians\n let hue = 360 - (Math.round(handleAngle * (180 / Math.PI)) + 180);\n // Find the point's distance from the center of the wheel\n // This is used to show the saturation level\n let handleDist = Math.min(Math.sqrt(x * x + y * y), handleRange);\n props.onInput(type, {\n h: hue,\n s: Math.round((100 / handleRange) * handleDist)\n });\n }\n}","/**\n * @desc Parse a css unit string - either regular int or a percentage number\n * @param {String} str input string\n * @param {String} max max number for converting percentages\n * @returns {Number} \n */\nexport function parseUnit(str, max) {\n const isPercentage = str.indexOf('%') > -1;\n const num = parseFloat(str);\n return isPercentage ? (max / 100) * num : num;\n}\n\n/**\n * @desc Parse hex str to an int\n * @param {String} str input string\n * @returns {Number} \n */\nexport function parseHexInt(str) {\n return parseInt(str, 16);\n}\n\n/**\n * @desc Convert into to 2-digit hex\n * @param {Number} int input number\n * @returns {String} \n */\nexport function intToHex(int) {\n return int.toString(16).padStart(2, '0');\n}","import { parseUnit, parseHexInt, intToHex } from './util/colorUtils';\n\n// Some regular expressions for rgb() and hsl() Colors are borrowed from tinyColor\n// https://github.com/bgrins/TinyColor\n\n// https://www.w3.org/TR/css3-values/#integers\nconst CSS_INTEGER = `[-\\\\+]?\\\\d+%?`;\n// http://www.w3.org/TR/css3-values/#number-value\nconst CSS_NUMBER = `[-\\\\+]?\\\\d*\\\\.\\\\d+%?`;\n// Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome\nconst CSS_UNIT = `(?:${ CSS_NUMBER })|(?:${ CSS_INTEGER })`;\n\n// Parse function params\n// Parens and commas are optional, and this also allows for whitespace between numbers\nconst PERMISSIVE_MATCH_3 = `[\\\\s|\\\\(]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })\\\\s*\\\\)?`;\nconst PERMISSIVE_MATCH_4 = `[\\\\s|\\\\(]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })\\\\s*\\\\)?`;\n\n// Regex patterns for functional colors\nconst REGEX_FUNCTIONAL_RGB = new RegExp(`rgb${ PERMISSIVE_MATCH_3 }`);\nconst REGEX_FUNCTIONAL_RGBA = new RegExp(`rgba${ PERMISSIVE_MATCH_4 }`);\nconst REGEX_FUNCTIONAL_HSL = new RegExp(`hsl${ PERMISSIVE_MATCH_3 }`);\nconst REGEX_FUNCTIONAL_HSLA = new RegExp(`hsla${ PERMISSIVE_MATCH_4 }`);\n\nconst HEX_START = `^(?:#?|0x?)`;\nconst HEX_INT_SINGLE = `([0-9a-fA-F]{1})`;\nconst HEX_INT_DOUBLE = `([0-9a-fA-F]{2})`;\nconst REGEX_HEX_3 = new RegExp(`${ HEX_START }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }$`);\nconst REGEX_HEX_4 = new RegExp(`${ HEX_START }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }$`);\nconst REGEX_HEX_6 = new RegExp(`${ HEX_START }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }$`);\nconst REGEX_HEX_8 = new RegExp(`${ HEX_START }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }$`);\n\nexport default class Color {\n /**\n * @constructor Color object\n * @param {Object | String | Color} value - Color instance, object (hsv, hsl or rgb), string (hsl, rgb, hex)\n */\n constructor(value) {\n // The watch callback function for this Color will be stored here\n this._onChange = false;\n // The default Color value\n this._value = {h: 0, s: 0, v: 0, a: 1};\n if (value) this.set(value);\n }\n\n /**\n * @desc set the Color from any valid value\n * @param {Object | String | Color} value - Color instance, object (hsv, hsl or rgb), string (hsl, rgb, hex)\n */\n set(value) {\n const isString = typeof value === 'string';\n const isObject = typeof value === 'object';\n if ((isString) && (/^(?:#?|0x?)[0-9a-fA-F]{3,8}$/.test(value))) {\n this.hexString = value;\n }\n else if ((isString) && (/^rgba?/.test(value))) {\n this.rgbString = value;\n }\n else if ((isString) && (/^hsla?/.test(value))) {\n this.hslString = value;\n }\n else if ((isObject) && (value instanceof Color)) {\n this.hsv = value.hsv;\n }\n else if ((isObject) && ('r' in value) && ('g' in value) && ('b' in value)) {\n this.rgb = value;\n }\n else if ((isObject) && ('h' in value) && ('s' in value) && ('v' in value)) {\n this.hsv = value;\n }\n else if ((isObject) && ('h' in value) && ('s' in value) && ('l' in value)) {\n this.hsl = value;\n }\n else {\n throw new Error('invalid color value');\n }\n }\n\n /**\n * @desc shortcut to set a specific channel value\n * @param {String} format - hsv | hsl | rgb\n * @param {String} channel - individual channel to set, for example if model = hsl, chanel = h | s | l\n * @param {Number} value - new value for the channel\n */\n setChannel(format, channel, value) {\n this[format] = {...this[format], [channel]: value};\n }\n\n /**\n * @desc make new Color instance with the same value as this one\n * @return {Color}\n */\n clone() {\n return new Color(this);\n }\n\n /**\n * @desc convert hsv object to rgb\n * @param {Object} hsv hsv object\n * @return {Object} rgb object\n */\n static hsvToRgb(hsv) {\n const h = hsv.h / 60;\n const s = hsv.s / 100;\n const v = hsv.v / 100;\n const i = Math.floor(h);\n const f = h - i;\n const p = v * (1 - s);\n const q = v * (1 - f * s);\n const t = v * (1 - (1 - f) * s);\n const mod = i % 6;\n const r = [v, q, p, p, t, v][mod];\n const g = [t, v, v, q, p, p][mod];\n const b = [p, p, t, v, v, q][mod];\n return {\n r: r * 255, \n g: g * 255, \n b: b * 255\n };\n }\n\n /**\n * @desc convert rgb object to hsv\n * @param {Object} rgb - rgb object\n * @return {Object} hsv object\n */\n static rgbToHsv(rgb) {\n const r = rgb.r / 255;\n const g = rgb.g / 255;\n const b = rgb.b / 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const delta = max - min;\n let hue;\n let value = max;\n let saturation = max === 0 ? 0 : delta / max;\n switch (max) {\n case min: \n hue = 0; // achromatic\n break;\n case r: \n hue = (g - b) / delta + (g < b ? 6 : 0);\n break;\n case g: \n hue = (b - r) / delta + 2;\n break;\n case b:\n hue = (r - g) / delta + 4;\n break;\n }\n return {\n h: hue * 60,\n s: saturation * 100,\n v: value * 100\n }\n }\n\n /**\n * @desc convert hsv object to hsl\n * @param {Object} hsv - hsv object\n * @return {Object} hsl object\n */\n static hsvToHsl(hsv) {\n const s = hsv.s / 100;\n const v = hsv.v / 100;\n const l = (2 - s) * v;\n const divisor = l <= 1 ? l : (2 - l);\n // Avoid division by zero when lightness is close to zero\n const saturation = divisor < 1e-9 ? 0 : (s * v) / divisor;\n return {\n h: hsv.h,\n s: saturation * 100,\n l: l * 50\n };\n }\n\n /**\n * @desc convert hsl object to hsv\n * @param {Object} hsl - hsl object\n * @return {Object} hsv object\n */\n static hslToHsv(hsl) {\n const l = hsl.l * 2;\n const s = (hsl.s * ((l <= 100) ? l : 200 - l)) / 100;\n // Avoid division by zero when l + s is near 0\n const saturation = (l + s < 1e-9) ? 0 : (2 * s) / (l + s);\n return {\n h: hsl.h,\n s: saturation * 100,\n v: (l + s) / 2\n };\n }\n\n get hsv() {\n // _value is cloned to allow changes to be made to the values before passing them back\n const value = this._value;\n return {h: value.h, s: value.s, v: value.v};\n }\n\n set hsv(newValue) {\n const oldValue = this._value;\n newValue = { ...oldValue, ...newValue };\n // If this Color is being watched for changes we need to compare the new and old values to check the difference\n // Otherwise we can just be lazy\n if (this._onChange) {\n // Compute changed values\n let changes = {};\n for (let key in oldValue) {\n changes[key] = newValue[key] != oldValue[key]\n };\n // Update the old value\n this._value = newValue;\n // If the value has changed, call hook callback\n if (changes.h || changes.s || changes.v || changes.a) this._onChange(this, changes);\n } else {\n this._value = newValue;\n }\n }\n\n get rgb() {\n const {r, g, b} = Color.hsvToRgb(this._value);\n return {\n r: Math.round(r),\n g: Math.round(g),\n b: Math.round(b),\n };\n }\n\n set rgb(value) {\n this.hsv = {...Color.rgbToHsv(value), a: (value.a === undefined) ? 1 : value.a};\n }\n\n get hsl() {\n const {h, s, l} = Color.hsvToHsl(this._value);\n return {\n h: Math.round(h),\n s: Math.round(s),\n l: Math.round(l),\n };\n }\n\n set hsl(value) {\n this.hsv = {...Color.hslToHsv(value), a: (value.a === undefined) ? 1 : value.a};\n }\n\n get rgbString() {\n const rgb = this.rgb;\n return `rgb(${rgb.r}, ${rgb.g}, ${rgb.b})`;\n }\n\n set rgbString(value) {\n let match;\n let r, g, b, a = 1;\n if (match = REGEX_FUNCTIONAL_RGB.exec(value)) {\n r = parseUnit(match[1], 255);\n g = parseUnit(match[2], 255);\n b = parseUnit(match[3], 255);\n }\n else if (match = REGEX_FUNCTIONAL_RGBA.exec(value)) {\n r = parseUnit(match[1], 255);\n g = parseUnit(match[2], 255);\n b = parseUnit(match[3], 255);\n a = parseUnit(match[4], 1);\n }\n if (match) {\n this.rgb = {r, g, b, a};\n } \n else {\n throw new Error('invalid rgb string');\n }\n }\n\n get hexString() {\n const rgb = this.rgb;\n return `#${ intToHex(rgb.r) }${ intToHex(rgb.g) }${ intToHex(rgb.b) }`;\n }\n\n set hexString(value) {\n let match;\n let r, g, b, a = 255;\n if (match = REGEX_HEX_3.exec(value)) {\n r = parseHexInt(match[1]) * 17;\n g = parseHexInt(match[2]) * 17;\n b = parseHexInt(match[3]) * 17;\n }\n else if (match = REGEX_HEX_4.exec(value)) {\n r = parseHexInt(match[1]) * 17;\n g = parseHexInt(match[2]) * 17;\n b = parseHexInt(match[3]) * 17;\n a = parseHexInt(match[4]) * 17;\n }\n else if (match = REGEX_HEX_6.exec(value)) {\n r = parseHexInt(match[1]);\n g = parseHexInt(match[2]);\n b = parseHexInt(match[3]);\n }\n else if (match = REGEX_HEX_8.exec(value)) {\n r = parseHexInt(match[1]);\n g = parseHexInt(match[2]);\n b = parseHexInt(match[3]);\n a = parseHexInt(match[4]);\n }\n if (match) {\n this.rgb = {r, g, b, a: a / 255};\n }\n else {\n throw new Error('invalid hex string');\n }\n }\n\n get hslString() {\n const hsl = this.hsl;\n return `hsl(${hsl.h}, ${hsl.s}%, ${hsl.l}%)`;\n }\n\n set hslString(value) {\n let match;\n let h, s, l, a = 1;\n if (match = REGEX_FUNCTIONAL_HSL.exec(value)) {\n h = parseUnit(match[1], 360);\n s = parseUnit(match[2], 100);\n l = parseUnit(match[3], 100);\n }\n else if (match = REGEX_FUNCTIONAL_HSLA.exec(value)) {\n h = parseUnit(match[1], 360);\n s = parseUnit(match[2], 100);\n l = parseUnit(match[3], 100);\n a = parseUnit(match[4], 1);\n }\n if (match) {\n this.hsl = {h, s, l, a};\n } \n else {\n throw new Error('invalid hsl string');\n }\n }\n}","import { h } from 'preact';\n\nimport IroComponent from 'ui/component';\nimport IroHandle from 'ui/handle';\nimport IroColor from '../color';\nimport { resolveUrl } from '../util/svg';\n\nexport default class IroSlider extends IroComponent {\n\n renderGradient(props) {\n const hsv = props.color.hsv;\n let stops = [];\n\n switch (props.sliderType) {\n case 'hue':\n stops = [\n {offset: '0', color: '#f00'},\n {offset: '16.666', color: '#ff0'},\n {offset: '33.333', color: '#0f0'},\n {offset: '50', color: '#0ff'},\n {offset: '66.666', color: '#00f'},\n {offset: '83.333', color: '#f0f'},\n {offset: '100', color: '#f00'},\n ];\n break;\n case 'saturation':\n var noSat = IroColor.hsvToHsl({h: hsv.h, s: 0, v: hsv.v});\n var fullSat = IroColor.hsvToHsl({h: hsv.h, s: 100, v: hsv.v});\n stops = [\n {offset: '0', color: `hsl(${noSat.h}, ${noSat.s}%, ${noSat.l}%)`},\n {offset: '100', color: `hsl(${fullSat.h}, ${fullSat.s}%, ${fullSat.l}%)`}\n ];\n break;\n case 'value':\n default:\n var hsl = IroColor.hsvToHsl({h: hsv.h, s: hsv.s, v: 100});\n stops = [\n {offset: '0', color: '#000'},\n {offset: '100', color: `hsl(${hsl.h}, ${hsl.s}%, ${hsl.l}%)`}\n ];\n break;\n }\n\n return (\n \n {stops.map(stop => (\n \n ))}\n \n )\n }\n\n render(props) {\n let { width, sliderHeight, borderWidth, handleRadius } = props;\n sliderHeight = sliderHeight ? sliderHeight : props.padding * 2 + handleRadius * 2 + borderWidth * 2;\n this.width = width;\n this.height = sliderHeight;\n const cornerRadius = sliderHeight / 2;\n const range = width - cornerRadius * 2\n const hsv = props.color.hsv;\n \n let sliderValue;\n switch (props.sliderType) {\n case 'hue':\n sliderValue = hsv.h /= 3.6;\n break;\n case 'saturation':\n sliderValue = hsv.s;\n break;\n case 'value':\n default:\n sliderValue = hsv.v;\n break;\n }\n\n return (\n \n \n { this.renderGradient(props) }\n \n \n \n \n );\n }\n\n getValueFromPoint(x, y, { left }) {\n const handleRange = this.width - this.height;\n const cornerRadius = this.height / 2;\n x = x - (left + cornerRadius);\n let dist = Math.max(Math.min(x, handleRange), 0);\n return Math.round((100 / handleRange) * dist);\n }\n\n /**\n * @desc handles mouse input for this component\n * @param {Number} x - point x coordinate\n * @param {Number} y - point y coordinate\n * @param {DOMRect} rect - bounding client rect for the component's base element\n * @param {String} type - input type: \"START\", \"MOVE\" or \"END\"\n */\n handleInput(x, y, bounds, type) {\n let value = this.getValueFromPoint(x, y, bounds);\n let channel;\n switch (this.props.sliderType) {\n case 'hue':\n channel = 'h';\n value *= 3.6;\n break;\n case 'saturation':\n channel = 's';\n break;\n case 'value':\n default:\n channel = 'v';\n break;\n }\n this.props.onInput(type, {\n [channel]: value\n });\n }\n}","import { h, Component } from 'preact';\n\nimport IroWheel from 'ui/wheel';\nimport IroSlider from 'ui/slider';\nimport IroColor from './color';\nimport { createWidget } from 'util/createWidget';\n\nclass ColorPicker extends Component {\n constructor(props) {\n super(props);\n this.emitHook('init:before');\n this._events = {};\n this._deferredEvents = {};\n this._colorUpdateActive = false;\n this._colorUpdateSrc = null;\n this.color = new IroColor(props.color);\n this.deferredEmit('color:init', this.color, { h: false, s: false, v: false, a: false });\n // Whenever the color changes, update the color wheel\n this.color._onChange = this.updateColor.bind(this);\n this.state = {\n ...props,\n color: this.color,\n };\n this.emitHook('init:state');\n\n if (props.layout) {\n this.layout = props.layout;\n } else {\n this.layout = [\n {component: IroWheel, options: {}},\n {component: IroSlider, options: {}},\n ];\n }\n this.emitHook('init:after');\n }\n\n // Public ColorPicker events API\n\n /**\n * @desc Set a callback function for an event\n * @param {String | Array} eventList event(s) to listen to\n * @param {Function} callback\n */\n on(eventList, callback) {\n const events = this._events;\n // eventList can be an eventType string or an array of eventType strings\n (!Array.isArray(eventList) ? [eventList] : eventList).forEach(eventType => {\n // Emit plugin hook\n this.emitHook('event:on', eventType, callback);\n // Add event callback\n (events[eventType] || (events[eventType] = [])).push(callback);\n // Call deferred events\n // These are events that can be stored until a listener for them is added\n if (this._deferredEvents[eventType]) {\n // Deffered events store an array of arguments from when the event was called\n this._deferredEvents[eventType].forEach(args => {\n callback.apply(null, args); \n });\n // Clear deferred events\n this._deferredEvents[eventType] = [];\n }\n });\n }\n\n /**\n * @desc Remove a callback function for an event added with on()\n * @param {String | Array} eventList The name of the event\n * @param {Function} callback\n */\n off(eventList, callback) {\n (!Array.isArray(eventList) ? [eventList] : eventList).forEach(eventType => {\n const callbackList = this._events[eventType];\n this.emitHook('event:off', eventType, callback);\n if (callbackList) callbackList.splice(callbackList.indexOf(callback), 1);\n });\n }\n\n /**\n * @desc Emit an event\n * @param {String} eventType The name of the event to emit\n * @param {Array} args array of args to pass to callbacks\n */\n emit(eventType, ...args) {\n // Events are plugin hooks too\n this.emitHook(eventType, ...args);\n const callbackList = this._events[eventType] || [];\n for (let i = 0; i < callbackList.length; i++) {\n callbackList[i].apply(null, args); \n }\n }\n\n /**\n * @desc Emit an event now, or save it for when the relevent event listener is added\n * @param {String} eventType The name of the event to emit\n * @param {Array} args array of args to pass to callbacks\n */\n deferredEmit(eventType, ...args) {\n const deferredEvents = this._deferredEvents;\n this.emit(eventType, ...args);\n (deferredEvents[eventType] || (deferredEvents[eventType] = [])).push(args);\n }\n\n // Public utility methods\n\n /**\n * @desc Resize the color picker\n * @param {Number} width\n */\n resize(width) {\n this.setState({width});\n }\n\n /**\n * @desc Reset the color picker to the initial color provided in the color picker options\n */\n reset() {\n this.color.set(this.props.color);\n }\n\n // Plugin hooks API\n\n /**\n * @desc Set a callback function for a hook\n * @param {String} hookType The name of the hook to listen to\n * @param {Function} callback\n */\n static addHook(hookType, callback) {\n const pluginHooks = ColorPicker.pluginHooks;\n (pluginHooks[hookType] || (pluginHooks[hookType] = [])).push(callback);\n }\n\n /**\n * @desc Emit a callback hook\n * @access private\n * @param {String} hookType The type of hook event to emit\n */\n emitHook(hookType, ...args) {\n const callbackList = ColorPicker.pluginHooks[hookType] || [];\n for (let i = 0; i < callbackList.length; i++) {\n callbackList[i].apply(this, args); \n }\n }\n\n // Internal methods\n\n /**\n * @desc Called by the createWidget wrapper when the element is mounted into the page\n * @access private\n * @param {Element} container the container element for this ColorPicker instance\n */\n onMount(container) {\n this.el = container;\n this.deferredEmit('mount', this);\n }\n\n /**\n * @desc React to a color update\n * @access private\n * @param {IroColor} color current color\n * @param {Object} changes shows which h,s,v color channels changed\n */\n updateColor(color, changes) {\n this.emitHook('color:beforeUpdate', color, changes);\n this.setState({ color: color });\n this.emitHook('color:afterUpdate', color, changes);\n // Prevent infinite loops if the color is set inside a color:change or input:change callback\n if (!this._colorUpdateActive) {\n // While _colorUpdateActive == true, branch cannot be entered\n this._colorUpdateActive = true;\n // If the color change originates from user input, fire input:change\n if (this._colorUpdateSrc == 'input') { // colorUpdateSrc is cleared in handeInput()\n this.emit('input:change', color, changes);\n } \n // Always fire color:change event\n this.emit('color:change', color, changes);\n this._colorUpdateActive = false;\n }\n }\n\n /**\n * @desc Handle input from a UI control element\n * @access private\n * @param {String} type \"START\" | \"MOVE\" | \"END\"\n * @param {Object} hsv new hsv values for the color\n */\n handleInput(type, hsv) {\n // Fire input start and move events before color update\n if (type === 'START') this.emit('input:start', this.color);\n if (type === 'MOVE') this.emit('input:move', this.color);\n // Set the color update source\n this._colorUpdateSrc = 'input';\n // Setting the color HSV here will automatically update the UI\n // Since we bound the color's _onChange callback\n this.color.hsv = hsv;\n // Fire input end event after color update\n if (type === 'END') this.emit('input:end', this.color);\n // Reset color update source so it doesn't interfere with future color updates\n // Super important to do this here and not in updateColor()\n this._colorUpdateSrc = null;\n }\n\n render(props, state) {\n return (\n
\n {this.layout.map(({component: UiComponent, options: options}) => (\n this.handleInput(type, hsv) }\n parent={ this }\n />\n ))}\n
\n )\n }\n}\n\nColorPicker.pluginHooks = {};\n\nColorPicker.defaultProps = {\n width: 300,\n height: 300,\n handleRadius: 8,\n handleSvg: null,\n handleOrigin: {x: 0, y: 0},\n color: '#fff',\n borderColor: '#fff',\n borderWidth: 0,\n display: 'block',\n wheelLightness: true,\n sliderHeight: null,\n sliderMargin: 12,\n padding: 6,\n layout: null,\n}\n\nexport default createWidget(ColorPicker);\n","import { h, render } from 'preact';\nimport { onDocumentReady } from './dom';\n\n/**\n * @desc Turn a component into a widget\n * This returns a factory function that can be used to create an instance of the widget component\n * The first function param is a DOM element or CSS selector for the element to mount to,\n * The second param is for config options which are passed to the component as props\n * This factory function can also delay mounting the element into the DOM until the page is ready\n * @param {Component} widgetComonpent ui component to turn into a widget\n * @returns {Function} widget factory\n */\nexport function createWidget(widgetComponent) {\n\n const widgetFactory = function (parent, props) {\n let widget = null; // will become an instance of the widget component class\n let widgetRoot = document.createElement('div');\n\n // Render widget into a temp DOM node\n render(\n h(widgetComponent, {\n ref: ref => widget = ref,\n ...props,\n }),\n widgetRoot\n );\n // Mount it into the DOM when the page document is ready\n onDocumentReady(() => {\n const container = parent instanceof Element ? parent : document.querySelector(parent);\n container.appendChild(widget.base);\n widget.onMount(container);\n });\n\n return widget;\n }\n\n // Allow the widget factory to inherit component prototype + static class methods\n // This makes it easier for plugin authors to extend the base widget component\n widgetFactory.prototype = widgetComponent.prototype;\n Object.assign(widgetFactory, widgetComponent);\n // Add reference to base component too\n widgetFactory.__component = widgetComponent; \n\n return widgetFactory;\n\n}","/**\n * iro.js plugins API\n * This provides the iro.use method, which can be used to register plugins which extend the iro.js core\n */\nexport function usePlugins(core) {\n const installedPlugins = [];\n \n /**\n * @desc Register iro.js plugin\n * @param {Function} plugin = plugin constructor\n * @param {Object} pluginOptions = plugin options passed to constructor\n */\n core.use = function(plugin, pluginOptions = {}) {\n // Check that the plugin hasn't already been registered\n if (!(installedPlugins.indexOf(plugin) > -1)) {\n // Init plugin\n // TODO: consider collection of plugin utils, which are passed as a thrid param\n plugin(core, pluginOptions);\n // Register plugin\n installedPlugins.push(plugin);\n }\n }\n\n core.installedPlugins = installedPlugins;\n\n return core;\n}","import { h } from 'preact';\n\nimport ColorPicker from './colorPicker';\nimport Color from './color';\n\nimport Component from 'ui/component';\nimport Handle from 'ui/handle';\nimport Slider from 'ui/slider';\nimport Wheel from 'ui/wheel';\nimport { usePlugins } from 'util/usePlugins';\nimport { resolveUrl, createArcPath } from 'util/svg';\nimport { parseUnit, parseHexInt, intToHex } from 'util/colorUtils';\n\nexport default usePlugins({\n Color,\n ColorPicker,\n ui: {\n h,\n Component,\n Handle,\n Slider,\n Wheel,\n },\n util: {\n resolveUrl, \n createArcPath,\n parseUnit,\n parseHexInt,\n intToHex\n },\n version: VERSION,\n});\n"],"names":["VNode","options","stack","EMPTY_CHILDREN","h","nodeName","attributes","lastSimple","child","simple","i","children","arguments","length","push","pop","undefined","String","p","key","extend","obj","props","applyRef","ref","value","current","defer","Promise","resolve","then","bind","setTimeout","IS_NON_DIMENSIONAL","items","enqueueRender","component","_dirty","rerender","renderComponent","isNamedNode","node","normalizedNodeName","toLowerCase","getNodeProps","vnode","defaultProps","removeNode","parentNode","removeChild","setAccessor","name","old","isSvg","style","cssText","test","innerHTML","__html","useCapture","replace","substring","addEventListener","eventProxy","removeEventListener","_listeners","e","removeAttribute","ns","removeAttributeNS","setAttributeNS","setAttribute","className","this","type","mounts","diffLevel","isSvgMode","hydrating","flushMounts","c","shift","componentDidMount","diff","dom","context","mountAll","parent","componentRoot","ownerSVGElement","ret","idiff","appendChild","out","prevSvgMode","splitText","_component","nodeValue","document","createTextNode","replaceChild","recollectNodeTree","vnodeName","originalComponent","oldDom","isDirectOwner","_componentConstructor","isOwner","_parentComponent","constructor","setComponentProps","base","unmountComponent","createComponent","nextBase","buildComponentFromVNode","createElementNS","createElement","firstChild","fc","vchildren","a","nextSibling","isHydrating","j","f","vchild","originalChildren","childNodes","keyed","keyedLen","min","len","childrenLen","vlen","_child","__key","trim","insertBefore","innerDiffNode","dangerouslySetInnerHTML","attrs","diffAttributes","unmountOnly","removeChildren","lastChild","next","previousSibling","recyclerComponents","Ctor","inst","prototype","render","Component","call","doRender","splice","state","renderMode","_disable","__ref","getDerivedStateFromProps","componentWillMount","componentWillReceiveProps","prevContext","prevProps","syncComponentUpdates","isChild","rendered","cbase","previousProps","previousState","prevState","previousContext","isUpdate","initialBase","initialChildComponent","skip","snapshot","shouldComponentUpdate","componentWillUpdate","getChildContext","getSnapshotBeforeUpdate","toUnmount","childComponent","childProps","baseParent","componentRef","t","componentDidUpdate","_renderCallbacks","componentWillUnmount","inner","listen","el","eventList","callback","params","unlisten","setState","forceUpdate","const","EVENT_MOUSEDOWN","EVENT_MOUSEMOVE","EVENT_MOUSEUP","EVENT_TOUCHSTART","EVENT_TOUCHMOVE","EVENT_TOUCHEND","IroComponent","super","uid","Math","random","toString","passive","handleEvent","preventDefault","point","touches","changedTouches","x","clientX","y","clientY","bounds","getBoundingClientRect","handleInput","resolveUrl","url","ua","window","navigator","userAgent","isSafari","isIos","location","createArcPath","cx","cy","radius","startAngle","endAngle","largeArcFlag","PI","cos","sin","IroHandle","r","class","overflow","xlinkHref","origin","fill","stroke-width","stroke","IroWheel","hsv","color","width","borderWidth","handleAngle","handleDist","s","padding","handleRadius","cX","cY","height","display","id","offset","stop-color","stop-opacity","Array","apply","map","_","hue","d","wheelLightness","opacity","v","borderColor","handleSvg","handleOrigin","handleRange","left","top","let","atan2","round","sqrt","onInput","parseUnit","str","max","isPercentage","indexOf","num","parseFloat","parseHexInt","parseInt","intToHex","int","padStart","CSS_UNIT","PERMISSIVE_MATCH_3","PERMISSIVE_MATCH_4","REGEX_FUNCTIONAL_RGB","RegExp","REGEX_FUNCTIONAL_RGBA","REGEX_FUNCTIONAL_HSL","REGEX_FUNCTIONAL_HSLA","HEX_START","HEX_INT_SINGLE","HEX_INT_DOUBLE","REGEX_HEX_3","REGEX_HEX_4","REGEX_HEX_6","REGEX_HEX_8","Color","_onChange","_value","set","isString","isObject","hexString","rgbString","hslString","rgb","Error","hsl","setChannel","format","channel","Object","clone","hsvToRgb","floor","q","mod","g","b","rgbToHsv","delta","saturation","hsvToHsl","l","divisor","hslToHsv","prototypeAccessors","newValue","oldValue","changes","match","exec","IroSlider","renderGradient","stops","sliderType","noSat","IroColor","fullSat","stop","sliderHeight","sliderValue","cornerRadius","range","marginTop","sliderMargin","rx","ry","getValueFromPoint","dist","ColorPicker","emitHook","_events","_deferredEvents","_colorUpdateActive","_colorUpdateSrc","deferredEmit","updateColor","layout","on","events","isArray","forEach","eventType","args","off","callbackList","emit","deferredEvents","resize","reset","addHook","hookType","pluginHooks","onMount","container","UiComponent","widgetComponent","widgetFactory","core","installedPlugins","merge","widget","widgetRoot","Element","querySelector","readyState","assign","__component","ui","Handle","Slider","Wheel","util","version","use","plugin","pluginOptions"],"mappings":";;;;;;+KAAA,IAAIA,EAAQ,aAERC,EAAU,GAEVC,EAAQ,GAERC,EAAiB,GAErB,SAASC,EAAEC,EAAUC,OAEhBC,EACAC,EACAC,EACAC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bS,QAAS,QACTW,gBAAgB,EAChBqF,aAAc,KACdK,aAAc,GACd1G,QAAS,EACTuH,OAAQ,UCnOmBmB,GAErBC,GCVmBC,GACnBC,QDSAF,GAAgB,SAAU3T,EAAQjE,GACtC0Q,IV+qBYnP,EAAewW,EChqBCjN,ESfxBkN,EAAS,KACTC,EAAarT,SAASmB,cAAc,OAiBxC,OV6pBYxE,EU1qBVzC,EAAE6Y,GAAiBlE,kBACjBvT,aAAKA,UAAO8X,EAAS9X,IACrBF,IVyqBC6D,EAAKkU,EAAOxW,EAAO,IAAI,EUvqB1B0W,GVuqByC,GCjqBfnN,aSF1BK,IAAMsM,EAAYxT,aAAkBiU,QAAUjU,EAASW,SAASuT,cAAclU,GAC9EwT,EAAUnT,YAAY0T,EAAOvS,MAC7BuS,EAAOR,QAAQC,ITCS,YAAxB7S,SAASwT,WACXtN,IAEAH,EAAO/F,SAAU,CAAC,oBAAqBkG,GSDhCkN,IAKK/P,WA1Ba0P,GDsOD3B,IC5MgB/N,UAC1CwL,OAAO4E,OAAOT,GAAeD,IAE7BC,GAAcU,YAAcX,GAErBC,WCtCDE,GAAmB,IADAD,GCSD,OACxBnF,eACAsD,GACAuC,GAAI,GACFzZ,YACAqJ,SACAqQ,SACAC,SACAC,GAEFC,KAAM,YACJ9L,gBACAS,YACAyD,cACAO,WACAE,GAEFoH,QAAS,UDlBJC,IAAM,SAASC,EAAQC,kBAAgB,KAEA,EAApCjB,GAAiB3G,QAAQ2H,KAG7BA,EAAOjB,GAAMkB,GAEbjB,GAAiBtY,KAAKsZ,KAI1BjB,GAAKC,iBAAmBA,GAEjBD"} \ No newline at end of file +{"version":3,"file":"iro.min.js.map","sources":["../node_modules/preact/dist/preact.mjs","../src/util/dom.js","../src/ui/component.js","../src/util/svg.js","../src/ui/handle.jsx","../src/ui/wheel.jsx","../src/util/colorUtils.js","../src/color.js","../src/ui/slider.jsx","../src/colorPicker.js","../src/util/createWidget.js","../src/util/usePlugins.js","../src/iro.js"],"sourcesContent":["var VNode = function VNode() {};\n\nvar options = {};\n\nvar stack = [];\n\nvar EMPTY_CHILDREN = [];\n\nfunction h(nodeName, attributes) {\n\tvar children = EMPTY_CHILDREN,\n\t lastSimple,\n\t child,\n\t simple,\n\t i;\n\tfor (i = arguments.length; i-- > 2;) {\n\t\tstack.push(arguments[i]);\n\t}\n\tif (attributes && attributes.children != null) {\n\t\tif (!stack.length) stack.push(attributes.children);\n\t\tdelete attributes.children;\n\t}\n\twhile (stack.length) {\n\t\tif ((child = stack.pop()) && child.pop !== undefined) {\n\t\t\tfor (i = child.length; i--;) {\n\t\t\t\tstack.push(child[i]);\n\t\t\t}\n\t\t} else {\n\t\t\tif (typeof child === 'boolean') child = null;\n\n\t\t\tif (simple = typeof nodeName !== 'function') {\n\t\t\t\tif (child == null) child = '';else if (typeof child === 'number') child = String(child);else if (typeof child !== 'string') simple = false;\n\t\t\t}\n\n\t\t\tif (simple && lastSimple) {\n\t\t\t\tchildren[children.length - 1] += child;\n\t\t\t} else if (children === EMPTY_CHILDREN) {\n\t\t\t\tchildren = [child];\n\t\t\t} else {\n\t\t\t\tchildren.push(child);\n\t\t\t}\n\n\t\t\tlastSimple = simple;\n\t\t}\n\t}\n\n\tvar p = new VNode();\n\tp.nodeName = nodeName;\n\tp.children = children;\n\tp.attributes = attributes == null ? undefined : attributes;\n\tp.key = attributes == null ? undefined : attributes.key;\n\n\tif (options.vnode !== undefined) options.vnode(p);\n\n\treturn p;\n}\n\nfunction extend(obj, props) {\n for (var i in props) {\n obj[i] = props[i];\n }return obj;\n}\n\nfunction applyRef(ref, value) {\n if (ref != null) {\n if (typeof ref == 'function') ref(value);else ref.current = value;\n }\n}\n\nvar defer = typeof Promise == 'function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;\n\nfunction cloneElement(vnode, props) {\n return h(vnode.nodeName, extend(extend({}, vnode.attributes), props), arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children);\n}\n\nvar IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\n\nvar items = [];\n\nfunction enqueueRender(component) {\n\tif (!component._dirty && (component._dirty = true) && items.push(component) == 1) {\n\t\t(options.debounceRendering || defer)(rerender);\n\t}\n}\n\nfunction rerender() {\n\tvar p;\n\twhile (p = items.pop()) {\n\t\tif (p._dirty) renderComponent(p);\n\t}\n}\n\nfunction isSameNodeType(node, vnode, hydrating) {\n\tif (typeof vnode === 'string' || typeof vnode === 'number') {\n\t\treturn node.splitText !== undefined;\n\t}\n\tif (typeof vnode.nodeName === 'string') {\n\t\treturn !node._componentConstructor && isNamedNode(node, vnode.nodeName);\n\t}\n\treturn hydrating || node._componentConstructor === vnode.nodeName;\n}\n\nfunction isNamedNode(node, nodeName) {\n\treturn node.normalizedNodeName === nodeName || node.nodeName.toLowerCase() === nodeName.toLowerCase();\n}\n\nfunction getNodeProps(vnode) {\n\tvar props = extend({}, vnode.attributes);\n\tprops.children = vnode.children;\n\n\tvar defaultProps = vnode.nodeName.defaultProps;\n\tif (defaultProps !== undefined) {\n\t\tfor (var i in defaultProps) {\n\t\t\tif (props[i] === undefined) {\n\t\t\t\tprops[i] = defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn props;\n}\n\nfunction createNode(nodeName, isSvg) {\n\tvar node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName);\n\tnode.normalizedNodeName = nodeName;\n\treturn node;\n}\n\nfunction removeNode(node) {\n\tvar parentNode = node.parentNode;\n\tif (parentNode) parentNode.removeChild(node);\n}\n\nfunction setAccessor(node, name, old, value, isSvg) {\n\tif (name === 'className') name = 'class';\n\n\tif (name === 'key') {} else if (name === 'ref') {\n\t\tapplyRef(old, null);\n\t\tapplyRef(value, node);\n\t} else if (name === 'class' && !isSvg) {\n\t\tnode.className = value || '';\n\t} else if (name === 'style') {\n\t\tif (!value || typeof value === 'string' || typeof old === 'string') {\n\t\t\tnode.style.cssText = value || '';\n\t\t}\n\t\tif (value && typeof value === 'object') {\n\t\t\tif (typeof old !== 'string') {\n\t\t\t\tfor (var i in old) {\n\t\t\t\t\tif (!(i in value)) node.style[i] = '';\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var i in value) {\n\t\t\t\tnode.style[i] = typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false ? value[i] + 'px' : value[i];\n\t\t\t}\n\t\t}\n\t} else if (name === 'dangerouslySetInnerHTML') {\n\t\tif (value) node.innerHTML = value.__html || '';\n\t} else if (name[0] == 'o' && name[1] == 'n') {\n\t\tvar useCapture = name !== (name = name.replace(/Capture$/, ''));\n\t\tname = name.toLowerCase().substring(2);\n\t\tif (value) {\n\t\t\tif (!old) node.addEventListener(name, eventProxy, useCapture);\n\t\t} else {\n\t\t\tnode.removeEventListener(name, eventProxy, useCapture);\n\t\t}\n\t\t(node._listeners || (node._listeners = {}))[name] = value;\n\t} else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\n\t\ttry {\n\t\t\tnode[name] = value == null ? '' : value;\n\t\t} catch (e) {}\n\t\tif ((value == null || value === false) && name != 'spellcheck') node.removeAttribute(name);\n\t} else {\n\t\tvar ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''));\n\n\t\tif (value == null || value === false) {\n\t\t\tif (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase());else node.removeAttribute(name);\n\t\t} else if (typeof value !== 'function') {\n\t\t\tif (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value);else node.setAttribute(name, value);\n\t\t}\n\t}\n}\n\nfunction eventProxy(e) {\n\treturn this._listeners[e.type](options.event && options.event(e) || e);\n}\n\nvar mounts = [];\n\nvar diffLevel = 0;\n\nvar isSvgMode = false;\n\nvar hydrating = false;\n\nfunction flushMounts() {\n\tvar c;\n\twhile (c = mounts.shift()) {\n\t\tif (options.afterMount) options.afterMount(c);\n\t\tif (c.componentDidMount) c.componentDidMount();\n\t}\n}\n\nfunction diff(dom, vnode, context, mountAll, parent, componentRoot) {\n\tif (!diffLevel++) {\n\t\tisSvgMode = parent != null && parent.ownerSVGElement !== undefined;\n\n\t\thydrating = dom != null && !('__preactattr_' in dom);\n\t}\n\n\tvar ret = idiff(dom, vnode, context, mountAll, componentRoot);\n\n\tif (parent && ret.parentNode !== parent) parent.appendChild(ret);\n\n\tif (! --diffLevel) {\n\t\thydrating = false;\n\n\t\tif (!componentRoot) flushMounts();\n\t}\n\n\treturn ret;\n}\n\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n\tvar out = dom,\n\t prevSvgMode = isSvgMode;\n\n\tif (vnode == null || typeof vnode === 'boolean') vnode = '';\n\n\tif (typeof vnode === 'string' || typeof vnode === 'number') {\n\t\tif (dom && dom.splitText !== undefined && dom.parentNode && (!dom._component || componentRoot)) {\n\t\t\tif (dom.nodeValue != vnode) {\n\t\t\t\tdom.nodeValue = vnode;\n\t\t\t}\n\t\t} else {\n\t\t\tout = document.createTextNode(vnode);\n\t\t\tif (dom) {\n\t\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\t\t\t\trecollectNodeTree(dom, true);\n\t\t\t}\n\t\t}\n\n\t\tout['__preactattr_'] = true;\n\n\t\treturn out;\n\t}\n\n\tvar vnodeName = vnode.nodeName;\n\tif (typeof vnodeName === 'function') {\n\t\treturn buildComponentFromVNode(dom, vnode, context, mountAll);\n\t}\n\n\tisSvgMode = vnodeName === 'svg' ? true : vnodeName === 'foreignObject' ? false : isSvgMode;\n\n\tvnodeName = String(vnodeName);\n\tif (!dom || !isNamedNode(dom, vnodeName)) {\n\t\tout = createNode(vnodeName, isSvgMode);\n\n\t\tif (dom) {\n\t\t\twhile (dom.firstChild) {\n\t\t\t\tout.appendChild(dom.firstChild);\n\t\t\t}\n\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\n\t\t\trecollectNodeTree(dom, true);\n\t\t}\n\t}\n\n\tvar fc = out.firstChild,\n\t props = out['__preactattr_'],\n\t vchildren = vnode.children;\n\n\tif (props == null) {\n\t\tprops = out['__preactattr_'] = {};\n\t\tfor (var a = out.attributes, i = a.length; i--;) {\n\t\t\tprops[a[i].name] = a[i].value;\n\t\t}\n\t}\n\n\tif (!hydrating && vchildren && vchildren.length === 1 && typeof vchildren[0] === 'string' && fc != null && fc.splitText !== undefined && fc.nextSibling == null) {\n\t\tif (fc.nodeValue != vchildren[0]) {\n\t\t\tfc.nodeValue = vchildren[0];\n\t\t}\n\t} else if (vchildren && vchildren.length || fc != null) {\n\t\t\tinnerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML != null);\n\t\t}\n\n\tdiffAttributes(out, vnode.attributes, props);\n\n\tisSvgMode = prevSvgMode;\n\n\treturn out;\n}\n\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n\tvar originalChildren = dom.childNodes,\n\t children = [],\n\t keyed = {},\n\t keyedLen = 0,\n\t min = 0,\n\t len = originalChildren.length,\n\t childrenLen = 0,\n\t vlen = vchildren ? vchildren.length : 0,\n\t j,\n\t c,\n\t f,\n\t vchild,\n\t child;\n\n\tif (len !== 0) {\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tvar _child = originalChildren[i],\n\t\t\t props = _child['__preactattr_'],\n\t\t\t key = vlen && props ? _child._component ? _child._component.__key : props.key : null;\n\t\t\tif (key != null) {\n\t\t\t\tkeyedLen++;\n\t\t\t\tkeyed[key] = _child;\n\t\t\t} else if (props || (_child.splitText !== undefined ? isHydrating ? _child.nodeValue.trim() : true : isHydrating)) {\n\t\t\t\tchildren[childrenLen++] = _child;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (vlen !== 0) {\n\t\tfor (var i = 0; i < vlen; i++) {\n\t\t\tvchild = vchildren[i];\n\t\t\tchild = null;\n\n\t\t\tvar key = vchild.key;\n\t\t\tif (key != null) {\n\t\t\t\tif (keyedLen && keyed[key] !== undefined) {\n\t\t\t\t\tchild = keyed[key];\n\t\t\t\t\tkeyed[key] = undefined;\n\t\t\t\t\tkeyedLen--;\n\t\t\t\t}\n\t\t\t} else if (min < childrenLen) {\n\t\t\t\t\tfor (j = min; j < childrenLen; j++) {\n\t\t\t\t\t\tif (children[j] !== undefined && isSameNodeType(c = children[j], vchild, isHydrating)) {\n\t\t\t\t\t\t\tchild = c;\n\t\t\t\t\t\t\tchildren[j] = undefined;\n\t\t\t\t\t\t\tif (j === childrenLen - 1) childrenLen--;\n\t\t\t\t\t\t\tif (j === min) min++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\tchild = idiff(child, vchild, context, mountAll);\n\n\t\t\tf = originalChildren[i];\n\t\t\tif (child && child !== dom && child !== f) {\n\t\t\t\tif (f == null) {\n\t\t\t\t\tdom.appendChild(child);\n\t\t\t\t} else if (child === f.nextSibling) {\n\t\t\t\t\tremoveNode(f);\n\t\t\t\t} else {\n\t\t\t\t\tdom.insertBefore(child, f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (keyedLen) {\n\t\tfor (var i in keyed) {\n\t\t\tif (keyed[i] !== undefined) recollectNodeTree(keyed[i], false);\n\t\t}\n\t}\n\n\twhile (min <= childrenLen) {\n\t\tif ((child = children[childrenLen--]) !== undefined) recollectNodeTree(child, false);\n\t}\n}\n\nfunction recollectNodeTree(node, unmountOnly) {\n\tvar component = node._component;\n\tif (component) {\n\t\tunmountComponent(component);\n\t} else {\n\t\tif (node['__preactattr_'] != null) applyRef(node['__preactattr_'].ref, null);\n\n\t\tif (unmountOnly === false || node['__preactattr_'] == null) {\n\t\t\tremoveNode(node);\n\t\t}\n\n\t\tremoveChildren(node);\n\t}\n}\n\nfunction removeChildren(node) {\n\tnode = node.lastChild;\n\twhile (node) {\n\t\tvar next = node.previousSibling;\n\t\trecollectNodeTree(node, true);\n\t\tnode = next;\n\t}\n}\n\nfunction diffAttributes(dom, attrs, old) {\n\tvar name;\n\n\tfor (name in old) {\n\t\tif (!(attrs && attrs[name] != null) && old[name] != null) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = undefined, isSvgMode);\n\t\t}\n\t}\n\n\tfor (name in attrs) {\n\t\tif (name !== 'children' && name !== 'innerHTML' && (!(name in old) || attrs[name] !== (name === 'value' || name === 'checked' ? dom[name] : old[name]))) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode);\n\t\t}\n\t}\n}\n\nvar recyclerComponents = [];\n\nfunction createComponent(Ctor, props, context) {\n\tvar inst,\n\t i = recyclerComponents.length;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t} else {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\twhile (i--) {\n\t\tif (recyclerComponents[i].constructor === Ctor) {\n\t\t\tinst.nextBase = recyclerComponents[i].nextBase;\n\t\t\trecyclerComponents.splice(i, 1);\n\t\t\treturn inst;\n\t\t}\n\t}\n\n\treturn inst;\n}\n\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n\nfunction setComponentProps(component, props, renderMode, context, mountAll) {\n\tif (component._disable) return;\n\tcomponent._disable = true;\n\n\tcomponent.__ref = props.ref;\n\tcomponent.__key = props.key;\n\tdelete props.ref;\n\tdelete props.key;\n\n\tif (typeof component.constructor.getDerivedStateFromProps === 'undefined') {\n\t\tif (!component.base || mountAll) {\n\t\t\tif (component.componentWillMount) component.componentWillMount();\n\t\t} else if (component.componentWillReceiveProps) {\n\t\t\tcomponent.componentWillReceiveProps(props, context);\n\t\t}\n\t}\n\n\tif (context && context !== component.context) {\n\t\tif (!component.prevContext) component.prevContext = component.context;\n\t\tcomponent.context = context;\n\t}\n\n\tif (!component.prevProps) component.prevProps = component.props;\n\tcomponent.props = props;\n\n\tcomponent._disable = false;\n\n\tif (renderMode !== 0) {\n\t\tif (renderMode === 1 || options.syncComponentUpdates !== false || !component.base) {\n\t\t\trenderComponent(component, 1, mountAll);\n\t\t} else {\n\t\t\tenqueueRender(component);\n\t\t}\n\t}\n\n\tapplyRef(component.__ref, component);\n}\n\nfunction renderComponent(component, renderMode, mountAll, isChild) {\n\tif (component._disable) return;\n\n\tvar props = component.props,\n\t state = component.state,\n\t context = component.context,\n\t previousProps = component.prevProps || props,\n\t previousState = component.prevState || state,\n\t previousContext = component.prevContext || context,\n\t isUpdate = component.base,\n\t nextBase = component.nextBase,\n\t initialBase = isUpdate || nextBase,\n\t initialChildComponent = component._component,\n\t skip = false,\n\t snapshot = previousContext,\n\t rendered,\n\t inst,\n\t cbase;\n\n\tif (component.constructor.getDerivedStateFromProps) {\n\t\tstate = extend(extend({}, state), component.constructor.getDerivedStateFromProps(props, state));\n\t\tcomponent.state = state;\n\t}\n\n\tif (isUpdate) {\n\t\tcomponent.props = previousProps;\n\t\tcomponent.state = previousState;\n\t\tcomponent.context = previousContext;\n\t\tif (renderMode !== 2 && component.shouldComponentUpdate && component.shouldComponentUpdate(props, state, context) === false) {\n\t\t\tskip = true;\n\t\t} else if (component.componentWillUpdate) {\n\t\t\tcomponent.componentWillUpdate(props, state, context);\n\t\t}\n\t\tcomponent.props = props;\n\t\tcomponent.state = state;\n\t\tcomponent.context = context;\n\t}\n\n\tcomponent.prevProps = component.prevState = component.prevContext = component.nextBase = null;\n\tcomponent._dirty = false;\n\n\tif (!skip) {\n\t\trendered = component.render(props, state, context);\n\n\t\tif (component.getChildContext) {\n\t\t\tcontext = extend(extend({}, context), component.getChildContext());\n\t\t}\n\n\t\tif (isUpdate && component.getSnapshotBeforeUpdate) {\n\t\t\tsnapshot = component.getSnapshotBeforeUpdate(previousProps, previousState);\n\t\t}\n\n\t\tvar childComponent = rendered && rendered.nodeName,\n\t\t toUnmount,\n\t\t base;\n\n\t\tif (typeof childComponent === 'function') {\n\n\t\t\tvar childProps = getNodeProps(rendered);\n\t\t\tinst = initialChildComponent;\n\n\t\t\tif (inst && inst.constructor === childComponent && childProps.key == inst.__key) {\n\t\t\t\tsetComponentProps(inst, childProps, 1, context, false);\n\t\t\t} else {\n\t\t\t\ttoUnmount = inst;\n\n\t\t\t\tcomponent._component = inst = createComponent(childComponent, childProps, context);\n\t\t\t\tinst.nextBase = inst.nextBase || nextBase;\n\t\t\t\tinst._parentComponent = component;\n\t\t\t\tsetComponentProps(inst, childProps, 0, context, false);\n\t\t\t\trenderComponent(inst, 1, mountAll, true);\n\t\t\t}\n\n\t\t\tbase = inst.base;\n\t\t} else {\n\t\t\tcbase = initialBase;\n\n\t\t\ttoUnmount = initialChildComponent;\n\t\t\tif (toUnmount) {\n\t\t\t\tcbase = component._component = null;\n\t\t\t}\n\n\t\t\tif (initialBase || renderMode === 1) {\n\t\t\t\tif (cbase) cbase._component = null;\n\t\t\t\tbase = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, true);\n\t\t\t}\n\t\t}\n\n\t\tif (initialBase && base !== initialBase && inst !== initialChildComponent) {\n\t\t\tvar baseParent = initialBase.parentNode;\n\t\t\tif (baseParent && base !== baseParent) {\n\t\t\t\tbaseParent.replaceChild(base, initialBase);\n\n\t\t\t\tif (!toUnmount) {\n\t\t\t\t\tinitialBase._component = null;\n\t\t\t\t\trecollectNodeTree(initialBase, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (toUnmount) {\n\t\t\tunmountComponent(toUnmount);\n\t\t}\n\n\t\tcomponent.base = base;\n\t\tif (base && !isChild) {\n\t\t\tvar componentRef = component,\n\t\t\t t = component;\n\t\t\twhile (t = t._parentComponent) {\n\t\t\t\t(componentRef = t).base = base;\n\t\t\t}\n\t\t\tbase._component = componentRef;\n\t\t\tbase._componentConstructor = componentRef.constructor;\n\t\t}\n\t}\n\n\tif (!isUpdate || mountAll) {\n\t\tmounts.push(component);\n\t} else if (!skip) {\n\n\t\tif (component.componentDidUpdate) {\n\t\t\tcomponent.componentDidUpdate(previousProps, previousState, snapshot);\n\t\t}\n\t\tif (options.afterUpdate) options.afterUpdate(component);\n\t}\n\n\twhile (component._renderCallbacks.length) {\n\t\tcomponent._renderCallbacks.pop().call(component);\n\t}if (!diffLevel && !isChild) flushMounts();\n}\n\nfunction buildComponentFromVNode(dom, vnode, context, mountAll) {\n\tvar c = dom && dom._component,\n\t originalComponent = c,\n\t oldDom = dom,\n\t isDirectOwner = c && dom._componentConstructor === vnode.nodeName,\n\t isOwner = isDirectOwner,\n\t props = getNodeProps(vnode);\n\twhile (c && !isOwner && (c = c._parentComponent)) {\n\t\tisOwner = c.constructor === vnode.nodeName;\n\t}\n\n\tif (c && isOwner && (!mountAll || c._component)) {\n\t\tsetComponentProps(c, props, 3, context, mountAll);\n\t\tdom = c.base;\n\t} else {\n\t\tif (originalComponent && !isDirectOwner) {\n\t\t\tunmountComponent(originalComponent);\n\t\t\tdom = oldDom = null;\n\t\t}\n\n\t\tc = createComponent(vnode.nodeName, props, context);\n\t\tif (dom && !c.nextBase) {\n\t\t\tc.nextBase = dom;\n\n\t\t\toldDom = null;\n\t\t}\n\t\tsetComponentProps(c, props, 1, context, mountAll);\n\t\tdom = c.base;\n\n\t\tif (oldDom && dom !== oldDom) {\n\t\t\toldDom._component = null;\n\t\t\trecollectNodeTree(oldDom, false);\n\t\t}\n\t}\n\n\treturn dom;\n}\n\nfunction unmountComponent(component) {\n\tif (options.beforeUnmount) options.beforeUnmount(component);\n\n\tvar base = component.base;\n\n\tcomponent._disable = true;\n\n\tif (component.componentWillUnmount) component.componentWillUnmount();\n\n\tcomponent.base = null;\n\n\tvar inner = component._component;\n\tif (inner) {\n\t\tunmountComponent(inner);\n\t} else if (base) {\n\t\tif (base['__preactattr_'] != null) applyRef(base['__preactattr_'].ref, null);\n\n\t\tcomponent.nextBase = base;\n\n\t\tremoveNode(base);\n\t\trecyclerComponents.push(component);\n\n\t\tremoveChildren(base);\n\t}\n\n\tapplyRef(component.__ref, null);\n}\n\nfunction Component(props, context) {\n\tthis._dirty = true;\n\n\tthis.context = context;\n\n\tthis.props = props;\n\n\tthis.state = this.state || {};\n\n\tthis._renderCallbacks = [];\n}\n\nextend(Component.prototype, {\n\tsetState: function setState(state, callback) {\n\t\tif (!this.prevState) this.prevState = this.state;\n\t\tthis.state = extend(extend({}, this.state), typeof state === 'function' ? state(this.state, this.props) : state);\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t},\n\tforceUpdate: function forceUpdate(callback) {\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\trenderComponent(this, 2);\n\t},\n\trender: function render() {}\n});\n\nfunction render(vnode, parent, merge) {\n return diff(merge, vnode, {}, false, parent, false);\n}\n\nfunction createRef() {\n\treturn {};\n}\n\nvar preact = {\n\th: h,\n\tcreateElement: h,\n\tcloneElement: cloneElement,\n\tcreateRef: createRef,\n\tComponent: Component,\n\trender: render,\n\trerender: rerender,\n\toptions: options\n};\n\nexport default preact;\nexport { h, h as createElement, cloneElement, createRef, Component, render, rerender, options };\n//# sourceMappingURL=preact.mjs.map\n","/**\n * @desc listen to one or more events on an element\n * @param {Element} el target element\n * @param {Array} eventList the events to listen to\n * @param {Function} callback\n * @param {Object} params params to pass to addEventListener\n */\nexport function listen(el, eventList, callback, params={}) {\n for (var i = 0; i < eventList.length; i++) {\n el.addEventListener(eventList[i], callback, params);\n }\n};\n\n/**\n * @desc remove an event listener on an element\n * @param {Element} el target element\n * @param {Array} eventList the events to remove\n * @param {Function} callback\n * @param {Object} params params to pass to removeEventListener\n */\nexport function unlisten(el, eventList, callback, params={}) {\n for (var i = 0; i < eventList.length; i++) {\n el.removeEventListener(eventList[i], callback, params);\n }\n};\n\n/**\n * @desc call fn callback when the page document has fully loaded\n * @param {Function} callback\n */\nexport function onDocumentReady(callback) {\n if (document.readyState !== 'loading') {\n callback();\n } else {\n listen(document, ['DOMContentLoaded'], callback);\n }\n};","import { Component } from 'preact';\nimport { listen, unlisten } from 'util/dom';\n\nconst EVENT_MOUSEDOWN = 'mousedown';\nconst EVENT_MOUSEMOVE = 'mousemove';\nconst EVENT_MOUSEUP = 'mouseup';\nconst EVENT_TOUCHSTART = 'touchstart';\nconst EVENT_TOUCHMOVE = 'touchmove';\nconst EVENT_TOUCHEND = 'touchend';\n\n/**\n * Base component class for iro UI components\n * This extends the Preact component class to allow them to react to mouse/touch input events by themselves\n */\nexport default class IroComponent extends Component {\n\n constructor(props) {\n super(props);\n // Generate unique ID for the component\n // This can be used to generate unique IDs for gradients, etc\n this.uid = (Math.random() + 1).toString(36).substring(5);\n }\n \n componentDidMount() {\n listen(this.base, [EVENT_MOUSEDOWN, EVENT_TOUCHSTART], this, { passive: false });\n }\n\n componentWillUnmount() {\n unlisten(this.base, [EVENT_MOUSEDOWN, EVENT_TOUCHSTART], this);\n }\n\n // More info on handleEvent:\n // https://medium.com/@WebReflection/dom-handleevent-a-cross-platform-standard-since-year-2000-5bf17287fd38\n // TL;DR this lets us have a single point of entry for multiple events, and we can avoid callback/binding hell\n handleEvent(e) {\n e.preventDefault();\n // Detect if the event is a touch event by checking if it has the `touches` property\n // If it is a touch event, use the first touch input\n const point = e.touches ? e.changedTouches[0] : e;\n const x = point.clientX;\n const y = point.clientY;\n // Get the screen position of the component\n const bounds = this.base.getBoundingClientRect();\n\n switch (e.type) {\n case EVENT_MOUSEDOWN:\n case EVENT_TOUCHSTART:\n listen(document, [EVENT_MOUSEMOVE, EVENT_TOUCHMOVE, EVENT_MOUSEUP, EVENT_TOUCHEND], this, { passive: false });\n this.handleInput(x, y, bounds, 'START');\n break;\n case EVENT_MOUSEMOVE:\n case EVENT_TOUCHMOVE:\n this.handleInput(x, y, bounds, 'MOVE');\n break;\n case EVENT_MOUSEUP:\n case EVENT_TOUCHEND:\n this.handleInput(x, y, bounds, 'END');\n unlisten(document, [EVENT_MOUSEMOVE, EVENT_TOUCHMOVE, EVENT_MOUSEUP, EVENT_TOUCHEND], this, { passive: false });\n break;\n }\n }\n}\n","/**\n * @desc Resolve an SVG URL\n * This is required to work around how Safari handles gradient URLS under certain conditions\n * If a page is using a client-side routing library which makes use of the HTML tag, \n * Safari won't be able to render SVG gradients properly (as they are referenced by URLs)\n * More info on the problem: \n * https://stackoverflow.com/questions/19742805/angular-and-svg-filters/19753427#19753427\n * https://github.com/jaames/iro.js/issues/18\n * https://github.com/jaames/iro.js/issues/45\n * @param {String} url resource url (should be an id selector e.g \"#example\")\n * @returns {String} resolved url\n */\nexport function resolveUrl(url) {\n // Sniff useragent string to check if the user is running Safari\n const ua = window.navigator.userAgent;\n const isSafari = /^((?!chrome|android).)*safari/i.test(ua);\n const isIos = /iPhone|iPod|iPad/i.test(ua);\n const location = window.location;\n return (isSafari || isIos) ? `${location.protocol}//${location.host}${location.pathname}${location.search}${url}` : url;\n}\n\n/**\n * @desc create the path commands to draw an svg arc\n * @param {Number} cx center point x\n * @param {Number} cy center point y\n * @param {Number} radius arc radius\n * @param {Number} startAngle arc start angle (degrees)\n * @param {Number} endAngle arc end angle (degrees)\n * @returns {String} arc path commands\n */\nexport function createArcPath(cx, cy, radius, startAngle, endAngle) {\n const largeArcFlag = endAngle - startAngle <= 180 ? 0 : 1;\n startAngle *= Math.PI / 180;\n endAngle *= Math.PI / 180;\n const x1 = cx + radius * Math.cos(endAngle);\n const y1 = cy + radius * Math.sin(endAngle);\n const x2 = cx + radius * Math.cos(startAngle);\n const y2 = cy + radius * Math.sin(startAngle);\n return `M ${x1} ${y1} A ${radius} ${radius} 0 ${largeArcFlag} 0 ${x2} ${y2}`;\n}","import { h } from 'preact';\nimport { resolveUrl } from '../util/svg';\n\nfunction IroHandle(props) {\n \n const radius = props.r;\n const url = props.url;\n\n return (\n \n {url && (\n \n )}\n {!url && (\n \n )}\n {!url && (\n \n )}\n \n );\n}\n\nIroHandle.defaultProps = {\n x: 0,\n y: 0,\n r: 8,\n url: null,\n origin: {x: 0, y: 0}\n};\n\nexport default IroHandle;","import { h } from 'preact';\n\nimport IroComponent from 'ui/component';\nimport IroHandle from 'ui/handle';\nimport { resolveUrl, createArcPath } from '../util/svg';\n\nconst HUE_STEPS = Array.apply(null, {length: 360}).map((_, index) => index);\n\nexport default class IroWheel extends IroComponent {\n\n _transformAngle(angle, handleFix) {\n const wheelAngle = this.props.wheelAngle;\n if (this.props.wheelDirection === 'clockwise') {\n // im sure this math could be simplified...\n angle = (-360 + angle - (handleFix ? -wheelAngle : wheelAngle));\n } else {\n angle = wheelAngle - angle\n }\n // javascript's modulo operator doesn't produce positive numbers with negative input\n // https://dev.to/maurobringolf/a-neat-trick-to-compute-modulo-of-negative-numbers-111e\n return (angle % 360 + 360) % 360;\n }\n\n render(props) {\n let { width, borderWidth, handleRadius } = props;\n const hsv = props.color.hsv;\n const radius = (width / 2) - borderWidth;\n const handleAngle = this._transformAngle(hsv.h, true) * (Math.PI / 180);\n const handleDist = (hsv.s / 100) * (radius - props.padding - handleRadius - borderWidth);\n const cX = radius + borderWidth;\n const cY = radius + borderWidth;\n \n return (\n \n \n \n \n \n \n \n \n { HUE_STEPS.map(angle => (\n \n ))}\n \n \n { props.wheelLightness && (\n \n )}\n \n \n \n );\n }\n\n /**\n * @desc handles mouse input for this component\n * @param {Number} x - point x coordinate\n * @param {Number} y - point y coordinate\n * @param {DOMRect} rect - bounding client rect for the component's base element\n * @param {String} type - input type: \"START\", \"MOVE\" or \"END\"\n */\n handleInput(x, y, { left, top }, type) {\n const props = this.props;\n const radius = props.width / 2;\n const handleRange = (radius - props.padding - props.handleRadius - props.borderWidth);\n const cX = radius;\n const cY = radius;\n\n x = cX - (x - left);\n y = cY - (y - top);\n\n let handleAngle = Math.atan2(y, x);\n // Calculate the hue by converting the angle to radians\n let hue = this._transformAngle(Math.round(handleAngle * (180 / Math.PI)) + 180);\n // Find the point's distance from the center of the wheel\n // This is used to show the saturation level\n let handleDist = Math.min(Math.sqrt(x * x + y * y), handleRange);\n props.onInput(type, {\n h: hue,\n s: Math.round((100 / handleRange) * handleDist)\n });\n }\n}","/**\n * @desc Parse a css unit string - either regular int or a percentage number\n * @param {String} str input string\n * @param {String} max max number for converting percentages\n * @returns {Number} \n */\nexport function parseUnit(str, max) {\n const isPercentage = str.indexOf('%') > -1;\n const num = parseFloat(str);\n return isPercentage ? (max / 100) * num : num;\n}\n\n/**\n * @desc Parse hex str to an int\n * @param {String} str input string\n * @returns {Number} \n */\nexport function parseHexInt(str) {\n return parseInt(str, 16);\n}\n\n/**\n * @desc Convert into to 2-digit hex\n * @param {Number} int input number\n * @returns {String} \n */\nexport function intToHex(int) {\n return int.toString(16).padStart(2, '0');\n}","import { parseUnit, parseHexInt, intToHex } from './util/colorUtils';\n\n// Some regular expressions for rgb() and hsl() Colors are borrowed from tinyColor\n// https://github.com/bgrins/TinyColor\n\n// https://www.w3.org/TR/css3-values/#integers\nconst CSS_INTEGER = `[-\\\\+]?\\\\d+%?`;\n// http://www.w3.org/TR/css3-values/#number-value\nconst CSS_NUMBER = `[-\\\\+]?\\\\d*\\\\.\\\\d+%?`;\n// Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome\nconst CSS_UNIT = `(?:${ CSS_NUMBER })|(?:${ CSS_INTEGER })`;\n\n// Parse function params\n// Parens and commas are optional, and this also allows for whitespace between numbers\nconst PERMISSIVE_MATCH_3 = `[\\\\s|\\\\(]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })\\\\s*\\\\)?`;\nconst PERMISSIVE_MATCH_4 = `[\\\\s|\\\\(]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })[,|\\\\s]+(${ CSS_UNIT })\\\\s*\\\\)?`;\n\n// Regex patterns for functional colors\nconst REGEX_FUNCTIONAL_RGB = new RegExp(`rgb${ PERMISSIVE_MATCH_3 }`);\nconst REGEX_FUNCTIONAL_RGBA = new RegExp(`rgba${ PERMISSIVE_MATCH_4 }`);\nconst REGEX_FUNCTIONAL_HSL = new RegExp(`hsl${ PERMISSIVE_MATCH_3 }`);\nconst REGEX_FUNCTIONAL_HSLA = new RegExp(`hsla${ PERMISSIVE_MATCH_4 }`);\n\nconst HEX_START = `^(?:#?|0x?)`;\nconst HEX_INT_SINGLE = `([0-9a-fA-F]{1})`;\nconst HEX_INT_DOUBLE = `([0-9a-fA-F]{2})`;\nconst REGEX_HEX_3 = new RegExp(`${ HEX_START }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }$`);\nconst REGEX_HEX_4 = new RegExp(`${ HEX_START }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }${ HEX_INT_SINGLE }$`);\nconst REGEX_HEX_6 = new RegExp(`${ HEX_START }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }$`);\nconst REGEX_HEX_8 = new RegExp(`${ HEX_START }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }${ HEX_INT_DOUBLE }$`);\n\nexport default class Color {\n /**\n * @constructor Color object\n * @param {Object | String | Color} value - Color instance, object (hsv, hsl or rgb), string (hsl, rgb, hex)\n */\n constructor(value) {\n // The watch callback function for this Color will be stored here\n this._onChange = false;\n // The default Color value\n this._value = {h: 0, s: 0, v: 0, a: 1};\n if (value) this.set(value);\n }\n\n /**\n * @desc set the Color from any valid value\n * @param {Object | String | Color} value - Color instance, object (hsv, hsl or rgb), string (hsl, rgb, hex)\n */\n set(value) {\n const isString = typeof value === 'string';\n const isObject = typeof value === 'object';\n if ((isString) && (/^(?:#?|0x?)[0-9a-fA-F]{3,8}$/.test(value))) {\n this.hexString = value;\n }\n else if ((isString) && (/^rgba?/.test(value))) {\n this.rgbString = value;\n }\n else if ((isString) && (/^hsla?/.test(value))) {\n this.hslString = value;\n }\n else if ((isObject) && (value instanceof Color)) {\n this.hsv = value.hsv;\n }\n else if ((isObject) && ('r' in value) && ('g' in value) && ('b' in value)) {\n this.rgb = value;\n }\n else if ((isObject) && ('h' in value) && ('s' in value) && ('v' in value)) {\n this.hsv = value;\n }\n else if ((isObject) && ('h' in value) && ('s' in value) && ('l' in value)) {\n this.hsl = value;\n }\n else {\n throw new Error('invalid color value');\n }\n }\n\n /**\n * @desc shortcut to set a specific channel value\n * @param {String} format - hsv | hsl | rgb\n * @param {String} channel - individual channel to set, for example if model = hsl, chanel = h | s | l\n * @param {Number} value - new value for the channel\n */\n setChannel(format, channel, value) {\n this[format] = {...this[format], [channel]: value};\n }\n\n /**\n * @desc make new Color instance with the same value as this one\n * @return {Color}\n */\n clone() {\n return new Color(this);\n }\n\n /**\n * @desc convert hsv object to rgb\n * @param {Object} hsv hsv object\n * @return {Object} rgb object\n */\n static hsvToRgb(hsv) {\n const h = hsv.h / 60;\n const s = hsv.s / 100;\n const v = hsv.v / 100;\n const i = Math.floor(h);\n const f = h - i;\n const p = v * (1 - s);\n const q = v * (1 - f * s);\n const t = v * (1 - (1 - f) * s);\n const mod = i % 6;\n const r = [v, q, p, p, t, v][mod];\n const g = [t, v, v, q, p, p][mod];\n const b = [p, p, t, v, v, q][mod];\n return {\n r: r * 255, \n g: g * 255, \n b: b * 255\n };\n }\n\n /**\n * @desc convert rgb object to hsv\n * @param {Object} rgb - rgb object\n * @return {Object} hsv object\n */\n static rgbToHsv(rgb) {\n const r = rgb.r / 255;\n const g = rgb.g / 255;\n const b = rgb.b / 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n const delta = max - min;\n let hue;\n let value = max;\n let saturation = max === 0 ? 0 : delta / max;\n switch (max) {\n case min: \n hue = 0; // achromatic\n break;\n case r: \n hue = (g - b) / delta + (g < b ? 6 : 0);\n break;\n case g: \n hue = (b - r) / delta + 2;\n break;\n case b:\n hue = (r - g) / delta + 4;\n break;\n }\n return {\n h: hue * 60,\n s: saturation * 100,\n v: value * 100\n }\n }\n\n /**\n * @desc convert hsv object to hsl\n * @param {Object} hsv - hsv object\n * @return {Object} hsl object\n */\n static hsvToHsl(hsv) {\n const s = hsv.s / 100;\n const v = hsv.v / 100;\n const l = (2 - s) * v;\n const divisor = l <= 1 ? l : (2 - l);\n // Avoid division by zero when lightness is close to zero\n const saturation = divisor < 1e-9 ? 0 : (s * v) / divisor;\n return {\n h: hsv.h,\n s: saturation * 100,\n l: l * 50\n };\n }\n\n /**\n * @desc convert hsl object to hsv\n * @param {Object} hsl - hsl object\n * @return {Object} hsv object\n */\n static hslToHsv(hsl) {\n const l = hsl.l * 2;\n const s = (hsl.s * ((l <= 100) ? l : 200 - l)) / 100;\n // Avoid division by zero when l + s is near 0\n const saturation = (l + s < 1e-9) ? 0 : (2 * s) / (l + s);\n return {\n h: hsl.h,\n s: saturation * 100,\n v: (l + s) / 2\n };\n }\n\n get hsv() {\n // _value is cloned to allow changes to be made to the values before passing them back\n const value = this._value;\n return {h: value.h, s: value.s, v: value.v};\n }\n\n set hsv(newValue) {\n const oldValue = this._value;\n newValue = { ...oldValue, ...newValue };\n // If this Color is being watched for changes we need to compare the new and old values to check the difference\n // Otherwise we can just be lazy\n if (this._onChange) {\n // Compute changed values\n let changes = {};\n for (let key in oldValue) {\n changes[key] = newValue[key] != oldValue[key]\n };\n // Update the old value\n this._value = newValue;\n // If the value has changed, call hook callback\n if (changes.h || changes.s || changes.v || changes.a) this._onChange(this, changes);\n } else {\n this._value = newValue;\n }\n }\n\n get rgb() {\n const {r, g, b} = Color.hsvToRgb(this._value);\n return {\n r: Math.round(r),\n g: Math.round(g),\n b: Math.round(b),\n };\n }\n\n set rgb(value) {\n this.hsv = {...Color.rgbToHsv(value), a: (value.a === undefined) ? 1 : value.a};\n }\n\n get hsl() {\n const {h, s, l} = Color.hsvToHsl(this._value);\n return {\n h: Math.round(h),\n s: Math.round(s),\n l: Math.round(l),\n };\n }\n\n set hsl(value) {\n this.hsv = {...Color.hslToHsv(value), a: (value.a === undefined) ? 1 : value.a};\n }\n\n get rgbString() {\n const rgb = this.rgb;\n return `rgb(${rgb.r}, ${rgb.g}, ${rgb.b})`;\n }\n\n set rgbString(value) {\n let match;\n let r, g, b, a = 1;\n if (match = REGEX_FUNCTIONAL_RGB.exec(value)) {\n r = parseUnit(match[1], 255);\n g = parseUnit(match[2], 255);\n b = parseUnit(match[3], 255);\n }\n else if (match = REGEX_FUNCTIONAL_RGBA.exec(value)) {\n r = parseUnit(match[1], 255);\n g = parseUnit(match[2], 255);\n b = parseUnit(match[3], 255);\n a = parseUnit(match[4], 1);\n }\n if (match) {\n this.rgb = {r, g, b, a};\n } \n else {\n throw new Error('invalid rgb string');\n }\n }\n\n get hexString() {\n const rgb = this.rgb;\n return `#${ intToHex(rgb.r) }${ intToHex(rgb.g) }${ intToHex(rgb.b) }`;\n }\n\n set hexString(value) {\n let match;\n let r, g, b, a = 255;\n if (match = REGEX_HEX_3.exec(value)) {\n r = parseHexInt(match[1]) * 17;\n g = parseHexInt(match[2]) * 17;\n b = parseHexInt(match[3]) * 17;\n }\n else if (match = REGEX_HEX_4.exec(value)) {\n r = parseHexInt(match[1]) * 17;\n g = parseHexInt(match[2]) * 17;\n b = parseHexInt(match[3]) * 17;\n a = parseHexInt(match[4]) * 17;\n }\n else if (match = REGEX_HEX_6.exec(value)) {\n r = parseHexInt(match[1]);\n g = parseHexInt(match[2]);\n b = parseHexInt(match[3]);\n }\n else if (match = REGEX_HEX_8.exec(value)) {\n r = parseHexInt(match[1]);\n g = parseHexInt(match[2]);\n b = parseHexInt(match[3]);\n a = parseHexInt(match[4]);\n }\n if (match) {\n this.rgb = {r, g, b, a: a / 255};\n }\n else {\n throw new Error('invalid hex string');\n }\n }\n\n get hslString() {\n const hsl = this.hsl;\n return `hsl(${hsl.h}, ${hsl.s}%, ${hsl.l}%)`;\n }\n\n set hslString(value) {\n let match;\n let h, s, l, a = 1;\n if (match = REGEX_FUNCTIONAL_HSL.exec(value)) {\n h = parseUnit(match[1], 360);\n s = parseUnit(match[2], 100);\n l = parseUnit(match[3], 100);\n }\n else if (match = REGEX_FUNCTIONAL_HSLA.exec(value)) {\n h = parseUnit(match[1], 360);\n s = parseUnit(match[2], 100);\n l = parseUnit(match[3], 100);\n a = parseUnit(match[4], 1);\n }\n if (match) {\n this.hsl = {h, s, l, a};\n } \n else {\n throw new Error('invalid hsl string');\n }\n }\n}","import { h } from 'preact';\n\nimport IroComponent from 'ui/component';\nimport IroHandle from 'ui/handle';\nimport IroColor from '../color';\nimport { resolveUrl } from '../util/svg';\n\nexport default class IroSlider extends IroComponent {\n\n renderGradient(props) {\n const hsv = props.color.hsv;\n let stops = [];\n\n switch (props.sliderType) {\n case 'hue':\n stops = [\n {offset: '0', color: '#f00'},\n {offset: '16.666', color: '#ff0'},\n {offset: '33.333', color: '#0f0'},\n {offset: '50', color: '#0ff'},\n {offset: '66.666', color: '#00f'},\n {offset: '83.333', color: '#f0f'},\n {offset: '100', color: '#f00'},\n ];\n break;\n case 'saturation':\n var noSat = IroColor.hsvToHsl({h: hsv.h, s: 0, v: hsv.v});\n var fullSat = IroColor.hsvToHsl({h: hsv.h, s: 100, v: hsv.v});\n stops = [\n {offset: '0', color: `hsl(${noSat.h}, ${noSat.s}%, ${noSat.l}%)`},\n {offset: '100', color: `hsl(${fullSat.h}, ${fullSat.s}%, ${fullSat.l}%)`}\n ];\n break;\n case 'value':\n default:\n var hsl = IroColor.hsvToHsl({h: hsv.h, s: hsv.s, v: 100});\n stops = [\n {offset: '0', color: '#000'},\n {offset: '100', color: `hsl(${hsl.h}, ${hsl.s}%, ${hsl.l}%)`}\n ];\n break;\n }\n\n return (\n \n {stops.map(stop => (\n \n ))}\n \n )\n }\n\n render(props) {\n let { width, sliderHeight, borderWidth, handleRadius } = props;\n sliderHeight = sliderHeight ? sliderHeight : props.padding * 2 + handleRadius * 2 + borderWidth * 2;\n this.width = width;\n this.height = sliderHeight;\n const cornerRadius = sliderHeight / 2;\n const range = width - cornerRadius * 2\n const hsv = props.color.hsv;\n \n let sliderValue;\n switch (props.sliderType) {\n case 'hue':\n sliderValue = hsv.h /= 3.6;\n break;\n case 'saturation':\n sliderValue = hsv.s;\n break;\n case 'value':\n default:\n sliderValue = hsv.v;\n break;\n }\n\n return (\n \n \n { this.renderGradient(props) }\n \n \n \n \n );\n }\n\n getValueFromPoint(x, y, { left }) {\n const handleRange = this.width - this.height;\n const cornerRadius = this.height / 2;\n x = x - (left + cornerRadius);\n let dist = Math.max(Math.min(x, handleRange), 0);\n return Math.round((100 / handleRange) * dist);\n }\n\n /**\n * @desc handles mouse input for this component\n * @param {Number} x - point x coordinate\n * @param {Number} y - point y coordinate\n * @param {DOMRect} rect - bounding client rect for the component's base element\n * @param {String} type - input type: \"START\", \"MOVE\" or \"END\"\n */\n handleInput(x, y, bounds, type) {\n let value = this.getValueFromPoint(x, y, bounds);\n let channel;\n switch (this.props.sliderType) {\n case 'hue':\n channel = 'h';\n value *= 3.6;\n break;\n case 'saturation':\n channel = 's';\n break;\n case 'value':\n default:\n channel = 'v';\n break;\n }\n this.props.onInput(type, {\n [channel]: value\n });\n }\n}","import { h, Component } from 'preact';\n\nimport IroWheel from 'ui/wheel';\nimport IroSlider from 'ui/slider';\nimport IroColor from './color';\nimport { createWidget } from 'util/createWidget';\n\nclass ColorPicker extends Component {\n constructor(props) {\n super(props);\n this.emitHook('init:before');\n this._events = {};\n this._deferredEvents = {};\n this._colorUpdateActive = false;\n this._colorUpdateSrc = null;\n this.color = new IroColor(props.color);\n this.deferredEmit('color:init', this.color, { h: false, s: false, v: false, a: false });\n // Whenever the color changes, update the color wheel\n this.color._onChange = this.updateColor.bind(this);\n this.state = {\n ...props,\n color: this.color,\n };\n this.emitHook('init:state');\n\n if (props.layout) {\n this.layout = props.layout;\n } else {\n this.layout = [\n {component: IroWheel, options: {}},\n {component: IroSlider, options: {}},\n ];\n }\n this.emitHook('init:after');\n }\n\n // Public ColorPicker events API\n\n /**\n * @desc Set a callback function for an event\n * @param {String | Array} eventList event(s) to listen to\n * @param {Function} callback\n */\n on(eventList, callback) {\n const events = this._events;\n // eventList can be an eventType string or an array of eventType strings\n (!Array.isArray(eventList) ? [eventList] : eventList).forEach(eventType => {\n // Emit plugin hook\n this.emitHook('event:on', eventType, callback);\n // Add event callback\n (events[eventType] || (events[eventType] = [])).push(callback);\n // Call deferred events\n // These are events that can be stored until a listener for them is added\n if (this._deferredEvents[eventType]) {\n // Deffered events store an array of arguments from when the event was called\n this._deferredEvents[eventType].forEach(args => {\n callback.apply(null, args); \n });\n // Clear deferred events\n this._deferredEvents[eventType] = [];\n }\n });\n }\n\n /**\n * @desc Remove a callback function for an event added with on()\n * @param {String | Array} eventList The name of the event\n * @param {Function} callback\n */\n off(eventList, callback) {\n (!Array.isArray(eventList) ? [eventList] : eventList).forEach(eventType => {\n const callbackList = this._events[eventType];\n this.emitHook('event:off', eventType, callback);\n if (callbackList) callbackList.splice(callbackList.indexOf(callback), 1);\n });\n }\n\n /**\n * @desc Emit an event\n * @param {String} eventType The name of the event to emit\n * @param {Array} args array of args to pass to callbacks\n */\n emit(eventType, ...args) {\n // Events are plugin hooks too\n this.emitHook(eventType, ...args);\n const callbackList = this._events[eventType] || [];\n for (let i = 0; i < callbackList.length; i++) {\n callbackList[i].apply(null, args); \n }\n }\n\n /**\n * @desc Emit an event now, or save it for when the relevent event listener is added\n * @param {String} eventType The name of the event to emit\n * @param {Array} args array of args to pass to callbacks\n */\n deferredEmit(eventType, ...args) {\n const deferredEvents = this._deferredEvents;\n this.emit(eventType, ...args);\n (deferredEvents[eventType] || (deferredEvents[eventType] = [])).push(args);\n }\n\n // Public utility methods\n\n /**\n * @desc Resize the color picker\n * @param {Number} width\n */\n resize(width) {\n this.setState({width});\n }\n\n /**\n * @desc Reset the color picker to the initial color provided in the color picker options\n */\n reset() {\n this.color.set(this.props.color);\n }\n\n // Plugin hooks API\n\n /**\n * @desc Set a callback function for a hook\n * @param {String} hookType The name of the hook to listen to\n * @param {Function} callback\n */\n static addHook(hookType, callback) {\n const pluginHooks = ColorPicker.pluginHooks;\n (pluginHooks[hookType] || (pluginHooks[hookType] = [])).push(callback);\n }\n\n /**\n * @desc Emit a callback hook\n * @access private\n * @param {String} hookType The type of hook event to emit\n */\n emitHook(hookType, ...args) {\n const callbackList = ColorPicker.pluginHooks[hookType] || [];\n for (let i = 0; i < callbackList.length; i++) {\n callbackList[i].apply(this, args); \n }\n }\n\n // Internal methods\n\n /**\n * @desc Called by the createWidget wrapper when the element is mounted into the page\n * @access private\n * @param {Element} container the container element for this ColorPicker instance\n */\n onMount(container) {\n this.el = container;\n this.deferredEmit('mount', this);\n }\n\n /**\n * @desc React to a color update\n * @access private\n * @param {IroColor} color current color\n * @param {Object} changes shows which h,s,v color channels changed\n */\n updateColor(color, changes) {\n this.emitHook('color:beforeUpdate', color, changes);\n this.setState({ color: color });\n this.emitHook('color:afterUpdate', color, changes);\n // Prevent infinite loops if the color is set inside a color:change or input:change callback\n if (!this._colorUpdateActive) {\n // While _colorUpdateActive == true, branch cannot be entered\n this._colorUpdateActive = true;\n // If the color change originates from user input, fire input:change\n if (this._colorUpdateSrc == 'input') { // colorUpdateSrc is cleared in handeInput()\n this.emit('input:change', color, changes);\n } \n // Always fire color:change event\n this.emit('color:change', color, changes);\n this._colorUpdateActive = false;\n }\n }\n\n /**\n * @desc Handle input from a UI control element\n * @access private\n * @param {String} type \"START\" | \"MOVE\" | \"END\"\n * @param {Object} hsv new hsv values for the color\n */\n handleInput(type, hsv) {\n // Fire input start and move events before color update\n if (type === 'START') this.emit('input:start', this.color);\n if (type === 'MOVE') this.emit('input:move', this.color);\n // Set the color update source\n this._colorUpdateSrc = 'input';\n // Setting the color HSV here will automatically update the UI\n // Since we bound the color's _onChange callback\n this.color.hsv = hsv;\n // Fire input end event after color update\n if (type === 'END') this.emit('input:end', this.color);\n // Reset color update source so it doesn't interfere with future color updates\n // Super important to do this here and not in updateColor()\n this._colorUpdateSrc = null;\n }\n\n render(props, state) {\n return (\n
\n {this.layout.map(({component: UiComponent, options: options}) => (\n this.handleInput(type, hsv) }\n parent={ this }\n />\n ))}\n
\n )\n }\n}\n\nColorPicker.pluginHooks = {};\n\nColorPicker.defaultProps = {\n width: 300,\n height: 300,\n handleRadius: 8,\n handleSvg: null,\n handleOrigin: {x: 0, y: 0},\n color: '#fff',\n borderColor: '#fff',\n borderWidth: 0,\n display: 'block',\n wheelLightness: true,\n wheelAngle: 0,\n wheelDirection: 'anticlockwise',\n sliderHeight: null,\n sliderMargin: 12,\n padding: 6,\n layout: null,\n}\n\nexport default createWidget(ColorPicker);\n","import { h, render } from 'preact';\nimport { onDocumentReady } from './dom';\n\n/**\n * @desc Turn a component into a widget\n * This returns a factory function that can be used to create an instance of the widget component\n * The first function param is a DOM element or CSS selector for the element to mount to,\n * The second param is for config options which are passed to the component as props\n * This factory function can also delay mounting the element into the DOM until the page is ready\n * @param {Component} widgetComonpent ui component to turn into a widget\n * @returns {Function} widget factory\n */\nexport function createWidget(widgetComponent) {\n\n const widgetFactory = function (parent, props) {\n let widget = null; // will become an instance of the widget component class\n let widgetRoot = document.createElement('div');\n\n // Render widget into a temp DOM node\n render(\n h(widgetComponent, {\n ref: ref => widget = ref,\n ...props,\n }),\n widgetRoot\n );\n // Mount it into the DOM when the page document is ready\n onDocumentReady(() => {\n const container = parent instanceof Element ? parent : document.querySelector(parent);\n container.appendChild(widget.base);\n widget.onMount(container);\n });\n\n return widget;\n }\n\n // Allow the widget factory to inherit component prototype + static class methods\n // This makes it easier for plugin authors to extend the base widget component\n widgetFactory.prototype = widgetComponent.prototype;\n Object.assign(widgetFactory, widgetComponent);\n // Add reference to base component too\n widgetFactory.__component = widgetComponent; \n\n return widgetFactory;\n\n}","/**\n * iro.js plugins API\n * This provides the iro.use method, which can be used to register plugins which extend the iro.js core\n */\nexport function usePlugins(core) {\n const installedPlugins = [];\n \n /**\n * @desc Register iro.js plugin\n * @param {Function} plugin = plugin constructor\n * @param {Object} pluginOptions = plugin options passed to constructor\n */\n core.use = function(plugin, pluginOptions = {}) {\n // Check that the plugin hasn't already been registered\n if (!(installedPlugins.indexOf(plugin) > -1)) {\n // Init plugin\n // TODO: consider collection of plugin utils, which are passed as a thrid param\n plugin(core, pluginOptions);\n // Register plugin\n installedPlugins.push(plugin);\n }\n }\n\n core.installedPlugins = installedPlugins;\n\n return core;\n}","import { h } from 'preact';\n\nimport ColorPicker from './colorPicker';\nimport Color from './color';\n\nimport Component from 'ui/component';\nimport Handle from 'ui/handle';\nimport Slider from 'ui/slider';\nimport Wheel from 'ui/wheel';\nimport { usePlugins } from 'util/usePlugins';\nimport { resolveUrl, createArcPath } from 'util/svg';\nimport { parseUnit, parseHexInt, intToHex } from 'util/colorUtils';\n\nexport default usePlugins({\n Color,\n ColorPicker,\n ui: {\n h,\n Component,\n Handle,\n Slider,\n Wheel,\n },\n util: {\n resolveUrl, \n createArcPath,\n parseUnit,\n parseHexInt,\n intToHex\n },\n version: VERSION,\n});\n"],"names":["VNode","options","stack","EMPTY_CHILDREN","h","nodeName","attributes","lastSimple","child","simple","i","children","arguments","length","push","pop","undefined","String","p","key","extend","obj","props","applyRef","ref","value","current","defer","Promise","resolve","then","bind","setTimeout","IS_NON_DIMENSIONAL","items","enqueueRender","component","_dirty","rerender","renderComponent","isNamedNode","node","normalizedNodeName","toLowerCase","getNodeProps","vnode","defaultProps","removeNode","parentNode","removeChild","setAccessor","name","old","isSvg","style","cssText","test","innerHTML","__html","useCapture","replace","substring","addEventListener","eventProxy","removeEventListener","_listeners","e","removeAttribute","ns","removeAttributeNS","setAttributeNS","setAttribute","className","this","type","mounts","diffLevel","isSvgMode","hydrating","flushMounts","c","shift","componentDidMount","diff","dom","context","mountAll","parent","componentRoot","ownerSVGElement","ret","idiff","appendChild","out","prevSvgMode","splitText","_component","nodeValue","document","createTextNode","replaceChild","recollectNodeTree","vnodeName","originalComponent","oldDom","isDirectOwner","_componentConstructor","isOwner","_parentComponent","constructor","setComponentProps","base","unmountComponent","createComponent","nextBase","buildComponentFromVNode","createElementNS","createElement","firstChild","fc","vchildren","a","nextSibling","isHydrating","j","f","vchild","originalChildren","childNodes","keyed","keyedLen","min","len","childrenLen","vlen","_child","__key","trim","insertBefore","innerDiffNode","dangerouslySetInnerHTML","attrs","diffAttributes","unmountOnly","removeChildren","lastChild","next","previousSibling","recyclerComponents","Ctor","inst","prototype","render","Component","call","doRender","splice","state","renderMode","_disable","__ref","getDerivedStateFromProps","componentWillMount","componentWillReceiveProps","prevContext","prevProps","syncComponentUpdates","isChild","rendered","cbase","previousProps","previousState","prevState","previousContext","isUpdate","initialBase","initialChildComponent","skip","snapshot","shouldComponentUpdate","componentWillUpdate","getChildContext","getSnapshotBeforeUpdate","toUnmount","childComponent","childProps","baseParent","componentRef","t","componentDidUpdate","_renderCallbacks","componentWillUnmount","inner","listen","el","eventList","callback","params","unlisten","setState","forceUpdate","const","EVENT_MOUSEDOWN","EVENT_MOUSEMOVE","EVENT_MOUSEUP","EVENT_TOUCHSTART","EVENT_TOUCHMOVE","EVENT_TOUCHEND","IroComponent","super","uid","Math","random","toString","passive","handleEvent","preventDefault","point","touches","changedTouches","x","clientX","y","clientY","bounds","getBoundingClientRect","handleInput","resolveUrl","url","ua","window","navigator","userAgent","isSafari","isIos","location","createArcPath","cx","cy","radius","startAngle","endAngle","largeArcFlag","PI","cos","sin","IroHandle","r","class","overflow","xlinkHref","origin","fill","stroke-width","stroke","HUE_STEPS","Array","apply","map","_","index","IroWheel","_transformAngle","angle","handleFix","wheelAngle","wheelDirection","hsv","color","width","borderWidth","handleAngle","handleDist","s","padding","handleRadius","cX","cY","height","display","id","offset","stop-color","stop-opacity","d","wheelLightness","opacity","v","borderColor","handleSvg","handleOrigin","handleRange","left","top","let","atan2","hue","round","sqrt","onInput","parseUnit","str","max","isPercentage","indexOf","num","parseFloat","parseHexInt","parseInt","intToHex","int","padStart","CSS_UNIT","PERMISSIVE_MATCH_3","PERMISSIVE_MATCH_4","REGEX_FUNCTIONAL_RGB","RegExp","REGEX_FUNCTIONAL_RGBA","REGEX_FUNCTIONAL_HSL","REGEX_FUNCTIONAL_HSLA","HEX_START","HEX_INT_SINGLE","HEX_INT_DOUBLE","REGEX_HEX_3","REGEX_HEX_4","REGEX_HEX_6","REGEX_HEX_8","Color","_onChange","_value","set","isString","isObject","hexString","rgbString","hslString","rgb","Error","hsl","setChannel","format","channel","Object","clone","hsvToRgb","floor","q","mod","g","b","rgbToHsv","delta","saturation","hsvToHsl","l","divisor","hslToHsv","prototypeAccessors","newValue","oldValue","changes","match","exec","IroSlider","renderGradient","stops","sliderType","noSat","IroColor","fullSat","stop","sliderHeight","sliderValue","cornerRadius","range","marginTop","sliderMargin","rx","ry","getValueFromPoint","dist","ColorPicker","emitHook","_events","_deferredEvents","_colorUpdateActive","_colorUpdateSrc","deferredEmit","updateColor","layout","on","events","isArray","forEach","eventType","args","off","callbackList","emit","deferredEvents","resize","reset","addHook","hookType","pluginHooks","onMount","container","UiComponent","widgetComponent","widgetFactory","core","installedPlugins","merge","widget","widgetRoot","Element","querySelector","readyState","assign","__component","ui","Handle","Slider","Wheel","util","version","use","plugin","pluginOptions"],"mappings":";;;;;;+KAAA,IAAIA,EAAQ,aAERC,EAAU,GAEVC,EAAQ,GAERC,EAAiB,GAErB,SAASC,EAAEC,EAAUC,OAEhBC,EACAC,EACAC,EACAC,cAJAC,EAAWR,EAKf,IAAKO,EAAIE,UAAUC,OAAc,EAANH,KAC1BR,EAAMY,KAAKF,EAAUF,IAMtB,IAJIJ,GAAqC,MAAvBA,EAAWK,WACvBT,EAAMW,QAAQX,EAAMY,KAAKR,EAAWK,iBAClCL,EAAWK,UAEZT,EAAMW,QACZ,IAAKL,EAAQN,EAAMa,aAAwBC,IAAdR,EAAMO,IAClC,IAAKL,EAAIF,EAAMK,OAAQH,KACtBR,EAAMY,KAAKN,EAAME,QAGG,kBAAVF,IAAqBA,EAAQ,OAEpCC,EAA6B,mBAAbJ,KACN,MAATG,EAAeA,EAAQ,GAA6B,iBAAVA,EAAoBA,EAAQS,OAAOT,GAAiC,iBAAVA,IAAoBC,GAAS,IAGlIA,GAAUF,EACbI,EAASA,EAASE,OAAS,IAAML,EACvBG,IAAaR,EACvBQ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GAAiBlE,kBACjB9T,aAAKA,UAAOqY,EAASrY,IACrBF,IVyqBC6D,EAAKyU,EAAO/W,EAAO,IAAI,EUvqB1BiX,GVuqByC,GCjqBf1N,aSF1BK,IAAM6M,EAAY/T,aAAkBwU,QAAUxU,EAASW,SAAS8T,cAAczU,GAC9E+T,EAAU1T,YAAYiU,EAAO9S,MAC7B8S,EAAOR,QAAQC,ITCS,YAAxBpT,SAAS+T,WACX7N,IAEAH,EAAO/F,SAAU,CAAC,oBAAqBkG,GSDhCyN,IAKKtQ,WA1BaiQ,GDwOD3B,IC9MgBtO,UAC1C+L,OAAO4E,OAAOT,GAAeD,IAE7BC,GAAcU,YAAcX,GAErBC,WCtCDE,GAAmB,IADAD,GCSD,OACxBnF,eACAsD,GACAuC,GAAI,GACFha,YACAqJ,SACA4Q,SACAC,SACAC,GAEFC,KAAM,YACJrM,gBACAS,YACAgE,cACAO,WACAE,GAEFoH,QAAS,UDlBJC,IAAM,SAASC,EAAQC,kBAAgB,KAEA,EAApCjB,GAAiB3G,QAAQ2H,KAG7BA,EAAOjB,GAAMkB,GAEbjB,GAAiB7Y,KAAK6Z,KAI1BjB,GAAKC,iBAAmBA,GAEjBD"} \ No newline at end of file diff --git a/docs/.vuepress/theme/ColorPicker.vue b/docs/.vuepress/theme/ColorPicker.vue index 300171d..01e9be9 100644 --- a/docs/.vuepress/theme/ColorPicker.vue +++ b/docs/.vuepress/theme/ColorPicker.vue @@ -20,6 +20,8 @@ export default { markerRadius: 8, borderWidth: 2, borderColor: "#fff", + wheelAngle: 120, + wheelDirection: "clockwise", width: 260, color: "#906bff", css: { diff --git a/docs/.vuepress/theme/js/iro.es.js b/docs/.vuepress/theme/js/iro.es.js index 977e41e..3ff17ae 100644 --- a/docs/.vuepress/theme/js/iro.es.js +++ b/docs/.vuepress/theme/js/iro.es.js @@ -1,5 +1,5 @@ /*! - * iro.js v4.3.3 + * iro.js v4.4.0 * 2016-2019 James Daniel * Licensed under MPL 2.0 * github.com/jaames/iro.js @@ -776,7 +776,7 @@ var IroComponent = /*@__PURE__*/(function (Component$$1) { }; // More info on handleEvent: - // http://download-cdn.miitomo.com/native/20180125111639/manifests/v2_20180405_3_android/manifest.json + // https://medium.com/@WebReflection/dom-handleevent-a-cross-platform-standard-since-year-2000-5bf17287fd38 // TL;DR this lets us have a single point of entry for multiple events, and we can avoid callback/binding hell IroComponent.prototype.handleEvent = function handleEvent (e) { e.preventDefault(); @@ -880,6 +880,8 @@ IroHandle.defaultProps = { origin: {x: 0, y: 0} }; +var HUE_STEPS = Array.apply(null, {length: 360}).map(function (_, index) { return index; }); + var IroWheel = /*@__PURE__*/(function (IroComponent$$1) { function IroWheel () { IroComponent$$1.apply(this, arguments); @@ -889,13 +891,28 @@ var IroWheel = /*@__PURE__*/(function (IroComponent$$1) { IroWheel.prototype = Object.create( IroComponent$$1 && IroComponent$$1.prototype ); IroWheel.prototype.constructor = IroWheel; + IroWheel.prototype._transformAngle = function _transformAngle (angle, handleFix) { + var wheelAngle = this.props.wheelAngle; + if (this.props.wheelDirection === 'clockwise') { + // im sure this math could be simplified... + angle = (-360 + angle - (handleFix ? -wheelAngle : wheelAngle)); + } else { + angle = wheelAngle - angle; + } + // javascript's modulo operator doesn't produce positive numbers with negative input + // https://dev.to/maurobringolf/a-neat-trick-to-compute-modulo-of-negative-numbers-111e + return (angle % 360 + 360) % 360; + }; + IroWheel.prototype.render = function render$$1 (props) { + var this$1 = this; + var width = props.width; var borderWidth = props.borderWidth; var handleRadius = props.handleRadius; var hsv = props.color.hsv; var radius = (width / 2) - borderWidth; - var handleAngle = (360 - hsv.h) * (Math.PI / 180); + var handleAngle = this._transformAngle(hsv.h, true) * (Math.PI / 180); var handleDist = (hsv.s / 100) * (radius - props.padding - handleRadius - borderWidth); var cX = radius + borderWidth; var cY = radius + borderWidth; @@ -913,9 +930,9 @@ var IroWheel = /*@__PURE__*/(function (IroComponent$$1) { ) ), h( 'g', { class: "iro__wheel__hue", 'stroke-width': radius, fill: "none" }, - Array.apply(null, { length: 360 }).map(function (_, hue) { return ( + HUE_STEPS.map(function (angle) { return ( h( 'path', { - key: hue, d: createArcPath(cX, cY, radius / 2, hue, hue + 1.5), stroke: ("hsl(" + (360 - hue) + ", 100%, 50%)") }) + key: angle, d: createArcPath(cX, cY, radius / 2, angle, angle + 1.5), stroke: ("hsl(" + (this$1._transformAngle(angle)) + ", 100%, 50%)") }) ); }) ), h( 'circle', { @@ -954,7 +971,7 @@ var IroWheel = /*@__PURE__*/(function (IroComponent$$1) { var handleAngle = Math.atan2(y, x); // Calculate the hue by converting the angle to radians - var hue = 360 - (Math.round(handleAngle * (180 / Math.PI)) + 180); + var hue = this._transformAngle(Math.round(handleAngle * (180 / Math.PI)) + 180); // Find the point's distance from the center of the wheel // This is used to show the saturation level var handleDist = Math.min(Math.sqrt(x * x + y * y), handleRange); @@ -1763,6 +1780,8 @@ ColorPicker.defaultProps = { borderWidth: 0, display: 'block', wheelLightness: true, + wheelAngle: 0, + wheelDirection: 'anticlockwise', sliderHeight: null, sliderMargin: 12, padding: 6, @@ -1818,7 +1837,7 @@ var iro = usePlugins({ parseHexInt: parseHexInt, intToHex: intToHex }, - version: "4.3.3", + version: "4.4.0", }); export default iro; diff --git a/docs/colorPicker_api.md b/docs/colorPicker_api.md index e78a7ad..f657ae9 100644 --- a/docs/colorPicker_api.md +++ b/docs/colorPicker_api.md @@ -67,6 +67,18 @@ If set to `false`, the color wheel will not fade to black when the lightness dec **Default value**: `true` +### `wheelAngle` + +Starting angle of the color wheel's hue gradient, measured in degrees. + +**Default value**: `0` + +### `wheelDirection` + +Direction of the color wheel's hue gradient, either `"clockwise"` or `"anticlockwise"`. + +**Default value**: `"anticlockwise"` + ### `sliderHeight` Slider height, measued in pixels. diff --git a/docs/guide.md b/docs/guide.md index 54aca6c..dcff39d 100644 --- a/docs/guide.md +++ b/docs/guide.md @@ -90,6 +90,8 @@ var colorPicker = new iro.ColorPicker("#color-picker-container", { | `handleSvg` | Custom handle SVG, used for [Custom Handles](#custom-handles) | `null` | | `handleOrigin` | Custom handle origin point, used for [Custom Handles](#custom-handles). | `{x:0,y:0}` | | `wheelLightness` | If set to `false`, the color wheel will not fade to black when the lightness decreases. | `true` | +| `wheelAngle` | Starting angle of the color wheel's hue gradient, measured in degrees. | `0` | +| `wheelDirection` | Direction of the color wheel's hue gradient, either `"clockwise"` or `"anticlockwise"` | `"anticlockwise"` | | `sliderHeight` | Slider control height. By default this will be calculated automatically | `undefined` | | `sliderMargin` | Distance between the wheel and the slider controls. | `12` | | `display` | CSS display value for the color picker root element. | `"block"` | diff --git a/index.html b/index.html index 4e3106d..322abfd 100644 --- a/index.html +++ b/index.html @@ -17,6 +17,8 @@ borderWidth: 2, padding: 8, wheelLightness: true, + wheelAngle: 270, + wheelDirection: 'anticlockwise', layout: [ { component: iro.ui.Wheel, diff --git a/package-lock.json b/package-lock.json index 4b0acec..0b76e21 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@jaames/iro", - "version": "4.0.1", + "version": "4.4.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d3ddd8d..3e059f2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@jaames/iro", - "version": "4.3.3", + "version": "4.4.0", "description": "An HSV color picker widget for JavaScript, with a modern SVG-based user interface", "module": "dist/iro.es.js", "main": "dist/iro.js", diff --git a/src/colorPicker.js b/src/colorPicker.js index cc8a294..e710921 100644 --- a/src/colorPicker.js +++ b/src/colorPicker.js @@ -234,6 +234,8 @@ ColorPicker.defaultProps = { borderWidth: 0, display: 'block', wheelLightness: true, + wheelAngle: 0, + wheelDirection: 'anticlockwise', sliderHeight: null, sliderMargin: 12, padding: 6, diff --git a/src/ui/wheel.jsx b/src/ui/wheel.jsx index f93c341..99fbb3c 100644 --- a/src/ui/wheel.jsx +++ b/src/ui/wheel.jsx @@ -4,14 +4,28 @@ import IroComponent from 'ui/component'; import IroHandle from 'ui/handle'; import { resolveUrl, createArcPath } from '../util/svg'; +const HUE_STEPS = Array.apply(null, {length: 360}).map((_, index) => index); export default class IroWheel extends IroComponent { + _transformAngle(angle, handleFix) { + const wheelAngle = this.props.wheelAngle; + if (this.props.wheelDirection === 'clockwise') { + // im sure this math could be simplified... + angle = (-360 + angle - (handleFix ? -wheelAngle : wheelAngle)); + } else { + angle = wheelAngle - angle + } + // javascript's modulo operator doesn't produce positive numbers with negative input + // https://dev.to/maurobringolf/a-neat-trick-to-compute-modulo-of-negative-numbers-111e + return (angle % 360 + 360) % 360; + } + render(props) { let { width, borderWidth, handleRadius } = props; const hsv = props.color.hsv; const radius = (width / 2) - borderWidth; - const handleAngle = (360 - hsv.h) * (Math.PI / 180); + const handleAngle = this._transformAngle(hsv.h, true) * (Math.PI / 180); const handleDist = (hsv.s / 100) * (radius - props.padding - handleRadius - borderWidth); const cX = radius + borderWidth; const cY = radius + borderWidth; @@ -33,11 +47,11 @@ export default class IroWheel extends IroComponent { - {Array.apply(null, { length: 360 }).map((_, hue) => ( + { HUE_STEPS.map(angle => ( ))} @@ -97,7 +111,7 @@ export default class IroWheel extends IroComponent { let handleAngle = Math.atan2(y, x); // Calculate the hue by converting the angle to radians - let hue = 360 - (Math.round(handleAngle * (180 / Math.PI)) + 180); + let hue = this._transformAngle(Math.round(handleAngle * (180 / Math.PI)) + 180); // Find the point's distance from the center of the wheel // This is used to show the saturation level let handleDist = Math.min(Math.sqrt(x * x + y * y), handleRange);