New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@builtwithjavascript/theme-system

Package Overview
Dependencies
Maintainers
0
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@builtwithjavascript/theme-system - npm Package Compare versions

Comparing version
0.2.1
to
0.3.1
+21
dist/shared/index.d.ts
export type TKeyValue<T = unknown> = {
key: string;
value: T;
};
export interface ICategoryOption {
uniqueId: string;
id: string;
hasHover: boolean;
hasFocus: boolean;
_hex: string;
_hoverHex?: string;
_focusHex?: string;
_contentHex: string;
oklch: string;
hoverOklch?: string;
focusOklch?: string;
contentOklch: string;
selected: boolean;
flash: boolean;
_initial?: ICategoryOption | undefined;
}
import type { ICategoryOption } from '../shared';
export declare const _uniqueId: () => string;
type TInitCategoryOption = (id: string, options?: {
hasHover: boolean;
hasFocus: boolean;
}) => ICategoryOption;
type TUpdateCategoryHex = (category: ICategoryOption, strHex: string, state?: string) => ICategoryOption;
type TValidateCategoryName = (categories: ICategoryOption[], uniqueId: string, newName: string) => string;
export interface IUseCategories {
getInitialCategoryOptions: () => ICategoryOption[];
updateCategoryFieldsFromHex: TUpdateCategoryHex;
initCategoryOption: TInitCategoryOption;
validateCategoryName: TValidateCategoryName;
}
export declare const useCategories: () => IUseCategories;
export {};
type TStringToStringArray = (value: string) => string[];
type TConvertHexValue = (strHex: string, useOkLch: boolean) => string[];
type TOklchStringFromHex = (strHex: string) => string;
type THexStringFromOklchString = (strOklch: string) => string;
export interface IUseColorConvertion {
convertHexValue: TConvertHexValue;
oklchStringFromHex: TOklchStringFromHex;
oklchStringToLchArray: TStringToStringArray;
oklchStringToHslArray: TStringToStringArray;
hexStringFromOklchString: THexStringFromOklchString;
}
export declare const useColorConversion: () => IUseColorConvertion;
export {};
import type { ICategoryOption } from '../shared';
type TComputeStyleSheetContent = (cssVarPrefix: string, useOkLch: boolean, selectedCategories: ICategoryOption[], formatNicely?: boolean) => string;
interface IUseComputeStyleSheetContent {
computeStyleSheetContent: TComputeStyleSheetContent;
}
export declare const useComputeStyleSheetContent: () => IUseComputeStyleSheetContent;
export {};
import type { TKeyValue } from '../shared';
interface IDocumentCssVarInfo {
id: string;
hasHover: boolean;
hasFocus: boolean;
}
export interface IUseCssVarsUtils {
defaultCssVarsKeyValues: TKeyValue<string>[];
buildCssAttributeColorExpression: (cssVarPrefix: string, useOkLch: boolean, categoryVariation: string, opacityVar?: string) => string;
getDocumentCssVarsInfos: () => IDocumentCssVarInfo[];
getDocumentCssVarsKeyValues: () => TKeyValue<string>[];
}
export declare const useCssVarsUtils: () => IUseCssVarsUtils;
export {};
export declare const useScrollbarStyle: (cssVarPrefix: string, useOklch?: boolean) => string;
export type TUpdateDocumentStyleProp = (cssVarPrefix: string, useOkLch: boolean, key: string, strOklch: string, state?: string) => void;
declare const updateDocumentStyleProp: TUpdateDocumentStyleProp;
interface IUpdateDocumentStyleProp {
updateDocumentStyleProp: typeof updateDocumentStyleProp;
}
export declare const useUpdateDocumentStyleProp: () => IUpdateDocumentStyleProp;
export {};
declare const updateHeadStyle: (styleSheetContent: string) => void;
declare const getHeadStyle: () => string;
interface IUseUpdateHeadStyle {
updateHeadStyle: typeof updateHeadStyle;
getHeadStyle: typeof getHeadStyle;
}
export declare const useUpdateHeadStyle: () => IUseUpdateHeadStyle;
export {};
+13
-2

@@ -1,2 +0,13 @@

export * from './hooks/';
export * from './models';
import type { ICategoryOption } from './shared';
export * from './shared';
export * from './use-categories';
export * from './use-color-conversion';
export * from './use-compute-stylesheet-content';
export * from './use-css-vars-utils';
export * from './use-scrollbar-style';
export * from './use-update-document-style-prop';
export * from './use-update-headstyle';
export type TSupportedColorSpaces = 'hsl' | 'oklch';
export declare const useThemeSystem: () => {
computeDocumentStyles: (cssVarPrefix?: string, categories?: ICategoryOption[], useOkLch?: boolean) => Promise<void>;
};
+8
-8

@@ -1,5 +0,5 @@

