@eslint/config-inspector
Version:
A visual tool for inspecting and understanding your ESLint flat configs
3 lines (2 loc) • 42.3 kB
JavaScript
import{j,J as g,e as b,aa as F,g as m,H as et,Y as C,X as O,f as A,d as x,G as M,S as tt,c as B,z as st,h as w,F as E,O as H,_ as le,r as ae,V as Se,T as nt,v as it,L as rt,a3 as ot,i as U,K as he,n as ze,l as ct,Z as ut,Q as lt,q as we,p as at,P as se,ab as Z,M as q,w as ce,C as ht,o as dt}from"./CpdG7ysU.js";import{g as ft,C as gt,_ as pt}from"./kRSJCsry.js";function P(t){return Array.isArray?Array.isArray(t):We(t)==="[object Array]"}function mt(t){if(typeof t=="string")return t;if(typeof t=="bigint")return t.toString();const e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function de(t){return t==null?"":mt(t)}function I(t){return typeof t=="string"}function te(t){return typeof t=="number"}function vt(t){return t===!0||t===!1||yt(t)&&We(t)=="[object Boolean]"}function Ve(t){return typeof t=="object"}function yt(t){return Ve(t)&&t!==null}function S(t){return t!=null}function ee(t){return!t.trim().length}function We(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const xt="Incorrect 'index' type",At=t=>`Invalid value for key ${t}`,kt=t=>`Pattern length exceeds max of ${t}.`,Ct=t=>`Missing ${t} property in key`,Et=t=>`Property 'weight' in key '${t}' must be a positive integer`,Fe=Object.prototype.hasOwnProperty;class bt{constructor(e){this._keys=[],this._keyMap={};let s=0;e.forEach(i=>{const n=He(i);this._keys.push(n),this._keyMap[n.id]=n,s+=n.weight}),this._keys.forEach(i=>{i.weight/=s})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function He(t){let e=null,s=null,i=null,n=1,o=null;if(I(t)||P(t))i=t,e=Be(t),s=fe(t);else{if(!Fe.call(t,"name"))throw new Error(Ct("name"));const a=t.name;if(i=a,Fe.call(t,"weight")&&(n=t.weight,n<=0))throw new Error(Et(a));e=Be(a),s=fe(a),o=t.getFn}return{path:e,id:s,weight:n,src:i,getFn:o}}function Be(t){return P(t)?t:t.split(".")}function fe(t){return P(t)?t.join("."):t}function Mt(t,e){const s=[];let i=!1;const n=(o,a,r,c)=>{if(S(o))if(!a[r])s.push(c!==void 0?{v:o,i:c}:o);else{const u=a[r],l=o[u];if(!S(l))return;if(r===a.length-1&&(I(l)||te(l)||vt(l)||typeof l=="bigint"))s.push(c!==void 0?{v:de(l),i:c}:de(l));else if(P(l)){i=!0;for(let h=0,f=l.length;h<f;h+=1)n(l[h],a,r+1,h)}else a.length&&n(l,a,r+1,c)}};return n(t,I(e)?e.split("."):e,0),i?s:s[0]}const It={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Dt={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1},St={location:0,threshold:.6,distance:100},wt={useExtendedSearch:!1,useTokenSearch:!1,getFn:Mt,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},p=Object.freeze({...Dt,...It,...St,...wt}),Ft=/[^ ]+/g;function Bt(t=1,e=3){const s=new Map,i=Math.pow(10,e);return{get(n){const o=n.match(Ft).length;if(s.has(o))return s.get(o);const a=1/Math.pow(o,.5*t),r=parseFloat(Math.round(a*i)/i);return s.set(o,r),r},clear(){s.clear()}}}class Ee{constructor({getFn:e=p.getFn,fieldNormWeight:s=p.fieldNormWeight}={}){this.norm=Bt(s,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((s,i)=>{this._keysMap[s.id]=i})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,I(this.docs[0])?this.docs.forEach((e,s)=>{this._addString(e,s)}):this.docs.forEach((e,s)=>{this._addObject(e,s)}),this.norm.clear())}add(e){const s=this.size();I(e)?this._addString(e,s):this._addObject(e,s)}removeAt(e){this.records.splice(e,1);for(let s=e,i=this.size();s<i;s+=1)this.records[s].i-=1}removeAll(e){for(let s=e.length-1;s>=0;s-=1)this.records.splice(e[s],1);for(let s=0,i=this.records.length;s<i;s+=1)this.records[s].i=s}getValueForItemAtKeyId(e,s){return e[this._keysMap[s]]}size(){return this.records.length}_addString(e,s){if(!S(e)||ee(e))return;const i={v:e,i:s,n:this.norm.get(e)};this.records.push(i)}_addObject(e,s){const i={i:s,$:{}};this.keys.forEach((n,o)=>{const a=n.getFn?n.getFn(e):this.getFn(e,n.path);if(S(a)){if(P(a)){const r=[];for(let c=0,u=a.length;c<u;c+=1){const l=a[c];if(S(l)){if(I(l)){if(!ee(l)){const h={v:l,i:c,n:this.norm.get(l)};r.push(h)}}else if(S(l.v)){const h=I(l.v)?l.v:de(l.v);if(!ee(h)){const f={v:h,i:l.i,n:this.norm.get(h)};r.push(f)}}}}i.$[o]=r}else if(I(a)&&!ee(a)){const r={v:a,n:this.norm.get(a)};i.$[o]=r}}}),this.records.push(i)}toJSON(){return{keys:this.keys.map(({getFn:e,...s})=>s),records:this.records}}}function Ke(t,e,{getFn:s=p.getFn,fieldNormWeight:i=p.fieldNormWeight}={}){const n=new Ee({getFn:s,fieldNormWeight:i});return n.setKeys(t.map(He)),n.setSources(e),n.create(),n}function _t(t,{getFn:e=p.getFn,fieldNormWeight:s=p.fieldNormWeight}={}){const{keys:i,records:n}=t,o=new Ee({getFn:e,fieldNormWeight:s});return o.setKeys(i),o.setIndexRecords(n),o}function $t(t=[],e=p.minMatchCharLength){const s=[];let i=-1,n=-1,o=0;for(let a=t.length;o<a;o+=1){const r=t[o];r&&i===-1?i=o:!r&&i!==-1&&(n=o-1,n-i+1>=e&&s.push([i,n]),i=-1)}return t[o-1]&&o-i>=e&&s.push([i,o-1]),s}const W=32;function Ot(t,e,s,{location:i=p.location,distance:n=p.distance,threshold:o=p.threshold,findAllMatches:a=p.findAllMatches,minMatchCharLength:r=p.minMatchCharLength,includeMatches:c=p.includeMatches,ignoreLocation:u=p.ignoreLocation}={}){if(e.length>W)throw new Error(kt(W));const l=e.length,h=t.length,f=Math.max(0,Math.min(i,h));let d=o,v=f;const y=(D,R)=>{const _=D/l;if(u)return _;const G=Math.abs(f-R);return n?_+G/n:G?1:_},k=r>1||c,L=k?Array(h):[];let T;for(;(T=t.indexOf(e,v))>-1;){const D=y(0,T);if(d=Math.min(D,d),v=T+l,k){let R=0;for(;R<l;)L[T+R]=1,R+=1}}v=-1;let N=[],V=1,Y=l+h;const qe=1<<l-1;for(let D=0;D<l;D+=1){let R=0,_=Y;for(;R<_;)y(D,f+_)<=d?R=_:Y=_,_=Math.floor((Y-R)/2+R);Y=_;let G=Math.max(1,f-_+1);const oe=a?h:Math.min(f+_,h)+l,J=Array(oe+2);J[oe+1]=(1<<D)-1;for(let $=oe;$>=G;$-=1){const X=$-1,De=s[t[X]];if(k&&(L[X]=+!!De),J[$]=(J[$+1]<<1|1)&De,D&&(J[$]|=(N[$+1]|N[$])<<1|1|N[$+1]),J[$]&qe&&(V=y(D,X),V<=d)){if(d=V,v=X,v<=f)break;G=Math.max(1,2*f-v)}}if(y(D+1,f)>d)break;N=J}const re={isMatch:v>=0,score:Math.max(.001,V)};if(k){const D=$t(L,r);D.length?c&&(re.indices=D):re.isMatch=!1}return re}function Lt(t){const e={};for(let s=0,i=t.length;s<i;s+=1){const n=t.charAt(s);e[n]=(e[n]||0)|1<<i-s-1}return e}function be(t){if(t.length<=1)return t;t.sort((s,i)=>s[0]-i[0]||s[1]-i[1]);const e=[t[0]];for(let s=1,i=t.length;s<i;s+=1){const n=e[e.length-1],o=t[s];o[0]<=n[1]+1?n[1]=Math.max(n[1],o[1]):e.push(o)}return e}const Je={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},Rt=new RegExp("["+Object.keys(Je).join("")+"]","g"),Q=String.prototype.normalize?t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(Rt,e=>Je[e]):t=>t;class Me{constructor(e,{location:s=p.location,threshold:i=p.threshold,distance:n=p.distance,includeMatches:o=p.includeMatches,findAllMatches:a=p.findAllMatches,minMatchCharLength:r=p.minMatchCharLength,isCaseSensitive:c=p.isCaseSensitive,ignoreDiacritics:u=p.ignoreDiacritics,ignoreLocation:l=p.ignoreLocation}={}){if(this.options={location:s,threshold:i,distance:n,includeMatches:o,findAllMatches:a,minMatchCharLength:r,isCaseSensitive:c,ignoreDiacritics:u,ignoreLocation:l},e=c?e:e.toLowerCase(),e=u?Q(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const h=(d,v)=>{this.chunks.push({pattern:d,alphabet:Lt(d),startIndex:v})},f=this.pattern.length;if(f>W){let d=0;const v=f%W,y=f-v;for(;d<y;)h(this.pattern.substr(d,W),d),d+=W;if(v){const k=f-W;h(this.pattern.substr(k),k)}}else h(this.pattern,0)}searchIn(e){const{isCaseSensitive:s,ignoreDiacritics:i,includeMatches:n}=this.options;if(e=s?e:e.toLowerCase(),e=i?Q(e):e,this.pattern===e){const y={isMatch:!0,score:0};return n&&(y.indices=[[0,e.length-1]]),y}const{location:o,distance:a,threshold:r,findAllMatches:c,minMatchCharLength:u,ignoreLocation:l}=this.options,h=[];let f=0,d=!1;this.chunks.forEach(({pattern:y,alphabet:k,startIndex:L})=>{const{isMatch:T,score:N,indices:V}=Ot(e,y,k,{location:o+L,distance:a,threshold:r,findAllMatches:c,minMatchCharLength:u,includeMatches:n,ignoreLocation:l});T&&(d=!0),f+=N,T&&V&&h.push(...V)});const v={isMatch:d,score:d?f/this.chunks.length:1};return d&&n&&(v.indices=be(h)),v}}class z{constructor(e){this.pattern=e}static isMultiMatch(e){return _e(e,this.multiRegex)}static isSingleMatch(e){return _e(e,this.singleRegex)}search(e){return{isMatch:!1,score:1}}}function _e(t,e){const s=t.match(e);return s?s[1]:null}class Tt extends z{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const s=e===this.pattern;return{isMatch:s,score:s?0:1,indices:[0,this.pattern.length-1]}}}class Nt extends z{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const i=e.indexOf(this.pattern)===-1;return{isMatch:i,score:i?0:1,indices:[0,e.length-1]}}}class jt extends z{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const s=e.startsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,this.pattern.length-1]}}}class Pt extends z{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const s=!e.startsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}}class zt extends z{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const s=e.endsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class Vt extends z{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const s=!e.endsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}}class Ue extends z{constructor(e,{location:s=p.location,threshold:i=p.threshold,distance:n=p.distance,includeMatches:o=p.includeMatches,findAllMatches:a=p.findAllMatches,minMatchCharLength:r=p.minMatchCharLength,isCaseSensitive:c=p.isCaseSensitive,ignoreDiacritics:u=p.ignoreDiacritics,ignoreLocation:l=p.ignoreLocation}={}){super(e),this._bitapSearch=new Me(e,{location:s,threshold:i,distance:n,includeMatches:o,findAllMatches:a,minMatchCharLength:r,isCaseSensitive:c,ignoreDiacritics:u,ignoreLocation:l})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class Ge extends z{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let s=0,i;const n=[],o=this.pattern.length;for(;(i=e.indexOf(this.pattern,s))>-1;)s=i+o,n.push([i,s-1]);const a=!!n.length;return{isMatch:a,score:a?0:1,indices:n}}}const ge=[Tt,Ge,jt,Pt,Vt,zt,Nt,Ue],$e=ge.length,Wt="\0",Ht="|";function Kt(t){const e=[],s=t.length;let i=0;for(;i<s;){for(;i<s&&t[i]===" ";)i++;if(i>=s)break;let n=i;for(;n<s&&t[n]!==" "&&t[n]!=='"';)n++;if(n<s&&t[n]==='"'){for(n++;n<s;){if(t[n]==='"'){const o=n+1;if(o>=s||t[o]===" "){n++;break}if(t[o]==="$"&&(o+1>=s||t[o+1]===" ")){n+=2;break}}n++}e.push(t.substring(i,n)),i=n}else{for(;n<s&&t[n]!==" ";)n++;e.push(t.substring(i,n)),i=n}}return e}function Jt(t,e={}){return t.replace(/\\\|/g,Wt).split(Ht).map(i=>{const n=i.replace(/\u0000/g,"|"),o=Kt(n.trim()).filter(r=>r&&!!r.trim()),a=[];for(let r=0,c=o.length;r<c;r+=1){const u=o[r];let l=!1,h=-1;for(;!l&&++h<$e;){const f=ge[h],d=f.isMultiMatch(u);d&&(a.push(new f(d,e)),l=!0)}if(!l)for(h=-1;++h<$e;){const f=ge[h],d=f.isSingleMatch(u);if(d){a.push(new f(d,e));break}}}return a})}const Ut=new Set([Ue.type,Ge.type]);class Gt{constructor(e,{isCaseSensitive:s=p.isCaseSensitive,ignoreDiacritics:i=p.ignoreDiacritics,includeMatches:n=p.includeMatches,minMatchCharLength:o=p.minMatchCharLength,ignoreLocation:a=p.ignoreLocation,findAllMatches:r=p.findAllMatches,location:c=p.location,threshold:u=p.threshold,distance:l=p.distance}={}){this.query=null,this.options={isCaseSensitive:s,ignoreDiacritics:i,includeMatches:n,minMatchCharLength:o,findAllMatches:r,ignoreLocation:a,location:c,threshold:u,distance:l},e=s?e:e.toLowerCase(),e=i?Q(e):e,this.pattern=e,this.query=Jt(this.pattern,this.options)}static condition(e,s){return s.useExtendedSearch}searchIn(e){const s=this.query;if(!s)return{isMatch:!1,score:1};const{includeMatches:i,isCaseSensitive:n,ignoreDiacritics:o}=this.options;e=n?e:e.toLowerCase(),e=o?Q(e):e;let a=0;const r=[];let c=0,u=!1;for(let l=0,h=s.length;l<h;l+=1){const f=s[l];r.length=0,a=0,u=!1;for(let d=0,v=f.length;d<v;d+=1){const y=f[d],{isMatch:k,indices:L,score:T}=y.search(e);if(k){a+=1,c+=T;const N=y.constructor.type;N.startsWith("inverse")&&(u=!0),i&&(Ut.has(N)?r.push(...L):r.push(L))}else{c=0,a=0,r.length=0,u=!1;break}}if(a){const d={isMatch:!0,score:c/a};return u&&(d.hasInverse=!0),i&&(d.indices=be(r)),d}}return{isMatch:!1,score:1}}}const pe=[];function Ie(...t){pe.push(...t)}function ne(t,e){for(let s=0,i=pe.length;s<i;s+=1){const n=pe[s];if(n.condition(t,e))return new n(t,e)}return new Me(t,e)}const ie={AND:"$and",OR:"$or"},me={PATH:"$path",PATTERN:"$val"},ve=t=>!!(t[ie.AND]||t[ie.OR]),Qt=t=>!!t[me.PATH],Yt=t=>!P(t)&&Ve(t)&&!ve(t),Oe=t=>({[ie.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function Qe(t,e,{auto:s=!0}={}){const i=n=>{if(I(n)){const c={keyId:null,pattern:n};return s&&(c.searcher=ne(n,e)),c}const o=Object.keys(n),a=Qt(n);if(!a&&o.length>1&&!ve(n))return i(Oe(n));if(Yt(n)){const c=a?n[me.PATH]:o[0],u=a?n[me.PATTERN]:n[c];if(!I(u))throw new Error(At(c));const l={keyId:fe(c),pattern:u};return s&&(l.searcher=ne(u,e)),l}const r={children:[],operator:o[0]};return o.forEach(c=>{const u=n[c];P(u)&&u.forEach(l=>{r.children.push(i(l))})}),r};return ve(t)||(t=Oe(t)),i(t)}function ye(t,{ignoreFieldNorm:e=p.ignoreFieldNorm}){let s=1;return t.forEach(({key:i,norm:n,score:o})=>{const a=i?i.weight:null;s*=Math.pow(o===0&&a?Number.EPSILON:o,(a||1)*(e?1:n))}),s}function Xt(t,{ignoreFieldNorm:e=p.ignoreFieldNorm}){t.forEach(s=>{s.score=ye(s.matches,{ignoreFieldNorm:e})})}class Zt{constructor(e){this.limit=e,this.heap=[]}get size(){return this.heap.length}shouldInsert(e){return this.size<this.limit||e<this.heap[0].score}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):e.score<this.heap[0].score&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(e){return this.heap.sort(e)}_bubbleUp(e){const s=this.heap;for(;e>0;){const i=e-1>>1;if(s[e].score<=s[i].score)break;const n=s[e];s[e]=s[i],s[i]=n,e=i}}_sinkDown(e){const s=this.heap,i=s.length;let n=e;do{e=n;const o=2*e+1,a=2*e+2;if(o<i&&s[o].score>s[n].score&&(n=o),a<i&&s[a].score>s[n].score&&(n=a),n!==e){const r=s[e];s[e]=s[n],s[n]=r}}while(n!==e)}}function qt(t,e){const s=t.matches;e.matches=[],S(s)&&s.forEach(i=>{if(!S(i.indices)||!i.indices.length)return;const{indices:n,value:o}=i,a={indices:n,value:o};i.key&&(a.key=i.key.src),i.idx>-1&&(a.refIndex=i.idx),e.matches.push(a)})}function es(t,e){e.score=t.score}function ts(t,e,{includeMatches:s=p.includeMatches,includeScore:i=p.includeScore}={}){const n=[];return s&&n.push(qt),i&&n.push(es),t.map(o=>{const{idx:a}=o,r={item:e[a],refIndex:a};return n.length&&n.forEach(c=>{c(o,r)}),r})}const ss=/\b\w+\b/g;function xe({isCaseSensitive:t=!1,ignoreDiacritics:e=!1}={}){return{tokenize(s){return t||(s=s.toLowerCase()),e&&(s=Q(s)),s.match(ss)||[]}}}function ns(t,e,s){const i=new Map,n=new Map;let o=0;function a(r,c,u,l){const h=s.tokenize(r);if(!h.length)return;o++;const f=new Map;for(const d of h)f.set(d,(f.get(d)||0)+1);for(const[d,v]of f){const y={docIdx:c,keyIdx:u,subIdx:l,tf:v};let k=i.get(d);k||(k=[],i.set(d,k)),k.push(y),n.set(d,(n.get(d)||0)+1)}}for(const r of t){const{i:c,v:u,$:l}=r;if(u!==void 0){a(u,c,-1,-1);continue}if(l)for(let h=0;h<e;h++){const f=l[h];if(f)if(Array.isArray(f))for(const d of f)a(d.v,c,h,d.i??-1);else a(f.v,c,h,-1)}}return{terms:i,fieldCount:o,df:n}}function is(t,e,s,i){const{i:n,v:o,$:a}=e;function r(c,u,l){const h=i.tokenize(c);if(!h.length)return;t.fieldCount++;const f=new Map;for(const d of h)f.set(d,(f.get(d)||0)+1);for(const[d,v]of f){const y={docIdx:n,keyIdx:u,subIdx:l,tf:v};let k=t.terms.get(d);k||(k=[],t.terms.set(d,k)),k.push(y),t.df.set(d,(t.df.get(d)||0)+1)}}if(o!==void 0){r(o,-1,-1);return}if(a)for(let c=0;c<s;c++){const u=a[c];if(u)if(Array.isArray(u))for(const l of u)r(l.v,c,l.i??-1);else r(u.v,c,-1)}}function Le(t,e){for(const[s,i]of t.terms){const n=i.filter(a=>a.docIdx!==e),o=i.length-n.length;o>0&&(t.fieldCount-=o,t.df.set(s,(t.df.get(s)||0)-o),n.length===0?(t.terms.delete(s),t.df.delete(s)):t.terms.set(s,n))}}class K{constructor(e,s,i){this.options={...p,...s},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new bt(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,i),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;const s=this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options,i=ne(e,s);return this._lastQuery=e,this._lastSearcher=i,i}setCollection(e,s){if(this._docs=e,s&&!(s instanceof Ee))throw new Error(xt);if(this._myIndex=s||Ke(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const i=xe({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});this._invertedIndex=ns(this._myIndex.records,this._myIndex.keys.length,i)}}add(e){if(S(e)&&(this._docs.push(e),this._myIndex.add(e),this._invertedIndex)){const s=this._myIndex.records[this._myIndex.records.length-1],i=xe({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});is(this._invertedIndex,s,this._myIndex.keys.length,i)}}remove(e=()=>!1){const s=[],i=[];for(let n=0,o=this._docs.length;n<o;n+=1)e(this._docs[n],n)&&(s.push(this._docs[n]),i.push(n));if(i.length){if(this._invertedIndex)for(const n of i)Le(this._invertedIndex,n);for(let n=i.length-1;n>=0;n-=1)this._docs.splice(i[n],1);this._myIndex.removeAll(i)}return s}removeAt(e){this._invertedIndex&&Le(this._invertedIndex,e);const s=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),s}getIndex(){return this._myIndex}search(e,s){const{limit:i=-1}=s||{},{includeMatches:n,includeScore:o,shouldSort:a,sortFn:r,ignoreFieldNorm:c}=this.options;if(I(e)&&!e.trim()){let h=this._docs.map((f,d)=>({item:f,refIndex:d}));return te(i)&&i>-1&&(h=h.slice(0,i)),h}const u=te(i)&&i>0&&I(e);let l;if(u){const h=new Zt(i);I(this._docs[0])?this._searchStringList(e,{heap:h,ignoreFieldNorm:c}):this._searchObjectList(e,{heap:h,ignoreFieldNorm:c}),l=h.extractSorted(r)}else l=I(e)?I(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),Xt(l,{ignoreFieldNorm:c}),a&&l.sort(r),te(i)&&i>-1&&(l=l.slice(0,i));return ts(l,this._docs,{includeMatches:n,includeScore:o})}_searchStringList(e,{heap:s,ignoreFieldNorm:i}={}){const n=this._getSearcher(e),{records:o}=this._myIndex,a=s?null:[];return o.forEach(({v:r,i:c,n:u})=>{if(!S(r))return;const{isMatch:l,score:h,indices:f}=n.searchIn(r);if(l){const d={item:r,idx:c,matches:[{score:h,value:r,norm:u,indices:f}]};s?(d.score=ye(d.matches,{ignoreFieldNorm:i}),s.shouldInsert(d.score)&&s.insert(d)):a.push(d)}}),a}_searchLogical(e){const s=Qe(e,this.options),i=(r,c,u)=>{if(!("children"in r)){const{keyId:d,searcher:v}=r;let y;return d===null?(y=[],this._myIndex.keys.forEach((k,L)=>{y.push(...this._findMatches({key:k,value:c[L],searcher:v}))})):y=this._findMatches({key:this._keyStore.get(d),value:this._myIndex.getValueForItemAtKeyId(c,d),searcher:v}),y&&y.length?[{idx:u,item:c,matches:y}]:[]}const{children:l,operator:h}=r,f=[];for(let d=0,v=l.length;d<v;d+=1){const y=l[d],k=i(y,c,u);if(k.length)f.push(...k);else if(h===ie.AND)return[]}return f},n=this._myIndex.records,o=new Map,a=[];return n.forEach(({$:r,i:c})=>{if(S(r)){const u=i(s,r,c);u.length&&(o.has(c)||(o.set(c,{idx:c,item:r,matches:[]}),a.push(o.get(c))),u.forEach(({matches:l})=>{o.get(c).matches.push(...l)}))}}),a}_searchObjectList(e,{heap:s,ignoreFieldNorm:i}={}){const n=this._getSearcher(e),{keys:o,records:a}=this._myIndex,r=s?null:[];return a.forEach(({$:c,i:u})=>{if(!S(c))return;const l=[];let h=!1,f=!1;if(o.forEach((d,v)=>{const y=this._findMatches({key:d,value:c[v],searcher:n});y.length?(l.push(...y),y[0].hasInverse&&(f=!0)):h=!0}),!(f&&h)&&l.length){const d={idx:u,item:c,matches:l};s?(d.score=ye(d.matches,{ignoreFieldNorm:i}),s.shouldInsert(d.score)&&s.insert(d)):r.push(d)}}),r}_findMatches({key:e,value:s,searcher:i}){if(!S(s))return[];const n=[];if(P(s))s.forEach(({v:o,i:a,n:r})=>{if(!S(o))return;const{isMatch:c,score:u,indices:l,hasInverse:h}=i.searchIn(o);c&&n.push({score:u,key:e,value:o,idx:a,norm:r,indices:l,hasInverse:h})});else{const{v:o,n:a}=s,{isMatch:r,score:c,indices:u,hasInverse:l}=i.searchIn(o);r&&n.push({score:c,key:e,value:o,norm:a,indices:u,hasInverse:l})}return n}}class rs{static condition(e,s){return s.useTokenSearch}constructor(e,s){this.options=s,this.analyzer=xe({isCaseSensitive:s.isCaseSensitive,ignoreDiacritics:s.ignoreDiacritics});const i=this.analyzer.tokenize(e),n=s._invertedIndex,{df:o,fieldCount:a}=n;this.termSearchers=[],this.idfWeights=[];for(const r of i){this.termSearchers.push(new Me(r,{location:s.location,threshold:s.threshold,distance:s.distance,includeMatches:s.includeMatches,findAllMatches:s.findAllMatches,minMatchCharLength:s.minMatchCharLength,isCaseSensitive:s.isCaseSensitive,ignoreDiacritics:s.ignoreDiacritics,ignoreLocation:!0}));const c=o.get(r)||0,u=Math.log(1+(a-c+.5)/(c+.5));this.idfWeights.push(u)}}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const s=[];let i=0,n=0,o=0;for(let c=0;c<this.termSearchers.length;c++){const u=this.termSearchers[c].searchIn(e),l=this.idfWeights[c];n+=l,u.isMatch&&(o++,i+=l*(1-u.score),u.indices&&s.push(...u.indices))}if(o===0)return{isMatch:!1,score:1};const a=n>0?1-i/n:0,r={isMatch:!0,score:Math.max(.001,a)};return this.options.includeMatches&&s.length&&(r.indices=be(s)),r}}K.version="7.3.0";K.createIndex=Ke;K.parseIndex=_t;K.config=p;K.match=function(t,e,s){return ne(t,{...p,...s}).searchIn(e)};K.parseQuery=Qe;Ie(Gt);Ie(rs);K.use=function(...t){t.forEach(e=>Ie(e))};const os={key:1,"color-faint":""},cs={key:2},us={"color-base":""},ls=j({__name:"ColorizedRuleName",props:{name:{},prefix:{},url:{},as:{},deprecated:{type:[Boolean,Object]},borderless:{type:Boolean},break:{type:Boolean}},setup(t){const e=t,s=B(()=>{if(e.prefix)return e.name.startsWith(e.prefix)?{scope:e.prefix,name:e.name.slice(e.prefix.length).replace(/^\/+/,"")}:{scope:void 0,name:e.name};const i=e.name.split("/");return i.length===1?{scope:void 0,name:i[0]}:{scope:i[0],name:i.slice(1).join("/")}});return(i,n)=>(g(),b(tt(t.as||"div"),{"of-hidden":"","text-ellipsis":"","ws-nowrap":"","font-mono":"",class:M([t.deprecated?"line-through":"",t.borderless?"":"badge"])},{default:F(()=>[s.value.scope?(g(),m("span",{key:0,style:et({color:C(ft)(s.value.scope)})},O(s.value.scope),5)):A("",!0),s.value.scope?(g(),m("span",os,"/")):A("",!0),s.value.scope&&e.break?(g(),m("br",cs)):A("",!0),x("span",us,O(s.value.name),1)]),_:1},8,["class"]))}}),as={border:"~ rose-700/30 dark:rose-300/30 rounded","select-none":"","bg-rose-50":"",px1:"","text-xs":"","text-rose-700":"","dark:bg-rose-900:20":"","dark:text-rose-300":""},hs={key:0,"p-2":"","text-sm":"","color-base":""},ds={key:0,mb1:"",flex:"~ gap-1","text-rose-700":"","dark:text-rose-300":""},fs={key:1},gs={key:2},ps={mt2:""},ms=["href"],Re=j({__name:"RuleDeprecatedInfo",props:{deprecated:{type:[Boolean,Object]},invalid:{type:Boolean}},setup(t){const e=B(()=>{if(!(!t.deprecated||typeof t.deprecated=="boolean"))return t.deprecated}),s=B(()=>{if(!e.value)return;let n="";return e.value.deprecatedSince&&(n+=`was deprecated in v${e.value.deprecatedSince}`),e.value.availableUntil&&(n&&(n+=", and "),n+=`will be removed in v${e.value.availableUntil}`),`This rule ${n}.`});function i(n){return["text-blue-700 dark:text-blue-300",n?"underline":""]}return(n,o)=>(g(),b(C(st),{"inline-block":"",disabled:!e.value},{popper:F(({shown:a})=>[a&&e.value?(g(),m("div",hs,[e.value.message?(g(),m("p",ds,[o[0]||(o[0]=x("span",{"i-ph-warning-duotone":"","inline-block":""},null,-1)),w(O(e.value.message),1)])):A("",!0),s.value?(g(),m("p",fs,O(s.value),1)):A("",!0),e.value.replacedBy?.length?(g(),m("p",gs,[o[2]||(o[2]=w(" Please use the ",-1)),(g(!0),m(E,null,H(e.value.replacedBy,({rule:r,plugin:c},u)=>(g(),m(E,null,[r?(g(),b(C(le),{key:r.name,class:M(i(r.url)),href:r.url,target:"_blank"},{default:F(()=>[w(O(r.name??r.url),1)]),_:2},1032,["class","href"])):A("",!0),c?(g(),m(E,{key:1},[o[1]||(o[1]=w(" in ",-1)),(g(),b(C(le),{key:c.name,class:M(i(c.url)),href:c.url,target:"_blank"},{default:F(()=>[w(O(c.name??c.url),1)]),_:2},1032,["class","href"]))],64)):A("",!0),w(O(u===e.value.replacedBy.length-1?".":u===0?"":", "),1)],64))),256))])):A("",!0),x("p",ps,[x("a",{"text-rose-700":"",underline:"","dark:text-rose-300":"",target:"_blank",href:e.value.url},"Learn more",8,ms)])])):A("",!0)]),default:F(()=>[x("div",as,O(t.invalid?"INVALID":"DEPRECATED"),1)]),_:1},8,["disabled"]))}});function Ye(t){const e=`${t}`;return e.endsWith("1")&&t!==11?`${e}st`:e.endsWith("2")&&t!==12?`${e}nd`:e.endsWith("3")&&t!==13?`${e}rd`:`${t}th`}function Te(t){return vs(t).replace(/\[\s*'--',\s*(\S.+),\s*'--'\s*\],?/g,"$1, // [!code muted]")}function vs(t){return JSON.stringify(t,null,2).replace(/"(\w+)":/g,"$1:").replace(/"/g,"'")}const ys=["title"],Ae=j({__name:"RuleLevelIcon",props:{level:{},hasOptions:{type:Boolean},hasRedundantOptions:{type:Boolean},configIndex:{},class:{}},setup(t){const e=t,s=B(()=>e.configIndex==null?`Enabled as '${e.level}'`:`Enabled as '${e.level}', in the ${Ye(e.configIndex+1)} config item`),i=B(()=>({error:"text-red op80",warn:"text-yellow5 op80 dark:text-yellow4",off:"text-gray op50"})[e.level]),n=B(()=>({error:"i-ph-warning-circle-duotone",warn:"i-ph-warning-duotone",off:"i-ph-circle-half-tilt-duotone"})[e.level]);return(o,a)=>(g(),m("div",{relative:"",class:M([i.value,e.class]),title:s.value},[x("div",{class:M(n.value)},null,2),t.hasOptions?(g(),m("div",{key:0,absolute:"","right--2px":"","top--2px":"","h-6px":"","w-6px":"","rounded-full":"","bg-current":"",op75:"",class:M(t.hasRedundantOptions?"text-blue5":"")},null,2)):A("",!0)],10,ys))}}),xs=/(\s+\/\/)/,As=/(?:\/\/|["'#]|;{1,2}|%{1,2}|--)(\s*)$/,ks=[[/^(<!--)(.+)(-->)$/,!1],[/^(\/\*)(.+)(\*\/)$/,!1],[/^(\/\/|["'#]|;{1,2}|%{1,2}|--)(.*)$/,!0],[/^(\*)(.+)$/,!0]];function Cs(t,e,s){const i=[];for(const n of t){if(s==="v3"){const r=n.children.flatMap((c,u)=>{if(c.type!=="element")return c;const l=c.children[0];if(l.type!=="text")return c;const h=u===n.children.length-1;if(!ue(l.value,h))return c;const f=l.value.split(xs);if(f.length<=1)return c;let d=[f[0]];for(let v=1;v<f.length;v+=2)d.push(f[v]+(f[v+1]||""));return d=d.filter(Boolean),d.length<=1?c:d.map(v=>({...c,children:[{type:"text",value:v}]}))});r.length!==n.children.length&&(n.children=r)}const o=n.children;let a=o.length-1;s==="v1"?a=0:e&&(a=o.length-2);for(let r=Math.max(a,0);r<o.length;r++){const c=o[r];if(c.type!=="element")continue;const u=c.children.at(0);if(u?.type!=="text")continue;const l=r===o.length-1;let h=ue(u.value,l),f;if(!h&&r>0&&u.value.trim().startsWith("[!code")){const d=o[r-1];if(d?.type==="element"){const v=d.children.at(0);if(v?.type==="text"&&v.value.includes("//")){const y=ue(v.value+u.value,l);if(y){h=y,i.push({info:y,line:n,token:d,isLineCommentOnly:o.length===2&&d.children.length===1&&c.children.length===1,isJsxStyle:!1,additionalTokens:[c]});continue}}}}if(h)if(e&&!l&&r!==0){const d=Ne(o[r-1],"{")&&Ne(o[r+1],"}");i.push({info:h,line:n,token:c,isLineCommentOnly:o.length===3&&c.children.length===1,isJsxStyle:d,additionalTokens:f})}else i.push({info:h,line:n,token:c,isLineCommentOnly:o.length===1&&c.children.length===1,isJsxStyle:!1,additionalTokens:f})}}return i}function Ne(t,e){if(t.type!=="element")return!1;const s=t.children[0];return s.type!=="text"?!1:s.value.trim()===e}function ue(t,e){let s=t.trimStart();const i=t.length-s.length;s=s.trimEnd();const n=t.length-s.length-i;for(const[o,a]of ks){if(a&&!e)continue;const r=o.exec(s);if(r)return[" ".repeat(i)+r[1],r[2],r[3]?r[3]+" ".repeat(n):void 0]}}function Es(t){const e=t.match(As);return e&&e[1].trim().length===0?t.slice(0,e.index):t}function bs(t,e,s,i){return i??="v3",{name:t,code(n){const o=n.children.filter(u=>u.type==="element"),a=[];n.data??={};const r=n.data;r._shiki_notation??=Cs(o,["jsx","tsx"].includes(this.options.lang),i);const c=r._shiki_notation;for(const u of c){if(u.info[1].length===0)continue;let l=o.indexOf(u.line);u.isLineCommentOnly&&i!=="v1"&&l++;let h=!1;if(u.info[1]=u.info[1].replace(e,(...d)=>s.call(this,d,u.line,u.token,o,l)?(h=!0,""):d[0]),!h)continue;i==="v1"&&(u.info[1]=Es(u.info[1]));const f=u.info[1].trim().length===0;if(f&&(u.info[1]=""),f&&u.isLineCommentOnly)a.push(u.line);else if(f&&u.isJsxStyle)u.line.children.splice(u.line.children.indexOf(u.token)-1,3);else if(f){if(u.additionalTokens)for(let d=u.additionalTokens.length-1;d>=0;d--){const v=u.additionalTokens[d],y=u.line.children.indexOf(v);y!==-1&&u.line.children.splice(y,1)}u.line.children.splice(u.line.children.indexOf(u.token),1)}else{const d=u.token.children[0];if(d.type==="text"&&(d.value=u.info.join(""),u.additionalTokens))for(const v of u.additionalTokens){const y=v.children[0];y?.type==="text"&&(y.value="")}}}for(const u of a){const l=n.children.indexOf(u),h=n.children[l+1];let f=1;h?.type==="text"&&h?.value===`
`&&(f=2),n.children.splice(l,f)}}}}const Ms=/[.*+?^${}()|[\]\\]/g;function Is(t){return t.replace(Ms,"\\$&")}function Ds(t={},e="@shikijs/transformers:notation-map"){const{classMap:s={},classActivePre:i=void 0,classActiveCode:n=void 0}=t;return bs(e,new RegExp(`#?\\s*\\[!code (${Object.keys(s).map(Is).join("|")})(:\\d+)?\\]`,"gi"),function([o,a,r=":1"],c,u,l,h){const f=Number.parseInt(r.slice(1),10);for(let d=h;d<Math.min(h+f,l.length);d++)this.addClassToHast(l[d],s[a]);return i&&this.addClassToHast(this.pre,i),n&&this.addClassToHast(this.code,n),!0},t.matchAlgorithm)}const je=j({name:"Shiki",props:{code:{type:String,required:!0},lang:{type:String,required:!0}},setup(t){const e=B(()=>Se.value?Se.value.codeToHtml(t.code,{lang:t.lang,theme:it.value?"vitesse-dark":"vitesse-light",transformers:[{pre(s){s.properties.style=""}},Ds({classMap:{muted:"muted"}},"@shikijs/transformers:notation-muted")]}):nt(t.code));return()=>ae("div",{class:"filter-hue-rotate-90",innerHTML:e.value})}});let ke;function Pe(t){return ke=!0,["--",t,"--"]}function Ce(t,e){if(e===void 0||typeof t!=typeof e)return t;if(t===e)return Pe(t);if(typeof t=="object"&&t!==null&&e!==null){if(Array.isArray(t)&&Array.isArray(e)&&t.length===e.length)return t.length===0?Pe(t):t.map((s,i)=>Ce(s,e[i]));if(!Array.isArray(t)&&!Array.isArray(e))return Object.keys(t).reduce((i,n)=>(i[n]=Ce(t[n],e[n]),i),{})}return t}function Xe(t,e){return ke=!1,{options:t.map((i,n)=>Ce(i,n<e.length?e[n]:void 0)),hasRedundantOptions:ke}}const Ss={"min-w-100":"",p4:"",flex:"~ col gap-2"},ws={flex:"~ gap-1 items-center"},Fs={key:0,ml1:"","color-muted":""},Bs={key:1,ml1:"","color-muted":""},_s={key:3,"color-muted":""},$s={key:0,flex:"~ gap-2"},Os={flex:"~ col gap-2"},Ls={flex:"~ gap-2 items-center wrap"},Rs={"items-center":"","justify-between":"","md:flex":""},Ts={flex:"~ gap-1","color-muted":""},Ns={key:2,"color-muted":""},Ze=j({__name:"RuleStateItem",props:{state:{},isLocal:{type:Boolean}},setup(t){const e=t,s={error:"text-rose-700 dark:text-rose-300",warn:"text-warning-700 dark:text-warning-300",off:"color-muted"},i=B(()=>he.value.configs[e.state.configIndex]),n=B(()=>ze(e.state.name)),o=B(()=>Xe(e.state.options??[],n.value)),a=B(()=>!e.state.options?.length&&n.value?.length?"default":"state"),r=rt({viewType:a.value}),c=ot();function u(){ct.rule=e.state.name,c.push("/configs")}return(l,h)=>(g(),m("div",Ss,[x("div",ws,[U(Ae,{level:t.state.level,"config-index":t.state.configIndex},null,8,["level","config-index"]),t.state.level==="off"?(g(),m("span",Fs,"Turned ")):(g(),m("span",Bs,"Set to ")),x("span",{"font-mono":"",class:M(s[t.state.level])},O(t.state.level),3),t.isLocal?(g(),m("div",_s," in this config ")):(g(),m(E,{key:2},[h[5]||(h[5]=x("span",{"color-muted":""},"in",-1)),x("button",{hover:"!color-base","color-muted":"",onClick:h[0]||(h[0]=f=>u())},[i.value.name?(g(),b(C(gt),{key:0,name:i.value.name,px2:"","font-mono":"",border:"~ base rounded"},null,8,["name"])):A("",!0),h[3]||(h[3]=x("span",{"color-muted":""}," the ",-1)),w(" "+O(C(Ye)(t.state.configIndex+1))+" ",1),h[4]||(h[4]=x("span",{"color-muted":""}," config item ",-1))])],64))]),t.isLocal?A("",!0):(g(),m("div",$s,[i.value.files?(g(),m(E,{key:0},[h[7]||(h[7]=x("div",{"i-ph-file-magnifying-glass-duotone":"",my1:"","flex-none":"",op75:""},null,-1)),x("div",Os,[h[6]||(h[6]=x("div",{"color-muted":""}," Applies to files matching ",-1)),x("div",Ls,[(g(!0),m(E,null,H(i.value.files,(f,d)=>(g(),b(pt,{key:d,glob:f},null,8,["glob"]))),128))])])],64)):i.value.rules?(g(),m(E,{key:1},[h[8]||(h[8]=x("div",{"i-ph-files-duotone":"",my1:"","flex-none":"",op75:""},null,-1)),h[9]||(h[9]=x("div",{"color-muted":""}," Applied generally for all files ",-1))],64)):A("",!0)])),t.state.options?.length||n.value?.length?(g(),m(E,{key:1},[x("div",Rs,[x("div",Ts,[t.state.options?.length?(g(),m("button",{key:0,"btn-action":"",class:M({"btn-action-active":r.viewType==="state"}),onClick:h[1]||(h[1]=f=>r.viewType="state")},[...h[10]||(h[10]=[x("div",{"i-ph-sliders-duotone":"",my1:"","flex-none":"",op75:""},null,-1),w(" Rule options ",-1)])],2)):A("",!0),n.value?.length?(g(),m("button",{key:1,"btn-action":"",class:M({"btn-action-active":r.viewType==="default"}),onClick:h[2]||(h[2]=f=>r.viewType="default")},[...h[11]||(h[11]=[x("div",{"i-ph-faders-duotone":"",my1:"","flex-none":"",op75:""},null,-1),w(" Option defaults ",-1)])],2)):A("",!0)])]),r.viewType==="state"?(g(!0),m(E,{key:0},H(o.value.options,(f,d)=>(g(),b(C(je),{key:d,lang:"ts",code:C(Te)(f),rounded:"","bg-code":"",p2:"","text-sm":""},null,8,["code"]))),128)):A("",!0),r.viewType==="default"?(g(!0),m(E,{key:1},H(n.value,(f,d)=>(g(),b(C(je),{key:d,lang:"ts",code:C(Te)(f),rounded:"","bg-code":"",p2:"","text-sm":""},null,8,["code"]))),128)):A("",!0)],64)):A("",!0),r.viewType==="state"&&o.value.hasRedundantOptions?(g(),m("div",Ns,[...h[12]||(h[12]=[w(" Options ",-1),x("span",{italic:"",op75:""},"italicized",-1),w(" match the default for the rule ",-1)])])):A("",!0)]))}}),js={key:0,"max-h":"50vh"},Ps={flex:"~ items-center gap-2",p3:""},zs={key:2,grid:"~ cols-2 items-center gap1",mx2:""},Vs={key:0,"i-ph-check-square-duotone":"",op50:""},Ws={key:1},Hs={key:2,"i-ph-wrench-duotone":"",op50:""},Ks={key:3},Js={key:3,flex:"","flex-auto":"","flex-col":"","items-start":"","justify-end":""},Us={flex:"~ gap-2",mt1:""},Gs={key:1,"i-ph-check-square-duotone":"",op50:""},Qs={key:2,"i-ph-wrench-duotone":"",op50:""},Ys=j({__name:"RuleItem",props:{rule:{},ruleStates:{},value:{},class:{},gridView:{type:Boolean}},emits:["badgeClick","stateClick"],setup(t,{emit:e}){const s=t,i=e;function n(r){const{hasRedundantOptions:c}=Xe(r??[],ze(s.rule.name));return c}const{copy:o}=ut();function a(r){return r&&r[0].toUpperCase()+r.slice(1)}return(r,c)=>{const u=lt("VDropdown");return g(),m(E,null,[t.ruleStates?(g(),m("div",{key:0,flex:"~ items-center gap-0.5 justify-end","text-lg":"",class:M(t.gridView?"absolute top-2 right-2 flex-col":"")},[(g(!0),m(E,null,H(t.ruleStates,(l,h)=>(g(),b(u,{key:h},{popper:F(({shown:f})=>[f?(g(),b(Ze,{key:0,state:l},null,8,["state"])):A("",!0)]),default:F(()=>[U(Ae,{level:l.level,"config-index":l.configIndex,"has-options":!!l.options?.length,"has-redundant-options":n(l.options)},null,8,["level","config-index","has-options","has-redundant-options"])]),_:2},1024))),128))],2)):A("",!0),t.value!=null?(g(),m("div",{key:1,class:M([s.class,t.gridView?"absolute top-2 right-2 flex-col":""])},[U(Ae,{level:C(at)(t.value),"has-options":!!C(we)(t.value)?.length,"has-redundant-options":n(C(we)(t.value))},null,8,["level","has-options","has-redundant-options"])],2)):A("",!0),x("div",{class:M(s.class)},[U(u,{"inline-block":""},{popper:F(({shown:l})=>[l?(g(),m("div",js,[x("div",Ps,[t.rule.invalid?A("",!0):(g(),b(C(le),{key:0,"btn-action-sm":"",to:t.rule.docs?.url,target:"_blank",rel:"noopener noreferrer",title:"Docs"},{default:F(()=>[...c[2]||(c[2]=[x("div",{"i-ph-book-duotone":""},null,-1),w(" Docs ",-1)])]),_:1},8,["to"])),x("button",{"btn-action-sm":"",title:"Copy",onClick:c[1]||(c[1]=h=>C(o)(t.rule.name))},[...c[3]||(c[3]=[x("div",{"i-ph-copy-duotone":""},null,-1),w(" Copy name ",-1)])]),se(r.$slots,"popup-actions")]),se(r.$slots,"popup")])):A("",!0)]),default:F(()=>[U(ls,{name:t.rule.name,prefix:t.rule.plugin,deprecated:t.rule.deprecated,borderless:t.gridView,break:t.gridView,"text-start":"",as:"button",onClick:c[0]||(c[0]=l=>i("badgeClick",l))},null,8,["name","prefix","deprecated","borderless","break"])]),_:3})],2),t.gridView?A("",!0):(g(),m("div",zs,[t.rule.docs?.recommended?Z((g(),m("div",Vs,null,512)),[[C(q),"✅ Recommended"]]):(g(),m("div",Ws)),t.rule.fixable?Z((g(),m("div",Hs,null,512)),[[C(q),"🔧 Fixable"]]):(g(),m("div",Ks))])),x("div",{class:M(s.class),flex:"~ gap-2 items-center","of-hidden":""},[x("div",{class:M([t.rule.deprecated?"line-through":"",t.rule.invalid?"text-red-700 dark:text-red-300":"",t.gridView?"color-muted text-sm":"color-muted ws-nowrap of-hidden text-ellipsis line-clamp-1"])},O(t.rule.invalid?"Invalid rule has no description":a(t.rule.docs?.description)),3),!t.gridView&&(t.rule.invalid||t.rule.deprecated)?(g(),b(Re,{key:0,deprecated:t.rule.deprecated,invalid:t.rule.invalid},null,8,["deprecated","invalid"])):A("",!0)],2),t.gridView&&(t.rule.invalid||t.rule.deprecated||t.rule.fixable||t.rule.docs?.recommended)?(g(),m("div",Js,[x("div",Us,[t.rule.invalid||t.rule.deprecated?(g(),b(Re,{key:0,deprecated:t.rule.deprecated,invalid:t.rule.invalid},null,8,["deprecated","invalid"])):A("",!0),t.rule.docs?.recommended?Z((g(),m("div",Gs,null,512)),[[C(q),"✅ Recommended"]]):A("",!0),t.rule.fixable?Z((g(),m("div",Qs,null,512)),[[C(q),"🔧 Fixable"]]):A("",!0)])])):A("",!0)],64)}}}),en=j({__name:"RuleList",props:{rules:{},getBind:{type:Function},filter:{type:Function}},setup(t){const e=t,s=B(()=>Array.isArray(e.rules)?e.rules.map(r=>r.name):Object.keys(e.rules));function i(r){return Array.isArray(e.rules)?e.rules.find(c=>c.name===r):dt(r)}function n(r){return Array.isArray(e.rules)?void 0:e.rules[r]}const o=B(()=>ce.value?"grid grid-cols-[repeat(auto-fill,minmax(min(100%,350px),1fr))] gap-2":(Array.isArray(e.rules),"grid grid-cols-[max-content_max-content_max-content_1fr] gap-x-2 gap-y-2 items-center")),a=j({setup(r,{slots:c}){return()=>ce.value?ae("div",{class:"relative border border-base max-w-full rounded-lg p4 py3 flex flex-col gap-2 of-hidden justify-start","data-testid":"rule-item"},c.default?.()):ae("div",{class:"contents","data-testid":"rule-item"},c.default?.())}});return(r,c)=>(g(),m("div",{class:M(o.value)},[(g(!0),m(E,null,H(s.value,u=>(g(),m(E,{key:u},[e.filter?.(u)!==!1?(g(),b(C(a),{key:0},{default:F(()=>[U(Ys,ht({rule:i(u),"rule-states":Array.isArray(t.rules)?C(he).ruleToState.get(u)||[]:void 0,"grid-view":C(ce),value:n(u)},{ref_for:!0},t.getBind?.(u)),{popup:F(()=>[se(r.$slots,"popup",{ruleName:u,value:n(u)},()=>[(g(!0),m(E,null,H(C(he).ruleToState.get(u)||[],(l,h)=>(g(),b(Ze,{key:h,border:"t base",state:l},null,8,["state"]))),128))])]),"popup-actions":F(()=>[se(r.$slots,"popup-actions",{ruleName:u})]),_:2},1040,["rule","rule-states","grid-view","value"])]),_:2},1024)):A("",!0)],64))),128))],2))}});export{K as F,je as S,Ze as _,en as a,ls as b,Ae as c,vs as s};