Files
the-beacon/node_modules/@bramus/specificity/dist/index.js
Alexander Whitestone a1ae4bf59a
Some checks failed
Accessibility Checks / a11y-audit (pull_request) Successful in 13s
Smoke Test / smoke (pull_request) Failing after 28s
fix: feat: strategy engine game theory tournaments (#5) (closes #217)
2026-04-21 23:35:43 -04:00

9 lines
52 KiB
JavaScript

var jn=Object.create;var Tt=Object.defineProperty;var zn=Object.getOwnPropertyDescriptor;var Kn=Object.getOwnPropertyNames;var Qn=Object.getPrototypeOf,$n=Object.prototype.hasOwnProperty;var Xn=e=>Tt(e,"__esModule",{value:!0});var lt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),$t=(e,t)=>{for(var r in t)Tt(e,r,{get:t[r],enumerable:!0})},Jn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Kn(t))!$n.call(e,s)&&(r||s!=="default")&&Tt(e,s,{get:()=>t[s],enumerable:!(n=zn(t,s))||n.enumerable});return e},Zn=(e,t)=>Jn(Xn(Tt(e!=null?jn(Qn(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var _e=lt(se=>{var Oe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");se.encode=function(e){if(0<=e&&e<Oe.length)return Oe[e];throw new TypeError("Must be between 0 and 63: "+e)};se.decode=function(e){var t=65,r=90,n=97,s=122,o=48,a=57,h=43,l=47,i=26,c=52;return t<=e&&e<=r?e-t:n<=e&&e<=s?e-n+i:o<=e&&e<=a?e-o+c:e==h?62:e==l?63:-1}});var Ve=lt(ae=>{var Me=_e(),oe=5,Be=1<<oe,Ue=Be-1,We=Be;function ci(e){return e<0?(-e<<1)+1:(e<<1)+0}function li(e){var t=(e&1)===1,r=e>>1;return t?-r:r}ae.encode=function(t){var r="",n,s=ci(t);do n=s&Ue,s>>>=oe,s>0&&(n|=We),r+=Me.encode(n);while(s>0);return r};ae.decode=function(t,r,n){var s=t.length,o=0,a=0,h,l;do{if(r>=s)throw new Error("Expected more digits in base 64 VLQ value.");if(l=Me.decode(t.charCodeAt(r++)),l===-1)throw new Error("Invalid base64 digit: "+t.charAt(r-1));h=!!(l&We),l&=Ue,o=o+(l<<a),a+=oe}while(h);n.value=li(o),n.rest=r}});var Bt=lt(N=>{function hi(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}N.getArg=hi;var He=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,ui=/^data:.+\,.+$/;function Ct(e){var t=e.match(He);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}N.urlParse=Ct;function ft(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}N.urlGenerate=ft;var fi=32;function pi(e){var t=[];return function(r){for(var n=0;n<t.length;n++)if(t[n].input===r){var s=t[0];return t[0]=t[n],t[n]=s,t[0].result}var o=e(r);return t.unshift({input:r,result:o}),t.length>fi&&t.pop(),o}}var ce=pi(function(t){var r=t,n=Ct(t);if(n){if(!n.path)return t;r=n.path}for(var s=N.isAbsolute(r),o=[],a=0,h=0;;)if(a=h,h=r.indexOf("/",a),h===-1){o.push(r.slice(a));break}else for(o.push(r.slice(a,h));h<r.length&&r[h]==="/";)h++;for(var l,i=0,h=o.length-1;h>=0;h--)l=o[h],l==="."?o.splice(h,1):l===".."?i++:i>0&&(l===""?(o.splice(h+1,i),i=0):(o.splice(h,2),i--));return r=o.join("/"),r===""&&(r=s?"/":"."),n?(n.path=r,ft(n)):r});N.normalize=ce;function Ge(e,t){e===""&&(e="."),t===""&&(t=".");var r=Ct(t),n=Ct(e);if(n&&(e=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),ft(r);if(r||t.match(ui))return t;if(n&&!n.host&&!n.path)return n.host=t,ft(n);var s=t.charAt(0)==="/"?t:ce(e.replace(/\/+$/,"")+"/"+t);return n?(n.path=s,ft(n)):s}N.join=Ge;N.isAbsolute=function(e){return e.charAt(0)==="/"||He.test(e)};function mi(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)}N.relative=mi;var qe=function(){var e=Object.create(null);return!("__proto__"in e)}();function Ye(e){return e}function di(e){return je(e)?"$"+e:e}N.toSetString=qe?Ye:di;function xi(e){return je(e)?e.slice(1):e}N.fromSetString=qe?Ye:xi;function je(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 ki(e,t,r){var n=K(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:K(e.name,t.name)}N.compareByOriginalPositions=ki;function Si(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:K(e.name,t.name)}N.compareByOriginalPositionsNoSource=Si;function gi(e,t,r){var n=e.generatedLine-t.generatedLine;return n!==0||(n=e.generatedColumn-t.generatedColumn,n!==0||r)||(n=K(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:K(e.name,t.name)}N.compareByGeneratedPositionsDeflated=gi;function Ci(e,t,r){var n=e.generatedColumn-t.generatedColumn;return n!==0||r||(n=K(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:K(e.name,t.name)}N.compareByGeneratedPositionsDeflatedNoLine=Ci;function K(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}function yi(e,t){var r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=K(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:K(e.name,t.name)}N.compareByGeneratedPositionsInflated=yi;function bi(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}N.parseSourceMapInput=bi;function Li(e,t,r){if(t=t||"",e&&(e[e.length-1]!=="/"&&t[0]!=="/"&&(e+="/"),t=e+t),r){var n=Ct(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var s=n.path.lastIndexOf("/");s>=0&&(n.path=n.path.substring(0,s+1))}t=Ge(ft(n),t)}return ce(t)}N.computeSourceURL=Li});var Ke=lt(ze=>{var le=Bt(),he=Object.prototype.hasOwnProperty,it=typeof Map<"u";function Q(){this._array=[],this._set=it?new Map:Object.create(null)}Q.fromArray=function(t,r){for(var n=new Q,s=0,o=t.length;s<o;s++)n.add(t[s],r);return n};Q.prototype.size=function(){return it?this._set.size:Object.getOwnPropertyNames(this._set).length};Q.prototype.add=function(t,r){var n=it?t:le.toSetString(t),s=it?this.has(t):he.call(this._set,n),o=this._array.length;(!s||r)&&this._array.push(t),s||(it?this._set.set(t,o):this._set[n]=o)};Q.prototype.has=function(t){if(it)return this._set.has(t);var r=le.toSetString(t);return he.call(this._set,r)};Q.prototype.indexOf=function(t){if(it){var r=this._set.get(t);if(r>=0)return r}else{var n=le.toSetString(t);if(he.call(this._set,n))return this._set[n]}throw new Error('"'+t+'" is not in the set.')};Q.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)};Q.prototype.toArray=function(){return this._array.slice()};ze.ArraySet=Q});var Xe=lt($e=>{var Qe=Bt();function Ti(e,t){var r=e.generatedLine,n=t.generatedLine,s=e.generatedColumn,o=t.generatedColumn;return n>r||n==r&&o>=s||Qe.compareByGeneratedPositionsInflated(e,t)<=0}function Ut(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Ut.prototype.unsortedForEach=function(t,r){this._array.forEach(t,r)};Ut.prototype.add=function(t){Ti(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))};Ut.prototype.toArray=function(){return this._sorted||(this._array.sort(Qe.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};$e.MappingList=Ut});var Ze=lt(Je=>{var yt=Ve(),v=Bt(),Wt=Ke().ArraySet,vi=Xe().MappingList;function W(e){e||(e={}),this._file=v.getArg(e,"file",null),this._sourceRoot=v.getArg(e,"sourceRoot",null),this._skipValidation=v.getArg(e,"skipValidation",!1),this._sources=new Wt,this._names=new Wt,this._mappings=new vi,this._sourcesContents=null}W.prototype._version=3;W.fromSourceMap=function(t){var r=t.sourceRoot,n=new W({file:t.file,sourceRoot:r});return t.eachMapping(function(s){var o={generated:{line:s.generatedLine,column:s.generatedColumn}};s.source!=null&&(o.source=s.source,r!=null&&(o.source=v.relative(r,o.source)),o.original={line:s.originalLine,column:s.originalColumn},s.name!=null&&(o.name=s.name)),n.addMapping(o)}),t.sources.forEach(function(s){var o=s;r!==null&&(o=v.relative(r,s)),n._sources.has(o)||n._sources.add(o);var a=t.sourceContentFor(s);a!=null&&n.setSourceContent(s,a)}),n};W.prototype.addMapping=function(t){var r=v.getArg(t,"generated"),n=v.getArg(t,"original",null),s=v.getArg(t,"source",null),o=v.getArg(t,"name",null);this._skipValidation||this._validateMapping(r,n,s,o),s!=null&&(s=String(s),this._sources.has(s)||this._sources.add(s)),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:s,name:o})};W.prototype.setSourceContent=function(t,r){var n=t;this._sourceRoot!=null&&(n=v.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[v.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[v.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};W.prototype.applySourceMap=function(t,r,n){var s=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.`);s=t.file}var o=this._sourceRoot;o!=null&&(s=v.relative(o,s));var a=new Wt,h=new Wt;this._mappings.unsortedForEach(function(l){if(l.source===s&&l.originalLine!=null){var i=t.originalPositionFor({line:l.originalLine,column:l.originalColumn});i.source!=null&&(l.source=i.source,n!=null&&(l.source=v.join(n,l.source)),o!=null&&(l.source=v.relative(o,l.source)),l.originalLine=i.line,l.originalColumn=i.column,i.name!=null&&(l.name=i.name))}var c=l.source;c!=null&&!a.has(c)&&a.add(c);var f=l.name;f!=null&&!h.has(f)&&h.add(f)},this),this._sources=a,this._names=h,t.sources.forEach(function(l){var i=t.sourceContentFor(l);i!=null&&(n!=null&&(l=v.join(n,l)),o!=null&&(l=v.relative(o,l)),this.setSourceContent(l,i))},this)};W.prototype._validateMapping=function(t,r,n,s){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&&!s)){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:s}))}};W.prototype._serializeMappings=function(){for(var t=0,r=1,n=0,s=0,o=0,a=0,h="",l,i,c,f,k=this._mappings.toArray(),S=0,T=k.length;S<T;S++){if(i=k[S],l="",i.generatedLine!==r)for(t=0;i.generatedLine!==r;)l+=";",r++;else if(S>0){if(!v.compareByGeneratedPositionsInflated(i,k[S-1]))continue;l+=","}l+=yt.encode(i.generatedColumn-t),t=i.generatedColumn,i.source!=null&&(f=this._sources.indexOf(i.source),l+=yt.encode(f-a),a=f,l+=yt.encode(i.originalLine-1-s),s=i.originalLine-1,l+=yt.encode(i.originalColumn-n),n=i.originalColumn,i.name!=null&&(c=this._names.indexOf(i.name),l+=yt.encode(c-o),o=c)),h+=l}return h};W.prototype._generateSourcesContent=function(t,r){return t.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=v.relative(r,n));var s=v.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,s)?this._sourcesContents[s]:null},this)};W.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};W.prototype.toString=function(){return JSON.stringify(this.toJSON())};Je.SourceMapGenerator=W});function I(e){return e>=48&&e<=57}function z(e){return I(e)||e>=65&&e<=70||e>=97&&e<=102}function Et(e){return e>=65&&e<=90}function ti(e){return e>=97&&e<=122}function ei(e){return Et(e)||ti(e)}function ri(e){return e>=128}function vt(e){return ei(e)||ri(e)||e===95}function wt(e){return vt(e)||I(e)||e===45}function ni(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function dt(e){return e===10||e===13||e===12}function $(e){return dt(e)||e===32||e===9}function R(e,t){return!(e!==92||dt(t)||t===0)}function At(e,t,r){return e===45?vt(t)||t===45||R(t,r):vt(e)?!0:e===92?R(e,t):!1}function Nt(e,t,r){return e===43||e===45?I(t)?2:t===46&&I(r)?3:0:e===46?I(t)?2:0:I(e)?1:0}function It(e){return e===65279||e===65534?1:0}var Xt=new Array(128),ii=128,xt=130,Jt=131,Dt=132,Zt=133;for(let e=0;e<Xt.length;e++)Xt[e]=$(e)&&xt||I(e)&&Jt||vt(e)&&Dt||ni(e)&&Zt||e||ii;function Pt(e){return e<128?Xt[e]:Dt}function ht(e,t){return t<e.length?e.charCodeAt(t):0}function Ft(e,t,r){return r===13&&ht(e,t+1)===10?2:1}function ee(e,t,r){let n=e.charCodeAt(t);return Et(n)&&(n=n|32),n===r}function et(e,t,r,n){if(r-t!==n.length||t<0||r>e.length)return!1;for(let s=t;s<r;s++){let o=n.charCodeAt(s-t),a=e.charCodeAt(s);if(Et(a)&&(a=a|32),a!==o)return!1}return!0}function De(e,t){for(;t>=0&&$(e.charCodeAt(t));t--);return t+1}function kt(e,t){for(;t<e.length&&$(e.charCodeAt(t));t++);return t}function te(e,t){for(;t<e.length&&I(e.charCodeAt(t));t++);return t}function X(e,t){if(t+=2,z(ht(e,t-1))){for(let n=Math.min(e.length,t+5);t<n&&z(ht(e,t));t++);let r=ht(e,t);$(r)&&(t+=Ft(e,t,r))}return t}function St(e,t){for(;t<e.length;t++){let r=e.charCodeAt(t);if(!wt(r)){if(R(r,ht(e,t+1))){t=X(e,t)-1;continue}break}}return t}function Rt(e,t){let r=e.charCodeAt(t);if((r===43||r===45)&&(r=e.charCodeAt(t+=1)),I(r)&&(t=te(e,t+1),r=e.charCodeAt(t)),r===46&&I(e.charCodeAt(t+1))&&(t+=2,t=te(e,t)),ee(e,t,101)){let n=0;r=e.charCodeAt(t+1),(r===45||r===43)&&(n=1,r=e.charCodeAt(t+2)),I(r)&&(t=te(e,t+1+n+1))}return t}function Ot(e,t){for(;t<e.length;t++){let r=e.charCodeAt(t);if(r===41){t++;break}R(r,ht(e,t+1))&&(t=X(e,t))}return t}function re(e){if(e.length===1&&!z(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 gt=["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 ut(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,16384)):e}var Pe=10,si=12,Fe=13;function Re(e){let t=e.source,r=t.length,n=t.length>0?It(t.charCodeAt(0)):0,s=ut(e.lines,r),o=ut(e.columns,r),a=e.startLine,h=e.startColumn;for(let l=n;l<r;l++){let i=t.charCodeAt(l);s[l]=a,o[l]=h++,(i===Pe||i===Fe||i===si)&&(i===Fe&&l+1<r&&t.charCodeAt(l+1)===Pe&&(l++,s[l]=a,o[l]=h),a++,h=1)}s[r]=a,o[r]=h,e.lines=s,e.columns=o,e.computed=!0}var ne=class{constructor(){this.lines=null,this.columns=null,this.computed=!1}setSource(t,r=0,n=1,s=1){this.source=t,this.startOffset=r,this.startLine=n,this.startColumn=s,this.computed=!1}getLocation(t,r){return this.computed||Re(this),{source:r,offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}getLocationRange(t,r,n){return this.computed||Re(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 M=16777215,V=24,oi=new Map([[2,22],[21,22],[19,20],[23,24]]),ie=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,s=ut(this.offsetAndType,t.length+1),o=ut(this.balance,t.length+1),a=0,h=0,l=0,i=-1;for(this.offsetAndType=null,this.balance=null,r(t,(c,f,k)=>{switch(c){default:o[a]=n;break;case h:{let S=l&M;for(l=o[S],h=l>>V,o[a]=S,o[S++]=a;S<a;S++)o[S]===n&&(o[S]=a);break}case 21:case 2:case 19:case 23:o[a]=l,h=oi.get(c),l=h<<V|a;break}s[a++]=c<<V|k,i===-1&&(i=f)}),s[a]=0<<V|n,o[a]=n,o[n]=n;l!==0;){let c=l&M;l=o[c],o[c]=n}this.source=t,this.firstCharOffset=i===-1?0:i,this.tokenCount=a,this.offsetAndType=s,this.balance=o,this.reset(),this.next()}lookupType(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t]>>V:0}lookupTypeNonSC(t){for(let r=this.tokenIndex;r<this.tokenCount;r++){let n=this.offsetAndType[r]>>V;if(n!==13&&n!==25&&t--===0)return n}return 0}lookupOffset(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t-1]&M:this.source.length}lookupOffsetNonSC(t){for(let r=this.tokenIndex;r<this.tokenCount;r++){let n=this.offsetAndType[r]>>V;if(n!==13&&n!==25&&t--===0)return r-this.tokenIndex}return 0}lookupValue(t,r){return t+=this.tokenIndex,t<this.tokenCount?et(this.source,this.offsetAndType[t-1]&M,this.offsetAndType[t]&M,r):!1}getTokenStart(t){return t===this.tokenIndex?this.tokenStart:t>0?t<this.tokenCount?this.offsetAndType[t-1]&M:this.offsetAndType[this.tokenCount]&M: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]&M,r=this.offsetAndType[r],this.tokenType=r>>V,this.tokenEnd=r&M):(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>>V,this.tokenEnd=t&M):(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,s,o;t:for(;n<this.tokenCount;n++){if(s=this.balance[n],s<t)break t;switch(o=n>0?this.offsetAndType[n-1]&M:this.firstCharOffset,r(this.source.charCodeAt(o))){case 1:break t;case 2:n++;break t;default:this.balance[s]===n&&(n=s)}}this.skip(n-this.tokenIndex)}forEachToken(t){for(let r=0,n=this.firstCharOffset;r<this.tokenCount;r++){let s=n,o=this.offsetAndType[r],a=o&M,h=o>>V;n=a,t(h,s,a,r)}}dump(){let t=new Array(this.tokenCount);return this.forEachToken((r,n,s,o)=>{t[o]={idx:o,type:gt[r],chunk:this.source.substring(n,s),balance:this.balance[o]}}),t}};function Mt(e,t){function r(f){return f<h?e.charCodeAt(f):0}function n(){if(i=Rt(e,i),At(r(i),r(i+1),r(i+2))){c=12,i=St(e,i);return}if(r(i)===37){c=11,i++;return}c=10}function s(){let f=i;if(i=St(e,i),et(e,f,i,"url")&&r(i)===40){if(i=kt(e,i+1),r(i)===34||r(i)===39){c=2,i=f+4;return}a();return}if(r(i)===40){c=2,i++;return}c=1}function o(f){for(f||(f=r(i++)),c=5;i<e.length;i++){let k=e.charCodeAt(i);switch(Pt(k)){case f:i++;return;case xt:if(dt(k)){i+=Ft(e,i,k),c=6;return}break;case 92:if(i===e.length-1)break;let S=r(i+1);dt(S)?i+=Ft(e,i+1,S):R(k,S)&&(i=X(e,i)-1);break}}}function a(){for(c=7,i=kt(e,i);i<e.length;i++){let f=e.charCodeAt(i);switch(Pt(f)){case 41:i++;return;case xt:if(i=kt(e,i),r(i)===41||i>=e.length){i<e.length&&i++;return}i=Ot(e,i),c=8;return;case 34:case 39:case 40:case Zt:i=Ot(e,i),c=8;return;case 92:if(R(f,r(i+1))){i=X(e,i)-1;break}i=Ot(e,i),c=8;return}}}e=String(e||"");let h=e.length,l=It(r(0)),i=l,c;for(;i<h;){let f=e.charCodeAt(i);switch(Pt(f)){case xt:c=13,i=kt(e,i+1);break;case 34:o();break;case 35:wt(r(i+1))||R(r(i+1),r(i+2))?(c=4,i=St(e,i+1)):(c=9,i++);break;case 39:o();break;case 40:c=21,i++;break;case 41:c=22,i++;break;case 43:Nt(f,r(i+1),r(i+2))?n():(c=9,i++);break;case 44:c=18,i++;break;case 45:Nt(f,r(i+1),r(i+2))?n():r(i+1)===45&&r(i+2)===62?(c=15,i=i+3):At(f,r(i+1),r(i+2))?s():(c=9,i++);break;case 46:Nt(f,r(i+1),r(i+2))?n():(c=9,i++);break;case 47:r(i+1)===42?(c=25,i=e.indexOf("*/",i+2),i=i===-1?e.length:i+2):(c=9,i++);break;case 58:c=16,i++;break;case 59:c=17,i++;break;case 60:r(i+1)===33&&r(i+2)===45&&r(i+3)===45?(c=14,i=i+4):(c=9,i++);break;case 64:At(r(i+1),r(i+2),r(i+3))?(c=3,i=St(e,i+1)):(c=9,i++);break;case 91:c=19,i++;break;case 92:R(f,r(i+1))?s():(c=9,i++);break;case 93:c=20,i++;break;case 123:c=23,i++;break;case 125:c=24,i++;break;case Jt:n();break;case Dt:s();break;default:c=9,i++}t(c,l,l=i)}}var er=Zn(Ze(),1),tr=new Set(["Atrule","Selector","Declaration"]);function rr(e){let t=new er.SourceMapGenerator,r={line:1,column:0},n={line:0,column:0},s={line:1,column:0},o={generated:s},a=1,h=0,l=!1,i=e.node;e.node=function(k){if(k.loc&&k.loc.start&&tr.has(k.type)){let S=k.loc.start.line,T=k.loc.start.column-1;(n.line!==S||n.column!==T)&&(n.line=S,n.column=T,r.line=a,r.column=h,l&&(l=!1,(r.line!==s.line||r.column!==s.column)&&t.addMapping(o)),l=!0,t.addMapping({source:k.loc.source,original:n,generated:r}))}i.call(this,k),l&&tr.has(k.type)&&(s.line=a,s.column=h)};let c=e.emit;e.emit=function(k,S,T){for(let j=0;j<k.length;j++)k.charCodeAt(j)===10?(a++,h=0):h++;c(k,S,T)};let f=e.result;return e.result=function(){return l&&t.addMapping(o),{css:f(),map:t}},e}var Vt={};$t(Vt,{safe:()=>fe,spec:()=>Ni});var Ei=43,wi=45,ue=(e,t)=>{if(e===9&&(e=t),typeof e=="string"){let r=e.charCodeAt(0);return r>127?32768:r<<8}return e},nr=[[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],["/","*"]],Ai=nr.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 ir(e){let t=new Set(e.map(([r,n])=>ue(r)<<16|ue(n)));return function(r,n,s){let o=ue(n,s),a=s.charCodeAt(0);return(a===wi&&n!==1&&n!==2&&n!==15||a===Ei?t.has(r<<16|a<<8):t.has(r<<16|o))&&this.emit(" ",13,!0),o}}var Ni=ir(nr),fe=ir(Ai);var Ii=92;function Di(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 Pi(e){Mt(e,(t,r,n)=>{this.token(t,e.slice(r,n))})}function sr(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 s="",o=0,a={node(l){if(t.has(l.type))t.get(l.type).call(h,l);else throw new Error("Unknown node type: "+l.type)},tokenBefore:fe,token(l,i){o=this.tokenBefore(o,l,i),this.emit(i,l,!1),l===9&&i.charCodeAt(0)===Ii&&this.emit(`
`,13,!0)},emit(l){s+=l},result(){return s}};n&&(typeof n.decorator=="function"&&(a=n.decorator(a)),n.sourceMap&&(a=rr(a)),n.mode in Vt&&(a.tokenBefore=Vt[n.mode]));let h={node:l=>a.node(l),children:Di,token:(l,i)=>a.token(l,i),tokenize:Pi};return a.node(r),a.result()}}var Se={};$t(Se,{AnPlusB:()=>ar,Atrule:()=>cr,AtrulePrelude:()=>lr,AttributeSelector:()=>fr,Block:()=>pr,Brackets:()=>mr,CDC:()=>dr,CDO:()=>xr,ClassSelector:()=>Sr,Combinator:()=>yr,Comment:()=>br,Condition:()=>Lr,Declaration:()=>Tr,DeclarationList:()=>vr,Dimension:()=>Er,Feature:()=>wr,FeatureFunction:()=>Ar,FeatureRange:()=>Nr,Function:()=>Ir,GeneralEnclosed:()=>Dr,Hash:()=>Pr,IdSelector:()=>_r,Identifier:()=>Rr,Layer:()=>Mr,LayerList:()=>Br,MediaQuery:()=>Ur,MediaQueryList:()=>Wr,NestingSelector:()=>Hr,Nth:()=>qr,Number:()=>Yr,Operator:()=>zr,Parentheses:()=>Kr,Percentage:()=>$r,PseudoClassSelector:()=>Jr,PseudoElementSelector:()=>tn,Ratio:()=>en,Raw:()=>nn,Rule:()=>sn,Scope:()=>on,Selector:()=>cn,SelectorList:()=>hn,String:()=>dn,StyleSheet:()=>xn,SupportsDeclaration:()=>kn,TypeSelector:()=>Cn,UnicodeRange:()=>yn,Url:()=>Ln,Value:()=>Tn,WhiteSpace:()=>vn});var Y=43,_=45,Ht=110,st=!0,Fi=!1;function Gt(e,t){let r=this.tokenStart+e,n=this.charCodeAt(r);for((n===Y||n===_)&&(t&&this.error("Number sign is not allowed"),r++);r<this.tokenEnd;r++)I(this.charCodeAt(r))||this.error("Integer is expected",r)}function pt(e){return Gt.call(this,0,e)}function Z(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let r="";switch(t){case Ht:r="N is expected";break;case _:r="HyphenMinus is expected";break}this.error(r,this.tokenStart+e)}}function pe(){let e=0,t=0,r=this.tokenType;for(;r===13||r===25;)r=this.lookupType(++e);if(r!==10)if(this.isDelim(Y,e)||this.isDelim(_,e)){t=this.isDelim(Y,e)?Y:_;do r=this.lookupType(++e);while(r===13||r===25);r!==10&&(this.skip(e),pt.call(this,st))}else return null;return e>0&&this.skip(e),t===0&&(r=this.charCodeAt(this.tokenStart),r!==Y&&r!==_&&this.error("Number sign is expected")),pt.call(this,t!==0),t===_?"-"+this.consume(10):this.consume(10)}function or(){let e=this.tokenStart,t=null,r=null;if(this.tokenType===10)pt.call(this,Fi),r=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,_))switch(t="-1",Z.call(this,1,Ht),this.tokenEnd-this.tokenStart){case 2:this.next(),r=pe.call(this);break;case 3:Z.call(this,2,_),this.next(),this.skipSC(),pt.call(this,st),r="-"+this.consume(10);break;default:Z.call(this,2,_),Gt.call(this,3,st),this.next(),r=this.substrToCursor(e+2)}else if(this.tokenType===1||this.isDelim(Y)&&this.lookupType(1)===1){let n=0;switch(t="1",this.isDelim(Y)&&(n=1,this.next()),Z.call(this,0,Ht),this.tokenEnd-this.tokenStart){case 1:this.next(),r=pe.call(this);break;case 2:Z.call(this,1,_),this.next(),this.skipSC(),pt.call(this,st),r="-"+this.consume(10);break;default:Z.call(this,1,_),Gt.call(this,2,st),this.next(),r=this.substrToCursor(e+n+1)}}else if(this.tokenType===12){let n=this.charCodeAt(this.tokenStart),s=n===Y||n===_,o=this.tokenStart+s;for(;o<this.tokenEnd&&I(this.charCodeAt(o));o++);o===this.tokenStart+s&&this.error("Integer is expected",this.tokenStart+s),Z.call(this,o-this.tokenStart,Ht),t=this.substring(e,o),o+1===this.tokenEnd?(this.next(),r=pe.call(this)):(Z.call(this,o-this.tokenStart+1,_),o+2===this.tokenEnd?(this.next(),this.skipSC(),pt.call(this,st),r="-"+this.consume(10)):(Gt.call(this,o-this.tokenStart+2,st),this.next(),r=this.substrToCursor(o+1)))}else this.error();return t!==null&&t.charCodeAt(0)===Y&&(t=t.substr(1)),r!==null&&r.charCodeAt(0)===Y&&(r=r.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:r}}function ar(e){if(e.a){let t=e.a==="+1"&&"n"||e.a==="1"&&"n"||e.a==="-1"&&"-n"||e.a+"n";if(e.b){let r=e.b[0]==="-"||e.b[0]==="+"?e.b:"+"+e.b;this.tokenize(t+r)}else this.tokenize(t)}else this.tokenize(e.b)}function cr(e){this.token(3,"@"+e.name),e.prelude!==null&&this.node(e.prelude),e.block?(this.token(23,"{"),this.node(e.block),this.token(24,"}")):this.token(17,";")}function lr(e){this.children(e)}var Ri=36,hr=42,qt=61,Oi=94,me=124,_i=126;function Mi(){this.eof&&this.error("Unexpected end of input");let e=this.tokenStart,t=!1;return this.isDelim(hr)?(t=!0,this.next()):this.isDelim(me)||this.eat(1),this.isDelim(me)?this.charCodeAt(this.tokenStart+1)!==qt?(this.next(),this.eat(1)):t&&this.error("Identifier is expected",this.tokenEnd):t&&this.error("Vertical line is expected"),{type:"Identifier",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function Bi(){let e=this.tokenStart,t=this.charCodeAt(e);return t!==qt&&t!==_i&&t!==Oi&&t!==Ri&&t!==hr&&t!==me&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),t!==qt&&(this.isDelim(qt)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}function ur(){let e=this.tokenStart,t,r=null,n=null,s=null;return this.eat(19),this.skipSC(),t=Mi.call(this),this.skipSC(),this.tokenType!==20&&(this.tokenType!==1&&(r=Bi.call(this),this.skipSC(),n=this.tokenType===5?this.String():this.Identifier(),this.skipSC()),this.tokenType===1&&(s=this.consume(1),this.skipSC())),this.eat(20),{type:"AttributeSelector",loc:this.getLocation(e,this.tokenStart),name:t,matcher:r,value:n,flags:s}}function fr(e){this.token(9,"["),this.node(e.name),e.matcher!==null&&(this.tokenize(e.matcher),this.node(e.value)),e.flags!==null&&this.token(1,e.flags),this.token(9,"]")}function pr(e){this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")})}function mr(e){this.token(9,"["),this.children(e),this.token(9,"]")}function dr(){this.token(15,"-->")}function xr(){this.token(14,"<!--")}var Ui=46;function kr(){return this.eatDelim(Ui),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function Sr(e){this.token(9,"."),this.token(1,e.name)}var Wi=43,gr=47,Vi=62,Hi=126;function Cr(){let e=this.tokenStart,t;switch(this.tokenType){case 13:t=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case Vi:case Wi:case Hi:this.next();break;case gr:this.next(),this.eatIdent("deep"),this.eatDelim(gr);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e);break}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function yr(e){this.tokenize(e.name)}function br(e){this.token(25,"/*"+e.value+"*/")}function Lr(e){e.children.forEach(t=>{t.type==="Condition"?(this.token(21,"("),this.node(t),this.token(22,")")):this.node(t)})}function Tr(e){this.token(1,e.property),this.token(16,":"),this.node(e.value),e.important&&(this.token(9,"!"),this.token(1,e.important===!0?"important":e.important))}function vr(e){this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")})}function Er(e){this.token(12,e.value+e.unit)}function wr(e){this.token(21,"("),this.token(1,e.name),e.value!==null&&(this.token(16,":"),this.node(e.value)),this.token(22,")")}function Ar(e){this.token(2,e.feature+"("),this.node(e.value),this.token(22,")")}function Nr(e){this.token(21,"("),this.node(e.left),this.tokenize(e.leftComparison),this.node(e.middle),e.right&&(this.tokenize(e.rightComparison),this.node(e.right)),this.token(22,")")}function Ir(e){this.token(2,e.name+"("),this.children(e),this.token(22,")")}function Dr(e){e.function?this.token(2,e.function+"("):this.token(21,"("),this.children(e),this.token(22,")")}function Pr(e){this.token(4,"#"+e.value)}function Fr(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function Rr(e){this.token(1,e.name)}function Or(){let e=this.tokenStart;return this.eat(4),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function _r(e){this.token(9,"#"+e.name)}function Mr(e){this.tokenize(e.name)}function Br(e){this.children(e,()=>this.token(18,","))}function Ur(e){e.mediaType?(e.modifier&&this.token(1,e.modifier),this.token(1,e.mediaType),e.condition&&(this.token(1,"and"),this.node(e.condition))):e.condition&&this.node(e.condition)}function Wr(e){this.children(e,()=>this.token(18,","))}var Gi=38;function Vr(){let e=this.tokenStart;return this.eatDelim(Gi),{type:"NestingSelector",loc:this.getLocation(e,this.tokenStart)}}function Hr(){this.token(9,"&")}function Gr(){this.skipSC();let e=this.tokenStart,t=e,r=null,n;return this.lookupValue(0,"odd")||this.lookupValue(0,"even")?n=this.Identifier():n=this.AnPlusB(),t=this.tokenStart,this.skipSC(),this.lookupValue(0,"of")&&(this.next(),r=this.SelectorList(),t=this.tokenStart),{type:"Nth",loc:this.getLocation(e,t),nth:n,selector:r}}function qr(e){this.node(e.nth),e.selector!==null&&(this.token(1,"of"),this.node(e.selector))}function Yr(e){this.token(10,e.value)}function jr(){let e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function zr(e){this.tokenize(e.value)}function Kr(e){this.token(21,"("),this.children(e),this.token(22,")")}function Qr(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(11)}}function $r(e){this.token(11,e.value+"%")}function Xr(){let e=this.tokenStart,t=null,r,n;return this.eat(16),this.tokenType===2?(r=this.consumeFunctionName(),n=r.toLowerCase(),this.lookupNonWSType(0)==22?t=this.createList():hasOwnProperty.call(this.pseudo,n)?(this.skipSC(),t=this.pseudo[n].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(null,!1))),this.eat(22)):r=this.consume(1),{type:"PseudoClassSelector",loc:this.getLocation(e,this.tokenStart),name:r,children:t}}function Jr(e){this.token(16,":"),e.children===null?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}function Zr(){let e=this.tokenStart,t=null,r,n;return this.eat(16),this.eat(16),this.tokenType===2?(r=this.consumeFunctionName(),n=r.toLowerCase(),this.lookupNonWSType(0)==22?t=this.createList():hasOwnProperty.call(this.pseudo,n)?(this.skipSC(),t=this.pseudo[n].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(null,!1))),this.eat(22)):r=this.consume(1),{type:"PseudoElementSelector",loc:this.getLocation(e,this.tokenStart),name:r,children:t}}function tn(e){this.token(16,":"),this.token(16,":"),e.children===null?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}function en(e){this.node(e.left),this.token(9,"/"),e.right?this.node(e.right):this.node(10,1)}function qi(){return this.tokenIndex>0&&this.lookupType(-1)===13?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}function rn(e,t){let r=this.getTokenStart(this.tokenIndex),n;return this.skipUntilBalanced(this.tokenIndex,e||this.consumeUntilBalanceEnd),t&&this.tokenStart>r?n=qi.call(this):n=this.tokenStart,{type:"Raw",loc:this.getLocation(r,n),value:this.substring(r,n)}}function nn(e){this.tokenize(e.value)}function sn(e){this.node(e.prelude),this.token(23,"{"),this.node(e.block),this.token(24,"}")}function on(e){e.root&&(this.token(21,"("),this.node(e.root),this.token(22,")")),e.limit&&(this.token(1,"to"),this.token(21,"("),this.node(e.limit),this.token(22,")"))}function an(){let e=this.readSequence(this.scope.Selector);return this.getFirstListNode(e)===null&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(e),children:e}}function cn(e){this.children(e)}function ln(){let e=this.createList();for(;!this.eof;){if(e.push(this.Selector()),this.tokenType===18){this.next();continue}break}return{type:"SelectorList",loc:this.getLocationFromList(e),children:e}}function hn(e){this.children(e,()=>this.token(18,","))}var de=92,un=34,fn=39;function xe(e){let t=e.length,r=e.charCodeAt(0),n=r===un||r===fn?1:0,s=n===1&&t>1&&e.charCodeAt(t-1)===r?t-2:t-1,o="";for(let a=n;a<=s;a++){let h=e.charCodeAt(a);if(h===de){if(a===s){a!==t-1&&(o=e.substr(a+1));break}if(h=e.charCodeAt(++a),R(de,h)){let l=a-1,i=X(e,l);a=i-1,o+=re(e.substring(l+1,i))}else h===13&&e.charCodeAt(a+1)===10&&a++}else o+=e[a]}return o}function pn(e,t){let r=t?"'":'"',n=t?fn:un,s="",o=!1;for(let a=0;a<e.length;a++){let h=e.charCodeAt(a);if(h===0){s+="\uFFFD";continue}if(h<=31||h===127){s+="\\"+h.toString(16),o=!0;continue}h===n||h===de?(s+="\\"+e.charAt(a),o=!1):(o&&(z(h)||$(h))&&(s+=" "),s+=e.charAt(a),o=!1)}return r+s+r}function mn(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:xe(this.consume(5))}}function dn(e){this.token(5,pn(e.value))}function xn(e){this.children(e)}function kn(e){this.token(21,"("),this.node(e.declaration),this.token(22,")")}var ji=42,Sn=124;function ke(){this.tokenType!==1&&this.isDelim(ji)===!1&&this.error("Identifier or asterisk is expected"),this.next()}function gn(){let e=this.tokenStart;return this.isDelim(Sn)?(this.next(),ke.call(this)):(ke.call(this),this.isDelim(Sn)&&(this.next(),ke.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function Cn(e){this.tokenize(e.name)}function yn(e){this.tokenize(e.value)}var zi=32,Ki=92,Qi=34,$i=39,Xi=40,Ji=41;function bn(e){let t="",r=!1;for(let n=0;n<e.length;n++){let s=e.charCodeAt(n);if(s===0){t+="\uFFFD";continue}if(s<=31||s===127){t+="\\"+s.toString(16),r=!0;continue}s===zi||s===Ki||s===Qi||s===$i||s===Xi||s===Ji?(t+="\\"+e.charAt(n),r=!1):(r&&z(s)&&(t+=" "),t+=e.charAt(n),r=!1)}return"url("+t+")"}function Ln(e){this.token(7,bn(e.value))}function Tn(e){this.children(e)}var ja=Object.freeze({type:"WhiteSpace",loc:null,value:" "});function vn(e){this.token(13,e.value)}var En={node:Se};var wn=sr(En);var mt=null,P=class{static createItem(t){return{prev:null,next:null,data:t}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(t){return P.createItem(t)}allocateCursor(t,r){let n;return mt!==null?(n=mt,mt=mt.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=mt,mt=t}updateCursors(t,r,n,s){let{cursor:o}=this;for(;o!==null;)o.prev===t&&(o.prev=r),o.next===n&&(o.next=s),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 s=P.createItem(n);r!==null?r.next=s:this.head=s,s.prev=r,r=s}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 s=n.next;n.next=s.next,t.call(r,s.data,s,this)}this.releaseCursor()}forEachRight(t,r=this){let n=this.allocateCursor(this.tail,null);for(;n.prev!==null;){let s=n.prev;n.prev=s.prev,t.call(r,s.data,s,this)}this.releaseCursor()}reduce(t,r,n=this){let s=this.allocateCursor(null,this.head),o=r,a;for(;s.next!==null;)a=s.next,s.next=a.next,o=t.call(n,o,a.data,a,this);return this.releaseCursor(),o}reduceRight(t,r,n=this){let s=this.allocateCursor(this.tail,null),o=r,a;for(;s.prev!==null;)a=s.prev,s.prev=a.prev,o=t.call(n,o,a.data,a,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 P;for(let s=this.head;s!==null;s=s.next)n.appendData(t.call(r,s.data,s,this));return n}filter(t,r=this){let n=new P;for(let s=this.head;s!==null;s=s.next)t.call(r,s.data,s,this)&&n.appendData(s.data);return n}nextUntil(t,r,n=this){if(t===null)return;let s=this.allocateCursor(null,t);for(;s.next!==null;){let o=s.next;if(s.next=o.next,r.call(n,o.data,o,this))break}this.releaseCursor()}prevUntil(t,r,n=this){if(t===null)return;let s=this.allocateCursor(t,null);for(;s.prev!==null;){let o=s.prev;if(s.prev=o.prev,r.call(n,o.data,o,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){let t=new P;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(P.createItem(t))}append(t){return this.insert(t)}appendData(t){return this.insert(P.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(P.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(P.createItem(t))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(t){this.prepend(P.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 An(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 ge=100,Nn=60,In=" ";function Dn({source:e,line:t,column:r,baseLine:n,baseColumn:s},o){function a(T,j){return i.slice(T,j).map((tt,Qt)=>String(T+Qt+1).padStart(k)+" |"+tt).join(`
`)}let h=`
`.repeat(Math.max(n-1,0)),l=" ".repeat(Math.max(s-1,0)),i=(h+l+e).split(/\r\n?|\n|\f/),c=Math.max(1,t-o)-1,f=Math.min(t+o,i.length+1),k=Math.max(4,String(f).length)+1,S=0;r+=(In.length-1)*(i[t-1].substr(0,r-1).match(/\t/g)||[]).length,r>ge&&(S=r-Nn+3,r=Nn-2);for(let T=c;T<=f;T++)T>=0&&T<i.length&&(i[T]=i[T].replace(/\t/g,In),i[T]=(S>0&&i[T].length>S?"\u2026":"")+i[T].substr(S,ge-2)+(i[T].length>S+ge-1?"\u2026":""));return[a(c,t),new Array(r+k+2).join("-")+"^",a(t,f)].filter(Boolean).join(`
`).replace(/^(\s+\d+\s+\|\n)+/,"").replace(/\n(\s+\d+\s+\|)+$/,"")}function Ce(e,t,r,n,s,o=1,a=1){return Object.assign(An("SyntaxError",e),{source:t,offset:r,line:n,column:s,sourceFragment(l){return Dn({source:t,line:n,column:s,baseLine:o,baseColumn:a},isNaN(l)?0:l)},get formattedMessage(){return`Parse error: ${e}
`+Dn({source:t,line:n,column:s,baseLine:o,baseColumn:a},2)}})}function Pn(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 s=e.getNode.call(this,n);if(s===void 0)break;r&&(e.onWhiteSpace&&e.onWhiteSpace.call(this,s,t,n),r=!1),t.push(s)}return r&&e.onWhiteSpace&&e.onWhiteSpace.call(this,null,t,n),t}var Fn=()=>{},ts=33,es=35,ye=59,Rn=123,On=0;function rs(e){return function(){return this[e]()}}function be(e){let t=Object.create(null);for(let r of Object.keys(e)){let n=e[r],s=n.parse||n;s&&(t[r]=s)}return t}function ns(e){let t={context:Object.create(null),features:Object.assign(Object.create(null),e.features),scope:Object.assign(Object.create(null),e.scope),atrule:be(e.atrule),pseudo:be(e.pseudo),node:be(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]=rs(n);break}return{config:t,...t,...t.node}}function _n(e){let t="",r="<unknown>",n=!1,s=Fn,o=!1,a=new ne,h=Object.assign(new ie,ns(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:Pn,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(i){return i===Rn?1:0},consumeUntilLeftCurlyBracketOrSemicolon(i){return i===Rn||i===ye?1:0},consumeUntilExclamationMarkOrSemicolon(i){return i===ts||i===ye?1:0},consumeUntilSemicolonIncluded(i){return i===ye?2:0},createList(){return new P},createSingleNodeList(i){return new P().appendData(i)},getFirstListNode(i){return i&&i.first},getLastListNode(i){return i&&i.last},parseWithFallback(i,c){let f=this.tokenIndex;try{return i.call(this)}catch(k){if(o)throw k;this.skip(f-this.tokenIndex);let S=c.call(this);return o=!0,s(k,S),o=!1,S}},lookupNonWSType(i){let c;do if(c=this.lookupType(i++),c!==13&&c!==25)return c;while(c!==On);return On},charCodeAt(i){return i>=0&&i<t.length?t.charCodeAt(i):0},substring(i,c){return t.substring(i,c)},substrToCursor(i){return this.source.substring(i,this.tokenStart)},cmpChar(i,c){return ee(t,i,c)},cmpStr(i,c,f){return et(t,i,c,f)},consume(i){let c=this.tokenStart;return this.eat(i),this.substrToCursor(c)},consumeFunctionName(){let i=t.substring(this.tokenStart,this.tokenEnd-1);return this.eat(2),i},consumeNumber(i){let c=t.substring(this.tokenStart,Rt(t,this.tokenStart));return this.eat(i),c},eat(i){if(this.tokenType!==i){let c=gt[i].slice(0,-6).replace(/-/g," ").replace(/^./,S=>S.toUpperCase()),f=`${/[[\](){}]/.test(c)?`"${c}"`:c} is expected`,k=this.tokenStart;switch(i){case 1:this.tokenType===2||this.tokenType===7?(k=this.tokenEnd-1,f="Identifier is expected but function found"):f="Identifier is expected";break;case 4:this.isDelim(es)&&(this.next(),k++,f="Name is expected");break;case 11:this.tokenType===10&&(k=this.tokenEnd,f="Percent sign is expected");break}this.error(f,k)}this.next()},eatIdent(i){(this.tokenType!==1||this.lookupValue(0,i)===!1)&&this.error(`Identifier "${i}" is expected`),this.next()},eatDelim(i){this.isDelim(i)||this.error(`Delim "${String.fromCharCode(i)}" is expected`),this.next()},getLocation(i,c){return n?a.getLocationRange(i,c,r):null},getLocationFromList(i){if(n){let c=this.getFirstListNode(i),f=this.getLastListNode(i);return a.getLocationRange(c!==null?c.loc.start.offset-a.startOffset:this.tokenStart,f!==null?f.loc.end.offset-a.startOffset:this.tokenStart,r)}return null},error(i,c){let f=typeof c<"u"&&c<t.length?a.getLocation(c):this.eof?a.getLocation(De(t,t.length-1)):a.getLocation(this.tokenStart);throw new Ce(i||"Unexpected input",t,f.offset,f.line,f.column,a.startLine,a.startColumn)}});return Object.assign(function(i,c){t=i,c=c||{},h.setSource(t,Mt),a.setSource(t,c.offset,c.line,c.column),r=c.filename||"<unknown>",n=Boolean(c.positions),s=typeof c.onParseError=="function"?c.onParseError:Fn,o=!1,h.parseAtrulePrelude="parseAtrulePrelude"in c?Boolean(c.parseAtrulePrelude):!0,h.parseRulePrelude="parseRulePrelude"in c?Boolean(c.parseRulePrelude):!0,h.parseValue="parseValue"in c?Boolean(c.parseValue):!0,h.parseCustomProperty="parseCustomProperty"in c?Boolean(c.parseCustomProperty):!1;let{context:f="default",onComment:k}=c;if(!(f in h.context))throw new Error("Unknown context `"+f+"`");typeof k=="function"&&h.forEachToken((T,j,tt)=>{if(T===25){let Qt=h.getLocation(j,tt),Yn=et(t,tt-2,tt,"*/")?t.slice(j+2,tt-2):t.slice(j+2,tt);k(Yn,Qt)}});let S=h.context[f].call(h,c);return h.eof||h.error(),S},{SyntaxError:Ce,config:h.config})}var ss=35,os=38,as=42,cs=43,ls=47,Mn=46,hs=62,us=124,fs=126;function ps(e,t){t.last!==null&&t.last.type!=="Combinator"&&e!==null&&e.type!=="Combinator"&&t.push({type:"Combinator",loc:null,name:" "})}function ms(){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)===Mn&&this.error("Identifier is expected",this.tokenStart+1);break;case 9:{switch(this.charCodeAt(this.tokenStart)){case cs:case hs:case fs:case ls:return this.Combinator();case Mn:return this.ClassSelector();case as:case us:return this.TypeSelector();case ss:return this.IdSelector();case os:return this.NestingSelector()}break}}}var Le={onWhiteSpace:ps,getNode:ms};function Bn(){let e=this.createList();this.skipSC();t:for(;!this.eof;){switch(this.tokenType){case 1:e.push(this.Identifier());break;case 5:e.push(this.String());break;case 18:e.push(this.Operator());break;case 22:break t;default:this.error("Identifier, string or comma is expected")}this.skipSC()}return e}var ot={parse(){return this.createSingleNodeList(this.SelectorList())}},Te={parse(){return this.createSingleNodeList(this.Selector())}},ds={parse(){return this.createSingleNodeList(this.Identifier())}},xs={parse:Bn},Yt={parse(){return this.createSingleNodeList(this.Nth())}},Un={dir:ds,has:ot,lang:xs,matches:ot,is:ot,"-moz-any":ot,"-webkit-any":ot,where:ot,not:ot,"nth-child":Yt,"nth-last-child":Yt,"nth-last-of-type":Yt,"nth-of-type":Yt,slotted:Te,host:Te,"host-context":Te};var ve={};$t(ve,{AnPlusB:()=>or,AttributeSelector:()=>ur,ClassSelector:()=>kr,Combinator:()=>Cr,IdSelector:()=>Or,Identifier:()=>Fr,NestingSelector:()=>Vr,Nth:()=>Gr,Operator:()=>jr,Percentage:()=>Qr,PseudoClassSelector:()=>Xr,PseudoElementSelector:()=>Zr,Raw:()=>rn,Selector:()=>an,SelectorList:()=>ln,String:()=>mn,TypeSelector:()=>gn});var Wn={parseContext:{default:"SelectorList",selectorList:"SelectorList",selector:"Selector"},scope:{Selector:Le},atrule:{},pseudo:Un,node:ve};var Ee=_n(Wn);var at=(e,t)=>e.a===t.a?e.b===t.b?e.c-t.c:e.b-t.b:e.a-t.a,we=(e,t)=>at(e,t)===0,Ae=(e,t)=>at(e,t)>0,Ne=(e,t)=>at(e,t)<0;var Vn=(e,t="ASC")=>{let r=e.sort(at);return t==="DESC"?r.reverse():r},jt=(...e)=>Vn(e,"ASC"),zt=(...e)=>Vn(e,"DESC");var bt=(...e)=>zt(...e)[0],Hn=(...e)=>jt(...e)[0];var Lt=e=>{if(!e||e.type!=="Selector")throw new TypeError("Passed in source is not a Selector AST");let t=0,r=0,n=0;return e.children.forEach(s=>{switch(s.type){case"IdSelector":t+=1;break;case"AttributeSelector":case"ClassSelector":r+=1;break;case"PseudoClassSelector":switch(s.name.toLowerCase()){case"where":break;case"-webkit-any":case"any":s.children?.first&&(r+=1);break;case"-moz-any":case"is":case"matches":case"not":case"has":if(s.children?.first){let a=bt(...ct(s.children.first));t+=a.a,r+=a.b,n+=a.c}break;case"nth-child":case"nth-last-child":if(r+=1,s.children?.first?.selector){let a=bt(...ct(s.children.first.selector));t+=a.a,r+=a.b,n+=a.c}break;case"host-context":case"host":if(r+=1,s.children?.first?.children){let a={type:"Selector",children:[]},h=!1;s.children.first.children.forEach(i=>{if(h)return!1;if(i.type==="Combinator")return h=!0,!1;a.children.push(i)});let l=ct(a)[0];t+=l.a,r+=l.b,n+=l.c}break;case"after":case"before":case"first-letter":case"first-line":n+=1;break;default:r+=1;break}break;case"PseudoElementSelector":switch(s.name){case"slotted":if(n+=1,s.children?.first?.children){let a={type:"Selector",children:[]},h=!1;s.children.first.children.forEach(i=>{if(h)return!1;if(i.type==="Combinator")return h=!0,!1;a.children.push(i)});let l=ct(a)[0];t+=l.a,r+=l.b,n+=l.c}break;case"view-transition-group":case"view-transition-image-pair":case"view-transition-old":case"view-transition-new":if(s.children?.first?.value==="*")break;n+=1;break;default:n+=1;break}break;case"TypeSelector":let o=s.name;o.includes("|")&&(o=o.split("|")[1]),o!=="*"&&(n+=1);break;default:break}}),new Gn({a:t,b:r,c:n},e)},ks=e=>{if(typeof e=="string"||e instanceof String)try{return Ee(e,{context:"selectorList"})}catch(t){throw new TypeError(`Could not convert passed in source '${e}' to SelectorList: ${t.message}`)}if(e instanceof Object){if(e.type&&["Selector","SelectorList"].includes(e.type))return e;if(e.type&&e.type==="Raw")try{return Ee(e.value,{context:"selectorList"})}catch(t){throw new TypeError(`Could not convert passed in source to SelectorList: ${t.message}`)}throw new TypeError("Passed in source is an Object but no AST / AST of the type Selector or SelectorList")}throw new TypeError("Passed in source is not a String nor an Object. I don't know what to do with it.")},ct=e=>{if(!e)return[];let t=ks(e);if(t.type==="Selector")return[Lt(e)];if(t.type==="SelectorList"){let r=[];return t.children.forEach(n=>{let s=Lt(n);r.push(s)}),r}};var Kt=class extends Error{constructor(){super("Manipulating a Specificity instance is not allowed. Instead, create a new Specificity()")}},qn=class{constructor(t,r=null){this.value=t,this.selector=r}get a(){return this.value.a}set a(t){throw new Kt}get b(){return this.value.b}set b(t){throw new Kt}get c(){return this.value.c}set c(t){throw new Kt}selectorString(){return typeof this.selector=="string"||this.selector instanceof String?this.selector:this.selector instanceof Object&&this.selector.type==="Selector"?wn(this.selector):""}toObject(){return this.value}toArray(){return[this.value.a,this.value.b,this.value.c]}toString(){return`(${this.value.a},${this.value.b},${this.value.c})`}toJSON(){return{selector:this.selectorString(),asObject:this.toObject(),asArray:this.toArray(),asString:this.toString()}}isEqualTo(t){return we(this,t)}isGreaterThan(t){return Ae(this,t)}isLessThan(t){return Ne(this,t)}static calculate(t){return ct(t)}static calculateForAST(t){return Lt(t)}static compare(t,r){return at(t,r)}static equals(t,r){return we(t,r)}static lessThan(t,r){return Ne(t,r)}static greaterThan(t,r){return Ae(t,r)}static min(...t){return Hn(...t)}static max(...t){return bt(...t)}static sortAsc(...t){return jt(...t)}static sortDesc(...t){return zt(...t)}},Gn=qn;export{Gn as default};
//# sourceMappingURL=index.js.map