mp-darkmode 1.2.3-beta.4 → 1.2.3-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Darkmode",[],e):"object"==typeof exports?exports.Darkmode=e():t.Darkmode=e()}(self,()=>(()=>{var t={31(t){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},40(t,e,r){var n=r(31),o={};for(var a in n)n.hasOwnProperty(a)&&(o[n[a]]=a);var i=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var l in i)if(i.hasOwnProperty(l)){if(!("channels"in i[l]))throw new Error("missing channels property: "+l);if(!("labels"in i[l]))throw new Error("missing channel labels property: "+l);if(i[l].labels.length!==i[l].channels)throw new Error("channel and label counts mismatch: "+l);var u=i[l].channels,s=i[l].labels;delete i[l].channels,delete i[l].labels,Object.defineProperty(i[l],"channels",{value:u}),Object.defineProperty(i[l],"labels",{value:s})}function c(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2)}i.rgb.hsl=function(t){var e,r,n=t[0]/255,o=t[1]/255,a=t[2]/255,i=Math.min(n,o,a),l=Math.max(n,o,a),u=l-i;return l===i?e=0:n===l?e=(o-a)/u:o===l?e=2+(a-n)/u:a===l&&(e=4+(n-o)/u),(e=Math.min(60*e,360))<0&&(e+=360),r=(i+l)/2,[e,100*(l===i?0:r<=.5?u/(l+i):u/(2-l-i)),100*r]},i.rgb.hsv=function(t){var e,r,n,o,a,i=t[0]/255,l=t[1]/255,u=t[2]/255,s=Math.max(i,l,u),c=s-Math.min(i,l,u),h=function(t){return(s-t)/6/c+.5};return 0===c?o=a=0:(a=c/s,e=h(i),r=h(l),n=h(u),i===s?o=n-r:l===s?o=1/3+e-n:u===s&&(o=2/3+r-e),o<0?o+=1:o>1&&(o-=1)),[360*o,100*a,100*s]},i.rgb.hwb=function(t){var e=t[0],r=t[1],n=t[2];return[i.rgb.hsl(t)[0],1/255*Math.min(e,Math.min(r,n))*100,100*(n=1-1/255*Math.max(e,Math.max(r,n)))]},i.rgb.cmyk=function(t){var e,r=t[0]/255,n=t[1]/255,o=t[2]/255;return[100*((1-r-(e=Math.min(1-r,1-n,1-o)))/(1-e)||0),100*((1-n-e)/(1-e)||0),100*((1-o-e)/(1-e)||0),100*e]},i.rgb.keyword=function(t){var e=o[t];if(e)return e;var r,a=1/0;for(var i in n)if(n.hasOwnProperty(i)){var l=c(t,n[i]);l<a&&(a=l,r=i)}return r},i.keyword.rgb=function(t){return n[t]},i.rgb.xyz=function(t){var e=t[0]/255,r=t[1]/255,n=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*e+.7152*r+.0722*n),100*(.0193*e+.1192*r+.9505*n)]},i.rgb.lab=function(t){var e=i.rgb.xyz(t),r=e[0],n=e[1],o=e[2];return n/=100,o/=108.883,r=(r/=95.047)>.008856?Math.pow(r,1/3):7.787*r+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(r-n),200*(n-(o=o>.008856?Math.pow(o,1/3):7.787*o+16/116))]},i.hsl.rgb=function(t){var e,r,n,o,a,i=t[0]/360,l=t[1]/100,u=t[2]/100;if(0===l)return[a=255*u,a,a];e=2*u-(r=u<.5?u*(1+l):u+l-u*l),o=[0,0,0];for(var s=0;s<3;s++)(n=i+1/3*-(s-1))<0&&n++,n>1&&n--,a=6*n<1?e+6*(r-e)*n:2*n<1?r:3*n<2?e+(r-e)*(2/3-n)*6:e,o[s]=255*a;return o},i.hsl.hsv=function(t){var e=t[0],r=t[1]/100,n=t[2]/100,o=r,a=Math.max(n,.01);return r*=(n*=2)<=1?n:2-n,o*=a<=1?a:2-a,[e,100*(0===n?2*o/(a+o):2*r/(n+r)),(n+r)/2*100]},i.hsv.rgb=function(t){var e=t[0]/60,r=t[1]/100,n=t[2]/100,o=Math.floor(e)%6,a=e-Math.floor(e),i=255*n*(1-r),l=255*n*(1-r*a),u=255*n*(1-r*(1-a));switch(n*=255,o){case 0:return[n,u,i];case 1:return[l,n,i];case 2:return[i,n,u];case 3:return[i,l,n];case 4:return[u,i,n];case 5:return[n,i,l]}},i.hsv.hsl=function(t){var e,r,n,o=t[0],a=t[1]/100,i=t[2]/100,l=Math.max(i,.01);return n=(2-a)*i,r=a*l,[o,100*(r=(r/=(e=(2-a)*l)<=1?e:2-e)||0),100*(n/=2)]},i.hwb.rgb=function(t){var e,r,n,o,a,i,l,u=t[0]/360,s=t[1]/100,c=t[2]/100,h=s+c;switch(h>1&&(s/=h,c/=h),n=6*u-(e=Math.floor(6*u)),1&e&&(n=1-n),o=s+n*((r=1-c)-s),e){default:case 6:case 0:a=r,i=o,l=s;break;case 1:a=o,i=r,l=s;break;case 2:a=s,i=r,l=o;break;case 3:a=s,i=o,l=r;break;case 4:a=o,i=s,l=r;break;case 5:a=r,i=s,l=o}return[255*a,255*i,255*l]},i.cmyk.rgb=function(t){var e=t[0]/100,r=t[1]/100,n=t[2]/100,o=t[3]/100;return[255*(1-Math.min(1,e*(1-o)+o)),255*(1-Math.min(1,r*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o))]},i.xyz.rgb=function(t){var e,r,n,o=t[0]/100,a=t[1]/100,i=t[2]/100;return r=-.9689*o+1.8758*a+.0415*i,n=.0557*o+-.204*a+1.057*i,e=(e=3.2406*o+-1.5372*a+-.4986*i)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:12.92*r,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(e=Math.min(Math.max(0,e),1)),255*(r=Math.min(Math.max(0,r),1)),255*(n=Math.min(Math.max(0,n),1))]},i.xyz.lab=function(t){var e=t[0],r=t[1],n=t[2];return r/=100,n/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116)-16,500*(e-r),200*(r-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},i.lab.xyz=function(t){var e,r,n,o=t[0];e=t[1]/500+(r=(o+16)/116),n=r-t[2]/200;var a=Math.pow(r,3),i=Math.pow(e,3),l=Math.pow(n,3);return r=a>.008856?a:(r-16/116)/7.787,e=i>.008856?i:(e-16/116)/7.787,n=l>.008856?l:(n-16/116)/7.787,[e*=95.047,r*=100,n*=108.883]},i.lab.lch=function(t){var e,r=t[0],n=t[1],o=t[2];return(e=360*Math.atan2(o,n)/2/Math.PI)<0&&(e+=360),[r,Math.sqrt(n*n+o*o),e]},i.lch.lab=function(t){var e,r=t[0],n=t[1];return e=t[2]/360*2*Math.PI,[r,n*Math.cos(e),n*Math.sin(e)]},i.rgb.ansi16=function(t){var e=t[0],r=t[1],n=t[2],o=1 in arguments?arguments[1]:i.rgb.hsv(t)[2];if(0===(o=Math.round(o/50)))return 30;var a=30+(Math.round(n/255)<<2|Math.round(r/255)<<1|Math.round(e/255));return 2===o&&(a+=60),a},i.hsv.ansi16=function(t){return i.rgb.ansi16(i.hsv.rgb(t),t[2])},i.rgb.ansi256=function(t){var e=t[0],r=t[1],n=t[2];return e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},i.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var r=.5*(1+~~(t>50));return[(1&e)*r*255,(e>>1&1)*r*255,(e>>2&1)*r*255]},i.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var r;return t-=16,[Math.floor(t/36)/5*255,Math.floor((r=t%36)/6)/5*255,r%6/5*255]},i.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},i.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var r=e[0];3===e[0].length&&(r=r.split("").map(function(t){return t+t}).join(""));var n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},i.rgb.hcg=function(t){var e,r=t[0]/255,n=t[1]/255,o=t[2]/255,a=Math.max(Math.max(r,n),o),i=Math.min(Math.min(r,n),o),l=a-i;return e=l<=0?0:a===r?(n-o)/l%6:a===n?2+(o-r)/l:4+(r-n)/l+4,e/=6,[360*(e%=1),100*l,100*(l<1?i/(1-l):0)]},i.hsl.hcg=function(t){var e,r=t[1]/100,n=t[2]/100,o=0;return(e=n<.5?2*r*n:2*r*(1-n))<1&&(o=(n-.5*e)/(1-e)),[t[0],100*e,100*o]},i.hsv.hcg=function(t){var e=t[1]/100,r=t[2]/100,n=e*r,o=0;return n<1&&(o=(r-n)/(1-n)),[t[0],100*n,100*o]},i.hcg.rgb=function(t){var e=t[0]/360,r=t[1]/100,n=t[2]/100;if(0===r)return[255*n,255*n,255*n];var o,a=[0,0,0],i=e%1*6,l=i%1,u=1-l;switch(Math.floor(i)){case 0:a[0]=1,a[1]=l,a[2]=0;break;case 1:a[0]=u,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=l;break;case 3:a[0]=0,a[1]=u,a[2]=1;break;case 4:a[0]=l,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=u}return o=(1-r)*n,[255*(r*a[0]+o),255*(r*a[1]+o),255*(r*a[2]+o)]},i.hcg.hsv=function(t){var e=t[1]/100,r=e+t[2]/100*(1-e),n=0;return r>0&&(n=e/r),[t[0],100*n,100*r]},i.hcg.hsl=function(t){var e=t[1]/100,r=t[2]/100*(1-e)+.5*e,n=0;return r>0&&r<.5?n=e/(2*r):r>=.5&&r<1&&(n=e/(2*(1-r))),[t[0],100*n,100*r]},i.hcg.hwb=function(t){var e=t[1]/100,r=e+t[2]/100*(1-e);return[t[0],100*(r-e),100*(1-r)]},i.hwb.hcg=function(t){var e=t[1]/100,r=1-t[2]/100,n=r-e,o=0;return n<1&&(o=(r-n)/(1-n)),[t[0],100*n,100*o]},i.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},i.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},i.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},i.gray.hsl=i.gray.hsv=function(t){return[0,0,t[0]]},i.gray.hwb=function(t){return[0,100,t[0]]},i.gray.cmyk=function(t){return[0,0,0,t[0]]},i.gray.lab=function(t){return[t[0],0,0]},i.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),r=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(r.length)+r},i.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}},156(t){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},195(t){t.exports=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}},507(t,e,r){var n=r(40);function o(t,e){return function(r){return e(t(r))}}function a(t,e){for(var r=[e[t].parent,t],a=n[e[t].parent][t],i=e[t].parent;e[i].parent;)r.unshift(e[i].parent),a=o(n[e[i].parent][i],a),i=e[i].parent;return a.conversion=r,a}t.exports=function(t){for(var e=function(t){var e=function(){for(var t={},e=Object.keys(n),r=e.length,o=0;o<r;o++)t[e[o]]={distance:-1,parent:null};return t}(),r=[t];for(e[t].distance=0;r.length;)for(var o=r.pop(),a=Object.keys(n[o]),i=a.length,l=0;l<i;l++){var u=a[l],s=e[u];-1===s.distance&&(s.distance=e[o].distance+1,s.parent=o,r.unshift(u))}return e}(t),r={},o=Object.keys(e),i=o.length,l=0;l<i;l++){var u=o[l];null!==e[u].parent&&(r[u]=a(u,e))}return r}},520(t,e,r){"use strict";var n=r(854),o=r(734),a=[].slice,i=["keyword","gray","hex"],l={};Object.keys(o).forEach(function(t){l[a.call(o[t].labels).sort().join("")]=t});var u={};function s(t,e){if(!(this instanceof s))return new s(t,e);if(e&&e in i&&(e=null),e&&!(e in o))throw new Error("Unknown model: "+e);var r,c;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof s)this.model=t.model,this.color=t.color.slice(),this.valpha=t.valpha;else if("string"==typeof t){var h=n.get(t);if(null===h)throw new Error("Unable to parse color from string: "+t);this.model=h.model,c=o[this.model].channels,this.color=h.value.slice(0,c),this.valpha="number"==typeof h.value[c]?h.value[c]:1}else if(t.length){this.model=e||"rgb",c=o[this.model].channels;var d=a.call(t,0,c);this.color=f(d,c),this.valpha="number"==typeof t[c]?t[c]:1}else if("number"==typeof t)t&=16777215,this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;var g=Object.keys(t);"alpha"in t&&(g.splice(g.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);var b=g.sort().join("");if(!(b in l))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=l[b];var y=o[this.model].labels,p=[];for(r=0;r<y.length;r++)p.push(t[y[r]]);this.color=f(p)}if(u[this.model])for(c=o[this.model].channels,r=0;r<c;r++){var m=u[this.model][r];m&&(this.color[r]=m(this.color[r]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}function c(t,e,r){return(t=Array.isArray(t)?t:[t]).forEach(function(t){(u[t]||(u[t]=[]))[e]=r}),t=t[0],function(n){var o;return arguments.length?(r&&(n=r(n)),(o=this[t]()).color[e]=n,o):(o=this[t]().color[e],r&&(o=r(o)),o)}}function h(t){return function(e){return Math.max(0,Math.min(t,e))}}function f(t,e){for(var r=0;r<e;r++)"number"!=typeof t[r]&&(t[r]=0);return t}s.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(t){var e=this.model in n.to?this:this.rgb(),r=1===(e=e.round("number"==typeof t?t:1)).valpha?e.color:e.color.concat(this.valpha);return n.to[e.model](r)},percentString:function(t){var e=this.rgb().round("number"==typeof t?t:1),r=1===e.valpha?e.color:e.color.concat(this.valpha);return n.to.rgb.percent(r)},array:function(){return 1===this.valpha?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var t={},e=o[this.model].channels,r=o[this.model].labels,n=0;n<e;n++)t[r[n]]=this.color[n];return 1!==this.valpha&&(t.alpha=this.valpha),t},unitArray:function(){var t=this.rgb().color;return t[0]/=255,t[1]/=255,t[2]/=255,1!==this.valpha&&t.push(this.valpha),t},unitObject:function(){var t=this.rgb().object();return t.r/=255,t.g/=255,t.b/=255,1!==this.valpha&&(t.alpha=this.valpha),t},round:function(t){return t=Math.max(t||0,0),new s(this.color.map(function(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}(t)).concat(this.valpha),this.model)},alpha:function(t){return arguments.length?new s(this.color.concat(Math.max(0,Math.min(1,t))),this.model):this.valpha},red:c("rgb",0,h(255)),green:c("rgb",1,h(255)),blue:c("rgb",2,h(255)),hue:c(["hsl","hsv","hsl","hwb","hcg"],0,function(t){return(t%360+360)%360}),saturationl:c("hsl",1,h(100)),lightness:c("hsl",2,h(100)),saturationv:c("hsv",1,h(100)),value:c("hsv",2,h(100)),chroma:c("hcg",1,h(100)),gray:c("hcg",2,h(100)),white:c("hwb",1,h(100)),wblack:c("hwb",2,h(100)),cyan:c("cmyk",0,h(100)),magenta:c("cmyk",1,h(100)),yellow:c("cmyk",2,h(100)),black:c("cmyk",3,h(100)),x:c("xyz",0,h(100)),y:c("xyz",1,h(100)),z:c("xyz",2,h(100)),l:c("lab",0,h(100)),a:c("lab",1),b:c("lab",2),keyword:function(t){return arguments.length?new s(t):o[this.model].keyword(this.color)},hex:function(t){return arguments.length?new s(t):n.to.hex(this.rgb().round().color)},rgbNumber:function(){var t=this.rgb().color;return(255&t[0])<<16|(255&t[1])<<8|255&t[2]},luminosity:function(){for(var t=this.rgb().color,e=[],r=0;r<t.length;r++){var n=t[r]/255;e[r]=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),r=t.luminosity();return e>r?(e+.05)/(r+.05):(r+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var t=this.rgb().color;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var t=this.rgb(),e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten:function(t){var e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken:function(t){var e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate:function(t){var e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate:function(t){var e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten:function(t){var e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken:function(t){var e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale:function(){var t=this.rgb().color,e=.3*t[0]+.59*t[1]+.11*t[2];return s.rgb(e,e,e)},fade:function(t){return this.alpha(this.valpha-this.valpha*t)},opaquer:function(t){return this.alpha(this.valpha+this.valpha*t)},rotate:function(t){var e=this.hsl(),r=e.color[0];return r=(r=(r+t)%360)<0?360+r:r,e.color[0]=r,e},mix:function(t,e){if(!t||!t.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof t);var r=t.rgb(),n=this.rgb(),o=void 0===e?.5:e,a=2*o-1,i=r.alpha()-n.alpha(),l=((a*i===-1?a:(a+i)/(1+a*i))+1)/2,u=1-l;return s.rgb(l*r.red()+u*n.red(),l*r.green()+u*n.green(),l*r.blue()+u*n.blue(),r.alpha()*o+n.alpha()*(1-o))}},Object.keys(o).forEach(function(t){if(-1===i.indexOf(t)){var e=o[t].channels;s.prototype[t]=function(){if(this.model===t)return new s(this);if(arguments.length)return new s(arguments,t);var r,n="number"==typeof arguments[e]?e:this.valpha;return new s((r=o[this.model][t].raw(this.color),Array.isArray(r)?r:[r]).concat(n),t)},s[t]=function(r){return"number"==typeof r&&(r=f(a.call(arguments),e)),new s(r,t)}}}),t.exports=s},734(t,e,r){var n=r(40),o=r(507),a={};Object.keys(n).forEach(function(t){a[t]={},Object.defineProperty(a[t],"channels",{value:n[t].channels}),Object.defineProperty(a[t],"labels",{value:n[t].labels});var e=o(t);Object.keys(e).forEach(function(r){var n=e[r];a[t][r]=function(t){var e=function(e){if(null==e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var r=t(e);if("object"==typeof r)for(var n=r.length,o=0;o<n;o++)r[o]=Math.round(r[o]);return r};return"conversion"in t&&(e.conversion=t.conversion),e}(n),a[t][r].raw=function(t){var e=function(e){return null==e?e:(arguments.length>1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(n)})}),t.exports=a},854(t,e,r){var n=r(156),o=r(872),a=Object.hasOwnProperty,i=Object.create(null);for(var l in n)a.call(n,l)&&(i[n[l]]=l);var u=t.exports={to:{},get:{}};function s(t,e,r){return Math.min(Math.max(e,t),r)}function c(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}u.get=function(t){var e,r;switch(t.substring(0,3).toLowerCase()){case"hsl":e=u.get.hsl(t),r="hsl";break;case"hwb":e=u.get.hwb(t),r="hwb";break;default:e=u.get.rgb(t),r="rgb"}return e?{model:r,value:e}:null},u.get.rgb=function(t){if(!t)return null;var e,r,o,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(o=e[2],e=e[1],r=0;r<3;r++){var l=2*r;i[r]=parseInt(e.slice(l,l+2),16)}o&&(i[3]=parseInt(o,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(o=(e=e[1])[3],r=0;r<3;r++)i[r]=parseInt(e[r]+e[r],16);o&&(i[3]=parseInt(o+o,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(r=0;r<3;r++)i[r]=parseInt(e[r+1],0);e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:a.call(n,e[1])?((i=n[e[1]])[3]=1,i):null:null;for(r=0;r<3;r++)i[r]=Math.round(2.55*parseFloat(e[r+1]));e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}for(r=0;r<3;r++)i[r]=s(i[r],0,255);return i[3]=s(i[3],0,1),i},u.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var r=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,s(parseFloat(e[2]),0,100),s(parseFloat(e[3]),0,100),s(isNaN(r)?1:r,0,1)]}return null},u.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var r=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,s(parseFloat(e[2]),0,100),s(parseFloat(e[3]),0,100),s(isNaN(r)?1:r,0,1)]}return null},u.to.hex=function(){var t=o(arguments);return"#"+c(t[0])+c(t[1])+c(t[2])+(t[3]<1?c(Math.round(255*t[3])):"")},u.to.rgb=function(){var t=o(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},u.to.rgb.percent=function(){var t=o(arguments),e=Math.round(t[0]/255*100),r=Math.round(t[1]/255*100),n=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+r+"%, "+n+"%)":"rgba("+e+"%, "+r+"%, "+n+"%, "+t[3]+")"},u.to.hsl=function(){var t=o(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},u.to.hwb=function(){var t=o(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},u.to.keyword=function(t){return i[t.slice(0,3)]}},872(t,e,r){"use strict";var n=r(195),o=Array.prototype.concat,a=Array.prototype.slice,i=t.exports=function(t){for(var e=[],r=0,i=t.length;r<i;r++){var l=t[r];n(l)?e=o.call(e,a.call(l)):e.push(l)}return e};i.wrap=function(t){return function(){return t(i(arguments))}}}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,r),a.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};return(()=>{"use strict";r.r(n),r.d(n,{convertBg:()=>Ee,extend:()=>Ae,getContrast:()=>Te,init:()=>Pe,run:()=>je,updateStyle:()=>Be});var t={};r.r(t),r.d(t,{color:()=>Yt,colorBurn:()=>Ht,colorDodge:()=>Kt,darken:()=>Vt,difference:()=>Qt,exclusion:()=>Gt,hardLight:()=>Jt,hue:()=>Wt,lighten:()=>zt,luminosity:()=>Zt,multiply:()=>qt,normal:()=>It,overlay:()=>$t,saturation:()=>Xt,screen:()=>Rt,softLight:()=>Ut});var e="(prefers-color-scheme: dark)",o="js_darkmode__",a=new RegExp("".concat(o,"\\d+")),i="data_color_scheme_dark",l="".concat(1*new Date).concat(Math.round(10*Math.random())),u="data-darkmode-color-".concat(l),s="data-darkmode-bgcolor-".concat(l),c="data-darkmode-original-color-".concat(l),h="data-darkmode-original-bgcolor-".concat(l),f="data-darkmode-bgimage-".concat(l),d="data-darkmode-complementary-bgimagecolor-".concat(l),g="|",b=.05,y=window.getInnerHeight&&window.getInnerHeight()||window.innerHeight||document.documentElement.clientHeight,p={BG_COLOR:["background-color","background-image","background"],TEXT_SHADOW:["text-shadow"],TEXT_COLOR:["-webkit-text-stroke","-webkit-text-stroke-color","text-decoration","text-decoration-color","text-emphasis-color","color","-webkit-text-fill-color"],BORDER_COLOR:["border-image","-webkit-border-image","border","border-top","border-right","border-bottom","border-left","border-color","border-top-color","border-right-color","border-bottom-color","border-left-color","border-block-color","border-block-start-color","border-block-end-color","border-inline-color","border-inline-start-color","border-inline-end-color","outline","outline-color","box-shadow","column-rule","column-rule-color"]},m=Object.keys(p).map(function(t){return p[t].join("|")}).join("|").split("|"),v=["TABLE","TR","TD","TH"],w=/ !important$/,k=/<\$#_SEMICOLON_#\$>/g,x=/\brgba?\([^)]+\)/i,M=/\brgba?\([^)]+\)/gi;const C={hasInit:!1,begin:null,showFirstPage:null,error:null,mode:"",whitelist:{tagName:["MPCPS","IFRAME"],attribute:[]},needJudgeFirstPage:!0,delayBgJudge:!1,container:null,cssSelectorsPrefix:"",defaultLightTextColor:"#191919",defaultLightBgColor:"#fff",defaultDarkTextColor:"#a3a3a3",defaultDarkBgColor:"#191919",set:function(t,e,r){var n=e[r];switch(t){case"boolean":"boolean"==typeof n&&(this[r]=n);break;case"string":"string"==typeof n&&""!==n&&(this[r]=n);break;case"function":"function"==typeof n&&(this[r]=n);break;case"dom":n instanceof HTMLElement&&(this[r]=n)}}};function S(t,e,r){return(e=E(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _(t){return _="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_(t)}function O(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function j(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,E(n.key),n)}}function P(t,e,r){return e&&j(t.prototype,e),r&&j(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function E(t){var e=function(t){if("object"!=_(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=_(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_(e)?e:e+""}var B=[],T=[],A=function(){return P(function t(){O(this,t)},[{key:"loopTimes",get:function(){return me.loopTimes}},{key:"isDarkmode",get:function(){return Me.isDarkmode}},{key:"addCss",value:function(t,e){(arguments.length>2&&void 0!==arguments[2]&&!arguments[2]?T:B).push(ke.genCss(t,e.map(function(t){var e=t.key,r=t.value;return ke.genCssKV(e,r)}).join("")))}}])}(),D=function(){return P(function t(){O(this,t),S(this,"_plugins",[]),S(this,"length",0),S(this,"loopTimes",0),S(this,"firstPageStyle",""),S(this,"otherPageStyle",""),S(this,"firstPageStyleNoMQ",""),S(this,"otherPageStyleNoMQ","")},[{key:"extend",value:function(t){this._plugins.push(new(t(A))),this.length++}},{key:"emit",value:function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];this._plugins.forEach(function(e){"function"==typeof e[t]&&e[t].apply(e,r)})}},{key:"addCss",value:function(t){t?(this.firstPageStyle+=B.join(""),this.firstPageStyleNoMQ+=T.join("")):(this.otherPageStyle+=B.join(""),this.otherPageStyleNoMQ+=T.join(""))}},{key:"resetCss",value:function(){B=[],T=[]}}])}();function F(t){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},F(t)}function N(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,I(n.key),n)}}function L(t,e,r){return(e=I(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function I(t){var e=function(t){if("object"!=F(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=F(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==F(e)?e:e+""}var q=function(){return function(t,e){return e&&N(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),L(this,"_queue",[]),L(this,"_idx",0),this._prefix=e},[{key:"length",get:function(){return this._queue.length}},{key:"push",value:function(t){var e="".concat(this._prefix).concat(this._idx++);t.classList.add(e),this._queue.push({el:t,className:e,updated:!C.delayBgJudge})}},{key:"forEach",value:function(t){var e=[];for(this._queue.forEach(function(r,n){r.updated&&(e.unshift(n),F(t)&&t(r.el))});e.length;)this._queue.splice(e.shift(),1)}},{key:"update",value:function(t){this._queue.forEach(function(e){e.updated||Array.prototype.some.call(t,function(t){return!(1!==t.nodeType||!t.classList.contains(e.className)||(e.el=t,e.updated=!0,0))})})}}])}();function R(t){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},R(t)}function $(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,z(n.key),n)}}function V(t,e,r){return(e=z(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function z(t){var e=function(t){if("object"!=R(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=R(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==R(e)?e:e+""}var K=function(){return function(t,e){return e&&$(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),V(this,"_stack",[]),V(this,"_idx",0),this._prefix=e,this.classNameReg=new RegExp("".concat(this._prefix,"\\d+"))},[{key:"push",value:function(t,e,r){var n="".concat(this._prefix).concat(this._idx++);t.classList.add(n),this._stack.unshift({elOld:t,el:t,className:n,cssKV:e,updated:!C.delayBgJudge,cb:r})}},{key:"contains",value:function(t,e){var r=t.getBoundingClientRect(),n=[];for(this._stack.forEach(function(t,e){if(t.updated){t.rect||(t.rect=t.el.getBoundingClientRect());var o=t.rect;r.top>=o.bottom||r.bottom<=o.top||r.left>=o.right||r.right<=o.left||n.unshift(e)}});n.length;){var o=n.shift(),a=this._stack.splice(o,1)[0];"function"==typeof e&&e(a)}}},{key:"update",value:function(t){this._stack.forEach(function(e){e.updated||Array.prototype.some.call(t,function(t){return!(1!==t.nodeType||!t.classList.contains(e.className)||(e.el=t,e.updated=!0,0))})})}}])}();function H(t){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},H(t)}function J(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function U(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,G(n.key),n)}}function Q(t,e,r){return(e=G(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function G(t){var e=function(t){if("object"!=H(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=H(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==H(e)?e:e+""}var W=function(){return function(t,e){return e&&U(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Q(this,"_firstPageStyle",""),Q(this,"_otherPageStyle",""),Q(this,"_watcher",{}),Q(this,"isFinish",!1)},[{key:"genCssKV",value:function(t,e){var r,n;return null===(r=(n=this._watcher)[t])||void 0===r||r.call(n),"".concat(t,": ").concat(e," !important;")}},{key:"genCss",value:function(t,e){return"".concat("dark"===C.mode?"html.".concat(i," "):"").concat(C.cssSelectorsPrefix&&"".concat(C.cssSelectorsPrefix," "),".").concat(t,"{").concat(e,"}")}},{key:"addCss",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this[e?"_firstPageStyle":"_otherPageStyle"]+=t,me.addCss(e)}},{key:"writeStyle",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];!t&&Me.isDarkmode&&(this.isFinish=!0);var r=(Me.isDarkmode?[{target:this,key:["_firstPageStyle","_otherPageStyle"],needMediaQuery:!0}]:[]).concat([{target:me,key:["firstPageStyle","otherPageStyle"],needMediaQuery:!0},{target:me,key:["firstPageStyleNoMQ","otherPageStyleNoMQ"],needMediaQuery:!1}]).map(function(r){var n=r.target,o=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,l=[],u=!0,s=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return J(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?J(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(r.key,2),a=o[0],i=o[1],l=r.needMediaQuery,u="";t?u=a:(n[i]=n[a]+n[i],n[a]="",u=i);var s=n[u];return s?(n[u]="","dark"!==C.mode&&l?"@media ".concat(e," {").concat(s,"}"):s):""}).join("");r&&document.head.insertAdjacentHTML("beforeend",'<style type="text/css">'.concat(r,"</style>"))}},{key:"watch",value:function(t,e){this._watcher[t]=e}},{key:"unwatch",value:function(t){delete this._watcher[t]}}])}();function X(t){return X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},X(t)}function Y(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,tt(n.key),n)}}function Z(t,e,r){return(e=tt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tt(t){var e=function(t){if("object"!=X(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=X(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==X(e)?e:e+""}function et(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function rt(t){var e;return(e=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?[]:[t]).concat.apply(e,function(t){return function(t){if(Array.isArray(t))return et(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return et(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?et(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t.querySelectorAll("*")))}var nt={"ue-table-interlace-color-single":"#fcfcfc","ue-table-interlace-color-double":"#f7faff"},ot=function(){return function(t,e){return e&&Y(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Z(this,"_els",[]),Z(this,"_firstPageEls",[]),Z(this,"_delayEls",[]),Z(this,"showFirstPage",!1)},[{key:"length",get:function(){return this._els.length}},{key:"set",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this._els=t}},{key:"get",value:function(){var t=[];return this._els.length?(t=this._els,Me.isDarkmode&&(this._els=[])):this._delayEls.length?(t=this._delayEls,this._delayEls=[]):C.container&&(t=C.container.querySelectorAll("*")),t}},{key:"delay",value:function(){var t=this;Array.prototype.forEach.call(this._els,function(e){return t._delayEls.push(e)}),this._els=[]}},{key:"hasDelay",value:function(){return!this._els.length&&(this._delayEls.length>0||null!==C.container)}},{key:"addFirstPageNode",value:function(t){this._firstPageEls.push(t)}},{key:"showFirstPageNodes",value:function(){this._firstPageEls.forEach(function(t){return!t.style.visibility&&(t.style.visibility="visible")}),this.showFirstPage=!0}},{key:"emptyFirstPageNodes",value:function(){this._firstPageEls=[]}}])}(),at=r(520),it=r.n(at),lt=r(156),ut=r.n(lt);function st(t,e,r){return{r:255*r(t.r/255,e.r/255),g:255*r(t.g/255,e.g/255),b:255*r(t.b/255,e.b/255)}}function ct(t,e){return e}function ht(t,e){return t*e}function ft(t,e){return t+e-t*e}function dt(t,e){return mt(e,t)}function gt(t,e){return Math.min(t,e)}function bt(t,e){return Math.min(Math.max(t,e),1)}function yt(t,e){return 0===t?0:1===e?1:Math.min(1,t/(1-e))}function pt(t,e){return 1===t?1:0===e?0:1-Math.min(1,(1-t)/e)}function mt(t,e){return e<=.5?ht(t,2*e):ft(t,2*e-1)}function vt(t,e){return e<=.5?t-(1-2*e)*t*(1-t):t+(2*e-1)*((t<=.25?((16*t-12)*t+4)*t:Math.sqrt(t))-t)}function wt(t,e){return Math.abs(t-e)}function kt(t,e){return t+e-2*t*e}function xt(t,e,r){return Math.min(Math.max(t||0,e),r)}function Mt(t){return{r:xt(t.r,0,255),g:xt(t.g,0,255),b:xt(t.b,0,255),a:xt(t.a,0,1)}}function Ct(t){return{r:255*t.r,g:255*t.g,b:255*t.b,a:t.a}}function St(t){return{r:t.r/255,g:t.g/255,b:t.b/255,a:t.a}}function _t(t,e){void 0===e&&(e=0);var r=Math.pow(10,e);return{r:Math.round(t.r*r)/r,g:Math.round(t.g*r)/r,b:Math.round(t.b*r)/r,a:t.a}}function Ot(t,e,r,n,o,a){return(1-e/r)*n+e/r*Math.round((1-t)*o+t*a)}function jt(t,e,r,n,o){void 0===o&&(o={unitInput:!1,unitOutput:!1,roundOutput:!0}),o.unitInput&&(t=Ct(t),e=Ct(e)),t=Mt(t);var a=(e=Mt(e)).a+t.a-e.a*t.a,i=r(t,e,n),l=Mt({r:Ot(t.a,e.a,a,t.r,e.r,i.r),g:Ot(t.a,e.a,a,t.g,e.g,i.g),b:Ot(t.a,e.a,a,t.b,e.b,i.b),a});return l=o.unitOutput?St(l):o.roundOutput?_t(l):function(t){return _t(t,9)}(l),l}function Pt(t,e,r){return Ct(r(St(t),St(e)))}function Et(t){return.3*t.r+.59*t.g+.11*t.b}function Bt(t,e){var r=e-Et(t);return function(t){var e=Et(t),r=t.r,n=t.g,o=t.b,a=Math.min(r,n,o),i=Math.max(r,n,o);function l(t){return e+(t-e)*e/(e-a)}function u(t){return e+(t-e)*(1-e)/(i-e)}return a<0&&(r=l(r),n=l(n),o=l(o)),i>1&&(r=u(r),n=u(n),o=u(o)),{r,g:n,b:o}}({r:t.r+r,g:t.g+r,b:t.b+r})}function Tt(t){return Math.max(t.r,t.g,t.b)-Math.min(t.r,t.g,t.b)}function At(t,e){var r=["r","g","b"].sort(function(e,r){return t[e]-t[r]}),n=r[0],o=r[1],a=r[2],i={r:t.r,g:t.g,b:t.b};return i[a]>i[n]?(i[o]=(i[o]-i[n])*e/(i[a]-i[n]),i[a]=e):i[o]=i[a]=0,i[n]=0,i}function Dt(t,e){return Bt(At(e,Tt(t)),Et(t))}function Ft(t,e){return Bt(At(t,Tt(e)),Et(t))}function Nt(t,e){return Bt(e,Et(t))}function Lt(t,e){return Bt(t,Et(e))}function It(t,e){return jt(t,e,st,ct)}function qt(t,e){return jt(t,e,st,ht)}function Rt(t,e){return jt(t,e,st,ft)}function $t(t,e){return jt(t,e,st,dt)}function Vt(t,e){return jt(t,e,st,gt)}function zt(t,e){return jt(t,e,st,bt)}function Kt(t,e){return jt(t,e,st,yt)}function Ht(t,e){return jt(t,e,st,pt)}function Jt(t,e){return jt(t,e,st,mt)}function Ut(t,e){return jt(t,e,st,vt)}function Qt(t,e){return jt(t,e,st,wt)}function Gt(t,e){return jt(t,e,st,kt)}function Wt(t,e){return jt(t,e,Pt,Dt)}function Xt(t,e){return jt(t,e,Pt,Ft)}function Yt(t,e){return jt(t,e,Pt,Nt)}function Zt(t,e){return jt(t,e,Pt,Lt)}ut().windowtext=[0,0,0],ut().transparent=[255,255,255,0];var te=new RegExp(Object.keys(ut()).map(function(t){return"\\b".concat(t,"\\b")}).join("|"),"ig"),ee=function(t){var e=t.object();return e.a=e.alpha||1,delete e.alpha,e},re=function(t){return t.alpha=t.a,delete t.a,ne(t)},ne=function(t){var e=null;try{e=t instanceof it()?t:it()(t)}catch(e){console.log("ignore the invalid color: `".concat(t,"`"))}return e},oe=function(t,e){return t.replace(w,"").replace(te,function(t){if(!e&&"transparent"===t)return t;var r=ut()[t.toLowerCase()];return"".concat(r.length>3?"rgba":"rgb","(").concat(r.toString(),")")})},ae=function(t){var e=oe(t);return x.test(e)?e:""},ie=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"mix";if("[object Array]"!==Object.prototype.toString.call(e)||e.length<1)return null;if(1===e.length)return e[0];for(var n=ne(e.shift()),o=ne(e.shift());o;){if(!n&&o)n=o;else if(n||o)n&&o&&(n="mix"===r?n.mix(o,o.alpha()):re(t[r](ee(n),ee(o))));else{if(0===e.length)break;n=ne(e.shift())}if(0===e.length)break;o=ne(e.shift())}return n||null},le=function(t){return(299*t[0]+587*t[1]+114*t[2])/1e3},ue=function(t,e){var r=t/le(e),n=Math.min(255,e[0]*r),o=Math.min(255,e[1]*r),a=Math.min(255,e[2]*r);return 0===o||255===n||255===a?o=(1e3*t-299*n-114*a)/587:0===n?n=(1e3*t-587*o-114*a)/299:0!==a&&255!==o||(a=(1e3*t-299*n-587*o)/114),it().rgb(n,o,a)};function se(t){return se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},se(t)}function ce(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,l=[],u=!0,s=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}(t,e)||fe(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function he(t){return function(t){if(Array.isArray(t))return de(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||fe(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fe(t,e){if(t){if("string"==typeof t)return de(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?de(t,e):void 0}}function de(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ge(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ye(n.key),n)}}function be(t,e,r){return(e=ye(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ye(t){var e=function(t){if("object"!=se(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=se(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==se(e)?e:e+""}var pe=function(){return function(t,e){return e&&ge(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),be(this,"_idx",0),be(this,"_defaultDarkTextColorRgb",null),be(this,"_defaultDarkBgColorRgb",null),be(this,"_defaultDarkBgColorHSL",null),be(this,"_defaultDarkTextColorBrightness",null),be(this,"_defaultDarkBgColorBrightness",null),be(this,"_defaultDarkBgColorHslBrightness",null),be(this,"_maxLimitOffsetBrightness",null),be(this,"isDarkmode",!1)},[{key:"_adjustBrightness",value:function(t,e,r,n,o){var a,i=t.alpha(),l="";if(r.isBgColor){if(i>=b&&(e[f]&&delete e[f],e[d])){if(e[d]===t.toString()||this.getContrast(e[d],t.toString())<1.1)return{newColor:o?t.toString():"",extStyle:l};rt(e).forEach(function(t){delete t[d]})}if(a=this._adjustBackgroundBrightness(t),!r.hasInlineColor){var h=e[c]||C.defaultLightTextColor,g=ne(h);if(g){var y=this._adjustBrightness(g,e,{isTextColor:!0,parentElementBgColorStr:a||t},n,o);l+=ke.genCssKV("color",y.newColor||g),rt(e).forEach(function(t){t[u]=y.newColor||g,t[c]=g})}}}else if(r.isTextColor||r.isBorderColor){var p=r.parentElementBgColorStr||r.isTextColor&&e[s]||C.defaultDarkBgColor,m=ne(p);if(m&&!e[f]){a=this._adjustTextBrightness(t,m);var v="";n?v="ByUpdateStyle":o&&(v="ByReset"),me.emit("afterConvertTextColor".concat(v),e,{fontColor:a,bgColor:m})}}else r.isTextShadow&&(e[f]||(a=this._adjustBackgroundBrightness(t)));return{newColor:a&&t.toString()!==a.toString()&&a.alpha(i).rgb(),extStyle:l}}},{key:"_adjustTextBrightness",value:function(t,e){var r=e.rgb().array(),n=e.alpha(),o=le(r)*n+this._defaultDarkBgColorBrightness*(1-n),a=t.rgb().array(),i=t.hsl().array(),l=t.alpha(),u=le(a),s=Math.abs(o-u);if(u>=250)return t;if(s>this._maxLimitOffsetBrightness&&o<=this._defaultDarkBgColorBrightness+2)return ue(this._maxLimitOffsetBrightness+o,a).alpha(l);if(s>=65)return t;if(o>=100){if(i[2]>50){i[2]=90-i[2];var c=it().hsl.apply(it(),he(i)).alpha(l);return this._adjustTextBrightness(c,e)}return ue(Math.min(this._maxLimitOffsetBrightness,o-65),a).alpha(l)}if(i[2]<=40){i[2]=90-i[2];var h=it().hsl.apply(it(),he(i)).alpha(l);return this._adjustTextBrightness(h,e)}return ue(Math.min(this._maxLimitOffsetBrightness,o+65),a).alpha(l)}},{key:"_adjustBackgroundBrightness",value:function(t){var e=t.rgb().array(),r=t.hsl().array(),n=t.alpha(),o=le(e),a=t;return 0===r[1]&&r[2]>40||o>250?a=it().hsl(0,0,Math.min(100,100+this._defaultDarkBgColorHslBrightness-r[2])):o>190?a=ue(190,e).alpha(n):r[2]<22&&(r[2]=22,a=it().hsl.apply(it(),he(r))),a.alpha(n).rgb()}},{key:"_updateBgWithGradient",value:function(t,e,r,n,o,a,i){var l=ie([e[s]||C.defaultDarkBgColor,t],"normal"),u=(e[h]||C.defaultLightBgColor).split(g).concat(t.toString()).join(g);rt(e).forEach(function(t){t[s]=l,t[h]=u});var c=n.slice(-1)[0];if("color"===c[0]){var f=this._adjustBrightness(ne(oe(c[1])),e,{isBgColor:!1,isTextShadow:!1,isTextColor:!0,isBorderColor:!1,hasInlineColor:o},a,i);if(f.newColor)return ke.genCss(r,ke.genCssKV("color",f.newColor))}return""}},{key:"_try",value:function(t){try{return t()}catch(t){console.log("An error occurred when running the dark mode conversion algorithm\n",t),"function"==typeof C.error&&C.error(t)}}},{key:"init",value:function(){this._defaultDarkTextColorRgb=ne(C.defaultDarkTextColor).rgb().array(),this._defaultDarkBgColorRgb=ne(C.defaultDarkBgColor).rgb().array(),this._defaultDarkBgColorHSL=ne(C.defaultDarkBgColor).hsl().array(),this._defaultDarkTextColorBrightness=le(this._defaultDarkTextColorRgb),this._defaultDarkBgColorBrightness=le(this._defaultDarkBgColorRgb),this._defaultDarkBgColorHslBrightness=this._defaultDarkBgColorHSL[2],this._maxLimitOffsetBrightness=this._defaultDarkTextColorBrightness-this._defaultDarkBgColorBrightness}},{key:"convert",value:function(t,e,r,n){var i=this;me.resetCss();var l="";r?l="ByUpdateStyle":n&&(l="ByReset"),me.emit("beforeConvertNode".concat(l),t);var y="",S="";if(this.isDarkmode||r||n){var _=t.nodeName;if(C.whitelist.tagName.indexOf(_)>-1)return"";if(C.whitelist.attribute.some(function(e){return t.hasAttribute(e)}))return"";var O=t.style;e||(e=(O.cssText&&O.cssText.replace(/("[^;]*);([^;]*")|('[^;]*);([^;]*')/g,"$1$3".concat("<$#_SEMICOLON_#$>","$2$4")).split(";")||[]).map(function(t){var e=t.indexOf(":");return[t.slice(0,e).toLowerCase(),t.slice(e+1).replace(k,";")].map(function(t){return(t||"").replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")})}));var j=!1,P=!1,E=!1,B=null,T=null;e=e.filter(function(t){var e=ce(t,2),r=e[0],n=e[1];return"color"===r?j=!0:/background/i.test(r)&&(P=!0,"background-position"===r?B=n:"background-size"===r&&(T=n)),(/background/i.test(r)||/^(-webkit-)?border-image/.test(r))&&/url\([^)]*\)/i.test(n)&&(E=!0),m.indexOf(r)>-1}).sort(function(t,e){var r=ce(t,1)[0],n=ce(e,1)[0];return"color"===r||"background-image"===r&&"background-color"===n||0===n.indexOf("-webkit-text")?1:-1}),v.indexOf(_)>-1&&!P&&this._try(function(){var r=function(t){var e=null;return Array.prototype.some.call(t.classList,function(t){return!!nt[t]&&(e=nt[t],!0)}),e}(t);if(r||(r=t.getAttribute("bgcolor")),r){var n=ne(r);n&&(e.unshift(["background-color",n.toString()]),P=!0)}}),"FONT"!==_||j||this._try(function(){var r=t.getAttribute("color");if(r){var n=ne(r);n&&(e.push(["color",n.toString()]),j=!0)}});var A="",D="",F=0;e.some(function(t,e){var r=ce(t,2),n=r[0],o=r[1];return i._try(function(){if(0!==n.indexOf("-webkit-text"))return F=e,!0;switch(n){case"-webkit-text-fill-color":A=ae(o);break;case"-webkit-text-stroke":var t=o.split(" ");2===t.length&&(D=ae(t[1]));break;case"-webkit-text-stroke-color":D=ae(o)}return!1})}),A&&(j?e[e.length-1]=["-webkit-text-fill-color",A]:(e.push(["-webkit-text-fill-color",A]),j=!0)),F&&(e.splice(0,F),D&&e.unshift(["-webkit-text-stroke-color",D]));var N="",L="";if((r||n)&&t.className&&"string"==typeof t.className){var I=t.className.match(a);I&&(N=I[0]),(I=t.className.match(we.classNameReg))&&(L=I[0])}var q="",R=n;R&&ke.watch("color",function(){R=!1,ke.unwatch("color")}),e.forEach(function(o){var a=ce(o,2),l=a[0],m=a[1];return i._try(function(){var o,a=m,v=!1,k=p.BG_COLOR.indexOf(l)>-1,_=p.TEXT_SHADOW.indexOf(l)>-1,A=p.TEXT_COLOR.indexOf(l),D=p.BORDER_COLOR.indexOf(l)>-1,F=/gradient/.test(m),N=[],I="";if(m=oe(m,F),x.test(m)){if(F){for(var $=M.exec(m);$;)N.push($[0]),$=M.exec(m);o=ie(N)}var V=0;m=m.replace(M,function(e){F&&(e=o,v=!0);var a=ne(e);if((null==a?void 0:a.alpha())>=b){var l=i._adjustBrightness(a,t,{isBgColor:k,isTextShadow:_,isTextColor:A>-1,isBorderColor:D,hasInlineColor:j},r,n),d=!E&&l.newColor;if(I+=l.extStyle,k||A>=5){var y=d?d.toString():e;0===V&&rt(t).forEach(function(t){k?(t[s]=y,t[h]=(t[h]||C.defaultLightBgColor).split(g).concat(e).join(g)):(t[u]=y,t[c]=e);var r=ne(y);k&&(null==r?void 0:r.alpha())>=b&&t[f]&&delete t[f]})}return d&&(v=!0),V++,d||e}return e}).replace(/\s?!\s?important/gi,"")}if(I&&(q+=I),!(t instanceof SVGElement)){var z=/^background/.test(l),K=/^(-webkit-)?border-image/.test(l);if((z||K)&&/url\([^)]*\)/i.test(m)){v=!0;var H=ie((t[h]||C.defaultLightBgColor).split(g),"normal").toString();if(m=m.replace(/^(.*?)url\(([^)]*)\)(.*)$/i,function(e){var r=e,o="";return t[f]||rt(t).forEach(function(t){t[f]=!0}),z?(o=ke.genCssKV(l,H?"".concat(r,",linear-gradient(").concat(H,", ").concat(H,")"):r),B&&(q+=ke.genCssKV("background-position",B),o+=ke.genCssKV("background-position",H?"".concat(B,",top left"):B)),T&&(q+=ke.genCssKV("background-size",T),o+=ke.genCssKV("background-size",H?"".concat(T,",100%"):T)),n||(L?(S+=ke.genCss(L,o),rt(t).forEach(function(t){t[d]=H||r})):we.push(t,o,function(t){var e=[t.elOld];t.el!==t.elOld&&e.push(t.el),e.forEach(function(t){rt(t).forEach(function(t){t[d]=H||r})})}))):!H||P||n||(o=ke.genCssKV("background-image","linear-gradient(".concat(H,", ").concat(H,")")),L?S+=ke.genCss(L,o):we.push(t,o)),r}),!j){var J=t[c]||C.defaultLightTextColor;q+=ke.genCssKV("color",J),rt(t).forEach(function(t){t[u]=J})}}}(v||n)&&(!r&&!n&&w.test(a)&&(O[l]=a.replace(w,"")),F?n||(L?(S+=ke.genCss(L,ke.genCssKV(l,m)),/^background/.test(l)&&!/url\([^)]*\)/i.test(m)&&(y+=i._updateBgWithGradient(o,t,L,e,j,r,n))):we.push(t,ke.genCssKV(l,m),function(a){/^background/.test(l)&&!/url\([^)]*\)/i.test(m)&&(y+=i._updateBgWithGradient(o,t,a.className,e,j,r,n))})):("color"===l&&(R=!1,ke.unwatch("color")),q+=ke.genCssKV(l,!v&&n?t.style[l]:m)))})}),R&&(q+=ke.genCssKV("color",t.style.color||t[u]||C.defaultDarkTextColor),ke.unwatch("color")),q&&(N||(N="".concat(o).concat(this._idx++),t.classList.add(N)),y+=q?ke.genCss(N,q):""),y+=S,r||!function(t){return t.textContent.replace(/\s/g,"").length>0}(t)||n||(C.delayBgJudge?ve.push(t):we.contains(t,function(t){y+=ke.genCss(t.className,t.cssKV),"function"==typeof t.cb&&t.cb(t)}))}return me.emit("afterConvertNode".concat(l),t),y}},{key:"getContrast",value:function(t,e){var r=ne(t),n=ne(e);return r&&n?r.contrast(n):0}}])}(),me=new D,ve=new q("".concat(o,"text__")),we=new K("".concat(o,"bg__")),ke=new W,xe=new ot,Me=new pe;function Ce(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var Se=new RegExp("".concat(o,"[^ ]+"),"g"),_e=null,Oe=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{type:"dom"};if(e.force&&(ke.isFinish=!1),!ke.isFinish)try{Me.isDarkmode=C.mode?"dark"===C.mode:t.matches,"dom"===e.type?(Me.isDarkmode&&"function"==typeof C.begin&&C.begin(xe.hasDelay()),Array.prototype.forEach.call(xe.get(),function(t){if(Me.isDarkmode&&t.className&&"string"==typeof t.className&&(t.className=t.className.replace(Se,"")),Me.isDarkmode||me.length)if(C.needJudgeFirstPage){var e=t.getBoundingClientRect(),r=e.top,n=e.bottom;r<=0&&n<=0?ke.addCss(Me.convert(t)):r>0&&r<y||n>0&&n<y?(xe.addFirstPageNode(t),ke.addCss(Me.convert(t),!0)):(C.needJudgeFirstPage=!1,ke.writeStyle(!0),xe.showFirstPageNodes(),"function"==typeof C.showFirstPage&&C.showFirstPage(),ke.addCss(Me.convert(t)))}else ke.addCss(Me.convert(t))}),me.loopTimes++):"bg"===e.type&&Me.isDarkmode&&ve.forEach(function(t){return we.contains(t,function(t){ke.addCss(ke.genCss(t.className,t.cssKV)),"function"==typeof t.cb&&t.cb(t);var e=[t.elOld];t.elOld!==t.el&&e.push(t.el),e.forEach(function(t){var e,r,n,o,a,i,l=[[u,null!==(e=t[u])&&void 0!==e?e:null],[s,null!==(r=t[s])&&void 0!==r?r:null],[c,null!==(n=t[c])&&void 0!==n?n:null],[h,null!==(o=t[h])&&void 0!==o?o:null],[f,null!==(a=t[f])&&void 0!==a?a:null],[d,null!==(i=t[d])&&void 0!==i?i:null]],g=rt(t,!0);g.forEach(function(t){l.forEach(function(e){var r=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,l=[],u=!0,s=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Ce(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ce(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,2),n=r[0],o=r[1];null===o?delete t[n]:t[n]=o})}),g.forEach(function(t){ke.addCss(Me.convert(t,void 0,!1,!0))})})})}),(C.needJudgeFirstPage||!C.needJudgeFirstPage&&!xe.showFirstPage)&&"function"==typeof C.showFirstPage&&C.showFirstPage(),ke.writeStyle(),xe.emptyFirstPageNodes(),Me.isDarkmode||(C.needJudgeFirstPage=!1,C.delayBgJudge=!1,null===C.container&&"dom"===e.type&&xe.length&&xe.delay())}catch(t){console.log("An error occurred when running the dark mode conversion algorithm\n",t),"function"==typeof C.error&&C.error(t)}};function je(t,e){Pe(e),xe.set(t),Oe(_e,{force:!0,type:"dom"})}function Pe(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!C.hasInit){C.hasInit=!0;var r=C.whitelist.tagName,n=C.whitelist.attribute;t.whitelist&&(t.whitelist.tagName instanceof Array&&t.whitelist.tagName.forEach(function(t){t=t.toUpperCase(),-1===r.indexOf(t)&&r.push(t)}),t.whitelist.attribute instanceof Array&&t.whitelist.attribute.forEach(function(t){-1===n.indexOf(t)&&n.push(t)})),["dark","light"].indexOf(t.mode)>-1&&(C.set("string",t,"mode"),"dark"===t.mode&&document.getElementsByTagName("html")[0].classList.add(i)),C.set("function",t,"begin"),C.set("function",t,"showFirstPage"),C.set("function",t,"error"),C.set("boolean",t,"needJudgeFirstPage"),C.set("boolean",t,"delayBgJudge"),C.set("dom",t,"container"),C.set("string",t,"cssSelectorsPrefix"),C.set("string",t,"defaultLightTextColor"),C.set("string",t,"defaultLightBgColor"),C.set("string",t,"defaultDarkTextColor"),C.set("string",t,"defaultDarkBgColor"),Me.init(),!C.mode&&null===_e&&window.matchMedia&&(_e=window.matchMedia(e)).addListener(Oe)}}function Ee(t){xe.set(t),null!==C.container&&(we.update(t),ve.update(t)),Oe(_e,{force:!0,type:"bg"})}function Be(t,e){ke.isFinish&&(ke.addCss(Me.convert(t,e?Object.keys(e).map(function(t){return[t,e[t]]}):void 0,!0),!1),ke.writeStyle())}function Te(t,e){return Me.getContrast(t,e)}function Ae(t){t.forEach(function(t){return me.extend(t)})}})(),n})());
1
+ !function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("Darkmode",[],r):"object"==typeof exports?exports.Darkmode=r():e.Darkmode=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=0)}([function(e,r,t){"use strict";t.r(r),t.d(r,"run",(function(){return mu})),t.d(r,"init",(function(){return bu})),t.d(r,"convertBg",(function(){return yu})),t.d(r,"updateStyle",(function(){return wu})),t.d(r,"getContrast",(function(){return Mu})),t.d(r,"extend",(function(){return ku}));var n={};t.r(n),t.d(n,"color",(function(){return Yr})),t.d(n,"colorBurn",(function(){return Jr})),t.d(n,"colorDodge",(function(){return Wr})),t.d(n,"darken",(function(){return qr})),t.d(n,"difference",(function(){return Gr})),t.d(n,"exclusion",(function(){return Vr})),t.d(n,"hardLight",(function(){return $r})),t.d(n,"hue",(function(){return Kr})),t.d(n,"lighten",(function(){return Hr})),t.d(n,"luminosity",(function(){return Zr})),t.d(n,"multiply",(function(){return Nr})),t.d(n,"normal",(function(){return Ir})),t.d(n,"overlay",(function(){return Fr})),t.d(n,"saturation",(function(){return Ur})),t.d(n,"screen",(function(){return zr})),t.d(n,"softLight",(function(){return Xr}));var a="(prefers-color-scheme: dark)",o=new RegExp("".concat("js_darkmode__","\\d+")),i="data_color_scheme_dark",u="".concat(1*new Date).concat(Math.round(10*Math.random())),s="data-darkmode-color-".concat(u),c="data-darkmode-bgcolor-".concat(u),l="data-darkmode-original-color-".concat(u),f="data-darkmode-original-bgcolor-".concat(u),h="data-darkmode-bgimage-".concat(u),d="data-darkmode-complementary-bgimagecolor-".concat(u),p=window.getInnerHeight&&window.getInnerHeight()||window.innerHeight||document.documentElement.clientHeight,g={BG_COLOR:["background-color","background-image","background"],TEXT_SHADOW:["text-shadow"],TEXT_COLOR:["-webkit-text-stroke","-webkit-text-stroke-color","text-decoration","text-decoration-color","text-emphasis-color","color","-webkit-text-fill-color"],BORDER_COLOR:["border-image","-webkit-border-image","border","border-top","border-right","border-bottom","border-left","border-color","border-top-color","border-right-color","border-bottom-color","border-left-color","border-block-color","border-block-start-color","border-block-end-color","border-inline-color","border-inline-start-color","border-inline-end-color","outline","outline-color","box-shadow","column-rule","column-rule-color"]},v=Object.keys(g).map((function(e){return g[e].join("|")})).join("|").split("|"),m=["TABLE","TR","TD","TH"],b=/ !important$/,y=/<\$#_SEMICOLON_#\$>/g,w="\\b((rgba?)|((ok)?lch)|((ok)?lab)|(color))\\([^)]+\\)",M=new RegExp(w,"i"),k=new RegExp(w,"ig"),C={hasInit:!1,begin:null,showFirstPage:null,error:null,mode:"",whitelist:{tagName:["MPCPS","IFRAME"],attribute:[]},needJudgeFirstPage:!0,delayBgJudge:!1,container:null,cssSelectorsPrefix:"",defaultLightTextColor:"#191919",defaultLightBgColor:"#fff",defaultDarkTextColor:"#a3a3a3",defaultDarkBgColor:"#191919",set:function(e,r,t){var n=r[t];switch(e){case"boolean":"boolean"==typeof n&&(this[t]=n);break;case"string":"string"==typeof n&&""!==n&&(this[t]=n);break;case"function":"function"==typeof n&&(this[t]=n);break;case"dom":n instanceof HTMLElement&&(this[t]=n)}}};function x(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function O(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function S(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _(e,r,t){return r&&S(e.prototype,r),t&&S(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var j=[],B=[],E=function(){function e(){O(this,e)}return _(e,[{key:"loopTimes",get:function(){return iu.loopTimes}},{key:"isDarkmode",get:function(){return fu.isDarkmode}},{key:"addCss",value:function(e,r){var t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];(t?j:B).push(cu.genCss(e,r.map((function(e){var r=e.key,t=e.value;return cu.genCssKV(r,t)})).join("")))}}]),e}(),A=function(){function e(){O(this,e),x(this,"_plugins",[]),x(this,"length",0),x(this,"loopTimes",0),x(this,"firstPageStyle",""),x(this,"otherPageStyle",""),x(this,"firstPageStyleNoMQ",""),x(this,"otherPageStyleNoMQ","")}return _(e,[{key:"extend",value:function(e){this._plugins.push(new(e(E))),this.length++}},{key:"emit",value:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];this._plugins.forEach((function(r){"function"==typeof r[e]&&r[e].apply(r,t)}))}},{key:"addCss",value:function(e){e?(this.firstPageStyle+=j.join(""),this.firstPageStyleNoMQ+=B.join("")):(this.otherPageStyle+=j.join(""),this.otherPageStyleNoMQ+=B.join(""))}},{key:"resetCss",value:function(){j=[],B=[]}}]),e}();function P(e){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function R(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function T(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var L=function(){function e(r){!function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e),T(this,"_queue",[]),T(this,"_idx",0),this._prefix=r}var r,t,n;return r=e,(t=[{key:"length",get:function(){return this._queue.length}},{key:"push",value:function(e){var r="".concat(this._prefix).concat(this._idx++);e.classList.add(r),this._queue.push({el:e,className:r,updated:!C.delayBgJudge})}},{key:"forEach",value:function(e){var r=[];for(this._queue.forEach((function(t,n){t.updated&&(r.unshift(n),P(e)&&e(t.el))}));r.length;)this._queue.splice(r.shift(),1)}},{key:"update",value:function(e){this._queue.forEach((function(r){r.updated||Array.prototype.some.call(e,(function(e){return!(1!==e.nodeType||!e.classList.contains(r.className)||(r.el=e,r.updated=!0,0))}))}))}}])&&R(r.prototype,t),n&&R(r,n),Object.defineProperty(r,"prototype",{writable:!1}),e}();function D(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function I(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var N=function(){function e(r){!function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e),I(this,"_stack",[]),I(this,"_idx",0),this._prefix=r,this.classNameReg=new RegExp("".concat(this._prefix,"\\d+"))}var r,t,n;return r=e,(t=[{key:"push",value:function(e,r,t){var n="".concat(this._prefix).concat(this._idx++);e.classList.add(n),this._stack.unshift({elOld:e,el:e,className:n,cssKV:r,updated:!C.delayBgJudge,cb:t})}},{key:"contains",value:function(e,r){var t=e.getBoundingClientRect(),n=[];for(this._stack.forEach((function(e,r){if(e.updated){e.rect||(e.rect=e.el.getBoundingClientRect());var a=e.rect;t.top>=a.bottom||t.bottom<=a.top||t.left>=a.right||t.right<=a.left||n.unshift(r)}}));n.length;){var a=n.shift(),o=this._stack.splice(a,1)[0];"function"==typeof r&&r(o)}}},{key:"update",value:function(e){this._stack.forEach((function(r){r.updated||Array.prototype.some.call(e,(function(e){return!(1!==e.nodeType||!e.classList.contains(r.className)||(r.el=e,r.updated=!0,0))}))}))}}])&&D(r.prototype,t),n&&D(r,n),Object.defineProperty(r,"prototype",{writable:!1}),e}();function z(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var n,a,o=[],i=!0,u=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(o.push(n.value),!r||o.length!==r);i=!0);}catch(e){u=!0,a=e}finally{try{i||null==t.return||t.return()}finally{if(u)throw a}}return o}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return F(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return F(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function F(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function q(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function H(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var W=function(){function e(){!function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e),H(this,"_firstPageStyle",""),H(this,"_otherPageStyle",""),H(this,"_watcher",{}),H(this,"isFinish",!1)}var r,t,n;return r=e,(t=[{key:"genCssKV",value:function(e,r){var t,n;return null===(t=(n=this._watcher)[e])||void 0===t||t.call(n),"".concat(e,": ").concat(r," !important;")}},{key:"genCss",value:function(e,r){return"".concat("dark"===C.mode?"html.".concat(i," "):"").concat(C.cssSelectorsPrefix&&"".concat(C.cssSelectorsPrefix," "),".").concat(e,"{").concat(r,"}")}},{key:"addCss",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this[r?"_firstPageStyle":"_otherPageStyle"]+=e,iu.addCss(r)}},{key:"writeStyle",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];!e&&fu.isDarkmode&&(this.isFinish=!0);var r=(fu.isDarkmode?[{target:this,key:["_firstPageStyle","_otherPageStyle"],needMediaQuery:!0}]:[]).concat([{target:iu,key:["firstPageStyle","otherPageStyle"],needMediaQuery:!0},{target:iu,key:["firstPageStyleNoMQ","otherPageStyleNoMQ"],needMediaQuery:!1}]).map((function(r){var t=r.target,n=z(r.key,2),o=n[0],i=n[1],u=r.needMediaQuery,s="";e?s=o:(t[i]=t[o]+t[i],t[o]="",s=i);var c=t[s];return c?(t[s]="","dark"!==C.mode&&u?"@media ".concat(a," {").concat(c,"}"):c):""})).join("");r&&document.head.insertAdjacentHTML("beforeend",'<style type="text/css">'.concat(r,"</style>"))}},{key:"watch",value:function(e,r){this._watcher[e]=r}},{key:"unwatch",value:function(e){delete this._watcher[e]}}])&&q(r.prototype,t),n&&q(r,n),Object.defineProperty(r,"prototype",{writable:!1}),e}();function J(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function $(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function X(e){return function(e){if(Array.isArray(e))return G(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,r){if(!e)return;if("string"==typeof e)return G(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return G(e,r)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function G(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function V(e){var r,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(r=t?[]:[e]).concat.apply(r,X(e.querySelectorAll("*")))}var K={"ue-table-interlace-color-single":"#fcfcfc","ue-table-interlace-color-double":"#f7faff"};var U=function(){function e(){!function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e),$(this,"_els",[]),$(this,"_firstPageEls",[]),$(this,"_delayEls",[]),$(this,"showFirstPage",!1)}var r,t,n;return r=e,(t=[{key:"length",get:function(){return this._els.length}},{key:"set",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this._els=e}},{key:"get",value:function(){var e=[];return this._els.length?(e=this._els,fu.isDarkmode&&(this._els=[])):this._delayEls.length?(e=this._delayEls,this._delayEls=[]):C.container&&(e=C.container.querySelectorAll("*")),e}},{key:"delay",value:function(){var e=this;Array.prototype.forEach.call(this._els,(function(r){return e._delayEls.push(r)})),this._els=[]}},{key:"hasDelay",value:function(){return!this._els.length&&(this._delayEls.length>0||null!==C.container)}},{key:"addFirstPageNode",value:function(e){this._firstPageEls.push(e)}},{key:"showFirstPageNodes",value:function(){this._firstPageEls.forEach((function(e){return!e.style.visibility&&(e.style.visibility="visible")})),this.showFirstPage=!0}},{key:"emptyFirstPageNodes",value:function(){this._firstPageEls=[]}}])&&J(r.prototype,t),n&&J(r,n),Object.defineProperty(r,"prototype",{writable:!1}),e}();const Y={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(const e in Y)Object.freeze(Y[e]);var Z=Object.freeze(Y);const Q=Object.create(null);for(const e in Z)Object.hasOwn(Z,e)&&(Q[Z[e]]=e);const ee={to:{},get:{}};function re(e,r,t){return Math.min(Math.max(r,e),t)}function te(e){const r=Math.round(e).toString(16).toUpperCase();return r.length<2?"0"+r:r}ee.get=function(e){let r,t;switch(e.slice(0,3).toLowerCase()){case"hsl":r=ee.get.hsl(e),t="hsl";break;case"hwb":r=ee.get.hwb(e),t="hwb";break;default:r=ee.get.rgb(e),t="rgb"}return r?{model:t,value:r}:null},ee.get.rgb=function(e){if(!e)return null;let r,t,n,a=[0,0,0,1];if(r=e.match(/^#([a-f\d]{6})([a-f\d]{2})?$/i)){for(n=r[2],r=r[1],t=0;t<3;t++){const e=2*t;a[t]=Number.parseInt(r.slice(e,e+2),16)}n&&(a[3]=Number.parseInt(n,16)/255)}else if(r=e.match(/^#([a-f\d]{3,4})$/i)){for(r=r[1],n=r[3],t=0;t<3;t++)a[t]=Number.parseInt(r[t]+r[t],16);n&&(a[3]=Number.parseInt(n+n,16)/255)}else if(r=e.match(/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i)){for(t=0;t<3;t++)a[t]=Number.parseFloat(r[t+1]);r[4]&&(a[3]=r[5]?.01*Number.parseFloat(r[4]):Number.parseFloat(r[4]))}else{if(!(r=e.match(/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/i)))return(r=e.toLowerCase().match(/^(\w+)$/))?"transparent"===r[1]?[0,0,0,0]:Object.hasOwn(Z,r[1])?(a=Z[r[1]].slice(),a[3]=1,a):null:null;for(t=0;t<3;t++)a[t]=Math.round(2.55*Number.parseFloat(r[t+1]));r[4]&&(a[3]=r[5]?.01*Number.parseFloat(r[4]):Number.parseFloat(r[4]))}for(t=0;t<3;t++)a[t]=re(a[t],0,255);return a[3]=re(a[3],0,1),a},ee.get.hsl=function(e){if(!e)return null;const r=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i);if(r){const e=Number.parseFloat(r[4]);return[(Number.parseFloat(r[1])%360+360)%360,re(Number.parseFloat(r[2]),0,100),re(Number.parseFloat(r[3]),0,100),re(Number.isNaN(e)?1:e,0,1)]}return null},ee.get.hwb=function(e){if(!e)return null;const r=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:e[+-]?\d+)?)\s*)?\)$/i);if(r){const e=Number.parseFloat(r[4]);return[(Number.parseFloat(r[1])%360+360)%360,re(Number.parseFloat(r[2]),0,100),re(Number.parseFloat(r[3]),0,100),re(Number.isNaN(e)?1:e,0,1)]}return null},ee.to.hex=function(...e){return"#"+te(e[0])+te(e[1])+te(e[2])+(e[3]<1?te(Math.round(255*e[3])):"")},ee.to.rgb=function(...e){return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},ee.to.rgb.percent=function(...e){const r=Math.round(e[0]/255*100),t=Math.round(e[1]/255*100),n=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+r+"%, "+t+"%, "+n+"%)":"rgba("+r+"%, "+t+"%, "+n+"%, "+e[3]+")"},ee.to.hsl=function(...e){return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},ee.to.hwb=function(...e){let r="";return e.length>=4&&1!==e[3]&&(r=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+r+")"},ee.to.keyword=function(...e){return Q[e.slice(0,3)]};var ne=ee;function ae(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var n,a,o=[],i=!0,u=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(o.push(n.value),!r||o.length!==r);i=!0);}catch(e){u=!0,a=e}finally{try{i||null==t.return||t.return()}finally{if(u)throw a}}return o}(e,r)||ie(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function oe(e){return function(e){if(Array.isArray(e))return ue(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ie(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ie(e,r){if(e){if("string"==typeof e)return ue(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ue(e,r):void 0}}function ue(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}for(var se={},ce=0,le=Object.keys(Z);ce<le.length;ce++){var fe=le[ce];se[Z[fe]]=fe}var he={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},de=he,pe=Math.pow(6/29,3);function ge(e){var r=e>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e;return Math.min(Math.max(0,r),1)}function ve(e){return e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92}for(var me=0,be=Object.keys(he);me<be.length;me++){var ye=be[me];if(!("channels"in he[ye]))throw new Error("missing channels property: "+ye);if(!("labels"in he[ye]))throw new Error("missing channel labels property: "+ye);if(he[ye].labels.length!==he[ye].channels)throw new Error("channel and label counts mismatch: "+ye);var we=he[ye],Me=we.channels,ke=we.labels;delete he[ye].channels,delete he[ye].labels,Object.defineProperty(he[ye],"channels",{value:Me}),Object.defineProperty(he[ye],"labels",{value:ke})}function Ce(e,r){return Math.pow(e[0]-r[0],2)+Math.pow(e[1]-r[1],2)+Math.pow(e[2]-r[2],2)}function xe(e){var r=function(){for(var e={},r=Object.keys(de),t=r.length,n=0;n<t;n++)e[r[n]]={distance:-1,parent:null};return e}(),t=[e];for(r[e].distance=0;t.length>0;)for(var n=t.pop(),a=Object.keys(de[n]),o=a.length,i=0;i<o;i++){var u=a[i],s=r[u];-1===s.distance&&(s.distance=r[n].distance+1,s.parent=n,t.unshift(u))}return r}function Oe(e,r){return function(t){return r(e(t))}}function Se(e,r){for(var t=[r[e].parent,e],n=de[r[e].parent][e],a=r[e].parent;r[a].parent;)t.unshift(r[a].parent),n=Oe(de[r[a].parent][a],n),a=r[a].parent;return n.conversion=t,n}he.rgb.hsl=function(e){var r,t=e[0]/255,n=e[1]/255,a=e[2]/255,o=Math.min(t,n,a),i=Math.max(t,n,a),u=i-o;switch(i){case o:r=0;break;case t:r=(n-a)/u;break;case n:r=2+(a-t)/u;break;case a:r=4+(t-n)/u}(r=Math.min(60*r,360))<0&&(r+=360);var s=(o+i)/2;return[r,100*(i===o?0:s<=.5?u/(i+o):u/(2-i-o)),100*s]},he.rgb.hsv=function(e){var r,t,n,a,o,i=e[0]/255,u=e[1]/255,s=e[2]/255,c=Math.max(i,u,s),l=c-Math.min(i,u,s),f=function(e){return(c-e)/6/l+.5};if(0===l)a=0,o=0;else{switch(o=l/c,r=f(i),t=f(u),n=f(s),c){case i:a=n-t;break;case u:a=1/3+r-n;break;case s:a=2/3+t-r}a<0?a+=1:a>1&&(a-=1)}return[360*a,100*o,100*c]},he.rgb.hwb=function(e){var r=e[0],t=e[1],n=e[2];return[he.rgb.hsl(e)[0],100*(1/255*Math.min(r,Math.min(t,n))),100*(n=1-1/255*Math.max(r,Math.max(t,n)))]},he.rgb.oklab=function(e){var r=ve(e[0]/255),t=ve(e[1]/255),n=ve(e[2]/255),a=Math.cbrt(.4122214708*r+.5363325363*t+.0514459929*n),o=Math.cbrt(.2119034982*r+.6806995451*t+.1073969566*n),i=Math.cbrt(.0883024619*r+.2817188376*t+.6299787005*n);return[100*(.2104542553*a+.793617785*o-.0040720468*i),100*(1.9779984951*a-2.428592205*o+.4505937099*i),100*(.0259040371*a+.7827717662*o-.808675766*i)]},he.rgb.cmyk=function(e){var r=e[0]/255,t=e[1]/255,n=e[2]/255,a=Math.min(1-r,1-t,1-n);return[100*((1-r-a)/(1-a)||0),100*((1-t-a)/(1-a)||0),100*((1-n-a)/(1-a)||0),100*a]},he.rgb.keyword=function(e){var r=se[e];if(r)return r;for(var t,n=Number.POSITIVE_INFINITY,a=0,o=Object.keys(Z);a<o.length;a++){var i=o[a],u=Ce(e,Z[i]);u<n&&(n=u,t=i)}return t},he.keyword.rgb=function(e){return oe(Z[e])},he.rgb.xyz=function(e){var r=ve(e[0]/255),t=ve(e[1]/255),n=ve(e[2]/255);return[100*(.4124564*r+.3575761*t+.1804375*n),100*(.2126729*r+.7151522*t+.072175*n),100*(.0193339*r+.119192*t+.9503041*n)]},he.rgb.lab=function(e){var r=he.rgb.xyz(e),t=r[0],n=r[1],a=r[2];return n/=100,a/=108.883,t=(t/=95.047)>pe?Math.pow(t,1/3):7.787*t+16/116,[116*(n=n>pe?Math.pow(n,1/3):7.787*n+16/116)-16,500*(t-n),200*(n-(a=a>pe?Math.pow(a,1/3):7.787*a+16/116))]},he.hsl.rgb=function(e){var r,t,n=e[0]/360,a=e[1]/100,o=e[2]/100;if(0===a)return[t=255*o,t,t];for(var i=o<.5?o*(1+a):o+a-o*a,u=2*o-i,s=[0,0,0],c=0;c<3;c++)(r=n+1/3*-(c-1))<0&&r++,r>1&&r--,t=6*r<1?u+6*(i-u)*r:2*r<1?i:3*r<2?u+(i-u)*(2/3-r)*6:u,s[c]=255*t;return s},he.hsl.hsv=function(e){var r=e[0],t=e[1]/100,n=e[2]/100,a=t,o=Math.max(n,.01);return t*=(n*=2)<=1?n:2-n,a*=o<=1?o:2-o,[r,100*(0===n?2*a/(o+a):2*t/(n+t)),100*((n+t)/2)]},he.hsv.rgb=function(e){var r=e[0]/60,t=e[1]/100,n=e[2]/100,a=Math.floor(r)%6,o=r-Math.floor(r),i=255*n*(1-t),u=255*n*(1-t*o),s=255*n*(1-t*(1-o));switch(n*=255,a){case 0:return[n,s,i];case 1:return[u,n,i];case 2:return[i,n,s];case 3:return[i,u,n];case 4:return[s,i,n];case 5:return[n,i,u]}},he.hsv.hsl=function(e){var r,t,n=e[0],a=e[1]/100,o=e[2]/100,i=Math.max(o,.01);t=(2-a)*o;var u=(2-a)*i;return r=a*i,[n,100*(r=(r/=u<=1?u:2-u)||0),100*(t/=2)]},he.hwb.rgb=function(e){var r,t=e[0]/360,n=e[1]/100,a=e[2]/100,o=n+a;o>1&&(n/=o,a/=o);var i=Math.floor(6*t),u=1-a;r=6*t-i,0!=(1&i)&&(r=1-r);var s,c,l,f=n+r*(u-n);switch(i){default:case 6:case 0:s=u,c=f,l=n;break;case 1:s=f,c=u,l=n;break;case 2:s=n,c=u,l=f;break;case 3:s=n,c=f,l=u;break;case 4:s=f,c=n,l=u;break;case 5:s=u,c=n,l=f}return[255*s,255*c,255*l]},he.cmyk.rgb=function(e){var r=e[0]/100,t=e[1]/100,n=e[2]/100,a=e[3]/100;return[255*(1-Math.min(1,r*(1-a)+a)),255*(1-Math.min(1,t*(1-a)+a)),255*(1-Math.min(1,n*(1-a)+a))]},he.xyz.rgb=function(e){var r,t,n=e[0]/100,a=e[1]/100,o=e[2]/100;return r=-.969266*n+1.8760108*a+.041556*o,t=.0556434*n+-.2040259*a+1.0572252*o,[255*ge(3.2404542*n+-1.5371385*a+-.4985314*o),255*(r=ge(r)),255*(t=ge(t))]},he.xyz.lab=function(e){var r=e[0],t=e[1],n=e[2];return t/=100,n/=108.883,r=(r/=95.047)>pe?Math.pow(r,1/3):7.787*r+16/116,[116*(t=t>pe?Math.pow(t,1/3):7.787*t+16/116)-16,500*(r-t),200*(t-(n=n>pe?Math.pow(n,1/3):7.787*n+16/116))]},he.xyz.oklab=function(e){var r=e[0]/100,t=e[1]/100,n=e[2]/100,a=Math.cbrt(.8189330101*r+.3618667424*t-.1288597137*n),o=Math.cbrt(.0329845436*r+.9293118715*t+.0361456387*n),i=Math.cbrt(.0482003018*r+.2643662691*t+.633851707*n);return[100*(.2104542553*a+.793617785*o-.0040720468*i),100*(1.9779984951*a-2.428592205*o+.4505937099*i),100*(.0259040371*a+.7827717662*o-.808675766*i)]},he.oklab.oklch=function(e){return he.lab.lch(e)},he.oklab.xyz=function(e){var r=e[0]/100,t=e[1]/100,n=e[2]/100,a=Math.pow(.999999998*r+.396337792*t+.215803758*n,3),o=Math.pow(1.000000008*r-.105561342*t-.063854175*n,3),i=Math.pow(1.000000055*r-.089484182*t-1.291485538*n,3);return[100*(1.227013851*a-.55779998*o+.281256149*i),100*(-.040580178*a+1.11225687*o-.071676679*i),100*(-.076381285*a-.421481978*o+1.58616322*i)]},he.oklab.rgb=function(e){var r=e[0]/100,t=e[1]/100,n=e[2]/100,a=Math.pow(r+.3963377774*t+.2158037573*n,3),o=Math.pow(r-.1055613458*t-.0638541728*n,3),i=Math.pow(r-.0894841775*t-1.291485548*n,3);return[255*ge(4.0767416621*a-3.3077115913*o+.2309699292*i),255*ge(-1.2684380046*a+2.6097574011*o-.3413193965*i),255*ge(-.0041960863*a-.7034186147*o+1.707614701*i)]},he.oklch.oklab=function(e){return he.lch.lab(e)},he.lab.xyz=function(e){var r,t,n,a=e[0];r=e[1]/500+(t=(a+16)/116),n=t-e[2]/200;var o=Math.pow(t,3),i=Math.pow(r,3),u=Math.pow(n,3);return t=o>pe?o:(t-16/116)/7.787,r=i>pe?i:(r-16/116)/7.787,n=u>pe?u:(n-16/116)/7.787,[r*=95.047,t*=100,n*=108.883]},he.lab.lch=function(e){var r,t=e[0],n=e[1],a=e[2];return(r=360*Math.atan2(a,n)/2/Math.PI)<0&&(r+=360),[t,Math.sqrt(n*n+a*a),r]},he.lch.lab=function(e){var r=e[0],t=e[1],n=e[2]/360*2*Math.PI;return[r,t*Math.cos(n),t*Math.sin(n)]},he.rgb.ansi16=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,t=ae(e,3),n=t[0],a=t[1],o=t[2],i=null===r?he.rgb.hsv(e)[2]:r;if(0===(i=Math.round(i/50)))return 30;var u=30+(Math.round(o/255)<<2|Math.round(a/255)<<1|Math.round(n/255));return 2===i&&(u+=60),u},he.hsv.ansi16=function(e){return he.rgb.ansi16(he.hsv.rgb(e),e[2])},he.rgb.ansi256=function(e){var r=e[0],t=e[1],n=e[2];return r>>4==t>>4&&t>>4==n>>4?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},he.ansi16.rgb=function(e){var r=(e=e[0])%10;if(0===r||7===r)return e>50&&(r+=3.5),[r=r/10.5*255,r,r];var t=.5*(Math.trunc(e>50)+1);return[(1&r)*t*255,(r>>1&1)*t*255,(r>>2&1)*t*255]},he.ansi256.rgb=function(e){if((e=e[0])>=232){var r=10*(e-232)+8;return[r,r,r]}var t;return e-=16,[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},he.rgb.hex=function(e){var r=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".slice(r.length)+r},he.hex.rgb=function(e){var r=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!r)return[0,0,0];var t=r[0];3===r[0].length&&(t=oe(t).map((function(e){return e+e})).join(""));var n=Number.parseInt(t,16);return[n>>16&255,n>>8&255,255&n]},he.rgb.hcg=function(e){var r,t=e[0]/255,n=e[1]/255,a=e[2]/255,o=Math.max(Math.max(t,n),a),i=Math.min(Math.min(t,n),a),u=o-i;return r=u<=0?0:o===t?(n-a)/u%6:o===n?2+(a-t)/u:4+(t-n)/u,r/=6,[360*(r%=1),100*u,100*(u<1?i/(1-u):0)]},he.hsl.hcg=function(e){var r=e[1]/100,t=e[2]/100,n=t<.5?2*r*t:2*r*(1-t),a=0;return n<1&&(a=(t-.5*n)/(1-n)),[e[0],100*n,100*a]},he.hsv.hcg=function(e){var r=e[1]/100,t=e[2]/100,n=r*t,a=0;return n<1&&(a=(t-n)/(1-n)),[e[0],100*n,100*a]},he.hcg.rgb=function(e){var r=e[0]/360,t=e[1]/100,n=e[2]/100;if(0===t)return[255*n,255*n,255*n];var a,o=[0,0,0],i=r%1*6,u=i%1,s=1-u;switch(Math.floor(i)){case 0:o[0]=1,o[1]=u,o[2]=0;break;case 1:o[0]=s,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=u;break;case 3:o[0]=0,o[1]=s,o[2]=1;break;case 4:o[0]=u,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=s}return a=(1-t)*n,[255*(t*o[0]+a),255*(t*o[1]+a),255*(t*o[2]+a)]},he.hcg.hsv=function(e){var r=e[1]/100,t=r+e[2]/100*(1-r),n=0;return t>0&&(n=r/t),[e[0],100*n,100*t]},he.hcg.hsl=function(e){var r=e[1]/100,t=e[2]/100*(1-r)+.5*r,n=0;return t>0&&t<.5?n=r/(2*t):t>=.5&&t<1&&(n=r/(2*(1-t))),[e[0],100*n,100*t]},he.hcg.hwb=function(e){var r=e[1]/100,t=r+e[2]/100*(1-r);return[e[0],100*(t-r),100*(1-t)]},he.hwb.hcg=function(e){var r=e[1]/100,t=1-e[2]/100,n=t-r,a=0;return n<1&&(a=(t-n)/(1-n)),[e[0],100*n,100*a]},he.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},he.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},he.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},he.gray.hsl=function(e){return[0,0,e[0]]},he.gray.hsv=he.gray.hsl,he.gray.hwb=function(e){return[0,100,e[0]]},he.gray.cmyk=function(e){return[0,0,0,e[0]]},he.gray.lab=function(e){return[e[0],0,0]},he.gray.hex=function(e){var r=255&Math.round(e[0]/100*255),t=((r<<16)+(r<<8)+r).toString(16).toUpperCase();return"000000".slice(t.length)+t},he.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};var _e=function(e){for(var r=xe(e),t={},n=Object.keys(r),a=n.length,o=0;o<a;o++){var i=n[o];null!==r[i].parent&&(t[i]=Se(i,r))}return t};function je(e){return(je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Be={};function Ee(e){var r=function(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];var a=t[0];return null==a?a:(a.length>1&&(t=a),e(t))};return"conversion"in e&&(r.conversion=e.conversion),r}function Ae(e){var r=function(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];var a=t[0];if(null==a)return a;a.length>1&&(t=a);var o=e(t);if("object"===je(o))for(var i=o.length,u=0;u<i;u++)o[u]=Math.round(o[u]);return o};return"conversion"in e&&(r.conversion=e.conversion),r}for(var Pe=0,Re=Object.keys(de);Pe<Re.length;Pe++){var Te=Re[Pe];Be[Te]={},Object.defineProperty(Be[Te],"channels",{value:de[Te].channels}),Object.defineProperty(Be[Te],"labels",{value:de[Te].labels});for(var Le=_e(Te),De=0,Ie=Object.keys(Le);De<Ie.length;De++){var Ne=Ie[De],ze=Le[Ne];Be[Te][Ne]=Ae(ze),Be[Te][Ne].raw=Ee(ze)}}var Fe=Be;function qe(e){return(qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function He(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var n,a,o=[],i=!0,u=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(o.push(n.value),!r||o.length!==r);i=!0);}catch(e){u=!0,a=e}finally{try{i||null==t.return||t.return()}finally{if(u)throw a}}return o}(e,r)||$e(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function We(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=$e(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,u=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){u=!0,o=e},f:function(){try{i||null==t.return||t.return()}finally{if(u)throw o}}}}function Je(e){return function(e){if(Array.isArray(e))return Xe(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||$e(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $e(e,r){if(e){if("string"==typeof e)return Xe(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Xe(e,r):void 0}}function Xe(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}for(var Ge=["keyword","gray","hex"],Ve={},Ke=0,Ue=Object.keys(Fe);Ke<Ue.length;Ke++){var Ye=Ue[Ke];Ve[Je(Fe[Ye].labels).sort().join("")]=Ye}var Ze={};function Qe(e,r){if(!(this instanceof Qe))return new Qe(e,r);if(r&&r in Ge&&(r=null),r&&!(r in Fe))throw new Error("Unknown model: "+r);var t,n;if(null==e)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof Qe)this.model=e.model,this.color=Je(e.color),this.valpha=e.valpha;else if("string"==typeof e){var a=ne.get(e);if(null===a)throw new Error("Unable to parse color from string: "+e);this.model=a.model,n=Fe[this.model].channels,this.color=a.value.slice(0,n),this.valpha="number"==typeof a.value[n]?a.value[n]:1}else if(e.length>0){this.model=r||"rgb",n=Fe[this.model].channels;var o=Array.prototype.slice.call(e,0,n);this.color=ir(o,n),this.valpha="number"==typeof e[n]?e[n]:1}else if("number"==typeof e)this.model="rgb",this.color=[e>>16&255,e>>8&255,255&e],this.valpha=1;else{this.valpha=1;var i=Object.keys(e);"alpha"in e&&(i.splice(i.indexOf("alpha"),1),this.valpha="number"==typeof e.alpha?e.alpha:0);var u=i.sort().join("");if(!(u in Ve))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=Ve[u];var s=Fe[this.model].labels,c=[];for(t=0;t<s.length;t++)c.push(e[s[t]]);this.color=ir(c)}if(Ze[this.model])for(n=Fe[this.model].channels,t=0;t<n;t++){var l=Ze[this.model][t];l&&(this.color[t]=l(this.color[t]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}Qe.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(e){var r,t=this.model in ne.to?this:this.rgb(),n=1===(t=t.round("number"==typeof e?e:1)).valpha?t.color:[].concat(Je(t.color),[this.valpha]);return(r=ne.to)[t.model].apply(r,Je(n))},percentString:function(e){var r,t=this.rgb().round("number"==typeof e?e:1),n=1===t.valpha?t.color:[].concat(Je(t.color),[this.valpha]);return(r=ne.to.rgb).percent.apply(r,Je(n))},array:function(){return 1===this.valpha?Je(this.color):[].concat(Je(this.color),[this.valpha])},object:function(){for(var e={},r=Fe[this.model].channels,t=Fe[this.model].labels,n=0;n<r;n++)e[t[n]]=this.color[n];return 1!==this.valpha&&(e.alpha=this.valpha),e},unitArray:function(){var e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,1!==this.valpha&&e.push(this.valpha),e},unitObject:function(){var e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,1!==this.valpha&&(e.alpha=this.valpha),e},round:function(e){return e=Math.max(e||0,0),new Qe([].concat(Je(this.color.map(function(e){return function(r){return function(e,r){return Number(e.toFixed(r))}(r,e)}}(e))),[this.valpha]),this.model)},alpha:function(e){return void 0!==e?new Qe([].concat(Je(this.color),[Math.max(0,Math.min(1,e))]),this.model):this.valpha},red:nr("rgb",0,ar(255)),green:nr("rgb",1,ar(255)),blue:nr("rgb",2,ar(255)),hue:nr(["hsl","hsv","hsl","hwb","hcg"],0,(function(e){return(e%360+360)%360})),saturationl:nr("hsl",1,ar(100)),lightness:nr("hsl",2,ar(100)),saturationv:nr("hsv",1,ar(100)),value:nr("hsv",2,ar(100)),chroma:nr("hcg",1,ar(100)),gray:nr("hcg",2,ar(100)),white:nr("hwb",1,ar(100)),wblack:nr("hwb",2,ar(100)),cyan:nr("cmyk",0,ar(100)),magenta:nr("cmyk",1,ar(100)),yellow:nr("cmyk",2,ar(100)),black:nr("cmyk",3,ar(100)),x:nr("xyz",0,ar(95.047)),y:nr("xyz",1,ar(100)),z:nr("xyz",2,ar(108.833)),l:nr("lab",0,ar(100)),a:nr("lab",1),b:nr("lab",2),keyword:function(e){return void 0!==e?new Qe(e):Fe[this.model].keyword(this.color)},hex:function(e){var r;return void 0!==e?new Qe(e):(r=ne.to).hex.apply(r,Je(this.rgb().round().color))},hexa:function(e){var r;if(void 0!==e)return new Qe(e);var t=this.rgb().round().color,n=Math.round(255*this.valpha).toString(16).toUpperCase();return 1===n.length&&(n="0"+n),(r=ne.to).hex.apply(r,Je(t))+n},rgbNumber:function(){var e=this.rgb().color;return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},luminosity:function(){var e,r=[],t=We(this.rgb().color.entries());try{for(t.s();!(e=t.n()).done;){var n=He(e.value,2),a=n[0],o=n[1]/255;r[a]=o<=.04045?o/12.92:Math.pow((o+.055)/1.055,2.4)}}catch(e){t.e(e)}finally{t.f()}return.2126*r[0]+.7152*r[1]+.0722*r[2]},contrast:function(e){var r=this.luminosity(),t=e.luminosity();return r>t?(r+.05)/(t+.05):(t+.05)/(r+.05)},level:function(e){var r=this.contrast(e);return r>=7?"AAA":r>=4.5?"AA":""},isDark:function(){var e=this.rgb().color;return(2126*e[0]+7152*e[1]+722*e[2])/1e4<128},isLight:function(){return!this.isDark()},negate:function(){for(var e=this.rgb(),r=0;r<3;r++)e.color[r]=255-e.color[r];return e},lighten:function(e){var r=this.hsl();return r.color[2]+=r.color[2]*e,r},darken:function(e){var r=this.hsl();return r.color[2]-=r.color[2]*e,r},saturate:function(e){var r=this.hsl();return r.color[1]+=r.color[1]*e,r},desaturate:function(e){var r=this.hsl();return r.color[1]-=r.color[1]*e,r},whiten:function(e){var r=this.hwb();return r.color[1]+=r.color[1]*e,r},blacken:function(e){var r=this.hwb();return r.color[2]+=r.color[2]*e,r},grayscale:function(){var e=this.rgb().color,r=.3*e[0]+.59*e[1]+.11*e[2];return Qe.rgb(r,r,r)},fade:function(e){return this.alpha(this.valpha-this.valpha*e)},opaquer:function(e){return this.alpha(this.valpha+this.valpha*e)},rotate:function(e){var r=this.hsl(),t=r.color[0];return t=(t=(t+e)%360)<0?360+t:t,r.color[0]=t,r},mix:function(e,r){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+qe(e));var t=e.rgb(),n=this.rgb(),a=void 0===r?.5:r,o=2*a-1,i=t.alpha()-n.alpha(),u=((o*i==-1?o:(o+i)/(1+o*i))+1)/2,s=1-u;return Qe.rgb(u*t.red()+s*n.red(),u*t.green()+s*n.green(),u*t.blue()+s*n.blue(),t.alpha()*a+n.alpha()*(1-a))}};for(var er=function(){var e=tr[rr];if(Ge.includes(e))return"continue";var r=Fe[e].channels;Qe.prototype[e]=function(){if(this.model===e)return new Qe(this);for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];return t.length>0?new Qe(t,e):new Qe([].concat(Je(or(Fe[this.model][e].raw(this.color))),[this.valpha]),e)},Qe[e]=function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];var o=n[0];return"number"==typeof o&&(o=ir(n,r)),new Qe(o,e)}},rr=0,tr=Object.keys(Fe);rr<tr.length;rr++)er();function nr(e,r,t){var n,a=We(e=Array.isArray(e)?e:[e]);try{for(a.s();!(n=a.n()).done;){var o=n.value;(Ze[o]||(Ze[o]=[]))[r]=t}}catch(e){a.e(e)}finally{a.f()}return e=e[0],function(n){var a;return void 0!==n?(t&&(n=t(n)),(a=this[e]()).color[r]=n,a):(a=this[e]().color[r],t&&(a=t(a)),a)}}function ar(e){return function(r){return Math.max(0,Math.min(e,r))}}function or(e){return Array.isArray(e)?e:[e]}function ir(e,r){for(var t=0;t<r;t++)"number"!=typeof e[t]&&(e[t]=0);return e}var ur=Qe;function sr(e,r,t){return{r:255*t(e.r/255,r.r/255),g:255*t(e.g/255,r.g/255),b:255*t(e.b/255,r.b/255)}}function cr(e,r){return r}function lr(e,r){return e*r}function fr(e,r){return e+r-e*r}function hr(e,r){return mr(r,e)}function dr(e,r){return Math.min(e,r)}function pr(e,r){return Math.min(Math.max(e,r),1)}function gr(e,r){return 0===e?0:1===r?1:Math.min(1,e/(1-r))}function vr(e,r){return 1===e?1:0===r?0:1-Math.min(1,(1-e)/r)}function mr(e,r){return r<=.5?lr(e,2*r):fr(e,2*r-1)}function br(e,r){return r<=.5?e-(1-2*r)*e*(1-e):e+(2*r-1)*((e<=.25?((16*e-12)*e+4)*e:Math.sqrt(e))-e)}function yr(e,r){return Math.abs(e-r)}function wr(e,r){return e+r-2*e*r}function Mr(e,r,t){return Math.min(Math.max(e||0,r),t)}function kr(e){return{r:Mr(e.r,0,255),g:Mr(e.g,0,255),b:Mr(e.b,0,255),a:Mr(e.a,0,1)}}function Cr(e){return{r:255*e.r,g:255*e.g,b:255*e.b,a:e.a}}function xr(e){return{r:e.r/255,g:e.g/255,b:e.b/255,a:e.a}}function Or(e,r){void 0===r&&(r=0);var t=Math.pow(10,r);return{r:Math.round(e.r*t)/t,g:Math.round(e.g*t)/t,b:Math.round(e.b*t)/t,a:e.a}}function Sr(e,r,t,n,a,o){return(1-r/t)*n+r/t*Math.round((1-e)*a+e*o)}function _r(e,r,t,n,a){void 0===a&&(a={unitInput:!1,unitOutput:!1,roundOutput:!0}),a.unitInput&&(e=Cr(e),r=Cr(r)),e=kr(e);var o=(r=kr(r)).a+e.a-r.a*e.a,i=t(e,r,n),u=kr({r:Sr(e.a,r.a,o,e.r,r.r,i.r),g:Sr(e.a,r.a,o,e.g,r.g,i.g),b:Sr(e.a,r.a,o,e.b,r.b,i.b),a:o});return u=a.unitOutput?xr(u):a.roundOutput?Or(u):function(e){return Or(e,9)}(u)}function jr(e,r,t){return Cr(t(xr(e),xr(r)))}function Br(e){return.3*e.r+.59*e.g+.11*e.b}function Er(e,r){var t=r-Br(e);return function(e){var r=Br(e),t=e.r,n=e.g,a=e.b,o=Math.min(t,n,a),i=Math.max(t,n,a);function u(e){return r+(e-r)*r/(r-o)}function s(e){return r+(e-r)*(1-r)/(i-r)}return o<0&&(t=u(t),n=u(n),a=u(a)),i>1&&(t=s(t),n=s(n),a=s(a)),{r:t,g:n,b:a}}({r:e.r+t,g:e.g+t,b:e.b+t})}function Ar(e){return Math.max(e.r,e.g,e.b)-Math.min(e.r,e.g,e.b)}function Pr(e,r){var t=["r","g","b"].sort((function(r,t){return e[r]-e[t]})),n=t[0],a=t[1],o=t[2],i={r:e.r,g:e.g,b:e.b};return i[o]>i[n]?(i[a]=(i[a]-i[n])*r/(i[o]-i[n]),i[o]=r):i[a]=i[o]=0,i[n]=0,i}function Rr(e,r){return Er(Pr(r,Ar(e)),Br(e))}function Tr(e,r){return Er(Pr(e,Ar(r)),Br(e))}function Lr(e,r){return Er(r,Br(e))}function Dr(e,r){return Er(e,Br(r))}function Ir(e,r){return _r(e,r,sr,cr)}function Nr(e,r){return _r(e,r,sr,lr)}function zr(e,r){return _r(e,r,sr,fr)}function Fr(e,r){return _r(e,r,sr,hr)}function qr(e,r){return _r(e,r,sr,dr)}function Hr(e,r){return _r(e,r,sr,pr)}function Wr(e,r){return _r(e,r,sr,gr)}function Jr(e,r){return _r(e,r,sr,vr)}function $r(e,r){return _r(e,r,sr,mr)}function Xr(e,r){return _r(e,r,sr,br)}function Gr(e,r){return _r(e,r,sr,yr)}function Vr(e,r){return _r(e,r,sr,wr)}function Kr(e,r){return _r(e,r,jr,Rr)}function Ur(e,r){return _r(e,r,jr,Tr)}function Yr(e,r){return _r(e,r,jr,Lr)}function Zr(e,r){return _r(e,r,jr,Dr)}var Qr,et,rt,tt=["cssProperty","element"],nt=["space"],at=["algorithm"],ot=["method"],it=["maxDeltaE","deltaEMethod","steps","maxSteps"];function ut(e,r){if(null==e)return{};var t,n,a=function(e,r){if(null==e)return{};var t,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||(a[t]=e[t]);return a}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function st(e,r){if(r&&("object"===yt(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ct(e){return(ct=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function lt(e){return function(e){if(Array.isArray(e))return St(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Ot(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ft(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function ht(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ft(Object(t),!0).forEach((function(r){wt(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ft(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function dt(e,r,t){return(dt=pt()?Reflect.construct:function(e,r,t){var n=[null];n.push.apply(n,r);var a=new(Function.bind.apply(e,n));return t&&bt(a,t.prototype),a}).apply(null,arguments)}function pt(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function gt(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var n,a,o=[],i=!0,u=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(o.push(n.value),!r||o.length!==r);i=!0);}catch(e){u=!0,a=e}finally{try{i||null==t.return||t.return()}finally{if(u)throw a}}return o}(e,r)||Ot(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function vt(){vt=function(e,r){return new t(e,void 0,r)};var e=RegExp.prototype,r=new WeakMap;function t(e,n,a){var o=new RegExp(e,n);return r.set(o,a||r.get(e)),bt(o,t.prototype)}function n(e,t){var n=r.get(t);return Object.keys(n).reduce((function(r,t){return r[t]=e[n[t]],r}),Object.create(null))}return mt(t,RegExp),t.prototype.exec=function(r){var t=e.exec.call(this,r);return t&&(t.groups=n(t,this)),t},t.prototype[Symbol.replace]=function(t,a){if("string"==typeof a){var o=r.get(this);return e[Symbol.replace].call(this,t,a.replace(/\$<([^>]+)>/g,(function(e,r){return"$"+o[r]})))}if("function"==typeof a){var i=this;return e[Symbol.replace].call(this,t,(function(){var e=arguments;return"object"!=yt(e[e.length-1])&&(e=[].slice.call(e)).push(n(e,i)),a.apply(this,e)}))}return e[Symbol.replace].call(this,t,a)},vt.apply(this,arguments)}function mt(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&bt(e,r)}function bt(e,r){return(bt=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function yt(e){return(yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function wt(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Mt(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function kt(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ct(e,r,t){return r&&kt(e.prototype,r),t&&kt(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function xt(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Ot(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,u=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){u=!0,o=e},f:function(){try{i||null==t.return||t.return()}finally{if(u)throw o}}}}function Ot(e,r){if(e){if("string"==typeof e)return St(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?St(e,r):void 0}}function St(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function _t(e,r){var t,n,a=e.length,o=!1,i=!1;Array.isArray(e[0])?t=e:(a=(t=[e]).length,o=!0),Array.isArray(r[0])?n=r:(n=r.length>0?r.map((function(e){return[e]})):[[]],i=!0);var u=n[0].length,s=n[0].map((function(e,r){return n.map((function(e){return e[r]}))})),c=t.map((function(e){return s.map((function(r){var t=0;if(!Array.isArray(e)){var n,a=xt(r);try{for(a.s();!(n=a.n()).done;){var o=n.value;t+=e*o}}catch(e){a.e(e)}finally{a.f()}return t}for(var i=0;i<e.length;i++)t+=e[i]*(r[i]||0);return t}))}));return 1===a&&o&&(c=c[0]),1===u&&i?1===a&&o?c[0]:c.map((function(e){return e[0]})):c}function jt(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]}function Bt(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0],n=jt(e,r[0]),a=jt(e,r[1]),o=jt(e,r[2]);return t[0]=n,t[1]=a,t[2]=o,t}function Et(e){return"string"===At(e)}function At(e){return(Object.prototype.toString.call(e).match(/^\[object\s+(.*?)\]$/)[1]||"").toLowerCase()}function Pt(e,r){var t=r.precision,n=void 0===t?16:t,a=r.unit;return Rt(e)?"none":(e=+Lt(e,n))+(null!=a?a:"")}function Rt(e){return null===e}function Tt(e){return Rt(e)?0:e}function Lt(e,r){if(0===e)return 0;var t=~~e,n=0;t&&r&&(n=1+~~Math.log10(Math.abs(t)));var a=Math.pow(10,r-n);return Math.floor(e*a+.5)/a}function Dt(e,r,t){return isNaN(e)?r:isNaN(r)?e:e+(r-e)*t}function It(e,r,t){return(t-e)/(r-e)}function Nt(e,r,t){return!e||!r||e===r||e[0]===r[0]&&e[1]===r[1]||isNaN(t)||null===t?t:Dt(r[0],r[1],It(e[0],e[1],t))}function zt(e,r,t){return Math.max(Math.min(t,r),e)}function Ft(e,r){return Math.sign(e)===Math.sign(r)?e:-e}function qt(e,r){return Ft(Math.pow(Math.abs(e),r),e)}function Ht(e,r){return 0===r?0:e/r}function Wt(e,r){for(var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length;t<n;){var a=t+n>>1;e[a]<r?t=a+1:n=a}return t}function Jt(e,r){if(e instanceof r)return!0;for(var t=r.name;e;){var n,a=Object.getPrototypeOf(e),o=null==a||null===(n=a.constructor)||void 0===n?void 0:n.name;if(o===t)return!0;if(!o||"Object"===o)return!1;e=a}return!1}var $t=Object.freeze({__proto__:null,bisectLeft:Wt,clamp:zt,copySign:Ft,interpolate:Dt,interpolateInv:It,isInstance:Jt,isNone:Rt,isString:Et,mapRange:Nt,multiplyMatrices:_t,multiply_v3_m3x3:Bt,serializeNumber:Pt,skipNone:Tt,spow:qt,toPrecision:Lt,type:At,zdiv:Ht}),Xt=new(function(){function e(){Mt(this,e)}return Ct(e,[{key:"add",value:function(e,r,t){if("string"==typeof arguments[0])(Array.isArray(e)?e:[e]).forEach((function(e){this[e]=this[e]||[],r&&this[e][t?"unshift":"push"](r)}),this);else for(var e in arguments[0])this.add(e,arguments[0][e],arguments[1])}},{key:"run",value:function(e,r){this[e]=this[e]||[],this[e].forEach((function(e){e.call(r&&r.context?r.context:r,r)}))}}]),e}()),Gt={gamut_mapping:"css",precision:5,deltaE:"76",verbose:"test"!==(null===globalThis||void 0===globalThis||null===(Qr=globalThis.process)||void 0===Qr||null===(et=Qr.env)||void 0===et||null===(rt=et.NODE_ENV)||void 0===rt?void 0:rt.toLowerCase()),warn:function(e){var r,t;this.verbose&&(null===globalThis||void 0===globalThis||null===(r=globalThis.console)||void 0===r||null===(t=r.warn)||void 0===t||t.call(r,e))}},Vt=function(){function e(r,t){var n;(Mt(this,e),wt(this,"type",void 0),wt(this,"coordMeta",void 0),wt(this,"coordRange",void 0),wt(this,"range",void 0),"object"===yt(r)&&(this.coordMeta=r),t)&&(this.coordMeta=t,this.coordRange=null!==(n=t.range)&&void 0!==n?n:t.refRange);if("string"==typeof r){var a=r.trim().match(vt(/^(<[a-z]+>)(\[(\x2D?[.\d]+),\s*(\x2D?[.\d]+)\])?$/,{type:1,min:3,max:4}));if(!a)throw new TypeError("Cannot parse ".concat(r," as a type definition."));this.type=a.groups.type;var o=a.groups,i=o.min,u=o.max;(i||u)&&(this.range=[+i,+u])}}return Ct(e,[{key:"computedRange",get:function(){return this.range?this.range:"<percentage>"===this.type?this.percentageRange():"<angle>"===this.type?[0,360]:null}},{key:"unit",get:function(){return"<percentage>"===this.type?"%":"<angle>"===this.type?"deg":""}},{key:"resolve",value:function(e){if("<angle>"===this.type)return e;var r,t=this.computedRange,n=this.coordRange;"<percentage>"===this.type&&(null!==(r=n)&&void 0!==r||(n=this.percentageRange()));return Nt(t,n,e)}},{key:"serialize",value:function(e,r){var t="<percentage>"===this.type?this.percentageRange(100):this.computedRange,n=this.unit;return Pt(e=Nt(this.coordRange,t,e),{unit:n,precision:r})}},{key:"toString",value:function(){var e=this.type;if(this.range){var r=gt(this.range,2),t=r[0],n=void 0===t?"":t,a=r[1],o=void 0===a?"":a;e+="[".concat(n,",").concat(o,"]")}return e}},{key:"percentageRange",value:function(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return[(e=this.coordMeta&&this.coordMeta.range||this.coordRange&&this.coordRange[0]>=0?[0,1]:[-1,1])[0]*r,e[1]*r]}}],[{key:"get",value:function(e,r){return Jt(e,this)?e:new this(e,r)}}]),e}(),Kt=Symbol("instance"),Ut=function(){function e(r){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r.space;Mt(this,e),wt(this,"type",void 0),wt(this,"name",void 0),wt(this,"spaceCoords",void 0),wt(this,"coords",void 0),wt(this,"id",void 0),wt(this,"alpha",void 0),r[Kt]=this,this.type="function",this.name="color",Object.assign(this,r),this.space=n,"custom"!==this.type&&(this.spaceCoords=Object.values(n.coords),this.coords||(this.coords=this.spaceCoords.map((function(e){var r=["<number>","<percentage>"];return"angle"===e.type&&r.push("<angle>"),r}))),this.coords=this.coords.map((function(e,r){var n=t.spaceCoords[r];return"string"==typeof e&&(e=e.trim().split(/\s*\|\s*/)),e.map((function(e){return Vt.get(e,n)}))})))}return Ct(e,[{key:"serializeCoords",value:function(e,r,t){var n=this;return t=e.map((function(e,r){var a,o;return Vt.get(null!==(a=null===(o=t)||void 0===o?void 0:o[r])&&void 0!==a?a:n.coords[r][0],n.spaceCoords[r])})),e.map((function(e,n){return t[n].serialize(e,r)}))}},{key:"coerceCoords",value:function(e,r){var t=this;return Object.entries(this.space.coords).map((function(n,a){var o=gt(n,2),i=o[0],u=o[1],s=e[a];if(Rt(s)||isNaN(s))return s;var c=r[a],l=t.coords[a].find((function(e){return e.type==c}));if(!l){var f,h,d=u.name||i;throw new TypeError("".concat(null!==(f=null!=c?c:null===(h=s)||void 0===h?void 0:h.raw)&&void 0!==f?f:s," not allowed for ").concat(d," in ").concat(t.name,"()"))}return s=l.resolve(s),l.range&&(r[a]=l.toString()),s}))}},{key:"canSerialize",value:function(){return"function"===this.type||this.serialize}},{key:"parse",value:function(e){return null}}],[{key:"get",value:function(r){if(!r||Jt(r,this))return r;if(r[Kt])return r[Kt];for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];return dt(e,[r].concat(n))}}]),e}(),Yt={D50:[.3457/.3585,1,.2958/.3585],D65:[.3127/.329,1,.3583/.329]};function Zt(e){return Array.isArray(e)?e:Yt[e]}function Qt(e,r,t){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(e=Zt(e),r=Zt(r),!e||!r)throw new TypeError("Missing white point to convert ".concat(e?"":"from").concat(e||r?"":"/").concat(r?"":"to"));if(e===r)return t;var a={W1:e,W2:r,XYZ:t,options:n};if(Xt.run("chromatic-adaptation-start",a),a.M||(a.W1===Yt.D65&&a.W2===Yt.D50?a.M=[[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]]:a.W1===Yt.D50&&a.W2===Yt.D65&&(a.M=[[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]])),Xt.run("chromatic-adaptation-end",a),a.M)return Bt(a.XYZ,a.M);throw new TypeError("Only Bradford CAT with white points D50 and D65 supported for now.")}function en(e,r){var t,n,a,o={str:null===(t=String(e))||void 0===t?void 0:t.trim(),options:r};if(Xt.run("parse-start",o),o.color)return o.color;o.parsed=function(e){if(!e)return;var r=(e=e.trim()).match(tn.function);if(r){var t=[],n=[],a=!1,o=r[1].toLowerCase(),i=r[2].replace(tn.singleArgument,(function(e,r){var i=function(e){var r,t={},n=null===(r=e.match(tn.unitValue))||void 0===r?void 0:r[0],a=t.raw=e;n?(t.type="%"===n?"<percentage>":"<angle>",t.unit=n,t.unitless=Number(a.slice(0,-n.length)),a=t.unitless*rn[n]):tn.number.test(a)?(a=Number(a),t.type="<number>"):"none"===a?a=null:"NaN"===a||"calc(NaN)"===a?(a=NaN,t.type="<number>"):t.type="<ident>";return{value:a,meta:t}}(r),u=i.value,s=i.meta;return(e.startsWith("/")||"color"!==o&&3===t.length)&&(a=!0),t.push(u),n.push(s),""}));return{name:o,args:t,argMeta:n,lastAlpha:a,commas:i.includes(","),rawName:r[1],rawArgs:r[2]}}}(o.str);var i=o.options?null!==(n=o.options.parseMeta)&&void 0!==n?n:o.options.meta:null;if(o.parsed){var u,s,c=o.parsed.name,l=o.parsed.args,f=l.map((function(e,r){var t;return null===(t=o.parsed.argMeta[r])||void 0===t?void 0:t.type}));if("color"===c){var h=l.shift();f.shift();var d=h.startsWith("--")?h.substring(2):"--".concat(h),p=[h,d];if(!(u=an.findFormat({name:c,id:p,type:"function"}))){var g,v,m=h in an.registry?h:d;if(m in an.registry){var b,y,w=null===(b=an.registry[m].formats)||void 0===b||null===(y=b.color)||void 0===y?void 0:y.id;if(w){var M=e.replace("color("+h,"color("+w);v="Did you mean ".concat(M,"?")}}throw new TypeError("Cannot parse ".concat(o.str,". ")+(null!==(g=v)&&void 0!==g?g:"Missing a plugin?"))}s=u.space,u.id.startsWith("--")&&!h.startsWith("--")&&Gt.warn("".concat(s.name," is a non-standard space and not currently supported in the CSS spec. ")+"Use prefixed color(".concat(u.id,") instead of color(").concat(h,").")),h.startsWith("--")&&!u.id.startsWith("--")&&Gt.warn("".concat(s.name," is a standard space and supported in the CSS spec. ")+"Use color(".concat(u.id,") instead of prefixed color(").concat(h,")."))}else s=(u=an.findFormat({name:c,type:"function"})).space;i&&Object.assign(i,{format:u,formatId:u.name,types:f,commas:o.parsed.commas});var k=1;o.parsed.lastAlpha&&(k=o.parsed.args.pop(),i&&(i.alphaType=f.pop()));var C=u.coords.length;if(l.length!==C)throw new TypeError("Expected ".concat(C," coordinates for ").concat(s.id," in ").concat(o.str,"), got ").concat(l.length));l=u.coerceCoords(l,f),a={spaceId:s.id,coords:l,alpha:k}}else{var x,O=xt(an.all);try{e:for(O.s();!(x=O.n()).done;){var S=x.value;for(var _ in S.formats){var j=S.formats[_];if("custom"===j.type&&(!j.test||j.test(o.str))){var B=S.getFormat(j),E=B.parse(o.str);if(E){i&&Object.assign(i,{format:B,formatId:_}),a=E;break e}}}}}catch(e){O.e(e)}finally{O.f()}}if(!a)throw new TypeError("Could not parse ".concat(e," as a color. Missing a plugin?"));return a.alpha=Rt(a.alpha)?a.alpha:void 0===a.alpha?1:zt(0,a.alpha,1),a}var rn={"%":.01,deg:1,grad:.9,rad:180/Math.PI,turn:360},tn={function:/^([a-z]+)\(((?:calc\(NaN\)|.)+?)\)$/i,number:/^([-+]?(?:[0-9]*\.)?[0-9]+(e[-+]?[0-9]+)?)$/i,unitValue:RegExp("(".concat(Object.keys(rn).join("|"),")$")),singleArgument:/\/?\s*(none|NaN|calc\(NaN\)|[-+\w.]+(?:%|deg|g?rad|turn)?)/g};function nn(e,r){if(Array.isArray(e))return e.map((function(e){return nn(e,r)}));if(!e)throw new TypeError("Empty color reference");Et(e)&&(e=en(e,r));var t=e.space||e.spaceId;return"string"==typeof t&&(e.space=an.get(t)),void 0===e.alpha&&(e.alpha=1),e}var an=function(){function e(r){var t,n,a,o,i;Mt(this,e),this.id=r.id,this.name=r.name,this.base=r.base?e.get(r.base):null,this.aliases=r.aliases,this.base&&(this.fromBase=r.fromBase,this.toBase=r.toBase);var u=null!==(t=r.coords)&&void 0!==t?t:this.base.coords;for(var s in u)"name"in u[s]||(u[s].name=s);this.coords=u;var c,l=null!==(n=null!==(a=r.white)&&void 0!==a?a:this.base.white)&&void 0!==n?n:"D65";for(var f in this.white=Zt(l),this.formats=null!==(o=r.formats)&&void 0!==o?o:{},this.formats){var h=this.formats[f];h.type||(h.type="function"),h.name||(h.name=f)}null!==(i=this.formats.color)&&void 0!==i&&i.id||(this.formats.color=ht(ht({},null!==(c=this.formats.color)&&void 0!==c?c:{}),{},{id:r.cssId||this.id}));r.gamutSpace?this.gamutSpace="self"===r.gamutSpace?this:e.get(r.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=function(e,r){return!0}),this.referred=r.referred,Object.defineProperty(this,"path",{value:on(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),Xt.run("colorspace-init-end",this)}return Ct(e,[{key:"inGamut",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.epsilon,n=void 0===t?75e-6:t;if(!this.equals(this.gamutSpace))return e=this.to(this.gamutSpace,e),this.gamutSpace.inGamut(e,{epsilon:n});var a=Object.values(this.coords);return e.every((function(e,r){var t=a[r];if("angle"!==t.type&&t.range){if(Rt(e))return!0;var o=gt(t.range,2),i=o[0],u=o[1];return(void 0===i||e>=i-n)&&(void 0===u||e<=u+n)}return!0}))}},{key:"isUnbounded",get:function(){return Object.values(this.coords).every((function(e){return!("range"in e)}))}},{key:"cssId",get:function(){var e,r;return(null===(e=this.formats)||void 0===e||null===(r=e.color)||void 0===r?void 0:r.id)||this.id}},{key:"isPolar",get:function(){for(var e in this.coords)if("angle"===this.coords[e].type)return!0;return!1}},{key:"getFormat",value:function(e){if(!e)return null;"default"===e?e=Object.values(this.formats)[0]:"string"==typeof e&&(e=this.formats[e]);var r=Ut.get(e,this);return r!==e&&e.name in this.formats&&(this.formats[e.name]=r),r}},{key:"equals",value:function(e){return!!e&&(this===e||this.id===e||this.id===e.id)}},{key:"to",value:function(r,t){if(1===arguments.length){var n=nn(r),a=[n.space,n.coords];r=a[0],t=a[1]}if(r=e.get(r),this.equals(r))return t;t=t.map((function(e){return Rt(e)?0:e}));for(var o,i,u=this.path,s=r.path,c=0;c<u.length&&u[c].equals(s[c]);c++)o=u[c],i=c;if(!o)throw new Error("Cannot convert between color spaces ".concat(this," and ").concat(r,": no connection space was found"));for(var l=u.length-1;l>i;l--)t=u[l].toBase(t);for(var f=i+1;f<s.length;f++)t=s[f].fromBase(t);return t}},{key:"from",value:function(r,t){if(1===arguments.length){var n=nn(r),a=[n.space,n.coords];r=a[0],t=a[1]}return(r=e.get(r)).to(this,t)}},{key:"toString",value:function(){return"".concat(this.name," (").concat(this.id,")")}},{key:"getMinCoords",value:function(){var e=[];for(var r in this.coords){var t,n=this.coords[r],a=n.range||n.refRange;e.push(null!==(t=null==a?void 0:a.min)&&void 0!==t?t:0)}return e}}],[{key:"all",get:function(){return lt(new Set(Object.values(e.registry)))}},{key:"register",value:function(e,r){if(1===arguments.length&&(e=(r=arguments[0]).id),r=this.get(r),this.registry[e]&&this.registry[e]!==r)throw new Error("Duplicate color space registration: '".concat(e,"'"));if(this.registry[e]=r,1===arguments.length&&r.aliases){var t,n=xt(r.aliases);try{for(n.s();!(t=n.n()).done;){var a=t.value;this.register(a,r)}}catch(e){n.e(e)}finally{n.f()}}return r}},{key:"get",value:function(r){if(!r||Jt(r,this))return r;var t=At(r);if("string"===t){var n=e.registry[r.toLowerCase()];if(!n)throw new TypeError('No color space found with id = "'.concat(r,'"'));return n}for(var a=arguments.length,o=new Array(a>1?a-1:0),i=1;i<a;i++)o[i-1]=arguments[i];if(o.length)return e.get.apply(e,o);throw new TypeError("".concat(r," is not a valid color space"))}},{key:"findFormat",value:function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.all;if(!r)return null;"string"==typeof r&&(r={name:r});var n,a=xt(t);try{for(a.s();!(n=a.n()).done;)for(var o=n.value,i=0,u=Object.entries(o.formats);i<u.length;i++){var s,c,l=gt(u[i],2),f=l[0],h=l[1];null!==(s=h.name)&&void 0!==s||(h.name=f),null!==(c=h.type)&&void 0!==c||(h.type="function");var d=!(r.name&&h.name!==r.name||r.type&&h.type!==r.type);if(r.id&&function(){var e=h.ids||[h.id],t=Array.isArray(r.id)?r.id:[r.id];d&&(d=t.some((function(r){return e.includes(r)})))}(),d){var p=Ut.get(h,o);return p!==h&&(o.formats[h.name]=p),p}}}catch(e){a.e(e)}finally{a.f()}return null}},{key:"resolveCoord",value:function(r,t){var n,a,o=At(r);if("string"===o)if(r.includes(".")){var i=gt(r.split("."),2);n=i[0],a=i[1]}else n=void 0,a=r;else if(Array.isArray(r)){var u=gt(r,2);n=u[0],a=u[1]}else n=r.space,a=r.coordId;if((n=e.get(n))||(n=t),!n)throw new TypeError("Cannot resolve coordinate reference ".concat(r,": No color space specified and relative references are not allowed here"));if("number"===(o=At(a))||"string"===o&&a>=0){var s=Object.entries(n.coords)[a];if(s)return ht({space:n,id:s[0],index:a},s[1])}n=e.get(n);var c=a.toLowerCase(),l=0;for(var f in n.coords){var h,d=n.coords[f];if(f.toLowerCase()===c||(null===(h=d.name)||void 0===h?void 0:h.toLowerCase())===c)return ht({space:n,id:f,index:l},d);l++}throw new TypeError('No "'.concat(a,'" coordinate found in ').concat(n.name,". Its coordinates are: ").concat(Object.keys(n.coords).join(", ")))}}]),e}();function on(e){for(var r=[e],t=e;t=t.base;)r.push(t);return r}wt(an,"registry",{}),wt(an,"DEFAULT_FORMAT",{type:"functions",name:"color"});var un=new an({id:"xyz-d65",name:"XYZ D65",coords:{x:{refRange:[0,1],name:"X"},y:{refRange:[0,1],name:"Y"},z:{refRange:[0,1],name:"Z"}},white:"D65",formats:{color:{ids:["xyz-d65","xyz"]}},aliases:["xyz"]}),sn=function(e){mt(a,e);var r,t,n=(r=a,t=pt(),function(){var e,n=ct(r);if(t){var a=ct(this).constructor;e=Reflect.construct(n,arguments,a)}else e=n.apply(this,arguments);return st(this,e)});function a(e){var r,t,o,i;(Mt(this,a),e.coords||(e.coords={r:{range:[0,1],name:"Red"},g:{range:[0,1],name:"Green"},b:{range:[0,1],name:"Blue"}}),e.base||(e.base=un),e.toXYZ_M&&e.fromXYZ_M)&&(null!==(o=e.toBase)&&void 0!==o||(e.toBase=function(r){var n=Bt(r,e.toXYZ_M);return t.white!==t.base.white&&(n=Qt(t.white,t.base.white,n)),n}),null!==(i=e.fromBase)&&void 0!==i||(e.fromBase=function(r){return Bt(r=Qt(t.base.white,t.white,r),e.fromXYZ_M)}));return null!==(r=e.referred)&&void 0!==r||(e.referred="display"),t=n.call(this,e)}return Ct(a)}(an);function cn(e,r){e=nn(e);var t,n=an.get(r,null==r?void 0:r.space),a=null==r?void 0:r.precision;return t=!n||e.space.equals(n)?e.coords.slice():n.from(e),void 0===a?t:t.map((function(e){return Lt(e,a)}))}function ln(e,r){var t;if(e=nn(e),"alpha"===r)return null!==(t=e.alpha)&&void 0!==t?t:1;var n=an.resolveCoord(r,e.space),a=n.space,o=n.index;return cn(e,a)[o]}function fn(e,r,t,n){if(e=nn(e),Array.isArray(r)){var a=[e.space,r,t];r=a[0],t=a[1],n=a[2]}return r=an.get(r),e.coords=r===e.space?t.slice():r.to(e.space,t),void 0!==n&&(e.alpha=n),e}function hn(e,r,t){if(e=nn(e),2===arguments.length&&"object"===At(arguments[1])){var n=arguments[1];for(var a in n)hn(e,a,n[a])}else if("function"==typeof t&&(t=t(ln(e,r))),"alpha"===r)e.alpha=t;else{var o=an.resolveCoord(r,e.space),i=o.space,u=o.index,s=cn(e,i);s[u]=t,fn(e,i,s)}return e}fn.returns="color",hn.returns="color";var dn=new an({id:"xyz-d50",name:"XYZ D50",white:"D50",base:un,fromBase:function(e){return Qt(un.white,"D50",e)},toBase:function(e){return Qt("D50",un.white,e)}}),pn=24389/27,gn=Yt.D50,vn=new an({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:gn,base:dn,fromBase:function(e){var r=e.map((function(e,r){return e/gn[r]})).map((function(e){return e>216/24389?Math.cbrt(e):(pn*e+16)/116}));return[116*r[1]-16,500*(r[0]-r[1]),200*(r[1]-r[2])]},toBase:function(e){var r=gt(e,3),t=r[0],n=r[1],a=r[2],o=[];return o[1]=(t+16)/116,o[0]=n/500+o[1],o[2]=o[1]-a/200,[o[0]>24/116?Math.pow(o[0],3):(116*o[0]-16)/pn,e[0]>8?Math.pow((e[0]+16)/116,3):e[0]/pn,o[2]>24/116?Math.pow(o[2],3):(116*o[2]-16)/pn].map((function(e,r){return e*gn[r]}))},formats:{lab:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <percentage>"]}}});function mn(e){return"number"!=typeof e?e:(e%360+360)%360}function bn(e,r){var t=gt(r,2),n=t[0],a=t[1],o=Rt(n),i=Rt(a);if(o&&i)return[n,a];if(o?n=a:i&&(a=n),"raw"===e)return r;n=mn(n);var u=(a=mn(a))-n;return"increasing"===e?u<0&&(a+=360):"decreasing"===e?u>0&&(n+=360):"longer"===e?-180<u&&u<180&&(u>0?n+=360:a+=360):"shorter"===e&&(u>180?n+=360:u<-180&&(a+=360)),[n,a]}var yn=new an({id:"lch",name:"LCH",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,150],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:vn,fromBase:function(e){if(void 0===this.ε){var r=Object.values(this.base.coords)[1].refRange,t=r[1]-r[0];this.ε=t/1e5}var n=gt(e,3),a=n[0],o=n[1],i=n[2],u=Math.abs(o)<this.ε&&Math.abs(i)<this.ε,s=u?null:mn(180*Math.atan2(i,o)/Math.PI);return[a,u?0:Math.sqrt(Math.pow(o,2)+Math.pow(i,2)),s]},toBase:function(e){var r=gt(e,3),t=r[0],n=r[1],a=r[2],o=null,i=null;return Rt(a)||(o=(n=n<0?0:n)*Math.cos(a*Math.PI/180),i=n*Math.sin(a*Math.PI/180)),[t,o,i]},formats:{lch:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <angle>"]}}}),wn=Math.pow(25,7),Mn=Math.PI,kn=180/Mn,Cn=Mn/180;function xn(e){var r=e*e;return r*r*r*e}function On(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.kL,a=void 0===n?1:n,o=t.kC,i=void 0===o?1:o,u=t.kH,s=void 0===u?1:u,c=nn([e,r]),l=gt(c,2);e=l[0],r=l[1];var f=vn.from(e),h=gt(f,3),d=h[0],p=h[1],g=h[2],v=yn.from(vn,[d,p,g])[1],m=vn.from(r),b=gt(m,3),y=b[0],w=b[1],M=b[2],k=yn.from(vn,[y,w,M])[1];v<0&&(v=0),k<0&&(k=0);var C=(v+k)/2,x=xn(C),O=.5*(1-Math.sqrt(x/(x+wn))),S=(1+O)*p,_=(1+O)*w,j=Math.sqrt(Math.pow(S,2)+Math.pow(g,2)),B=Math.sqrt(Math.pow(_,2)+Math.pow(M,2)),E=0===S&&0===g?0:Math.atan2(g,S),A=0===_&&0===M?0:Math.atan2(M,_);E<0&&(E+=2*Mn),A<0&&(A+=2*Mn);var P,R=y-d,T=B-j,L=(A*=kn)-(E*=kn),D=E+A,I=Math.abs(L);j*B==0?P=0:I<=180?P=L:L>180?P=L-360:L<-180?P=L+360:Gt.warn("the unthinkable has happened");var N,z=2*Math.sqrt(B*j)*Math.sin(P*Cn/2),F=(d+y)/2,q=(j+B)/2,H=xn(q);N=j*B==0?D:I<=180?D/2:D<360?(D+360)/2:(D-360)/2;var W=Math.pow(F-50,2),J=1+.015*W/Math.sqrt(20+W),$=1+.045*q,X=1;X-=.17*Math.cos((N-30)*Cn),X+=.24*Math.cos(2*N*Cn),X+=.32*Math.cos((3*N+6)*Cn);var G=1+.015*q*(X-=.2*Math.cos((4*N-63)*Cn)),V=30*Math.exp(-1*Math.pow((N-275)/25,2)),K=2*Math.sqrt(H/(H+wn)),U=-1*Math.sin(2*V*Cn)*K,Y=Math.pow(R/(a*J),2);return Y+=Math.pow(T/(i*$),2),Y+=Math.pow(z/(s*G),2),Y+=U*(T/(i*$))*(z/(s*G)),Math.sqrt(Y)}var Sn=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],_n=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],jn=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],Bn=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],En=new an({id:"oklab",name:"Oklab",coords:{l:{refRange:[0,1],name:"Lightness"},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:"D65",base:un,fromBase:function(e){var r=Bt(e,Sn);return r[0]=Math.cbrt(r[0]),r[1]=Math.cbrt(r[1]),r[2]=Math.cbrt(r[2]),Bt(r,jn,r)},toBase:function(e){var r=Bt(e,Bn);return r[0]=Math.pow(r[0],3),r[1]=Math.pow(r[1],3),r[2]=Math.pow(r[2],3),Bt(r,_n,r)},formats:{oklab:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <percentage>"]}}});function An(e,r){var t=gt(nn([e,r]),2);e=t[0],r=t[1];var n=gt(En.from(e),3),a=n[0],o=n[1],i=n[2],u=gt(En.from(r),3),s=a-u[0],c=o-u[1],l=i-u[2];return Math.sqrt(Math.pow(s,2)+Math.pow(c,2)+Math.pow(l,2))}function Pn(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.epsilon,a=void 0===n?75e-6:n;e=nn(e),r||(r=e.space),r=an.get(r);var o=e.coords;return r!==e.space&&(o=r.from(e)),r.inGamut(o,{epsilon:a})}function Rn(e){return{space:e.space,coords:e.coords.slice(),alpha:e.alpha}}function Tn(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"lab",n=(t=an.get(t)).from(e),a=t.from(r);return Math.sqrt(n.reduce((function(e,r,t){var n=a[t];return Rt(r)||Rt(n)?e:e+Math.pow(n-r,2)}),0))}var Ln=Math.PI/180;var Dn=new an({id:"xyz-abs-d65",cssId:"--xyz-abs-d65",name:"Absolute XYZ D65",coords:{x:{refRange:[0,9504.7],name:"Xa"},y:{refRange:[0,1e4],name:"Ya"},z:{refRange:[0,10888.3],name:"Za"}},base:un,fromBase:function(e){return e.map((function(e){return 203*e}))},toBase:function(e){return e.map((function(e){return e/203}))}}),In=2610/Math.pow(2,14),Nn=Math.pow(2,14)/2610,zn=3424/Math.pow(2,12),Fn=2413/Math.pow(2,7),qn=2392/Math.pow(2,7),Hn=1.7*2523/Math.pow(2,5),Wn=Math.pow(2,5)/(1.7*2523),Jn=16295499532821565e-27,$n=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],Xn=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],Gn=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],Vn=[[1,.13860504327153927,.05804731615611883],[1,-.1386050432715393,-.058047316156118904],[1,-.09601924202631895,-.811891896056039]],Kn=new an({id:"jzazbz",name:"Jzazbz",coords:{jz:{refRange:[0,1],name:"Jz"},az:{refRange:[-.21,.21]},bz:{refRange:[-.21,.21]}},base:Dn,fromBase:function(e){var r=gt(e,3),t=r[0],n=r[1],a=r[2],o=Bt([1.15*t-(1.15-1)*a,.66*n-(.66-1)*t,a],$n),i=gt(Bt(o.map((function(e){var r=zn+Fn*qt(e/1e4,In),t=1+qn*qt(e/1e4,In);return qt(r/t,Hn)})),Gn),3),u=i[0],s=i[1],c=i[2];return[(1-.56)*u/(1+-.56*u)-Jn,s,c]},toBase:function(e){var r=gt(e,3),t=r[0],n=r[1],a=r[2],o=Bt([(t+Jn)/(1-.56- -.56*(t+Jn)),n,a],Vn),i=gt(Bt(o.map((function(e){var r=zn-qt(e,Wn),t=qn*qt(e,Wn)-Fn;return 1e4*qt(r/t,Nn)})),Xn),3),u=i[0],s=i[1],c=i[2],l=(u+(1.15-1)*c)/1.15;return[l,(s+(.66-1)*l)/.66,c]},formats:{jzazbz:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <percentage>"]}}}),Un=new an({id:"jzczhz",name:"JzCzHz",coords:{jz:{refRange:[0,1],name:"Jz"},cz:{refRange:[0,.26],name:"Chroma"},hz:{refRange:[0,360],type:"angle",name:"Hue"}},base:Kn,fromBase:yn.fromBase,toBase:yn.toBase,formats:{jzczhz:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <angle>"]}}});var Yn=[[.3592832590121217,.6976051147779502,-.035891593232029],[-.1920808463704993,1.100476797037432,.0753748658519118],[.0070797844607479,.0748396662186362,.8433265453898765]],Zn=[[.5,.5,0],[6610/4096,-13613/4096,7003/4096],[17933/4096,-17390/4096,-543/4096]],Qn=[[.9999999999999998,.0086090370379328,.111029625003026],[.9999999999999998,-.0086090370379328,-.1110296250030259],[.9999999999999998,.5600313357106791,-.3206271749873188]],ea=[[2.0701522183894223,-1.3263473389671563,.2066510476294053],[.3647385209748072,.6805660249472273,-.0453045459220347],[-.0497472075358123,-.0492609666966131,1.1880659249923042]],ra=new an({id:"ictcp",name:"ICTCP",coords:{i:{refRange:[0,1],name:"I"},ct:{refRange:[-.5,.5],name:"CT"},cp:{refRange:[-.5,.5],name:"CP"}},base:Dn,fromBase:function(e){return function(e){return Bt(e.map((function(e){var r=.8359375+2413/128*Math.pow(e/1e4,2610/16384),t=1+18.6875*Math.pow(e/1e4,2610/16384);return Math.pow(r/t,2523/32)})),Zn)}(Bt(e,Yn))},toBase:function(e){var r=function(e){return Bt(e,Qn).map((function(e){var r=Math.max(Math.pow(e,32/2523)-.8359375,0),t=2413/128-18.6875*Math.pow(e,32/2523);return 1e4*Math.pow(r/t,16384/2610)}))}(e);return Bt(r,ea)},formats:{ictcp:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <percentage>"]}}});var ta=Yt.D65,na=2*Math.PI,aa=[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],oa=[[1.8620678550872327,-1.0112546305316843,.14918677544445175],[.38752654323613717,.6214474419314753,-.008973985167612518],[-.015841498849333856,-.03412293802851557,1.0499644368778496]],ia=[[460,451,288],[460,-891,-261],[460,-220,-6300]],ua={dark:[.8,.525,.8],dim:[.9,.59,.9],average:[1,.69,1]},sa={h:[20.14,90,164.25,237.53,380.14],e:[.8,.7,1,1.2,.8],H:[0,100,200,300,400]},ca=180/Math.PI,la=Math.PI/180;function fa(e,r){return e.map((function(e){var t=qt(r*Math.abs(e)*.01,.42);return 400*Ft(t,e)/(t+27.13)}))}function ha(e,r,t,n,a){var o={};o.discounting=a,o.refWhite=e,o.surround=n;var i=e.map((function(e){return 100*e}));o.la=r,o.yb=t;var u=i[1],s=Bt(i,aa),c=ua[o.surround],l=c[0];o.c=c[1],o.nc=c[2];var f=1/(5*o.la+1),h=Math.pow(f,4);o.fl=h*o.la+.1*(1-h)*(1-h)*Math.cbrt(5*o.la),o.flRoot=Math.pow(o.fl,.25),o.n=o.yb/u,o.z=1.48+Math.sqrt(o.n),o.nbb=.725*Math.pow(o.n,-.2),o.ncb=o.nbb;var d=Math.max(Math.min(l*(1-1/3.6*Math.exp((-o.la-42)/92)),1),0);o.dRgb=s.map((function(e){return Dt(1,u/e,d)})),o.dRgbInv=o.dRgb.map((function(e){return 1/e}));var p=fa(s.map((function(e,r){return e*o.dRgb[r]})),o.fl);return o.aW=o.nbb*(2*p[0]+p[1]+.05*p[2]),o}var da=ha(ta,64/Math.PI*.2,20,"average",!1);function pa(e,r){if(!(void 0!==e.J^void 0!==e.Q))throw new Error("Conversion requires one and only one: 'J' or 'Q'");if(!(void 0!==e.C^void 0!==e.M^void 0!==e.s))throw new Error("Conversion requires one and only one: 'C', 'M' or 's'");if(!(void 0!==e.h^void 0!==e.H))throw new Error("Conversion requires one and only one: 'h' or 'H'");if(0===e.J||0===e.Q)return[0,0,0];var t=0;t=void 0!==e.h?mn(e.h)*la:function(e){var r=(e%400+400)%400,t=Math.floor(.01*r);r%=100;var n=gt(sa.h.slice(t,t+2),2),a=n[0],o=n[1],i=gt(sa.e.slice(t,t+2),2),u=i[0],s=i[1];return mn((r*(s*a-u*o)-100*a*s)/(r*(s-u)-100*s))}(e.H)*la;var n=Math.cos(t),a=Math.sin(t),o=0;void 0!==e.J?o=.1*qt(e.J,.5):void 0!==e.Q&&(o=.25*r.c*e.Q/((r.aW+4)*r.flRoot));var i=0;void 0!==e.C?i=e.C/o:void 0!==e.M?i=e.M/r.flRoot/o:void 0!==e.s&&(i=4e-4*Math.pow(e.s,2)*(r.aW+4)/r.c);var u,s,c,l=qt(i*Math.pow(1.64-Math.pow(.29,r.n),-.73),10/9),f=.25*(Math.cos(t+2)+3.8),h=r.aW*qt(o,2/r.c/r.z),d=5e4/13*r.nc*r.ncb*f,p=h/r.nbb,g=23*(p+.305)*Ht(l,23*d+l*(11*n+108*a)),v=(u=Bt([p,g*n,g*a],ia).map((function(e){return 1*e/1403})),s=r.fl,c=100/s*Math.pow(27.13,1/.42),u.map((function(e){var r=Math.abs(e);return Ft(c*qt(r/(400-r),1/.42),e)})));return Bt(v.map((function(e,t){return e*r.dRgbInv[t]})),oa).map((function(e){return e/100}))}function ga(e,r){var t=fa(Bt(e.map((function(e){return 100*e})),aa).map((function(e,t){return e*r.dRgb[t]})),r.fl),n=t[0]+(-12*t[1]+t[2])/11,a=(t[0]+t[1]-2*t[2])/9,o=(Math.atan2(a,n)%na+na)%na,i=.25*(Math.cos(o+2)+3.8),u=qt(5e4/13*r.nc*r.ncb*Ht(i*Math.sqrt(Math.pow(n,2)+Math.pow(a,2)),t[0]+t[1]+1.05*t[2]+.305),.9)*Math.pow(1.64-Math.pow(.29,r.n),.73),s=qt(r.nbb*(2*t[0]+t[1]+.05*t[2])/r.aW,.5*r.c*r.z),c=100*qt(s,2),l=4/r.c*s*(r.aW+4)*r.flRoot,f=u*s,h=f*r.flRoot,d=mn(o*ca),p=function(e){var r=mn(e);r<=sa.h[0]&&(r+=360);var t=Wt(sa.h,r)-1,n=gt(sa.h.slice(t,t+2),2),a=n[0],o=n[1],i=gt(sa.e.slice(t,t+2),2),u=i[0],s=i[1],c=(r-a)/u;return sa.H[t]+100*c/(c+(o-r)/s)}(d);return{J:c,C:f,h:d,s:50*qt(r.c*u/(r.aW+4),.5),Q:l,M:h,H:p}}var va=new an({id:"cam16-jmh",cssId:"--cam16-jmh",name:"CAM16-JMh",coords:{j:{refRange:[0,100],name:"J"},m:{refRange:[0,105],name:"Colorfulness"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:un,fromBase:function(e){void 0===this.ε&&(this.ε=Object.values(this.coords)[1].refRange[1]/1e5);var r=ga(e,da),t=Math.abs(r.M)<this.ε;return[r.J,t?0:r.M,t?null:r.h]},toBase:function(e){return pa({J:e[0],M:e[1],h:e[2]},da)}}),ma=Yt.D65;function ba(e){return e>8?Math.pow((e+16)/116,3):e/(24389/27)}function ya(e,r){var t=function(e){return 116*(e>216/24389?Math.cbrt(e):(24389/27*e+16)/116)-16}(e[1]);if(0===t)return[0,0,0];var n=ga(e,wa);return[mn(n.h),n.C,t]}var wa=ha(ma,200/Math.PI*ba(50),100*ba(50),"average",!1),Ma=new an({id:"hct",name:"HCT",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},c:{refRange:[0,145],name:"Colorfulness"},t:{refRange:[0,100],name:"Tone"}},base:un,fromBase:function(e){void 0===this.ε&&(this.ε=Object.values(this.coords)[1].refRange[1]/1e5);var r=ya(e);return r[1]<this.ε&&(r[1]=0,r[0]=null),r},toBase:function(e){return function(e,r){var t=gt(e,3),n=t[0],a=t[1],o=t[2],i=[],u=0;if(0===o)return[0,0,0];var s=ba(o);u=o>0?.00379058511492914*Math.pow(o,2)+.608983189401032*o+.9155088574762233:9514440756550361e-21*Math.pow(o,2)+.08693057439788597*o-21.928975842194614;for(var c=0,l=1/0;c<=15;){i=pa({J:u,C:a,h:n},r);var f=Math.abs(i[1]-s);if(f<l){if(f<=2e-12)return i;l=f}u-=(i[1]-s)*u/(2*i[1]),c+=1}return pa({J:u,C:a,h:n},r)}(e,wa)},formats:{color:{id:"--hct",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),ka=Math.PI/180,Ca=[1,.007,.0228];function xa(e){e[1]<0&&(e=Ma.fromBase(Ma.toBase(e)));var r=Math.log(Math.max(1+Ca[2]*e[1]*wa.flRoot,1))/Ca[2],t=e[0]*ka,n=r*Math.cos(t),a=r*Math.sin(t);return[e[2],n,a]}var Oa={deltaE76:function(e,r){return Tn(e,r,"lab")},deltaECMC:function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.l,a=void 0===n?2:n,o=t.c,i=void 0===o?1:o,u=nn([e,r]),s=gt(u,2);e=s[0],r=s[1];var c=vn.from(e),l=gt(c,3),f=l[0],h=l[1],d=l[2],p=yn.from(vn,[f,h,d]),g=gt(p,3),v=g[1],m=g[2],b=vn.from(r),y=gt(b,3),w=y[0],M=y[1],k=y[2],C=yn.from(vn,[w,M,k])[1];v<0&&(v=0),C<0&&(C=0);var x=f-w,O=v-C,S=h-M,_=d-k,j=Math.pow(S,2)+Math.pow(_,2)-Math.pow(O,2),B=.511;f>=16&&(B=.040975*f/(1+.01765*f));var E,A=.0638*v/(1+.0131*v)+.638;Rt(m)&&(m=0),E=m>=164&&m<=345?.56+Math.abs(.2*Math.cos((m+168)*Ln)):.36+Math.abs(.4*Math.cos((m+35)*Ln));var P=Math.pow(v,4),R=Math.sqrt(P/(P+1900)),T=A*(R*E+1-R),L=Math.pow(x/(a*B),2);return L+=Math.pow(O/(i*A),2),L+=j/Math.pow(T,2),Math.sqrt(L)},deltaE2000:On,deltaEJz:function(e,r){var t=gt(nn([e,r]),2);e=t[0],r=t[1];var n=gt(Un.from(e),3),a=n[0],o=n[1],i=n[2],u=gt(Un.from(r),3),s=u[0],c=u[1],l=u[2],f=a-s,h=o-c;Rt(i)&&Rt(l)?(i=0,l=0):Rt(i)?i=l:Rt(l)&&(l=i);var d=i-l,p=2*Math.sqrt(o*c)*Math.sin(d/2*(Math.PI/180));return Math.sqrt(Math.pow(f,2)+Math.pow(h,2)+Math.pow(p,2))},deltaEITP:function(e,r){var t=gt(nn([e,r]),2);e=t[0],r=t[1];var n=gt(ra.from(e),3),a=n[0],o=n[1],i=n[2],u=gt(ra.from(r),3),s=u[0],c=u[1],l=u[2];return 720*Math.sqrt(Math.pow(a-s,2)+.25*Math.pow(o-c,2)+Math.pow(i-l,2))},deltaEOK:An,deltaEOK2:function(e,r){var t=gt(nn([e,r]),2);e=t[0],r=t[1];var n=gt(En.from(e),3),a=n[0],o=n[1],i=n[2],u=gt(En.from(r),3),s=a-u[0],c=2*(o-u[1]),l=2*(i-u[2]);return Math.sqrt(Math.pow(s,2)+Math.pow(c,2)+Math.pow(l,2))},deltaEHCT:function(e,r){var t=gt(nn([e,r]),2);e=t[0],r=t[1];var n=gt(xa(Ma.from(e)),3),a=n[0],o=n[1],i=n[2],u=gt(xa(Ma.from(r)),3),s=u[0],c=u[1],l=u[2];return Math.sqrt(Math.pow(a-s,2)+Math.pow(o-c,2)+Math.pow(i-l,2))}};function Sa(e){var r=e?Math.floor(Math.log10(Math.abs(e))):0;return Math.max(parseFloat("1e".concat(r-2)),1e-6)}var _a={hct:{method:"hct.c",jnd:2,deltaEMethod:"hct",blackWhiteClamp:{}},"hct-tonal":{method:"hct.c",jnd:0,deltaEMethod:"hct",blackWhiteClamp:{channel:"hct.t",min:0,max:100}}};function ja(e){var r,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.method,a=void 0===n?Gt.gamut_mapping:n,o=t.space,i=void 0===o?void 0:o,u=t.deltaEMethod,s=void 0===u?"":u,c=t.jnd,l=void 0===c?2:c,f=t.blackWhiteClamp,h=void 0===f?void 0:f;if(e=nn(e),Et(arguments[1])?i=arguments[1]:i||(i=e.space),Pn(e,i=an.get(i),{epsilon:0}))return e;if("css"===a)r=Ea(e,{space:i});else{if("clip"===a||Pn(e,i))r=Aa(e,i);else{if(Object.prototype.hasOwnProperty.call(_a,a)){var d=_a[a];a=d.method,l=d.jnd,s=d.deltaEMethod,h=d.blackWhiteClamp}var p=On;if(""!==s)for(var g in Oa)if("deltae"+s.toLowerCase()===g.toLowerCase()){p=Oa[g];break}0===l&&(l=1e-16);var v=ja(Aa(e,i),{method:"clip",space:i});if(p(e,v)>l){if(h&&3===Object.keys(h).length){var m=an.resolveCoord(h.channel),b=ln(Aa(e,m.space),m.id);if(Rt(b)&&(b=0),b>=h.max)return Aa({space:"xyz-d65",coords:Yt.D65},e.space);if(b<=h.min)return Aa({space:"xyz-d65",coords:[0,0,0]},e.space)}var y=an.resolveCoord(a),w=y.space,M=y.id,k=Aa(e,w);k.coords.forEach((function(e,r){Rt(e)&&(k.coords[r]=0)}));for(var C=y.range||y.refRange,x=C[0],O=Sa(l),S=x,_=ln(k,M);_-S>O;){var j=Rn(k);j=ja(j,{space:i,method:"clip"});var B=p(k,j);B-l<O?S=ln(k,M):_=ln(k,M),hn(k,M,(S+_)/2)}r=Aa(k,i)}else r=v}if("clip"===a||!Pn(r,i,{epsilon:0})){var E=Object.values(i.coords).map((function(e){return e.range||[]}));r.coords=r.coords.map((function(e,r){var t=gt(E[r],2),n=t[0],a=t[1];return void 0!==n&&(e=Math.max(n,e)),void 0!==a&&(e=Math.min(e,a)),e}))}}return i!==e.space&&(r=Aa(r,e.space)),e.coords=r.coords,e}ja.returns="color";var Ba={WHITE:{space:En,coords:[1,0,0],alpha:1},BLACK:{space:En,coords:[0,0,0],alpha:1}};function Ea(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.space,n=.02,a=1e-4;e=nn(e),t||(t=e.space),t=an.get(t);var o=an.get("oklch");if(t.isUnbounded)return Aa(e,t);var i=Aa(e,o),u=i.coords[0];if(u>=1){var s=Aa(Ba.WHITE,t);return s.alpha=e.alpha,Aa(s,t)}if(u<=0){var c=Aa(Ba.BLACK,t);return c.alpha=e.alpha,Aa(c,t)}if(Pn(i,t,{epsilon:0}))return Aa(i,t);function l(e){var r=Aa(e,t),n=Object.values(t.coords);return r.coords=r.coords.map((function(e,r){if("range"in n[r]){var t=gt(n[r].range,2);return zt(t[0],e,t[1])}return e})),r}var f=0,h=i.coords[1],d=!0,p=Rn(i),g=l(p),v=An(g,p);if(v<n)return g;for(;h-f>a;){var m=(f+h)/2;if(p.coords[1]=m,d&&Pn(p,t,{epsilon:0}))f=m;else if((v=An(g=l(p),p))<n){if(n-v<a)break;d=!1,f=m}else h=m}return g}function Aa(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.inGamut;e=nn(e);var a=(r=an.get(r)).from(e),o={space:r,coords:a,alpha:e.alpha};return n&&(o=ja(o,!0===n?void 0:n)),o}function Pa(e){var r,t,n,a,o,i,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=u.precision,c=void 0===s?Gt.precision:s,l=u.format,f=u.inGamut,h=void 0===f||f,d=u.coords,p=u.alpha,g=u.commas,v=nn(e),m=l,b=v.parseMeta;b&&!l&&(b.format.canSerialize()&&(l=b.format,m=b.formatId),null!==(t=d)&&void 0!==t||(d=b.types),null!==(n=p)&&void 0!==n||(p=b.alphaType),null!==(a=g)&&void 0!==a||(g=b.commas));m&&(l=null!==(o=v.space.getFormat(l))&&void 0!==o?o:an.findFormat(m));l||(m=(l=null!==(i=v.space.getFormat("default"))&&void 0!==i?i:an.DEFAULT_FORMAT).name);l&&l.space&&l.space!==v.space&&(v=Aa(v,l.space));var y=v.coords.slice();if(h||(h=l.toGamut),h&&!Pn(v)&&(y=ja(Rn(v),!0===h?void 0:h).coords),"custom"===l.type){if(!l.serialize)throw new TypeError("format ".concat(m," can only be used to parse colors, not for serialization"));r=l.serialize(y,v.alpha,u)}else{var w,M,k,C,x,O=l.name||"color",S=l.serializeCoords(y,c,d);if("color"===O){var _,j=l.id||(null===(_=l.ids)||void 0===_?void 0:_[0])||v.space.cssId||v.space.id;S.unshift(j)}var B=v.alpha;void 0!==p&&"object"!==yt(p)&&(p="string"==typeof p?{type:p}:{include:p});var E=null!==(w=null===(M=p)||void 0===M?void 0:M.type)&&void 0!==w?w:"<number>",A=!0===(null===(k=p)||void 0===k?void 0:k.include)||!0===l.alpha||!1!==(null===(C=p)||void 0===C?void 0:C.include)&&!1!==l.alpha&&B<1,P="";if(null!==(x=g)&&void 0!==x||(g=l.commas),A){var R;if(null!==c)"<percentage>"===E&&(R="%",B*=100),B=Pt(B,{precision:c,unit:R});P="".concat(g?",":" /"," ").concat(B)}r="".concat(O,"(").concat(S.join(g?", ":" ")).concat(P,")")}return r}Aa.returns="color";var Ra,Ta=new sn({id:"rec2020-linear",cssId:"--rec2020-linear",name:"Linear REC.2020",white:"D65",toXYZ_M:[[.6369580483012914,.14461690358620832,.1688809751641721],[.2627002120112671,.6779980715188708,.05930171646986196],[0,.028072693049087428,1.060985057710791]],fromXYZ_M:[[1.716651187971268,-.355670783776392,-.25336628137366],[-.666684351832489,1.616481236634939,.0157685458139111],[.017639857445311,-.042770613257809,.942103121235474]]}),La=new sn({id:"rec2020",name:"REC.2020",base:Ta,toBase:function(e){return e.map((function(e){var r=e<0?-1:1,t=e*r;return r*Math.pow(t,2.4)}))},fromBase:function(e){return e.map((function(e){var r=e<0?-1:1,t=e*r;return r*Math.pow(t,1/2.4)}))}}),Da=new sn({id:"p3-linear",cssId:"display-p3-linear",name:"Linear P3",white:"D65",toXYZ_M:[[.4865709486482162,.26566769316909306,.1982172852343625],[.2289745640697488,.6917385218365064,.079286914093745],[0,.04511338185890264,1.043944368900976]],fromXYZ_M:[[2.493496911941425,-.9313836179191239,-.40271078445071684],[-.8294889695615747,1.7626640603183463,.023624685841943577],[.03584583024378447,-.07617238926804182,.9568845240076872]]}),Ia=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]],Na=new sn({id:"srgb-linear",name:"Linear sRGB",white:"D65",toXYZ_M:[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],fromXYZ_M:Ia}),za={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[.6,50/255,.8],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,.6],lightslategrey:[119/255,136/255,.6],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[.4,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,.8],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[.4,.2,.6],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]},Fa=Array(3).fill("<percentage> | <number>[0, 255]"),qa=Array(3).fill("<number>[0, 255]"),Ha=new sn({id:"srgb",name:"sRGB",base:Na,fromBase:function(e){return e.map((function(e){var r=e<0?-1:1,t=e*r;return t>.0031308?r*(1.055*Math.pow(t,1/2.4)-.055):12.92*e}))},toBase:function(e){return e.map((function(e){var r=e<0?-1:1,t=e*r;return t<=.04045?e/12.92:r*Math.pow((t+.055)/1.055,2.4)}))},formats:{rgb:{coords:Fa},rgb_number:{name:"rgb",commas:!0,coords:qa,alpha:!1},color:{},rgba:{coords:Fa,commas:!0,alpha:!0},rgba_number:{name:"rgba",commas:!0,coords:qa},hex:{type:"custom",toGamut:!0,test:function(e){return/^#(([a-f0-9]{2}){3,4}|[a-f0-9]{3,4})$/i.test(e)},parse:function(e){e.length<=5&&(e=e.replace(/[a-f0-9]/gi,"$&$&"));var r=[];return e.replace(/[a-f0-9]{2}/gi,(function(e){r.push(parseInt(e,16)/255)})),{spaceId:"srgb",coords:r.slice(0,3),alpha:r.slice(3)[0]}},serialize:function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.collapse,a=void 0===n||n,o=t.alpha;(!1!==o&&r<1||!0===o)&&e.push(r),e=e.map((function(e){return Math.round(255*e)}));var i=a&&e.every((function(e){return e%17==0})),u=e.map((function(e){return i?(e/17).toString(16):e.toString(16).padStart(2,"0")})).join("");return"#"+u}},keyword:{type:"custom",test:function(e){return/^[a-z]+$/i.test(e)},parse:function(e){var r={spaceId:"srgb",coords:null,alpha:1};if("transparent"===(e=e.toLowerCase())?(r.coords=za.black,r.alpha=0):r.coords=za[e],r.coords)return r}}}}),Wa=new sn({id:"p3",cssId:"display-p3",name:"P3",base:Da,fromBase:Ha.fromBase,toBase:Ha.toBase});if(Gt.display_space=Ha,"undefined"!=typeof CSS&&CSS.supports)for(var Ja=0,$a=[vn,La,Wa];Ja<$a.length;Ja++){var Xa=$a[Ja],Ga=Xa.getMinCoords(),Va=Pa({space:Xa,coords:Ga,alpha:1});if(CSS.supports("color",Va)){Gt.display_space=Xa;break}}function Ka(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r.space,n=void 0===t?Gt.display_space:t,a=ut(r,nt),o=Pa(e=nn(e),a);if("undefined"==typeof CSS||CSS.supports("color",o)||!Gt.display_space)(o=new String(o)).color=e;else{var i,u=e,s=e.coords.some(Rt)||Rt(e.alpha);if(s)if(!(null!==(i=Ra)&&void 0!==i?i:Ra=CSS.supports("color","hsl(none 50% 50%)"))&&((u=Rn(e)).coords=u.coords.map(Tt),u.alpha=Tt(u.alpha),o=Pa(u,a),CSS.supports("color",o)))return(o=new String(o)).color=u,o;u=Aa(u,n),(o=new String(Pa(u,a))).color=u}return o}function Ua(e,r){return Rt(e)||Rt(r)?e===r?null:0:e-r}function Ya(e){return ln(e,[un,"y"])}function Za(e,r){hn(e,[un,"y"],r)}var Qa=Object.freeze({__proto__:null,getLuminance:Ya,register:function(e){Object.defineProperty(e.prototype,"luminance",{get:function(){return Ya(this)},set:function(e){Za(this,e)}})},setLuminance:Za});function eo(e){return e>=.022?e:e+Math.pow(.022-e,1.414)}function ro(e){var r=e<0?-1:1,t=Math.abs(e);return r*Math.pow(t,2.4)}var to=24389/27,no=Yt.D65,ao=new an({id:"lab-d65",name:"Lab D65",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:no,base:un,fromBase:function(e){var r=e.map((function(e,r){return e/no[r]})).map((function(e){return e>216/24389?Math.cbrt(e):(to*e+16)/116}));return[116*r[1]-16,500*(r[0]-r[1]),200*(r[1]-r[2])]},toBase:function(e){var r=[];return r[1]=(e[0]+16)/116,r[0]=e[1]/500+r[1],r[2]=r[1]-e[2]/200,[r[0]>24/116?Math.pow(r[0],3):(116*r[0]-16)/to,e[0]>8?Math.pow((e[0]+16)/116,3):e[0]/to,r[2]>24/116?Math.pow(r[2],3):(116*r[2]-16)/to].map((function(e,r){return e*no[r]}))},formats:{"lab-d65":{coords:["<number> | <percentage>","<number> | <percentage>","<number> | <percentage>"]}}}),oo=.5*Math.pow(5,.5)+.5;var io=Object.freeze({__proto__:null,contrastAPCA:function(e,r){var t,n,a,o;r=nn(r),e=nn(e);var i=gt((r=Aa(r,"srgb")).coords.map((function(e){return Rt(e)?0:e})),3);n=i[0],a=i[1],o=i[2];var u=.2126729*ro(n)+.7151522*ro(a)+.072175*ro(o),s=gt((e=Aa(e,"srgb")).coords.map((function(e){return Rt(e)?0:e})),3);n=s[0],a=s[1],o=s[2];var c=.2126729*ro(n)+.7151522*ro(a)+.072175*ro(o),l=eo(u),f=eo(c),h=f>l;return t=Math.abs(f-l)<5e-4?0:h?1.14*(Math.pow(f,.56)-Math.pow(l,.57)):1.14*(Math.pow(f,.65)-Math.pow(l,.62)),100*(Math.abs(t)<.1?0:t>0?t-.027:t+.027)},contrastDeltaPhi:function(e,r){e=nn(e),r=nn(r);var t=ln(e,[ao,"l"]),n=ln(r,[ao,"l"]),a=Math.abs(Math.pow(t,oo)-Math.pow(n,oo)),o=Math.pow(a,1/oo)*Math.SQRT2-40;return o<7.5?0:o},contrastLstar:function(e,r){e=nn(e),r=nn(r);var t=ln(e,[vn,"l"]),n=ln(r,[vn,"l"]);return Math.abs(t-n)},contrastMichelson:function(e,r){e=nn(e),r=nn(r);var t=Math.max(Ya(e),0),n=Math.max(Ya(r),0);if(n>t){var a=[n,t];t=a[0],n=a[1]}var o=t+n;return 0===o?0:(t-n)/o},contrastWCAG21:function(e,r){e=nn(e),r=nn(r);var t=Math.max(Ya(e),0),n=Math.max(Ya(r),0);if(n>t){var a=[n,t];t=a[0],n=a[1]}return(t+.05)/(n+.05)},contrastWeber:function(e,r){e=nn(e),r=nn(r);var t=Math.max(Ya(e),0),n=Math.max(Ya(r),0);if(n>t){var a=[n,t];t=a[0],n=a[1]}return 0===n?5e4:(t-n)/n}});function uo(e){var r=gt(cn(e,un),3),t=r[0],n=r[1],a=t+15*n+3*r[2];return[4*t/a,9*n/a]}function so(e){var r=gt(cn(e,un),3),t=r[0],n=r[1],a=t+n+r[2];return[t/a,n/a]}var co=Object.freeze({__proto__:null,register:function(e){Object.defineProperty(e.prototype,"uv",{get:function(){return uo(this)}}),Object.defineProperty(e.prototype,"xy",{get:function(){return so(this)}})},uv:uo,xy:so});function lo(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Et(t)&&(t={method:t});var n=t,a=n.method,o=void 0===a?Gt.deltaE:a,i=ut(n,ot);for(var u in Oa)if("deltae"+o.toLowerCase()===u.toLowerCase())return Oa[u](e,r,i);throw new TypeError("Unknown deltaE method: ".concat(o))}function fo(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.25,t=an.get("oklch","lch"),n=[t,"l"];return hn(e,n,(function(e){return e*(1+r)}))}function ho(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.25,t=an.get("oklch","lch"),n=[t,"l"];return hn(e,n,(function(e){return e*(1-r)}))}fo.returns="color",ho.returns="color";var po=Object.freeze({__proto__:null,darken:ho,lighten:fo});function go(e,r,t){var n,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=[nn(e),nn(r)];if(e=o[0],r=o[1],"object"===At(t)){var i=[.5,t];t=i[0],a=i[1]}var u=mo(e,r,a);return u(null!==(n=t)&&void 0!==n?n:.5)}function vo(e,r){var t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(bo(e)){n=r;var a=gt((t=e).rangeArgs.colors,2);e=a[0],r=a[1]}var o=n,i=o.maxDeltaE,u=o.deltaEMethod,s=o.steps,c=void 0===s?2:s,l=o.maxSteps,f=void 0===l?1e3:l,h=ut(o,it);if(!t){var d=[nn(e),nn(r)];e=d[0],r=d[1],t=mo(e,r,h)}var p=lo(e,r),g=i>0?Math.max(c,Math.ceil(p/i)+1):c,v=[];if(void 0!==f&&(g=Math.min(g,f)),1===g)v=[{p:.5,color:t(.5)}];else{var m=1/(g-1);v=Array.from({length:g},(function(e,r){var n=r*m;return{p:n,color:t(n)}}))}if(i>0)for(var b=v.reduce((function(e,r,t){if(0===t)return 0;var n=lo(r.color,v[t-1].color,u);return Math.max(e,n)}),0);b>i;){b=0;for(var y=1;y<v.length&&v.length<f;y++){var w=v[y-1],M=v[y],k=(M.p+w.p)/2,C=t(k);b=Math.max(b,lo(C,w.color),lo(C,M.color)),v.splice(y,0,{p:k,color:t(k)}),y++}}return v=v.map((function(e){return e.color}))}function mo(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(bo(e)){var n=e,a=r;return mo.apply(void 0,lt(n.rangeArgs.colors).concat([ht(ht({},n.rangeArgs.options),a)]))}var o=t.space,i=t.outputSpace,u=t.progression,s=t.premultiplied;e=nn(e),r=nn(r),e=Rn(e),r=Rn(r);var c={colors:[e,r],options:t};if(o=o?an.get(o):an.registry[Gt.interpolationSpace]||e.space,i=i?an.get(i):o,e=Aa(e,o),r=Aa(r,o),e=ja(e),r=ja(r),o.coords.h&&"angle"===o.coords.h.type){var l=t.hue=t.hue||"shorter",f=[o,"h"],h=[ln(e,f),ln(r,f)],d=h[0],p=h[1];Rt(d)&&!Rt(p)?d=p:Rt(p)&&!Rt(d)&&(p=d);var g=bn(l,[d,p]),v=gt(g,2);d=v[0],p=v[1],hn(e,f,d),hn(r,f,p)}return s&&(e.coords=e.coords.map((function(r){return r*e.alpha})),r.coords=r.coords.map((function(e){return e*r.alpha}))),Object.assign((function(t){t=u?u(t):t;var n=e.coords.map((function(e,n){return Dt(e,r.coords[n],t)})),a=Dt(e.alpha,r.alpha,t),c={space:o,coords:n,alpha:a};return s&&(c.coords=c.coords.map((function(e){return e/a}))),i!==o&&(c=Aa(c,i)),c}),{rangeArgs:c})}function bo(e){return"function"===At(e)&&!!e.rangeArgs}Gt.interpolationSpace="lab";var yo=Object.freeze({__proto__:null,isRange:bo,mix:go,range:mo,register:function(e){e.defineFunction("mix",go,{returns:"color"}),e.defineFunction("range",mo,{returns:"function<color>"}),e.defineFunction("steps",vo,{returns:"array<color>"})},steps:vo}),wo=new an({id:"hsl",name:"HSL",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:Ha,fromBase:function(e){var r=Math.max.apply(Math,lt(e)),t=Math.min.apply(Math,lt(e)),n=gt(e,3),a=n[0],o=n[1],i=n[2],u=null,s=0,c=(t+r)/2,l=r-t;if(0!==l){switch(s=0===c||1===c?0:(r-c)/Math.min(c,1-c),r){case a:u=(o-i)/l+(o<i?6:0);break;case o:u=(i-a)/l+2;break;case i:u=(a-o)/l+4}u*=60}return s<0&&(u+=180,s=Math.abs(s)),u>=360&&(u-=360),[u,100*s,100*c]},toBase:function(e){var r=gt(e,3),t=r[0],n=r[1],a=r[2];function o(e){var r=(e+t/30)%12,o=n*Math.min(a,1-a);return a-o*Math.max(-1,Math.min(r-3,9-r,1))}return(t%=360)<0&&(t+=360),n/=100,a/=100,[o(0),o(8),o(4)]},formats:{hsl:{coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]},hsla:{coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"],commas:!0,alpha:!0}}}),Mo=new an({id:"hsv",name:"HSV",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},v:{range:[0,100],name:"Value"}},base:Ha,fromBase:function(e){var r=Math.max.apply(Math,lt(e)),t=Math.min.apply(Math,lt(e)),n=gt(e,3),a=n[0],o=n[1],i=n[2],u=null,s=0,c=r,l=r-t;if(0!==l){switch(r){case a:u=(o-i)/l+(o<i?6:0);break;case o:u=(i-a)/l+2;break;case i:u=(a-o)/l+4}u*=60}return c&&(s=l/c),u>=360&&(u-=360),[u,100*s,100*c]},toBase:function(e){var r=gt(e,3),t=r[0],n=r[1],a=r[2];function o(e){var r=(e+t/60)%6;return a-a*n*Math.max(0,Math.min(r,4-r,1))}return(t%=360)<0&&(t+=360),n/=100,a/=100,[o(5),o(3),o(1)]},formats:{color:{id:"--hsv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),ko=new an({id:"hwb",name:"HWB",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},w:{range:[0,100],name:"Whiteness"},b:{range:[0,100],name:"Blackness"}},base:Mo,fromBase:function(e){var r=gt(e,3),t=r[0],n=r[1],a=r[2];return[t,a*(100-n)/100,100-a]},toBase:function(e){var r=gt(e,3),t=r[0],n=r[1],a=r[2],o=(n/=100)+(a/=100);if(o>=1)return[t,0,100*(n/o)];var i=1-a;return[t,100*(0===i?0:1-n/i),100*i]},formats:{hwb:{coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),Co=new sn({id:"a98rgb-linear",cssId:"--a98-rgb-linear",name:"Linear Adobe® 98 RGB compatible",white:"D65",toXYZ_M:[[.5766690429101305,.1855582379065463,.1882286462349947],[.29734497525053605,.6273635662554661,.07529145849399788],[.02703136138641234,.07068885253582723,.9913375368376388]],fromXYZ_M:[[2.0415879038107465,-.5650069742788596,-.34473135077832956],[-.9692436362808795,1.8759675015077202,.04155505740717557],[.013444280632031142,-.11836239223101838,1.0151749943912054]]}),xo=new sn({id:"a98rgb",cssId:"a98-rgb",name:"Adobe® 98 RGB compatible",base:Co,toBase:function(e){return e.map((function(e){return Math.pow(Math.abs(e),563/256)*Math.sign(e)}))},fromBase:function(e){return e.map((function(e){return Math.pow(Math.abs(e),256/563)*Math.sign(e)}))}}),Oo=new sn({id:"prophoto-linear",cssId:"--prophoto-rgb-linear",name:"Linear ProPhoto",white:"D50",base:dn,toXYZ_M:[[.7977666449006423,.13518129740053308,.0313477341283922],[.2880748288194013,.711835234241873,8993693872564e-17],[0,0,.8251046025104602]],fromXYZ_M:[[1.3457868816471583,-.25557208737979464,-.05110186497554526],[-.5446307051249019,1.5082477428451468,.02052744743642139],[0,0,1.2119675456389452]]}),So=new sn({id:"prophoto",cssId:"prophoto-rgb",name:"ProPhoto",base:Oo,toBase:function(e){return e.map((function(e){var r=e<0?-1:1,t=e*r;return t<16/512?e/16:r*Math.pow(t,1.8)}))},fromBase:function(e){return e.map((function(e){var r=e<0?-1:1,t=e*r;return t>=1/512?r*Math.pow(t,1/1.8):16*e}))}}),_o=1.09929682680944,jo=.018053968510807,Bo=new sn({id:"--rec2020-oetf",name:"REC.2020_Scene_Referred",base:Ta,referred:"scene",toBase:function(e){return e.map((function(e){var r=e<0?-1:1,t=e*r;return t<4.5*jo?e/4.5:r*Math.pow((t+_o-1)/_o,1/.45)}))},fromBase:function(e){return e.map((function(e){var r=e<0?-1:1,t=e*r;return t>=jo?r*(_o*Math.pow(t,.45)-(_o-1)):4.5*e}))}}),Eo=new an({id:"oklch",name:"OkLCh",coords:{l:{refRange:[0,1],name:"Lightness"},c:{refRange:[0,.4],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},white:"D65",base:En,fromBase:yn.fromBase,toBase:yn.toBase,formats:{oklch:{coords:["<percentage> | <number>","<number> | <percentage>","<number> | <angle>"]}}}),Ao=2*Math.PI,Po=[[4.076741636075958,-3.307711539258063,.2309699031821043],[-1.2684379732850315,2.609757349287688,-.341319376002657],[-.0041960761386756,-.7034186179359362,1.7076146940746117]],Ro=[[[-1.8817031,-.80936501],[1.19086277,1.76576728,.59662641,.75515197,.56771245]],[[1.8144408,-1.19445267],[.73956515,-.45954404,.08285427,.12541073,-.14503204]],[[.13110758,1.81333971],[1.35733652,-.00915799,-1.1513021,-.50559606,.00692167]]],To=Number.MAX_VALUE,Lo=.206,Do=(1+Lo)/1.03;function Io(e,r){var t=e.length;if(t!==r.length)throw new Error("Vectors of size ".concat(t," and ").concat(r.length," are not aligned"));var n=0;return e.forEach((function(e,t){n+=e*r[t]})),n}function No(e){return.5*(Do*e-Lo+Math.sqrt((Do*e-Lo)*(Do*e-Lo)+.12*Do*e))}function zo(e){return(Math.pow(e,2)+Lo*e)/(Do*(e+.03))}function Fo(e){var r=gt(e,2),t=r[0],n=r[1];return[n/t,n/(1-t)]}function qo(e,r){var t=Bt(e,Bn);return t[0]=Math.pow(t[0],3),t[1]=Math.pow(t[1],3),t[2]=Math.pow(t[2],3),Bt(t,r,t)}function Ho(e,r,t,n){var a=function(e,r,t,n){var a,o,i,u,s,c,l,f;if(Io(n[0][0],[e,r])>1){var h=gt(n[0][1],5);a=h[0],o=h[1],i=h[2],u=h[3],s=h[4];var d=gt(t[0],3);c=d[0],l=d[1],f=d[2]}else if(Io(n[1][0],[e,r])>1){var p=gt(n[1][1],5);a=p[0],o=p[1],i=p[2],u=p[3],s=p[4];var g=gt(t[1],3);c=g[0],l=g[1],f=g[2]}else{var v=gt(n[2][1],5);a=v[0],o=v[1],i=v[2],u=v[3],s=v[4];var m=gt(t[2],3);c=m[0],l=m[1],f=m[2]}var b=a+o*e+i*r+u*Math.pow(e,2)+s*e*r,y=Io(Bn[0].slice(1),[e,r]),w=Io(Bn[1].slice(1),[e,r]),M=Io(Bn[2].slice(1),[e,r]),k=1+b*y,C=1+b*w,x=1+b*M,O=Math.pow(k,3),S=Math.pow(C,3),_=Math.pow(x,3),j=3*y*Math.pow(k,2),B=3*w*Math.pow(C,2),E=3*M*Math.pow(x,2),A=6*Math.pow(y,2)*k,P=6*Math.pow(w,2)*C,R=6*Math.pow(M,2)*x,T=c*O+l*S+f*_,L=c*j+l*B+f*E,D=c*A+l*P+f*R;return b-=T*L/(Math.pow(L,2)-.5*T*D)}(e,r,t,n),o=qo([1,a*e,a*r],t),i=qt(1/Math.max.apply(Math,lt(o)),1/3);return[i,i*a]}function Wo(e,r,t){var n=gt(e,3),a=n[0],o=n[1],i=n[2],u=Ho(o,i,r,t),s=function(e,r,t,n,a,o,i,u){var s;if(void 0===u&&(u=Ho(e,r,o,i)),(t-a)*u[1]-(u[0]-a)*n<=0)s=u[1]*a/(n*u[0]+u[1]*(a-t));else{s=u[1]*(a-1)/(n*(u[0]-1)+u[1]*(a-t));var c=t-a,l=n,f=Io(Bn[0].slice(1),[e,r]),h=Io(Bn[1].slice(1),[e,r]),d=Io(Bn[2].slice(1),[e,r]),p=c+l*f,g=c+l*h,v=c+l*d,m=a*(1-s)+s*t,b=s*n,y=m+b*f,w=m+b*h,M=m+b*d,k=Math.pow(y,3),C=Math.pow(w,3),x=Math.pow(M,3),O=3*p*Math.pow(y,2),S=3*g*Math.pow(w,2),_=3*v*Math.pow(M,2),j=6*Math.pow(p,2)*y,B=6*Math.pow(g,2)*w,E=6*Math.pow(v,2)*M,A=Io(o[0],[k,C,x])-1,P=Io(o[0],[O,S,_]),R=P/(P*P-.5*A*Io(o[0],[j,B,E])),T=-A*R,L=Io(o[1],[k,C,x])-1,D=Io(o[1],[O,S,_]),I=D/(D*D-.5*L*Io(o[1],[j,B,E])),N=-L*I,z=Io(o[2],[k,C,x])-1,F=Io(o[2],[O,S,_]),q=F/(F*F-.5*z*Io(o[2],[j,B,E])),H=-z*q;T=R>=0?T:To,N=I>=0?N:To,H=q>=0?H:To,s+=Math.min(T,Math.min(N,H))}return s}(o,i,a,1,a,r,t,u),c=Fo(u),l=s/Math.min(a*c[0],(1-a)*c[1]),f=function(e,r){return[.11516993+1/(7.4477897+4.1590124*r+e*(1.75198401*r-2.19557347+e*(-2.13704948-10.02301043*r+e*(5.38770819*r-4.24894561+4.69891013*e)))),.11239642+1/(1.6132032-.68124379*r+e*(.40370612+.90148123*r+e*(.6122399*r-.27087943+e*(.00299215-.45399568*r-.14661872*e))))]}(o,i),h=a*f[0],d=(1-a)*f[1],p=.9*l*Math.sqrt(Math.sqrt(1/(1/Math.pow(h,4)+1/Math.pow(d,4))));return h=.4*a,d=.8*(1-a),[Math.sqrt(1/(1/Math.pow(h,2)+1/Math.pow(d,2))),p,s]}var Jo=new an({id:"okhsl",name:"Okhsl",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,1],name:"Saturation"},l:{range:[0,1],name:"Lightness"}},base:En,gamutSpace:"self",fromBase:function(e){return function(e,r,t){var n=e[0],a=0,o=No(n),i=Math.sqrt(Math.pow(e[1],2)+Math.pow(e[2],2)),u=.5+Math.atan2(-e[2],-e[1])/Ao;if(0!==o&&1!==o&&0!==i){var s,c,l=gt(Wo([n,e[1]/i,e[2]/i],r,t),3),f=l[0],h=l[1],d=l[2];a=i<h?.8*(i/((c=.8*f)+(1-c/h)*i)):.8+.2*((i-(s=h))/((c=.2*Math.pow(h,2)*Math.pow(1.25,2)/f)+(1-c/(d-h))*(i-s)))}var p=Math.abs(a)<1e-4;return p||0===o||Math.abs(1-o)<1e-7?(u=null,p||(a=0)):u=mn(360*u),[u,a,o]}(e,Po,Ro)},toBase:function(e){return function(e,r,t){var n=gt(e,3),a=n[0],o=n[1],i=zo(n[2]),u=null,s=null;if(a=mn(a)/360,0!==i&&1!==i&&0!==o){var c,l,f,h,d=Math.cos(Ao*a),p=Math.sin(Ao*a),g=gt(Wo([i,d,p],r,t),3),v=g[0],m=g[1],b=g[2];o<.8?(c=1.25*o,l=0,h=1-(f=.8*v)/m):(c=5*(o-.8),l=m,h=1-(f=.2*Math.pow(m,2)*Math.pow(1.25,2)/v)/(b-m));var y=l+c*f/(1-h*c);u=y*d,s=y*p}return[i,u,s]}(e,Po,Ro)},formats:{color:{id:"--okhsl",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),$o=new an({id:"oklrab",name:"Oklrab",coords:{l:{refRange:[0,1],name:"Lightness"},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:"D65",base:En,fromBase:function(e){return[No(e[0]),e[1],e[2]]},toBase:function(e){return[zo(e[0]),e[1],e[2]]},formats:{color:{coords:["<percentage> | <number>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}}),Xo=new an({id:"oklrch",name:"Oklrch",coords:{l:{refRange:[0,1],name:"Lightness"},c:{refRange:[0,.4],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},white:"D65",base:$o,fromBase:yn.fromBase,toBase:yn.toBase,formats:{color:{coords:["<percentage> | <number>","<number> | <percentage>[0,1]","<number> | <angle>"]}}});var Go=new an({id:"okhsv",name:"Okhsv",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,1],name:"Saturation"},v:{range:[0,1],name:"Value"}},base:En,gamutSpace:"self",fromBase:function(e){return function(e,r,t){var n=e[0],a=0,o=No(n),i=Math.sqrt(Math.pow(e[1],2)+Math.pow(e[2],2)),u=.5+Math.atan2(-e[2],-e[1])/Ao;if(0!==n&&1!==n&&0!==i){var s=e[1]/i,c=e[2]/i,l=gt(Fo(Ho(s,c,r,t)),2),f=l[0],h=l[1],d=1-.5/f,p=h/(i+n*h),g=p*n,v=p*i,m=zo(g),b=v*m/g,y=gt(qo([m,s*b,c*b],r),3),w=y[0],M=y[1],k=y[2],C=qt(1/Math.max(Math.max(w,M),Math.max(k,0)),1/3);i=(i/=C)*No(n/=C)/n,o=(n=No(n))/g,a=(.5+h)*v/(.5*h+h*d*v)}return[u=Math.abs(a)<1e-4||0===o?null:mn(360*u),a,o]}(e,Po,Ro)},toBase:function(e){return function(e,r,t){var n=gt(e,3),a=n[0],o=n[1],i=n[2];a=mn(a)/360;var u=zo(i),s=null,c=null;if(0!==u&&0!==o){var l=Math.cos(Ao*a),f=Math.sin(Ao*a),h=gt(Fo(Ho(l,f,r,t)),2),d=h[0],p=h[1],g=1-.5/d,v=1-.5*o/(.5+p-p*g*o),m=o*p*.5/(.5+p-p*g*o);u=i*v;var b=i*m,y=zo(v),w=m*y/v,M=zo(u);b=b*M/u,u=M;var k=gt(qo([y,l*w,f*w],r),3),C=k[0],x=k[1],O=k[2],S=qt(1/Math.max(Math.max(C,x),Math.max(O,0)),1/3);u*=S,s=(b*=S)*l,c=b*f}return[u,s,c]}(e,Po,Ro)},formats:{color:{id:"--okhsv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),Vo=Yt.D65,Ko=gt(uo({space:un,coords:Vo}),2),Uo=Ko[0],Yo=Ko[1],Zo=new an({id:"luv",name:"Luv",coords:{l:{refRange:[0,100],name:"Lightness"},u:{refRange:[-215,215]},v:{refRange:[-215,215]}},white:Vo,base:un,fromBase:function(e){var r=[Tt(e[0]),Tt(e[1]),Tt(e[2])],t=r[1],n=gt(uo({space:un,coords:r}),2),a=n[0],o=n[1];if(!Number.isFinite(a)||!Number.isFinite(o))return[0,0,0];var i=t<=216/24389?24389/27*t:116*Math.cbrt(t)-16;return[i,13*i*(a-Uo),13*i*(o-Yo)]},toBase:function(e){var r=gt(e,3),t=r[0],n=r[1],a=r[2];if(0===t||Rt(t))return[0,0,0];n=Tt(n),a=Tt(a);var o=n/(13*t)+Uo,i=a/(13*t)+Yo,u=t<=8?t/(24389/27):Math.pow((t+16)/116,3);return[u*(9*o/(4*i)),u,u*((12-3*o-20*i)/(4*i))]},formats:{color:{id:"--luv",coords:["<number> | <percentage>","<number> | <percentage>","<number> | <percentage>"]}}}),Qo=new an({id:"lchuv",name:"LChuv",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,220],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:Zo,fromBase:yn.fromBase,toBase:yn.toBase,formats:{color:{id:"--lchuv",coords:["<number> | <percentage>","<number> | <percentage>","<number> | <angle>"]}}}),ei=Ia[0][0],ri=Ia[0][1],ti=Ia[0][2],ni=Ia[1][0],ai=Ia[1][1],oi=Ia[1][2],ii=Ia[2][0],ui=Ia[2][1],si=Ia[2][2];function ci(e,r,t){var n=r/(Math.sin(t)-e*Math.cos(t));return n<0?1/0:n}function li(e){var r=Math.pow(e+16,3)/1560896,t=r>216/24389?r:e/(24389/27),n=t*(284517*ei-94839*ti),a=t*(838422*ti+769860*ri+731718*ei),o=t*(632260*ti-126452*ri),i=t*(284517*ni-94839*oi),u=t*(838422*oi+769860*ai+731718*ni),s=t*(632260*oi-126452*ai),c=t*(284517*ii-94839*si),l=t*(838422*si+769860*ui+731718*ii),f=t*(632260*si-126452*ui);return{r0s:n/o,r0i:a*e/o,r1s:n/(o+126452),r1i:(a-769860)*e/(o+126452),g0s:i/s,g0i:u*e/s,g1s:i/(s+126452),g1i:(u-769860)*e/(s+126452),b0s:c/f,b0i:l*e/f,b1s:c/(f+126452),b1i:(l-769860)*e/(f+126452)}}function fi(e,r){var t=r/360*Math.PI*2,n=ci(e.r0s,e.r0i,t),a=ci(e.r1s,e.r1i,t),o=ci(e.g0s,e.g0i,t),i=ci(e.g1s,e.g1i,t),u=ci(e.b0s,e.b0i,t),s=ci(e.b1s,e.b1i,t);return Math.min(n,a,o,i,u,s)}var hi=new an({id:"hsluv",name:"HSLuv",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:Qo,gamutSpace:Ha,fromBase:function(e){var r,t=[Tt(e[0]),Tt(e[1]),Tt(e[2])],n=t[0],a=t[2];if(n>99.9999999)r=0,n=100;else if(n<1e-8)r=0,n=0;else{r=t[1]/fi(li(n),a)*100}return[a,r,n]},toBase:function(e){var r,t=[Tt(e[0]),Tt(e[1]),Tt(e[2])],n=t[0],a=t[1],o=t[2];if(o>99.9999999)o=100,r=0;else if(o<1e-8)o=0,r=0;else{r=fi(li(o),n)/100*a}return[o,r,n]},formats:{color:{id:"--hsluv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}});function di(e,r){return Math.abs(r)/Math.sqrt(Math.pow(e,2)+1)}function pi(e){var r=di(e.r0s,e.r0i),t=di(e.r1s,e.r1i),n=di(e.g0s,e.g0i),a=di(e.g1s,e.g1i),o=di(e.b0s,e.b0i),i=di(e.b1s,e.b1i);return Math.min(r,t,n,a,o,i)}Ia[0][0],Ia[0][1],Ia[0][2],Ia[1][0],Ia[1][1],Ia[1][2],Ia[2][0],Ia[2][1],Ia[2][2];var gi=new an({id:"hpluv",name:"HPLuv",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:Qo,gamutSpace:"self",fromBase:function(e){var r,t=[Tt(e[0]),Tt(e[1]),Tt(e[2])],n=t[0],a=t[2];if(n>99.9999999)r=0,n=100;else if(n<1e-8)r=0,n=0;else{r=t[1]/pi(li(n))*100}return[a,r,n]},toBase:function(e){var r,t=[Tt(e[0]),Tt(e[1]),Tt(e[2])],n=t[0],a=t[1],o=t[2];if(o>99.9999999)o=100,r=0;else if(o<1e-8)o=0,r=0;else{r=pi(li(o))/100*a}return[o,r,n]},formats:{color:{id:"--hpluv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),vi=new sn({id:"rec2100-linear",name:"Linear REC.2100",white:"D65",toBase:Ta.toBase,fromBase:Ta.fromBase}),mi=2610/Math.pow(2,14),bi=Math.pow(2,14)/2610,yi=2523/Math.pow(2,5),wi=Math.pow(2,5)/2523,Mi=3424/Math.pow(2,12),ki=2413/Math.pow(2,7),Ci=2392/Math.pow(2,7),xi=new sn({id:"rec2100pq",cssId:"rec2100-pq",name:"REC.2100-PQ",base:vi,toBase:function(e){return e.map((function(e){return 1e4*Math.pow(Math.max(Math.pow(e,wi)-Mi,0)/(ki-Ci*Math.pow(e,wi)),bi)/203}))},fromBase:function(e){return e.map((function(e){var r=Math.max(203*e/1e4,0),t=Mi+ki*Math.pow(r,mi),n=1+Ci*Math.pow(r,mi);return Math.pow(t/n,yi)}))}}),Oi=new sn({id:"rec2100hlg",cssId:"rec2100-hlg",name:"REC.2100-HLG",referred:"scene",base:vi,toBase:function(e){return e.map((function(e){return e<=.5?Math.pow(e,2)/3*3.7743:(Math.exp((e-.55991073)/.17883277)+.28466892)/12*3.7743}))},fromBase:function(e){return e.map((function(e){return(e/=3.7743)<=1/12?qt(3*e,.5):.17883277*Math.log(12*e-.28466892)+.55991073}))}}),Si={};function _i(e){var r=e.id;e.toCone_M,e.fromCone_M;Si[r]=arguments[0]}function ji(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Bradford",n=Si[t],a=_t(n.toCone_M,e),o=gt(a,3),i=o[0],u=o[1],s=o[2],c=_t(n.toCone_M,r),l=gt(c,3),f=l[0],h=l[1],d=l[2],p=[[f/i,0,0],[0,h/u,0],[0,0,d/s]],g=_t(p,n.toCone_M),v=_t(n.fromCone_M,g);return v}Xt.add("chromatic-adaptation-start",(function(e){e.options.method&&(e.M=ji(e.W1,e.W2,e.options.method))})),Xt.add("chromatic-adaptation-end",(function(e){e.M||(e.M=ji(e.W1,e.W2,e.options.method))})),_i({id:"von Kries",toCone_M:[[.40024,.7076,-.08081],[-.2263,1.16532,.0457],[0,0,.91822]],fromCone_M:[[1.8599363874558397,-1.1293816185800916,.21989740959619328],[.3611914362417676,.6388124632850422,-6370596838649899e-21],[0,0,1.0890636230968613]]}),_i({id:"Bradford",toCone_M:[[.8951,.2664,-.1614],[-.7502,1.7135,.0367],[.0389,-.0685,1.0296]],fromCone_M:[[.9869929054667121,-.14705425642099013,.15996265166373122],[.4323052697233945,.5183602715367774,.049291228212855594],[-.00852866457517732,.04004282165408486,.96848669578755]]}),_i({id:"CAT02",toCone_M:[[.7328,.4296,-.1624],[-.7036,1.6975,.0061],[.003,.0136,.9834]],fromCone_M:[[1.0961238208355142,-.27886900021828726,.18274517938277307],[.4543690419753592,.4735331543074117,.07209780371722911],[-.009627608738429355,-.00569803121611342,1.0153256399545427]]}),_i({id:"CAT16",toCone_M:[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],fromCone_M:[[1.862067855087233,-1.0112546305316845,.14918677544445172],[.3875265432361372,.6214474419314753,-.008973985167612521],[-.01584149884933386,-.03412293802851557,1.0499644368778496]]}),Object.assign(Yt,{A:[1.0985,1,.35585],C:[.98074,1,1.18232],D55:[.95682,1,.92149],D75:[.94972,1,1.22638],E:[1,1,1],F2:[.99186,1,.67393],F7:[.95041,1,1.08747],F11:[1.00962,1,.6435]}),Yt.ACES=[.32168/.33767,1,.34065/.33767];var Bi=new sn({id:"acescg",cssId:"--acescg",name:"ACEScg",coords:{r:{range:[0,65504],name:"Red"},g:{range:[0,65504],name:"Green"},b:{range:[0,65504],name:"Blue"}},referred:"scene",white:Yt.ACES,toXYZ_M:[[.6624541811085053,.13400420645643313,.1561876870049078],[.27222871678091454,.6740817658111484,.05368951740793705],[-.005574649490394108,.004060733528982826,1.0103391003129971]],fromXYZ_M:[[1.6410233796943257,-.32480329418479,-.23642469523761225],[-.6636628587229829,1.6153315916573379,.016756347685530137],[.011721894328375376,-.008284441996237409,.9883948585390215]]}),Ei=Math.pow(2,-16),Ai=(Math.log2(65504)+9.72)/17.52,Pi=new sn({id:"acescc",cssId:"--acescc",name:"ACEScc",coords:{r:{range:[-.35828683,Ai],name:"Red"},g:{range:[-.35828683,Ai],name:"Green"},b:{range:[-.35828683,Ai],name:"Blue"}},referred:"scene",base:Bi,toBase:function(e){return e.map((function(e){return e<=(9.72-15)/17.52?2*(Math.pow(2,17.52*e-9.72)-Ei):e<Ai?Math.pow(2,17.52*e-9.72):65504}))},fromBase:function(e){return e.map((function(e){return e<=0?(Math.log2(Ei)+9.72)/17.52:e<Ei?(Math.log2(Ei+.5*e)+9.72)/17.52:(Math.log2(e)+9.72)/17.52}))}}),Ri=Object.freeze({__proto__:null,A98RGB:xo,A98RGB_Linear:Co,ACEScc:Pi,ACEScg:Bi,CAM16_JMh:va,HCT:Ma,HPLuv:gi,HSL:wo,HSLuv:hi,HSV:Mo,HWB:ko,ICTCP:ra,JzCzHz:Un,Jzazbz:Kn,LCH:yn,LCHuv:Qo,Lab:vn,Lab_D65:ao,Luv:Zo,OKLCH:Eo,OKLab:En,OKLrCH:Xo,OKLrab:$o,Okhsl:Jo,Okhsv:Go,P3:Wa,P3_Linear:Da,ProPhoto:So,ProPhoto_Linear:Oo,REC_2020:La,REC_2020_Linear:Ta,REC_2020_Scene_Referred:Bo,REC_2100_HLG:Oi,REC_2100_Linear:vi,REC_2100_PQ:xi,XYZ_ABS_D65:Dn,XYZ_D50:dn,XYZ_D65:un,sRGB:Ha,sRGB_Linear:Na}),Ti=function(){function e(){var r,t,n,a,o=this;Mt(this,e);for(var i=arguments.length,u=new Array(i),s=0;s<i;s++)u[s]=arguments[s];if(1===u.length){var c={};"object"===yt(u[0])&&Object.getPrototypeOf(u[0]).constructor===Object&&(u[0]=ht({},u[0])),r=nn(u[0],{parseMeta:c}),c.format&&(this.parseMeta=c)}r?(t=r.space||r.spaceId,n=r.coords,a=r.alpha):(t=u[0],n=u[1],a=u[2]),Object.defineProperty(this,"space",{value:an.get(t),writable:!1,enumerable:!0,configurable:!0}),this.coords=n?n.slice():[0,0,0],this.alpha=Rt(a)?a:void 0===a?1:zt(0,a,1);var l=function(e){Object.defineProperty(o,e,{get:function(){return o.get(e)},set:function(r){return o.set(e,r)}})};for(var f in this.space.coords)l(f)}return Ct(e,[{key:"spaceId",get:function(){return this.space.id}},{key:"clone",value:function(){return new e(this.space,this.coords,this.alpha)}},{key:"toJSON",value:function(){return{spaceId:this.spaceId,coords:this.coords,alpha:this.alpha}}},{key:"display",value:function(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];var a=Ka.apply(void 0,[this].concat(t));return a.color=new e(a.color),a}}],[{key:"get",value:function(r){if(Jt(r,this))return r;for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];return dt(e,[r].concat(n))}},{key:"try",value:function(r,t){if(Jt(r,this))return r;var n=function e(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Array.isArray(r))return r.map((function(r){return e(r,t)}));var n=t.cssProperty,a=void 0===n?"background-color":n,o=t.element,i=ut(t,tt),u=null;try{return nn(r,i)}catch(e){u=e}var s=globalThis.CSS,c=globalThis.getComputedStyle;if(Et(r)&&o&&s&&c&&s.supports(a,r)){var l=o.style[a];r!==l&&(o.style[a]=r);var f=c(o).getPropertyValue(a);if(r!==l&&(o.style[a]=l),f!==r)try{return nn(f,i)}catch(e){u=e}else u={message:"Color value is a valid CSS color, but it could not be resolved :("}}return t.errorMeta&&(t.errorMeta.error=u),null}(r,t);return n?new e(n):null}},{key:"defineFunction",value:function(r,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,a=n.instance,o=void 0===a||a,i=n.returns,u=function(){var r=t.apply(void 0,arguments);if("color"===i)r=e.get(r);else if("function<color>"===i){var n=r;r=function(){var r=n.apply(void 0,arguments);return e.get(r)},Object.assign(r,n)}else"array<color>"===i&&(r=r.map((function(r){return e.get(r)})));return r};r in e||(e[r]=u),o&&(e.prototype[r]=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return u.apply(void 0,[this].concat(r))})}},{key:"defineFunctions",value:function(r){for(var t in r)e.defineFunction(t,r[t],r[t])}},{key:"extend",value:function(r){if(r.register)r.register(e);else for(var t in r)e.defineFunction(t,r[t])}}]),e}();Ti.defineFunctions({get:ln,getAll:cn,set:hn,setAll:fn,to:Aa,equals:function(e,r){return e=nn(e),r=nn(r),e.space===r.space&&e.alpha===r.alpha&&e.coords.every((function(e,t){return e===r.coords[t]}))},inGamut:Pn,toGamut:ja,distance:Tn,deltas:function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=t.space,a=t.hue,o=void 0===a?"shorter":a;e=nn(e),n||(n=e.space),n=an.get(n);var i=Object.values(n.coords),u=[e,r].map((function(e){return Aa(e,n)})),s=gt(u,2),c=[e=s[0],r=s[1]].map((function(e){return e.coords})),l=gt(c,2),f=l[0],h=l[1],d=f.map((function(e,r){var t=i[r],n=h[r];if("angle"===t.type){var a=gt(bn(o,[e,n]),2);e=a[0],n=a[1]}return Ua(e,n)})),p=Ua(e.alpha,r.alpha);return{space:n,coords:d,alpha:p}},toString:Pa}),Object.assign(Ti,{util:$t,hooks:Xt,WHITES:Yt,Space:an,spaces:an.registry,parse:en,defaults:Gt});for(var Li=0,Di=Object.keys(Ri);Li<Di.length;Li++){var Ii=Di[Li];an.register(Ri[Ii])}for(var Ni in an.registry)zi(Ni,an.registry[Ni]);function zi(e,r){var t=e.replace(/-/g,"_");Object.defineProperty(Ti.prototype,t,{get:function(){var t=this,n=this.getAll(e);if("undefined"==typeof Proxy)return n;var a=new Proxy(n,{has:function(e,t){try{return an.resolveCoord([r,t]),!0}catch(e){}return Reflect.has(e,t)},get:function(e,t,n){if(t&&"symbol"!==yt(t)&&!(t in e)&&t in a){var o=an.resolveCoord([r,t]).index;if(o>=0)return e[o]}return Reflect.get(e,t,n)},set:function(n,a,o,i){if(a&&"symbol"!==yt(a)&&!(a in n)||Number(a)>=0){var u=an.resolveCoord([r,a]).index;if(u>=0)return n[u]=o,t.setAll(e,n),!0}return Reflect.set(n,a,o,i)}});return a},set:function(r){this.setAll(e,r)},configurable:!0,enumerable:!0})}function Fi(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function qi(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?Fi(Object(t),!0).forEach((function(r){Hi(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Fi(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function Hi(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}Xt.add("colorspace-init-end",(function(e){var r;zi(e.id,e),null===(r=e.aliases)||void 0===r||r.forEach((function(r){zi(r,e)}))})),Ti.extend(Oa),Ti.extend({deltaE:lo}),Object.assign(Ti,{deltaEMethods:Oa}),Ti.extend(po),Ti.extend({contrast:function(e,r,t){Et(t)&&(t={algorithm:t});var n=t||{},a=n.algorithm,o=ut(n,at);if(!a){var i=Object.keys(io).map((function(e){return e.replace(/^contrast/,"")})).join(", ");throw new TypeError("contrast() function needs a contrast algorithm. Please specify one of: ".concat(i))}for(var u in e=nn(e),r=nn(r),io)if("contrast"+a.toLowerCase()===u.toLowerCase())return io[u](e,r,o);throw new TypeError("Unknown contrast algorithm: ".concat(a))}}),Ti.extend(co),Ti.extend(Qa),Ti.extend(yo),Ti.extend(io);var Wi=qi(qi({},Z),{},{windowtext:[0,0,0],transparent:[255,255,255,0]}),Ji=new RegExp(Object.keys(Wi).map((function(e){return"\\b".concat(e,"\\b")})).join("|"),"ig"),$i=function(e){var r=e.object();return r.a=r.alpha||1,delete r.alpha,r},Xi=function(e){return e.alpha=e.a,delete e.a,Gi(e)},Gi=function e(r){var t=null;try{t=r instanceof ur?r:ur(r)}catch(n){try{t=e(new Ti(r).to("srgb").toString())}catch(e){console.log("ignore the invalid color: `".concat(r,"`"))}}return t},Vi=function(e,r){return e.replace(b,"").replace(Ji,(function(e){if(!r&&"transparent"===e)return e;var t=Wi[e.toLowerCase()];return"".concat(t.length>3?"rgba":"rgb","(").concat(t.toString(),")")}))},Ki=function(e){var r=Vi(e);return M.test(r)?r:""},Ui=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"mix";if("[object Array]"!==Object.prototype.toString.call(e)||e.length<1)return null;if(1===e.length)return e[0];for(var t=Gi(e.shift()),a=Gi(e.shift());a;){if(!t&&a)t=a;else if(t||a)t&&a&&(t="mix"===r?t.mix(a,a.alpha()):Xi(n[r]($i(t),$i(a))));else{if(0===e.length)break;t=Gi(e.shift())}if(0===e.length)break;a=Gi(e.shift())}return t||null},Yi=function(e){return(299*e[0]+587*e[1]+114*e[2])/1e3},Zi=function(e,r){var t=e/Yi(r),n=Math.min(255,r[0]*t),a=Math.min(255,r[1]*t),o=Math.min(255,r[2]*t);return 0===a||255===n||255===o?a=(1e3*e-299*n-114*o)/587:0===n?n=(1e3*e-587*a-114*o)/299:0!==o&&255!==a||(o=(1e3*e-299*n-587*a)/114),ur.rgb(n,a,o)};function Qi(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var n,a,o=[],i=!0,u=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(o.push(n.value),!r||o.length!==r);i=!0);}catch(e){u=!0,a=e}finally{try{i||null==t.return||t.return()}finally{if(u)throw a}}return o}(e,r)||ru(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eu(e){return function(e){if(Array.isArray(e))return tu(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ru(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ru(e,r){if(e){if("string"==typeof e)return tu(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?tu(e,r):void 0}}function tu(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function nu(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function au(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var ou=function(){function e(){!function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e),au(this,"_idx",0),au(this,"_defaultDarkTextColorRgb",null),au(this,"_defaultDarkBgColorRgb",null),au(this,"_defaultDarkBgColorHSL",null),au(this,"_defaultDarkTextColorBrightness",null),au(this,"_defaultDarkBgColorBrightness",null),au(this,"_defaultDarkBgColorHslBrightness",null),au(this,"_maxLimitOffsetBrightness",null),au(this,"isDarkmode",!1)}var r,t,n;return r=e,(t=[{key:"_adjustBrightness",value:function(e,r,t,n,a){var o,i=e.alpha(),u="";if(t.isBgColor){if(i>=.05&&(r[h]&&delete r[h],r[d])){if(r[d]===e.toString()||this.getContrast(r[d],e.toString())<1.1)return{newColor:a?e.toString():"",extStyle:u};V(r).forEach((function(e){delete e[d]}))}if(o=this._adjustBackgroundBrightness(e),!t.hasInlineColor){var f=r[l]||C.defaultLightTextColor,p=Gi(f);if(p){var g=this._adjustBrightness(p,r,{isTextColor:!0,parentElementBgColorStr:o||e},n,a);u+=cu.genCssKV("color",g.newColor||p),V(r).forEach((function(e){e[s]=g.newColor||p,e[l]=p}))}}}else if(t.isTextColor||t.isBorderColor){var v=t.parentElementBgColorStr||t.isTextColor&&r[c]||C.defaultDarkBgColor,m=Gi(v);if(m&&!r[h]){o=this._adjustTextBrightness(e,m);var b="";n?b="ByUpdateStyle":a&&(b="ByReset"),iu.emit("afterConvertTextColor".concat(b),r,{fontColor:o,bgColor:m})}}else t.isTextShadow&&(r[h]||(o=this._adjustBackgroundBrightness(e)));return{newColor:o&&e.toString()!==o.toString()&&o.alpha(i).rgb(),extStyle:u}}},{key:"_adjustTextBrightness",value:function(e,r){var t=r.rgb().array(),n=r.alpha(),a=Yi(t)*n+this._defaultDarkBgColorBrightness*(1-n),o=e.rgb().array(),i=e.hsl().array(),u=e.alpha(),s=Yi(o),c=Math.abs(a-s);if(s>=250)return e;if(c>this._maxLimitOffsetBrightness&&a<=this._defaultDarkBgColorBrightness+2)return Zi(this._maxLimitOffsetBrightness+a,o).alpha(u);if(c>=65)return e;if(a>=100){if(i[2]>50){i[2]=90-i[2];var l=ur.hsl.apply(ur,eu(i)).alpha(u);return this._adjustTextBrightness(l,r)}return Zi(Math.min(this._maxLimitOffsetBrightness,a-65),o).alpha(u)}if(i[2]<=40){i[2]=90-i[2];var f=ur.hsl.apply(ur,eu(i)).alpha(u);return this._adjustTextBrightness(f,r)}return Zi(Math.min(this._maxLimitOffsetBrightness,a+65),o).alpha(u)}},{key:"_adjustBackgroundBrightness",value:function(e){var r=e.rgb().array(),t=e.hsl().array(),n=e.alpha(),a=Yi(r),o=e;return 0===t[1]&&t[2]>40||a>250?o=ur.hsl(0,0,Math.min(100,100+this._defaultDarkBgColorHslBrightness-t[2])):a>190?o=Zi(190,r).alpha(n):t[2]<22&&(t[2]=22,o=ur.hsl.apply(ur,eu(t))),o.alpha(n).rgb()}},{key:"_updateBgWithGradient",value:function(e,r,t,n,a,o,i){var u=Ui([r[c]||C.defaultDarkBgColor,e],"normal"),s=(r[f]||C.defaultLightBgColor).split("|").concat(e.toString()).join("|");V(r).forEach((function(e){e[c]=u,e[f]=s}));var l=n.slice(-1)[0];if("color"===l[0]){var h=this._adjustBrightness(Gi(Vi(l[1])),r,{isBgColor:!1,isTextShadow:!1,isTextColor:!0,isBorderColor:!1,hasInlineColor:a},o,i);if(h.newColor)return cu.genCss(t,cu.genCssKV("color",h.newColor))}return""}},{key:"_try",value:function(e){try{return e()}catch(e){console.log("An error occurred when running the dark mode conversion algorithm\n",e),"function"==typeof C.error&&C.error(e)}}},{key:"init",value:function(){this._defaultDarkTextColorRgb=Gi(C.defaultDarkTextColor).rgb().array(),this._defaultDarkBgColorRgb=Gi(C.defaultDarkBgColor).rgb().array(),this._defaultDarkBgColorHSL=Gi(C.defaultDarkBgColor).hsl().array(),this._defaultDarkTextColorBrightness=Yi(this._defaultDarkTextColorRgb),this._defaultDarkBgColorBrightness=Yi(this._defaultDarkBgColorRgb),this._defaultDarkBgColorHslBrightness=this._defaultDarkBgColorHSL[2],this._maxLimitOffsetBrightness=this._defaultDarkTextColorBrightness-this._defaultDarkBgColorBrightness}},{key:"convert",value:function(e,r,t,n){var a=this;iu.resetCss();var i="";t?i="ByUpdateStyle":n&&(i="ByReset"),iu.emit("beforeConvertNode".concat(i),e);var u="",p="";if(this.isDarkmode||t||n){var w=e.nodeName;if(C.whitelist.tagName.indexOf(w)>-1)return"";if(C.whitelist.attribute.some((function(r){return e.hasAttribute(r)})))return"";var x=e.style;r||(r=(x.cssText&&x.cssText.replace(/("[^;]*);([^;]*")|('[^;]*);([^;]*')/g,"$1$3".concat("<$#_SEMICOLON_#$>","$2$4")).split(";")||[]).map((function(e){var r=e.indexOf(":");return[e.slice(0,r).toLowerCase(),e.slice(r+1).replace(y,";")].map((function(e){return(e||"").replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}))})));var O=!1,S=!1,_=!1,j=null,B=null;r=r.filter((function(e){var r=Qi(e,2),t=r[0],n=r[1];return"color"===t?O=!0:/background/i.test(t)&&(S=!0,"background-position"===t?j=n:"background-size"===t&&(B=n)),(/background/i.test(t)||/^(-webkit-)?border-image/.test(t))&&/url\([^)]*\)/i.test(n)&&(_=!0),v.indexOf(t)>-1})).sort((function(e,r){var t=Qi(e,1)[0],n=Qi(r,1)[0];return"color"===t||"background-image"===t&&"background-color"===n||0===n.indexOf("-webkit-text")?1:-1})),m.indexOf(w)>-1&&!S&&this._try((function(){var t=function(e){var r=null;return Array.prototype.some.call(e.classList,(function(e){return!!K[e]&&(r=K[e],!0)})),r}(e);if(t||(t=e.getAttribute("bgcolor")),t){var n=Gi(t);n&&(r.unshift(["background-color",n.toString()]),S=!0)}})),"FONT"!==w||O||this._try((function(){var t=e.getAttribute("color");if(t){var n=Gi(t);n&&(r.push(["color",n.toString()]),O=!0)}}));var E="",A="",P=0;r.some((function(e,r){var t=Qi(e,2),n=t[0],o=t[1];return a._try((function(){if(0!==n.indexOf("-webkit-text"))return P=r,!0;switch(n){case"-webkit-text-fill-color":E=Ki(o);break;case"-webkit-text-stroke":var e=o.split(" ");2===e.length&&(A=Ki(e[1]));break;case"-webkit-text-stroke-color":A=Ki(o)}return!1}))})),E&&(O?r[r.length-1]=["-webkit-text-fill-color",E]:(r.push(["-webkit-text-fill-color",E]),O=!0)),P&&(r.splice(0,P),A&&r.unshift(["-webkit-text-stroke-color",A]));var R="",T="";if((t||n)&&e.className&&"string"==typeof e.className){var L=e.className.match(o);L&&(R=L[0]),(L=e.className.match(su.classNameReg))&&(T=L[0])}var D="",I=n;I&&cu.watch("color",(function(){I=!1,cu.unwatch("color")})),r.forEach((function(o){var i=Qi(o,2),v=i[0],m=i[1];return a._try((function(){var o,i=m,y=!1,w=g.BG_COLOR.indexOf(v)>-1,E=g.TEXT_SHADOW.indexOf(v)>-1,A=g.TEXT_COLOR.indexOf(v),P=g.BORDER_COLOR.indexOf(v)>-1,R=/gradient/.test(m),L=[],N="";if(m=Vi(m,R),M.test(m)){if(R){for(var z=k.exec(m);z;)L.push(z[0]),z=k.exec(m);o=Ui(L)}var F=0;m=m.replace(k,(function(r){R&&(r=o,y=!0);var i=Gi(r);if((null==i?void 0:i.alpha())>=.05){var u=a._adjustBrightness(i,e,{isBgColor:w,isTextShadow:E,isTextColor:A>-1,isBorderColor:P,hasInlineColor:O},t,n),d=!_&&u.newColor;if(N+=u.extStyle,w||A>=5){var p=d?d.toString():r;0===F&&V(e).forEach((function(e){w?(e[c]=p,e[f]=(e[f]||C.defaultLightBgColor).split("|").concat(r).join("|")):(e[s]=p,e[l]=r);var t=Gi(p);w&&(null==t?void 0:t.alpha())>=.05&&e[h]&&delete e[h]}))}return d&&(y=!0),F++,d||r}return r})).replace(/\s?!\s?important/gi,"")}if(N&&(D+=N),!(e instanceof SVGElement)){var q=/^background/.test(v),H=/^(-webkit-)?border-image/.test(v);if((q||H)&&/url\([^)]*\)/i.test(m)){y=!0;var W=Ui((e[f]||C.defaultLightBgColor).split("|"),"normal").toString();if(m=m.replace(/^(.*?)url\(([^)]*)\)(.*)$/i,(function(r){var t=r,a="";return e[h]||V(e).forEach((function(e){e[h]=!0})),q?(a=cu.genCssKV(v,W?"".concat(t,",linear-gradient(").concat(W,", ").concat(W,")"):t),j&&(D+=cu.genCssKV("background-position",j),a+=cu.genCssKV("background-position",W?"".concat(j,",top left"):j)),B&&(D+=cu.genCssKV("background-size",B),a+=cu.genCssKV("background-size",W?"".concat(B,",100%"):B)),n||(T?(p+=cu.genCss(T,a),V(e).forEach((function(e){e[d]=W||t}))):su.push(e,a,(function(e){var r=[e.elOld];e.el!==e.elOld&&r.push(e.el),r.forEach((function(e){V(e).forEach((function(e){e[d]=W||t}))}))})))):!W||S||n||(a=cu.genCssKV("background-image","linear-gradient(".concat(W,", ").concat(W,")")),T?p+=cu.genCss(T,a):su.push(e,a)),t})),!O){var J=e[l]||C.defaultLightTextColor;D+=cu.genCssKV("color",J),V(e).forEach((function(e){e[s]=J}))}}}(y||n)&&(!t&&!n&&b.test(i)&&(x[v]=i.replace(b,"")),R?n||(T?(p+=cu.genCss(T,cu.genCssKV(v,m)),/^background/.test(v)&&!/url\([^)]*\)/i.test(m)&&(u+=a._updateBgWithGradient(o,e,T,r,O,t,n))):su.push(e,cu.genCssKV(v,m),(function(i){/^background/.test(v)&&!/url\([^)]*\)/i.test(m)&&(u+=a._updateBgWithGradient(o,e,i.className,r,O,t,n))}))):("color"===v&&(I=!1,cu.unwatch("color")),D+=cu.genCssKV(v,!y&&n?e.style[v]:m)))}))})),I&&(D+=cu.genCssKV("color",e.style.color||e[s]||C.defaultDarkTextColor),cu.unwatch("color")),D&&(R||(R="".concat("js_darkmode__").concat(this._idx++),e.classList.add(R)),u+=D?cu.genCss(R,D):""),u+=p,t||!function(e){return e.textContent.replace(/\s/g,"").length>0}(e)||n||(C.delayBgJudge?uu.push(e):su.contains(e,(function(e){u+=cu.genCss(e.className,e.cssKV),"function"==typeof e.cb&&e.cb(e)})))}return iu.emit("afterConvertNode".concat(i),e),u}},{key:"getContrast",value:function(e,r){var t=Gi(e),n=Gi(r);return t&&n?t.contrast(n):0}}])&&nu(r.prototype,t),n&&nu(r,n),Object.defineProperty(r,"prototype",{writable:!1}),e}(),iu=new A,uu=new L("".concat("js_darkmode__","text__")),su=new N("".concat("js_darkmode__","bg__")),cu=new W,lu=new U,fu=new ou;function hu(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var n,a,o=[],i=!0,u=!1;try{for(t=t.call(e);!(i=(n=t.next()).done)&&(o.push(n.value),!r||o.length!==r);i=!0);}catch(e){u=!0,a=e}finally{try{i||null==t.return||t.return()}finally{if(u)throw a}}return o}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return du(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return du(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function du(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var pu=new RegExp("".concat("js_darkmode__","[^ ]+"),"g"),gu=null,vu=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{type:"dom"};if(r.force&&(cu.isFinish=!1),!cu.isFinish)try{fu.isDarkmode=C.mode?"dark"===C.mode:e.matches,"dom"===r.type?(fu.isDarkmode&&"function"==typeof C.begin&&C.begin(lu.hasDelay()),Array.prototype.forEach.call(lu.get(),(function(e){if(fu.isDarkmode&&e.className&&"string"==typeof e.className&&(e.className=e.className.replace(pu,"")),fu.isDarkmode||iu.length)if(C.needJudgeFirstPage){var r=e.getBoundingClientRect(),t=r.top,n=r.bottom;t<=0&&n<=0?cu.addCss(fu.convert(e)):t>0&&t<p||n>0&&n<p?(lu.addFirstPageNode(e),cu.addCss(fu.convert(e),!0)):(C.needJudgeFirstPage=!1,cu.writeStyle(!0),lu.showFirstPageNodes(),"function"==typeof C.showFirstPage&&C.showFirstPage(),cu.addCss(fu.convert(e)))}else cu.addCss(fu.convert(e))})),iu.loopTimes++):"bg"===r.type&&fu.isDarkmode&&uu.forEach((function(e){return su.contains(e,(function(e){cu.addCss(cu.genCss(e.className,e.cssKV)),"function"==typeof e.cb&&e.cb(e);var r=[e.elOld];e.elOld!==e.el&&r.push(e.el),r.forEach((function(e){var r,t,n,a,o,i,u=[[s,null!==(r=e[s])&&void 0!==r?r:null],[c,null!==(t=e[c])&&void 0!==t?t:null],[l,null!==(n=e[l])&&void 0!==n?n:null],[f,null!==(a=e[f])&&void 0!==a?a:null],[h,null!==(o=e[h])&&void 0!==o?o:null],[d,null!==(i=e[d])&&void 0!==i?i:null]],p=V(e,!0);p.forEach((function(e){u.forEach((function(r){var t=hu(r,2),n=t[0],a=t[1];null===a?delete e[n]:e[n]=a}))})),p.forEach((function(e){cu.addCss(fu.convert(e,void 0,!1,!0))}))}))}))})),(C.needJudgeFirstPage||!C.needJudgeFirstPage&&!lu.showFirstPage)&&"function"==typeof C.showFirstPage&&C.showFirstPage(),cu.writeStyle(),lu.emptyFirstPageNodes(),fu.isDarkmode||(C.needJudgeFirstPage=!1,C.delayBgJudge=!1,null===C.container&&"dom"===r.type&&lu.length&&lu.delay())}catch(e){console.log("An error occurred when running the dark mode conversion algorithm\n",e),"function"==typeof C.error&&C.error(e)}};function mu(e,r){bu(r),lu.set(e),vu(gu,{force:!0,type:"dom"})}function bu(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!C.hasInit){C.hasInit=!0;var r=C.whitelist.tagName,t=C.whitelist.attribute;e.whitelist&&(e.whitelist.tagName instanceof Array&&e.whitelist.tagName.forEach((function(e){e=e.toUpperCase(),-1===r.indexOf(e)&&r.push(e)})),e.whitelist.attribute instanceof Array&&e.whitelist.attribute.forEach((function(e){-1===t.indexOf(e)&&t.push(e)}))),["dark","light"].indexOf(e.mode)>-1&&(C.set("string",e,"mode"),"dark"===e.mode&&document.getElementsByTagName("html")[0].classList.add(i)),C.set("function",e,"begin"),C.set("function",e,"showFirstPage"),C.set("function",e,"error"),C.set("boolean",e,"needJudgeFirstPage"),C.set("boolean",e,"delayBgJudge"),C.set("dom",e,"container"),C.set("string",e,"cssSelectorsPrefix"),C.set("string",e,"defaultLightTextColor"),C.set("string",e,"defaultLightBgColor"),C.set("string",e,"defaultDarkTextColor"),C.set("string",e,"defaultDarkBgColor"),fu.init(),!C.mode&&null===gu&&window.matchMedia&&(gu=window.matchMedia(a)).addListener(vu)}}function yu(e){lu.set(e),null!==C.container&&(su.update(e),uu.update(e)),vu(gu,{force:!0,type:"bg"})}function wu(e,r){cu.isFinish&&(cu.addCss(fu.convert(e,r?Object.keys(r).map((function(e){return[e,r[e]]})):void 0,!0),!1),cu.writeStyle())}function Mu(e,r){return fu.getContrast(e,r)}function ku(e){e.forEach((function(e){return iu.extend(e)}))}}])}));
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "mp-darkmode",
3
- "version": "1.2.3-beta.4",
3
+ "version": "1.2.3-beta.6",
4
4
  "description": "微信公众平台 Dark Mode 转换算法",
5
5
  "main": "dist/darkmode.min.js",
6
6
  "dependencies": {
7
- "color": "^3.1.2",
7
+ "color": "^5.0.3",
8
8
  "color-blend": "^4.0.0",
9
- "color-name": "^1.1.4"
9
+ "color-name": "^2.1.0",
10
+ "colorjs.io": "^0.6.1"
10
11
  },
11
12
  "devDependencies": {
12
13
  "@babel/core": "^7.17.8",