@tailwindcss/language-server 0.14.14 → 0.14.15

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.
@@ -3578,7 +3578,7 @@ input:where([type='button'], [type='reset'], [type='submit']),
3578
3578
  `;var rM=`@tailwind utilities;
3579
3579
  `;var nM={tailwindcss:GL,"tailwindcss/index":GL,"tailwindcss/index.css":GL,"tailwindcss/preflight":eM,"tailwindcss/preflight.css":eM,"tailwindcss/theme":tM,"tailwindcss/theme.css":tM,"tailwindcss/utilities":rM,"tailwindcss/utilities.css":rM};var XL={"@tailwindcss/forms":()=>Promise.resolve().then(()=>Er(Ek())).then(t=>t.default),"@tailwindcss/aspect-ratio":()=>Promise.resolve().then(()=>Er(nk())).then(t=>t.default),"@tailwindcss/typography":()=>Promise.resolve().then(()=>Er(TN())).then(t=>t.default)};var PWe=/@import\s*(?:'tailwindcss'|"tailwindcss")/,wWe=/@theme\s*\{/;async function kWe(t){return wWe.test(t)||PWe.test(t)}function iM({dependencies:t,legacy:e,jiti:n,filepath:i,resolver:o,onError:r}){let l=`${+Date.now()}`;async function s(u,H,a){try{let c=await o.resolveJsId(u,H);t.add(c);let p=hH(c);return p.searchParams.append("t",l),await n.import(p.href,{default:!0})}catch(c){if(a==="plugin"&&u in XL)return console.log("Loading bundled plugin for: ",u),await XL[u]();if(c&&typeof c.details=="string"){let p=c.details,d=/^resolve '([^']+)'/,h=p.match(d);if(h){let[m,g]=h;g in XL&&console.log(`[error] Cannot load '${u}' plugins inside configs or plugins is not currently supported`)}}return r(u,c,a)}}if(e){let u=ZL.dirname(i);return H=>s(H,u,"module")}return async(u,H,a)=>({base:H,module:await s(u,H,a)})}async function sM(t,e,n,i,o){if(!e.__unstable__loadDesignSystem||!kWe(i))return null;let r=new Set,l=!1;try{await e.__unstable__loadDesignSystem(i,{loadStylesheet:async(H,a)=>(l=!0,{base:a,content:""})})}catch{}l||(i=(await KL({resolver:t}).process(i,{from:n})).css);let s=Use(__filename,{moduleCache:!1,fsCache:!1}),u=await e.__unstable__loadDesignSystem(i,{base:ZL.dirname(n),loadModule:iM({dependencies:r,legacy:!1,jiti:s,filepath:n,resolver:t,onError:(H,a,c)=>{if(console.error(`Unable to load ${c}: ${H}`,a),c==="config")return{};if(c==="plugin")return()=>{}}}),loadStylesheet:async(H,a)=>{try{let c=await t.resolveCssId(H,a);return r.add(c),{base:ZL.dirname(c),content:await aoe.readFile(c,"utf-8")}}catch(c){return o&&H in nM?(console.error(`Loading fallback stylesheet for: ${H}`),{base:a,content:nM[H]}):(console.error(`Unable to load stylesheet: ${H}`,c),{base:a,content:""})}},loadPlugin:iM({dependencies:r,legacy:!0,jiti:s,filepath:n,resolver:t,onError(H,a){return console.error(`Unable to load plugin: ${H}`,a),()=>{}}}),loadConfig:iM({dependencies:r,legacy:!0,jiti:s,filepath:n,resolver:t,onError(H,a){return console.error(`Unable to load config: ${H}`,a),{}}})});return Object.assign(u,{dependencies:()=>r,compile(H){let a=u.candidatesToCss(H),c=[],p=a.map(d=>{if(d===null)return $l.root();try{return $l.parse(d.trimEnd())}catch(h){return c.push(h),$l.root()}});return c.length>0&&console.error(JSON.stringify(c)),p},toCss(H){return Array.isArray(H)?$l.root({nodes:H}).toString().trim():H.toString().trim()}}),u}var ooe=require("node:fs/promises");async function zp(t){try{let e=await(0,ooe.readFile)(t,"utf8");return vs(e,"css")}catch{return null}}var o1e=Object.keys(_1e.default);function l1e(t,e){return JSON.stringify([t,...e].map(n=>[n,eh.statSync(n).mtimeMs]))}function m1e(t){if(typeof t.mode<"u")return t.mode;if(Array.isArray(t.presets))for(let e=t.presets.length-1;e>=0;e--){let n=m1e(t.presets[e]);if(typeof n<"u")return n}}function E1e(t){if(delete t.mode,Array.isArray(t.presets))for(let e of t.presets)E1e(e)}function Vx(t,e){let n,i=_s.dirname(t),o=[t,i];if(i===e)return o;for(;i=_s.dirname(n=i),n!==i;)if(o.push(i),i===e)break;return o}async function y1e(t,e,n,i,o,r,l,s,u,H,a,c,p){let d=new Set;d.add(e.configPath);let h=!1,m=e.folder,g=[],y=e.documentSelector,_=i.capabilities.textDocument?.completion?.completionList?.itemDefaults??[];i.clientInfo?.name?.includes("Visual Studio Code")&&!_.includes("data")&&_.push("data");let E={enabled:!1,features:[],completionItemData:{_projectKey:t},editor:{connection:n,folder:m,userLanguages:c,capabilities:{configuration:!0,diagnosticRelatedInformation:!0,itemDefaults:_},getConfiguration:a,getDocumentSymbols:O=>n.sendRequest("@/tailwindCSS/getDocumentSymbols",{uri:O}),async readDirectory(O,j){try{let k=_s.dirname(BL(O.uri));j=await A.substituteId(`${j}/`,k),j=_s.resolve(k,j);let $=await eh.promises.readdir(j,{withFileTypes:!0});return(await Promise.all($.map(async F=>{let P=F.isDirectory();return await wH(E,O,_s.join(j,F.name,P?"/":""))?null:[F.name,{isDirectory:P}]}))).filter(F=>F!==null)}catch{return[]}}}};if(e.configPath&&e.config.source==="js"){let O=[];try{O=FL(e.configPath)}catch{}u([...Vx(e.configPath,e.folder),...O.flatMap(j=>Vx(j,e.folder))])}let A=await p.child({root:e.folder});function S(...O){console.log(`[${_s.relative(e.folder,e.configPath)}] ${O.join(" ")}`)}function T(O){let j=!1,k=!1,$=(0,p1e.default)(`**/${Vh}`,{dot:!0});for(let U of O){let F=Sa(Ss(U.file)),P=Qd(F,[e.configPath]),W=Qd(F,E.dependencies??[]),z=$(F);if(!(!P&&!W&&!z)){if(!h){!e.isUserConfigured&&e.configPath&&(P||W)&&(y=[...y.filter(({priority:ee})=>ee!==1),...H1e(e.configPath,H,e.folder)],l());continue}if(U.type===Kx.FileChangeType.Created){S("File created:",U.file),j=!0;break}else if(U.type===Kx.FileChangeType.Changed)if(S("File changed:",U.file),!E.enabled||z){j=!0;break}else k=!0;else if(U.type===Kx.FileChangeType.Deleted)if(S("File deleted:",U.file),!E.enabled||P||z){j=!0;break}else k=!0}}j?L():k&&C()}function I(){Object.keys(E).forEach(O=>{O!=="editor"&&O!=="dependencies"&&delete E[O]}),E.enabled=!1,s(),r(),n.sendNotification("@/tailwindCSS/projectReset")}async function L(){if(h)try{await x(),n.sendNotification("@/tailwindCSS/projectInitialized")}catch(O){I(),Xw(n,O)}}async function C(){if(h)try{await D()}catch(O){I(),Xw(n,O)}}async function x(){S("Initializing..."),ry();let O=e.configPath;if(!O)throw new jA("No config file found.");u(Vx(O,e.folder));let j=Ad.default.sync(pe=>{let be=_s.join(pe,".pnp.js");if(Ad.default.sync.exists(be)||(be=_s.join(pe,".pnp.cjs"),Ad.default.sync.exists(be)))return be;if(pe===_s.normalize(m))return Ad.default.stop},{cwd:m});if(j){let pe=require(j);pe.setup(),Kq(pe)}let k=e.config.source==="js"?FL(O):[],$=l1e(O,k),U=_s.dirname(O),F,P,W,z,ee,J,re,K,q,Q,Z,ie={future:[],experimental:[]},me;try{let pe=await A.resolveCjsId("tailwindcss/package.json",U),be=_s.dirname(pe);if(ee=require(pe).version,await A.hasPnP()){let he=await A.resolveCjsId("tailwindcss",U);F=require(he)}else{let he=await A.resolveJsId("tailwindcss",U);F=await import(hH(he).href)}let Ve=Lf(ee,F);if(S(`supported features: ${JSON.stringify(Ve)}`),E.features=Ve,i.initializationOptions?.testMode&&(E.features=[...E.features,...i.initializationOptions.additionalFeatures??[]]),Ve.includes("css-at-theme")||(F=F.default??F),S(`Loaded tailwindcss v${ee}: ${be}`),Ve.includes("css-at-theme"))return E.configPath=O,E.version=ee,E.isCssConfig=!0,E.v4=!0,E.jit=!0,E.modules={tailwindcss:{version:ee,module:F},postcss:{version:null,module:null},resolveConfig:{module:null},loadConfig:{module:null}},C();if(e.config.source==="css"){S("CSS-based configuration is not supported before Tailwind CSS v4"),E.enabled=!1,h=!1;return}let Fe=await A.resolveCjsId("postcss",be),_e=await A.resolveCjsId("postcss/package.json",be),ce=_s.dirname(_e),ke=await A.resolveCjsId("postcss-selector-parser",be);if(J=require(_e).version,re=Object.keys(mI).map(he=>{try{return require(Hs(U,`${he}/package.json`)).version}catch{return""}}).join(","),E.enabled&&J===E.modules.postcss.version&&ee===E.modules.tailwindcss.version&&re===E.pluginVersions&&O===E.configPath&&$===E.configId)return;S(`Loaded Tailwind CSS config file: ${O}`),P=require(Fe),W=require(ke),S(`Loaded postcss v${J}: ${ce}`);try{q=require(Hs(be,"./resolveConfig.js"))}catch{try{let se=require(Hs(be,"./lib/util/resolveConfig.js")),Se=require(Hs(be,"./stubs/defaultConfig.stub.js"));q=ye=>se([ye,Se])}catch{try{let Se=require(Hs(be,"./lib/util/mergeConfigWithDefaults.js")),ye=require(Hs(be,"./defaultConfig.js"));q=$e=>Se.default($e,ye())}catch{throw Error("Failed to load resolveConfig function.")}}}try{let he=require(Hs(be,"./lib/util/transformThemeValue.js"));Q=he.default??he}catch{}try{Z=require(Hs(be,"./loadConfig.js"))}catch{}if(vn(ee,"1.4.0")&&IH(ee,"1.99.0")){let he=Hs(be,"browserslist");K=require(he)(void 0,{path:m})}vn(ee,"1.99.0")?me=Vw(()=>require(Hs(be,"./lib/lib/substituteClassApplyAtRules"))):vn(ee,"1.7.0")&&(me=require(Hs(be,"./lib/flagged/applyComplexClasses")));try{ie=require(Hs(be,"./lib/featureFlags.js")).default}catch{}let je=new Set,Oe=P.root(),ne={opts:{},messages:[]},fe=()=>{};try{let he=MA(()=>{let se=require(Hs(U,"tailwindcss/lib/lib/setupContextUtils")).createContext;return eb.default.strictEqual(typeof se,"function"),Se=>se(Se.config)},()=>{let se=require(Hs(U,"tailwindcss/lib/jit/lib/setupContextUtils")).createContext;return eb.default.strictEqual(typeof se,"function"),Se=>se(Se.config)},()=>{let se=require(Hs(U,"tailwindcss/lib/jit/lib/setupTrackingContext")).default;return eb.default.strictEqual(typeof se,"function"),Se=>se(Se.configPath,je,fe)(ne,Oe)},()=>{let se=require(Hs(U,"tailwindcss/lib/jit/lib/setupContext")).default;return eb.default.strictEqual(typeof se,"function"),Se=>se(Se.configPath,je)(ne,Oe)});z={generateRules:{module:MA(()=>require(Hs(U,"tailwindcss/lib/lib/generateRules")).generateRules,()=>require(Hs(U,"tailwindcss/lib/jit/lib/generateRules")).generateRules)},createContext:{module:he},expandApplyAtRules:{module:MA(()=>require(Hs(U,"tailwindcss/lib/lib/expandApplyAtRules")).default,()=>require(Hs(U,"tailwindcss/lib/jit/lib/expandApplyAtRules")).default)},evaluateTailwindFunctions:{module:Vw(()=>require(Hs(U,"tailwindcss/lib/lib/evaluateTailwindFunctions")).default)}}}catch{try{let se=require(Hs(U,"tailwindcss/jit/lib/setupContext"));z={generateRules:{module:require(Hs(U,"tailwindcss/jit/lib/generateRules")).generateRules},createContext:{module:Se=>se(Se.configPath,je)(ne,Oe)},expandApplyAtRules:{module:require(Hs(U,"tailwindcss/jit/lib/expandApplyAtRules"))}}}catch{}}}catch(pe){if(e.config.source==="css"){let Ve=await Promise.resolve().then(()=>(PM(),DM)),Fe=wM().version,_e=Lf(Fe,Ve);return S("Failed to load workspace modules."),S(`Using bundled version of \`tailwindcss\`: v${Fe}`),E.configPath=O,E.version=Fe,E.isCssConfig=!0,E.v4=!0,E.v4Fallback=!0,E.jit=!0,E.features=_e,i.initializationOptions?.testMode&&(E.features=[...E.features,...i.initializationOptions.additionalFeatures??[]]),E.modules={tailwindcss:{version:Fe,module:Ve},postcss:{version:null,module:null},resolveConfig:{module:null},loadConfig:{module:null}},C()}let be=await import("node:util");console.error(be.format(pe)),F=c7(),q=i9(),Q=Hm().default,Z=s1e(),P=h$(),ee=_g().version,J=a1e().version,W=FI(),z={generateRules:{module:Eg().generateRules},createContext:{module:Ve=>fm().createContext(Ve.config)},expandApplyAtRules:{module:j4().default}},S("Failed to load workspace modules."),S(`Using bundled version of \`tailwindcss\`: v${ee}`),S(`Using bundled version of \`postcss\`: v${J}`)}E.configPath=O,E.modules={tailwindcss:{version:ee,module:F},postcss:{version:J,module:P},postcssSelectorParser:{module:W},resolveConfig:{module:q},loadConfig:{module:Z},transformThemeValue:{module:Q},jit:z},E.browserslist=K,E.featureFlags=ie,E.version=ee,E.pluginVersions=re;try{E.corePlugins=Object.keys(require(Hs(_s.dirname(E.configPath),"tailwindcss/lib/plugins/index.js")))}catch{}if(me&&!me.default.__patched){let pe=me.default;me.default=(be,...Ve)=>{if(E.jit)return E.modules.jit.expandApplyAtRules.module(E.jitContext);let Fe=vp(be);Fe.separator=typeof E.separator>"u"?":":E.separator;let _e=pe(Fe,...Ve);return async ce=>(ce.walkRules(ke=>{let je=ke.selector.replace(/__TWSEP__(.*?)__TWSEP__/g,"$1");je!==ke.selector&&(ke.before(P.comment({text:"__ORIGINAL_SELECTOR__:"+ke.selector})),ke.selector=je)}),await _e(ce),ce.walkComments(ke=>{ke.text.startsWith("__ORIGINAL_SELECTOR__:")&&(ke.next().selector=ke.text.replace(/^__ORIGINAL_SELECTOR__:/,""),ke.remove())}),ce)},me.default.__patched=!0}await C()}async function D(){S("Building..."),ry();let{tailwindcss:O,postcss:j,resolveConfig:k,loadConfig:$}=E.modules,U=vn(O.version,"0.99.0")?["separator"]:["options","separator"],F=[],P,W=vn(O.version,"2.99.0"),z;if(E.isCssConfig)try{let re=await zp(E.configPath),K=await sM(A,E.modules.tailwindcss.module,E.configPath,re,E.v4Fallback??!1);E.designSystem=K;let q=K.dependencies();for(let Q of q)d.add(Q);u(Array.from(q)),P={theme:{}}}catch{h=!1,E.enabled=!1;return}else if($.module){z=new i_(eh.realpathSync(E.configPath));try{P=await $.module(E.configPath),P=P.default??P,E.jit=!0}catch(re){P=await k.module({}),E.jit=!0,console.error(`Unable to load config file at: ${E.configPath}`),console.error(re),vG(n,"Tailwind CSS is unable to load your config file",re)}finally{z.unhook()}}else{z=new i_(eh.realpathSync(E.configPath),re=>{P=vp(re);let K=(0,du.default)(re,U);typeof K!="string"&&(K=":"),Pl(re,U,`__TWSEP__${K}__TWSEP__`),re[W?"content":"purge"]=[];let q=m1e(re);if(E1e(re),W||E.modules.jit&&q==="jit"){if(E.jit=!0,re.variants=[],Array.isArray(re.presets))for(let Z of re.presets)F.push(Z.variants),Z.variants=[]}else E.jit=!1;if(E.corePlugins){let Z={};for(let ie of E.corePlugins)Z[ie]=!0;re.corePlugins=Z}return Array.isArray(re.plugins)&&(re.plugins=re.plugins.map(Z=>{if(Z.__isOptionsFunction&&(Z=Z()),typeof Z=="function"){let ie=(...me)=>(me[0].matchUtilities||(me[0].matchUtilities=()=>{}),Z(...me));return ie.__intellisense_cache_bust=Math.random(),ie}return Z.handler?{...Z,handler:(...ie)=>(ie[0].matchUtilities||(ie[0].matchUtilities=()=>{}),Z.handler(...ie)),__intellisense_cache_bust:Math.random()}:Z})),re});try{e.config.source==="js"&&require(E.configPath)}catch(re){throw z.unhook(),re}}if(!P)throw new jA(`Failed to load config file: ${E.configPath}`);e.isUserConfigured||(y=[...y.filter(({priority:re})=>re!==1),...H1e(E.configPath,O.version,e.folder,P)]);try{if(E.config=E.isCssConfig?P:k.module(P),E.separator=(0,du.default)(E.config,U),typeof E.separator!="string"&&(E.separator=":"),E.blocklist=Array.isArray(E.config.blocklist)?E.config.blocklist:[],delete E.config.blocklist,E.v4){let re=E.designSystem.getClassList();E.classList=re.map(K=>[K[0],{...K[1],color:dc(E,K[0])}])}else if(E.jit){if(E.jitContext=E.modules.jit.createContext.module(E),E.jitContext.tailwindConfig.separator=E.config.separator,E.jitContext.getClassList){let re=E.jitContext.getClassList({includeMetadata:!0}).filter(K=>K!=="*");E.classListContainsMetadata=re.some(K=>Array.isArray(K)),E.classList=re.map(K=>Array.isArray(K)?[K[0],{color:dc(E,K[0]),...K[1]??{}}]:[K,{color:dc(E,K)}])}}else delete E.jitContext,delete E.classList}catch(re){throw z?.unhook(),re}let ee;if(E.classList)z?.unhook();else try{ee=await j.module([O.module(E.configPath)]).process([vn(O.version,"0.99.0")?"base":"preflight","components","utilities"].map(re=>`/*__tw_intellisense_layer_${re}__*/
3580
3580
  @tailwind ${re};`).join(`
3581
- `),{from:void 0})}catch(re){throw re}finally{z?.unhook()}E.dependencies=FL(E.configPath),u((E.dependencies??[]).flatMap(re=>Vx(re,e.folder))),E.configId=l1e(E.configPath,E.dependencies),E.plugins=await Pht(P),ee&&(E.classNames=await QQ(ee.root)),E.variants=u1e(E);let J=(0,du.default)(E.config,"theme.screens",(0,du.default)(E.config,"screens",{}));E.screens=xu(J)?Object.keys(J):[],E.enabled=!0,s(),r()}for(let O of e.config.entries){d.add(O.path);for(let j of O.deps)d.add(j.path)}return{projectConfig:e,enabled(){return h},enable(){h=!0},dependencies:()=>d,async reload(){if(!E.v4)return;console.log("---- RELOADING DESIGN SYSTEM ----"),console.log(`---- ${E.configPath} ----`);let O=await zp(E.configPath),j,k=process.hrtime.bigint();try{j=await sM(A,E.modules.tailwindcss.module,E.configPath,O,E.v4Fallback??!1)}catch(z){throw console.error(z),z}let $=Object.create(E,{designSystem:{value:j}}),U=j.getClassList().map(z=>[z[0],{...z[1],color:dc($,z[0])}]);E.designSystem=j,E.classList=U,E.variants=u1e(E);let F=j.dependencies();for(let z of F)d.add(z);u(Array.from(F));let P=process.hrtime.bigint()-k;console.log(`---- RELOADED IN ${(Number(P)/1e6).toFixed(2)}ms ----`),(i.initializationOptions?.testMode??!1)&&n.sendNotification("@/tailwindCSS/projectReloaded")},state:E,documentSelector(){return y},tryInit:L,async dispose(){E={enabled:!1,features:[]};for(let O of g)(await O).dispose()},async onUpdateSettings(O){E.enabled&&s(),r(),n.sendNotification("@/tailwindCSS/clearColors")},onFileEvents:T,async onHover(O){return Jd(async()=>{if(!E.enabled)return null;let j=o.getDocument(O.textDocument.uri);return!j||!(await E.editor.getConfiguration(j.uri)).tailwindCSS.hovers||await wH(E,j)?null:$ie(E,j,O.position)},null)},async onCodeLens(O){return Jd(async()=>{if(!E.enabled)return null;let j=o.getDocument(O.textDocument.uri);return!j||!(await E.editor.getConfiguration(j.uri)).tailwindCSS.codeLens||await wH(E,j)?null:Fie(E,j)},null)},async onCompletion(O){return Jd(async()=>{if(!E.enabled)return null;let j=o.getDocument(O.textDocument.uri);return!j||!(await E.editor.getConfiguration(j.uri)).tailwindCSS.suggestions||await wH(E,j)?null:Qie(E,j,O.position,O.context)},null)},onCompletionResolve(O){return Jd(()=>E.enabled?Yie(E,O):null,null)},async onCodeAction(O){return Jd(async()=>{if(!E.enabled)return null;let j=o.getDocument(O.textDocument.uri);return!j||!(await E.editor.getConfiguration(j.uri)).tailwindCSS.codeActions?null:vse(E,O,j)},null)},onDocumentLinks(O){if(!E.enabled)return null;let j=o.getDocument(O.textDocument.uri);if(!j)return null;let k=p7.URI.parse(j.uri).fsPath,$=_s.dirname(k);async function U(F){return F=await A.substituteId(F,$)??F,p7.URI.file(_s.resolve($,F)).toString()}return Dse(E,j,U)},provideDiagnostics:(0,h1e.debounce)(O=>{E.enabled&&$$(E,O)},i.initializationOptions?.testMode?0:500),provideDiagnosticsForce:O=>{E.enabled&&$$(E,O)},async onDocumentColor(O){return Jd(async()=>{if(!E.enabled)return[];let j=o.getDocument(O.textDocument.uri);return j?await wH(E,j)?null:Cse(E,j):[]},null)},async onColorPresentation(O){let j=o.getDocument(O.textDocument.uri);if(!j)return[];let k=j.getText(O.range),$=k.match(new RegExp(`-\\[(${o1e.join("|")}|(?:(?:#|rgba?\\(|hsla?\\())[^\\]]+)\\]$`,"i"));if($===null)return[];let U=$[1],F=o1e.includes(U),P={mode:"rgb",r:O.color.red,g:O.color.green,b:O.color.blue,alpha:O.color.alpha},W=$1(P);if(!F&&(U.length===4||U.length===5)){let[,...ee]=W.match(/^#([a-f\d])\1([a-f\d])\2([a-f\d])\3(?:([a-f\d])\4)?$/i)??[];ee.length&&(W=`#${ee.filter(Boolean).join("")}`)}W.length===5?W=W.replace(/f$/,""):W.length===9&&(W=W.replace(/ff$/,""));let z=k.substr(0,$.index);return[W,L_(P).replace(/ /g,""),L2(P).replace(/ /g,"").replace(/\d+\.\d+(%?)/g,(ee,J)=>`${Math.round(parseFloat(ee))}${J}`)].map(ee=>({label:`${z}-[${ee}]`}))},sortClassLists(O){return E.jit?O.map(j=>{let k="",$=j.split(/(\s+)/),U=$.filter((W,z)=>z%2===0),F=$.filter((W,z)=>z%2!==0);U[U.length-1]===""&&U.pop();let P;E.v4?P=E.designSystem.getClassOrder(U):E.jitContext.getClassOrder?P=E.jitContext.getClassOrder(U):P=xht(E,U),U=P.sort(([,W],[,z])=>W===z?0:W===null?-1:z===null?1:x_(W-z)).map(([W])=>W);for(let W=0;W<U.length;W++)k+=`${U[W]}${F[W]??""}`;return k}):O}}}function c1e(t,e){let n=t.config.prefix;return typeof n=="function"?n(e):n+e}function xht(t,e){let n=new Set([c1e(t,"group"),c1e(t,"peer")]),i=[];for(let o of e){let r=t.modules.jit.generateRules.module(new Set([o]),t.jitContext).sort(([l],[s])=>x_(s-l))[0]?.[0]??null;r===null&&n.has(o)&&(r=t.jitContext.layerOrder.components),i.push([o,r])}return i}function Cht(t,e,n={}){let i=e.config,o=e.modules.postcss.module,r=e.browserslist,l=r&&r.includes("ie 11")?"ie11":"relaxed",s=typeof t=="function"?t:t.handler;try{s({addUtilities:()=>{},addComponents:()=>{},addBase:()=>{},matchUtilities:()=>{},addVariant:()=>{},e:u=>u,prefix:u=>u,theme:(u,H)=>(0,du.default)(i,`theme.${u}`,H),variants:()=>[],config:(u,H)=>(0,du.default)(i,u,H),corePlugins:u=>Array.isArray(i.corePlugins)?i.corePlugins.includes(u):(0,du.default)(i,`corePlugins.${u}`,!0),target:u=>{if(typeof i.target=="string")return i.target==="browserslist"?l:i.target;let[H,a]=(0,du.default)(i,"target"),c=(0,du.default)(a,u,H);return c==="browserslist"?l:c},postcss:o,...n})}catch{}}function Dht(t){return t.type==="atrule"}function u1e(t){if(t.v4){let r=Array.from(t.designSystem.getVariants()),l=t.designSystem.theme.prefix??"";return l.length>0&&r.unshift({name:l,values:[],isArbitrary:!1,hasDash:!0,selectors:()=>["&"]}),r}if(t.jitContext?.getVariants)return t.jitContext.getVariants();if(t.jit){let r=[];return Array.from(t.jitContext.variantMap).forEach(([l,s])=>{r.push({name:l,values:[],isArbitrary:!1,hasDash:!0,selectors:()=>{function u(g){let y=t.modules.postcssSelectorParser.module.className();return y.value=g,(0,du.default)(y,"raws.value",y.value)}let H=(Array.isArray(s[0])?s:[s]).map(([g,y])=>y),a="__variant_placeholder__",c=t.modules.postcss.module.root({nodes:[t.modules.postcss.module.rule({selector:`.${u(a)}`,nodes:[]})]}),p=t.modules.postcssSelectorParser.module(g=>g.first.filter(({type:y})=>y==="class").pop().value);function d(g){return p.transformSync(g)}function h(g){return c.each(y=>{y.type==="rule"&&(y.selectors=y.selectors.map(_=>g({get className(){return d(_)},selector:_})))}),c}let m=[];for(let g of H){let y,_=c.clone(),E=gG(()=>g({container:_,separator:t.separator,modifySelectors:h,format:A=>{y=A.replace(/:merge\(([^)]+)\)/g,"$1")},wrap:A=>{Dht(A)&&(y=`@${A.name} ${A.params}`)}}));if(y||(y=E),y){m.push(y);continue}_.walkDecls(A=>{A.remove()}),y=_.toString().replace(`.${u(`${l}:${a}`)}`,"&").replace(/(?<!\\)[{}]/g,"").replace(/\s*\n\s*/g," ").trim(),y.includes(a)||m.push(y)}return m}})}),r}let e=t.config,n=t.modules.tailwindcss.version,i=["responsive","hover"];return vn(n,"0.3.0")&&i.push("focus","group-hover"),vn(n,"0.5.0")&&i.push("active"),vn(n,"0.7.0")&&i.push("focus-within"),vn(n,"1.0.0-beta.1")&&i.push("default"),vn(n,"1.1.0")&&i.push("first","last","odd","even","disabled","visited"),vn(n,"1.3.0")&&i.push("group-focus"),vn(n,"1.5.0")&&i.push("focus-visible","checked"),vn(n,"1.6.0")&&i.push("motion-safe","motion-reduce"),vn(n,"2.0.0-alpha.1")&&i.push("dark"),(Array.isArray(e.plugins)?e.plugins:[]).forEach(r=>{Cht(r,t,{addVariant:l=>{i.push(l)}})}),i.map(r=>({name:r,values:[],isArbitrary:!1,hasDash:!0,selectors:()=>[]}))}async function Pht(t){let e=t.plugins;return Array.isArray(e)?Promise.all(e.map(async n=>{let i=n.config;xu(i)||(i={});let o={theme:xu(i.theme)?Object.keys(i.theme):[],variants:xu(i.variants)?Object.keys(i.variants):[]},r=n.handler||n,l=typeof r.name=="string"&&r.name!=="handler"&&r.name!==""?r.name:null;try{r()}catch(s){let u=f1e.default.parse(s);if(u.length===0)return{name:l};let H=u[0].fileName,a=_s.dirname(H);if(!d1e.default.sync({cwd:a}))return{name:l};let p;try{p=require(p)}catch{return{name:l}}if(p.name&&_s.resolve(a,p.main||"index.js")===H)return{name:p.name,homepage:p.homepage,contributes:o}}return{name:l}})):[]}function wht(t,e){try{let n=Ad.default.sync(i=>{let o=_s.join(i,"package.json");if(Ad.default.sync.exists(o))return o;if(i===_s.normalize(e))return Ad.default.stop},{cwd:t});return n?_s.dirname(n):e}catch{return e}}function H1e(t,e,n,i){let o=i??require(t),r=o.content?.files??o.content,l=Array.isArray(r)?r:[],s=vn(e,"3.2.0")?o.future?.relativeContentPathsByDefault||o.content?.relative:!1,u;return s?u=_s.dirname(t):u=wht(_s.dirname(t),n),l.filter(H=>typeof H=="string").map(H=>H.startsWith("!")?`!${_s.resolve(u,H.slice(1))}`:_s.resolve(u,H)).map(H=>({pattern:Sa(Ss(H)),priority:1}))}var L1e=Er(I1e());function S1e(){return{editor:{tabSize:2},tailwindCSS:{inspectPort:null,emmetCompletions:!1,classAttributes:["class","className","ngClass","class:list"],classFunctions:[],codeActions:!0,codeLens:!0,hovers:!0,suggestions:!0,validate:!0,colorDecorators:!0,rootFontSize:16,lint:{cssConflict:"warning",invalidApply:"error",invalidScreen:"error",invalidVariant:"error",invalidConfigPath:"error",invalidTailwindDirective:"error",invalidSourceDirective:"error",recommendedVariantOrder:"warning"},showPixelEquivalents:!0,includeLanguages:{},files:{exclude:["**/.git/**","**/node_modules/**","**/.hg/**","**/.svn/**"]},experimental:{classRegex:[],configFile:null}}}}function T1e(t){let e=new Map;async function n(o){let r=e.get(o);return r||(r=await i(o),e.set(o,r)),r}async function i(o){let[r,l]=await Promise.all([t.workspace.getConfiguration({section:"editor",scopeUri:o}),t.workspace.getConfiguration({section:"tailwindCSS",scopeUri:o})]);return r=xu(r)?r:{},l=xu(l)?l:{},(0,L1e.default)(S1e(),{editor:r,tailwindCSS:l},{arrayMerge:(s,u,H)=>u})}return{get:n,clear(){e.clear()}}}var Da=Er(require("node:path")),rb=Er(require("node:fs/promises"));var Td=Er(require("path"),1),n0e=Er(t0e(),1),S7=Er(Ep(),1),aC=Er(Ep(),1),rmt=/^(\/?\.\.)+$/;function nmt(t,e){let n=t.length,i=Array(n),o=Array(n);for(let r=0;r<n;r++){let l=i0e(t[r]);i[r]=l;let s=l.length,u=Array(s);for(let H=0;H<s;H++)u[H]=aC.default.makeRe(l[H],e);o[r]=u}return r=>{let l=r.split("/");if(l[0]===".."&&rmt.test(r))return!0;for(let s=0;s<t.length;s++){let u=i[s],H=o[s],a=l.length,c=Math.min(a,u.length),p=0;for(;p<c;){let d=u[p];if(d.includes("/"))return!0;if(!H[p].test(l[p]))break;if(d==="**")return!0;p++}if(p===a)return!0}return!1}}var imt={parts:!0};function i0e(t){var e;let n=aC.default.scan(t,imt);return(e=n.parts)!=null&&e.length?n.parts:[t]}var smt=process.platform==="win32";var amt=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,omt=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,lmt=t=>t.replace(amt,"\\$&"),cmt=t=>t.replace(omt,"\\$&"),umt=smt?cmt:lmt;function Hmt(t,e){if(e?.caseSensitiveMatch===!1)return!0;let n=aC.default.scan(t);return n.isGlob||n.negated}function Gm(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}var pmt=/^(\/?\.\.)+/,dmt=/\\(?=[()[\]{}!*+?@|])/g,L7=/\\/g;function I7(t,e,n,i,o){var r;let l=t;t.endsWith("/")&&(l=t.slice(0,-1)),!l.endsWith("*")&&e&&(l+="/**"),Td.default.isAbsolute(l.replace(dmt,""))?l=Td.posix.relative(umt(n),l):l=Td.posix.normalize(l);let s=pmt.exec(l);if(s?.[0]){let u=Td.posix.join(n,s[0]);i.root.length>u.length&&(i.root=u,i.depthOffset=-(s[0].length+1)/3)}else if(!o&&i.depthOffset>=0){let u=i0e(l);(r=i.commonPath)!=null||(i.commonPath=u);let H=[],a=Math.min(i.commonPath.length,u.length);for(let c=0;c<a;c++){let p=u[c];if(p==="**"&&!u[c+1]){H.pop();break}if(p!==i.commonPath[c]||Hmt(p)||c===u.length-1)break;H.push(p)}i.depthOffset=H.length,i.commonPath=H,i.root=H.length>0?`${n}/${H.join("/")}`:n}return l}function fmt({patterns:t,ignore:e=[],expandDirectories:n=!0},i,o){typeof t=="string"?t=[t]:t||(t=["**/*"]),typeof e=="string"&&(e=[e]);let r=[],l=[];for(let s of e)s&&(s[0]!=="!"||s[1]==="(")&&l.push(I7(s,n,i,o,!0));for(let s of t)s&&(s[0]!=="!"||s[1]==="("?r.push(I7(s,n,i,o,!1)):(s[1]!=="!"||s[2]==="(")&&l.push(I7(s.slice(1),n,i,o,!0)));return{match:r,ignore:l}}function s0e(t,e,n){return Td.posix.relative(e,`${n}/${t}`)||"."}function sC(t,e,n,i,o){let r=o?t.slice(n.length+1)||".":t;return n===e?i&&r!=="."?r.slice(0,-1):r:s0e(r,e,n)}function r0e(t,e,n){for(let i=t.length-1;i>=0;i--){let o=t[i];t[i]=s0e(o,e,n)+(!o||o.endsWith("/")?"/":"")}return t}function hmt(t,e,n){if(process.env.TINYGLOBBY_DEBUG&&(t.debug=!0),t.debug&&Gm("globbing with options:",t,"cwd:",e),Array.isArray(t.patterns)&&t.patterns.length===0)return n?[]:Promise.resolve([]);let i={root:e,commonPath:null,depthOffset:0},o=fmt(t,e,i),r=t.caseSensitiveMatch===!1;t.debug&&Gm("internal processing patterns:",o);let l=(0,S7.default)(o.match,{dot:t.dot,nocase:r,ignore:o.ignore}),s=(0,S7.default)(o.ignore,{dot:t.dot,nocase:r}),u=nmt(o.match,{dot:t.dot,nocase:r}),H={filters:[t.debug?(p,d)=>{let h=sC(p,e,i.root,d,t.absolute),m=l(h);return m&&Gm(`matched ${h}`),m}:(p,d)=>l(sC(p,e,i.root,d,t.absolute))],exclude:t.debug?(p,d)=>{let h=sC(d,e,i.root,!0,!0),m=h!=="."&&!u(h)||s(h);return Gm(m?`skipped ${d}`:`crawling ${d}`),m}:(p,d)=>{let h=sC(d,e,i.root,!0,!0);return h!=="."&&!u(h)||s(h)},pathSeparator:"/",relativePaths:!0,resolveSymlinks:!0};t.deep&&(H.maxDepth=Math.round(t.deep-i.depthOffset)),t.absolute&&(H.relativePaths=!1,H.resolvePaths=!0,H.includeBasePath=!0),t.followSymbolicLinks===!1&&(H.resolveSymlinks=!1,H.excludeSymlinks=!0),t.onlyDirectories?(H.excludeFiles=!0,H.includeDirs=!0):t.onlyFiles===!1&&(H.includeDirs=!0),i.root=i.root.replace(L7,"");let a=i.root;t.debug&&Gm("internal properties:",i);let c=new n0e.fdir(H).crawl(a);return e===a||t.absolute?n?c.sync():c.withPromise():n?r0e(c.sync(),e,a):c.withPromise().then(p=>r0e(p,e,a))}async function a0e(t,e){if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let n=Array.isArray(t)||typeof t=="string"?{...e,patterns:t}:t,i=n.cwd?Td.default.resolve(n.cwd).replace(L7,"/"):process.cwd().replace(L7,"/");return hmt(n,i,!1)}var l0e=Er(Ep());var oC=class{constructor(){this.parents=new Map;this.children=new Map;this.nodes=new Map}add(e,n){return this.nodes.has(e)?this.nodes.get(e):(this.nodes.set(e,n),this.parents.set(e,new Set),this.children.set(e,new Set),n)}connect(e,n){let i=this.children.get(e);if(!i)throw new Error(`Node ${e} does not exist`);let o=this.parents.get(n);if(!o)throw new Error(`Node ${n} does not exist`);o.add(e),i.add(n)}*descendants(e){let n=[],i=new Set;for(let o of this.children.get(e))n.push(o);for(;n.length>0;){let o=n.shift();if(!i.has(o)){yield this.nodes.get(o),i.add(o);for(let r of this.children.get(o))n.push(r)}}}*roots(){for(let[e,n]of this.parents)n.size===0&&(yield this.nodes.get(e))}*leaves(){for(let[e,n]of this.children)n.size===0&&(yield this.nodes.get(e))}};var lC=class extends Map{remember(e,n){let i=super.get(e);return i||(i=n(e),this.set(e,i)),i}};var cC=Er(VA()),Xm=Er(require("node:path"));async function T7(t,e){async function n(i){let o=Xm.join(i,"package.json");if(await cC.default.exists(o))return o;if(i===Xm.normalize(e))return cC.default.stop}try{let i=await(0,cC.default)(n,{cwd:t});return i?Xm.dirname(i):e}catch{return e}}async function _mt(t){let e=await import(t);return!e.scanDir&&!e.Scanner?null:e}async function o0e(t){let e=await _mt(t.oxidePath);if(!e)return null;if(IH(t.oxideVersion,"4.0.0-alpha.18")){let n=e.scanDir?.({base:t.basePath,globs:!0});return{files:n.files,globs:n.globs.map(i=>({base:i.base,pattern:i.glob}))}}else if(IH(t.oxideVersion,"4.0.0-alpha.19")){let n=e.scanDir({base:t.basePath,sources:t.sources.map(i=>({base:i.base,pattern:i.pattern}))});return{files:n.files,globs:n.globs.map(i=>({base:i.base,pattern:i.pattern}))}}else if(IH(t.oxideVersion,"4.0.0-alpha.30")){let n=new e.Scanner({detectSources:{base:t.basePath},sources:t.sources.map(i=>({base:i.base,pattern:i.pattern}))});return{files:n.files,globs:n.globs.map(i=>({base:i.base,pattern:i.pattern}))}}else if(IH(t.oxideVersion,"4.0.9999")){let n=new e.Scanner({sources:[{base:t.basePath,pattern:"**/*"},...t.sources.map(i=>({base:i.base,pattern:i.pattern}))]});return{files:n.files,globs:n.globs.map(i=>({base:i.base,pattern:i.pattern}))}}else{let n=new e.Scanner({sources:[{base:t.basePath,pattern:"**/*",negated:!1},...t.sources.map(i=>({base:i.base,pattern:i.pattern,negated:i.negated}))]});return{files:n.files,globs:n.globs.map(i=>({base:i.base,pattern:i.pattern}))}}}var Emt=/@import\s*['"]tailwindcss(?:\/[^'"]+)?['"]/,ymt=/@(theme|plugin|utility|custom-variant|variant|reference)\s*[^;{]+[;{]/,gmt=/--(alpha|spacing|theme)\(/,bmt=/@tailwind\s*(base|preflight|components|variants|screens)+;/,Amt=/@tailwind\s*utilities\s*[^;]*;/,Imt=/@tailwind\s*[^;]+;/,Smt=/@(config|apply)\s*[^;{]+[;{]/,Lmt=/@import\s*['"]/;function uC(t){return Emt.test(t)?{root:!0,versions:["4"]}:ymt.test(t)?Amt.test(t)?{root:!0,versions:["4"]}:{root:!1,versions:["4"]}:gmt.test(t)?{root:!1,versions:["4"]}:bmt.test(t)?{root:!1,versions:["3"]}:Imt.test(t)?{root:!0,versions:["4","3"]}:Smt.test(t)?{root:!1,versions:["4","3"]}:Lmt.test(t)?{root:!0,versions:["4","3"]}:{root:!1,versions:[]}}var HC=class{constructor(e,n,i){this.base=e;this.settings=n;this.resolver=i}async search(){let e=await this.findConfigs(),n=await Promise.allSettled(e.map(o=>this.createProject(o))),i=[];for(let o of n)o.status==="rejected"?console.error(`[GLOBAL] Error creating project: ${o.reason}`):o.status==="fulfilled"&&o.value&&i.push(o.value);i.length===1&&i[0].documentSelector.push({pattern:Ss(Da.join(this.base,"**")),priority:5});for(let o of i){o.folder=Sa(o.folder),o.configPath=Sa(o.configPath),o.config.path=Sa(o.config.path);for(let r of o.config.entries)r.path=Sa(r.path);for(let r of o.documentSelector)r.pattern=Sa(r.pattern)}return i}async loadAllFromWorkspace(e){return Promise.all(e.map(n=>this.loadFromWorkspace(n[0],n[1])))}async loadFromWorkspace(e,n){let i=e.endsWith(".css")?{type:"css",path:e,source:"css",entries:[],content:[],packageRoot:""}:{type:"js",path:e,source:"js",entries:[],content:[],packageRoot:""},o=await this.detectTailwindVersion(i);return i.packageRoot=await T7(Da.dirname(i.path),this.base),{config:i,folder:this.base,isUserConfigured:!0,configPath:i.path,documentSelector:n.map(r=>({priority:0,pattern:r})),tailwind:o}}async createProject(e){let n=await this.detectTailwindVersion(e),i=e.entries.flatMap(r=>r.meta?.versions??[]);if(console.log(JSON.stringify({tailwind:n,path:e.path})),e.type==="js"&&e.source==="css"&&(n.isDefaultVersion||!n.features.includes("css-at-config-as-project")))return null;if(e.type==="css"){if(!n.features.includes("css-at-theme"))return null;if(!i.includes("4"))return console.warn(`The config ${e.path} looks like it might be for a different Tailwind CSS version. Skipping.`),null;if(c0e(e.path))return console.warn(`The config ${e.path} requires a preprocessor and is not supported by Tailwind CSS v4.0.`),null}if(e.type==="js"&&n.features.includes("css-at-theme")||e.type==="js"&&(e.path.endsWith(".ts")||e.path.endsWith(".mjs"))&&!n.features.includes("transpiled-configs"))return null;e.packageRoot=await T7(Da.dirname(e.path),this.base);let o=[];for(let r of e.entries)r.type==="css"&&o.push({pattern:r.path,priority:0});o.push({pattern:e.path,priority:0});for await(let r of Tmt(e,n.features,this.resolver))o.push(r);for(let r of e.entries)r.type==="css"&&o.push({pattern:Ss(Da.join(Da.dirname(r.path),"**")),priority:2});return o.push({pattern:Ss(Da.join(Da.dirname(e.path),"**")),priority:3}),o.push({pattern:Ss(Da.join(e.packageRoot,"**")),priority:4}),o.sort((r,l)=>r.priority-l.priority),o=o.filter(({pattern:r},l,s)=>s.findIndex(({pattern:u})=>u===r)===l),{config:e,folder:this.base,isUserConfigured:!1,configPath:e.path,documentSelector:o,tailwind:n}}async findConfigs(){let e=await a0e({patterns:[`**/${Wh}`,`**/${yp}`],cwd:this.base,ignore:this.settings.tailwindCSS.files.exclude,onlyFiles:!0,absolute:!0,followSymbolicLinks:!0,dot:!0}),n=await Promise.all(e.map(d=>rb.realpath(d)));e=e.filter((d,h)=>{let m=n[h];return d===m?!0:!e.includes(m)}),e=e.map(d=>Ss(d)),e=Array.from(new Set(e)).sort();let i=new lC,o=(0,l0e.default)(`**/${yp}`,{dot:!0}),r=e.map(d=>o(d)?new pC("css",d):new pC("js",d,[i.remember(d,()=>({source:"js",type:"js",path:d,entries:[],packageRoot:null,content:[]}))])),l=r.filter(d=>d.type==="css");await Promise.all(l.map(d=>d.read())),await Promise.all(l.map(d=>d.resolvePossibleVersions()));let s=[];for(let d of l){if(!d.content||!d.meta||d.meta.versions.length===0)continue;let h=d.configPathInCss();h&&d.configs.push(i.remember(h,()=>({source:"css",type:"js",path:h,entries:[],packageRoot:null,content:[]}))),s.push(d)}await Promise.all(s.map(d=>d.resolveImports(this.resolver))),await Promise.all(s.map(d=>d.resolveRealpaths())),await Promise.all(s.map(d=>d.resolveSourceDirectives()));let u=new oC,H=null,a=null,c=null;for(let d of s){u.add(d.realpath,d);for(let h of d.deps)u.add(h.realpath,h),u.connect(d.realpath,h.realpath);d.realpath.includes("node_modules/tailwindcss/index.css")?H=d.realpath:d.realpath.includes("node_modules/tailwindcss/theme.css")?a=d.realpath:d.realpath.includes("node_modules/tailwindcss/utilities.css")&&(c=d.realpath)}H&&a&&u.connect(H,a),H&&c&&u.connect(H,c);let p=Array.from(u.roots());p.sort((d,h)=>d.meta.root===h.meta.root?0:d.meta.root?-1:1);for(let d of p){if(!d.meta)continue;let h=i.remember(d.path,()=>({source:"css",type:"css",path:d.path,entries:[],packageRoot:null,content:[{kind:"auto"}]}));d.configs.push(h);for(let m of u.descendants(d.realpath))m.configs.push(h)}for(let d of r)for(let h of d.configs)h.entries.push(d);return Array.from(i.values())}async detectTailwindVersion(e){try{let r=await this.resolver.resolveCjsId("tailwindcss/package.json",Da.dirname(e.path)),{version:l}=require(r),s;if(this.resolver.hasPnP()){let H=await this.resolver.resolveCjsId("tailwindcss",Da.dirname(e.path));s=require(H)}else{let H=await this.resolver.resolveJsId("tailwindcss",Da.dirname(e.path));s=await import(hH(H).href)}let u=Lf(l,s);if(typeof l=="string")return{version:l,features:u,isDefaultVersion:!1}}catch{}if(e.type==="css"){let{version:r}=wM(),l=await Promise.resolve().then(()=>(PM(),DM)),s=Lf(r,l);return{version:r,features:s,isDefaultVersion:!0}}let{version:n}=_g(),i=c7(),o=Lf(n,i);return{version:n,features:o,isDefaultVersion:!0}}};function Tmt(t,e,n){if(t.type==="css")return xmt(t,n);if(t.type==="js")return vmt(t,e)}async function*vmt(t,e,n){let i;try{i=n??require(t.path)}catch{return}let o=i.content?.files??i.content,r=Array.isArray(o)?o:[],s=(e.includes("relative-content-paths")?i.future?.relativeContentPathsByDefault||i.content?.relative:!1)?Da.dirname(t.path):t.packageRoot;for(let u of r){if(typeof u!="string")continue;let H=u.startsWith("!")?`!${Da.resolve(s,u.slice(1))}`:Da.resolve(s,u);yield{pattern:Ss(H),priority:1}}}async function*xmt(t,e){let n=!1;for(let i of t.content)if(i.kind==="file")yield{pattern:Ss(i.file),priority:1};else if(i.kind==="auto"&&!n){n=!0;let o=t.entries.flatMap(r=>r.sources);for await(let r of Cmt(t.packageRoot,t.path,o,e))yield{pattern:r,priority:1}}}async function*Cmt(t,e,n,i){try{let o=await i.resolveJsId("@tailwindcss/oxide",t);o=hH(o).href;let r=await i.resolveJsId("@tailwindcss/oxide/package.json",t),l=JSON.parse(await rb.readFile(r,"utf8")),s=await o0e({oxidePath:o,oxideVersion:l.version,basePath:t,sources:n.map(u=>({base:Da.dirname(e),pattern:u.pattern,negated:u.negated}))});if(!s)return;for(let u of s.files)yield Ss(u);for(let{base:u,pattern:H}of s.globs)yield Ss(u)+"/"+H}catch{}}var pC=class t{constructor(e,n,i=[]){this.type=e;this.path=n;this.configs=i;this.deps=[];this.sources=[];this.meta=null}async read(){try{this.content=await zp(this.path)}catch{this.content=null}}async resolveImports(e){if(!c0e(this.path))try{let n=await KL({resolver:e,loose:!0}).process(this.content,{from:this.path}),i=n.messages.filter(o=>o.type==="dependency");i=i.filter(o=>!o.file.startsWith("/virtual:missing/")),this.deps=i.map(o=>new t("css",Ss(o.file))),this.content=n.css}catch(n){console.debug(`Unable to resolve imports for ${this.path}.`),console.debug("This may result in failure to locate Tailwind CSS projects."),console.error(n)}}async resolveRealpaths(){this.realpath=Ss(await rb.realpath(this.path)),await Promise.all(this.deps.map(e=>e.resolveRealpaths()))}async resolveSourceDirectives(){try{if(this.sources.length>0)return;await $l([soe(this.sources)]).process(this.content,{from:this.realpath})}catch{}}async resolvePossibleVersions(){this.meta=this.content?uC(this.content):null}configPathInCss(){if(!this.content)return null;let e=this.content.match(/@config\s*(?<config>'[^']+'|"[^"]+")/);return e?Ss(Da.resolve(Da.dirname(this.path),e.groups.config.slice(1,-1))):null}};function c0e(t){let e=Da.extname(t);return e===".scss"||e===".sass"||e===".less"||e===".styl"||e===".pcss"}var jEt=Er(require("node:fs")),dge=Er(require("node:path")),rE=Er(wD());var u0e=Er(VA()),dC=Er(require("node:path"));var v7=new Map;async function H0e(t){let e=v7.get(t);if(e!==void 0)return e;let n=await Dmt(dC.normalize(t));if(!n)return v7.set(t,null),null;let r=(await import(hH(n).href)).default;return r.setup(),v7.set(t,r),r}async function Dmt(t){let e=[".pnp.js",".pnp.cjs"];for(let n of e){let i=dC.join(t,n);if(await u0e.default.exists(i))return i}return null}var ah=Er(require("node:path")),Hge=Er(K0e());var sh=Er(require("node:path"),1),z0e=Er(require("node:fs"),1);var Go=Er(require("node:path"),1),Z0e=require("node:fs"),gEt=new RegExp("\\"+Go.default.posix.sep,"g"),bEt=new RegExp("\\"+Go.default.sep,"g"),V7=new Map,Ym="**/*",AC=[".ts",".tsx",".mts",".cts"],AEt=[".js",".jsx",".mjs",".cjs"],G7=AC.concat(AEt),IEt=`\\.(?:${AC.map(t=>t.substring(1)).join("|")})`,SEt=`\\.(?:${G7.map(t=>t.substring(1)).join("|")})`,IC=Go.default.posix.sep===Go.default.sep;function ob(){let t,e;return{promise:new Promise((i,o)=>{t=i,e=o}),resolve:t,reject:e}}async function X7(t,e){if(Go.default.extname(t)!==".json")return;let n=Go.default.resolve(t);return e&&(e.hasParseResult(n)||e.hasParseResult(t))?n:Z0e.promises.stat(n).then(i=>{if(i.isFile()||i.isFIFO())return n;throw new Error(`${t} exists but is not a regular file.`)})}var Z7=IC?t=>t.includes("/node_modules/"):t=>t.match(/[/\\]node_modules[/\\]/),K7=IC?t=>t:t=>t.replace(gEt,Go.default.sep),ih=IC?t=>t:t=>t.replace(bEt,Go.default.posix.sep),eE=IC?(t,e)=>t?Go.default.resolve(t,e):Go.default.resolve(e):(t,e)=>ih(t?Go.default.resolve(K7(t),K7(e)):Go.default.resolve(K7(e)));function z7(t,e){let n=Go.default.dirname(t.tsconfigFile);return t.tsconfig.references.map(i=>{let o=i.path.endsWith(".json")?i.path:Go.default.join(i.path,e?.configName??"tsconfig.json");return eE(n,o)})}function J7(t,e){let i=e.tsconfig.compilerOptions?.allowJs?G7:AC;if(e.referenced&&i.some(o=>t.endsWith(o))&&!G0e(t,e)){let o=e.referenced.find(r=>G0e(t,r));if(o)return o}return e}function G0e(t,e){let n=ih(Go.default.dirname(e.tsconfigFile)),i=(e.tsconfig.files||[]).map(s=>eE(n,s)),o=eE(null,t);if(i.includes(t))return!0;let r=e.tsconfig.compilerOptions?.allowJs;return X0e(o,n,e.tsconfig.include||(e.tsconfig.files?[]:[Ym]),r)?!X0e(o,n,e.tsconfig.exclude||[],r):!1}function X0e(t,e,n,i){let o=i?G7:AC;return n.some(r=>{let l=r.length,s=!1,u=!1,H=!1,a=-1;for(let h=r.length-1;h>-1;h--){let m=r[h];if(s||(m==="*"||m==="?")&&(l=h,s=!0),H||(m==="."?u=!0:m==="/"&&(a=h,H=!0)),s&&H)break}if(!u&&(!s||l<a)&&(r+=`${r.endsWith("/")?"":"/"}${Ym}`,l=r.length-1,s=!0),l<r.length-1&&!t.endsWith(r.slice(l+1))||r.endsWith("*")&&!o.some(h=>t.endsWith(h)))return!1;if(r===Ym)return t.startsWith(`${e}/`);let c=eE(e,r),p=-1;for(let h=0;h<c.length;h++)if(c[h]==="*"||c[h]==="?"){p=h,s=!0;break}if(p>1&&!t.startsWith(c.slice(0,p-1)))return!1;if(s){if(p+Ym.length===c.length-(r.length-1-l)&&c.slice(p,p+Ym.length)===Ym)return!0}else return t===c;if(V7.has(c))return V7.get(c).test(t);let d=LEt(c,i);return V7.set(c,d),d.test(t)})}function LEt(t,e){let n="^";for(let i=0;i<t.length;i++){let o=t[i];if(o==="?"){n+="[^\\/]";continue}if(o==="*"){if(t[i+1]==="*"&&t[i+2]==="/"){i+=2,n+="(?:[^\\/]*\\/)*";continue}n+="[^\\/]*";continue}"/.+^${}()|[]\\".includes(o)&&(n+="\\"),n+=o}return t.endsWith("*")&&(n+=e?SEt:IEt),n+="$",new RegExp(n)}function Q7(t,e){return JSON.parse(JSON.stringify(t).replaceAll(/"\${configDir}/g,`"${ih(e)}`))}async function Y7(t,e){let n=sh.default.dirname(sh.default.resolve(t));if(e?.ignoreNodeModules&&Z7(n))return null;let i=e?.cache,o=e?.configName??"tsconfig.json";if(i?.hasConfigPath(n,o))return i.getConfigPath(n,o);let{promise:r,resolve:l,reject:s}=ob();return e?.root&&!sh.default.isAbsolute(e.root)&&(e.root=sh.default.resolve(e.root)),J0e(n,{promise:r,resolve:l,reject:s},e),r}function J0e(t,{resolve:e,reject:n,promise:i},o){let{cache:r,root:l,configName:s}=o??{};if(r)if(r.hasConfigPath(t,s)){let H;try{H=r.getConfigPath(t,s)}catch(a){n(a);return}H?.then?H.then(e).catch(n):e(H)}else r.setConfigPath(t,i,s);let u=sh.default.join(t,o?.configName??"tsconfig.json");z0e.default.stat(u,(H,a)=>{if(a&&(a.isFile()||a.isFIFO()))e(u);else if(H?.code!=="ENOENT")n(H);else{let c;l===t||(c=sh.default.dirname(t))===t?e(null):J0e(c,{promise:i,resolve:e,reject:n},o)}})}var ej=Er(require("node:path"),1),Y0e=require("node:fs"),Q0e=ej.default.sep;async function tj(t,e){let n={files:[],calls:0,skip:e?.skip,err:!1,configNames:e?.configNames??["tsconfig.json"]};return new Promise((i,o)=>{ege(ej.default.resolve(t),n,(r,l)=>r?o(r):i(l))})}function ege(t,e,n){e.err||(e.calls++,(0,Y0e.readdir)(t,{withFileTypes:!0},(i,o=[])=>{if(!e.err)if(i&&!(i.code==="ENOENT"||i.code==="EACCES"||i.code==="EPERM"))e.err=!0,n(i);else{for(let r of o)r.isDirectory()&&!e.skip?.(r.name)?ege(`${t}${Q0e}${r.name}`,e,n):r.isFile()&&e.configNames.includes(r.name)&&e.files.push(`${t}${Q0e}${r.name}`);--e.calls===0&&(e.err||n(null,e.files))}}))}function nj(t){let e=TEt(vEt(xEt(t)));return e.trim()===""?"{}":e}function TEt(t){let e=!1,n=0,i="",o=null;for(let r=0;r<t.length;r++){let l=t[r];if(l==='"'&&(rge(t,r)||(e=!e)),e){o=null;continue}if(l===","){o=r;continue}o&&(l==="}"||l==="]"?(i+=t.slice(n,o)+" ",n=o+1,o=null):l.match(/\s/)||(o=null))}return i+t.substring(n)}function rge(t,e){let n=e-1,i=0;for(;t[n]==="\\";)n-=1,i+=1;return!!(i%2)}function SC(t,e,n){return t.slice(e,n).replace(/\S/g," ")}var rj=Symbol("singleComment"),tge=Symbol("multiComment");function vEt(t){let e=!1,n=!1,i=0,o="";for(let r=0;r<t.length;r++){let l=t[r],s=t[r+1];!n&&l==='"'&&(rge(t,r)||(e=!e)),!e&&(!n&&l+s==="//"?(o+=t.slice(i,r),i=r,n=rj,r++):n===rj&&l+s===`\r
3581
+ `),{from:void 0})}catch(re){throw re}finally{z?.unhook()}E.dependencies=FL(E.configPath),u((E.dependencies??[]).flatMap(re=>Vx(re,e.folder))),E.configId=l1e(E.configPath,E.dependencies),E.plugins=await Pht(P),ee&&(E.classNames=await QQ(ee.root)),E.variants=u1e(E);let J=(0,du.default)(E.config,"theme.screens",(0,du.default)(E.config,"screens",{}));E.screens=xu(J)?Object.keys(J):[],E.enabled=!0,s(),r()}for(let O of e.config.entries){d.add(O.path);for(let j of O.deps)d.add(j.path)}return{projectConfig:e,enabled(){return h},enable(){h=!0},dependencies:()=>d,async reload(){if(!E.v4)return;console.log("---- RELOADING DESIGN SYSTEM ----"),console.log(`---- ${E.configPath} ----`);let O=await zp(E.configPath),j,k=process.hrtime.bigint();try{j=await sM(A,E.modules.tailwindcss.module,E.configPath,O,E.v4Fallback??!1)}catch(z){throw console.error(z),z}let $=Object.create(E,{designSystem:{value:j}}),U=j.getClassList().map(z=>[z[0],{...z[1],color:dc($,z[0])}]);E.designSystem=j,E.classList=U,E.variants=u1e(E);let F=j.dependencies();for(let z of F)d.add(z);u(Array.from(F));let P=process.hrtime.bigint()-k;console.log(`---- RELOADED IN ${(Number(P)/1e6).toFixed(2)}ms ----`),(i.initializationOptions?.testMode??!1)&&n.sendNotification("@/tailwindCSS/projectReloaded")},state:E,documentSelector(){return y},tryInit:L,async dispose(){E={enabled:!1,features:[]};for(let O of g)(await O).dispose()},async onUpdateSettings(O){E.enabled&&s(),r(),n.sendNotification("@/tailwindCSS/clearColors")},onFileEvents:T,async onHover(O){return Jd(async()=>{if(!E.enabled)return null;let j=o.getDocument(O.textDocument.uri);return!j||!(await E.editor.getConfiguration(j.uri)).tailwindCSS.hovers||await wH(E,j)?null:$ie(E,j,O.position)},null)},async onCodeLens(O){return Jd(async()=>{if(!E.enabled)return null;let j=o.getDocument(O.textDocument.uri);return!j||!(await E.editor.getConfiguration(j.uri)).tailwindCSS.codeLens||await wH(E,j)?null:Fie(E,j)},null)},async onCompletion(O){return Jd(async()=>{if(!E.enabled)return null;let j=o.getDocument(O.textDocument.uri);return!j||!(await E.editor.getConfiguration(j.uri)).tailwindCSS.suggestions||await wH(E,j)?null:Qie(E,j,O.position,O.context)},null)},onCompletionResolve(O){return Jd(()=>E.enabled?Yie(E,O):null,null)},async onCodeAction(O){return Jd(async()=>{if(!E.enabled)return null;let j=o.getDocument(O.textDocument.uri);return!j||!(await E.editor.getConfiguration(j.uri)).tailwindCSS.codeActions?null:vse(E,O,j)},null)},onDocumentLinks(O){if(!E.enabled)return null;let j=o.getDocument(O.textDocument.uri);if(!j)return null;let k=p7.URI.parse(j.uri).fsPath,$=_s.dirname(k);async function U(F){return F=await A.substituteId(F,$)??F,p7.URI.file(_s.resolve($,F)).toString()}return Dse(E,j,U)},provideDiagnostics:(0,h1e.debounce)(O=>{E.enabled&&$$(E,O)},i.initializationOptions?.testMode?0:500),provideDiagnosticsForce:O=>{E.enabled&&$$(E,O)},async onDocumentColor(O){return Jd(async()=>{if(!E.enabled)return[];let j=o.getDocument(O.textDocument.uri);return j?await wH(E,j)?null:Cse(E,j):[]},null)},async onColorPresentation(O){let j=o.getDocument(O.textDocument.uri);if(!j)return[];let k=j.getText(O.range),$=k.match(new RegExp(`-\\[(${o1e.join("|")}|(?:(?:#|rgba?\\(|hsla?\\())[^\\]]+)\\]$`,"i"));if($===null)return[];let U=$[1],F=o1e.includes(U),P={mode:"rgb",r:O.color.red,g:O.color.green,b:O.color.blue,alpha:O.color.alpha},W=$1(P);if(!F&&(U.length===4||U.length===5)){let[,...ee]=W.match(/^#([a-f\d])\1([a-f\d])\2([a-f\d])\3(?:([a-f\d])\4)?$/i)??[];ee.length&&(W=`#${ee.filter(Boolean).join("")}`)}W.length===5?W=W.replace(/f$/,""):W.length===9&&(W=W.replace(/ff$/,""));let z=k.substr(0,$.index);return[W,L_(P).replace(/ /g,""),L2(P).replace(/ /g,"").replace(/\d+\.\d+(%?)/g,(ee,J)=>`${Math.round(parseFloat(ee))}${J}`)].map(ee=>({label:`${z}-[${ee}]`}))},sortClassLists(O){return E.jit?O.map(j=>{let k="",$=j.split(/(\s+)/),U=$.filter((W,z)=>z%2===0),F=$.filter((W,z)=>z%2!==0);U[U.length-1]===""&&U.pop();let P;E.v4?P=E.designSystem.getClassOrder(U):E.jitContext.getClassOrder?P=E.jitContext.getClassOrder(U):P=xht(E,U),U=P.sort(([,W],[,z])=>W===z?0:W===null?-1:z===null?1:x_(W-z)).map(([W])=>W);for(let W=0;W<U.length;W++)k+=`${U[W]}${F[W]??""}`;return k}):O}}}function c1e(t,e){let n=t.config.prefix;return typeof n=="function"?n(e):n+e}function xht(t,e){let n=new Set([c1e(t,"group"),c1e(t,"peer")]),i=[];for(let o of e){let r=t.modules.jit.generateRules.module(new Set([o]),t.jitContext).sort(([l],[s])=>x_(s-l))[0]?.[0]??null;r===null&&n.has(o)&&(r=t.jitContext.layerOrder.components),i.push([o,r])}return i}function Cht(t,e,n={}){let i=e.config,o=e.modules.postcss.module,r=e.browserslist,l=r&&r.includes("ie 11")?"ie11":"relaxed",s=typeof t=="function"?t:t.handler;try{s({addUtilities:()=>{},addComponents:()=>{},addBase:()=>{},matchUtilities:()=>{},addVariant:()=>{},e:u=>u,prefix:u=>u,theme:(u,H)=>(0,du.default)(i,`theme.${u}`,H),variants:()=>[],config:(u,H)=>(0,du.default)(i,u,H),corePlugins:u=>Array.isArray(i.corePlugins)?i.corePlugins.includes(u):(0,du.default)(i,`corePlugins.${u}`,!0),target:u=>{if(typeof i.target=="string")return i.target==="browserslist"?l:i.target;let[H,a]=(0,du.default)(i,"target"),c=(0,du.default)(a,u,H);return c==="browserslist"?l:c},postcss:o,...n})}catch{}}function Dht(t){return t.type==="atrule"}function u1e(t){if(t.v4){let r=Array.from(t.designSystem.getVariants()),l=t.designSystem.theme.prefix??"";return l.length>0&&r.unshift({name:l,values:[],isArbitrary:!1,hasDash:!0,selectors:()=>["&"]}),r}if(t.jitContext?.getVariants)return t.jitContext.getVariants();if(t.jit){let r=[];return Array.from(t.jitContext.variantMap).forEach(([l,s])=>{r.push({name:l,values:[],isArbitrary:!1,hasDash:!0,selectors:()=>{function u(g){let y=t.modules.postcssSelectorParser.module.className();return y.value=g,(0,du.default)(y,"raws.value",y.value)}let H=(Array.isArray(s[0])?s:[s]).map(([g,y])=>y),a="__variant_placeholder__",c=t.modules.postcss.module.root({nodes:[t.modules.postcss.module.rule({selector:`.${u(a)}`,nodes:[]})]}),p=t.modules.postcssSelectorParser.module(g=>g.first.filter(({type:y})=>y==="class").pop().value);function d(g){return p.transformSync(g)}function h(g){return c.each(y=>{y.type==="rule"&&(y.selectors=y.selectors.map(_=>g({get className(){return d(_)},selector:_})))}),c}let m=[];for(let g of H){let y,_=c.clone(),E=gG(()=>g({container:_,separator:t.separator,modifySelectors:h,format:A=>{y=A.replace(/:merge\(([^)]+)\)/g,"$1")},wrap:A=>{Dht(A)&&(y=`@${A.name} ${A.params}`)}}));if(y||(y=E),y){m.push(y);continue}_.walkDecls(A=>{A.remove()}),y=_.toString().replace(`.${u(`${l}:${a}`)}`,"&").replace(/(?<!\\)[{}]/g,"").replace(/\s*\n\s*/g," ").trim(),y.includes(a)||m.push(y)}return m}})}),r}let e=t.config,n=t.modules.tailwindcss.version,i=["responsive","hover"];return vn(n,"0.3.0")&&i.push("focus","group-hover"),vn(n,"0.5.0")&&i.push("active"),vn(n,"0.7.0")&&i.push("focus-within"),vn(n,"1.0.0-beta.1")&&i.push("default"),vn(n,"1.1.0")&&i.push("first","last","odd","even","disabled","visited"),vn(n,"1.3.0")&&i.push("group-focus"),vn(n,"1.5.0")&&i.push("focus-visible","checked"),vn(n,"1.6.0")&&i.push("motion-safe","motion-reduce"),vn(n,"2.0.0-alpha.1")&&i.push("dark"),(Array.isArray(e.plugins)?e.plugins:[]).forEach(r=>{Cht(r,t,{addVariant:l=>{i.push(l)}})}),i.map(r=>({name:r,values:[],isArbitrary:!1,hasDash:!0,selectors:()=>[]}))}async function Pht(t){let e=t.plugins;return Array.isArray(e)?Promise.all(e.map(async n=>{let i=n.config;xu(i)||(i={});let o={theme:xu(i.theme)?Object.keys(i.theme):[],variants:xu(i.variants)?Object.keys(i.variants):[]},r=n.handler||n,l=typeof r.name=="string"&&r.name!=="handler"&&r.name!==""?r.name:null;try{r()}catch(s){let u=f1e.default.parse(s);if(u.length===0)return{name:l};let H=u[0].fileName,a=_s.dirname(H);if(!d1e.default.sync({cwd:a}))return{name:l};let p;try{p=require(p)}catch{return{name:l}}if(p.name&&_s.resolve(a,p.main||"index.js")===H)return{name:p.name,homepage:p.homepage,contributes:o}}return{name:l}})):[]}function wht(t,e){try{let n=Ad.default.sync(i=>{let o=_s.join(i,"package.json");if(Ad.default.sync.exists(o))return o;if(i===_s.normalize(e))return Ad.default.stop},{cwd:t});return n?_s.dirname(n):e}catch{return e}}function H1e(t,e,n,i){let o=i??require(t),r=o.content?.files??o.content,l=Array.isArray(r)?r:[],s=vn(e,"3.2.0")?o.future?.relativeContentPathsByDefault||o.content?.relative:!1,u;return s?u=_s.dirname(t):u=wht(_s.dirname(t),n),l.filter(H=>typeof H=="string").map(H=>H.startsWith("!")?`!${_s.resolve(u,H.slice(1))}`:_s.resolve(u,H)).map(H=>({pattern:Sa(Ss(H)),priority:1}))}var L1e=Er(I1e());function S1e(){return{editor:{tabSize:2},tailwindCSS:{inspectPort:null,emmetCompletions:!1,classAttributes:["class","className","ngClass","class:list"],classFunctions:[],codeActions:!0,codeLens:!0,hovers:!0,suggestions:!0,validate:!0,colorDecorators:!0,rootFontSize:16,lint:{cssConflict:"warning",invalidApply:"error",invalidScreen:"error",invalidVariant:"error",invalidConfigPath:"error",invalidTailwindDirective:"error",invalidSourceDirective:"error",recommendedVariantOrder:"warning"},showPixelEquivalents:!0,includeLanguages:{},files:{exclude:["**/.git/**","**/node_modules/**","**/.hg/**","**/.svn/**"]},experimental:{classRegex:[],configFile:null}}}}function T1e(t){let e=new Map;async function n(o){let r=e.get(o);return r||(r=await i(o),e.set(o,r)),r}async function i(o){let[r,l]=await Promise.all([t.workspace.getConfiguration({section:"editor",scopeUri:o}),t.workspace.getConfiguration({section:"tailwindCSS",scopeUri:o})]);return r=xu(r)?r:{},l=xu(l)?l:{},(0,L1e.default)(S1e(),{editor:r,tailwindCSS:l},{arrayMerge:(s,u,H)=>u})}return{get:n,clear(){e.clear()}}}var Da=Er(require("node:path")),rb=Er(require("node:fs/promises"));var Td=Er(require("path"),1),n0e=Er(t0e(),1),S7=Er(Ep(),1),aC=Er(Ep(),1),rmt=/^(\/?\.\.)+$/;function nmt(t,e){let n=t.length,i=Array(n),o=Array(n);for(let r=0;r<n;r++){let l=i0e(t[r]);i[r]=l;let s=l.length,u=Array(s);for(let H=0;H<s;H++)u[H]=aC.default.makeRe(l[H],e);o[r]=u}return r=>{let l=r.split("/");if(l[0]===".."&&rmt.test(r))return!0;for(let s=0;s<t.length;s++){let u=i[s],H=o[s],a=l.length,c=Math.min(a,u.length),p=0;for(;p<c;){let d=u[p];if(d.includes("/"))return!0;if(!H[p].test(l[p]))break;if(d==="**")return!0;p++}if(p===a)return!0}return!1}}var imt={parts:!0};function i0e(t){var e;let n=aC.default.scan(t,imt);return(e=n.parts)!=null&&e.length?n.parts:[t]}var smt=process.platform==="win32";var amt=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,omt=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,lmt=t=>t.replace(amt,"\\$&"),cmt=t=>t.replace(omt,"\\$&"),umt=smt?cmt:lmt;function Hmt(t,e){if(e?.caseSensitiveMatch===!1)return!0;let n=aC.default.scan(t);return n.isGlob||n.negated}function Gm(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}var pmt=/^(\/?\.\.)+/,dmt=/\\(?=[()[\]{}!*+?@|])/g,L7=/\\/g;function I7(t,e,n,i,o){var r;let l=t;t.endsWith("/")&&(l=t.slice(0,-1)),!l.endsWith("*")&&e&&(l+="/**"),Td.default.isAbsolute(l.replace(dmt,""))?l=Td.posix.relative(umt(n),l):l=Td.posix.normalize(l);let s=pmt.exec(l);if(s?.[0]){let u=Td.posix.join(n,s[0]);i.root.length>u.length&&(i.root=u,i.depthOffset=-(s[0].length+1)/3)}else if(!o&&i.depthOffset>=0){let u=i0e(l);(r=i.commonPath)!=null||(i.commonPath=u);let H=[],a=Math.min(i.commonPath.length,u.length);for(let c=0;c<a;c++){let p=u[c];if(p==="**"&&!u[c+1]){H.pop();break}if(p!==i.commonPath[c]||Hmt(p)||c===u.length-1)break;H.push(p)}i.depthOffset=H.length,i.commonPath=H,i.root=H.length>0?`${n}/${H.join("/")}`:n}return l}function fmt({patterns:t,ignore:e=[],expandDirectories:n=!0},i,o){typeof t=="string"?t=[t]:t||(t=["**/*"]),typeof e=="string"&&(e=[e]);let r=[],l=[];for(let s of e)s&&(s[0]!=="!"||s[1]==="(")&&l.push(I7(s,n,i,o,!0));for(let s of t)s&&(s[0]!=="!"||s[1]==="("?r.push(I7(s,n,i,o,!1)):(s[1]!=="!"||s[2]==="(")&&l.push(I7(s.slice(1),n,i,o,!0)));return{match:r,ignore:l}}function s0e(t,e,n){return Td.posix.relative(e,`${n}/${t}`)||"."}function sC(t,e,n,i,o){let r=o?t.slice(n.length+1)||".":t;return n===e?i&&r!=="."?r.slice(0,-1):r:s0e(r,e,n)}function r0e(t,e,n){for(let i=t.length-1;i>=0;i--){let o=t[i];t[i]=s0e(o,e,n)+(!o||o.endsWith("/")?"/":"")}return t}function hmt(t,e,n){if(process.env.TINYGLOBBY_DEBUG&&(t.debug=!0),t.debug&&Gm("globbing with options:",t,"cwd:",e),Array.isArray(t.patterns)&&t.patterns.length===0)return n?[]:Promise.resolve([]);let i={root:e,commonPath:null,depthOffset:0},o=fmt(t,e,i),r=t.caseSensitiveMatch===!1;t.debug&&Gm("internal processing patterns:",o);let l=(0,S7.default)(o.match,{dot:t.dot,nocase:r,ignore:o.ignore}),s=(0,S7.default)(o.ignore,{dot:t.dot,nocase:r}),u=nmt(o.match,{dot:t.dot,nocase:r}),H={filters:[t.debug?(p,d)=>{let h=sC(p,e,i.root,d,t.absolute),m=l(h);return m&&Gm(`matched ${h}`),m}:(p,d)=>l(sC(p,e,i.root,d,t.absolute))],exclude:t.debug?(p,d)=>{let h=sC(d,e,i.root,!0,!0),m=h!=="."&&!u(h)||s(h);return Gm(m?`skipped ${d}`:`crawling ${d}`),m}:(p,d)=>{let h=sC(d,e,i.root,!0,!0);return h!=="."&&!u(h)||s(h)},pathSeparator:"/",relativePaths:!0,resolveSymlinks:!0};t.deep&&(H.maxDepth=Math.round(t.deep-i.depthOffset)),t.absolute&&(H.relativePaths=!1,H.resolvePaths=!0,H.includeBasePath=!0),t.followSymbolicLinks===!1&&(H.resolveSymlinks=!1,H.excludeSymlinks=!0),t.onlyDirectories?(H.excludeFiles=!0,H.includeDirs=!0):t.onlyFiles===!1&&(H.includeDirs=!0),i.root=i.root.replace(L7,"");let a=i.root;t.debug&&Gm("internal properties:",i);let c=new n0e.fdir(H).crawl(a);return e===a||t.absolute?n?c.sync():c.withPromise():n?r0e(c.sync(),e,a):c.withPromise().then(p=>r0e(p,e,a))}async function a0e(t,e){if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let n=Array.isArray(t)||typeof t=="string"?{...e,patterns:t}:t,i=n.cwd?Td.default.resolve(n.cwd).replace(L7,"/"):process.cwd().replace(L7,"/");return hmt(n,i,!1)}var l0e=Er(Ep());var oC=class{constructor(){this.parents=new Map;this.children=new Map;this.nodes=new Map}add(e,n){return this.nodes.has(e)?this.nodes.get(e):(this.nodes.set(e,n),this.parents.set(e,new Set),this.children.set(e,new Set),n)}connect(e,n){let i=this.children.get(e);if(!i)throw new Error(`Node ${e} does not exist`);let o=this.parents.get(n);if(!o)throw new Error(`Node ${n} does not exist`);o.add(e),i.add(n)}*descendants(e){let n=[],i=new Set;for(let o of this.children.get(e))n.push(o);for(;n.length>0;){let o=n.shift();if(!i.has(o)){yield this.nodes.get(o),i.add(o);for(let r of this.children.get(o))n.push(r)}}}*roots(){for(let[e,n]of this.parents)n.size===0&&(yield this.nodes.get(e))}*leaves(){for(let[e,n]of this.children)n.size===0&&(yield this.nodes.get(e))}};var lC=class extends Map{remember(e,n){let i=super.get(e);return i||(i=n(e),this.set(e,i)),i}};var cC=Er(VA()),Xm=Er(require("node:path"));async function T7(t,e){async function n(i){let o=Xm.join(i,"package.json");if(await cC.default.exists(o))return o;if(i===Xm.normalize(e))return cC.default.stop}try{let i=await(0,cC.default)(n,{cwd:t});return i?Xm.dirname(i):e}catch{return e}}async function _mt(t){let e=await import(t);return!e.scanDir&&!e.Scanner?null:e}async function o0e(t){let e=await _mt(t.oxidePath);if(!e)return null;if(IH(t.oxideVersion,"4.0.0-alpha.18")){let n=e.scanDir?.({base:t.basePath,globs:!0});return{files:n.files,globs:n.globs.map(i=>({base:i.base,pattern:i.glob}))}}else if(IH(t.oxideVersion,"4.0.0-alpha.19")){let n=e.scanDir({base:t.basePath,sources:t.sources.map(i=>({base:i.base,pattern:i.pattern}))});return{files:n.files,globs:n.globs.map(i=>({base:i.base,pattern:i.pattern}))}}else if(IH(t.oxideVersion,"4.0.0-alpha.30")){let n=new e.Scanner({detectSources:{base:t.basePath},sources:t.sources.map(i=>({base:i.base,pattern:i.pattern}))});return{files:n.files,globs:n.globs.map(i=>({base:i.base,pattern:i.pattern}))}}else if(IH(t.oxideVersion,"4.0.9999")){let n=new e.Scanner({sources:[{base:t.basePath,pattern:"**/*"},...t.sources.map(i=>({base:i.base,pattern:i.pattern}))]});return{files:n.files,globs:n.globs.map(i=>({base:i.base,pattern:i.pattern}))}}else{let n=new e.Scanner({sources:[{base:t.basePath,pattern:"**/*",negated:!1},...t.sources.map(i=>({base:i.base,pattern:i.pattern,negated:i.negated}))]});return{files:n.files,globs:n.globs.map(i=>({base:i.base,pattern:i.pattern}))}}}var Emt=/@import\s*['"]tailwindcss(?:\/[^'"]+)?['"]/,ymt=/@(theme|plugin|utility|custom-variant|variant|reference)\s*[^;{]+[;{]/,gmt=/--(alpha|spacing|theme)\(/,bmt=/@tailwind\s*(base|preflight|components|variants|screens)+;/,Amt=/@tailwind\s*utilities\s*[^;]*;/,Imt=/@tailwind\s*[^;]+;/,Smt=/@(config|apply)\s*[^;{]+[;{]/,Lmt=/@import\s*['"]/;function uC(t){return Emt.test(t)?{root:!0,versions:["4"]}:ymt.test(t)?Amt.test(t)?{root:!0,versions:["4"]}:{root:!1,versions:["4"]}:gmt.test(t)?{root:!1,versions:["4"]}:bmt.test(t)?{root:!1,versions:["3"]}:Imt.test(t)?{root:!0,versions:["4","3"]}:Smt.test(t)?{root:!1,versions:["4","3"]}:Lmt.test(t)?{root:!0,versions:["4","3"]}:{root:!1,versions:[]}}var HC=class{constructor(e,n,i){this.base=e;this.settings=n;this.resolver=i}async search(){let e=await this.findConfigs(),n=await Promise.allSettled(e.map(o=>this.createProject(o))),i=[];for(let o of n)o.status==="rejected"?console.error(`[GLOBAL] Error creating project: ${o.reason}`):o.status==="fulfilled"&&o.value&&i.push(o.value);i.length===1&&i[0].documentSelector.push({pattern:Ss(Da.join(this.base,"**")),priority:5});for(let o of i){o.folder=Sa(o.folder),o.configPath=Sa(o.configPath),o.config.path=Sa(o.config.path);for(let r of o.config.entries)r.path=Sa(r.path);for(let r of o.documentSelector)r.pattern=Sa(r.pattern)}return i}async loadAllFromWorkspace(e){return Promise.all(e.map(n=>this.loadFromWorkspace(n[0],n[1])))}async loadFromWorkspace(e,n){let i=e.endsWith(".css")?{type:"css",path:e,source:"css",entries:[],content:[],packageRoot:""}:{type:"js",path:e,source:"js",entries:[],content:[],packageRoot:""},o=await this.detectTailwindVersion(i);return i.packageRoot=await T7(Da.dirname(i.path),this.base),{config:i,folder:this.base,isUserConfigured:!0,configPath:i.path,documentSelector:n.map(r=>({priority:0,pattern:r})),tailwind:o}}async createProject(e){let n=await this.detectTailwindVersion(e),i=e.entries.flatMap(r=>r.meta?.versions??[]);if(console.log(JSON.stringify({tailwind:n,path:e.path})),e.type==="js"&&e.source==="css"&&(n.isDefaultVersion||!n.features.includes("css-at-config-as-project")))return null;if(e.type==="css"){if(!n.features.includes("css-at-theme"))return null;if(!i.includes("4"))return console.warn(`The config ${e.path} looks like it might be for a different Tailwind CSS version. Skipping.`),null;if(c0e(e.path))return console.warn(`The config ${e.path} requires a preprocessor and is not supported by Tailwind CSS v4.0.`),null}if(e.type==="js"&&n.features.includes("css-at-theme")||e.type==="js"&&(e.path.endsWith(".ts")||e.path.endsWith(".mjs"))&&!n.features.includes("transpiled-configs"))return null;e.packageRoot=await T7(Da.dirname(e.path),this.base);let o=[];for(let r of e.entries)r.type==="css"&&o.push({pattern:r.path,priority:0});o.push({pattern:e.path,priority:0});for await(let r of Tmt(e,n.features,this.resolver))o.push(r);for(let r of e.entries)r.type==="css"&&o.push({pattern:Ss(Da.join(Da.dirname(r.path),"**")),priority:2});return o.push({pattern:Ss(Da.join(Da.dirname(e.path),"**")),priority:3}),o.push({pattern:Ss(Da.join(e.packageRoot,"**")),priority:4}),o.sort((r,l)=>r.priority-l.priority),o=o.filter(({pattern:r},l,s)=>s.findIndex(({pattern:u})=>u===r)===l),{config:e,folder:this.base,isUserConfigured:!1,configPath:e.path,documentSelector:o,tailwind:n}}async findConfigs(){let e=this.settings.tailwindCSS.files.exclude;e=e.map(h=>h.startsWith("/")?h.slice(1):h);let n=await a0e({patterns:[`**/${Wh}`,`**/${yp}`],cwd:this.base,ignore:e,onlyFiles:!0,absolute:!0,followSymbolicLinks:!0,dot:!0}),i=await Promise.all(n.map(h=>rb.realpath(h)));n=n.filter((h,m)=>{let g=i[m];return h===g?!0:!n.includes(g)}),n=n.map(h=>Ss(h)),n=Array.from(new Set(n)).sort();let o=new lC,r=(0,l0e.default)(`**/${yp}`,{dot:!0}),l=n.map(h=>r(h)?new pC("css",h):new pC("js",h,[o.remember(h,()=>({source:"js",type:"js",path:h,entries:[],packageRoot:null,content:[]}))])),s=l.filter(h=>h.type==="css");await Promise.all(s.map(h=>h.read())),await Promise.all(s.map(h=>h.resolvePossibleVersions()));let u=[];for(let h of s){if(!h.content||!h.meta||h.meta.versions.length===0)continue;let m=h.configPathInCss();m&&h.configs.push(o.remember(m,()=>({source:"css",type:"js",path:m,entries:[],packageRoot:null,content:[]}))),u.push(h)}await Promise.all(u.map(h=>h.resolveImports(this.resolver))),await Promise.all(u.map(h=>h.resolveRealpaths())),await Promise.all(u.map(h=>h.resolveSourceDirectives()));let H=new oC,a=null,c=null,p=null;for(let h of u){H.add(h.realpath,h);for(let m of h.deps)H.add(m.realpath,m),H.connect(h.realpath,m.realpath);h.realpath.includes("node_modules/tailwindcss/index.css")?a=h.realpath:h.realpath.includes("node_modules/tailwindcss/theme.css")?c=h.realpath:h.realpath.includes("node_modules/tailwindcss/utilities.css")&&(p=h.realpath)}a&&c&&H.connect(a,c),a&&p&&H.connect(a,p);let d=Array.from(H.roots());d.sort((h,m)=>h.meta.root===m.meta.root?0:h.meta.root?-1:1);for(let h of d){if(!h.meta)continue;let m=o.remember(h.path,()=>({source:"css",type:"css",path:h.path,entries:[],packageRoot:null,content:[{kind:"auto"}]}));h.configs.push(m);for(let g of H.descendants(h.realpath))g.configs.push(m)}for(let h of l)for(let m of h.configs)m.entries.push(h);return Array.from(o.values())}async detectTailwindVersion(e){try{let r=await this.resolver.resolveCjsId("tailwindcss/package.json",Da.dirname(e.path)),{version:l}=require(r),s;if(this.resolver.hasPnP()){let H=await this.resolver.resolveCjsId("tailwindcss",Da.dirname(e.path));s=require(H)}else{let H=await this.resolver.resolveJsId("tailwindcss",Da.dirname(e.path));s=await import(hH(H).href)}let u=Lf(l,s);if(typeof l=="string")return{version:l,features:u,isDefaultVersion:!1}}catch{}if(e.type==="css"){let{version:r}=wM(),l=await Promise.resolve().then(()=>(PM(),DM)),s=Lf(r,l);return{version:r,features:s,isDefaultVersion:!0}}let{version:n}=_g(),i=c7(),o=Lf(n,i);return{version:n,features:o,isDefaultVersion:!0}}};function Tmt(t,e,n){if(t.type==="css")return xmt(t,n);if(t.type==="js")return vmt(t,e)}async function*vmt(t,e,n){let i;try{i=n??require(t.path)}catch{return}let o=i.content?.files??i.content,r=Array.isArray(o)?o:[],s=(e.includes("relative-content-paths")?i.future?.relativeContentPathsByDefault||i.content?.relative:!1)?Da.dirname(t.path):t.packageRoot;for(let u of r){if(typeof u!="string")continue;let H=u.startsWith("!")?`!${Da.resolve(s,u.slice(1))}`:Da.resolve(s,u);yield{pattern:Ss(H),priority:1}}}async function*xmt(t,e){let n=!1;for(let i of t.content)if(i.kind==="file")yield{pattern:Ss(i.file),priority:1};else if(i.kind==="auto"&&!n){n=!0;let o=t.entries.flatMap(r=>r.sources);for await(let r of Cmt(t.packageRoot,t.path,o,e))yield{pattern:r,priority:1}}}async function*Cmt(t,e,n,i){try{let o=await i.resolveJsId("@tailwindcss/oxide",t);o=hH(o).href;let r=await i.resolveJsId("@tailwindcss/oxide/package.json",t),l=JSON.parse(await rb.readFile(r,"utf8")),s=await o0e({oxidePath:o,oxideVersion:l.version,basePath:t,sources:n.map(u=>({base:Da.dirname(e),pattern:u.pattern,negated:u.negated}))});if(!s)return;for(let u of s.files)yield Ss(u);for(let{base:u,pattern:H}of s.globs)yield Ss(u)+"/"+H}catch{}}var pC=class t{constructor(e,n,i=[]){this.type=e;this.path=n;this.configs=i;this.deps=[];this.sources=[];this.meta=null}async read(){try{this.content=await zp(this.path)}catch{this.content=null}}async resolveImports(e){if(!c0e(this.path))try{let n=await KL({resolver:e,loose:!0}).process(this.content,{from:this.path}),i=n.messages.filter(o=>o.type==="dependency");i=i.filter(o=>!o.file.startsWith("/virtual:missing/")),this.deps=i.map(o=>new t("css",Ss(o.file))),this.content=n.css}catch(n){console.debug(`Unable to resolve imports for ${this.path}.`),console.debug("This may result in failure to locate Tailwind CSS projects."),console.error(n)}}async resolveRealpaths(){this.realpath=Ss(await rb.realpath(this.path)),await Promise.all(this.deps.map(e=>e.resolveRealpaths()))}async resolveSourceDirectives(){try{if(this.sources.length>0)return;await $l([soe(this.sources)]).process(this.content,{from:this.realpath})}catch{}}async resolvePossibleVersions(){this.meta=this.content?uC(this.content):null}configPathInCss(){if(!this.content)return null;let e=this.content.match(/@config\s*(?<config>'[^']+'|"[^"]+")/);return e?Ss(Da.resolve(Da.dirname(this.path),e.groups.config.slice(1,-1))):null}};function c0e(t){let e=Da.extname(t);return e===".scss"||e===".sass"||e===".less"||e===".styl"||e===".pcss"}var jEt=Er(require("node:fs")),dge=Er(require("node:path")),rE=Er(wD());var u0e=Er(VA()),dC=Er(require("node:path"));var v7=new Map;async function H0e(t){let e=v7.get(t);if(e!==void 0)return e;let n=await Dmt(dC.normalize(t));if(!n)return v7.set(t,null),null;let r=(await import(hH(n).href)).default;return r.setup(),v7.set(t,r),r}async function Dmt(t){let e=[".pnp.js",".pnp.cjs"];for(let n of e){let i=dC.join(t,n);if(await u0e.default.exists(i))return i}return null}var ah=Er(require("node:path")),Hge=Er(K0e());var sh=Er(require("node:path"),1),z0e=Er(require("node:fs"),1);var Go=Er(require("node:path"),1),Z0e=require("node:fs"),gEt=new RegExp("\\"+Go.default.posix.sep,"g"),bEt=new RegExp("\\"+Go.default.sep,"g"),V7=new Map,Ym="**/*",AC=[".ts",".tsx",".mts",".cts"],AEt=[".js",".jsx",".mjs",".cjs"],G7=AC.concat(AEt),IEt=`\\.(?:${AC.map(t=>t.substring(1)).join("|")})`,SEt=`\\.(?:${G7.map(t=>t.substring(1)).join("|")})`,IC=Go.default.posix.sep===Go.default.sep;function ob(){let t,e;return{promise:new Promise((i,o)=>{t=i,e=o}),resolve:t,reject:e}}async function X7(t,e){if(Go.default.extname(t)!==".json")return;let n=Go.default.resolve(t);return e&&(e.hasParseResult(n)||e.hasParseResult(t))?n:Z0e.promises.stat(n).then(i=>{if(i.isFile()||i.isFIFO())return n;throw new Error(`${t} exists but is not a regular file.`)})}var Z7=IC?t=>t.includes("/node_modules/"):t=>t.match(/[/\\]node_modules[/\\]/),K7=IC?t=>t:t=>t.replace(gEt,Go.default.sep),ih=IC?t=>t:t=>t.replace(bEt,Go.default.posix.sep),eE=IC?(t,e)=>t?Go.default.resolve(t,e):Go.default.resolve(e):(t,e)=>ih(t?Go.default.resolve(K7(t),K7(e)):Go.default.resolve(K7(e)));function z7(t,e){let n=Go.default.dirname(t.tsconfigFile);return t.tsconfig.references.map(i=>{let o=i.path.endsWith(".json")?i.path:Go.default.join(i.path,e?.configName??"tsconfig.json");return eE(n,o)})}function J7(t,e){let i=e.tsconfig.compilerOptions?.allowJs?G7:AC;if(e.referenced&&i.some(o=>t.endsWith(o))&&!G0e(t,e)){let o=e.referenced.find(r=>G0e(t,r));if(o)return o}return e}function G0e(t,e){let n=ih(Go.default.dirname(e.tsconfigFile)),i=(e.tsconfig.files||[]).map(s=>eE(n,s)),o=eE(null,t);if(i.includes(t))return!0;let r=e.tsconfig.compilerOptions?.allowJs;return X0e(o,n,e.tsconfig.include||(e.tsconfig.files?[]:[Ym]),r)?!X0e(o,n,e.tsconfig.exclude||[],r):!1}function X0e(t,e,n,i){let o=i?G7:AC;return n.some(r=>{let l=r.length,s=!1,u=!1,H=!1,a=-1;for(let h=r.length-1;h>-1;h--){let m=r[h];if(s||(m==="*"||m==="?")&&(l=h,s=!0),H||(m==="."?u=!0:m==="/"&&(a=h,H=!0)),s&&H)break}if(!u&&(!s||l<a)&&(r+=`${r.endsWith("/")?"":"/"}${Ym}`,l=r.length-1,s=!0),l<r.length-1&&!t.endsWith(r.slice(l+1))||r.endsWith("*")&&!o.some(h=>t.endsWith(h)))return!1;if(r===Ym)return t.startsWith(`${e}/`);let c=eE(e,r),p=-1;for(let h=0;h<c.length;h++)if(c[h]==="*"||c[h]==="?"){p=h,s=!0;break}if(p>1&&!t.startsWith(c.slice(0,p-1)))return!1;if(s){if(p+Ym.length===c.length-(r.length-1-l)&&c.slice(p,p+Ym.length)===Ym)return!0}else return t===c;if(V7.has(c))return V7.get(c).test(t);let d=LEt(c,i);return V7.set(c,d),d.test(t)})}function LEt(t,e){let n="^";for(let i=0;i<t.length;i++){let o=t[i];if(o==="?"){n+="[^\\/]";continue}if(o==="*"){if(t[i+1]==="*"&&t[i+2]==="/"){i+=2,n+="(?:[^\\/]*\\/)*";continue}n+="[^\\/]*";continue}"/.+^${}()|[]\\".includes(o)&&(n+="\\"),n+=o}return t.endsWith("*")&&(n+=e?SEt:IEt),n+="$",new RegExp(n)}function Q7(t,e){return JSON.parse(JSON.stringify(t).replaceAll(/"\${configDir}/g,`"${ih(e)}`))}async function Y7(t,e){let n=sh.default.dirname(sh.default.resolve(t));if(e?.ignoreNodeModules&&Z7(n))return null;let i=e?.cache,o=e?.configName??"tsconfig.json";if(i?.hasConfigPath(n,o))return i.getConfigPath(n,o);let{promise:r,resolve:l,reject:s}=ob();return e?.root&&!sh.default.isAbsolute(e.root)&&(e.root=sh.default.resolve(e.root)),J0e(n,{promise:r,resolve:l,reject:s},e),r}function J0e(t,{resolve:e,reject:n,promise:i},o){let{cache:r,root:l,configName:s}=o??{};if(r)if(r.hasConfigPath(t,s)){let H;try{H=r.getConfigPath(t,s)}catch(a){n(a);return}H?.then?H.then(e).catch(n):e(H)}else r.setConfigPath(t,i,s);let u=sh.default.join(t,o?.configName??"tsconfig.json");z0e.default.stat(u,(H,a)=>{if(a&&(a.isFile()||a.isFIFO()))e(u);else if(H?.code!=="ENOENT")n(H);else{let c;l===t||(c=sh.default.dirname(t))===t?e(null):J0e(c,{promise:i,resolve:e,reject:n},o)}})}var ej=Er(require("node:path"),1),Y0e=require("node:fs"),Q0e=ej.default.sep;async function tj(t,e){let n={files:[],calls:0,skip:e?.skip,err:!1,configNames:e?.configNames??["tsconfig.json"]};return new Promise((i,o)=>{ege(ej.default.resolve(t),n,(r,l)=>r?o(r):i(l))})}function ege(t,e,n){e.err||(e.calls++,(0,Y0e.readdir)(t,{withFileTypes:!0},(i,o=[])=>{if(!e.err)if(i&&!(i.code==="ENOENT"||i.code==="EACCES"||i.code==="EPERM"))e.err=!0,n(i);else{for(let r of o)r.isDirectory()&&!e.skip?.(r.name)?ege(`${t}${Q0e}${r.name}`,e,n):r.isFile()&&e.configNames.includes(r.name)&&e.files.push(`${t}${Q0e}${r.name}`);--e.calls===0&&(e.err||n(null,e.files))}}))}function nj(t){let e=TEt(vEt(xEt(t)));return e.trim()===""?"{}":e}function TEt(t){let e=!1,n=0,i="",o=null;for(let r=0;r<t.length;r++){let l=t[r];if(l==='"'&&(rge(t,r)||(e=!e)),e){o=null;continue}if(l===","){o=r;continue}o&&(l==="}"||l==="]"?(i+=t.slice(n,o)+" ",n=o+1,o=null):l.match(/\s/)||(o=null))}return i+t.substring(n)}function rge(t,e){let n=e-1,i=0;for(;t[n]==="\\";)n-=1,i+=1;return!!(i%2)}function SC(t,e,n){return t.slice(e,n).replace(/\S/g," ")}var rj=Symbol("singleComment"),tge=Symbol("multiComment");function vEt(t){let e=!1,n=!1,i=0,o="";for(let r=0;r<t.length;r++){let l=t[r],s=t[r+1];!n&&l==='"'&&(rge(t,r)||(e=!e)),!e&&(!n&&l+s==="//"?(o+=t.slice(i,r),i=r,n=rj,r++):n===rj&&l+s===`\r
3582
3582
  `?(r++,n=!1,o+=SC(t,i,r),i=r):n===rj&&l===`
3583
3583
  `?(n=!1,o+=SC(t,i,r),i=r):!n&&l+s==="/*"?(o+=t.slice(i,r),i=r,n=tge,r++):n===tge&&l+s==="*/"&&(r++,n=!1,o+=SC(t,i,r+1),i=r+1))}return o+(n?SC(t.slice(i)):t.slice(i))}function xEt(t){return t.charCodeAt(0)===65279?t.slice(1):t}var Dc=Er(require("node:path"),1),age=require("node:fs"),oge=require("module");var CEt={tsconfigFile:null,tsconfig:{}};async function sj(t,e){let n=e?.cache;if(n?.hasParseResult(t))return nge(t,n,e);let{resolve:i,reject:o,promise:r}=ob();n?.setParseResult(t,r,!0);try{let l=await X7(t,n)||await Y7(t,e);if(!l)return i(CEt),r;let s;t!==l&&n?.hasParseResult(l)?s=await nge(l,n,e):(s=await aj(l,n,t===l),await Promise.all([oj(s,n),lge(s,e)])),s.tsconfig=Q7(s.tsconfig,Dc.default.dirname(l)),i(J7(t,s))}catch(l){o(l)}return r}async function nge(t,e,n){let i=await e.getParseResult(t);if(i.tsconfig.extends&&!i.extended||i.tsconfig.references&&!i.referenced){let o=Promise.all([oj(i,e),lge(i,n)]).then(()=>i);return e.setParseResult(t,o,!0),o}return i}async function aj(t,e,n){if(!n&&e?.hasParseResult(t)&&!e.getParseResult(t)._isRootFile_)return e.getParseResult(t);let i=age.promises.readFile(t,"utf-8").then(nj).then(o=>{let r=JSON.parse(o);return NEt(r,t),{tsconfigFile:t,tsconfig:DEt(r,Dc.default.dirname(t))}}).catch(o=>{throw new tE(`parsing ${t} failed: ${o}`,"PARSE_FILE",t,o)});return!n&&(!e?.hasParseResult(t)||!e.getParseResult(t)._isRootFile_)&&e?.setParseResult(t,i),i}function DEt(t,e){let n=t.compilerOptions?.baseUrl;return n&&!n.startsWith("${")&&!Dc.default.isAbsolute(n)&&(t.compilerOptions.baseUrl=eE(e,n)),t}async function lge(t,e){if(!t.tsconfig.references)return;let n=z7(t,e),i=await Promise.all(n.map(o=>aj(o,e?.cache)));await Promise.all(i.map(o=>oj(o,e?.cache))),i.forEach(o=>{o.solution=t}),t.referenced=i}async function oj(t,e){if(!t.tsconfig.extends)return;let n=[{tsconfigFile:t.tsconfigFile,tsconfig:JSON.parse(JSON.stringify(t.tsconfig))}],i=0,o=[],r=0;for(;i<n.length;){let l=n[i];if(o.push(l.tsconfigFile),l.tsconfig.extends){r+=1;let s;Array.isArray(l.tsconfig.extends)?s=l.tsconfig.extends.reverse().map(H=>ige(H,l.tsconfigFile)):s=[ige(l.tsconfig.extends,l.tsconfigFile)];let u=s.find(H=>o.includes(H));if(u){let H=o.concat([u]).join(" -> ");throw new tE(`Circular dependency in "extends": ${H}`,"EXTENDS_CIRCULAR",t.tsconfigFile)}n.splice(i+1,0,...await Promise.all(s.map(H=>aj(H,e))))}else o.splice(-r),r=0;i=i+1}t.extended=n;for(let l of t.extended.slice(1))wEt(t,l)}function ige(t,e){t===".."&&(t="../tsconfig.json");let n=(0,oge.createRequire)(e),i;try{return n.resolve(t)}catch(o){i=o}if(t[0]!=="."&&!Dc.default.isAbsolute(t))try{return n.resolve(`${t}/tsconfig.json`)}catch(o){i=o}throw new tE(`failed to resolve "extends":"${t}" in ${e}`,"EXTENDS_RESOLVE",e,i)}var PEt=["compilerOptions","files","include","exclude","watchOptions","compileOnSave","typeAcquisition","buildOptions"];function wEt(t,e){let n=t.tsconfig,i=e.tsconfig,o=ih(Dc.default.relative(Dc.default.dirname(t.tsconfigFile),Dc.default.dirname(e.tsconfigFile)));for(let r of Object.keys(i).filter(l=>PEt.includes(l)))if(r==="compilerOptions"){n.compilerOptions||(n.compilerOptions={});for(let l of Object.keys(i.compilerOptions))Object.prototype.hasOwnProperty.call(n.compilerOptions,l)||(n.compilerOptions[l]=ij(l,i.compilerOptions[l],o))}else if(n[r]===void 0)if(r==="watchOptions"){n.watchOptions={};for(let l of Object.keys(i.watchOptions))n.watchOptions[l]=ij(l,i.watchOptions[l],o)}else n[r]=ij(r,i[r],o)}var kEt=["files","include","exclude","baseUrl","rootDir","rootDirs","typeRoots","outDir","outFile","declarationDir","excludeDirectories","excludeFiles"];function ij(t,e,n){return kEt.includes(t)?Array.isArray(e)?e.map(i=>sge(i,n)):sge(e,n):e}function sge(t,e){return Dc.default.isAbsolute(t)||t.startsWith("${configDir}")?t:Dc.default.posix.normalize(Dc.default.posix.join(e,t))}var tE=class t extends Error{code;cause;tsconfigFile;constructor(e,n,i,o){super(e),Object.setPrototypeOf(this,t.prototype),this.name=t.name,this.code=n,this.cause=o,this.tsconfigFile=i}};function NEt(t,e){$Et(e)&&(t.compilerOptions={...REt,...t.compilerOptions})}var REt={allowJs:!0,maxNodeModuleJsDepth:2,allowSyntheticDefaultImports:!0,skipLibCheck:!0,noEmit:!0};function $Et(t){return Dc.default.basename(t)==="jsconfig.json"}var lb=class{clear(){this.#t.clear(),this.#e.clear()}hasConfigPath(e,n="tsconfig.json"){return this.#t.has(`${e}/${n}`)}getConfigPath(e,n="tsconfig.json"){let i=`${e}/${n}`,o=this.#t.get(i);if(o==null||o.length||o.then)return o;throw o}hasParseResult(e){return this.#e.has(e)}getParseResult(e){let n=this.#e.get(e);if(n.then||n.tsconfig)return n;throw n}setParseResult(e,n,i=!1){Object.defineProperty(n,"_isRootFile_",{value:i,writable:!1,enumerable:!1,configurable:!1}),this.#e.set(e,n),n.then(o=>{this.#e.get(e)===n&&this.#e.set(e,o)}).catch(o=>{this.#e.get(e)===n&&this.#e.set(e,o)})}setConfigPath(e,n,i="tsconfig.json"){let o=`${e}/${i}`;this.#t.set(o,n),n.then(r=>{this.#t.get(o)===n&&this.#t.set(o,r)}).catch(r=>{this.#t.get(o)===n&&this.#t.set(o,r)})}#t=new Map;#e=new Map};var LC=class extends Map{constructor(n){super();this.factory=n}get(n){let i=super.get(n);return i===void 0&&(i=this.factory(n,this),this.set(n,i)),i}};async function pge(t){let{configs:e,errors:n}=await cge(t),i=await uge(e);async function o(u,H){for(let a of lj(H))for(let{match:c}of i.get(a))try{return await c(u)}catch{return null}return null}async function r(u,H){for(let a of lj(H))for(let{match:c}of i.get(a))try{return await c(u,{mustExist:!1})}catch{return null}return null}async function l(u){for(let H of lj(u))for(let{paths:a}of i.get(H))if(Object.keys(a).length)return a;return{}}async function s(){let{configs:u,errors:H}=await cge(t);if(i=await uge(u),H.length)throw new AggregateError(H)}return{resolveId:o,substituteId:r,paths:l,refresh:s,errors:n}}async function cge(t){let e=await tj(t,{configNames:["tsconfig.json","jsconfig.json"],skip(r){return r==="node_modules"||r===".git"}}),n={root:t,cache:new lb},i=new Set,o=[];for(let r of e)try{let l=await sj(r,n);i.add(l)}catch(l){o.push(l)}for(let r of i)if(r.referenced){for(let l of r.referenced)i.add(l);i.delete(r),i.add(r),r.referenced=void 0}for(let r of o)console.error(r);return{configs:i,errors:o}}async function uge(t){let e=new LC(()=>[]),n=(i,o)=>o(void 0,!0);for(let i of t){let H=function(a,{mustExist:c=!0}={}){u??=Hge.createMatchPathAsync(s,r.paths??{},void 0,l!==void 0);let p=c===!1?a.endsWith("/"):!1;return p&&(a+="__placeholder__"),new Promise((d,h)=>{u(a,void 0,c===!1?n:void 0,void 0,(m,g)=>m?h(m):(p&&(g=g.replace(/__placeholder__$/,"")),d(g)))})},o=Sa(Ss(ah.dirname(i.tsconfigFile))),r=i.tsconfig.compilerOptions??{},l=FEt(i),s=ah.resolve(o,l||""),u;e.get(o).push({match:H,paths:r.paths??{}})}return e}function*lj(t){let e=Sa(Ss(t)),n;for(;e!==n;)yield e,n=e,e=ah.dirname(e);return null}function FEt(t){let e=t.tsconfig.compilerOptions?.baseUrl;if(e)return e;for(let n of t.extended??[])if((n.tsconfig.compilerOptions??{})?.paths)return ah.dirname(n.tsconfigFile);return ah.dirname(t.tsconfigFile)}async function cj(t){let e=null;typeof t.pnp=="object"?e=t.pnp:t.pnp&&(e=await H0e(t.root));let n=t.fileSystem?t.fileSystem:new rE.CachedInputFileSystem(jEt,4e3),i=null;if(typeof t.tsconfig=="object")i=t.tsconfig;else if(t.tsconfig)try{i=await pge(t.root)}catch(m){console.error("Failed to load tsconfig",m)}let o=rE.ResolverFactory.createResolver({fileSystem:n,extensions:[".mjs",".js",".node",".mts",".ts"],mainFields:["module"],conditionNames:["node","import"],pnpApi:e}),r=rE.ResolverFactory.createResolver({fileSystem:n,extensions:[".cjs",".js",".json",".node",".cts",".ts"],mainFields:["main"],conditionNames:["node","require"],pnpApi:e}),l=rE.ResolverFactory.createResolver({fileSystem:n,extensions:[".css"],mainFields:["style"],conditionNames:["style"],pnpApi:e,preferRelative:!0});async function s(m,g,y){if(dge.sep==="\\"){if(g.startsWith("\\\\")||g.startsWith("//"))return g;y.startsWith("//")&&(y=`\\\\${y.slice(2)}`)}if(i){let E=await i.resolveId(g,y);E&&(g=E)}g=Kw(g),y=Kw(y);let _=await new Promise((E,A)=>{m.resolve({},y,g,{},(S,T)=>{S?A(S):E(T)})});return _?(_=_.replace(/\0(.)/g,"$1"),_):!1}async function u(m,g){try{return await s(o,m,g)||m}catch{return await s(r,m,g)||m}}async function H(m,g){return await s(r,m,g)||m}async function a(m,g){return await s(l,m,g)||m}async function c(m,g){return await i?.substituteId(m,g)??m}async function p(m){return i?await i.paths(m):{}}async function d(){await i?.refresh()}async function h(){return!!e}return{resolveJsId:u,resolveCjsId:H,resolveCssId:a,substituteId:c,refresh:d,hasPnP:h,aliases:p,child(m){return cj({...t,...m,pnp:m.pnp??e,tsconfig:m.tsconfig??i,fileSystem:m.fileSystem??n})}}}var cbe=['"',"'","`"," ",".","(","[","]","!","/","-"];async function ube(t){let e=await zp(t);if(!e)return null;let n=e.match(/@config\s*(?<config>'[^']+'|"[^"]+")/);return n?Sa((0,aE.default)(Pc.resolve(Pc.dirname(t),n.groups.config.slice(1,-1)))):null}var OC=class{constructor(e){this.connection=e;this.lspHandlersAdded=!1;this.disposables=[];this.watchPatterns=()=>{};this.watched=[];this.documentService=new FA(this.connection),this.projects=new Map,this.projectCounter=0,this.settingsCache=T1e(e)}async init(){this.initPromise||(this.initPromise=this._init()),await this.initPromise}getWorkspaceFolders(){return this.initializeParams.workspaceFolders?.length?this.initializeParams.workspaceFolders.map(e=>({uri:np.URI.parse(e.uri).fsPath,name:e.name})):this.initializeParams.rootUri?[{uri:np.URI.parse(this.initializeParams.rootUri).fsPath,name:"Root"}]:this.initializeParams.rootPath?[{uri:np.URI.file(this.initializeParams.rootPath).fsPath,name:"Root"}]:[]}async _init(){ry();let e=this.getWorkspaceFolders().map(i=>(0,aE.default)(i.uri));if(e.length===0){console.error("No workspace folders found, not initializing.");return}let n=await Promise.allSettled(e.map(i=>this._initFolder(np.URI.file(i))));for(let[i,o]of n.entries())o.status==="rejected"&&console.error("Failed to initialize workspace folder",e[i],o.reason);await this.listenForEvents()}async _initFolder(e){let n=e.fsPath;try{await Eb.access(n,Eb.constants.F_OK|Eb.constants.R_OK)}catch(S){console.error(`Unable to access the workspace folder [${n}]. This may happen if the directory does not exist or the current user does not have the necessary permissions to access it.`),console.error(S);return}let i=this.initializeParams.initializationOptions?.userLanguages??{};Object.keys(i).length>0&&console.warn("Language mappings are currently set via initialization options (`userLanguages`). This is deprecated and will be removed in a future release. Please use the `tailwindCSS.includeLanguages` setting instead.");let o=[],r=await this.settingsCache.get(),l=r.tailwindCSS.files.exclude,s=await this.settingsCache.get(e.toString()),u={...i,...s.tailwindCSS.includeLanguages??{}},H=new Map,a=new Map,c=this.initializeParams.initializationOptions?.workspaceFile?Pc.dirname(this.initializeParams.initializationOptions.workspaceFile):n;function p(S){function T(C){return Sa((0,aE.default)(Pc.resolve(c,C)))}let I=S.experimental.configFile,L={};if(typeof I=="string"){let C=T(I),x=[T(Pc.resolve(n,"**"))];L[C]=x}else if(xu(I))for(let[C,x]of Object.entries(I)){if(typeof C!="string")return null;C=T(C);let D;if(typeof x=="string")D=[T(x)];else if(Array.isArray(x))D=x.map(T);else return null;L[C]=D}else if(I)return null;return Object.entries(L)}let d=p(r.tailwindCSS);if(d===null){console.error("Invalid `experimental.configFile` configuration, not initializing.");return}let h=await cj({root:n,pnp:!0,tsconfig:!0}),m=new HC(n,r,h);d.length>0?(console.log("Loading Tailwind CSS projects from the workspace settings."),o=await m.loadAllFromWorkspace(d)):(console.log("Searching for Tailwind CSS projects in the workspace's folders."),o=await m.search());for(let S of o)if(a.set(S.config.path,S.tailwind.version),S.config.source==="css")for(let T of S.config.entries)T.type==="css"&&H.set(T.path,S.config.path);let g=o.map(S=>({folder:S.folder,config:S.config.path,selectors:S.documentSelector,user:S.isUserConfigured,tailwind:S.tailwind}));console.log(`[Global] Creating projects: ${JSON.stringify(g)}`);let y=async S=>{let T=!1,I=!1,L=(0,sH.default)(`**/${Vh}`,{dot:!0}),C=(0,sH.default)(`**/${yp}`,{dot:!0}),x=(0,sH.default)(`**/${Wh}`,{dot:!0}),D=(0,sH.default)(`**/${RA}`,{dot:!0});e:for(let O of S){let j=(0,aE.default)(O.file);j=Sa(j);for(let P of l)if((0,sH.default)(P,{dot:!0})(j))continue e;if(L(j))for(let[,P]of this.projects){let W=_g().version;try{let z=require(await h.resolveCjsId("tailwindcss/package.json",Pc.dirname(P.projectConfig.configPath))).version;typeof z=="string"&&(W=z)}catch{}if(a.get(P.projectConfig.configPath)!==W){T=!0;break e}}if(D(j)){T=!0;break e}for(let[,P]of this.projects)if(P.state.v4&&!(O.type===ki.FileChangeType.Deleted&&Qd(j,[P.projectConfig.configPath]))&&Qd(j,P.dependencies())){I=!0;break e}if(C(`**/${yp}`)&&O.type!==ki.FileChangeType.Deleted){let P=await ube(j)||await ube(O.file);if(H.has(j)&&H.get(j)!==P){T=!0;break}else if(!H.has(j)&&P){T=!0;break}else{if(this.projects.size>0)continue;let W=await zp(O.file);if(!W)continue;let z=uC(W);if(!z.root||!z.versions.includes("4"))continue;T=!0;break}}if(x(j)&&O.type===ki.FileChangeType.Created){T=!0;break}for(let[,P]of this.projects)if(O.type===ki.FileChangeType.Deleted&&Qd(j,[P.projectConfig.configPath])){T=!0;break e}}if(T){this.restart();return}if(I){try{await this.softRestart()}catch{this.restart()}return}for(let[,O]of this.projects)O.onFileEvents(S)};if(this.initializeParams.capabilities.workspace?.didChangeWatchedFiles?.dynamicRegistration){this.disposables.push(this.connection.onDidChangeWatchedFiles(async({changes:T})=>{let I=T.map(({uri:L,type:C})=>({file:np.URI.parse(L).fsPath,type:C})).filter((L,C,x)=>x.findIndex(D=>D.file===L.file&&D.type===L.type)===C);await y(I)}));let S=await this.connection.client.register(ki.DidChangeWatchedFilesNotification.type,{watchers:[{globPattern:`**/${Wh}`},{globPattern:`**/${Vh}`},{globPattern:`**/${yp}`},{globPattern:`**/${RA}`}]});this.disposables.push(S),this.watchPatterns=T=>{let I=this.filterNewWatchPatterns(T);I.length&&(console.log(`[Global] Adding watch patterns: ${I.join(", ")}`),this.connection.client.register(ki.DidChangeWatchedFilesNotification.type,{watchers:I.map(L=>({globPattern:L}))}).then(L=>{this.disposables.push(L)}))}}else if(FC.getBinding()){console.log("[Global] Your LSP client does not support watching files on behalf of the server"),console.log("[Global] Using bundled file watcher: @parcel/watcher");let S={create:ki.FileChangeType.Created,update:ki.FileChangeType.Changed,delete:ki.FileChangeType.Deleted},T=await FC.subscribe(n,(I,L)=>{y(L.map(C=>({file:C.path,type:S[C.type]})))},{ignore:l.map(I=>Pc.resolve(n,I.replace(/^[*/]+/,"").replace(/[*/]+$/,"")))});this.disposables.push({dispose(){T.unsubscribe()}})}else{console.log("[Global] Your LSP client does not support watching files on behalf of the server"),console.log("[Global] Using bundled file watcher: chokidar");let S=lbe().watch,T=S([`**/${Wh}`,`**/${Vh}`,`**/${yp}`,`**/${RA}`],{cwd:n,ignorePermissionErrors:!0,ignoreInitial:!0,ignored:l,awaitWriteFinish:{stabilityThreshold:100,pollInterval:20}});await new Promise(I=>{T.on("ready",()=>I())}),T.on("add",I=>y([{file:Pc.resolve(n,I),type:ki.FileChangeType.Created}])).on("change",I=>y([{file:Pc.resolve(n,I),type:ki.FileChangeType.Changed}])).on("unlink",I=>y([{file:Pc.resolve(n,I),type:ki.FileChangeType.Deleted}])),this.disposables.push({dispose(){T.close()}}),this.watchPatterns=I=>{let L=this.filterNewWatchPatterns(I);L.length&&(console.log(`[Global] Adding watch patterns: ${L.join(", ")}`),T.add(L))}}console.log("[Global] Preparing projects..."),await Promise.all(o.map(S=>this.addProject(S,this.initializeParams,this.watchPatterns,a.get(S.configPath),u,h,e))),console.log("[Global] Initializing projects...");let _=[],E=0;for(let S of this.documentService.getAllDocuments()){let T=this.getProject(S);T&&!T.enabled()&&(T.enable(),await T.tryInit(),E++),_.push(S.uri)}console.log(`[Global] Initialized ${E} projects`),this.setupLSPHandlers(),this.disposables.push(this.connection.onDidChangeConfiguration(async({settings:S})=>{let T=r.tailwindCSS.files.exclude;if(this.settingsCache.clear(),r=await this.settingsCache.get(),!Zl(T,r.tailwindCSS.files.exclude)){this.restart();return}for(let[,I]of this.projects)I.onUpdateSettings(S)})),(this.initializeParams.initializationOptions?.testMode??!1)&&(console.log("[Global][Test] Sending document notifications..."),await Promise.all(_.map(S=>this.connection.sendNotification("@/tailwindCSS/documentReady",{uri:S}))))}async listenForEvents(){let e=this.initializeParams.initializationOptions?.testMode??!1;this.disposables.push(this.connection.onShutdown(()=>{this.dispose()})),this.disposables.push(this.documentService.onDidChangeContent(n=>{this.getProject(n.document)?.provideDiagnostics(n.document)})),this.disposables.push(this.documentService.onDidOpen(async n=>{let i=this.getProject(n.document);i&&(i.enabled()||(i.enable(),await i.tryInit()),e&&await this.connection.sendNotification("@/tailwindCSS/documentReady",{uri:n.document.uri}))})),this.initializeParams.capabilities.workspace.workspaceFolders&&this.disposables.push(this.connection.workspace.onDidChangeWorkspaceFolders(async n=>{let i=n.added.map(o=>({uri:np.URI.parse(o.uri).fsPath,name:o.name})).map(o=>(0,aE.default)(o.uri));await Promise.allSettled(i.map(o=>this._initFolder(np.URI.file(o))))})),e&&await this.connection.sendNotification("@/tailwindCSS/serverReady")}filterNewWatchPatterns(e){return e=Array.from(new Set(e)),e=e.filter(n=>!this.watched.includes(n)),this.watched.push(...e),e}async addProject(e,n,i,o,r,l,s){let u=String(this.projectCounter++),H=await y1e(u,e,this.connection,n,this.documentService,()=>this.updateCapabilities(),()=>{for(let a of this.documentService.getAllDocuments()){let c=this.getProject(a);if(c&&!c.enabled()){c.enable(),c.tryInit();break}}},()=>this.refreshDiagnostics(),a=>i(a),o,this.settingsCache.get,r,l);this.projects.set(u,H),this.supportsTailwindProjectDetails&&this.connection.sendNotification("@/tailwindCSS/projectDetails",{uri:s.toString(),config:e.configPath,tailwind:e.tailwind})}get supportsTailwindProjectDetails(){return this.initializeParams.capabilities.experimental?.tailwind?.projectDetails??!1}refreshDiagnostics(){for(let e of this.documentService.getAllDocuments()){let n=this.getProject(e);n?n.provideDiagnosticsForce(e):this.connection.sendDiagnostics({uri:e.uri,diagnostics:[]})}}setupLSPHandlers(){this.lspHandlersAdded||(this.lspHandlersAdded=!0,this.connection.onHover(this.onHover.bind(this)),this.connection.onCompletion(this.onCompletion.bind(this)),this.connection.onCompletionResolve(this.onCompletionResolve.bind(this)),this.connection.onDocumentColor(this.onDocumentColor.bind(this)),this.connection.onColorPresentation(this.onColorPresentation.bind(this)),this.connection.onCodeAction(this.onCodeAction.bind(this)),this.connection.onCodeLens(this.onCodeLens.bind(this)),this.connection.onDocumentLinks(this.onDocumentLinks.bind(this)),this.connection.onRequest(this.onRequest.bind(this)))}onRequest(e,n){if(e==="@/tailwindCSS/sortSelection"){let i=this.getProject({uri:n.uri});if(!i)return{error:"no-project"};try{return{classLists:i.sortClassLists(n.classLists)}}catch{return{error:"unknown"}}}if(e==="@/tailwindCSS/getProject"){let i=this.getProject({uri:n.uri});return!i||!i.enabled()||!i.state?.enabled?null:{version:i.state.version}}}updateCapabilities(){if(!Hbe(this.initializeParams)){this.connection.client.register(ki.DidChangeConfigurationNotification.type,void 0);return}this.registrations&&this.registrations.then(i=>i.dispose());let e=Array.from(this.projects.values()),n=ki.BulkRegistration.create();n.add(ki.HoverRequest.type,{documentSelector:null}),n.add(ki.DocumentColorRequest.type,{documentSelector:null}),n.add(ki.CodeActionRequest.type,{documentSelector:null}),n.add(ki.CodeLensRequest.type,{documentSelector:null}),n.add(ki.DocumentLinkRequest.type,{documentSelector:null}),n.add(ki.DidChangeConfigurationNotification.type,void 0),n.add(ki.CompletionRequest.type,{documentSelector:null,resolveProvider:!0,triggerCharacters:[...cbe,...e.map(i=>i.state.separator).filter(i=>typeof i=="string").map(i=>i.slice(-1))].filter(Boolean)}),this.registrations=this.connection.client.register(n)}getProject(e){let n,i,o=1/0,r=np.URI.parse(e.uri),l=r.fsPath,s=r.path;l=Sa(l);for(let H of this.projects.values()){if(!H.projectConfig.configPath){n=n??H;continue}let a=H.documentSelector().concat().sort((c,p)=>c.pattern.startsWith("!")&&!p.pattern.startsWith("!")?-1:!c.pattern.startsWith("!")&&p.pattern.startsWith("!")?1:0);for(let c of a){let p=c.pattern.replace(/[\[\]{}()]/g,d=>`\\${d}`);if(p.startsWith("!")&&((0,sH.default)(p.slice(1),{dot:!0})(l)||(0,sH.default)(p.slice(1),{dot:!0})(s)))break;if((0,sH.default)(p,{dot:!0})(l)&&c.priority<o){i=H,o=c.priority;continue}if((0,sH.default)(p,{dot:!0})(s)&&c.priority<o){i=H,o=c.priority;continue}}}let u=i??n;return u||console.debug("[GLOBAL] No matching project for document",{fsPath:l,normalPath:s}),u}async onDocumentColor(e){return await this.init(),this.getProject(e.textDocument)?.onDocumentColor(e)??[]}async onColorPresentation(e){return await this.init(),this.getProject(e.textDocument)?.onColorPresentation(e)??[]}async onHover(e){return await this.init(),this.getProject(e.textDocument)?.onHover(e)??null}async onCompletion(e){return await this.init(),this.getProject(e.textDocument)?.onCompletion(e)??null}async onCompletionResolve(e){return await this.init(),this.projects.get(e.data?._projectKey)?.onCompletionResolve(e)??null}async onCodeAction(e){return await this.init(),this.getProject(e.textDocument)?.onCodeAction(e)??null}async onCodeLens(e){return await this.init(),this.getProject(e.textDocument)?.onCodeLens(e)??null}async onDocumentLinks(e){return await this.init(),this.getProject(e.textDocument)?.onDocumentLinks(e)??null}setup(){this.connection.onInitialize(async e=>(this.initializeParams=e,Hbe(e)?{capabilities:{textDocumentSync:ki.TextDocumentSyncKind.Full,workspace:{workspaceFolders:{changeNotifications:!0}}}}:(this.setupLSPHandlers(),{capabilities:{textDocumentSync:ki.TextDocumentSyncKind.Full,hoverProvider:!0,colorProvider:!0,codeActionProvider:!0,codeLensProvider:{resolveProvider:!1},documentLinkProvider:{},completionProvider:{resolveProvider:!0,triggerCharacters:[...cbe,":"]},workspace:{workspaceFolders:{changeNotifications:!0}}}}))),this.connection.onInitialized(()=>this.init())}listen(){this.connection.listen()}dispose(){this.connection.sendNotification("@/tailwindCSS/projectsDestroyed");for(let[,e]of this.projects)e.dispose();this.projects=new Map,this.refreshDiagnostics(),this.registrations&&(this.registrations.then(e=>e.dispose()),this.registrations=void 0),this.disposables.forEach(e=>e.dispose()),this.disposables.length=0,this.watched.length=0}async restart(){let e=this.initializeParams.initializationOptions?.testMode??!1;console.log(`----------
3584
3584
  RESTARTING
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailwindcss/language-server",
3
- "version": "0.14.14",
3
+ "version": "0.14.15",
4
4
  "description": "Tailwind CSS Language Server",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -93,7 +93,7 @@
93
93
  "vscode-languageserver-protocol": "^3.17.5",
94
94
  "vscode-languageserver-textdocument": "1.0.12",
95
95
  "vscode-uri": "3.0.2",
96
- "@tailwindcss/language-service": "0.14.14"
96
+ "@tailwindcss/language-service": "0.14.15"
97
97
  },
98
98
  "engines": {
99
99
  "node": ">=18.0.0"