import { useState as n, useEffect as t, createContext as e, useContext as r, useRef as o, memo as i } from "react";
import { g as a } from "./alasql-f60045ee.js";
import { lz as l, lI as c, lJ as u } from "./ant-design-icons-6bfdc7d5.js";
import { t as d } from "./lodash-b5661970.js";
import { createPortal as s } from "react-dom";
import { h as f } from "./ua-parser-js-c952c07b.js";
var g, h = { barSize: 18, crossSize: 18, inputSize: 40, delay: 150, defaultColor: "rgba(175, 51, 242, 1)", defaultGradient: "linear-gradient(90deg, rgba(2,0,36,1) 0%, rgba(9,9,121,1) 35%, rgba(0,212,255,1) 100%)" }, p = { CONTROLS: { SOLID: "Solid", GRADIENT: "Gradient" } }, v = ["rgba(0,0,0,1)", "rgba(128,128,128, 1)", "rgba(192,192,192, 1)", "rgba(255,255,255, 1)", "rgba(0,0,128,1)", "rgba(0,0,255,1)", "rgba(0,255,255, 1)", "rgba(0,128,0,1)", "rgba(128,128,0, 1)", "rgba(0,128,128,1)", "rgba(0,255,0, 1)", "rgba(128,0,0, 1)", "rgba(128,0,128, 1)", "rgba(175, 51, 242, 1)", "rgba(255,0,255, 1)", "rgba(255,0,0, 1)", "rgba(240, 103, 46, 1)", "rgba(255,255,0, 1)"], b = { exports: {} };
g = b, function(n2) {
  var t2 = /^\s+/, e2 = /\s+$/, r2 = 0, o2 = n2.round, i2 = n2.min, a2 = n2.max, l2 = n2.random;
  function c2(l3, u3) {
    if (u3 = u3 || {}, (l3 = l3 || "") instanceof c2)
      return l3;
    if (!(this instanceof c2))
      return new c2(l3, u3);
    var d3 = function(r3) {
      var o3, l4, c3, u4 = { r: 0, g: 0, b: 0 }, d4 = 1, s3 = null, f3 = null, g2 = null, h3 = false, p3 = false;
      return "string" == typeof r3 && (r3 = function(n3) {
        n3 = n3.replace(t2, "").replace(e2, "").toLowerCase();
        var r4, o4 = false;
        if (T2[n3])
          n3 = T2[n3], o4 = true;
        else if ("transparent" == n3)
          return { r: 0, g: 0, b: 0, a: 0, format: "name" };
        return (r4 = P2.rgb.exec(n3)) ? { r: r4[1], g: r4[2], b: r4[3] } : (r4 = P2.rgba.exec(n3)) ? { r: r4[1], g: r4[2], b: r4[3], a: r4[4] } : (r4 = P2.hsl.exec(n3)) ? { h: r4[1], s: r4[2], l: r4[3] } : (r4 = P2.hsla.exec(n3)) ? { h: r4[1], s: r4[2], l: r4[3], a: r4[4] } : (r4 = P2.hsv.exec(n3)) ? { h: r4[1], s: r4[2], v: r4[3] } : (r4 = P2.hsva.exec(n3)) ? { h: r4[1], s: r4[2], v: r4[3], a: r4[4] } : (r4 = P2.hex8.exec(n3)) ? { r: O2(r4[1]), g: O2(r4[2]), b: O2(r4[3]), a: M2(r4[4]), format: o4 ? "name" : "hex8" } : (r4 = P2.hex6.exec(n3)) ? { r: O2(r4[1]), g: O2(r4[2]), b: O2(r4[3]), format: o4 ? "name" : "hex" } : (r4 = P2.hex4.exec(n3)) ? { r: O2(r4[1] + "" + r4[1]), g: O2(r4[2] + "" + r4[2]), b: O2(r4[3] + "" + r4[3]), a: M2(r4[4] + "" + r4[4]), format: o4 ? "name" : "hex8" } : !!(r4 = P2.hex3.exec(n3)) && { r: O2(r4[1] + "" + r4[1]), g: O2(r4[2] + "" + r4[2]), b: O2(r4[3] + "" + r4[3]), format: o4 ? "name" : "hex" };
      }(r3)), "object" == typeof r3 && (D2(r3.r) && D2(r3.g) && D2(r3.b) ? (o3 = r3.r, l4 = r3.g, c3 = r3.b, u4 = { r: 255 * R2(o3, 255), g: 255 * R2(l4, 255), b: 255 * R2(c3, 255) }, h3 = true, p3 = "%" === String(r3.r).substr(-1) ? "prgb" : "rgb") : D2(r3.h) && D2(r3.s) && D2(r3.v) ? (s3 = j2(r3.s), f3 = j2(r3.v), u4 = function(t3, e3, r4) {
        t3 = 6 * R2(t3, 360), e3 = R2(e3, 100), r4 = R2(r4, 100);
        var o4 = n2.floor(t3), i3 = t3 - o4, a3 = r4 * (1 - e3), l5 = r4 * (1 - i3 * e3), c4 = r4 * (1 - (1 - i3) * e3), u5 = o4 % 6, d5 = [r4, l5, a3, a3, c4, r4][u5], s4 = [c4, r4, r4, l5, a3, a3][u5], f4 = [a3, a3, c4, r4, r4, l5][u5];
        return { r: 255 * d5, g: 255 * s4, b: 255 * f4 };
      }(r3.h, s3, f3), h3 = true, p3 = "hsv") : D2(r3.h) && D2(r3.s) && D2(r3.l) && (s3 = j2(r3.s), g2 = j2(r3.l), u4 = function(n3, t3, e3) {
        var r4, o4, i3;
        function a3(n4, t4, e4) {
          return e4 < 0 && (e4 += 1), e4 > 1 && (e4 -= 1), e4 < 1 / 6 ? n4 + 6 * (t4 - n4) * e4 : e4 < 0.5 ? t4 : e4 < 2 / 3 ? n4 + (t4 - n4) * (2 / 3 - e4) * 6 : n4;
        }
        if (n3 = R2(n3, 360), t3 = R2(t3, 100), e3 = R2(e3, 100), 0 === t3)
          r4 = o4 = i3 = e3;
        else {
          var l5 = e3 < 0.5 ? e3 * (1 + t3) : e3 + t3 - e3 * t3, c4 = 2 * e3 - l5;
          r4 = a3(c4, l5, n3 + 1 / 3), o4 = a3(c4, l5, n3), i3 = a3(c4, l5, n3 - 1 / 3);
        }
        return { r: 255 * r4, g: 255 * o4, b: 255 * i3 };
      }(r3.h, s3, g2), h3 = true, p3 = "hsl"), r3.hasOwnProperty("a") && (d4 = r3.a)), d4 = I2(d4), { ok: h3, format: r3.format || p3, r: i2(255, a2(u4.r, 0)), g: i2(255, a2(u4.g, 0)), b: i2(255, a2(u4.b, 0)), a: d4 };
    }(l3);
    this._originalInput = l3, this._r = d3.r, this._g = d3.g, this._b = d3.b, this._a = d3.a, this._roundA = o2(100 * this._a) / 100, this._format = u3.format || d3.format, this._gradientType = u3.gradientType, this._r < 1 && (this._r = o2(this._r)), this._g < 1 && (this._g = o2(this._g)), this._b < 1 && (this._b = o2(this._b)), this._ok = d3.ok, this._tc_id = r2++;
  }
  function u2(n3, t3, e3) {
    n3 = R2(n3, 255), t3 = R2(t3, 255), e3 = R2(e3, 255);
    var r3, o3, l3 = a2(n3, t3, e3), c3 = i2(n3, t3, e3), u3 = (l3 + c3) / 2;
    if (l3 == c3)
      r3 = o3 = 0;
    else {
      var d3 = l3 - c3;
      switch (o3 = u3 > 0.5 ? d3 / (2 - l3 - c3) : d3 / (l3 + c3), l3) {
        case n3:
          r3 = (t3 - e3) / d3 + (t3 < e3 ? 6 : 0);
          break;
        case t3:
          r3 = (e3 - n3) / d3 + 2;
          break;
        case e3:
          r3 = (n3 - t3) / d3 + 4;
      }
      r3 /= 6;
    }
    return { h: r3, s: o3, l: u3 };
  }
  function d2(n3, t3, e3) {
    n3 = R2(n3, 255), t3 = R2(t3, 255), e3 = R2(e3, 255);
    var r3, o3, l3 = a2(n3, t3, e3), c3 = i2(n3, t3, e3), u3 = l3, d3 = l3 - c3;
    if (o3 = 0 === l3 ? 0 : d3 / l3, l3 == c3)
      r3 = 0;
    else {
      switch (l3) {
        case n3:
          r3 = (t3 - e3) / d3 + (t3 < e3 ? 6 : 0);
          break;
        case t3:
          r3 = (e3 - n3) / d3 + 2;
          break;
        case e3:
          r3 = (n3 - t3) / d3 + 4;
      }
      r3 /= 6;
    }
    return { h: r3, s: o3, v: u3 };
  }
  function s2(n3, t3, e3, r3) {
    var i3 = [H2(o2(n3).toString(16)), H2(o2(t3).toString(16)), H2(o2(e3).toString(16))];
    return r3 && i3[0].charAt(0) == i3[0].charAt(1) && i3[1].charAt(0) == i3[1].charAt(1) && i3[2].charAt(0) == i3[2].charAt(1) ? i3[0].charAt(0) + i3[1].charAt(0) + i3[2].charAt(0) : i3.join("");
  }
  function f2(n3, t3, e3, r3) {
    return [H2(B2(r3)), H2(o2(n3).toString(16)), H2(o2(t3).toString(16)), H2(o2(e3).toString(16))].join("");
  }
  function h2(n3, t3) {
    t3 = 0 === t3 ? 0 : t3 || 10;
    var e3 = c2(n3).toHsl();
    return e3.s -= t3 / 100, e3.s = G2(e3.s), c2(e3);
  }
  function p2(n3, t3) {
    t3 = 0 === t3 ? 0 : t3 || 10;
    var e3 = c2(n3).toHsl();
    return e3.s += t3 / 100, e3.s = G2(e3.s), c2(e3);
  }
  function v2(n3) {
    return c2(n3).desaturate(100);
  }
  function b2(n3, t3) {
    t3 = 0 === t3 ? 0 : t3 || 10;
    var e3 = c2(n3).toHsl();
    return e3.l += t3 / 100, e3.l = G2(e3.l), c2(e3);
  }
  function y2(n3, t3) {
    t3 = 0 === t3 ? 0 : t3 || 10;
    var e3 = c2(n3).toRgb();
    return e3.r = a2(0, i2(255, e3.r - o2(-t3 / 100 * 255))), e3.g = a2(0, i2(255, e3.g - o2(-t3 / 100 * 255))), e3.b = a2(0, i2(255, e3.b - o2(-t3 / 100 * 255))), c2(e3);
  }
  function m2(n3, t3) {
    t3 = 0 === t3 ? 0 : t3 || 10;
    var e3 = c2(n3).toHsl();
    return e3.l -= t3 / 100, e3.l = G2(e3.l), c2(e3);
  }
  function x2(n3, t3) {
    var e3 = c2(n3).toHsl(), r3 = (e3.h + t3) % 360;
    return e3.h = r3 < 0 ? 360 + r3 : r3, c2(e3);
  }
  function C2(n3) {
    var t3 = c2(n3).toHsl();
    return t3.h = (t3.h + 180) % 360, c2(t3);
  }
  function w2(n3) {
    var t3 = c2(n3).toHsl(), e3 = t3.h;
    return [c2(n3), c2({ h: (e3 + 120) % 360, s: t3.s, l: t3.l }), c2({ h: (e3 + 240) % 360, s: t3.s, l: t3.l })];
  }
  function k2(n3) {
    var t3 = c2(n3).toHsl(), e3 = t3.h;
    return [c2(n3), c2({ h: (e3 + 90) % 360, s: t3.s, l: t3.l }), c2({ h: (e3 + 180) % 360, s: t3.s, l: t3.l }), c2({ h: (e3 + 270) % 360, s: t3.s, l: t3.l })];
  }
  function S2(n3) {
    var t3 = c2(n3).toHsl(), e3 = t3.h;
    return [c2(n3), c2({ h: (e3 + 72) % 360, s: t3.s, l: t3.l }), c2({ h: (e3 + 216) % 360, s: t3.s, l: t3.l })];
  }
  function _2(n3, t3, e3) {
    t3 = t3 || 6, e3 = e3 || 30;
    var r3 = c2(n3).toHsl(), o3 = 360 / e3, i3 = [c2(n3)];
    for (r3.h = (r3.h - (o3 * t3 >> 1) + 720) % 360; --t3; )
      r3.h = (r3.h + o3) % 360, i3.push(c2(r3));
    return i3;
  }
  function A2(n3, t3) {
    t3 = t3 || 6;
    for (var e3 = c2(n3).toHsv(), r3 = e3.h, o3 = e3.s, i3 = e3.v, a3 = [], l3 = 1 / t3; t3--; )
      a3.push(c2({ h: r3, s: o3, v: i3 })), i3 = (i3 + l3) % 1;
    return a3;
  }
  c2.prototype = { isDark: function() {
    return this.getBrightness() < 128;
  }, isLight: function() {
    return !this.isDark();
  }, isValid: function() {
    return this._ok;
  }, getOriginalInput: function() {
    return this._originalInput;
  }, getFormat: function() {
    return this._format;
  }, getAlpha: function() {
    return this._a;
  }, getBrightness: function() {
    var n3 = this.toRgb();
    return (299 * n3.r + 587 * n3.g + 114 * n3.b) / 1e3;
  }, getLuminance: function() {
    var t3, e3, r3, o3 = this.toRgb();
    return t3 = o3.r / 255, e3 = o3.g / 255, r3 = o3.b / 255, 0.2126 * (t3 <= 0.03928 ? t3 / 12.92 : n2.pow((t3 + 0.055) / 1.055, 2.4)) + 0.7152 * (e3 <= 0.03928 ? e3 / 12.92 : n2.pow((e3 + 0.055) / 1.055, 2.4)) + 0.0722 * (r3 <= 0.03928 ? r3 / 12.92 : n2.pow((r3 + 0.055) / 1.055, 2.4));
  }, setAlpha: function(n3) {
    return this._a = I2(n3), this._roundA = o2(100 * this._a) / 100, this;
  }, toHsv: function() {
    var n3 = d2(this._r, this._g, this._b);
    return { h: 360 * n3.h, s: n3.s, v: n3.v, a: this._a };
  }, toHsvString: function() {
    var n3 = d2(this._r, this._g, this._b), t3 = o2(360 * n3.h), e3 = o2(100 * n3.s), r3 = o2(100 * n3.v);
    return 1 == this._a ? "hsv(" + t3 + ", " + e3 + "%, " + r3 + "%)" : "hsva(" + t3 + ", " + e3 + "%, " + r3 + "%, " + this._roundA + ")";
  }, toHsl: function() {
    var n3 = u2(this._r, this._g, this._b);
    return { h: 360 * n3.h, s: n3.s, l: n3.l, a: this._a };
  }, toHslString: function() {
    var n3 = u2(this._r, this._g, this._b), t3 = o2(360 * n3.h), e3 = o2(100 * n3.s), r3 = o2(100 * n3.l);
    return 1 == this._a ? "hsl(" + t3 + ", " + e3 + "%, " + r3 + "%)" : "hsla(" + t3 + ", " + e3 + "%, " + r3 + "%, " + this._roundA + ")";
  }, toHex: function(n3) {
    return s2(this._r, this._g, this._b, n3);
  }, toHexString: function(n3) {
    return "#" + this.toHex(n3);
  }, toHex8: function(n3) {
    return function(n4, t3, e3, r3, i3) {
      var a3 = [H2(o2(n4).toString(16)), H2(o2(t3).toString(16)), H2(o2(e3).toString(16)), H2(B2(r3))];
      return i3 && a3[0].charAt(0) == a3[0].charAt(1) && a3[1].charAt(0) == a3[1].charAt(1) && a3[2].charAt(0) == a3[2].charAt(1) && a3[3].charAt(0) == a3[3].charAt(1) ? a3[0].charAt(0) + a3[1].charAt(0) + a3[2].charAt(0) + a3[3].charAt(0) : a3.join("");
    }(this._r, this._g, this._b, this._a, n3);
  }, toHex8String: function(n3) {
    return "#" + this.toHex8(n3);
  }, toRgb: function() {
    return { r: o2(this._r), g: o2(this._g), b: o2(this._b), a: this._a };
  }, toRgbString: function() {
    return 1 == this._a ? "rgb(" + o2(this._r) + ", " + o2(this._g) + ", " + o2(this._b) + ")" : "rgba(" + o2(this._r) + ", " + o2(this._g) + ", " + o2(this._b) + ", " + this._roundA + ")";
  }, toPercentageRgb: function() {
    return { r: o2(100 * R2(this._r, 255)) + "%", g: o2(100 * R2(this._g, 255)) + "%", b: o2(100 * R2(this._b, 255)) + "%", a: this._a };
  }, toPercentageRgbString: function() {
    return 1 == this._a ? "rgb(" + o2(100 * R2(this._r, 255)) + "%, " + o2(100 * R2(this._g, 255)) + "%, " + o2(100 * R2(this._b, 255)) + "%)" : "rgba(" + o2(100 * R2(this._r, 255)) + "%, " + o2(100 * R2(this._g, 255)) + "%, " + o2(100 * R2(this._b, 255)) + "%, " + this._roundA + ")";
  }, toName: function() {
    return 0 === this._a ? "transparent" : !(this._a < 1) && (L2[s2(this._r, this._g, this._b, true)] || false);
  }, toFilter: function(n3) {
    var t3 = "#" + f2(this._r, this._g, this._b, this._a), e3 = t3, r3 = this._gradientType ? "GradientType = 1, " : "";
    if (n3) {
      var o3 = c2(n3);
      e3 = "#" + f2(o3._r, o3._g, o3._b, o3._a);
    }
    return "progid:DXImageTransform.Microsoft.gradient(" + r3 + "startColorstr=" + t3 + ",endColorstr=" + e3 + ")";
  }, toString: function(n3) {
    var t3 = !!n3;
    n3 = n3 || this._format;
    var e3 = false, r3 = this._a < 1 && this._a >= 0;
    return t3 || !r3 || "hex" !== n3 && "hex6" !== n3 && "hex3" !== n3 && "hex4" !== n3 && "hex8" !== n3 && "name" !== n3 ? ("rgb" === n3 && (e3 = this.toRgbString()), "prgb" === n3 && (e3 = this.toPercentageRgbString()), "hex" !== n3 && "hex6" !== n3 || (e3 = this.toHexString()), "hex3" === n3 && (e3 = this.toHexString(true)), "hex4" === n3 && (e3 = this.toHex8String(true)), "hex8" === n3 && (e3 = this.toHex8String()), "name" === n3 && (e3 = this.toName()), "hsl" === n3 && (e3 = this.toHslString()), "hsv" === n3 && (e3 = this.toHsvString()), e3 || this.toHexString()) : "name" === n3 && 0 === this._a ? this.toName() : this.toRgbString();
  }, clone: function() {
    return c2(this.toString());
  }, _applyModification: function(n3, t3) {
    var e3 = n3.apply(null, [this].concat([].slice.call(t3)));
    return this._r = e3._r, this._g = e3._g, this._b = e3._b, this.setAlpha(e3._a), this;
  }, lighten: function() {
    return this._applyModification(b2, arguments);
  }, brighten: function() {
    return this._applyModification(y2, arguments);
  }, darken: function() {
    return this._applyModification(m2, arguments);
  }, desaturate: function() {
    return this._applyModification(h2, arguments);
  }, saturate: function() {
    return this._applyModification(p2, arguments);
  }, greyscale: function() {
    return this._applyModification(v2, arguments);
  }, spin: function() {
    return this._applyModification(x2, arguments);
  }, _applyCombination: function(n3, t3) {
    return n3.apply(null, [this].concat([].slice.call(t3)));
  }, analogous: function() {
    return this._applyCombination(_2, arguments);
  }, complement: function() {
    return this._applyCombination(C2, arguments);
  }, monochromatic: function() {
    return this._applyCombination(A2, arguments);
  }, splitcomplement: function() {
    return this._applyCombination(S2, arguments);
  }, triad: function() {
    return this._applyCombination(w2, arguments);
  }, tetrad: function() {
    return this._applyCombination(k2, arguments);
  } }, c2.fromRatio = function(n3, t3) {
    if ("object" == typeof n3) {
      var e3 = {};
      for (var r3 in n3)
        n3.hasOwnProperty(r3) && (e3[r3] = "a" === r3 ? n3[r3] : j2(n3[r3]));
      n3 = e3;
    }
    return c2(n3, t3);
  }, c2.equals = function(n3, t3) {
    return !(!n3 || !t3) && c2(n3).toRgbString() == c2(t3).toRgbString();
  }, c2.random = function() {
    return c2.fromRatio({ r: l2(), g: l2(), b: l2() });
  }, c2.mix = function(n3, t3, e3) {
    e3 = 0 === e3 ? 0 : e3 || 50;
    var r3 = c2(n3).toRgb(), o3 = c2(t3).toRgb(), i3 = e3 / 100;
    return c2({ r: (o3.r - r3.r) * i3 + r3.r, g: (o3.g - r3.g) * i3 + r3.g, b: (o3.b - r3.b) * i3 + r3.b, a: (o3.a - r3.a) * i3 + r3.a });
  }, c2.readability = function(t3, e3) {
    var r3 = c2(t3), o3 = c2(e3);
    return (n2.max(r3.getLuminance(), o3.getLuminance()) + 0.05) / (n2.min(r3.getLuminance(), o3.getLuminance()) + 0.05);
  }, c2.isReadable = function(n3, t3, e3) {
    var r3, o3, i3, a3, l3, u3 = c2.readability(n3, t3);
    switch (o3 = false, (i3 = e3, a3 = ((i3 = i3 || { level: "AA", size: "small" }).level || "AA").toUpperCase(), l3 = (i3.size || "small").toLowerCase(), "AA" !== a3 && "AAA" !== a3 && (a3 = "AA"), "small" !== l3 && "large" !== l3 && (l3 = "small"), r3 = { level: a3, size: l3 }).level + r3.size) {
      case "AAsmall":
      case "AAAlarge":
        o3 = u3 >= 4.5;
        break;
      case "AAlarge":
        o3 = u3 >= 3;
        break;
      case "AAAsmall":
        o3 = u3 >= 7;
    }
    return o3;
  }, c2.mostReadable = function(n3, t3, e3) {
    var r3, o3, i3, a3, l3 = null, u3 = 0;
    o3 = (e3 = e3 || {}).includeFallbackColors, i3 = e3.level, a3 = e3.size;
    for (var d3 = 0; d3 < t3.length; d3++)
      (r3 = c2.readability(n3, t3[d3])) > u3 && (u3 = r3, l3 = c2(t3[d3]));
    return c2.isReadable(n3, l3, { level: i3, size: a3 }) || !o3 ? l3 : (e3.includeFallbackColors = false, c2.mostReadable(n3, ["#fff", "#000"], e3));
  };
  var T2 = c2.names = { aliceblue: "f0f8ff", antiquewhite: "faebd7", aqua: "0ff", aquamarine: "7fffd4", azure: "f0ffff", beige: "f5f5dc", bisque: "ffe4c4", black: "000", blanchedalmond: "ffebcd", blue: "00f", blueviolet: "8a2be2", brown: "a52a2a", burlywood: "deb887", burntsienna: "ea7e5d", cadetblue: "5f9ea0", chartreuse: "7fff00", chocolate: "d2691e", coral: "ff7f50", cornflowerblue: "6495ed", cornsilk: "fff8dc", crimson: "dc143c", cyan: "0ff", darkblue: "00008b", darkcyan: "008b8b", darkgoldenrod: "b8860b", darkgray: "a9a9a9", darkgreen: "006400", darkgrey: "a9a9a9", darkkhaki: "bdb76b", darkmagenta: "8b008b", darkolivegreen: "556b2f", darkorange: "ff8c00", darkorchid: "9932cc", darkred: "8b0000", darksalmon: "e9967a", darkseagreen: "8fbc8f", darkslateblue: "483d8b", darkslategray: "2f4f4f", darkslategrey: "2f4f4f", darkturquoise: "00ced1", darkviolet: "9400d3", deeppink: "ff1493", deepskyblue: "00bfff", dimgray: "696969", dimgrey: "696969", dodgerblue: "1e90ff", firebrick: "b22222", floralwhite: "fffaf0", forestgreen: "228b22", fuchsia: "f0f", gainsboro: "dcdcdc", ghostwhite: "f8f8ff", gold: "ffd700", goldenrod: "daa520", gray: "808080", green: "008000", greenyellow: "adff2f", grey: "808080", honeydew: "f0fff0", hotpink: "ff69b4", indianred: "cd5c5c", indigo: "4b0082", ivory: "fffff0", khaki: "f0e68c", lavender: "e6e6fa", lavenderblush: "fff0f5", lawngreen: "7cfc00", lemonchiffon: "fffacd", lightblue: "add8e6", lightcoral: "f08080", lightcyan: "e0ffff", lightgoldenrodyellow: "fafad2", lightgray: "d3d3d3", lightgreen: "90ee90", lightgrey: "d3d3d3", lightpink: "ffb6c1", lightsalmon: "ffa07a", lightseagreen: "20b2aa", lightskyblue: "87cefa", lightslategray: "789", lightslategrey: "789", lightsteelblue: "b0c4de", lightyellow: "ffffe0", lime: "0f0", limegreen: "32cd32", linen: "faf0e6", magenta: "f0f", maroon: "800000", mediumaquamarine: "66cdaa", mediumblue: "0000cd", mediumorchid: "ba55d3", mediumpurple: "9370db", mediumseagreen: "3cb371", mediumslateblue: "7b68ee", mediumspringgreen: "00fa9a", mediumturquoise: "48d1cc", mediumvioletred: "c71585", midnightblue: "191970", mintcream: "f5fffa", mistyrose: "ffe4e1", moccasin: "ffe4b5", navajowhite: "ffdead", navy: "000080", oldlace: "fdf5e6", olive: "808000", olivedrab: "6b8e23", orange: "ffa500", orangered: "ff4500", orchid: "da70d6", palegoldenrod: "eee8aa", palegreen: "98fb98", paleturquoise: "afeeee", palevioletred: "db7093", papayawhip: "ffefd5", peachpuff: "ffdab9", peru: "cd853f", pink: "ffc0cb", plum: "dda0dd", powderblue: "b0e0e6", purple: "800080", rebeccapurple: "663399", red: "f00", rosybrown: "bc8f8f", royalblue: "4169e1", saddlebrown: "8b4513", salmon: "fa8072", sandybrown: "f4a460", seagreen: "2e8b57", seashell: "fff5ee", sienna: "a0522d", silver: "c0c0c0", skyblue: "87ceeb", slateblue: "6a5acd", slategray: "708090", slategrey: "708090", snow: "fffafa", springgreen: "00ff7f", steelblue: "4682b4", tan: "d2b48c", teal: "008080", thistle: "d8bfd8", tomato: "ff6347", turquoise: "40e0d0", violet: "ee82ee", wheat: "f5deb3", white: "fff", whitesmoke: "f5f5f5", yellow: "ff0", yellowgreen: "9acd32" }, L2 = c2.hexNames = function(n3) {
    var t3 = {};
    for (var e3 in n3)
      n3.hasOwnProperty(e3) && (t3[n3[e3]] = e3);
    return t3;
  }(T2);
  function I2(n3) {
    return n3 = parseFloat(n3), (isNaN(n3) || n3 < 0 || n3 > 1) && (n3 = 1), n3;
  }
  function R2(t3, e3) {
    (function(n3) {
      return "string" == typeof n3 && -1 != n3.indexOf(".") && 1 === parseFloat(n3);
    })(t3) && (t3 = "100%");
    var r3 = function(n3) {
      return "string" == typeof n3 && -1 != n3.indexOf("%");
    }(t3);
    return t3 = i2(e3, a2(0, parseFloat(t3))), r3 && (t3 = parseInt(t3 * e3, 10) / 100), n2.abs(t3 - e3) < 1e-6 ? 1 : t3 % e3 / parseFloat(e3);
  }
  function G2(n3) {
    return i2(1, a2(0, n3));
  }
  function O2(n3) {
    return parseInt(n3, 16);
  }
  function H2(n3) {
    return 1 == n3.length ? "0" + n3 : "" + n3;
  }
  function j2(n3) {
    return n3 <= 1 && (n3 = 100 * n3 + "%"), n3;
  }
  function B2(t3) {
    return n2.round(255 * parseFloat(t3)).toString(16);
  }
  function M2(n3) {
    return O2(n3) / 255;
  }
  var W2, z2, E2, P2 = (z2 = "[\\s|\\(]+(" + (W2 = "(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)") + ")[,|\\s]+(" + W2 + ")[,|\\s]+(" + W2 + ")\\s*\\)?", E2 = "[\\s|\\(]+(" + W2 + ")[,|\\s]+(" + W2 + ")[,|\\s]+(" + W2 + ")[,|\\s]+(" + W2 + ")\\s*\\)?", { CSS_UNIT: new RegExp(W2), rgb: new RegExp("rgb" + z2), rgba: new RegExp("rgba" + E2), hsl: new RegExp("hsl" + z2), hsla: new RegExp("hsla" + E2), hsv: new RegExp("hsv" + z2), hsva: new RegExp("hsva" + E2), hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ });
  function D2(n3) {
    return !!P2.CSS_UNIT.exec(n3);
  }
  g.exports ? g.exports = c2 : window.tinycolor = c2;
}(Math);
const y = a(b.exports);
var m = globalThis && globalThis.__assign || function() {
  return m = Object.assign || function(n2) {
    for (var t2, e2 = 1, r2 = arguments.length; e2 < r2; e2++)
      for (var o2 in t2 = arguments[e2])
        Object.prototype.hasOwnProperty.call(t2, o2) && (n2[o2] = t2[o2]);
    return n2;
  }, m.apply(this, arguments);
}, x = globalThis && globalThis.__spreadArray || function(n2, t2, e2) {
  if (e2 || 2 === arguments.length)
    for (var r2, o2 = 0, i2 = t2.length; o2 < i2; o2++)
      !r2 && o2 in t2 || (r2 || (r2 = Array.prototype.slice.call(t2, 0, o2)), r2[o2] = t2[o2]);
  return n2.concat(r2 || Array.prototype.slice.call(t2));
}, C = function(n2) {
  void 0 === n2 && (n2 = "");
  var t2 = { linearGradient: /^(-(webkit|o|ms|moz)-)?(linear-gradient)/i, repeatingLinearGradient: /^(-(webkit|o|ms|moz)-)?(repeating-linear-gradient)/i, radialGradient: /^(-(webkit|o|ms|moz)-)?(radial-gradient)/i, repeatingRadialGradient: /^(-(webkit|o|ms|moz)-)?(repeating-radial-gradient)/i, sideOrCorner: /^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i, extentKeywords: /^(closest-side|closest-corner|farthest-side|farthest-corner|contain|cover)/, positionKeywords: /^(left|center|right|top|bottom)/i, pixelValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/, percentageValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))%/, emValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/, angleValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/, startCall: /^\(/, endCall: /^\)/, comma: /^,/, hexColor: /^#([0-9a-fA-F]+)/, literalColor: /^([a-zA-Z]+)/, rgbColor: /^rgb/i, spacedRgbColor: /^(\d{1,3})\s+(\d{1,3})\s+(\d{1,3})\s+\/\s+([0-1](\.\d+)?)/, rgbaColor: /^rgba/i, hslColor: /^hsl/i, hsvColor: /^hsv/i, number: /^(([0-9]*\.[0-9]+)|([0-9]+\.?))/ };
  function e2(t3) {
    throw new Error(n2 + ": " + t3);
  }
  function r2(t3) {
    n2 = n2.substr(t3);
  }
  function o2(t3) {
    var e3 = /^[\n\r\t\s]+/.exec(n2);
    e3 && r2(e3[0].length);
    var o3 = t3.exec(n2);
    return o3 && r2(o3[0].length), o3;
  }
  function i2(n3) {
    var r3 = n3(), i3 = [];
    if (r3)
      for (i3.push(r3); o2(t2.comma); )
        (r3 = n3()) ? i3.push(r3) : e2("One extra comma");
    return i3;
  }
  function a2(n3, t3, e3) {
    var r3 = o2(t3);
    if (r3)
      return { type: n3, value: r3[e3] };
  }
  var l2 = function(n3) {
    var t3 = j(null == n3 ? void 0 : n3[0]);
    return { value: "".concat(t3 ? "RGBA" : "rgba", "(").concat(i2(k2), ")") };
  };
  function c2(n3, r3) {
    var i3 = o2(n3);
    if (i3) {
      o2(t2.startCall) || e2("Missing (");
      var a3 = r3(i3);
      return o2(t2.endCall) || e2("Missing )"), a3;
    }
  }
  function u2() {
    return function() {
      var n3 = a2("hex", t2.hexColor, 1);
      if (null == n3 ? void 0 : n3.value) {
        var e3 = y(null == n3 ? void 0 : n3.value).toRgb(), r3 = e3.r, o3 = e3.g, i3 = e3.b, l3 = e3.a;
        return { value: "rgba(".concat(r3, ", ").concat(o3, ", ").concat(i3, ", ").concat(l3, ")") };
      }
    }() || c2(t2.hslColor, A2) || c2(t2.rgbaColor, l2) || c2(t2.rgbColor, L2) || function() {
      var n3 = a2("literal", t2.literalColor, 0);
      if (null == n3 ? void 0 : n3.value) {
        var e3 = y(null == n3 ? void 0 : n3.value).toRgb(), r3 = e3.r, o3 = e3.g, i3 = e3.b, l3 = e3.a;
        return { value: "rgba(".concat(r3, ", ").concat(o3, ", ").concat(i3, ", ").concat(l3, ")") };
      }
    }() || c2(t2.hsvColor, T2);
  }
  function d2() {
    var n3, t3 = u2();
    return t3 || e2("Expected color definition"), t3.left = parseInt(null === (n3 = I2()) || void 0 === n3 ? void 0 : n3.value), t3;
  }
  function s2(n3, r3, a3) {
    return c2(r3, function() {
      var r4 = a3();
      return r4 && (o2(t2.comma) || e2("Missing comma before color stops")), { type: n3, orientation: r4, colorStops: i2(d2) };
    });
  }
  function f2() {
    return a2("directional", t2.sideOrCorner, 1) || a2("angular", t2.angleValue, 1);
  }
  function g2() {
    return s2("linear-gradient", t2.linearGradient, f2) || s2("repeating-linear-gradient", t2.repeatingLinearGradient, f2) || s2("radial-gradient", t2.radialGradient, h2) || s2("repeating-radial-gradient", t2.repeatingRadialGradient, h2);
  }
  function h2() {
    var e3, r3, i3 = p2();
    return i3 && ((e3 = []).push(i3), r3 = n2, o2(t2.comma) && ((i3 = p2()) ? e3.push(i3) : n2 = r3)), e3;
  }
  function p2() {
    var n3 = function() {
      var n4 = a2("shape", /^(circle)/i, 0);
      n4 && (n4.style = v2() || b2());
      return n4;
    }() || function() {
      var n4 = a2("shape", /^(ellipse)/i, 0);
      n4 && (n4.style = I2() || b2());
      return n4;
    }();
    if (n3)
      n3.at = C2();
    else {
      var t3 = b2();
      if (t3) {
        n3 = t3;
        var e3 = C2();
        e3 && (n3.at = e3);
      } else {
        var r3 = w2();
        r3 && (n3 = { type: "default-radial", at: r3 });
      }
    }
    return n3;
  }
  function v2() {
    return a2("px", t2.pixelValue, 1) || a2("em", t2.emValue, 1);
  }
  function b2() {
    return a2("extent-keyword", t2.extentKeywords, 1);
  }
  function C2() {
    if (a2("position", /^at/, 0)) {
      var n3 = w2();
      return n3 || e2("Missing positioning value"), n3;
    }
  }
  function w2() {
    var n3 = { x: I2(), y: I2() };
    if (n3.x || n3.y)
      return { type: "position", value: n3 };
  }
  function k2() {
    return o2(t2.number)[1];
  }
  var A2 = function(n3) {
    var t3 = j(null == n3 ? void 0 : n3[0]), e3 = i2(k2), r3 = y({ h: e3[0], s: e3[1], l: e3[2], a: e3[3] || 1 }).toRgb(), o3 = r3.r, a3 = r3.g, l3 = r3.b, c3 = r3.a;
    return { value: "".concat(t3 ? "RGBA" : "rgba", "(").concat(o3, ", ").concat(a3, ", ").concat(l3, ", ").concat(c3, ")") };
  }, T2 = function(n3) {
    var t3 = j(null == n3 ? void 0 : n3[0]), e3 = i2(k2), r3 = y({ h: e3[0], s: e3[1], v: e3[2], a: e3[3] || 1 }).toRgb(), o3 = r3.r, a3 = r3.g, l3 = r3.b, c3 = r3.a;
    return { value: "".concat(t3 ? "RGBA" : "rgba", "(").concat(o3, ", ").concat(a3, ", ").concat(l3, ", ").concat(c3, ")") };
  }, L2 = function(n3) {
    var e3 = j(null == n3 ? void 0 : n3[0]), r3 = o2(t2.spacedRgbColor) || x([null], i2(k2), true), a3 = r3[1], l3 = r3[2], c3 = r3[3], u3 = r3[4], d3 = void 0 === u3 ? 1 : u3;
    return { value: "".concat(e3 ? "RGBA" : "rgba", "(").concat(a3, ", ").concat(l3, ", ").concat(c3, ", ").concat(d3, ")") };
  };
  function I2() {
    return a2("%", t2.percentageValue, 1) || a2("position-keyword", t2.positionKeywords, 1) || v2();
  }
  return function() {
    var t3, r3 = i2(g2);
    n2.length > 0 && e2("Invalid input not EOF");
    var o3 = r3[0], a3 = null === (t3 = null == o3 ? void 0 : o3.colorStops) || void 0 === t3 ? void 0 : t3.filter(function(n3) {
      return j(n3.value);
    }).length;
    return function() {
      if (a3 > 0)
        return o3;
      var n3 = function(n4, t4) {
        return 0 === t4 ? _(n4) : S(n4);
      };
      return m(m({}, o3), { colorStops: o3.colorStops.map(function(t4, e3) {
        return m(m({}, t4), { value: n3(t4, e3) });
      }) });
    }();
  }();
}, w = h.defaultColor, k = h.defaultGradient, S = function(n2) {
  return n2.value.toLowerCase();
}, _ = function(n2) {
  return n2.value.toUpperCase();
}, A = function(n2) {
  if (null == n2 ? void 0 : n2.includes("gradient")) {
    var t2 = null == n2 ? void 0 : n2.includes("conic"), e2 = C(t2 ? k : n2);
    return null == e2 ? void 0 : e2.colorStops;
  }
  return [{ value: n2 || w }];
}, T = function(n2, t2, e2) {
  return isNaN(n2) || n2 < t2 ? t2 : n2 > e2 ? e2 : n2;
}, L = function(n2) {
  return Math.round(n2);
}, I = globalThis && globalThis.__assign || function() {
  return I = Object.assign || function(n2) {
    for (var t2, e2 = 1, r2 = arguments.length; e2 < r2; e2++)
      for (var o2 in t2 = arguments[e2])
        Object.prototype.hasOwnProperty.call(t2, o2) && (n2[o2] = t2[o2]);
    return n2;
  }, I.apply(this, arguments);
}, R = h.barSize, G = h.crossSize, O = function(n2) {
  var t2 = n2.target.parentNode.getBoundingClientRect(), e2 = "c-resize ps-rl" === n2.target.className ? 15 : 0;
  return { offsetLeft: (null == t2 ? void 0 : t2.x) + e2, offsetTop: null == t2 ? void 0 : t2.y, clientWidth: null == t2 ? void 0 : t2.width, clientHeight: null == t2 ? void 0 : t2.height };
};
function H(n2) {
  var t2 = O(n2), e2 = t2.offsetLeft, r2 = t2.clientWidth, o2 = n2.clientX - e2 - R / 2, i2 = r2 - 18, a2 = T(o2, 0, i2);
  return Math.round(a2 / (i2 / 100));
}
var j = function(n2) {
  var t2;
  return (null == n2 ? void 0 : n2[0]) === (null === (t2 = null == n2 ? void 0 : n2[0]) || void 0 === t2 ? void 0 : t2.toUpperCase());
}, B = function(n2) {
  return "to top" === n2 ? 0 : "to bottom" === n2 ? 180 : "to left" === n2 ? 270 : "to right" === n2 ? 90 : "to top right" === n2 ? 45 : "to bottom right" === n2 ? 135 : "to bottom left" === n2 ? 225 : "to top left" === n2 ? 315 : parseInt(n2 || 0);
}, M = function(n2) {
  var t2 = null == n2 ? void 0 : n2.map(function(n3, t3) {
    return I(I({}, n3), { index: t3 });
  }), e2 = (null == t2 ? void 0 : t2.find(function(n3) {
    return j(n3.value);
  })) || t2[0];
  return { currentColor: (null == e2 ? void 0 : e2.value) || (null == h ? void 0 : h.defaultGradient), selectedColor: (null == e2 ? void 0 : e2.index) || 0, currentLeft: (null == e2 ? void 0 : e2.left) || 0 };
}, W = function(n2) {
  var t2 = null == n2 ? void 0 : n2.includes("gradient"), e2 = null == n2 ? void 0 : n2.split("(")[0], r2 = function(n3) {
    var t3, e3 = null == n3 ? void 0 : n3.split(",")[0], r3 = null === (t3 = null == e3 ? void 0 : e3.split("(")[1]) || void 0 === t3 ? void 0 : t3.replace("deg", "");
    return B(r3);
  }(n2);
  return { degrees: r2, degreeStr: "linear-gradient" === e2 ? "".concat(r2, "deg") : "circle", isGradient: t2, gradientType: e2 };
}, z = globalThis && globalThis.__assign || function() {
  return z = Object.assign || function(n2) {
    for (var t2, e2 = 1, r2 = arguments.length; e2 < r2; e2++)
      for (var o2 in t2 = arguments[e2])
        Object.prototype.hasOwnProperty.call(t2, o2) && (n2[o2] = t2[o2]);
    return n2;
  }, z.apply(this, arguments);
}, E = globalThis && globalThis.__spreadArray || function(n2, t2, e2) {
  if (e2 || 2 === arguments.length)
    for (var r2, o2 = 0, i2 = t2.length; o2 < i2; o2++)
      !r2 && o2 in t2 || (r2 || (r2 = Array.prototype.slice.call(t2, 0, o2)), r2[o2] = t2[o2]);
  return n2.concat(r2 || Array.prototype.slice.call(t2));
}, P = e(null);
function D(e2) {
  var r2 = e2.value, o2 = e2.children, i2 = e2.onChange, a2 = e2.squareWidth, c2 = e2.hideOpacity, u2 = e2.squareHeight, d2 = e2.defaultStyles, s2 = A(r2), f2 = W(r2), g2 = f2.degrees, h2 = f2.degreeStr, p2 = f2.isGradient, v2 = f2.gradientType, b2 = M(s2), m2 = b2.currentColor, x2 = b2.selectedColor, C2 = b2.currentLeft, w2 = n("rgb"), k2 = w2[0], T2 = w2[1], L2 = n({}), I2 = L2[0], R2 = L2[1], G2 = y(m2), O2 = G2.toRgb(), H2 = G2.toHsv(), B2 = n(z(z({}, O2), H2)), D2 = B2[0], F2 = B2[1];
  t(function() {
    0 === (null == H2 ? void 0 : H2.s) ? F2(z(z(z({}, O2), H2), { h: null == D2 ? void 0 : D2.h })) : F2(z(z({}, O2), H2));
  }, [m2]);
  var q2 = function(n2) {
    var t2 = n2.sort(function(n3, t3) {
      return n3.left - t3.left;
    }), e3 = null == t2 ? void 0 : t2.map(function(n3) {
      return "".concat(null == n3 ? void 0 : n3.value, " ").concat(n3.left, "%");
    }), r3 = "".concat(v2, "(").concat(h2, ", ").concat(e3.join(", "), ")");
    R2(z(z({}, I2), { gradient: r3 })), i2(r3);
  }, N2 = function(n2, t2) {
    var e3 = null == s2 ? void 0 : s2.filter(function(n3) {
      return !j(n3.value);
    }), r3 = E([{ value: n2.toUpperCase(), left: null != t2 ? t2 : C2 }], e3, true);
    q2(r3);
  }, V2 = { hc: D2, setHc: F2, value: r2, colors: s2, degrees: g2, onChange: i2, previous: I2, inputType: k2, tinyColor: G2, isGradient: p2, squareWidth: a2, hideOpacity: c2, currentLeft: C2, deletePoint: function() {
    if ((null == s2 ? void 0 : s2.length) > 2) {
      var n2 = null == s2 ? void 0 : s2.map(function(n3, t3) {
        return z(z({}, n3), { value: t3 === x2 - 1 ? _(n3) : S(n3) });
      }), t2 = null == n2 ? void 0 : n2.filter(function(n3, t3) {
        return t3 !== x2;
      });
      q2(t2);
    }
  }, squareHeight: u2, setInputType: T2, gradientType: v2, handleChange: function(n2) {
    p2 ? N2(n2) : (R2(z(z({}, I2), { color: n2 })), i2(n2));
  }, currentColor: m2, selectedColor: x2, defaultStyles: d2, handleGradient: N2, createGradientStr: q2 };
  return l(P.Provider, { value: V2, children: o2 });
}
function F() {
  var n2 = r(P);
  if (!n2)
    throw new Error("usePicker has to be used within <PickerContext.Provider>");
  return n2;
}
const q = function(n2, e2) {
  t(function() {
    var t2, r2 = null === (t2 = null == n2 ? void 0 : n2.current) || void 0 === t2 ? void 0 : t2.getContext("2d", { willReadFrequently: true });
    if (r2) {
      r2.rect(0, 0, e2, 14);
      for (var o2 = r2.createLinearGradient(0, 0, e2, 0), i2 = 0; i2 <= 360; i2 += 30)
        o2.addColorStop(i2 / 360, "hsl(".concat(i2, ", 100%, 50%)"));
      r2.fillStyle = o2, r2.fill();
    }
  }, [n2, e2]);
};
var N = globalThis && globalThis.__assign || function() {
  return N = Object.assign || function(n2) {
    for (var t2, e2 = 1, r2 = arguments.length; e2 < r2; e2++)
      for (var o2 in t2 = arguments[e2])
        Object.prototype.hasOwnProperty.call(t2, o2) && (n2[o2] = t2[o2]);
    return n2;
  }, N.apply(this, arguments);
};
const V = function() {
  var e2 = o(null), r2 = F(), i2 = r2.handleChange, a2 = r2.squareWidth, u2 = r2.hc, d2 = r2.setHc, s2 = n(false), f2 = s2[0], g2 = s2[1];
  q(e2, a2);
  var h2 = function(n2) {
    var t2 = 3.6 * H(n2), e3 = y({ h: t2, s: null == u2 ? void 0 : u2.s, v: null == u2 ? void 0 : u2.v }).toRgb(), r3 = e3.r, o2 = e3.g, a3 = e3.b;
    i2("rgba(".concat(r3, ", ").concat(o2, ", ").concat(a3, ", ").concat(u2.a, ")")), d2(N(N({}, u2), { h: t2 }));
  };
  return t(function() {
    var n2 = function() {
      g2(false);
    };
    return window.addEventListener("mouseup", n2), function() {
      window.removeEventListener("mouseup", n2);
    };
  }, []), c("div", { style: { height: 14, marginTop: 17, marginBottom: 4, cursor: "ew-resize", position: "relative" }, onMouseMove: function(n2) {
    return function(n3) {
      f2 && h2(n3);
    }(n2);
  }, children: [l("div", { tabIndex: 0, role: "button", style: { border: "2px solid white", borderRadius: "50%", boxShadow: "0px 0px 3px rgba(0, 0, 0, 0.5)", width: "18px", height: "18px", zIndex: 1e3, transition: "all 10ms linear", position: "absolute", left: (null == u2 ? void 0 : u2.h) * ((a2 - 18) / 360), top: -2, cursor: "ew-resize", boxSizing: "border-box" }, onMouseDown: function() {
    g2(true);
  } }), l("canvas", { ref: e2, height: "14px", width: "".concat(a2, "px"), onClick: function(n2) {
    return function(n3) {
      f2 || h2(n3);
    }(n2);
  }, style: { position: "relative", borderRadius: 14, verticalAlign: "top" } })] });
};
function Z(n2, t2, e2) {
  var r2 = 0, o2 = 0, i2 = 0;
  if (null === n2 || null === t2 || null === e2 || isNaN(n2) || isNaN(t2) || isNaN(e2))
    return { c: 0, m: 0, k: 0, y: 1 };
  if (n2 < 0 || t2 < 0 || e2 < 0 || n2 > 255 || t2 > 255 || e2 > 255)
    return { c: 0, m: 0, k: 0, y: 1 };
  if (0 === n2 && 0 === t2 && 0 === e2)
    return 1, { c: 0, m: 0, k: 0, y: 1 };
  r2 = 1 - n2 / 255, o2 = 1 - t2 / 255, i2 = 1 - e2 / 255;
  var a2 = Math.min(r2, Math.min(o2, i2));
  return { c: r2 = (r2 - a2) / (1 - a2), m: o2 = (o2 - a2) / (1 - a2), y: i2 = (i2 - a2) / (1 - a2), k: a2 };
}
var X = globalThis && globalThis.__assign || function() {
  return X = Object.assign || function(n2) {
    for (var t2, e2 = 1, r2 = arguments.length; e2 < r2; e2++)
      for (var o2 in t2 = arguments[e2])
        Object.prototype.hasOwnProperty.call(t2, o2) && (n2[o2] = t2[o2]);
    return n2;
  }, X.apply(this, arguments);
}, K = function(e2) {
  var r2 = e2.value, o2 = e2.callback, i2 = e2.max, a2 = void 0 === i2 ? 100 : i2, u2 = e2.label, d2 = n(r2), s2 = d2[0], f2 = d2[1], g2 = F(), h2 = g2.hideOpacity, p2 = g2.defaultStyles, v2 = h2 ? "22%" : "18%";
  t(function() {
    f2(r2);
  }, [r2]);
  return c("div", { style: { width: v2 }, children: [l("input", { value: s2, id: "rbgcp-input", onChange: function(n2) {
    return function(n3) {
      var t2 = T(parseFloat(n3.target.value), 0, a2);
      f2(t2), o2(t2);
    }(n2);
  }, style: X({}, p2.rbgcpInput) }), l("div", { style: X({}, p2.rbgcpInputLabel), children: u2 })] });
}, Y = function(e2) {
  var r2 = e2.opacity, o2 = F(), i2 = o2.handleChange, a2 = o2.tinyColor, u2 = o2.defaultStyles, d2 = n(""), s2 = d2[0], f2 = d2[1], g2 = a2.toHex(), h2 = n(g2), p2 = h2[0], v2 = h2[1];
  t(function() {
    "hex" !== s2 && v2(g2);
  }, [a2, s2, g2]);
  return c("div", { style: { width: "23%" }, children: [l("input", { value: p2, onBlur: function() {
    f2("");
  }, onFocus: function() {
    f2("hex");
  }, id: "rbgcp-hex-input", onChange: function(n2) {
    return function(n3) {
      var t2 = y(n3.target.value);
      if (v2(n3.target.value), t2.isValid()) {
        var e3 = t2.toRgb(), o3 = e3.r, a3 = e3.g, l2 = e3.b, c2 = "rgba(".concat(o3, ", ").concat(a3, ", ").concat(l2, ", ").concat(r2, ")");
        i2(c2);
      }
    }(n2);
  }, style: X(X({}, u2.rbgcpInput), u2.rbgcpHexInput) }), l("div", { style: X({}, u2.rbgcpInputLabel), children: "HEX" })] });
}, U = function() {
  var n2 = F(), t2 = n2.handleChange, e2 = n2.hc, r2 = function(n3) {
    var r3 = n3.r, o2 = n3.g, i2 = n3.b;
    t2("rgba(".concat(r3, ", ").concat(o2, ", ").concat(i2, ", ").concat(null == e2 ? void 0 : e2.a, ")"));
  };
  return c(u, { children: [l(K, { value: null == e2 ? void 0 : e2.r, callback: function(n3) {
    return r2({ r: n3, g: null == e2 ? void 0 : e2.g, b: null == e2 ? void 0 : e2.b });
  }, label: "R", max: 255 }), l(K, { value: null == e2 ? void 0 : e2.g, callback: function(n3) {
    return r2({ r: null == e2 ? void 0 : e2.r, g: n3, b: null == e2 ? void 0 : e2.b });
  }, label: "G", max: 255 }), l(K, { value: null == e2 ? void 0 : e2.b, callback: function(n3) {
    return r2({ r: null == e2 ? void 0 : e2.r, g: null == e2 ? void 0 : e2.g, b: n3 });
  }, label: "B", max: 255 })] });
}, $ = function() {
  var n2 = F(), t2 = n2.handleChange, e2 = n2.tinyColor, r2 = n2.setHc, o2 = n2.hc, i2 = e2.toHsl(), a2 = i2.s, d2 = i2.l, s2 = function(n3) {
    var e3 = y(n3).toRgb(), r3 = e3.r, i3 = e3.g, a3 = e3.b;
    t2("rgba(".concat(r3, ", ").concat(i3, ", ").concat(a3, ", ").concat(null == o2 ? void 0 : o2.a, ")"));
  };
  return c(u, { children: [l(K, { value: L(null == o2 ? void 0 : o2.h), callback: function(n3) {
    return function(n4, e3, i3) {
      var a3 = y({ h: n4, s: e3, l: i3 }).toRgb(), l2 = a3.r, c2 = a3.g, u2 = a3.b;
      t2("rgba(".concat(l2, ", ").concat(c2, ", ").concat(u2, ", ").concat(null == o2 ? void 0 : o2.a, ")")), r2(X(X({}, o2), { h: n4 }));
    }(n3, a2, d2);
  }, label: "H", max: 360 }), l(K, { value: L(100 * a2), callback: function(n3) {
    return s2({ h: null == o2 ? void 0 : o2.h, s: n3, l: d2 });
  }, label: "S" }), l(K, { value: L(100 * d2), callback: function(n3) {
    return s2({ h: null == o2 ? void 0 : o2.h, s: a2, l: n3 });
  }, label: "L" })] });
}, J = function() {
  var n2 = F(), t2 = n2.handleChange, e2 = n2.setHc, r2 = n2.hc, o2 = function(n3) {
    var e3 = y(n3).toRgb(), o3 = e3.r, i2 = e3.g, a2 = e3.b;
    t2("rgba(".concat(o3, ", ").concat(i2, ", ").concat(a2, ", ").concat(null == r2 ? void 0 : r2.a, ")"));
  };
  return c(u, { children: [l(K, { value: L(null == r2 ? void 0 : r2.h), callback: function(n3) {
    return function(n4, o3, i2) {
      var a2 = y({ h: n4, s: o3, v: i2 }).toRgb(), l2 = a2.r, c2 = a2.g, u2 = a2.b;
      t2("rgba(".concat(l2, ", ").concat(c2, ", ").concat(u2, ", ").concat(null == r2 ? void 0 : r2.a, ")")), e2(X(X({}, r2), { h: n4 }));
    }(n3, null == r2 ? void 0 : r2.s, null == r2 ? void 0 : r2.v);
  }, label: "H", max: 360 }), l(K, { value: L(100 * (null == r2 ? void 0 : r2.s)), callback: function(n3) {
    return o2({ h: null == r2 ? void 0 : r2.h, s: n3, v: null == r2 ? void 0 : r2.v });
  }, label: "S" }), l(K, { value: L(100 * (null == r2 ? void 0 : r2.v)), callback: function(n3) {
    return o2({ h: null == r2 ? void 0 : r2.h, s: null == r2 ? void 0 : r2.s, v: n3 });
  }, label: "V" })] });
}, Q = function() {
  var n2 = F(), t2 = n2.handleChange, e2 = n2.hc, r2 = Z(null == e2 ? void 0 : e2.r, null == e2 ? void 0 : e2.g, null == e2 ? void 0 : e2.b), o2 = r2.c, i2 = r2.m, a2 = r2.y, d2 = r2.k, s2 = function(n3) {
    var r3 = function(n4) {
      var t3 = n4.c, e3 = n4.m, r4 = n4.y, o4 = n4.k;
      return { r: 255 * (1 - t3) * (1 - o4), g: 255 * (1 - e3) * (1 - o4), b: 255 * (1 - r4) * (1 - o4) };
    }(n3), o3 = r3.r, i3 = r3.g, a3 = r3.b;
    t2("rgba(".concat(o3, ", ").concat(i3, ", ").concat(a3, ", ").concat(null == e2 ? void 0 : e2.a, ")"));
  };
  return c(u, { children: [l(K, { value: L(100 * o2), callback: function(n3) {
    return s2({ c: n3 / 100, m: i2, y: a2, k: d2 });
  }, label: "C" }), l(K, { value: L(100 * i2), callback: function(n3) {
    return s2({ c: o2, m: n3 / 100, y: a2, k: d2 });
  }, label: "M" }), l(K, { value: L(100 * a2), callback: function(n3) {
    return s2({ c: o2, m: i2, y: n3 / 100, k: d2 });
  }, label: "Y" }), l(K, { value: L(100 * d2), callback: function(n3) {
    return s2({ c: o2, m: i2, y: a2, k: n3 / 100 });
  }, label: "K" })] });
};
const nn = function() {
  var n2 = F(), t2 = n2.handleChange, e2 = n2.inputType, r2 = n2.hideOpacity, o2 = n2.hc, i2 = n2.defaultStyles;
  return c("div", { style: X({ paddingTop: 14, display: "flex", justifyContent: "space-between" }, i2.rbgcpInputsWrap), id: "rbgcp-inputs-wrap", children: ["cmyk" !== e2 && l(Y, { opacity: null == o2 ? void 0 : o2.a }), "hsl" === e2 && l($, {}), "rgb" === e2 && l(U, {}), "hsv" === e2 && l(J, {}), "cmyk" === e2 && l(Q, {}), !r2 && l(K, { value: Math.round(100 * (null == o2 ? void 0 : o2.a)), callback: function(n3) {
    return t2("rgba(".concat(null == o2 ? void 0 : o2.r, ", ").concat(null == o2 ? void 0 : o2.g, ", ").concat(null == o2 ? void 0 : o2.b, ", ").concat(n3 / 100, ")"));
  }, label: "A" })] });
};
const tn = function(n2, e2, r2, o2) {
  t(function() {
    if (n2.current) {
      var t2 = n2.current.getContext("2d", { willReadFrequently: true });
      if (t2) {
        t2.fillStyle = "hsl(".concat(e2, ", 100%, 50%)"), t2.fillRect(0, 0, r2, o2);
        var i2 = t2.createLinearGradient(0, 0, r2, 0);
        i2.addColorStop(0, "rgba(255, 255, 255, 1)"), i2.addColorStop(1, "rgba(255, 255, 255, 0)"), t2.fillStyle = i2, t2.fillRect(0, 0, r2, o2);
        var a2 = t2.createLinearGradient(0, 0, 0, o2);
        a2.addColorStop(0, "rgba(0, 0, 0, 0)"), a2.addColorStop(1, "rgba(0, 0, 0, 1)"), t2.fillStyle = a2, t2.fillRect(0, 0, r2, o2);
      }
    }
  }, [n2, e2, r2, o2]);
};
var en = globalThis && globalThis.__assign || function() {
  return en = Object.assign || function(n2) {
    for (var t2, e2 = 1, r2 = arguments.length; e2 < r2; e2++)
      for (var o2 in t2 = arguments[e2])
        Object.prototype.hasOwnProperty.call(t2, o2) && (n2[o2] = t2[o2]);
    return n2;
  }, en.apply(this, arguments);
}, rn = h.crossSize;
const on = function() {
  var e2 = F(), r2 = e2.hc, i2 = e2.defaultStyles, a2 = e2.squareWidth, u2 = e2.squareHeight, s2 = e2.handleChange, f2 = n(false), g2 = f2[0], h2 = f2[1], p2 = o(null), v2 = function(n2, t2, e3, r3) {
    return [n2 * e3 - G / 2, (100 - t2) / 100 * r3 - G / 2];
  }(null == r2 ? void 0 : r2.s, 100 * (null == r2 ? void 0 : r2.v), a2, u2), b2 = v2[0], m2 = v2[1], x2 = n({ x: b2, y: m2 }), C2 = x2[0], w2 = x2[1];
  tn(p2, null == r2 ? void 0 : r2.h, a2, u2), t(function() {
    g2 || w2({ x: 0 === (null == r2 ? void 0 : r2.v) ? C2.x : b2, y: m2 });
  }, [b2, m2]);
  var k2 = function(n2) {
    var t2 = d(function() {
      var t3 = function(n3) {
        var t4 = O(n3), e4 = t4.offsetLeft, r3 = t4.offsetTop, o3 = t4.clientWidth, i4 = t4.clientHeight, a3 = function(n4) {
          if (n4.clientX)
            return { clientX: n4.clientX, clientY: n4.clientY };
          var t5 = n4.touches[0] || {};
          return { clientX: t5.clientX, clientY: t5.clientY };
        }(n3), l3 = a3.clientX, c3 = a3.clientY;
        return [T(l3 - e4 - G / 2, -9, o3 - 10), T(c3 - r3 - G / 2, -9, i4 - 10)];
      }(n2), e3 = t3[0], o2 = t3[1];
      if (e3 && o2) {
        var i3 = Math.min(e3 + rn / 2, a2 - 1), l2 = Math.min(o2 + rn / 2, u2 - 1), c2 = i3 / a2 * 100, d2 = 100 - l2 / u2 * 100;
        w2({ x: 0 === d2 ? null == C2 ? void 0 : C2.x : e3, y: o2 });
        var f3 = y("hsva(".concat(null == r2 ? void 0 : r2.h, ", ").concat(c2, "%, ").concat(d2, "%, ").concat(null == r2 ? void 0 : r2.a, ")"));
        s2(f3.toRgbString());
      }
    }, 250);
    t2();
  }, S2 = function() {
    h2(false);
  }, _2 = function(n2) {
    h2(true), k2(n2);
  };
  return t(function() {
    var n2 = function() {
      S2();
    };
    return window.addEventListener("mouseup", n2), function() {
      window.removeEventListener("mouseup", n2);
    };
  }, []), l("div", { style: { position: "relative" }, children: c("div", { onMouseUp: S2, onTouchEnd: S2, onMouseDown: _2, onTouchStart: _2, onMouseMove: function(n2) {
    return function(n3) {
      g2 && k2(n3);
    }(n2);
  }, style: { position: "relative", cursor: "ew-cross" }, children: [l("div", { style: en(en(en({}, i2.rbgcpHandle), { transform: "translate(".concat((null == C2 ? void 0 : C2.x) || 0, "px, ").concat((null == C2 ? void 0 : C2.y) || 0, "px)") }), g2 ? { transition: "" } : {}), onMouseDown: function() {
    h2(true);
  } }), l("div", { style: en(en({}, i2.rbgcpCanvasWrapper), { height: u2 }), onClick: function(n2) {
    return function(n3) {
      g2 || k2(n3);
    }(n2);
  }, children: l("canvas", { ref: p2, id: "paintSquare", width: "".concat(a2, "px"), height: "".concat(u2, "px") }) })] }) });
};
var an = globalThis && globalThis.__assign || function() {
  return an = Object.assign || function(n2) {
    for (var t2, e2 = 1, r2 = arguments.length; e2 < r2; e2++)
      for (var o2 in t2 = arguments[e2])
        Object.prototype.hasOwnProperty.call(t2, o2) && (n2[o2] = t2[o2]);
    return n2;
  }, an.apply(this, arguments);
};
const ln = function() {
  var e2 = F(), r2 = e2.handleChange, o2 = e2.hc, i2 = void 0 === o2 ? {} : o2, a2 = e2.squareWidth, u2 = e2.defaultStyles, d2 = n(false), s2 = d2[0], f2 = d2[1], g2 = i2.r, h2 = i2.g, p2 = i2.b, v2 = "linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(".concat(g2, ",").concat(h2, ",").concat(p2, ",.5) 100%)"), b2 = function(n2) {
    var t2 = H(n2) / 100, e3 = "rgba(".concat(g2, ", ").concat(h2, ", ").concat(p2, ", ").concat(t2, ")");
    r2(e3);
  }, y2 = a2 - 18;
  return t(function() {
    var n2 = function() {
      f2(false);
    };
    return window.addEventListener("mouseup", n2), function() {
      window.removeEventListener("mouseup", n2);
    };
  }, []), c("div", { onMouseDown: function() {
    f2(true);
  }, onMouseMove: function(n2) {
    return function(n3) {
      s2 && b2(n3);
    }(n2);
  }, style: { height: 14, marginTop: 17, marginBottom: 4, cursor: "ew-resize", position: "relative" }, children: [l("div", { style: an(an({}, u2.rbgcpCheckered), { width: "100%", height: 14 }) }), l("div", { style: an(an({}, u2.rbgcpHandle), { left: y2 * (null == i2 ? void 0 : i2.a), top: -2 }) }), l("div", { style: an(an({}, u2.rbgcpOpacityOverlay), { background: v2 }), onClick: function(n2) {
    return function(n3) {
      s2 || b2(n3);
    }(n2);
  } })] });
};
const cn = function(n2) {
  var t2 = n2.presets, e2 = void 0 === t2 ? [] : t2, r2 = F(), o2 = r2.value, i2 = r2.onChange, a2 = r2.handleChange, u2 = r2.squareWidth;
  return c("div", { style: { display: "flex", marginTop: 14, justifyContent: "space-between" }, children: [l("div", { style: { width: 50, height: 50, background: o2, borderRadius: 6, flexShrink: 0 } }), l("div", { style: { display: "flex", flexWrap: "wrap", width: u2 - 66, justifyContent: "space-between" }, children: ((null == e2 ? void 0 : e2.length) > 0 ? null == e2 ? void 0 : e2.slice(0, 18) : v).map(function(n3, t3) {
    return l("div", { style: { height: 23, width: "10.2%", borderRadius: 4, background: n3, marginBottom: 2, border: "rgba(255,255,255, 1)" === n3 ? "1px solid #96959c" : "" }, onClick: function() {
      var t4;
      (null == (t4 = n3) ? void 0 : t4.includes("gradient")) ? i2(t4) : a2(t4);
    } }, "".concat(n3, "-").concat(t3));
  }) })] });
};
var un = globalThis && globalThis.__assign || function() {
  return un = Object.assign || function(n2) {
    for (var t2, e2 = 1, r2 = arguments.length; e2 < r2; e2++)
      for (var o2 in t2 = arguments[e2])
        Object.prototype.hasOwnProperty.call(t2, o2) && (n2[o2] = t2[o2]);
    return n2;
  }, un.apply(this, arguments);
}, dn = function() {
  var n2 = F().defaultStyles;
  return l("svg", { id: "Layer_1", "data-name": "Layer 1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", style: { width: 15 }, children: l("polyline", { strokeLinecap: "round", strokeLinejoin: "round", style: un(un({}, { fill: "none", strokeWidth: "1.8px" }), n2.rbgcpControlIcon), points: "17.96 4.31 2.04 4.3 3.75 4.3 4.81 17.29 5.16 17.96 5.74 18.47 6.59 18.62 13.64 18.62 14.52 18.32 15.07 17.68 15.29 17.12 16.28 4.3 12.87 4.3 12.87 2.38 12.48 1.75 11.83 1.46 8.4 1.46 7.64 1.68 7.26 2.21 7.16 2.52 7.17 4.23" }) });
}, sn = function(n2) {
  var t2 = n2.color, e2 = F().defaultStyles, r2 = t2 || "";
  return l("svg", { id: "Layer_1", "data-name": "Layer 1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", style: { width: 14 }, children: l("polyline", { strokeLinecap: "round", strokeLinejoin: "round", style: un(un(un({}, { fill: "none", strokeWidth: "1.8px" }), e2.rbgcpControlIcon), r2 && { stroke: r2 }), points: "0.9 12.73 0.9 19.1 7.27 19.1 0.9 19.1 19.1 0.9 12.73 0.9 19.1 0.9 19.1 7.27" }) });
}, fn = function(n2) {
  var t2 = n2.color, e2 = F().defaultStyles, r2 = t2 || "", o2 = { fill: "none", strokeMiterlimit: 10, strokeWidth: "1.8px" };
  return c("svg", { id: "Layer_1", "data-name": "Layer 1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", style: { width: 15 }, children: [l("circle", { style: un(un(un({}, o2), e2.rbgcpControlIcon), r2 && { stroke: r2 }), cx: "10", cy: "10", r: "9" }), l("circle", { style: un(un(un({}, o2), e2.rbgcpControlIcon), r2 && { stroke: r2 }), cx: "10", cy: "10", r: "5" })] });
}, gn = function(n2) {
  var t2 = n2.color, e2 = F().defaultStyles, r2 = t2 || "", o2 = { fill: "none", strokeWidth: "1.8px" }, i2 = { strokeWidth: "1.8px" };
  return c("svg", { id: "Layer_1", "data-name": "Layer 1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", style: { width: 17 }, children: [l("polyline", { fillRule: "evenodd", strokeLinecap: "round", strokeLinejoin: "round", style: un(un(un({}, o2), e2.rbgcpControlIcon), r2 && { stroke: r2 }), points: "3.74 2.75 3.74 12.69 0.9 12.71 6.59 12.71" }), l("line", { strokeLinecap: "round", strokeLinejoin: "round", style: un(un(un({}, i2), e2.rbgcpControlIcon), r2 && { stroke: r2, fill: r2 }), x1: "3.74", y1: "17.26", x2: "3.74", y2: "15.21" }), l("polyline", { fillRule: "evenodd", strokeLinecap: "round", strokeLinejoin: "round", style: un(un(un({}, o2), e2.rbgcpControlIcon), r2 && { stroke: r2 }), points: "10.1 17.25 10.1 7.31 12.95 7.29 7.26 7.29" }), l("line", { strokeLinecap: "round", strokeLinejoin: "round", style: un(un(un({}, i2), e2.rbgcpControlIcon), r2 && { stroke: r2, fill: r2 }), x1: "10.1", y1: "2.74", x2: "10.1", y2: "4.79" }), l("polyline", { fillRule: "evenodd", strokeLinecap: "round", strokeLinejoin: "round", style: un(un(un({}, o2), e2.rbgcpControlIcon), r2 && { stroke: r2 }), points: "16.26 2.75 16.26 12.69 13.41 12.71 19.1 12.71" }), l("line", { strokeLinecap: "round", strokeLinejoin: "round", style: un(un(un({}, i2), e2.rbgcpControlIcon), r2 && { stroke: r2, fill: r2 }), x1: "16.26", y1: "17.26", x2: "16.26", y2: "15.21" })] });
}, hn = function(n2) {
  var t2 = n2.color, e2 = F().defaultStyles, r2 = t2 || "", o2 = { fill: "none", strokeWidth: "1.8px" };
  return c("svg", { id: "Layer_1", "data-name": "Layer 1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", style: { width: 17 }, children: [l("path", { strokeLinecap: "round", strokeLinejoin: "round", style: un(un(un({}, o2), e2.rbgcpControlIcon), r2 && { stroke: r2 }), d: "M6.35,2.72a4.85,4.85,0,0,1,1.86.16,7.94,7.94,0,0,1,.88.43,3.66,3.66,0,0,0,.85.49c.25,0,.58-.27.81-.39A8.25,8.25,0,0,1,11.7,3a4,4,0,0,1,1.79-.23,3.21,3.21,0,0,0-1.34.09,6.39,6.39,0,0,0-1.47.63c-.45.25-.7.3-.7.86s0,1.18,0,1.78c0,1.3,0,2.61,0,3.92h0v5.63a2.46,2.46,0,0,1,0,.47c-.07.28-.43.42-.7.57a5.29,5.29,0,0,1-2.94.61A9.3,9.3,0,0,0,8,17.15l1.09-.37.89-.52c.06,0,.48.21.56.25.32.14.64.27,1,.38a8.54,8.54,0,0,0,2.12.4" }), l("path", { strokeLinecap: "round", strokeLinejoin: "round", style: un(un(un({}, o2), e2.rbgcpControlIcon), r2 && { stroke: r2 }), d: "M7.57,5.73C6,5.7,4.5,5.65,3,5.77a2.28,2.28,0,0,0-1.76.74A2.3,2.3,0,0,0,.94,7.83l0,3.82A4.73,4.73,0,0,0,1,12.9a1.64,1.64,0,0,0,.68,1,2.44,2.44,0,0,0,1,.27,25,25,0,0,0,4.74.09" }), l("path", { strokeLinecap: "round", strokeLinejoin: "round", style: un(un(un({}, o2), e2.rbgcpControlIcon), r2 && { stroke: r2 }), d: "M12.43,14.32a44.12,44.12,0,0,0,4.6,0,2.24,2.24,0,0,0,1.76-.74,2.29,2.29,0,0,0,.27-1.32l0-3.81A4.81,4.81,0,0,0,19,7.15a1.62,1.62,0,0,0-.68-1,2.31,2.31,0,0,0-1-.28,26.8,26.8,0,0,0-4.74-.09" })] });
}, pn = function(n2) {
  var t2 = n2.color, e2 = F().defaultStyles, r2 = t2 || "";
  return c("svg", { id: "Layer_1", "data-name": "Layer 1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", style: { width: 17 }, children: [l("circle", { style: un(un({}, e2.rbgcpControlIcon2), r2 && { fill: r2 }), cx: "9.36", cy: "5.07", r: "1.71" }), l("circle", { style: un(un({}, e2.rbgcpControlIcon2), r2 && { fill: r2 }), cx: "13.93", cy: "6.91", r: "1.71" }), l("circle", { style: un(un({}, e2.rbgcpControlIcon2), r2 && { fill: r2 }), cx: "5.8", cy: "7.55", r: "1.71" }), l("circle", { style: un(un({}, e2.rbgcpControlIcon2), r2 && { fill: r2 }), cx: "5.45", cy: "12.04", r: "1.71" }), l("path", { style: un(un(un(un({}, { strokeMiterlimit: 10, strokeWidth: "0.5px" }), e2.rbgcpControlIcon), e2.rbgcpControlIcon2), r2 && { fill: r2, stroke: r2 }), d: "M19.1,10c0,3.58-2.12,2.94-4.06,2.35-1.15-.34-2.24-.67-2.77-.08-.68.78-.54,2.07-.39,3.33.2,1.79.39,3.5-1.88,3.5A9.1,9.1,0,1,1,19.1,10ZM10,18c.7,0,.74-.19.75-.2a2.67,2.67,0,0,0,.07-1.27c0-.19,0-.42-.06-.67-.06-.53-.13-1.15-.14-1.67a3.82,3.82,0,0,1,.8-2.63,2.14,2.14,0,0,1,1.45-.7,4.36,4.36,0,0,1,1.32.12c.39.08.8.21,1.16.32h0c.39.12.74.23,1.08.3.74.17,1,.1,1.13,0S18,11.32,18,10a8,8,0,1,0-8,8Z" })] });
}, vn = function(n2) {
  var t2 = n2.color, e2 = F().defaultStyles, r2 = t2 || "", o2 = { fill: "none", strokeMiterlimit: 10, strokeWidth: "1.8px" };
  return c("svg", { id: "Layer_1", "data-name": "Layer 1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", style: { width: 15 }, children: [l("polyline", { strokeLinecap: "round", style: un(un(un({}, o2), e2.rbgcpControlIcon), r2 && { stroke: r2 }), points: "13.86 2.01 1.7 16.99 18.77 16.99" }), l("polyline", { strokeLinecap: "round", style: un(un(un({}, o2), e2.rbgcpControlIcon), r2 && { stroke: r2 }), points: "10.96 16.38 10.96 16.38 10.74 15.7 10.44 14.97 10.06 14.21 9.72 13.63 9.21 12.89 8.85 12.44 8.41 11.95 7.91 11.45 7.51 11.1" })] });
}, bn = function() {
  var n2 = F().defaultStyles;
  return c("svg", { id: "Layer_1", "data-name": "Layer 1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", style: { width: 20, marginRight: 1 }, children: [l("path", { style: un({}, n2.rbgcpControlIcon2), d: "M2.39,8c-.63,0-1,.21-1,.63A.49.49,0,0,0,1.67,9a6.48,6.48,0,0,0,1.11.43A3,3,0,0,1,4,10.09a1.47,1.47,0,0,1,.35,1.09,1.75,1.75,0,0,1-.57,1.42,2.21,2.21,0,0,1-1.48.48,8.32,8.32,0,0,1-1.68-.21l-.31-.06.12-.94a13.7,13.7,0,0,0,1.8.16c.61,0,.92-.26.92-.77a.52.52,0,0,0-.21-.44,3.13,3.13,0,0,0-.85-.34A3.32,3.32,0,0,1,.66,9.79a1.43,1.43,0,0,1-.42-1.1A1.6,1.6,0,0,1,.78,7.36a2.32,2.32,0,0,1,1.49-.44,10.46,10.46,0,0,1,1.64.17l.32.07-.1.95C3.31,8,2.73,8,2.39,8Z" }), l("path", { style: un({}, n2.rbgcpControlIcon2), d: "M4.79,8.09V7H9.16V8.09H7.59V13H6.38V8.09Z" }), l("path", { style: un({}, n2.rbgcpControlIcon2), d: "M14,12.34a2.25,2.25,0,0,1-1.91.74,2.24,2.24,0,0,1-1.91-.74A3.85,3.85,0,0,1,9.61,10a4,4,0,0,1,.56-2.34,2.2,2.2,0,0,1,1.91-.77A2.21,2.21,0,0,1,14,7.69,4,4,0,0,1,14.55,10,3.85,3.85,0,0,1,14,12.34Zm-2.88-.77a1,1,0,0,0,1,.46,1,1,0,0,0,1-.46A3.25,3.25,0,0,0,13.3,10,3.45,3.45,0,0,0,13,8.46a1,1,0,0,0-1-.49,1,1,0,0,0-1,.49A3.43,3.43,0,0,0,10.85,10,3.38,3.38,0,0,0,11.11,11.57Z" }), l("path", { style: un({}, n2.rbgcpControlIcon2), d: "M17.77,11.24h-1V13H15.58V7h2.19a1.85,1.85,0,0,1,2.11,2.07,2.21,2.21,0,0,1-.54,1.6A2.07,2.07,0,0,1,17.77,11.24Zm-1-1h1c.6,0,.9-.37.9-1.12a1.18,1.18,0,0,0-.22-.79.88.88,0,0,0-.68-.24h-1Z" })] });
};
const yn = i(function(e2) {
  var r2 = e2.children, i2 = "id" + Math.random().toString(16).slice(2), a2 = o(document.getElementById(i2) || document.createElement("div")), l2 = n(!a2.current.parentElement)[0];
  return t(function() {
    var n2 = a2.current;
    return l2 && (a2.current.id = i2, document.body.appendChild(a2.current)), function() {
      l2 && n2.parentElement && n2.parentElement.removeChild(n2);
    };
  }, [i2]), s(r2, a2.current);
});
var mn = { body: { background: "rgb(32, 32, 32)" }, rbgcpInputLabel: { color: "rgb(212, 212, 212)" }, rbgcpControlBtnWrapper: { background: "rgb(54, 54, 54)" }, rbgcpInput: { border: "none", color: "white", background: "rgb(54, 54, 54)" }, rbgcpControlBtn: { color: "rgb(212, 212, 212)" }, rbgcpControlIcon: { stroke: "rgb(212, 212, 212)" }, rbgcpControlIcon2: { fill: "rgb(212, 212, 212)" }, rbgcpControlInput: { color: "white" }, rbgcpControlBtnSelected: { background: "black", color: "#568cf5" }, rbgcpDegreeIcon: { color: "rgb(212, 212, 212)" }, rbgcpColorModelDropdown: { background: "rgb(32, 32, 32)" }, rbgcpComparibleLabel: { color: "rgb(212, 212, 212)" } }, xn = globalThis && globalThis.__assign || function() {
  return xn = Object.assign || function(n2) {
    for (var t2, e2 = 1, r2 = arguments.length; e2 < r2; e2++)
      for (var o2 in t2 = arguments[e2])
        Object.prototype.hasOwnProperty.call(t2, o2) && (n2[o2] = t2[o2]);
    return n2;
  }, xn.apply(this, arguments);
}, Cn = { body: { boxSizing: "border-box", background: "rgb(255, 255, 255)" }, rbgcpControlBtn: { paddingLeft: "8px", paddingRight: "8px", lineHeight: "1", borderRadius: "4px", fontWeight: 700, fontSize: "12px", height: "24px", transition: "all 160ms ease", display: "flex", alignItems: "center", justifyContent: "center", background: "rgba(255, 255, 255, 0)", boxShadow: "1px 1px 3px rgba(0, 0, 0, 0)", color: "rgb(86, 86, 86)" }, rbgcpControlIcon: { stroke: "rgb(50, 49, 54)" }, rbgcpControlIconBtn: { width: "30px", height: "24px", borderRadius: "4px", display: "flex", alignItems: "center", justifyContent: "center", position: "relative" }, rbgcpControlBtnWrapper: { height: "28px", background: "#e9e9f5", borderRadius: "6px", padding: "2px", display: "flex", justifyContent: "center", alignItems: "center", position: "relative" }, rbgcpColorModelDropdown: { position: "absolute", right: "-2px", top: "34px", padding: "5px", background: "#e9e9f5", zIndex: 1e8, borderRadius: "6px", boxShadow: "1px 1px 14px 1px rgba(0, 0, 0, 0.25)" }, rbgcpEyedropperCover: { position: "fixed", left: "0px", top: "0px", zIndex: 1e8, width: "100vw", height: "100vh", cursor: "copy" }, rbgcpControlInput: { height: "24px", borderRadius: "4px", border: "none", outline: "none", textAlign: "center", width: "34px", fontWeight: 500, color: "rgb(50, 49, 54)", fontSize: "13px", background: "transparent" }, rbgcpInputLabel: { textAlign: "center", lineHeight: "1.2", fontWeight: 700, color: "rgb(86, 86, 86)", fontSize: "11px" }, rbgcpInput: { height: "32px", borderRadius: "6px", border: "1px solid #bebebe", width: "100%", padding: "2px", outline: "none", color: "black", fontWeight: 400, textAlign: "center" }, rbgcpHandle: { position: "absolute", border: "2px solid white", borderRadius: "50%", boxShadow: "0px 0px 3px rgba(0, 0, 0, 0.5)", width: "18px", height: "18px", zIndex: 1e3, transition: "all 30ms linear", boxSizing: "border-box", willChange: "transform", outline: "none" }, rbgcpCanvasWrapper: { borderRadius: "6px", overflow: "hidden", height: "294px" }, rbgcpCheckered: { background: "linear-gradient(\n      45deg,\n      rgba(0, 0, 0, 0.18) 25%,\n      transparent 25%,\n      transparent 75%,\n      rgba(0, 0, 0, 0.18) 75%,\n      rgba(0, 0, 0, 0.18) 0\n    ),\n    linear-gradient(\n      45deg,\n      rgba(0, 0, 0, 0.18) 25%,\n      transparent 25%,\n      transparent 75%,\n      rgba(0, 0, 0, 0.18) 75%,\n      rgba(0, 0, 0, 0.18) 0\n    ),\n    white", backgroundRepeat: "repeat, repeat", backgroundPosition: "0px 0, 7px 7px", transformOrigin: "0 0 0", backgroundOrigin: "padding-box, padding-box", backgroundClip: "border-box, border-box", backgroundSize: "14px 14px, 14px 14px", boxShadow: "none", textShadow: "none", transition: "none", transform: "scaleX(1) scaleY(1) scaleZ(1)", borderRadius: "10px" }, rbgcpOpacityOverlay: { position: "absolute", left: "0px", top: "0px", width: "100%", height: "100%", borderRadius: "10px" }, rbgcpGradientHandleWrap: { position: "absolute", zIndex: 1e4, top: "-2px", outline: "none" }, rbgcpGradientHandle: { border: "2px solid white", borderRadius: "50%", boxShadow: "0px 0px 3px rgba(0, 0, 0, 0.5)", width: "18px", height: "18px", display: "flex", alignItems: "center", justifyContent: "center" }, rbgcpControlIcon2: { fill: "#323136" }, rbgcpControlBtnSelected: { background: "white", color: "#568cf5", boxShadow: "1px 1px 3px rgba(0, 0, 0, 0.2)" }, rbgcpComparibleLabel: { color: "#323136" } }, wn = function(n2, t2) {
  return n2 ? xn(xn({}, t2.rbgcpControlBtn), t2.rbgcpControlBtnSelected) : xn({}, t2.rbgcpControlBtn);
}, kn = function(n2, t2) {
  return n2 ? xn(xn({}, t2.rbgcpControlIconBtn), t2.rbgcpControlBtnSelected) : xn({}, t2.rbgcpControlIconBtn);
}, Sn = function(n2, t2) {
  return n2 ? xn(xn(xn({}, t2.rbgcpControlBtn), t2.rbgcpColorModelDropdownBtn), t2.rbgcpControlBtnSelected) : xn(xn({}, t2.rbgcpControlBtn), t2.rbgcpColorModelDropdownBtn);
}, _n = globalThis && globalThis.__assign || function() {
  return _n = Object.assign || function(n2) {
    for (var t2, e2 = 1, r2 = arguments.length; e2 < r2; e2++)
      for (var o2 in t2 = arguments[e2])
        Object.prototype.hasOwnProperty.call(t2, o2) && (n2[o2] = t2[o2]);
    return n2;
  }, _n.apply(this, arguments);
}, An = function(n2) {
  var t2 = n2.color, e2 = F().defaultStyles, r2 = t2 || "";
  return c("svg", { id: "Layer_1", "data-name": "Layer 1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", style: { width: 16 }, children: [l("path", { strokeLinecap: "round", strokeLinejoin: "round", style: _n(_n({ fill: "none", strokeWidth: "1.4px" }, e2.rbgcpControlIcon), r2 && { stroke: r2 }), d: "M15.6,7h0L7.78,14.86c-.37.37-1.61.38-2,.75s-.5,1.53-.76,2a3.53,3.53,0,0,1-.52.52,1.6,1.6,0,0,1-2.27-.06l-.32-.32a1.61,1.61,0,0,1-.06-2.27A3.25,3.25,0,0,1,2.4,15c.47-.26,1.65-.35,2-.73s.34-1.64.71-2c1.68-1.73,5.61-5.65,7.91-7.93h0l1.14,1.38L15.6,7Z" }), l("polygon", { strokeLinecap: "round", strokeLinejoin: "round", style: _n(_n({ strokeWidth: "1.4px" }, e2.rbgcpControlIcon2), r2 && { stroke: r2, fill: r2 }), points: "15.7 8.87 11.13 4.29 12.69 2.73 17.25 7.31 15.7 8.87" }), l("path", { strokeLinecap: "round", strokeLinejoin: "round", style: _n(_n({ strokeWidth: "1.4px" }, e2.rbgcpControlIcon2), r2 && { stroke: r2, fill: r2 }), d: "M18.18,3.71,16.36,5.53a1.33,1.33,0,0,1-1.88,0h0a1.34,1.34,0,0,1,0-1.89l1.81-1.82a1.34,1.34,0,0,1,1.89,0h0A1.34,1.34,0,0,1,18.18,3.71Z" })] });
};
const Tn = function(t2) {
  var e2 = t2.onSelect, r2 = F().defaultStyles, o2 = n(null), i2 = o2[0], a2 = o2[1], u2 = n(false), d2 = u2[0], s2 = u2[1], g2 = n(false), h2 = g2[0], p2 = g2[1];
  return c("div", { children: [l("div", { onClick: function() {
    if (p2(true), window.EyeDropper) {
      var n2 = new window.EyeDropper(), t3 = new window.AbortController();
      n2.open({ signal: t3.signal }).then(function(n3) {
        var t4 = y(n3.sRGBHex).toRgb(), r4 = t4.r, o3 = t4.g, i3 = t4.b;
        e2("rgba(".concat(r4, ", ").concat(o3, ", ").concat(i3, ", 1)")), p2(false);
      }).catch(function(n3) {
        p2(false);
      });
    } else
      r3 = document.getElementById("root"), s2(true), f(r3).then(function(n3) {
        var t4 = document.createElement("canvas"), e3 = t4.getContext("2d", { willReadFrequently: true });
        r3 && e3 && (t4.width = 2 * r3.offsetWidth, t4.height = 2 * r3.offsetHeight, e3.drawImage(n3, 0, 0)), a2(e3);
      });
    var r3;
  }, id: "rbgcp-eyedropper-btn", style: _n(_n({}, r2.rbgcpEyedropperBtn), kn(d2, r2)), children: l(An, { color: h2 ? "rgb(86, 140, 245)" : "" }) }), d2 && l(yn, { children: l("div", { onClick: function(n2) {
    return function(n3) {
      if (n3.stopPropagation(), i2) {
        var t3 = 2 * n3.pageX, r3 = 2 * n3.pageY, o3 = i2.getImageData(t3, r3, 1, 1).data;
        e2("rgba(".concat(o3[0], ", ").concat(o3[1], ", ").concat(o3[2], ", 1)"));
      }
      p2(false), s2(false);
    }(n2);
  }, style: r2.rbgcpEyedropperCover }) })] });
};
var Ln = globalThis && globalThis.__assign || function() {
  return Ln = Object.assign || function(n2) {
    for (var t2, e2 = 1, r2 = arguments.length; e2 < r2; e2++)
      for (var o2 in t2 = arguments[e2])
        Object.prototype.hasOwnProperty.call(t2, o2) && (n2[o2] = t2[o2]);
    return n2;
  }, Ln.apply(this, arguments);
}, In = function(e2) {
  var r2 = e2.value, o2 = e2.callback, i2 = e2.reffy, a2 = e2.openAdvanced, u2 = e2.label, d2 = F(), s2 = d2.squareWidth, f2 = d2.defaultStyles, g2 = n(false), h2 = g2[0], p2 = g2[1], v2 = n(2), b2 = v2[0], y2 = v2[1], m2 = r2 * (s2 - 18);
  t(function() {
    var n2;
    y2((null === (n2 = null == i2 ? void 0 : i2.current) || void 0 === n2 ? void 0 : n2.offsetTop) - 2);
  }, [a2, i2]);
  var x2 = function(n2) {
    h2 && o2(H(n2));
  }, C2 = function(n2) {
    h2 || o2(H(n2));
  };
  return t(function() {
    var n2 = function() {
      p2(false);
    };
    return window.addEventListener("mouseup", n2), function() {
      window.removeEventListener("mouseup", n2);
    };
  }, []), l("div", { style: { width: "100%", padding: "3px 0px 3px 0px" }, children: c("div", { onMouseMove: function(n2) {
    return x2(n2);
  }, style: { cursor: "resize", position: "relative" }, children: [l("div", { style: Ln({ left: m2, top: b2 }, f2.rbgcpHandle), onMouseDown: function() {
    p2(true);
  }, role: "button", tabIndex: 0 }), l("div", { style: { textAlign: "center", color: "#fff", fontSize: 12, fontWeight: 500, lineHeight: 1, position: "absolute", left: "50%", transform: "translate(-50%, 0%)", top: b2 + 2, zIndex: 10, textShadow: "1px 1px 1px rgba(0,0,0,.6)" }, onMouseMove: function(n2) {
    return x2(n2);
  }, onClick: function(n2) {
    return C2(n2);
  }, tabIndex: 0, role: "button", onKeyDown: function() {
  }, children: u2 }), l("canvas", { ref: i2, height: "14px", width: "".concat(s2, "px"), onClick: function(n2) {
    return C2(n2);
  }, style: { position: "relative", borderRadius: 14 } })] }) });
};
const Rn = function(n2) {
  var e2 = n2.openAdvanced, r2 = F(), i2 = r2.tinyColor, a2 = r2.handleChange, u2 = r2.squareWidth, d2 = r2.hc, s2 = i2.toHsl(), f2 = s2.s, g2 = s2.l, h2 = o(null), p2 = o(null), v2 = o(null);
  !function(n3, e3, r3, o2) {
    t(function() {
      var t2, i3 = null === (t2 = null == n3 ? void 0 : n3.current) || void 0 === t2 ? void 0 : t2.getContext("2d", { willReadFrequently: true });
      if (i3) {
        i3.rect(0, 0, o2, 14);
        for (var a3 = i3.createLinearGradient(0, 0, o2, 0), l2 = 0; l2 <= 100; l2 += 10)
          a3.addColorStop(l2 / 100, "hsl(".concat(e3, ", ").concat(l2, "%, ").concat(r3, "%)"));
        i3.fillStyle = a3, i3.fill();
      }
    }, [n3, e3, r3, o2]);
  }(h2, null == d2 ? void 0 : d2.h, 100 * g2, u2), function(n3, e3, r3, o2) {
    t(function() {
      var t2, i3 = null === (t2 = null == n3 ? void 0 : n3.current) || void 0 === t2 ? void 0 : t2.getContext("2d", { willReadFrequently: true });
      if (i3) {
        i3.rect(0, 0, o2, 14);
        for (var a3 = i3.createLinearGradient(0, 0, o2, 0), l2 = 0; l2 <= 100; l2 += 10)
          a3.addColorStop(l2 / 100, "hsl(".concat(e3, ", ").concat(r3, "%, ").concat(l2, "%)"));
        i3.fillStyle = a3, i3.fill();
      }
    }, [n3, e3, r3, o2]);
  }(p2, null == d2 ? void 0 : d2.h, 100 * f2, u2), function(n3, e3, r3, o2) {
    t(function() {
      var t2, i3 = null === (t2 = null == n3 ? void 0 : n3.current) || void 0 === t2 ? void 0 : t2.getContext("2d", { willReadFrequently: true });
      if (i3) {
        i3.rect(0, 0, o2, 14);
        for (var a3 = i3.createLinearGradient(0, 0, o2, 0), l2 = 0; l2 <= 100; l2 += 10) {
          var c2 = y({ h: e3, s: r3, v: l2 });
          a3.addColorStop(l2 / 100, c2.toHslString());
        }
        i3.fillStyle = a3, i3.fill();
      }
    }, [n3, e3, r3, o2]);
  }(v2, null == d2 ? void 0 : d2.h, 100 * f2, u2);
  return l("div", { style: { height: e2 ? 98 : 0, width: "100%", transition: "all 120ms linear" }, children: c("div", { style: { paddingTop: 11, display: e2 ? "flex" : "none", flexDirection: "column", justifyContent: "space-between", height: e2 ? 98 : 0, overflow: "hidden", transition: "height 100ms linear" }, children: [l(In, { value: f2, reffy: h2, callback: function(n3) {
    var t2 = y({ h: null == d2 ? void 0 : d2.h, s: n3 / 100, l: g2 }).toRgb(), e3 = t2.r, r3 = t2.g, o2 = t2.b;
    a2("rgba(".concat(e3, ",").concat(r3, ",").concat(o2, ",").concat(null == d2 ? void 0 : d2.a, ")"));
  }, openAdvanced: e2, label: "Saturation" }), l(In, { value: g2, reffy: p2, label: "Lightness", callback: function(n3) {
    var t2 = y({ h: null == d2 ? void 0 : d2.h, s: f2, l: n3 / 100 }).toRgb(), e3 = t2.r, r3 = t2.g, o2 = t2.b;
    a2("rgba(".concat(e3, ",").concat(r3, ",").concat(o2, ",").concat(null == d2 ? void 0 : d2.a, ")"));
  }, openAdvanced: e2 }), l(In, { value: null == d2 ? void 0 : d2.v, reffy: v2, label: "Brightness", callback: function(n3) {
    var t2 = y({ h: null == d2 ? void 0 : d2.h, s: 100 * (null == d2 ? void 0 : d2.s), v: n3 }).toRgb(), e3 = t2.r, r3 = t2.g, o2 = t2.b;
    a2("rgba(".concat(e3, ",").concat(r3, ",").concat(o2, ",").concat(null == d2 ? void 0 : d2.a, ")"));
  }, openAdvanced: e2 })] }) });
};
var Gn = globalThis && globalThis.__assign || function() {
  return Gn = Object.assign || function(n2) {
    for (var t2, e2 = 1, r2 = arguments.length; e2 < r2; e2++)
      for (var o2 in t2 = arguments[e2])
        Object.prototype.hasOwnProperty.call(t2, o2) && (n2[o2] = t2[o2]);
    return n2;
  }, Gn.apply(this, arguments);
};
const On = function(n2) {
  var t2 = n2.openComparibles, e2 = F(), r2 = e2.tinyColor, o2 = e2.handleChange, i2 = e2.defaultStyles, a2 = r2.analogous(), u2 = r2.monochromatic(), d2 = r2.triad(), s2 = r2.tetrad(), f2 = function(n3) {
    var t3 = n3.toRgb(), e3 = t3.r, r3 = t3.g, i3 = t3.b, a3 = t3.a;
    o2("rgba(".concat(e3, ",").concat(r3, ",").concat(i3, ",").concat(a3, ")"));
  };
  return l("div", { style: { height: t2 ? 216 : 0, width: "100%", transition: "all 120ms linear" }, children: c("div", { style: { paddingTop: 11, display: t2 ? "" : "none", position: "relative" }, children: [l("div", { style: Gn({ textAlign: "center", fontSize: 13, fontWeight: 600, position: "absolute", top: 6.5, left: 2 }, i2.rbgcpComparibleLabel), children: "Color Guide" }), l("div", { style: Gn({ textAlign: "center", fontSize: 12, fontWeight: 500, marginTop: 3 }, i2.rbgcpComparibleLabel), children: "Analogous" }), l("div", { style: { borderRadius: 5, overflow: "hidden", display: "flex" }, children: null == a2 ? void 0 : a2.map(function(n3, t3) {
    return l("div", { style: { width: "20%", height: 30, background: n3.toHexString() }, onClick: function() {
      return f2(n3);
    } }, t3);
  }) }), l("div", { style: Gn({ textAlign: "center", fontSize: 12, fontWeight: 500, marginTop: 3 }, i2.rbgcpComparibleLabel), children: "Monochromatic" }), l("div", { style: { borderRadius: 5, overflow: "hidden", display: "flex", justifyContent: "flex-end" }, children: null == u2 ? void 0 : u2.map(function(n3, t3) {
    return l("div", { style: { width: "20%", height: 30, background: n3.toHexString() }, onClick: function() {
      return f2(n3);
    } }, t3);
  }) }), l("div", { style: Gn({ textAlign: "center", fontSize: 12, fontWeight: 500, marginTop: 3 }, i2.rbgcpComparibleLabel), children: "Triad" }), l("div", { style: { borderRadius: 5, overflow: "hidden", display: "flex", justifyContent: "flex-end" }, children: null == d2 ? void 0 : d2.map(function(n3, t3) {
    return l("div", { style: { width: "calc(100% / 3)", height: 28, background: n3.toHexString() }, onClick: function() {
      return f2(n3);
    } }, t3);
  }) }), l("div", { style: Gn({ textAlign: "center", fontSize: 12, fontWeight: 500, marginTop: 3 }, i2.rbgcpComparibleLabel), children: "Tetrad" }), l("div", { style: { borderRadius: 5, overflow: "hidden", display: "flex", justifyContent: "flex-end" }, children: null == s2 ? void 0 : s2.map(function(n3, t3) {
    return l("div", { style: { width: "25%", height: 28, background: n3.toHexString() }, onClick: function() {
      return f2(n3);
    } }, t3);
  }) })] }) });
};
var Hn = globalThis && globalThis.__assign || function() {
  return Hn = Object.assign || function(n2) {
    for (var t2, e2 = 1, r2 = arguments.length; e2 < r2; e2++)
      for (var o2 in t2 = arguments[e2])
        Object.prototype.hasOwnProperty.call(t2, o2) && (n2[o2] = t2[o2]);
    return n2;
  }, Hn.apply(this, arguments);
}, jn = function() {
  var n2 = F(), t2 = n2.gradientType, e2 = n2.onChange, r2 = n2.value, o2 = n2.defaultStyles, i2 = "linear-gradient" === t2, a2 = "radial-gradient" === t2;
  return c("div", { style: o2.rbgcpControlBtnWrapper, children: [l("div", { onClick: function() {
    var n3 = r2.split(/,(.+)/)[1];
    e2("linear-gradient(90deg, ".concat(n3));
  }, id: "rbgcp-linear-btn", style: Hn(Hn({}, o2.rbgcpControlBtn), i2 && o2.rbgcpControlBtnSelected), tabIndex: 0, role: "button", onKeyDown: function() {
  }, children: l(sn, { color: i2 ? "#568CF5" : "" }) }), l("div", { onClick: function() {
    var n3 = r2.split(/,(.+)/)[1];
    e2("radial-gradient(circle, ".concat(n3));
  }, id: "rbgcp-radial-btn", style: Hn(Hn({}, o2.rbgcpControlBtn), a2 && o2.rbgcpControlBtnSelected), tabIndex: 0, role: "button", onKeyDown: function() {
  }, children: l(fn, { color: a2 ? "#568CF5" : "" }) })] });
}, Bn = function() {
  var n2 = F(), t2 = n2.currentLeft, e2 = n2.handleGradient, r2 = n2.currentColor, o2 = n2.defaultStyles;
  return c("div", { style: Hn(Hn(Hn(Hn({}, o2.rbgcpControlBtnWrapper), o2.rbgcpControlInputWrap), o2.rbgcpStopInputWrap), { paddingLeft: 8 }), children: [l(bn, {}), l("input", { value: t2, id: "rbgcp-stop-input", onChange: function(n3) {
    return t3 = n3.target.value, void e2(r2, T(parseInt(t3), 0, 100));
    var t3;
  }, style: Hn(Hn({}, o2.rbgcpControlInput), o2.rbgcpStopInput) })] });
}, Mn = function() {
  var n2 = F(), t2 = n2.degrees, e2 = n2.onChange, r2 = n2.value, o2 = n2.defaultStyles;
  return c("div", { style: Hn(Hn(Hn({}, o2.rbgcpControlBtnWrapper), o2.rbgcpControlInputWrap), o2.rbgcpDegreeInputWrap), children: [l(vn, {}), l("input", { value: t2, id: "rbgcp-degree-input", onChange: function(n3) {
    return function(n4) {
      var t3 = T(n4.target.value, 0, 360), o3 = r2.split(/,(.+)/)[1];
      e2("linear-gradient(".concat(t3 || 0, "deg, ").concat(o3));
    }(n3);
  }, style: Hn(Hn({}, o2.rbgcpControlInput), o2.rbgcpDegreeInput) }), l("div", { style: Hn(Hn({}, o2.rbgcpDegreeIcon), { position: "absolute", right: t2 > 99 ? 0 : t2 < 10 ? 7 : 3, top: 1, fontWeight: 400, fontSize: 13 }), children: "°" })] });
}, Wn = function() {
  var n2 = F(), t2 = n2.colors, e2 = n2.selectedColor, r2 = n2.createGradientStr, o2 = n2.defaultStyles;
  return l("div", { onClick: function() {
    if ((null == t2 ? void 0 : t2.length) > 2) {
      var n3 = null == t2 ? void 0 : t2.map(function(n4, t3) {
        return Hn(Hn({}, n4), { value: t3 === e2 - 1 ? _(n4) : S(n4) });
      }), o3 = null == n3 ? void 0 : n3.filter(function(n4, t3) {
        return t3 !== e2;
      });
      r2(o3);
    }
  }, style: Hn(Hn({}, kn(false, o2)), { width: 28 }), id: "rbgcp-point-delete-btn", tabIndex: 0, role: "button", onKeyDown: function() {
  }, children: l(dn, {}) });
};
const zn = function(n2) {
  var t2 = n2.hideGradientType, e2 = n2.hideGradientAngle, r2 = n2.hideGradientStop, o2 = F(), i2 = o2.gradientType, a2 = o2.defaultStyles;
  return c("div", { style: Hn(Hn({}, a2.rbgcpControlBtnWrapper), { marginTop: 12, marginBottom: -4, justifyContent: "space-between", paddingLeft: t2 ? 4 : 0 }), id: "rbgcp-gradient-controls-wrap", children: [!t2 && l(jn, {}), l("div", { style: { width: 53 }, children: !e2 && "linear-gradient" === i2 && l(Mn, {}) }), !r2 && l(Bn, {}), l(Wn, {})] });
};
var En = globalThis && globalThis.__assign || function() {
  return En = Object.assign || function(n2) {
    for (var t2, e2 = 1, r2 = arguments.length; e2 < r2; e2++)
      for (var o2 in t2 = arguments[e2])
        Object.prototype.hasOwnProperty.call(t2, o2) && (n2[o2] = t2[o2]);
    return n2;
  }, En.apply(this, arguments);
}, Pn = h.defaultColor, Dn = h.defaultGradient, Fn = function(n2) {
  var t2, e2, r2 = n2.hideColorTypeBtns, o2 = n2.isGradient, i2 = n2.setSolid, a2 = n2.setGradient, u2 = n2.locales, d2 = F().defaultStyles;
  return r2 ? l("div", { style: { width: 1 } }) : c("div", { style: En({ display: "flex", alignItems: "center" }, d2.rbgcpControlBtnWrapper), children: [l("div", { onClick: i2, id: "rbgcp-solid-btn", style: wn(!o2, d2), children: null === (t2 = null == u2 ? void 0 : u2.CONTROLS) || void 0 === t2 ? void 0 : t2.SOLID }), l("div", { onClick: a2, id: "rbgcp-gradient-btn", style: wn(o2 || false, d2), children: null === (e2 = null == u2 ? void 0 : u2.CONTROLS) || void 0 === e2 ? void 0 : e2.GRADIENT })] });
}, qn = function(n2) {
  var t2 = n2.openInputType, e2 = n2.setOpenInputType, r2 = F(), o2 = r2.inputType, i2 = r2.setInputType, a2 = r2.defaultStyles, u2 = t2 ? "visibility 0ms linear" : "visibility 100ms linear 150ms", d2 = t2 ? "z-index 0ms linear" : "z-index 100ms linear 150ms", s2 = function(n3, r3) {
    t2 && (n3.stopPropagation(), i2(r3), e2(false));
  };
  return c("div", { style: En({ visibility: t2 ? "visible" : "hidden", zIndex: t2 ? "" : -100, opacity: t2 ? 1 : 0, transition: "".concat(t2 ? "opacity 120ms linear" : "opacity 150ms linear 50ms", ", ").concat(u2, ", ").concat(d2) }, a2.rbgcpColorModelDropdown), children: [l("div", { onClick: function(n3) {
    return s2(n3, "rgb");
  }, style: Sn("rgb" === o2, a2), children: "RGB" }), l("div", { onClick: function(n3) {
    return s2(n3, "hsl");
  }, style: Sn("hsl" === o2, a2), children: "HSL" }), l("div", { onClick: function(n3) {
    return s2(n3, "hsv");
  }, style: Sn("hsv" === o2, a2), children: "HSV" }), l("div", { onClick: function(n3) {
    return s2(n3, "cmyk");
  }, style: Sn("cmyk" === o2, a2), children: "CMYK" })] });
};
const Nn = function(t2) {
  var e2 = t2.locales, r2 = t2.hideEyeDrop, o2 = void 0 !== r2 && r2, i2 = t2.hideAdvancedSliders, a2 = void 0 !== i2 && i2, u2 = t2.hideColorGuide, d2 = void 0 !== u2 && u2, s2 = t2.hideInputType, f2 = void 0 !== s2 && s2, g2 = t2.hideColorTypeBtns, h2 = void 0 !== g2 && g2, p2 = t2.hideGradientControls, v2 = void 0 !== p2 && p2, b2 = t2.hideGradientType, y2 = void 0 !== b2 && b2, m2 = t2.hideGradientAngle, x2 = void 0 !== m2 && m2, C2 = t2.hideGradientStop, w2 = void 0 !== C2 && C2, k2 = F(), S2 = k2.onChange, _2 = k2.isGradient, A2 = k2.handleChange, T2 = k2.previous, L2 = k2.defaultStyles, I2 = n(false), R2 = I2[0], G2 = I2[1], O2 = n(false), H2 = O2[0], j2 = O2[1], B2 = n(false), M2 = B2[0], W2 = B2[1], z2 = o2 && a2 && d2 && f2, E2 = (null == T2 ? void 0 : T2.color) || Pn, P2 = (null == T2 ? void 0 : T2.gradient) || Dn, D2 = o2 && a2 && d2 && f2;
  return D2 && h2 ? _2 && !v2 ? l(zn, { hideGradientType: y2, hideGradientAngle: x2, hideGradientStop: w2 }) : null : c("div", { style: { paddingTop: 12, paddingBottom: 4 }, children: [c("div", { style: { width: "100%", display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [l(Fn, { hideColorTypeBtns: h2, setGradient: function() {
    S2(P2);
  }, isGradient: _2, setSolid: function() {
    S2(E2);
  }, locales: e2 }), !D2 && c("div", { style: En({ display: z2 ? "none" : "" }, L2.rbgcpControlBtnWrapper), children: [!o2 && l(Tn, { onSelect: A2 }), l("div", { id: "rbgcp-advanced-btn", onClick: function() {
    return W2(!M2);
  }, style: En({ display: a2 ? "none" : "flex" }, kn(M2, L2)), children: l(gn, { color: M2 ? "#568CF5" : "" }) }), l("div", { id: "rbgcp-comparibles-btn", style: En({ display: d2 ? "none" : "flex" }, kn(R2, L2)), onClick: function() {
    return G2(!R2);
  }, children: l(pn, { color: R2 ? "#568CF5" : "" }) }), c("div", { id: "rbgcp-color-model-btn", onClick: function() {
    return j2(!H2);
  }, style: En({ display: f2 ? "none" : "flex" }, kn(H2, L2)), children: [l(hn, { color: H2 ? "#568CF5" : "" }), l(qn, { openInputType: H2, setOpenInputType: j2 })] })] })] }), !a2 && l(Rn, { openAdvanced: M2 }), !d2 && l(On, { openComparibles: R2 }), _2 && !v2 && l(zn, { hideGradientType: y2, hideGradientAngle: x2, hideGradientStop: w2 })] });
};
var Vn = globalThis && globalThis.__assign || function() {
  return Vn = Object.assign || function(n2) {
    for (var t2, e2 = 1, r2 = arguments.length; e2 < r2; e2++)
      for (var o2 in t2 = arguments[e2])
        Object.prototype.hasOwnProperty.call(t2, o2) && (n2[o2] = t2[o2]);
    return n2;
  }, Vn.apply(this, arguments);
}, Zn = globalThis && globalThis.__spreadArray || function(n2, t2, e2) {
  if (e2 || 2 === arguments.length)
    for (var r2, o2 = 0, i2 = t2.length; o2 < i2; o2++)
      !r2 && o2 in t2 || (r2 || (r2 = Array.prototype.slice.call(t2, 0, o2)), r2[o2] = t2[o2]);
  return n2.concat(r2 || Array.prototype.slice.call(t2));
}, Xn = function(n2) {
  var t2 = n2.left, e2 = n2.i, r2 = n2.setDragging, o2 = F(), i2 = o2.colors, a2 = o2.selectedColor, c2 = o2.squareWidth, u2 = o2.defaultStyles, d2 = o2.createGradientStr, s2 = a2 === e2, f2 = (c2 - 18) / 100, g2 = function(n3) {
    var t3, o3;
    n3.stopPropagation(), t3 = e2, o3 = null == i2 ? void 0 : i2.map(function(n4, e3) {
      return Vn(Vn({}, n4), { value: e3 === t3 ? _(n4) : S(n4) });
    }), d2(o3), r2(true);
  };
  return l("div", { id: "gradient-handle-".concat(e2), onMouseDown: function(n3) {
    return g2(n3);
  }, style: Vn(Vn({}, u2.rbgcpGradientHandleWrap), { left: (t2 || 0) * f2 }), children: l("div", { style: Vn(Vn({}, u2.rbgcpGradientHandle), s2 ? { boxShadow: "0px 0px 5px 1px rgba(86, 140, 245,.95)", border: "2px solid white" } : {}), children: s2 && l("div", { style: { width: 5, height: 5, borderRadius: "50%", background: "white" } }) }) });
};
const Kn = function() {
  var e2 = F(), r2 = e2.currentColor, o2 = e2.createGradientStr, i2 = e2.colors, a2 = e2.value, u2 = e2.handleGradient, d2 = e2.squareWidth, s2 = n(false), f2 = s2[0], g2 = s2[1];
  var h2, p2 = function(n2) {
    f2 || (!function(n3) {
      var t2, e3 = H(n3), a3 = null === (t2 = Zn(Zn([], i2.map(function(n4) {
        return Vn(Vn({}, n4), { value: S(n4) });
      }), true), [{ value: r2, left: e3 }], false)) || void 0 === t2 ? void 0 : t2.sort(function(n4, t3) {
        return n4.left - t3.left;
      });
      o2(a3);
    }(n2), g2(true));
  }, v2 = function() {
    g2(false);
  };
  return t(function() {
    return window.addEventListener("mouseup", v2), function() {
      window.removeEventListener("mouseup", v2);
    };
  }), c("div", { style: { width: "100%", marginTop: 17, marginBottom: 4, position: "relative" }, id: "gradient-bar", children: [l("div", { style: { height: 14, borderRadius: 10, width: d2, backgroundImage: (h2 = a2, h2.replace(/(radial|linear)-gradient\([^,]+,/, "linear-gradient(90deg,")) }, onMouseDown: function(n2) {
    return p2(n2);
  }, onMouseMove: function(n2) {
    return function(n3) {
      f2 && u2(r2, H(n3));
    }(n2);
  } }), null == i2 ? void 0 : i2.map(function(n2, t2) {
    return l(Xn, { i: t2, left: n2.left, setDragging: g2 }, "".concat(t2, "-").concat(n2));
  })] });
};
const Yn = function(n2) {
  var t2 = n2.locales, e2 = n2.presets, r2 = n2.hideHue, o2 = n2.hideInputs, i2 = n2.hidePresets, a2 = n2.hideOpacity, u2 = n2.hideEyeDrop, d2 = n2.hideControls, s2 = n2.hideInputType, f2 = n2.hideColorGuide, g2 = n2.hideGradientType, h2 = n2.hideGradientStop, p2 = n2.hideGradientAngle, v2 = n2.hideColorTypeBtns, b2 = n2.hideAdvancedSliders, y2 = n2.hideGradientControls, m2 = F().isGradient;
  return c("div", { style: { userSelect: "none" }, id: "rbgcp-wrapper", children: [l(on, {}), !d2 && l(Nn, { locales: t2, hideEyeDrop: u2, hideInputType: s2, hideColorGuide: f2, hideGradientType: g2, hideGradientStop: h2, hideColorTypeBtns: v2, hideGradientAngle: p2, hideAdvancedSliders: b2, hideGradientControls: y2 }), m2 && l(Kn, {}), !r2 && l(V, {}), !a2 && l(ln, {}), !o2 && l(nn, {}), !i2 && l(cn, { presets: e2 })] });
};
var Un = globalThis && globalThis.__assign || function() {
  return Un = Object.assign || function(n2) {
    for (var t2, e2 = 1, r2 = arguments.length; e2 < r2; e2++)
      for (var o2 in t2 = arguments[e2])
        Object.prototype.hasOwnProperty.call(t2, o2) && (n2[o2] = t2[o2]);
    return n2;
  }, Un.apply(this, arguments);
};
function $n(n2) {
  var t2 = n2.value, e2 = void 0 === t2 ? "rgba(175, 51, 242, 1)" : t2, r2 = n2.onChange, i2 = n2.hideControls, a2 = void 0 !== i2 && i2, c2 = n2.hideInputs, u2 = void 0 !== c2 && c2, d2 = n2.hideOpacity, s2 = void 0 !== d2 && d2, f2 = n2.hidePresets, g2 = void 0 !== f2 && f2, h2 = n2.hideHue, v2 = void 0 !== h2 && h2, b2 = n2.presets, y2 = void 0 === b2 ? [] : b2, m2 = n2.hideEyeDrop, x2 = void 0 !== m2 && m2, C2 = n2.hideAdvancedSliders, w2 = void 0 !== C2 && C2, k2 = n2.hideColorGuide, S2 = void 0 !== k2 && k2, _2 = n2.hideInputType, A2 = void 0 !== _2 && _2, T2 = n2.hideColorTypeBtns, L2 = void 0 !== T2 && T2, I2 = n2.hideGradientType, R2 = void 0 !== I2 && I2, G2 = n2.hideGradientAngle, O2 = void 0 !== G2 && G2, H2 = n2.hideGradientStop, j2 = void 0 !== H2 && H2, M2 = n2.hideGradientControls, W2 = void 0 !== M2 && M2, z2 = n2.locales, E2 = void 0 === z2 ? p : z2, P2 = n2.width, F2 = void 0 === P2 ? 294 : P2, q2 = n2.height, N2 = void 0 === q2 ? 294 : q2, V2 = n2.style, Z2 = void 0 === V2 ? {} : V2, X2 = n2.className, K2 = n2.disableDarkMode, Y2 = void 0 !== K2 && K2, U2 = function(n3) {
    var t3, e3, r3, o2, i3;
    if ("string" == typeof n3)
      return n3;
    if (null === (t3 = null == n3 ? void 0 : n3.type) || void 0 === t3 ? void 0 : t3.includes("gradient")) {
      var a3 = null === (e3 = null == n3 ? void 0 : n3.colorStops) || void 0 === e3 ? void 0 : e3.sort(function(n4, t4) {
        return (null == n4 ? void 0 : n4.left) - (null == t4 ? void 0 : t4.left);
      }), l2 = null === (r3 = null == a3 ? void 0 : a3.map(function(n4) {
        return "".concat(null == n4 ? void 0 : n4.value, " ").concat(null == n4 ? void 0 : n4.left, "%");
      })) || void 0 === r3 ? void 0 : r3.join(", "), c3 = null == n3 ? void 0 : n3.type, u3 = B(null === (o2 = null == n3 ? void 0 : n3.orientation) || void 0 === o2 ? void 0 : o2.value), d3 = "linear-gradient" === c3 ? "".concat(u3, "deg") : "circle";
      return "".concat(c3, "(").concat(d3, ", ").concat(l2, ")");
    }
    return (null === (i3 = null == n3 ? void 0 : n3.colorStops[0]) || void 0 === i3 ? void 0 : i3.value) || "rgba(175, 51, 242, 1)";
  }(e2), $2 = o(null), J2 = function(n3) {
    if ("undefined" == typeof window || n3)
      return Cn;
    if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
      for (var t3 in mn)
        Object.prototype.hasOwnProperty.call(mn, t3) && (Cn[t3] = xn(xn({}, Object.prototype.hasOwnProperty.call(Cn, t3) ? Cn[t3] : {}), mn[t3]));
      return Cn;
    }
    return Cn;
  }(Y2);
  return l("div", { ref: $2, className: X2, style: Un(Un(Un({}, J2.body), Z2), { width: F2 }), children: l(D, { value: U2, onChange: r2, squareWidth: F2, squareHeight: N2, hideOpacity: s2, defaultStyles: J2, children: l(Yn, { hideControls: a2, hideInputs: u2, hidePresets: g2, hideOpacity: s2, hideHue: v2, presets: y2, hideEyeDrop: x2, hideAdvancedSliders: w2, hideColorGuide: S2, hideInputType: A2, hideColorTypeBtns: L2, hideGradientType: R2, hideGradientAngle: O2, hideGradientStop: j2, hideGradientControls: W2, locales: E2 }) }) });
}
var Jn = globalThis && globalThis.__assign || function() {
  return Jn = Object.assign || function(n2) {
    for (var t2, e2 = 1, r2 = arguments.length; e2 < r2; e2++)
      for (var o2 in t2 = arguments[e2])
        Object.prototype.hasOwnProperty.call(t2, o2) && (n2[o2] = t2[o2]);
    return n2;
  }, Jn.apply(this, arguments);
}, Qn = globalThis && globalThis.__spreadArray || function(n2, t2, e2) {
  if (e2 || 2 === arguments.length)
    for (var r2, o2 = 0, i2 = t2.length; o2 < i2; o2++)
      !r2 && o2 in t2 || (r2 || (r2 = Array.prototype.slice.call(t2, 0, o2)), r2[o2] = t2[o2]);
  return n2.concat(r2 || Array.prototype.slice.call(t2));
}, nt = h.defaultColor, tt = h.defaultGradient, et = function(e2, r2) {
  var o2 = A(e2), i2 = W(e2), a2 = i2.degrees, l2 = i2.degreeStr, c2 = i2.isGradient, u2 = i2.gradientType, d2 = M(o2), s2 = d2.currentColor, f2 = d2.selectedColor, g2 = d2.currentLeft, h2 = n([]), p2 = h2[0], v2 = h2[1], b2 = y(s2), m2 = b2.toRgb(), x2 = m2.r, C2 = m2.g, w2 = m2.b, k2 = m2.a, L2 = b2.toHsl(), I2 = L2.h, R2 = L2.s, G2 = L2.l;
  t(function() {
    var n2;
    (null === (n2 = y(s2)) || void 0 === n2 ? void 0 : n2.isValid()) && p2[0] !== s2 && v2(Qn([s2], p2.slice(0, 19), true));
  }, [s2, p2]);
  var O2 = function(n2) {
    var t2 = n2.sort(function(n3, t3) {
      return n3.left - t3.left;
    }), e3 = null == t2 ? void 0 : t2.map(function(n3) {
      return "".concat(null == n3 ? void 0 : n3.value, " ").concat(n3.left, "%");
    });
    r2("".concat(u2, "(").concat(l2, ", ").concat(e3.join(", "), ")"));
  }, H2 = function(n2, t2) {
    var e3 = null == o2 ? void 0 : o2.filter(function(n3) {
      return !j(n3.value);
    }), r3 = Qn([{ value: n2.toUpperCase(), left: t2 || g2 }], e3, true);
    O2(r3);
  }, B2 = function(n2) {
    c2 ? H2(n2) : r2(n2);
  };
  return { setR: function(n2) {
    var t2 = T(n2, 0, 255);
    B2("rgba(".concat(t2, ", ").concat(C2, ", ").concat(w2, ", ").concat(k2, ")"));
  }, setG: function(n2) {
    var t2 = T(n2, 0, 255);
    B2("rgba(".concat(x2, ", ").concat(t2, ", ").concat(w2, ", ").concat(k2, ")"));
  }, setB: function(n2) {
    var t2 = T(n2, 0, 255);
    B2("rgba(".concat(x2, ", ").concat(C2, ", ").concat(t2, ", ").concat(k2, ")"));
  }, setA: function(n2) {
    var t2 = T(n2, 0, 100);
    B2("rgba(".concat(x2, ", ").concat(C2, ", ").concat(w2, ", ").concat(t2 / 100, ")"));
  }, setHue: function(n2) {
    var t2 = T(n2, 0, 360), e3 = y({ h: t2, s: R2, l: G2 }).toRgb(), r3 = e3.r, o3 = e3.g, i3 = e3.b;
    B2("rgba(".concat(r3, ", ").concat(o3, ", ").concat(i3, ", ").concat(k2, ")"));
  }, addPoint: function(n2) {
    var t2 = Qn(Qn([], o2.map(function(n3) {
      return Jn(Jn({}, n3), { value: S(n3) });
    }), true), [{ value: s2, left: n2 }], false);
    O2(t2);
  }, setSolid: function(n2) {
    r2(n2 || nt);
  }, setLinear: function() {
    var n2 = e2.split(/,(.+)/)[1];
    r2("linear-gradient(90deg, ".concat(n2));
  }, setRadial: function() {
    var n2 = e2.split(/,(.+)/)[1];
    r2("radial-gradient(circle, ".concat(n2));
  }, valueToHSL: function() {
    return b2.toHslString();
  }, valueToHSV: function() {
    return b2.toHsvString();
  }, valueToHex: function() {
    return b2.toHexString();
  }, valueToCmyk: function() {
    var n2 = Z(x2, C2, w2), t2 = n2.c, e3 = n2.m, r3 = n2.y, o3 = n2.k;
    return "cmyk(".concat(t2, ", ").concat(e3, ", ").concat(r3, ", ").concat(o3, ")");
  }, setDegrees: function(n2) {
    var t2 = e2.split(/,(.+)/)[1];
    r2("linear-gradient(".concat(T(n2, 0, 360), "deg, ").concat(t2));
  }, setGradient: function(n2) {
    r2(n2 || tt);
  }, setLightness: function(n2) {
    var t2 = T(n2, 0, 100), e3 = y({ h: I2, s: R2, l: t2 / 100 });
    if (null == e3 ? void 0 : e3.isValid()) {
      var r3 = e3.toRgb(), o3 = r3.r, i3 = r3.g, a3 = r3.b;
      B2("rgba(".concat(o3, ", ").concat(i3, ", ").concat(a3, ", ").concat(k2, ")"));
    }
  }, setSaturation: function(n2) {
    var t2 = T(n2, 0, 100), e3 = y({ h: I2, s: t2 / 100, l: G2 }).toRgb(), r3 = e3.r, o3 = e3.g, i3 = e3.b;
    B2("rgba(".concat(r3, ", ").concat(o3, ", ").concat(i3, ", ").concat(k2, ")"));
  }, setSelectedPoint: function(n2) {
    if (c2) {
      var t2 = null == o2 ? void 0 : o2.map(function(t3, e3) {
        return Jn(Jn({}, t3), { value: e3 === n2 ? _(t3) : S(t3) });
      });
      O2(t2);
    }
  }, deletePoint: function(n2) {
    if ((null == o2 ? void 0 : o2.length) > 2) {
      var t2 = n2 || f2, e3 = null == o2 ? void 0 : o2.filter(function(n3, e4) {
        return e4 !== t2;
      });
      O2(e3);
    }
  }, isGradient: c2, gradientType: u2, degrees: a2, setPointLeft: function(n2) {
    H2(s2, T(n2, 0, 100));
  }, currentLeft: g2, rgbaArr: [x2, C2, w2, k2], hslArr: [I2, R2, G2], handleChange: B2, previousColors: p2, getGradientObject: function() {
    if (e2)
      return c2 ? { isGradient: true, gradientType: u2, degrees: l2, colors: null == o2 ? void 0 : o2.map(function(n2) {
        var t2;
        return Jn(Jn({}, n2), { value: null === (t2 = n2.value) || void 0 === t2 ? void 0 : t2.toLowerCase() });
      }) } : { isGradient: false, gradientType: null, degrees: null, colors: null == o2 ? void 0 : o2.map(function(n2) {
        var t2;
        return Jn(Jn({}, n2), { value: null === (t2 = n2.value) || void 0 === t2 ? void 0 : t2.toLowerCase() });
      }) };
  }, selectedPoint: f2 };
};
export {
  $n as C,
  et as u
};
