'use strict';var chunkGYCEEHZT_cjs=require('./chunk-GYCEEHZT.cjs'),chunkEXPXWBLP_cjs=require('./chunk-EXPXWBLP.cjs');var N=r=>({h:chunkEXPXWBLP_cjs.c(r.h),s:chunkEXPXWBLP_cjs.a(r.s,0,100),v:chunkEXPXWBLP_cjs.a(r.v,0,100),alpha:chunkEXPXWBLP_cjs.a(chunkEXPXWBLP_cjs.b(r.alpha,3),0,1)}),f={h:0,s:0,v:0,alpha:0},y=({r,g:n,b:l,alpha:u})=>{let t=r/255,s=n/255,e=l/255,a=Math.max(t,s,e),c=Math.min(t,s,e),b=a-c,v=a===0?0:b/a,k=0;if(a!==c)switch(a){case t:k=((s-e)/b+(s<e?6:0))/6;break;case s:k=((e-t)/b+2)/6;break;case e:k=((t-s)/b+4)/6;break}let C=k*360;return f.h=C>=0&&C<360?C:(C%360+360)%360,f.s=chunkEXPXWBLP_cjs.a(v*100,0,100),f.v=chunkEXPXWBLP_cjs.a(a*100,0,100),f.alpha=chunkEXPXWBLP_cjs.a(chunkEXPXWBLP_cjs.b(u,3),0,1),f},j=r=>{let{h:n,s:l,v:u,alpha:t}=y(r),s=chunkEXPXWBLP_cjs.b(n,2);return {h:s>=360?0:s,s:chunkEXPXWBLP_cjs.b(l,2),v:chunkEXPXWBLP_cjs.b(u,2),alpha:t}},o=[0,0,0],$=({h:r,s:n,v:l,alpha:u})=>{let t=n/100,s=l/100,e=Math.floor(r/60%6),a=r/60-Math.floor(r/60),c=s*(1-t),b=s*(1-a*t),v=s*(1-(1-a)*t);switch(e){case 0:o[0]=s,o[1]=v,o[2]=c;break;case 1:o[0]=b,o[1]=s,o[2]=c;break;case 2:o[0]=c,o[1]=s,o[2]=v;break;case 3:o[0]=c,o[1]=b,o[2]=s;break;case 4:o[0]=v,o[1]=c,o[2]=s;break;default:o[0]=s,o[1]=c,o[2]=b;break}return chunkGYCEEHZT_cjs.a({r:o[0]*255,g:o[1]*255,b:o[2]*255,alpha:u})},p="[+-]?\\d*\\.?\\d+",M=new RegExp(`^hsva?\\(\\s*(${p})(deg|rad|grad|turn)?\\s*(?:,\\s*(${p})%\\s*,\\s*(${p})%(?:\\s*,\\s*(${p})(%?)?\\s*)?|\\s+(${p})(%?)\\s+(${p})(%?)(?:\\s*/\\s*(${p})(%?)?\\s*)?)\\)$`,"i"),A=r=>{if(typeof r!="string")return null;let n=M.exec(r.trim());if(!n)return null;let l=n[2]?.toLowerCase()??"deg",u=Number(n[1])*(chunkEXPXWBLP_cjs.d[l]??1),t=Number(n[3]??n[7]),s=Number(n[4]??n[9]),e=n[5]??n[11],a=!!(n[6]??n[12]),c=e===void 0?1:Number(e)/(a?100:1);return $(N({h:u,s:t,v:s,alpha:c}))},E=r=>{if(!chunkEXPXWBLP_cjs.h(r)||!chunkEXPXWBLP_cjs.i(r,["h","s","v"]))return null;let{h:n,s:l,v:u,alpha:t=1}=r;return !chunkEXPXWBLP_cjs.f(n)||!chunkEXPXWBLP_cjs.f(l)||!chunkEXPXWBLP_cjs.f(u)||!chunkEXPXWBLP_cjs.f(t)?null:$(N({h:chunkEXPXWBLP_cjs.g(n),s:chunkEXPXWBLP_cjs.g(l),v:chunkEXPXWBLP_cjs.g(u),alpha:chunkEXPXWBLP_cjs.g(t)}))};exports.a=y;exports.b=j;exports.c=$;exports.d=A;exports.e=E;//# sourceMappingURL=chunk-KP3R2XXN.cjs.map
//# sourceMappingURL=chunk-KP3R2XXN.cjs.map