@master/css-compiler 2.0.0-beta.150 → 2.0.0-beta.152

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var we=Object.create;var R=Object.defineProperty;var Te=Object.getOwnPropertyDescriptor;var Ee=Object.getOwnPropertyNames;var Ce=Object.getPrototypeOf,Se=Object.prototype.hasOwnProperty;var Re=(e,r)=>{for(var t in r)R(e,t,{get:r[t],enumerable:!0})},z=(e,r,t,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Ee(r))!Se.call(e,i)&&i!==t&&R(e,i,{get:()=>r[i],enumerable:!(s=Te(r,i))||s.enumerable});return e};var m=(e,r,t)=>(t=e!=null?we(Ce(e)):{},z(r||!e||!e.__esModule?R(t,"default",{value:e,enumerable:!0}):t,e)),ke=e=>z(R({},"__esModule",{value:!0}),e);var yt={};Re(yt,{MasterCSSCompiler:()=>S,OPTIONS_ESM_TEXT:()=>Pe,OPTIONS_TEXT:()=>je,OPTIONS_TS_TEXT:()=>Be,default:()=>S,options:()=>T});module.exports=ke(yt);var Ne={path:"master.css-compiler.*",module:"master.css",config:"master.css.*",sources:[],include:["**/*.{html,js,jsx,ts,tsx,svelte,astro,vue,md,mdx,pug,php}"],exclude:["**/node_modules/**","**/*.d.ts","**/*.test.*","**/*.config.*","node_modules","master.css.*","dist","out","styles","public","README.md"],classes:{fixed:[],ignored:[]}},T=Ne;var je=`/** @type {import('@master/css-compiler').Options} */
1
+ var we=Object.create;var R=Object.defineProperty;var Te=Object.getOwnPropertyDescriptor;var Ee=Object.getOwnPropertyNames;var Ce=Object.getPrototypeOf,Se=Object.prototype.hasOwnProperty;var Re=(e,r)=>{for(var t in r)R(e,t,{get:r[t],enumerable:!0})},z=(e,r,t,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Ee(r))!Se.call(e,i)&&i!==t&&R(e,i,{get:()=>r[i],enumerable:!(s=Te(r,i))||s.enumerable});return e};var m=(e,r,t)=>(t=e!=null?we(Ce(e)):{},z(r||!e||!e.__esModule?R(t,"default",{value:e,enumerable:!0}):t,e)),ke=e=>z(R({},"__esModule",{value:!0}),e);var yt={};Re(yt,{MasterCSSCompiler:()=>S,OPTIONS_ESM_TEXT:()=>Pe,OPTIONS_TEXT:()=>je,OPTIONS_TS_TEXT:()=>Be,default:()=>S,options:()=>T});module.exports=ke(yt);var Ne={standalone:!0,path:"master.css-compiler.*",module:"master.css",config:"master.css.*",sources:[],include:["**/*.{html,js,jsx,ts,tsx,svelte,astro,vue,md,mdx,pug,php}"],exclude:["**/*.d.ts","**/*.test.*","**/*.config.*","master.css.*","dist","out","styles","public","README.md"],classes:{fixed:[],ignored:[]}},T=Ne;var je=`/** @type {import('@master/css-compiler').Options} */
2
2
  module.exports = {
3
3
  sources: [],
4
4
  classes: {
@@ -26,13 +26,13 @@ const options: Options = {
26
26
  }
27
27
 
28
28
  export default options
29
- `;var P=m(require("upath"));var be=m(require("@master/css"));var H=require("@master/css");function G({content:e},{config:r,classes:t}){e=Me(e);let s=[...new Set(Object.keys(r.semantics??H.semantics).concat(Object.keys(t)))],i=e.match(/\S+/g)??[],o=new Set;for(let n of i){o.add(F(n,s));let g=q(n);if(g.size)for(let c of g)o.add(F(c,s))}return[...o].filter(n=>n&&!Ae(n,s))}var F=(e,r)=>{let t=e,s=e.match(/(?:calc\(.*\)|\d+(?:%|ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmax|vmin|vw|deg|grad|rad|turn|s)?)x(?:calc\(.*\)|\d+(?:%|ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmax|vmin|vw|deg|grad|rad|turn|s)?)/g);return(s?.length?r.concat(s):r).find(i=>t.startsWith(i))?e=_(e,i=>i.replace(/^[^:@~(]*(?<!@>?)=/,"").replace(/(?:[([{\\:#=.]+|["'`].*)$/,"")):e=_(e,i=>i.replace(/^[^:@~(]*(?:["'`]|(?<!@>?)=)/,"").replace(/(?:[([{\\:#=.]+|["'`].*)$/,"")),t===e||!e?e:F(e,r)},J=e=>e.match(/((?<!\\)["'`])(?:\\\1|(?:(?!\1))[\S\s])*(?<!\\)\1/g),K=(e,r)=>(r?.forEach((t,s)=>{e=e.replace(t,`COMPLETE-STRING--${s}--`)}),e),_=(e,r)=>{let t=J(e);return e=K(e,t),e=r(e),t?.forEach((s,i)=>{e=e.replace(`COMPLETE-STRING--${i}--`,s)}),e},q=e=>{let r=new Set,t=/((?<!\\)["'`])((?:\\\1|(?:(?!\1))[\S\s])*)((?<!\\)\1)/g,s;for(;(s=t.exec(e))!==null;){s.index===t.lastIndex&&t.lastIndex++,r.add(s[2]);let i=q(s[2]);if(i.size)for(let o of i)r.add(o)}return r},Me=e=>_(e,r=>r.replace(/\/\*(?:(?!\*\/)[\S\s])*\*\//g,"").replace(/<!--(?:(?!-->)[\S\s])*-->/g,"").replace(/\/\/.*/g,"").replace(/<style[^>]*>(?:(?!<\/style>)[\S\s])*<\/style>/g,"").replace(/import.*from\s*COMPLETE-STRING--\d+--/g,"").replace(/import\s*(?:COMPLETE-STRING--\d+--|\([^;\s]*\))/g,"").replace(/(?:require|import)\([^;\s]*\)/g,"").replace(/(?:@.*\n)+(?:export|function|class)/g,"")),Ae=(e,r)=>{let t=J(e),s=K(e,t),i=/{(.*)}/,o;for(;(o=i.exec(s))!==null;)return o[1].split(";").find(g=>X(g,r))!==void 0;return X(s,r)||Ie(e)},X=(e,r)=>!e||!e.match(/(?:\S*\{\S*\})|(?:^[\w\-()]+:\S+)|(?:^[\w-]+\(\S+\))|(?:^[@~]\S+$)/)&&!e.match(/^(?:calc\(.*\)|\d+(?:%|ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmax|vmin|vw|deg|grad|rad|turn|s)?)x(?:calc\(.*\)|\d+(?:%|ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmax|vmin|vw|deg|grad|rad|turn|s)?)$/)&&!r.find(t=>e.startsWith(t))||e.match(/\*\*/)||e.match(/:\[/)||e.match(/\$\{/)||e.match(/\{\{/)||e.match(/\(\{[^}]*\}/)||e.match(/<\w+>|<\/\w+>/)||e.match(/;$/)||e.match(/^\w+:\/\//)||e.match(/^@(?:ts-[^\s]+|charset|import|namespace|media|supports|document|page|font-face|keyframes|counter-style|font-feature-values|property|layer|[^/]+\/.*)$/)||e.match(/^~\/.+.\w+$/)||e.match(/function\(|\(.*\)=>/)||e.match(/^\$\(.*/),Ie=e=>{let r=[],t;for(let s=0;s<e.length;s++)switch(e[s]){case"(":case"[":case"{":r.push(e[s]);break;case")":case"]":case"}":if(t=r.pop(),e[s]===")"&&t!=="("||e[s]==="]"&&t!=="["||e[s]==="}"&&t!=="{")return!0;break}return r.length>0};var ve=m(require("fs")),B=m(require("fast-glob")),M=m(require("minimatch")),A=m(require("techor"));var j=m(require("node:process"),1),he=m(require("node:os"),1),D=m(require("node:tty"),1),Fe=Object.create,pe=Object.defineProperty,_e=Object.getOwnPropertyDescriptor,Ge=Object.getOwnPropertyNames,Le=Object.getPrototypeOf,Ye=Object.prototype.hasOwnProperty,De=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),We=(e,r,t,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Ge(r))!Ye.call(e,i)&&i!==t&&pe(e,i,{get:()=>r[i],enumerable:!(s=_e(r,i))||s.enumerable});return e},Ve=(e,r,t)=>(t=e!=null?Fe(Le(e)):{},We(r||!e||!e.r?pe(t,"default",{value:e,enumerable:!0}):t,e)),Ue=De((e,r)=>{"use strict";function t(s){var i=void 0;typeof s=="string"?i=[s]:i=s.raw;for(var o="",n=0;n<i.length;n++)o+=i[n].replace(/\\\n[ \t]*/g,"").replace(/\\`/g,"`"),n<(arguments.length<=1?0:arguments.length-1)&&(o+=arguments.length<=n+1?void 0:arguments[n+1]);var g=o.split(`
30
- `),c=null;return g.forEach(function(a){var d=a.match(/^(\s+)\S+/);if(d){var x=d[1].length;c?c=Math.min(c,x):c=x}}),c!==null&&(o=g.map(function(a){return a[0]===" "?a.slice(c):a}).join(`
29
+ `;var P=m(require("upath"));var be=m(require("@master/css"));var H=require("@master/css");function G({content:e},{config:r,classes:t}){e=Me(e);let s=[...new Set(Object.keys(r.semantics??H.semantics).concat(Object.keys(t)))],i=e.match(/\S+/g)??[],o=new Set;for(let n of i){o.add(F(n,s));let p=q(n);if(p.size)for(let c of p)o.add(F(c,s))}return[...o].filter(n=>n&&!Ae(n,s))}var F=(e,r)=>{let t=e,s=e.match(/(?:calc\(.*\)|\d+(?:%|ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmax|vmin|vw|deg|grad|rad|turn|s)?)x(?:calc\(.*\)|\d+(?:%|ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmax|vmin|vw|deg|grad|rad|turn|s)?)/g);return(s?.length?r.concat(s):r).find(i=>t.startsWith(i))?e=_(e,i=>i.replace(/^[^:@~(]*(?<!@>?)=/,"").replace(/(?:[([{\\:#=.]+|["'`].*)$/,"")):e=_(e,i=>i.replace(/^[^:@~(]*(?:["'`]|(?<!@>?)=)/,"").replace(/(?:[([{\\:#=.]+|["'`].*)$/,"")),t===e||!e?e:F(e,r)},J=e=>e.match(/((?<!\\)["'`])(?:\\\1|(?:(?!\1))[\S\s])*(?<!\\)\1/g),K=(e,r)=>(r?.forEach((t,s)=>{e=e.replace(t,`COMPLETE-STRING--${s}--`)}),e),_=(e,r)=>{let t=J(e);return e=K(e,t),e=r(e),t?.forEach((s,i)=>{e=e.replace(`COMPLETE-STRING--${i}--`,s)}),e},q=e=>{let r=new Set,t=/((?<!\\)["'`])((?:\\\1|(?:(?!\1))[\S\s])*)((?<!\\)\1)/g,s;for(;(s=t.exec(e))!==null;){s.index===t.lastIndex&&t.lastIndex++,r.add(s[2]);let i=q(s[2]);if(i.size)for(let o of i)r.add(o)}return r},Me=e=>_(e,r=>r.replace(/\/\*(?:(?!\*\/)[\S\s])*\*\//g,"").replace(/<!--(?:(?!-->)[\S\s])*-->/g,"").replace(/\/\/.*/g,"").replace(/<style[^>]*>(?:(?!<\/style>)[\S\s])*<\/style>/g,"").replace(/import.*from\s*COMPLETE-STRING--\d+--/g,"").replace(/import\s*(?:COMPLETE-STRING--\d+--|\([^;\s]*\))/g,"").replace(/(?:require|import)\([^;\s]*\)/g,"").replace(/(?:@.*\n)+(?:export|function|class)/g,"")),Ae=(e,r)=>{let t=J(e),s=K(e,t),i=/{(.*)}/,o;for(;(o=i.exec(s))!==null;)return o[1].split(";").find(p=>X(p,r))!==void 0;return X(s,r)||Ie(e)},X=(e,r)=>!e||!e.match(/(?:\S*\{\S*\})|(?:^[\w\-()]+:\S+)|(?:^[\w-]+\(\S+\))|(?:^[@~]\S+$)/)&&!e.match(/^(?:calc\(.*\)|\d+(?:%|ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmax|vmin|vw|deg|grad|rad|turn|s)?)x(?:calc\(.*\)|\d+(?:%|ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmax|vmin|vw|deg|grad|rad|turn|s)?)$/)&&!r.find(t=>e.startsWith(t))||e.match(/\*\*/)||e.match(/:\[/)||e.match(/\$\{/)||e.match(/\{\{/)||e.match(/\(\{[^}]*\}/)||e.match(/<\w+>|<\/\w+>/)||e.match(/;$/)||e.match(/^\w+:\/\//)||e.match(/^@(?:ts-[^\s]+|charset|import|namespace|media|supports|document|page|font-face|keyframes|counter-style|font-feature-values|property|layer|[^/]+\/.*)$/)||e.match(/^~\/.+.\w+$/)||e.match(/function\(|\(.*\)=>/)||e.match(/^\$\(.*/),Ie=e=>{let r=[],t;for(let s=0;s<e.length;s++)switch(e[s]){case"(":case"[":case"{":r.push(e[s]);break;case")":case"]":case"}":if(t=r.pop(),e[s]===")"&&t!=="("||e[s]==="]"&&t!=="["||e[s]==="}"&&t!=="{")return!0;break}return r.length>0};var ve=m(require("fs")),B=m(require("fast-glob")),M=m(require("minimatch")),A=m(require("techor"));var j=m(require("node:process"),1),he=m(require("node:os"),1),D=m(require("node:tty"),1),Fe=Object.create,pe=Object.defineProperty,_e=Object.getOwnPropertyDescriptor,Ge=Object.getOwnPropertyNames,Le=Object.getPrototypeOf,Ye=Object.prototype.hasOwnProperty,De=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),We=(e,r,t,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Ge(r))!Ye.call(e,i)&&i!==t&&pe(e,i,{get:()=>r[i],enumerable:!(s=_e(r,i))||s.enumerable});return e},Ve=(e,r,t)=>(t=e!=null?Fe(Le(e)):{},We(r||!e||!e.r?pe(t,"default",{value:e,enumerable:!0}):t,e)),Ue=De((e,r)=>{"use strict";function t(s){var i=void 0;typeof s=="string"?i=[s]:i=s.raw;for(var o="",n=0;n<i.length;n++)o+=i[n].replace(/\\\n[ \t]*/g,"").replace(/\\`/g,"`"),n<(arguments.length<=1?0:arguments.length-1)&&(o+=arguments.length<=n+1?void 0:arguments[n+1]);var p=o.split(`
30
+ `),c=null;return p.forEach(function(a){var d=a.match(/^(\s+)\S+/);if(d){var x=d[1].length;c?c=Math.min(c,x):c=x}}),c!==null&&(o=p.map(function(a){return a[0]===" "?a.slice(c):a}).join(`
31
31
  `)),o=o.trim(),o.replace(/\\n/g,`
32
- `)}typeof r<"u"&&(r.exports=t)}),b=(e,r)=>{if(!e)throw new Error(r)},ze=e=>{let r={joined:!0,spacerNoNeighbour:" ",spacerNeighbour:"\u2502 ",keyNoNeighbour:"\u2514\u2500 ",keyNeighbour:"\u251C\u2500 ",separator:": ",renderFn:t=>["boolean","string","number"].includes(typeof t)?t:void 0,sortFn:null,breakCircularWith:" (circular ref.)",...e};return b(Object.keys(r).length===9,"Unexpected Option(s) provided"),b(typeof r.joined=="boolean",'Option "joined" has invalid format'),b(typeof r.spacerNoNeighbour=="string",'Option "spacerNoNeighbour" has invalid format'),b(typeof r.spacerNeighbour=="string",'Option "spacerNeighbour" has invalid format'),b(typeof r.keyNoNeighbour=="string",'Option "keyNoNeighbour" has invalid format'),b(typeof r.keyNeighbour=="string",'Option "keyNeighbour" has invalid format'),b(typeof r.separator=="string",'Option "separator" has invalid format'),b(typeof r.renderFn=="function",'Option "renderFn" has invalid format'),b(typeof r.sortFn=="function"||r.sortFn===null,'Option "sortFn" has invalid format'),b(typeof r.breakCircularWith=="string"||r.breakCircularWith===null,'Option "breakCircularWith" has invalid format'),r},ge=(e,r={})=>{let t=ze(r),s=[],i=t.renderFn(e);i!==void 0&&s.push(String(i));let o=a=>t.sortFn===null?a.reverse():a.sort((d,x)=>t.sortFn(x,d)),n=[],g=o(Object.keys(e)).map(a=>[a]),c=[e];for(;g.length!==0;){let a=g.pop(),d=c[a.length-1][a[a.length-1]],x=t.breakCircularWith!==null&&c.includes(d);n[a.length-1]=g.length!==0&&g[g.length-1].length===a.length;let $e=t.renderFn(d);s.push([n.slice(0,a.length-1).map(I=>I?t.spacerNeighbour:t.spacerNoNeighbour).join(""),n[a.length-1]?t.keyNeighbour:t.keyNoNeighbour,a[a.length-1],$e===void 0?"":`${t.separator}${d}`,x?t.breakCircularWith:""].join("")),d instanceof Object&&!Array.isArray(d)&&!x&&(g.push(...o(Object.keys(d)).map(I=>a.concat(I))),c[a.length]=d)}return t.joined===!0?s.join(`
33
- `):s},Z=(e=0)=>r=>`\x1B[${r+e}m`,Q=(e=0)=>r=>`\x1B[${38+e};5;${r}m`,ee=(e=0)=>(r,t,s)=>`\x1B[${38+e};2;${r};${t};${s}m`,u={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},St=Object.keys(u.modifier),Xe=Object.keys(u.color),He=Object.keys(u.bgColor),Rt=[...Xe,...He];function Je(){let e=new Map;for(let[r,t]of Object.entries(u)){for(let[s,i]of Object.entries(t))u[s]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[s]=u[s],e.set(i[0],i[1]);Object.defineProperty(u,r,{value:t,enumerable:!1})}return Object.defineProperty(u,"codes",{value:e,enumerable:!1}),u.color.close="\x1B[39m",u.bgColor.close="\x1B[49m",u.color.ansi=Z(),u.color.ansi256=Q(),u.color.ansi16m=ee(),u.bgColor.ansi=Z(10),u.bgColor.ansi256=Q(10),u.bgColor.ansi16m=ee(10),Object.defineProperties(u,{rgbToAnsi256:{value(r,t,s){return r===t&&t===s?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(t/255*5)+Math.round(s/255*5)},enumerable:!1},hexToRgb:{value(r){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(r.toString(16));if(!t)return[0,0,0];let[s]=t;s.length===3&&(s=[...s].map(o=>o+o).join(""));let i=Number.parseInt(s,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:r=>u.rgbToAnsi256(...u.hexToRgb(r)),enumerable:!1},ansi256ToAnsi:{value(r){if(r<8)return 30+r;if(r<16)return 90+(r-8);let t,s,i;if(r>=232)t=((r-232)*10+8)/255,s=t,i=t;else{r-=16;let g=r%36;t=Math.floor(r/36)/5,s=Math.floor(g/6)/5,i=g%6/5}let o=Math.max(t,s,i)*2;if(o===0)return 30;let n=30+(Math.round(i)<<2|Math.round(s)<<1|Math.round(t));return o===2&&(n+=60),n},enumerable:!1},rgbToAnsi:{value:(r,t,s)=>u.ansi256ToAnsi(u.rgbToAnsi256(r,t,s)),enumerable:!1},hexToAnsi:{value:r=>u.ansi256ToAnsi(u.hexToAnsi256(r)),enumerable:!1}}),u}var Ke=Je(),v=Ke;function f(e,r=globalThis.Deno?globalThis.Deno.args:j.default.argv){let t=e.startsWith("-")?"":e.length===1?"-":"--",s=r.indexOf(t+e),i=r.indexOf("--");return s!==-1&&(i===-1||s<i)}var{env:p}=j.default,k;f("no-color")||f("no-colors")||f("color=false")||f("color=never")?k=0:(f("color")||f("colors")||f("color=true")||f("color=always"))&&(k=1);function qe(){if("FORCE_COLOR"in p)return p.FORCE_COLOR==="true"?1:p.FORCE_COLOR==="false"?0:p.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(p.FORCE_COLOR,10),3)}function Ze(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Qe(e,{streamIsTTY:r,sniffFlags:t=!0}={}){let s=qe();s!==void 0&&(k=s);let i=t?k:s;if(i===0)return 0;if(t){if(f("color=16m")||f("color=full")||f("color=truecolor"))return 3;if(f("color=256"))return 2}if("TF_BUILD"in p&&"AGENT_NAME"in p)return 1;if(e&&!r&&i===void 0)return 0;let o=i||0;if(p.TERM==="dumb")return o;if(j.default.platform==="win32"){let n=he.default.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in p)return"GITHUB_ACTIONS"in p?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(n=>n in p)||p.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in p)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(p.TEAMCITY_VERSION)?1:0;if(p.COLORTERM==="truecolor"||p.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in p){let n=Number.parseInt((p.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(p.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(p.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(p.TERM)||"COLORTERM"in p?1:o}function te(e,r={}){let t=Qe(e,{streamIsTTY:e&&e.isTTY,...r});return Ze(t)}var et={stdout:te({isTTY:D.default.isatty(1)}),stderr:te({isTTY:D.default.isatty(2)})},tt=et;function rt(e,r,t){let s=e.indexOf(r);if(s===-1)return e;let i=r.length,o=0,n="";do n+=e.slice(o,s)+r+t,o=s+i,s=e.indexOf(r,o);while(s!==-1);return n+=e.slice(o),n}function st(e,r,t,s){let i=0,o="";do{let n=e[s-1]==="\r";o+=e.slice(i,n?s-1:s)+r+(n?`\r
32
+ `)}typeof r<"u"&&(r.exports=t)}),b=(e,r)=>{if(!e)throw new Error(r)},ze=e=>{let r={joined:!0,spacerNoNeighbour:" ",spacerNeighbour:"\u2502 ",keyNoNeighbour:"\u2514\u2500 ",keyNeighbour:"\u251C\u2500 ",separator:": ",renderFn:t=>["boolean","string","number"].includes(typeof t)?t:void 0,sortFn:null,breakCircularWith:" (circular ref.)",...e};return b(Object.keys(r).length===9,"Unexpected Option(s) provided"),b(typeof r.joined=="boolean",'Option "joined" has invalid format'),b(typeof r.spacerNoNeighbour=="string",'Option "spacerNoNeighbour" has invalid format'),b(typeof r.spacerNeighbour=="string",'Option "spacerNeighbour" has invalid format'),b(typeof r.keyNoNeighbour=="string",'Option "keyNoNeighbour" has invalid format'),b(typeof r.keyNeighbour=="string",'Option "keyNeighbour" has invalid format'),b(typeof r.separator=="string",'Option "separator" has invalid format'),b(typeof r.renderFn=="function",'Option "renderFn" has invalid format'),b(typeof r.sortFn=="function"||r.sortFn===null,'Option "sortFn" has invalid format'),b(typeof r.breakCircularWith=="string"||r.breakCircularWith===null,'Option "breakCircularWith" has invalid format'),r},ge=(e,r={})=>{let t=ze(r),s=[],i=t.renderFn(e);i!==void 0&&s.push(String(i));let o=a=>t.sortFn===null?a.reverse():a.sort((d,x)=>t.sortFn(x,d)),n=[],p=o(Object.keys(e)).map(a=>[a]),c=[e];for(;p.length!==0;){let a=p.pop(),d=c[a.length-1][a[a.length-1]],x=t.breakCircularWith!==null&&c.includes(d);n[a.length-1]=p.length!==0&&p[p.length-1].length===a.length;let $e=t.renderFn(d);s.push([n.slice(0,a.length-1).map(I=>I?t.spacerNeighbour:t.spacerNoNeighbour).join(""),n[a.length-1]?t.keyNeighbour:t.keyNoNeighbour,a[a.length-1],$e===void 0?"":`${t.separator}${d}`,x?t.breakCircularWith:""].join("")),d instanceof Object&&!Array.isArray(d)&&!x&&(p.push(...o(Object.keys(d)).map(I=>a.concat(I))),c[a.length]=d)}return t.joined===!0?s.join(`
33
+ `):s},Z=(e=0)=>r=>`\x1B[${r+e}m`,Q=(e=0)=>r=>`\x1B[${38+e};5;${r}m`,ee=(e=0)=>(r,t,s)=>`\x1B[${38+e};2;${r};${t};${s}m`,u={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},St=Object.keys(u.modifier),Xe=Object.keys(u.color),He=Object.keys(u.bgColor),Rt=[...Xe,...He];function Je(){let e=new Map;for(let[r,t]of Object.entries(u)){for(let[s,i]of Object.entries(t))u[s]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[s]=u[s],e.set(i[0],i[1]);Object.defineProperty(u,r,{value:t,enumerable:!1})}return Object.defineProperty(u,"codes",{value:e,enumerable:!1}),u.color.close="\x1B[39m",u.bgColor.close="\x1B[49m",u.color.ansi=Z(),u.color.ansi256=Q(),u.color.ansi16m=ee(),u.bgColor.ansi=Z(10),u.bgColor.ansi256=Q(10),u.bgColor.ansi16m=ee(10),Object.defineProperties(u,{rgbToAnsi256:{value(r,t,s){return r===t&&t===s?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(t/255*5)+Math.round(s/255*5)},enumerable:!1},hexToRgb:{value(r){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(r.toString(16));if(!t)return[0,0,0];let[s]=t;s.length===3&&(s=[...s].map(o=>o+o).join(""));let i=Number.parseInt(s,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:r=>u.rgbToAnsi256(...u.hexToRgb(r)),enumerable:!1},ansi256ToAnsi:{value(r){if(r<8)return 30+r;if(r<16)return 90+(r-8);let t,s,i;if(r>=232)t=((r-232)*10+8)/255,s=t,i=t;else{r-=16;let p=r%36;t=Math.floor(r/36)/5,s=Math.floor(p/6)/5,i=p%6/5}let o=Math.max(t,s,i)*2;if(o===0)return 30;let n=30+(Math.round(i)<<2|Math.round(s)<<1|Math.round(t));return o===2&&(n+=60),n},enumerable:!1},rgbToAnsi:{value:(r,t,s)=>u.ansi256ToAnsi(u.rgbToAnsi256(r,t,s)),enumerable:!1},hexToAnsi:{value:r=>u.ansi256ToAnsi(u.hexToAnsi256(r)),enumerable:!1}}),u}var Ke=Je(),v=Ke;function f(e,r=globalThis.Deno?globalThis.Deno.args:j.default.argv){let t=e.startsWith("-")?"":e.length===1?"-":"--",s=r.indexOf(t+e),i=r.indexOf("--");return s!==-1&&(i===-1||s<i)}var{env:g}=j.default,k;f("no-color")||f("no-colors")||f("color=false")||f("color=never")?k=0:(f("color")||f("colors")||f("color=true")||f("color=always"))&&(k=1);function qe(){if("FORCE_COLOR"in g)return g.FORCE_COLOR==="true"?1:g.FORCE_COLOR==="false"?0:g.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(g.FORCE_COLOR,10),3)}function Ze(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Qe(e,{streamIsTTY:r,sniffFlags:t=!0}={}){let s=qe();s!==void 0&&(k=s);let i=t?k:s;if(i===0)return 0;if(t){if(f("color=16m")||f("color=full")||f("color=truecolor"))return 3;if(f("color=256"))return 2}if("TF_BUILD"in g&&"AGENT_NAME"in g)return 1;if(e&&!r&&i===void 0)return 0;let o=i||0;if(g.TERM==="dumb")return o;if(j.default.platform==="win32"){let n=he.default.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in g)return"GITHUB_ACTIONS"in g?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(n=>n in g)||g.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in g)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(g.TEAMCITY_VERSION)?1:0;if(g.COLORTERM==="truecolor"||g.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in g){let n=Number.parseInt((g.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(g.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(g.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(g.TERM)||"COLORTERM"in g?1:o}function te(e,r={}){let t=Qe(e,{streamIsTTY:e&&e.isTTY,...r});return Ze(t)}var et={stdout:te({isTTY:D.default.isatty(1)}),stderr:te({isTTY:D.default.isatty(2)})},tt=et;function rt(e,r,t){let s=e.indexOf(r);if(s===-1)return e;let i=r.length,o=0,n="";do n+=e.slice(o,s)+r+t,o=s+i,s=e.indexOf(r,o);while(s!==-1);return n+=e.slice(o),n}function st(e,r,t,s){let i=0,o="";do{let n=e[s-1]==="\r";o+=e.slice(i,n?s-1:s)+r+(n?`\r
34
34
  `:`
35
35
  `)+t,i=s+1,s=e.indexOf(`
36
36
  `,i)}while(s!==-1);return o+=e.slice(i),o}var{stdout:re,stderr:se}=tt,W=Symbol("GENERATOR"),$=Symbol("STYLER"),E=Symbol("IS_EMPTY"),ie=["ansi","ansi","ansi256","ansi16m"],w=Object.create(null),it=(e,r={})=>{if(r.level&&!(Number.isInteger(r.level)&&r.level>=0&&r.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=re?re.level:0;e.level=r.level===void 0?t:r.level},ot=e=>{let r=(...t)=>t.join(" ");return it(r,e),Object.setPrototypeOf(r,C.prototype),r};function C(e){return ot(e)}Object.setPrototypeOf(C.prototype,Function.prototype);for(let[e,r]of Object.entries(v))w[e]={get(){let t=N(this,U(r.open,r.close,this[$]),this[E]);return Object.defineProperty(this,e,{value:t}),t}};w.visible={get(){let e=N(this,this[$],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var V=(e,r,t,...s)=>e==="rgb"?r==="ansi16m"?v[t].ansi16m(...s):r==="ansi256"?v[t].ansi256(v.rgbToAnsi256(...s)):v[t].ansi(v.rgbToAnsi(...s)):e==="hex"?V("rgb",r,t,...v.hexToRgb(...s)):v[t][e](...s),nt=["rgb","hex","ansi256"];for(let e of nt){w[e]={get(){let{level:t}=this;return function(...s){let i=U(V(e,ie[t],"color",...s),v.color.close,this[$]);return N(this,i,this[E])}}};let r="bg"+e[0].toUpperCase()+e.slice(1);w[r]={get(){let{level:t}=this;return function(...s){let i=U(V(e,ie[t],"bgColor",...s),v.bgColor.close,this[$]);return N(this,i,this[E])}}}}var lt=Object.defineProperties(()=>{},{...w,level:{enumerable:!0,get(){return this[W].level},set(e){this[W].level=e}}}),U=(e,r,t)=>{let s,i;return t===void 0?(s=e,i=r):(s=t.openAll+e,i=r+t.closeAll),{open:e,close:r,openAll:s,closeAll:i,parent:t}},N=(e,r,t)=>{let s=(...i)=>at(s,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(s,lt),s[W]=e,s[$]=r,s[E]=t,s},at=(e,r)=>{if(e.level<=0||!r)return e[E]?"":r;let t=e[$];if(t===void 0)return r;let{openAll:s,closeAll:i}=t;if(r.includes("\x1B"))for(;t!==void 0;)r=rt(r,t.close,t.open),t=t.parent;let o=r.indexOf(`
37
37
  `);return o!==-1&&(r=st(r,i,s,o)),s+r+i};Object.defineProperties(C.prototype,w);var ct=C(),kt=C({level:se?se.level:0}),l=ct;function y(e){return e.split(" ").map(r=>r.replace(/^(\d*\.?\d*)$/g,`${l.blue("$1")}`).replace(/^(\d*\.?\d*)(YB|ZB|EB|PB|TB|GB|MB|KB|B|mb|kb|kB|bit|zs|as|fs|ps|ns|µs|ms|s|m|h|d|m|y)$/g,`${l.cyan("$1")}${l.magenta("$2")}`).replace(/^((?:[0-1]?[0-9]|[2][0-3]):[0-5][0-9]:[0-5][0-9] (?:AM|PM)?)$/g,`${l.dim("$1")}`).replace(/^\[(.*?)\]$/g,`${l.dim("[")}${l.magenta("$1")}${l.dim("]")}`).replace(/^`(.*?)`$/g,`${l.dim("`")}$1${l.dim("`")}`).replace(/^\((.*?)\)$/g,`${l.dim("(")}$1${l.dim(")")}`).replace(/^<(.*?)>$/g,`${l.dim("<")}${l.gray("$1")}${l.dim(">")}`).replace(/->/g,l.dim("\u2192")).replace(/<-/g,l.dim("\u2190")).replace(/^\$t$/g,`${l.dim(new Date().toLocaleTimeString())}`).replace(/^\*\*(.*?)\*\*$/g,`${l.bold.white("$1")}`).replace(/^~~(.*?)~~$/g,`${l.strikethrough("$1")}`).replace(/^__(.*?)__$/g,`${l.underline("$1")}`).replace(/^\.\.(.*?)\.\.$/g,`${l.dim("$1")}`).replace(/^!!(.*?)!!$/g,`${l.yellow("$1")}`).replace(/^\*(.*?)\*$/g,`${l.italic("$1")}`).replace(/^_(.*?)_$/g,`${l.italic("$1")}`).replace(/^\+(.*?)\+$/g,`${l.green("$1")}`).replace(/^-(.*?)-$/g,`${l.red("$1")}`)).join(" ")}function h(e,r){let t="";if(Array.isArray(e))for(let s=0;s<e.length;s++)t+=L(e[s])+L(r[s]);else t=[e,...r].map(s=>L(s)).join(" ");return y(t)}var L=e=>e?Array.isArray(e)?e.map(r=>{switch(typeof r){case"string":return`'${l.yellow(r)}'`;case"number":case"boolean":return l.blue(r);default:return r}}).join(l.gray(", ")):e:"",oe=(e,...r)=>{let t=l.green("+")+" "+h(e,r);return console.log(t),t},ne=(e,...r)=>{let t=l.bgRed.bold.white(" \u{1D5EB} ERROR ")+" "+h(e,r);return console.log(t),t},ut=(e,...r)=>{let t=l.bgYellow.bold.white(" \u26A0\uFE0F CONFLICT ")+" "+l.yellow(h(e,r));return console.log(t),t},pt=(e,...r)=>{let t=l.green("\u2713 ")+h(e,r);return console.log(t),t},Y=(e,...r)=>{let t=l.red("-")+" "+h(e,r);return console.log(t),t},le=(e,...r)=>{let t=l.green("\u25CB ")+h(e,r);return console.log(t),t},ae=(e,...r)=>{let t=l.red("\u2717 ")+h(e,r);return console.log(t),t},ce=(e,...r)=>{let t=l.cyan("\u{1D4F2}")+" "+h(e,r);return console.log(t),t},gt=(e,...r)=>{let t=l.green("\u23FA Success ")+h(e,r);return console.log(t),t},ht=(e,...r)=>{let t=l.yellow("\u23FA Warn ")+h(e,r);return console.log(t),t},dt=(e,...r)=>{let t=l.bgGreen.bold.white(" \u2713 PASS ")+" "+h(e,r);return console.log(t),t},ft=e=>{let r=ge(fe(de(JSON.parse(JSON.stringify(e)))),{spacerNeighbour:y("..\u2502..")+" ",keyNoNeighbour:y("..\u2514\u2500..")+" ",keyNeighbour:y("..\u251C\u2500..")+" ",separator:y("..:..")+" "});return console.log(r),r};function de(e){for(let r in e){let t=e[r];typeof t=="object"?t!==null&&!Object.keys(t).length?delete e[r]:e[r]=de(t):t===void 0&&delete e[r]}return e}function fe(e){for(let r in e){let t=e[r];Array.isArray(t)?e[r]=t.map(s=>y(`**${s}**`)).join(y("..,..")):typeof t=="object"?fe(t):e[r]=y(`**${t}**`)}return e}var mt=(e,...r)=>{let t=l.red("\u23FA Fail ")+h(e,r);return console.log(t),t},ue=(e,...r)=>{let t=y("$t ")+h(e,r);return console.log(t),t},bt=Ve(Ue());function vt(e){let{message:r,stack:t}=typeof e=="string"?new Error(e):e,s={};return(0,bt.default)(t.replace(r,"").replace(/^Error: /,"")).split(`
38
- `).forEach(i=>{s[i.split(" ").map(o=>o.replace(/^\((.+)\)$/,`${l.cyan("$1")}`).replace(/\./g,`${l.dim(".")}`).replace(/^at$/,n=>l.dim(n))).join(" ")]=null}),{message:r.trim().replace(/Error: /g,""),stackTree:s}}var me=(e,...r)=>{if(e instanceof Error){let{message:t,stackTree:s}=vt(e);return console.log(""),console.log(l.bgRed.bold.white(" \u{1D5EB} ERROR ")+" "+l.bold.red(t)),console.log(ge(s,{spacerNeighbour:l.redBright.dim("\u2502\u2000\u2000"),keyNoNeighbour:l.redBright.dim("\u2514\u2500\u2000"),keyNeighbour:l.redBright.dim("\u251C\u2500 "),separator:l.redBright.dim(":\u2000")})),console.log(""),t}else{let t=h(e,r);return console.log(t),t}};Object.assign(me,{a:oe,add:oe,d:Y,del:Y,delete:Y,o:le,valid:le,x:ae,invalid:ae,i:ce,info:ce,e:ne,error:ne,t:ue,timestamp:ue,success:gt,fail:mt,warn:ht,pass:dt,conflict:ut,ok:pt,tree:ft,paint:y});var O=me;var ye=m(require("stylelint")),Oe=require("@techor/extend"),xe=m(require("cross-import")),S=class extends A.default{constructor(t){super(T,t);this.customOptions=t;this.init(t)}css;extractions=new Set;validExtractions=new Set;invalidExtractions=new Set;get resolvedModuleId(){return"\0"+this.options.module}get moduleHMREvent(){return`HMR:${this.options.module}`}init(t=this.customOptions){this.options=(0,Oe.extend)(A.options,T,this.readOptions(),t),this.css=new be.default({...typeof this.options.config=="object"?this.options.config:this.readConfig()||{},observe:!1})}logOptionsFound=t=>O.ok`**${t}** file found`;logOptionsNotFound=t=>O.i`No **${t}** file found`;readOptions(t="options"){let{cwd:s}=this.options;if(typeof this.options.path=="object")return this.options.path;let i;try{let o=this.optionsPath;if(o){let n=(0,xe.default)(o,{cwd:s});i=(t?n[t]:void 0)||n.default||n,this.logOptionsFound(o)}else this.logOptionsNotFound(this.options.path)}catch(o){O.error(o)}return i}get optionsPath(){if(!(!this.options.path||typeof this.options.path!="string"))return B.default.sync(this.options.path,{cwd:this.options.cwd})[0]}get resolvedOptionsPath(){let t=this.optionsPath;return t?P.default.resolve(this.options.cwd,t):""}async refresh(t=this.customOptions){return this.extractions.clear(),this.validExtractions.clear(),this.invalidExtractions.clear(),console.log(""),this.init(t),await this.compile(),this}async compile(){if(this.options.classes?.fixed?.length)for(let t of this.options.classes.fixed)this.css.insert(t);return await Promise.all(this.sources.map(async t=>{let s=ve.default.readFileSync(P.default.resolve(this.options.cwd,t),{encoding:"utf-8"}).toString();await this.insert(t,s)})),this}extract(t,s){if(!t||!s||!this.checkSourcePath(t))return[];let i=[];for(let o of G({content:s,name:t},this.css))this.extractions.has(o)||(this.extractions.add(o),i.push(o));return i}async insert(t,s){let i=this.extract(t,s);if(!i.length)return!1;this.invalidExtractions.size&&(i=i.filter(c=>!this.invalidExtractions.has(c))),this.validExtractions.size&&(i=i.filter(c=>!this.validExtractions.has(c))),this.options.classes?.ignored?.length&&(i=i.filter(c=>{for(let a of this.options.classes.ignored)if(typeof a=="string"){if(a===c)return!1}else if(a.test(c))return!1;return!0}));let o=process.hrtime(),n=[];await Promise.all(i.map(async c=>{let a=await this.createRules(c);a.length?(this.css.insertRules(a),n.push(c),this.validExtractions.add(c)):this.invalidExtractions.add(c)})),o=process.hrtime(o);let g=Math.round((o[0]*1e9+o[1])/1e6*10)/10;if(i.length&&(console.log(""),O`**${P.default.relative(this.options.cwd,t)}**`,O`[extract] ${i.length} potential`),this.css.rules.length){let c=n.filter(a=>!i.includes(a));c.length&&O`[exclude] ${c.length} unknown ${c}`,O`[compile] +${n.length}+ valid inserted ${l.gray("in")} ${g}ms ${n}`,O`[virtual] ${this.css.rules.length} total ${l.gray("in")} ${this.options.module}`}return!0}async createRules(t){return(await Promise.all(this.css.create(t).map(async i=>(await ye.default.lint({code:i.text,cache:!1,config:{rules:{"color-no-invalid-hex":!0,"named-grid-areas-no-invalid":!0,"at-rule-no-unknown":!0,"function-no-unknown":!0,"media-feature-name-no-unknown":!0,"property-no-unknown":!0,"selector-pseudo-class-no-unknown":!0,"selector-pseudo-element-no-unknown":!0,"selector-type-no-unknown":!0,"unit-no-unknown":!0}}})).errored?null:i))).filter(i=>i)}get sources(){let{include:t,exclude:s,sources:i,cwd:o}=this.options,n=B.default.sync(t,{cwd:o,ignore:s});return i?.length&&n.push(...B.default.sync(i,{cwd:o})),n.filter(g=>!!g)}checkSourcePath(t){let{include:s,exclude:i,sources:o}=this.options;for(let n of o)if((0,M.default)(t,n))return!0;for(let n of s)if(!(0,M.default)(t,n))return!1;for(let n of i)if((0,M.default)(t,n))return!1;return!0}get config(){return this.css.config}};0&&(module.exports={MasterCSSCompiler,OPTIONS_ESM_TEXT,OPTIONS_TEXT,OPTIONS_TS_TEXT,options});
38
+ `).forEach(i=>{s[i.split(" ").map(o=>o.replace(/^\((.+)\)$/,`${l.cyan("$1")}`).replace(/\./g,`${l.dim(".")}`).replace(/^at$/,n=>l.dim(n))).join(" ")]=null}),{message:r.trim().replace(/Error: /g,""),stackTree:s}}var me=(e,...r)=>{if(e instanceof Error){let{message:t,stackTree:s}=vt(e);return console.log(""),console.log(l.bgRed.bold.white(" \u{1D5EB} ERROR ")+" "+l.bold.red(t)),console.log(ge(s,{spacerNeighbour:l.redBright.dim("\u2502\u2000\u2000"),keyNoNeighbour:l.redBright.dim("\u2514\u2500\u2000"),keyNeighbour:l.redBright.dim("\u251C\u2500 "),separator:l.redBright.dim(":\u2000")})),console.log(""),t}else{let t=h(e,r);return console.log(t),t}};Object.assign(me,{a:oe,add:oe,d:Y,del:Y,delete:Y,o:le,valid:le,x:ae,invalid:ae,i:ce,info:ce,e:ne,error:ne,t:ue,timestamp:ue,success:gt,fail:mt,warn:ht,pass:dt,conflict:ut,ok:pt,tree:ft,paint:y});var O=me;var ye=m(require("stylelint")),Oe=require("@techor/extend"),xe=m(require("cross-import")),S=class extends A.default{constructor(t){super(T,t);this.customOptions=t;this.init(t)}css;extractions=new Set;validExtractions=new Set;invalidExtractions=new Set;get resolvedModuleId(){return"\0"+this.options.module}get moduleHMREvent(){return`HMR:${this.options.module}`}init(t=this.customOptions){this.options=(0,Oe.extend)(A.options,T,this.readOptions(),t),this.options.standalone&&this.options.exclude.push("**/node_modules/**","node_modules"),this.css=new be.default({...typeof this.options.config=="object"?this.options.config:this.readConfig()||{},observe:!1})}logOptionsFound=t=>O.ok`**${t}** file found`;logOptionsNotFound=t=>O.i`No **${t}** file found`;readOptions(t="options"){let{cwd:s}=this.options;if(typeof this.options.path=="object")return this.options.path;let i;try{let o=this.optionsPath;if(o){let n=(0,xe.default)(o,{cwd:s});i=(t?n[t]:void 0)||n.default||n,this.logOptionsFound(o)}else this.logOptionsNotFound(this.options.path)}catch(o){O.error(o)}return i}get optionsPath(){if(!(!this.options.path||typeof this.options.path!="string"))return B.default.sync(this.options.path,{cwd:this.options.cwd})[0]}get resolvedOptionsPath(){let t=this.optionsPath;return t?P.default.resolve(this.options.cwd,t):""}async refresh(t=this.customOptions){return this.extractions.clear(),this.validExtractions.clear(),this.invalidExtractions.clear(),console.log(""),this.init(t),await this.compile(),this}async compile(){if(this.options.classes?.fixed?.length)for(let t of this.options.classes.fixed)this.css.insert(t);return await Promise.all(this.sources.map(async t=>{let s=ve.default.readFileSync(P.default.resolve(this.options.cwd,t),{encoding:"utf-8"}).toString();await this.insert(t,s)})),this}extract(t,s){if(!t||!s||!this.checkSourcePath(t))return[];let i=[];for(let o of G({content:s,name:t},this.css))this.extractions.has(o)||(this.extractions.add(o),i.push(o));return i}async insert(t,s){let i=this.extract(t,s);if(!i.length)return!1;this.invalidExtractions.size&&(i=i.filter(c=>!this.invalidExtractions.has(c))),this.validExtractions.size&&(i=i.filter(c=>!this.validExtractions.has(c))),this.options.classes?.ignored?.length&&(i=i.filter(c=>{for(let a of this.options.classes.ignored)if(typeof a=="string"){if(a===c)return!1}else if(a.test(c))return!1;return!0}));let o=process.hrtime(),n=[];await Promise.all(i.map(async c=>{let a=await this.createRules(c);a.length?(this.css.insertRules(a),n.push(c),this.validExtractions.add(c)):this.invalidExtractions.add(c)})),o=process.hrtime(o);let p=Math.round((o[0]*1e9+o[1])/1e6*10)/10;if(i.length&&(console.log(""),O`**${P.default.relative(this.options.cwd,t)}**`,O`[extract] ${i.length} potential`),this.css.rules.length){let c=n.filter(a=>!i.includes(a));c.length&&O`[exclude] ${c.length} unknown ${c}`,O`[compile] +${n.length}+ valid inserted ${l.gray("in")} ${p}ms ${n}`,O`[virtual] ${this.css.rules.length} total ${l.gray("in")} ${this.options.module}`}return!0}async createRules(t){return(await Promise.all(this.css.create(t).map(async i=>(await ye.default.lint({code:i.text,cache:!1,config:{rules:{"color-no-invalid-hex":!0,"named-grid-areas-no-invalid":!0,"at-rule-no-unknown":!0,"function-no-unknown":!0,"media-feature-name-no-unknown":!0,"property-no-unknown":!0,"selector-pseudo-class-no-unknown":!0,"selector-pseudo-element-no-unknown":!0,"selector-type-no-unknown":!0,"unit-no-unknown":!0}}})).errored?null:i))).filter(i=>i)}get sources(){let{standalone:t,include:s,exclude:i,sources:o,cwd:n}=this.options,p=[];return t&&(p=B.default.sync(s,{cwd:n,ignore:i})),o?.length&&p.push(...B.default.sync(o,{cwd:n})),p.filter(c=>!!c)}checkSourcePath(t){let{include:s,exclude:i,sources:o}=this.options;for(let n of o)if((0,M.default)(t,n))return!0;for(let n of s)if(!(0,M.default)(t,n))return!1;for(let n of i)if((0,M.default)(t,n))return!1;return!0}get config(){return this.css.config}};0&&(module.exports={MasterCSSCompiler,OPTIONS_ESM_TEXT,OPTIONS_TEXT,OPTIONS_TS_TEXT,options});
@@ -7,6 +7,7 @@ export declare type Source = {
7
7
  content: string;
8
8
  };
9
9
  export interface Options extends TechorOptions<Config> {
10
+ standalone?: boolean;
10
11
  output?: string;
11
12
  path?: string;
12
13
  module?: string;
@@ -1 +1 @@
1
- var r=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var p=(s,t)=>{for(var o in t)r(s,o,{get:t[o],enumerable:!0})},d=(s,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of a(t))!c.call(s,e)&&e!==o&&r(s,e,{get:()=>t[e],enumerable:!(n=i(t,e))||n.enumerable});return s};var l=s=>d(r({},"__esModule",{value:!0}),s);var g={};p(g,{default:()=>u});module.exports=l(g);var m={path:"master.css-compiler.*",module:"master.css",config:"master.css.*",sources:[],include:["**/*.{html,js,jsx,ts,tsx,svelte,astro,vue,md,mdx,pug,php}"],exclude:["**/node_modules/**","**/*.d.ts","**/*.test.*","**/*.config.*","node_modules","master.css.*","dist","out","styles","public","README.md"],classes:{fixed:[],ignored:[]}},u=m;
1
+ var r=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var p=(s,t)=>{for(var o in t)r(s,o,{get:t[o],enumerable:!0})},l=(s,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of i(t))!c.call(s,e)&&e!==o&&r(s,e,{get:()=>t[e],enumerable:!(n=a(t,e))||n.enumerable});return s};var d=s=>l(r({},"__esModule",{value:!0}),s);var g={};p(g,{default:()=>u});module.exports=d(g);var m={standalone:!0,path:"master.css-compiler.*",module:"master.css",config:"master.css.*",sources:[],include:["**/*.{html,js,jsx,ts,tsx,svelte,astro,vue,md,mdx,pug,php}"],exclude:["**/*.d.ts","**/*.test.*","**/*.config.*","master.css.*","dist","out","styles","public","README.md"],classes:{fixed:[],ignored:[]}},u=m;
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@master/css-compiler","scripts":{"build":"techor pack --platform node","dev":"npm run build -- --watch","lint":"eslint ./src","type-check":"tsc --noEmit","test":"jest --forceExit --detectOpenHandles"},"license":"MIT","description":"The ahead-of-time compiler of Master CSS","author":"Aoyue Design LLC.","funding":"https://docs.master.co/css/donate","homepage":"https://css.master.co","bugs":{"url":"https://github.com/master-co/css/issues"},"repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/compiler"},"keywords":["webpack","plugin","integration","vite","parcel","build tools","css","mastercss","vite-plugin"],"sideEffects":false,"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":"./dist/index.js","./options":"./dist/options/index.js"},"typesVersions":{"*":{".":["./dist/index.d.js"],"./options":["./dist/options/index.d.ts"]}},"files":["dist"],"publishConfig":{"access":"public"},"dependencies":{"@master/css":"^2.0.0-beta.150","@techor/extend":"^2.1.15","cross-import":"^2.1.15","fast-glob":"^3.2.12","minimatch":"^5.1.1","stylelint":"^15.2.0","techor":"^2.1.15","upath":"^2.0.1"},"devDependencies":{"ts-jest":"^29.0.5"},"version":"2.0.0-beta.150"}
1
+ {"name":"@master/css-compiler","scripts":{"build":"techor pack --platform node","dev":"npm run build -- --watch","lint":"eslint ./src","type-check":"tsc --noEmit","test":"jest --forceExit --detectOpenHandles"},"license":"MIT","description":"The ahead-of-time compiler of Master CSS","author":"Aoyue Design LLC.","funding":"https://docs.master.co/css/donate","homepage":"https://css.master.co","bugs":{"url":"https://github.com/master-co/css/issues"},"repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/compiler"},"keywords":["webpack","plugin","integration","vite","parcel","build tools","css","mastercss","vite-plugin"],"sideEffects":false,"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":"./dist/index.js","./options":"./dist/options/index.js"},"typesVersions":{"*":{".":["./dist/index.d.js"],"./options":["./dist/options/index.d.ts"]}},"files":["dist"],"publishConfig":{"access":"public"},"dependencies":{"@master/css":"^2.0.0-beta.152","@techor/extend":"^2.1.15","cross-import":"^2.1.15","fast-glob":"^3.2.12","minimatch":"^5.1.1","stylelint":"^15.2.0","techor":"^2.1.15","upath":"^2.0.1"},"devDependencies":{"ts-jest":"^29.0.5"},"version":"2.0.0-beta.152"}