@mkbabb/keyframes.js 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +1,15 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const pn=16.666666666666668,Te=e=>!!e&&e.constructor===Object;function ct(e){return Te(e)?Object.entries(e).map(([t,n])=>[t,ct(n)]).reduce((t,[n,r])=>(t[n]=r,t),{}):e!=null&&typeof e.clone=="function"?e.clone():Array.isArray(e)?e.map(ct):e}async function cs(e){return await new Promise(t=>setTimeout(t,e))}function Q(e,t={}){const n=new Map,{maxCacheSize:r=1/0,ttl:s=1/0,keyFn:i=JSON.stringify}=t,o=function(...a){const c=i.apply(this,a),l=Date.now();if(n.has(c)){const h=n.get(c);if(l-h.timestamp<=s)return h.value;n.delete(c)}const u=e.apply(this,a);if(n.set(c,{value:u,timestamp:l}),n.size>r){const h=n.keys().next().value;n.delete(h)}return u};return o.cache=n,o}const ls=e=>e.replace(/([-_][a-z])/gi,t=>t.toUpperCase().replace("-","").replace("_",""));function us(e){return e.replace(/([A-Z])/g,t=>`-${t[0].toLowerCase()}`)}function mn(e,t,n){for(let r=e-1;r>=0;r--)if(n(t[r]))return r}function vt(e){if(typeof window<"u"&&window.requestAnimationFrame)return window.requestAnimationFrame(e);let t=pn,n=Date.now();return setTimeout(()=>{let r=Date.now(),s=r-n;n=r,t=Math.max(0,pn-s),e(r)},t)}function er(e){if(typeof window<"u"&&window.cancelAnimationFrame)return window.cancelAnimationFrame(e);clearTimeout(e)}const nr=["px","cm","mm","Q","in","pc","pt"],rr=["em","ex","ch","rem","lh","rlh","vw","vh","vmin","vmax","vb","vi","svw","svh","lvw","lvh","dvw","dvh"],hs=[...nr,...rr],ps=["s","ms"],ms=["deg","rad","grad","turn"],fs=["%"],ds=["dpi","dpcm","dppx","cqw"],ye=["var","calc"],bs=["string","var","calc"],gs=["accentColor","additiveSymbols","alignContent","alignItems","alignSelf","alignmentBaseline","all","anchorName","animation","animationComposition","animationDelay","animationDirection","animationDuration","animationFillMode","animationIterationCount","animationName","animationPlayState","animationRange","animationRangeEnd","animationRangeStart","animationTimeline","animationTimingFunction","appRegion","appearance","ascentOverride","aspectRatio","backdropFilter","backfaceVisibility","background","backgroundAttachment","backgroundBlendMode","backgroundClip","backgroundColor","backgroundImage","backgroundOrigin","backgroundPosition","backgroundPositionX","backgroundPositionY","backgroundRepeat","backgroundSize","basePalette","baselineShift","baselineSource","blockSize","border","borderBlock","borderBlockColor","borderBlockEnd","borderBlockEndColor","borderBlockEndStyle","borderBlockEndWidth","borderBlockStart","borderBlockStartColor","borderBlockStartStyle","borderBlockStartWidth","borderBlockStyle","borderBlockWidth","borderBottom","borderBottomColor","borderBottomLeftRadius","borderBottomRightRadius","borderBottomStyle","borderBottomWidth","borderCollapse","borderColor","borderEndEndRadius","borderEndStartRadius","borderImage","borderImageOutset","borderImageRepeat","borderImageSlice","borderImageSource","borderImageWidth","borderInline","borderInlineColor","borderInlineEnd","borderInlineEndColor","borderInlineEndStyle","borderInlineEndWidth","borderInlineStart","borderInlineStartColor","borderInlineStartStyle","borderInlineStartWidth","borderInlineStyle","borderInlineWidth","borderLeft","borderLeftColor","borderLeftStyle","borderLeftWidth","borderRadius","borderRight","borderRightColor","borderRightStyle","borderRightWidth","borderSpacing","borderStartEndRadius","borderStartStartRadius","borderStyle","borderTop","borderTopColor","borderTopLeftRadius","borderTopRightRadius","borderTopStyle","borderTopWidth","borderWidth","bottom","boxShadow","boxSizing","breakAfter","breakBefore","breakInside","bufferedRendering","captionSide","caretColor","clear","clip","clipPath","clipRule","color","colorInterpolation","colorInterpolationFilters","colorRendering","colorScheme","columnCount","columnFill","columnGap","columnRule","columnRuleColor","columnRuleStyle","columnRuleWidth","columnSpan","columnWidth","columns","contain","containIntrinsicBlockSize","containIntrinsicHeight","containIntrinsicInlineSize","containIntrinsicSize","containIntrinsicWidth","container","containerName","containerType","content","contentVisibility","counterIncrement","counterReset","counterSet","cursor","cx","cy","d","descentOverride","direction","display","dominantBaseline","emptyCells","fallback","fieldSizing","fill","fillOpacity","fillRule","filter","flex","flexBasis","flexDirection","flexFlow","flexGrow","flexShrink","flexWrap","float","floodColor","floodOpacity","font","fontDisplay","fontFamily","fontFeatureSettings","fontKerning","fontOpticalSizing","fontPalette","fontSize","fontStretch","fontStyle","fontSynthesis","fontSynthesisSmallCaps","fontSynthesisStyle","fontSynthesisWeight","fontVariant","fontVariantAlternates","fontVariantCaps","fontVariantEastAsian","fontVariantLigatures","fontVariantNumeric","fontVariantPosition","fontVariationSettings","fontWeight","forcedColorAdjust","gap","grid","gridArea","gridAutoColumns","gridAutoFlow","gridAutoRows","gridColumn","gridColumnEnd","gridColumnGap","gridColumnStart","gridGap","gridRow","gridRowEnd","gridRowGap","gridRowStart","gridTemplate","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","height","hyphenateCharacter","hyphenateLimitChars","hyphens","imageOrientation","imageRendering","inherits","initialLetter","initialValue","inlineSize","inset","insetArea","insetBlock","insetBlockEnd","insetBlockStart","insetInline","insetInlineEnd","insetInlineStart","isolation","justifyContent","justifyItems","justifySelf","left","letterSpacing","lightingColor","lineBreak","lineGapOverride","lineHeight","listStyle","listStyleImage","listStylePosition","listStyleType","margin","marginBlock","marginBlockEnd","marginBlockStart","marginBottom","marginInline","marginInlineEnd","marginInlineStart","marginLeft","marginRight","marginTop","marker","markerEnd","markerMid","markerStart","mask","maskClip","maskComposite","maskImage","maskMode","maskOrigin","maskPosition","maskRepeat","maskSize","maskType","mathDepth","mathShift","mathStyle","maxBlockSize","maxHeight","maxInlineSize","maxWidth","minBlockSize","minHeight","minInlineSize","minWidth","mixBlendMode","navigation","negative","objectFit","objectPosition","objectViewBox","offset","offsetAnchor","offsetDistance","offsetPath","offsetPosition","offsetRotate","opacity","order","orphans","outline","outlineColor","outlineOffset","outlineStyle","outlineWidth","overflow","overflowAnchor","overflowClipMargin","overflowWrap","overflowX","overflowY","overlay","overrideColors","overscrollBehavior","overscrollBehaviorBlock","overscrollBehaviorInline","overscrollBehaviorX","overscrollBehaviorY","pad","padding","paddingBlock","paddingBlockEnd","paddingBlockStart","paddingBottom","paddingInline","paddingInlineEnd","paddingInlineStart","paddingLeft","paddingRight","paddingTop","page","pageBreakAfter","pageBreakBefore","pageBreakInside","pageOrientation","paintOrder","perspective","perspectiveOrigin","placeContent","placeItems","placeSelf","pointerEvents","position","positionAnchor","positionTry","positionTryOptions","positionTryOrder","positionVisibility","prefix","quotes","r","range","resize","right","rotate","rowGap","rubyPosition","rx","ry","scale","scrollBehavior","scrollMargin","scrollMarginBlock","scrollMarginBlockEnd","scrollMarginBlockStart","scrollMarginBottom","scrollMarginInline","scrollMarginInlineEnd","scrollMarginInlineStart","scrollMarginLeft","scrollMarginRight","scrollMarginTop","scrollPadding","scrollPaddingBlock","scrollPaddingBlockEnd","scrollPaddingBlockStart","scrollPaddingBottom","scrollPaddingInline","scrollPaddingInlineEnd","scrollPaddingInlineStart","scrollPaddingLeft","scrollPaddingRight","scrollPaddingTop","scrollSnapAlign","scrollSnapStop","scrollSnapType","scrollTimeline","scrollTimelineAxis","scrollTimelineName","scrollbarColor","scrollbarGutter","scrollbarWidth","shapeImageThreshold","shapeMargin","shapeOutside","shapeRendering","size","sizeAdjust","speak","speakAs","src","stopColor","stopOpacity","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","suffix","symbols","syntax","system","tabSize","tableLayout","textAlign","textAlignLast","textAnchor","textCombineUpright","textDecoration","textDecorationColor","textDecorationLine","textDecorationSkipInk","textDecorationStyle","textDecorationThickness","textEmphasis","textEmphasisColor","textEmphasisPosition","textEmphasisStyle","textIndent","textOrientation","textOverflow","textRendering","textShadow","textSizeAdjust","textSpacingTrim","textTransform","textUnderlineOffset","textUnderlinePosition","textWrap","timelineScope","top","touchAction","transform","transformBox","transformOrigin","transformStyle","transition","transitionBehavior","transitionDelay","transitionDuration","transitionProperty","transitionTimingFunction","translate","types","unicodeBidi","unicodeRange","userSelect","vectorEffect","verticalAlign","viewTimeline","viewTimelineAxis","viewTimelineInset","viewTimelineName","viewTransitionClass","viewTransitionName","visibility","webkitAlignContent","webkitAlignItems","webkitAlignSelf","webkitAnimation","webkitAnimationDelay","webkitAnimationDirection","webkitAnimationDuration","webkitAnimationFillMode","webkitAnimationIterationCount","webkitAnimationName","webkitAnimationPlayState","webkitAnimationTimingFunction","webkitAppRegion","webkitAppearance","webkitBackfaceVisibility","webkitBackgroundClip","webkitBackgroundOrigin","webkitBackgroundSize","webkitBorderAfter","webkitBorderAfterColor","webkitBorderAfterStyle","webkitBorderAfterWidth","webkitBorderBefore","webkitBorderBeforeColor","webkitBorderBeforeStyle","webkitBorderBeforeWidth","webkitBorderBottomLeftRadius","webkitBorderBottomRightRadius","webkitBorderEnd","webkitBorderEndColor","webkitBorderEndStyle","webkitBorderEndWidth","webkitBorderHorizontalSpacing","webkitBorderImage","webkitBorderRadius","webkitBorderStart","webkitBorderStartColor","webkitBorderStartStyle","webkitBorderStartWidth","webkitBorderTopLeftRadius","webkitBorderTopRightRadius","webkitBorderVerticalSpacing","webkitBoxAlign","webkitBoxDecorationBreak","webkitBoxDirection","webkitBoxFlex","webkitBoxOrdinalGroup","webkitBoxOrient","webkitBoxPack","webkitBoxReflect","webkitBoxShadow","webkitBoxSizing","webkitClipPath","webkitColumnBreakAfter","webkitColumnBreakBefore","webkitColumnBreakInside","webkitColumnCount","webkitColumnGap","webkitColumnRule","webkitColumnRuleColor","webkitColumnRuleStyle","webkitColumnRuleWidth","webkitColumnSpan","webkitColumnWidth","webkitColumns","webkitFilter","webkitFlex","webkitFlexBasis","webkitFlexDirection","webkitFlexFlow","webkitFlexGrow","webkitFlexShrink","webkitFlexWrap","webkitFontFeatureSettings","webkitFontSmoothing","webkitHyphenateCharacter","webkitJustifyContent","webkitLineBreak","webkitLineClamp","webkitLocale","webkitLogicalHeight","webkitLogicalWidth","webkitMarginAfter","webkitMarginBefore","webkitMarginEnd","webkitMarginStart","webkitMask","webkitMaskBoxImage","webkitMaskBoxImageOutset","webkitMaskBoxImageRepeat","webkitMaskBoxImageSlice","webkitMaskBoxImageSource","webkitMaskBoxImageWidth","webkitMaskClip","webkitMaskComposite","webkitMaskImage","webkitMaskOrigin","webkitMaskPosition","webkitMaskPositionX","webkitMaskPositionY","webkitMaskRepeat","webkitMaskSize","webkitMaxLogicalHeight","webkitMaxLogicalWidth","webkitMinLogicalHeight","webkitMinLogicalWidth","webkitOpacity","webkitOrder","webkitPaddingAfter","webkitPaddingBefore","webkitPaddingEnd","webkitPaddingStart","webkitPerspective","webkitPerspectiveOrigin","webkitPerspectiveOriginX","webkitPerspectiveOriginY","webkitPrintColorAdjust","webkitRtlOrdering","webkitRubyPosition","webkitShapeImageThreshold","webkitShapeMargin","webkitShapeOutside","webkitTapHighlightColor","webkitTextCombine","webkitTextDecorationsInEffect","webkitTextEmphasis","webkitTextEmphasisColor","webkitTextEmphasisPosition","webkitTextEmphasisStyle","webkitTextFillColor","webkitTextOrientation","webkitTextSecurity","webkitTextSizeAdjust","webkitTextStroke","webkitTextStrokeColor","webkitTextStrokeWidth","webkitTransform","webkitTransformOrigin","webkitTransformOriginX","webkitTransformOriginY","webkitTransformOriginZ","webkitTransformStyle","webkitTransition","webkitTransitionDelay","webkitTransitionDuration","webkitTransitionProperty","webkitTransitionTimingFunction","webkitUserDrag","webkitUserModify","webkitUserSelect","webkitWritingMode","whiteSpace","whiteSpaceCollapse","widows","width","willChange","wordBreak","wordSpacing","wordWrap","writingMode","x","y","zIndex","zoom"],fn=(e,t=2)=>typeof e=="number"&&Number.isNaN(e)?"none":String(e?.toFixed?.(t)??e).trim().replace(/\.0+$/,""),dn=(e,t,n)=>`${e}(${t.join(" ")} / ${n})`;let H=class{constructor(e,t=1){this.colorSpace=e,this.alpha=t,this.components=new Map}components;toString(){const e=Array.from(this.components.values()).map(n=>typeof n=="number"&&Number.isNaN(n)?"none":n),t=typeof this.alpha=="number"&&Number.isNaN(this.alpha)?"none":this.alpha;return dn(this.colorSpace,e,t)}toFormattedString(e=2){const t=Array.from(this.components.values()).map(r=>fn(r,e)),n=fn(this.alpha,e);return dn(this.colorSpace,t,n)}valueOf(){return[...this.values(),this.alpha]}toJSON(){const e={};for(const[t,n]of this.entries())e[t]=n;return e.alpha=this.alpha,e}clone(){const e=this.constructor,t=new e;return t.alpha=ct(this.alpha),this.components.forEach((n,r)=>{t.components.set(r,ct(n))}),t}keys(){return[...this.components.keys(),"alpha"]}values(){return[...this.components.values(),this.alpha]}entries(){return[...this.components.entries(),["alpha",this.alpha]]}getComponent(e){return this.components.get(e)}setComponent(e,t){this.components.set(e,t)}};class Pe extends H{constructor(t,n,r){super(t,n),this.whitePoint=r}}class q extends H{constructor(t,n,r,s){super("rgb",s),this.components.set("r",t),this.components.set("g",n),this.components.set("b",r)}get r(){return this.getComponent("r")}set r(t){this.setComponent("r",t)}get g(){return this.getComponent("g")}set g(t){this.setComponent("g",t)}get b(){return this.getComponent("b")}set b(t){this.setComponent("b",t)}}class jt extends H{constructor(t,n,r,s){super("hsl",s),this.components.set("h",t),this.components.set("s",n),this.components.set("l",r)}get h(){return this.getComponent("h")}set h(t){this.setComponent("h",t)}get s(){return this.getComponent("s")}set s(t){this.setComponent("s",t)}get l(){return this.getComponent("l")}set l(t){this.setComponent("l",t)}}class Oe extends H{constructor(t,n,r,s){super("hsv",s),this.components.set("h",t),this.components.set("s",n),this.components.set("v",r)}get h(){return this.getComponent("h")}set h(t){this.setComponent("h",t)}get s(){return this.getComponent("s")}set s(t){this.setComponent("s",t)}get v(){return this.getComponent("v")}set v(t){this.setComponent("v",t)}}class ze extends H{constructor(t,n,r,s){super("hwb",s),this.components.set("h",t),this.components.set("w",n),this.components.set("b",r)}get h(){return this.getComponent("h")}set h(t){this.setComponent("h",t)}get w(){return this.getComponent("w")}set w(t){this.setComponent("w",t)}get b(){return this.getComponent("b")}set b(t){this.setComponent("b",t)}}class ee extends Pe{constructor(t,n,r,s){super("lab",s,"D50"),this.components.set("l",t),this.components.set("a",n),this.components.set("b",r)}get l(){return this.getComponent("l")}set l(t){this.setComponent("l",t)}get a(){return this.getComponent("a")}set a(t){this.setComponent("a",t)}get b(){return this.getComponent("b")}set b(t){this.setComponent("b",t)}}class Ne extends H{constructor(t,n,r,s){super("lch",s),this.components.set("l",t),this.components.set("c",n),this.components.set("h",r)}get l(){return this.getComponent("l")}set l(t){this.setComponent("l",t)}get c(){return this.getComponent("c")}set c(t){this.setComponent("c",t)}get h(){return this.getComponent("h")}set h(t){this.setComponent("h",t)}}class ne extends Pe{constructor(t,n,r,s){super("oklab",s,"D50"),this.components.set("l",t),this.components.set("a",n),this.components.set("b",r)}get l(){return this.getComponent("l")}set l(t){this.setComponent("l",t)}get a(){return this.getComponent("a")}set a(t){this.setComponent("a",t)}get b(){return this.getComponent("b")}set b(t){this.setComponent("b",t)}}class $e extends H{constructor(t,n,r,s){super("oklch",s),this.components.set("l",t),this.components.set("c",n),this.components.set("h",r)}get l(){return this.getComponent("l")}set l(t){this.setComponent("l",t)}get c(){return this.getComponent("c")}set c(t){this.setComponent("c",t)}get h(){return this.getComponent("h")}set h(t){this.setComponent("h",t)}}class Y extends Pe{constructor(t,n,r,s){super("xyz",s,"D65"),this.components.set("x",t),this.components.set("y",n),this.components.set("z",r)}get x(){return this.getComponent("x")}set x(t){this.setComponent("x",t)}get y(){return this.getComponent("y")}set y(t){this.setComponent("y",t)}get z(){return this.getComponent("z")}set z(t){this.setComponent("z",t)}}class sr extends H{constructor(t,n){super("kelvin",n),this.components.set("kelvin",t)}get kelvin(){return this.getComponent("kelvin")}set kelvin(t){this.setComponent("kelvin",t)}}class Fe extends H{constructor(t,n,r,s){super("srgb-linear",s),this.components.set("r",t),this.components.set("g",n),this.components.set("b",r)}get r(){return this.getComponent("r")}set r(t){this.setComponent("r",t)}get g(){return this.getComponent("g")}set g(t){this.setComponent("g",t)}get b(){return this.getComponent("b")}set b(t){this.setComponent("b",t)}}class Ae extends H{constructor(t,n,r,s){super("display-p3",s),this.components.set("r",t),this.components.set("g",n),this.components.set("b",r)}get r(){return this.getComponent("r")}set r(t){this.setComponent("r",t)}get g(){return this.getComponent("g")}set g(t){this.setComponent("g",t)}get b(){return this.getComponent("b")}set b(t){this.setComponent("b",t)}}class Ve extends H{constructor(t,n,r,s){super("a98-rgb",s),this.components.set("r",t),this.components.set("g",n),this.components.set("b",r)}get r(){return this.getComponent("r")}set r(t){this.setComponent("r",t)}get g(){return this.getComponent("g")}set g(t){this.setComponent("g",t)}get b(){return this.getComponent("b")}set b(t){this.setComponent("b",t)}}class Re extends H{constructor(t,n,r,s){super("prophoto-rgb",s),this.components.set("r",t),this.components.set("g",n),this.components.set("b",r)}get r(){return this.getComponent("r")}set r(t){this.setComponent("r",t)}get g(){return this.getComponent("g")}set g(t){this.setComponent("g",t)}get b(){return this.getComponent("b")}set b(t){this.setComponent("b",t)}}class je extends H{constructor(t,n,r,s){super("rec2020",s),this.components.set("r",t),this.components.set("g",n),this.components.set("b",r)}get r(){return this.getComponent("r")}set r(t){this.setComponent("r",t)}get g(){return this.getComponent("g")}set g(t){this.setComponent("g",t)}get b(){return this.getComponent("b")}set b(t){this.setComponent("b",t)}}function xe(e){return e.unit==="color"}const ir=e=>{const t={},n=(r,s=void 0)=>{if(Array.isArray(r)){r.forEach((o,a)=>n(o,s));return}else if(r instanceof _){let o=r.name;s&&(s.endsWith(r.name)?o=s:o=`${s}.${r.name}`),r.values.forEach((a,c)=>n(a,o));return}else if(Te(r)){for(const[o,a]of Object.entries(r)){const c=s?`${s}.${o}`:o;n(a,c)}return}const i=s;t[i]==null&&(t[i]=new st),t[i].push(r),t[i]=t[i].flat()};return n(e),t},ws=e=>{const t={};for(const[n,r]of Object.entries(e)){const s=n.split(".");let i=t;for(let o=0;o<s.length;o++){const a=s[o];o===s.length-1?Array.isArray(i)?i.push(r):i[a]=r:(a in i||(i[a]={}),i=i[a])}}return t},ks=e=>{const t={};for(const[n,r]of Object.entries(e)){const s=n.split("."),i=s[0];let o=t[i]??"",a="",c="";for(let u=1;u<s.length;u++)a+=`${s[u]}(`,c+=")";let l="";s.length>1&&Array.isArray(r)?l=r.join(", "):l=r.toString(),o+=` ${a}${l}${c}`,t[i]=o.trim()}return t};new Set(gs);const or=e=>{const t=e.name,n=e.valueOf();if(!e.name.startsWith("matrix"))throw new Error("Input must be a matrix or matrix3d value");const r={scaleX:1,scaleY:1,scaleZ:1,skewX:0,skewY:0,skewZ:0,translateX:0,translateY:0,translateZ:0,rotateX:0,rotateY:0,rotateZ:0,perspectiveX:0,perspectiveY:0,perspectiveZ:0,perspectiveW:1};if(e.name==="matrix")return{...r,scaleX:n[0]??1,skewY:n[1]??0,skewX:n[2]??0,scaleY:n[3]??1,translateX:n[4]??0,translateY:n[5]??0,rotateZ:Math.atan2(n[1]??0,n[0]??1),rotateY:Math.atan2(-(n[2]??0),n[0]??1),rotateX:Math.atan2(n[1]??0,n[3]??1)};if(t==="matrix3d"){if(n.length===4)return{...r,translateX:n[0]??0,translateY:n[1]??0,translateZ:n[2]??0,perspectiveW:n[3]??1};if(n.length===16)return{scaleX:n[0]??1,skewY:n[1]??0,skewX:n[4]??0,scaleY:n[5]??1,scaleZ:n[10]??1,skewZ:n[2]??0,translateX:n[12]??0,translateY:n[13]??0,translateZ:n[14]??0,rotateX:Math.atan2(-(n[9]??0),n[10]??1),rotateY:Math.atan2(n[8]??0,Math.sqrt(Math.pow(n[0]??1,2)+Math.pow(n[1]??0,2))),rotateZ:Math.atan2(n[1]??0,n[0]??1),perspectiveX:n[3]??0,perspectiveY:n[7]??0,perspectiveZ:n[11]??0,perspectiveW:n[15]??1}}throw new Error("Unsupported matrix type or invalid number of values")};function ys(e,t){let n=e;return t==="cm"?n*=96/2.54:t==="mm"?n*=96/25.4:t==="in"?n*=96:t==="pt"?n*=4/3:t==="pc"&&(n*=16),n}function xs(e,t,n,r){if(t==="em"&&n)e*=parseFloat(getComputedStyle(n).fontSize);else if(t==="rem")e*=parseFloat(getComputedStyle(document.documentElement).fontSize);else if(t==="vh")e*=window.innerHeight/100;else if(t==="vw")e*=window.innerWidth/100;else if(t==="vmin")e*=Math.min(window.innerHeight,window.innerWidth)/100;else if(t==="vmax")e*=Math.max(window.innerHeight,window.innerWidth)/100;else if(t==="%"&&n?.parentElement&&r){const s=parseFloat(getComputedStyle(n.parentElement).getPropertyValue(r));e=e/100*s}else t==="ex"||t==="ch"?e*=parseFloat(getComputedStyle(n).fontSize)??16:e=ys(e,t);return e}function ar(e,t){return t==="s"&&(e*=1e3),e}function cr(e,t){return t==="grad"?e*=.9:t==="rad"?e*=180/Math.PI:t==="turn"&&(e*=360),e}function Ss(e,t){return t==="dpcm"?e*=2.54:t==="dppx"&&(e*=96),e}class d{constructor(t,n,r,s,i,o){this.value=t,this.unit=n,this.superType=r,this.subProperty=s,this.property=i,this.targets=o}setSubProperty(t){this.subProperty=t}setProperty(t){this.property=t}setTargets(t){this.targets=t}valueOf(){return this.value}setValue(t){this.value=t}toString(){return this.value==null?"":this.unit==null||this.unit==="string"?`${this.value}`:xe(this)?this.value.toString():this.unit==="var"?`var(${this.value})`:this.unit==="calc"?`calc(${this.value})`:`${this.value}${this.unit}`}toJSON(){return this.valueOf()}toFixed(t=2){const n=Number(this.value).toFixed(t).replace(/\.0+$/,"");return new d(n).coalesce(this,!0).toString()}clone(){return new d(ct(this.value),this.unit,ct(this.superType),this.subProperty,this.property)}coalesce(t,n=!1){return t==null?this:bs.includes(this.unit)?this:n?(this.unit??=t.unit,this.superType??=t.superType,this.subProperty??=t.subProperty,this.property??=t.property,this.targets??=t.targets,this):new d(ct(this.value),this.unit??t.unit,ct(this.superType??t.superType),this.subProperty??t.subProperty,this.property??t.property,this.targets??t.targets)}}class _{constructor(t,n){this.name=t,this.values=n,n.forEach(r=>{this.setSubProperty(t)})}setSubProperty(t){this.values.forEach(n=>n.setSubProperty(t))}setProperty(t){this.values.forEach(n=>n.setProperty(t))}setTargets(t){this.values.forEach(n=>n.setTargets(t))}setValue(t,n){n!=null?this.values[n].setValue(t):this.values.forEach(r=>r.setValue(t))}valueOf(){return this.values.map(t=>t.valueOf())}toString(){return`${this.name}(${this.values.map(t=>t.toString()).join(", ")})`}toJSON(){return{[this.name]:this.values.map(t=>t.toJSON())}}clone(){return new _(this.name,this.values.map(t=>t.clone()))}}class st extends Array{constructor(...t){super(...t)}setSubProperty(t){this.forEach(n=>n.setSubProperty(t))}setProperty(t){this.forEach(n=>n.setProperty(t))}setTargets(t){this.forEach(n=>n.setTargets(t))}setValue(t,n){n!=null?this[n].setValue(t):this.forEach(r=>r.setValue(t))}valueOf(){return this.map(t=>t.valueOf())}toString(){return this.map(t=>t.toString()).join(" ")}toJSON(){return this.map(t=>t.toJSON())}clone(){return new st(...this.map(t=>t.clone()))}}const bn=4;function gn(e,t="^",n=!1){const r=e.src.split(`
2
- `),s=Math.min(r.length-1,e.getLineNumber()),i=Math.max(s-bn,0),o=Math.min(s+bn+1,r.length),a=r.slice(i,o);if(t){const c=" ".repeat(e.getColumnNumber())+t;a.splice(s-i+1,0,c)}return a.map((c,l)=>` ${i+l+1}| ${c}`).join(`
3
- `)}const dt=new Map;function lr(e){if(dt.has(e.id))return dt.get(e.id);const t=(r,s)=>{if(dt.has(r.id))return dt.get(r.id);const{name:i,args:o,parser:a}=r.context,c=a!=null?t(a,s):"unknown",l=(()=>{switch(i){case"string":return`"${o[0]}"`;case"regex":case"regexConcat":case"regexWrap":return`${o[0]}`;case"wrap":case"trim":{const[u,h]=o;return`${t(u,s)} ${c} ${t(h,s)}`}case"trimWhitespace":return`${c}?w`;case"not":return`!${c}`;case"opt":return`${c}?`;case"next":{const[u]=o;return`${c} >> ${t(u,s)}`}case"skip":{const[u]=o;return`${c} << ${t(u,s)}`}case"map":return c;case"all":case"then":return`[${o.map(u=>t(u,s)).join(", ")}]`;case"any":case"or":return o.map(u=>t(u,s)).join(" | ");case"many":{const[u,h]=o,b=h===1/0?`${u},`:`${u},${h}`;return`${c} {${b}}`}case"sepBy":return`${c} sepBy ${t(o[0],s)}`;case"lazy":{const[u]=o,h=hr(u);if(s)return i;{const b=t(h,h.id);return dt.set(h.id,b),b}}case"debug":return c;default:return}})()??i??"unknown";return s&&dt.set(r.id,l),l},n=t(e);return dt.set(e.id,n),n}function ur(e,t="",n=""){const r=String(e.value),s=e.offset>=e.src.length,i=`${`[${e.isError?"err":s?"done":"ok"}]`} ${t} offset=${e.offset} value=${r}`,o=e.offset>=e.src.length?gn(e,"",e.isError):gn(e,"^",e.isError);return`${i}
4
- ${o}`}function vs(e,t="",n=!1,r=console.log){const s=i=>{const o=e.parser(i),a=n?lr(e):e.context.name??"",c=ur(o,t,a);return r(c),o};return new S(s,I("debug",e,r))}class Yt{constructor(t,n=void 0,r=0,s=!1,i=0){this.src=t,this.value=n,this.offset=r,this.isError=s,this.furthest=i}ok(t,n=0){return n+=this.offset,new Yt(this.src,t,n,!1)}err(t,n=0){const r=this.ok(t,n);return r.isError=!0,r}from(t,n=0){return n+=this.offset,new Yt(this.src,t,n,this.isError)}getColumnNumber(){const t=this.offset,n=this.src.lastIndexOf(`
5
- `,t),r=n===-1?t:t-(n+1);return Math.max(0,r)}getLineNumber(){const t=this.src.lastIndexOf(`
6
- `,this.offset);return t>=0?this.src.slice(0,t).split(`
7
- `).length:0}toString(){return ur(this)}}function I(e,t,...n){return{name:e,parser:t,args:n}}let Cs=0;const bt=new Map,qt=new Map;let Ft;function D(e){return(!Ft||e.offset>Ft.offset)&&(Ft=e),Ft}function hr(e){return e.parser?e.parser:e.parser=e()}class S{constructor(t,n={}){this.parser=t,this.context=n}id=Cs++;state;reset(){Ft=void 0,bt.clear(),qt.clear()}parseState(t){this.reset();const n=this.parser(new Yt(t));return this.state=D(n),this.state.isError=n.isError,this.state.isError,n}parse(t){return this.parseState(t).value}getCijKey(t){return`${this.id}${t.offset}`}atLeftRecursionLimit(t){return(qt.get(this.getCijKey(t))??0)>t.src.length-t.offset}memoize(){const t=n=>{const r=this.getCijKey(n),s=qt.get(r)??0;let i=bt.get(this.id);if(i&&i.offset>=n.offset)return i;if(this.atLeftRecursionLimit(n))return n.err(void 0);qt.set(r,s+1);const o=this.parser(n);return i=bt.get(this.id),i&&i.offset>o.offset?o.offset=i.offset:i||bt.set(this.id,o),o};return new S(t,I("memoize",this))}mergeMemos(){const t=n=>{let r=bt.get(this.id);if(r)return r;if(this.atLeftRecursionLimit(n))return n.err(void 0);const s=this.parser(n);return r=bt.get(this.id),r||bt.set(this.id,s),s};return new S(t,I("mergeMemo",this))}then(t){const n=r=>{const s=this.parser(r);if(!s.isError){const i=t.parser(s);if(!i.isError)return i.ok([s.value,i.value])}return D(r),r.err(void 0)};return new S(n,I("then",this,this,t))}or(t){const n=r=>{const s=this.parser(r);return s.isError?t.parser(r):s};return new S(n,I("or",this,this,t))}chain(t,n=!1){const r=s=>{const i=this.parser(s);return i.isError?i:i.value||n?t(i.value).parser(i):s};return new S(r,I("chain",this,t))}map(t,n=!1){const r=s=>{const i=this.parser(s);return!i.isError||n?i.ok(t(i.value)):i};return new S(r,I("map",this))}mapState(t){const n=r=>{const s=this.parser(r);return t(s,r)};return new S(n,I("mapState",this))}skip(t){const n=r=>{const s=this.parser(r);if(!s.isError){const i=t.parser(s);if(!i.isError)return i.ok(s.value)}return D(r),r.err(void 0)};return new S(n,I("skip",this,t))}next(t){const n=this.then(t).map(([,r])=>r);return n.context=I("next",this,t),n}opt(){const t=n=>{const r=this.parser(n);return r.isError?(D(n),n.ok(void 0)):r};return new S(t,I("opt",this))}not(t){const n=s=>this.parser(s).isError?(D(s),s.ok(s.value)):s.err(void 0),r=s=>{const i=this.parser(s);return i.isError?(D(s),i):t.parser(s).isError?i:(D(s),s.err(void 0))};return new S(t?r:n,I("not",this,t))}wrap(t,n,r=!0){if(!r)return T(t,this,n);const s=t.next(this).skip(n);return s.context=I("wrap",this,t,n),s}trim(t=w,n=!0){if(!n)return T(t,this,t);if(t.context?.name==="whitespace"){const r=s=>{const i=kn(s),o=this.parser(i);return o.isError?(D(s),s.err(void 0)):kn(o)};return new S(r,I("trimWhitespace",this))}return this.wrap(t,t)}many(t=0,n=1/0){const r=s=>{const i=[];let o=s;for(let a=0;a<n;a+=1){const c=this.parser(o);if(c.isError)break;i.push(c.value),o=c}return i.length>=t?o.ok(i):(D(s),s.err([]))};return new S(r,I("many",this,t,n))}sepBy(t,n=0,r=1/0){const s=i=>{const o=[];let a=i;for(let c=0;c<r;c+=1){const l=this.parser(a);if(l.isError)break;a=l,o.push(a.value);const u=t.parser(a);if(u.isError)break;a=u}return o.length>n?a.ok(o):(D(i),i.err([]))};return new S(s,I("sepBy",this,t))}eof(){const t=this.skip(Es());return t.context=I("eof",this),t}debug(t="",n=!1,r=console.log){return vs(this,t,n,r)}toString(){return lr(this)}static lazy(t){const n=r=>hr(t).parser(r);return new S(n,I("lazy",void 0,t))}}function Es(){const e=t=>t.offset>=t.src.length?t.ok(void 0):(D(t),t.err());return new S(e,I("eof",void 0))}function g(...e){const t=n=>{for(const r of e){const s=r.parser(n);if(!s.isError)return s}return D(n),n.err(void 0)};return new S(e.length===1?e[0].parser:t,I("any",void 0,...e))}function T(...e){const t=n=>{const r=[];let s=n;for(const i of e){const o=i.parser(s);if(o.isError)return o;o.value!==void 0&&r.push(o.value),s=o}return D(s),s.ok(r)};return new S(e.length===1?e[0].parser:t,I("all",void 0,...e))}function O(e){const t=n=>{if(n.offset>=n.src.length)return n.err(void 0);const r=n.src.slice(n.offset,n.offset+e.length);return r===e?n.ok(r,r.length):(D(n),n.err(void 0))};return new S(t,I("string",void 0,e))}function G(e,t=n=>n?.[0]??null){const n=e.flags.replace(/y/g,""),r=new RegExp(e,n+"y"),s=i=>{if(i.offset>=i.src.length)return i.err(void 0);r.lastIndex=i.offset;const o=t(i.src.match(r));return o?i.ok(o,r.lastIndex-i.offset):o===""?i.ok(void 0):(D(i),i.err(void 0))};return new S(s,I("regex",void 0,e))}const wn=/\s*/y,kn=e=>{if(e.offset>=e.src.length)return e;wn.lastIndex=e.offset;const t=e.src.match(wn)?.[0]??"";return e.ok(e.value,t.length)},w=G(/\s*/);w.context.name="whitespace";const p=e=>{const t=new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"i");return G(t)},Lt=G(/-?[a-zA-Z][a-zA-Z0-9-]*/),Le=p("none"),Ms=G(/-?\d+/).map(Number),it=G(/-?(0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?/).map(Number);function Is(e){return new S(t=>t.ok(e,0))}function Bs(e){return new S(t=>t.err(void 0,0))}function et(e,t){const n=e.parseState(t);if(n.isError)throw new Error(`Parse error at offset ${n.offset}`);return n.value}function N(e,t){const[n,r,s]=e;return[t[0]*n+t[1]*r+t[2]*s,t[3]*n+t[4]*r+t[5]*s,t[6]*n+t[7]*r+t[8]*s]}function lt(e){const[t,n,r,s,i,o,a,c,l]=e,u=i*l-o*c,h=-(s*l-o*a),b=s*c-i*a,y=1/(t*u+n*h+r*b);return[u*y,(r*c-n*l)*y,(n*o-r*i)*y,h*y,(t*l-r*a)*y,(r*s-t*o)*y,b*y,(n*a-t*c)*y,(t*i-n*s)*y]}const F=255,m={"%":{min:0,max:100},number:{min:0,max:1}},me={"%":m["%"],number:{min:0,max:F}},L={"%":m["%"],number:m.number},$t={deg:{min:0,max:360},number:{min:0,max:360},"%":m["%"]},f={rgb:{r:me,g:me,b:me,alpha:m},hsl:{h:$t,s:{"%":m["%"],number:m.number},l:{"%":m["%"],number:m.number},alpha:m},hsv:{h:$t,s:{"%":m["%"],number:m.number},v:{"%":m["%"],number:m.number},alpha:m},hwb:{h:$t,w:{"%":m["%"],number:m.number},b:{"%":m["%"],number:m.number},alpha:m},lab:{l:{"%":m["%"],number:m["%"]},a:{number:{min:-125,max:125},"%":{min:-100,max:100}},b:{number:{min:-125,max:125},"%":{min:-100,max:100}},alpha:m},lch:{l:{"%":m["%"],number:m["%"]},c:{number:{min:0,max:150},"%":m["%"]},h:$t,alpha:m},oklab:{l:{"%":m["%"],number:m["%"]},a:{number:{min:-.4,max:.4},"%":{min:-100,max:100}},b:{number:{min:-.4,max:.4},"%":{min:-100,max:100}},alpha:m},oklch:{l:{"%":m["%"],number:m["%"]},c:{number:{min:0,max:.5},"%":m["%"]},h:$t,alpha:m},xyz:{x:{"%":m["%"],number:m.number},y:{"%":m["%"],number:m.number},z:{"%":m["%"],number:m.number},alpha:m},kelvin:{kelvin:{number:{min:1e3,max:4e4}},alpha:m},"srgb-linear":{r:L,g:L,b:L,alpha:m},"display-p3":{r:L,g:L,b:L,alpha:m},"a98-rgb":{r:L,g:L,b:L,alpha:m},"prophoto-rgb":{r:L,g:L,b:L,alpha:m},rec2020:{r:L,g:L,b:L,alpha:m}},W="%",Ts={rgb:{r:"",g:"",b:"",alpha:W},hsl:{h:"deg",s:"%",l:"%",alpha:W},hsv:{h:"deg",s:"%",v:"%",alpha:W},hwb:{h:"deg",w:"%",b:"%",alpha:W},lab:{l:"%",a:"",b:"",alpha:W},lch:{l:"%",c:"",h:"deg",alpha:W},oklab:{l:"%",a:"",b:"",alpha:W},oklch:{l:"%",c:"",h:"deg",alpha:W},xyz:{x:"%",y:"%",z:"%",alpha:W},kelvin:{kelvin:"K",alpha:W},"srgb-linear":{r:"",g:"",b:"",alpha:W},"display-p3":{r:"",g:"",b:"",alpha:W},"a98-rgb":{r:"",g:"",b:"",alpha:W},"prophoto-rgb":{r:"",g:"",b:"",alpha:W},rec2020:{r:"",g:"",b:"",alpha:W}},Ps=[.3127/.329,1,(1-.3127-.329)/.329],Os=[.3457/.3585,1,(1-.3457-.3585)/.3585],We=[1.0479297925449969,.022946870601609652,-.05019226628920524,.02962780877005599,.9904344267538799,-.017073799063418826,-.009243040646204504,.015055191490298152,.7518742814281371],pr=lt(We),mr={D65:Ps,D50:Os},fr=[.819022437996703,.3619062600528904,-.1288737815209879,.0329836539323885,.9292868615863434,.0361446663506424,.0481771893596242,.2642395317527308,.6335478284694309],zs=lt(fr),dr=[.210454268309314,.7936177747023054,-.0040720430116193,1.9779985324311684,-2.42859224204858,.450593709617411,.0259040424655478,.7827717124575296,-.8086757549230774],Ns=lt(dr),k=[4.0767416621,-3.3077115913,.2309699292,-1.2684380046,2.6097574011,-.3413193965,-.0041960863,-.7034186147,1.707614701],nt=[.4122214708,.5363325363,.0514459929,.2119034982,.6806995451,.1073969566,.0883024619,.2817188376,.6299787005],V={l:[1,.3963377774,.2158037573],m:[1,-.1055613458,-.0638541728],s:[1,-.0894841775,-1.291485548]},$s=[{test:(e,t)=>-1.88170328*e-.80936493*t>1,k0:1.19086277,k1:1.76576728,k2:.59662641,k3:.75515197,k4:.56771245,wl:4.0767416621,wm:-3.3077115913,ws:.2309699292},{test:(e,t)=>1.81444104*e-1.19445276*t>1,k0:.73956515,k1:-.45954404,k2:.08285427,k3:.1254107,k4:.14503204,wl:-1.2684380046,wm:2.6097574011,ws:-.3413193965},{test:()=>!0,k0:1.35733652,k1:-.00915799,k2:-1.1513021,k3:-.50559606,k4:.00692167,wl:-.0041960863,wm:-.7034186147,ws:1.707614701}],yn={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"rgba(0, 0, 0, 0)",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32",padaleckipink:"oklch(100% 0.42 360deg / 71.70%)","lodge-blu-color":"rgb(53 101 144)",lavendi:"oklch(79.90% 0.11 318.24deg / 100%)",shadyshroom:"oklch(53% 0.07 21.60deg / 100%)",patriarchalplum:"oklch(31.20% 0.11 19.80deg / 100%)"};function J(e,t,n){return Math.min(Math.max(e,t),n)}function E(e,t,n,r=0,s=1){const i=(s-r)/(n-t);if(n===t)throw new Error("fromMax and fromMin cannot be equal");return(e-t)*i+r}function Tt(e,t,n){return(1-e)*t+e*n}function Gt(e,t){const n=t.length-1,r=[...t];for(let s=1;s<=n;s++)for(let i=0;i<=n-s;i++)r[i]=Tt(e,r[i],r[i+1]);return r[0]}function Fs(e,t,n,r,s){return[Gt(e,[0,t,r,1]),Gt(e,[0,n,s,1])]}function re(e,t){const n=t.map(s=>s[0]),r=t.map(s=>s[1]);return[Gt(e,n),Gt(e,r)]}const br=2.4,Ht=.055,De=12.92,As=.04045,gr=As/De;function fe(e){const t=e<0?-1:1,n=e*t;return n<=gr?e/De:t*((n+Ht)/(1+Ht))**br}function de(e){const t=e<0?-1:1,n=e*t;return n<=gr?e*De:t*((1+Ht)*n**(1/br)-Ht)}function be(e,t,n){return Math.min(Math.max(e,t),n)}function Ue(e,t,n){const r=e+V.l[1]*t+V.l[2]*n,s=e+V.m[1]*t+V.m[2]*n,i=e+V.s[1]*t+V.s[2]*n,o=r*r*r,a=s*s*s,c=i*i*i;return[k[0]*o+k[1]*a+k[2]*c,k[3]*o+k[4]*a+k[5]*c,k[6]*o+k[7]*a+k[8]*c]}function Vs(e,t,n){return e>=0&&e<=1&&t>=0&&t<=1&&n>=0&&n<=1}function Rs(e,t){const n=$s.find(v=>v.test(e,t)),{k0:r,k1:s,k2:i,k3:o,k4:a,wl:c,wm:l,ws:u}=n;let h=r+s*e+i*t+o*e*e+a*e*t;const b=V.l[1]*e+V.l[2]*t,y=V.m[1]*e+V.m[2]*t,z=V.s[1]*e+V.s[2]*t;{const v=1+h*b,$=1+h*y,x=1+h*z,M=v*v*v,j=$*$*$,ht=x*x*x,pt=3*b*v*v,mt=3*y*$*$,Pt=3*z*x*x,Ot=6*b*b*v,zt=6*y*y*$,Nt=6*z*z*x,xt=c*M+l*j+u*ht,ft=c*pt+l*mt+u*Pt,Ut=c*Ot+l*zt+u*Nt;h=h-xt*ft/(ft*ft-.5*xt*Ut)}return h}function js(e,t){const n=Rs(e,t),[r,s,i]=Ue(1,n*e,n*t),o=Math.cbrt(1/Math.max(r,s,i)),a=o*n;return{L:o,C:a}}function Ls(e,t,n,r,s,i){let o;if((n-s)*i.C-(i.L-s)*r<=0)o=i.C*s/(r*i.L+i.C*(s-n));else{o=i.C*(s-1)/(r*(i.L-1)+i.C*(s-n));const a=n-s,c=r,l=V.l[1]*e+V.l[2]*t,u=V.m[1]*e+V.m[2]*t,h=V.s[1]*e+V.s[2]*t,b=a+c*l,y=a+c*u,z=a+c*h;{const v=s*(1-o)+o*n,$=o*r,x=v+$*l,M=v+$*u,j=v+$*h,ht=x*x*x,pt=M*M*M,mt=j*j*j,Pt=3*b*x*x,Ot=3*y*M*M,zt=3*z*j*j,Nt=6*b*b*x,xt=6*y*y*M,ft=6*z*z*j,Ut=k[0]*ht+k[1]*pt+k[2]*mt-1,ae=k[0]*Pt+k[1]*Ot+k[2]*zt,is=k[0]*Nt+k[1]*xt+k[2]*ft,an=ae/(ae*ae-.5*Ut*is);let ce=-Ut*an;const cn=k[3]*ht+k[4]*pt+k[5]*mt-1,le=k[3]*Pt+k[4]*Ot+k[5]*zt,os=k[3]*Nt+k[4]*xt+k[5]*ft,ln=le/(le*le-.5*cn*os);let ue=-cn*ln;const un=k[6]*ht+k[7]*pt+k[8]*mt-1,he=k[6]*Pt+k[7]*Ot+k[8]*zt,as=k[6]*Nt+k[7]*xt+k[8]*ft,hn=he/(he*he-.5*un*as);let pe=-un*hn;ce=an>=0?ce:1/0,ue=ln>=0?ue:1/0,pe=hn>=0?pe:1/0,o+=Math.min(ce,ue,pe)}}return o}const Ws=1e-5,Ds=.05;function Us(e,t,n){const[r,s,i]=Ue(e,t,n);if(Vs(r,s,i))return[e,t,n];const o=Math.max(Ws,Math.sqrt(t*t+n*n)),a=t/o,c=n/o,l=js(a,c),u=e-.5,h=.5+Math.abs(u)+Ds*o,b=.5*(1+Math.sign(u)*(h-Math.sqrt(h*h-2*Math.abs(u)))),y=Ls(a,c,e,o,b,l),z=b*(1-y)+y*e,v=y*o;return[z,v*a,v*c]}function qs(e,t,n){const r=fe(e),s=fe(t),i=fe(n),o=Math.cbrt(nt[0]*r+nt[1]*s+nt[2]*i),a=Math.cbrt(nt[3]*r+nt[4]*s+nt[5]*i),c=Math.cbrt(nt[6]*r+nt[7]*s+nt[8]*i);return[.2104542553*o+.793617785*a-.0040720468*c,1.9779984951*o-2.428592205*a+.4505937099*c,.0259040371*o+.7827717662*a-.808675766*c]}function Ks(e,t,n){if(e>=0&&e<=1&&t>=0&&t<=1&&n>=0&&n<=1)return[e,t,n];const[r,s,i]=qs(e,t,n),[o,a,c]=Us(r,s,i),[l,u,h]=Ue(o,a,c);return[be(de(l),0,1),be(de(u),0,1),be(de(h),0,1)]}const at=16,Xs=e=>{if(e=e.slice(1),e.length<=4){const t=parseInt(e[0]+e[0],at),n=parseInt(e[1]+e[1],at),r=parseInt(e[2]+e[2],at),s=e[3]?parseInt(e[3]+e[3],at)/F:1;return new q(t,n,r,s)}else{const t=parseInt(e.slice(0,2),at),n=parseInt(e.slice(2,4),at),r=parseInt(e.slice(4,6),at),s=e.length===8?parseInt(e.slice(6,8),at)/F:1;return new q(t,n,r,s)}},wr=1e3,kr=4e4,yr=100,xr=({kelvin:e,alpha:t})=>{e=J(e,wr,kr)/yr;let n,r,s;return e<=66?n=F:(n=e-60,n=329.698727446*n**-.1332047592),n=J(n,0,F)/F,e<=66?(r=e,r=99.4708025861*Math.log(r)-161.1195681661):(r=e-60,r=288.1221695283*r**-.0755148492),r=J(r,0,F)/F,e>=66?s=F:e<=19?s=0:(s=e-10,s=138.5177312231*Math.log(s)-305.0447927307),s=J(s,0,F)/F,new q(n,r,s,t)},Ys=({r:e,g:t,b:n,alpha:r})=>{e=J(e*F,0,F),t=J(t*F,0,F),n=J(n*F,0,F);let s;if(n===F?s=6600:n===0?s=1900:s=Math.exp((n+305.0447927307)/138.5177312231)+10,e<F){const o=(329.698727446/e)**-7.507239275877164+60;s=Math.max(s,o)}const i=s<=6600?Math.exp((t+161.1195681661)/99.4708025861):(288.1221695283/t)**(1/-.0755148492)+60;return s=(s+i)/2,s=J(Math.round(s*yr),wr,kr),new sr(s,r)},Sr=({h:e,s:t,v:n,alpha:r})=>{const s=n-n*t/2;let i;return s===0||s===1?i=0:i=(n-s)/Math.min(s,1-s),new jt(e,i,s,r)},vr=({h:e,s:t,l:n,alpha:r})=>{const s=n+t*Math.min(n,1-n);let i;return s===0?i=0:i=2*(1-n/s),new Oe(e,i,s,r)},Gs=({h:e,w:t,b:n,alpha:r})=>{let s,i;const o=t+n;return o>=1?(i=t/o,s=0):(i=1-n,s=i===0?0:1-t/i),Sr(new Oe(e,s,i,r))},Hs=({h:e,s:t,l:n,alpha:r})=>{const{h:s,s:i,v:o}=vr(new jt(e,t,n,r));return new ze(s,o*(1-i),1-o,r)},Zs=({r:e,g:t,b:n,alpha:r})=>{const s=Math.max(e,t,n),i=Math.min(e,t,n);let[o,a,c]=[0,0,(s+i)/2];const l=s-i;switch(a=l/(1-Math.abs(2*c-1)),s){case e:o=(t-n)/l+(t<n?6:0);break;case t:o=(n-e)/l+2;break;case n:o=(e-t)/l+4;break}return o/=6,a<0&&(o=(o+.5)%1,a=Math.abs(a)%1),o>=1&&(o-=1),new jt(o,a,c,r)};function Js({h:e,s:t,l:n,alpha:r}){const s=(1-Math.abs(2*n-1))*t,i=s*(1-Math.abs(e*6%2-1)),o=n-s/2;let a,c,l;return e<1/6?[a,c,l]=[s,i,0]:e<2/6?[a,c,l]=[i,s,0]:e<3/6?[a,c,l]=[0,s,i]:e<4/6?[a,c,l]=[0,i,s]:e<5/6?[a,c,l]=[i,0,s]:[a,c,l]=[s,0,i],new q(a+o,c+o,l+o,r)}const Qs=216/24389,_s=24/116,Se=24389/27,ti=8,Vt=16,Rt=116,Cr=500,Er=200;function ei(e){if(e.whitePoint==="D50")return[e.x,e.y,e.z];if(e.whitePoint==="D65")return N([e.x,e.y,e.z],We);throw new Error(`Unsupported white point: ${e.whitePoint}`)}function ni(e){if(e.whitePoint==="D65")return[e.x,e.y,e.z];if(e.whitePoint==="D50")return N([e.x,e.y,e.z],pr);throw new Error(`Unsupported white point: ${e.whitePoint}`)}function Mr(e,t="D50"){const n=x=>x>Qs?Math.cbrt(x):(Se*x+Vt)/Rt,r=mr[t],[s,i,o]=ei(e),a=s/r[0],c=i/r[1],l=o/r[2],u=n(a),h=n(c),b=n(l),y=Rt*h-Vt,z=Cr*(u-h),v=Er*(h-b),$=new ee(E(y,f.lab.l.number.min,f.lab.l.number.max),E(z,f.lab.a.number.min,f.lab.a.number.max),E(v,f.lab.b.number.min,f.lab.b.number.max),e.alpha);return $.whitePoint=t,$}function Ir(e){const t=M=>M>_s?M**3:(Rt*M-Vt)/Se,n=M=>M>ti?((M+Vt)/Rt)**3:M/Se,r=mr[e.whitePoint];let{l:s,a:i,b:o,alpha:a}=e;s=E(s,0,1,f.lab.l.number.min,f.lab.l.number.max),i=E(i,0,1,f.lab.a.number.min,f.lab.a.number.max),o=E(o,0,1,f.lab.b.number.min,f.lab.b.number.max);const c=(s+Vt)/Rt,l=i/Cr+c,u=c-o/Er,[h,b,y]=[t(l),n(s),t(u)];let z=h*r[0],v=b*r[1],$=y*r[2];const x=new Y(z,v,$,a);return x.whitePoint=e.whitePoint,[z,v,$]=ni(x),x.whitePoint="D65",x.x=z,x.y=v,x.z=$,x}const qe=[.41239079926595934,.357584339383878,.1804807884018343,.21263900587151027,.715168678767756,.07219231536073371,.01933081871559182,.11919477979462598,.9505321522496607],Br=lt(qe),Tr=2.4,Zt=.055,Ke=12.92,ri=.04045,Pr=ri/Ke;function Ct(e){const t=e<0?-1:1,n=e*t;return n<=Pr?e/Ke:t*((n+Zt)/(1+Zt))**Tr}function Or(e){const t=e<0?-1:1,n=e*t;return n<=Pr?e*Ke:t*((1+Zt)*n**(1/Tr)-Zt)}function Xe({r:e,g:t,b:n,alpha:r}){const s=[Ct(e),Ct(t),Ct(n)],[i,o,a]=N(s,qe);return new Y(i,o,a,r)}const Ye=({x:e,y:t,z:n,alpha:r},s=!0)=>{const i=N([e,t,n],Br),[o,a,c]=i.map(Or);if(s){const l=Fi(new q(o,a,c,r));return new q(l.r,l.g,l.b,r)}else return new q(o,a,c,r)};function si({l:e,c:t,h:n,alpha:r}){t=E(t,0,1,f.lch.c.number.min,f.lch.c.number.max);const s=n*2*Math.PI,i=Math.cos(s)*t,o=Math.sin(s)*t;return new ee(e,E(i,f.lab.a.number.min,f.lab.a.number.max),E(o,f.lab.b.number.min,f.lab.b.number.max),r)}function ii({l:e,a:t,b:n,alpha:r}){t=E(t,0,1,f.lab.a.number.min,f.lab.a.number.max),n=E(n,0,1,f.lab.b.number.min,f.lab.b.number.max);const s=Math.hypot(t,n);let i=Math.atan2(n,t)/(2*Math.PI);return i<0&&(i+=1),new Ne(e,E(s,f.lch.c.number.min,f.lch.c.number.max),i,r)}function zr({l:e,a:t,b:n,alpha:r}){t=E(t,0,1,f.oklab.a.number.min,f.oklab.a.number.max),n=E(n,0,1,f.oklab.b.number.min,f.oklab.b.number.max);const s=N([e,t,n],Ns),i=[s[0]*s[0]*s[0],s[1]*s[1]*s[1],s[2]*s[2]*s[2]],[o,a,c]=N(i,zs);return new Y(o,a,c,r)}function Nr(e){const{x:t,y:n,z:r}=e,s=N([t,n,r],fr),i=[Math.cbrt(s[0]),Math.cbrt(s[1]),Math.cbrt(s[2])],[o,a,c]=N(i,dr);return new ne(o,E(a,f.oklab.a.number.min,f.oklab.a.number.max),E(c,f.oklab.b.number.min,f.oklab.b.number.max),e.alpha)}function oi({l:e,a:t,b:n,alpha:r}){t=E(t,0,1,f.oklab.a.number.min,f.oklab.a.number.max),n=E(n,0,1,f.oklab.b.number.min,f.oklab.b.number.max);const s=Math.hypot(t,n);let i=Math.atan2(n,t)/(2*Math.PI);return i<0&&(i+=1),new $e(e,E(s,f.oklch.c.number.min,f.oklch.c.number.max),i,r)}function ai({l:e,c:t,h:n,alpha:r}){t=E(t,0,1,f.oklch.c.number.min,f.oklch.c.number.max);const s=n*2*Math.PI,i=Math.cos(s)*t,o=Math.sin(s)*t;return new ne(e,E(i,f.oklab.a.number.min,f.oklab.a.number.max),E(o,f.oklab.b.number.min,f.oklab.b.number.max),r)}function Ge(e){const t=Js(e);return Xe(t)}function He(e){const t=Ye(e);return Zs(t)}function ci(e){const t=Sr(e);return Ge(t)}function li(e){const t=He(e);return vr(t)}function ui(e){const t=Gs(e);return Ge(t)}function hi(e){const t=He(e);return Hs(t)}function pi(e){const t=si(e);return Ir(t)}function mi(e){const t=Mr(e);return ii(t)}function fi(e){const t=ai(e);return zr(t)}function di(e){const t=Nr(e);return oi(t)}function bi(e){const t=xr(e);return Xe(t)}function gi(e){const t=Ye(e);return Ys(t)}const $r=563/256;function ge(e){return(e<0?-1:1)*Math.abs(e)**$r}function wi(e){return(e<0?-1:1)*Math.abs(e)**(1/$r)}const Fr=1/512,Ar=1.8;function we(e){const t=e<0?-1:1,n=Math.abs(e);return t*(n<=Fr*16?n/16:n**Ar)}function ki(e){const t=e<0?-1:1,n=Math.abs(e);return t*(n>=Fr?n**(1/Ar):n*16)}const Jt=1.09929682680944,Vr=.018053968510807;function ke(e){const t=e<0?-1:1,n=Math.abs(e);return n<Vr*4.5?t*n/4.5:t*((n+Jt-1)/Jt)**(1/.45)}function yi(e){const t=e<0?-1:1,n=Math.abs(e);return n>=Vr?t*(Jt*n**.45-(Jt-1)):t*4.5*n}const Rr=[.4865709486482162,.26566769316909306,.1982172852343625,.22897456406974884,.6917385218365064,.079286914093745,0,.04511338185890264,1.043944368900976],xi=lt(Rr),jr=[.5766690429101305,.1855582379065463,.1882286462349947,.29734497525053605,.6273635662554661,.07529145849399788,.02703136138641234,.07068885253582723,.9913375368376388],Si=lt(jr),Lr=[.7977604896723027,.13518583717574031,.0313493495815248,.2880711282292934,.7118432178101014,8565396060525902e-20,0,0,.8251046025104602],vi=lt(Lr),Wr=[.6369580483012914,.14461690358620832,.1688809751641721,.2627002120112671,.6779980715188708,.05930171646986196,0,.028072693049087428,1.0609850577107909],Ci=lt(Wr);function Ei({r:e,g:t,b:n,alpha:r}){const[s,i,o]=N([e,t,n],qe);return new Y(s,i,o,r)}function Mi({x:e,y:t,z:n,alpha:r}){const[s,i,o]=N([e,t,n],Br);return new Fe(s,i,o,r)}function Ii({r:e,g:t,b:n,alpha:r}){const s=[Ct(e),Ct(t),Ct(n)],[i,o,a]=N(s,Rr);return new Y(i,o,a,r)}function Bi({x:e,y:t,z:n,alpha:r}){const s=N([e,t,n],xi),[i,o,a]=s.map(Or);return new Ae(i,o,a,r)}function Ti({r:e,g:t,b:n,alpha:r}){const s=[ge(e),ge(t),ge(n)],[i,o,a]=N(s,jr);return new Y(i,o,a,r)}function Pi({x:e,y:t,z:n,alpha:r}){const s=N([e,t,n],Si),[i,o,a]=s.map(wi);return new Ve(i,o,a,r)}function Oi({r:e,g:t,b:n,alpha:r}){const s=[we(e),we(t),we(n)],i=N(s,Lr),[o,a,c]=N(i,pr);return new Y(o,a,c,r)}function zi({x:e,y:t,z:n,alpha:r}){const s=N([e,t,n],We),i=N(s,vi),[o,a,c]=i.map(ki);return new Re(o,a,c,r)}function Ni({r:e,g:t,b:n,alpha:r}){const s=[ke(e),ke(t),ke(n)],[i,o,a]=N(s,Wr);return new Y(i,o,a,r)}function $i({x:e,y:t,z:n,alpha:r}){const s=N([e,t,n],Ci),[i,o,a]=s.map(yi);return new je(i,o,a,r)}const xn={rgb:{to:Xe,from:Ye},hsl:{to:Ge,from:He},hsv:{to:ci,from:li},hwb:{to:ui,from:hi},lab:{to:Ir,from:Mr},lch:{to:pi,from:mi},oklab:{to:zr,from:Nr},oklch:{to:fi,from:di},kelvin:{to:bi,from:gi},xyz:{to:e=>e,from:e=>e},"srgb-linear":{to:Ei,from:Mi},"display-p3":{to:Ii,from:Bi},"a98-rgb":{to:Ti,from:Pi},"prophoto-rgb":{to:Oi,from:zi},rec2020:{to:Ni,from:$i}};function yt(e,t){if(e.colorSpace===t)return e;const n=xn[e.colorSpace];if(!n)throw new Error(`Unknown source color space: "${e.colorSpace}"`);const r=xn[t];if(!r)throw new Error(`Unknown target color space: "${t}"`);const s=n.to(e),i=r.from;return i(s)}const St=1e-6;function Fi(e){const t=yt(e,"rgb"),n=Number.isNaN(t.r)?0:t.r,r=Number.isNaN(t.g)?0:t.g,s=Number.isNaN(t.b)?0:t.b;if(n>=0&&n<=1&&r>=0&&r<=1&&s>=0&&s<=1)return e;if(n>=-St&&n<=1+St&&r>=-St&&r<=1+St&&s>=-St&&s<=1+St){const l=new q(J(n,0,1),J(r,0,1),J(s,0,1),e.alpha);return yt(l,e.colorSpace)}const[i,o,a]=Ks(n,r,s),c=new q(i,o,a,e.alpha);return yt(c,e.colorSpace)}const Ai={hsl:"h",hsv:"h",hwb:"h",lch:"h",oklch:"h"};function Vi(e,t,n,r="shorter"){if(Number.isNaN(e)&&Number.isNaN(t))return 0;if(Number.isNaN(e))return t;if(Number.isNaN(t))return e;let s=t-e;switch(r){case"shorter":s>.5?e+=1:s<-.5&&(t+=1);break;case"longer":s>0&&s<.5?e+=1:s>-.5&&s<=0&&(t+=1);break;case"increasing":s<0&&(t+=1);break;case"decreasing":s>0&&(e+=1);break}let i=e+n*(t-e);return i=(i%1+1)%1,i}function Ri(e,t,n,r,s="oklab",i="shorter"){const o=yt(e,s),a=yt(t,s);n<0&&(n=0),r<0&&(r=0);const c=n+r;c===0?(n=.5,r=.5):c!==1&&(n=n/c,r=r/c);const l=Math.min(c,1),u=Ai[s],h=o.keys().filter(x=>x!=="alpha"),b=Number.isNaN(o.alpha)?a.alpha:o.alpha,y=Number.isNaN(a.alpha)?o.alpha:a.alpha,z=Tt(r,b,y)*l,v=[];for(const x of h){let M=o[x],j=a[x];if(Number.isNaN(M)&&Number.isNaN(j)){v.push(0);continue}if(Number.isNaN(M)&&(M=j),Number.isNaN(j)&&(j=M),x===u)v.push(Vi(M,j,r,i));else{const ht=M*b,pt=j*y,mt=Tt(r,ht,pt);v.push(z>0?mt/z:0)}}const $=o.constructor;return new $(...v,z)}const ji=(e,t,n)=>{const r=f[t][n];return r[e]??r.number},Li=(e,t,n,r,s=!1)=>{t=s?Ts[n][r]:t;const{min:i,max:o}=ji(t,n,r),[a,c,l,u]=s?[i,o,0,1]:[0,1,i,o],h=E(e,l,u,a,c);return new d(h,s?t:"")},Wi=(e,t=!1)=>{const n=e.colorSpace;return e.keys().forEach(r=>{const s=e[r]instanceof d?e[r].value:e[r];e[r]=Li(s,e[r]?.unit,n,r,t)}),e},ve=(e,t=!1,n=!1)=>{e=n?e:e.clone();const r=Wi(e.value,t);return n?e:new d(r).coalesce(e,!0)},Sn=(e,t="lab",n=!1,r=!1,s=!1)=>{const i=n?s?e:e.clone():ve(e,!1,s),o=yt(i.toJSON(),t);return o.entries().forEach(([a,c])=>{o[a]=new d(c)}),i.value=o,i.superType[1]=t,r?ve(i,!0,!0):i},Di=(e,t,n="lab",r=!1,s=!1,i=!1)=>[Sn(e,n,r,s,i),Sn(t,n,r,s,i)],K=e=>new d(e,"color",["color",e.colorSpace],void 0,"color");function Ce(e){const t=ve(e).value,n=t.clone();for(const r of t.keys()){const s=t[r];n[r]=s instanceof d?s.value:s}return n}function Ui(e){const t=e.replace(/[^0-9.+\-*/() e]/g,"");return new Function(`return (${t})`)()}function vn(e,t){switch(e.type){case"ref":return t[e.name]??0;case"literal":return e.value;case"none":return NaN;case"calc":{let n=e.expr;const r=Object.keys(t).sort((s,i)=>i.length-s.length);for(const s of r)n=n.replace(new RegExp(`\\b${s}\\b`,"g"),String(t[s]));return Ui(n)}}}function qi(e,t,n,r){const s=Ce(e),i=yt(s,t),o={};for(const[h,b]of i.entries())o[h]=b;const a=n.map(h=>vn(h,o)),c=r?vn(r,o):o.alpha??1,l={rgb:q,hsl:jt,hwb:ze,lab:ee,lch:Ne,oklab:ne,oklch:$e,xyz:Y,"srgb-linear":Fe,"display-p3":Ae,"a98-rgb":Ve,"prophoto-rgb":Re,rec2020:je}[t]??q,u=new l(...a,c);return K(u)}const Ki={srgb:"rgb","srgb-linear":"srgb-linear","display-p3":"display-p3","a98-rgb":"a98-rgb","prophoto-rgb":"prophoto-rgb",rec2020:"rec2020",lab:"lab",oklab:"oklab",oklch:"oklch",hsl:"hsl",hwb:"hwb",lch:"lch",xyz:"xyz","xyz-d65":"xyz","xyz-d50":"xyz"},Xi={srgb:{space:"rgb",ctor:q},"srgb-linear":{space:"srgb-linear",ctor:Fe},"display-p3":{space:"display-p3",ctor:Ae},"a98-rgb":{space:"a98-rgb",ctor:Ve},"prophoto-rgb":{space:"prophoto-rgb",ctor:Re},rec2020:{space:"rec2020",ctor:je},xyz:{space:"xyz",ctor:Y},"xyz-d65":{space:"xyz",ctor:Y},"xyz-d50":{space:"xyz",ctor:Y}},Yi=O(","),Gi=G(/\s+/),Ze=O("/"),se=O("("),ie=O(")"),Ee=g(Yi.trim(w),Gi),Hi=g(Ze.trim(w),Ee),tt=S.lazy(()=>g(A.Percentage,A.Angle.map(e=>{const t=cr(e.value,e.unit);return new d(t,"deg",["angle"])}),g(it,Ms).map(e=>new d(e)),Le.map(()=>new d(NaN)))),Kt=g(p("calc").next(G(/\(([^)]+)\)/,e=>e?.[1]??null)).map(e=>({type:"calc",expr:e})),Le.map(()=>({type:"none"})),G(/\b(alpha|r|g|b|h|s|l|c|w|a|x|y|z)\b/).map(e=>({type:"ref",name:e})),tt.map(e=>({type:"literal",value:e.value}))),ot=e=>{const t=O(e).skip(p("a").opt()),n=g(T(tt.skip(Hi),tt),tt.map(s=>[s])),r=T(tt.skip(Ee),tt.skip(Ee),n).trim(w).wrap(se,ie);return t.next(r).map(([s,i,[o,a]])=>[s,i,o,a??new d(1)])};function ut(e,t){return O(e).skip(p("a").opt()).next(T(p("from").skip(w).next(S.lazy(()=>Je.Value)),w.next(Kt),w.next(Kt),w.next(Kt),Ze.trim(w).next(Kt).opt()).trim(w).wrap(se,ie)).map(([n,r,s,i,o])=>qi(n,t,[r,s,i],o))}const Zi=G(/#[0-9a-fA-F]{3,8}/).map(e=>{const{r:t,g:n,b:r,alpha:s}=Xs(e);return K(new q(t,n,r,s))}),Ji=it.skip(p("k")).map(e=>{const t=xr(new sr(e));return K(t)}),Qi=g(ut("rgb","rgb"),ot("rgb").map(([e,t,n,r])=>K(new q(e,t,n,r)))),_i=g(ut("hsl","hsl"),ot("hsl").map(([e,t,n,r])=>K(new jt(e,t,n,r)))),to=ot("hsv").map(([e,t,n,r])=>K(new Oe(e,t,n,r))),eo=g(ut("hwb","hwb"),ot("hwb").map(([e,t,n,r])=>K(new ze(e,t,n,r)))),no=g(ut("lab","lab"),ot("lab").map(([e,t,n,r])=>K(new ee(e,t,n,r)))),ro=g(ut("lch","lch"),ot("lch").map(([e,t,n,r])=>K(new Ne(e,t,n,r)))),so=g(ut("oklab","oklab"),ot("oklab").map(([e,t,n,r])=>K(new ne(e,t,n,r)))),io=g(ut("oklch","oklch"),ot("oklch").map(([e,t,n,r])=>K(new $e(e,t,n,r)))),oo=g(ut("xyz","xyz"),ot("xyz").map(([e,t,n,r])=>K(new Y(e,t,n,r)))),ao=g(p("srgb-linear").map(()=>"srgb-linear"),p("srgb").map(()=>"srgb"),p("display-p3").map(()=>"display-p3"),p("a98-rgb").map(()=>"a98-rgb"),p("prophoto-rgb").map(()=>"prophoto-rgb"),p("rec2020").map(()=>"rec2020"),p("oklab").map(()=>"oklab"),p("oklch").map(()=>"oklch"),p("lab").map(()=>"lab"),p("lch").map(()=>"lch"),p("hsl").map(()=>"hsl"),p("hwb").map(()=>"hwb"),p("xyz-d65").map(()=>"xyz-d65"),p("xyz-d50").map(()=>"xyz-d50"),p("xyz").map(()=>"xyz")),co=g(p("shorter"),p("longer"),p("increasing"),p("decreasing")).skip(w).skip(p("hue")),Cn=S.lazy(()=>T(Je.Value,w.next(A.Percentage).opt())),lo=p("color-mix").next(T(p("in").skip(w).next(T(ao,w.next(co).opt())),O(",").trim(w).next(Cn),O(",").trim(w).next(Cn)).trim(w).wrap(se,ie)).map(([[e,t],[n,r],[s,i]])=>{const o=Ki[e]??"oklab",a=t??"shorter";let c=r!=null?r.value/100:-1,l=i!=null?i.value/100:-1;c<0&&l<0?(c=.5,l=.5):c<0?c=1-l:l<0&&(l=1-c);const u=Ce(n),h=Ce(s),b=Ri(u,h,c,l,o,a);return K(b)}),uo=g(p("srgb-linear").map(()=>"srgb-linear"),p("srgb").map(()=>"srgb"),p("display-p3").map(()=>"display-p3"),p("a98-rgb").map(()=>"a98-rgb"),p("prophoto-rgb").map(()=>"prophoto-rgb"),p("rec2020").map(()=>"rec2020"),p("xyz-d65").map(()=>"xyz-d65"),p("xyz-d50").map(()=>"xyz-d50"),p("xyz").map(()=>"xyz")),ho=p("color").next(T(uo.skip(w),tt.skip(w),tt.skip(w),g(T(tt.skip(Ze.trim(w)),tt),tt.map(e=>[e,void 0]))).trim(w).wrap(se,ie)).map(([e,t,n,[r,s]])=>{const i=Xi[e];if(!i)throw new Error(`Unknown color() space: ${e}`);const o=s??new d(1);if(e==="srgb"){const c=l=>l.value*255;return K(new q(c(t),c(n),c(r),o.value))}const a=new i.ctor(t,n,r,o);return K(a)}),po=g(...Object.keys(yn).sort((e,t)=>t.length-e.length).map(p)).chain(e=>{const t=yn[e.toLowerCase()];if(t){const n=oe(t);if(n)return Is(n)}return Bs()}),mo=g(lo,ho,Zi,Ji,Qi,_i,to,eo,no,ro,so,io,oo,po).trim(w),Je={Value:mo},fo=g(...hs.map(p)),bo=g(...ms.map(p)),go=g(...ps.map(p)),wo=g(...ds.map(p)),ko=g(...fs.map(p)),yo=O(","),xo=O(" ");g(yo,xo).trim(w);const Dr=T(it,fo).map(([e,t])=>{const n=["length"];return rr.includes(t)?n.push("relative"):nr.includes(t)&&n.push("absolute"),new d(e,t,n)}),Ur=T(it,bo).map(([e,t])=>new d(e,t,["angle"])),Qe=T(it,go).map(([e,t])=>new d(e,t,["time"])),So=S.lazy(()=>g(_e,Qe)),vo=T(it,wo).map(([e,t])=>new d(e,t,["resolution"])),_e=g(T(it,ko),p("from").map(()=>[0,"%"]),p("to").map(()=>[100,"%"])).map(([e,t])=>new d(e,t,["percentage"])),qr=S.lazy(()=>Je.Value),Co=O("/").trim(w).map(()=>new d("/","string")),Kr=g(Dr,Ur,Qe,vo,_e,qr,Co,it.map(e=>new d(e)),Le.map(()=>new d(NaN))).trim(w),A={Length:Dr,Angle:Ur,Time:Qe,TimePercentage:So,Percentage:_e,Color:qr,Value:Kr};function oe(e){return et(Kr,e)}const Et=O("("),Mt=O(")"),Me=O(","),Eo=S.lazy(()=>Gr.sepBy(g(Me,w)).trim(w).map(e=>new st(...e))),tn=e=>T(e||Lt,Eo.wrap(Et,Mt)),Mo=()=>{const e=G(/[^)]+/);return O("var").next(e.trim(w).wrap(Et,Mt)).map(t=>new d(t,"var"))},Io=()=>{const e=S.lazy(()=>g(G(/[^()]+/),e.many(1).wrap(Et,Mt).map(t=>`(${t.join(" ")})`)).many(1));return O("calc").next(g(S.lazy(()=>Gr).trim(w).wrap(Et,Mt),e.wrap(Et,Mt).map(t=>t.join(" ")))).map(t=>t instanceof d?t:new d(t,"calc"))},Bo=["translate","scale","rotate","skew"],Ie=["x","y","z"],To=Ie.map(p),Po=Bo.map(p),Oo=()=>{const e=T(g(...Po),g(...To,O(""))),t=(n,r)=>n+r.toUpperCase();return tn(e).map(([[n,r],s])=>{const i=n.toLowerCase(),o={};if(r){const c=i+r.toUpperCase();o[c]=s[0]}else s.length===1?Ie.forEach(c=>{const l=t(i,c);o[l]=s[0]}):s.forEach((c,l)=>{const u=t(i,Ie[l]);o[u]=c});const a=Object.entries(o).map(([c,l])=>new _(c,[l]));return new st(...a)})},zo={left:"270",right:"90",top:"0",bottom:"180"},No=()=>{const e=g(...["linear-gradient","radial-gradient"].map(p)),t=T(O("to").skip(w),g(...["left","right","top","bottom"].map(p))).map(([,o])=>{const a=zo[o.toLowerCase()];return new d(a,"deg")}),n=g(A.Angle,t),r=g(A.Length,A.Percentage),s=T(A.Color,r.sepBy(w)).map(([o,a])=>!a||a.length===0?[o]:[o,...a]),i=T(s,Me.trim(w).next(g(s,r)).many()).map(([o,a])=>[o,...a]);return T(e,T(n.skip(Me).opt(),i).trim(w).wrap(Et,Mt).map(([o,a])=>o?[o,...a].flat():[a])).map(([o,a])=>new _(o,a))},$o=()=>tn(O("cubic-bezier")).map(e=>new _("cubic-bezier",e[1])),Xr=G(/[^\(\)\{\}\s,;]+/).map(e=>new d(e)),Yr=g(Oo(),Mo(),Io(),No(),$o(),tn().map(([e,t])=>new _(e,t))),Gr=g(A.Value,Yr,Xr).trim(w),Fo=T(O("{"),G(/[^{}]+/),O("}")).map(e=>{const t=e.join(`
8
- `);let n=JSON.parse(t);return new d(n,"json")}),Hr=g(A.Value,Yr,Fo,Xr).trim(w);Hr.sepBy(w);const Ao=Q(e=>et(Hr,e));Q(e=>et(A.Percentage,String(e)).valueOf());Q(e=>et(A.Time.map(t=>t.unit==="ms"?t.value:t.unit==="s"?t.value*1e3:t.value),e));Q((e,t)=>(()=>{if(!t)return e;if(e.unit==="var"){const n=getComputedStyle(t).getPropertyValue(e.value);return oe(n)}if(e.unit==="calc"&&e.property&&e.subProperty&&e.value&&t){const n=e.property,r=t.style[n],s=e.subProperty?`${e.subProperty}(${e.toString()})`:e.toString();t.style[n]=s;const i=getComputedStyle(t).getPropertyValue(n);t.style[n]=r;const o=Ao(i);if(o instanceof d)return o;if(o.name.startsWith("matrix")){const a=or(o)[e.subProperty];if(a!=null)return new d(a,"px",["length","absolute"])}}return e})().coalesce(e),{keyFn:(e,t)=>`${e.toString()}-${JSON.stringify(t)}`});function Vo(e){return e}function En(e){return e*e}function Mn(e){return-e*(e-2)}function In(e){return(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1)}function Bn(e){return e*e*e}function Tn(e){return(e=e-1)*e*e+1}function Qt(e){return(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}function Pn(e){return e*e*(3-2*e)}const rt=(e,t,n,r)=>s=>(s=Fs(s,e,t,n,r)[1],s);function On(e){return e=rt(.09,.91,.5,1.5)(e),e}function zn(e){return e=rt(.09,.91,.5,1.5)(e),e}function Nn(e){return e=re(e,[[0,0],[.026,1.746],[.633,1.06],[1,0]])[1],e}function $n(e){return e=re(e,[[0,0],[.367,.94],[.974,.254],[1,0]])[1],e}function Fn(e){return e=re(e,[[0,0],[.026,1.746],[.633,1.06],[1,0]])[1],e}function An(e){return e=re(e,[[0,0],[.026,1.746],[.633,1.06],[1,0]])[1],e}function Vn(e){return 1-Math.cos(e*Math.PI/2)}function Rn(e){return Math.sin(e*Math.PI/2)}function jn(e){return-(Math.cos(Math.PI*e)-1)/2}function Ln(e){return 1-Math.sqrt(1-e*e)}function Wn(e){return Math.sqrt(1- --e*e)}function Dn(e){return(e/=.5)<1?-(Math.sqrt(1-e*e)-1)/2:(Math.sqrt(1-(e-=2)*e)+1)/2}function Un(e){return e===0?0:Math.pow(2,10*(e-1))}function qn(e){return e===1?1:1-Math.pow(2,-10*e)}function Kn(e){return e===0?0:e===1?1:(e/=.5)<1?.5*Math.pow(2,10*(e-1)):.5*(2-Math.pow(2,-10*--e))}function Zr(e,t){return Math.floor(e*t)/t}function Ro(e,t){return Math.ceil(e*t)/t}function jo(e,t){return e===0||e===1?e:Zr(e,t)}function Lo(e,t){return Math.round(e*t)/t}function en(e,t="jump-start"){switch(t){case"jump-none":return n=>Lo(n,e);case"jump-start":case"start":return n=>Zr(n,e);case"jump-end":case"end":return n=>Ro(n,e);case"jump-both":case"both":return n=>jo(n,e)}}function Wo(){return en(1,"jump-start")}function Do(){return en(1,"jump-end")}const gt={ease:[.25,.1,.25,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1],"ease-in-back":[.6,-.28,.735,.045],"ease-out-back":[.175,.885,.32,1.275],"ease-in-out-back":[.68,-.55,.265,1.55]},Uo={linear:Vo,easeInQuad:En,"ease-in-quad":En,easeOutQuad:Mn,"ease-out-quad":Mn,easeInOutQuad:In,"ease-in-out-quad":In,easeInCubic:Bn,"ease-in-cubic":Bn,easeOutCubic:Tn,"ease-out-cubic":Tn,easeInOutCubic:Qt,"ease-in-out-cubic":Qt,easeInBounce:On,"ease-in-bounce":On,bounceInEase:zn,"bounce-in-ease":zn,bounceInEaseHalf:Nn,"bounce-in-ease-half":Nn,bounceOutEase:$n,"bounce-out-ease":$n,bounceOutEaseHalf:Fn,"bounce-out-ease-half":Fn,bounceInOutEase:An,"bounce-in-out-ease":An,easeInSine:Vn,"ease-in-sine":Vn,easeOutSine:Rn,"ease-out-sine":Rn,easeInOutSine:jn,"ease-in-out-sine":jn,easeInCirc:Ln,"ease-in-circ":Ln,easeOutCirc:Wn,"ease-out-circ":Wn,easeInOutCirc:Dn,"ease-in-out-circ":Dn,easeInExpo:Un,"ease-in-expo":Un,easeOutExpo:qn,"ease-out-expo":qn,easeInOutExpo:Kn,"ease-in-out-expo":Kn,smoothStep3:Pn,"smooth-step-3":Pn,ease:rt(...gt.ease),"ease-in":rt(...gt["ease-in"]),"ease-out":rt(...gt["ease-out"]),"ease-in-out":rt(...gt["ease-in-out"]),"ease-in-back":rt(...gt["ease-in-back"]),"ease-out-back":rt(...gt["ease-out-back"]),"ease-in-out-back":rt(...gt["ease-in-out-back"]),steps:en,"step-start":Wo,"step-end":Do},Xn=4;function Yn(e,t="^",n=!1){const r=e.src.split(`
9
- `),s=Math.min(r.length-1,e.getLineNumber()),i=Math.max(s-Xn,0),o=Math.min(s+Xn+1,r.length),a=r.slice(i,o);if(t){const l=" ".repeat(e.getColumnNumber())+t;a.splice(s-i+1,0,l)}return a.map((l,u)=>` ${i+u+1}| ${l}`).join(`
10
- `)}const wt=new Map;function Jr(e){if(wt.has(e.id))return wt.get(e.id);const t=(r,s)=>{if(wt.has(r.id))return wt.get(r.id);const{name:i,args:o,parser:a}=r.context,c=a!=null?t(a,s):"unknown",u=(()=>{switch(i){case"string":return`"${o[0]}"`;case"regex":case"regexConcat":case"regexWrap":return`${o[0]}`;case"wrap":case"trim":{const[h,b]=o;return`${t(h,s)} ${c} ${t(b,s)}`}case"trimWhitespace":return`${c}?w`;case"not":return`!${c}`;case"opt":return`${c}?`;case"next":{const[h]=o;return`${c} >> ${t(h,s)}`}case"skip":{const[h]=o;return`${c} << ${t(h,s)}`}case"map":return c;case"all":case"then":return`[${o.map(b=>t(b,s)).join(", ")}]`;case"any":case"or":return o.map(b=>t(b,s)).join(" | ");case"many":{const[h,b]=o,y=b===1/0?`${h},`:`${h},${b}`;return`${c} {${y}}`}case"sepBy":return`${c} sepBy ${t(o[0],s)}`;case"lazy":{const[h]=o,b=_r(h);if(s)return i;{const y=t(b,b.id);return wt.set(b.id,y),y}}case"debug":return c;default:return}})()??i??"unknown";return s&&wt.set(r.id,u),u},n=t(e);return wt.set(e.id,n),n}function Qr(e,t="",n=""){const r=String(e.value),s=e.offset>=e.src.length,a=`${`[${e.isError?"err":s?"done":"ok"}]`} ${t} offset=${e.offset} value=${r}`,c=e.offset>=e.src.length?Yn(e,"",e.isError):Yn(e,"^",e.isError);return`${a}
11
- ${c}`}function qo(e,t="",n=!1,r=console.log){const s=i=>{const o=e.parser(i),a=n?Jr(e):e.context.name??"",c=Qr(o,t,a);return r(c),o};return new C(s,B("debug",e,r))}class _t{constructor(t,n=void 0,r=0,s=!1,i=0){this.src=t,this.value=n,this.offset=r,this.isError=s,this.furthest=i}ok(t,n=0){return n+=this.offset,new _t(this.src,t,n,!1)}err(t,n=0){const r=this.ok(t,n);return r.isError=!0,r}from(t,n=0){return n+=this.offset,new _t(this.src,t,n,this.isError)}getColumnNumber(){const t=this.offset,n=this.src.lastIndexOf(`
12
- `,t),r=n===-1?t:t-(n+1);return Math.max(0,r)}getLineNumber(){const t=this.src.lastIndexOf(`
13
- `,this.offset);return t>=0?this.src.slice(0,t).split(`
14
- `).length:0}toString(){return Qr(this)}}function B(e,t,...n){return{name:e,parser:t,args:n}}let Ko=0;const kt=new Map,Xt=new Map;let At;function U(e){return(!At||e.offset>At.offset)&&(At=e),At}function _r(e){return e.parser?e.parser:e.parser=e()}class C{constructor(t,n={}){this.parser=t,this.context=n}id=Ko++;state;reset(){At=void 0,kt.clear(),Xt.clear()}parseState(t){this.reset();const n=this.parser(new _t(t));return this.state=U(n),this.state.isError=n.isError,this.state.isError,n}parse(t){return this.parseState(t).value}getCijKey(t){return`${this.id}${t.offset}`}atLeftRecursionLimit(t){return(Xt.get(this.getCijKey(t))??0)>t.src.length-t.offset}memoize(){const t=n=>{const r=this.getCijKey(n),s=Xt.get(r)??0;let i=kt.get(this.id);if(i&&i.offset>=n.offset)return i;if(this.atLeftRecursionLimit(n))return n.err(void 0);Xt.set(r,s+1);const o=this.parser(n);return i=kt.get(this.id),i&&i.offset>o.offset?o.offset=i.offset:i||kt.set(this.id,o),o};return new C(t,B("memoize",this))}mergeMemos(){const t=n=>{let r=kt.get(this.id);if(r)return r;if(this.atLeftRecursionLimit(n))return n.err(void 0);const s=this.parser(n);return r=kt.get(this.id),r||kt.set(this.id,s),s};return new C(t,B("mergeMemo",this))}then(t){const n=r=>{const s=this.parser(r);if(!s.isError){const i=t.parser(s);if(!i.isError)return i.ok([s.value,i.value])}return U(r),r.err(void 0)};return new C(n,B("then",this,this,t))}or(t){const n=r=>{const s=this.parser(r);return s.isError?t.parser(r):s};return new C(n,B("or",this,this,t))}chain(t,n=!1){const r=s=>{const i=this.parser(s);return i.isError?i:i.value||n?t(i.value).parser(i):s};return new C(r,B("chain",this,t))}map(t,n=!1){const r=s=>{const i=this.parser(s);return!i.isError||n?i.ok(t(i.value)):i};return new C(r,B("map",this))}mapState(t){const n=r=>{const s=this.parser(r);return t(s,r)};return new C(n,B("mapState",this))}skip(t){const n=r=>{const s=this.parser(r);if(!s.isError){const i=t.parser(s);if(!i.isError)return i.ok(s.value)}return U(r),r.err(void 0)};return new C(n,B("skip",this,t))}next(t){const n=this.then(t).map(([,r])=>r);return n.context=B("next",this,t),n}opt(){const t=n=>{const r=this.parser(n);return r.isError?(U(n),n.ok(void 0)):r};return new C(t,B("opt",this))}not(t){const n=s=>this.parser(s).isError?(U(s),s.ok(s.value)):s.err(void 0),r=s=>{const i=this.parser(s);return i.isError?(U(s),i):t.parser(s).isError?i:(U(s),s.err(void 0))};return new C(t?r:n,B("not",this,t))}wrap(t,n,r=!0){if(!r)return Z(t,this,n);const s=t.next(this).skip(n);return s.context=B("wrap",this,t,n),s}trim(t=nn,n=!0){if(!n)return Z(t,this,t);if(t.context?.name==="whitespace"){const r=s=>{const i=Hn(s),o=this.parser(i);return o.isError?(U(s),s.err(void 0)):Hn(o)};return new C(r,B("trimWhitespace",this))}return this.wrap(t,t)}many(t=0,n=1/0){const r=s=>{const i=[];let o=s;for(let a=0;a<n;a+=1){const c=this.parser(o);if(c.isError)break;i.push(c.value),o=c}return i.length>=t?o.ok(i):(U(s),s.err([]))};return new C(r,B("many",this,t,n))}sepBy(t,n=0,r=1/0){const s=i=>{const o=[];let a=i;for(let c=0;c<r;c+=1){const l=this.parser(a);if(l.isError)break;a=l,o.push(a.value);const u=t.parser(a);if(u.isError)break;a=u}return o.length>n?a.ok(o):(U(i),i.err([]))};return new C(s,B("sepBy",this,t))}eof(){const t=this.skip(Xo());return t.context=B("eof",this),t}debug(t="",n=!1,r=console.log){return qo(this,t,n,r)}toString(){return Jr(this)}static lazy(t){const n=r=>_r(t).parser(r);return new C(n,B("lazy",void 0,t))}}function Xo(){const e=t=>t.offset>=t.src.length?t.ok(void 0):(U(t),t.err());return new C(e,B("eof",void 0))}function R(...e){const t=n=>{for(const r of e){const s=r.parser(n);if(!s.isError)return s}return U(n),n.err(void 0)};return new C(e.length===1?e[0].parser:t,B("any",void 0,...e))}function Z(...e){const t=n=>{const r=[];let s=n;for(const i of e){const o=i.parser(s);if(o.isError)return o;o.value!==void 0&&r.push(o.value),s=o}return U(s),s.ok(r)};return new C(e.length===1?e[0].parser:t,B("all",void 0,...e))}function X(e){const t=n=>{if(n.offset>=n.src.length)return n.err(void 0);const r=n.src.slice(n.offset,n.offset+e.length);return r===e?n.ok(r,r.length):(U(n),n.err(void 0))};return new C(t,B("string",void 0,e))}function Wt(e,t=n=>n?.[0]??null){const n=e.flags.replace(/y/g,""),r=new RegExp(e,n+"y"),s=i=>{if(i.offset>=i.src.length)return i.err(void 0);r.lastIndex=i.offset;const o=t(i.src.match(r));return o?i.ok(o,r.lastIndex-i.offset):o===""?i.ok(void 0):(U(i),i.err(void 0))};return new C(s,B("regex",void 0,e))}const Gn=/\s*/y,Hn=e=>{if(e.offset>=e.src.length)return e;Gn.lastIndex=e.offset;const t=e.src.match(Gn)?.[0]??"";return e.ok(e.value,t.length)},nn=Wt(/\s*/);nn.context.name="whitespace";const It=X("("),Bt=X(")"),Yo=X(";"),Go=X(":"),rn=X("{"),sn=X("}"),te=X(","),Ho=X("."),P=nn,ts=C.lazy(()=>Dt.sepBy(R(te,P)).trim(P).map(e=>new st(...e))),on=e=>Z(e||Lt,ts.wrap(It,Bt)),Zo=()=>{const e=Wt(/[^)]+/);return X("var").next(e.trim(P).wrap(It,Bt)).map(t=>new d(t,"var"))},Jo=()=>{const e=C.lazy(()=>R(Wt(/[^()]+/),e.many(1).wrap(It,Bt).map(t=>`(${t.join(" ")})`)).many(1));return X("calc").next(R(C.lazy(()=>Dt).trim(P).wrap(It,Bt),e.wrap(It,Bt).map(t=>t.join(" ")))).map(t=>t instanceof d?t:new d(t,"calc"))},Qo=["translate","scale","rotate","skew"],Be=["x","y","z"],_o=Be.map(p),ta=Qo.map(p),ea=()=>{const e=Z(R(...ta),R(..._o,X(""))),t=(r,s)=>r+s.toUpperCase();return on(e).map(([[r,s],i])=>{const o=r.toLowerCase(),a={};if(s){const l=o+s.toUpperCase();a[l]=i[0]}else i.length===1?Be.forEach(l=>{const u=t(o,l);a[u]=i[0]}):i.forEach((l,u)=>{const h=t(o,Be[u]);a[h]=l});const c=Object.entries(a).map(([l,u])=>new _(l,[u]));return new st(...c)})},na={left:"270",right:"90",top:"0",bottom:"180"},ra=()=>{const e=R(...["linear-gradient","radial-gradient"].map(p)),t=Z(X("to").skip(P),R(...["left","right","top","bottom"].map(p))).map(([,a])=>{const c=na[a.toLowerCase()];return new d(c,"deg")}),n=R(A.Angle,t),r=R(A.Length,A.Percentage),s=Z(A.Color,r.sepBy(P)).map(([a,c])=>!c||c.length===0?[a]:[a,...c]),i=Z(s,te.trim(P).next(R(s,r)).many()).map(([a,c])=>[a,...c]);return Z(e,Z(n.skip(te).opt(),i).trim(P).wrap(It,Bt).map(([a,c])=>a?[a,...c].flat():[c])).map(([a,c])=>new _(a,c))},sa=()=>on(X("cubic-bezier")).map(e=>new _("cubic-bezier",e[1])),ia=Wt(/[^\(\)\{\}\s,;]+/).map(e=>new d(e)),oa=R(ea(),Zo(),Jo(),ra(),sa(),on().map(([e,t])=>new _(e,t))),aa=Z(rn,Wt(/[^{}]+/),sn).map(e=>{const t=e.join(`
15
- `),n=JSON.parse(t);return new d(n,"json")}),Dt=R(A.Value,oa,aa,ia).trim(P),ca=Dt.sepBy(P),la=Z(Lt.skip(Go).trim(P).map(e=>ls(e)),ca.skip(Yo).trim(P)).map(([e,t])=>{const n=new st(...t).flat();return n.setProperty(e),{[e]:n}}),ua=R(A.TimePercentage.trim(P).map(e=>e.toString()),it.map(e=>`${e}%`)),ha=ua.sepBy(te).trim(P),es=la.many().trim(P).wrap(rn,sn).map(e=>Object.assign({},...e)),pa=X("@keyframes").trim(P).next(Lt),Zn=Z(ha,es).map(([e,t])=>e.reduce((n,r)=>(n.set(r,t),n),new Map)),ns=R(pa.next(Zn.many(1).trim(P).wrap(rn,sn).trim(P)),Zn.many(1).trim(P)).map(e=>e.reduce((t,n)=>{for(const[r,s]of n)t.has(r)?t.set(r,{...t.get(r),...s}):t.set(r,s);return t},new Map)),ma=Ho.trim(P).next(Lt).trim(P),fa=es.map(e=>{const t={};for(const[n,r]of Object.entries(e))if(n.includes("animation")){const s=n.replace(/^animation/i,"").replace(/^\w/,o=>o.toLowerCase()),i=us(r.toString());t[s]=i,delete e[n]}return{options:t,values:e}}),da=ma.next(fa),ba=R(da.map(e=>e),ns.map(e=>({keyframes:e}))),ga=ba.sepBy(P).map(e=>Object.assign({},...e)),Jn={Value:Dt,FunctionArgs:ts},wa=Q(e=>et(Dt,e)),ka=Q(e=>et(ns,e));Q(e=>{const{options:t,values:n,keyframes:r}=et(ga,e);return{options:t,values:n,keyframes:r}});Q(e=>et(A.Percentage,String(e)).valueOf());const Qn=Q(e=>et(A.Time.map(t=>t.unit==="ms"?t.value:t.unit==="s"?t.value*1e3:t.value),e));Q(e=>e>=5e3?`${e/1e3}s`:`${e}ms`);Q(e=>e===1/0?"infinite":String(e));const ya={duration:1e3,delay:0,iterationCount:1,direction:"normal",fillMode:"forwards",timingFunction:Qt};class xa{animations={};transform;superKey;paused=!1;started=!1;done=!1;singleTarget=!0;handleId=void 0;resolvePromise=null;constructor(...t){for(const n of t){this.transform??=n.frames[0].transform;const r=rs(n);this.animations[r]={values:{},animation:n}}this.singleTarget=t.every(n=>n.targets[0]===t[0].targets[0])}setSuperKey(t){return this.superKey=t,Object.values(this.animations).forEach(n=>{n.animation.superKey=t}),this}setTargets(...t){Object.values(this.animations).forEach(r=>{r.animation.setTargets(...t)});const n=Object.values(this.animations).map(r=>r.animation);return this.singleTarget=n.every(r=>r.targets[0]===n[0].targets[0]),this}onStart(){return this.started=!0,this}onEnd(){return this}transformFramesGrouped(t){let n={},r=!0;for(const s of Object.values(this.animations)){const{animation:i,values:o}=s;if(r=r&&i.done,!(i.done||i.paused)){const a=i.interpFrames(i.t,!1);Object.assign(o,a)}n={...n,...o}}return this.done=r,this.transform(n,t),n}async tick(t){return this.started||this.onStart(),Object.values(this.animations).forEach(async n=>{(!n.animation.paused||n.animation.pausedTime===0)&&await n.animation.tick(t)}),this.done&&this.onEnd(),this}async draw(t){await this.tick(t),!this.paused&&(this.singleTarget?this.transformFramesGrouped(t):this.done=Object.values(this.animations).map(({animation:n})=>(n.interpFrames(n.t,!0),n)).every(n=>n.done),this.done?(this.reset(),this.resolvePromise&&this.resolvePromise()):this.handleId=vt(this.draw.bind(this)))}async play(){return new Promise(t=>{this.resolvePromise=t,this.handleId=vt(this.draw.bind(this))})}pause(){const t=this.paused;return this.started&&(this.paused=!this.paused,Object.values(this.animations).forEach(n=>{n.animation.pause(!1)})),t&&vt(this.draw.bind(this)),this}reset(){return Object.values(this.animations).forEach(t=>{t.animation.reset()}),this.started=!1,this.done=!1,this.paused=!1,this}stop(){return er(this.handleId),this.reset(),this}playing(){return!(!this.started||this.paused)}forcePause(){this.paused=!0,Object.values(this.animations).forEach(t=>{t.animation.paused=!0})}forcePlay(){this.paused=!1,Object.values(this.animations).forEach(t=>{t.animation.paused=!1})}}const _n=Q((e,t)=>(()=>{if(!t)return e;if(e.unit==="var"){const s=getComputedStyle(t).getPropertyValue(e.value);return oe(s)}if(e.unit==="calc"&&e.property&&e.subProperty&&e.value&&t){const s=t.style[e.property],i=e.subProperty?`${e.subProperty}(${e.toString()})`:e.toString();t.style[e.property]=i;const o=getComputedStyle(t).getPropertyValue(e.property);t.style[e.property]=s;const a=wa(o);if(a instanceof d)return a;if(a.name.startsWith("matrix")){const l=or(a)[e.subProperty];if(l!=null)return new d(l,"px",["length","absolute"])}}return e})().coalesce(e),{keyFn:(e,t)=>`${e.toString()}-${JSON.stringify(t)}`}),Sa=(e,t,n=!1)=>{if(e?.superType?.[0]!==t?.superType?.[0])return n?[e,t]:[e.clone(),t.clone()];const r=o=>{switch(o?.superType?.[0]){case"length":return{value:xs(o.value,o.unit,o.targets?.[0]),unit:"px"};case"angle":return{value:cr(o.value,o.unit),unit:"deg"};case"time":return{value:ar(o.value,o.unit),unit:"ms"};case"resolution":return{value:Ss(o.value,o.unit),unit:"dpi"};default:return{value:o.value,unit:o.unit}}},[s,i]=[r(e),r(t)];return n?(e.value=s.value,e.unit=s.unit,t.value=i.value,t.unit=i.unit,[e,t]):[new d(s.value,s.unit,e.superType,e.subProperty,e.property,e.targets),new d(i.value,i.unit,t.superType,t.subProperty,t.property,t.targets)]};function va(e,t){e=e.coalesce(t,!0),t=t.coalesce(e,!0);const n={start:e,stop:t,value:e.clone()};if(xe(e)&&xe(t)){const[r,s]=Di(e,t,"lab",!0);n.start=r,n.stop=s,n.value=r.clone()}if(e.unit!==t.unit){const[r,s]=Sa(e,t,!0);n.start=r,n.stop=s,n.value=r.clone()}return n.computed=ye.includes(e.unit)||ye.includes(t.unit),n}const tr=e=>typeof e=="string"?Uo[e]:e??void 0;function Ca(e,{start:t,stop:n,value:r}){const s=_n(t.clone(),t.targets?.[0]),i=_n(n.clone(),n.targets?.[0]),o=ye.includes(s.unit)?i.unit:s.unit,a=Tt(e,s.value,i.value);return r.value=a,r.unit=o,r}function Ea(e,{start:t,stop:n,value:r}){return t.value.keys().forEach(s=>{r.value[s]=Tt(e,t.value[s],n.value[s])}),r}function Ma(e,t){const{start:n,stop:r,computed:s}=t;return typeof n.value=="number"&&typeof r.value=="number"?t.value.value=Tt(e,n.value,r.value):n.unit==="color"?Ea(e,t):s&&Ca(e,t),t}function Ia(e){const t=ir(e),n=(s,i)=>{const o=s.split(".").pop(),a=s.split(".").shift();if(i instanceof d)return i.setProperty(a),i;if(i instanceof _)return i.setProperty(a),i.setSubProperty(o),i.values.flat();if(i instanceof st)return i.map(l=>n(s,l)).flat();const c=et(R(Jn.FunctionArgs.map(l=>(l.setSubProperty(o),l)),Jn.Value),String(i));return c.setProperty(a),c};return Object.entries(t).map(([s,i])=>[s,n(s,i)]).reduce((s,[i,o])=>(s[i]=o,s),{})}const Ba=(e,t,n,r)=>{const s=r[t][e],i=r[n][e],o=Math.max(s.length,i.length),a=s.concat(Array(Math.abs(o-s.length)).fill(new d(0))),c=i.concat(Array(Math.abs(o-i.length)).fill(new d(0)));return a.map((l,u)=>va(l,c[u]))};function Ta(e,t,n){const[r,s]=[e.start,t.start];return{start:r.value*n/100,stop:s.value*n/100}}function Pa(e,t,n=!0){e=n?e:ir(e);const r=ks(e);t.forEach(s=>{Object.entries(r).forEach(([i,o])=>{s.style[i]=o})})}const rs=e=>typeof e=="string"?e:e.name??String(e.id);let Oa=0;class ss{id=Oa++;name;superKey;targets;options;templateFrames=[];parsedVars=[];frameId=0;frames=[];handleId=void 0;startTime=void 0;pausedTime=0;prevTime=0;t=0;iteration=0;started=!1;done=!1;reversed=!1;paused=!1;unflatten=!0;resolvePromise=null;constructor(t,n,r,s){this.options={},this.setOptions({...ya,...t??{}}),this.targets=n==null?[]:Array.isArray(n)?n:[n],this.name=r,this.superKey=s}convertFrameStart(t){if(t.start.unit==="s"||t.start.unit==="ms"||!t.start.unit){const n=ar(t.start.value,t.start.unit);t.start.value=n/this.options.duration*100,t.start.unit="%"}return t.start.value=J(t.start.value,0,100),t}addFrame(t,n,r,s){typeof t=="number"?t=String(t)+"%":typeof t=="string"?t=t:t instanceof d&&(t=String(t));const i=oe(t);let o={id:this.frameId,start:i,vars:n,transform:r,timingFunction:tr(s)??this.options.timingFunction};return this.convertFrameStart(o),this.templateFrames.push(o),this.frameId+=1,this}createFrame(t,n){const[r,s]=[this.templateFrames[t],this.templateFrames[n]],i={start:t,stop:n},o=Ta(r,s,this.options.duration);let a=r.transform;if(a==null){const u=mn(t,this.frames,h=>h.transform!=null);a=this.frames[u].transform}let c=r.timingFunction;if(c==null){const u=mn(t,this.frames,h=>h.timingFunction!=null);c=this.frames[u].timingFunction}return{id:this.frameId++,ixs:i,start:r.start,time:o,vars:void 0,flatVars:void 0,interpVars:{},transform:a,timingFunction:c}}reconcileVars(t){const n=this.parsedVars[t];Object.keys(n).forEach(r=>{const s=this.parsedVars.findIndex((l,u)=>u>t&&l[r]!=null);if(s===-1)return;const[i,o]=[t,s],a=this.frames.findIndex(l=>l.ixs.start===i&&l.ixs.stop===o),c=a!==-1?this.frames[a]:this.createFrame(i,o);c.interpVars[r]=Ba(r,i,o,this.parsedVars),a===-1&&this.frames.push(c)})}parse(){this.frames=[],this.templateFrames.sort((t,n)=>t.start.value-n.start.value),this.parsedVars=this.templateFrames.map(t=>{const n=Ia(t.vars);return Object.values(n).forEach(r=>{r.setTargets(this.targets)}),n});for(let t=0;t<this.templateFrames.length-1;t++)this.frames.push(this.createFrame(t,t+1));return this.frames.forEach((t,n)=>this.reconcileVars(n)),this.frames.sort((t,n)=>t.time.start===n.time.start?t.time.stop-n.time.stop:t.time.start-n.time.start),this.frames=this.frames.filter(t=>t.interpVars!=null&&Object.keys(t.interpVars).length>0),this.frames.forEach(t=>{t.flatVars=Object.entries(t.interpVars).reduce((n,[r,s])=>(n[r]=s.map(i=>i.value),n),{}),t.vars=ws(t.flatVars)}),this}setTimingFunction(t){return this.options.timingFunction=tr(t)??Qt,this}setIterationCount(t){return!t||t==="infinite"||t==="∞"||t==="Infinity"?this.options.iterationCount=1/0:typeof t=="string"?this.options.iterationCount=parseFloat(t.trim()):this.options.iterationCount=t,this}setDuration(t){typeof t=="string"&&(t=Qn(t));const n=this.options.duration,r=t??n,s=r/n;for(let i=0;i<this.frames.length;i++){const o=this.frames[i];o.time.start*=s,o.time.stop*=s}return this.options.duration=r,this}setDelay(t){return typeof t=="string"&&(t=Qn(t)),this.options.delay=t??0,this}setDirection(t){return this.options.direction=t??"normal",this}setFillMode(t){return this.options.fillMode=t??"forwards",this}setOptions(t){return this.setTimingFunction(t.timingFunction),this.setDuration(t.duration),this.setIterationCount(t.iterationCount),this.setDelay(t.delay),this.setDirection(t.direction),this.setFillMode(t.fillMode),this}reverse(){return this.reversed=!this.reversed,this}fillForwards(){this.interpFrames(this.options.duration,!0)}fillBackwards(){this.interpFrames(0,!0)}interpFrames(t,n=!1){return t=this.reversed?this.options.duration-t:t,this.frames.map(r=>{const{start:s,stop:i}=r.time;if(t<s||t>i)return;const o=E(t,s,i,0,1),a=r.timingFunction(o);return Object.values(r.interpVars).forEach(c=>{c.forEach(l=>{Ma(a,l)})}),n&&r.transform(this.unflatten?r.vars:r.flatVars,t),r.flatVars}).reduce((r,s)=>({...r,...s}),{})}async onStart(){this.reversed=!1,(this.options.direction==="reverse"||this.options.direction==="alternate-reverse"||this.options.direction==="alternate"&&this.iteration%2===1)&&this.reverse(),(this.options.fillMode==="backwards"||this.options.fillMode==="both")&&this.fillBackwards(),this.options.delay>0&&(this.pause(),await cs(this.options.delay),this.pause()),this.started=!0}async onEnd(){this.options.fillMode==="forwards"||this.options.fillMode==="both"?this.fillForwards():(this.options.fillMode==="none"||this.options.fillMode==="backwards")&&this.fillBackwards(),this.startTime=void 0,this.iteration===this.options.iterationCount-1?(this.done=!0,this.iteration=0):this.iteration+=1}async tick(t){if(this.startTime===void 0&&(await this.onStart(),this.startTime=t+this.options.delay),this.paused&&this.pausedTime===0)return this.pausedTime=t,this.t;if(this.pausedTime>0&&!this.paused){const n=t-this.pausedTime;this.startTime+=n,this.pausedTime=0}return this.t=t-this.startTime,this.t>=this.options.duration&&(await this.onEnd(),this.t=this.options.duration),this.t}async draw(t){t=await this.tick(t),!this.paused&&(this.interpFrames(t,!0),this.done?(this.reset(),this.resolvePromise&&this.resolvePromise()):this.handleId=vt(this.draw.bind(this)))}async play(){return new Promise(t=>{this.resolvePromise=t,this.handleId=vt(this.draw.bind(this))})}pause(t=!0){return this.paused&&t&&(this.handleId=vt(this.draw.bind(this))),this.started&&(this.paused=!this.paused),this}stop(){er(this.handleId),this.reset()}playing(){return!(!this.started||this.paused)}reset(){return this.done=!1,this.started=!1,this.paused=!1,this}setTargets(...t){return this.targets=t,this.frames.forEach(n=>{Object.values(n.interpVars).forEach(r=>{r.forEach(({start:s,stop:i,value:o})=>{s.setTargets(this.targets),i.setTargets(this.targets),o.setTargets(this.targets)})})}),this}group(...t){return new xa(this,...t)}}class za extends ss{constructor(t,...n){super(t,n),this.unflatten=!1}fromVars(t,n){this.unflatten=n!=null,n??=this.transform.bind(this);for(let r=0;r<t.length;r++){const s=t[r],i=Math.round(r/(t.length-1)*100);this.addFrame(i,s,n)}return this.parse(),this}fromKeyframes(t,n){this.unflatten=n!=null,n??=this.transform.bind(this),Te(t)&&(t=new Map(Object.entries(t)));for(const[r,s]of t.entries())this.addFrame(r,s,n);return this.parse(),this}fromString(t,n){this.unflatten=n!=null,n??=this.transform.bind(this);const r=ka(t);for(const[s,i]of r.entries())this.addFrame(s,i,n),this.parsedVars.push(i);return this.parse(),this}transform(t){Pa(t,this.targets)}}exports.Animation=ss;exports.CSSKeyframesAnimation=za;exports.getAnimationId=rs;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const kr=16.666666666666668,zt=t=>!!t&&t.constructor===Object;function ce(t){return zt(t)?Object.entries(t).map(([e,r])=>[e,ce(r)]).reduce((e,[r,n])=>(e[r]=n,e),{}):t!=null&&typeof t.clone=="function"?t.clone():Array.isArray(t)?t.map(ce):t}async function ps(t){return await new Promise(e=>setTimeout(e,t))}function J(t,e={}){const r=new Map,{maxCacheSize:n=1/0,ttl:s=1/0,keyFn:i=JSON.stringify}=e,o=function(...a){const l=i.apply(this,a),c=Date.now();if(r.has(l)){const f=r.get(l);if(c-f.timestamp<=s)return f.value;r.delete(l)}const u=t.apply(this,a);if(r.set(l,{value:u,timestamp:c}),r.size>n){const f=r.keys().next().value;r.delete(f)}return u};return o.cache=r,o}const ms=t=>t.replace(/([-_][a-z])/gi,e=>e.toUpperCase().replace("-","").replace("_",""));function ds(t){return t.replace(/([A-Z])/g,e=>`-${e[0].toLowerCase()}`)}function yr(t,e,r){for(let n=t-1;n>=0;n--)if(r(e[n]))return n}function Me(t){if(typeof window<"u"&&window.requestAnimationFrame)return window.requestAnimationFrame(t);let e=kr,r=Date.now();return setTimeout(()=>{let n=Date.now(),s=n-r;r=n,e=Math.max(0,kr-s),t(n)},e)}function an(t){if(typeof window<"u"&&window.cancelAnimationFrame)return window.cancelAnimationFrame(t);clearTimeout(t)}const vr=(t,e=2)=>typeof t=="number"&&Number.isNaN(t)?"none":String(t?.toFixed?.(e)??t).trim().replace(/\.0+$/,""),xr=(t,e,r)=>`${t}(${e.join(" ")} / ${r})`;let H=class{constructor(t,e=1){this.colorSpace=t,this.alpha=e,this.components=new Map}components;toString(){const t=Array.from(this.components.values()).map(r=>typeof r=="number"&&Number.isNaN(r)?"none":r),e=typeof this.alpha=="number"&&Number.isNaN(this.alpha)?"none":this.alpha;return xr(this.colorSpace,t,e)}toFormattedString(t=2){const e=Array.from(this.components.values()).map(n=>vr(n,t)),r=vr(this.alpha,t);return xr(this.colorSpace,e,r)}valueOf(){return[...this.values(),this.alpha]}toJSON(){const t={};for(const[e,r]of this.entries())t[e]=r;return t.alpha=this.alpha,t}clone(){const t=this.constructor,e=new t;return e.alpha=ce(this.alpha),this.components.forEach((r,n)=>{e.components.set(n,ce(r))}),e}keys(){return[...this.components.keys(),"alpha"]}values(){return[...this.components.values(),this.alpha]}entries(){return[...this.components.entries(),["alpha",this.alpha]]}getComponent(t){return this.components.get(t)}setComponent(t,e){this.components.set(t,e)}};class Ft extends H{constructor(e,r,n){super(e,r),this.whitePoint=n}}class q extends H{constructor(e,r,n,s){super("rgb",s),this.components.set("r",e),this.components.set("g",r),this.components.set("b",n)}get r(){return this.getComponent("r")}set r(e){this.setComponent("r",e)}get g(){return this.getComponent("g")}set g(e){this.setComponent("g",e)}get b(){return this.getComponent("b")}set b(e){this.setComponent("b",e)}}class je extends H{constructor(e,r,n,s){super("hsl",s),this.components.set("h",e),this.components.set("s",r),this.components.set("l",n)}get h(){return this.getComponent("h")}set h(e){this.setComponent("h",e)}get s(){return this.getComponent("s")}set s(e){this.setComponent("s",e)}get l(){return this.getComponent("l")}set l(e){this.setComponent("l",e)}}class $t extends H{constructor(e,r,n,s){super("hsv",s),this.components.set("h",e),this.components.set("s",r),this.components.set("v",n)}get h(){return this.getComponent("h")}set h(e){this.setComponent("h",e)}get s(){return this.getComponent("s")}set s(e){this.setComponent("s",e)}get v(){return this.getComponent("v")}set v(e){this.setComponent("v",e)}}class Nt extends H{constructor(e,r,n,s){super("hwb",s),this.components.set("h",e),this.components.set("w",r),this.components.set("b",n)}get h(){return this.getComponent("h")}set h(e){this.setComponent("h",e)}get w(){return this.getComponent("w")}set w(e){this.setComponent("w",e)}get b(){return this.getComponent("b")}set b(e){this.setComponent("b",e)}}class it extends Ft{constructor(e,r,n,s){super("lab",s,"D50"),this.components.set("l",e),this.components.set("a",r),this.components.set("b",n)}get l(){return this.getComponent("l")}set l(e){this.setComponent("l",e)}get a(){return this.getComponent("a")}set a(e){this.setComponent("a",e)}get b(){return this.getComponent("b")}set b(e){this.setComponent("b",e)}}class Vt extends H{constructor(e,r,n,s){super("lch",s),this.components.set("l",e),this.components.set("c",r),this.components.set("h",n)}get l(){return this.getComponent("l")}set l(e){this.setComponent("l",e)}get c(){return this.getComponent("c")}set c(e){this.setComponent("c",e)}get h(){return this.getComponent("h")}set h(e){this.setComponent("h",e)}}class ot extends Ft{constructor(e,r,n,s){super("oklab",s,"D50"),this.components.set("l",e),this.components.set("a",r),this.components.set("b",n)}get l(){return this.getComponent("l")}set l(e){this.setComponent("l",e)}get a(){return this.getComponent("a")}set a(e){this.setComponent("a",e)}get b(){return this.getComponent("b")}set b(e){this.setComponent("b",e)}}class jt extends H{constructor(e,r,n,s){super("oklch",s),this.components.set("l",e),this.components.set("c",r),this.components.set("h",n)}get l(){return this.getComponent("l")}set l(e){this.setComponent("l",e)}get c(){return this.getComponent("c")}set c(e){this.setComponent("c",e)}get h(){return this.getComponent("h")}set h(e){this.setComponent("h",e)}}class X extends Ft{constructor(e,r,n,s){super("xyz",s,"D65"),this.components.set("x",e),this.components.set("y",r),this.components.set("z",n)}get x(){return this.getComponent("x")}set x(e){this.setComponent("x",e)}get y(){return this.getComponent("y")}set y(e){this.setComponent("y",e)}get z(){return this.getComponent("z")}set z(e){this.setComponent("z",e)}}class ln extends H{constructor(e,r){super("kelvin",r),this.components.set("kelvin",e)}get kelvin(){return this.getComponent("kelvin")}set kelvin(e){this.setComponent("kelvin",e)}}class Rt extends H{constructor(e,r,n,s){super("srgb-linear",s),this.components.set("r",e),this.components.set("g",r),this.components.set("b",n)}get r(){return this.getComponent("r")}set r(e){this.setComponent("r",e)}get g(){return this.getComponent("g")}set g(e){this.setComponent("g",e)}get b(){return this.getComponent("b")}set b(e){this.setComponent("b",e)}}class Lt extends H{constructor(e,r,n,s){super("display-p3",s),this.components.set("r",e),this.components.set("g",r),this.components.set("b",n)}get r(){return this.getComponent("r")}set r(e){this.setComponent("r",e)}get g(){return this.getComponent("g")}set g(e){this.setComponent("g",e)}get b(){return this.getComponent("b")}set b(e){this.setComponent("b",e)}}class Wt extends H{constructor(e,r,n,s){super("a98-rgb",s),this.components.set("r",e),this.components.set("g",r),this.components.set("b",n)}get r(){return this.getComponent("r")}set r(e){this.setComponent("r",e)}get g(){return this.getComponent("g")}set g(e){this.setComponent("g",e)}get b(){return this.getComponent("b")}set b(e){this.setComponent("b",e)}}class Dt extends H{constructor(e,r,n,s){super("prophoto-rgb",s),this.components.set("r",e),this.components.set("g",r),this.components.set("b",n)}get r(){return this.getComponent("r")}set r(e){this.setComponent("r",e)}get g(){return this.getComponent("g")}set g(e){this.setComponent("g",e)}get b(){return this.getComponent("b")}set b(e){this.setComponent("b",e)}}class qt extends H{constructor(e,r,n,s){super("rec2020",s),this.components.set("r",e),this.components.set("g",r),this.components.set("b",n)}get r(){return this.getComponent("r")}set r(e){this.setComponent("r",e)}get g(){return this.getComponent("g")}set g(e){this.setComponent("g",e)}get b(){return this.getComponent("b")}set b(e){this.setComponent("b",e)}}const Sr=4;function Er(t,e="^",r=!1){const n=t.src.split(`
2
+ `),s=Math.min(n.length-1,t.getLineNumber()),i=Math.max(s-Sr,0),o=Math.min(s+Sr+1,n.length),a=n.slice(i,o);if(e){const l=" ".repeat(t.getColumnNumber())+e;a.splice(s-i+1,0,l)}return a.map((l,c)=>` ${i+c+1}| ${l}`).join(`
3
+ `)}const me=new Map;function cn(t){if(me.has(t.id))return me.get(t.id);const e=(n,s)=>{if(me.has(n.id))return me.get(n.id);const{name:i,args:o,parser:a}=n.context,l=a!=null?e(a,s):"unknown",c=(()=>{switch(i){case"string":return`"${o[0]}"`;case"regex":case"regexConcat":case"regexWrap":return`${o[0]}`;case"wrap":case"trim":{const[u,f]=o;return`${e(u,s)} ${l} ${e(f,s)}`}case"trimWhitespace":return`${l}?w`;case"not":return`!${l}`;case"opt":return`${l}?`;case"next":{const[u]=o;return`${l} >> ${e(u,s)}`}case"skip":{const[u]=o;return`${l} << ${e(u,s)}`}case"map":return l;case"all":case"then":return`[${o.map(u=>e(u,s)).join(", ")}]`;case"any":case"or":return o.map(u=>e(u,s)).join(" | ");case"many":{const[u,f]=o,h=f===1/0?`${u},`:`${u},${f}`;return`${l} {${h}}`}case"sepBy":return`${l} sepBy ${e(o[0],s)}`;case"lazy":{const[u]=o,f=ks(u);if(s)return i;{const h=e(f,f.id);return me.set(f.id,h),h}}case"debug":return l;default:return}})()??i??"unknown";return s&&me.set(n.id,c),c},r=e(t);return me.set(t.id,r),r}function un(t,e="",r=""){const n=String(t.value),s=t.offset>=t.src.length,i=`${`[${t.isError?"err":s?"done":"ok"}]`} ${e} offset=${t.offset} value=${n}`,o=t.offset>=t.src.length?Er(t,"",t.isError):Er(t,"^",t.isError);return`${i}
4
+ ${o}`}function gs(t,e="",r=!1,n=console.log){const s=i=>{const o=t.parser(i),a=r?cn(t):t.context.name??"",l=un(o,e,a);return n(l),o};return new S(s,O("debug",t,n))}class Ye{constructor(e,r=void 0,n=0,s=!1,i=0){this.src=e,this.value=r,this.offset=n,this.isError=s,this.furthest=i}expected;ok(e,r=0){return this.offset+=r,this.value=e,this.isError=!1,this}err(e,r=0){return this.offset+=r,this.value=e,this.isError=!0,this}from(e,r=0){return this.offset+=r,this.value=e,this}save(){return{offset:this.offset,value:this.value}}restore(e){return this.offset=e.offset,this.value=e.value,this.isError=!1,this}clone(){return new Ye(this.src,this.value,this.offset,this.isError,this.furthest)}getColumnNumber(){const e=this.offset,r=this.src.lastIndexOf(`
5
+ `,e),n=r===-1?e:e-(r+1);return Math.max(0,n)}getLineNumber(){const e=this.src.lastIndexOf(`
6
+ `,this.offset);return e>=0?this.src.slice(0,e).split(`
7
+ `).length:0}toString(){return un(this)}}function O(t,e,...r){return{name:t,parser:e,args:r}}let bs=0;const de=new Map,We=new Map,fn=20,ws=(1<<fn)-1;let He=-1,Ge;function F(t,e){return t.offset>He?(He=t.offset,Ge=t,t.expected=void 0):t.offset,Ge}function ks(t){return t.parser?t.parser:t.parser=t()}function ys(t){let e;return r=>(e||(e=t()),e.parser(r))}const vs=0,De=1,xs=2;class S{constructor(e,r={}){this.parser=e,this.context=r}id=bs++;state;flags=vs;reset(){Ge=void 0,He=-1,de.clear(),We.clear()}parseState(e){this.reset();const r=new Ye(e);if(this.parser(r),r.isError&&Ge){const n=new Ye(e,void 0,He,!0);this.state=n}else this.state=r,r.isError;return r}parse(e){return this.parseState(e).value}getCijKey(e){return this.id<<fn|e.offset&ws}atLeftRecursionLimit(e){return(We.get(this.getCijKey(e))??0)>e.src.length-e.offset}memoize(){const e=r=>{const n=this.getCijKey(r),s=We.get(n)??0,i=de.get(this.id);if(i&&i.offset>=r.offset)return r.offset=i.offset,r.value=i.value,r.isError=i.isError,r;if(this.atLeftRecursionLimit(r))return r.isError=!0,r;We.set(n,s+1),this.parser(r);const o=de.get(this.id);return o&&o.offset>r.offset?r.offset=o.offset:o||de.set(this.id,r.clone()),r};return new S(e,O("memoize",this))}mergeMemos(){const e=r=>{const n=de.get(this.id);return n?(r.offset=n.offset,r.value=n.value,r.isError=n.isError,r):this.atLeftRecursionLimit(r)?(r.isError=!0,r):(this.parser(r),de.get(this.id)||de.set(this.id,r.clone()),r)};return new S(e,O("mergeMemo",this))}then(e){const r=n=>{const s=n.offset;if(this.parser(n),!n.isError){const i=n.value;if(e.parser(n),!n.isError)return n.ok([i,n.value])}return F(n),n.offset=s,n.isError=!0,n};return new S(r,O("then",this,this,e))}or(e){const r=n=>{const s=n.offset;return this.parser(n),n.isError?(n.offset=s,n.isError=!1,e.parser(n)):n};return new S(r,O("or",this,this,e))}chain(e,r=!1){const n=s=>(this.parser(s),s.isError?s:s.value||r?e(s.value).parser(s):s);return new S(n,O("chain",this,e))}map(e,r=!1){const n=s=>(this.parser(s),!s.isError||r?s.ok(e(s.value)):s);return new S(n,O("map",this))}mapState(e){const r=n=>{const s=n.offset,i=n.value;if(this.parser(n),n.isError)return n;const o=Object.create(n);return o.offset=s,o.value=i,e(n,o)};return new S(r,O("mapState",this))}skip(e){const r=n=>{const s=n.offset;if(this.parser(n),!n.isError){const i=n.value;if(e.parser(n),!n.isError)return n.ok(i)}return F(n),n.offset=s,n.isError=!0,n};return new S(r,O("skip",this,e))}next(e){const r=n=>{const s=n.offset;return this.parser(n),!n.isError&&(e.parser(n),!n.isError)||(F(n),n.offset=s,n.isError=!0),n};return new S(r,O("next",this,e))}opt(){const e=r=>{const n=r.offset;return this.parser(r),r.isError?(F(r),r.offset=n,r.ok(void 0)):r};return new S(e,O("opt",this))}not(e){const r=s=>{const i=s.offset,o=s.value;return this.parser(s),s.isError?(F(s),s.offset=i,s.ok(o)):(s.offset=i,s.isError=!0,s)},n=s=>{const i=s.offset;if(this.parser(s),s.isError)return F(s),s.offset=i,s.isError=!0,s;{const o=s.value,a=s.offset;return s.offset=i,s.isError=!1,e.parser(s),s.isError?(s.offset=a,s.value=o,s.isError=!1,s):(F(s),s.offset=i,s.isError=!0,s)}};return new S(e?n:r,O("not",this,e))}wrap(e,r,n=!0){if(!n)return E(e,this,r);const s=this,i=o=>{const a=o.offset;if(e.parser(o),o.isError)return o.offset=a,o;if(s.parser(o),o.isError)return F(o),o.offset=a,o.isError=!0,o;const l=o.value;return r.parser(o),o.isError?(F(o),o.offset=a,o.isError=!0,o):(o.value=l,o)};return new S(i,O("wrap",this,e,r))}call(e){if(this.flags===0)return this.parser(e);if(this.flags===De){Se(e);const n=e.offset;return this.parser(e),e.isError?(F(e),e.offset=n,e.isError=!0,e):(Se(e),e)}this.flags&De&&Se(e);const r=e.offset;return this.parser(e),e.isError?(F(e),e.offset=r,e.isError=!0,e):(this.flags&De&&Se(e),this.flags&xs&&e.offset<e.src.length&&(F(e),e.offset=r,e.isError=!0),e)}trim(e=g,r=!0){if(!r)return E(e,this,e);if(e.context?.name==="whitespace"){const n=this,s=new S((o=>n.call(o)),O("trimWhitespace",this));s.flags=this.flags|De;const i=o=>{Se(o);const a=o.offset;return n.parser(o),o.isError?(F(o),o.offset=a,o.isError=!0,o):(Se(o),o)};return new S(i,O("trimWhitespace",this))}return this.wrap(e,e)}many(e=0,r=1/0){const n=s=>{const i=e>0?e:0,o=i>0?new Array(i):[];let a=0;for(let l=0;l<r;l+=1){const c=s.offset;if(this.parser(s),s.isError){s.offset=c,s.isError=!1;break}if(s.offset===c)break;a<i?o[a]=s.value:o.push(s.value),a++}return a<i&&(o.length=a),a>=e?s.ok(o):(F(s),s.isError=!0,s.value=[],s)};return new S(n,O("many",this,e,r))}sepBy(e,r=0,n=1/0){const s=i=>{const o=r>0?r:0,a=o>0?new Array(o):[];let l=0;for(let c=0;c<n;c+=1){const u=i.offset;if(this.parser(i),i.isError){i.offset=u,i.isError=!1;break}if(i.offset===u)break;l<o?a[l]=i.value:a.push(i.value),l++;const f=i.offset;if(e.parser(i),i.isError){i.offset=f,i.isError=!1;break}}return l<o&&(a.length=l),l>=r?i.ok(a):(F(i),i.isError=!0,i.value=[],i)};return new S(s,O("sepBy",this,e))}eof(){const e=this.skip(Ss());return e.context=O("eof",this),e}debug(e="",r=!1,n=console.log){return gs(this,e,r,n)}toString(){return cn(this)}static lazy(e){return new S(ys(e),O("lazy",void 0,e))}}function Ss(){const t=e=>e.offset>=e.src.length?e.ok(void 0):(F(e),e.isError=!0,e);return new S(t,O("eof",void 0))}function d(...t){const e=r=>{const n=r.offset;for(const s of t){if(s.parser(r),!r.isError)return r;r.offset=n,r.isError=!1}return F(r),r.isError=!0,r};return new S(t.length===1?t[0].parser:e,O("any",void 0,...t))}function E(...t){const e=r=>{const n=[],s=r.offset;for(const i of t){if(i.parser(r),r.isError)return r.offset=s,r.isError=!0,r;r.value!==void 0&&n.push(r.value)}return r.ok(n)};return new S(t.length===1?t[0].parser:e,O("all",void 0,...t))}function w(t){const e=t.length;let r;if(e===1){const n=t.charCodeAt(0);r=(s=>s.src.charCodeAt(s.offset)===n?(s.offset+=1,s.value=t,s.isError=!1,s):(F(s),s.isError=!0,s))}else r=(n=>n.src.startsWith(t,n.offset)?(n.offset+=e,n.value=t,n.isError=!1,n):(F(n),n.isError=!0,n));return new S(r,O("string",void 0,t))}function Z(t,e){const r=t.flags.replace(/y/g,""),n=new RegExp(t,r+"y"),s=e!=null,i=o=>{if(o.offset>=o.src.length)return o.isError=!0,o;const a=o.offset;if(n.lastIndex=a,s){const l=n.exec(o.src),c=e(l);if(c)return o.ok(c,n.lastIndex-a);if(c==="")return o.ok(void 0)}else if(n.test(o.src)){const l=n.lastIndex;return l>a?(o.offset=l,o.value=o.src.substring(a,l),o.isError=!1,o):(o.value=void 0,o.isError=!1,o)}return F(o),o.isError=!0,o};return new S(i,O("regex",void 0,t))}const Se=t=>{const e=t.src,r=e.length;let n=t.offset;if(n>=r||e.charCodeAt(n)>32)return t;for(;n<r;){const s=e.charCodeAt(n);if(s===32||s>=9&&s<=13)n++;else break}return t.offset=n,t},g=Z(/\s*/);g.context.name="whitespace";function V(t,e){const[r,n,s]=t;return[e[0]*r+e[1]*n+e[2]*s,e[3]*r+e[4]*n+e[5]*s,e[6]*r+e[7]*n+e[8]*s]}function ue(t){const[e,r,n,s,i,o,a,l,c]=t,u=i*c-o*l,f=-(s*c-o*a),h=s*l-i*a,p=1/(e*u+r*f+n*h);return[u*p,(n*l-r*c)*p,(r*o-n*i)*p,f*p,(e*c-n*a)*p,(n*s-e*o)*p,h*p,(r*a-e*l)*p,(e*i-r*s)*p]}const j=255,k={"%":{min:0,max:100},number:{min:0,max:1}},wt={"%":k["%"],number:{min:0,max:j}},W={"%":k["%"],number:k.number},Te={deg:{min:0,max:360},number:{min:0,max:360},"%":k["%"]},y={rgb:{r:wt,g:wt,b:wt,alpha:k},hsl:{h:Te,s:{"%":k["%"],number:k.number},l:{"%":k["%"],number:k.number},alpha:k},hsv:{h:Te,s:{"%":k["%"],number:k.number},v:{"%":k["%"],number:k.number},alpha:k},hwb:{h:Te,w:{"%":k["%"],number:k.number},b:{"%":k["%"],number:k.number},alpha:k},lab:{l:{"%":k["%"],number:k["%"]},a:{number:{min:-125,max:125},"%":{min:-100,max:100}},b:{number:{min:-125,max:125},"%":{min:-100,max:100}},alpha:k},lch:{l:{"%":k["%"],number:k["%"]},c:{number:{min:0,max:150},"%":k["%"]},h:Te,alpha:k},oklab:{l:{"%":k["%"],number:k.number},a:{number:{min:-.4,max:.4},"%":{min:-100,max:100}},b:{number:{min:-.4,max:.4},"%":{min:-100,max:100}},alpha:k},oklch:{l:{"%":k["%"],number:k.number},c:{number:{min:0,max:.5},"%":k["%"]},h:Te,alpha:k},xyz:{x:{"%":k["%"],number:k.number},y:{"%":k["%"],number:k.number},z:{"%":k["%"],number:k.number},alpha:k},kelvin:{kelvin:{number:{min:1e3,max:4e4}},alpha:k},"srgb-linear":{r:W,g:W,b:W,alpha:k},"display-p3":{r:W,g:W,b:W,alpha:k},"a98-rgb":{r:W,g:W,b:W,alpha:k},"prophoto-rgb":{r:W,g:W,b:W,alpha:k},rec2020:{r:W,g:W,b:W,alpha:k}},D="%",Es={rgb:{r:"",g:"",b:"",alpha:D},hsl:{h:"deg",s:"%",l:"%",alpha:D},hsv:{h:"deg",s:"%",v:"%",alpha:D},hwb:{h:"deg",w:"%",b:"%",alpha:D},lab:{l:"%",a:"",b:"",alpha:D},lch:{l:"%",c:"",h:"deg",alpha:D},oklab:{l:"%",a:"",b:"",alpha:D},oklch:{l:"%",c:"",h:"deg",alpha:D},xyz:{x:"%",y:"%",z:"%",alpha:D},kelvin:{kelvin:"K",alpha:D},"srgb-linear":{r:"",g:"",b:"",alpha:D},"display-p3":{r:"",g:"",b:"",alpha:D},"a98-rgb":{r:"",g:"",b:"",alpha:D},"prophoto-rgb":{r:"",g:"",b:"",alpha:D},rec2020:{r:"",g:"",b:"",alpha:D}},Cs=[.3127/.329,1,(1-.3127-.329)/.329],Ms=[.3457/.3585,1,(1-.3457-.3585)/.3585],Kt=[1.0479297925449969,.022946870601609652,-.05019226628920524,.02962780877005599,.9904344267538799,-.017073799063418826,-.009243040646204504,.015055191490298152,.7518742814281371],hn=ue(Kt),pn={D65:Cs,D50:Ms},mn=[.819022437996703,.3619062600528904,-.1288737815209879,.0329836539323885,.9292868615863434,.0361446663506424,.0481771893596242,.2642395317527308,.6335478284694309],Is=ue(mn),dn=[.210454268309314,.7936177747023054,-.0040720430116193,1.9779985324311684,-2.42859224204858,.450593709617411,.0259040424655478,.7827717124575296,-.8086757549230774],Os=ue(dn),x=[4.0767416621,-3.3077115913,.2309699292,-1.2684380046,2.6097574011,-.3413193965,-.0041960863,-.7034186147,1.707614701],se=[.4122214708,.5363325363,.0514459929,.2119034982,.6806995451,.1073969566,.0883024619,.2817188376,.6299787005],R={l:[1,.3963377774,.2158037573],m:[1,-.1055613458,-.0638541728],s:[1,-.0894841775,-1.291485548]},As=[{test:(t,e)=>-1.88170328*t-.80936493*e>1,k0:1.19086277,k1:1.76576728,k2:.59662641,k3:.75515197,k4:.56771245,wl:4.0767416621,wm:-3.3077115913,ws:.2309699292},{test:(t,e)=>1.81444104*t-1.19445276*e>1,k0:.73956515,k1:-.45954404,k2:.08285427,k3:.1254107,k4:.14503204,wl:-1.2684380046,wm:2.6097574011,ws:-.3413193965},{test:()=>!0,k0:1.35733652,k1:-.00915799,k2:-1.1513021,k3:-.50559606,k4:.00692167,wl:-.0041960863,wm:-.7034186147,ws:1.707614701}],Cr={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"rgba(0, 0, 0, 0)",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32",padaleckipink:"oklch(100% 0.42 360deg / 71.70%)","lodge-blu-color":"rgb(53 101 144)",lavendi:"oklch(79.90% 0.11 318.24deg / 100%)",shadyshroom:"oklch(53% 0.07 21.60deg / 100%)",patriarchalplum:"oklch(31.20% 0.11 19.80deg / 100%)"};function G(t,e,r){return Math.min(Math.max(t,e),r)}function P(t,e,r,n=0,s=1){const i=(s-n)/(r-e);if(r===e)throw new Error("fromMax and fromMin cannot be equal");return(t-e)*i+n}function ye(t,e,r){return(1-t)*e+t*r}function Ze(t,e){const r=e.length-1,n=[...e];for(let s=1;s<=r;s++)for(let i=0;i<=r-s;i++)n[i]=ye(t,n[i],n[i+1]);return n[0]}function Bs(t,e,r,n,s){return[Ze(t,[0,e,n,1]),Ze(t,[0,r,s,1])]}function at(t,e){const r=e.map(s=>s[0]),n=e.map(s=>s[1]);return[Ze(t,r),Ze(t,n)]}const gn=2.4,Je=.055,Ut=12.92,Ps=.04045,bn=Ps/Ut;function kt(t){const e=t<0?-1:1,r=t*e;return r<=bn?t/Ut:e*((r+Je)/(1+Je))**gn}function yt(t){const e=t<0?-1:1,r=t*e;return r<=bn?t*Ut:e*((1+Je)*r**(1/gn)-Je)}function vt(t,e,r){return Math.min(Math.max(t,e),r)}function Xt(t,e,r){const n=t+R.l[1]*e+R.l[2]*r,s=t+R.m[1]*e+R.m[2]*r,i=t+R.s[1]*e+R.s[2]*r,o=n*n*n,a=s*s*s,l=i*i*i;return[x[0]*o+x[1]*a+x[2]*l,x[3]*o+x[4]*a+x[5]*l,x[6]*o+x[7]*a+x[8]*l]}function Ts(t,e,r){return t>=0&&t<=1&&e>=0&&e<=1&&r>=0&&r<=1}function zs(t,e){const r=As.find(M=>M.test(t,e)),{k0:n,k1:s,k2:i,k3:o,k4:a,wl:l,wm:c,ws:u}=r;let f=n+s*t+i*e+o*t*t+a*t*e;const h=R.l[1]*t+R.l[2]*e,p=R.m[1]*t+R.m[2]*e,T=R.s[1]*t+R.s[2]*e;{const M=1+f*h,z=1+f*p,C=1+f*T,I=M*M*M,v=z*z*z,U=C*C*C,ne=3*h*M*M,he=3*p*z*z,Oe=3*T*C*C,Ae=6*h*h*M,Be=6*p*p*z,Pe=6*T*T*C,xe=l*I+c*v+u*U,pe=l*ne+c*he+u*Oe,Le=l*Ae+c*Be+u*Pe;f=f-xe*pe/(pe*pe-.5*xe*Le)}return f}function Fs(t,e){const r=zs(t,e),[n,s,i]=Xt(1,r*t,r*e),o=Math.cbrt(1/Math.max(n,s,i)),a=o*r;return{L:o,C:a}}function $s(t,e,r,n,s,i){let o;if((r-s)*i.C-(i.L-s)*n<=0)o=i.C*s/(n*i.L+i.C*(s-r));else{o=i.C*(s-1)/(n*(i.L-1)+i.C*(s-r));const a=r-s,l=n,c=R.l[1]*t+R.l[2]*e,u=R.m[1]*t+R.m[2]*e,f=R.s[1]*t+R.s[2]*e,h=a+l*c,p=a+l*u,T=a+l*f;{const M=s*(1-o)+o*r,z=o*n,C=M+z*c,I=M+z*u,v=M+z*f,U=C*C*C,ne=I*I*I,he=v*v*v,Oe=3*h*C*C,Ae=3*p*I*I,Be=3*T*v*v,Pe=6*h*h*C,xe=6*p*p*I,pe=6*T*T*v,Le=x[0]*U+x[1]*ne+x[2]*he-1,ht=x[0]*Oe+x[1]*Ae+x[2]*Be,us=x[0]*Pe+x[1]*xe+x[2]*pe,mr=ht/(ht*ht-.5*Le*us);let pt=-Le*mr;const dr=x[3]*U+x[4]*ne+x[5]*he-1,mt=x[3]*Oe+x[4]*Ae+x[5]*Be,fs=x[3]*Pe+x[4]*xe+x[5]*pe,gr=mt/(mt*mt-.5*dr*fs);let dt=-dr*gr;const br=x[6]*U+x[7]*ne+x[8]*he-1,gt=x[6]*Oe+x[7]*Ae+x[8]*Be,hs=x[6]*Pe+x[7]*xe+x[8]*pe,wr=gt/(gt*gt-.5*br*hs);let bt=-br*wr;pt=mr>=0?pt:1/0,dt=gr>=0?dt:1/0,bt=wr>=0?bt:1/0,o+=Math.min(pt,dt,bt)}}return o}const Ns=1e-5,Vs=.05;function js(t,e,r){const[n,s,i]=Xt(t,e,r);if(Ts(n,s,i))return[t,e,r];const o=Math.max(Ns,Math.sqrt(e*e+r*r)),a=e/o,l=r/o,c=Fs(a,l),u=t-.5,f=.5+Math.abs(u)+Vs*o,h=.5*(1+Math.sign(u)*(f-Math.sqrt(f*f-2*Math.abs(u)))),p=$s(a,l,t,o,h,c),T=h*(1-p)+p*t,M=p*o;return[T,M*a,M*l]}function Rs(t,e,r){const n=kt(t),s=kt(e),i=kt(r),o=Math.cbrt(se[0]*n+se[1]*s+se[2]*i),a=Math.cbrt(se[3]*n+se[4]*s+se[5]*i),l=Math.cbrt(se[6]*n+se[7]*s+se[8]*i);return[.2104542553*o+.793617785*a-.0040720468*l,1.9779984951*o-2.428592205*a+.4505937099*l,.0259040371*o+.7827717662*a-.808675766*l]}function Ls(t,e,r){if(t>=0&&t<=1&&e>=0&&e<=1&&r>=0&&r<=1)return[t,e,r];const[n,s,i]=Rs(t,e,r),[o,a,l]=js(n,s,i),[c,u,f]=Xt(o,a,l);return[vt(yt(c),0,1),vt(yt(u),0,1),vt(yt(f),0,1)]}const le=16,Ws=t=>{if(t=t.slice(1),t.length<=4){const e=parseInt(t[0]+t[0],le),r=parseInt(t[1]+t[1],le),n=parseInt(t[2]+t[2],le),s=t[3]?parseInt(t[3]+t[3],le)/j:1;return new q(e,r,n,s)}else{const e=parseInt(t.slice(0,2),le),r=parseInt(t.slice(2,4),le),n=parseInt(t.slice(4,6),le),s=t.length===8?parseInt(t.slice(6,8),le)/j:1;return new q(e,r,n,s)}},wn=1e3,kn=4e4,yn=100,vn=({kelvin:t,alpha:e})=>{t=G(t,wn,kn)/yn;let r,n,s;return t<=66?r=j:(r=t-60,r=329.698727446*r**-.1332047592),r=G(r,0,j)/j,t<=66?(n=t,n=99.4708025861*Math.log(n)-161.1195681661):(n=t-60,n=288.1221695283*n**-.0755148492),n=G(n,0,j)/j,t>=66?s=j:t<=19?s=0:(s=t-10,s=138.5177312231*Math.log(s)-305.0447927307),s=G(s,0,j)/j,new q(r,n,s,e)},Ds=({r:t,g:e,b:r,alpha:n})=>{t=G(t*j,0,j),e=G(e*j,0,j),r=G(r*j,0,j);let s;if(r===j?s=6600:r===0?s=1900:s=Math.exp((r+305.0447927307)/138.5177312231)+10,t<j){const o=(329.698727446/t)**-7.507239275877164+60;s=Math.max(s,o)}const i=s<=6600?Math.exp((e+161.1195681661)/99.4708025861):(288.1221695283/e)**(1/-.0755148492)+60;return s=(s+i)/2,s=G(Math.round(s*yn),wn,kn),new ln(s,n)},xn=({h:t,s:e,v:r,alpha:n})=>{const s=r-r*e/2;let i;return s===0||s===1?i=0:i=(r-s)/Math.min(s,1-s),new je(t,i,s,n)},Sn=({h:t,s:e,l:r,alpha:n})=>{const s=r+e*Math.min(r,1-r);let i;return s===0?i=0:i=2*(1-r/s),new $t(t,i,s,n)},qs=({h:t,w:e,b:r,alpha:n})=>{let s,i;const o=e+r;return o>=1?(i=e/o,s=0):(i=1-r,s=i===0?0:1-e/i),xn(new $t(t,s,i,n))},Ks=({h:t,s:e,l:r,alpha:n})=>{const{h:s,s:i,v:o}=Sn(new je(t,e,r,n));return new Nt(s,o*(1-i),1-o,n)},Us=({r:t,g:e,b:r,alpha:n})=>{const s=Math.max(t,e,r),i=Math.min(t,e,r);let[o,a,l]=[0,0,(s+i)/2];const c=s-i;switch(a=c/(1-Math.abs(2*l-1)),s){case t:o=(e-r)/c+(e<r?6:0);break;case e:o=(r-t)/c+2;break;case r:o=(t-e)/c+4;break}return o/=6,a<0&&(o=(o+.5)%1,a=Math.abs(a)%1),o>=1&&(o-=1),new je(o,a,l,n)};function Xs({h:t,s:e,l:r,alpha:n}){const s=(1-Math.abs(2*r-1))*e,i=s*(1-Math.abs(t*6%2-1)),o=r-s/2;let a,l,c;return t<1/6?[a,l,c]=[s,i,0]:t<2/6?[a,l,c]=[i,s,0]:t<3/6?[a,l,c]=[0,s,i]:t<4/6?[a,l,c]=[0,i,s]:t<5/6?[a,l,c]=[i,0,s]:[a,l,c]=[s,0,i],new q(a+o,l+o,c+o,n)}const Ys=216/24389,Hs=24/116,Ct=24389/27,Gs=8,ze=16,Fe=116,En=500,Cn=200;function Zs(t){if(t.whitePoint==="D50")return[t.x,t.y,t.z];if(t.whitePoint==="D65")return V([t.x,t.y,t.z],Kt);throw new Error(`Unsupported white point: ${t.whitePoint}`)}function Js(t){if(t.whitePoint==="D65")return[t.x,t.y,t.z];if(t.whitePoint==="D50")return V([t.x,t.y,t.z],hn);throw new Error(`Unsupported white point: ${t.whitePoint}`)}function Mn(t,e="D50"){const r=C=>C>Ys?Math.cbrt(C):(Ct*C+ze)/Fe,n=pn[e],[s,i,o]=Zs(t),a=s/n[0],l=i/n[1],c=o/n[2],u=r(a),f=r(l),h=r(c),p=Fe*f-ze,T=En*(u-f),M=Cn*(f-h),z=new it(P(p,y.lab.l.number.min,y.lab.l.number.max),P(T,y.lab.a.number.min,y.lab.a.number.max),P(M,y.lab.b.number.min,y.lab.b.number.max),t.alpha);return z.whitePoint=e,z}function In(t){const e=I=>I>Hs?I**3:(Fe*I-ze)/Ct,r=I=>I>Gs?((I+ze)/Fe)**3:I/Ct,n=pn[t.whitePoint];let{l:s,a:i,b:o,alpha:a}=t;s=P(s,0,1,y.lab.l.number.min,y.lab.l.number.max),i=P(i,0,1,y.lab.a.number.min,y.lab.a.number.max),o=P(o,0,1,y.lab.b.number.min,y.lab.b.number.max);const l=(s+ze)/Fe,c=i/En+l,u=l-o/Cn,[f,h,p]=[e(c),r(s),e(u)];let T=f*n[0],M=h*n[1],z=p*n[2];const C=new X(T,M,z,a);return C.whitePoint=t.whitePoint,[T,M,z]=Js(C),C.whitePoint="D65",C.x=T,C.y=M,C.z=z,C}const Yt=[.41239079926595934,.357584339383878,.1804807884018343,.21263900587151027,.715168678767756,.07219231536073371,.01933081871559182,.11919477979462598,.9505321522496607],On=ue(Yt),An=2.4,Qe=.055,Ht=12.92,Qs=.04045,Bn=Qs/Ht;function Ie(t){const e=t<0?-1:1,r=t*e;return r<=Bn?t/Ht:e*((r+Qe)/(1+Qe))**An}function Pn(t){const e=t<0?-1:1,r=t*e;return r<=Bn?t*Ht:e*((1+Qe)*r**(1/An)-Qe)}function Gt({r:t,g:e,b:r,alpha:n}){const s=[Ie(t),Ie(e),Ie(r)],[i,o,a]=V(s,Yt);return new X(i,o,a,n)}const Zt=({x:t,y:e,z:r,alpha:n},s=!0)=>{const i=V([t,e,r],On),[o,a,l]=i.map(Pn);if(s){const c=Bi(new q(o,a,l,n));return new q(c.r,c.g,c.b,n)}else return new q(o,a,l,n)};function _s({l:t,c:e,h:r,alpha:n}){e=P(e,0,1,y.lch.c.number.min,y.lch.c.number.max);const s=r*2*Math.PI,i=Math.cos(s)*e,o=Math.sin(s)*e;return new it(t,P(i,y.lab.a.number.min,y.lab.a.number.max),P(o,y.lab.b.number.min,y.lab.b.number.max),n)}function ei({l:t,a:e,b:r,alpha:n}){e=P(e,0,1,y.lab.a.number.min,y.lab.a.number.max),r=P(r,0,1,y.lab.b.number.min,y.lab.b.number.max);const s=Math.hypot(e,r);let i=Math.atan2(r,e)/(2*Math.PI);return i<0&&(i+=1),new Vt(t,P(s,y.lch.c.number.min,y.lch.c.number.max),i,n)}function Tn({l:t,a:e,b:r,alpha:n}){e=P(e,0,1,y.oklab.a.number.min,y.oklab.a.number.max),r=P(r,0,1,y.oklab.b.number.min,y.oklab.b.number.max);const s=V([t,e,r],Os),i=[s[0]*s[0]*s[0],s[1]*s[1]*s[1],s[2]*s[2]*s[2]],[o,a,l]=V(i,Is);return new X(o,a,l,n)}function zn(t){const{x:e,y:r,z:n}=t,s=V([e,r,n],mn),i=[Math.cbrt(s[0]),Math.cbrt(s[1]),Math.cbrt(s[2])],[o,a,l]=V(i,dn);return new ot(o,P(a,y.oklab.a.number.min,y.oklab.a.number.max),P(l,y.oklab.b.number.min,y.oklab.b.number.max),t.alpha)}function ti({l:t,a:e,b:r,alpha:n}){e=P(e,0,1,y.oklab.a.number.min,y.oklab.a.number.max),r=P(r,0,1,y.oklab.b.number.min,y.oklab.b.number.max);const s=Math.hypot(e,r);let i=Math.atan2(r,e)/(2*Math.PI);return i<0&&(i+=1),new jt(t,P(s,y.oklch.c.number.min,y.oklch.c.number.max),i,n)}function ri({l:t,c:e,h:r,alpha:n}){e=P(e,0,1,y.oklch.c.number.min,y.oklch.c.number.max);const s=r*2*Math.PI,i=Math.cos(s)*e,o=Math.sin(s)*e;return new ot(t,P(i,y.oklab.a.number.min,y.oklab.a.number.max),P(o,y.oklab.b.number.min,y.oklab.b.number.max),n)}function Jt(t){const e=Xs(t);return Gt(e)}function Qt(t){const e=Zt(t);return Us(e)}function ni(t){const e=xn(t);return Jt(e)}function si(t){const e=Qt(t);return Sn(e)}function ii(t){const e=qs(t);return Jt(e)}function oi(t){const e=Qt(t);return Ks(e)}function ai(t){const e=_s(t);return In(e)}function li(t){const e=Mn(t);return ei(e)}function ci(t){const e=ri(t);return Tn(e)}function ui(t){const e=zn(t);return ti(e)}function fi(t){const e=vn(t);return Gt(e)}function hi(t){const e=Zt(t);return Ds(e)}const Fn=563/256;function xt(t){return(t<0?-1:1)*Math.abs(t)**Fn}function pi(t){return(t<0?-1:1)*Math.abs(t)**(1/Fn)}const $n=1/512,Nn=1.8;function St(t){const e=t<0?-1:1,r=Math.abs(t);return e*(r<=$n*16?r/16:r**Nn)}function mi(t){const e=t<0?-1:1,r=Math.abs(t);return e*(r>=$n?r**(1/Nn):r*16)}const _e=1.09929682680944,Vn=.018053968510807;function Et(t){const e=t<0?-1:1,r=Math.abs(t);return r<Vn*4.5?e*r/4.5:e*((r+_e-1)/_e)**(1/.45)}function di(t){const e=t<0?-1:1,r=Math.abs(t);return r>=Vn?e*(_e*r**.45-(_e-1)):e*4.5*r}const jn=[.4865709486482162,.26566769316909306,.1982172852343625,.22897456406974884,.6917385218365064,.079286914093745,0,.04511338185890264,1.043944368900976],gi=ue(jn),Rn=[.5766690429101305,.1855582379065463,.1882286462349947,.29734497525053605,.6273635662554661,.07529145849399788,.02703136138641234,.07068885253582723,.9913375368376388],bi=ue(Rn),Ln=[.7977604896723027,.13518583717574031,.0313493495815248,.2880711282292934,.7118432178101014,8565396060525902e-20,0,0,.8251046025104602],wi=ue(Ln),Wn=[.6369580483012914,.14461690358620832,.1688809751641721,.2627002120112671,.6779980715188708,.05930171646986196,0,.028072693049087428,1.0609850577107909],ki=ue(Wn);function yi({r:t,g:e,b:r,alpha:n}){const[s,i,o]=V([t,e,r],Yt);return new X(s,i,o,n)}function vi({x:t,y:e,z:r,alpha:n}){const[s,i,o]=V([t,e,r],On);return new Rt(s,i,o,n)}function xi({r:t,g:e,b:r,alpha:n}){const s=[Ie(t),Ie(e),Ie(r)],[i,o,a]=V(s,jn);return new X(i,o,a,n)}function Si({x:t,y:e,z:r,alpha:n}){const s=V([t,e,r],gi),[i,o,a]=s.map(Pn);return new Lt(i,o,a,n)}function Ei({r:t,g:e,b:r,alpha:n}){const s=[xt(t),xt(e),xt(r)],[i,o,a]=V(s,Rn);return new X(i,o,a,n)}function Ci({x:t,y:e,z:r,alpha:n}){const s=V([t,e,r],bi),[i,o,a]=s.map(pi);return new Wt(i,o,a,n)}function Mi({r:t,g:e,b:r,alpha:n}){const s=[St(t),St(e),St(r)],i=V(s,Ln),[o,a,l]=V(i,hn);return new X(o,a,l,n)}function Ii({x:t,y:e,z:r,alpha:n}){const s=V([t,e,r],Kt),i=V(s,wi),[o,a,l]=i.map(mi);return new Dt(o,a,l,n)}function Oi({r:t,g:e,b:r,alpha:n}){const s=[Et(t),Et(e),Et(r)],[i,o,a]=V(s,Wn);return new X(i,o,a,n)}function Ai({x:t,y:e,z:r,alpha:n}){const s=V([t,e,r],ki),[i,o,a]=s.map(di);return new qt(i,o,a,n)}const Mr={rgb:{to:Gt,from:Zt},hsl:{to:Jt,from:Qt},hsv:{to:ni,from:si},hwb:{to:ii,from:oi},lab:{to:In,from:Mn},lch:{to:ai,from:li},oklab:{to:Tn,from:zn},oklch:{to:ci,from:ui},kelvin:{to:fi,from:hi},xyz:{to:t=>t,from:t=>t},"srgb-linear":{to:yi,from:vi},"display-p3":{to:xi,from:Si},"a98-rgb":{to:Ei,from:Ci},"prophoto-rgb":{to:Mi,from:Ii},rec2020:{to:Oi,from:Ai}};function ke(t,e){if(t.colorSpace===e)return t;const r=Mr[t.colorSpace];if(!r)throw new Error(`Unknown source color space: "${t.colorSpace}"`);const n=Mr[e];if(!n)throw new Error(`Unknown target color space: "${e}"`);const s=r.to(t),i=n.from;return i(s)}const Ee=1e-6;function Bi(t){const e=ke(t,"rgb"),r=Number.isNaN(e.r)?0:e.r,n=Number.isNaN(e.g)?0:e.g,s=Number.isNaN(e.b)?0:e.b;if(r>=0&&r<=1&&n>=0&&n<=1&&s>=0&&s<=1)return t;if(r>=-Ee&&r<=1+Ee&&n>=-Ee&&n<=1+Ee&&s>=-Ee&&s<=1+Ee){const c=new q(G(r,0,1),G(n,0,1),G(s,0,1),t.alpha);return ke(c,t.colorSpace)}const[i,o,a]=Ls(r,n,s),l=new q(i,o,a,t.alpha);return ke(l,t.colorSpace)}const Pi={hsl:"h",hsv:"h",hwb:"h",lch:"h",oklch:"h"};function Ti(t,e,r,n="shorter"){if(Number.isNaN(t)&&Number.isNaN(e))return 0;if(Number.isNaN(t))return e;if(Number.isNaN(e))return t;let s=e-t;switch(n){case"shorter":s>.5?t+=1:s<-.5&&(e+=1);break;case"longer":s>0&&s<.5?t+=1:s>-.5&&s<=0&&(e+=1);break;case"increasing":s<0&&(e+=1);break;case"decreasing":s>0&&(t+=1);break}let i=t+r*(e-t);return i=(i%1+1)%1,i}function zi(t,e,r,n,s="oklab",i="shorter"){const o=ke(t,s),a=ke(e,s);r<0&&(r=0),n<0&&(n=0);const l=r+n;l===0?(r=.5,n=.5):l!==1&&(r=r/l,n=n/l);const c=Math.min(l,1),u=Pi[s],f=o.keys().filter(C=>C!=="alpha"),h=Number.isNaN(o.alpha)?a.alpha:o.alpha,p=Number.isNaN(a.alpha)?o.alpha:a.alpha,T=ye(n,h,p)*c,M=[];for(const C of f){let I=o[C],v=a[C];if(Number.isNaN(I)&&Number.isNaN(v)){M.push(0);continue}if(Number.isNaN(I)&&(I=v),Number.isNaN(v)&&(v=I),C===u)M.push(Ti(I,v,n,i));else{const U=I*h,ne=v*p,he=ye(n,U,ne);M.push(T>0?he/T:0)}}const z=o.constructor;return new z(...M,T)}const Fi=(t,e,r)=>{const n=y[e][r];return n[t]??n.number},$i=(t,e,r,n,s=!1)=>{e=s?Es[r][n]:e;const{min:i,max:o}=Fi(e,r,n),[a,l,c,u]=s?[i,o,0,1]:[0,1,i,o],f=P(t,c,u,a,l);return new b(f,s?e:"")},Ni=(t,e=!1)=>{const r=t.colorSpace;return t.keys().forEach(n=>{const s=t[n]instanceof b?t[n].value:t[n];t[n]=$i(s,t[n]?.unit,r,n,e)}),t},Mt=(t,e=!1,r=!1)=>{t=r?t:t.clone();const n=Ni(t.value,e);return r?t:new b(n).coalesce(t,!0)},Ir=(t,e="oklab",r=!1,n=!1,s=!1)=>{const i=r?s?t:t.clone():Mt(t,!1,s),o=ke(i.toJSON(),e);return o.entries().forEach(([a,l])=>{o[a]=new b(l)}),i.value=o,i.superType[1]=e,n?Mt(i,!0,!0):i},Vi=(t,e,r="oklab",n=!1,s=!1,i=!1,o)=>[Ir(t,r,n,s,i),Ir(e,r,n,s,i),o],Dn=["px","cm","mm","Q","in","pc","pt"],qn=["em","ex","ch","cap","ic","rem","lh","rlh","vw","vh","vmin","vmax","vb","vi","svw","svh","svi","svb","svmin","svmax","lvw","lvh","lvi","lvb","lvmin","lvmax","dvw","dvh","dvi","dvb","dvmin","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],ji=[...Dn,...qn],Ri=["s","ms"],Li=["deg","rad","grad","turn"],Wi=["%"],Di=["Hz","kHz"],qi=["dpi","dpcm","dppx"],Ki=["fr"],Ne=["var","calc"],Ui=["string","var","calc"],Xi=["accentColor","additiveSymbols","alignContent","alignItems","alignSelf","alignmentBaseline","all","anchorName","animation","animationComposition","animationDelay","animationDirection","animationDuration","animationFillMode","animationIterationCount","animationName","animationPlayState","animationRange","animationRangeEnd","animationRangeStart","animationTimeline","animationTimingFunction","appRegion","appearance","ascentOverride","aspectRatio","backdropFilter","backfaceVisibility","background","backgroundAttachment","backgroundBlendMode","backgroundClip","backgroundColor","backgroundImage","backgroundOrigin","backgroundPosition","backgroundPositionX","backgroundPositionY","backgroundRepeat","backgroundSize","basePalette","baselineShift","baselineSource","blockSize","border","borderBlock","borderBlockColor","borderBlockEnd","borderBlockEndColor","borderBlockEndStyle","borderBlockEndWidth","borderBlockStart","borderBlockStartColor","borderBlockStartStyle","borderBlockStartWidth","borderBlockStyle","borderBlockWidth","borderBottom","borderBottomColor","borderBottomLeftRadius","borderBottomRightRadius","borderBottomStyle","borderBottomWidth","borderCollapse","borderColor","borderEndEndRadius","borderEndStartRadius","borderImage","borderImageOutset","borderImageRepeat","borderImageSlice","borderImageSource","borderImageWidth","borderInline","borderInlineColor","borderInlineEnd","borderInlineEndColor","borderInlineEndStyle","borderInlineEndWidth","borderInlineStart","borderInlineStartColor","borderInlineStartStyle","borderInlineStartWidth","borderInlineStyle","borderInlineWidth","borderLeft","borderLeftColor","borderLeftStyle","borderLeftWidth","borderRadius","borderRight","borderRightColor","borderRightStyle","borderRightWidth","borderSpacing","borderStartEndRadius","borderStartStartRadius","borderStyle","borderTop","borderTopColor","borderTopLeftRadius","borderTopRightRadius","borderTopStyle","borderTopWidth","borderWidth","bottom","boxShadow","boxSizing","breakAfter","breakBefore","breakInside","bufferedRendering","captionSide","caretColor","clear","clip","clipPath","clipRule","color","colorInterpolation","colorInterpolationFilters","colorRendering","colorScheme","columnCount","columnFill","columnGap","columnRule","columnRuleColor","columnRuleStyle","columnRuleWidth","columnSpan","columnWidth","columns","contain","containIntrinsicBlockSize","containIntrinsicHeight","containIntrinsicInlineSize","containIntrinsicSize","containIntrinsicWidth","container","containerName","containerType","content","contentVisibility","counterIncrement","counterReset","counterSet","cursor","cx","cy","d","descentOverride","direction","display","dominantBaseline","emptyCells","fallback","fieldSizing","fill","fillOpacity","fillRule","filter","flex","flexBasis","flexDirection","flexFlow","flexGrow","flexShrink","flexWrap","float","floodColor","floodOpacity","font","fontDisplay","fontFamily","fontFeatureSettings","fontKerning","fontOpticalSizing","fontPalette","fontSize","fontStretch","fontStyle","fontSynthesis","fontSynthesisSmallCaps","fontSynthesisStyle","fontSynthesisWeight","fontVariant","fontVariantAlternates","fontVariantCaps","fontVariantEastAsian","fontVariantLigatures","fontVariantNumeric","fontVariantPosition","fontVariationSettings","fontWeight","forcedColorAdjust","gap","grid","gridArea","gridAutoColumns","gridAutoFlow","gridAutoRows","gridColumn","gridColumnEnd","gridColumnGap","gridColumnStart","gridGap","gridRow","gridRowEnd","gridRowGap","gridRowStart","gridTemplate","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","height","hyphenateCharacter","hyphenateLimitChars","hyphens","imageOrientation","imageRendering","inherits","initialLetter","initialValue","inlineSize","inset","insetArea","insetBlock","insetBlockEnd","insetBlockStart","insetInline","insetInlineEnd","insetInlineStart","isolation","justifyContent","justifyItems","justifySelf","left","letterSpacing","lightingColor","lineBreak","lineGapOverride","lineHeight","listStyle","listStyleImage","listStylePosition","listStyleType","margin","marginBlock","marginBlockEnd","marginBlockStart","marginBottom","marginInline","marginInlineEnd","marginInlineStart","marginLeft","marginRight","marginTop","marker","markerEnd","markerMid","markerStart","mask","maskClip","maskComposite","maskImage","maskMode","maskOrigin","maskPosition","maskRepeat","maskSize","maskType","mathDepth","mathShift","mathStyle","maxBlockSize","maxHeight","maxInlineSize","maxWidth","minBlockSize","minHeight","minInlineSize","minWidth","mixBlendMode","navigation","negative","objectFit","objectPosition","objectViewBox","offset","offsetAnchor","offsetDistance","offsetPath","offsetPosition","offsetRotate","opacity","order","orphans","outline","outlineColor","outlineOffset","outlineStyle","outlineWidth","overflow","overflowAnchor","overflowClipMargin","overflowWrap","overflowX","overflowY","overlay","overrideColors","overscrollBehavior","overscrollBehaviorBlock","overscrollBehaviorInline","overscrollBehaviorX","overscrollBehaviorY","pad","padding","paddingBlock","paddingBlockEnd","paddingBlockStart","paddingBottom","paddingInline","paddingInlineEnd","paddingInlineStart","paddingLeft","paddingRight","paddingTop","page","pageBreakAfter","pageBreakBefore","pageBreakInside","pageOrientation","paintOrder","perspective","perspectiveOrigin","placeContent","placeItems","placeSelf","pointerEvents","position","positionAnchor","positionTry","positionTryOptions","positionTryOrder","positionVisibility","prefix","quotes","r","range","resize","right","rotate","rowGap","rubyPosition","rx","ry","scale","scrollBehavior","scrollMargin","scrollMarginBlock","scrollMarginBlockEnd","scrollMarginBlockStart","scrollMarginBottom","scrollMarginInline","scrollMarginInlineEnd","scrollMarginInlineStart","scrollMarginLeft","scrollMarginRight","scrollMarginTop","scrollPadding","scrollPaddingBlock","scrollPaddingBlockEnd","scrollPaddingBlockStart","scrollPaddingBottom","scrollPaddingInline","scrollPaddingInlineEnd","scrollPaddingInlineStart","scrollPaddingLeft","scrollPaddingRight","scrollPaddingTop","scrollSnapAlign","scrollSnapStop","scrollSnapType","scrollTimeline","scrollTimelineAxis","scrollTimelineName","scrollbarColor","scrollbarGutter","scrollbarWidth","shapeImageThreshold","shapeMargin","shapeOutside","shapeRendering","size","sizeAdjust","speak","speakAs","src","stopColor","stopOpacity","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","suffix","symbols","syntax","system","tabSize","tableLayout","textAlign","textAlignLast","textAnchor","textCombineUpright","textDecoration","textDecorationColor","textDecorationLine","textDecorationSkipInk","textDecorationStyle","textDecorationThickness","textEmphasis","textEmphasisColor","textEmphasisPosition","textEmphasisStyle","textIndent","textOrientation","textOverflow","textRendering","textShadow","textSizeAdjust","textSpacingTrim","textTransform","textUnderlineOffset","textUnderlinePosition","textWrap","timelineScope","top","touchAction","transform","transformBox","transformOrigin","transformStyle","transition","transitionBehavior","transitionDelay","transitionDuration","transitionProperty","transitionTimingFunction","translate","types","unicodeBidi","unicodeRange","userSelect","vectorEffect","verticalAlign","viewTimeline","viewTimelineAxis","viewTimelineInset","viewTimelineName","viewTransitionClass","viewTransitionName","visibility","webkitAlignContent","webkitAlignItems","webkitAlignSelf","webkitAnimation","webkitAnimationDelay","webkitAnimationDirection","webkitAnimationDuration","webkitAnimationFillMode","webkitAnimationIterationCount","webkitAnimationName","webkitAnimationPlayState","webkitAnimationTimingFunction","webkitAppRegion","webkitAppearance","webkitBackfaceVisibility","webkitBackgroundClip","webkitBackgroundOrigin","webkitBackgroundSize","webkitBorderAfter","webkitBorderAfterColor","webkitBorderAfterStyle","webkitBorderAfterWidth","webkitBorderBefore","webkitBorderBeforeColor","webkitBorderBeforeStyle","webkitBorderBeforeWidth","webkitBorderBottomLeftRadius","webkitBorderBottomRightRadius","webkitBorderEnd","webkitBorderEndColor","webkitBorderEndStyle","webkitBorderEndWidth","webkitBorderHorizontalSpacing","webkitBorderImage","webkitBorderRadius","webkitBorderStart","webkitBorderStartColor","webkitBorderStartStyle","webkitBorderStartWidth","webkitBorderTopLeftRadius","webkitBorderTopRightRadius","webkitBorderVerticalSpacing","webkitBoxAlign","webkitBoxDecorationBreak","webkitBoxDirection","webkitBoxFlex","webkitBoxOrdinalGroup","webkitBoxOrient","webkitBoxPack","webkitBoxReflect","webkitBoxShadow","webkitBoxSizing","webkitClipPath","webkitColumnBreakAfter","webkitColumnBreakBefore","webkitColumnBreakInside","webkitColumnCount","webkitColumnGap","webkitColumnRule","webkitColumnRuleColor","webkitColumnRuleStyle","webkitColumnRuleWidth","webkitColumnSpan","webkitColumnWidth","webkitColumns","webkitFilter","webkitFlex","webkitFlexBasis","webkitFlexDirection","webkitFlexFlow","webkitFlexGrow","webkitFlexShrink","webkitFlexWrap","webkitFontFeatureSettings","webkitFontSmoothing","webkitHyphenateCharacter","webkitJustifyContent","webkitLineBreak","webkitLineClamp","webkitLocale","webkitLogicalHeight","webkitLogicalWidth","webkitMarginAfter","webkitMarginBefore","webkitMarginEnd","webkitMarginStart","webkitMask","webkitMaskBoxImage","webkitMaskBoxImageOutset","webkitMaskBoxImageRepeat","webkitMaskBoxImageSlice","webkitMaskBoxImageSource","webkitMaskBoxImageWidth","webkitMaskClip","webkitMaskComposite","webkitMaskImage","webkitMaskOrigin","webkitMaskPosition","webkitMaskPositionX","webkitMaskPositionY","webkitMaskRepeat","webkitMaskSize","webkitMaxLogicalHeight","webkitMaxLogicalWidth","webkitMinLogicalHeight","webkitMinLogicalWidth","webkitOpacity","webkitOrder","webkitPaddingAfter","webkitPaddingBefore","webkitPaddingEnd","webkitPaddingStart","webkitPerspective","webkitPerspectiveOrigin","webkitPerspectiveOriginX","webkitPerspectiveOriginY","webkitPrintColorAdjust","webkitRtlOrdering","webkitRubyPosition","webkitShapeImageThreshold","webkitShapeMargin","webkitShapeOutside","webkitTapHighlightColor","webkitTextCombine","webkitTextDecorationsInEffect","webkitTextEmphasis","webkitTextEmphasisColor","webkitTextEmphasisPosition","webkitTextEmphasisStyle","webkitTextFillColor","webkitTextOrientation","webkitTextSecurity","webkitTextSizeAdjust","webkitTextStroke","webkitTextStrokeColor","webkitTextStrokeWidth","webkitTransform","webkitTransformOrigin","webkitTransformOriginX","webkitTransformOriginY","webkitTransformOriginZ","webkitTransformStyle","webkitTransition","webkitTransitionDelay","webkitTransitionDuration","webkitTransitionProperty","webkitTransitionTimingFunction","webkitUserDrag","webkitUserModify","webkitUserSelect","webkitWritingMode","whiteSpace","whiteSpaceCollapse","widows","width","willChange","wordBreak","wordSpacing","wordWrap","writingMode","x","y","zIndex","zoom"];function It(t){return t.unit==="color"}const Kn=t=>{const e={},r=(n,s=void 0)=>{if(Array.isArray(n)){n.forEach((o,a)=>r(o,s));return}else if(n instanceof N){let o=n.name;s&&(s.endsWith(n.name)?o=s:o=`${s}.${n.name}`),n.values.forEach((a,l)=>r(a,o));return}else if(zt(n)){for(const[o,a]of Object.entries(n)){const l=s?`${s}.${o}`:o;r(a,l)}return}const i=s;e[i]==null&&(e[i]=new ve),e[i].push(n),e[i]=e[i].flat()};return r(t),e},Yi=t=>{const e={};for(const[r,n]of Object.entries(t)){const s=r.split(".");let i=e;for(let o=0;o<s.length;o++){const a=s[o];o===s.length-1?Array.isArray(i)?i.push(n):i[a]=n:(a in i||(i[a]={}),i=i[a])}}return e},Un=t=>{const e={};for(const[r,n]of Object.entries(t)){const s=r.split("."),i=s[0];let o=e[i]??"",a="",l="";for(let u=1;u<s.length;u++)a+=`${s[u]}(`,l+=")";let c="";s.length>1&&Array.isArray(n)?c=n.join(", "):c=n.toString(),o+=` ${a}${c}${l}`,e[i]=o.trim()}return e};new Set(Xi);const Xn=t=>{const e=t.name,r=t.valueOf();if(!t.name.startsWith("matrix"))throw new Error("Input must be a matrix or matrix3d value");const n={scaleX:1,scaleY:1,scaleZ:1,skewX:0,skewY:0,skewZ:0,translateX:0,translateY:0,translateZ:0,rotateX:0,rotateY:0,rotateZ:0,perspectiveX:0,perspectiveY:0,perspectiveZ:0,perspectiveW:1};if(t.name==="matrix")return{...n,scaleX:r[0]??1,skewY:r[1]??0,skewX:r[2]??0,scaleY:r[3]??1,translateX:r[4]??0,translateY:r[5]??0,rotateZ:Math.atan2(r[1]??0,r[0]??1),rotateY:Math.atan2(-(r[2]??0),r[0]??1),rotateX:Math.atan2(r[1]??0,r[3]??1)};if(e==="matrix3d"){if(r.length===4)return{...n,translateX:r[0]??0,translateY:r[1]??0,translateZ:r[2]??0,perspectiveW:r[3]??1};if(r.length===16)return{scaleX:r[0]??1,skewY:r[1]??0,skewX:r[4]??0,scaleY:r[5]??1,scaleZ:r[10]??1,skewZ:r[2]??0,translateX:r[12]??0,translateY:r[13]??0,translateZ:r[14]??0,rotateX:Math.atan2(-(r[9]??0),r[10]??1),rotateY:Math.atan2(r[8]??0,Math.sqrt(Math.pow(r[0]??1,2)+Math.pow(r[1]??0,2))),rotateZ:Math.atan2(r[1]??0,r[0]??1),perspectiveX:r[3]??0,perspectiveY:r[7]??0,perspectiveZ:r[11]??0,perspectiveW:r[15]??1}}throw new Error("Unsupported matrix type or invalid number of values")};function Hi(t,e){let r=t;return e==="cm"?r*=96/2.54:e==="mm"?r*=96/25.4:e==="Q"?r*=96/(25.4*4):e==="in"?r*=96:e==="pt"?r*=4/3:e==="pc"&&(r*=16),r}function Gi(t,e,r,n){if(e==="em"&&r)t*=parseFloat(getComputedStyle(r).fontSize);else if(e==="rem")t*=parseFloat(getComputedStyle(document.documentElement).fontSize);else if(e==="vh")t*=window.innerHeight/100;else if(e==="vw")t*=window.innerWidth/100;else if(e==="vmin")t*=Math.min(window.innerHeight,window.innerWidth)/100;else if(e==="vmax")t*=Math.max(window.innerHeight,window.innerWidth)/100;else if(e==="%"&&r?.parentElement&&n){const s=parseFloat(getComputedStyle(r.parentElement).getPropertyValue(n));t=t/100*s}else if(e==="ch"&&r){const s=parseFloat(getComputedStyle(r).fontSize)||16;if(typeof OffscreenCanvas<"u"||typeof document<"u")try{const i=(typeof OffscreenCanvas<"u"?new OffscreenCanvas(1,1):document.createElement("canvas")).getContext("2d");i.font=`${s}px ${getComputedStyle(r).fontFamily}`;const o=i.measureText("0").width;t*=o>0?o:s*.5}catch{t*=s*.5}else t*=s*.5}else if(e==="ex"&&r){const s=parseFloat(getComputedStyle(r).fontSize)||16;t*=s*.5}else t=Hi(t,e);return t}function Yn(t,e){return e==="s"&&(t*=1e3),t}function Hn(t,e){return e==="grad"?t*=.9:e==="rad"?t*=180/Math.PI:e==="turn"&&(t*=360),t}function Zi(t,e){return e==="dpcm"?t*=2.54:e==="dppx"&&(t*=96),t}const m=t=>{const e=new RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"i");return Z(e)},lt=Z(/-?[a-zA-Z][a-zA-Z0-9-]*/),_t=m("none"),Ji=Z(/-?\d+/).map(Number),_=Z(/-?(0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?/).map(Number);function Qi(t){return new S(e=>e.ok(t,0))}function _i(t){return new S(e=>e.err(void 0,0))}function re(t,e){const r=t.parseState(e);if(r.isError)throw new Error(`Parse error at offset ${r.offset}`);return r.value}const eo=d(...ji.map(m)),to=d(...Li.map(m)),ro=d(...Ri.map(m)),no=d(...Di.map(m)),so=d(...qi.map(m)),io=d(...Ki.map(m)),oo=d(...Wi.map(m)),ao=w(","),lo=w(" ");d(ao,lo).trim(g);const Gn=E(_,eo).map(([t,e])=>{const r=["length"];return qn.includes(e)?r.push("relative"):Dn.includes(e)&&r.push("absolute"),new b(t,e,r)}),Zn=E(_,to).map(([t,e])=>new b(t,e,["angle"])),er=E(_,ro).map(([t,e])=>new b(t,e,["time"])),co=S.lazy(()=>d(tr,er)),uo=E(_,no).map(([t,e])=>new b(t,e,["frequency"])),fo=E(_,so).map(([t,e])=>new b(t,e,["resolution"])),ho=E(_,io).map(([t,e])=>new b(t,e,["flex"])),tr=d(E(_,oo),m("from").map(()=>[0,"%"]),m("to").map(()=>[100,"%"])).map(([t,e])=>new b(t,e,["percentage"])),Jn=S.lazy(()=>nr.Value),po=w("/").trim(g).map(()=>new b("/","string")),Qn=d(Gn,Zn,er,uo,fo,ho,tr,Jn,po,_.map(t=>new b(t)),_t.map(()=>new b(NaN))).trim(g),L={Length:Gn,Angle:Zn,Time:er,TimePercentage:co,Percentage:tr,Color:Jn,Value:Qn};function ct(t){return re(Qn,t)}const K=t=>new b(t,"color",["color",t.colorSpace],void 0,"color");function Ot(t){const e=Mt(t).value,r=e.clone();for(const n of e.keys()){const s=e[n];r[n]=s instanceof b?s.value:s}return r}function mo(t){const e=t.replace(/[^0-9.+\-*/() e]/g,"");return new Function(`return (${e})`)()}function Or(t,e){switch(t.type){case"ref":return e[t.name]??0;case"literal":return t.value;case"none":return NaN;case"calc":{let r=t.expr;const n=Object.keys(e).sort((s,i)=>i.length-s.length);for(const s of n)r=r.replace(new RegExp(`\\b${s}\\b`,"g"),String(e[s]));return mo(r)}}}function go(t,e,r,n){const s=Ot(t),i=ke(s,e),o={};for(const[f,h]of i.entries())o[f]=h;const a=r.map(f=>Or(f,o)),l=n?Or(n,o):o.alpha??1,c={rgb:q,hsl:je,hwb:Nt,lab:it,lch:Vt,oklab:ot,oklch:jt,xyz:X,"srgb-linear":Rt,"display-p3":Lt,"a98-rgb":Wt,"prophoto-rgb":Dt,rec2020:qt}[e]??q,u=new c(...a,l);return K(u)}const bo={srgb:"rgb","srgb-linear":"srgb-linear","display-p3":"display-p3","a98-rgb":"a98-rgb","prophoto-rgb":"prophoto-rgb",rec2020:"rec2020",lab:"lab",oklab:"oklab",oklch:"oklch",hsl:"hsl",hwb:"hwb",lch:"lch",xyz:"xyz","xyz-d65":"xyz","xyz-d50":"xyz"},wo={srgb:{space:"rgb",ctor:q},"srgb-linear":{space:"srgb-linear",ctor:Rt},"display-p3":{space:"display-p3",ctor:Lt},"a98-rgb":{space:"a98-rgb",ctor:Wt},"prophoto-rgb":{space:"prophoto-rgb",ctor:Dt},rec2020:{space:"rec2020",ctor:qt},xyz:{space:"xyz",ctor:X},"xyz-d65":{space:"xyz",ctor:X},"xyz-d50":{space:"xyz",ctor:X}},ko=w(","),yo=Z(/\s+/),rr=w("/"),ut=w("("),ft=w(")"),At=d(ko.trim(g),yo),vo=d(rr.trim(g),At),Q=S.lazy(()=>d(L.Percentage,L.Angle.map(t=>{const e=Hn(t.value,t.unit);return new b(e,"deg",["angle"])}),d(_,Ji).map(t=>new b(t)),_t.map(()=>new b(NaN)))),qe=d(m("calc").next(Z(/\(([^)]+)\)/,t=>t?.[1]??null)).map(t=>({type:"calc",expr:t})),_t.map(()=>({type:"none"})),Z(/\b(alpha|r|g|b|h|s|l|c|w|a|x|y|z)\b/).map(t=>({type:"ref",name:t})),Q.map(t=>({type:"literal",value:t.value}))),oe=t=>{const e=w(t).skip(m("a").opt()),r=d(E(Q.skip(vo),Q),Q.map(s=>[s])),n=E(Q.skip(At),Q.skip(At),r).trim(g).wrap(ut,ft);return e.next(n).map(([s,i,[o,a]])=>[s,i,o,a??new b(1)])};function fe(t,e){return w(t).skip(m("a").opt()).next(E(m("from").skip(g).next(S.lazy(()=>nr.Value)),g.next(qe),g.next(qe),g.next(qe),rr.trim(g).next(qe).opt()).trim(g).wrap(ut,ft)).map(([r,n,s,i,o])=>go(r,e,[n,s,i],o))}const xo=Z(/#[0-9a-fA-F]{3,8}/).map(t=>{const{r:e,g:r,b:n,alpha:s}=Ws(t);return K(new q(e,r,n,s))}),So=_.skip(m("k")).map(t=>{const e=vn(new ln(t));return K(e)}),Eo=d(fe("rgb","rgb"),oe("rgb").map(([t,e,r,n])=>K(new q(t,e,r,n)))),Co=d(fe("hsl","hsl"),oe("hsl").map(([t,e,r,n])=>K(new je(t,e,r,n)))),Mo=oe("hsv").map(([t,e,r,n])=>K(new $t(t,e,r,n))),Io=d(fe("hwb","hwb"),oe("hwb").map(([t,e,r,n])=>K(new Nt(t,e,r,n)))),Oo=d(fe("lab","lab"),oe("lab").map(([t,e,r,n])=>K(new it(t,e,r,n)))),Ao=d(fe("lch","lch"),oe("lch").map(([t,e,r,n])=>K(new Vt(t,e,r,n)))),Bo=d(fe("oklab","oklab"),oe("oklab").map(([t,e,r,n])=>K(new ot(t,e,r,n)))),Po=d(fe("oklch","oklch"),oe("oklch").map(([t,e,r,n])=>K(new jt(t,e,r,n)))),To=d(fe("xyz","xyz"),oe("xyz").map(([t,e,r,n])=>K(new X(t,e,r,n)))),zo=d(m("srgb-linear").map(()=>"srgb-linear"),m("srgb").map(()=>"srgb"),m("display-p3").map(()=>"display-p3"),m("a98-rgb").map(()=>"a98-rgb"),m("prophoto-rgb").map(()=>"prophoto-rgb"),m("rec2020").map(()=>"rec2020"),m("oklab").map(()=>"oklab"),m("oklch").map(()=>"oklch"),m("lab").map(()=>"lab"),m("lch").map(()=>"lch"),m("hsl").map(()=>"hsl"),m("hwb").map(()=>"hwb"),m("xyz-d65").map(()=>"xyz-d65"),m("xyz-d50").map(()=>"xyz-d50"),m("xyz").map(()=>"xyz")),Fo=d(m("shorter"),m("longer"),m("increasing"),m("decreasing")).skip(g).skip(m("hue")),Ar=S.lazy(()=>E(nr.Value,g.next(L.Percentage).opt())),$o=m("color-mix").next(E(m("in").skip(g).next(E(zo,g.next(Fo).opt())),w(",").trim(g).next(Ar),w(",").trim(g).next(Ar)).trim(g).wrap(ut,ft)).map(([[t,e],[r,n],[s,i]])=>{const o=bo[t]??"oklab",a=e??"shorter";let l=n!=null?n.value/100:-1,c=i!=null?i.value/100:-1;l<0&&c<0?(l=.5,c=.5):l<0?l=1-c:c<0&&(c=1-l);const u=Ot(r),f=Ot(s),h=zi(u,f,l,c,o,a);return K(h)}),No=d(m("srgb-linear").map(()=>"srgb-linear"),m("srgb").map(()=>"srgb"),m("display-p3").map(()=>"display-p3"),m("a98-rgb").map(()=>"a98-rgb"),m("prophoto-rgb").map(()=>"prophoto-rgb"),m("rec2020").map(()=>"rec2020"),m("xyz-d65").map(()=>"xyz-d65"),m("xyz-d50").map(()=>"xyz-d50"),m("xyz").map(()=>"xyz")),Vo=m("color").next(E(No.skip(g),Q.skip(g),Q.skip(g),d(E(Q.skip(rr.trim(g)),Q),Q.map(t=>[t,void 0]))).trim(g).wrap(ut,ft)).map(([t,e,r,[n,s]])=>{const i=wo[t];if(!i)throw new Error(`Unknown color() space: ${t}`);const o=s??new b(1);if(t==="srgb"){const l=c=>c.value*255;return K(new q(l(e),l(r),l(n),o.value))}const a=new i.ctor(e,r,n,o);return t==="xyz-d50"&&a instanceof X&&(a.whitePoint="D50"),K(a)}),jo=d(...Object.keys(Cr).sort((t,e)=>e.length-t.length).map(m)).chain(t=>{const e=Cr[t.toLowerCase()];if(e){const r=ct(e);if(r)return Qi(r)}return _i()}),Ro=d($o,Vo,xo,So,Eo,Co,Mo,Io,Oo,Ao,Bo,Po,To,jo).trim(g),nr={Value:Ro};class b{constructor(e,r,n,s,i,o){this.value=e,this.unit=r,this.superType=n,this.subProperty=s,this.property=i,this.targets=o}setSubProperty(e){this.subProperty=e}setProperty(e){this.property=e}setTargets(e){this.targets=e}valueOf(){return this.value}setValue(e){this.value=e}toString(){return this.value==null?"":this.unit==null||this.unit==="string"?`${this.value}`:It(this)?this.value.toString():this.unit==="var"?`var(${this.value})`:this.unit==="calc"?`calc(${this.value})`:`${this.value}${this.unit}`}toJSON(){return this.valueOf()}toFixed(e=2){const r=Number(this.value).toFixed(e).replace(/\.0+$/,"");return new b(r).coalesce(this,!0).toString()}clone(){return new b(ce(this.value),this.unit,ce(this.superType),this.subProperty,this.property)}coalesce(e,r=!1){return e==null?this:Ui.includes(this.unit)?this:r?(this.unit??=e.unit,this.superType??=e.superType,this.subProperty??=e.subProperty,this.property??=e.property,this.targets??=e.targets,this):new b(ce(this.value),this.unit??e.unit,ce(this.superType??e.superType),this.subProperty??e.subProperty,this.property??e.property,this.targets??e.targets)}}class N{constructor(e,r){this.name=e,this.values=r,r.forEach(n=>{this.setSubProperty(e)})}setSubProperty(e){this.values.forEach(r=>r.setSubProperty(e))}setProperty(e){this.values.forEach(r=>r.setProperty(e))}setTargets(e){this.values.forEach(r=>r.setTargets(e))}setValue(e,r){r!=null?this.values[r].setValue(e):this.values.forEach(n=>n.setValue(e))}valueOf(){return this.values.map(e=>e.valueOf())}toString(){return(this.name==="+"||this.name==="-"||this.name==="*"||this.name==="/")&&this.values.length===2?`${this.values[0].toString()} ${this.name} ${this.values[1].toString()}`:`${this.name}(${this.values.map(e=>e.toString()).join(", ")})`}toJSON(){return{[this.name]:this.values.map(e=>e.toJSON())}}clone(){return new N(this.name,this.values.map(e=>e.clone()))}}class ve extends Array{constructor(...e){super(...e)}setSubProperty(e){this.forEach(r=>r.setSubProperty(e))}setProperty(e){this.forEach(r=>r.setProperty(e))}setTargets(e){this.forEach(r=>r.setTargets(e))}setValue(e,r){r!=null?this[r].setValue(e):this.forEach(n=>n.setValue(e))}valueOf(){return this.map(e=>e.valueOf())}toString(){return this.map(e=>e.toString()).join(" ")}toJSON(){return this.map(e=>e.toJSON())}clone(){return new ve(...this.map(e=>e.clone()))}}const ee=w("("),te=w(")"),Br=w(",");function Lo(t,e){const r=S.lazy(()=>d(a.trim(g).wrap(ee,te),e,t).trim(g)),n=S.lazy(()=>d(E(w("-").trim(g),r).map(([,l])=>new N("*",[new b(-1),l])),E(w("+").trim(g),r).map(([,l])=>l),r)),s=d(w("*"),w("/")).trim(g),i=d(w("+"),w("-")).trim(g),o=E(n,E(s,n).many()).map(([l,c])=>{let u=l;for(const[f,h]of c)u=new N(f,[u,h]);return u}),a=E(o,E(i,o).many()).map(([l,c])=>{let u=l;for(const[f,h]of c)u=new N(f,[u,h]);return u});return a}function Wo(t){const e=S.lazy(()=>I),r=Lo(t,e),n=w("calc").next(r.trim(g).wrap(ee,te)).map(v=>new N("calc",[v])),s=r.trim(g),i=s.sepBy(Br.trim(g)),o=w("min").next(i.wrap(ee,te)).map(v=>new N("min",v)),a=w("max").next(i.wrap(ee,te)).map(v=>new N("max",v)),l=w("clamp").next(i.wrap(ee,te)).map(v=>{if(v.length!==3)throw new Error("clamp() requires exactly 3 arguments");return new N("clamp",v)}),c=d(w("nearest"),w("up"),w("down"),w("to-zero")).trim(g),u=w("round").next(E(c.skip(Br.trim(g)).opt(),i).wrap(ee,te)).map(([v,U])=>{const ne=new b(v??"nearest","string");return new N("round",[ne,...U])}),f=v=>w(v).next(i.wrap(ee,te)).map(U=>{if(U.length!==2)throw new Error(`${v}() requires exactly 2 arguments`);return new N(v,U)}),h=v=>w(v).next(s.trim(g).wrap(ee,te)).map(U=>new N(v,[U])),p=f("pow"),T=f("atan2"),M=w("hypot").next(i.wrap(ee,te)).map(v=>new N("hypot",v)),z=w("log").next(i.wrap(ee,te)).map(v=>{if(v.length<1||v.length>2)throw new Error("log() requires 1 or 2 arguments");return new N("log",v)}),C=d(w("infinity").map(()=>new b(1/0)),w("-infinity").map(()=>new b(-1/0)),w("NaN").map(()=>new b(NaN)),w("pi").map(()=>new b(Math.PI)),w("e").map(()=>new b(Math.E))),I=d(n,o,a,l,u,f("mod"),f("rem"),h("abs"),h("sign"),h("sin"),h("cos"),h("tan"),h("asin"),h("acos"),h("atan"),T,p,h("sqrt"),M,z,h("exp"),C);return{calcFn:n,mathFunction:I,calcSum:r}}const et=w("("),tt=w(")"),Bt=w(","),_n=S.lazy(()=>_o.sepBy(d(Bt,g)).trim(g).map(t=>new ve(...t))),sr=t=>E(t||lt,_n.wrap(et,tt)),Do=()=>{const t=S.lazy(()=>d(Z(/[^()]+/),t.many(1).wrap(et,tt).map(e=>`(${e.flat().join("")})`)).many(1));return w("var").next(t.trim(g).wrap(et,tt).map(e=>[e].flat(1/0).join(""))).map(e=>new b(e,"var"))},{mathFunction:es}=Wo(L.Value),qo=["translate","scale","rotate","skew"],Pt=["x","y","z"],Ko=Pt.map(m),Uo=qo.map(m),Xo=()=>{const t=E(d(...Uo),d(...Ko,w(""))),e=(r,n)=>r+n.toUpperCase();return sr(t).map(([[r,n],s])=>{const i=r.toLowerCase(),o=i==="skew"?Pt.filter(c=>c!=="z"):Pt,a={};if(n){const c=i+n.toUpperCase();a[c]=s[0]}else s.length===1?o.forEach(c=>{const u=e(i,c);a[u]=s[0]}):s.forEach((c,u)=>{const f=e(i,o[u]);a[f]=c});const l=Object.entries(a).map(([c,u])=>new N(c,[u]));return new ve(...l)})},Yo={left:270,right:90,top:0,bottom:180},Ho={"top left":315,"left top":315,"top right":45,"right top":45,"bottom right":135,"right bottom":135,"bottom left":225,"left bottom":225},Go=()=>{const t=d(...["linear-gradient","radial-gradient","conic-gradient","repeating-linear-gradient","repeating-radial-gradient","repeating-conic-gradient"].map(m)),e=d(...["left","right","top","bottom"].map(m)),r=E(w("to").skip(g),e.skip(g),e).map(([,u,f])=>{const h=`${u.toLowerCase()} ${f.toLowerCase()}`,p=Ho[h];if(p==null)throw new Error(`Invalid gradient corner: to ${u} ${f}`);return new b(p,"deg")}),n=E(w("to").skip(g),e).map(([,u])=>new b(Yo[u.toLowerCase()],"deg")),s=d(r,n),i=E(m("from").skip(g),L.Angle).map(([,u])=>u),o=d(L.Angle,s),a=d(L.Length,L.Percentage),l=E(L.Color,a.sepBy(g)).map(([u,f])=>!f||f.length===0?[u]:[u,...f]),c=E(l,Bt.trim(g).next(d(l,a)).many()).map(([u,f])=>[u,...f]);return E(t,E(d(i,o).skip(Bt).opt(),c).trim(g).wrap(et,tt).map(([u,f])=>u?[u,...f].flat():[f])).map(([u,f])=>new N(u,f))},Zo=()=>sr(w("cubic-bezier")).map(t=>new N("cubic-bezier",t[1])),Jo=["inherit","initial","unset","revert","revert-layer"],Qo=d(...Jo.map(m)).map(t=>new b(t.toLowerCase(),"string",["keyword"])),ts=Z(/[^\(\)\{\}\s,;]+/).map(t=>new b(t)),ir=d(Xo(),Do(),es,Go(),Zo(),sr().map(([t,e])=>new N(t,e))),_o=d(Qo,L.Value,ir,ts).trim(g),rs={Function:ir,FunctionArgs:_n},ea=E(w("{"),Z(/[^{}]+/),w("}")).map(t=>{const e=t.join(`
8
+ `);let r=JSON.parse(e);return new b(r,"json")}),ns=d(es,L.Value,ir,ea,ts).trim(g);ns.sepBy(g);const ta=J(t=>re(ns,t));J(t=>re(L.Percentage,String(t)).valueOf());J(t=>re(L.Time.map(e=>e.unit==="ms"?e.value:e.unit==="s"?e.value*1e3:e.value),t));J((t,e)=>(()=>{if(!e)return t;if(t.unit==="var"){const r=getComputedStyle(e).getPropertyValue(t.value);return ct(r)}if(t.unit==="calc"&&t.property&&t.subProperty&&t.value&&e){const r=t.property,n=e.style[r],s=t.subProperty?`${t.subProperty}(${t.toString()})`:t.toString();e.style[r]=s;const i=getComputedStyle(e).getPropertyValue(r);e.style[r]=n;const o=ta(i);if(o instanceof b)return o;if(o.name.startsWith("matrix")){const a=Xn(o)[t.subProperty];if(a!=null)return new b(a,"px",["length","absolute"])}}return t})().coalesce(t),{keyFn:(t,e)=>`${t.toString()}-${JSON.stringify(e)}`});function ra(t){return t}function Pr(t){return t*t}function Tr(t){return-t*(t-2)}function zr(t){return(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1)}function Fr(t){return t*t*t}function $r(t){return(t=t-1)*t*t+1}function rt(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}function Nr(t){return t*t*(3-2*t)}function na(t,e,r,n=1e-6){let s=t;for(let a=0;a<8;a++){const l=s*s,c=l*s,u=1-s,f=u*u,h=3*f*s*e+3*u*l*r+c-t;if(Math.abs(h)<n)return s;const p=3*f*e+6*u*s*(r-e)+3*l*(1-r);if(Math.abs(p)<1e-12)break;s-=h/p}let i=0,o=1;s=t;for(let a=0;a<64;a++){const l=1-s,c=3*l*l*s*e+3*l*s*s*r+s*s*s;if(Math.abs(c-t)<n)return s;t>c?i=s:o=s,s=(i+o)/2}return s}const ie=(t,e,r,n)=>s=>{if(s<=0)return 0;if(s>=1)return 1;const i=na(s,t,r);return Bs(i,t,e,r,n)[1]};function Vr(t){return t=ie(.09,.91,.5,1.5)(t),t}function jr(t){return t=ie(.09,.91,.5,1.5)(t),t}function Rr(t){return t=at(t,[[0,0],[.026,1.746],[.633,1.06],[1,0]])[1],t}function Lr(t){return t=at(t,[[0,0],[.367,.94],[.974,.254],[1,0]])[1],t}function Wr(t){return t=at(t,[[0,0],[.026,1.746],[.633,1.06],[1,0]])[1],t}function Dr(t){return t=at(t,[[0,0],[.026,1.746],[.633,1.06],[1,0]])[1],t}function qr(t){return 1-Math.cos(t*Math.PI/2)}function Kr(t){return Math.sin(t*Math.PI/2)}function Ur(t){return-(Math.cos(Math.PI*t)-1)/2}function Xr(t){return 1-Math.sqrt(1-t*t)}function Yr(t){return Math.sqrt(1- --t*t)}function Hr(t){return(t/=.5)<1?-(Math.sqrt(1-t*t)-1)/2:(Math.sqrt(1-(t-=2)*t)+1)/2}function Gr(t){return t===0?0:Math.pow(2,10*(t-1))}function Zr(t){return t===1?1:1-Math.pow(2,-10*t)}function Jr(t){return t===0?0:t===1?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))}function sa(t,e){return Math.ceil(t*e)/e}function ia(t,e){return Math.floor(t*e)/e}function oa(t,e){return Math.floor(t*(e+1))/(e+1)}function aa(t,e){return e<=1?t:Math.floor(t*(e-1))/(e-1)}function or(t,e="jump-end"){switch(e){case"jump-none":return r=>aa(r,t);case"jump-start":case"start":return r=>sa(r,t);case"jump-end":case"end":return r=>ia(r,t);case"jump-both":case"both":return r=>oa(r,t)}}function la(){return or(1,"jump-start")}function ca(){return or(1,"jump-end")}const ge={ease:[.25,.1,.25,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1],"ease-in-back":[.6,-.28,.735,.045],"ease-out-back":[.175,.885,.32,1.275],"ease-in-out-back":[.68,-.55,.265,1.55]},ua={linear:ra,easeInQuad:Pr,"ease-in-quad":Pr,easeOutQuad:Tr,"ease-out-quad":Tr,easeInOutQuad:zr,"ease-in-out-quad":zr,easeInCubic:Fr,"ease-in-cubic":Fr,easeOutCubic:$r,"ease-out-cubic":$r,easeInOutCubic:rt,"ease-in-out-cubic":rt,easeInBounce:Vr,"ease-in-bounce":Vr,bounceInEase:jr,"bounce-in-ease":jr,bounceInEaseHalf:Rr,"bounce-in-ease-half":Rr,bounceOutEase:Lr,"bounce-out-ease":Lr,bounceOutEaseHalf:Wr,"bounce-out-ease-half":Wr,bounceInOutEase:Dr,"bounce-in-out-ease":Dr,easeInSine:qr,"ease-in-sine":qr,easeOutSine:Kr,"ease-out-sine":Kr,easeInOutSine:Ur,"ease-in-out-sine":Ur,easeInCirc:Xr,"ease-in-circ":Xr,easeOutCirc:Yr,"ease-out-circ":Yr,easeInOutCirc:Hr,"ease-in-out-circ":Hr,easeInExpo:Gr,"ease-in-expo":Gr,easeOutExpo:Zr,"ease-out-expo":Zr,easeInOutExpo:Jr,"ease-in-out-expo":Jr,smoothStep3:Nr,"smooth-step-3":Nr,ease:ie(...ge.ease),"ease-in":ie(...ge["ease-in"]),"ease-out":ie(...ge["ease-out"]),"ease-in-out":ie(...ge["ease-in-out"]),"ease-in-back":ie(...ge["ease-in-back"]),"ease-out-back":ie(...ge["ease-out-back"]),"ease-in-out-back":ie(...ge["ease-in-out-back"]),steps:or,"step-start":la,"step-end":ca},Qr=4;function _r(t,e="^",r=!1){const n=t.src.split(`
9
+ `),s=Math.min(n.length-1,t.getLineNumber()),i=Math.max(s-Qr,0),o=Math.min(s+Qr+1,n.length),a=n.slice(i,o);if(e){const c=" ".repeat(t.getColumnNumber())+e;a.splice(s-i+1,0,c)}return a.map((c,u)=>` ${i+u+1}| ${c}`).join(`
10
+ `)}const be=new Map;function ss(t){if(be.has(t.id))return be.get(t.id);const e=(n,s)=>{if(be.has(n.id))return be.get(n.id);const{name:i,args:o,parser:a}=n.context,l=a!=null?e(a,s):"unknown",u=(()=>{switch(i){case"string":return`"${o[0]}"`;case"regex":case"regexConcat":case"regexWrap":return`${o[0]}`;case"wrap":case"trim":{const[f,h]=o;return`${e(f,s)} ${l} ${e(h,s)}`}case"trimWhitespace":return`${l}?w`;case"not":return`!${l}`;case"opt":return`${l}?`;case"next":{const[f]=o;return`${l} >> ${e(f,s)}`}case"skip":{const[f]=o;return`${l} << ${e(f,s)}`}case"map":return l;case"all":case"then":return`[${o.map(h=>e(h,s)).join(", ")}]`;case"any":case"or":return o.map(h=>e(h,s)).join(" | ");case"many":{const[f,h]=o,p=h===1/0?`${f},`:`${f},${h}`;return`${l} {${p}}`}case"sepBy":return`${l} sepBy ${e(o[0],s)}`;case"lazy":{const[f]=o,h=ma(f);if(s)return i;{const p=e(h,h.id);return be.set(h.id,p),p}}case"debug":return l;default:return}})()??i??"unknown";return s&&be.set(n.id,u),u},r=e(t);return be.set(t.id,r),r}function is(t,e="",r=""){const n=String(t.value),s=t.offset>=t.src.length,a=`${`[${t.isError?"err":s?"done":"ok"}]`} ${e} offset=${t.offset} value=${n}`,l=t.offset>=t.src.length?_r(t,"",t.isError):_r(t,"^",t.isError);return`${a}
11
+ ${l}`}function fa(t,e="",r=!1,n=console.log){const s=i=>{const o=t.parser(i),a=r?ss(t):t.context.name??"",l=is(o,e,a);return n(l),o};return new B(s,A("debug",t,n))}class nt{constructor(e,r=void 0,n=0,s=!1,i=0){this.src=e,this.value=r,this.offset=n,this.isError=s,this.furthest=i}expected;ok(e,r=0){return this.offset+=r,this.value=e,this.isError=!1,this}err(e,r=0){return this.offset+=r,this.value=e,this.isError=!0,this}from(e,r=0){return this.offset+=r,this.value=e,this}save(){return{offset:this.offset,value:this.value}}restore(e){return this.offset=e.offset,this.value=e.value,this.isError=!1,this}clone(){return new nt(this.src,this.value,this.offset,this.isError,this.furthest)}getColumnNumber(){const e=this.offset,r=this.src.lastIndexOf(`
12
+ `,e),n=r===-1?e:e-(r+1);return Math.max(0,n)}getLineNumber(){const e=this.src.lastIndexOf(`
13
+ `,this.offset);return e>=0?this.src.slice(0,e).split(`
14
+ `).length:0}toString(){return is(this)}}function A(t,e,...r){return{name:t,parser:e,args:r}}let ha=0;const we=new Map,Ke=new Map,os=20,pa=(1<<os)-1;let $e=-1,st;function $(t,e){return t.offset>$e?($e=t.offset,st=t,t.expected=void 0):t.offset,st}function ma(t){return t.parser?t.parser:t.parser=t()}function da(t){let e;return r=>(e||(e=t()),e.parser(r))}const ga=0,Ue=1,ba=2;class B{constructor(e,r={}){this.parser=e,this.context=r}id=ha++;state;flags=ga;reset(){st=void 0,$e=-1,we.clear(),Ke.clear()}parseState(e){this.reset();const r=new nt(e);if(this.parser(r),r.isError&&st){const n=new nt(e,void 0,$e,!0);this.state=n}else this.state=r,r.isError;return r}parse(e){return this.parseState(e).value}getCijKey(e){return this.id<<os|e.offset&pa}atLeftRecursionLimit(e){return(Ke.get(this.getCijKey(e))??0)>e.src.length-e.offset}memoize(){const e=r=>{const n=this.getCijKey(r),s=Ke.get(n)??0,i=we.get(this.id);if(i&&i.offset>=r.offset)return r.offset=i.offset,r.value=i.value,r.isError=i.isError,r;if(this.atLeftRecursionLimit(r))return r.isError=!0,r;Ke.set(n,s+1),this.parser(r);const o=we.get(this.id);return o&&o.offset>r.offset?r.offset=o.offset:o||we.set(this.id,r.clone()),r};return new B(e,A("memoize",this))}mergeMemos(){const e=r=>{const n=we.get(this.id);return n?(r.offset=n.offset,r.value=n.value,r.isError=n.isError,r):this.atLeftRecursionLimit(r)?(r.isError=!0,r):(this.parser(r),we.get(this.id)||we.set(this.id,r.clone()),r)};return new B(e,A("mergeMemo",this))}then(e){const r=n=>{const s=n.offset;if(this.parser(n),!n.isError){const i=n.value;if(e.parser(n),!n.isError)return n.ok([i,n.value])}return $(n),n.offset=s,n.isError=!0,n};return new B(r,A("then",this,this,e))}or(e){const r=n=>{const s=n.offset;return this.parser(n),n.isError?(n.offset=s,n.isError=!1,e.parser(n)):n};return new B(r,A("or",this,this,e))}chain(e,r=!1){const n=s=>(this.parser(s),s.isError?s:s.value||r?e(s.value).parser(s):s);return new B(n,A("chain",this,e))}map(e,r=!1){const n=s=>(this.parser(s),!s.isError||r?s.ok(e(s.value)):s);return new B(n,A("map",this))}mapState(e){const r=n=>{const s=n.offset,i=n.value;if(this.parser(n),n.isError)return n;const o=Object.create(n);return o.offset=s,o.value=i,e(n,o)};return new B(r,A("mapState",this))}skip(e){const r=n=>{const s=n.offset;if(this.parser(n),!n.isError){const i=n.value;if(e.parser(n),!n.isError)return n.ok(i)}return $(n),n.offset=s,n.isError=!0,n};return new B(r,A("skip",this,e))}next(e){const r=n=>{const s=n.offset;return this.parser(n),!n.isError&&(e.parser(n),!n.isError)||($(n),n.offset=s,n.isError=!0),n};return new B(r,A("next",this,e))}opt(){const e=r=>{const n=r.offset;return this.parser(r),r.isError?($(r),r.offset=n,r.ok(void 0)):r};return new B(e,A("opt",this))}not(e){const r=s=>{const i=s.offset,o=s.value;return this.parser(s),s.isError?($(s),s.offset=i,s.ok(o)):(s.offset=i,s.isError=!0,s)},n=s=>{const i=s.offset;if(this.parser(s),s.isError)return $(s),s.offset=i,s.isError=!0,s;{const o=s.value,a=s.offset;return s.offset=i,s.isError=!1,e.parser(s),s.isError?(s.offset=a,s.value=o,s.isError=!1,s):($(s),s.offset=i,s.isError=!0,s)}};return new B(e?n:r,A("not",this,e))}wrap(e,r,n=!0){if(!n)return Ve(e,this,r);const s=this,i=o=>{const a=o.offset;if(e.parser(o),o.isError)return o.offset=a,o;if(s.parser(o),o.isError)return $(o),o.offset=a,o.isError=!0,o;const l=o.value;return r.parser(o),o.isError?($(o),o.offset=a,o.isError=!0,o):(o.value=l,o)};return new B(i,A("wrap",this,e,r))}call(e){if(this.flags===0)return this.parser(e);if(this.flags===Ue){Ce(e);const n=e.offset;return this.parser(e),e.isError?($(e),e.offset=n,e.isError=!0,e):(Ce(e),e)}this.flags&Ue&&Ce(e);const r=e.offset;return this.parser(e),e.isError?($(e),e.offset=r,e.isError=!0,e):(this.flags&Ue&&Ce(e),this.flags&ba&&e.offset<e.src.length&&($(e),e.offset=r,e.isError=!0),e)}trim(e=lr,r=!0){if(!r)return Ve(e,this,e);if(e.context?.name==="whitespace"){const n=this,s=new B((o=>n.call(o)),A("trimWhitespace",this));s.flags=this.flags|Ue;const i=o=>{Ce(o);const a=o.offset;return n.parser(o),o.isError?($(o),o.offset=a,o.isError=!0,o):(Ce(o),o)};return new B(i,A("trimWhitespace",this))}return this.wrap(e,e)}many(e=0,r=1/0){const n=s=>{const i=e>0?e:0,o=i>0?new Array(i):[];let a=0;for(let l=0;l<r;l+=1){const c=s.offset;if(this.parser(s),s.isError){s.offset=c,s.isError=!1;break}if(s.offset===c)break;a<i?o[a]=s.value:o.push(s.value),a++}return a<i&&(o.length=a),a>=e?s.ok(o):($(s),s.isError=!0,s.value=[],s)};return new B(n,A("many",this,e,r))}sepBy(e,r=0,n=1/0){const s=i=>{const o=r>0?r:0,a=o>0?new Array(o):[];let l=0;for(let c=0;c<n;c+=1){const u=i.offset;if(this.parser(i),i.isError){i.offset=u,i.isError=!1;break}if(i.offset===u)break;l<o?a[l]=i.value:a.push(i.value),l++;const f=i.offset;if(e.parser(i),i.isError){i.offset=f,i.isError=!1;break}}return l<o&&(a.length=l),l>=r?i.ok(a):($(i),i.isError=!0,i.value=[],i)};return new B(s,A("sepBy",this,e))}eof(){const e=this.skip(wa());return e.context=A("eof",this),e}debug(e="",r=!1,n=console.log){return fa(this,e,r,n)}toString(){return ss(this)}static lazy(e){return new B(da(e),A("lazy",void 0,e))}}function wa(){const t=e=>e.offset>=e.src.length?e.ok(void 0):($(e),e.isError=!0,e);return new B(t,A("eof",void 0))}function Re(...t){const e=r=>{const n=r.offset;for(const s of t){if(s.parser(r),!r.isError)return r;r.offset=n,r.isError=!1}return $(r),r.isError=!0,r};return new B(t.length===1?t[0].parser:e,A("any",void 0,...t))}function Ve(...t){const e=r=>{const n=[],s=r.offset;for(const i of t){if(i.parser(r),r.isError)return r.offset=s,r.isError=!0,r;r.value!==void 0&&n.push(r.value)}return r.ok(n)};return new B(t.length===1?t[0].parser:e,A("all",void 0,...t))}function ae(t){const e=t.length;let r;if(e===1){const n=t.charCodeAt(0);r=(s=>s.src.charCodeAt(s.offset)===n?(s.offset+=1,s.value=t,s.isError=!1,s):($(s),s.isError=!0,s))}else r=(n=>n.src.startsWith(t,n.offset)?(n.offset+=e,n.value=t,n.isError=!1,n):($(n),n.isError=!0,n));return new B(r,A("string",void 0,t))}function ar(t,e){const r=t.flags.replace(/y/g,""),n=new RegExp(t,r+"y"),s=i=>{if(i.offset>=i.src.length)return i.isError=!0,i;const o=i.offset;if(n.lastIndex=o,n.test(i.src)){const a=n.lastIndex;return a>o?(i.offset=a,i.value=i.src.substring(o,a),i.isError=!1,i):(i.value=void 0,i.isError=!1,i)}return $(i),i.isError=!0,i};return new B(s,A("regex",void 0,t))}const Ce=t=>{const e=t.src,r=e.length;let n=t.offset;if(n>=r||e.charCodeAt(n)>32)return t;for(;n<r;){const s=e.charCodeAt(n);if(s===32||s>=9&&s<=13)n++;else break}return t.offset=n,t},lr=ar(/\s*/);lr.context.name="whitespace";const ka=t=>t.replace(/\/\*[\s\S]*?\*\//g,""),ya=t=>t.replace(/\s*!important/gi,""),cr=t=>ya(ka(t));ae("(");ae(")");const va=ae(";"),xa=ae(":"),ur=ae("{"),fr=ae("}"),Sa=ae(","),Ea=ae("."),Y=lr,Ca=rs.Function,Ma=Ve(ur,ar(/[^{}]+/),fr).map(t=>{const e=t.join(`
15
+ `),r=JSON.parse(e);return new b(r,"json")}),hr=Re(L.Value,Ca,Ma,ar(/[^\(\)\{\}\s,;]+/).map(t=>new b(t))).trim(Y),Ia=hr.sepBy(Y),Oa=Ve(lt.skip(xa).trim(Y).map(t=>ms(t)),Ia.skip(va.opt()).trim(Y)).map(([t,e])=>{const r=new ve(...e).flat();return r.setProperty(t),{[t]:r}}),Aa=Re(L.TimePercentage.trim(Y).map(t=>t.toString()),_.map(t=>`${t}%`)),Ba=Aa.sepBy(Sa).trim(Y),as=Oa.many().trim(Y).wrap(ur,fr).map(t=>Object.assign({},...t)),Pa=ae("@keyframes").trim(Y).next(lt),en=Ve(Ba,as).map(([t,e])=>t.reduce((r,n)=>(r.set(n,e),r),new Map)),ls=Re(Pa.next(en.many(1).trim(Y).wrap(ur,fr).trim(Y)),en.many(1).trim(Y)).map(t=>t.reduce((e,r)=>{for(const[n,s]of r)e.has(n)?e.set(n,{...e.get(n),...s}):e.set(n,s);return e},new Map)),Ta=Ea.trim(Y).next(lt).trim(Y),za=as.map(t=>{const e={};for(const[r,n]of Object.entries(t))if(r.includes("animation")){const s=r.replace(/^animation/i,"").replace(/^\w/,o=>o.toLowerCase()),i=ds(n.toString());e[s]=i,delete t[r]}return{options:e,values:t}}),Fa=Ta.next(za),$a=Re(Fa.map(t=>t),ls.map(t=>({keyframes:t}))),Na=$a.sepBy(Y).map(t=>Object.assign({},...t)),tn={Value:hr,FunctionArgs:rs.FunctionArgs},Va=J(t=>re(hr,cr(t))),ja=J(t=>re(ls,cr(t)));J(t=>{const{options:e,values:r,keyframes:n}=re(Na,cr(t));return{options:e,values:r,keyframes:n}});J(t=>re(L.Percentage,String(t)).valueOf());const rn=J(t=>re(L.Time.map(e=>e.unit==="ms"?e.value:e.unit==="s"?e.value*1e3:e.value),t));J(t=>t>=5e3?`${t/1e3}s`:`${t}ms`);J(t=>t===1/0?"infinite":String(t));const Ra={duration:1e3,delay:0,iterationCount:1,direction:"normal",fillMode:"forwards",timingFunction:rt,useWAAPI:!0,colorSpace:"oklab"},La={zIndex:0,weight:1,blendMode:"replace",enabled:!0};class Wa{animations={};transform;superKey;paused=!1;started=!1;done=!1;singleTarget=!0;handleId=void 0;resolvePromise=null;constructor(...e){const r=[];for(const n of e){let s,i;n instanceof pr?s=n:(s=n.animation,i=n.layer),this.transform??=s.frames[0].transform;const o=Xe(s);this.animations[o]={values:{},animation:s,layer:{...La,...i}},s.managed=!0,r.push(s)}this.singleTarget=r.every(n=>n.targets[0]===r[0].targets[0])}setSuperKey(e){return this.superKey=e,Object.values(this.animations).forEach(r=>{r.animation.superKey=e}),this}setTargets(...e){Object.values(this.animations).forEach(n=>{n.animation.setTargets(...e)});const r=Object.values(this.animations).map(n=>n.animation);return this.singleTarget=r.every(n=>n.targets[0]===r[0].targets[0]),this}onStart(){return this.started=!0,this}onEnd(){return this}transformFramesGrouped(e){const r={},n=Object.values(this.animations);n.sort((i,o)=>i.layer.zIndex-o.layer.zIndex);let s=!0;for(const i of n){const{animation:o,values:a,layer:l}=i;if(s=s&&o.done,!l.enabled)continue;if(!(o.done||o.paused)){const u=o.interpFrames(o.t,!1);Object.assign(a,u)}const c=l.properties?Object.fromEntries(Object.entries(a).filter(([u])=>l.properties.has(u))):a;switch(l.blendMode){case"replace":Object.assign(r,c);break;case"add":for(const[u,f]of Object.entries(c))if(u in r){const h=r[u],p=f;h!=null&&typeof h.value=="number"&&p!=null&&typeof p.value=="number"?h.value=h.value+p.value:r[u]=f}else r[u]=f;break;case"weighted":for(const[u,f]of Object.entries(c))if(u in r&&l.weight<1){const h=r[u],p=f;h!=null&&typeof h.value=="number"&&p!=null&&typeof p.value=="number"?h.value=ye(l.weight,h.value,p.value):r[u]=f}else r[u]=f;break}}return this.done=s,this.transform(r,e),r}async tick(e){return this.started||this.onStart(),Object.values(this.animations).forEach(async r=>{(!r.animation.paused||r.animation.pausedTime===0)&&await r.animation.tick(e)}),this.done&&this.onEnd(),this}async draw(e){await this.tick(e),!this.paused&&(this.singleTarget?this.transformFramesGrouped(e):this.done=Object.values(this.animations).map(({animation:r})=>(r.interpFrames(r.t,!0),r)).every(r=>r.done),this.done?(this.reset(),this.resolvePromise&&this.resolvePromise()):this.handleId=Me(this.draw.bind(this)))}async play(){return new Promise(e=>{this.resolvePromise=e,this.handleId=Me(this.draw.bind(this))})}pause(){const e=this.paused;return this.started&&(this.paused=!this.paused,Object.values(this.animations).forEach(r=>{r.animation.pause(!1)})),e&&Me(this.draw.bind(this)),this}reset(){return Object.values(this.animations).forEach(e=>{const r=e.animation;r.started&&r.frames.length>0&&r.interpFrames(0,!0),r.managed=!1,r.reset()}),this.started=!1,this.done=!1,this.paused=!1,this}stop(){return an(this.handleId),this.reset(),this}playing(){return!(!this.started||this.paused)}forcePause(){this.paused=!0,Object.values(this.animations).forEach(e=>{e.animation.paused=!0})}forcePlay(){this.paused=!1,Object.values(this.animations).forEach(e=>{e.animation.paused=!1})}setLayerConfig(e,r){const n=typeof e=="string"?e:Xe(e),s=this.animations[n];return s&&Object.assign(s.layer,r),this}setLayerEnabled(e,r){return this.setLayerConfig(e,{enabled:r})}getLayerConfig(e){const r=typeof e=="string"?e:Xe(e);return this.animations[r]?.layer}}const nn=new WeakMap;let Da=0;const qa=t=>{let e=nn.get(t);return e===void 0&&(e=Da++,nn.set(t,e)),e},sn=J((t,e)=>(()=>{if(!e)return t;if(t.unit==="var"){const s=getComputedStyle(e).getPropertyValue(t.value);return ct(s)}if(t.unit==="calc"&&t.property&&t.subProperty&&t.value&&e){const s=e.style[t.property],i=t.subProperty?`${t.subProperty}(${t.toString()})`:t.toString();e.style[t.property]=i;const o=getComputedStyle(e).getPropertyValue(t.property);e.style[t.property]=s;const a=Va(o);if(a instanceof b)return a;if(a.name.startsWith("matrix")){const c=Xn(a)[t.subProperty];if(c!=null)return new b(c,"px",["length","absolute"])}}return t})().coalesce(t),{keyFn:(t,e)=>`${t.toString()}-${e?qa(e):"null"}`}),Ka=(t,e,r=!1)=>{if(t?.superType?.[0]!==e?.superType?.[0])return r?[t,e]:[t.clone(),e.clone()];const n=o=>{switch(o?.superType?.[0]){case"length":return{value:Gi(o.value,o.unit,o.targets?.[0]),unit:"px"};case"angle":return{value:Hn(o.value,o.unit),unit:"deg"};case"time":return{value:Yn(o.value,o.unit),unit:"ms"};case"resolution":return{value:Zi(o.value,o.unit),unit:"dpi"};default:return{value:o.value,unit:o.unit}}},[s,i]=[n(t),n(e)];return r?(t.value=s.value,t.unit=s.unit,e.value=i.value,e.unit=i.unit,[t,e]):[new b(s.value,s.unit,t.superType,t.subProperty,t.property,t.targets),new b(i.value,i.unit,e.superType,e.subProperty,e.property,e.targets)]};function Ua(t,e,r="oklab",n){t=t.coalesce(e,!0),e=e.coalesce(t,!0);const s={start:t,stop:e,value:t.clone()};if(It(t)&&It(e)){const[i,o]=Vi(t,e,r,!0,!1,!1,n);s.start=i,s.stop=o,s.value=i.clone()}if(t.unit!==e.unit){const[i,o]=Ka(t,e,!0);s.start=i,s.stop=o,s.value=i.clone()}return s.computed=Ne.includes(t.unit)||Ne.includes(e.unit),s}const Tt=t=>typeof t=="string"?ua[t]:t??void 0;function Xa(t,{start:e,stop:r,value:n}){const s=sn(e,e.targets?.[0]),i=sn(r,r.targets?.[0]),o=Ne.includes(s.unit)?i.unit:s.unit,a=ye(t,s.value,i.value);return n.value=a,n.unit=o,n}function Ya(t,{start:e,stop:r,value:n}){return e.value.keys().forEach(s=>{n.value[s]=ye(t,e.value[s],r.value[s])}),n}function Ha(t,e){const{start:r,stop:n,computed:s}=e;return typeof r.value=="number"&&typeof n.value=="number"?e.value.value=ye(t,r.value,n.value):r.unit==="color"?Ya(t,e):s&&Xa(t,e),e}const on=new Map;function Ga(t){const e=Kn(t),r=(s,i)=>{const o=s.split(".").pop(),a=s.split(".").shift();if(i instanceof b)return i.setProperty(a),i;if(i instanceof N)return i.setProperty(a),i.setSubProperty(o),i.values.flat();if(i instanceof ve)return i.map(h=>r(s,h)).flat();const l=String(i),c=`${o}:${l}`,u=on.get(c);if(u){const h=u.clone();return h.setProperty(a),h}const f=re(Re(tn.FunctionArgs.map(h=>(h.setSubProperty(o),h)),tn.Value),l);return f.setProperty(a),on.set(c,f.clone()),f};return Object.entries(e).map(([s,i])=>[s,r(s,i)]).reduce((s,[i,o])=>(s[i]=o,s),{})}const Za=(t,e,r,n,s="oklab",i)=>{const o=n[e][t],a=n[r][t],l=Math.max(o.length,a.length),c=o.concat(Array(Math.abs(l-o.length)).fill(new b(0))),u=a.concat(Array(Math.abs(l-a.length)).fill(new b(0)));return c.map((f,h)=>Ua(f,u[h],s,i))};function Ja(t,e,r){const[n,s]=[t.start,e.start];return{start:n.value*r/100,stop:s.value*r/100}}function cs(t,e,r=!0){t=r?t:Kn(t);const n=Un(t);e.forEach(s=>{Object.entries(n).forEach(([i,o])=>{s.style[i]=o})})}function Qa(t){if(!t.targets||t.targets.length===0)return!1;for(const e of t.frames){const r=e.transform;if(r!==cs&&r!==t.transform)return!1}if(t.frames.length>1){const e=t.frames[0].timingFunction;for(let r=1;r<t.frames.length;r++)if(t.frames[r].timingFunction!==e)return!1}for(const e of t.frames)for(const r of Object.values(e.interpVars))for(const n of r){const s=n.start?.unit,i=n.stop?.unit;if(s&&Ne.includes(s)||i&&Ne.includes(i))return!1}for(const e of t.frames)for(const r of Object.values(e.interpVars))for(const n of r)if(n.start?.unit==="color"||n.stop?.unit==="color")return!1;return!0}function _a(t){const e=t.options.duration,r=[],n=new Set;for(const i of t.frames)n.add(i.time.start),n.add(i.time.stop);const s=[...n].sort((i,o)=>i-o);for(const i of s){const o=t.interpFrames(i,!1);if(Object.keys(o).length===0)continue;const a=Un(o),l={offset:Math.max(0,Math.min(1,i/e)),...a};r.push(l)}return r}function el(t){const e=t.options,r={normal:"normal",reverse:"reverse",alternate:"alternate","alternate-reverse":"alternate-reverse"},n={none:"none",forwards:"forwards",backwards:"backwards",both:"both"};return{duration:e.duration,delay:e.delay,iterations:e.iterationCount===1/0?1/0:e.iterationCount,direction:r[e.direction]??"normal",fill:n[e.fillMode]??"forwards",easing:"linear"}}async function tl(t){const e=_a(t),r=el(t),n=[];for(const s of t.targets){const i=s.animate(e,r);n.push(i)}return await Promise.all(n.map(s=>s.finished)),n}const Xe=t=>typeof t=="string"?t:t.name??String(t.id);let rl=0;class pr{id=rl++;name;superKey;targets;options;templateFrames=[];parsedVars=[];frameId=0;frames=[];handleId=void 0;startTime=void 0;pausedTime=0;prevTime=0;t=0;iteration=0;started=!1;done=!1;reversed=!1;paused=!1;managed=!1;unflatten=!0;resolvePromise=null;dispatchAnimationEvent(e){if(!(typeof AnimationEvent>"u"))for(const r of this.targets)r.dispatchEvent(new AnimationEvent(e,{animationName:this.name??"",elapsedTime:this.t/1e3}))}constructor(e,r,n,s){this.options={},this.setOptions({...Ra,...e??{}}),this.targets=r==null?[]:Array.isArray(r)?r:[r],this.name=n,this.superKey=s}convertFrameStart(e){if(e.start.unit==="s"||e.start.unit==="ms"||!e.start.unit){const r=Yn(e.start.value,e.start.unit);e.start.value=r/this.options.duration*100,e.start.unit="%"}return e.start.value=G(e.start.value,0,100),e}addFrame(e,r,n,s){typeof e=="number"?e=String(e)+"%":typeof e=="string"?e=e:e instanceof b&&(e=String(e));const i=ct(e);let o={id:this.frameId,start:i,vars:r,transform:n,timingFunction:Tt(s)??this.options.timingFunction};return this.convertFrameStart(o),this.templateFrames.push(o),this.frameId+=1,this}createFrame(e,r){const[n,s]=[this.templateFrames[e],this.templateFrames[r]],i={start:e,stop:r},o=Ja(n,s,this.options.duration);let a=n.transform;if(a==null){const u=yr(e,this.frames,f=>f.transform!=null);a=this.frames[u].transform}let l=n.timingFunction;if(l==null){const u=yr(e,this.frames,f=>f.timingFunction!=null);l=this.frames[u].timingFunction}return{id:this.frameId++,ixs:i,start:n.start,time:o,vars:void 0,flatVars:void 0,interpVars:{},transform:a,timingFunction:l}}reconcileVars(e){const r=this.parsedVars[e];Object.keys(r).forEach(n=>{const s=this.parsedVars.findIndex((c,u)=>u>e&&c[n]!=null);if(s===-1)return;const[i,o]=[e,s],a=this.frames.findIndex(c=>c.ixs.start===i&&c.ixs.stop===o),l=a!==-1?this.frames[a]:this.createFrame(i,o);l.interpVars[n]=Za(n,i,o,this.parsedVars,this.options.colorSpace,this.options.hueMethod),a===-1&&this.frames.push(l)})}parse(){this.frames=[],this.templateFrames.sort((e,r)=>e.start.value-r.start.value),this.parsedVars=this.templateFrames.map(e=>{const r=Ga(e.vars);return Object.values(r).forEach(n=>{n.setTargets(this.targets)}),r});for(let e=0;e<this.templateFrames.length-1;e++)this.frames.push(this.createFrame(e,e+1));return this.frames.forEach((e,r)=>this.reconcileVars(r)),this.frames.sort((e,r)=>e.time.start===r.time.start?e.time.stop-r.time.stop:e.time.start-r.time.start),this.frames=this.frames.filter(e=>e.interpVars!=null&&Object.keys(e.interpVars).length>0),this.frames.forEach(e=>{e.flatVars=Object.entries(e.interpVars).reduce((r,[n,s])=>(r[n]=s.map(i=>i.value),r),{}),e.vars=Yi(e.flatVars)}),this}setTimingFunction(e){return this.options.timingFunction=Tt(e)??rt,this}setIterationCount(e){return!e||e==="infinite"||e==="∞"||e==="Infinity"?this.options.iterationCount=1/0:typeof e=="string"?this.options.iterationCount=parseFloat(e.trim()):this.options.iterationCount=e,this}setDuration(e){typeof e=="string"&&(e=rn(e));const r=this.options.duration,n=e??r,s=n/r;for(let i=0;i<this.frames.length;i++){const o=this.frames[i];o.time.start*=s,o.time.stop*=s}return this.options.duration=n,this}setDelay(e){return typeof e=="string"&&(e=rn(e)),this.options.delay=e??0,this}setDirection(e){return this.options.direction=e??"normal",this.reversed=!1,(this.options.direction==="reverse"||this.options.direction==="alternate-reverse"&&this.iteration%2===0||this.options.direction==="alternate"&&this.iteration%2===1)&&(this.reversed=!0),this}setFillMode(e){return this.options.fillMode=e??"forwards",this}setUseWAAPI(e){return this.options.useWAAPI=e??!0,this}setColorSpace(e){return this.options.colorSpace=e??"oklab",this}setHueMethod(e){return this.options.hueMethod=e,this}setOptions(e){return this.setTimingFunction(e.timingFunction),this.setDuration(e.duration),this.setIterationCount(e.iterationCount),this.setDelay(e.delay),this.setDirection(e.direction),this.setFillMode(e.fillMode),this.setUseWAAPI(e.useWAAPI),this.setColorSpace(e.colorSpace),this.setHueMethod(e.hueMethod),this}reverse(){return this.reversed=!this.reversed,this}fillForwards(){this.interpFrames(this.options.duration,!0)}fillBackwards(){this.interpFrames(0,!0)}interpFrames(e,r=!1){e=this.reversed?this.options.duration-e:e;const n={};for(let s=0;s<this.frames.length;s++){const i=this.frames[s],{start:o,stop:a}=i.time;if(e<o||e>a)continue;const l=P(e,o,a,0,1),c=i.timingFunction(l),u=Object.values(i.interpVars);for(let f=0;f<u.length;f++){const h=u[f];for(let p=0;p<h.length;p++)Ha(c,h[p])}r&&i.transform(this.unflatten?i.vars:i.flatVars,e),Object.assign(n,i.flatVars)}return n}async onStart(){this.reversed=!1,(this.options.direction==="reverse"||this.options.direction==="alternate-reverse"&&this.iteration%2===0||this.options.direction==="alternate"&&this.iteration%2===1)&&this.reverse(),(this.options.fillMode==="backwards"||this.options.fillMode==="both")&&this.fillBackwards(),this.options.delay>0&&(this.pause(),await ps(this.options.delay),this.pause()),this.started=!0}async onEnd(){this.options.fillMode==="forwards"||this.options.fillMode==="both"?this.fillForwards():(this.options.fillMode==="none"||this.options.fillMode==="backwards")&&this.fillBackwards(),this.startTime=void 0,this.iteration>=this.options.iterationCount-1?(this.done=!0,this.iteration=0,this.dispatchAnimationEvent("animationend")):(this.iteration+=1,this.dispatchAnimationEvent("animationiteration"))}async tick(e){if(this.startTime===void 0&&(await this.onStart(),this.startTime=e+this.options.delay,this.dispatchAnimationEvent("animationstart")),this.paused&&this.pausedTime===0)return this.pausedTime=e,this.t;if(this.pausedTime>0&&!this.paused){const r=e-this.pausedTime;this.startTime+=r,this.pausedTime=0}return this.t=e-this.startTime,this.t>=this.options.duration&&(await this.onEnd(),this.t=this.options.duration),this.t}async draw(e){this.managed||(e=await this.tick(e),!this.paused&&(this.interpFrames(e,!0),this.done?(this.reset(),this.resolvePromise&&this.resolvePromise()):this.handleId=Me(this.draw.bind(this))))}_playRAF(){return new Promise(e=>{this.resolvePromise=e,this.handleId=Me(this.draw.bind(this))})}async _playWAAPI(){try{await tl(this),this.reset()}catch{return this._playRAF()}}async play(){if(!this.managed)return this.options.useWAAPI&&this.targets.length>0&&typeof this.targets[0]?.animate=="function"&&Qa(this)?this._playWAAPI():this._playRAF()}pause(e=!0){return this.paused&&e&&(this.handleId=Me(this.draw.bind(this))),this.started&&(this.paused=!this.paused),this}stop(){an(this.handleId),this.reset()}playing(){return!(!this.started||this.paused)}get effectiveT(){return this.reversed?this.options.duration-this.t:this.t}reset(){return this.done=!1,this.started=!1,this.paused=!1,this.reversed=!1,this.iteration=0,this.startTime=void 0,this.pausedTime=0,this.t=0,this}setTargets(...e){return this.targets=e,this.frames.forEach(r=>{Object.values(r.interpVars).forEach(n=>{n.forEach(({start:s,stop:i,value:o})=>{s.setTargets(this.targets),i.setTargets(this.targets),o.setTargets(this.targets)})})}),this}group(...e){return new Wa(this,...e)}}class nl extends pr{constructor(e,...r){super(e,r),this.unflatten=!1}fromVars(e,r){this.unflatten=r!=null,r??=this.transform.bind(this);for(let n=0;n<e.length;n++){const s=e[n],i=Math.round(n/(e.length-1)*100);this.addFrame(i,s,r)}return this.parse(),this}fromKeyframes(e,r){this.unflatten=r!=null,r??=this.transform.bind(this),zt(e)&&(e=new Map(Object.entries(e)));for(const[n,s]of e.entries())this.addFrame(n,s,r);return this.parse(),this}fromString(e,r){this.unflatten=r!=null,r??=this.transform.bind(this);const n=ja(e);for(const[s,i]of n.entries()){const o=i.animationTimingFunction??i.timingFunction;delete i.animationTimingFunction,delete i.timingFunction;const a=o?Tt(o.toString()):void 0;this.addFrame(s,i,r,a),this.parsedVars.push(i)}return this.parse(),this}transform(e){cs(e,this.targets)}}exports.Animation=pr;exports.CSSKeyframesAnimation=nl;exports.getAnimationId=Xe;