function o(){return o=Object.assign?Object.assign.bind():function(r){for(var e=1;e=0&&n<1?(u=f,s=i):n>=1&&n<2?(u=i,s=f):n>=2&&n<3?(s=f,l=i):n>=3&&n<4?(s=i,l=f):n>=4&&n<5?(u=i,l=f):n>=5&&n<6&&(u=f,l=i);var c=a-f/2,b=u+c,p=s+c,w=l+c;return t(b,p,w)}var P={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",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:"ff00ff",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:"639",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"};function J(r){if(typeof r!="string")return r;var e=r.toLowerCase();return P[e]?"#"+P[e]:r}var K=/^#[a-fA-F0-9]{6}$/,Q=/^#[a-fA-F0-9]{8}$/,U=/^#[a-fA-F0-9]{3}$/,X=/^#[a-fA-F0-9]{4}$/,j=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,Y=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,Z=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,V=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function k(r){if(typeof r!="string")throw new h(3);var e=J(r);if(e.match(K))return{red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16)};if(e.match(Q)){var a=parseFloat((parseInt(""+e[7]+e[8],16)/255).toFixed(2));return{red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16),alpha:a}}if(e.match(U))return{red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16)};if(e.match(X)){var t=parseFloat((parseInt(""+e[4]+e[4],16)/255).toFixed(2));return{red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16),alpha:t}}var n=j.exec(e);if(n)return{red:parseInt(""+n[1],10),green:parseInt(""+n[2],10),blue:parseInt(""+n[3],10)};var f=Y.exec(e.substring(0,50));if(f)return{red:parseInt(""+f[1],10),green:parseInt(""+f[2],10),blue:parseInt(""+f[3],10),alpha:parseFloat(""+f[4])>1?parseFloat(""+f[4])/100:parseFloat(""+f[4])};var i=Z.exec(e);if(i){var u=parseInt(""+i[1],10),s=parseInt(""+i[2],10)/100,l=parseInt(""+i[3],10)/100,c="rgb("+F(u,s,l)+")",b=j.exec(c);if(!b)throw new h(4,e,c);return{red:parseInt(""+b[1],10),green:parseInt(""+b[2],10),blue:parseInt(""+b[3],10)}}var p=V.exec(e.substring(0,50));if(p){var w=parseInt(""+p[1],10),S=parseInt(""+p[2],10)/100,E=parseInt(""+p[3],10)/100,T="rgb("+F(w,S,E)+")",I=j.exec(T);if(!I)throw new h(4,e,T);return{red:parseInt(""+I[1],10),green:parseInt(""+I[2],10),blue:parseInt(""+I[3],10),alpha:parseFloat(""+p[4])>1?parseFloat(""+p[4])/100:parseFloat(""+p[4])}}throw new h(5)}function ee(r){var e=r.red/255,a=r.green/255,t=r.blue/255,n=Math.max(e,a,t),f=Math.min(e,a,t),i=(n+f)/2;if(n===f)return r.alpha!==void 0?{hue:0,saturation:0,lightness:i,alpha:r.alpha}:{hue:0,saturation:0,lightness:i};var u,s=n-f,l=i>.5?s/(2-n-f):s/(n+f);switch(n){case e:u=(a-t)/s+(a=1?q(r.hue,r.saturation,r.lightness):"rgba("+F(r.hue,r.saturation,r.lightness)+","+r.alpha+")";throw new h(2)}function A(r,e,a){if(typeof r=="number"&&typeof e=="number"&&typeof a=="number")return C("#"+v(r)+v(e)+v(a));if(typeof r=="object"&&e===void 0&&a===void 0)return C("#"+v(r.red)+v(r.green)+v(r.blue));throw new h(6)}function O(r,e,a,t){if(typeof r=="object"&&e===void 0&&a===void 0&&t===void 0)return r.alpha>=1?A(r.red,r.green,r.blue):"rgba("+r.red+","+r.green+","+r.blue+","+r.alpha+")";throw new h(7)}var fe=function(e){return typeof e.red=="number"&&typeof e.green=="number"&&typeof e.blue=="number"&&(typeof e.alpha!="number"||typeof e.alpha>"u")},ie=function(e){return typeof e.red=="number"&&typeof e.green=="number"&&typeof e.blue=="number"&&typeof e.alpha=="number"},ue=function(e){return typeof e.hue=="number"&&typeof e.saturation=="number"&&typeof e.lightness=="number"&&(typeof e.alpha!="number"||typeof e.alpha>"u")},se=function(e){return typeof e.hue=="number"&&typeof e.saturation=="number"&&typeof e.lightness=="number"&&typeof e.alpha=="number"};function m(r){if(typeof r!="object")throw new h(8);if(ie(r))return O(r);if(fe(r))return A(r);if(se(r))return ne(r);if(ue(r))return te(r);throw new h(8)}function z(r,e,a){return function(){var n=a.concat(Array.prototype.slice.call(arguments));return n.length>=e?r.apply(this,n):z(r,e,n)}}function d(r){return z(r,r.length,[])}function oe(r,e){if(e==="transparent")return e;var a=g(e);return m(o({},a,{hue:a.hue+parseFloat(r)}))}d(oe);function y(r,e,a){return Math.max(r,Math.min(e,a))}function pe(r,e){if(e==="transparent")return e;var a=g(e);return m(o({},a,{lightness:y(0,1,a.lightness-parseFloat(r))}))}d(pe);function de(r,e){if(e==="transparent")return e;var a=g(e);return m(o({},a,{saturation:y(0,1,a.saturation-parseFloat(r))}))}d(de);function le(r,e){if(e==="transparent")return e;var a=g(e);return m(o({},a,{lightness:y(0,1,a.lightness+parseFloat(r))}))}d(le);function be(r,e,a){if(e==="transparent")return a;if(a==="transparent")return e;if(r===0)return a;var t=k(e),n=o({},t,{alpha:typeof t.alpha=="number"?t.alpha:1}),f=k(a),i=o({},f,{alpha:typeof f.alpha=="number"?f.alpha:1}),u=n.alpha-i.alpha,s=parseFloat(r)*2-1,l=s*u===-1?s:s+u,c=1+s*u,b=(l/c+1)/2,p=1-b,w={red:Math.floor(n.red*b+i.red*p),green:Math.floor(n.green*b+i.green*p),blue:Math.floor(n.blue*b+i.blue*p),alpha:n.alpha*parseFloat(r)+i.alpha*(1-parseFloat(r))};return O(w)}var he=d(be),N=he;function ce(r,e){if(e==="transparent")return e;var a=k(e),t=typeof a.alpha=="number"?a.alpha:1,n=o({},a,{alpha:y(0,1,(t*100+parseFloat(r)*100)/100)});return O(n)}var ge=d(ce),Fe=ge;function me(r,e){if(e==="transparent")return e;var a=g(e);return m(o({},a,{saturation:y(0,1,a.saturation+parseFloat(r))}))}d(me);function ve(r,e){return e==="transparent"?e:m(o({},g(e),{hue:parseFloat(r)}))}d(ve);function ye(r,e){return e==="transparent"?e:m(o({},g(e),{lightness:parseFloat(r)}))}d(ye);function we(r,e){return e==="transparent"?e:m(o({},g(e),{saturation:parseFloat(r)}))}d(we);function xe(r,e){return e==="transparent"?e:N(parseFloat(r),"rgb(0, 0, 0)",e)}d(xe);function ke(r,e){return e==="transparent"?e:N(parseFloat(r),"rgb(255, 255, 255)",e)}d(ke);function Ie(r,e){if(e==="transparent")return e;var a=k(e),t=typeof a.alpha=="number"?a.alpha:1,n=o({},a,{alpha:y(0,1,+(t*100-parseFloat(r)*100).toFixed(2)/100)});return O(n)}d(Ie);export{Fe as c,k as p};