svelte-chroma-picker
Version:
A color picker for Svelte using chroma-js to do the color manipulations
58 lines • 50.9 kB
JavaScript
var SvelteChromaPicker=function(){"use strict";function t(){}function r(t){return t()}function e(){return Object.create(null)}function n(t){t.forEach(r)}function a(t){return"function"==typeof t}function o(t,r){return t!=t?r==r:t!==r||t&&"object"==typeof t||"function"==typeof t}function f(t,r){t.appendChild(r)}function i(t,r,e){t.insertBefore(r,e||null)}function u(t){t.parentNode.removeChild(t)}function c(t){return document.createElement(t)}function l(){return t=" ",document.createTextNode(t);var t}function h(t,r,e,n){return t.addEventListener(r,e,n),()=>t.removeEventListener(r,e,n)}function s(t,r,e){null==e?t.removeAttribute(r):t.getAttribute(r)!==e&&t.setAttribute(r,e)}function d(t,r){(null!=r||t.value)&&(t.value=r)}function b(t,r,e,n){t.style.setProperty(r,e,n?"important":"")}let p;function g(t){p=t}function v(){const t=function(){if(!p)throw new Error("Function called outside component initialization");return p}();return(r,e)=>{const n=t.$$.callbacks[r];if(n){const a=function(t,r){const e=document.createEvent("CustomEvent");return e.initCustomEvent(t,!1,!1,r),e}(r,e);n.slice().forEach(r=>{r.call(t,a)})}}}const m=[],y=[],w=[],k=[],x=Promise.resolve();let M=!1;function _(t){w.push(t)}let $=!1;const N=new Set;function E(){if(!$){$=!0;do{for(let t=0;t<m.length;t+=1){const r=m[t];g(r),A(r.$$)}for(m.length=0;y.length;)y.pop()();for(let t=0;t<w.length;t+=1){const r=w[t];N.has(r)||(N.add(r),r())}w.length=0}while(m.length);for(;k.length;)k.pop()();M=!1,$=!1,N.clear()}}function A(t){if(null!==t.fragment){t.update(),n(t.before_update);const r=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,r),t.after_update.forEach(_)}}const F=new Set;function P(t,r){-1===t.$$.dirty[0]&&(m.push(t),M||(M=!0,x.then(E)),t.$$.dirty.fill(0)),t.$$.dirty[r/31|0]|=1<<r%31}function C(o,f,i,c,l,h,s=[-1]){const d=p;g(o);const b=f.props||{},v=o.$$={fragment:null,ctx:null,props:h,update:t,not_equal:l,bound:e(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(d?d.$$.context:[]),callbacks:e(),dirty:s};let m=!1;if(v.ctx=i?i(o,b,(t,r,...e)=>{const n=e.length?e[0]:r;return v.ctx&&l(v.ctx[t],v.ctx[t]=n)&&(v.bound[t]&&v.bound[t](n),m&&P(o,t)),r}):[],v.update(),m=!0,n(v.before_update),v.fragment=!!c&&c(v.ctx),f.target){if(f.hydrate){const t=function(t){return Array.from(t.childNodes)}(f.target);v.fragment&&v.fragment.l(t),t.forEach(u)}else v.fragment&&v.fragment.c();f.intro&&((y=o.$$.fragment)&&y.i&&(F.delete(y),y.i(w))),function(t,e,o){const{fragment:f,on_mount:i,on_destroy:u,after_update:c}=t.$$;f&&f.m(e,o),_(()=>{const e=i.map(r).filter(a);u?u.push(...e):n(e),t.$$.on_mount=[]}),c.forEach(_)}(o,f.target,f.anchor),E()}var y,w;g(d)}let L;"function"==typeof HTMLElement&&(L=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,r,e){this[t]=e}$destroy(){!function(t,r){const e=t.$$;null!==e.fragment&&(n(e.on_destroy),e.fragment&&e.fragment.d(r),e.on_destroy=e.fragment=null,e.ctx=[])}(this,1),this.$destroy=t}$on(t,r){const e=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return e.push(r),()=>{const t=e.indexOf(r);-1!==t&&e.splice(t,1)}}$set(){}});"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var O=function(t,r){return t(r={exports:{}},r.exports),r.exports}((function(t,r){
/**
* chroma.js - JavaScript library for color conversions
*
* Copyright (c) 2011-2019, Gregor Aisch
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. The name Gregor Aisch may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL GREGOR AISCH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* -------------------------------------------------------
*
* chroma.js includes colors from colorbrewer2.org, which are released under
* the following license:
*
* Copyright (c) 2002 Cynthia Brewer, Mark Harrower,
* and The Pennsylvania State University.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the License.
*
* ------------------------------------------------------
*
* Named colors are taken from X11 Color Names.
* http://www.w3.org/TR/css3-color/#svg-color
*
* @preserve
*/
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={},e=0,n=["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"];e<n.length;e+=1){var a=n[e];r["[object "+a+"]"]=a.toLowerCase()}var o=function(t){return r[Object.prototype.toString.call(t)]||"object"},f=Math.PI,i={clip_rgb:function(r){r._clipped=!1,r._unclipped=r.slice(0);for(var e=0;e<=3;e++)e<3?((r[e]<0||r[e]>255)&&(r._clipped=!0),r[e]=t(r[e],0,255)):3===e&&(r[e]=t(r[e],0,1));return r},limit:t,type:o,unpack:function(t,r){return void 0===r&&(r=null),t.length>=3?Array.prototype.slice.call(t):"object"==o(t[0])&&r?r.split("").filter((function(r){return void 0!==t[0][r]})).map((function(r){return t[0][r]})):t[0]},last:function(t){if(t.length<2)return null;var r=t.length-1;return"string"==o(t[r])?t[r].toLowerCase():null},PI:f,TWOPI:2*f,PITHIRD:f/3,DEG2RAD:f/180,RAD2DEG:180/f},u={format:{},autodetect:[]},c=i.last,l=i.clip_rgb,h=i.type,s=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=this;if("object"===h(t[0])&&t[0].constructor&&t[0].constructor===this.constructor)return t[0];var n=c(t),a=!1;if(!n){a=!0,u.sorted||(u.autodetect=u.autodetect.sort((function(t,r){return r.p-t.p})),u.sorted=!0);for(var o=0,f=u.autodetect;o<f.length;o+=1){var i=f[o];if(n=i.test.apply(i,t))break}}if(!u.format[n])throw new Error("unknown format: "+t);var s=u.format[n].apply(null,a?t:t.slice(0,-1));e._rgb=l(s),3===e._rgb.length&&e._rgb.push(1)};s.prototype.toString=function(){return"function"==h(this.hex)?this.hex():"["+this._rgb.join(",")+"]"};var d=s,b=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(b.Color,[null].concat(t)))};b.Color=d,b.version="2.1.0";var p=b,g=i.unpack,v=Math.max,m=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=g(t,"rgb"),n=e[0],a=e[1],o=e[2],f=1-v(n/=255,v(a/=255,o/=255)),i=f<1?1/(1-f):0,u=(1-n-f)*i,c=(1-a-f)*i,l=(1-o-f)*i;return[u,c,l,f]},y=i.unpack,w=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=(t=y(t,"cmyk"))[0],n=t[1],a=t[2],o=t[3],f=t.length>4?t[4]:1;return 1===o?[0,0,0,f]:[e>=1?0:255*(1-e)*(1-o),n>=1?0:255*(1-n)*(1-o),a>=1?0:255*(1-a)*(1-o),f]},k=i.unpack,x=i.type;d.prototype.cmyk=function(){return m(this._rgb)},p.cmyk=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(d,[null].concat(t,["cmyk"])))},u.format.cmyk=w,u.autodetect.push({p:2,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=k(t,"cmyk"),"array"===x(t)&&4===t.length)return"cmyk"}});var M=i.unpack,_=i.last,$=function(t){return Math.round(100*t)/100},N=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=M(t,"hsla"),n=_(t)||"lsa";return e[0]=$(e[0]||0),e[1]=$(100*e[1])+"%",e[2]=$(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(",")+")"},E=i.unpack,A=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=(t=E(t,"rgba"))[0],n=t[1],a=t[2];e/=255,n/=255,a/=255;var o,f,i=Math.min(e,n,a),u=Math.max(e,n,a),c=(u+i)/2;return u===i?(o=0,f=Number.NaN):o=c<.5?(u-i)/(u+i):(u-i)/(2-u-i),e==u?f=(n-a)/(u-i):n==u?f=2+(a-e)/(u-i):a==u&&(f=4+(e-n)/(u-i)),(f*=60)<0&&(f+=360),t.length>3&&void 0!==t[3]?[f,o,c,t[3]]:[f,o,c]},F=i.unpack,P=i.last,C=Math.round,L=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=F(t,"rgba"),n=P(t)||"rgb";return"hsl"==n.substr(0,3)?N(A(e),n):(e[0]=C(e[0]),e[1]=C(e[1]),e[2]=C(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(",")+")")},O=i.unpack,R=Math.round,j=function(){for(var t,r=[],e=arguments.length;e--;)r[e]=arguments[e];var n,a,o,f=(r=O(r,"hsl"))[0],i=r[1],u=r[2];if(0===i)n=a=o=255*u;else{var c=[0,0,0],l=[0,0,0],h=u<.5?u*(1+i):u+i-u*i,s=2*u-h,d=f/360;c[0]=d+1/3,c[1]=d,c[2]=d-1/3;for(var b=0;b<3;b++)c[b]<0&&(c[b]+=1),c[b]>1&&(c[b]-=1),6*c[b]<1?l[b]=s+6*(h-s)*c[b]:2*c[b]<1?l[b]=h:3*c[b]<2?l[b]=s+(h-s)*(2/3-c[b])*6:l[b]=s;n=(t=[R(255*l[0]),R(255*l[1]),R(255*l[2])])[0],a=t[1],o=t[2]}return r.length>3?[n,a,o,r[3]]:[n,a,o,1]},q=/^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/,G=/^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/,B=/^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,I=/^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,S=/^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/,D=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,T=Math.round,Y=function(t){var r;if(t=t.toLowerCase().trim(),u.format.named)try{return u.format.named(t)}catch(t){}if(r=t.match(q)){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(G)){for(var a=r.slice(1,5),o=0;o<4;o++)a[o]=+a[o];return a}if(r=t.match(B)){for(var f=r.slice(1,4),i=0;i<3;i++)f[i]=T(2.55*f[i]);return f[3]=1,f}if(r=t.match(I)){for(var c=r.slice(1,5),l=0;l<3;l++)c[l]=T(2.55*c[l]);return c[3]=+c[3],c}if(r=t.match(S)){var h=r.slice(1,4);h[1]*=.01,h[2]*=.01;var s=j(h);return s[3]=1,s}if(r=t.match(D)){var d=r.slice(1,4);d[1]*=.01,d[2]*=.01;var b=j(d);return b[3]=+r[4],b}};Y.test=function(t){return q.test(t)||G.test(t)||B.test(t)||I.test(t)||S.test(t)||D.test(t)};var z=Y,H=i.type;d.prototype.css=function(t){return L(this._rgb,t)},p.css=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(d,[null].concat(t,["css"])))},u.format.css=z,u.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"===H(t)&&z.test(t))return"css"}});var X=i.unpack;u.format.gl=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=X(t,"rgba");return e[0]*=255,e[1]*=255,e[2]*=255,e},p.gl=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(d,[null].concat(t,["gl"])))},d.prototype.gl=function(){var t=this._rgb;return[t[0]/255,t[1]/255,t[2]/255,t[3]]};var U=i.unpack,V=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e,n=U(t,"rgb"),a=n[0],o=n[1],f=n[2],i=Math.min(a,o,f),u=Math.max(a,o,f),c=u-i,l=100*c/255,h=i/(255-c)*100;return 0===c?e=Number.NaN:(a===u&&(e=(o-f)/c),o===u&&(e=2+(f-a)/c),f===u&&(e=4+(a-o)/c),(e*=60)<0&&(e+=360)),[e,l,h]},W=i.unpack,J=Math.floor,K=function(){for(var t,r,e,n,a,o,f=[],i=arguments.length;i--;)f[i]=arguments[i];var u,c,l,h=(f=W(f,"hcg"))[0],s=f[1],d=f[2];d*=255;var b=255*s;if(0===s)u=c=l=d;else{360===h&&(h=0),h>360&&(h-=360),h<0&&(h+=360);var p=J(h/=60),g=h-p,v=d*(1-s),m=v+b*(1-g),y=v+b*g,w=v+b;switch(p){case 0:u=(t=[w,y,v])[0],c=t[1],l=t[2];break;case 1:u=(r=[m,w,v])[0],c=r[1],l=r[2];break;case 2:u=(e=[v,w,y])[0],c=e[1],l=e[2];break;case 3:u=(n=[v,m,w])[0],c=n[1],l=n[2];break;case 4:u=(a=[y,v,w])[0],c=a[1],l=a[2];break;case 5:u=(o=[w,v,m])[0],c=o[1],l=o[2]}}return[u,c,l,f.length>3?f[3]:1]},Q=i.unpack,Z=i.type;d.prototype.hcg=function(){return V(this._rgb)},p.hcg=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(d,[null].concat(t,["hcg"])))},u.format.hcg=K,u.autodetect.push({p:1,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=Q(t,"hcg"),"array"===Z(t)&&3===t.length)return"hcg"}});var tt=i.unpack,rt=i.last,et=Math.round,nt=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=tt(t,"rgba"),n=e[0],a=e[1],o=e[2],f=e[3],i=rt(t)||"auto";void 0===f&&(f=1),"auto"===i&&(i=f<1?"rgba":"rgb");var u=(n=et(n))<<16|(a=et(a))<<8|(o=et(o)),c="000000"+u.toString(16);c=c.substr(c.length-6);var l="0"+et(255*f).toString(16);switch(l=l.substr(l.length-2),i.toLowerCase()){case"rgba":return"#"+c+l;case"argb":return"#"+l+c;default:return"#"+c}},at=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,ot=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,ft=function(t){if(t.match(at)){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(ot)){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)},it=i.type;d.prototype.hex=function(t){return nt(this._rgb,t)},p.hex=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(d,[null].concat(t,["hex"])))},u.format.hex=ft,u.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"===it(t)&&[3,4,5,6,7,8,9].indexOf(t.length)>=0)return"hex"}});var ut=i.unpack,ct=i.TWOPI,lt=Math.min,ht=Math.sqrt,st=Math.acos,dt=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e,n=ut(t,"rgb"),a=n[0],o=n[1],f=n[2],i=lt(a/=255,o/=255,f/=255),u=(a+o+f)/3,c=u>0?1-i/u:0;return 0===c?e=NaN:(e=(a-o+(a-f))/2,e/=ht((a-o)*(a-o)+(a-f)*(o-f)),e=st(e),f>o&&(e=ct-e),e/=ct),[360*e,c,u]},bt=i.unpack,pt=i.limit,gt=i.TWOPI,vt=i.PITHIRD,mt=Math.cos,yt=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e,n,a,o=(t=bt(t,"hsi"))[0],f=t[1],i=t[2];return isNaN(o)&&(o=0),isNaN(f)&&(f=0),o>360&&(o-=360),o<0&&(o+=360),(o/=360)<1/3?n=1-((a=(1-f)/3)+(e=(1+f*mt(gt*o)/mt(vt-gt*o))/3)):o<2/3?a=1-((e=(1-f)/3)+(n=(1+f*mt(gt*(o-=1/3))/mt(vt-gt*o))/3)):e=1-((n=(1-f)/3)+(a=(1+f*mt(gt*(o-=2/3))/mt(vt-gt*o))/3)),[255*(e=pt(i*e*3)),255*(n=pt(i*n*3)),255*(a=pt(i*a*3)),t.length>3?t[3]:1]},wt=i.unpack,kt=i.type;d.prototype.hsi=function(){return dt(this._rgb)},p.hsi=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(d,[null].concat(t,["hsi"])))},u.format.hsi=yt,u.autodetect.push({p:2,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=wt(t,"hsi"),"array"===kt(t)&&3===t.length)return"hsi"}});var xt=i.unpack,Mt=i.type;d.prototype.hsl=function(){return A(this._rgb)},p.hsl=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(d,[null].concat(t,["hsl"])))},u.format.hsl=j,u.autodetect.push({p:2,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=xt(t,"hsl"),"array"===Mt(t)&&3===t.length)return"hsl"}});var _t=i.unpack,$t=Math.min,Nt=Math.max,Et=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e,n,a,o=(t=_t(t,"rgb"))[0],f=t[1],i=t[2],u=$t(o,f,i),c=Nt(o,f,i),l=c-u;return a=c/255,0===c?(e=Number.NaN,n=0):(n=l/c,o===c&&(e=(f-i)/l),f===c&&(e=2+(i-o)/l),i===c&&(e=4+(o-f)/l),(e*=60)<0&&(e+=360)),[e,n,a]},At=i.unpack,Ft=Math.floor,Pt=function(){for(var t,r,e,n,a,o,f=[],i=arguments.length;i--;)f[i]=arguments[i];var u,c,l,h=(f=At(f,"hsv"))[0],s=f[1],d=f[2];if(d*=255,0===s)u=c=l=d;else{360===h&&(h=0),h>360&&(h-=360),h<0&&(h+=360);var b=Ft(h/=60),p=h-b,g=d*(1-s),v=d*(1-s*p),m=d*(1-s*(1-p));switch(b){case 0:u=(t=[d,m,g])[0],c=t[1],l=t[2];break;case 1:u=(r=[v,d,g])[0],c=r[1],l=r[2];break;case 2:u=(e=[g,d,m])[0],c=e[1],l=e[2];break;case 3:u=(n=[g,v,d])[0],c=n[1],l=n[2];break;case 4:u=(a=[m,g,d])[0],c=a[1],l=a[2];break;case 5:u=(o=[d,g,v])[0],c=o[1],l=o[2]}}return[u,c,l,f.length>3?f[3]:1]},Ct=i.unpack,Lt=i.type;d.prototype.hsv=function(){return Et(this._rgb)},p.hsv=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(d,[null].concat(t,["hsv"])))},u.format.hsv=Pt,u.autodetect.push({p:2,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=Ct(t,"hsv"),"array"===Lt(t)&&3===t.length)return"hsv"}});var Ot=18,Rt=.95047,jt=1,qt=1.08883,Gt=.137931034,Bt=.206896552,It=.12841855,St=.008856452,Dt=i.unpack,Tt=Math.pow,Yt=function(t){return(t/=255)<=.04045?t/12.92:Tt((t+.055)/1.055,2.4)},zt=function(t){return t>St?Tt(t,1/3):t/It+Gt},Ht=function(t,r,e){return t=Yt(t),r=Yt(r),e=Yt(e),[zt((.4124564*t+.3575761*r+.1804375*e)/Rt),zt((.2126729*t+.7151522*r+.072175*e)/jt),zt((.0193339*t+.119192*r+.9503041*e)/qt)]},Xt=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=Dt(t,"rgb"),n=e[0],a=e[1],o=e[2],f=Ht(n,a,o),i=f[0],u=f[1],c=f[2],l=116*u-16;return[l<0?0:l,500*(i-u),200*(u-c)]},Ut=i.unpack,Vt=Math.pow,Wt=function(t){return 255*(t<=.00304?12.92*t:1.055*Vt(t,1/2.4)-.055)},Jt=function(t){return t>Bt?t*t*t:It*(t-Gt)},Kt=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e,n,a,o=(t=Ut(t,"lab"))[0],f=t[1],i=t[2];return n=(o+16)/116,e=isNaN(f)?n:n+f/500,a=isNaN(i)?n:n-i/200,n=jt*Jt(n),e=Rt*Jt(e),a=qt*Jt(a),[Wt(3.2404542*e-1.5371385*n-.4985314*a),Wt(-.969266*e+1.8760108*n+.041556*a),Wt(.0556434*e-.2040259*n+1.0572252*a),t.length>3?t[3]:1]},Qt=i.unpack,Zt=i.type;d.prototype.lab=function(){return Xt(this._rgb)},p.lab=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(d,[null].concat(t,["lab"])))},u.format.lab=Kt,u.autodetect.push({p:2,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=Qt(t,"lab"),"array"===Zt(t)&&3===t.length)return"lab"}});var tr=i.unpack,rr=i.RAD2DEG,er=Math.sqrt,nr=Math.atan2,ar=Math.round,or=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=tr(t,"lab"),n=e[0],a=e[1],o=e[2],f=er(a*a+o*o),i=(nr(o,a)*rr+360)%360;return 0===ar(1e4*f)&&(i=Number.NaN),[n,f,i]},fr=i.unpack,ir=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=fr(t,"rgb"),n=e[0],a=e[1],o=e[2],f=Xt(n,a,o),i=f[0],u=f[1],c=f[2];return or(i,u,c)},ur=i.unpack,cr=i.DEG2RAD,lr=Math.sin,hr=Math.cos,sr=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=ur(t,"lch"),n=e[0],a=e[1],o=e[2];return isNaN(o)&&(o=0),[n,hr(o*=cr)*a,lr(o)*a]},dr=i.unpack,br=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=(t=dr(t,"lch"))[0],n=t[1],a=t[2],o=sr(e,n,a),f=o[0],i=o[1],u=o[2],c=Kt(f,i,u),l=c[0],h=c[1],s=c[2];return[l,h,s,t.length>3?t[3]:1]},pr=i.unpack,gr=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=pr(t,"hcl").reverse();return br.apply(void 0,e)},vr=i.unpack,mr=i.type;d.prototype.lch=function(){return ir(this._rgb)},d.prototype.hcl=function(){return ir(this._rgb).reverse()},p.lch=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(d,[null].concat(t,["lch"])))},p.hcl=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(d,[null].concat(t,["hcl"])))},u.format.lch=br,u.format.hcl=gr,["lch","hcl"].forEach((function(t){return u.autodetect.push({p:2,test:function(){for(var r=[],e=arguments.length;e--;)r[e]=arguments[e];if(r=vr(r,t),"array"===mr(r)&&3===r.length)return t}})}));var yr={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"},wr=i.type;d.prototype.name=function(){for(var t=nt(this._rgb,"rgb"),r=0,e=Object.keys(yr);r<e.length;r+=1){var n=e[r];if(yr[n]===t)return n.toLowerCase()}return t},u.format.named=function(t){if(t=t.toLowerCase(),yr[t])return ft(yr[t]);throw new Error("unknown color name: "+t)},u.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"===wr(t)&&yr[t.toLowerCase()])return"named"}});var kr=i.unpack,xr=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=kr(t,"rgb"),n=e[0],a=e[1],o=e[2];return(n<<16)+(a<<8)+o},Mr=i.type,_r=function(t){if("number"==Mr(t)&&t>=0&&t<=16777215)return[t>>16,t>>8&255,255&t,1];throw new Error("unknown num color: "+t)},$r=i.type;d.prototype.num=function(){return xr(this._rgb)},p.num=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(d,[null].concat(t,["num"])))},u.format.num=_r,u.autodetect.push({p:5,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(1===t.length&&"number"===$r(t[0])&&t[0]>=0&&t[0]<=16777215)return"num"}});var Nr=i.unpack,Er=i.type,Ar=Math.round;d.prototype.rgb=function(t){return void 0===t&&(t=!0),!1===t?this._rgb.slice(0,3):this._rgb.slice(0,3).map(Ar)},d.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:Ar(r):r}))},p.rgb=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(d,[null].concat(t,["rgb"])))},u.format.rgb=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];var e=Nr(t,"rgba");return void 0===e[3]&&(e[3]=1),e},u.autodetect.push({p:3,test:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];if(t=Nr(t,"rgba"),"array"===Er(t)&&(3===t.length||4===t.length&&"number"==Er(t[3])&&t[3]>=0&&t[3]<=1))return"rgb"}});var Fr=Math.log,Pr=function(t){var r,e,n,a=t/100;return a<66?(r=255,e=-155.25485562709179-.44596950469579133*(e=a-2)+104.49216199393888*Fr(e),n=a<20?0:.8274096064007395*(n=a-10)-254.76935184120902+115.67994401066147*Fr(n)):(r=351.97690566805693+.114206453784165*(r=a-55)-40.25366309332127*Fr(r),e=325.4494125711974+.07943456536662342*(e=a-50)-28.0852963507957*Fr(e),n=255),[r,e,n,1]},Cr=i.unpack,Lr=Math.round,Or=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];for(var e,n=Cr(t,"rgb"),a=n[0],o=n[2],f=1e3,i=4e4,u=.4;i-f>u;){var c=Pr(e=.5*(i+f));c[2]/c[0]>=o/a?i=e:f=e}return Lr(e)};d.prototype.temp=d.prototype.kelvin=d.prototype.temperature=function(){return Or(this._rgb)},p.temp=p.kelvin=p.temperature=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return new(Function.prototype.bind.apply(d,[null].concat(t,["temp"])))},u.format.temp=u.format.kelvin=u.format.temperature=Pr;var Rr=i.type;d.prototype.alpha=function(t,r){return void 0===r&&(r=!1),void 0!==t&&"number"===Rr(t)?r?(this._rgb[3]=t,this):new d([this._rgb[0],this._rgb[1],this._rgb[2],t],"rgb"):this._rgb[3]},d.prototype.clipped=function(){return this._rgb._clipped||!1},d.prototype.darken=function(t){void 0===t&&(t=1);var r=this.lab();return r[0]-=Ot*t,new d(r,"lab").alpha(this.alpha(),!0)},d.prototype.brighten=function(t){return void 0===t&&(t=1),this.darken(-t)},d.prototype.darker=d.prototype.darken,d.prototype.brighter=d.prototype.brighten,d.prototype.get=function(t){var r=t.split("."),e=r[0],n=r[1],a=this[e]();if(n){var o=e.indexOf(n);if(o>-1)return a[o];throw new Error("unknown channel "+n+" in mode "+e)}return a};var jr=i.type,qr=Math.pow;d.prototype.luminance=function(t){if(void 0!==t&&"number"===jr(t)){if(0===t)return new d([0,0,0,this._rgb[3]],"rgb");if(1===t)return new d([255,255,255,this._rgb[3]],"rgb");var r=this.luminance(),e=20,n=function(r,a){var o=r.interpolate(a,.5,"rgb"),f=o.luminance();return Math.abs(t-f)<1e-7||!e--?o:f>t?n(r,o):n(o,a)},a=(r>t?n(new d([0,0,0]),this):n(this,new d([255,255,255]))).rgb();return new d(a.concat([this._rgb[3]]))}return Gr.apply(void 0,this._rgb.slice(0,3))};var Gr=function(t,r,e){return.2126*(t=Br(t))+.7152*(r=Br(r))+.0722*(e=Br(e))},Br=function(t){return(t/=255)<=.03928?t/12.92:qr((t+.055)/1.055,2.4)},Ir={},Sr=i.type,Dr=function(t,r,e){void 0===e&&(e=.5);for(var n=[],a=arguments.length-3;a-- >0;)n[a]=arguments[a+3];var o=n[0]||"lrgb";if(Ir[o]||n.length||(o=Object.keys(Ir)[0]),!Ir[o])throw new Error("interpolation mode "+o+" is not defined");return"object"!==Sr(t)&&(t=new d(t)),"object"!==Sr(r)&&(r=new d(r)),Ir[o](t,r,e).alpha(t.alpha()+e*(r.alpha()-t.alpha()))};d.prototype.mix=d.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 Dr.apply(void 0,[this,t,r].concat(e))},d.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 d([r[0]*e,r[1]*e,r[2]*e,e],"rgb")},d.prototype.saturate=function(t){void 0===t&&(t=1);var r=this.lch();return r[1]+=Ot*t,r[1]<0&&(r[1]=0),new d(r,"lch").alpha(this.alpha(),!0)},d.prototype.desaturate=function(t){return void 0===t&&(t=1),this.saturate(-t)};var Tr=i.type;d.prototype.set=function(t,r,e){void 0===e&&(e=!1);var n=t.split("."),a=n[0],o=n[1],f=this[a]();if(o){var i=a.indexOf(o);if(i>-1){if("string"==Tr(r))switch(r.charAt(0)){case"+":case"-":f[i]+=+r;break;case"*":f[i]*=+r.substr(1);break;case"/":f[i]/=+r.substr(1);break;default:f[i]=+r}else{if("number"!==Tr(r))throw new Error("unsupported value for Color.set");f[i]=r}var u=new d(f,a);return e?(this._rgb=u._rgb,this):u}throw new Error("unknown channel "+o+" in mode "+a)}return f},Ir.rgb=function(t,r,e){var n=t._rgb,a=r._rgb;return new d(n[0]+e*(a[0]-n[0]),n[1]+e*(a[1]-n[1]),n[2]+e*(a[2]-n[2]),"rgb")};var Yr=Math.sqrt,zr=Math.pow;Ir.lrgb=function(t,r,e){var n=t._rgb,a=n[0],o=n[1],f=n[2],i=r._rgb,u=i[0],c=i[1],l=i[2];return new d(Yr(zr(a,2)*(1-e)+zr(u,2)*e),Yr(zr(o,2)*(1-e)+zr(c,2)*e),Yr(zr(f,2)*(1-e)+zr(l,2)*e),"rgb")},Ir.lab=function(t,r,e){var n=t.lab(),a=r.lab();return new d(n[0]+e*(a[0]-n[0]),n[1]+e*(a[1]-n[1]),n[2]+e*(a[2]-n[2]),"lab")};var Hr=function(t,r,e,n){var a,o,f,i,u,c,l,h,s,b,p,g;return"hsl"===n?(f=t.hsl(),i=r.hsl()):"hsv"===n?(f=t.hsv(),i=r.hsv()):"hcg"===n?(f=t.hcg(),i=r.hcg()):"hsi"===n?(f=t.hsi(),i=r.hsi()):"lch"!==n&&"hcl"!==n||(n="hcl",f=t.hcl(),i=r.hcl()),"h"===n.substr(0,1)&&(u=(a=f)[0],l=a[1],s=a[2],c=(o=i)[0],h=o[1],b=o[2]),isNaN(u)||isNaN(c)?isNaN(u)?isNaN(c)?g=Number.NaN:(g=c,1!=s&&0!=s||"hsv"==n||(p=h)):(g=u,1!=b&&0!=b||"hsv"==n||(p=l)):g=u+e*(c>u&&c-u>180?c-(u+360):c<u&&u-c>180?c+360-u:c-u),void 0===p&&(p=l+e*(h-l)),new d([g,p,s+e*(b-s)],n)},Xr=function(t,r,e){return Hr(t,r,e,"lch")};Ir.lch=Xr,Ir.hcl=Xr,Ir.num=function(t,r,e){var n=t.num(),a=r.num();return new d(n+e*(a-n),"num")},Ir.hcg=function(t,r,e){return Hr(t,r,e,"hcg")},Ir.hsi=function(t,r,e){return Hr(t,r,e,"hsi")},Ir.hsl=function(t,r,e){return Hr(t,r,e,"hsl")},Ir.hsv=function(t,r,e){return Hr(t,r,e,"hsv")};var Ur=i.clip_rgb,Vr=Math.pow,Wr=Math.sqrt,Jr=Math.PI,Kr=Math.cos,Qr=Math.sin,Zr=Math.atan2,te=function(t,r){for(var e=t.length,n=[0,0,0,0],a=0;a<t.length;a++){var o=t[a],f=r[a]/e,i=o._rgb;n[0]+=Vr(i[0],2)*f,n[1]+=Vr(i[1],2)*f,n[2]+=Vr(i[2],2)*f,n[3]+=i[3]*f}return n[0]=Wr(n[0]),n[1]=Wr(n[1]),n[2]=Wr(n[2]),n[3]>.9999999&&(n[3]=1),new d(Ur(n))},re=i.type,ee=Math.pow,ne=function(t){var r="rgb",e=p("#ccc"),n=0,a=[0,1],o=[],f=[0,0],i=!1,u=[],c=!1,l=0,h=1,s=!1,d={},b=!0,g=1,v=function(t){if((t=t||["#fff","#000"])&&"string"===re(t)&&p.brewer&&p.brewer[t.toLowerCase()]&&(t=p.brewer[t.toLowerCase()]),"array"===re(t)){1===t.length&&(t=[t[0],t[0]]),t=t.slice(0);for(var r=0;r<t.length;r++)t[r]=p(t[r]);o.length=0;for(var e=0;e<t.length;e++)o.push(e/(t.length-1))}return k(),u=t},m=function(t){return t},y=function(t){return t},w=function(t,n){var a,c;if(null==n&&(n=!1),isNaN(t)||null===t)return e;c=n?t:i&&i.length>2?function(t){if(null!=i){for(var r=i.length-1,e=0;e<r&&t>=i[e];)e++;return e-1}return 0}(t)/(i.length-2):h!==l?(t-l)/(h-l):1,c=y(c),n||(c=m(c)),1!==g&&(c=ee(c,g)),c=f[0]+c*(1-f[0]-f[1]),c=Math.min(1,Math.max(0,c));var s=Math.floor(1e4*c);if(b&&d[s])a=d[s];else{if("array"===re(u))for(var v=0;v<o.length;v++){var w=o[v];if(c<=w){a=u[v];break}if(c>=w&&v===o.length-1){a=u[v];break}if(c>w&&c<o[v+1]){c=(c-w)/(o[v+1]-w),a=p.interpolate(u[v],u[v+1],c,r);break}}else"function"===re(u)&&(a=u(c));b&&(d[s]=a)}return a},k=function(){return d={}};v(t);var x=function(t){var r=p(w(t));return c&&r[c]?r[c]():r};return x.classes=function(t){if(null!=t){if("array"===re(t))i=t,a=[t[0],t[t.length-1]];else{var r=p.analyze(a);i=0===t?[r.min,r.max]:p.limits(r,"e",t)}return x}return i},x.domain=function(t){if(!arguments.length)return a;l=t[0],h=t[t.length-1],o=[];var r=u.length;if(t.length===r&&l!==h)for(var e=0,n=Array.from(t);e<n.length;e+=1){var f=n[e];o.push((f-l)/(h-l))}else{for(var i=0;i<r;i++)o.push(i/(r-1));if(t.length>2){var c=t.map((function(r,e){return e/(t.length-1)})),s=t.map((function(t){return(t-l)/(h-l)}));s.every((function(t,r){return c[r]===t}))||(y=function(t){if(t<=0||t>=1)return t;for(var r=0;t>=s[r+1];)r++;var e=(t-s[r])/(s[r+1]-s[r]);return c[r]+e*(c[r+1]-c[r])})}}return a=[l,h],x},x.mode=function(t){return arguments.length?(r=t,k(),x):r},x.range=function(t,r){return v(t),x},x.out=function(t){return c=t,x},x.spread=function(t){return arguments.length?(n=t,x):n},x.correctLightness=function(t){return null==t&&(t=!0),s=t,k(),m=s?function(t){for(var r=w(0,!0).lab()[0],e=w(1,!0).lab()[0],n=r>e,a=w(t,!0).lab()[0],o=r+(e-r)*t,f=a-o,i=0,u=1,c=20;Math.abs(f)>.01&&c-- >0;)n&&(f*=-1),f<0?(i=t,t+=.5*(u-t)):(u=t,t+=.5*(i-t)),a=w(t,!0).lab()[0],f=a-o;return t}:function(t){return t},x},x.padding=function(t){return null!=t?("number"===re(t)&&(t=[t,t]),f=t,x):f},x.colors=function(r,e){arguments.length<2&&(e="hex");var n=[];if(0===arguments.length)n=u.slice(0);else if(1===r)n=[x(.5)];else if(r>1){var o=a[0],f=a[1]-o;n=ae(0,r,!1).map((function(t){return x(o+t/(r-1)*f)}))}else{t=[];var c=[];if(i&&i.length>2)for(var l=1,h=i.length,s=1<=h;s?l<h:l>h;s?l++:l--)c.push(.5*(i[l-1]+i[l]));else c=a;n=c.map((function(t){return x(t)}))}return p[e]&&(n=n.map((function(t){return t[e]()}))),n},x.cache=function(t){return null!=t?(b=t,x):b},x.gamma=function(t){return null!=t?(g=t,x):g},x.nodata=function(t){return null!=t?(e=p(t),x):e},x};function ae(t,r,e){for(var n=[],a=t<r,o=e?a?r+1:r-1:r,f=t;a?f<o:f>o;a?f++:f--)n.push(f);return n}var oe=function(t){var r,e,n,a,o,f,i;if(2===(t=t.map((function(t){return new d(t)}))).length)r=t.map((function(t){return t.lab()})),o=r[0],f=r[1],a=function(t){var r=[0,1,2].map((function(r){return o[r]+t*(f[r]-o[r])}));return new d(r,"lab")};else if(3===t.length)e=t.map((function(t){return t.lab()})),o=e[0],f=e[1],i=e[2],a=function(t){var r=[0,1,2].map((function(r){return(1-t)*(1-t)*o[r]+2*(1-t)*t*f[r]+t*t*i[r]}));return new d(r,"lab")};else if(4===t.length){var u;n=t.map((function(t){return t.lab()})),o=n[0],f=n[1],i=n[2],u=n[3],a=function(t){var r=[0,1,2].map((function(r){return(1-t)*(1-t)*(1-t)*o[r]+3*(1-t)*(1-t)*t*f[r]+3*(1-t)*t*t*i[r]+t*t*t*u[r]}));return new d(r,"lab")}}else if(5===t.length){var c=oe(t.slice(0,3)),l=oe(t.slice(2,5));a=function(t){return t<.5?c(2*t):l(2*(t-.5))}}return a},fe=function(t,r,e){if(!fe[e])throw new Error("unknown blend mode "+e);return fe[e](t,r)},ie=function(t){return function(r,e){var n=p(e).rgb(),a=p(r).rgb();return p.rgb(t(n,a))}},ue=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}};fe.normal=ie(ue((function(t){return t}))),fe.multiply=ie(ue((function(t,r){return t*r/255}))),fe.screen=ie(ue((function(t,r){return 255*(1-(1-t/255)*(1-r/255))}))),fe.overlay=ie(ue((function(t,r){return r<128?2*t*r/255:255*(1-2*(1-t/255)*(1-r/255))}))),fe.darken=ie(ue((function(t,r){return t>r?r:t}))),fe.lighten=ie(ue((function(t,r){return t>r?t:r}))),fe.dodge=ie(ue((function(t,r){return 255===t||(t=r/255*255/(1-t/255))>255?255:t}))),fe.burn=ie(ue((function(t,r){return 255*(1-(1-r/255)/(t/255))})));for(var ce=fe,le=i.type,he=i.clip_rgb,se=i.TWOPI,de=Math.pow,be=Math.sin,pe=Math.cos,ge=Math.floor,ve=Math.random,me=Math.log,ye=Math.pow,we=Math.floor,ke=Math.abs,xe=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"===o(t)&&(t=Object.values(t)),t.forEach((function(t){r&&"object"===o(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 Me(e,t,r)},e},Me=function(t,r,e){void 0===r&&(r="equal"),void 0===e&&(e=7),"array"==o(t)&&(t=xe(t));var n=t.min,a=t.max,f=t.values.sort((function(t,r){return t-r}));if(1===e)return[n,a];var i=[];if("c"===r.substr(0,1)&&(i.push(n),i.push(a)),"e"===r.substr(0,1)){i.push(n);for(var u=1;u<e;u++)i.push(n+u/e*(a-n));i.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*me(n),l=Math.LOG10E*me(a);i.push(n);for(var h=1;h<e;h++)i.push(ye(10,c+h/e*(l-c)));i.push(a)}else if("q"===r.substr(0,1)){i.push(n);for(var s=1;s<e;s++){var d=(f.length-1)*s/e,b=we(d);if(b===d)i.push(f[b]);else{var p=d-b;i.push(f[b]*(1-p)+f[b+1]*p)}}i.push(a)}else if("k"===r.substr(0,1)){var g,v=f.length,m=new Array(v),y=new Array(e),w=!0,k=0,x=null;(x=[]).push(n);for(var M=1;M<e;M++)x.push(n+M/e*(a-n));for(x.push(a);w;){for(var _=0;_<e;_++)y[_]=0;for(var $=0;$<v;$++)for(var N=f[$],E=Number.MAX_VALUE,A=void 0,F=0;F<e;F++){var P=ke(x[F]-N);P<E&&(E=P,A=F),y[A]++,m[$]=A}for(var C=new Array(e),L=0;L<e;L++)C[L]=null;for(var O=0;O<v;O++)null===C[g=m[O]]?C[g]=f[O]:C[g]+=f[O];for(var R=0;R<e;R++)C[R]*=1/y[R];w=!1;for(var j=0;j<e;j++)if(C[j]!==x[j]){w=!0;break}x=C,++k>200&&(w=!1)}for(var q={},G=0;G<e;G++)q[G]=[];for(var B=0;B<v;B++)q[g=m[B]].push(f[B]);for(var I=[],S=0;S<e;S++)I.push(q[S][0]),I.push(q[S][q[S].length-1]);I=I.sort((function(t,r){return t-r})),i.push(I[0]);for(var D=1;D<I.length;D+=2){var T=I[D];isNaN(T)||-1!==i.indexOf(T)||i.push(T)}}return i},_e={analyze:xe,limits:Me},$e=Math.sqrt,Ne=Math.atan2,Ee=Math.abs,Ae=Math.cos,Fe=Math.PI,Pe={cool:function(){return ne([p.hsl(180,1,.9),p.hsl(250,.7,.4)])},hot:function(){return ne(["#000","#f00","#ff0","#fff"]).mode("rgb")}},Ce={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"]},Le=0,Oe=Object.keys(Ce);Le<Oe.length;Le+=1){var Re=Oe[Le];Ce[Re.toLowerCase()]=Ce[Re]}var je=Ce;return p.average=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 a=n/e.reduce((function(t,r){return t+r}));if(e.forEach((function(t,r){e[r]*=a})),t=t.map((function(t){return new d(t)})),"lrgb"===r)return te(t,e);for(var o=t.shift(),f=o.get(r),i=[],u=0,c=0,l=0;l<f.length;l++)if(f[l]=(f[l]||0)*e[0],i.push(isNaN(f[l])?0:e[0]),"h"===r.charAt(l)&&!isNaN(f[l])){var h=f[l]/180*Jr;u+=Kr(h)*e[0],c+=Qr(h)*e[0]}var s=o.alpha()*e[0];t.forEach((function(t,n){var a=t.get(r);s+=t.alpha()*e[n+1];for(var o=0;o<f.length;o++)if(!isNaN(a[o]))if(i[o]+=e[n+1],"h"===r.charAt(o)){var l=a[o]/180*Jr;u+=Kr(l)*e[n+1],c+=Qr(l)*e[n+1]}else f[o]+=a[o]*e[n+1]}));for(var b=0;b<f.length;b++)if("h"===r.charAt(b)){for(var p=Zr(c/i[b],u/i[b])/Jr*180;p<0;)p+=360;for(;p>=360;)p-=360;f[b]=p}else f[b]=f[b]/i[b];return s/=n,new d(f,r).alpha(s>.99999?1:s,!0)},p.bezier=function(t){var r=oe(t);return r.scale=function(){return ne(r)},r},p.blend=ce,p.cubehelix=function(t,r,e,n,a){void 0===t&&(t=300),void 0===r&&(r=-1.5),void 0===e&&(e=1),void 0===n&&(n=1),void 0===a&&(a=[0,1]);var o,f=0;"array"===le(a)?o=a[1]-a[0]:(o=0,a=[a,a]);var i=function(i){var u=se*((t+120)/360+r*i),c=de(a[0]+o*i,n),l=(0!==f?e[0]+i*f:e)*c*(1-c)/2,h=pe(u),s=be(u);return p(he([255*(c+l*(-.14861*h+1.78277*s)),255*(c+l*(-.29227*h-.90649*s)),255*(c+l*(1.97294*h)),1]))};return i.start=function(r){return null==r?t:(t=r,i)},i.rotations=function(t){return null==t?r:(r=t,i)},i.gamma=function(t){return null==t?n:(n=t,i)},i.hue=function(t){return null==t?e:("array"===le(e=t)?0==(f=e[1]-e[0])&&(e=e[1]):f=0,i)},i.lightness=function(t){return null==t?a:("array"===le(t)?(a=t,o=t[1]-t[0]):(a=[t,t],o=0),i)},i.scale=function(){return p.scale(i)},i.hue(e),i},p.mix=p.interpolate=Dr,p.random=function(){for(var t="#",r=0;r<6;r++)t+="0123456789abcdef".charAt(ge(16*ve()));return new d(t,"hex")},p.scale=ne,p.analyze=_e.analyze,p.contrast=function(t,r){t=new d(t),r=new d(r);var e=t.luminance(),n=r.luminance();return e>n?(e+.05)/(n+.05):(n+.05)/(e+.05)},p.deltaE=function(t,r,e,n){void 0===e&&(e=1),void 0===n&&(n=1),t=new d(t),r=new d(r);for(var a=Array.from(t.lab()),o=a[0],f=a[1],i=a[2],u=Array.from(r.lab()),c=u[0],l=u[1],h=u[2],s=$e(f*f+i*i),b=$e(l*l+h*h),p=o<16?.511:.040975*o/(1+.01765*o),g=.0638*s/(1+.0131*s)+.638,v=s<1e-6?0:180*Ne(i,f)/Fe;v<0;)v+=360;for(;v>=360;)v-=360;var m=v>=164&&v<=345?.56+Ee(.2*Ae(Fe*(v+168)/180)):.36+Ee(.4*Ae(Fe*(v+35)/180)),y=s*s*s*s,w=$e(y/(y+1900)),k=g*(w*m+1-w),x=s-b,M=f-l,_=i-h,$=(o-c)/(e*p),N=x/(n*g);return $e($*$+N*N+(M*M+_*_-x*x)/(k*k))},p.distance=function(t,r,e){void 0===e&&(e="lab"),t=new d(t),r=new d(r);var n=t.get(e),a=r.get(e),o=0;for(var f in n){var i=(n[f]||0)-(a[f]||0);o+=i*i}return Math.sqrt(o)},p.limits=_e.limits,p.valid=function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];try{return new(Function.prototype.bind.apply(d,[null].concat(t))),!0}catch(t){return!1}},p.scales=Pe,p.colors=yr,p.brewer=je,p}()}));const{valid:R}=O,j=t=>{const r=O(t);return{rgb:{r:r.get("rgb.r"),g:r.get("rgb.g"),b:r.get("rgb.b")},hsv:{h:r.get("hsv.h"),s:r.get("hsv.s"),v:r.get("hsv.v")}}};function q(r){let e,a,o,p,g,v,m,y,w,k,x,M;return{c(){e=c("div"),a=c("div"),o=c("div"),p=c("div"),g=l(),v=c("div"),m=l(),y=c("label"),w=c("span"),w.textContent="Hue",k=l(),x=c("input"),this.c=t,s(p,"data-picker","handle"),b(p,"--top",r[0].handle.y+"%"),b(p,"--left",r[0].handle.y+"%"),s(v,"data-picker","colorBox"),s(o,"data-picker","value"),s(a,"data-picker","saturation"),s(e,"role","presentation"),b(e,"--width",r[0].width+"px"),b(e,"--height",r[0].height+"px"),b(e,"--color-red",r[0].bg.r),b(e,"--color-green",r[0].bg.g),b(e,"--color-blue",r[0].bg.b),s(x,"type","range"),s(x,"min","0"),s(x,"max","360"),b(y,"--width",r[0].width+"px"),b(y,"--height",r[0].height+"px")},m(t,u,c){i(t,e,u),f(e,a),f(a,o),f(o,p),r[18](p),f(o,g),f(o,v),r[19](v),i(t,m,u),i(t,y,u),f(y,w),f(y,k),f(y,x),d(x,r[1]),c&&n(M),M=[h(v,"mousedown",r[5]),h(v,"touchstart",r[5]),h(v,"mousemove",r[6]),h(v,"touchmove",r[7]),h(v,"mouseup",r[4]),h(v,"touchend",r[4],{passive:!0}),h(x,"change",r[20]),h(x,"input",r[20])]},p(t,[r]){1&r&&b(p,"--top",t[0].handle.y+"%"),1&r&&b(p,"--left",t[0].handle.y+"%"),1&r&&b(e,"--width",t[0].width+"px"),1&r&&b(e,"--height",t[0].height+"px"),1&r&&b(e,"--color-red",t[0].bg.r),1&r&&b(e,"--color-green",t[0].bg.g),1&r&&b(e,"--color-blue",t[0].bg.b),2&r&&d(x,t[1]),1&r&&b(y,"--width",t[0].width+"px"),1&r&&b(y,"--height",t[0].height+"px")},i:t,o:t,d(t){t&&u(e),r[18](null),r[19](null),t&&u(m),t&&u(y),n(M)}}}function G(t,r,e){let{color:n="#fff"}=r,{width:a=240}=r,{height:o=160}=r;const f=v(),i={width:a,height:o,handle:{x:0,y:0},bg:{}};let u,c,l=180,h=!1;const s=(t,r)=>{e(8,n=((t,r,e)=>O(t).set(r,e).hex())(n,t,r))},d=t=>{const r=((t,r,e)=>O.hsv(t,r,e).rgb())(t,1,1);s("hsv.h",t),e(0,i.bg={r:r[0],g:r[1],b:r[2]},i)},b=(t,r)=>{e(2,u.style.top=`${r}%`,u),e(2,u.style.left=`${t}%`,u),e(8,n=((t,r,e)=>O.hsv(t,r,e).hex())(l,t/100,1-r/100))},p=(t,r=0,e=100)=>{let n=t;return t>e&&(n=e),t<r&&(n=r),n=n.toFixed(2),n},g=(t,r)=>{const{x:e,y:n}=c.getBoundingClientRect();let a=(t-e)/i.width*100,o=(r-n)/i.height*100;o=p(o),a=p(a),b(a,o)};return t.$set=t=>{"color"in t&&e(8,n=t.color),"width"in t&&e(9,a=t.width),"height"in t&&e(10,o=t.height)},t.$$.update=()=>{if(256&t.$$.dirty&&R(n)){const{hsv:t}=j(n);isNaN(t.h)||e(1,l=t.h),e(0,i.handle.x=100*t.s,i),e(0,i.handle.y=100*(1-t.v),i)}2&t.$$.dirty&&d(l),256&t.$$.dirty&&R(n)&&f("update",{hex:n,...j(n)})},[i,l,u,c,()=>{h=!1},t=>{h=!0;const r=((t.offsetX+1)/i.width*100).toFixed(2),e=((t.offsetY+1)/i.height*100).toFixed(2);b(r,e)},t=>{h&&g(t.clientX,t.clientY)},t=>{h&&g(t.touches[0].clientX,t.touches[0].clientY)},n,a,o,h,f,s,d,b,p,g,function(t){y[t?"unshift":"push"](()=>{e(2,u=t)})},function(t){y[t?"unshift":"push"](()=>{e(3,c=t)})},function(){var t;t=this.value,l=""===t?void 0:+t,e(1,l),e(8,n)}]}class B extends L{constructor(t){super(),this.shadowRoot.innerHTML="<style>[role='presentation']{background:rgb(var(--color-red), var(--color-green), var(--color-blue));box-shadow:rgba(0, 0, 0, 0.06) 0 0 0 1px;height:var(--height);width:var(--width)}[data-picker='saturation']{background:linear-gradient(\n to right,\n rgb(255, 255, 255),\n rgba(255, 255, 255, 0)\n );height:var(--height);width:var(--width)}[data-picker='value']{background:linear-gradient(to top, rgb(0, 0, 0), rgba(0, 0, 0, 0));height:var(--height);overflow:hidden;width:var(--width)}[data-picker='handle']{background:transparent;border-radius:50%;border:2px solid #f2f2f2;box-shadow:0 0.3px 1.4px rgba(0, 0, 0, 0.6),\n 0 0.9px 4.7px rgba(0, 0, 0, 0.032), 0 4px 21px rgba(0, 0, 0, 0.04);cursor:crosshair;height:8px;left:100%;margin:0;padding:0;position:relative;transform:translate(-9px, -9px);width:8px;top:var(--top, 50%);left:var(--left, 50%)}[data-picker='colorBox']{box-shadow:0 0 1px rgba(0, 0, 0, 0.32) inset;cursor:crosshair;display:block;height:100%;position:relative;transform:translate(0, -16px);touch-action:none;width:100%}label{display:block;margin:0.8em 0;max-width:calc(var(--width) - 4px);width:calc(var(--width) - 4px)}label span{border:0;clip:rect(0, 0, 0, 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}input{-webkit-appearance:none;-webkit-tap-highlight-color:rgba(255, 255, 255, 0);background:linear-gradient(\n to right,\n #ff0000 0%,\n #ffff00 17%,\n #00ff00 33%,\n #00ffff 50%,\n #0000ff 67%,\n #ff00ff 83%,\n #ff0000 100%\n );border-radius:6px;border:none;box-shadow:rgba(0, 0, 0, 0.06) 0 0 0 1px inset;height:12px;outline:none;padding:1px 2px;width:100%}input::-moz-range-track{background:transparent;border:inherit}input::-ms-track{backgr