5 lines
58 KiB
JavaScript
5 lines
58 KiB
JavaScript
|
var u0=(e,t)=>{if(typeof e=="number"){if(t===3)return{mode:"rgb",r:(e>>8&15|e>>4&240)/255,g:(e>>4&15|e&240)/255,b:(e&15|e<<4&240)/255};if(t===4)return{mode:"rgb",r:(e>>12&15|e>>8&240)/255,g:(e>>8&15|e>>4&240)/255,b:(e>>4&15|e&240)/255,alpha:(e&15|e<<4&240)/255};if(t===6)return{mode:"rgb",r:(e>>16&255)/255,g:(e>>8&255)/255,b:(e&255)/255};if(t===8)return{mode:"rgb",r:(e>>24&255)/255,g:(e>>16&255)/255,b:(e>>8&255)/255,alpha:(e&255)/255}}},pt=u0;var m0={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ft=m0;var s0=e=>pt(Ft[e.toLowerCase()],6),Wt=s0;var d0=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,c0=e=>{let t;return(t=e.match(d0))?pt(parseInt(t[1],16),t[1].length):void 0},Ut=c0;var O="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",ii=`(?:${O}|none)`,ce=`${O}%`,li=`(?:${O}%|none)`,De=`(?:${O}%|${O})`,h0=`(?:${O}%|${O}|none)`,io=`(?:${O}(deg|grad|rad|turn)|${O})`,pi=`(?:${O}(deg|grad|rad|turn)|${O}|none)`,le="\\s*,\\s*";var ui=new RegExp("^"+h0+"$");var b0=new RegExp(`^rgba?\\(\\s*${O}${le}${O}${le}${O}\\s*(?:,\\s*${De}\\s*)?\\)$`),x0=new RegExp(`^rgba?\\(\\s*${ce}${le}${ce}${le}${ce}\\s*(?:,\\s*${De}\\s*)?\\)$`),g0=e=>{let t={mode:"rgb"},r;if(r=e.match(b0))r[1]!==void 0&&(t.r=r[1]/255),r[2]!==void 0&&(t.g=r[2]/255),r[3]!==void 0&&(t.b=r[3]/255);else if(r=e.match(x0))r[1]!==void 0&&(t.r=r[1]/100),r[2]!==void 0&&(t.g=r[2]/100),r[3]!==void 0&&(t.b=r[3]/100);else return;return r[4]!==void 0?t.alpha=r[4]/100:r[5]!==void 0&&(t.a
|
||
|
`||o===" "||o===" "){for(;x<t.length&&(t[x]===`
|
||
|
`||t[x]===" "||t[x]===" ");)x++;continue}if(o===",")return;if(o===")"){r.push({type:p.ParenClose});continue}if(o==="+"){if(x--,mt(t)){r.push(Je(t));continue}return}if(o==="-"){if(x--,mt(t)){r.push(Je(t));continue}if(er(t)){r.push({type:p.Ident,value:dt(t)});continue}return}if(o==="."){if(x--,mt(t)){r.push(Je(t));continue}return}if(o==="/"){for(;x<t.length&&(t[x]===`
|
||
|
`||t[x]===" "||t[x]===" ");)x++;let n;if(mt(t)&&(n=Je(t),n.type!==p.Hue)){r.push({type:p.Alpha,value:n});continue}if(er(t)&&dt(t)==="none"){r.push({type:p.Alpha,value:{type:p.None,value:void 0}});continue}return}if(/\d/.test(o)){x--,r.push(Je(t));continue}if(Vt.test(o)){x--,r.push(L0(t));continue}return}return r}function w0(e){e._i=0;let t=e[e._i++];if(!t||t.type!==p.Function||t.value!=="color"||(t=e[e._i++],t.type!==p.Ident))return;let r=ut[t.value];if(!r)return;let o={mode:r},n=uo(e,!1);if(!n)return;let a=L(r).channels;for(let f=0,i;f<a.length;f++)i=n[f],i.type!==p.None&&(o[a[f]]=i.type===p.Number?i.value:i.value/100);return o}function uo(e,t){let r=[],o;for(;e._i<e.length;){if(o=e[e._i++],o.type===p.None||o.type===p.Number||o.type===p.Alpha||o.type===p.Percentage||t&&o.type===p.Hue){r.push(o);continue}if(o.type===p.ParenClose){if(e._i<e.length)return;continue}return}if(!(r.length<3||r.length>4)){if(r.length===4){if(r[3].type!==p.Alpha)return;r[3]=r[3].value}return r.length===3&&r.push({type:p.None,value:void 0}),r.every(n=>n.type!==p.Alpha)?r:void 0}}function _0(e,t){e._i=0;let r=e[e._i++];if(!r||r.type!==p.Function)return;let o=uo(e,t);if(o)return o.unshift(r.value),o}var H0=e=>{if(typeof e!="string")return;let t=R0(e),r=t?_0(t,!0):void 0,o,n=0,a=he.length;for(;n<a;)if((o=he[n++](e,r))!==void 0)return o;return t?w0(t):void 0},Qt=H0;function S0(e,t){if(!t||t[0]!=="rgb"&&t[0]!=="rgba")return;let r={mode:"rgb"},[,o,n,a,f]=t;if(!(o.type===p.Hue||n.type===p.Hue||a.type===p.Hue))return o.type!==p.None&&(r.r=o.type===p.Number?o.value/255:o.value/100),n.type!==p.None&&(r.g=n.type===p.Number?n.value/255:n.value/100),a.type!==p.None&&(r.b=a.type===p.Number?a.value/255:a.value/100),f.type!==p.None&&(r.alpha=f.type===p.Number?f.value:f.value/100),r}var tr=S0;var X0=e=>e==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,rr=X0;var V=(e,t,r)=>e+r*(t-e),P0=(e,t,r)=>(r-e)/(t-e),or=(e,t,r,o,n,a)=>V(V(e,t,n),V(r,o,n),a),N0=(e,t,r,o,n,a,f,i,l,m,s)=>V(or(e,t,r,o,l,m),or(n,a,f,i,l,m),s);var $0=e=>{let t=[];for(let r=0;r<e.length-1;r++){let o=e[r],n=e[r+1];o===void 0&&n===void 0?t.push(void 0):o!==void 0&&n!==void 0?t.push([o,n]):t.push(o!==void 0?[o,o]:[n,n])}return t},nr=e=>t=>{let r=$0(t);return o=>{let n=o*r.length,a=o>=1?r.length-1:Math.max(Math.floor(n),0),f=r[a];return f===void 0?void 0:e(f[0],f[1],n-a)}};var u=nr(V);var y=e=>{let t=!1,r=e.map(o=>o!==void 0?(t=!0,o):1);return t?r:e};var C0={mode:"rgb",channels:["r","g","b","alpha"],parse:[tr,Ut,Kt,Wt,rr,"srgb"],serialize:"srgb",interpolate:{r:u,g:u,b:u,alpha:{use:u,fixup:y}},gamut:!0},Z=C0;var ar=e=>Math.pow(Math.abs(e),2.19921875)*Math.sign(e),O0=e=>{let t=ar(e.r),r=ar(e.g),o=ar(e.b),n={mode:"xyz65",x:.5766690429101305*t+.1855582379065463*r+.1882286462349947*o,y:.297344975250536*t+.6273635662554661*r+.0752914584939979*o,z:.0270313613864123*t+.0706888525358272*r+.9913375368376386*o};return e.alpha!==void 0&&(n.alpha=e.alpha),n},ct=O0;var fr=e=>Math.pow(Math.abs(e),.4547069271758437)*Math.sign(e),I0=({x:e,y:t,z:r,alpha:o})=>{let n={mode:"a98",r:fr(e*2.0415879038107465-t*.5650069742788597-.3447313507783297*r),g:fr(e*-.9692436362808798+t*1.8759675015077206+.0415550574071756*r),b:fr(e*.0134442806320312-t*.1183623922310184+1.0151749943912058*r)};return o!==void 0&&(n.alpha=o),n},ht=I0;var ir=e=>{let t=Math.abs(e);return t<=.04045?e/12.92:(Math.sign(e)||1)*Math.pow((t+.055)/1.055,2.4)},A0=({r:e,g:t,b:r,alpha:o})=>{let n={mode:"lrgb",r:ir(e),g:ir(t),b:ir(r)};return o!==void 0&&(n.alpha=o),n},J=A0;var q0=e=>{let{r:t,g:r,b:o,alpha:n}=J(e),a={mode:"xyz65",x:.4123907992659593*t+.357584339383878*r+.1804807884018343*o,y:.2126390058715102*t+.715168678767756*r+.0721923153607337*o,z:.0193308187155918*t+.119194779794626*r+.9505321522496607*o};return n!==void 0&&(a.alpha=n),a},E=q0;var lr=e=>{let t=Math.abs(e);return t>.0031308?(Math.sign(e)||1)*(1.055*Math.pow(t,.4166666666666667)-.055):e*12.92},D0=({r:e,g:t,b:r,alpha:o},n="rgb")=>{let a={mode:n,r:lr(e),g:lr(t),b:lr(r)};return o!==void 0&&(a.alpha=o),a},j=D0;var J0=({x:e,y:t,z:r,alpha:o})=>{let n=j({r:e*3.2409699419045226-t*1.537383177570094-
|