@phun-ky/moebius 0.1.2 → 0.1.4

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.
package/moebius.d.ts CHANGED
@@ -7,6 +7,8 @@ interface MoebiusColorInterface {
7
7
  hex: MoebiusColorValueHexType;
8
8
  rgb: MoebiusColorValueRgbType;
9
9
  hsl: MoebiusHSLObjectType;
10
+ hslFloat: MoebiusHSLObjectType;
11
+ rgbFloat: MoebiusRGBObjectType;
10
12
  hwb: MoebiusHWBObjectType;
11
13
  hsv: MoebiusHSVObjectType;
12
14
  lab: MoebiusLABObjectType;
@@ -91,10 +93,22 @@ type MoebiusPaletteDefaultOptionsType = {
91
93
  * Represents a color value in hexadecimal format.
92
94
  */
93
95
  type MoebiusColorValueHexType = `#${string}`;
96
+ /**
97
+ * Represents a color value in HSL format.
98
+ */
99
+ type MoebiusColorValueHslType = `hsl(${number}, ${string}, ${string})`;
100
+ /**
101
+ * Represents a color value in HSLA format.
102
+ */
103
+ type MoebiusColorValueHslaType = `hsl(${number}, ${string}, ${string}, ${number})`;
94
104
  /**
95
105
  * Represents a color value in RGB format.
96
106
  */
97
107
  type MoebiusColorValueRgbType = `rgb(${number}, ${number}, ${number})`;
108
+ /**
109
+ * Represents a color value in RGBA format.
110
+ */
111
+ type MoebiusColorValueRgbaType = `rgb(${number}, ${number}, ${number}, ${number})`;
98
112
  /**
99
113
  * Represents an RGB color object.
100
114
  */
@@ -168,6 +182,22 @@ type MoebiusCMYKObjectType = {
168
182
  y: number;
169
183
  k: number;
170
184
  };
185
+ /**
186
+ * Represents a color specification for nearest color matching.
187
+ */
188
+ interface NearestColorColorSpecInterface {
189
+ name: string;
190
+ source: string;
191
+ rgb: MoebiusRGBObjectType;
192
+ }
193
+ /**
194
+ * Represents a color match for nearest color matching.
195
+ */
196
+ interface NearestColorColorMatchInterface {
197
+ name: string;
198
+ value: string;
199
+ rgb: MoebiusRGBObjectType;
200
+ }
171
201
  type MoebiusChromaColorInputType = MoebiusCMYKObjectType | MoebiusLCHObjectType | MoebiusHSLObjectType | MoebiusColorValueHexType | string;
172
202
 
173
203
  /**
@@ -445,6 +475,8 @@ declare class MoebiusColor implements MoebiusColorInterface {
445
475
  hsi: MoebiusHSIObjectType;
446
476
  oklab: MoebiusLABObjectType;
447
477
  cmyk: MoebiusCMYKObjectType;
478
+ rgbFloat: MoebiusRGBObjectType;
479
+ hslFloat: MoebiusHSLObjectType;
448
480
  /**
449
481
  * Creates an instance of MoebiusColor.
450
482
  * @param {MoebiusChromaColorInputType} value - The hex value of the color.
@@ -480,4 +512,4 @@ type MoebiusReturnType = Promise<{
480
512
  */
481
513
  declare function Moebius(): MoebiusReturnType;
482
514
 
483
- export { MoebiusReturnType, Moebius as default };
515
+ export { MoebiusCMYKObjectType, MoebiusChromaColorInputType, MoebiusColorInterface, MoebiusColorValueHexType, MoebiusColorValueHslType, MoebiusColorValueHslaType, MoebiusColorValueRgbType, MoebiusColorValueRgbaType, MoebiusHSIObjectType, MoebiusHSLObjectType, MoebiusHSVObjectType, MoebiusHWBObjectType, MoebiusLABObjectType, MoebiusLCHObjectType, MoebiusPaletteAccentColorsInterface, MoebiusPaletteColorsInterface, MoebiusPaletteDefaultOptionsType, MoebiusPaletteInterface, MoebiusPaletteOptionsType, MoebiusRGBObjectType, MoebiusReturnType, MoebiusXYZObjectType, NearestColorColorMatchInterface, NearestColorColorSpecInterface, Moebius as default };
package/moebius.js CHANGED
@@ -1,2 +1,2 @@
1
- var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(t){var r={exports:{}};return t(r,r.exports),r.exports}var e=r((function(t,r){t.exports=function(){for(var t=function(t,r,e){return void 0===r&&(r=0),void 0===e&&(e=1),t<r?r:t>e?e:t},r=t,e=function(t){t._clipped=!1,t._unclipped=t.slice(0);for(var e=0;e<=3;e++)e<3?((t[e]<0||t[e]>255)&&(t._clipped=!0),t[e]=r(t[e],0,255)):3===e&&(t[e]=r(t[e],0,1));return t},n={},o=0,a=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];o<a.length;o+=1){var i=a[o];n["[object "+i+"]"]=i.toLowerCase()}var c=function(t){return n[Object.prototype.toString.call(t)]||"object"},f=c,u=function(t,r){return void 0===r&&(r=null),t.length>=3?Array.prototype.slice.call(t):"object"==f(t[0])&&r?r.split("").filter((function(r){return void 0!==t[0][r]})).map((function(r){return t[0][r]})):t[0]},s=c,l=function(t){if(t.length<2)return null;var r=t.length-1;return"string"==s(t[r])?t[r].toLowerCase():null},h=Math.PI,d={clip_rgb:e,limit:t,type:c,unpack:u,last:l,PI:h,TWOPI:2*h,PITHIRD:h/3,DEG2RAD:h/180,RAD2DEG:180/h},b={format:{},autodetect:[]},p=d.last,g=d.clip_rgb,m=d.type,v=b,y=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=this;if("object"===m(t[0])&&t[0].constructor&&t[0].constructor===this.constructor)return t[0];var n=p(t),o=!1;if(!n){o=!0,v.sorted||(v.autodetect=v.autodetect.sort((function(t,r){return r.p-t.p})),v.sorted=!0);for(var a=0,i=v.autodetect;a<i.length;a+=1){var c=i[a];if(n=c.test.apply(c,t))break}}if(!v.format[n])throw new Error("unknown format: "+t);var f=v.format[n].apply(null,o?t:t.slice(0,-1));e._rgb=g(f),3===e._rgb.length&&e._rgb.push(1)};y.prototype.toString=function(){return"function"==m(this.hex)?this.hex():"["+this._rgb.join(",")+"]"};var w=y,k=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(k.Color,[null].concat(t)))};k.Color=w,k.version="2.4.2";var N=k,x=d.unpack,M=Math.max,S=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=x(t,"rgb"),n=e[0],o=e[1],a=e[2],i=1-M(n/=255,M(o/=255,a/=255)),c=i<1?1/(1-i):0;return[(1-n-i)*c,(1-o-i)*c,(1-a-i)*c,i]},F=S,O=d.unpack,A=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=(t=O(t,"cmyk"))[0],n=t[1],o=t[2],a=t[3],i=t.length>4?t[4]:1;return 1===a?[0,0,0,i]:[e>=1?0:255*(1-e)*(1-a),n>=1?0:255*(1-n)*(1-a),o>=1?0:255*(1-o)*(1-a),i]},C=A,_=N,L=w,$=b,j=d.unpack,E=d.type,P=F;L.prototype.cmyk=function(){return P(this._rgb)},_.cmyk=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(L,[null].concat(t,["cmyk"])))},$.format.cmyk=C,$.autodetect.push({p:2,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=j(t,"cmyk"),"array"===E(t)&&4===t.length)return"cmyk"}});var D=d.unpack,R=d.last,I=function(t){return Math.round(100*t)/100},z=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=D(t,"hsla"),n=R(t)||"lsa";return e[0]=I(e[0]||0),e[1]=I(100*e[1])+"%",e[2]=I(100*e[2])+"%","hsla"===n||e.length>3&&e[3]<1?(e[3]=e.length>3?e[3]:1,n="hsla"):e.length=3,n+"("+e.join(",")+")"},q=z,G=d.unpack,B=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=(t=G(t,"rgba"))[0],n=t[1],o=t[2];e/=255,n/=255,o/=255;var a,i,c=Math.min(e,n,o),f=Math.max(e,n,o),u=(f+c)/2;return f===c?(a=0,i=Number.NaN):a=u<.5?(f-c)/(f+c):(f-c)/(2-f-c),e==f?i=(n-o)/(f-c):n==f?i=2+(o-e)/(f-c):o==f&&(i=4+(e-n)/(f-c)),(i*=60)<0&&(i+=360),t.length>3&&void 0!==t[3]?[i,a,u,t[3]]:[i,a,u]},T=B,Y=d.unpack,U=d.last,V=q,X=T,W=Math.round,Z=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=Y(t,"rgba"),n=U(t)||"rgb";return"hsl"==n.substr(0,3)?V(X(e),n):(e[0]=W(e[0]),e[1]=W(e[1]),e[2]=W(e[2]),("rgba"===n||e.length>3&&e[3]<1)&&(e[3]=e.length>3?e[3]:1,n="rgba"),n+"("+e.slice(0,"rgb"===n?3:4).join(",")+")")},H=Z,K=d.unpack,J=Math.round,Q=function(){for(var t,r=[],e=arguments.length;e--;)r[e]=arguments[e];var n,o,a,i=(r=K(r,"hsl"))[0],c=r[1],f=r[2];if(0===c)n=o=a=255*f;else{var u=[0,0,0],s=[0,0,0],l=f<.5?f*(1+c):f+c-f*c,h=2*f-l,d=i/360;u[0]=d+1/3,u[1]=d,u[2]=d-1/3;for(var b=0;b<3;b++)u[b]<0&&(u[b]+=1),u[b]>1&&(u[b]-=1),6*u[b]<1?s[b]=h+6*(l-h)*u[b]:2*u[b]<1?s[b]=l:3*u[b]<2?s[b]=h+(l-h)*(2/3-u[b])*6:s[b]=h;n=(t=[J(255*s[0]),J(255*s[1]),J(255*s[2])])[0],o=t[1],a=t[2]}return r.length>3?[n,o,a,r[3]]:[n,o,a,1]},tt=Q,rt=tt,et=b,nt=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,ot=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,at=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,it=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,ct=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,ft=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,ut=Math.round,st=function(t){var r;if(t=t.toLowerCase().trim(),et.format.named)try{return et.format.named(t)}catch(t){}if(r=t.match(nt)){for(var e=r.slice(1,4),n=0;n<3;n++)e[n]=+e[n];return e[3]=1,e}if(r=t.match(ot)){for(var o=r.slice(1,5),a=0;a<4;a++)o[a]=+o[a];return o}if(r=t.match(at)){for(var i=r.slice(1,4),c=0;c<3;c++)i[c]=ut(2.55*i[c]);return i[3]=1,i}if(r=t.match(it)){for(var f=r.slice(1,5),u=0;u<3;u++)f[u]=ut(2.55*f[u]);return f[3]=+f[3],f}if(r=t.match(ct)){var s=r.slice(1,4);s[1]*=.01,s[2]*=.01;var l=rt(s);return l[3]=1,l}if(r=t.match(ft)){var h=r.slice(1,4);h[1]*=.01,h[2]*=.01;var d=rt(h);return d[3]=+r[4],d}};st.test=function(t){return nt.test(t)||ot.test(t)||at.test(t)||it.test(t)||ct.test(t)||ft.test(t)};var lt=st,ht=N,dt=w,bt=b,pt=d.type,gt=H,mt=lt;dt.prototype.css=function(t){return gt(this._rgb,t)},ht.css=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(dt,[null].concat(t,["css"])))},bt.format.css=mt,bt.autodetect.push({p:5,test:function(t){for(var r=[],e=arguments.length-1;e-- >0;)r[e]=arguments[e+1];if(!r.length&&"string"===pt(t)&&mt.test(t))return"css"}});var vt=w,yt=N,wt=b,kt=d.unpack;wt.format.gl=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=kt(t,"rgba");return e[0]*=255,e[1]*=255,e[2]*=255,e},yt.gl=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(vt,[null].concat(t,["gl"])))},vt.prototype.gl=function(){var t=this._rgb;return[t[0]/255,t[1]/255,t[2]/255,t[3]]};var Nt=d.unpack,xt=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e,n=Nt(t,"rgb"),o=n[0],a=n[1],i=n[2],c=Math.min(o,a,i),f=Math.max(o,a,i),u=f-c,s=100*u/255,l=c/(255-u)*100;return 0===u?e=Number.NaN:(o===f&&(e=(a-i)/u),a===f&&(e=2+(i-o)/u),i===f&&(e=4+(o-a)/u),(e*=60)<0&&(e+=360)),[e,s,l]},Mt=xt,St=d.unpack,Ft=Math.floor,Ot=function(){for(var t,r,e,n,o,a,i=[],c=arguments.length;c--;)i[c]=arguments[c];var f,u,s,l=(i=St(i,"hcg"))[0],h=i[1],d=i[2];d*=255;var b=255*h;if(0===h)f=u=s=d;else{360===l&&(l=0),l>360&&(l-=360),l<0&&(l+=360);var p=Ft(l/=60),g=l-p,m=d*(1-h),v=m+b*(1-g),y=m+b*g,w=m+b;switch(p){case 0:f=(t=[w,y,m])[0],u=t[1],s=t[2];break;case 1:f=(r=[v,w,m])[0],u=r[1],s=r[2];break;case 2:f=(e=[m,w,y])[0],u=e[1],s=e[2];break;case 3:f=(n=[m,v,w])[0],u=n[1],s=n[2];break;case 4:f=(o=[y,m,w])[0],u=o[1],s=o[2];break;case 5:f=(a=[w,m,v])[0],u=a[1],s=a[2]}}return[f,u,s,i.length>3?i[3]:1]},At=Ot,Ct=d.unpack,_t=d.type,Lt=N,$t=w,jt=b,Et=Mt;$t.prototype.hcg=function(){return Et(this._rgb)},Lt.hcg=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply($t,[null].concat(t,["hcg"])))},jt.format.hcg=At,jt.autodetect.push({p:1,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=Ct(t,"hcg"),"array"===_t(t)&&3===t.length)return"hcg"}});var Pt=d.unpack,Dt=d.last,Rt=Math.round,It=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=Pt(t,"rgba"),n=e[0],o=e[1],a=e[2],i=e[3],c=Dt(t)||"auto";void 0===i&&(i=1),"auto"===c&&(c=i<1?"rgba":"rgb");var f="000000"+((n=Rt(n))<<16|(o=Rt(o))<<8|(a=Rt(a))).toString(16);f=f.substr(f.length-6);var u="0"+Rt(255*i).toString(16);switch(u=u.substr(u.length-2),c.toLowerCase()){case"rgba":return"#"+f+u;case"argb":return"#"+u+f;default:return"#"+f}},zt=It,qt=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Gt=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,Bt=function(t){if(t.match(qt)){4!==t.length&&7!==t.length||(t=t.substr(1)),3===t.length&&(t=(t=t.split(""))[0]+t[0]+t[1]+t[1]+t[2]+t[2]);var r=parseInt(t,16);return[r>>16,r>>8&255,255&r,1]}if(t.match(Gt)){5!==t.length&&9!==t.length||(t=t.substr(1)),4===t.length&&(t=(t=t.split(""))[0]+t[0]+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]);var e=parseInt(t,16);return[e>>24&255,e>>16&255,e>>8&255,Math.round((255&e)/255*100)/100]}throw new Error("unknown hex color: "+t)},Tt=N,Yt=w,Ut=d.type,Vt=b,Xt=zt;Yt.prototype.hex=function(t){return Xt(this._rgb,t)},Tt.hex=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(Yt,[null].concat(t,["hex"])))},Vt.format.hex=Bt,Vt.autodetect.push({p:4,test:function(t){for(var r=[],e=arguments.length-1;e-- >0;)r[e]=arguments[e+1];if(!r.length&&"string"===Ut(t)&&[3,4,5,6,7,8,9].indexOf(t.length)>=0)return"hex"}});var Wt=d.unpack,Zt=d.TWOPI,Ht=Math.min,Kt=Math.sqrt,Jt=Math.acos,Qt=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e,n=Wt(t,"rgb"),o=n[0],a=n[1],i=n[2],c=Ht(o/=255,a/=255,i/=255),f=(o+a+i)/3,u=f>0?1-c/f:0;return 0===u?e=NaN:(e=(o-a+(o-i))/2,e/=Kt((o-a)*(o-a)+(o-i)*(a-i)),e=Jt(e),i>a&&(e=Zt-e),e/=Zt),[360*e,u,f]},tr=Qt,rr=d.unpack,er=d.limit,nr=d.TWOPI,or=d.PITHIRD,ar=Math.cos,ir=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e,n,o,a=(t=rr(t,"hsi"))[0],i=t[1],c=t[2];return isNaN(a)&&(a=0),isNaN(i)&&(i=0),a>360&&(a-=360),a<0&&(a+=360),(a/=360)<1/3?n=1-((o=(1-i)/3)+(e=(1+i*ar(nr*a)/ar(or-nr*a))/3)):a<2/3?o=1-((e=(1-i)/3)+(n=(1+i*ar(nr*(a-=1/3))/ar(or-nr*a))/3)):e=1-((n=(1-i)/3)+(o=(1+i*ar(nr*(a-=2/3))/ar(or-nr*a))/3)),[255*(e=er(c*e*3)),255*(n=er(c*n*3)),255*(o=er(c*o*3)),t.length>3?t[3]:1]},cr=ir,fr=d.unpack,ur=d.type,sr=N,lr=w,hr=b,dr=tr;lr.prototype.hsi=function(){return dr(this._rgb)},sr.hsi=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(lr,[null].concat(t,["hsi"])))},hr.format.hsi=cr,hr.autodetect.push({p:2,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=fr(t,"hsi"),"array"===ur(t)&&3===t.length)return"hsi"}});var br=d.unpack,pr=d.type,gr=N,mr=w,vr=b,yr=T;mr.prototype.hsl=function(){return yr(this._rgb)},gr.hsl=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(mr,[null].concat(t,["hsl"])))},vr.format.hsl=tt,vr.autodetect.push({p:2,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=br(t,"hsl"),"array"===pr(t)&&3===t.length)return"hsl"}});var wr=d.unpack,kr=Math.min,Nr=Math.max,xr=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e,n,o,a=(t=wr(t,"rgb"))[0],i=t[1],c=t[2],f=kr(a,i,c),u=Nr(a,i,c),s=u-f;return o=u/255,0===u?(e=Number.NaN,n=0):(n=s/u,a===u&&(e=(i-c)/s),i===u&&(e=2+(c-a)/s),c===u&&(e=4+(a-i)/s),(e*=60)<0&&(e+=360)),[e,n,o]},Mr=xr,Sr=d.unpack,Fr=Math.floor,Or=function(){for(var t,r,e,n,o,a,i=[],c=arguments.length;c--;)i[c]=arguments[c];var f,u,s,l=(i=Sr(i,"hsv"))[0],h=i[1],d=i[2];if(d*=255,0===h)f=u=s=d;else{360===l&&(l=0),l>360&&(l-=360),l<0&&(l+=360);var b=Fr(l/=60),p=l-b,g=d*(1-h),m=d*(1-h*p),v=d*(1-h*(1-p));switch(b){case 0:f=(t=[d,v,g])[0],u=t[1],s=t[2];break;case 1:f=(r=[m,d,g])[0],u=r[1],s=r[2];break;case 2:f=(e=[g,d,v])[0],u=e[1],s=e[2];break;case 3:f=(n=[g,m,d])[0],u=n[1],s=n[2];break;case 4:f=(o=[v,g,d])[0],u=o[1],s=o[2];break;case 5:f=(a=[d,g,m])[0],u=a[1],s=a[2]}}return[f,u,s,i.length>3?i[3]:1]},Ar=Or,Cr=d.unpack,_r=d.type,Lr=N,$r=w,jr=b,Er=Mr;$r.prototype.hsv=function(){return Er(this._rgb)},Lr.hsv=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply($r,[null].concat(t,["hsv"])))},jr.format.hsv=Ar,jr.autodetect.push({p:2,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=Cr(t,"hsv"),"array"===_r(t)&&3===t.length)return"hsv"}});var Pr={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},Dr=Pr,Rr=d.unpack,Ir=Math.pow,zr=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=Rr(t,"rgb"),n=e[0],o=e[1],a=e[2],i=Br(n,o,a),c=i[0],f=i[1],u=116*f-16;return[u<0?0:u,500*(c-f),200*(f-i[2])]},qr=function(t){return(t/=255)<=.04045?t/12.92:Ir((t+.055)/1.055,2.4)},Gr=function(t){return t>Dr.t3?Ir(t,1/3):t/Dr.t2+Dr.t0},Br=function(t,r,e){return t=qr(t),r=qr(r),e=qr(e),[Gr((.4124564*t+.3575761*r+.1804375*e)/Dr.Xn),Gr((.2126729*t+.7151522*r+.072175*e)/Dr.Yn),Gr((.0193339*t+.119192*r+.9503041*e)/Dr.Zn)]},Tr=zr,Yr=Pr,Ur=d.unpack,Vr=Math.pow,Xr=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e,n,o,a=(t=Ur(t,"lab"))[0],i=t[1],c=t[2];return n=(a+16)/116,e=isNaN(i)?n:n+i/500,o=isNaN(c)?n:n-c/200,n=Yr.Yn*Zr(n),e=Yr.Xn*Zr(e),o=Yr.Zn*Zr(o),[Wr(3.2404542*e-1.5371385*n-.4985314*o),Wr(-.969266*e+1.8760108*n+.041556*o),Wr(.0556434*e-.2040259*n+1.0572252*o),t.length>3?t[3]:1]},Wr=function(t){return 255*(t<=.00304?12.92*t:1.055*Vr(t,1/2.4)-.055)},Zr=function(t){return t>Yr.t1?t*t*t:Yr.t2*(t-Yr.t0)},Hr=Xr,Kr=d.unpack,Jr=d.type,Qr=N,te=w,re=b,ee=Tr;te.prototype.lab=function(){return ee(this._rgb)},Qr.lab=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(te,[null].concat(t,["lab"])))},re.format.lab=Hr,re.autodetect.push({p:2,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=Kr(t,"lab"),"array"===Jr(t)&&3===t.length)return"lab"}});var ne=d.unpack,oe=d.RAD2DEG,ae=Math.sqrt,ie=Math.atan2,ce=Math.round,fe=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=ne(t,"lab"),n=e[0],o=e[1],a=e[2],i=ae(o*o+a*a),c=(ie(a,o)*oe+360)%360;return 0===ce(1e4*i)&&(c=Number.NaN),[n,i,c]},ue=fe,se=d.unpack,le=Tr,he=ue,de=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=se(t,"rgb"),n=e[0],o=e[1],a=e[2],i=le(n,o,a),c=i[0],f=i[1],u=i[2];return he(c,f,u)},be=de,pe=d.unpack,ge=d.DEG2RAD,me=Math.sin,ve=Math.cos,ye=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=pe(t,"lch"),n=e[0],o=e[1],a=e[2];return isNaN(a)&&(a=0),[n,ve(a*=ge)*o,me(a)*o]},we=ye,ke=d.unpack,Ne=we,xe=Hr,Me=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=(t=ke(t,"lch"))[0],n=t[1],o=t[2],a=Ne(e,n,o),i=a[0],c=a[1],f=a[2],u=xe(i,c,f);return[u[0],u[1],u[2],t.length>3?t[3]:1]},Se=Me,Fe=d.unpack,Oe=Se,Ae=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=Fe(t,"hcl").reverse();return Oe.apply(void 0,e)},Ce=Ae,_e=d.unpack,Le=d.type,$e=N,je=w,Ee=b,Pe=be;je.prototype.lch=function(){return Pe(this._rgb)},je.prototype.hcl=function(){return Pe(this._rgb).reverse()},$e.lch=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(je,[null].concat(t,["lch"])))},$e.hcl=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(je,[null].concat(t,["hcl"])))},Ee.format.lch=Se,Ee.format.hcl=Ce,["lch","hcl"].forEach((function(t){return Ee.autodetect.push({p:2,test:function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];if(r=_e(r,t),"array"===Le(r)&&3===r.length)return t}})}));var De={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",cornflower:"#6495ed",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"},Re=w,Ie=b,ze=d.type,qe=De,Ge=Bt,Be=zt;Re.prototype.name=function(){for(var t=Be(this._rgb,"rgb"),r=0,e=Object.keys(qe);r<e.length;r+=1){var n=e[r];if(qe[n]===t)return n.toLowerCase()}return t},Ie.format.named=function(t){if(t=t.toLowerCase(),qe[t])return Ge(qe[t]);throw new Error("unknown color name: "+t)},Ie.autodetect.push({p:5,test:function(t){for(var r=[],e=arguments.length-1;e-- >0;)r[e]=arguments[e+1];if(!r.length&&"string"===ze(t)&&qe[t.toLowerCase()])return"named"}});var Te=d.unpack,Ye=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=Te(t,"rgb");return(e[0]<<16)+(e[1]<<8)+e[2]},Ue=Ye,Ve=d.type,Xe=function(t){if("number"==Ve(t)&&t>=0&&t<=16777215)return[t>>16,t>>8&255,255&t,1];throw new Error("unknown num color: "+t)},We=N,Ze=w,He=b,Ke=d.type,Je=Ue;Ze.prototype.num=function(){return Je(this._rgb)},We.num=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(Ze,[null].concat(t,["num"])))},He.format.num=Xe,He.autodetect.push({p:5,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(1===t.length&&"number"===Ke(t[0])&&t[0]>=0&&t[0]<=16777215)return"num"}});var Qe=N,tn=w,rn=b,en=d.unpack,nn=d.type,on=Math.round;tn.prototype.rgb=function(t){return void 0===t&&(t=!0),!1===t?this._rgb.slice(0,3):this._rgb.slice(0,3).map(on)},tn.prototype.rgba=function(t){return void 0===t&&(t=!0),this._rgb.slice(0,4).map((function(r,e){return e<3?!1===t?r:on(r):r}))},Qe.rgb=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(tn,[null].concat(t,["rgb"])))},rn.format.rgb=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=en(t,"rgba");return void 0===e[3]&&(e[3]=1),e},rn.autodetect.push({p:3,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=en(t,"rgba"),"array"===nn(t)&&(3===t.length||4===t.length&&"number"==nn(t[3])&&t[3]>=0&&t[3]<=1))return"rgb"}});var an=Math.log,cn=function(t){var r,e,n,o=t/100;return o<66?(r=255,e=o<6?0:-155.25485562709179-.44596950469579133*(e=o-2)+104.49216199393888*an(e),n=o<20?0:.8274096064007395*(n=o-10)-254.76935184120902+115.67994401066147*an(n)):(r=351.97690566805693+.114206453784165*(r=o-55)-40.25366309332127*an(r),e=325.4494125711974+.07943456536662342*(e=o-50)-28.0852963507957*an(e),n=255),[r,e,n,1]},fn=cn,un=d.unpack,sn=Math.round,ln=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];for(var e,n=un(t,"rgb"),o=n[0],a=n[2],i=1e3,c=4e4,f=.4;c-i>f;){var u=fn(e=.5*(c+i));u[2]/u[0]>=a/o?c=e:i=e}return sn(e)},hn=N,dn=w,bn=b,pn=ln;dn.prototype.temp=dn.prototype.kelvin=dn.prototype.temperature=function(){return pn(this._rgb)},hn.temp=hn.kelvin=hn.temperature=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(dn,[null].concat(t,["temp"])))},bn.format.temp=bn.format.kelvin=bn.format.temperature=cn;var gn=d.unpack,mn=Math.cbrt,vn=Math.pow,yn=Math.sign,wn=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=gn(t,"rgb"),n=e[0],o=e[1],a=e[2],i=[Nn(n/255),Nn(o/255),Nn(a/255)],c=i[0],f=i[1],u=i[2],s=mn(.4122214708*c+.5363325363*f+.0514459929*u),l=mn(.2119034982*c+.6806995451*f+.1073969566*u),h=mn(.0883024619*c+.2817188376*f+.6299787005*u);return[.2104542553*s+.793617785*l-.0040720468*h,1.9779984951*s-2.428592205*l+.4505937099*h,.0259040371*s+.7827717662*l-.808675766*h]},kn=wn;function Nn(t){var r=Math.abs(t);return r<.04045?t/12.92:(yn(t)||1)*vn((r+.055)/1.055,2.4)}var xn=d.unpack,Mn=Math.pow,Sn=Math.sign,Fn=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=(t=xn(t,"lab"))[0],n=t[1],o=t[2],a=Mn(e+.3963377774*n+.2158037573*o,3),i=Mn(e-.1055613458*n-.0638541728*o,3),c=Mn(e-.0894841775*n-1.291485548*o,3);return[255*An(4.0767416621*a-3.3077115913*i+.2309699292*c),255*An(-1.2684380046*a+2.6097574011*i-.3413193965*c),255*An(-.0041960863*a-.7034186147*i+1.707614701*c),t.length>3?t[3]:1]},On=Fn;function An(t){var r=Math.abs(t);return r>.0031308?(Sn(t)||1)*(1.055*Mn(r,1/2.4)-.055):12.92*t}var Cn=d.unpack,_n=d.type,Ln=N,$n=w,jn=b,En=kn;$n.prototype.oklab=function(){return En(this._rgb)},Ln.oklab=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply($n,[null].concat(t,["oklab"])))},jn.format.oklab=On,jn.autodetect.push({p:3,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=Cn(t,"oklab"),"array"===_n(t)&&3===t.length)return"oklab"}});var Pn=d.unpack,Dn=kn,Rn=ue,In=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=Pn(t,"rgb"),n=e[0],o=e[1],a=e[2],i=Dn(n,o,a),c=i[0],f=i[1],u=i[2];return Rn(c,f,u)},zn=In,qn=d.unpack,Gn=we,Bn=On,Tn=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=(t=qn(t,"lch"))[0],n=t[1],o=t[2],a=Gn(e,n,o),i=a[0],c=a[1],f=a[2],u=Bn(i,c,f);return[u[0],u[1],u[2],t.length>3?t[3]:1]},Yn=Tn,Un=d.unpack,Vn=d.type,Xn=N,Wn=w,Zn=b,Hn=zn;Wn.prototype.oklch=function(){return Hn(this._rgb)},Xn.oklch=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(Wn,[null].concat(t,["oklch"])))},Zn.format.oklch=Yn,Zn.autodetect.push({p:3,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=Un(t,"oklch"),"array"===Vn(t)&&3===t.length)return"oklch"}});var Kn=w,Jn=d.type;Kn.prototype.alpha=function(t,r){return void 0===r&&(r=!1),void 0!==t&&"number"===Jn(t)?r?(this._rgb[3]=t,this):new Kn([this._rgb[0],this._rgb[1],this._rgb[2],t],"rgb"):this._rgb[3]},w.prototype.clipped=function(){return this._rgb._clipped||!1};var Qn=w,to=Pr;Qn.prototype.darken=function(t){void 0===t&&(t=1);var r=this,e=r.lab();return e[0]-=to.Kn*t,new Qn(e,"lab").alpha(r.alpha(),!0)},Qn.prototype.brighten=function(t){return void 0===t&&(t=1),this.darken(-t)},Qn.prototype.darker=Qn.prototype.darken,Qn.prototype.brighter=Qn.prototype.brighten,w.prototype.get=function(t){var r=t.split("."),e=r[0],n=r[1],o=this[e]();if(n){var a=e.indexOf(n)-("ok"===e.substr(0,2)?2:0);if(a>-1)return o[a];throw new Error("unknown channel "+n+" in mode "+e)}return o};var ro=w,eo=d.type,no=Math.pow,oo=1e-7,ao=20;ro.prototype.luminance=function(t){if(void 0!==t&&"number"===eo(t)){if(0===t)return new ro([0,0,0,this._rgb[3]],"rgb");if(1===t)return new ro([255,255,255,this._rgb[3]],"rgb");var r=this.luminance(),e="rgb",n=ao,o=function(r,a){var i=r.interpolate(a,.5,e),c=i.luminance();return Math.abs(t-c)<oo||!n--?i:c>t?o(r,i):o(i,a)},a=(r>t?o(new ro([0,0,0]),this):o(this,new ro([255,255,255]))).rgb();return new ro(a.concat([this._rgb[3]]))}return io.apply(void 0,this._rgb.slice(0,3))};var io=function(t,r,e){return.2126*(t=co(t))+.7152*(r=co(r))+.0722*(e=co(e))},co=function(t){return(t/=255)<=.03928?t/12.92:no((t+.055)/1.055,2.4)},fo={},uo=w,so=d.type,lo=fo,ho=function(t,r,e){void 0===e&&(e=.5);for(var n=[],o=arguments.length-3;o-- >0;)n[o]=arguments[o+3];var a=n[0]||"lrgb";if(lo[a]||n.length||(a=Object.keys(lo)[0]),!lo[a])throw new Error("interpolation mode "+a+" is not defined");return"object"!==so(t)&&(t=new uo(t)),"object"!==so(r)&&(r=new uo(r)),lo[a](t,r,e).alpha(t.alpha()+e*(r.alpha()-t.alpha()))},bo=w,po=ho;bo.prototype.mix=bo.prototype.interpolate=function(t,r){void 0===r&&(r=.5);for(var e=[],n=arguments.length-2;n-- >0;)e[n]=arguments[n+2];return po.apply(void 0,[this,t,r].concat(e))};var go=w;go.prototype.premultiply=function(t){void 0===t&&(t=!1);var r=this._rgb,e=r[3];return t?(this._rgb=[r[0]*e,r[1]*e,r[2]*e,e],this):new go([r[0]*e,r[1]*e,r[2]*e,e],"rgb")};var mo=w,vo=Pr;mo.prototype.saturate=function(t){void 0===t&&(t=1);var r=this,e=r.lch();return e[1]+=vo.Kn*t,e[1]<0&&(e[1]=0),new mo(e,"lch").alpha(r.alpha(),!0)},mo.prototype.desaturate=function(t){return void 0===t&&(t=1),this.saturate(-t)};var yo=w,wo=d.type;yo.prototype.set=function(t,r,e){void 0===e&&(e=!1);var n=t.split("."),o=n[0],a=n[1],i=this[o]();if(a){var c=o.indexOf(a)-("ok"===o.substr(0,2)?2:0);if(c>-1){if("string"==wo(r))switch(r.charAt(0)){case"+":case"-":i[c]+=+r;break;case"*":i[c]*=+r.substr(1);break;case"/":i[c]/=+r.substr(1);break;default:i[c]=+r}else{if("number"!==wo(r))throw new Error("unsupported value for Color.set");i[c]=r}var f=new yo(i,o);return e?(this._rgb=f._rgb,this):f}throw new Error("unknown channel "+a+" in mode "+o)}return i};var ko=w,No=function(t,r,e){var n=t._rgb,o=r._rgb;return new ko(n[0]+e*(o[0]-n[0]),n[1]+e*(o[1]-n[1]),n[2]+e*(o[2]-n[2]),"rgb")};fo.rgb=No;var xo=w,Mo=Math.sqrt,So=Math.pow,Fo=function(t,r,e){var n=t._rgb,o=n[0],a=n[1],i=n[2],c=r._rgb,f=c[0],u=c[1],s=c[2];return new xo(Mo(So(o,2)*(1-e)+So(f,2)*e),Mo(So(a,2)*(1-e)+So(u,2)*e),Mo(So(i,2)*(1-e)+So(s,2)*e),"rgb")};fo.lrgb=Fo;var Oo=w,Ao=function(t,r,e){var n=t.lab(),o=r.lab();return new Oo(n[0]+e*(o[0]-n[0]),n[1]+e*(o[1]-n[1]),n[2]+e*(o[2]-n[2]),"lab")};fo.lab=Ao;var Co=w,_o=function(t,r,e,n){var o,a,i,c,f,u,s,l,h,d,b,p,g;return"hsl"===n?(i=t.hsl(),c=r.hsl()):"hsv"===n?(i=t.hsv(),c=r.hsv()):"hcg"===n?(i=t.hcg(),c=r.hcg()):"hsi"===n?(i=t.hsi(),c=r.hsi()):"lch"===n||"hcl"===n?(n="hcl",i=t.hcl(),c=r.hcl()):"oklch"===n&&(i=t.oklch().reverse(),c=r.oklch().reverse()),"h"!==n.substr(0,1)&&"oklch"!==n||(f=(o=i)[0],s=o[1],h=o[2],u=(a=c)[0],l=a[1],d=a[2]),isNaN(f)||isNaN(u)?isNaN(f)?isNaN(u)?p=Number.NaN:(p=u,1!=h&&0!=h||"hsv"==n||(b=l)):(p=f,1!=d&&0!=d||"hsv"==n||(b=s)):p=f+e*(u>f&&u-f>180?u-(f+360):u<f&&f-u>180?u+360-f:u-f),void 0===b&&(b=s+e*(l-s)),g=h+e*(d-h),new Co("oklch"===n?[g,b,p]:[p,b,g],n)},Lo=_o,$o=function(t,r,e){return Lo(t,r,e,"lch")};fo.lch=$o,fo.hcl=$o;var jo=w,Eo=function(t,r,e){var n=t.num(),o=r.num();return new jo(n+e*(o-n),"num")};fo.num=Eo;var Po=_o,Do=function(t,r,e){return Po(t,r,e,"hcg")};fo.hcg=Do;var Ro=_o,Io=function(t,r,e){return Ro(t,r,e,"hsi")};fo.hsi=Io;var zo=_o,qo=function(t,r,e){return zo(t,r,e,"hsl")};fo.hsl=qo;var Go=_o,Bo=function(t,r,e){return Go(t,r,e,"hsv")};fo.hsv=Bo;var To=w,Yo=function(t,r,e){var n=t.oklab(),o=r.oklab();return new To(n[0]+e*(o[0]-n[0]),n[1]+e*(o[1]-n[1]),n[2]+e*(o[2]-n[2]),"oklab")};fo.oklab=Yo;var Uo=_o,Vo=function(t,r,e){return Uo(t,r,e,"oklch")};fo.oklch=Vo;var Xo=w,Wo=d.clip_rgb,Zo=Math.pow,Ho=Math.sqrt,Ko=Math.PI,Jo=Math.cos,Qo=Math.sin,ta=Math.atan2,ra=function(t,r,e){void 0===r&&(r="lrgb"),void 0===e&&(e=null);var n=t.length;e||(e=Array.from(new Array(n)).map((function(){return 1})));var o=n/e.reduce((function(t,r){return t+r}));if(e.forEach((function(t,r){e[r]*=o})),t=t.map((function(t){return new Xo(t)})),"lrgb"===r)return ea(t,e);for(var a=t.shift(),i=a.get(r),c=[],f=0,u=0,s=0;s<i.length;s++)if(i[s]=(i[s]||0)*e[0],c.push(isNaN(i[s])?0:e[0]),"h"===r.charAt(s)&&!isNaN(i[s])){var l=i[s]/180*Ko;f+=Jo(l)*e[0],u+=Qo(l)*e[0]}var h=a.alpha()*e[0];t.forEach((function(t,n){var o=t.get(r);h+=t.alpha()*e[n+1];for(var a=0;a<i.length;a++)if(!isNaN(o[a]))if(c[a]+=e[n+1],"h"===r.charAt(a)){var s=o[a]/180*Ko;f+=Jo(s)*e[n+1],u+=Qo(s)*e[n+1]}else i[a]+=o[a]*e[n+1]}));for(var d=0;d<i.length;d++)if("h"===r.charAt(d)){for(var b=ta(u/c[d],f/c[d])/Ko*180;b<0;)b+=360;for(;b>=360;)b-=360;i[d]=b}else i[d]=i[d]/c[d];return h/=n,new Xo(i,r).alpha(h>.99999?1:h,!0)},ea=function(t,r){for(var e=t.length,n=[0,0,0,0],o=0;o<t.length;o++){var a=t[o],i=r[o]/e,c=a._rgb;n[0]+=Zo(c[0],2)*i,n[1]+=Zo(c[1],2)*i,n[2]+=Zo(c[2],2)*i,n[3]+=c[3]*i}return n[0]=Ho(n[0]),n[1]=Ho(n[1]),n[2]=Ho(n[2]),n[3]>.9999999&&(n[3]=1),new Xo(Wo(n))},na=N,oa=d.type,aa=Math.pow,ia=function(t){var r="rgb",e=na("#ccc"),n=0,o=[0,1],a=[],i=[0,0],c=!1,f=[],u=!1,s=0,l=1,h=!1,d={},b=!0,p=1,g=function(t){if((t=t||["#fff","#000"])&&"string"===oa(t)&&na.brewer&&na.brewer[t.toLowerCase()]&&(t=na.brewer[t.toLowerCase()]),"array"===oa(t)){1===t.length&&(t=[t[0],t[0]]),t=t.slice(0);for(var r=0;r<t.length;r++)t[r]=na(t[r]);a.length=0;for(var e=0;e<t.length;e++)a.push(e/(t.length-1))}return k(),f=t},m=function(t){if(null!=c){for(var r=c.length-1,e=0;e<r&&t>=c[e];)e++;return e-1}return 0},v=function(t){return t},y=function(t){return t},w=function(t,n){var o,u;if(null==n&&(n=!1),isNaN(t)||null===t)return e;u=n?t:c&&c.length>2?m(t)/(c.length-2):l!==s?(t-s)/(l-s):1,u=y(u),n||(u=v(u)),1!==p&&(u=aa(u,p)),u=i[0]+u*(1-i[0]-i[1]),u=Math.min(1,Math.max(0,u));var h=Math.floor(1e4*u);if(b&&d[h])o=d[h];else{if("array"===oa(f))for(var g=0;g<a.length;g++){var w=a[g];if(u<=w){o=f[g];break}if(u>=w&&g===a.length-1){o=f[g];break}if(u>w&&u<a[g+1]){u=(u-w)/(a[g+1]-w),o=na.interpolate(f[g],f[g+1],u,r);break}}else"function"===oa(f)&&(o=f(u));b&&(d[h]=o)}return o},k=function(){return d={}};g(t);var N=function(t){var r=na(w(t));return u&&r[u]?r[u]():r};return N.classes=function(t){if(null!=t){if("array"===oa(t))c=t,o=[t[0],t[t.length-1]];else{var r=na.analyze(o);c=0===t?[r.min,r.max]:na.limits(r,"e",t)}return N}return c},N.domain=function(t){if(!arguments.length)return o;s=t[0],l=t[t.length-1],a=[];var r=f.length;if(t.length===r&&s!==l)for(var e=0,n=Array.from(t);e<n.length;e+=1){var i=n[e];a.push((i-s)/(l-s))}else{for(var c=0;c<r;c++)a.push(c/(r-1));if(t.length>2){var u=t.map((function(r,e){return e/(t.length-1)})),h=t.map((function(t){return(t-s)/(l-s)}));h.every((function(t,r){return u[r]===t}))||(y=function(t){if(t<=0||t>=1)return t;for(var r=0;t>=h[r+1];)r++;var e=(t-h[r])/(h[r+1]-h[r]);return u[r]+e*(u[r+1]-u[r])})}}return o=[s,l],N},N.mode=function(t){return arguments.length?(r=t,k(),N):r},N.range=function(t,r){return g(t),N},N.out=function(t){return u=t,N},N.spread=function(t){return arguments.length?(n=t,N):n},N.correctLightness=function(t){return null==t&&(t=!0),h=t,k(),v=h?function(t){for(var r=w(0,!0).lab()[0],e=w(1,!0).lab()[0],n=r>e,o=w(t,!0).lab()[0],a=r+(e-r)*t,i=o-a,c=0,f=1,u=20;Math.abs(i)>.01&&u-- >0;)n&&(i*=-1),i<0?(c=t,t+=.5*(f-t)):(f=t,t+=.5*(c-t)),o=w(t,!0).lab()[0],i=o-a;return t}:function(t){return t},N},N.padding=function(t){return null!=t?("number"===oa(t)&&(t=[t,t]),i=t,N):i},N.colors=function(r,e){arguments.length<2&&(e="hex");var n=[];if(0===arguments.length)n=f.slice(0);else if(1===r)n=[N(.5)];else if(r>1){var a=o[0],i=o[1]-a;n=ca(0,r,!1).map((function(t){return N(a+t/(r-1)*i)}))}else{t=[];var u=[];if(c&&c.length>2)for(var s=1,l=c.length,h=1<=l;h?s<l:s>l;h?s++:s--)u.push(.5*(c[s-1]+c[s]));else u=o;n=u.map((function(t){return N(t)}))}return na[e]&&(n=n.map((function(t){return t[e]()}))),n},N.cache=function(t){return null!=t?(b=t,N):b},N.gamma=function(t){return null!=t?(p=t,N):p},N.nodata=function(t){return null!=t?(e=na(t),N):e},N};function ca(t,r,e){for(var n=[],o=t<r,a=e?o?r+1:r-1:r,i=t;o?i<a:i>a;o?i++:i--)n.push(i);return n}var fa=w,ua=ia,sa=function(t){for(var r=[1,1],e=1;e<t;e++){for(var n=[1],o=1;o<=r.length;o++)n[o]=(r[o]||0)+r[o-1];r=n}return r},la=function(t){var r,e,n,o,a,i,c;if(2===(t=t.map((function(t){return new fa(t)}))).length)r=t.map((function(t){return t.lab()})),a=r[0],i=r[1],o=function(t){var r=[0,1,2].map((function(r){return a[r]+t*(i[r]-a[r])}));return new fa(r,"lab")};else if(3===t.length)e=t.map((function(t){return t.lab()})),a=e[0],i=e[1],c=e[2],o=function(t){var r=[0,1,2].map((function(r){return(1-t)*(1-t)*a[r]+2*(1-t)*t*i[r]+t*t*c[r]}));return new fa(r,"lab")};else if(4===t.length){var f;n=t.map((function(t){return t.lab()})),a=n[0],i=n[1],c=n[2],f=n[3],o=function(t){var r=[0,1,2].map((function(r){return(1-t)*(1-t)*(1-t)*a[r]+3*(1-t)*(1-t)*t*i[r]+3*(1-t)*t*t*c[r]+t*t*t*f[r]}));return new fa(r,"lab")}}else{if(!(t.length>=5))throw new RangeError("No point in running bezier with only one color.");var u,s,l;u=t.map((function(t){return t.lab()})),l=t.length-1,s=sa(l),o=function(t){var r=1-t,e=[0,1,2].map((function(e){return u.reduce((function(n,o,a){return n+s[a]*Math.pow(r,l-a)*Math.pow(t,a)*o[e]}),0)}));return new fa(e,"lab")}}return o},ha=function(t){var r=la(t);return r.scale=function(){return ua(r)},r},da=N,ba=function(t,r,e){if(!ba[e])throw new Error("unknown blend mode "+e);return ba[e](t,r)},pa=function(t){return function(r,e){var n=da(e).rgb(),o=da(r).rgb();return da.rgb(t(n,o))}},ga=function(t){return function(r,e){var n=[];return n[0]=t(r[0],e[0]),n[1]=t(r[1],e[1]),n[2]=t(r[2],e[2]),n}},ma=function(t){return t},va=function(t,r){return t*r/255},ya=function(t,r){return t>r?r:t},wa=function(t,r){return t>r?t:r},ka=function(t,r){return 255*(1-(1-t/255)*(1-r/255))},Na=function(t,r){return r<128?2*t*r/255:255*(1-2*(1-t/255)*(1-r/255))},xa=function(t,r){return 255*(1-(1-r/255)/(t/255))},Ma=function(t,r){return 255===t||(t=r/255*255/(1-t/255))>255?255:t};ba.normal=pa(ga(ma)),ba.multiply=pa(ga(va)),ba.screen=pa(ga(ka)),ba.overlay=pa(ga(Na)),ba.darken=pa(ga(ya)),ba.lighten=pa(ga(wa)),ba.dodge=pa(ga(Ma)),ba.burn=pa(ga(xa));for(var Sa=ba,Fa=d.type,Oa=d.clip_rgb,Aa=d.TWOPI,Ca=Math.pow,_a=Math.sin,La=Math.cos,$a=N,ja=function(t,r,e,n,o){void 0===t&&(t=300),void 0===r&&(r=-1.5),void 0===e&&(e=1),void 0===n&&(n=1),void 0===o&&(o=[0,1]);var a,i=0;"array"===Fa(o)?a=o[1]-o[0]:(a=0,o=[o,o]);var c=function(c){var f=Aa*((t+120)/360+r*c),u=Ca(o[0]+a*c,n),s=(0!==i?e[0]+c*i:e)*u*(1-u)/2,l=La(f),h=_a(f);return $a(Oa([255*(u+s*(-.14861*l+1.78277*h)),255*(u+s*(-.29227*l-.90649*h)),255*(u+s*(1.97294*l)),1]))};return c.start=function(r){return null==r?t:(t=r,c)},c.rotations=function(t){return null==t?r:(r=t,c)},c.gamma=function(t){return null==t?n:(n=t,c)},c.hue=function(t){return null==t?e:("array"===Fa(e=t)?0==(i=e[1]-e[0])&&(e=e[1]):i=0,c)},c.lightness=function(t){return null==t?o:("array"===Fa(t)?(o=t,a=t[1]-t[0]):(o=[t,t],a=0),c)},c.scale=function(){return $a.scale(c)},c.hue(e),c},Ea=w,Pa="0123456789abcdef",Da=Math.floor,Ra=Math.random,Ia=function(){for(var t="#",r=0;r<6;r++)t+=Pa.charAt(Da(16*Ra()));return new Ea(t,"hex")},za=c,qa=Math.log,Ga=Math.pow,Ba=Math.floor,Ta=Math.abs,Ya=function(t,r){void 0===r&&(r=null);var e={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0};return"object"===za(t)&&(t=Object.values(t)),t.forEach((function(t){r&&"object"===za(t)&&(t=t[r]),null==t||isNaN(t)||(e.values.push(t),e.sum+=t,t<e.min&&(e.min=t),t>e.max&&(e.max=t),e.count+=1)})),e.domain=[e.min,e.max],e.limits=function(t,r){return Ua(e,t,r)},e},Ua=function(t,r,e){void 0===r&&(r="equal"),void 0===e&&(e=7),"array"==za(t)&&(t=Ya(t));var n=t.min,o=t.max,a=t.values.sort((function(t,r){return t-r}));if(1===e)return[n,o];var i=[];if("c"===r.substr(0,1)&&(i.push(n),i.push(o)),"e"===r.substr(0,1)){i.push(n);for(var c=1;c<e;c++)i.push(n+c/e*(o-n));i.push(o)}else if("l"===r.substr(0,1)){if(n<=0)throw new Error("Logarithmic scales are only possible for values > 0");var f=Math.LOG10E*qa(n),u=Math.LOG10E*qa(o);i.push(n);for(var s=1;s<e;s++)i.push(Ga(10,f+s/e*(u-f)));i.push(o)}else if("q"===r.substr(0,1)){i.push(n);for(var l=1;l<e;l++){var h=(a.length-1)*l/e,d=Ba(h);if(d===h)i.push(a[d]);else{var b=h-d;i.push(a[d]*(1-b)+a[d+1]*b)}}i.push(o)}else if("k"===r.substr(0,1)){var p,g=a.length,m=new Array(g),v=new Array(e),y=!0,w=0,k=null;(k=[]).push(n);for(var N=1;N<e;N++)k.push(n+N/e*(o-n));for(k.push(o);y;){for(var x=0;x<e;x++)v[x]=0;for(var M=0;M<g;M++)for(var S=a[M],F=Number.MAX_VALUE,O=void 0,A=0;A<e;A++){var C=Ta(k[A]-S);C<F&&(F=C,O=A),v[O]++,m[M]=O}for(var _=new Array(e),L=0;L<e;L++)_[L]=null;for(var $=0;$<g;$++)null===_[p=m[$]]?_[p]=a[$]:_[p]+=a[$];for(var j=0;j<e;j++)_[j]*=1/v[j];y=!1;for(var E=0;E<e;E++)if(_[E]!==k[E]){y=!0;break}k=_,++w>200&&(y=!1)}for(var P={},D=0;D<e;D++)P[D]=[];for(var R=0;R<g;R++)P[p=m[R]].push(a[R]);for(var I=[],z=0;z<e;z++)I.push(P[z][0]),I.push(P[z][P[z].length-1]);I=I.sort((function(t,r){return t-r})),i.push(I[0]);for(var q=1;q<I.length;q+=2){var G=I[q];isNaN(G)||-1!==i.indexOf(G)||i.push(G)}}return i},Va={analyze:Ya,limits:Ua},Xa=w,Wa=function(t,r){t=new Xa(t),r=new Xa(r);var e=t.luminance(),n=r.luminance();return e>n?(e+.05)/(n+.05):(n+.05)/(e+.05)},Za=w,Ha=Math.sqrt,Ka=Math.pow,Ja=Math.min,Qa=Math.max,ti=Math.atan2,ri=Math.abs,ei=Math.cos,ni=Math.sin,oi=Math.exp,ai=Math.PI,ii=function(t,r,e,n,o){void 0===e&&(e=1),void 0===n&&(n=1),void 0===o&&(o=1);var a=function(t){return 360*t/(2*ai)},i=function(t){return 2*ai*t/360};t=new Za(t),r=new Za(r);var c=Array.from(t.lab()),f=c[0],u=c[1],s=c[2],l=Array.from(r.lab()),h=l[0],d=l[1],b=l[2],p=(f+h)/2,g=(Ha(Ka(u,2)+Ka(s,2))+Ha(Ka(d,2)+Ka(b,2)))/2,m=.5*(1-Ha(Ka(g,7)/(Ka(g,7)+Ka(25,7)))),v=u*(1+m),y=d*(1+m),w=Ha(Ka(v,2)+Ka(s,2)),k=Ha(Ka(y,2)+Ka(b,2)),N=(w+k)/2,x=a(ti(s,v)),M=a(ti(b,y)),S=x>=0?x:x+360,F=M>=0?M:M+360,O=ri(S-F)>180?(S+F+360)/2:(S+F)/2,A=1-.17*ei(i(O-30))+.24*ei(i(2*O))+.32*ei(i(3*O+6))-.2*ei(i(4*O-63)),C=F-S;C=ri(C)<=180?C:F<=S?C+360:C-360,C=2*Ha(w*k)*ni(i(C)/2);var _=h-f,L=k-w,$=1+.015*Ka(p-50,2)/Ha(20+Ka(p-50,2)),j=1+.045*N,E=1+.015*N*A,P=30*oi(-Ka((O-275)/25,2)),D=-2*Ha(Ka(N,7)/(Ka(N,7)+Ka(25,7)))*ni(2*i(P)),R=Ha(Ka(_/(e*$),2)+Ka(L/(n*j),2)+Ka(C/(o*E),2)+D*(L/(n*j))*(C/(o*E)));return Qa(0,Ja(100,R))},ci=w,fi=function(t,r,e){void 0===e&&(e="lab"),t=new ci(t),r=new ci(r);var n=t.get(e),o=r.get(e),a=0;for(var i in n){var c=(n[i]||0)-(o[i]||0);a+=c*c}return Math.sqrt(a)},ui=w,si=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];try{return new(Function.prototype.bind.apply(ui,[null].concat(t))),!0}catch(t){return!1}},li=N,hi=ia,di={cool:function(){return hi([li.hsl(180,1,.9),li.hsl(250,.7,.4)])},hot:function(){return hi(["#000","#f00","#ff0","#fff"]).mode("rgb")}},bi={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"]},pi=0,gi=Object.keys(bi);pi<gi.length;pi+=1){var mi=gi[pi];bi[mi.toLowerCase()]=bi[mi]}var vi=bi,yi=N;yi.average=ra,yi.bezier=ha,yi.blend=Sa,yi.cubehelix=ja,yi.mix=yi.interpolate=ho,yi.random=Ia,yi.scale=ia,yi.analyze=Va.analyze,yi.contrast=Wa,yi.deltaE=ii,yi.distance=fi,yi.limits=Va.limits,yi.valid=si,yi.scales=di,yi.colors=De,yi.brewer=vi;var wi=yi;return wi}()})),n=r((function(r){!function(t){function e(t,r){if(!(t=o(t)))return null;var n,a,i,c=1/0;r||(r=e.DEFAULT_COLORS);for(var f=0;f<r.length;++f)a=r[f].rgb,(n=Math.pow(t.r-a.r,2)+Math.pow(t.g-a.g,2)+Math.pow(t.b-a.b,2))<c&&(c=n,i=r[f]);return i.name?{name:i.name,value:i.source,rgb:i.rgb,distance:Math.sqrt(c)}:i.source}function n(t){return t instanceof Array?t.map((function(t){return a(t)})):Object.keys(t).map((function(r){return a(t[r],r)}))}function o(t){if("object"==typeof t)return t;if(t in e.STANDARD_COLORS)return o(e.STANDARD_COLORS[t]);var r=t.match(/^#?((?:[0-9a-f]{3}){1,2})$/i);if(r)return r=3===(r=r[1]).length?[r.charAt(0)+r.charAt(0),r.charAt(1)+r.charAt(1),r.charAt(2)+r.charAt(2)]:[r.substring(0,2),r.substring(2,4),r.substring(4,6)],{r:parseInt(r[0],16),g:parseInt(r[1],16),b:parseInt(r[2],16)};var n=t.match(/^rgb\(\s*(\d{1,3}%?),\s*(\d{1,3}%?),\s*(\d{1,3}%?)\s*\)$/i);if(n)return{r:i(n[1]),g:i(n[2]),b:i(n[3])};throw Error('"'+t+'" is not a valid color')}function a(t,r){var e,n={};if(r&&(n.name=r),"string"==typeof t)n.source=t,n.rgb=o(t);else if("object"==typeof t){if(t.source)return a(t.source,t.name);n.rgb=t,n.source="#"+c((e=t).r.toString(16))+c(e.g.toString(16))+c(e.b.toString(16))}return n}function i(t){return"%"===t.charAt(t.length-1)?Math.round(255*parseInt(t,10)/100):Number(t)}function c(t){return 1===t.length&&(t="0"+t),t}e.from=function t(r){var o=n(r),a=e,i=function(t){return a(t,o)};return i.from=t,i.or=function(t){var r=o.concat(n(t));return e.from(r)},i},e.STANDARD_COLORS={aqua:"#0ff",black:"#000",blue:"#00f",fuchsia:"#f0f",gray:"#808080",green:"#008000",lime:"#0f0",maroon:"#800000",navy:"#000080",olive:"#808000",orange:"#ffa500",purple:"#800080",red:"#f00",silver:"#c0c0c0",teal:"#008080",white:"#fff",yellow:"#ff0"},e.DEFAULT_COLORS=n(["#f00","#f80","#ff0","#0f0","#00f","#008","#808"]),e.VERSION="0.4.4",r&&r.exports?r.exports=e:t.nearestColor=e}(t)}));class o{xlmns="http://www.w3.org/2000/svg";getColorPiePaths(t,r=256){const e=document.createDocumentFragment(),n=document.createElementNS(this.xlmns,"defs"),o=document.createElementNS(this.xlmns,"mask"),a=document.createElementNS(this.xlmns,"rect"),i=document.createElementNS(this.xlmns,"g"),c=360/t.length,f="_"+Math.random().toString(36).substring(2,11);o.setAttributeNS(null,"id",f),a.setAttributeNS(null,"height","100%"),a.setAttributeNS(null,"width","100%"),a.setAttributeNS(null,"fill","white"),i.setAttributeNS(null,"mask",`url(#${f})`),o.appendChild(a);const u=360/t.length;var s,l;for(let r=(s=u/2,4===(l=t.length)||8===l||12===l?0:3===l||9===l?30:7===l?12:5===l?55:s);r<360;r+=u){const t=document.createElementNS(this.xlmns,"line");t.setAttributeNS(null,"x1","128"),t.setAttributeNS(null,"y1","128"),t.setAttributeNS(null,"x2","0"),t.setAttributeNS(null,"y2","128"),t.setAttributeNS(null,"stroke","black"),t.setAttributeNS(null,"stroke-width","6"),t.setAttributeNS(null,"transform",`rotate(${r} 128 128)`),o.appendChild(t)}let h=0;return t.forEach((t=>{const e=r/2/t.length;return h+=c,t.forEach(((t,n)=>{const o=r/2-n*e,a=document.createElementNS(this.xlmns,"path");a.setAttributeNS(null,"fill",t),a.setAttributeNS(null,"data-color-hex",t),a.setAttributeNS(null,"data-r",`${o}`),a.setAttributeNS(null,"d",((t,r,e,n=256)=>{const o=n/2,a=o;let i=t+r;if(t>i){const r=t;t=i,i=r}return`M ${o+e*Math.cos((90-t)*(Math.PI/180))} ${a+e*Math.sin((90-t)*(Math.PI/180))} A ${e} ${e} 0 ${i-t<=180?"0":"1"} 0 ${o+e*Math.cos((90-i)*(Math.PI/180))} ${a+e*Math.sin((90-i)*(Math.PI/180))} L ${o} ${a} Z`})(h,c,o)),i.appendChild(a)}))})),n.appendChild(o),e.appendChild(n),e.appendChild(i),e}}const a={diverging:!1,bezier:!1,randomOffset:!1,correctLightness:!1,noDuplicates:!0,colorScaleMode:"lch",reverseDirection:!1};class i{interpolate;luminanceShift;monochromatic;complement;split;triadic;tetradic;pentadic;hexadic;analogous;constructor(t){Object.keys(t).forEach((r=>{this[r]=t[r]}))}toArray(){return[...this.interpolate,...this.luminanceShift,...this.monochromatic,...this.complement,...this.split,...this.triadic,...this.tetradic,...this.pentadic,...this.hexadic,...this.analogous].flat()}}const c=(t,r,n,o,a={})=>{const{noDuplicates:i=!0}=a,c=[e(t).hex()];let[f,u,s]=e(t).hsl();isNaN(f)&&(f=0),u=Number((100*u).toFixed()),s=Number((100*s).toFixed());for(let t=r;t<=n;t+=o){const r=Number(((f+t)%360).toFixed());c.push(e(`hsl(${r}, ${u}%, ${s}%)`).hex())}let l=c;return i&&(l=[...new Set(c)]),l},f=(t,r)=>Math.floor(Math.random()*(t-r+1))+r,u=(t,r={})=>{const{numberOfColors:n=8,bezier:o=!1,randomOffset:a=!1,colorScaleMode:i,noDuplicates:c=!0,reverseDirection:u=!1,correctLightness:s=!0}=r;let[l,h,d]=e(t).hsl();isNaN(l)&&(l=0),l=Number(l.toFixed(0)),h=Number((100*h).toFixed(0)),d=Number((100*d).toFixed(0));const b=[];if(b.push(e(`hsl(${l}, ${h}%, ${d<0?0:d}%)`).hex()),a)for(let t=1;t<n;t++)u?(d+=f(0,10),l+=f(-5,5)):(d-=f(0,10),l-=f(-5,5)),l>359&&(l=359),l<0&&(l=0),b.push(e(`hsl(${l}, ${h}%, ${d<0?0:d}%)`).hex());else for(let t=1;t<n;t++)u?(d+=5,l+=5):(d-=5,l-=5),l>359&&(l=359),l<0&&(l=0),b.push(e(`hsl(${l}, ${h}%, ${d<0?0:d}%)`).hex());let p=b.map((t=>e(t).hex()));return c&&(p=[...new Set(p)]),o&&(p=p.length>1?e.bezier(p).scale().mode(i).correctLightness(s).colors(n):e.scale(p).mode(i).correctLightness(s).colors(n)),p},s=(t,r={})=>{if(!t)throw new Error("MoebiusPalettes: missing input `color`");const{diverging:n=!1,numberOfColors:o=7}=r,[a,i,c]=e(t).lab(),f=100*(.95-1/o),u=f/(o-1),s=.5*(100-f),l=((t,r,e)=>{const n=[];for(let o=t;o<r;o+=e)n.push(o);return n})(s,s+o*u,u);let h=0;if(!n){h=9999;for(let t=0;t<o;t++){const r=a-l[t];Math.abs(r)<Math.abs(h)&&(h=r)}}return l.map((t=>e.lab([t+h,i,c]).hex()))},l=(t,r={})=>{const{numberOfColors:n,reverseDirection:o=!1,diverging:a=!1,divergentColor:i}=r;if(a){const r=s(e(t).hex(),{numberOfColors:Math.ceil(n/2)}).concat(i);return o&&r.reverse(),r}return s(t,{numberOfColors:n})};class h{interpolate;luminanceShift;monochromatic;complement;split;triadic;tetradic;pentadic;hexadic;analogous;constructor(t,r){Object.keys(t).forEach((e=>{this[e]=t[e].map((t=>u(t,{...r,numberOfColors:9})))}))}toArray(){return[...this.interpolate,...this.luminanceShift,...this.monochromatic,...this.complement,...this.split,...this.triadic,...this.tetradic,...this.pentadic,...this.hexadic,...this.analogous].flat()}}class d{baseColor;secondaryColor;colors={};defaultOptions={...a,divergentColor:"#f5f5f5"};options;all=[];accents;constructor(t){this.options={...this.defaultOptions,...t},this.baseColor=this.options.baseColor,this.secondaryColor=this.options.secondaryColor,this.colors=new i({interpolate:this.interpolate(this.baseColor.hex,this.secondaryColor.hex,this.options),luminanceShift:this.luminanceShift([this.baseColor.hex],[this.secondaryColor.hex],this.options),monochromatic:this.monochromatic(this.baseColor.hex),complement:this.complement(this.baseColor.hex),split:this.split(this.baseColor.hex),triadic:this.triadic(this.baseColor.hex),tetradic:this.tetradic(this.baseColor.hex),pentadic:this.pentadic(this.baseColor.hex),hexadic:this.hexadic(this.baseColor.hex),analogous:this.analogous(this.baseColor.hex)}),this.accents=new h(this.colors,this.options),this.all=[...this.accents.toArray(),...this.colors.toArray()].flat()}complement(t,r={}){return((t,r={})=>{const{numberOfColors:n=8,colorScaleMode:o,correctLightness:a=!0}=r,i=c(t,180,180,1);return e.scale(i).mode(o).correctLightness(a).colors(n)})(t,{...this.options,...r})}split(t,r={}){return((t,r={})=>{const{numberOfColors:n=8,colorScaleMode:o,correctLightness:a=!0}=r,i=c(t,150,210,60);return e.scale(i).mode(o).correctLightness(a).colors(n)})(t,{...this.options,...r})}triadic(t,r={}){return((t,r={})=>{const{numberOfColors:n=8,colorScaleMode:o,correctLightness:a=!0}=r,i=c(t,120,240,120);return e.scale(i).mode(o).correctLightness(a).colors(n)})(t,{...this.options,...r})}tetradic(t,r={}){return((t,r={})=>{const{numberOfColors:n=8,colorScaleMode:o,correctLightness:a=!0}=r,i=c(t,90,270,90);return e.scale(i).mode(o).correctLightness(a).colors(n)})(t,{...this.options,...r})}pentadic(t,r={}){return((t,r={})=>{const{numberOfColors:n=8,colorScaleMode:o,correctLightness:a=!0}=r,i=c(t,144,360,72);return e.scale(i).mode(o).correctLightness(a).colors(n)})(t,{...this.options,...r})}hexadic(t,r={}){return((t,r={})=>{const{numberOfColors:n=8,colorScaleMode:o,correctLightness:a=!0}=r,i=c(t,120,360,60);return e.scale(i).mode(o).correctLightness(a).colors(n)})(t,{...this.options,...r})}analogous(t,r={}){return((t,r={})=>{const{numberOfColors:n=8,colorScaleMode:o,correctLightness:a=!0}=r,i=c(t,30,90,30);return e.scale(i).mode(o).correctLightness(a).colors(n)})(t,{...this.options,...r})}interpolate(t,r,n={}){return((t,r,n={})=>{const{numberOfColors:o=8,colorScaleMode:a,bezier:i=!1,correctLightness:c=!0}=n;let f=e.scale([t,r]).mode(a).correctLightness(c).colors(o);return i&&(f=e.bezier([t,r]).scale().mode(a).correctLightness(c).colors(o)),f})(t,r,{...this.options,...n})}luminanceShift(t,r=[],n={}){return((t,r=[],n={})=>{const{numberOfColors:o=8,diverging:a=!1,colorScaleMode:i,bezier:f=!1,divergentColor:u="#f5f5f5",correctLightness:s=!0}=n;r=0===r.length?[c(t[0],90,270,90)[3]]:r;const h=o%2==0,d=a?Math.ceil(o/2)+(h?1:0):o,b=a?Math.ceil(o/2)+(h?1:0):0,p=1!==t.length?t:l(t[0],{numberOfColors:d,divergentColor:u});let g=[];a&&(g=1!==r.length?r:l(r[0],{numberOfColors:b,divergentColor:u,reverse:!1,diverging:a}));let m=t.length?e.scale(p).mode(i).correctLightness(s).colors(d):[];f&&(m=t.length?e.bezier(p).scale().mode(i).correctLightness(s).colors(d):[]);let v=a&&r.length?e.scale(g).mode(i).correctLightness(s).colors(b):[];f&&(v=a&&r.length?e.bezier(g).scale().mode(i).correctLightness(s).colors(b):[]);let y=m;return y=(a?m.slice(0,m.length-(d%2!=0?0:1)):m).concat(v.reverse()),y})(t,r,{...this.options,...n})}monochromatic(t,r={}){const e={...this.options,...r};return u(t,e)}harmonize(t,r,e,n,o={}){const a={...this.options,...o};return c(t,r,e,n,a)}}const b=function([t,r,e]){this.h=Number(isNaN(t)?0:t.toFixed(0)),this.s=Number((100*r).toFixed()),this.l=Number((100*e).toFixed())};b.prototype.toString=function(){return`hsl(${Object.keys(this).map(((t,r)=>`${this[t]}${0!==r?"%":""}`)).join(", ")})`};const p=function([t,r,e]){this.h=Number(isNaN(t)?0:t.toFixed(0)),this.s=Number(r.toFixed(2)),this.l=Number(e.toFixed(2))};p.prototype.toString=function(){return Object.keys(this).map((t=>`${this[t]}`)).join(", ")};const g=function({x:t,y:r,z:e}){this.x=t,this.y=r,this.z=e};g.prototype.toString=function(){return Object.keys(this).map((t=>`${this[t]}`)).join(", ")};const m=function({c:t,m:r,y:e,k:n}){this.c=t,this.m=r,this.y=e,this.k=n};m.prototype.toString=function(){return Object.keys(this).map((t=>`${this[t]}`)).join(", ")};const v=function({r:t,g:r,b:e}){this.r=t,this.g=r,this.b=e};v.prototype.toString=function(){return Object.keys(this).map((t=>`${this[t]}`)).join(", ")};const y=function({h:t,w:r,b:e}){this.h=t,this.w=r,this.b=e};y.prototype.toString=function(){return Object.keys(this).map((t=>`${this[t]}`)).join(", ")};const w=function([t,r,e]){this.l=Number(t.toFixed(2)),this.a=Number(r.toFixed(2)),this.b=Number(e.toFixed(2))};w.prototype.toString=function(){return Object.keys(this).map((t=>`${this[t]}`)).join(", ")};const k=function([t,r,e]){this.l=Number(t.toFixed(2)),this.a=Number(r.toFixed(2)),this.b=Number(e.toFixed(2))};k.prototype.toString=function(){return Object.keys(this).map((t=>`${this[t]}`)).join(", ")};const N=function([t,r,e]){this.h=Number(isNaN(t)?0:t.toFixed(2)),this.s=Number(r.toFixed(2)),this.v=Number(e.toFixed(2))};N.prototype.toString=function(){return Object.keys(this).map((t=>`${this[t]}`)).join(", ")};const x=function([t,r,e]){this.l=Number(t.toFixed(2)),this.c=Number(r.toFixed(2)),this.h=Number(isNaN(e)?0:e.toFixed(2))};x.prototype.toString=function(){return Object.keys(this).map((t=>`${this[t]}`)).join(", ")};const M=function([t,r,e]){this.l=Number(t.toFixed(2)),this.c=Number(r.toFixed(2)),this.h=Number(e.toFixed(2))};M.prototype.toString=function(){return Object.keys(this).map((t=>`${this[t]}`)).join(", ")};const S=function([t,r,e]){this.h=Number(isNaN(t)?0:t.toFixed(2)),this.s=Number(r.toFixed(2)),this.i=Number(e.toFixed(2))};S.prototype.toString=function(){return Object.keys(this).map((t=>`${this[t]}`)).join(", ")};const F=t=>(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4),O=t=>t>.008856452?Math.pow(t,1/3):t/.12841855+.137931034;class A{color;name;hex;rgb;hsl;hwb;hsv;lab;xyz;lch;oklch;hsi;oklab;cmyk;constructor(t,r){this.color=t,this.name=r,this.hex=(t=>e(t).hex())(this.color),this.cmyk=(t=>{let[r,n,o]=e(t).rgb();r/=255,o/=255,n/=255;const a=+(1-Math.max(r,o,n)),i=+((1-o-a)/(1-a)||0),c=+((1-n-a)/(1-a)||0);return new m({c:Number((100*+((1-r-a)/(1-a)||0)).toFixed()),m:Number((100*i).toFixed()),y:Number((100*c).toFixed()),k:Number((100*a).toFixed())})})(this.color),this.xyz=(t=>{let[r,n,o]=e(t).rgb();r=F(r),o=F(o),n=F(n);const a=O((.4124564*r+.3575761*o+.1804375*n)/.95047),i=O((.2126729*r+.7151522*o+.072175*n)/1),c=O((.0193339*r+.119192*o+.9503041*n)/1.08883);return new g({x:Number(a.toFixed(2)),y:Number(i.toFixed(2)),z:Number(c.toFixed(2))})})(this.color),this.hsl=(t=>new b(e(t).hsl()))(this.color),this.hwb=(t=>{let[r,n,o]=e(t).rgb();r/=255,o/=255,n/=255;const a=Math.min(r,o,n),i=Math.max(r,o,n),c=1-i;return i===a?{h:0,w:a,b:c}:new y({h:Number((((r===a?3:o===a?5:1)-(r===a?o-n:o===a?n-r:r-o)/(i-a))/6).toFixed(2)),w:Number(a.toFixed(2)),b:Number(c.toFixed(2))})})(this.color),this.lab=(t=>new w(e(t).lab()))(this.color),this.oklab=(t=>new k(e(t).oklab()))(this.color),this.hsv=(t=>new N(e(t).hsv()))(this.color),this.lch=(t=>new x(e(t).lch()))(this.color),this.oklch=(t=>new M(e(t).oklch()))(this.color),this.hsi=(t=>new S(e(t).hsi()))(this.color),this.rgb=(t=>{const[r,n,o]=e(t).rgb();return`rgb(${r}, ${n}, ${o})`})(this.color)}toObject(t){return((t,r)=>{if("hsl"===r){const[r,n,o]=e(t).hsl();return{h:Number(isNaN(r)?0:r.toFixed(0)),s:Number((100*n).toFixed()),l:Number((100*o).toFixed())}}const n=e(t).rgb();return{r:n[0],g:n[1],b:n[2]}})(this.color,t)}toFloat(t){return((t,r)=>{if("hsl"===r)return new p(e(t).hsl());const n=e(t).rgb();return new v({r:Number((n[0]/255).toFixed(2)),g:Number((n[1]/255).toFixed(2)),b:Number((n[2]/255).toFixed(2))})})(this.color,t)}}async function C(){const t=await(async()=>{const t=await fetch("https://color-names.herokuapp.com/v1/"),r=(await t.json()).colors,e={};return r.forEach((t=>{e[t.name]=t.hex})),n.from(e)})();return{MoebiusColor:class extends A{constructor(r){super(e(r).hex(),"string"==typeof t(r)?t(r):t(r).name)}},MoebiusPalettes:d,MoebiusSVGHelper:o}}export{C as default};
1
+ var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(t){var r={exports:{}};return t(r,r.exports),r.exports}var e=r((function(t,r){t.exports=function(){for(var t=function(t,r,e){return void 0===r&&(r=0),void 0===e&&(e=1),t<r?r:t>e?e:t},r=t,e=function(t){t._clipped=!1,t._unclipped=t.slice(0);for(var e=0;e<=3;e++)e<3?((t[e]<0||t[e]>255)&&(t._clipped=!0),t[e]=r(t[e],0,255)):3===e&&(t[e]=r(t[e],0,1));return t},n={},o=0,a=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];o<a.length;o+=1){var i=a[o];n["[object "+i+"]"]=i.toLowerCase()}var c=function(t){return n[Object.prototype.toString.call(t)]||"object"},f=c,u=function(t,r){return void 0===r&&(r=null),t.length>=3?Array.prototype.slice.call(t):"object"==f(t[0])&&r?r.split("").filter((function(r){return void 0!==t[0][r]})).map((function(r){return t[0][r]})):t[0]},s=c,l=function(t){if(t.length<2)return null;var r=t.length-1;return"string"==s(t[r])?t[r].toLowerCase():null},h=Math.PI,d={clip_rgb:e,limit:t,type:c,unpack:u,last:l,PI:h,TWOPI:2*h,PITHIRD:h/3,DEG2RAD:h/180,RAD2DEG:180/h},b={format:{},autodetect:[]},p=d.last,g=d.clip_rgb,m=d.type,v=b,y=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=this;if("object"===m(t[0])&&t[0].constructor&&t[0].constructor===this.constructor)return t[0];var n=p(t),o=!1;if(!n){o=!0,v.sorted||(v.autodetect=v.autodetect.sort((function(t,r){return r.p-t.p})),v.sorted=!0);for(var a=0,i=v.autodetect;a<i.length;a+=1){var c=i[a];if(n=c.test.apply(c,t))break}}if(!v.format[n])throw new Error("unknown format: "+t);var f=v.format[n].apply(null,o?t:t.slice(0,-1));e._rgb=g(f),3===e._rgb.length&&e._rgb.push(1)};y.prototype.toString=function(){return"function"==m(this.hex)?this.hex():"["+this._rgb.join(",")+"]"};var w=y,k=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(k.Color,[null].concat(t)))};k.Color=w,k.version="2.4.2";var N=k,x=d.unpack,M=Math.max,S=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=x(t,"rgb"),n=e[0],o=e[1],a=e[2],i=1-M(n/=255,M(o/=255,a/=255)),c=i<1?1/(1-i):0;return[(1-n-i)*c,(1-o-i)*c,(1-a-i)*c,i]},F=S,O=d.unpack,A=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=(t=O(t,"cmyk"))[0],n=t[1],o=t[2],a=t[3],i=t.length>4?t[4]:1;return 1===a?[0,0,0,i]:[e>=1?0:255*(1-e)*(1-a),n>=1?0:255*(1-n)*(1-a),o>=1?0:255*(1-o)*(1-a),i]},C=A,_=N,L=w,$=b,j=d.unpack,E=d.type,P=F;L.prototype.cmyk=function(){return P(this._rgb)},_.cmyk=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(L,[null].concat(t,["cmyk"])))},$.format.cmyk=C,$.autodetect.push({p:2,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=j(t,"cmyk"),"array"===E(t)&&4===t.length)return"cmyk"}});var D=d.unpack,R=d.last,I=function(t){return Math.round(100*t)/100},z=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=D(t,"hsla"),n=R(t)||"lsa";return e[0]=I(e[0]||0),e[1]=I(100*e[1])+"%",e[2]=I(100*e[2])+"%","hsla"===n||e.length>3&&e[3]<1?(e[3]=e.length>3?e[3]:1,n="hsla"):e.length=3,n+"("+e.join(",")+")"},q=z,G=d.unpack,B=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=(t=G(t,"rgba"))[0],n=t[1],o=t[2];e/=255,n/=255,o/=255;var a,i,c=Math.min(e,n,o),f=Math.max(e,n,o),u=(f+c)/2;return f===c?(a=0,i=Number.NaN):a=u<.5?(f-c)/(f+c):(f-c)/(2-f-c),e==f?i=(n-o)/(f-c):n==f?i=2+(o-e)/(f-c):o==f&&(i=4+(e-n)/(f-c)),(i*=60)<0&&(i+=360),t.length>3&&void 0!==t[3]?[i,a,u,t[3]]:[i,a,u]},T=B,Y=d.unpack,U=d.last,V=q,X=T,W=Math.round,Z=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=Y(t,"rgba"),n=U(t)||"rgb";return"hsl"==n.substr(0,3)?V(X(e),n):(e[0]=W(e[0]),e[1]=W(e[1]),e[2]=W(e[2]),("rgba"===n||e.length>3&&e[3]<1)&&(e[3]=e.length>3?e[3]:1,n="rgba"),n+"("+e.slice(0,"rgb"===n?3:4).join(",")+")")},H=Z,K=d.unpack,J=Math.round,Q=function(){for(var t,r=[],e=arguments.length;e--;)r[e]=arguments[e];var n,o,a,i=(r=K(r,"hsl"))[0],c=r[1],f=r[2];if(0===c)n=o=a=255*f;else{var u=[0,0,0],s=[0,0,0],l=f<.5?f*(1+c):f+c-f*c,h=2*f-l,d=i/360;u[0]=d+1/3,u[1]=d,u[2]=d-1/3;for(var b=0;b<3;b++)u[b]<0&&(u[b]+=1),u[b]>1&&(u[b]-=1),6*u[b]<1?s[b]=h+6*(l-h)*u[b]:2*u[b]<1?s[b]=l:3*u[b]<2?s[b]=h+(l-h)*(2/3-u[b])*6:s[b]=h;n=(t=[J(255*s[0]),J(255*s[1]),J(255*s[2])])[0],o=t[1],a=t[2]}return r.length>3?[n,o,a,r[3]]:[n,o,a,1]},tt=Q,rt=tt,et=b,nt=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,ot=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,at=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,it=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,ct=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,ft=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,ut=Math.round,st=function(t){var r;if(t=t.toLowerCase().trim(),et.format.named)try{return et.format.named(t)}catch(t){}if(r=t.match(nt)){for(var e=r.slice(1,4),n=0;n<3;n++)e[n]=+e[n];return e[3]=1,e}if(r=t.match(ot)){for(var o=r.slice(1,5),a=0;a<4;a++)o[a]=+o[a];return o}if(r=t.match(at)){for(var i=r.slice(1,4),c=0;c<3;c++)i[c]=ut(2.55*i[c]);return i[3]=1,i}if(r=t.match(it)){for(var f=r.slice(1,5),u=0;u<3;u++)f[u]=ut(2.55*f[u]);return f[3]=+f[3],f}if(r=t.match(ct)){var s=r.slice(1,4);s[1]*=.01,s[2]*=.01;var l=rt(s);return l[3]=1,l}if(r=t.match(ft)){var h=r.slice(1,4);h[1]*=.01,h[2]*=.01;var d=rt(h);return d[3]=+r[4],d}};st.test=function(t){return nt.test(t)||ot.test(t)||at.test(t)||it.test(t)||ct.test(t)||ft.test(t)};var lt=st,ht=N,dt=w,bt=b,pt=d.type,gt=H,mt=lt;dt.prototype.css=function(t){return gt(this._rgb,t)},ht.css=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(dt,[null].concat(t,["css"])))},bt.format.css=mt,bt.autodetect.push({p:5,test:function(t){for(var r=[],e=arguments.length-1;e-- >0;)r[e]=arguments[e+1];if(!r.length&&"string"===pt(t)&&mt.test(t))return"css"}});var vt=w,yt=N,wt=b,kt=d.unpack;wt.format.gl=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=kt(t,"rgba");return e[0]*=255,e[1]*=255,e[2]*=255,e},yt.gl=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(vt,[null].concat(t,["gl"])))},vt.prototype.gl=function(){var t=this._rgb;return[t[0]/255,t[1]/255,t[2]/255,t[3]]};var Nt=d.unpack,xt=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e,n=Nt(t,"rgb"),o=n[0],a=n[1],i=n[2],c=Math.min(o,a,i),f=Math.max(o,a,i),u=f-c,s=100*u/255,l=c/(255-u)*100;return 0===u?e=Number.NaN:(o===f&&(e=(a-i)/u),a===f&&(e=2+(i-o)/u),i===f&&(e=4+(o-a)/u),(e*=60)<0&&(e+=360)),[e,s,l]},Mt=xt,St=d.unpack,Ft=Math.floor,Ot=function(){for(var t,r,e,n,o,a,i=[],c=arguments.length;c--;)i[c]=arguments[c];var f,u,s,l=(i=St(i,"hcg"))[0],h=i[1],d=i[2];d*=255;var b=255*h;if(0===h)f=u=s=d;else{360===l&&(l=0),l>360&&(l-=360),l<0&&(l+=360);var p=Ft(l/=60),g=l-p,m=d*(1-h),v=m+b*(1-g),y=m+b*g,w=m+b;switch(p){case 0:f=(t=[w,y,m])[0],u=t[1],s=t[2];break;case 1:f=(r=[v,w,m])[0],u=r[1],s=r[2];break;case 2:f=(e=[m,w,y])[0],u=e[1],s=e[2];break;case 3:f=(n=[m,v,w])[0],u=n[1],s=n[2];break;case 4:f=(o=[y,m,w])[0],u=o[1],s=o[2];break;case 5:f=(a=[w,m,v])[0],u=a[1],s=a[2]}}return[f,u,s,i.length>3?i[3]:1]},At=Ot,Ct=d.unpack,_t=d.type,Lt=N,$t=w,jt=b,Et=Mt;$t.prototype.hcg=function(){return Et(this._rgb)},Lt.hcg=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply($t,[null].concat(t,["hcg"])))},jt.format.hcg=At,jt.autodetect.push({p:1,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=Ct(t,"hcg"),"array"===_t(t)&&3===t.length)return"hcg"}});var Pt=d.unpack,Dt=d.last,Rt=Math.round,It=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=Pt(t,"rgba"),n=e[0],o=e[1],a=e[2],i=e[3],c=Dt(t)||"auto";void 0===i&&(i=1),"auto"===c&&(c=i<1?"rgba":"rgb");var f="000000"+((n=Rt(n))<<16|(o=Rt(o))<<8|(a=Rt(a))).toString(16);f=f.substr(f.length-6);var u="0"+Rt(255*i).toString(16);switch(u=u.substr(u.length-2),c.toLowerCase()){case"rgba":return"#"+f+u;case"argb":return"#"+u+f;default:return"#"+f}},zt=It,qt=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,Gt=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,Bt=function(t){if(t.match(qt)){4!==t.length&&7!==t.length||(t=t.substr(1)),3===t.length&&(t=(t=t.split(""))[0]+t[0]+t[1]+t[1]+t[2]+t[2]);var r=parseInt(t,16);return[r>>16,r>>8&255,255&r,1]}if(t.match(Gt)){5!==t.length&&9!==t.length||(t=t.substr(1)),4===t.length&&(t=(t=t.split(""))[0]+t[0]+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]);var e=parseInt(t,16);return[e>>24&255,e>>16&255,e>>8&255,Math.round((255&e)/255*100)/100]}throw new Error("unknown hex color: "+t)},Tt=N,Yt=w,Ut=d.type,Vt=b,Xt=zt;Yt.prototype.hex=function(t){return Xt(this._rgb,t)},Tt.hex=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(Yt,[null].concat(t,["hex"])))},Vt.format.hex=Bt,Vt.autodetect.push({p:4,test:function(t){for(var r=[],e=arguments.length-1;e-- >0;)r[e]=arguments[e+1];if(!r.length&&"string"===Ut(t)&&[3,4,5,6,7,8,9].indexOf(t.length)>=0)return"hex"}});var Wt=d.unpack,Zt=d.TWOPI,Ht=Math.min,Kt=Math.sqrt,Jt=Math.acos,Qt=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e,n=Wt(t,"rgb"),o=n[0],a=n[1],i=n[2],c=Ht(o/=255,a/=255,i/=255),f=(o+a+i)/3,u=f>0?1-c/f:0;return 0===u?e=NaN:(e=(o-a+(o-i))/2,e/=Kt((o-a)*(o-a)+(o-i)*(a-i)),e=Jt(e),i>a&&(e=Zt-e),e/=Zt),[360*e,u,f]},tr=Qt,rr=d.unpack,er=d.limit,nr=d.TWOPI,or=d.PITHIRD,ar=Math.cos,ir=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e,n,o,a=(t=rr(t,"hsi"))[0],i=t[1],c=t[2];return isNaN(a)&&(a=0),isNaN(i)&&(i=0),a>360&&(a-=360),a<0&&(a+=360),(a/=360)<1/3?n=1-((o=(1-i)/3)+(e=(1+i*ar(nr*a)/ar(or-nr*a))/3)):a<2/3?o=1-((e=(1-i)/3)+(n=(1+i*ar(nr*(a-=1/3))/ar(or-nr*a))/3)):e=1-((n=(1-i)/3)+(o=(1+i*ar(nr*(a-=2/3))/ar(or-nr*a))/3)),[255*(e=er(c*e*3)),255*(n=er(c*n*3)),255*(o=er(c*o*3)),t.length>3?t[3]:1]},cr=ir,fr=d.unpack,ur=d.type,sr=N,lr=w,hr=b,dr=tr;lr.prototype.hsi=function(){return dr(this._rgb)},sr.hsi=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(lr,[null].concat(t,["hsi"])))},hr.format.hsi=cr,hr.autodetect.push({p:2,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=fr(t,"hsi"),"array"===ur(t)&&3===t.length)return"hsi"}});var br=d.unpack,pr=d.type,gr=N,mr=w,vr=b,yr=T;mr.prototype.hsl=function(){return yr(this._rgb)},gr.hsl=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(mr,[null].concat(t,["hsl"])))},vr.format.hsl=tt,vr.autodetect.push({p:2,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=br(t,"hsl"),"array"===pr(t)&&3===t.length)return"hsl"}});var wr=d.unpack,kr=Math.min,Nr=Math.max,xr=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e,n,o,a=(t=wr(t,"rgb"))[0],i=t[1],c=t[2],f=kr(a,i,c),u=Nr(a,i,c),s=u-f;return o=u/255,0===u?(e=Number.NaN,n=0):(n=s/u,a===u&&(e=(i-c)/s),i===u&&(e=2+(c-a)/s),c===u&&(e=4+(a-i)/s),(e*=60)<0&&(e+=360)),[e,n,o]},Mr=xr,Sr=d.unpack,Fr=Math.floor,Or=function(){for(var t,r,e,n,o,a,i=[],c=arguments.length;c--;)i[c]=arguments[c];var f,u,s,l=(i=Sr(i,"hsv"))[0],h=i[1],d=i[2];if(d*=255,0===h)f=u=s=d;else{360===l&&(l=0),l>360&&(l-=360),l<0&&(l+=360);var b=Fr(l/=60),p=l-b,g=d*(1-h),m=d*(1-h*p),v=d*(1-h*(1-p));switch(b){case 0:f=(t=[d,v,g])[0],u=t[1],s=t[2];break;case 1:f=(r=[m,d,g])[0],u=r[1],s=r[2];break;case 2:f=(e=[g,d,v])[0],u=e[1],s=e[2];break;case 3:f=(n=[g,m,d])[0],u=n[1],s=n[2];break;case 4:f=(o=[v,g,d])[0],u=o[1],s=o[2];break;case 5:f=(a=[d,g,m])[0],u=a[1],s=a[2]}}return[f,u,s,i.length>3?i[3]:1]},Ar=Or,Cr=d.unpack,_r=d.type,Lr=N,$r=w,jr=b,Er=Mr;$r.prototype.hsv=function(){return Er(this._rgb)},Lr.hsv=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply($r,[null].concat(t,["hsv"])))},jr.format.hsv=Ar,jr.autodetect.push({p:2,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=Cr(t,"hsv"),"array"===_r(t)&&3===t.length)return"hsv"}});var Pr={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},Dr=Pr,Rr=d.unpack,Ir=Math.pow,zr=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=Rr(t,"rgb"),n=e[0],o=e[1],a=e[2],i=Br(n,o,a),c=i[0],f=i[1],u=116*f-16;return[u<0?0:u,500*(c-f),200*(f-i[2])]},qr=function(t){return(t/=255)<=.04045?t/12.92:Ir((t+.055)/1.055,2.4)},Gr=function(t){return t>Dr.t3?Ir(t,1/3):t/Dr.t2+Dr.t0},Br=function(t,r,e){return t=qr(t),r=qr(r),e=qr(e),[Gr((.4124564*t+.3575761*r+.1804375*e)/Dr.Xn),Gr((.2126729*t+.7151522*r+.072175*e)/Dr.Yn),Gr((.0193339*t+.119192*r+.9503041*e)/Dr.Zn)]},Tr=zr,Yr=Pr,Ur=d.unpack,Vr=Math.pow,Xr=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e,n,o,a=(t=Ur(t,"lab"))[0],i=t[1],c=t[2];return n=(a+16)/116,e=isNaN(i)?n:n+i/500,o=isNaN(c)?n:n-c/200,n=Yr.Yn*Zr(n),e=Yr.Xn*Zr(e),o=Yr.Zn*Zr(o),[Wr(3.2404542*e-1.5371385*n-.4985314*o),Wr(-.969266*e+1.8760108*n+.041556*o),Wr(.0556434*e-.2040259*n+1.0572252*o),t.length>3?t[3]:1]},Wr=function(t){return 255*(t<=.00304?12.92*t:1.055*Vr(t,1/2.4)-.055)},Zr=function(t){return t>Yr.t1?t*t*t:Yr.t2*(t-Yr.t0)},Hr=Xr,Kr=d.unpack,Jr=d.type,Qr=N,te=w,re=b,ee=Tr;te.prototype.lab=function(){return ee(this._rgb)},Qr.lab=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(te,[null].concat(t,["lab"])))},re.format.lab=Hr,re.autodetect.push({p:2,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=Kr(t,"lab"),"array"===Jr(t)&&3===t.length)return"lab"}});var ne=d.unpack,oe=d.RAD2DEG,ae=Math.sqrt,ie=Math.atan2,ce=Math.round,fe=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=ne(t,"lab"),n=e[0],o=e[1],a=e[2],i=ae(o*o+a*a),c=(ie(a,o)*oe+360)%360;return 0===ce(1e4*i)&&(c=Number.NaN),[n,i,c]},ue=fe,se=d.unpack,le=Tr,he=ue,de=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=se(t,"rgb"),n=e[0],o=e[1],a=e[2],i=le(n,o,a),c=i[0],f=i[1],u=i[2];return he(c,f,u)},be=de,pe=d.unpack,ge=d.DEG2RAD,me=Math.sin,ve=Math.cos,ye=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=pe(t,"lch"),n=e[0],o=e[1],a=e[2];return isNaN(a)&&(a=0),[n,ve(a*=ge)*o,me(a)*o]},we=ye,ke=d.unpack,Ne=we,xe=Hr,Me=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=(t=ke(t,"lch"))[0],n=t[1],o=t[2],a=Ne(e,n,o),i=a[0],c=a[1],f=a[2],u=xe(i,c,f);return[u[0],u[1],u[2],t.length>3?t[3]:1]},Se=Me,Fe=d.unpack,Oe=Se,Ae=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=Fe(t,"hcl").reverse();return Oe.apply(void 0,e)},Ce=Ae,_e=d.unpack,Le=d.type,$e=N,je=w,Ee=b,Pe=be;je.prototype.lch=function(){return Pe(this._rgb)},je.prototype.hcl=function(){return Pe(this._rgb).reverse()},$e.lch=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(je,[null].concat(t,["lch"])))},$e.hcl=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(je,[null].concat(t,["hcl"])))},Ee.format.lch=Se,Ee.format.hcl=Ce,["lch","hcl"].forEach((function(t){return Ee.autodetect.push({p:2,test:function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];if(r=_e(r,t),"array"===Le(r)&&3===r.length)return t}})}));var De={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",cornflower:"#6495ed",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"},Re=w,Ie=b,ze=d.type,qe=De,Ge=Bt,Be=zt;Re.prototype.name=function(){for(var t=Be(this._rgb,"rgb"),r=0,e=Object.keys(qe);r<e.length;r+=1){var n=e[r];if(qe[n]===t)return n.toLowerCase()}return t},Ie.format.named=function(t){if(t=t.toLowerCase(),qe[t])return Ge(qe[t]);throw new Error("unknown color name: "+t)},Ie.autodetect.push({p:5,test:function(t){for(var r=[],e=arguments.length-1;e-- >0;)r[e]=arguments[e+1];if(!r.length&&"string"===ze(t)&&qe[t.toLowerCase()])return"named"}});var Te=d.unpack,Ye=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=Te(t,"rgb");return(e[0]<<16)+(e[1]<<8)+e[2]},Ue=Ye,Ve=d.type,Xe=function(t){if("number"==Ve(t)&&t>=0&&t<=16777215)return[t>>16,t>>8&255,255&t,1];throw new Error("unknown num color: "+t)},We=N,Ze=w,He=b,Ke=d.type,Je=Ue;Ze.prototype.num=function(){return Je(this._rgb)},We.num=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(Ze,[null].concat(t,["num"])))},He.format.num=Xe,He.autodetect.push({p:5,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(1===t.length&&"number"===Ke(t[0])&&t[0]>=0&&t[0]<=16777215)return"num"}});var Qe=N,tn=w,rn=b,en=d.unpack,nn=d.type,on=Math.round;tn.prototype.rgb=function(t){return void 0===t&&(t=!0),!1===t?this._rgb.slice(0,3):this._rgb.slice(0,3).map(on)},tn.prototype.rgba=function(t){return void 0===t&&(t=!0),this._rgb.slice(0,4).map((function(r,e){return e<3?!1===t?r:on(r):r}))},Qe.rgb=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(tn,[null].concat(t,["rgb"])))},rn.format.rgb=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=en(t,"rgba");return void 0===e[3]&&(e[3]=1),e},rn.autodetect.push({p:3,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=en(t,"rgba"),"array"===nn(t)&&(3===t.length||4===t.length&&"number"==nn(t[3])&&t[3]>=0&&t[3]<=1))return"rgb"}});var an=Math.log,cn=function(t){var r,e,n,o=t/100;return o<66?(r=255,e=o<6?0:-155.25485562709179-.44596950469579133*(e=o-2)+104.49216199393888*an(e),n=o<20?0:.8274096064007395*(n=o-10)-254.76935184120902+115.67994401066147*an(n)):(r=351.97690566805693+.114206453784165*(r=o-55)-40.25366309332127*an(r),e=325.4494125711974+.07943456536662342*(e=o-50)-28.0852963507957*an(e),n=255),[r,e,n,1]},fn=cn,un=d.unpack,sn=Math.round,ln=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];for(var e,n=un(t,"rgb"),o=n[0],a=n[2],i=1e3,c=4e4,f=.4;c-i>f;){var u=fn(e=.5*(c+i));u[2]/u[0]>=a/o?c=e:i=e}return sn(e)},hn=N,dn=w,bn=b,pn=ln;dn.prototype.temp=dn.prototype.kelvin=dn.prototype.temperature=function(){return pn(this._rgb)},hn.temp=hn.kelvin=hn.temperature=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(dn,[null].concat(t,["temp"])))},bn.format.temp=bn.format.kelvin=bn.format.temperature=cn;var gn=d.unpack,mn=Math.cbrt,vn=Math.pow,yn=Math.sign,wn=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=gn(t,"rgb"),n=e[0],o=e[1],a=e[2],i=[Nn(n/255),Nn(o/255),Nn(a/255)],c=i[0],f=i[1],u=i[2],s=mn(.4122214708*c+.5363325363*f+.0514459929*u),l=mn(.2119034982*c+.6806995451*f+.1073969566*u),h=mn(.0883024619*c+.2817188376*f+.6299787005*u);return[.2104542553*s+.793617785*l-.0040720468*h,1.9779984951*s-2.428592205*l+.4505937099*h,.0259040371*s+.7827717662*l-.808675766*h]},kn=wn;function Nn(t){var r=Math.abs(t);return r<.04045?t/12.92:(yn(t)||1)*vn((r+.055)/1.055,2.4)}var xn=d.unpack,Mn=Math.pow,Sn=Math.sign,Fn=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=(t=xn(t,"lab"))[0],n=t[1],o=t[2],a=Mn(e+.3963377774*n+.2158037573*o,3),i=Mn(e-.1055613458*n-.0638541728*o,3),c=Mn(e-.0894841775*n-1.291485548*o,3);return[255*An(4.0767416621*a-3.3077115913*i+.2309699292*c),255*An(-1.2684380046*a+2.6097574011*i-.3413193965*c),255*An(-.0041960863*a-.7034186147*i+1.707614701*c),t.length>3?t[3]:1]},On=Fn;function An(t){var r=Math.abs(t);return r>.0031308?(Sn(t)||1)*(1.055*Mn(r,1/2.4)-.055):12.92*t}var Cn=d.unpack,_n=d.type,Ln=N,$n=w,jn=b,En=kn;$n.prototype.oklab=function(){return En(this._rgb)},Ln.oklab=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply($n,[null].concat(t,["oklab"])))},jn.format.oklab=On,jn.autodetect.push({p:3,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=Cn(t,"oklab"),"array"===_n(t)&&3===t.length)return"oklab"}});var Pn=d.unpack,Dn=kn,Rn=ue,In=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=Pn(t,"rgb"),n=e[0],o=e[1],a=e[2],i=Dn(n,o,a),c=i[0],f=i[1],u=i[2];return Rn(c,f,u)},zn=In,qn=d.unpack,Gn=we,Bn=On,Tn=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=(t=qn(t,"lch"))[0],n=t[1],o=t[2],a=Gn(e,n,o),i=a[0],c=a[1],f=a[2],u=Bn(i,c,f);return[u[0],u[1],u[2],t.length>3?t[3]:1]},Yn=Tn,Un=d.unpack,Vn=d.type,Xn=N,Wn=w,Zn=b,Hn=zn;Wn.prototype.oklch=function(){return Hn(this._rgb)},Xn.oklch=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(Wn,[null].concat(t,["oklch"])))},Zn.format.oklch=Yn,Zn.autodetect.push({p:3,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=Un(t,"oklch"),"array"===Vn(t)&&3===t.length)return"oklch"}});var Kn=w,Jn=d.type;Kn.prototype.alpha=function(t,r){return void 0===r&&(r=!1),void 0!==t&&"number"===Jn(t)?r?(this._rgb[3]=t,this):new Kn([this._rgb[0],this._rgb[1],this._rgb[2],t],"rgb"):this._rgb[3]},w.prototype.clipped=function(){return this._rgb._clipped||!1};var Qn=w,to=Pr;Qn.prototype.darken=function(t){void 0===t&&(t=1);var r=this,e=r.lab();return e[0]-=to.Kn*t,new Qn(e,"lab").alpha(r.alpha(),!0)},Qn.prototype.brighten=function(t){return void 0===t&&(t=1),this.darken(-t)},Qn.prototype.darker=Qn.prototype.darken,Qn.prototype.brighter=Qn.prototype.brighten,w.prototype.get=function(t){var r=t.split("."),e=r[0],n=r[1],o=this[e]();if(n){var a=e.indexOf(n)-("ok"===e.substr(0,2)?2:0);if(a>-1)return o[a];throw new Error("unknown channel "+n+" in mode "+e)}return o};var ro=w,eo=d.type,no=Math.pow,oo=1e-7,ao=20;ro.prototype.luminance=function(t){if(void 0!==t&&"number"===eo(t)){if(0===t)return new ro([0,0,0,this._rgb[3]],"rgb");if(1===t)return new ro([255,255,255,this._rgb[3]],"rgb");var r=this.luminance(),e="rgb",n=ao,o=function(r,a){var i=r.interpolate(a,.5,e),c=i.luminance();return Math.abs(t-c)<oo||!n--?i:c>t?o(r,i):o(i,a)},a=(r>t?o(new ro([0,0,0]),this):o(this,new ro([255,255,255]))).rgb();return new ro(a.concat([this._rgb[3]]))}return io.apply(void 0,this._rgb.slice(0,3))};var io=function(t,r,e){return.2126*(t=co(t))+.7152*(r=co(r))+.0722*(e=co(e))},co=function(t){return(t/=255)<=.03928?t/12.92:no((t+.055)/1.055,2.4)},fo={},uo=w,so=d.type,lo=fo,ho=function(t,r,e){void 0===e&&(e=.5);for(var n=[],o=arguments.length-3;o-- >0;)n[o]=arguments[o+3];var a=n[0]||"lrgb";if(lo[a]||n.length||(a=Object.keys(lo)[0]),!lo[a])throw new Error("interpolation mode "+a+" is not defined");return"object"!==so(t)&&(t=new uo(t)),"object"!==so(r)&&(r=new uo(r)),lo[a](t,r,e).alpha(t.alpha()+e*(r.alpha()-t.alpha()))},bo=w,po=ho;bo.prototype.mix=bo.prototype.interpolate=function(t,r){void 0===r&&(r=.5);for(var e=[],n=arguments.length-2;n-- >0;)e[n]=arguments[n+2];return po.apply(void 0,[this,t,r].concat(e))};var go=w;go.prototype.premultiply=function(t){void 0===t&&(t=!1);var r=this._rgb,e=r[3];return t?(this._rgb=[r[0]*e,r[1]*e,r[2]*e,e],this):new go([r[0]*e,r[1]*e,r[2]*e,e],"rgb")};var mo=w,vo=Pr;mo.prototype.saturate=function(t){void 0===t&&(t=1);var r=this,e=r.lch();return e[1]+=vo.Kn*t,e[1]<0&&(e[1]=0),new mo(e,"lch").alpha(r.alpha(),!0)},mo.prototype.desaturate=function(t){return void 0===t&&(t=1),this.saturate(-t)};var yo=w,wo=d.type;yo.prototype.set=function(t,r,e){void 0===e&&(e=!1);var n=t.split("."),o=n[0],a=n[1],i=this[o]();if(a){var c=o.indexOf(a)-("ok"===o.substr(0,2)?2:0);if(c>-1){if("string"==wo(r))switch(r.charAt(0)){case"+":case"-":i[c]+=+r;break;case"*":i[c]*=+r.substr(1);break;case"/":i[c]/=+r.substr(1);break;default:i[c]=+r}else{if("number"!==wo(r))throw new Error("unsupported value for Color.set");i[c]=r}var f=new yo(i,o);return e?(this._rgb=f._rgb,this):f}throw new Error("unknown channel "+a+" in mode "+o)}return i};var ko=w,No=function(t,r,e){var n=t._rgb,o=r._rgb;return new ko(n[0]+e*(o[0]-n[0]),n[1]+e*(o[1]-n[1]),n[2]+e*(o[2]-n[2]),"rgb")};fo.rgb=No;var xo=w,Mo=Math.sqrt,So=Math.pow,Fo=function(t,r,e){var n=t._rgb,o=n[0],a=n[1],i=n[2],c=r._rgb,f=c[0],u=c[1],s=c[2];return new xo(Mo(So(o,2)*(1-e)+So(f,2)*e),Mo(So(a,2)*(1-e)+So(u,2)*e),Mo(So(i,2)*(1-e)+So(s,2)*e),"rgb")};fo.lrgb=Fo;var Oo=w,Ao=function(t,r,e){var n=t.lab(),o=r.lab();return new Oo(n[0]+e*(o[0]-n[0]),n[1]+e*(o[1]-n[1]),n[2]+e*(o[2]-n[2]),"lab")};fo.lab=Ao;var Co=w,_o=function(t,r,e,n){var o,a,i,c,f,u,s,l,h,d,b,p,g;return"hsl"===n?(i=t.hsl(),c=r.hsl()):"hsv"===n?(i=t.hsv(),c=r.hsv()):"hcg"===n?(i=t.hcg(),c=r.hcg()):"hsi"===n?(i=t.hsi(),c=r.hsi()):"lch"===n||"hcl"===n?(n="hcl",i=t.hcl(),c=r.hcl()):"oklch"===n&&(i=t.oklch().reverse(),c=r.oklch().reverse()),"h"!==n.substr(0,1)&&"oklch"!==n||(f=(o=i)[0],s=o[1],h=o[2],u=(a=c)[0],l=a[1],d=a[2]),isNaN(f)||isNaN(u)?isNaN(f)?isNaN(u)?p=Number.NaN:(p=u,1!=h&&0!=h||"hsv"==n||(b=l)):(p=f,1!=d&&0!=d||"hsv"==n||(b=s)):p=f+e*(u>f&&u-f>180?u-(f+360):u<f&&f-u>180?u+360-f:u-f),void 0===b&&(b=s+e*(l-s)),g=h+e*(d-h),new Co("oklch"===n?[g,b,p]:[p,b,g],n)},Lo=_o,$o=function(t,r,e){return Lo(t,r,e,"lch")};fo.lch=$o,fo.hcl=$o;var jo=w,Eo=function(t,r,e){var n=t.num(),o=r.num();return new jo(n+e*(o-n),"num")};fo.num=Eo;var Po=_o,Do=function(t,r,e){return Po(t,r,e,"hcg")};fo.hcg=Do;var Ro=_o,Io=function(t,r,e){return Ro(t,r,e,"hsi")};fo.hsi=Io;var zo=_o,qo=function(t,r,e){return zo(t,r,e,"hsl")};fo.hsl=qo;var Go=_o,Bo=function(t,r,e){return Go(t,r,e,"hsv")};fo.hsv=Bo;var To=w,Yo=function(t,r,e){var n=t.oklab(),o=r.oklab();return new To(n[0]+e*(o[0]-n[0]),n[1]+e*(o[1]-n[1]),n[2]+e*(o[2]-n[2]),"oklab")};fo.oklab=Yo;var Uo=_o,Vo=function(t,r,e){return Uo(t,r,e,"oklch")};fo.oklch=Vo;var Xo=w,Wo=d.clip_rgb,Zo=Math.pow,Ho=Math.sqrt,Ko=Math.PI,Jo=Math.cos,Qo=Math.sin,ta=Math.atan2,ra=function(t,r,e){void 0===r&&(r="lrgb"),void 0===e&&(e=null);var n=t.length;e||(e=Array.from(new Array(n)).map((function(){return 1})));var o=n/e.reduce((function(t,r){return t+r}));if(e.forEach((function(t,r){e[r]*=o})),t=t.map((function(t){return new Xo(t)})),"lrgb"===r)return ea(t,e);for(var a=t.shift(),i=a.get(r),c=[],f=0,u=0,s=0;s<i.length;s++)if(i[s]=(i[s]||0)*e[0],c.push(isNaN(i[s])?0:e[0]),"h"===r.charAt(s)&&!isNaN(i[s])){var l=i[s]/180*Ko;f+=Jo(l)*e[0],u+=Qo(l)*e[0]}var h=a.alpha()*e[0];t.forEach((function(t,n){var o=t.get(r);h+=t.alpha()*e[n+1];for(var a=0;a<i.length;a++)if(!isNaN(o[a]))if(c[a]+=e[n+1],"h"===r.charAt(a)){var s=o[a]/180*Ko;f+=Jo(s)*e[n+1],u+=Qo(s)*e[n+1]}else i[a]+=o[a]*e[n+1]}));for(var d=0;d<i.length;d++)if("h"===r.charAt(d)){for(var b=ta(u/c[d],f/c[d])/Ko*180;b<0;)b+=360;for(;b>=360;)b-=360;i[d]=b}else i[d]=i[d]/c[d];return h/=n,new Xo(i,r).alpha(h>.99999?1:h,!0)},ea=function(t,r){for(var e=t.length,n=[0,0,0,0],o=0;o<t.length;o++){var a=t[o],i=r[o]/e,c=a._rgb;n[0]+=Zo(c[0],2)*i,n[1]+=Zo(c[1],2)*i,n[2]+=Zo(c[2],2)*i,n[3]+=c[3]*i}return n[0]=Ho(n[0]),n[1]=Ho(n[1]),n[2]=Ho(n[2]),n[3]>.9999999&&(n[3]=1),new Xo(Wo(n))},na=N,oa=d.type,aa=Math.pow,ia=function(t){var r="rgb",e=na("#ccc"),n=0,o=[0,1],a=[],i=[0,0],c=!1,f=[],u=!1,s=0,l=1,h=!1,d={},b=!0,p=1,g=function(t){if((t=t||["#fff","#000"])&&"string"===oa(t)&&na.brewer&&na.brewer[t.toLowerCase()]&&(t=na.brewer[t.toLowerCase()]),"array"===oa(t)){1===t.length&&(t=[t[0],t[0]]),t=t.slice(0);for(var r=0;r<t.length;r++)t[r]=na(t[r]);a.length=0;for(var e=0;e<t.length;e++)a.push(e/(t.length-1))}return k(),f=t},m=function(t){if(null!=c){for(var r=c.length-1,e=0;e<r&&t>=c[e];)e++;return e-1}return 0},v=function(t){return t},y=function(t){return t},w=function(t,n){var o,u;if(null==n&&(n=!1),isNaN(t)||null===t)return e;u=n?t:c&&c.length>2?m(t)/(c.length-2):l!==s?(t-s)/(l-s):1,u=y(u),n||(u=v(u)),1!==p&&(u=aa(u,p)),u=i[0]+u*(1-i[0]-i[1]),u=Math.min(1,Math.max(0,u));var h=Math.floor(1e4*u);if(b&&d[h])o=d[h];else{if("array"===oa(f))for(var g=0;g<a.length;g++){var w=a[g];if(u<=w){o=f[g];break}if(u>=w&&g===a.length-1){o=f[g];break}if(u>w&&u<a[g+1]){u=(u-w)/(a[g+1]-w),o=na.interpolate(f[g],f[g+1],u,r);break}}else"function"===oa(f)&&(o=f(u));b&&(d[h]=o)}return o},k=function(){return d={}};g(t);var N=function(t){var r=na(w(t));return u&&r[u]?r[u]():r};return N.classes=function(t){if(null!=t){if("array"===oa(t))c=t,o=[t[0],t[t.length-1]];else{var r=na.analyze(o);c=0===t?[r.min,r.max]:na.limits(r,"e",t)}return N}return c},N.domain=function(t){if(!arguments.length)return o;s=t[0],l=t[t.length-1],a=[];var r=f.length;if(t.length===r&&s!==l)for(var e=0,n=Array.from(t);e<n.length;e+=1){var i=n[e];a.push((i-s)/(l-s))}else{for(var c=0;c<r;c++)a.push(c/(r-1));if(t.length>2){var u=t.map((function(r,e){return e/(t.length-1)})),h=t.map((function(t){return(t-s)/(l-s)}));h.every((function(t,r){return u[r]===t}))||(y=function(t){if(t<=0||t>=1)return t;for(var r=0;t>=h[r+1];)r++;var e=(t-h[r])/(h[r+1]-h[r]);return u[r]+e*(u[r+1]-u[r])})}}return o=[s,l],N},N.mode=function(t){return arguments.length?(r=t,k(),N):r},N.range=function(t,r){return g(t),N},N.out=function(t){return u=t,N},N.spread=function(t){return arguments.length?(n=t,N):n},N.correctLightness=function(t){return null==t&&(t=!0),h=t,k(),v=h?function(t){for(var r=w(0,!0).lab()[0],e=w(1,!0).lab()[0],n=r>e,o=w(t,!0).lab()[0],a=r+(e-r)*t,i=o-a,c=0,f=1,u=20;Math.abs(i)>.01&&u-- >0;)n&&(i*=-1),i<0?(c=t,t+=.5*(f-t)):(f=t,t+=.5*(c-t)),o=w(t,!0).lab()[0],i=o-a;return t}:function(t){return t},N},N.padding=function(t){return null!=t?("number"===oa(t)&&(t=[t,t]),i=t,N):i},N.colors=function(r,e){arguments.length<2&&(e="hex");var n=[];if(0===arguments.length)n=f.slice(0);else if(1===r)n=[N(.5)];else if(r>1){var a=o[0],i=o[1]-a;n=ca(0,r,!1).map((function(t){return N(a+t/(r-1)*i)}))}else{t=[];var u=[];if(c&&c.length>2)for(var s=1,l=c.length,h=1<=l;h?s<l:s>l;h?s++:s--)u.push(.5*(c[s-1]+c[s]));else u=o;n=u.map((function(t){return N(t)}))}return na[e]&&(n=n.map((function(t){return t[e]()}))),n},N.cache=function(t){return null!=t?(b=t,N):b},N.gamma=function(t){return null!=t?(p=t,N):p},N.nodata=function(t){return null!=t?(e=na(t),N):e},N};function ca(t,r,e){for(var n=[],o=t<r,a=e?o?r+1:r-1:r,i=t;o?i<a:i>a;o?i++:i--)n.push(i);return n}var fa=w,ua=ia,sa=function(t){for(var r=[1,1],e=1;e<t;e++){for(var n=[1],o=1;o<=r.length;o++)n[o]=(r[o]||0)+r[o-1];r=n}return r},la=function(t){var r,e,n,o,a,i,c;if(2===(t=t.map((function(t){return new fa(t)}))).length)r=t.map((function(t){return t.lab()})),a=r[0],i=r[1],o=function(t){var r=[0,1,2].map((function(r){return a[r]+t*(i[r]-a[r])}));return new fa(r,"lab")};else if(3===t.length)e=t.map((function(t){return t.lab()})),a=e[0],i=e[1],c=e[2],o=function(t){var r=[0,1,2].map((function(r){return(1-t)*(1-t)*a[r]+2*(1-t)*t*i[r]+t*t*c[r]}));return new fa(r,"lab")};else if(4===t.length){var f;n=t.map((function(t){return t.lab()})),a=n[0],i=n[1],c=n[2],f=n[3],o=function(t){var r=[0,1,2].map((function(r){return(1-t)*(1-t)*(1-t)*a[r]+3*(1-t)*(1-t)*t*i[r]+3*(1-t)*t*t*c[r]+t*t*t*f[r]}));return new fa(r,"lab")}}else{if(!(t.length>=5))throw new RangeError("No point in running bezier with only one color.");var u,s,l;u=t.map((function(t){return t.lab()})),l=t.length-1,s=sa(l),o=function(t){var r=1-t,e=[0,1,2].map((function(e){return u.reduce((function(n,o,a){return n+s[a]*Math.pow(r,l-a)*Math.pow(t,a)*o[e]}),0)}));return new fa(e,"lab")}}return o},ha=function(t){var r=la(t);return r.scale=function(){return ua(r)},r},da=N,ba=function(t,r,e){if(!ba[e])throw new Error("unknown blend mode "+e);return ba[e](t,r)},pa=function(t){return function(r,e){var n=da(e).rgb(),o=da(r).rgb();return da.rgb(t(n,o))}},ga=function(t){return function(r,e){var n=[];return n[0]=t(r[0],e[0]),n[1]=t(r[1],e[1]),n[2]=t(r[2],e[2]),n}},ma=function(t){return t},va=function(t,r){return t*r/255},ya=function(t,r){return t>r?r:t},wa=function(t,r){return t>r?t:r},ka=function(t,r){return 255*(1-(1-t/255)*(1-r/255))},Na=function(t,r){return r<128?2*t*r/255:255*(1-2*(1-t/255)*(1-r/255))},xa=function(t,r){return 255*(1-(1-r/255)/(t/255))},Ma=function(t,r){return 255===t||(t=r/255*255/(1-t/255))>255?255:t};ba.normal=pa(ga(ma)),ba.multiply=pa(ga(va)),ba.screen=pa(ga(ka)),ba.overlay=pa(ga(Na)),ba.darken=pa(ga(ya)),ba.lighten=pa(ga(wa)),ba.dodge=pa(ga(Ma)),ba.burn=pa(ga(xa));for(var Sa=ba,Fa=d.type,Oa=d.clip_rgb,Aa=d.TWOPI,Ca=Math.pow,_a=Math.sin,La=Math.cos,$a=N,ja=function(t,r,e,n,o){void 0===t&&(t=300),void 0===r&&(r=-1.5),void 0===e&&(e=1),void 0===n&&(n=1),void 0===o&&(o=[0,1]);var a,i=0;"array"===Fa(o)?a=o[1]-o[0]:(a=0,o=[o,o]);var c=function(c){var f=Aa*((t+120)/360+r*c),u=Ca(o[0]+a*c,n),s=(0!==i?e[0]+c*i:e)*u*(1-u)/2,l=La(f),h=_a(f);return $a(Oa([255*(u+s*(-.14861*l+1.78277*h)),255*(u+s*(-.29227*l-.90649*h)),255*(u+s*(1.97294*l)),1]))};return c.start=function(r){return null==r?t:(t=r,c)},c.rotations=function(t){return null==t?r:(r=t,c)},c.gamma=function(t){return null==t?n:(n=t,c)},c.hue=function(t){return null==t?e:("array"===Fa(e=t)?0==(i=e[1]-e[0])&&(e=e[1]):i=0,c)},c.lightness=function(t){return null==t?o:("array"===Fa(t)?(o=t,a=t[1]-t[0]):(o=[t,t],a=0),c)},c.scale=function(){return $a.scale(c)},c.hue(e),c},Ea=w,Pa="0123456789abcdef",Da=Math.floor,Ra=Math.random,Ia=function(){for(var t="#",r=0;r<6;r++)t+=Pa.charAt(Da(16*Ra()));return new Ea(t,"hex")},za=c,qa=Math.log,Ga=Math.pow,Ba=Math.floor,Ta=Math.abs,Ya=function(t,r){void 0===r&&(r=null);var e={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0};return"object"===za(t)&&(t=Object.values(t)),t.forEach((function(t){r&&"object"===za(t)&&(t=t[r]),null==t||isNaN(t)||(e.values.push(t),e.sum+=t,t<e.min&&(e.min=t),t>e.max&&(e.max=t),e.count+=1)})),e.domain=[e.min,e.max],e.limits=function(t,r){return Ua(e,t,r)},e},Ua=function(t,r,e){void 0===r&&(r="equal"),void 0===e&&(e=7),"array"==za(t)&&(t=Ya(t));var n=t.min,o=t.max,a=t.values.sort((function(t,r){return t-r}));if(1===e)return[n,o];var i=[];if("c"===r.substr(0,1)&&(i.push(n),i.push(o)),"e"===r.substr(0,1)){i.push(n);for(var c=1;c<e;c++)i.push(n+c/e*(o-n));i.push(o)}else if("l"===r.substr(0,1)){if(n<=0)throw new Error("Logarithmic scales are only possible for values > 0");var f=Math.LOG10E*qa(n),u=Math.LOG10E*qa(o);i.push(n);for(var s=1;s<e;s++)i.push(Ga(10,f+s/e*(u-f)));i.push(o)}else if("q"===r.substr(0,1)){i.push(n);for(var l=1;l<e;l++){var h=(a.length-1)*l/e,d=Ba(h);if(d===h)i.push(a[d]);else{var b=h-d;i.push(a[d]*(1-b)+a[d+1]*b)}}i.push(o)}else if("k"===r.substr(0,1)){var p,g=a.length,m=new Array(g),v=new Array(e),y=!0,w=0,k=null;(k=[]).push(n);for(var N=1;N<e;N++)k.push(n+N/e*(o-n));for(k.push(o);y;){for(var x=0;x<e;x++)v[x]=0;for(var M=0;M<g;M++)for(var S=a[M],F=Number.MAX_VALUE,O=void 0,A=0;A<e;A++){var C=Ta(k[A]-S);C<F&&(F=C,O=A),v[O]++,m[M]=O}for(var _=new Array(e),L=0;L<e;L++)_[L]=null;for(var $=0;$<g;$++)null===_[p=m[$]]?_[p]=a[$]:_[p]+=a[$];for(var j=0;j<e;j++)_[j]*=1/v[j];y=!1;for(var E=0;E<e;E++)if(_[E]!==k[E]){y=!0;break}k=_,++w>200&&(y=!1)}for(var P={},D=0;D<e;D++)P[D]=[];for(var R=0;R<g;R++)P[p=m[R]].push(a[R]);for(var I=[],z=0;z<e;z++)I.push(P[z][0]),I.push(P[z][P[z].length-1]);I=I.sort((function(t,r){return t-r})),i.push(I[0]);for(var q=1;q<I.length;q+=2){var G=I[q];isNaN(G)||-1!==i.indexOf(G)||i.push(G)}}return i},Va={analyze:Ya,limits:Ua},Xa=w,Wa=function(t,r){t=new Xa(t),r=new Xa(r);var e=t.luminance(),n=r.luminance();return e>n?(e+.05)/(n+.05):(n+.05)/(e+.05)},Za=w,Ha=Math.sqrt,Ka=Math.pow,Ja=Math.min,Qa=Math.max,ti=Math.atan2,ri=Math.abs,ei=Math.cos,ni=Math.sin,oi=Math.exp,ai=Math.PI,ii=function(t,r,e,n,o){void 0===e&&(e=1),void 0===n&&(n=1),void 0===o&&(o=1);var a=function(t){return 360*t/(2*ai)},i=function(t){return 2*ai*t/360};t=new Za(t),r=new Za(r);var c=Array.from(t.lab()),f=c[0],u=c[1],s=c[2],l=Array.from(r.lab()),h=l[0],d=l[1],b=l[2],p=(f+h)/2,g=(Ha(Ka(u,2)+Ka(s,2))+Ha(Ka(d,2)+Ka(b,2)))/2,m=.5*(1-Ha(Ka(g,7)/(Ka(g,7)+Ka(25,7)))),v=u*(1+m),y=d*(1+m),w=Ha(Ka(v,2)+Ka(s,2)),k=Ha(Ka(y,2)+Ka(b,2)),N=(w+k)/2,x=a(ti(s,v)),M=a(ti(b,y)),S=x>=0?x:x+360,F=M>=0?M:M+360,O=ri(S-F)>180?(S+F+360)/2:(S+F)/2,A=1-.17*ei(i(O-30))+.24*ei(i(2*O))+.32*ei(i(3*O+6))-.2*ei(i(4*O-63)),C=F-S;C=ri(C)<=180?C:F<=S?C+360:C-360,C=2*Ha(w*k)*ni(i(C)/2);var _=h-f,L=k-w,$=1+.015*Ka(p-50,2)/Ha(20+Ka(p-50,2)),j=1+.045*N,E=1+.015*N*A,P=30*oi(-Ka((O-275)/25,2)),D=-2*Ha(Ka(N,7)/(Ka(N,7)+Ka(25,7)))*ni(2*i(P)),R=Ha(Ka(_/(e*$),2)+Ka(L/(n*j),2)+Ka(C/(o*E),2)+D*(L/(n*j))*(C/(o*E)));return Qa(0,Ja(100,R))},ci=w,fi=function(t,r,e){void 0===e&&(e="lab"),t=new ci(t),r=new ci(r);var n=t.get(e),o=r.get(e),a=0;for(var i in n){var c=(n[i]||0)-(o[i]||0);a+=c*c}return Math.sqrt(a)},ui=w,si=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];try{return new(Function.prototype.bind.apply(ui,[null].concat(t))),!0}catch(t){return!1}},li=N,hi=ia,di={cool:function(){return hi([li.hsl(180,1,.9),li.hsl(250,.7,.4)])},hot:function(){return hi(["#000","#f00","#ff0","#fff"]).mode("rgb")}},bi={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"]},pi=0,gi=Object.keys(bi);pi<gi.length;pi+=1){var mi=gi[pi];bi[mi.toLowerCase()]=bi[mi]}var vi=bi,yi=N;yi.average=ra,yi.bezier=ha,yi.blend=Sa,yi.cubehelix=ja,yi.mix=yi.interpolate=ho,yi.random=Ia,yi.scale=ia,yi.analyze=Va.analyze,yi.contrast=Wa,yi.deltaE=ii,yi.distance=fi,yi.limits=Va.limits,yi.valid=si,yi.scales=di,yi.colors=De,yi.brewer=vi;var wi=yi;return wi}()})),n=r((function(r){!function(t){function e(t,r){if(!(t=o(t)))return null;var n,a,i,c=1/0;r||(r=e.DEFAULT_COLORS);for(var f=0;f<r.length;++f)a=r[f].rgb,(n=Math.pow(t.r-a.r,2)+Math.pow(t.g-a.g,2)+Math.pow(t.b-a.b,2))<c&&(c=n,i=r[f]);return i.name?{name:i.name,value:i.source,rgb:i.rgb,distance:Math.sqrt(c)}:i.source}function n(t){return t instanceof Array?t.map((function(t){return a(t)})):Object.keys(t).map((function(r){return a(t[r],r)}))}function o(t){if("object"==typeof t)return t;if(t in e.STANDARD_COLORS)return o(e.STANDARD_COLORS[t]);var r=t.match(/^#?((?:[0-9a-f]{3}){1,2})$/i);if(r)return r=3===(r=r[1]).length?[r.charAt(0)+r.charAt(0),r.charAt(1)+r.charAt(1),r.charAt(2)+r.charAt(2)]:[r.substring(0,2),r.substring(2,4),r.substring(4,6)],{r:parseInt(r[0],16),g:parseInt(r[1],16),b:parseInt(r[2],16)};var n=t.match(/^rgb\(\s*(\d{1,3}%?),\s*(\d{1,3}%?),\s*(\d{1,3}%?)\s*\)$/i);if(n)return{r:i(n[1]),g:i(n[2]),b:i(n[3])};throw Error('"'+t+'" is not a valid color')}function a(t,r){var e,n={};if(r&&(n.name=r),"string"==typeof t)n.source=t,n.rgb=o(t);else if("object"==typeof t){if(t.source)return a(t.source,t.name);n.rgb=t,n.source="#"+c((e=t).r.toString(16))+c(e.g.toString(16))+c(e.b.toString(16))}return n}function i(t){return"%"===t.charAt(t.length-1)?Math.round(255*parseInt(t,10)/100):Number(t)}function c(t){return 1===t.length&&(t="0"+t),t}e.from=function t(r){var o=n(r),a=e,i=function(t){return a(t,o)};return i.from=t,i.or=function(t){var r=o.concat(n(t));return e.from(r)},i},e.STANDARD_COLORS={aqua:"#0ff",black:"#000",blue:"#00f",fuchsia:"#f0f",gray:"#808080",green:"#008000",lime:"#0f0",maroon:"#800000",navy:"#000080",olive:"#808000",orange:"#ffa500",purple:"#800080",red:"#f00",silver:"#c0c0c0",teal:"#008080",white:"#fff",yellow:"#ff0"},e.DEFAULT_COLORS=n(["#f00","#f80","#ff0","#0f0","#00f","#008","#808"]),e.VERSION="0.4.4",r&&r.exports?r.exports=e:t.nearestColor=e}(t)}));class o{xlmns="http://www.w3.org/2000/svg";getColorPiePaths(t,r=256){const e=document.createDocumentFragment(),n=document.createElementNS(this.xlmns,"defs"),o=document.createElementNS(this.xlmns,"mask"),a=document.createElementNS(this.xlmns,"rect"),i=document.createElementNS(this.xlmns,"g"),c=360/t.length,f="_"+Math.random().toString(36).substring(2,11);o.setAttributeNS(null,"id",f),a.setAttributeNS(null,"height","100%"),a.setAttributeNS(null,"width","100%"),a.setAttributeNS(null,"fill","white"),i.setAttributeNS(null,"mask",`url(#${f})`),o.appendChild(a);const u=360/t.length;var s,l;for(let r=(s=u/2,4===(l=t.length)||8===l||12===l?0:3===l||9===l?30:7===l?12:5===l?55:s);r<360;r+=u){const t=document.createElementNS(this.xlmns,"line");t.setAttributeNS(null,"x1","128"),t.setAttributeNS(null,"y1","128"),t.setAttributeNS(null,"x2","0"),t.setAttributeNS(null,"y2","128"),t.setAttributeNS(null,"stroke","black"),t.setAttributeNS(null,"stroke-width","6"),t.setAttributeNS(null,"transform",`rotate(${r} 128 128)`),o.appendChild(t)}let h=0;return t.forEach((t=>{const e=r/2/t.length;return h+=c,t.forEach(((t,n)=>{const o=r/2-n*e,a=document.createElementNS(this.xlmns,"path");a.setAttributeNS(null,"fill",t),a.setAttributeNS(null,"data-color-hex",t),a.setAttributeNS(null,"data-r",`${o}`),a.setAttributeNS(null,"d",((t,r,e,n=256)=>{const o=n/2,a=o;let i=t+r;if(t>i){const r=t;t=i,i=r}return`M ${o+e*Math.cos((90-t)*(Math.PI/180))} ${a+e*Math.sin((90-t)*(Math.PI/180))} A ${e} ${e} 0 ${i-t<=180?"0":"1"} 0 ${o+e*Math.cos((90-i)*(Math.PI/180))} ${a+e*Math.sin((90-i)*(Math.PI/180))} L ${o} ${a} Z`})(h,c,o)),i.appendChild(a)}))})),n.appendChild(o),e.appendChild(n),e.appendChild(i),e}}const a={diverging:!1,bezier:!1,randomOffset:!1,correctLightness:!1,noDuplicates:!0,colorScaleMode:"lch",reverseDirection:!1};class i{interpolate;luminanceShift;monochromatic;complement;split;triadic;tetradic;pentadic;hexadic;analogous;constructor(t){Object.keys(t).forEach((r=>{this[r]=t[r]}))}toArray(){return[...this.interpolate,...this.luminanceShift,...this.monochromatic,...this.complement,...this.split,...this.triadic,...this.tetradic,...this.pentadic,...this.hexadic,...this.analogous].flat()}}const c=(t,r,n,o,a={})=>{const{noDuplicates:i=!0}=a,c=[e(t).hex()];let[f,u,s]=e(t).hsl();isNaN(f)&&(f=0),u=Number((100*u).toFixed()),s=Number((100*s).toFixed());for(let t=r;t<=n;t+=o){const r=Number(((f+t)%360).toFixed());c.push(e(`hsl(${r}, ${u}%, ${s}%)`).hex())}let l=c;return i&&(l=[...new Set(c)]),l},f=(t,r)=>Math.floor(Math.random()*(t-r+1))+r,u=(t,r={})=>{const{numberOfColors:n=8,bezier:o=!1,randomOffset:a=!1,colorScaleMode:i,noDuplicates:c=!0,reverseDirection:u=!1,correctLightness:s=!0}=r;let[l,h,d]=e(t).hsl();isNaN(l)&&(l=0),l=Number(l.toFixed(0)),h=Number((100*h).toFixed(0)),d=Number((100*d).toFixed(0));const b=[];if(b.push(e(`hsl(${l}, ${h}%, ${d<0?0:d}%)`).hex()),a)for(let t=1;t<n;t++)u?(d+=f(0,10),l+=f(-5,5)):(d-=f(0,10),l-=f(-5,5)),l>359&&(l=359),l<0&&(l=0),b.push(e(`hsl(${l}, ${h}%, ${d<0?0:d}%)`).hex());else for(let t=1;t<n;t++)u?(d+=5,l+=5):(d-=5,l-=5),l>359&&(l=359),l<0&&(l=0),b.push(e(`hsl(${l}, ${h}%, ${d<0?0:d}%)`).hex());let p=b.map((t=>e(t).hex()));return c&&(p=[...new Set(p)]),o&&(p=p.length>1?e.bezier(p).scale().mode(i).correctLightness(s).colors(n):e.scale(p).mode(i).correctLightness(s).colors(n)),p},s=(t,r={})=>{if(!t)throw new Error("MoebiusPalettes: missing input `color`");const{diverging:n=!1,numberOfColors:o=7}=r,[a,i,c]=e(t).lab(),f=100*(.95-1/o),u=f/(o-1),s=.5*(100-f),l=((t,r,e)=>{const n=[];for(let o=t;o<r;o+=e)n.push(o);return n})(s,s+o*u,u);let h=0;if(!n){h=9999;for(let t=0;t<o;t++){const r=a-l[t];Math.abs(r)<Math.abs(h)&&(h=r)}}return l.map((t=>e.lab([t+h,i,c]).hex()))},l=(t,r={})=>{const{numberOfColors:n,reverseDirection:o=!1,diverging:a=!1,divergentColor:i}=r;if(a){const r=s(e(t).hex(),{numberOfColors:Math.ceil(n/2)}).concat(i);return o&&r.reverse(),r}return s(t,{numberOfColors:n})};class h{interpolate;luminanceShift;monochromatic;complement;split;triadic;tetradic;pentadic;hexadic;analogous;constructor(t,r){Object.keys(t).forEach((e=>{this[e]=t[e].map((t=>u(t,{...r,numberOfColors:9})))}))}toArray(){return[...this.interpolate,...this.luminanceShift,...this.monochromatic,...this.complement,...this.split,...this.triadic,...this.tetradic,...this.pentadic,...this.hexadic,...this.analogous].flat()}}class d{baseColor;secondaryColor;colors={};defaultOptions={...a,divergentColor:"#f5f5f5"};options;all=[];accents;constructor(t){this.options={...this.defaultOptions,...t},this.baseColor=this.options.baseColor,this.secondaryColor=this.options.secondaryColor,this.colors=new i({interpolate:this.interpolate(this.baseColor.hex,this.secondaryColor.hex,this.options),luminanceShift:this.luminanceShift([this.baseColor.hex],[this.secondaryColor.hex],this.options),monochromatic:this.monochromatic(this.baseColor.hex),complement:this.complement(this.baseColor.hex),split:this.split(this.baseColor.hex),triadic:this.triadic(this.baseColor.hex),tetradic:this.tetradic(this.baseColor.hex),pentadic:this.pentadic(this.baseColor.hex),hexadic:this.hexadic(this.baseColor.hex),analogous:this.analogous(this.baseColor.hex)}),this.accents=new h(this.colors,this.options),this.all=[...new Set([...this.accents.toArray(),...this.colors.toArray()].flat())]}complement(t,r={}){return((t,r={})=>{const{numberOfColors:n=8,colorScaleMode:o,correctLightness:a=!0}=r,i=c(t,180,180,1);return e.scale(i).mode(o).correctLightness(a).colors(n)})(t,{...this.options,...r})}split(t,r={}){return((t,r={})=>{const{numberOfColors:n=8,colorScaleMode:o,correctLightness:a=!0}=r,i=c(t,150,210,60);return e.scale(i).mode(o).correctLightness(a).colors(n)})(t,{...this.options,...r})}triadic(t,r={}){return((t,r={})=>{const{numberOfColors:n=8,colorScaleMode:o,correctLightness:a=!0}=r,i=c(t,120,240,120);return e.scale(i).mode(o).correctLightness(a).colors(n)})(t,{...this.options,...r})}tetradic(t,r={}){return((t,r={})=>{const{numberOfColors:n=8,colorScaleMode:o,correctLightness:a=!0}=r,i=c(t,90,270,90);return e.scale(i).mode(o).correctLightness(a).colors(n)})(t,{...this.options,...r})}pentadic(t,r={}){return((t,r={})=>{const{numberOfColors:n=8,colorScaleMode:o,correctLightness:a=!0}=r,i=c(t,144,360,72);return e.scale(i).mode(o).correctLightness(a).colors(n)})(t,{...this.options,...r})}hexadic(t,r={}){return((t,r={})=>{const{numberOfColors:n=8,colorScaleMode:o,correctLightness:a=!0}=r,i=c(t,120,360,60);return e.scale(i).mode(o).correctLightness(a).colors(n)})(t,{...this.options,...r})}analogous(t,r={}){return((t,r={})=>{const{numberOfColors:n=8,colorScaleMode:o,correctLightness:a=!0}=r,i=c(t,30,90,30);return e.scale(i).mode(o).correctLightness(a).colors(n)})(t,{...this.options,...r})}interpolate(t,r,n={}){return((t,r,n={})=>{const{numberOfColors:o=8,colorScaleMode:a,bezier:i=!1,correctLightness:c=!0}=n;let f=e.scale([t,r]).mode(a).correctLightness(c).colors(o);return i&&(f=e.bezier([t,r]).scale().mode(a).correctLightness(c).colors(o)),f})(t,r,{...this.options,...n})}luminanceShift(t,r=[],n={}){return((t,r=[],n={})=>{const{numberOfColors:o=8,diverging:a=!1,colorScaleMode:i,bezier:f=!1,divergentColor:u="#f5f5f5",correctLightness:s=!0}=n;r=0===r.length?[c(t[0],90,270,90)[3]]:r;const h=o%2==0,d=a?Math.ceil(o/2)+(h?1:0):o,b=a?Math.ceil(o/2)+(h?1:0):0,p=1!==t.length?t:l(t[0],{numberOfColors:d,divergentColor:u});let g=[];a&&(g=1!==r.length?r:l(r[0],{numberOfColors:b,divergentColor:u,reverse:!1,diverging:a}));let m=t.length?e.scale(p).mode(i).correctLightness(s).colors(d):[];f&&(m=t.length?e.bezier(p).scale().mode(i).correctLightness(s).colors(d):[]);let v=a&&r.length?e.scale(g).mode(i).correctLightness(s).colors(b):[];f&&(v=a&&r.length?e.bezier(g).scale().mode(i).correctLightness(s).colors(b):[]);let y=m;return y=(a?m.slice(0,m.length-(d%2!=0?0:1)):m).concat(v.reverse()),y})(t,r,{...this.options,...n})}monochromatic(t,r={}){const e={...this.options,...r};return u(t,e)}harmonize(t,r,e,n,o={}){const a={...this.options,...o};return c(t,r,e,n,a)}}const b=function([t,r,e]){this.h=Number(isNaN(t)?0:t.toFixed(0)),this.s=Number((100*r).toFixed()),this.l=Number((100*e).toFixed())};b.prototype.toString=function(){return`hsl(${Object.keys(this).map(((t,r)=>`${this[t]}${0!==r?"%":""}`)).join(", ")})`};const p=function([t,r,e]){this.h=Number(isNaN(t)?0:t.toFixed(0)),this.s=Number(r.toFixed(2)),this.l=Number(e.toFixed(2))};p.prototype.toString=function(){return Object.keys(this).map((t=>`${this[t]}`)).join(", ")};const g=function({x:t,y:r,z:e}){this.x=t,this.y=r,this.z=e};g.prototype.toString=function(){return Object.keys(this).map((t=>`${this[t]}`)).join(", ")};const m=function({c:t,m:r,y:e,k:n}){this.c=t,this.m=r,this.y=e,this.k=n};m.prototype.toString=function(){return Object.keys(this).map((t=>`${this[t]}`)).join(", ")};const v=function({r:t,g:r,b:e}){this.r=t,this.g=r,this.b=e};v.prototype.toString=function(){return Object.keys(this).map((t=>`${this[t]}`)).join(", ")};const y=function({h:t,w:r,b:e}){this.h=t,this.w=r,this.b=e};y.prototype.toString=function(){return Object.keys(this).map((t=>`${this[t]}`)).join(", ")};const w=function([t,r,e]){this.l=Number(t.toFixed(2)),this.a=Number(r.toFixed(2)),this.b=Number(e.toFixed(2))};w.prototype.toString=function(){return Object.keys(this).map((t=>`${this[t]}`)).join(", ")};const k=function([t,r,e]){this.l=Number(t.toFixed(2)),this.a=Number(r.toFixed(2)),this.b=Number(e.toFixed(2))};k.prototype.toString=function(){return Object.keys(this).map((t=>`${this[t]}`)).join(", ")};const N=function([t,r,e]){this.h=Number(isNaN(t)?0:t.toFixed(2)),this.s=Number(r.toFixed(2)),this.v=Number(e.toFixed(2))};N.prototype.toString=function(){return Object.keys(this).map((t=>`${this[t]}`)).join(", ")};const x=function([t,r,e]){this.l=Number(t.toFixed(2)),this.c=Number(r.toFixed(2)),this.h=Number(isNaN(e)?0:e.toFixed(2))};x.prototype.toString=function(){return Object.keys(this).map((t=>`${this[t]}`)).join(", ")};const M=function([t,r,e]){this.l=Number(t.toFixed(2)),this.c=Number(r.toFixed(2)),this.h=Number(isNaN(e)?0:e.toFixed(2))};M.prototype.toString=function(){return Object.keys(this).map((t=>`${this[t]}`)).join(", ")};const S=function([t,r,e]){this.h=Number(isNaN(t)?0:t.toFixed(2)),this.s=Number(r.toFixed(2)),this.i=Number(e.toFixed(2))};S.prototype.toString=function(){return Object.keys(this).map((t=>`${this[t]}`)).join(", ")};const F=(t,r)=>{if("hsl"===r)return new p(e(t).hsl());const n=e(t).rgb();return new v({r:Number((n[0]/255).toFixed(2)),g:Number((n[1]/255).toFixed(2)),b:Number((n[2]/255).toFixed(2))})},O=t=>(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4),A=t=>t>.008856452?Math.pow(t,1/3):t/.12841855+.137931034;class C{color;name;hex;rgb;hsl;hwb;hsv;lab;xyz;lch;oklch;hsi;oklab;cmyk;rgbFloat;hslFloat;constructor(t,r){this.color=t,this.name=r,this.hex=(t=>e(t).hex())(this.color),this.cmyk=(t=>{let[r,n,o]=e(t).rgb();r/=255,o/=255,n/=255;const a=+(1-Math.max(r,o,n)),i=+((1-o-a)/(1-a)||0),c=+((1-n-a)/(1-a)||0);return new m({c:Number((100*+((1-r-a)/(1-a)||0)).toFixed()),m:Number((100*i).toFixed()),y:Number((100*c).toFixed()),k:Number((100*a).toFixed())})})(this.color),this.xyz=(t=>{let[r,n,o]=e(t).rgb();r=O(r),o=O(o),n=O(n);const a=A((.4124564*r+.3575761*o+.1804375*n)/.95047),i=A((.2126729*r+.7151522*o+.072175*n)/1),c=A((.0193339*r+.119192*o+.9503041*n)/1.08883);return new g({x:Number(a.toFixed(2)),y:Number(i.toFixed(2)),z:Number(c.toFixed(2))})})(this.color),this.hsl=(t=>new b(e(t).hsl()))(this.color),this.hwb=(t=>{let[r,n,o]=e(t).rgb();r/=255,o/=255,n/=255;const a=Math.min(r,o,n),i=Math.max(r,o,n),c=1-i;return i===a?{h:0,w:a,b:c}:new y({h:Number((((r===a?3:o===a?5:1)-(r===a?o-n:o===a?n-r:r-o)/(i-a))/6).toFixed(2)),w:Number(a.toFixed(2)),b:Number(c.toFixed(2))})})(this.color),this.lab=(t=>new w(e(t).lab()))(this.color),this.oklab=(t=>new k(e(t).oklab()))(this.color),this.hsv=(t=>new N(e(t).hsv()))(this.color),this.lch=(t=>new x(e(t).lch()))(this.color),this.oklch=(t=>new M(e(t).oklch()))(this.color),this.hsi=(t=>new S(e(t).hsi()))(this.color),this.rgb=(t=>{const[r,n,o]=e(t).rgb();return`rgb(${r}, ${n}, ${o})`})(this.color),this.rgbFloat=F(this.color),this.hslFloat=F(this.color,"hsl")}toObject(t){return((t,r)=>{if("hsl"===r){const[r,n,o]=e(t).hsl();return{h:Number(isNaN(r)?0:r.toFixed(0)),s:Number((100*n).toFixed()),l:Number((100*o).toFixed())}}const n=e(t).rgb();return{r:n[0],g:n[1],b:n[2]}})(this.color,t)}toFloat(t){return F(this.color,t)}}async function _(){const t=await(async()=>{const t=await fetch("https://color-names.herokuapp.com/v1/"),r=(await t.json()).colors,e={};return r.forEach((t=>{e[t.name]=t.hex})),n.from(e)})();return{MoebiusColor:class extends C{constructor(r){super(e(r).hex(),"string"==typeof t(r)?t(r):t(r).name)}},MoebiusPalettes:d,MoebiusSVGHelper:o}}export{_ as default};
2
2
  //# sourceMappingURL=moebius.js.map