\n \n ${useAsButton ? '' : '
'}\n\n
\n
\n `);\n\n const int = root.interaction;\n\n // Select option which is not hidden\n int.options.find(o => !o.hidden && !o.classList.add('active'));\n\n // Create method to find currenlty active option\n int.type = () => int.options.find(e => e.classList.contains('active'));\n return root;\n}\n\n// Static methods\nPickr.utils = {\n once: _.once,\n on: _.on,\n off: _.off,\n eventPath: _.eventPath,\n createElementFromString: _.createElementFromString,\n adjustableInputNumbers: _.adjustableInputNumbers,\n removeAttribute: _.removeAttribute,\n createFromTemplate: _.createFromTemplate\n};\n\n// Create instance via method\nPickr.create = (options) => new Pickr(options);\n\n// Export\nPickr.version = '0.4.11';\nexport default Pickr;\n"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap","webpack:///./src/js/lib/utils.js","webpack:///./src/js/lib/color.js","webpack:///./src/js/lib/hsvacolor.js","webpack:///./src/js/helper/moveable.js","webpack:///./src/js/helper/selectable.js","webpack:///./src/js/pickr.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","once","element","event","fn","options","on","helper","apply","this","arguments","removeEventListener","eventListener","off","method","elements","events","length","undefined","HTMLCollection","NodeList","Array","from","isArray","forEach","el","ev","_objectSpread","capture","slice","createElementFromString","html","div","document","createElement","innerHTML","trim","firstElementChild","removeAttribute","getAttribute","createFromTemplate","str","resolve","base","con","children","subtree","_i","_children","child","arr","push","eventPath","evt","path","composedPath","target","parentElement","adjustableInputNumbers","negative","isNumChar","handleScroll","e","val","selectionStart","numStart","num","isNaN","isFinite","mul","deltaY","inc","ctrlKey","newNum","Number","newStr","substr","substring","curPos","String","focus","setSelectionRange","preventDefault","dispatchEvent","Event","passive","padStart","string","maxLength","fillString","repeat","min","Math","max","floor","round","hsvToRgb","h","v","f","q","mod","hsvToHex","map","toString","hsvToCmyk","k","rgb","g","b","hsvToHsl","rgbToHsv","minVal","maxVal","delta","dr","dg","db","cmykToHsv","y","_toConsumableArray","hslToHsv","hexToHsv","hex","match","parseInt","parseToHSV","ctx","getContext","fillStyle","regex","cmyk","rgba","hsla","hsva","numarize","array","test","type","exec","_numarize2","_slicedToArray","values","concat","_numarize4","_numarize4$","a","splitAt","alpha","_splitAt$map2","_splitAt2","_numarize6","_numarize6$","_numarize8","_numarize8$","HSVaColor","ceil","that","toHSVA","rhsva","toFixed","toHSLA","Color","rhsla","toRGBA","rrgba","toCMYK","rcmyk","toHEXA","toUpperCase","join","clone","toHEX","Moveable","opt","assign","lockX","lockY","onchange","_tapstart","_","_tapstop","_tapmove","cache","wrapper","getBoundingClientRect","x","touch","touches","clientX","clientY","left","width","top","height","style","offsetWidth","trigger","update","wrapperRect","destroy","Selectable","className","onTap","classList","selectable_toConsumableArray","Pickr","_this","_classCallCheck","pickr_defineProperty","swatchselect","change","save","init","inline","_this$_root","_root","app","button","_window","innerWidth","innerHeight","bb","ab","bottom","pos","middle","right","wantedLeft","position","useAsButton","disabled","comparison","components","interaction","strings","swatches","default","defaultRepresentation","adjustableNumbers","showAlways","closeWithKey","_opt","preview","opacity","hue","palette","_preBuild","_buildComponents","_bindEvents","_finalBuild","color","addSwatch","requestAnimationFrame","cb","offsetParent","body","setColor","_rePositioningPicker","_representation","setColorRepresentation","show","_initializingActive","_emit","hidden","int","split","reduce","pv","cv","ci","querySelector","shadowRoot","keys","input","clear","find","add","contains","appendChild","removeChild","lastChild","insertBefore","nextSibling","parentNode","replaceChild","disable","transition","lastColor","hide","inst","comp","picker","_color","offsetHeight","cssRGBaString","background","currentColor","_recalc","_updateOutput","remove","slider","backgroundColor","selectable","updateTimeout","_this2","eventBindings","_clearColor","setHSVA","pickr_toConsumableArray","_lastColor","applyColor","result","stopImmediatePropagation","ck","isOpen","code","some","clearTimeout","setTimeout","_eventBindings","_this3","_len","args","_key","_eventListener","callBacks","index","indexOf","splice","_this4","_swatchColors","hsvaColorObject","swatchColor","silent","_this$_root2","_this5","pickr","recalc","_this$components","hueY","opacityY","pickerWrapper","pickerX","pickerY","_Color$parseToHSV2","utype","startsWith","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","iterator","next","done","err","return","click","utils","version"],"mappings":";CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,OAAA,GAAAH,GACA,iBAAAC,QACAA,QAAA,MAAAD,IAEAD,EAAA,MAAAC,IARA,CASCK,OAAA,WACD,mBCTA,IAAAC,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAP,QAGA,IAAAC,EAAAI,EAAAE,GAAA,CACAC,EAAAD,EACAE,GAAA,EACAT,QAAA,IAUA,OANAU,EAAAH,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAQ,GAAA,EAGAR,EAAAD,QA0DA,OArDAM,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,EAAA,CAA0CK,YAAA,EAAAC,IAAAL,KAK1CV,EAAAgB,EAAA,SAAAtB,GACA,oBAAAuB,eAAAC,aACAN,OAAAC,eAAAnB,EAAAuB,OAAAC,YAAA,CAAwDC,MAAA,WAExDP,OAAAC,eAAAnB,EAAA,cAAiDyB,OAAA,KAQjDnB,EAAAoB,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,EAAAnB,EAAAmB,IACA,EAAAE,EAAA,OAAAF,EACA,KAAAE,GAAA,iBAAAF,QAAAG,WAAA,OAAAH,EACA,IAAAI,EAAAX,OAAAY,OAAA,MAGA,GAFAxB,EAAAgB,EAAAO,GACAX,OAAA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B9N,KAAK+M,MAAME,OAAOd,UAAUgG,OAAO,YAC5BnS,0CAiEfqM,EAAMyJ,MAAQ,CACVtW,KAAMmL,EACN9K,GAAI8K,EACJvK,IAAKuK,EACLhI,UAAWgI,EACXtJ,wBAAyBsJ,EACzB1H,uBAAwB0H,EACxB9I,gBAAiB8I,EACjB5I,mBAAoB4I,GAIxB0B,EAAMvN,OAAS,SAACc,GAAD,OAAa,IAAIyM,EAAMzM,IAGtCyM,EAAM0J,QAAU,QACD1J","file":"pickr.es5.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Pickr\"] = factory();\n\telse\n\t\troot[\"Pickr\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n","/**\n * Add an eventlistener which will be fired only once.\n *\n * @param element Target element\n * @param event Event name\n * @param fn Callback\n * @param options Optional options\n * @return Array passed arguments\n */\nexport const once = (element, event, fn, options) => on(element, event, function helper() {\n fn.apply(this, arguments);\n this.removeEventListener(event, helper);\n}, options);\n\n/**\n * Add event(s) to element(s).\n * @param elements DOM-Elements\n * @param events Event names\n * @param fn Callback\n * @param options Optional options\n * @return Array passed arguments\n */\nexport const on = eventListener.bind(null, 'addEventListener');\n\n/**\n * Remove event(s) from element(s).\n * @param elements DOM-Elements\n * @param events Event names\n * @param fn Callback\n * @param options Optional options\n * @return Array passed arguments\n */\nexport const off = eventListener.bind(null, 'removeEventListener');\n\nfunction eventListener(method, elements, events, fn, options = {}) {\n\n // Normalize array\n if (elements instanceof HTMLCollection || elements instanceof NodeList) {\n elements = Array.from(elements);\n } else if (!Array.isArray(elements)) {\n elements = [elements];\n }\n\n if (!Array.isArray(events)) {\n events = [events];\n }\n\n elements.forEach(el =>\n events.forEach(ev =>\n el[method](ev, fn, {capture: false, ...options})\n )\n );\n\n return Array.prototype.slice.call(arguments, 1);\n}\n\n/**\n * Creates an DOM-Element out of a string (Single element).\n * @param html HTML representing a single element\n * @returns {Element | null} The element.\n */\nexport function createElementFromString(html) {\n const div = document.createElement('div');\n div.innerHTML = html.trim();\n return div.firstElementChild;\n}\n\n/**\n * Removes an attribute from a HTMLElement and returns the value.\n * @param el\n * @param name\n * @return {string}\n */\nexport function removeAttribute(el, name) {\n const value = el.getAttribute(name);\n el.removeAttribute(name);\n return value;\n}\n\n/**\n * Creates a new html element, every element which has\n * a 'data-key' attribute will be saved in a object (which will be returned)\n * where the value of 'data-key' ist the object-key and the value the HTMLElement.\n *\n * It's possible to create a hierarchy if you add a 'data-con' attribute. Every\n * sibling will be added to the object which will get the name from the 'data-con' attribute.\n *\n * If you want to create an Array out of multiple elements, you can use the 'data-arr' attribute,\n * the value defines the key and all elements, which has the same parent and the same 'data-arr' attribute,\n * would be added to it.\n *\n * @param str - The HTML String.\n */\nexport function createFromTemplate(str) {\n\n // Recursive function to resolve template\n function resolve(element, base = {}) {\n\n // Check key and container attribute\n const con = removeAttribute(element, 'data-con');\n const key = removeAttribute(element, 'data-key');\n\n // Check and save element\n if (key) {\n base[key] = element;\n }\n\n // Check all children\n const children = Array.from(element.children);\n const subtree = con ? (base[con] = {}) : base;\n for (let child of children) {\n\n // Check if element should be saved as array\n const arr = removeAttribute(child, 'data-arr');\n if (arr) {\n\n // Check if there is already an array and add element\n (subtree[arr] || (subtree[arr] = [])).push(child);\n } else {\n resolve(child, subtree);\n }\n }\n\n return base;\n }\n\n return resolve(createElementFromString(str));\n}\n\n/**\n * Polyfill for safari & firefox for the eventPath event property.\n * @param evt The event object.\n * @return [String] event path.\n */\nexport function eventPath(evt) {\n let path = evt.path || (evt.composedPath && evt.composedPath());\n if (path) return path;\n\n let el = evt.target.parentElement;\n path = [evt.target, el];\n while (el = el.parentElement) path.push(el);\n\n path.push(document, window);\n return path;\n}\n\n/**\n * Creates the ability to change numbers in an input field with the scroll-wheel.\n * @param el\n * @param negative\n */\nexport function adjustableInputNumbers(el, negative = true) {\n\n // Check if a char represents a number\n const isNumChar = c => (c >= '0' && c <= '9') || c === '-' || c === '.';\n\n function handleScroll(e) {\n const val = el.value;\n const off = el.selectionStart;\n let numStart = off;\n let num = ''; // Will be the number as string\n\n // Look back\n for (let i = off - 1; i > 0 && isNumChar(val[i]); i--) {\n num = val[i] + num;\n numStart--; // Find start of number\n }\n\n // Look forward\n for (let i = off, n = val.length; i < n && isNumChar(val[i]); i++) {\n num += val[i];\n }\n\n // Check if number is valid\n if (num.length > 0 && !isNaN(num) && isFinite(num)) {\n\n const mul = e.deltaY < 0 ? 1 : -1;\n const inc = e.ctrlKey ? mul * 5 : mul;\n let newNum = Number(num) + inc;\n\n if (!negative && newNum < 0) {\n newNum = 0;\n }\n\n const newStr = val.substr(0, numStart) + newNum + val.substring(numStart + num.length, val.length);\n const curPos = numStart + String(newNum).length;\n\n // Update value and set cursor\n el.value = newStr;\n el.focus();\n el.setSelectionRange(curPos, curPos);\n }\n\n // Prevent default\n e.preventDefault();\n\n // Trigger input event\n el.dispatchEvent(new Event('input'));\n }\n\n // Bind events\n on(el, 'focus', () => on(window, 'wheel', handleScroll, {passive: false}));\n on(el, 'blur', () => off(window, 'wheel', handleScroll));\n}\n\n/**\n * Cross browser padStart implementation\n * @param string\n * @param maxLength\n * @param fillString\n * @returns {string}\n */\nexport function padStart(string, maxLength, fillString = ' ') {\n maxLength = maxLength - string.length;\n\n if (maxLength <= 0 || !fillString.length) {\n return String(string);\n } else {\n\n if (maxLength > fillString.length) {\n fillString += fillString.repeat(maxLength / fillString.length);\n }\n\n return fillString.slice(0, maxLength) + String(string);\n }\n}\n","import {padStart} from '../lib/utils';\n\n// Shorthands\nconst {min, max, floor, round} = Math;\n\n/**\n * Tries to convert a color name to rgb/a hex representation\n * @param name\n * @returns {string | CanvasGradient | CanvasPattern}\n */\nfunction standardizeColor(name) {\n const ctx = document.createElement('canvas').getContext('2d');\n ctx.fillStyle = name;\n return ctx.fillStyle;\n}\n\n/**\n * Convert HSV spectrum to RGB.\n * @param h Hue\n * @param s Saturation\n * @param v Value\n * @returns {number[]} Array with rgb values.\n */\nexport function hsvToRgb(h, s, v) {\n h = (h / 360) * 6;\n s /= 100;\n v /= 100;\n\n let i = floor(h);\n\n let f = h - i;\n let p = v * (1 - s);\n let q = v * (1 - f * s);\n let t = v * (1 - (1 - f) * s);\n\n let mod = i % 6;\n let r = [v, q, p, p, t, v][mod];\n let g = [t, v, v, q, p, p][mod];\n let b = [p, p, t, v, v, q][mod];\n\n return [\n r * 255,\n g * 255,\n b * 255\n ];\n}\n\n/**\n * Convert HSV spectrum to Hex.\n * @param h Hue\n * @param s Saturation\n * @param v Value\n * @returns {string[]} Hex values\n */\nexport function hsvToHex(h, s, v) {\n return hsvToRgb(h, s, v).map(v =>\n padStart(round(v).toString(16), 2, '0')\n );\n}\n\n/**\n * Convert HSV spectrum to CMYK.\n * @param h Hue\n * @param s Saturation\n * @param v Value\n * @returns {number[]} CMYK values\n */\nexport function hsvToCmyk(h, s, v) {\n const rgb = hsvToRgb(h, s, v);\n const r = rgb[0] / 255;\n const g = rgb[1] / 255;\n const b = rgb[2] / 255;\n\n let k, c, m, y;\n\n k = min(1 - r, 1 - g, 1 - b);\n\n c = k === 1 ? 0 : (1 - r - k) / (1 - k);\n m = k === 1 ? 0 : (1 - g - k) / (1 - k);\n y = k === 1 ? 0 : (1 - b - k) / (1 - k);\n\n return [\n c * 100,\n m * 100,\n y * 100,\n k * 100\n ];\n}\n\n/**\n * Convert HSV spectrum to HSL.\n * @param h Hue\n * @param s Saturation\n * @param v Value\n * @returns {number[]} HSL values\n */\nexport function hsvToHsl(h, s, v) {\n s /= 100, v /= 100;\n\n let l = (2 - s) * v / 2;\n\n if (l !== 0) {\n if (l === 1) {\n s = 0;\n } else if (l < 0.5) {\n s = s * v / (l * 2);\n } else {\n s = s * v / (2 - l * 2);\n }\n }\n\n return [\n h,\n s * 100,\n l * 100\n ];\n}\n\n/**\n * Convert RGB to HSV.\n * @param r Red\n * @param g Green\n * @param b Blue\n * @return {number[]} HSV values.\n */\nfunction rgbToHsv(r, g, b) {\n r /= 255, g /= 255, b /= 255;\n\n let h, s, v;\n const minVal = min(r, g, b);\n const maxVal = max(r, g, b);\n const delta = maxVal - minVal;\n\n v = maxVal;\n if (delta === 0) {\n h = s = 0;\n } else {\n s = delta / maxVal;\n let dr = (((maxVal - r) / 6) + (delta / 2)) / delta;\n let dg = (((maxVal - g) / 6) + (delta / 2)) / delta;\n let db = (((maxVal - b) / 6) + (delta / 2)) / delta;\n\n if (r === maxVal) {\n h = db - dg;\n } else if (g === maxVal) {\n h = (1 / 3) + dr - db;\n } else if (b === maxVal) {\n h = (2 / 3) + dg - dr;\n }\n\n if (h < 0) {\n h += 1;\n } else if (h > 1) {\n h -= 1;\n }\n }\n\n return [\n h * 360,\n s * 100,\n v * 100\n ];\n}\n\n/**\n * Convert CMYK to HSV.\n * @param c Cyan\n * @param m Magenta\n * @param y Yellow\n * @param k Key (Black)\n * @return {number[]} HSV values.\n */\nfunction cmykToHsv(c, m, y, k) {\n c /= 100, m /= 100, y /= 100, k /= 100;\n\n const r = (1 - min(1, c * (1 - k) + k)) * 255;\n const g = (1 - min(1, m * (1 - k) + k)) * 255;\n const b = (1 - min(1, y * (1 - k) + k)) * 255;\n\n return [...rgbToHsv(r, g, b)];\n}\n\n/**\n * Convert HSL to HSV.\n * @param h Hue\n * @param s Saturation\n * @param l Lightness\n * @return {number[]} HSV values.\n */\nfunction hslToHsv(h, s, l) {\n s /= 100, l /= 100;\n s *= l < 0.5 ? l : 1 - l;\n\n let ns = (2 * s / (l + s)) * 100;\n let v = (l + s) * 100;\n return [h, ns, v];\n}\n\n/**\n * Convert HEX to HSV.\n * @param hex Hexadecimal string of rgb colors, can have length 3 or 6.\n * @return {number[]} HSV values.\n */\nfunction hexToHsv(hex) {\n return rgbToHsv(...hex.match(/.{2}/g).map(v => parseInt(v, 16)));\n}\n\n/**\n * Try's to parse a string which represents a color to a HSV array.\n * Current supported types are cmyk, rgba, hsla and hexadecimal.\n * @param str\n * @return {*}\n */\nexport function parseToHSV(str) {\n\n // Check if string is a color-name\n str = str.match(/^[a-zA-Z]+$/) ? standardizeColor(str) : str;\n\n // Regular expressions to match different types of color represention\n const regex = {\n cmyk: /^cmyk[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)/i,\n rgba: /^(rgb|rgba)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]*?([\\d.]+|$)/i,\n hsla: /^(hsl|hsla)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]*?([\\d.]+|$)/i,\n hsva: /^(hsv|hsva)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]+(\\d+)[\\D]*?([\\d.]+|$)/i,\n hex: /^#?(([\\dA-Fa-f]{3,4})|([\\dA-Fa-f]{6})|([\\dA-Fa-f]{8}))$/i\n };\n\n /**\n * Takes an Array of any type, convert strings which represents\n * a number to a number an anything else to undefined.\n * @param array\n * @return {*}\n */\n const numarize = array => array.map(v => /^(|\\d+)\\.\\d+|\\d+$/.test(v) ? Number(v) : undefined);\n\n let match;\n for (const type in regex) {\n\n // Check if current scheme passed\n if (!(match = regex[type].exec(str)))\n continue;\n\n // Try to convert\n switch (type) {\n case 'cmyk': {\n let [, c, m, y, k] = numarize(match);\n\n if (c > 100 || m > 100 || y > 100 || k > 100)\n break;\n\n return {values: [...cmykToHsv(c, m, y, k), 1], type};\n }\n case 'rgba': {\n let [, , r, g, b, a = 1] = numarize(match);\n\n if (r > 255 || g > 255 || b > 255 || a < 0 || a > 1)\n break;\n\n return {values: [...rgbToHsv(r, g, b), a], type};\n }\n case 'hex': {\n const splitAt = (s, i) => [s.substring(0, i), s.substring(i, s.length)];\n let [, hex] = match;\n\n // Fill up opacity if not declared\n if (hex.length === 3) {\n hex += 'F';\n } else if (hex.length === 6) {\n hex += 'FF';\n }\n\n let alpha;\n if (hex.length === 4) {\n [hex, alpha] = splitAt(hex, 3).map(v => v + v);\n } else if (hex.length === 8) {\n [hex, alpha] = splitAt(hex, 6);\n }\n\n // Convert 0 - 255 to 0 - 1 for opacity\n alpha = parseInt(alpha, 16) / 255;\n return {values: [...hexToHsv(hex), alpha], type};\n }\n case 'hsla': {\n let [, , h, s, l, a = 1] = numarize(match);\n\n if (h > 360 || s > 100 || l > 100 || a < 0 || a > 1)\n break;\n\n return {values: [...hslToHsv(h, s, l), a], type};\n }\n case 'hsva': {\n let [, , h, s, v, a = 1] = numarize(match);\n\n if (h > 360 || s > 100 || v > 100 || a < 0 || a > 1)\n break;\n\n return {values: [h, s, v, a], type};\n }\n }\n }\n\n return {values: null, type: null};\n}\n","import {padStart} from '../lib/utils';\nimport * as Color from './color';\n\n/**\n * Simple class which holds the properties\n * of the color represention model hsla (hue saturation lightness alpha)\n */\nexport function HSVaColor(h = 0, s = 0, v = 0, a = 1) {\n\n const ceil = Math.ceil;\n const that = {\n h, s, v, a,\n\n toHSVA() {\n const hsva = [that.h, that.s, that.v];\n const rhsva = hsva.map(ceil);\n\n hsva.push(that.a);\n hsva.toString = () => `hsva(${rhsva[0]}, ${rhsva[1]}%, ${rhsva[2]}%, ${that.a.toFixed(1)})`;\n return hsva;\n },\n\n toHSLA() {\n const hsla = Color.hsvToHsl(that.h, that.s, that.v);\n const rhsla = hsla.map(ceil);\n\n hsla.push(that.a);\n hsla.toString = () => `hsla(${rhsla[0]}, ${rhsla[1]}%, ${rhsla[2]}%, ${that.a.toFixed(1)})`;\n return hsla;\n },\n\n toRGBA() {\n const rgba = Color.hsvToRgb(that.h, that.s, that.v);\n const rrgba = rgba.map(ceil);\n\n rgba.push(that.a);\n rgba.toString = () => `rgba(${rrgba[0]}, ${rrgba[1]}, ${rrgba[2]}, ${that.a.toFixed(1)})`;\n return rgba;\n },\n\n toCMYK() {\n const cmyk = Color.hsvToCmyk(that.h, that.s, that.v);\n const rcmyk = cmyk.map(ceil);\n\n cmyk.toString = () => `cmyk(${rcmyk[0]}%, ${rcmyk[1]}%, ${rcmyk[2]}%, ${rcmyk[3]}%)`;\n return cmyk;\n },\n\n toHEXA() {\n const hex = Color.hsvToHex(...[that.h, that.s, that.v]);\n\n hex.toString = () => {\n\n // Check if alpha channel make sense, convert it to 255 number space, convert\n // to hex and pad it with zeros if needet.\n const alpha = that.a >= 1 ? '' : padStart(Number((that.a * 255).toFixed(0))\n .toString(16)\n .toUpperCase(), 2, '0');\n\n return `#${hex.join('').toUpperCase() + alpha}`;\n };\n\n return hex;\n },\n\n clone() {\n return HSVaColor(that.h, that.s, that.v, that.a);\n }\n };\n\n // TODO: Remove in 0.5.0\n that.toHEX = that.toHEXA;\n return that;\n}\n","import * as _ from './../lib/utils';\r\n\r\nexport default function Moveable(opt) {\r\n\r\n const that = {\r\n\r\n // Assign default values\r\n options: Object.assign({\r\n lockX: false,\r\n lockY: false,\r\n onchange: () => 0\r\n }, opt),\r\n\r\n _tapstart(evt) {\r\n _.on(document, ['mouseup', 'touchend', 'touchcancel'], that._tapstop);\r\n _.on(document, ['mousemove', 'touchmove'], that._tapmove);\r\n\r\n // Prevent default touch event\r\n evt.preventDefault();\r\n\r\n // Trigger\r\n that._tapmove(evt);\r\n },\r\n\r\n _tapmove(evt) {\r\n const {options, cache} = that;\r\n const {element} = options;\r\n const b = that.options.wrapper.getBoundingClientRect();\r\n\r\n let x = 0, y = 0;\r\n if (evt) {\r\n const touch = evt && evt.touches && evt.touches[0];\r\n x = evt ? (touch || evt).clientX : 0;\r\n y = evt ? (touch || evt).clientY : 0;\r\n\r\n // Reset to bounds\r\n if (x < b.left) x = b.left;\r\n else if (x > b.left + b.width) x = b.left + b.width;\r\n if (y < b.top) y = b.top;\r\n else if (y > b.top + b.height) y = b.top + b.height;\r\n\r\n // Normalize\r\n x -= b.left;\r\n y -= b.top;\r\n } else if (cache) {\r\n x = cache.x * b.width;\r\n y = cache.y * b.height;\r\n }\r\n\r\n if (!options.lockX) {\r\n element.style.left = `calc(${x / b.width * 100}% - ${element.offsetWidth / 2}px)`;\r\n }\r\n\r\n if (!options.lockY) {\r\n element.style.top = `calc(${y / b.height * 100}% - ${element.offsetWidth / 2}px)`;\r\n }\r\n\r\n that.cache = {x: x / b.width, y: y / b.height};\r\n options.onchange(x, y);\r\n },\r\n\r\n _tapstop() {\r\n _.off(document, ['mouseup', 'touchend', 'touchcancel'], that._tapstop);\r\n _.off(document, ['mousemove', 'touchmove'], that._tapmove);\r\n },\r\n\r\n trigger() {\r\n that._tapmove();\r\n },\r\n\r\n update(x = 0, y = 0) {\r\n const wrapperRect = that.options.wrapper.getBoundingClientRect();\r\n that._tapmove({\r\n clientX: wrapperRect.left + x,\r\n clientY: wrapperRect.top + y\r\n });\r\n },\r\n\r\n destroy() {\r\n const {options, _tapstart} = that;\r\n _.off([options.wrapper, options.element], 'mousedown', _tapstart);\r\n _.off([options.wrapper, options.element], 'touchstart', _tapstart, {\r\n passive: false\r\n });\r\n }\r\n };\r\n\r\n // Initilize\r\n const {options, _tapstart} = that;\r\n _.on([options.wrapper, options.element], 'mousedown', _tapstart);\r\n _.on([options.wrapper, options.element], 'touchstart', _tapstart, {\r\n passive: false\r\n });\r\n\r\n return that;\r\n}\r\n","import * as _ from './../lib/utils';\r\n\r\nexport default function Selectable(opt = {}) {\r\n opt = Object.assign({\r\n onchange: () => 0,\r\n className: '',\r\n elements: []\r\n }, opt);\r\n\r\n const onTap = _.on(opt.elements, 'click', evt => {\r\n opt.elements.forEach(e =>\r\n e.classList[evt.target === e ? 'add' : 'remove'](opt.className)\r\n );\r\n\r\n opt.onchange(evt);\r\n });\r\n\r\n return {\r\n destroy: () => _.off(...onTap)\r\n };\r\n}\r\n","// Import styles\nimport '../scss/pickr.scss';\n\n// Import utils\nimport * as _ from './lib/utils';\nimport * as Color from './lib/color';\n\n// Import classes\nimport {HSVaColor} from './lib/hsvacolor';\nimport Moveable from './helper/moveable';\nimport Selectable from './helper/selectable';\n\nclass Pickr {\n\n // Will be used to prevent specific actions during initilization\n _initializingActive = true;\n\n // Replace element with color picker\n _recalc = true;\n\n // Current and last color for comparison\n _color = HSVaColor();\n _lastColor = HSVaColor();\n _swatchColors = [];\n\n // Evenlistener name: [callbacks]\n _eventListener = {\n 'swatchselect': [],\n 'change': [],\n 'save': [],\n 'init': []\n };\n\n constructor(opt) {\n\n // Assign default values\n this.options = opt = Object.assign({\n useAsButton: false,\n disabled: false,\n comparison: true,\n\n components: {\n interaction: {}\n },\n strings: {},\n\n swatches: null,\n inline: false,\n\n default: 'fff',\n defaultRepresentation: null,\n position: 'middle',\n adjustableNumbers: true,\n showAlways: false,\n\n closeWithKey: 'Escape'\n }, opt);\n const {swatches, inline, components} = opt;\n\n // Check interaction section\n if (!components.interaction) {\n components.interaction = {};\n }\n\n // Overwrite palette if preview, opacity or hue are true\n const {preview, opacity, hue, palette} = components;\n components.palette = palette || preview || opacity || hue;\n\n // Per default enabled if inline\n if (inline) {\n opt.showAlways = true;\n }\n\n // Initialize picker\n this._preBuild();\n this._buildComponents();\n this._bindEvents();\n\n // Finalize build\n this._finalBuild();\n\n // Append pre-defined swatch colors\n if (swatches && swatches.length) {\n swatches.forEach(color => this.addSwatch(color));\n }\n\n // Initilization is finish, pickr is visible and ready for usage\n const {button} = this._root;\n requestAnimationFrame((function cb() {\n\n // offsetParent of body is always 0. So check if it is the body\n if (button.offsetParent === null && button !== document.body) {\n return requestAnimationFrame(cb.bind(this));\n }\n\n // Apply default color\n this.setColor(opt.default);\n this._rePositioningPicker();\n\n // Initialize color representation\n if (opt.defaultRepresentation) {\n this._representation = opt.defaultRepresentation;\n this.setColorRepresentation(this._representation);\n }\n\n // Show pickr if locked\n if (opt.showAlways) {\n this.show();\n }\n\n // Initialization is done - pickr is usable, fire init event\n this._initializingActive = false;\n this._emit('init');\n }).bind(this));\n }\n\n // Does only the absolutly basic thing to initialize the components\n _preBuild() {\n const opt = this.options;\n\n // Check if element is selector\n if (typeof opt.el === 'string') {\n\n // Resolve possible shadow dom access\n opt.el = opt.el.split(/>>/g).reduce((pv, cv, ci, a) => {\n pv = pv.querySelector(cv);\n return ci < a.length - 1 ? pv.shadowRoot : pv;\n }, document);\n }\n\n // Create element and append it to body to\n // prevent initialization errors\n this._root = create(opt);\n\n // Check if a custom button is used\n if (opt.useAsButton) {\n this._root.button = opt.el; // Replace button with customized button\n }\n\n document.body.appendChild(this._root.root);\n }\n\n _finalBuild() {\n const opt = this.options;\n const root = this._root;\n\n // Remove from body\n document.body.removeChild(root.root);\n\n if (opt.inline) {\n const {parentElement} = opt.el;\n\n if (parentElement.lastChild === opt.el) {\n parentElement.appendChild(root.app);\n } else {\n parentElement.insertBefore(root.app, opt.el.nextSibling);\n }\n } else {\n document.body.appendChild(root.app);\n }\n\n // Don't replace the the element if a custom button is used\n if (!opt.useAsButton) {\n\n // Replace element with actual color-picker\n opt.el.parentNode.replaceChild(root.root, opt.el);\n }\n\n // Call disable to also add the disabled class\n if (opt.disabled) {\n this.disable();\n }\n\n // Check if color comparison is disabled, if yes - remove transitions so everything keeps smoothly\n if (!opt.comparison) {\n root.button.style.transition = 'none';\n if (!opt.useAsButton) {\n root.preview.lastColor.style.transition = 'none';\n }\n }\n\n this.hide();\n }\n\n _buildComponents() {\n\n // Instance reference\n const inst = this;\n const comp = this.options.components;\n\n const components = {\n\n palette: Moveable({\n element: inst._root.palette.picker,\n wrapper: inst._root.palette.palette,\n\n onchange(x, y) {\n if (!comp.palette) return;\n const {_color, _root, options} = inst;\n\n // Calculate saturation based on the position\n _color.s = (x / this.wrapper.offsetWidth) * 100;\n\n // Calculate the value\n _color.v = 100 - (y / this.wrapper.offsetHeight) * 100;\n\n // Prevent falling under zero\n _color.v < 0 ? _color.v = 0 : 0;\n\n // Set picker and gradient color\n const cssRGBaString = _color.toRGBA().toString();\n this.element.style.background = cssRGBaString;\n this.wrapper.style.background = `\n linear-gradient(to top, rgba(0, 0, 0, ${_color.a}), transparent), \n linear-gradient(to left, hsla(${_color.h}, 100%, 50%, ${_color.a}), rgba(255, 255, 255, ${_color.a}))\n `;\n\n // Check if color is locked\n if (!options.comparison) {\n _root.button.style.color = cssRGBaString;\n\n if (!options.useAsButton) {\n _root.preview.lastColor.style.color = cssRGBaString;\n }\n }\n\n // Change current color\n _root.preview.currentColor.style.color = cssRGBaString;\n\n // Update the input field only if the user is currently not typing\n if (inst._recalc) {\n inst._updateOutput();\n }\n\n // If the user changes the color, remove the cleared icon\n _root.button.classList.remove('clear');\n }\n }),\n\n hue: Moveable({\n lockX: true,\n element: inst._root.hue.picker,\n wrapper: inst._root.hue.slider,\n\n onchange(x, y) {\n if (!comp.hue || !comp.palette) return;\n\n // Calculate hue\n inst._color.h = (y / this.wrapper.offsetHeight) * 360;\n\n // Update color\n this.element.style.backgroundColor = `hsl(${inst._color.h}, 100%, 50%)`;\n components.palette.trigger();\n }\n }),\n\n opacity: Moveable({\n lockX: true,\n element: inst._root.opacity.picker,\n wrapper: inst._root.opacity.slider,\n\n onchange(x, y) {\n if (!comp.opacity || !comp.palette) return;\n\n // Calculate opacity\n inst._color.a = Math.round(((y / this.wrapper.offsetHeight)) * 1e2) / 100;\n\n // Update color\n this.element.style.background = `rgba(0, 0, 0, ${inst._color.a})`;\n inst.components.palette.trigger();\n }\n }),\n\n selectable: Selectable({\n elements: inst._root.interaction.options,\n className: 'active',\n onchange(e) {\n inst._representation = e.target.getAttribute('data-type').toUpperCase();\n inst._updateOutput();\n }\n })\n };\n\n this.components = components;\n }\n\n _bindEvents() {\n const {_root, options} = this;\n\n const eventBindings = [\n\n // Clear color\n _.on(_root.interaction.clear, 'click', () => this._clearColor()),\n\n // Select last color on click\n _.on(_root.preview.lastColor, 'click', () => this.setHSVA(...this._lastColor.toHSVA())),\n\n // Save color\n _.on(_root.interaction.save, 'click', () => {\n !this.applyColor() && !options.showAlways && this.hide();\n }),\n\n // Detect user input and disable auto-recalculation\n _.on(_root.interaction.result, ['keyup', 'input'], e => {\n this._recalc = false;\n\n // Fire listener if initialization is finish and changed color was valid\n if (this.setColor(e.target.value, true) && !this._initializingActive) {\n this._emit('change', this._color);\n }\n\n e.stopImmediatePropagation();\n }),\n\n // Cancel input detection on color change\n _.on([\n _root.palette.palette,\n _root.palette.picker,\n _root.hue.slider,\n _root.hue.picker,\n _root.opacity.slider,\n _root.opacity.picker\n ], ['mousedown', 'touchstart'], () => this._recalc = true)\n ];\n\n // Provide hiding / showing abilities only if showAlways is false\n if (!options.showAlways) {\n const ck = options.closeWithKey;\n\n eventBindings.push(\n // Save and hide / show picker\n _.on(_root.button, 'click', () => this.isOpen() ? this.hide() : this.show()),\n\n // Close with escape key\n _.on(document, 'keyup', e => this.isOpen() && (e.key === ck || e.code === ck) && this.hide()),\n\n // Cancel selecting if the user taps behind the color picker\n _.on(document, ['touchstart', 'mousedown'], e => {\n if (this.isOpen() && !_.eventPath(e).some(el => el === _root.app || el === _root.button)) {\n this.hide();\n }\n }, {capture: true})\n );\n }\n\n // Make input adjustable if enabled\n if (options.adjustableNumbers) {\n _.adjustableInputNumbers(_root.interaction.result, false);\n }\n\n if (!options.inline) {\n let updateTimeout;\n\n // Re-calc position on window resize, scroll and wheel\n eventBindings.push(_.on(window, ['scroll', 'wheel', 'resize'], () => {\n if (this.isOpen()) {\n this.hide();\n\n if (updateTimeout) {\n clearTimeout(updateTimeout);\n }\n\n updateTimeout = setTimeout(() => this.show(), 250);\n }\n }));\n }\n\n // Save bindings\n this._eventBindings = eventBindings;\n }\n\n _rePositioningPicker = (() => {\n const padding = 8;\n let left, top;\n\n return () => {\n\n // No repositioning needed if inline\n if (this.options.inline) {\n return;\n }\n\n const {app, button} = this._root;\n const {innerWidth, innerHeight} = window;\n const bb = button.getBoundingClientRect();\n const ab = app.getBoundingClientRect();\n\n // Check if picker is cuttet of from the top & bottom\n if (innerHeight - (bb.bottom + ab.height + padding) < 0) {\n top = bb.top - ab.height - padding;\n } else {\n top = bb.bottom + padding;\n }\n\n // Positioning picker on the x-axis\n const pos = {\n left: bb.left + bb.width - ab.width,\n middle: (-ab.width / 2) + (bb.left + bb.width / 2),\n right: bb.left\n };\n\n const wantedLeft = pos[this.options.position];\n if (left + wantedLeft > innerWidth) {\n left = pos['left'];\n } else if (wantedLeft < 0) {\n left = pos['right'];\n } else {\n left = wantedLeft;\n }\n\n Object.assign(app.style, {\n left: `${left}px`,\n top: `${top}px`\n });\n };\n })();\n\n _updateOutput() {\n\n // Check if component is present\n if (this._root.interaction.type()) {\n\n // Construct function name and call if present\n const method = `to${this._root.interaction.type().getAttribute('data-type')}`;\n this._root.interaction.result.value = typeof this._color[method] === 'function' ? this._color[method]().toString() : '';\n }\n\n // Fire listener if initialization is finish\n if (!this._initializingActive) {\n this._emit('change', this._color);\n }\n }\n\n _clearColor() {\n const {_root, options} = this;\n\n // Change only the button color if it isn't customized\n if (!options.useAsButton) {\n _root.button.style.color = 'rgba(0, 0, 0, 0.15)';\n }\n\n _root.button.classList.add('clear');\n\n if (!options.showAlways) {\n this.hide();\n }\n\n if (!this._initializingActive) {\n\n // Fire listener\n this._emit('save', null);\n }\n }\n\n _emit(event, ...args) {\n this._eventListener[event].forEach(cb => cb(...args, this));\n }\n\n on(event, cb) {\n\n // Validate\n if (typeof cb === 'function' && typeof event === 'string' && event in this._eventListener) {\n this._eventListener[event].push(cb);\n }\n\n return this;\n }\n\n off(event, cb) {\n const callBacks = this._eventListener[event];\n\n if (callBacks) {\n const index = callBacks.indexOf(cb);\n\n if (~index) {\n callBacks.splice(index, 1);\n }\n }\n\n return this;\n }\n\n /**\n * Appends a color to the swatch palette\n * @param color\n * @returns {boolean}\n */\n addSwatch(color) {\n const {values} = Color.parseToHSV(color);\n\n if (values) {\n const {_swatchColors, _root} = this;\n const hsvaColorObject = HSVaColor(...values);\n\n // Create new swatch HTMLElement\n const element = _.createElementFromString(\n `