diff --git a/LICENSE b/LICENSE index 3fca0ab..003fc6b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2014-2020 Daniel Mester Pirttijärvi +Copyright (c) 2014-2021 Daniel Mester Pirttijärvi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 7612487..e5c884d 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,8 @@ use it right off [jsDelivr](https://www.jsdelivr.com). ```HTML - diff --git a/dist/jdenticon-module.js b/dist/jdenticon-module.js index 93f8f68..20ceaa7 100644 --- a/dist/jdenticon-module.js +++ b/dist/jdenticon-module.js @@ -1,8 +1,8 @@ /** - * Jdenticon 3.1.0 + * Jdenticon 3.1.1 * http://jdenticon.com * - * Built: 2020-12-12T13:51:48.709Z + * Built: 2021-08-14T17:50:52.207Z * * MIT License * @@ -1385,7 +1385,7 @@ jdenticon["updateSvg"] = updateSvg; * Specifies the version of the Jdenticon package in use. * @type {string} */ -jdenticon["version"] = "3.1.0"; +jdenticon["version"] = "3.1.1"; /** * Specifies which bundle of Jdenticon that is used. diff --git a/dist/jdenticon-module.js.map b/dist/jdenticon-module.js.map index 5b2caa9..cacab24 100644 --- a/dist/jdenticon-module.js.map +++ b/dist/jdenticon-module.js.map @@ -1 +1 @@ -{"version":3,"sources":["replacement/7","src/common/parseHex.js","src/renderer/color.js","src/common/global.js","src/common/configuration.js","src/renderer/point.js","src/renderer/transform.js","src/renderer/graphics.js","replacement/1","src/renderer/shapes.js","src/renderer/colorTheme.js","src/renderer/iconGenerator.js","src/common/sha1.js","src/common/hashUtils.js","src/renderer/canvas/canvasRenderer.js","replacement/2","src/apis/drawIcon.js","src/renderer/svg/svgPath.js","replacement/3","src/renderer/svg/svgRenderer.js","replacement/4","src/renderer/svg/constants.js","src/renderer/svg/svgWriter.js","replacement/5","src/apis/toSvg.js","src/common/dom.js","src/renderer/svg/svgElement.js","replacement/6","src/apis/update.js","src/browser-cjs.js","replacement/8"],"names":["let","const","GLOBAL","MODULE","hue","colorSaturation","grayscaleSaturation","colorLightness","grayscaleLightness","backColor","iconPadding","_x","_y","_size","_rotation","transformIconPoint","_renderer","currentTransform","addPolygon","this","addCircle","addRectangle","addTriangle","addRhombus","setBackground","iconSize","beginShape","endShape","_ctx","dataString","_path","_pathsByColor","_target","appendPath","XMLNS","WIDTH","HEIGHT","_s","HASH","VALUE","_el"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjBO,SAAS,QAAQ,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE;IAClD,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;CAC5D;;ACLA,SAAS,QAAQ,CAAC,CAAC,EAAE;IACjB,CAAC,IAAI,CAAC,CAAC;IACP,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI;QACf,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7B,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;QACxB,IAAI,CAAC;CACZ;;AAED,SAAS,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE;IACzB,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,QAAQ,CAAC,GAAG,GAAA;QACf,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,CAAA,GAAI,CAAC;QAC1B,CAAC,GAAG,CAAC,GAAG,EAAE;QACV,CA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AC3D,IAAI,QAAQ,EAAE;;QAEV,aAAa,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;KACzC;CACL;;;;ACnHAA,GAAA,CAAM,SAAS,GAAG,SAAS,CAAC;;AAE5B,oBAAoB,CAAC,SAAS,CAAC,CAAC;;;AAGhC,SAAS,CAAC,WAAW,CAAC,GAAG,SAAS,CAAC;AACnC,SAAS,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC;AACjC,SAAS,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;AAC3B,SAAS,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC;AAC7B,SAAS,CAAC,cAAc,CAAC,GAAG,YAAY,CAAC;AACzC,SAAS,CAAC,WAAW,CAAC,GAAG,SAAS,CAAC;;;;;;AAMnC,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,KAAS,CAAC,CAAC;;;;;;AAMnC,SAAS,CAAC,QAAQ,CAAC,GAAG,aAAa,CAAC;;AAEpC,MAAM,CAAC,OAAO,GAAG,SAAS;ACrC1B","file":"jdenticon-module.js","sourcesContent":["/**\r\n * Jdenticon 3.1.0\r\n * http://jdenticon.com\r\n *\r\n * Built: 2020-12-12T13:51:48.709Z\r\n * \r\n * MIT License\r\n * \r\n * Copyright (c) 2014-2020 Daniel Mester Pirttijärvi\r\n * \r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n * \r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n * \r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n */\r\n\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Parses a substring of the hash as a number.\r\n * @param {number} startPosition \r\n * @param {number=} octets\r\n */\r\nexport function parseHex(hash, startPosition, octets) {\r\n return parseInt(hash.substr(startPosition, octets), 16);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { parseHex } from \"../common/parseHex\";\r\n\r\nfunction decToHex(v) {\r\n v |= 0; // Ensure integer value\r\n return v < 0 ? \"00\" :\r\n v < 16 ? \"0\" + v.toString(16) :\r\n v < 256 ? v.toString(16) :\r\n \"ff\";\r\n}\r\n\r\nfunction hueToRgb(m1, m2, h) {\r\n h = h < 0 ? h + 6 : h > 6 ? h - 6 : h;\r\n return decToHex(255 * (\r\n h < 1 ? m1 + (m2 - m1) * h :\r\n h < 3 ? m2 :\r\n h < 4 ? m1 + (m2 - m1) * (4 - h) :\r\n m1));\r\n}\r\n\r\n/**\r\n * @param {number} r Red channel [0, 255]\r\n * @param {number} g Green channel [0, 255]\r\n * @param {number} b Blue channel [0, 255]\r\n */\r\nexport function rgb(r, g, b) {\r\n return \"#\" + decToHex(r) + decToHex(g) + decToHex(b);\r\n}\r\n\r\n/**\r\n * @param {string} color Color value to parse. Currently hexadecimal strings on the format #rgb[a] and #rrggbb[aa] are supported.\r\n * @returns {string}\r\n */\r\nexport function parseColor(color) {\r\n if (/^#[0-9a-f]{3,8}$/i.test(color)) {\r\n let result;\r\n const colorLength = color.length;\r\n\r\n if (colorLength < 6) {\r\n const r = color[1],\r\n g = color[2],\r\n b = color[3],\r\n a = color[4] || \"\";\r\n result = \"#\" + r + r + g + g + b + b + a + a;\r\n }\r\n if (colorLength == 7 || colorLength > 8) {\r\n result = color;\r\n }\r\n \r\n return result;\r\n }\r\n}\r\n\r\n/**\r\n * Converts a hexadecimal color to a CSS3 compatible color.\r\n * @param {string} hexColor Color on the format \"#RRGGBB\" or \"#RRGGBBAA\"\r\n * @returns {string}\r\n */\r\nexport function toCss3Color(hexColor) {\r\n const a = parseHex(hexColor, 7, 2);\r\n let result;\r\n\r\n if (isNaN(a)) {\r\n result = hexColor;\r\n } else {\r\n const r = parseHex(hexColor, 1, 2),\r\n g = parseHex(hexColor, 3, 2),\r\n b = parseHex(hexColor, 5, 2);\r\n result = \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + (a / 255).toFixed(2) + \")\";\r\n }\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * Converts an HSL color to a hexadecimal RGB color.\r\n * @param {number} hue Hue in range [0, 1]\r\n * @param {number} saturation Saturation in range [0, 1]\r\n * @param {number} lightness Lightness in range [0, 1]\r\n * @returns {string}\r\n */\r\nexport function hsl(hue, saturation, lightness) {\r\n // Based on http://www.w3.org/TR/2011/REC-css3-color-20110607/#hsl-color\r\n let result;\r\n\r\n if (saturation == 0) {\r\n const partialHex = decToHex(lightness * 255);\r\n result = partialHex + partialHex + partialHex;\r\n }\r\n else {\r\n const m2 = lightness <= 0.5 ? lightness * (saturation + 1) : lightness + saturation - lightness * saturation,\r\n m1 = lightness * 2 - m2;\r\n result =\r\n hueToRgb(m1, m2, hue * 6 + 2) +\r\n hueToRgb(m1, m2, hue * 6) +\r\n hueToRgb(m1, m2, hue * 6 - 2);\r\n }\r\n\r\n return \"#\" + result;\r\n}\r\n\r\n/**\r\n * Converts an HSL color to a hexadecimal RGB color. This function will correct the lightness for the \"dark\" hues\r\n * @param {number} hue Hue in range [0, 1]\r\n * @param {number} saturation Saturation in range [0, 1]\r\n * @param {number} lightness Lightness in range [0, 1]\r\n * @returns {string}\r\n */\r\nexport function correctedHsl(hue, saturation, lightness) {\r\n // The corrector specifies the perceived middle lightness for each hue\r\n const correctors = [ 0.55, 0.5, 0.5, 0.46, 0.6, 0.55, 0.55 ],\r\n corrector = correctors[(hue * 6 + 0.5) | 0];\r\n \r\n // Adjust the input lightness relative to the corrector\r\n lightness = lightness < 0.5 ? lightness * corrector * 2 : corrector + (lightness - 0.5) * (1 - corrector) * 2;\r\n \r\n return hsl(hue, saturation, lightness);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n// In the future we can replace `GLOBAL` with `globalThis`, but for now use the old school global detection for\r\n// backward compatibility.\r\n\r\nexport const GLOBAL = \r\n typeof window !== \"undefined\" ? window :\r\n typeof self !== \"undefined\" ? self :\r\n typeof global !== \"undefined\" ? global :\r\n {};\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { parseColor } from \"../renderer/color\";\r\nimport { GLOBAL } from \"./global\";\r\n\r\n/**\r\n * @typedef {Object} ParsedConfiguration\r\n * @property {number} colorSaturation\r\n * @property {number} grayscaleSaturation\r\n * @property {string} backColor\r\n * @property {number} iconPadding\r\n * @property {function(number):number} hue\r\n * @property {function(number):number} colorLightness\r\n * @property {function(number):number} grayscaleLightness\r\n */\r\n\r\nexport const CONFIG_PROPERTIES = {\r\n GLOBAL: \"jdenticon_config\",\r\n MODULE: \"config\",\r\n};\r\n\r\nvar rootConfigurationHolder = {};\r\n\r\n/**\r\n * Defines the deprecated `config` property on the root Jdenticon object. When the property is set a warning is \r\n * printed in the console. To minimize bundle size, this is only used in Node bundles.\r\n * @param {!Object} rootObject \r\n */\r\nexport function defineConfigPropertyWithWarn(rootObject) {\r\n Object.defineProperty(rootObject, CONFIG_PROPERTIES.MODULE, {\r\n configurable: true,\r\n get: () => rootConfigurationHolder[CONFIG_PROPERTIES.MODULE],\r\n set: newConfiguration => {\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] = newConfiguration;\r\n console.warn(\"jdenticon.config is deprecated. Use jdenticon.configure() instead.\");\r\n },\r\n });\r\n}\r\n\r\n/**\r\n * Defines the deprecated `config` property on the root Jdenticon object without printing a warning in the console\r\n * when it is being used.\r\n * @param {!Object} rootObject \r\n */\r\nexport function defineConfigProperty(rootObject) {\r\n rootConfigurationHolder = rootObject;\r\n}\r\n\r\n/**\r\n * Sets a new icon style configuration. The new configuration is not merged with the previous one. * \r\n * @param {Object} newConfiguration - New configuration object.\r\n */\r\nexport function configure(newConfiguration) {\r\n if (arguments.length) {\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] = newConfiguration;\r\n }\r\n return rootConfigurationHolder[CONFIG_PROPERTIES.MODULE];\r\n}\r\n\r\n/**\r\n * Gets the normalized current Jdenticon color configuration. Missing fields have default values.\r\n * @param {Object|number|undefined} paddingOrLocalConfig - Configuration passed to the called API method. A\r\n * local configuration overrides the global configuration in it entirety. This parameter can for backward\r\n * compatibility also contain a padding value. A padding value only overrides the global padding, not the\r\n * entire global configuration.\r\n * @param {number} defaultPadding - Padding used if no padding is specified in neither the configuration nor\r\n * explicitly to the API method.\r\n * @returns {ParsedConfiguration}\r\n */\r\nexport function getConfiguration(paddingOrLocalConfig, defaultPadding) {\r\n const configObject = \r\n typeof paddingOrLocalConfig == \"object\" && paddingOrLocalConfig ||\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] ||\r\n GLOBAL[CONFIG_PROPERTIES.GLOBAL] ||\r\n { },\r\n\r\n lightnessConfig = configObject[\"lightness\"] || { },\r\n \r\n // In versions < 2.1.0 there was no grayscale saturation -\r\n // saturation was the color saturation.\r\n saturation = configObject[\"saturation\"] || { },\r\n colorSaturation = \"color\" in saturation ? saturation[\"color\"] : saturation,\r\n grayscaleSaturation = saturation[\"grayscale\"],\r\n\r\n backColor = configObject[\"backColor\"],\r\n padding = configObject[\"padding\"];\r\n \r\n /**\r\n * Creates a lightness range.\r\n */\r\n function lightness(configName, defaultRange) {\r\n let range = lightnessConfig[configName];\r\n \r\n // Check if the lightness range is an array-like object. This way we ensure the\r\n // array contain two values at the same time.\r\n if (!(range && range.length > 1)) {\r\n range = defaultRange;\r\n }\r\n\r\n /**\r\n * Gets a lightness relative the specified value in the specified lightness range.\r\n */\r\n return function (value) {\r\n value = range[0] + value * (range[1] - range[0]);\r\n return value < 0 ? 0 : value > 1 ? 1 : value;\r\n };\r\n }\r\n\r\n /**\r\n * Gets a hue allowed by the configured hue restriction,\r\n * provided the originally computed hue.\r\n */\r\n function hueFunction(originalHue) {\r\n const hueConfig = configObject[\"hues\"];\r\n let hue;\r\n \r\n // Check if 'hues' is an array-like object. This way we also ensure that\r\n // the array is not empty, which would mean no hue restriction.\r\n if (hueConfig && hueConfig.length > 0) {\r\n // originalHue is in the range [0, 1]\r\n // Multiply with 0.999 to change the range to [0, 1) and then truncate the index.\r\n hue = hueConfig[0 | (0.999 * originalHue * hueConfig.length)];\r\n }\r\n\r\n return typeof hue == \"number\" ?\r\n \r\n // A hue was specified. We need to convert the hue from\r\n // degrees on any turn - e.g. 746° is a perfectly valid hue -\r\n // to turns in the range [0, 1).\r\n ((((hue / 360) % 1) + 1) % 1) :\r\n\r\n // No hue configured => use original hue\r\n originalHue;\r\n }\r\n \r\n return {\r\n hue: hueFunction,\r\n colorSaturation: typeof colorSaturation == \"number\" ? colorSaturation : 0.5,\r\n grayscaleSaturation: typeof grayscaleSaturation == \"number\" ? grayscaleSaturation : 0,\r\n colorLightness: lightness(\"color\", [0.4, 0.8]),\r\n grayscaleLightness: lightness(\"grayscale\", [0.3, 0.9]),\r\n backColor: parseColor(backColor),\r\n iconPadding: \r\n typeof paddingOrLocalConfig == \"number\" ? paddingOrLocalConfig : \r\n typeof padding == \"number\" ? padding : \r\n defaultPadding\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Represents a point.\r\n */\r\nexport class Point {\r\n /**\r\n * @param {number} x \r\n * @param {number} y \r\n */\r\n constructor(x, y) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { Point } from \"./point\";\r\n\r\n/**\r\n * Translates and rotates a point before being passed on to the canvas context. This was previously done by the canvas context itself, \r\n * but this caused a rendering issue in Chrome on sizes > 256 where the rotation transformation of inverted paths was not done properly.\r\n */\r\nexport class Transform {\r\n /**\r\n * @param {number} x The x-coordinate of the upper left corner of the transformed rectangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the transformed rectangle.\r\n * @param {number} size The size of the transformed rectangle.\r\n * @param {number} rotation Rotation specified as 0 = 0 rad, 1 = 0.5π rad, 2 = π rad, 3 = 1.5π rad\r\n */\r\n constructor(x, y, size, rotation) {\r\n this._x = x;\r\n this._y = y;\r\n this._size = size;\r\n this._rotation = rotation;\r\n }\r\n\r\n /**\r\n * Transforms the specified point based on the translation and rotation specification for this Transform.\r\n * @param {number} x x-coordinate\r\n * @param {number} y y-coordinate\r\n * @param {number=} w The width of the transformed rectangle. If greater than 0, this will ensure the returned point is of the upper left corner of the transformed rectangle.\r\n * @param {number=} h The height of the transformed rectangle. If greater than 0, this will ensure the returned point is of the upper left corner of the transformed rectangle.\r\n */\r\n transformIconPoint(x, y, w, h) {\r\n const right = this._x + this._size,\r\n bottom = this._y + this._size,\r\n rotation = this._rotation;\r\n return rotation === 1 ? new Point(right - y - (h || 0), this._y + x) :\r\n rotation === 2 ? new Point(right - x - (w || 0), bottom - y - (h || 0)) :\r\n rotation === 3 ? new Point(this._x + y, bottom - x - (w || 0)) :\r\n new Point(this._x + x, this._y + y);\r\n }\r\n}\r\n\r\nexport const NO_TRANSFORM = new Transform(0, 0, 0, 0);\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { NO_TRANSFORM } from \"./transform\";\r\n\r\n/**\r\n * @typedef {import(\"./renderer\").Renderer} Renderer\r\n * @typedef {import(\"./transform\").Transform} Transform\r\n */\r\n\r\n/**\r\n * Provides helper functions for rendering common basic shapes.\r\n */\r\nexport class Graphics {\r\n /**\r\n * @param {Renderer} renderer \r\n */\r\n constructor(renderer) {\r\n /**\r\n * @type {Renderer}\r\n * @private\r\n */\r\n this._renderer = renderer;\r\n\r\n /**\r\n * @type {Transform}\r\n */\r\n this.currentTransform = NO_TRANSFORM;\r\n }\r\n\r\n /**\r\n * Adds a polygon to the underlying renderer.\r\n * @param {Array} points The points of the polygon clockwise on the format [ x0, y0, x1, y1, ..., xn, yn ]\r\n * @param {boolean=} invert Specifies if the polygon will be inverted.\r\n */\r\n addPolygon(points, invert) {\r\n const di = invert ? -2 : 2,\r\n transformedPoints = [];\r\n \r\n for (let i = invert ? points.length - 2 : 0; i < points.length && i >= 0; i += di) {\r\n transformedPoints.push(this.currentTransform.transformIconPoint(points[i], points[i + 1]));\r\n }\r\n \r\n this._renderer.addPolygon(transformedPoints);\r\n }\r\n \r\n /**\r\n * Adds a polygon to the underlying renderer.\r\n * Source: http://stackoverflow.com/a/2173084\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the entire ellipse.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the entire ellipse.\r\n * @param {number} size The size of the ellipse.\r\n * @param {boolean=} invert Specifies if the ellipse will be inverted.\r\n */\r\n addCircle(x, y, size, invert) {\r\n const p = this.currentTransform.transformIconPoint(x, y, size, size);\r\n this._renderer.addCircle(p, size, invert);\r\n }\r\n\r\n /**\r\n * Adds a rectangle to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle.\r\n * @param {number} w The width of the rectangle.\r\n * @param {number} h The height of the rectangle.\r\n * @param {boolean=} invert Specifies if the rectangle will be inverted.\r\n */\r\n addRectangle(x, y, w, h, invert) {\r\n this.addPolygon([\r\n x, y, \r\n x + w, y,\r\n x + w, y + h,\r\n x, y + h\r\n ], invert);\r\n }\r\n\r\n /**\r\n * Adds a right triangle to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the triangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the triangle.\r\n * @param {number} w The width of the triangle.\r\n * @param {number} h The height of the triangle.\r\n * @param {number} r The rotation of the triangle (clockwise). 0 = right corner of the triangle in the lower left corner of the bounding rectangle.\r\n * @param {boolean=} invert Specifies if the triangle will be inverted.\r\n */\r\n addTriangle(x, y, w, h, r, invert) {\r\n const points = [\r\n x + w, y, \r\n x + w, y + h, \r\n x, y + h,\r\n x, y\r\n ];\r\n points.splice(((r || 0) % 4) * 2, 2);\r\n this.addPolygon(points, invert);\r\n }\r\n\r\n /**\r\n * Adds a rhombus to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the rhombus.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the rhombus.\r\n * @param {number} w The width of the rhombus.\r\n * @param {number} h The height of the rhombus.\r\n * @param {boolean=} invert Specifies if the rhombus will be inverted.\r\n */\r\n addRhombus(x, y, w, h, invert) {\r\n this.addPolygon([\r\n x + w / 2, y,\r\n x + w, y + h / 2,\r\n x + w / 2, y + h,\r\n x, y + h / 2\r\n ], invert);\r\n }\r\n}","\r\nvar Graphics__prototype = Graphics.prototype;","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * @param {number} index\r\n * @param {Graphics} g\r\n * @param {number} cell\r\n * @param {number} positionIndex\r\n * @typedef {import('./graphics').Graphics} Graphics\r\n */\r\nexport function centerShape(index, g, cell, positionIndex) {\r\n index = index % 14;\r\n\r\n let k, m, w, h, inner, outer;\r\n\r\n !index ? (\r\n k = cell * 0.42,\r\n g.addPolygon([\r\n 0, 0,\r\n cell, 0,\r\n cell, cell - k * 2,\r\n cell - k, cell,\r\n 0, cell\r\n ])) :\r\n\r\n index == 1 ? (\r\n w = 0 | (cell * 0.5), \r\n h = 0 | (cell * 0.8),\r\n\r\n g.addTriangle(cell - w, 0, w, h, 2)) :\r\n\r\n index == 2 ? (\r\n w = 0 | (cell / 3),\r\n g.addRectangle(w, w, cell - w, cell - w)) :\r\n\r\n index == 3 ? (\r\n inner = cell * 0.1,\r\n // Use fixed outer border widths in small icons to ensure the border is drawn\r\n outer = \r\n cell < 6 ? 1 :\r\n cell < 8 ? 2 :\r\n (0 | (cell * 0.25)),\r\n \r\n inner = \r\n inner > 1 ? (0 | inner) : // large icon => truncate decimals\r\n inner > 0.5 ? 1 : // medium size icon => fixed width\r\n inner, // small icon => anti-aliased border\r\n\r\n g.addRectangle(outer, outer, cell - inner - outer, cell - inner - outer)) :\r\n\r\n index == 4 ? (\r\n m = 0 | (cell * 0.15),\r\n w = 0 | (cell * 0.5),\r\n g.addCircle(cell - w - m, cell - w - m, w)) :\r\n\r\n index == 5 ? (\r\n inner = cell * 0.1,\r\n outer = inner * 4,\r\n\r\n // Align edge to nearest pixel in large icons\r\n outer > 3 && (outer = 0 | outer),\r\n \r\n g.addRectangle(0, 0, cell, cell),\r\n g.addPolygon([\r\n outer, outer,\r\n cell - inner, outer,\r\n outer + (cell - outer - inner) / 2, cell - inner\r\n ], true)) :\r\n\r\n index == 6 ? \r\n g.addPolygon([\r\n 0, 0,\r\n cell, 0,\r\n cell, cell * 0.7,\r\n cell * 0.4, cell * 0.4,\r\n cell * 0.7, cell,\r\n 0, cell\r\n ]) :\r\n\r\n index == 7 ? \r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 3) :\r\n\r\n index == 8 ? (\r\n g.addRectangle(0, 0, cell, cell / 2),\r\n g.addRectangle(0, cell / 2, cell / 2, cell / 2),\r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 1)) :\r\n\r\n index == 9 ? (\r\n inner = cell * 0.14,\r\n // Use fixed outer border widths in small icons to ensure the border is drawn\r\n outer = \r\n cell < 4 ? 1 :\r\n cell < 6 ? 2 :\r\n (0 | (cell * 0.35)),\r\n\r\n inner = \r\n cell < 8 ? inner : // small icon => anti-aliased border\r\n (0 | inner), // large icon => truncate decimals\r\n\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addRectangle(outer, outer, cell - outer - inner, cell - outer - inner, true)) :\r\n\r\n index == 10 ? (\r\n inner = cell * 0.12,\r\n outer = inner * 3,\r\n\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addCircle(outer, outer, cell - inner - outer, true)) :\r\n\r\n index == 11 ? \r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 3) :\r\n\r\n index == 12 ? (\r\n m = cell * 0.25,\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addRhombus(m, m, cell - m, cell - m, true)) :\r\n\r\n // 13\r\n (\r\n !positionIndex && (\r\n m = cell * 0.4, w = cell * 1.2,\r\n g.addCircle(m, m, w)\r\n )\r\n );\r\n}\r\n\r\n/**\r\n * @param {number} index\r\n * @param {Graphics} g\r\n * @param {number} cell\r\n */\r\nexport function outerShape(index, g, cell) {\r\n index = index % 4;\r\n\r\n let m;\r\n\r\n !index ?\r\n g.addTriangle(0, 0, cell, cell, 0) :\r\n \r\n index == 1 ?\r\n g.addTriangle(0, cell / 2, cell, cell / 2, 0) :\r\n\r\n index == 2 ?\r\n g.addRhombus(0, 0, cell, cell) :\r\n\r\n // 3\r\n (\r\n m = cell / 6,\r\n g.addCircle(m, m, cell - 2 * m)\r\n );\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { correctedHsl } from \"./color\";\r\n\r\n/**\r\n * Gets a set of identicon color candidates for a specified hue and config.\r\n * @param {number} hue\r\n * @param {import(\"../common/configuration\").ParsedConfiguration} config\r\n */\r\nexport function colorTheme(hue, config) {\r\n hue = config.hue(hue);\r\n return [\r\n // Dark gray\r\n correctedHsl(hue, config.grayscaleSaturation, config.grayscaleLightness(0)),\r\n // Mid color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(0.5)),\r\n // Light gray\r\n correctedHsl(hue, config.grayscaleSaturation, config.grayscaleLightness(1)),\r\n // Light color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(1)),\r\n // Dark color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(0))\r\n ];\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { Transform } from \"./transform\";\r\nimport { Graphics } from \"./graphics\";\r\nimport { centerShape, outerShape } from \"./shapes\";\r\nimport { colorTheme } from \"./colorTheme\";\r\nimport { parseHex } from \"../common/parseHex\";\r\nimport { getConfiguration } from \"../common/configuration\";\r\n \r\n/**\r\n * Draws an identicon to a specified renderer.\r\n * @param {import('./renderer').Renderer} renderer\r\n * @param {string} hash\r\n * @param {Object|number=} config\r\n */\r\nexport function iconGenerator(renderer, hash, config) {\r\n const parsedConfig = getConfiguration(config, 0.08);\r\n\r\n // Set background color\r\n if (parsedConfig.backColor) {\r\n renderer.setBackground(parsedConfig.backColor);\r\n }\r\n \r\n // Calculate padding and round to nearest integer\r\n let size = renderer.iconSize;\r\n const padding = (0.5 + size * parsedConfig.iconPadding) | 0;\r\n size -= padding * 2;\r\n \r\n const graphics = new Graphics(renderer);\r\n \r\n // Calculate cell size and ensure it is an integer\r\n const cell = 0 | (size / 4);\r\n \r\n // Since the cell size is integer based, the actual icon will be slightly smaller than specified => center icon\r\n const x = 0 | (padding + size / 2 - cell * 2);\r\n const y = 0 | (padding + size / 2 - cell * 2);\r\n\r\n function renderShape(colorIndex, shapes, index, rotationIndex, positions) {\r\n const shapeIndex = parseHex(hash, index, 1);\r\n let r = rotationIndex ? parseHex(hash, rotationIndex, 1) : 0;\r\n \r\n renderer.beginShape(availableColors[selectedColorIndexes[colorIndex]]);\r\n \r\n for (let i = 0; i < positions.length; i++) {\r\n graphics.currentTransform = new Transform(x + positions[i][0] * cell, y + positions[i][1] * cell, cell, r++ % 4);\r\n shapes(shapeIndex, graphics, cell, i);\r\n }\r\n \r\n renderer.endShape();\r\n }\r\n\r\n // AVAILABLE COLORS\r\n const hue = parseHex(hash, -7) / 0xfffffff,\r\n \r\n // Available colors for this icon\r\n availableColors = colorTheme(hue, parsedConfig),\r\n\r\n // The index of the selected colors\r\n selectedColorIndexes = [];\r\n\r\n let index;\r\n\r\n function isDuplicate(values) {\r\n if (values.indexOf(index) >= 0) {\r\n for (let i = 0; i < values.length; i++) {\r\n if (selectedColorIndexes.indexOf(values[i]) >= 0) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n for (let i = 0; i < 3; i++) {\r\n index = parseHex(hash, 8 + i, 1) % availableColors.length;\r\n if (isDuplicate([0, 4]) || // Disallow dark gray and dark color combo\r\n isDuplicate([2, 3])) { // Disallow light gray and light color combo\r\n index = 1;\r\n }\r\n selectedColorIndexes.push(index);\r\n }\r\n\r\n // ACTUAL RENDERING\r\n // Sides\r\n renderShape(0, outerShape, 2, 3, [[1, 0], [2, 0], [2, 3], [1, 3], [0, 1], [3, 1], [3, 2], [0, 2]]);\r\n // Corners\r\n renderShape(1, outerShape, 4, 5, [[0, 0], [3, 0], [3, 3], [0, 3]]);\r\n // Center\r\n renderShape(2, centerShape, 1, null, [[1, 1], [2, 1], [2, 2], [1, 2]]);\r\n \r\n renderer.finish();\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Computes a SHA1 hash for any value and returns it as a hexadecimal string.\r\n * \r\n * This function is optimized for minimal code size and rather short messages.\r\n * \r\n * @param {string} message \r\n */\r\nexport function sha1(message) {\r\n const HASH_SIZE_HALF_BYTES = 40;\r\n const BLOCK_SIZE_WORDS = 16;\r\n\r\n // Variables\r\n // `var` is used to be able to minimize the number of `var` keywords.\r\n var i = 0,\r\n f = 0,\r\n \r\n // Use `encodeURI` to UTF8 encode the message without any additional libraries\r\n // We could use `unescape` + `encodeURI` to minimize the code, but that would be slightly risky\r\n // since `unescape` is deprecated.\r\n urlEncodedMessage = encodeURI(message) + \"%80\", // trailing '1' bit padding\r\n \r\n // This can be changed to a preallocated Uint32Array array for greater performance and larger code size\r\n data = [],\r\n dataSize,\r\n \r\n hashBuffer = [],\r\n\r\n a = 0x67452301,\r\n b = 0xefcdab89,\r\n c = ~a,\r\n d = ~b,\r\n e = 0xc3d2e1f0,\r\n hash = [a, b, c, d, e],\r\n\r\n blockStartIndex = 0,\r\n hexHash = \"\";\r\n\r\n /**\r\n * Rotates the value a specified number of bits to the left.\r\n * @param {number} value Value to rotate\r\n * @param {number} shift Bit count to shift.\r\n */\r\n function rotl(value, shift) {\r\n return (value << shift) | (value >>> (32 - shift));\r\n }\r\n\r\n // Message data\r\n for ( ; i < urlEncodedMessage.length; f++) {\r\n data[f >> 2] = data[f >> 2] |\r\n (\r\n (\r\n urlEncodedMessage[i] == \"%\"\r\n // Percent encoded byte\r\n ? parseInt(urlEncodedMessage.substring(i + 1, i += 3), 16)\r\n // Unencoded byte\r\n : urlEncodedMessage.charCodeAt(i++)\r\n )\r\n\r\n // Read bytes in reverse order (big endian words)\r\n << ((3 - (f & 3)) * 8)\r\n );\r\n }\r\n\r\n // f is now the length of the utf8 encoded message\r\n // 7 = 8 bytes (64 bit) for message size, -1 to round down\r\n // >> 6 = integer division with block size\r\n dataSize = (((f + 7) >> 6) + 1) * BLOCK_SIZE_WORDS;\r\n\r\n // Message size in bits.\r\n // SHA1 uses a 64 bit integer to represent the size, but since we only support short messages only the least\r\n // significant 32 bits are set. -8 is for the '1' bit padding byte.\r\n data[dataSize - 1] = f * 8 - 8;\r\n \r\n // Compute hash\r\n for ( ; blockStartIndex < dataSize; blockStartIndex += BLOCK_SIZE_WORDS) {\r\n for (i = 0; i < 80; i++) {\r\n f = rotl(a, 5) + e + (\r\n // Ch\r\n i < 20 ? ((b & c) ^ ((~b) & d)) + 0x5a827999 :\r\n \r\n // Parity\r\n i < 40 ? (b ^ c ^ d) + 0x6ed9eba1 :\r\n \r\n // Maj\r\n i < 60 ? ((b & c) ^ (b & d) ^ (c & d)) + 0x8f1bbcdc :\r\n \r\n // Parity\r\n (b ^ c ^ d) + 0xca62c1d6\r\n ) + ( \r\n hashBuffer[i] = i < BLOCK_SIZE_WORDS\r\n // Bitwise OR is used to coerse `undefined` to 0\r\n ? (data[blockStartIndex + i] | 0)\r\n : rotl(hashBuffer[i - 3] ^ hashBuffer[i - 8] ^ hashBuffer[i - 14] ^ hashBuffer[i - 16], 1)\r\n );\r\n\r\n e = d;\r\n d = c;\r\n c = rotl(b, 30);\r\n b = a;\r\n a = f;\r\n }\r\n\r\n hash[0] = a = ((hash[0] + a) | 0);\r\n hash[1] = b = ((hash[1] + b) | 0);\r\n hash[2] = c = ((hash[2] + c) | 0);\r\n hash[3] = d = ((hash[3] + d) | 0);\r\n hash[4] = e = ((hash[4] + e) | 0);\r\n }\r\n\r\n // Format hex hash\r\n for (i = 0; i < HASH_SIZE_HALF_BYTES; i++) {\r\n hexHash += (\r\n (\r\n // Get word (2^3 half-bytes per word)\r\n hash[i >> 3] >>>\r\n\r\n // Append half-bytes in reverse order\r\n ((7 - (i & 7)) * 4)\r\n ) \r\n // Clamp to half-byte\r\n & 0xf\r\n ).toString(16);\r\n }\r\n\r\n return hexHash;\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { sha1 } from \"./sha1\";\r\n\r\n/**\r\n * Inputs a value that might be a valid hash string for Jdenticon and returns it \r\n * if it is determined valid, otherwise a falsy value is returned.\r\n */\r\nexport function isValidHash(hashCandidate) {\r\n return /^[0-9a-f]{11,}$/i.test(hashCandidate) && hashCandidate;\r\n}\r\n\r\n/**\r\n * Computes a hash for the specified value. Currently SHA1 is used. This function\r\n * always returns a valid hash.\r\n */\r\nexport function computeHash(value) {\r\n return sha1(value == null ? \"\" : \"\" + value);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { toCss3Color } from \"../color\";\r\n\r\n/**\r\n * @typedef {import(\"../renderer\").Renderer} Renderer\r\n * @typedef {import('../point').Point} Point\r\n */\r\n\r\n/**\r\n * Renderer redirecting drawing commands to a canvas context.\r\n * @implements {Renderer}\r\n */\r\nexport class CanvasRenderer {\r\n /**\r\n * @param {number=} iconSize\r\n */\r\n constructor(ctx, iconSize) {\r\n const canvas = ctx.canvas; \r\n const width = canvas.width;\r\n const height = canvas.height;\r\n \r\n ctx.save();\r\n \r\n if (!iconSize) {\r\n iconSize = Math.min(width, height);\r\n \r\n ctx.translate(\r\n ((width - iconSize) / 2) | 0,\r\n ((height - iconSize) / 2) | 0);\r\n }\r\n\r\n /**\r\n * @private\r\n */\r\n this._ctx = ctx;\r\n this.iconSize = iconSize;\r\n \r\n ctx.clearRect(0, 0, iconSize, iconSize);\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb[aa].\r\n */\r\n setBackground(fillColor) {\r\n const ctx = this._ctx;\r\n const iconSize = this.iconSize;\r\n\r\n ctx.fillStyle = toCss3Color(fillColor);\r\n ctx.fillRect(0, 0, iconSize, iconSize);\r\n }\r\n\r\n /**\r\n * Marks the beginning of a new shape of the specified color. Should be ended with a call to endShape.\r\n * @param {string} fillColor Fill color on format #rrggbb[aa].\r\n */\r\n beginShape(fillColor) {\r\n const ctx = this._ctx;\r\n ctx.fillStyle = toCss3Color(fillColor);\r\n ctx.beginPath();\r\n }\r\n\r\n /**\r\n * Marks the end of the currently drawn shape. This causes the queued paths to be rendered on the canvas.\r\n */\r\n endShape() {\r\n this._ctx.fill();\r\n }\r\n\r\n /**\r\n * Adds a polygon to the rendering queue.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n const ctx = this._ctx;\r\n ctx.moveTo(points[0].x, points[0].y);\r\n for (let i = 1; i < points.length; i++) {\r\n ctx.lineTo(points[i].x, points[i].y);\r\n }\r\n ctx.closePath();\r\n }\r\n\r\n /**\r\n * Adds a circle to the rendering queue.\r\n * @param {Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n const ctx = this._ctx,\r\n radius = diameter / 2;\r\n ctx.moveTo(point.x + radius, point.y + radius);\r\n ctx.arc(point.x + radius, point.y + radius, radius, 0, Math.PI * 2, counterClockwise);\r\n ctx.closePath();\r\n }\r\n\r\n /**\r\n * Called when the icon has been completely drawn.\r\n */\r\n finish() {\r\n this._ctx.restore();\r\n }\r\n}\r\n","\r\nvar CanvasRenderer__prototype = CanvasRenderer.prototype;","import { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { CanvasRenderer } from \"../renderer/canvas/canvasRenderer\";\r\n\r\n/**\r\n * Draws an identicon to a context.\r\n * @param {CanvasRenderingContext2D} ctx - Canvas context on which the icon will be drawn at location (0, 0).\r\n * @param {*} hashOrValue - A hexadecimal hash string or any value that will be hashed by Jdenticon.\r\n * @param {number} size - Icon size in pixels.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compatibility a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function drawIcon(ctx, hashOrValue, size, config) {\r\n if (!ctx) {\r\n throw new Error(\"No canvas specified.\");\r\n }\r\n \r\n iconGenerator(new CanvasRenderer(ctx, size), \r\n isValidHash(hashOrValue) || computeHash(hashOrValue), \r\n config);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Prepares a measure to be used as a measure in an SVG path, by\r\n * rounding the measure to a single decimal. This reduces the file\r\n * size of the generated SVG with more than 50% in some cases.\r\n */\r\nfunction svgValue(value) {\r\n return ((value * 10 + 0.5) | 0) / 10;\r\n}\r\n\r\n/**\r\n * Represents an SVG path element.\r\n */\r\nexport class SvgPath {\r\n constructor() {\r\n /**\r\n * This property holds the data string (path.d) of the SVG path.\r\n * @type {string}\r\n */\r\n this.dataString = \"\";\r\n }\r\n\r\n /**\r\n * Adds a polygon with the current fill color to the SVG path.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n let dataString = \"\";\r\n for (let i = 0; i < points.length; i++) {\r\n dataString += (i ? \"L\" : \"M\") + svgValue(points[i].x) + \" \" + svgValue(points[i].y);\r\n }\r\n this.dataString += dataString + \"Z\";\r\n }\r\n\r\n /**\r\n * Adds a circle with the current fill color to the SVG path.\r\n * @param {import('../point').Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n const sweepFlag = counterClockwise ? 0 : 1,\r\n svgRadius = svgValue(diameter / 2),\r\n svgDiameter = svgValue(diameter),\r\n svgArc = \"a\" + svgRadius + \",\" + svgRadius + \" 0 1,\" + sweepFlag + \" \";\r\n \r\n this.dataString += \r\n \"M\" + svgValue(point.x) + \" \" + svgValue(point.y + diameter / 2) +\r\n svgArc + svgDiameter + \",0\" + \r\n svgArc + (-svgDiameter) + \",0\";\r\n }\r\n}\r\n\r\n","\r\nvar SvgPath__prototype = SvgPath.prototype;","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { SvgPath } from \"./svgPath\";\r\nimport { parseHex } from \"../../common/parseHex\";\r\n\r\n/**\r\n * @typedef {import(\"../point\").Point} Point\r\n * @typedef {import(\"../renderer\").Renderer} Renderer\r\n * @typedef {import(\"./svgElement\").SvgElement} SvgElement\r\n * @typedef {import(\"./svgWriter\").SvgWriter} SvgWriter\r\n */\r\n\r\n/**\r\n * Renderer producing SVG output.\r\n * @implements {Renderer}\r\n */\r\nexport class SvgRenderer {\r\n /**\r\n * @param {SvgElement|SvgWriter} target \r\n */\r\n constructor(target) {\r\n /**\r\n * @type {SvgPath}\r\n * @private\r\n */\r\n this._path;\r\n\r\n /**\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._pathsByColor = { };\r\n\r\n /**\r\n * @type {SvgElement|SvgWriter}\r\n * @private\r\n */\r\n this._target = target;\r\n\r\n /**\r\n * @type {number}\r\n */\r\n this.iconSize = target.iconSize;\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb[aa].\r\n */\r\n setBackground(fillColor) {\r\n const match = /^(#......)(..)?/.exec(fillColor),\r\n opacity = match[2] ? parseHex(match[2], 0) / 255 : 1;\r\n this._target.setBackground(match[1], opacity);\r\n }\r\n\r\n /**\r\n * Marks the beginning of a new shape of the specified color. Should be ended with a call to endShape.\r\n * @param {string} color Fill color on format #xxxxxx.\r\n */\r\n beginShape(color) {\r\n this._path = this._pathsByColor[color] || (this._pathsByColor[color] = new SvgPath());\r\n }\r\n\r\n /**\r\n * Marks the end of the currently drawn shape.\r\n */\r\n endShape() { }\r\n\r\n /**\r\n * Adds a polygon with the current fill color to the SVG.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n this._path.addPolygon(points);\r\n }\r\n\r\n /**\r\n * Adds a circle with the current fill color to the SVG.\r\n * @param {Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n this._path.addCircle(point, diameter, counterClockwise);\r\n }\r\n\r\n /**\r\n * Called when the icon has been completely drawn.\r\n */\r\n finish() { \r\n const pathsByColor = this._pathsByColor;\r\n for (let color in pathsByColor) {\r\n // hasOwnProperty cannot be shadowed in pathsByColor\r\n // eslint-disable-next-line no-prototype-builtins\r\n if (pathsByColor.hasOwnProperty(color)) {\r\n this._target.appendPath(color, pathsByColor[color].dataString);\r\n }\r\n }\r\n }\r\n}\r\n","\r\nvar SvgRenderer__prototype = SvgRenderer.prototype;","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nexport const SVG_CONSTANTS = {\r\n XMLNS: \"http://www.w3.org/2000/svg\",\r\n WIDTH: \"width\",\r\n HEIGHT: \"height\",\r\n}","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { SVG_CONSTANTS } from \"./constants\";\r\n\r\n/**\r\n * Renderer producing SVG output.\r\n */\r\nexport class SvgWriter {\r\n /**\r\n * @param {number} iconSize - Icon width and height in pixels.\r\n */\r\n constructor(iconSize) {\r\n /**\r\n * @type {number}\r\n */\r\n this.iconSize = iconSize;\r\n\r\n /**\r\n * @type {string}\r\n * @private\r\n */\r\n this._s =\r\n '';\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb.\r\n * @param {number} opacity Opacity in the range [0.0, 1.0].\r\n */\r\n setBackground(fillColor, opacity) {\r\n if (opacity) {\r\n this._s += '';\r\n }\r\n }\r\n\r\n /**\r\n * Writes a path to the SVG string.\r\n * @param {string} color Fill color on format #rrggbb.\r\n * @param {string} dataString The SVG path data string.\r\n */\r\n appendPath(color, dataString) {\r\n this._s += '';\r\n }\r\n\r\n /**\r\n * Gets the rendered image as an SVG string.\r\n */\r\n toString() {\r\n return this._s + \"\";\r\n }\r\n}\r\n","\r\nvar SvgWriter__prototype = SvgWriter.prototype;","import { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { SvgRenderer } from \"../renderer/svg/svgRenderer\";\r\nimport { SvgWriter } from \"../renderer/svg/svgWriter\";\r\n\r\n/**\r\n * Draws an identicon as an SVG string.\r\n * @param {*} hashOrValue - A hexadecimal hash string or any value that will be hashed by Jdenticon.\r\n * @param {number} size - Icon size in pixels.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compatibility a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n * @returns {string} SVG string\r\n */\r\nexport function toSvg(hashOrValue, size, config) {\r\n const writer = new SvgWriter(size);\r\n iconGenerator(new SvgRenderer(writer), \r\n isValidHash(hashOrValue) || computeHash(hashOrValue),\r\n config);\r\n return writer.toString();\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nexport const ICON_TYPE_SVG = 1;\r\n\r\nexport const ICON_TYPE_CANVAS = 2;\r\n\r\nexport const ATTRIBUTES = {\r\n HASH: \"data-jdenticon-hash\",\r\n VALUE: \"data-jdenticon-value\"\r\n};\r\n\r\nexport const ICON_SELECTOR = \"[\" + ATTRIBUTES.HASH +\"],[\" + ATTRIBUTES.VALUE +\"]\";\r\n\r\nexport const documentQuerySelectorAll = /** @type {!Function} */ (\r\n typeof document !== \"undefined\" && document.querySelectorAll.bind(document));\r\n\r\nexport function getIdenticonType(el) {\r\n if (el) {\r\n const tagName = el[\"tagName\"];\r\n\r\n if (/^svg$/i.test(tagName)) {\r\n return ICON_TYPE_SVG;\r\n }\r\n\r\n if (/^canvas$/i.test(tagName) && \"getContext\" in el) {\r\n return ICON_TYPE_CANVAS;\r\n }\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { SVG_CONSTANTS } from \"./constants\";\r\n\r\n/**\r\n * Creates a new element and adds it to the specified parent.\r\n * @param {Element} parentNode\r\n * @param {string} name\r\n * @param {...(string|number)} keyValuePairs\r\n */\r\nfunction SvgElement_append(parentNode, name, ...keyValuePairs) {\r\n const el = document.createElementNS(SVG_CONSTANTS.XMLNS, name);\r\n \r\n for (let i = 0; i + 1 < keyValuePairs.length; i += 2) {\r\n el.setAttribute(\r\n /** @type {string} */(keyValuePairs[i]),\r\n /** @type {string} */(keyValuePairs[i + 1]),\r\n );\r\n }\r\n\r\n parentNode.appendChild(el);\r\n}\r\n\r\n\r\n/**\r\n * Renderer producing SVG output.\r\n */\r\nexport class SvgElement {\r\n /**\r\n * @param {Element} element - Target element\r\n */\r\n constructor(element) {\r\n // Don't use the clientWidth and clientHeight properties on SVG elements\r\n // since Firefox won't serve a proper value of these properties on SVG\r\n // elements (https://bugzilla.mozilla.org/show_bug.cgi?id=874811)\r\n // Instead use 100px as a hardcoded size (the svg viewBox will rescale \r\n // the icon to the correct dimensions)\r\n const iconSize = this.iconSize = Math.min(\r\n (Number(element.getAttribute(SVG_CONSTANTS.WIDTH)) || 100),\r\n (Number(element.getAttribute(SVG_CONSTANTS.HEIGHT)) || 100)\r\n );\r\n \r\n /**\r\n * @type {Element}\r\n * @private\r\n */\r\n this._el = element;\r\n \r\n // Clear current SVG child elements\r\n while (element.firstChild) {\r\n element.removeChild(element.firstChild);\r\n }\r\n \r\n // Set viewBox attribute to ensure the svg scales nicely.\r\n element.setAttribute(\"viewBox\", \"0 0 \" + iconSize + \" \" + iconSize);\r\n element.setAttribute(\"preserveAspectRatio\", \"xMidYMid meet\");\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb.\r\n * @param {number} opacity Opacity in the range [0.0, 1.0].\r\n */\r\n setBackground(fillColor, opacity) {\r\n if (opacity) {\r\n SvgElement_append(this._el, \"rect\",\r\n SVG_CONSTANTS.WIDTH, \"100%\",\r\n SVG_CONSTANTS.HEIGHT, \"100%\",\r\n \"fill\", fillColor,\r\n \"opacity\", opacity);\r\n }\r\n }\r\n\r\n /**\r\n * Appends a path to the SVG element.\r\n * @param {string} color Fill color on format #xxxxxx.\r\n * @param {string} dataString The SVG path data string.\r\n */\r\n appendPath(color, dataString) {\r\n SvgElement_append(this._el, \"path\",\r\n \"fill\", color,\r\n \"d\", dataString);\r\n }\r\n}\r\n","\r\nvar SvgElement__prototype = SvgElement.prototype;","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { ATTRIBUTES, ICON_SELECTOR, documentQuerySelectorAll } from \"../common/dom\";\r\nimport { SvgRenderer } from \"../renderer/svg/svgRenderer\";\r\nimport { SvgElement } from \"../renderer/svg/svgElement\";\r\nimport { CanvasRenderer } from \"../renderer/canvas/canvasRenderer\";\r\nimport { ICON_TYPE_CANVAS, ICON_TYPE_SVG, getIdenticonType } from \"../common/dom\";\r\n\r\n\r\n/**\r\n * Updates all canvas elements with the `data-jdenticon-hash` or `data-jdenticon-value` attribute.\r\n */\r\nexport function updateAll() {\r\n if (documentQuerySelectorAll) {\r\n update(ICON_SELECTOR);\r\n }\r\n}\r\n\r\n/**\r\n * Updates the identicon in the specified `` or `` elements.\r\n * @param {(string|Element)} el - Specifies the container in which the icon is rendered as a DOM element of the type\r\n * `` or ``, or a CSS selector to such an element.\r\n * @param {*=} hashOrValue - Optional hash or value to be rendered. If not specified, the `data-jdenticon-hash` or\r\n * `data-jdenticon-value` attribute will be evaluated.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compability a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function update(el, hashOrValue, config) {\r\n renderDomElement(el, hashOrValue, config, function (el, iconType) {\r\n if (iconType) {\r\n return iconType == ICON_TYPE_SVG ? \r\n new SvgRenderer(new SvgElement(el)) : \r\n new CanvasRenderer(/** @type {HTMLCanvasElement} */(el).getContext(\"2d\"));\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Updates the identicon in the specified `` elements.\r\n * @param {(string|Element)} el - Specifies the container in which the icon is rendered as a DOM element of the type\r\n * ``, or a CSS selector to such an element.\r\n * @param {*=} hashOrValue - Optional hash or value to be rendered. If not specified, the `data-jdenticon-hash` or\r\n * `data-jdenticon-value` attribute will be evaluated.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compability a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function updateCanvas(el, hashOrValue, config) {\r\n renderDomElement(el, hashOrValue, config, function (el, iconType) {\r\n if (iconType == ICON_TYPE_CANVAS) {\r\n return new CanvasRenderer(/** @type {HTMLCanvasElement} */(el).getContext(\"2d\"));\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Updates the identicon in the specified `` elements.\r\n * @param {(string|Element)} el - Specifies the container in which the icon is rendered as a DOM element of the type\r\n * ``, or a CSS selector to such an element.\r\n * @param {*=} hashOrValue - Optional hash or value to be rendered. If not specified, the `data-jdenticon-hash` or\r\n * `data-jdenticon-value` attribute will be evaluated.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compability a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function updateSvg(el, hashOrValue, config) {\r\n renderDomElement(el, hashOrValue, config, function (el, iconType) {\r\n if (iconType == ICON_TYPE_SVG) {\r\n return new SvgRenderer(new SvgElement(el));\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Updates the identicon in the specified canvas or svg elements.\r\n * @param {(string|Element)} el - Specifies the container in which the icon is rendered as a DOM element of the type\r\n * `` or ``, or a CSS selector to such an element.\r\n * @param {*} hashOrValue - Optional hash or value to be rendered. If not specified, the `data-jdenticon-hash` or\r\n * `data-jdenticon-value` attribute will be evaluated.\r\n * @param {Object|number|undefined} config\r\n * @param {function(Element,number):import(\"../renderer/renderer\").Renderer} rendererFactory - Factory function for creating an icon renderer.\r\n */\r\nfunction renderDomElement(el, hashOrValue, config, rendererFactory) {\r\n if (typeof el === \"string\") {\r\n if (documentQuerySelectorAll) {\r\n const elements = documentQuerySelectorAll(el);\r\n for (let i = 0; i < elements.length; i++) {\r\n renderDomElement(elements[i], hashOrValue, config, rendererFactory);\r\n }\r\n }\r\n return;\r\n }\r\n \r\n // Hash selection. The result from getValidHash or computeHash is \r\n // accepted as a valid hash.\r\n const hash = \r\n // 1. Explicit valid hash\r\n isValidHash(hashOrValue) ||\r\n \r\n // 2. Explicit value (`!= null` catches both null and undefined)\r\n hashOrValue != null && computeHash(hashOrValue) ||\r\n \r\n // 3. `data-jdenticon-hash` attribute\r\n isValidHash(el.getAttribute(ATTRIBUTES.HASH)) ||\r\n \r\n // 4. `data-jdenticon-value` attribute. \r\n // We want to treat an empty attribute as an empty value. \r\n // Some browsers return empty string even if the attribute \r\n // is not specified, so use hasAttribute to determine if \r\n // the attribute is specified.\r\n el.hasAttribute(ATTRIBUTES.VALUE) && computeHash(el.getAttribute(ATTRIBUTES.VALUE));\r\n \r\n if (!hash) {\r\n // No hash specified. Don't render an icon.\r\n return;\r\n }\r\n \r\n const renderer = rendererFactory(el, getIdenticonType(el));\r\n if (renderer) {\r\n // Draw icon\r\n iconGenerator(renderer, hash, config);\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n// This file is compiled to dist/jdenticon-module.js\r\n\r\nimport { defineConfigProperty } from \"./common/configuration\";\r\nimport { configure } from \"./apis/configure\";\r\nimport { drawIcon } from \"./apis/drawIcon\";\r\nimport { toSvg } from \"./apis/toSvg\";\r\nimport { update, updateAll, updateCanvas, updateSvg } from \"./apis/update\";\r\n\r\nconst jdenticon = updateAll;\r\n\r\ndefineConfigProperty(jdenticon);\r\n\r\n// Export public API\r\njdenticon[\"configure\"] = configure;\r\njdenticon[\"drawIcon\"] = drawIcon;\r\njdenticon[\"toSvg\"] = toSvg;\r\njdenticon[\"update\"] = update;\r\njdenticon[\"updateCanvas\"] = updateCanvas;\r\njdenticon[\"updateSvg\"] = updateSvg;\r\n\r\n/**\r\n * Specifies the version of the Jdenticon package in use.\r\n * @type {string}\r\n */\r\njdenticon[\"version\"] = \"#version#\";\r\n\r\n/**\r\n * Specifies which bundle of Jdenticon that is used.\r\n * @type {string}\r\n */\r\njdenticon[\"bundle\"] = \"browser-cjs\";\r\n\r\nmodule.exports = jdenticon;","\n//# sourceMappingURL=jdenticon-module.js.map\n"]} \ No newline at end of file +{"version":3,"sources":["replacement/7","src/common/parseHex.js","src/renderer/color.js","src/common/global.js","src/common/configuration.js","src/renderer/point.js","src/renderer/transform.js","src/renderer/graphics.js","replacement/1","src/renderer/shapes.js","src/renderer/colorTheme.js","src/renderer/iconGenerator.js","src/common/sha1.js","src/common/hashUtils.js","src/renderer/canvas/canvasRenderer.js","replacement/2","src/apis/drawIcon.js","src/renderer/svg/svgPath.js","replacement/3","src/renderer/svg/svgRenderer.js","replacement/4","src/renderer/svg/constants.js","src/renderer/svg/svgWriter.js","replacement/5","src/apis/toSvg.js","src/common/dom.js","src/renderer/svg/svgElement.js","replacement/6","src/apis/update.js","src/browser-cjs.js","replacement/8"],"names":["let","const","GLOBAL","MODULE","hue","colorSaturation","grayscaleSaturation","colorLightness","grayscaleLightness","backColor","iconPadding","_x","_y","_size","_rotation","transformIconPoint","_renderer","currentTransform","addPolygon","this","addCircle","addRectangle","addTriangle","addRhombus","setBackground","iconSize","beginShape","endShape","_ctx","dataString","_path","_pathsByColor","_target","appendPath","XMLNS","WIDTH","HEIGHT","_s","HASH","VALUE","_el"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACjBO,SAAS,QAAQ,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE;IAClD,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;CAC5D;;ACLA,SAAS,QAAQ,CAAC,CAAC,EAAE;IACjB,CAAC,IAAI,CAAC,CAAC;IACP,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI;QACf,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7B,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;QACxB,IAAI,CAAC;CACZ;;AAED,SAAS,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE;IACzB,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,QAAQ,CAAC,GAAG,GAAA;QACf,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,CAAA,GAAI,CAAC;QAC1B,CAAC,GAAG,CAAC,GAAG,EAAE;QACV,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,G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AQ,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;KACzC;CACL;;;;ACnHAA,GAAA,CAAM,SAAS,GAAG,SAAS,CAAC;;AAE5B,oBAAoB,CAAC,SAAS,CAAC,CAAC;;;AAGhC,SAAS,CAAC,WAAW,CAAC,GAAG,SAAS,CAAC;AACnC,SAAS,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC;AACjC,SAAS,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC;AAC3B,SAAS,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC;AAC7B,SAAS,CAAC,cAAc,CAAC,GAAG,YAAY,CAAC;AACzC,SAAS,CAAC,WAAW,CAAC,GAAG,SAAS,CAAC;;;;;;AAMnC,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,KAAS,CAAC,CAAC;;;;;;AAMnC,SAAS,CAAC,QAAQ,CAAC,GAAG,aAAa,CAAC;;AAEpC,MAAM,CAAC,OAAO,GAAG,SAAS;ACrC1B","file":"jdenticon-module.js","sourcesContent":["/**\r\n * Jdenticon 3.1.1\r\n * http://jdenticon.com\r\n *\r\n * Built: 2021-08-14T17:50:52.207Z\r\n * \r\n * MIT License\r\n * \r\n * Copyright (c) 2014-2020 Daniel Mester Pirttijärvi\r\n * \r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n * \r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n * \r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n */\r\n\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Parses a substring of the hash as a number.\r\n * @param {number} startPosition \r\n * @param {number=} octets\r\n */\r\nexport function parseHex(hash, startPosition, octets) {\r\n return parseInt(hash.substr(startPosition, octets), 16);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { parseHex } from \"../common/parseHex\";\r\n\r\nfunction decToHex(v) {\r\n v |= 0; // Ensure integer value\r\n return v < 0 ? \"00\" :\r\n v < 16 ? \"0\" + v.toString(16) :\r\n v < 256 ? v.toString(16) :\r\n \"ff\";\r\n}\r\n\r\nfunction hueToRgb(m1, m2, h) {\r\n h = h < 0 ? h + 6 : h > 6 ? h - 6 : h;\r\n return decToHex(255 * (\r\n h < 1 ? m1 + (m2 - m1) * h :\r\n h < 3 ? m2 :\r\n h < 4 ? m1 + (m2 - m1) * (4 - h) :\r\n m1));\r\n}\r\n\r\n/**\r\n * @param {number} r Red channel [0, 255]\r\n * @param {number} g Green channel [0, 255]\r\n * @param {number} b Blue channel [0, 255]\r\n */\r\nexport function rgb(r, g, b) {\r\n return \"#\" + decToHex(r) + decToHex(g) + decToHex(b);\r\n}\r\n\r\n/**\r\n * @param {string} color Color value to parse. Currently hexadecimal strings on the format #rgb[a] and #rrggbb[aa] are supported.\r\n * @returns {string}\r\n */\r\nexport function parseColor(color) {\r\n if (/^#[0-9a-f]{3,8}$/i.test(color)) {\r\n let result;\r\n const colorLength = color.length;\r\n\r\n if (colorLength < 6) {\r\n const r = color[1],\r\n g = color[2],\r\n b = color[3],\r\n a = color[4] || \"\";\r\n result = \"#\" + r + r + g + g + b + b + a + a;\r\n }\r\n if (colorLength == 7 || colorLength > 8) {\r\n result = color;\r\n }\r\n \r\n return result;\r\n }\r\n}\r\n\r\n/**\r\n * Converts a hexadecimal color to a CSS3 compatible color.\r\n * @param {string} hexColor Color on the format \"#RRGGBB\" or \"#RRGGBBAA\"\r\n * @returns {string}\r\n */\r\nexport function toCss3Color(hexColor) {\r\n const a = parseHex(hexColor, 7, 2);\r\n let result;\r\n\r\n if (isNaN(a)) {\r\n result = hexColor;\r\n } else {\r\n const r = parseHex(hexColor, 1, 2),\r\n g = parseHex(hexColor, 3, 2),\r\n b = parseHex(hexColor, 5, 2);\r\n result = \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + (a / 255).toFixed(2) + \")\";\r\n }\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * Converts an HSL color to a hexadecimal RGB color.\r\n * @param {number} hue Hue in range [0, 1]\r\n * @param {number} saturation Saturation in range [0, 1]\r\n * @param {number} lightness Lightness in range [0, 1]\r\n * @returns {string}\r\n */\r\nexport function hsl(hue, saturation, lightness) {\r\n // Based on http://www.w3.org/TR/2011/REC-css3-color-20110607/#hsl-color\r\n let result;\r\n\r\n if (saturation == 0) {\r\n const partialHex = decToHex(lightness * 255);\r\n result = partialHex + partialHex + partialHex;\r\n }\r\n else {\r\n const m2 = lightness <= 0.5 ? lightness * (saturation + 1) : lightness + saturation - lightness * saturation,\r\n m1 = lightness * 2 - m2;\r\n result =\r\n hueToRgb(m1, m2, hue * 6 + 2) +\r\n hueToRgb(m1, m2, hue * 6) +\r\n hueToRgb(m1, m2, hue * 6 - 2);\r\n }\r\n\r\n return \"#\" + result;\r\n}\r\n\r\n/**\r\n * Converts an HSL color to a hexadecimal RGB color. This function will correct the lightness for the \"dark\" hues\r\n * @param {number} hue Hue in range [0, 1]\r\n * @param {number} saturation Saturation in range [0, 1]\r\n * @param {number} lightness Lightness in range [0, 1]\r\n * @returns {string}\r\n */\r\nexport function correctedHsl(hue, saturation, lightness) {\r\n // The corrector specifies the perceived middle lightness for each hue\r\n const correctors = [ 0.55, 0.5, 0.5, 0.46, 0.6, 0.55, 0.55 ],\r\n corrector = correctors[(hue * 6 + 0.5) | 0];\r\n \r\n // Adjust the input lightness relative to the corrector\r\n lightness = lightness < 0.5 ? lightness * corrector * 2 : corrector + (lightness - 0.5) * (1 - corrector) * 2;\r\n \r\n return hsl(hue, saturation, lightness);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n// In the future we can replace `GLOBAL` with `globalThis`, but for now use the old school global detection for\r\n// backward compatibility.\r\n\r\nexport const GLOBAL = \r\n typeof window !== \"undefined\" ? window :\r\n typeof self !== \"undefined\" ? self :\r\n typeof global !== \"undefined\" ? global :\r\n {};\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { parseColor } from \"../renderer/color\";\r\nimport { GLOBAL } from \"./global\";\r\n\r\n/**\r\n * @typedef {Object} ParsedConfiguration\r\n * @property {number} colorSaturation\r\n * @property {number} grayscaleSaturation\r\n * @property {string} backColor\r\n * @property {number} iconPadding\r\n * @property {function(number):number} hue\r\n * @property {function(number):number} colorLightness\r\n * @property {function(number):number} grayscaleLightness\r\n */\r\n\r\nexport const CONFIG_PROPERTIES = {\r\n GLOBAL: \"jdenticon_config\",\r\n MODULE: \"config\",\r\n};\r\n\r\nvar rootConfigurationHolder = {};\r\n\r\n/**\r\n * Defines the deprecated `config` property on the root Jdenticon object. When the property is set a warning is \r\n * printed in the console. To minimize bundle size, this is only used in Node bundles.\r\n * @param {!Object} rootObject \r\n */\r\nexport function defineConfigPropertyWithWarn(rootObject) {\r\n Object.defineProperty(rootObject, CONFIG_PROPERTIES.MODULE, {\r\n configurable: true,\r\n get: () => rootConfigurationHolder[CONFIG_PROPERTIES.MODULE],\r\n set: newConfiguration => {\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] = newConfiguration;\r\n console.warn(\"jdenticon.config is deprecated. Use jdenticon.configure() instead.\");\r\n },\r\n });\r\n}\r\n\r\n/**\r\n * Defines the deprecated `config` property on the root Jdenticon object without printing a warning in the console\r\n * when it is being used.\r\n * @param {!Object} rootObject \r\n */\r\nexport function defineConfigProperty(rootObject) {\r\n rootConfigurationHolder = rootObject;\r\n}\r\n\r\n/**\r\n * Sets a new icon style configuration. The new configuration is not merged with the previous one. * \r\n * @param {Object} newConfiguration - New configuration object.\r\n */\r\nexport function configure(newConfiguration) {\r\n if (arguments.length) {\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] = newConfiguration;\r\n }\r\n return rootConfigurationHolder[CONFIG_PROPERTIES.MODULE];\r\n}\r\n\r\n/**\r\n * Gets the normalized current Jdenticon color configuration. Missing fields have default values.\r\n * @param {Object|number|undefined} paddingOrLocalConfig - Configuration passed to the called API method. A\r\n * local configuration overrides the global configuration in it entirety. This parameter can for backward\r\n * compatibility also contain a padding value. A padding value only overrides the global padding, not the\r\n * entire global configuration.\r\n * @param {number} defaultPadding - Padding used if no padding is specified in neither the configuration nor\r\n * explicitly to the API method.\r\n * @returns {ParsedConfiguration}\r\n */\r\nexport function getConfiguration(paddingOrLocalConfig, defaultPadding) {\r\n const configObject = \r\n typeof paddingOrLocalConfig == \"object\" && paddingOrLocalConfig ||\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] ||\r\n GLOBAL[CONFIG_PROPERTIES.GLOBAL] ||\r\n { },\r\n\r\n lightnessConfig = configObject[\"lightness\"] || { },\r\n \r\n // In versions < 2.1.0 there was no grayscale saturation -\r\n // saturation was the color saturation.\r\n saturation = configObject[\"saturation\"] || { },\r\n colorSaturation = \"color\" in saturation ? saturation[\"color\"] : saturation,\r\n grayscaleSaturation = saturation[\"grayscale\"],\r\n\r\n backColor = configObject[\"backColor\"],\r\n padding = configObject[\"padding\"];\r\n \r\n /**\r\n * Creates a lightness range.\r\n */\r\n function lightness(configName, defaultRange) {\r\n let range = lightnessConfig[configName];\r\n \r\n // Check if the lightness range is an array-like object. This way we ensure the\r\n // array contain two values at the same time.\r\n if (!(range && range.length > 1)) {\r\n range = defaultRange;\r\n }\r\n\r\n /**\r\n * Gets a lightness relative the specified value in the specified lightness range.\r\n */\r\n return function (value) {\r\n value = range[0] + value * (range[1] - range[0]);\r\n return value < 0 ? 0 : value > 1 ? 1 : value;\r\n };\r\n }\r\n\r\n /**\r\n * Gets a hue allowed by the configured hue restriction,\r\n * provided the originally computed hue.\r\n */\r\n function hueFunction(originalHue) {\r\n const hueConfig = configObject[\"hues\"];\r\n let hue;\r\n \r\n // Check if 'hues' is an array-like object. This way we also ensure that\r\n // the array is not empty, which would mean no hue restriction.\r\n if (hueConfig && hueConfig.length > 0) {\r\n // originalHue is in the range [0, 1]\r\n // Multiply with 0.999 to change the range to [0, 1) and then truncate the index.\r\n hue = hueConfig[0 | (0.999 * originalHue * hueConfig.length)];\r\n }\r\n\r\n return typeof hue == \"number\" ?\r\n \r\n // A hue was specified. We need to convert the hue from\r\n // degrees on any turn - e.g. 746° is a perfectly valid hue -\r\n // to turns in the range [0, 1).\r\n ((((hue / 360) % 1) + 1) % 1) :\r\n\r\n // No hue configured => use original hue\r\n originalHue;\r\n }\r\n \r\n return {\r\n hue: hueFunction,\r\n colorSaturation: typeof colorSaturation == \"number\" ? colorSaturation : 0.5,\r\n grayscaleSaturation: typeof grayscaleSaturation == \"number\" ? grayscaleSaturation : 0,\r\n colorLightness: lightness(\"color\", [0.4, 0.8]),\r\n grayscaleLightness: lightness(\"grayscale\", [0.3, 0.9]),\r\n backColor: parseColor(backColor),\r\n iconPadding: \r\n typeof paddingOrLocalConfig == \"number\" ? paddingOrLocalConfig : \r\n typeof padding == \"number\" ? padding : \r\n defaultPadding\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Represents a point.\r\n */\r\nexport class Point {\r\n /**\r\n * @param {number} x \r\n * @param {number} y \r\n */\r\n constructor(x, y) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { Point } from \"./point\";\r\n\r\n/**\r\n * Translates and rotates a point before being passed on to the canvas context. This was previously done by the canvas context itself, \r\n * but this caused a rendering issue in Chrome on sizes > 256 where the rotation transformation of inverted paths was not done properly.\r\n */\r\nexport class Transform {\r\n /**\r\n * @param {number} x The x-coordinate of the upper left corner of the transformed rectangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the transformed rectangle.\r\n * @param {number} size The size of the transformed rectangle.\r\n * @param {number} rotation Rotation specified as 0 = 0 rad, 1 = 0.5π rad, 2 = π rad, 3 = 1.5π rad\r\n */\r\n constructor(x, y, size, rotation) {\r\n this._x = x;\r\n this._y = y;\r\n this._size = size;\r\n this._rotation = rotation;\r\n }\r\n\r\n /**\r\n * Transforms the specified point based on the translation and rotation specification for this Transform.\r\n * @param {number} x x-coordinate\r\n * @param {number} y y-coordinate\r\n * @param {number=} w The width of the transformed rectangle. If greater than 0, this will ensure the returned point is of the upper left corner of the transformed rectangle.\r\n * @param {number=} h The height of the transformed rectangle. If greater than 0, this will ensure the returned point is of the upper left corner of the transformed rectangle.\r\n */\r\n transformIconPoint(x, y, w, h) {\r\n const right = this._x + this._size,\r\n bottom = this._y + this._size,\r\n rotation = this._rotation;\r\n return rotation === 1 ? new Point(right - y - (h || 0), this._y + x) :\r\n rotation === 2 ? new Point(right - x - (w || 0), bottom - y - (h || 0)) :\r\n rotation === 3 ? new Point(this._x + y, bottom - x - (w || 0)) :\r\n new Point(this._x + x, this._y + y);\r\n }\r\n}\r\n\r\nexport const NO_TRANSFORM = new Transform(0, 0, 0, 0);\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { NO_TRANSFORM } from \"./transform\";\r\n\r\n/**\r\n * @typedef {import(\"./renderer\").Renderer} Renderer\r\n * @typedef {import(\"./transform\").Transform} Transform\r\n */\r\n\r\n/**\r\n * Provides helper functions for rendering common basic shapes.\r\n */\r\nexport class Graphics {\r\n /**\r\n * @param {Renderer} renderer \r\n */\r\n constructor(renderer) {\r\n /**\r\n * @type {Renderer}\r\n * @private\r\n */\r\n this._renderer = renderer;\r\n\r\n /**\r\n * @type {Transform}\r\n */\r\n this.currentTransform = NO_TRANSFORM;\r\n }\r\n\r\n /**\r\n * Adds a polygon to the underlying renderer.\r\n * @param {Array} points The points of the polygon clockwise on the format [ x0, y0, x1, y1, ..., xn, yn ]\r\n * @param {boolean=} invert Specifies if the polygon will be inverted.\r\n */\r\n addPolygon(points, invert) {\r\n const di = invert ? -2 : 2,\r\n transformedPoints = [];\r\n \r\n for (let i = invert ? points.length - 2 : 0; i < points.length && i >= 0; i += di) {\r\n transformedPoints.push(this.currentTransform.transformIconPoint(points[i], points[i + 1]));\r\n }\r\n \r\n this._renderer.addPolygon(transformedPoints);\r\n }\r\n \r\n /**\r\n * Adds a polygon to the underlying renderer.\r\n * Source: http://stackoverflow.com/a/2173084\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the entire ellipse.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the entire ellipse.\r\n * @param {number} size The size of the ellipse.\r\n * @param {boolean=} invert Specifies if the ellipse will be inverted.\r\n */\r\n addCircle(x, y, size, invert) {\r\n const p = this.currentTransform.transformIconPoint(x, y, size, size);\r\n this._renderer.addCircle(p, size, invert);\r\n }\r\n\r\n /**\r\n * Adds a rectangle to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle.\r\n * @param {number} w The width of the rectangle.\r\n * @param {number} h The height of the rectangle.\r\n * @param {boolean=} invert Specifies if the rectangle will be inverted.\r\n */\r\n addRectangle(x, y, w, h, invert) {\r\n this.addPolygon([\r\n x, y, \r\n x + w, y,\r\n x + w, y + h,\r\n x, y + h\r\n ], invert);\r\n }\r\n\r\n /**\r\n * Adds a right triangle to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the triangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the triangle.\r\n * @param {number} w The width of the triangle.\r\n * @param {number} h The height of the triangle.\r\n * @param {number} r The rotation of the triangle (clockwise). 0 = right corner of the triangle in the lower left corner of the bounding rectangle.\r\n * @param {boolean=} invert Specifies if the triangle will be inverted.\r\n */\r\n addTriangle(x, y, w, h, r, invert) {\r\n const points = [\r\n x + w, y, \r\n x + w, y + h, \r\n x, y + h,\r\n x, y\r\n ];\r\n points.splice(((r || 0) % 4) * 2, 2);\r\n this.addPolygon(points, invert);\r\n }\r\n\r\n /**\r\n * Adds a rhombus to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the rhombus.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the rhombus.\r\n * @param {number} w The width of the rhombus.\r\n * @param {number} h The height of the rhombus.\r\n * @param {boolean=} invert Specifies if the rhombus will be inverted.\r\n */\r\n addRhombus(x, y, w, h, invert) {\r\n this.addPolygon([\r\n x + w / 2, y,\r\n x + w, y + h / 2,\r\n x + w / 2, y + h,\r\n x, y + h / 2\r\n ], invert);\r\n }\r\n}","\r\nvar Graphics__prototype = Graphics.prototype;","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * @param {number} index\r\n * @param {Graphics} g\r\n * @param {number} cell\r\n * @param {number} positionIndex\r\n * @typedef {import('./graphics').Graphics} Graphics\r\n */\r\nexport function centerShape(index, g, cell, positionIndex) {\r\n index = index % 14;\r\n\r\n let k, m, w, h, inner, outer;\r\n\r\n !index ? (\r\n k = cell * 0.42,\r\n g.addPolygon([\r\n 0, 0,\r\n cell, 0,\r\n cell, cell - k * 2,\r\n cell - k, cell,\r\n 0, cell\r\n ])) :\r\n\r\n index == 1 ? (\r\n w = 0 | (cell * 0.5), \r\n h = 0 | (cell * 0.8),\r\n\r\n g.addTriangle(cell - w, 0, w, h, 2)) :\r\n\r\n index == 2 ? (\r\n w = 0 | (cell / 3),\r\n g.addRectangle(w, w, cell - w, cell - w)) :\r\n\r\n index == 3 ? (\r\n inner = cell * 0.1,\r\n // Use fixed outer border widths in small icons to ensure the border is drawn\r\n outer = \r\n cell < 6 ? 1 :\r\n cell < 8 ? 2 :\r\n (0 | (cell * 0.25)),\r\n \r\n inner = \r\n inner > 1 ? (0 | inner) : // large icon => truncate decimals\r\n inner > 0.5 ? 1 : // medium size icon => fixed width\r\n inner, // small icon => anti-aliased border\r\n\r\n g.addRectangle(outer, outer, cell - inner - outer, cell - inner - outer)) :\r\n\r\n index == 4 ? (\r\n m = 0 | (cell * 0.15),\r\n w = 0 | (cell * 0.5),\r\n g.addCircle(cell - w - m, cell - w - m, w)) :\r\n\r\n index == 5 ? (\r\n inner = cell * 0.1,\r\n outer = inner * 4,\r\n\r\n // Align edge to nearest pixel in large icons\r\n outer > 3 && (outer = 0 | outer),\r\n \r\n g.addRectangle(0, 0, cell, cell),\r\n g.addPolygon([\r\n outer, outer,\r\n cell - inner, outer,\r\n outer + (cell - outer - inner) / 2, cell - inner\r\n ], true)) :\r\n\r\n index == 6 ? \r\n g.addPolygon([\r\n 0, 0,\r\n cell, 0,\r\n cell, cell * 0.7,\r\n cell * 0.4, cell * 0.4,\r\n cell * 0.7, cell,\r\n 0, cell\r\n ]) :\r\n\r\n index == 7 ? \r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 3) :\r\n\r\n index == 8 ? (\r\n g.addRectangle(0, 0, cell, cell / 2),\r\n g.addRectangle(0, cell / 2, cell / 2, cell / 2),\r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 1)) :\r\n\r\n index == 9 ? (\r\n inner = cell * 0.14,\r\n // Use fixed outer border widths in small icons to ensure the border is drawn\r\n outer = \r\n cell < 4 ? 1 :\r\n cell < 6 ? 2 :\r\n (0 | (cell * 0.35)),\r\n\r\n inner = \r\n cell < 8 ? inner : // small icon => anti-aliased border\r\n (0 | inner), // large icon => truncate decimals\r\n\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addRectangle(outer, outer, cell - outer - inner, cell - outer - inner, true)) :\r\n\r\n index == 10 ? (\r\n inner = cell * 0.12,\r\n outer = inner * 3,\r\n\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addCircle(outer, outer, cell - inner - outer, true)) :\r\n\r\n index == 11 ? \r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 3) :\r\n\r\n index == 12 ? (\r\n m = cell * 0.25,\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addRhombus(m, m, cell - m, cell - m, true)) :\r\n\r\n // 13\r\n (\r\n !positionIndex && (\r\n m = cell * 0.4, w = cell * 1.2,\r\n g.addCircle(m, m, w)\r\n )\r\n );\r\n}\r\n\r\n/**\r\n * @param {number} index\r\n * @param {Graphics} g\r\n * @param {number} cell\r\n */\r\nexport function outerShape(index, g, cell) {\r\n index = index % 4;\r\n\r\n let m;\r\n\r\n !index ?\r\n g.addTriangle(0, 0, cell, cell, 0) :\r\n \r\n index == 1 ?\r\n g.addTriangle(0, cell / 2, cell, cell / 2, 0) :\r\n\r\n index == 2 ?\r\n g.addRhombus(0, 0, cell, cell) :\r\n\r\n // 3\r\n (\r\n m = cell / 6,\r\n g.addCircle(m, m, cell - 2 * m)\r\n );\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { correctedHsl } from \"./color\";\r\n\r\n/**\r\n * Gets a set of identicon color candidates for a specified hue and config.\r\n * @param {number} hue\r\n * @param {import(\"../common/configuration\").ParsedConfiguration} config\r\n */\r\nexport function colorTheme(hue, config) {\r\n hue = config.hue(hue);\r\n return [\r\n // Dark gray\r\n correctedHsl(hue, config.grayscaleSaturation, config.grayscaleLightness(0)),\r\n // Mid color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(0.5)),\r\n // Light gray\r\n correctedHsl(hue, config.grayscaleSaturation, config.grayscaleLightness(1)),\r\n // Light color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(1)),\r\n // Dark color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(0))\r\n ];\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { Transform } from \"./transform\";\r\nimport { Graphics } from \"./graphics\";\r\nimport { centerShape, outerShape } from \"./shapes\";\r\nimport { colorTheme } from \"./colorTheme\";\r\nimport { parseHex } from \"../common/parseHex\";\r\nimport { getConfiguration } from \"../common/configuration\";\r\n \r\n/**\r\n * Draws an identicon to a specified renderer.\r\n * @param {import('./renderer').Renderer} renderer\r\n * @param {string} hash\r\n * @param {Object|number=} config\r\n */\r\nexport function iconGenerator(renderer, hash, config) {\r\n const parsedConfig = getConfiguration(config, 0.08);\r\n\r\n // Set background color\r\n if (parsedConfig.backColor) {\r\n renderer.setBackground(parsedConfig.backColor);\r\n }\r\n \r\n // Calculate padding and round to nearest integer\r\n let size = renderer.iconSize;\r\n const padding = (0.5 + size * parsedConfig.iconPadding) | 0;\r\n size -= padding * 2;\r\n \r\n const graphics = new Graphics(renderer);\r\n \r\n // Calculate cell size and ensure it is an integer\r\n const cell = 0 | (size / 4);\r\n \r\n // Since the cell size is integer based, the actual icon will be slightly smaller than specified => center icon\r\n const x = 0 | (padding + size / 2 - cell * 2);\r\n const y = 0 | (padding + size / 2 - cell * 2);\r\n\r\n function renderShape(colorIndex, shapes, index, rotationIndex, positions) {\r\n const shapeIndex = parseHex(hash, index, 1);\r\n let r = rotationIndex ? parseHex(hash, rotationIndex, 1) : 0;\r\n \r\n renderer.beginShape(availableColors[selectedColorIndexes[colorIndex]]);\r\n \r\n for (let i = 0; i < positions.length; i++) {\r\n graphics.currentTransform = new Transform(x + positions[i][0] * cell, y + positions[i][1] * cell, cell, r++ % 4);\r\n shapes(shapeIndex, graphics, cell, i);\r\n }\r\n \r\n renderer.endShape();\r\n }\r\n\r\n // AVAILABLE COLORS\r\n const hue = parseHex(hash, -7) / 0xfffffff,\r\n \r\n // Available colors for this icon\r\n availableColors = colorTheme(hue, parsedConfig),\r\n\r\n // The index of the selected colors\r\n selectedColorIndexes = [];\r\n\r\n let index;\r\n\r\n function isDuplicate(values) {\r\n if (values.indexOf(index) >= 0) {\r\n for (let i = 0; i < values.length; i++) {\r\n if (selectedColorIndexes.indexOf(values[i]) >= 0) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n for (let i = 0; i < 3; i++) {\r\n index = parseHex(hash, 8 + i, 1) % availableColors.length;\r\n if (isDuplicate([0, 4]) || // Disallow dark gray and dark color combo\r\n isDuplicate([2, 3])) { // Disallow light gray and light color combo\r\n index = 1;\r\n }\r\n selectedColorIndexes.push(index);\r\n }\r\n\r\n // ACTUAL RENDERING\r\n // Sides\r\n renderShape(0, outerShape, 2, 3, [[1, 0], [2, 0], [2, 3], [1, 3], [0, 1], [3, 1], [3, 2], [0, 2]]);\r\n // Corners\r\n renderShape(1, outerShape, 4, 5, [[0, 0], [3, 0], [3, 3], [0, 3]]);\r\n // Center\r\n renderShape(2, centerShape, 1, null, [[1, 1], [2, 1], [2, 2], [1, 2]]);\r\n \r\n renderer.finish();\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Computes a SHA1 hash for any value and returns it as a hexadecimal string.\r\n * \r\n * This function is optimized for minimal code size and rather short messages.\r\n * \r\n * @param {string} message \r\n */\r\nexport function sha1(message) {\r\n const HASH_SIZE_HALF_BYTES = 40;\r\n const BLOCK_SIZE_WORDS = 16;\r\n\r\n // Variables\r\n // `var` is used to be able to minimize the number of `var` keywords.\r\n var i = 0,\r\n f = 0,\r\n \r\n // Use `encodeURI` to UTF8 encode the message without any additional libraries\r\n // We could use `unescape` + `encodeURI` to minimize the code, but that would be slightly risky\r\n // since `unescape` is deprecated.\r\n urlEncodedMessage = encodeURI(message) + \"%80\", // trailing '1' bit padding\r\n \r\n // This can be changed to a preallocated Uint32Array array for greater performance and larger code size\r\n data = [],\r\n dataSize,\r\n \r\n hashBuffer = [],\r\n\r\n a = 0x67452301,\r\n b = 0xefcdab89,\r\n c = ~a,\r\n d = ~b,\r\n e = 0xc3d2e1f0,\r\n hash = [a, b, c, d, e],\r\n\r\n blockStartIndex = 0,\r\n hexHash = \"\";\r\n\r\n /**\r\n * Rotates the value a specified number of bits to the left.\r\n * @param {number} value Value to rotate\r\n * @param {number} shift Bit count to shift.\r\n */\r\n function rotl(value, shift) {\r\n return (value << shift) | (value >>> (32 - shift));\r\n }\r\n\r\n // Message data\r\n for ( ; i < urlEncodedMessage.length; f++) {\r\n data[f >> 2] = data[f >> 2] |\r\n (\r\n (\r\n urlEncodedMessage[i] == \"%\"\r\n // Percent encoded byte\r\n ? parseInt(urlEncodedMessage.substring(i + 1, i += 3), 16)\r\n // Unencoded byte\r\n : urlEncodedMessage.charCodeAt(i++)\r\n )\r\n\r\n // Read bytes in reverse order (big endian words)\r\n << ((3 - (f & 3)) * 8)\r\n );\r\n }\r\n\r\n // f is now the length of the utf8 encoded message\r\n // 7 = 8 bytes (64 bit) for message size, -1 to round down\r\n // >> 6 = integer division with block size\r\n dataSize = (((f + 7) >> 6) + 1) * BLOCK_SIZE_WORDS;\r\n\r\n // Message size in bits.\r\n // SHA1 uses a 64 bit integer to represent the size, but since we only support short messages only the least\r\n // significant 32 bits are set. -8 is for the '1' bit padding byte.\r\n data[dataSize - 1] = f * 8 - 8;\r\n \r\n // Compute hash\r\n for ( ; blockStartIndex < dataSize; blockStartIndex += BLOCK_SIZE_WORDS) {\r\n for (i = 0; i < 80; i++) {\r\n f = rotl(a, 5) + e + (\r\n // Ch\r\n i < 20 ? ((b & c) ^ ((~b) & d)) + 0x5a827999 :\r\n \r\n // Parity\r\n i < 40 ? (b ^ c ^ d) + 0x6ed9eba1 :\r\n \r\n // Maj\r\n i < 60 ? ((b & c) ^ (b & d) ^ (c & d)) + 0x8f1bbcdc :\r\n \r\n // Parity\r\n (b ^ c ^ d) + 0xca62c1d6\r\n ) + ( \r\n hashBuffer[i] = i < BLOCK_SIZE_WORDS\r\n // Bitwise OR is used to coerse `undefined` to 0\r\n ? (data[blockStartIndex + i] | 0)\r\n : rotl(hashBuffer[i - 3] ^ hashBuffer[i - 8] ^ hashBuffer[i - 14] ^ hashBuffer[i - 16], 1)\r\n );\r\n\r\n e = d;\r\n d = c;\r\n c = rotl(b, 30);\r\n b = a;\r\n a = f;\r\n }\r\n\r\n hash[0] = a = ((hash[0] + a) | 0);\r\n hash[1] = b = ((hash[1] + b) | 0);\r\n hash[2] = c = ((hash[2] + c) | 0);\r\n hash[3] = d = ((hash[3] + d) | 0);\r\n hash[4] = e = ((hash[4] + e) | 0);\r\n }\r\n\r\n // Format hex hash\r\n for (i = 0; i < HASH_SIZE_HALF_BYTES; i++) {\r\n hexHash += (\r\n (\r\n // Get word (2^3 half-bytes per word)\r\n hash[i >> 3] >>>\r\n\r\n // Append half-bytes in reverse order\r\n ((7 - (i & 7)) * 4)\r\n ) \r\n // Clamp to half-byte\r\n & 0xf\r\n ).toString(16);\r\n }\r\n\r\n return hexHash;\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { sha1 } from \"./sha1\";\r\n\r\n/**\r\n * Inputs a value that might be a valid hash string for Jdenticon and returns it \r\n * if it is determined valid, otherwise a falsy value is returned.\r\n */\r\nexport function isValidHash(hashCandidate) {\r\n return /^[0-9a-f]{11,}$/i.test(hashCandidate) && hashCandidate;\r\n}\r\n\r\n/**\r\n * Computes a hash for the specified value. Currently SHA1 is used. This function\r\n * always returns a valid hash.\r\n */\r\nexport function computeHash(value) {\r\n return sha1(value == null ? \"\" : \"\" + value);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { toCss3Color } from \"../color\";\r\n\r\n/**\r\n * @typedef {import(\"../renderer\").Renderer} Renderer\r\n * @typedef {import('../point').Point} Point\r\n */\r\n\r\n/**\r\n * Renderer redirecting drawing commands to a canvas context.\r\n * @implements {Renderer}\r\n */\r\nexport class CanvasRenderer {\r\n /**\r\n * @param {number=} iconSize\r\n */\r\n constructor(ctx, iconSize) {\r\n const canvas = ctx.canvas; \r\n const width = canvas.width;\r\n const height = canvas.height;\r\n \r\n ctx.save();\r\n \r\n if (!iconSize) {\r\n iconSize = Math.min(width, height);\r\n \r\n ctx.translate(\r\n ((width - iconSize) / 2) | 0,\r\n ((height - iconSize) / 2) | 0);\r\n }\r\n\r\n /**\r\n * @private\r\n */\r\n this._ctx = ctx;\r\n this.iconSize = iconSize;\r\n \r\n ctx.clearRect(0, 0, iconSize, iconSize);\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb[aa].\r\n */\r\n setBackground(fillColor) {\r\n const ctx = this._ctx;\r\n const iconSize = this.iconSize;\r\n\r\n ctx.fillStyle = toCss3Color(fillColor);\r\n ctx.fillRect(0, 0, iconSize, iconSize);\r\n }\r\n\r\n /**\r\n * Marks the beginning of a new shape of the specified color. Should be ended with a call to endShape.\r\n * @param {string} fillColor Fill color on format #rrggbb[aa].\r\n */\r\n beginShape(fillColor) {\r\n const ctx = this._ctx;\r\n ctx.fillStyle = toCss3Color(fillColor);\r\n ctx.beginPath();\r\n }\r\n\r\n /**\r\n * Marks the end of the currently drawn shape. This causes the queued paths to be rendered on the canvas.\r\n */\r\n endShape() {\r\n this._ctx.fill();\r\n }\r\n\r\n /**\r\n * Adds a polygon to the rendering queue.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n const ctx = this._ctx;\r\n ctx.moveTo(points[0].x, points[0].y);\r\n for (let i = 1; i < points.length; i++) {\r\n ctx.lineTo(points[i].x, points[i].y);\r\n }\r\n ctx.closePath();\r\n }\r\n\r\n /**\r\n * Adds a circle to the rendering queue.\r\n * @param {Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n const ctx = this._ctx,\r\n radius = diameter / 2;\r\n ctx.moveTo(point.x + radius, point.y + radius);\r\n ctx.arc(point.x + radius, point.y + radius, radius, 0, Math.PI * 2, counterClockwise);\r\n ctx.closePath();\r\n }\r\n\r\n /**\r\n * Called when the icon has been completely drawn.\r\n */\r\n finish() {\r\n this._ctx.restore();\r\n }\r\n}\r\n","\r\nvar CanvasRenderer__prototype = CanvasRenderer.prototype;","import { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { CanvasRenderer } from \"../renderer/canvas/canvasRenderer\";\r\n\r\n/**\r\n * Draws an identicon to a context.\r\n * @param {CanvasRenderingContext2D} ctx - Canvas context on which the icon will be drawn at location (0, 0).\r\n * @param {*} hashOrValue - A hexadecimal hash string or any value that will be hashed by Jdenticon.\r\n * @param {number} size - Icon size in pixels.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compatibility a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function drawIcon(ctx, hashOrValue, size, config) {\r\n if (!ctx) {\r\n throw new Error(\"No canvas specified.\");\r\n }\r\n \r\n iconGenerator(new CanvasRenderer(ctx, size), \r\n isValidHash(hashOrValue) || computeHash(hashOrValue), \r\n config);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Prepares a measure to be used as a measure in an SVG path, by\r\n * rounding the measure to a single decimal. This reduces the file\r\n * size of the generated SVG with more than 50% in some cases.\r\n */\r\nfunction svgValue(value) {\r\n return ((value * 10 + 0.5) | 0) / 10;\r\n}\r\n\r\n/**\r\n * Represents an SVG path element.\r\n */\r\nexport class SvgPath {\r\n constructor() {\r\n /**\r\n * This property holds the data string (path.d) of the SVG path.\r\n * @type {string}\r\n */\r\n this.dataString = \"\";\r\n }\r\n\r\n /**\r\n * Adds a polygon with the current fill color to the SVG path.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n let dataString = \"\";\r\n for (let i = 0; i < points.length; i++) {\r\n dataString += (i ? \"L\" : \"M\") + svgValue(points[i].x) + \" \" + svgValue(points[i].y);\r\n }\r\n this.dataString += dataString + \"Z\";\r\n }\r\n\r\n /**\r\n * Adds a circle with the current fill color to the SVG path.\r\n * @param {import('../point').Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n const sweepFlag = counterClockwise ? 0 : 1,\r\n svgRadius = svgValue(diameter / 2),\r\n svgDiameter = svgValue(diameter),\r\n svgArc = \"a\" + svgRadius + \",\" + svgRadius + \" 0 1,\" + sweepFlag + \" \";\r\n \r\n this.dataString += \r\n \"M\" + svgValue(point.x) + \" \" + svgValue(point.y + diameter / 2) +\r\n svgArc + svgDiameter + \",0\" + \r\n svgArc + (-svgDiameter) + \",0\";\r\n }\r\n}\r\n\r\n","\r\nvar SvgPath__prototype = SvgPath.prototype;","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { SvgPath } from \"./svgPath\";\r\nimport { parseHex } from \"../../common/parseHex\";\r\n\r\n/**\r\n * @typedef {import(\"../point\").Point} Point\r\n * @typedef {import(\"../renderer\").Renderer} Renderer\r\n * @typedef {import(\"./svgElement\").SvgElement} SvgElement\r\n * @typedef {import(\"./svgWriter\").SvgWriter} SvgWriter\r\n */\r\n\r\n/**\r\n * Renderer producing SVG output.\r\n * @implements {Renderer}\r\n */\r\nexport class SvgRenderer {\r\n /**\r\n * @param {SvgElement|SvgWriter} target \r\n */\r\n constructor(target) {\r\n /**\r\n * @type {SvgPath}\r\n * @private\r\n */\r\n this._path;\r\n\r\n /**\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._pathsByColor = { };\r\n\r\n /**\r\n * @type {SvgElement|SvgWriter}\r\n * @private\r\n */\r\n this._target = target;\r\n\r\n /**\r\n * @type {number}\r\n */\r\n this.iconSize = target.iconSize;\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb[aa].\r\n */\r\n setBackground(fillColor) {\r\n const match = /^(#......)(..)?/.exec(fillColor),\r\n opacity = match[2] ? parseHex(match[2], 0) / 255 : 1;\r\n this._target.setBackground(match[1], opacity);\r\n }\r\n\r\n /**\r\n * Marks the beginning of a new shape of the specified color. Should be ended with a call to endShape.\r\n * @param {string} color Fill color on format #xxxxxx.\r\n */\r\n beginShape(color) {\r\n this._path = this._pathsByColor[color] || (this._pathsByColor[color] = new SvgPath());\r\n }\r\n\r\n /**\r\n * Marks the end of the currently drawn shape.\r\n */\r\n endShape() { }\r\n\r\n /**\r\n * Adds a polygon with the current fill color to the SVG.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n this._path.addPolygon(points);\r\n }\r\n\r\n /**\r\n * Adds a circle with the current fill color to the SVG.\r\n * @param {Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n this._path.addCircle(point, diameter, counterClockwise);\r\n }\r\n\r\n /**\r\n * Called when the icon has been completely drawn.\r\n */\r\n finish() { \r\n const pathsByColor = this._pathsByColor;\r\n for (let color in pathsByColor) {\r\n // hasOwnProperty cannot be shadowed in pathsByColor\r\n // eslint-disable-next-line no-prototype-builtins\r\n if (pathsByColor.hasOwnProperty(color)) {\r\n this._target.appendPath(color, pathsByColor[color].dataString);\r\n }\r\n }\r\n }\r\n}\r\n","\r\nvar SvgRenderer__prototype = SvgRenderer.prototype;","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nexport const SVG_CONSTANTS = {\r\n XMLNS: \"http://www.w3.org/2000/svg\",\r\n WIDTH: \"width\",\r\n HEIGHT: \"height\",\r\n}","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { SVG_CONSTANTS } from \"./constants\";\r\n\r\n/**\r\n * Renderer producing SVG output.\r\n */\r\nexport class SvgWriter {\r\n /**\r\n * @param {number} iconSize - Icon width and height in pixels.\r\n */\r\n constructor(iconSize) {\r\n /**\r\n * @type {number}\r\n */\r\n this.iconSize = iconSize;\r\n\r\n /**\r\n * @type {string}\r\n * @private\r\n */\r\n this._s =\r\n '';\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb.\r\n * @param {number} opacity Opacity in the range [0.0, 1.0].\r\n */\r\n setBackground(fillColor, opacity) {\r\n if (opacity) {\r\n this._s += '';\r\n }\r\n }\r\n\r\n /**\r\n * Writes a path to the SVG string.\r\n * @param {string} color Fill color on format #rrggbb.\r\n * @param {string} dataString The SVG path data string.\r\n */\r\n appendPath(color, dataString) {\r\n this._s += '';\r\n }\r\n\r\n /**\r\n * Gets the rendered image as an SVG string.\r\n */\r\n toString() {\r\n return this._s + \"\";\r\n }\r\n}\r\n","\r\nvar SvgWriter__prototype = SvgWriter.prototype;","import { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { SvgRenderer } from \"../renderer/svg/svgRenderer\";\r\nimport { SvgWriter } from \"../renderer/svg/svgWriter\";\r\n\r\n/**\r\n * Draws an identicon as an SVG string.\r\n * @param {*} hashOrValue - A hexadecimal hash string or any value that will be hashed by Jdenticon.\r\n * @param {number} size - Icon size in pixels.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compatibility a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n * @returns {string} SVG string\r\n */\r\nexport function toSvg(hashOrValue, size, config) {\r\n const writer = new SvgWriter(size);\r\n iconGenerator(new SvgRenderer(writer), \r\n isValidHash(hashOrValue) || computeHash(hashOrValue),\r\n config);\r\n return writer.toString();\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nexport const ICON_TYPE_SVG = 1;\r\n\r\nexport const ICON_TYPE_CANVAS = 2;\r\n\r\nexport const ATTRIBUTES = {\r\n HASH: \"data-jdenticon-hash\",\r\n VALUE: \"data-jdenticon-value\"\r\n};\r\n\r\nexport const ICON_SELECTOR = \"[\" + ATTRIBUTES.HASH +\"],[\" + ATTRIBUTES.VALUE +\"]\";\r\n\r\nexport const documentQuerySelectorAll = /** @type {!Function} */ (\r\n typeof document !== \"undefined\" && document.querySelectorAll.bind(document));\r\n\r\nexport function getIdenticonType(el) {\r\n if (el) {\r\n const tagName = el[\"tagName\"];\r\n\r\n if (/^svg$/i.test(tagName)) {\r\n return ICON_TYPE_SVG;\r\n }\r\n\r\n if (/^canvas$/i.test(tagName) && \"getContext\" in el) {\r\n return ICON_TYPE_CANVAS;\r\n }\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { SVG_CONSTANTS } from \"./constants\";\r\n\r\n/**\r\n * Creates a new element and adds it to the specified parent.\r\n * @param {Element} parentNode\r\n * @param {string} name\r\n * @param {...(string|number)} keyValuePairs\r\n */\r\nfunction SvgElement_append(parentNode, name, ...keyValuePairs) {\r\n const el = document.createElementNS(SVG_CONSTANTS.XMLNS, name);\r\n \r\n for (let i = 0; i + 1 < keyValuePairs.length; i += 2) {\r\n el.setAttribute(\r\n /** @type {string} */(keyValuePairs[i]),\r\n /** @type {string} */(keyValuePairs[i + 1]),\r\n );\r\n }\r\n\r\n parentNode.appendChild(el);\r\n}\r\n\r\n\r\n/**\r\n * Renderer producing SVG output.\r\n */\r\nexport class SvgElement {\r\n /**\r\n * @param {Element} element - Target element\r\n */\r\n constructor(element) {\r\n // Don't use the clientWidth and clientHeight properties on SVG elements\r\n // since Firefox won't serve a proper value of these properties on SVG\r\n // elements (https://bugzilla.mozilla.org/show_bug.cgi?id=874811)\r\n // Instead use 100px as a hardcoded size (the svg viewBox will rescale \r\n // the icon to the correct dimensions)\r\n const iconSize = this.iconSize = Math.min(\r\n (Number(element.getAttribute(SVG_CONSTANTS.WIDTH)) || 100),\r\n (Number(element.getAttribute(SVG_CONSTANTS.HEIGHT)) || 100)\r\n );\r\n \r\n /**\r\n * @type {Element}\r\n * @private\r\n */\r\n this._el = element;\r\n \r\n // Clear current SVG child elements\r\n while (element.firstChild) {\r\n element.removeChild(element.firstChild);\r\n }\r\n \r\n // Set viewBox attribute to ensure the svg scales nicely.\r\n element.setAttribute(\"viewBox\", \"0 0 \" + iconSize + \" \" + iconSize);\r\n element.setAttribute(\"preserveAspectRatio\", \"xMidYMid meet\");\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb.\r\n * @param {number} opacity Opacity in the range [0.0, 1.0].\r\n */\r\n setBackground(fillColor, opacity) {\r\n if (opacity) {\r\n SvgElement_append(this._el, \"rect\",\r\n SVG_CONSTANTS.WIDTH, \"100%\",\r\n SVG_CONSTANTS.HEIGHT, \"100%\",\r\n \"fill\", fillColor,\r\n \"opacity\", opacity);\r\n }\r\n }\r\n\r\n /**\r\n * Appends a path to the SVG element.\r\n * @param {string} color Fill color on format #xxxxxx.\r\n * @param {string} dataString The SVG path data string.\r\n */\r\n appendPath(color, dataString) {\r\n SvgElement_append(this._el, \"path\",\r\n \"fill\", color,\r\n \"d\", dataString);\r\n }\r\n}\r\n","\r\nvar SvgElement__prototype = SvgElement.prototype;","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { ATTRIBUTES, ICON_SELECTOR, documentQuerySelectorAll } from \"../common/dom\";\r\nimport { SvgRenderer } from \"../renderer/svg/svgRenderer\";\r\nimport { SvgElement } from \"../renderer/svg/svgElement\";\r\nimport { CanvasRenderer } from \"../renderer/canvas/canvasRenderer\";\r\nimport { ICON_TYPE_CANVAS, ICON_TYPE_SVG, getIdenticonType } from \"../common/dom\";\r\n\r\n\r\n/**\r\n * Updates all canvas elements with the `data-jdenticon-hash` or `data-jdenticon-value` attribute.\r\n */\r\nexport function updateAll() {\r\n if (documentQuerySelectorAll) {\r\n update(ICON_SELECTOR);\r\n }\r\n}\r\n\r\n/**\r\n * Updates the identicon in the specified `` or `` elements.\r\n * @param {(string|Element)} el - Specifies the container in which the icon is rendered as a DOM element of the type\r\n * `` or ``, or a CSS selector to such an element.\r\n * @param {*=} hashOrValue - Optional hash or value to be rendered. If not specified, the `data-jdenticon-hash` or\r\n * `data-jdenticon-value` attribute will be evaluated.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compability a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function update(el, hashOrValue, config) {\r\n renderDomElement(el, hashOrValue, config, function (el, iconType) {\r\n if (iconType) {\r\n return iconType == ICON_TYPE_SVG ? \r\n new SvgRenderer(new SvgElement(el)) : \r\n new CanvasRenderer(/** @type {HTMLCanvasElement} */(el).getContext(\"2d\"));\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Updates the identicon in the specified `` elements.\r\n * @param {(string|Element)} el - Specifies the container in which the icon is rendered as a DOM element of the type\r\n * ``, or a CSS selector to such an element.\r\n * @param {*=} hashOrValue - Optional hash or value to be rendered. If not specified, the `data-jdenticon-hash` or\r\n * `data-jdenticon-value` attribute will be evaluated.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compability a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function updateCanvas(el, hashOrValue, config) {\r\n renderDomElement(el, hashOrValue, config, function (el, iconType) {\r\n if (iconType == ICON_TYPE_CANVAS) {\r\n return new CanvasRenderer(/** @type {HTMLCanvasElement} */(el).getContext(\"2d\"));\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Updates the identicon in the specified `` elements.\r\n * @param {(string|Element)} el - Specifies the container in which the icon is rendered as a DOM element of the type\r\n * ``, or a CSS selector to such an element.\r\n * @param {*=} hashOrValue - Optional hash or value to be rendered. If not specified, the `data-jdenticon-hash` or\r\n * `data-jdenticon-value` attribute will be evaluated.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compability a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function updateSvg(el, hashOrValue, config) {\r\n renderDomElement(el, hashOrValue, config, function (el, iconType) {\r\n if (iconType == ICON_TYPE_SVG) {\r\n return new SvgRenderer(new SvgElement(el));\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Updates the identicon in the specified canvas or svg elements.\r\n * @param {(string|Element)} el - Specifies the container in which the icon is rendered as a DOM element of the type\r\n * `` or ``, or a CSS selector to such an element.\r\n * @param {*} hashOrValue - Optional hash or value to be rendered. If not specified, the `data-jdenticon-hash` or\r\n * `data-jdenticon-value` attribute will be evaluated.\r\n * @param {Object|number|undefined} config\r\n * @param {function(Element,number):import(\"../renderer/renderer\").Renderer} rendererFactory - Factory function for creating an icon renderer.\r\n */\r\nfunction renderDomElement(el, hashOrValue, config, rendererFactory) {\r\n if (typeof el === \"string\") {\r\n if (documentQuerySelectorAll) {\r\n const elements = documentQuerySelectorAll(el);\r\n for (let i = 0; i < elements.length; i++) {\r\n renderDomElement(elements[i], hashOrValue, config, rendererFactory);\r\n }\r\n }\r\n return;\r\n }\r\n \r\n // Hash selection. The result from getValidHash or computeHash is \r\n // accepted as a valid hash.\r\n const hash = \r\n // 1. Explicit valid hash\r\n isValidHash(hashOrValue) ||\r\n \r\n // 2. Explicit value (`!= null` catches both null and undefined)\r\n hashOrValue != null && computeHash(hashOrValue) ||\r\n \r\n // 3. `data-jdenticon-hash` attribute\r\n isValidHash(el.getAttribute(ATTRIBUTES.HASH)) ||\r\n \r\n // 4. `data-jdenticon-value` attribute. \r\n // We want to treat an empty attribute as an empty value. \r\n // Some browsers return empty string even if the attribute \r\n // is not specified, so use hasAttribute to determine if \r\n // the attribute is specified.\r\n el.hasAttribute(ATTRIBUTES.VALUE) && computeHash(el.getAttribute(ATTRIBUTES.VALUE));\r\n \r\n if (!hash) {\r\n // No hash specified. Don't render an icon.\r\n return;\r\n }\r\n \r\n const renderer = rendererFactory(el, getIdenticonType(el));\r\n if (renderer) {\r\n // Draw icon\r\n iconGenerator(renderer, hash, config);\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n// This file is compiled to dist/jdenticon-module.js\r\n\r\nimport { defineConfigProperty } from \"./common/configuration\";\r\nimport { configure } from \"./apis/configure\";\r\nimport { drawIcon } from \"./apis/drawIcon\";\r\nimport { toSvg } from \"./apis/toSvg\";\r\nimport { update, updateAll, updateCanvas, updateSvg } from \"./apis/update\";\r\n\r\nconst jdenticon = updateAll;\r\n\r\ndefineConfigProperty(jdenticon);\r\n\r\n// Export public API\r\njdenticon[\"configure\"] = configure;\r\njdenticon[\"drawIcon\"] = drawIcon;\r\njdenticon[\"toSvg\"] = toSvg;\r\njdenticon[\"update\"] = update;\r\njdenticon[\"updateCanvas\"] = updateCanvas;\r\njdenticon[\"updateSvg\"] = updateSvg;\r\n\r\n/**\r\n * Specifies the version of the Jdenticon package in use.\r\n * @type {string}\r\n */\r\njdenticon[\"version\"] = \"#version#\";\r\n\r\n/**\r\n * Specifies which bundle of Jdenticon that is used.\r\n * @type {string}\r\n */\r\njdenticon[\"bundle\"] = \"browser-cjs\";\r\n\r\nmodule.exports = jdenticon;","\n//# sourceMappingURL=jdenticon-module.js.map\n"]} \ No newline at end of file diff --git a/dist/jdenticon-module.mjs b/dist/jdenticon-module.mjs index 9a2312d..6e41a96 100644 --- a/dist/jdenticon-module.mjs +++ b/dist/jdenticon-module.mjs @@ -1,8 +1,8 @@ /** - * Jdenticon 3.1.0 + * Jdenticon 3.1.1 * http://jdenticon.com * - * Built: 2020-12-12T13:51:48.709Z + * Built: 2021-08-14T17:50:52.207Z * * MIT License * @@ -1379,7 +1379,7 @@ function renderDomElement(el, hashOrValue, config, rendererFactory) { * Specifies the version of the Jdenticon package in use. * @type {string} */ -const version = "3.1.0"; +const version = "3.1.1"; /** * Specifies which bundle of Jdenticon that is used. diff --git a/dist/jdenticon-module.mjs.map b/dist/jdenticon-module.mjs.map index 4868188..09161c5 100644 --- a/dist/jdenticon-module.mjs.map +++ b/dist/jdenticon-module.mjs.map @@ -1 +1 @@ -{"version":3,"sources":["replacement/1","src/common/parseHex.js","src/renderer/color.js","src/common/global.js","src/common/configuration.js","src/renderer/point.js","src/renderer/transform.js","src/renderer/graphics.js","src/renderer/shapes.js","src/renderer/colorTheme.js","src/renderer/iconGenerator.js","src/common/sha1.js","src/common/hashUtils.js","src/renderer/canvas/canvasRenderer.js","src/apis/drawIcon.js","src/renderer/svg/svgPath.js","src/renderer/svg/svgRenderer.js","src/renderer/svg/constants.js","src/renderer/svg/svgWriter.js","src/apis/toSvg.js","src/common/dom.js","src/renderer/svg/svgElement.js","src/apis/update.js","src/browser-esm.js","replacement/2"],"names":["GLOBAL","MODULE","hue","colorSaturation","grayscaleSaturation","colorLightness","grayscaleLightness","backColor","iconPadding","_x","_y","_size","_rotation","transformIconPoint","_renderer","currentTransform","addPolygon","addCircle","addRectangle","addTriangle","addRhombus","setBackground","iconSize","beginShape","endShape","_ctx","dataString","_path","_pathsByColor","_target","appendPath","XMLNS","WIDTH","HEIGHT","_s","HASH","VALUE","_el"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACtBA;AACA;AACA;AACA;AACA;AACO,SAAS,QAAQ,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE;AACtD,IAAI,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;AAC5D;;ACLA,SAAS,QAAQ,CAAC,CAAC,EAAE;AACrB,IAAI,CAAC,IAAI,CAAC,CAAC;AACX,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI;AACvB,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;AACrC,QAAQ,CAAC,GAAG,GAAG,GAAG,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;AACA;AACA,QAAQ,WAAW,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAACF,SAAI,CAAC,CAAC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,EAAE,CAAC,YAAY,CAAC,UAAU,CAACC,UAAK,CAAC,IAAI,WAAW,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAACA,UAAK,CAAC,CAAC,CAAC;AAC5F;AACA,IAAI,IAAI,CAAC,IAAI,EAAE;AACf;AACA,QAAQ,OAAO;AACf,KAAK;AACL;AACA,IAAI,MAAM,QAAQ,GAAG,eAAe,CAAC,EAAE,EAAE,gBAAgB,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,IAAI,QAAQ,EAAE;AAClB;AACA,QAAQ,aAAa,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAC9C,KAAK;AACL;;AC3HA;AAMA;AACA;AACA;AACA;AACA;AACY,MAAC,OAAO,GAAG,CAAC,KAAS,EAAE;AACnC;AACA;AACA;AACA;AACA;AACY,MAAC,MAAM,GAAG;;;ACtBtB","file":"jdenticon-module.mjs","sourcesContent":["/**\r\n * Jdenticon 3.1.0\r\n * http://jdenticon.com\r\n *\r\n * Built: 2020-12-12T13:51:48.709Z\r\n * \r\n * MIT License\r\n * \r\n * Copyright (c) 2014-2020 Daniel Mester Pirttijärvi\r\n * \r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n * \r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n * \r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n */\r\n\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Parses a substring of the hash as a number.\r\n * @param {number} startPosition \r\n * @param {number=} octets\r\n */\r\nexport function parseHex(hash, startPosition, octets) {\r\n return parseInt(hash.substr(startPosition, octets), 16);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { parseHex } from \"../common/parseHex\";\r\n\r\nfunction decToHex(v) {\r\n v |= 0; // Ensure integer value\r\n return v < 0 ? \"00\" :\r\n v < 16 ? \"0\" + v.toString(16) :\r\n v < 256 ? v.toString(16) :\r\n \"ff\";\r\n}\r\n\r\nfunction hueToRgb(m1, m2, h) {\r\n h = h < 0 ? h + 6 : h > 6 ? h - 6 : h;\r\n return decToHex(255 * (\r\n h < 1 ? m1 + (m2 - m1) * h :\r\n h < 3 ? m2 :\r\n h < 4 ? m1 + (m2 - m1) * (4 - h) :\r\n m1));\r\n}\r\n\r\n/**\r\n * @param {number} r Red channel [0, 255]\r\n * @param {number} g Green channel [0, 255]\r\n * @param {number} b Blue channel [0, 255]\r\n */\r\nexport function rgb(r, g, b) {\r\n return \"#\" + decToHex(r) + decToHex(g) + decToHex(b);\r\n}\r\n\r\n/**\r\n * @param {string} color Color value to parse. Currently hexadecimal strings on the format #rgb[a] and #rrggbb[aa] are supported.\r\n * @returns {string}\r\n */\r\nexport function parseColor(color) {\r\n if (/^#[0-9a-f]{3,8}$/i.test(color)) {\r\n let result;\r\n const colorLength = color.length;\r\n\r\n if (colorLength < 6) {\r\n const r = color[1],\r\n g = color[2],\r\n b = color[3],\r\n a = color[4] || \"\";\r\n result = \"#\" + r + r + g + g + b + b + a + a;\r\n }\r\n if (colorLength == 7 || colorLength > 8) {\r\n result = color;\r\n }\r\n \r\n return result;\r\n }\r\n}\r\n\r\n/**\r\n * Converts a hexadecimal color to a CSS3 compatible color.\r\n * @param {string} hexColor Color on the format \"#RRGGBB\" or \"#RRGGBBAA\"\r\n * @returns {string}\r\n */\r\nexport function toCss3Color(hexColor) {\r\n const a = parseHex(hexColor, 7, 2);\r\n let result;\r\n\r\n if (isNaN(a)) {\r\n result = hexColor;\r\n } else {\r\n const r = parseHex(hexColor, 1, 2),\r\n g = parseHex(hexColor, 3, 2),\r\n b = parseHex(hexColor, 5, 2);\r\n result = \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + (a / 255).toFixed(2) + \")\";\r\n }\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * Converts an HSL color to a hexadecimal RGB color.\r\n * @param {number} hue Hue in range [0, 1]\r\n * @param {number} saturation Saturation in range [0, 1]\r\n * @param {number} lightness Lightness in range [0, 1]\r\n * @returns {string}\r\n */\r\nexport function hsl(hue, saturation, lightness) {\r\n // Based on http://www.w3.org/TR/2011/REC-css3-color-20110607/#hsl-color\r\n let result;\r\n\r\n if (saturation == 0) {\r\n const partialHex = decToHex(lightness * 255);\r\n result = partialHex + partialHex + partialHex;\r\n }\r\n else {\r\n const m2 = lightness <= 0.5 ? lightness * (saturation + 1) : lightness + saturation - lightness * saturation,\r\n m1 = lightness * 2 - m2;\r\n result =\r\n hueToRgb(m1, m2, hue * 6 + 2) +\r\n hueToRgb(m1, m2, hue * 6) +\r\n hueToRgb(m1, m2, hue * 6 - 2);\r\n }\r\n\r\n return \"#\" + result;\r\n}\r\n\r\n/**\r\n * Converts an HSL color to a hexadecimal RGB color. This function will correct the lightness for the \"dark\" hues\r\n * @param {number} hue Hue in range [0, 1]\r\n * @param {number} saturation Saturation in range [0, 1]\r\n * @param {number} lightness Lightness in range [0, 1]\r\n * @returns {string}\r\n */\r\nexport function correctedHsl(hue, saturation, lightness) {\r\n // The corrector specifies the perceived middle lightness for each hue\r\n const correctors = [ 0.55, 0.5, 0.5, 0.46, 0.6, 0.55, 0.55 ],\r\n corrector = correctors[(hue * 6 + 0.5) | 0];\r\n \r\n // Adjust the input lightness relative to the corrector\r\n lightness = lightness < 0.5 ? lightness * corrector * 2 : corrector + (lightness - 0.5) * (1 - corrector) * 2;\r\n \r\n return hsl(hue, saturation, lightness);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n// In the future we can replace `GLOBAL` with `globalThis`, but for now use the old school global detection for\r\n// backward compatibility.\r\n\r\nexport const GLOBAL = \r\n typeof window !== \"undefined\" ? window :\r\n typeof self !== \"undefined\" ? self :\r\n typeof global !== \"undefined\" ? global :\r\n {};\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { parseColor } from \"../renderer/color\";\r\nimport { GLOBAL } from \"./global\";\r\n\r\n/**\r\n * @typedef {Object} ParsedConfiguration\r\n * @property {number} colorSaturation\r\n * @property {number} grayscaleSaturation\r\n * @property {string} backColor\r\n * @property {number} iconPadding\r\n * @property {function(number):number} hue\r\n * @property {function(number):number} colorLightness\r\n * @property {function(number):number} grayscaleLightness\r\n */\r\n\r\nexport const CONFIG_PROPERTIES = {\r\n GLOBAL: \"jdenticon_config\",\r\n MODULE: \"config\",\r\n};\r\n\r\nvar rootConfigurationHolder = {};\r\n\r\n/**\r\n * Defines the deprecated `config` property on the root Jdenticon object. When the property is set a warning is \r\n * printed in the console. To minimize bundle size, this is only used in Node bundles.\r\n * @param {!Object} rootObject \r\n */\r\nexport function defineConfigPropertyWithWarn(rootObject) {\r\n Object.defineProperty(rootObject, CONFIG_PROPERTIES.MODULE, {\r\n configurable: true,\r\n get: () => rootConfigurationHolder[CONFIG_PROPERTIES.MODULE],\r\n set: newConfiguration => {\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] = newConfiguration;\r\n console.warn(\"jdenticon.config is deprecated. Use jdenticon.configure() instead.\");\r\n },\r\n });\r\n}\r\n\r\n/**\r\n * Defines the deprecated `config` property on the root Jdenticon object without printing a warning in the console\r\n * when it is being used.\r\n * @param {!Object} rootObject \r\n */\r\nexport function defineConfigProperty(rootObject) {\r\n rootConfigurationHolder = rootObject;\r\n}\r\n\r\n/**\r\n * Sets a new icon style configuration. The new configuration is not merged with the previous one. * \r\n * @param {Object} newConfiguration - New configuration object.\r\n */\r\nexport function configure(newConfiguration) {\r\n if (arguments.length) {\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] = newConfiguration;\r\n }\r\n return rootConfigurationHolder[CONFIG_PROPERTIES.MODULE];\r\n}\r\n\r\n/**\r\n * Gets the normalized current Jdenticon color configuration. Missing fields have default values.\r\n * @param {Object|number|undefined} paddingOrLocalConfig - Configuration passed to the called API method. A\r\n * local configuration overrides the global configuration in it entirety. This parameter can for backward\r\n * compatibility also contain a padding value. A padding value only overrides the global padding, not the\r\n * entire global configuration.\r\n * @param {number} defaultPadding - Padding used if no padding is specified in neither the configuration nor\r\n * explicitly to the API method.\r\n * @returns {ParsedConfiguration}\r\n */\r\nexport function getConfiguration(paddingOrLocalConfig, defaultPadding) {\r\n const configObject = \r\n typeof paddingOrLocalConfig == \"object\" && paddingOrLocalConfig ||\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] ||\r\n GLOBAL[CONFIG_PROPERTIES.GLOBAL] ||\r\n { },\r\n\r\n lightnessConfig = configObject[\"lightness\"] || { },\r\n \r\n // In versions < 2.1.0 there was no grayscale saturation -\r\n // saturation was the color saturation.\r\n saturation = configObject[\"saturation\"] || { },\r\n colorSaturation = \"color\" in saturation ? saturation[\"color\"] : saturation,\r\n grayscaleSaturation = saturation[\"grayscale\"],\r\n\r\n backColor = configObject[\"backColor\"],\r\n padding = configObject[\"padding\"];\r\n \r\n /**\r\n * Creates a lightness range.\r\n */\r\n function lightness(configName, defaultRange) {\r\n let range = lightnessConfig[configName];\r\n \r\n // Check if the lightness range is an array-like object. This way we ensure the\r\n // array contain two values at the same time.\r\n if (!(range && range.length > 1)) {\r\n range = defaultRange;\r\n }\r\n\r\n /**\r\n * Gets a lightness relative the specified value in the specified lightness range.\r\n */\r\n return function (value) {\r\n value = range[0] + value * (range[1] - range[0]);\r\n return value < 0 ? 0 : value > 1 ? 1 : value;\r\n };\r\n }\r\n\r\n /**\r\n * Gets a hue allowed by the configured hue restriction,\r\n * provided the originally computed hue.\r\n */\r\n function hueFunction(originalHue) {\r\n const hueConfig = configObject[\"hues\"];\r\n let hue;\r\n \r\n // Check if 'hues' is an array-like object. This way we also ensure that\r\n // the array is not empty, which would mean no hue restriction.\r\n if (hueConfig && hueConfig.length > 0) {\r\n // originalHue is in the range [0, 1]\r\n // Multiply with 0.999 to change the range to [0, 1) and then truncate the index.\r\n hue = hueConfig[0 | (0.999 * originalHue * hueConfig.length)];\r\n }\r\n\r\n return typeof hue == \"number\" ?\r\n \r\n // A hue was specified. We need to convert the hue from\r\n // degrees on any turn - e.g. 746° is a perfectly valid hue -\r\n // to turns in the range [0, 1).\r\n ((((hue / 360) % 1) + 1) % 1) :\r\n\r\n // No hue configured => use original hue\r\n originalHue;\r\n }\r\n \r\n return {\r\n hue: hueFunction,\r\n colorSaturation: typeof colorSaturation == \"number\" ? colorSaturation : 0.5,\r\n grayscaleSaturation: typeof grayscaleSaturation == \"number\" ? grayscaleSaturation : 0,\r\n colorLightness: lightness(\"color\", [0.4, 0.8]),\r\n grayscaleLightness: lightness(\"grayscale\", [0.3, 0.9]),\r\n backColor: parseColor(backColor),\r\n iconPadding: \r\n typeof paddingOrLocalConfig == \"number\" ? paddingOrLocalConfig : \r\n typeof padding == \"number\" ? padding : \r\n defaultPadding\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Represents a point.\r\n */\r\nexport class Point {\r\n /**\r\n * @param {number} x \r\n * @param {number} y \r\n */\r\n constructor(x, y) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { Point } from \"./point\";\r\n\r\n/**\r\n * Translates and rotates a point before being passed on to the canvas context. This was previously done by the canvas context itself, \r\n * but this caused a rendering issue in Chrome on sizes > 256 where the rotation transformation of inverted paths was not done properly.\r\n */\r\nexport class Transform {\r\n /**\r\n * @param {number} x The x-coordinate of the upper left corner of the transformed rectangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the transformed rectangle.\r\n * @param {number} size The size of the transformed rectangle.\r\n * @param {number} rotation Rotation specified as 0 = 0 rad, 1 = 0.5π rad, 2 = π rad, 3 = 1.5π rad\r\n */\r\n constructor(x, y, size, rotation) {\r\n this._x = x;\r\n this._y = y;\r\n this._size = size;\r\n this._rotation = rotation;\r\n }\r\n\r\n /**\r\n * Transforms the specified point based on the translation and rotation specification for this Transform.\r\n * @param {number} x x-coordinate\r\n * @param {number} y y-coordinate\r\n * @param {number=} w The width of the transformed rectangle. If greater than 0, this will ensure the returned point is of the upper left corner of the transformed rectangle.\r\n * @param {number=} h The height of the transformed rectangle. If greater than 0, this will ensure the returned point is of the upper left corner of the transformed rectangle.\r\n */\r\n transformIconPoint(x, y, w, h) {\r\n const right = this._x + this._size,\r\n bottom = this._y + this._size,\r\n rotation = this._rotation;\r\n return rotation === 1 ? new Point(right - y - (h || 0), this._y + x) :\r\n rotation === 2 ? new Point(right - x - (w || 0), bottom - y - (h || 0)) :\r\n rotation === 3 ? new Point(this._x + y, bottom - x - (w || 0)) :\r\n new Point(this._x + x, this._y + y);\r\n }\r\n}\r\n\r\nexport const NO_TRANSFORM = new Transform(0, 0, 0, 0);\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { NO_TRANSFORM } from \"./transform\";\r\n\r\n/**\r\n * @typedef {import(\"./renderer\").Renderer} Renderer\r\n * @typedef {import(\"./transform\").Transform} Transform\r\n */\r\n\r\n/**\r\n * Provides helper functions for rendering common basic shapes.\r\n */\r\nexport class Graphics {\r\n /**\r\n * @param {Renderer} renderer \r\n */\r\n constructor(renderer) {\r\n /**\r\n * @type {Renderer}\r\n * @private\r\n */\r\n this._renderer = renderer;\r\n\r\n /**\r\n * @type {Transform}\r\n */\r\n this.currentTransform = NO_TRANSFORM;\r\n }\r\n\r\n /**\r\n * Adds a polygon to the underlying renderer.\r\n * @param {Array} points The points of the polygon clockwise on the format [ x0, y0, x1, y1, ..., xn, yn ]\r\n * @param {boolean=} invert Specifies if the polygon will be inverted.\r\n */\r\n addPolygon(points, invert) {\r\n const di = invert ? -2 : 2,\r\n transformedPoints = [];\r\n \r\n for (let i = invert ? points.length - 2 : 0; i < points.length && i >= 0; i += di) {\r\n transformedPoints.push(this.currentTransform.transformIconPoint(points[i], points[i + 1]));\r\n }\r\n \r\n this._renderer.addPolygon(transformedPoints);\r\n }\r\n \r\n /**\r\n * Adds a polygon to the underlying renderer.\r\n * Source: http://stackoverflow.com/a/2173084\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the entire ellipse.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the entire ellipse.\r\n * @param {number} size The size of the ellipse.\r\n * @param {boolean=} invert Specifies if the ellipse will be inverted.\r\n */\r\n addCircle(x, y, size, invert) {\r\n const p = this.currentTransform.transformIconPoint(x, y, size, size);\r\n this._renderer.addCircle(p, size, invert);\r\n }\r\n\r\n /**\r\n * Adds a rectangle to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle.\r\n * @param {number} w The width of the rectangle.\r\n * @param {number} h The height of the rectangle.\r\n * @param {boolean=} invert Specifies if the rectangle will be inverted.\r\n */\r\n addRectangle(x, y, w, h, invert) {\r\n this.addPolygon([\r\n x, y, \r\n x + w, y,\r\n x + w, y + h,\r\n x, y + h\r\n ], invert);\r\n }\r\n\r\n /**\r\n * Adds a right triangle to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the triangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the triangle.\r\n * @param {number} w The width of the triangle.\r\n * @param {number} h The height of the triangle.\r\n * @param {number} r The rotation of the triangle (clockwise). 0 = right corner of the triangle in the lower left corner of the bounding rectangle.\r\n * @param {boolean=} invert Specifies if the triangle will be inverted.\r\n */\r\n addTriangle(x, y, w, h, r, invert) {\r\n const points = [\r\n x + w, y, \r\n x + w, y + h, \r\n x, y + h,\r\n x, y\r\n ];\r\n points.splice(((r || 0) % 4) * 2, 2);\r\n this.addPolygon(points, invert);\r\n }\r\n\r\n /**\r\n * Adds a rhombus to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the rhombus.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the rhombus.\r\n * @param {number} w The width of the rhombus.\r\n * @param {number} h The height of the rhombus.\r\n * @param {boolean=} invert Specifies if the rhombus will be inverted.\r\n */\r\n addRhombus(x, y, w, h, invert) {\r\n this.addPolygon([\r\n x + w / 2, y,\r\n x + w, y + h / 2,\r\n x + w / 2, y + h,\r\n x, y + h / 2\r\n ], invert);\r\n }\r\n}","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * @param {number} index\r\n * @param {Graphics} g\r\n * @param {number} cell\r\n * @param {number} positionIndex\r\n * @typedef {import('./graphics').Graphics} Graphics\r\n */\r\nexport function centerShape(index, g, cell, positionIndex) {\r\n index = index % 14;\r\n\r\n let k, m, w, h, inner, outer;\r\n\r\n !index ? (\r\n k = cell * 0.42,\r\n g.addPolygon([\r\n 0, 0,\r\n cell, 0,\r\n cell, cell - k * 2,\r\n cell - k, cell,\r\n 0, cell\r\n ])) :\r\n\r\n index == 1 ? (\r\n w = 0 | (cell * 0.5), \r\n h = 0 | (cell * 0.8),\r\n\r\n g.addTriangle(cell - w, 0, w, h, 2)) :\r\n\r\n index == 2 ? (\r\n w = 0 | (cell / 3),\r\n g.addRectangle(w, w, cell - w, cell - w)) :\r\n\r\n index == 3 ? (\r\n inner = cell * 0.1,\r\n // Use fixed outer border widths in small icons to ensure the border is drawn\r\n outer = \r\n cell < 6 ? 1 :\r\n cell < 8 ? 2 :\r\n (0 | (cell * 0.25)),\r\n \r\n inner = \r\n inner > 1 ? (0 | inner) : // large icon => truncate decimals\r\n inner > 0.5 ? 1 : // medium size icon => fixed width\r\n inner, // small icon => anti-aliased border\r\n\r\n g.addRectangle(outer, outer, cell - inner - outer, cell - inner - outer)) :\r\n\r\n index == 4 ? (\r\n m = 0 | (cell * 0.15),\r\n w = 0 | (cell * 0.5),\r\n g.addCircle(cell - w - m, cell - w - m, w)) :\r\n\r\n index == 5 ? (\r\n inner = cell * 0.1,\r\n outer = inner * 4,\r\n\r\n // Align edge to nearest pixel in large icons\r\n outer > 3 && (outer = 0 | outer),\r\n \r\n g.addRectangle(0, 0, cell, cell),\r\n g.addPolygon([\r\n outer, outer,\r\n cell - inner, outer,\r\n outer + (cell - outer - inner) / 2, cell - inner\r\n ], true)) :\r\n\r\n index == 6 ? \r\n g.addPolygon([\r\n 0, 0,\r\n cell, 0,\r\n cell, cell * 0.7,\r\n cell * 0.4, cell * 0.4,\r\n cell * 0.7, cell,\r\n 0, cell\r\n ]) :\r\n\r\n index == 7 ? \r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 3) :\r\n\r\n index == 8 ? (\r\n g.addRectangle(0, 0, cell, cell / 2),\r\n g.addRectangle(0, cell / 2, cell / 2, cell / 2),\r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 1)) :\r\n\r\n index == 9 ? (\r\n inner = cell * 0.14,\r\n // Use fixed outer border widths in small icons to ensure the border is drawn\r\n outer = \r\n cell < 4 ? 1 :\r\n cell < 6 ? 2 :\r\n (0 | (cell * 0.35)),\r\n\r\n inner = \r\n cell < 8 ? inner : // small icon => anti-aliased border\r\n (0 | inner), // large icon => truncate decimals\r\n\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addRectangle(outer, outer, cell - outer - inner, cell - outer - inner, true)) :\r\n\r\n index == 10 ? (\r\n inner = cell * 0.12,\r\n outer = inner * 3,\r\n\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addCircle(outer, outer, cell - inner - outer, true)) :\r\n\r\n index == 11 ? \r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 3) :\r\n\r\n index == 12 ? (\r\n m = cell * 0.25,\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addRhombus(m, m, cell - m, cell - m, true)) :\r\n\r\n // 13\r\n (\r\n !positionIndex && (\r\n m = cell * 0.4, w = cell * 1.2,\r\n g.addCircle(m, m, w)\r\n )\r\n );\r\n}\r\n\r\n/**\r\n * @param {number} index\r\n * @param {Graphics} g\r\n * @param {number} cell\r\n */\r\nexport function outerShape(index, g, cell) {\r\n index = index % 4;\r\n\r\n let m;\r\n\r\n !index ?\r\n g.addTriangle(0, 0, cell, cell, 0) :\r\n \r\n index == 1 ?\r\n g.addTriangle(0, cell / 2, cell, cell / 2, 0) :\r\n\r\n index == 2 ?\r\n g.addRhombus(0, 0, cell, cell) :\r\n\r\n // 3\r\n (\r\n m = cell / 6,\r\n g.addCircle(m, m, cell - 2 * m)\r\n );\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { correctedHsl } from \"./color\";\r\n\r\n/**\r\n * Gets a set of identicon color candidates for a specified hue and config.\r\n * @param {number} hue\r\n * @param {import(\"../common/configuration\").ParsedConfiguration} config\r\n */\r\nexport function colorTheme(hue, config) {\r\n hue = config.hue(hue);\r\n return [\r\n // Dark gray\r\n correctedHsl(hue, config.grayscaleSaturation, config.grayscaleLightness(0)),\r\n // Mid color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(0.5)),\r\n // Light gray\r\n correctedHsl(hue, config.grayscaleSaturation, config.grayscaleLightness(1)),\r\n // Light color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(1)),\r\n // Dark color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(0))\r\n ];\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { Transform } from \"./transform\";\r\nimport { Graphics } from \"./graphics\";\r\nimport { centerShape, outerShape } from \"./shapes\";\r\nimport { colorTheme } from \"./colorTheme\";\r\nimport { parseHex } from \"../common/parseHex\";\r\nimport { getConfiguration } from \"../common/configuration\";\r\n \r\n/**\r\n * Draws an identicon to a specified renderer.\r\n * @param {import('./renderer').Renderer} renderer\r\n * @param {string} hash\r\n * @param {Object|number=} config\r\n */\r\nexport function iconGenerator(renderer, hash, config) {\r\n const parsedConfig = getConfiguration(config, 0.08);\r\n\r\n // Set background color\r\n if (parsedConfig.backColor) {\r\n renderer.setBackground(parsedConfig.backColor);\r\n }\r\n \r\n // Calculate padding and round to nearest integer\r\n let size = renderer.iconSize;\r\n const padding = (0.5 + size * parsedConfig.iconPadding) | 0;\r\n size -= padding * 2;\r\n \r\n const graphics = new Graphics(renderer);\r\n \r\n // Calculate cell size and ensure it is an integer\r\n const cell = 0 | (size / 4);\r\n \r\n // Since the cell size is integer based, the actual icon will be slightly smaller than specified => center icon\r\n const x = 0 | (padding + size / 2 - cell * 2);\r\n const y = 0 | (padding + size / 2 - cell * 2);\r\n\r\n function renderShape(colorIndex, shapes, index, rotationIndex, positions) {\r\n const shapeIndex = parseHex(hash, index, 1);\r\n let r = rotationIndex ? parseHex(hash, rotationIndex, 1) : 0;\r\n \r\n renderer.beginShape(availableColors[selectedColorIndexes[colorIndex]]);\r\n \r\n for (let i = 0; i < positions.length; i++) {\r\n graphics.currentTransform = new Transform(x + positions[i][0] * cell, y + positions[i][1] * cell, cell, r++ % 4);\r\n shapes(shapeIndex, graphics, cell, i);\r\n }\r\n \r\n renderer.endShape();\r\n }\r\n\r\n // AVAILABLE COLORS\r\n const hue = parseHex(hash, -7) / 0xfffffff,\r\n \r\n // Available colors for this icon\r\n availableColors = colorTheme(hue, parsedConfig),\r\n\r\n // The index of the selected colors\r\n selectedColorIndexes = [];\r\n\r\n let index;\r\n\r\n function isDuplicate(values) {\r\n if (values.indexOf(index) >= 0) {\r\n for (let i = 0; i < values.length; i++) {\r\n if (selectedColorIndexes.indexOf(values[i]) >= 0) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n for (let i = 0; i < 3; i++) {\r\n index = parseHex(hash, 8 + i, 1) % availableColors.length;\r\n if (isDuplicate([0, 4]) || // Disallow dark gray and dark color combo\r\n isDuplicate([2, 3])) { // Disallow light gray and light color combo\r\n index = 1;\r\n }\r\n selectedColorIndexes.push(index);\r\n }\r\n\r\n // ACTUAL RENDERING\r\n // Sides\r\n renderShape(0, outerShape, 2, 3, [[1, 0], [2, 0], [2, 3], [1, 3], [0, 1], [3, 1], [3, 2], [0, 2]]);\r\n // Corners\r\n renderShape(1, outerShape, 4, 5, [[0, 0], [3, 0], [3, 3], [0, 3]]);\r\n // Center\r\n renderShape(2, centerShape, 1, null, [[1, 1], [2, 1], [2, 2], [1, 2]]);\r\n \r\n renderer.finish();\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Computes a SHA1 hash for any value and returns it as a hexadecimal string.\r\n * \r\n * This function is optimized for minimal code size and rather short messages.\r\n * \r\n * @param {string} message \r\n */\r\nexport function sha1(message) {\r\n const HASH_SIZE_HALF_BYTES = 40;\r\n const BLOCK_SIZE_WORDS = 16;\r\n\r\n // Variables\r\n // `var` is used to be able to minimize the number of `var` keywords.\r\n var i = 0,\r\n f = 0,\r\n \r\n // Use `encodeURI` to UTF8 encode the message without any additional libraries\r\n // We could use `unescape` + `encodeURI` to minimize the code, but that would be slightly risky\r\n // since `unescape` is deprecated.\r\n urlEncodedMessage = encodeURI(message) + \"%80\", // trailing '1' bit padding\r\n \r\n // This can be changed to a preallocated Uint32Array array for greater performance and larger code size\r\n data = [],\r\n dataSize,\r\n \r\n hashBuffer = [],\r\n\r\n a = 0x67452301,\r\n b = 0xefcdab89,\r\n c = ~a,\r\n d = ~b,\r\n e = 0xc3d2e1f0,\r\n hash = [a, b, c, d, e],\r\n\r\n blockStartIndex = 0,\r\n hexHash = \"\";\r\n\r\n /**\r\n * Rotates the value a specified number of bits to the left.\r\n * @param {number} value Value to rotate\r\n * @param {number} shift Bit count to shift.\r\n */\r\n function rotl(value, shift) {\r\n return (value << shift) | (value >>> (32 - shift));\r\n }\r\n\r\n // Message data\r\n for ( ; i < urlEncodedMessage.length; f++) {\r\n data[f >> 2] = data[f >> 2] |\r\n (\r\n (\r\n urlEncodedMessage[i] == \"%\"\r\n // Percent encoded byte\r\n ? parseInt(urlEncodedMessage.substring(i + 1, i += 3), 16)\r\n // Unencoded byte\r\n : urlEncodedMessage.charCodeAt(i++)\r\n )\r\n\r\n // Read bytes in reverse order (big endian words)\r\n << ((3 - (f & 3)) * 8)\r\n );\r\n }\r\n\r\n // f is now the length of the utf8 encoded message\r\n // 7 = 8 bytes (64 bit) for message size, -1 to round down\r\n // >> 6 = integer division with block size\r\n dataSize = (((f + 7) >> 6) + 1) * BLOCK_SIZE_WORDS;\r\n\r\n // Message size in bits.\r\n // SHA1 uses a 64 bit integer to represent the size, but since we only support short messages only the least\r\n // significant 32 bits are set. -8 is for the '1' bit padding byte.\r\n data[dataSize - 1] = f * 8 - 8;\r\n \r\n // Compute hash\r\n for ( ; blockStartIndex < dataSize; blockStartIndex += BLOCK_SIZE_WORDS) {\r\n for (i = 0; i < 80; i++) {\r\n f = rotl(a, 5) + e + (\r\n // Ch\r\n i < 20 ? ((b & c) ^ ((~b) & d)) + 0x5a827999 :\r\n \r\n // Parity\r\n i < 40 ? (b ^ c ^ d) + 0x6ed9eba1 :\r\n \r\n // Maj\r\n i < 60 ? ((b & c) ^ (b & d) ^ (c & d)) + 0x8f1bbcdc :\r\n \r\n // Parity\r\n (b ^ c ^ d) + 0xca62c1d6\r\n ) + ( \r\n hashBuffer[i] = i < BLOCK_SIZE_WORDS\r\n // Bitwise OR is used to coerse `undefined` to 0\r\n ? (data[blockStartIndex + i] | 0)\r\n : rotl(hashBuffer[i - 3] ^ hashBuffer[i - 8] ^ hashBuffer[i - 14] ^ hashBuffer[i - 16], 1)\r\n );\r\n\r\n e = d;\r\n d = c;\r\n c = rotl(b, 30);\r\n b = a;\r\n a = f;\r\n }\r\n\r\n hash[0] = a = ((hash[0] + a) | 0);\r\n hash[1] = b = ((hash[1] + b) | 0);\r\n hash[2] = c = ((hash[2] + c) | 0);\r\n hash[3] = d = ((hash[3] + d) | 0);\r\n hash[4] = e = ((hash[4] + e) | 0);\r\n }\r\n\r\n // Format hex hash\r\n for (i = 0; i < HASH_SIZE_HALF_BYTES; i++) {\r\n hexHash += (\r\n (\r\n // Get word (2^3 half-bytes per word)\r\n hash[i >> 3] >>>\r\n\r\n // Append half-bytes in reverse order\r\n ((7 - (i & 7)) * 4)\r\n ) \r\n // Clamp to half-byte\r\n & 0xf\r\n ).toString(16);\r\n }\r\n\r\n return hexHash;\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { sha1 } from \"./sha1\";\r\n\r\n/**\r\n * Inputs a value that might be a valid hash string for Jdenticon and returns it \r\n * if it is determined valid, otherwise a falsy value is returned.\r\n */\r\nexport function isValidHash(hashCandidate) {\r\n return /^[0-9a-f]{11,}$/i.test(hashCandidate) && hashCandidate;\r\n}\r\n\r\n/**\r\n * Computes a hash for the specified value. Currently SHA1 is used. This function\r\n * always returns a valid hash.\r\n */\r\nexport function computeHash(value) {\r\n return sha1(value == null ? \"\" : \"\" + value);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { toCss3Color } from \"../color\";\r\n\r\n/**\r\n * @typedef {import(\"../renderer\").Renderer} Renderer\r\n * @typedef {import('../point').Point} Point\r\n */\r\n\r\n/**\r\n * Renderer redirecting drawing commands to a canvas context.\r\n * @implements {Renderer}\r\n */\r\nexport class CanvasRenderer {\r\n /**\r\n * @param {number=} iconSize\r\n */\r\n constructor(ctx, iconSize) {\r\n const canvas = ctx.canvas; \r\n const width = canvas.width;\r\n const height = canvas.height;\r\n \r\n ctx.save();\r\n \r\n if (!iconSize) {\r\n iconSize = Math.min(width, height);\r\n \r\n ctx.translate(\r\n ((width - iconSize) / 2) | 0,\r\n ((height - iconSize) / 2) | 0);\r\n }\r\n\r\n /**\r\n * @private\r\n */\r\n this._ctx = ctx;\r\n this.iconSize = iconSize;\r\n \r\n ctx.clearRect(0, 0, iconSize, iconSize);\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb[aa].\r\n */\r\n setBackground(fillColor) {\r\n const ctx = this._ctx;\r\n const iconSize = this.iconSize;\r\n\r\n ctx.fillStyle = toCss3Color(fillColor);\r\n ctx.fillRect(0, 0, iconSize, iconSize);\r\n }\r\n\r\n /**\r\n * Marks the beginning of a new shape of the specified color. Should be ended with a call to endShape.\r\n * @param {string} fillColor Fill color on format #rrggbb[aa].\r\n */\r\n beginShape(fillColor) {\r\n const ctx = this._ctx;\r\n ctx.fillStyle = toCss3Color(fillColor);\r\n ctx.beginPath();\r\n }\r\n\r\n /**\r\n * Marks the end of the currently drawn shape. This causes the queued paths to be rendered on the canvas.\r\n */\r\n endShape() {\r\n this._ctx.fill();\r\n }\r\n\r\n /**\r\n * Adds a polygon to the rendering queue.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n const ctx = this._ctx;\r\n ctx.moveTo(points[0].x, points[0].y);\r\n for (let i = 1; i < points.length; i++) {\r\n ctx.lineTo(points[i].x, points[i].y);\r\n }\r\n ctx.closePath();\r\n }\r\n\r\n /**\r\n * Adds a circle to the rendering queue.\r\n * @param {Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n const ctx = this._ctx,\r\n radius = diameter / 2;\r\n ctx.moveTo(point.x + radius, point.y + radius);\r\n ctx.arc(point.x + radius, point.y + radius, radius, 0, Math.PI * 2, counterClockwise);\r\n ctx.closePath();\r\n }\r\n\r\n /**\r\n * Called when the icon has been completely drawn.\r\n */\r\n finish() {\r\n this._ctx.restore();\r\n }\r\n}\r\n","import { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { CanvasRenderer } from \"../renderer/canvas/canvasRenderer\";\r\n\r\n/**\r\n * Draws an identicon to a context.\r\n * @param {CanvasRenderingContext2D} ctx - Canvas context on which the icon will be drawn at location (0, 0).\r\n * @param {*} hashOrValue - A hexadecimal hash string or any value that will be hashed by Jdenticon.\r\n * @param {number} size - Icon size in pixels.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compatibility a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function drawIcon(ctx, hashOrValue, size, config) {\r\n if (!ctx) {\r\n throw new Error(\"No canvas specified.\");\r\n }\r\n \r\n iconGenerator(new CanvasRenderer(ctx, size), \r\n isValidHash(hashOrValue) || computeHash(hashOrValue), \r\n config);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Prepares a measure to be used as a measure in an SVG path, by\r\n * rounding the measure to a single decimal. This reduces the file\r\n * size of the generated SVG with more than 50% in some cases.\r\n */\r\nfunction svgValue(value) {\r\n return ((value * 10 + 0.5) | 0) / 10;\r\n}\r\n\r\n/**\r\n * Represents an SVG path element.\r\n */\r\nexport class SvgPath {\r\n constructor() {\r\n /**\r\n * This property holds the data string (path.d) of the SVG path.\r\n * @type {string}\r\n */\r\n this.dataString = \"\";\r\n }\r\n\r\n /**\r\n * Adds a polygon with the current fill color to the SVG path.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n let dataString = \"\";\r\n for (let i = 0; i < points.length; i++) {\r\n dataString += (i ? \"L\" : \"M\") + svgValue(points[i].x) + \" \" + svgValue(points[i].y);\r\n }\r\n this.dataString += dataString + \"Z\";\r\n }\r\n\r\n /**\r\n * Adds a circle with the current fill color to the SVG path.\r\n * @param {import('../point').Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n const sweepFlag = counterClockwise ? 0 : 1,\r\n svgRadius = svgValue(diameter / 2),\r\n svgDiameter = svgValue(diameter),\r\n svgArc = \"a\" + svgRadius + \",\" + svgRadius + \" 0 1,\" + sweepFlag + \" \";\r\n \r\n this.dataString += \r\n \"M\" + svgValue(point.x) + \" \" + svgValue(point.y + diameter / 2) +\r\n svgArc + svgDiameter + \",0\" + \r\n svgArc + (-svgDiameter) + \",0\";\r\n }\r\n}\r\n\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { SvgPath } from \"./svgPath\";\r\nimport { parseHex } from \"../../common/parseHex\";\r\n\r\n/**\r\n * @typedef {import(\"../point\").Point} Point\r\n * @typedef {import(\"../renderer\").Renderer} Renderer\r\n * @typedef {import(\"./svgElement\").SvgElement} SvgElement\r\n * @typedef {import(\"./svgWriter\").SvgWriter} SvgWriter\r\n */\r\n\r\n/**\r\n * Renderer producing SVG output.\r\n * @implements {Renderer}\r\n */\r\nexport class SvgRenderer {\r\n /**\r\n * @param {SvgElement|SvgWriter} target \r\n */\r\n constructor(target) {\r\n /**\r\n * @type {SvgPath}\r\n * @private\r\n */\r\n this._path;\r\n\r\n /**\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._pathsByColor = { };\r\n\r\n /**\r\n * @type {SvgElement|SvgWriter}\r\n * @private\r\n */\r\n this._target = target;\r\n\r\n /**\r\n * @type {number}\r\n */\r\n this.iconSize = target.iconSize;\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb[aa].\r\n */\r\n setBackground(fillColor) {\r\n const match = /^(#......)(..)?/.exec(fillColor),\r\n opacity = match[2] ? parseHex(match[2], 0) / 255 : 1;\r\n this._target.setBackground(match[1], opacity);\r\n }\r\n\r\n /**\r\n * Marks the beginning of a new shape of the specified color. Should be ended with a call to endShape.\r\n * @param {string} color Fill color on format #xxxxxx.\r\n */\r\n beginShape(color) {\r\n this._path = this._pathsByColor[color] || (this._pathsByColor[color] = new SvgPath());\r\n }\r\n\r\n /**\r\n * Marks the end of the currently drawn shape.\r\n */\r\n endShape() { }\r\n\r\n /**\r\n * Adds a polygon with the current fill color to the SVG.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n this._path.addPolygon(points);\r\n }\r\n\r\n /**\r\n * Adds a circle with the current fill color to the SVG.\r\n * @param {Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n this._path.addCircle(point, diameter, counterClockwise);\r\n }\r\n\r\n /**\r\n * Called when the icon has been completely drawn.\r\n */\r\n finish() { \r\n const pathsByColor = this._pathsByColor;\r\n for (let color in pathsByColor) {\r\n // hasOwnProperty cannot be shadowed in pathsByColor\r\n // eslint-disable-next-line no-prototype-builtins\r\n if (pathsByColor.hasOwnProperty(color)) {\r\n this._target.appendPath(color, pathsByColor[color].dataString);\r\n }\r\n }\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nexport const SVG_CONSTANTS = {\r\n XMLNS: \"http://www.w3.org/2000/svg\",\r\n WIDTH: \"width\",\r\n HEIGHT: \"height\",\r\n}","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { SVG_CONSTANTS } from \"./constants\";\r\n\r\n/**\r\n * Renderer producing SVG output.\r\n */\r\nexport class SvgWriter {\r\n /**\r\n * @param {number} iconSize - Icon width and height in pixels.\r\n */\r\n constructor(iconSize) {\r\n /**\r\n * @type {number}\r\n */\r\n this.iconSize = iconSize;\r\n\r\n /**\r\n * @type {string}\r\n * @private\r\n */\r\n this._s =\r\n '';\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb.\r\n * @param {number} opacity Opacity in the range [0.0, 1.0].\r\n */\r\n setBackground(fillColor, opacity) {\r\n if (opacity) {\r\n this._s += '';\r\n }\r\n }\r\n\r\n /**\r\n * Writes a path to the SVG string.\r\n * @param {string} color Fill color on format #rrggbb.\r\n * @param {string} dataString The SVG path data string.\r\n */\r\n appendPath(color, dataString) {\r\n this._s += '';\r\n }\r\n\r\n /**\r\n * Gets the rendered image as an SVG string.\r\n */\r\n toString() {\r\n return this._s + \"\";\r\n }\r\n}\r\n","import { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { SvgRenderer } from \"../renderer/svg/svgRenderer\";\r\nimport { SvgWriter } from \"../renderer/svg/svgWriter\";\r\n\r\n/**\r\n * Draws an identicon as an SVG string.\r\n * @param {*} hashOrValue - A hexadecimal hash string or any value that will be hashed by Jdenticon.\r\n * @param {number} size - Icon size in pixels.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compatibility a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n * @returns {string} SVG string\r\n */\r\nexport function toSvg(hashOrValue, size, config) {\r\n const writer = new SvgWriter(size);\r\n iconGenerator(new SvgRenderer(writer), \r\n isValidHash(hashOrValue) || computeHash(hashOrValue),\r\n config);\r\n return writer.toString();\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nexport const ICON_TYPE_SVG = 1;\r\n\r\nexport const ICON_TYPE_CANVAS = 2;\r\n\r\nexport const ATTRIBUTES = {\r\n HASH: \"data-jdenticon-hash\",\r\n VALUE: \"data-jdenticon-value\"\r\n};\r\n\r\nexport const ICON_SELECTOR = \"[\" + ATTRIBUTES.HASH +\"],[\" + ATTRIBUTES.VALUE +\"]\";\r\n\r\nexport const documentQuerySelectorAll = /** @type {!Function} */ (\r\n typeof document !== \"undefined\" && document.querySelectorAll.bind(document));\r\n\r\nexport function getIdenticonType(el) {\r\n if (el) {\r\n const tagName = el[\"tagName\"];\r\n\r\n if (/^svg$/i.test(tagName)) {\r\n return ICON_TYPE_SVG;\r\n }\r\n\r\n if (/^canvas$/i.test(tagName) && \"getContext\" in el) {\r\n return ICON_TYPE_CANVAS;\r\n }\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { SVG_CONSTANTS } from \"./constants\";\r\n\r\n/**\r\n * Creates a new element and adds it to the specified parent.\r\n * @param {Element} parentNode\r\n * @param {string} name\r\n * @param {...(string|number)} keyValuePairs\r\n */\r\nfunction SvgElement_append(parentNode, name, ...keyValuePairs) {\r\n const el = document.createElementNS(SVG_CONSTANTS.XMLNS, name);\r\n \r\n for (let i = 0; i + 1 < keyValuePairs.length; i += 2) {\r\n el.setAttribute(\r\n /** @type {string} */(keyValuePairs[i]),\r\n /** @type {string} */(keyValuePairs[i + 1]),\r\n );\r\n }\r\n\r\n parentNode.appendChild(el);\r\n}\r\n\r\n\r\n/**\r\n * Renderer producing SVG output.\r\n */\r\nexport class SvgElement {\r\n /**\r\n * @param {Element} element - Target element\r\n */\r\n constructor(element) {\r\n // Don't use the clientWidth and clientHeight properties on SVG elements\r\n // since Firefox won't serve a proper value of these properties on SVG\r\n // elements (https://bugzilla.mozilla.org/show_bug.cgi?id=874811)\r\n // Instead use 100px as a hardcoded size (the svg viewBox will rescale \r\n // the icon to the correct dimensions)\r\n const iconSize = this.iconSize = Math.min(\r\n (Number(element.getAttribute(SVG_CONSTANTS.WIDTH)) || 100),\r\n (Number(element.getAttribute(SVG_CONSTANTS.HEIGHT)) || 100)\r\n );\r\n \r\n /**\r\n * @type {Element}\r\n * @private\r\n */\r\n this._el = element;\r\n \r\n // Clear current SVG child elements\r\n while (element.firstChild) {\r\n element.removeChild(element.firstChild);\r\n }\r\n \r\n // Set viewBox attribute to ensure the svg scales nicely.\r\n element.setAttribute(\"viewBox\", \"0 0 \" + iconSize + \" \" + iconSize);\r\n element.setAttribute(\"preserveAspectRatio\", \"xMidYMid meet\");\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb.\r\n * @param {number} opacity Opacity in the range [0.0, 1.0].\r\n */\r\n setBackground(fillColor, opacity) {\r\n if (opacity) {\r\n SvgElement_append(this._el, \"rect\",\r\n SVG_CONSTANTS.WIDTH, \"100%\",\r\n SVG_CONSTANTS.HEIGHT, \"100%\",\r\n \"fill\", fillColor,\r\n \"opacity\", opacity);\r\n }\r\n }\r\n\r\n /**\r\n * Appends a path to the SVG element.\r\n * @param {string} color Fill color on format #xxxxxx.\r\n * @param {string} dataString The SVG path data string.\r\n */\r\n appendPath(color, dataString) {\r\n SvgElement_append(this._el, \"path\",\r\n \"fill\", color,\r\n \"d\", dataString);\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { ATTRIBUTES, ICON_SELECTOR, documentQuerySelectorAll } from \"../common/dom\";\r\nimport { SvgRenderer } from \"../renderer/svg/svgRenderer\";\r\nimport { SvgElement } from \"../renderer/svg/svgElement\";\r\nimport { CanvasRenderer } from \"../renderer/canvas/canvasRenderer\";\r\nimport { ICON_TYPE_CANVAS, ICON_TYPE_SVG, getIdenticonType } from \"../common/dom\";\r\n\r\n\r\n/**\r\n * Updates all canvas elements with the `data-jdenticon-hash` or `data-jdenticon-value` attribute.\r\n */\r\nexport function updateAll() {\r\n if (documentQuerySelectorAll) {\r\n update(ICON_SELECTOR);\r\n }\r\n}\r\n\r\n/**\r\n * Updates the identicon in the specified `` or `` elements.\r\n * @param {(string|Element)} el - Specifies the container in which the icon is rendered as a DOM element of the type\r\n * `` or ``, or a CSS selector to such an element.\r\n * @param {*=} hashOrValue - Optional hash or value to be rendered. If not specified, the `data-jdenticon-hash` or\r\n * `data-jdenticon-value` attribute will be evaluated.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compability a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function update(el, hashOrValue, config) {\r\n renderDomElement(el, hashOrValue, config, function (el, iconType) {\r\n if (iconType) {\r\n return iconType == ICON_TYPE_SVG ? \r\n new SvgRenderer(new SvgElement(el)) : \r\n new CanvasRenderer(/** @type {HTMLCanvasElement} */(el).getContext(\"2d\"));\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Updates the identicon in the specified `` elements.\r\n * @param {(string|Element)} el - Specifies the container in which the icon is rendered as a DOM element of the type\r\n * ``, or a CSS selector to such an element.\r\n * @param {*=} hashOrValue - Optional hash or value to be rendered. If not specified, the `data-jdenticon-hash` or\r\n * `data-jdenticon-value` attribute will be evaluated.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compability a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function updateCanvas(el, hashOrValue, config) {\r\n renderDomElement(el, hashOrValue, config, function (el, iconType) {\r\n if (iconType == ICON_TYPE_CANVAS) {\r\n return new CanvasRenderer(/** @type {HTMLCanvasElement} */(el).getContext(\"2d\"));\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Updates the identicon in the specified `` elements.\r\n * @param {(string|Element)} el - Specifies the container in which the icon is rendered as a DOM element of the type\r\n * ``, or a CSS selector to such an element.\r\n * @param {*=} hashOrValue - Optional hash or value to be rendered. If not specified, the `data-jdenticon-hash` or\r\n * `data-jdenticon-value` attribute will be evaluated.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compability a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function updateSvg(el, hashOrValue, config) {\r\n renderDomElement(el, hashOrValue, config, function (el, iconType) {\r\n if (iconType == ICON_TYPE_SVG) {\r\n return new SvgRenderer(new SvgElement(el));\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Updates the identicon in the specified canvas or svg elements.\r\n * @param {(string|Element)} el - Specifies the container in which the icon is rendered as a DOM element of the type\r\n * `` or ``, or a CSS selector to such an element.\r\n * @param {*} hashOrValue - Optional hash or value to be rendered. If not specified, the `data-jdenticon-hash` or\r\n * `data-jdenticon-value` attribute will be evaluated.\r\n * @param {Object|number|undefined} config\r\n * @param {function(Element,number):import(\"../renderer/renderer\").Renderer} rendererFactory - Factory function for creating an icon renderer.\r\n */\r\nfunction renderDomElement(el, hashOrValue, config, rendererFactory) {\r\n if (typeof el === \"string\") {\r\n if (documentQuerySelectorAll) {\r\n const elements = documentQuerySelectorAll(el);\r\n for (let i = 0; i < elements.length; i++) {\r\n renderDomElement(elements[i], hashOrValue, config, rendererFactory);\r\n }\r\n }\r\n return;\r\n }\r\n \r\n // Hash selection. The result from getValidHash or computeHash is \r\n // accepted as a valid hash.\r\n const hash = \r\n // 1. Explicit valid hash\r\n isValidHash(hashOrValue) ||\r\n \r\n // 2. Explicit value (`!= null` catches both null and undefined)\r\n hashOrValue != null && computeHash(hashOrValue) ||\r\n \r\n // 3. `data-jdenticon-hash` attribute\r\n isValidHash(el.getAttribute(ATTRIBUTES.HASH)) ||\r\n \r\n // 4. `data-jdenticon-value` attribute. \r\n // We want to treat an empty attribute as an empty value. \r\n // Some browsers return empty string even if the attribute \r\n // is not specified, so use hasAttribute to determine if \r\n // the attribute is specified.\r\n el.hasAttribute(ATTRIBUTES.VALUE) && computeHash(el.getAttribute(ATTRIBUTES.VALUE));\r\n \r\n if (!hash) {\r\n // No hash specified. Don't render an icon.\r\n return;\r\n }\r\n \r\n const renderer = rendererFactory(el, getIdenticonType(el));\r\n if (renderer) {\r\n // Draw icon\r\n iconGenerator(renderer, hash, config);\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n// This file is compiled to dist/jdenticon-module.mjs\r\n\r\nexport { configure } from \"./apis/configure\";\r\nexport { drawIcon } from \"./apis/drawIcon\";\r\nexport { toSvg } from \"./apis/toSvg\";\r\nexport { update, updateCanvas, updateSvg } from \"./apis/update\";\r\n\r\n/**\r\n * Specifies the version of the Jdenticon package in use.\r\n * @type {string}\r\n */\r\nexport const version = \"#version#\";\r\n\r\n/**\r\n * Specifies which bundle of Jdenticon that is used.\r\n * @type {string}\r\n */\r\nexport const bundle = \"browser-esm\";\r\n","\n//# sourceMappingURL=jdenticon-module.mjs.map\n"]} \ No newline at end of file +{"version":3,"sources":["replacement/1","src/common/parseHex.js","src/renderer/color.js","src/common/global.js","src/common/configuration.js","src/renderer/point.js","src/renderer/transform.js","src/renderer/graphics.js","src/renderer/shapes.js","src/renderer/colorTheme.js","src/renderer/iconGenerator.js","src/common/sha1.js","src/common/hashUtils.js","src/renderer/canvas/canvasRenderer.js","src/apis/drawIcon.js","src/renderer/svg/svgPath.js","src/renderer/svg/svgRenderer.js","src/renderer/svg/constants.js","src/renderer/svg/svgWriter.js","src/apis/toSvg.js","src/common/dom.js","src/renderer/svg/svgElement.js","src/apis/update.js","src/browser-esm.js","replacement/2"],"names":["GLOBAL","MODULE","hue","colorSaturation","grayscaleSaturation","colorLightness","grayscaleLightness","backColor","iconPadding","_x","_y","_size","_rotation","transformIconPoint","_renderer","currentTransform","addPolygon","addCircle","addRectangle","addTriangle","addRhombus","setBackground","iconSize","beginShape","endShape","_ctx","dataString","_path","_pathsByColor","_target","appendPath","XMLNS","WIDTH","HEIGHT","_s","HASH","VALUE","_el"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACtBA;AACA;AACA;AACA;AACA;AACO,SAAS,QAAQ,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE;AACtD,IAAI,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC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AAQ,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;AACpF,aAAa;AACb,SAAS;AACT,QAAQ,OAAO;AACf,KAAK;AACL;AACA;AACA;AACA,IAAI,MAAM,IAAI;AACd;AACA,QAAQ,WAAW,CAAC,WAAW,CAAC;AAChC;AACA;AACA,QAAQ,WAAW,IAAI,IAAI,IAAI,WAAW,CAAC,WAAW,CAAC;AACvD;AACA;AACA,QAAQ,WAAW,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAACF,SAAI,CAAC,CAAC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,EAAE,CAAC,YAAY,CAAC,UAAU,CAACC,UAAK,CAAC,IAAI,WAAW,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,CAACA,UAAK,CAAC,CAAC,CAAC;AAC5F;AACA,IAAI,IAAI,CAAC,IAAI,EAAE;AACf;AACA,QAAQ,OAAO;AACf,KAAK;AACL;AACA,IAAI,MAAM,QAAQ,GAAG,eAAe,CAAC,EAAE,EAAE,gBAAgB,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/D,IAAI,IAAI,QAAQ,EAAE;AAClB;AACA,QAAQ,aAAa,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAC9C,KAAK;AACL;;AC3HA;AAMA;AACA;AACA;AACA;AACA;AACY,MAAC,OAAO,GAAG,CAAC,KAAS,EAAE;AACnC;AACA;AACA;AACA;AACA;AACY,MAAC,MAAM,GAAG;;;ACtBtB","file":"jdenticon-module.mjs","sourcesContent":["/**\r\n * Jdenticon 3.1.1\r\n * http://jdenticon.com\r\n *\r\n * Built: 2021-08-14T17:50:52.207Z\r\n * \r\n * MIT License\r\n * \r\n * Copyright (c) 2014-2020 Daniel Mester Pirttijärvi\r\n * \r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n * \r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n * \r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n */\r\n\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Parses a substring of the hash as a number.\r\n * @param {number} startPosition \r\n * @param {number=} octets\r\n */\r\nexport function parseHex(hash, startPosition, octets) {\r\n return parseInt(hash.substr(startPosition, octets), 16);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { parseHex } from \"../common/parseHex\";\r\n\r\nfunction decToHex(v) {\r\n v |= 0; // Ensure integer value\r\n return v < 0 ? \"00\" :\r\n v < 16 ? \"0\" + v.toString(16) :\r\n v < 256 ? v.toString(16) :\r\n \"ff\";\r\n}\r\n\r\nfunction hueToRgb(m1, m2, h) {\r\n h = h < 0 ? h + 6 : h > 6 ? h - 6 : h;\r\n return decToHex(255 * (\r\n h < 1 ? m1 + (m2 - m1) * h :\r\n h < 3 ? m2 :\r\n h < 4 ? m1 + (m2 - m1) * (4 - h) :\r\n m1));\r\n}\r\n\r\n/**\r\n * @param {number} r Red channel [0, 255]\r\n * @param {number} g Green channel [0, 255]\r\n * @param {number} b Blue channel [0, 255]\r\n */\r\nexport function rgb(r, g, b) {\r\n return \"#\" + decToHex(r) + decToHex(g) + decToHex(b);\r\n}\r\n\r\n/**\r\n * @param {string} color Color value to parse. Currently hexadecimal strings on the format #rgb[a] and #rrggbb[aa] are supported.\r\n * @returns {string}\r\n */\r\nexport function parseColor(color) {\r\n if (/^#[0-9a-f]{3,8}$/i.test(color)) {\r\n let result;\r\n const colorLength = color.length;\r\n\r\n if (colorLength < 6) {\r\n const r = color[1],\r\n g = color[2],\r\n b = color[3],\r\n a = color[4] || \"\";\r\n result = \"#\" + r + r + g + g + b + b + a + a;\r\n }\r\n if (colorLength == 7 || colorLength > 8) {\r\n result = color;\r\n }\r\n \r\n return result;\r\n }\r\n}\r\n\r\n/**\r\n * Converts a hexadecimal color to a CSS3 compatible color.\r\n * @param {string} hexColor Color on the format \"#RRGGBB\" or \"#RRGGBBAA\"\r\n * @returns {string}\r\n */\r\nexport function toCss3Color(hexColor) {\r\n const a = parseHex(hexColor, 7, 2);\r\n let result;\r\n\r\n if (isNaN(a)) {\r\n result = hexColor;\r\n } else {\r\n const r = parseHex(hexColor, 1, 2),\r\n g = parseHex(hexColor, 3, 2),\r\n b = parseHex(hexColor, 5, 2);\r\n result = \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + (a / 255).toFixed(2) + \")\";\r\n }\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * Converts an HSL color to a hexadecimal RGB color.\r\n * @param {number} hue Hue in range [0, 1]\r\n * @param {number} saturation Saturation in range [0, 1]\r\n * @param {number} lightness Lightness in range [0, 1]\r\n * @returns {string}\r\n */\r\nexport function hsl(hue, saturation, lightness) {\r\n // Based on http://www.w3.org/TR/2011/REC-css3-color-20110607/#hsl-color\r\n let result;\r\n\r\n if (saturation == 0) {\r\n const partialHex = decToHex(lightness * 255);\r\n result = partialHex + partialHex + partialHex;\r\n }\r\n else {\r\n const m2 = lightness <= 0.5 ? lightness * (saturation + 1) : lightness + saturation - lightness * saturation,\r\n m1 = lightness * 2 - m2;\r\n result =\r\n hueToRgb(m1, m2, hue * 6 + 2) +\r\n hueToRgb(m1, m2, hue * 6) +\r\n hueToRgb(m1, m2, hue * 6 - 2);\r\n }\r\n\r\n return \"#\" + result;\r\n}\r\n\r\n/**\r\n * Converts an HSL color to a hexadecimal RGB color. This function will correct the lightness for the \"dark\" hues\r\n * @param {number} hue Hue in range [0, 1]\r\n * @param {number} saturation Saturation in range [0, 1]\r\n * @param {number} lightness Lightness in range [0, 1]\r\n * @returns {string}\r\n */\r\nexport function correctedHsl(hue, saturation, lightness) {\r\n // The corrector specifies the perceived middle lightness for each hue\r\n const correctors = [ 0.55, 0.5, 0.5, 0.46, 0.6, 0.55, 0.55 ],\r\n corrector = correctors[(hue * 6 + 0.5) | 0];\r\n \r\n // Adjust the input lightness relative to the corrector\r\n lightness = lightness < 0.5 ? lightness * corrector * 2 : corrector + (lightness - 0.5) * (1 - corrector) * 2;\r\n \r\n return hsl(hue, saturation, lightness);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n// In the future we can replace `GLOBAL` with `globalThis`, but for now use the old school global detection for\r\n// backward compatibility.\r\n\r\nexport const GLOBAL = \r\n typeof window !== \"undefined\" ? window :\r\n typeof self !== \"undefined\" ? self :\r\n typeof global !== \"undefined\" ? global :\r\n {};\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { parseColor } from \"../renderer/color\";\r\nimport { GLOBAL } from \"./global\";\r\n\r\n/**\r\n * @typedef {Object} ParsedConfiguration\r\n * @property {number} colorSaturation\r\n * @property {number} grayscaleSaturation\r\n * @property {string} backColor\r\n * @property {number} iconPadding\r\n * @property {function(number):number} hue\r\n * @property {function(number):number} colorLightness\r\n * @property {function(number):number} grayscaleLightness\r\n */\r\n\r\nexport const CONFIG_PROPERTIES = {\r\n GLOBAL: \"jdenticon_config\",\r\n MODULE: \"config\",\r\n};\r\n\r\nvar rootConfigurationHolder = {};\r\n\r\n/**\r\n * Defines the deprecated `config` property on the root Jdenticon object. When the property is set a warning is \r\n * printed in the console. To minimize bundle size, this is only used in Node bundles.\r\n * @param {!Object} rootObject \r\n */\r\nexport function defineConfigPropertyWithWarn(rootObject) {\r\n Object.defineProperty(rootObject, CONFIG_PROPERTIES.MODULE, {\r\n configurable: true,\r\n get: () => rootConfigurationHolder[CONFIG_PROPERTIES.MODULE],\r\n set: newConfiguration => {\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] = newConfiguration;\r\n console.warn(\"jdenticon.config is deprecated. Use jdenticon.configure() instead.\");\r\n },\r\n });\r\n}\r\n\r\n/**\r\n * Defines the deprecated `config` property on the root Jdenticon object without printing a warning in the console\r\n * when it is being used.\r\n * @param {!Object} rootObject \r\n */\r\nexport function defineConfigProperty(rootObject) {\r\n rootConfigurationHolder = rootObject;\r\n}\r\n\r\n/**\r\n * Sets a new icon style configuration. The new configuration is not merged with the previous one. * \r\n * @param {Object} newConfiguration - New configuration object.\r\n */\r\nexport function configure(newConfiguration) {\r\n if (arguments.length) {\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] = newConfiguration;\r\n }\r\n return rootConfigurationHolder[CONFIG_PROPERTIES.MODULE];\r\n}\r\n\r\n/**\r\n * Gets the normalized current Jdenticon color configuration. Missing fields have default values.\r\n * @param {Object|number|undefined} paddingOrLocalConfig - Configuration passed to the called API method. A\r\n * local configuration overrides the global configuration in it entirety. This parameter can for backward\r\n * compatibility also contain a padding value. A padding value only overrides the global padding, not the\r\n * entire global configuration.\r\n * @param {number} defaultPadding - Padding used if no padding is specified in neither the configuration nor\r\n * explicitly to the API method.\r\n * @returns {ParsedConfiguration}\r\n */\r\nexport function getConfiguration(paddingOrLocalConfig, defaultPadding) {\r\n const configObject = \r\n typeof paddingOrLocalConfig == \"object\" && paddingOrLocalConfig ||\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] ||\r\n GLOBAL[CONFIG_PROPERTIES.GLOBAL] ||\r\n { },\r\n\r\n lightnessConfig = configObject[\"lightness\"] || { },\r\n \r\n // In versions < 2.1.0 there was no grayscale saturation -\r\n // saturation was the color saturation.\r\n saturation = configObject[\"saturation\"] || { },\r\n colorSaturation = \"color\" in saturation ? saturation[\"color\"] : saturation,\r\n grayscaleSaturation = saturation[\"grayscale\"],\r\n\r\n backColor = configObject[\"backColor\"],\r\n padding = configObject[\"padding\"];\r\n \r\n /**\r\n * Creates a lightness range.\r\n */\r\n function lightness(configName, defaultRange) {\r\n let range = lightnessConfig[configName];\r\n \r\n // Check if the lightness range is an array-like object. This way we ensure the\r\n // array contain two values at the same time.\r\n if (!(range && range.length > 1)) {\r\n range = defaultRange;\r\n }\r\n\r\n /**\r\n * Gets a lightness relative the specified value in the specified lightness range.\r\n */\r\n return function (value) {\r\n value = range[0] + value * (range[1] - range[0]);\r\n return value < 0 ? 0 : value > 1 ? 1 : value;\r\n };\r\n }\r\n\r\n /**\r\n * Gets a hue allowed by the configured hue restriction,\r\n * provided the originally computed hue.\r\n */\r\n function hueFunction(originalHue) {\r\n const hueConfig = configObject[\"hues\"];\r\n let hue;\r\n \r\n // Check if 'hues' is an array-like object. This way we also ensure that\r\n // the array is not empty, which would mean no hue restriction.\r\n if (hueConfig && hueConfig.length > 0) {\r\n // originalHue is in the range [0, 1]\r\n // Multiply with 0.999 to change the range to [0, 1) and then truncate the index.\r\n hue = hueConfig[0 | (0.999 * originalHue * hueConfig.length)];\r\n }\r\n\r\n return typeof hue == \"number\" ?\r\n \r\n // A hue was specified. We need to convert the hue from\r\n // degrees on any turn - e.g. 746° is a perfectly valid hue -\r\n // to turns in the range [0, 1).\r\n ((((hue / 360) % 1) + 1) % 1) :\r\n\r\n // No hue configured => use original hue\r\n originalHue;\r\n }\r\n \r\n return {\r\n hue: hueFunction,\r\n colorSaturation: typeof colorSaturation == \"number\" ? colorSaturation : 0.5,\r\n grayscaleSaturation: typeof grayscaleSaturation == \"number\" ? grayscaleSaturation : 0,\r\n colorLightness: lightness(\"color\", [0.4, 0.8]),\r\n grayscaleLightness: lightness(\"grayscale\", [0.3, 0.9]),\r\n backColor: parseColor(backColor),\r\n iconPadding: \r\n typeof paddingOrLocalConfig == \"number\" ? paddingOrLocalConfig : \r\n typeof padding == \"number\" ? padding : \r\n defaultPadding\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Represents a point.\r\n */\r\nexport class Point {\r\n /**\r\n * @param {number} x \r\n * @param {number} y \r\n */\r\n constructor(x, y) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { Point } from \"./point\";\r\n\r\n/**\r\n * Translates and rotates a point before being passed on to the canvas context. This was previously done by the canvas context itself, \r\n * but this caused a rendering issue in Chrome on sizes > 256 where the rotation transformation of inverted paths was not done properly.\r\n */\r\nexport class Transform {\r\n /**\r\n * @param {number} x The x-coordinate of the upper left corner of the transformed rectangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the transformed rectangle.\r\n * @param {number} size The size of the transformed rectangle.\r\n * @param {number} rotation Rotation specified as 0 = 0 rad, 1 = 0.5π rad, 2 = π rad, 3 = 1.5π rad\r\n */\r\n constructor(x, y, size, rotation) {\r\n this._x = x;\r\n this._y = y;\r\n this._size = size;\r\n this._rotation = rotation;\r\n }\r\n\r\n /**\r\n * Transforms the specified point based on the translation and rotation specification for this Transform.\r\n * @param {number} x x-coordinate\r\n * @param {number} y y-coordinate\r\n * @param {number=} w The width of the transformed rectangle. If greater than 0, this will ensure the returned point is of the upper left corner of the transformed rectangle.\r\n * @param {number=} h The height of the transformed rectangle. If greater than 0, this will ensure the returned point is of the upper left corner of the transformed rectangle.\r\n */\r\n transformIconPoint(x, y, w, h) {\r\n const right = this._x + this._size,\r\n bottom = this._y + this._size,\r\n rotation = this._rotation;\r\n return rotation === 1 ? new Point(right - y - (h || 0), this._y + x) :\r\n rotation === 2 ? new Point(right - x - (w || 0), bottom - y - (h || 0)) :\r\n rotation === 3 ? new Point(this._x + y, bottom - x - (w || 0)) :\r\n new Point(this._x + x, this._y + y);\r\n }\r\n}\r\n\r\nexport const NO_TRANSFORM = new Transform(0, 0, 0, 0);\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { NO_TRANSFORM } from \"./transform\";\r\n\r\n/**\r\n * @typedef {import(\"./renderer\").Renderer} Renderer\r\n * @typedef {import(\"./transform\").Transform} Transform\r\n */\r\n\r\n/**\r\n * Provides helper functions for rendering common basic shapes.\r\n */\r\nexport class Graphics {\r\n /**\r\n * @param {Renderer} renderer \r\n */\r\n constructor(renderer) {\r\n /**\r\n * @type {Renderer}\r\n * @private\r\n */\r\n this._renderer = renderer;\r\n\r\n /**\r\n * @type {Transform}\r\n */\r\n this.currentTransform = NO_TRANSFORM;\r\n }\r\n\r\n /**\r\n * Adds a polygon to the underlying renderer.\r\n * @param {Array} points The points of the polygon clockwise on the format [ x0, y0, x1, y1, ..., xn, yn ]\r\n * @param {boolean=} invert Specifies if the polygon will be inverted.\r\n */\r\n addPolygon(points, invert) {\r\n const di = invert ? -2 : 2,\r\n transformedPoints = [];\r\n \r\n for (let i = invert ? points.length - 2 : 0; i < points.length && i >= 0; i += di) {\r\n transformedPoints.push(this.currentTransform.transformIconPoint(points[i], points[i + 1]));\r\n }\r\n \r\n this._renderer.addPolygon(transformedPoints);\r\n }\r\n \r\n /**\r\n * Adds a polygon to the underlying renderer.\r\n * Source: http://stackoverflow.com/a/2173084\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the entire ellipse.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the entire ellipse.\r\n * @param {number} size The size of the ellipse.\r\n * @param {boolean=} invert Specifies if the ellipse will be inverted.\r\n */\r\n addCircle(x, y, size, invert) {\r\n const p = this.currentTransform.transformIconPoint(x, y, size, size);\r\n this._renderer.addCircle(p, size, invert);\r\n }\r\n\r\n /**\r\n * Adds a rectangle to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle.\r\n * @param {number} w The width of the rectangle.\r\n * @param {number} h The height of the rectangle.\r\n * @param {boolean=} invert Specifies if the rectangle will be inverted.\r\n */\r\n addRectangle(x, y, w, h, invert) {\r\n this.addPolygon([\r\n x, y, \r\n x + w, y,\r\n x + w, y + h,\r\n x, y + h\r\n ], invert);\r\n }\r\n\r\n /**\r\n * Adds a right triangle to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the triangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the triangle.\r\n * @param {number} w The width of the triangle.\r\n * @param {number} h The height of the triangle.\r\n * @param {number} r The rotation of the triangle (clockwise). 0 = right corner of the triangle in the lower left corner of the bounding rectangle.\r\n * @param {boolean=} invert Specifies if the triangle will be inverted.\r\n */\r\n addTriangle(x, y, w, h, r, invert) {\r\n const points = [\r\n x + w, y, \r\n x + w, y + h, \r\n x, y + h,\r\n x, y\r\n ];\r\n points.splice(((r || 0) % 4) * 2, 2);\r\n this.addPolygon(points, invert);\r\n }\r\n\r\n /**\r\n * Adds a rhombus to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the rhombus.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the rhombus.\r\n * @param {number} w The width of the rhombus.\r\n * @param {number} h The height of the rhombus.\r\n * @param {boolean=} invert Specifies if the rhombus will be inverted.\r\n */\r\n addRhombus(x, y, w, h, invert) {\r\n this.addPolygon([\r\n x + w / 2, y,\r\n x + w, y + h / 2,\r\n x + w / 2, y + h,\r\n x, y + h / 2\r\n ], invert);\r\n }\r\n}","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * @param {number} index\r\n * @param {Graphics} g\r\n * @param {number} cell\r\n * @param {number} positionIndex\r\n * @typedef {import('./graphics').Graphics} Graphics\r\n */\r\nexport function centerShape(index, g, cell, positionIndex) {\r\n index = index % 14;\r\n\r\n let k, m, w, h, inner, outer;\r\n\r\n !index ? (\r\n k = cell * 0.42,\r\n g.addPolygon([\r\n 0, 0,\r\n cell, 0,\r\n cell, cell - k * 2,\r\n cell - k, cell,\r\n 0, cell\r\n ])) :\r\n\r\n index == 1 ? (\r\n w = 0 | (cell * 0.5), \r\n h = 0 | (cell * 0.8),\r\n\r\n g.addTriangle(cell - w, 0, w, h, 2)) :\r\n\r\n index == 2 ? (\r\n w = 0 | (cell / 3),\r\n g.addRectangle(w, w, cell - w, cell - w)) :\r\n\r\n index == 3 ? (\r\n inner = cell * 0.1,\r\n // Use fixed outer border widths in small icons to ensure the border is drawn\r\n outer = \r\n cell < 6 ? 1 :\r\n cell < 8 ? 2 :\r\n (0 | (cell * 0.25)),\r\n \r\n inner = \r\n inner > 1 ? (0 | inner) : // large icon => truncate decimals\r\n inner > 0.5 ? 1 : // medium size icon => fixed width\r\n inner, // small icon => anti-aliased border\r\n\r\n g.addRectangle(outer, outer, cell - inner - outer, cell - inner - outer)) :\r\n\r\n index == 4 ? (\r\n m = 0 | (cell * 0.15),\r\n w = 0 | (cell * 0.5),\r\n g.addCircle(cell - w - m, cell - w - m, w)) :\r\n\r\n index == 5 ? (\r\n inner = cell * 0.1,\r\n outer = inner * 4,\r\n\r\n // Align edge to nearest pixel in large icons\r\n outer > 3 && (outer = 0 | outer),\r\n \r\n g.addRectangle(0, 0, cell, cell),\r\n g.addPolygon([\r\n outer, outer,\r\n cell - inner, outer,\r\n outer + (cell - outer - inner) / 2, cell - inner\r\n ], true)) :\r\n\r\n index == 6 ? \r\n g.addPolygon([\r\n 0, 0,\r\n cell, 0,\r\n cell, cell * 0.7,\r\n cell * 0.4, cell * 0.4,\r\n cell * 0.7, cell,\r\n 0, cell\r\n ]) :\r\n\r\n index == 7 ? \r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 3) :\r\n\r\n index == 8 ? (\r\n g.addRectangle(0, 0, cell, cell / 2),\r\n g.addRectangle(0, cell / 2, cell / 2, cell / 2),\r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 1)) :\r\n\r\n index == 9 ? (\r\n inner = cell * 0.14,\r\n // Use fixed outer border widths in small icons to ensure the border is drawn\r\n outer = \r\n cell < 4 ? 1 :\r\n cell < 6 ? 2 :\r\n (0 | (cell * 0.35)),\r\n\r\n inner = \r\n cell < 8 ? inner : // small icon => anti-aliased border\r\n (0 | inner), // large icon => truncate decimals\r\n\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addRectangle(outer, outer, cell - outer - inner, cell - outer - inner, true)) :\r\n\r\n index == 10 ? (\r\n inner = cell * 0.12,\r\n outer = inner * 3,\r\n\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addCircle(outer, outer, cell - inner - outer, true)) :\r\n\r\n index == 11 ? \r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 3) :\r\n\r\n index == 12 ? (\r\n m = cell * 0.25,\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addRhombus(m, m, cell - m, cell - m, true)) :\r\n\r\n // 13\r\n (\r\n !positionIndex && (\r\n m = cell * 0.4, w = cell * 1.2,\r\n g.addCircle(m, m, w)\r\n )\r\n );\r\n}\r\n\r\n/**\r\n * @param {number} index\r\n * @param {Graphics} g\r\n * @param {number} cell\r\n */\r\nexport function outerShape(index, g, cell) {\r\n index = index % 4;\r\n\r\n let m;\r\n\r\n !index ?\r\n g.addTriangle(0, 0, cell, cell, 0) :\r\n \r\n index == 1 ?\r\n g.addTriangle(0, cell / 2, cell, cell / 2, 0) :\r\n\r\n index == 2 ?\r\n g.addRhombus(0, 0, cell, cell) :\r\n\r\n // 3\r\n (\r\n m = cell / 6,\r\n g.addCircle(m, m, cell - 2 * m)\r\n );\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { correctedHsl } from \"./color\";\r\n\r\n/**\r\n * Gets a set of identicon color candidates for a specified hue and config.\r\n * @param {number} hue\r\n * @param {import(\"../common/configuration\").ParsedConfiguration} config\r\n */\r\nexport function colorTheme(hue, config) {\r\n hue = config.hue(hue);\r\n return [\r\n // Dark gray\r\n correctedHsl(hue, config.grayscaleSaturation, config.grayscaleLightness(0)),\r\n // Mid color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(0.5)),\r\n // Light gray\r\n correctedHsl(hue, config.grayscaleSaturation, config.grayscaleLightness(1)),\r\n // Light color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(1)),\r\n // Dark color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(0))\r\n ];\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { Transform } from \"./transform\";\r\nimport { Graphics } from \"./graphics\";\r\nimport { centerShape, outerShape } from \"./shapes\";\r\nimport { colorTheme } from \"./colorTheme\";\r\nimport { parseHex } from \"../common/parseHex\";\r\nimport { getConfiguration } from \"../common/configuration\";\r\n \r\n/**\r\n * Draws an identicon to a specified renderer.\r\n * @param {import('./renderer').Renderer} renderer\r\n * @param {string} hash\r\n * @param {Object|number=} config\r\n */\r\nexport function iconGenerator(renderer, hash, config) {\r\n const parsedConfig = getConfiguration(config, 0.08);\r\n\r\n // Set background color\r\n if (parsedConfig.backColor) {\r\n renderer.setBackground(parsedConfig.backColor);\r\n }\r\n \r\n // Calculate padding and round to nearest integer\r\n let size = renderer.iconSize;\r\n const padding = (0.5 + size * parsedConfig.iconPadding) | 0;\r\n size -= padding * 2;\r\n \r\n const graphics = new Graphics(renderer);\r\n \r\n // Calculate cell size and ensure it is an integer\r\n const cell = 0 | (size / 4);\r\n \r\n // Since the cell size is integer based, the actual icon will be slightly smaller than specified => center icon\r\n const x = 0 | (padding + size / 2 - cell * 2);\r\n const y = 0 | (padding + size / 2 - cell * 2);\r\n\r\n function renderShape(colorIndex, shapes, index, rotationIndex, positions) {\r\n const shapeIndex = parseHex(hash, index, 1);\r\n let r = rotationIndex ? parseHex(hash, rotationIndex, 1) : 0;\r\n \r\n renderer.beginShape(availableColors[selectedColorIndexes[colorIndex]]);\r\n \r\n for (let i = 0; i < positions.length; i++) {\r\n graphics.currentTransform = new Transform(x + positions[i][0] * cell, y + positions[i][1] * cell, cell, r++ % 4);\r\n shapes(shapeIndex, graphics, cell, i);\r\n }\r\n \r\n renderer.endShape();\r\n }\r\n\r\n // AVAILABLE COLORS\r\n const hue = parseHex(hash, -7) / 0xfffffff,\r\n \r\n // Available colors for this icon\r\n availableColors = colorTheme(hue, parsedConfig),\r\n\r\n // The index of the selected colors\r\n selectedColorIndexes = [];\r\n\r\n let index;\r\n\r\n function isDuplicate(values) {\r\n if (values.indexOf(index) >= 0) {\r\n for (let i = 0; i < values.length; i++) {\r\n if (selectedColorIndexes.indexOf(values[i]) >= 0) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n for (let i = 0; i < 3; i++) {\r\n index = parseHex(hash, 8 + i, 1) % availableColors.length;\r\n if (isDuplicate([0, 4]) || // Disallow dark gray and dark color combo\r\n isDuplicate([2, 3])) { // Disallow light gray and light color combo\r\n index = 1;\r\n }\r\n selectedColorIndexes.push(index);\r\n }\r\n\r\n // ACTUAL RENDERING\r\n // Sides\r\n renderShape(0, outerShape, 2, 3, [[1, 0], [2, 0], [2, 3], [1, 3], [0, 1], [3, 1], [3, 2], [0, 2]]);\r\n // Corners\r\n renderShape(1, outerShape, 4, 5, [[0, 0], [3, 0], [3, 3], [0, 3]]);\r\n // Center\r\n renderShape(2, centerShape, 1, null, [[1, 1], [2, 1], [2, 2], [1, 2]]);\r\n \r\n renderer.finish();\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Computes a SHA1 hash for any value and returns it as a hexadecimal string.\r\n * \r\n * This function is optimized for minimal code size and rather short messages.\r\n * \r\n * @param {string} message \r\n */\r\nexport function sha1(message) {\r\n const HASH_SIZE_HALF_BYTES = 40;\r\n const BLOCK_SIZE_WORDS = 16;\r\n\r\n // Variables\r\n // `var` is used to be able to minimize the number of `var` keywords.\r\n var i = 0,\r\n f = 0,\r\n \r\n // Use `encodeURI` to UTF8 encode the message without any additional libraries\r\n // We could use `unescape` + `encodeURI` to minimize the code, but that would be slightly risky\r\n // since `unescape` is deprecated.\r\n urlEncodedMessage = encodeURI(message) + \"%80\", // trailing '1' bit padding\r\n \r\n // This can be changed to a preallocated Uint32Array array for greater performance and larger code size\r\n data = [],\r\n dataSize,\r\n \r\n hashBuffer = [],\r\n\r\n a = 0x67452301,\r\n b = 0xefcdab89,\r\n c = ~a,\r\n d = ~b,\r\n e = 0xc3d2e1f0,\r\n hash = [a, b, c, d, e],\r\n\r\n blockStartIndex = 0,\r\n hexHash = \"\";\r\n\r\n /**\r\n * Rotates the value a specified number of bits to the left.\r\n * @param {number} value Value to rotate\r\n * @param {number} shift Bit count to shift.\r\n */\r\n function rotl(value, shift) {\r\n return (value << shift) | (value >>> (32 - shift));\r\n }\r\n\r\n // Message data\r\n for ( ; i < urlEncodedMessage.length; f++) {\r\n data[f >> 2] = data[f >> 2] |\r\n (\r\n (\r\n urlEncodedMessage[i] == \"%\"\r\n // Percent encoded byte\r\n ? parseInt(urlEncodedMessage.substring(i + 1, i += 3), 16)\r\n // Unencoded byte\r\n : urlEncodedMessage.charCodeAt(i++)\r\n )\r\n\r\n // Read bytes in reverse order (big endian words)\r\n << ((3 - (f & 3)) * 8)\r\n );\r\n }\r\n\r\n // f is now the length of the utf8 encoded message\r\n // 7 = 8 bytes (64 bit) for message size, -1 to round down\r\n // >> 6 = integer division with block size\r\n dataSize = (((f + 7) >> 6) + 1) * BLOCK_SIZE_WORDS;\r\n\r\n // Message size in bits.\r\n // SHA1 uses a 64 bit integer to represent the size, but since we only support short messages only the least\r\n // significant 32 bits are set. -8 is for the '1' bit padding byte.\r\n data[dataSize - 1] = f * 8 - 8;\r\n \r\n // Compute hash\r\n for ( ; blockStartIndex < dataSize; blockStartIndex += BLOCK_SIZE_WORDS) {\r\n for (i = 0; i < 80; i++) {\r\n f = rotl(a, 5) + e + (\r\n // Ch\r\n i < 20 ? ((b & c) ^ ((~b) & d)) + 0x5a827999 :\r\n \r\n // Parity\r\n i < 40 ? (b ^ c ^ d) + 0x6ed9eba1 :\r\n \r\n // Maj\r\n i < 60 ? ((b & c) ^ (b & d) ^ (c & d)) + 0x8f1bbcdc :\r\n \r\n // Parity\r\n (b ^ c ^ d) + 0xca62c1d6\r\n ) + ( \r\n hashBuffer[i] = i < BLOCK_SIZE_WORDS\r\n // Bitwise OR is used to coerse `undefined` to 0\r\n ? (data[blockStartIndex + i] | 0)\r\n : rotl(hashBuffer[i - 3] ^ hashBuffer[i - 8] ^ hashBuffer[i - 14] ^ hashBuffer[i - 16], 1)\r\n );\r\n\r\n e = d;\r\n d = c;\r\n c = rotl(b, 30);\r\n b = a;\r\n a = f;\r\n }\r\n\r\n hash[0] = a = ((hash[0] + a) | 0);\r\n hash[1] = b = ((hash[1] + b) | 0);\r\n hash[2] = c = ((hash[2] + c) | 0);\r\n hash[3] = d = ((hash[3] + d) | 0);\r\n hash[4] = e = ((hash[4] + e) | 0);\r\n }\r\n\r\n // Format hex hash\r\n for (i = 0; i < HASH_SIZE_HALF_BYTES; i++) {\r\n hexHash += (\r\n (\r\n // Get word (2^3 half-bytes per word)\r\n hash[i >> 3] >>>\r\n\r\n // Append half-bytes in reverse order\r\n ((7 - (i & 7)) * 4)\r\n ) \r\n // Clamp to half-byte\r\n & 0xf\r\n ).toString(16);\r\n }\r\n\r\n return hexHash;\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { sha1 } from \"./sha1\";\r\n\r\n/**\r\n * Inputs a value that might be a valid hash string for Jdenticon and returns it \r\n * if it is determined valid, otherwise a falsy value is returned.\r\n */\r\nexport function isValidHash(hashCandidate) {\r\n return /^[0-9a-f]{11,}$/i.test(hashCandidate) && hashCandidate;\r\n}\r\n\r\n/**\r\n * Computes a hash for the specified value. Currently SHA1 is used. This function\r\n * always returns a valid hash.\r\n */\r\nexport function computeHash(value) {\r\n return sha1(value == null ? \"\" : \"\" + value);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { toCss3Color } from \"../color\";\r\n\r\n/**\r\n * @typedef {import(\"../renderer\").Renderer} Renderer\r\n * @typedef {import('../point').Point} Point\r\n */\r\n\r\n/**\r\n * Renderer redirecting drawing commands to a canvas context.\r\n * @implements {Renderer}\r\n */\r\nexport class CanvasRenderer {\r\n /**\r\n * @param {number=} iconSize\r\n */\r\n constructor(ctx, iconSize) {\r\n const canvas = ctx.canvas; \r\n const width = canvas.width;\r\n const height = canvas.height;\r\n \r\n ctx.save();\r\n \r\n if (!iconSize) {\r\n iconSize = Math.min(width, height);\r\n \r\n ctx.translate(\r\n ((width - iconSize) / 2) | 0,\r\n ((height - iconSize) / 2) | 0);\r\n }\r\n\r\n /**\r\n * @private\r\n */\r\n this._ctx = ctx;\r\n this.iconSize = iconSize;\r\n \r\n ctx.clearRect(0, 0, iconSize, iconSize);\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb[aa].\r\n */\r\n setBackground(fillColor) {\r\n const ctx = this._ctx;\r\n const iconSize = this.iconSize;\r\n\r\n ctx.fillStyle = toCss3Color(fillColor);\r\n ctx.fillRect(0, 0, iconSize, iconSize);\r\n }\r\n\r\n /**\r\n * Marks the beginning of a new shape of the specified color. Should be ended with a call to endShape.\r\n * @param {string} fillColor Fill color on format #rrggbb[aa].\r\n */\r\n beginShape(fillColor) {\r\n const ctx = this._ctx;\r\n ctx.fillStyle = toCss3Color(fillColor);\r\n ctx.beginPath();\r\n }\r\n\r\n /**\r\n * Marks the end of the currently drawn shape. This causes the queued paths to be rendered on the canvas.\r\n */\r\n endShape() {\r\n this._ctx.fill();\r\n }\r\n\r\n /**\r\n * Adds a polygon to the rendering queue.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n const ctx = this._ctx;\r\n ctx.moveTo(points[0].x, points[0].y);\r\n for (let i = 1; i < points.length; i++) {\r\n ctx.lineTo(points[i].x, points[i].y);\r\n }\r\n ctx.closePath();\r\n }\r\n\r\n /**\r\n * Adds a circle to the rendering queue.\r\n * @param {Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n const ctx = this._ctx,\r\n radius = diameter / 2;\r\n ctx.moveTo(point.x + radius, point.y + radius);\r\n ctx.arc(point.x + radius, point.y + radius, radius, 0, Math.PI * 2, counterClockwise);\r\n ctx.closePath();\r\n }\r\n\r\n /**\r\n * Called when the icon has been completely drawn.\r\n */\r\n finish() {\r\n this._ctx.restore();\r\n }\r\n}\r\n","import { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { CanvasRenderer } from \"../renderer/canvas/canvasRenderer\";\r\n\r\n/**\r\n * Draws an identicon to a context.\r\n * @param {CanvasRenderingContext2D} ctx - Canvas context on which the icon will be drawn at location (0, 0).\r\n * @param {*} hashOrValue - A hexadecimal hash string or any value that will be hashed by Jdenticon.\r\n * @param {number} size - Icon size in pixels.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compatibility a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function drawIcon(ctx, hashOrValue, size, config) {\r\n if (!ctx) {\r\n throw new Error(\"No canvas specified.\");\r\n }\r\n \r\n iconGenerator(new CanvasRenderer(ctx, size), \r\n isValidHash(hashOrValue) || computeHash(hashOrValue), \r\n config);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Prepares a measure to be used as a measure in an SVG path, by\r\n * rounding the measure to a single decimal. This reduces the file\r\n * size of the generated SVG with more than 50% in some cases.\r\n */\r\nfunction svgValue(value) {\r\n return ((value * 10 + 0.5) | 0) / 10;\r\n}\r\n\r\n/**\r\n * Represents an SVG path element.\r\n */\r\nexport class SvgPath {\r\n constructor() {\r\n /**\r\n * This property holds the data string (path.d) of the SVG path.\r\n * @type {string}\r\n */\r\n this.dataString = \"\";\r\n }\r\n\r\n /**\r\n * Adds a polygon with the current fill color to the SVG path.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n let dataString = \"\";\r\n for (let i = 0; i < points.length; i++) {\r\n dataString += (i ? \"L\" : \"M\") + svgValue(points[i].x) + \" \" + svgValue(points[i].y);\r\n }\r\n this.dataString += dataString + \"Z\";\r\n }\r\n\r\n /**\r\n * Adds a circle with the current fill color to the SVG path.\r\n * @param {import('../point').Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n const sweepFlag = counterClockwise ? 0 : 1,\r\n svgRadius = svgValue(diameter / 2),\r\n svgDiameter = svgValue(diameter),\r\n svgArc = \"a\" + svgRadius + \",\" + svgRadius + \" 0 1,\" + sweepFlag + \" \";\r\n \r\n this.dataString += \r\n \"M\" + svgValue(point.x) + \" \" + svgValue(point.y + diameter / 2) +\r\n svgArc + svgDiameter + \",0\" + \r\n svgArc + (-svgDiameter) + \",0\";\r\n }\r\n}\r\n\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { SvgPath } from \"./svgPath\";\r\nimport { parseHex } from \"../../common/parseHex\";\r\n\r\n/**\r\n * @typedef {import(\"../point\").Point} Point\r\n * @typedef {import(\"../renderer\").Renderer} Renderer\r\n * @typedef {import(\"./svgElement\").SvgElement} SvgElement\r\n * @typedef {import(\"./svgWriter\").SvgWriter} SvgWriter\r\n */\r\n\r\n/**\r\n * Renderer producing SVG output.\r\n * @implements {Renderer}\r\n */\r\nexport class SvgRenderer {\r\n /**\r\n * @param {SvgElement|SvgWriter} target \r\n */\r\n constructor(target) {\r\n /**\r\n * @type {SvgPath}\r\n * @private\r\n */\r\n this._path;\r\n\r\n /**\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._pathsByColor = { };\r\n\r\n /**\r\n * @type {SvgElement|SvgWriter}\r\n * @private\r\n */\r\n this._target = target;\r\n\r\n /**\r\n * @type {number}\r\n */\r\n this.iconSize = target.iconSize;\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb[aa].\r\n */\r\n setBackground(fillColor) {\r\n const match = /^(#......)(..)?/.exec(fillColor),\r\n opacity = match[2] ? parseHex(match[2], 0) / 255 : 1;\r\n this._target.setBackground(match[1], opacity);\r\n }\r\n\r\n /**\r\n * Marks the beginning of a new shape of the specified color. Should be ended with a call to endShape.\r\n * @param {string} color Fill color on format #xxxxxx.\r\n */\r\n beginShape(color) {\r\n this._path = this._pathsByColor[color] || (this._pathsByColor[color] = new SvgPath());\r\n }\r\n\r\n /**\r\n * Marks the end of the currently drawn shape.\r\n */\r\n endShape() { }\r\n\r\n /**\r\n * Adds a polygon with the current fill color to the SVG.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n this._path.addPolygon(points);\r\n }\r\n\r\n /**\r\n * Adds a circle with the current fill color to the SVG.\r\n * @param {Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n this._path.addCircle(point, diameter, counterClockwise);\r\n }\r\n\r\n /**\r\n * Called when the icon has been completely drawn.\r\n */\r\n finish() { \r\n const pathsByColor = this._pathsByColor;\r\n for (let color in pathsByColor) {\r\n // hasOwnProperty cannot be shadowed in pathsByColor\r\n // eslint-disable-next-line no-prototype-builtins\r\n if (pathsByColor.hasOwnProperty(color)) {\r\n this._target.appendPath(color, pathsByColor[color].dataString);\r\n }\r\n }\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nexport const SVG_CONSTANTS = {\r\n XMLNS: \"http://www.w3.org/2000/svg\",\r\n WIDTH: \"width\",\r\n HEIGHT: \"height\",\r\n}","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { SVG_CONSTANTS } from \"./constants\";\r\n\r\n/**\r\n * Renderer producing SVG output.\r\n */\r\nexport class SvgWriter {\r\n /**\r\n * @param {number} iconSize - Icon width and height in pixels.\r\n */\r\n constructor(iconSize) {\r\n /**\r\n * @type {number}\r\n */\r\n this.iconSize = iconSize;\r\n\r\n /**\r\n * @type {string}\r\n * @private\r\n */\r\n this._s =\r\n '';\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb.\r\n * @param {number} opacity Opacity in the range [0.0, 1.0].\r\n */\r\n setBackground(fillColor, opacity) {\r\n if (opacity) {\r\n this._s += '';\r\n }\r\n }\r\n\r\n /**\r\n * Writes a path to the SVG string.\r\n * @param {string} color Fill color on format #rrggbb.\r\n * @param {string} dataString The SVG path data string.\r\n */\r\n appendPath(color, dataString) {\r\n this._s += '';\r\n }\r\n\r\n /**\r\n * Gets the rendered image as an SVG string.\r\n */\r\n toString() {\r\n return this._s + \"\";\r\n }\r\n}\r\n","import { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { SvgRenderer } from \"../renderer/svg/svgRenderer\";\r\nimport { SvgWriter } from \"../renderer/svg/svgWriter\";\r\n\r\n/**\r\n * Draws an identicon as an SVG string.\r\n * @param {*} hashOrValue - A hexadecimal hash string or any value that will be hashed by Jdenticon.\r\n * @param {number} size - Icon size in pixels.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compatibility a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n * @returns {string} SVG string\r\n */\r\nexport function toSvg(hashOrValue, size, config) {\r\n const writer = new SvgWriter(size);\r\n iconGenerator(new SvgRenderer(writer), \r\n isValidHash(hashOrValue) || computeHash(hashOrValue),\r\n config);\r\n return writer.toString();\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nexport const ICON_TYPE_SVG = 1;\r\n\r\nexport const ICON_TYPE_CANVAS = 2;\r\n\r\nexport const ATTRIBUTES = {\r\n HASH: \"data-jdenticon-hash\",\r\n VALUE: \"data-jdenticon-value\"\r\n};\r\n\r\nexport const ICON_SELECTOR = \"[\" + ATTRIBUTES.HASH +\"],[\" + ATTRIBUTES.VALUE +\"]\";\r\n\r\nexport const documentQuerySelectorAll = /** @type {!Function} */ (\r\n typeof document !== \"undefined\" && document.querySelectorAll.bind(document));\r\n\r\nexport function getIdenticonType(el) {\r\n if (el) {\r\n const tagName = el[\"tagName\"];\r\n\r\n if (/^svg$/i.test(tagName)) {\r\n return ICON_TYPE_SVG;\r\n }\r\n\r\n if (/^canvas$/i.test(tagName) && \"getContext\" in el) {\r\n return ICON_TYPE_CANVAS;\r\n }\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { SVG_CONSTANTS } from \"./constants\";\r\n\r\n/**\r\n * Creates a new element and adds it to the specified parent.\r\n * @param {Element} parentNode\r\n * @param {string} name\r\n * @param {...(string|number)} keyValuePairs\r\n */\r\nfunction SvgElement_append(parentNode, name, ...keyValuePairs) {\r\n const el = document.createElementNS(SVG_CONSTANTS.XMLNS, name);\r\n \r\n for (let i = 0; i + 1 < keyValuePairs.length; i += 2) {\r\n el.setAttribute(\r\n /** @type {string} */(keyValuePairs[i]),\r\n /** @type {string} */(keyValuePairs[i + 1]),\r\n );\r\n }\r\n\r\n parentNode.appendChild(el);\r\n}\r\n\r\n\r\n/**\r\n * Renderer producing SVG output.\r\n */\r\nexport class SvgElement {\r\n /**\r\n * @param {Element} element - Target element\r\n */\r\n constructor(element) {\r\n // Don't use the clientWidth and clientHeight properties on SVG elements\r\n // since Firefox won't serve a proper value of these properties on SVG\r\n // elements (https://bugzilla.mozilla.org/show_bug.cgi?id=874811)\r\n // Instead use 100px as a hardcoded size (the svg viewBox will rescale \r\n // the icon to the correct dimensions)\r\n const iconSize = this.iconSize = Math.min(\r\n (Number(element.getAttribute(SVG_CONSTANTS.WIDTH)) || 100),\r\n (Number(element.getAttribute(SVG_CONSTANTS.HEIGHT)) || 100)\r\n );\r\n \r\n /**\r\n * @type {Element}\r\n * @private\r\n */\r\n this._el = element;\r\n \r\n // Clear current SVG child elements\r\n while (element.firstChild) {\r\n element.removeChild(element.firstChild);\r\n }\r\n \r\n // Set viewBox attribute to ensure the svg scales nicely.\r\n element.setAttribute(\"viewBox\", \"0 0 \" + iconSize + \" \" + iconSize);\r\n element.setAttribute(\"preserveAspectRatio\", \"xMidYMid meet\");\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb.\r\n * @param {number} opacity Opacity in the range [0.0, 1.0].\r\n */\r\n setBackground(fillColor, opacity) {\r\n if (opacity) {\r\n SvgElement_append(this._el, \"rect\",\r\n SVG_CONSTANTS.WIDTH, \"100%\",\r\n SVG_CONSTANTS.HEIGHT, \"100%\",\r\n \"fill\", fillColor,\r\n \"opacity\", opacity);\r\n }\r\n }\r\n\r\n /**\r\n * Appends a path to the SVG element.\r\n * @param {string} color Fill color on format #xxxxxx.\r\n * @param {string} dataString The SVG path data string.\r\n */\r\n appendPath(color, dataString) {\r\n SvgElement_append(this._el, \"path\",\r\n \"fill\", color,\r\n \"d\", dataString);\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { ATTRIBUTES, ICON_SELECTOR, documentQuerySelectorAll } from \"../common/dom\";\r\nimport { SvgRenderer } from \"../renderer/svg/svgRenderer\";\r\nimport { SvgElement } from \"../renderer/svg/svgElement\";\r\nimport { CanvasRenderer } from \"../renderer/canvas/canvasRenderer\";\r\nimport { ICON_TYPE_CANVAS, ICON_TYPE_SVG, getIdenticonType } from \"../common/dom\";\r\n\r\n\r\n/**\r\n * Updates all canvas elements with the `data-jdenticon-hash` or `data-jdenticon-value` attribute.\r\n */\r\nexport function updateAll() {\r\n if (documentQuerySelectorAll) {\r\n update(ICON_SELECTOR);\r\n }\r\n}\r\n\r\n/**\r\n * Updates the identicon in the specified `` or `` elements.\r\n * @param {(string|Element)} el - Specifies the container in which the icon is rendered as a DOM element of the type\r\n * `` or ``, or a CSS selector to such an element.\r\n * @param {*=} hashOrValue - Optional hash or value to be rendered. If not specified, the `data-jdenticon-hash` or\r\n * `data-jdenticon-value` attribute will be evaluated.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compability a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function update(el, hashOrValue, config) {\r\n renderDomElement(el, hashOrValue, config, function (el, iconType) {\r\n if (iconType) {\r\n return iconType == ICON_TYPE_SVG ? \r\n new SvgRenderer(new SvgElement(el)) : \r\n new CanvasRenderer(/** @type {HTMLCanvasElement} */(el).getContext(\"2d\"));\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Updates the identicon in the specified `` elements.\r\n * @param {(string|Element)} el - Specifies the container in which the icon is rendered as a DOM element of the type\r\n * ``, or a CSS selector to such an element.\r\n * @param {*=} hashOrValue - Optional hash or value to be rendered. If not specified, the `data-jdenticon-hash` or\r\n * `data-jdenticon-value` attribute will be evaluated.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compability a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function updateCanvas(el, hashOrValue, config) {\r\n renderDomElement(el, hashOrValue, config, function (el, iconType) {\r\n if (iconType == ICON_TYPE_CANVAS) {\r\n return new CanvasRenderer(/** @type {HTMLCanvasElement} */(el).getContext(\"2d\"));\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Updates the identicon in the specified `` elements.\r\n * @param {(string|Element)} el - Specifies the container in which the icon is rendered as a DOM element of the type\r\n * ``, or a CSS selector to such an element.\r\n * @param {*=} hashOrValue - Optional hash or value to be rendered. If not specified, the `data-jdenticon-hash` or\r\n * `data-jdenticon-value` attribute will be evaluated.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compability a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function updateSvg(el, hashOrValue, config) {\r\n renderDomElement(el, hashOrValue, config, function (el, iconType) {\r\n if (iconType == ICON_TYPE_SVG) {\r\n return new SvgRenderer(new SvgElement(el));\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Updates the identicon in the specified canvas or svg elements.\r\n * @param {(string|Element)} el - Specifies the container in which the icon is rendered as a DOM element of the type\r\n * `` or ``, or a CSS selector to such an element.\r\n * @param {*} hashOrValue - Optional hash or value to be rendered. If not specified, the `data-jdenticon-hash` or\r\n * `data-jdenticon-value` attribute will be evaluated.\r\n * @param {Object|number|undefined} config\r\n * @param {function(Element,number):import(\"../renderer/renderer\").Renderer} rendererFactory - Factory function for creating an icon renderer.\r\n */\r\nfunction renderDomElement(el, hashOrValue, config, rendererFactory) {\r\n if (typeof el === \"string\") {\r\n if (documentQuerySelectorAll) {\r\n const elements = documentQuerySelectorAll(el);\r\n for (let i = 0; i < elements.length; i++) {\r\n renderDomElement(elements[i], hashOrValue, config, rendererFactory);\r\n }\r\n }\r\n return;\r\n }\r\n \r\n // Hash selection. The result from getValidHash or computeHash is \r\n // accepted as a valid hash.\r\n const hash = \r\n // 1. Explicit valid hash\r\n isValidHash(hashOrValue) ||\r\n \r\n // 2. Explicit value (`!= null` catches both null and undefined)\r\n hashOrValue != null && computeHash(hashOrValue) ||\r\n \r\n // 3. `data-jdenticon-hash` attribute\r\n isValidHash(el.getAttribute(ATTRIBUTES.HASH)) ||\r\n \r\n // 4. `data-jdenticon-value` attribute. \r\n // We want to treat an empty attribute as an empty value. \r\n // Some browsers return empty string even if the attribute \r\n // is not specified, so use hasAttribute to determine if \r\n // the attribute is specified.\r\n el.hasAttribute(ATTRIBUTES.VALUE) && computeHash(el.getAttribute(ATTRIBUTES.VALUE));\r\n \r\n if (!hash) {\r\n // No hash specified. Don't render an icon.\r\n return;\r\n }\r\n \r\n const renderer = rendererFactory(el, getIdenticonType(el));\r\n if (renderer) {\r\n // Draw icon\r\n iconGenerator(renderer, hash, config);\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n// This file is compiled to dist/jdenticon-module.mjs\r\n\r\nexport { configure } from \"./apis/configure\";\r\nexport { drawIcon } from \"./apis/drawIcon\";\r\nexport { toSvg } from \"./apis/toSvg\";\r\nexport { update, updateCanvas, updateSvg } from \"./apis/update\";\r\n\r\n/**\r\n * Specifies the version of the Jdenticon package in use.\r\n * @type {string}\r\n */\r\nexport const version = \"#version#\";\r\n\r\n/**\r\n * Specifies which bundle of Jdenticon that is used.\r\n * @type {string}\r\n */\r\nexport const bundle = \"browser-esm\";\r\n","\n//# sourceMappingURL=jdenticon-module.mjs.map\n"]} \ No newline at end of file diff --git a/dist/jdenticon-node.js b/dist/jdenticon-node.js index 27e0d8e..1e437b3 100644 --- a/dist/jdenticon-node.js +++ b/dist/jdenticon-node.js @@ -1,8 +1,8 @@ /** - * Jdenticon 3.1.0 + * Jdenticon 3.1.1 * http://jdenticon.com * - * Built: 2020-12-12T13:51:48.709Z + * Built: 2021-08-14T17:50:52.207Z * * MIT License * @@ -1233,7 +1233,7 @@ jdenticon.toSvg = toSvg; * Specifies the version of the Jdenticon package in use. * @type {string} */ -jdenticon.version = "3.1.0"; +jdenticon.version = "3.1.1"; /** * Specifies which bundle of Jdenticon that is used. diff --git a/dist/jdenticon-node.js.map b/dist/jdenticon-node.js.map index cd15848..b9b56e2 100644 --- a/dist/jdenticon-node.js.map +++ b/dist/jdenticon-node.js.map @@ -1 +1 @@ -{"version":3,"sources":["replacement/1","src/common/parseHex.js","src/renderer/color.js","src/common/global.js","src/common/configuration.js","src/renderer/point.js","src/renderer/transform.js","src/renderer/graphics.js","src/renderer/shapes.js","src/renderer/colorTheme.js","src/renderer/iconGenerator.js","src/common/sha1.js","src/common/hashUtils.js","src/renderer/canvas/canvasRenderer.js","src/apis/drawIcon.js","src/apis/toPng.js","src/renderer/svg/svgPath.js","src/renderer/svg/svgRenderer.js","src/renderer/svg/constants.js","src/renderer/svg/svgWriter.js","src/apis/toSvg.js","src/node-cjs.js","replacement/2"],"names":["canvasRenderer"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACO,SAAS,QAAQ,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE;AACtD,IAAI,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;AAC5D;;ACLA,SAAS,QAAQ,CAAC,CAAC,EAAE;AACrB,IAAI,CAAC,IAAI,CAAC,CAAC;AACX,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI;AACvB,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;AACrC,QAAQ,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;AAChC,QAAQ,IAAI,CAAC;AACb,CAAC;AACD;AACA,SAAS,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE;AAC7B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC1C,IAAI,OAAO,QAAQ,CAAC,GAAG;AACvB,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC;AAClC,QAAQ,CAAC,GAAG,CAAC,GAA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,CAAC,SAAS,GAAG,SAAS,CAAC;AAChC,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC9B,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC;AACxB,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC;AACxB;AACA;AACA;AACA;AACA;AACA,SAAS,CAAC,OAAO,GAAG,CAAC,KAAS,CAAC,CAAC;AAChC;AACA;AACA;AACA;AACA;AACA,SAAS,CAAC,MAAM,GAAG,UAAU,CAAC;AAC9B;AACA;AACA;AACA;AACA,SAAS,CAAC,MAAM,GAAG,SAAS,MAAM,GAAG;AACrC,IAAI,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;AACvE,CAAC,CAAC;AACF;AACA;AACA;AACA;AACA,SAAS,CAAC,YAAY,GAAG,SAAS,YAAY,GAAG;AACjD,IAAI,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;AAC7E,CAAC,CAAC;AACF;AACA;AACA;AACA;AACA,SAAS,CAAC,SAAS,GAAG,SAAS,SAAS,GAAG;AAC3C,IAAI,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;AAC1E,CAAC,CAAC;AACF;AACA,MAAM,CAAC,OAAO,GAAG,SAAS;ACtE1B","file":"jdenticon-node.js","sourcesContent":["/**\r\n * Jdenticon 3.1.0\r\n * http://jdenticon.com\r\n *\r\n * Built: 2020-12-12T13:51:48.709Z\r\n * \r\n * MIT License\r\n * \r\n * Copyright (c) 2014-2020 Daniel Mester Pirttijärvi\r\n * \r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n * \r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n * \r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n */\r\n\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Parses a substring of the hash as a number.\r\n * @param {number} startPosition \r\n * @param {number=} octets\r\n */\r\nexport function parseHex(hash, startPosition, octets) {\r\n return parseInt(hash.substr(startPosition, octets), 16);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { parseHex } from \"../common/parseHex\";\r\n\r\nfunction decToHex(v) {\r\n v |= 0; // Ensure integer value\r\n return v < 0 ? \"00\" :\r\n v < 16 ? \"0\" + v.toString(16) :\r\n v < 256 ? v.toString(16) :\r\n \"ff\";\r\n}\r\n\r\nfunction hueToRgb(m1, m2, h) {\r\n h = h < 0 ? h + 6 : h > 6 ? h - 6 : h;\r\n return decToHex(255 * (\r\n h < 1 ? m1 + (m2 - m1) * h :\r\n h < 3 ? m2 :\r\n h < 4 ? m1 + (m2 - m1) * (4 - h) :\r\n m1));\r\n}\r\n\r\n/**\r\n * @param {number} r Red channel [0, 255]\r\n * @param {number} g Green channel [0, 255]\r\n * @param {number} b Blue channel [0, 255]\r\n */\r\nexport function rgb(r, g, b) {\r\n return \"#\" + decToHex(r) + decToHex(g) + decToHex(b);\r\n}\r\n\r\n/**\r\n * @param {string} color Color value to parse. Currently hexadecimal strings on the format #rgb[a] and #rrggbb[aa] are supported.\r\n * @returns {string}\r\n */\r\nexport function parseColor(color) {\r\n if (/^#[0-9a-f]{3,8}$/i.test(color)) {\r\n let result;\r\n const colorLength = color.length;\r\n\r\n if (colorLength < 6) {\r\n const r = color[1],\r\n g = color[2],\r\n b = color[3],\r\n a = color[4] || \"\";\r\n result = \"#\" + r + r + g + g + b + b + a + a;\r\n }\r\n if (colorLength == 7 || colorLength > 8) {\r\n result = color;\r\n }\r\n \r\n return result;\r\n }\r\n}\r\n\r\n/**\r\n * Converts a hexadecimal color to a CSS3 compatible color.\r\n * @param {string} hexColor Color on the format \"#RRGGBB\" or \"#RRGGBBAA\"\r\n * @returns {string}\r\n */\r\nexport function toCss3Color(hexColor) {\r\n const a = parseHex(hexColor, 7, 2);\r\n let result;\r\n\r\n if (isNaN(a)) {\r\n result = hexColor;\r\n } else {\r\n const r = parseHex(hexColor, 1, 2),\r\n g = parseHex(hexColor, 3, 2),\r\n b = parseHex(hexColor, 5, 2);\r\n result = \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + (a / 255).toFixed(2) + \")\";\r\n }\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * Converts an HSL color to a hexadecimal RGB color.\r\n * @param {number} hue Hue in range [0, 1]\r\n * @param {number} saturation Saturation in range [0, 1]\r\n * @param {number} lightness Lightness in range [0, 1]\r\n * @returns {string}\r\n */\r\nexport function hsl(hue, saturation, lightness) {\r\n // Based on http://www.w3.org/TR/2011/REC-css3-color-20110607/#hsl-color\r\n let result;\r\n\r\n if (saturation == 0) {\r\n const partialHex = decToHex(lightness * 255);\r\n result = partialHex + partialHex + partialHex;\r\n }\r\n else {\r\n const m2 = lightness <= 0.5 ? lightness * (saturation + 1) : lightness + saturation - lightness * saturation,\r\n m1 = lightness * 2 - m2;\r\n result =\r\n hueToRgb(m1, m2, hue * 6 + 2) +\r\n hueToRgb(m1, m2, hue * 6) +\r\n hueToRgb(m1, m2, hue * 6 - 2);\r\n }\r\n\r\n return \"#\" + result;\r\n}\r\n\r\n/**\r\n * Converts an HSL color to a hexadecimal RGB color. This function will correct the lightness for the \"dark\" hues\r\n * @param {number} hue Hue in range [0, 1]\r\n * @param {number} saturation Saturation in range [0, 1]\r\n * @param {number} lightness Lightness in range [0, 1]\r\n * @returns {string}\r\n */\r\nexport function correctedHsl(hue, saturation, lightness) {\r\n // The corrector specifies the perceived middle lightness for each hue\r\n const correctors = [ 0.55, 0.5, 0.5, 0.46, 0.6, 0.55, 0.55 ],\r\n corrector = correctors[(hue * 6 + 0.5) | 0];\r\n \r\n // Adjust the input lightness relative to the corrector\r\n lightness = lightness < 0.5 ? lightness * corrector * 2 : corrector + (lightness - 0.5) * (1 - corrector) * 2;\r\n \r\n return hsl(hue, saturation, lightness);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n// In the future we can replace `GLOBAL` with `globalThis`, but for now use the old school global detection for\r\n// backward compatibility.\r\n\r\nexport const GLOBAL = \r\n typeof window !== \"undefined\" ? window :\r\n typeof self !== \"undefined\" ? self :\r\n typeof global !== \"undefined\" ? global :\r\n {};\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { parseColor } from \"../renderer/color\";\r\nimport { GLOBAL } from \"./global\";\r\n\r\n/**\r\n * @typedef {Object} ParsedConfiguration\r\n * @property {number} colorSaturation\r\n * @property {number} grayscaleSaturation\r\n * @property {string} backColor\r\n * @property {number} iconPadding\r\n * @property {function(number):number} hue\r\n * @property {function(number):number} colorLightness\r\n * @property {function(number):number} grayscaleLightness\r\n */\r\n\r\nexport const CONFIG_PROPERTIES = {\r\n GLOBAL: \"jdenticon_config\",\r\n MODULE: \"config\",\r\n};\r\n\r\nvar rootConfigurationHolder = {};\r\n\r\n/**\r\n * Defines the deprecated `config` property on the root Jdenticon object. When the property is set a warning is \r\n * printed in the console. To minimize bundle size, this is only used in Node bundles.\r\n * @param {!Object} rootObject \r\n */\r\nexport function defineConfigPropertyWithWarn(rootObject) {\r\n Object.defineProperty(rootObject, CONFIG_PROPERTIES.MODULE, {\r\n configurable: true,\r\n get: () => rootConfigurationHolder[CONFIG_PROPERTIES.MODULE],\r\n set: newConfiguration => {\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] = newConfiguration;\r\n console.warn(\"jdenticon.config is deprecated. Use jdenticon.configure() instead.\");\r\n },\r\n });\r\n}\r\n\r\n/**\r\n * Defines the deprecated `config` property on the root Jdenticon object without printing a warning in the console\r\n * when it is being used.\r\n * @param {!Object} rootObject \r\n */\r\nexport function defineConfigProperty(rootObject) {\r\n rootConfigurationHolder = rootObject;\r\n}\r\n\r\n/**\r\n * Sets a new icon style configuration. The new configuration is not merged with the previous one. * \r\n * @param {Object} newConfiguration - New configuration object.\r\n */\r\nexport function configure(newConfiguration) {\r\n if (arguments.length) {\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] = newConfiguration;\r\n }\r\n return rootConfigurationHolder[CONFIG_PROPERTIES.MODULE];\r\n}\r\n\r\n/**\r\n * Gets the normalized current Jdenticon color configuration. Missing fields have default values.\r\n * @param {Object|number|undefined} paddingOrLocalConfig - Configuration passed to the called API method. A\r\n * local configuration overrides the global configuration in it entirety. This parameter can for backward\r\n * compatibility also contain a padding value. A padding value only overrides the global padding, not the\r\n * entire global configuration.\r\n * @param {number} defaultPadding - Padding used if no padding is specified in neither the configuration nor\r\n * explicitly to the API method.\r\n * @returns {ParsedConfiguration}\r\n */\r\nexport function getConfiguration(paddingOrLocalConfig, defaultPadding) {\r\n const configObject = \r\n typeof paddingOrLocalConfig == \"object\" && paddingOrLocalConfig ||\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] ||\r\n GLOBAL[CONFIG_PROPERTIES.GLOBAL] ||\r\n { },\r\n\r\n lightnessConfig = configObject[\"lightness\"] || { },\r\n \r\n // In versions < 2.1.0 there was no grayscale saturation -\r\n // saturation was the color saturation.\r\n saturation = configObject[\"saturation\"] || { },\r\n colorSaturation = \"color\" in saturation ? saturation[\"color\"] : saturation,\r\n grayscaleSaturation = saturation[\"grayscale\"],\r\n\r\n backColor = configObject[\"backColor\"],\r\n padding = configObject[\"padding\"];\r\n \r\n /**\r\n * Creates a lightness range.\r\n */\r\n function lightness(configName, defaultRange) {\r\n let range = lightnessConfig[configName];\r\n \r\n // Check if the lightness range is an array-like object. This way we ensure the\r\n // array contain two values at the same time.\r\n if (!(range && range.length > 1)) {\r\n range = defaultRange;\r\n }\r\n\r\n /**\r\n * Gets a lightness relative the specified value in the specified lightness range.\r\n */\r\n return function (value) {\r\n value = range[0] + value * (range[1] - range[0]);\r\n return value < 0 ? 0 : value > 1 ? 1 : value;\r\n };\r\n }\r\n\r\n /**\r\n * Gets a hue allowed by the configured hue restriction,\r\n * provided the originally computed hue.\r\n */\r\n function hueFunction(originalHue) {\r\n const hueConfig = configObject[\"hues\"];\r\n let hue;\r\n \r\n // Check if 'hues' is an array-like object. This way we also ensure that\r\n // the array is not empty, which would mean no hue restriction.\r\n if (hueConfig && hueConfig.length > 0) {\r\n // originalHue is in the range [0, 1]\r\n // Multiply with 0.999 to change the range to [0, 1) and then truncate the index.\r\n hue = hueConfig[0 | (0.999 * originalHue * hueConfig.length)];\r\n }\r\n\r\n return typeof hue == \"number\" ?\r\n \r\n // A hue was specified. We need to convert the hue from\r\n // degrees on any turn - e.g. 746° is a perfectly valid hue -\r\n // to turns in the range [0, 1).\r\n ((((hue / 360) % 1) + 1) % 1) :\r\n\r\n // No hue configured => use original hue\r\n originalHue;\r\n }\r\n \r\n return {\r\n hue: hueFunction,\r\n colorSaturation: typeof colorSaturation == \"number\" ? colorSaturation : 0.5,\r\n grayscaleSaturation: typeof grayscaleSaturation == \"number\" ? grayscaleSaturation : 0,\r\n colorLightness: lightness(\"color\", [0.4, 0.8]),\r\n grayscaleLightness: lightness(\"grayscale\", [0.3, 0.9]),\r\n backColor: parseColor(backColor),\r\n iconPadding: \r\n typeof paddingOrLocalConfig == \"number\" ? paddingOrLocalConfig : \r\n typeof padding == \"number\" ? padding : \r\n defaultPadding\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Represents a point.\r\n */\r\nexport class Point {\r\n /**\r\n * @param {number} x \r\n * @param {number} y \r\n */\r\n constructor(x, y) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { Point } from \"./point\";\r\n\r\n/**\r\n * Translates and rotates a point before being passed on to the canvas context. This was previously done by the canvas context itself, \r\n * but this caused a rendering issue in Chrome on sizes > 256 where the rotation transformation of inverted paths was not done properly.\r\n */\r\nexport class Transform {\r\n /**\r\n * @param {number} x The x-coordinate of the upper left corner of the transformed rectangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the transformed rectangle.\r\n * @param {number} size The size of the transformed rectangle.\r\n * @param {number} rotation Rotation specified as 0 = 0 rad, 1 = 0.5π rad, 2 = π rad, 3 = 1.5π rad\r\n */\r\n constructor(x, y, size, rotation) {\r\n this._x = x;\r\n this._y = y;\r\n this._size = size;\r\n this._rotation = rotation;\r\n }\r\n\r\n /**\r\n * Transforms the specified point based on the translation and rotation specification for this Transform.\r\n * @param {number} x x-coordinate\r\n * @param {number} y y-coordinate\r\n * @param {number=} w The width of the transformed rectangle. If greater than 0, this will ensure the returned point is of the upper left corner of the transformed rectangle.\r\n * @param {number=} h The height of the transformed rectangle. If greater than 0, this will ensure the returned point is of the upper left corner of the transformed rectangle.\r\n */\r\n transformIconPoint(x, y, w, h) {\r\n const right = this._x + this._size,\r\n bottom = this._y + this._size,\r\n rotation = this._rotation;\r\n return rotation === 1 ? new Point(right - y - (h || 0), this._y + x) :\r\n rotation === 2 ? new Point(right - x - (w || 0), bottom - y - (h || 0)) :\r\n rotation === 3 ? new Point(this._x + y, bottom - x - (w || 0)) :\r\n new Point(this._x + x, this._y + y);\r\n }\r\n}\r\n\r\nexport const NO_TRANSFORM = new Transform(0, 0, 0, 0);\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { NO_TRANSFORM } from \"./transform\";\r\n\r\n/**\r\n * @typedef {import(\"./renderer\").Renderer} Renderer\r\n * @typedef {import(\"./transform\").Transform} Transform\r\n */\r\n\r\n/**\r\n * Provides helper functions for rendering common basic shapes.\r\n */\r\nexport class Graphics {\r\n /**\r\n * @param {Renderer} renderer \r\n */\r\n constructor(renderer) {\r\n /**\r\n * @type {Renderer}\r\n * @private\r\n */\r\n this._renderer = renderer;\r\n\r\n /**\r\n * @type {Transform}\r\n */\r\n this.currentTransform = NO_TRANSFORM;\r\n }\r\n\r\n /**\r\n * Adds a polygon to the underlying renderer.\r\n * @param {Array} points The points of the polygon clockwise on the format [ x0, y0, x1, y1, ..., xn, yn ]\r\n * @param {boolean=} invert Specifies if the polygon will be inverted.\r\n */\r\n addPolygon(points, invert) {\r\n const di = invert ? -2 : 2,\r\n transformedPoints = [];\r\n \r\n for (let i = invert ? points.length - 2 : 0; i < points.length && i >= 0; i += di) {\r\n transformedPoints.push(this.currentTransform.transformIconPoint(points[i], points[i + 1]));\r\n }\r\n \r\n this._renderer.addPolygon(transformedPoints);\r\n }\r\n \r\n /**\r\n * Adds a polygon to the underlying renderer.\r\n * Source: http://stackoverflow.com/a/2173084\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the entire ellipse.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the entire ellipse.\r\n * @param {number} size The size of the ellipse.\r\n * @param {boolean=} invert Specifies if the ellipse will be inverted.\r\n */\r\n addCircle(x, y, size, invert) {\r\n const p = this.currentTransform.transformIconPoint(x, y, size, size);\r\n this._renderer.addCircle(p, size, invert);\r\n }\r\n\r\n /**\r\n * Adds a rectangle to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle.\r\n * @param {number} w The width of the rectangle.\r\n * @param {number} h The height of the rectangle.\r\n * @param {boolean=} invert Specifies if the rectangle will be inverted.\r\n */\r\n addRectangle(x, y, w, h, invert) {\r\n this.addPolygon([\r\n x, y, \r\n x + w, y,\r\n x + w, y + h,\r\n x, y + h\r\n ], invert);\r\n }\r\n\r\n /**\r\n * Adds a right triangle to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the triangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the triangle.\r\n * @param {number} w The width of the triangle.\r\n * @param {number} h The height of the triangle.\r\n * @param {number} r The rotation of the triangle (clockwise). 0 = right corner of the triangle in the lower left corner of the bounding rectangle.\r\n * @param {boolean=} invert Specifies if the triangle will be inverted.\r\n */\r\n addTriangle(x, y, w, h, r, invert) {\r\n const points = [\r\n x + w, y, \r\n x + w, y + h, \r\n x, y + h,\r\n x, y\r\n ];\r\n points.splice(((r || 0) % 4) * 2, 2);\r\n this.addPolygon(points, invert);\r\n }\r\n\r\n /**\r\n * Adds a rhombus to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the rhombus.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the rhombus.\r\n * @param {number} w The width of the rhombus.\r\n * @param {number} h The height of the rhombus.\r\n * @param {boolean=} invert Specifies if the rhombus will be inverted.\r\n */\r\n addRhombus(x, y, w, h, invert) {\r\n this.addPolygon([\r\n x + w / 2, y,\r\n x + w, y + h / 2,\r\n x + w / 2, y + h,\r\n x, y + h / 2\r\n ], invert);\r\n }\r\n}","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * @param {number} index\r\n * @param {Graphics} g\r\n * @param {number} cell\r\n * @param {number} positionIndex\r\n * @typedef {import('./graphics').Graphics} Graphics\r\n */\r\nexport function centerShape(index, g, cell, positionIndex) {\r\n index = index % 14;\r\n\r\n let k, m, w, h, inner, outer;\r\n\r\n !index ? (\r\n k = cell * 0.42,\r\n g.addPolygon([\r\n 0, 0,\r\n cell, 0,\r\n cell, cell - k * 2,\r\n cell - k, cell,\r\n 0, cell\r\n ])) :\r\n\r\n index == 1 ? (\r\n w = 0 | (cell * 0.5), \r\n h = 0 | (cell * 0.8),\r\n\r\n g.addTriangle(cell - w, 0, w, h, 2)) :\r\n\r\n index == 2 ? (\r\n w = 0 | (cell / 3),\r\n g.addRectangle(w, w, cell - w, cell - w)) :\r\n\r\n index == 3 ? (\r\n inner = cell * 0.1,\r\n // Use fixed outer border widths in small icons to ensure the border is drawn\r\n outer = \r\n cell < 6 ? 1 :\r\n cell < 8 ? 2 :\r\n (0 | (cell * 0.25)),\r\n \r\n inner = \r\n inner > 1 ? (0 | inner) : // large icon => truncate decimals\r\n inner > 0.5 ? 1 : // medium size icon => fixed width\r\n inner, // small icon => anti-aliased border\r\n\r\n g.addRectangle(outer, outer, cell - inner - outer, cell - inner - outer)) :\r\n\r\n index == 4 ? (\r\n m = 0 | (cell * 0.15),\r\n w = 0 | (cell * 0.5),\r\n g.addCircle(cell - w - m, cell - w - m, w)) :\r\n\r\n index == 5 ? (\r\n inner = cell * 0.1,\r\n outer = inner * 4,\r\n\r\n // Align edge to nearest pixel in large icons\r\n outer > 3 && (outer = 0 | outer),\r\n \r\n g.addRectangle(0, 0, cell, cell),\r\n g.addPolygon([\r\n outer, outer,\r\n cell - inner, outer,\r\n outer + (cell - outer - inner) / 2, cell - inner\r\n ], true)) :\r\n\r\n index == 6 ? \r\n g.addPolygon([\r\n 0, 0,\r\n cell, 0,\r\n cell, cell * 0.7,\r\n cell * 0.4, cell * 0.4,\r\n cell * 0.7, cell,\r\n 0, cell\r\n ]) :\r\n\r\n index == 7 ? \r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 3) :\r\n\r\n index == 8 ? (\r\n g.addRectangle(0, 0, cell, cell / 2),\r\n g.addRectangle(0, cell / 2, cell / 2, cell / 2),\r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 1)) :\r\n\r\n index == 9 ? (\r\n inner = cell * 0.14,\r\n // Use fixed outer border widths in small icons to ensure the border is drawn\r\n outer = \r\n cell < 4 ? 1 :\r\n cell < 6 ? 2 :\r\n (0 | (cell * 0.35)),\r\n\r\n inner = \r\n cell < 8 ? inner : // small icon => anti-aliased border\r\n (0 | inner), // large icon => truncate decimals\r\n\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addRectangle(outer, outer, cell - outer - inner, cell - outer - inner, true)) :\r\n\r\n index == 10 ? (\r\n inner = cell * 0.12,\r\n outer = inner * 3,\r\n\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addCircle(outer, outer, cell - inner - outer, true)) :\r\n\r\n index == 11 ? \r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 3) :\r\n\r\n index == 12 ? (\r\n m = cell * 0.25,\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addRhombus(m, m, cell - m, cell - m, true)) :\r\n\r\n // 13\r\n (\r\n !positionIndex && (\r\n m = cell * 0.4, w = cell * 1.2,\r\n g.addCircle(m, m, w)\r\n )\r\n );\r\n}\r\n\r\n/**\r\n * @param {number} index\r\n * @param {Graphics} g\r\n * @param {number} cell\r\n */\r\nexport function outerShape(index, g, cell) {\r\n index = index % 4;\r\n\r\n let m;\r\n\r\n !index ?\r\n g.addTriangle(0, 0, cell, cell, 0) :\r\n \r\n index == 1 ?\r\n g.addTriangle(0, cell / 2, cell, cell / 2, 0) :\r\n\r\n index == 2 ?\r\n g.addRhombus(0, 0, cell, cell) :\r\n\r\n // 3\r\n (\r\n m = cell / 6,\r\n g.addCircle(m, m, cell - 2 * m)\r\n );\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { correctedHsl } from \"./color\";\r\n\r\n/**\r\n * Gets a set of identicon color candidates for a specified hue and config.\r\n * @param {number} hue\r\n * @param {import(\"../common/configuration\").ParsedConfiguration} config\r\n */\r\nexport function colorTheme(hue, config) {\r\n hue = config.hue(hue);\r\n return [\r\n // Dark gray\r\n correctedHsl(hue, config.grayscaleSaturation, config.grayscaleLightness(0)),\r\n // Mid color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(0.5)),\r\n // Light gray\r\n correctedHsl(hue, config.grayscaleSaturation, config.grayscaleLightness(1)),\r\n // Light color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(1)),\r\n // Dark color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(0))\r\n ];\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { Transform } from \"./transform\";\r\nimport { Graphics } from \"./graphics\";\r\nimport { centerShape, outerShape } from \"./shapes\";\r\nimport { colorTheme } from \"./colorTheme\";\r\nimport { parseHex } from \"../common/parseHex\";\r\nimport { getConfiguration } from \"../common/configuration\";\r\n \r\n/**\r\n * Draws an identicon to a specified renderer.\r\n * @param {import('./renderer').Renderer} renderer\r\n * @param {string} hash\r\n * @param {Object|number=} config\r\n */\r\nexport function iconGenerator(renderer, hash, config) {\r\n const parsedConfig = getConfiguration(config, 0.08);\r\n\r\n // Set background color\r\n if (parsedConfig.backColor) {\r\n renderer.setBackground(parsedConfig.backColor);\r\n }\r\n \r\n // Calculate padding and round to nearest integer\r\n let size = renderer.iconSize;\r\n const padding = (0.5 + size * parsedConfig.iconPadding) | 0;\r\n size -= padding * 2;\r\n \r\n const graphics = new Graphics(renderer);\r\n \r\n // Calculate cell size and ensure it is an integer\r\n const cell = 0 | (size / 4);\r\n \r\n // Since the cell size is integer based, the actual icon will be slightly smaller than specified => center icon\r\n const x = 0 | (padding + size / 2 - cell * 2);\r\n const y = 0 | (padding + size / 2 - cell * 2);\r\n\r\n function renderShape(colorIndex, shapes, index, rotationIndex, positions) {\r\n const shapeIndex = parseHex(hash, index, 1);\r\n let r = rotationIndex ? parseHex(hash, rotationIndex, 1) : 0;\r\n \r\n renderer.beginShape(availableColors[selectedColorIndexes[colorIndex]]);\r\n \r\n for (let i = 0; i < positions.length; i++) {\r\n graphics.currentTransform = new Transform(x + positions[i][0] * cell, y + positions[i][1] * cell, cell, r++ % 4);\r\n shapes(shapeIndex, graphics, cell, i);\r\n }\r\n \r\n renderer.endShape();\r\n }\r\n\r\n // AVAILABLE COLORS\r\n const hue = parseHex(hash, -7) / 0xfffffff,\r\n \r\n // Available colors for this icon\r\n availableColors = colorTheme(hue, parsedConfig),\r\n\r\n // The index of the selected colors\r\n selectedColorIndexes = [];\r\n\r\n let index;\r\n\r\n function isDuplicate(values) {\r\n if (values.indexOf(index) >= 0) {\r\n for (let i = 0; i < values.length; i++) {\r\n if (selectedColorIndexes.indexOf(values[i]) >= 0) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n for (let i = 0; i < 3; i++) {\r\n index = parseHex(hash, 8 + i, 1) % availableColors.length;\r\n if (isDuplicate([0, 4]) || // Disallow dark gray and dark color combo\r\n isDuplicate([2, 3])) { // Disallow light gray and light color combo\r\n index = 1;\r\n }\r\n selectedColorIndexes.push(index);\r\n }\r\n\r\n // ACTUAL RENDERING\r\n // Sides\r\n renderShape(0, outerShape, 2, 3, [[1, 0], [2, 0], [2, 3], [1, 3], [0, 1], [3, 1], [3, 2], [0, 2]]);\r\n // Corners\r\n renderShape(1, outerShape, 4, 5, [[0, 0], [3, 0], [3, 3], [0, 3]]);\r\n // Center\r\n renderShape(2, centerShape, 1, null, [[1, 1], [2, 1], [2, 2], [1, 2]]);\r\n \r\n renderer.finish();\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Computes a SHA1 hash for any value and returns it as a hexadecimal string.\r\n * \r\n * This function is optimized for minimal code size and rather short messages.\r\n * \r\n * @param {string} message \r\n */\r\nexport function sha1(message) {\r\n const HASH_SIZE_HALF_BYTES = 40;\r\n const BLOCK_SIZE_WORDS = 16;\r\n\r\n // Variables\r\n // `var` is used to be able to minimize the number of `var` keywords.\r\n var i = 0,\r\n f = 0,\r\n \r\n // Use `encodeURI` to UTF8 encode the message without any additional libraries\r\n // We could use `unescape` + `encodeURI` to minimize the code, but that would be slightly risky\r\n // since `unescape` is deprecated.\r\n urlEncodedMessage = encodeURI(message) + \"%80\", // trailing '1' bit padding\r\n \r\n // This can be changed to a preallocated Uint32Array array for greater performance and larger code size\r\n data = [],\r\n dataSize,\r\n \r\n hashBuffer = [],\r\n\r\n a = 0x67452301,\r\n b = 0xefcdab89,\r\n c = ~a,\r\n d = ~b,\r\n e = 0xc3d2e1f0,\r\n hash = [a, b, c, d, e],\r\n\r\n blockStartIndex = 0,\r\n hexHash = \"\";\r\n\r\n /**\r\n * Rotates the value a specified number of bits to the left.\r\n * @param {number} value Value to rotate\r\n * @param {number} shift Bit count to shift.\r\n */\r\n function rotl(value, shift) {\r\n return (value << shift) | (value >>> (32 - shift));\r\n }\r\n\r\n // Message data\r\n for ( ; i < urlEncodedMessage.length; f++) {\r\n data[f >> 2] = data[f >> 2] |\r\n (\r\n (\r\n urlEncodedMessage[i] == \"%\"\r\n // Percent encoded byte\r\n ? parseInt(urlEncodedMessage.substring(i + 1, i += 3), 16)\r\n // Unencoded byte\r\n : urlEncodedMessage.charCodeAt(i++)\r\n )\r\n\r\n // Read bytes in reverse order (big endian words)\r\n << ((3 - (f & 3)) * 8)\r\n );\r\n }\r\n\r\n // f is now the length of the utf8 encoded message\r\n // 7 = 8 bytes (64 bit) for message size, -1 to round down\r\n // >> 6 = integer division with block size\r\n dataSize = (((f + 7) >> 6) + 1) * BLOCK_SIZE_WORDS;\r\n\r\n // Message size in bits.\r\n // SHA1 uses a 64 bit integer to represent the size, but since we only support short messages only the least\r\n // significant 32 bits are set. -8 is for the '1' bit padding byte.\r\n data[dataSize - 1] = f * 8 - 8;\r\n \r\n // Compute hash\r\n for ( ; blockStartIndex < dataSize; blockStartIndex += BLOCK_SIZE_WORDS) {\r\n for (i = 0; i < 80; i++) {\r\n f = rotl(a, 5) + e + (\r\n // Ch\r\n i < 20 ? ((b & c) ^ ((~b) & d)) + 0x5a827999 :\r\n \r\n // Parity\r\n i < 40 ? (b ^ c ^ d) + 0x6ed9eba1 :\r\n \r\n // Maj\r\n i < 60 ? ((b & c) ^ (b & d) ^ (c & d)) + 0x8f1bbcdc :\r\n \r\n // Parity\r\n (b ^ c ^ d) + 0xca62c1d6\r\n ) + ( \r\n hashBuffer[i] = i < BLOCK_SIZE_WORDS\r\n // Bitwise OR is used to coerse `undefined` to 0\r\n ? (data[blockStartIndex + i] | 0)\r\n : rotl(hashBuffer[i - 3] ^ hashBuffer[i - 8] ^ hashBuffer[i - 14] ^ hashBuffer[i - 16], 1)\r\n );\r\n\r\n e = d;\r\n d = c;\r\n c = rotl(b, 30);\r\n b = a;\r\n a = f;\r\n }\r\n\r\n hash[0] = a = ((hash[0] + a) | 0);\r\n hash[1] = b = ((hash[1] + b) | 0);\r\n hash[2] = c = ((hash[2] + c) | 0);\r\n hash[3] = d = ((hash[3] + d) | 0);\r\n hash[4] = e = ((hash[4] + e) | 0);\r\n }\r\n\r\n // Format hex hash\r\n for (i = 0; i < HASH_SIZE_HALF_BYTES; i++) {\r\n hexHash += (\r\n (\r\n // Get word (2^3 half-bytes per word)\r\n hash[i >> 3] >>>\r\n\r\n // Append half-bytes in reverse order\r\n ((7 - (i & 7)) * 4)\r\n ) \r\n // Clamp to half-byte\r\n & 0xf\r\n ).toString(16);\r\n }\r\n\r\n return hexHash;\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { sha1 } from \"./sha1\";\r\n\r\n/**\r\n * Inputs a value that might be a valid hash string for Jdenticon and returns it \r\n * if it is determined valid, otherwise a falsy value is returned.\r\n */\r\nexport function isValidHash(hashCandidate) {\r\n return /^[0-9a-f]{11,}$/i.test(hashCandidate) && hashCandidate;\r\n}\r\n\r\n/**\r\n * Computes a hash for the specified value. Currently SHA1 is used. This function\r\n * always returns a valid hash.\r\n */\r\nexport function computeHash(value) {\r\n return sha1(value == null ? \"\" : \"\" + value);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { toCss3Color } from \"../color\";\r\n\r\n/**\r\n * @typedef {import(\"../renderer\").Renderer} Renderer\r\n * @typedef {import('../point').Point} Point\r\n */\r\n\r\n/**\r\n * Renderer redirecting drawing commands to a canvas context.\r\n * @implements {Renderer}\r\n */\r\nexport class CanvasRenderer {\r\n /**\r\n * @param {number=} iconSize\r\n */\r\n constructor(ctx, iconSize) {\r\n const canvas = ctx.canvas; \r\n const width = canvas.width;\r\n const height = canvas.height;\r\n \r\n ctx.save();\r\n \r\n if (!iconSize) {\r\n iconSize = Math.min(width, height);\r\n \r\n ctx.translate(\r\n ((width - iconSize) / 2) | 0,\r\n ((height - iconSize) / 2) | 0);\r\n }\r\n\r\n /**\r\n * @private\r\n */\r\n this._ctx = ctx;\r\n this.iconSize = iconSize;\r\n \r\n ctx.clearRect(0, 0, iconSize, iconSize);\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb[aa].\r\n */\r\n setBackground(fillColor) {\r\n const ctx = this._ctx;\r\n const iconSize = this.iconSize;\r\n\r\n ctx.fillStyle = toCss3Color(fillColor);\r\n ctx.fillRect(0, 0, iconSize, iconSize);\r\n }\r\n\r\n /**\r\n * Marks the beginning of a new shape of the specified color. Should be ended with a call to endShape.\r\n * @param {string} fillColor Fill color on format #rrggbb[aa].\r\n */\r\n beginShape(fillColor) {\r\n const ctx = this._ctx;\r\n ctx.fillStyle = toCss3Color(fillColor);\r\n ctx.beginPath();\r\n }\r\n\r\n /**\r\n * Marks the end of the currently drawn shape. This causes the queued paths to be rendered on the canvas.\r\n */\r\n endShape() {\r\n this._ctx.fill();\r\n }\r\n\r\n /**\r\n * Adds a polygon to the rendering queue.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n const ctx = this._ctx;\r\n ctx.moveTo(points[0].x, points[0].y);\r\n for (let i = 1; i < points.length; i++) {\r\n ctx.lineTo(points[i].x, points[i].y);\r\n }\r\n ctx.closePath();\r\n }\r\n\r\n /**\r\n * Adds a circle to the rendering queue.\r\n * @param {Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n const ctx = this._ctx,\r\n radius = diameter / 2;\r\n ctx.moveTo(point.x + radius, point.y + radius);\r\n ctx.arc(point.x + radius, point.y + radius, radius, 0, Math.PI * 2, counterClockwise);\r\n ctx.closePath();\r\n }\r\n\r\n /**\r\n * Called when the icon has been completely drawn.\r\n */\r\n finish() {\r\n this._ctx.restore();\r\n }\r\n}\r\n","import { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { CanvasRenderer } from \"../renderer/canvas/canvasRenderer\";\r\n\r\n/**\r\n * Draws an identicon to a context.\r\n * @param {CanvasRenderingContext2D} ctx - Canvas context on which the icon will be drawn at location (0, 0).\r\n * @param {*} hashOrValue - A hexadecimal hash string or any value that will be hashed by Jdenticon.\r\n * @param {number} size - Icon size in pixels.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compatibility a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function drawIcon(ctx, hashOrValue, size, config) {\r\n if (!ctx) {\r\n throw new Error(\"No canvas specified.\");\r\n }\r\n \r\n iconGenerator(new CanvasRenderer(ctx, size), \r\n isValidHash(hashOrValue) || computeHash(hashOrValue), \r\n config);\r\n}\r\n","import canvasRenderer from \"canvas-renderer\";\r\nimport { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { CanvasRenderer } from \"../renderer/canvas/canvasRenderer\";\r\n\r\n/**\r\n * Draws an identicon as PNG.\r\n * @param {*} hashOrValue - A hexadecimal hash string or any value that will be hashed by Jdenticon.\r\n * @param {number} size - Icon size in pixels.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compatibility a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n * @returns {Buffer} PNG data\r\n */\r\nexport function toPng(hashOrValue, size, config) {\r\n const canvas = canvasRenderer.createCanvas(size, size);\r\n const ctx = canvas.getContext(\"2d\");\r\n \r\n iconGenerator(new CanvasRenderer(ctx, size), \r\n isValidHash(hashOrValue) || computeHash(hashOrValue), \r\n config);\r\n \r\n return canvas.toPng({ \"Software\": \"Jdenticon\" });\r\n}","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Prepares a measure to be used as a measure in an SVG path, by\r\n * rounding the measure to a single decimal. This reduces the file\r\n * size of the generated SVG with more than 50% in some cases.\r\n */\r\nfunction svgValue(value) {\r\n return ((value * 10 + 0.5) | 0) / 10;\r\n}\r\n\r\n/**\r\n * Represents an SVG path element.\r\n */\r\nexport class SvgPath {\r\n constructor() {\r\n /**\r\n * This property holds the data string (path.d) of the SVG path.\r\n * @type {string}\r\n */\r\n this.dataString = \"\";\r\n }\r\n\r\n /**\r\n * Adds a polygon with the current fill color to the SVG path.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n let dataString = \"\";\r\n for (let i = 0; i < points.length; i++) {\r\n dataString += (i ? \"L\" : \"M\") + svgValue(points[i].x) + \" \" + svgValue(points[i].y);\r\n }\r\n this.dataString += dataString + \"Z\";\r\n }\r\n\r\n /**\r\n * Adds a circle with the current fill color to the SVG path.\r\n * @param {import('../point').Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n const sweepFlag = counterClockwise ? 0 : 1,\r\n svgRadius = svgValue(diameter / 2),\r\n svgDiameter = svgValue(diameter),\r\n svgArc = \"a\" + svgRadius + \",\" + svgRadius + \" 0 1,\" + sweepFlag + \" \";\r\n \r\n this.dataString += \r\n \"M\" + svgValue(point.x) + \" \" + svgValue(point.y + diameter / 2) +\r\n svgArc + svgDiameter + \",0\" + \r\n svgArc + (-svgDiameter) + \",0\";\r\n }\r\n}\r\n\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { SvgPath } from \"./svgPath\";\r\nimport { parseHex } from \"../../common/parseHex\";\r\n\r\n/**\r\n * @typedef {import(\"../point\").Point} Point\r\n * @typedef {import(\"../renderer\").Renderer} Renderer\r\n * @typedef {import(\"./svgElement\").SvgElement} SvgElement\r\n * @typedef {import(\"./svgWriter\").SvgWriter} SvgWriter\r\n */\r\n\r\n/**\r\n * Renderer producing SVG output.\r\n * @implements {Renderer}\r\n */\r\nexport class SvgRenderer {\r\n /**\r\n * @param {SvgElement|SvgWriter} target \r\n */\r\n constructor(target) {\r\n /**\r\n * @type {SvgPath}\r\n * @private\r\n */\r\n this._path;\r\n\r\n /**\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._pathsByColor = { };\r\n\r\n /**\r\n * @type {SvgElement|SvgWriter}\r\n * @private\r\n */\r\n this._target = target;\r\n\r\n /**\r\n * @type {number}\r\n */\r\n this.iconSize = target.iconSize;\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb[aa].\r\n */\r\n setBackground(fillColor) {\r\n const match = /^(#......)(..)?/.exec(fillColor),\r\n opacity = match[2] ? parseHex(match[2], 0) / 255 : 1;\r\n this._target.setBackground(match[1], opacity);\r\n }\r\n\r\n /**\r\n * Marks the beginning of a new shape of the specified color. Should be ended with a call to endShape.\r\n * @param {string} color Fill color on format #xxxxxx.\r\n */\r\n beginShape(color) {\r\n this._path = this._pathsByColor[color] || (this._pathsByColor[color] = new SvgPath());\r\n }\r\n\r\n /**\r\n * Marks the end of the currently drawn shape.\r\n */\r\n endShape() { }\r\n\r\n /**\r\n * Adds a polygon with the current fill color to the SVG.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n this._path.addPolygon(points);\r\n }\r\n\r\n /**\r\n * Adds a circle with the current fill color to the SVG.\r\n * @param {Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n this._path.addCircle(point, diameter, counterClockwise);\r\n }\r\n\r\n /**\r\n * Called when the icon has been completely drawn.\r\n */\r\n finish() { \r\n const pathsByColor = this._pathsByColor;\r\n for (let color in pathsByColor) {\r\n // hasOwnProperty cannot be shadowed in pathsByColor\r\n // eslint-disable-next-line no-prototype-builtins\r\n if (pathsByColor.hasOwnProperty(color)) {\r\n this._target.appendPath(color, pathsByColor[color].dataString);\r\n }\r\n }\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nexport const SVG_CONSTANTS = {\r\n XMLNS: \"http://www.w3.org/2000/svg\",\r\n WIDTH: \"width\",\r\n HEIGHT: \"height\",\r\n}","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { SVG_CONSTANTS } from \"./constants\";\r\n\r\n/**\r\n * Renderer producing SVG output.\r\n */\r\nexport class SvgWriter {\r\n /**\r\n * @param {number} iconSize - Icon width and height in pixels.\r\n */\r\n constructor(iconSize) {\r\n /**\r\n * @type {number}\r\n */\r\n this.iconSize = iconSize;\r\n\r\n /**\r\n * @type {string}\r\n * @private\r\n */\r\n this._s =\r\n '';\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb.\r\n * @param {number} opacity Opacity in the range [0.0, 1.0].\r\n */\r\n setBackground(fillColor, opacity) {\r\n if (opacity) {\r\n this._s += '';\r\n }\r\n }\r\n\r\n /**\r\n * Writes a path to the SVG string.\r\n * @param {string} color Fill color on format #rrggbb.\r\n * @param {string} dataString The SVG path data string.\r\n */\r\n appendPath(color, dataString) {\r\n this._s += '';\r\n }\r\n\r\n /**\r\n * Gets the rendered image as an SVG string.\r\n */\r\n toString() {\r\n return this._s + \"\";\r\n }\r\n}\r\n","import { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { SvgRenderer } from \"../renderer/svg/svgRenderer\";\r\nimport { SvgWriter } from \"../renderer/svg/svgWriter\";\r\n\r\n/**\r\n * Draws an identicon as an SVG string.\r\n * @param {*} hashOrValue - A hexadecimal hash string or any value that will be hashed by Jdenticon.\r\n * @param {number} size - Icon size in pixels.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compatibility a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n * @returns {string} SVG string\r\n */\r\nexport function toSvg(hashOrValue, size, config) {\r\n const writer = new SvgWriter(size);\r\n iconGenerator(new SvgRenderer(writer), \r\n isValidHash(hashOrValue) || computeHash(hashOrValue),\r\n config);\r\n return writer.toString();\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n// This file is compiled to dist/jdenticon-node.js\r\n\r\nif (typeof process === \"undefined\" &&\r\n typeof window !== \"undefined\" &&\r\n typeof document !== \"undefined\"\r\n) {\r\n console.warn(\r\n \"Jdenticon: 'dist/jdenticon-node.js' is only intended for Node.js environments and will increase your \" +\r\n \"bundle size when included in browser bundles. If you want to run Jdenticon in the browser, please add a \" +\r\n \"reference to 'dist/jdenticon.js' or 'dist/jdenticon.min.js' instead.\");\r\n}\r\n\r\nimport { defineConfigPropertyWithWarn } from \"./common/configuration\";\r\nimport { configure } from \"./apis/configure\";\r\nimport { drawIcon } from \"./apis/drawIcon\";\r\nimport { toPng } from \"./apis/toPng\";\r\nimport { toSvg } from \"./apis/toSvg\";\r\n\r\n/**\r\n * @throws {Error}\r\n */\r\nfunction jdenticon() {\r\n throw new Error(\"jdenticon() is not supported on Node.js.\");\r\n}\r\n\r\ndefineConfigPropertyWithWarn(jdenticon);\r\n\r\njdenticon.configure = configure;\r\njdenticon.drawIcon = drawIcon;\r\njdenticon.toPng = toPng;\r\njdenticon.toSvg = toSvg;\r\n\r\n/**\r\n * Specifies the version of the Jdenticon package in use.\r\n * @type {string}\r\n */\r\njdenticon.version = \"#version#\";\r\n\r\n/**\r\n * Specifies which bundle of Jdenticon that is used.\r\n * @type {string}\r\n */\r\njdenticon.bundle = \"node-cjs\";\r\n\r\n/**\r\n * @throws {Error}\r\n */\r\njdenticon.update = function update() {\r\n throw new Error(\"jdenticon.update() is not supported on Node.js.\");\r\n};\r\n\r\n/**\r\n * @throws {Error}\r\n */\r\njdenticon.updateCanvas = function updateCanvas() {\r\n throw new Error(\"jdenticon.updateCanvas() is not supported on Node.js.\");\r\n};\r\n\r\n/**\r\n * @throws {Error}\r\n */\r\njdenticon.updateSvg = function updateSvg() {\r\n throw new Error(\"jdenticon.updateSvg() is not supported on Node.js.\");\r\n};\r\n\r\nmodule.exports = jdenticon;","\n//# sourceMappingURL=jdenticon-node.js.map\n"]} \ No newline at end of file +{"version":3,"sources":["replacement/1","src/common/parseHex.js","src/renderer/color.js","src/common/global.js","src/common/configuration.js","src/renderer/point.js","src/renderer/transform.js","src/renderer/graphics.js","src/renderer/shapes.js","src/renderer/colorTheme.js","src/renderer/iconGenerator.js","src/common/sha1.js","src/common/hashUtils.js","src/renderer/canvas/canvasRenderer.js","src/apis/drawIcon.js","src/apis/toPng.js","src/renderer/svg/svgPath.js","src/renderer/svg/svgRenderer.js","src/renderer/svg/constants.js","src/renderer/svg/svgWriter.js","src/apis/toSvg.js","src/node-cjs.js","replacement/2"],"names":["canvasRenderer"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACO,SAAS,QAAQ,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE;AACtD,IAAI,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;AAC5D;;ACLA,SAAS,QAAQ,CAAC,CAAC,EAAE;AACrB,IAAI,CAAC,IAAI,CAAC,CAAC;AACX,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI;AACvB,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;AACrC,QAAQ,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;AAChC,QAAQ,IAAI,CAAC;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2021-08-14T17:50:52.207Z\r\n * \r\n * MIT License\r\n * \r\n * Copyright (c) 2014-2020 Daniel Mester Pirttijärvi\r\n * \r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n * \r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n * \r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n */\r\n\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Parses a substring of the hash as a number.\r\n * @param {number} startPosition \r\n * @param {number=} octets\r\n */\r\nexport function parseHex(hash, startPosition, octets) {\r\n return parseInt(hash.substr(startPosition, octets), 16);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { parseHex } from \"../common/parseHex\";\r\n\r\nfunction decToHex(v) {\r\n v |= 0; // Ensure integer value\r\n return v < 0 ? \"00\" :\r\n v < 16 ? \"0\" + v.toString(16) :\r\n v < 256 ? v.toString(16) :\r\n \"ff\";\r\n}\r\n\r\nfunction hueToRgb(m1, m2, h) {\r\n h = h < 0 ? h + 6 : h > 6 ? h - 6 : h;\r\n return decToHex(255 * (\r\n h < 1 ? m1 + (m2 - m1) * h :\r\n h < 3 ? m2 :\r\n h < 4 ? m1 + (m2 - m1) * (4 - h) :\r\n m1));\r\n}\r\n\r\n/**\r\n * @param {number} r Red channel [0, 255]\r\n * @param {number} g Green channel [0, 255]\r\n * @param {number} b Blue channel [0, 255]\r\n */\r\nexport function rgb(r, g, b) {\r\n return \"#\" + decToHex(r) + decToHex(g) + decToHex(b);\r\n}\r\n\r\n/**\r\n * @param {string} color Color value to parse. Currently hexadecimal strings on the format #rgb[a] and #rrggbb[aa] are supported.\r\n * @returns {string}\r\n */\r\nexport function parseColor(color) {\r\n if (/^#[0-9a-f]{3,8}$/i.test(color)) {\r\n let result;\r\n const colorLength = color.length;\r\n\r\n if (colorLength < 6) {\r\n const r = color[1],\r\n g = color[2],\r\n b = color[3],\r\n a = color[4] || \"\";\r\n result = \"#\" + r + r + g + g + b + b + a + a;\r\n }\r\n if (colorLength == 7 || colorLength > 8) {\r\n result = color;\r\n }\r\n \r\n return result;\r\n }\r\n}\r\n\r\n/**\r\n * Converts a hexadecimal color to a CSS3 compatible color.\r\n * @param {string} hexColor Color on the format \"#RRGGBB\" or \"#RRGGBBAA\"\r\n * @returns {string}\r\n */\r\nexport function toCss3Color(hexColor) {\r\n const a = parseHex(hexColor, 7, 2);\r\n let result;\r\n\r\n if (isNaN(a)) {\r\n result = hexColor;\r\n } else {\r\n const r = parseHex(hexColor, 1, 2),\r\n g = parseHex(hexColor, 3, 2),\r\n b = parseHex(hexColor, 5, 2);\r\n result = \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + (a / 255).toFixed(2) + \")\";\r\n }\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * Converts an HSL color to a hexadecimal RGB color.\r\n * @param {number} hue Hue in range [0, 1]\r\n * @param {number} saturation Saturation in range [0, 1]\r\n * @param {number} lightness Lightness in range [0, 1]\r\n * @returns {string}\r\n */\r\nexport function hsl(hue, saturation, lightness) {\r\n // Based on http://www.w3.org/TR/2011/REC-css3-color-20110607/#hsl-color\r\n let result;\r\n\r\n if (saturation == 0) {\r\n const partialHex = decToHex(lightness * 255);\r\n result = partialHex + partialHex + partialHex;\r\n }\r\n else {\r\n const m2 = lightness <= 0.5 ? lightness * (saturation + 1) : lightness + saturation - lightness * saturation,\r\n m1 = lightness * 2 - m2;\r\n result =\r\n hueToRgb(m1, m2, hue * 6 + 2) +\r\n hueToRgb(m1, m2, hue * 6) +\r\n hueToRgb(m1, m2, hue * 6 - 2);\r\n }\r\n\r\n return \"#\" + result;\r\n}\r\n\r\n/**\r\n * Converts an HSL color to a hexadecimal RGB color. This function will correct the lightness for the \"dark\" hues\r\n * @param {number} hue Hue in range [0, 1]\r\n * @param {number} saturation Saturation in range [0, 1]\r\n * @param {number} lightness Lightness in range [0, 1]\r\n * @returns {string}\r\n */\r\nexport function correctedHsl(hue, saturation, lightness) {\r\n // The corrector specifies the perceived middle lightness for each hue\r\n const correctors = [ 0.55, 0.5, 0.5, 0.46, 0.6, 0.55, 0.55 ],\r\n corrector = correctors[(hue * 6 + 0.5) | 0];\r\n \r\n // Adjust the input lightness relative to the corrector\r\n lightness = lightness < 0.5 ? lightness * corrector * 2 : corrector + (lightness - 0.5) * (1 - corrector) * 2;\r\n \r\n return hsl(hue, saturation, lightness);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n// In the future we can replace `GLOBAL` with `globalThis`, but for now use the old school global detection for\r\n// backward compatibility.\r\n\r\nexport const GLOBAL = \r\n typeof window !== \"undefined\" ? window :\r\n typeof self !== \"undefined\" ? self :\r\n typeof global !== \"undefined\" ? global :\r\n {};\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { parseColor } from \"../renderer/color\";\r\nimport { GLOBAL } from \"./global\";\r\n\r\n/**\r\n * @typedef {Object} ParsedConfiguration\r\n * @property {number} colorSaturation\r\n * @property {number} grayscaleSaturation\r\n * @property {string} backColor\r\n * @property {number} iconPadding\r\n * @property {function(number):number} hue\r\n * @property {function(number):number} colorLightness\r\n * @property {function(number):number} grayscaleLightness\r\n */\r\n\r\nexport const CONFIG_PROPERTIES = {\r\n GLOBAL: \"jdenticon_config\",\r\n MODULE: \"config\",\r\n};\r\n\r\nvar rootConfigurationHolder = {};\r\n\r\n/**\r\n * Defines the deprecated `config` property on the root Jdenticon object. When the property is set a warning is \r\n * printed in the console. To minimize bundle size, this is only used in Node bundles.\r\n * @param {!Object} rootObject \r\n */\r\nexport function defineConfigPropertyWithWarn(rootObject) {\r\n Object.defineProperty(rootObject, CONFIG_PROPERTIES.MODULE, {\r\n configurable: true,\r\n get: () => rootConfigurationHolder[CONFIG_PROPERTIES.MODULE],\r\n set: newConfiguration => {\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] = newConfiguration;\r\n console.warn(\"jdenticon.config is deprecated. Use jdenticon.configure() instead.\");\r\n },\r\n });\r\n}\r\n\r\n/**\r\n * Defines the deprecated `config` property on the root Jdenticon object without printing a warning in the console\r\n * when it is being used.\r\n * @param {!Object} rootObject \r\n */\r\nexport function defineConfigProperty(rootObject) {\r\n rootConfigurationHolder = rootObject;\r\n}\r\n\r\n/**\r\n * Sets a new icon style configuration. The new configuration is not merged with the previous one. * \r\n * @param {Object} newConfiguration - New configuration object.\r\n */\r\nexport function configure(newConfiguration) {\r\n if (arguments.length) {\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] = newConfiguration;\r\n }\r\n return rootConfigurationHolder[CONFIG_PROPERTIES.MODULE];\r\n}\r\n\r\n/**\r\n * Gets the normalized current Jdenticon color configuration. Missing fields have default values.\r\n * @param {Object|number|undefined} paddingOrLocalConfig - Configuration passed to the called API method. A\r\n * local configuration overrides the global configuration in it entirety. This parameter can for backward\r\n * compatibility also contain a padding value. A padding value only overrides the global padding, not the\r\n * entire global configuration.\r\n * @param {number} defaultPadding - Padding used if no padding is specified in neither the configuration nor\r\n * explicitly to the API method.\r\n * @returns {ParsedConfiguration}\r\n */\r\nexport function getConfiguration(paddingOrLocalConfig, defaultPadding) {\r\n const configObject = \r\n typeof paddingOrLocalConfig == \"object\" && paddingOrLocalConfig ||\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] ||\r\n GLOBAL[CONFIG_PROPERTIES.GLOBAL] ||\r\n { },\r\n\r\n lightnessConfig = configObject[\"lightness\"] || { },\r\n \r\n // In versions < 2.1.0 there was no grayscale saturation -\r\n // saturation was the color saturation.\r\n saturation = configObject[\"saturation\"] || { },\r\n colorSaturation = \"color\" in saturation ? saturation[\"color\"] : saturation,\r\n grayscaleSaturation = saturation[\"grayscale\"],\r\n\r\n backColor = configObject[\"backColor\"],\r\n padding = configObject[\"padding\"];\r\n \r\n /**\r\n * Creates a lightness range.\r\n */\r\n function lightness(configName, defaultRange) {\r\n let range = lightnessConfig[configName];\r\n \r\n // Check if the lightness range is an array-like object. This way we ensure the\r\n // array contain two values at the same time.\r\n if (!(range && range.length > 1)) {\r\n range = defaultRange;\r\n }\r\n\r\n /**\r\n * Gets a lightness relative the specified value in the specified lightness range.\r\n */\r\n return function (value) {\r\n value = range[0] + value * (range[1] - range[0]);\r\n return value < 0 ? 0 : value > 1 ? 1 : value;\r\n };\r\n }\r\n\r\n /**\r\n * Gets a hue allowed by the configured hue restriction,\r\n * provided the originally computed hue.\r\n */\r\n function hueFunction(originalHue) {\r\n const hueConfig = configObject[\"hues\"];\r\n let hue;\r\n \r\n // Check if 'hues' is an array-like object. This way we also ensure that\r\n // the array is not empty, which would mean no hue restriction.\r\n if (hueConfig && hueConfig.length > 0) {\r\n // originalHue is in the range [0, 1]\r\n // Multiply with 0.999 to change the range to [0, 1) and then truncate the index.\r\n hue = hueConfig[0 | (0.999 * originalHue * hueConfig.length)];\r\n }\r\n\r\n return typeof hue == \"number\" ?\r\n \r\n // A hue was specified. We need to convert the hue from\r\n // degrees on any turn - e.g. 746° is a perfectly valid hue -\r\n // to turns in the range [0, 1).\r\n ((((hue / 360) % 1) + 1) % 1) :\r\n\r\n // No hue configured => use original hue\r\n originalHue;\r\n }\r\n \r\n return {\r\n hue: hueFunction,\r\n colorSaturation: typeof colorSaturation == \"number\" ? colorSaturation : 0.5,\r\n grayscaleSaturation: typeof grayscaleSaturation == \"number\" ? grayscaleSaturation : 0,\r\n colorLightness: lightness(\"color\", [0.4, 0.8]),\r\n grayscaleLightness: lightness(\"grayscale\", [0.3, 0.9]),\r\n backColor: parseColor(backColor),\r\n iconPadding: \r\n typeof paddingOrLocalConfig == \"number\" ? paddingOrLocalConfig : \r\n typeof padding == \"number\" ? padding : \r\n defaultPadding\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Represents a point.\r\n */\r\nexport class Point {\r\n /**\r\n * @param {number} x \r\n * @param {number} y \r\n */\r\n constructor(x, y) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { Point } from \"./point\";\r\n\r\n/**\r\n * Translates and rotates a point before being passed on to the canvas context. This was previously done by the canvas context itself, \r\n * but this caused a rendering issue in Chrome on sizes > 256 where the rotation transformation of inverted paths was not done properly.\r\n */\r\nexport class Transform {\r\n /**\r\n * @param {number} x The x-coordinate of the upper left corner of the transformed rectangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the transformed rectangle.\r\n * @param {number} size The size of the transformed rectangle.\r\n * @param {number} rotation Rotation specified as 0 = 0 rad, 1 = 0.5π rad, 2 = π rad, 3 = 1.5π rad\r\n */\r\n constructor(x, y, size, rotation) {\r\n this._x = x;\r\n this._y = y;\r\n this._size = size;\r\n this._rotation = rotation;\r\n }\r\n\r\n /**\r\n * Transforms the specified point based on the translation and rotation specification for this Transform.\r\n * @param {number} x x-coordinate\r\n * @param {number} y y-coordinate\r\n * @param {number=} w The width of the transformed rectangle. If greater than 0, this will ensure the returned point is of the upper left corner of the transformed rectangle.\r\n * @param {number=} h The height of the transformed rectangle. If greater than 0, this will ensure the returned point is of the upper left corner of the transformed rectangle.\r\n */\r\n transformIconPoint(x, y, w, h) {\r\n const right = this._x + this._size,\r\n bottom = this._y + this._size,\r\n rotation = this._rotation;\r\n return rotation === 1 ? new Point(right - y - (h || 0), this._y + x) :\r\n rotation === 2 ? new Point(right - x - (w || 0), bottom - y - (h || 0)) :\r\n rotation === 3 ? new Point(this._x + y, bottom - x - (w || 0)) :\r\n new Point(this._x + x, this._y + y);\r\n }\r\n}\r\n\r\nexport const NO_TRANSFORM = new Transform(0, 0, 0, 0);\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { NO_TRANSFORM } from \"./transform\";\r\n\r\n/**\r\n * @typedef {import(\"./renderer\").Renderer} Renderer\r\n * @typedef {import(\"./transform\").Transform} Transform\r\n */\r\n\r\n/**\r\n * Provides helper functions for rendering common basic shapes.\r\n */\r\nexport class Graphics {\r\n /**\r\n * @param {Renderer} renderer \r\n */\r\n constructor(renderer) {\r\n /**\r\n * @type {Renderer}\r\n * @private\r\n */\r\n this._renderer = renderer;\r\n\r\n /**\r\n * @type {Transform}\r\n */\r\n this.currentTransform = NO_TRANSFORM;\r\n }\r\n\r\n /**\r\n * Adds a polygon to the underlying renderer.\r\n * @param {Array} points The points of the polygon clockwise on the format [ x0, y0, x1, y1, ..., xn, yn ]\r\n * @param {boolean=} invert Specifies if the polygon will be inverted.\r\n */\r\n addPolygon(points, invert) {\r\n const di = invert ? -2 : 2,\r\n transformedPoints = [];\r\n \r\n for (let i = invert ? points.length - 2 : 0; i < points.length && i >= 0; i += di) {\r\n transformedPoints.push(this.currentTransform.transformIconPoint(points[i], points[i + 1]));\r\n }\r\n \r\n this._renderer.addPolygon(transformedPoints);\r\n }\r\n \r\n /**\r\n * Adds a polygon to the underlying renderer.\r\n * Source: http://stackoverflow.com/a/2173084\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the entire ellipse.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the entire ellipse.\r\n * @param {number} size The size of the ellipse.\r\n * @param {boolean=} invert Specifies if the ellipse will be inverted.\r\n */\r\n addCircle(x, y, size, invert) {\r\n const p = this.currentTransform.transformIconPoint(x, y, size, size);\r\n this._renderer.addCircle(p, size, invert);\r\n }\r\n\r\n /**\r\n * Adds a rectangle to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle.\r\n * @param {number} w The width of the rectangle.\r\n * @param {number} h The height of the rectangle.\r\n * @param {boolean=} invert Specifies if the rectangle will be inverted.\r\n */\r\n addRectangle(x, y, w, h, invert) {\r\n this.addPolygon([\r\n x, y, \r\n x + w, y,\r\n x + w, y + h,\r\n x, y + h\r\n ], invert);\r\n }\r\n\r\n /**\r\n * Adds a right triangle to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the triangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the triangle.\r\n * @param {number} w The width of the triangle.\r\n * @param {number} h The height of the triangle.\r\n * @param {number} r The rotation of the triangle (clockwise). 0 = right corner of the triangle in the lower left corner of the bounding rectangle.\r\n * @param {boolean=} invert Specifies if the triangle will be inverted.\r\n */\r\n addTriangle(x, y, w, h, r, invert) {\r\n const points = [\r\n x + w, y, \r\n x + w, y + h, \r\n x, y + h,\r\n x, y\r\n ];\r\n points.splice(((r || 0) % 4) * 2, 2);\r\n this.addPolygon(points, invert);\r\n }\r\n\r\n /**\r\n * Adds a rhombus to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the rhombus.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the rhombus.\r\n * @param {number} w The width of the rhombus.\r\n * @param {number} h The height of the rhombus.\r\n * @param {boolean=} invert Specifies if the rhombus will be inverted.\r\n */\r\n addRhombus(x, y, w, h, invert) {\r\n this.addPolygon([\r\n x + w / 2, y,\r\n x + w, y + h / 2,\r\n x + w / 2, y + h,\r\n x, y + h / 2\r\n ], invert);\r\n }\r\n}","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * @param {number} index\r\n * @param {Graphics} g\r\n * @param {number} cell\r\n * @param {number} positionIndex\r\n * @typedef {import('./graphics').Graphics} Graphics\r\n */\r\nexport function centerShape(index, g, cell, positionIndex) {\r\n index = index % 14;\r\n\r\n let k, m, w, h, inner, outer;\r\n\r\n !index ? (\r\n k = cell * 0.42,\r\n g.addPolygon([\r\n 0, 0,\r\n cell, 0,\r\n cell, cell - k * 2,\r\n cell - k, cell,\r\n 0, cell\r\n ])) :\r\n\r\n index == 1 ? (\r\n w = 0 | (cell * 0.5), \r\n h = 0 | (cell * 0.8),\r\n\r\n g.addTriangle(cell - w, 0, w, h, 2)) :\r\n\r\n index == 2 ? (\r\n w = 0 | (cell / 3),\r\n g.addRectangle(w, w, cell - w, cell - w)) :\r\n\r\n index == 3 ? (\r\n inner = cell * 0.1,\r\n // Use fixed outer border widths in small icons to ensure the border is drawn\r\n outer = \r\n cell < 6 ? 1 :\r\n cell < 8 ? 2 :\r\n (0 | (cell * 0.25)),\r\n \r\n inner = \r\n inner > 1 ? (0 | inner) : // large icon => truncate decimals\r\n inner > 0.5 ? 1 : // medium size icon => fixed width\r\n inner, // small icon => anti-aliased border\r\n\r\n g.addRectangle(outer, outer, cell - inner - outer, cell - inner - outer)) :\r\n\r\n index == 4 ? (\r\n m = 0 | (cell * 0.15),\r\n w = 0 | (cell * 0.5),\r\n g.addCircle(cell - w - m, cell - w - m, w)) :\r\n\r\n index == 5 ? (\r\n inner = cell * 0.1,\r\n outer = inner * 4,\r\n\r\n // Align edge to nearest pixel in large icons\r\n outer > 3 && (outer = 0 | outer),\r\n \r\n g.addRectangle(0, 0, cell, cell),\r\n g.addPolygon([\r\n outer, outer,\r\n cell - inner, outer,\r\n outer + (cell - outer - inner) / 2, cell - inner\r\n ], true)) :\r\n\r\n index == 6 ? \r\n g.addPolygon([\r\n 0, 0,\r\n cell, 0,\r\n cell, cell * 0.7,\r\n cell * 0.4, cell * 0.4,\r\n cell * 0.7, cell,\r\n 0, cell\r\n ]) :\r\n\r\n index == 7 ? \r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 3) :\r\n\r\n index == 8 ? (\r\n g.addRectangle(0, 0, cell, cell / 2),\r\n g.addRectangle(0, cell / 2, cell / 2, cell / 2),\r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 1)) :\r\n\r\n index == 9 ? (\r\n inner = cell * 0.14,\r\n // Use fixed outer border widths in small icons to ensure the border is drawn\r\n outer = \r\n cell < 4 ? 1 :\r\n cell < 6 ? 2 :\r\n (0 | (cell * 0.35)),\r\n\r\n inner = \r\n cell < 8 ? inner : // small icon => anti-aliased border\r\n (0 | inner), // large icon => truncate decimals\r\n\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addRectangle(outer, outer, cell - outer - inner, cell - outer - inner, true)) :\r\n\r\n index == 10 ? (\r\n inner = cell * 0.12,\r\n outer = inner * 3,\r\n\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addCircle(outer, outer, cell - inner - outer, true)) :\r\n\r\n index == 11 ? \r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 3) :\r\n\r\n index == 12 ? (\r\n m = cell * 0.25,\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addRhombus(m, m, cell - m, cell - m, true)) :\r\n\r\n // 13\r\n (\r\n !positionIndex && (\r\n m = cell * 0.4, w = cell * 1.2,\r\n g.addCircle(m, m, w)\r\n )\r\n );\r\n}\r\n\r\n/**\r\n * @param {number} index\r\n * @param {Graphics} g\r\n * @param {number} cell\r\n */\r\nexport function outerShape(index, g, cell) {\r\n index = index % 4;\r\n\r\n let m;\r\n\r\n !index ?\r\n g.addTriangle(0, 0, cell, cell, 0) :\r\n \r\n index == 1 ?\r\n g.addTriangle(0, cell / 2, cell, cell / 2, 0) :\r\n\r\n index == 2 ?\r\n g.addRhombus(0, 0, cell, cell) :\r\n\r\n // 3\r\n (\r\n m = cell / 6,\r\n g.addCircle(m, m, cell - 2 * m)\r\n );\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { correctedHsl } from \"./color\";\r\n\r\n/**\r\n * Gets a set of identicon color candidates for a specified hue and config.\r\n * @param {number} hue\r\n * @param {import(\"../common/configuration\").ParsedConfiguration} config\r\n */\r\nexport function colorTheme(hue, config) {\r\n hue = config.hue(hue);\r\n return [\r\n // Dark gray\r\n correctedHsl(hue, config.grayscaleSaturation, config.grayscaleLightness(0)),\r\n // Mid color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(0.5)),\r\n // Light gray\r\n correctedHsl(hue, config.grayscaleSaturation, config.grayscaleLightness(1)),\r\n // Light color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(1)),\r\n // Dark color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(0))\r\n ];\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { Transform } from \"./transform\";\r\nimport { Graphics } from \"./graphics\";\r\nimport { centerShape, outerShape } from \"./shapes\";\r\nimport { colorTheme } from \"./colorTheme\";\r\nimport { parseHex } from \"../common/parseHex\";\r\nimport { getConfiguration } from \"../common/configuration\";\r\n \r\n/**\r\n * Draws an identicon to a specified renderer.\r\n * @param {import('./renderer').Renderer} renderer\r\n * @param {string} hash\r\n * @param {Object|number=} config\r\n */\r\nexport function iconGenerator(renderer, hash, config) {\r\n const parsedConfig = getConfiguration(config, 0.08);\r\n\r\n // Set background color\r\n if (parsedConfig.backColor) {\r\n renderer.setBackground(parsedConfig.backColor);\r\n }\r\n \r\n // Calculate padding and round to nearest integer\r\n let size = renderer.iconSize;\r\n const padding = (0.5 + size * parsedConfig.iconPadding) | 0;\r\n size -= padding * 2;\r\n \r\n const graphics = new Graphics(renderer);\r\n \r\n // Calculate cell size and ensure it is an integer\r\n const cell = 0 | (size / 4);\r\n \r\n // Since the cell size is integer based, the actual icon will be slightly smaller than specified => center icon\r\n const x = 0 | (padding + size / 2 - cell * 2);\r\n const y = 0 | (padding + size / 2 - cell * 2);\r\n\r\n function renderShape(colorIndex, shapes, index, rotationIndex, positions) {\r\n const shapeIndex = parseHex(hash, index, 1);\r\n let r = rotationIndex ? parseHex(hash, rotationIndex, 1) : 0;\r\n \r\n renderer.beginShape(availableColors[selectedColorIndexes[colorIndex]]);\r\n \r\n for (let i = 0; i < positions.length; i++) {\r\n graphics.currentTransform = new Transform(x + positions[i][0] * cell, y + positions[i][1] * cell, cell, r++ % 4);\r\n shapes(shapeIndex, graphics, cell, i);\r\n }\r\n \r\n renderer.endShape();\r\n }\r\n\r\n // AVAILABLE COLORS\r\n const hue = parseHex(hash, -7) / 0xfffffff,\r\n \r\n // Available colors for this icon\r\n availableColors = colorTheme(hue, parsedConfig),\r\n\r\n // The index of the selected colors\r\n selectedColorIndexes = [];\r\n\r\n let index;\r\n\r\n function isDuplicate(values) {\r\n if (values.indexOf(index) >= 0) {\r\n for (let i = 0; i < values.length; i++) {\r\n if (selectedColorIndexes.indexOf(values[i]) >= 0) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n for (let i = 0; i < 3; i++) {\r\n index = parseHex(hash, 8 + i, 1) % availableColors.length;\r\n if (isDuplicate([0, 4]) || // Disallow dark gray and dark color combo\r\n isDuplicate([2, 3])) { // Disallow light gray and light color combo\r\n index = 1;\r\n }\r\n selectedColorIndexes.push(index);\r\n }\r\n\r\n // ACTUAL RENDERING\r\n // Sides\r\n renderShape(0, outerShape, 2, 3, [[1, 0], [2, 0], [2, 3], [1, 3], [0, 1], [3, 1], [3, 2], [0, 2]]);\r\n // Corners\r\n renderShape(1, outerShape, 4, 5, [[0, 0], [3, 0], [3, 3], [0, 3]]);\r\n // Center\r\n renderShape(2, centerShape, 1, null, [[1, 1], [2, 1], [2, 2], [1, 2]]);\r\n \r\n renderer.finish();\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Computes a SHA1 hash for any value and returns it as a hexadecimal string.\r\n * \r\n * This function is optimized for minimal code size and rather short messages.\r\n * \r\n * @param {string} message \r\n */\r\nexport function sha1(message) {\r\n const HASH_SIZE_HALF_BYTES = 40;\r\n const BLOCK_SIZE_WORDS = 16;\r\n\r\n // Variables\r\n // `var` is used to be able to minimize the number of `var` keywords.\r\n var i = 0,\r\n f = 0,\r\n \r\n // Use `encodeURI` to UTF8 encode the message without any additional libraries\r\n // We could use `unescape` + `encodeURI` to minimize the code, but that would be slightly risky\r\n // since `unescape` is deprecated.\r\n urlEncodedMessage = encodeURI(message) + \"%80\", // trailing '1' bit padding\r\n \r\n // This can be changed to a preallocated Uint32Array array for greater performance and larger code size\r\n data = [],\r\n dataSize,\r\n \r\n hashBuffer = [],\r\n\r\n a = 0x67452301,\r\n b = 0xefcdab89,\r\n c = ~a,\r\n d = ~b,\r\n e = 0xc3d2e1f0,\r\n hash = [a, b, c, d, e],\r\n\r\n blockStartIndex = 0,\r\n hexHash = \"\";\r\n\r\n /**\r\n * Rotates the value a specified number of bits to the left.\r\n * @param {number} value Value to rotate\r\n * @param {number} shift Bit count to shift.\r\n */\r\n function rotl(value, shift) {\r\n return (value << shift) | (value >>> (32 - shift));\r\n }\r\n\r\n // Message data\r\n for ( ; i < urlEncodedMessage.length; f++) {\r\n data[f >> 2] = data[f >> 2] |\r\n (\r\n (\r\n urlEncodedMessage[i] == \"%\"\r\n // Percent encoded byte\r\n ? parseInt(urlEncodedMessage.substring(i + 1, i += 3), 16)\r\n // Unencoded byte\r\n : urlEncodedMessage.charCodeAt(i++)\r\n )\r\n\r\n // Read bytes in reverse order (big endian words)\r\n << ((3 - (f & 3)) * 8)\r\n );\r\n }\r\n\r\n // f is now the length of the utf8 encoded message\r\n // 7 = 8 bytes (64 bit) for message size, -1 to round down\r\n // >> 6 = integer division with block size\r\n dataSize = (((f + 7) >> 6) + 1) * BLOCK_SIZE_WORDS;\r\n\r\n // Message size in bits.\r\n // SHA1 uses a 64 bit integer to represent the size, but since we only support short messages only the least\r\n // significant 32 bits are set. -8 is for the '1' bit padding byte.\r\n data[dataSize - 1] = f * 8 - 8;\r\n \r\n // Compute hash\r\n for ( ; blockStartIndex < dataSize; blockStartIndex += BLOCK_SIZE_WORDS) {\r\n for (i = 0; i < 80; i++) {\r\n f = rotl(a, 5) + e + (\r\n // Ch\r\n i < 20 ? ((b & c) ^ ((~b) & d)) + 0x5a827999 :\r\n \r\n // Parity\r\n i < 40 ? (b ^ c ^ d) + 0x6ed9eba1 :\r\n \r\n // Maj\r\n i < 60 ? ((b & c) ^ (b & d) ^ (c & d)) + 0x8f1bbcdc :\r\n \r\n // Parity\r\n (b ^ c ^ d) + 0xca62c1d6\r\n ) + ( \r\n hashBuffer[i] = i < BLOCK_SIZE_WORDS\r\n // Bitwise OR is used to coerse `undefined` to 0\r\n ? (data[blockStartIndex + i] | 0)\r\n : rotl(hashBuffer[i - 3] ^ hashBuffer[i - 8] ^ hashBuffer[i - 14] ^ hashBuffer[i - 16], 1)\r\n );\r\n\r\n e = d;\r\n d = c;\r\n c = rotl(b, 30);\r\n b = a;\r\n a = f;\r\n }\r\n\r\n hash[0] = a = ((hash[0] + a) | 0);\r\n hash[1] = b = ((hash[1] + b) | 0);\r\n hash[2] = c = ((hash[2] + c) | 0);\r\n hash[3] = d = ((hash[3] + d) | 0);\r\n hash[4] = e = ((hash[4] + e) | 0);\r\n }\r\n\r\n // Format hex hash\r\n for (i = 0; i < HASH_SIZE_HALF_BYTES; i++) {\r\n hexHash += (\r\n (\r\n // Get word (2^3 half-bytes per word)\r\n hash[i >> 3] >>>\r\n\r\n // Append half-bytes in reverse order\r\n ((7 - (i & 7)) * 4)\r\n ) \r\n // Clamp to half-byte\r\n & 0xf\r\n ).toString(16);\r\n }\r\n\r\n return hexHash;\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { sha1 } from \"./sha1\";\r\n\r\n/**\r\n * Inputs a value that might be a valid hash string for Jdenticon and returns it \r\n * if it is determined valid, otherwise a falsy value is returned.\r\n */\r\nexport function isValidHash(hashCandidate) {\r\n return /^[0-9a-f]{11,}$/i.test(hashCandidate) && hashCandidate;\r\n}\r\n\r\n/**\r\n * Computes a hash for the specified value. Currently SHA1 is used. This function\r\n * always returns a valid hash.\r\n */\r\nexport function computeHash(value) {\r\n return sha1(value == null ? \"\" : \"\" + value);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { toCss3Color } from \"../color\";\r\n\r\n/**\r\n * @typedef {import(\"../renderer\").Renderer} Renderer\r\n * @typedef {import('../point').Point} Point\r\n */\r\n\r\n/**\r\n * Renderer redirecting drawing commands to a canvas context.\r\n * @implements {Renderer}\r\n */\r\nexport class CanvasRenderer {\r\n /**\r\n * @param {number=} iconSize\r\n */\r\n constructor(ctx, iconSize) {\r\n const canvas = ctx.canvas; \r\n const width = canvas.width;\r\n const height = canvas.height;\r\n \r\n ctx.save();\r\n \r\n if (!iconSize) {\r\n iconSize = Math.min(width, height);\r\n \r\n ctx.translate(\r\n ((width - iconSize) / 2) | 0,\r\n ((height - iconSize) / 2) | 0);\r\n }\r\n\r\n /**\r\n * @private\r\n */\r\n this._ctx = ctx;\r\n this.iconSize = iconSize;\r\n \r\n ctx.clearRect(0, 0, iconSize, iconSize);\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb[aa].\r\n */\r\n setBackground(fillColor) {\r\n const ctx = this._ctx;\r\n const iconSize = this.iconSize;\r\n\r\n ctx.fillStyle = toCss3Color(fillColor);\r\n ctx.fillRect(0, 0, iconSize, iconSize);\r\n }\r\n\r\n /**\r\n * Marks the beginning of a new shape of the specified color. Should be ended with a call to endShape.\r\n * @param {string} fillColor Fill color on format #rrggbb[aa].\r\n */\r\n beginShape(fillColor) {\r\n const ctx = this._ctx;\r\n ctx.fillStyle = toCss3Color(fillColor);\r\n ctx.beginPath();\r\n }\r\n\r\n /**\r\n * Marks the end of the currently drawn shape. This causes the queued paths to be rendered on the canvas.\r\n */\r\n endShape() {\r\n this._ctx.fill();\r\n }\r\n\r\n /**\r\n * Adds a polygon to the rendering queue.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n const ctx = this._ctx;\r\n ctx.moveTo(points[0].x, points[0].y);\r\n for (let i = 1; i < points.length; i++) {\r\n ctx.lineTo(points[i].x, points[i].y);\r\n }\r\n ctx.closePath();\r\n }\r\n\r\n /**\r\n * Adds a circle to the rendering queue.\r\n * @param {Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n const ctx = this._ctx,\r\n radius = diameter / 2;\r\n ctx.moveTo(point.x + radius, point.y + radius);\r\n ctx.arc(point.x + radius, point.y + radius, radius, 0, Math.PI * 2, counterClockwise);\r\n ctx.closePath();\r\n }\r\n\r\n /**\r\n * Called when the icon has been completely drawn.\r\n */\r\n finish() {\r\n this._ctx.restore();\r\n }\r\n}\r\n","import { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { CanvasRenderer } from \"../renderer/canvas/canvasRenderer\";\r\n\r\n/**\r\n * Draws an identicon to a context.\r\n * @param {CanvasRenderingContext2D} ctx - Canvas context on which the icon will be drawn at location (0, 0).\r\n * @param {*} hashOrValue - A hexadecimal hash string or any value that will be hashed by Jdenticon.\r\n * @param {number} size - Icon size in pixels.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compatibility a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function drawIcon(ctx, hashOrValue, size, config) {\r\n if (!ctx) {\r\n throw new Error(\"No canvas specified.\");\r\n }\r\n \r\n iconGenerator(new CanvasRenderer(ctx, size), \r\n isValidHash(hashOrValue) || computeHash(hashOrValue), \r\n config);\r\n}\r\n","import canvasRenderer from \"canvas-renderer\";\r\nimport { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { CanvasRenderer } from \"../renderer/canvas/canvasRenderer\";\r\n\r\n/**\r\n * Draws an identicon as PNG.\r\n * @param {*} hashOrValue - A hexadecimal hash string or any value that will be hashed by Jdenticon.\r\n * @param {number} size - Icon size in pixels.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compatibility a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n * @returns {Buffer} PNG data\r\n */\r\nexport function toPng(hashOrValue, size, config) {\r\n const canvas = canvasRenderer.createCanvas(size, size);\r\n const ctx = canvas.getContext(\"2d\");\r\n \r\n iconGenerator(new CanvasRenderer(ctx, size), \r\n isValidHash(hashOrValue) || computeHash(hashOrValue), \r\n config);\r\n \r\n return canvas.toPng({ \"Software\": \"Jdenticon\" });\r\n}","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Prepares a measure to be used as a measure in an SVG path, by\r\n * rounding the measure to a single decimal. This reduces the file\r\n * size of the generated SVG with more than 50% in some cases.\r\n */\r\nfunction svgValue(value) {\r\n return ((value * 10 + 0.5) | 0) / 10;\r\n}\r\n\r\n/**\r\n * Represents an SVG path element.\r\n */\r\nexport class SvgPath {\r\n constructor() {\r\n /**\r\n * This property holds the data string (path.d) of the SVG path.\r\n * @type {string}\r\n */\r\n this.dataString = \"\";\r\n }\r\n\r\n /**\r\n * Adds a polygon with the current fill color to the SVG path.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n let dataString = \"\";\r\n for (let i = 0; i < points.length; i++) {\r\n dataString += (i ? \"L\" : \"M\") + svgValue(points[i].x) + \" \" + svgValue(points[i].y);\r\n }\r\n this.dataString += dataString + \"Z\";\r\n }\r\n\r\n /**\r\n * Adds a circle with the current fill color to the SVG path.\r\n * @param {import('../point').Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n const sweepFlag = counterClockwise ? 0 : 1,\r\n svgRadius = svgValue(diameter / 2),\r\n svgDiameter = svgValue(diameter),\r\n svgArc = \"a\" + svgRadius + \",\" + svgRadius + \" 0 1,\" + sweepFlag + \" \";\r\n \r\n this.dataString += \r\n \"M\" + svgValue(point.x) + \" \" + svgValue(point.y + diameter / 2) +\r\n svgArc + svgDiameter + \",0\" + \r\n svgArc + (-svgDiameter) + \",0\";\r\n }\r\n}\r\n\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { SvgPath } from \"./svgPath\";\r\nimport { parseHex } from \"../../common/parseHex\";\r\n\r\n/**\r\n * @typedef {import(\"../point\").Point} Point\r\n * @typedef {import(\"../renderer\").Renderer} Renderer\r\n * @typedef {import(\"./svgElement\").SvgElement} SvgElement\r\n * @typedef {import(\"./svgWriter\").SvgWriter} SvgWriter\r\n */\r\n\r\n/**\r\n * Renderer producing SVG output.\r\n * @implements {Renderer}\r\n */\r\nexport class SvgRenderer {\r\n /**\r\n * @param {SvgElement|SvgWriter} target \r\n */\r\n constructor(target) {\r\n /**\r\n * @type {SvgPath}\r\n * @private\r\n */\r\n this._path;\r\n\r\n /**\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._pathsByColor = { };\r\n\r\n /**\r\n * @type {SvgElement|SvgWriter}\r\n * @private\r\n */\r\n this._target = target;\r\n\r\n /**\r\n * @type {number}\r\n */\r\n this.iconSize = target.iconSize;\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb[aa].\r\n */\r\n setBackground(fillColor) {\r\n const match = /^(#......)(..)?/.exec(fillColor),\r\n opacity = match[2] ? parseHex(match[2], 0) / 255 : 1;\r\n this._target.setBackground(match[1], opacity);\r\n }\r\n\r\n /**\r\n * Marks the beginning of a new shape of the specified color. Should be ended with a call to endShape.\r\n * @param {string} color Fill color on format #xxxxxx.\r\n */\r\n beginShape(color) {\r\n this._path = this._pathsByColor[color] || (this._pathsByColor[color] = new SvgPath());\r\n }\r\n\r\n /**\r\n * Marks the end of the currently drawn shape.\r\n */\r\n endShape() { }\r\n\r\n /**\r\n * Adds a polygon with the current fill color to the SVG.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n this._path.addPolygon(points);\r\n }\r\n\r\n /**\r\n * Adds a circle with the current fill color to the SVG.\r\n * @param {Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n this._path.addCircle(point, diameter, counterClockwise);\r\n }\r\n\r\n /**\r\n * Called when the icon has been completely drawn.\r\n */\r\n finish() { \r\n const pathsByColor = this._pathsByColor;\r\n for (let color in pathsByColor) {\r\n // hasOwnProperty cannot be shadowed in pathsByColor\r\n // eslint-disable-next-line no-prototype-builtins\r\n if (pathsByColor.hasOwnProperty(color)) {\r\n this._target.appendPath(color, pathsByColor[color].dataString);\r\n }\r\n }\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nexport const SVG_CONSTANTS = {\r\n XMLNS: \"http://www.w3.org/2000/svg\",\r\n WIDTH: \"width\",\r\n HEIGHT: \"height\",\r\n}","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { SVG_CONSTANTS } from \"./constants\";\r\n\r\n/**\r\n * Renderer producing SVG output.\r\n */\r\nexport class SvgWriter {\r\n /**\r\n * @param {number} iconSize - Icon width and height in pixels.\r\n */\r\n constructor(iconSize) {\r\n /**\r\n * @type {number}\r\n */\r\n this.iconSize = iconSize;\r\n\r\n /**\r\n * @type {string}\r\n * @private\r\n */\r\n this._s =\r\n '';\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb.\r\n * @param {number} opacity Opacity in the range [0.0, 1.0].\r\n */\r\n setBackground(fillColor, opacity) {\r\n if (opacity) {\r\n this._s += '';\r\n }\r\n }\r\n\r\n /**\r\n * Writes a path to the SVG string.\r\n * @param {string} color Fill color on format #rrggbb.\r\n * @param {string} dataString The SVG path data string.\r\n */\r\n appendPath(color, dataString) {\r\n this._s += '';\r\n }\r\n\r\n /**\r\n * Gets the rendered image as an SVG string.\r\n */\r\n toString() {\r\n return this._s + \"\";\r\n }\r\n}\r\n","import { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { SvgRenderer } from \"../renderer/svg/svgRenderer\";\r\nimport { SvgWriter } from \"../renderer/svg/svgWriter\";\r\n\r\n/**\r\n * Draws an identicon as an SVG string.\r\n * @param {*} hashOrValue - A hexadecimal hash string or any value that will be hashed by Jdenticon.\r\n * @param {number} size - Icon size in pixels.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compatibility a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n * @returns {string} SVG string\r\n */\r\nexport function toSvg(hashOrValue, size, config) {\r\n const writer = new SvgWriter(size);\r\n iconGenerator(new SvgRenderer(writer), \r\n isValidHash(hashOrValue) || computeHash(hashOrValue),\r\n config);\r\n return writer.toString();\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n// This file is compiled to dist/jdenticon-node.js\r\n\r\nif (typeof process === \"undefined\" &&\r\n typeof window !== \"undefined\" &&\r\n typeof document !== \"undefined\"\r\n) {\r\n console.warn(\r\n \"Jdenticon: 'dist/jdenticon-node.js' is only intended for Node.js environments and will increase your \" +\r\n \"bundle size when included in browser bundles. If you want to run Jdenticon in the browser, please add a \" +\r\n \"reference to 'dist/jdenticon.js' or 'dist/jdenticon.min.js' instead.\");\r\n}\r\n\r\nimport { defineConfigPropertyWithWarn } from \"./common/configuration\";\r\nimport { configure } from \"./apis/configure\";\r\nimport { drawIcon } from \"./apis/drawIcon\";\r\nimport { toPng } from \"./apis/toPng\";\r\nimport { toSvg } from \"./apis/toSvg\";\r\n\r\n/**\r\n * @throws {Error}\r\n */\r\nfunction jdenticon() {\r\n throw new Error(\"jdenticon() is not supported on Node.js.\");\r\n}\r\n\r\ndefineConfigPropertyWithWarn(jdenticon);\r\n\r\njdenticon.configure = configure;\r\njdenticon.drawIcon = drawIcon;\r\njdenticon.toPng = toPng;\r\njdenticon.toSvg = toSvg;\r\n\r\n/**\r\n * Specifies the version of the Jdenticon package in use.\r\n * @type {string}\r\n */\r\njdenticon.version = \"#version#\";\r\n\r\n/**\r\n * Specifies which bundle of Jdenticon that is used.\r\n * @type {string}\r\n */\r\njdenticon.bundle = \"node-cjs\";\r\n\r\n/**\r\n * @throws {Error}\r\n */\r\njdenticon.update = function update() {\r\n throw new Error(\"jdenticon.update() is not supported on Node.js.\");\r\n};\r\n\r\n/**\r\n * @throws {Error}\r\n */\r\njdenticon.updateCanvas = function updateCanvas() {\r\n throw new Error(\"jdenticon.updateCanvas() is not supported on Node.js.\");\r\n};\r\n\r\n/**\r\n * @throws {Error}\r\n */\r\njdenticon.updateSvg = function updateSvg() {\r\n throw new Error(\"jdenticon.updateSvg() is not supported on Node.js.\");\r\n};\r\n\r\nmodule.exports = jdenticon;","\n//# sourceMappingURL=jdenticon-node.js.map\n"]} \ No newline at end of file diff --git a/dist/jdenticon-node.mjs b/dist/jdenticon-node.mjs index 0bb10ba..6bc2e0c 100644 --- a/dist/jdenticon-node.mjs +++ b/dist/jdenticon-node.mjs @@ -1,8 +1,8 @@ /** - * Jdenticon 3.1.0 + * Jdenticon 3.1.1 * http://jdenticon.com * - * Built: 2020-12-12T13:51:48.709Z + * Built: 2021-08-14T17:50:52.207Z * * MIT License * @@ -1197,7 +1197,7 @@ if (typeof process === "undefined" && * Specifies the version of the Jdenticon package in use. * @type {string} */ -const version = "3.1.0"; +const version = "3.1.1"; /** * Specifies which bundle of Jdenticon that is used. diff --git a/dist/jdenticon-node.mjs.map b/dist/jdenticon-node.mjs.map index 74df24f..6c84393 100644 --- a/dist/jdenticon-node.mjs.map +++ b/dist/jdenticon-node.mjs.map @@ -1 +1 @@ -{"version":3,"sources":["replacement/1","src/common/parseHex.js","src/renderer/color.js","src/common/global.js","src/common/configuration.js","src/renderer/point.js","src/renderer/transform.js","src/renderer/graphics.js","src/renderer/shapes.js","src/renderer/colorTheme.js","src/renderer/iconGenerator.js","src/common/sha1.js","src/common/hashUtils.js","src/renderer/canvas/canvasRenderer.js","src/apis/drawIcon.js","src/apis/toPng.js","src/renderer/svg/svgPath.js","src/renderer/svg/svgRenderer.js","src/renderer/svg/constants.js","src/renderer/svg/svgWriter.js","src/apis/toSvg.js","src/node-esm.js","replacement/2"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACtBA;AACA;AACA;AACA;AACA;AACO,SAAS,QAAQ,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE;AACtD,IAAI,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;AAC5D;;ACLA,SAAS,QAAQ,CAAC,CAAC,EAAE;AACrB,IAAI,CAAC,IAAI,CAAC,CAAC;AACX,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI;AACvB,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;AACrC,QAAQ,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;AAChC,QAAQ,IAAI,CAAC;AACb,CAAC;AACD;AACA,SAAS,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE;AAC7B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC1C,IAAI,OAAO,QAAQ,CAAC,GAAG;AACvB,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC;AAClC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE;AAClB,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O,SAAS,KAAK,CAAC,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE;AACjD,IAAI,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC;AACvC,IAAI,aAAa,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC;AACzC,QAAQ,WAAW,CAAC,WAAW,CAAC,IAAI,WAAW,CAAC,WAAW,CAAC;AAC5D,QAAQ,MAAM,CAAC,CAAC;AAChB,IAAI,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;AAC7B;;ACdA;AACA;AACA,IAAI,OAAO,OAAO,KAAK,WAAW;AAClC,IAAI,OAAO,MAAM,KAAK,WAAW;AACjC,IAAI,OAAO,QAAQ,KAAK,WAAW;AACnC,EAAE;AACF,IAAI,OAAO,CAAC,IAAI;AAChB,QAAQ,wGAAwG;AAChH,QAAQ,0GAA0G;AAClH,QAAQ,sEAAsE,CAAC,CAAC;AAChF,CAAC;AAMD;AACA;AACA;AACA;AACA;AACY,MAAC,OAAO,GAAG,CAAC,KAAS,EAAE;AACnC;AACA;AACA;AACA;AACA;AACY,MAAC,MAAM,GAAG,WAAW;AACjC;AACA;AACA;AACA;AACO,SAAS,MAAM,GAAG;AACzB,IAAI,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;AACvE,CAAC;AACD;AACA;AACA;AACA;AACO,SAAS,YAAY,GAAG;AAC/B,IAAI,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;AAC7E,CAAC;AACD;AACA;AACA;AACA;AACO,SAAS,SAAS,GAAG;AAC5B,IAAI,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;AAC1E;;;ACrDA","file":"jdenticon-node.mjs","sourcesContent":["/**\r\n * Jdenticon 3.1.0\r\n * http://jdenticon.com\r\n *\r\n * Built: 2020-12-12T13:51:48.709Z\r\n * \r\n * MIT License\r\n * \r\n * Copyright (c) 2014-2020 Daniel Mester Pirttijärvi\r\n * \r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n * \r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n * \r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n */\r\n\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Parses a substring of the hash as a number.\r\n * @param {number} startPosition \r\n * @param {number=} octets\r\n */\r\nexport function parseHex(hash, startPosition, octets) {\r\n return parseInt(hash.substr(startPosition, octets), 16);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { parseHex } from \"../common/parseHex\";\r\n\r\nfunction decToHex(v) {\r\n v |= 0; // Ensure integer value\r\n return v < 0 ? \"00\" :\r\n v < 16 ? \"0\" + v.toString(16) :\r\n v < 256 ? v.toString(16) :\r\n \"ff\";\r\n}\r\n\r\nfunction hueToRgb(m1, m2, h) {\r\n h = h < 0 ? h + 6 : h > 6 ? h - 6 : h;\r\n return decToHex(255 * (\r\n h < 1 ? m1 + (m2 - m1) * h :\r\n h < 3 ? m2 :\r\n h < 4 ? m1 + (m2 - m1) * (4 - h) :\r\n m1));\r\n}\r\n\r\n/**\r\n * @param {number} r Red channel [0, 255]\r\n * @param {number} g Green channel [0, 255]\r\n * @param {number} b Blue channel [0, 255]\r\n */\r\nexport function rgb(r, g, b) {\r\n return \"#\" + decToHex(r) + decToHex(g) + decToHex(b);\r\n}\r\n\r\n/**\r\n * @param {string} color Color value to parse. Currently hexadecimal strings on the format #rgb[a] and #rrggbb[aa] are supported.\r\n * @returns {string}\r\n */\r\nexport function parseColor(color) {\r\n if (/^#[0-9a-f]{3,8}$/i.test(color)) {\r\n let result;\r\n const colorLength = color.length;\r\n\r\n if (colorLength < 6) {\r\n const r = color[1],\r\n g = color[2],\r\n b = color[3],\r\n a = color[4] || \"\";\r\n result = \"#\" + r + r + g + g + b + b + a + a;\r\n }\r\n if (colorLength == 7 || colorLength > 8) {\r\n result = color;\r\n }\r\n \r\n return result;\r\n }\r\n}\r\n\r\n/**\r\n * Converts a hexadecimal color to a CSS3 compatible color.\r\n * @param {string} hexColor Color on the format \"#RRGGBB\" or \"#RRGGBBAA\"\r\n * @returns {string}\r\n */\r\nexport function toCss3Color(hexColor) {\r\n const a = parseHex(hexColor, 7, 2);\r\n let result;\r\n\r\n if (isNaN(a)) {\r\n result = hexColor;\r\n } else {\r\n const r = parseHex(hexColor, 1, 2),\r\n g = parseHex(hexColor, 3, 2),\r\n b = parseHex(hexColor, 5, 2);\r\n result = \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + (a / 255).toFixed(2) + \")\";\r\n }\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * Converts an HSL color to a hexadecimal RGB color.\r\n * @param {number} hue Hue in range [0, 1]\r\n * @param {number} saturation Saturation in range [0, 1]\r\n * @param {number} lightness Lightness in range [0, 1]\r\n * @returns {string}\r\n */\r\nexport function hsl(hue, saturation, lightness) {\r\n // Based on http://www.w3.org/TR/2011/REC-css3-color-20110607/#hsl-color\r\n let result;\r\n\r\n if (saturation == 0) {\r\n const partialHex = decToHex(lightness * 255);\r\n result = partialHex + partialHex + partialHex;\r\n }\r\n else {\r\n const m2 = lightness <= 0.5 ? lightness * (saturation + 1) : lightness + saturation - lightness * saturation,\r\n m1 = lightness * 2 - m2;\r\n result =\r\n hueToRgb(m1, m2, hue * 6 + 2) +\r\n hueToRgb(m1, m2, hue * 6) +\r\n hueToRgb(m1, m2, hue * 6 - 2);\r\n }\r\n\r\n return \"#\" + result;\r\n}\r\n\r\n/**\r\n * Converts an HSL color to a hexadecimal RGB color. This function will correct the lightness for the \"dark\" hues\r\n * @param {number} hue Hue in range [0, 1]\r\n * @param {number} saturation Saturation in range [0, 1]\r\n * @param {number} lightness Lightness in range [0, 1]\r\n * @returns {string}\r\n */\r\nexport function correctedHsl(hue, saturation, lightness) {\r\n // The corrector specifies the perceived middle lightness for each hue\r\n const correctors = [ 0.55, 0.5, 0.5, 0.46, 0.6, 0.55, 0.55 ],\r\n corrector = correctors[(hue * 6 + 0.5) | 0];\r\n \r\n // Adjust the input lightness relative to the corrector\r\n lightness = lightness < 0.5 ? lightness * corrector * 2 : corrector + (lightness - 0.5) * (1 - corrector) * 2;\r\n \r\n return hsl(hue, saturation, lightness);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n// In the future we can replace `GLOBAL` with `globalThis`, but for now use the old school global detection for\r\n// backward compatibility.\r\n\r\nexport const GLOBAL = \r\n typeof window !== \"undefined\" ? window :\r\n typeof self !== \"undefined\" ? self :\r\n typeof global !== \"undefined\" ? global :\r\n {};\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { parseColor } from \"../renderer/color\";\r\nimport { GLOBAL } from \"./global\";\r\n\r\n/**\r\n * @typedef {Object} ParsedConfiguration\r\n * @property {number} colorSaturation\r\n * @property {number} grayscaleSaturation\r\n * @property {string} backColor\r\n * @property {number} iconPadding\r\n * @property {function(number):number} hue\r\n * @property {function(number):number} colorLightness\r\n * @property {function(number):number} grayscaleLightness\r\n */\r\n\r\nexport const CONFIG_PROPERTIES = {\r\n GLOBAL: \"jdenticon_config\",\r\n MODULE: \"config\",\r\n};\r\n\r\nvar rootConfigurationHolder = {};\r\n\r\n/**\r\n * Defines the deprecated `config` property on the root Jdenticon object. When the property is set a warning is \r\n * printed in the console. To minimize bundle size, this is only used in Node bundles.\r\n * @param {!Object} rootObject \r\n */\r\nexport function defineConfigPropertyWithWarn(rootObject) {\r\n Object.defineProperty(rootObject, CONFIG_PROPERTIES.MODULE, {\r\n configurable: true,\r\n get: () => rootConfigurationHolder[CONFIG_PROPERTIES.MODULE],\r\n set: newConfiguration => {\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] = newConfiguration;\r\n console.warn(\"jdenticon.config is deprecated. Use jdenticon.configure() instead.\");\r\n },\r\n });\r\n}\r\n\r\n/**\r\n * Defines the deprecated `config` property on the root Jdenticon object without printing a warning in the console\r\n * when it is being used.\r\n * @param {!Object} rootObject \r\n */\r\nexport function defineConfigProperty(rootObject) {\r\n rootConfigurationHolder = rootObject;\r\n}\r\n\r\n/**\r\n * Sets a new icon style configuration. The new configuration is not merged with the previous one. * \r\n * @param {Object} newConfiguration - New configuration object.\r\n */\r\nexport function configure(newConfiguration) {\r\n if (arguments.length) {\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] = newConfiguration;\r\n }\r\n return rootConfigurationHolder[CONFIG_PROPERTIES.MODULE];\r\n}\r\n\r\n/**\r\n * Gets the normalized current Jdenticon color configuration. Missing fields have default values.\r\n * @param {Object|number|undefined} paddingOrLocalConfig - Configuration passed to the called API method. A\r\n * local configuration overrides the global configuration in it entirety. This parameter can for backward\r\n * compatibility also contain a padding value. A padding value only overrides the global padding, not the\r\n * entire global configuration.\r\n * @param {number} defaultPadding - Padding used if no padding is specified in neither the configuration nor\r\n * explicitly to the API method.\r\n * @returns {ParsedConfiguration}\r\n */\r\nexport function getConfiguration(paddingOrLocalConfig, defaultPadding) {\r\n const configObject = \r\n typeof paddingOrLocalConfig == \"object\" && paddingOrLocalConfig ||\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] ||\r\n GLOBAL[CONFIG_PROPERTIES.GLOBAL] ||\r\n { },\r\n\r\n lightnessConfig = configObject[\"lightness\"] || { },\r\n \r\n // In versions < 2.1.0 there was no grayscale saturation -\r\n // saturation was the color saturation.\r\n saturation = configObject[\"saturation\"] || { },\r\n colorSaturation = \"color\" in saturation ? saturation[\"color\"] : saturation,\r\n grayscaleSaturation = saturation[\"grayscale\"],\r\n\r\n backColor = configObject[\"backColor\"],\r\n padding = configObject[\"padding\"];\r\n \r\n /**\r\n * Creates a lightness range.\r\n */\r\n function lightness(configName, defaultRange) {\r\n let range = lightnessConfig[configName];\r\n \r\n // Check if the lightness range is an array-like object. This way we ensure the\r\n // array contain two values at the same time.\r\n if (!(range && range.length > 1)) {\r\n range = defaultRange;\r\n }\r\n\r\n /**\r\n * Gets a lightness relative the specified value in the specified lightness range.\r\n */\r\n return function (value) {\r\n value = range[0] + value * (range[1] - range[0]);\r\n return value < 0 ? 0 : value > 1 ? 1 : value;\r\n };\r\n }\r\n\r\n /**\r\n * Gets a hue allowed by the configured hue restriction,\r\n * provided the originally computed hue.\r\n */\r\n function hueFunction(originalHue) {\r\n const hueConfig = configObject[\"hues\"];\r\n let hue;\r\n \r\n // Check if 'hues' is an array-like object. This way we also ensure that\r\n // the array is not empty, which would mean no hue restriction.\r\n if (hueConfig && hueConfig.length > 0) {\r\n // originalHue is in the range [0, 1]\r\n // Multiply with 0.999 to change the range to [0, 1) and then truncate the index.\r\n hue = hueConfig[0 | (0.999 * originalHue * hueConfig.length)];\r\n }\r\n\r\n return typeof hue == \"number\" ?\r\n \r\n // A hue was specified. We need to convert the hue from\r\n // degrees on any turn - e.g. 746° is a perfectly valid hue -\r\n // to turns in the range [0, 1).\r\n ((((hue / 360) % 1) + 1) % 1) :\r\n\r\n // No hue configured => use original hue\r\n originalHue;\r\n }\r\n \r\n return {\r\n hue: hueFunction,\r\n colorSaturation: typeof colorSaturation == \"number\" ? colorSaturation : 0.5,\r\n grayscaleSaturation: typeof grayscaleSaturation == \"number\" ? grayscaleSaturation : 0,\r\n colorLightness: lightness(\"color\", [0.4, 0.8]),\r\n grayscaleLightness: lightness(\"grayscale\", [0.3, 0.9]),\r\n backColor: parseColor(backColor),\r\n iconPadding: \r\n typeof paddingOrLocalConfig == \"number\" ? paddingOrLocalConfig : \r\n typeof padding == \"number\" ? padding : \r\n defaultPadding\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Represents a point.\r\n */\r\nexport class Point {\r\n /**\r\n * @param {number} x \r\n * @param {number} y \r\n */\r\n constructor(x, y) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { Point } from \"./point\";\r\n\r\n/**\r\n * Translates and rotates a point before being passed on to the canvas context. This was previously done by the canvas context itself, \r\n * but this caused a rendering issue in Chrome on sizes > 256 where the rotation transformation of inverted paths was not done properly.\r\n */\r\nexport class Transform {\r\n /**\r\n * @param {number} x The x-coordinate of the upper left corner of the transformed rectangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the transformed rectangle.\r\n * @param {number} size The size of the transformed rectangle.\r\n * @param {number} rotation Rotation specified as 0 = 0 rad, 1 = 0.5π rad, 2 = π rad, 3 = 1.5π rad\r\n */\r\n constructor(x, y, size, rotation) {\r\n this._x = x;\r\n this._y = y;\r\n this._size = size;\r\n this._rotation = rotation;\r\n }\r\n\r\n /**\r\n * Transforms the specified point based on the translation and rotation specification for this Transform.\r\n * @param {number} x x-coordinate\r\n * @param {number} y y-coordinate\r\n * @param {number=} w The width of the transformed rectangle. If greater than 0, this will ensure the returned point is of the upper left corner of the transformed rectangle.\r\n * @param {number=} h The height of the transformed rectangle. If greater than 0, this will ensure the returned point is of the upper left corner of the transformed rectangle.\r\n */\r\n transformIconPoint(x, y, w, h) {\r\n const right = this._x + this._size,\r\n bottom = this._y + this._size,\r\n rotation = this._rotation;\r\n return rotation === 1 ? new Point(right - y - (h || 0), this._y + x) :\r\n rotation === 2 ? new Point(right - x - (w || 0), bottom - y - (h || 0)) :\r\n rotation === 3 ? new Point(this._x + y, bottom - x - (w || 0)) :\r\n new Point(this._x + x, this._y + y);\r\n }\r\n}\r\n\r\nexport const NO_TRANSFORM = new Transform(0, 0, 0, 0);\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { NO_TRANSFORM } from \"./transform\";\r\n\r\n/**\r\n * @typedef {import(\"./renderer\").Renderer} Renderer\r\n * @typedef {import(\"./transform\").Transform} Transform\r\n */\r\n\r\n/**\r\n * Provides helper functions for rendering common basic shapes.\r\n */\r\nexport class Graphics {\r\n /**\r\n * @param {Renderer} renderer \r\n */\r\n constructor(renderer) {\r\n /**\r\n * @type {Renderer}\r\n * @private\r\n */\r\n this._renderer = renderer;\r\n\r\n /**\r\n * @type {Transform}\r\n */\r\n this.currentTransform = NO_TRANSFORM;\r\n }\r\n\r\n /**\r\n * Adds a polygon to the underlying renderer.\r\n * @param {Array} points The points of the polygon clockwise on the format [ x0, y0, x1, y1, ..., xn, yn ]\r\n * @param {boolean=} invert Specifies if the polygon will be inverted.\r\n */\r\n addPolygon(points, invert) {\r\n const di = invert ? -2 : 2,\r\n transformedPoints = [];\r\n \r\n for (let i = invert ? points.length - 2 : 0; i < points.length && i >= 0; i += di) {\r\n transformedPoints.push(this.currentTransform.transformIconPoint(points[i], points[i + 1]));\r\n }\r\n \r\n this._renderer.addPolygon(transformedPoints);\r\n }\r\n \r\n /**\r\n * Adds a polygon to the underlying renderer.\r\n * Source: http://stackoverflow.com/a/2173084\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the entire ellipse.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the entire ellipse.\r\n * @param {number} size The size of the ellipse.\r\n * @param {boolean=} invert Specifies if the ellipse will be inverted.\r\n */\r\n addCircle(x, y, size, invert) {\r\n const p = this.currentTransform.transformIconPoint(x, y, size, size);\r\n this._renderer.addCircle(p, size, invert);\r\n }\r\n\r\n /**\r\n * Adds a rectangle to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle.\r\n * @param {number} w The width of the rectangle.\r\n * @param {number} h The height of the rectangle.\r\n * @param {boolean=} invert Specifies if the rectangle will be inverted.\r\n */\r\n addRectangle(x, y, w, h, invert) {\r\n this.addPolygon([\r\n x, y, \r\n x + w, y,\r\n x + w, y + h,\r\n x, y + h\r\n ], invert);\r\n }\r\n\r\n /**\r\n * Adds a right triangle to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the triangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the triangle.\r\n * @param {number} w The width of the triangle.\r\n * @param {number} h The height of the triangle.\r\n * @param {number} r The rotation of the triangle (clockwise). 0 = right corner of the triangle in the lower left corner of the bounding rectangle.\r\n * @param {boolean=} invert Specifies if the triangle will be inverted.\r\n */\r\n addTriangle(x, y, w, h, r, invert) {\r\n const points = [\r\n x + w, y, \r\n x + w, y + h, \r\n x, y + h,\r\n x, y\r\n ];\r\n points.splice(((r || 0) % 4) * 2, 2);\r\n this.addPolygon(points, invert);\r\n }\r\n\r\n /**\r\n * Adds a rhombus to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the rhombus.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the rhombus.\r\n * @param {number} w The width of the rhombus.\r\n * @param {number} h The height of the rhombus.\r\n * @param {boolean=} invert Specifies if the rhombus will be inverted.\r\n */\r\n addRhombus(x, y, w, h, invert) {\r\n this.addPolygon([\r\n x + w / 2, y,\r\n x + w, y + h / 2,\r\n x + w / 2, y + h,\r\n x, y + h / 2\r\n ], invert);\r\n }\r\n}","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * @param {number} index\r\n * @param {Graphics} g\r\n * @param {number} cell\r\n * @param {number} positionIndex\r\n * @typedef {import('./graphics').Graphics} Graphics\r\n */\r\nexport function centerShape(index, g, cell, positionIndex) {\r\n index = index % 14;\r\n\r\n let k, m, w, h, inner, outer;\r\n\r\n !index ? (\r\n k = cell * 0.42,\r\n g.addPolygon([\r\n 0, 0,\r\n cell, 0,\r\n cell, cell - k * 2,\r\n cell - k, cell,\r\n 0, cell\r\n ])) :\r\n\r\n index == 1 ? (\r\n w = 0 | (cell * 0.5), \r\n h = 0 | (cell * 0.8),\r\n\r\n g.addTriangle(cell - w, 0, w, h, 2)) :\r\n\r\n index == 2 ? (\r\n w = 0 | (cell / 3),\r\n g.addRectangle(w, w, cell - w, cell - w)) :\r\n\r\n index == 3 ? (\r\n inner = cell * 0.1,\r\n // Use fixed outer border widths in small icons to ensure the border is drawn\r\n outer = \r\n cell < 6 ? 1 :\r\n cell < 8 ? 2 :\r\n (0 | (cell * 0.25)),\r\n \r\n inner = \r\n inner > 1 ? (0 | inner) : // large icon => truncate decimals\r\n inner > 0.5 ? 1 : // medium size icon => fixed width\r\n inner, // small icon => anti-aliased border\r\n\r\n g.addRectangle(outer, outer, cell - inner - outer, cell - inner - outer)) :\r\n\r\n index == 4 ? (\r\n m = 0 | (cell * 0.15),\r\n w = 0 | (cell * 0.5),\r\n g.addCircle(cell - w - m, cell - w - m, w)) :\r\n\r\n index == 5 ? (\r\n inner = cell * 0.1,\r\n outer = inner * 4,\r\n\r\n // Align edge to nearest pixel in large icons\r\n outer > 3 && (outer = 0 | outer),\r\n \r\n g.addRectangle(0, 0, cell, cell),\r\n g.addPolygon([\r\n outer, outer,\r\n cell - inner, outer,\r\n outer + (cell - outer - inner) / 2, cell - inner\r\n ], true)) :\r\n\r\n index == 6 ? \r\n g.addPolygon([\r\n 0, 0,\r\n cell, 0,\r\n cell, cell * 0.7,\r\n cell * 0.4, cell * 0.4,\r\n cell * 0.7, cell,\r\n 0, cell\r\n ]) :\r\n\r\n index == 7 ? \r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 3) :\r\n\r\n index == 8 ? (\r\n g.addRectangle(0, 0, cell, cell / 2),\r\n g.addRectangle(0, cell / 2, cell / 2, cell / 2),\r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 1)) :\r\n\r\n index == 9 ? (\r\n inner = cell * 0.14,\r\n // Use fixed outer border widths in small icons to ensure the border is drawn\r\n outer = \r\n cell < 4 ? 1 :\r\n cell < 6 ? 2 :\r\n (0 | (cell * 0.35)),\r\n\r\n inner = \r\n cell < 8 ? inner : // small icon => anti-aliased border\r\n (0 | inner), // large icon => truncate decimals\r\n\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addRectangle(outer, outer, cell - outer - inner, cell - outer - inner, true)) :\r\n\r\n index == 10 ? (\r\n inner = cell * 0.12,\r\n outer = inner * 3,\r\n\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addCircle(outer, outer, cell - inner - outer, true)) :\r\n\r\n index == 11 ? \r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 3) :\r\n\r\n index == 12 ? (\r\n m = cell * 0.25,\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addRhombus(m, m, cell - m, cell - m, true)) :\r\n\r\n // 13\r\n (\r\n !positionIndex && (\r\n m = cell * 0.4, w = cell * 1.2,\r\n g.addCircle(m, m, w)\r\n )\r\n );\r\n}\r\n\r\n/**\r\n * @param {number} index\r\n * @param {Graphics} g\r\n * @param {number} cell\r\n */\r\nexport function outerShape(index, g, cell) {\r\n index = index % 4;\r\n\r\n let m;\r\n\r\n !index ?\r\n g.addTriangle(0, 0, cell, cell, 0) :\r\n \r\n index == 1 ?\r\n g.addTriangle(0, cell / 2, cell, cell / 2, 0) :\r\n\r\n index == 2 ?\r\n g.addRhombus(0, 0, cell, cell) :\r\n\r\n // 3\r\n (\r\n m = cell / 6,\r\n g.addCircle(m, m, cell - 2 * m)\r\n );\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { correctedHsl } from \"./color\";\r\n\r\n/**\r\n * Gets a set of identicon color candidates for a specified hue and config.\r\n * @param {number} hue\r\n * @param {import(\"../common/configuration\").ParsedConfiguration} config\r\n */\r\nexport function colorTheme(hue, config) {\r\n hue = config.hue(hue);\r\n return [\r\n // Dark gray\r\n correctedHsl(hue, config.grayscaleSaturation, config.grayscaleLightness(0)),\r\n // Mid color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(0.5)),\r\n // Light gray\r\n correctedHsl(hue, config.grayscaleSaturation, config.grayscaleLightness(1)),\r\n // Light color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(1)),\r\n // Dark color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(0))\r\n ];\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { Transform } from \"./transform\";\r\nimport { Graphics } from \"./graphics\";\r\nimport { centerShape, outerShape } from \"./shapes\";\r\nimport { colorTheme } from \"./colorTheme\";\r\nimport { parseHex } from \"../common/parseHex\";\r\nimport { getConfiguration } from \"../common/configuration\";\r\n \r\n/**\r\n * Draws an identicon to a specified renderer.\r\n * @param {import('./renderer').Renderer} renderer\r\n * @param {string} hash\r\n * @param {Object|number=} config\r\n */\r\nexport function iconGenerator(renderer, hash, config) {\r\n const parsedConfig = getConfiguration(config, 0.08);\r\n\r\n // Set background color\r\n if (parsedConfig.backColor) {\r\n renderer.setBackground(parsedConfig.backColor);\r\n }\r\n \r\n // Calculate padding and round to nearest integer\r\n let size = renderer.iconSize;\r\n const padding = (0.5 + size * parsedConfig.iconPadding) | 0;\r\n size -= padding * 2;\r\n \r\n const graphics = new Graphics(renderer);\r\n \r\n // Calculate cell size and ensure it is an integer\r\n const cell = 0 | (size / 4);\r\n \r\n // Since the cell size is integer based, the actual icon will be slightly smaller than specified => center icon\r\n const x = 0 | (padding + size / 2 - cell * 2);\r\n const y = 0 | (padding + size / 2 - cell * 2);\r\n\r\n function renderShape(colorIndex, shapes, index, rotationIndex, positions) {\r\n const shapeIndex = parseHex(hash, index, 1);\r\n let r = rotationIndex ? parseHex(hash, rotationIndex, 1) : 0;\r\n \r\n renderer.beginShape(availableColors[selectedColorIndexes[colorIndex]]);\r\n \r\n for (let i = 0; i < positions.length; i++) {\r\n graphics.currentTransform = new Transform(x + positions[i][0] * cell, y + positions[i][1] * cell, cell, r++ % 4);\r\n shapes(shapeIndex, graphics, cell, i);\r\n }\r\n \r\n renderer.endShape();\r\n }\r\n\r\n // AVAILABLE COLORS\r\n const hue = parseHex(hash, -7) / 0xfffffff,\r\n \r\n // Available colors for this icon\r\n availableColors = colorTheme(hue, parsedConfig),\r\n\r\n // The index of the selected colors\r\n selectedColorIndexes = [];\r\n\r\n let index;\r\n\r\n function isDuplicate(values) {\r\n if (values.indexOf(index) >= 0) {\r\n for (let i = 0; i < values.length; i++) {\r\n if (selectedColorIndexes.indexOf(values[i]) >= 0) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n for (let i = 0; i < 3; i++) {\r\n index = parseHex(hash, 8 + i, 1) % availableColors.length;\r\n if (isDuplicate([0, 4]) || // Disallow dark gray and dark color combo\r\n isDuplicate([2, 3])) { // Disallow light gray and light color combo\r\n index = 1;\r\n }\r\n selectedColorIndexes.push(index);\r\n }\r\n\r\n // ACTUAL RENDERING\r\n // Sides\r\n renderShape(0, outerShape, 2, 3, [[1, 0], [2, 0], [2, 3], [1, 3], [0, 1], [3, 1], [3, 2], [0, 2]]);\r\n // Corners\r\n renderShape(1, outerShape, 4, 5, [[0, 0], [3, 0], [3, 3], [0, 3]]);\r\n // Center\r\n renderShape(2, centerShape, 1, null, [[1, 1], [2, 1], [2, 2], [1, 2]]);\r\n \r\n renderer.finish();\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Computes a SHA1 hash for any value and returns it as a hexadecimal string.\r\n * \r\n * This function is optimized for minimal code size and rather short messages.\r\n * \r\n * @param {string} message \r\n */\r\nexport function sha1(message) {\r\n const HASH_SIZE_HALF_BYTES = 40;\r\n const BLOCK_SIZE_WORDS = 16;\r\n\r\n // Variables\r\n // `var` is used to be able to minimize the number of `var` keywords.\r\n var i = 0,\r\n f = 0,\r\n \r\n // Use `encodeURI` to UTF8 encode the message without any additional libraries\r\n // We could use `unescape` + `encodeURI` to minimize the code, but that would be slightly risky\r\n // since `unescape` is deprecated.\r\n urlEncodedMessage = encodeURI(message) + \"%80\", // trailing '1' bit padding\r\n \r\n // This can be changed to a preallocated Uint32Array array for greater performance and larger code size\r\n data = [],\r\n dataSize,\r\n \r\n hashBuffer = [],\r\n\r\n a = 0x67452301,\r\n b = 0xefcdab89,\r\n c = ~a,\r\n d = ~b,\r\n e = 0xc3d2e1f0,\r\n hash = [a, b, c, d, e],\r\n\r\n blockStartIndex = 0,\r\n hexHash = \"\";\r\n\r\n /**\r\n * Rotates the value a specified number of bits to the left.\r\n * @param {number} value Value to rotate\r\n * @param {number} shift Bit count to shift.\r\n */\r\n function rotl(value, shift) {\r\n return (value << shift) | (value >>> (32 - shift));\r\n }\r\n\r\n // Message data\r\n for ( ; i < urlEncodedMessage.length; f++) {\r\n data[f >> 2] = data[f >> 2] |\r\n (\r\n (\r\n urlEncodedMessage[i] == \"%\"\r\n // Percent encoded byte\r\n ? parseInt(urlEncodedMessage.substring(i + 1, i += 3), 16)\r\n // Unencoded byte\r\n : urlEncodedMessage.charCodeAt(i++)\r\n )\r\n\r\n // Read bytes in reverse order (big endian words)\r\n << ((3 - (f & 3)) * 8)\r\n );\r\n }\r\n\r\n // f is now the length of the utf8 encoded message\r\n // 7 = 8 bytes (64 bit) for message size, -1 to round down\r\n // >> 6 = integer division with block size\r\n dataSize = (((f + 7) >> 6) + 1) * BLOCK_SIZE_WORDS;\r\n\r\n // Message size in bits.\r\n // SHA1 uses a 64 bit integer to represent the size, but since we only support short messages only the least\r\n // significant 32 bits are set. -8 is for the '1' bit padding byte.\r\n data[dataSize - 1] = f * 8 - 8;\r\n \r\n // Compute hash\r\n for ( ; blockStartIndex < dataSize; blockStartIndex += BLOCK_SIZE_WORDS) {\r\n for (i = 0; i < 80; i++) {\r\n f = rotl(a, 5) + e + (\r\n // Ch\r\n i < 20 ? ((b & c) ^ ((~b) & d)) + 0x5a827999 :\r\n \r\n // Parity\r\n i < 40 ? (b ^ c ^ d) + 0x6ed9eba1 :\r\n \r\n // Maj\r\n i < 60 ? ((b & c) ^ (b & d) ^ (c & d)) + 0x8f1bbcdc :\r\n \r\n // Parity\r\n (b ^ c ^ d) + 0xca62c1d6\r\n ) + ( \r\n hashBuffer[i] = i < BLOCK_SIZE_WORDS\r\n // Bitwise OR is used to coerse `undefined` to 0\r\n ? (data[blockStartIndex + i] | 0)\r\n : rotl(hashBuffer[i - 3] ^ hashBuffer[i - 8] ^ hashBuffer[i - 14] ^ hashBuffer[i - 16], 1)\r\n );\r\n\r\n e = d;\r\n d = c;\r\n c = rotl(b, 30);\r\n b = a;\r\n a = f;\r\n }\r\n\r\n hash[0] = a = ((hash[0] + a) | 0);\r\n hash[1] = b = ((hash[1] + b) | 0);\r\n hash[2] = c = ((hash[2] + c) | 0);\r\n hash[3] = d = ((hash[3] + d) | 0);\r\n hash[4] = e = ((hash[4] + e) | 0);\r\n }\r\n\r\n // Format hex hash\r\n for (i = 0; i < HASH_SIZE_HALF_BYTES; i++) {\r\n hexHash += (\r\n (\r\n // Get word (2^3 half-bytes per word)\r\n hash[i >> 3] >>>\r\n\r\n // Append half-bytes in reverse order\r\n ((7 - (i & 7)) * 4)\r\n ) \r\n // Clamp to half-byte\r\n & 0xf\r\n ).toString(16);\r\n }\r\n\r\n return hexHash;\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { sha1 } from \"./sha1\";\r\n\r\n/**\r\n * Inputs a value that might be a valid hash string for Jdenticon and returns it \r\n * if it is determined valid, otherwise a falsy value is returned.\r\n */\r\nexport function isValidHash(hashCandidate) {\r\n return /^[0-9a-f]{11,}$/i.test(hashCandidate) && hashCandidate;\r\n}\r\n\r\n/**\r\n * Computes a hash for the specified value. Currently SHA1 is used. This function\r\n * always returns a valid hash.\r\n */\r\nexport function computeHash(value) {\r\n return sha1(value == null ? \"\" : \"\" + value);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { toCss3Color } from \"../color\";\r\n\r\n/**\r\n * @typedef {import(\"../renderer\").Renderer} Renderer\r\n * @typedef {import('../point').Point} Point\r\n */\r\n\r\n/**\r\n * Renderer redirecting drawing commands to a canvas context.\r\n * @implements {Renderer}\r\n */\r\nexport class CanvasRenderer {\r\n /**\r\n * @param {number=} iconSize\r\n */\r\n constructor(ctx, iconSize) {\r\n const canvas = ctx.canvas; \r\n const width = canvas.width;\r\n const height = canvas.height;\r\n \r\n ctx.save();\r\n \r\n if (!iconSize) {\r\n iconSize = Math.min(width, height);\r\n \r\n ctx.translate(\r\n ((width - iconSize) / 2) | 0,\r\n ((height - iconSize) / 2) | 0);\r\n }\r\n\r\n /**\r\n * @private\r\n */\r\n this._ctx = ctx;\r\n this.iconSize = iconSize;\r\n \r\n ctx.clearRect(0, 0, iconSize, iconSize);\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb[aa].\r\n */\r\n setBackground(fillColor) {\r\n const ctx = this._ctx;\r\n const iconSize = this.iconSize;\r\n\r\n ctx.fillStyle = toCss3Color(fillColor);\r\n ctx.fillRect(0, 0, iconSize, iconSize);\r\n }\r\n\r\n /**\r\n * Marks the beginning of a new shape of the specified color. Should be ended with a call to endShape.\r\n * @param {string} fillColor Fill color on format #rrggbb[aa].\r\n */\r\n beginShape(fillColor) {\r\n const ctx = this._ctx;\r\n ctx.fillStyle = toCss3Color(fillColor);\r\n ctx.beginPath();\r\n }\r\n\r\n /**\r\n * Marks the end of the currently drawn shape. This causes the queued paths to be rendered on the canvas.\r\n */\r\n endShape() {\r\n this._ctx.fill();\r\n }\r\n\r\n /**\r\n * Adds a polygon to the rendering queue.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n const ctx = this._ctx;\r\n ctx.moveTo(points[0].x, points[0].y);\r\n for (let i = 1; i < points.length; i++) {\r\n ctx.lineTo(points[i].x, points[i].y);\r\n }\r\n ctx.closePath();\r\n }\r\n\r\n /**\r\n * Adds a circle to the rendering queue.\r\n * @param {Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n const ctx = this._ctx,\r\n radius = diameter / 2;\r\n ctx.moveTo(point.x + radius, point.y + radius);\r\n ctx.arc(point.x + radius, point.y + radius, radius, 0, Math.PI * 2, counterClockwise);\r\n ctx.closePath();\r\n }\r\n\r\n /**\r\n * Called when the icon has been completely drawn.\r\n */\r\n finish() {\r\n this._ctx.restore();\r\n }\r\n}\r\n","import { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { CanvasRenderer } from \"../renderer/canvas/canvasRenderer\";\r\n\r\n/**\r\n * Draws an identicon to a context.\r\n * @param {CanvasRenderingContext2D} ctx - Canvas context on which the icon will be drawn at location (0, 0).\r\n * @param {*} hashOrValue - A hexadecimal hash string or any value that will be hashed by Jdenticon.\r\n * @param {number} size - Icon size in pixels.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compatibility a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function drawIcon(ctx, hashOrValue, size, config) {\r\n if (!ctx) {\r\n throw new Error(\"No canvas specified.\");\r\n }\r\n \r\n iconGenerator(new CanvasRenderer(ctx, size), \r\n isValidHash(hashOrValue) || computeHash(hashOrValue), \r\n config);\r\n}\r\n","import canvasRenderer from \"canvas-renderer\";\r\nimport { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { CanvasRenderer } from \"../renderer/canvas/canvasRenderer\";\r\n\r\n/**\r\n * Draws an identicon as PNG.\r\n * @param {*} hashOrValue - A hexadecimal hash string or any value that will be hashed by Jdenticon.\r\n * @param {number} size - Icon size in pixels.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compatibility a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n * @returns {Buffer} PNG data\r\n */\r\nexport function toPng(hashOrValue, size, config) {\r\n const canvas = canvasRenderer.createCanvas(size, size);\r\n const ctx = canvas.getContext(\"2d\");\r\n \r\n iconGenerator(new CanvasRenderer(ctx, size), \r\n isValidHash(hashOrValue) || computeHash(hashOrValue), \r\n config);\r\n \r\n return canvas.toPng({ \"Software\": \"Jdenticon\" });\r\n}","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Prepares a measure to be used as a measure in an SVG path, by\r\n * rounding the measure to a single decimal. This reduces the file\r\n * size of the generated SVG with more than 50% in some cases.\r\n */\r\nfunction svgValue(value) {\r\n return ((value * 10 + 0.5) | 0) / 10;\r\n}\r\n\r\n/**\r\n * Represents an SVG path element.\r\n */\r\nexport class SvgPath {\r\n constructor() {\r\n /**\r\n * This property holds the data string (path.d) of the SVG path.\r\n * @type {string}\r\n */\r\n this.dataString = \"\";\r\n }\r\n\r\n /**\r\n * Adds a polygon with the current fill color to the SVG path.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n let dataString = \"\";\r\n for (let i = 0; i < points.length; i++) {\r\n dataString += (i ? \"L\" : \"M\") + svgValue(points[i].x) + \" \" + svgValue(points[i].y);\r\n }\r\n this.dataString += dataString + \"Z\";\r\n }\r\n\r\n /**\r\n * Adds a circle with the current fill color to the SVG path.\r\n * @param {import('../point').Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n const sweepFlag = counterClockwise ? 0 : 1,\r\n svgRadius = svgValue(diameter / 2),\r\n svgDiameter = svgValue(diameter),\r\n svgArc = \"a\" + svgRadius + \",\" + svgRadius + \" 0 1,\" + sweepFlag + \" \";\r\n \r\n this.dataString += \r\n \"M\" + svgValue(point.x) + \" \" + svgValue(point.y + diameter / 2) +\r\n svgArc + svgDiameter + \",0\" + \r\n svgArc + (-svgDiameter) + \",0\";\r\n }\r\n}\r\n\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { SvgPath } from \"./svgPath\";\r\nimport { parseHex } from \"../../common/parseHex\";\r\n\r\n/**\r\n * @typedef {import(\"../point\").Point} Point\r\n * @typedef {import(\"../renderer\").Renderer} Renderer\r\n * @typedef {import(\"./svgElement\").SvgElement} SvgElement\r\n * @typedef {import(\"./svgWriter\").SvgWriter} SvgWriter\r\n */\r\n\r\n/**\r\n * Renderer producing SVG output.\r\n * @implements {Renderer}\r\n */\r\nexport class SvgRenderer {\r\n /**\r\n * @param {SvgElement|SvgWriter} target \r\n */\r\n constructor(target) {\r\n /**\r\n * @type {SvgPath}\r\n * @private\r\n */\r\n this._path;\r\n\r\n /**\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._pathsByColor = { };\r\n\r\n /**\r\n * @type {SvgElement|SvgWriter}\r\n * @private\r\n */\r\n this._target = target;\r\n\r\n /**\r\n * @type {number}\r\n */\r\n this.iconSize = target.iconSize;\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb[aa].\r\n */\r\n setBackground(fillColor) {\r\n const match = /^(#......)(..)?/.exec(fillColor),\r\n opacity = match[2] ? parseHex(match[2], 0) / 255 : 1;\r\n this._target.setBackground(match[1], opacity);\r\n }\r\n\r\n /**\r\n * Marks the beginning of a new shape of the specified color. Should be ended with a call to endShape.\r\n * @param {string} color Fill color on format #xxxxxx.\r\n */\r\n beginShape(color) {\r\n this._path = this._pathsByColor[color] || (this._pathsByColor[color] = new SvgPath());\r\n }\r\n\r\n /**\r\n * Marks the end of the currently drawn shape.\r\n */\r\n endShape() { }\r\n\r\n /**\r\n * Adds a polygon with the current fill color to the SVG.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n this._path.addPolygon(points);\r\n }\r\n\r\n /**\r\n * Adds a circle with the current fill color to the SVG.\r\n * @param {Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n this._path.addCircle(point, diameter, counterClockwise);\r\n }\r\n\r\n /**\r\n * Called when the icon has been completely drawn.\r\n */\r\n finish() { \r\n const pathsByColor = this._pathsByColor;\r\n for (let color in pathsByColor) {\r\n // hasOwnProperty cannot be shadowed in pathsByColor\r\n // eslint-disable-next-line no-prototype-builtins\r\n if (pathsByColor.hasOwnProperty(color)) {\r\n this._target.appendPath(color, pathsByColor[color].dataString);\r\n }\r\n }\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nexport const SVG_CONSTANTS = {\r\n XMLNS: \"http://www.w3.org/2000/svg\",\r\n WIDTH: \"width\",\r\n HEIGHT: \"height\",\r\n}","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { SVG_CONSTANTS } from \"./constants\";\r\n\r\n/**\r\n * Renderer producing SVG output.\r\n */\r\nexport class SvgWriter {\r\n /**\r\n * @param {number} iconSize - Icon width and height in pixels.\r\n */\r\n constructor(iconSize) {\r\n /**\r\n * @type {number}\r\n */\r\n this.iconSize = iconSize;\r\n\r\n /**\r\n * @type {string}\r\n * @private\r\n */\r\n this._s =\r\n '';\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb.\r\n * @param {number} opacity Opacity in the range [0.0, 1.0].\r\n */\r\n setBackground(fillColor, opacity) {\r\n if (opacity) {\r\n this._s += '';\r\n }\r\n }\r\n\r\n /**\r\n * Writes a path to the SVG string.\r\n * @param {string} color Fill color on format #rrggbb.\r\n * @param {string} dataString The SVG path data string.\r\n */\r\n appendPath(color, dataString) {\r\n this._s += '';\r\n }\r\n\r\n /**\r\n * Gets the rendered image as an SVG string.\r\n */\r\n toString() {\r\n return this._s + \"\";\r\n }\r\n}\r\n","import { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { SvgRenderer } from \"../renderer/svg/svgRenderer\";\r\nimport { SvgWriter } from \"../renderer/svg/svgWriter\";\r\n\r\n/**\r\n * Draws an identicon as an SVG string.\r\n * @param {*} hashOrValue - A hexadecimal hash string or any value that will be hashed by Jdenticon.\r\n * @param {number} size - Icon size in pixels.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compatibility a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n * @returns {string} SVG string\r\n */\r\nexport function toSvg(hashOrValue, size, config) {\r\n const writer = new SvgWriter(size);\r\n iconGenerator(new SvgRenderer(writer), \r\n isValidHash(hashOrValue) || computeHash(hashOrValue),\r\n config);\r\n return writer.toString();\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n// This file is compiled to dist/jdenticon-node.mjs\r\n\r\nif (typeof process === \"undefined\" &&\r\n typeof window !== \"undefined\" &&\r\n typeof document !== \"undefined\"\r\n) {\r\n console.warn(\r\n \"Jdenticon: 'dist/jdenticon-node.mjs' is only intended for Node.js environments and will increase your \" +\r\n \"bundle size when included in browser bundles. If you want to run Jdenticon in the browser, please add a \" +\r\n \"reference to 'dist/jdenticon.js' or 'dist/jdenticon.min.js' instead.\");\r\n}\r\n\r\nexport { configure } from \"./apis/configure\";\r\nexport { drawIcon } from \"./apis/drawIcon\";\r\nexport { toPng } from \"./apis/toPng\";\r\nexport { toSvg } from \"./apis/toSvg\";\r\n\r\n/**\r\n * Specifies the version of the Jdenticon package in use.\r\n * @type {string}\r\n */\r\nexport const version = \"#version#\";\r\n\r\n/**\r\n * Specifies which bundle of Jdenticon that is used.\r\n * @type {string}\r\n */\r\nexport const bundle = \"node-esm\";\r\n\r\n/**\r\n * @throws {Error}\r\n */\r\nexport function update() {\r\n throw new Error(\"jdenticon.update() is not supported on Node.js.\");\r\n}\r\n\r\n/**\r\n * @throws {Error}\r\n */\r\nexport function updateCanvas() {\r\n throw new Error(\"jdenticon.updateCanvas() is not supported on Node.js.\");\r\n}\r\n\r\n/**\r\n * @throws {Error}\r\n */\r\nexport function updateSvg() {\r\n throw new Error(\"jdenticon.updateSvg() is not supported on Node.js.\");\r\n}\r\n","\n//# sourceMappingURL=jdenticon-node.mjs.map\n"]} \ No newline at end of file +{"version":3,"sources":["replacement/1","src/common/parseHex.js","src/renderer/color.js","src/common/global.js","src/common/configuration.js","src/renderer/point.js","src/renderer/transform.js","src/renderer/graphics.js","src/renderer/shapes.js","src/renderer/colorTheme.js","src/renderer/iconGenerator.js","src/common/sha1.js","src/common/hashUtils.js","src/renderer/canvas/canvasRenderer.js","src/apis/drawIcon.js","src/apis/toPng.js","src/renderer/svg/svgPath.js","src/renderer/svg/svgRenderer.js","src/renderer/svg/constants.js","src/renderer/svg/svgWriter.js","src/apis/toSvg.js","src/node-esm.js","replacement/2"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACtBA;AACA;AACA;AACA;AACA;AACO,SAAS,QAAQ,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE;AACtD,IAAI,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;AAC5D;;ACLA,SAAS,QAAQ,CAAC,CAAC,EAAE;AACrB,IAAI,CAAC,IAAI,CAAC,CAAC;AACX,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI;AACvB,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;AACrC,QAAQ,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;AAChC,QAAQ,IAAI,CAAC;AACb,CAAC;AACD;AACA,SAAS,QAAQ,CAAC,EAAE,EAAE,EAAE,E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,CAAC;AAC7E,CAAC;AACD;AACA;AACA;AACA;AACO,SAAS,SAAS,GAAG;AAC5B,IAAI,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;AAC1E;;;ACrDA","file":"jdenticon-node.mjs","sourcesContent":["/**\r\n * Jdenticon 3.1.1\r\n * http://jdenticon.com\r\n *\r\n * Built: 2021-08-14T17:50:52.207Z\r\n * \r\n * MIT License\r\n * \r\n * Copyright (c) 2014-2020 Daniel Mester Pirttijärvi\r\n * \r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n * \r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n * \r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n */\r\n\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Parses a substring of the hash as a number.\r\n * @param {number} startPosition \r\n * @param {number=} octets\r\n */\r\nexport function parseHex(hash, startPosition, octets) {\r\n return parseInt(hash.substr(startPosition, octets), 16);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { parseHex } from \"../common/parseHex\";\r\n\r\nfunction decToHex(v) {\r\n v |= 0; // Ensure integer value\r\n return v < 0 ? \"00\" :\r\n v < 16 ? \"0\" + v.toString(16) :\r\n v < 256 ? v.toString(16) :\r\n \"ff\";\r\n}\r\n\r\nfunction hueToRgb(m1, m2, h) {\r\n h = h < 0 ? h + 6 : h > 6 ? h - 6 : h;\r\n return decToHex(255 * (\r\n h < 1 ? m1 + (m2 - m1) * h :\r\n h < 3 ? m2 :\r\n h < 4 ? m1 + (m2 - m1) * (4 - h) :\r\n m1));\r\n}\r\n\r\n/**\r\n * @param {number} r Red channel [0, 255]\r\n * @param {number} g Green channel [0, 255]\r\n * @param {number} b Blue channel [0, 255]\r\n */\r\nexport function rgb(r, g, b) {\r\n return \"#\" + decToHex(r) + decToHex(g) + decToHex(b);\r\n}\r\n\r\n/**\r\n * @param {string} color Color value to parse. Currently hexadecimal strings on the format #rgb[a] and #rrggbb[aa] are supported.\r\n * @returns {string}\r\n */\r\nexport function parseColor(color) {\r\n if (/^#[0-9a-f]{3,8}$/i.test(color)) {\r\n let result;\r\n const colorLength = color.length;\r\n\r\n if (colorLength < 6) {\r\n const r = color[1],\r\n g = color[2],\r\n b = color[3],\r\n a = color[4] || \"\";\r\n result = \"#\" + r + r + g + g + b + b + a + a;\r\n }\r\n if (colorLength == 7 || colorLength > 8) {\r\n result = color;\r\n }\r\n \r\n return result;\r\n }\r\n}\r\n\r\n/**\r\n * Converts a hexadecimal color to a CSS3 compatible color.\r\n * @param {string} hexColor Color on the format \"#RRGGBB\" or \"#RRGGBBAA\"\r\n * @returns {string}\r\n */\r\nexport function toCss3Color(hexColor) {\r\n const a = parseHex(hexColor, 7, 2);\r\n let result;\r\n\r\n if (isNaN(a)) {\r\n result = hexColor;\r\n } else {\r\n const r = parseHex(hexColor, 1, 2),\r\n g = parseHex(hexColor, 3, 2),\r\n b = parseHex(hexColor, 5, 2);\r\n result = \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + (a / 255).toFixed(2) + \")\";\r\n }\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * Converts an HSL color to a hexadecimal RGB color.\r\n * @param {number} hue Hue in range [0, 1]\r\n * @param {number} saturation Saturation in range [0, 1]\r\n * @param {number} lightness Lightness in range [0, 1]\r\n * @returns {string}\r\n */\r\nexport function hsl(hue, saturation, lightness) {\r\n // Based on http://www.w3.org/TR/2011/REC-css3-color-20110607/#hsl-color\r\n let result;\r\n\r\n if (saturation == 0) {\r\n const partialHex = decToHex(lightness * 255);\r\n result = partialHex + partialHex + partialHex;\r\n }\r\n else {\r\n const m2 = lightness <= 0.5 ? lightness * (saturation + 1) : lightness + saturation - lightness * saturation,\r\n m1 = lightness * 2 - m2;\r\n result =\r\n hueToRgb(m1, m2, hue * 6 + 2) +\r\n hueToRgb(m1, m2, hue * 6) +\r\n hueToRgb(m1, m2, hue * 6 - 2);\r\n }\r\n\r\n return \"#\" + result;\r\n}\r\n\r\n/**\r\n * Converts an HSL color to a hexadecimal RGB color. This function will correct the lightness for the \"dark\" hues\r\n * @param {number} hue Hue in range [0, 1]\r\n * @param {number} saturation Saturation in range [0, 1]\r\n * @param {number} lightness Lightness in range [0, 1]\r\n * @returns {string}\r\n */\r\nexport function correctedHsl(hue, saturation, lightness) {\r\n // The corrector specifies the perceived middle lightness for each hue\r\n const correctors = [ 0.55, 0.5, 0.5, 0.46, 0.6, 0.55, 0.55 ],\r\n corrector = correctors[(hue * 6 + 0.5) | 0];\r\n \r\n // Adjust the input lightness relative to the corrector\r\n lightness = lightness < 0.5 ? lightness * corrector * 2 : corrector + (lightness - 0.5) * (1 - corrector) * 2;\r\n \r\n return hsl(hue, saturation, lightness);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n// In the future we can replace `GLOBAL` with `globalThis`, but for now use the old school global detection for\r\n// backward compatibility.\r\n\r\nexport const GLOBAL = \r\n typeof window !== \"undefined\" ? window :\r\n typeof self !== \"undefined\" ? self :\r\n typeof global !== \"undefined\" ? global :\r\n {};\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { parseColor } from \"../renderer/color\";\r\nimport { GLOBAL } from \"./global\";\r\n\r\n/**\r\n * @typedef {Object} ParsedConfiguration\r\n * @property {number} colorSaturation\r\n * @property {number} grayscaleSaturation\r\n * @property {string} backColor\r\n * @property {number} iconPadding\r\n * @property {function(number):number} hue\r\n * @property {function(number):number} colorLightness\r\n * @property {function(number):number} grayscaleLightness\r\n */\r\n\r\nexport const CONFIG_PROPERTIES = {\r\n GLOBAL: \"jdenticon_config\",\r\n MODULE: \"config\",\r\n};\r\n\r\nvar rootConfigurationHolder = {};\r\n\r\n/**\r\n * Defines the deprecated `config` property on the root Jdenticon object. When the property is set a warning is \r\n * printed in the console. To minimize bundle size, this is only used in Node bundles.\r\n * @param {!Object} rootObject \r\n */\r\nexport function defineConfigPropertyWithWarn(rootObject) {\r\n Object.defineProperty(rootObject, CONFIG_PROPERTIES.MODULE, {\r\n configurable: true,\r\n get: () => rootConfigurationHolder[CONFIG_PROPERTIES.MODULE],\r\n set: newConfiguration => {\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] = newConfiguration;\r\n console.warn(\"jdenticon.config is deprecated. Use jdenticon.configure() instead.\");\r\n },\r\n });\r\n}\r\n\r\n/**\r\n * Defines the deprecated `config` property on the root Jdenticon object without printing a warning in the console\r\n * when it is being used.\r\n * @param {!Object} rootObject \r\n */\r\nexport function defineConfigProperty(rootObject) {\r\n rootConfigurationHolder = rootObject;\r\n}\r\n\r\n/**\r\n * Sets a new icon style configuration. The new configuration is not merged with the previous one. * \r\n * @param {Object} newConfiguration - New configuration object.\r\n */\r\nexport function configure(newConfiguration) {\r\n if (arguments.length) {\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] = newConfiguration;\r\n }\r\n return rootConfigurationHolder[CONFIG_PROPERTIES.MODULE];\r\n}\r\n\r\n/**\r\n * Gets the normalized current Jdenticon color configuration. Missing fields have default values.\r\n * @param {Object|number|undefined} paddingOrLocalConfig - Configuration passed to the called API method. A\r\n * local configuration overrides the global configuration in it entirety. This parameter can for backward\r\n * compatibility also contain a padding value. A padding value only overrides the global padding, not the\r\n * entire global configuration.\r\n * @param {number} defaultPadding - Padding used if no padding is specified in neither the configuration nor\r\n * explicitly to the API method.\r\n * @returns {ParsedConfiguration}\r\n */\r\nexport function getConfiguration(paddingOrLocalConfig, defaultPadding) {\r\n const configObject = \r\n typeof paddingOrLocalConfig == \"object\" && paddingOrLocalConfig ||\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] ||\r\n GLOBAL[CONFIG_PROPERTIES.GLOBAL] ||\r\n { },\r\n\r\n lightnessConfig = configObject[\"lightness\"] || { },\r\n \r\n // In versions < 2.1.0 there was no grayscale saturation -\r\n // saturation was the color saturation.\r\n saturation = configObject[\"saturation\"] || { },\r\n colorSaturation = \"color\" in saturation ? saturation[\"color\"] : saturation,\r\n grayscaleSaturation = saturation[\"grayscale\"],\r\n\r\n backColor = configObject[\"backColor\"],\r\n padding = configObject[\"padding\"];\r\n \r\n /**\r\n * Creates a lightness range.\r\n */\r\n function lightness(configName, defaultRange) {\r\n let range = lightnessConfig[configName];\r\n \r\n // Check if the lightness range is an array-like object. This way we ensure the\r\n // array contain two values at the same time.\r\n if (!(range && range.length > 1)) {\r\n range = defaultRange;\r\n }\r\n\r\n /**\r\n * Gets a lightness relative the specified value in the specified lightness range.\r\n */\r\n return function (value) {\r\n value = range[0] + value * (range[1] - range[0]);\r\n return value < 0 ? 0 : value > 1 ? 1 : value;\r\n };\r\n }\r\n\r\n /**\r\n * Gets a hue allowed by the configured hue restriction,\r\n * provided the originally computed hue.\r\n */\r\n function hueFunction(originalHue) {\r\n const hueConfig = configObject[\"hues\"];\r\n let hue;\r\n \r\n // Check if 'hues' is an array-like object. This way we also ensure that\r\n // the array is not empty, which would mean no hue restriction.\r\n if (hueConfig && hueConfig.length > 0) {\r\n // originalHue is in the range [0, 1]\r\n // Multiply with 0.999 to change the range to [0, 1) and then truncate the index.\r\n hue = hueConfig[0 | (0.999 * originalHue * hueConfig.length)];\r\n }\r\n\r\n return typeof hue == \"number\" ?\r\n \r\n // A hue was specified. We need to convert the hue from\r\n // degrees on any turn - e.g. 746° is a perfectly valid hue -\r\n // to turns in the range [0, 1).\r\n ((((hue / 360) % 1) + 1) % 1) :\r\n\r\n // No hue configured => use original hue\r\n originalHue;\r\n }\r\n \r\n return {\r\n hue: hueFunction,\r\n colorSaturation: typeof colorSaturation == \"number\" ? colorSaturation : 0.5,\r\n grayscaleSaturation: typeof grayscaleSaturation == \"number\" ? grayscaleSaturation : 0,\r\n colorLightness: lightness(\"color\", [0.4, 0.8]),\r\n grayscaleLightness: lightness(\"grayscale\", [0.3, 0.9]),\r\n backColor: parseColor(backColor),\r\n iconPadding: \r\n typeof paddingOrLocalConfig == \"number\" ? paddingOrLocalConfig : \r\n typeof padding == \"number\" ? padding : \r\n defaultPadding\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Represents a point.\r\n */\r\nexport class Point {\r\n /**\r\n * @param {number} x \r\n * @param {number} y \r\n */\r\n constructor(x, y) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { Point } from \"./point\";\r\n\r\n/**\r\n * Translates and rotates a point before being passed on to the canvas context. This was previously done by the canvas context itself, \r\n * but this caused a rendering issue in Chrome on sizes > 256 where the rotation transformation of inverted paths was not done properly.\r\n */\r\nexport class Transform {\r\n /**\r\n * @param {number} x The x-coordinate of the upper left corner of the transformed rectangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the transformed rectangle.\r\n * @param {number} size The size of the transformed rectangle.\r\n * @param {number} rotation Rotation specified as 0 = 0 rad, 1 = 0.5π rad, 2 = π rad, 3 = 1.5π rad\r\n */\r\n constructor(x, y, size, rotation) {\r\n this._x = x;\r\n this._y = y;\r\n this._size = size;\r\n this._rotation = rotation;\r\n }\r\n\r\n /**\r\n * Transforms the specified point based on the translation and rotation specification for this Transform.\r\n * @param {number} x x-coordinate\r\n * @param {number} y y-coordinate\r\n * @param {number=} w The width of the transformed rectangle. If greater than 0, this will ensure the returned point is of the upper left corner of the transformed rectangle.\r\n * @param {number=} h The height of the transformed rectangle. If greater than 0, this will ensure the returned point is of the upper left corner of the transformed rectangle.\r\n */\r\n transformIconPoint(x, y, w, h) {\r\n const right = this._x + this._size,\r\n bottom = this._y + this._size,\r\n rotation = this._rotation;\r\n return rotation === 1 ? new Point(right - y - (h || 0), this._y + x) :\r\n rotation === 2 ? new Point(right - x - (w || 0), bottom - y - (h || 0)) :\r\n rotation === 3 ? new Point(this._x + y, bottom - x - (w || 0)) :\r\n new Point(this._x + x, this._y + y);\r\n }\r\n}\r\n\r\nexport const NO_TRANSFORM = new Transform(0, 0, 0, 0);\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { NO_TRANSFORM } from \"./transform\";\r\n\r\n/**\r\n * @typedef {import(\"./renderer\").Renderer} Renderer\r\n * @typedef {import(\"./transform\").Transform} Transform\r\n */\r\n\r\n/**\r\n * Provides helper functions for rendering common basic shapes.\r\n */\r\nexport class Graphics {\r\n /**\r\n * @param {Renderer} renderer \r\n */\r\n constructor(renderer) {\r\n /**\r\n * @type {Renderer}\r\n * @private\r\n */\r\n this._renderer = renderer;\r\n\r\n /**\r\n * @type {Transform}\r\n */\r\n this.currentTransform = NO_TRANSFORM;\r\n }\r\n\r\n /**\r\n * Adds a polygon to the underlying renderer.\r\n * @param {Array} points The points of the polygon clockwise on the format [ x0, y0, x1, y1, ..., xn, yn ]\r\n * @param {boolean=} invert Specifies if the polygon will be inverted.\r\n */\r\n addPolygon(points, invert) {\r\n const di = invert ? -2 : 2,\r\n transformedPoints = [];\r\n \r\n for (let i = invert ? points.length - 2 : 0; i < points.length && i >= 0; i += di) {\r\n transformedPoints.push(this.currentTransform.transformIconPoint(points[i], points[i + 1]));\r\n }\r\n \r\n this._renderer.addPolygon(transformedPoints);\r\n }\r\n \r\n /**\r\n * Adds a polygon to the underlying renderer.\r\n * Source: http://stackoverflow.com/a/2173084\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the entire ellipse.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the entire ellipse.\r\n * @param {number} size The size of the ellipse.\r\n * @param {boolean=} invert Specifies if the ellipse will be inverted.\r\n */\r\n addCircle(x, y, size, invert) {\r\n const p = this.currentTransform.transformIconPoint(x, y, size, size);\r\n this._renderer.addCircle(p, size, invert);\r\n }\r\n\r\n /**\r\n * Adds a rectangle to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle.\r\n * @param {number} w The width of the rectangle.\r\n * @param {number} h The height of the rectangle.\r\n * @param {boolean=} invert Specifies if the rectangle will be inverted.\r\n */\r\n addRectangle(x, y, w, h, invert) {\r\n this.addPolygon([\r\n x, y, \r\n x + w, y,\r\n x + w, y + h,\r\n x, y + h\r\n ], invert);\r\n }\r\n\r\n /**\r\n * Adds a right triangle to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the triangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the triangle.\r\n * @param {number} w The width of the triangle.\r\n * @param {number} h The height of the triangle.\r\n * @param {number} r The rotation of the triangle (clockwise). 0 = right corner of the triangle in the lower left corner of the bounding rectangle.\r\n * @param {boolean=} invert Specifies if the triangle will be inverted.\r\n */\r\n addTriangle(x, y, w, h, r, invert) {\r\n const points = [\r\n x + w, y, \r\n x + w, y + h, \r\n x, y + h,\r\n x, y\r\n ];\r\n points.splice(((r || 0) % 4) * 2, 2);\r\n this.addPolygon(points, invert);\r\n }\r\n\r\n /**\r\n * Adds a rhombus to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the rhombus.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the rhombus.\r\n * @param {number} w The width of the rhombus.\r\n * @param {number} h The height of the rhombus.\r\n * @param {boolean=} invert Specifies if the rhombus will be inverted.\r\n */\r\n addRhombus(x, y, w, h, invert) {\r\n this.addPolygon([\r\n x + w / 2, y,\r\n x + w, y + h / 2,\r\n x + w / 2, y + h,\r\n x, y + h / 2\r\n ], invert);\r\n }\r\n}","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * @param {number} index\r\n * @param {Graphics} g\r\n * @param {number} cell\r\n * @param {number} positionIndex\r\n * @typedef {import('./graphics').Graphics} Graphics\r\n */\r\nexport function centerShape(index, g, cell, positionIndex) {\r\n index = index % 14;\r\n\r\n let k, m, w, h, inner, outer;\r\n\r\n !index ? (\r\n k = cell * 0.42,\r\n g.addPolygon([\r\n 0, 0,\r\n cell, 0,\r\n cell, cell - k * 2,\r\n cell - k, cell,\r\n 0, cell\r\n ])) :\r\n\r\n index == 1 ? (\r\n w = 0 | (cell * 0.5), \r\n h = 0 | (cell * 0.8),\r\n\r\n g.addTriangle(cell - w, 0, w, h, 2)) :\r\n\r\n index == 2 ? (\r\n w = 0 | (cell / 3),\r\n g.addRectangle(w, w, cell - w, cell - w)) :\r\n\r\n index == 3 ? (\r\n inner = cell * 0.1,\r\n // Use fixed outer border widths in small icons to ensure the border is drawn\r\n outer = \r\n cell < 6 ? 1 :\r\n cell < 8 ? 2 :\r\n (0 | (cell * 0.25)),\r\n \r\n inner = \r\n inner > 1 ? (0 | inner) : // large icon => truncate decimals\r\n inner > 0.5 ? 1 : // medium size icon => fixed width\r\n inner, // small icon => anti-aliased border\r\n\r\n g.addRectangle(outer, outer, cell - inner - outer, cell - inner - outer)) :\r\n\r\n index == 4 ? (\r\n m = 0 | (cell * 0.15),\r\n w = 0 | (cell * 0.5),\r\n g.addCircle(cell - w - m, cell - w - m, w)) :\r\n\r\n index == 5 ? (\r\n inner = cell * 0.1,\r\n outer = inner * 4,\r\n\r\n // Align edge to nearest pixel in large icons\r\n outer > 3 && (outer = 0 | outer),\r\n \r\n g.addRectangle(0, 0, cell, cell),\r\n g.addPolygon([\r\n outer, outer,\r\n cell - inner, outer,\r\n outer + (cell - outer - inner) / 2, cell - inner\r\n ], true)) :\r\n\r\n index == 6 ? \r\n g.addPolygon([\r\n 0, 0,\r\n cell, 0,\r\n cell, cell * 0.7,\r\n cell * 0.4, cell * 0.4,\r\n cell * 0.7, cell,\r\n 0, cell\r\n ]) :\r\n\r\n index == 7 ? \r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 3) :\r\n\r\n index == 8 ? (\r\n g.addRectangle(0, 0, cell, cell / 2),\r\n g.addRectangle(0, cell / 2, cell / 2, cell / 2),\r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 1)) :\r\n\r\n index == 9 ? (\r\n inner = cell * 0.14,\r\n // Use fixed outer border widths in small icons to ensure the border is drawn\r\n outer = \r\n cell < 4 ? 1 :\r\n cell < 6 ? 2 :\r\n (0 | (cell * 0.35)),\r\n\r\n inner = \r\n cell < 8 ? inner : // small icon => anti-aliased border\r\n (0 | inner), // large icon => truncate decimals\r\n\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addRectangle(outer, outer, cell - outer - inner, cell - outer - inner, true)) :\r\n\r\n index == 10 ? (\r\n inner = cell * 0.12,\r\n outer = inner * 3,\r\n\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addCircle(outer, outer, cell - inner - outer, true)) :\r\n\r\n index == 11 ? \r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 3) :\r\n\r\n index == 12 ? (\r\n m = cell * 0.25,\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addRhombus(m, m, cell - m, cell - m, true)) :\r\n\r\n // 13\r\n (\r\n !positionIndex && (\r\n m = cell * 0.4, w = cell * 1.2,\r\n g.addCircle(m, m, w)\r\n )\r\n );\r\n}\r\n\r\n/**\r\n * @param {number} index\r\n * @param {Graphics} g\r\n * @param {number} cell\r\n */\r\nexport function outerShape(index, g, cell) {\r\n index = index % 4;\r\n\r\n let m;\r\n\r\n !index ?\r\n g.addTriangle(0, 0, cell, cell, 0) :\r\n \r\n index == 1 ?\r\n g.addTriangle(0, cell / 2, cell, cell / 2, 0) :\r\n\r\n index == 2 ?\r\n g.addRhombus(0, 0, cell, cell) :\r\n\r\n // 3\r\n (\r\n m = cell / 6,\r\n g.addCircle(m, m, cell - 2 * m)\r\n );\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { correctedHsl } from \"./color\";\r\n\r\n/**\r\n * Gets a set of identicon color candidates for a specified hue and config.\r\n * @param {number} hue\r\n * @param {import(\"../common/configuration\").ParsedConfiguration} config\r\n */\r\nexport function colorTheme(hue, config) {\r\n hue = config.hue(hue);\r\n return [\r\n // Dark gray\r\n correctedHsl(hue, config.grayscaleSaturation, config.grayscaleLightness(0)),\r\n // Mid color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(0.5)),\r\n // Light gray\r\n correctedHsl(hue, config.grayscaleSaturation, config.grayscaleLightness(1)),\r\n // Light color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(1)),\r\n // Dark color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(0))\r\n ];\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { Transform } from \"./transform\";\r\nimport { Graphics } from \"./graphics\";\r\nimport { centerShape, outerShape } from \"./shapes\";\r\nimport { colorTheme } from \"./colorTheme\";\r\nimport { parseHex } from \"../common/parseHex\";\r\nimport { getConfiguration } from \"../common/configuration\";\r\n \r\n/**\r\n * Draws an identicon to a specified renderer.\r\n * @param {import('./renderer').Renderer} renderer\r\n * @param {string} hash\r\n * @param {Object|number=} config\r\n */\r\nexport function iconGenerator(renderer, hash, config) {\r\n const parsedConfig = getConfiguration(config, 0.08);\r\n\r\n // Set background color\r\n if (parsedConfig.backColor) {\r\n renderer.setBackground(parsedConfig.backColor);\r\n }\r\n \r\n // Calculate padding and round to nearest integer\r\n let size = renderer.iconSize;\r\n const padding = (0.5 + size * parsedConfig.iconPadding) | 0;\r\n size -= padding * 2;\r\n \r\n const graphics = new Graphics(renderer);\r\n \r\n // Calculate cell size and ensure it is an integer\r\n const cell = 0 | (size / 4);\r\n \r\n // Since the cell size is integer based, the actual icon will be slightly smaller than specified => center icon\r\n const x = 0 | (padding + size / 2 - cell * 2);\r\n const y = 0 | (padding + size / 2 - cell * 2);\r\n\r\n function renderShape(colorIndex, shapes, index, rotationIndex, positions) {\r\n const shapeIndex = parseHex(hash, index, 1);\r\n let r = rotationIndex ? parseHex(hash, rotationIndex, 1) : 0;\r\n \r\n renderer.beginShape(availableColors[selectedColorIndexes[colorIndex]]);\r\n \r\n for (let i = 0; i < positions.length; i++) {\r\n graphics.currentTransform = new Transform(x + positions[i][0] * cell, y + positions[i][1] * cell, cell, r++ % 4);\r\n shapes(shapeIndex, graphics, cell, i);\r\n }\r\n \r\n renderer.endShape();\r\n }\r\n\r\n // AVAILABLE COLORS\r\n const hue = parseHex(hash, -7) / 0xfffffff,\r\n \r\n // Available colors for this icon\r\n availableColors = colorTheme(hue, parsedConfig),\r\n\r\n // The index of the selected colors\r\n selectedColorIndexes = [];\r\n\r\n let index;\r\n\r\n function isDuplicate(values) {\r\n if (values.indexOf(index) >= 0) {\r\n for (let i = 0; i < values.length; i++) {\r\n if (selectedColorIndexes.indexOf(values[i]) >= 0) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n for (let i = 0; i < 3; i++) {\r\n index = parseHex(hash, 8 + i, 1) % availableColors.length;\r\n if (isDuplicate([0, 4]) || // Disallow dark gray and dark color combo\r\n isDuplicate([2, 3])) { // Disallow light gray and light color combo\r\n index = 1;\r\n }\r\n selectedColorIndexes.push(index);\r\n }\r\n\r\n // ACTUAL RENDERING\r\n // Sides\r\n renderShape(0, outerShape, 2, 3, [[1, 0], [2, 0], [2, 3], [1, 3], [0, 1], [3, 1], [3, 2], [0, 2]]);\r\n // Corners\r\n renderShape(1, outerShape, 4, 5, [[0, 0], [3, 0], [3, 3], [0, 3]]);\r\n // Center\r\n renderShape(2, centerShape, 1, null, [[1, 1], [2, 1], [2, 2], [1, 2]]);\r\n \r\n renderer.finish();\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Computes a SHA1 hash for any value and returns it as a hexadecimal string.\r\n * \r\n * This function is optimized for minimal code size and rather short messages.\r\n * \r\n * @param {string} message \r\n */\r\nexport function sha1(message) {\r\n const HASH_SIZE_HALF_BYTES = 40;\r\n const BLOCK_SIZE_WORDS = 16;\r\n\r\n // Variables\r\n // `var` is used to be able to minimize the number of `var` keywords.\r\n var i = 0,\r\n f = 0,\r\n \r\n // Use `encodeURI` to UTF8 encode the message without any additional libraries\r\n // We could use `unescape` + `encodeURI` to minimize the code, but that would be slightly risky\r\n // since `unescape` is deprecated.\r\n urlEncodedMessage = encodeURI(message) + \"%80\", // trailing '1' bit padding\r\n \r\n // This can be changed to a preallocated Uint32Array array for greater performance and larger code size\r\n data = [],\r\n dataSize,\r\n \r\n hashBuffer = [],\r\n\r\n a = 0x67452301,\r\n b = 0xefcdab89,\r\n c = ~a,\r\n d = ~b,\r\n e = 0xc3d2e1f0,\r\n hash = [a, b, c, d, e],\r\n\r\n blockStartIndex = 0,\r\n hexHash = \"\";\r\n\r\n /**\r\n * Rotates the value a specified number of bits to the left.\r\n * @param {number} value Value to rotate\r\n * @param {number} shift Bit count to shift.\r\n */\r\n function rotl(value, shift) {\r\n return (value << shift) | (value >>> (32 - shift));\r\n }\r\n\r\n // Message data\r\n for ( ; i < urlEncodedMessage.length; f++) {\r\n data[f >> 2] = data[f >> 2] |\r\n (\r\n (\r\n urlEncodedMessage[i] == \"%\"\r\n // Percent encoded byte\r\n ? parseInt(urlEncodedMessage.substring(i + 1, i += 3), 16)\r\n // Unencoded byte\r\n : urlEncodedMessage.charCodeAt(i++)\r\n )\r\n\r\n // Read bytes in reverse order (big endian words)\r\n << ((3 - (f & 3)) * 8)\r\n );\r\n }\r\n\r\n // f is now the length of the utf8 encoded message\r\n // 7 = 8 bytes (64 bit) for message size, -1 to round down\r\n // >> 6 = integer division with block size\r\n dataSize = (((f + 7) >> 6) + 1) * BLOCK_SIZE_WORDS;\r\n\r\n // Message size in bits.\r\n // SHA1 uses a 64 bit integer to represent the size, but since we only support short messages only the least\r\n // significant 32 bits are set. -8 is for the '1' bit padding byte.\r\n data[dataSize - 1] = f * 8 - 8;\r\n \r\n // Compute hash\r\n for ( ; blockStartIndex < dataSize; blockStartIndex += BLOCK_SIZE_WORDS) {\r\n for (i = 0; i < 80; i++) {\r\n f = rotl(a, 5) + e + (\r\n // Ch\r\n i < 20 ? ((b & c) ^ ((~b) & d)) + 0x5a827999 :\r\n \r\n // Parity\r\n i < 40 ? (b ^ c ^ d) + 0x6ed9eba1 :\r\n \r\n // Maj\r\n i < 60 ? ((b & c) ^ (b & d) ^ (c & d)) + 0x8f1bbcdc :\r\n \r\n // Parity\r\n (b ^ c ^ d) + 0xca62c1d6\r\n ) + ( \r\n hashBuffer[i] = i < BLOCK_SIZE_WORDS\r\n // Bitwise OR is used to coerse `undefined` to 0\r\n ? (data[blockStartIndex + i] | 0)\r\n : rotl(hashBuffer[i - 3] ^ hashBuffer[i - 8] ^ hashBuffer[i - 14] ^ hashBuffer[i - 16], 1)\r\n );\r\n\r\n e = d;\r\n d = c;\r\n c = rotl(b, 30);\r\n b = a;\r\n a = f;\r\n }\r\n\r\n hash[0] = a = ((hash[0] + a) | 0);\r\n hash[1] = b = ((hash[1] + b) | 0);\r\n hash[2] = c = ((hash[2] + c) | 0);\r\n hash[3] = d = ((hash[3] + d) | 0);\r\n hash[4] = e = ((hash[4] + e) | 0);\r\n }\r\n\r\n // Format hex hash\r\n for (i = 0; i < HASH_SIZE_HALF_BYTES; i++) {\r\n hexHash += (\r\n (\r\n // Get word (2^3 half-bytes per word)\r\n hash[i >> 3] >>>\r\n\r\n // Append half-bytes in reverse order\r\n ((7 - (i & 7)) * 4)\r\n ) \r\n // Clamp to half-byte\r\n & 0xf\r\n ).toString(16);\r\n }\r\n\r\n return hexHash;\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { sha1 } from \"./sha1\";\r\n\r\n/**\r\n * Inputs a value that might be a valid hash string for Jdenticon and returns it \r\n * if it is determined valid, otherwise a falsy value is returned.\r\n */\r\nexport function isValidHash(hashCandidate) {\r\n return /^[0-9a-f]{11,}$/i.test(hashCandidate) && hashCandidate;\r\n}\r\n\r\n/**\r\n * Computes a hash for the specified value. Currently SHA1 is used. This function\r\n * always returns a valid hash.\r\n */\r\nexport function computeHash(value) {\r\n return sha1(value == null ? \"\" : \"\" + value);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { toCss3Color } from \"../color\";\r\n\r\n/**\r\n * @typedef {import(\"../renderer\").Renderer} Renderer\r\n * @typedef {import('../point').Point} Point\r\n */\r\n\r\n/**\r\n * Renderer redirecting drawing commands to a canvas context.\r\n * @implements {Renderer}\r\n */\r\nexport class CanvasRenderer {\r\n /**\r\n * @param {number=} iconSize\r\n */\r\n constructor(ctx, iconSize) {\r\n const canvas = ctx.canvas; \r\n const width = canvas.width;\r\n const height = canvas.height;\r\n \r\n ctx.save();\r\n \r\n if (!iconSize) {\r\n iconSize = Math.min(width, height);\r\n \r\n ctx.translate(\r\n ((width - iconSize) / 2) | 0,\r\n ((height - iconSize) / 2) | 0);\r\n }\r\n\r\n /**\r\n * @private\r\n */\r\n this._ctx = ctx;\r\n this.iconSize = iconSize;\r\n \r\n ctx.clearRect(0, 0, iconSize, iconSize);\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb[aa].\r\n */\r\n setBackground(fillColor) {\r\n const ctx = this._ctx;\r\n const iconSize = this.iconSize;\r\n\r\n ctx.fillStyle = toCss3Color(fillColor);\r\n ctx.fillRect(0, 0, iconSize, iconSize);\r\n }\r\n\r\n /**\r\n * Marks the beginning of a new shape of the specified color. Should be ended with a call to endShape.\r\n * @param {string} fillColor Fill color on format #rrggbb[aa].\r\n */\r\n beginShape(fillColor) {\r\n const ctx = this._ctx;\r\n ctx.fillStyle = toCss3Color(fillColor);\r\n ctx.beginPath();\r\n }\r\n\r\n /**\r\n * Marks the end of the currently drawn shape. This causes the queued paths to be rendered on the canvas.\r\n */\r\n endShape() {\r\n this._ctx.fill();\r\n }\r\n\r\n /**\r\n * Adds a polygon to the rendering queue.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n const ctx = this._ctx;\r\n ctx.moveTo(points[0].x, points[0].y);\r\n for (let i = 1; i < points.length; i++) {\r\n ctx.lineTo(points[i].x, points[i].y);\r\n }\r\n ctx.closePath();\r\n }\r\n\r\n /**\r\n * Adds a circle to the rendering queue.\r\n * @param {Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n const ctx = this._ctx,\r\n radius = diameter / 2;\r\n ctx.moveTo(point.x + radius, point.y + radius);\r\n ctx.arc(point.x + radius, point.y + radius, radius, 0, Math.PI * 2, counterClockwise);\r\n ctx.closePath();\r\n }\r\n\r\n /**\r\n * Called when the icon has been completely drawn.\r\n */\r\n finish() {\r\n this._ctx.restore();\r\n }\r\n}\r\n","import { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { CanvasRenderer } from \"../renderer/canvas/canvasRenderer\";\r\n\r\n/**\r\n * Draws an identicon to a context.\r\n * @param {CanvasRenderingContext2D} ctx - Canvas context on which the icon will be drawn at location (0, 0).\r\n * @param {*} hashOrValue - A hexadecimal hash string or any value that will be hashed by Jdenticon.\r\n * @param {number} size - Icon size in pixels.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compatibility a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function drawIcon(ctx, hashOrValue, size, config) {\r\n if (!ctx) {\r\n throw new Error(\"No canvas specified.\");\r\n }\r\n \r\n iconGenerator(new CanvasRenderer(ctx, size), \r\n isValidHash(hashOrValue) || computeHash(hashOrValue), \r\n config);\r\n}\r\n","import canvasRenderer from \"canvas-renderer\";\r\nimport { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { CanvasRenderer } from \"../renderer/canvas/canvasRenderer\";\r\n\r\n/**\r\n * Draws an identicon as PNG.\r\n * @param {*} hashOrValue - A hexadecimal hash string or any value that will be hashed by Jdenticon.\r\n * @param {number} size - Icon size in pixels.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compatibility a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n * @returns {Buffer} PNG data\r\n */\r\nexport function toPng(hashOrValue, size, config) {\r\n const canvas = canvasRenderer.createCanvas(size, size);\r\n const ctx = canvas.getContext(\"2d\");\r\n \r\n iconGenerator(new CanvasRenderer(ctx, size), \r\n isValidHash(hashOrValue) || computeHash(hashOrValue), \r\n config);\r\n \r\n return canvas.toPng({ \"Software\": \"Jdenticon\" });\r\n}","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Prepares a measure to be used as a measure in an SVG path, by\r\n * rounding the measure to a single decimal. This reduces the file\r\n * size of the generated SVG with more than 50% in some cases.\r\n */\r\nfunction svgValue(value) {\r\n return ((value * 10 + 0.5) | 0) / 10;\r\n}\r\n\r\n/**\r\n * Represents an SVG path element.\r\n */\r\nexport class SvgPath {\r\n constructor() {\r\n /**\r\n * This property holds the data string (path.d) of the SVG path.\r\n * @type {string}\r\n */\r\n this.dataString = \"\";\r\n }\r\n\r\n /**\r\n * Adds a polygon with the current fill color to the SVG path.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n let dataString = \"\";\r\n for (let i = 0; i < points.length; i++) {\r\n dataString += (i ? \"L\" : \"M\") + svgValue(points[i].x) + \" \" + svgValue(points[i].y);\r\n }\r\n this.dataString += dataString + \"Z\";\r\n }\r\n\r\n /**\r\n * Adds a circle with the current fill color to the SVG path.\r\n * @param {import('../point').Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n const sweepFlag = counterClockwise ? 0 : 1,\r\n svgRadius = svgValue(diameter / 2),\r\n svgDiameter = svgValue(diameter),\r\n svgArc = \"a\" + svgRadius + \",\" + svgRadius + \" 0 1,\" + sweepFlag + \" \";\r\n \r\n this.dataString += \r\n \"M\" + svgValue(point.x) + \" \" + svgValue(point.y + diameter / 2) +\r\n svgArc + svgDiameter + \",0\" + \r\n svgArc + (-svgDiameter) + \",0\";\r\n }\r\n}\r\n\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { SvgPath } from \"./svgPath\";\r\nimport { parseHex } from \"../../common/parseHex\";\r\n\r\n/**\r\n * @typedef {import(\"../point\").Point} Point\r\n * @typedef {import(\"../renderer\").Renderer} Renderer\r\n * @typedef {import(\"./svgElement\").SvgElement} SvgElement\r\n * @typedef {import(\"./svgWriter\").SvgWriter} SvgWriter\r\n */\r\n\r\n/**\r\n * Renderer producing SVG output.\r\n * @implements {Renderer}\r\n */\r\nexport class SvgRenderer {\r\n /**\r\n * @param {SvgElement|SvgWriter} target \r\n */\r\n constructor(target) {\r\n /**\r\n * @type {SvgPath}\r\n * @private\r\n */\r\n this._path;\r\n\r\n /**\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._pathsByColor = { };\r\n\r\n /**\r\n * @type {SvgElement|SvgWriter}\r\n * @private\r\n */\r\n this._target = target;\r\n\r\n /**\r\n * @type {number}\r\n */\r\n this.iconSize = target.iconSize;\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb[aa].\r\n */\r\n setBackground(fillColor) {\r\n const match = /^(#......)(..)?/.exec(fillColor),\r\n opacity = match[2] ? parseHex(match[2], 0) / 255 : 1;\r\n this._target.setBackground(match[1], opacity);\r\n }\r\n\r\n /**\r\n * Marks the beginning of a new shape of the specified color. Should be ended with a call to endShape.\r\n * @param {string} color Fill color on format #xxxxxx.\r\n */\r\n beginShape(color) {\r\n this._path = this._pathsByColor[color] || (this._pathsByColor[color] = new SvgPath());\r\n }\r\n\r\n /**\r\n * Marks the end of the currently drawn shape.\r\n */\r\n endShape() { }\r\n\r\n /**\r\n * Adds a polygon with the current fill color to the SVG.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n this._path.addPolygon(points);\r\n }\r\n\r\n /**\r\n * Adds a circle with the current fill color to the SVG.\r\n * @param {Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n this._path.addCircle(point, diameter, counterClockwise);\r\n }\r\n\r\n /**\r\n * Called when the icon has been completely drawn.\r\n */\r\n finish() { \r\n const pathsByColor = this._pathsByColor;\r\n for (let color in pathsByColor) {\r\n // hasOwnProperty cannot be shadowed in pathsByColor\r\n // eslint-disable-next-line no-prototype-builtins\r\n if (pathsByColor.hasOwnProperty(color)) {\r\n this._target.appendPath(color, pathsByColor[color].dataString);\r\n }\r\n }\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nexport const SVG_CONSTANTS = {\r\n XMLNS: \"http://www.w3.org/2000/svg\",\r\n WIDTH: \"width\",\r\n HEIGHT: \"height\",\r\n}","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { SVG_CONSTANTS } from \"./constants\";\r\n\r\n/**\r\n * Renderer producing SVG output.\r\n */\r\nexport class SvgWriter {\r\n /**\r\n * @param {number} iconSize - Icon width and height in pixels.\r\n */\r\n constructor(iconSize) {\r\n /**\r\n * @type {number}\r\n */\r\n this.iconSize = iconSize;\r\n\r\n /**\r\n * @type {string}\r\n * @private\r\n */\r\n this._s =\r\n '';\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb.\r\n * @param {number} opacity Opacity in the range [0.0, 1.0].\r\n */\r\n setBackground(fillColor, opacity) {\r\n if (opacity) {\r\n this._s += '';\r\n }\r\n }\r\n\r\n /**\r\n * Writes a path to the SVG string.\r\n * @param {string} color Fill color on format #rrggbb.\r\n * @param {string} dataString The SVG path data string.\r\n */\r\n appendPath(color, dataString) {\r\n this._s += '';\r\n }\r\n\r\n /**\r\n * Gets the rendered image as an SVG string.\r\n */\r\n toString() {\r\n return this._s + \"\";\r\n }\r\n}\r\n","import { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { SvgRenderer } from \"../renderer/svg/svgRenderer\";\r\nimport { SvgWriter } from \"../renderer/svg/svgWriter\";\r\n\r\n/**\r\n * Draws an identicon as an SVG string.\r\n * @param {*} hashOrValue - A hexadecimal hash string or any value that will be hashed by Jdenticon.\r\n * @param {number} size - Icon size in pixels.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compatibility a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n * @returns {string} SVG string\r\n */\r\nexport function toSvg(hashOrValue, size, config) {\r\n const writer = new SvgWriter(size);\r\n iconGenerator(new SvgRenderer(writer), \r\n isValidHash(hashOrValue) || computeHash(hashOrValue),\r\n config);\r\n return writer.toString();\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n// This file is compiled to dist/jdenticon-node.mjs\r\n\r\nif (typeof process === \"undefined\" &&\r\n typeof window !== \"undefined\" &&\r\n typeof document !== \"undefined\"\r\n) {\r\n console.warn(\r\n \"Jdenticon: 'dist/jdenticon-node.mjs' is only intended for Node.js environments and will increase your \" +\r\n \"bundle size when included in browser bundles. If you want to run Jdenticon in the browser, please add a \" +\r\n \"reference to 'dist/jdenticon.js' or 'dist/jdenticon.min.js' instead.\");\r\n}\r\n\r\nexport { configure } from \"./apis/configure\";\r\nexport { drawIcon } from \"./apis/drawIcon\";\r\nexport { toPng } from \"./apis/toPng\";\r\nexport { toSvg } from \"./apis/toSvg\";\r\n\r\n/**\r\n * Specifies the version of the Jdenticon package in use.\r\n * @type {string}\r\n */\r\nexport const version = \"#version#\";\r\n\r\n/**\r\n * Specifies which bundle of Jdenticon that is used.\r\n * @type {string}\r\n */\r\nexport const bundle = \"node-esm\";\r\n\r\n/**\r\n * @throws {Error}\r\n */\r\nexport function update() {\r\n throw new Error(\"jdenticon.update() is not supported on Node.js.\");\r\n}\r\n\r\n/**\r\n * @throws {Error}\r\n */\r\nexport function updateCanvas() {\r\n throw new Error(\"jdenticon.updateCanvas() is not supported on Node.js.\");\r\n}\r\n\r\n/**\r\n * @throws {Error}\r\n */\r\nexport function updateSvg() {\r\n throw new Error(\"jdenticon.updateSvg() is not supported on Node.js.\");\r\n}\r\n","\n//# sourceMappingURL=jdenticon-node.mjs.map\n"]} \ No newline at end of file diff --git a/dist/jdenticon.js b/dist/jdenticon.js index c58eb36..1300bc6 100644 --- a/dist/jdenticon.js +++ b/dist/jdenticon.js @@ -1,8 +1,8 @@ /** - * Jdenticon 3.1.0 + * Jdenticon 3.1.1 * http://jdenticon.com * - * Built: 2020-12-12T13:51:48.709Z + * Built: 2021-08-14T17:50:52.207Z * * MIT License * @@ -1419,7 +1419,7 @@ jdenticon["updateSvg"] = update; * Specifies the version of the Jdenticon package in use. * @type {string} */ -jdenticon["version"] = "3.1.0"; +jdenticon["version"] = "3.1.1"; /** * Specifies which bundle of Jdenticon that is used. diff --git a/dist/jdenticon.min.js b/dist/jdenticon.min.js index 232ff98..c7500f1 100644 --- a/dist/jdenticon.min.js +++ b/dist/jdenticon.min.js @@ -1,3 +1,3 @@ -// Jdenticon 3.1.0 | jdenticon.com | MIT licensed | (c) 2014-2020 Daniel Mester Pirttijärvi -!function(t,n){var i=function(t){"use strict";function n(t,n,i){return parseInt(t.substr(n,i),16)}function i(t){return(t|=0)<0?"00":t<16?"0"+t.toString(16):t<256?t.toString(16):"ff"}function e(t,n,e){return i(255*((e=e<0?e+6:e>6?e-6:e)<1?t+(n-t)*e:e<3?n:e<4?t+(n-t)*(4-e):t))}function r(t){if(/^#[0-9a-f]{3,8}$/i.test(t)){var n,i=t.length;if(i<6){var e=t[1],r=t[2],o=t[3],u=t[4]||"";n="#"+e+e+r+r+o+o+u+u}return(7==i||i>8)&&(n=t),n}}function o(t){var i,e=n(t,7,2);isNaN(e)?i=t:i="rgba("+n(t,1,2)+","+n(t,3,2)+","+n(t,5,2)+","+(e/255).toFixed(2)+")";return i}function u(t,n,r){var o;if(0==n){var u=i(255*r);o=u+u+u}else{var f=r<=.5?r*(n+1):r+n-r*n,h=2*r-f;o=e(h,f,6*t+2)+e(h,f,6*t)+e(h,f,6*t-2)}return"#"+o}function f(t,n,i){var e=[.55,.5,.5,.46,.6,.55,.55][6*t+.5|0];return u(t,n,i=i<.5?i*e*2:e+(i-.5)*(1-e)*2)}var h=t,s={G:"jdenticon_config",n:"config"},a={};function c(t){a=t}function v(t){return arguments.length&&(a[s.n]=t),a[s.n]}function l(t,n){var i="object"==typeof t&&t||a[s.n]||h[s.G]||{},e=i.lightness||{},o=i.saturation||{},u="color"in o?o.color:o,f=o.grayscale,c=i.backColor,v=i.padding;function l(t,n){var i=e[t];return i&&i.length>1||(i=n),function(t){return(t=i[0]+t*(i[1]-i[0]))<0?0:t>1?1:t}}function g(t){var n,e=i.hues;return e&&e.length>0&&(n=e[0|.999*t*e.length]),"number"==typeof n?(n/360%1+1)%1:t}return{X:g,p:"number"==typeof u?u:.5,H:"number"==typeof f?f:0,q:l("color",[.4,.8]),I:l("grayscale",[.3,.9]),J:r(c),Y:"number"==typeof t?t:"number"==typeof v?v:n}}var g=1,d=2,p={t:"data-jdenticon-hash",o:"data-jdenticon-value"},y="["+p.t+"],["+p.o+"]",m="undefined"!=typeof document&&document.querySelectorAll.bind(document);function b(t){if(t){var n=t.tagName;if(/^svg$/i.test(n))return g;if(/^canvas$/i.test(n)&&"getContext"in t)return d}}function w(t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(n){for(var i=0;i1?0|h:h>.5?1:h,n.i(s,s,i-h-s,i-h-s)):4==t?(o=0|.15*i,u=0|.5*i,n.h(i-u-o,i-u-o,u)):5==t?((s=4*(h=.1*i))>3&&(s|=0),n.i(0,0,i,i),n.g([s,s,i-h,s,s+(i-s-h)/2,i-h],!0)):6==t?n.g([0,0,i,0,i,.7*i,.4*i,.4*i,.7*i,i,0,i]):7==t?n.j(i/2,i/2,i/2,i/2,3):8==t?(n.i(0,0,i,i/2),n.i(0,i/2,i/2,i/2),n.j(i/2,i/2,i/2,i/2,1)):9==t?(h=.14*i,s=i<4?1:i<6?2:0|.35*i,h=i<8?h:0|h,n.i(0,0,i,i),n.i(s,s,i-s-h,i-s-h,!0)):10==t?(s=3*(h=.12*i),n.i(0,0,i,i),n.h(s,s,i-h-s,!0)):11==t?n.j(i/2,i/2,i/2,i/2,3):12==t?(o=.25*i,n.i(0,0,i,i),n.N(o,o,i-o,i-o,!0)):!e&&(o=.4*i,u=1.2*i,n.h(o,o,u)):(r=.42*i,n.g([0,0,i,0,i,i-2*r,i-r,i,0,i]))}function N(t,n,i){var e;(t%=4)?1==t?n.j(0,i/2,i,i/2,0):2==t?n.N(0,0,i,i):(e=i/6,n.h(e,e,i-2*e)):n.j(0,0,i,i,0)}function T(t,n){return[f(t=n.X(t),n.H,n.I(0)),f(t,n.p,n.q(.5)),f(t,n.H,n.I(1)),f(t,n.p,n.q(1)),f(t,n.p,n.q(0))]}function k(t,i,e){var r=l(e,.08);r.J&&t.m(r.J);var o=t.k,u=.5+o*r.Y|0;o-=2*u;var f=new j(t),h=0|o/4,s=0|u+o/2-2*h,a=0|u+o/2-2*h;function c(e,r,o,u,c){var v=n(i,o,1),l=u?n(i,u,1):0;t.O(g[d[e]]);for(var p=0;p=0)for(var n=0;n=0)return!0}for(var y=0;y<3;y++)v=n(i,8+y,1)%g.length,(p([0,4])||p([2,3]))&&(v=1),d.push(v);c(0,N,2,3,[[1,0],[2,0],[2,3],[1,3],[0,1],[3,1],[3,2],[0,2]]),c(1,N,4,5,[[0,0],[3,0],[3,3],[0,3]]),c(2,M,1,null,[[1,1],[2,1],[2,2],[1,2]]),t.finish()}function I(t){var n,i=40,e=16,r=0,o=0,u=encodeURI(t)+"%80",f=[],h=[],s=1732584193,a=4023233417,c=~s,v=~a,l=3285377520,g=[s,a,c,v,l],d=0,p="";function y(t,n){return t<>>32-n}for(;r>2]=f[o>>2]|("%"==u[r]?parseInt(u.substring(r+1,r+=3),16):u.charCodeAt(r++))<<8*(3-(3&o));for(f[(n=(1+(o+7>>6))*e)-1]=8*o-8;d>3]>>>4*(7-(7&r))&15).toString(16);return p}function O(t){return/^[0-9a-f]{11,}$/i.test(t)&&t}function P(t){return I(null==t?"":""+t)}function F(t,n){var i=t.canvas,e=i.width,r=i.height;t.save(),n||(n=Math.min(e,r),t.translate((e-n)/2|0,(r-n)/2|0)),this.l=t,this.k=n,t.clearRect(0,0,n,n)}C.g=function(t,n){for(var i=this,e=n?-2:2,r=[],o=n?t.length-2:0;o=0;o+=e)r.push(i.A.L(t[o],t[o+1]));this.M.g(r)},C.h=function(t,n,i,e){var r=this.A.L(t,n,i,i);this.M.h(r,i,e)},C.i=function(t,n,i,e,r){this.g([t,n,t+i,n,t+i,n+e,t,n+e],r)},C.j=function(t,n,i,e,r,o){var u=[t+i,n,t+i,n+e,t,n+e,t,n];u.splice((r||0)%4*2,2),this.g(u,o)},C.N=function(t,n,i,e,r){this.g([t+i/2,n,t+i,n+e/2,t+i/2,n+e,t,n+e/2],r)};var R=F.prototype;function q(t,n,i,e){if(!t)throw new Error("No canvas specified.");k(new F(t,i),O(n)||P(n),e)}function B(t){return(10*t+.5|0)/10}function L(){this.B=""}R.m=function(t){var n=this.l,i=this.k;n.fillStyle=o(t),n.fillRect(0,0,i,i)},R.O=function(t){var n=this.l;n.fillStyle=o(t),n.beginPath()},R.P=function(){this.l.fill()},R.g=function(t){var n=this.l;n.moveTo(t[0].x,t[0].y);for(var i=1;i'}var J=H.prototype;function K(t,n,i){var e=new H(n);return k(new U(e),O(t)||P(t),i),e.toString()}function V(t,n){for(var i=[],e=arguments.length-2;e-- >0;)i[e]=arguments[e+2];for(var r=document.createElementNS(G.T,n),o=0;o+1')},J.S=function(t,n){this.F+=''},J.toString=function(){return this.F+""};var Y=W.prototype;function Z(){m&&E(y)}function E(t,n,i){X(t,n,i,(function(t,n){if(n)return n==g?new U(new W(t)):new F(t.getContext("2d"))}))}function X(t,n,i,e){if("string"!=typeof t){var r=O(n)||null!=n&&P(n)||O(t.getAttribute(p.t))||t.hasAttribute(p.o)&&P(t.getAttribute(p.o));if(r){var o=e(t,b(t));o&&k(o,r,i)}}else if(m)for(var u=m(t),f=0;f6?e-6:e)<1?t+(n-t)*e:e<3?n:e<4?t+(n-t)*(4-e):t))}function r(t){if(/^#[0-9a-f]{3,8}$/i.test(t)){var n,i=t.length;if(i<6){var e=t[1],r=t[2],o=t[3],u=t[4]||"";n="#"+e+e+r+r+o+o+u+u}return(7==i||i>8)&&(n=t),n}}function o(t){var i,e=n(t,7,2);isNaN(e)?i=t:i="rgba("+n(t,1,2)+","+n(t,3,2)+","+n(t,5,2)+","+(e/255).toFixed(2)+")";return i}function u(t,n,r){var o;if(0==n){var u=i(255*r);o=u+u+u}else{var f=r<=.5?r*(n+1):r+n-r*n,h=2*r-f;o=e(h,f,6*t+2)+e(h,f,6*t)+e(h,f,6*t-2)}return"#"+o}function f(t,n,i){var e=[.55,.5,.5,.46,.6,.55,.55][6*t+.5|0];return u(t,n,i=i<.5?i*e*2:e+(i-.5)*(1-e)*2)}var h=t,s={G:"jdenticon_config",n:"config"},a={};function c(t){a=t}function v(t){return arguments.length&&(a[s.n]=t),a[s.n]}function l(t,n){var i="object"==typeof t&&t||a[s.n]||h[s.G]||{},e=i.lightness||{},o=i.saturation||{},u="color"in o?o.color:o,f=o.grayscale,c=i.backColor,v=i.padding;function l(t,n){var i=e[t];return i&&i.length>1||(i=n),function(t){return(t=i[0]+t*(i[1]-i[0]))<0?0:t>1?1:t}}function g(t){var n,e=i.hues;return e&&e.length>0&&(n=e[0|.999*t*e.length]),"number"==typeof n?(n/360%1+1)%1:t}return{X:g,p:"number"==typeof u?u:.5,H:"number"==typeof f?f:0,q:l("color",[.4,.8]),I:l("grayscale",[.3,.9]),J:r(c),Y:"number"==typeof t?t:"number"==typeof v?v:n}}var g=1,d=2,p={t:"data-jdenticon-hash",o:"data-jdenticon-value"},y="["+p.t+"],["+p.o+"]",m="undefined"!=typeof document&&document.querySelectorAll.bind(document);function b(t){if(t){var n=t.tagName;if(/^svg$/i.test(n))return g;if(/^canvas$/i.test(n)&&"getContext"in t)return d}}function w(t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(n){for(var i=0;i1?0|h:h>.5?1:h,n.i(s,s,i-h-s,i-h-s)):4==t?(o=0|.15*i,u=0|.5*i,n.h(i-u-o,i-u-o,u)):5==t?((s=4*(h=.1*i))>3&&(s|=0),n.i(0,0,i,i),n.g([s,s,i-h,s,s+(i-s-h)/2,i-h],!0)):6==t?n.g([0,0,i,0,i,.7*i,.4*i,.4*i,.7*i,i,0,i]):7==t?n.j(i/2,i/2,i/2,i/2,3):8==t?(n.i(0,0,i,i/2),n.i(0,i/2,i/2,i/2),n.j(i/2,i/2,i/2,i/2,1)):9==t?(h=.14*i,s=i<4?1:i<6?2:0|.35*i,h=i<8?h:0|h,n.i(0,0,i,i),n.i(s,s,i-s-h,i-s-h,!0)):10==t?(s=3*(h=.12*i),n.i(0,0,i,i),n.h(s,s,i-h-s,!0)):11==t?n.j(i/2,i/2,i/2,i/2,3):12==t?(o=.25*i,n.i(0,0,i,i),n.N(o,o,i-o,i-o,!0)):!e&&(o=.4*i,u=1.2*i,n.h(o,o,u)):(r=.42*i,n.g([0,0,i,0,i,i-2*r,i-r,i,0,i]))}function N(t,n,i){var e;(t%=4)?1==t?n.j(0,i/2,i,i/2,0):2==t?n.N(0,0,i,i):(e=i/6,n.h(e,e,i-2*e)):n.j(0,0,i,i,0)}function T(t,n){return[f(t=n.X(t),n.H,n.I(0)),f(t,n.p,n.q(.5)),f(t,n.H,n.I(1)),f(t,n.p,n.q(1)),f(t,n.p,n.q(0))]}function k(t,i,e){var r=l(e,.08);r.J&&t.m(r.J);var o=t.k,u=.5+o*r.Y|0;o-=2*u;var f=new j(t),h=0|o/4,s=0|u+o/2-2*h,a=0|u+o/2-2*h;function c(e,r,o,u,c){var v=n(i,o,1),l=u?n(i,u,1):0;t.O(g[d[e]]);for(var p=0;p=0)for(var n=0;n=0)return!0}for(var y=0;y<3;y++)v=n(i,8+y,1)%g.length,(p([0,4])||p([2,3]))&&(v=1),d.push(v);c(0,N,2,3,[[1,0],[2,0],[2,3],[1,3],[0,1],[3,1],[3,2],[0,2]]),c(1,N,4,5,[[0,0],[3,0],[3,3],[0,3]]),c(2,M,1,null,[[1,1],[2,1],[2,2],[1,2]]),t.finish()}function I(t){var n,i=40,e=16,r=0,o=0,u=encodeURI(t)+"%80",f=[],h=[],s=1732584193,a=4023233417,c=~s,v=~a,l=3285377520,g=[s,a,c,v,l],d=0,p="";function y(t,n){return t<>>32-n}for(;r>2]=f[o>>2]|("%"==u[r]?parseInt(u.substring(r+1,r+=3),16):u.charCodeAt(r++))<<8*(3-(3&o));for(f[(n=(1+(o+7>>6))*e)-1]=8*o-8;d>3]>>>4*(7-(7&r))&15).toString(16);return p}function O(t){return/^[0-9a-f]{11,}$/i.test(t)&&t}function P(t){return I(null==t?"":""+t)}function F(t,n){var i=t.canvas,e=i.width,r=i.height;t.save(),n||(n=Math.min(e,r),t.translate((e-n)/2|0,(r-n)/2|0)),this.l=t,this.k=n,t.clearRect(0,0,n,n)}C.g=function(t,n){for(var i=this,e=n?-2:2,r=[],o=n?t.length-2:0;o=0;o+=e)r.push(i.A.L(t[o],t[o+1]));this.M.g(r)},C.h=function(t,n,i,e){var r=this.A.L(t,n,i,i);this.M.h(r,i,e)},C.i=function(t,n,i,e,r){this.g([t,n,t+i,n,t+i,n+e,t,n+e],r)},C.j=function(t,n,i,e,r,o){var u=[t+i,n,t+i,n+e,t,n+e,t,n];u.splice((r||0)%4*2,2),this.g(u,o)},C.N=function(t,n,i,e,r){this.g([t+i/2,n,t+i,n+e/2,t+i/2,n+e,t,n+e/2],r)};var R=F.prototype;function q(t,n,i,e){if(!t)throw new Error("No canvas specified.");k(new F(t,i),O(n)||P(n),e)}function B(t){return(10*t+.5|0)/10}function L(){this.B=""}R.m=function(t){var n=this.l,i=this.k;n.fillStyle=o(t),n.fillRect(0,0,i,i)},R.O=function(t){var n=this.l;n.fillStyle=o(t),n.beginPath()},R.P=function(){this.l.fill()},R.g=function(t){var n=this.l;n.moveTo(t[0].x,t[0].y);for(var i=1;i'}var J=H.prototype;function K(t,n,i){var e=new H(n);return k(new U(e),O(t)||P(t),i),e.toString()}function V(t,n){for(var i=[],e=arguments.length-2;e-- >0;)i[e]=arguments[e+2];for(var r=document.createElementNS(G.T,n),o=0;o+1')},J.S=function(t,n){this.F+=''},J.toString=function(){return this.F+""};var Y=W.prototype;function Z(){m&&E(y)}function E(t,n,i){X(t,n,i,(function(t,n){if(n)return n==g?new U(new W(t)):new F(t.getContext("2d"))}))}function X(t,n,i,e){if("string"!=typeof t){var r=O(n)||null!=n&&P(n)||O(t.getAttribute(p.t))||t.hasAttribute(p.o)&&P(t.getAttribute(p.o));if(r){var o=e(t,b(t));o&&k(o,r,i)}}else if(m)for(var u=m(t),f=0;f 6 ? h - 6 : h;\r\n return decToHex(255 * (\r\n h < 1 ? m1 + (m2 - m1) * h :\r\n h < 3 ? m2 :\r\n h < 4 ? m1 + (m2 - m1) * (4 - h) :\r\n m1));\r\n}\r\n\r\n/**\r\n * @param {number} r Red channel [0, 255]\r\n * @param {number} g Green channel [0, 255]\r\n * @param {number} b Blue channel [0, 255]\r\n */\r\nexport function rgb(r, g, b) {\r\n return \"#\" + decToHex(r) + decToHex(g) + decToHex(b);\r\n}\r\n\r\n/**\r\n * @param {string} color Color value to parse. Currently hexadecimal strings on the format #rgb[a] and #rrggbb[aa] are supported.\r\n * @returns {string}\r\n */\r\nexport function parseColor(color) {\r\n if (/^#[0-9a-f]{3,8}$/i.test(color)) {\r\n let result;\r\n const colorLength = color.length;\r\n\r\n if (colorLength < 6) {\r\n const r = color[1],\r\n g = color[2],\r\n b = color[3],\r\n a = color[4] || \"\";\r\n result = \"#\" + r + r + g + g + b + b + a + a;\r\n }\r\n if (colorLength == 7 || colorLength > 8) {\r\n result = color;\r\n }\r\n \r\n return result;\r\n }\r\n}\r\n\r\n/**\r\n * Converts a hexadecimal color to a CSS3 compatible color.\r\n * @param {string} hexColor Color on the format \"#RRGGBB\" or \"#RRGGBBAA\"\r\n * @returns {string}\r\n */\r\nexport function toCss3Color(hexColor) {\r\n const a = parseHex(hexColor, 7, 2);\r\n let result;\r\n\r\n if (isNaN(a)) {\r\n result = hexColor;\r\n } else {\r\n const r = parseHex(hexColor, 1, 2),\r\n g = parseHex(hexColor, 3, 2),\r\n b = parseHex(hexColor, 5, 2);\r\n result = \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + (a / 255).toFixed(2) + \")\";\r\n }\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * Converts an HSL color to a hexadecimal RGB color.\r\n * @param {number} hue Hue in range [0, 1]\r\n * @param {number} saturation Saturation in range [0, 1]\r\n * @param {number} lightness Lightness in range [0, 1]\r\n * @returns {string}\r\n */\r\nexport function hsl(hue, saturation, lightness) {\r\n // Based on http://www.w3.org/TR/2011/REC-css3-color-20110607/#hsl-color\r\n let result;\r\n\r\n if (saturation == 0) {\r\n const partialHex = decToHex(lightness * 255);\r\n result = partialHex + partialHex + partialHex;\r\n }\r\n else {\r\n const m2 = lightness <= 0.5 ? lightness * (saturation + 1) : lightness + saturation - lightness * saturation,\r\n m1 = lightness * 2 - m2;\r\n result =\r\n hueToRgb(m1, m2, hue * 6 + 2) +\r\n hueToRgb(m1, m2, hue * 6) +\r\n hueToRgb(m1, m2, hue * 6 - 2);\r\n }\r\n\r\n return \"#\" + result;\r\n}\r\n\r\n/**\r\n * Converts an HSL color to a hexadecimal RGB color. This function will correct the lightness for the \"dark\" hues\r\n * @param {number} hue Hue in range [0, 1]\r\n * @param {number} saturation Saturation in range [0, 1]\r\n * @param {number} lightness Lightness in range [0, 1]\r\n * @returns {string}\r\n */\r\nexport function correctedHsl(hue, saturation, lightness) {\r\n // The corrector specifies the perceived middle lightness for each hue\r\n const correctors = [ 0.55, 0.5, 0.5, 0.46, 0.6, 0.55, 0.55 ],\r\n corrector = correctors[(hue * 6 + 0.5) | 0];\r\n \r\n // Adjust the input lightness relative to the corrector\r\n lightness = lightness < 0.5 ? lightness * corrector * 2 : corrector + (lightness - 0.5) * (1 - corrector) * 2;\r\n \r\n return hsl(hue, saturation, lightness);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n/* global umdGlobal */\r\n\r\n// In the future we can replace `GLOBAL` with `globalThis`, but for now use the old school global detection for\r\n// backward compatibility.\r\nexport const GLOBAL = umdGlobal;\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { parseColor } from \"../renderer/color\";\r\nimport { GLOBAL } from \"./global\";\r\n\r\n/**\r\n * @typedef {Object} ParsedConfiguration\r\n * @property {number} colorSaturation\r\n * @property {number} grayscaleSaturation\r\n * @property {string} backColor\r\n * @property {number} iconPadding\r\n * @property {function(number):number} hue\r\n * @property {function(number):number} colorLightness\r\n * @property {function(number):number} grayscaleLightness\r\n */\r\n\r\nexport const CONFIG_PROPERTIES = {\r\n GLOBAL: \"jdenticon_config\",\r\n MODULE: \"config\",\r\n};\r\n\r\nvar rootConfigurationHolder = {};\r\n\r\n/**\r\n * Defines the deprecated `config` property on the root Jdenticon object. When the property is set a warning is \r\n * printed in the console. To minimize bundle size, this is only used in Node bundles.\r\n * @param {!Object} rootObject \r\n */\r\nexport function defineConfigPropertyWithWarn(rootObject) {\r\n Object.defineProperty(rootObject, CONFIG_PROPERTIES.MODULE, {\r\n configurable: true,\r\n get: () => rootConfigurationHolder[CONFIG_PROPERTIES.MODULE],\r\n set: newConfiguration => {\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] = newConfiguration;\r\n console.warn(\"jdenticon.config is deprecated. Use jdenticon.configure() instead.\");\r\n },\r\n });\r\n}\r\n\r\n/**\r\n * Defines the deprecated `config` property on the root Jdenticon object without printing a warning in the console\r\n * when it is being used.\r\n * @param {!Object} rootObject \r\n */\r\nexport function defineConfigProperty(rootObject) {\r\n rootConfigurationHolder = rootObject;\r\n}\r\n\r\n/**\r\n * Sets a new icon style configuration. The new configuration is not merged with the previous one. * \r\n * @param {Object} newConfiguration - New configuration object.\r\n */\r\nexport function configure(newConfiguration) {\r\n if (arguments.length) {\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] = newConfiguration;\r\n }\r\n return rootConfigurationHolder[CONFIG_PROPERTIES.MODULE];\r\n}\r\n\r\n/**\r\n * Gets the normalized current Jdenticon color configuration. Missing fields have default values.\r\n * @param {Object|number|undefined} paddingOrLocalConfig - Configuration passed to the called API method. A\r\n * local configuration overrides the global configuration in it entirety. This parameter can for backward\r\n * compatibility also contain a padding value. A padding value only overrides the global padding, not the\r\n * entire global configuration.\r\n * @param {number} defaultPadding - Padding used if no padding is specified in neither the configuration nor\r\n * explicitly to the API method.\r\n * @returns {ParsedConfiguration}\r\n */\r\nexport function getConfiguration(paddingOrLocalConfig, defaultPadding) {\r\n const configObject = \r\n typeof paddingOrLocalConfig == \"object\" && paddingOrLocalConfig ||\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] ||\r\n GLOBAL[CONFIG_PROPERTIES.GLOBAL] ||\r\n { },\r\n\r\n lightnessConfig = configObject[\"lightness\"] || { },\r\n \r\n // In versions < 2.1.0 there was no grayscale saturation -\r\n // saturation was the color saturation.\r\n saturation = configObject[\"saturation\"] || { },\r\n colorSaturation = \"color\" in saturation ? saturation[\"color\"] : saturation,\r\n grayscaleSaturation = saturation[\"grayscale\"],\r\n\r\n backColor = configObject[\"backColor\"],\r\n padding = configObject[\"padding\"];\r\n \r\n /**\r\n * Creates a lightness range.\r\n */\r\n function lightness(configName, defaultRange) {\r\n let range = lightnessConfig[configName];\r\n \r\n // Check if the lightness range is an array-like object. This way we ensure the\r\n // array contain two values at the same time.\r\n if (!(range && range.length > 1)) {\r\n range = defaultRange;\r\n }\r\n\r\n /**\r\n * Gets a lightness relative the specified value in the specified lightness range.\r\n */\r\n return function (value) {\r\n value = range[0] + value * (range[1] - range[0]);\r\n return value < 0 ? 0 : value > 1 ? 1 : value;\r\n };\r\n }\r\n\r\n /**\r\n * Gets a hue allowed by the configured hue restriction,\r\n * provided the originally computed hue.\r\n */\r\n function hueFunction(originalHue) {\r\n const hueConfig = configObject[\"hues\"];\r\n let hue;\r\n \r\n // Check if 'hues' is an array-like object. This way we also ensure that\r\n // the array is not empty, which would mean no hue restriction.\r\n if (hueConfig && hueConfig.length > 0) {\r\n // originalHue is in the range [0, 1]\r\n // Multiply with 0.999 to change the range to [0, 1) and then truncate the index.\r\n hue = hueConfig[0 | (0.999 * originalHue * hueConfig.length)];\r\n }\r\n\r\n return typeof hue == \"number\" ?\r\n \r\n // A hue was specified. We need to convert the hue from\r\n // degrees on any turn - e.g. 746° is a perfectly valid hue -\r\n // to turns in the range [0, 1).\r\n ((((hue / 360) % 1) + 1) % 1) :\r\n\r\n // No hue configured => use original hue\r\n originalHue;\r\n }\r\n \r\n return {\r\n hue: hueFunction,\r\n colorSaturation: typeof colorSaturation == \"number\" ? colorSaturation : 0.5,\r\n grayscaleSaturation: typeof grayscaleSaturation == \"number\" ? grayscaleSaturation : 0,\r\n colorLightness: lightness(\"color\", [0.4, 0.8]),\r\n grayscaleLightness: lightness(\"grayscale\", [0.3, 0.9]),\r\n backColor: parseColor(backColor),\r\n iconPadding: \r\n typeof paddingOrLocalConfig == \"number\" ? paddingOrLocalConfig : \r\n typeof padding == \"number\" ? padding : \r\n defaultPadding\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nexport const ICON_TYPE_SVG = 1;\r\n\r\nexport const ICON_TYPE_CANVAS = 2;\r\n\r\nexport const ATTRIBUTES = {\r\n HASH: \"data-jdenticon-hash\",\r\n VALUE: \"data-jdenticon-value\"\r\n};\r\n\r\nexport const ICON_SELECTOR = \"[\" + ATTRIBUTES.HASH +\"],[\" + ATTRIBUTES.VALUE +\"]\";\r\n\r\nexport const documentQuerySelectorAll = /** @type {!Function} */ (\r\n typeof document !== \"undefined\" && document.querySelectorAll.bind(document));\r\n\r\nexport function getIdenticonType(el) {\r\n if (el) {\r\n const tagName = el[\"tagName\"];\r\n\r\n if (/^svg$/i.test(tagName)) {\r\n return ICON_TYPE_SVG;\r\n }\r\n\r\n if (/^canvas$/i.test(tagName) && \"getContext\" in el) {\r\n return ICON_TYPE_CANVAS;\r\n }\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { ATTRIBUTES, ICON_SELECTOR, getIdenticonType } from \"./dom\";\r\n\r\nexport function observer(updateCallback) {\r\n if (typeof MutationObserver != \"undefined\") {\r\n const mutationObserver = new MutationObserver(function onmutation(mutations) {\r\n for (let mutationIndex = 0; mutationIndex < mutations.length; mutationIndex++) {\r\n const mutation = mutations[mutationIndex];\r\n const addedNodes = mutation.addedNodes;\r\n \r\n for (let addedNodeIndex = 0; addedNodes && addedNodeIndex < addedNodes.length; addedNodeIndex++) {\r\n const addedNode = addedNodes[addedNodeIndex];\r\n \r\n // Skip other types of nodes than element nodes, since they might not support\r\n // the querySelectorAll method => runtime error.\r\n if (addedNode.nodeType == Node.ELEMENT_NODE) {\r\n if (getIdenticonType(addedNode)) {\r\n updateCallback(addedNode);\r\n }\r\n else {\r\n const icons = /** @type {Element} */(addedNode).querySelectorAll(ICON_SELECTOR);\r\n for (let iconIndex = 0; iconIndex < icons.length; iconIndex++) {\r\n updateCallback(icons[iconIndex]);\r\n }\r\n }\r\n }\r\n }\r\n \r\n if (mutation.type == \"attributes\" && getIdenticonType(mutation.target)) {\r\n updateCallback(mutation.target);\r\n }\r\n }\r\n });\r\n\r\n mutationObserver.observe(document.body, {\r\n \"childList\": true,\r\n \"attributes\": true,\r\n \"attributeFilter\": [ATTRIBUTES.VALUE, ATTRIBUTES.HASH, \"width\", \"height\"],\r\n \"subtree\": true,\r\n });\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Represents a point.\r\n */\r\nexport class Point {\r\n /**\r\n * @param {number} x \r\n * @param {number} y \r\n */\r\n constructor(x, y) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { Point } from \"./point\";\r\n\r\n/**\r\n * Translates and rotates a point before being passed on to the canvas context. This was previously done by the canvas context itself, \r\n * but this caused a rendering issue in Chrome on sizes > 256 where the rotation transformation of inverted paths was not done properly.\r\n */\r\nexport class Transform {\r\n /**\r\n * @param {number} x The x-coordinate of the upper left corner of the transformed rectangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the transformed rectangle.\r\n * @param {number} size The size of the transformed rectangle.\r\n * @param {number} rotation Rotation specified as 0 = 0 rad, 1 = 0.5π rad, 2 = π rad, 3 = 1.5π rad\r\n */\r\n constructor(x, y, size, rotation) {\r\n this._x = x;\r\n this._y = y;\r\n this._size = size;\r\n this._rotation = rotation;\r\n }\r\n\r\n /**\r\n * Transforms the specified point based on the translation and rotation specification for this Transform.\r\n * @param {number} x x-coordinate\r\n * @param {number} y y-coordinate\r\n * @param {number=} w The width of the transformed rectangle. If greater than 0, this will ensure the returned point is of the upper left corner of the transformed rectangle.\r\n * @param {number=} h The height of the transformed rectangle. If greater than 0, this will ensure the returned point is of the upper left corner of the transformed rectangle.\r\n */\r\n transformIconPoint(x, y, w, h) {\r\n const right = this._x + this._size,\r\n bottom = this._y + this._size,\r\n rotation = this._rotation;\r\n return rotation === 1 ? new Point(right - y - (h || 0), this._y + x) :\r\n rotation === 2 ? new Point(right - x - (w || 0), bottom - y - (h || 0)) :\r\n rotation === 3 ? new Point(this._x + y, bottom - x - (w || 0)) :\r\n new Point(this._x + x, this._y + y);\r\n }\r\n}\r\n\r\nexport const NO_TRANSFORM = new Transform(0, 0, 0, 0);\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { NO_TRANSFORM } from \"./transform\";\r\n\r\n/**\r\n * @typedef {import(\"./renderer\").Renderer} Renderer\r\n * @typedef {import(\"./transform\").Transform} Transform\r\n */\r\n\r\n/**\r\n * Provides helper functions for rendering common basic shapes.\r\n */\r\nexport class Graphics {\r\n /**\r\n * @param {Renderer} renderer \r\n */\r\n constructor(renderer) {\r\n /**\r\n * @type {Renderer}\r\n * @private\r\n */\r\n this._renderer = renderer;\r\n\r\n /**\r\n * @type {Transform}\r\n */\r\n this.currentTransform = NO_TRANSFORM;\r\n }\r\n\r\n /**\r\n * Adds a polygon to the underlying renderer.\r\n * @param {Array} points The points of the polygon clockwise on the format [ x0, y0, x1, y1, ..., xn, yn ]\r\n * @param {boolean=} invert Specifies if the polygon will be inverted.\r\n */\r\n addPolygon(points, invert) {\r\n const di = invert ? -2 : 2,\r\n transformedPoints = [];\r\n \r\n for (let i = invert ? points.length - 2 : 0; i < points.length && i >= 0; i += di) {\r\n transformedPoints.push(this.currentTransform.transformIconPoint(points[i], points[i + 1]));\r\n }\r\n \r\n this._renderer.addPolygon(transformedPoints);\r\n }\r\n \r\n /**\r\n * Adds a polygon to the underlying renderer.\r\n * Source: http://stackoverflow.com/a/2173084\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the entire ellipse.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the entire ellipse.\r\n * @param {number} size The size of the ellipse.\r\n * @param {boolean=} invert Specifies if the ellipse will be inverted.\r\n */\r\n addCircle(x, y, size, invert) {\r\n const p = this.currentTransform.transformIconPoint(x, y, size, size);\r\n this._renderer.addCircle(p, size, invert);\r\n }\r\n\r\n /**\r\n * Adds a rectangle to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle.\r\n * @param {number} w The width of the rectangle.\r\n * @param {number} h The height of the rectangle.\r\n * @param {boolean=} invert Specifies if the rectangle will be inverted.\r\n */\r\n addRectangle(x, y, w, h, invert) {\r\n this.addPolygon([\r\n x, y, \r\n x + w, y,\r\n x + w, y + h,\r\n x, y + h\r\n ], invert);\r\n }\r\n\r\n /**\r\n * Adds a right triangle to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the triangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the triangle.\r\n * @param {number} w The width of the triangle.\r\n * @param {number} h The height of the triangle.\r\n * @param {number} r The rotation of the triangle (clockwise). 0 = right corner of the triangle in the lower left corner of the bounding rectangle.\r\n * @param {boolean=} invert Specifies if the triangle will be inverted.\r\n */\r\n addTriangle(x, y, w, h, r, invert) {\r\n const points = [\r\n x + w, y, \r\n x + w, y + h, \r\n x, y + h,\r\n x, y\r\n ];\r\n points.splice(((r || 0) % 4) * 2, 2);\r\n this.addPolygon(points, invert);\r\n }\r\n\r\n /**\r\n * Adds a rhombus to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the rhombus.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the rhombus.\r\n * @param {number} w The width of the rhombus.\r\n * @param {number} h The height of the rhombus.\r\n * @param {boolean=} invert Specifies if the rhombus will be inverted.\r\n */\r\n addRhombus(x, y, w, h, invert) {\r\n this.addPolygon([\r\n x + w / 2, y,\r\n x + w, y + h / 2,\r\n x + w / 2, y + h,\r\n x, y + h / 2\r\n ], invert);\r\n }\r\n}","\r\nvar Graphics__prototype = Graphics.prototype;","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * @param {number} index\r\n * @param {Graphics} g\r\n * @param {number} cell\r\n * @param {number} positionIndex\r\n * @typedef {import('./graphics').Graphics} Graphics\r\n */\r\nexport function centerShape(index, g, cell, positionIndex) {\r\n index = index % 14;\r\n\r\n let k, m, w, h, inner, outer;\r\n\r\n !index ? (\r\n k = cell * 0.42,\r\n g.addPolygon([\r\n 0, 0,\r\n cell, 0,\r\n cell, cell - k * 2,\r\n cell - k, cell,\r\n 0, cell\r\n ])) :\r\n\r\n index == 1 ? (\r\n w = 0 | (cell * 0.5), \r\n h = 0 | (cell * 0.8),\r\n\r\n g.addTriangle(cell - w, 0, w, h, 2)) :\r\n\r\n index == 2 ? (\r\n w = 0 | (cell / 3),\r\n g.addRectangle(w, w, cell - w, cell - w)) :\r\n\r\n index == 3 ? (\r\n inner = cell * 0.1,\r\n // Use fixed outer border widths in small icons to ensure the border is drawn\r\n outer = \r\n cell < 6 ? 1 :\r\n cell < 8 ? 2 :\r\n (0 | (cell * 0.25)),\r\n \r\n inner = \r\n inner > 1 ? (0 | inner) : // large icon => truncate decimals\r\n inner > 0.5 ? 1 : // medium size icon => fixed width\r\n inner, // small icon => anti-aliased border\r\n\r\n g.addRectangle(outer, outer, cell - inner - outer, cell - inner - outer)) :\r\n\r\n index == 4 ? (\r\n m = 0 | (cell * 0.15),\r\n w = 0 | (cell * 0.5),\r\n g.addCircle(cell - w - m, cell - w - m, w)) :\r\n\r\n index == 5 ? (\r\n inner = cell * 0.1,\r\n outer = inner * 4,\r\n\r\n // Align edge to nearest pixel in large icons\r\n outer > 3 && (outer = 0 | outer),\r\n \r\n g.addRectangle(0, 0, cell, cell),\r\n g.addPolygon([\r\n outer, outer,\r\n cell - inner, outer,\r\n outer + (cell - outer - inner) / 2, cell - inner\r\n ], true)) :\r\n\r\n index == 6 ? \r\n g.addPolygon([\r\n 0, 0,\r\n cell, 0,\r\n cell, cell * 0.7,\r\n cell * 0.4, cell * 0.4,\r\n cell * 0.7, cell,\r\n 0, cell\r\n ]) :\r\n\r\n index == 7 ? \r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 3) :\r\n\r\n index == 8 ? (\r\n g.addRectangle(0, 0, cell, cell / 2),\r\n g.addRectangle(0, cell / 2, cell / 2, cell / 2),\r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 1)) :\r\n\r\n index == 9 ? (\r\n inner = cell * 0.14,\r\n // Use fixed outer border widths in small icons to ensure the border is drawn\r\n outer = \r\n cell < 4 ? 1 :\r\n cell < 6 ? 2 :\r\n (0 | (cell * 0.35)),\r\n\r\n inner = \r\n cell < 8 ? inner : // small icon => anti-aliased border\r\n (0 | inner), // large icon => truncate decimals\r\n\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addRectangle(outer, outer, cell - outer - inner, cell - outer - inner, true)) :\r\n\r\n index == 10 ? (\r\n inner = cell * 0.12,\r\n outer = inner * 3,\r\n\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addCircle(outer, outer, cell - inner - outer, true)) :\r\n\r\n index == 11 ? \r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 3) :\r\n\r\n index == 12 ? (\r\n m = cell * 0.25,\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addRhombus(m, m, cell - m, cell - m, true)) :\r\n\r\n // 13\r\n (\r\n !positionIndex && (\r\n m = cell * 0.4, w = cell * 1.2,\r\n g.addCircle(m, m, w)\r\n )\r\n );\r\n}\r\n\r\n/**\r\n * @param {number} index\r\n * @param {Graphics} g\r\n * @param {number} cell\r\n */\r\nexport function outerShape(index, g, cell) {\r\n index = index % 4;\r\n\r\n let m;\r\n\r\n !index ?\r\n g.addTriangle(0, 0, cell, cell, 0) :\r\n \r\n index == 1 ?\r\n g.addTriangle(0, cell / 2, cell, cell / 2, 0) :\r\n\r\n index == 2 ?\r\n g.addRhombus(0, 0, cell, cell) :\r\n\r\n // 3\r\n (\r\n m = cell / 6,\r\n g.addCircle(m, m, cell - 2 * m)\r\n );\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { correctedHsl } from \"./color\";\r\n\r\n/**\r\n * Gets a set of identicon color candidates for a specified hue and config.\r\n * @param {number} hue\r\n * @param {import(\"../common/configuration\").ParsedConfiguration} config\r\n */\r\nexport function colorTheme(hue, config) {\r\n hue = config.hue(hue);\r\n return [\r\n // Dark gray\r\n correctedHsl(hue, config.grayscaleSaturation, config.grayscaleLightness(0)),\r\n // Mid color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(0.5)),\r\n // Light gray\r\n correctedHsl(hue, config.grayscaleSaturation, config.grayscaleLightness(1)),\r\n // Light color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(1)),\r\n // Dark color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(0))\r\n ];\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { Transform } from \"./transform\";\r\nimport { Graphics } from \"./graphics\";\r\nimport { centerShape, outerShape } from \"./shapes\";\r\nimport { colorTheme } from \"./colorTheme\";\r\nimport { parseHex } from \"../common/parseHex\";\r\nimport { getConfiguration } from \"../common/configuration\";\r\n \r\n/**\r\n * Draws an identicon to a specified renderer.\r\n * @param {import('./renderer').Renderer} renderer\r\n * @param {string} hash\r\n * @param {Object|number=} config\r\n */\r\nexport function iconGenerator(renderer, hash, config) {\r\n const parsedConfig = getConfiguration(config, 0.08);\r\n\r\n // Set background color\r\n if (parsedConfig.backColor) {\r\n renderer.setBackground(parsedConfig.backColor);\r\n }\r\n \r\n // Calculate padding and round to nearest integer\r\n let size = renderer.iconSize;\r\n const padding = (0.5 + size * parsedConfig.iconPadding) | 0;\r\n size -= padding * 2;\r\n \r\n const graphics = new Graphics(renderer);\r\n \r\n // Calculate cell size and ensure it is an integer\r\n const cell = 0 | (size / 4);\r\n \r\n // Since the cell size is integer based, the actual icon will be slightly smaller than specified => center icon\r\n const x = 0 | (padding + size / 2 - cell * 2);\r\n const y = 0 | (padding + size / 2 - cell * 2);\r\n\r\n function renderShape(colorIndex, shapes, index, rotationIndex, positions) {\r\n const shapeIndex = parseHex(hash, index, 1);\r\n let r = rotationIndex ? parseHex(hash, rotationIndex, 1) : 0;\r\n \r\n renderer.beginShape(availableColors[selectedColorIndexes[colorIndex]]);\r\n \r\n for (let i = 0; i < positions.length; i++) {\r\n graphics.currentTransform = new Transform(x + positions[i][0] * cell, y + positions[i][1] * cell, cell, r++ % 4);\r\n shapes(shapeIndex, graphics, cell, i);\r\n }\r\n \r\n renderer.endShape();\r\n }\r\n\r\n // AVAILABLE COLORS\r\n const hue = parseHex(hash, -7) / 0xfffffff,\r\n \r\n // Available colors for this icon\r\n availableColors = colorTheme(hue, parsedConfig),\r\n\r\n // The index of the selected colors\r\n selectedColorIndexes = [];\r\n\r\n let index;\r\n\r\n function isDuplicate(values) {\r\n if (values.indexOf(index) >= 0) {\r\n for (let i = 0; i < values.length; i++) {\r\n if (selectedColorIndexes.indexOf(values[i]) >= 0) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n for (let i = 0; i < 3; i++) {\r\n index = parseHex(hash, 8 + i, 1) % availableColors.length;\r\n if (isDuplicate([0, 4]) || // Disallow dark gray and dark color combo\r\n isDuplicate([2, 3])) { // Disallow light gray and light color combo\r\n index = 1;\r\n }\r\n selectedColorIndexes.push(index);\r\n }\r\n\r\n // ACTUAL RENDERING\r\n // Sides\r\n renderShape(0, outerShape, 2, 3, [[1, 0], [2, 0], [2, 3], [1, 3], [0, 1], [3, 1], [3, 2], [0, 2]]);\r\n // Corners\r\n renderShape(1, outerShape, 4, 5, [[0, 0], [3, 0], [3, 3], [0, 3]]);\r\n // Center\r\n renderShape(2, centerShape, 1, null, [[1, 1], [2, 1], [2, 2], [1, 2]]);\r\n \r\n renderer.finish();\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Computes a SHA1 hash for any value and returns it as a hexadecimal string.\r\n * \r\n * This function is optimized for minimal code size and rather short messages.\r\n * \r\n * @param {string} message \r\n */\r\nexport function sha1(message) {\r\n const HASH_SIZE_HALF_BYTES = 40;\r\n const BLOCK_SIZE_WORDS = 16;\r\n\r\n // Variables\r\n // `var` is used to be able to minimize the number of `var` keywords.\r\n var i = 0,\r\n f = 0,\r\n \r\n // Use `encodeURI` to UTF8 encode the message without any additional libraries\r\n // We could use `unescape` + `encodeURI` to minimize the code, but that would be slightly risky\r\n // since `unescape` is deprecated.\r\n urlEncodedMessage = encodeURI(message) + \"%80\", // trailing '1' bit padding\r\n \r\n // This can be changed to a preallocated Uint32Array array for greater performance and larger code size\r\n data = [],\r\n dataSize,\r\n \r\n hashBuffer = [],\r\n\r\n a = 0x67452301,\r\n b = 0xefcdab89,\r\n c = ~a,\r\n d = ~b,\r\n e = 0xc3d2e1f0,\r\n hash = [a, b, c, d, e],\r\n\r\n blockStartIndex = 0,\r\n hexHash = \"\";\r\n\r\n /**\r\n * Rotates the value a specified number of bits to the left.\r\n * @param {number} value Value to rotate\r\n * @param {number} shift Bit count to shift.\r\n */\r\n function rotl(value, shift) {\r\n return (value << shift) | (value >>> (32 - shift));\r\n }\r\n\r\n // Message data\r\n for ( ; i < urlEncodedMessage.length; f++) {\r\n data[f >> 2] = data[f >> 2] |\r\n (\r\n (\r\n urlEncodedMessage[i] == \"%\"\r\n // Percent encoded byte\r\n ? parseInt(urlEncodedMessage.substring(i + 1, i += 3), 16)\r\n // Unencoded byte\r\n : urlEncodedMessage.charCodeAt(i++)\r\n )\r\n\r\n // Read bytes in reverse order (big endian words)\r\n << ((3 - (f & 3)) * 8)\r\n );\r\n }\r\n\r\n // f is now the length of the utf8 encoded message\r\n // 7 = 8 bytes (64 bit) for message size, -1 to round down\r\n // >> 6 = integer division with block size\r\n dataSize = (((f + 7) >> 6) + 1) * BLOCK_SIZE_WORDS;\r\n\r\n // Message size in bits.\r\n // SHA1 uses a 64 bit integer to represent the size, but since we only support short messages only the least\r\n // significant 32 bits are set. -8 is for the '1' bit padding byte.\r\n data[dataSize - 1] = f * 8 - 8;\r\n \r\n // Compute hash\r\n for ( ; blockStartIndex < dataSize; blockStartIndex += BLOCK_SIZE_WORDS) {\r\n for (i = 0; i < 80; i++) {\r\n f = rotl(a, 5) + e + (\r\n // Ch\r\n i < 20 ? ((b & c) ^ ((~b) & d)) + 0x5a827999 :\r\n \r\n // Parity\r\n i < 40 ? (b ^ c ^ d) + 0x6ed9eba1 :\r\n \r\n // Maj\r\n i < 60 ? ((b & c) ^ (b & d) ^ (c & d)) + 0x8f1bbcdc :\r\n \r\n // Parity\r\n (b ^ c ^ d) + 0xca62c1d6\r\n ) + ( \r\n hashBuffer[i] = i < BLOCK_SIZE_WORDS\r\n // Bitwise OR is used to coerse `undefined` to 0\r\n ? (data[blockStartIndex + i] | 0)\r\n : rotl(hashBuffer[i - 3] ^ hashBuffer[i - 8] ^ hashBuffer[i - 14] ^ hashBuffer[i - 16], 1)\r\n );\r\n\r\n e = d;\r\n d = c;\r\n c = rotl(b, 30);\r\n b = a;\r\n a = f;\r\n }\r\n\r\n hash[0] = a = ((hash[0] + a) | 0);\r\n hash[1] = b = ((hash[1] + b) | 0);\r\n hash[2] = c = ((hash[2] + c) | 0);\r\n hash[3] = d = ((hash[3] + d) | 0);\r\n hash[4] = e = ((hash[4] + e) | 0);\r\n }\r\n\r\n // Format hex hash\r\n for (i = 0; i < HASH_SIZE_HALF_BYTES; i++) {\r\n hexHash += (\r\n (\r\n // Get word (2^3 half-bytes per word)\r\n hash[i >> 3] >>>\r\n\r\n // Append half-bytes in reverse order\r\n ((7 - (i & 7)) * 4)\r\n ) \r\n // Clamp to half-byte\r\n & 0xf\r\n ).toString(16);\r\n }\r\n\r\n return hexHash;\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { sha1 } from \"./sha1\";\r\n\r\n/**\r\n * Inputs a value that might be a valid hash string for Jdenticon and returns it \r\n * if it is determined valid, otherwise a falsy value is returned.\r\n */\r\nexport function isValidHash(hashCandidate) {\r\n return /^[0-9a-f]{11,}$/i.test(hashCandidate) && hashCandidate;\r\n}\r\n\r\n/**\r\n * Computes a hash for the specified value. Currently SHA1 is used. This function\r\n * always returns a valid hash.\r\n */\r\nexport function computeHash(value) {\r\n return sha1(value == null ? \"\" : \"\" + value);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { toCss3Color } from \"../color\";\r\n\r\n/**\r\n * @typedef {import(\"../renderer\").Renderer} Renderer\r\n * @typedef {import('../point').Point} Point\r\n */\r\n\r\n/**\r\n * Renderer redirecting drawing commands to a canvas context.\r\n * @implements {Renderer}\r\n */\r\nexport class CanvasRenderer {\r\n /**\r\n * @param {number=} iconSize\r\n */\r\n constructor(ctx, iconSize) {\r\n const canvas = ctx.canvas; \r\n const width = canvas.width;\r\n const height = canvas.height;\r\n \r\n ctx.save();\r\n \r\n if (!iconSize) {\r\n iconSize = Math.min(width, height);\r\n \r\n ctx.translate(\r\n ((width - iconSize) / 2) | 0,\r\n ((height - iconSize) / 2) | 0);\r\n }\r\n\r\n /**\r\n * @private\r\n */\r\n this._ctx = ctx;\r\n this.iconSize = iconSize;\r\n \r\n ctx.clearRect(0, 0, iconSize, iconSize);\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb[aa].\r\n */\r\n setBackground(fillColor) {\r\n const ctx = this._ctx;\r\n const iconSize = this.iconSize;\r\n\r\n ctx.fillStyle = toCss3Color(fillColor);\r\n ctx.fillRect(0, 0, iconSize, iconSize);\r\n }\r\n\r\n /**\r\n * Marks the beginning of a new shape of the specified color. Should be ended with a call to endShape.\r\n * @param {string} fillColor Fill color on format #rrggbb[aa].\r\n */\r\n beginShape(fillColor) {\r\n const ctx = this._ctx;\r\n ctx.fillStyle = toCss3Color(fillColor);\r\n ctx.beginPath();\r\n }\r\n\r\n /**\r\n * Marks the end of the currently drawn shape. This causes the queued paths to be rendered on the canvas.\r\n */\r\n endShape() {\r\n this._ctx.fill();\r\n }\r\n\r\n /**\r\n * Adds a polygon to the rendering queue.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n const ctx = this._ctx;\r\n ctx.moveTo(points[0].x, points[0].y);\r\n for (let i = 1; i < points.length; i++) {\r\n ctx.lineTo(points[i].x, points[i].y);\r\n }\r\n ctx.closePath();\r\n }\r\n\r\n /**\r\n * Adds a circle to the rendering queue.\r\n * @param {Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n const ctx = this._ctx,\r\n radius = diameter / 2;\r\n ctx.moveTo(point.x + radius, point.y + radius);\r\n ctx.arc(point.x + radius, point.y + radius, radius, 0, Math.PI * 2, counterClockwise);\r\n ctx.closePath();\r\n }\r\n\r\n /**\r\n * Called when the icon has been completely drawn.\r\n */\r\n finish() {\r\n this._ctx.restore();\r\n }\r\n}\r\n","\r\nvar CanvasRenderer__prototype = CanvasRenderer.prototype;","import { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { CanvasRenderer } from \"../renderer/canvas/canvasRenderer\";\r\n\r\n/**\r\n * Draws an identicon to a context.\r\n * @param {CanvasRenderingContext2D} ctx - Canvas context on which the icon will be drawn at location (0, 0).\r\n * @param {*} hashOrValue - A hexadecimal hash string or any value that will be hashed by Jdenticon.\r\n * @param {number} size - Icon size in pixels.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compatibility a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function drawIcon(ctx, hashOrValue, size, config) {\r\n if (!ctx) {\r\n throw new Error(\"No canvas specified.\");\r\n }\r\n \r\n iconGenerator(new CanvasRenderer(ctx, size), \r\n isValidHash(hashOrValue) || computeHash(hashOrValue), \r\n config);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Prepares a measure to be used as a measure in an SVG path, by\r\n * rounding the measure to a single decimal. This reduces the file\r\n * size of the generated SVG with more than 50% in some cases.\r\n */\r\nfunction svgValue(value) {\r\n return ((value * 10 + 0.5) | 0) / 10;\r\n}\r\n\r\n/**\r\n * Represents an SVG path element.\r\n */\r\nexport class SvgPath {\r\n constructor() {\r\n /**\r\n * This property holds the data string (path.d) of the SVG path.\r\n * @type {string}\r\n */\r\n this.dataString = \"\";\r\n }\r\n\r\n /**\r\n * Adds a polygon with the current fill color to the SVG path.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n let dataString = \"\";\r\n for (let i = 0; i < points.length; i++) {\r\n dataString += (i ? \"L\" : \"M\") + svgValue(points[i].x) + \" \" + svgValue(points[i].y);\r\n }\r\n this.dataString += dataString + \"Z\";\r\n }\r\n\r\n /**\r\n * Adds a circle with the current fill color to the SVG path.\r\n * @param {import('../point').Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n const sweepFlag = counterClockwise ? 0 : 1,\r\n svgRadius = svgValue(diameter / 2),\r\n svgDiameter = svgValue(diameter),\r\n svgArc = \"a\" + svgRadius + \",\" + svgRadius + \" 0 1,\" + sweepFlag + \" \";\r\n \r\n this.dataString += \r\n \"M\" + svgValue(point.x) + \" \" + svgValue(point.y + diameter / 2) +\r\n svgArc + svgDiameter + \",0\" + \r\n svgArc + (-svgDiameter) + \",0\";\r\n }\r\n}\r\n\r\n","\r\nvar SvgPath__prototype = SvgPath.prototype;","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { SvgPath } from \"./svgPath\";\r\nimport { parseHex } from \"../../common/parseHex\";\r\n\r\n/**\r\n * @typedef {import(\"../point\").Point} Point\r\n * @typedef {import(\"../renderer\").Renderer} Renderer\r\n * @typedef {import(\"./svgElement\").SvgElement} SvgElement\r\n * @typedef {import(\"./svgWriter\").SvgWriter} SvgWriter\r\n */\r\n\r\n/**\r\n * Renderer producing SVG output.\r\n * @implements {Renderer}\r\n */\r\nexport class SvgRenderer {\r\n /**\r\n * @param {SvgElement|SvgWriter} target \r\n */\r\n constructor(target) {\r\n /**\r\n * @type {SvgPath}\r\n * @private\r\n */\r\n this._path;\r\n\r\n /**\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._pathsByColor = { };\r\n\r\n /**\r\n * @type {SvgElement|SvgWriter}\r\n * @private\r\n */\r\n this._target = target;\r\n\r\n /**\r\n * @type {number}\r\n */\r\n this.iconSize = target.iconSize;\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb[aa].\r\n */\r\n setBackground(fillColor) {\r\n const match = /^(#......)(..)?/.exec(fillColor),\r\n opacity = match[2] ? parseHex(match[2], 0) / 255 : 1;\r\n this._target.setBackground(match[1], opacity);\r\n }\r\n\r\n /**\r\n * Marks the beginning of a new shape of the specified color. Should be ended with a call to endShape.\r\n * @param {string} color Fill color on format #xxxxxx.\r\n */\r\n beginShape(color) {\r\n this._path = this._pathsByColor[color] || (this._pathsByColor[color] = new SvgPath());\r\n }\r\n\r\n /**\r\n * Marks the end of the currently drawn shape.\r\n */\r\n endShape() { }\r\n\r\n /**\r\n * Adds a polygon with the current fill color to the SVG.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n this._path.addPolygon(points);\r\n }\r\n\r\n /**\r\n * Adds a circle with the current fill color to the SVG.\r\n * @param {Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n this._path.addCircle(point, diameter, counterClockwise);\r\n }\r\n\r\n /**\r\n * Called when the icon has been completely drawn.\r\n */\r\n finish() { \r\n const pathsByColor = this._pathsByColor;\r\n for (let color in pathsByColor) {\r\n // hasOwnProperty cannot be shadowed in pathsByColor\r\n // eslint-disable-next-line no-prototype-builtins\r\n if (pathsByColor.hasOwnProperty(color)) {\r\n this._target.appendPath(color, pathsByColor[color].dataString);\r\n }\r\n }\r\n }\r\n}\r\n","\r\nvar SvgRenderer__prototype = SvgRenderer.prototype;","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nexport const SVG_CONSTANTS = {\r\n XMLNS: \"http://www.w3.org/2000/svg\",\r\n WIDTH: \"width\",\r\n HEIGHT: \"height\",\r\n}","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { SVG_CONSTANTS } from \"./constants\";\r\n\r\n/**\r\n * Renderer producing SVG output.\r\n */\r\nexport class SvgWriter {\r\n /**\r\n * @param {number} iconSize - Icon width and height in pixels.\r\n */\r\n constructor(iconSize) {\r\n /**\r\n * @type {number}\r\n */\r\n this.iconSize = iconSize;\r\n\r\n /**\r\n * @type {string}\r\n * @private\r\n */\r\n this._s =\r\n '';\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb.\r\n * @param {number} opacity Opacity in the range [0.0, 1.0].\r\n */\r\n setBackground(fillColor, opacity) {\r\n if (opacity) {\r\n this._s += '';\r\n }\r\n }\r\n\r\n /**\r\n * Writes a path to the SVG string.\r\n * @param {string} color Fill color on format #rrggbb.\r\n * @param {string} dataString The SVG path data string.\r\n */\r\n appendPath(color, dataString) {\r\n this._s += '';\r\n }\r\n\r\n /**\r\n * Gets the rendered image as an SVG string.\r\n */\r\n toString() {\r\n return this._s + \"\";\r\n }\r\n}\r\n","\r\nvar SvgWriter__prototype = SvgWriter.prototype;","import { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { SvgRenderer } from \"../renderer/svg/svgRenderer\";\r\nimport { SvgWriter } from \"../renderer/svg/svgWriter\";\r\n\r\n/**\r\n * Draws an identicon as an SVG string.\r\n * @param {*} hashOrValue - A hexadecimal hash string or any value that will be hashed by Jdenticon.\r\n * @param {number} size - Icon size in pixels.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compatibility a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n * @returns {string} SVG string\r\n */\r\nexport function toSvg(hashOrValue, size, config) {\r\n const writer = new SvgWriter(size);\r\n iconGenerator(new SvgRenderer(writer), \r\n isValidHash(hashOrValue) || computeHash(hashOrValue),\r\n config);\r\n return writer.toString();\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { SVG_CONSTANTS } from \"./constants\";\r\n\r\n/**\r\n * Creates a new element and adds it to the specified parent.\r\n * @param {Element} parentNode\r\n * @param {string} name\r\n * @param {...(string|number)} keyValuePairs\r\n */\r\nfunction SvgElement_append(parentNode, name, ...keyValuePairs) {\r\n const el = document.createElementNS(SVG_CONSTANTS.XMLNS, name);\r\n \r\n for (let i = 0; i + 1 < keyValuePairs.length; i += 2) {\r\n el.setAttribute(\r\n /** @type {string} */(keyValuePairs[i]),\r\n /** @type {string} */(keyValuePairs[i + 1]),\r\n );\r\n }\r\n\r\n parentNode.appendChild(el);\r\n}\r\n\r\n\r\n/**\r\n * Renderer producing SVG output.\r\n */\r\nexport class SvgElement {\r\n /**\r\n * @param {Element} element - Target element\r\n */\r\n constructor(element) {\r\n // Don't use the clientWidth and clientHeight properties on SVG elements\r\n // since Firefox won't serve a proper value of these properties on SVG\r\n // elements (https://bugzilla.mozilla.org/show_bug.cgi?id=874811)\r\n // Instead use 100px as a hardcoded size (the svg viewBox will rescale \r\n // the icon to the correct dimensions)\r\n const iconSize = this.iconSize = Math.min(\r\n (Number(element.getAttribute(SVG_CONSTANTS.WIDTH)) || 100),\r\n (Number(element.getAttribute(SVG_CONSTANTS.HEIGHT)) || 100)\r\n );\r\n \r\n /**\r\n * @type {Element}\r\n * @private\r\n */\r\n this._el = element;\r\n \r\n // Clear current SVG child elements\r\n while (element.firstChild) {\r\n element.removeChild(element.firstChild);\r\n }\r\n \r\n // Set viewBox attribute to ensure the svg scales nicely.\r\n element.setAttribute(\"viewBox\", \"0 0 \" + iconSize + \" \" + iconSize);\r\n element.setAttribute(\"preserveAspectRatio\", \"xMidYMid meet\");\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb.\r\n * @param {number} opacity Opacity in the range [0.0, 1.0].\r\n */\r\n setBackground(fillColor, opacity) {\r\n if (opacity) {\r\n SvgElement_append(this._el, \"rect\",\r\n SVG_CONSTANTS.WIDTH, \"100%\",\r\n SVG_CONSTANTS.HEIGHT, \"100%\",\r\n \"fill\", fillColor,\r\n \"opacity\", opacity);\r\n }\r\n }\r\n\r\n /**\r\n * Appends a path to the SVG element.\r\n * @param {string} color Fill color on format #xxxxxx.\r\n * @param {string} dataString The SVG path data string.\r\n */\r\n appendPath(color, dataString) {\r\n SvgElement_append(this._el, \"path\",\r\n \"fill\", color,\r\n \"d\", dataString);\r\n }\r\n}\r\n","\r\nvar SvgElement__prototype = SvgElement.prototype;","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { ATTRIBUTES, ICON_SELECTOR, documentQuerySelectorAll } from \"../common/dom\";\r\nimport { SvgRenderer } from \"../renderer/svg/svgRenderer\";\r\nimport { SvgElement } from \"../renderer/svg/svgElement\";\r\nimport { CanvasRenderer } from \"../renderer/canvas/canvasRenderer\";\r\nimport { ICON_TYPE_CANVAS, ICON_TYPE_SVG, getIdenticonType } from \"../common/dom\";\r\n\r\n\r\n/**\r\n * Updates all canvas elements with the `data-jdenticon-hash` or `data-jdenticon-value` attribute.\r\n */\r\nexport function updateAll() {\r\n if (documentQuerySelectorAll) {\r\n update(ICON_SELECTOR);\r\n }\r\n}\r\n\r\n/**\r\n * Updates the identicon in the specified `` or `` elements.\r\n * @param {(string|Element)} el - Specifies the container in which the icon is rendered as a DOM element of the type\r\n * `` or ``, or a CSS selector to such an element.\r\n * @param {*=} hashOrValue - Optional hash or value to be rendered. If not specified, the `data-jdenticon-hash` or\r\n * `data-jdenticon-value` attribute will be evaluated.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compability a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function update(el, hashOrValue, config) {\r\n renderDomElement(el, hashOrValue, config, function (el, iconType) {\r\n if (iconType) {\r\n return iconType == ICON_TYPE_SVG ? \r\n new SvgRenderer(new SvgElement(el)) : \r\n new CanvasRenderer(/** @type {HTMLCanvasElement} */(el).getContext(\"2d\"));\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Updates the identicon in the specified `` elements.\r\n * @param {(string|Element)} el - Specifies the container in which the icon is rendered as a DOM element of the type\r\n * ``, or a CSS selector to such an element.\r\n * @param {*=} hashOrValue - Optional hash or value to be rendered. If not specified, the `data-jdenticon-hash` or\r\n * `data-jdenticon-value` attribute will be evaluated.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compability a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function updateCanvas(el, hashOrValue, config) {\r\n renderDomElement(el, hashOrValue, config, function (el, iconType) {\r\n if (iconType == ICON_TYPE_CANVAS) {\r\n return new CanvasRenderer(/** @type {HTMLCanvasElement} */(el).getContext(\"2d\"));\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Updates the identicon in the specified `` elements.\r\n * @param {(string|Element)} el - Specifies the container in which the icon is rendered as a DOM element of the type\r\n * ``, or a CSS selector to such an element.\r\n * @param {*=} hashOrValue - Optional hash or value to be rendered. If not specified, the `data-jdenticon-hash` or\r\n * `data-jdenticon-value` attribute will be evaluated.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compability a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function updateSvg(el, hashOrValue, config) {\r\n renderDomElement(el, hashOrValue, config, function (el, iconType) {\r\n if (iconType == ICON_TYPE_SVG) {\r\n return new SvgRenderer(new SvgElement(el));\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Updates the identicon in the specified canvas or svg elements.\r\n * @param {(string|Element)} el - Specifies the container in which the icon is rendered as a DOM element of the type\r\n * `` or ``, or a CSS selector to such an element.\r\n * @param {*} hashOrValue - Optional hash or value to be rendered. If not specified, the `data-jdenticon-hash` or\r\n * `data-jdenticon-value` attribute will be evaluated.\r\n * @param {Object|number|undefined} config\r\n * @param {function(Element,number):import(\"../renderer/renderer\").Renderer} rendererFactory - Factory function for creating an icon renderer.\r\n */\r\nfunction renderDomElement(el, hashOrValue, config, rendererFactory) {\r\n if (typeof el === \"string\") {\r\n if (documentQuerySelectorAll) {\r\n const elements = documentQuerySelectorAll(el);\r\n for (let i = 0; i < elements.length; i++) {\r\n renderDomElement(elements[i], hashOrValue, config, rendererFactory);\r\n }\r\n }\r\n return;\r\n }\r\n \r\n // Hash selection. The result from getValidHash or computeHash is \r\n // accepted as a valid hash.\r\n const hash = \r\n // 1. Explicit valid hash\r\n isValidHash(hashOrValue) ||\r\n \r\n // 2. Explicit value (`!= null` catches both null and undefined)\r\n hashOrValue != null && computeHash(hashOrValue) ||\r\n \r\n // 3. `data-jdenticon-hash` attribute\r\n isValidHash(el.getAttribute(ATTRIBUTES.HASH)) ||\r\n \r\n // 4. `data-jdenticon-value` attribute. \r\n // We want to treat an empty attribute as an empty value. \r\n // Some browsers return empty string even if the attribute \r\n // is not specified, so use hasAttribute to determine if \r\n // the attribute is specified.\r\n el.hasAttribute(ATTRIBUTES.VALUE) && computeHash(el.getAttribute(ATTRIBUTES.VALUE));\r\n \r\n if (!hash) {\r\n // No hash specified. Don't render an icon.\r\n return;\r\n }\r\n \r\n const renderer = rendererFactory(el, getIdenticonType(el));\r\n if (renderer) {\r\n // Draw icon\r\n iconGenerator(renderer, hash, config);\r\n }\r\n}\r\n","import { update } from \"./update\";\r\n\r\n/**\r\n * Renders an identicon for all matching supported elements.\r\n * \r\n * @param {*} hashOrValue - A hexadecimal hash string or any value that will be hashed by Jdenticon. If not \r\n * specified the `data-jdenticon-hash` and `data-jdenticon-value` attributes of each element will be\r\n * evaluated.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any global\r\n * configuration in its entirety. For backward compatibility a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function jdenticonJqueryPlugin(hashOrValue, config) {\r\n this[\"each\"](function (index, el) {\r\n update(el, hashOrValue, config);\r\n });\r\n return this;\r\n}","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n// This file is compiled to dist/jdenticon.js and dist/jdenticon.min.js\r\n\r\nimport { CONFIG_PROPERTIES, defineConfigProperty } from \"./common/configuration\";\r\nimport { observer } from \"./common/observer\";\r\nimport { configure } from \"./apis/configure\";\r\nimport { drawIcon } from \"./apis/drawIcon\";\r\nimport { toSvg } from \"./apis/toSvg\";\r\nimport { update, updateAll } from \"./apis/update\";\r\nimport { jdenticonJqueryPlugin } from \"./apis/jquery\";\r\nimport { GLOBAL } from \"./common/global\";\r\n\r\nconst jdenticon = updateAll;\r\n\r\ndefineConfigProperty(jdenticon);\r\n\r\n// Export public API\r\njdenticon[\"configure\"] = configure;\r\njdenticon[\"drawIcon\"] = drawIcon;\r\njdenticon[\"toSvg\"] = toSvg;\r\njdenticon[\"update\"] = update;\r\njdenticon[\"updateCanvas\"] = update;\r\njdenticon[\"updateSvg\"] = update;\r\n\r\n/**\r\n * Specifies the version of the Jdenticon package in use.\r\n * @type {string}\r\n */\r\njdenticon[\"version\"] = \"#version#\";\r\n\r\n/**\r\n * Specifies which bundle of Jdenticon that is used.\r\n * @type {string}\r\n */\r\njdenticon[\"bundle\"] = \"browser-umd\";\r\n\r\n// Basic jQuery plugin\r\nconst jQuery = GLOBAL[\"jQuery\"];\r\nif (jQuery) {\r\n jQuery[\"fn\"][\"jdenticon\"] = jdenticonJqueryPlugin;\r\n}\r\n\r\n/**\r\n * This function is called once upon page load.\r\n */\r\nfunction jdenticonStartup() {\r\n const replaceMode = (\r\n jdenticon[CONFIG_PROPERTIES.MODULE] ||\r\n GLOBAL[CONFIG_PROPERTIES.GLOBAL] ||\r\n { }\r\n )[\"replaceMode\"];\r\n \r\n if (replaceMode != \"never\") {\r\n updateAll();\r\n \r\n if (replaceMode == \"observe\") {\r\n observer(update);\r\n }\r\n }\r\n}\r\n\r\n// Schedule to render all identicons on the page once it has been loaded.\r\nif (typeof setTimeout === \"function\") {\r\n setTimeout(jdenticonStartup, 0);\r\n}\r\n\r\nmodule.exports = jdenticon;\r\n"]} \ No newline at end of file +{"version":3,"sources":["replacement/8","replacement/7","src/common/parseHex.js","src/renderer/color.js","src/common/global.umd.js","src/common/configuration.js","src/common/dom.js","src/common/observer.js","src/renderer/point.js","src/renderer/transform.js","src/renderer/graphics.js","replacement/1","src/renderer/shapes.js","src/renderer/colorTheme.js","src/renderer/iconGenerator.js","src/common/sha1.js","src/common/hashUtils.js","src/renderer/canvas/canvasRenderer.js","replacement/2","src/apis/drawIcon.js","src/renderer/svg/svgPath.js","replacement/3","src/renderer/svg/svgRenderer.js","replacement/4","src/renderer/svg/constants.js","src/renderer/svg/svgWriter.js","replacement/5","src/apis/toSvg.js","src/renderer/svg/svgElement.js","replacement/6","src/apis/update.js","src/apis/jquery.js","src/browser-umd.js"],"names":["umdGlobal","factory","jdenticon","parseHex","hash","startPosition","octets","parseInt","substr","decToHex","v","toString","hueToRgb","m1","m2","h","parseColor","color","test","let","result","colorLength","length","const","r","g","b","a","toCss3Color","hexColor","isNaN","toFixed","hsl","hue","saturation","lightness","partialHex","correctedHsl","corrector","GLOBAL","CONFIG_PROPERTIES","MODULE","rootConfigurationHolder","defineConfigProperty","rootObject","configure","newConfiguration","arguments","getConfiguration","paddingOrLocalConfig","defaultPadding","configObject","lightnessConfig","colorSaturation","grayscaleSaturation","backColor","padding","configName","defaultRange","range","value","hueFunction","originalHue","hueConfig","colorLightness","grayscaleLightness","iconPadding","ICON_TYPE_SVG","ICON_TYPE_CANVAS","ATTRIBUTES","HASH","VALUE","ICON_SELECTOR","documentQuerySelectorAll","document","querySelectorAll","bind","getIdenticonType","el","tagName","observer","updateCallback","MutationObserver","mutations","mutationIndex","mutation","addedNodes","addedNodeIndex","addedNode","nodeType","icons","iconIndex","type","target","observe","body","childList","attributes","attributeFilter","subtree","Point","x","y","this","Transform","size","rotation","_x","_y","_size","_rotation","prototype","transformIconPoint","w","right","bottom","NO_TRANSFORM","Graphics","renderer","_renderer","currentTransform","Graphics__prototype","centerShape","index","cell","positionIndex","k","m","inner","outer","addTriangle","addRectangle","addCircle","addPolygon","addRhombus","outerShape","colorTheme","config","iconGenerator","parsedConfig","setBackground","iconSize","graphics","renderShape","colorIndex","shapes","rotationIndex","positions","shapeIndex","beginShape","availableColors","selectedColorIndexes","i","endShape","isDuplicate","values","indexOf","push","finish","sha1","message","dataSize","HASH_SIZE_HALF_BYTES","BLOCK_SIZE_WORDS","f","urlEncodedMessage","encodeURI","data","hashBuffer","c","d","e","blockStartIndex","hexHash","rotl","shift","substring","charCodeAt","isValidHash","hashCandidate","computeHash","CanvasRenderer","ctx","canvas","width","height","save","Math","min","translate","_ctx","clearRect","points","invert","di","transformedPoints","p","splice","CanvasRenderer__prototype","drawIcon","hashOrValue","Error","svgValue","SvgPath","dataString","fillColor","fillStyle","fillRect","beginPath","fill","moveTo","lineTo","closePath","point","diameter","counterClockwise","radius","arc","PI","restore","SvgPath__prototype","SvgRenderer","_path","_pathsByColor","_target","sweepFlag","svgRadius","svgDiameter","svgArc","SvgRenderer__prototype","match","exec","opacity","pathsByColor","hasOwnProperty","this$1","appendPath","SVG_CONSTANTS","XMLNS","WIDTH","HEIGHT","SvgWriter","_s","SvgWriter__prototype","toSvg","writer","SvgElement_append","parentNode","name","createElementNS","keyValuePairs","setAttribute","appendChild","SvgElement","element","Number","getAttribute","_el","firstChild","removeChild","SvgElement__prototype","updateAll","update","renderDomElement","iconType","getContext","rendererFactory","hasAttribute","elements","jdenticonJqueryPlugin","jQuery","jdenticonStartup","replaceMode","setTimeout","module","define","self"],"mappings":"AAAA;CC6BA,SAAAA,EAAAC,GACA,IAAAC,EAcA,SAAAF,gBCjCO,SAASG,EAASC,EAAMC,EAAeC,GAC1C,OAAOC,SAASH,EAAKI,OAAOH,EAAeC,GA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AI/C,OAHAlC,KAAW,MAAE,SAAUoB,EAAO7C,GAC1BwL,EAAOxL,EAAI0H,EAAa/D,MAErBlC,KHmDX6J,EAAIxH,EAAa,SAACiE,EAAW2B,GACjBA,GACZc,EAA8B/I,KAAK0J,EAAK,OACxCpB,EAA8BE,EAAO,OACrCF,EAA8BG,EAAQ,OACtC,OAAwBnC,EACxB,UAA2B2B,IAS3B4B,EAAIxB,EAAU,SAAC3N,EAAO2L,GACtB0C,EAA0B/I,KAAK0J,EAAK,OACpC,OAAoBhP,EACpB,IAAiB2L,IIpEjBrL,IAAMrB,EAAYmQ,EAElB1N,EAAqBzC,GAGrBA,EAAqB,UAAI2C,EACzB3C,EAAoB,SAAIqM,EACxBrM,EAAiB,MAAIkP,EACrBlP,EAAkB,OAAIoQ,EACtBpQ,EAAwB,aAAIoQ,EAC5BpQ,EAAqB,UAAIoQ,EAMzBpQ,EAAmB,QAAI,QAMvBA,EAAkB,OAAI,cAGtBqB,IAAMuP,EAASvO,EAAe,OAC1BuO,IACAA,EAAW,GAAa,UAAID,GAMhC,SAASE,KACLxP,IAAMyP,GACF9Q,EAAUsC,EAAkBC,IAC5BF,EAAOC,EAAkBD,IACzB,IACW,YAEI,SAAfyO,IACAX,IAEmB,WAAfW,GACAhM,EAASsL,IAMK,mBAAfW,YACPA,WAAWF,GAAkB,GAGjC,OAAiB7Q,E/BzCjBD,CAAAD,GAGA,oBAAAkR,QAAA,YAAAA,OACAA,OAAA,QAAAhR,EAGA,mBAAAiR,QAAAA,OAAA,IACAA,OAAA,IAAA,WAAA,OAAAjR,KAIAF,EAAA,UAAAE,EAbA,CAeA,oBAAAkR,KAAAA,KAAA7K","file":"jdenticon.min.js","sourcesContent":["// Jdenticon 3.1.1 | jdenticon.com | MIT licensed | (c) 2014-2021 Daniel Mester Pirttijärvi\r\n","/**\r\n * Jdenticon 3.1.1\r\n * http://jdenticon.com\r\n * \r\n * Built: 2021-08-14T17:50:52.207Z\r\n *\r\n * MIT License\r\n * \r\n * Copyright (c) 2014-2020 Daniel Mester Pirttijärvi\r\n * \r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n * \r\n * The above copyright notice and this permission notice shall be included in all\r\n * copies or substantial portions of the Software.\r\n * \r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\n * SOFTWARE.\r\n */\r\n\r\n(function (umdGlobal, factory) {\r\n var jdenticon = factory(umdGlobal);\r\n\r\n // Node.js\r\n if (typeof module !== \"undefined\" && \"exports\" in module) {\r\n module[\"exports\"] = jdenticon;\r\n }\r\n // RequireJS\r\n else if (typeof define === \"function\" && define[\"amd\"]) {\r\n define([], function () { return jdenticon; });\r\n }\r\n // No module loader\r\n else {\r\n umdGlobal[\"jdenticon\"] = jdenticon;\r\n }\r\n})(typeof self !== \"undefined\" ? self : this, function (umdGlobal) {\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Parses a substring of the hash as a number.\r\n * @param {number} startPosition \r\n * @param {number=} octets\r\n */\r\nexport function parseHex(hash, startPosition, octets) {\r\n return parseInt(hash.substr(startPosition, octets), 16);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { parseHex } from \"../common/parseHex\";\r\n\r\nfunction decToHex(v) {\r\n v |= 0; // Ensure integer value\r\n return v < 0 ? \"00\" :\r\n v < 16 ? \"0\" + v.toString(16) :\r\n v < 256 ? v.toString(16) :\r\n \"ff\";\r\n}\r\n\r\nfunction hueToRgb(m1, m2, h) {\r\n h = h < 0 ? h + 6 : h > 6 ? h - 6 : h;\r\n return decToHex(255 * (\r\n h < 1 ? m1 + (m2 - m1) * h :\r\n h < 3 ? m2 :\r\n h < 4 ? m1 + (m2 - m1) * (4 - h) :\r\n m1));\r\n}\r\n\r\n/**\r\n * @param {number} r Red channel [0, 255]\r\n * @param {number} g Green channel [0, 255]\r\n * @param {number} b Blue channel [0, 255]\r\n */\r\nexport function rgb(r, g, b) {\r\n return \"#\" + decToHex(r) + decToHex(g) + decToHex(b);\r\n}\r\n\r\n/**\r\n * @param {string} color Color value to parse. Currently hexadecimal strings on the format #rgb[a] and #rrggbb[aa] are supported.\r\n * @returns {string}\r\n */\r\nexport function parseColor(color) {\r\n if (/^#[0-9a-f]{3,8}$/i.test(color)) {\r\n let result;\r\n const colorLength = color.length;\r\n\r\n if (colorLength < 6) {\r\n const r = color[1],\r\n g = color[2],\r\n b = color[3],\r\n a = color[4] || \"\";\r\n result = \"#\" + r + r + g + g + b + b + a + a;\r\n }\r\n if (colorLength == 7 || colorLength > 8) {\r\n result = color;\r\n }\r\n \r\n return result;\r\n }\r\n}\r\n\r\n/**\r\n * Converts a hexadecimal color to a CSS3 compatible color.\r\n * @param {string} hexColor Color on the format \"#RRGGBB\" or \"#RRGGBBAA\"\r\n * @returns {string}\r\n */\r\nexport function toCss3Color(hexColor) {\r\n const a = parseHex(hexColor, 7, 2);\r\n let result;\r\n\r\n if (isNaN(a)) {\r\n result = hexColor;\r\n } else {\r\n const r = parseHex(hexColor, 1, 2),\r\n g = parseHex(hexColor, 3, 2),\r\n b = parseHex(hexColor, 5, 2);\r\n result = \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + (a / 255).toFixed(2) + \")\";\r\n }\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * Converts an HSL color to a hexadecimal RGB color.\r\n * @param {number} hue Hue in range [0, 1]\r\n * @param {number} saturation Saturation in range [0, 1]\r\n * @param {number} lightness Lightness in range [0, 1]\r\n * @returns {string}\r\n */\r\nexport function hsl(hue, saturation, lightness) {\r\n // Based on http://www.w3.org/TR/2011/REC-css3-color-20110607/#hsl-color\r\n let result;\r\n\r\n if (saturation == 0) {\r\n const partialHex = decToHex(lightness * 255);\r\n result = partialHex + partialHex + partialHex;\r\n }\r\n else {\r\n const m2 = lightness <= 0.5 ? lightness * (saturation + 1) : lightness + saturation - lightness * saturation,\r\n m1 = lightness * 2 - m2;\r\n result =\r\n hueToRgb(m1, m2, hue * 6 + 2) +\r\n hueToRgb(m1, m2, hue * 6) +\r\n hueToRgb(m1, m2, hue * 6 - 2);\r\n }\r\n\r\n return \"#\" + result;\r\n}\r\n\r\n/**\r\n * Converts an HSL color to a hexadecimal RGB color. This function will correct the lightness for the \"dark\" hues\r\n * @param {number} hue Hue in range [0, 1]\r\n * @param {number} saturation Saturation in range [0, 1]\r\n * @param {number} lightness Lightness in range [0, 1]\r\n * @returns {string}\r\n */\r\nexport function correctedHsl(hue, saturation, lightness) {\r\n // The corrector specifies the perceived middle lightness for each hue\r\n const correctors = [ 0.55, 0.5, 0.5, 0.46, 0.6, 0.55, 0.55 ],\r\n corrector = correctors[(hue * 6 + 0.5) | 0];\r\n \r\n // Adjust the input lightness relative to the corrector\r\n lightness = lightness < 0.5 ? lightness * corrector * 2 : corrector + (lightness - 0.5) * (1 - corrector) * 2;\r\n \r\n return hsl(hue, saturation, lightness);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n/* global umdGlobal */\r\n\r\n// In the future we can replace `GLOBAL` with `globalThis`, but for now use the old school global detection for\r\n// backward compatibility.\r\nexport const GLOBAL = umdGlobal;\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { parseColor } from \"../renderer/color\";\r\nimport { GLOBAL } from \"./global\";\r\n\r\n/**\r\n * @typedef {Object} ParsedConfiguration\r\n * @property {number} colorSaturation\r\n * @property {number} grayscaleSaturation\r\n * @property {string} backColor\r\n * @property {number} iconPadding\r\n * @property {function(number):number} hue\r\n * @property {function(number):number} colorLightness\r\n * @property {function(number):number} grayscaleLightness\r\n */\r\n\r\nexport const CONFIG_PROPERTIES = {\r\n GLOBAL: \"jdenticon_config\",\r\n MODULE: \"config\",\r\n};\r\n\r\nvar rootConfigurationHolder = {};\r\n\r\n/**\r\n * Defines the deprecated `config` property on the root Jdenticon object. When the property is set a warning is \r\n * printed in the console. To minimize bundle size, this is only used in Node bundles.\r\n * @param {!Object} rootObject \r\n */\r\nexport function defineConfigPropertyWithWarn(rootObject) {\r\n Object.defineProperty(rootObject, CONFIG_PROPERTIES.MODULE, {\r\n configurable: true,\r\n get: () => rootConfigurationHolder[CONFIG_PROPERTIES.MODULE],\r\n set: newConfiguration => {\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] = newConfiguration;\r\n console.warn(\"jdenticon.config is deprecated. Use jdenticon.configure() instead.\");\r\n },\r\n });\r\n}\r\n\r\n/**\r\n * Defines the deprecated `config` property on the root Jdenticon object without printing a warning in the console\r\n * when it is being used.\r\n * @param {!Object} rootObject \r\n */\r\nexport function defineConfigProperty(rootObject) {\r\n rootConfigurationHolder = rootObject;\r\n}\r\n\r\n/**\r\n * Sets a new icon style configuration. The new configuration is not merged with the previous one. * \r\n * @param {Object} newConfiguration - New configuration object.\r\n */\r\nexport function configure(newConfiguration) {\r\n if (arguments.length) {\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] = newConfiguration;\r\n }\r\n return rootConfigurationHolder[CONFIG_PROPERTIES.MODULE];\r\n}\r\n\r\n/**\r\n * Gets the normalized current Jdenticon color configuration. Missing fields have default values.\r\n * @param {Object|number|undefined} paddingOrLocalConfig - Configuration passed to the called API method. A\r\n * local configuration overrides the global configuration in it entirety. This parameter can for backward\r\n * compatibility also contain a padding value. A padding value only overrides the global padding, not the\r\n * entire global configuration.\r\n * @param {number} defaultPadding - Padding used if no padding is specified in neither the configuration nor\r\n * explicitly to the API method.\r\n * @returns {ParsedConfiguration}\r\n */\r\nexport function getConfiguration(paddingOrLocalConfig, defaultPadding) {\r\n const configObject = \r\n typeof paddingOrLocalConfig == \"object\" && paddingOrLocalConfig ||\r\n rootConfigurationHolder[CONFIG_PROPERTIES.MODULE] ||\r\n GLOBAL[CONFIG_PROPERTIES.GLOBAL] ||\r\n { },\r\n\r\n lightnessConfig = configObject[\"lightness\"] || { },\r\n \r\n // In versions < 2.1.0 there was no grayscale saturation -\r\n // saturation was the color saturation.\r\n saturation = configObject[\"saturation\"] || { },\r\n colorSaturation = \"color\" in saturation ? saturation[\"color\"] : saturation,\r\n grayscaleSaturation = saturation[\"grayscale\"],\r\n\r\n backColor = configObject[\"backColor\"],\r\n padding = configObject[\"padding\"];\r\n \r\n /**\r\n * Creates a lightness range.\r\n */\r\n function lightness(configName, defaultRange) {\r\n let range = lightnessConfig[configName];\r\n \r\n // Check if the lightness range is an array-like object. This way we ensure the\r\n // array contain two values at the same time.\r\n if (!(range && range.length > 1)) {\r\n range = defaultRange;\r\n }\r\n\r\n /**\r\n * Gets a lightness relative the specified value in the specified lightness range.\r\n */\r\n return function (value) {\r\n value = range[0] + value * (range[1] - range[0]);\r\n return value < 0 ? 0 : value > 1 ? 1 : value;\r\n };\r\n }\r\n\r\n /**\r\n * Gets a hue allowed by the configured hue restriction,\r\n * provided the originally computed hue.\r\n */\r\n function hueFunction(originalHue) {\r\n const hueConfig = configObject[\"hues\"];\r\n let hue;\r\n \r\n // Check if 'hues' is an array-like object. This way we also ensure that\r\n // the array is not empty, which would mean no hue restriction.\r\n if (hueConfig && hueConfig.length > 0) {\r\n // originalHue is in the range [0, 1]\r\n // Multiply with 0.999 to change the range to [0, 1) and then truncate the index.\r\n hue = hueConfig[0 | (0.999 * originalHue * hueConfig.length)];\r\n }\r\n\r\n return typeof hue == \"number\" ?\r\n \r\n // A hue was specified. We need to convert the hue from\r\n // degrees on any turn - e.g. 746° is a perfectly valid hue -\r\n // to turns in the range [0, 1).\r\n ((((hue / 360) % 1) + 1) % 1) :\r\n\r\n // No hue configured => use original hue\r\n originalHue;\r\n }\r\n \r\n return {\r\n hue: hueFunction,\r\n colorSaturation: typeof colorSaturation == \"number\" ? colorSaturation : 0.5,\r\n grayscaleSaturation: typeof grayscaleSaturation == \"number\" ? grayscaleSaturation : 0,\r\n colorLightness: lightness(\"color\", [0.4, 0.8]),\r\n grayscaleLightness: lightness(\"grayscale\", [0.3, 0.9]),\r\n backColor: parseColor(backColor),\r\n iconPadding: \r\n typeof paddingOrLocalConfig == \"number\" ? paddingOrLocalConfig : \r\n typeof padding == \"number\" ? padding : \r\n defaultPadding\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nexport const ICON_TYPE_SVG = 1;\r\n\r\nexport const ICON_TYPE_CANVAS = 2;\r\n\r\nexport const ATTRIBUTES = {\r\n HASH: \"data-jdenticon-hash\",\r\n VALUE: \"data-jdenticon-value\"\r\n};\r\n\r\nexport const ICON_SELECTOR = \"[\" + ATTRIBUTES.HASH +\"],[\" + ATTRIBUTES.VALUE +\"]\";\r\n\r\nexport const documentQuerySelectorAll = /** @type {!Function} */ (\r\n typeof document !== \"undefined\" && document.querySelectorAll.bind(document));\r\n\r\nexport function getIdenticonType(el) {\r\n if (el) {\r\n const tagName = el[\"tagName\"];\r\n\r\n if (/^svg$/i.test(tagName)) {\r\n return ICON_TYPE_SVG;\r\n }\r\n\r\n if (/^canvas$/i.test(tagName) && \"getContext\" in el) {\r\n return ICON_TYPE_CANVAS;\r\n }\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { ATTRIBUTES, ICON_SELECTOR, getIdenticonType } from \"./dom\";\r\n\r\nexport function observer(updateCallback) {\r\n if (typeof MutationObserver != \"undefined\") {\r\n const mutationObserver = new MutationObserver(function onmutation(mutations) {\r\n for (let mutationIndex = 0; mutationIndex < mutations.length; mutationIndex++) {\r\n const mutation = mutations[mutationIndex];\r\n const addedNodes = mutation.addedNodes;\r\n \r\n for (let addedNodeIndex = 0; addedNodes && addedNodeIndex < addedNodes.length; addedNodeIndex++) {\r\n const addedNode = addedNodes[addedNodeIndex];\r\n \r\n // Skip other types of nodes than element nodes, since they might not support\r\n // the querySelectorAll method => runtime error.\r\n if (addedNode.nodeType == Node.ELEMENT_NODE) {\r\n if (getIdenticonType(addedNode)) {\r\n updateCallback(addedNode);\r\n }\r\n else {\r\n const icons = /** @type {Element} */(addedNode).querySelectorAll(ICON_SELECTOR);\r\n for (let iconIndex = 0; iconIndex < icons.length; iconIndex++) {\r\n updateCallback(icons[iconIndex]);\r\n }\r\n }\r\n }\r\n }\r\n \r\n if (mutation.type == \"attributes\" && getIdenticonType(mutation.target)) {\r\n updateCallback(mutation.target);\r\n }\r\n }\r\n });\r\n\r\n mutationObserver.observe(document.body, {\r\n \"childList\": true,\r\n \"attributes\": true,\r\n \"attributeFilter\": [ATTRIBUTES.VALUE, ATTRIBUTES.HASH, \"width\", \"height\"],\r\n \"subtree\": true,\r\n });\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Represents a point.\r\n */\r\nexport class Point {\r\n /**\r\n * @param {number} x \r\n * @param {number} y \r\n */\r\n constructor(x, y) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { Point } from \"./point\";\r\n\r\n/**\r\n * Translates and rotates a point before being passed on to the canvas context. This was previously done by the canvas context itself, \r\n * but this caused a rendering issue in Chrome on sizes > 256 where the rotation transformation of inverted paths was not done properly.\r\n */\r\nexport class Transform {\r\n /**\r\n * @param {number} x The x-coordinate of the upper left corner of the transformed rectangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the transformed rectangle.\r\n * @param {number} size The size of the transformed rectangle.\r\n * @param {number} rotation Rotation specified as 0 = 0 rad, 1 = 0.5π rad, 2 = π rad, 3 = 1.5π rad\r\n */\r\n constructor(x, y, size, rotation) {\r\n this._x = x;\r\n this._y = y;\r\n this._size = size;\r\n this._rotation = rotation;\r\n }\r\n\r\n /**\r\n * Transforms the specified point based on the translation and rotation specification for this Transform.\r\n * @param {number} x x-coordinate\r\n * @param {number} y y-coordinate\r\n * @param {number=} w The width of the transformed rectangle. If greater than 0, this will ensure the returned point is of the upper left corner of the transformed rectangle.\r\n * @param {number=} h The height of the transformed rectangle. If greater than 0, this will ensure the returned point is of the upper left corner of the transformed rectangle.\r\n */\r\n transformIconPoint(x, y, w, h) {\r\n const right = this._x + this._size,\r\n bottom = this._y + this._size,\r\n rotation = this._rotation;\r\n return rotation === 1 ? new Point(right - y - (h || 0), this._y + x) :\r\n rotation === 2 ? new Point(right - x - (w || 0), bottom - y - (h || 0)) :\r\n rotation === 3 ? new Point(this._x + y, bottom - x - (w || 0)) :\r\n new Point(this._x + x, this._y + y);\r\n }\r\n}\r\n\r\nexport const NO_TRANSFORM = new Transform(0, 0, 0, 0);\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { NO_TRANSFORM } from \"./transform\";\r\n\r\n/**\r\n * @typedef {import(\"./renderer\").Renderer} Renderer\r\n * @typedef {import(\"./transform\").Transform} Transform\r\n */\r\n\r\n/**\r\n * Provides helper functions for rendering common basic shapes.\r\n */\r\nexport class Graphics {\r\n /**\r\n * @param {Renderer} renderer \r\n */\r\n constructor(renderer) {\r\n /**\r\n * @type {Renderer}\r\n * @private\r\n */\r\n this._renderer = renderer;\r\n\r\n /**\r\n * @type {Transform}\r\n */\r\n this.currentTransform = NO_TRANSFORM;\r\n }\r\n\r\n /**\r\n * Adds a polygon to the underlying renderer.\r\n * @param {Array} points The points of the polygon clockwise on the format [ x0, y0, x1, y1, ..., xn, yn ]\r\n * @param {boolean=} invert Specifies if the polygon will be inverted.\r\n */\r\n addPolygon(points, invert) {\r\n const di = invert ? -2 : 2,\r\n transformedPoints = [];\r\n \r\n for (let i = invert ? points.length - 2 : 0; i < points.length && i >= 0; i += di) {\r\n transformedPoints.push(this.currentTransform.transformIconPoint(points[i], points[i + 1]));\r\n }\r\n \r\n this._renderer.addPolygon(transformedPoints);\r\n }\r\n \r\n /**\r\n * Adds a polygon to the underlying renderer.\r\n * Source: http://stackoverflow.com/a/2173084\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the entire ellipse.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the entire ellipse.\r\n * @param {number} size The size of the ellipse.\r\n * @param {boolean=} invert Specifies if the ellipse will be inverted.\r\n */\r\n addCircle(x, y, size, invert) {\r\n const p = this.currentTransform.transformIconPoint(x, y, size, size);\r\n this._renderer.addCircle(p, size, invert);\r\n }\r\n\r\n /**\r\n * Adds a rectangle to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle.\r\n * @param {number} w The width of the rectangle.\r\n * @param {number} h The height of the rectangle.\r\n * @param {boolean=} invert Specifies if the rectangle will be inverted.\r\n */\r\n addRectangle(x, y, w, h, invert) {\r\n this.addPolygon([\r\n x, y, \r\n x + w, y,\r\n x + w, y + h,\r\n x, y + h\r\n ], invert);\r\n }\r\n\r\n /**\r\n * Adds a right triangle to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the triangle.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the triangle.\r\n * @param {number} w The width of the triangle.\r\n * @param {number} h The height of the triangle.\r\n * @param {number} r The rotation of the triangle (clockwise). 0 = right corner of the triangle in the lower left corner of the bounding rectangle.\r\n * @param {boolean=} invert Specifies if the triangle will be inverted.\r\n */\r\n addTriangle(x, y, w, h, r, invert) {\r\n const points = [\r\n x + w, y, \r\n x + w, y + h, \r\n x, y + h,\r\n x, y\r\n ];\r\n points.splice(((r || 0) % 4) * 2, 2);\r\n this.addPolygon(points, invert);\r\n }\r\n\r\n /**\r\n * Adds a rhombus to the underlying renderer.\r\n * @param {number} x The x-coordinate of the upper left corner of the rectangle holding the rhombus.\r\n * @param {number} y The y-coordinate of the upper left corner of the rectangle holding the rhombus.\r\n * @param {number} w The width of the rhombus.\r\n * @param {number} h The height of the rhombus.\r\n * @param {boolean=} invert Specifies if the rhombus will be inverted.\r\n */\r\n addRhombus(x, y, w, h, invert) {\r\n this.addPolygon([\r\n x + w / 2, y,\r\n x + w, y + h / 2,\r\n x + w / 2, y + h,\r\n x, y + h / 2\r\n ], invert);\r\n }\r\n}","\r\nvar Graphics__prototype = Graphics.prototype;","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * @param {number} index\r\n * @param {Graphics} g\r\n * @param {number} cell\r\n * @param {number} positionIndex\r\n * @typedef {import('./graphics').Graphics} Graphics\r\n */\r\nexport function centerShape(index, g, cell, positionIndex) {\r\n index = index % 14;\r\n\r\n let k, m, w, h, inner, outer;\r\n\r\n !index ? (\r\n k = cell * 0.42,\r\n g.addPolygon([\r\n 0, 0,\r\n cell, 0,\r\n cell, cell - k * 2,\r\n cell - k, cell,\r\n 0, cell\r\n ])) :\r\n\r\n index == 1 ? (\r\n w = 0 | (cell * 0.5), \r\n h = 0 | (cell * 0.8),\r\n\r\n g.addTriangle(cell - w, 0, w, h, 2)) :\r\n\r\n index == 2 ? (\r\n w = 0 | (cell / 3),\r\n g.addRectangle(w, w, cell - w, cell - w)) :\r\n\r\n index == 3 ? (\r\n inner = cell * 0.1,\r\n // Use fixed outer border widths in small icons to ensure the border is drawn\r\n outer = \r\n cell < 6 ? 1 :\r\n cell < 8 ? 2 :\r\n (0 | (cell * 0.25)),\r\n \r\n inner = \r\n inner > 1 ? (0 | inner) : // large icon => truncate decimals\r\n inner > 0.5 ? 1 : // medium size icon => fixed width\r\n inner, // small icon => anti-aliased border\r\n\r\n g.addRectangle(outer, outer, cell - inner - outer, cell - inner - outer)) :\r\n\r\n index == 4 ? (\r\n m = 0 | (cell * 0.15),\r\n w = 0 | (cell * 0.5),\r\n g.addCircle(cell - w - m, cell - w - m, w)) :\r\n\r\n index == 5 ? (\r\n inner = cell * 0.1,\r\n outer = inner * 4,\r\n\r\n // Align edge to nearest pixel in large icons\r\n outer > 3 && (outer = 0 | outer),\r\n \r\n g.addRectangle(0, 0, cell, cell),\r\n g.addPolygon([\r\n outer, outer,\r\n cell - inner, outer,\r\n outer + (cell - outer - inner) / 2, cell - inner\r\n ], true)) :\r\n\r\n index == 6 ? \r\n g.addPolygon([\r\n 0, 0,\r\n cell, 0,\r\n cell, cell * 0.7,\r\n cell * 0.4, cell * 0.4,\r\n cell * 0.7, cell,\r\n 0, cell\r\n ]) :\r\n\r\n index == 7 ? \r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 3) :\r\n\r\n index == 8 ? (\r\n g.addRectangle(0, 0, cell, cell / 2),\r\n g.addRectangle(0, cell / 2, cell / 2, cell / 2),\r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 1)) :\r\n\r\n index == 9 ? (\r\n inner = cell * 0.14,\r\n // Use fixed outer border widths in small icons to ensure the border is drawn\r\n outer = \r\n cell < 4 ? 1 :\r\n cell < 6 ? 2 :\r\n (0 | (cell * 0.35)),\r\n\r\n inner = \r\n cell < 8 ? inner : // small icon => anti-aliased border\r\n (0 | inner), // large icon => truncate decimals\r\n\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addRectangle(outer, outer, cell - outer - inner, cell - outer - inner, true)) :\r\n\r\n index == 10 ? (\r\n inner = cell * 0.12,\r\n outer = inner * 3,\r\n\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addCircle(outer, outer, cell - inner - outer, true)) :\r\n\r\n index == 11 ? \r\n g.addTriangle(cell / 2, cell / 2, cell / 2, cell / 2, 3) :\r\n\r\n index == 12 ? (\r\n m = cell * 0.25,\r\n g.addRectangle(0, 0, cell, cell),\r\n g.addRhombus(m, m, cell - m, cell - m, true)) :\r\n\r\n // 13\r\n (\r\n !positionIndex && (\r\n m = cell * 0.4, w = cell * 1.2,\r\n g.addCircle(m, m, w)\r\n )\r\n );\r\n}\r\n\r\n/**\r\n * @param {number} index\r\n * @param {Graphics} g\r\n * @param {number} cell\r\n */\r\nexport function outerShape(index, g, cell) {\r\n index = index % 4;\r\n\r\n let m;\r\n\r\n !index ?\r\n g.addTriangle(0, 0, cell, cell, 0) :\r\n \r\n index == 1 ?\r\n g.addTriangle(0, cell / 2, cell, cell / 2, 0) :\r\n\r\n index == 2 ?\r\n g.addRhombus(0, 0, cell, cell) :\r\n\r\n // 3\r\n (\r\n m = cell / 6,\r\n g.addCircle(m, m, cell - 2 * m)\r\n );\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { correctedHsl } from \"./color\";\r\n\r\n/**\r\n * Gets a set of identicon color candidates for a specified hue and config.\r\n * @param {number} hue\r\n * @param {import(\"../common/configuration\").ParsedConfiguration} config\r\n */\r\nexport function colorTheme(hue, config) {\r\n hue = config.hue(hue);\r\n return [\r\n // Dark gray\r\n correctedHsl(hue, config.grayscaleSaturation, config.grayscaleLightness(0)),\r\n // Mid color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(0.5)),\r\n // Light gray\r\n correctedHsl(hue, config.grayscaleSaturation, config.grayscaleLightness(1)),\r\n // Light color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(1)),\r\n // Dark color\r\n correctedHsl(hue, config.colorSaturation, config.colorLightness(0))\r\n ];\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { Transform } from \"./transform\";\r\nimport { Graphics } from \"./graphics\";\r\nimport { centerShape, outerShape } from \"./shapes\";\r\nimport { colorTheme } from \"./colorTheme\";\r\nimport { parseHex } from \"../common/parseHex\";\r\nimport { getConfiguration } from \"../common/configuration\";\r\n \r\n/**\r\n * Draws an identicon to a specified renderer.\r\n * @param {import('./renderer').Renderer} renderer\r\n * @param {string} hash\r\n * @param {Object|number=} config\r\n */\r\nexport function iconGenerator(renderer, hash, config) {\r\n const parsedConfig = getConfiguration(config, 0.08);\r\n\r\n // Set background color\r\n if (parsedConfig.backColor) {\r\n renderer.setBackground(parsedConfig.backColor);\r\n }\r\n \r\n // Calculate padding and round to nearest integer\r\n let size = renderer.iconSize;\r\n const padding = (0.5 + size * parsedConfig.iconPadding) | 0;\r\n size -= padding * 2;\r\n \r\n const graphics = new Graphics(renderer);\r\n \r\n // Calculate cell size and ensure it is an integer\r\n const cell = 0 | (size / 4);\r\n \r\n // Since the cell size is integer based, the actual icon will be slightly smaller than specified => center icon\r\n const x = 0 | (padding + size / 2 - cell * 2);\r\n const y = 0 | (padding + size / 2 - cell * 2);\r\n\r\n function renderShape(colorIndex, shapes, index, rotationIndex, positions) {\r\n const shapeIndex = parseHex(hash, index, 1);\r\n let r = rotationIndex ? parseHex(hash, rotationIndex, 1) : 0;\r\n \r\n renderer.beginShape(availableColors[selectedColorIndexes[colorIndex]]);\r\n \r\n for (let i = 0; i < positions.length; i++) {\r\n graphics.currentTransform = new Transform(x + positions[i][0] * cell, y + positions[i][1] * cell, cell, r++ % 4);\r\n shapes(shapeIndex, graphics, cell, i);\r\n }\r\n \r\n renderer.endShape();\r\n }\r\n\r\n // AVAILABLE COLORS\r\n const hue = parseHex(hash, -7) / 0xfffffff,\r\n \r\n // Available colors for this icon\r\n availableColors = colorTheme(hue, parsedConfig),\r\n\r\n // The index of the selected colors\r\n selectedColorIndexes = [];\r\n\r\n let index;\r\n\r\n function isDuplicate(values) {\r\n if (values.indexOf(index) >= 0) {\r\n for (let i = 0; i < values.length; i++) {\r\n if (selectedColorIndexes.indexOf(values[i]) >= 0) {\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n for (let i = 0; i < 3; i++) {\r\n index = parseHex(hash, 8 + i, 1) % availableColors.length;\r\n if (isDuplicate([0, 4]) || // Disallow dark gray and dark color combo\r\n isDuplicate([2, 3])) { // Disallow light gray and light color combo\r\n index = 1;\r\n }\r\n selectedColorIndexes.push(index);\r\n }\r\n\r\n // ACTUAL RENDERING\r\n // Sides\r\n renderShape(0, outerShape, 2, 3, [[1, 0], [2, 0], [2, 3], [1, 3], [0, 1], [3, 1], [3, 2], [0, 2]]);\r\n // Corners\r\n renderShape(1, outerShape, 4, 5, [[0, 0], [3, 0], [3, 3], [0, 3]]);\r\n // Center\r\n renderShape(2, centerShape, 1, null, [[1, 1], [2, 1], [2, 2], [1, 2]]);\r\n \r\n renderer.finish();\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Computes a SHA1 hash for any value and returns it as a hexadecimal string.\r\n * \r\n * This function is optimized for minimal code size and rather short messages.\r\n * \r\n * @param {string} message \r\n */\r\nexport function sha1(message) {\r\n const HASH_SIZE_HALF_BYTES = 40;\r\n const BLOCK_SIZE_WORDS = 16;\r\n\r\n // Variables\r\n // `var` is used to be able to minimize the number of `var` keywords.\r\n var i = 0,\r\n f = 0,\r\n \r\n // Use `encodeURI` to UTF8 encode the message without any additional libraries\r\n // We could use `unescape` + `encodeURI` to minimize the code, but that would be slightly risky\r\n // since `unescape` is deprecated.\r\n urlEncodedMessage = encodeURI(message) + \"%80\", // trailing '1' bit padding\r\n \r\n // This can be changed to a preallocated Uint32Array array for greater performance and larger code size\r\n data = [],\r\n dataSize,\r\n \r\n hashBuffer = [],\r\n\r\n a = 0x67452301,\r\n b = 0xefcdab89,\r\n c = ~a,\r\n d = ~b,\r\n e = 0xc3d2e1f0,\r\n hash = [a, b, c, d, e],\r\n\r\n blockStartIndex = 0,\r\n hexHash = \"\";\r\n\r\n /**\r\n * Rotates the value a specified number of bits to the left.\r\n * @param {number} value Value to rotate\r\n * @param {number} shift Bit count to shift.\r\n */\r\n function rotl(value, shift) {\r\n return (value << shift) | (value >>> (32 - shift));\r\n }\r\n\r\n // Message data\r\n for ( ; i < urlEncodedMessage.length; f++) {\r\n data[f >> 2] = data[f >> 2] |\r\n (\r\n (\r\n urlEncodedMessage[i] == \"%\"\r\n // Percent encoded byte\r\n ? parseInt(urlEncodedMessage.substring(i + 1, i += 3), 16)\r\n // Unencoded byte\r\n : urlEncodedMessage.charCodeAt(i++)\r\n )\r\n\r\n // Read bytes in reverse order (big endian words)\r\n << ((3 - (f & 3)) * 8)\r\n );\r\n }\r\n\r\n // f is now the length of the utf8 encoded message\r\n // 7 = 8 bytes (64 bit) for message size, -1 to round down\r\n // >> 6 = integer division with block size\r\n dataSize = (((f + 7) >> 6) + 1) * BLOCK_SIZE_WORDS;\r\n\r\n // Message size in bits.\r\n // SHA1 uses a 64 bit integer to represent the size, but since we only support short messages only the least\r\n // significant 32 bits are set. -8 is for the '1' bit padding byte.\r\n data[dataSize - 1] = f * 8 - 8;\r\n \r\n // Compute hash\r\n for ( ; blockStartIndex < dataSize; blockStartIndex += BLOCK_SIZE_WORDS) {\r\n for (i = 0; i < 80; i++) {\r\n f = rotl(a, 5) + e + (\r\n // Ch\r\n i < 20 ? ((b & c) ^ ((~b) & d)) + 0x5a827999 :\r\n \r\n // Parity\r\n i < 40 ? (b ^ c ^ d) + 0x6ed9eba1 :\r\n \r\n // Maj\r\n i < 60 ? ((b & c) ^ (b & d) ^ (c & d)) + 0x8f1bbcdc :\r\n \r\n // Parity\r\n (b ^ c ^ d) + 0xca62c1d6\r\n ) + ( \r\n hashBuffer[i] = i < BLOCK_SIZE_WORDS\r\n // Bitwise OR is used to coerse `undefined` to 0\r\n ? (data[blockStartIndex + i] | 0)\r\n : rotl(hashBuffer[i - 3] ^ hashBuffer[i - 8] ^ hashBuffer[i - 14] ^ hashBuffer[i - 16], 1)\r\n );\r\n\r\n e = d;\r\n d = c;\r\n c = rotl(b, 30);\r\n b = a;\r\n a = f;\r\n }\r\n\r\n hash[0] = a = ((hash[0] + a) | 0);\r\n hash[1] = b = ((hash[1] + b) | 0);\r\n hash[2] = c = ((hash[2] + c) | 0);\r\n hash[3] = d = ((hash[3] + d) | 0);\r\n hash[4] = e = ((hash[4] + e) | 0);\r\n }\r\n\r\n // Format hex hash\r\n for (i = 0; i < HASH_SIZE_HALF_BYTES; i++) {\r\n hexHash += (\r\n (\r\n // Get word (2^3 half-bytes per word)\r\n hash[i >> 3] >>>\r\n\r\n // Append half-bytes in reverse order\r\n ((7 - (i & 7)) * 4)\r\n ) \r\n // Clamp to half-byte\r\n & 0xf\r\n ).toString(16);\r\n }\r\n\r\n return hexHash;\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { sha1 } from \"./sha1\";\r\n\r\n/**\r\n * Inputs a value that might be a valid hash string for Jdenticon and returns it \r\n * if it is determined valid, otherwise a falsy value is returned.\r\n */\r\nexport function isValidHash(hashCandidate) {\r\n return /^[0-9a-f]{11,}$/i.test(hashCandidate) && hashCandidate;\r\n}\r\n\r\n/**\r\n * Computes a hash for the specified value. Currently SHA1 is used. This function\r\n * always returns a valid hash.\r\n */\r\nexport function computeHash(value) {\r\n return sha1(value == null ? \"\" : \"\" + value);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { toCss3Color } from \"../color\";\r\n\r\n/**\r\n * @typedef {import(\"../renderer\").Renderer} Renderer\r\n * @typedef {import('../point').Point} Point\r\n */\r\n\r\n/**\r\n * Renderer redirecting drawing commands to a canvas context.\r\n * @implements {Renderer}\r\n */\r\nexport class CanvasRenderer {\r\n /**\r\n * @param {number=} iconSize\r\n */\r\n constructor(ctx, iconSize) {\r\n const canvas = ctx.canvas; \r\n const width = canvas.width;\r\n const height = canvas.height;\r\n \r\n ctx.save();\r\n \r\n if (!iconSize) {\r\n iconSize = Math.min(width, height);\r\n \r\n ctx.translate(\r\n ((width - iconSize) / 2) | 0,\r\n ((height - iconSize) / 2) | 0);\r\n }\r\n\r\n /**\r\n * @private\r\n */\r\n this._ctx = ctx;\r\n this.iconSize = iconSize;\r\n \r\n ctx.clearRect(0, 0, iconSize, iconSize);\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb[aa].\r\n */\r\n setBackground(fillColor) {\r\n const ctx = this._ctx;\r\n const iconSize = this.iconSize;\r\n\r\n ctx.fillStyle = toCss3Color(fillColor);\r\n ctx.fillRect(0, 0, iconSize, iconSize);\r\n }\r\n\r\n /**\r\n * Marks the beginning of a new shape of the specified color. Should be ended with a call to endShape.\r\n * @param {string} fillColor Fill color on format #rrggbb[aa].\r\n */\r\n beginShape(fillColor) {\r\n const ctx = this._ctx;\r\n ctx.fillStyle = toCss3Color(fillColor);\r\n ctx.beginPath();\r\n }\r\n\r\n /**\r\n * Marks the end of the currently drawn shape. This causes the queued paths to be rendered on the canvas.\r\n */\r\n endShape() {\r\n this._ctx.fill();\r\n }\r\n\r\n /**\r\n * Adds a polygon to the rendering queue.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n const ctx = this._ctx;\r\n ctx.moveTo(points[0].x, points[0].y);\r\n for (let i = 1; i < points.length; i++) {\r\n ctx.lineTo(points[i].x, points[i].y);\r\n }\r\n ctx.closePath();\r\n }\r\n\r\n /**\r\n * Adds a circle to the rendering queue.\r\n * @param {Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n const ctx = this._ctx,\r\n radius = diameter / 2;\r\n ctx.moveTo(point.x + radius, point.y + radius);\r\n ctx.arc(point.x + radius, point.y + radius, radius, 0, Math.PI * 2, counterClockwise);\r\n ctx.closePath();\r\n }\r\n\r\n /**\r\n * Called when the icon has been completely drawn.\r\n */\r\n finish() {\r\n this._ctx.restore();\r\n }\r\n}\r\n","\r\nvar CanvasRenderer__prototype = CanvasRenderer.prototype;","import { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { CanvasRenderer } from \"../renderer/canvas/canvasRenderer\";\r\n\r\n/**\r\n * Draws an identicon to a context.\r\n * @param {CanvasRenderingContext2D} ctx - Canvas context on which the icon will be drawn at location (0, 0).\r\n * @param {*} hashOrValue - A hexadecimal hash string or any value that will be hashed by Jdenticon.\r\n * @param {number} size - Icon size in pixels.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compatibility a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function drawIcon(ctx, hashOrValue, size, config) {\r\n if (!ctx) {\r\n throw new Error(\"No canvas specified.\");\r\n }\r\n \r\n iconGenerator(new CanvasRenderer(ctx, size), \r\n isValidHash(hashOrValue) || computeHash(hashOrValue), \r\n config);\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n/**\r\n * Prepares a measure to be used as a measure in an SVG path, by\r\n * rounding the measure to a single decimal. This reduces the file\r\n * size of the generated SVG with more than 50% in some cases.\r\n */\r\nfunction svgValue(value) {\r\n return ((value * 10 + 0.5) | 0) / 10;\r\n}\r\n\r\n/**\r\n * Represents an SVG path element.\r\n */\r\nexport class SvgPath {\r\n constructor() {\r\n /**\r\n * This property holds the data string (path.d) of the SVG path.\r\n * @type {string}\r\n */\r\n this.dataString = \"\";\r\n }\r\n\r\n /**\r\n * Adds a polygon with the current fill color to the SVG path.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n let dataString = \"\";\r\n for (let i = 0; i < points.length; i++) {\r\n dataString += (i ? \"L\" : \"M\") + svgValue(points[i].x) + \" \" + svgValue(points[i].y);\r\n }\r\n this.dataString += dataString + \"Z\";\r\n }\r\n\r\n /**\r\n * Adds a circle with the current fill color to the SVG path.\r\n * @param {import('../point').Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n const sweepFlag = counterClockwise ? 0 : 1,\r\n svgRadius = svgValue(diameter / 2),\r\n svgDiameter = svgValue(diameter),\r\n svgArc = \"a\" + svgRadius + \",\" + svgRadius + \" 0 1,\" + sweepFlag + \" \";\r\n \r\n this.dataString += \r\n \"M\" + svgValue(point.x) + \" \" + svgValue(point.y + diameter / 2) +\r\n svgArc + svgDiameter + \",0\" + \r\n svgArc + (-svgDiameter) + \",0\";\r\n }\r\n}\r\n\r\n","\r\nvar SvgPath__prototype = SvgPath.prototype;","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { SvgPath } from \"./svgPath\";\r\nimport { parseHex } from \"../../common/parseHex\";\r\n\r\n/**\r\n * @typedef {import(\"../point\").Point} Point\r\n * @typedef {import(\"../renderer\").Renderer} Renderer\r\n * @typedef {import(\"./svgElement\").SvgElement} SvgElement\r\n * @typedef {import(\"./svgWriter\").SvgWriter} SvgWriter\r\n */\r\n\r\n/**\r\n * Renderer producing SVG output.\r\n * @implements {Renderer}\r\n */\r\nexport class SvgRenderer {\r\n /**\r\n * @param {SvgElement|SvgWriter} target \r\n */\r\n constructor(target) {\r\n /**\r\n * @type {SvgPath}\r\n * @private\r\n */\r\n this._path;\r\n\r\n /**\r\n * @type {Object.}\r\n * @private\r\n */\r\n this._pathsByColor = { };\r\n\r\n /**\r\n * @type {SvgElement|SvgWriter}\r\n * @private\r\n */\r\n this._target = target;\r\n\r\n /**\r\n * @type {number}\r\n */\r\n this.iconSize = target.iconSize;\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb[aa].\r\n */\r\n setBackground(fillColor) {\r\n const match = /^(#......)(..)?/.exec(fillColor),\r\n opacity = match[2] ? parseHex(match[2], 0) / 255 : 1;\r\n this._target.setBackground(match[1], opacity);\r\n }\r\n\r\n /**\r\n * Marks the beginning of a new shape of the specified color. Should be ended with a call to endShape.\r\n * @param {string} color Fill color on format #xxxxxx.\r\n */\r\n beginShape(color) {\r\n this._path = this._pathsByColor[color] || (this._pathsByColor[color] = new SvgPath());\r\n }\r\n\r\n /**\r\n * Marks the end of the currently drawn shape.\r\n */\r\n endShape() { }\r\n\r\n /**\r\n * Adds a polygon with the current fill color to the SVG.\r\n * @param points An array of Point objects.\r\n */\r\n addPolygon(points) {\r\n this._path.addPolygon(points);\r\n }\r\n\r\n /**\r\n * Adds a circle with the current fill color to the SVG.\r\n * @param {Point} point The upper left corner of the circle bounding box.\r\n * @param {number} diameter The diameter of the circle.\r\n * @param {boolean} counterClockwise True if the circle is drawn counter-clockwise (will result in a hole if rendered on a clockwise path).\r\n */\r\n addCircle(point, diameter, counterClockwise) {\r\n this._path.addCircle(point, diameter, counterClockwise);\r\n }\r\n\r\n /**\r\n * Called when the icon has been completely drawn.\r\n */\r\n finish() { \r\n const pathsByColor = this._pathsByColor;\r\n for (let color in pathsByColor) {\r\n // hasOwnProperty cannot be shadowed in pathsByColor\r\n // eslint-disable-next-line no-prototype-builtins\r\n if (pathsByColor.hasOwnProperty(color)) {\r\n this._target.appendPath(color, pathsByColor[color].dataString);\r\n }\r\n }\r\n }\r\n}\r\n","\r\nvar SvgRenderer__prototype = SvgRenderer.prototype;","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nexport const SVG_CONSTANTS = {\r\n XMLNS: \"http://www.w3.org/2000/svg\",\r\n WIDTH: \"width\",\r\n HEIGHT: \"height\",\r\n}","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { SVG_CONSTANTS } from \"./constants\";\r\n\r\n/**\r\n * Renderer producing SVG output.\r\n */\r\nexport class SvgWriter {\r\n /**\r\n * @param {number} iconSize - Icon width and height in pixels.\r\n */\r\n constructor(iconSize) {\r\n /**\r\n * @type {number}\r\n */\r\n this.iconSize = iconSize;\r\n\r\n /**\r\n * @type {string}\r\n * @private\r\n */\r\n this._s =\r\n '';\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb.\r\n * @param {number} opacity Opacity in the range [0.0, 1.0].\r\n */\r\n setBackground(fillColor, opacity) {\r\n if (opacity) {\r\n this._s += '';\r\n }\r\n }\r\n\r\n /**\r\n * Writes a path to the SVG string.\r\n * @param {string} color Fill color on format #rrggbb.\r\n * @param {string} dataString The SVG path data string.\r\n */\r\n appendPath(color, dataString) {\r\n this._s += '';\r\n }\r\n\r\n /**\r\n * Gets the rendered image as an SVG string.\r\n */\r\n toString() {\r\n return this._s + \"\";\r\n }\r\n}\r\n","\r\nvar SvgWriter__prototype = SvgWriter.prototype;","import { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { SvgRenderer } from \"../renderer/svg/svgRenderer\";\r\nimport { SvgWriter } from \"../renderer/svg/svgWriter\";\r\n\r\n/**\r\n * Draws an identicon as an SVG string.\r\n * @param {*} hashOrValue - A hexadecimal hash string or any value that will be hashed by Jdenticon.\r\n * @param {number} size - Icon size in pixels.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compatibility a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n * @returns {string} SVG string\r\n */\r\nexport function toSvg(hashOrValue, size, config) {\r\n const writer = new SvgWriter(size);\r\n iconGenerator(new SvgRenderer(writer), \r\n isValidHash(hashOrValue) || computeHash(hashOrValue),\r\n config);\r\n return writer.toString();\r\n}\r\n","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { SVG_CONSTANTS } from \"./constants\";\r\n\r\n/**\r\n * Creates a new element and adds it to the specified parent.\r\n * @param {Element} parentNode\r\n * @param {string} name\r\n * @param {...(string|number)} keyValuePairs\r\n */\r\nfunction SvgElement_append(parentNode, name, ...keyValuePairs) {\r\n const el = document.createElementNS(SVG_CONSTANTS.XMLNS, name);\r\n \r\n for (let i = 0; i + 1 < keyValuePairs.length; i += 2) {\r\n el.setAttribute(\r\n /** @type {string} */(keyValuePairs[i]),\r\n /** @type {string} */(keyValuePairs[i + 1]),\r\n );\r\n }\r\n\r\n parentNode.appendChild(el);\r\n}\r\n\r\n\r\n/**\r\n * Renderer producing SVG output.\r\n */\r\nexport class SvgElement {\r\n /**\r\n * @param {Element} element - Target element\r\n */\r\n constructor(element) {\r\n // Don't use the clientWidth and clientHeight properties on SVG elements\r\n // since Firefox won't serve a proper value of these properties on SVG\r\n // elements (https://bugzilla.mozilla.org/show_bug.cgi?id=874811)\r\n // Instead use 100px as a hardcoded size (the svg viewBox will rescale \r\n // the icon to the correct dimensions)\r\n const iconSize = this.iconSize = Math.min(\r\n (Number(element.getAttribute(SVG_CONSTANTS.WIDTH)) || 100),\r\n (Number(element.getAttribute(SVG_CONSTANTS.HEIGHT)) || 100)\r\n );\r\n \r\n /**\r\n * @type {Element}\r\n * @private\r\n */\r\n this._el = element;\r\n \r\n // Clear current SVG child elements\r\n while (element.firstChild) {\r\n element.removeChild(element.firstChild);\r\n }\r\n \r\n // Set viewBox attribute to ensure the svg scales nicely.\r\n element.setAttribute(\"viewBox\", \"0 0 \" + iconSize + \" \" + iconSize);\r\n element.setAttribute(\"preserveAspectRatio\", \"xMidYMid meet\");\r\n }\r\n\r\n /**\r\n * Fills the background with the specified color.\r\n * @param {string} fillColor Fill color on the format #rrggbb.\r\n * @param {number} opacity Opacity in the range [0.0, 1.0].\r\n */\r\n setBackground(fillColor, opacity) {\r\n if (opacity) {\r\n SvgElement_append(this._el, \"rect\",\r\n SVG_CONSTANTS.WIDTH, \"100%\",\r\n SVG_CONSTANTS.HEIGHT, \"100%\",\r\n \"fill\", fillColor,\r\n \"opacity\", opacity);\r\n }\r\n }\r\n\r\n /**\r\n * Appends a path to the SVG element.\r\n * @param {string} color Fill color on format #xxxxxx.\r\n * @param {string} dataString The SVG path data string.\r\n */\r\n appendPath(color, dataString) {\r\n SvgElement_append(this._el, \"path\",\r\n \"fill\", color,\r\n \"d\", dataString);\r\n }\r\n}\r\n","\r\nvar SvgElement__prototype = SvgElement.prototype;","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\nimport { iconGenerator } from \"../renderer/iconGenerator\";\r\nimport { isValidHash, computeHash } from \"../common/hashUtils\";\r\nimport { ATTRIBUTES, ICON_SELECTOR, documentQuerySelectorAll } from \"../common/dom\";\r\nimport { SvgRenderer } from \"../renderer/svg/svgRenderer\";\r\nimport { SvgElement } from \"../renderer/svg/svgElement\";\r\nimport { CanvasRenderer } from \"../renderer/canvas/canvasRenderer\";\r\nimport { ICON_TYPE_CANVAS, ICON_TYPE_SVG, getIdenticonType } from \"../common/dom\";\r\n\r\n\r\n/**\r\n * Updates all canvas elements with the `data-jdenticon-hash` or `data-jdenticon-value` attribute.\r\n */\r\nexport function updateAll() {\r\n if (documentQuerySelectorAll) {\r\n update(ICON_SELECTOR);\r\n }\r\n}\r\n\r\n/**\r\n * Updates the identicon in the specified `` or `` elements.\r\n * @param {(string|Element)} el - Specifies the container in which the icon is rendered as a DOM element of the type\r\n * `` or ``, or a CSS selector to such an element.\r\n * @param {*=} hashOrValue - Optional hash or value to be rendered. If not specified, the `data-jdenticon-hash` or\r\n * `data-jdenticon-value` attribute will be evaluated.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compability a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function update(el, hashOrValue, config) {\r\n renderDomElement(el, hashOrValue, config, function (el, iconType) {\r\n if (iconType) {\r\n return iconType == ICON_TYPE_SVG ? \r\n new SvgRenderer(new SvgElement(el)) : \r\n new CanvasRenderer(/** @type {HTMLCanvasElement} */(el).getContext(\"2d\"));\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Updates the identicon in the specified `` elements.\r\n * @param {(string|Element)} el - Specifies the container in which the icon is rendered as a DOM element of the type\r\n * ``, or a CSS selector to such an element.\r\n * @param {*=} hashOrValue - Optional hash or value to be rendered. If not specified, the `data-jdenticon-hash` or\r\n * `data-jdenticon-value` attribute will be evaluated.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compability a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function updateCanvas(el, hashOrValue, config) {\r\n renderDomElement(el, hashOrValue, config, function (el, iconType) {\r\n if (iconType == ICON_TYPE_CANVAS) {\r\n return new CanvasRenderer(/** @type {HTMLCanvasElement} */(el).getContext(\"2d\"));\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Updates the identicon in the specified `` elements.\r\n * @param {(string|Element)} el - Specifies the container in which the icon is rendered as a DOM element of the type\r\n * ``, or a CSS selector to such an element.\r\n * @param {*=} hashOrValue - Optional hash or value to be rendered. If not specified, the `data-jdenticon-hash` or\r\n * `data-jdenticon-value` attribute will be evaluated.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any\r\n * global configuration in its entirety. For backward compability a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function updateSvg(el, hashOrValue, config) {\r\n renderDomElement(el, hashOrValue, config, function (el, iconType) {\r\n if (iconType == ICON_TYPE_SVG) {\r\n return new SvgRenderer(new SvgElement(el));\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Updates the identicon in the specified canvas or svg elements.\r\n * @param {(string|Element)} el - Specifies the container in which the icon is rendered as a DOM element of the type\r\n * `` or ``, or a CSS selector to such an element.\r\n * @param {*} hashOrValue - Optional hash or value to be rendered. If not specified, the `data-jdenticon-hash` or\r\n * `data-jdenticon-value` attribute will be evaluated.\r\n * @param {Object|number|undefined} config\r\n * @param {function(Element,number):import(\"../renderer/renderer\").Renderer} rendererFactory - Factory function for creating an icon renderer.\r\n */\r\nfunction renderDomElement(el, hashOrValue, config, rendererFactory) {\r\n if (typeof el === \"string\") {\r\n if (documentQuerySelectorAll) {\r\n const elements = documentQuerySelectorAll(el);\r\n for (let i = 0; i < elements.length; i++) {\r\n renderDomElement(elements[i], hashOrValue, config, rendererFactory);\r\n }\r\n }\r\n return;\r\n }\r\n \r\n // Hash selection. The result from getValidHash or computeHash is \r\n // accepted as a valid hash.\r\n const hash = \r\n // 1. Explicit valid hash\r\n isValidHash(hashOrValue) ||\r\n \r\n // 2. Explicit value (`!= null` catches both null and undefined)\r\n hashOrValue != null && computeHash(hashOrValue) ||\r\n \r\n // 3. `data-jdenticon-hash` attribute\r\n isValidHash(el.getAttribute(ATTRIBUTES.HASH)) ||\r\n \r\n // 4. `data-jdenticon-value` attribute. \r\n // We want to treat an empty attribute as an empty value. \r\n // Some browsers return empty string even if the attribute \r\n // is not specified, so use hasAttribute to determine if \r\n // the attribute is specified.\r\n el.hasAttribute(ATTRIBUTES.VALUE) && computeHash(el.getAttribute(ATTRIBUTES.VALUE));\r\n \r\n if (!hash) {\r\n // No hash specified. Don't render an icon.\r\n return;\r\n }\r\n \r\n const renderer = rendererFactory(el, getIdenticonType(el));\r\n if (renderer) {\r\n // Draw icon\r\n iconGenerator(renderer, hash, config);\r\n }\r\n}\r\n","import { update } from \"./update\";\r\n\r\n/**\r\n * Renders an identicon for all matching supported elements.\r\n * \r\n * @param {*} hashOrValue - A hexadecimal hash string or any value that will be hashed by Jdenticon. If not \r\n * specified the `data-jdenticon-hash` and `data-jdenticon-value` attributes of each element will be\r\n * evaluated.\r\n * @param {Object|number=} config - Optional configuration. If specified, this configuration object overrides any global\r\n * configuration in its entirety. For backward compatibility a padding value in the range [0.0, 0.5) can be\r\n * specified in place of a configuration object.\r\n */\r\nexport function jdenticonJqueryPlugin(hashOrValue, config) {\r\n this[\"each\"](function (index, el) {\r\n update(el, hashOrValue, config);\r\n });\r\n return this;\r\n}","/**\r\n * Jdenticon\r\n * https://github.com/dmester/jdenticon\r\n * Copyright © Daniel Mester Pirttijärvi\r\n */\r\n\r\n// This file is compiled to dist/jdenticon.js and dist/jdenticon.min.js\r\n\r\nimport { CONFIG_PROPERTIES, defineConfigProperty } from \"./common/configuration\";\r\nimport { observer } from \"./common/observer\";\r\nimport { configure } from \"./apis/configure\";\r\nimport { drawIcon } from \"./apis/drawIcon\";\r\nimport { toSvg } from \"./apis/toSvg\";\r\nimport { update, updateAll } from \"./apis/update\";\r\nimport { jdenticonJqueryPlugin } from \"./apis/jquery\";\r\nimport { GLOBAL } from \"./common/global\";\r\n\r\nconst jdenticon = updateAll;\r\n\r\ndefineConfigProperty(jdenticon);\r\n\r\n// Export public API\r\njdenticon[\"configure\"] = configure;\r\njdenticon[\"drawIcon\"] = drawIcon;\r\njdenticon[\"toSvg\"] = toSvg;\r\njdenticon[\"update\"] = update;\r\njdenticon[\"updateCanvas\"] = update;\r\njdenticon[\"updateSvg\"] = update;\r\n\r\n/**\r\n * Specifies the version of the Jdenticon package in use.\r\n * @type {string}\r\n */\r\njdenticon[\"version\"] = \"#version#\";\r\n\r\n/**\r\n * Specifies which bundle of Jdenticon that is used.\r\n * @type {string}\r\n */\r\njdenticon[\"bundle\"] = \"browser-umd\";\r\n\r\n// Basic jQuery plugin\r\nconst jQuery = GLOBAL[\"jQuery\"];\r\nif (jQuery) {\r\n jQuery[\"fn\"][\"jdenticon\"] = jdenticonJqueryPlugin;\r\n}\r\n\r\n/**\r\n * This function is called once upon page load.\r\n */\r\nfunction jdenticonStartup() {\r\n const replaceMode = (\r\n jdenticon[CONFIG_PROPERTIES.MODULE] ||\r\n GLOBAL[CONFIG_PROPERTIES.GLOBAL] ||\r\n { }\r\n )[\"replaceMode\"];\r\n \r\n if (replaceMode != \"never\") {\r\n updateAll();\r\n \r\n if (replaceMode == \"observe\") {\r\n observer(update);\r\n }\r\n }\r\n}\r\n\r\n// Schedule to render all identicons on the page once it has been loaded.\r\nif (typeof setTimeout === \"function\") {\r\n setTimeout(jdenticonStartup, 0);\r\n}\r\n\r\nmodule.exports = jdenticon;\r\n"]} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index a7295f7..5cd1c85 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1884,15 +1884,6 @@ "y18n": "^4.0.0" }, "dependencies": { - "lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - }, "y18n": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", @@ -5928,6 +5919,15 @@ "js-tokens": "^3.0.0 || ^4.0.0" } }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, "lru-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz", diff --git a/package.json b/package.json index 98fcbf9..f1fd992 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jdenticon", - "version": "3.1.0", + "version": "3.1.1", "description": "Javascript identicon generator", "main": "dist/jdenticon-node.js", "exports": { @@ -78,7 +78,7 @@ "test:browser-win": "tap ./test/e2e/browser/test.js --test-arg=win --test-arg=chrome,firefox,edge,ie11,ie10,ie9 --timeout=300", "test:browser-macos": "tap ./test/e2e/browser/test.js --test-arg=macos --test-arg=chrome,firefox,safari --timeout=180", "test:node-cjs": "tap ./test/e2e/node/test.js", - "test:node-esm": "tap ./test/e2e/node/test.mjs", + "test:node-esm": "tap ./test/e2e/node/test.mjs", "test:webpack4": "cd ./test/e2e/webpack && node runner.js webpack4 && tap ./app.bundle.js --no-coverage", "test:webpack5": "cd ./test/e2e/webpack && node runner.js webpack5 && tap ./app.bundle.js --no-coverage", "test:rollup": "cd ./test/e2e/rollup && rollup --config && tap ./app.bundle.js --no-coverage",