@mkbabb/keyframes.js 0.9.97 → 1.0.1
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.
- package/dist/keyframes.cjs +15 -0
- package/dist/keyframes.d.ts +163 -0
- package/dist/keyframes.js +4645 -0
- package/package.json +37 -37
- package/dist/index.cjs +0 -13792
- package/dist/index.cjs.map +0 -1
- package/dist/index.js +0 -13791
- package/dist/index.js.map +0 -1
|
@@ -0,0 +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;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { InterpolatedVar } from '@mkbabb/value.js';
|
|
2
|
+
import { timingFunctions } from '@mkbabb/value.js';
|
|
3
|
+
import { ValueArray } from '@mkbabb/value.js';
|
|
4
|
+
import { ValueUnit } from '@mkbabb/value.js';
|
|
5
|
+
|
|
6
|
+
declare class Animation_2<V extends Vars = any> {
|
|
7
|
+
id: number;
|
|
8
|
+
name: string | undefined;
|
|
9
|
+
superKey: string | undefined;
|
|
10
|
+
targets: HTMLElement[];
|
|
11
|
+
options: AnimationOptions;
|
|
12
|
+
templateFrames: TemplateAnimationFrame<V>[];
|
|
13
|
+
parsedVars: any[];
|
|
14
|
+
frameId: number;
|
|
15
|
+
frames: AnimationFrame<V>[];
|
|
16
|
+
handleId: number | any;
|
|
17
|
+
startTime: number | undefined;
|
|
18
|
+
pausedTime: number;
|
|
19
|
+
prevTime: number;
|
|
20
|
+
t: number;
|
|
21
|
+
iteration: number;
|
|
22
|
+
started: boolean;
|
|
23
|
+
done: boolean;
|
|
24
|
+
reversed: boolean;
|
|
25
|
+
paused: boolean;
|
|
26
|
+
unflatten: boolean;
|
|
27
|
+
private resolvePromise;
|
|
28
|
+
constructor(options?: Partial<InputAnimationOptions>, targets?: HTMLElement[] | HTMLElement | undefined, name?: string | undefined, superKey?: string | undefined);
|
|
29
|
+
convertFrameStart(frame: TemplateAnimationFrame<V>): TemplateAnimationFrame<V>;
|
|
30
|
+
addFrame<K extends V>(start: number | string | ValueUnit<number>, vars: Partial<K>, transform?: TransformFunction<K>, timingFunction?: TimingFunction | TimingFunctionNames): Animation_2<K>;
|
|
31
|
+
createFrame(startIx: number, endIx: number): AnimationFrame<V>;
|
|
32
|
+
reconcileVars(ix: number): void;
|
|
33
|
+
parse(): this;
|
|
34
|
+
setTimingFunction(timingFunction: InputAnimationOptions["timingFunction"]): this;
|
|
35
|
+
setIterationCount(iterationCount: InputAnimationOptions["iterationCount"]): this;
|
|
36
|
+
setDuration(duration: InputAnimationOptions["duration"]): this;
|
|
37
|
+
setDelay(delay: InputAnimationOptions["delay"]): this;
|
|
38
|
+
setDirection(direction: InputAnimationOptions["direction"]): this;
|
|
39
|
+
setFillMode(fillMode: InputAnimationOptions["fillMode"]): this;
|
|
40
|
+
setOptions(options: Partial<InputAnimationOptions>): this;
|
|
41
|
+
reverse(): this;
|
|
42
|
+
fillForwards(): void;
|
|
43
|
+
fillBackwards(): void;
|
|
44
|
+
interpFrames(t: number, transformFrames?: boolean): {};
|
|
45
|
+
onStart(): Promise<void>;
|
|
46
|
+
onEnd(): Promise<void>;
|
|
47
|
+
tick(t: number): Promise<number>;
|
|
48
|
+
draw(t: number): Promise<void>;
|
|
49
|
+
play(): Promise<void>;
|
|
50
|
+
pause(draw?: boolean): this;
|
|
51
|
+
stop(): void;
|
|
52
|
+
playing(): boolean;
|
|
53
|
+
reset(): this;
|
|
54
|
+
setTargets(...targets: HTMLElement[]): this;
|
|
55
|
+
group(...animations: Animation_2<V>[]): AnimationGroup<V>;
|
|
56
|
+
}
|
|
57
|
+
export { Animation_2 as Animation }
|
|
58
|
+
|
|
59
|
+
declare interface AnimationFrame<V extends Vars> {
|
|
60
|
+
id: number;
|
|
61
|
+
start: ValueUnit;
|
|
62
|
+
ixs: {
|
|
63
|
+
start: number;
|
|
64
|
+
stop: number;
|
|
65
|
+
};
|
|
66
|
+
time: {
|
|
67
|
+
start: number;
|
|
68
|
+
stop: number;
|
|
69
|
+
};
|
|
70
|
+
flatVars: V;
|
|
71
|
+
vars: V;
|
|
72
|
+
interpVars: {
|
|
73
|
+
[arg: string]: Array<InterpolatedVar<V>>;
|
|
74
|
+
};
|
|
75
|
+
transform: TransformFunction<V>;
|
|
76
|
+
timingFunction: TimingFunction;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
declare class AnimationGroup<V extends Vars> {
|
|
80
|
+
animations: AnimationGroupObject<V>;
|
|
81
|
+
transform: TransformFunction<V>;
|
|
82
|
+
superKey: string | undefined;
|
|
83
|
+
paused: boolean;
|
|
84
|
+
started: boolean;
|
|
85
|
+
done: boolean;
|
|
86
|
+
singleTarget: boolean;
|
|
87
|
+
handleId: number | any;
|
|
88
|
+
resolvePromise: ((value: void | PromiseLike<void>) => void) | null;
|
|
89
|
+
constructor(...animations: Animation_2<V>[]);
|
|
90
|
+
setSuperKey(superKey: string): this;
|
|
91
|
+
setTargets(...targets: HTMLElement[]): this;
|
|
92
|
+
onStart(): this;
|
|
93
|
+
onEnd(): this;
|
|
94
|
+
transformFramesGrouped(t: number): Vars<ValueArray<any>>;
|
|
95
|
+
tick(t: number): Promise<this>;
|
|
96
|
+
draw(t: number): Promise<void>;
|
|
97
|
+
play(): Promise<unknown>;
|
|
98
|
+
pause(): this;
|
|
99
|
+
reset(): this;
|
|
100
|
+
stop(): this;
|
|
101
|
+
playing(): boolean;
|
|
102
|
+
forcePause(): void;
|
|
103
|
+
forcePlay(): void;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
declare interface AnimationGroupObject<V extends Vars> {
|
|
107
|
+
[key: string]: {
|
|
108
|
+
animation: Animation_2<V>;
|
|
109
|
+
values: Vars<ValueArray>;
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
declare type AnimationOptions = {
|
|
114
|
+
duration: number;
|
|
115
|
+
delay: number;
|
|
116
|
+
iterationCount: number;
|
|
117
|
+
direction: (typeof DIRECTIONS)[number];
|
|
118
|
+
fillMode: (typeof FILL_MODES)[number];
|
|
119
|
+
timingFunction: TimingFunction;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export declare class CSSKeyframesAnimation<V extends Vars> extends Animation_2<V> {
|
|
123
|
+
constructor(options?: Partial<InputAnimationOptions>, ...targets: HTMLElement[]);
|
|
124
|
+
fromVars(vars: V[], transform?: TransformFunction<V>): this;
|
|
125
|
+
fromKeyframes(keyframes: Map<string, Partial<V>> | Record<string, Partial<V>>, transform?: TransformFunction<V>): this;
|
|
126
|
+
fromString(keyframes: string, transform?: TransformFunction<V>): this;
|
|
127
|
+
transform(vars: any): void;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
declare const DIRECTIONS: readonly ["normal", "reverse", "alternate", "alternate-reverse"];
|
|
131
|
+
|
|
132
|
+
declare const FILL_MODES: readonly ["none", "forwards", "backwards", "both"];
|
|
133
|
+
|
|
134
|
+
export declare const getAnimationId: (animation: Animation_2 | string) => string;
|
|
135
|
+
|
|
136
|
+
declare type InputAnimationOptions = Partial<{
|
|
137
|
+
duration: number | string;
|
|
138
|
+
delay: number | string;
|
|
139
|
+
iterationCount: number | string | "infinite" | undefined;
|
|
140
|
+
direction: (typeof DIRECTIONS)[number];
|
|
141
|
+
fillMode: (typeof FILL_MODES)[number];
|
|
142
|
+
timingFunction: TimingFunction | TimingFunctionNames | undefined;
|
|
143
|
+
}>;
|
|
144
|
+
|
|
145
|
+
declare interface TemplateAnimationFrame<V extends Vars> {
|
|
146
|
+
id: number;
|
|
147
|
+
start: ValueUnit;
|
|
148
|
+
vars: V;
|
|
149
|
+
transform?: TransformFunction<V>;
|
|
150
|
+
timingFunction?: TimingFunction;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
declare type TimingFunction = (t: number) => number;
|
|
154
|
+
|
|
155
|
+
declare type TimingFunctionNames = keyof typeof timingFunctions;
|
|
156
|
+
|
|
157
|
+
declare type TransformFunction<V extends Vars> = (v: V, t: number) => void;
|
|
158
|
+
|
|
159
|
+
declare type Vars<T = any> = {
|
|
160
|
+
[arg: string]: number | string | T;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
export { }
|