@protonradio/proton-ui 0.6.18-beta.2 → 0.6.18-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +0,0 @@
1
- "use strict";const T=require("./colors-BdogYmJi.js"),{min:ve,max:je}=Math,Q=(t,e=0,n=1)=>ve(je(e,t),n),Dt=t=>{t._clipped=!1,t._unclipped=t.slice(0);for(let e=0;e<=3;e++)e<3?((t[e]<0||t[e]>255)&&(t._clipped=!0),t[e]=Q(t[e],0,255)):e===3&&(t[e]=Q(t[e],0,1));return t},se={};for(let t of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])se[`[object ${t}]`]=t.toLowerCase();function E(t){return se[Object.prototype.toString.call(t)]||"object"}const k=(t,e=null)=>t.length>=3?Array.prototype.slice.call(t):E(t[0])=="object"&&e?e.split("").filter(n=>t[0][n]!==void 0).map(n=>t[0][n]):t[0].slice(0),ct=t=>{if(t.length<2)return null;const e=t.length-1;return E(t[e])=="string"?t[e].toLowerCase():null},{PI:yt,min:fe,max:ae}=Math,j=t=>Math.round(t*100)/100,Pt=t=>Math.round(t*100)/100,X=yt*2,Mt=yt/3,He=yt/180,Be=180/yt;function le(t){return[...t.slice(0,3).reverse(),...t.slice(3)]}const y={format:{},autodetect:[]};class i{constructor(...e){const n=this;if(E(e[0])==="object"&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];let r=ct(e),o=!1;if(!r){o=!0,y.sorted||(y.autodetect=y.autodetect.sort((c,s)=>s.p-c.p),y.sorted=!0);for(let c of y.autodetect)if(r=c.test(...e),r)break}if(y.format[r]){const c=y.format[r].apply(null,o?e:e.slice(0,-1));n._rgb=Dt(c)}else throw new Error("unknown format: "+e);n._rgb.length===3&&n._rgb.push(1)}toString(){return E(this.hex)=="function"?this.hex():`[${this._rgb.join(",")}]`}}const ze="3.1.2",R=(...t)=>new i(...t);R.version=ze;const rt={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",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",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",maroon2:"#7f0000",maroon3:"#b03060",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",purple2:"#7f007f",purple3:"#a020f0",rebeccapurple:"#663399",red:"#ff0000",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:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},Ue=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Ke=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,ie=t=>{if(t.match(Ue)){(t.length===4||t.length===7)&&(t=t.substr(1)),t.length===3&&(t=t.split(""),t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const e=parseInt(t,16),n=e>>16,r=e>>8&255,o=e&255;return[n,r,o,1]}if(t.match(Ke)){(t.length===5||t.length===9)&&(t=t.substr(1)),t.length===4&&(t=t.split(""),t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]);const e=parseInt(t,16),n=e>>24&255,r=e>>16&255,o=e>>8&255,c=Math.round((e&255)/255*100)/100;return[n,r,o,c]}throw new Error(`unknown hex color: ${t}`)},{round:ht}=Math,ue=(...t)=>{let[e,n,r,o]=k(t,"rgba"),c=ct(t)||"auto";o===void 0&&(o=1),c==="auto"&&(c=o<1?"rgba":"rgb"),e=ht(e),n=ht(n),r=ht(r);let f="000000"+(e<<16|n<<8|r).toString(16);f=f.substr(f.length-6);let a="0"+ht(o*255).toString(16);switch(a=a.substr(a.length-2),c.toLowerCase()){case"rgba":return`#${f}${a}`;case"argb":return`#${a}${f}`;default:return`#${f}`}};i.prototype.name=function(){const t=ue(this._rgb,"rgb");for(let e of Object.keys(rt))if(rt[e]===t)return e.toLowerCase();return t};y.format.named=t=>{if(t=t.toLowerCase(),rt[t])return ie(rt[t]);throw new Error("unknown color name: "+t)};y.autodetect.push({p:5,test:(t,...e)=>{if(!e.length&&E(t)==="string"&&rt[t.toLowerCase()])return"named"}});i.prototype.alpha=function(t,e=!1){return t!==void 0&&E(t)==="number"?e?(this._rgb[3]=t,this):new i([this._rgb[0],this._rgb[1],this._rgb[2],t],"rgb"):this._rgb[3]};i.prototype.clipped=function(){return this._rgb._clipped||!1};const U={Kn:18,labWhitePoint:"d65",Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452,kE:216/24389,kKE:8,kK:24389/27,RefWhiteRGB:{X:.95047,Y:1,Z:1.08883},MtxRGB2XYZ:{m00:.4124564390896922,m01:.21267285140562253,m02:.0193338955823293,m10:.357576077643909,m11:.715152155287818,m12:.11919202588130297,m20:.18043748326639894,m21:.07217499330655958,m22:.9503040785363679},MtxXYZ2RGB:{m00:3.2404541621141045,m01:-.9692660305051868,m02:.055643430959114726,m10:-1.5371385127977166,m11:1.8760108454466942,m12:-.2040259135167538,m20:-.498531409556016,m21:.041556017530349834,m22:1.0572251882231791},As:.9414285350000001,Bs:1.040417467,Cs:1.089532651,MtxAdaptMa:{m00:.8951,m01:-.7502,m02:.0389,m10:.2664,m11:1.7135,m12:-.0685,m20:-.1614,m21:.0367,m22:1.0296},MtxAdaptMaI:{m00:.9869929054667123,m01:.43230526972339456,m02:-.008528664575177328,m10:-.14705425642099013,m11:.5183602715367776,m12:.04004282165408487,m20:.15996265166373125,m21:.0492912282128556,m22:.9684866957875502}},Xe=new Map([["a",[1.0985,.35585]],["b",[1.0985,.35585]],["c",[.98074,1.18232]],["d50",[.96422,.82521]],["d55",[.95682,.92149]],["d65",[.95047,1.08883]],["e",[1,1,1]],["f2",[.99186,.67393]],["f7",[.95041,1.08747]],["f11",[1.00962,.6435]],["icc",[.96422,.82521]]]);function q(t){const e=Xe.get(String(t).toLowerCase());if(!e)throw new Error("unknown Lab illuminant "+t);U.labWhitePoint=t,U.Xn=e[0],U.Zn=e[1]}function it(){return U.labWhitePoint}const Ot=(...t)=>{t=k(t,"lab");const[e,n,r]=t,[o,c,s]=qe(e,n,r),[f,a,l]=be(o,c,s);return[f,a,l,t.length>3?t[3]:1]},qe=(t,e,n)=>{const{kE:r,kK:o,kKE:c,Xn:s,Yn:f,Zn:a}=U,l=(t+16)/116,b=.002*e+l,d=l-.005*n,h=b*b*b,p=d*d*d,A=h>r?h:(116*b-16)/o,S=t>c?Math.pow((t+16)/116,3):t/o,_=p>r?p:(116*d-16)/o,g=A*s,P=S*f,x=_*a;return[g,P,x]},Et=t=>{const e=Math.sign(t);return t=Math.abs(t),(t<=.0031308?t*12.92:1.055*Math.pow(t,1/2.4)-.055)*e},be=(t,e,n)=>{const{MtxAdaptMa:r,MtxAdaptMaI:o,MtxXYZ2RGB:c,RefWhiteRGB:s,Xn:f,Yn:a,Zn:l}=U,b=f*r.m00+a*r.m10+l*r.m20,d=f*r.m01+a*r.m11+l*r.m21,h=f*r.m02+a*r.m12+l*r.m22,p=s.X*r.m00+s.Y*r.m10+s.Z*r.m20,A=s.X*r.m01+s.Y*r.m11+s.Z*r.m21,S=s.X*r.m02+s.Y*r.m12+s.Z*r.m22,_=(t*r.m00+e*r.m10+n*r.m20)*(p/b),g=(t*r.m01+e*r.m11+n*r.m21)*(A/d),P=(t*r.m02+e*r.m12+n*r.m22)*(S/h),x=_*o.m00+g*o.m10+P*o.m20,N=_*o.m01+g*o.m11+P*o.m21,D=_*o.m02+g*o.m12+P*o.m22,L=Et(x*c.m00+N*c.m10+D*c.m20),u=Et(x*c.m01+N*c.m11+D*c.m21),m=Et(x*c.m02+N*c.m12+D*c.m22);return[L*255,u*255,m*255]},vt=(...t)=>{const[e,n,r,...o]=k(t,"rgb"),[c,s,f]=he(e,n,r),[a,l,b]=Fe(c,s,f);return[a,l,b,...o.length>0&&o[0]<1?[o[0]]:[]]};function Fe(t,e,n){const{Xn:r,Yn:o,Zn:c,kE:s,kK:f}=U,a=t/r,l=e/o,b=n/c,d=a>s?Math.pow(a,1/3):(f*a+16)/116,h=l>s?Math.pow(l,1/3):(f*l+16)/116,p=b>s?Math.pow(b,1/3):(f*b+16)/116;return[116*h-16,500*(d-h),200*(h-p)]}function Lt(t){const e=Math.sign(t);return t=Math.abs(t),(t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4))*e}const he=(t,e,n)=>{t=Lt(t/255),e=Lt(e/255),n=Lt(n/255);const{MtxRGB2XYZ:r,MtxAdaptMa:o,MtxAdaptMaI:c,Xn:s,Yn:f,Zn:a,As:l,Bs:b,Cs:d}=U;let h=t*r.m00+e*r.m10+n*r.m20,p=t*r.m01+e*r.m11+n*r.m21,A=t*r.m02+e*r.m12+n*r.m22;const S=s*o.m00+f*o.m10+a*o.m20,_=s*o.m01+f*o.m11+a*o.m21,g=s*o.m02+f*o.m12+a*o.m22;let P=h*o.m00+p*o.m10+A*o.m20,x=h*o.m01+p*o.m11+A*o.m21,N=h*o.m02+p*o.m12+A*o.m22;return P*=S/l,x*=_/b,N*=g/d,h=P*c.m00+x*c.m10+N*c.m20,p=P*c.m01+x*c.m11+N*c.m21,A=P*c.m02+x*c.m12+N*c.m22,[h,p,A]};i.prototype.lab=function(){return vt(this._rgb)};const Ze=(...t)=>new i(...t,"lab");Object.assign(R,{lab:Ze,getLabWhitePoint:it,setLabWhitePoint:q});y.format.lab=Ot;y.autodetect.push({p:2,test:(...t)=>{if(t=k(t,"lab"),E(t)==="array"&&t.length===3)return"lab"}});i.prototype.darken=function(t=1){const e=this,n=e.lab();return n[0]-=U.Kn*t,new i(n,"lab").alpha(e.alpha(),!0)};i.prototype.brighten=function(t=1){return this.darken(-t)};i.prototype.darker=i.prototype.darken;i.prototype.brighter=i.prototype.brighten;i.prototype.get=function(t){const[e,n]=t.split("."),r=this[e]();if(n){const o=e.indexOf(n)-(e.substr(0,2)==="ok"?2:0);if(o>-1)return r[o];throw new Error(`unknown channel ${n} in mode ${e}`)}else return r};const{pow:We}=Math,Ve=1e-7,Je=20;i.prototype.luminance=function(t,e="rgb"){if(t!==void 0&&E(t)==="number"){if(t===0)return new i([0,0,0,this._rgb[3]],"rgb");if(t===1)return new i([255,255,255,this._rgb[3]],"rgb");let n=this.luminance(),r=Je;const o=(s,f)=>{const a=s.interpolate(f,.5,e),l=a.luminance();return Math.abs(t-l)<Ve||!r--?a:l>t?o(s,a):o(a,f)},c=(n>t?o(new i([0,0,0]),this):o(this,new i([255,255,255]))).rgb();return new i([...c,this._rgb[3]])}return Qe(...this._rgb.slice(0,3))};const Qe=(t,e,n)=>(t=Yt(t),e=Yt(e),n=Yt(n),.2126*t+.7152*e+.0722*n),Yt=t=>(t/=255,t<=.03928?t/12.92:We((t+.055)/1.055,2.4)),O={},ot=(t,e,n=.5,...r)=>{let o=r[0]||"lrgb";if(!O[o]&&!r.length&&(o=Object.keys(O)[0]),!O[o])throw new Error(`interpolation mode ${o} is not defined`);return E(t)!=="object"&&(t=new i(t)),E(e)!=="object"&&(e=new i(e)),O[o](t,e,n).alpha(t.alpha()+n*(e.alpha()-t.alpha()))};i.prototype.mix=i.prototype.interpolate=function(t,e=.5,...n){return ot(this,t,e,...n)};i.prototype.premultiply=function(t=!1){const e=this._rgb,n=e[3];return t?(this._rgb=[e[0]*n,e[1]*n,e[2]*n,n],this):new i([e[0]*n,e[1]*n,e[2]*n,n],"rgb")};const{sin:tn,cos:en}=Math,de=(...t)=>{let[e,n,r]=k(t,"lch");return isNaN(r)&&(r=0),r=r*He,[e,en(r)*n,tn(r)*n]},jt=(...t)=>{t=k(t,"lch");const[e,n,r]=t,[o,c,s]=de(e,n,r),[f,a,l]=Ot(o,c,s);return[f,a,l,t.length>3?t[3]:1]},nn=(...t)=>{const e=le(k(t,"hcl"));return jt(...e)},{sqrt:rn,atan2:on,round:cn}=Math,pe=(...t)=>{const[e,n,r]=k(t,"lab"),o=rn(n*n+r*r);let c=(on(r,n)*Be+360)%360;return cn(o*1e4)===0&&(c=Number.NaN),[e,o,c]},Ht=(...t)=>{const[e,n,r,...o]=k(t,"rgb"),[c,s,f]=vt(e,n,r),[a,l,b]=pe(c,s,f);return[a,l,b,...o.length>0&&o[0]<1?[o[0]]:[]]};i.prototype.lch=function(){return Ht(this._rgb)};i.prototype.hcl=function(){return le(Ht(this._rgb))};const sn=(...t)=>new i(...t,"lch"),fn=(...t)=>new i(...t,"hcl");Object.assign(R,{lch:sn,hcl:fn});y.format.lch=jt;y.format.hcl=nn;["lch","hcl"].forEach(t=>y.autodetect.push({p:2,test:(...e)=>{if(e=k(e,t),E(e)==="array"&&e.length===3)return t}}));i.prototype.saturate=function(t=1){const e=this,n=e.lch();return n[1]+=U.Kn*t,n[1]<0&&(n[1]=0),new i(n,"lch").alpha(e.alpha(),!0)};i.prototype.desaturate=function(t=1){return this.saturate(-t)};i.prototype.set=function(t,e,n=!1){const[r,o]=t.split("."),c=this[r]();if(o){const s=r.indexOf(o)-(r.substr(0,2)==="ok"?2:0);if(s>-1){if(E(e)=="string")switch(e.charAt(0)){case"+":c[s]+=+e;break;case"-":c[s]+=+e;break;case"*":c[s]*=+e.substr(1);break;case"/":c[s]/=+e.substr(1);break;default:c[s]=+e}else if(E(e)==="number")c[s]=e;else throw new Error("unsupported value for Color.set");const f=new i(c,r);return n?(this._rgb=f._rgb,this):f}throw new Error(`unknown channel ${o} in mode ${r}`)}else return c};i.prototype.tint=function(t=.5,...e){return ot(this,"white",t,...e)};i.prototype.shade=function(t=.5,...e){return ot(this,"black",t,...e)};const an=(t,e,n)=>{const r=t._rgb,o=e._rgb;return new i(r[0]+n*(o[0]-r[0]),r[1]+n*(o[1]-r[1]),r[2]+n*(o[2]-r[2]),"rgb")};O.rgb=an;const{sqrt:$t,pow:tt}=Math,ln=(t,e,n)=>{const[r,o,c]=t._rgb,[s,f,a]=e._rgb;return new i($t(tt(r,2)*(1-n)+tt(s,2)*n),$t(tt(o,2)*(1-n)+tt(f,2)*n),$t(tt(c,2)*(1-n)+tt(a,2)*n),"rgb")};O.lrgb=ln;const un=(t,e,n)=>{const r=t.lab(),o=e.lab();return new i(r[0]+n*(o[0]-r[0]),r[1]+n*(o[1]-r[1]),r[2]+n*(o[2]-r[2]),"lab")};O.lab=un;const st=(t,e,n,r)=>{let o,c;r==="hsl"?(o=t.hsl(),c=e.hsl()):r==="hsv"?(o=t.hsv(),c=e.hsv()):r==="hcg"?(o=t.hcg(),c=e.hcg()):r==="hsi"?(o=t.hsi(),c=e.hsi()):r==="lch"||r==="hcl"?(r="hcl",o=t.hcl(),c=e.hcl()):r==="oklch"&&(o=t.oklch().reverse(),c=e.oklch().reverse());let s,f,a,l,b,d;(r.substr(0,1)==="h"||r==="oklch")&&([s,a,b]=o,[f,l,d]=c);let h,p,A,S;return!isNaN(s)&&!isNaN(f)?(f>s&&f-s>180?S=f-(s+360):f<s&&s-f>180?S=f+360-s:S=f-s,p=s+n*S):isNaN(s)?isNaN(f)?p=Number.NaN:(p=f,(b==1||b==0)&&r!="hsv"&&(h=l)):(p=s,(d==1||d==0)&&r!="hsv"&&(h=a)),h===void 0&&(h=a+n*(l-a)),A=b+n*(d-b),r==="oklch"?new i([A,h,p],r):new i([p,h,A],r)},me=(t,e,n)=>st(t,e,n,"lch");O.lch=me;O.hcl=me;const bn=t=>{if(E(t)=="number"&&t>=0&&t<=16777215){const e=t>>16,n=t>>8&255,r=t&255;return[e,n,r,1]}throw new Error("unknown num color: "+t)},hn=(...t)=>{const[e,n,r]=k(t,"rgb");return(e<<16)+(n<<8)+r};i.prototype.num=function(){return hn(this._rgb)};const dn=(...t)=>new i(...t,"num");Object.assign(R,{num:dn});y.format.num=bn;y.autodetect.push({p:5,test:(...t)=>{if(t.length===1&&E(t[0])==="number"&&t[0]>=0&&t[0]<=16777215)return"num"}});const pn=(t,e,n)=>{const r=t.num(),o=e.num();return new i(r+n*(o-r),"num")};O.num=pn;const{floor:mn}=Math,gn=(...t)=>{t=k(t,"hcg");let[e,n,r]=t,o,c,s;r=r*255;const f=n*255;if(n===0)o=c=s=r;else{e===360&&(e=0),e>360&&(e-=360),e<0&&(e+=360),e/=60;const a=mn(e),l=e-a,b=r*(1-n),d=b+f*(1-l),h=b+f*l,p=b+f;switch(a){case 0:[o,c,s]=[p,h,b];break;case 1:[o,c,s]=[d,p,b];break;case 2:[o,c,s]=[b,p,h];break;case 3:[o,c,s]=[b,d,p];break;case 4:[o,c,s]=[h,b,p];break;case 5:[o,c,s]=[p,b,d];break}}return[o,c,s,t.length>3?t[3]:1]},_n=(...t)=>{const[e,n,r]=k(t,"rgb"),o=fe(e,n,r),c=ae(e,n,r),s=c-o,f=s*100/255,a=o/(255-s)*100;let l;return s===0?l=Number.NaN:(e===c&&(l=(n-r)/s),n===c&&(l=2+(r-e)/s),r===c&&(l=4+(e-n)/s),l*=60,l<0&&(l+=360)),[l,f,a]};i.prototype.hcg=function(){return _n(this._rgb)};const wn=(...t)=>new i(...t,"hcg");R.hcg=wn;y.format.hcg=gn;y.autodetect.push({p:1,test:(...t)=>{if(t=k(t,"hcg"),E(t)==="array"&&t.length===3)return"hcg"}});const Rn=(t,e,n)=>st(t,e,n,"hcg");O.hcg=Rn;const{cos:et}=Math,yn=(...t)=>{t=k(t,"hsi");let[e,n,r]=t,o,c,s;return isNaN(e)&&(e=0),isNaN(n)&&(n=0),e>360&&(e-=360),e<0&&(e+=360),e/=360,e<1/3?(s=(1-n)/3,o=(1+n*et(X*e)/et(Mt-X*e))/3,c=1-(s+o)):e<2/3?(e-=1/3,o=(1-n)/3,c=(1+n*et(X*e)/et(Mt-X*e))/3,s=1-(o+c)):(e-=2/3,c=(1-n)/3,s=(1+n*et(X*e)/et(Mt-X*e))/3,o=1-(c+s)),o=Q(r*o*3),c=Q(r*c*3),s=Q(r*s*3),[o*255,c*255,s*255,t.length>3?t[3]:1]},{min:An,sqrt:kn,acos:Mn}=Math,En=(...t)=>{let[e,n,r]=k(t,"rgb");e/=255,n/=255,r/=255;let o;const c=An(e,n,r),s=(e+n+r)/3,f=s>0?1-c/s:0;return f===0?o=NaN:(o=(e-n+(e-r))/2,o/=kn((e-n)*(e-n)+(e-r)*(n-r)),o=Mn(o),r>n&&(o=X-o),o/=X),[o*360,f,s]};i.prototype.hsi=function(){return En(this._rgb)};const Ln=(...t)=>new i(...t,"hsi");R.hsi=Ln;y.format.hsi=yn;y.autodetect.push({p:2,test:(...t)=>{if(t=k(t,"hsi"),E(t)==="array"&&t.length===3)return"hsi"}});const Yn=(t,e,n)=>st(t,e,n,"hsi");O.hsi=Yn;const xt=(...t)=>{t=k(t,"hsl");const[e,n,r]=t;let o,c,s;if(n===0)o=c=s=r*255;else{const f=[0,0,0],a=[0,0,0],l=r<.5?r*(1+n):r+n-r*n,b=2*r-l,d=e/360;f[0]=d+1/3,f[1]=d,f[2]=d-1/3;for(let h=0;h<3;h++)f[h]<0&&(f[h]+=1),f[h]>1&&(f[h]-=1),6*f[h]<1?a[h]=b+(l-b)*6*f[h]:2*f[h]<1?a[h]=l:3*f[h]<2?a[h]=b+(l-b)*(2/3-f[h])*6:a[h]=b;[o,c,s]=[a[0]*255,a[1]*255,a[2]*255]}return t.length>3?[o,c,s,t[3]]:[o,c,s,1]},ge=(...t)=>{t=k(t,"rgba");let[e,n,r]=t;e/=255,n/=255,r/=255;const o=fe(e,n,r),c=ae(e,n,r),s=(c+o)/2;let f,a;return c===o?(f=0,a=Number.NaN):f=s<.5?(c-o)/(c+o):(c-o)/(2-c-o),e==c?a=(n-r)/(c-o):n==c?a=2+(r-e)/(c-o):r==c&&(a=4+(e-n)/(c-o)),a*=60,a<0&&(a+=360),t.length>3&&t[3]!==void 0?[a,f,s,t[3]]:[a,f,s]};i.prototype.hsl=function(){return ge(this._rgb)};const $n=(...t)=>new i(...t,"hsl");R.hsl=$n;y.format.hsl=xt;y.autodetect.push({p:2,test:(...t)=>{if(t=k(t,"hsl"),E(t)==="array"&&t.length===3)return"hsl"}});const Sn=(t,e,n)=>st(t,e,n,"hsl");O.hsl=Sn;const{floor:Gn}=Math,Nn=(...t)=>{t=k(t,"hsv");let[e,n,r]=t,o,c,s;if(r*=255,n===0)o=c=s=r;else{e===360&&(e=0),e>360&&(e-=360),e<0&&(e+=360),e/=60;const f=Gn(e),a=e-f,l=r*(1-n),b=r*(1-n*a),d=r*(1-n*(1-a));switch(f){case 0:[o,c,s]=[r,d,l];break;case 1:[o,c,s]=[b,r,l];break;case 2:[o,c,s]=[l,r,d];break;case 3:[o,c,s]=[l,b,r];break;case 4:[o,c,s]=[d,l,r];break;case 5:[o,c,s]=[r,l,b];break}}return[o,c,s,t.length>3?t[3]:1]},{min:Cn,max:In}=Math,Pn=(...t)=>{t=k(t,"rgb");let[e,n,r]=t;const o=Cn(e,n,r),c=In(e,n,r),s=c-o;let f,a,l;return l=c/255,c===0?(f=Number.NaN,a=0):(a=s/c,e===c&&(f=(n-r)/s),n===c&&(f=2+(r-e)/s),r===c&&(f=4+(e-n)/s),f*=60,f<0&&(f+=360)),[f,a,l]};i.prototype.hsv=function(){return Pn(this._rgb)};const xn=(...t)=>new i(...t,"hsv");R.hsv=xn;y.format.hsv=Nn;y.autodetect.push({p:2,test:(...t)=>{if(t=k(t,"hsv"),E(t)==="array"&&t.length===3)return"hsv"}});const Tn=(t,e,n)=>st(t,e,n,"hsv");O.hsv=Tn;function gt(t,e){let n=t.length;Array.isArray(t[0])||(t=[t]),Array.isArray(e[0])||(e=e.map(s=>[s]));let r=e[0].length,o=e[0].map((s,f)=>e.map(a=>a[f])),c=t.map(s=>o.map(f=>Array.isArray(s)?s.reduce((a,l,b)=>a+l*(f[b]||0),0):f.reduce((a,l)=>a+l*s,0)));return n===1&&(c=c[0]),r===1?c.map(s=>s[0]):c}const Bt=(...t)=>{t=k(t,"lab");const[e,n,r,...o]=t,[c,s,f]=Dn([e,n,r]),[a,l,b]=be(c,s,f);return[a,l,b,...o.length>0&&o[0]<1?[o[0]]:[]]};function Dn(t){var e=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],n=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],r=gt(n,t);return gt(e,r.map(o=>o**3))}const zt=(...t)=>{const[e,n,r,...o]=k(t,"rgb"),c=he(e,n,r);return[...On(c),...o.length>0&&o[0]<1?[o[0]]:[]]};function On(t){const e=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],n=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],r=gt(e,t);return gt(n,r.map(o=>Math.cbrt(o)))}i.prototype.oklab=function(){return zt(this._rgb)};const vn=(...t)=>new i(...t,"oklab");Object.assign(R,{oklab:vn});y.format.oklab=Bt;y.autodetect.push({p:2,test:(...t)=>{if(t=k(t,"oklab"),E(t)==="array"&&t.length===3)return"oklab"}});const jn=(t,e,n)=>{const r=t.oklab(),o=e.oklab();return new i(r[0]+n*(o[0]-r[0]),r[1]+n*(o[1]-r[1]),r[2]+n*(o[2]-r[2]),"oklab")};O.oklab=jn;const Hn=(t,e,n)=>st(t,e,n,"oklch");O.oklch=Hn;const{pow:St,sqrt:Gt,PI:Nt,cos:qt,sin:Ft,atan2:Bn}=Math,zn=(t,e="lrgb",n=null)=>{const r=t.length;n||(n=Array.from(new Array(r)).map(()=>1));const o=r/n.reduce(function(d,h){return d+h});if(n.forEach((d,h)=>{n[h]*=o}),t=t.map(d=>new i(d)),e==="lrgb")return Un(t,n);const c=t.shift(),s=c.get(e),f=[];let a=0,l=0;for(let d=0;d<s.length;d++)if(s[d]=(s[d]||0)*n[0],f.push(isNaN(s[d])?0:n[0]),e.charAt(d)==="h"&&!isNaN(s[d])){const h=s[d]/180*Nt;a+=qt(h)*n[0],l+=Ft(h)*n[0]}let b=c.alpha()*n[0];t.forEach((d,h)=>{const p=d.get(e);b+=d.alpha()*n[h+1];for(let A=0;A<s.length;A++)if(!isNaN(p[A]))if(f[A]+=n[h+1],e.charAt(A)==="h"){const S=p[A]/180*Nt;a+=qt(S)*n[h+1],l+=Ft(S)*n[h+1]}else s[A]+=p[A]*n[h+1]});for(let d=0;d<s.length;d++)if(e.charAt(d)==="h"){let h=Bn(l/f[d],a/f[d])/Nt*180;for(;h<0;)h+=360;for(;h>=360;)h-=360;s[d]=h}else s[d]=s[d]/f[d];return b/=r,new i(s,e).alpha(b>.99999?1:b,!0)},Un=(t,e)=>{const n=t.length,r=[0,0,0,0];for(let o=0;o<t.length;o++){const c=t[o],s=e[o]/n,f=c._rgb;r[0]+=St(f[0],2)*s,r[1]+=St(f[1],2)*s,r[2]+=St(f[2],2)*s,r[3]+=f[3]*s}return r[0]=Gt(r[0]),r[1]=Gt(r[1]),r[2]=Gt(r[2]),r[3]>.9999999&&(r[3]=1),new i(Dt(r))},{pow:Kn}=Math;function _t(t){let e="rgb",n=R("#ccc"),r=0,o=[0,1],c=[],s=[0,0],f=!1,a=[],l=!1,b=0,d=1,h=!1,p={},A=!0,S=1;const _=function(u){if(u=u||["#fff","#000"],u&&E(u)==="string"&&R.brewer&&R.brewer[u.toLowerCase()]&&(u=R.brewer[u.toLowerCase()]),E(u)==="array"){u.length===1&&(u=[u[0],u[0]]),u=u.slice(0);for(let m=0;m<u.length;m++)u[m]=R(u[m]);c.length=0;for(let m=0;m<u.length;m++)c.push(m/(u.length-1))}return D(),a=u},g=function(u){if(f!=null){const m=f.length-1;let M=0;for(;M<m&&u>=f[M];)M++;return M-1}return 0};let P=u=>u,x=u=>u;const N=function(u,m){let M,w;if(m==null&&(m=!1),isNaN(u)||u===null)return n;m?w=u:f&&f.length>2?w=g(u)/(f.length-2):d!==b?w=(u-b)/(d-b):w=1,w=x(w),m||(w=P(w)),S!==1&&(w=Kn(w,S)),w=s[0]+w*(1-s[0]-s[1]),w=Q(w,0,1);const $=Math.floor(w*1e4);if(A&&p[$])M=p[$];else{if(E(a)==="array")for(let Y=0;Y<c.length;Y++){const G=c[Y];if(w<=G){M=a[Y];break}if(w>=G&&Y===c.length-1){M=a[Y];break}if(w>G&&w<c[Y+1]){w=(w-G)/(c[Y+1]-G),M=R.interpolate(a[Y],a[Y+1],w,e);break}}else E(a)==="function"&&(M=a(w));A&&(p[$]=M)}return M};var D=()=>p={};_(t);const L=function(u){const m=R(N(u));return l&&m[l]?m[l]():m};return L.classes=function(u){if(u!=null){if(E(u)==="array")f=u,o=[u[0],u[u.length-1]];else{const m=R.analyze(o);u===0?f=[m.min,m.max]:f=R.limits(m,"e",u)}return L}return f},L.domain=function(u){if(!arguments.length)return o;b=u[0],d=u[u.length-1],c=[];const m=a.length;if(u.length===m&&b!==d)for(let M of Array.from(u))c.push((M-b)/(d-b));else{for(let M=0;M<m;M++)c.push(M/(m-1));if(u.length>2){const M=u.map(($,Y)=>Y/(u.length-1)),w=u.map($=>($-b)/(d-b));w.every(($,Y)=>M[Y]===$)||(x=$=>{if($<=0||$>=1)return $;let Y=0;for(;$>=w[Y+1];)Y++;const G=($-w[Y])/(w[Y+1]-w[Y]);return M[Y]+G*(M[Y+1]-M[Y])})}}return o=[b,d],L},L.mode=function(u){return arguments.length?(e=u,D(),L):e},L.range=function(u,m){return _(u),L},L.out=function(u){return l=u,L},L.spread=function(u){return arguments.length?(r=u,L):r},L.correctLightness=function(u){return u==null&&(u=!0),h=u,D(),h?P=function(m){const M=N(0,!0).lab()[0],w=N(1,!0).lab()[0],$=M>w;let Y=N(m,!0).lab()[0];const G=M+(w-M)*m;let J=Y-G,lt=0,ut=1,bt=20;for(;Math.abs(J)>.01&&bt-- >0;)(function(){return $&&(J*=-1),J<0?(lt=m,m+=(ut-m)*.5):(ut=m,m+=(lt-m)*.5),Y=N(m,!0).lab()[0],J=Y-G})();return m}:P=m=>m,L},L.padding=function(u){return u!=null?(E(u)==="number"&&(u=[u,u]),s=u,L):s},L.colors=function(u,m){arguments.length<2&&(m="hex");let M=[];if(arguments.length===0)M=a.slice(0);else if(u===1)M=[L(.5)];else if(u>1){const w=o[0],$=o[1]-w;M=Xn(0,u).map(Y=>L(w+Y/(u-1)*$))}else{t=[];let w=[];if(f&&f.length>2)for(let $=1,Y=f.length,G=1<=Y;G?$<Y:$>Y;G?$++:$--)w.push((f[$-1]+f[$])*.5);else w=o;M=w.map($=>L($))}return R[m]&&(M=M.map(w=>w[m]())),M},L.cache=function(u){return u!=null?(A=u,L):A},L.gamma=function(u){return u!=null?(S=u,L):S},L.nodata=function(u){return u!=null?(n=R(u),L):n},L}function Xn(t,e,n){let r=[],o=t<e,c=e;for(let s=t;o?s<c:s>c;o?s++:s--)r.push(s);return r}const qn=function(t){let e=[1,1];for(let n=1;n<t;n++){let r=[1];for(let o=1;o<=e.length;o++)r[o]=(e[o]||0)+e[o-1];e=r}return e},Fn=function(t){let e,n,r,o;if(t=t.map(c=>new i(c)),t.length===2)[n,r]=t.map(c=>c.lab()),e=function(c){const s=[0,1,2].map(f=>n[f]+c*(r[f]-n[f]));return new i(s,"lab")};else if(t.length===3)[n,r,o]=t.map(c=>c.lab()),e=function(c){const s=[0,1,2].map(f=>(1-c)*(1-c)*n[f]+2*(1-c)*c*r[f]+c*c*o[f]);return new i(s,"lab")};else if(t.length===4){let c;[n,r,o,c]=t.map(s=>s.lab()),e=function(s){const f=[0,1,2].map(a=>(1-s)*(1-s)*(1-s)*n[a]+3*(1-s)*(1-s)*s*r[a]+3*(1-s)*s*s*o[a]+s*s*s*c[a]);return new i(f,"lab")}}else if(t.length>=5){let c,s,f;c=t.map(a=>a.lab()),f=t.length-1,s=qn(f),e=function(a){const l=1-a,b=[0,1,2].map(d=>c.reduce((h,p,A)=>h+s[A]*l**(f-A)*a**A*p[d],0));return new i(b,"lab")}}else throw new RangeError("No point in running bezier with only one color.");return e},Zn=t=>{const e=Fn(t);return e.scale=()=>_t(e),e},{round:_e}=Math;i.prototype.rgb=function(t=!0){return t===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(_e)};i.prototype.rgba=function(t=!0){return this._rgb.slice(0,4).map((e,n)=>n<3?t===!1?e:_e(e):e)};const Wn=(...t)=>new i(...t,"rgb");Object.assign(R,{rgb:Wn});y.format.rgb=(...t)=>{const e=k(t,"rgba");return e[3]===void 0&&(e[3]=1),e};y.autodetect.push({p:3,test:(...t)=>{if(t=k(t,"rgba"),E(t)==="array"&&(t.length===3||t.length===4&&E(t[3])=="number"&&t[3]>=0&&t[3]<=1))return"rgb"}});const z=(t,e,n)=>{if(!z[n])throw new Error("unknown blend mode "+n);return z[n](t,e)},W=t=>(e,n)=>{const r=R(n).rgb(),o=R(e).rgb();return R.rgb(t(r,o))},V=t=>(e,n)=>{const r=[];return r[0]=t(e[0],n[0]),r[1]=t(e[1],n[1]),r[2]=t(e[2],n[2]),r},Vn=t=>t,Jn=(t,e)=>t*e/255,Qn=(t,e)=>t>e?e:t,t0=(t,e)=>t>e?t:e,e0=(t,e)=>255*(1-(1-t/255)*(1-e/255)),n0=(t,e)=>e<128?2*t*e/255:255*(1-2*(1-t/255)*(1-e/255)),r0=(t,e)=>255*(1-(1-e/255)/(t/255)),o0=(t,e)=>t===255?255:(t=255*(e/255)/(1-t/255),t>255?255:t);z.normal=W(V(Vn));z.multiply=W(V(Jn));z.screen=W(V(e0));z.overlay=W(V(n0));z.darken=W(V(Qn));z.lighten=W(V(t0));z.dodge=W(V(o0));z.burn=W(V(r0));const{pow:c0,sin:s0,cos:f0}=Math;function a0(t=300,e=-1.5,n=1,r=1,o=[0,1]){let c=0,s;E(o)==="array"?s=o[1]-o[0]:(s=0,o=[o,o]);const f=function(a){const l=X*((t+120)/360+e*a),b=c0(o[0]+s*a,r),h=(c!==0?n[0]+a*c:n)*b*(1-b)/2,p=f0(l),A=s0(l),S=b+h*(-.14861*p+1.78277*A),_=b+h*(-.29227*p-.90649*A),g=b+h*(1.97294*p);return R(Dt([S*255,_*255,g*255,1]))};return f.start=function(a){return a==null?t:(t=a,f)},f.rotations=function(a){return a==null?e:(e=a,f)},f.gamma=function(a){return a==null?r:(r=a,f)},f.hue=function(a){return a==null?n:(n=a,E(n)==="array"?(c=n[1]-n[0],c===0&&(n=n[1])):c=0,f)},f.lightness=function(a){return a==null?o:(E(a)==="array"?(o=a,s=a[1]-a[0]):(o=[a,a],s=0),f)},f.scale=()=>R.scale(f),f.hue(n),f}const l0="0123456789abcdef",{floor:i0,random:u0}=Math,b0=()=>{let t="#";for(let e=0;e<6;e++)t+=l0.charAt(i0(u0()*16));return new i(t,"hex")},{log:Zt,pow:h0,floor:d0,abs:p0}=Math;function we(t,e=null){const n={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return E(t)==="object"&&(t=Object.values(t)),t.forEach(r=>{e&&E(r)==="object"&&(r=r[e]),r!=null&&!isNaN(r)&&(n.values.push(r),n.sum+=r,r<n.min&&(n.min=r),r>n.max&&(n.max=r),n.count+=1)}),n.domain=[n.min,n.max],n.limits=(r,o)=>Re(n,r,o),n}function Re(t,e="equal",n=7){E(t)=="array"&&(t=we(t));const{min:r,max:o}=t,c=t.values.sort((f,a)=>f-a);if(n===1)return[r,o];const s=[];if(e.substr(0,1)==="c"&&(s.push(r),s.push(o)),e.substr(0,1)==="e"){s.push(r);for(let f=1;f<n;f++)s.push(r+f/n*(o-r));s.push(o)}else if(e.substr(0,1)==="l"){if(r<=0)throw new Error("Logarithmic scales are only possible for values > 0");const f=Math.LOG10E*Zt(r),a=Math.LOG10E*Zt(o);s.push(r);for(let l=1;l<n;l++)s.push(h0(10,f+l/n*(a-f)));s.push(o)}else if(e.substr(0,1)==="q"){s.push(r);for(let f=1;f<n;f++){const a=(c.length-1)*f/n,l=d0(a);if(l===a)s.push(c[l]);else{const b=a-l;s.push(c[l]*(1-b)+c[l+1]*b)}}s.push(o)}else if(e.substr(0,1)==="k"){let f;const a=c.length,l=new Array(a),b=new Array(n);let d=!0,h=0,p=null;p=[],p.push(r);for(let _=1;_<n;_++)p.push(r+_/n*(o-r));for(p.push(o);d;){for(let g=0;g<n;g++)b[g]=0;for(let g=0;g<a;g++){const P=c[g];let x=Number.MAX_VALUE,N;for(let D=0;D<n;D++){const L=p0(p[D]-P);L<x&&(x=L,N=D),b[N]++,l[g]=N}}const _=new Array(n);for(let g=0;g<n;g++)_[g]=null;for(let g=0;g<a;g++)f=l[g],_[f]===null?_[f]=c[g]:_[f]+=c[g];for(let g=0;g<n;g++)_[g]*=1/b[g];d=!1;for(let g=0;g<n;g++)if(_[g]!==p[g]){d=!0;break}p=_,h++,h>200&&(d=!1)}const A={};for(let _=0;_<n;_++)A[_]=[];for(let _=0;_<a;_++)f=l[_],A[f].push(c[_]);let S=[];for(let _=0;_<n;_++)S.push(A[_][0]),S.push(A[_][A[_].length-1]);S=S.sort((_,g)=>_-g),s.push(S[0]);for(let _=1;_<S.length;_+=2){const g=S[_];!isNaN(g)&&s.indexOf(g)===-1&&s.push(g)}}return s}const m0=(t,e)=>{t=new i(t),e=new i(e);const n=t.luminance(),r=e.luminance();return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)};/**
2
- * @license
3
- *
4
- * The APCA contrast prediction algorithm is based of the formulas published
5
- * in the APCA-1.0.98G specification by Myndex. The specification is available at:
6
- * https://raw.githubusercontent.com/Myndex/apca-w3/master/images/APCAw3_0.1.17_APCA0.0.98G.svg
7
- *
8
- * Note that the APCA implementation is still beta, so please update to
9
- * future versions of chroma.js when they become available.
10
- *
11
- * You can read more about the APCA Readability Criterion at
12
- * https://readtech.org/ARC/
13
- */const Wt=.027,g0=5e-4,_0=.1,Vt=1.14,dt=.022,Jt=1.414,w0=(t,e)=>{t=new i(t),e=new i(e),t.alpha()<1&&(t=ot(e,t,t.alpha(),"rgb"));const n=Qt(...t.rgb()),r=Qt(...e.rgb()),o=n>=dt?n:n+Math.pow(dt-n,Jt),c=r>=dt?r:r+Math.pow(dt-r,Jt),s=Math.pow(c,.56)-Math.pow(o,.57),f=Math.pow(c,.65)-Math.pow(o,.62),a=Math.abs(c-o)<g0?0:o<c?s*Vt:f*Vt;return(Math.abs(a)<_0?0:a>0?a-Wt:a+Wt)*100};function Qt(t,e,n){return .2126729*Math.pow(t/255,2.4)+.7151522*Math.pow(e/255,2.4)+.072175*Math.pow(n/255,2.4)}const{sqrt:K,pow:C,min:R0,max:y0,atan2:te,abs:ee,cos:pt,sin:ne,exp:A0,PI:re}=Math;function k0(t,e,n=1,r=1,o=1){var c=function(kt){return 360*kt/(2*re)},s=function(kt){return 2*re*kt/360};t=new i(t),e=new i(e);const[f,a,l]=Array.from(t.lab()),[b,d,h]=Array.from(e.lab()),p=(f+b)/2,A=K(C(a,2)+C(l,2)),S=K(C(d,2)+C(h,2)),_=(A+S)/2,g=.5*(1-K(C(_,7)/(C(_,7)+C(25,7)))),P=a*(1+g),x=d*(1+g),N=K(C(P,2)+C(l,2)),D=K(C(x,2)+C(h,2)),L=(N+D)/2,u=c(te(l,P)),m=c(te(h,x)),M=u>=0?u:u+360,w=m>=0?m:m+360,$=ee(M-w)>180?(M+w+360)/2:(M+w)/2,Y=1-.17*pt(s($-30))+.24*pt(s(2*$))+.32*pt(s(3*$+6))-.2*pt(s(4*$-63));let G=w-M;G=ee(G)<=180?G:w<=M?G+360:G-360,G=2*K(N*D)*ne(s(G)/2);const J=b-f,lt=D-N,ut=1+.015*C(p-50,2)/K(20+C(p-50,2)),bt=1+.045*L,Xt=1+.015*L*Y,Te=30*A0(-C(($-275)/25,2)),De=-(2*K(C(L,7)/(C(L,7)+C(25,7))))*ne(2*s(Te)),Oe=K(C(J/(n*ut),2)+C(lt/(r*bt),2)+C(G/(o*Xt),2)+De*(lt/(r*bt))*(G/(o*Xt)));return y0(0,R0(100,Oe))}function M0(t,e,n="lab"){t=new i(t),e=new i(e);const r=t.get(n),o=e.get(n);let c=0;for(let s in r){const f=(r[s]||0)-(o[s]||0);c+=f*f}return Math.sqrt(c)}const E0=(...t)=>{try{return new i(...t),!0}catch{return!1}},L0={cool(){return _t([R.hsl(180,1,.9),R.hsl(250,.7,.4)])},hot(){return _t(["#000","#f00","#ff0","#fff"]).mode("rgb")}},Tt={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},ye=Object.keys(Tt),oe=new Map(ye.map(t=>[t.toLowerCase(),t])),Y0=typeof Proxy=="function"?new Proxy(Tt,{get(t,e){const n=e.toLowerCase();if(oe.has(n))return t[oe.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(ye)}}):Tt,$0=(...t)=>{t=k(t,"cmyk");const[e,n,r,o]=t,c=t.length>4?t[4]:1;return o===1?[0,0,0,c]:[e>=1?0:255*(1-e)*(1-o),n>=1?0:255*(1-n)*(1-o),r>=1?0:255*(1-r)*(1-o),c]},{max:ce}=Math,S0=(...t)=>{let[e,n,r]=k(t,"rgb");e=e/255,n=n/255,r=r/255;const o=1-ce(e,ce(n,r)),c=o<1?1/(1-o):0,s=(1-e-o)*c,f=(1-n-o)*c,a=(1-r-o)*c;return[s,f,a,o]};i.prototype.cmyk=function(){return S0(this._rgb)};const G0=(...t)=>new i(...t,"cmyk");Object.assign(R,{cmyk:G0});y.format.cmyk=$0;y.autodetect.push({p:2,test:(...t)=>{if(t=k(t,"cmyk"),E(t)==="array"&&t.length===4)return"cmyk"}});const N0=(...t)=>{const e=k(t,"hsla");let n=ct(t)||"lsa";return e[0]=j(e[0]||0)+"deg",e[1]=j(e[1]*100)+"%",e[2]=j(e[2]*100)+"%",n==="hsla"||e.length>3&&e[3]<1?(e[3]="/ "+(e.length>3?e[3]:1),n="hsla"):e.length=3,`${n.substr(0,3)}(${e.join(" ")})`},C0=(...t)=>{const e=k(t,"lab");let n=ct(t)||"lab";return e[0]=j(e[0])+"%",e[1]=j(e[1]),e[2]=j(e[2]),n==="laba"||e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`lab(${e.join(" ")})`},I0=(...t)=>{const e=k(t,"lch");let n=ct(t)||"lab";return e[0]=j(e[0])+"%",e[1]=j(e[1]),e[2]=isNaN(e[2])?"none":j(e[2])+"deg",n==="lcha"||e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`lch(${e.join(" ")})`},P0=(...t)=>{const e=k(t,"lab");return e[0]=j(e[0]*100)+"%",e[1]=Pt(e[1]),e[2]=Pt(e[2]),e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`oklab(${e.join(" ")})`},Ae=(...t)=>{const[e,n,r,...o]=k(t,"rgb"),[c,s,f]=zt(e,n,r),[a,l,b]=pe(c,s,f);return[a,l,b,...o.length>0&&o[0]<1?[o[0]]:[]]},x0=(...t)=>{const e=k(t,"lch");return e[0]=j(e[0]*100)+"%",e[1]=Pt(e[1]),e[2]=isNaN(e[2])?"none":j(e[2])+"deg",e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`oklch(${e.join(" ")})`},{round:Ct}=Math,T0=(...t)=>{const e=k(t,"rgba");let n=ct(t)||"rgb";if(n.substr(0,3)==="hsl")return N0(ge(e),n);if(n.substr(0,3)==="lab"){const r=it();q("d50");const o=C0(vt(e),n);return q(r),o}if(n.substr(0,3)==="lch"){const r=it();q("d50");const o=I0(Ht(e),n);return q(r),o}return n.substr(0,5)==="oklab"?P0(zt(e)):n.substr(0,5)==="oklch"?x0(Ae(e)):(e[0]=Ct(e[0]),e[1]=Ct(e[1]),e[2]=Ct(e[2]),(n==="rgba"||e.length>3&&e[3]<1)&&(e[3]="/ "+(e.length>3?e[3]:1),n="rgba"),`${n.substr(0,3)}(${e.slice(0,n==="rgb"?3:4).join(" ")})`)},ke=(...t)=>{t=k(t,"lch");const[e,n,r,...o]=t,[c,s,f]=de(e,n,r),[a,l,b]=Bt(c,s,f);return[a,l,b,...o.length>0&&o[0]<1?[o[0]]:[]]},F=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,B=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,wt=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,H=/\s*/.source,ft=/\s+/.source,Ut=/\s*,\s*/.source,At=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,at=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,Me=new RegExp("^rgba?\\("+H+[F,F,F].join(ft)+at+"\\)$"),Ee=new RegExp("^rgb\\("+H+[F,F,F].join(Ut)+H+"\\)$"),Le=new RegExp("^rgba\\("+H+[F,F,F,B].join(Ut)+H+"\\)$"),Ye=new RegExp("^hsla?\\("+H+[At,wt,wt].join(ft)+at+"\\)$"),$e=new RegExp("^hsl?\\("+H+[At,wt,wt].join(Ut)+H+"\\)$"),Se=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,Ge=new RegExp("^lab\\("+H+[B,B,B].join(ft)+at+"\\)$"),Ne=new RegExp("^lch\\("+H+[B,B,At].join(ft)+at+"\\)$"),Ce=new RegExp("^oklab\\("+H+[B,B,B].join(ft)+at+"\\)$"),Ie=new RegExp("^oklch\\("+H+[B,B,At].join(ft)+at+"\\)$"),{round:Pe}=Math,nt=t=>t.map((e,n)=>n<=2?Q(Pe(e),0,255):e),I=(t,e=0,n=100,r=!1)=>(typeof t=="string"&&t.endsWith("%")&&(t=parseFloat(t.substring(0,t.length-1))/100,r?t=e+(t+1)*.5*(n-e):t=e+t*(n-e)),+t),v=(t,e)=>t==="none"?e:t,Kt=t=>{if(t=t.toLowerCase().trim(),t==="transparent")return[0,0,0,0];let e;if(y.format.named)try{return y.format.named(t)}catch{}if((e=t.match(Me))||(e=t.match(Ee))){let n=e.slice(1,4);for(let o=0;o<3;o++)n[o]=+I(v(n[o],0),0,255);n=nt(n);const r=e[4]!==void 0?+I(e[4],0,1):1;return n[3]=r,n}if(e=t.match(Le)){const n=e.slice(1,5);for(let r=0;r<4;r++)n[r]=+I(n[r],0,255);return n}if((e=t.match(Ye))||(e=t.match($e))){const n=e.slice(1,4);n[0]=+v(n[0].replace("deg",""),0),n[1]=+I(v(n[1],0),0,100)*.01,n[2]=+I(v(n[2],0),0,100)*.01;const r=nt(xt(n)),o=e[4]!==void 0?+I(e[4],0,1):1;return r[3]=o,r}if(e=t.match(Se)){const n=e.slice(1,4);n[1]*=.01,n[2]*=.01;const r=xt(n);for(let o=0;o<3;o++)r[o]=Pe(r[o]);return r[3]=+e[4],r}if(e=t.match(Ge)){const n=e.slice(1,4);n[0]=I(v(n[0],0),0,100),n[1]=I(v(n[1],0),-125,125,!0),n[2]=I(v(n[2],0),-125,125,!0);const r=it();q("d50");const o=nt(Ot(n));q(r);const c=e[4]!==void 0?+I(e[4],0,1):1;return o[3]=c,o}if(e=t.match(Ne)){const n=e.slice(1,4);n[0]=I(n[0],0,100),n[1]=I(v(n[1],0),0,150,!1),n[2]=+v(n[2].replace("deg",""),0);const r=it();q("d50");const o=nt(jt(n));q(r);const c=e[4]!==void 0?+I(e[4],0,1):1;return o[3]=c,o}if(e=t.match(Ce)){const n=e.slice(1,4);n[0]=I(v(n[0],0),0,1),n[1]=I(v(n[1],0),-.4,.4,!0),n[2]=I(v(n[2],0),-.4,.4,!0);const r=nt(Bt(n)),o=e[4]!==void 0?+I(e[4],0,1):1;return r[3]=o,r}if(e=t.match(Ie)){const n=e.slice(1,4);n[0]=I(v(n[0],0),0,1),n[1]=I(v(n[1],0),0,.4,!1),n[2]=+v(n[2].replace("deg",""),0);const r=nt(ke(n)),o=e[4]!==void 0?+I(e[4],0,1):1;return r[3]=o,r}};Kt.test=t=>Me.test(t)||Ye.test(t)||Ge.test(t)||Ne.test(t)||Ce.test(t)||Ie.test(t)||Ee.test(t)||Le.test(t)||$e.test(t)||Se.test(t)||t==="transparent";i.prototype.css=function(t){return T0(this._rgb,t)};const D0=(...t)=>new i(...t,"css");R.css=D0;y.format.css=Kt;y.autodetect.push({p:5,test:(t,...e)=>{if(!e.length&&E(t)==="string"&&Kt.test(t))return"css"}});y.format.gl=(...t)=>{const e=k(t,"rgba");return e[0]*=255,e[1]*=255,e[2]*=255,e};const O0=(...t)=>new i(...t,"gl");R.gl=O0;i.prototype.gl=function(){const t=this._rgb;return[t[0]/255,t[1]/255,t[2]/255,t[3]]};i.prototype.hex=function(t){return ue(this._rgb,t)};const v0=(...t)=>new i(...t,"hex");R.hex=v0;y.format.hex=ie;y.autodetect.push({p:4,test:(t,...e)=>{if(!e.length&&E(t)==="string"&&[3,4,5,6,7,8,9].indexOf(t.length)>=0)return"hex"}});const{log:mt}=Math,xe=t=>{const e=t/100;let n,r,o;return e<66?(n=255,r=e<6?0:-155.25485562709179-.44596950469579133*(r=e-2)+104.49216199393888*mt(r),o=e<20?0:-254.76935184120902+.8274096064007395*(o=e-10)+115.67994401066147*mt(o)):(n=351.97690566805693+.114206453784165*(n=e-55)-40.25366309332127*mt(n),r=325.4494125711974+.07943456536662342*(r=e-50)-28.0852963507957*mt(r),o=255),[n,r,o,1]},{round:j0}=Math,H0=(...t)=>{const e=k(t,"rgb"),n=e[0],r=e[2];let o=1e3,c=4e4;const s=.4;let f;for(;c-o>s;){f=(c+o)*.5;const a=xe(f);a[2]/a[0]>=r/n?c=f:o=f}return j0(f)};i.prototype.temp=i.prototype.kelvin=i.prototype.temperature=function(){return H0(this._rgb)};const It=(...t)=>new i(...t,"temp");Object.assign(R,{temp:It,kelvin:It,temperature:It});y.format.temp=y.format.kelvin=y.format.temperature=xe;i.prototype.oklch=function(){return Ae(this._rgb)};const B0=(...t)=>new i(...t,"oklch");Object.assign(R,{oklch:B0});y.format.oklch=ke;y.autodetect.push({p:2,test:(...t)=>{if(t=k(t,"oklch"),E(t)==="array"&&t.length===3)return"oklch"}});Object.assign(R,{analyze:we,average:zn,bezier:Zn,blend:z,brewer:Y0,Color:i,colors:rt,contrast:m0,contrastAPCA:w0,cubehelix:a0,deltaE:k0,distance:M0,input:y,interpolate:ot,limits:Re,mix:ot,random:b0,scale:_t,scales:L0,valid:E0});const z0={BRAND:{PRIMARY:T.BRAND.PRIMARY,PRIMARY_LIGHT:T.BRAND.PRIMARY_LIGHT,SECONDARY:T.BRAND.SECONDARY},PRIMARY:{PRIMARY_SUPER_DARK:T.GRAYSCALE.GRAY_SUPER_DARK,PRIMARY_DARK:T.GRAYSCALE.GRAY_DARK,PRIMARY_MEDIUM:T.GRAYSCALE.GRAY_MEDIUM,PRIMARY_MEDIUM_LIGHT:T.GRAYSCALE.GRAY_MEDIUM_LIGHT,PRIMARY_LIGHT:T.GRAYSCALE.GRAY_LIGHT,PRIMARY_LIGHTEST:T.GRAYSCALE.GRAY_LIGHTEST,PRIMARY_SUPER_LIGHT:T.GRAYSCALE.GRAY_SUPER_LIGHT},SECONDARY:{SECONDARY_SUPER_DARK:T.GRAYSCALE.GRAY_SUPER_DARK,SECONDARY_DARK:T.GRAYSCALE.GRAY_DARK,SECONDARY_MEDIUM:T.GRAYSCALE.GRAY_MEDIUM,SECONDARY_MEDIUM_LIGHT:T.GRAYSCALE.GRAY_MEDIUM_LIGHT,SECONDARY_LIGHT:T.GRAYSCALE.GRAY_LIGHT,SECONDARY_LIGHTEST:T.GRAYSCALE.GRAY_LIGHTEST,SECONDARY_SUPER_LIGHT:T.GRAYSCALE.GRAY_SUPER_LIGHT}},Rt=(t,e)=>e===void 0?`rgb(${t[0]}, ${t[1]}, ${t[2]})`:`rgba(${t[0]}, ${t[1]}, ${t[2]}, ${e})`,Z=([t,e,n])=>t*.2126+e*.7152+n*.0722,U0=t=>t.map(e=>255-e),K0=(t,e)=>{const n=Z(t),r=Z(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)},X0=(t,e=4.5)=>{const n=U0(t);if(K0(t,n)>=e)return n;const o=Z(t),c=o<128;if(c&&o>255/e)return[255,255,255];const s=Z(n),f=(Math.min(o,s)+.05)*e-(Math.max(o,s)+.05);return c?n.map(a=>Math.min(255,Math.round(a+f))):n.map(a=>Math.max(0,Math.round(a-f)))},q0=(t,e=!0)=>{const n=R.scale(["#FFFFFF",t,"#000000"]).mode("hsv").colors(12).map(c=>Rt(e?F0(R(c).rgb()):R(c).rgb())),r=R(t).set("hsv.h","+180").saturate(1).rgb(),o=R.scale(["#FFFFFF",r,"#000000"]).mode("hsv").colors(12).map(c=>Rt(R(c).rgb()));return{BRAND:{PRIMARY:n[5],PRIMARY_LIGHT:n[3],SECONDARY:o[4]},PRIMARY:{PRIMARY_SUPER_DARK:n[10],PRIMARY_DARK:n[9],PRIMARY_MEDIUM:n[7],PRIMARY_MEDIUM_LIGHT:n[6],PRIMARY_LIGHT:n[5],PRIMARY_LIGHTEST:n[4],PRIMARY_SUPER_LIGHT:n[3]},SECONDARY:{SECONDARY_SUPER_DARK:o[10],SECONDARY_DARK:o[9],SECONDARY_MEDIUM:o[7],SECONDARY_MEDIUM_LIGHT:o[6],SECONDARY_LIGHT:o[5],SECONDARY_LIGHTEST:o[4],SECONDARY_SUPER_LIGHT:o[3]}}},F0=t=>{let e=R(Rt(t)),n=Z(t),r=0;const o=6;for(;n<100&&r<o;)r++,e=e.brighten(.5),n=Z(e.rgb());for(;n>160&&r<o;)r++,e=e.darken(.5),n=Z(e.rgb());return e.rgb()},Z0=t=>typeof t=="string"||t instanceof String;function W0(...t){return t.filter(Z0).join(" ")}const V0=t=>{if(/^https?:\/\//.test(t)){const e=document.createElement("a");return e.href=t,e.hostname}return window.location.hostname},J0=t=>{const e=window.location.hostname,n=V0(t);return e!==n},Q0=(t,e)=>{if(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey||t.button&&t.button!==0)return;t.preventDefault();const n=e.startsWith("/")?e:`/${e}`;window.history.pushState({},"",n),window.dispatchEvent(new PopStateEvent("popstate"))};exports.DEFAULT_PALETTE=z0;exports.arrayToRgbString=Rt;exports.chroma=R;exports.contrastColor=X0;exports.csx=W0;exports.generatePalette=q0;exports.handleInternalNavigation=Q0;exports.isUrlExternal=J0;exports.luminance=Z;
14
- //# sourceMappingURL=index-DdgXcT07.js.map