{"version":3,"sources":["../src/index.ts","../node_modules/esm-seedrandom/lib/_common.js","../node_modules/esm-seedrandom/lib/alea.js","../node_modules/esm-seedrandom/lib/xor128.js","../node_modules/esm-seedrandom/lib/xorwow.js","../node_modules/esm-seedrandom/lib/xorshift7.js","../node_modules/esm-seedrandom/lib/xor4096.js","../node_modules/esm-seedrandom/lib/tychei.js","../node_modules/esm-seedrandom/lib/arc4.js","../src/generators.ts","../src/color-conversion-algorithms.ts"],"sourcesContent":["import { Algo, Xor128, Xorwow } from \"./generators\";\nimport { hslToRgb } from \"./color-conversion-algorithms\";\n\nexport {\n  Algo,\n  Alea,\n  Arc4,\n  Tychei,\n  Xor128,\n  Xor4096,\n  Xorshift7,\n  Xorwow,\n} from \"./generators\";\n\ntype Only<T, U> = {\n  [P in keyof T]: T[P];\n} & {\n  [P in keyof U]?: never;\n};\n\ntype Either<T, U> = Only<T, U> | Only<U, T>;\n\ntype Saturation = Either<\n  {\n    /**\n     * Short form of the saturation property, range must be between 0 and 100, inclusive.\n     */\n    s?: number;\n  },\n  {\n    /**\n     * Long form of the saturation property, range must be between 0 and 100, inclusive.\n     */\n    saturation?: number;\n  }\n>;\n\ntype Lightness = Either<\n  {\n    /**\n     * Short form of the lightness property, range must be between 0 and 100, inclusive.\n     */\n    l?: number;\n  },\n  {\n    /**\n     * Long form of the lightness property, range must be between 0 and 100, inclusive.\n     */\n    lightness?: number;\n  }\n>;\n\ntype Alpha = Either<\n  {\n    /**\n     * Short form of the alpha property, range must be between 0 and 100, inclusive.\n     */\n    a?: number;\n  },\n  {\n    /**\n     * Long form of the alpha property, range must be between 0 and 100, inclusive.\n     */\n    alpha?: number;\n  }\n>;\n\n/**\n * The options for the color generation.\n * It is possible to use the short form of the options (s, l, a) or the long form (saturation, lightness, alpha),\n * but not both at the same time. If both are present, the full property name takes precedence. Range must be between 0 and 100, inclusive.\n */\nexport type ColorOptions = {\n  /**\n   * The algorithm to use for the color generation.\n   */\n  algorithm?: Algo;\n} & Saturation &\n  Lightness &\n  Alpha;\n\nexport const defaultColorOptions: ColorOptions = {\n  saturation: 75,\n  lightness: 50,\n  alpha: 100,\n};\n\nconst PHI = 1.618033988749895;\n\n/**\n * Generates a random color from the given string, saturation and lightness can be controlled.\n * Inspired by https://martin.ankerl.com/2009/12/09/how-to-create-random-colors-programmatically/\n * @param input The input to generate the color from\n * @param options The custom options to use for the color generation\n */\nexport function generateColor(\n  input: string,\n  options: ColorOptions = {},\n): string {\n  const { saturation, lightness, alpha } = getOptions(options);\n  const algorithm = options.algorithm || Xor128;\n  const h = calculateHue(input, algorithm);\n  return `hsl(\n    ${Math.floor(h * 360)}\n    , ${saturation}%, ${lightness}%, ${alpha}%\n  )`;\n}\n\n/**\n * Generates a random color from the given string in the RGB format, same as {@link generateColor} but in the RGB format.\n * @param input The input string to generate the color from\n * @param options The custom options to use for the color generation\n * @returns The generated color in the RGB format\n */\nexport function generateColorRGB(\n  input: string,\n  options: ColorOptions = {},\n): string {\n  const { saturation, lightness, alpha } = getOptions(options);\n  const algorithm = options.algorithm || Xor128;\n  const h = calculateHue(input, algorithm);\n  const [r, g, b] = hslToRgb(h, saturation! / 100, lightness! / 100);\n  return `rgba(${r}, ${g}, ${b}, ${alpha! / 100})`;\n}\n\n/**\n * Same as generateColor() but with a different default algorithm that produces a different color.\n * @param input The input to generate the color from\n * @param options The custom options to use for the color generation\n */\nexport function generateSecondaryColor(\n  input: string,\n  options: ColorOptions = {},\n): string {\n  const { saturation, lightness, alpha } = getOptions(options);\n  const algorithm = options.algorithm || Xorwow;\n  const h = calculateHue(input, algorithm);\n  return `hsl(\n    ${Math.floor(h * 360)}\n    , ${saturation}%, ${lightness}%, ${alpha}%\n  )`;\n}\n\n/**\n * Same as {@link generateColorRGB} but with a different default algorithm that produces a different color.\n * @param input The input to generate the color from\n * @param options The custom options to use for the color generation\n */\nexport function generateSecondaryColorRGB(\n  input: string,\n  options: ColorOptions = {},\n): string {\n  const { saturation, lightness, alpha } = getOptions(options);\n  const algorithm = options.algorithm || Xor128;\n  const h = calculateHue(input, algorithm);\n  const [r, g, b] = hslToRgb(h, saturation! / 100, lightness! / 100);\n  return `rgba(${r}, ${g}, ${b}, ${alpha! / 100})`;\n}\n\n/**\n * Generates a linear gradient from the given input.\n * @param input The input to generate the gradient from\n * @param angle The angle of the gradient\n * @param options The custom options to use for the color generation of the primary color\n * @param secondaryOptions The custom options to use for the color generation of the secondary color\n */\nexport function generateGradient(\n  input: string,\n  angle = 45,\n  options: ColorOptions = {},\n  secondaryOptions: ColorOptions = {},\n): string {\n  return `linear-gradient(\n    ${angle}deg,\n    ${generateColor(input, options)},\n    ${generateSecondaryColor(input, secondaryOptions)}\n  )`;\n}\n\n/**\n * Extracts the saturation, lightness, and alpha values from the given options and fills in the missing values with the default values.\n * @param options The options to extract the values from\n * @returns An object containing the extracted saturation, lightness, and alpha values\n */\nfunction getOptions(options: ColorOptions = {}) {\n  const {\n    s,\n    l,\n    a,\n    saturation = s ?? defaultColorOptions.saturation,\n    lightness = l ?? defaultColorOptions.lightness,\n    alpha = a ?? defaultColorOptions.alpha,\n  } = options;\n  return { saturation, lightness, alpha };\n}\n\n/**\n * Calculates the hue for a given input string.\n * @param input The input string to calculate the hue for\n * @param algorithm The algorithm to use for the calculation\n * @returns The calculated hue\n */\nfunction calculateHue(input: string, algorithm: Algo): number {\n  return (algorithm(input) + 1 / PHI) % 1;\n}\n","\nexport function _prng_restore(prng, xg, opts) {\n  let state = opts && opts.state;\n  if (state) {\n    if (typeof(state) == 'object') xg.copy(state, xg);\n    prng.state = () => xg.copy(xg, {});\n  }\n}\n\nexport function _prng_xor_core(xg, opts) {\n  let prng = () => (xg.next() >>> 0) / 0x100000000;\n\n  prng.double = () => {\n    let top, bot, result\n    do {\n      top = xg.next() >>> 11;\n      bot = (xg.next() >>> 0) / 0x100000000;\n      result = (top + bot) / (1 << 21);\n    } while (result === 0);\n    return result;\n  };\n\n  prng.int32 = () => xg.next() | 0;\n\n  prng.quick = prng;\n\n  _prng_restore(prng, xg, opts);\n  return prng;\n}\n","// A port of an algorithm by Johannes Baagøe <baagoe@baagoe.com>, 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baagøe <baagoe@baagoe.org>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nimport {_prng_restore} from './_common.js'\n\nexport default prng_alea;\nexport function prng_alea(seed, opts) {\n  let xg = new AleaGen(seed);\n\n  let prng = () => xg.next();\n\n  prng.double = () =>\n    prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n\n  prng.int32 = () => (xg.next() * 0x100000000) | 0;\n\n  prng.quick = prng;\n\n  _prng_restore(prng, xg, opts);\n  return prng\n}\n\nclass AleaGen {\n  constructor(seed) {\n    if (seed == null) seed = +(new Date);\n\n    let n = 0xefc8249d;\n\n    // Apply the seeding algorithm from Baagoe.\n    this.c = 1;\n    this.s0 = mash(' ');\n    this.s1 = mash(' ');\n    this.s2 = mash(' ');\n    this.s0 -= mash(seed);\n    if (this.s0 < 0) { this.s0 += 1; }\n    this.s1 -= mash(seed);\n    if (this.s1 < 0) { this.s1 += 1; }\n    this.s2 -= mash(seed);\n    if (this.s2 < 0) { this.s2 += 1; }\n\n    function mash(data) {\n      data = String(data);\n      for (let i = 0; i < data.length; i++) {\n        n += data.charCodeAt(i);\n        let h = 0.02519603282416938 * n;\n        n = h >>> 0;\n        h -= n;\n        h *= n;\n        n = h >>> 0;\n        h -= n;\n        n += h * 0x100000000; // 2^32\n      }\n      return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n    }\n  }\n\n  next() {\n    let {c,s0,s1,s2} = this\n    let t = 2091639 * s0 + c * 2.3283064365386963e-10; // 2^-32\n    this.s0 = s1;\n    this.s1 = s2;\n    return this.s2 = t - (this.c = t | 0);\n  }\n\n  copy(f, t) {\n    t.c = f.c;\n    t.s0 = f.s0;\n    t.s1 = f.s1;\n    t.s2 = f.s2;\n    return t;\n  }\n}\n","// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia.  See http://www.jstatsoft.org/v08/i14/paper\n\nimport {_prng_xor_core} from './_common.js'\n\nexport default prng_xor128;\nexport function prng_xor128(seed, opts) {\n  let xg = new Xor128Gen(seed);\n  return _prng_xor_core(xg, opts);\n}\n\nclass Xor128Gen {\n  constructor(seed) {\n    if (seed == null) seed = +(new Date);\n\n    let strseed = '';\n\n    this.x = 0;\n    this.y = 0;\n    this.z = 0;\n    this.w = 0;\n\n    if (seed === (seed | 0)) {\n      // Integer seed.\n      this.x = seed;\n    } else {\n      // String seed.\n      strseed += seed;\n    }\n\n    // Mix in string seed, then discard an initial batch of 64 values.\n    for (let k = 0; k < strseed.length + 64; k++) {\n      this.x ^= strseed.charCodeAt(k) | 0;\n      this.next();\n    }\n  }\n\n  next() {\n    let {x,y,z,w} = this\n    let t = x ^ (x << 11);\n    this.x = y;\n    this.y = z;\n    this.z = w;\n    return this.w = w ^ ((w >>> 19) ^ t ^ (t >>> 8));\n  };\n\n  copy(f, t) {\n    t.x = f.x;\n    t.y = f.y;\n    t.z = f.z;\n    t.w = f.w;\n    return t;\n  }\n}\n\n","// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia.  See http://www.jstatsoft.org/v08/i14/paper\n\nimport {_prng_xor_core} from './_common.js'\n\nexport default prng_xorwow\nexport function prng_xorwow(seed, opts) {\n  let xg = new XorWowGen(seed);\n  return _prng_xor_core(xg, opts);\n}\n\nclass XorWowGen {\n  constructor(seed) {\n    if (seed == null) seed = +(new Date);\n\n    let strseed = '';\n\n    this.x = 0;\n    this.y = 0;\n    this.z = 0;\n    this.w = 0;\n    this.v = 0;\n\n    if (seed === (seed | 0)) {\n      // Integer seed.\n      this.x = seed;\n    } else {\n      // String seed.\n      strseed += seed;\n    }\n\n    // Mix in string seed, then discard an initial batch of 64 values.\n    for (let k = 0; k < strseed.length + 64; k++) {\n      this.x ^= strseed.charCodeAt(k) | 0;\n      if (k == strseed.length) {\n        this.d = this.x << 10 ^ this.x >>> 4;\n      }\n      this.next();\n    }\n  }\n\n  next() {\n    let {x,y,z,w,v,d} = this\n    let t = (x ^ (x >>> 2));\n    this.x = y;\n    this.y = z;\n    this.z = w;\n    this.w = v;\n    return (this.d = (d + 362437 | 0)) +\n       (this.v = (v ^ (v << 4)) ^ (t ^ (t << 1))) | 0;\n  };\n\n  copy(f, t) {\n    t.x = f.x;\n    t.y = f.y;\n    t.z = f.z;\n    t.w = f.w;\n    t.v = f.v;\n    t.d = f.d;\n    return t;\n  }\n}\n","// A Javascript implementaion of the \"xorshift7\" algorithm by\n// François Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\nimport {_prng_xor_core} from './_common.js'\n\nexport default prng_xorshift7\nexport function prng_xorshift7(seed, opts) {\n  let xg = new XorShift7Gen(seed);\n  return _prng_xor_core(xg, opts);\n}\n\n\nclass XorShift7Gen {\n  constructor(seed) {\n    if (seed == null) seed = +(new Date);\n\n    var j, w, x = [];\n\n    if (seed === (seed | 0)) {\n      // Seed state array using a 32-bit integer.\n      w = x[0] = seed;\n    } else {\n      // Seed state using a string.\n      seed = '' + seed;\n      for (j = 0; j < seed.length; ++j) {\n        x[j & 7] = (x[j & 7] << 15) ^\n            (seed.charCodeAt(j) + x[(j + 1) & 7] << 13);\n      }\n    }\n\n    // Enforce an array length of 8, not all zeroes.\n    while (x.length < 8) x.push(0);\n    for (j = 0; j < 8 && x[j] === 0; ++j);\n    if (j == 8) w = x[7] = -1; else w = x[j];\n\n    this.x = x;\n    this.i = 0;\n\n    // Discard an initial 256 values.\n    for (j = 256; j > 0; --j) {\n      this.next();\n    }\n  }\n\n  next() {\n    // Update xor generator.\n    let t, v, w, {x,i} = this\n    t = x[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n    t = x[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n    t = x[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n    t = x[(i + 4) & 7]; v ^= t ^ (t << 7);\n    t = x[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n    x[i] = v;\n    this.i = (i + 1) & 7;\n    return v;\n  };\n\n  copy(f, t) {\n    t.x = [... f.x];\n    t.i = f.i;\n    return t;\n  }\n}\n","// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated.  For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C.  This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\nimport {_prng_xor_core} from './_common.js'\n\nexport default prng_xor4096\nexport function prng_xor4096(seed, opts) {\n  let xg = new Xor4096Gen(seed);\n  return _prng_xor_core(xg, opts);\n}\n\n\nclass Xor4096Gen {\n  constructor(seed) {\n    if (seed == null) seed = +(new Date);\n\n    let t, v, i, j, w, X = [], limit = 128;\n    if (seed === (seed | 0)) {\n      // Numeric seeds initialize v, which is used to generates X.\n      v = seed;\n      seed = null;\n    } else {\n      // String seeds are mixed into v and X one character at a time.\n      seed = seed + '\\0';\n      v = 0;\n      limit = Math.max(limit, seed.length);\n    }\n    // Initialize circular array and weyl value.\n    for (i = 0, j = -32; j < limit; ++j) {\n      // Put the unicode characters into the array, and shuffle them.\n      if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n      // After 32 shuffles, take v as the starting w value.\n      if (j === 0) w = v;\n      v ^= v << 10;\n      v ^= v >>> 15;\n      v ^= v << 4;\n      v ^= v >>> 13;\n      if (j >= 0) {\n        w = (w + 0x61c88647) | 0;     // Weyl.\n        t = (X[j & 127] ^= (v + w));  // Combine xor and weyl to init array.\n        i = (0 == t) ? i + 1 : 0;     // Count zeroes.\n      }\n    }\n    // We have detected all zeroes; make the key nonzero.\n    if (i >= 128) {\n      X[(seed && seed.length || 0) & 127] = -1;\n    }\n    // Run the generator 512 times to further mix the state before using it.\n    // Factoring this as a function slows the main generator, so it is just\n    // unrolled here.  The weyl generator is not advanced while warming up.\n    i = 127;\n    for (j = 4 * 128; j > 0; --j) {\n      v = X[(i + 34) & 127];\n      t = X[i = ((i + 1) & 127)];\n      v ^= v << 13;\n      t ^= t << 17;\n      v ^= v >>> 15;\n      t ^= t >>> 12;\n      X[i] = v ^ t;\n    }\n    // Storing state as object members is faster than using closure variables.\n    this.w = w;\n    this.X = X;\n    this.i = i;\n  }\n\n  next() {\n    let t, v, {w, X, i} = this\n    // Update Weyl generator.\n    this.w = w = (w + 0x61c88647) | 0;\n    // Update xor generator.\n    v = X[(i + 34) & 127];\n    t = X[i = ((i + 1) & 127)];\n    v ^= v << 13;\n    t ^= t << 17;\n    v ^= v >>> 15;\n    t ^= t >>> 12;\n    // Update Xor generator array state.\n    v = X[i] = v ^ t;\n    this.i = i;\n    // Result is the combination.\n    return (v + (w ^ (w >>> 16))) | 0;\n  }\n\n  copy(f, t) {\n    t.i = f.i;\n    t.w = f.w;\n    t.X = [... f.X]\n    return t;\n  }\n}\n","// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\nimport {_prng_xor_core} from './_common.js'\n\nexport default prng_tychei\nexport function prng_tychei(seed, opts) {\n  let xg = new TycheiGen(seed);\n  return _prng_xor_core(xg, opts);\n}\n\nclass TycheiGen {\n  constructor(seed) {\n    if (seed == null) seed = +(new Date);\n\n    let strseed = '';\n\n    this.a = 0;\n    this.b = 0;\n    this.c = 2654435769 | 0;\n    this.d = 1367130551;\n\n    if (seed === Math.floor(seed)) {\n      // Integer seed.\n      this.a = (seed / 0x100000000) | 0;\n      this.b = seed | 0;\n    } else {\n      // String seed.\n      strseed += seed;\n    }\n\n    // Mix in string seed, then discard an initial batch of 64 values.\n    for (let k = 0; k < strseed.length + 20; k++) {\n      this.b ^= strseed.charCodeAt(k) | 0;\n      this.next();\n    }\n  }\n\n  next() {\n    let {a,b,c,d} = this\n    b = (b << 25) ^ (b >>> 7) ^ c;\n    c = (c - d) | 0;\n    d = (d << 24) ^ (d >>> 8) ^ a;\n    a = (a - b) | 0;\n    this.b = b = (b << 20) ^ (b >>> 12) ^ c;\n    this.c = c = (c - d) | 0;\n    this.d = (d << 16) ^ (c >>> 16) ^ a;\n    return this.a = (a - b) | 0;\n  };\n\n  copy(f, t) {\n    t.a = f.a;\n    t.b = f.b;\n    t.c = f.c;\n    t.d = f.d;\n    return t;\n  }\n}\n\n\n/* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n *\n\nclass TycheiGenAlt extends TycheiGen {\n  next() {\n    let {a,b,c,d} = this\n    a = (a + b | 0) >>> 0;\n    d = d ^ a; d = d << 16 ^ d >>> 16;\n    c = c + d | 0;\n    b = b ^ c; b = b << 12 ^ d >>> 20;\n    this.a = a = a + b | 0;\n    d = d ^ a; this.d = d = d << 8 ^ d >>> 24;\n    this.c = c = c + d | 0;\n    b = b ^ c;\n    return this.b = (b << 7 ^ b >>> 25);\n  }\n}\n*/\n","/*\nCopyright 2019 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\nimport {_prng_restore} from './_common.js'\n\nexport default prng_arc4;\nexport function prng_arc4(seed, opts) {\n  let xg = new ARC4Gen(seed);\n  let prng = () => xg.next();\n\n  prng.double = prng;\n\n  prng.int32 = () => xg.g(4) | 0;\n\n  prng.quick = () => xg.g(4) / 0x100000000;\n\n  _prng_restore(prng, xg, opts);\n  return prng\n}\n\n\n//\n// ARC4\n//\n// An ARC4 implementation.  The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4.  Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\n\n//\n// The following constants are related to IEEE 754 limits.\n//\n\n// const width = 256 // each RC4 output is 0 <= x < 256\n// const chunks = 6 // at least six RC4 outputs for each double\nconst _arc4_startdenom = 281474976710656     // 256 ** 6 == width ** chunks\nconst _arc4_significance = 4503599627370496  // 2 ** 52 significant digits in a double\nconst _arc4_overflow = 9007199254740992      // 2 ** 53 == significance * 2\n\n\nclass ARC4Gen {\n  constructor(seed) {\n    if (seed == null) seed = +(new Date);\n\n    let key = this.mixkey(seed, [])\n    let i,j,t, S=[], keylen = key.length\n    this.i = this.j = i = j = 0\n    this.S = S\n\n    // The empty key [] is treated as [0].\n    if (!keylen) { key = [keylen++]; }\n\n    // Set up S using the standard key scheduling algorithm.\n    while (i <= 0xff) {\n      S[i] = i++;\n    }\n    for (i = 0; i <= 0xff; i++) {\n      S[i] = S[j = 0xff & (j + key[i % keylen] + (t = S[i]))];\n      S[j] = t;\n    }\n\n    // For robust unpredictability, the function call below automatically\n    // discards an initial batch of values.  This is called RC4-drop[256].\n    // See http://google.com/search?q=rsa+fluhrer+response&btnI\n    this.g(256)\n  }\n\n  next() {\n    // This function returns a random double in [0, 1) that contains\n    // randomness in every bit of the mantissa of the IEEE 754 value.\n\n    let n = this.g(6);                  // Start with a numerator n < 2 ^ 48\n    let d = _arc4_startdenom;           //   and denominator d = 2 ^ 48.\n    let x = 0;                          //   and no 'extra last byte'.\n\n    while (n < _arc4_significance) {    // Fill up all significant digits (2 ** 52)\n      n = (n + x) * 256;                //   by shifting numerator and\n      d *= 256;                         //   denominator and generating a\n      x = this.g(1);                    //   new least-significant-byte.\n    }\n    while (n >= _arc4_overflow) {       // To avoid rounding past overflow, before adding\n      n /= 2;                           //   last byte, shift everything\n      d /= 2;                           //   right using integer math until\n      x >>>= 1;                         //   we have exactly the desired bits.\n    }\n    return (n + x) / d;                 // Form the number within [0, 1).\n  }\n\n  g(count) {\n    // The \"g\" method returns the next (count) outputs as one number.\n    let t, r = 0, {i,j,S} = this;\n    while (count--) {\n      t = S[i = 0xff & (i + 1)];\n      r = r * 256 + S[0xff & ((S[i] = S[j = 0xff & (j + t)]) + (S[j] = t))];\n    }\n    this.i = i;\n    this.j = j;\n    return r;\n  }\n\n  copy(f, t) {\n    t.i = f.i;\n    t.j = f.j;\n    t.S = [... f.S]\n    return t;\n  }\n\n  mixkey(seed, key) {\n    seed = seed + ''\n    let smear=0, j=0;\n    while (j < seed.length) {\n      key[0xff & j] =\n        0xff & ((smear ^= key[0xff & j] * 19) + seed.charCodeAt(j++));\n    }\n    return key\n  }\n}\n","import {\n  prng_alea,\n  prng_arc4,\n  prng_tychei,\n  prng_xor128,\n  prng_xor4096,\n  prng_xorshift7,\n  prng_xorwow,\n} from \"esm-seedrandom\";\n\nexport type Algo = (seed: string) => number;\n\n/**\n * The Alea PRNG algorithm, based on a simple multiplicative congruential generator.\n * It is very fast (★★★★★) and has a good balance between simplicity and statistical properties.\n * @param seed - The input seed string.\n * @returns The next random number in the sequence.\n */\nexport const Alea: Algo = (seed) => prng_alea(seed)();\n\n/**\n * The Arc4 (Alleged RC4) PRNG algorithm, based on a stream cipher.\n * It is slow (★★☆☆☆) and generates random numbers with good statistical properties but has been considered cryptographically insecure.\n * @param seed - The input seed string.\n * @returns The next random number in the sequence.\n */\nexport const Arc4: Algo = (seed) => prng_arc4(seed)();\n\n/**\n * The Tychei PRNG algorithm, based on a variant of the Xorshift family.\n * It is fast (★★★★☆) and has good statistical properties.\n * @param seed - The input seed string.\n * @returns The next random number in the sequence.\n */\nexport const Tychei: Algo = (seed) => prng_tychei(seed)();\n\n/**\n * The Xor128 PRNG algorithm, based on the Xorshift family.\n * It is very fast (★★★★★), simple, and statistically good but has a relatively small state space.\n * @param seed - The input seed string.\n * @returns The next random number in the sequence.\n */\nexport const Xor128: Algo = (seed) => prng_xor128(seed)();\n\n/**\n * The Xor4096 PRNG algorithm, based on the Xorshift family.\n * It is fast (★★★★☆) and has a larger state space than Xor128, making it more suitable for applications requiring more randomness.\n * @param seed - The input seed string.\n * @returns The next random number in the sequence.\n */\nexport const Xor4096: Algo = (seed) => prng_xor4096(seed)();\n\n/**\n * The Xorshift7 PRNG algorithm, based on the Xorshift family.\n * Somewhat slower than others (★★★☆☆), has good statistical properties, and a larger state space than Xor128.\n * @param seed - The input seed string.\n * @returns The next random number in the sequence.\n */\nexport const Xorshift7: Algo = (seed) => prng_xorshift7(seed)();\n\n/**\n * The Xorwow PRNG algorithm, a combination of a linear feedback shift register and Xorshift.\n * It is fast (★★★★☆), simple, and has good statistical properties.\n * @param seed - The input seed string.\n * @returns The next random number in the sequence.\n */\nexport const Xorwow: Algo = (seed) => prng_xorwow(seed)();\n","/**\n * Converts an HSL color value to RGB. Conversion formula\n * adapted from http://en.wikipedia.org/wiki/HSL_color_space\n * and taken from https://gist.github.com/mjackson/5311256\n * Assumes h, s, and l are contained in the set [0, 1] and\n * returns r, g, and b in the set [0, 255].\n *\n * @param h hue\n * @param s The saturation\n * @param l The lightness\n * @return The RGB representation\n */\nexport function hslToRgb(h: number, s: number, l: number): number[] {\n  let r, g, b;\n\n  if (s == 0) {\n    r = g = b = l; // achromatic\n  } else {\n    const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n    const p = 2 * l - q;\n\n    r = hue2rgb(p, q, h + 1 / 3);\n    g = hue2rgb(p, q, h);\n    b = hue2rgb(p, q, h - 1 / 3);\n  }\n\n  return [r * 255, g * 255, b * 255];\n}\n\nfunction hue2rgb(p: number, q: number, t: number): number {\n  if (t < 0) t += 1;\n  if (t > 1) t -= 1;\n  if (t < 1 / 6) return p + (q - p) * 6 * t;\n  if (t < 1 / 2) return q;\n  if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n  return p;\n}\n"],"mappings":";yaAAA,IAAAA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DK,EAAYL,EAAQ,WAAaM,EACjCC,EAAIC,EAAaT,EAAOM,CAAS,EACjC,CAACK,EAAGC,EAAGC,CAAC,EAAIC,EAASN,EAAGN,EAAc,IAAKC,EAAa,GAAG,EACjE,MAAO,QAAQQ,CAAC,KAAKC,CAAC,KAAKC,CAAC,KAAKT,EAAS,GAAG,GAC/C,CASO,SAASc,EACdlB,EACAmB,EAAQ,GACRlB,EAAwB,CAAC,EACzBmB,EAAiC,CAAC,EAC1B,CACR,MAAO;AAAA,MACHD,CAAK;AAAA,MACLpB,EAAcC,EAAOC,CAAO,CAAC;AAAA,MAC7Bc,EAAuBf,EAAOoB,CAAgB,CAAC;AAAA,IAErD,CAOA,SAASf,EAAWJ,EAAwB,CAAC,EAAG,CAC9C,GAAM,CACJ,EAAAoB,EACA,EAAAC,EACA,EAAAC,EACA,WAAArB,EAAamB,GAAA,KAAAA,EAAKxB,EAAoB,WACtC,UAAAM,EAAYmB,GAAA,KAAAA,EAAKzB,EAAoB,UACrC,MAAAO,EAAQmB,GAAA,KAAAA,EAAK1B,EAAoB,KACnC,EAAII,EACJ,MAAO,CAAE,WAAAC,EAAY,UAAAC,EAAW,MAAAC,CAAM,CACxC,CAQA,SAASK,EAAaT,EAAeM,EAAyB,CAC5D,OAAQA,EAAUN,CAAK,EAAI,EAAIF,GAAO,CACxC","names":["index_exports","__export","Alea","Arc4","Tychei","Xor128","Xor4096","Xorshift7","Xorwow","defaultColorOptions","generateColor","generateColorRGB","generateGradient","generateSecondaryColor","generateSecondaryColorRGB","__toCommonJS","_prng_restore","prng","xg","opts","state","_prng_xor_core","top","bot","result","prng_alea","seed","AleaGen","n","mash","data","i","h","c","s0","s1","s2","t","f","prng_xor128","Xor128Gen","strseed","k","x","y","z","w","prng_xorwow","XorWowGen","v","d","prng_xorshift7","XorShift7Gen","j","prng_xor4096","Xor4096Gen","X","limit","prng_tychei","TycheiGen","a","b","prng_arc4","ARC4Gen","_arc4_startdenom","_arc4_significance","_arc4_overflow","key","S","keylen","count","r","smear","Alea","seed","prng_alea","Arc4","prng_arc4","Tychei","prng_tychei","Xor128","prng_xor128","Xor4096","prng_xor4096","Xorshift7","prng_xorshift7","Xorwow","prng_xorwow","hslToRgb","h","s","l","r","g","b","q","p","hue2rgb","t","defaultColorOptions","PHI","generateColor","input","options","saturation","lightness","alpha","getOptions","algorithm","Xor128","h","calculateHue","generateColorRGB","r","g","b","hslToRgb","generateSecondaryColor","Xorwow","generateSecondaryColorRGB","generateGradient","angle","secondaryOptions","s","l","a"]}