13 lines
188 KiB
JavaScript
13 lines
188 KiB
JavaScript
|
|
var Da=Object.create;var nr=Object.defineProperty;var Na=Object.getOwnPropertyDescriptor;var Oa=Object.getOwnPropertyNames;var Fa=Object.getPrototypeOf,Ra=Object.prototype.hasOwnProperty;var Re=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),x=(e,t)=>{for(var r in t)nr(e,r,{get:t[r],enumerable:!0})},Ma=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Oa(t))!Ra.call(e,i)&&i!==r&&nr(e,i,{get:()=>t[i],enumerable:!(n=Na(t,i))||n.enumerable});return e};var Ba=(e,t,r)=>(r=e!=null?Da(Fa(e)):{},Ma(t||!e||!e.__esModule?nr(r,"default",{value:e,enumerable:!0}):r,e));var yo=Re(hr=>{var xo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");hr.encode=function(e){if(0<=e&&e<xo.length)return xo[e];throw new TypeError("Must be between 0 and 63: "+e)};hr.decode=function(e){var t=65,r=90,n=97,i=122,o=48,a=57,u=43,l=47,s=26,c=52;return t<=e&&e<=r?e-t:n<=e&&e<=i?e-n+s:o<=e&&e<=a?e-o+c:e==u?62:e==l?63:-1}});var Co=Re(fr=>{var ko=yo(),mr=5,wo=1<<mr,vo=wo-1,So=wo;function Qa(e){return e<0?(-e<<1)+1:(e<<1)+0}function Xa(e){var t=(e&1)===1,r=e>>1;return t?-r:r}fr.encode=function(t){var r="",n,i=Qa(t);do n=i&vo,i>>>=mr,i>0&&(n|=So),r+=ko.encode(n);while(i>0);return r};fr.decode=function(t,r,n){var i=t.length,o=0,a=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<<a),a+=mr}while(u);n.value=Xa(o),n.rest=r}});var Nt=Re(V=>{function $a(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}V.getArg=$a;var To=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Za=/^data:.+\,.+$/;function at(e){var t=e.match(To);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}V.urlParse=at;function He(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}V.urlGenerate=He;var Ja=32;function el(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>Ja&&t.pop(),o}}var dr=el(function(t){var r=t,n=at(t);if(n){if(!n.path)return t;r=n.path}for(var i=V.isAbsolute(r),o=[],a=0,u=0;;)if(a=u,u=r.indexOf("/",a),u===-1){o.push(r.slice(a));break}else for(o.push(r.slice(a,u));u<r.length&&r[u]==="/";)u++;for(var l,s=0,u=o.length-1;u>=0;u--)l=o[u],l==="."?o.splice(u,1):l===".."?s++:s>0&&(l===""?(o.splice(u+1,s),s=0):(o.splice(u,2),s--));return r=o.join("/"),r===""&&(r=i?"/":"."),n?(n.path=r,He(n)):r});V.normalize=dr;function Ao(e,t){e===""&&(e="."),t===""&&(t=".");var r=at(t),n=at(e);if(n&&(e=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),He(r);if(r||t.match(Za))return t;if(n&&!n.host&&!n.path)return n.host=t,He(n);var i=t.charAt(0)==="/"?t:dr(e.replace(/\/+$/,"")+"/"+t);return n?(n.path=i,He(n)):i}V.join=Ao;V.isAbsolute=function(e){return e.charAt(0)==="/"||To.test(e)};function tl(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)}V.relative=tl;var Lo=function(){var e=Object.create(null);return!("__proto__"in e)}();function Eo(e){return e}function rl(e){return zo(e)?"$"+e:e}V.toSetString=Lo?Eo:rl;function nl(e){return zo(e)?e.slice(1):e}V.fromSetString=Lo?Eo:nl;function zo(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 il(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.gen
|
||
|
|
`)}})}var lr=100,co=60,uo=" ";function po({source:e,line:t,column:r,baseLine:n,baseColumn:i},o){function a(w,ee){return s.slice(w,ee).map((G,C)=>String(w+C+1).padStart(m)+" |"+G).join(`
|
||
|
|
`)}let u=`
|
||
|
|
`.repeat(Math.max(n-1,0)),l=" ".repeat(Math.max(i-1,0)),s=(u+l+e).split(/\r\n?|\n|\f/),c=Math.max(1,t-o)-1,h=Math.min(t+o,s.length+1),m=Math.max(4,String(h).length)+1,f=0;r+=(uo.length-1)*(s[t-1].substr(0,r-1).match(/\t/g)||[]).length,r>lr&&(f=r-co+3,r=co-2);for(let w=c;w<=h;w++)w>=0&&w<s.length&&(s[w]=s[w].replace(/\t/g,uo),s[w]=(f>0&&s[w].length>f?"\u2026":"")+s[w].substr(f,lr-2)+(s[w].length>f+lr-1?"\u2026":""));return[a(c,t),new Array(r+m+2).join("-")+"^",a(t,h)].filter(Boolean).join(`
|
||
|
|
`).replace(/^(\s+\d+\s+\|\n)+/,"").replace(/\n(\s+\d+\s+\|)+$/,"")}function cr(e,t,r,n,i,o=1,a=1){return Object.assign(Ie("SyntaxError",e),{source:t,offset:r,line:n,column:i,sourceFragment(l){return po({source:t,line:n,column:i,baseLine:o,baseColumn:a},isNaN(l)?0:l)},get formattedMessage(){return`Parse error: ${e}
|
||
|
|
`+po({source:t,line:n,column:i,baseLine:o,baseColumn:a},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=()=>{},Ga=33,Ya=35,ur=59,fo=123,go=0;function Ka(e){return function(){return this[e]()}}function pr(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 Va(e){let t={context:Object.create(null),features:Object.assign(Object.create(null),e.features),scope:Object.assign(Object.create(null),e.scope),atrule:pr(e.atrule),pseudo:pr(e.pseudo),node:pr(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]=Ka(n);break}return{config:t,...t,...t.node}}function bo(e){let t="",r="<unknown>",n=!1,i=mo,o=!1,a=new ot,u=Object.assign(new st,Va(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:ho,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(s){return s===fo?1:0},consumeUntilLeftCurlyBracketOrSemicolon(s){return s===fo||s===ur?1:0},consumeUntilExclamationMarkOrSemicolon(s){return s===Ga||s===ur?1:0},consumeUntilSemicolonIncluded(s){return s===ur?2:0},createList(){return new Z},createSingleNodeList(s){return new Z().appendData(s)},getFirstListNode(s){return s&&s.first},getLastListNode(s){return s&&s.last},parseWithFallback(s,c){let h=this.tokenIndex;try{return s.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(s){let c;do if(c=this.lookupType(s++),c!==13&&c!==25)return c;while(c!==go);return go},charCodeAt(s){return s>=0&&s<t.length?t.charCodeAt(s):0},substring(s,c){return t.substring(s,c)},substrToCursor(s){return this.source.substring(s,this.tokenStart)},cmpChar(s,c){return be(t,s,c)},cmpStr(s,c,h){return xe(t,s,c,h)},consume(s){let c=this.tokenStart;return this.eat(s),this.substrToCursor(c)},consumeFunctionName(){let s=t.substring(this.tokenStart,this.tokenEnd-1);return this.eat(2),s},consumeNumber(s){let c=t.substring(this.tokenStart,ze(t,this.tokenStart));return this.eat(s),c},eat(s){if(this.tokenType!==s){let c=je[s].slice(0,-6).replace(/-/g," ").replace(/^./,f=>f.toUpperCase()),h=`${/[[\](){}]/.test(c)?`"${c}"`:c} is expected`,m=this.tokenStart;switch(s){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(Ya)&&(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(s){(this.tokenType!==1||this.lookupValue(0,s)===!1)&&this.error(`Identifier "${s}" is expected`),this.next()},eatDelim(s){this.isDelim(s)||this.error(`Delim "${String.fromCharCode(s)}" is expected`),this.next()},getLocation(s,c){return n?a.getLocationRange(s,c,r):null},getLocationFromList(s){if(n){let c=this.getFirstListNode(s),h=this.getLastListNode(s);return a.getLocationRange(c!==null?c.loc.start.offset-a.startOffset:this.tokenStart,h!==null?h.loc.end.offset-a.startOffset:this.tokenStart,r)}return null},error(s,c){let h=typeof c<"u"&&c<t.length?a.getLocation(c):this.eof?a.getLocation(io(t,t.length-1)):a.getLocation(this.tokenStart);throw new cr(s||"Unexpected input",t,h.offset,h.line,h.column,a.startLine,a.startColumn)}});return Object.assign(function(s,c){t=s,c=c||{},u.setSource(t,Se),a.setSource(t,c.offset,c.line,c.column),r=c.filename||"<unknown>",n=!!c.positions,i=typeof c.onParseError=="function"?c.onParseError:mo,o=!1,u.parseAtrulePrelude="parseAtrulePrelude"in c?!!c.parseAtrulePrelude:!0,u.parseRulePrelude="parseRulePrelude"in c?!!c.parseRulePrelude:!0,u.parseValue="parseValue"in c?!!c.parseValue:!0,u.parseCustomProperty="parseCustomProperty"in c?!!c.parseCustomProper
|
||
|
|
`,13,!0)},emit(l){i+=l},result(){return i}};n&&(typeof n.decorator=="function"&&(a=n.decorator(a)),n.sourceMap&&(a=_o(a)),n.mode in Rt&&(a.tokenBefore=Rt[n.mode]));let u={node:l=>a.node(l),children:xl,token:(l,s)=>a.token(l,s),tokenize:yl};return a.node(r),a.result()}}function Uo(e){return{fromPlainObject(t){return e(t,{enter(r){r.children&&!(r.children instanceof Z)&&(r.children=new Z().fromArray(r.children))}}),t},toPlainObject(t){return e(t,{leave(r){r.children&&r.children instanceof Z&&(r.children=r.children.toArray())}}),t}}}var{hasOwnProperty:kr}=Object.prototype,ct=function(){};function Ho(e){return typeof e=="function"?e:ct}function Go(e,t){return function(r,n,i){r.type===t&&e.call(this,r,n,i)}}function kl(e,t){let r=t.structure,n=[];for(let i in r){if(kr.call(r,i)===!1)continue;let o=r[i],a={name:i,type:!1,nullable:!1};Array.isArray(o)||(o=[o]);for(let u of o)u===null?a.nullable=!0:typeof u=="string"?a.type="node":Array.isArray(u)&&(a.type="list");a.type&&n.push(a)}return n.length?{context:t.walkContext,fields:n}:null}function wl(e){let t={};for(let r in e.node)if(kr.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]=kl(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,a,u,l){let s;i&&(s=a[n],a[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&&(a[n]=s)}}function Ko({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 Vo(e){let t=wl(e),r={},n={},i=Symbol("break-walk"),o=Symbol("skip-node");for(let s in t)kr.call(t,s)&&t[s]!==null&&(r[s]=Yo(t[s],!1),n[s]=Yo(t[s],!0));let a=Ko(r),u=Ko(n),l=function(s,c){function h(C,M,ve){let O=m.call(G,C,M,ve);return O===i?!0:O===o?!1:!!(w.hasOwnProperty(C.type)&&w[C.type](C,G,h,ee)||f.call(G,C,M,ve)===i)}let m=ct,f=ct,w=r,ee=(C,M,ve,O)=>C||h(M,ve,O),G={break:i,skip:o,root:s,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&&(w=n),c.visit)){if(a.hasOwnProperty(c.visit))w=c.reverse?u[c.visit]:a[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===ct&&f===ct)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");h(s)};return l.break=i,l.skip=o,l.find=function(s,c){let h=null;return l(s,function(m,f,w){if(c.call(this,m,f,w))return h=m,i}),h},l.findLast=function(s,c){let h=null;return l(s,{reverse:!0,enter(m,f,w){if(c.call(this,m,f,w))return h=m,i}}),h},l.findAll=function(s,c){let h=[];return l(s,function(m,f,w){c.call(this,m,f,w)&&h.push(m)}),h},l}function vl(e){return e}function Sl(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 Cl(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 Tl(e,t,r,n){let i=e.combinator===" "||n?e.combinator:" "+e.combinator+" ",o=e.terms.map(a=>Mt(a,t,r,n)).join(i);return e.explicit||r?(n||o[0]===","?"[":"[ ")+o+(n?"]":" ]"):o}function Mt(e,t,r,n){let i;switch(e.type){case"Group":i=Tl(e,t,r,n)+(e.disallowEmpty?"!":"");break;case"Multiplier":return Mt(e.term,t,r,n)+t(Sl(e),e);case"Boolean":i="<boolean-expr["+Mt(e.term,t,r,n)+"]>";break;case"Type":i="<"+e.name+(e.opts?t(Cl(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
|
||
|
|
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:s},i};var _t=new Map,Ye=new Map,Wt=45,jt=Ll,wr=El,Xf=vr;function qt(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===Wt&&e.charCodeAt(t+1)===Wt}function vr(e,t){if(t=t||0,e.length-t>=3&&e.charCodeAt(t)===Wt&&e.charCodeAt(t+1)!==Wt){let r=e.indexOf("-",t+2);if(r!==-1)return e.substring(t,r+1)}return""}function Ll(e){if(_t.has(e))return _t.get(e);let t=e.toLowerCase(),r=_t.get(t);if(r===void 0){let n=qt(t,0),i=n?"":vr(t,0);r=Object.freeze({basename:t.substr(i.length),name:t,prefix:i,vendor:i,custom:n})}return _t.set(e,r),r}function El(e){if(Ye.has(e))return Ye.get(e);let t=e,r=e[0];r==="/"?r=e[1]==="/"?"//":"/":r!=="_"&&r!=="*"&&r!=="$"&&r!=="#"&&r!=="+"&&r!=="&"&&(r="");let n=qt(t,r.length);if(!n&&(t=t.toLowerCase(),Ye.has(t))){let u=Ye.get(t);return Ye.set(e,u),u}let i=n?"":vr(t,r.length),o=t.substr(0,r.length+i.length),a=Object.freeze({basename:t.substr(o.length),name:t.substr(r.length),hack:r,vendor:i,prefix:o,custom:n});return Ye.set(e,a),a}var Ke=["initial","inherit","unset","revert","revert-layer"];var ht=43,fe=45,Sr=110,Ve=!0,Pl=!1;function Tr(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function pt(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===ht||i===fe){if(r)return 0;t++}for(;t<e.value.length;t++)if(!j(e.value.charCodeAt(t)))return 0;return n+1}function Cr(e,t,r){let n=!1,i=pt(e,t,r);if(e=r(i),e===null)return t;if(e.type!==10)if(Tr(e,ht)||Tr(e,fe)){if(n=!0,i=pt(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!==ht&&o!==fe)return 0}return Ce(e,n?0:1,n,i)}function Ar(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,Sr))return 0;switch(e.value.length){case 2:return Cr(t(++r),r,t);case 3:return e.value.charCodeAt(2)!==fe?0:(r=pt(t(++r),r,t),e=t(r),Ce(e,0,Ve,r));default:return e.value.charCodeAt(2)!==fe?0:Ce(e,3,Ve,r)}}else if(e.type===1||Tr(e,ht)&&t(r+1).type===1){if(e.type!==1&&(e=t(++r)),e===null||!be(e.value,0,Sr))return 0;switch(e.value.length){case 1:return Cr(t(++r),r,t);case 2:return e.value.charCodeAt(1)!==fe?0:(r=pt(t(++r),r,t),e=t(r),Ce(e,0,Ve,r));default:return e.value.charCodeAt(1)!==fe?0:Ce(e,2,Ve,r)}}else if(e.type===12){let n=e.value.charCodeAt(0),i=n===ht||n===fe?1:0,o=i;for(;o<e.value.length&&j(e.value.charCodeAt(o));o++);return o===i||!be(e.value,o,Sr)?0:o+1===e.value.length?Cr(t(++r),r,t):e.value.charCodeAt(o+1)!==fe?0:o+2===e.value.length?(r=pt(t(++r),r,t),e=t(r),Ce(e,0,Ve,r)):Ce(e,o+2,Ve,r)}return 0}var Il=43,$o=45,Zo=63,Dl=117;function Lr(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function Nl(e,t){return e.value.charCodeAt(0)===t}function mt(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 mt(e,t+n+1,!1),6;if(!te(o)||++n>6)return 0}return n}function Ut(e,t,r){if(!e)return 0;for(;Lr(r(t),Zo);){if(++e>6)return 0;t++}return t}function Er(e,t){let r=0;if(e===null||e.type!==1||!be(e.value,0,Dl)||(e=t(++r),e===null))return 0;if(Lr(e,Il))return e=t(++r),e===null?0:e.type===1?Ut(mt(e,0,!0),++r,t):Lr(e,Zo)?Ut(1,++r,t):0;if(e.type===10){let n=mt(e,1,!0);return n===0?0:(e=t(++r),e===null?r:e.type===12||e.type===10?!Nl(e,$o)||!mt(e,1,!1)?0:r+1:Ut(n,r,t))}return e.type===12?Ut(mt(e,1,!0),++r,t):0}var Ol=["calc(","-moz-calc(","-webkit-calc("],zr=new Map([[2,22],[21,22],[19,20],[23,24]]);function le(e,t){return t<e.length?e.charCodeAt(t):0}function Jo(e,t){return xe(e,0,e.length,t)}function es(e,t){for(let r=0;r<t.length;r++)if(Jo(e,t[r]))return!0;return!1}function ts(e,t){return t!==e.length-2?!1:le(e,t)===92&&j(le(e,t+1))}function Ht(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
|
||
|
|
`+t+`
|
||
|
|
--`+new Array((r||t.length)+1).join("-")+"^"})}var rc=9,nc=10,ic=12,oc=13,sc=32,os=new Uint8Array(128).map((e,t)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))?1:0),Kt=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)}isNameCharCode(t=this.charCode()){return t<128&&os[t]===1}nextCharCode(){return this.charCodeAt(this.pos+1)}nextNonWsCode(t){return this.charCodeAt(this.findWsEnd(t))}skipWs(){this.pos=this.findWsEnd(this.pos)}findWsEnd(t){for(;t<this.str.length;t++){let r=this.str.charCodeAt(t);if(r!==oc&&r!==nc&&r!==ic&&r!==sc&&r!==rc)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 Yt(t,this.str,this.pos)}scanSpaces(){return this.substringToPos(this.findWsEnd(this.pos))}scanWord(){let t=this.pos;for(;t<this.str.length;t++){let r=this.str.charCodeAt(t);if(r>=128||os[r]===0)break}return this.pos===t&&this.error("Expect a keyword"),this.substringToPos(t)}scanNumber(){let t=this.pos;for(;t<this.str.length;t++){let r=this.str.charCodeAt(t);if(r<48||r>57)break}return this.pos===t&&this.error("Expect a number"),this.substringToPos(t)}scanString(){let t=this.str.indexOf("'",this.pos+1);return t===-1&&(this.pos=this.str.length,this.error("Expect an apostrophe")),this.substringToPos(t+1)}};var ac=9,lc=10,cc=12,uc=13,pc=32,ms=33,Nr=35,ss=38,Vt=39,fs=40,hc=41,ds=42,Or=43,Fr=44,as=45,Rr=60,Ir=62,Dr=63,mc=64,ft=91,dt=93,Qt=123,ls=124,cs=125,us=8734,ps={" ":1,"&&":2,"||":3,"|":4};function hs(e){let t=null,r=null;return e.eat(Qt),e.skipWs(),t=e.scanNumber(e),e.skipWs(),e.charCode()===Fr?(e.pos++,e.skipWs(),e.charCode()!==cs&&(r=e.scanNumber(e),e.skipWs())):r=t,e.eat(cs),{min:Number(t),max:r?Number(r):0}}function fc(e){let t=null,r=!1;switch(e.charCode()){case ds:e.pos++,t={min:0,max:0};break;case Or:e.pos++,t={min:1,max:0};break;case Dr:e.pos++,t={min:0,max:1};break;case Nr:e.pos++,r=!0,e.charCode()===Qt?t=hs(e):e.charCode()===Dr?(e.pos++,t={min:0,max:0}):t={min:1,max:0};break;case Qt:t=hs(e);break;default:return null}return{type:"Multiplier",comma:r,min:t.min,max:t.max,term:null}}function Te(e,t){let r=fc(e);return r!==null?(r.term=t,e.charCode()===Nr&&e.charCodeAt(e.pos-1)===Or?Te(e,r):r):t}function Pr(e){let t=e.peek();return t===""?null:Te(e,{type:"Token",value:t})}function dc(e){let t;return e.eat(Rr),e.eat(Vt),t=e.scanWord(),e.eat(Vt),e.eat(Ir),Te(e,{type:"Property",name:t})}function gc(e){let t=null,r=null,n=1;return e.eat(ft),e.charCode()===as&&(e.peek(),n=-1),n==-1&&e.charCode()===us?e.peek():(t=n*Number(e.scanNumber(e)),e.isNameCharCode()&&(t+=e.scanWord())),e.skipWs(),e.eat(Fr),e.skipWs(),e.charCode()===us?e.peek():(n=1,e.charCode()===as&&(e.peek(),n=-1),r=n*Number(e.scanNumber(e)),e.isNameCharCode()&&(r+=e.scanWord())),e.eat(dt),{type:"Range",min:t,max:r}}function bc(e){let t,r=null;if(e.eat(Rr),t=e.scanWord(),t==="boolean-expr"){e.eat(ft);let n=Mr(e,dt);return e.eat(dt),e.eat(Ir),Te(e,{type:"Boolean",term:n.terms.length===1?n.terms[0]:n})}return e.charCode()===fs&&e.nextCharCode()===hc&&(e.pos+=2,t+="()"),e.charCodeAt(e.findWsEnd(e.pos))===ft&&(e.skipWs(),r=gc(e)),e.eat(Ir),Te(e,{type:"Type",name:t,opts:r})}function xc(e){let t=e.scanWord();return e.charCode()===fs?(e.pos++,{type:"Function",name:t}):Te(e,{type:"Keyword",name:t})}function yc(e,t){function r(i,o){return{type:"Group",terms:i,combinator:o,disallowEmpty:!1,explicit:!1}}let n;for(t=Object.keys(t).sort((i,o)=>ps[i]-ps[o]);t.length>0;){n=t.shift();let i=0,o=0;for(;i<e.length;i++){let a=e[i];a.type==="Combinator"&&(a.value===n?(o===-1&&(o=i-1),e.splice(i,1),i--):(o!==-1&&i-o>1&&(e.splice(o,i-o,r(e.slice(o,i),n)),i=o+1),o=-1))}o!==-1&&t.length&&e.splice(o,i-o,r(e.slice(o,i),n))}return n}function Mr(e,t){let r=Object.create(null),n=[],i,o=null,a=e.pos;for(;e.charCode()!==t&&(i=wc(e,t));)i.type!=="Spaces"&&(i.type==="Combinator"?((o===null||o.type==="Combinator")&&
|