UNPKG

@applitools/css-tree

Version:

A temporary custom copy of https://github.com/csstree/csstree

12 lines 184 kB
var Is=Object.create;var Zr=Object.defineProperty;var Ds=Object.getOwnPropertyDescriptor;var Ns=Object.getOwnPropertyNames;var Os=Object.getPrototypeOf,Fs=Object.prototype.hasOwnProperty;var Oe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),x=(e,t)=>{for(var r in t)Zr(e,r,{get:t[r],enumerable:!0})},zs=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ns(t))!Fs.call(e,i)&&i!==r&&Zr(e,i,{get:()=>t[i],enumerable:!(n=Ds(t,i))||n.enumerable});return e};var Rs=(e,t,r)=>(r=e!=null?Is(Os(e)):{},zs(t||!e||!e.__esModule?Zr(r,"default",{value:e,enumerable:!0}):r,e));var yo=Oe(ln=>{var xo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");ln.encode=function(e){if(0<=e&&e<xo.length)return xo[e];throw new TypeError("Must be between 0 and 63: "+e)};ln.decode=function(e){var t=65,r=90,n=97,i=122,o=48,s=57,u=43,l=47,a=26,c=52;return t<=e&&e<=r?e-t:n<=e&&e<=i?e-n+a:o<=e&&e<=s?e-o+c:e==u?62:e==l?63:-1}});var Co=Oe(un=>{var ko=yo(),cn=5,wo=1<<cn,vo=wo-1,So=wo;function Ks(e){return e<0?(-e<<1)+1:(e<<1)+0}function Qs(e){var t=(e&1)===1,r=e>>1;return t?-r:r}un.encode=function(t){var r="",n,i=Ks(t);do n=i&vo,i>>>=cn,i>0&&(n|=So),r+=ko.encode(n);while(i>0);return r};un.decode=function(t,r,n){var i=t.length,o=0,s=0,u,l;do{if(r>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(l=ko.decode(t.charCodeAt(r++)),l===-1)throw new Error("Invalid base64 digit: "+t.charAt(r-1));u=!!(l&So),l&=vo,o=o+(l<<s),s+=cn}while(u);n.value=Qs(o),n.rest=r}});var Et=Oe(Q=>{function Xs(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}Q.getArg=Xs;var To=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,$s=/^data:.+\,.+$/;function nt(e){var t=e.match(To);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}Q.urlParse=nt;function Ue(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}Q.urlGenerate=Ue;var Zs=32;function Js(e){var t=[];return function(r){for(var n=0;n<t.length;n++)if(t[n].input===r){var i=t[0];return t[0]=t[n],t[n]=i,t[0].result}var o=e(r);return t.unshift({input:r,result:o}),t.length>Zs&&t.pop(),o}}var pn=Js(function(t){var r=t,n=nt(t);if(n){if(!n.path)return t;r=n.path}for(var i=Q.isAbsolute(r),o=[],s=0,u=0;;)if(s=u,u=r.indexOf("/",s),u===-1){o.push(r.slice(s));break}else for(o.push(r.slice(s,u));u<r.length&&r[u]==="/";)u++;for(var l,a=0,u=o.length-1;u>=0;u--)l=o[u],l==="."?o.splice(u,1):l===".."?a++:a>0&&(l===""?(o.splice(u+1,a),a=0):(o.splice(u,2),a--));return r=o.join("/"),r===""&&(r=i?"/":"."),n?(n.path=r,Ue(n)):r});Q.normalize=pn;function Ao(e,t){e===""&&(e="."),t===""&&(t=".");var r=nt(t),n=nt(e);if(n&&(e=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),Ue(r);if(r||t.match($s))return t;if(n&&!n.host&&!n.path)return n.host=t,Ue(n);var i=t.charAt(0)==="/"?t:pn(e.replace(/\/+$/,"")+"/"+t);return n?(n.path=i,Ue(n)):i}Q.join=Ao;Q.isAbsolute=function(e){return e.charAt(0)==="/"||To.test(e)};function el(e,t){e===""&&(e="."),e=e.replace(/\/$/,"");for(var r=0;t.indexOf(e+"/")!==0;){var n=e.lastIndexOf("/");if(n<0||(e=e.slice(0,n),e.match(/^([^\/]+:\/)?\/*$/)))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)}Q.relative=el;var Eo=function(){var e=Object.create(null);return!("__proto__"in e)}();function Lo(e){return e}function tl(e){return Po(e)?"$"+e:e}Q.toSetString=Eo?Lo:tl;function rl(e){return Po(e)?e.slice(1):e}Q.fromSetString=Eo?Lo:rl;function Po(e){if(!e)return!1;var t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(var r=t-10;r>=0;r--)if(e.charCodeAt(r)!==36)return!1;return!0}function nl(e,t,r){var n=ye(e.source,t.source);return n!==0||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0||r)||(n=e.generatedColumn-t.generatedColumn,n!==0)||(n=e.generatedLine-t.generatedLine,n!==0)?n:ye(e.name,t.name)}Q.compareByOriginalPositions=nl;function il(e,t,r){var n;return n=e.originalLine-t.originalLine,n!==0||(n=e.originalColumn-t.originalColumn,n!==0||r)||(n=e.generatedColumn-t.generatedColumn,n!==0)||(n=e.generatedLine-t.generatedLine,n!==0)?n:ye(e.name,t.name)}Q.compareByOriginalPositionsNoSource=il;function ol(e,t,r){var n=e.generatedLine-t.generatedLine;return n!==0||(n=e.generatedColumn-t.generatedColumn,n!==0||r)||(n=ye(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:ye(e.name,t.name)}Q.compareByGeneratedPositionsDeflated=ol;function al(e,t,r){var n=e.generatedColumn-t.generatedColumn;return n!==0||r||(n=ye(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:ye(e.name,t.name)}Q.compareByGeneratedPositionsDeflatedNoLine=al;function ye(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}function sl(e,t){var r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=ye(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:ye(e.name,t.name)}Q.compareByGeneratedPositionsInflated=sl;function ll(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}Q.parseSourceMapInput=ll;function cl(e,t,r){if(t=t||"",e&&(e[e.length-1]!=="/"&&t[0]!=="/"&&(e+="/"),t=e+t),r){var n=nt(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))}t=Ao(Ue(n),t)}return pn(t)}Q.computeSourceURL=cl});var Do=Oe(Io=>{var hn=Et(),mn=Object.prototype.hasOwnProperty,Pe=typeof Map<"u";function ke(){this._array=[],this._set=Pe?new Map:Object.create(null)}ke.fromArray=function(t,r){for(var n=new ke,i=0,o=t.length;i<o;i++)n.add(t[i],r);return n};ke.prototype.size=function(){return Pe?this._set.size:Object.getOwnPropertyNames(this._set).length};ke.prototype.add=function(t,r){var n=Pe?t:hn.toSetString(t),i=Pe?this.has(t):mn.call(this._set,n),o=this._array.length;(!i||r)&&this._array.push(t),i||(Pe?this._set.set(t,o):this._set[n]=o)};ke.prototype.has=function(t){if(Pe)return this._set.has(t);var r=hn.toSetString(t);return mn.call(this._set,r)};ke.prototype.indexOf=function(t){if(Pe){var r=this._set.get(t);if(r>=0)return r}else{var n=hn.toSetString(t);if(mn.call(this._set,n))return this._set[n]}throw new Error('"'+t+'" is not in the set.')};ke.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)};ke.prototype.toArray=function(){return this._array.slice()};Io.ArraySet=ke});var Fo=Oe(Oo=>{var No=Et();function ul(e,t){var r=e.generatedLine,n=t.generatedLine,i=e.generatedColumn,o=t.generatedColumn;return n>r||n==r&&o>=i||No.compareByGeneratedPositionsInflated(e,t)<=0}function Lt(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Lt.prototype.unsortedForEach=function(t,r){this._array.forEach(t,r)};Lt.prototype.add=function(t){ul(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))};Lt.prototype.toArray=function(){return this._sorted||(this._array.sort(No.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};Oo.MappingList=Lt});var Ro=Oe(zo=>{var it=Co(),H=Et(),Pt=Do().ArraySet,pl=Fo().MappingList;function oe(e){e||(e={}),this._file=H.getArg(e,"file",null),this._sourceRoot=H.getArg(e,"sourceRoot",null),this._skipValidation=H.getArg(e,"skipValidation",!1),this._sources=new Pt,this._names=new Pt,this._mappings=new pl,this._sourcesContents=null}oe.prototype._version=3;oe.fromSourceMap=function(t){var r=t.sourceRoot,n=new oe({file:t.file,sourceRoot:r});return t.eachMapping(function(i){var o={generated:{line:i.generatedLine,column:i.generatedColumn}};i.source!=null&&(o.source=i.source,r!=null&&(o.source=H.relative(r,o.source)),o.original={line:i.originalLine,column:i.originalColumn},i.name!=null&&(o.name=i.name)),n.addMapping(o)}),t.sources.forEach(function(i){var o=i;r!==null&&(o=H.relative(r,i)),n._sources.has(o)||n._sources.add(o);var s=t.sourceContentFor(i);s!=null&&n.setSourceContent(i,s)}),n};oe.prototype.addMapping=function(t){var r=H.getArg(t,"generated"),n=H.getArg(t,"original",null),i=H.getArg(t,"source",null),o=H.getArg(t,"name",null);this._skipValidation||this._validateMapping(r,n,i,o),i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),o!=null&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:i,name:o})};oe.prototype.setSourceContent=function(t,r){var n=t;this._sourceRoot!=null&&(n=H.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[H.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[H.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};oe.prototype.applySourceMap=function(t,r,n){var i=r;if(r==null){if(t.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=t.file}var o=this._sourceRoot;o!=null&&(i=H.relative(o,i));var s=new Pt,u=new Pt;this._mappings.unsortedForEach(function(l){if(l.source===i&&l.originalLine!=null){var a=t.originalPositionFor({line:l.originalLine,column:l.originalColumn});a.source!=null&&(l.source=a.source,n!=null&&(l.source=H.join(n,l.source)),o!=null&&(l.source=H.relative(o,l.source)),l.originalLine=a.line,l.originalColumn=a.column,a.name!=null&&(l.name=a.name))}var c=l.source;c!=null&&!s.has(c)&&s.add(c);var h=l.name;h!=null&&!u.has(h)&&u.add(h)},this),this._sources=s,this._names=u,t.sources.forEach(function(l){var a=t.sourceContentFor(l);a!=null&&(n!=null&&(l=H.join(n,l)),o!=null&&(l=H.relative(o,l)),this.setSourceContent(l,a))},this)};oe.prototype._validateMapping=function(t,r,n,i){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("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(!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!r&&!n&&!i)){if(t&&"line"in t&&"column"in t&&r&&"line"in r&&"column"in r&&t.line>0&&t.column>=0&&r.line>0&&r.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:n,original:r,name:i}))}};oe.prototype._serializeMappings=function(){for(var t=0,r=1,n=0,i=0,o=0,s=0,u="",l,a,c,h,m=this._mappings.toArray(),f=0,S=m.length;f<S;f++){if(a=m[f],l="",a.generatedLine!==r)for(t=0;a.generatedLine!==r;)l+=";",r++;else if(f>0){if(!H.compareByGeneratedPositionsInflated(a,m[f-1]))continue;l+=","}l+=it.encode(a.generatedColumn-t),t=a.generatedColumn,a.source!=null&&(h=this._sources.indexOf(a.source),l+=it.encode(h-s),s=h,l+=it.encode(a.originalLine-1-i),i=a.originalLine-1,l+=it.encode(a.originalColumn-n),n=a.originalColumn,a.name!=null&&(c=this._names.indexOf(a.name),l+=it.encode(c-o),o=c)),u+=l}return u};oe.prototype._generateSourcesContent=function(t,r){return t.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=H.relative(r,n));var i=H.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)};oe.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(t.file=this._file),this._sourceRoot!=null&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t};oe.prototype.toString=function(){return JSON.stringify(this.toJSON())};zo.SourceMapGenerator=oe});var Fe={};x(Fe,{AtKeyword:()=>D,BadString:()=>Ae,BadUrl:()=>V,CDC:()=>W,CDO:()=>pe,Colon:()=>O,Comma:()=>_,Comment:()=>L,Delim:()=>y,Dimension:()=>k,EOF:()=>ne,Function:()=>g,Hash:()=>T,Ident:()=>p,LeftCurlyBracket:()=>P,LeftParenthesis:()=>w,LeftSquareBracket:()=>j,Number:()=>b,Percentage:()=>E,RightCurlyBracket:()=>q,RightParenthesis:()=>d,RightSquareBracket:()=>K,Semicolon:()=>R,String:()=>G,Url:()=>B,WhiteSpace:()=>v});var ne=0,p=1,g=2,D=3,T=4,G=5,Ae=6,B=7,V=8,y=9,b=10,E=11,k=12,v=13,pe=14,W=15,O=16,R=17,_=18,j=19,K=20,w=21,d=22,P=23,q=24,L=25;function U(e){return e>=48&&e<=57}function te(e){return U(e)||e>=65&&e<=70||e>=97&&e<=102}function yt(e){return e>=65&&e<=90}function Ms(e){return e>=97&&e<=122}function Bs(e){return yt(e)||Ms(e)}function _s(e){return e>=128}function xt(e){return Bs(e)||_s(e)||e===95}function ze(e){return xt(e)||U(e)||e===45}function js(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function Ze(e){return e===10||e===13||e===12}function he(e){return Ze(e)||e===32||e===9}function $(e,t){return!(e!==92||Ze(t)||t===0)}function Re(e,t,r){return e===45?xt(t)||t===45||$(t,r):xt(e)?!0:e===92?$(e,t):!1}function kt(e,t,r){return e===43||e===45?U(t)?2:t===46&&U(r)?3:0:e===46?U(t)?2:0:U(e)?1:0}function wt(e){return e===65279||e===65534?1:0}var Jr=new Array(128),qs=128,Je=130,en=131,vt=132,tn=133;for(let e=0;e<Jr.length;e++)Jr[e]=he(e)&&Je||U(e)&&en||xt(e)&&vt||js(e)&&tn||e||qs;function St(e){return e<128?Jr[e]:vt}function Me(e,t){return t<e.length?e.charCodeAt(t):0}function Ct(e,t,r){return r===13&&Me(e,t+1)===10?2:1}function be(e,t,r){let n=e.charCodeAt(t);return yt(n)&&(n=n|32),n===r}function xe(e,t,r,n){if(r-t!==n.length||t<0||r>e.length)return!1;for(let i=t;i<r;i++){let o=n.charCodeAt(i-t),s=e.charCodeAt(i);if(yt(s)&&(s=s|32),s!==o)return!1}return!0}function oo(e,t){for(;t>=0&&he(e.charCodeAt(t));t--);return t+1}function et(e,t){for(;t<e.length&&he(e.charCodeAt(t));t++);return t}function rn(e,t){for(;t<e.length&&U(e.charCodeAt(t));t++);return t}function le(e,t){if(t+=2,te(Me(e,t-1))){for(let n=Math.min(e.length,t+5);t<n&&te(Me(e,t));t++);let r=Me(e,t);he(r)&&(t+=Ct(e,t,r))}return t}function tt(e,t){for(;t<e.length;t++){let r=e.charCodeAt(t);if(!ze(r)){if($(r,Me(e,t+1))){t=le(e,t)-1;continue}break}}return t}function Ee(e,t){let r=e.charCodeAt(t);if((r===43||r===45)&&(r=e.charCodeAt(t+=1)),U(r)&&(t=rn(e,t+1),r=e.charCodeAt(t)),r===46&&U(e.charCodeAt(t+1))&&(t+=2,t=rn(e,t)),be(e,t,101)){let n=0;r=e.charCodeAt(t+1),(r===45||r===43)&&(n=1,r=e.charCodeAt(t+2)),U(r)&&(t=rn(e,t+1+n+1))}return t}function Tt(e,t){for(;t<e.length;t++){let r=e.charCodeAt(t);if(r===41){t++;break}$(r,Me(e,t+1))&&(t=le(e,t))}return t}function Be(e){if(e.length===1&&!te(e.charCodeAt(0)))return e[0];let t=parseInt(e,16);return(t===0||t>=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}var _e=["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(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,16384)):e}var ao=10,Us=12,so=13;function lo(e){let t=e.source,r=t.length,n=t.length>0?wt(t.charCodeAt(0)):0,i=je(e.lines,r),o=je(e.columns,r),s=e.startLine,u=e.startColumn;for(let l=n;l<r;l++){let a=t.charCodeAt(l);i[l]=s,o[l]=u++,(a===ao||a===so||a===Us)&&(a===so&&l+1<r&&t.charCodeAt(l+1)===ao&&(l++,i[l]=s,o[l]=u),s++,u=1)}i[r]=s,o[r]=u,e.lines=i,e.columns=o,e.computed=!0}var At=class{constructor(){this.lines=null,this.columns=null,this.computed=!1}setSource(t,r=0,n=1,i=1){this.source=t,this.startOffset=r,this.startLine=n,this.startColumn=i,this.computed=!1}getLocation(t,r){return this.computed||lo(this),{source:r,offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}getLocationRange(t,r,n){return this.computed||lo(this),{source:n,start:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]},end:{offset:this.startOffset+r,line:this.lines[r],column:this.columns[r]}}}};var ie=16777215,me=24,Ws=new Map([[2,22],[21,22],[19,20],[23,24]]),rt=class{constructor(t,r){this.setSource(t,r)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(t="",r=()=>{}){t=String(t||"");let n=t.length,i=je(this.offsetAndType,t.length+1),o=je(this.balance,t.length+1),s=0,u=0,l=0,a=-1;for(this.offsetAndType=null,this.balance=null,r(t,(c,h,m)=>{switch(c){default:o[s]=n;break;case u:{let f=l&ie;for(l=o[f],u=l>>me,o[s]=f,o[f++]=s;f<s;f++)o[f]===n&&(o[f]=s);break}case 21:case 2:case 19:case 23:o[s]=l,u=Ws.get(c),l=u<<me|s;break}i[s++]=c<<me|m,a===-1&&(a=h)}),i[s]=0<<me|n,o[s]=n,o[n]=n;l!==0;){let c=l&ie;l=o[c],o[c]=n}this.source=t,this.firstCharOffset=a===-1?0:a,this.tokenCount=s,this.offsetAndType=i,this.balance=o,this.reset(),this.next()}lookupType(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t]>>me:0}lookupTypeNonSC(t){for(let r=this.tokenIndex;r<this.tokenCount;r++){let n=this.offsetAndType[r]>>me;if(n!==13&&n!==25&&t--===0)return n}return 0}lookupOffset(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t-1]&ie:this.source.length}lookupOffsetNonSC(t){for(let r=this.tokenIndex;r<this.tokenCount;r++){let n=this.offsetAndType[r]>>me;if(n!==13&&n!==25&&t--===0)return r-this.tokenIndex}return 0}lookupValue(t,r){return t+=this.tokenIndex,t<this.tokenCount?xe(this.source,this.offsetAndType[t-1]&ie,this.offsetAndType[t]&ie,r):!1}getTokenStart(t){return t===this.tokenIndex?this.tokenStart:t>0?t<this.tokenCount?this.offsetAndType[t-1]&ie:this.offsetAndType[this.tokenCount]&ie:this.firstCharOffset}substrToCursor(t){return this.source.substring(t,this.tokenStart)}isBalanceEdge(t){return this.balance[this.tokenIndex]<t}isDelim(t,r){return r?this.lookupType(r)===9&&this.source.charCodeAt(this.lookupOffset(r))===t:this.tokenType===9&&this.source.charCodeAt(this.tokenStart)===t}skip(t){let r=this.tokenIndex+t;r<this.tokenCount?(this.tokenIndex=r,this.tokenStart=this.offsetAndType[r-1]&ie,r=this.offsetAndType[r],this.tokenType=r>>me,this.tokenEnd=r&ie):(this.tokenIndex=this.tokenCount,this.next())}next(){let t=this.tokenIndex+1;t<this.tokenCount?(this.tokenIndex=t,this.tokenStart=this.tokenEnd,t=this.offsetAndType[t],this.tokenType=t>>me,this.tokenEnd=t&ie):(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(t,r){let n=t,i,o;e:for(;n<this.tokenCount;n++){if(i=this.balance[n],i<t)break e;switch(o=n>0?this.offsetAndType[n-1]&ie:this.firstCharOffset,r(this.source.charCodeAt(o))){case 1:break e;case 2:n++;break e;default:this.balance[i]===n&&(n=i)}}this.skip(n-this.tokenIndex)}forEachToken(t){for(let r=0,n=this.firstCharOffset;r<this.tokenCount;r++){let i=n,o=this.offsetAndType[r],s=o&ie,u=o>>me;n=s,t(u,i,s,r)}}dump(){let t=new Array(this.tokenCount);return this.forEachToken((r,n,i,o)=>{t[o]={idx:o,type:_e[r],chunk:this.source.substring(n,i),balance:this.balance[o]}}),t}};function Se(e,t){function r(h){return h<u?e.charCodeAt(h):0}function n(){if(a=Ee(e,a),Re(r(a),r(a+1),r(a+2))){c=12,a=tt(e,a);return}if(r(a)===37){c=11,a++;return}c=10}function i(){let h=a;if(a=tt(e,a),xe(e,h,a,"url")&&r(a)===40){if(a=et(e,a+1),r(a)===34||r(a)===39){c=2,a=h+4;return}s();return}if(r(a)===40){c=2,a++;return}c=1}function o(h){for(h||(h=r(a++)),c=5;a<e.length;a++){let m=e.charCodeAt(a);switch(St(m)){case h:a++;return;case Je:if(Ze(m)){a+=Ct(e,a,m),c=6;return}break;case 92:if(a===e.length-1)break;let f=r(a+1);Ze(f)?a+=Ct(e,a+1,f):$(m,f)&&(a=le(e,a)-1);break}}}function s(){for(c=7,a=et(e,a);a<e.length;a++){let h=e.charCodeAt(a);switch(St(h)){case 41:a++;return;case Je:if(a=et(e,a),r(a)===41||a>=e.length){a<e.length&&a++;return}a=Tt(e,a),c=8;return;case 34:case 39:case 40:case tn:a=Tt(e,a),c=8;return;case 92:if($(h,r(a+1))){a=le(e,a)-1;break}a=Tt(e,a),c=8;return}}}e=String(e||"");let u=e.length,l=wt(r(0)),a=l,c;for(;a<u;){let h=e.charCodeAt(a);switch(St(h)){case Je:c=13,a=et(e,a+1);break;case 34:o();break;case 35:ze(r(a+1))||$(r(a+1),r(a+2))?(c=4,a=tt(e,a+1)):(c=9,a++);break;case 39:o();break;case 40:c=21,a++;break;case 41:c=22,a++;break;case 43:kt(h,r(a+1),r(a+2))?n():(c=9,a++);break;case 44:c=18,a++;break;case 45:kt(h,r(a+1),r(a+2))?n():r(a+1)===45&&r(a+2)===62?(c=15,a=a+3):Re(h,r(a+1),r(a+2))?i():(c=9,a++);break;case 46:kt(h,r(a+1),r(a+2))?n():(c=9,a++);break;case 47:r(a+1)===42?(c=25,a=e.indexOf("*/",a+2),a=a===-1?e.length:a+2):(c=9,a++);break;case 58:c=16,a++;break;case 59:c=17,a++;break;case 60:r(a+1)===33&&r(a+2)===45&&r(a+3)===45?(c=14,a=a+4):(c=9,a++);break;case 64:Re(r(a+1),r(a+2),r(a+3))?(c=3,a=tt(e,a+1)):(c=9,a++);break;case 91:c=19,a++;break;case 92:$(h,r(a+1))?i():(c=9,a++);break;case 93:c=20,a++;break;case 123:c=23,a++;break;case 125:c=24,a++;break;case en:n();break;case vt:i();break;default:c=9,a++}t(c,l,l=a)}}var qe=null,N=class{static createItem(t){return{prev:null,next:null,data:t}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(t){return N.createItem(t)}allocateCursor(t,r){let n;return qe!==null?(n=qe,qe=qe.cursor,n.prev=t,n.next=r,n.cursor=this.cursor):n={prev:t,next:r,cursor:this.cursor},this.cursor=n,n}releaseCursor(){let{cursor:t}=this;this.cursor=t.cursor,t.prev=null,t.next=null,t.cursor=qe,qe=t}updateCursors(t,r,n,i){let{cursor:o}=this;for(;o!==null;)o.prev===t&&(o.prev=r),o.next===n&&(o.next=i),o=o.cursor}*[Symbol.iterator](){for(let t=this.head;t!==null;t=t.next)yield t.data}get size(){let t=0;for(let r=this.head;r!==null;r=r.next)t++;return t}get isEmpty(){return this.head===null}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(t){let r=null;this.head=null;for(let n of t){let i=N.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(t,r=this){let n=this.allocateCursor(null,this.head);for(;n.next!==null;){let i=n.next;n.next=i.next,t.call(r,i.data,i,this)}this.releaseCursor()}forEachRight(t,r=this){let n=this.allocateCursor(this.tail,null);for(;n.prev!==null;){let i=n.prev;n.prev=i.prev,t.call(r,i.data,i,this)}this.releaseCursor()}reduce(t,r,n=this){let i=this.allocateCursor(null,this.head),o=r,s;for(;i.next!==null;)s=i.next,i.next=s.next,o=t.call(n,o,s.data,s,this);return this.releaseCursor(),o}reduceRight(t,r,n=this){let i=this.allocateCursor(this.tail,null),o=r,s;for(;i.prev!==null;)s=i.prev,i.prev=s.prev,o=t.call(n,o,s.data,s,this);return this.releaseCursor(),o}some(t,r=this){for(let n=this.head;n!==null;n=n.next)if(t.call(r,n.data,n,this))return!0;return!1}map(t,r=this){let n=new N;for(let i=this.head;i!==null;i=i.next)n.appendData(t.call(r,i.data,i,this));return n}filter(t,r=this){let n=new N;for(let i=this.head;i!==null;i=i.next)t.call(r,i.data,i,this)&&n.appendData(i.data);return n}nextUntil(t,r,n=this){if(t===null)return;let i=this.allocateCursor(null,t);for(;i.next!==null;){let o=i.next;if(i.next=o.next,r.call(n,o.data,o,this))break}this.releaseCursor()}prevUntil(t,r,n=this){if(t===null)return;let i=this.allocateCursor(t,null);for(;i.prev!==null;){let o=i.prev;if(i.prev=o.prev,r.call(n,o.data,o,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){let t=new N;for(let r of this)t.appendData(r);return t}prepend(t){return this.updateCursors(null,t,this.head,t),this.head!==null?(this.head.prev=t,t.next=this.head):this.tail=t,this.head=t,this}prependData(t){return this.prepend(N.createItem(t))}append(t){return this.insert(t)}appendData(t){return this.insert(N.createItem(t))}insert(t,r=null){if(r!==null)if(this.updateCursors(r.prev,t,r,t),r.prev===null){if(this.head!==r)throw new Error("before doesn't belong to list");this.head=t,r.prev=t,t.next=r,this.updateCursors(null,t)}else r.prev.next=t,t.prev=r.prev,r.prev=t,t.next=r;else this.updateCursors(this.tail,t,null,t),this.tail!==null?(this.tail.next=t,t.prev=this.tail):this.head=t,this.tail=t;return this}insertData(t,r){return this.insert(N.createItem(t),r)}remove(t){if(this.updateCursors(t,t.prev,t,t.next),t.prev!==null)t.prev.next=t.next;else{if(this.head!==t)throw new Error("item doesn't belong to list");this.head=t.next}if(t.next!==null)t.next.prev=t.prev;else{if(this.tail!==t)throw new Error("item doesn't belong to list");this.tail=t.prev}return t.prev=null,t.next=null,t}push(t){this.insert(N.createItem(t))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(t){this.prepend(N.createItem(t))}shift(){return this.head!==null?this.remove(this.head):null}prependList(t){return this.insertList(t,this.head)}appendList(t){return this.insertList(t)}insertList(t,r){return t.head===null?this:(r!=null?(this.updateCursors(r.prev,t.tail,r,t.head),r.prev!==null?(r.prev.next=t.head,t.head.prev=r.prev):this.head=t.head,r.prev=t.tail,t.tail.next=r):(this.updateCursors(this.tail,t.tail,null,t.head),this.tail!==null?(this.tail.next=t.head,t.head.prev=this.tail):this.head=t.head,this.tail=t.tail),t.head=null,t.tail=null,this)}replace(t,r){"head"in r?this.insertList(r,t):this.insert(r,t),this.remove(t)}};function Le(e,t){let r=Object.create(SyntaxError.prototype),n=new Error;return Object.assign(r,{name:e,message:t,get stack(){return(n.stack||"").replace(/^(.+\n){1,3}/,`${e}: ${t} `)}})}var nn=100,co=60,uo=" ";function po({source:e,line:t,column:r,baseLine:n,baseColumn:i},o){function s(S,J){return a.slice(S,J).map((Y,C)=>String(S+C+1).padStart(m)+" |"+Y).join(` `)}let u=` `.repeat(Math.max(n-1,0)),l=" ".repeat(Math.max(i-1,0)),a=(u+l+e).split(/\r\n?|\n|\f/),c=Math.max(1,t-o)-1,h=Math.min(t+o,a.length+1),m=Math.max(4,String(h).length)+1,f=0;r+=(uo.length-1)*(a[t-1].substr(0,r-1).match(/\t/g)||[]).length,r>nn&&(f=r-co+3,r=co-2);for(let S=c;S<=h;S++)S>=0&&S<a.length&&(a[S]=a[S].replace(/\t/g,uo),a[S]=(f>0&&a[S].length>f?"\u2026":"")+a[S].substr(f,nn-2)+(a[S].length>f+nn-1?"\u2026":""));return[s(c,t),new Array(r+m+2).join("-")+"^",s(t,h)].filter(Boolean).join(` `).replace(/^(\s+\d+\s+\|\n)+/,"").replace(/\n(\s+\d+\s+\|)+$/,"")}function on(e,t,r,n,i,o=1,s=1){return Object.assign(Le("SyntaxError",e),{source:t,offset:r,line:n,column:i,sourceFragment(l){return po({source:t,line:n,column:i,baseLine:o,baseColumn:s},isNaN(l)?0:l)},get formattedMessage(){return`Parse error: ${e} `+po({source:t,line:n,column:i,baseLine:o,baseColumn:s},2)}})}function ho(e){let t=this.createList(),r=!1,n={recognizer:e};for(;!this.eof;){switch(this.tokenType){case 25:this.next();continue;case 13:r=!0,this.next();continue}let i=e.getNode.call(this,n);if(i===void 0)break;r&&(e.onWhiteSpace&&e.onWhiteSpace.call(this,i,t,n),r=!1),t.push(i)}return r&&e.onWhiteSpace&&e.onWhiteSpace.call(this,null,t,n),t}var mo=()=>{},Hs=33,Gs=35,an=59,fo=123,go=0;function Ys(e){return function(){return this[e]()}}function sn(e){let t=Object.create(null);for(let r of Object.keys(e)){let n=e[r],i=n.parse||n;i&&(t[r]=i)}return t}function Vs(e){let t={context:Object.create(null),features:Object.assign(Object.create(null),e.features),scope:Object.assign(Object.create(null),e.scope),atrule:sn(e.atrule),pseudo:sn(e.pseudo),node:sn(e.node)};for(let[r,n]of Object.entries(e.parseContext))switch(typeof n){case"function":t.context[r]=n;break;case"string":t.context[r]=Ys(n);break}return{config:t,...t,...t.node}}function bo(e){let t="",r="<unknown>",n=!1,i=mo,o=!1,s=new At,u=Object.assign(new rt,Vs(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:ho,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(a){return a===fo?1:0},consumeUntilLeftCurlyBracketOrSemicolon(a){return a===fo||a===an?1:0},consumeUntilExclamationMarkOrSemicolon(a){return a===Hs||a===an?1:0},consumeUntilSemicolonIncluded(a){return a===an?2:0},createList(){return new N},createSingleNodeList(a){return new N().appendData(a)},getFirstListNode(a){return a&&a.first},getLastListNode(a){return a&&a.last},parseWithFallback(a,c){let h=this.tokenIndex;try{return a.call(this)}catch(m){if(o)throw m;this.skip(h-this.tokenIndex);let f=c.call(this);return o=!0,i(m,f),o=!1,f}},lookupNonWSType(a){let c;do if(c=this.lookupType(a++),c!==13&&c!==25)return c;while(c!==go);return go},charCodeAt(a){return a>=0&&a<t.length?t.charCodeAt(a):0},substring(a,c){return t.substring(a,c)},substrToCursor(a){return this.source.substring(a,this.tokenStart)},cmpChar(a,c){return be(t,a,c)},cmpStr(a,c,h){return xe(t,a,c,h)},consume(a){let c=this.tokenStart;return this.eat(a),this.substrToCursor(c)},consumeFunctionName(){let a=t.substring(this.tokenStart,this.tokenEnd-1);return this.eat(2),a},consumeNumber(a){let c=t.substring(this.tokenStart,Ee(t,this.tokenStart));return this.eat(a),c},eat(a){if(this.tokenType!==a){let c=_e[a].slice(0,-6).replace(/-/g," ").replace(/^./,f=>f.toUpperCase()),h=`${/[[\](){}]/.test(c)?`"${c}"`:c} is expected`,m=this.tokenStart;switch(a){case 1:this.tokenType===2||this.tokenType===7?(m=this.tokenEnd-1,h="Identifier is expected but function found"):h="Identifier is expected";break;case 4:this.isDelim(Gs)&&(this.next(),m++,h="Name is expected");break;case 11:this.tokenType===10&&(m=this.tokenEnd,h="Percent sign is expected");break}this.error(h,m)}this.next()},eatIdent(a){(this.tokenType!==1||this.lookupValue(0,a)===!1)&&this.error(`Identifier "${a}" is expected`),this.next()},eatDelim(a){this.isDelim(a)||this.error(`Delim "${String.fromCharCode(a)}" is expected`),this.next()},getLocation(a,c){return n?s.getLocationRange(a,c,r):null},getLocationFromList(a){if(n){let c=this.getFirstListNode(a),h=this.getLastListNode(a);return s.getLocationRange(c!==null?c.loc.start.offset-s.startOffset:this.tokenStart,h!==null?h.loc.end.offset-s.startOffset:this.tokenStart,r)}return null},error(a,c){let h=typeof c!="undefined"&&c<t.length?s.getLocation(c):this.eof?s.getLocation(oo(t,t.length-1)):s.getLocation(this.tokenStart);throw new on(a||"Unexpected input",t,h.offset,h.line,h.column,s.startLine,s.startColumn)}});return Object.assign(function(a,c){t=a,c=c||{},u.setSource(t,Se),s.setSource(t,c.offset,c.line,c.column),r=c.filename||"<unknown>",n=Boolean(c.positions),i=typeof c.onParseError=="function"?c.onParseError:mo,o=!1,u.parseAtrulePrelude="parseAtrulePrelude"in c?Boolean(c.parseAtrulePrelude):!0,u.parseRulePrelude="parseRulePrelude"in c?Boolean(c.parseRulePrelude):!0,u.parseValue="parseValue"in c?Boolean(c.parseValue):!0,u.parseCustomProperty="parseCustomProperty"in c?Boolean(c.parseCustomProperty):!1;let{context:h="default",onComment:m}=c;if(!(h in u.context))throw new Error("Unknown context `"+h+"`");typeof m=="function"&&u.forEachToken((S,J,Y)=>{if(S===25){let C=u.getLocation(J,Y),M=xe(t,Y-2,Y,"*/")?t.slice(J+2,Y-2):t.slice(J+2,Y);m(M,C)}});let f=u.context[h].call(u,c);return u.eof||u.error(),f},{SyntaxError:on,config:u.config})}var Bo=Rs(Ro(),1),Mo=new Set(["Atrule","Selector","Declaration"]);function _o(e){let t=new Bo.SourceMapGenerator,r={line:1,column:0},n={line:0,column:0},i={line:1,column:0},o={generated:i},s=1,u=0,l=!1,a=e.node;e.node=function(m){if(m.loc&&m.loc.start&&Mo.has(m.type)){let f=m.loc.start.line,S=m.loc.start.column-1;(n.line!==f||n.column!==S)&&(n.line=f,n.column=S,r.line=s,r.column=u,l&&(l=!1,(r.line!==i.line||r.column!==i.column)&&t.addMapping(o)),l=!0,t.addMapping({source:m.loc.source,original:n,generated:r}))}a.call(this,m),l&&Mo.has(m.type)&&(i.line=s,i.column=u)};let c=e.emit;e.emit=function(m,f,S){for(let J=0;J<m.length;J++)m.charCodeAt(J)===10?(s++,u=0):u++;c(m,f,S)};let h=e.result;return e.result=function(){return l&&t.addMapping(o),{css:h(),map:t}},e}var It={};x(It,{safe:()=>dn,spec:()=>dl});var hl=43,ml=45,fn=(e,t)=>{if(e===9&&(e=t),typeof e=="string"){let r=e.charCodeAt(0);return r>127?32768:r<<8}return e},jo=[[1,1],[1,2],[1,7],[1,8],[1,"-"],[1,10],[1,11],[1,12],[1,15],[1,21],[3,1],[3,2],[3,7],[3,8],[3,"-"],[3,10],[3,11],[3,12],[3,15],[4,1],[4,2],[4,7],[4,8],[4,"-"],[4,10],[4,11],[4,12],[4,15],[12,1],[12,2],[12,7],[12,8],[12,"-"],[12,10],[12,11],[12,12],[12,15],["#",1],["#",2],["#",7],["#",8],["#","-"],["#",10],["#",11],["#",12],["#",15],["-",1],["-",2],["-",7],["-",8],["-","-"],["-",10],["-",11],["-",12],["-",15],[10,1],[10,2],[10,7],[10,8],[10,10],[10,11],[10,12],[10,"%"],[10,15],["@",1],["@",2],["@",7],["@",8],["@","-"],["@",15],[".",10],[".",11],[".",12],["+",10],["+",11],["+",12],["/","*"]],fl=jo.concat([[1,4],[12,4],[4,4],[3,21],[3,5],[3,16],[11,11],[11,12],[11,2],[11,"-"],[22,1],[22,2],[22,11],[22,12],[22,4],[22,"-"]]);function qo(e){let t=new Set(e.map(([r,n])=>fn(r)<<16|fn(n)));return function(r,n,i){let o=fn(n,i),s=i.charCodeAt(0);return(s===ml&&n!==1&&n!==2&&n!==15||s===hl?t.has(r<<16|s<<8):t.has(r<<16|o))&&this.emit(" ",13,!0),o}}var dl=qo(jo),dn=qo(fl);var gl=92;function bl(e,t){if(typeof t=="function"){let r=null;e.children.forEach(n=>{r!==null&&t.call(this,r),this.node(n),r=n});return}e.children.forEach(this.node,this)}function xl(e){Se(e,(t,r,n)=>{this.token(t,e.slice(r,n))})}function Uo(e){let t=new Map;for(let[r,n]of Object.entries(e.node))typeof(n.generate||n)=="function"&&t.set(r,n.generate||n);return function(r,n){let i="",o=0,s={node(l){if(t.has(l.type))t.get(l.type).call(u,l);else throw new Error("Unknown node type: "+l.type)},tokenBefore:dn,token(l,a){o=this.tokenBefore(o,l,a),this.emit(a,l,!1),l===9&&a.charCodeAt(0)===gl&&this.emit(` `,13,!0)},emit(l){i+=l},result(){return i}};n&&(typeof n.decorator=="function"&&(s=n.decorator(s)),n.sourceMap&&(s=_o(s)),n.mode in It&&(s.tokenBefore=It[n.mode]));let u={node:l=>s.node(l),children:bl,token:(l,a)=>s.token(l,a),tokenize:xl};return s.node(r),s.result()}}function Wo(e){return{fromPlainObject(t){return e(t,{enter(r){r.children&&!(r.children instanceof N)&&(r.children=new N().fromArray(r.children))}}),t},toPlainObject(t){return e(t,{leave(r){r.children&&r.children instanceof N&&(r.children=r.children.toArray())}}),t}}}var{hasOwnProperty:gn}=Object.prototype,ot=function(){};function Ho(e){return typeof e=="function"?e:ot}function Go(e,t){return function(r,n,i){r.type===t&&e.call(this,r,n,i)}}function yl(e,t){let r=t.structure,n=[];for(let i in r){if(gn.call(r,i)===!1)continue;let o=r[i],s={name:i,type:!1,nullable:!1};Array.isArray(o)||(o=[o]);for(let u of o)u===null?s.nullable=!0:typeof u=="string"?s.type="node":Array.isArray(u)&&(s.type="list");s.type&&n.push(s)}return n.length?{context:t.walkContext,fields:n}:null}function kl(e){let t={};for(let r in e.node)if(gn.call(e.node,r)){let n=e.node[r];if(!n.structure)throw new Error("Missed `structure` field in `"+r+"` node type definition");t[r]=yl(r,n)}return t}function Yo(e,t){let r=e.fields.slice(),n=e.context,i=typeof n=="string";return t&&r.reverse(),function(o,s,u,l){let a;i&&(a=s[n],s[n]=o);for(let c of r){let h=o[c.name];if(!c.nullable||h){if(c.type==="list"){if(t?h.reduceRight(l,!1):h.reduce(l,!1))return!0}else if(u(h))return!0}}i&&(s[n]=a)}}function Vo({StyleSheet:e,Atrule:t,Rule:r,Block:n,DeclarationList:i}){return{Atrule:{StyleSheet:e,Atrule:t,Rule:r,Block:n},Rule:{StyleSheet:e,Atrule:t,Rule:r,Block:n},Declaration:{StyleSheet:e,Atrule:t,Rule:r,Block:n,DeclarationList:i}}}function Ko(e){let t=kl(e),r={},n={},i=Symbol("break-walk"),o=Symbol("skip-node");for(let a in t)gn.call(t,a)&&t[a]!==null&&(r[a]=Yo(t[a],!1),n[a]=Yo(t[a],!0));let s=Vo(r),u=Vo(n),l=function(a,c){function h(C,M,ve){let z=m.call(Y,C,M,ve);return z===i?!0:z===o?!1:!!(S.hasOwnProperty(C.type)&&S[C.type](C,Y,h,J)||f.call(Y,C,M,ve)===i)}let m=ot,f=ot,S=r,J=(C,M,ve,z)=>C||h(M,ve,z),Y={break:i,skip:o,root:a,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if(typeof c=="function")m=c;else if(c&&(m=Ho(c.enter),f=Ho(c.leave),c.reverse&&(S=n),c.visit)){if(s.hasOwnProperty(c.visit))S=c.reverse?u[c.visit]:s[c.visit];else if(!t.hasOwnProperty(c.visit))throw new Error("Bad value `"+c.visit+"` for `visit` option (should be: "+Object.keys(t).sort().join(", ")+")");m=Go(m,c.visit),f=Go(f,c.visit)}if(m===ot&&f===ot)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");h(a)};return l.break=i,l.skip=o,l.find=function(a,c){let h=null;return l(a,function(m,f,S){if(c.call(this,m,f,S))return h=m,i}),h},l.findLast=function(a,c){let h=null;return l(a,{reverse:!0,enter(m,f,S){if(c.call(this,m,f,S))return h=m,i}}),h},l.findAll=function(a,c){let h=[];return l(a,function(m,f,S){c.call(this,m,f,S)&&h.push(m)}),h},l}function wl(e){return e}function vl(e){let{min:t,max:r,comma:n}=e;return t===0&&r===0?n?"#?":"*":t===0&&r===1?"?":t===1&&r===0?n?"#":"+":t===1&&r===1?"":(n?"#":"")+(t===r?"{"+t+"}":"{"+t+","+(r!==0?r:"")+"}")}function Sl(e){switch(e.type){case"Range":return" ["+(e.min===null?"-\u221E":e.min)+","+(e.max===null?"\u221E":e.max)+"]";default:throw new Error("Unknown node type `"+e.type+"`")}}function Cl(e,t,r,n){let i=e.combinator===" "||n?e.combinator:" "+e.combinator+" ",o=e.terms.map(s=>bn(s,t,r,n)).join(i);return e.explicit||r?(n||o[0]===","?"[":"[ ")+o+(n?"]":" ]"):o}function bn(e,t,r,n){let i;switch(e.type){case"Group":i=Cl(e,t,r,n)+(e.disallowEmpty?"!":"");break;case"Multiplier":return bn(e.term,t,r,n)+t(vl(e),e);case"Type":i="<"+e.name+(e.opts?t(Sl(e.opts),e.opts):"")+">";break;case"Property":i="<'"+e.name+"'>";break;case"Keyword":i=e.name;break;case"AtKeyword":i="@"+e.name;break;case"Function":i=e.name+"(";break;case"String":case"Token":i=e.value;break;case"Comma":i=",";break;default:throw new Error("Unknown node type `"+e.type+"`")}return t(i,e)}function Ie(e,t){let r=wl,n=!1,i=!1;return typeof t=="function"?r=t:t&&(n=Boolean(t.forceBraces),i=Boolean(t.compact),typeof t.decorate=="function"&&(r=t.decorate)),bn(e,r,n,i)}var Qo={offset:0,line:1,column:1};function Tl(e,t){let r=e.tokens,n=e.longestMatch,i=n<r.length&&r[n].node||null,o=i!==t?i:null,s=0,u=0,l=0,a="",c,h;for(let m=0;m<r.length;m++){let f=r[m].value;m===n&&(u=f.length,s=a.length),o!==null&&r[m].node===o&&(m<=n?l++:l=0),a+=f}return n===r.length||l>1?(c=Dt(o||t,"end")||at(Qo,a),h=at(c)):(c=Dt(o,"start")||at(Dt(t,"start")||Qo,a.slice(0,s)),h=Dt(o,"end")||at(c,a.substr(s,u))),{css:a,mismatchOffset:s,mismatchLength:u,start:c,end:h}}function Dt(e,t){let r=e&&e.loc&&e.loc[t];return r?"line"in r?at(r):r:null}function at({offset:e,line:t,column:r},n){let i={offset:e,line:t,column:r};if(n){let o=n.split(/\n|\r\n?|\f/);i.offset+=n.length,i.line+=o.length-1,i.column=o.length===1?i.column+n.length:o.pop().length+1}return i}var We=function(e,t){let r=Le("SyntaxReferenceError",e+(t?" `"+t+"`":""));return r.reference=t,r},Xo=function(e,t,r,n){let i=Le("SyntaxMatchError",e),{css:o,mismatchOffset:s,mismatchLength:u,start:l,end:a}=Tl(n,r);return i.rawMessage=e,i.syntax=t?Ie(t):"<generic>",i.css=o,i.mismatchOffset=s,i.mismatchLength=u,i.message=e+` syntax: `+i.syntax+` value: `+(o||"<empty string>")+` --------`+new Array(i.mismatchOffset+1).join("-")+"^",Object.assign(i,l),i.loc={source:r&&r.loc&&r.loc.source||"<unknown>",start:l,end:a},i};var Nt=new Map,He=new Map,Ot=45,Ft=Al,xn=El,Kf=yn;function zt(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===Ot&&e.charCodeAt(t+1)===Ot}function yn(e,t){if(t=t||0,e.length-t>=3&&e.charCodeAt(t)===Ot&&e.charCodeAt(t+1)!==Ot){let r=e.indexOf("-",t+2);if(r!==-1)return e.substring(t,r+1)}return""}function Al(e){if(Nt.has(e))return Nt.get(e);let t=e.toLowerCase(),r=Nt.get(t);if(r===void 0){let n=zt(t,0),i=n?"":yn(t,0);r=Object.freeze({basename:t.substr(i.length),name:t,prefix:i,vendor:i,custom:n})}return Nt.set(e,r),r}function El(e){if(He.has(e))return He.get(e);let t=e,r=e[0];r==="/"?r=e[1]==="/"?"//":"/":r!=="_"&&r!=="*"&&r!=="$"&&r!=="#"&&r!=="+"&&r!=="&"&&(r="");let n=zt(t,r.length);if(!n&&(t=t.toLowerCase(),He.has(t))){let u=He.get(t);return He.set(e,u),u}let i=n?"":yn(t,r.length),o=t.substr(0,r.length+i.length),s=Object.freeze({basename:t.substr(o.length),name:t.substr(r.length),hack:r,vendor:i,prefix:o,custom:n});return He.set(e,s),s}var Rt=["initial","inherit","unset","revert","revert-layer"];var lt=43,fe=45,kn=110,Ge=!0,Pl=!1;function vn(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function st(e,t,r){for(;e!==null&&(e.type===13||e.type===25);)e=r(++t);return t}function Ce(e,t,r,n){if(!e)return 0;let i=e.value.charCodeAt(t);if(i===lt||i===fe){if(r)return 0;t++}for(;t<e.value.length;t++)if(!U(e.value.charCodeAt(t)))return 0;return n+1}function wn(e,t,r){let n=!1,i=st(e,t,r);if(e=r(i),e===null)return t;if(e.type!==10)if(vn(e,lt)||vn(e,fe)){if(n=!0,i=st(r(++i),i,r),e=r(i),e===null||e.type!==10)return 0}else return t;if(!n){let o=e.value.charCodeAt(0);if(o!==lt&&o!==fe)return 0}return Ce(e,n?0:1,n,i)}function Sn(e,t){let r=0;if(!e)return 0;if(e.type===10)return Ce(e,0,Pl,r);if(e.type===1&&e.value.charCodeAt(0)===fe){if(!be(e.value,1,kn))return 0;switch(e.value.length){case 2:return wn(t(++r),r,t);case 3:return e.value.charCodeAt(2)!==fe?0:(r=st(t(++r),r,t),e=t(r),Ce(e,0,Ge,r));default:return e.value.charCodeAt(2)!==fe?0:Ce(e,3,Ge,r)}}else if(e.type===1||vn(e,lt)&&t(r+1).type===1){if(e.type!==1&&(e=t(++r)),e===null||!be(e.value,0,kn))return 0;switch(e.value.length){case 1:return wn(t(++r),r,t);case 2:return e.value.charCodeAt(1)!==fe?0:(r=st(t(++r),r,t),e=t(r),Ce(e,0,Ge,r));default:return e.value.charCodeAt(1)!==fe?0:Ce(e,2,Ge,r)}}else if(e.type===12){let n=e.value.charCodeAt(0),i=n===lt||n===fe?1:0,o=i;for(;o<e.value.length&&U(e.value.charCodeAt(o));o++);return o===i||!be(e.value,o,kn)?0:o+1===e.value.length?wn(t(++r),r,t):e.value.charCodeAt(o+1)!==fe?0:o+2===e.value.length?(r=st(t(++r),r,t),e=t(r),Ce(e,0,Ge,r)):Ce(e,o+2,Ge,r)}return 0}var Il=43,$o=45,Zo=63,Dl=117;function Cn(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function Nl(e,t){return e.value.charCodeAt(0)===t}function ct(e,t,r){let n=0;for(let i=t;i<e.value.length;i++){let o=e.value.charCodeAt(i);if(o===$o&&r&&n!==0)return ct(e,t+n+1,!1),6;if(!te(o)||++n>6)return 0}return n}function Mt(e,t,r){if(!e)return 0;for(;Cn(r(t),Zo);){if(++e>6)return 0;t++}return t}function Tn(e,t){let r=0;if(e===null||e.type!==1||!be(e.value,0,Dl)||(e=t(++r),e===null))return 0;if(Cn(e,Il))return e=t(++r),e===null?0:e.type===1?Mt(ct(e,0,!0),++r,t):Cn(e,Zo)?Mt(1,++r,t):0;if(e.type===10){let n=ct(e,1,!0);return n===0?0:(e=t(++r),e===null?r:e.type===12||e.type===10?!Nl(e,$o)||!ct(e,1,!1)?0:r+1:Mt(n,r,t))}return e.type===12?Mt(ct(e,1,!0),++r,t):0}var Ol=["calc(","-moz-calc(","-webkit-calc("],An=new Map([[2,22],[21,22],[19,20],[23,24]]);function ce(e,t){return t<e.length?e.charCodeAt(t):0}function Jo(e,t){return xe(e,0,e.length,t)}function ea(e,t){for(let r=0;r<t.length;r++)if(Jo(e,t[r]))return!0;return!1}function ta(e,t){return t!==e.length-2?!1:ce(e,t)===92&&U(ce(e,t+1))}function Bt(e,t,r){if(e&&e.type==="Range"){let n=Number(r!==void 0&&r!==t.length?t.substr(0,r):t);if(isNaN(n)||e.min!==null&&n<e.min&&typeof e.min!="string"||e.max!==null&&n>e.max&&typeof e.max!="string")return!0}return!1}function Fl(e,t){let r=0,n=[],i=0;e:do{switch(e.type){case 24:case 22:case 20:if(e.type!==r)break e;if(r=n.pop(),n.length===0){i++;break e}break;case 2:case 21:case 19:case 23:n.push(r),r=An.get(e.type);break}i++}while(e=t(i));return i}function ae(e){return function(t,r,n){return t===null?0:t.type===2&&ea(t.value,Ol)?Fl(t,r):e(t,r,n)}}function F(e){return function(t){return t===null||t.type!==e?0:1}}function zl(e){if(e===null||e.type!==1)return 0;let t=e.value.toLowerCase();return ea(t,Rt)||Jo(t,"default")?0:1}function ra(e){return e===null||e.type!==1||ce(e.value,0)!==45||ce(e.value,1)!==45?0:1}function Rl(e){return!ra(e)||e.value==="--"?0:1}function Ml(e){if(e===null||e.type!==4)return 0;let t=e.value.length;if(t!==4&&t!==5&&t!==7&&t!==9)return 0;for(let r=1;r<t;r++)if(!te(ce(e.value,r)))return 0;return 1}function Bl(e){return e===null||e.type!==4||!Re(ce(e.value,1),ce(e.value,2),ce(e.value,3))?0:1}function _l(e,t){if(!e)return 0;let r=0,n=[],i=0;e:do{switch(e.type){case 6:case 8:break e;case 24:case 22:case 20:if(e.type!==r)break e;r=n.pop();break;case 17:if(r===0)break e;break;case 9:if(r===0&&e.value==="!")break e;break;case 2:case 21:case 19:case 23:n.push(r),r=An.get(e.type);break}i++}while(e=t(i));return i}function jl(e,t){if(!e)return 0;let r=0,n=[],i=0;e:do{switch(e.type){case 6:case 8:break e;case 24:case 22:case 20:if(e.type!==r)break e;r=n.pop();break;case 2:case 21:case 19:case 23:n.push(r),r=An.get(e.type);break}i++}while(e=t(i));return i}function we(e){return e&&(e=new Set(e)),function(t,r,n){if(t===null||t.type!==12)return 0;let i=Ee(t.value,0);if(e!==null){let o=t.value.indexOf("\\",i),s=o===-1||!ta(t.value,o)?t.value.substr(i):t.value.substring(i,o);if(e.has(s.toLowerCase())===!1)return 0}return Bt(n,t.value,i)?0:1}}function ql(e,t,r){return e===null||e.type!==11||Bt(r,e.value,e.value.length-1)?0:1}function na(e){return typeof e!="function"&&(e=function(){return 0}),function(t,r,n){return t!==null&&t.type===10&&Number(t.value)===0?1:e(t,r,n)}}function Ul(e,t,r){if(e===null)return 0;let n=Ee(e.value,0);return!(n===e.value.length)&&!ta(e.value,n)||Bt(r,e.value,n)?0:1}function Wl(e,t,r){if(e===null||e.type!==10)return 0;let n=ce(e.value,0)===43||ce(e.value,0)===45?1:0;for(;n<e.value.length;n++)if(!U(ce(e.value,n)))return 0;return Bt(r,e.value,n)?0:1}var Hl={"ident-token":F(1),"function-token":F(2),"at-keyword-token":F(3),"hash-token":F(4),"string-token":F(5),"bad-string-token":F(6),"url-token":F(7),"bad-url-token":F(8),"delim-token":F(9),"number-token":F(10),"percentage-token":F(11),"dimension-token":F(12),"whitespace-token":F(13),"CDO-token":F(14),"CDC-token":F(15),"colon-token":F(16),"semicolon-token":F(17),"comma-token":F(18),"[-token":F(19),"]-token":F(20),"(-token":F(21),")-token":F(22),"{-token":F(23),"}-token":F(24)},Gl={string:F(5),ident:F(1),percentage:ae(ql),zero:na(),number:ae(Ul),integer:ae(Wl),"custom-ident":zl,"dashed-ident":ra,"custom-property-name":Rl,"hex-color":Ml,"id-selector":Bl,"an-plus-b":Sn,urange:Tn,"declaration-value":_l,"any-value":jl};function Yl(e){let{angle:t,decibel:r,frequency:n,flex:i,length:o,resolution:s,semitones:u,time:l}=e||{};return{dimension:ae(we(null)),angle:ae(we(t)),decibel:ae(we(r)),frequency:ae(we(n)),flex:ae(we(i)),length:ae(na(we(o))),resolution:ae(we(s)),semitones:ae(we(u)),time:ae(we(l))}}function ia(e){return{...Hl,...Gl,...Yl(e)}}var _t={};x(_t,{angle:()=>Kl,decibel:()=>Jl,flex:()=>Zl,frequency:()=>Xl,length:()=>Vl,resolution:()=>$l,semitones:()=>ec,time:()=>Ql});var Vl=["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],Kl=["deg","grad","rad","turn"],Ql=["s","ms"],Xl=["hz","khz"],$l=["dpi","dpcm","dppx","x"],Zl=["fr"],Jl=["db"],ec=["st"];var Fn={};x(Fn,{SyntaxError:()=>jt,generate:()=>Ie,parse:()=>Ke,walk:()=>Vt});function jt(e,t,r){return Object.assign(Le("SyntaxError",e),{input:t,offset:r,rawMessage:e,message:e+` `+t+` --`+new Array((r||t.length)+1).join("-")+"^"})}var tc=9,rc=10,nc=12,ic=13,oc=32,qt=class{constructor(t){this.str=t,this.pos=0}charCodeAt(t){return t<this.str.length?this.str.charCodeAt(t):0}charCode(){return this.charCodeAt(this.pos)}nextCharCode(){return this.charCodeAt(this.pos+1)}nextNonWsCode(t){return this.charCodeAt(this.findWsEnd(t))}findWsEnd(t){for(;t<this.str.length;t++){let r=this.str.charCodeAt(t);if(r!==ic&&r!==rc&&r!==nc&&r!==oc&&r!==tc)break}return t}substringToPos(t){return this.str.substring(this.pos,this.pos=t)}eat(t){this.charCode()!==t&&this.error("Expect `"+String.fromCharCode(t)+"`"),this.pos++}peek(){return this.pos<this.str.length?this.str.charAt(this.pos++):""}error(t){throw new jt(t,this.str,this.pos)}};var ac=9,sc=10,lc=12,cc=13,uc=32,ha=33,Pn=35,oa=38,Ut=39,ma=40,pc=41,fa=42,In=43,Dn=44,aa=45,Nn=60,da=62,Ln=63,hc=64,Yt=91,On=93,Wt=123,sa=124,la=125,ca=8734,ut=new Uint8Array(128).map((e,t)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))?1:0),ua={" ":1,"&&":2,"||":3,"|":4};function Ht(e){return e.substringToPos(e.findWsEnd(e.pos))}function Ye(e){let t=e.pos;for(;t<e.str.length;t++){let r=e.str.charCodeAt(t);if(r>=128||ut[r]===0)break}return e.pos===t&&e.error("Expect a keyword"),e.substringToPos(t)}function Gt(e){let t=e.pos;for(;t<e.str.length;t++){let r=e.str.charCodeAt(t);if(r<48||r>57)break}return e.pos===t&&e.error("Expect a number"),e.substringToPos(t)}function mc(e){let t=e.str.indexOf("'",e.pos+1);return t===-1&&(e.pos=e.str.length,e.error("Expect an apostrophe")),e.substringToPos(t+1)}function pa(e){let t=null,r=null;return e.eat(Wt),t=Gt(e),e.charCode()===Dn?(e.pos++,e.charCode()!==la&&(r=Gt(e))):r=t,e.eat(la),{min:Number(t),max:r?Number(r):0}}function fc(e){let t=null,r=!1;switch(e.charCode()){case fa:e.pos++,t={min:0,max:0};break;case In:e.pos++,t={min:1,max:0};break;case Ln:e.pos++,t={min:0,max:1};break;case Pn:e.pos++,r=!0,e.charCode()===Wt?t=pa(e):e.charCode()===Ln?(e.pos++,t={min:0,max:0}):t={min:1,max:0};break;case Wt:t=pa(e);break;default:return null}return{type:"Multiplier",comma:r,min:t.min,max:t.max,term:null}}function Ve(e,t){let r=fc(e);return r!==null?(r.term=t,e.charCode()===Pn&&e.charCodeAt(e.pos-1)===In?Ve(e,r):r):t}function En(e){let t=e.peek();return t===""?null:{type:"Token",value:t}}function dc(e){let t;return e.eat(Nn),e.eat(Ut),t=Ye(e),e.eat(Ut),e.eat(da),Ve(e,{type:"Property",name:t})}function gc(e){let t=null,r=null,n=1;return e.eat(Yt),e.charCode()===aa&&(e.peek(),n=-1),n==-1&&e.charCode()===ca?e.peek():(t=n*Number(Gt(e)),ut[e.charCode()]!==0&&(t+=Ye(e))),Ht(e),e.eat(Dn),Ht(e),e.charCode()===ca?e.peek():(n=1,e.charCode()===aa&&(e.peek(),n=-1),r=n*Number(Gt(e)),ut[e.charCode()]!==0