(function(B,J){typeof exports=="object"&&typeof module<"u"?J(exports):typeof define=="function"&&define.amd?define(["exports"],J):(B=typeof globalThis<"u"?globalThis:B||self,J(B["theme-system"]={}))})(this,function(B){"use strict";const J=(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}}},jn={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},Fn=e=>J(jn[e.toLowerCase()],6),Xn=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,En=e=>{let t;return(t=e.match(Xn))?J(parseInt(t[1],16),t[1].length):void 0},E="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",ee=`${E}%`,Oe=`(?:${E}%|${E})`,Ln=`(?:${E}(deg|grad|rad|turn)|${E})`,K="\\s*,\\s*",An=new RegExp(`^rgba?\\(\\s*${E}${K}${E}${K}${E}\\s*(?:,\\s*${Oe}\\s*)?\\)$`),Pn=new RegExp(`^rgba?\\(\\s*${ee}${K}${ee}${K}${ee}\\s*(?:,\\s*${Oe}\\s*)?\\)$`),Dn=e=>{let t={mode:"rgb"},n;if(n=e.match(An))n[1]!==void 0&&(t.r=n[1]/255),n[2]!==void 0&&(t.g=n[2]/255),n[3]!==void 0&&(t.b=n[3]/255);else if(n=e.match(Pn))n[1]!==void 0&&(t.r=n[1]/100),n[2]!==void 0&&(t.g=n[2]/100),n[3]!==void 0&&(t.b=n[3]/100);else return;return n[4]!==void 0?t.alpha=Math.max(0,Math.min(1,n[4]/100)):n[5]!==void 0&&(t.alpha=Math.max(0,Math.min(1,+n[5]))),t},Yn=(e,t)=>e===void 0?void 0:typeof e!="object"?zt(e):e.mode!==void 0?e:t?{...e,mode:t}:void 0,de=(e="rgb")=>t=>(t=Yn(t,e))!==void 0?t.mode===e?t:I[t.mode][e]?I[t.mode][e](t):e==="rgb"?I[t.mode].rgb(t):I.rgb[e](I[t.mode].rgb(t)):void 0,I={},_t={},se=[],wt={},Zn=e=>e,v=e=>(I[e.mode]={...I[e.mode],...e.toMode},Object.keys(e.fromMode||{}).forEach(t=>{I[t]||(I[t]={}),I[t][e.mode]=e.fromMode[t]}),e.ranges||(e.ranges={}),e.difference||(e.difference={}),e.channels.forEach(t=>{if(e.ranges[t]===void 0&&(e.ranges[t]=[0,1]),!e.interpolate[t])throw new Error(`Missing interpolator for: ${t}`);typeof e.interpolate[t]=="function"&&(e.interpolate[t]={use:e.interpolate[t]}),e.interpolate[t].fixup||(e.interpolate[t].fixup=Zn)}),_t[e.mode]=e,(e.parse||[]).forEach(t=>{Jn(t,e.mode)}),de(e.mode)),Bn=e=>_t[e],Jn=(e,t)=>{if(typeof e=="string"){if(!t)throw new Error("'mode' required when 'parser' is a string");wt[e]=t}else typeof e=="function"&&se.indexOf(e)<0&&se.push(e)},Ne=/[^\x00-\x7F]|[a-zA-Z_]/,Kn=/[^\x00-\x7F]|[-\w]/,i={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"};let b=0;function ce(e){let t=e[b],n=e[b+1];return t==="-"||t==="+"?/\d/.test(n)||n==="."&&/\d/.test(e[b+2]):t==="."?/\d/.test(n):/\d/.test(t)}function Ie(e){if(b>=e.length)return!1;let t=e[b];if(Ne.test(t))return!0;if(t==="-"){if(e.length-b<2)return!1;let n=e[b+1];return!!(n==="-"||Ne.test(n))}return!1}const Un={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function te(e){let t="";if((e[b]==="-"||e[b]==="+")&&(t+=e[b++]),t+=he(e),e[b]==="."&&/\d/.test(e[b+1])&&(t+=e[b++]+he(e)),(e[b]==="e"||e[b]==="E")&&((e[b+1]==="-"||e[b+1]==="+")&&/\d/.test(e[b+2])?t+=e[b++]+e[b++]+he(e):/\d/.test(e[b+1])&&(t+=e[b++]+he(e))),Ie(e)){let n=pe(e);return n==="deg"||n==="rad"||n==="turn"||n==="grad"?{type:i.Hue,value:t*Un[n]}:void 0}return e[b]==="%"?(b++,{type:i.Percentage,value:+t}):{type:i.Number,value:+t}}function he(e){let t="";for(;/\d/.test(e[b]);)t+=e[b++];return t}function pe(e){let t="";for(;b<e.length&&Kn.test(e[b]);)t+=e[b++];return t}function Wn(e){let t=pe(e);return e[b]==="("?(b++,{type:i.Function,value:t}):t==="none"?{type:i.None,value:void 0}:{type:i.Ident,value:t}}function Gn(e=""){let t=e.trim(),n=[],r;for(b=0;b<t.length;){if(r=t[b++],r===`
(function(I,J){typeof exports=="object"&&typeof module<"u"?J(exports):typeof define=="function"&&define.amd?define(["exports"],J):(I=typeof globalThis<"u"?globalThis:I||self,J(I["theme-system"]={}))})(this,function(I){"use strict";const J=(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}}},Pn={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},An=e=>J(Pn[e.toLowerCase()],6),Dn=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,Yn=e=>{let t;return(t=e.match(Dn))?J(parseInt(t[1],16),t[1].length):void 0},L="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",ee=`${L}%`,Ie=`(?:${L}%|${L})`,Zn=`(?:${L}(deg|grad|rad|turn)|${L})`,U="\\s*,\\s*",Bn=new RegExp(`^rgba?\\(\\s*${L}${U}${L}${U}${L}\\s*(?:,\\s*${Ie}\\s*)?\\)$`),Jn=new RegExp(`^rgba?\\(\\s*${ee}${U}${ee}${U}${ee}\\s*(?:,\\s*${Ie}\\s*)?\\)$`),Un=e=>{let t={mode:"rgb"},n;if(n=e.match(Bn))n[1]!==void 0&&(t.r=n[1]/255),n[2]!==void 0&&(t.g=n[2]/255),n[3]!==void 0&&(t.b=n[3]/255);else if(n=e.match(Jn))n[1]!==void 0&&(t.r=n[1]/100),n[2]!==void 0&&(t.g=n[2]/100),n[3]!==void 0&&(t.b=n[3]/100);else return;return n[4]!==void 0?t.alpha=Math.max(0,Math.min(1,n[4]/100)):n[5]!==void 0&&(t.alpha=Math.max(0,Math.min(1,+n[5]))),t},Kn=(e,t)=>e===void 0?void 0:typeof e!="object"?zt(e):e.mode!==void 0?e:t?{...e,mode:t}:void 0,de=(e="rgb")=>t=>(t=Kn(t,e))!==void 0?t.mode===e?t:q[t.mode][e]?q[t.mode][e](t):e==="rgb"?q[t.mode].rgb(t):q.rgb[e](q[t.mode].rgb(t)):void 0,q={},wt={},se=[],Ht={},Wn=e=>e,v=e=>(q[e.mode]={...q[e.mode],...e.toMode},Object.keys(e.fromMode||{}).forEach(t=>{q[t]||(q[t]={}),q[t][e.mode]=e.fromMode[t]}),e.ranges||(e.ranges={}),e.difference||(e.difference={}),e.channels.forEach(t=>{if(e.ranges[t]===void 0&&(e.ranges[t]=[0,1]),!e.interpolate[t])throw new Error(`Missing interpolator for: ${t}`);typeof e.interpolate[t]=="function"&&(e.interpolate[t]={use:e.interpolate[t]}),e.interpolate[t].fixup||(e.interpolate[t].fixup=Wn)}),wt[e.mode]=e,(e.parse||[]).forEach(t=>{Qn(t,e.mode)}),de(e.mode)),Gn=e=>wt[e],Qn=(e,t)=>{if(typeof e=="string"){if(!t)throw new Error("'mode' required when 'parser' is a string");Ht[e]=t}else typeof e=="function"&&se.indexOf(e)<0&&se.push(e)},Ne=/[^\x00-\x7F]|[a-zA-Z_]/,Vn=/[^\x00-\x7F]|[-\w]/,i={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"};let b=0;function ce(e){let t=e[b],n=e[b+1];return t==="-"||t==="+"?/\d/.test(n)||n==="."&&/\d/.test(e[b+2]):t==="."?/\d/.test(n):/\d/.test(t)}function qe(e){if(b>=e.length)return!1;let t=e[b];if(Ne.test(t))return!0;if(t==="-"){if(e.length-b<2)return!1;let n=e[b+1];return!!(n==="-"||Ne.test(n))}return!1}const e0={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function te(e){let t="";if((e[b]==="-"||e[b]==="+")&&(t+=e[b++]),t+=he(e),e[b]==="."&&/\d/.test(e[b+1])&&(t+=e[b++]+he(e)),(e[b]==="e"||e[b]==="E")&&((e[b+1]==="-"||e[b+1]==="+")&&/\d/.test(e[b+2])?t+=e[b++]+e[b++]+he(e):/\d/.test(e[b+1])&&(t+=e[b++]+he(e))),qe(e)){let n=pe(e);return n==="deg"||n==="rad"||n==="turn"||n==="grad"?{type:i.Hue,value:t*e0[n]}:void 0}return e[b]==="%"?(b++,{type:i.Percentage,value:+t}):{type:i.Number,value:+t}}function he(e){let t="";for(;/\d/.test(e[b]);)t+=e[b++];return t}function pe(e){let t="";for(;b<e.length&&Vn.test(e[b]);)t+=e[b++];return t}function t0(e){let t=pe(e);return e[b]==="("?(b++,{type:i.Function,value:t}):t==="none"?{type:i.None,value:void 0}:{type:i.Ident,value:t}}function n0(e=""){let t=e.trim(),n=[],r;for(b=0;b<t.length;){if(r=t[b++],r===`
`||r===" "||r===" "){for(;b<t.length&&(t[b]===`
`||t[b]===" "||t[b]===" ");)b++;continue}if(r===",")return;if(r===")"){n.push({type:i.ParenClose});continue}if(r==="+"){if(b--,ce(t)){n.push(te(t));continue}return}if(r==="-"){if(b--,ce(t)){n.push(te(t));continue}if(Ie(t)){n.push({type:i.Ident,value:pe(t)});continue}return}if(r==="."){if(b--,ce(t)){n.push(te(t));continue}return}if(r==="/"){for(;b<t.length&&(t[b]===`
`||t[b]===" "||t[b]===" ");)b++;let o;if(ce(t)&&(o=te(t),o.type!==i.Hue)){n.push({type:i.Alpha,value:o});continue}if(Ie(t)&&pe(t)==="none"){n.push({type:i.Alpha,value:{type:i.None,value:void 0}});continue}return}if(/\d/.test(r)){b--,n.push(te(t));continue}if(Ne.test(r)){b--,n.push(Wn(t));continue}return}return n}function Qn(e){e._i=0;let t=e[e._i++];if(!t||t.type!==i.Function||t.value!=="color"||(t=e[e._i++],t.type!==i.Ident))return;const n=wt[t.value];if(!n)return;const r={mode:n},o=Ht(e,!1);if(!o)return;const l=Bn(n).channels;for(let a=0,f,c;a<l.length;a++)f=o[a],c=l[a],f.type!==i.None&&(r[c]=f.type===i.Number?f.value:f.value/100,c==="alpha"&&(r[c]=Math.max(0,Math.min(1,r[c]))));return r}function Ht(e,t){const n=[];let r;for(;e._i<e.length;){if(r=e[e._i++],r.type===i.None||r.type===i.Number||r.type===i.Alpha||r.type===i.Percentage||t&&r.type===i.Hue){n.push(r);continue}if(r.type===i.ParenClose){if(e._i<e.length)return;continue}return}if(!(n.length<3||n.length>4)){if(n.length===4){if(n[3].type!==i.Alpha)return;n[3]=n[3].value}return n.length===3&&n.push({type:i.None,value:void 0}),n.every(o=>o.type!==i.Alpha)?n:void 0}}function Vn(e,t){e._i=0;let n=e[e._i++];if(!n||n.type!==i.Function)return;let r=Ht(e,t);if(r)return r.unshift(n.value),r}const zt=e=>{if(typeof e!="string")return;const t=Gn(e),n=t?Vn(t,!0):void 0;let r,o=0,l=se.length;for(;o<l;)if((r=se[o++](e,n))!==void 0)return r;return t?Qn(t):void 0};function e0(e,t){if(!t||t[0]!=="rgb"&&t[0]!=="rgba")return;const n={mode:"rgb"},[,r,o,l,a]=t;if(!(r.type===i.Hue||o.type===i.Hue||l.type===i.Hue))return r.type!==i.None&&(n.r=r.type===i.Number?r.value/255:r.value/100),o.type!==i.None&&(n.g=o.type===i.Number?o.value/255:o.value/100),l.type!==i.None&&(n.b=l.type===i.Number?l.value/255:l.value/100),a.type!==i.None&&(n.alpha=Math.min(1,Math.max(0,a.type===i.Number?a.value:a.value/100))),n}const t0=e=>e==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,n0=(e,t,n)=>e+n*(t-e),o0=e=>{let t=[];for(let n=0;n<e.length-1;n++){let r=e[n],o=e[n+1];r===void 0&&o===void 0?t.push(void 0):r!==void 0&&o!==void 0?t.push([r,o]):t.push(r!==void 0?[r,r]:[o,o])}return t},s=(e=>t=>{let n=o0(t);return r=>{let o=r*n.length,l=r>=1?n.length-1:Math.max(Math.floor(o),0),a=n[l];return a===void 0?void 0:e(a[0],a[1],o-l)}})(n0),w=e=>{let t=!1,n=e.map(r=>r!==void 0?(t=!0,r):1);return t?n:e},U={mode:"rgb",channels:["r","g","b","alpha"],parse:[e0,En,Dn,Fn,t0,"srgb"],serialize:"srgb",interpolate:{r:s,g:s,b:s,alpha:{use:s,fixup:w}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},qe=(e=0)=>Math.pow(Math.abs(e),563/256)*Math.sign(e),Tt=e=>{let t=qe(e.r),n=qe(e.g),r=qe(e.b),o={mode:"xyz65",x:.5766690429101305*t+.1855582379065463*n+.1882286462349947*r,y:.297344975250536*t+.6273635662554661*n+.0752914584939979*r,z:.0270313613864123*t+.0706888525358272*n+.9913375368376386*r};return e.alpha!==void 0&&(o.alpha=e.alpha),o},Re=e=>Math.pow(Math.abs(e),256/563)*Math.sign(e),Ct=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o={mode:"a98",r:Re(e*2.0415879038107465-t*.5650069742788597-.3447313507783297*n),g:Re(e*-.9692436362808798+t*1.8759675015077206+.0415550574071756*n),b:Re(e*.0134442806320312-t*.1183623922310184+1.0151749943912058*n)};return r!==void 0&&(o.alpha=r),o},je=(e=0)=>{const t=Math.abs(e);return t<=.04045?e/12.92:(Math.sign(e)||1)*Math.pow((t+.055)/1.055,2.4)},W=({r:e,g:t,b:n,alpha:r})=>{let o={mode:"lrgb",r:je(e),g:je(t),b:je(n)};return r!==void 0&&(o.alpha=r),o},P=e=>{let{r:t,g:n,b:r,alpha:o}=W(e),l={mode:"xyz65",x:.4123907992659593*t+.357584339383878*n+.1804807884018343*r,y:.2126390058715102*t+.715168678767756*n+.0721923153607337*r,z:.0193308187155918*t+.119194779794626*n+.9505321522496607*r};return o!==void 0&&(l.alpha=o),l},Fe=(e=0)=>{const t=Math.abs(e);return t>.0031308?(Math.sign(e)||1)*(1.055*Math.pow(t,1/2.4)-.055):e*12.92},G=({r:e,g:t,b:n,alpha:r},o="rgb")=>{let l={mode:o,r:Fe(e),g:Fe(t),b:Fe(n)};return r!==void 0&&(l.alpha=r),l},D=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=G({r:e*3.2409699419045226-t*1.537383177570094-.4986107602930034*n,g:e*-.9692436362808796+t*1.8759675015077204+.0415550574071756*n,b:e*.0556300796969936-t*.2039769588889765+1.0569715142428784*n});return r!==void 0&&(o.alpha=r),o},r0={...U,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:e=>Ct(P(e)),xyz65:Ct},toMode:{rgb:e=>D(Tt(e)),xyz65:Tt}},C=e=>(e=e%360)<0?e+360:e,l0=(e,t)=>e.map((n,r,o)=>{if(n===void 0)return n;let l=C(n);return r===0||e[r-1]===void 0?l:t(l-C(o[r-1]))}).reduce((n,r)=>!n.length||r===void 0||n[n.length-1]===void 0?(n.push(r),n):(n.push(r+n[n.length-1]),n),[]),F=e=>l0(e,t=>Math.abs(t)<=180?t:t-360*Math.sign(t)),z=[-.14861,1.78277,-.29227,-.90649,1.97294,0],a0=Math.PI/180,f0=180/Math.PI;let St=z[3]*z[4],Ot=z[1]*z[4],Nt=z[1]*z[2]-z[0]*z[3];const i0=({r:e,g:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=(Nt*n+e*St-t*Ot)/(Nt+St-Ot),l=n-o,a=(z[4]*(t-o)-z[2]*l)/z[3],f={mode:"cubehelix",l:o,s:o===0||o===1?void 0:Math.sqrt(l*l+a*a)/(z[4]*o*(1-o))};return f.s&&(f.h=Math.atan2(a,l)*f0-120),r!==void 0&&(f.alpha=r),f},u0=({h:e,s:t,l:n,alpha:r})=>{let o={mode:"rgb"};e=(e===void 0?0:e+120)*a0,n===void 0&&(n=0);let l=t===void 0?0:t*n*(1-n),a=Math.cos(e),f=Math.sin(e);return o.r=n+l*(z[0]*a+z[1]*f),o.g=n+l*(z[2]*a+z[3]*f),o.b=n+l*(z[4]*a+z[5]*f),r!==void 0&&(o.alpha=r),o},be=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.s||!t.s)return 0;let n=C(e.h),r=C(t.h),o=Math.sin((r-n+360)/2*Math.PI/180);return 2*Math.sqrt(e.s*t.s)*o},d0=(e,t)=>{if(e.h===void 0||t.h===void 0)return 0;let n=C(e.h),r=C(t.h);return Math.abs(r-n)>180?n-(r-360*Math.sign(r-n)):r-n},ge=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.c||!t.c)return 0;let n=C(e.h),r=C(t.h),o=Math.sin((r-n+360)/2*Math.PI/180);return 2*Math.sqrt(e.c*t.c)*o},X=e=>{let t=e.reduce((r,o)=>{if(o!==void 0){let l=o*Math.PI/180;r.sin+=Math.sin(l),r.cos+=Math.cos(l)}return r},{sin:0,cos:0}),n=Math.atan2(t.sin,t.cos)*180/Math.PI;return n<0?360+n:n},s0={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:i0},toMode:{rgb:u0},interpolate:{h:{use:s,fixup:F},s,l:s,alpha:{use:s,fixup:w}},difference:{h:be},average:{h:X}},L=({l:e,a:t,b:n,alpha:r},o="lch")=>{t===void 0&&(t=0),n===void 0&&(n=0);let l=Math.sqrt(t*t+n*n),a={mode:o,l:e,c:l};return l&&(a.h=C(Math.atan2(n,t)*180/Math.PI)),r!==void 0&&(a.alpha=r),a},A=({l:e,c:t,h:n,alpha:r},o="lab")=>{n===void 0&&(n=0);let l={mode:o,l:e,a:t?t*Math.cos(n/180*Math.PI):0,b:t?t*Math.sin(n/180*Math.PI):0};return r!==void 0&&(l.alpha=r),l},It=Math.pow(29,3)/Math.pow(3,3),qt=Math.pow(6,3)/Math.pow(29,3),M={X:.3457/.3585,Y:1,Z:(1-.3457-.3585)/.3585},Q={X:.3127/.329,Y:1,Z:(1-.3127-.329)/.329};let Xe=e=>Math.pow(e,3)>qt?Math.pow(e,3):(116*e-16)/It;const Rt=({l:e,a:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=(e+16)/116,l=t/500+o,a=o-n/200,f={mode:"xyz65",x:Xe(l)*Q.X,y:Xe(o)*Q.Y,z:Xe(a)*Q.Z};return r!==void 0&&(f.alpha=r),f},me=e=>D(Rt(e)),Ee=e=>e>qt?Math.cbrt(e):(It*e+16)/116,jt=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=Ee(e/Q.X),l=Ee(t/Q.Y),a=Ee(n/Q.Z),f={mode:"lab65",l:116*l-16,a:500*(o-l),b:200*(l-a)};return r!==void 0&&(f.alpha=r),f},$e=e=>{let t=jt(P(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},ve=1,Ft=1,ne=26/180*Math.PI,ye=Math.cos(ne),ke=Math.sin(ne),Xt=100/Math.log(139/100),Le=({l:e,c:t,h:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o={mode:"lab65",l:(Math.exp(e*ve/Xt)-1)/.0039},l=(Math.exp(.0435*t*Ft*ve)-1)/.075,a=l*Math.cos(n/180*Math.PI-ne),f=l*Math.sin(n/180*Math.PI-ne);return o.a=a*ye-f/.83*ke,o.b=a*ke+f/.83*ye,r!==void 0&&(o.alpha=r),o},Ae=({l:e,a:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=t*ye+n*ke,l=.83*(n*ye-t*ke),a=Math.sqrt(o*o+l*l),f={mode:"dlch",l:Xt/ve*Math.log(1+.0039*e),c:Math.log(1+.075*a)/(.0435*Ft*ve)};return f.c&&(f.h=C((Math.atan2(l,o)+ne)/Math.PI*180)),r!==void 0&&(f.alpha=r),f},Et=e=>Le(L(e,"dlch")),Lt=e=>A(Ae(e),"dlab"),c0={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:Et,rgb:e=>me(Et(e))},fromMode:{lab65:Lt,rgb:e=>Lt($e(e))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:s,a:s,b:s,alpha:{use:s,fixup:w}}},h0={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:Le,dlab:e=>A(e,"dlab"),rgb:e=>me(Le(e))},fromMode:{lab65:Ae,dlab:e=>L(e,"dlch"),rgb:e=>Ae($e(e))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:s,c:s,h:{use:s,fixup:F},alpha:{use:s,fixup:w}},difference:{h:ge},average:{h:X}};function p0({h:e,s:t,i:n,alpha:r}){e=C(e!==void 0?e:0),t===void 0&&(t=0),n===void 0&&(n=0);let o=Math.abs(e/60%2-1),l;switch(Math.floor(e/60)){case 0:l={r:n*(1+t*(3/(2-o)-1)),g:n*(1+t*(3*(1-o)/(2-o)-1)),b:n*(1-t)};break;case 1:l={r:n*(1+t*(3*(1-o)/(2-o)-1)),g:n*(1+t*(3/(2-o)-1)),b:n*(1-t)};break;case 2:l={r:n*(1-t),g:n*(1+t*(3/(2-o)-1)),b:n*(1+t*(3*(1-o)/(2-o)-1))};break;case 3:l={r:n*(1-t),g:n*(1+t*(3*(1-o)/(2-o)-1)),b:n*(1+t*(3/(2-o)-1))};break;case 4:l={r:n*(1+t*(3*(1-o)/(2-o)-1)),g:n*(1-t),b:n*(1+t*(3/(2-o)-1))};break;case 5:l={r:n*(1+t*(3/(2-o)-1)),g:n*(1-t),b:n*(1+t*(3*(1-o)/(2-o)-1))};break;default:l={r:n*(1-t),g:n*(1-t),b:n*(1-t)}}return l.mode="rgb",r!==void 0&&(l.alpha=r),l}function b0({r:e,g:t,b:n,alpha:r}){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=Math.max(e,t,n),l=Math.min(e,t,n),a={mode:"hsi",s:e+t+n===0?0:1-3*l/(e+t+n),i:(e+t+n)/3};return o-l!==0&&(a.h=(o===e?(t-n)/(o-l)+(t<n)*6:o===t?(n-e)/(o-l)+2:(e-t)/(o-l)+4)*60),r!==void 0&&(a.alpha=r),a}const g0={mode:"hsi",toMode:{rgb:p0},parse:["--hsi"],serialize:"--hsi",fromMode:{rgb:b0},channels:["h","s","i","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:s,fixup:F},s,i:s,alpha:{use:s,fixup:w}},difference:{h:be},average:{h:X}};function m0({h:e,s:t,l:n,alpha:r}){e=C(e!==void 0?e:0),t===void 0&&(t=0),n===void 0&&(n=0);let o=n+t*(n<.5?n:1-n),l=o-(o-n)*2*Math.abs(e/60%2-1),a;switch(Math.floor(e/60)){case 0:a={r:o,g:l,b:2*n-o};break;case 1:a={r:l,g:o,b:2*n-o};break;case 2:a={r:2*n-o,g:o,b:l};break;case 3:a={r:2*n-o,g:l,b:o};break;case 4:a={r:l,g:2*n-o,b:o};break;case 5:a={r:o,g:2*n-o,b:l};break;default:a={r:2*n-o,g:2*n-o,b:2*n-o}}return a.mode="rgb",r!==void 0&&(a.alpha=r),a}function $0({r:e,g:t,b:n,alpha:r}){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=Math.max(e,t,n),l=Math.min(e,t,n),a={mode:"hsl",s:o===l?0:(o-l)/(1-Math.abs(o+l-1)),l:.5*(o+l)};return o-l!==0&&(a.h=(o===e?(t-n)/(o-l)+(t<n)*6:o===t?(n-e)/(o-l)+2:(e-t)/(o-l)+4)*60),r!==void 0&&(a.alpha=r),a}const v0=(e,t)=>{switch(t){case"deg":return+e;case"rad":return e/Math.PI*180;case"grad":return e/10*9;case"turn":return e*360}},y0=new RegExp(`^hsla?\\(\\s*${Ln}${K}${ee}${K}${ee}\\s*(?:,\\s*${Oe}\\s*)?\\)$`),k0=e=>{let t=e.match(y0);if(!t)return;let n={mode:"hsl"};return t[3]!==void 0?n.h=+t[3]:t[1]!==void 0&&t[2]!==void 0&&(n.h=v0(t[1],t[2])),t[4]!==void 0&&(n.s=Math.min(Math.max(0,t[4]/100),1)),t[5]!==void 0&&(n.l=Math.min(Math.max(0,t[5]/100),1)),t[6]!==void 0?n.alpha=Math.max(0,Math.min(1,t[6]/100)):t[7]!==void 0&&(n.alpha=Math.max(0,Math.min(1,+t[7]))),n};function x0(e,t){if(!t||t[0]!=="hsl"&&t[0]!=="hsla")return;const n={mode:"hsl"},[,r,o,l,a]=t;if(r.type!==i.None){if(r.type===i.Percentage)return;n.h=r.value}if(o.type!==i.None){if(o.type===i.Hue)return;n.s=o.value/100}if(l.type!==i.None){if(l.type===i.Hue)return;n.l=l.value/100}return a.type!==i.None&&(n.alpha=Math.min(1,Math.max(0,a.type===i.Number?a.value:a.value/100))),n}const At={mode:"hsl",toMode:{rgb:m0},fromMode:{rgb:$0},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[x0,k0],serialize:e=>`hsl(${e.h!==void 0?e.h:"none"} ${e.s!==void 0?e.s*100+"%":"none"} ${e.l!==void 0?e.l*100+"%":"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:s,fixup:F},s,l:s,alpha:{use:s,fixup:w}},difference:{h:be},average:{h:X}};function Pt({h:e,s:t,v:n,alpha:r}){e=C(e!==void 0?e:0),t===void 0&&(t=0),n===void 0&&(n=0);let o=Math.abs(e/60%2-1),l;switch(Math.floor(e/60)){case 0:l={r:n,g:n*(1-t*o),b:n*(1-t)};break;case 1:l={r:n*(1-t*o),g:n,b:n*(1-t)};break;case 2:l={r:n*(1-t),g:n,b:n*(1-t*o)};break;case 3:l={r:n*(1-t),g:n*(1-t*o),b:n};break;case 4:l={r:n*(1-t*o),g:n*(1-t),b:n};break;case 5:l={r:n,g:n*(1-t),b:n*(1-t*o)};break;default:l={r:n*(1-t),g:n*(1-t),b:n*(1-t)}}return l.mode="rgb",r!==void 0&&(l.alpha=r),l}function Dt({r:e,g:t,b:n,alpha:r}){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=Math.max(e,t,n),l=Math.min(e,t,n),a={mode:"hsv",s:o===0?0:1-l/o,v:o};return o-l!==0&&(a.h=(o===e?(t-n)/(o-l)+(t<n)*6:o===t?(n-e)/(o-l)+2:(e-t)/(o-l)+4)*60),r!==void 0&&(a.alpha=r),a}const Yt={mode:"hsv",toMode:{rgb:Pt},parse:["--hsv"],serialize:"--hsv",fromMode:{rgb:Dt},channels:["h","s","v","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:s,fixup:F},s,v:s,alpha:{use:s,fixup:w}},difference:{h:be},average:{h:X}};function M0({h:e,w:t,b:n,alpha:r}){if(t===void 0&&(t=0),n===void 0&&(n=0),t+n>1){let o=t+n;t/=o,n/=o}return Pt({h:e,s:n===1?1:1-t/(1-n),v:1-n,alpha:r})}function _0(e){let t=Dt(e);if(t===void 0)return;let n=t.s!==void 0?t.s:0,r=t.v!==void 0?t.v:0,o={mode:"hwb",w:(1-n)*r,b:1-r};return t.h!==void 0&&(o.h=t.h),t.alpha!==void 0&&(o.alpha=t.alpha),o}function w0(e,t){if(!t||t[0]!=="hwb")return;const n={mode:"hwb"},[,r,o,l,a]=t;if(r.type!==i.None){if(r.type===i.Percentage)return;n.h=r.value}if(o.type!==i.None){if(o.type===i.Hue)return;n.w=o.value/100}if(l.type!==i.None){if(l.type===i.Hue)return;n.b=l.value/100}return a.type!==i.None&&(n.alpha=Math.min(1,Math.max(0,a.type===i.Number?a.value:a.value/100))),n}const H0={mode:"hwb",toMode:{rgb:M0},fromMode:{rgb:_0},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[w0],serialize:e=>`hwb(${e.h!==void 0?e.h:"none"} ${e.w!==void 0?e.w*100+"%":"none"} ${e.b!==void 0?e.b*100+"%":"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:s,fixup:F},w:s,b:s,alpha:{use:s,fixup:w}},difference:{h:d0},average:{h:X}},Zt=203,xe=.1593017578125,Bt=78.84375,Me=.8359375,_e=18.8515625,we=18.6875;function Pe(e){if(e<0)return 0;const t=Math.pow(e,1/Bt);return 1e4*Math.pow(Math.max(0,t-Me)/(_e-we*t),1/xe)}function De(e){if(e<0)return 0;const t=Math.pow(e/1e4,xe);return Math.pow((Me+_e*t)/(1+we*t),Bt)}const Ye=e=>Math.max(e/Zt,0),Jt=({i:e,t,p:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);const o=Pe(e+.008609037037932761*t+.11102962500302593*n),l=Pe(e-.00860903703793275*t-.11102962500302599*n),a=Pe(e+.5600313357106791*t-.32062717498731885*n),f={mode:"xyz65",x:Ye(2.070152218389422*o-1.3263473389671556*l+.2066510476294051*a),y:Ye(.3647385209748074*o+.680566024947227*l-.0453045459220346*a),z:Ye(-.049747207535812*o-.0492609666966138*l+1.1880659249923042*a)};return r!==void 0&&(f.alpha=r),f},Ze=(e=0)=>Math.max(e*Zt,0),Kt=({x:e,y:t,z:n,alpha:r})=>{const o=Ze(e),l=Ze(t),a=Ze(n),f=De(.3592832590121217*o+.6976051147779502*l-.0358915932320289*a),c=De(-.1920808463704995*o+1.1004767970374323*l+.0753748658519118*a),d=De(.0070797844607477*o+.0748396662186366*l+.8433265453898765*a),h=.5*f+.5*c,g=1.61376953125*f-3.323486328125*c+1.709716796875*d,m=4.378173828125*f-4.24560546875*c-.132568359375*d,$={mode:"itp",i:h,t:g,p:m};return r!==void 0&&($.alpha=r),$},z0={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:Jt,rgb:e=>D(Jt(e))},fromMode:{xyz65:Kt,rgb:e=>Kt(P(e))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:s,t:s,p:s,alpha:{use:s,fixup:w}}},T0=134.03437499999998,C0=16295499532821565e-27,Be=e=>{if(e<0)return 0;let t=Math.pow(e/1e4,xe);return Math.pow((Me+_e*t)/(1+we*t),T0)},Je=(e=0)=>Math.max(e*203,0),Ut=({x:e,y:t,z:n,alpha:r})=>{e=Je(e),t=Je(t),n=Je(n);let o=1.15*e-.15*n,l=.66*t+.34*e,a=Be(.41478972*o+.579999*l+.014648*n),f=Be(-.20151*o+1.120649*l+.0531008*n),c=Be(-.0166008*o+.2648*l+.6684799*n),d=(a+f)/2,h={mode:"jab",j:.44*d/(1-.56*d)-C0,a:3.524*a-4.066708*f+.542708*c,b:.199076*a+1.096799*f-1.295875*c};return r!==void 0&&(h.alpha=r),h},S0=134.03437499999998,Wt=16295499532821565e-27,Ke=e=>{if(e<0)return 0;let t=Math.pow(e,1/S0);return 1e4*Math.pow((Me-t)/(we*t-_e),1/xe)},Ue=e=>e/203,Gt=({j:e,a:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=(e+Wt)/(.44+.56*(e+Wt)),l=Ke(o+.13860504*t+.058047316*n),a=Ke(o-.13860504*t-.058047316*n),f=Ke(o-.096019242*t-.8118919*n),c={mode:"xyz65",x:Ue(1.661373024652174*l-.914523081304348*a+.23136208173913045*f),y:Ue(-.3250758611844533*l+1.571847026732543*a-.21825383453227928*f),z:Ue(-.090982811*l-.31272829*a+1.5227666*f)};return r!==void 0&&(c.alpha=r),c},Qt=e=>{let t=Ut(P(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},Vt=e=>D(Gt(e)),O0={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:Qt,xyz65:Ut},toMode:{rgb:Vt,xyz65:Gt},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:s,a:s,b:s,alpha:{use:s,fixup:w}}},en=({j:e,a:t,b:n,alpha:r})=>{t===void 0&&(t=0),n===void 0&&(n=0);let o=Math.sqrt(t*t+n*n),l={mode:"jch",j:e,c:o};return o&&(l.h=C(Math.atan2(n,t)*180/Math.PI)),r!==void 0&&(l.alpha=r),l},tn=({j:e,c:t,h:n,alpha:r})=>{n===void 0&&(n=0);let o={mode:"jab",j:e,a:t?t*Math.cos(n/180*Math.PI):0,b:t?t*Math.sin(n/180*Math.PI):0};return r!==void 0&&(o.alpha=r),o},N0={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:tn,rgb:e=>Vt(tn(e))},fromMode:{rgb:e=>en(Qt(e)),jab:en},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:s,fixup:F},c:s,j:s,alpha:{use:s,fixup:w}},difference:{h:ge},average:{h:X}},He=Math.pow(29,3)/Math.pow(3,3),We=Math.pow(6,3)/Math.pow(29,3);let Ge=e=>Math.pow(e,3)>We?Math.pow(e,3):(116*e-16)/He;const Qe=({l:e,a:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=(e+16)/116,l=t/500+o,a=o-n/200,f={mode:"xyz50",x:Ge(l)*M.X,y:Ge(o)*M.Y,z:Ge(a)*M.Z};return r!==void 0&&(f.alpha=r),f},oe=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=G({r:e*3.1341359569958707-t*1.6173863321612538-.4906619460083532*n,g:e*-.978795502912089+t*1.916254567259524+.03344273116131949*n,b:e*.07195537988411677-t*.2289768264158322+1.405386058324125*n});return r!==void 0&&(o.alpha=r),o},nn=e=>oe(Qe(e)),re=e=>{let{r:t,g:n,b:r,alpha:o}=W(e),l={mode:"xyz50",x:.436065742824811*t+.3851514688337912*n+.14307845442264197*r,y:.22249319175623702*t+.7168870538238823*n+.06061979053616537*r,z:.013923904500943465*t+.09708128566574634*n+.7140993584005155*r};return o!==void 0&&(l.alpha=o),l},Ve=e=>e>We?Math.cbrt(e):(He*e+16)/116,et=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=Ve(e/M.X),l=Ve(t/M.Y),a=Ve(n/M.Z),f={mode:"lab",l:116*l-16,a:500*(o-l),b:200*(l-a)};return r!==void 0&&(f.alpha=r),f},on=e=>{let t=et(re(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t};function I0(e,t){if(!t||t[0]!=="lab")return;const n={mode:"lab"},[,r,o,l,a]=t;if(!(r.type===i.Hue||o.type===i.Hue||l.type===i.Hue))return r.type!==i.None&&(n.l=Math.min(Math.max(0,r.value),100)),o.type!==i.None&&(n.a=o.type===i.Number?o.value:o.value*125/100),l.type!==i.None&&(n.b=l.type===i.Number?l.value:l.value*125/100),a.type!==i.None&&(n.alpha=Math.min(1,Math.max(0,a.type===i.Number?a.value:a.value/100))),n}const tt={mode:"lab",toMode:{xyz50:Qe,rgb:nn},fromMode:{xyz50:et,rgb:on},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-100,100],b:[-100,100]},parse:[I0],serialize:e=>`lab(${e.l!==void 0?e.l:"none"} ${e.a!==void 0?e.a:"none"} ${e.b!==void 0?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{l:s,a:s,b:s,alpha:{use:s,fixup:w}}},q0={...tt,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:Rt,rgb:me},fromMode:{xyz65:jt,rgb:$e},ranges:{l:[0,100],a:[-86.182,98.234],b:[-107.86,94.477]}};function R0(e,t){if(!t||t[0]!=="lch")return;const n={mode:"lch"},[,r,o,l,a]=t;if(r.type!==i.None){if(r.type===i.Hue)return;n.l=Math.min(Math.max(0,r.value),100)}if(o.type!==i.None&&(n.c=Math.max(0,o.type===i.Number?o.value:o.value*150/100)),l.type!==i.None){if(l.type===i.Percentage)return;n.h=l.value}return a.type!==i.None&&(n.alpha=Math.min(1,Math.max(0,a.type===i.Number?a.value:a.value/100))),n}const nt={mode:"lch",toMode:{lab:A,rgb:e=>nn(A(e))},fromMode:{rgb:e=>L(on(e)),lab:L},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[R0],serialize:e=>`lch(${e.l!==void 0?e.l:"none"} ${e.c!==void 0?e.c:"none"} ${e.h!==void 0?e.h:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:s,fixup:F},c:s,l:s,alpha:{use:s,fixup:w}},difference:{h:ge},average:{h:X}},j0={...nt,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:e=>A(e,"lab65"),rgb:e=>me(A(e,"lab65"))},fromMode:{rgb:e=>L($e(e),"lch65"),lab65:e=>L(e,"lch65")},ranges:{l:[0,100],c:[0,133.807],h:[0,360]}},rn=({l:e,u:t,v:n,alpha:r})=>{t===void 0&&(t=0),n===void 0&&(n=0);let o=Math.sqrt(t*t+n*n),l={mode:"lchuv",l:e,c:o};return o&&(l.h=C(Math.atan2(n,t)*180/Math.PI)),r!==void 0&&(l.alpha=r),l},ln=({l:e,c:t,h:n,alpha:r})=>{n===void 0&&(n=0);let o={mode:"luv",l:e,u:t?t*Math.cos(n/180*Math.PI):0,v:t?t*Math.sin(n/180*Math.PI):0};return r!==void 0&&(o.alpha=r),o},an=(e,t,n)=>4*e/(e+15*t+3*n),fn=(e,t,n)=>9*t/(e+15*t+3*n),F0=an(M.X,M.Y,M.Z),X0=fn(M.X,M.Y,M.Z),E0=e=>e<=We?He*e:116*Math.cbrt(e)-16,ot=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=E0(t/M.Y),l=an(e,t,n),a=fn(e,t,n);!isFinite(l)||!isFinite(a)?o=l=a=0:(l=13*o*(l-F0),a=13*o*(a-X0));let f={mode:"luv",l:o,u:l,v:a};return r!==void 0&&(f.alpha=r),f},L0=(e,t,n)=>4*e/(e+15*t+3*n),A0=(e,t,n)=>9*t/(e+15*t+3*n),P0=L0(M.X,M.Y,M.Z),D0=A0(M.X,M.Y,M.Z),rt=({l:e,u:t,v:n,alpha:r})=>{if(e===void 0&&(e=0),e===0)return{mode:"xyz50",x:0,y:0,z:0};t===void 0&&(t=0),n===void 0&&(n=0);let o=t/(13*e)+P0,l=n/(13*e)+D0,a=M.Y*(e<=8?e/He:Math.pow((e+16)/116,3)),f=a*(9*o)/(4*l),c=a*(12-3*o-20*l)/(4*l),d={mode:"xyz50",x:f,y:a,z:c};return r!==void 0&&(d.alpha=r),d},Y0={mode:"lchuv",toMode:{luv:ln,rgb:e=>oe(rt(ln(e)))},fromMode:{rgb:e=>rn(ot(re(e))),luv:rn},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:s,fixup:F},c:s,l:s,alpha:{use:s,fixup:w}},difference:{h:ge},average:{h:X}},Z0={...U,mode:"lrgb",toMode:{rgb:G},fromMode:{rgb:W},parse:["srgb-linear"],serialize:"srgb-linear"},B0={mode:"luv",toMode:{xyz50:rt,rgb:e=>oe(rt(e))},fromMode:{xyz50:ot,rgb:e=>ot(re(e))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:s,u:s,v:s,alpha:{use:s,fixup:w}}},un=({r:e,g:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=Math.cbrt(.41222147079999993*e+.5363325363*t+.0514459929*n),l=Math.cbrt(.2119034981999999*e+.6806995450999999*t+.1073969566*n),a=Math.cbrt(.08830246189999998*e+.2817188376*t+.6299787005000002*n),f={mode:"oklab",l:.2104542553*o+.793617785*l-.0040720468*a,a:1.9779984951*o-2.428592205*l+.4505937099*a,b:.0259040371*o+.7827717662*l-.808675766*a};return r!==void 0&&(f.alpha=r),f},ze=e=>{let t=un(W(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},le=({l:e,a:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=Math.pow(e*.9999999984505198+.39633779217376786*t+.2158037580607588*n,3),l=Math.pow(e*1.0000000088817609-.10556134232365635*t-.06385417477170591*n,3),a=Math.pow(e*1.0000000546724108-.08948418209496575*t-1.2914855378640917*n,3),f={mode:"lrgb",r:4.076741661347994*o-3.307711590408193*l+.230969928729428*a,g:-1.2684380040921763*o+2.6097574006633715*l-.3413193963102197*a,b:-.004196086541837188*o-.7034186144594493*l+1.7076147009309444*a};return r!==void 0&&(f.alpha=r),f},Te=e=>G(le(e));function lt(e){const r=1.170873786407767;return .5*(r*e-.206+Math.sqrt((r*e-.206)*(r*e-.206)+4*.03*r*e))}function Ce(e){return(e*e+.206*e)/(1.170873786407767*(e+.03))}function J0(e,t){let n,r,o,l,a,f,c,d;-1.88170328*e-.80936493*t>1?(n=1.19086277,r=1.76576728,o=.59662641,l=.75515197,a=.56771245,f=4.0767416621,c=-3.3077115913,d=.2309699292):1.81444104*e-1.19445276*t>1?(n=.73956515,r=-.45954404,o=.08285427,l=.1254107,a=.14503204,f=-1.2684380046,c=2.6097574011,d=-.3413193965):(n=1.35733652,r=-.00915799,o=-1.1513021,l=-.50559606,a=.00692167,f=-.0041960863,c=-.7034186147,d=1.707614701);let h=n+r*e+o*t+l*e*e+a*e*t,g=.3963377774*e+.2158037573*t,m=-.1055613458*e-.0638541728*t,$=-.0894841775*e-1.291485548*t;{let y=1+h*g,x=1+h*m,k=1+h*$,_=y*y*y,p=x*x*x,u=k*k*k,T=3*g*y*y,N=3*m*x*x,S=3*$*k*k,ae=6*g*g*y,fe=6*m*m*x,ie=6*$*$*k,V=f*_+c*p+d*u,Z=f*T+c*N+d*S,ue=f*ae+c*fe+d*ie;h=h-V*Z/(Z*Z-.5*V*ue)}return h}function at(e,t){let n=J0(e,t),r=le({l:1,a:n*e,b:n*t}),o=Math.cbrt(1/Math.max(r.r,r.g,r.b)),l=o*n;return[o,l]}function K0(e,t,n,r,o,l=null){l||(l=at(e,t));let a;if((n-o)*l[1]-(l[0]-o)*r<=0)a=l[1]*o/(r*l[0]+l[1]*(o-n));else{a=l[1]*(o-1)/(r*(l[0]-1)+l[1]*(o-n));{let f=n-o,c=r,d=.3963377774*e+.2158037573*t,h=-.1055613458*e-.0638541728*t,g=-.0894841775*e-1.291485548*t,m=f+c*d,$=f+c*h,y=f+c*g;{let x=o*(1-a)+a*n,k=a*r,_=x+k*d,p=x+k*h,u=x+k*g,T=_*_*_,N=p*p*p,S=u*u*u,ae=3*m*_*_,fe=3*$*p*p,ie=3*y*u*u,V=6*m*m*_,Z=6*$*$*p,ue=6*y*y*u,Sn=4.0767416621*T-3.3077115913*N+.2309699292*S-1,$t=4.0767416621*ae-3.3077115913*fe+.2309699292*ie,Yo=4.0767416621*V-3.3077115913*Z+.2309699292*ue,On=$t/($t*$t-.5*Sn*Yo),vt=-Sn*On,Nn=-1.2684380046*T+2.6097574011*N-.3413193965*S-1,yt=-1.2684380046*ae+2.6097574011*fe-.3413193965*ie,Zo=-1.2684380046*V+2.6097574011*Z-.3413193965*ue,In=yt/(yt*yt-.5*Nn*Zo),kt=-Nn*In,qn=-.0041960863*T-.7034186147*N+1.707614701*S-1,xt=-.0041960863*ae-.7034186147*fe+1.707614701*ie,Bo=-.0041960863*V-.7034186147*Z+1.707614701*ue,Rn=xt/(xt*xt-.5*qn*Bo),Mt=-qn*Rn;vt=On>=0?vt:1e6,kt=In>=0?kt:1e6,Mt=Rn>=0?Mt:1e6,a+=Math.min(vt,Math.min(kt,Mt))}}}return a}function ft(e,t,n=null){n||(n=at(e,t));let r=n[0],o=n[1];return[o/r,o/(1-r)]}function dn(e,t,n){let r=at(t,n),o=K0(t,n,e,1,e,r),l=ft(t,n,r),a=.11516993+1/(7.4477897+4.1590124*n+t*(-2.19557347+1.75198401*n+t*(-2.13704948-10.02301043*n+t*(-4.24894561+5.38770819*n+4.69891013*t)))),f=.11239642+1/(1.6132032-.68124379*n+t*(.40370612+.90148123*n+t*(-.27087943+.6122399*n+t*(.00299215-.45399568*n-.14661872*t)))),c=o/Math.min(e*l[0],(1-e)*l[1]),d=e*a,h=(1-e)*f,g=.9*c*Math.sqrt(Math.sqrt(1/(1/(d*d*d*d)+1/(h*h*h*h))));return d=e*.4,h=(1-e)*.8,[Math.sqrt(1/(1/(d*d)+1/(h*h))),g,o]}function sn(e){const t=e.l!==void 0?e.l:0,n=e.a!==void 0?e.a:0,r=e.b!==void 0?e.b:0,o={mode:"okhsl",l:lt(t)};e.alpha!==void 0&&(o.alpha=e.alpha);let l=Math.sqrt(n*n+r*r);if(!l)return o.s=0,o;let[a,f,c]=dn(t,n/l,r/l),d;if(l<f){let h=0,g=.8*a,m=1-g/f;d=(l-h)/(g+m*(l-h))*.8}else{let h=f,g=.2*f*f*1.25*1.25/a,m=1-g/(c-f);d=.8+.2*((l-h)/(g+m*(l-h)))}return d&&(o.s=d,o.h=C(Math.atan2(r,n)*180/Math.PI)),o}function cn(e){let t=e.h!==void 0?e.h:0,n=e.s!==void 0?e.s:0,r=e.l!==void 0?e.l:0;const o={mode:"oklab",l:Ce(r)};if(e.alpha!==void 0&&(o.alpha=e.alpha),!n||r===1)return o.a=o.b=0,o;let l=Math.cos(t/180*Math.PI),a=Math.sin(t/180*Math.PI),[f,c,d]=dn(o.l,l,a),h,g,m,$;n<.8?(h=1.25*n,g=0,m=.8*f,$=1-m/c):(h=5*(n-.8),g=c,m=.2*c*c*1.25*1.25/f,$=1-m/(d-c));let y=g+h*m/(1-$*h);return o.a=y*l,o.b=y*a,o}const U0={...At,mode:"okhsl",channels:["h","s","l","alpha"],parse:["--okhsl"],serialize:"--okhsl",fromMode:{oklab:sn,rgb:e=>sn(ze(e))},toMode:{oklab:cn,rgb:e=>Te(cn(e))}};function hn(e){let t=e.l!==void 0?e.l:0,n=e.a!==void 0?e.a:0,r=e.b!==void 0?e.b:0,o=Math.sqrt(n*n+r*r),l=o?n/o:1,a=o?r/o:1,[f,c]=ft(l,a),d=.5,h=1-d/f,g=c/(o+t*c),m=g*t,$=g*o,y=Ce(m),x=$*y/m,k=le({l:y,a:l*x,b:a*x}),_=Math.cbrt(1/Math.max(k.r,k.g,k.b,0));t=t/_,o=o/_*lt(t)/t,t=lt(t);const p={mode:"okhsv",s:o?(d+c)*$/(c*d+c*h*$):0,v:t?t/m:0};return p.s&&(p.h=C(Math.atan2(r,n)*180/Math.PI)),e.alpha!==void 0&&(p.alpha=e.alpha),p}function pn(e){const t={mode:"oklab"};e.alpha!==void 0&&(t.alpha=e.alpha);const n=e.h!==void 0?e.h:0,r=e.s!==void 0?e.s:0,o=e.v!==void 0?e.v:0,l=Math.cos(n/180*Math.PI),a=Math.sin(n/180*Math.PI),[f,c]=ft(l,a),d=.5,h=1-d/f,g=1-r*d/(d+c-c*h*r),m=r*c*d/(d+c-c*h*r),$=Ce(g),y=m*$/g,x=le({l:$,a:l*y,b:a*y}),k=Math.cbrt(1/Math.max(x.r,x.g,x.b,0)),_=Ce(o*g),p=m*_/g;return t.l=_*k,t.a=p*l*k,t.b=p*a*k,t}const W0={...Yt,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:hn,rgb:e=>hn(ze(e))},toMode:{oklab:pn,rgb:e=>Te(pn(e))}};function G0(e,t){if(!t||t[0]!=="oklab")return;const n={mode:"oklab"},[,r,o,l,a]=t;if(!(r.type===i.Hue||o.type===i.Hue||l.type===i.Hue))return r.type!==i.None&&(n.l=Math.min(Math.max(0,r.type===i.Number?r.value:r.value/100),1)),o.type!==i.None&&(n.a=o.type===i.Number?o.value:o.value*.4/100),l.type!==i.None&&(n.b=l.type===i.Number?l.value:l.value*.4/100),a.type!==i.None&&(n.alpha=Math.min(1,Math.max(0,a.type===i.Number?a.value:a.value/100))),n}const Q0={...tt,mode:"oklab",toMode:{lrgb:le,rgb:Te},fromMode:{lrgb:un,rgb:ze},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[G0],serialize:e=>`oklab(${e.l!==void 0?e.l:"none"} ${e.a!==void 0?e.a:"none"} ${e.b!==void 0?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`};function V0(e,t){if(!t||t[0]!=="oklch")return;const n={mode:"oklch"},[,r,o,l,a]=t;if(r.type!==i.None){if(r.type===i.Hue)return;n.l=Math.min(Math.max(0,r.type===i.Number?r.value:r.value/100),1)}if(o.type!==i.None&&(n.c=Math.max(0,o.type===i.Number?o.value:o.value*.4/100)),l.type!==i.None){if(l.type===i.Percentage)return;n.h=l.value}return a.type!==i.None&&(n.alpha=Math.min(1,Math.max(0,a.type===i.Number?a.value:a.value/100))),n}const eo={...nt,mode:"oklch",toMode:{oklab:e=>A(e,"oklab"),rgb:e=>Te(A(e,"oklab"))},fromMode:{rgb:e=>L(ze(e),"oklch"),oklab:e=>L(e,"oklch")},parse:[V0],serialize:e=>`oklch(${e.l!==void 0?e.l:"none"} ${e.c!==void 0?e.c:"none"} ${e.h!==void 0?e.h:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}},bn=e=>{let{r:t,g:n,b:r,alpha:o}=W(e),l={mode:"xyz65",x:.486570948648216*t+.265667693169093*n+.1982172852343625*r,y:.2289745640697487*t+.6917385218365062*n+.079286914093745*r,z:0*t+.0451133818589026*n+1.043944368900976*r};return o!==void 0&&(l.alpha=o),l},gn=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=G({r:e*2.4934969119414263-t*.9313836179191242-.402710784450717*n,g:e*-.8294889695615749+t*1.7626640603183465+.0236246858419436*n,b:e*.0358458302437845-t*.0761723892680418+.9568845240076871*n},"p3");return r!==void 0&&(o.alpha=r),o},to={...U,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:e=>gn(P(e)),xyz65:gn},toMode:{rgb:e=>D(bn(e)),xyz65:bn}},it=e=>{let t=Math.abs(e);return t>=1/512?Math.sign(e)*Math.pow(t,1/1.8):16*e},mn=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o={mode:"prophoto",r:it(e*1.3457868816471585-t*.2555720873797946-.0511018649755453*n),g:it(e*-.5446307051249019+t*1.5082477428451466+.0205274474364214*n),b:it(e*0+t*0+1.2119675456389452*n)};return r!==void 0&&(o.alpha=r),o},ut=(e=0)=>{let t=Math.abs(e);return t>=16/512?Math.sign(e)*Math.pow(t,1.8):e/16},$n=e=>{let t=ut(e.r),n=ut(e.g),r=ut(e.b),o={mode:"xyz50",x:.7977666449006423*t+.1351812974005331*n+.0313477341283922*r,y:.2880748288194013*t+.7118352342418731*n+899369387256e-16*r,z:0*t+0*n+.8251046025104602*r};return e.alpha!==void 0&&(o.alpha=e.alpha),o},no={...U,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:mn,rgb:e=>mn(re(e))},toMode:{xyz50:$n,rgb:e=>oe($n(e))}},vn=1.09929682680944,oo=.018053968510807,dt=e=>{const t=Math.abs(e);return t>oo?(Math.sign(e)||1)*(vn*Math.pow(t,.45)-(vn-1)):4.5*e},yn=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o={mode:"rec2020",r:dt(e*1.7166511879712683-t*.3556707837763925-.2533662813736599*n),g:dt(e*-.6666843518324893+t*1.6164812366349395+.0157685458139111*n),b:dt(e*.0176398574453108-t*.0427706132578085+.9421031212354739*n)};return r!==void 0&&(o.alpha=r),o},kn=1.09929682680944,ro=.018053968510807,st=(e=0)=>{let t=Math.abs(e);return t<ro*4.5?e/4.5:(Math.sign(e)||1)*Math.pow((t+kn-1)/kn,1/.45)},xn=e=>{let t=st(e.r),n=st(e.g),r=st(e.b),o={mode:"xyz65",x:.6369580483012911*t+.1446169035862083*n+.1688809751641721*r,y:.262700212011267*t+.6779980715188708*n+.059301716469862*r,z:0*t+.0280726930490874*n+1.0609850577107909*r};return e.alpha!==void 0&&(o.alpha=e.alpha),o},lo={...U,mode:"rec2020",fromMode:{xyz65:yn,rgb:e=>yn(P(e))},toMode:{xyz65:xn,rgb:e=>D(xn(e))},parse:["rec2020"],serialize:"rec2020"},Y=.0037930732552754493,Mn=Math.cbrt(Y),ct=e=>Math.cbrt(e)-Mn,ao=e=>{const{r:t,g:n,b:r,alpha:o}=W(e),l=ct(.3*t+.622*n+.078*r+Y),a=ct(.23*t+.692*n+.078*r+Y),f=ct(.2434226892454782*t+.2047674442449682*n+.5518098665095535*r+Y),c={mode:"xyb",x:(l-a)/2,y:(l+a)/2,b:f-(l+a)/2};return o!==void 0&&(c.alpha=o),c},ht=e=>Math.pow(e+Mn,3),fo={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:({x:e,y:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);const o=ht(e+t)-Y,l=ht(t-e)-Y,a=ht(n+t)-Y,f=G({r:11.031566904639861*o-9.866943908131562*l-.16462299650829934*a,g:-3.2541473810744237*o+4.418770377582723*l-.16462299650829934*a,b:-3.6588512867136815*o+2.7129230459360922*l+1.9459282407775895*a});return r!==void 0&&(f.alpha=r),f}},fromMode:{rgb:ao},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:s,y:s,b:s,alpha:{use:s,fixup:w}}},io={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:oe,lab:et},fromMode:{rgb:re,lab:Qe},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:s,y:s,z:s,alpha:{use:s,fixup:w}}},uo={mode:"xyz65",toMode:{rgb:D,xyz50:e=>{let{x:t,y:n,z:r,alpha:o}=e;t===void 0&&(t=0),n===void 0&&(n=0),r===void 0&&(r=0);let l={mode:"xyz50",x:1.0479298208405488*t+.0229467933410191*n-.0501922295431356*r,y:.0296278156881593*t+.990434484573249*n-.0170738250293851*r,z:-.0092430581525912*t+.0150551448965779*n+.7518742899580008*r};return o!==void 0&&(l.alpha=o),l}},fromMode:{rgb:P,xyz50:e=>{let{x:t,y:n,z:r,alpha:o}=e;t===void 0&&(t=0),n===void 0&&(n=0),r===void 0&&(r=0);let l={mode:"xyz65",x:.9554734527042182*t-.0230985368742614*n+.0632593086610217*r,y:-.0283697069632081*t+1.0099954580058226*n+.021041398966943*r,z:.0123140016883199*t-.0205076964334779*n+1.3303659366080753*r};return o!==void 0&&(l.alpha=o),l}},ranges:{x:[0,.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:s,y:s,z:s,alpha:{use:s,fixup:w}}},so={mode:"yiq",toMode:{rgb:({y:e,i:t,q:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);const o={mode:"rgb",r:e+.95608445*t+.6208885*n,g:e-.27137664*t-.6486059*n,b:e-1.10561724*t+1.70250126*n};return r!==void 0&&(o.alpha=r),o}},fromMode:{rgb:({r:e,g:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);const o={mode:"yiq",y:.29889531*e+.58662247*t+.11448223*n,i:.59597799*e-.2741761*t-.32180189*n,q:.21147017*e-.52261711*t+.31114694*n};return r!==void 0&&(o.alpha=r),o}},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:s,i:s,q:s,alpha:{use:s,fixup:w}}},co=e=>Math.max(0,Math.min(1,e||0)),pt=e=>Math.round(co(e)*255),ho=de("rgb"),po=e=>{if(e===void 0)return;let t=pt(e.r),n=pt(e.g),r=pt(e.b);return"#"+(1<<24|t<<16|n<<8|r).toString(16).slice(1)},bo=e=>po(ho(e));v(r0),v(s0),v(c0),v(h0),v(g0),v(At),v(Yt),v(H0),v(z0),v(O0),v(N0),v(tt),v(q0),v(nt),v(j0),v(Y0),v(Z0),v(B0),v(U0),v(W0),v(Q0),v(eo),v(to),v(no),v(lo),v(U),v(fo),v(io),v(uo),v(so);const bt=de("oklch"),_n=de("hsl"),go=e=>{(typeof e===void 0||`${e}`.trim().length<1)&&console.warn(`oklchStringToLchArray: invalid param strOklch: "${e}"`);const t=bt(e);return[`${H((t==null?void 0:t.l)??0)}`,`${H((t==null?void 0:t.c)??0)}`,`${H((t==null?void 0:t.h)??0)}`,`${H((t==null?void 0:t.alpha)??1)}`]},mo=e=>{(typeof e===void 0||`${e}`.trim().length<1)&&console.warn(`oklchStringToHslArray: invalid param strOklch: "${e}"`);const t=_n(e);return[`${H((t==null?void 0:t.h)??0)}`,`${H(((t==null?void 0:t.s)??0)*100)}%`,`${H(((t==null?void 0:t.l)??0)*100)}%`,`${H((t==null?void 0:t.alpha)??1)}`]},$o=(e,t)=>{if((typeof e===void 0||`${e}`.trim().length<1)&&console.warn(`convertHexValue: invalid param hexValue: "${e}"`),t){const n=bt(e);return[`${H(n.l??0)}`,`${H(n.c??0)}`,`${H(n.h??0)}`,`${H(n.alpha??1)}`]}else{const n=_n(e);return[`${H((n==null?void 0:n.h)??0)}`,`${H(((n==null?void 0:n.s)??0)*100)}%`,`${H(((n==null?void 0:n.l)??0)*100)}%`,`${H((n==null?void 0:n.alpha)??1)}`]}},H=e=>Number(e.toFixed(2)),vo=e=>{const t=bt(e);return`oklch(${H(t.l??0)} ${H(t.c??0)} ${H(t.h??0)} / 1)`},yo=e=>(e||"").trim().length<7?"":`${bo(zt(e))}`,gt=()=>({convertHexValue:$o,oklchStringFromHex:vo,oklchStringToLchArray:go,oklchStringToHslArray:mo,hexStringFromOklchString:yo}),ko=(e,t,n,r)=>{const o=(r||"").trim().length>0;if(t){let l=`--${e}-${n}-okl`,a=`--${e}-${n}-okc`,f=`--${e}-${n}-okh`;const c=`var(${l}) var(${a}) var(${f})`;return o?`oklch(${c} / var(${r}))`:`oklch(${c})`}else{let l=`--${e}-${n}-h`,a=`--${e}-${n}-s`,f=`--${e}-${n}-l`;const c=`var(${l}) var(${a}) var(${f})`;return o?`hsl(${c} / var(${r})%)`:`hsl(${c})`}},wn=[{key:"--bwj-text-opacity",value:"1"},{key:"--bwj-content-opacity",value:"1"},{key:"--bwj-backdrop-opacity",value:"1"},{key:"--bwj-fill-opacity",value:"1"},{key:"--bwj-shadow",value:"var(--tw-shadow, 0 0 #0000)"},{key:"--bwj-ring-inset",value:""},{key:"--bwj-ring-offset-width",value:"var(--tw-ring-offset-width, 0px)"},{key:"--bwj-ring-offset-color",value:"var(--tw-ring-offset-color, #ffffff)"}],xo=()=>[...new Set([...Object.values(document.documentElement.style)])].map(n=>n.replace(/^[\-\-]+[^\-]+\-{1}/,"")).map(n=>{let r=n.split("-");return r.pop(),r.join("-")}).filter(n=>n.length>0&&n.indexOf("-content")===-1).map(n=>n.split("-")).reduce((n,[r,o])=>{let l=n.find(a=>a.id===r);return l||(l={id:r,hasHover:!1,hasFocus:!1},n.push(l)),o==="hover"&&(l.hasHover=!0),o==="focus"&&(l.hasFocus=!0),n},[]),Mo=()=>{const t=[...new Set([...Object.values(document.documentElement.style)])].filter(n=>(n||"").trim().length>0).map(n=>({key:n,value:document.documentElement.style.getPropertyValue(n)}));return[...wn,...t]},Hn=()=>({defaultCssVarsKeyValues:wn,buildCssAttributeColorExpression:ko,getDocumentCssVarsInfos:xo,getDocumentCssVarsKeyValues:Mo}),{defaultCssVarsKeyValues:_o}=Hn(),O=()=>{let e=""+new Date().getTime();e.length<13&&(e=e.padEnd(13,"0"));let t=`${Math.round(Math.random()*1e6)}`.trim();return t.length<10&&(t=t.padStart(10,"0")),`${e}${t}`},zn=[{uniqueId:O(),id:"primary",hasHover:!0,hasFocus:!0,_hex:"#00bfff",_hoverHex:"#3dc7f5",_focusHex:"#80dfff",_contentHex:"#ffffff",selected:!0,flash:!1,oklch:"oklch(0.76 0.15 231.64 / 1)",contentOklch:"oklch(1 0 0 / 1)",hoverOklch:"oklch(0.78 0.13 225.15 / 1)",focusOklch:"oklch(0.86 0.1 221.95 / 1)"},{uniqueId:O(),id:"secondary",hasHover:!0,hasFocus:!0,_hex:"#f0fbff",_hoverHex:"#e0f7ff",_focusHex:"#d6f4ff",_contentHex:"#0095c7",selected:!0,flash:!1,oklch:"oklch(0.98 0.01 221.42 / 1)",contentOklch:"oklch(0.63 0.13 231.17 / 1)",hoverOklch:"oklch(0.96 0.03 220.63 / 1)",focusOklch:"oklch(0.95 0.03 221.88 / 1)"},{uniqueId:O(),id:"accent",hasHover:!0,hasFocus:!0,_hex:"#fdf59b",_hoverHex:"#fcf178",_focusHex:"#fbeb37",_contentHex:"#000000",selected:!0,flash:!1,oklch:"oklch(0.96 0.11 103.9 / 1)",contentOklch:"oklch(0 0 0 / 1)",hoverOklch:"oklch(0.94 0.14 104.07 / 1)",focusOklch:"oklch(0.92 0.18 104.02 / 1)"},{uniqueId:O(),id:"neutral",hasHover:!0,hasFocus:!0,_hex:"#f5f5f5",_hoverHex:"#fdfff5",_focusHex:"#ffffff",_contentHex:"#000000",selected:!0,flash:!1,oklch:"oklch(0.97 0 0 / 1)",contentOklch:"oklch(0 0 0 / 1)",hoverOklch:"oklch(1 0.01 115.82 / 1)",focusOklch:"oklch(1 0 0 / 1)"},{uniqueId:O(),id:"disabled",hasHover:!1,hasFocus:!1,_hex:"#f2f2f2",_contentHex:"#8c8c8c",selected:!0,flash:!1,oklch:"oklch(0.96 0 0 / 1)",contentOklch:"oklch(0.64 0 0 / 1)"},{uniqueId:O(),id:"info",hasHover:!0,hasFocus:!0,_hex:"#70b5ff",_hoverHex:"#5cabff",_focusHex:"#c2dfff",_contentHex:"#ffffff",selected:!0,flash:!1,oklch:"oklch(0.76 0.13 251.4 / 1)",contentOklch:"oklch(1 0 0 / 1)",hoverOklch:"oklch(0.73 0.15 251.72 / 1)",focusOklch:"oklch(0.89 0.05 250.99 / 1)"},{uniqueId:O(),id:"success",hasHover:!0,hasFocus:!0,_hex:"#8cf28c",_hoverHex:"#a8f0a8",_focusHex:"#19e619",_contentHex:"#000000",selected:!0,flash:!1,oklch:"oklch(0.87 0.17 143.98 / 1)",contentOklch:"oklch(0 0 0 / 1)",hoverOklch:"oklch(0.89 0.12 144.47 / 1)",focusOklch:"oklch(0.8 0.27 142.58 / 1)"},{uniqueId:O(),id:"warning",hasHover:!0,hasFocus:!0,_hex:"#ffc266",_hoverHex:"#f5a83d",_focusHex:"#fdb953",_contentHex:"#000000",selected:!0,flash:!1,oklch:"oklch(0.85 0.13 75.72 / 1)",contentOklch:"oklch(0 0 0 / 1)",hoverOklch:"oklch(0.79 0.15 70.87 / 1)",focusOklch:"oklch(0.83 0.14 74.52 / 1)"},{uniqueId:O(),id:"danger",hasHover:!0,hasFocus:!0,_hex:"#ff6666",_hoverHex:"#f50000",_focusHex:"#f07575",_contentHex:"#ffffff",selected:!0,flash:!1,oklch:"oklch(0.7 0.19 23.19 / 1)",contentOklch:"oklch(1 0 0 / 1)",hoverOklch:"oklch(0.61 0.25 29.23 / 1)",focusOklch:"oklch(0.71 0.15 21.7 / 1)"},{uniqueId:O(),id:"formfield",hasHover:!0,hasFocus:!0,_hex:"eeeeee",_hoverHex:"#efefef",_focusHex:"#efefef",_contentHex:"#111111",selected:!0,flash:!1,oklch:"oklch(0.9491 0 0 / 1)",contentOklch:"oklch(0.1776 0 0 / 1)",hoverOklch:"oklch(0.9521 0 0 / 1)",focusOklch:"oklch(0.9521 0 0 / 1)"},{uniqueId:O(),id:"body",hasHover:!1,hasFocus:!1,_hex:"#363636",_contentHex:"#efefef",selected:!0,flash:!1,oklch:"oklch(0.33 0 0 / 1)",contentOklch:"oklch(0.95 0 0 / 1)"},{uniqueId:O(),id:"card",hasHover:!1,hasFocus:!1,_hex:"#dedede",_contentHex:"#333333",selected:!0,flash:!1,oklch:"oklch(0.9 0 0 / 1)",contentOklch:"oklch(0.32 0 0 / 1)"},{uniqueId:O(),id:"code",hasHover:!1,hasFocus:!1,_hex:"#3a3753",_contentHex:"#c2dcff",selected:!0,flash:!1,oklch:"oklch(0.35 0.05 288.57 / 1)",contentOklch:"oklch(0.89 0.06 255.89 / 1)"}],wo=(e,t)=>{const n=(t==null?void 0:t.hasHover)||!1,r=(t==null?void 0:t.hasFocus)||!1;return{uniqueId:O(),id:e,hasHover:n,hasFocus:r,_hex:"#ff3fd0",_hoverHex:"#ff3fd0",_focusHex:"#ff3fd0",_contentHex:"#ffffff",oklch:"oklch(0.7 0.27 340 / 1)",hoverOklch:"oklch(0.7 0.32 340 / 1)",focusOklch:"oklch(0.7 0.32 340 / 1)",contentOklch:"oklch(1 0 0 / 1)",selected:!0,flash:!1}},Ho=()=>{const e=d=>(d==null?void 0:d.value)||"0",t=d=>{if(d.length<3)return"";const h=`${e(d.find($=>$.key.endsWith("-okl")))}`,g=`${e(d.find($=>$.key.endsWith("-okc")))}`,m=`${e(d.find($=>$.key.endsWith("-okh")))}`;return d.length>0?`oklch(${h} ${g} ${m})`:""},n=d=>{const{hexStringFromOklchString:h}=gt(),g=l.filter(S=>S.key.startsWith(d)),m=g.filter(S=>S.key.split("-").length===2),$=g.filter(S=>S.key.indexOf("-hover")>-1),y=g.filter(S=>S.key.indexOf("-focus")>-1),x=g.filter(S=>S.key.indexOf("-content")>-1),k=$.length>0,_=y.length>0,p=t(m),u=t(x);let T="",N="";return k&&(T=t($)),_&&(N=t(y)),{uniqueId:O(),id:d,hasHover:k,hasFocus:_,_hex:h(p),_hoverHex:k?h(T):"",_focusHex:_?h(N):"",_contentHex:h(u),oklch:p,hoverOklch:T,focusOklch:N,contentOklch:u,selected:!0,flash:!1}},o=[...document.styleSheets].flatMap(d=>Object.values(d.rules)).filter(d=>d.selectorText==":root");if(o.length<1)return zn;const l=`${o[0].cssText}`.replace(":root","").replace("{","").replace("}","").trim().split(";").map(d=>{let h=`${d}`.split(":");return{key:`${h[0]}`.replace("--bwj-","").trim(),value:h.length>1?h[1].trim():"0"}}),a=new Set([..._o.map(d=>`${d.key}`.trim().replace("--bwj-","").split("-")[0].trim()),"opacity"]),c=[...new Set(l.map(d=>d.key.split("-")[0].trim()))].filter(d=>d.length>0).filter(d=>!a.has(d));return c.length>0?c.map(n):zn},zo=(e,t,n)=>{const{oklchStringFromHex:r}=gt(),o=r(t);return n?n==="content"?(e.contentOklch=o,e._contentHex=t):n==="hover"?(e.hoverOklch=o,e._hoverHex=t):n==="focus"&&(e.focusOklch=o,e._focusHex=t):(e.oklch=o,e._hex=t),e},To=(e,t,n)=>(n=(n||"").trim().toLowerCase(),/[^a-z]+/.test(n)?'Name can only contain characters from "a" to "z".':n.length<3||n.length>20?"Name must be between 3 and 20 characters.":e.some(r=>r.uniqueId!==t&&r.id.toLowerCase()===n)?"Name is already in use.":""),Co=()=>({getInitialCategoryOptions:Ho,updateCategoryFieldsFromHex:zo,initCategoryOption:wo,validateCategoryName:To}),So=`
`||t[b]===" "||t[b]===" ");)b++;continue}if(r===",")return;if(r===")"){n.push({type:i.ParenClose});continue}if(r==="+"){if(b--,ce(t)){n.push(te(t));continue}return}if(r==="-"){if(b--,ce(t)){n.push(te(t));continue}if(qe(t)){n.push({type:i.Ident,value:pe(t)});continue}return}if(r==="."){if(b--,ce(t)){n.push(te(t));continue}return}if(r==="/"){for(;b<t.length&&(t[b]===`
`||t[b]===" "||t[b]===" ");)b++;let o;if(ce(t)&&(o=te(t),o.type!==i.Hue)){n.push({type:i.Alpha,value:o});continue}if(qe(t)&&pe(t)==="none"){n.push({type:i.Alpha,value:{type:i.None,value:void 0}});continue}return}if(/\d/.test(r)){b--,n.push(te(t));continue}if(Ne.test(r)){b--,n.push(t0(t));continue}return}return n}function o0(e){e._i=0;let t=e[e._i++];if(!t||t.type!==i.Function||t.value!=="color"||(t=e[e._i++],t.type!==i.Ident))return;const n=Ht[t.value];if(!n)return;const r={mode:n},o=Tt(e,!1);if(!o)return;const l=Gn(n).channels;for(let a=0,f,c;a<l.length;a++)f=o[a],c=l[a],f.type!==i.None&&(r[c]=f.type===i.Number?f.value:f.value/100,c==="alpha"&&(r[c]=Math.max(0,Math.min(1,r[c]))));return r}function Tt(e,t){const n=[];let r;for(;e._i<e.length;){if(r=e[e._i++],r.type===i.None||r.type===i.Number||r.type===i.Alpha||r.type===i.Percentage||t&&r.type===i.Hue){n.push(r);continue}if(r.type===i.ParenClose){if(e._i<e.length)return;continue}return}if(!(n.length<3||n.length>4)){if(n.length===4){if(n[3].type!==i.Alpha)return;n[3]=n[3].value}return n.length===3&&n.push({type:i.None,value:void 0}),n.every(o=>o.type!==i.Alpha)?n:void 0}}function r0(e,t){e._i=0;let n=e[e._i++];if(!n||n.type!==i.Function)return;let r=Tt(e,t);if(r)return r.unshift(n.value),r}const zt=e=>{if(typeof e!="string")return;const t=n0(e),n=t?r0(t,!0):void 0;let r,o=0,l=se.length;for(;o<l;)if((r=se[o++](e,n))!==void 0)return r;return t?o0(t):void 0};function l0(e,t){if(!t||t[0]!=="rgb"&&t[0]!=="rgba")return;const n={mode:"rgb"},[,r,o,l,a]=t;if(!(r.type===i.Hue||o.type===i.Hue||l.type===i.Hue))return r.type!==i.None&&(n.r=r.type===i.Number?r.value/255:r.value/100),o.type!==i.None&&(n.g=o.type===i.Number?o.value/255:o.value/100),l.type!==i.None&&(n.b=l.type===i.Number?l.value/255:l.value/100),a.type!==i.None&&(n.alpha=Math.min(1,Math.max(0,a.type===i.Number?a.value:a.value/100))),n}const a0=e=>e==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,f0=(e,t,n)=>e+n*(t-e),i0=e=>{let t=[];for(let n=0;n<e.length-1;n++){let r=e[n],o=e[n+1];r===void 0&&o===void 0?t.push(void 0):r!==void 0&&o!==void 0?t.push([r,o]):t.push(r!==void 0?[r,r]:[o,o])}return t},s=(e=>t=>{let n=i0(t);return r=>{let o=r*n.length,l=r>=1?n.length-1:Math.max(Math.floor(o),0),a=n[l];return a===void 0?void 0:e(a[0],a[1],o-l)}})(f0),w=e=>{let t=!1,n=e.map(r=>r!==void 0?(t=!0,r):1);return t?n:e},K={mode:"rgb",channels:["r","g","b","alpha"],parse:[l0,Yn,Un,An,a0,"srgb"],serialize:"srgb",interpolate:{r:s,g:s,b:s,alpha:{use:s,fixup:w}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},Re=(e=0)=>Math.pow(Math.abs(e),563/256)*Math.sign(e),Ct=e=>{let t=Re(e.r),n=Re(e.g),r=Re(e.b),o={mode:"xyz65",x:.5766690429101305*t+.1855582379065463*n+.1882286462349947*r,y:.297344975250536*t+.6273635662554661*n+.0752914584939979*r,z:.0270313613864123*t+.0706888525358272*n+.9913375368376386*r};return e.alpha!==void 0&&(o.alpha=e.alpha),o},je=e=>Math.pow(Math.abs(e),256/563)*Math.sign(e),St=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o={mode:"a98",r:je(e*2.0415879038107465-t*.5650069742788597-.3447313507783297*n),g:je(e*-.9692436362808798+t*1.8759675015077206+.0415550574071756*n),b:je(e*.0134442806320312-t*.1183623922310184+1.0151749943912058*n)};return r!==void 0&&(o.alpha=r),o},Fe=(e=0)=>{const t=Math.abs(e);return t<=.04045?e/12.92:(Math.sign(e)||1)*Math.pow((t+.055)/1.055,2.4)},W=({r:e,g:t,b:n,alpha:r})=>{let o={mode:"lrgb",r:Fe(e),g:Fe(t),b:Fe(n)};return r!==void 0&&(o.alpha=r),o},D=e=>{let{r:t,g:n,b:r,alpha:o}=W(e),l={mode:"xyz65",x:.4123907992659593*t+.357584339383878*n+.1804807884018343*r,y:.2126390058715102*t+.715168678767756*n+.0721923153607337*r,z:.0193308187155918*t+.119194779794626*n+.9505321522496607*r};return o!==void 0&&(l.alpha=o),l},Xe=(e=0)=>{const t=Math.abs(e);return t>.0031308?(Math.sign(e)||1)*(1.055*Math.pow(t,1/2.4)-.055):e*12.92},G=({r:e,g:t,b:n,alpha:r},o="rgb")=>{let l={mode:o,r:Xe(e),g:Xe(t),b:Xe(n)};return r!==void 0&&(l.alpha=r),l},Y=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=G({r:e*3.2409699419045226-t*1.537383177570094-.4986107602930034*n,g:e*-.9692436362808796+t*1.8759675015077204+.0415550574071756*n,b:e*.0556300796969936-t*.2039769588889765+1.0569715142428784*n});return r!==void 0&&(o.alpha=r),o},u0={...K,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:e=>St(D(e)),xyz65:St},toMode:{rgb:e=>Y(Ct(e)),xyz65:Ct}},C=e=>(e=e%360)<0?e+360:e,d0=(e,t)=>e.map((n,r,o)=>{if(n===void 0)return n;let l=C(n);return r===0||e[r-1]===void 0?l:t(l-C(o[r-1]))}).reduce((n,r)=>!n.length||r===void 0||n[n.length-1]===void 0?(n.push(r),n):(n.push(r+n[n.length-1]),n),[]),X=e=>d0(e,t=>Math.abs(t)<=180?t:t-360*Math.sign(t)),T=[-.14861,1.78277,-.29227,-.90649,1.97294,0],s0=Math.PI/180,c0=180/Math.PI;let Ot=T[3]*T[4],It=T[1]*T[4],Nt=T[1]*T[2]-T[0]*T[3];const h0=({r:e,g:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=(Nt*n+e*Ot-t*It)/(Nt+Ot-It),l=n-o,a=(T[4]*(t-o)-T[2]*l)/T[3],f={mode:"cubehelix",l:o,s:o===0||o===1?void 0:Math.sqrt(l*l+a*a)/(T[4]*o*(1-o))};return f.s&&(f.h=Math.atan2(a,l)*c0-120),r!==void 0&&(f.alpha=r),f},p0=({h:e,s:t,l:n,alpha:r})=>{let o={mode:"rgb"};e=(e===void 0?0:e+120)*s0,n===void 0&&(n=0);let l=t===void 0?0:t*n*(1-n),a=Math.cos(e),f=Math.sin(e);return o.r=n+l*(T[0]*a+T[1]*f),o.g=n+l*(T[2]*a+T[3]*f),o.b=n+l*(T[4]*a+T[5]*f),r!==void 0&&(o.alpha=r),o},be=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.s||!t.s)return 0;let n=C(e.h),r=C(t.h),o=Math.sin((r-n+360)/2*Math.PI/180);return 2*Math.sqrt(e.s*t.s)*o},b0=(e,t)=>{if(e.h===void 0||t.h===void 0)return 0;let n=C(e.h),r=C(t.h);return Math.abs(r-n)>180?n-(r-360*Math.sign(r-n)):r-n},ge=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.c||!t.c)return 0;let n=C(e.h),r=C(t.h),o=Math.sin((r-n+360)/2*Math.PI/180);return 2*Math.sqrt(e.c*t.c)*o},E=e=>{let t=e.reduce((r,o)=>{if(o!==void 0){let l=o*Math.PI/180;r.sin+=Math.sin(l),r.cos+=Math.cos(l)}return r},{sin:0,cos:0}),n=Math.atan2(t.sin,t.cos)*180/Math.PI;return n<0?360+n:n},g0={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:h0},toMode:{rgb:p0},interpolate:{h:{use:s,fixup:X},s,l:s,alpha:{use:s,fixup:w}},difference:{h:be},average:{h:E}},P=({l:e,a:t,b:n,alpha:r},o="lch")=>{t===void 0&&(t=0),n===void 0&&(n=0);let l=Math.sqrt(t*t+n*n),a={mode:o,l:e,c:l};return l&&(a.h=C(Math.atan2(n,t)*180/Math.PI)),r!==void 0&&(a.alpha=r),a},A=({l:e,c:t,h:n,alpha:r},o="lab")=>{n===void 0&&(n=0);let l={mode:o,l:e,a:t?t*Math.cos(n/180*Math.PI):0,b:t?t*Math.sin(n/180*Math.PI):0};return r!==void 0&&(l.alpha=r),l},qt=Math.pow(29,3)/Math.pow(3,3),Rt=Math.pow(6,3)/Math.pow(29,3),M={X:.3457/.3585,Y:1,Z:(1-.3457-.3585)/.3585},Q={X:.3127/.329,Y:1,Z:(1-.3127-.329)/.329};let Ee=e=>Math.pow(e,3)>Rt?Math.pow(e,3):(116*e-16)/qt;const jt=({l:e,a:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=(e+16)/116,l=t/500+o,a=o-n/200,f={mode:"xyz65",x:Ee(l)*Q.X,y:Ee(o)*Q.Y,z:Ee(a)*Q.Z};return r!==void 0&&(f.alpha=r),f},me=e=>Y(jt(e)),Le=e=>e>Rt?Math.cbrt(e):(qt*e+16)/116,Ft=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=Le(e/Q.X),l=Le(t/Q.Y),a=Le(n/Q.Z),f={mode:"lab65",l:116*l-16,a:500*(o-l),b:200*(l-a)};return r!==void 0&&(f.alpha=r),f},$e=e=>{let t=Ft(D(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},ve=1,Xt=1,ne=26/180*Math.PI,ye=Math.cos(ne),ke=Math.sin(ne),Et=100/Math.log(139/100),Pe=({l:e,c:t,h:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o={mode:"lab65",l:(Math.exp(e*ve/Et)-1)/.0039},l=(Math.exp(.0435*t*Xt*ve)-1)/.075,a=l*Math.cos(n/180*Math.PI-ne),f=l*Math.sin(n/180*Math.PI-ne);return o.a=a*ye-f/.83*ke,o.b=a*ke+f/.83*ye,r!==void 0&&(o.alpha=r),o},Ae=({l:e,a:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=t*ye+n*ke,l=.83*(n*ye-t*ke),a=Math.sqrt(o*o+l*l),f={mode:"dlch",l:Et/ve*Math.log(1+.0039*e),c:Math.log(1+.075*a)/(.0435*Xt*ve)};return f.c&&(f.h=C((Math.atan2(l,o)+ne)/Math.PI*180)),r!==void 0&&(f.alpha=r),f},Lt=e=>Pe(P(e,"dlch")),Pt=e=>A(Ae(e),"dlab"),m0={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:Lt,rgb:e=>me(Lt(e))},fromMode:{lab65:Pt,rgb:e=>Pt($e(e))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:s,a:s,b:s,alpha:{use:s,fixup:w}}},$0={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:Pe,dlab:e=>A(e,"dlab"),rgb:e=>me(Pe(e))},fromMode:{lab65:Ae,dlab:e=>P(e,"dlch"),rgb:e=>Ae($e(e))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:s,c:s,h:{use:s,fixup:X},alpha:{use:s,fixup:w}},difference:{h:ge},average:{h:E}};function v0({h:e,s:t,i:n,alpha:r}){e=C(e!==void 0?e:0),t===void 0&&(t=0),n===void 0&&(n=0);let o=Math.abs(e/60%2-1),l;switch(Math.floor(e/60)){case 0:l={r:n*(1+t*(3/(2-o)-1)),g:n*(1+t*(3*(1-o)/(2-o)-1)),b:n*(1-t)};break;case 1:l={r:n*(1+t*(3*(1-o)/(2-o)-1)),g:n*(1+t*(3/(2-o)-1)),b:n*(1-t)};break;case 2:l={r:n*(1-t),g:n*(1+t*(3/(2-o)-1)),b:n*(1+t*(3*(1-o)/(2-o)-1))};break;case 3:l={r:n*(1-t),g:n*(1+t*(3*(1-o)/(2-o)-1)),b:n*(1+t*(3/(2-o)-1))};break;case 4:l={r:n*(1+t*(3*(1-o)/(2-o)-1)),g:n*(1-t),b:n*(1+t*(3/(2-o)-1))};break;case 5:l={r:n*(1+t*(3/(2-o)-1)),g:n*(1-t),b:n*(1+t*(3*(1-o)/(2-o)-1))};break;default:l={r:n*(1-t),g:n*(1-t),b:n*(1-t)}}return l.mode="rgb",r!==void 0&&(l.alpha=r),l}function y0({r:e,g:t,b:n,alpha:r}){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=Math.max(e,t,n),l=Math.min(e,t,n),a={mode:"hsi",s:e+t+n===0?0:1-3*l/(e+t+n),i:(e+t+n)/3};return o-l!==0&&(a.h=(o===e?(t-n)/(o-l)+(t<n)*6:o===t?(n-e)/(o-l)+2:(e-t)/(o-l)+4)*60),r!==void 0&&(a.alpha=r),a}const k0={mode:"hsi",toMode:{rgb:v0},parse:["--hsi"],serialize:"--hsi",fromMode:{rgb:y0},channels:["h","s","i","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:s,fixup:X},s,i:s,alpha:{use:s,fixup:w}},difference:{h:be},average:{h:E}};function x0({h:e,s:t,l:n,alpha:r}){e=C(e!==void 0?e:0),t===void 0&&(t=0),n===void 0&&(n=0);let o=n+t*(n<.5?n:1-n),l=o-(o-n)*2*Math.abs(e/60%2-1),a;switch(Math.floor(e/60)){case 0:a={r:o,g:l,b:2*n-o};break;case 1:a={r:l,g:o,b:2*n-o};break;case 2:a={r:2*n-o,g:o,b:l};break;case 3:a={r:2*n-o,g:l,b:o};break;case 4:a={r:l,g:2*n-o,b:o};break;case 5:a={r:o,g:2*n-o,b:l};break;default:a={r:2*n-o,g:2*n-o,b:2*n-o}}return a.mode="rgb",r!==void 0&&(a.alpha=r),a}function M0({r:e,g:t,b:n,alpha:r}){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=Math.max(e,t,n),l=Math.min(e,t,n),a={mode:"hsl",s:o===l?0:(o-l)/(1-Math.abs(o+l-1)),l:.5*(o+l)};return o-l!==0&&(a.h=(o===e?(t-n)/(o-l)+(t<n)*6:o===t?(n-e)/(o-l)+2:(e-t)/(o-l)+4)*60),r!==void 0&&(a.alpha=r),a}const _0=(e,t)=>{switch(t){case"deg":return+e;case"rad":return e/Math.PI*180;case"grad":return e/10*9;case"turn":return e*360}},w0=new RegExp(`^hsla?\\(\\s*${Zn}${U}${ee}${U}${ee}\\s*(?:,\\s*${Ie}\\s*)?\\)$`),H0=e=>{let t=e.match(w0);if(!t)return;let n={mode:"hsl"};return t[3]!==void 0?n.h=+t[3]:t[1]!==void 0&&t[2]!==void 0&&(n.h=_0(t[1],t[2])),t[4]!==void 0&&(n.s=Math.min(Math.max(0,t[4]/100),1)),t[5]!==void 0&&(n.l=Math.min(Math.max(0,t[5]/100),1)),t[6]!==void 0?n.alpha=Math.max(0,Math.min(1,t[6]/100)):t[7]!==void 0&&(n.alpha=Math.max(0,Math.min(1,+t[7]))),n};function T0(e,t){if(!t||t[0]!=="hsl"&&t[0]!=="hsla")return;const n={mode:"hsl"},[,r,o,l,a]=t;if(r.type!==i.None){if(r.type===i.Percentage)return;n.h=r.value}if(o.type!==i.None){if(o.type===i.Hue)return;n.s=o.value/100}if(l.type!==i.None){if(l.type===i.Hue)return;n.l=l.value/100}return a.type!==i.None&&(n.alpha=Math.min(1,Math.max(0,a.type===i.Number?a.value:a.value/100))),n}const At={mode:"hsl",toMode:{rgb:x0},fromMode:{rgb:M0},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[T0,H0],serialize:e=>`hsl(${e.h!==void 0?e.h:"none"} ${e.s!==void 0?e.s*100+"%":"none"} ${e.l!==void 0?e.l*100+"%":"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:s,fixup:X},s,l:s,alpha:{use:s,fixup:w}},difference:{h:be},average:{h:E}};function Dt({h:e,s:t,v:n,alpha:r}){e=C(e!==void 0?e:0),t===void 0&&(t=0),n===void 0&&(n=0);let o=Math.abs(e/60%2-1),l;switch(Math.floor(e/60)){case 0:l={r:n,g:n*(1-t*o),b:n*(1-t)};break;case 1:l={r:n*(1-t*o),g:n,b:n*(1-t)};break;case 2:l={r:n*(1-t),g:n,b:n*(1-t*o)};break;case 3:l={r:n*(1-t),g:n*(1-t*o),b:n};break;case 4:l={r:n*(1-t*o),g:n*(1-t),b:n};break;case 5:l={r:n,g:n*(1-t),b:n*(1-t*o)};break;default:l={r:n*(1-t),g:n*(1-t),b:n*(1-t)}}return l.mode="rgb",r!==void 0&&(l.alpha=r),l}function Yt({r:e,g:t,b:n,alpha:r}){e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=Math.max(e,t,n),l=Math.min(e,t,n),a={mode:"hsv",s:o===0?0:1-l/o,v:o};return o-l!==0&&(a.h=(o===e?(t-n)/(o-l)+(t<n)*6:o===t?(n-e)/(o-l)+2:(e-t)/(o-l)+4)*60),r!==void 0&&(a.alpha=r),a}const Zt={mode:"hsv",toMode:{rgb:Dt},parse:["--hsv"],serialize:"--hsv",fromMode:{rgb:Yt},channels:["h","s","v","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:s,fixup:X},s,v:s,alpha:{use:s,fixup:w}},difference:{h:be},average:{h:E}};function z0({h:e,w:t,b:n,alpha:r}){if(t===void 0&&(t=0),n===void 0&&(n=0),t+n>1){let o=t+n;t/=o,n/=o}return Dt({h:e,s:n===1?1:1-t/(1-n),v:1-n,alpha:r})}function C0(e){let t=Yt(e);if(t===void 0)return;let n=t.s!==void 0?t.s:0,r=t.v!==void 0?t.v:0,o={mode:"hwb",w:(1-n)*r,b:1-r};return t.h!==void 0&&(o.h=t.h),t.alpha!==void 0&&(o.alpha=t.alpha),o}function S0(e,t){if(!t||t[0]!=="hwb")return;const n={mode:"hwb"},[,r,o,l,a]=t;if(r.type!==i.None){if(r.type===i.Percentage)return;n.h=r.value}if(o.type!==i.None){if(o.type===i.Hue)return;n.w=o.value/100}if(l.type!==i.None){if(l.type===i.Hue)return;n.b=l.value/100}return a.type!==i.None&&(n.alpha=Math.min(1,Math.max(0,a.type===i.Number?a.value:a.value/100))),n}const O0={mode:"hwb",toMode:{rgb:z0},fromMode:{rgb:C0},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[S0],serialize:e=>`hwb(${e.h!==void 0?e.h:"none"} ${e.w!==void 0?e.w*100+"%":"none"} ${e.b!==void 0?e.b*100+"%":"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:s,fixup:X},w:s,b:s,alpha:{use:s,fixup:w}},difference:{h:b0},average:{h:E}},Bt=203,xe=.1593017578125,Jt=78.84375,Me=.8359375,_e=18.8515625,we=18.6875;function De(e){if(e<0)return 0;const t=Math.pow(e,1/Jt);return 1e4*Math.pow(Math.max(0,t-Me)/(_e-we*t),1/xe)}function Ye(e){if(e<0)return 0;const t=Math.pow(e/1e4,xe);return Math.pow((Me+_e*t)/(1+we*t),Jt)}const Ze=e=>Math.max(e/Bt,0),Ut=({i:e,t,p:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);const o=De(e+.008609037037932761*t+.11102962500302593*n),l=De(e-.00860903703793275*t-.11102962500302599*n),a=De(e+.5600313357106791*t-.32062717498731885*n),f={mode:"xyz65",x:Ze(2.070152218389422*o-1.3263473389671556*l+.2066510476294051*a),y:Ze(.3647385209748074*o+.680566024947227*l-.0453045459220346*a),z:Ze(-.049747207535812*o-.0492609666966138*l+1.1880659249923042*a)};return r!==void 0&&(f.alpha=r),f},Be=(e=0)=>Math.max(e*Bt,0),Kt=({x:e,y:t,z:n,alpha:r})=>{const o=Be(e),l=Be(t),a=Be(n),f=Ye(.3592832590121217*o+.6976051147779502*l-.0358915932320289*a),c=Ye(-.1920808463704995*o+1.1004767970374323*l+.0753748658519118*a),d=Ye(.0070797844607477*o+.0748396662186366*l+.8433265453898765*a),h=.5*f+.5*c,g=1.61376953125*f-3.323486328125*c+1.709716796875*d,m=4.378173828125*f-4.24560546875*c-.132568359375*d,$={mode:"itp",i:h,t:g,p:m};return r!==void 0&&($.alpha=r),$},I0={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:Ut,rgb:e=>Y(Ut(e))},fromMode:{xyz65:Kt,rgb:e=>Kt(D(e))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:s,t:s,p:s,alpha:{use:s,fixup:w}}},N0=134.03437499999998,q0=16295499532821565e-27,Je=e=>{if(e<0)return 0;let t=Math.pow(e/1e4,xe);return Math.pow((Me+_e*t)/(1+we*t),N0)},Ue=(e=0)=>Math.max(e*203,0),Wt=({x:e,y:t,z:n,alpha:r})=>{e=Ue(e),t=Ue(t),n=Ue(n);let o=1.15*e-.15*n,l=.66*t+.34*e,a=Je(.41478972*o+.579999*l+.014648*n),f=Je(-.20151*o+1.120649*l+.0531008*n),c=Je(-.0166008*o+.2648*l+.6684799*n),d=(a+f)/2,h={mode:"jab",j:.44*d/(1-.56*d)-q0,a:3.524*a-4.066708*f+.542708*c,b:.199076*a+1.096799*f-1.295875*c};return r!==void 0&&(h.alpha=r),h},R0=134.03437499999998,Gt=16295499532821565e-27,Ke=e=>{if(e<0)return 0;let t=Math.pow(e,1/R0);return 1e4*Math.pow((Me-t)/(we*t-_e),1/xe)},We=e=>e/203,Qt=({j:e,a:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=(e+Gt)/(.44+.56*(e+Gt)),l=Ke(o+.13860504*t+.058047316*n),a=Ke(o-.13860504*t-.058047316*n),f=Ke(o-.096019242*t-.8118919*n),c={mode:"xyz65",x:We(1.661373024652174*l-.914523081304348*a+.23136208173913045*f),y:We(-.3250758611844533*l+1.571847026732543*a-.21825383453227928*f),z:We(-.090982811*l-.31272829*a+1.5227666*f)};return r!==void 0&&(c.alpha=r),c},Vt=e=>{let t=Wt(D(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},en=e=>Y(Qt(e)),j0={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:Vt,xyz65:Wt},toMode:{rgb:en,xyz65:Qt},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:s,a:s,b:s,alpha:{use:s,fixup:w}}},tn=({j:e,a:t,b:n,alpha:r})=>{t===void 0&&(t=0),n===void 0&&(n=0);let o=Math.sqrt(t*t+n*n),l={mode:"jch",j:e,c:o};return o&&(l.h=C(Math.atan2(n,t)*180/Math.PI)),r!==void 0&&(l.alpha=r),l},nn=({j:e,c:t,h:n,alpha:r})=>{n===void 0&&(n=0);let o={mode:"jab",j:e,a:t?t*Math.cos(n/180*Math.PI):0,b:t?t*Math.sin(n/180*Math.PI):0};return r!==void 0&&(o.alpha=r),o},F0={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:nn,rgb:e=>en(nn(e))},fromMode:{rgb:e=>tn(Vt(e)),jab:tn},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:s,fixup:X},c:s,j:s,alpha:{use:s,fixup:w}},difference:{h:ge},average:{h:E}},He=Math.pow(29,3)/Math.pow(3,3),Ge=Math.pow(6,3)/Math.pow(29,3);let Qe=e=>Math.pow(e,3)>Ge?Math.pow(e,3):(116*e-16)/He;const Ve=({l:e,a:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=(e+16)/116,l=t/500+o,a=o-n/200,f={mode:"xyz50",x:Qe(l)*M.X,y:Qe(o)*M.Y,z:Qe(a)*M.Z};return r!==void 0&&(f.alpha=r),f},oe=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=G({r:e*3.1341359569958707-t*1.6173863321612538-.4906619460083532*n,g:e*-.978795502912089+t*1.916254567259524+.03344273116131949*n,b:e*.07195537988411677-t*.2289768264158322+1.405386058324125*n});return r!==void 0&&(o.alpha=r),o},on=e=>oe(Ve(e)),re=e=>{let{r:t,g:n,b:r,alpha:o}=W(e),l={mode:"xyz50",x:.436065742824811*t+.3851514688337912*n+.14307845442264197*r,y:.22249319175623702*t+.7168870538238823*n+.06061979053616537*r,z:.013923904500943465*t+.09708128566574634*n+.7140993584005155*r};return o!==void 0&&(l.alpha=o),l},et=e=>e>Ge?Math.cbrt(e):(He*e+16)/116,tt=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=et(e/M.X),l=et(t/M.Y),a=et(n/M.Z),f={mode:"lab",l:116*l-16,a:500*(o-l),b:200*(l-a)};return r!==void 0&&(f.alpha=r),f},rn=e=>{let t=tt(re(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t};function X0(e,t){if(!t||t[0]!=="lab")return;const n={mode:"lab"},[,r,o,l,a]=t;if(!(r.type===i.Hue||o.type===i.Hue||l.type===i.Hue))return r.type!==i.None&&(n.l=Math.min(Math.max(0,r.value),100)),o.type!==i.None&&(n.a=o.type===i.Number?o.value:o.value*125/100),l.type!==i.None&&(n.b=l.type===i.Number?l.value:l.value*125/100),a.type!==i.None&&(n.alpha=Math.min(1,Math.max(0,a.type===i.Number?a.value:a.value/100))),n}const nt={mode:"lab",toMode:{xyz50:Ve,rgb:on},fromMode:{xyz50:tt,rgb:rn},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-100,100],b:[-100,100]},parse:[X0],serialize:e=>`lab(${e.l!==void 0?e.l:"none"} ${e.a!==void 0?e.a:"none"} ${e.b!==void 0?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{l:s,a:s,b:s,alpha:{use:s,fixup:w}}},E0={...nt,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:jt,rgb:me},fromMode:{xyz65:Ft,rgb:$e},ranges:{l:[0,100],a:[-86.182,98.234],b:[-107.86,94.477]}};function L0(e,t){if(!t||t[0]!=="lch")return;const n={mode:"lch"},[,r,o,l,a]=t;if(r.type!==i.None){if(r.type===i.Hue)return;n.l=Math.min(Math.max(0,r.value),100)}if(o.type!==i.None&&(n.c=Math.max(0,o.type===i.Number?o.value:o.value*150/100)),l.type!==i.None){if(l.type===i.Percentage)return;n.h=l.value}return a.type!==i.None&&(n.alpha=Math.min(1,Math.max(0,a.type===i.Number?a.value:a.value/100))),n}const ot={mode:"lch",toMode:{lab:A,rgb:e=>on(A(e))},fromMode:{rgb:e=>P(rn(e)),lab:P},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[L0],serialize:e=>`lch(${e.l!==void 0?e.l:"none"} ${e.c!==void 0?e.c:"none"} ${e.h!==void 0?e.h:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:s,fixup:X},c:s,l:s,alpha:{use:s,fixup:w}},difference:{h:ge},average:{h:E}},P0={...ot,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:e=>A(e,"lab65"),rgb:e=>me(A(e,"lab65"))},fromMode:{rgb:e=>P($e(e),"lch65"),lab65:e=>P(e,"lch65")},ranges:{l:[0,100],c:[0,133.807],h:[0,360]}},ln=({l:e,u:t,v:n,alpha:r})=>{t===void 0&&(t=0),n===void 0&&(n=0);let o=Math.sqrt(t*t+n*n),l={mode:"lchuv",l:e,c:o};return o&&(l.h=C(Math.atan2(n,t)*180/Math.PI)),r!==void 0&&(l.alpha=r),l},an=({l:e,c:t,h:n,alpha:r})=>{n===void 0&&(n=0);let o={mode:"luv",l:e,u:t?t*Math.cos(n/180*Math.PI):0,v:t?t*Math.sin(n/180*Math.PI):0};return r!==void 0&&(o.alpha=r),o},fn=(e,t,n)=>4*e/(e+15*t+3*n),un=(e,t,n)=>9*t/(e+15*t+3*n),A0=fn(M.X,M.Y,M.Z),D0=un(M.X,M.Y,M.Z),Y0=e=>e<=Ge?He*e:116*Math.cbrt(e)-16,rt=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=Y0(t/M.Y),l=fn(e,t,n),a=un(e,t,n);!isFinite(l)||!isFinite(a)?o=l=a=0:(l=13*o*(l-A0),a=13*o*(a-D0));let f={mode:"luv",l:o,u:l,v:a};return r!==void 0&&(f.alpha=r),f},Z0=(e,t,n)=>4*e/(e+15*t+3*n),B0=(e,t,n)=>9*t/(e+15*t+3*n),J0=Z0(M.X,M.Y,M.Z),U0=B0(M.X,M.Y,M.Z),lt=({l:e,u:t,v:n,alpha:r})=>{if(e===void 0&&(e=0),e===0)return{mode:"xyz50",x:0,y:0,z:0};t===void 0&&(t=0),n===void 0&&(n=0);let o=t/(13*e)+J0,l=n/(13*e)+U0,a=M.Y*(e<=8?e/He:Math.pow((e+16)/116,3)),f=a*(9*o)/(4*l),c=a*(12-3*o-20*l)/(4*l),d={mode:"xyz50",x:f,y:a,z:c};return r!==void 0&&(d.alpha=r),d},K0={mode:"lchuv",toMode:{luv:an,rgb:e=>oe(lt(an(e)))},fromMode:{rgb:e=>ln(rt(re(e))),luv:ln},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:s,fixup:X},c:s,l:s,alpha:{use:s,fixup:w}},difference:{h:ge},average:{h:E}},W0={...K,mode:"lrgb",toMode:{rgb:G},fromMode:{rgb:W},parse:["srgb-linear"],serialize:"srgb-linear"},G0={mode:"luv",toMode:{xyz50:lt,rgb:e=>oe(lt(e))},fromMode:{xyz50:rt,rgb:e=>rt(re(e))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:s,u:s,v:s,alpha:{use:s,fixup:w}}},dn=({r:e,g:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=Math.cbrt(.41222147079999993*e+.5363325363*t+.0514459929*n),l=Math.cbrt(.2119034981999999*e+.6806995450999999*t+.1073969566*n),a=Math.cbrt(.08830246189999998*e+.2817188376*t+.6299787005000002*n),f={mode:"oklab",l:.2104542553*o+.793617785*l-.0040720468*a,a:1.9779984951*o-2.428592205*l+.4505937099*a,b:.0259040371*o+.7827717662*l-.808675766*a};return r!==void 0&&(f.alpha=r),f},Te=e=>{let t=dn(W(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},le=({l:e,a:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=Math.pow(e*.9999999984505198+.39633779217376786*t+.2158037580607588*n,3),l=Math.pow(e*1.0000000088817609-.10556134232365635*t-.06385417477170591*n,3),a=Math.pow(e*1.0000000546724108-.08948418209496575*t-1.2914855378640917*n,3),f={mode:"lrgb",r:4.076741661347994*o-3.307711590408193*l+.230969928729428*a,g:-1.2684380040921763*o+2.6097574006633715*l-.3413193963102197*a,b:-.004196086541837188*o-.7034186144594493*l+1.7076147009309444*a};return r!==void 0&&(f.alpha=r),f},ze=e=>G(le(e));function at(e){const r=1.170873786407767;return .5*(r*e-.206+Math.sqrt((r*e-.206)*(r*e-.206)+4*.03*r*e))}function Ce(e){return(e*e+.206*e)/(1.170873786407767*(e+.03))}function Q0(e,t){let n,r,o,l,a,f,c,d;-1.88170328*e-.80936493*t>1?(n=1.19086277,r=1.76576728,o=.59662641,l=.75515197,a=.56771245,f=4.0767416621,c=-3.3077115913,d=.2309699292):1.81444104*e-1.19445276*t>1?(n=.73956515,r=-.45954404,o=.08285427,l=.1254107,a=.14503204,f=-1.2684380046,c=2.6097574011,d=-.3413193965):(n=1.35733652,r=-.00915799,o=-1.1513021,l=-.50559606,a=.00692167,f=-.0041960863,c=-.7034186147,d=1.707614701);let h=n+r*e+o*t+l*e*e+a*e*t,g=.3963377774*e+.2158037573*t,m=-.1055613458*e-.0638541728*t,$=-.0894841775*e-1.291485548*t;{let y=1+h*g,x=1+h*m,k=1+h*$,_=y*y*y,p=x*x*x,u=k*k*k,z=3*g*y*y,N=3*m*x*x,S=3*$*k*k,ae=6*g*g*y,fe=6*m*m*x,ie=6*$*$*k,V=f*_+c*p+d*u,B=f*z+c*N+d*S,ue=f*ae+c*fe+d*ie;h=h-V*B/(B*B-.5*V*ue)}return h}function ft(e,t){let n=Q0(e,t),r=le({l:1,a:n*e,b:n*t}),o=Math.cbrt(1/Math.max(r.r,r.g,r.b)),l=o*n;return[o,l]}function V0(e,t,n,r,o,l=null){l||(l=ft(e,t));let a;if((n-o)*l[1]-(l[0]-o)*r<=0)a=l[1]*o/(r*l[0]+l[1]*(o-n));else{a=l[1]*(o-1)/(r*(l[0]-1)+l[1]*(o-n));{let f=n-o,c=r,d=.3963377774*e+.2158037573*t,h=-.1055613458*e-.0638541728*t,g=-.0894841775*e-1.291485548*t,m=f+c*d,$=f+c*h,y=f+c*g;{let x=o*(1-a)+a*n,k=a*r,_=x+k*d,p=x+k*h,u=x+k*g,z=_*_*_,N=p*p*p,S=u*u*u,ae=3*m*_*_,fe=3*$*p*p,ie=3*y*u*u,V=6*m*m*_,B=6*$*$*p,ue=6*y*y*u,Rn=4.0767416621*z-3.3077115913*N+.2309699292*S-1,vt=4.0767416621*ae-3.3077115913*fe+.2309699292*ie,Zo=4.0767416621*V-3.3077115913*B+.2309699292*ue,jn=vt/(vt*vt-.5*Rn*Zo),yt=-Rn*jn,Fn=-1.2684380046*z+2.6097574011*N-.3413193965*S-1,kt=-1.2684380046*ae+2.6097574011*fe-.3413193965*ie,Bo=-1.2684380046*V+2.6097574011*B-.3413193965*ue,Xn=kt/(kt*kt-.5*Fn*Bo),xt=-Fn*Xn,En=-.0041960863*z-.7034186147*N+1.707614701*S-1,Mt=-.0041960863*ae-.7034186147*fe+1.707614701*ie,Jo=-.0041960863*V-.7034186147*B+1.707614701*ue,Ln=Mt/(Mt*Mt-.5*En*Jo),_t=-En*Ln;yt=jn>=0?yt:1e6,xt=Xn>=0?xt:1e6,_t=Ln>=0?_t:1e6,a+=Math.min(yt,Math.min(xt,_t))}}}return a}function it(e,t,n=null){n||(n=ft(e,t));let r=n[0],o=n[1];return[o/r,o/(1-r)]}function sn(e,t,n){let r=ft(t,n),o=V0(t,n,e,1,e,r),l=it(t,n,r),a=.11516993+1/(7.4477897+4.1590124*n+t*(-2.19557347+1.75198401*n+t*(-2.13704948-10.02301043*n+t*(-4.24894561+5.38770819*n+4.69891013*t)))),f=.11239642+1/(1.6132032-.68124379*n+t*(.40370612+.90148123*n+t*(-.27087943+.6122399*n+t*(.00299215-.45399568*n-.14661872*t)))),c=o/Math.min(e*l[0],(1-e)*l[1]),d=e*a,h=(1-e)*f,g=.9*c*Math.sqrt(Math.sqrt(1/(1/(d*d*d*d)+1/(h*h*h*h))));return d=e*.4,h=(1-e)*.8,[Math.sqrt(1/(1/(d*d)+1/(h*h))),g,o]}function cn(e){const t=e.l!==void 0?e.l:0,n=e.a!==void 0?e.a:0,r=e.b!==void 0?e.b:0,o={mode:"okhsl",l:at(t)};e.alpha!==void 0&&(o.alpha=e.alpha);let l=Math.sqrt(n*n+r*r);if(!l)return o.s=0,o;let[a,f,c]=sn(t,n/l,r/l),d;if(l<f){let h=0,g=.8*a,m=1-g/f;d=(l-h)/(g+m*(l-h))*.8}else{let h=f,g=.2*f*f*1.25*1.25/a,m=1-g/(c-f);d=.8+.2*((l-h)/(g+m*(l-h)))}return d&&(o.s=d,o.h=C(Math.atan2(r,n)*180/Math.PI)),o}function hn(e){let t=e.h!==void 0?e.h:0,n=e.s!==void 0?e.s:0,r=e.l!==void 0?e.l:0;const o={mode:"oklab",l:Ce(r)};if(e.alpha!==void 0&&(o.alpha=e.alpha),!n||r===1)return o.a=o.b=0,o;let l=Math.cos(t/180*Math.PI),a=Math.sin(t/180*Math.PI),[f,c,d]=sn(o.l,l,a),h,g,m,$;n<.8?(h=1.25*n,g=0,m=.8*f,$=1-m/c):(h=5*(n-.8),g=c,m=.2*c*c*1.25*1.25/f,$=1-m/(d-c));let y=g+h*m/(1-$*h);return o.a=y*l,o.b=y*a,o}const eo={...At,mode:"okhsl",channels:["h","s","l","alpha"],parse:["--okhsl"],serialize:"--okhsl",fromMode:{oklab:cn,rgb:e=>cn(Te(e))},toMode:{oklab:hn,rgb:e=>ze(hn(e))}};function pn(e){let t=e.l!==void 0?e.l:0,n=e.a!==void 0?e.a:0,r=e.b!==void 0?e.b:0,o=Math.sqrt(n*n+r*r),l=o?n/o:1,a=o?r/o:1,[f,c]=it(l,a),d=.5,h=1-d/f,g=c/(o+t*c),m=g*t,$=g*o,y=Ce(m),x=$*y/m,k=le({l:y,a:l*x,b:a*x}),_=Math.cbrt(1/Math.max(k.r,k.g,k.b,0));t=t/_,o=o/_*at(t)/t,t=at(t);const p={mode:"okhsv",s:o?(d+c)*$/(c*d+c*h*$):0,v:t?t/m:0};return p.s&&(p.h=C(Math.atan2(r,n)*180/Math.PI)),e.alpha!==void 0&&(p.alpha=e.alpha),p}function bn(e){const t={mode:"oklab"};e.alpha!==void 0&&(t.alpha=e.alpha);const n=e.h!==void 0?e.h:0,r=e.s!==void 0?e.s:0,o=e.v!==void 0?e.v:0,l=Math.cos(n/180*Math.PI),a=Math.sin(n/180*Math.PI),[f,c]=it(l,a),d=.5,h=1-d/f,g=1-r*d/(d+c-c*h*r),m=r*c*d/(d+c-c*h*r),$=Ce(g),y=m*$/g,x=le({l:$,a:l*y,b:a*y}),k=Math.cbrt(1/Math.max(x.r,x.g,x.b,0)),_=Ce(o*g),p=m*_/g;return t.l=_*k,t.a=p*l*k,t.b=p*a*k,t}const to={...Zt,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:pn,rgb:e=>pn(Te(e))},toMode:{oklab:bn,rgb:e=>ze(bn(e))}};function no(e,t){if(!t||t[0]!=="oklab")return;const n={mode:"oklab"},[,r,o,l,a]=t;if(!(r.type===i.Hue||o.type===i.Hue||l.type===i.Hue))return r.type!==i.None&&(n.l=Math.min(Math.max(0,r.type===i.Number?r.value:r.value/100),1)),o.type!==i.None&&(n.a=o.type===i.Number?o.value:o.value*.4/100),l.type!==i.None&&(n.b=l.type===i.Number?l.value:l.value*.4/100),a.type!==i.None&&(n.alpha=Math.min(1,Math.max(0,a.type===i.Number?a.value:a.value/100))),n}const oo={...nt,mode:"oklab",toMode:{lrgb:le,rgb:ze},fromMode:{lrgb:dn,rgb:Te},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[no],serialize:e=>`oklab(${e.l!==void 0?e.l:"none"} ${e.a!==void 0?e.a:"none"} ${e.b!==void 0?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`};function ro(e,t){if(!t||t[0]!=="oklch")return;const n={mode:"oklch"},[,r,o,l,a]=t;if(r.type!==i.None){if(r.type===i.Hue)return;n.l=Math.min(Math.max(0,r.type===i.Number?r.value:r.value/100),1)}if(o.type!==i.None&&(n.c=Math.max(0,o.type===i.Number?o.value:o.value*.4/100)),l.type!==i.None){if(l.type===i.Percentage)return;n.h=l.value}return a.type!==i.None&&(n.alpha=Math.min(1,Math.max(0,a.type===i.Number?a.value:a.value/100))),n}const lo={...ot,mode:"oklch",toMode:{oklab:e=>A(e,"oklab"),rgb:e=>ze(A(e,"oklab"))},fromMode:{rgb:e=>P(Te(e),"oklch"),oklab:e=>P(e,"oklch")},parse:[ro],serialize:e=>`oklch(${e.l!==void 0?e.l:"none"} ${e.c!==void 0?e.c:"none"} ${e.h!==void 0?e.h:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}},gn=e=>{let{r:t,g:n,b:r,alpha:o}=W(e),l={mode:"xyz65",x:.486570948648216*t+.265667693169093*n+.1982172852343625*r,y:.2289745640697487*t+.6917385218365062*n+.079286914093745*r,z:0*t+.0451133818589026*n+1.043944368900976*r};return o!==void 0&&(l.alpha=o),l},mn=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o=G({r:e*2.4934969119414263-t*.9313836179191242-.402710784450717*n,g:e*-.8294889695615749+t*1.7626640603183465+.0236246858419436*n,b:e*.0358458302437845-t*.0761723892680418+.9568845240076871*n},"p3");return r!==void 0&&(o.alpha=r),o},ao={...K,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:e=>mn(D(e)),xyz65:mn},toMode:{rgb:e=>Y(gn(e)),xyz65:gn}},ut=e=>{let t=Math.abs(e);return t>=1/512?Math.sign(e)*Math.pow(t,1/1.8):16*e},$n=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o={mode:"prophoto",r:ut(e*1.3457868816471585-t*.2555720873797946-.0511018649755453*n),g:ut(e*-.5446307051249019+t*1.5082477428451466+.0205274474364214*n),b:ut(e*0+t*0+1.2119675456389452*n)};return r!==void 0&&(o.alpha=r),o},dt=(e=0)=>{let t=Math.abs(e);return t>=16/512?Math.sign(e)*Math.pow(t,1.8):e/16},vn=e=>{let t=dt(e.r),n=dt(e.g),r=dt(e.b),o={mode:"xyz50",x:.7977666449006423*t+.1351812974005331*n+.0313477341283922*r,y:.2880748288194013*t+.7118352342418731*n+899369387256e-16*r,z:0*t+0*n+.8251046025104602*r};return e.alpha!==void 0&&(o.alpha=e.alpha),o},fo={...K,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:$n,rgb:e=>$n(re(e))},toMode:{xyz50:vn,rgb:e=>oe(vn(e))}},yn=1.09929682680944,io=.018053968510807,st=e=>{const t=Math.abs(e);return t>io?(Math.sign(e)||1)*(yn*Math.pow(t,.45)-(yn-1)):4.5*e},kn=({x:e,y:t,z:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);let o={mode:"rec2020",r:st(e*1.7166511879712683-t*.3556707837763925-.2533662813736599*n),g:st(e*-.6666843518324893+t*1.6164812366349395+.0157685458139111*n),b:st(e*.0176398574453108-t*.0427706132578085+.9421031212354739*n)};return r!==void 0&&(o.alpha=r),o},xn=1.09929682680944,uo=.018053968510807,ct=(e=0)=>{let t=Math.abs(e);return t<uo*4.5?e/4.5:(Math.sign(e)||1)*Math.pow((t+xn-1)/xn,1/.45)},Mn=e=>{let t=ct(e.r),n=ct(e.g),r=ct(e.b),o={mode:"xyz65",x:.6369580483012911*t+.1446169035862083*n+.1688809751641721*r,y:.262700212011267*t+.6779980715188708*n+.059301716469862*r,z:0*t+.0280726930490874*n+1.0609850577107909*r};return e.alpha!==void 0&&(o.alpha=e.alpha),o},so={...K,mode:"rec2020",fromMode:{xyz65:kn,rgb:e=>kn(D(e))},toMode:{xyz65:Mn,rgb:e=>Y(Mn(e))},parse:["rec2020"],serialize:"rec2020"},Z=.0037930732552754493,_n=Math.cbrt(Z),ht=e=>Math.cbrt(e)-_n,co=e=>{const{r:t,g:n,b:r,alpha:o}=W(e),l=ht(.3*t+.622*n+.078*r+Z),a=ht(.23*t+.692*n+.078*r+Z),f=ht(.2434226892454782*t+.2047674442449682*n+.5518098665095535*r+Z),c={mode:"xyb",x:(l-a)/2,y:(l+a)/2,b:f-(l+a)/2};return o!==void 0&&(c.alpha=o),c},pt=e=>Math.pow(e+_n,3),ho={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:({x:e,y:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);const o=pt(e+t)-Z,l=pt(t-e)-Z,a=pt(n+t)-Z,f=G({r:11.031566904639861*o-9.866943908131562*l-.16462299650829934*a,g:-3.2541473810744237*o+4.418770377582723*l-.16462299650829934*a,b:-3.6588512867136815*o+2.7129230459360922*l+1.9459282407775895*a});return r!==void 0&&(f.alpha=r),f}},fromMode:{rgb:co},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:s,y:s,b:s,alpha:{use:s,fixup:w}}},po={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:oe,lab:tt},fromMode:{rgb:re,lab:Ve},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:s,y:s,z:s,alpha:{use:s,fixup:w}}},bo={mode:"xyz65",toMode:{rgb:Y,xyz50:e=>{let{x:t,y:n,z:r,alpha:o}=e;t===void 0&&(t=0),n===void 0&&(n=0),r===void 0&&(r=0);let l={mode:"xyz50",x:1.0479298208405488*t+.0229467933410191*n-.0501922295431356*r,y:.0296278156881593*t+.990434484573249*n-.0170738250293851*r,z:-.0092430581525912*t+.0150551448965779*n+.7518742899580008*r};return o!==void 0&&(l.alpha=o),l}},fromMode:{rgb:D,xyz50:e=>{let{x:t,y:n,z:r,alpha:o}=e;t===void 0&&(t=0),n===void 0&&(n=0),r===void 0&&(r=0);let l={mode:"xyz65",x:.9554734527042182*t-.0230985368742614*n+.0632593086610217*r,y:-.0283697069632081*t+1.0099954580058226*n+.021041398966943*r,z:.0123140016883199*t-.0205076964334779*n+1.3303659366080753*r};return o!==void 0&&(l.alpha=o),l}},ranges:{x:[0,.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:s,y:s,z:s,alpha:{use:s,fixup:w}}},go={mode:"yiq",toMode:{rgb:({y:e,i:t,q:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);const o={mode:"rgb",r:e+.95608445*t+.6208885*n,g:e-.27137664*t-.6486059*n,b:e-1.10561724*t+1.70250126*n};return r!==void 0&&(o.alpha=r),o}},fromMode:{rgb:({r:e,g:t,b:n,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=0);const o={mode:"yiq",y:.29889531*e+.58662247*t+.11448223*n,i:.59597799*e-.2741761*t-.32180189*n,q:.21147017*e-.52261711*t+.31114694*n};return r!==void 0&&(o.alpha=r),o}},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:s,i:s,q:s,alpha:{use:s,fixup:w}}},mo=e=>Math.max(0,Math.min(1,e||0)),bt=e=>Math.round(mo(e)*255),$o=de("rgb"),vo=e=>{if(e===void 0)return;let t=bt(e.r),n=bt(e.g),r=bt(e.b);return"#"+(1<<24|t<<16|n<<8|r).toString(16).slice(1)},yo=e=>vo($o(e));v(u0),v(g0),v(m0),v($0),v(k0),v(At),v(Zt),v(O0),v(I0),v(j0),v(F0),v(nt),v(E0),v(ot),v(P0),v(K0),v(W0),v(G0),v(eo),v(to),v(oo),v(lo),v(ao),v(fo),v(so),v(K),v(ho),v(po),v(bo),v(go);const gt=de("oklch"),wn=de("hsl"),ko=e=>{(typeof e===void 0||`${e}`.trim().length<1)&&console.warn(`oklchStringToLchArray: invalid param strOklch: "${e}"`);const t=gt(e);return[`${H((t==null?void 0:t.l)??0)}`,`${H((t==null?void 0:t.c)??0)}`,`${H((t==null?void 0:t.h)??0)}`,`${H((t==null?void 0:t.alpha)??1)}`]},xo=e=>{(typeof e===void 0||`${e}`.trim().length<1)&&console.warn(`oklchStringToHslArray: invalid param strOklch: "${e}"`);const t=wn(e);return[`${H((t==null?void 0:t.h)??0)}`,`${H(((t==null?void 0:t.s)??0)*100)}%`,`${H(((t==null?void 0:t.l)??0)*100)}%`,`${H((t==null?void 0:t.alpha)??1)}`]},Mo=(e,t)=>{if((typeof e===void 0||`${e}`.trim().length<1)&&console.warn(`convertHexValue: invalid param hexValue: "${e}"`),t){const n=gt(e);return[`${H(n.l??0)}`,`${H(n.c??0)}`,`${H(n.h??0)}`,`${H(n.alpha??1)}`]}else{const n=wn(e);return[`${H((n==null?void 0:n.h)??0)}`,`${H(((n==null?void 0:n.s)??0)*100)}%`,`${H(((n==null?void 0:n.l)??0)*100)}%`,`${H((n==null?void 0:n.alpha)??1)}`]}},H=e=>Number(e.toFixed(2)),_o=e=>{const t=gt(e);return`oklch(${H(t.l??0)} ${H(t.c??0)} ${H(t.h??0)} / 1)`},wo=e=>(e||"").trim().length<7?"":`${yo(zt(e))}`,Se=()=>({convertHexValue:Mo,oklchStringFromHex:_o,oklchStringToLchArray:ko,oklchStringToHslArray:xo,hexStringFromOklchString:wo}),Ho=(e,t,n,r)=>{const o=(r||"").trim().length>0;if(t){let l=`--${e}-${n}-okl`,a=`--${e}-${n}-okc`,f=`--${e}-${n}-okh`;const c=`var(${l}) var(${a}) var(${f})`;return o?`oklch(${c} / var(${r}))`:`oklch(${c})`}else{let l=`--${e}-${n}-h`,a=`--${e}-${n}-s`,f=`--${e}-${n}-l`;const c=`var(${l}) var(${a}) var(${f})`;return o?`hsl(${c} / var(${r})%)`:`hsl(${c})`}},Hn=[{key:"--bwj-text-opacity",value:"1"},{key:"--bwj-content-opacity",value:"1"},{key:"--bwj-backdrop-opacity",value:"1"},{key:"--bwj-fill-opacity",value:"1"},{key:"--bwj-shadow",value:"var(--tw-shadow, 0 0 #0000)"},{key:"--bwj-ring-inset",value:""},{key:"--bwj-ring-offset-width",value:"var(--tw-ring-offset-width, 0px)"},{key:"--bwj-ring-offset-color",value:"var(--tw-ring-offset-color, #ffffff)"}],To=()=>[...new Set([...Object.values(document.documentElement.style)])].map(n=>n.replace(/^[\-\-]+[^\-]+\-{1}/,"")).map(n=>{let r=n.split("-");return r.pop(),r.join("-")}).filter(n=>n.length>0&&n.indexOf("-content")===-1).map(n=>n.split("-")).reduce((n,[r,o])=>{let l=n.find(a=>a.id===r);return l||(l={id:r,hasHover:!1,hasFocus:!1},n.push(l)),o==="hover"&&(l.hasHover=!0),o==="focus"&&(l.hasFocus=!0),n},[]),zo=()=>{const t=[...new Set([...Object.values(document.documentElement.style)])].filter(n=>(n||"").trim().length>0).map(n=>({key:n,value:document.documentElement.style.getPropertyValue(n)}));return[...Hn,...t]},mt=()=>({defaultCssVarsKeyValues:Hn,buildCssAttributeColorExpression:Ho,getDocumentCssVarsInfos:To,getDocumentCssVarsKeyValues:zo}),{defaultCssVarsKeyValues:Co}=mt(),O=()=>{let e=""+new Date().getTime();e.length<13&&(e=e.padEnd(13,"0"));let t=`${Math.round(Math.random()*1e6)}`.trim();return t.length<10&&(t=t.padStart(10,"0")),`${e}${t}`},Tn=[{uniqueId:O(),id:"primary",hasHover:!0,hasFocus:!0,_hex:"#00bfff",_hoverHex:"#3dc7f5",_focusHex:"#80dfff",_contentHex:"#ffffff",selected:!0,flash:!1,oklch:"oklch(0.76 0.15 231.64 / 1)",contentOklch:"oklch(1 0 0 / 1)",hoverOklch:"oklch(0.78 0.13 225.15 / 1)",focusOklch:"oklch(0.86 0.1 221.95 / 1)"},{uniqueId:O(),id:"secondary",hasHover:!0,hasFocus:!0,_hex:"#f0fbff",_hoverHex:"#e0f7ff",_focusHex:"#d6f4ff",_contentHex:"#0095c7",selected:!0,flash:!1,oklch:"oklch(0.98 0.01 221.42 / 1)",contentOklch:"oklch(0.63 0.13 231.17 / 1)",hoverOklch:"oklch(0.96 0.03 220.63 / 1)",focusOklch:"oklch(0.95 0.03 221.88 / 1)"},{uniqueId:O(),id:"accent",hasHover:!0,hasFocus:!0,_hex:"#fdf59b",_hoverHex:"#fcf178",_focusHex:"#fbeb37",_contentHex:"#000000",selected:!0,flash:!1,oklch:"oklch(0.96 0.11 103.9 / 1)",contentOklch:"oklch(0 0 0 / 1)",hoverOklch:"oklch(0.94 0.14 104.07 / 1)",focusOklch:"oklch(0.92 0.18 104.02 / 1)"},{uniqueId:O(),id:"neutral",hasHover:!0,hasFocus:!0,_hex:"#f5f5f5",_hoverHex:"#fdfff5",_focusHex:"#ffffff",_contentHex:"#000000",selected:!0,flash:!1,oklch:"oklch(0.97 0 0 / 1)",contentOklch:"oklch(0 0 0 / 1)",hoverOklch:"oklch(1 0.01 115.82 / 1)",focusOklch:"oklch(1 0 0 / 1)"},{uniqueId:O(),id:"disabled",hasHover:!1,hasFocus:!1,_hex:"#f2f2f2",_contentHex:"#8c8c8c",selected:!0,flash:!1,oklch:"oklch(0.96 0 0 / 1)",contentOklch:"oklch(0.64 0 0 / 1)"},{uniqueId:O(),id:"info",hasHover:!0,hasFocus:!0,_hex:"#70b5ff",_hoverHex:"#5cabff",_focusHex:"#c2dfff",_contentHex:"#ffffff",selected:!0,flash:!1,oklch:"oklch(0.76 0.13 251.4 / 1)",contentOklch:"oklch(1 0 0 / 1)",hoverOklch:"oklch(0.73 0.15 251.72 / 1)",focusOklch:"oklch(0.89 0.05 250.99 / 1)"},{uniqueId:O(),id:"success",hasHover:!0,hasFocus:!0,_hex:"#8cf28c",_hoverHex:"#a8f0a8",_focusHex:"#19e619",_contentHex:"#000000",selected:!0,flash:!1,oklch:"oklch(0.87 0.17 143.98 / 1)",contentOklch:"oklch(0 0 0 / 1)",hoverOklch:"oklch(0.89 0.12 144.47 / 1)",focusOklch:"oklch(0.8 0.27 142.58 / 1)"},{uniqueId:O(),id:"warning",hasHover:!0,hasFocus:!0,_hex:"#ffc266",_hoverHex:"#f5a83d",_focusHex:"#fdb953",_contentHex:"#000000",selected:!0,flash:!1,oklch:"oklch(0.85 0.13 75.72 / 1)",contentOklch:"oklch(0 0 0 / 1)",hoverOklch:"oklch(0.79 0.15 70.87 / 1)",focusOklch:"oklch(0.83 0.14 74.52 / 1)"},{uniqueId:O(),id:"danger",hasHover:!0,hasFocus:!0,_hex:"#ff6666",_hoverHex:"#f50000",_focusHex:"#f07575",_contentHex:"#ffffff",selected:!0,flash:!1,oklch:"oklch(0.7 0.19 23.19 / 1)",contentOklch:"oklch(1 0 0 / 1)",hoverOklch:"oklch(0.61 0.25 29.23 / 1)",focusOklch:"oklch(0.71 0.15 21.7 / 1)"},{uniqueId:O(),id:"formfield",hasHover:!0,hasFocus:!0,_hex:"eeeeee",_hoverHex:"#efefef",_focusHex:"#efefef",_contentHex:"#111111",selected:!0,flash:!1,oklch:"oklch(0.9491 0 0 / 1)",contentOklch:"oklch(0.1776 0 0 / 1)",hoverOklch:"oklch(0.9521 0 0 / 1)",focusOklch:"oklch(0.9521 0 0 / 1)"},{uniqueId:O(),id:"body",hasHover:!1,hasFocus:!1,_hex:"#363636",_contentHex:"#efefef",selected:!0,flash:!1,oklch:"oklch(0.33 0 0 / 1)",contentOklch:"oklch(0.95 0 0 / 1)"},{uniqueId:O(),id:"card",hasHover:!1,hasFocus:!1,_hex:"#dedede",_contentHex:"#333333",selected:!0,flash:!1,oklch:"oklch(0.9 0 0 / 1)",contentOklch:"oklch(0.32 0 0 / 1)"},{uniqueId:O(),id:"code",hasHover:!1,hasFocus:!1,_hex:"#3a3753",_contentHex:"#c2dcff",selected:!0,flash:!1,oklch:"oklch(0.35 0.05 288.57 / 1)",contentOklch:"oklch(0.89 0.06 255.89 / 1)"}],So=(e,t)=>{const n=(t==null?void 0:t.hasHover)||!1,r=(t==null?void 0:t.hasFocus)||!1;return{uniqueId:O(),id:e,hasHover:n,hasFocus:r,_hex:"#ff3fd0",_hoverHex:"#ff3fd0",_focusHex:"#ff3fd0",_contentHex:"#ffffff",oklch:"oklch(0.7 0.27 340 / 1)",hoverOklch:"oklch(0.7 0.32 340 / 1)",focusOklch:"oklch(0.7 0.32 340 / 1)",contentOklch:"oklch(1 0 0 / 1)",selected:!0,flash:!1}},Oo=()=>{const e=d=>(d==null?void 0:d.value)||"0",t=d=>{if(d.length<3)return"";const h=`${e(d.find($=>$.key.endsWith("-okl")))}`,g=`${e(d.find($=>$.key.endsWith("-okc")))}`,m=`${e(d.find($=>$.key.endsWith("-okh")))}`;return d.length>0?`oklch(${h} ${g} ${m})`:""},n=d=>{const{hexStringFromOklchString:h}=Se(),g=l.filter(S=>S.key.startsWith(d)),m=g.filter(S=>S.key.split("-").length===2),$=g.filter(S=>S.key.indexOf("-hover")>-1),y=g.filter(S=>S.key.indexOf("-focus")>-1),x=g.filter(S=>S.key.indexOf("-content")>-1),k=$.length>0,_=y.length>0,p=t(m),u=t(x);let z="",N="";return k&&(z=t($)),_&&(N=t(y)),{uniqueId:O(),id:d,hasHover:k,hasFocus:_,_hex:h(p),_hoverHex:k?h(z):"",_focusHex:_?h(N):"",_contentHex:h(u),oklch:p,hoverOklch:z,focusOklch:N,contentOklch:u,selected:!0,flash:!1}},o=[...document.styleSheets].flatMap(d=>Object.values(d.rules)).filter(d=>d.selectorText==":root");if(o.length<1)return Tn;const l=`${o[0].cssText}`.replace(":root","").replace("{","").replace("}","").trim().split(";").map(d=>{let h=`${d}`.split(":");return{key:`${h[0]}`.replace("--bwj-","").trim(),value:h.length>1?h[1].trim():"0"}}),a=new Set([...Co.map(d=>`${d.key}`.trim().replace("--bwj-","").split("-")[0].trim()),"opacity"]),c=[...new Set(l.map(d=>d.key.split("-")[0].trim()))].filter(d=>d.length>0).filter(d=>!a.has(d));return c.length>0?c.map(n):Tn},Io=(e,t,n)=>{const{oklchStringFromHex:r}=Se(),o=r(t);return n?n==="content"?(e.contentOklch=o,e._contentHex=t):n==="hover"?(e.hoverOklch=o,e._hoverHex=t):n==="focus"&&(e.focusOklch=o,e._focusHex=t):(e.oklch=o,e._hex=t),e},No=(e,t,n)=>(n=(n||"").trim().toLowerCase(),/[^a-z]+/.test(n)?'Name can only contain characters from "a" to "z".':n.length<3||n.length>20?"Name must be between 3 and 20 characters.":e.some(r=>r.uniqueId!==t&&r.id.toLowerCase()===n)?"Name is already in use.":""),zn=()=>({getInitialCategoryOptions:Oo,updateCategoryFieldsFromHex:Io,initCategoryOption:So,validateCategoryName:No}),qo=`
::-webkit-scrollbar-corner {

@@ -26,3 +26,3 @@ background: 0 0;

}
`,Tn=(e,t,n,r)=>{if(t){let o=`--${e}-${n}-okl`,l=`--${e}-${n}-okc`,a=`--${e}-${n}-okh`;return`oklch(${`var(${o}) var(${l}) var(${a})`} / ${r})`}else{let o=`--${e}-${n}-h`,l=`--${e}-${n}-s`,a=`--${e}-${n}-l`;return`hsl(${`var(${o}) var(${l}) var(${a})`} / ${r})`}},Oo=(e,t=!0)=>{const n=Tn(e,t,"primary",.2),r=Tn(e,t,"primary",.85);return So.replace("[track-background]",n).replace("[thumb-background]",r)},q="--bwj-text-opacity",R="--bwj-content-opacity",j="--bwj-backdrop-opacity",Cn="--bwj-fill-opacity",No=(e,t,n,r)=>{const o=n,l=[];let a=[];const f=[];let c=[],d=[];const h=[0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100];a=[...h.map(p=>({key:`.opacity-${p}`,value:`${q}: ${(+`${p/100}`).toFixed(2)};`})),...h.map(p=>({key:`.content-opacity-${p}`,value:`${R}: ${(+`${p/100}`).toFixed(2)};`})),...h.map(p=>({key:`.bg-opacity-${p}`,value:`${j}: ${(+`${p/100}`).toFixed(2)};`}))],c=[...h.map(p=>({key:`.hover\\:opacity-${p}:hover`,value:`${q}: ${(+`${p/100}`).toFixed(2)};`})),...h.map(p=>({key:`.hover\\:content-opacity-${p}:hover`,value:`${R}: ${(+`${p/100}`).toFixed(2)};`})),...h.map(p=>({key:`.hover\\:bg-opacity-${p}:hover`,value:`${j}: ${(+`${p/100}`).toFixed(2)};`}))],d=[...h.map(p=>({key:`.group:hover .group-hover\\:opacity-${p}`,value:`${q}: ${(+`${p/100}`).toFixed(2)};`})),...h.map(p=>({key:`.group:hover .group-hover\\:content-opacity-${p}`,value:`${R}: ${(+`${p/100}`).toFixed(2)};`})),...h.map(p=>({key:`.group:hover .group-hover\\:bg-opacity-${p}`,value:`${j}: ${(+`${p/100}`).toFixed(2)};`}))],t.forEach(p=>{const u=p.id;l.push({key:`.bg-${u}`,value:`background-color: ${o(u,j)};`},{key:`.content-${u}`,value:`color: ${o(`${u}-content`,R)};`},{key:`.text-${u}`,value:`color: ${o(u,q)};`},{key:`.border-${u}`,value:`border-color: ${o(u)};`},{key:`.fill-${u}`,value:`fill: ${o(u,Cn)};`},{key:`.ring-${u}`,value:`--${e}-ring-color: ${o(`${u}`)};`},{key:`.ring-offset-${u}`,value:`--${e}-ring-offset-color: ${o(`${u}`)};`},{key:`.bg-${u}-invert`,value:`background-color: ${o(`${u}-content`,j)};`},{key:`.content-${u}-invert`,value:`color: ${o(u,R)};`},{key:`.text-${u}-invert`,value:`color: ${o(u,q)};`},{key:`.fill-${u}-invert`,value:`fill: ${o(`${u}-content`,Cn)};`});const T="::file-selector-button";l.push({key:`.file\\:bg-${u}${T}`,value:`background-color: ${o(u,j)};`},{key:`.file\\:content-${u}${T}`,value:`color: ${o(`${u}-content`,R)};`},{key:`.file\\:text-${u}${T}`,value:`color: ${o(u,q)};`},{key:`.file\\:border-${u}${T}`,value:`border-color: ${o(u)};`},{key:`.file\\:bg-${u}-invert${T}`,value:`background-color: ${o(`${u}-content`,j)};`},{key:`.file\\:content-${u}-invert${T}`,value:`color: ${o(u,R)};`},{key:`.file\\:text-${u}-invert`,value:`color: ${o(u,q)};`}),l.push({key:`.placeholder\\:content-${u}::placeholder`,value:`color: ${o(`${u}-content`)};`},{key:`.placeholder\\:text-${u}::placeholder`,value:`color: ${o(u)};`}),p.hasFocus&&f.push({key:`.focus\\:bg-${u}:focus`,value:`background-color: ${o(`${u}-focus`,j)};`},{key:`.focus\\:text-${u}:focus`,value:`color: ${o(`${u}-focus`,q)};`},{key:`.focus\\:content-${u}:focus`,value:`color: ${o(`${u}-focus`,R)};`},{key:`.focus\\:border-${u}:focus`,value:`border-color: ${o(`${u}-focus`)};`},{key:`.focus\\:ring-${u}:focus`,value:`--${e}-ring-color: ${o(`${u}-focus`)};`},{key:`.focus\\:ring-offset-${u}:focus`,value:`--${e}-ring-offset-color: ${o(`${u}-focus`)};`}),p.hasHover&&(c.push({key:`.hover\\:bg-${u}:hover`,value:`background-color: ${o(`${u}-hover`,j)};`},{key:`.hover\\:text-${u}:hover`,value:`color: ${o(`${u}-hover`,q)};`},{key:`.hover\\:content-${u}:hover`,value:`color: ${o(`${u}-content`,R)};`},{key:`.hover\\:border-${u}:hover`,value:`border-color: ${o(`${u}-hover`)};`},{key:`.hover\\:ring-${u}:hover`,value:`--${e}-ring-color: ${o(`${u}-hover`)};`},{key:`.hover\\:ring-offset-${u}:hover`,value:`--${e}-ring-offset-color: ${o(`${u}-hover`)};`}),d.push({key:`.group:hover .group-hover\\:bg-${u}`,value:`background-color: ${o(`${u}-hover`,j)};`},{key:`.group:hover .group-hover\\:text-${u}`,value:`color: ${o(`${u}-hover`,q)};`},{key:`.group:hover .group-hover\\:content-${u}`,value:`color: ${o(`${u}-content`,R)};`},{key:`.group:hover .group-hover\\:border-${u}`,value:`border-color: ${o(`${u}-hover`)};`},{key:`.group:hover .group-hover\\:ring-${u}`,value:`--${e}-ring-color: ${o(`${u}-hover`)};`},{key:`.group:hover .group-hover\\:ring-offset-${u}`,value:`--${e}-ring-offset-color: ${o(`${u}-hover`)};`}))});const g=[{key:`
`,Cn=(e,t,n,r)=>{if(t){let o=`--${e}-${n}-okl`,l=`--${e}-${n}-okc`,a=`--${e}-${n}-okh`;return`oklch(${`var(${o}) var(${l}) var(${a})`} / ${r})`}else{let o=`--${e}-${n}-h`,l=`--${e}-${n}-s`,a=`--${e}-${n}-l`;return`hsl(${`var(${o}) var(${l}) var(${a})`} / ${r})`}},Sn=(e,t=!0)=>{const n=Cn(e,t,"primary",.2),r=Cn(e,t,"primary",.85);return qo.replace("[track-background]",n).replace("[thumb-background]",r)},R="--bwj-text-opacity",j="--bwj-content-opacity",F="--bwj-backdrop-opacity",On="--bwj-fill-opacity",Ro=(e,t,n,r)=>{const o=n,l=[];let a=[];const f=[];let c=[],d=[];const h=[0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100];a=[...h.map(p=>({key:`.opacity-${p}`,value:`${R}: ${(+`${p/100}`).toFixed(2)};`})),...h.map(p=>({key:`.content-opacity-${p}`,value:`${j}: ${(+`${p/100}`).toFixed(2)};`})),...h.map(p=>({key:`.bg-opacity-${p}`,value:`${F}: ${(+`${p/100}`).toFixed(2)};`}))],c=[...h.map(p=>({key:`.hover\\:opacity-${p}:hover`,value:`${R}: ${(+`${p/100}`).toFixed(2)};`})),...h.map(p=>({key:`.hover\\:content-opacity-${p}:hover`,value:`${j}: ${(+`${p/100}`).toFixed(2)};`})),...h.map(p=>({key:`.hover\\:bg-opacity-${p}:hover`,value:`${F}: ${(+`${p/100}`).toFixed(2)};`}))],d=[...h.map(p=>({key:`.group:hover .group-hover\\:opacity-${p}`,value:`${R}: ${(+`${p/100}`).toFixed(2)};`})),...h.map(p=>({key:`.group:hover .group-hover\\:content-opacity-${p}`,value:`${j}: ${(+`${p/100}`).toFixed(2)};`})),...h.map(p=>({key:`.group:hover .group-hover\\:bg-opacity-${p}`,value:`${F}: ${(+`${p/100}`).toFixed(2)};`}))],t.forEach(p=>{const u=p.id;l.push({key:`.bg-${u}`,value:`background-color: ${o(u,F)};`},{key:`.content-${u}`,value:`color: ${o(`${u}-content`,j)};`},{key:`.text-${u}`,value:`color: ${o(u,R)};`},{key:`.border-${u}`,value:`border-color: ${o(u)};`},{key:`.fill-${u}`,value:`fill: ${o(u,On)};`},{key:`.ring-${u}`,value:`--${e}-ring-color: ${o(`${u}`)};`},{key:`.ring-offset-${u}`,value:`--${e}-ring-offset-color: ${o(`${u}`)};`},{key:`.bg-${u}-invert`,value:`background-color: ${o(`${u}-content`,F)};`},{key:`.content-${u}-invert`,value:`color: ${o(u,j)};`},{key:`.text-${u}-invert`,value:`color: ${o(u,R)};`},{key:`.fill-${u}-invert`,value:`fill: ${o(`${u}-content`,On)};`});const z="::file-selector-button";l.push({key:`.file\\:bg-${u}${z}`,value:`background-color: ${o(u,F)};`},{key:`.file\\:content-${u}${z}`,value:`color: ${o(`${u}-content`,j)};`},{key:`.file\\:text-${u}${z}`,value:`color: ${o(u,R)};`},{key:`.file\\:border-${u}${z}`,value:`border-color: ${o(u)};`},{key:`.file\\:bg-${u}-invert${z}`,value:`background-color: ${o(`${u}-content`,F)};`},{key:`.file\\:content-${u}-invert${z}`,value:`color: ${o(u,j)};`},{key:`.file\\:text-${u}-invert`,value:`color: ${o(u,R)};`}),l.push({key:`.placeholder\\:content-${u}::placeholder`,value:`color: ${o(`${u}-content`)};`},{key:`.placeholder\\:text-${u}::placeholder`,value:`color: ${o(u)};`}),p.hasFocus&&f.push({key:`.focus\\:bg-${u}:focus`,value:`background-color: ${o(`${u}-focus`,F)};`},{key:`.focus\\:text-${u}:focus`,value:`color: ${o(`${u}-focus`,R)};`},{key:`.focus\\:content-${u}:focus`,value:`color: ${o(`${u}-focus`,j)};`},{key:`.focus\\:border-${u}:focus`,value:`border-color: ${o(`${u}-focus`)};`},{key:`.focus\\:ring-${u}:focus`,value:`--${e}-ring-color: ${o(`${u}-focus`)};`},{key:`.focus\\:ring-offset-${u}:focus`,value:`--${e}-ring-offset-color: ${o(`${u}-focus`)};`}),p.hasHover&&(c.push({key:`.hover\\:bg-${u}:hover`,value:`background-color: ${o(`${u}-hover`,F)};`},{key:`.hover\\:text-${u}:hover`,value:`color: ${o(`${u}-hover`,R)};`},{key:`.hover\\:content-${u}:hover`,value:`color: ${o(`${u}-content`,j)};`},{key:`.hover\\:border-${u}:hover`,value:`border-color: ${o(`${u}-hover`)};`},{key:`.hover\\:ring-${u}:hover`,value:`--${e}-ring-color: ${o(`${u}-hover`)};`},{key:`.hover\\:ring-offset-${u}:hover`,value:`--${e}-ring-offset-color: ${o(`${u}-hover`)};`}),d.push({key:`.group:hover .group-hover\\:bg-${u}`,value:`background-color: ${o(`${u}-hover`,F)};`},{key:`.group:hover .group-hover\\:text-${u}`,value:`color: ${o(`${u}-hover`,R)};`},{key:`.group:hover .group-hover\\:content-${u}`,value:`color: ${o(`${u}-content`,j)};`},{key:`.group:hover .group-hover\\:border-${u}`,value:`border-color: ${o(`${u}-hover`)};`},{key:`.group:hover .group-hover\\:ring-${u}`,value:`--${e}-ring-color: ${o(`${u}-hover`)};`},{key:`.group:hover .group-hover\\:ring-offset-${u}`,value:`--${e}-ring-offset-color: ${o(`${u}-hover`)};`}))});const g=[{key:`
.ring-2,

@@ -42,6 +42,6 @@ .hover\\:ring-2:hover,

box-shadow: 0 0 0 var(--${e}-ring-offset-width) var(--${e}-ring-offset-color), var(--${e}-ring-shadow);
`.trim()}],m=(p,u=2)=>{if(!r)return`${p.key} {${p.value}}`;let T=`${Array(u+1).join(" ")}`,N=`${Array(u-2+1).join(" ")}`,S=`${p.key} {${p.value}}`.replace(/\s+/gi," ").replace(/\;\s+/gi,";").replace(/\{+/gi,`{
`.trim()}],m=(p,u=2)=>{if(!r)return`${p.key} {${p.value}}`;let z=`${Array(u+1).join(" ")}`,N=`${Array(u-2+1).join(" ")}`,S=`${p.key} {${p.value}}`.replace(/\s+/gi," ").replace(/\;\s+/gi,";").replace(/\{+/gi,`{
`).replace(/\;+/gi,`;
`).replace(/\n+/gi,`
${T}`).replace(/\s+}/gi,`
${z}`).replace(/\s+}/gi,`
${N}}`);return`${N}${S}`},$=c.map(p=>m(p,4)).join(`

@@ -56,3 +56,3 @@ `),y=d.map(p=>m(p,4)).join(`

`:" ";return`${k.map(p=>m(p)).join(_)}
${x}`},Io=(e,t,n,r)=>{const{buildCssAttributeColorExpression:o}=Hn(),l=(c,d)=>o(e,t,c,d),a=Oo(e,t),f=No(e,n,l,r);return`${a}
${f}`.trim()},qo=()=>({computeStyleSheetContent:Io}),mt="bwj-themesystem",Ro=e=>{let t=document.getElementById(mt);t?t.innerHTML=e:(t=document.createElement("style"),t.id=mt,t.type="text/css",t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t))},jo=()=>{let e=document.getElementById(mt);return e||console.warn("not found"),(e==null?void 0:e.innerText)||""},Fo=()=>({updateHeadStyle:Ro,getHeadStyle:jo}),Xo=(e,t,n,r,o)=>{const{oklchStringToLchArray:l,oklchStringToHslArray:a}=gt();let f=[];t?f=l(r):f=a(r);const c=t?"okl":"h",d=t?"okc":"s",h=t?"okh":"l",g=document.documentElement.style;o?(g.setProperty(`--${e}-${n}-${o}-${c}`,`${f[0]}`),g.setProperty(`--${e}-${n}-${o}-${d}`,`${f[1]}`),g.setProperty(`--${e}-${n}-${o}-${h}`,`${f[2]}`)):(g.setProperty(`--${e}-${n}-${c}`,`${f[0]}`),g.setProperty(`--${e}-${n}-${d}`,`${f[1]}`),g.setProperty(`--${e}-${n}-${h}`,`${f[2]}`))},Eo=()=>({updateDocumentStyleProp:Xo}),{getInitialCategoryOptions:Lo}=Co(),{computeStyleSheetContent:Ao}=qo(),{updateHeadStyle:Po}=Fo(),{updateDocumentStyleProp:Se}=Eo(),Do=async(e,t,n)=>{e=e||"bwj",n=n||!0,t||(t=Lo());const r=t.filter(a=>a.selected);Object.values(document.documentElement.style).forEach(a=>{document.documentElement.style.removeProperty(a)});const l=Ao(e,n,r);Po(l),r.forEach(a=>{Se(e,n,a.id,a.oklch),Se(e,n,a.id,a.contentOklch,"content"),a.hasHover&&Se(e,n,a.id,`${a.hoverOklch}`,"hover"),a.hasFocus&&Se(e,n,a.id,`${a.focusOklch}`,"focus")})};B.computeDocumentStyles=Do,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"})});
${x}`},jo=(e,t,n,r)=>{const{buildCssAttributeColorExpression:o}=mt(),l=(c,d)=>o(e,t,c,d),a=Sn(e,t),f=Ro(e,n,l,r);return`${a}
${f}`.trim()},In=()=>({computeStyleSheetContent:jo}),$t="bwj-themesystem",Fo=e=>{let t=document.getElementById($t);t?t.innerHTML=e:(t=document.createElement("style"),t.id=$t,t.type="text/css",t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t))},Xo=()=>{let e=document.getElementById($t);return e||console.warn("not found"),(e==null?void 0:e.innerText)||""},Nn=()=>({updateHeadStyle:Fo,getHeadStyle:Xo}),Eo=(e,t,n,r,o)=>{const{oklchStringToLchArray:l,oklchStringToHslArray:a}=Se();let f=[];t?f=l(r):f=a(r);const c=t?"okl":"h",d=t?"okc":"s",h=t?"okh":"l",g=document.documentElement.style;o?(g.setProperty(`--${e}-${n}-${o}-${c}`,`${f[0]}`),g.setProperty(`--${e}-${n}-${o}-${d}`,`${f[1]}`),g.setProperty(`--${e}-${n}-${o}-${h}`,`${f[2]}`)):(g.setProperty(`--${e}-${n}-${c}`,`${f[0]}`),g.setProperty(`--${e}-${n}-${d}`,`${f[1]}`),g.setProperty(`--${e}-${n}-${h}`,`${f[2]}`))},qn=()=>({updateDocumentStyleProp:Eo}),{getInitialCategoryOptions:Lo}=zn(),{computeStyleSheetContent:Po}=In(),{updateHeadStyle:Ao}=Nn(),{updateDocumentStyleProp:Oe}=qn(),Do=async(e,t,n)=>{e=e||"bwj",n=n||!0,t||(t=Lo());const r=t.filter(a=>a.selected);Object.values(document.documentElement.style).forEach(a=>{document.documentElement.style.removeProperty(a)});const l=Po(e,n,r);Ao(l),r.forEach(a=>{Oe(e,n,a.id,a.oklch),Oe(e,n,a.id,a.contentOklch,"content"),a.hasHover&&Oe(e,n,a.id,`${a.hoverOklch}`,"hover"),a.hasFocus&&Oe(e,n,a.id,`${a.focusOklch}`,"focus")})},Yo=()=>({computeDocumentStyles:Do});I._uniqueId=O,I.useCategories=zn,I.useColorConversion=Se,I.useComputeStyleSheetContent=In,I.useCssVarsUtils=mt,I.useScrollbarStyle=Sn,I.useThemeSystem=Yo,I.useUpdateDocumentStyleProp=qn,I.useUpdateHeadStyle=Nn,Object.defineProperty(I,Symbol.toStringTag,{value:"Module"})});
{
"name": "@builtwithjavascript/theme-system",
"version": "0.2.1",
"version": "0.3.1",
"description": "A framework agnostic theme system based on CSS variables.",

@@ -27,3 +27,3 @@ "author": "Damiano Fusco",

"pretty": "npx prettier -w \"./src/**/*.ts\"",
"push": "npm run pretty; git add .; git commit -m \"Fixed package.json types references\";",
"push": "npm run pretty; git add .; git commit -m \"Code re-org and cleanup\";",
"version-patch": "npm run pretty; npm version patch -m \"Patch version\"",

@@ -30,0 +30,0 @@ "preversion": "npm run test",

# @builtwithjavascript/theme-system
A framework agnostic theme system based on CSS variables.
Currently in development.
[![npm version](https://badge.fury.io/js/@builtwithjavascript%2Ftheme-system.svg)](https://badge.fury.io/js/@builtwithjavascript%2Ftheme-system)

@@ -5,0 +7,0 @@

import type { ICategoryOption } from '../models';
export declare const computeDocumentStyles: (cssVarPrefix?: string, categories?: ICategoryOption[], useOkLch?: boolean) => Promise<void>;
export type Fn = () => void;
export type Arrayable<T> = T[] | T;
export type AnyFn = (...args: any[]) => any;
export type TKeyValue<T = unknown> = {
key: string;
value: T;
};
export declare const noop: () => void;
export declare const isObject: (val: any) => val is object;
export declare function toValue<T>(r: T): T;
import type { ICategoryOption, TInitCategoryOption, TUpdateCategoryHex, TValidateCategoryName } from '../models';
export declare const _uniqueId: () => string;
interface IUseCategories {
getInitialCategoryOptions: () => ICategoryOption[];
updateCategoryFieldsFromHex: TUpdateCategoryHex;
initCategoryOption: TInitCategoryOption;
validateCategoryName: TValidateCategoryName;
}
export declare const useCategories: () => IUseCategories;
export {};
import type { TStringToStringArray, TConvertHexValue, TOklchStringFromHex, THexStringFromOklchString } from '../models';
interface IUseColorConvertion {
convertHexValue: TConvertHexValue;
oklchStringFromHex: TOklchStringFromHex;
oklchStringToLchArray: TStringToStringArray;
oklchStringToHslArray: TStringToStringArray;
hexStringFromOklchString: THexStringFromOklchString;
}
export declare const useColorConversion: () => IUseColorConvertion;
export {};
import { ICategoryOption } from '../models';
declare const computeStyleSheetContent: (cssVarPrefix: string, useOkLch: boolean, selectedCategories: ICategoryOption[], formatNicely?: boolean) => string;
interface IUseComputeStyleSheetContent {
computeStyleSheetContent: typeof computeStyleSheetContent;
}
export declare const useComputeStyleSheetContent: () => IUseComputeStyleSheetContent;
export {};
declare const buildCssAttributeColorExpression: (cssVarPrefix: string, useOkLch: boolean, categoryVariation: string, opacityVar?: string) => string;
interface IDocumentCssVarInfo {
id: string;
hasHover: boolean;
hasFocus: boolean;
}
interface TKeyValue {
key: string;
value: string;
}
declare const defaultCssVarsKeyValues: TKeyValue[];
declare const getDocumentCssVarsInfos: () => IDocumentCssVarInfo[];
declare const getDocumentCssVarsKeyValues: () => TKeyValue[];
interface IUseCssVarsUtils {
defaultCssVarsKeyValues: typeof defaultCssVarsKeyValues;
buildCssAttributeColorExpression: typeof buildCssAttributeColorExpression;
getDocumentCssVarsInfos: typeof getDocumentCssVarsInfos;
getDocumentCssVarsKeyValues: typeof getDocumentCssVarsKeyValues;
}
export declare const useCssVarsUtils: () => IUseCssVarsUtils;
export {};
export declare const useScrollbarStyle: (cssVarPrefix: string, useOklch?: boolean) => string;
import { TUpdateDocumentStyleProp } from '../models';
declare const updateDocumentStyleProp: TUpdateDocumentStyleProp;
interface IUpdateDocumentStyleProp {
updateDocumentStyleProp: typeof updateDocumentStyleProp;
}
export declare const useUpdateDocumentStyleProp: () => IUpdateDocumentStyleProp;
export {};
declare const updateHeadStyle: (styleSheetContent: string) => void;
declare const getHeadStyle: () => string;
interface IUseUpdateHeadStyle {
updateHeadStyle: typeof updateHeadStyle;
getHeadStyle: typeof getHeadStyle;
}
export declare const useUpdateHeadStyle: () => IUseUpdateHeadStyle;
export {};
export interface ICategoryOption {
uniqueId: string;
id: string;
hasHover: boolean;
hasFocus: boolean;
_hex: string;
_hoverHex?: string;
_focusHex?: string;
_contentHex: string;
oklch: string;
hoverOklch?: string;
focusOklch?: string;
contentOklch: string;
selected: boolean;
flash: boolean;
_initial?: ICategoryOption | undefined;
}
export type TInitCategoryOption = (id: string, options?: {
hasHover: boolean;
hasFocus: boolean;
}) => ICategoryOption;
export type TUpdateCategoryHex = (category: ICategoryOption, strHex: string, state?: string) => ICategoryOption;
export type TValidateCategoryName = (categories: ICategoryOption[], uniqueId: string, newName: string) => string;
export type TStringToStringArray = (value: string) => string[];
export type TConvertHexValue = (strHex: string, useOkLch: boolean) => string[];
export type TOklchStringFromHex = (strHex: string) => string;
export type THexStringFromOklchString = (strOklch: string) => string;
export type TUpdateDocumentStyleProp = (cssVarPrefix: string, useOkLch: boolean, key: string, strOklch: string, state?: string) => void;
export type TComputeStyleSheetContent = (cssVarPrefix: string, useOkLch: boolean, selectedCategories: ICategoryOption[]) => string;

Sorry, the diff of this file is too big to display