UNPKG

@gradient-js/css

Version:

Gradient-js css generation module

2 lines 43.8 kB
/*! For license information please see css.js.LICENSE.txt */ !function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.GradientJsCss=r():e.GradientJsCss=r()}(window,(function(){return function(e){var r={};function t(n){if(r[n])return r[n].exports;var a=r[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,t),a.l=!0,a.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var a in e)t.d(n,a,function(r){return e[r]}.bind(null,a));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=1)}([function(e,r,t){window,e.exports=function(e){var r={};function t(n){if(r[n])return r[n].exports;var a=r[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,t),a.l=!0,a.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var a in e)t.d(n,a,function(r){return e[r]}.bind(null,a));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=1)}([function(e,r,t){e.exports=function(){"use strict";for(var e=function(e,r,t){return void 0===r&&(r=0),void 0===t&&(t=1),e<r?r:e>t?t:e},r={},t=0,n=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];t<n.length;t+=1){var a=n[t];r["[object "+a+"]"]=a.toLowerCase()}var f=function(e){return r[Object.prototype.toString.call(e)]||"object"},o=Math.PI,u={clip_rgb:function(r){r._clipped=!1,r._unclipped=r.slice(0);for(var t=0;t<=3;t++)t<3?((r[t]<0||r[t]>255)&&(r._clipped=!0),r[t]=e(r[t],0,255)):3===t&&(r[t]=e(r[t],0,1));return r},limit:e,type:f,unpack:function(e,r){return void 0===r&&(r=null),e.length>=3?Array.prototype.slice.call(e):"object"==f(e[0])&&r?r.split("").filter((function(r){return void 0!==e[0][r]})).map((function(r){return e[0][r]})):e[0]},last:function(e){if(e.length<2)return null;var r=e.length-1;return"string"==f(e[r])?e[r].toLowerCase():null},PI:o,TWOPI:2*o,PITHIRD:o/3,DEG2RAD:o/180,RAD2DEG:180/o},i={format:{},autodetect:[]},c=u.last,l=u.clip_rgb,s=u.type,d=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=this;if("object"===s(e[0])&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];var n=c(e),a=!1;if(!n){a=!0,i.sorted||(i.autodetect=i.autodetect.sort((function(e,r){return r.p-e.p})),i.sorted=!0);for(var f=0,o=i.autodetect;f<o.length;f+=1){var u=o[f];if(n=u.test.apply(u,e))break}}if(!i.format[n])throw new Error("unknown format: "+e);var d=i.format[n].apply(null,a?e:e.slice(0,-1));t._rgb=l(d),3===t._rgb.length&&t._rgb.push(1)};d.prototype.toString=function(){return"function"==s(this.hex)?this.hex():"["+this._rgb.join(",")+"]"};var h=d,p=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(p.Color,[null].concat(e)))};p.Color=h,p.version="2.1.0";var b=p,g=u.unpack,v=Math.max,y=u.unpack,m=u.unpack,w=u.type;h.prototype.cmyk=function(){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=g(e,"rgb"),n=t[0],a=t[1],f=t[2],o=1-v(n/=255,v(a/=255,f/=255)),u=o<1?1/(1-o):0,i=(1-n-o)*u,c=(1-a-o)*u,l=(1-f-o)*u;return[i,c,l,o]}(this._rgb)},b.cmyk=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["cmyk"])))},i.format.cmyk=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=(e=y(e,"cmyk"))[0],n=e[1],a=e[2],f=e[3],o=e.length>4?e[4]:1;return 1===f?[0,0,0,o]:[t>=1?0:255*(1-t)*(1-f),n>=1?0:255*(1-n)*(1-f),a>=1?0:255*(1-a)*(1-f),o]},i.autodetect.push({p:2,test:function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e=m(e,"cmyk"),"array"===w(e)&&4===e.length)return"cmyk"}});var k=u.unpack,M=u.last,_=function(e){return Math.round(100*e)/100},x=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=k(e,"hsla"),n=M(e)||"lsa";return t[0]=_(t[0]||0),t[1]=_(100*t[1])+"%",t[2]=_(100*t[2])+"%","hsla"===n||t.length>3&&t[3]<1?(t[3]=t.length>3?t[3]:1,n="hsla"):t.length=3,n+"("+t.join(",")+")"},N=u.unpack,O=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=(e=N(e,"rgba"))[0],n=e[1],a=e[2];t/=255,n/=255,a/=255;var f,o,u=Math.min(t,n,a),i=Math.max(t,n,a),c=(i+u)/2;return i===u?(f=0,o=Number.NaN):f=c<.5?(i-u)/(i+u):(i-u)/(2-i-u),t==i?o=(n-a)/(i-u):n==i?o=2+(a-t)/(i-u):a==i&&(o=4+(t-n)/(i-u)),(o*=60)<0&&(o+=360),e.length>3&&void 0!==e[3]?[o,f,c,e[3]]:[o,f,c]},P=u.unpack,j=u.last,A=Math.round,E=u.unpack,C=Math.round,S=function(){for(var e,r=[],t=arguments.length;t--;)r[t]=arguments[t];var n,a,f,o=(r=E(r,"hsl"))[0],u=r[1],i=r[2];if(0===u)n=a=f=255*i;else{var c=[0,0,0],l=[0,0,0],s=i<.5?i*(1+u):i+u-i*u,d=2*i-s,h=o/360;c[0]=h+1/3,c[1]=h,c[2]=h-1/3;for(var p=0;p<3;p++)c[p]<0&&(c[p]+=1),c[p]>1&&(c[p]-=1),6*c[p]<1?l[p]=d+6*(s-d)*c[p]:2*c[p]<1?l[p]=s:3*c[p]<2?l[p]=d+(s-d)*(2/3-c[p])*6:l[p]=d;n=(e=[C(255*l[0]),C(255*l[1]),C(255*l[2])])[0],a=e[1],f=e[2]}return r.length>3?[n,a,f,r[3]]:[n,a,f,1]},L=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,F=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,G=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,B=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,q=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,R=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,I=Math.round,D=function(e){var r;if(e=e.toLowerCase().trim(),i.format.named)try{return i.format.named(e)}catch(e){}if(r=e.match(L)){for(var t=r.slice(1,4),n=0;n<3;n++)t[n]=+t[n];return t[3]=1,t}if(r=e.match(F)){for(var a=r.slice(1,5),f=0;f<4;f++)a[f]=+a[f];return a}if(r=e.match(G)){for(var o=r.slice(1,4),u=0;u<3;u++)o[u]=I(2.55*o[u]);return o[3]=1,o}if(r=e.match(B)){for(var c=r.slice(1,5),l=0;l<3;l++)c[l]=I(2.55*c[l]);return c[3]=+c[3],c}if(r=e.match(q)){var s=r.slice(1,4);s[1]*=.01,s[2]*=.01;var d=S(s);return d[3]=1,d}if(r=e.match(R)){var h=r.slice(1,4);h[1]*=.01,h[2]*=.01;var p=S(h);return p[3]=+r[4],p}};D.test=function(e){return L.test(e)||F.test(e)||G.test(e)||B.test(e)||q.test(e)||R.test(e)};var z=D,T=u.type;h.prototype.css=function(e){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=P(e,"rgba"),n=j(e)||"rgb";return"hsl"==n.substr(0,3)?x(O(t),n):(t[0]=A(t[0]),t[1]=A(t[1]),t[2]=A(t[2]),("rgba"===n||t.length>3&&t[3]<1)&&(t[3]=t.length>3?t[3]:1,n="rgba"),n+"("+t.slice(0,"rgb"===n?3:4).join(",")+")")}(this._rgb,e)},b.css=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["css"])))},i.format.css=z,i.autodetect.push({p:5,test:function(e){for(var r=[],t=arguments.length-1;t-- >0;)r[t]=arguments[t+1];if(!r.length&&"string"===T(e)&&z.test(e))return"css"}});var K=u.unpack;i.format.gl=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=K(e,"rgba");return t[0]*=255,t[1]*=255,t[2]*=255,t},b.gl=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["gl"])))},h.prototype.gl=function(){var e=this._rgb;return[e[0]/255,e[1]/255,e[2]/255,e[3]]};var $=u.unpack,Y=u.unpack,U=Math.floor,V=u.unpack,W=u.type;h.prototype.hcg=function(){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t,n=$(e,"rgb"),a=n[0],f=n[1],o=n[2],u=Math.min(a,f,o),i=Math.max(a,f,o),c=i-u,l=100*c/255,s=u/(255-c)*100;return 0===c?t=Number.NaN:(a===i&&(t=(f-o)/c),f===i&&(t=2+(o-a)/c),o===i&&(t=4+(a-f)/c),(t*=60)<0&&(t+=360)),[t,l,s]}(this._rgb)},b.hcg=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["hcg"])))},i.format.hcg=function(){for(var e,r,t,n,a,f,o=[],u=arguments.length;u--;)o[u]=arguments[u];var i,c,l,s=(o=Y(o,"hcg"))[0],d=o[1],h=o[2];h*=255;var p=255*d;if(0===d)i=c=l=h;else{360===s&&(s=0),s>360&&(s-=360),s<0&&(s+=360);var b=U(s/=60),g=s-b,v=h*(1-d),y=v+p*(1-g),m=v+p*g,w=v+p;switch(b){case 0:i=(e=[w,m,v])[0],c=e[1],l=e[2];break;case 1:i=(r=[y,w,v])[0],c=r[1],l=r[2];break;case 2:i=(t=[v,w,m])[0],c=t[1],l=t[2];break;case 3:i=(n=[v,y,w])[0],c=n[1],l=n[2];break;case 4:i=(a=[m,v,w])[0],c=a[1],l=a[2];break;case 5:i=(f=[w,v,y])[0],c=f[1],l=f[2]}}return[i,c,l,o.length>3?o[3]:1]},i.autodetect.push({p:1,test:function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e=V(e,"hcg"),"array"===W(e)&&3===e.length)return"hcg"}});var X=u.unpack,H=u.last,J=Math.round,Q=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=X(e,"rgba"),n=t[0],a=t[1],f=t[2],o=t[3],u=H(e)||"auto";void 0===o&&(o=1),"auto"===u&&(u=o<1?"rgba":"rgb");var i=(n=J(n))<<16|(a=J(a))<<8|(f=J(f)),c="000000"+i.toString(16);c=c.substr(c.length-6);var l="0"+J(255*o).toString(16);switch(l=l.substr(l.length-2),u.toLowerCase()){case"rgba":return"#"+c+l;case"argb":return"#"+l+c;default:return"#"+c}},Z=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,ee=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,re=function(e){if(e.match(Z)){4!==e.length&&7!==e.length||(e=e.substr(1)),3===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]);var r=parseInt(e,16);return[r>>16,r>>8&255,255&r,1]}if(e.match(ee)){5!==e.length&&9!==e.length||(e=e.substr(1)),4===e.length&&(e=(e=e.split(""))[0]+e[0]+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);var t=parseInt(e,16);return[t>>24&255,t>>16&255,t>>8&255,Math.round((255&t)/255*100)/100]}throw new Error("unknown hex color: "+e)},te=u.type;h.prototype.hex=function(e){return Q(this._rgb,e)},b.hex=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["hex"])))},i.format.hex=re,i.autodetect.push({p:4,test:function(e){for(var r=[],t=arguments.length-1;t-- >0;)r[t]=arguments[t+1];if(!r.length&&"string"===te(e)&&[3,4,5,6,7,8,9].indexOf(e.length)>=0)return"hex"}});var ne=u.unpack,ae=u.TWOPI,fe=Math.min,oe=Math.sqrt,ue=Math.acos,ie=u.unpack,ce=u.limit,le=u.TWOPI,se=u.PITHIRD,de=Math.cos,he=u.unpack,pe=u.type;h.prototype.hsi=function(){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t,n=ne(e,"rgb"),a=n[0],f=n[1],o=n[2],u=fe(a/=255,f/=255,o/=255),i=(a+f+o)/3,c=i>0?1-u/i:0;return 0===c?t=NaN:(t=(a-f+(a-o))/2,t/=oe((a-f)*(a-f)+(a-o)*(f-o)),t=ue(t),o>f&&(t=ae-t),t/=ae),[360*t,c,i]}(this._rgb)},b.hsi=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["hsi"])))},i.format.hsi=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t,n,a,f=(e=ie(e,"hsi"))[0],o=e[1],u=e[2];return isNaN(f)&&(f=0),isNaN(o)&&(o=0),f>360&&(f-=360),f<0&&(f+=360),(f/=360)<1/3?n=1-((a=(1-o)/3)+(t=(1+o*de(le*f)/de(se-le*f))/3)):f<2/3?a=1-((t=(1-o)/3)+(n=(1+o*de(le*(f-=1/3))/de(se-le*f))/3)):t=1-((n=(1-o)/3)+(a=(1+o*de(le*(f-=2/3))/de(se-le*f))/3)),[255*(t=ce(u*t*3)),255*(n=ce(u*n*3)),255*(a=ce(u*a*3)),e.length>3?e[3]:1]},i.autodetect.push({p:2,test:function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e=he(e,"hsi"),"array"===pe(e)&&3===e.length)return"hsi"}});var be=u.unpack,ge=u.type;h.prototype.hsl=function(){return O(this._rgb)},b.hsl=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["hsl"])))},i.format.hsl=S,i.autodetect.push({p:2,test:function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e=be(e,"hsl"),"array"===ge(e)&&3===e.length)return"hsl"}});var ve=u.unpack,ye=Math.min,me=Math.max,we=u.unpack,ke=Math.floor,Me=u.unpack,_e=u.type;h.prototype.hsv=function(){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t,n,a,f=(e=ve(e,"rgb"))[0],o=e[1],u=e[2],i=ye(f,o,u),c=me(f,o,u),l=c-i;return a=c/255,0===c?(t=Number.NaN,n=0):(n=l/c,f===c&&(t=(o-u)/l),o===c&&(t=2+(u-f)/l),u===c&&(t=4+(f-o)/l),(t*=60)<0&&(t+=360)),[t,n,a]}(this._rgb)},b.hsv=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["hsv"])))},i.format.hsv=function(){for(var e,r,t,n,a,f,o=[],u=arguments.length;u--;)o[u]=arguments[u];var i,c,l,s=(o=we(o,"hsv"))[0],d=o[1],h=o[2];if(h*=255,0===d)i=c=l=h;else{360===s&&(s=0),s>360&&(s-=360),s<0&&(s+=360);var p=ke(s/=60),b=s-p,g=h*(1-d),v=h*(1-d*b),y=h*(1-d*(1-b));switch(p){case 0:i=(e=[h,y,g])[0],c=e[1],l=e[2];break;case 1:i=(r=[v,h,g])[0],c=r[1],l=r[2];break;case 2:i=(t=[g,h,y])[0],c=t[1],l=t[2];break;case 3:i=(n=[g,v,h])[0],c=n[1],l=n[2];break;case 4:i=(a=[y,g,h])[0],c=a[1],l=a[2];break;case 5:i=(f=[h,g,v])[0],c=f[1],l=f[2]}}return[i,c,l,o.length>3?o[3]:1]},i.autodetect.push({p:2,test:function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e=Me(e,"hsv"),"array"===_e(e)&&3===e.length)return"hsv"}});var xe=u.unpack,Ne=Math.pow,Oe=function(e){return(e/=255)<=.04045?e/12.92:Ne((e+.055)/1.055,2.4)},Pe=function(e){return e>.008856452?Ne(e,1/3):e/.12841855+.137931034},je=function(e,r,t){return e=Oe(e),r=Oe(r),t=Oe(t),[Pe((.4124564*e+.3575761*r+.1804375*t)/.95047),Pe((.2126729*e+.7151522*r+.072175*t)/1),Pe((.0193339*e+.119192*r+.9503041*t)/1.08883)]},Ae=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=xe(e,"rgb"),n=t[0],a=t[1],f=t[2],o=je(n,a,f),u=o[0],i=o[1],c=o[2],l=116*i-16;return[l<0?0:l,500*(u-i),200*(i-c)]},Ee=u.unpack,Ce=Math.pow,Se=function(e){return 255*(e<=.00304?12.92*e:1.055*Ce(e,1/2.4)-.055)},Le=function(e){return e>.206896552?e*e*e:.12841855*(e-.137931034)},Fe=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t,n,a,f=(e=Ee(e,"lab"))[0],o=e[1],u=e[2];return n=(f+16)/116,t=isNaN(o)?n:n+o/500,a=isNaN(u)?n:n-u/200,n=1*Le(n),t=.95047*Le(t),a=1.08883*Le(a),[Se(3.2404542*t-1.5371385*n-.4985314*a),Se(-.969266*t+1.8760108*n+.041556*a),Se(.0556434*t-.2040259*n+1.0572252*a),e.length>3?e[3]:1]},Ge=u.unpack,Be=u.type;h.prototype.lab=function(){return Ae(this._rgb)},b.lab=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["lab"])))},i.format.lab=Fe,i.autodetect.push({p:2,test:function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e=Ge(e,"lab"),"array"===Be(e)&&3===e.length)return"lab"}});var qe=u.unpack,Re=u.RAD2DEG,Ie=Math.sqrt,De=Math.atan2,ze=Math.round,Te=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=qe(e,"lab"),n=t[0],a=t[1],f=t[2],o=Ie(a*a+f*f),u=(De(f,a)*Re+360)%360;return 0===ze(1e4*o)&&(u=Number.NaN),[n,o,u]},Ke=u.unpack,$e=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=Ke(e,"rgb"),n=t[0],a=t[1],f=t[2],o=Ae(n,a,f),u=o[0],i=o[1],c=o[2];return Te(u,i,c)},Ye=u.unpack,Ue=u.DEG2RAD,Ve=Math.sin,We=Math.cos,Xe=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=Ye(e,"lch"),n=t[0],a=t[1],f=t[2];return isNaN(f)&&(f=0),[n,We(f*=Ue)*a,Ve(f)*a]},He=u.unpack,Je=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=(e=He(e,"lch"))[0],n=e[1],a=e[2],f=Xe(t,n,a),o=f[0],u=f[1],i=f[2],c=Fe(o,u,i),l=c[0],s=c[1],d=c[2];return[l,s,d,e.length>3?e[3]:1]},Qe=u.unpack,Ze=u.unpack,er=u.type;h.prototype.lch=function(){return $e(this._rgb)},h.prototype.hcl=function(){return $e(this._rgb).reverse()},b.lch=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["lch"])))},b.hcl=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["hcl"])))},i.format.lch=Je,i.format.hcl=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=Qe(e,"hcl").reverse();return Je.apply(void 0,t)},["lch","hcl"].forEach((function(e){return i.autodetect.push({p:2,test:function(){for(var r=[],t=arguments.length;t--;)r[t]=arguments[t];if(r=Ze(r,e),"array"===er(r)&&3===r.length)return e}})}));var rr={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"},tr=u.type;h.prototype.name=function(){for(var e=Q(this._rgb,"rgb"),r=0,t=Object.keys(rr);r<t.length;r+=1){var n=t[r];if(rr[n]===e)return n.toLowerCase()}return e},i.format.named=function(e){if(e=e.toLowerCase(),rr[e])return re(rr[e]);throw new Error("unknown color name: "+e)},i.autodetect.push({p:5,test:function(e){for(var r=[],t=arguments.length-1;t-- >0;)r[t]=arguments[t+1];if(!r.length&&"string"===tr(e)&&rr[e.toLowerCase()])return"named"}});var nr=u.unpack,ar=u.type,fr=u.type;h.prototype.num=function(){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=nr(e,"rgb"),n=t[0],a=t[1],f=t[2];return(n<<16)+(a<<8)+f}(this._rgb)},b.num=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["num"])))},i.format.num=function(e){if("number"==ar(e)&&e>=0&&e<=16777215)return[e>>16,e>>8&255,255&e,1];throw new Error("unknown num color: "+e)},i.autodetect.push({p:5,test:function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];if(1===e.length&&"number"===fr(e[0])&&e[0]>=0&&e[0]<=16777215)return"num"}});var or=u.unpack,ur=u.type,ir=Math.round;h.prototype.rgb=function(e){return void 0===e&&(e=!0),!1===e?this._rgb.slice(0,3):this._rgb.slice(0,3).map(ir)},h.prototype.rgba=function(e){return void 0===e&&(e=!0),this._rgb.slice(0,4).map((function(r,t){return t<3?!1===e?r:ir(r):r}))},b.rgb=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["rgb"])))},i.format.rgb=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];var t=or(e,"rgba");return void 0===t[3]&&(t[3]=1),t},i.autodetect.push({p:3,test:function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];if(e=or(e,"rgba"),"array"===ur(e)&&(3===e.length||4===e.length&&"number"==ur(e[3])&&e[3]>=0&&e[3]<=1))return"rgb"}});var cr=Math.log,lr=function(e){var r,t,n,a=e/100;return a<66?(r=255,t=-155.25485562709179-.44596950469579133*(t=a-2)+104.49216199393888*cr(t),n=a<20?0:.8274096064007395*(n=a-10)-254.76935184120902+115.67994401066147*cr(n)):(r=351.97690566805693+.114206453784165*(r=a-55)-40.25366309332127*cr(r),t=325.4494125711974+.07943456536662342*(t=a-50)-28.0852963507957*cr(t),n=255),[r,t,n,1]},sr=u.unpack,dr=Math.round;h.prototype.temp=h.prototype.kelvin=h.prototype.temperature=function(){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];for(var t,n=sr(e,"rgb"),a=n[0],f=n[2],o=1e3,u=4e4,i=.4;u-o>i;){var c=lr(t=.5*(u+o));c[2]/c[0]>=f/a?u=t:o=t}return dr(t)}(this._rgb)},b.temp=b.kelvin=b.temperature=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return new(Function.prototype.bind.apply(h,[null].concat(e,["temp"])))},i.format.temp=i.format.kelvin=i.format.temperature=lr;var hr=u.type;h.prototype.alpha=function(e,r){return void 0===r&&(r=!1),void 0!==e&&"number"===hr(e)?r?(this._rgb[3]=e,this):new h([this._rgb[0],this._rgb[1],this._rgb[2],e],"rgb"):this._rgb[3]},h.prototype.clipped=function(){return this._rgb._clipped||!1},h.prototype.darken=function(e){void 0===e&&(e=1);var r=this.lab();return r[0]-=18*e,new h(r,"lab").alpha(this.alpha(),!0)},h.prototype.brighten=function(e){return void 0===e&&(e=1),this.darken(-e)},h.prototype.darker=h.prototype.darken,h.prototype.brighter=h.prototype.brighten,h.prototype.get=function(e){var r=e.split("."),t=r[0],n=r[1],a=this[t]();if(n){var f=t.indexOf(n);if(f>-1)return a[f];throw new Error("unknown channel "+n+" in mode "+t)}return a};var pr=u.type,br=Math.pow;h.prototype.luminance=function(e){if(void 0!==e&&"number"===pr(e)){if(0===e)return new h([0,0,0,this._rgb[3]],"rgb");if(1===e)return new h([255,255,255,this._rgb[3]],"rgb");var r=this.luminance(),t=20,n=function(r,a){var f=r.interpolate(a,.5,"rgb"),o=f.luminance();return Math.abs(e-o)<1e-7||!t--?f:o>e?n(r,f):n(f,a)},a=(r>e?n(new h([0,0,0]),this):n(this,new h([255,255,255]))).rgb();return new h(a.concat([this._rgb[3]]))}return gr.apply(void 0,this._rgb.slice(0,3))};var gr=function(e,r,t){return.2126*(e=vr(e))+.7152*(r=vr(r))+.0722*vr(t)},vr=function(e){return(e/=255)<=.03928?e/12.92:br((e+.055)/1.055,2.4)},yr={},mr=u.type,wr=function(e,r,t){void 0===t&&(t=.5);for(var n=[],a=arguments.length-3;a-- >0;)n[a]=arguments[a+3];var f=n[0]||"lrgb";if(yr[f]||n.length||(f=Object.keys(yr)[0]),!yr[f])throw new Error("interpolation mode "+f+" is not defined");return"object"!==mr(e)&&(e=new h(e)),"object"!==mr(r)&&(r=new h(r)),yr[f](e,r,t).alpha(e.alpha()+t*(r.alpha()-e.alpha()))};h.prototype.mix=h.prototype.interpolate=function(e,r){void 0===r&&(r=.5);for(var t=[],n=arguments.length-2;n-- >0;)t[n]=arguments[n+2];return wr.apply(void 0,[this,e,r].concat(t))},h.prototype.premultiply=function(e){void 0===e&&(e=!1);var r=this._rgb,t=r[3];return e?(this._rgb=[r[0]*t,r[1]*t,r[2]*t,t],this):new h([r[0]*t,r[1]*t,r[2]*t,t],"rgb")},h.prototype.saturate=function(e){void 0===e&&(e=1);var r=this.lch();return r[1]+=18*e,r[1]<0&&(r[1]=0),new h(r,"lch").alpha(this.alpha(),!0)},h.prototype.desaturate=function(e){return void 0===e&&(e=1),this.saturate(-e)};var kr=u.type;h.prototype.set=function(e,r,t){void 0===t&&(t=!1);var n=e.split("."),a=n[0],f=n[1],o=this[a]();if(f){var u=a.indexOf(f);if(u>-1){if("string"==kr(r))switch(r.charAt(0)){case"+":case"-":o[u]+=+r;break;case"*":o[u]*=+r.substr(1);break;case"/":o[u]/=+r.substr(1);break;default:o[u]=+r}else{if("number"!==kr(r))throw new Error("unsupported value for Color.set");o[u]=r}var i=new h(o,a);return t?(this._rgb=i._rgb,this):i}throw new Error("unknown channel "+f+" in mode "+a)}return o},yr.rgb=function(e,r,t){var n=e._rgb,a=r._rgb;return new h(n[0]+t*(a[0]-n[0]),n[1]+t*(a[1]-n[1]),n[2]+t*(a[2]-n[2]),"rgb")};var Mr=Math.sqrt,_r=Math.pow;yr.lrgb=function(e,r,t){var n=e._rgb,a=n[0],f=n[1],o=n[2],u=r._rgb,i=u[0],c=u[1],l=u[2];return new h(Mr(_r(a,2)*(1-t)+_r(i,2)*t),Mr(_r(f,2)*(1-t)+_r(c,2)*t),Mr(_r(o,2)*(1-t)+_r(l,2)*t),"rgb")},yr.lab=function(e,r,t){var n=e.lab(),a=r.lab();return new h(n[0]+t*(a[0]-n[0]),n[1]+t*(a[1]-n[1]),n[2]+t*(a[2]-n[2]),"lab")};var xr=function(e,r,t,n){var a,f,o,u,i,c,l,s,d,p,b,g;return"hsl"===n?(o=e.hsl(),u=r.hsl()):"hsv"===n?(o=e.hsv(),u=r.hsv()):"hcg"===n?(o=e.hcg(),u=r.hcg()):"hsi"===n?(o=e.hsi(),u=r.hsi()):"lch"!==n&&"hcl"!==n||(n="hcl",o=e.hcl(),u=r.hcl()),"h"===n.substr(0,1)&&(i=(a=o)[0],l=a[1],d=a[2],c=(f=u)[0],s=f[1],p=f[2]),isNaN(i)||isNaN(c)?isNaN(i)?isNaN(c)?g=Number.NaN:(g=c,1!=d&&0!=d||"hsv"==n||(b=s)):(g=i,1!=p&&0!=p||"hsv"==n||(b=l)):g=i+t*(c>i&&c-i>180?c-(i+360):c<i&&i-c>180?c+360-i:c-i),void 0===b&&(b=l+t*(s-l)),new h([g,b,d+t*(p-d)],n)},Nr=function(e,r,t){return xr(e,r,t,"lch")};yr.lch=Nr,yr.hcl=Nr,yr.num=function(e,r,t){var n=e.num(),a=r.num();return new h(n+t*(a-n),"num")},yr.hcg=function(e,r,t){return xr(e,r,t,"hcg")},yr.hsi=function(e,r,t){return xr(e,r,t,"hsi")},yr.hsl=function(e,r,t){return xr(e,r,t,"hsl")},yr.hsv=function(e,r,t){return xr(e,r,t,"hsv")};var Or=u.clip_rgb,Pr=Math.pow,jr=Math.sqrt,Ar=Math.PI,Er=Math.cos,Cr=Math.sin,Sr=Math.atan2,Lr=u.type,Fr=Math.pow,Gr=function(e){var r="rgb",t=b("#ccc"),n=0,a=[0,1],f=[],o=[0,0],u=!1,i=[],c=!1,l=0,s=1,d=!1,h={},p=!0,g=1,v=function(e){if((e=e||["#fff","#000"])&&"string"===Lr(e)&&b.brewer&&b.brewer[e.toLowerCase()]&&(e=b.brewer[e.toLowerCase()]),"array"===Lr(e)){1===e.length&&(e=[e[0],e[0]]),e=e.slice(0);for(var r=0;r<e.length;r++)e[r]=b(e[r]);f.length=0;for(var t=0;t<e.length;t++)f.push(t/(e.length-1))}return k(),i=e},y=function(e){return e},m=function(e){return e},w=function(e,n){var a,c;if(null==n&&(n=!1),isNaN(e)||null===e)return t;c=n?e:u&&u.length>2?function(e){if(null!=u){for(var r=u.length-1,t=0;t<r&&e>=u[t];)t++;return t-1}return 0}(e)/(u.length-2):s!==l?(e-l)/(s-l):1,c=m(c),n||(c=y(c)),1!==g&&(c=Fr(c,g)),c=o[0]+c*(1-o[0]-o[1]),c=Math.min(1,Math.max(0,c));var d=Math.floor(1e4*c);if(p&&h[d])a=h[d];else{if("array"===Lr(i))for(var v=0;v<f.length;v++){var w=f[v];if(c<=w){a=i[v];break}if(c>=w&&v===f.length-1){a=i[v];break}if(c>w&&c<f[v+1]){c=(c-w)/(f[v+1]-w),a=b.interpolate(i[v],i[v+1],c,r);break}}else"function"===Lr(i)&&(a=i(c));p&&(h[d]=a)}return a},k=function(){return h={}};v(e);var M=function(e){var r=b(w(e));return c&&r[c]?r[c]():r};return M.classes=function(e){if(null!=e){if("array"===Lr(e))u=e,a=[e[0],e[e.length-1]];else{var r=b.analyze(a);u=0===e?[r.min,r.max]:b.limits(r,"e",e)}return M}return u},M.domain=function(e){if(!arguments.length)return a;l=e[0],s=e[e.length-1],f=[];var r=i.length;if(e.length===r&&l!==s)for(var t=0,n=Array.from(e);t<n.length;t+=1){var o=n[t];f.push((o-l)/(s-l))}else{for(var u=0;u<r;u++)f.push(u/(r-1));if(e.length>2){var c=e.map((function(r,t){return t/(e.length-1)})),d=e.map((function(e){return(e-l)/(s-l)}));d.every((function(e,r){return c[r]===e}))||(m=function(e){if(e<=0||e>=1)return e;for(var r=0;e>=d[r+1];)r++;var t=(e-d[r])/(d[r+1]-d[r]);return c[r]+t*(c[r+1]-c[r])})}}return a=[l,s],M},M.mode=function(e){return arguments.length?(r=e,k(),M):r},M.range=function(e,r){return v(e),M},M.out=function(e){return c=e,M},M.spread=function(e){return arguments.length?(n=e,M):n},M.correctLightness=function(e){return null==e&&(e=!0),d=e,k(),y=d?function(e){for(var r=w(0,!0).lab()[0],t=w(1,!0).lab()[0],n=r>t,a=w(e,!0).lab()[0],f=r+(t-r)*e,o=a-f,u=0,i=1,c=20;Math.abs(o)>.01&&c-- >0;)n&&(o*=-1),o<0?(u=e,e+=.5*(i-e)):(i=e,e+=.5*(u-e)),o=(a=w(e,!0).lab()[0])-f;return e}:function(e){return e},M},M.padding=function(e){return null!=e?("number"===Lr(e)&&(e=[e,e]),o=e,M):o},M.colors=function(r,t){arguments.length<2&&(t="hex");var n=[];if(0===arguments.length)n=i.slice(0);else if(1===r)n=[M(.5)];else if(r>1){var f=a[0],o=a[1]-f;n=Br(0,r,!1).map((function(e){return M(f+e/(r-1)*o)}))}else{e=[];var c=[];if(u&&u.length>2)for(var l=1,s=u.length,d=1<=s;d?l<s:l>s;d?l++:l--)c.push(.5*(u[l-1]+u[l]));else c=a;n=c.map((function(e){return M(e)}))}return b[t]&&(n=n.map((function(e){return e[t]()}))),n},M.cache=function(e){return null!=e?(p=e,M):p},M.gamma=function(e){return null!=e?(g=e,M):g},M.nodata=function(e){return null!=e?(t=b(e),M):t},M};function Br(e,r,t){for(var n=[],a=e<r,f=t?a?r+1:r-1:r,o=e;a?o<f:o>f;a?o++:o--)n.push(o);return n}var qr=function(e){var r,t,n,a,f,o,u;if(2===(e=e.map((function(e){return new h(e)}))).length)r=e.map((function(e){return e.lab()})),f=r[0],o=r[1],a=function(e){var r=[0,1,2].map((function(r){return f[r]+e*(o[r]-f[r])}));return new h(r,"lab")};else if(3===e.length)t=e.map((function(e){return e.lab()})),f=t[0],o=t[1],u=t[2],a=function(e){var r=[0,1,2].map((function(r){return(1-e)*(1-e)*f[r]+2*(1-e)*e*o[r]+e*e*u[r]}));return new h(r,"lab")};else if(4===e.length){var i;n=e.map((function(e){return e.lab()})),f=n[0],o=n[1],u=n[2],i=n[3],a=function(e){var r=[0,1,2].map((function(r){return(1-e)*(1-e)*(1-e)*f[r]+3*(1-e)*(1-e)*e*o[r]+3*(1-e)*e*e*u[r]+e*e*e*i[r]}));return new h(r,"lab")}}else if(5===e.length){var c=qr(e.slice(0,3)),l=qr(e.slice(2,5));a=function(e){return e<.5?c(2*e):l(2*(e-.5))}}return a},Rr=function(e,r,t){if(!Rr[t])throw new Error("unknown blend mode "+t);return Rr[t](e,r)},Ir=function(e){return function(r,t){var n=b(t).rgb(),a=b(r).rgb();return b.rgb(e(n,a))}},Dr=function(e){return function(r,t){var n=[];return n[0]=e(r[0],t[0]),n[1]=e(r[1],t[1]),n[2]=e(r[2],t[2]),n}};Rr.normal=Ir(Dr((function(e){return e}))),Rr.multiply=Ir(Dr((function(e,r){return e*r/255}))),Rr.screen=Ir(Dr((function(e,r){return 255*(1-(1-e/255)*(1-r/255))}))),Rr.overlay=Ir(Dr((function(e,r){return r<128?2*e*r/255:255*(1-2*(1-e/255)*(1-r/255))}))),Rr.darken=Ir(Dr((function(e,r){return e>r?r:e}))),Rr.lighten=Ir(Dr((function(e,r){return e>r?e:r}))),Rr.dodge=Ir(Dr((function(e,r){return 255===e||(e=r/255*255/(1-e/255))>255?255:e}))),Rr.burn=Ir(Dr((function(e,r){return 255*(1-(1-r/255)/(e/255))})));for(var zr=Rr,Tr=u.type,Kr=u.clip_rgb,$r=u.TWOPI,Yr=Math.pow,Ur=Math.sin,Vr=Math.cos,Wr=Math.floor,Xr=Math.random,Hr=Math.log,Jr=Math.pow,Qr=Math.floor,Zr=Math.abs,et=function(e,r){void 0===r&&(r=null);var t={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0};return"object"===f(e)&&(e=Object.values(e)),e.forEach((function(e){r&&"object"===f(e)&&(e=e[r]),null==e||isNaN(e)||(t.values.push(e),t.sum+=e,e<t.min&&(t.min=e),e>t.max&&(t.max=e),t.count+=1)})),t.domain=[t.min,t.max],t.limits=function(e,r){return rt(t,e,r)},t},rt=function(e,r,t){void 0===r&&(r="equal"),void 0===t&&(t=7),"array"==f(e)&&(e=et(e));var n=e.min,a=e.max,o=e.values.sort((function(e,r){return e-r}));if(1===t)return[n,a];var u=[];if("c"===r.substr(0,1)&&(u.push(n),u.push(a)),"e"===r.substr(0,1)){u.push(n);for(var i=1;i<t;i++)u.push(n+i/t*(a-n));u.push(a)}else if("l"===r.substr(0,1)){if(n<=0)throw new Error("Logarithmic scales are only possible for values > 0");var c=Math.LOG10E*Hr(n),l=Math.LOG10E*Hr(a);u.push(n);for(var s=1;s<t;s++)u.push(Jr(10,c+s/t*(l-c)));u.push(a)}else if("q"===r.substr(0,1)){u.push(n);for(var d=1;d<t;d++){var h=(o.length-1)*d/t,p=Qr(h);if(p===h)u.push(o[p]);else{var b=h-p;u.push(o[p]*(1-b)+o[p+1]*b)}}u.push(a)}else if("k"===r.substr(0,1)){var g,v=o.length,y=new Array(v),m=new Array(t),w=!0,k=0,M=null;(M=[]).push(n);for(var _=1;_<t;_++)M.push(n+_/t*(a-n));for(M.push(a);w;){for(var x=0;x<t;x++)m[x]=0;for(var N=0;N<v;N++)for(var O=o[N],P=Number.MAX_VALUE,j=void 0,A=0;A<t;A++){var E=Zr(M[A]-O);E<P&&(P=E,j=A),m[j]++,y[N]=j}for(var C=new Array(t),S=0;S<t;S++)C[S]=null;for(var L=0;L<v;L++)null===C[g=y[L]]?C[g]=o[L]:C[g]+=o[L];for(var F=0;F<t;F++)C[F]*=1/m[F];w=!1;for(var G=0;G<t;G++)if(C[G]!==M[G]){w=!0;break}M=C,++k>200&&(w=!1)}for(var B={},q=0;q<t;q++)B[q]=[];for(var R=0;R<v;R++)B[g=y[R]].push(o[R]);for(var I=[],D=0;D<t;D++)I.push(B[D][0]),I.push(B[D][B[D].length-1]);I=I.sort((function(e,r){return e-r})),u.push(I[0]);for(var z=1;z<I.length;z+=2){var T=I[z];isNaN(T)||-1!==u.indexOf(T)||u.push(T)}}return u},tt={analyze:et,limits:rt},nt=Math.sqrt,at=Math.atan2,ft=Math.abs,ot=Math.cos,ut=Math.PI,it={cool:function(){return Gr([b.hsl(180,1,.9),b.hsl(250,.7,.4)])},hot:function(){return Gr(["#000","#f00","#ff0","#fff"]).mode("rgb")}},ct={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"]},lt=0,st=Object.keys(ct);lt<st.length;lt+=1){var dt=st[lt];ct[dt.toLowerCase()]=ct[dt]}var ht=ct;return b.average=function(e,r,t){void 0===r&&(r="lrgb"),void 0===t&&(t=null);var n=e.length;t||(t=Array.from(new Array(n)).map((function(){return 1})));var a=n/t.reduce((function(e,r){return e+r}));if(t.forEach((function(e,r){t[r]*=a})),e=e.map((function(e){return new h(e)})),"lrgb"===r)return function(e,r){for(var t=e.length,n=[0,0,0,0],a=0;a<e.length;a++){var f=e[a],o=r[a]/t,u=f._rgb;n[0]+=Pr(u[0],2)*o,n[1]+=Pr(u[1],2)*o,n[2]+=Pr(u[2],2)*o,n[3]+=u[3]*o}return n[0]=jr(n[0]),n[1]=jr(n[1]),n[2]=jr(n[2]),n[3]>.9999999&&(n[3]=1),new h(Or(n))}(e,t);for(var f=e.shift(),o=f.get(r),u=[],i=0,c=0,l=0;l<o.length;l++)if(o[l]=(o[l]||0)*t[0],u.push(isNaN(o[l])?0:t[0]),"h"===r.charAt(l)&&!isNaN(o[l])){var s=o[l]/180*Ar;i+=Er(s)*t[0],c+=Cr(s)*t[0]}var d=f.alpha()*t[0];e.forEach((function(e,n){var a=e.get(r);d+=e.alpha()*t[n+1];for(var f=0;f<o.length;f++)if(!isNaN(a[f]))if(u[f]+=t[n+1],"h"===r.charAt(f)){var l=a[f]/180*Ar;i+=Er(l)*t[n+1],c+=Cr(l)*t[n+1]}else o[f]+=a[f]*t[n+1]}));for(var p=0;p<o.length;p++)if("h"===r.charAt(p)){for(var b=Sr(c/u[p],i/u[p])/Ar*180;b<0;)b+=360;for(;b>=360;)b-=360;o[p]=b}else o[p]=o[p]/u[p];return d/=n,new h(o,r).alpha(d>.99999?1:d,!0)},b.bezier=function(e){var r=qr(e);return r.scale=function(){return Gr(r)},r},b.blend=zr,b.cubehelix=function(e,r,t,n,a){void 0===e&&(e=300),void 0===r&&(r=-1.5),void 0===t&&(t=1),void 0===n&&(n=1),void 0===a&&(a=[0,1]);var f,o=0;"array"===Tr(a)?f=a[1]-a[0]:(f=0,a=[a,a]);var u=function(u){var i=$r*((e+120)/360+r*u),c=Yr(a[0]+f*u,n),l=(0!==o?t[0]+u*o:t)*c*(1-c)/2,s=Vr(i),d=Ur(i);return b(Kr([255*(c+l*(-.14861*s+1.78277*d)),255*(c+l*(-.29227*s-.90649*d)),255*(c+l*(1.97294*s)),1]))};return u.start=function(r){return null==r?e:(e=r,u)},u.rotations=function(e){return null==e?r:(r=e,u)},u.gamma=function(e){return null==e?n:(n=e,u)},u.hue=function(e){return null==e?t:("array"===Tr(t=e)?0==(o=t[1]-t[0])&&(t=t[1]):o=0,u)},u.lightness=function(e){return null==e?a:("array"===Tr(e)?(a=e,f=e[1]-e[0]):(a=[e,e],f=0),u)},u.scale=function(){return b.scale(u)},u.hue(t),u},b.mix=b.interpolate=wr,b.random=function(){for(var e="#",r=0;r<6;r++)e+="0123456789abcdef".charAt(Wr(16*Xr()));return new h(e,"hex")},b.scale=Gr,b.analyze=tt.analyze,b.contrast=function(e,r){e=new h(e),r=new h(r);var t=e.luminance(),n=r.luminance();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},b.deltaE=function(e,r,t,n){void 0===t&&(t=1),void 0===n&&(n=1),e=new h(e),r=new h(r);for(var a=Array.from(e.lab()),f=a[0],o=a[1],u=a[2],i=Array.from(r.lab()),c=i[0],l=i[1],s=i[2],d=nt(o*o+u*u),p=nt(l*l+s*s),b=f<16?.511:.040975*f/(1+.01765*f),g=.0638*d/(1+.0131*d)+.638,v=d<1e-6?0:180*at(u,o)/ut;v<0;)v+=360;for(;v>=360;)v-=360;var y=v>=164&&v<=345?.56+ft(.2*ot(ut*(v+168)/180)):.36+ft(.4*ot(ut*(v+35)/180)),m=d*d*d*d,w=nt(m/(m+1900)),k=g*(w*y+1-w),M=d-p,_=o-l,x=u-s,N=(f-c)/(t*b),O=M/(n*g);return nt(N*N+O*O+(_*_+x*x-M*M)/(k*k))},b.distance=function(e,r,t){void 0===t&&(t="lab"),e=new h(e),r=new h(r);var n=e.get(t),a=r.get(t),f=0;for(var o in n){var u=(n[o]||0)-(a[o]||0);f+=u*u}return Math.sqrt(f)},b.limits=tt.limits,b.valid=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];try{return new(Function.prototype.bind.apply(h,[null].concat(e))),!0}catch(e){return!1}},b.scales=it,b.colors=rr,b.brewer=ht,b}()},function(e,r,t){"use strict";t.r(r),t.d(r,"Core",(function(){return f}));var n=t(0),a=t.n(n),f=function(){function e(){this.defaultOptions={useBezier:!1,interpolation:"rgb",samples:10,lightnessCorrection:!1}}return e.prototype.get=function(e,r){if(void 0===r&&(r=this.defaultOptions),e.find((function(e){return"string"!=typeof e})))throw new Error("Invalid color types. Only colors passed as the css strings are accepted");var t=this.getLinearScale,n=this.getBezierScale;return(0,this.getBase)((r.useBezier?n:t)(r,e))},e.prototype.getLinearScale=function(e,r){var t=a.a.scale(r);return e.interpolation?{scale:e.lightnessCorrection?t.mode(e.interpolation).correctLightness():t.mode(e.interpolation),options:e}:{scale:e.lightnessCorrection?t.correctLightness():t,options:e}},e.prototype.getBezierScale=function(e,r){var t=a.a.bezier(r).scale();return{scale:e.lightnessCorrection?t.correctLightness():t,options:e}},e.prototype.getBase=function(e){return new Array(e.options.samples).fill("").map((function(r,t){return e.scale(t/e.options.samples)}))},e}()}])},function(e,r,t){"use strict";t.r(r),t.d(r,"Css",(function(){return a}));var n=t(0),a=function(){function e(){this.core=new n.Core}return e.prototype.get=function(e,r){return this.options=r,this.colors=this.core.get(e,r),r.type+"-gradient("+this.angle+this.shape+this.extentKeyword+this.cssifyColors()+")"},e.prototype.cssifyColors=function(){return this.colors.map((function(e){return"rgba("+e.rgba()+")"}))},Object.defineProperty(e.prototype,"angle",{get:function(){var e=this.options;if(e.angle){var r=void 0;switch(e.type){case"linear":r=e.angle+"deg, ";break;case"radial":r="";break;case"conic":r="from "+e.angle+"deg"+(e.conicPosition?" at "+e.conicPosition.x+"% "+e.conicPosition.y+"%":"")+", ";break;default:r=""}return r}return""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var e=this.options,r="";return"radial"===e.type?(!e.shape||"ellipse"===e.shape||e.top||e.left||(r=e.shape+", "),e.shape&&"ellipse"!==e.shape&&e.top&&e.left&&(r=e.shape+" at "+e.left+"% "+e.top+"%, "),e.shape&&"ellipse"===e.shape&&e.top&&e.left&&"none"===e.extentKeyword&&(r=e.shape+" at "+e.left+"% "+e.top+"%, "),e.shape&&"ellipse"===e.shape&&e.top&&e.left&&"none"!==e.extentKeyword&&(r="")):r="",r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"extentKeyword",{get:function(){var e=this.options,r=e.top&&e.left?" at "+e.left+"% "+e.top+"%, ":", ";return"conic"!==e.type?"ellipse"===e.shape&&e.extentKeyword&&"none"!==e.extentKeyword?e.extentKeyword+r:"ellipse"===e.shape&&!e.extentKeyword&&e.top&&e.left?r:"":""},enumerable:!1,configurable:!0}),e}()}])}));