@teacss/language-server 0.6.3 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server.js +2 -2
- package/package.json +9 -9
package/dist/server.js
CHANGED
|
@@ -25,8 +25,8 @@ import{a as e,i as t,n,o as r,r as i,t as a}from"./semanticTokens-Cniz5X9a.js";i
|
|
|
25
25
|
;for(let e=`̀`.codePointAt(0);e<=`ͯ`.codePointAt(0);++e){let t=String.fromCodePoint(e);for(let e of`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`){let n=(e+t).normalize().codePointAt(0);n>126&&(Wi[n]=e)}}const Gi={a:[7844,7863],e:[7870,7879],o:[7888,7907],u:[7912,7921]};for(let e of Object.keys(Gi)){let t=e.toUpperCase();for(let n=Gi[e][0];n<=Gi[e][1];++n)Wi[n]=n%2==0?t:e}function Ki(e){if(e<192||e>8580)return e;let t=Wi[e];return t===void 0?e:t.codePointAt(0)}function qi(e){return e}function Ji(e){return e}function Yi(e,t){return e>t?e:t}const Xi=e=>e.split(``).map(e=>e.codePointAt(0)),Zi=new Set(` \f
|
|
26
26
|
\r \v\xA0 \u2028\u2029 `.split(``).map(e=>e.codePointAt(0)));for(let e=` `.codePointAt(0);e<=` `.codePointAt(0);e++)Zi.add(e);const Qi=``.codePointAt(0),$i=`A`.codePointAt(0),ea=`Z`.codePointAt(0),ta=`a`.codePointAt(0),na=`z`.codePointAt(0),ra=`0`.codePointAt(0),ia=`9`.codePointAt(0);function aa(e,t,n){return n?e:t-e-1}function oa(e){return e?new Set:null}function sa(e,t,n){if(t!==null&&t.i16.length>e+n){let r=t.i16.subarray(e,e+n);return[e+n,r]}return[e,new Int16Array(n)]}function ca(e,t,n){if(t!==null&&t.i32.length>e+n){let r=t.i32.subarray(e,e+n);return[e+n,r]}return[e,new Int32Array(n)]}function la(e){return e>=ta&&e<=na?1:e>=$i&&e<=ea?2:e>=ra&&e<=ia?4:0}function ua(e){let t=String.fromCodePoint(e);return t===t.toUpperCase()?t===t.toLowerCase()?t.match(/\p{Number}/gu)===null?t.match(/\p{Letter}/gu)===null?0:3:4:2:1}function da(e){return e<=Qi?la(e):ua(e)}function fa(e,t){return e===0&&t!==0?8:e===1&&t===2||e!==4&&t===4?7:t===0?8:0}function pa(e,t){return t===0?8:fa(da(e[t-1]),da(e[t]))}function ma(e,t,n,r){let i=e.slice(r),a=i.indexOf(n);if(a===0)return r;if(!t&&n>=ta&&n<=na){a>0&&(i=i.slice(0,a));let e=i.indexOf(n-32);e>=0&&(a=e)}return a<0?-1:r+a}function ha(e){for(let t of e)if(t>=128)return!1;return!0}function ga(e,t,n){if(!ha(e))return 0;if(!ha(t))return-1;let r=0,i=0;for(let a=0;a<t.length;a++){if(i=ma(e,n,t[a],i),i<0)return-1;a===0&&i>0&&(r=i-1),i++}return r}const _a=(e,t,n,r,i,a,o)=>{let s=i.length;if(s===0)return[{start:0,end:0,score:0},oa(a)];let c=r.length;if(o!==null&&c*s>o.i16.length)return ya(e,t,n,r,i,a);let l=ga(r,i,e);if(l<0)return[{start:-1,end:-1,score:0},null];let u=0,d=0,f=null,p=null,m=null,h=null;[u,f]=sa(u,o,c),[u,p]=sa(u,o,c),[u,m]=sa(u,o,c),[d,h]=ca(d,o,s);let[,g]=ca(d,o,c);for(let e=0;e<g.length;e++)g[e]=r[e];let _=qi(0),v=0,y=0,b=0,x=i[0],S=i[0],C=qi(0),w=0,T=!1,E=g.subarray(l),D=f.subarray(l).subarray(0,E.length),O=p.subarray(l).subarray(0,E.length),k=m.subarray(l).subarray(0,E.length);for(let[r,a]of E.entries()){let o=null;a<=Qi?(o=la(a),!e&&o===2&&(a+=32)):(o=ua(a),!e&&o===2&&(a=String.fromCodePoint(a).toLowerCase().codePointAt(0)),t&&(a=Ki(a))),E[r]=a;let c=fa(w,o);if(k[r]=c,w=o,a===S&&(y<s&&(h[y]=Ji(l+r),y++,S=i[Math.min(y,s-1)]),b=l+r),a===x){let e=16+c*2;if(D[r]=e,O[r]=1,s===1&&(n&&e>_||!n&&e>=_)&&(_=e,v=l+r,n&&c===8))break;T=!1}else D[r]=Yi(T?C+-1:C+-3,0),O[r]=0,T=!0;C=D[r]}if(y!==s)return[{start:-1,end:-1,score:0},null];if(s===1){let e={start:v,end:v+1,score:_};if(!a)return[e,null];let t=new Set;return t.add(v),[e,t]}let A=h[0],ee=b-A+1,j=null;[u,j]=sa(u,o,ee*s);{let e=f.subarray(A,b+1);for(let[t,n]of e.entries())j[t]=n}let[,M]=sa(u,o,ee*s);{let e=p.subarray(A,b+1);for(let[t,n]of e.entries())M[t]=n}let N=h.subarray(1),P=i.slice(1).slice(0,N.length);for(let[e,t]of N.entries()){let r=!1,i=P[e],a=e+1,o=a*ee,c=g.subarray(t,b+1),l=m.subarray(t).subarray(0,c.length),u=M.subarray(o+t-A).subarray(0,c.length),d=M.subarray(o+t-A-1-ee).subarray(0,c.length),f=j.subarray(o+t-A).subarray(0,c.length),p=j.subarray(o+t-A-1-ee).subarray(0,c.length),h=j.subarray(o+t-A-1).subarray(0,c.length);h[0]=0;for(let[e,o]of c.entries()){let c=e+t,g=0,y=0,b=0;if(y=r?h[e]+-1:h[e]+-3,i===o){g=p[e]+16;let t=l[e];b=d[e]+1,t===8?b=1:b>1&&(t=Yi(t,Yi(4,m[c-b+1]))),g+t<y?(g+=l[e],b=0):g+=t}u[e]=b,r=g<y;let x=Yi(Yi(g,y),0);a===s-1&&(n&&x>_||!n&&x>=_)&&(_=x,v=c),f[e]=x}}let F=oa(a),I=A;if(a&&F!==null){let e=s-1;I=v;let t=!0;for(;;){let n=e*ee,r=I-A,i=j[n+r],a=0,o=0;if(e>0&&I>=h[e]&&(a=j[n-ee+r-1]),I>h[e]&&(o=j[n+r-1]),i>a&&(i>o||i===o&&t)){if(F.add(I),e===0)break;e--}t=M[n+r]>1||n+ee+r+1<M.length&&M[n+ee+r+1]>0,I--}}return[{start:I,end:v+1,score:_},F]};function va(e,t,n,r,i,a,o){let s=0,c=0,l=!1,u=0,d=qi(0),f=oa(o),p=0;i>0&&(p=da(n[i-1]));for(let m=i;m<a;m++){let i=n[m],a=da(i);if(e||(i>=$i&&i<=ea?i+=32:i>Qi&&(i=String.fromCodePoint(i).toLowerCase().codePointAt(0))),t&&(i=Ki(i)),i===r[s]){o&&f!==null&&f.add(m),c+=16;let e=fa(p,a);u===0?d=e:(e===8&&(d=e),e=Yi(Yi(e,d),4)),c+=s===0?e*2:e,l=!1,u++,s++}else c+=l?-1:-3,l=!0,u=0,d=0;p=a}return[c,f]}const ya=(e,t,n,r,i,a,o)=>{if(i.length===0)return[{start:0,end:0,score:0},null];if(ga(r,i,e)<0)return[{start:-1,end:-1,score:0},null];let s=0,c=-1,l=-1,u=r.length,d=i.length;for(let a=0;a<u;a++){let o=r[aa(a,u,n)];e||(o>=$i&&o<=ea?o+=32:o>Qi&&(o=String.fromCodePoint(o).toLowerCase().codePointAt(0))),t&&(o=Ki(o));let f=i[aa(s,d,n)];if(o===f&&(c<0&&(c=a),s++,s===d)){l=a+1;break}}if(c>=0&&l>=0){s--;for(let t=l-1;t>=c;t--){let a=r[aa(t,u,n)];e||(a>=$i&&a<=ea?a+=32:a>Qi&&(a=String.fromCodePoint(a).toLowerCase().codePointAt(0)));let o=i[aa(s,d,n)];if(a===o&&(s--,s<0)){c=t;break}}if(!n){let e=c;c=u-l,l=u-e}let[o,f]=va(e,t,r,i,c,l,a);return[{start:c,end:l,score:o},f]}return[{start:-1,end:-1,score:0},null]},ba=(e,t,n,r,i,a,o)=>{if(i.length===0)return[{start:0,end:0,score:0},null];let s=r.length,c=i.length;if(s<c||ga(r,i,e)<0)return[{start:-1,end:-1,score:0},null];let l=0,u=-1,d=qi(0),f=qi(-1);for(let a=0;a<s;a++){let o=aa(a,s,n),p=r[o];e||(p>=$i&&p<=ea?p+=32:p>Qi&&(p=String.fromCodePoint(p).toLowerCase().codePointAt(0))),t&&(p=Ki(p));let m=aa(l,c,n);if(i[m]===p){if(m===0&&(d=pa(r,o)),l++,l===c){if(d>f&&(u=a,f=d),d===8)break;a-=l-1,l=0,d=0}}else a-=l,l=0,d=0}if(u>=0){let a=0,o=0;n?(a=u-c+1,o=u+1):(a=s-(u+1),o=s-(u-c+1));let[l]=va(e,t,r,i,a,o,!1);return[{start:a,end:o,score:l},null]}return[{start:-1,end:-1,score:0},null]};function xa(e,t){return{i16:new Int16Array(e),i32:new Int32Array(t)}}const Sa=xa(102400,2048),Ca=(e,t,n)=>{let r=!1;switch(t){case`smart-case`:e.toLowerCase()!==e&&(r=!0);break;case`case-sensitive`:r=!0;break;case`case-insensitive`:e=e.toLowerCase(),r=!1}let i=Xi(e);return n&&(i=i.map(Ki)),{queryRunes:i,caseSensitive:r}};function wa(e,t){let n=Object.keys(e).map(e=>parseInt(e,10)).sort((e,t)=>t-e),r=[];for(let i of n)if(r=r.concat(e[i]),r.length>=t)break;return r}function Ta(e,t,n){return r=>{let i=this.runesList[r];if(t.length>i.length)return;let[a,o]=this.algoFn(n,this.opts.normalize,this.opts.forward,i,t,!0,Sa);if(a.start===-1)return;if(this.opts.fuzzy===!1){o=new Set;for(let e=a.start;e<a.end;++e)o.add(e)}let s=this.opts.sort?a.score:0;e[s]===void 0&&(e[s]=[]),e[s].push({item:this.items[r],...a,positions:o??new Set})}}function Ea(e){let{queryRunes:t,caseSensitive:n}=Ca(e,this.opts.casing,this.opts.normalize),r={},i=Ta.bind(this)(r,t,n);for(let e=0,t=this.runesList.length;e<t;++e)i(e);return wa(r,this.opts.limit)}const Da={limit:1/0,selector:e=>e,casing:`smart-case`,normalize:!0,fuzzy:`v2`,tiebreakers:[],sort:!0,forward:!0};var Oa=class{constructor(e,...t){switch(this.opts={...Da,...t[0]},this.items=e,this.runesList=e.map(e=>Xi(this.opts.selector(e).normalize())),this.algoFn=ba,this.opts.fuzzy){case`v2`:this.algoFn=_a;break;case`v1`:this.algoFn=ya}}};const ka={...Da,match:Ea};var Aa=class extends Oa{constructor(e,...t){super(e,...t),this.opts={...ka,...t[0]}}find(e){return e.length===0||this.items.length===0?this.items.slice(0,this.opts.limit).map(ja):(e=e.normalize(),Ma(this.opts.match.bind(this)(e),this.opts))}};({...Da});const ja=e=>({item:e,start:-1,end:-1,score:0,positions:new Set});function Ma(e,t){if(t.sort){let{selector:n}=t;e.sort((e,r)=>{if(e.score===r.score)for(let i of t.tiebreakers){let t=i(e,r,n);if(t!==0)return t}return 0})}return Number.isFinite(t.limit)&&e.splice(t.limit),e}function Na(e,t,n){return n(e.item).length-n(t.item).length}function Pa(e,t){return e.start-t.start}var Fa=class{constructor(e,...t){this.finder=new Aa(e,...t),this.find=this.finder.find.bind(this.finder)}},X=l(`lru-cache:metrics`),Ia=u(`lru-cache`),La=typeof performance==`object`&&performance&&typeof performance.now==`function`?performance:Date,Ra=()=>X.hasSubscribers||Ia.hasSubscribers,za=new Set,Ba=typeof process==`object`&&process?process:{},Va=(e,t,n,r)=>{typeof Ba.emitWarning==`function`?Ba.emitWarning(e,t,n,r):console.error(`[${n}] ${t}: ${e}`)},Ha=e=>!za.has(e),Ua=e=>!!e&&e===Math.floor(e)&&e>0&&isFinite(e),Wa=e=>Ua(e)?e<=256?Uint8Array:e<=2**16?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?Ga:null:null,Ga=class extends Array{constructor(e){super(e),this.fill(0)}},Ka=class e{heap;length;static#e=!1;static create(t){let n=Wa(t);if(!n)return[];e.#e=!0;let r=new e(t,n);return e.#e=!1,r}constructor(t,n){if(!e.#e)throw TypeError(`instantiate Stack using Stack.create(n)`);this.heap=new n(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},qa=class e{#e;#t;#n;#r;#i;#a;#o;#s;get perf(){return this.#s}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;#C;#w;#T;#E;static unsafeExposeInternals(e){return{starts:e.#b,ttls:e.#x,autopurgeTimers:e.#S,sizes:e.#y,keyMap:e.#u,keyList:e.#d,valList:e.#f,next:e.#p,prev:e.#m,get head(){return e.#h},get tail(){return e.#g},free:e.#_,isBackgroundFetch:t=>e.#W(t),backgroundFetch:(t,n,r,i)=>e.#U(t,n,r,i),moveToTail:t=>e.#X(t),indexes:t=>e.#I(t),rindexes:t=>e.#L(t),isStale:t=>e.#j(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#l}get size(){return this.#c}get fetchMethod(){return this.#a}get memoMethod(){return this.#o}get dispose(){return this.#n}get onInsert(){return this.#r}get disposeAfter(){return this.#i}constructor(t){let{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:a,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:c,dispose:l,onInsert:u,disposeAfter:d,noDisposeOnSet:f,noUpdateTTL:p,maxSize:m=0,maxEntrySize:h=0,sizeCalculation:g,fetchMethod:_,memoMethod:v,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:S,ignoreFetchAbort:C,backgroundFetchSize:w=1,perf:T}=t;if(this.backgroundFetchSize=w,T!==void 0&&typeof T?.now!=`function`)throw TypeError(`perf option must have a now() method if specified`);if(this.#s=T??La,n!==0&&!Ua(n))throw TypeError(`max option must be a nonnegative integer`);let E=n?Wa(n):Array;if(!E)throw Error(`invalid max value: `+n);if(this.#e=n,this.#t=m,this.maxEntrySize=h||this.#t,this.sizeCalculation=g,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError(`cannot set sizeCalculation without setting maxSize or maxEntrySize`);if(typeof this.sizeCalculation!=`function`)throw TypeError(`sizeCalculation set to non-function`)}if(v!==void 0&&typeof v!=`function`)throw TypeError(`memoMethod must be a function if defined`);if(this.#o=v,_!==void 0&&typeof _!=`function`)throw TypeError(`fetchMethod must be a function if specified`);if(this.#a=_,this.#w=!!_,this.#u=new Map,this.#d=Array.from({length:n}).fill(void 0),this.#f=Array.from({length:n}).fill(void 0),this.#p=new E(n),this.#m=new E(n),this.#h=0,this.#g=0,this.#_=Ka.create(n),this.#c=0,this.#l=0,typeof l==`function`&&(this.#n=l),typeof u==`function`&&(this.#r=u),typeof d==`function`?(this.#i=d,this.#v=[]):(this.#i=void 0,this.#v=void 0),this.#C=!!this.#n,this.#E=!!this.#r,this.#T=!!this.#i,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!x,this.allowStaleOnFetchAbort=!!S,this.ignoreFetchAbort=!!C,this.maxEntrySize!==0){if(this.#t!==0&&!Ua(this.#t))throw TypeError(`maxSize must be a positive integer if specified`);if(!Ua(this.maxEntrySize))throw TypeError(`maxEntrySize must be a positive integer if specified`);this.#M()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=Ua(i)||i===0?i:1,this.ttlAutopurge=!!a,this.ttl=r||0,this.ttl){if(!Ua(this.ttl))throw TypeError(`ttl must be a positive integer if specified`);this.#D()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw TypeError(`At least one of max, maxSize, or ttl is required`);if(!this.ttlAutopurge&&!this.#e&&!this.#t){let t=`LRU_CACHE_UNBOUNDED`;Ha(t)&&(za.add(t),Va(`TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.`,`UnboundedCacheWarning`,t,e))}}getRemainingTTL(e){return this.#u.has(e)?1/0:0}#D(){let e=new Ga(this.#e),t=new Ga(this.#e);this.#x=e,this.#b=t;let n=this.ttlAutopurge?Array.from({length:this.#e}):void 0;this.#S=n,this.#A=(n,i,a=this.#s.now())=>{t[n]=i===0?0:a,e[n]=i,r(n,i)},this.#O=n=>{t[n]=e[n]===0?0:this.#s.now(),r(n,e[n])};let r=this.ttlAutopurge?(e,t)=>{if(n?.[e]&&(clearTimeout(n[e]),n[e]=void 0),t&&t!==0&&n){let i=setTimeout(()=>{this.#j(e)?(this.#Z(this.#d[e],`expire`),n[e]=void 0):r(e,o(e))},t+1);i.unref&&i.unref(),n[e]=i}}:()=>{};this.#k=(n,r)=>{if(e[r]){let o=e[r],s=t[r];if(!o||!s)return;n.ttl=o,n.start=s,n.now=i||a(),n.remainingTTL=o-(n.now-s)}};let i=0,a=()=>{let e=this.#s.now();if(this.ttlResolution>0){i=e;let t=setTimeout(()=>i=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=e=>{let t=this.#u.get(e);return t===void 0?0:o(t)};let o=n=>{let r=e[n],o=t[n];return!r||!o?1/0:r-((i||a())-o)};this.#j=n=>{let r=t[n],o=e[n];return!!o&&!!r&&(i||a())-r>o}}#O=()=>{};#k=()=>{};#A=()=>{};#j=()=>!1;#M(){let e=new Ga(this.#e);this.#l=0,this.#y=e,this.#N=t=>{this.#l-=e[t],e[t]=0},this.#F=(e,t,n,r)=>{if(!Ua(n)){if(this.#W(t))return this.backgroundFetchSize;if(r){if(typeof r!=`function`)throw TypeError(`sizeCalculation must be a function`);if(n=r(t,e),!Ua(n))throw TypeError(`sizeCalculation return invalid (expect positive integer)`)}else throw TypeError(`invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.`)}return n},this.#P=(t,n,r)=>{if(e[t]=n,this.#t){let n=this.#t-e[t];for(;this.#l>n;)this.#B(!0)}this.#l+=e[t],r&&(r.entrySize=n,r.totalCalculatedSize=this.#l)}}#N=e=>{};#P=(e,t,n)=>{};#F=(e,t,n,r)=>{if(n||r)throw TypeError(`cannot set size without setting maxSize or maxEntrySize on cache`);return 0};*#I({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#g;this.#R(t)&&((e||!this.#j(t))&&(yield t),t!==this.#h);)t=this.#m[t]}*#L({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#h;this.#R(t)&&((e||!this.#j(t))&&(yield t),t!==this.#g);)t=this.#p[t]}#R(e){return e!==void 0&&this.#u.get(this.#d[e])===e}*entries(){for(let e of this.#I())this.#f[e]!==void 0&&this.#d[e]!==void 0&&!this.#W(this.#f[e])&&(yield[this.#d[e],this.#f[e]])}*rentries(){for(let e of this.#L())this.#f[e]!==void 0&&this.#d[e]!==void 0&&!this.#W(this.#f[e])&&(yield[this.#d[e],this.#f[e]])}*keys(){for(let e of this.#I()){let t=this.#d[e];t!==void 0&&!this.#W(this.#f[e])&&(yield t)}}*rkeys(){for(let e of this.#L()){let t=this.#d[e];t!==void 0&&!this.#W(this.#f[e])&&(yield t)}}*values(){for(let e of this.#I())this.#f[e]!==void 0&&!this.#W(this.#f[e])&&(yield this.#f[e])}*rvalues(){for(let e of this.#L())this.#f[e]!==void 0&&!this.#W(this.#f[e])&&(yield this.#f[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]=`LRUCache`;find(e,t={}){for(let n of this.#I()){let r=this.#f[n],i=this.#W(r)?r.__staleWhileFetching:r;if(i!==void 0&&e(i,this.#d[n],this))return this.#J(this.#d[n],t)}}forEach(e,t=this){for(let n of this.#I()){let r=this.#f[n],i=this.#W(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#d[n],this)}}rforEach(e,t=this){for(let n of this.#L()){let r=this.#f[n],i=this.#W(r)?r.__staleWhileFetching:r;i!==void 0&&e.call(t,i,this.#d[n],this)}}purgeStale(){let e=!1;for(let t of this.#L({allowStale:!0}))this.#j(t)&&(this.#Z(this.#d[t],`expire`),e=!0);return e}info(e){let t=this.#u.get(e);if(t===void 0)return;let n=this.#f[t],r=this.#W(n)?n.__staleWhileFetching:n;if(r===void 0)return;let i={value:r};if(this.#x&&this.#b){let e=this.#x[t],n=this.#b[t];e&&n&&(i.ttl=e-(this.#s.now()-n),i.start=Date.now())}return this.#y&&(i.size=this.#y[t]),i}dump(){let e=[];for(let t of this.#I({allowStale:!0})){let n=this.#d[t],r=this.#f[t],i=this.#W(r)?r.__staleWhileFetching:r;if(i===void 0||n===void 0)continue;let a={value:i};if(this.#x&&this.#b){a.ttl=this.#x[t];let e=this.#s.now()-this.#b[t];a.start=Math.floor(Date.now()-e)}this.#y&&(a.size=this.#y[t]),e.unshift([n,a])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let e=Date.now()-n.start;n.start=this.#s.now()-e}this.#z(t,n.value,n)}}set(e,t,n={}){let{status:r=X.hasSubscribers?{}:void 0}=n;n.status=r,r&&(r.op=`set`,r.key=e,t!==void 0&&(r.value=t),r.cache=this);let i=this.#z(e,t,n);return r&&X.hasSubscribers&&X.publish(r),i}#z(e,t,n,r){let{ttl:i=this.ttl,start:a,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:c}=n,l=this.#W(t);if(t===void 0)return c&&(c.set=`deleted`),this.delete(e),this;let{noUpdateTTL:u=this.noUpdateTTL}=n;c&&!l&&(c.value=t);let d=this.#F(e,t,n.size||0,s,c);if(this.maxEntrySize&&d>this.maxEntrySize)return this.#Z(e,`set`),c&&(c.set=`miss`,c.maxEntrySizeExceeded=!0),this;let f=this.#c===0?void 0:this.#u.get(e);if(f===void 0)f=this.#c===0?this.#g:this.#_.length===0?this.#c===this.#e?this.#B(!1):this.#c:this.#_.pop(),this.#d[f]=e,this.#f[f]=t,this.#u.set(e,f),this.#p[this.#g]=f,this.#m[f]=this.#g,this.#g=f,this.#c++,this.#P(f,d,c),c&&(c.set=`add`),u=!1,this.#E&&!l&&this.#r?.(t,e,`add`);else{this.#X(f);let n=this.#f[f];if(t!==n){if(!o){if(this.#W(n)){n!==r&&n.__abortController.abort(Error(`replaced`));let{__staleWhileFetching:i}=n;i!==void 0&&i!==t&&(this.#C&&this.#n?.(i,e,`set`),this.#T&&this.#v?.push([i,e,`set`]))}else this.#C&&this.#n?.(n,e,`set`),this.#T&&this.#v?.push([n,e,`set`])}if(this.#N(f),this.#P(f,d,c),this.#f[f]=t,!l){let r=n&&this.#W(n)?n.__staleWhileFetching:n,i=r===void 0?`add`:t===r?`update`:`replace`;c&&(c.set=i,r!==void 0&&(c.oldValue=r)),this.#E&&this.onInsert?.(t,e,i)}}else l||(c&&(c.set=`update`),this.#E&&this.onInsert?.(t,e,`update`))}if(i!==0&&!this.#x&&this.#D(),this.#x&&(u||this.#A(f,i,a),c&&this.#k(c,f)),!o&&this.#T&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}return this}pop(){try{for(;this.#c;){let e=this.#f[this.#h];if(this.#B(!0),this.#W(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#T&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}}}#B(e){let t=this.#h,n=this.#d[t],r=this.#f[t],i=this.#W(r);i&&r.__abortController.abort(Error(`evicted`));let a=i?r.__staleWhileFetching:r;return(this.#C||this.#T)&&a!==void 0&&(this.#C&&this.#n?.(a,n,`evict`),this.#T&&this.#v?.push([a,n,`evict`])),this.#N(t),this.#S?.[t]&&(clearTimeout(this.#S[t]),this.#S[t]=void 0),e&&(this.#d[t]=void 0,this.#f[t]=void 0,this.#_.push(t)),this.#c===1?(this.#h=this.#g=0,this.#_.length=0):this.#h=this.#p[t],this.#u.delete(n),this.#c--,t}has(e,t={}){let{status:n=X.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op=`has`,n.key=e,n.cache=this);let r=this.#V(e,t);return X.hasSubscribers&&X.publish(n),r}#V(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=t,i=this.#u.get(e);if(i!==void 0){let e=this.#f[i];if(this.#W(e)&&e.__staleWhileFetching===void 0)return!1;if(this.#j(i))r&&(r.has=`stale`,this.#k(r,i));else return n&&this.#O(i),r&&(r.has=`hit`,this.#k(r,i)),!0}else r&&(r.has=`miss`);return!1}peek(e,t={}){let{status:n=Ra()?{}:void 0}=t;n&&(n.op=`peek`,n.key=e,n.cache=this),t.status=n;let r=this.#H(e,t);return X.hasSubscribers&&X.publish(n),r}#H(e,t){let{status:n,allowStale:r=this.allowStale}=t,i=this.#u.get(e);if(i===void 0||!r&&this.#j(i)){n&&(n.peek=i===void 0?`miss`:`stale`);return}let a=this.#f[i],o=this.#W(a)?a.__staleWhileFetching:a;return n&&(o===void 0?n.peek=`miss`:(n.peek=`hit`,n.value=o)),o}#U(e,t,n,r){let i=t===void 0?void 0:this.#f[t];if(this.#W(i))return i;let a=new AbortController,{signal:o}=n;o?.addEventListener(`abort`,()=>a.abort(o.reason),{signal:a.signal});let s={signal:a.signal,options:n,context:r},c=(r,i=!1)=>{let{aborted:o}=a.signal,c=n.ignoreFetchAbort&&r!==void 0,l=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&r!==void 0);if(n.status&&(o&&!i?(n.status.fetchAborted=!0,n.status.fetchError=a.signal.reason,c&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),o&&!c&&!i)return u(a.signal.reason,l);let d=f,p=this.#f[t];return(p===f||p===void 0&&c&&i)&&(r===void 0?d.__staleWhileFetching===void 0?this.#Z(e,`fetch`):this.#f[t]=d.__staleWhileFetching:(n.status&&(n.status.fetchUpdated=!0),this.#z(e,r,s.options,d))),r},l=e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),u(e,!1)),u=(r,i)=>{let{aborted:o}=a.signal,s=o&&n.allowStaleOnFetchAbort,c=s||n.allowStaleOnFetchRejection,l=c||n.noDeleteOnFetchRejection,u=f;if(this.#f[t]===f&&(!l||!i&&u.__staleWhileFetching===void 0?this.#Z(e,`fetch`):s||(this.#f[t]=u.__staleWhileFetching)),c)return n.status&&u.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw r},d=(t,r)=>{let o=this.#a?.(e,i,s);a.signal.addEventListener(`abort`,()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(t(void 0),n.allowStaleOnFetchAbort&&(t=e=>c(e,!0)))}),o&&o instanceof Promise?o.then(e=>t(e===void 0?void 0:e),r):o!==void 0&&t(o)};n.status&&(n.status.fetchDispatched=!0);let f=new Promise(d).then(c,l),p=Object.assign(f,{__abortController:a,__staleWhileFetching:i,__returned:void 0});return t===void 0?(this.#z(e,p,{...s.options,status:void 0}),t=this.#u.get(e)):this.#f[t]=p,p}#W(e){if(!this.#w)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty(`__staleWhileFetching`)&&t.__abortController instanceof AbortController}fetch(e,t={}){let n=Ia.hasSubscribers,{status:r=Ra()?{}:void 0}=t;t.status=r,r&&t.context&&(r.context=t.context);let i=this.#G(e,t);return r&&n&&(r.trace=!0,Ia.tracePromise(()=>i,r).catch(()=>{})),i}async#G(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:s=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:h=!1,status:g,signal:_}=t;if(g&&(g.op=`fetch`,g.key=e,h&&(g.forceRefresh=!0),g.cache=this),!this.#w)return g&&(g.fetch=`get`),this.#J(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:g});let v={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:a,noDisposeOnSet:o,size:s,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:_},y=this.#u.get(e);if(y===void 0){g&&(g.fetch=`miss`);let t=this.#U(e,y,v,m);return t.__returned=t}{let t=this.#f[y];if(this.#W(t)){let e=n&&t.__staleWhileFetching!==void 0;return g&&(g.fetch=`inflight`,e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let i=this.#j(y);if(!h&&!i)return g&&(g.fetch=`hit`),this.#X(y),r&&this.#O(y),g&&this.#k(g,y),t;let a=this.#U(e,y,v,m),o=a.__staleWhileFetching!==void 0&&n;return g&&(g.fetch=i?`stale`:`refresh`,o&&i&&(g.returnedStale=!0)),o?a.__staleWhileFetching:a.__returned=a}}forceFetch(e,t={}){let n=Ia.hasSubscribers,{status:r=Ra()?{}:void 0}=t;t.status=r,r&&t.context&&(r.context=t.context);let i=this.#K(e,t);return r&&n&&(r.trace=!0,Ia.tracePromise(()=>i,r).catch(()=>{})),i}async#K(e,t={}){let n=await this.#G(e,t);if(n===void 0)throw Error(`fetch() returned undefined`);return n}memo(e,t={}){let{status:n=X.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op=`memo`,n.key=e,t.context&&(n.context=t.context),n.cache=this);let r=this.#q(e,t);return n&&(n.value=r),X.hasSubscribers&&X.publish(n),r}#q(e,t={}){let n=this.#o;if(!n)throw Error(`no memoMethod provided to constructor`);let{context:r,status:i,forceRefresh:a,...o}=t;i&&a&&(i.forceRefresh=!0);let s=this.#J(e,o),c=a||s===void 0;if(i&&(i.memo=c?`miss`:`hit`,c||(i.value=s)),!c)return s;let l=n(e,s,{options:o,context:r});return i&&(i.value=l),this.#z(e,l,o),l}get(e,t={}){let{status:n=X.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op=`get`,n.key=e,n.cache=this);let r=this.#J(e,t);return n&&(r!==void 0&&(n.value=r),X.hasSubscribers&&X.publish(n)),r}#J(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:a}=t,o=this.#u.get(e);if(o===void 0){a&&(a.get=`miss`);return}let s=this.#f[o],c=this.#W(s);return a&&this.#k(a,o),this.#j(o)?c?(a&&(a.get=`stale-fetching`),n&&s.__staleWhileFetching!==void 0?(a&&(a.returnedStale=!0),s.__staleWhileFetching):void 0):(i||this.#Z(e,`expire`),a&&(a.get=`stale`),n?(a&&(a.returnedStale=!0),s):void 0):(a&&(a.get=c?`fetching`:`hit`),this.#X(o),r&&this.#O(o),c?s.__staleWhileFetching:s)}#Y(e,t){this.#m[t]=e,this.#p[e]=t}#X(e){e!==this.#g&&(e===this.#h?this.#h=this.#p[e]:this.#Y(this.#m[e],this.#p[e]),this.#Y(this.#g,e),this.#g=e)}delete(e){return this.#Z(e,`delete`)}#Z(e,t){X.hasSubscribers&&X.publish({op:`delete`,delete:t,key:e,cache:this});let n=!1;if(this.#c!==0){let r=this.#u.get(e);if(r!==void 0){if(this.#S?.[r]&&(clearTimeout(this.#S[r]),this.#S[r]=void 0),n=!0,this.#c===1)this.#Q(t);else{this.#N(r);let n=this.#f[r];if(this.#W(n)?n.__abortController.abort(Error(`deleted`)):(this.#C||this.#T)&&(this.#C&&this.#n?.(n,e,t),this.#T&&this.#v?.push([n,e,t])),this.#u.delete(e),this.#d[r]=void 0,this.#f[r]=void 0,r===this.#g)this.#g=this.#m[r];else if(r===this.#h)this.#h=this.#p[r];else{let e=this.#m[r];this.#p[e]=this.#p[r];let t=this.#p[r];this.#m[t]=this.#m[r]}this.#c--,this.#_.push(r)}}}if(this.#T&&this.#v?.length){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}return n}clear(){return this.#Q(`delete`)}#Q(e){for(let t of this.#L({allowStale:!0})){let n=this.#f[t];if(this.#W(n))n.__abortController.abort(Error(`deleted`));else{let r=this.#d[t];this.#C&&this.#n?.(n,r,e),this.#T&&this.#v?.push([n,r,e])}}if(this.#u.clear(),this.#f.fill(void 0),this.#d.fill(void 0),this.#x&&this.#b){this.#x.fill(0),this.#b.fill(0);for(let e of this.#S??[])e!==void 0&&clearTimeout(e);this.#S?.fill(void 0)}if(this.#y&&this.#y.fill(0),this.#h=0,this.#g=0,this.#_.length=0,this.#l=0,this.#c=0,this.#T&&this.#v){let e=this.#v,t;for(;t=e?.shift();)this.#i?.(...t)}}},Ja=`@teacss/autocomplete`;const Ya=5e4,Xa=2e6,Za=5e4,Qa=4096,$a=1e3,eo=5e7,to=1e5,no=new Map(Array.from(`ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåçèéêëìíîïñòóôõöøùúûüýÿĀāĂ㥹ĆćĈĉĊċČčĎďđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥħĨĩĪīĬĭĮįİıĴĵĶķĹĺĻļĽľŀłŃńŅņŇňŌōŎŏŐőŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžſƀƁƃƆƈƉƊƌƎƐƒƓƗƙƚƜƝƞƟƠơƥƫƭƮƯưƲƴƶǍǎǏǐǑǒǓǔǗǘǝǥǦǧǨǩǪǫǰǴǵǸǹȀȁȂȃȄȅȆȇȈȉȊȋȌȍȎȏȐȑȒȓȔȕȖȗȘșȚțȞȟȠȡȥȦȧȨȩȮȯȲȳȴȵȶȷȺȻȼȽȾȿɀɃɄɅɆɇɈɉɊɋɌɍɎɏɐɑɓɔɕɖɗɘɛɜɝɞɟɠɡɢɥɦɨɪɫɬɭɯɰɱɲɳɴɵɹɺɻɼɽɾɿʀʁʂʇʈʉʋʌʍʎʏʐʑʗʙʚʛʜʝʞʟʠʮͣͤͥͦͧͨͩͪͫͬͭͮͯᴀᴃᴄᴅᴇᴈᴉᴊᴋᴌᴍᴎᴏᴐᴑᴒᴓᴖᴗᴘᴙᴚᴛᴜᴝᴞᴟᴠᴡᴢᵢᵣᵤᵥḀḁḂḃḄḅḆḇḊḋḌḍḎḏḐḑḒḓḘḙḚḛḞḟḠḡḢḣḤḥḦḧḨḩḪḫḬḭḮḯḰḱḲḳḴḵḶḷḺḻḼḽḾḿṀṁṂṃṄṅṆṇṈṉṊṋṔṕṖṗṘṙṚṛṞṟṠṡṢṣṪṫṬṭṮṯṰṱṲṳṴṵṶṷṼṽṾṿẀẁẂẃẄẅẆẇẈẉẊẋẌẍẎẏẐẑẒẓẔẕẖẗẘẙẚẛẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặẸẹẺẻẼẽẾếỀềỂểỄễỆệỈỉỊịỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợỤụỦủỨứỪừỬửỮữỰựỲỳỴỵỶỷỸỹⁱₕₖₗₘₙₚₛₜↄ`,(e,t)=>[e,`AAAAAACEEEEIIIINOOOOOOUUUUYsaaaaaaceeeeiiiinoooooouuuuyyAaAaAaCcCcCcCcDddEeEeEeEeEeGgGgGgGgHhhIiIiIiIiIiJjKkLlLlLlllNnNnNnOoOoOoRrRrRrSsSsSsSsTtTttUuUuUuUuUuUuWwYyYZzZzZzsbBbOcDDdEEfGIklMNnOOopttTUuVyzAaIiOoUuUuegGgKkOojGgNnAaAaEeEeIiIiOoOoRrRrUuUuSsTtHhNdzAaEeOoYylntjACcLTszBUVEeJjQqRrYyaabocddeeeeejggGhhiIlllmmmnnNorrrrrrrRRsttuvvwyYzzcBeGHjkLqhaeioucdhmrtvxABCDEeiJKLMNOOoooooPRRTUuumVWZiruvAaBbBbBbDdDdDdDdDdEeEeFfGgHhHhHhHhHhIiIiKkKkKkLlLlLlMmMmMmNnNnNnNnPpPpRrRrRrSsSsTtTtTtTtUuUuUuVvVvWwWwWwWwWwXxXxYyZzZzZzhtwyasAaAaAaAaAaAaAaAaAaAaAaAaEeEeEeEeEeEeEeEeIiIiOoOoOoOoOoOoOoOoOoOoOoOoUuUuUuUuUuUuUuYyYyYyYyihklmnpstc`[t]])),ro={maxAttempts:Za,maxCandidateLength:Qa,maxCandidates:Ya,maxCharacters:Xa,maxScans:to,maxScannedCharacters:5e7},io={...ro,maxCandidateLength:Xa,maxCandidates:$a};function ao(){return{suggestions:[],attempts:0,candidates:0,characters:0,scans:0,truncated:!1}}const oo=new WeakMap,so=new WeakMap;function co(e,t,n){let r=oo.get(e);if(!r){let n=e.suggest(t,`prefix`)??[];return{suggestions:n,attempts:n.length,candidates:n.length,characters:n.reduce((e,t)=>e+t.length,0),scans:n.length,truncated:!1}}return r(t,n)}function lo(e,t,n){let r=so.get(e);return r?r(t,n):co(e,t,n)}var uo=class extends Error{template;constructor(e,t){super(e),this.template=t,this.name=Ja,this.template=t}toString(){return`⚠️ [${this.name}]: ${this.message}. ${this.template?`Template: ${this.template}.`:``}`}};const fo={directions:`(x|y|t|b|l|r|s|e)`,num:`(${[0,1,2,3,4,5,6,8,10,12,24,36].join(`|`)})`,percent:`(${[0,10,20,30,40,50,60,70,80,90,100].join(`|`)})`,percentage:`(${[`10%`,`20%`,`30%`,`40%`,`50%`,`60%`,`70%`,`80%`,`90%`,`100%`].join(`|`)})`},po=[`DEFAULT`];function mo(e,t,n,r){let i=0;Array.from(e.matchAll(t)).forEach(t=>{let a=t.index;i!==a&&r(e.slice(i,a),i,a),n(t),i=a+t[0].length}),i!==e.length&&r(e.slice(i),i,e.length)}const ho=Ya;function go(e,t){let n=0;for(let r=t;r<e.length;r++)if(e[r]===`(`)n++;else if(e[r]===`)`&&--n===0)return r}function _o(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`?n++:a===`)`?n--:a===`|`&&n===0&&(t.push(e.slice(r,i)),r=i+1)}return t.push(e.slice(r)),t}function vo(e,t){let n=e.indexOf(`(`),r=n===-1?void 0:go(e,n);if(n===-1||r==null)return[e];let i=e.slice(0,n),a=vo(e.slice(r+1),t);if(a===void 0)return;let o=[];for(let s of _o(e.slice(n+1,r))){let e=vo(s,t);if(e===void 0)return;for(let n of e)for(let e of a){if(--t.remaining<0)return;o.push(`${i}${n}${e}`)}}return o}function yo(e){let t={remaining:ho},n=[];for(let r of _o(e)){let e=vo(r,t);if(e===void 0)return;n.push(...e)}return n}function bo(e,t={},n={}){let r=[],i=[],a={...fo,...n};e=e.replace(/<([\w-]+)>/g,(e,t,n,r)=>Object.hasOwn(a,t)?a[t]:(i.push(new uo(`Unknown template shorthand: <${t}>`,r)),e)),c(e),i.length&&(r.length=0);let o={parts:r,suggest:l,errors:i};return oo.set(o,d),so.set(o,u),o;function s(e){mo(e,/\$([\w.|-]+)/g,e=>{r.push({type:`theme`,objects:e[1].split(`|`).map(n=>{let r=n.split(`.`).reduce((t,n)=>!n||typeof t!=`object`||!t||!Object.hasOwn(t,n)||!t[n]?(i.push(new uo(`Invalid theme key: ${n}`,e.input)),{}):t[n],t);return typeof r!=`object`||!r||Array.isArray(r)?(i.push(new uo(`Invalid theme path: ${n}`,e.input)),{}):r})})},e=>{r.push({type:`static`,value:e})})}function c(t){let n=0;for(let a=0;a<t.length;a++){if(t[a]!==`(`)continue;let o=go(t,a);if(o==null)break;let c=t.slice(a+1,o);if(n!==a&&s(t.slice(n,a)),n=o+1,!c.includes(`|`)){r.push({type:`static`,value:t.slice(a,o+1)}),a=o;continue}let l=yo(c);l===void 0?(i.push(new uo(`Template group expands past ${ho} values: (${c})`,e)),r.push({type:`static`,value:t.slice(a,o+1)})):r.push({type:`group`,values:l}),a=o}n!==t.length&&s(t.slice(n))}function l(e,t=`prefix`){if(e.length>1&&t===`fuzzy`){let t=e!==e.toLowerCase(),n=Fo(e,t),i=d(e,{maxCandidates:$a}).suggestions.filter(e=>ko(n,Fo(e,t),e,0));if(n.length>Qa)return i;let a=ps(r,{},e).candidates;if(i.length){let e=new Set(i);if(a.every(t=>e.has(t)))return i}if(Oo(e,a.reduce((e,t)=>e+t.length,0))){let t=To(a,e),n=t.filter(t=>Po(t,e));return n.length?cs(n,[...i,...t]):cs(i,t)}return cs(i,new Fa(a,{fuzzy:`v1`,limit:$a}).find(e).map(e=>e.item))}return u(e).suggestions}function u(e,t={}){let n={...io,...t},i=wo(e);if(i.length>n.maxCandidateLength)return ao();let a=xo(r);if(a){let t=So(r,0,a.index);if(!Ko(t,e)&&!Ko(wo(t),i))return ao();let o=So(r,a.index+1,r.length);return qo(a.part,t,o,e,a.suppressPartialRoots,n)}let o=Co(r);return o&&!Ko(o,e)&&!Ko(wo(o),wo(e))?ao():Lo(r,e,n)}function d(e,t={}){let n={...ro,...t},i=u(e,n),a=Co(r);if(i.suggestions.length||!a)return i;let o={...n,maxAttempts:n.maxAttempts-i.attempts,maxCandidates:n.maxCandidates-i.candidates,maxCharacters:n.maxCharacters-i.characters,maxScans:n.maxScans-i.scans},s=u(a+e,o);return{suggestions:s.suggestions,attempts:i.attempts+s.attempts,candidates:i.candidates+s.candidates,characters:i.characters+s.characters,scans:i.scans+s.scans,truncated:i.truncated||s.truncated}}}function xo(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(i.type!==`static`){if(i.type===`group`&&i.values.length>0&&i.values.every(e=>e===``)){n=!0;continue}if(i.type!==`theme`||t)return;t={index:r,part:i}}}return t&&{...t,suppressPartialRoots:n}}function So(e,t,n){let r=``;for(let i=t;i<n;i++){let t=e[i];t.type===`static`&&(r+=t.value)}return r}function Co(e){let t=e.findIndex(e=>e.type!==`static`);return So(e,0,t<0?e.length:t)}function wo(e){return e.replace(/-/g,``)}function To(e,t){return Eo(e,t)}function Eo(e,t,n={}){let r={...ro,maxCandidates:$a,...n};if(!t)return Do(e,r);let i=t!==t.toLowerCase(),a=Fo(t,i);if(a.length>r.maxCandidateLength)return[];let o={characters:0,items:[],retained:new Set},s=new Set,c=e[Symbol.iterator](),l=0,u=0;for(;l<r.maxAttempts&&u<r.maxScannedCharacters;){let e=c.next();if(e.done)break;let t=e.value,n=l++;if(!t||t.length>r.maxCandidateLength||s.has(t)||t.length>r.maxScannedCharacters-u)continue;s.add(t),u+=t.length;let d=ko(a,Fo(t,i),t,n);d&&Ao(o,d,r.maxCandidates,r.maxCharacters)}return o.items.sort(No).map(({candidate:e})=>e)}function Do(e,t){let n=[],r=new Set,i=e[Symbol.iterator](),a=0,o=0,s=0;for(;a<t.maxAttempts&&n.length<t.maxCandidates&&o<t.maxCharacters&&s<t.maxScannedCharacters;){let e=i.next();if(e.done)break;let c=e.value;a++,!(!c||c.length>t.maxCandidateLength||r.has(c)||c.length>t.maxScannedCharacters-s)&&(r.add(c),s+=c.length,!(o+c.length>t.maxCharacters)&&(n.push(c),o+=c.length))}return n}function Oo(e,t){return e.length*t>eo}function ko(e,t,n,r){if(t===e)return{candidate:n,category:0,gaps:0,longestRun:e.length,start:0,order:r};if(t.startsWith(e))return{candidate:n,category:1,gaps:0,longestRun:e.length,start:0,order:r};let i=0,a=-1,o=-1,s=0,c=0,l=0;for(let n=0;n<t.length&&i<e.length;n++)t[n]===e[i]&&(a<0&&(a=n),o>=0&&(l+=n-o-1),s=n===o+1?s+1:1,c=Math.max(c,s),o=n,i++);if(i===e.length)return{candidate:n,category:2,gaps:l,longestRun:c,start:a,order:r}}function Ao(e,t,n,r){e.retained.has(t.candidate)||(e.items.length<n&&e.characters+t.candidate.length<=r?(e.items.push(t),e.retained.add(t.candidate),e.characters+=t.candidate.length,jo(e.items,e.items.length-1)):e.items.length&&No(t,e.items[0])<0&&e.characters-e.items[0].candidate.length+t.candidate.length<=r&&(e.retained.delete(e.items[0].candidate),e.characters+=t.candidate.length-e.items[0].candidate.length,e.items[0]=t,e.retained.add(t.candidate),Mo(e.items,0)))}function jo(e,t){for(;t>0;){let n=t-1>>>1;if(No(e[t],e[n])<=0)return;[e[n],e[t]]=[e[t],e[n]],t=n}}function Mo(e,t){for(;;){let n=t*2+1;if(n>=e.length)return;let r=n+1,i=n;if(r<e.length&&No(e[r],e[n])>0&&(i=r),No(e[i],e[t])<=0)return;[e[t],e[i]]=[e[i],e[t]],t=i}}function No(e,t){return e.category-t.category||e.gaps-t.gaps||t.longestRun-e.longestRun||e.start-t.start||e.candidate.length-t.candidate.length||e.order-t.order}function Po(e,t){let n=t!==t.toLowerCase();return Fo(e,n)===Fo(t,n)}function Fo(e,t){let n=e.normalize(),r=Io(n)?n:Array.from(n,e=>no.get(e)??e).join(``);return t?r:r.toLowerCase()}function Io(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>127)return!1;return!0}function Lo(e,t,n={}){let r={...ro,...n};if(r.maxAttempts<=0||r.maxCandidates<=0||r.maxCharacters<=0)return ao();let i=wo(t),a=Ro(),o=Ro(),s=r.maxCandidates,c=Xo(r.maxScans),l=[],u=Array.from({length:e.length},()=>``),d=Array.from({length:e.length+1},()=>0),f=Array.from({length:e.length+1},()=>0),p=Array.from({length:e.length+1},()=>0),m=[],h=new Set,g=0,_=0;for(;_>=0&&!c.truncated;){if(_===e.length){let e=u.join(``),n=f[_]>=t.length,c=p[_]>=i.length;if((n||c)&&e.length<=r.maxCharacters){let t=!h.has(e);(!t||g<r.maxAttempts)&&(t&&(h.add(e),g++),n&&zo(a,e,m,s,r),c&&zo(o,e,m,s,r))}_--;continue}if(g>=r.maxAttempts)break;let n=l[_];n||(n={choiceIndex:0,iterator:ls(e[_],r.maxCandidateLength-d[_],c)},l[_]=n);let v=n.iterator.next();if(v.done){l.pop(),_--;continue}let y=n.choiceIndex++,b=v.value,x=d[_]+b.length;if(x>r.maxCandidateLength)continue;let S=f[_]<0?-1:Go(t,f[_],b,!1),C=p[_]<0?-1:Go(i,p[_],b,!0);if(S<0&&C<0)continue;for(;m.length&&!(m.at(-1).depth<_);)m.pop();y>0&&m.push({depth:_,index:y}),u[_]=b;let w=_+1;d[w]=x,f[w]=S,p[w]=C,l.length=w,_=w}let v=a.entries.length?a:o;v.entries.sort((e,t)=>Wo(e.path,t.path));let y=v.entries.map(e=>e.candidate);return{suggestions:y,attempts:g,candidates:y.length,characters:v.characters,scans:c.initial-c.remaining,truncated:c.truncated}}function Ro(){return{characters:0,entries:[],indices:new Map}}function zo(e,t,n,r,i){let a=e.indices.get(t);if(a!==void 0){let t=e.entries[a];Wo(n,t.path)<0&&(t.path=n.slice(),Ho(e,a));return}if(r<=0||t.length>i.maxCharacters)return;let o={candidate:t,path:n.slice()};if(e.entries.length>=r){if(Wo(o.path,e.entries[0].path)>=0)return;Bo(e)}for(;e.entries.length&&e.characters+t.length>i.maxCharacters;){if(Wo(o.path,e.entries[0].path)>=0)return;Bo(e)}e.characters+t.length>i.maxCharacters||(e.indices.set(t,e.entries.length),e.entries.push(o),e.characters+=t.length,Vo(e,e.entries.length-1))}function Bo(e){let t=e.entries[0],n=e.entries.pop();e.indices.delete(t.candidate),e.characters-=t.candidate.length,e.entries.length&&(e.entries[0]=n,e.indices.set(n.candidate,0),Ho(e,0))}function Vo(e,t){for(;t>0;){let n=t-1>>>1;if(Wo(e.entries[t].path,e.entries[n].path)<=0)return;Uo(e,n,t),t=n}}function Ho(e,t){for(;;){let n=t*2+1;if(n>=e.entries.length)return;let r=n+1,i=n;if(r<e.entries.length&&Wo(e.entries[r].path,e.entries[n].path)>0&&(i=r),Wo(e.entries[i].path,e.entries[t].path)<=0)return;Uo(e,i,t),t=i}}function Uo(e,t,n){[e.entries[t],e.entries[n]]=[e.entries[n],e.entries[t]],e.indices.set(e.entries[t].candidate,t),e.indices.set(e.entries[n].candidate,n)}function Wo(e,t){let n=e.length-1,r=t.length-1;for(;n>=0||r>=0;){let i=n>=0?e[n].depth:-1,a=r>=0?t[r].depth:-1,o=Math.max(i,a),s=i===o?e[n--].index:0,c=a===o?t[r--].index:0;if(s!==c)return s-c}return 0}function Go(e,t,n,r){let i=t;for(let t=0;t<n.length;t++){let a=n[t];if(!(r&&a===`-`)){if(i<e.length&&e[i]!==a)return-1;i++}}return i}function Ko(e,t){return e.length<=t.length?t.startsWith(e):e.startsWith(t)}function qo(e,t,n,r,i,a){let o={...ro,...a};if(t.length+1>o.maxCandidateLength)return ao();let s=Xo(o.maxScans),c=$o(e.objects,s),l=es(r,!1,o),u=es(wo(r),!0,o);Jo(c,t,n,o.maxCandidateLength,i,l,u,s);let d=ns(l,s);if(d.suggestions.length||!d.exhausted)return d;let f=ns(u,s);return{suggestions:f.suggestions,attempts:d.attempts+f.attempts,candidates:d.candidates+f.candidates,characters:d.characters+f.characters,scans:f.scans,truncated:f.truncated}}function Jo(e,t,n,r,i,a,o,s){for(let c of e){let e=t+c.key,l=rs(e,a.input,!1),u=rs(e,o.input,!0);if(l===`none`&&u===`none`)continue;let d=as(c.objects,e,n,a.input,o.input,r),f=l===`partial`||u===`partial`?os(d,s):void 0,p=f!==void 0;if(is(a,l,c.hasLeaf,p,e,n,i),is(o,u,c.hasLeaf,p,e,n,i),a.blocked)return;for(f??=os(d,s);f;){if((l===`reached`||i&&l===`partial`)&&ts(a,f.candidate,f.rawMatch),(u===`reached`||i&&u===`partial`)&&ts(o,f.candidate,f.normalizedMatch),a.blocked)return;f=os(d,s)}if(s.truncated||a.blocked)return}}function Yo(e){return!!e&&e[0]!==`_`&&!po.includes(e)}function Xo(e=to){let t=Math.max(0,e);return{initial:t,remaining:t,truncated:!1}}function Zo(e){return e.remaining<=0?(e.truncated=!0,!1):(e.remaining--,!0)}function*Qo(e){yield*Object.keys(e)}function $o(e,t){let n=new Map;outer:for(let r of e)for(let e of Qo(r)){if(!Zo(t))break outer;if(!Yo(e))continue;let i=r[e];if(i==null)continue;let a=n.get(e)??{key:e,hasLeaf:!1,objects:[]};if(typeof i!=`object`||Array.isArray(i))a.hasLeaf=!0;else{let e=i;a.objects.push(e),a.hasLeaf||=Object.hasOwn(e,`DEFAULT`)&&e.DEFAULT!==null&&e.DEFAULT!==void 0}n.set(e,a)}return[...n.values()]}function es(e,t,n){return{attempts:0,blocked:n.maxAttempts<=0||n.maxCandidates<=0||n.maxCharacters<=0,characters:0,input:e,limits:n,normalize:t,seen:new Set,suggestions:[]}}function ts(e,t,n){!n||e.blocked||e.seen.has(t)||(e.seen.add(t),e.attempts++,t.length<=e.limits.maxCandidateLength&&e.characters+t.length<=e.limits.maxCharacters&&(e.suggestions.push(t),e.characters+=t.length),e.blocked||=e.attempts>=e.limits.maxAttempts||e.suggestions.length>=e.limits.maxCandidates||e.characters>=e.limits.maxCharacters)}function ns(e,t){return{suggestions:e.suggestions,attempts:e.attempts,candidates:e.suggestions.length,characters:e.characters,scans:t.initial-t.remaining,truncated:t.truncated,exhausted:!e.blocked&&!t.truncated}}function rs(e,t,n){let r=n?wo(e):e;return t.startsWith(r)?`reached`:r.startsWith(t)?`partial`:`none`}function is(e,t,n,r,i,a,o){if(t===`none`)return;if(t===`partial`&&r){(n||!o)&&ts(e,i,!0);return}if(!n)return;let s=i+a;ts(e,s,(e.normalize?wo(s):s).startsWith(e.input))}function as(e,t,n,r,i,a){return{base:t,fragments:[],frames:[],maxCandidateLength:a,normalizedInput:i,normalizedMatchedLength:Go(i,0,t,!0),objectIndex:0,objects:e,rawInput:r,rawMatchedLength:Go(r,0,t,!1),staticSuffix:n}}function os(e,t){for(;!t.truncated;){if(!e.frames.length){if(e.objectIndex>=e.objects.length)return;let t=e.objects[e.objectIndex++];e.frames.push({depth:0,iterator:Qo(t),normalizedMatchedLength:e.normalizedMatchedLength,object:t,rawMatchedLength:e.rawMatchedLength,valueLength:0})}let n=e.frames.at(-1),r=n.iterator.next();if(r.done){e.frames.pop(),e.fragments.length=n.depth;continue}if(!Zo(t))return;let i=r.value;if(!Yo(i))continue;let a=n.object[i];if(a==null)continue;let o=n.valueLength+ +!!n.depth+i.length;if(e.base.length+o+e.staticSuffix.length+1>e.maxCandidateLength)continue;let s=`-${i}`,c=n.rawMatchedLength<0?-1:Go(e.rawInput,n.rawMatchedLength,s,!1),l=n.normalizedMatchedLength<0?-1:Go(e.normalizedInput,n.normalizedMatchedLength,s,!0);if(c<0&&l<0)continue;e.fragments.length=n.depth,e.fragments.push(i);let u=typeof a==`object`&&!Array.isArray(a)?a:void 0;if(u&&e.frames.push({depth:n.depth+1,iterator:Qo(u),normalizedMatchedLength:l,object:u,rawMatchedLength:c,valueLength:o}),!(!u||Object.hasOwn(u,`DEFAULT`)&&u.DEFAULT!==null&&u.DEFAULT!==void 0))continue;let d=ss(e.rawInput,c,e.staticSuffix,!1),f=ss(e.normalizedInput,l,e.staticSuffix,!0);if(d||f)return{candidate:`${e.base}-${e.fragments.join(`-`)}${e.staticSuffix}`,normalizedMatch:f,rawMatch:d}}}function ss(e,t,n,r){return t<0?!1:Go(e,t,n,r)>=e.length}function cs(e,t){let n=[],r=new Set,i=0,a=(e,t)=>{for(let a of e){if(n.length===t)return;if(!(!a||r.has(a)||a.length>Qa)){if(i+a.length>Xa)return;r.add(a),n.push(a),i+=a.length}}};return a(e,t.length?750:$a),a(t,$a),a(e,$a),n}function*ls(e,t,n){e.type===`theme`?yield*ds(e.objects,t,n):yield*us(e,t,n)}function*us(e,t,n){if(e.type===`static`){e.value.length<=t&&(yield e.value);return}if(e.type===`group`)for(let r of e.values){if(!Zo(n))return;r.length<=t&&(yield r)}}function*ds(e,t,n){let r=[];for(let i of e){r.length=0;let e=[{depth:0,iterator:Qo(i),object:i,valueLength:0}];for(;e.length&&!n.truncated;){let i=e.at(-1),a=i.iterator.next();if(a.done){e.pop(),r.length=i.depth;continue}if(!Zo(n))return;let o=a.value;if(!Yo(o))continue;let s=i.object[o];if(s==null)continue;let c=i.valueLength+ +!!i.depth+o.length;if(c>t)continue;r.length=i.depth,r.push(o);let l=typeof s==`object`&&!Array.isArray(s)?s:void 0;l&&e.push({depth:i.depth+1,iterator:Qo(l),object:l,valueLength:c}),(!l||Object.hasOwn(l,`DEFAULT`)&&l.DEFAULT!==null&&l.DEFAULT!==void 0)&&(yield r.join(`-`))}}}function fs(e,t){let n=Xo(t.maxScans),r=e.map(e=>({done:!1,iterator:ls(e,t.maxCandidateLength,n),pending:void 0,seen:new Set,values:[]})),i=e.length+Math.max(0,t.maxCandidates-1),a=r.length,o=0,s=0,c=!1,l=r.length;for(;l&&!n.truncated;){let e=!1;for(let n of r){if(!n.values.length&&n.pending!==void 0&&o+n.pending.length<=t.maxCharacters){n.values.push(n.pending),o+=n.pending.length,n.pending=void 0,s++,l--,e=!0;continue}if(n.done)continue;let r=n.iterator.next();if(e=!0,r.done){n.done=!0,a--;continue}if(n.seen.has(r.value))continue;if(n.seen.add(r.value),!n.values.length){o+r.value.length<=t.maxCharacters?(n.values.push(r.value),o+=r.value.length,s++,l--):(n.pending===void 0||r.value.length<n.pending.length)&&(n.pending=r.value,c=!0);continue}let i=n.values[0];r.value.length<i.length&&(n.values[0]=r.value,o+=r.value.length-i.length,c=!0)}if(!e)break}for(;a&&s<i&&o<t.maxCharacters&&!n.truncated;){let e=!1;for(let n of r){if(n.done)continue;let r=n.iterator.next();if(r.done){n.done=!0,a--;continue}if(e=!0,!n.seen.has(r.value)){if(n.seen.add(r.value),o+r.value.length>t.maxCharacters){c=!0;continue}if(n.values.push(r.value),o+=r.value.length,s++,s===i)break}}if(!e)break}return c||=n.truncated||a>0||l>0,{scans:n.initial-n.remaining,truncated:c,values:r.map(e=>e.values)}}function ps(e,t={},n=``){let r={...ro,...t},i=fs(e,r),a=i.values,o=i.scans,s,c=()=>{if(s===void 0){let t=ms(a,n,r);s=t?{combination:t,scans:0}:hs(e,n,r,Math.max(0,r.maxScans-o)),o+=s.scans}return s};if(a.some(e=>!e.length)){let e=i.truncated?c().combination:void 0;if(!e)return{candidates:[],truncated:i.truncated,attempts:0,scans:o};let t=_s(r),n={remaining:r.maxAttempts};return vs(t,n,0)&&ws(t,e),{candidates:[...t.candidates],truncated:!0,attempts:r.maxAttempts-n.remaining,scans:o}}let l=0;for(let e of a){let t=e[0].length;for(let n=1;n<e.length;n++)t=Math.min(t,e[n].length);if(l+=t,l>Math.min(r.maxCandidateLength,r.maxCharacters)){let e=i.truncated?c().combination:void 0;if(!e)return{candidates:[],truncated:!0,attempts:0,scans:o};let t=_s(r),n={remaining:r.maxAttempts};return vs(t,n,0)&&ws(t,e),{candidates:[...t.candidates],truncated:!0,attempts:r.maxAttempts-n.remaining,scans:o}}}let u=1,d=0,f=i.truncated;for(let e of a){if(f)continue;let t=0;for(let n of e)if(t+=n.length,t>r.maxCharacters)break;let n=d*e.length,i=u*t;u>r.maxCandidates/e.length||u>r.maxAttempts/e.length||n>r.maxCharacters||i>r.maxCharacters-n?f=!0:(u*=e.length,d=n+i)}let p={remaining:r.maxAttempts};if(!f){let e=_s(r);return Cs(e,a,u,p),{candidates:[...e.candidates],truncated:!1,attempts:r.maxAttempts-p.remaining,scans:o}}let m=_s(r),h=a.map(e=>e[0]),g=a.flatMap((e,t)=>e.length>1?[t]:[]),_=c().combination;_&&vs(m,p,0)&&ws(m,_),vs(m,p,0)&&ws(m,h);let v=Math.min(Za,Math.max(0,p.remaining));return e.length&&v>eo/e.length?{candidates:[...m.candidates],truncated:!0,attempts:r.maxAttempts-p.remaining,scans:o}:(ys(m,a,h,g,p),xs(m,a,h,g,p),bs(m,a,h,g,p),Ss(m,a,h,g,p),Cs(m,a,r.maxAttempts,p,!0),{candidates:[...m.candidates],truncated:!0,attempts:r.maxAttempts-p.remaining,scans:o})}function ms(e,t,n){if(!t||e.some(e=>!e.length))return;let r=t!==t.toLowerCase(),i=Fo(t,r);if(!i||i.length>n.maxCandidateLength)return;let a=Math.min(n.maxCandidateLength,n.maxCharacters),o=Array.from({length:e.length+1},()=>0);for(let t=e.length-1;t>=0;t--){let n=e[t][0].length;for(let r=1;r<e[t].length;r++)n=Math.min(n,e[t][r].length);o[t]=o[t+1]+n}if(o[0]>a)return;let s=[],c=0,l=0;for(let t=0;t<e.length;t++){let n,u=l;for(let s of e[t]){if(c+s.length+o[t+1]>a)continue;let e=gs(i,l,Fo(s,r)),d=e>l,f=u>l;(n===void 0||d&&!f||d===f&&(s.length<n.length||s.length===n.length&&e>u))&&(n=s,u=e)}if(n===void 0)return;s.push(n),c+=n.length,l=u}if(l<i.length)return;let u=s.join(``);if(ko(i,Fo(u,r),u,0))return s}function hs(e,t,n,r){let i=Xo(r),a=e=>({combination:e,scans:i.initial-i.remaining});if(!t)return a();let o=t!==t.toLowerCase(),s=Fo(t,o);if(!s||s.length>n.maxCandidateLength)return a();let c=Math.min(n.maxCandidateLength,n.maxCharacters),l=[{characters:0,choice:``,matched:0}],u=0,d=0;for(let t of e){let e=new Map,n=new Set;for(let r of ls(t,c,i)){if(n.has(r))continue;n.add(r);let t={normalized:Fo(r,o),raw:r};for(let n of l){if(d++,u+=t.normalized.length,d>Za||u>eo)return a();let r=n.characters+t.raw.length;if(r>c)continue;let i=gs(s,n.matched,t.normalized),o=e.get(i);o&&o.characters<=r||e.set(i,{characters:r,choice:t.raw,matched:i,previous:n})}}if(!e.size)return a();let r=1/0;l=[...e.values()].sort((e,t)=>t.matched-e.matched||e.characters-t.characters).filter(e=>e.characters>=r?!1:(r=e.characters,!0))}let f=l.find(e=>e.matched===s.length);if(!f)return a();let p=Array.from({length:e.length},()=>``),m=f;for(let t=e.length-1;t>=0;t--)p[t]=m.choice,m=m.previous;let h=p.join(``);return ko(s,Fo(h,o),h,0)?a(p):a()}function gs(e,t,n){for(let r=0;r<n.length&&t<e.length;r++)n[r]===e[t]&&t++;return t}function _s(e){return{candidates:new Set,characters:0,maxCandidateLength:e.maxCandidateLength,maxCandidates:e.maxCandidates,maxCharacters:e.maxCharacters}}function vs(e,t,n){return n>=Za||t.remaining<=0||e.candidates.size>=e.maxCandidates||e.characters>=e.maxCharacters?!1:(t.remaining--,!0)}function ys(e,t,n,r,i){let a=0;for(let o of r){if(!vs(e,i,a))return;a++;let r=n.slice();r[o]=t[o].at(-1),ws(e,r)}}function bs(e,t,n,r,i){let a=0;for(let o=0;o<r.length;o++)for(let s=o+1;s<r.length;s++){if(!vs(e,i,a))return;a++;let c=r[o],l=r[s],u=n.slice();u[c]=t[c].at(-1),u[l]=t[l].at(-1),ws(e,u)}}function xs(e,t,n,r,i){let a=0;for(let o of r)for(let r=1;r<t[o].length-1;r++){if(!vs(e,i,a))return;a++;let s=n.slice();s[o]=t[o][r],ws(e,s)}}function Ss(e,t,n,r,i){let a=0;for(let o=0;o<r.length;o++)for(let s=o+1;s<r.length;s++){let c=r[o],l=r[s];for(let r=1;r<t[c].length;r++)for(let o=1;o<t[l].length;o++){if(r===t[c].length-1&&o===t[l].length-1)continue;if(!vs(e,i,a))return;a++;let s=n.slice();s[c]=t[c][r],s[l]=t[l][o],ws(e,s)}}}function Cs(e,t,n,r,i=!1){if(!t.length){vs(e,r,0)&&ws(e,[``]);return}let a=t.map(()=>0),o=t.flatMap((e,t)=>e.length>1?[t]:[]),s=()=>{let e=o.length-1;for(;e>=0;){let n=o[e];if(a[n]++,a[n]<t[n].length)return!0;a[n]=0,e--}return!1};if(i&&!s())return;let c=Math.min(n,Za);for(let n=0;n<c;n++){if(!vs(e,r,n))return;if(ws(e,t.map((e,t)=>e[a[t]])),!s())break}}function ws(e,t){let n=e.maxCharacters-e.characters,r=0;for(let i of t)if(r+=i.length,r>Math.min(e.maxCandidateLength,n))return;let i=t.join(``);e.candidates.has(i)||e.candidates.size===e.maxCandidates||e.characters+i.length>e.maxCharacters||(e.candidates.add(i),e.characters+=i.length)}function Ts(e,t,n=!0){let r=t,i=t,a=/[^\s>"'`;]/;for(;r&&a.test(e.charAt(r-1));)--r;for(;i<e.length&&a.test(e.charAt(i));)++i;if(n)return{content:e.slice(r,i),start:r,end:i};let o=Ps(e,t),s=o?.key.toLowerCase();if(o&&(s?.endsWith(`class`)||s?.endsWith(`classname`)))return r=Math.max(r,o.valueStart),{content:e.slice(r,i),start:r,end:i};let c=e.slice(0,r).trimEnd();if(/(?:^|[\s;{])@apply$/.test(c))return{content:e.slice(r,i),start:r,end:i}}const Es=new Set(`a abbr address area article aside audio b base bdi bdo blockquote body br button canvas caption cite code col colgroup data datalist dd del details dfn dialog div dl dt em embed fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins kbd label legend li link main map mark menu meta meter nav noscript object ol optgroup option output p picture pre progress q rp rt ruby s samp script search section select slot small source span strong style sub summary sup table tbody td template textarea tfoot th thead time title tr track u ul var video wbr svg`.split(` `)),Ds=new Set(`=([{,:;!?&|>~`);function Os(e){return e>=65&&e<=90||e>=97&&e<=122}function ks(e){return Os(e)||e===95}function As(e){return ks(e)||e>=48&&e<=57||e===36||e===45||e===46||e===58}function js(e,t,n){let r=t-n.length;return r<0||e.slice(r,t)!==n?!1:r===0||!As(e.charCodeAt(r-1))}function Ms(e,t,n,r){if(Es.has(n.toLowerCase())||n.includes(`-`)||r&&n.charCodeAt(0)>=65&&n.charCodeAt(0)<=90)return!0;let i=t-1;for(;i>=0&&/\s/.test(e.charAt(i));)i--;return i<0||Ds.has(e.charAt(i))?!0:js(e,i+1,`return`)}function Ns(e){let t,n=!1,r,i=0,a=0;for(;a<e.length;){if(t){let o=e.charAt(a);r?o===`\\`?a++:o===r&&(r=void 0):o===`"`||o===`'`?r=o:o===`{`?i++:o===`}`?i>0&&i--:o===`>`&&i===0&&(t=void 0,n=!0),a++;continue}if(e.charAt(a)===`;`&&(n=!1),e.charCodeAt(a)!==60){a++;continue}let o=a++;if(!ks(e.charCodeAt(a)))continue;let s=a;for(;a<e.length&&As(e.charCodeAt(a));)a++;if(a<e.length&&!/[\s/>]/.test(e.charAt(a)))continue;let c=e.slice(s,a);Ms(e,o,c,n)&&(t={name:c,start:o},i=0)}return t}function Ps(e,t){let n=e.substring(0,t),r=Ns(n);if(!r)return;let i=r.start+1,a=n.slice(i),o=-1,s=-1,c=-1,l=-1,u=-1,d=-1,f;for(let e=0;e<a.length;e++){let t=a.charAt(e);if(f){t===`\\`?e++:t===f&&(f=void 0);continue}if(t===`"`||t===`'`){f=t,o<0&&(o=e);continue}if(/\s/.test(t)){o>=0&&(s=o,c=e,o=-1);continue}if(t===`=`){let t=o>=0?o:s,n=o>=0?e:c;t>=0&&n>t&&t>=l&&(l=t,u=n,d=e)}o<0&&(o=e)}if(l<0)return;let p=d+1;for(;/\s/.test(a.charAt(p));)p++;let m=a.charAt(p);if(m===`"`||m===`'`){p++;for(let e=p;e<a.length;e++){let t=a.charAt(e);if(t===`\\`)e++;else if(t===m)return}}else if(/[\s>]/.test(a.slice(p)))return;return{key:a.slice(l,u),valueStart:i+p}}function Fs(e,t){return Ps(e,t)?.key}function Is(e,t){return Ps(e,t)}const Ls=1e3,Rs=6e5,zs=5e7,Bs=6e4,Vs=3e5,Hs=5e4,Us=2e5,Ws=5e3,Z={...ro,maxAttempts:15e3,maxCandidates:15e3,maxCharacters:6e5,maxScans:3e5};function Gs(){return{active:0,waiters:[]}}function Ks(e){return e>=48&&e<=57}function qs(e){for(let t=0;t<e.length;t++)if(Ks(e.charCodeAt(t)))return!0;return!1}function Js(e,t){let n=0,r=0;for(;n<e.length&&r<t.length;){let i=e.charCodeAt(n),a=t.charCodeAt(r),o=Ks(i),s=Ks(a);if(o&&s){let i=n+1,a=r+1;for(;i<e.length&&Ks(e.charCodeAt(i));)i++;for(;a<t.length&&Ks(t.charCodeAt(a));)a++;let o=n,s=r;for(;o<i-1&&e.charCodeAt(o)===48;)o++;for(;s<a-1&&t.charCodeAt(s)===48;)s++;let c=i-o,l=a-s;if(c!==l)return c<l?-1:1;for(;o<i;){let n=e.charCodeAt(o)-t.charCodeAt(s);if(n)return n<0?-1:1;o++,s++}n=i,r=a;continue}if(i!==a)return i<a?-1:1;n++,r++}return n!==e.length||r!==t.length?n===e.length?-1:1:0}function Ys(e,t){let n=qs(e);return n===qs(t)?Js(e,t)||(e===t?0:e<t?-1:1):n?1:-1}function Xs(e,t=Vs,n=zs){return{attempts:0,heap:[],limit:e,maxAttempts:t,maxScannedCharacters:n,retained:new Set,scannedCharacters:0}}function Zs(e){return e.attempts<e.maxAttempts&&e.scannedCharacters<e.maxScannedCharacters}function Qs(e,t){return Zs(e)?(e.attempts++,!t||e.retained.has(t)||t.length>Bs||t.length>e.maxScannedCharacters-e.scannedCharacters?!0:(e.scannedCharacters+=t.length,$s(e,t),!0)):!1}function $s(e,t){if(!(!t||e.retained.has(t)||t.length>Bs)){if(e.heap.length<e.limit){e.heap.push(t),e.retained.add(t),ec(e.heap,e.heap.length-1);return}Ys(t,e.heap[0])>=0||(e.retained.delete(e.heap[0]),e.heap[0]=t,e.retained.add(t),tc(e.heap,0))}}function ec(e,t){let n=t;for(;n>0;){let t=Math.floor((n-1)/2);if(Ys(e[t],e[n])>=0)return;[e[t],e[n]]=[e[n],e[t]],n=t}}function tc(e,t){let n=t;for(;;){let t=n*2+1;if(t>=e.length)return;let r=t+1,i=r<e.length&&Ys(e[r],e[t])>0?r:t;if(Ys(e[n],e[i])>=0)return;[e[n],e[i]]=[e[i],e[n]],n=i}}function nc(e){let t=[],n=0;for(let r of e.heap.sort(Ys))n+r.length>Rs||(t.push(r),n+=r.length);return t}function rc(e,t,n,r){return Math.floor((t+n)*e/r)-Math.floor(t*e/r)}function*ic(e){let t=e.filter(e=>e.length).map(e=>({index:0,source:e})),n=0;for(;t.length;){let e=t[n];yield e.source[e.index++],e.index===e.source.length?t.splice(n,1):n++,n===t.length&&(n=0)}}function*ac(e,t,n,r,i,a){for(;n.attempts<r&&n.characters<i;){let r=e.next();if(r.done)return;let o=r.value;n.attempts++,!(!o||t.has(o)||o.length>a||o.length>i-n.characters)&&(t.add(o),n.characters+=o.length,yield o)}}function oc(e){let t=``;for(let n of e.parts){if(n.type!==`static`)break;t+=n.value}return t}function sc(e,t){if(!t)return{priorityCount:0,templates:[...e]};let n=t.replace(/-/g,``),r=[],i=[];for(let a=0;a<e.length;a++){let o=e[a],s=oc(o),c=s.replace(/-/g,``),l=-1;s&&t.startsWith(s)?l=0:c&&n.startsWith(c)?l=1:s.startsWith(t)?l=2:c.startsWith(n)&&(l=3),l<0?i.push(o):r.push({category:l,index:a,parsed:o,prefixLength:l<2?l?c.length:s.length:0})}return r.sort((e,t)=>e.category-t.category||t.prefixLength-e.prefixLength||e.index-t.index),{priorityCount:r.length,templates:[...r.map(({parsed:e})=>e),...i]}}function cc(e,t){return e.length<=t?[...e]:t<=0?[]:t===1?[e[0]]:Array.from({length:t},(n,r)=>e[Math.floor(r*(e.length-1)/(t-1))])}async function lc(e,t,n){let r=Array(e.length),i=0,a=!1,o=Array.from({length:Math.min(t,e.length)},async()=>{for(;!a&&i<e.length;){let t=i++;try{r[t]=await n(e[t])}catch(e){throw a=!0,e}}});return await Promise.all(o),r}function uc(e,t=Ls){let n=Xs(t);for(let t of e)if(!Qs(n,t))break;return nc(n)}function dc(e,t){let n=[],r=new Set,i=0,a=0;for(let o of e)if(o.startsWith(t)){if(i===Vs||n.length===Ls||a>=Rs)break;i++,!(!o||r.has(o)||o.length>Bs||a+o.length>Rs)&&(r.add(o),n.push(o),a+=o.length)}return n}function fc(e,t={}){let n=new Map,r=new qa({max:Ws,maxSize:32e6,sizeCalculation:(e,t)=>Math.max(1,t.length*2+e.reduce((e,t)=>e+t.length*2+8,0))}),i=new Map,a=e.config,o=0,s=[],c,l,u=[],d=0,f=new Set,p=new Set,m=[],h=new Map,g=new Set,_=Gs(),{matchType:v=`prefix`,throwErrors:y=!0}=t;return te(),{suggest:S,suggestInFile:w,templates:m,cache:r,errorCache:i,reset:te,enumerate:b};async function b(){let e=Array.from(`abcdefghijklmnopqrstuvwxyz`),t=[...e,`-`],n=e.flatMap(e=>[e,...t.map(t=>`${e}${t}`)]);for(;;){z();let e=a,t=o,r=new Set;if(await x(n,r,e,t,e=>e)&&await x([...r].filter(e=>/^\w+$/.test(e)&&e.length>3),r,e,t,e=>`${e}-`))return r}}async function x(e,t,n,r,i){for(let a=0;a<e.length;a+=128){let o=await V(Promise.all(e.slice(a,a+128).map(e=>S(i(e)))),n,r);if(o.stale)return!1;for(let e of o.value)for(let n of e)t.add(n)}return!0}async function S(e,t=!1){if(z(),!t&&e.length<1)return[];if(r.has(e))return r.get(e);let n=h.get(e);if(n)return n;let i=C(e,t);h.set(e,i);try{return await i}finally{h.get(e)===i&&h.delete(e)}}async function C(t,n){for(;;){z();let i=a,s=o;if(!n&&t.length<1)return[];if(r.has(t))return r.get(t);let c=i.presets.find(e=>e.name===`@teacss/preset-attributify`)?.options?.prefix,l=c?t.startsWith(c)?t.slice(c.length):t.replace(`:${c}`,`:`):t,u=await V(e.matchVariants(l),i,s);if(u.stale)continue;let d=await V(Promise.all(u.value.map(async([,e])=>{if(!e&&l)return[];let n=e?t.indexOf(e):t.length;n===-1&&(n=0);let r=t.slice(0,n),a=t.slice(n+e.length),o=v===`fuzzy`?[E(e,i,s),k(e,i,s),O(e),D(e)]:[E(e,i,s),D(e),O(e),k(e,i,s)];return H(await Promise.all(o),r,a)})),i,s);if(d.stale)continue;let f=d.value.flat();if(f=v===`fuzzy`?P(Eo(f,t,{maxCandidates:Z.maxCandidates,maxCharacters:Z.maxCharacters}),t):uc(f),!B(i,s))return r.set(t,f),f}}async function w(e,t){z();let n=a,r=o,i=Fs(e,t)!==void 0,s=await V(T(e,t,n),n,r);if(s.stale)return w(e,t);let c=s.value;if(c){let a=await S(c.extracted,i);if(B(n,r))return w(e,t);let o=c.transformSuggestions?c.transformSuggestions(a):a;return{suggestions:a.map((e,t)=>[e,o[t]]),resolveReplacement:c.resolveReplacement}}let l=Ts(e,t,n.presets.some(e=>e.name===`@teacss/preset-attributify`));if(!l)return;let u=await S(l.content,i);return B(n,r)?w(e,t):{suggestions:u.map(e=>[e,e]),resolveReplacement:e=>({start:l.start,end:l.end,replacement:e})}}async function T(e,t,n){if(!n.autocomplete.extractors.length)return null;for(let r of n.autocomplete.extractors){let n=await r.extract({content:e,cursor:t});if(n)return n}return null}async function E(t,n,r){let i=await e.parseToken(t,`-`);return i&&!B(n,r)&&(p.delete(t),p.add(t),p.size>Ws&&p.delete(p.values().next().value)),i?[t]:[]}async function D(e){if(v===`fuzzy`){let t=F(),n=P(u,e,t,d),r=Eo(I(),e,{maxAttempts:Vs,maxCandidates:750,maxCharacters:6e4});return Eo([...n,...r],e,{maxCandidates:Ls,maxCharacters:Z.maxCharacters})}return c??=[...s].sort(Ys),dc(c,e)}async function O(t){return uc(n());function*n(){for(let e of p)e.startsWith(t)&&(yield e);for(let[n,r]of e.cache){if(!r)continue;let e=n.replace(/ -$/,``);e.startsWith(t)&&(yield e)}}}async function k(e,t,n){let r=m.filter(e=>typeof e==`function`);if(v!==`fuzzy`){let i=L(e),a=await A(r,e,t,n);return[...i,...a]}let i=R(e),a=await ee(r,e,t,n);return[...i,...a]}async function A(e,t,n,r){if(!e.length)return[];let i=Xs(Ls),a=Xs(Ls);for(let o=0;o<e.length;o+=8){let s=await lc(e.slice(o,o+8),8,e=>j(e,t,n,r));if(B(n,r))return[];let c=rc(Vs,o,s.length,e.length),l=rc(zs,o,s.length,e.length),u=Xs(Ls,c,l),d=ic(s.filter(e=>!!e?.length));for(;Zs(u);){let e=d.next();if(e.done)break;Qs(u,e.value)}for(let e of nc(u))$s(i,e);let f=Xs(Ls,c,l);for(;Zs(f);){let e=d.next();if(e.done)break;Qs(f,e.value)}for(let e of nc(f))$s(i,e);for(;Zs(a);){let e=d.next();if(e.done)break;Qs(a,e.value)}}for(let e of nc(a))$s(i,e);return nc(i)}async function ee(e,t,n,r){if(!e.length)return[];let i=[],a=new Set,o={attempts:0,characters:0};for(let s=0;s<e.length;s+=32){let c=await lc(e.slice(s,s+32),32,e=>j(e,t,n,r));if(B(n,r))return[];let l=ic(c.filter(e=>!!e?.length)),u=rc(Vs,s,c.length,e.length),d=rc(ro.maxScannedCharacters,s,c.length,e.length),f=Eo(l,t,{maxAttempts:u,maxCandidates:Ls,maxCharacters:Z.maxCharacters,maxScannedCharacters:d});i=Eo([...i,...f],t,{maxAttempts:i.length+f.length,maxCandidates:Ls,maxCharacters:Z.maxCharacters});let p=Eo(ac(l,a,{attempts:0,characters:0},u,d,ro.maxCandidateLength),t,{maxAttempts:u,maxCandidates:750,maxCharacters:Z.maxCharacters,maxScannedCharacters:d});i=Eo([...i,...p],t,{maxAttempts:i.length+p.length,maxCandidates:Ls,maxCharacters:Z.maxCharacters});let m=Eo(ac(l,a,{attempts:0,characters:0},u,d,ro.maxCandidateLength),t,{maxAttempts:u,maxCandidates:750,maxCharacters:Z.maxCharacters,maxScannedCharacters:d});i=Eo([...i,...m],t,{maxAttempts:i.length+m.length,maxCandidates:Ls,maxCharacters:Z.maxCharacters});let h=Eo(ac(l,a,o,Vs,ro.maxScannedCharacters,ro.maxCandidateLength),t,{maxAttempts:Vs-o.attempts,maxCandidates:750,maxCharacters:Z.maxCharacters,maxScannedCharacters:ro.maxScannedCharacters-o.characters});i=Eo([...i,...h],t,{maxAttempts:i.length+h.length,maxCandidates:Ls,maxCharacters:Z.maxCharacters})}return i}async function j(e,t,n,r){let i=_;await M(i);try{if(B(n,r))return;try{return await e(t)}catch{return}}finally{N(i)}}async function M(e){if(e.active<128){e.active++;return}await new Promise(t=>e.waiters.push(t))}function N(e){let t=e.waiters.shift();t?t():e.active--}function P(e,t,n,r){return Oo(t,r??e.reduce((e,t)=>e+t.length,0))?Eo(e,t,{maxCandidates:Ls,maxCharacters:Z.maxCharacters}):(n??new Fa(e,{fuzzy:`v1`,limit:Ls,tiebreakers:[Pa,Na]})).find(t).map(e=>e.item)}function F(){if(l)return l;let e=new Set,t=0,n=0,r=n=>!n||e.has(n)||n.length>Z.maxCandidateLength||e.size===Z.maxCandidates||t+n.length>Z.maxCharacters?!1:(e.add(n),t+=n.length,!0),i=0;for(;i<s.length&&n<Z.maxAttempts&&e.size<Z.maxCandidates&&t<Z.maxCharacters;){let e=s[i++];n++,r(e)&&f.add(e)}return u=[...e],d=t,l=new Fa(u,{fuzzy:`v1`,limit:Ls,tiebreakers:[Pa,Na]}),l}function*I(){for(let e of s)f.has(e)||(yield e)}function L(e){let t=Xs(Ls),r=0,i=0,a=0,o=sc([...n.values()],e).templates.slice(0,Hs);for(let n=0;n<o.length;n++){let s=Vs-r,c=zs-i,l=Us-a;if(c<=0||s<=0||l<=0||!Zs(t))break;let u=o.length-n,d=Math.max(1,Math.floor(s/u)),f=lo(o[n],e,{maxAttempts:d,maxCandidateLength:Bs,maxCandidates:d,maxCharacters:Math.max(1,Math.floor(c/u)),maxScans:Math.max(1,Math.floor(l/u))});r+=f.attempts,i+=f.characters,a+=f.scans;for(let e of f.suggestions)if(!Qs(t,e))break}return nc(t)}function R(e){let t=[],r=new Set,i=0,a=0,o=0,s=0,c=sc([...n.values()],e).templates.slice(0,Hs),l=e=>{!e||r.has(e)||e.length>ro.maxCandidateLength||o>=Z.maxCandidates||i+e.length>Z.maxCharacters||(r.add(e),t.push(e),o++,i+=e.length)},u=0;for(let t of Eo(f(),e,{maxAttempts:Hs,maxCandidates:750,maxCharacters:Z.maxCharacters}))l(t);let d=cc(c,Math.max(1,Math.floor(Math.min(Z.maxAttempts,Z.maxCandidates-o)/2)));for(let t=0;t<d.length;t++){let n=Z.maxAttempts-a,r=Z.maxCandidates-o,c=Z.maxCharacters-i,u=Z.maxScans-s;if(n<=0||r<=0||c<=0||u<=0)break;let f=d.length-t,p={maxAttempts:Math.max(2,Math.floor(n/f)),maxCandidates:Math.max(2,Math.floor(r/f)),maxCharacters:Math.max(1,Math.floor(c/f)),maxScans:Math.max(1,Math.floor(u/f))},m;if(e.length<=1){let n=lo(d[t],e,p);m=n.suggestions,a+=n.attempts,s+=n.scans}else{let n=ps(d[t].parts,p,e);m=n.candidates,a+=n.attempts,s+=n.scans}for(let e of m)l(e)}return Eo(t,e,{maxAttempts:Z.maxAttempts,maxCandidates:750,maxCharacters:Z.maxCharacters});function*f(){for(let t=0;t<c.length;t++){let n=Us-u;if(n<=0)return;let r=c.length-t,i=(e.length<=1?lo:co)(c[t],e,{maxAttempts:1,maxCandidates:1,maxCharacters:ro.maxCandidateLength,maxScans:Math.max(1,Math.floor(n/r))});u+=i.scans,yield*i.suggestions}}}function te(){let t=e.config,v=[...Object.keys(t.rulesStaticMap),...t.shortcuts.filter(e=>typeof e[0]==`string`).map(e=>e[0])],b=[...t.autocomplete.templates||[],...t.rulesDynamic.flatMap(e=>ye(e?.[2]?.autocomplete||[])),...t.shortcuts.flatMap(e=>ye(e?.[2]?.autocomplete||[])),...t.variants.flatMap(e=>ye(e.autocomplete||[]))],x=new Map,S=new Map;for(let e of b)if(typeof e!=`function`){if(x.has(e)||S.has(e))continue;let n=bo(e,t.theme,t.autocomplete.shorthands);n.errors.length&&S.set(e,n.errors),x.set(e,n)}if(S.size&&y){i.clear();for(let[e,t]of S)i.set(e,t);let e=Array.from(S.values()).flat().map(e=>e.toString()).join(`
|
|
27
27
|
`);throw Error(e)}o++;for(let e of[...g])e();a=t,s=v,c=void 0,m.length=0,m.push(...b),n.clear();for(let[e,t]of x)n.set(e,t);r.clear(),h.clear(),_=Gs(),i.clear();for(let[e,t]of S)i.set(e,t);l=void 0,u=[],d=0,f.clear(),p.clear()}function z(){a!==e.config&&te()}function B(t,n){return t!==e.config||n!==o}function V(t,n,r){return new Promise((i,a)=>{let o=!1,s=e=>{o||(o=!0,l(),g.delete(c),i(e))},c=()=>s({stale:!0}),l=e.events.on(`config`,e=>{e!==n&&c()});g.add(c),Promise.resolve(t).then(e=>s({stale:!1,value:e}),e=>{o||(o=!0,l(),g.delete(c),a(e))}),B(n,r)&&c()})}function H(t,n=``,r=``){let i=be(t.flat()).filter(t=>!(!t||t.endsWith(`-`)||e.isBlocked(t)||e.isBlocked(n+t+r)));v!==`fuzzy`&&i.sort(Ys);let a=i.map(e=>n+e+r);return v===`fuzzy`?a:uc(a)}}function pc(e,t){let n=e[t];for(let r=t+1;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===n)return r+1;return e.length}function mc(e,t){if(e[t]===`"`||e[t]===`'`||e[t]==="`")return pc(e,t);if(e[t]!==`{`){let n=t;for(;n<e.length&&!/[\s>]/.test(e[n]);)n++;return n}let n=1;for(let r=t+1;r<e.length;r++){let t=e[r];if(t===`"`||t===`'`||t==="`")r=pc(e,r)-1;else if(e.startsWith(`/*`,r)){let t=e.indexOf(`*/`,r+2);if(t<0)return e.length;r=t+1}else if(e.startsWith(`//`,r)){let t=e.indexOf(`
|
|
28
|
-
`,r+2);if(t<0)return e.length;r=t}else if(t===`{`)n++;else if(t===`}`&&--n===0)return r+1}return e.length}function hc(e){let t=[],n=/(?:^|\s)((?::|v-bind:)?(?:data-css-(?:primary|neutral|success|warning|failure|general|focused|scheme|group|peer)|lang))\s*=\s*/gi;for(let r=n.exec(e);r;r=n.exec(e)){let i=r.index+r[0].length;if(Fs(e,i)?.toLowerCase()!==r[1].toLowerCase())continue;let a=mc(e,i);t.push([i,a]),n.lastIndex=Math.max(i,a)}return t}function gc(e,t){return hc(e).some(([e,n])=>t>=e&&t<=n)}const _c=/([\\:]?[\s"'`;<>]|:\(|\)"|\)\s)/g,vc=/(?:[\w&:[\]-]|\[\S{1,64}=\S{1,64}\]){1,64}\[\\?['"]?\S{0,64}?['"]\]\]?[\w:@-]{0,64}/g,yc=/\[(\\\W|[\w-]){1,64}:[^\s:]{0,64}?("\S{1,64}?"|'\S{1,64}?'|`\S{1,64}?`|[^\s:]{1,64}?)[^\s:]{0,64}?\)?\]/g;async function bc(e,t,n=``){let r=e.config.extractors?.find(e=>e.name===`pug`);if(!r)return{pug:!1,code:``};let i={code:t,id:n};await r.extract?.(i);let a=i.code.startsWith(t)?i.code.substring(t.length+2):i.code;return i.code===t?{pug:!1,code:``}:{pug:!0,code:a}}function xc(e,t,n){let r=[];t.has(e)&&r.push([n,n+e.length,e]);let i=new Set;for(let a of e.matchAll(/\.([^.#=\s(]+)(?=[.#=\s(]|$)/g)){let e=a[1];if(e.includes(`:`)||i.has(e)||!t.has(e))continue;i.add(e);let o=n+a.index+1;r.push([o,o+e.length,e])}return r}function Sc(e,t){let n=e.flags.includes(`g`)?e.flags:`${e.flags}g`;return t.matchAll(new RegExp(e.source,n))}function Cc(e,t){let n=t.map(([t,n])=>[Math.max(0,t),Math.min(e.length,n)]).filter(([e,t])=>t>e).sort((e,t)=>e[0]-t[0]||e[1]-t[1]);if(!n.length)return e;let r=[];for(let[e,t]of n){let n=r.at(-1);n&&e<=n[1]?n[1]=Math.max(n[1],t):r.push([e,t])}let i=[],a=0;for(let[t,n]of r)i.push(e.slice(a,t),` `.repeat(n-t)),a=n;return i.push(e.slice(a)),i.join(``)}function wc(e){let t=[...e].sort((e,t)=>e[0]-t[0]||t[1]-e[1]),n=[],r=[],i=-1;for(let[e,a]of t)n.push(e),i=Math.max(i,a),r.push(i);return{starts:n,maxEnds:r}}function Tc(e,t,n){let r=0,i=e.starts.length;for(;r<i;){let n=r+i>>>1;e.starts[n]<=t?r=n+1:i=n}return r>0&&e.maxEnds[r-1]>=n}function Ec(e){return e===void 0||/[\s'"`;<>]/.test(e)}function Dc(e,t){if(!t.size)return[];let n={children:new Map};for(let e of t){let t=n;for(let n=0;n<e.length;n++){let r=e[n],i=t.children.get(r);i||(i={children:new Map},t.children.set(r,i)),t=i}t.value=e}let r=[];for(let t=0;t<e.length;t++){if(!Ec(e[t-1]))continue;let i=n;for(let n=t;n<e.length;n++){let a=i.children.get(e[n]);if(!a)break;i=a,i.value&&Ec(e[n+1])&&r.push([t,n+1,i.value])}}return r}function Oc(e,t,n){for(let r=t+1;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===n)return r;return-1}function kc(e,t,n){if(!n)return[];let r=[],i=RegExp(`(^|[^\\w:-])${On(t)}\\s*=\\s*(['"])`,`g`);for(let t of e.matchAll(i)){let i=t.index+t[0].length-1,a=Oc(e,i,t[2]);if(!(a<0))for(let t=e.indexOf(n,i+1);t>=0&&t+n.length<=a;t=e.indexOf(n,t+n.length)){let o=t===i+1||/\s/.test(e[t-1]),s=t+n.length===a||/\s/.test(e[t+n.length]);o&&s&&r.push(t)}}return r}function Ac(e,t){let n=0,r=0,i=!1;for(let a=t+1;a<e.length;a++){let t=e[a];if(t===`(`){if(n===0&&r===0&&!i)return-1;n++}else if(t===`)`)n>0&&n--;else if(t===`[`)r++;else if(t===`]`)r>0&&r--;else if((t===`:`||t===`;`)&&n===0&&r===0)i=!0;else if(t===`}`&&n===0&&r===0)return a}return-1}function jc(e,t){let n=t;if(e[n]===`!`&&n++,e[n]!==`@`)return{suffix:e.slice(t,n),end:n};let r=0,i=0;for(;n<e.length;n++){let t=e[n];if(t===`(`)r++;else if(t===`)`)r>0&&r--;else if(t===`[`)i++;else if(t===`]`)i>0&&i--;else if((/\s/.test(t)||t===`"`||t===`'`||t==="`"||t===`{`||t===`}`)&&r===0&&i===0)break}return{suffix:e.slice(t,n),end:n}}function Mc(e){let t=[],n=0,r=0,i=0;for(let a=0;a<e.length;a++){let o=e[a];o===`(`?n++:o===`)`?n>0&&n--:o===`[`?r++:o===`]`?r>0&&r--:o===`;`&&n===0&&r===0&&(t.push(e.slice(i,a).trim()),i=a+1)}return t.push(e.slice(i).trim()),t.filter(Boolean)}function Nc(e,t,n){let r=Ac(e,t);if(r<0)return null;let i=Mc(e.slice(t+1,r));if(!i.length)return null;let{suffix:a,end:o}=jc(e,r+1);return i.every(e=>n.has(e)||n.has(`${e}${a}`))?[t,o,e.slice(t,o)]:null}function Pc(e,t,n=[],r={}){let i=[],a=[],o=new Set,s=new Set,c=[],l=hc(e);if(e=Cc(e,l),r.excludeRanges&&(e=Cc(e,r.excludeRanges)),r.excludeRegex)for(let t of r.excludeRegex){let n=Array.from(Sc(t,e),e=>[e.index,e.index+e[0].length]);e=Cc(e,n)}if(r.includeRegex)for(let t of r.includeRegex)for(let n of Sc(t,e))c.push([n.index,n.index+n[0].length]);else c.push([0,e.length]);let u=wc(c);Array.from(t).forEach(e=>{let t=vr(e);t?t[2]?a.push(t):(/[><()]|\[\\?['"`]/.test(t[1])&&s.add(t[1]),o.add(t[1])):(/[><()]|\[\\?['"`]/.test(e)&&s.add(e),o.add(e))}),i.push(...Dc(e,s));let d=0;e.split(_c).forEach(e=>{let t=d+e.length;r.isPug?i.push(...xc(e,o,d)):o.has(e)&&i.push([d,t,e]),d=t});for(let t of e.matchAll(vc)){let e=t.index,n=e+t[0].length;o.has(t[0])&&i.push([e,n,t[0]])}let f=new Set(i.map(([e,t])=>`${e}:${t}`));for(let t of e.matchAll(yc)){let e=t.index,n=e+t[0].length;if(o.has(t[0])){let r=`${e}:${n}`;f.has(r)||(f.add(r),i.push([e,n,t[0]]))}}a.forEach(([,t,n])=>{for(let r of kc(e,t,n)){let e=r+n.length;i.push([r,e,`[${t}="${n}"]`])}});for(let t=e.indexOf(`{`);t>=0;t=e.indexOf(`{`,t+1)){let n=Nc(e,t,o);if(!n)continue;let[r,a]=n;for(let e=i.length-1;e>=0;e--){let[t,n]=i[e];t>=r&&n<=a&&i.splice(e,1)}i.some(([e,t])=>e===r&&t===a)||i.push(n)}i.push(...n.map(e=>[e.offset,e.offset+e.length,e.className]));let p=new Set;return i.filter(([e,t])=>!l.some(([n,r])=>e<r&&t>n)).filter(([e,t])=>Tc(u,e,t)).filter(([e,t,n])=>{let r=`${e}:${t}:${n}`;return!p.has(r)&&(p.add(r),!0)}).sort((e,t)=>e[0]-t[0])}const Fc=[`@teacss/directives`,`@teacss/transformer-compile-class`];async function Ic(e,t,n=``,r={}){let i=new c(t),a={generator:e,tokens:new Set},o=e.config.transformers?.filter(e=>!Fc.includes(e.name)),s=[];for(let e of[`pre`,`default`,`post`])for(let t of o?.filter(t=>(t.enforce??`default`)===e)||[]){let e=(await t.transform(i,n,a))?.highlightAnnotations;e&&s.push(...e)}let{pug:l,code:u}=await bc(e,i.toString(),n);return Pc(t,[...(await e.generate(l?u:i.toString(),{preflights:!1,safelist:!1})).matched],s,{isPug:l,...r})}function Lc(e,t,n,r){if(!(r<1)){if(e.delete(t),e.size>=r){let t=e.keys().next();t.done||e.delete(t.value)}e.set(t,n)}}function Rc(e,t,n,r){let i=e.get(t);if(i)return Lc(e,t,i,n),i;let a;return a=r().catch(n=>{throw e.get(t)===a&&e.delete(t),n}),Lc(e,t,a,n),a}const zc=new Map;function Bc(e){zc.delete(e)}function Vc(){zc.clear()}function Hc(e,t,n,r=!1,i=!1){i&&zc.delete(n);let a=zc.get(n);if(a&&a.code===t&&a.config===e.config&&a.generator===e&&a.strictAnnotationMatch===r)return Lc(zc,n,a,100),a.result;let o=Ic(e,t,n,{excludeRanges:Vi(t,n),excludeRegex:Ui,...r?{includeRegex:Hi}:null});return Lc(zc,n,{code:t,config:e.config,generator:e,strictAnnotationMatch:r,result:o},100),o}function Uc(e){try{return k(e)}catch{try{let t=new URL(e);return t.protocol===`file:`?e:decodeURIComponent(t.pathname.replace(/^\/([a-z]:)/i,`$1`))}catch{return e}}}const Wc=/<style[^>]*>[\s\S]*?(?:<\/style>|<\/>|$)/g,Gc=/(?:<\/style>|<\/>)$/,Kc=/<template\b[^>]*\slang\s*=\s*(?:'pug'|"pug")[^>]*>/i;function qc(e,t,n){let r=t.match(/\.(svelte|vue|astro|marko)$/);if(r&&Jc(e,t)){let t=e.slice(0,n);if(/\.$/.test(t)||/\.\S+$/.test(t))return!0}if((r?[...e.matchAll(Wc)].some(t=>{let r=t.index,i=r+t[0].length,a=i===e.length&&!Gc.test(t[0]);return n>r&&(n<i||a&&n===i)}):/\.(?:css|scss|sass|less|styl(?:us)?|pcss|postcss)$/i.test(t))||Fs(e,n)!==void 0)return!0;let i=e.slice(n).replace(/"[^"]*"|\{[^}]*\}|'[^']*'/g,``);return/^[^<>]*>/.test(i)}function Jc(e,t){return t.endsWith(`.vue`)&&Kc.test(e)}function Yc(e,t){let n=p.relative(e,t);return n!==``&&n!==`..`&&!n.startsWith(`..${p.sep}`)&&!p.isAbsolute(n)}const Xc={log(){},warn(){}},Zc=/[\\/](?:node_modules|dist|\.temp|\.cache)[\\/]/;var Qc=class{cwd;logger;ready;contextsMap=new Map;configSources=[];fileContextCache=new Map;configExistsCache=new Map;loadingContexts=new Map;contextLoadVersions=new Map;contextReloadDisposers=new Map;failedConfigSources=new Map;discoveredConfigs=new Set;yarnPnpSetupFailures=new Set;lifecycleVersion=0;workspaceRoots;events=hr();constructor(e,t=Xc,n=[e]){this.cwd=e,this.logger=t,this.workspaceRoots=Array.from(new Set(n.length?n:[e])),this.ready=this.reload()}log(e){this.logger.log(e)}warn(e){this.logger.warn(e)}isTarget(e){return Array.from(this.contextsMap.keys()).some(t=>Yc(t,e))}get contexts(){return Array.from(new Set(this.contextsMap.values())).filter(br)}async setRoots(e){let t=Array.from(new Set(e)),n=Array.from(this.contextsMap.keys()),r=this.workspaceRoots.length===t.length&&t.every(e=>this.workspaceRoots.includes(e)),i=n.length===t.length&&t.every(e=>n.includes(e));if(r&&i)return;let a=++this.lifecycleVersion;this.workspaceRoots=t;for(let e of n)t.includes(e)||this.removeContext(e,`contextUnload`,!0);a===this.lifecycleVersion&&(this.resetCaches(),await this.loadRoots(t.filter(e=>!n.includes(e)),a),a===this.lifecycleVersion&&this.events.emit(`reload`))}async reload(){let e=++this.lifecycleVersion,t=Array.from(this.contextsMap.keys()),n=t.length?t:this.workspaceRoots;for(let e of t)this.removeContext(e,`contextUnload`,!1);e===this.lifecycleVersion&&(this.resetCaches(),await this.loadRoots(n,e),e===this.lifecycleVersion&&this.events.emit(`reload`))}async unloadContext(e){this.removeContext(e,`contextUnload`,!0)}async unload(e){this.removeContext(e,`unload`,!0)}removeContext(e,t,n){n&&(this.contextLoadVersions.set(e,(this.contextLoadVersions.get(e)??0)+1),this.loadingContexts.delete(e));let r=this.contextsMap.get(e);r!==void 0&&(this.contextsMap.delete(e),this.failedConfigSources.delete(e),this.syncConfigSources(),r&&(this.disposeContextReload(r),this.clearFileContextCache(r),this.events.emit(t,r),t===`contextUnload`&&this.events.emit(`reload`)))}syncConfigSources(){let e=this.contexts.flatMap(e=>e.getConfigFileList()),t=Array.from(this.failedConfigSources.values()).flat(),n=Array.from(new Set([...e,...t]));this.configSources.splice(0,this.configSources.length,...n)}clearFileContextCache(e){for(let[t,n]of this.fileContextCache)n===e&&this.fileContextCache.delete(t)}resetCaches(){this.fileContextCache.clear(),this.configExistsCache.clear()}releaseDocument(e){this.fileContextCache.delete(e),this.invalidateConfigSearchPath(e)}invalidateConfigSearchPath(e){let t=p.dirname(e),n=this.getWorkspaceBoundary(t);if(n)for(;t===n||Yc(n,t);){if(this.configExistsCache.delete(t),t===n)return;t=p.dirname(t)}}async loadRoots(e,t){let n=e.map(e=>({dir:e,loadVersion:this.contextLoadVersions.get(e)??0}));await Promise.all(n.map(async({dir:e,loadVersion:n})=>{try{await this.loadContextInDirectoryWithVersion(e,t,n)}catch(n){if(t!==this.lifecycleVersion)return;this.warn(`⚠️ Failed to reload context for ${e}: ${String(n.stack??n)}`)}}))}async loadContextInDirectory(e){return this.loadContextInDirectoryWithVersion(e,void 0,this.contextLoadVersions.get(e)??0)}async loadContextInDirectoryWithVersion(e,t,n){if(!this.isLoadCurrent(e,t,n))return;let r=this.contextsMap.get(e);if(r!==void 0)return r;let i=this.loadingContexts.get(e);if(i&&i.lifecycleVersion===t&&i.loadVersion===n)return i.promise;let a=this.loadContext(e,t,n);this.loadingContexts.set(e,{lifecycleVersion:t,loadVersion:n,promise:a});try{return await a}finally{this.loadingContexts.get(e)?.promise===a&&this.loadingContexts.delete(e)}}async loadContext(e,t,n){this.setupYarnPnp(e),this.discoveredConfigs.has(e)||this.log(`🛠 Resolving config for ${e}`);let r=D(e,{},e=>{e.config.details=!0}),i=[];try{i=(await r.updateRoot(e)).sources}catch(i){return this.isLoadCurrent(e,t,n)?(this.warn(`⚠️ Error on loading config. Config directory: ${e}`),this.warn(String(i.stack??i)),this.failedConfigSources.set(e,r.getConfigFileList()),this.finishLoading(e,null,t,n)):void 0}if(!this.isLoadCurrent(e,t,n))return;if(this.failedConfigSources.delete(e),!i.length)return this.log(`ℹ️ No config sources found in ${e}`),this.finishLoading(e,null,t,n);if(await r.ready,!this.isLoadCurrent(e,t,n))return;this.setupContextReload(r),this.logConfigInfo(i,r.generator);let a=this.finishLoading(e,r,t,n);return this.events.emit(`contextLoaded`,r),a}setupYarnPnp(e){for(let t of[`.pnp.js`,`.pnp.cjs`]){let n=p.join(e,t);if(f(n))try{he(n).setup(),this.yarnPnpSetupFailures.delete(n)}catch(e){if(this.yarnPnpSetupFailures.has(n))continue;this.yarnPnpSetupFailures.add(n);let t=e instanceof Error?e.message:String(e);this.warn(`⚠️ Failed to setup Yarn PnP from ${n}: ${t}`)}}}setupContextReload(e){this.disposeContextReload(e);let t=e.onReload(()=>{for(let[t,n]of this.fileContextCache)(n===e||!n)&&this.fileContextCache.delete(t);this.configExistsCache.clear(),this.syncConfigSources(),this.events.emit(`contextReload`,e)});this.contextReloadDisposers.set(e,t);for(let[e,t]of this.fileContextCache)t||this.fileContextCache.delete(e)}disposeContextReload(e){this.contextReloadDisposers.get(e)?.(),this.contextReloadDisposers.delete(e)}isLoadCurrent(e,t,n){return(t===void 0||t===this.lifecycleVersion)&&n===(this.contextLoadVersions.get(e)??0)}logConfigInfo(e,t){let n=e.length===1?e[0]:`\n${e.map(e=>` - ${e}`).join(`
|
|
29
|
-
`)}`;this.log(`🛠 New configuration loaded from ${n}`),this.log(`ℹ️ ${t.config.presets.length} presets, ${t.config.rulesSize} rules, ${t.config.shortcuts.length} shortcuts, ${t.config.variants.length} variants, ${t.config.transformers?.length||0} transformers loaded`)}finishLoading(e,t,n,r){if(!this.isLoadCurrent(e,n,r))return;this.contextsMap.has(e)||this.contextsMap.set(e,t),this.syncConfigSources(),this.fileContextCache.clear(),this.events.emit(`reload`);let i=Array.from(this.contextsMap.entries()).filter(([,e])=>e).map(([e])=>e).join(`, `)||`[none]`;return this.log(`🗂️ Enabled context: ${i}`),t}async resolveClosestContext(e,t){if(Zc.test(t))return;if(this.fileContextCache.has(t)){let e=this.fileContextCache.get(t);return Lc(this.fileContextCache,t,e,100),e}let n=await this.discoverAndLoadConfig(t);if(n)return n;let r=Array.from(this.contextsMap.entries()).sort((e,t)=>t[0].length-e[0].length);for(let[n,i]of r)if(i&&Yc(n,t)&&(i.filter(e,t)||An(t)))return Lc(this.fileContextCache,t,i,100),i;for(let[e,n]of r)if(n&&Yc(e,t))return Lc(this.fileContextCache,t,n,100),n}async discoverAndLoadConfig(e){let t=this.lifecycleVersion,n=await this.findConfigDirectory(p.dirname(e),t);if(t!==this.lifecycleVersion||!n||this.contextsMap.has(n))return;this.discoveredConfigs.has(n)||(this.log(`🔍 Discovered config in ${n}`),this.discoveredConfigs.add(n));let r=this.contextLoadVersions.get(n)??0;if(await this.loadContextInDirectoryWithVersion(n,t,r),!this.isLoadCurrent(n,t,r))return;let i=this.contextsMap.get(n);return i&&Lc(this.fileContextCache,e,i,100),i}async findConfigDirectory(e,t){let n=this.configExistsCache.get(e);if(n!==void 0)return Lc(this.configExistsCache,e,n,100),n||void 0;let r=this.getWorkspaceBoundary(e);if(!r)return;let i=p.parse(e).root,a=[],o=e;for(;o!==i&&(Yc(r,o)||o===r);){a.push(o);let e=this.configExistsCache.get(o);if(e!==void 0)return Lc(this.configExistsCache,o,e,100),this.cacheSearchPath(a,e||!1),e||void 0;let n=await this.hasConfigFiles(o);if(t!==this.lifecycleVersion)return;if(n)return this.cacheSearchPath(a,o),o;o=p.dirname(o)}this.cacheSearchPath(a,!1)}getWorkspaceBoundary(e){return[...this.workspaceRoots,...this.contextsMap.keys()].filter(t=>t===e||Yc(t,e)).sort((e,t)=>t.length-e.length)[0]}async hasConfigFiles(e){return!!x(e)}cacheSearchPath(e,t){for(let n of e)Lc(this.configExistsCache,n,t,100)}};const $c=/^[A-Za-z]:\//;function el(e=``){return e&&e.replace(/\\/g,`/`).replace($c,e=>e.toUpperCase())}const tl=/^[/\\]{2}/,nl=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,rl=/^[A-Za-z]:$/,il=function(e){if(e.length===0)return`.`;e=el(e);let t=e.match(tl),n=ll(e),r=e[e.length-1]===`/`;return e=cl(e,!n),e.length===0?n?`/`:r?`./`:`.`:(r&&(e+=`/`),rl.test(e)&&(e+=`/`),t?n?`//${e}`:`//./${e}`:n&&!ll(e)?`/${e}`:e)},al=function(...e){let t=``;for(let n of e)if(n){if(t.length>0){let e=t[t.length-1]===`/`,r=n[0]===`/`;t+=e&&r?n.slice(1):e||r?n:`/${n}`}else t+=n}return il(t)};function ol(){return typeof process<`u`&&typeof process.cwd==`function`?process.cwd().replace(/\\/g,`/`):`/`}const sl=function(...e){e=e.map(e=>el(e));let t=``,n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:ol();i&&i.length!==0&&(t=`${i}/${t}`,n=ll(i))}return t=cl(t,!n),n&&!ll(t)?`/${t}`:t.length>0?t:`.`};function cl(e,t){let n=``,r=0,i=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else if(o===`/`)break;else o=`/`;if(o===`/`){if(i!==s-1&&a!==1){if(a===2){if(n.length<2||r!==2||n[n.length-1]!==`.`||n[n.length-2]!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}if(n.length>0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1}i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}const ll=function(e){return nl.test(e)};var ul=fe(((e,t)=>{let n=`[^\\\\/]`,r=`[^/]`,i=`(?:\\/|$)`,a=`(?:^|\\/)`,o=`\\.{1,2}${i}`,s={DOT_LITERAL:`\\.`,PLUS_LITERAL:`\\+`,QMARK_LITERAL:`\\?`,SLASH_LITERAL:`\\/`,ONE_CHAR:`(?=.)`,QMARK:r,END_ANCHOR:i,DOTS_SLASH:o,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!${a}${o})`,NO_DOT_SLASH:`(?!\\.{0,1}${i})`,NO_DOTS_SLASH:`(?!${o})`,QMARK_NO_DOT:`[^.\\/]`,STAR:`${r}*?`,START_ANCHOR:a,SEP:`/`},c={...s,SLASH_LITERAL:`[\\\\/]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`\\.{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!\\.{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!\\.{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:`[^.\\\\/]`,START_ANCHOR:`(?:^|[\\\\/])`,END_ANCHOR:`(?:[\\\\/]|$)`,SEP:`\\`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{__proto__:null,alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?c:s}}})),dl=fe((e=>{let{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=ul();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,`\\$1`),e.toPosixSlashes=e=>e.replace(t,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),fl=fe(((e,t)=>{let n=dl(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:_}=ul(),v=e=>e===l||e===a,y=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let b=t||{},x=e.length-1,S=b.parts===!0||b.scanToEnd===!0,C=[],w=[],T=[],E=e,D=-1,O=0,k=0,A=!1,ee=!1,j=!1,M=!1,N=!1,P=!1,F=!1,I=!1,L=!1,R=!1,te=0,z,B,V={value:``,depth:0,isGlob:!1},H=()=>D>=x,ne=()=>E.charCodeAt(D+1),U=()=>(z=B,E.charCodeAt(++D));for(;D<x;){B=U();let e;if(B===a){F=V.backslashes=!0,B=U(),B===u&&(P=!0);continue}if(P===!0||B===u){for(te++;H()!==!0&&(B=U());){if(B===a){F=V.backslashes=!0,U();continue}if(B===u){te++;continue}if(P!==!0&&B===s&&(B=U())===s){if(A=V.isBrace=!0,j=V.isGlob=!0,R=!0,S===!0)continue;break}if(P!==!0&&B===o){if(A=V.isBrace=!0,j=V.isGlob=!0,R=!0,S===!0)continue;break}if(B===h&&(te--,te===0)){P=!1,A=V.isBrace=!0,R=!0;break}}if(S===!0)continue;break}if(B===l){if(C.push(D),w.push(V),V={value:``,depth:0,isGlob:!1},R===!0)continue;if(z===s&&D===O+1){O+=2;continue}k=D+1;continue}if(b.noext!==!0&&(B===p||B===i||B===r||B===m||B===c)&&ne()===d){if(j=V.isGlob=!0,M=V.isExtglob=!0,R=!0,B===c&&D===O&&(L=!0),S===!0){for(;H()!==!0&&(B=U());){if(B===a){F=V.backslashes=!0,B=U();continue}if(B===g){j=V.isGlob=!0,R=!0;break}}continue}break}if(B===r){if(z===r&&(N=V.isGlobstar=!0),j=V.isGlob=!0,R=!0,S===!0)continue;break}if(B===m){if(j=V.isGlob=!0,R=!0,S===!0)continue;break}if(B===f){for(;H()!==!0&&(e=U());){if(e===a){F=V.backslashes=!0,U();continue}if(e===_){ee=V.isBracket=!0,j=V.isGlob=!0,R=!0;break}}if(S===!0)continue;break}if(b.nonegate!==!0&&B===c&&D===O){I=V.negated=!0,O++;continue}if(b.noparen!==!0&&B===d){if(j=V.isGlob=!0,S===!0){for(;H()!==!0&&(B=U());){if(B===d){F=V.backslashes=!0,B=U();continue}if(B===g){R=!0;break}}continue}break}if(j===!0){if(R=!0,S===!0)continue;break}}b.noext===!0&&(M=!1,j=!1);let W=E,re=``,ie=``;O>0&&(re=E.slice(0,O),E=E.slice(O),k-=O),W&&j===!0&&k>0?(W=E.slice(0,k),ie=E.slice(k)):j===!0?(W=``,ie=E):W=E,W&&W!==``&&W!==`/`&&W!==E&&v(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),b.unescape===!0&&(ie&&=n.removeBackslashes(ie),W&&F===!0&&(W=n.removeBackslashes(W)));let ae={prefix:re,input:e,start:O,base:W,glob:ie,isBrace:A,isBracket:ee,isGlob:j,isExtglob:M,isGlobstar:N,negated:I,negatedExtglob:L};if(b.tokens===!0&&(ae.maxDepth=0,v(B)||w.push(V),ae.tokens=w),b.parts===!0||b.tokens===!0){let t;for(let n=0;n<C.length;n++){let r=t?t+1:O,i=C[n],a=e.slice(r,i);b.tokens&&(n===0&&O!==0?(w[n].isPrefix=!0,w[n].value=re):w[n].value=a,y(w[n]),ae.maxDepth+=w[n].depth),(n!==0||a!==``)&&T.push(a),t=i}if(t&&t+1<e.length){let n=e.slice(t+1);T.push(n),b.tokens&&(w[w.length-1].value=n,y(w[w.length-1]),ae.maxDepth+=w[w.length-1].depth)}ae.slashes=C,ae.parts=T}return ae}})),pl=fe(((e,t)=>{let n=ul(),r=dl(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e){if(o===!0){a+=s,o=!1;continue}if(s===`\\`){a+=s,o=!0;continue}if(s===`"`){i=i===1?0:1,a+=s;continue}if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},f=e=>{let t=!1;for(let n of e){if(t===!0){t=!1;continue}if(n===`\\`){t=!0;continue}if(/[?*+@!()[\]{}]/.test(n))return!1}return!0},p=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(f(t))return t.replace(/\\(.)/g,`$1`)},m=e=>{let t=e.map(p).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(a&&r===a.repeat(r.length)&&i===a.repeat(i.length)&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},h=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0){a=!1;continue}if(s===`\\`){a=!0;continue}if(s===`"`){i=i===1?0:1;continue}if(i!==1){if(s===`[`){n++;continue}if(s===`]`&&n>0){n--;continue}if(!(n>0)){if(s===`(`){r++;continue}if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},g=e=>`${e.length===1?r.escapeRegex(e[0]):`[${e.map(e=>r.escapeRegex(e)).join(``)}]`}*`,_=e=>{let t=0,n=[];for(;t<e.length;){let r=h(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=d(r.body).map(e=>e.trim());if(i.length!==1)return;let a=p(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return n},v=e=>{let t=0,n=e.trim(),r=h(n);for(;r;)t++,n=r.body.trim(),r=h(n);return t},y=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,i=d(e).map(e=>e.trim());if(i.length>1&&(i.some(e=>e===``)||i.some(e=>/^[*?]+$/.test(e))||m(i)))return{risky:!0};let a=[],o=!1,s=!0;for(let e of i){let t=_(e);if(t){o=!0,a.push(...t);continue}let n=p(e);if(n&&n.length===1){a.push(n);continue}if(s=!1,v(e)>r)return{risky:!0}}return o?s?{risky:!0,safeOutput:g([...new Set(a)])}:{risky:!0}:{risky:!1}},b=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let d={...t},f=typeof d.maxLength==`number`?Math.min(i,d.maxLength):i,p=e.length;if(p>f)throw SyntaxError(`Input length: ${p}, exceeds maximum allowed length: ${f}`);let m={type:`bos`,value:``,output:d.prepend||``},h=[m],g=d.capture?``:`?:`,_=n.globChars(d.windows),v=n.extglobChars(_),{DOT_LITERAL:x,PLUS_LITERAL:S,SLASH_LITERAL:C,ONE_CHAR:w,DOTS_SLASH:T,NO_DOT:E,NO_DOT_SLASH:D,NO_DOTS_SLASH:O,QMARK:k,QMARK_NO_DOT:A,STAR:ee,START_ANCHOR:j}=_,M=e=>`(${g}(?:(?!${j}${e.dot?T:x}).)*?)`,N=d.dot?``:E,P=d.dot?k:A,F=d.bash===!0?M(d):ee;d.capture&&(F=`(${F})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let I={input:e,index:-1,start:0,dot:d.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};e=r.removePrefix(e,I),p=e.length;let L=[],R=[],te=[],z=m,B,V=()=>I.index===p-1,H=I.peek=(t=1)=>e[I.index+t],ne=I.advance=()=>e[++I.index]||``,U=()=>e.slice(I.index+1),W=(e=``,t=0)=>{I.consumed+=e,I.index+=t},re=e=>{I.output+=e.output==null?e.value:e.output,W(e.value)},ie=()=>{let e=1;for(;H()===`!`&&(H(2)!==`(`||H(3)===`?`);)ne(),I.start++,e++;return e%2!=0&&(I.negated=!0,I.start++,!0)},ae=e=>{I[e]++,te.push(e)},oe=e=>{I[e]--,te.pop()},G=e=>{if(z.type===`globstar`){let t=I.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||L.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(I.output=I.output.slice(0,-z.output.length),z.type=`star`,z.value=`*`,z.output=F,I.output+=z.output)}if(L.length&&e.type!==`paren`&&(L[L.length-1].inner+=e.value),(e.value||e.output)&&re(e),z&&z.type===`text`&&e.type===`text`){z.output=(z.output||z.value)+e.value,z.value+=e.value;return}e.prev=z,h.push(e),z=e},se=(e,t)=>{let n={...v[t],conditions:1,inner:``};n.prev=z,n.parens=I.parens,n.output=I.output,n.startIndex=I.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;ae(`parens`),G({type:e,value:t,output:I.output?``:w}),G({type:`paren`,extglob:!0,value:ne(),output:r}),L.push(n)},ce=n=>{let i=e.slice(n.startIndex,I.index+1),a=e.slice(n.startIndex+2,I.index),o=y(a,d);if((n.type===`plus`||n.type===`star`)&&o.risky){let e=o.safeOutput?(n.output?``:w)+(d.capture?`(${o.safeOutput})`:o.safeOutput):void 0,t=h[n.tokensIndex];t.type=`text`,t.value=i,t.output=e||r.escapeRegex(i);for(let e=n.tokensIndex+1;e<h.length;e++)h[e].value=``,h[e].output=``,delete h[e].suffix;I.output=n.output+t.output,I.backtrack=!0,G({type:`paren`,extglob:!0,value:B,output:``}),oe(`parens`);return}let s=n.close+(d.capture?`)`:``),c;if(n.type===`negate`){let e=F;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=M(d)),(e!==F||V()||/^\)+$/.test(U()))&&(s=n.close=`)$))${e}`),n.inner.includes(`*`)&&(c=U())&&/^\.[^\\/.]+$/.test(c)&&(s=n.close=`)${b(c,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(I.negatedExtglob=!0)}G({type:`paren`,extglob:!0,value:B,output:s}),oe(`parens`)};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?k.repeat(a.length):``):o===0?P+(a?k.repeat(a.length):``):k.repeat(r.length):i===`.`?x.repeat(r.length):i===`*`?t?t+i+(a?F:``):F:t?e:`\\${e}`);return n===!0&&(i=d.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&d.contains===!0?(I.output=e,I):(I.output=r.wrapOutput(i,I,t),I)}for(;!V();){if(B=ne(),B===`\0`)continue;if(B===`\\`){let e=H();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){B+=`\\`,G({type:`text`,value:B});continue}let t=/^\\+/.exec(U()),n=0;if(t&&t[0].length>2&&(n=t[0].length,I.index+=n,n%2!=0&&(B+=`\\`)),d.unescape===!0?B=ne():B+=ne(),I.brackets===0){G({type:`text`,value:B});continue}}if(I.brackets>0&&(B!==`]`||z.value===`[`||z.value===`[^`)){if(d.posix!==!1&&B===`:`){let e=z.value.slice(1);if(e.includes(`[`)&&(z.posix=!0,e.includes(`:`))){let e=z.value.lastIndexOf(`[`),t=z.value.slice(0,e),n=z.value.slice(e+2),r=a[n];if(r){z.value=t+r,I.backtrack=!0,ne(),!m.output&&h.indexOf(z)===1&&(m.output=w);continue}}}(B===`[`&&H()!==`:`||B===`-`&&H()===`]`)&&(B=`\\${B}`),B===`]`&&(z.value===`[`||z.value===`[^`)&&(B=`\\${B}`),d.posix===!0&&B===`!`&&z.value===`[`&&(B=`^`),z.value+=B,re({value:B});continue}if(I.quotes===1&&B!==`"`){B=r.escapeRegex(B),z.value+=B,re({value:B});continue}if(B===`"`){I.quotes=I.quotes===1?0:1,d.keepQuotes===!0&&G({type:`text`,value:B});continue}if(B===`(`){ae(`parens`),G({type:`paren`,value:B});continue}if(B===`)`){if(I.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=L[L.length-1];if(e&&I.parens===e.parens+1){ce(L.pop());continue}G({type:`paren`,value:B,output:I.parens?`)`:`\\)`}),oe(`parens`);continue}if(B===`[`){if(d.nobracket===!0||!U().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));B=`\\${B}`}else ae(`brackets`);G({type:`bracket`,value:B});continue}if(B===`]`){if(d.nobracket===!0||z&&z.type===`bracket`&&z.value.length===1){G({type:`text`,value:B,output:`\\${B}`});continue}if(I.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));G({type:`text`,value:B,output:`\\${B}`});continue}oe(`brackets`);let e=z.value.slice(1);if(z.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(B=`/${B}`),z.value+=B,re({value:B}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(z.value);if(I.output=I.output.slice(0,-z.value.length),d.literalBrackets===!0){I.output+=t,z.value=t;continue}z.value=`(${g}${t}|${z.value})`,I.output+=z.value;continue}if(B===`{`&&d.nobrace!==!0){ae(`braces`);let e={type:`brace`,value:B,output:`(`,outputIndex:I.output.length,tokensIndex:I.tokens.length};R.push(e),G(e);continue}if(B===`}`){let e=R[R.length-1];if(d.nobrace===!0||!e){G({type:`text`,value:B,output:B});continue}let t=`)`;if(e.dots===!0){let e=h.slice(),n=[];for(let t=e.length-1;t>=0&&(h.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,d),I.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=I.output.slice(0,e.outputIndex),r=I.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,B=t=`\\}`,I.output=n;for(let e of r)I.output+=e.output||e.value}G({type:`brace`,value:B,output:t}),oe(`braces`),R.pop();continue}if(B===`|`){L.length>0&&L[L.length-1].conditions++,G({type:`text`,value:B});continue}if(B===`,`){let e=B,t=R[R.length-1];t&&te[te.length-1]===`braces`&&(t.comma=!0,e=`|`),G({type:`comma`,value:B,output:e});continue}if(B===`/`){if(z.type===`dot`&&I.index===I.start+1){I.start=I.index+1,I.consumed=``,I.output=``,h.pop(),z=m;continue}G({type:`slash`,value:B,output:C});continue}if(B===`.`){if(I.braces>0&&z.type===`dot`){z.value===`.`&&(z.output=x);let e=R[R.length-1];z.type=`dots`,z.output+=B,z.value+=B,e.dots=!0;continue}if(I.braces+I.parens===0&&z.type!==`bos`&&z.type!==`slash`){G({type:`text`,value:B,output:x});continue}G({type:`dot`,value:B,output:x});continue}if(B===`?`){if(!(z&&z.value===`(`)&&d.noextglob!==!0&&H()===`(`&&H(2)!==`?`){se(`qmark`,B);continue}if(z&&z.type===`paren`){let e=H(),t=B;(z.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(U()))&&(t=`\\${B}`),G({type:`text`,value:B,output:t});continue}if(d.dot!==!0&&(z.type===`slash`||z.type===`bos`)){G({type:`qmark`,value:B,output:A});continue}G({type:`qmark`,value:B,output:k});continue}if(B===`!`){if(d.noextglob!==!0&&H()===`(`&&(H(2)!==`?`||!/[!=<:]/.test(H(3)))){se(`negate`,B);continue}if(d.nonegate!==!0&&I.index===0){ie();continue}}if(B===`+`){if(d.noextglob!==!0&&H()===`(`&&H(2)!==`?`){se(`plus`,B);continue}if(z&&z.value===`(`||d.regex===!1){G({type:`plus`,value:B,output:S});continue}if(z&&(z.type===`bracket`||z.type===`paren`||z.type===`brace`)||I.parens>0){G({type:`plus`,value:B});continue}G({type:`plus`,value:S});continue}if(B===`@`){if(d.noextglob!==!0&&H()===`(`&&H(2)!==`?`){G({type:`at`,extglob:!0,value:B,output:``});continue}G({type:`text`,value:B});continue}if(B!==`*`){(B===`$`||B===`^`)&&(B=`\\${B}`);let e=o.exec(U());e&&(B+=e[0],I.index+=e[0].length),G({type:`text`,value:B});continue}if(z&&(z.type===`globstar`||z.star===!0)){z.type=`star`,z.star=!0,z.value+=B,z.output=F,I.backtrack=!0,I.globstar=!0,W(B);continue}let t=U();if(d.noextglob!==!0&&/^\([^?]/.test(t)){se(`star`,B);continue}if(z.type===`star`){if(d.noglobstar===!0){W(B);continue}let n=z.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(d.bash===!0&&(!i||t[0]&&t[0]!==`/`)){G({type:`star`,value:B,output:``});continue}let o=I.braces>0&&(n.type===`comma`||n.type===`brace`),s=L.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){G({type:`star`,value:B,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[I.index+4];if(n&&n!==`/`)break;t=t.slice(3),W(`/**`,3)}if(n.type===`bos`&&V()){z.type=`globstar`,z.value+=B,z.output=M(d),I.output=z.output,I.globstar=!0,W(B);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&V()){I.output=I.output.slice(0,-(n.output+z.output).length),n.output=`(?:${n.output}`,z.type=`globstar`,z.output=M(d)+(d.strictSlashes?`)`:`|$)`),z.value+=B,I.globstar=!0,I.output+=n.output+z.output,W(B);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;I.output=I.output.slice(0,-(n.output+z.output).length),n.output=`(?:${n.output}`,z.type=`globstar`,z.output=`${M(d)}${C}|${C}${e})`,z.value+=B,I.output+=n.output+z.output,I.globstar=!0,W(B+ne()),G({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){z.type=`globstar`,z.value+=B,z.output=`(?:^|${C}|${M(d)}${C})`,I.output=z.output,I.globstar=!0,W(B+ne()),G({type:`slash`,value:`/`,output:``});continue}I.output=I.output.slice(0,-z.output.length),z.type=`globstar`,z.output=M(d),z.value+=B,I.output+=z.output,I.globstar=!0,W(B);continue}let n={type:`star`,value:B,output:F};if(d.bash===!0){n.output=`.*?`,(z.type===`bos`||z.type===`slash`)&&(n.output=N+n.output),G(n);continue}if(z&&(z.type===`bracket`||z.type===`paren`)&&d.regex===!0){n.output=B,G(n);continue}(I.index===I.start||z.type===`slash`||z.type===`dot`)&&(z.type===`dot`?(I.output+=D,z.output+=D):d.dot===!0?(I.output+=O,z.output+=O):(I.output+=N,z.output+=N),H()!==`*`&&(I.output+=w,z.output+=w)),G(n)}for(;I.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));I.output=r.escapeLast(I.output,`[`),oe(`brackets`)}for(;I.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));I.output=r.escapeLast(I.output,`(`),oe(`parens`)}for(;I.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));I.output=r.escapeLast(I.output,`{`),oe(`braces`)}if(d.strictSlashes!==!0&&(z.type===`star`||z.type===`bracket`)&&G({type:`maybe_slash`,value:``,output:`${C}?`}),I.backtrack===!0){I.output=``;for(let e of I.tokens)I.output+=e.output==null?e.value:e.output,e.suffix&&(I.output+=e.suffix)}return I};b.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:u,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:_}=n.globChars(a.windows),v=a.dot?m:p,y=a.dot?h:p,b=a.capture?``:`?:`,x={negated:!1,prefix:``},S=a.bash===!0?`.*?`:g;a.capture&&(S=`(${S})`);let C=e=>e.noglobstar===!0?S:`(${b}(?:(?!${_}${e.dot?f:l}).)*?)`,w=e=>{switch(e){case`*`:return`${v}${d}${S}`;case`.*`:return`${l}${d}${S}`;case`*.*`:return`${v}${S}${l}${d}${S}`;case`*/*`:return`${v}${S}${u}${d}${y}${S}`;case`**`:return v+C(a);case`**/*`:return`(?:${v}${C(a)}${u})?${y}${d}${S}`;case`**/*.*`:return`(?:${v}${C(a)}${u})?${y}${S}${l}${d}${S}`;case`**/.*`:return`(?:${v}${C(a)}${u})?${l}${d}${S}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=w(t[1]);return n?n+l+t[2]:void 0}}},T=w(r.removePrefix(e,x));return T&&a.strictSlashes!==!0&&(T+=`${u}?`),T},t.exports=b})),ml=fe(((e,t)=>{let n=fl(),r=pl(),i=dl(),a=ul(),o=e=>e&&typeof e==`object`&&!Array.isArray(e),s=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>s(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=o(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=c.state;delete c.state;let u=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=s(i.ignore,e,n)}let d=(n,r=!1)=>{let{isMatch:o,match:d,output:f}=s.test(n,c,t,{glob:e,posix:a}),p={glob:e,state:l,regex:c,posix:a,input:n,output:f,match:d,isMatch:o};return typeof i.onResult==`function`&&i.onResult(p),o===!1?(p.isMatch=!1,r?p:!1):u(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),!r||p)};return n&&(d.state=l),d};s.test=(e,t,n,{glob:r,posix:a}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},c=o.format||(a?i.toPosixSlashes:null),l=e===r,u=l&&c?c(e):e;return l===!1&&(u=c?c(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?s.matchBase(e,t,n,a):t.exec(u)),{isMatch:!!l,match:l,output:u}},s.matchBase=(e,t,n,r=n&&n.windows)=>(t instanceof RegExp?t:s.makeRe(t,n)).test(i.basename(e,{windows:r})),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map(e=>s.parse(e,t)):r(e,{...t,fastpaths:!1}),s.scan=(e,t)=>n(e,t),s.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,c=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(c=`^(?!${c}).*$`);let l=s.toRegex(c,t);return r===!0&&(l.state=e),l},s.makeRe=(e,t={},n=!1,i=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=r.fastpaths(e,t)),a.output||(a=r(e,t)),s.compileRe(a,t,n,i)},s.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},s.constants=a,t.exports=s})),hl=me(fe(((e,t)=>{let n=ml(),r=dl();function i(e,t,i=!1){return t&&(t.windows===null||t.windows===void 0)&&(t={...t,windows:r.isWindows()}),n(e,t,i)}Object.assign(i,n),t.exports=i}))(),1);function gl(e){return e.replaceAll(`\\`,`/`)}const _l=Array.isArray;function vl(e){return _l(e)?e:e==null?[]:[e]}const yl=`[_#EsCaPe#_]`;function bl(e,t){return t===!1||ll(e)||e.startsWith(`**`)?gl(e):al(gl(sl(t||``)).replaceAll(/[-^$*+?.()|[\]{}]/g,`${yl}$&`),gl(e)).replaceAll(yl,`\\`)}function xl(e,t,n){let r=n&&n.resolve,i=e=>e instanceof RegExp?e:{test:t=>(0,hl.default)(bl(e,r),{dot:!0})(t)},a=vl(e).map(i),o=vl(t).map(i);return!a.length&&!o.length?e=>typeof e==`string`&&!e.includes(`\0`):function(e){if(typeof e!=`string`||e.includes(`\0`))return!1;let t=gl(e);for(let e of o)if(e instanceof RegExp&&(e.lastIndex=0),e.test(t))return!1;for(let e of a)if(e instanceof RegExp&&(e.lastIndex=0),e.test(t))return!0;return!a.length}}const Sl={root:void 0,colorPreview:!1,remToPxPreview:!0,remToPxRatio:16,syntaxHighlight:!0,strictAnnotationMatch:!1,unmatchedDiagnostics:!0,autocompleteMatchType:`prefix`,autocompleteStrict:!1,autocompleteMaxItems:1e3},Cl=/^#(?:[0-9a-f]{3,8})$/i,wl=/^(?:rgb|rgba|hsl|hsla|hwb|oklch|oklab|lab|lch|device-cmyk|color)\(/i,Tl=/^(?:media|supports|container)\b/;function El(e={}){let t=new Set(Object.keys(e.colors??{})),n=new Set(Object.keys(e.breakpoint??e.breakpoints??{}));return{isColorValue(e){let n=e.trim();if(n.startsWith(`[`)&&n.endsWith(`]`)&&(n=n.slice(1,-1)),!n)return!1;if(n===`current`||n===`transparent`||Cl.test(n)||wl.test(n))return!0;let r=n.split(`/`)[0].split(`-`)[0];return t.has(r)},isBreakpoint(e){if(Tl.test(e))return!0;let t=e.replace(/^(?:max|min)-/,``).split(/[^a-z0-9]/i)[0];return n.has(t)}}}R([te,z,B,V,H,ne]);const Dl=/var\((?<cssVarName>--[^,|)]+)(?:,(?<fallback>[^)]+))?\)/g,Ol=String.raw`(?:#|0x)(?:[a-f0-9]{3}|[a-f0-9]{4}|[a-f0-9]{6}|[a-f0-9]{8})\b|(?:rgb|rgba|hsl|hsla|hwb|oklch|oklab|lab|lch|device-cmyk|color)\([^)]*\)`,kl=new RegExp(Ol,`g`),Al=/var\((--[^,|)]+)(?:,([^)]+))?\)/,jl=String.raw`(?:^|[;{]\s*)(?:[\w-]+-color|color|fill|stroke)\s*:\s*(?<value>[^;}{]+)`,Ml=new RegExp(jl,`gm`),Nl=/(?:^|[;{])\s*--[^\s:;{}]+\s*:/m,Pl=new RegExp(Ol,`i`),Fl=new RegExp(jl,`m`),Il=new RegExp(String.raw`color-mix\([^,]+,\s*(?<color>${Ol})\s+(?<weight>\d+(?:\.\d+)?%)\s*,\s*transparent\s*\)`,`i`);function Ll(e){return Nl.test(e)||Fl.test(e)||Rl(e)}function Rl(e){return Pl.test(e)}function zl(e){let t=/(?:^|[;{])\s*(?<key>--[^\s:;{}]+)\s*:\s*(?<value>[^;{}]+)(?=;|})/gm,n=new Map;for(let r of e.matchAll(t)){let e=r.groups?.key;e&&n.set(e,(r.groups?.value??``).trim().replace(/\s*!important\s*$/,``))}return n}function Bl(e,t){let n=e.trim(),r=new Set;for(;n.startsWith(`var(`);){let e=n.match(Al);if(!e)break;let i=e[1].trim(),a=e[2]?.trim();if(r.has(i))return a;r.add(i);let o=t.get(i)?.trim();if(o){n=o;continue}return a||`1`}return n}function Vl(e,t){let n=e;for(let r of e.matchAll(Dl)){let e=r[0],i=r.groups?.cssVarName?.trim(),a=r.groups?.fallback;if(!i)continue;let o=t.get(i);o?n=n.replaceAll(e,Bl(o,t)??a??`1`):a&&(n=n.replaceAll(e,a))}return n.replaceAll(/,?\s+var\(--.*?\)/g,``)}function Hl(e,t){let n=Vl(e,t),r=n.match(Il);if(r?.groups?.color){let e=r.groups.color,t=r.groups.weight;if(e)return/\//.test(e)?e:e.replace(/\)$/,` / ${t})`)}let i=n.match(kl)?.[0];if(!i){let e=n.trim().replace(/\s*!important$/,``);return L(e).isValid()?e:void 0}return/\/\)/.test(i)&&(i=i.replace(/ \/\)/g,`/ 1)`)),i}function Ul(e){let t=zl(e);for(let n of e.matchAll(Ml)){let e=n.groups?.value;if(!e)continue;let r=Hl(e,t);if(r)return r}return Hl(e,t)}function Wl(e){let t=L(e);if(!t.isValid())return;let n=t.toRgb();return{red:n.r/255,green:n.g/255,blue:n.b/255,alpha:n.alpha}}const Gl=/(-?[\d.]+)rem(\s+!important)?;/;let Kl;function ql(e){return e.default??e}function Jl(){return Kl??=Promise.all([import(`prettier/standalone`),import(`prettier/parser-postcss`)]).then(([e,t])=>({prettier:ql(e),parserCSS:ql(t)}))}function Yl(e,t=16){if(!e)return``;if(t<1)return e;let n=0,r=[];for(;n<e.length;){let i=e.slice(n).match(Gl);if(i?.index==null)break;let a=` /* ${Number.parseFloat(i[1])*t}px */`,o=n+i.index+i[0].length;r.push(e.slice(n,o)),r.push(a),n=o}return r.push(e.slice(n)),r.join(``)}async function Xl(e,t,n){let[r,{prettier:i,parserCSS:a}]=await Promise.all([e.generate(new Set(ye(t)),{preflights:!1,safelist:!1}),Jl()]),o=Yl(r.css,n),s=await i.format(o,{parser:`css`,plugins:[a]});return{...r,prettified:s}}async function Zl(e,t,n){return`\`\`\`css\n${(await Xl(e,t,n)).prettified.trimEnd()}\n\`\`\``}const Ql=[`property`,`class`,`keyword`,`number`,`enumMember`,`string`,`operator`,`type`],$l=[`important`,`pseudoClass`,`pseudoElement`,`query`,`selector`,`variable`,`combinator`,`bracket`,`group`,`condition`],eu=/^-?(?:\d+\.?\d*|\.\d+)[a-z%]*$/i,tu=/^[>+~_[&.#*: ]/,nu=/^[>+~_.#]/;function ru(e,t){return t?.isColorValue?.(e)?`enumMember`:e.startsWith(`[`)?`string`:eu.test(e)?`number`:`keyword`}function iu(e,t){return e.startsWith(`::`)?{type:`type`,modifier:`pseudoElement`,symbolLen:0}:nu.test(e)?{type:`type`,modifier:`selector`,symbolLen:1}:tu.test(e)?{type:`type`,modifier:`selector`,symbolLen:0}:t?.isBreakpoint?.(e)?{type:`keyword`,modifier:`query`,symbolLen:0}:{type:`keyword`,modifier:`pseudoClass`,symbolLen:0}}function au(e,t,n,r){e.push({start:n,length:1,type:`operator`,modifiers:[`condition`]});let i=n+1,a=t;if(a.startsWith(`!`)&&(e.push({start:i,length:1,type:`operator`,modifiers:[`important`]}),i+=1,a=a.slice(1)),a.length){let{type:t,modifier:n,symbolLen:o}=iu(a,r);o&&(e.push({start:i,length:o,type:`operator`,modifiers:[`combinator`]}),i+=o,a=a.slice(o)),a.length&&e.push({start:i,length:a.length,type:t,modifiers:[n]})}return n+t.length+1}function ou(e,t,n){let r=-1,i=t=>{r>=0&&(e.push({start:n+r,length:t-r,type:`string`,modifiers:[]}),r=-1)};for(let a=0;a<t.length;a++){let o=t[a];o===`[`||o===`]`||o===`_`?(i(a),e.push({start:n+a,length:1,type:`operator`,modifiers:[`bracket`]})):r<0&&(r=a)}i(t.length)}function su(e,t,n,r,i){let a=+!!t.startsWith(`$`);a&&e.push({start:n,length:1,type:`operator`,modifiers:[`variable`]});let o=t.slice(a);if(!o.length)return;if(r===`value`&&o.startsWith(`[`)){ou(e,o,n+a);return}if(r===`value`&&a&&o.includes(`|`)){let t=o.indexOf(`|`),r=o.slice(0,t),s=o.slice(t+1);if(r.length&&e.push({start:n+a,length:r.length,type:ru(r,i),modifiers:[]}),e.push({start:n+a+t,length:1,type:`operator`,modifiers:[`important`]}),s.length){let r=n+a+t+1;s.startsWith(`[`)?ou(e,s,r):e.push({start:r,length:s.length,type:ru(s,i),modifiers:[]})}return}let s=r===`property`?`property`:ru(o,i);e.push({start:n+a,length:o.length,type:s,modifiers:[]})}function cu(e,t,n){if(!e)return[];if(e.startsWith(`{`)&&e.includes(`}`))return uu(e,t,n);let r=Pe(e),i=[];if(r.keyword)r.body.length&&(r.body.startsWith(`[`)?ou(i,r.body,t):i.push({start:t,length:r.body.length,type:`class`,modifiers:[]}));else{let e=r.property??``,a=r.value??``;e.length&&su(i,e,t,`property`,n),i.push({start:t+e.length,length:1,type:`operator`,modifiers:[]}),a.length&&su(i,a,t+e.length+1,`value`,n)}let a=t+r.body.length;r.important&&(i.push({start:a,length:1,type:`operator`,modifiers:[`important`]}),a+=1);for(let e of r.conditions)a=au(i,e,a,n);return i}function lu(e,t,n){let r=0;for(let i=n;i<e.length;i++){let n=e[i];if(n===`\\`)i++;else if(n===`[`||n===`(`)r++;else if(n===`]`||n===`)`)r--;else if(n===t&&r<=0)return i}return-1}function uu(e,t,n){let r=[],i=lu(e,`}`,0);r.push({start:t,length:1,type:`operator`,modifiers:[`group`]});let a=t+1,o=e.slice(1,i),s=[],c=0;for(;;){let e=lu(o,`;`,c);if(e===-1){s.push(o.slice(c));break}s.push(o.slice(c,e)),c=e+1}s.forEach((e,t)=>{if(t>0&&(r.push({start:a,length:1,type:`operator`,modifiers:[`group`]}),a+=1),e.length){for(let t of cu(e,a,n))r.push(t);a+=e.length}}),r.push({start:t+i,length:1,type:`operator`,modifiers:[`group`]});let l=t+i+1,u=e.slice(i+1);if(u.startsWith(`!`)&&(r.push({start:l,length:1,type:`operator`,modifiers:[`important`]}),l+=1,u=u.slice(1)),u.startsWith(`@`))for(let e of u.slice(1).split(`@`))l=au(r,e,l,n);return r}const du=new Map,fu=new WeakMap;function pu(e,t){return e<t?-1:+(e>t)}function mu(e,t){return pu(e??``,t??``)}function hu(e,t){return e[0]-t[0]||(e[4]?.sort??0)-(t[4]?.sort??0)||mu(e[5]?.currentSelector,t[5]?.currentSelector)||mu(e[1],t[1])||pu(e[2],t[2])}function gu(e){let t=!1,n=0,r,i=``;for(let a=0;a<e.length;a++){let o=e[a];if(t){o===`*`&&e[a+1]===`/`&&(t=!1,a++);continue}if(r){o===`\\`?a++:o===r&&(r=void 0);continue}if(o===`/`&&e[a+1]===`*`){t=!0,a++;continue}if(o===`\\`){a++;continue}if(o===`"`||o===`'`){r=o;continue}if(!/\s/.test(o)||e[a+1]!==`$`||e[a+2]!==`$`||!/\s/.test(e[a+3]??``))continue;let s=a+4;for(;s<e.length&&/\s/.test(e[s]);)s++;i+=`${e.slice(n,a)} `,n=s,a=s-1}return n?i+e.slice(n):e}function _u(e){let t=[],n=0,r=!1,i=0,a,o=0;for(let s=0;s<e.length;s++){let c=e[s];r?c===`*`&&e[s+1]===`/`&&(r=!1,s++):a?c===`\\`?s++:c===a&&(a=void 0):c===`/`&&e[s+1]===`*`?(r=!0,s++):c===`"`||c===`'`?a=c:c===`(`?i++:c===`)`?i>0&&i--:c===`[`?n++:c===`]`?n>0&&n--:n===0&&i===0&&e.startsWith(` $$ `,s)&&(t.push(e.slice(o,s)),s+=3,o=s+1)}return t.push(e.slice(o)),t}function vu(e){let t=du.get(e);if(t!==void 0)return t;let n=Ll(e);return Lc(du,e,n,2048),n}function yu(e){let t=new Map,n=new Map,r=0;for(let i of e){let[a,o,s]=i;if(s){e[r++]=i;continue}let c=a.length?t:n,l=c.get(o);l?a.length&&l[0].push(...a):(c.set(o,i),e[r++]=i)}e.length=r}function bu(e,t,n){let r=e.sort(hu).map(([,e,t,,n,,r])=>{let i=e&&!n?.noScope?gu(e):e;return[i==null?[]:[[i,n?.sort??0]],t,!!(r??n?.noMerge)]});t&&yu(r);let i=[];for(let e=r.length-1;e>=0;e--){let[t,n]=r[e],a=t.length===1?t[0][0]:``;t.length>1&&(t.sort((e,t)=>e[1]-t[1]||pu(e[0],t[0])),a=[...new Set(t.map(([e])=>e).filter(Boolean))].join(`,
|
|
28
|
+
`,r+2);if(t<0)return e.length;r=t}else if(t===`{`)n++;else if(t===`}`&&--n===0)return r+1}return e.length}function hc(e){let t=[],n=/(?:^|\s)((?::|v-bind:)?(?:data-css-(?:primary|neutral|success|warning|failure|general|focused|appearance|group|peer)|lang))\s*=\s*/gi;for(let r=n.exec(e);r;r=n.exec(e)){let i=r.index+r[0].length;if(Fs(e,i)?.toLowerCase()!==r[1].toLowerCase())continue;let a=mc(e,i);t.push([i,a]),n.lastIndex=Math.max(i,a)}return t}function gc(e,t){return hc(e).some(([e,n])=>t>=e&&t<=n)}const _c=/([\\:]?[\s"'`;<>]|:\(|\)"|\)\s)/g,vc=/(?:[\w&:[\]-]|\[\S{1,64}=\S{1,64}\]){1,64}\[\\?['"]?\S{0,64}?['"]\]\]?[\w:@-]{0,64}/g,yc=/\[(\\\W|[\w-]){1,64}:[^\s:]{0,64}?("\S{1,64}?"|'\S{1,64}?'|`\S{1,64}?`|[^\s:]{1,64}?)[^\s:]{0,64}?\)?\]/g;async function bc(e,t,n=``){let r=e.config.extractors?.find(e=>e.name===`pug`);if(!r)return{pug:!1,code:``};let i={code:t,id:n};await r.extract?.(i);let a=i.code.startsWith(t)?i.code.substring(t.length+2):i.code;return i.code===t?{pug:!1,code:``}:{pug:!0,code:a}}function xc(e,t,n){let r=[];t.has(e)&&r.push([n,n+e.length,e]);let i=new Set;for(let a of e.matchAll(/\.([^.#=\s(]+)(?=[.#=\s(]|$)/g)){let e=a[1];if(e.includes(`:`)||i.has(e)||!t.has(e))continue;i.add(e);let o=n+a.index+1;r.push([o,o+e.length,e])}return r}function Sc(e,t){let n=e.flags.includes(`g`)?e.flags:`${e.flags}g`;return t.matchAll(new RegExp(e.source,n))}function Cc(e,t){let n=t.map(([t,n])=>[Math.max(0,t),Math.min(e.length,n)]).filter(([e,t])=>t>e).sort((e,t)=>e[0]-t[0]||e[1]-t[1]);if(!n.length)return e;let r=[];for(let[e,t]of n){let n=r.at(-1);n&&e<=n[1]?n[1]=Math.max(n[1],t):r.push([e,t])}let i=[],a=0;for(let[t,n]of r)i.push(e.slice(a,t),` `.repeat(n-t)),a=n;return i.push(e.slice(a)),i.join(``)}function wc(e){let t=[...e].sort((e,t)=>e[0]-t[0]||t[1]-e[1]),n=[],r=[],i=-1;for(let[e,a]of t)n.push(e),i=Math.max(i,a),r.push(i);return{starts:n,maxEnds:r}}function Tc(e,t,n){let r=0,i=e.starts.length;for(;r<i;){let n=r+i>>>1;e.starts[n]<=t?r=n+1:i=n}return r>0&&e.maxEnds[r-1]>=n}function Ec(e){return e===void 0||/[\s'"`;<>]/.test(e)}function Dc(e,t){if(!t.size)return[];let n={children:new Map};for(let e of t){let t=n;for(let n=0;n<e.length;n++){let r=e[n],i=t.children.get(r);i||(i={children:new Map},t.children.set(r,i)),t=i}t.value=e}let r=[];for(let t=0;t<e.length;t++){if(!Ec(e[t-1]))continue;let i=n;for(let n=t;n<e.length;n++){let a=i.children.get(e[n]);if(!a)break;i=a,i.value&&Ec(e[n+1])&&r.push([t,n+1,i.value])}}return r}function Oc(e,t,n){for(let r=t+1;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===n)return r;return-1}function kc(e,t,n){if(!n)return[];let r=[],i=RegExp(`(^|[^\\w:-])${On(t)}\\s*=\\s*(['"])`,`g`);for(let t of e.matchAll(i)){let i=t.index+t[0].length-1,a=Oc(e,i,t[2]);if(!(a<0))for(let t=e.indexOf(n,i+1);t>=0&&t+n.length<=a;t=e.indexOf(n,t+n.length)){let o=t===i+1||/\s/.test(e[t-1]),s=t+n.length===a||/\s/.test(e[t+n.length]);o&&s&&r.push(t)}}return r}function Ac(e,t){let n=0,r=0,i=!1;for(let a=t+1;a<e.length;a++){let t=e[a];if(t===`(`){if(n===0&&r===0&&!i)return-1;n++}else if(t===`)`)n>0&&n--;else if(t===`[`)r++;else if(t===`]`)r>0&&r--;else if((t===`:`||t===`;`)&&n===0&&r===0)i=!0;else if(t===`}`&&n===0&&r===0)return a}return-1}function jc(e,t){let n=t;if(e[n]===`!`&&n++,e[n]!==`@`)return{suffix:e.slice(t,n),end:n};let r=0,i=0;for(;n<e.length;n++){let t=e[n];if(t===`(`)r++;else if(t===`)`)r>0&&r--;else if(t===`[`)i++;else if(t===`]`)i>0&&i--;else if((/\s/.test(t)||t===`"`||t===`'`||t==="`"||t===`{`||t===`}`)&&r===0&&i===0)break}return{suffix:e.slice(t,n),end:n}}function Mc(e){let t=[],n=0,r=0,i=0;for(let a=0;a<e.length;a++){let o=e[a];o===`(`?n++:o===`)`?n>0&&n--:o===`[`?r++:o===`]`?r>0&&r--:o===`;`&&n===0&&r===0&&(t.push(e.slice(i,a).trim()),i=a+1)}return t.push(e.slice(i).trim()),t.filter(Boolean)}function Nc(e,t,n){let r=Ac(e,t);if(r<0)return null;let i=Mc(e.slice(t+1,r));if(!i.length)return null;let{suffix:a,end:o}=jc(e,r+1);return i.every(e=>n.has(e)||n.has(`${e}${a}`))?[t,o,e.slice(t,o)]:null}function Pc(e,t,n=[],r={}){let i=[],a=[],o=new Set,s=new Set,c=[],l=hc(e);if(e=Cc(e,l),r.excludeRanges&&(e=Cc(e,r.excludeRanges)),r.excludeRegex)for(let t of r.excludeRegex){let n=Array.from(Sc(t,e),e=>[e.index,e.index+e[0].length]);e=Cc(e,n)}if(r.includeRegex)for(let t of r.includeRegex)for(let n of Sc(t,e))c.push([n.index,n.index+n[0].length]);else c.push([0,e.length]);let u=wc(c);Array.from(t).forEach(e=>{let t=vr(e);t?t[2]?a.push(t):(/[><()]|\[\\?['"`]/.test(t[1])&&s.add(t[1]),o.add(t[1])):(/[><()]|\[\\?['"`]/.test(e)&&s.add(e),o.add(e))}),i.push(...Dc(e,s));let d=0;e.split(_c).forEach(e=>{let t=d+e.length;r.isPug?i.push(...xc(e,o,d)):o.has(e)&&i.push([d,t,e]),d=t});for(let t of e.matchAll(vc)){let e=t.index,n=e+t[0].length;o.has(t[0])&&i.push([e,n,t[0]])}let f=new Set(i.map(([e,t])=>`${e}:${t}`));for(let t of e.matchAll(yc)){let e=t.index,n=e+t[0].length;if(o.has(t[0])){let r=`${e}:${n}`;f.has(r)||(f.add(r),i.push([e,n,t[0]]))}}a.forEach(([,t,n])=>{for(let r of kc(e,t,n)){let e=r+n.length;i.push([r,e,`[${t}="${n}"]`])}});for(let t=e.indexOf(`{`);t>=0;t=e.indexOf(`{`,t+1)){let n=Nc(e,t,o);if(!n)continue;let[r,a]=n;for(let e=i.length-1;e>=0;e--){let[t,n]=i[e];t>=r&&n<=a&&i.splice(e,1)}i.some(([e,t])=>e===r&&t===a)||i.push(n)}i.push(...n.map(e=>[e.offset,e.offset+e.length,e.className]));let p=new Set;return i.filter(([e,t])=>!l.some(([n,r])=>e<r&&t>n)).filter(([e,t])=>Tc(u,e,t)).filter(([e,t,n])=>{let r=`${e}:${t}:${n}`;return!p.has(r)&&(p.add(r),!0)}).sort((e,t)=>e[0]-t[0])}const Fc=[`@teacss/directives`,`@teacss/transformer-compile-class`];async function Ic(e,t,n=``,r={}){let i=new c(t),a={generator:e,tokens:new Set},o=e.config.transformers?.filter(e=>!Fc.includes(e.name)),s=[];for(let e of[`pre`,`default`,`post`])for(let t of o?.filter(t=>(t.enforce??`default`)===e)||[]){let e=(await t.transform(i,n,a))?.highlightAnnotations;e&&s.push(...e)}let{pug:l,code:u}=await bc(e,i.toString(),n);return Pc(t,[...(await e.generate(l?u:i.toString(),{preflights:!1,safelist:!1})).matched],s,{isPug:l,...r})}function Lc(e,t,n,r){if(!(r<1)){if(e.delete(t),e.size>=r){let t=e.keys().next();t.done||e.delete(t.value)}e.set(t,n)}}function Rc(e,t,n,r){let i=e.get(t);if(i)return Lc(e,t,i,n),i;let a;return a=r().catch(n=>{throw e.get(t)===a&&e.delete(t),n}),Lc(e,t,a,n),a}const zc=new Map;function Bc(e){zc.delete(e)}function Vc(){zc.clear()}function Hc(e,t,n,r=!1,i=!1){i&&zc.delete(n);let a=zc.get(n);if(a&&a.code===t&&a.config===e.config&&a.generator===e&&a.strictAnnotationMatch===r)return Lc(zc,n,a,100),a.result;let o=Ic(e,t,n,{excludeRanges:Vi(t,n),excludeRegex:Ui,...r?{includeRegex:Hi}:null});return Lc(zc,n,{code:t,config:e.config,generator:e,strictAnnotationMatch:r,result:o},100),o}function Uc(e){try{return k(e)}catch{try{let t=new URL(e);return t.protocol===`file:`?e:decodeURIComponent(t.pathname.replace(/^\/([a-z]:)/i,`$1`))}catch{return e}}}const Wc=/<style[^>]*>[\s\S]*?(?:<\/style>|<\/>|$)/g,Gc=/(?:<\/style>|<\/>)$/,Kc=/<template\b[^>]*\slang\s*=\s*(?:'pug'|"pug")[^>]*>/i;function qc(e,t,n){let r=t.match(/\.(svelte|vue|astro|marko)$/);if(r&&Jc(e,t)){let t=e.slice(0,n);if(/\.$/.test(t)||/\.\S+$/.test(t))return!0}if((r?[...e.matchAll(Wc)].some(t=>{let r=t.index,i=r+t[0].length,a=i===e.length&&!Gc.test(t[0]);return n>r&&(n<i||a&&n===i)}):/\.(?:css|scss|sass|less|styl(?:us)?|pcss|postcss)$/i.test(t))||Fs(e,n)!==void 0)return!0;let i=e.slice(n).replace(/"[^"]*"|\{[^}]*\}|'[^']*'/g,``);return/^[^<>]*>/.test(i)}function Jc(e,t){return t.endsWith(`.vue`)&&Kc.test(e)}function Yc(e,t){let n=p.relative(e,t);return n!==``&&n!==`..`&&!n.startsWith(`..${p.sep}`)&&!p.isAbsolute(n)}const Xc={log(){},warn(){}},Zc=/[\\/](?:node_modules|dist|\.temp|\.cache)[\\/]/;var Qc=class{cwd;logger;ready;contextsMap=new Map;configSources=[];fileContextCache=new Map;configExistsCache=new Map;loadingContexts=new Map;contextLoadVersions=new Map;contextReloadDisposers=new Map;failedConfigSources=new Map;discoveredConfigs=new Set;yarnPnpSetupFailures=new Set;lifecycleVersion=0;workspaceRoots;events=hr();constructor(e,t=Xc,n=[e]){this.cwd=e,this.logger=t,this.workspaceRoots=Array.from(new Set(n.length?n:[e])),this.ready=this.reload()}log(e){this.logger.log(e)}warn(e){this.logger.warn(e)}isTarget(e){return Array.from(this.contextsMap.keys()).some(t=>Yc(t,e))}get contexts(){return Array.from(new Set(this.contextsMap.values())).filter(br)}async setRoots(e){let t=Array.from(new Set(e)),n=Array.from(this.contextsMap.keys()),r=this.workspaceRoots.length===t.length&&t.every(e=>this.workspaceRoots.includes(e)),i=n.length===t.length&&t.every(e=>n.includes(e));if(r&&i)return;let a=++this.lifecycleVersion;this.workspaceRoots=t;for(let e of n)t.includes(e)||this.removeContext(e,`contextUnload`,!0);a===this.lifecycleVersion&&(this.resetCaches(),await this.loadRoots(t.filter(e=>!n.includes(e)),a),a===this.lifecycleVersion&&this.events.emit(`reload`))}async reload(){let e=++this.lifecycleVersion,t=Array.from(this.contextsMap.keys()),n=t.length?t:this.workspaceRoots;for(let e of t)this.removeContext(e,`contextUnload`,!1);e===this.lifecycleVersion&&(this.resetCaches(),await this.loadRoots(n,e),e===this.lifecycleVersion&&this.events.emit(`reload`))}async unloadContext(e){this.removeContext(e,`contextUnload`,!0)}async unload(e){this.removeContext(e,`unload`,!0)}removeContext(e,t,n){n&&(this.contextLoadVersions.set(e,(this.contextLoadVersions.get(e)??0)+1),this.loadingContexts.delete(e));let r=this.contextsMap.get(e);r!==void 0&&(this.contextsMap.delete(e),this.failedConfigSources.delete(e),this.syncConfigSources(),r&&(this.disposeContextReload(r),this.clearFileContextCache(r),this.events.emit(t,r),t===`contextUnload`&&this.events.emit(`reload`)))}syncConfigSources(){let e=this.contexts.flatMap(e=>e.getConfigFileList()),t=Array.from(this.failedConfigSources.values()).flat(),n=Array.from(new Set([...e,...t]));this.configSources.splice(0,this.configSources.length,...n)}clearFileContextCache(e){for(let[t,n]of this.fileContextCache)n===e&&this.fileContextCache.delete(t)}resetCaches(){this.fileContextCache.clear(),this.configExistsCache.clear()}releaseDocument(e){this.fileContextCache.delete(e),this.invalidateConfigSearchPath(e)}invalidateConfigSearchPath(e){let t=p.dirname(e),n=this.getWorkspaceBoundary(t);if(n)for(;t===n||Yc(n,t);){if(this.configExistsCache.delete(t),t===n)return;t=p.dirname(t)}}async loadRoots(e,t){let n=e.map(e=>({dir:e,loadVersion:this.contextLoadVersions.get(e)??0}));await Promise.all(n.map(async({dir:e,loadVersion:n})=>{try{await this.loadContextInDirectoryWithVersion(e,t,n)}catch(n){if(t!==this.lifecycleVersion)return;this.warn(`⚠️ Failed to reload context for ${e}: ${String(n.stack??n)}`)}}))}async loadContextInDirectory(e){return this.loadContextInDirectoryWithVersion(e,void 0,this.contextLoadVersions.get(e)??0)}async loadContextInDirectoryWithVersion(e,t,n){if(!this.isLoadCurrent(e,t,n))return;let r=this.contextsMap.get(e);if(r!==void 0)return r;let i=this.loadingContexts.get(e);if(i&&i.lifecycleVersion===t&&i.loadVersion===n)return i.promise;let a=this.loadContext(e,t,n);this.loadingContexts.set(e,{lifecycleVersion:t,loadVersion:n,promise:a});try{return await a}finally{this.loadingContexts.get(e)?.promise===a&&this.loadingContexts.delete(e)}}async loadContext(e,t,n){this.setupYarnPnp(e),this.discoveredConfigs.has(e)||this.log(`🛠 Resolving config for ${e}`);let r=D(e,{},e=>{e.config.details=!0}),i=[];try{i=(await r.updateRoot(e)).sources}catch(i){return this.isLoadCurrent(e,t,n)?(this.warn(`⚠️ Error on loading config. Config directory: ${e}`),this.warn(String(i.stack??i)),this.failedConfigSources.set(e,r.getConfigFileList()),this.finishLoading(e,null,t,n)):void 0}if(!this.isLoadCurrent(e,t,n))return;if(this.failedConfigSources.delete(e),!i.length)return this.log(`ℹ️ No config sources found in ${e}`),this.finishLoading(e,null,t,n);if(await r.ready,!this.isLoadCurrent(e,t,n))return;this.setupContextReload(r),this.logConfigInfo(i,r.generator);let a=this.finishLoading(e,r,t,n);return this.events.emit(`contextLoaded`,r),a}setupYarnPnp(e){for(let t of[`.pnp.js`,`.pnp.cjs`]){let n=p.join(e,t);if(f(n))try{he(n).setup(),this.yarnPnpSetupFailures.delete(n)}catch(e){if(this.yarnPnpSetupFailures.has(n))continue;this.yarnPnpSetupFailures.add(n);let t=e instanceof Error?e.message:String(e);this.warn(`⚠️ Failed to setup Yarn PnP from ${n}: ${t}`)}}}setupContextReload(e){this.disposeContextReload(e);let t=e.onReload(()=>{for(let[t,n]of this.fileContextCache)(n===e||!n)&&this.fileContextCache.delete(t);this.configExistsCache.clear(),this.syncConfigSources(),this.events.emit(`contextReload`,e)});this.contextReloadDisposers.set(e,t);for(let[e,t]of this.fileContextCache)t||this.fileContextCache.delete(e)}disposeContextReload(e){this.contextReloadDisposers.get(e)?.(),this.contextReloadDisposers.delete(e)}isLoadCurrent(e,t,n){return(t===void 0||t===this.lifecycleVersion)&&n===(this.contextLoadVersions.get(e)??0)}logConfigInfo(e,t){let n=e.length===1?e[0]:`\n${e.map(e=>` - ${e}`).join(`
|
|
29
|
+
`)}`;this.log(`🛠 New configuration loaded from ${n}`),this.log(`ℹ️ ${t.config.presets.length} presets, ${t.config.rulesSize} rules, ${t.config.shortcuts.length} shortcuts, ${t.config.variants.length} variants, ${t.config.transformers?.length||0} transformers loaded`)}finishLoading(e,t,n,r){if(!this.isLoadCurrent(e,n,r))return;this.contextsMap.has(e)||this.contextsMap.set(e,t),this.syncConfigSources(),this.fileContextCache.clear(),this.events.emit(`reload`);let i=Array.from(this.contextsMap.entries()).filter(([,e])=>e).map(([e])=>e).join(`, `)||`[none]`;return this.log(`🗂️ Enabled context: ${i}`),t}async resolveClosestContext(e,t){if(Zc.test(t))return;if(this.fileContextCache.has(t)){let e=this.fileContextCache.get(t);return Lc(this.fileContextCache,t,e,100),e}let n=await this.discoverAndLoadConfig(t);if(n)return n;let r=Array.from(this.contextsMap.entries()).sort((e,t)=>t[0].length-e[0].length);for(let[n,i]of r)if(i&&Yc(n,t)&&(i.filter(e,t)||An(t)))return Lc(this.fileContextCache,t,i,100),i;for(let[e,n]of r)if(n&&Yc(e,t))return Lc(this.fileContextCache,t,n,100),n}async discoverAndLoadConfig(e){let t=this.lifecycleVersion,n=await this.findConfigDirectory(p.dirname(e),t);if(t!==this.lifecycleVersion||!n||this.contextsMap.has(n))return;this.discoveredConfigs.has(n)||(this.log(`🔍 Discovered config in ${n}`),this.discoveredConfigs.add(n));let r=this.contextLoadVersions.get(n)??0;if(await this.loadContextInDirectoryWithVersion(n,t,r),!this.isLoadCurrent(n,t,r))return;let i=this.contextsMap.get(n);return i&&Lc(this.fileContextCache,e,i,100),i}async findConfigDirectory(e,t){let n=this.configExistsCache.get(e);if(n!==void 0)return Lc(this.configExistsCache,e,n,100),n||void 0;let r=this.getWorkspaceBoundary(e);if(!r)return;let i=p.parse(e).root,a=[],o=e;for(;o!==i&&(Yc(r,o)||o===r);){a.push(o);let e=this.configExistsCache.get(o);if(e!==void 0)return Lc(this.configExistsCache,o,e,100),this.cacheSearchPath(a,e||!1),e||void 0;let n=await this.hasConfigFiles(o);if(t!==this.lifecycleVersion)return;if(n)return this.cacheSearchPath(a,o),o;o=p.dirname(o)}this.cacheSearchPath(a,!1)}getWorkspaceBoundary(e){return[...this.workspaceRoots,...this.contextsMap.keys()].filter(t=>t===e||Yc(t,e)).sort((e,t)=>t.length-e.length)[0]}async hasConfigFiles(e){return!!x(e)}cacheSearchPath(e,t){for(let n of e)Lc(this.configExistsCache,n,t,100)}};const $c=/^[A-Za-z]:\//;function el(e=``){return e&&e.replace(/\\/g,`/`).replace($c,e=>e.toUpperCase())}const tl=/^[/\\]{2}/,nl=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,rl=/^[A-Za-z]:$/,il=function(e){if(e.length===0)return`.`;e=el(e);let t=e.match(tl),n=ll(e),r=e[e.length-1]===`/`;return e=cl(e,!n),e.length===0?n?`/`:r?`./`:`.`:(r&&(e+=`/`),rl.test(e)&&(e+=`/`),t?n?`//${e}`:`//./${e}`:n&&!ll(e)?`/${e}`:e)},al=function(...e){let t=``;for(let n of e)if(n){if(t.length>0){let e=t[t.length-1]===`/`,r=n[0]===`/`;t+=e&&r?n.slice(1):e||r?n:`/${n}`}else t+=n}return il(t)};function ol(){return typeof process<`u`&&typeof process.cwd==`function`?process.cwd().replace(/\\/g,`/`):`/`}const sl=function(...e){e=e.map(e=>el(e));let t=``,n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:ol();i&&i.length!==0&&(t=`${i}/${t}`,n=ll(i))}return t=cl(t,!n),n&&!ll(t)?`/${t}`:t.length>0?t:`.`};function cl(e,t){let n=``,r=0,i=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else if(o===`/`)break;else o=`/`;if(o===`/`){if(i!==s-1&&a!==1){if(a===2){if(n.length<2||r!==2||n[n.length-1]!==`.`||n[n.length-2]!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}if(n.length>0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1}i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}const ll=function(e){return nl.test(e)};var ul=fe(((e,t)=>{let n=`[^\\\\/]`,r=`[^/]`,i=`(?:\\/|$)`,a=`(?:^|\\/)`,o=`\\.{1,2}${i}`,s={DOT_LITERAL:`\\.`,PLUS_LITERAL:`\\+`,QMARK_LITERAL:`\\?`,SLASH_LITERAL:`\\/`,ONE_CHAR:`(?=.)`,QMARK:r,END_ANCHOR:i,DOTS_SLASH:o,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!${a}${o})`,NO_DOT_SLASH:`(?!\\.{0,1}${i})`,NO_DOTS_SLASH:`(?!${o})`,QMARK_NO_DOT:`[^.\\/]`,STAR:`${r}*?`,START_ANCHOR:a,SEP:`/`},c={...s,SLASH_LITERAL:`[\\\\/]`,QMARK:n,STAR:`${n}*?`,DOTS_SLASH:`\\.{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!\\.)`,NO_DOTS:`(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!\\.{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!\\.{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:`[^.\\\\/]`,START_ANCHOR:`(?:^|[\\\\/])`,END_ANCHOR:`(?:[\\\\/]|$)`,SEP:`\\`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{__proto__:null,alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?c:s}}})),dl=fe((e=>{let{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=ul();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,`\\$1`),e.toPosixSlashes=e=>e.replace(t,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),fl=fe(((e,t)=>{let n=dl(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:_}=ul(),v=e=>e===l||e===a,y=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let b=t||{},x=e.length-1,S=b.parts===!0||b.tokens===!0||b.scanToEnd===!0,C=[],w=[],T=[],E=e,D=-1,O=0,k=0,A=!1,ee=!1,j=!1,M=!1,N=!1,P=!1,F=!1,I=!1,L=!1,R=!1,te=0,z,B,V={value:``,depth:0,isGlob:!1},H=()=>D>=x,ne=()=>E.charCodeAt(D+1),U=()=>(z=B,E.charCodeAt(++D));for(;D<x;){B=U();let e;if(B===a){F=V.backslashes=!0,B=U(),B===u&&(P=!0);continue}if(P===!0||B===u){for(te++;H()!==!0&&(B=U());){if(B===a){F=V.backslashes=!0,U();continue}if(B===u){te++;continue}if(P!==!0&&B===s&&(B=U())===s){if(A=V.isBrace=!0,j=V.isGlob=!0,R=!0,S===!0)continue;break}if(P!==!0&&B===o){if(A=V.isBrace=!0,j=V.isGlob=!0,R=!0,S===!0)continue;break}if(B===h&&(te--,te===0)){P=!1,A=V.isBrace=!0,R=!0;break}}if(S===!0)continue;break}if(B===l){if(C.push(D),w.push(V),V={value:``,depth:0,isGlob:!1},R===!0)continue;if(z===s&&D===O+1){O+=2;continue}k=D+1;continue}if(b.noext!==!0&&(B===p||B===i||B===r||B===m||B===c)&&ne()===d){if(j=V.isGlob=!0,M=V.isExtglob=!0,R=!0,B===c&&D===O&&(L=!0),S===!0){let e=0;for(;H()!==!0&&(B=U());){if(B===a){F=V.backslashes=!0,U();continue}if(B===d){e++;continue}if(B===g&&--e===0){R=!0;break}}continue}break}if(B===r){if(z===r&&(N=V.isGlobstar=!0),j=V.isGlob=!0,R=!0,S===!0)continue;break}if(B===m){if(j=V.isGlob=!0,R=!0,S===!0)continue;break}if(B===f){for(;H()!==!0&&(e=U());){if(e===a){F=V.backslashes=!0,U();continue}if(e===_){ee=V.isBracket=!0,j=V.isGlob=!0,R=!0;break}}if(S===!0)continue;break}if(b.nonegate!==!0&&B===c&&D===O){I=V.negated=!0,O++;continue}if(b.noparen!==!0&&B===d){if(j=V.isGlob=!0,S===!0){let e=1;for(;H()!==!0&&(B=U());){if(B===a){F=V.backslashes=!0,U();continue}if(B===d){e++;continue}if(B===g&&--e===0){R=!0;break}}continue}break}if(j===!0){if(R=!0,S===!0)continue;break}}b.noext===!0&&(M=!1,j=!1);let W=E,re=``,ie=``;O>0&&(re=E.slice(0,O),E=E.slice(O),k-=O),W&&j===!0&&k>0?(W=E.slice(0,k),ie=E.slice(k)):j===!0?(W=``,ie=E):W=E,W&&W!==``&&W!==`/`&&W!==E&&v(W.charCodeAt(W.length-1))&&(W=W.slice(0,-1)),b.unescape===!0&&(ie&&=n.removeBackslashes(ie),W&&F===!0&&(W=n.removeBackslashes(W)));let ae={prefix:re,input:e,start:O,base:W,glob:ie,isBrace:A,isBracket:ee,isGlob:j,isExtglob:M,isGlobstar:N,negated:I,negatedExtglob:L};if(b.tokens===!0&&(ae.maxDepth=0,v(B)||w.push(V),ae.tokens=w),b.parts===!0||b.tokens===!0){let t;for(let n=0;n<C.length;n++){let r=t===void 0?O:t+1,i=C[n],a=e.slice(r,i);b.tokens&&(n===0&&O!==0?(w[n].isPrefix=!0,w[n].value=re):w[n].value=a,y(w[n]),ae.maxDepth+=w[n].depth),i>=O&&(T.push(a),t=i)}let n=t===void 0?O:t+1,r=e.slice(n);T.push(r),b.tokens&&t&&t+1<e.length&&(w[w.length-1].value=r,y(w[w.length-1]),ae.maxDepth+=w[w.length-1].depth),ae.slashes=C,ae.parts=T}return ae}})),pl=fe(((e,t)=>{let n=ul(),r=dl(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e){if(o===!0){a+=s,o=!1;continue}if(s===`\\`){a+=s,o=!0;continue}if(s===`"`){i=i===1?0:1,a+=s;continue}if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},f=e=>{let t=!1;for(let n of e){if(t===!0){t=!1;continue}if(n===`\\`){t=!0;continue}if(/[?*+@!()[\]{}]/.test(n))return!1}return!0},p=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(f(t))return t.replace(/\\(.)/g,`$1`)},m=e=>{let t=e.map(p).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(a&&r===a.repeat(r.length)&&i===a.repeat(i.length)&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},h=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0){a=!1;continue}if(s===`\\`){a=!0;continue}if(s===`"`){i=i===1?0:1;continue}if(i!==1){if(s===`[`){n++;continue}if(s===`]`&&n>0){n--;continue}if(!(n>0)){if(s===`(`){r++;continue}if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},g=e=>`${e.length===1?r.escapeRegex(e[0]):`[${e.map(e=>r.escapeRegex(e)).join(``)}]`}*`,_=e=>{let t=0,n=[];for(;t<e.length;){let r=h(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=d(r.body).map(e=>e.trim());if(i.length!==1)return;let a=p(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return n},v=e=>{let t=0,n=e.trim(),r=h(n);for(;r;)t++,n=r.body.trim(),r=h(n);return t},y=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,i=d(e).map(e=>e.trim());if(i.length>1&&(i.some(e=>e===``)||i.some(e=>/^[*?]+$/.test(e))||m(i)))return{risky:!0};let a=[],o=!1,s=!0;for(let e of i){let t=_(e);if(t){o=!0,a.push(...t);continue}let n=p(e);if(n&&n.length===1){a.push(n);continue}if(s=!1,v(e)>r)return{risky:!0}}return o?s?{risky:!0,safeOutput:g([...new Set(a)])}:{risky:!0}:{risky:!1}},b=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let d={...t},f=typeof d.maxLength==`number`?Math.min(i,d.maxLength):i,p=e.length;if(p>f)throw SyntaxError(`Input length: ${p}, exceeds maximum allowed length: ${f}`);let m={type:`bos`,value:``,output:d.prepend||``},h=[m],g=d.capture?``:`?:`,_=n.globChars(d.windows),v=n.extglobChars(_),{DOT_LITERAL:x,PLUS_LITERAL:S,SLASH_LITERAL:C,ONE_CHAR:w,DOTS_SLASH:T,NO_DOT:E,NO_DOT_SLASH:D,NO_DOTS_SLASH:O,QMARK:k,QMARK_NO_DOT:A,STAR:ee,START_ANCHOR:j}=_,M=e=>`(${g}(?:(?!${j}${e.dot?T:x}).)*?)`,N=d.dot?``:E,P=d.dot?k:A,F=d.bash===!0?M(d):ee;d.capture&&(F=`(${F})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let I={input:e,index:-1,start:0,dot:d.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};e=r.removePrefix(e,I),p=e.length;let L=[],R=[],te=[],z=m,B,V=()=>I.index===p-1,H=I.peek=(t=1)=>e[I.index+t],ne=I.advance=()=>e[++I.index]||``,U=()=>e.slice(I.index+1),W=(e=``,t=0)=>{I.consumed+=e,I.index+=t},re=e=>{I.output+=e.output==null?e.value:e.output,W(e.value)},ie=()=>{let e=1;for(;H()===`!`&&(H(2)!==`(`||H(3)===`?`);)ne(),I.start++,e++;return e%2!=0&&(I.negated=!0,I.start++,!0)},ae=e=>{I[e]++,te.push(e)},oe=e=>{I[e]--,te.pop()},G=e=>{if(z.type===`globstar`){let t=I.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||L.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(I.output=I.output.slice(0,-z.output.length),z.type=`star`,z.value=`*`,z.output=F,I.output+=z.output)}if(L.length&&e.type!==`paren`&&(L[L.length-1].inner+=e.value),(e.value||e.output)&&re(e),z&&z.type===`text`&&e.type===`text`){z.output=(z.output||z.value)+e.value,z.value+=e.value;return}e.prev=z,h.push(e),z=e},se=(e,t)=>{let n={...v[t],conditions:1,inner:``};n.prev=z,n.parens=I.parens,n.output=I.output,n.startIndex=I.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;ae(`parens`),G({type:e,value:t,output:I.output?``:w}),G({type:`paren`,extglob:!0,value:ne(),output:r}),L.push(n)},ce=n=>{let i=e.slice(n.startIndex,I.index+1),a=e.slice(n.startIndex+2,I.index),o=y(a,d);if((n.type===`plus`||n.type===`star`)&&o.risky){let e=o.safeOutput?(n.output?``:w)+(d.capture?`(${o.safeOutput})`:o.safeOutput):void 0,t=h[n.tokensIndex];t.type=`text`,t.value=i,t.output=e||r.escapeRegex(i);for(let e=n.tokensIndex+1;e<h.length;e++)h[e].value=``,h[e].output=``,delete h[e].suffix;I.output=n.output+t.output,I.backtrack=!0,G({type:`paren`,extglob:!0,value:B,output:``}),oe(`parens`);return}let s=n.close+(d.capture?`)`:``),c;if(n.type===`negate`){let e=F;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=M(d)),(e!==F||V()||/^\)+$/.test(U()))&&(s=n.close=`)$))${e}`),n.inner.includes(`*`)&&(c=U())&&/^\.[^\\/.]+$/.test(c)&&(s=n.close=`)${b(c,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(I.negatedExtglob=!0)}G({type:`paren`,extglob:!0,value:B,output:s}),oe(`parens`)};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?k.repeat(a.length):``):o===0?P+(a?k.repeat(a.length):``):k.repeat(r.length):i===`.`?x.repeat(r.length):i===`*`?t?t+i+(a?F:``):F:t?e:`\\${e}`);return n===!0&&(i=d.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&d.contains===!0?(I.output=e,I):(I.output=r.wrapOutput(i,I,t),I)}for(;!V();){if(B=ne(),B===`\0`)continue;if(B===`\\`){let e=H();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){B+=`\\`,G({type:`text`,value:B});continue}let t=/^\\+/.exec(U()),n=0;if(t&&t[0].length>2&&(n=t[0].length,I.index+=n,n%2!=0&&(B+=`\\`)),d.unescape===!0?B=ne():B+=ne(),I.brackets===0){G({type:`text`,value:B});continue}}if(I.brackets>0&&(B!==`]`||z.value===`[`||z.value===`[^`)){if(d.posix!==!1&&B===`:`){let e=z.value.slice(1);if(e.includes(`[`)&&(z.posix=!0,e.includes(`:`))){let e=z.value.lastIndexOf(`[`),t=z.value.slice(0,e),n=z.value.slice(e+2),r=a[n];if(r){z.value=t+r,I.backtrack=!0,ne(),!m.output&&h.indexOf(z)===1&&(m.output=w);continue}}}(B===`[`&&H()!==`:`||B===`-`&&H()===`]`)&&(B=`\\${B}`),B===`]`&&(z.value===`[`||z.value===`[^`)&&(B=`\\${B}`),d.posix===!0&&B===`!`&&z.value===`[`&&(B=`^`),z.value+=B,re({value:B});continue}if(I.quotes===1&&B!==`"`){B=r.escapeRegex(B),z.value+=B,re({value:B});continue}if(B===`"`){I.quotes=I.quotes===1?0:1,d.keepQuotes===!0&&G({type:`text`,value:B});continue}if(B===`(`){ae(`parens`),G({type:`paren`,value:B});continue}if(B===`)`){if(I.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=L[L.length-1];if(e&&I.parens===e.parens+1){ce(L.pop());continue}G({type:`paren`,value:B,output:I.parens?`)`:`\\)`}),oe(`parens`);continue}if(B===`[`){if(d.nobracket===!0||!U().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));B=`\\${B}`}else ae(`brackets`);G({type:`bracket`,value:B});continue}if(B===`]`){if(d.nobracket===!0||z&&z.type===`bracket`&&z.value.length===1){G({type:`text`,value:B,output:`\\${B}`});continue}if(I.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));G({type:`text`,value:B,output:`\\${B}`});continue}oe(`brackets`);let e=z.value.slice(1);if(z.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(B=`/${B}`),z.value+=B,re({value:B}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(z.value);if(I.output=I.output.slice(0,-z.value.length),d.literalBrackets===!0){I.output+=t,z.value=t;continue}z.value=`(${g}${t}|${z.value})`,I.output+=z.value;continue}if(B===`{`&&d.nobrace!==!0){ae(`braces`);let e={type:`brace`,value:B,output:`(`,outputIndex:I.output.length,tokensIndex:I.tokens.length};R.push(e),G(e);continue}if(B===`}`){let e=R[R.length-1];if(d.nobrace===!0||!e){G({type:`text`,value:B,output:B});continue}let t=`)`;if(e.dots===!0){let e=h.slice(),n=[];for(let t=e.length-1;t>=0&&(h.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,d),I.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=I.output.slice(0,e.outputIndex),r=I.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,B=t=`\\}`,I.output=n;for(let e of r)I.output+=e.output||e.value}G({type:`brace`,value:B,output:t}),oe(`braces`),R.pop();continue}if(B===`|`){L.length>0&&L[L.length-1].conditions++,G({type:`text`,value:B});continue}if(B===`,`){let e=B,t=R[R.length-1];t&&te[te.length-1]===`braces`&&(t.comma=!0,e=`|`),G({type:`comma`,value:B,output:e});continue}if(B===`/`){if(z.type===`dot`&&I.index===I.start+1){I.start=I.index+1,I.consumed=``,I.output=``,h.pop(),z=m;continue}G({type:`slash`,value:B,output:C});continue}if(B===`.`){if(I.braces>0&&z.type===`dot`){z.value===`.`&&(z.output=x);let e=R[R.length-1];z.type=`dots`,z.output+=B,z.value+=B,e.dots=!0;continue}if(I.braces+I.parens===0&&z.type!==`bos`&&z.type!==`slash`){G({type:`text`,value:B,output:x});continue}G({type:`dot`,value:B,output:x});continue}if(B===`?`){if(!(z&&z.value===`(`)&&d.noextglob!==!0&&H()===`(`&&H(2)!==`?`){se(`qmark`,B);continue}if(z&&z.type===`paren`){let e=H(),t=B;(z.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(U()))&&(t=`\\${B}`),G({type:`text`,value:B,output:t});continue}if(d.dot!==!0&&(z.type===`slash`||z.type===`bos`)){G({type:`qmark`,value:B,output:A});continue}G({type:`qmark`,value:B,output:k});continue}if(B===`!`){if(d.noextglob!==!0&&H()===`(`&&(H(2)!==`?`||!/[!=<:]/.test(H(3)))){se(`negate`,B);continue}if(d.nonegate!==!0&&I.index===0){ie();continue}}if(B===`+`){if(d.noextglob!==!0&&H()===`(`&&H(2)!==`?`){se(`plus`,B);continue}if(z&&z.value===`(`||d.regex===!1){G({type:`plus`,value:B,output:S});continue}if(z&&(z.type===`bracket`||z.type===`paren`||z.type===`brace`)||I.parens>0){G({type:`plus`,value:B});continue}G({type:`plus`,value:S});continue}if(B===`@`){if(d.noextglob!==!0&&H()===`(`&&H(2)!==`?`){G({type:`at`,extglob:!0,value:B,output:``});continue}G({type:`text`,value:B});continue}if(B!==`*`){(B===`$`||B===`^`)&&(B=`\\${B}`);let e=o.exec(U());e&&(B+=e[0],I.index+=e[0].length),G({type:`text`,value:B});continue}if(z&&(z.type===`globstar`||z.star===!0)){z.type=`star`,z.star=!0,z.value+=B,z.output=F,I.backtrack=!0,I.globstar=!0,W(B);continue}let t=U();if(d.noextglob!==!0&&/^\([^?]/.test(t)){se(`star`,B);continue}if(z.type===`star`){if(d.noglobstar===!0){W(B);continue}let n=z.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(d.bash===!0&&(!i||t[0]&&t[0]!==`/`)){G({type:`star`,value:B,output:``});continue}let o=I.braces>0&&(n.type===`comma`||n.type===`brace`),s=L.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){G({type:`star`,value:B,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[I.index+4];if(n&&n!==`/`)break;t=t.slice(3),W(`/**`,3)}let c=V()||I.parens>0&&t===`)`.repeat(I.parens)&&!L.some(e=>e.type===`negate`);if(n.type===`bos`&&V()){z.type=`globstar`,z.value+=B,z.output=M(d),I.output=z.output,I.globstar=!0,W(B);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&c){I.output=I.output.slice(0,-(n.output+z.output).length),n.output=`(?:${n.output}`,z.type=`globstar`,z.output=M(d)+(d.strictSlashes?`)`:`|$)`),z.value+=B,I.globstar=!0,I.output+=n.output+z.output,W(B);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;I.output=I.output.slice(0,-(n.output+z.output).length),n.output=`(?:${n.output}`,z.type=`globstar`,z.output=`${M(d)}${C}|${C}${e})`,z.value+=B,I.output+=n.output+z.output,I.globstar=!0,W(B+ne()),G({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){z.type=`globstar`,z.value+=B,z.output=`(?:^|${C}|${M(d)}${C})`,I.output=z.output,I.globstar=!0,W(B+ne()),G({type:`slash`,value:`/`,output:``});continue}I.output=I.output.slice(0,-z.output.length),z.type=`globstar`,z.output=M(d),z.value+=B,I.output+=z.output,I.globstar=!0,W(B);continue}let n={type:`star`,value:B,output:F};if(d.bash===!0){n.output=`.*?`,(z.type===`bos`||z.type===`slash`)&&(n.output=N+n.output),G(n);continue}if(z&&(z.type===`bracket`||z.type===`paren`)&&d.regex===!0){n.output=B,G(n);continue}(I.index===I.start||z.type===`slash`||z.type===`dot`)&&(z.type===`dot`?(I.output+=D,z.output+=D):d.dot===!0?(I.output+=O,z.output+=O):(I.output+=N,z.output+=N),H()!==`*`&&(I.output+=w,z.output+=w)),G(n)}for(;I.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));I.output=r.escapeLast(I.output,`[`),oe(`brackets`)}for(;I.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));I.output=r.escapeLast(I.output,`(`),oe(`parens`)}for(;I.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));I.output=r.escapeLast(I.output,`{`),oe(`braces`)}if(d.strictSlashes!==!0&&(z.type===`star`||z.type===`bracket`)&&G({type:`maybe_slash`,value:``,output:`${C}?`}),I.backtrack===!0){I.output=``;for(let e of I.tokens)I.output+=e.output==null?e.value:e.output,e.suffix&&(I.output+=e.suffix)}return I};b.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:u,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:_}=n.globChars(a.windows),v=a.dot?m:p,y=a.dot?h:p,b=a.capture?``:`?:`,x={negated:!1,prefix:``},S=a.bash===!0?`.*?`:g;a.capture&&(S=`(${S})`);let C=e=>e.noglobstar===!0?S:`(${b}(?:(?!${_}${e.dot?f:l}).)*?)`,w=e=>{switch(e){case`*`:return`${v}${d}${S}`;case`.*`:return`${l}${d}${S}`;case`*.*`:return`${v}${S}${l}${d}${S}`;case`*/*`:return`${v}${S}${u}${d}${y}${S}`;case`**`:return v+C(a);case`**/*`:return`(?:${v}${C(a)}${u})?${y}${d}${S}`;case`**/*.*`:return`(?:${v}${C(a)}${u})?${y}${S}${l}${d}${S}`;case`**/.*`:return`(?:${v}${C(a)}${u})?${l}${d}${S}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=w(t[1]);return n?n+l+t[2]:void 0}}},T=w(r.removePrefix(e,x));return T&&a.strictSlashes!==!0&&(T+=`${u}?`),T},t.exports=b})),ml=fe(((e,t)=>{let n=fl(),r=pl(),i=dl(),a=ul(),o=e=>e&&typeof e==`object`&&!Array.isArray(e),s=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>s(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=o(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=c.state;delete c.state;let u=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=s(i.ignore,e,n)}let d=(n,r=!1)=>{let{isMatch:o,match:d,output:f}=s.test(n,c,t,{glob:e,posix:a}),p={glob:e,state:l,regex:c,posix:a,input:n,output:f,match:d,isMatch:o};return typeof i.onResult==`function`&&i.onResult(p),o===!1?(p.isMatch=!1,r?p:!1):u(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),!r||p)};return n&&(d.state=l),d};s.test=(e,t,n,{glob:r,posix:a}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},c=o.format||(a?i.toPosixSlashes:null),l=e===r,u=l&&c?c(e):e;return l===!1&&(u=c?c(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?s.matchBase(e,t,n,a):t.exec(u)),{isMatch:!!l,match:l,output:u}},s.matchBase=(e,t,n,r=n&&n.windows)=>(t instanceof RegExp?t:s.makeRe(t,n)).test(i.basename(e,{windows:r})),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map(e=>s.parse(e,t)):r(e,{...t,fastpaths:!1}),s.scan=(e,t)=>n(e,t),s.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,c=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(c=`^(?!${c}).*$`);let l=s.toRegex(c,t);return r===!0&&(l.state=e),l},s.makeRe=(e,t={},n=!1,i=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=r.fastpaths(e,t)),a.output||(a=r(e,t)),s.compileRe(a,t,n,i)},s.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},s.constants=a,t.exports=s})),hl=me(fe(((e,t)=>{let n=ml(),r=dl();function i(e,t,i=!1){return t&&(t.windows===null||t.windows===void 0)&&(t={...t,windows:r.isWindows()}),n(e,t,i)}Object.assign(i,n),t.exports=i}))(),1);function gl(e){return e.replaceAll(`\\`,`/`)}const _l=Array.isArray;function vl(e){return _l(e)?e:e==null?[]:[e]}const yl=`[_#EsCaPe#_]`;function bl(e,t){return t===!1||ll(e)||e.startsWith(`**`)?gl(e):al(gl(sl(t||``)).replaceAll(/[-^$*+?.()|[\]{}]/g,`${yl}$&`),gl(e)).replaceAll(yl,`\\`)}function xl(e,t,n){let r=n&&n.resolve,i=e=>e instanceof RegExp?e:{test:t=>(0,hl.default)(bl(e,r),{dot:!0})(t)},a=vl(e).map(i),o=vl(t).map(i);return!a.length&&!o.length?e=>typeof e==`string`&&!e.includes(`\0`):function(e){if(typeof e!=`string`||e.includes(`\0`))return!1;let t=gl(e);for(let e of o)if(e instanceof RegExp&&(e.lastIndex=0),e.test(t))return!1;for(let e of a)if(e instanceof RegExp&&(e.lastIndex=0),e.test(t))return!0;return!a.length}}const Sl={root:void 0,colorPreview:!1,remToPxPreview:!0,remToPxRatio:16,syntaxHighlight:!0,strictAnnotationMatch:!1,unmatchedDiagnostics:!0,autocompleteMatchType:`prefix`,autocompleteStrict:!1,autocompleteMaxItems:1e3},Cl=/^#(?:[0-9a-f]{3,8})$/i,wl=/^(?:rgb|rgba|hsl|hsla|hwb|oklch|oklab|lab|lch|device-cmyk|color)\(/i,Tl=/^(?:media|supports|container)\b/;function El(e={}){let t=new Set(Object.keys(e.colors??{})),n=new Set(Object.keys(e.breakpoint??e.breakpoints??{}));return{isColorValue(e){let n=e.trim();if(n.startsWith(`[`)&&n.endsWith(`]`)&&(n=n.slice(1,-1)),!n)return!1;if(n===`current`||n===`transparent`||Cl.test(n)||wl.test(n))return!0;let r=n.split(`/`)[0].split(`-`)[0];return t.has(r)},isBreakpoint(e){if(Tl.test(e))return!0;let t=e.replace(/^(?:max|min)-/,``).split(/[^a-z0-9]/i)[0];return n.has(t)}}}R([te,z,B,V,H,ne]);const Dl=/var\((?<cssVarName>--[^,|)]+)(?:,(?<fallback>[^)]+))?\)/g,Ol=String.raw`(?:#|0x)(?:[a-f0-9]{3}|[a-f0-9]{4}|[a-f0-9]{6}|[a-f0-9]{8})\b|(?:rgb|rgba|hsl|hsla|hwb|oklch|oklab|lab|lch|device-cmyk|color)\([^)]*\)`,kl=new RegExp(Ol,`g`),Al=/var\((--[^,|)]+)(?:,([^)]+))?\)/,jl=String.raw`(?:^|[;{]\s*)(?:[\w-]+-color|color|fill|stroke)\s*:\s*(?<value>[^;}{]+)`,Ml=new RegExp(jl,`gm`),Nl=/(?:^|[;{])\s*--[^\s:;{}]+\s*:/m,Pl=new RegExp(Ol,`i`),Fl=new RegExp(jl,`m`),Il=new RegExp(String.raw`color-mix\([^,]+,\s*(?<color>${Ol})\s+(?<weight>\d+(?:\.\d+)?%)\s*,\s*transparent\s*\)`,`i`);function Ll(e){return Nl.test(e)||Fl.test(e)||Rl(e)}function Rl(e){return Pl.test(e)}function zl(e){let t=/(?:^|[;{])\s*(?<key>--[^\s:;{}]+)\s*:\s*(?<value>[^;{}]+)(?=;|})/gm,n=new Map;for(let r of e.matchAll(t)){let e=r.groups?.key;e&&n.set(e,(r.groups?.value??``).trim().replace(/\s*!important\s*$/,``))}return n}function Bl(e,t){let n=e.trim(),r=new Set;for(;n.startsWith(`var(`);){let e=n.match(Al);if(!e)break;let i=e[1].trim(),a=e[2]?.trim();if(r.has(i))return a;r.add(i);let o=t.get(i)?.trim();if(o){n=o;continue}return a||`1`}return n}function Vl(e,t){let n=e;for(let r of e.matchAll(Dl)){let e=r[0],i=r.groups?.cssVarName?.trim(),a=r.groups?.fallback;if(!i)continue;let o=t.get(i);o?n=n.replaceAll(e,Bl(o,t)??a??`1`):a&&(n=n.replaceAll(e,a))}return n.replaceAll(/,?\s+var\(--.*?\)/g,``)}function Hl(e,t){let n=Vl(e,t),r=n.match(Il);if(r?.groups?.color){let e=r.groups.color,t=r.groups.weight;if(e)return/\//.test(e)?e:e.replace(/\)$/,` / ${t})`)}let i=n.match(kl)?.[0];if(!i){let e=n.trim().replace(/\s*!important$/,``);return L(e).isValid()?e:void 0}return/\/\)/.test(i)&&(i=i.replace(/ \/\)/g,`/ 1)`)),i}function Ul(e){let t=zl(e);for(let n of e.matchAll(Ml)){let e=n.groups?.value;if(!e)continue;let r=Hl(e,t);if(r)return r}return Hl(e,t)}function Wl(e){let t=L(e);if(!t.isValid())return;let n=t.toRgb();return{red:n.r/255,green:n.g/255,blue:n.b/255,alpha:n.alpha}}const Gl=/(-?[\d.]+)rem(\s+!important)?;/;let Kl;function ql(e){return e.default??e}function Jl(){return Kl??=Promise.all([import(`prettier/standalone`),import(`prettier/parser-postcss`)]).then(([e,t])=>({prettier:ql(e),parserCSS:ql(t)}))}function Yl(e,t=16){if(!e)return``;if(t<1)return e;let n=0,r=[];for(;n<e.length;){let i=e.slice(n).match(Gl);if(i?.index==null)break;let a=` /* ${Number.parseFloat(i[1])*t}px */`,o=n+i.index+i[0].length;r.push(e.slice(n,o)),r.push(a),n=o}return r.push(e.slice(n)),r.join(``)}async function Xl(e,t,n){let[r,{prettier:i,parserCSS:a}]=await Promise.all([e.generate(new Set(ye(t)),{preflights:!1,safelist:!1}),Jl()]),o=Yl(r.css,n),s=await i.format(o,{parser:`css`,plugins:[a]});return{...r,prettified:s}}async function Zl(e,t,n){return`\`\`\`css\n${(await Xl(e,t,n)).prettified.trimEnd()}\n\`\`\``}const Ql=[`property`,`class`,`keyword`,`number`,`enumMember`,`string`,`operator`,`type`],$l=[`important`,`pseudoClass`,`pseudoElement`,`query`,`selector`,`variable`,`combinator`,`bracket`,`group`,`condition`],eu=/^-?(?:\d+\.?\d*|\.\d+)[a-z%]*$/i,tu=/^[>+~_[&.#*: ]/,nu=/^[>+~_.#]/;function ru(e,t){return t?.isColorValue?.(e)?`enumMember`:e.startsWith(`[`)?`string`:eu.test(e)?`number`:`keyword`}function iu(e,t){return e.startsWith(`::`)?{type:`type`,modifier:`pseudoElement`,symbolLen:0}:nu.test(e)?{type:`type`,modifier:`selector`,symbolLen:1}:tu.test(e)?{type:`type`,modifier:`selector`,symbolLen:0}:t?.isBreakpoint?.(e)?{type:`keyword`,modifier:`query`,symbolLen:0}:{type:`keyword`,modifier:`pseudoClass`,symbolLen:0}}function au(e,t,n,r){e.push({start:n,length:1,type:`operator`,modifiers:[`condition`]});let i=n+1,a=t;if(a.startsWith(`!`)&&(e.push({start:i,length:1,type:`operator`,modifiers:[`important`]}),i+=1,a=a.slice(1)),a.length){let{type:t,modifier:n,symbolLen:o}=iu(a,r);o&&(e.push({start:i,length:o,type:`operator`,modifiers:[`combinator`]}),i+=o,a=a.slice(o)),a.length&&e.push({start:i,length:a.length,type:t,modifiers:[n]})}return n+t.length+1}function ou(e,t,n){let r=-1,i=t=>{r>=0&&(e.push({start:n+r,length:t-r,type:`string`,modifiers:[]}),r=-1)};for(let a=0;a<t.length;a++){let o=t[a];o===`[`||o===`]`||o===`_`?(i(a),e.push({start:n+a,length:1,type:`operator`,modifiers:[`bracket`]})):r<0&&(r=a)}i(t.length)}function su(e,t,n,r,i){let a=+!!t.startsWith(`$`);a&&e.push({start:n,length:1,type:`operator`,modifiers:[`variable`]});let o=t.slice(a);if(!o.length)return;if(r===`value`&&o.startsWith(`[`)){ou(e,o,n+a);return}if(r===`value`&&a&&o.includes(`|`)){let t=o.indexOf(`|`),r=o.slice(0,t),s=o.slice(t+1);if(r.length&&e.push({start:n+a,length:r.length,type:ru(r,i),modifiers:[]}),e.push({start:n+a+t,length:1,type:`operator`,modifiers:[`important`]}),s.length){let r=n+a+t+1;s.startsWith(`[`)?ou(e,s,r):e.push({start:r,length:s.length,type:ru(s,i),modifiers:[]})}return}let s=r===`property`?`property`:ru(o,i);e.push({start:n+a,length:o.length,type:s,modifiers:[]})}function cu(e,t,n){if(!e)return[];if(e.startsWith(`{`)&&e.includes(`}`))return uu(e,t,n);let r=Pe(e),i=[];if(r.keyword)r.body.length&&(r.body.startsWith(`[`)?ou(i,r.body,t):i.push({start:t,length:r.body.length,type:`class`,modifiers:[]}));else{let e=r.property??``,a=r.value??``;e.length&&su(i,e,t,`property`,n),i.push({start:t+e.length,length:1,type:`operator`,modifiers:[]}),a.length&&su(i,a,t+e.length+1,`value`,n)}let a=t+r.body.length;r.important&&(i.push({start:a,length:1,type:`operator`,modifiers:[`important`]}),a+=1);for(let e of r.conditions)a=au(i,e,a,n);return i}function lu(e,t,n){let r=0;for(let i=n;i<e.length;i++){let n=e[i];if(n===`\\`)i++;else if(n===`[`||n===`(`)r++;else if(n===`]`||n===`)`)r--;else if(n===t&&r<=0)return i}return-1}function uu(e,t,n){let r=[],i=lu(e,`}`,0);r.push({start:t,length:1,type:`operator`,modifiers:[`group`]});let a=t+1,o=e.slice(1,i),s=[],c=0;for(;;){let e=lu(o,`;`,c);if(e===-1){s.push(o.slice(c));break}s.push(o.slice(c,e)),c=e+1}s.forEach((e,t)=>{if(t>0&&(r.push({start:a,length:1,type:`operator`,modifiers:[`group`]}),a+=1),e.length){for(let t of cu(e,a,n))r.push(t);a+=e.length}}),r.push({start:t+i,length:1,type:`operator`,modifiers:[`group`]});let l=t+i+1,u=e.slice(i+1);if(u.startsWith(`!`)&&(r.push({start:l,length:1,type:`operator`,modifiers:[`important`]}),l+=1,u=u.slice(1)),u.startsWith(`@`))for(let e of u.slice(1).split(`@`))l=au(r,e,l,n);return r}const du=new Map,fu=new WeakMap;function pu(e,t){return e<t?-1:+(e>t)}function mu(e,t){return pu(e??``,t??``)}function hu(e,t){return e[0]-t[0]||(e[4]?.sort??0)-(t[4]?.sort??0)||mu(e[5]?.currentSelector,t[5]?.currentSelector)||mu(e[1],t[1])||pu(e[2],t[2])}function gu(e){let t=!1,n=0,r,i=``;for(let a=0;a<e.length;a++){let o=e[a];if(t){o===`*`&&e[a+1]===`/`&&(t=!1,a++);continue}if(r){o===`\\`?a++:o===r&&(r=void 0);continue}if(o===`/`&&e[a+1]===`*`){t=!0,a++;continue}if(o===`\\`){a++;continue}if(o===`"`||o===`'`){r=o;continue}if(!/\s/.test(o)||e[a+1]!==`$`||e[a+2]!==`$`||!/\s/.test(e[a+3]??``))continue;let s=a+4;for(;s<e.length&&/\s/.test(e[s]);)s++;i+=`${e.slice(n,a)} `,n=s,a=s-1}return n?i+e.slice(n):e}function _u(e){let t=[],n=0,r=!1,i=0,a,o=0;for(let s=0;s<e.length;s++){let c=e[s];r?c===`*`&&e[s+1]===`/`&&(r=!1,s++):a?c===`\\`?s++:c===a&&(a=void 0):c===`/`&&e[s+1]===`*`?(r=!0,s++):c===`"`||c===`'`?a=c:c===`(`?i++:c===`)`?i>0&&i--:c===`[`?n++:c===`]`?n>0&&n--:n===0&&i===0&&e.startsWith(` $$ `,s)&&(t.push(e.slice(o,s)),s+=3,o=s+1)}return t.push(e.slice(o)),t}function vu(e){let t=du.get(e);if(t!==void 0)return t;let n=Ll(e);return Lc(du,e,n,2048),n}function yu(e){let t=new Map,n=new Map,r=0;for(let i of e){let[a,o,s]=i;if(s){e[r++]=i;continue}let c=a.length?t:n,l=c.get(o);l?a.length&&l[0].push(...a):(c.set(o,i),e[r++]=i)}e.length=r}function bu(e,t,n){let r=e.sort(hu).map(([,e,t,,n,,r])=>{let i=e&&!n?.noScope?gu(e):e;return[i==null?[]:[[i,n?.sort??0]],t,!!(r??n?.noMerge)]});t&&yu(r);let i=[];for(let e=r.length-1;e>=0;e--){let[t,n]=r[e],a=t.length===1?t[0][0]:``;t.length>1&&(t.sort((e,t)=>e[1]-t[1]||pu(e[0],t[0])),a=[...new Set(t.map(([e])=>e).filter(Boolean))].join(`,
|
|
30
30
|
`)),i.push(a?`${a}{${n}}`:n)}let a=[...new Set(i)].reverse();return(n?a:a.filter(vu)).join(`
|
|
31
31
|
`)}function xu(e,t,n){let r=new Map,i=new Set([Le]);for(let e of n){let t=e[4]?.layer||`utilities`;i.add(t);let n=e[3]||``,a=r.get(t);a||(a=new Map,r.set(t,a));let o=a.get(n);o?o.push(e):a.set(n,[e])}let a=t=>Object.hasOwn(e.layers,t)?e.layers[t]??0:0,o=e.sortLayers([...i].sort((e,t)=>a(e)-a(t)||pu(e,t))),s=[];for(let n of o){let i=r.get(n);if(i)for(let n of[...i.keys()].sort((e,n)=>Mi(t,e,n))){let t=bu(i.get(n),e.mergeSelectors,vu(n));if(t){if(!n)s.push(t);else{let e=_u(n);s.push(`${e.join(`{`)}{${t}${`}`.repeat(e.length)}`)}}}}return s.join(`
|
|
32
32
|
`)}async function Su(e,t){let n=e.config,r=await e.parseToken(t);if(e.config!==n)return Su(e,t);if(r?.length)return Ul(xu(n,new Map(e.parentOrders),r))}async function Cu(e,t){let n=fu.get(e);return(!n||n.config!==e.config)&&(n={config:e.config,values:new Map},fu.set(e,n)),Rc(n.values,t,1e3,()=>Su(e,t).then(e=>e?{colorString:e,color:Wl(e)}:{}))}const wu=[...$l,`teacss`],Tu={tokenTypes:[...Ql],tokenModifiers:wu},Eu=new Map(Ql.map((e,t)=>[e,t])),Du=new Map(wu.map((e,t)=>[e,1<<t])),Ou=Du.get(`teacss`)??0,ku=/^-?(?:\d+\.?\d*|\.\d+)[a-z%]*$/i,Au=new WeakMap,ju={log(){},warn(){}},Mu=Symbol.for(`@teacss/config/role-palettes`),Nu=Symbol.for(`@teacss/preset-standard/physical-palettes`);function Pu(e,t){let n=Fs(e,t)?.toLowerCase();return n?.endsWith(`class`)||n?.endsWith(`classname`)}function Fu(e){let t=[];if(!e.includes(`:`))for(let n=e.indexOf(`-`);n>0;n=e.indexOf(`-`,n+1))t.push(`${e.slice(0,n)}:${e.slice(n+1)}`);let n=e.indexOf(`:`);return n>0&&e.indexOf(`:`,n+1)>n&&t.push(`${e.slice(n+1)}@${e.slice(0,n)}`),t}function Iu(e,t){let n=e[t-1];if(n===`"`||n===`'`){for(let r=t;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===n)return r;return e.length}let r=t;for(;r<e.length&&!/[\s>]/.test(e[r]);)r++;return r}async function Lu(e,t,n){let r=Array(e.length),i=0,a=Array.from({length:Math.min(t,e.length)},async()=>{for(;i<e.length;){let t=i++;r[t]=await n(e[t],t)}});return await Promise.all(a),r}function Ru(e){return!e.startsWith(`[`)||!e.endsWith(`]`)||Wl(e.slice(1,-1).replace(/\\?_/g,e=>e===`_`?` `:`_`).trim())!==void 0}function zu(e){let t=Au.get(e);if(t?.config===e.config)return t.classifier;let n=El(e.config?.theme??{});return Au.set(e,{config:e.config,classifier:n}),n}function Bu(e){e.sort((e,t)=>e.line-t.line||e.char-t.char);let t=[],n=0,r=0;for(let i of e){let e=i.line-n,a=e===0?i.char-r:i.char;t.push(e,a,i.length,i.type,i.modifiers),n=i.line,r=i.char}return{data:t}}function Vu(e,t,n,r,i=Ou){let a=e.positionAt(t);return{line:a.line,char:a.character,length:n,type:Eu.get(r)??0,modifiers:i}}function Hu(e,t,n,r,i=Ou){let a=[],o=0;for(let s=0;s<n.length;s++)(n[s]===`\r`||n[s]===`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teacss/language-server",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.6",
|
|
4
4
|
"description": "Standalone LSP server for TeaCSS — completion, hover, color, and token highlighting over stdio.",
|
|
5
5
|
"homepage": "https://css.teasim.com",
|
|
6
6
|
"funding": "https://github.com/sponsors/billgo",
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@colordx/core": "^6.3.0",
|
|
33
|
-
"@teacss/config": "0.6.
|
|
34
|
-
"@teacss/language-service": "0.6.
|
|
35
|
-
"@teacss/runtime": "0.6.
|
|
33
|
+
"@teacss/config": "0.6.6",
|
|
34
|
+
"@teacss/language-service": "0.6.6",
|
|
35
|
+
"@teacss/runtime": "0.6.6",
|
|
36
36
|
"magic-string": "^1.2.3",
|
|
37
37
|
"prettier": "^3.9.6",
|
|
38
38
|
"vscode-languageserver": "^10.1.1",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"vscode-languageserver-types": "^3.18.3"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@teacss/autocomplete": "0.6.
|
|
44
|
-
"@teacss/core": "0.6.
|
|
45
|
-
"@teacss/preset-standard": "0.6.
|
|
43
|
+
"@teacss/autocomplete": "0.6.6",
|
|
44
|
+
"@teacss/core": "0.6.6",
|
|
45
|
+
"@teacss/preset-standard": "0.6.6"
|
|
46
46
|
},
|
|
47
47
|
"engines": {
|
|
48
48
|
"node": ">=22.12.0"
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
},
|
|
53
53
|
"inlinedDependencies": {
|
|
54
54
|
"fzf": "0.5.2",
|
|
55
|
-
"lru-cache": "11.5.
|
|
55
|
+
"lru-cache": "11.5.3",
|
|
56
56
|
"pathe": "2.0.3",
|
|
57
|
-
"picomatch": "4.0.
|
|
57
|
+
"picomatch": "4.0.7",
|
|
58
58
|
"unplugin-utils": "0.3.2"
|
|
59
59
|
}
|
|
60
60
|
}
|