@master/css 2.0.0-beta.151 → 2.0.0-beta.153

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- var g=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var w=(e,t)=>{for(var i in t)g(e,i,{get:t[i],enumerable:!0})},S=(e,t,i,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of $(t))!C.call(e,n)&&n!==i&&g(e,n,{get:()=>t[n],enumerable:!(c=k(t,n))||c.enumerable});return e};var R=e=>S(g({},"__esModule",{value:!0}),e);var I={};w(I,{rules:()=>T});module.exports=R(I);var f=require("../constants/start-symbol"),x=require("../utils/css-escape"),B={group:{match:"^(?:.+?[*_>~+])?\\{.+?\\}",analyze(e){let t=0;for(;t<e.length&&!(e[t]==="{"&&e[t-1]!=="\\");t++);return[e.slice(t),e.slice(0,t)]},declare(e){let t={},i=(r,o)=>{let a=o.indexOf(":");if(a!==-1){r in t||(t[r]={});let u=t[r],h=o.slice(0,a);h in u||(u[h]=o.slice(a+1))}},c=r=>{let o=(a,u)=>{let h=u.slice((0,x.cssEscape)(r.className).length).match(/\{(.*)\}/)[1].split(";");for(let y of h)i(a,y)};if(this.theme){let a=r.natives.find(u=>u.theme===this.theme)??r.natives.find(u=>!u.theme);a&&o(this.theme,a.text)}else for(let a of r.natives)o(a.theme,a.text);if(r.keyframeNames){this.keyframeNames||(this.keyframeNames=[]);for(let a of r.keyframeNames)this.keyframeNames.includes(a)||this.keyframeNames.push(a)}},n=[],l="",d=()=>{l&&(n.push(l.replace(/ /g,"|")),l="")},m=1;(function r(o){for(;m<e.length;m++){let a=e[m];if(!o){if(a===";"){d();continue}if(a==="}")break}if(l+=a,o===a){if(o==="'"||o==='"'){let u=0;for(let h=l.length-2;l[h]==="\\";h--)u++;if(u%2)continue}break}else a in f.START_SYMBOLS&&o!=="'"&&o!=='"'&&(m++,r(f.START_SYMBOLS[a]))}})(void 0),d();for(let r of n){let o=this.css.create(r);if(Array.isArray(o))for(let a of o)c(a);else o?c(o):i(this.theme??"",r)}let s={};for(let r in t)for(let[o,a]of Object.entries(t[r]))o in s?s[o][r]=a:s[o]={[r]:a};return s},delete(){return v.call(this)},insert(){return b.call(this)}},variable:{match:"^\\$[^ (){}A-Z]+:[^ ]",declare(e){return{["--"+this.prefix.slice(1,-1)]:e}}},fontSize:{match:"^f(?:ont)?:(?:[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},fontWeight:{match:"^f(?:ont)?:(?:bolder|$values)(?!\\|)",native:!0,values:{thin:100,extralight:200,light:300,regular:400,medium:500,semibold:600,bold:700,extrabold:800,heavy:900}},fontFamily:{match:"^f(?:ont)?:(?:$values)(?!\\|)",native:!0,values:{mono:"ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace",sans:"ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji",serif:"ui-serif,Georgia,Cambria,Times New Roman,Times,serif"}},fontSmoothing:{match:"^f(?:ont)?:(?:antialiased|subpixel-antialiased|$values)(?!\\|)",declare(e){switch(e){case"subpixel-antialiased":return{"-webkit-font-smoothing":"auto","-moz-osx-font-smoothing":"auto"};case"antialiased":return{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale"}}}},fontStyle:{match:"^f(?:ont)?:(?:normal|italic|oblique|$values)(?!\\|)",native:!0,unit:"deg"},fontVariantNumeric:{match:"^f(?:ont)?:(?:ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|$values)(?!\\|)",native:!0},fontFeatureSettings:{match:"^font-feature:.",native:!0},font:{match:"^f:.",native:!0,order:-1},color:{match:"^(?:color|fg|foreground):.",native:!0,colored:!0,values:{current:"currentColor"}},marginLeft:{match:"^ml:.",native:!0,unit:"rem"},marginRight:{match:"^mr:.",native:!0,unit:"rem"},marginTop:{match:"^mt:.",native:!0,unit:"rem"},marginBottom:{match:"^mb:.",native:!0,unit:"rem"},marginX:{match:"^(?:mx|margin-x):.",unit:"rem",order:-.5,declare(e,t){return{"margin-left":e+t,"margin-right":e+t}}},marginY:{match:"^(?:my|margin-y):.",unit:"rem",order:-.5,declare(e,t){return{"margin-top":e+t,"margin-bottom":e+t}}},margin:{match:"^m:.",native:!0,unit:"rem",order:-1},paddingLeft:{match:"^pl:.",native:!0,unit:"rem"},paddingRight:{match:"^pr:.",native:!0,unit:"rem"},paddingTop:{match:"^pt:.",native:!0,unit:"rem"},paddingBottom:{match:"^pb:.",native:!0,unit:"rem"},paddingX:{match:"^(?:px|padding-x):.",unit:"rem",order:-.5,declare(e,t){return{"padding-left":e+t,"padding-right":e+t}}},paddingY:{match:"^(?:py|padding-y):.",unit:"rem",order:-.5,declare(e,t){return{"padding-top":e+t,"padding-bottom":e+t}}},padding:{match:"^p:.",native:!0,unit:"rem",order:-1},flexBasis:{values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560},unit:"rem",native:!0},flexWrap:{match:"^flex:(?:wrap(?:-reverse)?|nowrap|$values)(?!\\|)",native:!0},flexGrow:{native:!0},flexShrink:{native:!0},flexDirection:{match:"^flex:(?:(?:row|column)(?:-reverse)?|$values)(?!\\|)",native:!0,values:{col:"column","col-reverse":"column-reverse"}},flex:{native:!0,order:-1},display:{match:"^d:.",native:!0},width:{match:"^w:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},height:{match:"^h:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},minWidth:{match:"^min-w:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},minHeight:{match:"^min-h:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},box:{match:"^(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e]},declare(e){let[t,i]=e.split(" x ");return{width:t,height:i}}},minBox:{match:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e.slice(4)]},declare(e){let[t,i]=e.split(" x ");return{"min-width":t,"min-height":i}}},maxBox:{match:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e.slice(4)]},declare(e){let[t,i]=e.split(" x ");return{"max-width":t,"max-height":i}}},contain:{native:!0},content:{native:!0},counterIncrement:{native:!0},counterReset:{native:!0},letterSpacing:{match:"^ls:.",native:!0,unit:"em"},lineHeight:{match:"^lh:.",native:!0},objectFit:{match:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)",native:!0},objectPosition:{match:"^(?:object|obj):(?:top|bottom|right|left|center|$values)",native:!0},textAlign:{match:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)",native:!0},textDecorationColor:{match:"^text-decoration:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},textDecorationStyle:{match:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)",native:!0},textDecorationThickness:{match:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",native:!0,unit:"em"},textDecorationLine:{match:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)",native:!0},textDecoration:{match:"^t(?:ext)?:(?:underline|line-through|overline)",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"},order:-1},textUnderlineOffset:{unit:"rem",native:!0},textOverflow:{match:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))",native:!0},textOrientation:{match:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)",native:!0},textTransform:{match:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)",native:!0},textRendering:{match:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)",native:!0},textIndent:{unit:"rem",native:!0},verticalAlign:{match:"^(?:v|vertical):.",native:!0},columns:{match:"^(?:columns|cols):.",native:!0,order:-1},whiteSpace:{native:!0},top:{native:!0,unit:"rem"},bottom:{native:!0,unit:"rem"},left:{native:!0,unit:"rem"},right:{native:!0,unit:"rem"},inset:{native:!0,unit:"rem",order:-1},lines:{match:"^lines:.",declare(e,t){return{overflow:"hidden",display:"-webkit-box","overflow-wrap":"break-word","text-overflow":"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":e+t}}},maxHeight:{match:"^max-h:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},maxWidth:{match:"^max-w:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},boxSizing:{match:"^box:(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box"}},opacity:{native:!0},visibility:{native:!0},clear:{native:!0},float:{native:!0},isolation:{native:!0},overflowX:{native:!0,declare(e,t){return e==="overlay"?{"overflow-x":["auto",e]}:{"overflow-x":e}}},overflowY:{native:!0,declare(e,t){return e==="overlay"?{"overflow-y":["auto",e]}:{"overflow-y":e}}},overflow:{native:!0,order:-1,declare(e,t){return e==="overlay"?{overflow:["auto",e]}:{overflow:e}}},overscrollBehaviorX:{native:!0},overscrollBehaviorY:{native:!0},overscrollBehavior:{native:!0,order:-1},zIndex:{match:"^z:.",native:!0},position:{native:!0,values:{abs:"absolute",rel:"relative"}},cursor:{native:!0},pointerEvents:{native:!0},resize:{native:!0},touchAction:{native:!0},wordBreak:{native:!0},wordSpacing:{native:!0,unit:"em"},userDrag:{declare(e,t){return{"user-drag":e+t,"-webkit-user-drag":e+t}}},userSelect:{native:!0,declare(e,t){return{"user-select":e+t,"-webkit-user-select":e+t}}},textShadow:{unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},textSize:{match:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",declare(e,t){return{"font-size":e+t,"line-height":t==="em"?e+.875+t:`calc(${e}${t} + ${.875}em)`}}},textFillColor:{native:!0,match:"^(?:text-fill|text|t):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-fill-color":e+t}}},textStrokeWidth:{match:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",unit:"rem",declare(e,t){return{"-webkit-text-stroke-width":e+t}}},textStrokeColor:{match:"^text-stroke:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-stroke-color":e+t}}},textStroke:{unit:"rem",native:!0,declare(e,t){return{"-webkit-text-stroke":e+t}}},boxShadow:{match:"^s(?:hadow)?:.",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},tableLayout:{native:!0},transformBox:{match:"^transform:(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},transformStyle:{match:"^transform:(?:flat|preserve-3d|$values)(?!\\|)",native:!0},transformOrigin:{match:"^transform:(?:top|bottom|right|left|center|[0-9]|$values)",native:!0,unit:"px"},transform:{match:"^(?:translate|scale|skew|rotate|perspective|matrix)(?:3d|[XYZ])?\\(",native:!0},transitionProperty:{match:"^~property:.",native:!0},transitionTimingFunction:{match:"^~easing:.",native:!0},transitionDuration:{match:"^~duration:.",native:!0,unit:"ms"},transitionDelay:{match:"^~delay:.",native:!0,unit:"ms"},transition:{symbol:"~",native:!0,order:-1},animationDelay:{match:"^@delay:.",native:!0,unit:"ms"},animationDirection:{match:"^@direction:.",native:!0},animationDuration:{match:"^@duration:.",native:!0,unit:"ms"},animationFillMode:{match:"^@fill-mode:.",native:!0},animationIterationCount:{match:"^@iteration-count:.",native:!0},animationName:{match:"^@name:.",native:!0,create(e){return p.call(this,e)},delete(){return v.call(this)},insert(){return b.call(this)}},animationPlayState:{match:"^@play-state:.",native:!0},animationTimingFunction:{match:"^@easing:.",native:!0},animation:{symbol:"@",native:!0,order:-1,create(e){return p.call(this,e)},delete(){return v.call(this)},insert(){return b.call(this)}},borderCollapse:{match:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)",native:!0},borderSpacing:{unit:"rem",native:!0},borderTopColor:{match:"^b(?:t|order-top(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderBottomColor:{match:"^b(?:b|order-bottom(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderLeftColor:{match:"^b(?:l|order-left(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderRightColor:{match:"^b(?:r|order-right(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderXColor:{match:"^b(?:x|order-x(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",order:-.5,colored:!0,values:{current:"currentColor"},declare(e,t){return{"border-left-color":e+t,"border-right-color":e+t}}},borderYColor:{match:"^b(?:y|order-y(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",order:-.5,colored:!0,values:{current:"currentColor"},declare(e,t){return{"border-top-color":e+t,"border-bottom-color":e+t}}},borderColor:{match:"^b(?:order)?(?:-color)?:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,order:-1,colored:!0,values:{current:"currentColor"}},borderTopLeftRadius:{match:"^r(?:tl|lt):.",unit:"rem",native:!0},borderTopRightRadius:{match:"^r(?:tr|rt):.",unit:"rem",native:!0},borderBottomLeftRadius:{match:"^r(?:bl|lb):.",unit:"rem",native:!0},borderBottomRightRadius:{match:"^r(?:br|rb):.",unit:"rem",native:!0},borderTopRadius:{match:"^rt:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-left-radius":e+t,"border-top-right-radius":e+t}}},borderBottomRadius:{match:"^rb:.",unit:"rem",order:-.5,declare(e,t){return{"border-bottom-left-radius":e+t,"border-bottom-right-radius":e+t}}},borderLeftRadius:{match:"^rl:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-left-radius":e+t,"border-bottom-left-radius":e+t}}},borderRightRadius:{match:"^rr:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-right-radius":e+t,"border-bottom-right-radius":e+t}}},borderRadius:{match:"^r:.",unit:"rem",native:!0,order:-1},borderTopStyle:{match:"^b(?:t|order-top(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderBottomStyle:{match:"^b(?:b|order-bottom(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderLeftStyle:{match:"^b(?:l|order-left(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderRightStyle:{match:"^b(?:r|order-right(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderXStyle:{match:"^b(?:x|order-x(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",order:-.5,declare(e,t){return{"border-left-style":e+t,"border-right-style":e+t}}},borderYStyle:{match:"^b(?:y|order-y(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",order:-.5,declare(e,t){return{"border-top-style":e+t,"border-bottom-style":e+t}}},borderStyle:{match:"^b(?:order)?(?:-style)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0,order:-1},borderTopWidth:{match:"^b(?:t|order-top(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderBottomWidth:{match:"^b(?:b|order-bottom(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderLeftWidth:{match:"^b(?:l|order-left(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderRightWidth:{match:"^b(?:r|order-right(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderXWidth:{match:"^b(?:x|order-x(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",order:-.5,declare(e,t){return{"border-left-width":e+t,"border-right-width":e+t}}},borderYWidth:{match:"^b(?:y|order-y(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",order:-.5,declare(e,t){return{"border-top-width":e+t,"border-bottom-width":e+t}}},borderWidth:{match:"^b(?:order)?(?:-width)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0,order:-1},borderImageOutset:{unit:"rem",native:!0},borderImageRepeat:{match:"^border-image:(?:stretch|repeat|round|space|$values)(?!\\|)",native:!0},borderImageSlice:{native:!0},borderImageSource:{match:"^border-image:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0},borderImageWidth:{match:"^border-image:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderImage:{native:!0,order:-1},borderTop:{match:"^bt:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderBottom:{match:"^bb:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderLeft:{match:"^bl:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderRight:{match:"^br:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderX:{match:"^(?:bx|border-x):.",unit:"rem",colored:!0,order:-.5,values:{current:"currentColor"},declare(e){return{"border-left":e,"border-right":e}}},borderY:{match:"^(?:by|border-y):.",unit:"rem",colored:!0,order:-.5,values:{current:"currentColor"},declare(e){return{"border-top":e,"border-bottom":e}}},border:{match:"^b:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"},order:-2},backgroundAttachment:{match:"^(?:bg|background):(?:fixed|local|scroll|$values)(?!\\|)",native:!0},backgroundBlendMode:{native:!0},backgroundColor:{match:"^(?:bg|background):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},backgroundClip:{match:"^(?:bg|background):(?:text|$values)(?!\\|)",native:!0,declare(e,t){return{"-webkit-background-clip":e+t,"background-clip":e+t}},values:{content:"content-box",border:"border-box",padding:"padding-box"}},backgroundOrigin:{match:"^(?:bg|background):(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box"}},backgroundPosition:{match:"^(?:bg|background):(?:top|bottom|right|left|center|$values)(?!\\|)",native:!0,unit:"px"},backgroundRepeat:{match:"^(?:bg|background):(?:space|round|repeat|no-repeat|repeat-x|repeat-y|$values)(?![|a-zA-Z])",native:!0},backgroundSize:{match:"^(?:bg|background):(?:\\.?\\[0-9]+|auto|cover|contain|$values)(?!\\|)",unit:"rem",native:!0},backgroundImage:{match:"^(?:(?:bg|background):(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)|gradient\\(.*\\))(?!\\|)",native:!0,colored:!0,values:{current:"currentColor"},analyze(e){if(e.startsWith("gradient"))return["linear-"+e];let t=e.indexOf(":");return this.prefix=e.slice(0,t+1),[e.slice(t+1)]}},background:{match:"^bg:.",native:!0,colored:!0,values:{current:"currentColor"},order:-1},mixBlendMode:{match:"^blend:.",native:!0},backdropFilter:{match:"^bd:.",native:!0,colored:!0,values:{current:"currentColor"},declare(e,t){return{"backdrop-filter":e+t,"-webkit-backdrop-filter":e+t}}},filter:{match:"^(?:blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(",native:!0,colored:!0,values:{current:"currentColor"}},fill:{match:"^fill:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},strokeDasharray:{native:!0},strokeDashoffset:{native:!0},strokeWidth:{match:"^stroke:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",native:!0},stroke:{native:!0,colored:!0,values:{current:"currentColor"}},x:{native:!0},y:{native:!0},cx:{native:!0},cy:{native:!0},rx:{native:!0},ry:{native:!0},gridColumnStart:{match:"^grid-col-start:.",native:!0},gridColumnEnd:{match:"^grid-col-end:.",native:!0},gridColumn:{match:"^grid-col(?:umn)?(?:-span)?:.",native:!0,order:-1,transform(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridColumns:{match:"^grid-cols:.",declare(e,t){return{display:"grid","grid-template-columns":"repeat("+e+t+",minmax(0,1fr))"}}},gridRowStart:{native:!0},gridRowEnd:{native:!0},gridRow:{match:"^grid-row-span:.",native:!0,order:-1,transform(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridRows:{match:"^grid-rows:.",declare(e,t){return{display:"grid","grid-auto-flow":"column","grid-template-rows":"repeat("+e+t+",minmax(0,1fr))"}}},gridAutoColumns:{match:"^grid-auto-cols:.",native:!0,values:{min:"min-content",max:"max-content"}},gridAutoFlow:{match:"^grid-flow:.",native:!0},gridAutoRows:{values:{min:"min-content",max:"max-content"},native:!0},gridTemplateAreas:{native:!0},gridTemplateColumns:{match:"^grid-template-cols:.",native:!0,unit:"rem",values:{min:"min-content",max:"max-content"}},gridTemplateRows:{native:!0,unit:"rem",values:{min:"min-content",max:"max-content"}},gridTemplate:{native:!0,order:-1},gridArea:{native:!0,order:-1},grid:{native:!0,order:-1},columnGap:{match:"^gap-x:.",unit:"rem",native:!0},rowGap:{match:"^gap-y:.",unit:"rem",native:!0},gap:{unit:"rem",native:!0,order:-1},order:{match:"^o:.",native:!0,values:{first:-999999,last:999999}},breakInside:{native:!0},breakBefore:{native:!0},breakAfter:{native:!0},boxDecorationBreak:{match:"^box:(?:slice|clone|$values)(?!\\|)",native:!0,declare(e,t){return{"box-decoration-break":e+t,"-webkit-box-decoration-break":e+t}}},aspectRatio:{match:"^aspect:.",native:!0},columnSpan:{match:"^col-span:.",native:!0},alignContent:{match:"^ac:.",native:!0},alignItems:{match:"^ai:.",native:!0},alignSelf:{match:"^as:",native:!0},justifyContent:{match:"^jc:.",native:!0},justifyItems:{match:"^ji:.",native:!0},justifySelf:{match:"^js:.",native:!0},placeContent:{native:!0,order:-1},placeItems:{native:!0,order:-1},placeSelf:{native:!0,order:-1},listStylePosition:{match:"^list-style:(?:inside|outside|$values)(?!\\|)",native:!0},listStyleType:{match:"^list-style:(?:disc|decimal|$values)(?!\\|)",native:!0},listStyleImage:{match:"^list-style:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0},listStyle:{native:!0,order:-1},outlineColor:{match:"^outline:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},outlineOffset:{unit:"rem",native:!0},outlineStyle:{match:"^outline:(?:none|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},outlineWidth:{match:"^outline:(?:\\.?[0-9]|medium|thick|thin|(max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},outline:{native:!0,unit:"rem",order:-1,colored:!0,values:{current:"currentColor"}},accentColor:{match:"^accent:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},appearance:{native:!0},caretColor:{match:"^caret:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},scrollBehavior:{native:!0},scrollMarginLeft:{match:"^sml:.",native:!0,unit:"rem"},scrollMarginRight:{match:"^smr:.",native:!0,unit:"rem"},scrollMarginTop:{match:"^smt:.",native:!0,unit:"rem"},scrollMarginBottom:{match:"^smb:.",native:!0,unit:"rem"},scrollMarginX:{match:"^(?:smx|scroll-margin-x):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-margin-left":e+t,"scroll-margin-right":e+t}}},scrollMarginY:{match:"^(?:smy|scroll-margin-y):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-margin-top":e+t,"scroll-margin-bottom":e+t}}},scrollMargin:{match:"^sm:.",native:!0,unit:"rem",order:-1},scrollPaddingLeft:{match:"^spl:.",native:!0,unit:"rem"},scrollPaddingRight:{match:"^spr:.",native:!0,unit:"rem"},scrollPaddingTop:{match:"^spt:.",native:!0,unit:"rem"},scrollPaddingBottom:{match:"^spb:.",native:!0,unit:"rem"},scrollPaddingX:{match:"^(?:spx|scroll-padding-x):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-padding-left":e+t,"scroll-padding-right":e+t}}},scrollPaddingY:{match:"^(?:spy|scroll-padding-y):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-padding-top":e+t,"scroll-padding-bottom":e+t}}},scrollPadding:{match:"^sp:.",native:!0,unit:"rem",order:-1},scrollSnapAlign:{match:"^scroll-snap:(?:start|end|center|$values)",native:!0},scrollSnapStop:{match:"^scroll-snap:(?:normal|always|$values)(?!\\|)",native:!0},scrollSnapType:{match:"^scroll-snap:(?:(?:[xy]|block|inline|both)(?:\\|(?:proximity|mandatory))?|$values)(?!\\|)",native:!0},willChange:{native:!0},writingMode:{match:"^writing:.",native:!0},direction:{native:!0},shapeOutside:{match:"^shape:(?:(?:inset|circle|ellipse|polygon|url|linear-gradient)\\(.*\\)|$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box",margin:"margin-box"}},shapeMargin:{match:"^shape:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},shapeImageThreshold:{native:!0},clipPath:{match:"^clip:.",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box",margin:"margin-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},quotes:{native:!0},maskImage:{native:!0,declare(e,t){return{"mask-image":e+t,"-webkit-mask-image":e+t}}}},T=B;function p(e){if(!this.css.config.keyframes)return;let t=(this.meta.origin==="symbol"?e.slice(this.meta.config.symbol.length):e.slice(e.indexOf(":")+1)).split("|").filter(i=>i in this.css.config.keyframes);t?.length&&(this.keyframeNames=t)}function v(){if(this.keyframeNames?.length){let e=this.css.rules[0];for(let t of this.keyframeNames){let i=this.css.keyframes[t];if(!--i.count){let c=e.natives.indexOf(i.native);this.css.style.sheet.deleteRule(c),e.natives.splice(c,1),delete this.css.keyframes[t]}}e.natives.length||this.css.rules.splice(0,1)}}function b(){if(this.keyframeNames){let{config:e,keyframes:t,style:i,rules:c}=this.css,n=i?.sheet;for(let l of this.keyframeNames)if(l in t)t[l].count++;else{let d={text:`@keyframes ${l}{`+Object.entries(e.keyframes[l]).map(([s,r])=>`${s}{${Object.entries(r).map(([o,a])=>o+":"+a).join(";")}}`).join("")+"}",theme:""},m;if(Object.keys(t).length?(m=c[0]).natives.push(d):c.splice(0,0,m={natives:[d],get text(){return this.natives.map(s=>s.text).join("")}}),n){let s;for(let r=0;r<n.cssRules.length;r++){let o=n.cssRules[r];if(o.constructor.name!=="CSSKeyframesRule")break;if(o.name===l){s=o;break}}if(s)d.cssRule=s;else{let r=m.natives.length-1;n.insertRule(d.text,r),d.cssRule=n.cssRules[r]}}t[l]={native:d,count:1}}}}0&&(module.exports={rules});
1
+ var g=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var w=(e,t)=>{for(var i in t)g(e,i,{get:t[i],enumerable:!0})},S=(e,t,i,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of $(t))!C.call(e,n)&&n!==i&&g(e,n,{get:()=>t[n],enumerable:!(c=k(t,n))||c.enumerable});return e};var R=e=>S(g({},"__esModule",{value:!0}),e);var I={};w(I,{rules:()=>T});module.exports=R(I);var f=require("../constants/start-symbol"),x=require("../utils/css-escape"),B={group:{match:"^(?:.+?[*_>~+])?\\{.+?\\}",analyze(e){let t=0;for(;t<e.length&&!(e[t]==="{"&&e[t-1]!=="\\");t++);return[e.slice(t),e.slice(0,t)]},declare(e){let t={},i=(r,o)=>{let a=o.indexOf(":");if(a!==-1){r in t||(t[r]={});let u=t[r],h=o.slice(0,a);h in u||(u[h]=o.slice(a+1))}},c=r=>{let o=(a,u)=>{let h=u.slice((0,x.cssEscape)(r.className).length).match(/\{(.*)\}/)[1].split(";");for(let y of h)i(a,y)};if(this.theme){let a=r.natives.find(u=>u.theme===this.theme)??r.natives.find(u=>!u.theme);a&&o(this.theme,a.text)}else for(let a of r.natives)o(a.theme,a.text);if(r.keyframeNames){this.keyframeNames||(this.keyframeNames=[]);for(let a of r.keyframeNames)this.keyframeNames.includes(a)||this.keyframeNames.push(a)}},n=[],l="",d=()=>{l&&(n.push(l.replace(/ /g,"|")),l="")},m=1;(function r(o){for(;m<e.length;m++){let a=e[m];if(!o){if(a===";"){d();continue}if(a==="}")break}if(l+=a,o===a){if(o==="'"||o==='"'){let u=0;for(let h=l.length-2;l[h]==="\\";h--)u++;if(u%2)continue}break}else a in f.START_SYMBOLS&&o!=="'"&&o!=='"'&&(m++,r(f.START_SYMBOLS[a]))}})(void 0),d();for(let r of n){let o=this.css.create(r);if(Array.isArray(o))for(let a of o)c(a);else o?c(o):i(this.theme??"",r)}let s={};for(let r in t)for(let[o,a]of Object.entries(t[r]))o in s?s[o][r]=a:s[o]={[r]:a};return s},delete(){return v.call(this)},insert(){return b.call(this)}},variable:{match:"^\\$[^ (){}A-Z]+:[^ ]",declare(e){return{["--"+this.prefix.slice(1,-1)]:e}}},fontSize:{match:"^f(?:ont)?:(?:[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},fontWeight:{match:"^f(?:ont)?:(?:bolder|$values)(?!\\|)",native:!0,values:{thin:100,extralight:200,light:300,regular:400,medium:500,semibold:600,bold:700,extrabold:800,heavy:900}},fontFamily:{match:"^f(?:ont)?:(?:$values)(?!\\|)",native:!0,values:{mono:"ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace",sans:"ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji",serif:"ui-serif,Georgia,Cambria,Times New Roman,Times,serif"}},fontSmoothing:{match:"^f(?:ont)?:(?:antialiased|subpixel-antialiased|$values)(?!\\|)",declare(e){switch(e){case"subpixel-antialiased":return{"-webkit-font-smoothing":"auto","-moz-osx-font-smoothing":"auto"};case"antialiased":return{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale"}}}},fontStyle:{match:"^f(?:ont)?:(?:normal|italic|oblique|$values)(?!\\|)",native:!0,unit:"deg"},fontVariantNumeric:{match:"^f(?:ont)?:(?:ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|$values)(?!\\|)",native:!0},fontFeatureSettings:{match:"^font-feature:.",native:!0},font:{match:"^f:.",native:!0,order:-1},color:{match:"^(?:color|fg|foreground):.",native:!0,colored:!0,values:{current:"currentColor"}},marginLeft:{match:"^ml:.",native:!0,unit:"rem"},marginRight:{match:"^mr:.",native:!0,unit:"rem"},marginTop:{match:"^mt:.",native:!0,unit:"rem"},marginBottom:{match:"^mb:.",native:!0,unit:"rem"},marginX:{match:"^(?:mx|margin-x):.",unit:"rem",order:-.5,declare(e,t){return{"margin-left":e+t,"margin-right":e+t}}},marginY:{match:"^(?:my|margin-y):.",unit:"rem",order:-.5,declare(e,t){return{"margin-top":e+t,"margin-bottom":e+t}}},margin:{match:"^m:.",native:!0,unit:"rem",order:-1},paddingLeft:{match:"^pl:.",native:!0,unit:"rem"},paddingRight:{match:"^pr:.",native:!0,unit:"rem"},paddingTop:{match:"^pt:.",native:!0,unit:"rem"},paddingBottom:{match:"^pb:.",native:!0,unit:"rem"},paddingX:{match:"^(?:px|padding-x):.",unit:"rem",order:-.5,declare(e,t){return{"padding-left":e+t,"padding-right":e+t}}},paddingY:{match:"^(?:py|padding-y):.",unit:"rem",order:-.5,declare(e,t){return{"padding-top":e+t,"padding-bottom":e+t}}},padding:{match:"^p:.",native:!0,unit:"rem",order:-1},flexBasis:{values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560},unit:"rem",native:!0},flexWrap:{match:"^flex:(?:wrap(?:-reverse)?|nowrap|$values)(?!\\|)",native:!0},flexGrow:{native:!0},flexShrink:{native:!0},flexDirection:{match:"^flex:(?:(?:row|column)(?:-reverse)?|$values)(?!\\|)",native:!0,values:{col:"column","col-reverse":"column-reverse"}},flex:{native:!0,order:-1},display:{match:"^d:.",native:!0},width:{match:"^w:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},height:{match:"^h:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},minWidth:{match:"^min-w:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},minHeight:{match:"^min-h:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},box:{match:"^(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e]},declare(e){let[t,i]=e.split(" x ");return{width:t,height:i}}},minBox:{match:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e.slice(4)]},declare(e){let[t,i]=e.split(" x ");return{"min-width":t,"min-height":i}}},maxBox:{match:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e.slice(4)]},declare(e){let[t,i]=e.split(" x ");return{"max-width":t,"max-height":i}}},contain:{native:!0},content:{native:!0},counterIncrement:{native:!0},counterReset:{native:!0},letterSpacing:{match:"^ls:.",native:!0,unit:"em"},lineHeight:{match:"^lh:.",native:!0},objectFit:{match:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)",native:!0},objectPosition:{match:"^(?:object|obj):(?:top|bottom|right|left|center|$values)",native:!0},textAlign:{match:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)",native:!0},textDecorationColor:{match:"^text-decoration:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},textDecorationStyle:{match:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)",native:!0},textDecorationThickness:{match:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",native:!0,unit:"em"},textDecorationLine:{match:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)",native:!0},textDecoration:{match:"^t(?:ext)?:(?:underline|line-through|overline)",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"},order:-1},textUnderlineOffset:{unit:"rem",native:!0},textOverflow:{match:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))",native:!0},textOrientation:{match:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)",native:!0},textTransform:{match:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)",native:!0},textRendering:{match:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)",native:!0},textIndent:{unit:"rem",native:!0},verticalAlign:{match:"^(?:v|vertical):.",native:!0},columns:{match:"^(?:columns|cols):.",native:!0,order:-1},whiteSpace:{native:!0},top:{native:!0,unit:"rem"},bottom:{native:!0,unit:"rem"},left:{native:!0,unit:"rem"},right:{native:!0,unit:"rem"},inset:{native:!0,unit:"rem",order:-1},lines:{match:"^lines:.",declare(e,t){return{overflow:"hidden",display:"-webkit-box","overflow-wrap":"break-word","text-overflow":"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":e+t}}},maxHeight:{match:"^max-h:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},maxWidth:{match:"^max-w:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},boxSizing:{match:"^box:(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box"}},opacity:{native:!0},visibility:{native:!0},clear:{native:!0},float:{native:!0},isolation:{native:!0},overflowX:{native:!0,declare(e,t){return e==="overlay"?{"overflow-x":["auto",e]}:{"overflow-x":e}}},overflowY:{native:!0,declare(e,t){return e==="overlay"?{"overflow-y":["auto",e]}:{"overflow-y":e}}},overflow:{native:!0,order:-1,declare(e,t){return e==="overlay"?{overflow:["auto",e]}:{overflow:e}}},overscrollBehaviorX:{native:!0},overscrollBehaviorY:{native:!0},overscrollBehavior:{native:!0,order:-1},zIndex:{match:"^z:.",native:!0},position:{native:!0,values:{abs:"absolute",rel:"relative"}},cursor:{native:!0},pointerEvents:{native:!0},resize:{native:!0},touchAction:{native:!0},wordBreak:{native:!0},wordSpacing:{native:!0,unit:"em"},userDrag:{native:!0,declare(e,t){return{"user-drag":e+t,"-webkit-user-drag":e+t}}},userSelect:{native:!0,declare(e,t){return{"user-select":e+t,"-webkit-user-select":e+t}}},textShadow:{unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},textSize:{match:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",declare(e,t){return{"font-size":e+t,"line-height":t==="em"?e+.875+t:`calc(${e}${t} + ${.875}em)`}}},textFillColor:{native:!0,match:"^(?:text-fill|text|t):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-fill-color":e+t}}},textStrokeWidth:{match:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",unit:"rem",declare(e,t){return{"-webkit-text-stroke-width":e+t}}},textStrokeColor:{match:"^text-stroke:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-stroke-color":e+t}}},textStroke:{unit:"rem",native:!0,declare(e,t){return{"-webkit-text-stroke":e+t}}},boxShadow:{match:"^s(?:hadow)?:.",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},tableLayout:{native:!0},transformBox:{match:"^transform:(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},transformStyle:{match:"^transform:(?:flat|preserve-3d|$values)(?!\\|)",native:!0},transformOrigin:{match:"^transform:(?:top|bottom|right|left|center|[0-9]|$values)",native:!0,unit:"px"},transform:{match:"^(?:translate|scale|skew|rotate|perspective|matrix)(?:3d|[XYZ])?\\(",native:!0},transitionProperty:{match:"^~property:.",native:!0},transitionTimingFunction:{match:"^~easing:.",native:!0},transitionDuration:{match:"^~duration:.",native:!0,unit:"ms"},transitionDelay:{match:"^~delay:.",native:!0,unit:"ms"},transition:{symbol:"~",native:!0,order:-1},animationDelay:{match:"^@delay:.",native:!0,unit:"ms"},animationDirection:{match:"^@direction:.",native:!0},animationDuration:{match:"^@duration:.",native:!0,unit:"ms"},animationFillMode:{match:"^@fill-mode:.",native:!0},animationIterationCount:{match:"^@iteration-count:.",native:!0},animationName:{match:"^@name:.",native:!0,create(e){return p.call(this,e)},delete(){return v.call(this)},insert(){return b.call(this)}},animationPlayState:{match:"^@play-state:.",native:!0},animationTimingFunction:{match:"^@easing:.",native:!0},animation:{symbol:"@",native:!0,order:-1,create(e){return p.call(this,e)},delete(){return v.call(this)},insert(){return b.call(this)}},borderCollapse:{match:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)",native:!0},borderSpacing:{unit:"rem",native:!0},borderTopColor:{match:"^b(?:t|order-top(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderBottomColor:{match:"^b(?:b|order-bottom(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderLeftColor:{match:"^b(?:l|order-left(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderRightColor:{match:"^b(?:r|order-right(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderXColor:{match:"^b(?:x|order-x(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",order:-.5,colored:!0,values:{current:"currentColor"},declare(e,t){return{"border-left-color":e+t,"border-right-color":e+t}}},borderYColor:{match:"^b(?:y|order-y(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",order:-.5,colored:!0,values:{current:"currentColor"},declare(e,t){return{"border-top-color":e+t,"border-bottom-color":e+t}}},borderColor:{match:"^b(?:order)?(?:-color)?:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,order:-1,colored:!0,values:{current:"currentColor"}},borderTopLeftRadius:{match:"^r(?:tl|lt):.",unit:"rem",native:!0},borderTopRightRadius:{match:"^r(?:tr|rt):.",unit:"rem",native:!0},borderBottomLeftRadius:{match:"^r(?:bl|lb):.",unit:"rem",native:!0},borderBottomRightRadius:{match:"^r(?:br|rb):.",unit:"rem",native:!0},borderTopRadius:{match:"^rt:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-left-radius":e+t,"border-top-right-radius":e+t}}},borderBottomRadius:{match:"^rb:.",unit:"rem",order:-.5,declare(e,t){return{"border-bottom-left-radius":e+t,"border-bottom-right-radius":e+t}}},borderLeftRadius:{match:"^rl:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-left-radius":e+t,"border-bottom-left-radius":e+t}}},borderRightRadius:{match:"^rr:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-right-radius":e+t,"border-bottom-right-radius":e+t}}},borderRadius:{match:"^r:.",unit:"rem",native:!0,order:-1},borderTopStyle:{match:"^b(?:t|order-top(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderBottomStyle:{match:"^b(?:b|order-bottom(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderLeftStyle:{match:"^b(?:l|order-left(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderRightStyle:{match:"^b(?:r|order-right(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderXStyle:{match:"^b(?:x|order-x(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",order:-.5,declare(e,t){return{"border-left-style":e+t,"border-right-style":e+t}}},borderYStyle:{match:"^b(?:y|order-y(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",order:-.5,declare(e,t){return{"border-top-style":e+t,"border-bottom-style":e+t}}},borderStyle:{match:"^b(?:order)?(?:-style)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0,order:-1},borderTopWidth:{match:"^b(?:t|order-top(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderBottomWidth:{match:"^b(?:b|order-bottom(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderLeftWidth:{match:"^b(?:l|order-left(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderRightWidth:{match:"^b(?:r|order-right(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderXWidth:{match:"^b(?:x|order-x(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",order:-.5,declare(e,t){return{"border-left-width":e+t,"border-right-width":e+t}}},borderYWidth:{match:"^b(?:y|order-y(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",order:-.5,declare(e,t){return{"border-top-width":e+t,"border-bottom-width":e+t}}},borderWidth:{match:"^b(?:order)?(?:-width)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0,order:-1},borderImageOutset:{unit:"rem",native:!0},borderImageRepeat:{match:"^border-image:(?:stretch|repeat|round|space|$values)(?!\\|)",native:!0},borderImageSlice:{native:!0},borderImageSource:{match:"^border-image:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0},borderImageWidth:{match:"^border-image:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderImage:{native:!0,order:-1},borderTop:{match:"^bt:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderBottom:{match:"^bb:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderLeft:{match:"^bl:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderRight:{match:"^br:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderX:{match:"^(?:bx|border-x):.",unit:"rem",colored:!0,order:-.5,values:{current:"currentColor"},declare(e){return{"border-left":e,"border-right":e}}},borderY:{match:"^(?:by|border-y):.",unit:"rem",colored:!0,order:-.5,values:{current:"currentColor"},declare(e){return{"border-top":e,"border-bottom":e}}},border:{match:"^b:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"},order:-2},backgroundAttachment:{match:"^(?:bg|background):(?:fixed|local|scroll|$values)(?!\\|)",native:!0},backgroundBlendMode:{native:!0},backgroundColor:{match:"^(?:bg|background):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},backgroundClip:{match:"^(?:bg|background):(?:text|$values)(?!\\|)",native:!0,declare(e,t){return{"-webkit-background-clip":e+t,"background-clip":e+t}},values:{content:"content-box",border:"border-box",padding:"padding-box"}},backgroundOrigin:{match:"^(?:bg|background):(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box"}},backgroundPosition:{match:"^(?:bg|background):(?:top|bottom|right|left|center|$values)(?!\\|)",native:!0,unit:"px"},backgroundRepeat:{match:"^(?:bg|background):(?:space|round|repeat|no-repeat|repeat-x|repeat-y|$values)(?![|a-zA-Z])",native:!0},backgroundSize:{match:"^(?:bg|background):(?:\\.?\\[0-9]+|auto|cover|contain|$values)(?!\\|)",unit:"rem",native:!0},backgroundImage:{match:"^(?:(?:bg|background):(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)|gradient\\(.*\\))(?!\\|)",native:!0,colored:!0,values:{current:"currentColor"},analyze(e){if(e.startsWith("gradient"))return["linear-"+e];let t=e.indexOf(":");return this.prefix=e.slice(0,t+1),[e.slice(t+1)]}},background:{match:"^bg:.",native:!0,colored:!0,values:{current:"currentColor"},order:-1},mixBlendMode:{match:"^blend:.",native:!0},backdropFilter:{match:"^bd:.",native:!0,colored:!0,values:{current:"currentColor"},declare(e,t){return{"backdrop-filter":e+t,"-webkit-backdrop-filter":e+t}}},filter:{match:"^(?:blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(",native:!0,colored:!0,values:{current:"currentColor"}},fill:{match:"^fill:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},strokeDasharray:{native:!0},strokeDashoffset:{native:!0},strokeWidth:{match:"^stroke:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",native:!0},stroke:{native:!0,colored:!0,values:{current:"currentColor"}},x:{native:!0},y:{native:!0},cx:{native:!0},cy:{native:!0},rx:{native:!0},ry:{native:!0},gridColumnStart:{match:"^grid-col-start:.",native:!0},gridColumnEnd:{match:"^grid-col-end:.",native:!0},gridColumn:{match:"^grid-col(?:umn)?(?:-span)?:.",native:!0,order:-1,transform(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridColumns:{match:"^grid-cols:.",declare(e,t){return{display:"grid","grid-template-columns":"repeat("+e+t+",minmax(0,1fr))"}}},gridRowStart:{native:!0},gridRowEnd:{native:!0},gridRow:{match:"^grid-row-span:.",native:!0,order:-1,transform(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridRows:{match:"^grid-rows:.",declare(e,t){return{display:"grid","grid-auto-flow":"column","grid-template-rows":"repeat("+e+t+",minmax(0,1fr))"}}},gridAutoColumns:{match:"^grid-auto-cols:.",native:!0,values:{min:"min-content",max:"max-content"}},gridAutoFlow:{match:"^grid-flow:.",native:!0},gridAutoRows:{values:{min:"min-content",max:"max-content"},native:!0},gridTemplateAreas:{native:!0},gridTemplateColumns:{match:"^grid-template-cols:.",native:!0,unit:"rem",values:{min:"min-content",max:"max-content"}},gridTemplateRows:{native:!0,unit:"rem",values:{min:"min-content",max:"max-content"}},gridTemplate:{native:!0,order:-1},gridArea:{native:!0,order:-1},grid:{native:!0,order:-1},columnGap:{match:"^gap-x:.",unit:"rem",native:!0},rowGap:{match:"^gap-y:.",unit:"rem",native:!0},gap:{unit:"rem",native:!0,order:-1},order:{match:"^o:.",native:!0,values:{first:-999999,last:999999}},breakInside:{native:!0},breakBefore:{native:!0},breakAfter:{native:!0},boxDecorationBreak:{match:"^box:(?:slice|clone|$values)(?!\\|)",native:!0,declare(e,t){return{"box-decoration-break":e+t,"-webkit-box-decoration-break":e+t}}},aspectRatio:{match:"^aspect:.",native:!0},columnSpan:{match:"^col-span:.",native:!0},alignContent:{match:"^ac:.",native:!0},alignItems:{match:"^ai:.",native:!0},alignSelf:{match:"^as:",native:!0},justifyContent:{match:"^jc:.",native:!0},justifyItems:{match:"^ji:.",native:!0},justifySelf:{match:"^js:.",native:!0},placeContent:{native:!0,order:-1},placeItems:{native:!0,order:-1},placeSelf:{native:!0,order:-1},listStylePosition:{match:"^list-style:(?:inside|outside|$values)(?!\\|)",native:!0},listStyleType:{match:"^list-style:(?:disc|decimal|$values)(?!\\|)",native:!0},listStyleImage:{match:"^list-style:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0},listStyle:{native:!0,order:-1},outlineColor:{match:"^outline:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},outlineOffset:{unit:"rem",native:!0},outlineStyle:{match:"^outline:(?:none|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},outlineWidth:{match:"^outline:(?:\\.?[0-9]|medium|thick|thin|(max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},outline:{native:!0,unit:"rem",order:-1,colored:!0,values:{current:"currentColor"}},accentColor:{match:"^accent:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},appearance:{native:!0},caretColor:{match:"^caret:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},scrollBehavior:{native:!0},scrollMarginLeft:{match:"^sml:.",native:!0,unit:"rem"},scrollMarginRight:{match:"^smr:.",native:!0,unit:"rem"},scrollMarginTop:{match:"^smt:.",native:!0,unit:"rem"},scrollMarginBottom:{match:"^smb:.",native:!0,unit:"rem"},scrollMarginX:{match:"^(?:smx|scroll-margin-x):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-margin-left":e+t,"scroll-margin-right":e+t}}},scrollMarginY:{match:"^(?:smy|scroll-margin-y):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-margin-top":e+t,"scroll-margin-bottom":e+t}}},scrollMargin:{match:"^sm:.",native:!0,unit:"rem",order:-1},scrollPaddingLeft:{match:"^spl:.",native:!0,unit:"rem"},scrollPaddingRight:{match:"^spr:.",native:!0,unit:"rem"},scrollPaddingTop:{match:"^spt:.",native:!0,unit:"rem"},scrollPaddingBottom:{match:"^spb:.",native:!0,unit:"rem"},scrollPaddingX:{match:"^(?:spx|scroll-padding-x):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-padding-left":e+t,"scroll-padding-right":e+t}}},scrollPaddingY:{match:"^(?:spy|scroll-padding-y):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-padding-top":e+t,"scroll-padding-bottom":e+t}}},scrollPadding:{match:"^sp:.",native:!0,unit:"rem",order:-1},scrollSnapAlign:{match:"^scroll-snap:(?:start|end|center|$values)",native:!0},scrollSnapStop:{match:"^scroll-snap:(?:normal|always|$values)(?!\\|)",native:!0},scrollSnapType:{match:"^scroll-snap:(?:(?:[xy]|block|inline|both)(?:\\|(?:proximity|mandatory))?|$values)(?!\\|)",native:!0},willChange:{native:!0},writingMode:{match:"^writing:.",native:!0},direction:{native:!0},shapeOutside:{match:"^shape:(?:(?:inset|circle|ellipse|polygon|url|linear-gradient)\\(.*\\)|$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box",margin:"margin-box"}},shapeMargin:{match:"^shape:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},shapeImageThreshold:{native:!0},clipPath:{match:"^clip:.",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box",margin:"margin-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},quotes:{native:!0},maskImage:{native:!0,declare(e,t){return{"mask-image":e+t,"-webkit-mask-image":e+t}}}},T=B;function p(e){if(!this.css.config.keyframes)return;let t=(this.meta.origin==="symbol"?e.slice(this.meta.config.symbol.length):e.slice(e.indexOf(":")+1)).split("|").filter(i=>i in this.css.config.keyframes);t?.length&&(this.keyframeNames=t)}function v(){if(this.keyframeNames?.length){let e=this.css.rules[0];for(let t of this.keyframeNames){let i=this.css.keyframes[t];if(!--i.count){let c=e.natives.indexOf(i.native);this.css.style.sheet.deleteRule(c),e.natives.splice(c,1),delete this.css.keyframes[t]}}e.natives.length||this.css.rules.splice(0,1)}}function b(){if(this.keyframeNames){let{config:e,keyframes:t,style:i,rules:c}=this.css,n=i?.sheet;for(let l of this.keyframeNames)if(l in t)t[l].count++;else{let d={text:`@keyframes ${l}{`+Object.entries(e.keyframes[l]).map(([s,r])=>`${s}{${Object.entries(r).map(([o,a])=>o+":"+a).join(";")}}`).join("")+"}",theme:""},m;if(Object.keys(t).length?(m=c[0]).natives.push(d):c.splice(0,0,m={natives:[d],get text(){return this.natives.map(s=>s.text).join("")}}),n){let s;for(let r=0;r<n.cssRules.length;r++){let o=n.cssRules[r];if(o.constructor.name!=="CSSKeyframesRule")break;if(o.name===l){s=o;break}}if(s)d.cssRule=s;else{let r=m.natives.length-1;n.insertRule(d.text,r),d.cssRule=n.cssRules[r]}}t[l]={native:d,count:1}}}}0&&(module.exports={rules});
@@ -1 +1 @@
1
- var L=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var Y=(y,s,i)=>s in y?L(y,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):y[s]=i;var G=(y,s)=>{for(var i in s)L(y,i,{get:s[i],enumerable:!0})},J=(y,s,i,o)=>{if(s&&typeof s=="object"||typeof s=="function")for(let u of q(s))!U.call(y,u)&&u!==i&&L(y,u,{get:()=>s[u],enumerable:!(o=Z(s,u))||o.enumerable});return y};var P=y=>J(L({},"__esModule",{value:!0}),y);var T=(y,s,i)=>(Y(y,typeof s!="symbol"?s+"":s,i),i);var X={};G(X,{MasterCSS:()=>k});module.exports=P(X);function $(y){let s=typeof Buffer<"u"?Buffer:null;return!!(s&&y instanceof s||y instanceof Date||y instanceof RegExp)}function F(y){if(typeof Buffer<"u"&&Buffer&&y instanceof Buffer){let s=Buffer.alloc(y.length);return y.copy(s),s}else{if(y instanceof Date)return new Date(y.getTime());if(y instanceof RegExp)return new RegExp(y);throw new Error("Unexpected situation")}}function V(y){let s=[];return y.forEach(function(i,o){typeof i=="object"&&i!==null?Array.isArray(i)?s[o]=V(i):$(i)?s[o]=F(i):s[o]=M({},i):s[o]=i}),s}function I(y,s){return s==="__proto__"?void 0:y[s]}function M(...y){let s={},i,o;return y.forEach(function(u){typeof u!="object"||u===null||Array.isArray(u)||Object.keys(u).forEach(function(v){if(o=I(s,v),i=I(u,v),i!==s)if(typeof i!="object"||i===null){s[v]=i;return}else if(Array.isArray(i)){s[v]=V(i);return}else if($(i)){s[v]=F(i);return}else if(typeof o!="object"||o===null||Array.isArray(o)){s[v]=M({},i);return}else{s[v]=M(o,i);return}})}),s}var H=require("./rule"),N=require("./config"),Q=require("./utils/rgb-to-hex"),z=require("./constants/selector-symbols");var W=typeof window<"u",D=()=>{let y=document.createElement("style");return y.id="master",y},S=class{constructor(s=N.config){this.config=s;s?.override||(this.config=M(N.config,s),"keyframes"in s&&Object.assign(this.config.keyframes,s.keyframes)),this.cache(),W&&this.config.observe&&this.observe(document),S.instances.push(this)}rules=[];ruleBy={};countBy={};observing=!1;observer;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.themeAffectedClassesBy={},this.classesBy={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={},this.keyframes={};let{semantics:s,classes:i,selectors:o,themes:u,colors:v,values:A,breakpoints:w,mediaQueries:g,rules:E}=this.config;function C(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function a(t,n,c="",d={}){let b=R=>R?(c?c+"-":"")+R:c,x=Object.entries(t),B=[],O=[];for(let R of x){let j=R[1];(typeof j=="object"&&!Array.isArray(j)?B:O).push(R)}for(let[R,j]of B)a(j,n,b(R),d);if(n&&c)O.length&&(d[c]=O.reduce((R,[j,_])=>(R[j]=_,R),{}));else for(let[R,j]of O)d[b(R)]=j;return d}function m(t){for(let[n,c]of Object.entries(t))/^[0-9]+x$/.test(n)&&typeof c=="number"&&(t["-"+n]=c*-1);return t}if(s)for(let[t,n]of Object.entries(a(s,!0)))this.semantics.push([new RegExp("^"+C(t)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[t,n]]);if(o)for(let[t,n]of Object.entries(a(o,!1))){let c=new RegExp(C(t)+"(?![a-z-])");for(let d of Array.isArray(n)?n:[n]){let b=d.match(/^::-[a-z]+-/m)?.[0]??"",x=this.selectors[b];x||(x=this.selectors[b]=[]);let B=x.find(([O])=>O===c);B||(B=[c,[]],x.push(B)),B[1].push(d)}}A&&(this.globalValues=m(a(A,!1))),w&&(this.breakpoints=a(w,!1)),g&&(this.mediaQueries=a(g,!1));let p=i?a(i,!1):{},h=u&&!Array.isArray(u)?Object.entries(u).filter(([,{classes:t}])=>t).reduce((t,[n,{classes:c}])=>(t[n]=a(c,!1),t),{}):{},f=[...Object.keys(p),...Object.entries(h).flatMap(([t,n])=>Object.keys(n))],l=t=>{if(t in this.classes)return;let n=this.classes[t]=[],c=(d,b)=>{if(!b)return;let x=Array.isArray(b)?b:b.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let B of x){let O=R=>{R in this.themeAffectedClassesBy?d in this.themeAffectedClassesBy[R]?this.themeAffectedClassesBy[R][d].push(t):this.themeAffectedClassesBy[R][d]=[t]:this.themeAffectedClassesBy[R]={[d]:[t]},n.includes(R)||n.push(R)};if(f.includes(B)){l(B);for(let R of this.classes[B])O(R)}else O(B)}};c("",p?.[t]);for(let[d,b]of Object.entries(h))c(d,b?.[t])};for(let t of f)l(t);for(let t in this.themeAffectedClassesBy){let n=this.classesBy[t]=[];for(let c of Object.values(this.themeAffectedClassesBy[t]))for(let d of c)n.includes(d)||n.push(d)}let r=(t,n)=>{if(!n)return;let c=a(n,!0);for(let[d,b]of Object.entries(c)){let x=typeof b=="string"?{"":b}:b;for(let[B,O]of Object.entries(x)){let R=d+(B?"-"+B:"");R in this.colorThemesMap?this.colorThemesMap[R][t]=O:this.colorThemesMap[R]={[t]:O}}}for(let d in n)this.colorNames.includes(d)||this.colorNames.push(d)};if(r("",v),u)if(Array.isArray(u))this.themeNames.push(...u);else for(let t in u){let n=u[t];r(t,n.colors),this.themeNames.push(t)}let e=t=>{for(let[n,c]of Object.entries(this.colorThemesMap))for(let[d,b]of Object.entries(c))b.startsWith("#")||t(n,c,d,b)};if(e((t,n,c,d)=>{let b=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(d);if(b){let x="#"+(0,Q.rgbToHex)(+b[1],+b[2],+b[3]);b[4]&&(x+=Math.round(255*+b[4]).toString(16)),n[c]=x}}),e((t,n,c,d)=>{let[b,x]=d.split("/"),B=this.colorThemesMap[b];if(B){let O=(c?B[c]:void 0)??B[""];n[c]=x?O.slice(0,7)+Math.round(255*+x).toString(16):O}else console.warn(`\`${d}\` doesn't exist in the extended config \`.colors\``),delete n[c],Object.keys(n).length||delete this.colorThemesMap[t]}),E)for(let t in E){let n=E[t],{native:c,values:d,colored:b}=n,x=n.match;if(n.id=t,n.native=c===!0?t.replace(/(?!^)[A-Z]/g,B=>"-"+B).toLowerCase():void 0,d&&(this.values[t]=m(a(d,!1))),x){let B=Object.keys(this.values[t]??{});x.includes("$values")&&(x=B.length?x.replace(/\$values/,B.join("|")):x.replace(/(?:\|)?\$values/,"")),b&&x.includes("$colors")&&(x=this.colorNames.length?x.replace(/\$colors/,"(?:"+this.colorNames.join("|")+")(?![0-9A-Za-z])"):x.replace(/(?:\|)?\$colors/,"")),this.matches[t]=new RegExp(x)}}}observe(s,i={subtree:!0,childList:!0}){if(this.root!==s){if(W&&s){this.root=s;let o=s===document;o&&(S.root=this),this.host=o?document.documentElement:this.root.host;let u=o?document.head:s,v=o?document.styleSheets:s.styleSheets;for(let w of v){let{ownerNode:g}=w;if(g&&g.id==="master"){this.style=g;break}}if(this.style)for(let w=0;w<this.style.sheet.cssRules.length;w++){let g=this.style.sheet.cssRules[w];if(g.constructor.name==="CSSKeyframesRule")continue;let E=a=>{if(a.selectorText){let p=a.selectorText.split(", ")[0].split(" ");for(let h=0;h<p.length;h++){let f=p[h];if(f[0]==="."){let l=f.slice(1),r="";for(let e=0;e<l.length;e++){let t=l[e],n=l[e+1];if(t==="\\"){if(e++,n!=="\\"){r+=n;continue}}else if(z.SELECTOR_SYMBOLS.includes(t))break;r+=t}if(!(r in this.ruleBy)&&!(r in this.classes)){let e=this.create(r)[0];if(e)return e}}}}else if(a.cssRules)for(let m=0;m<a.cssRules.length;m++){let p=E(a.cssRules[m]);if(p)return p}},C=E(g);if(C){this.rules.push(C),this.ruleBy[C.className]=C;for(let a=0;a<C.natives.length;a++)C.natives[a].cssRule=this.style.sheet.cssRules[w+a];w+=C.natives.length-1,C.config.insert?.call(C)}}else this.style=D(),u.append(this.style);let A=w=>{w.forEach(g=>{g in this.countBy?this.countBy[g]++:(this.countBy[g]=1,this.insert(g))})};A(this.host.classList),i.subtree&&this.host.querySelectorAll("[class]").forEach(w=>A(w.classList)),this.observer=new MutationObserver(w=>{let g={},E=[],C=[],a=[],m=(l,r)=>{r?l.classList.forEach(h):l.classList.forEach(p);let e=l.children;for(let t=0;t<e.length;t++){let n=e[t];n.classList&&(C.push(n),m(n,r))}},p=l=>{l in g?g[l]++:g[l]=1},h=l=>{l in g?g[l]--:l in this.countBy&&(g[l]=-1)},f=(l,r)=>{for(let e=0;e<l.length;e++){let t=l[e];t.classList&&!C.includes(t)&&!a.includes(t)&&(t.isConnected!==r?(C.push(t),m(t,r)):a.push(t))}};for(let l=0;l<w.length;l++){let r=w[l],{addedNodes:e,removedNodes:t,type:n,target:c}=r;if(n==="attributes"){if(E.find(d=>d.target===c))continue;E.push(r)}else f(e,!1),(!c.isConnected||!C.includes(c))&&f(t,!0)}if(!(!E.length&&!Object.keys(g).length)){for(let{oldValue:l,target:r}of E){let e=C.includes(r),t=r.classList,n=l?l.split(" "):[];if(e){if(r.isConnected)continue;for(let c of n)t.contains(c)||h(c)}else if(r.isConnected){t.forEach(c=>{n.includes(c)||p(c)});for(let c of n)t.contains(c)||h(c)}}for(let l in g){let r=g[l],e=(this.countBy[l]||0)+r;e===0?(delete this.countBy[l],this.delete(l)):(l in this.countBy||this.insert(l),this.countBy[l]=e)}}}),this.observer.observe(s,{...i,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]}),this.host.style.display=null,this.observing=!0}return this}}disconnect(){this.observer&&(this.observer.disconnect(),this.observer=null),this.observing=!1,this.ruleBy={},this.countBy={},this.rules.length=0;let s=this.style?.sheet;if(s?.cssRules)for(let i=s.cssRules.length-1;i>=0;i--)s.deleteRule(i);this.style?.remove(),this.style=null,this.root=null}match(s){for(let i in this.config.rules){let o=this.config.rules[i],u=this.matches[i],{symbol:v,native:A}=o;if(u&&u.test(s))return{origin:"match",config:o};if(v&&s.startsWith(v))return{origin:"symbol",config:o};if(A&&s.startsWith(A+":"))return{origin:"match",config:o}}for(let i of this.semantics)if(s.match(i[0]))return{origin:"semantics",value:i[1]}}create(s){let i=o=>{if(o in this.ruleBy)return this.ruleBy[o];let u=this.match(o);if(u)return new H.Rule(o,u,this)};return(s in this.classes?this.classes[s].map(o=>i(o)):[i(s)]).filter(o=>o&&o.text)}refresh(s){if(s?.override?this.config=s:this.config=M(N.config,s),this.cache(),!this.style)return;let i=D();this.style.replaceWith(i),this.style=i,this.rules.length=0,this.ruleBy={};for(let o in this.countBy)this.insert(o)}destroy(){let s=S.instances;this.disconnect(),s.splice(s.indexOf(this),1)}delete(s){let i=this.style?.sheet,o=u=>{let v=this.ruleBy[u];if(!(!v||u in this.classesBy&&this.classesBy[u].some(A=>A in this.countBy))){if(i&&v.natives.length){let A=v.natives[0];for(let w=0;w<i.cssRules.length;w++)if(i.cssRules[w]===A.cssRule){for(let E=0;E<v.natives.length;E++)i.deleteRule(w);break}}this.rules.splice(this.rules.indexOf(v),1),delete this.ruleBy[u],v.config.delete&&v.config.delete.call(v,u)}};if(s in this.classes){for(let u of this.classes[s])u in this.countBy||o(u);delete this.ruleBy[s]}else o(s)}insert(s){let i=this.create(s);return i.length?(this.insertRules(i),!0):!1}insertRules(s){for(let i of s){if(this.ruleBy[i.className])continue;let o,u=Object.keys(this.keyframes).length,v=this.rules.length-1,{media:A,order:w,priority:g,hasWhere:E,className:C}=i,a=(h,f,l)=>{let r=h;for(;r<=v;r++){let e=this.rules[r];if(f?.(e))return l?-1:r-1;if(l?.(e))return r}return l?-1:r-1},m,p;if(A){let h=this.rules.findIndex(f=>f.media);if(h===-1)o=v+1;else{let{"max-width":f,"min-width":l}=A.features;if(f||l){let r=this.rules.findIndex(e=>e.media?.features["max-width"]||e.media?.features["min-width"]);if(r===-1)o=v+1;else if(f&&l){if(g===-1?(m=a(r,e=>e.priority!==-1,e=>e.media.features["max-width"]&&e.media.features["min-width"]),p=a(r,e=>e.priority!==-1)):(m=a(r,void 0,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1),p=v),m!==-1){let e=f.value-l.value,t=p,n=m;for(m=void 0;t>=n;t--){let{"max-width":c,"min-width":d}=this.rules[t].media.features,b=c.value-d.value;if(b<e)p=t-1;else if(b===e)m=t;else break}}if(m!==-1){let e=f.value-l.value;for(let t=p;t>=m;t--){let{"max-width":n,"min-width":c}=this.rules[t].media.features,d=n.value-c.value;if(d<e)p=t-1;else if(d>e){m=t+1;break}}}}else if(l){if(g===-1?(m=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]||e.priority!==-1,e=>!e.media.features["max-width"]&&e.media.features["min-width"]),p=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]||e.priority!==-1)):(m=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1,e=>!e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1),p=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1)),m!==-1)for(let e=p;e>=m;e--){let t=this.rules[e].media.features["min-width"].value;if(t>l.value)p=e-1;else if(t<l.value){m=e+1;break}}}else if(g===-1?(m=a(r,e=>e.media.features["min-width"]||e.priority!==-1,e=>e.media.features["max-width"]),p=a(r,e=>e.media.features["min-width"]||e.priority!==-1)):(m=a(r,e=>e.media.features["min-width"]&&e.priority!==-1,e=>e.media.features["max-width"]&&e.priority!==-1),p=a(r,e=>e.media.features["min-width"]&&e.priority!==-1)),m!==-1)for(let e=p;e>=m;e--){let t=this.rules[e].media.features["max-width"].value;if(t<f.value)p=e-1;else if(t>f.value){m=e+1;break}}}else g===-1?(m=h,p=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"]||r.priority!==-1)):(m=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"],r=>r.priority!==-1),p=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"]))}}else{let h=u?1:0;g===-1?(m=h,p=a(h,f=>f.media||f.priority!==-1)):(m=a(h,f=>f.media,f=>f.priority!==-1),p=a(h,f=>f.media))}if(o===void 0)if(m===-1)o=p+1;else{if(g===-1)for(let h=m;h<=p;h++){let f=this.rules[h];if(!(!E&&f.hasWhere)&&(E&&!f.hasWhere||f.order>=w)){o=h;break}}else for(let h=m;h<=p;h++){let f=this.rules[h];if(!(!E&&f.hasWhere)){if(E&&!f.hasWhere){o=h;break}if(f.priority<g){o=h;break}else if(f.priority===g){if(f.order>=w){o=h;break}}else o=h+1}}o===void 0&&(o=p+1)}if(this.rules.splice(o,0,i),this.ruleBy[C]=i,this.style){let h=this.style.sheet,f=0,l=r=>{let e=this.rules[r];if(e){if(!e.natives.length)return l(r-1);let t=e.natives[e.natives.length-1].cssRule;for(let n=0;n<h.cssRules.length;n++)if(h.cssRules[n]===t){f=n+1;break}}};l(o-1);for(let r=0;r<i.natives.length;)try{let e=i.natives[r];h.insertRule(e.text,f),e.cssRule=h.cssRules[f++],r++}catch(e){console.error(e),i.natives.splice(r,1)}}i.config.insert?.call(i)}}get text(){return this.rules.map(s=>s.text).join("")}},k=S;T(k,"root"),T(k,"config",N.config),T(k,"instances",[]),T(k,"refresh",s=>{for(let i of S.instances)i.refresh(s)});W&&(window.MasterCSS=k);0&&(module.exports={MasterCSS});
1
+ var L=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var Y=(y,s,i)=>s in y?L(y,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):y[s]=i;var G=(y,s)=>{for(var i in s)L(y,i,{get:s[i],enumerable:!0})},J=(y,s,i,o)=>{if(s&&typeof s=="object"||typeof s=="function")for(let u of q(s))!U.call(y,u)&&u!==i&&L(y,u,{get:()=>s[u],enumerable:!(o=Z(s,u))||o.enumerable});return y};var P=y=>J(L({},"__esModule",{value:!0}),y);var T=(y,s,i)=>(Y(y,typeof s!="symbol"?s+"":s,i),i);var X={};G(X,{MasterCSS:()=>O});module.exports=P(X);function $(y){let s=typeof Buffer<"u"?Buffer:null;return!!(s&&y instanceof s||y instanceof Date||y instanceof RegExp)}function F(y){if(typeof Buffer<"u"&&Buffer&&y instanceof Buffer){let s=Buffer.alloc(y.length);return y.copy(s),s}else{if(y instanceof Date)return new Date(y.getTime());if(y instanceof RegExp)return new RegExp(y);throw new Error("Unexpected situation")}}function V(y){let s=[];return y.forEach(function(i,o){typeof i=="object"&&i!==null?Array.isArray(i)?s[o]=V(i):$(i)?s[o]=F(i):s[o]=j({},i):s[o]=i}),s}function I(y,s){return s==="__proto__"?void 0:y[s]}function j(...y){let s={},i,o;return y.forEach(function(u){typeof u!="object"||u===null||Array.isArray(u)||Object.keys(u).forEach(function(v){if(o=I(s,v),i=I(u,v),i!==s)if(typeof i!="object"||i===null){s[v]=i;return}else if(Array.isArray(i)){s[v]=V(i);return}else if($(i)){s[v]=F(i);return}else if(typeof o!="object"||o===null||Array.isArray(o)){s[v]=j({},i);return}else{s[v]=j(o,i);return}})}),s}var H=require("./rule"),N=require("./config"),Q=require("./utils/rgb-to-hex"),z=require("./constants/selector-symbols");var W=typeof window<"u",D=()=>{let y=document.createElement("style");return y.id="master",y},k=class{constructor(s=N.config){this.config=s;s?.override||(this.config=j(N.config,s),"keyframes"in s&&Object.assign(this.config.keyframes,s.keyframes)),this.cache(),W&&this.config.observe&&this.observe(document),k.instances.push(this)}rules=[];ruleBy={};countBy={};observing=!1;observer;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.themeAffectedClassesBy={},this.classesBy={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={},this.keyframes={};let{semantics:s,classes:i,selectors:o,themes:u,colors:v,values:S,breakpoints:w,mediaQueries:g,rules:E}=this.config;function B(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function a(t,n,c="",d={}){let b=R=>R?(c?c+"-":"")+R:c,x=Object.entries(t),C=[],M=[];for(let R of x){let A=R[1];(typeof A=="object"&&!Array.isArray(A)?C:M).push(R)}for(let[R,A]of C)a(A,n,b(R),d);if(n&&c)M.length&&(d[c]=M.reduce((R,[A,_])=>(R[A]=_,R),{}));else for(let[R,A]of M)d[b(R)]=A;return d}function m(t){for(let[n,c]of Object.entries(t))/^[0-9]+x$/.test(n)&&typeof c=="number"&&(t["-"+n]=c*-1);return t}if(s)for(let[t,n]of Object.entries(a(s,!0)))this.semantics.push([new RegExp("^"+B(t)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[t,n]]);if(o)for(let[t,n]of Object.entries(a(o,!1))){let c=new RegExp(B(t)+"(?![a-z-])");for(let d of Array.isArray(n)?n:[n]){let b=d.match(/^::-[a-z]+-/m)?.[0]??"",x=this.selectors[b];x||(x=this.selectors[b]=[]);let C=x.find(([M])=>M===c);C||(C=[c,[]],x.push(C)),C[1].push(d)}}S&&(this.globalValues=m(a(S,!1))),w&&(this.breakpoints=a(w,!1)),g&&(this.mediaQueries=a(g,!1));let p=i?a(i,!1):{},h=u&&!Array.isArray(u)?Object.entries(u).filter(([,{classes:t}])=>t).reduce((t,[n,{classes:c}])=>(t[n]=a(c,!1),t),{}):{},f=[...Object.keys(p),...Object.entries(h).flatMap(([t,n])=>Object.keys(n))],l=t=>{if(t in this.classes)return;let n=this.classes[t]=[],c=(d,b)=>{if(!b)return;let x=Array.isArray(b)?b:b.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let C of x){let M=R=>{R in this.themeAffectedClassesBy?d in this.themeAffectedClassesBy[R]?this.themeAffectedClassesBy[R][d].push(t):this.themeAffectedClassesBy[R][d]=[t]:this.themeAffectedClassesBy[R]={[d]:[t]},n.includes(R)||n.push(R)};if(f.includes(C)){l(C);for(let R of this.classes[C])M(R)}else M(C)}};c("",p?.[t]);for(let[d,b]of Object.entries(h))c(d,b?.[t])};for(let t of f)l(t);for(let t in this.themeAffectedClassesBy){let n=this.classesBy[t]=[];for(let c of Object.values(this.themeAffectedClassesBy[t]))for(let d of c)n.includes(d)||n.push(d)}let r=(t,n)=>{if(!n)return;let c=a(n,!0);for(let[d,b]of Object.entries(c)){let x=typeof b=="string"?{"":b}:b;for(let[C,M]of Object.entries(x)){let R=d+(C?"-"+C:"");R in this.colorThemesMap?this.colorThemesMap[R][t]=M:this.colorThemesMap[R]={[t]:M}}}for(let d in n)this.colorNames.includes(d)||this.colorNames.push(d)};if(r("",v),u)if(Array.isArray(u))this.themeNames.push(...u);else for(let t in u){let n=u[t];r(t,n.colors),this.themeNames.push(t)}let e=t=>{for(let[n,c]of Object.entries(this.colorThemesMap))for(let[d,b]of Object.entries(c))b.startsWith("#")||t(n,c,d,b)};if(e((t,n,c,d)=>{let b=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(d);if(b){let x="#"+(0,Q.rgbToHex)(+b[1],+b[2],+b[3]);b[4]&&(x+=Math.round(255*+b[4]).toString(16)),n[c]=x}}),e((t,n,c,d)=>{let[b,x]=d.split("/"),C=this.colorThemesMap[b];if(C){let M=(c?C[c]:void 0)??C[""];n[c]=x?M.slice(0,7)+Math.round(255*+x).toString(16):M}else console.warn(`\`${d}\` doesn't exist in the extended config \`.colors\``),delete n[c],Object.keys(n).length||delete this.colorThemesMap[t]}),E)for(let t in E){let n=E[t],{native:c,values:d,colored:b}=n,x=n.match;if(n.id=t,n.native=c===!0?t.replace(/(?!^)[A-Z]/g,C=>"-"+C).toLowerCase():void 0,d&&(this.values[t]=m(a(d,!1))),x){let C=Object.keys(this.values[t]??{});x.includes("$values")&&(x=C.length?x.replace(/\$values/,C.join("|")):x.replace(/(?:\|)?\$values/,"")),b&&x.includes("$colors")&&(x=this.colorNames.length?x.replace(/\$colors/,"(?:"+this.colorNames.join("|")+")(?![0-9A-Za-z])"):x.replace(/(?:\|)?\$colors/,"")),this.matches[t]=new RegExp(x)}}}observe(s,i={subtree:!0,childList:!0}){if(this.root!==s){if(W&&s){this.root=s;let o=s===document;o&&(k.root=this),this.host=o?document.documentElement:this.root.host;let u=o?document.head:s,v=o?document.styleSheets:s.styleSheets;for(let w of v){let{ownerNode:g}=w;if(g&&g.id==="master"){this.style=g;break}}if(this.style)for(let w=0;w<this.style.sheet.cssRules.length;w++){let g=this.style.sheet.cssRules[w];if(g.constructor.name==="CSSKeyframesRule")continue;let E=a=>{if(a.selectorText){let p=a.selectorText.split(", ")[0].split(" ");for(let h=0;h<p.length;h++){let f=p[h];if(f[0]==="."){let l=f.slice(1),r="";for(let e=0;e<l.length;e++){let t=l[e],n=l[e+1];if(t==="\\"){if(e++,n!=="\\"){r+=n;continue}}else if(z.SELECTOR_SYMBOLS.includes(t))break;r+=t}if(!(r in this.ruleBy)&&!(r in this.classes)){let e=this.create(r)[0];if(e)return e}}}}else if(a.cssRules)for(let m=0;m<a.cssRules.length;m++){let p=E(a.cssRules[m]);if(p)return p}},B=E(g);if(B){this.rules.push(B),this.ruleBy[B.className]=B;for(let a=0;a<B.natives.length;a++)B.natives[a].cssRule=this.style.sheet.cssRules[w+a];w+=B.natives.length-1,B.config.insert?.call(B)}}else this.style=D(),u.append(this.style);let S=w=>{w.forEach(g=>{g in this.countBy?this.countBy[g]++:(this.countBy[g]=1,this.insert(g))})};S(this.host.classList),i.subtree&&this.host.querySelectorAll("[class]").forEach(w=>S(w.classList)),this.observer=new MutationObserver(w=>{let g={},E=[],B=[],a=[],m=(l,r)=>{r?l.classList.forEach(h):l.classList.forEach(p);let e=l.children;for(let t=0;t<e.length;t++){let n=e[t];n.classList&&(B.push(n),m(n,r))}},p=l=>{l in g?g[l]++:g[l]=1},h=l=>{l in g?g[l]--:l in this.countBy&&(g[l]=-1)},f=(l,r)=>{for(let e=0;e<l.length;e++){let t=l[e];t.classList&&!B.includes(t)&&!a.includes(t)&&(t.isConnected!==r?(B.push(t),m(t,r)):a.push(t))}};for(let l=0;l<w.length;l++){let r=w[l],{addedNodes:e,removedNodes:t,type:n,target:c}=r;if(n==="attributes"){if(E.find(d=>d.target===c))continue;E.push(r)}else f(e,!1),(!c.isConnected||!B.includes(c))&&f(t,!0)}if(!(!E.length&&!Object.keys(g).length)){for(let{oldValue:l,target:r}of E){let e=B.includes(r),t=r.classList,n=l?l.split(" "):[];if(e){if(r.isConnected)continue;for(let c of n)t.contains(c)||h(c)}else if(r.isConnected){t.forEach(c=>{n.includes(c)||p(c)});for(let c of n)t.contains(c)||h(c)}}for(let l in g){let r=g[l],e=(this.countBy[l]||0)+r;e===0?(delete this.countBy[l],this.delete(l)):(l in this.countBy||this.insert(l),this.countBy[l]=e)}}}),this.observer.observe(s,{...i,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]}),this.host.style.display=null,this.observing=!0}return this}}disconnect(){this.observer&&(this.observer.disconnect(),this.observer=null),this.observing=!1,this.ruleBy={},this.countBy={},this.rules.length=0;let s=this.style?.sheet;if(s?.cssRules)for(let i=s.cssRules.length-1;i>=0;i--)s.deleteRule(i);this.style?.remove(),this.style=null,this.root=null}match(s){for(let i in this.config.rules){let o=this.config.rules[i],u=this.matches[i],{symbol:v,native:S}=o;if(u&&u.test(s))return{origin:"match",config:o};if(v&&s.startsWith(v))return{origin:"symbol",config:o};if(S&&s.startsWith(S+":"))return{origin:"match",config:o}}for(let i of this.semantics)if(s.match(i[0]))return{origin:"semantics",value:i[1]}}create(s){let i=o=>{if(o in this.ruleBy)return this.ruleBy[o];let u=this.match(o);if(u)return new H.Rule(o,u,this)};return(s in this.classes?this.classes[s].map(o=>i(o)):[i(s)]).filter(o=>o&&o.text)}refresh(s){if(s?.override?this.config=s:this.config=j(N.config,s),this.cache(),!this.style)return;let i=D();this.style.replaceWith(i),this.style=i,this.rules.length=0,this.ruleBy={};for(let o in this.countBy)this.insert(o)}destroy(){let s=k.instances;this.disconnect(),s.splice(s.indexOf(this),1)}delete(s){let i=this.style?.sheet,o=u=>{let v=this.ruleBy[u];if(!(!v||u in this.classesBy&&this.classesBy[u].some(S=>S in this.countBy))){if(i&&v.natives.length){let S=v.natives[0];for(let w=0;w<i.cssRules.length;w++)if(i.cssRules[w]===S.cssRule){for(let E=0;E<v.natives.length;E++)i.deleteRule(w);break}}this.rules.splice(this.rules.indexOf(v),1),delete this.ruleBy[u],v.config.delete&&v.config.delete.call(v,u)}};if(s in this.classes){for(let u of this.classes[s])u in this.countBy||o(u);delete this.ruleBy[s]}else o(s)}insert(s){let i=this.create(s);return i.length?(this.insertRules(i),!0):!1}insertRules(s){for(let i of s){if(this.ruleBy[i.className])continue;let o,u=Object.keys(this.keyframes).length,v=this.rules.length-1,{media:S,order:w,priority:g,hasWhere:E,className:B}=i,a=(h,f,l)=>{let r=h;for(;r<=v;r++){let e=this.rules[r];if(f?.(e))return l?-1:r-1;if(l?.(e))return r}return l?-1:r-1},m,p;if(S){let h=this.rules.findIndex(f=>f.media);if(h===-1)o=v+1;else{let{"max-width":f,"min-width":l}=S.features;if(f||l){let r=this.rules.findIndex(e=>e.media?.features["max-width"]||e.media?.features["min-width"]);if(r===-1)o=v+1;else if(f&&l){if(g===-1?(m=a(r,e=>e.priority!==-1,e=>e.media.features["max-width"]&&e.media.features["min-width"]),p=a(r,e=>e.priority!==-1)):(m=a(r,void 0,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1),p=v),m!==-1){let e=f.value-l.value,t=p,n=m;for(m=void 0;t>=n;t--){let{"max-width":c,"min-width":d}=this.rules[t].media.features,b=c.value-d.value;if(b<e)p=t-1;else if(b===e)m=t;else break}}if(m!==-1){let e=f.value-l.value;for(let t=p;t>=m;t--){let{"max-width":n,"min-width":c}=this.rules[t].media.features,d=n.value-c.value;if(d<e)p=t-1;else if(d>e){m=t+1;break}}}}else if(l){if(g===-1?(m=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]||e.priority!==-1,e=>!e.media.features["max-width"]&&e.media.features["min-width"]),p=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]||e.priority!==-1)):(m=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1,e=>!e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1),p=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1)),m!==-1)for(let e=p;e>=m;e--){let t=this.rules[e].media.features["min-width"].value;if(t>l.value)p=e-1;else if(t<l.value){m=e+1;break}}}else if(g===-1?(m=a(r,e=>e.media.features["min-width"]||e.priority!==-1,e=>e.media.features["max-width"]),p=a(r,e=>e.media.features["min-width"]||e.priority!==-1)):(m=a(r,e=>e.media.features["min-width"]&&e.priority!==-1,e=>e.media.features["max-width"]&&e.priority!==-1),p=a(r,e=>e.media.features["min-width"]&&e.priority!==-1)),m!==-1)for(let e=p;e>=m;e--){let t=this.rules[e].media.features["max-width"].value;if(t<f.value)p=e-1;else if(t>f.value){m=e+1;break}}}else g===-1?(m=h,p=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"]||r.priority!==-1)):(m=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"],r=>r.priority!==-1),p=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"]))}}else{let h=u?1:0;g===-1?(m=h,p=a(h,f=>f.media||f.priority!==-1)):(m=a(h,f=>f.media,f=>f.priority!==-1),p=a(h,f=>f.media))}if(o===void 0)if(m===-1)o=p+1;else{if(g===-1)for(let h=m;h<=p;h++){let f=this.rules[h];if(!(!E&&f.hasWhere)&&(E&&!f.hasWhere||f.order>=w)){o=h;break}}else for(let h=m;h<=p;h++){let f=this.rules[h];if(!(!E&&f.hasWhere)){if(E&&!f.hasWhere){o=h;break}if(f.priority<g){o=h;break}else if(f.priority===g){if(f.order>=w){o=h;break}}else o=h+1}}o===void 0&&(o=p+1)}if(this.rules.splice(o,0,i),this.ruleBy[B]=i,this.style){let h=this.style.sheet,f=0,l=r=>{let e=this.rules[r];if(e){if(!e.natives.length)return l(r-1);let t=e.natives[e.natives.length-1].cssRule;for(let n=0;n<h.cssRules.length;n++)if(h.cssRules[n]===t){f=n+1;break}}};l(o-1);for(let r=0;r<i.natives.length;)try{let e=i.natives[r];h.insertRule(e.text,f),e.cssRule=h.cssRules[f++],r++}catch(e){console.error(e),i.natives.splice(r,1)}}i.config.insert?.call(i)}}get text(){return this.rules.map(s=>s.text).join("")}},O=k;T(O,"root"),T(O,"config",N.config),T(O,"instances",[]),T(O,"refresh",s=>{for(let i of k.instances)i.refresh(s)});W&&(window.MasterCSS=O);0&&(module.exports={MasterCSS});
@@ -1 +1 @@
1
- var e=require("./css"),a=require("./theme");new e.MasterCSS(window.masterCSSConfig);new a.Theme(window.masterCSSThemeSettings);
1
+ var o=require("./core");new o.MasterCSS(window.masterCSSConfig);
package/dist/cjs/index.js CHANGED
@@ -1 +1 @@
1
- var c=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var B=(o,t)=>{for(var n in t)c(o,n,{get:t[n],enumerable:!0})},l=(o,t,n,f)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of d(t))!E.call(o,u)&&u!==n&&c(o,u,{get:()=>t[u],enumerable:!(f=A(t,u))||f.enumerable});return o},r=(o,t,n)=>(l(o,t,"default"),n&&l(n,t,"default"));var b=o=>l(c({},"__esModule",{value:!0}),o);var e={};B(e,{default:()=>m.MasterCSS,extend:()=>a});module.exports=b(e);r(e,require("./css"),module.exports);r(e,require("./rule"),module.exports);r(e,require("./theme"),module.exports);r(e,require("./constants"),module.exports);var m=require("./css");function p(o){let t=typeof Buffer<"u"?Buffer:null;return!!(t&&o instanceof t||o instanceof Date||o instanceof RegExp)}function y(o){if(typeof Buffer<"u"&&Buffer&&o instanceof Buffer){let t=Buffer.alloc(o.length);return o.copy(t),t}else{if(o instanceof Date)return new Date(o.getTime());if(o instanceof RegExp)return new RegExp(o);throw new Error("Unexpected situation")}}function x(o){let t=[];return o.forEach(function(n,f){typeof n=="object"&&n!==null?Array.isArray(n)?t[f]=x(n):p(n)?t[f]=y(n):t[f]=a({},n):t[f]=n}),t}function s(o,t){return t==="__proto__"?void 0:o[t]}function a(...o){let t={},n,f;return o.forEach(function(u){typeof u!="object"||u===null||Array.isArray(u)||Object.keys(u).forEach(function(i){if(f=s(t,i),n=s(u,i),n!==t)if(typeof n!="object"||n===null){t[i]=n;return}else if(Array.isArray(n)){t[i]=x(n);return}else if(p(n)){t[i]=y(n);return}else if(typeof f!="object"||f===null||Array.isArray(f)){t[i]=a({},n);return}else{t[i]=a(f,n);return}})}),t}r(e,require("./methods"),module.exports);r(e,require("./config"),module.exports);0&&(module.exports={extend,...require("./css"),...require("./rule"),...require("./theme"),...require("./constants"),...require("./methods"),...require("./config")});
1
+ var c=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var B=(f,t)=>{for(var n in t)c(f,n,{get:t[n],enumerable:!0})},l=(f,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of d(t))!E.call(f,u)&&u!==n&&c(f,u,{get:()=>t[u],enumerable:!(o=A(t,u))||o.enumerable});return f},r=(f,t,n)=>(l(f,t,"default"),n&&l(n,t,"default"));var b=f=>l(c({},"__esModule",{value:!0}),f);var e={};B(e,{default:()=>m.MasterCSS,extend:()=>a});module.exports=b(e);r(e,require("./core"),module.exports);r(e,require("./rule"),module.exports);r(e,require("./constants"),module.exports);var m=require("./core");function p(f){let t=typeof Buffer<"u"?Buffer:null;return!!(t&&f instanceof t||f instanceof Date||f instanceof RegExp)}function y(f){if(typeof Buffer<"u"&&Buffer&&f instanceof Buffer){let t=Buffer.alloc(f.length);return f.copy(t),t}else{if(f instanceof Date)return new Date(f.getTime());if(f instanceof RegExp)return new RegExp(f);throw new Error("Unexpected situation")}}function x(f){let t=[];return f.forEach(function(n,o){typeof n=="object"&&n!==null?Array.isArray(n)?t[o]=x(n):p(n)?t[o]=y(n):t[o]=a({},n):t[o]=n}),t}function s(f,t){return t==="__proto__"?void 0:f[t]}function a(...f){let t={},n,o;return f.forEach(function(u){typeof u!="object"||u===null||Array.isArray(u)||Object.keys(u).forEach(function(i){if(o=s(t,i),n=s(u,i),n!==t)if(typeof n!="object"||n===null){t[i]=n;return}else if(Array.isArray(n)){t[i]=x(n);return}else if(p(n)){t[i]=y(n);return}else if(typeof o!="object"||o===null||Array.isArray(o)){t[i]=a({},n);return}else{t[i]=a(o,n);return}})}),t}r(e,require("./methods"),module.exports);r(e,require("./config"),module.exports);0&&(module.exports={extend,...require("./core"),...require("./rule"),...require("./constants"),...require("./methods"),...require("./config")});
@@ -1 +1 @@
1
- var s=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var g=(t,r)=>{for(var e in r)s(t,e,{get:r[e],enumerable:!0})},u=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of a(r))!m.call(t,o)&&o!==e&&s(t,o,{get:()=>r[o],enumerable:!(n=c(r,o))||n.enumerable});return t};var p=t=>u(s({},"__esModule",{value:!0}),t);var l={};g(l,{renderFromHTML:()=>C});module.exports=p(l);var i=require("../css"),f=require("./extract-classes-from-html");function C(t,r){if(!t)return;let e=(0,f.extractClassesFromHTML)(t);if(!e.length)return;let n=new i.MasterCSS({...r,observe:!1});for(let o of e)o in n.countBy||n.insert(o)&&(n.countBy[o]=1);return n.text}0&&(module.exports={renderFromHTML});
1
+ var s=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var g=(t,r)=>{for(var e in r)s(t,e,{get:r[e],enumerable:!0})},u=(t,r,e,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of a(r))!m.call(t,o)&&o!==e&&s(t,o,{get:()=>r[o],enumerable:!(n=c(r,o))||n.enumerable});return t};var p=t=>u(s({},"__esModule",{value:!0}),t);var l={};g(l,{renderFromHTML:()=>C});module.exports=p(l);var i=require("../core"),f=require("./extract-classes-from-html");function C(t,r){if(!t)return;let e=(0,f.extractClassesFromHTML)(t);if(!e.length)return;let n=new i.MasterCSS({...r,observe:!1});for(let o of e)o in n.countBy||n.insert(o)&&(n.countBy[o]=1);return n.text}0&&(module.exports={renderFromHTML});
@@ -1 +1 @@
1
- var f=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var l=(r,e)=>{for(var o in e)f(r,o,{get:e[o],enumerable:!0})},m=(r,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of u(e))!c.call(r,t)&&t!==o&&f(r,t,{get:()=>e[t],enumerable:!(n=s(e,t))||n.enumerable});return r};var p=r=>m(f({},"__esModule",{value:!0}),r);var a={};l(a,{renderRules:()=>g});module.exports=p(a);var i=require("../css");function g(r,e){if(!r?.length)return;let o=new i.MasterCSS({...e,observe:!1});for(let n of r)n in o.countBy||o.insert(n)&&(o.countBy[n]=1);return o.rules}0&&(module.exports={renderRules});
1
+ var f=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var l=(r,e)=>{for(var o in e)f(r,o,{get:e[o],enumerable:!0})},m=(r,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of u(e))!c.call(r,t)&&t!==o&&f(r,t,{get:()=>e[t],enumerable:!(n=s(e,t))||n.enumerable});return r};var p=r=>m(f({},"__esModule",{value:!0}),r);var a={};l(a,{renderRules:()=>g});module.exports=p(a);var i=require("../core");function g(r,e){if(!r?.length)return;let o=new i.MasterCSS({...e,observe:!1});for(let n of r)n in o.countBy||o.insert(n)&&(o.countBy[n]=1);return o.rules}0&&(module.exports={renderRules});
@@ -1 +1 @@
1
- var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var m=(t,n)=>{for(var r in n)i(t,r,{get:n[r],enumerable:!0})},u=(t,n,r,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of c(n))!g.call(t,e)&&e!==r&&i(t,e,{get:()=>n[e],enumerable:!(o=s(n,e))||o.enumerable});return t};var a=t=>u(i({},"__esModule",{value:!0}),t);var C={};m(C,{render:()=>p});module.exports=a(C);var f=require("../css");function p(t,n){if(!t?.length)return;let r=new f.MasterCSS({...n,observe:!1});for(let o of t)o in r.countBy||r.insert(o)&&(r.countBy[o]=1);return r.text}0&&(module.exports={render});
1
+ var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var m=(t,n)=>{for(var r in n)i(t,r,{get:n[r],enumerable:!0})},u=(t,n,r,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of c(n))!g.call(t,e)&&e!==r&&i(t,e,{get:()=>n[e],enumerable:!(o=s(n,e))||o.enumerable});return t};var a=t=>u(i({},"__esModule",{value:!0}),t);var C={};m(C,{render:()=>p});module.exports=a(C);var f=require("../core");function p(t,n){if(!t?.length)return;let r=new f.MasterCSS({...n,observe:!1});for(let o of t)o in r.countBy||r.insert(o)&&(r.countBy[o]=1);return r.text}0&&(module.exports={render});
@@ -76,3 +76,8 @@ export declare class MasterCSS {
76
76
  insertRules(rules: Rule[]): void;
77
77
  get text(): string;
78
78
  }
79
+ declare global {
80
+ interface Window {
81
+ MasterCSS: typeof MasterCSS;
82
+ }
83
+ }
@@ -1 +1 @@
1
- import{START_SYMBOLS as b}from"../constants/start-symbol.mjs";import{cssEscape as x}from"../utils/css-escape.mjs";var y={group:{match:"^(?:.+?[*_>~+])?\\{.+?\\}",analyze(e){let t=0;for(;t<e.length&&!(e[t]==="{"&&e[t-1]!=="\\");t++);return[e.slice(t),e.slice(0,t)]},declare(e){let t={},i=(r,o)=>{let a=o.indexOf(":");if(a!==-1){r in t||(t[r]={});let s=t[r],h=o.slice(0,a);h in s||(s[h]=o.slice(a+1))}},u=r=>{let o=(a,s)=>{let h=s.slice(x(r.className).length).match(/\{(.*)\}/)[1].split(";");for(let p of h)i(a,p)};if(this.theme){let a=r.natives.find(s=>s.theme===this.theme)??r.natives.find(s=>!s.theme);a&&o(this.theme,a.text)}else for(let a of r.natives)o(a.theme,a.text);if(r.keyframeNames){this.keyframeNames||(this.keyframeNames=[]);for(let a of r.keyframeNames)this.keyframeNames.includes(a)||this.keyframeNames.push(a)}},d=[],n="",c=()=>{n&&(d.push(n.replace(/ /g,"|")),n="")},m=1;(function r(o){for(;m<e.length;m++){let a=e[m];if(!o){if(a===";"){c();continue}if(a==="}")break}if(n+=a,o===a){if(o==="'"||o==='"'){let s=0;for(let h=n.length-2;n[h]==="\\";h--)s++;if(s%2)continue}break}else a in b&&o!=="'"&&o!=='"'&&(m++,r(b[a]))}})(void 0),c();for(let r of d){let o=this.css.create(r);if(Array.isArray(o))for(let a of o)u(a);else o?u(o):i(this.theme??"",r)}let l={};for(let r in t)for(let[o,a]of Object.entries(t[r]))o in l?l[o][r]=a:l[o]={[r]:a};return l},delete(){return g.call(this)},insert(){return v.call(this)}},variable:{match:"^\\$[^ (){}A-Z]+:[^ ]",declare(e){return{["--"+this.prefix.slice(1,-1)]:e}}},fontSize:{match:"^f(?:ont)?:(?:[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},fontWeight:{match:"^f(?:ont)?:(?:bolder|$values)(?!\\|)",native:!0,values:{thin:100,extralight:200,light:300,regular:400,medium:500,semibold:600,bold:700,extrabold:800,heavy:900}},fontFamily:{match:"^f(?:ont)?:(?:$values)(?!\\|)",native:!0,values:{mono:"ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace",sans:"ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji",serif:"ui-serif,Georgia,Cambria,Times New Roman,Times,serif"}},fontSmoothing:{match:"^f(?:ont)?:(?:antialiased|subpixel-antialiased|$values)(?!\\|)",declare(e){switch(e){case"subpixel-antialiased":return{"-webkit-font-smoothing":"auto","-moz-osx-font-smoothing":"auto"};case"antialiased":return{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale"}}}},fontStyle:{match:"^f(?:ont)?:(?:normal|italic|oblique|$values)(?!\\|)",native:!0,unit:"deg"},fontVariantNumeric:{match:"^f(?:ont)?:(?:ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|$values)(?!\\|)",native:!0},fontFeatureSettings:{match:"^font-feature:.",native:!0},font:{match:"^f:.",native:!0,order:-1},color:{match:"^(?:color|fg|foreground):.",native:!0,colored:!0,values:{current:"currentColor"}},marginLeft:{match:"^ml:.",native:!0,unit:"rem"},marginRight:{match:"^mr:.",native:!0,unit:"rem"},marginTop:{match:"^mt:.",native:!0,unit:"rem"},marginBottom:{match:"^mb:.",native:!0,unit:"rem"},marginX:{match:"^(?:mx|margin-x):.",unit:"rem",order:-.5,declare(e,t){return{"margin-left":e+t,"margin-right":e+t}}},marginY:{match:"^(?:my|margin-y):.",unit:"rem",order:-.5,declare(e,t){return{"margin-top":e+t,"margin-bottom":e+t}}},margin:{match:"^m:.",native:!0,unit:"rem",order:-1},paddingLeft:{match:"^pl:.",native:!0,unit:"rem"},paddingRight:{match:"^pr:.",native:!0,unit:"rem"},paddingTop:{match:"^pt:.",native:!0,unit:"rem"},paddingBottom:{match:"^pb:.",native:!0,unit:"rem"},paddingX:{match:"^(?:px|padding-x):.",unit:"rem",order:-.5,declare(e,t){return{"padding-left":e+t,"padding-right":e+t}}},paddingY:{match:"^(?:py|padding-y):.",unit:"rem",order:-.5,declare(e,t){return{"padding-top":e+t,"padding-bottom":e+t}}},padding:{match:"^p:.",native:!0,unit:"rem",order:-1},flexBasis:{values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560},unit:"rem",native:!0},flexWrap:{match:"^flex:(?:wrap(?:-reverse)?|nowrap|$values)(?!\\|)",native:!0},flexGrow:{native:!0},flexShrink:{native:!0},flexDirection:{match:"^flex:(?:(?:row|column)(?:-reverse)?|$values)(?!\\|)",native:!0,values:{col:"column","col-reverse":"column-reverse"}},flex:{native:!0,order:-1},display:{match:"^d:.",native:!0},width:{match:"^w:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},height:{match:"^h:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},minWidth:{match:"^min-w:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},minHeight:{match:"^min-h:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},box:{match:"^(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e]},declare(e){let[t,i]=e.split(" x ");return{width:t,height:i}}},minBox:{match:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e.slice(4)]},declare(e){let[t,i]=e.split(" x ");return{"min-width":t,"min-height":i}}},maxBox:{match:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e.slice(4)]},declare(e){let[t,i]=e.split(" x ");return{"max-width":t,"max-height":i}}},contain:{native:!0},content:{native:!0},counterIncrement:{native:!0},counterReset:{native:!0},letterSpacing:{match:"^ls:.",native:!0,unit:"em"},lineHeight:{match:"^lh:.",native:!0},objectFit:{match:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)",native:!0},objectPosition:{match:"^(?:object|obj):(?:top|bottom|right|left|center|$values)",native:!0},textAlign:{match:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)",native:!0},textDecorationColor:{match:"^text-decoration:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},textDecorationStyle:{match:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)",native:!0},textDecorationThickness:{match:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",native:!0,unit:"em"},textDecorationLine:{match:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)",native:!0},textDecoration:{match:"^t(?:ext)?:(?:underline|line-through|overline)",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"},order:-1},textUnderlineOffset:{unit:"rem",native:!0},textOverflow:{match:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))",native:!0},textOrientation:{match:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)",native:!0},textTransform:{match:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)",native:!0},textRendering:{match:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)",native:!0},textIndent:{unit:"rem",native:!0},verticalAlign:{match:"^(?:v|vertical):.",native:!0},columns:{match:"^(?:columns|cols):.",native:!0,order:-1},whiteSpace:{native:!0},top:{native:!0,unit:"rem"},bottom:{native:!0,unit:"rem"},left:{native:!0,unit:"rem"},right:{native:!0,unit:"rem"},inset:{native:!0,unit:"rem",order:-1},lines:{match:"^lines:.",declare(e,t){return{overflow:"hidden",display:"-webkit-box","overflow-wrap":"break-word","text-overflow":"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":e+t}}},maxHeight:{match:"^max-h:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},maxWidth:{match:"^max-w:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},boxSizing:{match:"^box:(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box"}},opacity:{native:!0},visibility:{native:!0},clear:{native:!0},float:{native:!0},isolation:{native:!0},overflowX:{native:!0,declare(e,t){return e==="overlay"?{"overflow-x":["auto",e]}:{"overflow-x":e}}},overflowY:{native:!0,declare(e,t){return e==="overlay"?{"overflow-y":["auto",e]}:{"overflow-y":e}}},overflow:{native:!0,order:-1,declare(e,t){return e==="overlay"?{overflow:["auto",e]}:{overflow:e}}},overscrollBehaviorX:{native:!0},overscrollBehaviorY:{native:!0},overscrollBehavior:{native:!0,order:-1},zIndex:{match:"^z:.",native:!0},position:{native:!0,values:{abs:"absolute",rel:"relative"}},cursor:{native:!0},pointerEvents:{native:!0},resize:{native:!0},touchAction:{native:!0},wordBreak:{native:!0},wordSpacing:{native:!0,unit:"em"},userDrag:{declare(e,t){return{"user-drag":e+t,"-webkit-user-drag":e+t}}},userSelect:{native:!0,declare(e,t){return{"user-select":e+t,"-webkit-user-select":e+t}}},textShadow:{unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},textSize:{match:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",declare(e,t){return{"font-size":e+t,"line-height":t==="em"?e+.875+t:`calc(${e}${t} + ${.875}em)`}}},textFillColor:{native:!0,match:"^(?:text-fill|text|t):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-fill-color":e+t}}},textStrokeWidth:{match:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",unit:"rem",declare(e,t){return{"-webkit-text-stroke-width":e+t}}},textStrokeColor:{match:"^text-stroke:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-stroke-color":e+t}}},textStroke:{unit:"rem",native:!0,declare(e,t){return{"-webkit-text-stroke":e+t}}},boxShadow:{match:"^s(?:hadow)?:.",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},tableLayout:{native:!0},transformBox:{match:"^transform:(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},transformStyle:{match:"^transform:(?:flat|preserve-3d|$values)(?!\\|)",native:!0},transformOrigin:{match:"^transform:(?:top|bottom|right|left|center|[0-9]|$values)",native:!0,unit:"px"},transform:{match:"^(?:translate|scale|skew|rotate|perspective|matrix)(?:3d|[XYZ])?\\(",native:!0},transitionProperty:{match:"^~property:.",native:!0},transitionTimingFunction:{match:"^~easing:.",native:!0},transitionDuration:{match:"^~duration:.",native:!0,unit:"ms"},transitionDelay:{match:"^~delay:.",native:!0,unit:"ms"},transition:{symbol:"~",native:!0,order:-1},animationDelay:{match:"^@delay:.",native:!0,unit:"ms"},animationDirection:{match:"^@direction:.",native:!0},animationDuration:{match:"^@duration:.",native:!0,unit:"ms"},animationFillMode:{match:"^@fill-mode:.",native:!0},animationIterationCount:{match:"^@iteration-count:.",native:!0},animationName:{match:"^@name:.",native:!0,create(e){return f.call(this,e)},delete(){return g.call(this)},insert(){return v.call(this)}},animationPlayState:{match:"^@play-state:.",native:!0},animationTimingFunction:{match:"^@easing:.",native:!0},animation:{symbol:"@",native:!0,order:-1,create(e){return f.call(this,e)},delete(){return g.call(this)},insert(){return v.call(this)}},borderCollapse:{match:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)",native:!0},borderSpacing:{unit:"rem",native:!0},borderTopColor:{match:"^b(?:t|order-top(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderBottomColor:{match:"^b(?:b|order-bottom(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderLeftColor:{match:"^b(?:l|order-left(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderRightColor:{match:"^b(?:r|order-right(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderXColor:{match:"^b(?:x|order-x(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",order:-.5,colored:!0,values:{current:"currentColor"},declare(e,t){return{"border-left-color":e+t,"border-right-color":e+t}}},borderYColor:{match:"^b(?:y|order-y(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",order:-.5,colored:!0,values:{current:"currentColor"},declare(e,t){return{"border-top-color":e+t,"border-bottom-color":e+t}}},borderColor:{match:"^b(?:order)?(?:-color)?:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,order:-1,colored:!0,values:{current:"currentColor"}},borderTopLeftRadius:{match:"^r(?:tl|lt):.",unit:"rem",native:!0},borderTopRightRadius:{match:"^r(?:tr|rt):.",unit:"rem",native:!0},borderBottomLeftRadius:{match:"^r(?:bl|lb):.",unit:"rem",native:!0},borderBottomRightRadius:{match:"^r(?:br|rb):.",unit:"rem",native:!0},borderTopRadius:{match:"^rt:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-left-radius":e+t,"border-top-right-radius":e+t}}},borderBottomRadius:{match:"^rb:.",unit:"rem",order:-.5,declare(e,t){return{"border-bottom-left-radius":e+t,"border-bottom-right-radius":e+t}}},borderLeftRadius:{match:"^rl:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-left-radius":e+t,"border-bottom-left-radius":e+t}}},borderRightRadius:{match:"^rr:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-right-radius":e+t,"border-bottom-right-radius":e+t}}},borderRadius:{match:"^r:.",unit:"rem",native:!0,order:-1},borderTopStyle:{match:"^b(?:t|order-top(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderBottomStyle:{match:"^b(?:b|order-bottom(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderLeftStyle:{match:"^b(?:l|order-left(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderRightStyle:{match:"^b(?:r|order-right(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderXStyle:{match:"^b(?:x|order-x(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",order:-.5,declare(e,t){return{"border-left-style":e+t,"border-right-style":e+t}}},borderYStyle:{match:"^b(?:y|order-y(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",order:-.5,declare(e,t){return{"border-top-style":e+t,"border-bottom-style":e+t}}},borderStyle:{match:"^b(?:order)?(?:-style)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0,order:-1},borderTopWidth:{match:"^b(?:t|order-top(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderBottomWidth:{match:"^b(?:b|order-bottom(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderLeftWidth:{match:"^b(?:l|order-left(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderRightWidth:{match:"^b(?:r|order-right(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderXWidth:{match:"^b(?:x|order-x(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",order:-.5,declare(e,t){return{"border-left-width":e+t,"border-right-width":e+t}}},borderYWidth:{match:"^b(?:y|order-y(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",order:-.5,declare(e,t){return{"border-top-width":e+t,"border-bottom-width":e+t}}},borderWidth:{match:"^b(?:order)?(?:-width)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0,order:-1},borderImageOutset:{unit:"rem",native:!0},borderImageRepeat:{match:"^border-image:(?:stretch|repeat|round|space|$values)(?!\\|)",native:!0},borderImageSlice:{native:!0},borderImageSource:{match:"^border-image:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0},borderImageWidth:{match:"^border-image:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderImage:{native:!0,order:-1},borderTop:{match:"^bt:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderBottom:{match:"^bb:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderLeft:{match:"^bl:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderRight:{match:"^br:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderX:{match:"^(?:bx|border-x):.",unit:"rem",colored:!0,order:-.5,values:{current:"currentColor"},declare(e){return{"border-left":e,"border-right":e}}},borderY:{match:"^(?:by|border-y):.",unit:"rem",colored:!0,order:-.5,values:{current:"currentColor"},declare(e){return{"border-top":e,"border-bottom":e}}},border:{match:"^b:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"},order:-2},backgroundAttachment:{match:"^(?:bg|background):(?:fixed|local|scroll|$values)(?!\\|)",native:!0},backgroundBlendMode:{native:!0},backgroundColor:{match:"^(?:bg|background):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},backgroundClip:{match:"^(?:bg|background):(?:text|$values)(?!\\|)",native:!0,declare(e,t){return{"-webkit-background-clip":e+t,"background-clip":e+t}},values:{content:"content-box",border:"border-box",padding:"padding-box"}},backgroundOrigin:{match:"^(?:bg|background):(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box"}},backgroundPosition:{match:"^(?:bg|background):(?:top|bottom|right|left|center|$values)(?!\\|)",native:!0,unit:"px"},backgroundRepeat:{match:"^(?:bg|background):(?:space|round|repeat|no-repeat|repeat-x|repeat-y|$values)(?![|a-zA-Z])",native:!0},backgroundSize:{match:"^(?:bg|background):(?:\\.?\\[0-9]+|auto|cover|contain|$values)(?!\\|)",unit:"rem",native:!0},backgroundImage:{match:"^(?:(?:bg|background):(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)|gradient\\(.*\\))(?!\\|)",native:!0,colored:!0,values:{current:"currentColor"},analyze(e){if(e.startsWith("gradient"))return["linear-"+e];let t=e.indexOf(":");return this.prefix=e.slice(0,t+1),[e.slice(t+1)]}},background:{match:"^bg:.",native:!0,colored:!0,values:{current:"currentColor"},order:-1},mixBlendMode:{match:"^blend:.",native:!0},backdropFilter:{match:"^bd:.",native:!0,colored:!0,values:{current:"currentColor"},declare(e,t){return{"backdrop-filter":e+t,"-webkit-backdrop-filter":e+t}}},filter:{match:"^(?:blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(",native:!0,colored:!0,values:{current:"currentColor"}},fill:{match:"^fill:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},strokeDasharray:{native:!0},strokeDashoffset:{native:!0},strokeWidth:{match:"^stroke:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",native:!0},stroke:{native:!0,colored:!0,values:{current:"currentColor"}},x:{native:!0},y:{native:!0},cx:{native:!0},cy:{native:!0},rx:{native:!0},ry:{native:!0},gridColumnStart:{match:"^grid-col-start:.",native:!0},gridColumnEnd:{match:"^grid-col-end:.",native:!0},gridColumn:{match:"^grid-col(?:umn)?(?:-span)?:.",native:!0,order:-1,transform(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridColumns:{match:"^grid-cols:.",declare(e,t){return{display:"grid","grid-template-columns":"repeat("+e+t+",minmax(0,1fr))"}}},gridRowStart:{native:!0},gridRowEnd:{native:!0},gridRow:{match:"^grid-row-span:.",native:!0,order:-1,transform(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridRows:{match:"^grid-rows:.",declare(e,t){return{display:"grid","grid-auto-flow":"column","grid-template-rows":"repeat("+e+t+",minmax(0,1fr))"}}},gridAutoColumns:{match:"^grid-auto-cols:.",native:!0,values:{min:"min-content",max:"max-content"}},gridAutoFlow:{match:"^grid-flow:.",native:!0},gridAutoRows:{values:{min:"min-content",max:"max-content"},native:!0},gridTemplateAreas:{native:!0},gridTemplateColumns:{match:"^grid-template-cols:.",native:!0,unit:"rem",values:{min:"min-content",max:"max-content"}},gridTemplateRows:{native:!0,unit:"rem",values:{min:"min-content",max:"max-content"}},gridTemplate:{native:!0,order:-1},gridArea:{native:!0,order:-1},grid:{native:!0,order:-1},columnGap:{match:"^gap-x:.",unit:"rem",native:!0},rowGap:{match:"^gap-y:.",unit:"rem",native:!0},gap:{unit:"rem",native:!0,order:-1},order:{match:"^o:.",native:!0,values:{first:-999999,last:999999}},breakInside:{native:!0},breakBefore:{native:!0},breakAfter:{native:!0},boxDecorationBreak:{match:"^box:(?:slice|clone|$values)(?!\\|)",native:!0,declare(e,t){return{"box-decoration-break":e+t,"-webkit-box-decoration-break":e+t}}},aspectRatio:{match:"^aspect:.",native:!0},columnSpan:{match:"^col-span:.",native:!0},alignContent:{match:"^ac:.",native:!0},alignItems:{match:"^ai:.",native:!0},alignSelf:{match:"^as:",native:!0},justifyContent:{match:"^jc:.",native:!0},justifyItems:{match:"^ji:.",native:!0},justifySelf:{match:"^js:.",native:!0},placeContent:{native:!0,order:-1},placeItems:{native:!0,order:-1},placeSelf:{native:!0,order:-1},listStylePosition:{match:"^list-style:(?:inside|outside|$values)(?!\\|)",native:!0},listStyleType:{match:"^list-style:(?:disc|decimal|$values)(?!\\|)",native:!0},listStyleImage:{match:"^list-style:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0},listStyle:{native:!0,order:-1},outlineColor:{match:"^outline:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},outlineOffset:{unit:"rem",native:!0},outlineStyle:{match:"^outline:(?:none|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},outlineWidth:{match:"^outline:(?:\\.?[0-9]|medium|thick|thin|(max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},outline:{native:!0,unit:"rem",order:-1,colored:!0,values:{current:"currentColor"}},accentColor:{match:"^accent:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},appearance:{native:!0},caretColor:{match:"^caret:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},scrollBehavior:{native:!0},scrollMarginLeft:{match:"^sml:.",native:!0,unit:"rem"},scrollMarginRight:{match:"^smr:.",native:!0,unit:"rem"},scrollMarginTop:{match:"^smt:.",native:!0,unit:"rem"},scrollMarginBottom:{match:"^smb:.",native:!0,unit:"rem"},scrollMarginX:{match:"^(?:smx|scroll-margin-x):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-margin-left":e+t,"scroll-margin-right":e+t}}},scrollMarginY:{match:"^(?:smy|scroll-margin-y):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-margin-top":e+t,"scroll-margin-bottom":e+t}}},scrollMargin:{match:"^sm:.",native:!0,unit:"rem",order:-1},scrollPaddingLeft:{match:"^spl:.",native:!0,unit:"rem"},scrollPaddingRight:{match:"^spr:.",native:!0,unit:"rem"},scrollPaddingTop:{match:"^spt:.",native:!0,unit:"rem"},scrollPaddingBottom:{match:"^spb:.",native:!0,unit:"rem"},scrollPaddingX:{match:"^(?:spx|scroll-padding-x):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-padding-left":e+t,"scroll-padding-right":e+t}}},scrollPaddingY:{match:"^(?:spy|scroll-padding-y):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-padding-top":e+t,"scroll-padding-bottom":e+t}}},scrollPadding:{match:"^sp:.",native:!0,unit:"rem",order:-1},scrollSnapAlign:{match:"^scroll-snap:(?:start|end|center|$values)",native:!0},scrollSnapStop:{match:"^scroll-snap:(?:normal|always|$values)(?!\\|)",native:!0},scrollSnapType:{match:"^scroll-snap:(?:(?:[xy]|block|inline|both)(?:\\|(?:proximity|mandatory))?|$values)(?!\\|)",native:!0},willChange:{native:!0},writingMode:{match:"^writing:.",native:!0},direction:{native:!0},shapeOutside:{match:"^shape:(?:(?:inset|circle|ellipse|polygon|url|linear-gradient)\\(.*\\)|$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box",margin:"margin-box"}},shapeMargin:{match:"^shape:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},shapeImageThreshold:{native:!0},clipPath:{match:"^clip:.",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box",margin:"margin-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},quotes:{native:!0},maskImage:{native:!0,declare(e,t){return{"mask-image":e+t,"-webkit-mask-image":e+t}}}},C=y;function f(e){if(!this.css.config.keyframes)return;let t=(this.meta.origin==="symbol"?e.slice(this.meta.config.symbol.length):e.slice(e.indexOf(":")+1)).split("|").filter(i=>i in this.css.config.keyframes);t?.length&&(this.keyframeNames=t)}function g(){if(this.keyframeNames?.length){let e=this.css.rules[0];for(let t of this.keyframeNames){let i=this.css.keyframes[t];if(!--i.count){let u=e.natives.indexOf(i.native);this.css.style.sheet.deleteRule(u),e.natives.splice(u,1),delete this.css.keyframes[t]}}e.natives.length||this.css.rules.splice(0,1)}}function v(){if(this.keyframeNames){let{config:e,keyframes:t,style:i,rules:u}=this.css,d=i?.sheet;for(let n of this.keyframeNames)if(n in t)t[n].count++;else{let c={text:`@keyframes ${n}{`+Object.entries(e.keyframes[n]).map(([l,r])=>`${l}{${Object.entries(r).map(([o,a])=>o+":"+a).join(";")}}`).join("")+"}",theme:""},m;if(Object.keys(t).length?(m=u[0]).natives.push(c):u.splice(0,0,m={natives:[c],get text(){return this.natives.map(l=>l.text).join("")}}),d){let l;for(let r=0;r<d.cssRules.length;r++){let o=d.cssRules[r];if(o.constructor.name!=="CSSKeyframesRule")break;if(o.name===n){l=o;break}}if(l)c.cssRule=l;else{let r=m.natives.length-1;d.insertRule(c.text,r),c.cssRule=d.cssRules[r]}}t[n]={native:c,count:1}}}}export{C as rules};
1
+ import{START_SYMBOLS as b}from"../constants/start-symbol.mjs";import{cssEscape as x}from"../utils/css-escape.mjs";var y={group:{match:"^(?:.+?[*_>~+])?\\{.+?\\}",analyze(e){let t=0;for(;t<e.length&&!(e[t]==="{"&&e[t-1]!=="\\");t++);return[e.slice(t),e.slice(0,t)]},declare(e){let t={},i=(r,o)=>{let a=o.indexOf(":");if(a!==-1){r in t||(t[r]={});let s=t[r],h=o.slice(0,a);h in s||(s[h]=o.slice(a+1))}},u=r=>{let o=(a,s)=>{let h=s.slice(x(r.className).length).match(/\{(.*)\}/)[1].split(";");for(let p of h)i(a,p)};if(this.theme){let a=r.natives.find(s=>s.theme===this.theme)??r.natives.find(s=>!s.theme);a&&o(this.theme,a.text)}else for(let a of r.natives)o(a.theme,a.text);if(r.keyframeNames){this.keyframeNames||(this.keyframeNames=[]);for(let a of r.keyframeNames)this.keyframeNames.includes(a)||this.keyframeNames.push(a)}},d=[],n="",c=()=>{n&&(d.push(n.replace(/ /g,"|")),n="")},m=1;(function r(o){for(;m<e.length;m++){let a=e[m];if(!o){if(a===";"){c();continue}if(a==="}")break}if(n+=a,o===a){if(o==="'"||o==='"'){let s=0;for(let h=n.length-2;n[h]==="\\";h--)s++;if(s%2)continue}break}else a in b&&o!=="'"&&o!=='"'&&(m++,r(b[a]))}})(void 0),c();for(let r of d){let o=this.css.create(r);if(Array.isArray(o))for(let a of o)u(a);else o?u(o):i(this.theme??"",r)}let l={};for(let r in t)for(let[o,a]of Object.entries(t[r]))o in l?l[o][r]=a:l[o]={[r]:a};return l},delete(){return g.call(this)},insert(){return v.call(this)}},variable:{match:"^\\$[^ (){}A-Z]+:[^ ]",declare(e){return{["--"+this.prefix.slice(1,-1)]:e}}},fontSize:{match:"^f(?:ont)?:(?:[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},fontWeight:{match:"^f(?:ont)?:(?:bolder|$values)(?!\\|)",native:!0,values:{thin:100,extralight:200,light:300,regular:400,medium:500,semibold:600,bold:700,extrabold:800,heavy:900}},fontFamily:{match:"^f(?:ont)?:(?:$values)(?!\\|)",native:!0,values:{mono:"ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace",sans:"ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji",serif:"ui-serif,Georgia,Cambria,Times New Roman,Times,serif"}},fontSmoothing:{match:"^f(?:ont)?:(?:antialiased|subpixel-antialiased|$values)(?!\\|)",declare(e){switch(e){case"subpixel-antialiased":return{"-webkit-font-smoothing":"auto","-moz-osx-font-smoothing":"auto"};case"antialiased":return{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale"}}}},fontStyle:{match:"^f(?:ont)?:(?:normal|italic|oblique|$values)(?!\\|)",native:!0,unit:"deg"},fontVariantNumeric:{match:"^f(?:ont)?:(?:ordinal|slashed-zero|lining-nums|oldstyle-nums|proportional-nums|tabular-nums|diagonal-fractions|stacked-fractions|$values)(?!\\|)",native:!0},fontFeatureSettings:{match:"^font-feature:.",native:!0},font:{match:"^f:.",native:!0,order:-1},color:{match:"^(?:color|fg|foreground):.",native:!0,colored:!0,values:{current:"currentColor"}},marginLeft:{match:"^ml:.",native:!0,unit:"rem"},marginRight:{match:"^mr:.",native:!0,unit:"rem"},marginTop:{match:"^mt:.",native:!0,unit:"rem"},marginBottom:{match:"^mb:.",native:!0,unit:"rem"},marginX:{match:"^(?:mx|margin-x):.",unit:"rem",order:-.5,declare(e,t){return{"margin-left":e+t,"margin-right":e+t}}},marginY:{match:"^(?:my|margin-y):.",unit:"rem",order:-.5,declare(e,t){return{"margin-top":e+t,"margin-bottom":e+t}}},margin:{match:"^m:.",native:!0,unit:"rem",order:-1},paddingLeft:{match:"^pl:.",native:!0,unit:"rem"},paddingRight:{match:"^pr:.",native:!0,unit:"rem"},paddingTop:{match:"^pt:.",native:!0,unit:"rem"},paddingBottom:{match:"^pb:.",native:!0,unit:"rem"},paddingX:{match:"^(?:px|padding-x):.",unit:"rem",order:-.5,declare(e,t){return{"padding-left":e+t,"padding-right":e+t}}},paddingY:{match:"^(?:py|padding-y):.",unit:"rem",order:-.5,declare(e,t){return{"padding-top":e+t,"padding-bottom":e+t}}},padding:{match:"^p:.",native:!0,unit:"rem",order:-1},flexBasis:{values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560},unit:"rem",native:!0},flexWrap:{match:"^flex:(?:wrap(?:-reverse)?|nowrap|$values)(?!\\|)",native:!0},flexGrow:{native:!0},flexShrink:{native:!0},flexDirection:{match:"^flex:(?:(?:row|column)(?:-reverse)?|$values)(?!\\|)",native:!0,values:{col:"column","col-reverse":"column-reverse"}},flex:{native:!0,order:-1},display:{match:"^d:.",native:!0},width:{match:"^w:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},height:{match:"^h:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},minWidth:{match:"^min-w:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},minHeight:{match:"^min-h:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},box:{match:"^(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e]},declare(e){let[t,i]=e.split(" x ");return{width:t,height:i}}},minBox:{match:"^min:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e.slice(4)]},declare(e){let[t,i]=e.split(" x ");return{"min-width":t,"min-height":i}}},maxBox:{match:"^max:(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)x(?:(?:max|min|clamp|calc)\\(.+\\)|[0-9]+[a-z]*?)",unit:"rem",separators:["x"],analyze(e){return[e.slice(4)]},declare(e){let[t,i]=e.split(" x ");return{"max-width":t,"max-height":i}}},contain:{native:!0},content:{native:!0},counterIncrement:{native:!0},counterReset:{native:!0},letterSpacing:{match:"^ls:.",native:!0,unit:"em"},lineHeight:{match:"^lh:.",native:!0},objectFit:{match:"^(?:object|obj):(?:contain|cover|fill|scale-down|$values)",native:!0},objectPosition:{match:"^(?:object|obj):(?:top|bottom|right|left|center|$values)",native:!0},textAlign:{match:"^t(?:ext)?:(?:justify|center|left|right|start|end|$values)(?!\\|)",native:!0},textDecorationColor:{match:"^text-decoration:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},textDecorationStyle:{match:"^t(?:ext)?:(?:solid|double|dotted|dashed|wavy|$values)(?!\\|)",native:!0},textDecorationThickness:{match:"^text-decoration:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|from-font|$values)[^|]*$",native:!0,unit:"em"},textDecorationLine:{match:"^t(?:ext)?:(?:none|underline|overline|line-through|$values)(?!\\|)",native:!0},textDecoration:{match:"^t(?:ext)?:(?:underline|line-through|overline)",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"},order:-1},textUnderlineOffset:{unit:"rem",native:!0},textOverflow:{match:"^(?:text-(?:overflow|ovf):.|t(?:ext)?:(?:ellipsis|clip|$values)(?!\\|))",native:!0},textOrientation:{match:"^t(?:ext)?:(?:mixed|upright|sideways-right|sideways|use-glyph-orientation|$values)(?!\\|)",native:!0},textTransform:{match:"^t(?:ext)?:(?:uppercase|lowercase|capitalize|$values)(?!\\|)",native:!0},textRendering:{match:"^t(?:ext)?:(?:optimizeSpeed|optimizeLegibility|geometricPrecision|$values)(?!\\|)",native:!0},textIndent:{unit:"rem",native:!0},verticalAlign:{match:"^(?:v|vertical):.",native:!0},columns:{match:"^(?:columns|cols):.",native:!0,order:-1},whiteSpace:{native:!0},top:{native:!0,unit:"rem"},bottom:{native:!0,unit:"rem"},left:{native:!0,unit:"rem"},right:{native:!0,unit:"rem"},inset:{native:!0,unit:"rem",order:-1},lines:{match:"^lines:.",declare(e,t){return{overflow:"hidden",display:"-webkit-box","overflow-wrap":"break-word","text-overflow":"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":e+t}}},maxHeight:{match:"^max-h:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},maxWidth:{match:"^max-w:.",unit:"rem",native:!0,values:{full:"100%",fit:"fit-content",max:"max-content",min:"min-content","3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560}},boxSizing:{match:"^box:(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box"}},opacity:{native:!0},visibility:{native:!0},clear:{native:!0},float:{native:!0},isolation:{native:!0},overflowX:{native:!0,declare(e,t){return e==="overlay"?{"overflow-x":["auto",e]}:{"overflow-x":e}}},overflowY:{native:!0,declare(e,t){return e==="overlay"?{"overflow-y":["auto",e]}:{"overflow-y":e}}},overflow:{native:!0,order:-1,declare(e,t){return e==="overlay"?{overflow:["auto",e]}:{overflow:e}}},overscrollBehaviorX:{native:!0},overscrollBehaviorY:{native:!0},overscrollBehavior:{native:!0,order:-1},zIndex:{match:"^z:.",native:!0},position:{native:!0,values:{abs:"absolute",rel:"relative"}},cursor:{native:!0},pointerEvents:{native:!0},resize:{native:!0},touchAction:{native:!0},wordBreak:{native:!0},wordSpacing:{native:!0,unit:"em"},userDrag:{native:!0,declare(e,t){return{"user-drag":e+t,"-webkit-user-drag":e+t}}},userSelect:{native:!0,declare(e,t){return{"user-select":e+t,"-webkit-user-select":e+t}}},textShadow:{unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},textSize:{match:"^t(?:ext)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",declare(e,t){return{"font-size":e+t,"line-height":t==="em"?e+.875+t:`calc(${e}${t} + ${.875}em)`}}},textFillColor:{native:!0,match:"^(?:text-fill|text|t):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-fill-color":e+t}}},textStrokeWidth:{match:"^text-stroke(:(thin|medium|thick|\\.?[0-9]+|$values)(?!\\|)|-width:.)",unit:"rem",declare(e,t){return{"-webkit-text-stroke-width":e+t}}},textStrokeColor:{match:"^text-stroke:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"},declare(e,t){return{"-webkit-text-stroke-color":e+t}}},textStroke:{unit:"rem",native:!0,declare(e,t){return{"-webkit-text-stroke":e+t}}},boxShadow:{match:"^s(?:hadow)?:.",unit:"rem",native:!0,colored:!0,values:{current:"currentColor"}},tableLayout:{native:!0},transformBox:{match:"^transform:(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},transformStyle:{match:"^transform:(?:flat|preserve-3d|$values)(?!\\|)",native:!0},transformOrigin:{match:"^transform:(?:top|bottom|right|left|center|[0-9]|$values)",native:!0,unit:"px"},transform:{match:"^(?:translate|scale|skew|rotate|perspective|matrix)(?:3d|[XYZ])?\\(",native:!0},transitionProperty:{match:"^~property:.",native:!0},transitionTimingFunction:{match:"^~easing:.",native:!0},transitionDuration:{match:"^~duration:.",native:!0,unit:"ms"},transitionDelay:{match:"^~delay:.",native:!0,unit:"ms"},transition:{symbol:"~",native:!0,order:-1},animationDelay:{match:"^@delay:.",native:!0,unit:"ms"},animationDirection:{match:"^@direction:.",native:!0},animationDuration:{match:"^@duration:.",native:!0,unit:"ms"},animationFillMode:{match:"^@fill-mode:.",native:!0},animationIterationCount:{match:"^@iteration-count:.",native:!0},animationName:{match:"^@name:.",native:!0,create(e){return f.call(this,e)},delete(){return g.call(this)},insert(){return v.call(this)}},animationPlayState:{match:"^@play-state:.",native:!0},animationTimingFunction:{match:"^@easing:.",native:!0},animation:{symbol:"@",native:!0,order:-1,create(e){return f.call(this,e)},delete(){return g.call(this)},insert(){return v.call(this)}},borderCollapse:{match:"^b(?:order)?:(?:collapse|separate|$values)(?!\\|)",native:!0},borderSpacing:{unit:"rem",native:!0},borderTopColor:{match:"^b(?:t|order-top(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderBottomColor:{match:"^b(?:b|order-bottom(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderLeftColor:{match:"^b(?:l|order-left(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderRightColor:{match:"^b(?:r|order-right(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},borderXColor:{match:"^b(?:x|order-x(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",order:-.5,colored:!0,values:{current:"currentColor"},declare(e,t){return{"border-left-color":e+t,"border-right-color":e+t}}},borderYColor:{match:"^b(?:y|order-y(?:-color)?):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",order:-.5,colored:!0,values:{current:"currentColor"},declare(e,t){return{"border-top-color":e+t,"border-bottom-color":e+t}}},borderColor:{match:"^b(?:order)?(?:-color)?:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,order:-1,colored:!0,values:{current:"currentColor"}},borderTopLeftRadius:{match:"^r(?:tl|lt):.",unit:"rem",native:!0},borderTopRightRadius:{match:"^r(?:tr|rt):.",unit:"rem",native:!0},borderBottomLeftRadius:{match:"^r(?:bl|lb):.",unit:"rem",native:!0},borderBottomRightRadius:{match:"^r(?:br|rb):.",unit:"rem",native:!0},borderTopRadius:{match:"^rt:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-left-radius":e+t,"border-top-right-radius":e+t}}},borderBottomRadius:{match:"^rb:.",unit:"rem",order:-.5,declare(e,t){return{"border-bottom-left-radius":e+t,"border-bottom-right-radius":e+t}}},borderLeftRadius:{match:"^rl:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-left-radius":e+t,"border-bottom-left-radius":e+t}}},borderRightRadius:{match:"^rr:.",unit:"rem",order:-.5,declare(e,t){return{"border-top-right-radius":e+t,"border-bottom-right-radius":e+t}}},borderRadius:{match:"^r:.",unit:"rem",native:!0,order:-1},borderTopStyle:{match:"^b(?:t|order-top(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderBottomStyle:{match:"^b(?:b|order-bottom(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderLeftStyle:{match:"^b(?:l|order-left(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderRightStyle:{match:"^b(?:r|order-right(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},borderXStyle:{match:"^b(?:x|order-x(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",order:-.5,declare(e,t){return{"border-left-style":e+t,"border-right-style":e+t}}},borderYStyle:{match:"^b(?:y|order-y(?:-style)?):(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",order:-.5,declare(e,t){return{"border-top-style":e+t,"border-bottom-style":e+t}}},borderStyle:{match:"^b(?:order)?(?:-style)?:(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0,order:-1},borderTopWidth:{match:"^b(?:t|order-top(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderBottomWidth:{match:"^b(?:b|order-bottom(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderLeftWidth:{match:"^b(?:l|order-left(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderRightWidth:{match:"^b(?:r|order-right(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderXWidth:{match:"^b(?:x|order-x(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",order:-.5,declare(e,t){return{"border-left-width":e+t,"border-right-width":e+t}}},borderYWidth:{match:"^b(?:y|order-y(?:-width)?):(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",order:-.5,declare(e,t){return{"border-top-width":e+t,"border-bottom-width":e+t}}},borderWidth:{match:"^b(?:order)?(?:-width)?:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0,order:-1},borderImageOutset:{unit:"rem",native:!0},borderImageRepeat:{match:"^border-image:(?:stretch|repeat|round|space|$values)(?!\\|)",native:!0},borderImageSlice:{native:!0},borderImageSource:{match:"^border-image:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0},borderImageWidth:{match:"^border-image:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},borderImage:{native:!0,order:-1},borderTop:{match:"^bt:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderBottom:{match:"^bb:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderLeft:{match:"^bl:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderRight:{match:"^br:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"}},borderX:{match:"^(?:bx|border-x):.",unit:"rem",colored:!0,order:-.5,values:{current:"currentColor"},declare(e){return{"border-left":e,"border-right":e}}},borderY:{match:"^(?:by|border-y):.",unit:"rem",colored:!0,order:-.5,values:{current:"currentColor"},declare(e){return{"border-top":e,"border-bottom":e}}},border:{match:"^b:.",native:!0,unit:"rem",colored:!0,values:{current:"currentColor"},order:-2},backgroundAttachment:{match:"^(?:bg|background):(?:fixed|local|scroll|$values)(?!\\|)",native:!0},backgroundBlendMode:{native:!0},backgroundColor:{match:"^(?:bg|background):(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},backgroundClip:{match:"^(?:bg|background):(?:text|$values)(?!\\|)",native:!0,declare(e,t){return{"-webkit-background-clip":e+t,"background-clip":e+t}},values:{content:"content-box",border:"border-box",padding:"padding-box"}},backgroundOrigin:{match:"^(?:bg|background):(?:$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box"}},backgroundPosition:{match:"^(?:bg|background):(?:top|bottom|right|left|center|$values)(?!\\|)",native:!0,unit:"px"},backgroundRepeat:{match:"^(?:bg|background):(?:space|round|repeat|no-repeat|repeat-x|repeat-y|$values)(?![|a-zA-Z])",native:!0},backgroundSize:{match:"^(?:bg|background):(?:\\.?\\[0-9]+|auto|cover|contain|$values)(?!\\|)",unit:"rem",native:!0},backgroundImage:{match:"^(?:(?:bg|background):(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)|gradient\\(.*\\))(?!\\|)",native:!0,colored:!0,values:{current:"currentColor"},analyze(e){if(e.startsWith("gradient"))return["linear-"+e];let t=e.indexOf(":");return this.prefix=e.slice(0,t+1),[e.slice(t+1)]}},background:{match:"^bg:.",native:!0,colored:!0,values:{current:"currentColor"},order:-1},mixBlendMode:{match:"^blend:.",native:!0},backdropFilter:{match:"^bd:.",native:!0,colored:!0,values:{current:"currentColor"},declare(e,t){return{"backdrop-filter":e+t,"-webkit-backdrop-filter":e+t}}},filter:{match:"^(?:blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\\(",native:!0,colored:!0,values:{current:"currentColor"}},fill:{match:"^fill:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},strokeDasharray:{native:!0},strokeDashoffset:{native:!0},strokeWidth:{match:"^stroke:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",native:!0},stroke:{native:!0,colored:!0,values:{current:"currentColor"}},x:{native:!0},y:{native:!0},cx:{native:!0},cy:{native:!0},rx:{native:!0},ry:{native:!0},gridColumnStart:{match:"^grid-col-start:.",native:!0},gridColumnEnd:{match:"^grid-col-end:.",native:!0},gridColumn:{match:"^grid-col(?:umn)?(?:-span)?:.",native:!0,order:-1,transform(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridColumns:{match:"^grid-cols:.",declare(e,t){return{display:"grid","grid-template-columns":"repeat("+e+t+",minmax(0,1fr))"}}},gridRowStart:{native:!0},gridRowEnd:{native:!0},gridRow:{match:"^grid-row-span:.",native:!0,order:-1,transform(e){return this.prefix.slice(-5,-1)==="span"&&e!=="auto"?"span "+e+"/span "+e:e}},gridRows:{match:"^grid-rows:.",declare(e,t){return{display:"grid","grid-auto-flow":"column","grid-template-rows":"repeat("+e+t+",minmax(0,1fr))"}}},gridAutoColumns:{match:"^grid-auto-cols:.",native:!0,values:{min:"min-content",max:"max-content"}},gridAutoFlow:{match:"^grid-flow:.",native:!0},gridAutoRows:{values:{min:"min-content",max:"max-content"},native:!0},gridTemplateAreas:{native:!0},gridTemplateColumns:{match:"^grid-template-cols:.",native:!0,unit:"rem",values:{min:"min-content",max:"max-content"}},gridTemplateRows:{native:!0,unit:"rem",values:{min:"min-content",max:"max-content"}},gridTemplate:{native:!0,order:-1},gridArea:{native:!0,order:-1},grid:{native:!0,order:-1},columnGap:{match:"^gap-x:.",unit:"rem",native:!0},rowGap:{match:"^gap-y:.",unit:"rem",native:!0},gap:{unit:"rem",native:!0,order:-1},order:{match:"^o:.",native:!0,values:{first:-999999,last:999999}},breakInside:{native:!0},breakBefore:{native:!0},breakAfter:{native:!0},boxDecorationBreak:{match:"^box:(?:slice|clone|$values)(?!\\|)",native:!0,declare(e,t){return{"box-decoration-break":e+t,"-webkit-box-decoration-break":e+t}}},aspectRatio:{match:"^aspect:.",native:!0},columnSpan:{match:"^col-span:.",native:!0},alignContent:{match:"^ac:.",native:!0},alignItems:{match:"^ai:.",native:!0},alignSelf:{match:"^as:",native:!0},justifyContent:{match:"^jc:.",native:!0},justifyItems:{match:"^ji:.",native:!0},justifySelf:{match:"^js:.",native:!0},placeContent:{native:!0,order:-1},placeItems:{native:!0,order:-1},placeSelf:{native:!0,order:-1},listStylePosition:{match:"^list-style:(?:inside|outside|$values)(?!\\|)",native:!0},listStyleType:{match:"^list-style:(?:disc|decimal|$values)(?!\\|)",native:!0},listStyleImage:{match:"^list-style:(?:(?:url|linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient|conic-gradient)\\(.*\\)|$values)(?!\\|)",native:!0},listStyle:{native:!0,order:-1},outlineColor:{match:"^outline:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},outlineOffset:{unit:"rem",native:!0},outlineStyle:{match:"^outline:(?:none|dotted|dashed|solid|double|groove|ridge|inset|outset|$values)(?!\\|)",native:!0},outlineWidth:{match:"^outline:(?:\\.?[0-9]|medium|thick|thin|(max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},outline:{native:!0,unit:"rem",order:-1,colored:!0,values:{current:"currentColor"}},accentColor:{match:"^accent:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},appearance:{native:!0},caretColor:{match:"^caret:(?:#|(?:rgb|hsl)\\(.*\\)|transparent|currentColor|inherit|$values|$colors)[^|]*$",native:!0,colored:!0,values:{current:"currentColor"}},scrollBehavior:{native:!0},scrollMarginLeft:{match:"^sml:.",native:!0,unit:"rem"},scrollMarginRight:{match:"^smr:.",native:!0,unit:"rem"},scrollMarginTop:{match:"^smt:.",native:!0,unit:"rem"},scrollMarginBottom:{match:"^smb:.",native:!0,unit:"rem"},scrollMarginX:{match:"^(?:smx|scroll-margin-x):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-margin-left":e+t,"scroll-margin-right":e+t}}},scrollMarginY:{match:"^(?:smy|scroll-margin-y):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-margin-top":e+t,"scroll-margin-bottom":e+t}}},scrollMargin:{match:"^sm:.",native:!0,unit:"rem",order:-1},scrollPaddingLeft:{match:"^spl:.",native:!0,unit:"rem"},scrollPaddingRight:{match:"^spr:.",native:!0,unit:"rem"},scrollPaddingTop:{match:"^spt:.",native:!0,unit:"rem"},scrollPaddingBottom:{match:"^spb:.",native:!0,unit:"rem"},scrollPaddingX:{match:"^(?:spx|scroll-padding-x):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-padding-left":e+t,"scroll-padding-right":e+t}}},scrollPaddingY:{match:"^(?:spy|scroll-padding-y):.",unit:"rem",order:-.5,declare(e,t){return{"scroll-padding-top":e+t,"scroll-padding-bottom":e+t}}},scrollPadding:{match:"^sp:.",native:!0,unit:"rem",order:-1},scrollSnapAlign:{match:"^scroll-snap:(?:start|end|center|$values)",native:!0},scrollSnapStop:{match:"^scroll-snap:(?:normal|always|$values)(?!\\|)",native:!0},scrollSnapType:{match:"^scroll-snap:(?:(?:[xy]|block|inline|both)(?:\\|(?:proximity|mandatory))?|$values)(?!\\|)",native:!0},willChange:{native:!0},writingMode:{match:"^writing:.",native:!0},direction:{native:!0},shapeOutside:{match:"^shape:(?:(?:inset|circle|ellipse|polygon|url|linear-gradient)\\(.*\\)|$values)(?!\\|)",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box",margin:"margin-box"}},shapeMargin:{match:"^shape:(?:\\.?[0-9]|(?:max|min|calc|clamp)\\(.*\\)|$values)[^|]*$",unit:"rem",native:!0},shapeImageThreshold:{native:!0},clipPath:{match:"^clip:.",native:!0,values:{content:"content-box",border:"border-box",padding:"padding-box",margin:"margin-box",fill:"fill-box",stroke:"stroke-box",view:"view-box"}},quotes:{native:!0},maskImage:{native:!0,declare(e,t){return{"mask-image":e+t,"-webkit-mask-image":e+t}}}},C=y;function f(e){if(!this.css.config.keyframes)return;let t=(this.meta.origin==="symbol"?e.slice(this.meta.config.symbol.length):e.slice(e.indexOf(":")+1)).split("|").filter(i=>i in this.css.config.keyframes);t?.length&&(this.keyframeNames=t)}function g(){if(this.keyframeNames?.length){let e=this.css.rules[0];for(let t of this.keyframeNames){let i=this.css.keyframes[t];if(!--i.count){let u=e.natives.indexOf(i.native);this.css.style.sheet.deleteRule(u),e.natives.splice(u,1),delete this.css.keyframes[t]}}e.natives.length||this.css.rules.splice(0,1)}}function v(){if(this.keyframeNames){let{config:e,keyframes:t,style:i,rules:u}=this.css,d=i?.sheet;for(let n of this.keyframeNames)if(n in t)t[n].count++;else{let c={text:`@keyframes ${n}{`+Object.entries(e.keyframes[n]).map(([l,r])=>`${l}{${Object.entries(r).map(([o,a])=>o+":"+a).join(";")}}`).join("")+"}",theme:""},m;if(Object.keys(t).length?(m=u[0]).natives.push(c):u.splice(0,0,m={natives:[c],get text(){return this.natives.map(l=>l.text).join("")}}),d){let l;for(let r=0;r<d.cssRules.length;r++){let o=d.cssRules[r];if(o.constructor.name!=="CSSKeyframesRule")break;if(o.name===n){l=o;break}}if(l)c.cssRule=l;else{let r=m.natives.length-1;d.insertRule(c.text,r),c.cssRule=d.cssRules[r]}}t[n]={native:c,count:1}}}}export{C as rules};
@@ -1 +1 @@
1
- var H=Object.defineProperty;var Q=(x,s,i)=>s in x?H(x,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):x[s]=i;var T=(x,s,i)=>(Q(x,typeof s!="symbol"?s+"":s,i),i);function I(x){let s=typeof Buffer<"u"?Buffer:null;return!!(s&&x instanceof s||x instanceof Date||x instanceof RegExp)}function $(x){if(typeof Buffer<"u"&&Buffer&&x instanceof Buffer){let s=Buffer.alloc(x.length);return x.copy(s),s}else{if(x instanceof Date)return new Date(x.getTime());if(x instanceof RegExp)return new RegExp(x);throw new Error("Unexpected situation")}}function F(x){let s=[];return x.forEach(function(i,o){typeof i=="object"&&i!==null?Array.isArray(i)?s[o]=F(i):I(i)?s[o]=$(i):s[o]=M({},i):s[o]=i}),s}function W(x,s){return s==="__proto__"?void 0:x[s]}function M(...x){let s={},i,o;return x.forEach(function(g){typeof g!="object"||g===null||Array.isArray(g)||Object.keys(g).forEach(function(b){if(o=W(s,b),i=W(g,b),i!==s)if(typeof i!="object"||i===null){s[b]=i;return}else if(Array.isArray(i)){s[b]=F(i);return}else if(I(i)){s[b]=$(i);return}else if(typeof o!="object"||o===null||Array.isArray(o)){s[b]=M({},i);return}else{s[b]=M(o,i);return}})}),s}import{Rule as z}from"./rule.mjs";import{config as N}from"./config/index.mjs";import{rgbToHex as _}from"./utils/rgb-to-hex.mjs";import{SELECTOR_SYMBOLS as Z}from"./constants/selector-symbols.mjs";var L=typeof window<"u",V=()=>{let x=document.createElement("style");return x.id="master",x},S=class{constructor(s=N){this.config=s;s?.override||(this.config=M(N,s),"keyframes"in s&&Object.assign(this.config.keyframes,s.keyframes)),this.cache(),L&&this.config.observe&&this.observe(document),S.instances.push(this)}rules=[];ruleBy={};countBy={};observing=!1;observer;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.themeAffectedClassesBy={},this.classesBy={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={},this.keyframes={};let{semantics:s,classes:i,selectors:o,themes:g,colors:b,values:j,breakpoints:w,mediaQueries:m,rules:E}=this.config;function C(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function a(t,n,c="",u={}){let p=R=>R?(c?c+"-":"")+R:c,v=Object.entries(t),B=[],A=[];for(let R of v){let O=R[1];(typeof O=="object"&&!Array.isArray(O)?B:A).push(R)}for(let[R,O]of B)a(O,n,p(R),u);if(n&&c)A.length&&(u[c]=A.reduce((R,[O,D])=>(R[O]=D,R),{}));else for(let[R,O]of A)u[p(R)]=O;return u}function d(t){for(let[n,c]of Object.entries(t))/^[0-9]+x$/.test(n)&&typeof c=="number"&&(t["-"+n]=c*-1);return t}if(s)for(let[t,n]of Object.entries(a(s,!0)))this.semantics.push([new RegExp("^"+C(t)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[t,n]]);if(o)for(let[t,n]of Object.entries(a(o,!1))){let c=new RegExp(C(t)+"(?![a-z-])");for(let u of Array.isArray(n)?n:[n]){let p=u.match(/^::-[a-z]+-/m)?.[0]??"",v=this.selectors[p];v||(v=this.selectors[p]=[]);let B=v.find(([A])=>A===c);B||(B=[c,[]],v.push(B)),B[1].push(u)}}j&&(this.globalValues=d(a(j,!1))),w&&(this.breakpoints=a(w,!1)),m&&(this.mediaQueries=a(m,!1));let y=i?a(i,!1):{},h=g&&!Array.isArray(g)?Object.entries(g).filter(([,{classes:t}])=>t).reduce((t,[n,{classes:c}])=>(t[n]=a(c,!1),t),{}):{},f=[...Object.keys(y),...Object.entries(h).flatMap(([t,n])=>Object.keys(n))],l=t=>{if(t in this.classes)return;let n=this.classes[t]=[],c=(u,p)=>{if(!p)return;let v=Array.isArray(p)?p:p.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let B of v){let A=R=>{R in this.themeAffectedClassesBy?u in this.themeAffectedClassesBy[R]?this.themeAffectedClassesBy[R][u].push(t):this.themeAffectedClassesBy[R][u]=[t]:this.themeAffectedClassesBy[R]={[u]:[t]},n.includes(R)||n.push(R)};if(f.includes(B)){l(B);for(let R of this.classes[B])A(R)}else A(B)}};c("",y?.[t]);for(let[u,p]of Object.entries(h))c(u,p?.[t])};for(let t of f)l(t);for(let t in this.themeAffectedClassesBy){let n=this.classesBy[t]=[];for(let c of Object.values(this.themeAffectedClassesBy[t]))for(let u of c)n.includes(u)||n.push(u)}let r=(t,n)=>{if(!n)return;let c=a(n,!0);for(let[u,p]of Object.entries(c)){let v=typeof p=="string"?{"":p}:p;for(let[B,A]of Object.entries(v)){let R=u+(B?"-"+B:"");R in this.colorThemesMap?this.colorThemesMap[R][t]=A:this.colorThemesMap[R]={[t]:A}}}for(let u in n)this.colorNames.includes(u)||this.colorNames.push(u)};if(r("",b),g)if(Array.isArray(g))this.themeNames.push(...g);else for(let t in g){let n=g[t];r(t,n.colors),this.themeNames.push(t)}let e=t=>{for(let[n,c]of Object.entries(this.colorThemesMap))for(let[u,p]of Object.entries(c))p.startsWith("#")||t(n,c,u,p)};if(e((t,n,c,u)=>{let p=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(u);if(p){let v="#"+_(+p[1],+p[2],+p[3]);p[4]&&(v+=Math.round(255*+p[4]).toString(16)),n[c]=v}}),e((t,n,c,u)=>{let[p,v]=u.split("/"),B=this.colorThemesMap[p];if(B){let A=(c?B[c]:void 0)??B[""];n[c]=v?A.slice(0,7)+Math.round(255*+v).toString(16):A}else console.warn(`\`${u}\` doesn't exist in the extended config \`.colors\``),delete n[c],Object.keys(n).length||delete this.colorThemesMap[t]}),E)for(let t in E){let n=E[t],{native:c,values:u,colored:p}=n,v=n.match;if(n.id=t,n.native=c===!0?t.replace(/(?!^)[A-Z]/g,B=>"-"+B).toLowerCase():void 0,u&&(this.values[t]=d(a(u,!1))),v){let B=Object.keys(this.values[t]??{});v.includes("$values")&&(v=B.length?v.replace(/\$values/,B.join("|")):v.replace(/(?:\|)?\$values/,"")),p&&v.includes("$colors")&&(v=this.colorNames.length?v.replace(/\$colors/,"(?:"+this.colorNames.join("|")+")(?![0-9A-Za-z])"):v.replace(/(?:\|)?\$colors/,"")),this.matches[t]=new RegExp(v)}}}observe(s,i={subtree:!0,childList:!0}){if(this.root!==s){if(L&&s){this.root=s;let o=s===document;o&&(S.root=this),this.host=o?document.documentElement:this.root.host;let g=o?document.head:s,b=o?document.styleSheets:s.styleSheets;for(let w of b){let{ownerNode:m}=w;if(m&&m.id==="master"){this.style=m;break}}if(this.style)for(let w=0;w<this.style.sheet.cssRules.length;w++){let m=this.style.sheet.cssRules[w];if(m.constructor.name==="CSSKeyframesRule")continue;let E=a=>{if(a.selectorText){let y=a.selectorText.split(", ")[0].split(" ");for(let h=0;h<y.length;h++){let f=y[h];if(f[0]==="."){let l=f.slice(1),r="";for(let e=0;e<l.length;e++){let t=l[e],n=l[e+1];if(t==="\\"){if(e++,n!=="\\"){r+=n;continue}}else if(Z.includes(t))break;r+=t}if(!(r in this.ruleBy)&&!(r in this.classes)){let e=this.create(r)[0];if(e)return e}}}}else if(a.cssRules)for(let d=0;d<a.cssRules.length;d++){let y=E(a.cssRules[d]);if(y)return y}},C=E(m);if(C){this.rules.push(C),this.ruleBy[C.className]=C;for(let a=0;a<C.natives.length;a++)C.natives[a].cssRule=this.style.sheet.cssRules[w+a];w+=C.natives.length-1,C.config.insert?.call(C)}}else this.style=V(),g.append(this.style);let j=w=>{w.forEach(m=>{m in this.countBy?this.countBy[m]++:(this.countBy[m]=1,this.insert(m))})};j(this.host.classList),i.subtree&&this.host.querySelectorAll("[class]").forEach(w=>j(w.classList)),this.observer=new MutationObserver(w=>{let m={},E=[],C=[],a=[],d=(l,r)=>{r?l.classList.forEach(h):l.classList.forEach(y);let e=l.children;for(let t=0;t<e.length;t++){let n=e[t];n.classList&&(C.push(n),d(n,r))}},y=l=>{l in m?m[l]++:m[l]=1},h=l=>{l in m?m[l]--:l in this.countBy&&(m[l]=-1)},f=(l,r)=>{for(let e=0;e<l.length;e++){let t=l[e];t.classList&&!C.includes(t)&&!a.includes(t)&&(t.isConnected!==r?(C.push(t),d(t,r)):a.push(t))}};for(let l=0;l<w.length;l++){let r=w[l],{addedNodes:e,removedNodes:t,type:n,target:c}=r;if(n==="attributes"){if(E.find(u=>u.target===c))continue;E.push(r)}else f(e,!1),(!c.isConnected||!C.includes(c))&&f(t,!0)}if(!(!E.length&&!Object.keys(m).length)){for(let{oldValue:l,target:r}of E){let e=C.includes(r),t=r.classList,n=l?l.split(" "):[];if(e){if(r.isConnected)continue;for(let c of n)t.contains(c)||h(c)}else if(r.isConnected){t.forEach(c=>{n.includes(c)||y(c)});for(let c of n)t.contains(c)||h(c)}}for(let l in m){let r=m[l],e=(this.countBy[l]||0)+r;e===0?(delete this.countBy[l],this.delete(l)):(l in this.countBy||this.insert(l),this.countBy[l]=e)}}}),this.observer.observe(s,{...i,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]}),this.host.style.display=null,this.observing=!0}return this}}disconnect(){this.observer&&(this.observer.disconnect(),this.observer=null),this.observing=!1,this.ruleBy={},this.countBy={},this.rules.length=0;let s=this.style?.sheet;if(s?.cssRules)for(let i=s.cssRules.length-1;i>=0;i--)s.deleteRule(i);this.style?.remove(),this.style=null,this.root=null}match(s){for(let i in this.config.rules){let o=this.config.rules[i],g=this.matches[i],{symbol:b,native:j}=o;if(g&&g.test(s))return{origin:"match",config:o};if(b&&s.startsWith(b))return{origin:"symbol",config:o};if(j&&s.startsWith(j+":"))return{origin:"match",config:o}}for(let i of this.semantics)if(s.match(i[0]))return{origin:"semantics",value:i[1]}}create(s){let i=o=>{if(o in this.ruleBy)return this.ruleBy[o];let g=this.match(o);if(g)return new z(o,g,this)};return(s in this.classes?this.classes[s].map(o=>i(o)):[i(s)]).filter(o=>o&&o.text)}refresh(s){if(s?.override?this.config=s:this.config=M(N,s),this.cache(),!this.style)return;let i=V();this.style.replaceWith(i),this.style=i,this.rules.length=0,this.ruleBy={};for(let o in this.countBy)this.insert(o)}destroy(){let s=S.instances;this.disconnect(),s.splice(s.indexOf(this),1)}delete(s){let i=this.style?.sheet,o=g=>{let b=this.ruleBy[g];if(!(!b||g in this.classesBy&&this.classesBy[g].some(j=>j in this.countBy))){if(i&&b.natives.length){let j=b.natives[0];for(let w=0;w<i.cssRules.length;w++)if(i.cssRules[w]===j.cssRule){for(let E=0;E<b.natives.length;E++)i.deleteRule(w);break}}this.rules.splice(this.rules.indexOf(b),1),delete this.ruleBy[g],b.config.delete&&b.config.delete.call(b,g)}};if(s in this.classes){for(let g of this.classes[s])g in this.countBy||o(g);delete this.ruleBy[s]}else o(s)}insert(s){let i=this.create(s);return i.length?(this.insertRules(i),!0):!1}insertRules(s){for(let i of s){if(this.ruleBy[i.className])continue;let o,g=Object.keys(this.keyframes).length,b=this.rules.length-1,{media:j,order:w,priority:m,hasWhere:E,className:C}=i,a=(h,f,l)=>{let r=h;for(;r<=b;r++){let e=this.rules[r];if(f?.(e))return l?-1:r-1;if(l?.(e))return r}return l?-1:r-1},d,y;if(j){let h=this.rules.findIndex(f=>f.media);if(h===-1)o=b+1;else{let{"max-width":f,"min-width":l}=j.features;if(f||l){let r=this.rules.findIndex(e=>e.media?.features["max-width"]||e.media?.features["min-width"]);if(r===-1)o=b+1;else if(f&&l){if(m===-1?(d=a(r,e=>e.priority!==-1,e=>e.media.features["max-width"]&&e.media.features["min-width"]),y=a(r,e=>e.priority!==-1)):(d=a(r,void 0,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1),y=b),d!==-1){let e=f.value-l.value,t=y,n=d;for(d=void 0;t>=n;t--){let{"max-width":c,"min-width":u}=this.rules[t].media.features,p=c.value-u.value;if(p<e)y=t-1;else if(p===e)d=t;else break}}if(d!==-1){let e=f.value-l.value;for(let t=y;t>=d;t--){let{"max-width":n,"min-width":c}=this.rules[t].media.features,u=n.value-c.value;if(u<e)y=t-1;else if(u>e){d=t+1;break}}}}else if(l){if(m===-1?(d=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]||e.priority!==-1,e=>!e.media.features["max-width"]&&e.media.features["min-width"]),y=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]||e.priority!==-1)):(d=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1,e=>!e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1),y=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1)),d!==-1)for(let e=y;e>=d;e--){let t=this.rules[e].media.features["min-width"].value;if(t>l.value)y=e-1;else if(t<l.value){d=e+1;break}}}else if(m===-1?(d=a(r,e=>e.media.features["min-width"]||e.priority!==-1,e=>e.media.features["max-width"]),y=a(r,e=>e.media.features["min-width"]||e.priority!==-1)):(d=a(r,e=>e.media.features["min-width"]&&e.priority!==-1,e=>e.media.features["max-width"]&&e.priority!==-1),y=a(r,e=>e.media.features["min-width"]&&e.priority!==-1)),d!==-1)for(let e=y;e>=d;e--){let t=this.rules[e].media.features["max-width"].value;if(t<f.value)y=e-1;else if(t>f.value){d=e+1;break}}}else m===-1?(d=h,y=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"]||r.priority!==-1)):(d=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"],r=>r.priority!==-1),y=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"]))}}else{let h=g?1:0;m===-1?(d=h,y=a(h,f=>f.media||f.priority!==-1)):(d=a(h,f=>f.media,f=>f.priority!==-1),y=a(h,f=>f.media))}if(o===void 0)if(d===-1)o=y+1;else{if(m===-1)for(let h=d;h<=y;h++){let f=this.rules[h];if(!(!E&&f.hasWhere)&&(E&&!f.hasWhere||f.order>=w)){o=h;break}}else for(let h=d;h<=y;h++){let f=this.rules[h];if(!(!E&&f.hasWhere)){if(E&&!f.hasWhere){o=h;break}if(f.priority<m){o=h;break}else if(f.priority===m){if(f.order>=w){o=h;break}}else o=h+1}}o===void 0&&(o=y+1)}if(this.rules.splice(o,0,i),this.ruleBy[C]=i,this.style){let h=this.style.sheet,f=0,l=r=>{let e=this.rules[r];if(e){if(!e.natives.length)return l(r-1);let t=e.natives[e.natives.length-1].cssRule;for(let n=0;n<h.cssRules.length;n++)if(h.cssRules[n]===t){f=n+1;break}}};l(o-1);for(let r=0;r<i.natives.length;)try{let e=i.natives[r];h.insertRule(e.text,f),e.cssRule=h.cssRules[f++],r++}catch(e){console.error(e),i.natives.splice(r,1)}}i.config.insert?.call(i)}}get text(){return this.rules.map(s=>s.text).join("")}},k=S;T(k,"root"),T(k,"config",N),T(k,"instances",[]),T(k,"refresh",s=>{for(let i of S.instances)i.refresh(s)});L&&(window.MasterCSS=k);export{k as MasterCSS};
1
+ var H=Object.defineProperty;var Q=(x,s,i)=>s in x?H(x,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):x[s]=i;var T=(x,s,i)=>(Q(x,typeof s!="symbol"?s+"":s,i),i);function I(x){let s=typeof Buffer<"u"?Buffer:null;return!!(s&&x instanceof s||x instanceof Date||x instanceof RegExp)}function $(x){if(typeof Buffer<"u"&&Buffer&&x instanceof Buffer){let s=Buffer.alloc(x.length);return x.copy(s),s}else{if(x instanceof Date)return new Date(x.getTime());if(x instanceof RegExp)return new RegExp(x);throw new Error("Unexpected situation")}}function F(x){let s=[];return x.forEach(function(i,o){typeof i=="object"&&i!==null?Array.isArray(i)?s[o]=F(i):I(i)?s[o]=$(i):s[o]=O({},i):s[o]=i}),s}function W(x,s){return s==="__proto__"?void 0:x[s]}function O(...x){let s={},i,o;return x.forEach(function(g){typeof g!="object"||g===null||Array.isArray(g)||Object.keys(g).forEach(function(b){if(o=W(s,b),i=W(g,b),i!==s)if(typeof i!="object"||i===null){s[b]=i;return}else if(Array.isArray(i)){s[b]=F(i);return}else if(I(i)){s[b]=$(i);return}else if(typeof o!="object"||o===null||Array.isArray(o)){s[b]=O({},i);return}else{s[b]=O(o,i);return}})}),s}import{Rule as z}from"./rule.mjs";import{config as N}from"./config/index.mjs";import{rgbToHex as _}from"./utils/rgb-to-hex.mjs";import{SELECTOR_SYMBOLS as Z}from"./constants/selector-symbols.mjs";var L=typeof window<"u",V=()=>{let x=document.createElement("style");return x.id="master",x},k=class{constructor(s=N){this.config=s;s?.override||(this.config=O(N,s),"keyframes"in s&&Object.assign(this.config.keyframes,s.keyframes)),this.cache(),L&&this.config.observe&&this.observe(document),k.instances.push(this)}rules=[];ruleBy={};countBy={};observing=!1;observer;cache(){this.semantics=[],this.classes={},this.colorThemesMap={},this.themeAffectedClassesBy={},this.classesBy={},this.colorNames=[],this.themeNames=[""],this.selectors={},this.values={},this.globalValues={},this.breakpoints={},this.mediaQueries={},this.matches={},this.keyframes={};let{semantics:s,classes:i,selectors:o,themes:g,colors:b,values:S,breakpoints:w,mediaQueries:m,rules:E}=this.config;function B(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function a(t,n,c="",u={}){let p=R=>R?(c?c+"-":"")+R:c,v=Object.entries(t),C=[],M=[];for(let R of v){let j=R[1];(typeof j=="object"&&!Array.isArray(j)?C:M).push(R)}for(let[R,j]of C)a(j,n,p(R),u);if(n&&c)M.length&&(u[c]=M.reduce((R,[j,D])=>(R[j]=D,R),{}));else for(let[R,j]of M)u[p(R)]=j;return u}function d(t){for(let[n,c]of Object.entries(t))/^[0-9]+x$/.test(n)&&typeof c=="number"&&(t["-"+n]=c*-1);return t}if(s)for(let[t,n]of Object.entries(a(s,!0)))this.semantics.push([new RegExp("^"+B(t)+"(?=!|\\*|>|\\+|~|:|\\[|@|_|\\.|$)","m"),[t,n]]);if(o)for(let[t,n]of Object.entries(a(o,!1))){let c=new RegExp(B(t)+"(?![a-z-])");for(let u of Array.isArray(n)?n:[n]){let p=u.match(/^::-[a-z]+-/m)?.[0]??"",v=this.selectors[p];v||(v=this.selectors[p]=[]);let C=v.find(([M])=>M===c);C||(C=[c,[]],v.push(C)),C[1].push(u)}}S&&(this.globalValues=d(a(S,!1))),w&&(this.breakpoints=a(w,!1)),m&&(this.mediaQueries=a(m,!1));let y=i?a(i,!1):{},h=g&&!Array.isArray(g)?Object.entries(g).filter(([,{classes:t}])=>t).reduce((t,[n,{classes:c}])=>(t[n]=a(c,!1),t),{}):{},f=[...Object.keys(y),...Object.entries(h).flatMap(([t,n])=>Object.keys(n))],l=t=>{if(t in this.classes)return;let n=this.classes[t]=[],c=(u,p)=>{if(!p)return;let v=Array.isArray(p)?p:p.replace(/(?:\n(?:\s*))+/g," ").trim().split(" ");for(let C of v){let M=R=>{R in this.themeAffectedClassesBy?u in this.themeAffectedClassesBy[R]?this.themeAffectedClassesBy[R][u].push(t):this.themeAffectedClassesBy[R][u]=[t]:this.themeAffectedClassesBy[R]={[u]:[t]},n.includes(R)||n.push(R)};if(f.includes(C)){l(C);for(let R of this.classes[C])M(R)}else M(C)}};c("",y?.[t]);for(let[u,p]of Object.entries(h))c(u,p?.[t])};for(let t of f)l(t);for(let t in this.themeAffectedClassesBy){let n=this.classesBy[t]=[];for(let c of Object.values(this.themeAffectedClassesBy[t]))for(let u of c)n.includes(u)||n.push(u)}let r=(t,n)=>{if(!n)return;let c=a(n,!0);for(let[u,p]of Object.entries(c)){let v=typeof p=="string"?{"":p}:p;for(let[C,M]of Object.entries(v)){let R=u+(C?"-"+C:"");R in this.colorThemesMap?this.colorThemesMap[R][t]=M:this.colorThemesMap[R]={[t]:M}}}for(let u in n)this.colorNames.includes(u)||this.colorNames.push(u)};if(r("",b),g)if(Array.isArray(g))this.themeNames.push(...g);else for(let t in g){let n=g[t];r(t,n.colors),this.themeNames.push(t)}let e=t=>{for(let[n,c]of Object.entries(this.colorThemesMap))for(let[u,p]of Object.entries(c))p.startsWith("#")||t(n,c,u,p)};if(e((t,n,c,u)=>{let p=/^rgba?\( *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?: |,) *([0-9]{1,3}) *(?:(?:\/|,) *0?(\.[0-9]))?\)$/.exec(u);if(p){let v="#"+_(+p[1],+p[2],+p[3]);p[4]&&(v+=Math.round(255*+p[4]).toString(16)),n[c]=v}}),e((t,n,c,u)=>{let[p,v]=u.split("/"),C=this.colorThemesMap[p];if(C){let M=(c?C[c]:void 0)??C[""];n[c]=v?M.slice(0,7)+Math.round(255*+v).toString(16):M}else console.warn(`\`${u}\` doesn't exist in the extended config \`.colors\``),delete n[c],Object.keys(n).length||delete this.colorThemesMap[t]}),E)for(let t in E){let n=E[t],{native:c,values:u,colored:p}=n,v=n.match;if(n.id=t,n.native=c===!0?t.replace(/(?!^)[A-Z]/g,C=>"-"+C).toLowerCase():void 0,u&&(this.values[t]=d(a(u,!1))),v){let C=Object.keys(this.values[t]??{});v.includes("$values")&&(v=C.length?v.replace(/\$values/,C.join("|")):v.replace(/(?:\|)?\$values/,"")),p&&v.includes("$colors")&&(v=this.colorNames.length?v.replace(/\$colors/,"(?:"+this.colorNames.join("|")+")(?![0-9A-Za-z])"):v.replace(/(?:\|)?\$colors/,"")),this.matches[t]=new RegExp(v)}}}observe(s,i={subtree:!0,childList:!0}){if(this.root!==s){if(L&&s){this.root=s;let o=s===document;o&&(k.root=this),this.host=o?document.documentElement:this.root.host;let g=o?document.head:s,b=o?document.styleSheets:s.styleSheets;for(let w of b){let{ownerNode:m}=w;if(m&&m.id==="master"){this.style=m;break}}if(this.style)for(let w=0;w<this.style.sheet.cssRules.length;w++){let m=this.style.sheet.cssRules[w];if(m.constructor.name==="CSSKeyframesRule")continue;let E=a=>{if(a.selectorText){let y=a.selectorText.split(", ")[0].split(" ");for(let h=0;h<y.length;h++){let f=y[h];if(f[0]==="."){let l=f.slice(1),r="";for(let e=0;e<l.length;e++){let t=l[e],n=l[e+1];if(t==="\\"){if(e++,n!=="\\"){r+=n;continue}}else if(Z.includes(t))break;r+=t}if(!(r in this.ruleBy)&&!(r in this.classes)){let e=this.create(r)[0];if(e)return e}}}}else if(a.cssRules)for(let d=0;d<a.cssRules.length;d++){let y=E(a.cssRules[d]);if(y)return y}},B=E(m);if(B){this.rules.push(B),this.ruleBy[B.className]=B;for(let a=0;a<B.natives.length;a++)B.natives[a].cssRule=this.style.sheet.cssRules[w+a];w+=B.natives.length-1,B.config.insert?.call(B)}}else this.style=V(),g.append(this.style);let S=w=>{w.forEach(m=>{m in this.countBy?this.countBy[m]++:(this.countBy[m]=1,this.insert(m))})};S(this.host.classList),i.subtree&&this.host.querySelectorAll("[class]").forEach(w=>S(w.classList)),this.observer=new MutationObserver(w=>{let m={},E=[],B=[],a=[],d=(l,r)=>{r?l.classList.forEach(h):l.classList.forEach(y);let e=l.children;for(let t=0;t<e.length;t++){let n=e[t];n.classList&&(B.push(n),d(n,r))}},y=l=>{l in m?m[l]++:m[l]=1},h=l=>{l in m?m[l]--:l in this.countBy&&(m[l]=-1)},f=(l,r)=>{for(let e=0;e<l.length;e++){let t=l[e];t.classList&&!B.includes(t)&&!a.includes(t)&&(t.isConnected!==r?(B.push(t),d(t,r)):a.push(t))}};for(let l=0;l<w.length;l++){let r=w[l],{addedNodes:e,removedNodes:t,type:n,target:c}=r;if(n==="attributes"){if(E.find(u=>u.target===c))continue;E.push(r)}else f(e,!1),(!c.isConnected||!B.includes(c))&&f(t,!0)}if(!(!E.length&&!Object.keys(m).length)){for(let{oldValue:l,target:r}of E){let e=B.includes(r),t=r.classList,n=l?l.split(" "):[];if(e){if(r.isConnected)continue;for(let c of n)t.contains(c)||h(c)}else if(r.isConnected){t.forEach(c=>{n.includes(c)||y(c)});for(let c of n)t.contains(c)||h(c)}}for(let l in m){let r=m[l],e=(this.countBy[l]||0)+r;e===0?(delete this.countBy[l],this.delete(l)):(l in this.countBy||this.insert(l),this.countBy[l]=e)}}}),this.observer.observe(s,{...i,attributes:!0,attributeOldValue:!0,attributeFilter:["class"]}),this.host.style.display=null,this.observing=!0}return this}}disconnect(){this.observer&&(this.observer.disconnect(),this.observer=null),this.observing=!1,this.ruleBy={},this.countBy={},this.rules.length=0;let s=this.style?.sheet;if(s?.cssRules)for(let i=s.cssRules.length-1;i>=0;i--)s.deleteRule(i);this.style?.remove(),this.style=null,this.root=null}match(s){for(let i in this.config.rules){let o=this.config.rules[i],g=this.matches[i],{symbol:b,native:S}=o;if(g&&g.test(s))return{origin:"match",config:o};if(b&&s.startsWith(b))return{origin:"symbol",config:o};if(S&&s.startsWith(S+":"))return{origin:"match",config:o}}for(let i of this.semantics)if(s.match(i[0]))return{origin:"semantics",value:i[1]}}create(s){let i=o=>{if(o in this.ruleBy)return this.ruleBy[o];let g=this.match(o);if(g)return new z(o,g,this)};return(s in this.classes?this.classes[s].map(o=>i(o)):[i(s)]).filter(o=>o&&o.text)}refresh(s){if(s?.override?this.config=s:this.config=O(N,s),this.cache(),!this.style)return;let i=V();this.style.replaceWith(i),this.style=i,this.rules.length=0,this.ruleBy={};for(let o in this.countBy)this.insert(o)}destroy(){let s=k.instances;this.disconnect(),s.splice(s.indexOf(this),1)}delete(s){let i=this.style?.sheet,o=g=>{let b=this.ruleBy[g];if(!(!b||g in this.classesBy&&this.classesBy[g].some(S=>S in this.countBy))){if(i&&b.natives.length){let S=b.natives[0];for(let w=0;w<i.cssRules.length;w++)if(i.cssRules[w]===S.cssRule){for(let E=0;E<b.natives.length;E++)i.deleteRule(w);break}}this.rules.splice(this.rules.indexOf(b),1),delete this.ruleBy[g],b.config.delete&&b.config.delete.call(b,g)}};if(s in this.classes){for(let g of this.classes[s])g in this.countBy||o(g);delete this.ruleBy[s]}else o(s)}insert(s){let i=this.create(s);return i.length?(this.insertRules(i),!0):!1}insertRules(s){for(let i of s){if(this.ruleBy[i.className])continue;let o,g=Object.keys(this.keyframes).length,b=this.rules.length-1,{media:S,order:w,priority:m,hasWhere:E,className:B}=i,a=(h,f,l)=>{let r=h;for(;r<=b;r++){let e=this.rules[r];if(f?.(e))return l?-1:r-1;if(l?.(e))return r}return l?-1:r-1},d,y;if(S){let h=this.rules.findIndex(f=>f.media);if(h===-1)o=b+1;else{let{"max-width":f,"min-width":l}=S.features;if(f||l){let r=this.rules.findIndex(e=>e.media?.features["max-width"]||e.media?.features["min-width"]);if(r===-1)o=b+1;else if(f&&l){if(m===-1?(d=a(r,e=>e.priority!==-1,e=>e.media.features["max-width"]&&e.media.features["min-width"]),y=a(r,e=>e.priority!==-1)):(d=a(r,void 0,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1),y=b),d!==-1){let e=f.value-l.value,t=y,n=d;for(d=void 0;t>=n;t--){let{"max-width":c,"min-width":u}=this.rules[t].media.features,p=c.value-u.value;if(p<e)y=t-1;else if(p===e)d=t;else break}}if(d!==-1){let e=f.value-l.value;for(let t=y;t>=d;t--){let{"max-width":n,"min-width":c}=this.rules[t].media.features,u=n.value-c.value;if(u<e)y=t-1;else if(u>e){d=t+1;break}}}}else if(l){if(m===-1?(d=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]||e.priority!==-1,e=>!e.media.features["max-width"]&&e.media.features["min-width"]),y=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]||e.priority!==-1)):(d=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1,e=>!e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1),y=a(r,e=>e.media.features["max-width"]&&e.media.features["min-width"]&&e.priority!==-1)),d!==-1)for(let e=y;e>=d;e--){let t=this.rules[e].media.features["min-width"].value;if(t>l.value)y=e-1;else if(t<l.value){d=e+1;break}}}else if(m===-1?(d=a(r,e=>e.media.features["min-width"]||e.priority!==-1,e=>e.media.features["max-width"]),y=a(r,e=>e.media.features["min-width"]||e.priority!==-1)):(d=a(r,e=>e.media.features["min-width"]&&e.priority!==-1,e=>e.media.features["max-width"]&&e.priority!==-1),y=a(r,e=>e.media.features["min-width"]&&e.priority!==-1)),d!==-1)for(let e=y;e>=d;e--){let t=this.rules[e].media.features["max-width"].value;if(t<f.value)y=e-1;else if(t>f.value){d=e+1;break}}}else m===-1?(d=h,y=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"]||r.priority!==-1)):(d=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"],r=>r.priority!==-1),y=a(h,r=>r.media?.features["max-width"]||r.media?.features["min-width"]))}}else{let h=g?1:0;m===-1?(d=h,y=a(h,f=>f.media||f.priority!==-1)):(d=a(h,f=>f.media,f=>f.priority!==-1),y=a(h,f=>f.media))}if(o===void 0)if(d===-1)o=y+1;else{if(m===-1)for(let h=d;h<=y;h++){let f=this.rules[h];if(!(!E&&f.hasWhere)&&(E&&!f.hasWhere||f.order>=w)){o=h;break}}else for(let h=d;h<=y;h++){let f=this.rules[h];if(!(!E&&f.hasWhere)){if(E&&!f.hasWhere){o=h;break}if(f.priority<m){o=h;break}else if(f.priority===m){if(f.order>=w){o=h;break}}else o=h+1}}o===void 0&&(o=y+1)}if(this.rules.splice(o,0,i),this.ruleBy[B]=i,this.style){let h=this.style.sheet,f=0,l=r=>{let e=this.rules[r];if(e){if(!e.natives.length)return l(r-1);let t=e.natives[e.natives.length-1].cssRule;for(let n=0;n<h.cssRules.length;n++)if(h.cssRules[n]===t){f=n+1;break}}};l(o-1);for(let r=0;r<i.natives.length;)try{let e=i.natives[r];h.insertRule(e.text,f),e.cssRule=h.cssRules[f++],r++}catch(e){console.error(e),i.natives.splice(r,1)}}i.config.insert?.call(i)}}get text(){return this.rules.map(s=>s.text).join("")}},A=k;T(A,"root"),T(A,"config",N),T(A,"instances",[]),T(A,"refresh",s=>{for(let i of k.instances)i.refresh(s)});L&&(window.MasterCSS=A);export{A as MasterCSS};
@@ -1 +1 @@
1
- import{MasterCSS as e}from"./css.mjs";import{Theme as a}from"./theme.mjs";new e(window.masterCSSConfig);new a(window.masterCSSThemeSettings);
1
+ import{MasterCSS as o}from"./core.mjs";new o(window.masterCSSConfig);
@@ -1 +1 @@
1
- export*from"./css.mjs";export*from"./rule.mjs";export*from"./theme.mjs";export*from"./constants/index.mjs";import{MasterCSS as E}from"./css.mjs";function a(t){let e=typeof Buffer<"u"?Buffer:null;return!!(e&&t instanceof e||t instanceof Date||t instanceof RegExp)}function l(t){if(typeof Buffer<"u"&&Buffer&&t instanceof Buffer){let e=Buffer.alloc(t.length);return t.copy(e),e}else{if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);throw new Error("Unexpected situation")}}function c(t){let e=[];return t.forEach(function(r,n){typeof r=="object"&&r!==null?Array.isArray(r)?e[n]=c(r):a(r)?e[n]=l(r):e[n]=u({},r):e[n]=r}),e}function i(t,e){return e==="__proto__"?void 0:t[e]}function u(...t){let e={},r,n;return t.forEach(function(f){typeof f!="object"||f===null||Array.isArray(f)||Object.keys(f).forEach(function(o){if(n=i(e,o),r=i(f,o),r!==e)if(typeof r!="object"||r===null){e[o]=r;return}else if(Array.isArray(r)){e[o]=c(r);return}else if(a(r)){e[o]=l(r);return}else if(typeof n!="object"||n===null||Array.isArray(n)){e[o]=u({},r);return}else{e[o]=u(n,r);return}})}),e}export*from"./methods/index.mjs";export*from"./config/index.mjs";export{E as default,u as extend};
1
+ export*from"./core.mjs";export*from"./rule.mjs";export*from"./constants/index.mjs";import{MasterCSS as d}from"./core.mjs";function a(t){let e=typeof Buffer<"u"?Buffer:null;return!!(e&&t instanceof e||t instanceof Date||t instanceof RegExp)}function l(t){if(typeof Buffer<"u"&&Buffer&&t instanceof Buffer){let e=Buffer.alloc(t.length);return t.copy(e),e}else{if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);throw new Error("Unexpected situation")}}function c(t){let e=[];return t.forEach(function(r,n){typeof r=="object"&&r!==null?Array.isArray(r)?e[n]=c(r):a(r)?e[n]=l(r):e[n]=u({},r):e[n]=r}),e}function i(t,e){return e==="__proto__"?void 0:t[e]}function u(...t){let e={},r,n;return t.forEach(function(o){typeof o!="object"||o===null||Array.isArray(o)||Object.keys(o).forEach(function(f){if(n=i(e,f),r=i(o,f),r!==e)if(typeof r!="object"||r===null){e[f]=r;return}else if(Array.isArray(r)){e[f]=c(r);return}else if(a(r)){e[f]=l(r);return}else if(typeof n!="object"||n===null||Array.isArray(n)){e[f]=u({},r);return}else{e[f]=u(n,r);return}})}),e}export*from"./methods/index.mjs";export*from"./config/index.mjs";export{d as default,u as extend};
@@ -1 +1 @@
1
- import{MasterCSS as s}from"../css.mjs";import{extractClassesFromHTML as i}from"./extract-classes-from-html.mjs";function m(e,o){if(!e)return;let n=i(e);if(!n.length)return;let r=new s({...o,observe:!1});for(let t of n)t in r.countBy||r.insert(t)&&(r.countBy[t]=1);return r.text}export{m as renderFromHTML};
1
+ import{MasterCSS as s}from"../core.mjs";import{extractClassesFromHTML as i}from"./extract-classes-from-html.mjs";function m(e,o){if(!e)return;let n=i(e);if(!n.length)return;let r=new s({...o,observe:!1});for(let t of n)t in r.countBy||r.insert(t)&&(r.countBy[t]=1);return r.text}export{m as renderFromHTML};
@@ -1 +1 @@
1
- import{MasterCSS as t}from"../css.mjs";function f(n,o){if(!n?.length)return;let e=new t({...o,observe:!1});for(let r of n)r in e.countBy||e.insert(r)&&(e.countBy[r]=1);return e.rules}export{f as renderRules};
1
+ import{MasterCSS as t}from"../core.mjs";function f(n,o){if(!n?.length)return;let e=new t({...o,observe:!1});for(let r of n)r in e.countBy||e.insert(r)&&(e.countBy[r]=1);return e.rules}export{f as renderRules};
@@ -1 +1 @@
1
- import{MasterCSS as o}from"../css.mjs";function f(r,e){if(!r?.length)return;let n=new o({...e,observe:!1});for(let t of r)t in n.countBy||n.insert(t)&&(n.countBy[t]=1);return n.text}export{f as render};
1
+ import{MasterCSS as o}from"../core.mjs";function f(r,e){if(!r?.length)return;let n=new o({...e,observe:!1});for(let t of r)t in n.countBy||n.insert(t)&&(n.countBy[t]=1);return n.text}export{f as render};
@@ -1,6 +1,6 @@
1
- import { MasterCSS } from './css';
1
+ import { Config } from './config';
2
2
  declare global {
3
3
  interface Window {
4
- MasterCSS: typeof MasterCSS;
4
+ masterCSSConfig: Config;
5
5
  }
6
6
  }