wallace-cli
Version:
Pretty CSS analytics on the CLI
7 lines • 109 kB
JavaScript
#!/usr/bin/env node
var ac=Object.create;var Xr=Object.defineProperty;var lc=Object.getOwnPropertyDescriptor;var cc=Object.getOwnPropertyNames;var uc=Object.getPrototypeOf,hc=Object.prototype.hasOwnProperty;var Fe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),k=(t,e)=>{for(var r in e)Xr(t,r,{get:e[r],enumerable:!0})},pc=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of cc(e))!hc.call(t,i)&&i!==r&&Xr(t,i,{get:()=>e[i],enumerable:!(n=lc(e,i))||n.enumerable});return t};var Vs=(t,e,r)=>(r=t!=null?ac(uc(t)):{},pc(e||!t||!t.__esModule?Xr(r,"default",{value:t,enumerable:!0}):r,t));var Ys=Fe((Xf,Zr)=>{var $t=process||{},Hs=$t.argv||[],Yt=$t.env||{},fc=!(Yt.NO_COLOR||Hs.includes("--no-color"))&&(!!Yt.FORCE_COLOR||Hs.includes("--color")||$t.platform==="win32"||($t.stdout||{}).isTTY&&Yt.TERM!=="dumb"||!!Yt.CI),mc=(t,e,r=t)=>n=>{let i=""+n,s=i.indexOf(e,t.length);return~s?t+dc(i,e,r,s)+e:t+i+e},dc=(t,e,r,n)=>{let i="",s=0;do i+=t.substring(s,n)+r,s=n+e.length,n=t.indexOf(e,s);while(~n);return i+t.substring(s)},Gs=(t=fc)=>{let e=t?mc:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};Zr.exports=Gs();Zr.exports.createColors=Gs});var hl=Fe(Qo=>{var ul="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");Qo.encode=function(t){if(0<=t&&t<ul.length)return ul[t];throw new TypeError("Must be between 0 and 63: "+t)};Qo.decode=function(t){var e=65,r=90,n=97,i=122,s=48,a=57,u=43,c=47,o=26,l=52;return e<=t&&t<=r?t-e:n<=t&&t<=i?t-n+o:s<=t&&t<=a?t-s+l:t==u?62:t==c?63:-1}});var xl=Fe(Jo=>{var pl=hl(),Ko=5,fl=1<<Ko,ml=fl-1,dl=fl;function Wp(t){return t<0?(-t<<1)+1:(t<<1)+0}function zp(t){var e=(t&1)===1,r=t>>1;return e?-r:r}Jo.encode=function(e){var r="",n,i=Wp(e);do n=i&ml,i>>>=Ko,i>0&&(n|=dl),r+=pl.encode(n);while(i>0);return r};Jo.decode=function(e,r,n){var i=e.length,s=0,a=0,u,c;do{if(r>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(c=pl.decode(e.charCodeAt(r++)),c===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));u=!!(c&dl),c&=ml,s=s+(c<<a),a+=Ko}while(u);n.value=zp(s),n.rest=r}});var Sr=Fe(Q=>{function jp(t,e,r){if(e in t)return t[e];if(arguments.length===3)return r;throw new Error('"'+e+'" is a required argument.')}Q.getArg=jp;var kl=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Vp=/^data:.+\,.+$/;function Ft(t){var e=t.match(kl);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}Q.urlParse=Ft;function et(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}Q.urlGenerate=et;var Hp=32;function Gp(t){var e=[];return function(r){for(var n=0;n<e.length;n++)if(e[n].input===r){var i=e[0];return e[0]=e[n],e[n]=i,e[0].result}var s=t(r);return e.unshift({input:r,result:s}),e.length>Hp&&e.pop(),s}}var Xo=Gp(function(e){var r=e,n=Ft(e);if(n){if(!n.path)return e;r=n.path}for(var i=Q.isAbsolute(r),s=[],a=0,u=0;;)if(a=u,u=r.indexOf("/",a),u===-1){s.push(r.slice(a));break}else for(s.push(r.slice(a,u));u<r.length&&r[u]==="/";)u++;for(var c,o=0,u=s.length-1;u>=0;u--)c=s[u],c==="."?s.splice(u,1):c===".."?o++:o>0&&(c===""?(s.splice(u+1,o),o=0):(s.splice(u,2),o--));return r=s.join("/"),r===""&&(r=i?"/":"."),n?(n.path=r,et(n)):r});Q.normalize=Xo;function gl(t,e){t===""&&(t="."),e===""&&(e=".");var r=Ft(e),n=Ft(t);if(n&&(t=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),et(r);if(r||e.match(Vp))return e;if(n&&!n.host&&!n.path)return n.host=e,et(n);var i=e.charAt(0)==="/"?e:Xo(t.replace(/\/+$/,"")+"/"+e);return n?(n.path=i,et(n)):i}Q.join=gl;Q.isAbsolute=function(t){return t.charAt(0)==="/"||kl.test(t)};function Yp(t,e){t===""&&(t="."),t=t.replace(/\/$/,"");for(var r=0;e.indexOf(t+"/")!==0;){var n=t.lastIndexOf("/");if(n<0||(t=t.slice(0,n),t.match(/^([^\/]+:\/)?\/*$/)))return e;++r}return Array(r+1).join("../")+e.substr(t.length+1)}Q.relative=Yp;var Sl=function(){var t=Object.create(null);return!("__proto__"in t)}();function bl(t){return t}function $p(t){return yl(t)?"$"+t:t}Q.toSetString=Sl?bl:$p;function Qp(t){return yl(t)?t.slice(1):t}Q.fromSetString=Sl?bl:Qp;function yl(t){if(!t)return!1;var e=t.length;if(e<9||t.charCodeAt(e-1)!==95||t.charCodeAt(e-2)!==95||t.charCodeAt(e-3)!==111||t.charCodeAt(e-4)!==116||t.charCodeAt(e-5)!==111||t.charCodeAt(e-6)!==114||t.charCodeAt(e-7)!==112||t.charCodeAt(e-8)!==95||t.charCodeAt(e-9)!==95)return!1;for(var r=e-10;r>=0;r--)if(t.charCodeAt(r)!==36)return!1;return!0}function Kp(t,e,r){var n=we(t.source,e.source);return n!==0||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0||r)||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=t.generatedLine-e.generatedLine,n!==0)?n:we(t.name,e.name)}Q.compareByOriginalPositions=Kp;function Jp(t,e,r){var n;return n=t.originalLine-e.originalLine,n!==0||(n=t.originalColumn-e.originalColumn,n!==0||r)||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=t.generatedLine-e.generatedLine,n!==0)?n:we(t.name,e.name)}Q.compareByOriginalPositionsNoSource=Jp;function Xp(t,e,r){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0||r)||(n=we(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:we(t.name,e.name)}Q.compareByGeneratedPositionsDeflated=Xp;function Zp(t,e,r){var n=t.generatedColumn-e.generatedColumn;return n!==0||r||(n=we(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:we(t.name,e.name)}Q.compareByGeneratedPositionsDeflatedNoLine=Zp;function we(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}function ef(t,e){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=we(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:we(t.name,e.name)}Q.compareByGeneratedPositionsInflated=ef;function tf(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}Q.parseSourceMapInput=tf;function rf(t,e,r){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),r){var n=Ft(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var i=n.path.lastIndexOf("/");i>=0&&(n.path=n.path.substring(0,i+1))}e=gl(et(n),e)}return Xo(e)}Q.computeSourceURL=rf});var wl=Fe(Cl=>{var Zo=Sr(),es=Object.prototype.hasOwnProperty,Me=typeof Map<"u";function ve(){this._array=[],this._set=Me?new Map:Object.create(null)}ve.fromArray=function(e,r){for(var n=new ve,i=0,s=e.length;i<s;i++)n.add(e[i],r);return n};ve.prototype.size=function(){return Me?this._set.size:Object.getOwnPropertyNames(this._set).length};ve.prototype.add=function(e,r){var n=Me?e:Zo.toSetString(e),i=Me?this.has(e):es.call(this._set,n),s=this._array.length;(!i||r)&&this._array.push(e),i||(Me?this._set.set(e,s):this._set[n]=s)};ve.prototype.has=function(e){if(Me)return this._set.has(e);var r=Zo.toSetString(e);return es.call(this._set,r)};ve.prototype.indexOf=function(e){if(Me){var r=this._set.get(e);if(r>=0)return r}else{var n=Zo.toSetString(e);if(es.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')};ve.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)};ve.prototype.toArray=function(){return this._array.slice()};Cl.ArraySet=ve});var Tl=Fe(Ll=>{var vl=Sr();function nf(t,e){var r=t.generatedLine,n=e.generatedLine,i=t.generatedColumn,s=e.generatedColumn;return n>r||n==r&&s>=i||vl.compareByGeneratedPositionsInflated(t,e)<=0}function br(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}br.prototype.unsortedForEach=function(e,r){this._array.forEach(e,r)};br.prototype.add=function(e){nf(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};br.prototype.toArray=function(){return this._sorted||(this._array.sort(vl.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};Ll.MappingList=br});var El=Fe(Al=>{var Ot=xl(),z=Sr(),yr=wl().ArraySet,of=Tl().MappingList;function he(t){t||(t={}),this._file=z.getArg(t,"file",null),this._sourceRoot=z.getArg(t,"sourceRoot",null),this._skipValidation=z.getArg(t,"skipValidation",!1),this._ignoreInvalidMapping=z.getArg(t,"ignoreInvalidMapping",!1),this._sources=new yr,this._names=new yr,this._mappings=new of,this._sourcesContents=null}he.prototype._version=3;he.fromSourceMap=function(e,r){var n=e.sourceRoot,i=new he(Object.assign(r||{},{file:e.file,sourceRoot:n}));return e.eachMapping(function(s){var a={generated:{line:s.generatedLine,column:s.generatedColumn}};s.source!=null&&(a.source=s.source,n!=null&&(a.source=z.relative(n,a.source)),a.original={line:s.originalLine,column:s.originalColumn},s.name!=null&&(a.name=s.name)),i.addMapping(a)}),e.sources.forEach(function(s){var a=s;n!==null&&(a=z.relative(n,s)),i._sources.has(a)||i._sources.add(a);var u=e.sourceContentFor(s);u!=null&&i.setSourceContent(s,u)}),i};he.prototype.addMapping=function(e){var r=z.getArg(e,"generated"),n=z.getArg(e,"original",null),i=z.getArg(e,"source",null),s=z.getArg(e,"name",null);!this._skipValidation&&this._validateMapping(r,n,i,s)===!1||(i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),s!=null&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:i,name:s}))};he.prototype.setSourceContent=function(e,r){var n=e;this._sourceRoot!=null&&(n=z.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[z.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[z.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};he.prototype.applySourceMap=function(e,r,n){var i=r;if(r==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);i=e.file}var s=this._sourceRoot;s!=null&&(i=z.relative(s,i));var a=new yr,u=new yr;this._mappings.unsortedForEach(function(c){if(c.source===i&&c.originalLine!=null){var o=e.originalPositionFor({line:c.originalLine,column:c.originalColumn});o.source!=null&&(c.source=o.source,n!=null&&(c.source=z.join(n,c.source)),s!=null&&(c.source=z.relative(s,c.source)),c.originalLine=o.line,c.originalColumn=o.column,o.name!=null&&(c.name=o.name))}var l=c.source;l!=null&&!a.has(l)&&a.add(l);var f=c.name;f!=null&&!u.has(f)&&u.add(f)},this),this._sources=a,this._names=u,e.sources.forEach(function(c){var o=e.sourceContentFor(c);o!=null&&(n!=null&&(c=z.join(n,c)),s!=null&&(c=z.relative(s,c)),this.setSourceContent(c,o))},this)};he.prototype._validateMapping=function(e,r,n,i){if(r&&typeof r.line!="number"&&typeof r.column!="number"){var s="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(s),!1;throw new Error(s)}if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!r&&!n&&!i)){if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n)return;var s="Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:i});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(s),!1;throw new Error(s)}};he.prototype._serializeMappings=function(){for(var e=0,r=1,n=0,i=0,s=0,a=0,u="",c,o,l,f,h=this._mappings.toArray(),d=0,g=h.length;d<g;d++){if(o=h[d],c="",o.generatedLine!==r)for(e=0;o.generatedLine!==r;)c+=";",r++;else if(d>0){if(!z.compareByGeneratedPositionsInflated(o,h[d-1]))continue;c+=","}c+=Ot.encode(o.generatedColumn-e),e=o.generatedColumn,o.source!=null&&(f=this._sources.indexOf(o.source),c+=Ot.encode(f-a),a=f,c+=Ot.encode(o.originalLine-1-i),i=o.originalLine-1,c+=Ot.encode(o.originalColumn-n),n=o.originalColumn,o.name!=null&&(l=this._names.indexOf(o.name),c+=Ot.encode(l-s),s=l)),u+=c}return u};he.prototype._generateSourcesContent=function(e,r){return e.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=z.relative(r,n));var i=z.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)};he.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e};he.prototype.toString=function(){return JSON.stringify(this.toJSON())};Al.SourceMapGenerator=he});var ic=require("fs/promises"),oc=require("path"),sc=Vs(Ys(),1);var Qe=null,lt=class t{static createItem(e){return{prev:null,next:null,data:e}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(e){return t.createItem(e)}allocateCursor(e,r){let n;return Qe!==null?(n=Qe,Qe=Qe.cursor,n.prev=e,n.next=r,n.cursor=this.cursor):n={prev:e,next:r,cursor:this.cursor},this.cursor=n,n}releaseCursor(){let{cursor:e}=this;this.cursor=e.cursor,e.prev=null,e.next=null,e.cursor=Qe,Qe=e}updateCursors(e,r,n,i){let{cursor:s}=this;for(;s!==null;)s.prev===e&&(s.prev=r),s.next===n&&(s.next=i),s=s.cursor}*[Symbol.iterator](){for(let e=this.head;e!==null;e=e.next)yield e.data}get size(){let e=0;for(let r=this.head;r!==null;r=r.next)e++;return e}get isEmpty(){return this.head===null}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(e){let r=null;this.head=null;for(let n of e){let i=t.createItem(n);r!==null?r.next=i:this.head=i,i.prev=r,r=i}return this.tail=r,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(e,r=this){let n=this.allocateCursor(null,this.head);for(;n.next!==null;){let i=n.next;n.next=i.next,e.call(r,i.data,i,this)}this.releaseCursor()}forEachRight(e,r=this){let n=this.allocateCursor(this.tail,null);for(;n.prev!==null;){let i=n.prev;n.prev=i.prev,e.call(r,i.data,i,this)}this.releaseCursor()}reduce(e,r,n=this){let i=this.allocateCursor(null,this.head),s=r,a;for(;i.next!==null;)a=i.next,i.next=a.next,s=e.call(n,s,a.data,a,this);return this.releaseCursor(),s}reduceRight(e,r,n=this){let i=this.allocateCursor(this.tail,null),s=r,a;for(;i.prev!==null;)a=i.prev,i.prev=a.prev,s=e.call(n,s,a.data,a,this);return this.releaseCursor(),s}some(e,r=this){for(let n=this.head;n!==null;n=n.next)if(e.call(r,n.data,n,this))return!0;return!1}map(e,r=this){let n=new t;for(let i=this.head;i!==null;i=i.next)n.appendData(e.call(r,i.data,i,this));return n}filter(e,r=this){let n=new t;for(let i=this.head;i!==null;i=i.next)e.call(r,i.data,i,this)&&n.appendData(i.data);return n}nextUntil(e,r,n=this){if(e===null)return;let i=this.allocateCursor(null,e);for(;i.next!==null;){let s=i.next;if(i.next=s.next,r.call(n,s.data,s,this))break}this.releaseCursor()}prevUntil(e,r,n=this){if(e===null)return;let i=this.allocateCursor(e,null);for(;i.prev!==null;){let s=i.prev;if(i.prev=s.prev,r.call(n,s.data,s,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){let e=new t;for(let r of this)e.appendData(r);return e}prepend(e){return this.updateCursors(null,e,this.head,e),this.head!==null?(this.head.prev=e,e.next=this.head):this.tail=e,this.head=e,this}prependData(e){return this.prepend(t.createItem(e))}append(e){return this.insert(e)}appendData(e){return this.insert(t.createItem(e))}insert(e,r=null){if(r!==null)if(this.updateCursors(r.prev,e,r,e),r.prev===null){if(this.head!==r)throw new Error("before doesn't belong to list");this.head=e,r.prev=e,e.next=r,this.updateCursors(null,e)}else r.prev.next=e,e.prev=r.prev,r.prev=e,e.next=r;else this.updateCursors(this.tail,e,null,e),this.tail!==null?(this.tail.next=e,e.prev=this.tail):this.head=e,this.tail=e;return this}insertData(e,r){return this.insert(t.createItem(e),r)}remove(e){if(this.updateCursors(e,e.prev,e,e.next),e.prev!==null)e.prev.next=e.next;else{if(this.head!==e)throw new Error("item doesn't belong to list");this.head=e.next}if(e.next!==null)e.next.prev=e.prev;else{if(this.tail!==e)throw new Error("item doesn't belong to list");this.tail=e.prev}return e.prev=null,e.next=null,e}push(e){this.insert(t.createItem(e))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(e){this.prepend(t.createItem(e))}shift(){return this.head!==null?this.remove(this.head):null}prependList(e){return this.insertList(e,this.head)}appendList(e){return this.insertList(e)}insertList(e,r){return e.head===null?this:(r!=null?(this.updateCursors(r.prev,e.tail,r,e.head),r.prev!==null?(r.prev.next=e.head,e.head.prev=r.prev):this.head=e.head,r.prev=e.tail,e.tail.next=r):(this.updateCursors(this.tail,e.tail,null,e.head),this.tail!==null?(this.tail.next=e.head,e.head.prev=this.tail):this.head=e.head,this.tail=e.tail),e.head=null,e.tail=null,this)}replace(e,r){"head"in r?this.insertList(r,e):this.insert(r,e),this.remove(e)}};function $s(t,e){let r=Object.create(SyntaxError.prototype),n=new Error;return Object.assign(r,{name:t,message:e,get stack(){return(n.stack||"").replace(/^(.+\n){1,3}/,`${t}: ${e}
`)}})}var en=100,Qs=60,Ks=" ";function Js({source:t,line:e,column:r,baseLine:n,baseColumn:i},s){function a(g,q){return o.slice(g,q).map((M,U)=>String(g+U+1).padStart(h)+" |"+M).join(`
`)}let u=`
`.repeat(Math.max(n-1,0)),c=" ".repeat(Math.max(i-1,0)),o=(u+c+t).split(/\r\n?|\n|\f/),l=Math.max(1,e-s)-1,f=Math.min(e+s,o.length+1),h=Math.max(4,String(f).length)+1,d=0;r+=(Ks.length-1)*(o[e-1].substr(0,r-1).match(/\t/g)||[]).length,r>en&&(d=r-Qs+3,r=Qs-2);for(let g=l;g<=f;g++)g>=0&&g<o.length&&(o[g]=o[g].replace(/\t/g,Ks),o[g]=(d>0&&o[g].length>d?"\u2026":"")+o[g].substr(d,en-2)+(o[g].length>d+en-1?"\u2026":""));return[a(l,e),new Array(r+h+2).join("-")+"^",a(e,f)].filter(Boolean).join(`
`).replace(/^(\s+\d+\s+\|\n)+/,"").replace(/\n(\s+\d+\s+\|)+$/,"")}function tn(t,e,r,n,i,s=1,a=1){return Object.assign($s("SyntaxError",t),{source:e,offset:r,line:n,column:i,sourceFragment(c){return Js({source:e,line:n,column:i,baseLine:s,baseColumn:a},isNaN(c)?0:c)},get formattedMessage(){return`Parse error: ${t}
`+Js({source:e,line:n,column:i,baseLine:s,baseColumn:a},2)}})}function te(t){return t>=48&&t<=57}function me(t){return te(t)||t>=65&&t<=70||t>=97&&t<=102}function Kt(t){return t>=65&&t<=90}function xc(t){return t>=97&&t<=122}function kc(t){return Kt(t)||xc(t)}function gc(t){return t>=128}function Qt(t){return kc(t)||gc(t)||t===95}function Jt(t){return Qt(t)||te(t)||t===45}function Sc(t){return t>=0&&t<=8||t===11||t>=14&&t<=31||t===127}function ct(t){return t===10||t===13||t===12}function de(t){return ct(t)||t===32||t===9}function ne(t,e){return!(t!==92||ct(e)||e===0)}function Xt(t,e,r){return t===45?Qt(e)||e===45||ne(e,r):Qt(t)?!0:t===92?ne(t,e):!1}function Zt(t,e,r){return t===43||t===45?te(e)?2:e===46&&te(r)?3:0:t===46?te(e)?2:0:te(t)?1:0}function er(t){return t===65279||t===65534?1:0}var rn=new Array(128),bc=128,ut=130,nn=131,tr=132,on=133;for(let t=0;t<rn.length;t++)rn[t]=de(t)&&ut||te(t)&&nn||Qt(t)&&tr||Sc(t)&&on||t||bc;function rr(t){return t<128?rn[t]:tr}function Ke(t,e){return e<t.length?t.charCodeAt(e):0}function nr(t,e,r){return r===13&&Ke(t,e+1)===10?2:1}function an(t,e,r){let n=t.charCodeAt(e);return Kt(n)&&(n=n|32),n===r}function Oe(t,e,r,n){if(r-e!==n.length||e<0||r>t.length)return!1;for(let i=e;i<r;i++){let s=n.charCodeAt(i-e),a=t.charCodeAt(i);if(Kt(a)&&(a=a|32),a!==s)return!1}return!0}function Zs(t,e){for(;e>=0&&de(t.charCodeAt(e));e--);return e+1}function ht(t,e){for(;e<t.length&&de(t.charCodeAt(e));e++);return e}function sn(t,e){for(;e<t.length&&te(t.charCodeAt(e));e++);return e}function ye(t,e){if(e+=2,me(Ke(t,e-1))){for(let n=Math.min(t.length,e+5);e<n&&me(Ke(t,e));e++);let r=Ke(t,e);de(r)&&(e+=nr(t,e,r))}return e}function pt(t,e){for(;e<t.length;e++){let r=t.charCodeAt(e);if(!Jt(r)){if(ne(r,Ke(t,e+1))){e=ye(t,e)-1;continue}break}}return e}function ir(t,e){let r=t.charCodeAt(e);if((r===43||r===45)&&(r=t.charCodeAt(e+=1)),te(r)&&(e=sn(t,e+1),r=t.charCodeAt(e)),r===46&&te(t.charCodeAt(e+1))&&(e+=2,e=sn(t,e)),an(t,e,101)){let n=0;r=t.charCodeAt(e+1),(r===45||r===43)&&(n=1,r=t.charCodeAt(e+2)),te(r)&&(e=sn(t,e+1+n+1))}return e}function or(t,e){for(;e<t.length;e++){let r=t.charCodeAt(e);if(r===41){e++;break}ne(r,Ke(t,e+1))&&(e=ye(t,e))}return e}function sr(t){if(t.length===1&&!me(t.charCodeAt(0)))return t[0];let e=parseInt(t,16);return(e===0||e>=55296&&e<=57343||e>1114111)&&(e=65533),String.fromCodePoint(e)}var ft=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token","comment-token"];function Je(t=null,e){return t===null||t.length<e?new Uint32Array(Math.max(e+1024,16384)):t}var ea=10,yc=12,ta=13;function ra(t){let e=t.source,r=e.length,n=e.length>0?er(e.charCodeAt(0)):0,i=Je(t.lines,r),s=Je(t.columns,r),a=t.startLine,u=t.startColumn;for(let c=n;c<r;c++){let o=e.charCodeAt(c);i[c]=a,s[c]=u++,(o===ea||o===ta||o===yc)&&(o===ta&&c+1<r&&e.charCodeAt(c+1)===ea&&(c++,i[c]=a,s[c]=u),a++,u=1)}i[r]=a,s[r]=u,t.lines=i,t.columns=s,t.computed=!0}var ar=class{constructor(e,r,n,i){this.setSource(e,r,n,i),this.lines=null,this.columns=null}setSource(e="",r=0,n=1,i=1){this.source=e,this.startOffset=r,this.startLine=n,this.startColumn=i,this.computed=!1}getLocation(e,r){return this.computed||ra(this),{source:r,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}getLocationRange(e,r,n){return this.computed||ra(this),{source:n,start:{offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]},end:{offset:this.startOffset+r,line:this.lines[r],column:this.columns[r]}}}};var xe=16777215,ke=24,_e=new Uint8Array(32);_e[2]=22;_e[21]=22;_e[19]=20;_e[23]=24;function na(t){return _e[t]!==0}var lr=class{constructor(e,r){this.setSource(e,r)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(e="",r=()=>{}){e=String(e||"");let n=e.length,i=Je(this.offsetAndType,e.length+1),s=Je(this.balance,e.length+1),a=0,u=-1,c=0,o=e.length;this.offsetAndType=null,this.balance=null,s.fill(0),r(e,(l,f,h)=>{let d=a++;if(i[d]=l<<ke|h,u===-1&&(u=f),s[d]=o,l===c){let g=s[o];s[o]=d,o=g,c=_e[i[g]>>ke]}else na(l)&&(o=d,c=_e[l])}),i[a]=0<<ke|n,s[a]=a;for(let l=0;l<a;l++){let f=s[l];if(f<=l){let h=s[f];h!==l&&(s[l]=h)}else f>a&&(s[l]=a)}this.source=e,this.firstCharOffset=u===-1?0:u,this.tokenCount=a,this.offsetAndType=i,this.balance=s,this.reset(),this.next()}lookupType(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e]>>ke:0}lookupTypeNonSC(e){for(let r=this.tokenIndex;r<this.tokenCount;r++){let n=this.offsetAndType[r]>>ke;if(n!==13&&n!==25&&e--===0)return n}return 0}lookupOffset(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e-1]&xe:this.source.length}lookupOffsetNonSC(e){for(let r=this.tokenIndex;r<this.tokenCount;r++){let n=this.offsetAndType[r]>>ke;if(n!==13&&n!==25&&e--===0)return r-this.tokenIndex}return 0}lookupValue(e,r){return e+=this.tokenIndex,e<this.tokenCount?Oe(this.source,this.offsetAndType[e-1]&xe,this.offsetAndType[e]&xe,r):!1}getTokenStart(e){return e===this.tokenIndex?this.tokenStart:e>0?e<this.tokenCount?this.offsetAndType[e-1]&xe:this.offsetAndType[this.tokenCount]&xe:this.firstCharOffset}substrToCursor(e){return this.source.substring(e,this.tokenStart)}isBalanceEdge(e){return this.balance[this.tokenIndex]<e}isDelim(e,r){return r?this.lookupType(r)===9&&this.source.charCodeAt(this.lookupOffset(r))===e:this.tokenType===9&&this.source.charCodeAt(this.tokenStart)===e}skip(e){let r=this.tokenIndex+e;r<this.tokenCount?(this.tokenIndex=r,this.tokenStart=this.offsetAndType[r-1]&xe,r=this.offsetAndType[r],this.tokenType=r>>ke,this.tokenEnd=r&xe):(this.tokenIndex=this.tokenCount,this.next())}next(){let e=this.tokenIndex+1;e<this.tokenCount?(this.tokenIndex=e,this.tokenStart=this.tokenEnd,e=this.offsetAndType[e],this.tokenType=e>>ke,this.tokenEnd=e&xe):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=0,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===13||this.tokenType===25;)this.next()}skipUntilBalanced(e,r){let n=e,i=0,s=0;e:for(;n<this.tokenCount;n++){if(i=this.balance[n],i<e)break e;switch(s=n>0?this.offsetAndType[n-1]&xe:this.firstCharOffset,r(this.source.charCodeAt(s))){case 1:break e;case 2:n++;break e;default:na(this.offsetAndType[n]>>ke)&&(n=i)}}this.skip(n-this.tokenIndex)}forEachToken(e){for(let r=0,n=this.firstCharOffset;r<this.tokenCount;r++){let i=n,s=this.offsetAndType[r],a=s&xe,u=s>>ke;n=a,e(u,i,a,r)}}dump(){let e=new Array(this.tokenCount);return this.forEachToken((r,n,i,s)=>{e[s]={idx:s,type:ft[r],chunk:this.source.substring(n,i),balance:this.balance[s]}}),e}};function cr(t,e){function r(f){return f<u?t.charCodeAt(f):0}function n(){if(o=ir(t,o),Xt(r(o),r(o+1),r(o+2))){l=12,o=pt(t,o);return}if(r(o)===37){l=11,o++;return}l=10}function i(){let f=o;if(o=pt(t,o),Oe(t,f,o,"url")&&r(o)===40){if(o=ht(t,o+1),r(o)===34||r(o)===39){l=2,o=f+4;return}a();return}if(r(o)===40){l=2,o++;return}l=1}function s(f){for(f||(f=r(o++)),l=5;o<t.length;o++){let h=t.charCodeAt(o);switch(rr(h)){case f:o++;return;case ut:if(ct(h)){o+=nr(t,o,h),l=6;return}break;case 92:if(o===t.length-1)break;let d=r(o+1);ct(d)?o+=nr(t,o+1,d):ne(h,d)&&(o=ye(t,o)-1);break}}}function a(){for(l=7,o=ht(t,o);o<t.length;o++){let f=t.charCodeAt(o);switch(rr(f)){case 41:o++;return;case ut:if(o=ht(t,o),r(o)===41||o>=t.length){o<t.length&&o++;return}o=or(t,o),l=8;return;case 34:case 39:case 40:case on:o=or(t,o),l=8;return;case 92:if(ne(f,r(o+1))){o=ye(t,o)-1;break}o=or(t,o),l=8;return}}}t=String(t||"");let u=t.length,c=er(r(0)),o=c,l;for(;o<u;){let f=t.charCodeAt(o);switch(rr(f)){case ut:l=13,o=ht(t,o+1);break;case 34:s();break;case 35:Jt(r(o+1))||ne(r(o+1),r(o+2))?(l=4,o=pt(t,o+1)):(l=9,o++);break;case 39:s();break;case 40:l=21,o++;break;case 41:l=22,o++;break;case 43:Zt(f,r(o+1),r(o+2))?n():(l=9,o++);break;case 44:l=18,o++;break;case 45:Zt(f,r(o+1),r(o+2))?n():r(o+1)===45&&r(o+2)===62?(l=15,o=o+3):Xt(f,r(o+1),r(o+2))?i():(l=9,o++);break;case 46:Zt(f,r(o+1),r(o+2))?n():(l=9,o++);break;case 47:r(o+1)===42?(l=25,o=t.indexOf("*/",o+2),o=o===-1?t.length:o+2):(l=9,o++);break;case 58:l=16,o++;break;case 59:l=17,o++;break;case 60:r(o+1)===33&&r(o+2)===45&&r(o+3)===45?(l=14,o=o+4):(l=9,o++);break;case 64:Xt(r(o+1),r(o+2),r(o+3))?(l=3,o=pt(t,o+1)):(l=9,o++);break;case 91:l=19,o++;break;case 92:ne(f,r(o+1))?i():(l=9,o++);break;case 93:l=20,o++;break;case 123:l=23,o++;break;case 125:l=24,o++;break;case nn:n();break;case tr:i();break;default:l=9,o++}e(l,c,c=o)}}function ia(t){let e=this.createList(),r=!1,n={recognizer:t};for(;!this.eof;){switch(this.tokenType){case 25:this.next();continue;case 13:r=!0,this.next();continue}let i=t.getNode.call(this,n);if(i===void 0)break;r&&(t.onWhiteSpace&&t.onWhiteSpace.call(this,i,e,n),r=!1),e.push(i)}return r&&t.onWhiteSpace&&t.onWhiteSpace.call(this,null,e,n),e}var oa=()=>{},wc=33,vc=35,ln=59,sa=123,aa=0;function Lc(t){return function(){return this[t]()}}function cn(t){let e=Object.create(null);for(let r of Object.keys(t)){let n=t[r],i=n.parse||n;i&&(e[r]=i)}return e}function Tc(t){let e={context:Object.create(null),features:Object.assign(Object.create(null),t.features),scope:Object.assign(Object.create(null),t.scope),atrule:cn(t.atrule),pseudo:cn(t.pseudo),node:cn(t.node)};for(let[r,n]of Object.entries(t.parseContext))switch(typeof n){case"function":e.context[r]=n;break;case"string":e.context[r]=Lc(n);break}return{config:e,...e,...e.node}}function ur(t){let e="",r="<unknown>",n=!1,i=oa,s=!1,a=new ar,u=Object.assign(new lr,Tc(t||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:ia,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(o){return o===sa?1:0},consumeUntilLeftCurlyBracketOrSemicolon(o){return o===sa||o===ln?1:0},consumeUntilExclamationMarkOrSemicolon(o){return o===wc||o===ln?1:0},consumeUntilSemicolonIncluded(o){return o===ln?2:0},createList(){return new lt},createSingleNodeList(o){return new lt().appendData(o)},getFirstListNode(o){return o&&o.first},getLastListNode(o){return o&&o.last},parseWithFallback(o,l){let f=this.tokenIndex;try{return o.call(this)}catch(h){if(s)throw h;this.skip(f-this.tokenIndex);let d=l.call(this);return s=!0,i(h,d),s=!1,d}},lookupNonWSType(o){let l;do if(l=this.lookupType(o++),l!==13&&l!==25)return l;while(l!==aa);return aa},charCodeAt(o){return o>=0&&o<e.length?e.charCodeAt(o):0},substring(o,l){return e.substring(o,l)},substrToCursor(o){return this.source.substring(o,this.tokenStart)},cmpChar(o,l){return an(e,o,l)},cmpStr(o,l,f){return Oe(e,o,l,f)},consume(o){let l=this.tokenStart;return this.eat(o),this.substrToCursor(l)},consumeFunctionName(){let o=e.substring(this.tokenStart,this.tokenEnd-1);return this.eat(2),o},consumeNumber(o){let l=e.substring(this.tokenStart,ir(e,this.tokenStart));return this.eat(o),l},eat(o){if(this.tokenType!==o){let l=ft[o].slice(0,-6).replace(/-/g," ").replace(/^./,d=>d.toUpperCase()),f=`${/[[\](){}]/.test(l)?`"${l}"`:l} is expected`,h=this.tokenStart;switch(o){case 1:this.tokenType===2||this.tokenType===7?(h=this.tokenEnd-1,f="Identifier is expected but function found"):f="Identifier is expected";break;case 4:this.isDelim(vc)&&(this.next(),h++,f="Name is expected");break;case 11:this.tokenType===10&&(h=this.tokenEnd,f="Percent sign is expected");break}this.error(f,h)}this.next()},eatIdent(o){(this.tokenType!==1||this.lookupValue(0,o)===!1)&&this.error(`Identifier "${o}" is expected`),this.next()},eatDelim(o){this.isDelim(o)||this.error(`Delim "${String.fromCharCode(o)}" is expected`),this.next()},getLocation(o,l){return n?a.getLocationRange(o,l,r):null},getLocationFromList(o){if(n){let l=this.getFirstListNode(o),f=this.getLastListNode(o);return a.getLocationRange(l!==null?l.loc.start.offset-a.startOffset:this.tokenStart,f!==null?f.loc.end.offset-a.startOffset:this.tokenStart,r)}return null},error(o,l){let f=typeof l<"u"&&l<e.length?a.getLocation(l):this.eof?a.getLocation(Zs(e,e.length-1)):a.getLocation(this.tokenStart);throw new tn(o||"Unexpected input",e,f.offset,f.line,f.column,a.startLine,a.startColumn)}});return Object.assign(function(o,l){e=o,l=l||{},u.setSource(e,cr),a.setSource(e,l.offset,l.line,l.column),r=l.filename||"<unknown>",n=!!l.positions,i=typeof l.onParseError=="function"?l.onParseError:oa,s=!1,u.parseAtrulePrelude="parseAtrulePrelude"in l?!!l.parseAtrulePrelude:!0,u.parseRulePrelude="parseRulePrelude"in l?!!l.parseRulePrelude:!0,u.parseValue="parseValue"in l?!!l.parseValue:!0,u.parseCustomProperty="parseCustomProperty"in l?!!l.parseCustomProperty:!1;let{context:f="default",onComment:h}=l;if(!(f in u.context))throw new Error("Unknown context `"+f+"`");typeof h=="function"&&u.forEachToken((g,q,M)=>{if(g===25){let U=u.getLocation(q,M),Y=Oe(e,M-2,M,"*/")?e.slice(q+2,M-2):e.slice(q+2,M);h(Y,U)}});let d=u.context[f].call(u,l);return u.eof||u.error(),d},{SyntaxError:tn,config:u.config})}var un={};k(un,{AtrulePrelude:()=>ca,Selector:()=>hr,Value:()=>ma});var Ac=35,Ec=42,la=43,Nc=45,Dc=47,Pc=117;function mt(t){switch(this.tokenType){case 4:return this.Hash();case 18:return this.Operator();case 21:return this.Parentheses(this.readSequence,t.recognizer);case 19:return this.Brackets(this.readSequence,t.recognizer);case 5:return this.String();case 12:return this.Dimension();case 11:return this.Percentage();case 10:return this.Number();case 2:return this.cmpStr(this.tokenStart,this.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,t.recognizer);case 7:return this.Url();case 1:return this.cmpChar(this.tokenStart,Pc)&&this.cmpChar(this.tokenStart+1,la)?this.UnicodeRange():this.Identifier();case 9:{let e=this.charCodeAt(this.tokenStart);if(e===Dc||e===Ec||e===la||e===Nc)return this.Operator();e===Ac&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}var ca={getNode:mt};var Ic=35,Rc=38,Fc=42,Oc=43,_c=47,ua=46,Bc=62,qc=124,Mc=126;function Uc(t,e){e.last!==null&&e.last.type!=="Combinator"&&t!==null&&t.type!=="Combinator"&&e.push({type:"Combinator",loc:null,name:" "})}function Wc(){switch(this.tokenType){case 19:return this.AttributeSelector();case 4:return this.IdSelector();case 16:return this.lookupType(1)===16?this.PseudoElementSelector():this.PseudoClassSelector();case 1:return this.TypeSelector();case 10:case 11:return this.Percentage();case 12:this.charCodeAt(this.tokenStart)===ua&&this.error("Identifier is expected",this.tokenStart+1);break;case 9:{switch(this.charCodeAt(this.tokenStart)){case Oc:case Bc:case Mc:case _c:return this.Combinator();case ua:return this.ClassSelector();case Fc:case qc:return this.TypeSelector();case Ic:return this.IdSelector();case Rc:return this.NestingSelector()}break}}}var hr={onWhiteSpace:Uc,getNode:Wc};function ha(){return this.createSingleNodeList(this.Raw(null,!1))}function pa(){let t=this.createList();if(this.skipSC(),t.push(this.Identifier()),this.skipSC(),this.tokenType===18){t.push(this.Operator());let e=this.tokenIndex,r=this.parseCustomProperty?this.Value(null):this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1);if(r.type==="Value"&&r.children.isEmpty){for(let n=e-this.tokenIndex;n<=0;n++)if(this.lookupType(n)===13){r.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}t.push(r)}return t}function fa(t){return t!==null&&t.type==="Operator"&&(t.value[t.value.length-1]==="-"||t.value[t.value.length-1]==="+")}var ma={getNode:mt,onWhiteSpace(t,e){fa(t)&&(t.value=" "+t.value),fa(e.last)&&(e.last.value+=" ")},expression:ha,var:pa};var zc=new Set(["none","and","not","or"]),da={parse:{prelude(){let t=this.createList();if(this.tokenType===1){let e=this.substring(this.tokenStart,this.tokenEnd);zc.has(e.toLowerCase())||t.push(this.Identifier())}return t.push(this.Condition("container")),t},block(t=!1){return this.Block(t)}}};var xa={parse:{prelude:null,block(){return this.Block(!0)}}};function hn(t,e){return this.parseWithFallback(()=>{try{return t.call(this)}finally{this.skipSC(),this.lookupNonWSType(0)!==22&&this.error()}},e||(()=>this.Raw(null,!0)))}var ka={layer(){this.skipSC();let t=this.createList(),e=hn.call(this,this.Layer);return(e.type!=="Raw"||e.value!=="")&&t.push(e),t},supports(){this.skipSC();let t=this.createList(),e=hn.call(this,this.Declaration,()=>hn.call(this,()=>this.Condition("supports")));return(e.type!=="Raw"||e.value!=="")&&t.push(e),t}},ga={parse:{prelude(){let t=this.createList();switch(this.tokenType){case 5:t.push(this.String());break;case 7:case 2:t.push(this.Url());break;default:this.error("String or url() is expected")}return this.skipSC(),this.tokenType===1&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer")?t.push(this.Identifier()):this.tokenType===2&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer(")&&t.push(this.Function(null,ka)),this.skipSC(),this.tokenType===2&&this.cmpStr(this.tokenStart,this.tokenEnd,"supports(")&&t.push(this.Function(null,ka)),(this.lookupNonWSType(0)===1||this.lookupNonWSType(0)===21)&&t.push(this.MediaQueryList()),t},block:null}};var Sa={parse:{prelude(){return this.createSingleNodeList(this.LayerList())},block(){return this.Block(!1)}}};var ba={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(t=!1){return this.Block(t)}}};var ya={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}};var Ca={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}};var wa={parse:{prelude(){return this.createSingleNodeList(this.Scope())},block(t=!1){return this.Block(t)}}};var va={parse:{prelude:null,block(t=!1){return this.Block(t)}}};var La={parse:{prelude(){return this.createSingleNodeList(this.Condition("supports"))},block(t=!1){return this.Block(t)}}};var Ta={container:da,"font-face":xa,import:ga,layer:Sa,media:ba,nest:ya,page:Ca,scope:wa,"starting-style":va,supports:La};function Aa(){let t=this.createList();this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case 1:t.push(this.Identifier());break;case 5:t.push(this.String());break;case 18:t.push(this.Operator());break;case 22:break e;default:this.error("Identifier, string or comma is expected")}this.skipSC()}return t}var Be={parse(){return this.createSingleNodeList(this.SelectorList())}},pn={parse(){return this.createSingleNodeList(this.Selector())}},jc={parse(){return this.createSingleNodeList(this.Identifier())}},Vc={parse:Aa},pr={parse(){return this.createSingleNodeList(this.Nth())}},fr={dir:jc,has:Be,lang:Vc,matches:Be,is:Be,"-moz-any":Be,"-webkit-any":Be,where:Be,not:Be,"nth-child":pr,"nth-last-child":pr,"nth-last-of-type":pr,"nth-of-type":pr,slotted:pn,host:pn,"host-context":pn};var Vo={};k(Vo,{AnPlusB:()=>dt,Atrule:()=>xn,AtrulePrelude:()=>Sn,AttributeSelector:()=>xt,Block:()=>Ln,Brackets:()=>En,CDC:()=>Pn,CDO:()=>Fn,ClassSelector:()=>kt,Combinator:()=>gt,Comment:()=>Wn,Condition:()=>Vn,Declaration:()=>Yn,DeclarationList:()=>Jn,Dimension:()=>ei,Feature:()=>ni,FeatureFunction:()=>si,FeatureRange:()=>ui,Function:()=>fi,GeneralEnclosed:()=>xi,Hash:()=>Si,IdSelector:()=>bt,Identifier:()=>St,Layer:()=>Ti,LayerList:()=>Ni,MediaQuery:()=>Ii,MediaQueryList:()=>Oi,NestingSelector:()=>yt,Nth:()=>Ct,Number:()=>zi,Operator:()=>wt,Parentheses:()=>Yi,Percentage:()=>vt,PseudoClassSelector:()=>Lt,PseudoElementSelector:()=>Tt,Ratio:()=>ro,Raw:()=>At,Rule:()=>ao,Scope:()=>uo,Selector:()=>Et,SelectorList:()=>Nt,String:()=>Dt,StyleSheet:()=>yo,SupportsDeclaration:()=>vo,TypeSelector:()=>Pt,UnicodeRange:()=>Po,Url:()=>Oo,Value:()=>qo,WhiteSpace:()=>Wo});var dn={};k(dn,{generate:()=>mn,name:()=>Gc,parse:()=>dt,structure:()=>Yc});var Se=43,ie=45,mr=110,qe=!0,Hc=!1;function dr(t,e){let r=this.tokenStart+t,n=this.charCodeAt(r);for((n===Se||n===ie)&&(e&&this.error("Number sign is not allowed"),r++);r<this.tokenEnd;r++)te(this.charCodeAt(r))||this.error("Integer is expected",r)}function Ze(t){return dr.call(this,0,t)}function Ne(t,e){if(!this.cmpChar(this.tokenStart+t,e)){let r="";switch(e){case mr:r="N is expected";break;case ie:r="HyphenMinus is expected";break}this.error(r,this.tokenStart+t)}}function fn(){let t=0,e=0,r=this.tokenType;for(;r===13||r===25;)r=this.lookupType(++t);if(r!==10)if(this.isDelim(Se,t)||this.isDelim(ie,t)){e=this.isDelim(Se,t)?Se:ie;do r=this.lookupType(++t);while(r===13||r===25);r!==10&&(this.skip(t),Ze.call(this,qe))}else return null;return t>0&&this.skip(t),e===0&&(r=this.charCodeAt(this.tokenStart),r!==Se&&r!==ie&&this.error("Number sign is expected")),Ze.call(this,e!==0),e===ie?"-"+this.consume(10):this.consume(10)}var Gc="AnPlusB",Yc={a:[String,null],b:[String,null]};function dt(){let t=this.tokenStart,e=null,r=null;if(this.tokenType===10)Ze.call(this,Hc),r=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,ie))switch(e="-1",Ne.call(this,1,mr),this.tokenEnd-this.tokenStart){case 2:this.next(),r=fn.call(this);break;case 3:Ne.call(this,2,ie),this.next(),this.skipSC(),Ze.call(this,qe),r="-"+this.consume(10);break;default:Ne.call(this,2,ie),dr.call(this,3,qe),this.next(),r=this.substrToCursor(t+2)}else if(this.tokenType===1||this.isDelim(Se)&&this.lookupType(1)===1){let n=0;switch(e="1",this.isDelim(Se)&&(n=1,this.next()),Ne.call(this,0,mr),this.tokenEnd-this.tokenStart){case 1:this.next(),r=fn.call(this);break;case 2:Ne.call(this,1,ie),this.next(),this.skipSC(),Ze.call(this,qe),r="-"+this.consume(10);break;default:Ne.call(this,1,ie),dr.call(this,2,qe),this.next(),r=this.substrToCursor(t+n+1)}}else if(this.tokenType===12){let n=this.charCodeAt(this.tokenStart),i=n===Se||n===ie,s=this.tokenStart+i;for(;s<this.tokenEnd&&te(this.charCodeAt(s));s++);s===this.tokenStart+i&&this.error("Integer is expected",this.tokenStart+i),Ne.call(this,s-this.tokenStart,mr),e=this.substring(t,s),s+1===this.tokenEnd?(this.next(),r=fn.call(this)):(Ne.call(this,s-this.tokenStart+1,ie),s+2===this.tokenEnd?(this.next(),this.skipSC(),Ze.call(this,qe),r="-"+this.consume(10)):(dr.call(this,s-this.tokenStart+2,qe),this.next(),r=this.substrToCursor(s+1)))}else this.error();return e!==null&&e.charCodeAt(0)===Se&&(e=e.substr(1)),r!==null&&r.charCodeAt(0)===Se&&(r=r.substr(1)),{type:"AnPlusB",loc:this.getLocation(t,this.tokenStart),a:e,b:r}}function mn(t){if(t.a){let e=t.a==="+1"&&"n"||t.a==="1"&&"n"||t.a==="-1"&&"-n"||t.a+"n";if(t.b){let r=t.b[0]==="-"||t.b[0]==="+"?t.b:"+"+t.b;this.tokenize(e+r)}else this.tokenize(e)}else this.tokenize(t.b)}var gn={};k(gn,{generate:()=>kn,name:()=>Qc,parse:()=>xn,structure:()=>Jc,walkContext:()=>Kc});function Ea(){return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function $c(){for(let t=1,e;e=this.lookupType(t);t++){if(e===24)return!0;if(e===23||e===3)return!1}return!1}var Qc="Atrule",Kc="atrule",Jc={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function xn(t=!1){let e=this.tokenStart,r,n,i=null,s=null;switch(this.eat(3),r=this.substrToCursor(e+1),n=r.toLowerCase(),this.skipSC(),this.eof===!1&&this.tokenType!==23&&this.tokenType!==17&&(this.parseAtrulePrelude?i=this.parseWithFallback(this.AtrulePrelude.bind(this,r,t),Ea):i=Ea.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case 17:this.next();break;case 23:hasOwnProperty.call(this.atrule,n)&&typeof this.atrule[n].block=="function"?s=this.atrule[n].block.call(this,t):s=this.Block($c.call(this));break}return{type:"Atrule",loc:this.getLocation(e,this.tokenStart),name:r,prelude:i,block:s}}function kn(t){this.token(3,"@"+t.name),t.prelude!==null&&this.node(t.prelude),t.block?this.node(t.block):this.token(17,";")}var yn={};k(yn,{generate:()=>bn,name:()=>Xc,parse:()=>Sn,structure:()=>eu,walkContext:()=>Zc});var Xc="AtrulePrelude",Zc="atrulePrelude",eu={children:[[]]};function Sn(t){let e=null;return t!==null&&(t=t.toLowerCase()),this.skipSC(),hasOwnProperty.call(this.atrule,t)&&typeof this.atrule[t].prelude=="function"?e=this.atrule[t].prelude.call(this):e=this.readSequence(this.scope.AtrulePrelude),this.skipSC(),this.eof!==!0&&this.tokenType!==23&&this.tokenType!==17&&this.error("Semicolon or block is expected"),{type:"AtrulePrelude",loc:this.getLocationFromList(e),children:e}}function bn(t){this.children(t)}var vn={};k(vn,{generate:()=>wn,name:()=>su,parse:()=>xt,structure:()=>au});var tu=36,Na=42,xr=61,ru=94,Cn=124,nu=126;function iu(){this.eof&&this.error("Unexpected end of input");let t=this.tokenStart,e=!1;return this.isDelim(Na)?(e=!0,this.next()):this.isDelim(Cn)||this.eat(1),this.isDelim(Cn)?this.charCodeAt(this.tokenStart+1)!==xr?(this.next(),this.eat(1)):e&&this.error("Identifier is expected",this.tokenEnd):e&&this.error("Vertical line is expected"),{type:"Identifier",loc:this.getLocation(t,this.tokenStart),name:this.substrToCursor(t)}}function ou(){let t=this.tokenStart,e=this.charCodeAt(t);return e!==xr&&e!==nu&&e!==ru&&e!==tu&&e!==Na&&e!==Cn&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),e!==xr&&(this.isDelim(xr)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(t)}var su="AttributeSelector",au={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function xt(){let t=this.tokenStart,e,r=null,n=null,i=null;return this.eat(19),this.skipSC(),e=iu.call(this),this.skipSC(),this.tokenType!==20&&(this.tokenType!==1&&(r=ou.call(this),this.skipSC(),n=this.tokenType===5?this.String():this.Identifier(),this.skipSC()),this.tokenType===1&&(i=this.consume(1),this.skipSC())),this.eat(20),{type:"AttributeSelector",loc:this.getLocation(t,this.tokenStart),name:e,matcher:r,value:n,flags:i}}function wn(t){this.token(9,"["),this.node(t.name),t.matcher!==null&&(this.tokenize(t.matcher),this.node(t.value)),t.flags!==null&&this.token(1,t.flags),this.token(9,"]")}var An={};k(An,{generate:()=>Tn,name:()=>uu,parse:()=>Ln,structure:()=>pu,walkContext:()=>hu});var lu=38;function Ia(){return this.Raw(null,!0)}function Da(){return this.parseWithFallback(this.Rule,Ia)}function Pa(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function cu(){if(this.tokenType===17)return Pa.call(this,this.tokenIndex);let t=this.parseWithFallback(this.Declaration,Pa);return this.tokenType===17&&this.next(),t}var uu="Block",hu="block",pu={children:[["Atrule","Rule","Declaration"]]};function Ln(t){let e=t?cu:Da,r=this.tokenStart,n=this.createList();this.eat(23);e:for(;!this.eof;)switch(this.tokenType){case 24:break e;case 13:case 25:this.next();break;case 3:n.push(this.parseWithFallback(this.Atrule.bind(this,t),Ia));break;default:t&&this.isDelim(lu)?n.push(Da.call(this)):n.push(e.call(this))}return this.eof||this.eat(24),{type:"Block",loc:this.getLocation(r,this.tokenStart),children:n}}function Tn(t){this.token(23,"{"),this.children(t,e=>{e.type==="Declaration"&&this.token(17,";")}),this.token(24,"}")}var Dn={};k(Dn,{generate:()=>Nn,name:()=>fu,parse:()=>En,structure:()=>mu});var fu="Brackets",mu={children:[[]]};function En(t,e){let r=this.tokenStart,n=null;return this.eat(19),n=t.call(this,e),this.eof||this.eat(20),{type:"Brackets",loc:this.getLocation(r,this.tokenStart),children:n}}function Nn(t){this.token(9,"["),this.children(t),this.token(9,"]")}var Rn={};k(Rn,{generate:()=>In,name:()=>du,parse:()=>Pn,structure:()=>xu});var du="CDC",xu=[];function Pn(){let t=this.tokenStart;return this.eat(15),{type:"CDC",loc:this.getLocation(t,this.tokenStart)}}function In(){this.token(15,"-->")}var _n={};k(_n,{generate:()=>On,name:()=>ku,parse:()=>Fn,structure:()=>gu});var ku="CDO",gu=[];function Fn(){let t=this.tokenStart;return this.eat(14),{type:"CDO",loc:this.getLocation(t,this.tokenStart)}}function On(){this.token(14,"<!--")}var qn={};k(qn,{generate:()=>Bn,name:()=>bu,parse:()=>kt,structure:()=>yu});var Su=46,bu="ClassSelector",yu={name:String};function kt(){return this.eatDelim(Su),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function Bn(t){this.token(9,"."),this.token(1,t.name)}var Un={};k(Un,{generate:()=>Mn,name:()=>Lu,parse:()=>gt,structure:()=>Tu});var Cu=43,Ra=47,wu=62,vu=126,Lu="Combinator",Tu={name:String};function gt(){let t=this.tokenStart,e;switch(this.tokenType){case 13:e=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case wu:case Cu:case vu:this.next();break;case Ra:this.next(),this.eatIdent("deep"),this.eatDelim(Ra);break;default:this.error("Combinator is expected")}e=this.substrToCursor(t);break}return{type:"Combinator",loc:this.getLocation(t,this.tokenStart),name:e}}function Mn(t){this.tokenize(t.name)}var jn={};k(jn,{generate:()=>zn,name:()=>Nu,parse:()=>Wn,structure:()=>Du});var Au=42,Eu=47,Nu="Comment",Du={value:String};function Wn(){let t=this.tokenStart,e=this.tokenEnd;return this.eat(25),e-t+2>=2&&this.charCodeAt(e-2)===Au&&this.charCodeAt(e-1)===Eu&&(e-=2),{type:"Comment",loc:this.getLocation(t,this.tokenStart),value:this.substring(t+2,e)}}function zn(t){this.token(25,"/*"+t.value+"*/")}var Gn={};k(Gn,{generate:()=>Hn,name:()=>Iu,parse:()=>Vn,structure:()=>Ru});var Pu=new Set([16,22,0]),Iu="Condition",Ru={kind:String,children:[["Identifier","Feature","FeatureFunction","FeatureRange","SupportsDeclaration"]]};function Fa(t){return this.lookupTypeNonSC(1)===1&&Pu.has(this.lookupTypeNonSC(2))?this.Feature(t):this.FeatureRange(t)}var Fu={media:Fa,container:Fa,supports(){return this.SupportsDeclaration()}};function Vn(t="media"){let e=this.createList();e:for(;!this.eof;)switch(this.tokenType){case 25:case 13:this.next();continue;case 1:e.push(this.Identifier());break;case 21:{let r=this.parseWithFallback(()=>Fu[t].call(this,t),()=>null);r||(r=this.parseWithFallback(()=>{this.eat(21);let n=this.Condition(t);return this.eat(22),n},()=>this.GeneralEnclosed(t))),e.push(r);break}case 2:{let r=this.parseWithFallback(()=>this.FeatureFunction(t),()=>null);r||(r=this.GeneralEnclosed(t)),e.push(r);break}default:break e}return e.isEmpty&&this.error("Condition is expected"),{type:"Condition",loc:this.getLocationFromList(e),kind:t,children:e}}function Hn(t){t.children.forEach(e=>{e.type==="Condition"?(this.toke