@bgforge/mls-server 3.4.0 → 3.5.0

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.
Files changed (2) hide show
  1. package/out/server.js +3 -3
  2. package/package.json +1 -1
package/out/server.js CHANGED
@@ -447,7 +447,7 @@ Project '${y.projectName}' (${NB[y.projectKind]}) ${p}
447
447
  `,p++};this.projectService.externalProjects.forEach(m),this.projectService.configuredProjects.forEach(m),this.projectService.inferredProjects.forEach(m)}}this.logger.msg(c,"Err")}send(t){if(t.type==="event"&&!this.canUseEvents){this.logger.hasLevel(3)&&this.logger.info(`Session does not support events: ignored event: ${OT(t)}`);return}this.writeMessage(t)}writeMessage(t){let o=VRe(t,this.logger,this.byteLength,this.host.newLine);this.host.write(o)}event(t,o){this.send(jRe(o,t))}doOutput(t,o,l,c,p,m){let y={seq:0,type:"response",command:o,request_seq:l,success:c,performanceData:p&&Jnt(p)};if(c){let h;if(la(t))y.body=t,h=t.metadata,delete t.metadata;else if(typeof t=="object")if(t.metadata){let{metadata:E,...T}=t;y.body=T,h=E}else y.body=t;else y.body=t;h&&(y.metadata=h)}else F.assert(t===void 0);m&&(y.message=m),this.send(y)}semanticCheck(t,o){var l,c;let p=Cl();(l=Kr)==null||l.push(Kr.Phase.Session,"semanticCheck",{file:t,configFilePath:o.canonicalConfigFilePath});let m=Gnt(o,t)?Yu:o.getLanguageService().getSemanticDiagnostics(t).filter(y=>!!y.file);this.sendDiagnosticsEvent(t,o,m,"semanticDiag",p),(c=Kr)==null||c.pop()}syntacticCheck(t,o){var l,c;let p=Cl();(l=Kr)==null||l.push(Kr.Phase.Session,"syntacticCheck",{file:t,configFilePath:o.canonicalConfigFilePath}),this.sendDiagnosticsEvent(t,o,o.getLanguageService().getSyntacticDiagnostics(t),"syntaxDiag",p),(c=Kr)==null||c.pop()}suggestionCheck(t,o){var l,c;let p=Cl();(l=Kr)==null||l.push(Kr.Phase.Session,"suggestionCheck",{file:t,configFilePath:o.canonicalConfigFilePath}),this.sendDiagnosticsEvent(t,o,o.getLanguageService().getSuggestionDiagnostics(t),"suggestionDiag",p),(c=Kr)==null||c.pop()}regionSemanticCheck(t,o,l){var c,p,m;let y=Cl();(c=Kr)==null||c.push(Kr.Phase.Session,"regionSemanticCheck",{file:t,configFilePath:o.canonicalConfigFilePath});let h;if(!this.shouldDoRegionCheck(t)||!(h=o.getLanguageService().getRegionSemanticDiagnostics(t,l))){(p=Kr)==null||p.pop();return}this.sendDiagnosticsEvent(t,o,h.diagnostics,"regionSemanticDiag",y,h.spans),(m=Kr)==null||m.pop()}shouldDoRegionCheck(t){var o;let l=(o=this.projectService.getScriptInfoForNormalizedPath(t))==null?void 0:o.textStorage.getLineInfo().getLineCount();return!!(l&&l>=this.regionDiagLineCountThreshold)}sendDiagnosticsEvent(t,o,l,c,p,m){try{let y=F.checkDefined(o.getScriptInfo(t)),h=Cl()-p,E={file:t,diagnostics:l.map(T=>znt(t,o,T)),spans:m?.map(T=>Gy(T,y))};this.event(E,c),this.addDiagnosticsPerformanceData(t,c,h)}catch(y){this.logError(y,c)}}updateErrorCheck(t,o,l,c=!0){if(o.length===0)return;F.assert(!this.suppressDiagnosticEvents);let p=this.changeSeq,m=Math.min(l,200),y=0,h=()=>{if(y++,o.length>y)return t.delay("checkOne",m,T)},E=(N,R)=>{if(this.semanticCheck(N,R),this.changeSeq===p){if(this.getPreferences(N).disableSuggestions)return h();t.immediate("suggestionCheck",()=>{this.suggestionCheck(N,R),h()})}},T=()=>{if(this.changeSeq!==p)return;let N,R=o[y];if(ca(R)?R=this.toPendingErrorCheck(R):"ranges"in R&&(N=R.ranges,R=this.toPendingErrorCheck(R.file)),!R)return h();let{fileName:L,project:O}=R;if(X_(O),!!O.containsFile(L,c)&&(this.syntacticCheck(L,O),this.changeSeq===p)){if(O.projectService.serverMode!==0)return h();if(N)return t.immediate("regionSemanticCheck",()=>{let W=this.projectService.getScriptInfoForNormalizedPath(L);W&&this.regionSemanticCheck(L,O,N.map(G=>this.getRange({file:L,...G},W))),this.changeSeq===p&&t.immediate("semanticCheck",()=>E(L,O))});t.immediate("semanticCheck",()=>E(L,O))}};o.length>y&&this.changeSeq===p&&t.delay("checkOne",l,T)}cleanProjects(t,o){if(o){this.logger.info(`cleaning ${t}`);for(let l of o)l.getLanguageService(!1).cleanupSemanticCache(),l.cleanupProgram()}}cleanup(){this.cleanProjects("inferred projects",this.projectService.inferredProjects),this.cleanProjects("configured projects",$o(this.projectService.configuredProjects.values())),this.cleanProjects("external projects",this.projectService.externalProjects),this.host.gc&&(this.logger.info("host.gc()"),this.host.gc())}getEncodedSyntacticClassifications(t){let{file:o,languageService:l}=this.getFileAndLanguageServiceForSyntacticOperation(t);return l.getEncodedSyntacticClassifications(o,t)}getEncodedSemanticClassifications(t){let{file:o,project:l}=this.getFileAndProject(t),c=t.format==="2020"?"2020":"original";return l.getLanguageService().getEncodedSemanticClassifications(o,t,c)}getProject(t){return t===void 0?void 0:this.projectService.findProject(t)}getConfigFileAndProject(t){let o=this.getProject(t.projectFileName),l=cc(t.file);return{configFile:o&&o.hasConfigFile(l)?l:void 0,project:o}}getConfigFileDiagnostics(t,o,l){let c=o.getAllProjectErrors(),p=o.getLanguageService().getCompilerOptionsDiagnostics(),m=pn(Ai(c,p),y=>!!y.file&&y.file.fileName===t);return l?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(m):gn(m,y=>PB(y,!1))}convertToDiagnosticsWithLinePositionFromDiagnosticFile(t){return t.map(o=>({message:Oy(o.messageText,this.host.newLine),start:o.start,length:o.length,category:X1(o),code:o.code,source:o.source,startLocation:o.file&&ik(is(o.file,o.start)),endLocation:o.file&&ik(is(o.file,o.start+o.length)),reportsUnnecessary:o.reportsUnnecessary,reportsDeprecated:o.reportsDeprecated,relatedInformation:gn(o.relatedInformation,$oe)}))}getCompilerOptionsDiagnostics(t){let o=this.getProject(t.projectFileName);return this.convertToDiagnosticsWithLinePosition(pn(o.getLanguageService().getCompilerOptionsDiagnostics(),l=>!l.file),void 0)}convertToDiagnosticsWithLinePosition(t,o){return t.map(l=>({message:Oy(l.messageText,this.host.newLine),start:l.start,length:l.length,category:X1(l),code:l.code,source:l.source,startLocation:o&&o.positionToLineOffset(l.start),endLocation:o&&o.positionToLineOffset(l.start+l.length),reportsUnnecessary:l.reportsUnnecessary,reportsDeprecated:l.reportsDeprecated,relatedInformation:gn(l.relatedInformation,$oe)}))}getDiagnosticsWorker(t,o,l,c){let{project:p,file:m}=this.getFileAndProject(t);if(o&&Gnt(p,m))return Yu;let y=p.getScriptInfoForNormalizedPath(m),h=l(p,m);return c?this.convertToDiagnosticsWithLinePosition(h,y):h.map(E=>znt(m,p,E))}getDefinition(t,o){let{file:l,project:c}=this.getFileAndProject(t),p=this.getPositionInFile(t,l),m=this.mapDefinitionInfoLocations(c.getLanguageService().getDefinitionAtPosition(l,p)||Yu,c);return o?this.mapDefinitionInfo(m,c):m.map(Hce.mapToOriginalLocation)}mapDefinitionInfoLocations(t,o){return t.map(l=>{let c=Knt(l,o);return c?{...c,containerKind:l.containerKind,containerName:l.containerName,kind:l.kind,name:l.name,failedAliasResolution:l.failedAliasResolution,...l.unverified&&{unverified:l.unverified}}:l})}getDefinitionAndBoundSpan(t,o){let{file:l,project:c}=this.getFileAndProject(t),p=this.getPositionInFile(t,l),m=F.checkDefined(c.getScriptInfo(l)),y=c.getLanguageService().getDefinitionAndBoundSpan(l,p);if(!y||!y.definitions)return{definitions:Yu,textSpan:void 0};let h=this.mapDefinitionInfoLocations(y.definitions,c),{textSpan:E}=y;return o?{definitions:this.mapDefinitionInfo(h,c),textSpan:Gy(E,m)}:{definitions:h.map(Hce.mapToOriginalLocation),textSpan:E}}findSourceDefinition(t){var o;let{file:l,project:c}=this.getFileAndProject(t),p=this.getPositionInFile(t,l),m=c.getLanguageService().getDefinitionAtPosition(l,p),y=this.mapDefinitionInfoLocations(m||Yu,c).slice();if(this.projectService.serverMode===0&&(!ht(y,L=>cc(L.fileName)!==l&&!L.isAmbient)||ht(y,L=>!!L.failedAliasResolution))){let L=cX(H=>H.textSpan.start,dre(this.host.useCaseSensitiveFileNames));y?.forEach(H=>L.add(H));let O=c.getNoDtsResolutionProject(l),W=O.getLanguageService(),G=(o=W.getDefinitionAtPosition(l,p,!0,!1))==null?void 0:o.filter(H=>cc(H.fileName)!==l);if(ht(G))for(let H of G){if(H.unverified){let $=N(H,c.getLanguageService().getProgram(),W.getProgram());if(ht($)){for(let J of $)L.add(J);continue}}L.add(H)}else{let H=y.filter($=>cc($.fileName)!==l&&$.isAmbient);for(let $ of ht(H)?H:T()){let J=E($.fileName,l,O);if(!J)continue;let ee=this.projectService.getOrCreateScriptInfoNotOpenedByClient(J,O.currentDirectory,O.directoryStructureHost,!1);if(!ee)continue;O.containsScriptInfo(ee)||(O.addRoot(ee),O.updateGraph());let ne=W.getProgram(),pe=F.checkDefined(ne.getSourceFile(J));for(let se of R($.name,pe,ne))L.add(se)}}y=$o(L.values())}return y=y.filter(L=>!L.isAmbient&&!L.failedAliasResolution),this.mapDefinitionInfo(y,c);function E(L,O,W){var G,H,$;let J=tV(L);if(J&&L.lastIndexOf(mb)===J.topLevelNodeModulesIndex){let ee=L.substring(0,J.packageRootIndex),ne=(G=c.getModuleResolutionCache())==null?void 0:G.getPackageJsonInfoCache(),pe=c.getCompilationSettings(),se=q2(Qo(ee,c.getCurrentDirectory()),H2(ne,c,pe));if(!se)return;let ae=Ree(se,{moduleResolution:2},c,c.getModuleResolutionCache()),xe=L.substring(J.topLevelPackageNameIndex+1,J.packageRootIndex),_e=J2(Y4(xe)),ue=c.toPath(L);if(ae&&ht(ae,Ie=>c.toPath(Ie)===ue))return(H=W.resolutionCache.resolveSingleModuleNameWithoutWatching(_e,O).resolvedModule)==null?void 0:H.resolvedFileName;{let Ie=L.substring(J.packageRootIndex+1),ye=`${_e}/${Qp(Ie)}`;return($=W.resolutionCache.resolveSingleModuleNameWithoutWatching(ye,O).resolvedModule)==null?void 0:$.resolvedFileName}}}function T(){let L=c.getLanguageService(),O=L.getProgram(),W=Nf(O.getSourceFile(l),p);return(cl(W)||Qe(W))&&Gl(W.parent)&&oEe(W,G=>{var H;if(G===W)return;let $=(H=L.getDefinitionAtPosition(l,G.getStart(),!0,!1))==null?void 0:H.filter(J=>cc(J.fileName)!==l&&J.isAmbient).map(J=>({fileName:J.fileName,name:Ng(W)}));if(ht($))return $})||Yu}function N(L,O,W){var G;let H=W.getSourceFile(L.fileName);if(!H)return;let $=Nf(O.getSourceFile(l),p),J=O.getTypeChecker().getSymbolAtLocation($),ee=J&&sc(J,276);if(!ee)return;let ne=((G=ee.propertyName)==null?void 0:G.text)||ee.name.text;return R(ne,H,W)}function R(L,O,W){let G=Vl.Core.getTopMostDeclarationNamesInFile(L,O);return pi(G,H=>{let $=W.getTypeChecker().getSymbolAtLocation(H),J=VO(H);if($&&J)return QM.createDefinitionInfo(J,W.getTypeChecker(),$,J,!0)})}}getEmitOutput(t){let{file:o,project:l}=this.getFileAndProject(t);if(!l.shouldEmitFile(l.getScriptInfo(o)))return{emitSkipped:!0,outputFiles:[],diagnostics:[]};let c=l.getLanguageService().getEmitOutput(o);return t.richResponse?{...c,diagnostics:t.includeLinePosition?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(c.diagnostics):c.diagnostics.map(p=>PB(p,!0))}:c}mapJSDocTagInfo(t,o,l){return t?t.map(c=>{var p;return{...c,text:l?this.mapDisplayParts(c.text,o):(p=c.text)==null?void 0:p.map(m=>m.text).join("")}}):[]}mapDisplayParts(t,o){return t?t.map(l=>l.kind!=="linkName"?l:{...l,target:this.toFileSpan(l.target.fileName,l.target.textSpan,o)}):[]}mapSignatureHelpItems(t,o,l){return t.map(c=>({...c,documentation:this.mapDisplayParts(c.documentation,o),parameters:c.parameters.map(p=>({...p,documentation:this.mapDisplayParts(p.documentation,o)})),tags:this.mapJSDocTagInfo(c.tags,o,l)}))}mapDefinitionInfo(t,o){return t.map(l=>({...this.toFileSpanWithContext(l.fileName,l.textSpan,l.contextSpan,o),...l.unverified&&{unverified:l.unverified}}))}static mapToOriginalLocation(t){return t.originalFileName?(F.assert(t.originalTextSpan!==void 0,"originalTextSpan should be present if originalFileName is"),{...t,fileName:t.originalFileName,textSpan:t.originalTextSpan,targetFileName:t.fileName,targetTextSpan:t.textSpan,contextSpan:t.originalContextSpan,targetContextSpan:t.contextSpan}):t}toFileSpan(t,o,l){let c=l.getLanguageService(),p=c.toLineColumnOffset(t,o.start),m=c.toLineColumnOffset(t,Tc(o));return{file:t,start:{line:p.line+1,offset:p.character+1},end:{line:m.line+1,offset:m.character+1}}}toFileSpanWithContext(t,o,l,c){let p=this.toFileSpan(t,o,c),m=l&&this.toFileSpan(t,l,c);return m?{...p,contextStart:m.start,contextEnd:m.end}:p}getTypeDefinition(t){let{file:o,project:l}=this.getFileAndProject(t),c=this.getPositionInFile(t,o),p=this.mapDefinitionInfoLocations(l.getLanguageService().getTypeDefinitionAtPosition(o,c)||Yu,l);return this.mapDefinitionInfo(p,l)}mapImplementationLocations(t,o){return t.map(l=>{let c=Knt(l,o);return c?{...c,kind:l.kind,displayParts:l.displayParts}:l})}getImplementation(t,o){let{file:l,project:c}=this.getFileAndProject(t),p=this.getPositionInFile(t,l),m=this.mapImplementationLocations(c.getLanguageService().getImplementationAtPosition(l,p)||Yu,c);return o?m.map(({fileName:y,textSpan:h,contextSpan:E})=>this.toFileSpanWithContext(y,h,E,c)):m.map(Hce.mapToOriginalLocation)}getSyntacticDiagnosticsSync(t){let{configFile:o}=this.getConfigFileAndProject(t);return o?Yu:this.getDiagnosticsWorker(t,!1,(l,c)=>l.getLanguageService().getSyntacticDiagnostics(c),!!t.includeLinePosition)}getSemanticDiagnosticsSync(t){let{configFile:o,project:l}=this.getConfigFileAndProject(t);return o?this.getConfigFileDiagnostics(o,l,!!t.includeLinePosition):this.getDiagnosticsWorker(t,!0,(c,p)=>c.getLanguageService().getSemanticDiagnostics(p).filter(m=>!!m.file),!!t.includeLinePosition)}getSuggestionDiagnosticsSync(t){let{configFile:o}=this.getConfigFileAndProject(t);return o?Yu:this.getDiagnosticsWorker(t,!0,(l,c)=>l.getLanguageService().getSuggestionDiagnostics(c),!!t.includeLinePosition)}getJsxClosingTag(t){let{file:o,languageService:l}=this.getFileAndLanguageServiceForSyntacticOperation(t),c=this.getPositionInFile(t,o),p=l.getJsxClosingTagAtPosition(o,c);return p===void 0?void 0:{newText:p.newText,caretOffset:0}}getLinkedEditingRange(t){let{file:o,languageService:l}=this.getFileAndLanguageServiceForSyntacticOperation(t),c=this.getPositionInFile(t,o),p=l.getLinkedEditingRangeAtPosition(o,c),m=this.projectService.getScriptInfoForNormalizedPath(o);if(!(m===void 0||p===void 0))return SVt(p,m)}getDocumentHighlights(t,o){let{file:l,project:c}=this.getFileAndProject(t),p=this.getPositionInFile(t,l),m=c.getLanguageService().getDocumentHighlights(l,p,t.filesToSearch);return m?o?m.map(({fileName:y,highlightSpans:h})=>{let E=c.getScriptInfo(y);return{file:y,highlightSpans:h.map(({textSpan:T,kind:N,contextSpan:R})=>({...HRe(T,R,E),kind:N}))}}):m:Yu}provideInlayHints(t){let{file:o,project:l}=this.getFileAndProject(t),c=this.projectService.getScriptInfoForNormalizedPath(o);return l.getLanguageService().provideInlayHints(o,t,this.getPreferences(o)).map(m=>{let{position:y,displayParts:h}=m;return{...m,position:c.positionToLineOffset(y),displayParts:h?.map(({text:E,span:T,file:N})=>{if(T){F.assertIsDefined(N,"Target file should be defined together with its span.");let R=this.projectService.getScriptInfo(N);return{text:E,span:{start:R.positionToLineOffset(T.start),end:R.positionToLineOffset(T.start+T.length),file:N}}}else return{text:E}})}})}mapCode(t){var o;let l=this.getHostFormatOptions(),c=this.getHostPreferences(),{file:p,languageService:m}=this.getFileAndLanguageServiceForSyntacticOperation(t),y=this.projectService.getScriptInfoForNormalizedPath(p),h=(o=t.mapping.focusLocations)==null?void 0:o.map(T=>T.map(N=>{let R=y.lineOffsetToPosition(N.start.line,N.start.offset),L=y.lineOffsetToPosition(N.end.line,N.end.offset);return{start:R,length:L-R}})),E=m.mapCode(p,t.mapping.contents,h,l,c);return this.mapTextChangesToCodeEdits(E)}setCompilerOptionsForInferredProjects(t){this.projectService.setCompilerOptionsForInferredProjects(t.options,t.projectRootPath)}getProjectInfo(t){return this.getProjectInfoWorker(t.file,t.projectFileName,t.needFileNameList,!1)}getProjectInfoWorker(t,o,l,c){let{project:p}=this.getFileAndProjectWorker(t,o);return X_(p),{configFileName:p.getProjectName(),languageServiceDisabled:!p.languageServiceEnabled,fileNames:l?p.getFileNames(!1,c):void 0}}getRenameInfo(t){let{file:o,project:l}=this.getFileAndProject(t),c=this.getPositionInFile(t,o),p=this.getPreferences(o);return l.getLanguageService().getRenameInfo(o,c,p)}getProjects(t,o,l){let c,p;if(t.projectFileName){let m=this.getProject(t.projectFileName);m&&(c=[m])}else{let m=o?this.projectService.getScriptInfoEnsuringProjectsUptoDate(t.file):this.projectService.getScriptInfo(t.file);if(m)o||this.projectService.ensureDefaultProjectForFile(m);else return l?Yu:(this.projectService.logErrorForScriptInfoNotFound(t.file),pS.ThrowNoProject());c=m.containingProjects,p=this.projectService.getSymlinkedProjects(m)}return c=pn(c,m=>m.languageServiceEnabled&&!m.isOrphan()),!l&&(!c||!c.length)&&!p?(this.projectService.logErrorForScriptInfoNotFound(t.file??t.projectFileName),pS.ThrowNoProject()):p?{projects:c,symLinkedProjects:p}:c}getDefaultProject(t){if(t.projectFileName){let l=this.getProject(t.projectFileName);if(l)return l;if(!t.file)return pS.ThrowNoProject()}return this.projectService.getScriptInfo(t.file).getDefaultProject()}getRenameLocations(t,o){let l=cc(t.file),c=this.getPositionInFile(t,l),p=this.getProjects(t),m=this.getDefaultProject(t),y=this.getPreferences(l),h=this.mapRenameInfo(m.getLanguageService().getRenameInfo(l,c,y),F.checkDefined(this.projectService.getScriptInfo(l)));if(!h.canRename)return o?{info:h,locs:[]}:[];let E=fVt(p,m,{fileName:t.file,pos:c},!!t.findInStrings,!!t.findInComments,y,this.host.useCaseSensitiveFileNames);return o?{info:h,locs:this.toSpanGroups(E)}:E}mapRenameInfo(t,o){if(t.canRename){let{canRename:l,fileToRename:c,displayName:p,fullDisplayName:m,kind:y,kindModifiers:h,triggerSpan:E}=t;return{canRename:l,fileToRename:c,displayName:p,fullDisplayName:m,kind:y,kindModifiers:h,triggerSpan:Gy(E,o)}}else return t}toSpanGroups(t){let o=new Map;for(let{fileName:l,textSpan:c,contextSpan:p,originalContextSpan:m,originalTextSpan:y,originalFileName:h,...E}of t){let T=o.get(l);T||o.set(l,T={file:l,locs:[]});let N=F.checkDefined(this.projectService.getScriptInfo(l));T.locs.push({...HRe(c,p,N),...E})}return $o(o.values())}getReferences(t,o){let l=cc(t.file),c=this.getProjects(t),p=this.getPositionInFile(t,l),m=_Vt(c,this.getDefaultProject(t),{fileName:t.file,pos:p},this.host.useCaseSensitiveFileNames,this.logger);if(!o)return m;let y=this.getPreferences(l),h=this.getDefaultProject(t),E=h.getScriptInfoForNormalizedPath(l),T=h.getLanguageService().getQuickInfoAtPosition(l,p),N=T?eB(T.displayParts):"",R=T&&T.textSpan,L=R?E.positionToLineOffset(R.start).offset:0,O=R?E.getSnapshot().getText(R.start,Tc(R)):"";return{refs:Fo(m,G=>G.references.map(H=>Xnt(this.projectService,H,y))),symbolName:O,symbolStartOffset:L,symbolDisplayString:N}}getFileReferences(t,o){let l=this.getProjects(t),c=t.file,p=this.getPreferences(cc(c)),m=[],y=Xoe(this.host.useCaseSensitiveFileNames);return KRe(l,void 0,E=>{if(E.getCancellationToken().isCancellationRequested())return;let T=E.getLanguageService().getFileReferences(c);if(T)for(let N of T)y.has(N)||(m.push(N),y.add(N))}),o?{refs:m.map(E=>Xnt(this.projectService,E,p)),symbolName:`"${t.file}"`}:m}openClientFile(t,o,l,c){this.projectService.openClientFileWithNormalizedPath(t,o,l,!1,c)}getPosition(t,o){return t.position!==void 0?t.position:o.lineOffsetToPosition(t.line,t.offset)}getPositionInFile(t,o){let l=this.projectService.getScriptInfoForNormalizedPath(o);return this.getPosition(t,l)}getFileAndProject(t){return this.getFileAndProjectWorker(t.file,t.projectFileName)}getFileAndLanguageServiceForSyntacticOperation(t){let{file:o,project:l}=this.getFileAndProject(t);return{file:o,languageService:l.getLanguageService(!1)}}getFileAndProjectWorker(t,o){let l=cc(t),c=this.getProject(o)||this.projectService.ensureDefaultProjectForFile(l);return{file:l,project:c}}getOutliningSpans(t,o){let{file:l,languageService:c}=this.getFileAndLanguageServiceForSyntacticOperation(t),p=c.getOutliningSpans(l);if(o){let m=this.projectService.getScriptInfoForNormalizedPath(l);return p.map(y=>({textSpan:Gy(y.textSpan,m),hintSpan:Gy(y.hintSpan,m),bannerText:y.bannerText,autoCollapse:y.autoCollapse,kind:y.kind}))}else return p}getTodoComments(t){let{file:o,project:l}=this.getFileAndProject(t);return l.getLanguageService().getTodoComments(o,t.descriptors)}getDocCommentTemplate(t){let{file:o,languageService:l}=this.getFileAndLanguageServiceForSyntacticOperation(t),c=this.getPositionInFile(t,o);return l.getDocCommentTemplateAtPosition(o,c,this.getPreferences(o),this.getFormatOptions(o))}getSpanOfEnclosingComment(t){let{file:o,languageService:l}=this.getFileAndLanguageServiceForSyntacticOperation(t),c=t.onlyMultiLine,p=this.getPositionInFile(t,o);return l.getSpanOfEnclosingComment(o,p,c)}getIndentation(t){let{file:o,languageService:l}=this.getFileAndLanguageServiceForSyntacticOperation(t),c=this.getPositionInFile(t,o),p=t.options?rk(t.options):this.getFormatOptions(o),m=l.getIndentationAtPosition(o,c,p);return{position:c,indentation:m}}getBreakpointStatement(t){let{file:o,languageService:l}=this.getFileAndLanguageServiceForSyntacticOperation(t),c=this.getPositionInFile(t,o);return l.getBreakpointStatementAtPosition(o,c)}getNameOrDottedNameSpan(t){let{file:o,languageService:l}=this.getFileAndLanguageServiceForSyntacticOperation(t),c=this.getPositionInFile(t,o);return l.getNameOrDottedNameSpan(o,c,c)}isValidBraceCompletion(t){let{file:o,languageService:l}=this.getFileAndLanguageServiceForSyntacticOperation(t),c=this.getPositionInFile(t,o);return l.isValidBraceCompletionAtPosition(o,c,t.openingBrace.charCodeAt(0))}getQuickInfoWorker(t,o){let{file:l,project:c}=this.getFileAndProject(t),p=this.projectService.getScriptInfoForNormalizedPath(l),m=c.getLanguageService().getQuickInfoAtPosition(l,this.getPosition(t,p));if(!m)return;let y=!!this.getPreferences(l).displayPartsForJSDoc;if(o){let h=eB(m.displayParts);return{kind:m.kind,kindModifiers:m.kindModifiers,start:p.positionToLineOffset(m.textSpan.start),end:p.positionToLineOffset(Tc(m.textSpan)),displayString:h,documentation:y?this.mapDisplayParts(m.documentation,c):eB(m.documentation),tags:this.mapJSDocTagInfo(m.tags,c,y)}}else return y?m:{...m,tags:this.mapJSDocTagInfo(m.tags,c,!1)}}getFormattingEditsForRange(t){let{file:o,languageService:l}=this.getFileAndLanguageServiceForSyntacticOperation(t),c=this.projectService.getScriptInfoForNormalizedPath(o),p=c.lineOffsetToPosition(t.line,t.offset),m=c.lineOffsetToPosition(t.endLine,t.endOffset),y=l.getFormattingEditsForRange(o,p,m,this.getFormatOptions(o));if(y)return y.map(h=>this.convertTextChangeToCodeEdit(h,c))}getFormattingEditsForRangeFull(t){let{file:o,languageService:l}=this.getFileAndLanguageServiceForSyntacticOperation(t),c=t.options?rk(t.options):this.getFormatOptions(o);return l.getFormattingEditsForRange(o,t.position,t.endPosition,c)}getFormattingEditsForDocumentFull(t){let{file:o,languageService:l}=this.getFileAndLanguageServiceForSyntacticOperation(t),c=t.options?rk(t.options):this.getFormatOptions(o);return l.getFormattingEditsForDocument(o,c)}getFormattingEditsAfterKeystrokeFull(t){let{file:o,languageService:l}=this.getFileAndLanguageServiceForSyntacticOperation(t),c=t.options?rk(t.options):this.getFormatOptions(o);return l.getFormattingEditsAfterKeystroke(o,t.position,t.key,c)}getFormattingEditsAfterKeystroke(t){let{file:o,languageService:l}=this.getFileAndLanguageServiceForSyntacticOperation(t),c=this.projectService.getScriptInfoForNormalizedPath(o),p=c.lineOffsetToPosition(t.line,t.offset),m=this.getFormatOptions(o),y=l.getFormattingEditsAfterKeystroke(o,p,t.key,m);if(t.key===`
448
448
  `&&(!y||y.length===0||uVt(y,p))){let{lineText:h,absolutePosition:E}=c.textStorage.getAbsolutePositionAndLineText(t.line);if(h&&h.search("\\S")<0){let T=l.getIndentationAtPosition(o,p,m),N=0,R,L;for(R=0,L=h.length;R<L;R++)if(h.charAt(R)===" ")N++;else if(h.charAt(R)===" ")N+=m.tabSize;else break;if(T!==N){let O=E+R;y.push({span:Yc(E,O),newText:Pu.getIndentationString(T,m)})}}}if(y)return y.map(h=>({start:c.positionToLineOffset(h.span.start),end:c.positionToLineOffset(Tc(h.span)),newText:h.newText?h.newText:""}))}getCompletions(t,o){let{file:l,project:c}=this.getFileAndProject(t),p=this.projectService.getScriptInfoForNormalizedPath(l),m=this.getPosition(t,p),y=c.getLanguageService().getCompletionsAtPosition(l,m,{...DRe(this.getPreferences(l)),triggerCharacter:t.triggerCharacter,triggerKind:t.triggerKind,includeExternalModuleExports:t.includeExternalModuleExports,includeInsertTextCompletions:t.includeInsertTextCompletions},c.projectService.getFormatCodeOptions(l));if(y===void 0)return;if(o==="completions-full")return y;let h=t.prefix||"",E=pi(y.entries,N=>{if(y.isMemberCompletion||Go(N.name.toLowerCase(),h.toLowerCase())){let R=N.replacementSpan?Gy(N.replacementSpan,p):void 0;return{...N,replacementSpan:R,hasAction:N.hasAction||void 0,symbol:void 0}}});return o==="completions"?(y.metadata&&(E.metadata=y.metadata),E):{...y,optionalReplacementSpan:y.optionalReplacementSpan&&Gy(y.optionalReplacementSpan,p),entries:E}}getCompletionEntryDetails(t,o){let{file:l,project:c}=this.getFileAndProject(t),p=this.projectService.getScriptInfoForNormalizedPath(l),m=this.getPosition(t,p),y=c.projectService.getFormatCodeOptions(l),h=!!this.getPreferences(l).displayPartsForJSDoc,E=pi(t.entryNames,T=>{let{name:N,source:R,data:L}=typeof T=="string"?{name:T,source:void 0,data:void 0}:T;return c.getLanguageService().getCompletionEntryDetails(l,m,N,y,R,this.getPreferences(l),L?Ha(L,AVt):void 0)});return o?h?E:E.map(T=>({...T,tags:this.mapJSDocTagInfo(T.tags,c,!1)})):E.map(T=>({...T,codeActions:gn(T.codeActions,N=>this.mapCodeAction(N)),documentation:this.mapDisplayParts(T.documentation,c),tags:this.mapJSDocTagInfo(T.tags,c,h)}))}getCompileOnSaveAffectedFileList(t){let o=this.getProjects(t,!0,!0),l=this.projectService.getScriptInfo(t.file);return l?pVt(l,c=>this.projectService.getScriptInfoForPath(c),o,(c,p)=>{if(!c.compileOnSaveEnabled||!c.languageServiceEnabled||c.isOrphan())return;let m=c.getCompilationSettings();if(!(m.noEmit||fd(p.fileName)&&!cVt(m)))return{projectFileName:c.getProjectName(),fileNames:c.getCompileOnSaveAffectedFileList(p),projectUsesOutFile:!!m.outFile}}):Yu}emitFile(t){let{file:o,project:l}=this.getFileAndProject(t);if(l||pS.ThrowNoProject(),!l.languageServiceEnabled)return t.richResponse?{emitSkipped:!0,diagnostics:[]}:!1;let c=l.getScriptInfo(o),{emitSkipped:p,diagnostics:m}=l.emitFile(c,(y,h,E)=>this.host.writeFile(y,h,E));return t.richResponse?{emitSkipped:p,diagnostics:t.includeLinePosition?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(m):m.map(y=>PB(y,!0))}:!p}getSignatureHelpItems(t,o){let{file:l,project:c}=this.getFileAndProject(t),p=this.projectService.getScriptInfoForNormalizedPath(l),m=this.getPosition(t,p),y=c.getLanguageService().getSignatureHelpItems(l,m,t),h=!!this.getPreferences(l).displayPartsForJSDoc;if(y&&o){let E=y.applicableSpan;return{...y,applicableSpan:{start:p.positionToLineOffset(E.start),end:p.positionToLineOffset(E.start+E.length)},items:this.mapSignatureHelpItems(y.items,c,h)}}else return h||!y?y:{...y,items:y.items.map(E=>({...E,tags:this.mapJSDocTagInfo(E.tags,c,!1)}))}}toPendingErrorCheck(t){let o=cc(t),l=this.projectService.tryGetDefaultProjectForFile(o);return l&&{fileName:o,project:l}}getDiagnostics(t,o,l){this.suppressDiagnosticEvents||l.length>0&&this.updateErrorCheck(t,l,o)}change(t){let o=this.projectService.getScriptInfo(t.file);F.assert(!!o),o.textStorage.switchToScriptVersionCache();let l=o.lineOffsetToPosition(t.line,t.offset),c=o.lineOffsetToPosition(t.endLine,t.endOffset);l>=0&&(this.changeSeq++,this.projectService.applyChangesToFile(o,go({span:{start:l,length:c-l},newText:t.insertString})))}reload(t){let o=cc(t.file),l=t.tmpfile===void 0?void 0:cc(t.tmpfile),c=this.projectService.getScriptInfoForNormalizedPath(o);c&&(this.changeSeq++,c.reloadFromFile(l))}saveToTmp(t,o){let l=this.projectService.getScriptInfo(t);l&&l.saveTo(o)}closeClientFile(t){if(!t)return;let o=Wa(t);this.projectService.closeClientFile(o)}mapLocationNavigationBarItems(t,o){return gn(t,l=>({text:l.text,kind:l.kind,kindModifiers:l.kindModifiers,spans:l.spans.map(c=>Gy(c,o)),childItems:this.mapLocationNavigationBarItems(l.childItems,o),indent:l.indent}))}getNavigationBarItems(t,o){let{file:l,languageService:c}=this.getFileAndLanguageServiceForSyntacticOperation(t),p=c.getNavigationBarItems(l);return p?o?this.mapLocationNavigationBarItems(p,this.projectService.getScriptInfoForNormalizedPath(l)):p:void 0}toLocationNavigationTree(t,o){return{text:t.text,kind:t.kind,kindModifiers:t.kindModifiers,spans:t.spans.map(l=>Gy(l,o)),nameSpan:t.nameSpan&&Gy(t.nameSpan,o),childItems:gn(t.childItems,l=>this.toLocationNavigationTree(l,o))}}getNavigationTree(t,o){let{file:l,languageService:c}=this.getFileAndLanguageServiceForSyntacticOperation(t),p=c.getNavigationTree(l);return p?o?this.toLocationNavigationTree(p,this.projectService.getScriptInfoForNormalizedPath(l)):p:void 0}getNavigateToItems(t,o){let l=this.getFullNavigateToItems(t);return o?Fo(l,({project:c,navigateToItems:p})=>p.map(m=>{let y=c.getScriptInfo(m.fileName),h={name:m.name,kind:m.kind,kindModifiers:m.kindModifiers,isCaseSensitive:m.isCaseSensitive,matchKind:m.matchKind,file:m.fileName,start:y.positionToLineOffset(m.textSpan.start),end:y.positionToLineOffset(Tc(m.textSpan))};return m.kindModifiers&&m.kindModifiers!==""&&(h.kindModifiers=m.kindModifiers),m.containerName&&m.containerName.length>0&&(h.containerName=m.containerName),m.containerKind&&m.containerKind.length>0&&(h.containerKind=m.containerKind),h})):Fo(l,({navigateToItems:c})=>c)}getFullNavigateToItems(t){let{currentFileOnly:o,searchValue:l,maxResultCount:c,projectFileName:p}=t;if(o){F.assertIsDefined(t.file);let{file:R,project:L}=this.getFileAndProject(t);return[{project:L,navigateToItems:L.getLanguageService().getNavigateToItems(l,c,R)}]}let m=this.getHostPreferences(),y=[],h=new Map;if(!t.file&&!p)this.projectService.loadAncestorProjectTree(),this.projectService.forEachEnabledProject(R=>E(R));else{let R=this.getProjects(t);KRe(R,void 0,L=>E(L))}return y;function E(R){let L=R.getLanguageService().getNavigateToItems(l,c,void 0,R.isNonTsProject(),m.excludeLibrarySymbolsInNavTo),O=pn(L,W=>T(W)&&!Yoe(FF(W),R));O.length&&y.push({project:R,navigateToItems:O})}function T(R){let L=R.name;if(!h.has(L))return h.set(L,[R]),!0;let O=h.get(L);for(let W of O)if(N(W,R))return!1;return O.push(R),!0}function N(R,L){return R===L?!0:!R||!L?!1:R.containerKind===L.containerKind&&R.containerName===L.containerName&&R.fileName===L.fileName&&R.isCaseSensitive===L.isCaseSensitive&&R.kind===L.kind&&R.kindModifiers===L.kindModifiers&&R.matchKind===L.matchKind&&R.name===L.name&&R.textSpan.start===L.textSpan.start&&R.textSpan.length===L.textSpan.length}}getSupportedCodeFixes(t){if(!t)return hie();if(t.file){let{file:l,project:c}=this.getFileAndProject(t);return c.getLanguageService().getSupportedCodeFixes(l)}let o=this.getProject(t.projectFileName);return o||pS.ThrowNoProject(),o.getLanguageService().getSupportedCodeFixes()}isLocation(t){return t.line!==void 0}extractPositionOrRange(t,o){let l,c;return this.isLocation(t)?l=p(t):c=this.getRange(t,o),F.checkDefined(l===void 0?c:l);function p(m){return m.position!==void 0?m.position:o.lineOffsetToPosition(m.line,m.offset)}}getRange(t,o){let{startPosition:l,endPosition:c}=this.getStartAndEndPosition(t,o);return{pos:l,end:c}}getApplicableRefactors(t){let{file:o,project:l}=this.getFileAndProject(t),c=l.getScriptInfoForNormalizedPath(o);return l.getLanguageService().getApplicableRefactors(o,this.extractPositionOrRange(t,c),this.getPreferences(o),t.triggerReason,t.kind,t.includeInteractiveActions).map(m=>({...m,actions:m.actions.map(y=>({...y,range:y.range?{start:ik({line:y.range.start.line,character:y.range.start.offset}),end:ik({line:y.range.end.line,character:y.range.end.offset})}:void 0}))}))}getEditsForRefactor(t,o){let{file:l,project:c}=this.getFileAndProject(t),p=c.getScriptInfoForNormalizedPath(l),m=c.getLanguageService().getEditsForRefactor(l,this.getFormatOptions(l),this.extractPositionOrRange(t,p),t.refactor,t.action,this.getPreferences(l),t.interactiveRefactorArguments);if(m===void 0)return{edits:[]};if(o){let{renameFilename:y,renameLocation:h,edits:E}=m,T;if(y!==void 0&&h!==void 0){let N=c.getScriptInfoForNormalizedPath(cc(y));T=qRe(PP(N.getSnapshot()),y,h,E)}return{renameLocation:T,renameFilename:y,edits:this.mapTextChangesToCodeEdits(E),notApplicableReason:m.notApplicableReason}}return m}getMoveToRefactoringFileSuggestions(t){let{file:o,project:l}=this.getFileAndProject(t),c=l.getScriptInfoForNormalizedPath(o);return l.getLanguageService().getMoveToRefactoringFileSuggestions(o,this.extractPositionOrRange(t,c),this.getPreferences(o))}getPasteEdits(t){let{file:o,project:l}=this.getFileAndProject(t),c=t.copiedFrom?{file:t.copiedFrom.file,range:t.copiedFrom.spans.map(m=>this.getRange({file:t.copiedFrom.file,startLine:m.start.line,startOffset:m.start.offset,endLine:m.end.line,endOffset:m.end.offset},l.getScriptInfoForNormalizedPath(cc(t.copiedFrom.file))))}:void 0,p=l.getLanguageService().getPasteEdits({targetFile:o,pastedText:t.pastedText,pasteLocations:t.pasteLocations.map(m=>this.getRange({file:o,startLine:m.start.line,startOffset:m.start.offset,endLine:m.end.line,endOffset:m.end.offset},l.getScriptInfoForNormalizedPath(o))),copiedFrom:c,preferences:this.getPreferences(o)},this.getFormatOptions(o));return p&&this.mapPasteEditsAction(p)}organizeImports(t,o){F.assert(t.scope.type==="file");let{file:l,project:c}=this.getFileAndProject(t.scope.args),p=c.getLanguageService().organizeImports({fileName:l,mode:t.mode??(t.skipDestructiveCodeActions?"SortAndCombine":void 0),type:"file"},this.getFormatOptions(l),this.getPreferences(l));return o?this.mapTextChangesToCodeEdits(p):p}getEditsForFileRename(t,o){let l=cc(t.oldFilePath),c=cc(t.newFilePath),p=this.getHostFormatOptions(),m=this.getHostPreferences(),y=new Set,h=[];return this.projectService.loadAncestorProjectTree(),this.projectService.forEachEnabledProject(E=>{let T=E.getLanguageService().getEditsForFileRename(l,c,p,m),N=[];for(let R of T)y.has(R.fileName)||(h.push(R),N.push(R.fileName));for(let R of N)y.add(R)}),o?h.map(E=>this.mapTextChangeToCodeEdit(E)):h}getCodeFixes(t,o){let{file:l,project:c}=this.getFileAndProject(t),p=c.getScriptInfoForNormalizedPath(l),{startPosition:m,endPosition:y}=this.getStartAndEndPosition(t,p),h;try{h=c.getLanguageService().getCodeFixesAtPosition(l,m,y,t.errorCodes,this.getFormatOptions(l),this.getPreferences(l))}catch(E){let T=c.getLanguageService(),N=[...T.getSyntacticDiagnostics(l),...T.getSemanticDiagnostics(l),...T.getSuggestionDiagnostics(l)].map(L=>HW(m,y-m,L.start,L.length)&&L.code),R=t.errorCodes.find(L=>!N.includes(L));throw R!==void 0&&(E.message=`BADCLIENT: Bad error code, ${R} not found in range ${m}..${y} (found: ${N.join(", ")}); could have caused this error:
449
449
  ${E.message}`),E}return o?h.map(E=>this.mapCodeFixAction(E)):h}getCombinedCodeFix({scope:t,fixId:o},l){F.assert(t.type==="file");let{file:c,project:p}=this.getFileAndProject(t.args),m=p.getLanguageService().getCombinedCodeFix({type:"file",fileName:c},o,this.getFormatOptions(c),this.getPreferences(c));return l?{changes:this.mapTextChangesToCodeEdits(m.changes),commands:m.commands}:m}applyCodeActionCommand(t){let o=t.command;for(let l of fD(o)){let{file:c,project:p}=this.getFileAndProject(l);p.getLanguageService().applyCodeActionCommand(l,this.getFormatOptions(c)).then(m=>{},m=>{})}return{}}getStartAndEndPosition(t,o){let l,c;return t.startPosition!==void 0?l=t.startPosition:(l=o.lineOffsetToPosition(t.startLine,t.startOffset),t.startPosition=l),t.endPosition!==void 0?c=t.endPosition:(c=o.lineOffsetToPosition(t.endLine,t.endOffset),t.endPosition=c),{startPosition:l,endPosition:c}}mapCodeAction({description:t,changes:o,commands:l}){return{description:t,changes:this.mapTextChangesToCodeEdits(o),commands:l}}mapCodeFixAction({fixName:t,description:o,changes:l,commands:c,fixId:p,fixAllDescription:m}){return{fixName:t,description:o,changes:this.mapTextChangesToCodeEdits(l),commands:c,fixId:p,fixAllDescription:m}}mapPasteEditsAction({edits:t,fixId:o}){return{edits:this.mapTextChangesToCodeEdits(t),fixId:o}}mapTextChangesToCodeEdits(t){return t.map(o=>this.mapTextChangeToCodeEdit(o))}mapTextChangeToCodeEdit(t){let o=this.projectService.getScriptInfoOrConfig(t.fileName);return!!t.isNewFile==!!o&&(o||this.projectService.logErrorForScriptInfoNotFound(t.fileName),F.fail("Expected isNewFile for (only) new files. "+JSON.stringify({isNewFile:!!t.isNewFile,hasScriptInfo:!!o}))),o?{fileName:t.fileName,textChanges:t.textChanges.map(l=>bVt(l,o))}:xVt(t)}convertTextChangeToCodeEdit(t,o){return{start:o.positionToLineOffset(t.span.start),end:o.positionToLineOffset(t.span.start+t.span.length),newText:t.newText?t.newText:""}}getBraceMatching(t,o){let{file:l,languageService:c}=this.getFileAndLanguageServiceForSyntacticOperation(t),p=this.projectService.getScriptInfoForNormalizedPath(l),m=this.getPosition(t,p),y=c.getBraceMatchingAtPosition(l,m);return y?o?y.map(h=>Gy(h,p)):y:void 0}getDiagnosticsForProject(t,o,l){if(this.suppressDiagnosticEvents)return;let{fileNames:c,languageServiceDisabled:p}=this.getProjectInfoWorker(l,void 0,!0,!0);if(p)return;let m=c.filter(W=>!W.includes("lib.d.ts"));if(m.length===0)return;let y=[],h=[],E=[],T=[],N=cc(l),R=this.projectService.ensureDefaultProjectForFile(N);for(let W of m)this.getCanonicalFileName(W)===this.getCanonicalFileName(l)?y.push(W):this.projectService.getScriptInfo(W).isScriptOpen()?h.push(W):fd(W)?T.push(W):E.push(W);let O=[...y,...h,...E,...T].map(W=>({fileName:W,project:R}));this.updateErrorCheck(t,O,o,!1)}configurePlugin(t){this.projectService.configurePlugin(t)}getSmartSelectionRange(t,o){let{locations:l}=t,{file:c,languageService:p}=this.getFileAndLanguageServiceForSyntacticOperation(t),m=F.checkDefined(this.projectService.getScriptInfo(c));return gn(l,y=>{let h=this.getPosition(y,m),E=p.getSmartSelectionRange(c,h);return o?this.mapSelectionRange(E,m):E})}toggleLineComment(t,o){let{file:l,languageService:c}=this.getFileAndLanguageServiceForSyntacticOperation(t),p=this.projectService.getScriptInfo(l),m=this.getRange(t,p),y=c.toggleLineComment(l,m);if(o){let h=this.projectService.getScriptInfoForNormalizedPath(l);return y.map(E=>this.convertTextChangeToCodeEdit(E,h))}return y}toggleMultilineComment(t,o){let{file:l,languageService:c}=this.getFileAndLanguageServiceForSyntacticOperation(t),p=this.projectService.getScriptInfoForNormalizedPath(l),m=this.getRange(t,p),y=c.toggleMultilineComment(l,m);if(o){let h=this.projectService.getScriptInfoForNormalizedPath(l);return y.map(E=>this.convertTextChangeToCodeEdit(E,h))}return y}commentSelection(t,o){let{file:l,languageService:c}=this.getFileAndLanguageServiceForSyntacticOperation(t),p=this.projectService.getScriptInfoForNormalizedPath(l),m=this.getRange(t,p),y=c.commentSelection(l,m);if(o){let h=this.projectService.getScriptInfoForNormalizedPath(l);return y.map(E=>this.convertTextChangeToCodeEdit(E,h))}return y}uncommentSelection(t,o){let{file:l,languageService:c}=this.getFileAndLanguageServiceForSyntacticOperation(t),p=this.projectService.getScriptInfoForNormalizedPath(l),m=this.getRange(t,p),y=c.uncommentSelection(l,m);if(o){let h=this.projectService.getScriptInfoForNormalizedPath(l);return y.map(E=>this.convertTextChangeToCodeEdit(E,h))}return y}mapSelectionRange(t,o){let l={textSpan:Gy(t.textSpan,o)};return t.parent&&(l.parent=this.mapSelectionRange(t.parent,o)),l}getScriptInfoFromProjectService(t){let o=cc(t),l=this.projectService.getScriptInfoForNormalizedPath(o);return l||(this.projectService.logErrorForScriptInfoNotFound(o),pS.ThrowNoProject())}toProtocolCallHierarchyItem(t){let o=this.getScriptInfoFromProjectService(t.file);return{name:t.name,kind:t.kind,kindModifiers:t.kindModifiers,file:t.file,containerName:t.containerName,span:Gy(t.span,o),selectionSpan:Gy(t.selectionSpan,o)}}toProtocolCallHierarchyIncomingCall(t){let o=this.getScriptInfoFromProjectService(t.from.file);return{from:this.toProtocolCallHierarchyItem(t.from),fromSpans:t.fromSpans.map(l=>Gy(l,o))}}toProtocolCallHierarchyOutgoingCall(t,o){return{to:this.toProtocolCallHierarchyItem(t.to),fromSpans:t.fromSpans.map(l=>Gy(l,o))}}prepareCallHierarchy(t){let{file:o,project:l}=this.getFileAndProject(t),c=this.projectService.getScriptInfoForNormalizedPath(o);if(c){let p=this.getPosition(t,c),m=l.getLanguageService().prepareCallHierarchy(o,p);return m&&Ire(m,y=>this.toProtocolCallHierarchyItem(y))}}provideCallHierarchyIncomingCalls(t){let{file:o,project:l}=this.getFileAndProject(t),c=this.getScriptInfoFromProjectService(o);return l.getLanguageService().provideCallHierarchyIncomingCalls(o,this.getPosition(t,c)).map(m=>this.toProtocolCallHierarchyIncomingCall(m))}provideCallHierarchyOutgoingCalls(t){let{file:o,project:l}=this.getFileAndProject(t),c=this.getScriptInfoFromProjectService(o);return l.getLanguageService().provideCallHierarchyOutgoingCalls(o,this.getPosition(t,c)).map(m=>this.toProtocolCallHierarchyOutgoingCall(m,c))}getCanonicalFileName(t){let o=this.host.useCaseSensitiveFileNames?t:_0(t);return Wa(o)}exit(){}notRequired(t){return t&&this.doOutput(void 0,t.command,t.seq,!0,this.performanceData),{responseRequired:!1,performanceData:this.performanceData}}requiredResponse(t){return{response:t,responseRequired:!0,performanceData:this.performanceData}}addProtocolHandler(t,o){if(this.handlers.has(t))throw new Error(`Protocol handler already exists for command "${t}"`);this.handlers.set(t,o)}setCurrentRequest(t){F.assert(this.currentRequestId===void 0),this.currentRequestId=t,this.cancellationToken.setRequest(t)}resetCurrentRequest(t){F.assert(this.currentRequestId===t),this.currentRequestId=void 0,this.cancellationToken.resetRequest(t)}executeWithRequestId(t,o,l){let c=this.performanceData;try{return this.performanceData=l,this.setCurrentRequest(t),o()}finally{this.resetCurrentRequest(t),this.performanceData=c}}executeCommand(t){let o=this.handlers.get(t.command);if(o){let l=this.executeWithRequestId(t.seq,()=>o(t),void 0);return this.projectService.enableRequestedPlugins(),l}else return this.logger.msg(`Unrecognized JSON command:${OT(t)}`,"Err"),this.doOutput(void 0,"unknown",t.seq,!1,void 0,`Unrecognized JSON command: ${t.command}`),{responseRequired:!1}}onMessage(t){var o,l,c,p,m,y,h;this.gcTimer.scheduleCollect();let E,T=this.performanceData;this.logger.hasLevel(2)&&(E=this.hrtime(),this.logger.hasLevel(3)&&this.logger.info(`request:${uF(this.toStringMessage(t))}`));let N,R;try{N=this.parseMessage(t),R=N.arguments&&N.arguments.file?N.arguments:void 0,(o=Kr)==null||o.instant(Kr.Phase.Session,"request",{seq:N.seq,command:N.command}),(l=Kr)==null||l.push(Kr.Phase.Session,"executeCommand",{seq:N.seq,command:N.command},!0);let{response:L,responseRequired:O,performanceData:W}=this.executeCommand(N);if((c=Kr)==null||c.pop(),this.logger.hasLevel(2)){let G=lVt(this.hrtime(E)).toFixed(4);O?this.logger.perftrc(`${N.seq}::${N.command}: elapsed time (in milliseconds) ${G}`):this.logger.perftrc(`${N.seq}::${N.command}: async elapsed time (in milliseconds) ${G}`)}(p=Kr)==null||p.instant(Kr.Phase.Session,"response",{seq:N.seq,command:N.command,success:!!L}),L?this.doOutput(L,N.command,N.seq,!0,W):O&&this.doOutput(void 0,N.command,N.seq,!1,W,"No content available.")}catch(L){if((m=Kr)==null||m.popAll(),L instanceof lO){(y=Kr)==null||y.instant(Kr.Phase.Session,"commandCanceled",{seq:N?.seq,command:N?.command}),this.doOutput({canceled:!0},N.command,N.seq,!0,this.performanceData);return}this.logErrorWorker(L,this.toStringMessage(t),R),(h=Kr)==null||h.instant(Kr.Phase.Session,"commandError",{seq:N?.seq,command:N?.command,message:L.message}),this.doOutput(void 0,N?N.command:"unknown",N?N.seq:0,!1,this.performanceData,"Error processing request. "+L.message+`
450
- `+L.stack)}finally{this.performanceData=T}}parseMessage(t){return JSON.parse(t)}toStringMessage(t){return t}getFormatOptions(t){return this.projectService.getFormatCodeOptions(t)}getPreferences(t){return this.projectService.getPreferences(t)}getHostFormatOptions(){return this.projectService.getHostFormatCodeOptions()}getHostPreferences(){return this.projectService.getHostPreferences()}};function Jnt(e){let t=e.diagnosticsDuration&&$o(e.diagnosticsDuration,([o,l])=>({...l,file:o}));return{...e,diagnosticsDuration:t}}function Gy(e,t){return{start:t.positionToLineOffset(e.start),end:t.positionToLineOffset(Tc(e))}}function HRe(e,t,o){let l=Gy(e,o),c=t&&Gy(t,o);return c?{...l,contextStart:c.start,contextEnd:c.end}:l}function bVt(e,t){return{start:$nt(t,e.span.start),end:$nt(t,Tc(e.span)),newText:e.newText}}function $nt(e,t){return BRe(e)?EVt(e.getLineAndCharacterOfPosition(t)):e.positionToLineOffset(t)}function SVt(e,t){let o=e.ranges.map(l=>({start:t.positionToLineOffset(l.start),end:t.positionToLineOffset(l.start+l.length)}));return e.wordPattern?{ranges:o,wordPattern:e.wordPattern}:{ranges:o}}function EVt(e){return{line:e.line+1,offset:e.character+1}}function xVt(e){F.assert(e.textChanges.length===1);let t=Ea(e.textChanges);return F.assert(t.span.start===0&&t.span.length===0),{fileName:e.fileName,textChanges:[{start:{line:0,offset:0},end:{line:0,offset:0},newText:t.newText}]}}function qRe(e,t,o,l){let c=TVt(e,t,l),{line:p,character:m}=bL(yD(c),o);return{line:p+1,offset:m+1}}function TVt(e,t,o){for(let{fileName:l,textChanges:c}of o)if(l===t)for(let p=c.length-1;p>=0;p--){let{newText:m,span:{start:y,length:h}}=c[p];e=e.slice(0,y)+m+e.slice(y+h)}return e}function Xnt(e,{fileName:t,textSpan:o,contextSpan:l,isWriteAccess:c,isDefinition:p},{disableLineTextInReferences:m}){let y=F.checkDefined(e.getScriptInfo(t)),h=HRe(o,l,y),E=m?void 0:NVt(y,h);return{file:t,...h,lineText:E,isWriteAccess:c,isDefinition:p}}function NVt(e,t){let o=e.lineToTextSpan(t.start.line-1);return e.getSnapshot().getText(o.start,Tc(o)).replace(/\r|\n/g,"")}function AVt(e){return e===void 0||e&&typeof e=="object"&&typeof e.exportName=="string"&&(e.fileName===void 0||typeof e.fileName=="string")&&(e.ambientModuleName===void 0||typeof e.ambientModuleName=="string"&&(e.isPackageJsonImport===void 0||typeof e.isPackageJsonImport=="boolean"))}var ok=4,JRe=(e=>(e[e.PreStart=0]="PreStart",e[e.Start=1]="Start",e[e.Entire=2]="Entire",e[e.Mid=3]="Mid",e[e.End=4]="End",e[e.PostEnd=5]="PostEnd",e))(JRe||{}),CVt=class{constructor(){this.goSubtree=!0,this.lineIndex=new RB,this.endBranch=[],this.state=2,this.initialText="",this.trailingText="",this.lineIndex.root=new ak,this.startPath=[this.lineIndex.root],this.stack=[this.lineIndex.root]}get done(){return!1}insertLines(e,t){t&&(this.trailingText=""),e?e=this.initialText+e+this.trailingText:e=this.initialText+this.trailingText;let l=RB.linesFromText(e).lines;l.length>1&&l[l.length-1]===""&&l.pop();let c,p;for(let y=this.endBranch.length-1;y>=0;y--)this.endBranch[y].updateCounts(),this.endBranch[y].charCount()===0&&(p=this.endBranch[y],y>0?c=this.endBranch[y-1]:c=this.branchNode);p&&c.remove(p);let m=this.startPath[this.startPath.length-1];if(l.length>0)if(m.text=l[0],l.length>1){let y=new Array(l.length-1),h=m;for(let N=1;N<l.length;N++)y[N-1]=new jK(l[N]);let E=this.startPath.length-2;for(;E>=0;){let N=this.startPath[E];y=N.insertAt(h,y),E--,h=N}let T=y.length;for(;T>0;){let N=new ak;N.add(this.lineIndex.root),y=N.insertAt(this.lineIndex.root,y),T=y.length,this.lineIndex.root=N}this.lineIndex.root.updateCounts()}else for(let y=this.startPath.length-2;y>=0;y--)this.startPath[y].updateCounts();else{this.startPath[this.startPath.length-2].remove(m);for(let h=this.startPath.length-2;h>=0;h--)this.startPath[h].updateCounts()}return this.lineIndex}post(e,t,o){o===this.lineCollectionAtBranch&&(this.state=4),this.stack.pop()}pre(e,t,o,l,c){let p=this.stack[this.stack.length-1];this.state===2&&c===1&&(this.state=1,this.branchNode=p,this.lineCollectionAtBranch=o);let m;function y(h){return h.isLeaf()?new jK(""):new ak}switch(c){case 0:this.goSubtree=!1,this.state!==4&&p.add(o);break;case 1:this.state===4?this.goSubtree=!1:(m=y(o),p.add(m),this.startPath.push(m));break;case 2:this.state!==4?(m=y(o),p.add(m),this.startPath.push(m)):o.isLeaf()||(m=y(o),p.add(m),this.endBranch.push(m));break;case 3:this.goSubtree=!1;break;case 4:this.state!==4?this.goSubtree=!1:o.isLeaf()||(m=y(o),p.add(m),this.endBranch.push(m));break;case 5:this.goSubtree=!1,this.state!==1&&p.add(o);break}this.goSubtree&&this.stack.push(m)}leaf(e,t,o){this.state===1?this.initialText=o.text.substring(0,e):this.state===2?(this.initialText=o.text.substring(0,e),this.trailingText=o.text.substring(e+t)):this.trailingText=o.text.substring(e+t)}},IVt=class{constructor(e,t,o){this.pos=e,this.deleteLen=t,this.insertedText=o}getTextChangeRange(){return qW(kd(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}},Qoe=class HI{constructor(){this.changes=[],this.versions=new Array(HI.maxVersions),this.minVersion=0,this.currentVersion=0}versionToIndex(t){if(!(t<this.minVersion||t>this.currentVersion))return t%HI.maxVersions}currentVersionToIndex(){return this.currentVersion%HI.maxVersions}edit(t,o,l){this.changes.push(new IVt(t,o,l)),(this.changes.length>HI.changeNumberThreshold||o>HI.changeLengthThreshold||l&&l.length>HI.changeLengthThreshold)&&this.getSnapshot()}getSnapshot(){return this._getSnapshot()}_getSnapshot(){let t=this.versions[this.currentVersionToIndex()];if(this.changes.length>0){let o=t.index;for(let l of this.changes)o=o.edit(l.pos,l.deleteLen,l.insertedText);t=new Ynt(this.currentVersion+1,this,o,this.changes),this.currentVersion=t.version,this.versions[this.currentVersionToIndex()]=t,this.changes=[],this.currentVersion-this.minVersion>=HI.maxVersions&&(this.minVersion=this.currentVersion-HI.maxVersions+1)}return t}getSnapshotVersion(){return this._getSnapshot().version}getAbsolutePositionAndLineText(t){return this._getSnapshot().index.lineNumberToInfo(t)}lineOffsetToPosition(t,o){return this._getSnapshot().index.absolutePositionOfStartOfLine(t)+(o-1)}positionToLineOffset(t){return this._getSnapshot().index.positionToLineOffset(t)}lineToTextSpan(t){let o=this._getSnapshot().index,{lineText:l,absolutePosition:c}=o.lineNumberToInfo(t+1),p=l!==void 0?l.length:o.absolutePositionOfStartOfLine(t+2)-c;return kd(c,p)}getTextChangesBetweenVersions(t,o){if(t<o)if(t>=this.minVersion){let l=[];for(let c=t+1;c<=o;c++){let p=this.versions[this.versionToIndex(c)];for(let m of p.changesSincePreviousVersion)l.push(m.getTextChangeRange())}return zve(l)}else return;else return iz}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString(t){let o=new HI,l=new Ynt(0,o,new RB);o.versions[o.currentVersion]=l;let c=RB.linesFromText(t);return l.index.load(c.lines),o}};Qoe.changeNumberThreshold=8,Qoe.changeLengthThreshold=256,Qoe.maxVersions=8;var Zoe=Qoe,Ynt=class A_t{constructor(t,o,l,c=Yu){this.version=t,this.cache=o,this.index=l,this.changesSincePreviousVersion=c}getText(t,o){return this.index.getText(t,o-t)}getLength(){return this.index.getLength()}getChangeRange(t){if(t instanceof A_t&&this.cache===t.cache)return this.version<=t.version?iz:this.cache.getTextChangesBetweenVersions(t.version,this.version)}},RB=class N8e{constructor(){this.checkEdits=!1}absolutePositionOfStartOfLine(t){return this.lineNumberToInfo(t).absolutePosition}positionToLineOffset(t){let{oneBasedLine:o,zeroBasedColumn:l}=this.root.charOffsetToLineInfo(1,t);return{line:o,offset:l+1}}positionToColumnAndLineText(t){return this.root.charOffsetToLineInfo(1,t)}getLineCount(){return this.root.lineCount()}lineNumberToInfo(t){let o=this.getLineCount();if(t<=o){let{position:l,leaf:c}=this.root.lineNumberToInfo(t,0);return{absolutePosition:l,lineText:c&&c.text}}else return{absolutePosition:this.root.charCount(),lineText:void 0}}load(t){if(t.length>0){let o=[];for(let l=0;l<t.length;l++)o[l]=new jK(t[l]);this.root=N8e.buildTreeFromBottom(o)}else this.root=new ak}walk(t,o,l){this.root.walk(t,o,l)}getText(t,o){let l="";return o>0&&t<this.root.charCount()&&this.walk(t,o,{goSubtree:!0,done:!1,leaf:(c,p,m)=>{l=l.concat(m.text.substring(c,c+p))}}),l}getLength(){return this.root.charCount()}every(t,o,l){l||(l=this.root.charCount());let c={goSubtree:!0,done:!1,leaf(p,m,y){t(y,p,m)||(this.done=!0)}};return this.walk(o,l-o,c),!c.done}edit(t,o,l){if(this.root.charCount()===0)return F.assert(o===0),l!==void 0?(this.load(N8e.linesFromText(l).lines),this):void 0;{let c;if(this.checkEdits){let y=this.getText(0,this.root.charCount());c=y.slice(0,t)+l+y.slice(t+o)}let p=new CVt,m=!1;if(t>=this.root.charCount()){t=this.root.charCount()-1;let y=this.getText(t,1);l?l=y+l:l=y,o=0,m=!0}else if(o>0){let y=t+o,{zeroBasedColumn:h,lineText:E}=this.positionToColumnAndLineText(y);h===0&&(o+=E.length,l=l?l+E:E)}if(this.root.walk(t,o,p),p.insertLines(l,m),this.checkEdits){let y=p.lineIndex.getText(0,p.lineIndex.getLength());F.assert(c===y,"buffer edit mismatch")}return p.lineIndex}}static buildTreeFromBottom(t){if(t.length<ok)return new ak(t);let o=new Array(Math.ceil(t.length/ok)),l=0;for(let c=0;c<o.length;c++){let p=Math.min(l+ok,t.length);o[c]=new ak(t.slice(l,p)),l=p}return this.buildTreeFromBottom(o)}static linesFromText(t){let o=yD(t);if(o.length===0)return{lines:[],lineMap:o};let l=new Array(o.length),c=o.length-1;for(let m=0;m<c;m++)l[m]=t.substring(o[m],o[m+1]);let p=t.substring(o[c]);return p.length>0?l[c]=p:l.pop(),{lines:l,lineMap:o}}},ak=class A8e{constructor(t=[]){this.children=t,this.totalChars=0,this.totalLines=0,t.length&&this.updateCounts()}isLeaf(){return!1}updateCounts(){this.totalChars=0,this.totalLines=0;for(let t of this.children)this.totalChars+=t.charCount(),this.totalLines+=t.lineCount()}execWalk(t,o,l,c,p){return l.pre&&l.pre(t,o,this.children[c],this,p),l.goSubtree?(this.children[c].walk(t,o,l),l.post&&l.post(t,o,this.children[c],this,p)):l.goSubtree=!0,l.done}skipChild(t,o,l,c,p){c.pre&&!c.done&&(c.pre(t,o,this.children[l],this,p),c.goSubtree=!0)}walk(t,o,l){let c=0,p=this.children[c].charCount(),m=t;for(;m>=p;)this.skipChild(m,o,c,l,0),m-=p,c++,p=this.children[c].charCount();if(m+o<=p){if(this.execWalk(m,o,l,c,2))return}else{if(this.execWalk(m,p-m,l,c,1))return;let y=o-(p-m);for(c++,p=this.children[c].charCount();y>p;){if(this.execWalk(0,p,l,c,3))return;y-=p,c++,p=this.children[c].charCount()}if(y>0&&this.execWalk(0,y,l,c,4))return}if(l.pre){let y=this.children.length;if(c<y-1)for(let h=c+1;h<y;h++)this.skipChild(0,0,h,l,5)}}charOffsetToLineInfo(t,o){if(this.children.length===0)return{oneBasedLine:t,zeroBasedColumn:o,lineText:void 0};for(let p of this.children){if(p.charCount()>o)return p.isLeaf()?{oneBasedLine:t,zeroBasedColumn:o,lineText:p.text}:p.charOffsetToLineInfo(t,o);o-=p.charCount(),t+=p.lineCount()}let l=this.lineCount();if(l===0)return{oneBasedLine:1,zeroBasedColumn:0,lineText:void 0};let c=F.checkDefined(this.lineNumberToInfo(l,0).leaf);return{oneBasedLine:l,zeroBasedColumn:c.charCount(),lineText:void 0}}lineNumberToInfo(t,o){for(let l of this.children){let c=l.lineCount();if(c>=t)return l.isLeaf()?{position:o,leaf:l}:l.lineNumberToInfo(t,o);t-=c,o+=l.charCount()}return{position:o,leaf:void 0}}splitAfter(t){let o,l=this.children.length;t++;let c=t;if(t<l){for(o=new A8e;t<l;)o.add(this.children[t]),t++;o.updateCounts()}return this.children.length=c,o}remove(t){let o=this.findChildIndex(t),l=this.children.length;if(o<l-1)for(let c=o;c<l-1;c++)this.children[c]=this.children[c+1];this.children.pop()}findChildIndex(t){let o=this.children.indexOf(t);return F.assert(o!==-1),o}insertAt(t,o){let l=this.findChildIndex(t),c=this.children.length,p=o.length;if(c<ok&&l===c-1&&p===1)return this.add(o[0]),this.updateCounts(),[];{let m=this.splitAfter(l),y=0;for(l++;l<ok&&y<p;)this.children[l]=o[y],l++,y++;let h=[],E=0;if(y<p){E=Math.ceil((p-y)/ok),h=new Array(E);let T=0;for(let R=0;R<E;R++)h[R]=new A8e;let N=h[0];for(;y<p;)N.add(o[y]),y++,N.children.length===ok&&(T++,N=h[T]);for(let R=h.length-1;R>=0;R--)h[R].children.length===0&&h.pop()}m&&h.push(m),this.updateCounts();for(let T=0;T<E;T++)h[T].updateCounts();return h}}add(t){this.children.push(t),F.assert(this.children.length<=ok)}charCount(){return this.totalChars}lineCount(){return this.totalLines}},jK=class{constructor(e){this.text=e}isLeaf(){return!0}walk(e,t,o){o.leaf(e,t,this)}charCount(){return this.text.length}lineCount(){return 1}},Qnt=class C_t{constructor(t,o,l,c,p,m){this.telemetryEnabled=t,this.logger=o,this.host=l,this.globalTypingsCacheLocation=c,this.event=p,this.maxActiveRequestCount=m,this.activeRequestCount=0,this.requestQueue=DW(),this.requestMap=new Map,this.requestedRegistry=!1,this.packageInstallId=0}isKnownTypesPackageName(t){var o;return Fy.validatePackageName(t)!==Fy.NameValidationResult.Ok?!1:(this.requestedRegistry||(this.requestedRegistry=!0,this.installer.send({kind:"typesRegistry"})),!!((o=this.typesRegistryCache)!=null&&o.has(t)))}installPackage(t){this.packageInstallId++;let o={kind:"installPackage",...t,id:this.packageInstallId},l=new Promise((c,p)=>{(this.packageInstalledPromise??(this.packageInstalledPromise=new Map)).set(this.packageInstallId,{resolve:c,reject:p})});return this.installer.send(o),l}attach(t){this.projectService=t,this.installer=this.createInstallerProcess()}onProjectClosed(t){this.installer.send({projectName:t.getProjectName(),kind:"closeProject"})}enqueueInstallTypingsRequest(t,o,l){let c=oRe(t,o,l);this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling throttled operation:${OT(c)}`),this.activeRequestCount<this.maxActiveRequestCount?this.scheduleRequest(c):(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Deferring request for: ${c.projectName}`),this.requestQueue.enqueue(c),this.requestMap.set(c.projectName,c))}handleMessage(t){var o,l;switch(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Received response:${OT(t)}`),t.kind){case Tne:this.typesRegistryCache=new Map(Object.entries(t.typesRegistry));break;case aj:{let c=(o=this.packageInstalledPromise)==null?void 0:o.get(t.id);F.assertIsDefined(c,"Should find the promise for package install"),(l=this.packageInstalledPromise)==null||l.delete(t.id),t.success?c.resolve({successMessage:t.message}):c.reject(t.message),this.projectService.updateTypingsForProject(t),this.event(t,"setTypings");break}case mAe:{let c={message:t.message};this.event(c,"typesInstallerInitializationFailed");break}case Nne:{let c={eventId:t.eventId,packages:t.packagesToInstall};this.event(c,"beginInstallTypes");break}case Ane:{if(this.telemetryEnabled){let m={telemetryEventName:"typingsInstalled",payload:{installedPackages:t.packagesToInstall.join(","),installSuccess:t.installSuccess,typingsInstallerVersion:t.typingsInstallerVersion}};this.event(m,"telemetry")}let c={eventId:t.eventId,packages:t.packagesToInstall,success:t.installSuccess};this.event(c,"endInstallTypes");break}case oj:{this.projectService.updateTypingsForProject(t);break}case ij:{for(this.activeRequestCount>0?this.activeRequestCount--:F.fail("TIAdapter:: Received too many responses");!this.requestQueue.isEmpty();){let c=this.requestQueue.dequeue();if(this.requestMap.get(c.projectName)===c){this.requestMap.delete(c.projectName),this.scheduleRequest(c);break}this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Skipping defunct request for: ${c.projectName}`)}this.projectService.updateTypingsForProject(t),this.event(t,"setTypings");break}case E3:this.projectService.watchTypingLocations(t);break;default:}}scheduleRequest(t){this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling request for: ${t.projectName}`),this.activeRequestCount++,this.host.setTimeout(()=>{this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Sending request:${OT(t)}`),this.installer.send(t)},C_t.requestDelayMillis,`${t.projectName}::${t.kind}`)}};Qnt.requestDelayMillis=100;var Znt=Qnt,ert={};g(ert,{ActionInvalidate:()=>oj,ActionPackageInstalled:()=>aj,ActionSet:()=>ij,ActionWatchTypingLocations:()=>E3,Arguments:()=>Cne,AutoImportProviderProject:()=>TRe,AuxiliaryProject:()=>ERe,CharRangeSection:()=>JRe,CloseFileWatcherEvent:()=>Uoe,CommandNames:()=>Unt,ConfigFileDiagEvent:()=>Foe,ConfiguredProject:()=>NRe,ConfiguredProjectLoadKind:()=>RRe,CreateDirectoryWatcherEvent:()=>zoe,CreateFileWatcherEvent:()=>Goe,Errors:()=>pS,EventBeginInstallTypes:()=>Nne,EventEndInstallTypes:()=>Ane,EventInitializationFailed:()=>mAe,EventTypesRegistry:()=>Tne,ExternalProject:()=>Roe,GcTimer:()=>pRe,InferredProject:()=>SRe,LargeFileReferencedEvent:()=>Ooe,LineIndex:()=>RB,LineLeaf:()=>jK,LineNode:()=>ak,LogLevel:()=>rRe,Msg:()=>iRe,OpenFileInfoTelemetryEvent:()=>ARe,Project:()=>jP,ProjectInfoTelemetryEvent:()=>Boe,ProjectKind:()=>NB,ProjectLanguageServiceStateEvent:()=>Woe,ProjectLoadingFinishEvent:()=>woe,ProjectLoadingStartEvent:()=>koe,ProjectService:()=>WRe,ProjectsUpdatedInBackgroundEvent:()=>zK,ScriptInfo:()=>gRe,ScriptVersionCache:()=>Zoe,Session:()=>qnt,TextStorage:()=>_Re,ThrottledOperations:()=>dRe,TypingsInstallerAdapter:()=>Znt,allFilesAreJsOrDts:()=>yRe,allRootFilesAreJsOrDts:()=>hRe,asNormalizedPath:()=>_nt,convertCompilerOptions:()=>UK,convertFormatOptions:()=>rk,convertScriptKindName:()=>joe,convertTypeAcquisition:()=>IRe,convertUserPreferences:()=>DRe,convertWatchOptions:()=>DB,countEachFileTypes:()=>AB,createInstallTypingsRequest:()=>oRe,createModuleSpecifierCache:()=>zRe,createNormalizedPathMap:()=>gnt,createPackageJsonCache:()=>URe,createSortedArray:()=>uRe,emptyArray:()=>Yu,findArgument:()=>pKe,formatDiagnosticToProtocol:()=>PB,formatMessage:()=>VRe,getBaseConfigFileName:()=>Poe,getLocationInNewDocument:()=>qRe,hasArgument:()=>dKe,hasNoTypeScriptSource:()=>vRe,indent:()=>uF,isBackgroundProject:()=>IB,isConfigFile:()=>BRe,isConfiguredProject:()=>bE,isDynamicFileName:()=>TB,isExternalProject:()=>CB,isInferredProject:()=>nk,isInferredProjectName:()=>aRe,isProjectDeferredClose:()=>GK,makeAutoImportProviderProjectName:()=>lRe,makeAuxiliaryProjectName:()=>cRe,makeInferredProjectName:()=>sRe,maxFileSize:()=>Moe,maxProgramSizeForNonTsFiles:()=>Loe,normalizedPathToPath:()=>tk,nowString:()=>fKe,nullCancellationToken:()=>Bnt,nullTypingsInstaller:()=>VK,protocol:()=>fRe,stringifyIndented:()=>OT,toEvent:()=>jRe,toNormalizedPath:()=>cc,tryConvertScriptKindName:()=>Voe,typingsInstaller:()=>nRe,updateProjectIfDirty:()=>X_}),typeof console<"u"&&(F.loggingHost={log(e,t){switch(e){case 1:return console.error(t);case 2:return console.warn(t);case 3:return console.log(t);case 4:return console.log(t)}}})})({get exports(){return b_t},set exports(s){b_t=s,typeof qce<"u"&&qce.exports&&(qce.exports=s)}})});var M_t=Ln((uPn,L_t)=>{"use strict";L_t.exports=P_t;function P_t(s,n,a){s instanceof RegExp&&(s=D_t(s,a)),n instanceof RegExp&&(n=D_t(n,a));var u=R_t(s,n,a);return u&&{start:u[0],end:u[1],pre:a.slice(0,u[0]),body:a.slice(u[0]+s.length,u[1]),post:a.slice(u[1]+n.length)}}function D_t(s,n){var a=n.match(s);return a?a[0]:null}P_t.range=R_t;function R_t(s,n,a){var u,f,g,b,C,k=a.indexOf(s),B=a.indexOf(n,k+1),K=k;if(k>=0&&B>0){if(s===n)return[k,B];for(u=[],g=a.length;K>=0&&!C;)K==k?(u.push(K),k=a.indexOf(s,K+1)):u.length==1?C=[u.pop(),B]:(f=u.pop(),f<g&&(g=f,b=B),B=a.indexOf(n,K+1)),K=k<B&&k>=0?k:B;u.length&&(C=[g,b])}return C}});var z_t=Ln((dPn,G_t)=>{var k_t=M_t();G_t.exports=dun;var w_t="\0SLASH"+Math.random()+"\0",O_t="\0OPEN"+Math.random()+"\0",I8e="\0CLOSE"+Math.random()+"\0",F_t="\0COMMA"+Math.random()+"\0",W_t="\0PERIOD"+Math.random()+"\0";function C8e(s){return parseInt(s,10)==s?parseInt(s,10):s.charCodeAt(0)}function cun(s){return s.split("\\\\").join(w_t).split("\\{").join(O_t).split("\\}").join(I8e).split("\\,").join(F_t).split("\\.").join(W_t)}function uun(s){return s.split(w_t).join("\\").split(O_t).join("{").split(I8e).join("}").split(F_t).join(",").split(W_t).join(".")}function B_t(s){if(!s)return[""];var n=[],a=k_t("{","}",s);if(!a)return s.split(",");var u=a.pre,f=a.body,g=a.post,b=u.split(",");b[b.length-1]+="{"+f+"}";var C=B_t(g);return g.length&&(b[b.length-1]+=C.shift(),b.push.apply(b,C)),n.push.apply(n,b),n}function dun(s){return s?(s.substr(0,2)==="{}"&&(s="\\{\\}"+s.substr(2)),iJ(cun(s),!0).map(uun)):[]}function pun(s){return"{"+s+"}"}function fun(s){return/^-?0\d/.test(s)}function mun(s,n){return s<=n}function _un(s,n){return s>=n}function iJ(s,n){var a=[],u=k_t("{","}",s);if(!u)return[s];var f=u.pre,g=u.post.length?iJ(u.post,!1):[""];if(/\$$/.test(u.pre))for(var b=0;b<g.length;b++){var C=f+"{"+u.body+"}"+g[b];a.push(C)}else{var k=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(u.body),B=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(u.body),K=k||B,re=u.body.indexOf(",")>=0;if(!K&&!re)return u.post.match(/,(?!,).*\}/)?(s=u.pre+"{"+u.body+I8e+u.post,iJ(s)):[s];var q;if(K)q=u.body.split(/\.\./);else if(q=B_t(u.body),q.length===1&&(q=iJ(q[0],!1).map(pun),q.length===1))return g.map(function(br){return u.pre+q[0]+br});var Me;if(K){var Te=C8e(q[0]),Ee=C8e(q[1]),St=Math.max(q[0].length,q[1].length),Ot=q.length==3?Math.abs(C8e(q[2])):1,ft=mun,Gt=Ee<Te;Gt&&(Ot*=-1,ft=_un);var En=q.some(fun);Me=[];for(var vr=Te;ft(vr,Ee);vr+=Ot){var rn;if(B)rn=String.fromCharCode(vr),rn==="\\"&&(rn="");else if(rn=String(vr),En){var Ht=St-rn.length;if(Ht>0){var hn=new Array(Ht+1).join("0");vr<0?rn="-"+hn+rn.slice(1):rn=hn+rn}}Me.push(rn)}}else{Me=[];for(var ur=0;ur<q.length;ur++)Me.push.apply(Me,iJ(q[ur],!1))}for(var ur=0;ur<Me.length;ur++)for(var b=0;b<g.length;b++){var C=f+Me[ur]+g[b];(!n||K||C)&&a.push(C)}}return a}});var U_t=Ln(Jce=>{"use strict";Object.defineProperty(Jce,"__esModule",{value:!0});Jce.assertValidPattern=void 0;var gun=1024*64,hun=s=>{if(typeof s!="string")throw new TypeError("invalid pattern");if(s.length>gun)throw new TypeError("pattern is too long")};Jce.assertValidPattern=hun});var j_t=Ln($ce=>{"use strict";Object.defineProperty($ce,"__esModule",{value:!0});$ce.parseClass=void 0;var yun={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},oJ=s=>s.replace(/[[\]\\-]/g,"\\$&"),vun=s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),V_t=s=>s.join(""),bun=(s,n)=>{let a=n;if(s.charAt(a)!=="[")throw new Error("not in a brace expression");let u=[],f=[],g=a+1,b=!1,C=!1,k=!1,B=!1,K=a,re="";e:for(;g<s.length;){let Ee=s.charAt(g);if((Ee==="!"||Ee==="^")&&g===a+1){B=!0,g++;continue}if(Ee==="]"&&b&&!k){K=g+1;break}if(b=!0,Ee==="\\"&&!k){k=!0,g++;continue}if(Ee==="["&&!k){for(let[St,[Ot,ft,Gt]]of Object.entries(yun))if(s.startsWith(St,g)){if(re)return["$.",!1,s.length-a,!0];g+=St.length,Gt?f.push(Ot):u.push(Ot),C=C||ft;continue e}}if(k=!1,re){Ee>re?u.push(oJ(re)+"-"+oJ(Ee)):Ee===re&&u.push(oJ(Ee)),re="",g++;continue}if(s.startsWith("-]",g+1)){u.push(oJ(Ee+"-")),g+=2;continue}if(s.startsWith("-",g+1)){re=Ee,g+=2;continue}u.push(oJ(Ee)),g++}if(K<g)return["",!1,0,!1];if(!u.length&&!f.length)return["$.",!1,s.length-a,!0];if(f.length===0&&u.length===1&&/^\\?.$/.test(u[0])&&!B){let Ee=u[0].length===2?u[0].slice(-1):u[0];return[vun(Ee),!1,K-a,!1]}let q="["+(B?"^":"")+V_t(u)+"]",Me="["+(B?"":"^")+V_t(f)+"]";return[u.length&&f.length?"("+q+"|"+Me+")":u.length?q:Me,C,K-a,!0]};$ce.parseClass=bun});var Yce=Ln(Xce=>{"use strict";Object.defineProperty(Xce,"__esModule",{value:!0});Xce.unescape=void 0;var Sun=(s,{windowsPathsNoEscape:n=!1}={})=>n?s.replace(/\[([^\/\\])\]/g,"$1"):s.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");Xce.unescape=Sun});var R8e=Ln(tue=>{"use strict";var ZE;Object.defineProperty(tue,"__esModule",{value:!0});tue.AST=void 0;var Eun=j_t(),Qce=Yce(),xun=new Set(["!","?","+","*","@"]),D8e=s=>xun.has(s),K_t=s=>D8e(s.type),Tun=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),Nun=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),Aun=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),H_t=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),Cun="(?!(?:^|/)\\.\\.?(?:$|/))",Zce="(?!\\.)",Iun=new Set(["[","."]),Dun=new Set(["..","."]),Pun=new Set("().*{}+?[]^$\\!"),Run=s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),P8e="[^/]",q_t=P8e+"*?",J_t=P8e+"+?",eue=class{type;#e;#t;#n=!1;#r=[];#i;#o;#a;#s=!1;#c;#m;#_=!1;constructor(n,a,u={}){this.type=n,n&&(this.#t=!0),this.#i=a,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?u:this.#e.#c,this.#a=this.#e===this?[]:this.#e.#a,n==="!"&&!this.#e.#s&&this.#a.push(this),this.#o=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let n of this.#r)if(typeof n!="string"&&(n.type||n.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#m!==void 0?this.#m:this.type?this.#m=this.type+"("+this.#r.map(n=>String(n)).join("|")+")":this.#m=this.#r.map(n=>String(n)).join("")}#x(){if(this!==this.#e)throw new Error("should only call on root");if(this.#s)return this;this.toString(),this.#s=!0;let n;for(;n=this.#a.pop();){if(n.type!=="!")continue;let a=n,u=a.#i;for(;u;){for(let f=a.#o+1;!u.type&&f<u.#r.length;f++)for(let g of n.#r){if(typeof g=="string")throw new Error("string part in extglob AST??");g.copyIn(u.#r[f])}a=u,u=a.#i}}return this}push(...n){for(let a of n)if(a!==""){if(typeof a!="string"&&!(a instanceof ZE&&a.#i===this))throw new Error("invalid part: "+a);this.#r.push(a)}}toJSON(){let n=this.type===null?this.#r.slice().map(a=>typeof a=="string"?a:a.toJSON()):[this.type,...this.#r.map(a=>a.toJSON())];return this.isStart()&&!this.type&&n.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type==="!")&&n.push({}),n}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#o===0)return!0;let n=this.#i;for(let a=0;a<this.#o;a++){let u=n.#r[a];if(!(u instanceof ZE&&u.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let n=this.#i?this.#i.#r.length:0;return this.#o===n-1}copyIn(n){typeof n=="string"?this.push(n):this.push(n.clone(this))}clone(n){let a=new ZE(this.type,n);for(let u of this.#r)a.copyIn(u);return a}static#S(n,a,u,f,g){let b=f.maxExtglobRecursion??2,C=!1,k=!1,B=-1,K=!1;if(a.type===null){let Ee=u,St="";for(;Ee<n.length;){let Ot=n.charAt(Ee++);if(C||Ot==="\\"){C=!C,St+=Ot;continue}if(k){Ee===B+1?(Ot==="^"||Ot==="!")&&(K=!0):Ot==="]"&&!(Ee===B+2&&K)&&(k=!1),St+=Ot;continue}else if(Ot==="["){k=!0,B=Ee,K=!1,St+=Ot;continue}if(!f.noext&&D8e(Ot)&&n.charAt(Ee)==="("&&g<=b){a.push(St),St="";let Gt=new ZE(Ot,a);Ee=ZE.#S(n,Gt,Ee,f,g+1),a.push(Gt);continue}St+=Ot}return a.push(St),Ee}let re=u+1,q=new ZE(null,a),Me=[],Te="";for(;re<n.length;){let Ee=n.charAt(re++);if(C||Ee==="\\"){C=!C,Te+=Ee;continue}if(k){re===B+1?(Ee==="^"||Ee==="!")&&(K=!0):Ee==="]"&&!(re===B+2&&K)&&(k=!1),Te+=Ee;continue}else if(Ee==="["){k=!0,B=re,K=!1,Te+=Ee;continue}if(D8e(Ee)&&n.charAt(re)==="("&&(g<=b||a&&a.#d(Ee))){let Ot=a&&a.#d(Ee)?0:1;q.push(Te),Te="";let ft=new ZE(Ee,q);q.push(ft),re=ZE.#S(n,ft,re,f,g+Ot);continue}if(Ee==="|"){q.push(Te),Te="",Me.push(q),q=new ZE(null,a);continue}if(Ee===")")return Te===""&&a.#r.length===0&&(a.#_=!0),q.push(Te),Te="",a.push(...Me,q),re;Te+=Ee}return a.type=null,a.#t=void 0,a.#r=[n.substring(u-1)],re}#h(n){return this.#y(n,Nun)}#y(n,a=Tun){if(!n||typeof n!="object"||n.type!==null||n.#r.length!==1||this.type===null)return!1;let u=n.#r[0];return!u||typeof u!="object"||u.type===null?!1:this.#d(u.type,a)}#d(n,a=Aun){return!!a.get(this.type)?.includes(n)}#p(n,a){let u=n.#r[0],f=new ZE(null,u,this.options);f.#r.push(""),u.push(f),this.#g(n,a)}#g(n,a){let u=n.#r[0];this.#r.splice(a,1,...u.#r);for(let f of u.#r)typeof f=="object"&&(f.#i=this);this.#m=void 0}#E(n){return!!H_t.get(this.type)?.has(n)}#f(n){if(!n||typeof n!="object"||n.type!==null||n.#r.length!==1||this.type===null||this.#r.length!==1)return!1;let a=n.#r[0];return!a||typeof a!="object"||a.type===null?!1:this.#E(a.type)}#v(n){let a=H_t.get(this.type),u=n.#r[0],f=a?.get(u.type);if(!f)return!1;this.#r=u.#r;for(let g of this.#r)typeof g=="object"&&(g.#i=this);this.type=f,this.#m=void 0,this.#_=!1}#l(){if(K_t(this)){let n=0,a=!1;do{a=!0;for(let u=0;u<this.#r.length;u++){let f=this.#r[u];typeof f=="object"&&(f.#l(),this.#y(f)?(a=!1,this.#g(f,u)):this.#h(f)?(a=!1,this.#p(f,u)):this.#f(f)&&(a=!1,this.#v(f)))}}while(!a&&++n<10)}else for(let n of this.#r)typeof n=="object"&&n.#l();this.#m=void 0}static fromGlob(n,a={}){let u=new ZE(null,void 0,a);return ZE.#S(n,u,0,a,0),u}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let n=this.toString(),[a,u,f,g]=this.toRegExpSource();if(!(f||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&n.toUpperCase()!==n.toLowerCase()))return u;let C=(this.#c.nocase?"i":"")+(g?"u":"");return Object.assign(new RegExp(`^${a}$`,C),{_src:a,_glob:n})}get options(){return this.#c}toRegExpSource(n){let a=n??!!this.#c.dot;if(this.#e===this&&(this.#l(),this.#x()),!K_t(this)){let k=this.isStart()&&this.isEnd(),B=this.#r.map(Me=>{let[Te,Ee,St,Ot]=typeof Me=="string"?ZE.#T(Me,this.#t,k):Me.toRegExpSource(n);return this.#t=this.#t||St,this.#n=this.#n||Ot,Te}).join(""),K="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&Dun.has(this.#r[0]))){let Te=Iun,Ee=a&&Te.has(B.charAt(0))||B.startsWith("\\.")&&Te.has(B.charAt(2))||B.startsWith("\\.\\.")&&Te.has(B.charAt(4)),St=!a&&!n&&Te.has(B.charAt(0));K=Ee?Cun:St?Zce:""}let re="";return this.isEnd()&&this.#e.#s&&this.#i?.type==="!"&&(re="(?:$|\\/)"),[K+B+re,(0,Qce.unescape)(B),this.#t=!!this.#t,this.#n]}let u=this.type==="*"||this.type==="+",f=this.type==="!"?"(?:(?!(?:":"(?:",g=this.#u(a);if(this.isStart()&&this.isEnd()&&!g&&this.type!=="!"){let k=this.toString(),B=this;return B.#r=[k],B.type=null,B.#t=void 0,[k,(0,Qce.unescape)(this.toString()),!1,!1]}let b=!u||n||a||!Zce?"":this.#u(!0);b===g&&(b=""),b&&(g=`(?:${g})(?:${b})*?`);let C="";if(this.type==="!"&&this.#_)C=(this.isStart()&&!a?Zce:"")+J_t;else{let k=this.type==="!"?"))"+(this.isStart()&&!a&&!n?Zce:"")+q_t+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&b?")":this.type==="*"&&b?")?":`)${this.type}`;C=f+g+k}return[C,(0,Qce.unescape)(g),this.#t=!!this.#t,this.#n]}#u(n){return this.#r.map(a=>{if(typeof a=="string")throw new Error("string type in extglob ast??");let[u,f,g,b]=a.toRegExpSource(n);return this.#n=this.#n||b,u}).filter(a=>!(this.isStart()&&this.isEnd())||!!a).join("|")}static#T(n,a,u=!1){let f=!1,g="",b=!1,C=!1;for(let k=0;k<n.length;k++){let B=n.charAt(k);if(f){f=!1,g+=(Pun.has(B)?"\\":"")+B,C=!1;continue}if(B==="\\"){k===n.length-1?g+="\\\\":f=!0;continue}if(B==="["){let[K,re,q,Me]=(0,Eun.parseClass)(n,k);if(q){g+=K,b=b||re,k+=q-1,a=a||Me,C=!1;continue}}if(B==="*"){if(C)continue;C=!0,g+=u&&/^[*]+$/.test(n)?J_t:q_t,a=!0;continue}else C=!1;if(B==="?"){g+=P8e,a=!0;continue}g+=Run(B)}return[g,(0,Qce.unescape)(n),!!a,b]}};tue.AST=eue;ZE=eue});var L8e=Ln(nue=>{"use strict";Object.defineProperty(nue,"__esModule",{value:!0});nue.escape=void 0;var Lun=(s,{windowsPathsNoEscape:n=!1}={})=>n?s.replace(/[?*()[\]]/g,"[$&]"):s.replace(/[?*()[\]\\]/g,"\\$&");nue.escape=Lun});var tgt=Ln(ks=>{"use strict";var Mun=ks&&ks.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ks,"__esModule",{value:!0});ks.unescape=ks.escape=ks.AST=ks.Minimatch=ks.match=ks.makeRe=ks.braceExpand=ks.defaults=ks.filter=ks.GLOBSTAR=ks.sep=ks.minimatch=void 0;var kun=Mun(z_t()),rue=U_t(),Y_t=R8e(),wun=L8e(),Oun=Yce(),Fun=(s,n,a={})=>((0,rue.assertValidPattern)(n),!a.nocomment&&n.charAt(0)==="#"?!1:new F8(n,a).match(s));ks.minimatch=Fun;var Wun=/^\*+([^+@!?\*\[\(]*)$/,Bun=s=>n=>!n.startsWith(".")&&n.endsWith(s),Gun=s=>n=>n.endsWith(s),zun=s=>(s=s.toLowerCase(),n=>!n.startsWith(".")&&n.toLowerCase().endsWith(s)),Uun=s=>(s=s.toLowerCase(),n=>n.toLowerCase().endsWith(s)),Vun=/^\*+\.\*+$/,jun=s=>!s.startsWith(".")&&s.includes("."),Kun=s=>s!=="."&&s!==".."&&s.includes("."),Hun=/^\.\*+$/,qun=s=>s!=="."&&s!==".."&&s.startsWith("."),Jun=/^\*+$/,$un=s=>s.length!==0&&!s.startsWith("."),Xun=s=>s.length!==0&&s!=="."&&s!=="..",Yun=/^\?+([^+@!?\*\[\(]*)?$/,Qun=([s,n=""])=>{let a=Q_t([s]);return n?(n=n.toLowerCase(),u=>a(u)&&u.toLowerCase().endsWith(n)):a},Zun=([s,n=""])=>{let a=Z_t([s]);return n?(n=n.toLowerCase(),u=>a(u)&&u.toLowerCase().endsWith(n)):a},edn=([s,n=""])=>{let a=Z_t([s]);return n?u=>a(u)&&u.endsWith(n):a},tdn=([s,n=""])=>{let a=Q_t([s]);return n?u=>a(u)&&u.endsWith(n):a},Q_t=([s])=>{let n=s.length;return a=>a.length===n&&!a.startsWith(".")},Z_t=([s])=>{let n=s.length;return a=>a.length===n&&a!=="."&&a!==".."},egt=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",$_t={win32:{sep:"\\"},posix:{sep:"/"}};ks.sep=egt==="win32"?$_t.win32.sep:$_t.posix.sep;ks.minimatch.sep=ks.sep;ks.GLOBSTAR=Symbol("globstar **");ks.minimatch.GLOBSTAR=ks.GLOBSTAR;var ndn="[^/]",rdn=ndn+"*?",idn="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",odn="(?:(?!(?:\\/|^)\\.).)*?",adn=(s,n={})=>a=>(0,ks.minimatch)(a,s,n);ks.filter=adn;ks.minimatch.filter=ks.filter;var IN=(s,n={})=>Object.assign({},s,n),sdn=s=>{if(!s||typeof s!="object"||!Object.keys(s).length)return ks.minimatch;let n=ks.minimatch;return Object.assign((u,f,g={})=>n(u,f,IN(s,g)),{Minimatch:class extends n.Minimatch{constructor(f,g={}){super(f,IN(s,g))}static defaults(f){return n.defaults(IN(s,f)).Minimatch}},AST:class extends n.AST{constructor(f,g,b={}){super(f,g,IN(s,b))}static fromGlob(f,g={}){return n.AST.fromGlob(f,IN(s,g))}},unescape:(u,f={})=>n.unescape(u,IN(s,f)),escape:(u,f={})=>n.escape(u,IN(s,f)),filter:(u,f={})=>n.filter(u,IN(s,f)),defaults:u=>n.defaults(IN(s,u)),makeRe:(u,f={})=>n.makeRe(u,IN(s,f)),braceExpand:(u,f={})=>n.braceExpand(u,IN(s,f)),match:(u,f,g={})=>n.match(u,f,IN(s,g)),sep:n.sep,GLOBSTAR:ks.GLOBSTAR})};ks.defaults=sdn;ks.minimatch.defaults=ks.defaults;var ldn=(s,n={})=>((0,rue.assertValidPattern)(s),n.nobrace||!/\{(?:(?!\{).)*\}/.test(s)?[s]:(0,kun.default)(s));ks.braceExpand=ldn;ks.minimatch.braceExpand=ks.braceExpand;var cdn=(s,n={})=>new F8(s,n).makeRe();ks.makeRe=cdn;ks.minimatch.makeRe=ks.makeRe;var udn=(s,n,a={})=>{let u=new F8(n,a);return s=s.filter(f=>u.match(f)),u.options.nonull&&!s.length&&s.push(n),s};ks.match=udn;ks.minimatch.match=ks.match;var X_t=/[?*]|[+@!]\(.*?\)|\[|\]/,ddn=s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),F8=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(n,a={}){(0,rue.assertValidPattern)(n),a=a||{},this.options=a,this.maxGlobstarRecursion=a.maxGlobstarRecursion??200,this.pattern=n,this.platform=a.platform||egt,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!a.windowsPathsNoEscape||a.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!a.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!a.nonegate,this.comment=!1,this.empty=!1,this.partial=!!a.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=a.windowsNoMagicRoot!==void 0?a.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let n of this.set)for(let a of n)if(typeof a!="string")return!0;return!1}debug(...n){}make(){let n=this.pattern,a=this.options;if(!a.nocomment&&n.charAt(0)==="#"){this.comment=!0;return}if(!n){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],a.debug&&(this.debug=(...g)=>console.error(...g)),this.debug(this.pattern,this.globSet);let u=this.globSet.map(g=>this.slashSplit(g));this.globParts=this.preprocess(u),this.debug(this.pattern,this.globParts);let f=this.globParts.map((g,b,C)=>{if(this.isWindows&&this.windowsNoMagicRoot){let k=g[0]===""&&g[1]===""&&(g[2]==="?"||!X_t.test(g[2]))&&!X_t.test(g[3]),B=/^[a-z]:/i.test(g[0]);if(k)return[...g.slice(0,4),...g.slice(4).map(K=>this.parse(K))];if(B)return[g[0],...g.slice(1).map(K=>this.parse(K))]}return g.map(k=>this.parse(k))});if(this.debug(this.pattern,f),this.set=f.filter(g=>g.indexOf(!1)===-1),this.isWindows)for(let g=0;g<this.set.length;g++){let b=this.set[g];b[0]===""&&b[1]===""&&this.globParts[g][2]==="?"&&typeof b[3]=="string"&&/^[a-z]:$/i.test(b[3])&&(b[2]="?")}this.debug(this.pattern,this.set)}preprocess(n){if(this.options.noglobstar)for(let u=0;u<n.length;u++)for(let f=0;f<n[u].length;f++)n[u][f]==="**"&&(n[u][f]="*");let{optimizationLevel:a=1}=this.options;return a>=2?(n=this.firstPhasePreProcess(n),n=this.secondPhasePreProcess(n)):a>=1?n=this.levelOneOptimize(n):n=this.adjascentGlobstarOptimize(n),n}adjascentGlobstarOptimize(n){return n.map(a=>{let u=-1;for(;(u=a.indexOf("**",u+1))!==-1;){let f=u;for(;a[f+1]==="**";)f++;f!==u&&a.splice(u,f-u)}return a})}levelOneOptimize(n){return n.map(a=>(a=a.reduce((u,f)=>{let g=u[u.length-1];return f==="**"&&g==="**"?u:f===".."&&g&&g!==".."&&g!=="."&&g!=="**"?(u.pop(),u):(u.push(f),u)},[]),a.length===0?[""]:a))}levelTwoFileOptimize(n){Array.isArray(n)||(n=this.slashSplit(n));let a=!1;do{if(a=!1,!this.preserveMultipleSlashes){for(let f=1;f<n.length-1;f++){let g=n[f];f===1&&g===""&&n[0]===""||(g==="."||g==="")&&(a=!0,n.splice(f,1),f--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(a=!0,n.pop())}let u=0;for(;(u=n.indexOf("..",u+1))!==-1;){let f=n[u-1];f&&f!=="."&&f!==".."&&f!=="**"&&(a=!0,n.splice(u-1,2),u-=2)}}while(a);return n.length===0?[""]:n}firstPhasePreProcess(n){let a=!1;do{a=!1;for(let u of n){let f=-1;for(;(f=u.indexOf("**",f+1))!==-1;){let b=f;for(;u[b+1]==="**";)b++;b>f&&u.splice(f+1,b-f);let C=u[f+1],k=u[f+2],B=u[f+3];if(C!==".."||!k||k==="."||k===".."||!B||B==="."||B==="..")continue;a=!0,u.splice(f,1);let K=u.slice(0);K[f]="**",n.push(K),f--}if(!this.preserveMultipleSlashes){for(let b=1;b<u.length-1;b++){let C=u[b];b===1&&C===""&&u[0]===""||(C==="."||C==="")&&(a=!0,u.splice(b,1),b--)}u[0]==="."&&u.length===2&&(u[1]==="."||u[1]==="")&&(a=!0,u.pop())}let g=0;for(;(g=u.indexOf("..",g+1))!==-1;){let b=u[g-1];if(b&&b!=="."&&b!==".."&&b!=="**"){a=!0;let k=g===1&&u[g+1]==="**"?["."]:[];u.splice(g-1,2,...k),u.length===0&&u.push(""),g-=2}}}}while(a);return n}secondPhasePreProcess(n){for(let a=0;a<n.length-1;a++)for(let u=a+1;u<n.length;u++){let f=this.partsMatch(n[a],n[u],!this.preserveMultipleSlashes);if(f){n[a]=[],n[u]=f;break}}return n.filter(a=>a.length)}partsMatch(n,a,u=!1){let f=0,g=0,b=[],C="";for(;f<n.length&&g<a.length;)if(n[f]===a[g])b.push(C==="b"?a[g]:n[f]),f++,g++;else if(u&&n[f]==="**"&&a[g]===n[f+1])b.push(n[f]),f++;else if(u&&a[g]==="**"&&n[f]===a[g+1])b.push(a[g]),g++;else if(n[f]==="*"&&a[g]&&(this.options.dot||!a[g].startsWith("."))&&a[g]!=="**"){if(C==="b")return!1;C="a",b.push(n[f]),f++,g++}else if(a[g]==="*"&&n[f]&&(this.options.dot||!n[f].startsWith("."))&&n[f]!=="**"){if(C==="a")return!1;C="b",b.push(a[g]),f++,g++}else return!1;return n.length===a.length&&b}parseNegate(){if(this.nonegate)return;let n=this.pattern,a=!1,u=0;for(let f=0;f<n.length&&n.charAt(f)==="!";f++)a=!a,u++;u&&(this.pattern=n.slice(u)),this.negate=a}matchOne(n,a,u=!1){let f=0,g=0;if(this.isWindows){let C=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),k=!C&&n[0]===""&&n[1]===""&&n[2]==="?"&&/^[a-z]:$/i.test(n[3]),B=typeof a[0]=="string"&&/^[a-z]:$/i.test(a[0]),K=!B&&a[0]===""&&a[1]===""&&a[2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3]),re=k?3:C?0:void 0,q=K?3:B?0:void 0;if(typeof re=="number"&&typeof q=="number"){let[Me,Te]=[n[re],a[q]];Me.toLowerCase()===Te.toLowerCase()&&(a[q]=Me,g=q,f=re)}}let{optimizationLevel:b=1}=this.options;return b>=2&&(n=this.levelTwoFileOptimize(n)),a.includes(ks.GLOBSTAR)?this.#e(n,a,u,f,g):this.#n(n,a,u,f,g)}#e(n,a,u,f,g){let b=a.indexOf(ks.GLOBSTAR,g),C=a.lastIndexOf(ks.GLOBSTAR),[k,B,K]=u?[a.slice(g,b),a.slice(b+1),[]]:[a.slice(g,b),a.slice(b+1,C),a.slice(C+1)];if(k.length){let ft=n.slice(f,f+k.length);if(!this.#n(ft,k,u,0,0))return!1;f+=k.length}let re=0;if(K.length){if(K.length+f>n.length)return!1;let ft=n.length-K.length;if(this.#n(n,K,u,ft,0))re=K.length;else{if(n[n.length-1]!==""||f+K.length===n.length||(ft--,!this.#n(n,K,u,ft,0)))return!1;re=K.length+1}}if(!B.length){let ft=!!re;for(let Gt=f;Gt<n.length-re;Gt++){let En=String(n[Gt]);if(ft=!0,En==="."||En===".."||!this.options.dot&&En.startsWith("."))return!1}return u||ft}let q=[[[],0]],Me=q[0],Te=0,Ee=[0];for(let ft of B)ft===ks.GLOBSTAR?(Ee.push(Te),Me=[[],0],q.push(Me)):(Me[0].push(ft),Te++);let St=q.length-1,Ot=n.length-re;for(let ft of q)ft[1]=Ot-(Ee[St--]+ft[0].length);return!!this.#t(n,q,f,0,u,0,!!re)}#t(n,a,u,f,g,b,C){let k=a[f];if(!k){for(let re=u;re<n.length;re++){C=!0;let q=n[re];if(q==="."||q===".."||!this.options.dot&&q.startsWith("."))return!1}return C}let[B,K]=k;for(;u<=K;){if(this.#n(n.slice(0,u+B.length),B,g,u,0)&&b<this.maxGlobstarRecursion){let Me=this.#t(n,a,u+B.length,f+1,g,b+1,C);if(Me!==!1)return Me}let q=n[u];if(q==="."||q===".."||!this.options.dot&&q.startsWith("."))return!1;u++}return g||null}#n(n,a,u,f,g){let b,C,k,B;for(b=f,C=g,B=n.length,k=a.length;b<B&&C<k;b++,C++){this.debug("matchOne loop");let K=a[C],re=n[b];if(this.debug(a,K,re),K===!1||K===ks.GLOBSTAR)return!1;let q;if(typeof K=="string"?(q=re===K,this.debug("string match",K,re,q)):(q=K.test(re),this.debug("pattern match",K,re,q)),!q)return!1}if(b===B&&C===k)return!0;if(b===B)return u;if(C===k)return b===B-1&&n[b]==="";throw new Error("wtf?")}braceExpand(){return(0,ks.braceExpand)(this.pattern,this.options)}parse(n){(0,rue.assertValidPattern)(n);let a=this.options;if(n==="**")return ks.GLOBSTAR;if(n==="")return"";let u,f=null;(u=n.match(Jun))?f=a.dot?Xun:$un:(u=n.match(Wun))?f=(a.nocase?a.dot?Uun:zun:a.dot?Gun:Bun)(u[1]):(u=n.match(Yun))?f=(a.nocase?a.dot?Zun:Qun:a.dot?edn:tdn)(u):(u=n.match(Vun))?f=a.dot?Kun:jun:(u=n.match(Hun))&&(f=qun);let g=Y_t.AST.fromGlob(n,this.options).toMMPattern();return f&&typeof g=="object"&&Reflect.defineProperty(g,"test",{value:f}),g}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let n=this.set;if(!n.length)return this.regexp=!1,this.regexp;let a=this.options,u=a.noglobstar?rdn:a.dot?idn:odn,f=new Set(a.nocase?["i"]:[]),g=n.map(k=>{let B=k.map(K=>{if(K instanceof RegExp)for(let re of K.flags.split(""))f.add(re);return typeof K=="string"?ddn(K):K===ks.GLOBSTAR?ks.GLOBSTAR:K._src});return B.forEach((K,re)=>{let q=B[re+1],Me=B[re-1];K!==ks.GLOBSTAR||Me===ks.GLOBSTAR||(Me===void 0?q!==void 0&&q!==ks.GLOBSTAR?B[re+1]="(?:\\/|"+u+"\\/)?"+q:B[re]=u:q===void 0?B[re-1]=Me+"(?:\\/|"+u+")?":q!==ks.GLOBSTAR&&(B[re-1]=Me+"(?:\\/|\\/"+u+"\\/)"+q,B[re+1]=ks.GLOBSTAR))}),B.filter(K=>K!==ks.GLOBSTAR).join("/")}).join("|"),[b,C]=n.length>1?["(?:",")"]:["",""];g="^"+b+g+C+"$",this.negate&&(g="^(?!"+g+").+$");try{this.regexp=new RegExp(g,[...f].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(n){return this.preserveMultipleSlashes?n.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(n)?["",...n.split(/\/+/)]:n.split(/\/+/)}match(n,a=this.partial){if(this.debug("match",n,this.pattern),this.comment)return!1;if(this.empty)return n==="";if(n==="/"&&a)return!0;let u=this.options;this.isWindows&&(n=n.split("\\").join("/"));let f=this.slashSplit(n);this.debug(this.pattern,"split",f);let g=this.set;this.debug(this.pattern,"set",g);let b=f[f.length-1];if(!b)for(let C=f.length-2;!b&&C>=0;C--)b=f[C];for(let C=0;C<g.length;C++){let k=g[C],B=f;if(u.matchBase&&k.length===1&&(B=[b]),this.matchOne(B,k,a))return u.flipNegate?!0:!this.negate}return u.flipNegate?!1:this.negate}static defaults(n){return ks.minimatch.defaults(n).Minimatch}};ks.Minimatch=F8;var pdn=R8e();Object.defineProperty(ks,"AST",{enumerable:!0,get:function(){return pdn.AST}});var fdn=L8e();Object.defineProperty(ks,"escape",{enumerable:!0,get:function(){return fdn.escape}});var mdn=Yce();Object.defineProperty(ks,"unescape",{enumerable:!0,get:function(){return mdn.unescape}});ks.minimatch.AST=Y_t.AST;ks.minimatch.Minimatch=F8;ks.minimatch.escape=wun.escape;ks.minimatch.unescape=Oun.unescape});var aJ=Ln((bPn,agt)=>{"use strict";var ngt="[^\\\\/]",_dn="(?=.)",rgt="[^/]",M8e="(?:\\/|$)",igt="(?:^|\\/)",k8e=`\\.{1,2}${M8e}`,gdn="(?!\\.)",hdn=`(?!${igt}${k8e})`,ydn=`(?!\\.{0,1}${M8e})`,vdn=`(?!${k8e})`,bdn="[^.\\/]",Sdn=`${rgt}*?`,Edn="/",ogt={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:_dn,QMARK:rgt,END_ANCHOR:M8e,DOTS_SLASH:k8e,NO_DOT:gdn,NO_DOTS:hdn,NO_DOT_SLASH:ydn,NO_DOTS_SLASH:vdn,QMARK_NO_DOT:bdn,STAR:Sdn,START_ANCHOR:igt,SEP:Edn},xdn={...ogt,SLASH_LITERAL:"[\\\\/]",QMARK:ngt,STAR:`${ngt}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},Tdn={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};agt.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Tdn,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(s){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${s.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(s){return s===!0?xdn:ogt}}});var sJ=Ln(e0=>{"use strict";var{REGEX_BACKSLASH:Ndn,REGEX_REMOVE_BACKSLASH:Adn,REGEX_SPECIAL_CHARS:Cdn,REGEX_SPECIAL_CHARS_GLOBAL:Idn}=aJ();e0.isObject=s=>s!==null&&typeof s=="object"&&!Array.isArray(s);e0.hasRegexChars=s=>Cdn.test(s);e0.isRegexChar=s=>s.length===1&&e0.hasRegexChars(s);e0.escapeRegex=s=>s.replace(Idn,"\\$1");e0.toPosixSlashes=s=>s.replace(Ndn,"/");e0.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let s=navigator.platform.toLowerCase();return s==="win32"||s==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};e0.removeBackslashes=s=>s.replace(Adn,n=>n==="\\"?"":n);e0.escapeLast=(s,n,a)=>{let u=s.lastIndexOf(n,a);return u===-1?s:s[u-1]==="\\"?e0.escapeLast(s,n,u-1):`${s.slice(0,u)}\\${s.slice(u)}`};e0.removePrefix=(s,n={})=>{let a=s;return a.startsWith("./")&&(a=a.slice(2),n.prefix="./"),a};e0.wrapOutput=(s,n={},a={})=>{let u=a.contains?"":"^",f=a.contains?"":"$",g=`${u}(?:${s})${f}`;return n.negated===!0&&(g=`(?:^(?!${g}).*$)`),g};e0.basename=(s,{windows:n}={})=>{let a=s.split(n?/[\\/]/:"/"),u=a[a.length-1];return u===""?a[a.length-2]:u}});var mgt=Ln((EPn,fgt)=>{"use strict";var sgt=sJ(),{CHAR_ASTERISK:w8e,CHAR_AT:Ddn,CHAR_BACKWARD_SLASH:lJ,CHAR_COMMA:Pdn,CHAR_DOT:O8e,CHAR_EXCLAMATION_MARK:F8e,CHAR_FORWARD_SLASH:pgt,CHAR_LEFT_CURLY_BRACE:W8e,CHAR_LEFT_PARENTHESES:B8e,CHAR_LEFT_SQUARE_BRACKET:Rdn,CHAR_PLUS:Ldn,CHAR_QUESTION_MARK:lgt,CHAR_RIGHT_CURLY_BRACE:Mdn,CHAR_RIGHT_PARENTHESES:cgt,CHAR_RIGHT_SQUARE_BRACKET:kdn}=aJ(),ugt=s=>s===pgt||s===lJ,dgt=s=>{s.isPrefix!==!0&&(s.depth=s.isGlobstar?1/0:1)},wdn=(s,n)=>{let a=n||{},u=s.length-1,f=a.parts===!0||a.scanToEnd===!0,g=[],b=[],C=[],k=s,B=-1,K=0,re=0,q=!1,Me=!1,Te=!1,Ee=!1,St=!1,Ot=!1,ft=!1,Gt=!1,En=!1,vr=!1,rn=0,Ht,hn,ur={value:"",depth:0,isGlob:!1},br=()=>B>=u,Cn=()=>k.charCodeAt(B+1),Bo=()=>(Ht=hn,k.charCodeAt(++B));for(;B<u;){hn=Bo();let gn;if(hn===lJ){ft=ur.backslashes=!0,hn=Bo(),hn===W8e&&(Ot=!0);continue}if(Ot===!0||hn===W8e){for(rn++;br()!==!0&&(hn=Bo());){if(hn===lJ){ft=ur.backslashes=!0,Bo();continue}if(hn===W8e){rn++;continue}if(Ot!==!0&&hn===O8e&&(hn=Bo())===O8e){if(q=ur.isBrace=!0,Te=ur.isGlob=!0,vr=!0,f===!0)continue;break}if(Ot!==!0&&hn===Pdn){if(q=ur.isBrace=!0,Te=ur.isGlob=!0,vr=!0,f===!0)continue;break}if(hn===Mdn&&(rn--,rn===0)){Ot=!1,q=ur.isBrace=!0,vr=!0;break}}if(f===!0)continue;break}if(hn===pgt){if(g.push(B),b.push(ur),ur={value:"",depth:0,isGlob:!1},vr===!0)continue;if(Ht===O8e&&B===K+1){K+=2;continue}re=B+1;continue}if(a.noext!==!0&&(hn===Ldn||hn===Ddn||hn===w8e||hn===lgt||hn===F8e)===!0&&Cn()===B8e){if(Te=ur.isGlob=!0,Ee=ur.isExtglob=!0,vr=!0,hn===F8e&&B===K&&(En=!0),f===!0){for(;br()!==!0&&(hn=Bo());){if(hn===lJ){ft=ur.backslashes=!0,hn=Bo();continue}if(hn===cgt){Te=ur.isGlob=!0,vr=!0;break}}continue}break}if(hn===w8e){if(Ht===w8e&&(St=ur.isGlobstar=!0),Te=ur.isGlob=!0,vr=!0,f===!0)continue;break}if(hn===lgt){if(Te=ur.isGlob=!0,vr=!0,f===!0)continue;break}if(hn===Rdn){for(;br()!==!0&&(gn=Bo());){if(gn===lJ){ft=ur.backslashes=!0,Bo();continue}if(gn===kdn){Me=ur.isBracket=!0,Te=ur.isGlob=!0,vr=!0;break}}if(f===!0)continue;break}if(a.nonegate!==!0&&hn===F8e&&B===K){Gt=ur.negated=!0,K++;continue}if(a.noparen!==!0&&hn===B8e){if(Te=ur.isGlob=!0,f===!0){for(;br()!==!0&&(hn=Bo());){if(hn===B8e){ft=ur.backslashes=!0,hn=Bo();continue}if(hn===cgt){vr=!0;break}}continue}break}if(Te===!0){if(vr=!0,f===!0)continue;break}}a.noext===!0&&(Ee=!1,Te=!1);let Fa=k,pn="",Mn="";K>0&&(pn=k.slice(0,K),k=k.slice(K),re-=K),Fa&&Te===!0&&re>0?(Fa=k.slice(0,re),Mn=k.slice(re)):Te===!0?(Fa="",Mn=k):Fa=k,Fa&&Fa!==""&&Fa!=="/"&&Fa!==k&&ugt(Fa.charCodeAt(Fa.length-1))&&(Fa=Fa.slice(0,-1)),a.unescape===!0&&(Mn&&(Mn=sgt.removeBackslashes(Mn)),Fa&&ft===!0&&(Fa=sgt.removeBackslashes(Fa)));let si={prefix:pn,input:s,start:K,base:Fa,glob:Mn,isBrace:q,isBracket:Me,isGlob:Te,isExtglob:Ee,isGlobstar:St,negated:Gt,negatedExtglob:En};if(a.tokens===!0&&(si.maxDepth=0,ugt(hn)||b.push(ur),si.tokens=b),a.parts===!0||a.tokens===!0){let gn;for(let ms=0;ms<g.length;ms++){let Ds=gn?gn+1:K,Sl=g[ms],Fo=s.slice(Ds,Sl);a.tokens&&(ms===0&&K!==0?(b[ms].isPrefix=!0,b[ms].value=pn):b[ms].value=Fo,dgt(b[ms]),si.maxDepth+=b[ms].depth),(ms!==0||Fo!=="")&&C.push(Fo),gn=Sl}if(gn&&gn+1<s.length){let ms=s.slice(gn+1);C.push(ms),a.tokens&&(b[b.length-1].value=ms,dgt(b[b.length-1]),si.maxDepth+=b[b.length-1].depth)}si.slashes=g,si.parts=C}return si};fgt.exports=wdn});var vgt=Ln((xPn,ygt)=>{"use strict";var cJ=aJ(),Bx=sJ(),{MAX_LENGTH:iue,POSIX_REGEX_SOURCE:Odn,REGEX_NON_SPECIAL_CHARS:Fdn,REGEX_SPECIAL_CHARS_BACKREF:Wdn,REPLACEMENTS:_gt}=cJ,Bdn=(s,n)=>{if(typeof n.expandRange=="function")return n.expandRange(...s,n);s.sort();let a=`[${s.join("-")}]`;try{new RegExp(a)}catch{return s.map(f=>Bx.escapeRegex(f)).join("..")}return a},uG=(s,n)=>`Missing ${s}: "${n}" - use "\\\\${n}" to match literal characters`,ggt=s=>{let n=[],a=0,u=0,f=0,g="",b=!1;for(let C of s){if(b===!0){g+=C,b=!1;continue}if(C==="\\"){g+=C,b=!0;continue}if(C==='"'){f=f===1?0:1,g+=C;continue}if(f===0){if(C==="[")a++;else if(C==="]"&&a>0)a--;else if(a===0){if(C==="(")u++;else if(C===")"&&u>0)u--;else if(C==="|"&&u===0){n.push(g),g="";continue}}}g+=C}return n.push(g),n},Gdn=s=>{let n=!1;for(let a of s){if(n===!0){n=!1;continue}if(a==="\\"){n=!0;continue}if(/[?*+@!()[\]{}]/.test(a))return!1}return!0},hgt=s=>{let n=s.trim(),a=!0;for(;a===!0;)a=!1,/^@\([^\\()[\]{}|]+\)$/.test(n)&&(n=n.slice(2,-1),a=!0);if(Gdn(n))return n.replace(/\\(.)/g,"$1")},zdn=s=>{let n=s.map(hgt).filter(Boolean);for(let a=0;a<n.length;a++)for(let u=a+1;u<n.length;u++){let f=n[a],g=n[u],b=f[0];if(!(!b||f!==b.repeat(f.length)||g!==b.repeat(g.length))&&(f===g||f.startsWith(g)||g.startsWith(f)))return!0}return!1},G8e=(s,n=!0)=>{if(s[0]!=="+"&&s[0]!=="*"||s[1]!=="(")return;let a=0,u=0,f=0,g=!1;for(let b=1;b<s.length;b++){let C=s[b];if(g===!0){g=!1;continue}if(C==="\\"){g=!0;continue}if(C==='"'){f=f===1?0:1;continue}if(f!==1){if(C==="["){a++;continue}if(C==="]"&&a>0){a--;continue}if(!(a>0)){if(C==="("){u++;continue}if(C===")"&&(u--,u===0))return n===!0&&b!==s.length-1?void 0:{type:s[0],body:s.slice(2,b),end:b}}}}},Udn=s=>{let n=0,a=[];for(;n<s.length;){let f=G8e(s.slice(n),!1);if(!f||f.type!=="*")return;let g=ggt(f.body).map(C=>C.trim());if(g.length!==1)return;let b=hgt(g[0]);if(!b||b.length!==1)return;a.push(b),n+=f.end+1}return a.length<1?void 0:`${a.length===1?Bx.escapeRegex(a[0]):`[${a.map(f=>Bx.escapeRegex(f)).join("")}]`}*`},Vdn=s=>{let n=0,a=s.trim(),u=G8e(a);for(;u;)n++,a=u.body.trim(),u=G8e(a);return n},jdn=(s,n)=>{if(n.maxExtglobRecursion===!1)return{risky:!1};let a=typeof n.maxExtglobRecursion=="number"?n.maxExtglobRecursion:cJ.DEFAULT_MAX_EXTGLOB_RECURSION,u=ggt(s).map(f=>f.trim());if(u.length>1&&(u.some(f=>f==="")||u.some(f=>/^[*?]+$/.test(f))||zdn(u)))return{risky:!0};for(let f of u){let g=Udn(f);if(g)return{risky:!0,safeOutput:g};if(Vdn(f)>a)return{risky:!0}}return{risky:!1}},z8e=(s,n)=>{if(typeof s!="string")throw new TypeError("Expected a string");s=_gt[s]||s;let a={...n},u=typeof a.maxLength=="number"?Math.min(iue,a.maxLength):iue,f=s.length;if(f>u)throw new SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${u}`);let g={type:"bos",value:"",output:a.prepend||""},b=[g],C=a.capture?"":"?:",k=cJ.globChars(a.windows),B=cJ.extglobChars(k),{DOT_LITERAL:K,PLUS_LITERAL:re,SLASH_LITERAL:q,ONE_CHAR:Me,DOTS_SLASH:Te,NO_DOT:Ee,NO_DOT_SLASH:St,NO_DOTS_SLASH:Ot,QMARK:ft,QMARK_NO_DOT:Gt,STAR:En,START_ANCHOR:vr}=k,rn=na=>`(${C}(?:(?!${vr}${na.dot?Te:K}).)*?)`,Ht=a.dot?"":Ee,hn=a.dot?ft:Gt,ur=a.bash===!0?rn(a):En;a.capture&&(ur=`(${ur})`),typeof a.noext=="boolean"&&(a.noextglob=a.noext);let br={input:s,index:-1,start:0,dot:a.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:b};s=Bx.removePrefix(s,br),f=s.length;let Cn=[],Bo=[],Fa=[],pn=g,Mn,si=()=>br.index===f-1,gn=br.peek=(na=1)=>s[br.index+na],ms=br.advance=()=>s[++br.index]||"",Ds=()=>s.slice(br.index+1),Sl=(na="",Ji=0)=>{br.consumed+=na,br.index+=Ji},Fo=na=>{br.output+=na.output!=null?na.output:na.value,Sl(na.value)},gg=()=>{let na=1;for(;gn()==="!"&&(gn(2)!=="("||gn(3)==="?");)ms(),br.start++,na++;return na%2===0?!1:(br.negated=!0,br.start++,!0)},jb=na=>{br[na]++,Fa.push(na)},k_=na=>{br[na]--,Fa.pop()},dl=na=>{if(pn.type==="globstar"){let Ji=br.braces>0&&(na.type==="comma"||na.type==="brace"),go=na.extglob===!0||Cn.length&&(na.type==="pipe"||na.type==="paren");na.type!=="slash"&&na.type!=="paren"&&!Ji&&!go&&(br.output=br.output.slice(0,-pn.output.length),pn.type="star",pn.value="*",pn.output=ur,br.output+=pn.output)}if(Cn.length&&na.type!=="paren"&&(Cn[Cn.length-1].inner+=na.value),(na.value||na.output)&&Fo(na),pn&&pn.type==="text"&&na.type==="text"){pn.output=(pn.output||pn.value)+na.value,pn.value+=na.value;return}na.prev=pn,b.push(na),pn=na},pi=(na,Ji)=>{let go={...B[Ji],conditions:1,inner:""};go.prev=pn,go.parens=br.parens,go.output=br.output,go.startIndex=br.index,go.tokensIndex=b.length;let Ki=(a.capture?"(":"")+go.open;jb("parens"),dl({type:na,value:Ji,output:br.output?"":Me}),dl({type:"paren",extglob:!0,value:ms(),output:Ki}),Cn.push(go)},km=na=>{let Ji=s.slice(na.startIndex,br.index+1),go=s.slice(na.startIndex+2,br.index),Ki=jdn(go,a);if((na.type==="plus"||na.type==="star")&&Ki.risky){let gl=Ki.safeOutput?(na.output?"":Me)+(a.capture?`(${Ki.safeOutput})`:Ki.safeOutput):void 0,Ai=b[na.tokensIndex];Ai.type="text",Ai.value=Ji,Ai.output=gl||Bx.escapeRegex(Ji);for(let _f=na.tokensIndex+1;_f<b.length;_f++)b[_f].value="",b[_f].output="",delete b[_f].suffix;br.output=na.output+Ai.output,br.backtrack=!0,dl({type:"paren",extglob:!0,value:Mn,output:""}),k_("parens");return}let wa=na.close+(a.capture?")":""),ht;if(na.type==="negate"){let gl=ur;if(na.inner&&na.inner.length>1&&na.inner.includes("/")&&(gl=rn(a)),(gl!==ur||si()||/^\)+$/.test(Ds()))&&(wa=na.close=`)$))${gl}`),na.inner.includes("*")&&(ht=Ds())&&/^\.[^\\/.]+$/.test(ht)){let Ai=z8e(ht,{...n,fastpaths:!1}).output;wa=na.close=`)${Ai})${gl})`}na.prev.type==="bos"&&(br.negatedExtglob=!0)}dl({type:"paren",extglob:!0,value:Mn,output:wa}),k_("parens")};if(a.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(s)){let na=!1,Ji=s.replace(Wdn,(go,Ki,wa,ht,gl,Ai)=>ht==="\\"?(na=!0,go):ht==="?"?Ki?Ki+ht+(gl?ft.repeat(gl.length):""):Ai===0?hn+(gl?ft.repeat(gl.length):""):ft.repeat(wa.length):ht==="."?K.repeat(wa.length):ht==="*"?Ki?Ki+ht+(gl?ur:""):ur:Ki?go:`\\${go}`);return na===!0&&(a.unescape===!0?Ji=Ji.replace(/\\/g,""):Ji=Ji.replace(/\\+/g,go=>go.length%2===0?"\\\\":go?"\\":"")),Ji===s&&a.contains===!0?(br.output=s,br):(br.output=Bx.wrapOutput(Ji,br,n),br)}for(;!si();){if(Mn=ms(),Mn==="\0")continue;if(Mn==="\\"){let go=gn();if(go==="/"&&a.bash!==!0||go==="."||go===";")continue;if(!go){Mn+="\\",dl({type:"text",value:Mn});continue}let Ki=/^\\+/.exec(Ds()),wa=0;if(Ki&&Ki[0].length>2&&(wa=Ki[0].length,br.index+=wa,wa%2!==0&&(Mn+="\\")),a.unescape===!0?Mn=ms():Mn+=ms(),br.brackets===0){dl({type:"text",value:Mn});continue}}if(br.brackets>0&&(Mn!=="]"||pn.value==="["||pn.value==="[^")){if(a.posix!==!1&&Mn===":"){let go=pn.value.slice(1);if(go.includes("[")&&(pn.posix=!0,go.includes(":"))){let Ki=pn.value.lastIndexOf("["),wa=pn.value.slice(0,Ki),ht=pn.value.slice(Ki+2),gl=Odn[ht];if(gl){pn.value=wa+gl,br.backtrack=!0,ms(),!g.output&&b.indexOf(pn)===1&&(g.output=Me);continue}}}(Mn==="["&&gn()!==":"||Mn==="-"&&gn()==="]")&&(Mn=`\\${Mn}`),Mn==="]"&&(pn.value==="["||pn.value==="[^")&&(Mn=`\\${Mn}`),a.posix===!0&&Mn==="!"&&pn.value==="["&&(Mn="^"),pn.value+=Mn,Fo({value:Mn});continue}if(br.quotes===1&&Mn!=='"'){Mn=Bx.escapeRegex(Mn),pn.value+=Mn,Fo({value:Mn});continue}if(Mn==='"'){br.quotes=br.quotes===1?0:1,a.keepQuotes===!0&&dl({type:"text",value:Mn});continue}if(Mn==="("){jb("parens"),dl({type:"paren",value:Mn});continue}if(Mn===")"){if(br.parens===0&&a.strictBrackets===!0)throw new SyntaxError(uG("opening","("));let go=Cn[Cn.length-1];if(go&&br.parens===go.parens+1){km(Cn.pop());continue}dl({type:"paren",value:Mn,output:br.parens?")":"\\)"}),k_("parens");continue}if(Mn==="["){if(a.nobracket===!0||!Ds().includes("]")){if(a.nobracket!==!0&&a.strictBrackets===!0)throw new SyntaxError(uG("closing","]"));Mn=`\\${Mn}`}else jb("brackets");dl({type:"bracket",value:Mn});continue}if(Mn==="]"){if(a.nobracket===!0||pn&&pn.type==="bracket"&&pn.value.length===1){dl({type:"text",value:Mn,output:`\\${Mn}`});continue}if(br.brackets===0){if(a.strictBrackets===!0)throw new SyntaxError(uG("opening","["));dl({type:"text",value:Mn,output:`\\${Mn}`});continue}k_("brackets");let go=pn.value.slice(1);if(pn.posix!==!0&&go[0]==="^"&&!go.includes("/")&&(Mn=`/${Mn}`),pn.value+=Mn,Fo({value:Mn}),a.literalBrackets===!1||Bx.hasRegexChars(go))continue;let Ki=Bx.escapeRegex(pn.value);if(br.output=br.output.slice(0,-pn.value.length),a.literalBrackets===!0){br.output+=Ki,pn.value=Ki;continue}pn.value=`(${C}${Ki}|${pn.value})`,br.output+=pn.value;continue}if(Mn==="{"&&a.nobrace!==!0){jb("braces");let go={type:"brace",value:Mn,output:"(",outputIndex:br.output.length,tokensIndex:br.tokens.length};Bo.push(go),dl(go);continue}if(Mn==="}"){let go=Bo[Bo.length-1];if(a.nobrace===!0||!go){dl({type:"text",value:Mn,output:Mn});continue}let Ki=")";if(go.dots===!0){let wa=b.slice(),ht=[];for(let gl=wa.length-1;gl>=0&&(b.pop(),wa[gl].type!=="brace");gl--)wa[gl].type!=="dots"&&ht.unshift(wa[gl].value);Ki=Bdn(ht,a),br.backtrack=!0}if(go.comma!==!0&&go.dots!==!0){let wa=br.output.slice(0,go.outputIndex),ht=br.tokens.slice(go.tokensIndex);go.value=go.output="\\{",Mn=Ki="\\}",br.output=wa;for(let gl of ht)br.output+=gl.output||gl.value}dl({type:"brace",value:Mn,output:Ki}),k_("braces"),Bo.pop();continue}if(Mn==="|"){Cn.length>0&&Cn[Cn.length-1].conditions++,dl({type:"text",value:Mn});continue}if(Mn===","){let go=Mn,Ki=Bo[Bo.length-1];Ki&&Fa[Fa.length-1]==="braces"&&(Ki.comma=!0,go="|"),dl({type:"comma",value:Mn,output:go});continue}if(Mn==="/"){if(pn.type==="dot"&&br.index===br.start+1){br.start=br.index+1,br.consumed="",br.output="",b.pop(),pn=g;continue}dl({type:"slash",value:Mn,output:q});continue}if(Mn==="."){if(br.braces>0&&pn.type==="dot"){pn.value==="."&&(pn.output=K);let go=Bo[Bo.length-1];pn.type="dots",pn.output+=Mn,pn.value+=Mn,go.dots=!0;continue}if(br.braces+br.parens===0&&pn.type!=="bos"&&pn.type!=="slash"){dl({type:"text",value:Mn,output:K});continue}dl({type:"dot",value:Mn,output:K});continue}if(Mn==="?"){if(!(pn&&pn.value==="(")&&a.noextglob!==!0&&gn()==="("&&gn(2)!=="?"){pi("qmark",Mn);continue}if(pn&&pn.type==="paren"){let Ki=gn(),wa=Mn;(pn.value==="("&&!/[!=<:]/.test(Ki)||Ki==="<"&&!/<([!=]|\w+>)/.test(Ds()))&&(wa=`\\${Mn}`),dl({type:"text",value:Mn,output:wa});continue}if(a.dot!==!0&&(pn.type==="slash"||pn.type==="bos")){dl({type:"qmark",value:Mn,output:Gt});continue}dl({type:"qmark",value:Mn,output:ft});continue}if(Mn==="!"){if(a.noextglob!==!0&&gn()==="("&&(gn(2)!=="?"||!/[!=<:]/.test(gn(3)))){pi("negate",Mn);continue}if(a.nonegate!==!0&&br.index===0){gg();continue}}if(Mn==="+"){if(a.noextglob!==!0&&gn()==="("&&gn(2)!=="?"){pi("plus",Mn);continue}if(pn&&pn.value==="("||a.regex===!1){dl({type:"plus",value:Mn,output:re});continue}if(pn&&(pn.type==="bracket"||pn.type==="paren"||pn.type==="brace")||br.parens>0){dl({type:"plus",value:Mn});continue}dl({type:"plus",value:re});continue}if(Mn==="@"){if(a.noextglob!==!0&&gn()==="("&&gn(2)!=="?"){dl({type:"at",extglob:!0,value:Mn,output:""});continue}dl({type:"text",value:Mn});continue}if(Mn!=="*"){(Mn==="$"||Mn==="^")&&(Mn=`\\${Mn}`);let go=Fdn.exec(Ds());go&&(Mn+=go[0],br.index+=go[0].length),dl({type:"text",value:Mn});continue}if(pn&&(pn.type==="globstar"||pn.star===!0)){pn.type="star",pn.star=!0,pn.value+=Mn,pn.output=ur,br.backtrack=!0,br.globstar=!0,Sl(Mn);continue}let na=Ds();if(a.noextglob!==!0&&/^\([^?]/.test(na)){pi("star",Mn);continue}if(pn.type==="star"){if(a.noglobstar===!0){Sl(Mn);continue}let go=pn.prev,Ki=go.prev,wa=go.type==="slash"||go.type==="bos",ht=Ki&&(Ki.type==="star"||Ki.type==="globstar");if(a.bash===!0&&(!wa||na[0]&&na[0]!=="/")){dl({type:"star",value:Mn,output:""});continue}let gl=br.braces>0&&(go.type==="comma"||go.type==="brace"),Ai=Cn.length&&(go.type==="pipe"||go.type==="paren");if(!wa&&go.type!=="paren"&&!gl&&!Ai){dl({type:"star",value:Mn,output:""});continue}for(;na.slice(0,3)==="/**";){let _f=s[br.index+4];if(_f&&_f!=="/")break;na=na.slice(3),Sl("/**",3)}if(go.type==="bos"&&si()){pn.type="globstar",pn.value+=Mn,pn.output=rn(a),br.output=pn.output,br.globstar=!0,Sl(Mn);continue}if(go.type==="slash"&&go.prev.type!=="bos"&&!ht&&si()){br.output=br.output.slice(0,-(go.output+pn.output).length),go.output=`(?:${go.output}`,pn.type="globstar",pn.output=rn(a)+(a.strictSlashes?")":"|$)"),pn.value+=Mn,br.globstar=!0,br.output+=go.output+pn.output,Sl(Mn);continue}if(go.type==="slash"&&go.prev.type!=="bos"&&na[0]==="/"){let _f=na[1]!==void 0?"|$":"";br.output=br.output.slice(0,-(go.output+pn.output).length),go.output=`(?:${go.output}`,pn.type="globstar",pn.output=`${rn(a)}${q}|${q}${_f})`,pn.value+=Mn,br.output+=go.output+pn.output,br.globstar=!0,Sl(Mn+ms()),dl({type:"slash",value:"/",output:""});continue}if(go.type==="bos"&&na[0]==="/"){pn.type="globstar",pn.value+=Mn,pn.output=`(?:^|${q}|${rn(a)}${q})`,br.output=pn.output,br.globstar=!0,Sl(Mn+ms()),dl({type:"slash",value:"/",output:""});continue}br.output=br.output.slice(0,-pn.output.length),pn.type="globstar",pn.output=rn(a),pn.value+=Mn,br.output+=pn.output,br.globstar=!0,Sl(Mn);continue}let Ji={type:"star",value:Mn,output:ur};if(a.bash===!0){Ji.output=".*?",(pn.type==="bos"||pn.type==="slash")&&(Ji.output=Ht+Ji.output),dl(Ji);continue}if(pn&&(pn.type==="bracket"||pn.type==="paren")&&a.regex===!0){Ji.output=Mn,dl(Ji);continue}(br.index===br.start||pn.type==="slash"||pn.type==="dot")&&(pn.type==="dot"?(br.output+=St,pn.output+=St):a.dot===!0?(br.output+=Ot,pn.output+=Ot):(br.output+=Ht,pn.output+=Ht),gn()!=="*"&&(br.output+=Me,pn.output+=Me)),dl(Ji)}for(;br.brackets>0;){if(a.strictBrackets===!0)throw new SyntaxError(uG("closing","]"));br.output=Bx.escapeLast(br.output,"["),k_("brackets")}for(;br.parens>0;){if(a.strictBrackets===!0)throw new SyntaxError(uG("closing",")"));br.output=Bx.escapeLast(br.output,"("),k_("parens")}for(;br.braces>0;){if(a.strictBrackets===!0)throw new SyntaxError(uG("closing","}"));br.output=Bx.escapeLast(br.output,"{"),k_("braces")}if(a.strictSlashes!==!0&&(pn.type==="star"||pn.type==="bracket")&&dl({type:"maybe_slash",value:"",output:`${q}?`}),br.backtrack===!0){br.output="";for(let na of br.tokens)br.output+=na.output!=null?na.output:na.value,na.suffix&&(br.output+=na.suffix)}return br};z8e.fastpaths=(s,n)=>{let a={...n},u=typeof a.maxLength=="number"?Math.min(iue,a.maxLength):iue,f=s.length;if(f>u)throw new SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${u}`);s=_gt[s]||s;let{DOT_LITERAL:g,SLASH_LITERAL:b,ONE_CHAR:C,DOTS_SLASH:k,NO_DOT:B,NO_DOTS:K,NO_DOTS_SLASH:re,STAR:q,START_ANCHOR:Me}=cJ.globChars(a.windows),Te=a.dot?K:B,Ee=a.dot?re:B,St=a.capture?"":"?:",Ot={negated:!1,prefix:""},ft=a.bash===!0?".*?":q;a.capture&&(ft=`(${ft})`);let Gt=Ht=>Ht.noglobstar===!0?ft:`(${St}(?:(?!${Me}${Ht.dot?k:g}).)*?)`,En=Ht=>{switch(Ht){case"*":return`${Te}${C}${ft}`;case".*":return`${g}${C}${ft}`;case"*.*":return`${Te}${ft}${g}${C}${ft}`;case"*/*":return`${Te}${ft}${b}${C}${Ee}${ft}`;case"**":return Te+Gt(a);case"**/*":return`(?:${Te}${Gt(a)}${b})?${Ee}${C}${ft}`;case"**/*.*":return`(?:${Te}${Gt(a)}${b})?${Ee}${ft}${g}${C}${ft}`;case"**/.*":return`(?:${Te}${Gt(a)}${b})?${g}${C}${ft}`;default:{let hn=/^(.*?)\.(\w+)$/.exec(Ht);if(!hn)return;let ur=En(hn[1]);return ur?ur+g+hn[2]:void 0}}},vr=Bx.removePrefix(s,Ot),rn=En(vr);return rn&&a.strictSlashes!==!0&&(rn+=`${b}?`),rn};ygt.exports=z8e});var Egt=Ln((TPn,Sgt)=>{"use strict";var Kdn=mgt(),U8e=vgt(),bgt=sJ(),Hdn=aJ(),qdn=s=>s&&typeof s=="object"&&!Array.isArray(s),$g=(s,n,a=!1)=>{if(Array.isArray(s)){let K=s.map(q=>$g(q,n,a));return q=>{for(let Me of K){let Te=Me(q);if(Te)return Te}return!1}}let u=qdn(s)&&s.tokens&&s.input;if(s===""||typeof s!="string"&&!u)throw new TypeError("Expected pattern to be a non-empty string");let f=n||{},g=f.windows,b=u?$g.compileRe(s,n):$g.makeRe(s,n,!1,!0),C=b.state;delete b.state;let k=()=>!1;if(f.ignore){let K={...n,ignore:null,onMatch:null,onResult:null};k=$g(f.ignore,K,a)}let B=(K,re=!1)=>{let{isMatch:q,match:Me,output:Te}=$g.test(K,b,n,{glob:s,posix:g}),Ee={glob:s,state:C,regex:b,posix:g,input:K,output:Te,match:Me,isMatch:q};return typeof f.onResult=="function"&&f.onResult(Ee),q===!1?(Ee.isMatch=!1,re?Ee:!1):k(K)?(typeof f.onIgnore=="function"&&f.onIgnore(Ee),Ee.isMatch=!1,re?Ee:!1):(typeof f.onMatch=="function"&&f.onMatch(Ee),re?Ee:!0)};return a&&(B.state=C),B};$g.test=(s,n,a,{glob:u,posix:f}={})=>{if(typeof s!="string")throw new TypeError("Expected input to be a string");if(s==="")return{isMatch:!1,output:""};let g=a||{},b=g.format||(f?bgt.toPosixSlashes:null),C=s===u,k=C&&b?b(s):s;return C===!1&&(k=b?b(s):s,C=k===u),(C===!1||g.capture===!0)&&(g.matchBase===!0||g.basename===!0?C=$g.matchBase(s,n,a,f):C=n.exec(k)),{isMatch:!!C,match:C,output:k}};$g.matchBase=(s,n,a)=>(n instanceof RegExp?n:$g.makeRe(n,a)).test(bgt.basename(s));$g.isMatch=(s,n,a)=>$g(n,a)(s);$g.parse=(s,n)=>Array.isArray(s)?s.map(a=>$g.parse(a,n)):U8e(s,{...n,fastpaths:!1});$g.scan=(s,n)=>Kdn(s,n);$g.compileRe=(s,n,a=!1,u=!1)=>{if(a===!0)return s.output;let f=n||{},g=f.contains?"":"^",b=f.contains?"":"$",C=`${g}(?:${s.output})${b}`;s&&s.negated===!0&&(C=`^(?!${C}).*$`);let k=$g.toRegex(C,n);return u===!0&&(k.state=s),k};$g.makeRe=(s,n={},a=!1,u=!1)=>{if(!s||typeof s!="string")throw new TypeError("Expected a non-empty string");let f={negated:!1,fastpaths:!0};return n.fastpaths!==!1&&(s[0]==="."||s[0]==="*")&&(f.output=U8e.fastpaths(s,n)),f.output||(f=U8e(s,n)),$g.compileRe(f,n,a,u)};$g.toRegex=(s,n)=>{try{let a=n||{};return new RegExp(s,a.flags||(a.nocase?"i":""))}catch(a){if(n&&n.debug===!0)throw a;return/$^/}};$g.constants=Hdn;Sgt.exports=$g});var V8e=Ln((NPn,Ngt)=>{"use strict";var xgt=Egt(),Jdn=sJ();function Tgt(s,n,a=!1){return n&&(n.windows===null||n.windows===void 0)&&(n={...n,windows:Jdn.isWindows()}),xgt(s,n,a)}Object.assign(Tgt,xgt);Ngt.exports=Tgt});var Fgt=Ln(Ogt=>{var $dn=Object.create,Cgt=Object.defineProperty,Xdn=Object.getOwnPropertyDescriptor,Ydn=Object.getOwnPropertyNames,Qdn=Object.getPrototypeOf,Zdn=Object.prototype.hasOwnProperty,epn=(s,n,a,u)=>{if(n&&typeof n=="object"||typeof n=="function")for(var f=Ydn(n),g=0,b=f.length,C;g<b;g++)C=f[g],!Zdn.call(s,C)&&C!==a&&Cgt(s,C,{get:(k=>n[k]).bind(null,C),enumerable:!(u=Xdn(n,C))||u.enumerable});return s},Igt=(s,n,a)=>(a=s!=null?$dn(Qdn(s)):{},epn(n||!s||!s.__esModule?Cgt(a,"default",{value:s,enumerable:!0}):a,s)),GR=Igt(require("path")),tpn=Igt(require("fs"));function npn(s){let n=(0,GR.normalize)(s);return n.length>1&&n[n.length-1]===GR.sep&&(n=n.substring(0,n.length-1)),n}var rpn=/[\\/]/g;function Dgt(s,n){return s.replace(rpn,n)}var ipn=/^[a-z]:[\\/]$/i;function opn(s){return s==="/"||ipn.test(s)}function j8e(s,n){let{resolvePaths:a,normalizePath:u,pathSeparator:f}=n,g=process.platform==="win32"&&s.includes("/")||s.startsWith(".");if(a&&(s=(0,GR.resolve)(s)),(u||g)&&(s=npn(s)),s===".")return"";let b=s[s.length-1]!==f;return Dgt(b?s+f:s,f)}function Pgt(s,n){return n+s}function apn(s,n){return function(a,u){return u.startsWith(s)?u.slice(s.length)+a:Dgt((0,GR.relative)(s,u),n.pathSeparator)+n.pathSeparator+a}}function spn(s){return s}function lpn(s,n,a){return n+s+a}function cpn(s,n){let{relativePaths:a,includeBasePath:u}=n;return a&&s?apn(s,n):u?Pgt:spn}function upn(s){return function(n,a){a.push(n.substring(s.length)||".")}}function dpn(s){return function(n,a,u){let f=n.substring(s.length)||".";u.every(g=>g(f,!0))&&a.push(f)}}var ppn=(s,n)=>{n.push(s||".")},fpn=(s,n,a)=>{let u=s||".";a.every(f=>f(u,!0))&&n.push(u)},mpn=()=>{};function _pn(s,n){let{includeDirs:a,filters:u,relativePaths:f}=n;return a?f?u&&u.length?dpn(s):upn(s):u&&u.length?fpn:ppn:mpn}var gpn=(s,n,a,u)=>{u.every(f=>f(s,!1))&&a.files++},hpn=(s,n,a,u)=>{u.every(f=>f(s,!1))&&n.push(s)},ypn=(s,n,a,u)=>{a.files++},vpn=(s,n)=>{n.push(s)},bpn=()=>{};function Spn(s){let{excludeFiles:n,filters:a,onlyCounts:u}=s;return n?bpn:a&&a.length?u?gpn:hpn:u?ypn:vpn}var Epn=s=>s,xpn=()=>[""].slice(0,0);function Tpn(s){return s.group?xpn:Epn}var Npn=(s,n,a)=>{s.push({directory:n,files:a,dir:n})},Apn=()=>{};function Cpn(s){return s.group?Npn:Apn}var Ipn=function(s,n,a){let{queue:u,fs:f,options:{suppressErrors:g}}=n;u.enqueue(),f.realpath(s,(b,C)=>{if(b)return u.dequeue(g?null:b,n);f.stat(C,(k,B)=>{if(k)return u.dequeue(g?null:k,n);if(B.isDirectory()&&Rgt(s,C,n))return u.dequeue(null,n);a(B,C),u.dequeue(null,n)})})},Dpn=function(s,n,a){let{queue:u,fs:f,options:{suppressErrors:g}}=n;u.enqueue();try{let b=f.realpathSync(s),C=f.statSync(b);if(C.isDirectory()&&Rgt(s,b,n))return;a(C,b)}catch(b){if(!g)throw b}};function Ppn(s,n){return!s.resolveSymlinks||s.excludeSymlinks?null:n?Dpn:Ipn}function Rgt(s,n,a){if(a.options.useRealPaths)return Rpn(n,a);let u=(0,GR.dirname)(s),f=1;for(;u!==a.root&&f<2;){let g=a.symlinks.get(u);!!g&&(g===n||g.startsWith(n)||n.startsWith(g))?f++:u=(0,GR.dirname)(u)}return a.symlinks.set(s,n),f>1}function Rpn(s,n){return n.visited.includes(s+n.options.pathSeparator)}var Lpn=s=>s.counts,Mpn=s=>s.groups,kpn=s=>s.paths,wpn=s=>s.paths.slice(0,s.options.maxFiles),Opn=(s,n,a)=>(oue(n,a,s.counts,s.options.suppressErrors),null),Fpn=(s,n,a)=>(oue(n,a,s.paths,s.options.suppressErrors),null),Wpn=(s,n,a)=>(oue(n,a,s.paths.slice(0,s.options.maxFiles),s.options.suppressErrors),null),Bpn=(s,n,a)=>(oue(n,a,s.groups,s.options.suppressErrors),null);function oue(s,n,a,u){n(s&&!u?s:null,a)}function Gpn(s,n){let{onlyCounts:a,group:u,maxFiles:f}=s;return a?n?Lpn:Opn:u?n?Mpn:Bpn:f?n?wpn:Wpn:n?kpn:Fpn}var Lgt={withFileTypes:!0},zpn=(s,n,a,u,f)=>{if(s.queue.enqueue(),u<0)return s.queue.dequeue(null,s);let{fs:g}=s;s.visited.push(n),s.counts.directories++,g.readdir(n||".",Lgt,(b,C=[])=>{f(C,a,u),s.queue.dequeue(s.options.suppressErrors?null:b,s)})},Upn=(s,n,a,u,f)=>{let{fs:g}=s;if(u<0)return;s.visited.push(n),s.counts.directories++;let b=[];try{b=g.readdirSync(n||".",Lgt)}catch(C){if(!s.options.suppressErrors)throw C}f(b,a,u)};function Vpn(s){return s?Upn:zpn}var jpn=class{count=0;constructor(s){this.onQueueEmpty=s}enqueue(){return this.count++,this.count}dequeue(s,n){this.onQueueEmpty&&(--this.count<=0||s)&&(this.onQueueEmpty(s,n),s&&(n.controller.abort(),this.onQueueEmpty=void 0))}},Kpn=class{_files=0;_directories=0;set files(s){this._files=s}get files(){return this._files}set directories(s){this._directories=s}get directories(){return this._directories}get dirs(){return this._directories}},Hpn=class{aborted=!1;abort(){this.aborted=!0}},Mgt=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(s,n,a){this.isSynchronous=!a,this.callbackInvoker=Gpn(n,this.isSynchronous),this.root=j8e(s,n),this.state={root:opn(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new Kpn,options:n,queue:new jpn((u,f)=>this.callbackInvoker(f,u,a)),symlinks:new Map,visited:[""].slice(0,0),controller:new Hpn,fs:n.fs||tpn},this.joinPath=cpn(this.root,n),this.pushDirectory=_pn(this.root,n),this.pushFile=Spn(n),this.getArray=Tpn(n),this.groupFiles=Cpn(n),this.resolveSymlink=Ppn(n,this.isSynchronous),this.walkDirectory=Vpn(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(s,n,a)=>{let{paths:u,options:{filters:f,resolveSymlinks:g,excludeSymlinks:b,exclude:C,maxFiles:k,signal:B,useRealPaths:K,pathSeparator:re},controller:q}=this.state;if(q.aborted||B&&B.aborted||k&&u.length>k)return;let Me=this.getArray(this.state.paths);for(let Te=0;Te<s.length;++Te){let Ee=s[Te];if(Ee.isFile()||Ee.isSymbolicLink()&&!g&&!b){let St=this.joinPath(Ee.name,n);this.pushFile(St,Me,this.state.counts,f)}else if(Ee.isDirectory()){let St=lpn(Ee.name,n,this.state.options.pathSeparator);if(C&&C(Ee.name,St))continue;this.pushDirectory(St,u,f),this.walkDirectory(this.state,St,St,a-1,this.walk)}else if(this.resolveSymlink&&Ee.isSymbolicLink()){let St=Pgt(Ee.name,n);this.resolveSymlink(St,this.state,(Ot,ft)=>{if(Ot.isDirectory()){if(ft=j8e(ft,this.state.options),C&&C(Ee.name,K?ft:St+re))return;this.walkDirectory(this.state,ft,K?ft:St+re,a-1,this.walk)}else{ft=K?ft:St;let Gt=(0,GR.basename)(ft),En=j8e((0,GR.dirname)(ft),this.state.options);ft=this.joinPath(Gt,En),this.pushFile(ft,Me,this.state.counts,f)}})}}this.groupFiles(this.state.groups,n,Me)}};function qpn(s,n){return new Promise((a,u)=>{kgt(s,n,(f,g)=>{if(f)return u(f);a(g)})})}function kgt(s,n,a){new Mgt(s,n,a).start()}function Jpn(s,n){return new Mgt(s,n).start()}var Agt=class{constructor(s,n){this.root=s,this.options=n}withPromise(){return qpn(this.root,this.options)}withCallback(s){kgt(this.root,this.options,s)}sync(){return Jpn(this.root,this.options)}},wgt=null;try{require.resolve("picomatch"),wgt=V8e()}catch{}var $pn=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:GR.sep,filters:[]};globFunction;constructor(s){this.options={...this.options,...s},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(s){return this.options.pathSeparator=s,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(s){return this.options.maxDepth=s,this}withMaxFiles(s){return this.options.maxFiles=s,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:s=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=s,this.withFullPaths()}withAbortSignal(s){return this.options.signal=s,this}normalize(){return this.options.normalizePath=!0,this}filter(s){return this.options.filters.push(s),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(s){return this.options.exclude=s,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(s){return new Agt(s||".",this.options)}withGlobFunction(s){return this.globFunction=s,this}crawlWithOptions(s,n){return this.options={...this.options,...n},new Agt(s||".",this.options)}glob(...s){return this.globFunction?this.globWithOptions(s):this.globWithOptions(s,{dot:!0})}globWithOptions(s,...n){let a=this.globFunction||wgt;if(!a)throw new Error("Please specify a glob function to use glob matching.");var u=this.globCache[s.join("\0")];return u||(u=a(s,...n),this.globCache[s.join("\0")]=u),this.options.filters.push(f=>u(f)),this}};Ogt.fdir=$pn});var Jgt=Ln(pG=>{var Xpn=Object.create,Bgt=Object.defineProperty,Ypn=Object.getOwnPropertyDescriptor,Qpn=Object.getOwnPropertyNames,Zpn=Object.getPrototypeOf,efn=Object.prototype.hasOwnProperty,tfn=(s,n,a,u)=>{if(n&&typeof n=="object"||typeof n=="function")for(var f=Qpn(n),g=0,b=f.length,C;g<b;g++)C=f[g],!efn.call(s,C)&&C!==a&&Bgt(s,C,{get:(k=>n[k]).bind(null,C),enumerable:!(u=Ypn(n,C))||u.enumerable});return s},uJ=(s,n,a)=>(a=s!=null?Xpn(Zpn(s)):{},tfn(n||!s||!s.__esModule?Bgt(a,"default",{value:s,enumerable:!0}):a,s)),cw=require("fs");cw=uJ(cw);var I1=require("path");I1=uJ(I1);var H8e=require("url");H8e=uJ(H8e);var q8e=Fgt();q8e=uJ(q8e);var W8=V8e();W8=uJ(W8);var Ggt=Array.isArray,J8e=process.platform==="win32",nfn=/^(\/?\.\.)+$/;function rfn(s,n={}){let a=s.length,u=Array(a),f=Array(a),g=!n.noglobstar;for(let b=0;b<a;b++){let C=zgt(s[b]);u[b]=C;let k=C.length,B=Array(k);for(let K=0;K<k;K++)B[K]=(0,W8.default)(C[K],n);f[b]=B}return b=>{let C=b.split("/");if(C[0]===".."&&nfn.test(b))return!0;for(let k=0;k<s.length;k++){let B=u[k],K=f[k],re=C.length,q=Math.min(re,B.length),Me=0;for(;Me<q;){let Te=B[Me];if(Te.includes("/"))return!0;if(!K[Me](C[Me]))break;if(g&&Te==="**")return!0;Me++}if(Me===re)return!0}return!1}}var ifn=/^[A-Z]:\/$/i,ofn=J8e?s=>ifn.test(s):s=>s==="/";function Wgt(s,n,a){if(s===n||n.startsWith(`${s}/`)){if(a){let f=ofn(s)?s.length:s.length+1;return(g,b)=>g.slice(f,b?-1:void 0)||"."}let u=n.slice(s.length+1);return u?(f,g)=>{if(f===".")return u;let b=`${u}/${f}`;return g?b.slice(0,-1):b}:(f,g)=>g&&f!=="."?f.slice(0,-1):f}return a?u=>I1.posix.relative(s,u)||".":u=>I1.posix.relative(s,`${n}/${u}`)||"."}function afn(s,n){if(n.startsWith(`${s}/`)){let a=n.slice(s.length+1);return u=>`${a}/${u}`}return a=>{let u=I1.posix.relative(s,`${n}/${a}`);return a.endsWith("/")&&u!==""?`${u}/`:u||"."}}var sfn={parts:!0};function zgt(s){var n;let a=W8.default.scan(s,sfn);return!((n=a.parts)===null||n===void 0)&&n.length?a.parts:[s]}var lfn=/\\(?![()[\]{}!+@])/g;function cfn(s){return Ugt(s)}function ufn(s){return Vgt(s).replace(lfn,"/")}var dfn=J8e?ufn:cfn,pfn=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,ffn=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,Ugt=s=>s.replace(pfn,"\\$&"),Vgt=s=>s.replace(ffn,"\\$&"),jgt=J8e?Vgt:Ugt;function Kgt(s,n){if(n?.caseSensitiveMatch===!1)return!0;let a=W8.default.scan(s);return a.isGlob||a.negated}function dG(...s){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...s)}var mfn=/^(\/?\.\.)+/,_fn=/\\(?=[()[\]{}!*+?@|])/g,aue=/\\/g;function K8e(s,n,a,u,f){let g=s;s.endsWith("/")&&(g=s.slice(0,-1)),!g.endsWith("*")&&n&&(g+="/**");let b=jgt(a);I1.default.isAbsolute(g.replace(_fn,""))?g=I1.posix.relative(b,g):g=I1.posix.normalize(g);let C=mfn.exec(g),k=zgt(g);if(C?.[0]){let K=(C[0].length+1)/3,re=0,q=b.split("/");for(;re<K&&k[re+K]===q[q.length+re-K];)g=g.slice(0,(K-re-1)*3)+g.slice((K-re)*3+k[re+K].length+1)||".",re++;let Me=I1.posix.join(a,C[0].slice(re*3));!Me.startsWith(".")&&u.root.length>Me.length&&(u.root=Me,u.depthOffset=-K+re)}if(!f&&u.depthOffset>=0){var B;(B=u.commonPath)!==null&&B!==void 0||(u.commonPath=k);let K=[],re=Math.min(u.commonPath.length,k.length);for(let q=0;q<re;q++){let Me=k[q];if(Me==="**"&&!k[q+1]){K.pop();break}if(Me!==u.commonPath[q]||Kgt(Me)||q===k.length-1)break;K.push(Me)}u.depthOffset=K.length,u.commonPath=K,u.root=K.length>0?I1.posix.join(a,...K):a}return g}function gfn({patterns:s=["**/*"],ignore:n=[],expandDirectories:a=!0},u,f){typeof s=="string"&&(s=[s]),typeof n=="string"&&(n=[n]);let g=[],b=[];for(let C of n)C&&(C[0]!=="!"||C[1]==="(")&&b.push(K8e(C,a,u,f,!0));for(let C of s)C&&(C[0]!=="!"||C[1]==="("?g.push(K8e(C,a,u,f,!1)):(C[1]!=="!"||C[2]==="(")&&b.push(K8e(C.slice(1),a,u,f,!0)));return{match:g,ignore:b}}function Hgt(s,n){for(let a=s.length-1;a>=0;a--){let u=s[a];s[a]=n(u)}return s}function hfn(s){return s?s instanceof URL?(0,H8e.fileURLToPath)(s).replace(aue,"/"):I1.default.resolve(s).replace(aue,"/"):process.cwd().replace(aue,"/")}function qgt(s,n={}){let a=process.env.TINYGLOBBY_DEBUG?{...n,debug:!0}:n,u=hfn(a.cwd);if(a.debug&&dG("globbing with:",{patterns:s,options:a,cwd:u}),Array.isArray(s)&&s.length===0)return[{sync:()=>[],withPromise:async()=>[]},!1];let f={root:u,commonPath:null,depthOffset:0},g=gfn({...a,patterns:s},u,f);a.debug&&dG("internal processing patterns:",g);let b={dot:a.dot,nobrace:a.braceExpansion===!1,nocase:a.caseSensitiveMatch===!1,noextglob:a.extglob===!1,noglobstar:a.globstar===!1,posix:!0},C=(0,W8.default)(g.match,{...b,ignore:g.ignore}),k=(0,W8.default)(g.ignore,b),B=rfn(g.match,b),K=Wgt(u,f.root,a.absolute),re=a.absolute?K:Wgt(u,f.root,!0),q={filters:[a.debug?(Ee,St)=>{let Ot=K(Ee,St),ft=C(Ot);return ft&&dG(`matched ${Ot}`),ft}:(Ee,St)=>C(K(Ee,St))],exclude:a.debug?(Ee,St)=>{let Ot=re(St,!0),ft=Ot!=="."&&!B(Ot)||k(Ot);return dG(ft?`skipped ${St}`:`crawling ${St}`),ft}:(Ee,St)=>{let Ot=re(St,!0);return Ot!=="."&&!B(Ot)||k(Ot)},fs:a.fs?{readdir:a.fs.readdir||cw.default.readdir,readdirSync:a.fs.readdirSync||cw.default.readdirSync,realpath:a.fs.realpath||cw.default.realpath,realpathSync:a.fs.realpathSync||cw.default.realpathSync,stat:a.fs.stat||cw.default.stat,statSync:a.fs.statSync||cw.default.statSync}:void 0,pathSeparator:"/",relativePaths:!0,resolveSymlinks:!0,signal:a.signal};a.deep!==void 0&&(q.maxDepth=Math.round(a.deep-f.depthOffset)),a.absolute&&(q.relativePaths=!1,q.resolvePaths=!0,q.includeBasePath=!0),a.followSymbolicLinks===!1&&(q.resolveSymlinks=!1,q.excludeSymlinks=!0),a.onlyDirectories?(q.excludeFiles=!0,q.includeDirs=!0):a.onlyFiles===!1&&(q.includeDirs=!0),f.root=f.root.replace(aue,"");let Me=f.root;a.debug&&dG("internal properties:",f);let Te=u!==Me&&!a.absolute&&afn(u,f.root);return[new q8e.fdir(q).crawl(Me),Te]}async function yfn(s,n){if(s&&n?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let a=Ggt(s)||typeof s=="string",u=a?n:s,f=a?s:s.patterns,[g,b]=qgt(f,u);return b?Hgt(await g.withPromise(),b):g.withPromise()}function vfn(s,n){if(s&&n?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let a=Ggt(s)||typeof s=="string",u=a?n:s,f=a?s:s.patterns,[g,b]=qgt(f,u);return b?Hgt(g.sync(),b):g.sync()}pG.convertPathToPattern=dfn;pG.escapePath=jgt;pG.glob=yfn;pG.globSync=vfn;pG.isDynamicPattern=Kgt});var Ygt=Ln((kPn,Xgt)=>{"use strict";function qI(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}function $gt(s,n){for(var a="",u=0,f=-1,g=0,b,C=0;C<=s.length;++C){if(C<s.length)b=s.charCodeAt(C);else{if(b===47)break;b=47}if(b===47){if(!(f===C-1||g===1))if(f!==C-1&&g===2){if(a.length<2||u!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){var k=a.lastIndexOf("/");if(k!==a.length-1){k===-1?(a="",u=0):(a=a.slice(0,k),u=a.length-1-a.lastIndexOf("/")),f=C,g=0;continue}}else if(a.length===2||a.length===1){a="",u=0,f=C,g=0;continue}}n&&(a.length>0?a+="/..":a="..",u=2)}else a.length>0?a+="/"+s.slice(f+1,C):a=s.slice(f+1,C),u=C-f-1;f=C,g=0}else b===46&&g!==-1?++g:g=-1}return a}function bfn(s,n){var a=n.dir||n.root,u=n.base||(n.name||"")+(n.ext||"");return a?a===n.root?a+u:a+s+u:u}var fG={resolve:function(){for(var n="",a=!1,u,f=arguments.length-1;f>=-1&&!a;f--){var g;f>=0?g=arguments[f]:(u===void 0&&(u=process.cwd()),g=u),qI(g),g.length!==0&&(n=g+"/"+n,a=g.charCodeAt(0)===47)}return n=$gt(n,!a),a?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(n){if(qI(n),n.length===0)return".";var a=n.charCodeAt(0)===47,u=n.charCodeAt(n.length-1)===47;return n=$gt(n,!a),n.length===0&&!a&&(n="."),n.length>0&&u&&(n+="/"),a?"/"+n:n},isAbsolute:function(n){return qI(n),n.length>0&&n.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var n,a=0;a<arguments.length;++a){var u=arguments[a];qI(u),u.length>0&&(n===void 0?n=u:n+="/"+u)}return n===void 0?".":fG.normalize(n)},relative:function(n,a){if(qI(n),qI(a),n===a||(n=fG.resolve(n),a=fG.resolve(a),n===a))return"";for(var u=1;u<n.length&&n.charCodeAt(u)===47;++u);for(var f=n.length,g=f-u,b=1;b<a.length&&a.charCodeAt(b)===47;++b);for(var C=a.length,k=C-b,B=g<k?g:k,K=-1,re=0;re<=B;++re){if(re===B){if(k>B){if(a.charCodeAt(b+re)===47)return a.slice(b+re+1);if(re===0)return a.slice(b+re)}else g>B&&(n.charCodeAt(u+re)===47?K=re:re===0&&(K=0));break}var q=n.charCodeAt(u+re),Me=a.charCodeAt(b+re);if(q!==Me)break;q===47&&(K=re)}var Te="";for(re=u+K+1;re<=f;++re)(re===f||n.charCodeAt(re)===47)&&(Te.length===0?Te+="..":Te+="/..");return Te.length>0?Te+a.slice(b+K):(b+=K,a.charCodeAt(b)===47&&++b,a.slice(b))},_makeLong:function(n){return n},dirname:function(n){if(qI(n),n.length===0)return".";for(var a=n.charCodeAt(0),u=a===47,f=-1,g=!0,b=n.length-1;b>=1;--b)if(a=n.charCodeAt(b),a===47){if(!g){f=b;break}}else g=!1;return f===-1?u?"/":".":u&&f===1?"//":n.slice(0,f)},basename:function(n,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');qI(n);var u=0,f=-1,g=!0,b;if(a!==void 0&&a.length>0&&a.length<=n.length){if(a.length===n.length&&a===n)return"";var C=a.length-1,k=-1;for(b=n.length-1;b>=0;--b){var B=n.charCodeAt(b);if(B===47){if(!g){u=b+1;break}}else k===-1&&(g=!1,k=b+1),C>=0&&(B===a.charCodeAt(C)?--C===-1&&(f=b):(C=-1,f=k))}return u===f?f=k:f===-1&&(f=n.length),n.slice(u,f)}else{for(b=n.length-1;b>=0;--b)if(n.charCodeAt(b)===47){if(!g){u=b+1;break}}else f===-1&&(g=!1,f=b+1);return f===-1?"":n.slice(u,f)}},extname:function(n){qI(n);for(var a=-1,u=0,f=-1,g=!0,b=0,C=n.length-1;C>=0;--C){var k=n.charCodeAt(C);if(k===47){if(!g){u=C+1;break}continue}f===-1&&(g=!1,f=C+1),k===46?a===-1?a=C:b!==1&&(b=1):a!==-1&&(b=-1)}return a===-1||f===-1||b===0||b===1&&a===f-1&&a===u+1?"":n.slice(a,f)},format:function(n){if(n===null||typeof n!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof n);return bfn("/",n)},parse:function(n){qI(n);var a={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return a;var u=n.charCodeAt(0),f=u===47,g;f?(a.root="/",g=1):g=0;for(var b=-1,C=0,k=-1,B=!0,K=n.length-1,re=0;K>=g;--K){if(u=n.charCodeAt(K),u===47){if(!B){C=K+1;break}continue}k===-1&&(B=!1,k=K+1),u===46?b===-1?b=K:re!==1&&(re=1):b!==-1&&(re=-1)}return b===-1||k===-1||re===0||re===1&&b===k-1&&b===C+1?k!==-1&&(C===0&&f?a.base=a.name=n.slice(1,k):a.base=a.name=n.slice(C,k)):(C===0&&f?(a.name=n.slice(1,b),a.base=n.slice(1,k)):(a.name=n.slice(C,b),a.base=n.slice(C,k)),a.ext=n.slice(b,k)),C>0?a.dir=n.slice(0,C-1):f&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};fG.posix=fG;Xgt.exports=fG});var pht=Ln(Aa=>{"use strict";var VS=I_t(),Sfn=tgt(),Efn=require("fs"),xfn=require("fs/promises"),Tfn=require("os"),Nfn=require("path"),Qgt=Jgt();function gG(s){if(s&&typeof s=="object"&&"default"in s)return s;var n=Object.create(null);return s&&Object.keys(s).forEach(function(a){if(a!=="default"){var u=Object.getOwnPropertyDescriptor(s,a);Object.defineProperty(n,a,u.get?u:{enumerable:!0,get:function(){return s[a]}})}}),n.default=s,Object.freeze(n)}var Gx=gG(VS),nht=gG(Sfn),US=gG(Efn),Afn=gG(xfn),Cfn=gG(Tfn),sue=gG(Nfn),lue=class{#e=new Map;getSize(){return this.#e.size}getValues(){return this.#e.values()}getValuesAsArray(){return Array.from(this.getValues())}getKeys(){return this.#e.keys()}getEntries(){return this.#e.entries()}getOrCreate(n,a){let u=this.get(n);return u==null&&(u=a(),this.set(n,u)),u}has(n){return this.#e.has(n)}get(n){return this.#e.get(n)}set(n,a){this.#e.set(n,a)}replaceKey(n,a){if(!this.#e.has(n))throw new Error("Key not found.");let u=this.#e.get(n);this.#e.delete(n),this.#e.set(a,u)}removeByKey(n){this.#e.delete(n)}clear(){this.#e.clear()}},cue=class{#e;#t;constructor(n,a){this.#e=n,this.#t=a}compareTo(n){return this.#e.compareTo(this.#t,n)}},uue=class s{static instance=new s;compareTo(n,a){let u=n.localeCompare(a,"en-us-u-kf-upper");return u<0?-1:u===0?0:1}},due=class{#e;#t;constructor(n,a){this.#t=n,this.#e=a}compareTo(n,a){return this.#e.compareTo(this.#t(n),this.#t(a))}},pue=class{#e;#t;constructor(n,a){this.#t=n,this.#e=a}compareTo(n){return this.#e.compareTo(this.#t(n))}},DN=class{constructor(){}static isReadonlyArray(n){return n instanceof Array}static isNullOrEmpty(n){return!(n instanceof Array)||n.length===0}static getUniqueItems(n){return n.filter((a,u)=>n.indexOf(a)===u)}static removeFirst(n,a){let u=n.indexOf(a);return u===-1?!1:(n.splice(u,1),!0)}static removeAll(n,a){let u=[];for(let f=n.length-1;f>=0;f--)a(n[f])&&(u.push(n[f]),n.splice(f,1));return u}static*toIterator(n){for(let a of n)yield a}static sortByProperty(n,a){return n.sort((u,f)=>a(u)<=a(f)?-1:1),n}static groupBy(n,a){let u=[],f={};for(let g of n){let b=a(g).toString();f[b]==null&&(f[b]=[],u.push(f[b])),f[b].push(g)}return u}static binaryInsertWithOverwrite(n,a,u){let f=n.length-1,g=0;for(;g<=f;){let b=Math.floor((f+g)/2);u.compareTo(a,n[b])<0?f=b-1:g=b+1}n[f]!=null&&u.compareTo(a,n[f])===0?n[f]=a:n.splice(f+1,0,a)}static binarySearch(n,a){let u=n.length-1,f=0;for(;f<=u;){let g=Math.floor((u+f)/2),b=a.compareTo(n[g]);if(b===0)return g;b<0?u=g-1:f=g+1}return-1}static containsSubArray(n,a){let u=0;for(let f of n)if(a[u]===f){if(u++,u===a.length)return!0}else u=0;return!1}};function rht(s){return n(s);function n(f){let g=Object.create(f.constructor.prototype);for(let b of Object.keys(f))g[b]=u(f[b]);return g}function a(f){return f.map(u)}function u(f){return f instanceof Array?a(f):typeof f=="object"?f===null?f:n(f):f}}var fue=class{#e=[];subscribe(n){this.#t(n)===-1&&this.#e.push(n)}unsubscribe(n){let a=this.#t(n);a>=0&&this.#e.splice(a,1)}fire(n){for(let a of this.#e)a(n)}#t(n){return this.#e.indexOf(n)}},Q8e=class{static find(n,a){for(let u of n)if(a(u))return u}};function Z8e(s,n){return n??s}var eWe=class s{constructor(){}static clone(n){if(n==null)return;if(n instanceof Array)return a(n);return Object.assign({},n);function a(u){return u.map(f=>s.clone(f))}}};function iht(s,n,a,u,f,g,b,C,k,B){return Gx.matchFiles.apply(this,arguments)}function oht(s,n,a,u,f){return Gx.getFileMatcherPatterns.apply(this,arguments)}function Ifn(s){return Gx.getEmitModuleResolutionKind.apply(this,arguments)}function aht(s){return Dfn()[s]}var mG;function Dfn(){if(mG!=null)return mG;mG={};for(let s of Object.keys(Gx.SyntaxKind).filter(n=>isNaN(parseInt(n,10)))){let n=Gx.SyntaxKind[s];mG[n]==null&&(mG[n]=s)}return mG}Aa.errors=void 0;(function(s){class n extends Error{constructor(hn,ur){let br=ur&&Pfn(ur),Cn=br?`${hn}
450
+ `+L.stack)}finally{this.performanceData=T}}parseMessage(t){return JSON.parse(t)}toStringMessage(t){return t}getFormatOptions(t){return this.projectService.getFormatCodeOptions(t)}getPreferences(t){return this.projectService.getPreferences(t)}getHostFormatOptions(){return this.projectService.getHostFormatCodeOptions()}getHostPreferences(){return this.projectService.getHostPreferences()}};function Jnt(e){let t=e.diagnosticsDuration&&$o(e.diagnosticsDuration,([o,l])=>({...l,file:o}));return{...e,diagnosticsDuration:t}}function Gy(e,t){return{start:t.positionToLineOffset(e.start),end:t.positionToLineOffset(Tc(e))}}function HRe(e,t,o){let l=Gy(e,o),c=t&&Gy(t,o);return c?{...l,contextStart:c.start,contextEnd:c.end}:l}function bVt(e,t){return{start:$nt(t,e.span.start),end:$nt(t,Tc(e.span)),newText:e.newText}}function $nt(e,t){return BRe(e)?EVt(e.getLineAndCharacterOfPosition(t)):e.positionToLineOffset(t)}function SVt(e,t){let o=e.ranges.map(l=>({start:t.positionToLineOffset(l.start),end:t.positionToLineOffset(l.start+l.length)}));return e.wordPattern?{ranges:o,wordPattern:e.wordPattern}:{ranges:o}}function EVt(e){return{line:e.line+1,offset:e.character+1}}function xVt(e){F.assert(e.textChanges.length===1);let t=Ea(e.textChanges);return F.assert(t.span.start===0&&t.span.length===0),{fileName:e.fileName,textChanges:[{start:{line:0,offset:0},end:{line:0,offset:0},newText:t.newText}]}}function qRe(e,t,o,l){let c=TVt(e,t,l),{line:p,character:m}=bL(yD(c),o);return{line:p+1,offset:m+1}}function TVt(e,t,o){for(let{fileName:l,textChanges:c}of o)if(l===t)for(let p=c.length-1;p>=0;p--){let{newText:m,span:{start:y,length:h}}=c[p];e=e.slice(0,y)+m+e.slice(y+h)}return e}function Xnt(e,{fileName:t,textSpan:o,contextSpan:l,isWriteAccess:c,isDefinition:p},{disableLineTextInReferences:m}){let y=F.checkDefined(e.getScriptInfo(t)),h=HRe(o,l,y),E=m?void 0:NVt(y,h);return{file:t,...h,lineText:E,isWriteAccess:c,isDefinition:p}}function NVt(e,t){let o=e.lineToTextSpan(t.start.line-1);return e.getSnapshot().getText(o.start,Tc(o)).replace(/\r|\n/g,"")}function AVt(e){return e===void 0||e&&typeof e=="object"&&typeof e.exportName=="string"&&(e.fileName===void 0||typeof e.fileName=="string")&&(e.ambientModuleName===void 0||typeof e.ambientModuleName=="string"&&(e.isPackageJsonImport===void 0||typeof e.isPackageJsonImport=="boolean"))}var ok=4,JRe=(e=>(e[e.PreStart=0]="PreStart",e[e.Start=1]="Start",e[e.Entire=2]="Entire",e[e.Mid=3]="Mid",e[e.End=4]="End",e[e.PostEnd=5]="PostEnd",e))(JRe||{}),CVt=class{constructor(){this.goSubtree=!0,this.lineIndex=new RB,this.endBranch=[],this.state=2,this.initialText="",this.trailingText="",this.lineIndex.root=new ak,this.startPath=[this.lineIndex.root],this.stack=[this.lineIndex.root]}get done(){return!1}insertLines(e,t){t&&(this.trailingText=""),e?e=this.initialText+e+this.trailingText:e=this.initialText+this.trailingText;let l=RB.linesFromText(e).lines;l.length>1&&l[l.length-1]===""&&l.pop();let c,p;for(let y=this.endBranch.length-1;y>=0;y--)this.endBranch[y].updateCounts(),this.endBranch[y].charCount()===0&&(p=this.endBranch[y],y>0?c=this.endBranch[y-1]:c=this.branchNode);p&&c.remove(p);let m=this.startPath[this.startPath.length-1];if(l.length>0)if(m.text=l[0],l.length>1){let y=new Array(l.length-1),h=m;for(let N=1;N<l.length;N++)y[N-1]=new jK(l[N]);let E=this.startPath.length-2;for(;E>=0;){let N=this.startPath[E];y=N.insertAt(h,y),E--,h=N}let T=y.length;for(;T>0;){let N=new ak;N.add(this.lineIndex.root),y=N.insertAt(this.lineIndex.root,y),T=y.length,this.lineIndex.root=N}this.lineIndex.root.updateCounts()}else for(let y=this.startPath.length-2;y>=0;y--)this.startPath[y].updateCounts();else{this.startPath[this.startPath.length-2].remove(m);for(let h=this.startPath.length-2;h>=0;h--)this.startPath[h].updateCounts()}return this.lineIndex}post(e,t,o){o===this.lineCollectionAtBranch&&(this.state=4),this.stack.pop()}pre(e,t,o,l,c){let p=this.stack[this.stack.length-1];this.state===2&&c===1&&(this.state=1,this.branchNode=p,this.lineCollectionAtBranch=o);let m;function y(h){return h.isLeaf()?new jK(""):new ak}switch(c){case 0:this.goSubtree=!1,this.state!==4&&p.add(o);break;case 1:this.state===4?this.goSubtree=!1:(m=y(o),p.add(m),this.startPath.push(m));break;case 2:this.state!==4?(m=y(o),p.add(m),this.startPath.push(m)):o.isLeaf()||(m=y(o),p.add(m),this.endBranch.push(m));break;case 3:this.goSubtree=!1;break;case 4:this.state!==4?this.goSubtree=!1:o.isLeaf()||(m=y(o),p.add(m),this.endBranch.push(m));break;case 5:this.goSubtree=!1,this.state!==1&&p.add(o);break}this.goSubtree&&this.stack.push(m)}leaf(e,t,o){this.state===1?this.initialText=o.text.substring(0,e):this.state===2?(this.initialText=o.text.substring(0,e),this.trailingText=o.text.substring(e+t)):this.trailingText=o.text.substring(e+t)}},IVt=class{constructor(e,t,o){this.pos=e,this.deleteLen=t,this.insertedText=o}getTextChangeRange(){return qW(kd(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}},Qoe=class HI{constructor(){this.changes=[],this.versions=new Array(HI.maxVersions),this.minVersion=0,this.currentVersion=0}versionToIndex(t){if(!(t<this.minVersion||t>this.currentVersion))return t%HI.maxVersions}currentVersionToIndex(){return this.currentVersion%HI.maxVersions}edit(t,o,l){this.changes.push(new IVt(t,o,l)),(this.changes.length>HI.changeNumberThreshold||o>HI.changeLengthThreshold||l&&l.length>HI.changeLengthThreshold)&&this.getSnapshot()}getSnapshot(){return this._getSnapshot()}_getSnapshot(){let t=this.versions[this.currentVersionToIndex()];if(this.changes.length>0){let o=t.index;for(let l of this.changes)o=o.edit(l.pos,l.deleteLen,l.insertedText);t=new Ynt(this.currentVersion+1,this,o,this.changes),this.currentVersion=t.version,this.versions[this.currentVersionToIndex()]=t,this.changes=[],this.currentVersion-this.minVersion>=HI.maxVersions&&(this.minVersion=this.currentVersion-HI.maxVersions+1)}return t}getSnapshotVersion(){return this._getSnapshot().version}getAbsolutePositionAndLineText(t){return this._getSnapshot().index.lineNumberToInfo(t)}lineOffsetToPosition(t,o){return this._getSnapshot().index.absolutePositionOfStartOfLine(t)+(o-1)}positionToLineOffset(t){return this._getSnapshot().index.positionToLineOffset(t)}lineToTextSpan(t){let o=this._getSnapshot().index,{lineText:l,absolutePosition:c}=o.lineNumberToInfo(t+1),p=l!==void 0?l.length:o.absolutePositionOfStartOfLine(t+2)-c;return kd(c,p)}getTextChangesBetweenVersions(t,o){if(t<o)if(t>=this.minVersion){let l=[];for(let c=t+1;c<=o;c++){let p=this.versions[this.versionToIndex(c)];for(let m of p.changesSincePreviousVersion)l.push(m.getTextChangeRange())}return zve(l)}else return;else return iz}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString(t){let o=new HI,l=new Ynt(0,o,new RB);o.versions[o.currentVersion]=l;let c=RB.linesFromText(t);return l.index.load(c.lines),o}};Qoe.changeNumberThreshold=8,Qoe.changeLengthThreshold=256,Qoe.maxVersions=8;var Zoe=Qoe,Ynt=class A_t{constructor(t,o,l,c=Yu){this.version=t,this.cache=o,this.index=l,this.changesSincePreviousVersion=c}getText(t,o){return this.index.getText(t,o-t)}getLength(){return this.index.getLength()}getChangeRange(t){if(t instanceof A_t&&this.cache===t.cache)return this.version<=t.version?iz:this.cache.getTextChangesBetweenVersions(t.version,this.version)}},RB=class N8e{constructor(){this.checkEdits=!1}absolutePositionOfStartOfLine(t){return this.lineNumberToInfo(t).absolutePosition}positionToLineOffset(t){let{oneBasedLine:o,zeroBasedColumn:l}=this.root.charOffsetToLineInfo(1,t);return{line:o,offset:l+1}}positionToColumnAndLineText(t){return this.root.charOffsetToLineInfo(1,t)}getLineCount(){return this.root.lineCount()}lineNumberToInfo(t){let o=this.getLineCount();if(t<=o){let{position:l,leaf:c}=this.root.lineNumberToInfo(t,0);return{absolutePosition:l,lineText:c&&c.text}}else return{absolutePosition:this.root.charCount(),lineText:void 0}}load(t){if(t.length>0){let o=[];for(let l=0;l<t.length;l++)o[l]=new jK(t[l]);this.root=N8e.buildTreeFromBottom(o)}else this.root=new ak}walk(t,o,l){this.root.walk(t,o,l)}getText(t,o){let l="";return o>0&&t<this.root.charCount()&&this.walk(t,o,{goSubtree:!0,done:!1,leaf:(c,p,m)=>{l=l.concat(m.text.substring(c,c+p))}}),l}getLength(){return this.root.charCount()}every(t,o,l){l||(l=this.root.charCount());let c={goSubtree:!0,done:!1,leaf(p,m,y){t(y,p,m)||(this.done=!0)}};return this.walk(o,l-o,c),!c.done}edit(t,o,l){if(this.root.charCount()===0)return F.assert(o===0),l!==void 0?(this.load(N8e.linesFromText(l).lines),this):void 0;{let c;if(this.checkEdits){let y=this.getText(0,this.root.charCount());c=y.slice(0,t)+l+y.slice(t+o)}let p=new CVt,m=!1;if(t>=this.root.charCount()){t=this.root.charCount()-1;let y=this.getText(t,1);l?l=y+l:l=y,o=0,m=!0}else if(o>0){let y=t+o,{zeroBasedColumn:h,lineText:E}=this.positionToColumnAndLineText(y);h===0&&(o+=E.length,l=l?l+E:E)}if(this.root.walk(t,o,p),p.insertLines(l,m),this.checkEdits){let y=p.lineIndex.getText(0,p.lineIndex.getLength());F.assert(c===y,"buffer edit mismatch")}return p.lineIndex}}static buildTreeFromBottom(t){if(t.length<ok)return new ak(t);let o=new Array(Math.ceil(t.length/ok)),l=0;for(let c=0;c<o.length;c++){let p=Math.min(l+ok,t.length);o[c]=new ak(t.slice(l,p)),l=p}return this.buildTreeFromBottom(o)}static linesFromText(t){let o=yD(t);if(o.length===0)return{lines:[],lineMap:o};let l=new Array(o.length),c=o.length-1;for(let m=0;m<c;m++)l[m]=t.substring(o[m],o[m+1]);let p=t.substring(o[c]);return p.length>0?l[c]=p:l.pop(),{lines:l,lineMap:o}}},ak=class A8e{constructor(t=[]){this.children=t,this.totalChars=0,this.totalLines=0,t.length&&this.updateCounts()}isLeaf(){return!1}updateCounts(){this.totalChars=0,this.totalLines=0;for(let t of this.children)this.totalChars+=t.charCount(),this.totalLines+=t.lineCount()}execWalk(t,o,l,c,p){return l.pre&&l.pre(t,o,this.children[c],this,p),l.goSubtree?(this.children[c].walk(t,o,l),l.post&&l.post(t,o,this.children[c],this,p)):l.goSubtree=!0,l.done}skipChild(t,o,l,c,p){c.pre&&!c.done&&(c.pre(t,o,this.children[l],this,p),c.goSubtree=!0)}walk(t,o,l){let c=0,p=this.children[c].charCount(),m=t;for(;m>=p;)this.skipChild(m,o,c,l,0),m-=p,c++,p=this.children[c].charCount();if(m+o<=p){if(this.execWalk(m,o,l,c,2))return}else{if(this.execWalk(m,p-m,l,c,1))return;let y=o-(p-m);for(c++,p=this.children[c].charCount();y>p;){if(this.execWalk(0,p,l,c,3))return;y-=p,c++,p=this.children[c].charCount()}if(y>0&&this.execWalk(0,y,l,c,4))return}if(l.pre){let y=this.children.length;if(c<y-1)for(let h=c+1;h<y;h++)this.skipChild(0,0,h,l,5)}}charOffsetToLineInfo(t,o){if(this.children.length===0)return{oneBasedLine:t,zeroBasedColumn:o,lineText:void 0};for(let p of this.children){if(p.charCount()>o)return p.isLeaf()?{oneBasedLine:t,zeroBasedColumn:o,lineText:p.text}:p.charOffsetToLineInfo(t,o);o-=p.charCount(),t+=p.lineCount()}let l=this.lineCount();if(l===0)return{oneBasedLine:1,zeroBasedColumn:0,lineText:void 0};let c=F.checkDefined(this.lineNumberToInfo(l,0).leaf);return{oneBasedLine:l,zeroBasedColumn:c.charCount(),lineText:void 0}}lineNumberToInfo(t,o){for(let l of this.children){let c=l.lineCount();if(c>=t)return l.isLeaf()?{position:o,leaf:l}:l.lineNumberToInfo(t,o);t-=c,o+=l.charCount()}return{position:o,leaf:void 0}}splitAfter(t){let o,l=this.children.length;t++;let c=t;if(t<l){for(o=new A8e;t<l;)o.add(this.children[t]),t++;o.updateCounts()}return this.children.length=c,o}remove(t){let o=this.findChildIndex(t),l=this.children.length;if(o<l-1)for(let c=o;c<l-1;c++)this.children[c]=this.children[c+1];this.children.pop()}findChildIndex(t){let o=this.children.indexOf(t);return F.assert(o!==-1),o}insertAt(t,o){let l=this.findChildIndex(t),c=this.children.length,p=o.length;if(c<ok&&l===c-1&&p===1)return this.add(o[0]),this.updateCounts(),[];{let m=this.splitAfter(l),y=0;for(l++;l<ok&&y<p;)this.children[l]=o[y],l++,y++;let h=[],E=0;if(y<p){E=Math.ceil((p-y)/ok),h=new Array(E);let T=0;for(let R=0;R<E;R++)h[R]=new A8e;let N=h[0];for(;y<p;)N.add(o[y]),y++,N.children.length===ok&&(T++,N=h[T]);for(let R=h.length-1;R>=0;R--)h[R].children.length===0&&h.pop()}m&&h.push(m),this.updateCounts();for(let T=0;T<E;T++)h[T].updateCounts();return h}}add(t){this.children.push(t),F.assert(this.children.length<=ok)}charCount(){return this.totalChars}lineCount(){return this.totalLines}},jK=class{constructor(e){this.text=e}isLeaf(){return!0}walk(e,t,o){o.leaf(e,t,this)}charCount(){return this.text.length}lineCount(){return 1}},Qnt=class C_t{constructor(t,o,l,c,p,m){this.telemetryEnabled=t,this.logger=o,this.host=l,this.globalTypingsCacheLocation=c,this.event=p,this.maxActiveRequestCount=m,this.activeRequestCount=0,this.requestQueue=DW(),this.requestMap=new Map,this.requestedRegistry=!1,this.packageInstallId=0}isKnownTypesPackageName(t){var o;return Fy.validatePackageName(t)!==Fy.NameValidationResult.Ok?!1:(this.requestedRegistry||(this.requestedRegistry=!0,this.installer.send({kind:"typesRegistry"})),!!((o=this.typesRegistryCache)!=null&&o.has(t)))}installPackage(t){this.packageInstallId++;let o={kind:"installPackage",...t,id:this.packageInstallId},l=new Promise((c,p)=>{(this.packageInstalledPromise??(this.packageInstalledPromise=new Map)).set(this.packageInstallId,{resolve:c,reject:p})});return this.installer.send(o),l}attach(t){this.projectService=t,this.installer=this.createInstallerProcess()}onProjectClosed(t){this.installer.send({projectName:t.getProjectName(),kind:"closeProject"})}enqueueInstallTypingsRequest(t,o,l){let c=oRe(t,o,l);this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling throttled operation:${OT(c)}`),this.activeRequestCount<this.maxActiveRequestCount?this.scheduleRequest(c):(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Deferring request for: ${c.projectName}`),this.requestQueue.enqueue(c),this.requestMap.set(c.projectName,c))}handleMessage(t){var o,l;switch(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Received response:${OT(t)}`),t.kind){case Tne:this.typesRegistryCache=new Map(Object.entries(t.typesRegistry));break;case aj:{let c=(o=this.packageInstalledPromise)==null?void 0:o.get(t.id);F.assertIsDefined(c,"Should find the promise for package install"),(l=this.packageInstalledPromise)==null||l.delete(t.id),t.success?c.resolve({successMessage:t.message}):c.reject(t.message),this.projectService.updateTypingsForProject(t),this.event(t,"setTypings");break}case mAe:{let c={message:t.message};this.event(c,"typesInstallerInitializationFailed");break}case Nne:{let c={eventId:t.eventId,packages:t.packagesToInstall};this.event(c,"beginInstallTypes");break}case Ane:{if(this.telemetryEnabled){let m={telemetryEventName:"typingsInstalled",payload:{installedPackages:t.packagesToInstall.join(","),installSuccess:t.installSuccess,typingsInstallerVersion:t.typingsInstallerVersion}};this.event(m,"telemetry")}let c={eventId:t.eventId,packages:t.packagesToInstall,success:t.installSuccess};this.event(c,"endInstallTypes");break}case oj:{this.projectService.updateTypingsForProject(t);break}case ij:{for(this.activeRequestCount>0?this.activeRequestCount--:F.fail("TIAdapter:: Received too many responses");!this.requestQueue.isEmpty();){let c=this.requestQueue.dequeue();if(this.requestMap.get(c.projectName)===c){this.requestMap.delete(c.projectName),this.scheduleRequest(c);break}this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Skipping defunct request for: ${c.projectName}`)}this.projectService.updateTypingsForProject(t),this.event(t,"setTypings");break}case E3:this.projectService.watchTypingLocations(t);break;default:}}scheduleRequest(t){this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling request for: ${t.projectName}`),this.activeRequestCount++,this.host.setTimeout(()=>{this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Sending request:${OT(t)}`),this.installer.send(t)},C_t.requestDelayMillis,`${t.projectName}::${t.kind}`)}};Qnt.requestDelayMillis=100;var Znt=Qnt,ert={};g(ert,{ActionInvalidate:()=>oj,ActionPackageInstalled:()=>aj,ActionSet:()=>ij,ActionWatchTypingLocations:()=>E3,Arguments:()=>Cne,AutoImportProviderProject:()=>TRe,AuxiliaryProject:()=>ERe,CharRangeSection:()=>JRe,CloseFileWatcherEvent:()=>Uoe,CommandNames:()=>Unt,ConfigFileDiagEvent:()=>Foe,ConfiguredProject:()=>NRe,ConfiguredProjectLoadKind:()=>RRe,CreateDirectoryWatcherEvent:()=>zoe,CreateFileWatcherEvent:()=>Goe,Errors:()=>pS,EventBeginInstallTypes:()=>Nne,EventEndInstallTypes:()=>Ane,EventInitializationFailed:()=>mAe,EventTypesRegistry:()=>Tne,ExternalProject:()=>Roe,GcTimer:()=>pRe,InferredProject:()=>SRe,LargeFileReferencedEvent:()=>Ooe,LineIndex:()=>RB,LineLeaf:()=>jK,LineNode:()=>ak,LogLevel:()=>rRe,Msg:()=>iRe,OpenFileInfoTelemetryEvent:()=>ARe,Project:()=>jP,ProjectInfoTelemetryEvent:()=>Boe,ProjectKind:()=>NB,ProjectLanguageServiceStateEvent:()=>Woe,ProjectLoadingFinishEvent:()=>woe,ProjectLoadingStartEvent:()=>koe,ProjectService:()=>WRe,ProjectsUpdatedInBackgroundEvent:()=>zK,ScriptInfo:()=>gRe,ScriptVersionCache:()=>Zoe,Session:()=>qnt,TextStorage:()=>_Re,ThrottledOperations:()=>dRe,TypingsInstallerAdapter:()=>Znt,allFilesAreJsOrDts:()=>yRe,allRootFilesAreJsOrDts:()=>hRe,asNormalizedPath:()=>_nt,convertCompilerOptions:()=>UK,convertFormatOptions:()=>rk,convertScriptKindName:()=>joe,convertTypeAcquisition:()=>IRe,convertUserPreferences:()=>DRe,convertWatchOptions:()=>DB,countEachFileTypes:()=>AB,createInstallTypingsRequest:()=>oRe,createModuleSpecifierCache:()=>zRe,createNormalizedPathMap:()=>gnt,createPackageJsonCache:()=>URe,createSortedArray:()=>uRe,emptyArray:()=>Yu,findArgument:()=>pKe,formatDiagnosticToProtocol:()=>PB,formatMessage:()=>VRe,getBaseConfigFileName:()=>Poe,getLocationInNewDocument:()=>qRe,hasArgument:()=>dKe,hasNoTypeScriptSource:()=>vRe,indent:()=>uF,isBackgroundProject:()=>IB,isConfigFile:()=>BRe,isConfiguredProject:()=>bE,isDynamicFileName:()=>TB,isExternalProject:()=>CB,isInferredProject:()=>nk,isInferredProjectName:()=>aRe,isProjectDeferredClose:()=>GK,makeAutoImportProviderProjectName:()=>lRe,makeAuxiliaryProjectName:()=>cRe,makeInferredProjectName:()=>sRe,maxFileSize:()=>Moe,maxProgramSizeForNonTsFiles:()=>Loe,normalizedPathToPath:()=>tk,nowString:()=>fKe,nullCancellationToken:()=>Bnt,nullTypingsInstaller:()=>VK,protocol:()=>fRe,stringifyIndented:()=>OT,toEvent:()=>jRe,toNormalizedPath:()=>cc,tryConvertScriptKindName:()=>Voe,typingsInstaller:()=>nRe,updateProjectIfDirty:()=>X_}),typeof console<"u"&&(F.loggingHost={log(e,t){switch(e){case 1:return console.error(t);case 2:return console.warn(t);case 3:return console.log(t);case 4:return console.log(t)}}})})({get exports(){return b_t},set exports(s){b_t=s,typeof qce<"u"&&qce.exports&&(qce.exports=s)}})});var M_t=Ln((uPn,L_t)=>{"use strict";L_t.exports=P_t;function P_t(s,n,a){s instanceof RegExp&&(s=D_t(s,a)),n instanceof RegExp&&(n=D_t(n,a));var u=R_t(s,n,a);return u&&{start:u[0],end:u[1],pre:a.slice(0,u[0]),body:a.slice(u[0]+s.length,u[1]),post:a.slice(u[1]+n.length)}}function D_t(s,n){var a=n.match(s);return a?a[0]:null}P_t.range=R_t;function R_t(s,n,a){var u,f,g,b,C,k=a.indexOf(s),B=a.indexOf(n,k+1),K=k;if(k>=0&&B>0){if(s===n)return[k,B];for(u=[],g=a.length;K>=0&&!C;)K==k?(u.push(K),k=a.indexOf(s,K+1)):u.length==1?C=[u.pop(),B]:(f=u.pop(),f<g&&(g=f,b=B),B=a.indexOf(n,K+1)),K=k<B&&k>=0?k:B;u.length&&(C=[g,b])}return C}});var z_t=Ln((dPn,G_t)=>{var k_t=M_t();G_t.exports=dun;var w_t="\0SLASH"+Math.random()+"\0",O_t="\0OPEN"+Math.random()+"\0",I8e="\0CLOSE"+Math.random()+"\0",F_t="\0COMMA"+Math.random()+"\0",W_t="\0PERIOD"+Math.random()+"\0";function C8e(s){return parseInt(s,10)==s?parseInt(s,10):s.charCodeAt(0)}function cun(s){return s.split("\\\\").join(w_t).split("\\{").join(O_t).split("\\}").join(I8e).split("\\,").join(F_t).split("\\.").join(W_t)}function uun(s){return s.split(w_t).join("\\").split(O_t).join("{").split(I8e).join("}").split(F_t).join(",").split(W_t).join(".")}function B_t(s){if(!s)return[""];var n=[],a=k_t("{","}",s);if(!a)return s.split(",");var u=a.pre,f=a.body,g=a.post,b=u.split(",");b[b.length-1]+="{"+f+"}";var C=B_t(g);return g.length&&(b[b.length-1]+=C.shift(),b.push.apply(b,C)),n.push.apply(n,b),n}function dun(s){return s?(s.substr(0,2)==="{}"&&(s="\\{\\}"+s.substr(2)),iJ(cun(s),!0).map(uun)):[]}function pun(s){return"{"+s+"}"}function fun(s){return/^-?0\d/.test(s)}function mun(s,n){return s<=n}function _un(s,n){return s>=n}function iJ(s,n){var a=[],u=k_t("{","}",s);if(!u)return[s];var f=u.pre,g=u.post.length?iJ(u.post,!1):[""];if(/\$$/.test(u.pre))for(var b=0;b<g.length;b++){var C=f+"{"+u.body+"}"+g[b];a.push(C)}else{var k=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(u.body),B=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(u.body),K=k||B,re=u.body.indexOf(",")>=0;if(!K&&!re)return u.post.match(/,(?!,).*\}/)?(s=u.pre+"{"+u.body+I8e+u.post,iJ(s)):[s];var q;if(K)q=u.body.split(/\.\./);else if(q=B_t(u.body),q.length===1&&(q=iJ(q[0],!1).map(pun),q.length===1))return g.map(function(br){return u.pre+q[0]+br});var Me;if(K){var Te=C8e(q[0]),Ee=C8e(q[1]),St=Math.max(q[0].length,q[1].length),Ot=q.length==3?Math.max(Math.abs(C8e(q[2])),1):1,ft=mun,Gt=Ee<Te;Gt&&(Ot*=-1,ft=_un);var En=q.some(fun);Me=[];for(var vr=Te;ft(vr,Ee);vr+=Ot){var rn;if(B)rn=String.fromCharCode(vr),rn==="\\"&&(rn="");else if(rn=String(vr),En){var Ht=St-rn.length;if(Ht>0){var hn=new Array(Ht+1).join("0");vr<0?rn="-"+hn+rn.slice(1):rn=hn+rn}}Me.push(rn)}}else{Me=[];for(var ur=0;ur<q.length;ur++)Me.push.apply(Me,iJ(q[ur],!1))}for(var ur=0;ur<Me.length;ur++)for(var b=0;b<g.length;b++){var C=f+Me[ur]+g[b];(!n||K||C)&&a.push(C)}}return a}});var U_t=Ln(Jce=>{"use strict";Object.defineProperty(Jce,"__esModule",{value:!0});Jce.assertValidPattern=void 0;var gun=1024*64,hun=s=>{if(typeof s!="string")throw new TypeError("invalid pattern");if(s.length>gun)throw new TypeError("pattern is too long")};Jce.assertValidPattern=hun});var j_t=Ln($ce=>{"use strict";Object.defineProperty($ce,"__esModule",{value:!0});$ce.parseClass=void 0;var yun={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},oJ=s=>s.replace(/[[\]\\-]/g,"\\$&"),vun=s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),V_t=s=>s.join(""),bun=(s,n)=>{let a=n;if(s.charAt(a)!=="[")throw new Error("not in a brace expression");let u=[],f=[],g=a+1,b=!1,C=!1,k=!1,B=!1,K=a,re="";e:for(;g<s.length;){let Ee=s.charAt(g);if((Ee==="!"||Ee==="^")&&g===a+1){B=!0,g++;continue}if(Ee==="]"&&b&&!k){K=g+1;break}if(b=!0,Ee==="\\"&&!k){k=!0,g++;continue}if(Ee==="["&&!k){for(let[St,[Ot,ft,Gt]]of Object.entries(yun))if(s.startsWith(St,g)){if(re)return["$.",!1,s.length-a,!0];g+=St.length,Gt?f.push(Ot):u.push(Ot),C=C||ft;continue e}}if(k=!1,re){Ee>re?u.push(oJ(re)+"-"+oJ(Ee)):Ee===re&&u.push(oJ(Ee)),re="",g++;continue}if(s.startsWith("-]",g+1)){u.push(oJ(Ee+"-")),g+=2;continue}if(s.startsWith("-",g+1)){re=Ee,g+=2;continue}u.push(oJ(Ee)),g++}if(K<g)return["",!1,0,!1];if(!u.length&&!f.length)return["$.",!1,s.length-a,!0];if(f.length===0&&u.length===1&&/^\\?.$/.test(u[0])&&!B){let Ee=u[0].length===2?u[0].slice(-1):u[0];return[vun(Ee),!1,K-a,!1]}let q="["+(B?"^":"")+V_t(u)+"]",Me="["+(B?"":"^")+V_t(f)+"]";return[u.length&&f.length?"("+q+"|"+Me+")":u.length?q:Me,C,K-a,!0]};$ce.parseClass=bun});var Yce=Ln(Xce=>{"use strict";Object.defineProperty(Xce,"__esModule",{value:!0});Xce.unescape=void 0;var Sun=(s,{windowsPathsNoEscape:n=!1}={})=>n?s.replace(/\[([^\/\\])\]/g,"$1"):s.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");Xce.unescape=Sun});var R8e=Ln(tue=>{"use strict";var ZE;Object.defineProperty(tue,"__esModule",{value:!0});tue.AST=void 0;var Eun=j_t(),Qce=Yce(),xun=new Set(["!","?","+","*","@"]),D8e=s=>xun.has(s),K_t=s=>D8e(s.type),Tun=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),Nun=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),Aun=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),H_t=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),Cun="(?!(?:^|/)\\.\\.?(?:$|/))",Zce="(?!\\.)",Iun=new Set(["[","."]),Dun=new Set(["..","."]),Pun=new Set("().*{}+?[]^$\\!"),Run=s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),P8e="[^/]",q_t=P8e+"*?",J_t=P8e+"+?",eue=class{type;#e;#t;#n=!1;#r=[];#i;#o;#a;#s=!1;#c;#m;#_=!1;constructor(n,a,u={}){this.type=n,n&&(this.#t=!0),this.#i=a,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?u:this.#e.#c,this.#a=this.#e===this?[]:this.#e.#a,n==="!"&&!this.#e.#s&&this.#a.push(this),this.#o=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let n of this.#r)if(typeof n!="string"&&(n.type||n.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#m!==void 0?this.#m:this.type?this.#m=this.type+"("+this.#r.map(n=>String(n)).join("|")+")":this.#m=this.#r.map(n=>String(n)).join("")}#x(){if(this!==this.#e)throw new Error("should only call on root");if(this.#s)return this;this.toString(),this.#s=!0;let n;for(;n=this.#a.pop();){if(n.type!=="!")continue;let a=n,u=a.#i;for(;u;){for(let f=a.#o+1;!u.type&&f<u.#r.length;f++)for(let g of n.#r){if(typeof g=="string")throw new Error("string part in extglob AST??");g.copyIn(u.#r[f])}a=u,u=a.#i}}return this}push(...n){for(let a of n)if(a!==""){if(typeof a!="string"&&!(a instanceof ZE&&a.#i===this))throw new Error("invalid part: "+a);this.#r.push(a)}}toJSON(){let n=this.type===null?this.#r.slice().map(a=>typeof a=="string"?a:a.toJSON()):[this.type,...this.#r.map(a=>a.toJSON())];return this.isStart()&&!this.type&&n.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type==="!")&&n.push({}),n}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#o===0)return!0;let n=this.#i;for(let a=0;a<this.#o;a++){let u=n.#r[a];if(!(u instanceof ZE&&u.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let n=this.#i?this.#i.#r.length:0;return this.#o===n-1}copyIn(n){typeof n=="string"?this.push(n):this.push(n.clone(this))}clone(n){let a=new ZE(this.type,n);for(let u of this.#r)a.copyIn(u);return a}static#S(n,a,u,f,g){let b=f.maxExtglobRecursion??2,C=!1,k=!1,B=-1,K=!1;if(a.type===null){let Ee=u,St="";for(;Ee<n.length;){let Ot=n.charAt(Ee++);if(C||Ot==="\\"){C=!C,St+=Ot;continue}if(k){Ee===B+1?(Ot==="^"||Ot==="!")&&(K=!0):Ot==="]"&&!(Ee===B+2&&K)&&(k=!1),St+=Ot;continue}else if(Ot==="["){k=!0,B=Ee,K=!1,St+=Ot;continue}if(!f.noext&&D8e(Ot)&&n.charAt(Ee)==="("&&g<=b){a.push(St),St="";let Gt=new ZE(Ot,a);Ee=ZE.#S(n,Gt,Ee,f,g+1),a.push(Gt);continue}St+=Ot}return a.push(St),Ee}let re=u+1,q=new ZE(null,a),Me=[],Te="";for(;re<n.length;){let Ee=n.charAt(re++);if(C||Ee==="\\"){C=!C,Te+=Ee;continue}if(k){re===B+1?(Ee==="^"||Ee==="!")&&(K=!0):Ee==="]"&&!(re===B+2&&K)&&(k=!1),Te+=Ee;continue}else if(Ee==="["){k=!0,B=re,K=!1,Te+=Ee;continue}if(D8e(Ee)&&n.charAt(re)==="("&&(g<=b||a&&a.#d(Ee))){let Ot=a&&a.#d(Ee)?0:1;q.push(Te),Te="";let ft=new ZE(Ee,q);q.push(ft),re=ZE.#S(n,ft,re,f,g+Ot);continue}if(Ee==="|"){q.push(Te),Te="",Me.push(q),q=new ZE(null,a);continue}if(Ee===")")return Te===""&&a.#r.length===0&&(a.#_=!0),q.push(Te),Te="",a.push(...Me,q),re;Te+=Ee}return a.type=null,a.#t=void 0,a.#r=[n.substring(u-1)],re}#h(n){return this.#y(n,Nun)}#y(n,a=Tun){if(!n||typeof n!="object"||n.type!==null||n.#r.length!==1||this.type===null)return!1;let u=n.#r[0];return!u||typeof u!="object"||u.type===null?!1:this.#d(u.type,a)}#d(n,a=Aun){return!!a.get(this.type)?.includes(n)}#p(n,a){let u=n.#r[0],f=new ZE(null,u,this.options);f.#r.push(""),u.push(f),this.#g(n,a)}#g(n,a){let u=n.#r[0];this.#r.splice(a,1,...u.#r);for(let f of u.#r)typeof f=="object"&&(f.#i=this);this.#m=void 0}#E(n){return!!H_t.get(this.type)?.has(n)}#f(n){if(!n||typeof n!="object"||n.type!==null||n.#r.length!==1||this.type===null||this.#r.length!==1)return!1;let a=n.#r[0];return!a||typeof a!="object"||a.type===null?!1:this.#E(a.type)}#v(n){let a=H_t.get(this.type),u=n.#r[0],f=a?.get(u.type);if(!f)return!1;this.#r=u.#r;for(let g of this.#r)typeof g=="object"&&(g.#i=this);this.type=f,this.#m=void 0,this.#_=!1}#l(){if(K_t(this)){let n=0,a=!1;do{a=!0;for(let u=0;u<this.#r.length;u++){let f=this.#r[u];typeof f=="object"&&(f.#l(),this.#y(f)?(a=!1,this.#g(f,u)):this.#h(f)?(a=!1,this.#p(f,u)):this.#f(f)&&(a=!1,this.#v(f)))}}while(!a&&++n<10)}else for(let n of this.#r)typeof n=="object"&&n.#l();this.#m=void 0}static fromGlob(n,a={}){let u=new ZE(null,void 0,a);return ZE.#S(n,u,0,a,0),u}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let n=this.toString(),[a,u,f,g]=this.toRegExpSource();if(!(f||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&n.toUpperCase()!==n.toLowerCase()))return u;let C=(this.#c.nocase?"i":"")+(g?"u":"");return Object.assign(new RegExp(`^${a}$`,C),{_src:a,_glob:n})}get options(){return this.#c}toRegExpSource(n){let a=n??!!this.#c.dot;if(this.#e===this&&(this.#l(),this.#x()),!K_t(this)){let k=this.isStart()&&this.isEnd(),B=this.#r.map(Me=>{let[Te,Ee,St,Ot]=typeof Me=="string"?ZE.#T(Me,this.#t,k):Me.toRegExpSource(n);return this.#t=this.#t||St,this.#n=this.#n||Ot,Te}).join(""),K="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&Dun.has(this.#r[0]))){let Te=Iun,Ee=a&&Te.has(B.charAt(0))||B.startsWith("\\.")&&Te.has(B.charAt(2))||B.startsWith("\\.\\.")&&Te.has(B.charAt(4)),St=!a&&!n&&Te.has(B.charAt(0));K=Ee?Cun:St?Zce:""}let re="";return this.isEnd()&&this.#e.#s&&this.#i?.type==="!"&&(re="(?:$|\\/)"),[K+B+re,(0,Qce.unescape)(B),this.#t=!!this.#t,this.#n]}let u=this.type==="*"||this.type==="+",f=this.type==="!"?"(?:(?!(?:":"(?:",g=this.#u(a);if(this.isStart()&&this.isEnd()&&!g&&this.type!=="!"){let k=this.toString(),B=this;return B.#r=[k],B.type=null,B.#t=void 0,[k,(0,Qce.unescape)(this.toString()),!1,!1]}let b=!u||n||a||!Zce?"":this.#u(!0);b===g&&(b=""),b&&(g=`(?:${g})(?:${b})*?`);let C="";if(this.type==="!"&&this.#_)C=(this.isStart()&&!a?Zce:"")+J_t;else{let k=this.type==="!"?"))"+(this.isStart()&&!a&&!n?Zce:"")+q_t+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&b?")":this.type==="*"&&b?")?":`)${this.type}`;C=f+g+k}return[C,(0,Qce.unescape)(g),this.#t=!!this.#t,this.#n]}#u(n){return this.#r.map(a=>{if(typeof a=="string")throw new Error("string type in extglob ast??");let[u,f,g,b]=a.toRegExpSource(n);return this.#n=this.#n||b,u}).filter(a=>!(this.isStart()&&this.isEnd())||!!a).join("|")}static#T(n,a,u=!1){let f=!1,g="",b=!1,C=!1;for(let k=0;k<n.length;k++){let B=n.charAt(k);if(f){f=!1,g+=(Pun.has(B)?"\\":"")+B,C=!1;continue}if(B==="\\"){k===n.length-1?g+="\\\\":f=!0;continue}if(B==="["){let[K,re,q,Me]=(0,Eun.parseClass)(n,k);if(q){g+=K,b=b||re,k+=q-1,a=a||Me,C=!1;continue}}if(B==="*"){if(C)continue;C=!0,g+=u&&/^[*]+$/.test(n)?J_t:q_t,a=!0;continue}else C=!1;if(B==="?"){g+=P8e,a=!0;continue}g+=Run(B)}return[g,(0,Qce.unescape)(n),!!a,b]}};tue.AST=eue;ZE=eue});var L8e=Ln(nue=>{"use strict";Object.defineProperty(nue,"__esModule",{value:!0});nue.escape=void 0;var Lun=(s,{windowsPathsNoEscape:n=!1}={})=>n?s.replace(/[?*()[\]]/g,"[$&]"):s.replace(/[?*()[\]\\]/g,"\\$&");nue.escape=Lun});var tgt=Ln(ks=>{"use strict";var Mun=ks&&ks.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ks,"__esModule",{value:!0});ks.unescape=ks.escape=ks.AST=ks.Minimatch=ks.match=ks.makeRe=ks.braceExpand=ks.defaults=ks.filter=ks.GLOBSTAR=ks.sep=ks.minimatch=void 0;var kun=Mun(z_t()),rue=U_t(),Y_t=R8e(),wun=L8e(),Oun=Yce(),Fun=(s,n,a={})=>((0,rue.assertValidPattern)(n),!a.nocomment&&n.charAt(0)==="#"?!1:new F8(n,a).match(s));ks.minimatch=Fun;var Wun=/^\*+([^+@!?\*\[\(]*)$/,Bun=s=>n=>!n.startsWith(".")&&n.endsWith(s),Gun=s=>n=>n.endsWith(s),zun=s=>(s=s.toLowerCase(),n=>!n.startsWith(".")&&n.toLowerCase().endsWith(s)),Uun=s=>(s=s.toLowerCase(),n=>n.toLowerCase().endsWith(s)),Vun=/^\*+\.\*+$/,jun=s=>!s.startsWith(".")&&s.includes("."),Kun=s=>s!=="."&&s!==".."&&s.includes("."),Hun=/^\.\*+$/,qun=s=>s!=="."&&s!==".."&&s.startsWith("."),Jun=/^\*+$/,$un=s=>s.length!==0&&!s.startsWith("."),Xun=s=>s.length!==0&&s!=="."&&s!=="..",Yun=/^\?+([^+@!?\*\[\(]*)?$/,Qun=([s,n=""])=>{let a=Q_t([s]);return n?(n=n.toLowerCase(),u=>a(u)&&u.toLowerCase().endsWith(n)):a},Zun=([s,n=""])=>{let a=Z_t([s]);return n?(n=n.toLowerCase(),u=>a(u)&&u.toLowerCase().endsWith(n)):a},edn=([s,n=""])=>{let a=Z_t([s]);return n?u=>a(u)&&u.endsWith(n):a},tdn=([s,n=""])=>{let a=Q_t([s]);return n?u=>a(u)&&u.endsWith(n):a},Q_t=([s])=>{let n=s.length;return a=>a.length===n&&!a.startsWith(".")},Z_t=([s])=>{let n=s.length;return a=>a.length===n&&a!=="."&&a!==".."},egt=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",$_t={win32:{sep:"\\"},posix:{sep:"/"}};ks.sep=egt==="win32"?$_t.win32.sep:$_t.posix.sep;ks.minimatch.sep=ks.sep;ks.GLOBSTAR=Symbol("globstar **");ks.minimatch.GLOBSTAR=ks.GLOBSTAR;var ndn="[^/]",rdn=ndn+"*?",idn="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",odn="(?:(?!(?:\\/|^)\\.).)*?",adn=(s,n={})=>a=>(0,ks.minimatch)(a,s,n);ks.filter=adn;ks.minimatch.filter=ks.filter;var IN=(s,n={})=>Object.assign({},s,n),sdn=s=>{if(!s||typeof s!="object"||!Object.keys(s).length)return ks.minimatch;let n=ks.minimatch;return Object.assign((u,f,g={})=>n(u,f,IN(s,g)),{Minimatch:class extends n.Minimatch{constructor(f,g={}){super(f,IN(s,g))}static defaults(f){return n.defaults(IN(s,f)).Minimatch}},AST:class extends n.AST{constructor(f,g,b={}){super(f,g,IN(s,b))}static fromGlob(f,g={}){return n.AST.fromGlob(f,IN(s,g))}},unescape:(u,f={})=>n.unescape(u,IN(s,f)),escape:(u,f={})=>n.escape(u,IN(s,f)),filter:(u,f={})=>n.filter(u,IN(s,f)),defaults:u=>n.defaults(IN(s,u)),makeRe:(u,f={})=>n.makeRe(u,IN(s,f)),braceExpand:(u,f={})=>n.braceExpand(u,IN(s,f)),match:(u,f,g={})=>n.match(u,f,IN(s,g)),sep:n.sep,GLOBSTAR:ks.GLOBSTAR})};ks.defaults=sdn;ks.minimatch.defaults=ks.defaults;var ldn=(s,n={})=>((0,rue.assertValidPattern)(s),n.nobrace||!/\{(?:(?!\{).)*\}/.test(s)?[s]:(0,kun.default)(s));ks.braceExpand=ldn;ks.minimatch.braceExpand=ks.braceExpand;var cdn=(s,n={})=>new F8(s,n).makeRe();ks.makeRe=cdn;ks.minimatch.makeRe=ks.makeRe;var udn=(s,n,a={})=>{let u=new F8(n,a);return s=s.filter(f=>u.match(f)),u.options.nonull&&!s.length&&s.push(n),s};ks.match=udn;ks.minimatch.match=ks.match;var X_t=/[?*]|[+@!]\(.*?\)|\[|\]/,ddn=s=>s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),F8=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(n,a={}){(0,rue.assertValidPattern)(n),a=a||{},this.options=a,this.maxGlobstarRecursion=a.maxGlobstarRecursion??200,this.pattern=n,this.platform=a.platform||egt,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!a.windowsPathsNoEscape||a.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!a.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!a.nonegate,this.comment=!1,this.empty=!1,this.partial=!!a.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=a.windowsNoMagicRoot!==void 0?a.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let n of this.set)for(let a of n)if(typeof a!="string")return!0;return!1}debug(...n){}make(){let n=this.pattern,a=this.options;if(!a.nocomment&&n.charAt(0)==="#"){this.comment=!0;return}if(!n){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],a.debug&&(this.debug=(...g)=>console.error(...g)),this.debug(this.pattern,this.globSet);let u=this.globSet.map(g=>this.slashSplit(g));this.globParts=this.preprocess(u),this.debug(this.pattern,this.globParts);let f=this.globParts.map((g,b,C)=>{if(this.isWindows&&this.windowsNoMagicRoot){let k=g[0]===""&&g[1]===""&&(g[2]==="?"||!X_t.test(g[2]))&&!X_t.test(g[3]),B=/^[a-z]:/i.test(g[0]);if(k)return[...g.slice(0,4),...g.slice(4).map(K=>this.parse(K))];if(B)return[g[0],...g.slice(1).map(K=>this.parse(K))]}return g.map(k=>this.parse(k))});if(this.debug(this.pattern,f),this.set=f.filter(g=>g.indexOf(!1)===-1),this.isWindows)for(let g=0;g<this.set.length;g++){let b=this.set[g];b[0]===""&&b[1]===""&&this.globParts[g][2]==="?"&&typeof b[3]=="string"&&/^[a-z]:$/i.test(b[3])&&(b[2]="?")}this.debug(this.pattern,this.set)}preprocess(n){if(this.options.noglobstar)for(let u=0;u<n.length;u++)for(let f=0;f<n[u].length;f++)n[u][f]==="**"&&(n[u][f]="*");let{optimizationLevel:a=1}=this.options;return a>=2?(n=this.firstPhasePreProcess(n),n=this.secondPhasePreProcess(n)):a>=1?n=this.levelOneOptimize(n):n=this.adjascentGlobstarOptimize(n),n}adjascentGlobstarOptimize(n){return n.map(a=>{let u=-1;for(;(u=a.indexOf("**",u+1))!==-1;){let f=u;for(;a[f+1]==="**";)f++;f!==u&&a.splice(u,f-u)}return a})}levelOneOptimize(n){return n.map(a=>(a=a.reduce((u,f)=>{let g=u[u.length-1];return f==="**"&&g==="**"?u:f===".."&&g&&g!==".."&&g!=="."&&g!=="**"?(u.pop(),u):(u.push(f),u)},[]),a.length===0?[""]:a))}levelTwoFileOptimize(n){Array.isArray(n)||(n=this.slashSplit(n));let a=!1;do{if(a=!1,!this.preserveMultipleSlashes){for(let f=1;f<n.length-1;f++){let g=n[f];f===1&&g===""&&n[0]===""||(g==="."||g==="")&&(a=!0,n.splice(f,1),f--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(a=!0,n.pop())}let u=0;for(;(u=n.indexOf("..",u+1))!==-1;){let f=n[u-1];f&&f!=="."&&f!==".."&&f!=="**"&&(a=!0,n.splice(u-1,2),u-=2)}}while(a);return n.length===0?[""]:n}firstPhasePreProcess(n){let a=!1;do{a=!1;for(let u of n){let f=-1;for(;(f=u.indexOf("**",f+1))!==-1;){let b=f;for(;u[b+1]==="**";)b++;b>f&&u.splice(f+1,b-f);let C=u[f+1],k=u[f+2],B=u[f+3];if(C!==".."||!k||k==="."||k===".."||!B||B==="."||B==="..")continue;a=!0,u.splice(f,1);let K=u.slice(0);K[f]="**",n.push(K),f--}if(!this.preserveMultipleSlashes){for(let b=1;b<u.length-1;b++){let C=u[b];b===1&&C===""&&u[0]===""||(C==="."||C==="")&&(a=!0,u.splice(b,1),b--)}u[0]==="."&&u.length===2&&(u[1]==="."||u[1]==="")&&(a=!0,u.pop())}let g=0;for(;(g=u.indexOf("..",g+1))!==-1;){let b=u[g-1];if(b&&b!=="."&&b!==".."&&b!=="**"){a=!0;let k=g===1&&u[g+1]==="**"?["."]:[];u.splice(g-1,2,...k),u.length===0&&u.push(""),g-=2}}}}while(a);return n}secondPhasePreProcess(n){for(let a=0;a<n.length-1;a++)for(let u=a+1;u<n.length;u++){let f=this.partsMatch(n[a],n[u],!this.preserveMultipleSlashes);if(f){n[a]=[],n[u]=f;break}}return n.filter(a=>a.length)}partsMatch(n,a,u=!1){let f=0,g=0,b=[],C="";for(;f<n.length&&g<a.length;)if(n[f]===a[g])b.push(C==="b"?a[g]:n[f]),f++,g++;else if(u&&n[f]==="**"&&a[g]===n[f+1])b.push(n[f]),f++;else if(u&&a[g]==="**"&&n[f]===a[g+1])b.push(a[g]),g++;else if(n[f]==="*"&&a[g]&&(this.options.dot||!a[g].startsWith("."))&&a[g]!=="**"){if(C==="b")return!1;C="a",b.push(n[f]),f++,g++}else if(a[g]==="*"&&n[f]&&(this.options.dot||!n[f].startsWith("."))&&n[f]!=="**"){if(C==="a")return!1;C="b",b.push(a[g]),f++,g++}else return!1;return n.length===a.length&&b}parseNegate(){if(this.nonegate)return;let n=this.pattern,a=!1,u=0;for(let f=0;f<n.length&&n.charAt(f)==="!";f++)a=!a,u++;u&&(this.pattern=n.slice(u)),this.negate=a}matchOne(n,a,u=!1){let f=0,g=0;if(this.isWindows){let C=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),k=!C&&n[0]===""&&n[1]===""&&n[2]==="?"&&/^[a-z]:$/i.test(n[3]),B=typeof a[0]=="string"&&/^[a-z]:$/i.test(a[0]),K=!B&&a[0]===""&&a[1]===""&&a[2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3]),re=k?3:C?0:void 0,q=K?3:B?0:void 0;if(typeof re=="number"&&typeof q=="number"){let[Me,Te]=[n[re],a[q]];Me.toLowerCase()===Te.toLowerCase()&&(a[q]=Me,g=q,f=re)}}let{optimizationLevel:b=1}=this.options;return b>=2&&(n=this.levelTwoFileOptimize(n)),a.includes(ks.GLOBSTAR)?this.#e(n,a,u,f,g):this.#n(n,a,u,f,g)}#e(n,a,u,f,g){let b=a.indexOf(ks.GLOBSTAR,g),C=a.lastIndexOf(ks.GLOBSTAR),[k,B,K]=u?[a.slice(g,b),a.slice(b+1),[]]:[a.slice(g,b),a.slice(b+1,C),a.slice(C+1)];if(k.length){let ft=n.slice(f,f+k.length);if(!this.#n(ft,k,u,0,0))return!1;f+=k.length}let re=0;if(K.length){if(K.length+f>n.length)return!1;let ft=n.length-K.length;if(this.#n(n,K,u,ft,0))re=K.length;else{if(n[n.length-1]!==""||f+K.length===n.length||(ft--,!this.#n(n,K,u,ft,0)))return!1;re=K.length+1}}if(!B.length){let ft=!!re;for(let Gt=f;Gt<n.length-re;Gt++){let En=String(n[Gt]);if(ft=!0,En==="."||En===".."||!this.options.dot&&En.startsWith("."))return!1}return u||ft}let q=[[[],0]],Me=q[0],Te=0,Ee=[0];for(let ft of B)ft===ks.GLOBSTAR?(Ee.push(Te),Me=[[],0],q.push(Me)):(Me[0].push(ft),Te++);let St=q.length-1,Ot=n.length-re;for(let ft of q)ft[1]=Ot-(Ee[St--]+ft[0].length);return!!this.#t(n,q,f,0,u,0,!!re)}#t(n,a,u,f,g,b,C){let k=a[f];if(!k){for(let re=u;re<n.length;re++){C=!0;let q=n[re];if(q==="."||q===".."||!this.options.dot&&q.startsWith("."))return!1}return C}let[B,K]=k;for(;u<=K;){if(this.#n(n.slice(0,u+B.length),B,g,u,0)&&b<this.maxGlobstarRecursion){let Me=this.#t(n,a,u+B.length,f+1,g,b+1,C);if(Me!==!1)return Me}let q=n[u];if(q==="."||q===".."||!this.options.dot&&q.startsWith("."))return!1;u++}return g||null}#n(n,a,u,f,g){let b,C,k,B;for(b=f,C=g,B=n.length,k=a.length;b<B&&C<k;b++,C++){this.debug("matchOne loop");let K=a[C],re=n[b];if(this.debug(a,K,re),K===!1||K===ks.GLOBSTAR)return!1;let q;if(typeof K=="string"?(q=re===K,this.debug("string match",K,re,q)):(q=K.test(re),this.debug("pattern match",K,re,q)),!q)return!1}if(b===B&&C===k)return!0;if(b===B)return u;if(C===k)return b===B-1&&n[b]==="";throw new Error("wtf?")}braceExpand(){return(0,ks.braceExpand)(this.pattern,this.options)}parse(n){(0,rue.assertValidPattern)(n);let a=this.options;if(n==="**")return ks.GLOBSTAR;if(n==="")return"";let u,f=null;(u=n.match(Jun))?f=a.dot?Xun:$un:(u=n.match(Wun))?f=(a.nocase?a.dot?Uun:zun:a.dot?Gun:Bun)(u[1]):(u=n.match(Yun))?f=(a.nocase?a.dot?Zun:Qun:a.dot?edn:tdn)(u):(u=n.match(Vun))?f=a.dot?Kun:jun:(u=n.match(Hun))&&(f=qun);let g=Y_t.AST.fromGlob(n,this.options).toMMPattern();return f&&typeof g=="object"&&Reflect.defineProperty(g,"test",{value:f}),g}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let n=this.set;if(!n.length)return this.regexp=!1,this.regexp;let a=this.options,u=a.noglobstar?rdn:a.dot?idn:odn,f=new Set(a.nocase?["i"]:[]),g=n.map(k=>{let B=k.map(K=>{if(K instanceof RegExp)for(let re of K.flags.split(""))f.add(re);return typeof K=="string"?ddn(K):K===ks.GLOBSTAR?ks.GLOBSTAR:K._src});return B.forEach((K,re)=>{let q=B[re+1],Me=B[re-1];K!==ks.GLOBSTAR||Me===ks.GLOBSTAR||(Me===void 0?q!==void 0&&q!==ks.GLOBSTAR?B[re+1]="(?:\\/|"+u+"\\/)?"+q:B[re]=u:q===void 0?B[re-1]=Me+"(?:\\/|"+u+")?":q!==ks.GLOBSTAR&&(B[re-1]=Me+"(?:\\/|\\/"+u+"\\/)"+q,B[re+1]=ks.GLOBSTAR))}),B.filter(K=>K!==ks.GLOBSTAR).join("/")}).join("|"),[b,C]=n.length>1?["(?:",")"]:["",""];g="^"+b+g+C+"$",this.negate&&(g="^(?!"+g+").+$");try{this.regexp=new RegExp(g,[...f].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(n){return this.preserveMultipleSlashes?n.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(n)?["",...n.split(/\/+/)]:n.split(/\/+/)}match(n,a=this.partial){if(this.debug("match",n,this.pattern),this.comment)return!1;if(this.empty)return n==="";if(n==="/"&&a)return!0;let u=this.options;this.isWindows&&(n=n.split("\\").join("/"));let f=this.slashSplit(n);this.debug(this.pattern,"split",f);let g=this.set;this.debug(this.pattern,"set",g);let b=f[f.length-1];if(!b)for(let C=f.length-2;!b&&C>=0;C--)b=f[C];for(let C=0;C<g.length;C++){let k=g[C],B=f;if(u.matchBase&&k.length===1&&(B=[b]),this.matchOne(B,k,a))return u.flipNegate?!0:!this.negate}return u.flipNegate?!1:this.negate}static defaults(n){return ks.minimatch.defaults(n).Minimatch}};ks.Minimatch=F8;var pdn=R8e();Object.defineProperty(ks,"AST",{enumerable:!0,get:function(){return pdn.AST}});var fdn=L8e();Object.defineProperty(ks,"escape",{enumerable:!0,get:function(){return fdn.escape}});var mdn=Yce();Object.defineProperty(ks,"unescape",{enumerable:!0,get:function(){return mdn.unescape}});ks.minimatch.AST=Y_t.AST;ks.minimatch.Minimatch=F8;ks.minimatch.escape=wun.escape;ks.minimatch.unescape=Oun.unescape});var aJ=Ln((bPn,agt)=>{"use strict";var ngt="[^\\\\/]",_dn="(?=.)",rgt="[^/]",M8e="(?:\\/|$)",igt="(?:^|\\/)",k8e=`\\.{1,2}${M8e}`,gdn="(?!\\.)",hdn=`(?!${igt}${k8e})`,ydn=`(?!\\.{0,1}${M8e})`,vdn=`(?!${k8e})`,bdn="[^.\\/]",Sdn=`${rgt}*?`,Edn="/",ogt={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:_dn,QMARK:rgt,END_ANCHOR:M8e,DOTS_SLASH:k8e,NO_DOT:gdn,NO_DOTS:hdn,NO_DOT_SLASH:ydn,NO_DOTS_SLASH:vdn,QMARK_NO_DOT:bdn,STAR:Sdn,START_ANCHOR:igt,SEP:Edn},xdn={...ogt,SLASH_LITERAL:"[\\\\/]",QMARK:ngt,STAR:`${ngt}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},Tdn={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};agt.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Tdn,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(s){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${s.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(s){return s===!0?xdn:ogt}}});var sJ=Ln(e0=>{"use strict";var{REGEX_BACKSLASH:Ndn,REGEX_REMOVE_BACKSLASH:Adn,REGEX_SPECIAL_CHARS:Cdn,REGEX_SPECIAL_CHARS_GLOBAL:Idn}=aJ();e0.isObject=s=>s!==null&&typeof s=="object"&&!Array.isArray(s);e0.hasRegexChars=s=>Cdn.test(s);e0.isRegexChar=s=>s.length===1&&e0.hasRegexChars(s);e0.escapeRegex=s=>s.replace(Idn,"\\$1");e0.toPosixSlashes=s=>s.replace(Ndn,"/");e0.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let s=navigator.platform.toLowerCase();return s==="win32"||s==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};e0.removeBackslashes=s=>s.replace(Adn,n=>n==="\\"?"":n);e0.escapeLast=(s,n,a)=>{let u=s.lastIndexOf(n,a);return u===-1?s:s[u-1]==="\\"?e0.escapeLast(s,n,u-1):`${s.slice(0,u)}\\${s.slice(u)}`};e0.removePrefix=(s,n={})=>{let a=s;return a.startsWith("./")&&(a=a.slice(2),n.prefix="./"),a};e0.wrapOutput=(s,n={},a={})=>{let u=a.contains?"":"^",f=a.contains?"":"$",g=`${u}(?:${s})${f}`;return n.negated===!0&&(g=`(?:^(?!${g}).*$)`),g};e0.basename=(s,{windows:n}={})=>{let a=s.split(n?/[\\/]/:"/"),u=a[a.length-1];return u===""?a[a.length-2]:u}});var mgt=Ln((EPn,fgt)=>{"use strict";var sgt=sJ(),{CHAR_ASTERISK:w8e,CHAR_AT:Ddn,CHAR_BACKWARD_SLASH:lJ,CHAR_COMMA:Pdn,CHAR_DOT:O8e,CHAR_EXCLAMATION_MARK:F8e,CHAR_FORWARD_SLASH:pgt,CHAR_LEFT_CURLY_BRACE:W8e,CHAR_LEFT_PARENTHESES:B8e,CHAR_LEFT_SQUARE_BRACKET:Rdn,CHAR_PLUS:Ldn,CHAR_QUESTION_MARK:lgt,CHAR_RIGHT_CURLY_BRACE:Mdn,CHAR_RIGHT_PARENTHESES:cgt,CHAR_RIGHT_SQUARE_BRACKET:kdn}=aJ(),ugt=s=>s===pgt||s===lJ,dgt=s=>{s.isPrefix!==!0&&(s.depth=s.isGlobstar?1/0:1)},wdn=(s,n)=>{let a=n||{},u=s.length-1,f=a.parts===!0||a.scanToEnd===!0,g=[],b=[],C=[],k=s,B=-1,K=0,re=0,q=!1,Me=!1,Te=!1,Ee=!1,St=!1,Ot=!1,ft=!1,Gt=!1,En=!1,vr=!1,rn=0,Ht,hn,ur={value:"",depth:0,isGlob:!1},br=()=>B>=u,Cn=()=>k.charCodeAt(B+1),Bo=()=>(Ht=hn,k.charCodeAt(++B));for(;B<u;){hn=Bo();let gn;if(hn===lJ){ft=ur.backslashes=!0,hn=Bo(),hn===W8e&&(Ot=!0);continue}if(Ot===!0||hn===W8e){for(rn++;br()!==!0&&(hn=Bo());){if(hn===lJ){ft=ur.backslashes=!0,Bo();continue}if(hn===W8e){rn++;continue}if(Ot!==!0&&hn===O8e&&(hn=Bo())===O8e){if(q=ur.isBrace=!0,Te=ur.isGlob=!0,vr=!0,f===!0)continue;break}if(Ot!==!0&&hn===Pdn){if(q=ur.isBrace=!0,Te=ur.isGlob=!0,vr=!0,f===!0)continue;break}if(hn===Mdn&&(rn--,rn===0)){Ot=!1,q=ur.isBrace=!0,vr=!0;break}}if(f===!0)continue;break}if(hn===pgt){if(g.push(B),b.push(ur),ur={value:"",depth:0,isGlob:!1},vr===!0)continue;if(Ht===O8e&&B===K+1){K+=2;continue}re=B+1;continue}if(a.noext!==!0&&(hn===Ldn||hn===Ddn||hn===w8e||hn===lgt||hn===F8e)===!0&&Cn()===B8e){if(Te=ur.isGlob=!0,Ee=ur.isExtglob=!0,vr=!0,hn===F8e&&B===K&&(En=!0),f===!0){for(;br()!==!0&&(hn=Bo());){if(hn===lJ){ft=ur.backslashes=!0,hn=Bo();continue}if(hn===cgt){Te=ur.isGlob=!0,vr=!0;break}}continue}break}if(hn===w8e){if(Ht===w8e&&(St=ur.isGlobstar=!0),Te=ur.isGlob=!0,vr=!0,f===!0)continue;break}if(hn===lgt){if(Te=ur.isGlob=!0,vr=!0,f===!0)continue;break}if(hn===Rdn){for(;br()!==!0&&(gn=Bo());){if(gn===lJ){ft=ur.backslashes=!0,Bo();continue}if(gn===kdn){Me=ur.isBracket=!0,Te=ur.isGlob=!0,vr=!0;break}}if(f===!0)continue;break}if(a.nonegate!==!0&&hn===F8e&&B===K){Gt=ur.negated=!0,K++;continue}if(a.noparen!==!0&&hn===B8e){if(Te=ur.isGlob=!0,f===!0){for(;br()!==!0&&(hn=Bo());){if(hn===B8e){ft=ur.backslashes=!0,hn=Bo();continue}if(hn===cgt){vr=!0;break}}continue}break}if(Te===!0){if(vr=!0,f===!0)continue;break}}a.noext===!0&&(Ee=!1,Te=!1);let Fa=k,pn="",Mn="";K>0&&(pn=k.slice(0,K),k=k.slice(K),re-=K),Fa&&Te===!0&&re>0?(Fa=k.slice(0,re),Mn=k.slice(re)):Te===!0?(Fa="",Mn=k):Fa=k,Fa&&Fa!==""&&Fa!=="/"&&Fa!==k&&ugt(Fa.charCodeAt(Fa.length-1))&&(Fa=Fa.slice(0,-1)),a.unescape===!0&&(Mn&&(Mn=sgt.removeBackslashes(Mn)),Fa&&ft===!0&&(Fa=sgt.removeBackslashes(Fa)));let si={prefix:pn,input:s,start:K,base:Fa,glob:Mn,isBrace:q,isBracket:Me,isGlob:Te,isExtglob:Ee,isGlobstar:St,negated:Gt,negatedExtglob:En};if(a.tokens===!0&&(si.maxDepth=0,ugt(hn)||b.push(ur),si.tokens=b),a.parts===!0||a.tokens===!0){let gn;for(let ms=0;ms<g.length;ms++){let Ds=gn?gn+1:K,Sl=g[ms],Fo=s.slice(Ds,Sl);a.tokens&&(ms===0&&K!==0?(b[ms].isPrefix=!0,b[ms].value=pn):b[ms].value=Fo,dgt(b[ms]),si.maxDepth+=b[ms].depth),(ms!==0||Fo!=="")&&C.push(Fo),gn=Sl}if(gn&&gn+1<s.length){let ms=s.slice(gn+1);C.push(ms),a.tokens&&(b[b.length-1].value=ms,dgt(b[b.length-1]),si.maxDepth+=b[b.length-1].depth)}si.slashes=g,si.parts=C}return si};fgt.exports=wdn});var vgt=Ln((xPn,ygt)=>{"use strict";var cJ=aJ(),Bx=sJ(),{MAX_LENGTH:iue,POSIX_REGEX_SOURCE:Odn,REGEX_NON_SPECIAL_CHARS:Fdn,REGEX_SPECIAL_CHARS_BACKREF:Wdn,REPLACEMENTS:_gt}=cJ,Bdn=(s,n)=>{if(typeof n.expandRange=="function")return n.expandRange(...s,n);s.sort();let a=`[${s.join("-")}]`;try{new RegExp(a)}catch{return s.map(f=>Bx.escapeRegex(f)).join("..")}return a},uG=(s,n)=>`Missing ${s}: "${n}" - use "\\\\${n}" to match literal characters`,ggt=s=>{let n=[],a=0,u=0,f=0,g="",b=!1;for(let C of s){if(b===!0){g+=C,b=!1;continue}if(C==="\\"){g+=C,b=!0;continue}if(C==='"'){f=f===1?0:1,g+=C;continue}if(f===0){if(C==="[")a++;else if(C==="]"&&a>0)a--;else if(a===0){if(C==="(")u++;else if(C===")"&&u>0)u--;else if(C==="|"&&u===0){n.push(g),g="";continue}}}g+=C}return n.push(g),n},Gdn=s=>{let n=!1;for(let a of s){if(n===!0){n=!1;continue}if(a==="\\"){n=!0;continue}if(/[?*+@!()[\]{}]/.test(a))return!1}return!0},hgt=s=>{let n=s.trim(),a=!0;for(;a===!0;)a=!1,/^@\([^\\()[\]{}|]+\)$/.test(n)&&(n=n.slice(2,-1),a=!0);if(Gdn(n))return n.replace(/\\(.)/g,"$1")},zdn=s=>{let n=s.map(hgt).filter(Boolean);for(let a=0;a<n.length;a++)for(let u=a+1;u<n.length;u++){let f=n[a],g=n[u],b=f[0];if(!(!b||f!==b.repeat(f.length)||g!==b.repeat(g.length))&&(f===g||f.startsWith(g)||g.startsWith(f)))return!0}return!1},G8e=(s,n=!0)=>{if(s[0]!=="+"&&s[0]!=="*"||s[1]!=="(")return;let a=0,u=0,f=0,g=!1;for(let b=1;b<s.length;b++){let C=s[b];if(g===!0){g=!1;continue}if(C==="\\"){g=!0;continue}if(C==='"'){f=f===1?0:1;continue}if(f!==1){if(C==="["){a++;continue}if(C==="]"&&a>0){a--;continue}if(!(a>0)){if(C==="("){u++;continue}if(C===")"&&(u--,u===0))return n===!0&&b!==s.length-1?void 0:{type:s[0],body:s.slice(2,b),end:b}}}}},Udn=s=>{let n=0,a=[];for(;n<s.length;){let f=G8e(s.slice(n),!1);if(!f||f.type!=="*")return;let g=ggt(f.body).map(C=>C.trim());if(g.length!==1)return;let b=hgt(g[0]);if(!b||b.length!==1)return;a.push(b),n+=f.end+1}return a.length<1?void 0:`${a.length===1?Bx.escapeRegex(a[0]):`[${a.map(f=>Bx.escapeRegex(f)).join("")}]`}*`},Vdn=s=>{let n=0,a=s.trim(),u=G8e(a);for(;u;)n++,a=u.body.trim(),u=G8e(a);return n},jdn=(s,n)=>{if(n.maxExtglobRecursion===!1)return{risky:!1};let a=typeof n.maxExtglobRecursion=="number"?n.maxExtglobRecursion:cJ.DEFAULT_MAX_EXTGLOB_RECURSION,u=ggt(s).map(f=>f.trim());if(u.length>1&&(u.some(f=>f==="")||u.some(f=>/^[*?]+$/.test(f))||zdn(u)))return{risky:!0};for(let f of u){let g=Udn(f);if(g)return{risky:!0,safeOutput:g};if(Vdn(f)>a)return{risky:!0}}return{risky:!1}},z8e=(s,n)=>{if(typeof s!="string")throw new TypeError("Expected a string");s=_gt[s]||s;let a={...n},u=typeof a.maxLength=="number"?Math.min(iue,a.maxLength):iue,f=s.length;if(f>u)throw new SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${u}`);let g={type:"bos",value:"",output:a.prepend||""},b=[g],C=a.capture?"":"?:",k=cJ.globChars(a.windows),B=cJ.extglobChars(k),{DOT_LITERAL:K,PLUS_LITERAL:re,SLASH_LITERAL:q,ONE_CHAR:Me,DOTS_SLASH:Te,NO_DOT:Ee,NO_DOT_SLASH:St,NO_DOTS_SLASH:Ot,QMARK:ft,QMARK_NO_DOT:Gt,STAR:En,START_ANCHOR:vr}=k,rn=na=>`(${C}(?:(?!${vr}${na.dot?Te:K}).)*?)`,Ht=a.dot?"":Ee,hn=a.dot?ft:Gt,ur=a.bash===!0?rn(a):En;a.capture&&(ur=`(${ur})`),typeof a.noext=="boolean"&&(a.noextglob=a.noext);let br={input:s,index:-1,start:0,dot:a.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:b};s=Bx.removePrefix(s,br),f=s.length;let Cn=[],Bo=[],Fa=[],pn=g,Mn,si=()=>br.index===f-1,gn=br.peek=(na=1)=>s[br.index+na],ms=br.advance=()=>s[++br.index]||"",Ds=()=>s.slice(br.index+1),Sl=(na="",Ji=0)=>{br.consumed+=na,br.index+=Ji},Fo=na=>{br.output+=na.output!=null?na.output:na.value,Sl(na.value)},gg=()=>{let na=1;for(;gn()==="!"&&(gn(2)!=="("||gn(3)==="?");)ms(),br.start++,na++;return na%2===0?!1:(br.negated=!0,br.start++,!0)},jb=na=>{br[na]++,Fa.push(na)},k_=na=>{br[na]--,Fa.pop()},dl=na=>{if(pn.type==="globstar"){let Ji=br.braces>0&&(na.type==="comma"||na.type==="brace"),go=na.extglob===!0||Cn.length&&(na.type==="pipe"||na.type==="paren");na.type!=="slash"&&na.type!=="paren"&&!Ji&&!go&&(br.output=br.output.slice(0,-pn.output.length),pn.type="star",pn.value="*",pn.output=ur,br.output+=pn.output)}if(Cn.length&&na.type!=="paren"&&(Cn[Cn.length-1].inner+=na.value),(na.value||na.output)&&Fo(na),pn&&pn.type==="text"&&na.type==="text"){pn.output=(pn.output||pn.value)+na.value,pn.value+=na.value;return}na.prev=pn,b.push(na),pn=na},pi=(na,Ji)=>{let go={...B[Ji],conditions:1,inner:""};go.prev=pn,go.parens=br.parens,go.output=br.output,go.startIndex=br.index,go.tokensIndex=b.length;let Ki=(a.capture?"(":"")+go.open;jb("parens"),dl({type:na,value:Ji,output:br.output?"":Me}),dl({type:"paren",extglob:!0,value:ms(),output:Ki}),Cn.push(go)},km=na=>{let Ji=s.slice(na.startIndex,br.index+1),go=s.slice(na.startIndex+2,br.index),Ki=jdn(go,a);if((na.type==="plus"||na.type==="star")&&Ki.risky){let gl=Ki.safeOutput?(na.output?"":Me)+(a.capture?`(${Ki.safeOutput})`:Ki.safeOutput):void 0,Ai=b[na.tokensIndex];Ai.type="text",Ai.value=Ji,Ai.output=gl||Bx.escapeRegex(Ji);for(let _f=na.tokensIndex+1;_f<b.length;_f++)b[_f].value="",b[_f].output="",delete b[_f].suffix;br.output=na.output+Ai.output,br.backtrack=!0,dl({type:"paren",extglob:!0,value:Mn,output:""}),k_("parens");return}let wa=na.close+(a.capture?")":""),ht;if(na.type==="negate"){let gl=ur;if(na.inner&&na.inner.length>1&&na.inner.includes("/")&&(gl=rn(a)),(gl!==ur||si()||/^\)+$/.test(Ds()))&&(wa=na.close=`)$))${gl}`),na.inner.includes("*")&&(ht=Ds())&&/^\.[^\\/.]+$/.test(ht)){let Ai=z8e(ht,{...n,fastpaths:!1}).output;wa=na.close=`)${Ai})${gl})`}na.prev.type==="bos"&&(br.negatedExtglob=!0)}dl({type:"paren",extglob:!0,value:Mn,output:wa}),k_("parens")};if(a.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(s)){let na=!1,Ji=s.replace(Wdn,(go,Ki,wa,ht,gl,Ai)=>ht==="\\"?(na=!0,go):ht==="?"?Ki?Ki+ht+(gl?ft.repeat(gl.length):""):Ai===0?hn+(gl?ft.repeat(gl.length):""):ft.repeat(wa.length):ht==="."?K.repeat(wa.length):ht==="*"?Ki?Ki+ht+(gl?ur:""):ur:Ki?go:`\\${go}`);return na===!0&&(a.unescape===!0?Ji=Ji.replace(/\\/g,""):Ji=Ji.replace(/\\+/g,go=>go.length%2===0?"\\\\":go?"\\":"")),Ji===s&&a.contains===!0?(br.output=s,br):(br.output=Bx.wrapOutput(Ji,br,n),br)}for(;!si();){if(Mn=ms(),Mn==="\0")continue;if(Mn==="\\"){let go=gn();if(go==="/"&&a.bash!==!0||go==="."||go===";")continue;if(!go){Mn+="\\",dl({type:"text",value:Mn});continue}let Ki=/^\\+/.exec(Ds()),wa=0;if(Ki&&Ki[0].length>2&&(wa=Ki[0].length,br.index+=wa,wa%2!==0&&(Mn+="\\")),a.unescape===!0?Mn=ms():Mn+=ms(),br.brackets===0){dl({type:"text",value:Mn});continue}}if(br.brackets>0&&(Mn!=="]"||pn.value==="["||pn.value==="[^")){if(a.posix!==!1&&Mn===":"){let go=pn.value.slice(1);if(go.includes("[")&&(pn.posix=!0,go.includes(":"))){let Ki=pn.value.lastIndexOf("["),wa=pn.value.slice(0,Ki),ht=pn.value.slice(Ki+2),gl=Odn[ht];if(gl){pn.value=wa+gl,br.backtrack=!0,ms(),!g.output&&b.indexOf(pn)===1&&(g.output=Me);continue}}}(Mn==="["&&gn()!==":"||Mn==="-"&&gn()==="]")&&(Mn=`\\${Mn}`),Mn==="]"&&(pn.value==="["||pn.value==="[^")&&(Mn=`\\${Mn}`),a.posix===!0&&Mn==="!"&&pn.value==="["&&(Mn="^"),pn.value+=Mn,Fo({value:Mn});continue}if(br.quotes===1&&Mn!=='"'){Mn=Bx.escapeRegex(Mn),pn.value+=Mn,Fo({value:Mn});continue}if(Mn==='"'){br.quotes=br.quotes===1?0:1,a.keepQuotes===!0&&dl({type:"text",value:Mn});continue}if(Mn==="("){jb("parens"),dl({type:"paren",value:Mn});continue}if(Mn===")"){if(br.parens===0&&a.strictBrackets===!0)throw new SyntaxError(uG("opening","("));let go=Cn[Cn.length-1];if(go&&br.parens===go.parens+1){km(Cn.pop());continue}dl({type:"paren",value:Mn,output:br.parens?")":"\\)"}),k_("parens");continue}if(Mn==="["){if(a.nobracket===!0||!Ds().includes("]")){if(a.nobracket!==!0&&a.strictBrackets===!0)throw new SyntaxError(uG("closing","]"));Mn=`\\${Mn}`}else jb("brackets");dl({type:"bracket",value:Mn});continue}if(Mn==="]"){if(a.nobracket===!0||pn&&pn.type==="bracket"&&pn.value.length===1){dl({type:"text",value:Mn,output:`\\${Mn}`});continue}if(br.brackets===0){if(a.strictBrackets===!0)throw new SyntaxError(uG("opening","["));dl({type:"text",value:Mn,output:`\\${Mn}`});continue}k_("brackets");let go=pn.value.slice(1);if(pn.posix!==!0&&go[0]==="^"&&!go.includes("/")&&(Mn=`/${Mn}`),pn.value+=Mn,Fo({value:Mn}),a.literalBrackets===!1||Bx.hasRegexChars(go))continue;let Ki=Bx.escapeRegex(pn.value);if(br.output=br.output.slice(0,-pn.value.length),a.literalBrackets===!0){br.output+=Ki,pn.value=Ki;continue}pn.value=`(${C}${Ki}|${pn.value})`,br.output+=pn.value;continue}if(Mn==="{"&&a.nobrace!==!0){jb("braces");let go={type:"brace",value:Mn,output:"(",outputIndex:br.output.length,tokensIndex:br.tokens.length};Bo.push(go),dl(go);continue}if(Mn==="}"){let go=Bo[Bo.length-1];if(a.nobrace===!0||!go){dl({type:"text",value:Mn,output:Mn});continue}let Ki=")";if(go.dots===!0){let wa=b.slice(),ht=[];for(let gl=wa.length-1;gl>=0&&(b.pop(),wa[gl].type!=="brace");gl--)wa[gl].type!=="dots"&&ht.unshift(wa[gl].value);Ki=Bdn(ht,a),br.backtrack=!0}if(go.comma!==!0&&go.dots!==!0){let wa=br.output.slice(0,go.outputIndex),ht=br.tokens.slice(go.tokensIndex);go.value=go.output="\\{",Mn=Ki="\\}",br.output=wa;for(let gl of ht)br.output+=gl.output||gl.value}dl({type:"brace",value:Mn,output:Ki}),k_("braces"),Bo.pop();continue}if(Mn==="|"){Cn.length>0&&Cn[Cn.length-1].conditions++,dl({type:"text",value:Mn});continue}if(Mn===","){let go=Mn,Ki=Bo[Bo.length-1];Ki&&Fa[Fa.length-1]==="braces"&&(Ki.comma=!0,go="|"),dl({type:"comma",value:Mn,output:go});continue}if(Mn==="/"){if(pn.type==="dot"&&br.index===br.start+1){br.start=br.index+1,br.consumed="",br.output="",b.pop(),pn=g;continue}dl({type:"slash",value:Mn,output:q});continue}if(Mn==="."){if(br.braces>0&&pn.type==="dot"){pn.value==="."&&(pn.output=K);let go=Bo[Bo.length-1];pn.type="dots",pn.output+=Mn,pn.value+=Mn,go.dots=!0;continue}if(br.braces+br.parens===0&&pn.type!=="bos"&&pn.type!=="slash"){dl({type:"text",value:Mn,output:K});continue}dl({type:"dot",value:Mn,output:K});continue}if(Mn==="?"){if(!(pn&&pn.value==="(")&&a.noextglob!==!0&&gn()==="("&&gn(2)!=="?"){pi("qmark",Mn);continue}if(pn&&pn.type==="paren"){let Ki=gn(),wa=Mn;(pn.value==="("&&!/[!=<:]/.test(Ki)||Ki==="<"&&!/<([!=]|\w+>)/.test(Ds()))&&(wa=`\\${Mn}`),dl({type:"text",value:Mn,output:wa});continue}if(a.dot!==!0&&(pn.type==="slash"||pn.type==="bos")){dl({type:"qmark",value:Mn,output:Gt});continue}dl({type:"qmark",value:Mn,output:ft});continue}if(Mn==="!"){if(a.noextglob!==!0&&gn()==="("&&(gn(2)!=="?"||!/[!=<:]/.test(gn(3)))){pi("negate",Mn);continue}if(a.nonegate!==!0&&br.index===0){gg();continue}}if(Mn==="+"){if(a.noextglob!==!0&&gn()==="("&&gn(2)!=="?"){pi("plus",Mn);continue}if(pn&&pn.value==="("||a.regex===!1){dl({type:"plus",value:Mn,output:re});continue}if(pn&&(pn.type==="bracket"||pn.type==="paren"||pn.type==="brace")||br.parens>0){dl({type:"plus",value:Mn});continue}dl({type:"plus",value:re});continue}if(Mn==="@"){if(a.noextglob!==!0&&gn()==="("&&gn(2)!=="?"){dl({type:"at",extglob:!0,value:Mn,output:""});continue}dl({type:"text",value:Mn});continue}if(Mn!=="*"){(Mn==="$"||Mn==="^")&&(Mn=`\\${Mn}`);let go=Fdn.exec(Ds());go&&(Mn+=go[0],br.index+=go[0].length),dl({type:"text",value:Mn});continue}if(pn&&(pn.type==="globstar"||pn.star===!0)){pn.type="star",pn.star=!0,pn.value+=Mn,pn.output=ur,br.backtrack=!0,br.globstar=!0,Sl(Mn);continue}let na=Ds();if(a.noextglob!==!0&&/^\([^?]/.test(na)){pi("star",Mn);continue}if(pn.type==="star"){if(a.noglobstar===!0){Sl(Mn);continue}let go=pn.prev,Ki=go.prev,wa=go.type==="slash"||go.type==="bos",ht=Ki&&(Ki.type==="star"||Ki.type==="globstar");if(a.bash===!0&&(!wa||na[0]&&na[0]!=="/")){dl({type:"star",value:Mn,output:""});continue}let gl=br.braces>0&&(go.type==="comma"||go.type==="brace"),Ai=Cn.length&&(go.type==="pipe"||go.type==="paren");if(!wa&&go.type!=="paren"&&!gl&&!Ai){dl({type:"star",value:Mn,output:""});continue}for(;na.slice(0,3)==="/**";){let _f=s[br.index+4];if(_f&&_f!=="/")break;na=na.slice(3),Sl("/**",3)}if(go.type==="bos"&&si()){pn.type="globstar",pn.value+=Mn,pn.output=rn(a),br.output=pn.output,br.globstar=!0,Sl(Mn);continue}if(go.type==="slash"&&go.prev.type!=="bos"&&!ht&&si()){br.output=br.output.slice(0,-(go.output+pn.output).length),go.output=`(?:${go.output}`,pn.type="globstar",pn.output=rn(a)+(a.strictSlashes?")":"|$)"),pn.value+=Mn,br.globstar=!0,br.output+=go.output+pn.output,Sl(Mn);continue}if(go.type==="slash"&&go.prev.type!=="bos"&&na[0]==="/"){let _f=na[1]!==void 0?"|$":"";br.output=br.output.slice(0,-(go.output+pn.output).length),go.output=`(?:${go.output}`,pn.type="globstar",pn.output=`${rn(a)}${q}|${q}${_f})`,pn.value+=Mn,br.output+=go.output+pn.output,br.globstar=!0,Sl(Mn+ms()),dl({type:"slash",value:"/",output:""});continue}if(go.type==="bos"&&na[0]==="/"){pn.type="globstar",pn.value+=Mn,pn.output=`(?:^|${q}|${rn(a)}${q})`,br.output=pn.output,br.globstar=!0,Sl(Mn+ms()),dl({type:"slash",value:"/",output:""});continue}br.output=br.output.slice(0,-pn.output.length),pn.type="globstar",pn.output=rn(a),pn.value+=Mn,br.output+=pn.output,br.globstar=!0,Sl(Mn);continue}let Ji={type:"star",value:Mn,output:ur};if(a.bash===!0){Ji.output=".*?",(pn.type==="bos"||pn.type==="slash")&&(Ji.output=Ht+Ji.output),dl(Ji);continue}if(pn&&(pn.type==="bracket"||pn.type==="paren")&&a.regex===!0){Ji.output=Mn,dl(Ji);continue}(br.index===br.start||pn.type==="slash"||pn.type==="dot")&&(pn.type==="dot"?(br.output+=St,pn.output+=St):a.dot===!0?(br.output+=Ot,pn.output+=Ot):(br.output+=Ht,pn.output+=Ht),gn()!=="*"&&(br.output+=Me,pn.output+=Me)),dl(Ji)}for(;br.brackets>0;){if(a.strictBrackets===!0)throw new SyntaxError(uG("closing","]"));br.output=Bx.escapeLast(br.output,"["),k_("brackets")}for(;br.parens>0;){if(a.strictBrackets===!0)throw new SyntaxError(uG("closing",")"));br.output=Bx.escapeLast(br.output,"("),k_("parens")}for(;br.braces>0;){if(a.strictBrackets===!0)throw new SyntaxError(uG("closing","}"));br.output=Bx.escapeLast(br.output,"{"),k_("braces")}if(a.strictSlashes!==!0&&(pn.type==="star"||pn.type==="bracket")&&dl({type:"maybe_slash",value:"",output:`${q}?`}),br.backtrack===!0){br.output="";for(let na of br.tokens)br.output+=na.output!=null?na.output:na.value,na.suffix&&(br.output+=na.suffix)}return br};z8e.fastpaths=(s,n)=>{let a={...n},u=typeof a.maxLength=="number"?Math.min(iue,a.maxLength):iue,f=s.length;if(f>u)throw new SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${u}`);s=_gt[s]||s;let{DOT_LITERAL:g,SLASH_LITERAL:b,ONE_CHAR:C,DOTS_SLASH:k,NO_DOT:B,NO_DOTS:K,NO_DOTS_SLASH:re,STAR:q,START_ANCHOR:Me}=cJ.globChars(a.windows),Te=a.dot?K:B,Ee=a.dot?re:B,St=a.capture?"":"?:",Ot={negated:!1,prefix:""},ft=a.bash===!0?".*?":q;a.capture&&(ft=`(${ft})`);let Gt=Ht=>Ht.noglobstar===!0?ft:`(${St}(?:(?!${Me}${Ht.dot?k:g}).)*?)`,En=Ht=>{switch(Ht){case"*":return`${Te}${C}${ft}`;case".*":return`${g}${C}${ft}`;case"*.*":return`${Te}${ft}${g}${C}${ft}`;case"*/*":return`${Te}${ft}${b}${C}${Ee}${ft}`;case"**":return Te+Gt(a);case"**/*":return`(?:${Te}${Gt(a)}${b})?${Ee}${C}${ft}`;case"**/*.*":return`(?:${Te}${Gt(a)}${b})?${Ee}${ft}${g}${C}${ft}`;case"**/.*":return`(?:${Te}${Gt(a)}${b})?${g}${C}${ft}`;default:{let hn=/^(.*?)\.(\w+)$/.exec(Ht);if(!hn)return;let ur=En(hn[1]);return ur?ur+g+hn[2]:void 0}}},vr=Bx.removePrefix(s,Ot),rn=En(vr);return rn&&a.strictSlashes!==!0&&(rn+=`${b}?`),rn};ygt.exports=z8e});var Egt=Ln((TPn,Sgt)=>{"use strict";var Kdn=mgt(),U8e=vgt(),bgt=sJ(),Hdn=aJ(),qdn=s=>s&&typeof s=="object"&&!Array.isArray(s),$g=(s,n,a=!1)=>{if(Array.isArray(s)){let K=s.map(q=>$g(q,n,a));return q=>{for(let Me of K){let Te=Me(q);if(Te)return Te}return!1}}let u=qdn(s)&&s.tokens&&s.input;if(s===""||typeof s!="string"&&!u)throw new TypeError("Expected pattern to be a non-empty string");let f=n||{},g=f.windows,b=u?$g.compileRe(s,n):$g.makeRe(s,n,!1,!0),C=b.state;delete b.state;let k=()=>!1;if(f.ignore){let K={...n,ignore:null,onMatch:null,onResult:null};k=$g(f.ignore,K,a)}let B=(K,re=!1)=>{let{isMatch:q,match:Me,output:Te}=$g.test(K,b,n,{glob:s,posix:g}),Ee={glob:s,state:C,regex:b,posix:g,input:K,output:Te,match:Me,isMatch:q};return typeof f.onResult=="function"&&f.onResult(Ee),q===!1?(Ee.isMatch=!1,re?Ee:!1):k(K)?(typeof f.onIgnore=="function"&&f.onIgnore(Ee),Ee.isMatch=!1,re?Ee:!1):(typeof f.onMatch=="function"&&f.onMatch(Ee),re?Ee:!0)};return a&&(B.state=C),B};$g.test=(s,n,a,{glob:u,posix:f}={})=>{if(typeof s!="string")throw new TypeError("Expected input to be a string");if(s==="")return{isMatch:!1,output:""};let g=a||{},b=g.format||(f?bgt.toPosixSlashes:null),C=s===u,k=C&&b?b(s):s;return C===!1&&(k=b?b(s):s,C=k===u),(C===!1||g.capture===!0)&&(g.matchBase===!0||g.basename===!0?C=$g.matchBase(s,n,a,f):C=n.exec(k)),{isMatch:!!C,match:C,output:k}};$g.matchBase=(s,n,a)=>(n instanceof RegExp?n:$g.makeRe(n,a)).test(bgt.basename(s));$g.isMatch=(s,n,a)=>$g(n,a)(s);$g.parse=(s,n)=>Array.isArray(s)?s.map(a=>$g.parse(a,n)):U8e(s,{...n,fastpaths:!1});$g.scan=(s,n)=>Kdn(s,n);$g.compileRe=(s,n,a=!1,u=!1)=>{if(a===!0)return s.output;let f=n||{},g=f.contains?"":"^",b=f.contains?"":"$",C=`${g}(?:${s.output})${b}`;s&&s.negated===!0&&(C=`^(?!${C}).*$`);let k=$g.toRegex(C,n);return u===!0&&(k.state=s),k};$g.makeRe=(s,n={},a=!1,u=!1)=>{if(!s||typeof s!="string")throw new TypeError("Expected a non-empty string");let f={negated:!1,fastpaths:!0};return n.fastpaths!==!1&&(s[0]==="."||s[0]==="*")&&(f.output=U8e.fastpaths(s,n)),f.output||(f=U8e(s,n)),$g.compileRe(f,n,a,u)};$g.toRegex=(s,n)=>{try{let a=n||{};return new RegExp(s,a.flags||(a.nocase?"i":""))}catch(a){if(n&&n.debug===!0)throw a;return/$^/}};$g.constants=Hdn;Sgt.exports=$g});var V8e=Ln((NPn,Ngt)=>{"use strict";var xgt=Egt(),Jdn=sJ();function Tgt(s,n,a=!1){return n&&(n.windows===null||n.windows===void 0)&&(n={...n,windows:Jdn.isWindows()}),xgt(s,n,a)}Object.assign(Tgt,xgt);Ngt.exports=Tgt});var Fgt=Ln(Ogt=>{var $dn=Object.create,Cgt=Object.defineProperty,Xdn=Object.getOwnPropertyDescriptor,Ydn=Object.getOwnPropertyNames,Qdn=Object.getPrototypeOf,Zdn=Object.prototype.hasOwnProperty,epn=(s,n,a,u)=>{if(n&&typeof n=="object"||typeof n=="function")for(var f=Ydn(n),g=0,b=f.length,C;g<b;g++)C=f[g],!Zdn.call(s,C)&&C!==a&&Cgt(s,C,{get:(k=>n[k]).bind(null,C),enumerable:!(u=Xdn(n,C))||u.enumerable});return s},Igt=(s,n,a)=>(a=s!=null?$dn(Qdn(s)):{},epn(n||!s||!s.__esModule?Cgt(a,"default",{value:s,enumerable:!0}):a,s)),GR=Igt(require("path")),tpn=Igt(require("fs"));function npn(s){let n=(0,GR.normalize)(s);return n.length>1&&n[n.length-1]===GR.sep&&(n=n.substring(0,n.length-1)),n}var rpn=/[\\/]/g;function Dgt(s,n){return s.replace(rpn,n)}var ipn=/^[a-z]:[\\/]$/i;function opn(s){return s==="/"||ipn.test(s)}function j8e(s,n){let{resolvePaths:a,normalizePath:u,pathSeparator:f}=n,g=process.platform==="win32"&&s.includes("/")||s.startsWith(".");if(a&&(s=(0,GR.resolve)(s)),(u||g)&&(s=npn(s)),s===".")return"";let b=s[s.length-1]!==f;return Dgt(b?s+f:s,f)}function Pgt(s,n){return n+s}function apn(s,n){return function(a,u){return u.startsWith(s)?u.slice(s.length)+a:Dgt((0,GR.relative)(s,u),n.pathSeparator)+n.pathSeparator+a}}function spn(s){return s}function lpn(s,n,a){return n+s+a}function cpn(s,n){let{relativePaths:a,includeBasePath:u}=n;return a&&s?apn(s,n):u?Pgt:spn}function upn(s){return function(n,a){a.push(n.substring(s.length)||".")}}function dpn(s){return function(n,a,u){let f=n.substring(s.length)||".";u.every(g=>g(f,!0))&&a.push(f)}}var ppn=(s,n)=>{n.push(s||".")},fpn=(s,n,a)=>{let u=s||".";a.every(f=>f(u,!0))&&n.push(u)},mpn=()=>{};function _pn(s,n){let{includeDirs:a,filters:u,relativePaths:f}=n;return a?f?u&&u.length?dpn(s):upn(s):u&&u.length?fpn:ppn:mpn}var gpn=(s,n,a,u)=>{u.every(f=>f(s,!1))&&a.files++},hpn=(s,n,a,u)=>{u.every(f=>f(s,!1))&&n.push(s)},ypn=(s,n,a,u)=>{a.files++},vpn=(s,n)=>{n.push(s)},bpn=()=>{};function Spn(s){let{excludeFiles:n,filters:a,onlyCounts:u}=s;return n?bpn:a&&a.length?u?gpn:hpn:u?ypn:vpn}var Epn=s=>s,xpn=()=>[""].slice(0,0);function Tpn(s){return s.group?xpn:Epn}var Npn=(s,n,a)=>{s.push({directory:n,files:a,dir:n})},Apn=()=>{};function Cpn(s){return s.group?Npn:Apn}var Ipn=function(s,n,a){let{queue:u,fs:f,options:{suppressErrors:g}}=n;u.enqueue(),f.realpath(s,(b,C)=>{if(b)return u.dequeue(g?null:b,n);f.stat(C,(k,B)=>{if(k)return u.dequeue(g?null:k,n);if(B.isDirectory()&&Rgt(s,C,n))return u.dequeue(null,n);a(B,C),u.dequeue(null,n)})})},Dpn=function(s,n,a){let{queue:u,fs:f,options:{suppressErrors:g}}=n;u.enqueue();try{let b=f.realpathSync(s),C=f.statSync(b);if(C.isDirectory()&&Rgt(s,b,n))return;a(C,b)}catch(b){if(!g)throw b}};function Ppn(s,n){return!s.resolveSymlinks||s.excludeSymlinks?null:n?Dpn:Ipn}function Rgt(s,n,a){if(a.options.useRealPaths)return Rpn(n,a);let u=(0,GR.dirname)(s),f=1;for(;u!==a.root&&f<2;){let g=a.symlinks.get(u);!!g&&(g===n||g.startsWith(n)||n.startsWith(g))?f++:u=(0,GR.dirname)(u)}return a.symlinks.set(s,n),f>1}function Rpn(s,n){return n.visited.includes(s+n.options.pathSeparator)}var Lpn=s=>s.counts,Mpn=s=>s.groups,kpn=s=>s.paths,wpn=s=>s.paths.slice(0,s.options.maxFiles),Opn=(s,n,a)=>(oue(n,a,s.counts,s.options.suppressErrors),null),Fpn=(s,n,a)=>(oue(n,a,s.paths,s.options.suppressErrors),null),Wpn=(s,n,a)=>(oue(n,a,s.paths.slice(0,s.options.maxFiles),s.options.suppressErrors),null),Bpn=(s,n,a)=>(oue(n,a,s.groups,s.options.suppressErrors),null);function oue(s,n,a,u){n(s&&!u?s:null,a)}function Gpn(s,n){let{onlyCounts:a,group:u,maxFiles:f}=s;return a?n?Lpn:Opn:u?n?Mpn:Bpn:f?n?wpn:Wpn:n?kpn:Fpn}var Lgt={withFileTypes:!0},zpn=(s,n,a,u,f)=>{if(s.queue.enqueue(),u<0)return s.queue.dequeue(null,s);let{fs:g}=s;s.visited.push(n),s.counts.directories++,g.readdir(n||".",Lgt,(b,C=[])=>{f(C,a,u),s.queue.dequeue(s.options.suppressErrors?null:b,s)})},Upn=(s,n,a,u,f)=>{let{fs:g}=s;if(u<0)return;s.visited.push(n),s.counts.directories++;let b=[];try{b=g.readdirSync(n||".",Lgt)}catch(C){if(!s.options.suppressErrors)throw C}f(b,a,u)};function Vpn(s){return s?Upn:zpn}var jpn=class{count=0;constructor(s){this.onQueueEmpty=s}enqueue(){return this.count++,this.count}dequeue(s,n){this.onQueueEmpty&&(--this.count<=0||s)&&(this.onQueueEmpty(s,n),s&&(n.controller.abort(),this.onQueueEmpty=void 0))}},Kpn=class{_files=0;_directories=0;set files(s){this._files=s}get files(){return this._files}set directories(s){this._directories=s}get directories(){return this._directories}get dirs(){return this._directories}},Hpn=class{aborted=!1;abort(){this.aborted=!0}},Mgt=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(s,n,a){this.isSynchronous=!a,this.callbackInvoker=Gpn(n,this.isSynchronous),this.root=j8e(s,n),this.state={root:opn(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new Kpn,options:n,queue:new jpn((u,f)=>this.callbackInvoker(f,u,a)),symlinks:new Map,visited:[""].slice(0,0),controller:new Hpn,fs:n.fs||tpn},this.joinPath=cpn(this.root,n),this.pushDirectory=_pn(this.root,n),this.pushFile=Spn(n),this.getArray=Tpn(n),this.groupFiles=Cpn(n),this.resolveSymlink=Ppn(n,this.isSynchronous),this.walkDirectory=Vpn(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(s,n,a)=>{let{paths:u,options:{filters:f,resolveSymlinks:g,excludeSymlinks:b,exclude:C,maxFiles:k,signal:B,useRealPaths:K,pathSeparator:re},controller:q}=this.state;if(q.aborted||B&&B.aborted||k&&u.length>k)return;let Me=this.getArray(this.state.paths);for(let Te=0;Te<s.length;++Te){let Ee=s[Te];if(Ee.isFile()||Ee.isSymbolicLink()&&!g&&!b){let St=this.joinPath(Ee.name,n);this.pushFile(St,Me,this.state.counts,f)}else if(Ee.isDirectory()){let St=lpn(Ee.name,n,this.state.options.pathSeparator);if(C&&C(Ee.name,St))continue;this.pushDirectory(St,u,f),this.walkDirectory(this.state,St,St,a-1,this.walk)}else if(this.resolveSymlink&&Ee.isSymbolicLink()){let St=Pgt(Ee.name,n);this.resolveSymlink(St,this.state,(Ot,ft)=>{if(Ot.isDirectory()){if(ft=j8e(ft,this.state.options),C&&C(Ee.name,K?ft:St+re))return;this.walkDirectory(this.state,ft,K?ft:St+re,a-1,this.walk)}else{ft=K?ft:St;let Gt=(0,GR.basename)(ft),En=j8e((0,GR.dirname)(ft),this.state.options);ft=this.joinPath(Gt,En),this.pushFile(ft,Me,this.state.counts,f)}})}}this.groupFiles(this.state.groups,n,Me)}};function qpn(s,n){return new Promise((a,u)=>{kgt(s,n,(f,g)=>{if(f)return u(f);a(g)})})}function kgt(s,n,a){new Mgt(s,n,a).start()}function Jpn(s,n){return new Mgt(s,n).start()}var Agt=class{constructor(s,n){this.root=s,this.options=n}withPromise(){return qpn(this.root,this.options)}withCallback(s){kgt(this.root,this.options,s)}sync(){return Jpn(this.root,this.options)}},wgt=null;try{require.resolve("picomatch"),wgt=V8e()}catch{}var $pn=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:GR.sep,filters:[]};globFunction;constructor(s){this.options={...this.options,...s},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(s){return this.options.pathSeparator=s,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(s){return this.options.maxDepth=s,this}withMaxFiles(s){return this.options.maxFiles=s,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:s=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=s,this.withFullPaths()}withAbortSignal(s){return this.options.signal=s,this}normalize(){return this.options.normalizePath=!0,this}filter(s){return this.options.filters.push(s),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(s){return this.options.exclude=s,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(s){return new Agt(s||".",this.options)}withGlobFunction(s){return this.globFunction=s,this}crawlWithOptions(s,n){return this.options={...this.options,...n},new Agt(s||".",this.options)}glob(...s){return this.globFunction?this.globWithOptions(s):this.globWithOptions(s,{dot:!0})}globWithOptions(s,...n){let a=this.globFunction||wgt;if(!a)throw new Error("Please specify a glob function to use glob matching.");var u=this.globCache[s.join("\0")];return u||(u=a(s,...n),this.globCache[s.join("\0")]=u),this.options.filters.push(f=>u(f)),this}};Ogt.fdir=$pn});var Jgt=Ln(pG=>{var Xpn=Object.create,Bgt=Object.defineProperty,Ypn=Object.getOwnPropertyDescriptor,Qpn=Object.getOwnPropertyNames,Zpn=Object.getPrototypeOf,efn=Object.prototype.hasOwnProperty,tfn=(s,n,a,u)=>{if(n&&typeof n=="object"||typeof n=="function")for(var f=Qpn(n),g=0,b=f.length,C;g<b;g++)C=f[g],!efn.call(s,C)&&C!==a&&Bgt(s,C,{get:(k=>n[k]).bind(null,C),enumerable:!(u=Ypn(n,C))||u.enumerable});return s},uJ=(s,n,a)=>(a=s!=null?Xpn(Zpn(s)):{},tfn(n||!s||!s.__esModule?Bgt(a,"default",{value:s,enumerable:!0}):a,s)),cw=require("fs");cw=uJ(cw);var I1=require("path");I1=uJ(I1);var H8e=require("url");H8e=uJ(H8e);var q8e=Fgt();q8e=uJ(q8e);var W8=V8e();W8=uJ(W8);var Ggt=Array.isArray,J8e=process.platform==="win32",nfn=/^(\/?\.\.)+$/;function rfn(s,n={}){let a=s.length,u=Array(a),f=Array(a),g=!n.noglobstar;for(let b=0;b<a;b++){let C=zgt(s[b]);u[b]=C;let k=C.length,B=Array(k);for(let K=0;K<k;K++)B[K]=(0,W8.default)(C[K],n);f[b]=B}return b=>{let C=b.split("/");if(C[0]===".."&&nfn.test(b))return!0;for(let k=0;k<s.length;k++){let B=u[k],K=f[k],re=C.length,q=Math.min(re,B.length),Me=0;for(;Me<q;){let Te=B[Me];if(Te.includes("/"))return!0;if(!K[Me](C[Me]))break;if(g&&Te==="**")return!0;Me++}if(Me===re)return!0}return!1}}var ifn=/^[A-Z]:\/$/i,ofn=J8e?s=>ifn.test(s):s=>s==="/";function Wgt(s,n,a){if(s===n||n.startsWith(`${s}/`)){if(a){let f=ofn(s)?s.length:s.length+1;return(g,b)=>g.slice(f,b?-1:void 0)||"."}let u=n.slice(s.length+1);return u?(f,g)=>{if(f===".")return u;let b=`${u}/${f}`;return g?b.slice(0,-1):b}:(f,g)=>g&&f!=="."?f.slice(0,-1):f}return a?u=>I1.posix.relative(s,u)||".":u=>I1.posix.relative(s,`${n}/${u}`)||"."}function afn(s,n){if(n.startsWith(`${s}/`)){let a=n.slice(s.length+1);return u=>`${a}/${u}`}return a=>{let u=I1.posix.relative(s,`${n}/${a}`);return a.endsWith("/")&&u!==""?`${u}/`:u||"."}}var sfn={parts:!0};function zgt(s){var n;let a=W8.default.scan(s,sfn);return!((n=a.parts)===null||n===void 0)&&n.length?a.parts:[s]}var lfn=/\\(?![()[\]{}!+@])/g;function cfn(s){return Ugt(s)}function ufn(s){return Vgt(s).replace(lfn,"/")}var dfn=J8e?ufn:cfn,pfn=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,ffn=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,Ugt=s=>s.replace(pfn,"\\$&"),Vgt=s=>s.replace(ffn,"\\$&"),jgt=J8e?Vgt:Ugt;function Kgt(s,n){if(n?.caseSensitiveMatch===!1)return!0;let a=W8.default.scan(s);return a.isGlob||a.negated}function dG(...s){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...s)}var mfn=/^(\/?\.\.)+/,_fn=/\\(?=[()[\]{}!*+?@|])/g,aue=/\\/g;function K8e(s,n,a,u,f){let g=s;s.endsWith("/")&&(g=s.slice(0,-1)),!g.endsWith("*")&&n&&(g+="/**");let b=jgt(a);I1.default.isAbsolute(g.replace(_fn,""))?g=I1.posix.relative(b,g):g=I1.posix.normalize(g);let C=mfn.exec(g),k=zgt(g);if(C?.[0]){let K=(C[0].length+1)/3,re=0,q=b.split("/");for(;re<K&&k[re+K]===q[q.length+re-K];)g=g.slice(0,(K-re-1)*3)+g.slice((K-re)*3+k[re+K].length+1)||".",re++;let Me=I1.posix.join(a,C[0].slice(re*3));!Me.startsWith(".")&&u.root.length>Me.length&&(u.root=Me,u.depthOffset=-K+re)}if(!f&&u.depthOffset>=0){var B;(B=u.commonPath)!==null&&B!==void 0||(u.commonPath=k);let K=[],re=Math.min(u.commonPath.length,k.length);for(let q=0;q<re;q++){let Me=k[q];if(Me==="**"&&!k[q+1]){K.pop();break}if(Me!==u.commonPath[q]||Kgt(Me)||q===k.length-1)break;K.push(Me)}u.depthOffset=K.length,u.commonPath=K,u.root=K.length>0?I1.posix.join(a,...K):a}return g}function gfn({patterns:s=["**/*"],ignore:n=[],expandDirectories:a=!0},u,f){typeof s=="string"&&(s=[s]),typeof n=="string"&&(n=[n]);let g=[],b=[];for(let C of n)C&&(C[0]!=="!"||C[1]==="(")&&b.push(K8e(C,a,u,f,!0));for(let C of s)C&&(C[0]!=="!"||C[1]==="("?g.push(K8e(C,a,u,f,!1)):(C[1]!=="!"||C[2]==="(")&&b.push(K8e(C.slice(1),a,u,f,!0)));return{match:g,ignore:b}}function Hgt(s,n){for(let a=s.length-1;a>=0;a--){let u=s[a];s[a]=n(u)}return s}function hfn(s){return s?s instanceof URL?(0,H8e.fileURLToPath)(s).replace(aue,"/"):I1.default.resolve(s).replace(aue,"/"):process.cwd().replace(aue,"/")}function qgt(s,n={}){let a=process.env.TINYGLOBBY_DEBUG?{...n,debug:!0}:n,u=hfn(a.cwd);if(a.debug&&dG("globbing with:",{patterns:s,options:a,cwd:u}),Array.isArray(s)&&s.length===0)return[{sync:()=>[],withPromise:async()=>[]},!1];let f={root:u,commonPath:null,depthOffset:0},g=gfn({...a,patterns:s},u,f);a.debug&&dG("internal processing patterns:",g);let b={dot:a.dot,nobrace:a.braceExpansion===!1,nocase:a.caseSensitiveMatch===!1,noextglob:a.extglob===!1,noglobstar:a.globstar===!1,posix:!0},C=(0,W8.default)(g.match,{...b,ignore:g.ignore}),k=(0,W8.default)(g.ignore,b),B=rfn(g.match,b),K=Wgt(u,f.root,a.absolute),re=a.absolute?K:Wgt(u,f.root,!0),q={filters:[a.debug?(Ee,St)=>{let Ot=K(Ee,St),ft=C(Ot);return ft&&dG(`matched ${Ot}`),ft}:(Ee,St)=>C(K(Ee,St))],exclude:a.debug?(Ee,St)=>{let Ot=re(St,!0),ft=Ot!=="."&&!B(Ot)||k(Ot);return dG(ft?`skipped ${St}`:`crawling ${St}`),ft}:(Ee,St)=>{let Ot=re(St,!0);return Ot!=="."&&!B(Ot)||k(Ot)},fs:a.fs?{readdir:a.fs.readdir||cw.default.readdir,readdirSync:a.fs.readdirSync||cw.default.readdirSync,realpath:a.fs.realpath||cw.default.realpath,realpathSync:a.fs.realpathSync||cw.default.realpathSync,stat:a.fs.stat||cw.default.stat,statSync:a.fs.statSync||cw.default.statSync}:void 0,pathSeparator:"/",relativePaths:!0,resolveSymlinks:!0,signal:a.signal};a.deep!==void 0&&(q.maxDepth=Math.round(a.deep-f.depthOffset)),a.absolute&&(q.relativePaths=!1,q.resolvePaths=!0,q.includeBasePath=!0),a.followSymbolicLinks===!1&&(q.resolveSymlinks=!1,q.excludeSymlinks=!0),a.onlyDirectories?(q.excludeFiles=!0,q.includeDirs=!0):a.onlyFiles===!1&&(q.includeDirs=!0),f.root=f.root.replace(aue,"");let Me=f.root;a.debug&&dG("internal properties:",f);let Te=u!==Me&&!a.absolute&&afn(u,f.root);return[new q8e.fdir(q).crawl(Me),Te]}async function yfn(s,n){if(s&&n?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let a=Ggt(s)||typeof s=="string",u=a?n:s,f=a?s:s.patterns,[g,b]=qgt(f,u);return b?Hgt(await g.withPromise(),b):g.withPromise()}function vfn(s,n){if(s&&n?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let a=Ggt(s)||typeof s=="string",u=a?n:s,f=a?s:s.patterns,[g,b]=qgt(f,u);return b?Hgt(g.sync(),b):g.sync()}pG.convertPathToPattern=dfn;pG.escapePath=jgt;pG.glob=yfn;pG.globSync=vfn;pG.isDynamicPattern=Kgt});var Ygt=Ln((kPn,Xgt)=>{"use strict";function qI(s){if(typeof s!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(s))}function $gt(s,n){for(var a="",u=0,f=-1,g=0,b,C=0;C<=s.length;++C){if(C<s.length)b=s.charCodeAt(C);else{if(b===47)break;b=47}if(b===47){if(!(f===C-1||g===1))if(f!==C-1&&g===2){if(a.length<2||u!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){var k=a.lastIndexOf("/");if(k!==a.length-1){k===-1?(a="",u=0):(a=a.slice(0,k),u=a.length-1-a.lastIndexOf("/")),f=C,g=0;continue}}else if(a.length===2||a.length===1){a="",u=0,f=C,g=0;continue}}n&&(a.length>0?a+="/..":a="..",u=2)}else a.length>0?a+="/"+s.slice(f+1,C):a=s.slice(f+1,C),u=C-f-1;f=C,g=0}else b===46&&g!==-1?++g:g=-1}return a}function bfn(s,n){var a=n.dir||n.root,u=n.base||(n.name||"")+(n.ext||"");return a?a===n.root?a+u:a+s+u:u}var fG={resolve:function(){for(var n="",a=!1,u,f=arguments.length-1;f>=-1&&!a;f--){var g;f>=0?g=arguments[f]:(u===void 0&&(u=process.cwd()),g=u),qI(g),g.length!==0&&(n=g+"/"+n,a=g.charCodeAt(0)===47)}return n=$gt(n,!a),a?n.length>0?"/"+n:"/":n.length>0?n:"."},normalize:function(n){if(qI(n),n.length===0)return".";var a=n.charCodeAt(0)===47,u=n.charCodeAt(n.length-1)===47;return n=$gt(n,!a),n.length===0&&!a&&(n="."),n.length>0&&u&&(n+="/"),a?"/"+n:n},isAbsolute:function(n){return qI(n),n.length>0&&n.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var n,a=0;a<arguments.length;++a){var u=arguments[a];qI(u),u.length>0&&(n===void 0?n=u:n+="/"+u)}return n===void 0?".":fG.normalize(n)},relative:function(n,a){if(qI(n),qI(a),n===a||(n=fG.resolve(n),a=fG.resolve(a),n===a))return"";for(var u=1;u<n.length&&n.charCodeAt(u)===47;++u);for(var f=n.length,g=f-u,b=1;b<a.length&&a.charCodeAt(b)===47;++b);for(var C=a.length,k=C-b,B=g<k?g:k,K=-1,re=0;re<=B;++re){if(re===B){if(k>B){if(a.charCodeAt(b+re)===47)return a.slice(b+re+1);if(re===0)return a.slice(b+re)}else g>B&&(n.charCodeAt(u+re)===47?K=re:re===0&&(K=0));break}var q=n.charCodeAt(u+re),Me=a.charCodeAt(b+re);if(q!==Me)break;q===47&&(K=re)}var Te="";for(re=u+K+1;re<=f;++re)(re===f||n.charCodeAt(re)===47)&&(Te.length===0?Te+="..":Te+="/..");return Te.length>0?Te+a.slice(b+K):(b+=K,a.charCodeAt(b)===47&&++b,a.slice(b))},_makeLong:function(n){return n},dirname:function(n){if(qI(n),n.length===0)return".";for(var a=n.charCodeAt(0),u=a===47,f=-1,g=!0,b=n.length-1;b>=1;--b)if(a=n.charCodeAt(b),a===47){if(!g){f=b;break}}else g=!1;return f===-1?u?"/":".":u&&f===1?"//":n.slice(0,f)},basename:function(n,a){if(a!==void 0&&typeof a!="string")throw new TypeError('"ext" argument must be a string');qI(n);var u=0,f=-1,g=!0,b;if(a!==void 0&&a.length>0&&a.length<=n.length){if(a.length===n.length&&a===n)return"";var C=a.length-1,k=-1;for(b=n.length-1;b>=0;--b){var B=n.charCodeAt(b);if(B===47){if(!g){u=b+1;break}}else k===-1&&(g=!1,k=b+1),C>=0&&(B===a.charCodeAt(C)?--C===-1&&(f=b):(C=-1,f=k))}return u===f?f=k:f===-1&&(f=n.length),n.slice(u,f)}else{for(b=n.length-1;b>=0;--b)if(n.charCodeAt(b)===47){if(!g){u=b+1;break}}else f===-1&&(g=!1,f=b+1);return f===-1?"":n.slice(u,f)}},extname:function(n){qI(n);for(var a=-1,u=0,f=-1,g=!0,b=0,C=n.length-1;C>=0;--C){var k=n.charCodeAt(C);if(k===47){if(!g){u=C+1;break}continue}f===-1&&(g=!1,f=C+1),k===46?a===-1?a=C:b!==1&&(b=1):a!==-1&&(b=-1)}return a===-1||f===-1||b===0||b===1&&a===f-1&&a===u+1?"":n.slice(a,f)},format:function(n){if(n===null||typeof n!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof n);return bfn("/",n)},parse:function(n){qI(n);var a={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return a;var u=n.charCodeAt(0),f=u===47,g;f?(a.root="/",g=1):g=0;for(var b=-1,C=0,k=-1,B=!0,K=n.length-1,re=0;K>=g;--K){if(u=n.charCodeAt(K),u===47){if(!B){C=K+1;break}continue}k===-1&&(B=!1,k=K+1),u===46?b===-1?b=K:re!==1&&(re=1):b!==-1&&(re=-1)}return b===-1||k===-1||re===0||re===1&&b===k-1&&b===C+1?k!==-1&&(C===0&&f?a.base=a.name=n.slice(1,k):a.base=a.name=n.slice(C,k)):(C===0&&f?(a.name=n.slice(1,b),a.base=n.slice(1,k)):(a.name=n.slice(C,b),a.base=n.slice(C,k)),a.ext=n.slice(b,k)),C>0?a.dir=n.slice(0,C-1):f&&(a.dir="/"),a},sep:"/",delimiter:":",win32:null,posix:null};fG.posix=fG;Xgt.exports=fG});var pht=Ln(Aa=>{"use strict";var VS=I_t(),Sfn=tgt(),Efn=require("fs"),xfn=require("fs/promises"),Tfn=require("os"),Nfn=require("path"),Qgt=Jgt();function gG(s){if(s&&typeof s=="object"&&"default"in s)return s;var n=Object.create(null);return s&&Object.keys(s).forEach(function(a){if(a!=="default"){var u=Object.getOwnPropertyDescriptor(s,a);Object.defineProperty(n,a,u.get?u:{enumerable:!0,get:function(){return s[a]}})}}),n.default=s,Object.freeze(n)}var Gx=gG(VS),nht=gG(Sfn),US=gG(Efn),Afn=gG(xfn),Cfn=gG(Tfn),sue=gG(Nfn),lue=class{#e=new Map;getSize(){return this.#e.size}getValues(){return this.#e.values()}getValuesAsArray(){return Array.from(this.getValues())}getKeys(){return this.#e.keys()}getEntries(){return this.#e.entries()}getOrCreate(n,a){let u=this.get(n);return u==null&&(u=a(),this.set(n,u)),u}has(n){return this.#e.has(n)}get(n){return this.#e.get(n)}set(n,a){this.#e.set(n,a)}replaceKey(n,a){if(!this.#e.has(n))throw new Error("Key not found.");let u=this.#e.get(n);this.#e.delete(n),this.#e.set(a,u)}removeByKey(n){this.#e.delete(n)}clear(){this.#e.clear()}},cue=class{#e;#t;constructor(n,a){this.#e=n,this.#t=a}compareTo(n){return this.#e.compareTo(this.#t,n)}},uue=class s{static instance=new s;compareTo(n,a){let u=n.localeCompare(a,"en-us-u-kf-upper");return u<0?-1:u===0?0:1}},due=class{#e;#t;constructor(n,a){this.#t=n,this.#e=a}compareTo(n,a){return this.#e.compareTo(this.#t(n),this.#t(a))}},pue=class{#e;#t;constructor(n,a){this.#t=n,this.#e=a}compareTo(n){return this.#e.compareTo(this.#t(n))}},DN=class{constructor(){}static isReadonlyArray(n){return n instanceof Array}static isNullOrEmpty(n){return!(n instanceof Array)||n.length===0}static getUniqueItems(n){return n.filter((a,u)=>n.indexOf(a)===u)}static removeFirst(n,a){let u=n.indexOf(a);return u===-1?!1:(n.splice(u,1),!0)}static removeAll(n,a){let u=[];for(let f=n.length-1;f>=0;f--)a(n[f])&&(u.push(n[f]),n.splice(f,1));return u}static*toIterator(n){for(let a of n)yield a}static sortByProperty(n,a){return n.sort((u,f)=>a(u)<=a(f)?-1:1),n}static groupBy(n,a){let u=[],f={};for(let g of n){let b=a(g).toString();f[b]==null&&(f[b]=[],u.push(f[b])),f[b].push(g)}return u}static binaryInsertWithOverwrite(n,a,u){let f=n.length-1,g=0;for(;g<=f;){let b=Math.floor((f+g)/2);u.compareTo(a,n[b])<0?f=b-1:g=b+1}n[f]!=null&&u.compareTo(a,n[f])===0?n[f]=a:n.splice(f+1,0,a)}static binarySearch(n,a){let u=n.length-1,f=0;for(;f<=u;){let g=Math.floor((u+f)/2),b=a.compareTo(n[g]);if(b===0)return g;b<0?u=g-1:f=g+1}return-1}static containsSubArray(n,a){let u=0;for(let f of n)if(a[u]===f){if(u++,u===a.length)return!0}else u=0;return!1}};function rht(s){return n(s);function n(f){let g=Object.create(f.constructor.prototype);for(let b of Object.keys(f))g[b]=u(f[b]);return g}function a(f){return f.map(u)}function u(f){return f instanceof Array?a(f):typeof f=="object"?f===null?f:n(f):f}}var fue=class{#e=[];subscribe(n){this.#t(n)===-1&&this.#e.push(n)}unsubscribe(n){let a=this.#t(n);a>=0&&this.#e.splice(a,1)}fire(n){for(let a of this.#e)a(n)}#t(n){return this.#e.indexOf(n)}},Q8e=class{static find(n,a){for(let u of n)if(a(u))return u}};function Z8e(s,n){return n??s}var eWe=class s{constructor(){}static clone(n){if(n==null)return;if(n instanceof Array)return a(n);return Object.assign({},n);function a(u){return u.map(f=>s.clone(f))}}};function iht(s,n,a,u,f,g,b,C,k,B){return Gx.matchFiles.apply(this,arguments)}function oht(s,n,a,u,f){return Gx.getFileMatcherPatterns.apply(this,arguments)}function Ifn(s){return Gx.getEmitModuleResolutionKind.apply(this,arguments)}function aht(s){return Dfn()[s]}var mG;function Dfn(){if(mG!=null)return mG;mG={};for(let s of Object.keys(Gx.SyntaxKind).filter(n=>isNaN(parseInt(n,10)))){let n=Gx.SyntaxKind[s];mG[n]==null&&(mG[n]=s)}return mG}Aa.errors=void 0;(function(s){class n extends Error{constructor(hn,ur){let br=ur&&Pfn(ur),Cn=br?`${hn}
451
451
 
452
452
  ${br}`:hn;super(Cn),this.message=Cn}}s.BaseError=n;class a extends n{constructor(hn,ur,br){super(`Argument Error (${hn}): ${ur}`,br)}}s.ArgumentError=a;class u extends a{constructor(hn,ur){super(hn,"Cannot be null or whitespace.",ur)}}s.ArgumentNullOrWhitespaceError=u;class f extends a{constructor(hn,ur,br,Cn){super(hn,`Range is ${br[0]} to ${br[1]}, but ${ur} was provided.`,Cn)}}s.ArgumentOutOfRangeError=f;class g extends a{constructor(hn,ur,br,Cn){super(hn,`Expected type '${ur}', but was '${br}'.`,Cn)}}s.ArgumentTypeError=g;class b extends n{path;constructor(hn,ur="Path"){super(`${ur} not found: ${hn}`),this.path=hn}code="ENOENT"}s.PathNotFoundError=b;class C extends b{constructor(hn){super(hn,"Directory")}}s.DirectoryNotFoundError=C;class k extends b{constructor(hn){super(hn,"File")}}s.FileNotFoundError=k;class B extends n{constructor(hn,ur){super(hn,ur)}}s.InvalidOperationError=B;class K extends n{constructor(hn="Not implemented.",ur){super(hn,ur)}}s.NotImplementedError=K;class re extends n{constructor(hn){super(hn)}}s.NotSupportedError=re;function q(Ht,hn,ur){if(typeof Ht!==hn)throw new g(ur,hn,typeof Ht)}s.throwIfNotType=q;function Me(Ht,hn){if(typeof Ht!="string")throw new g(hn,"string",typeof Ht)}s.throwIfNotString=Me;function Te(Ht,hn){if(Me(Ht,hn),Ht.trim().length===0)throw new u(hn)}s.throwIfWhitespaceOrNotString=Te;function Ee(Ht,hn,ur){if(Ht<hn[0]||Ht>hn[1])throw new f(ur,Ht,hn)}s.throwIfOutOfRange=Ee;function St(Ht,hn,ur){if(Ht[0]>Ht[1])throw new a(ur,`The start of a range must not be greater than the end: [${Ht[0]}, ${Ht[1]}]`);Ee(Ht[0],hn,ur),Ee(Ht[1],hn,ur)}s.throwIfRangeOutOfRange=St;function Ot(Ht,hn){throw new K(`Not implemented feature for syntax kind '${aht(Ht)}'.`,hn)}s.throwNotImplementedForSyntaxKindError=Ot;function ft(Ht,hn){if(Ht<0)throw new a(hn,"Expected a non-negative value.")}s.throwIfNegative=ft;function Gt(Ht,hn,ur){if(Ht==null)throw new B(typeof hn=="string"?hn:hn(),ur);return Ht}s.throwIfNullOrUndefined=Gt;function En(Ht,hn){let ur=Ht;if(ur!=null&&typeof ur.kind=="number")return Ot(ur.kind,hn);throw new K(`Not implemented value: ${JSON.stringify(Ht)}`,hn)}s.throwNotImplementedForNeverValueError=En;function vr(Ht,hn,ur){if(Ht!==hn)throw new B(`Expected ${Ht} to equal ${hn}. ${ur}`)}s.throwIfNotEqual=vr;function rn(Ht,hn){if(Ht===!0)throw new B(hn)}s.throwIfTrue=rn})(Aa.errors||(Aa.errors={}));function Pfn(s){let n=Rfn(s);if(n)return`${n.filePath}:${n.loc.line}:${n.loc.character}
453
453
  > ${n.loc.line} | ${n.lineText}`}function Rfn(s){if(!Lfn(s))return;let n=s.getSourceFile(),a=n.getFullText(),u=s.getStart(),f=a.lastIndexOf(`
@@ -30667,7 +30667,7 @@ returnCode=`+C+`
30667
30667
  `),u=a[a.length-1]??"";return[c0t.TextEdit.replace({start:{line:0,character:0},end:{line:a.length-1,character:u.length}},n)]}var Y_e=5;function e5(s){let n="",a=0;for(;a<s.length;){if(s[a]==="~"){let u=a,f=0;for(;a<s.length&&s[a]==="~";)f++,a++;let g=f>=Y_e?Y_e:1;a=u+g,n+=s.slice(u,a);let b="~".repeat(g),C=s.indexOf(b,a);C!==-1&&(n+=s.slice(a,C+g),a=C+g);continue}if(s[a]==='"'){let u=a++;for(;a<s.length&&s[a]!=='"';)s[a]==="\\"&&a++,a++;n+=s.slice(u,++a);continue}if(s[a]==="/"&&s[a+1]==="*"){let u=s.indexOf("*/",a+2);a=u!==-1?u+2:s.length;continue}if(s[a]==="/"&&s[a+1]==="/"){for(;a<s.length&&s[a]!==`
30668
30668
  `;)a++;continue}n+=s[a++]}return n}function t5(s){let n=[],a=0,u=0,f=g=>{g>u&&n.push({type:0,text:s.slice(u,g)})};for(;a<s.length;){if(s[a]==="~"){let g=a,b=0;for(;a<s.length&&s[a]==="~";)b++,a++;let C=b>=Y_e?Y_e:1;a=g+C;let k="~".repeat(C),B=s.indexOf(k,a);B!==-1&&(f(g),n.push({type:1,text:s.slice(g,B+C)}),a=B+C,u=a);continue}if(s[a]==='"'){let g=a++;for(;a<s.length&&s[a]!=='"';)s[a]==="\\"&&a++,a++;a<s.length&&a++,f(g),n.push({type:1,text:s.slice(g,a)}),u=a;continue}if(s[a]==="%"){let g=a++,b=s.indexOf("%",a);b!==-1&&(f(g),n.push({type:1,text:s.slice(g,b+1)}),a=b+1,u=a);continue}if(s[a]==="/"&&s[a+1]==="*"){let g=a,b=s.indexOf("*/",a+2);a=b!==-1?b+2:s.length,f(g),n.push({type:2,text:s.slice(g,a)}),u=a;continue}if(s[a]==="/"&&s[a+1]==="/"){let g=a;for(;a<s.length&&s[a]!==`
30669
30669
  `;)a++;f(g),n.push({type:2,text:s.slice(g,a)}),u=a;continue}a++}return f(s.length),n}function YJ(s){let n=t5(s),a=[];for(let u of n)if(u.type===0){let f=u.text.replace(/\s+/g," ");a.push(f)}else a.push(u.text);return a.join("").trim()}function p0t(s){let n="",a=0;for(;a<s.length;){if(s[a]==='"'){let u=a++;for(;a<s.length&&s[a]!=='"';)s[a]==="\\"&&a++,a++;n+=s.slice(u,++a);continue}if(s[a]==="/"&&s[a+1]==="*"){let u=s.indexOf("*/",a+2);a=u!==-1?u+2:s.length;continue}if(s[a]==="/"&&s[a+1]==="/"){for(;a<s.length&&s[a]!==`
30670
- `;)a++;continue}n+=s[a++]}return n}function f0t(s,n,a){let u=b=>a(b).replace(/\s+/g,""),f=u(s),g=u(n);if(f!==g){let b=Math.min(f.length,g.length),C=0;for(;C<b&&f[C]===g[C];)C++;let k=20,B=f.slice(Math.max(0,C-k),C+k),K=g.slice(Math.max(0,C-k),C+k);return`Formatter changed content at position ${C}: "${B}" vs "${K}"`}return null}function n5(s,n){return n?.lookup(s)}function m0t(s,n,a,u,f){let g=f(s,n,a);if(g)return g;if(u){let b=u.lookup(s);if(b&&b.source.uri!==a)return b}}function r5(s){return s?s.query({}).map(n=>n.completion):[]}function ww(s){if(!s.isInitialized())return{edits:[]};let n=s.parse(s.text);if(!n)return{edits:[]};let a=s.getFormatOptions(s.uri),u;try{u=s.formatAst(n.rootNode,a)}catch(g){let b=g instanceof Error?g.message:String(g);return Jo(`${s.languageName} formatter error: ${b}`),{edits:[],warning:`${s.languageName} formatter error: ${b}`}}let f=f0t(s.text,u.text,s.stripComments);return f?(Jo(`${s.languageName} formatter validation failed: ${f}`),{edits:[],warning:`${s.languageName} formatter validation failed: ${f}`}):{edits:d0t(s.text,u.text)}}var w3e=ta(ff());var fvn=["array","any","bool","float","int","list","map","mixed","ObjectPtr","string"],mvn=["array","bool","filename","ids","int","list","map","resref","string"],_vn=["list","map"],gvn=[...new Set([...fvn,...mvn,..._vn])].sort(),Q_e=gvn.join("|"),QJ=["param","arg"],ZJ=["ret","return","returns"],e$=["type","deprecated"],_0t=[...QJ,...ZJ,...e$].sort();var hvn={title:"",command:"editor.action.triggerSuggest"},g0t=new Set([...QJ,...ZJ,e$[0]]),yvn=new Map([...QJ.map((s,n)=>[s,n===0?"Function parameter":`Function parameter (alias for @${QJ[0]})`]),...ZJ.map((s,n)=>[s,n===0?"Return type":`Return type (alias for @${ZJ[0]})`]),[e$[0],"Variable type"],[e$[1],"Mark as deprecated"]]),vvn=new RegExp(`@(?:${[...g0t].join("|")})\\s+\\{?\\w*$`),bvn=/@\w*$/;function Svn(s){return vvn.test(s)?"type":bvn.test(s)?"tag":"none"}function Z_e(s,n){let a=Svn(n);return a==="tag"?Evn():a==="type"?xvn(s):[]}function Evn(){return[..._0t].map(s=>{let n=g0t.has(s),a=n?" ":"";return{label:`@${s}`,insertText:`${s}${a}`,filterText:s,kind:w3e.CompletionItemKind.Keyword,detail:yvn.get(s)??s,...n?{command:hvn}:{}}})}function xvn(s){return[...s].map(([n,{detail:a}])=>({label:n,detail:a,kind:w3e.CompletionItemKind.TypeParameter}))}var h0t=new Map([["array",{detail:"Array type"}],["any",{detail:"Any type"}],["bool",{detail:"Boolean type"}],["float",{detail:"Floating point type"}],["int",{detail:"Integer type"}],["list",{detail:"List type"}],["map",{detail:"Map type"}],["mixed",{detail:"Mixed type (int or float)"}],["ObjectPtr",{detail:"Object pointer"}],["string",{detail:"String type"}]]);var C0t=require("url");var tge=ta(require("fs")),dW=ta(require("path")),x0t=ta(E0t());function Tvn(s,n){if(n==="*")return!0;if(n.startsWith("*.")){let a=n.slice(2),u=a.match(/^\{(.+)\}$/);return u&&u[1]?u[1].split(",").some(g=>s.endsWith("."+g.trim())):s.endsWith("."+a)}return s===n}function T0t(s){let n=dW.basename(s),a=dW.dirname(s),u={indentSize:null,maxLineLength:null};for(;;){let f=dW.join(a,".editorconfig");if(tge.existsSync(f))try{let b=tge.readFileSync(f,"utf-8"),C=(0,x0t.parse)(b);for(let k of Object.keys(C))if(Tvn(n,k)){let B=C[k],K=B.indent_size;if(typeof K=="number")u.indentSize=K;else if(typeof K=="string"){let q=parseInt(K,10);isNaN(q)||(u.indentSize=q)}let re=B.max_line_length;if(typeof re=="number")u.maxLineLength=re;else if(typeof re=="string"&&re!=="off"){let q=parseInt(re,10);isNaN(q)||(u.maxLineLength=q)}}if(u.indentSize!==null&&u.maxLineLength!==null)return u;if(C.root===!0||C.root==="true")break}catch{}let g=dW.dirname(a);if(g===a)break;a=g}return u}var N0t=4,A0t=120;function Ow(s){try{let n=(0,C0t.fileURLToPath)(s),a=T0t(n);return{indentSize:a.indentSize??N0t,lineLimit:a.maxLineLength??A0t}}catch{return{indentSize:N0t,lineLimit:A0t}}}function wc(s,n=0,a=0){if(!s)return"";if(s.type==="ERROR")return s.text;switch(s.type){case"binary_expr":return Nvn(s,n,a);case"unary_expr":return Avn(s);case"ternary_expr":return Cvn(s);case"call_expr":return I0t(s,n,a);case"subscript_expr":return Ivn(s);case"member_expr":return Dvn(s);case"paren_expr":{let u=s.children[1];return(!u||u.type==="comment"||u.type==="line_comment")&&t$(`Unexpected paren_expr structure: ${s.text}`,s.startPosition.row+1,s.startPosition.column+1),`(${wc(u,n+1,a>0?a-1:0)})`}case"array_expr":return Pvn(s,n,a);case"map_expr":return Rvn(s,n,a);case"proc_ref":{let u=s.children[1];return(!u||u.type!=="identifier")&&t$(`Unexpected proc_ref structure: ${s.text}`,s.startPosition.row+1,s.startPosition.column+1),`@${u.text}`}case"identifier":return s.text;case"number":case"boolean":case"string":return s.text;case"for_var_decl":{let u=s.childForFieldName("name"),f=s.childForFieldName("value");return(!u||!f)&&t$(`Malformed for_var_decl: ${s.text}`,s.startPosition.row+1,s.startPosition.column+1),`variable ${u.text} = ${wc(f)}`}case"for_init_assign":{let u=s.childForFieldName("name"),f=s.childForFieldName("value");(!u||!f)&&t$(`Malformed for_init_assign: ${s.text}`,s.startPosition.row+1,s.startPosition.column+1);let g=s.children.find(b=>b.text===":="||b.text==="=")?.text||"=";return`${u.text} ${g} ${wc(f)}`}default:return s.text}}function W3e(s){return s.childForFieldName("op")?.text??""}function B3e(s,n){let a=s.childForFieldName("left"),u=s.childForFieldName("right"),f=[];return a?.type==="binary_expr"&&W3e(a)===n?f.push(...B3e(a,n)):a&&f.push(a),u?.type==="binary_expr"&&W3e(u)===n?f.push(...B3e(u,n)):u&&f.push(u),f}function Nvn(s,n=0,a=0){let u=qS(),f=s.childForFieldName("left"),g=s.childForFieldName("right"),b=W3e(s);if(["or","and","bwor","bwand","bwxor"].includes(b)){let K=B3e(s,b),q=K.map(St=>wc(St)).join(` ${b} `);if(n+q.length+a<=u.lineLimit)return q;let Me=n+b.length+1,Te=K.map((St,Ot)=>wc(St,Ot===0?n:Me)),Ee=" ".repeat(n);return Te.join(`
30670
+ `;)a++;continue}n+=s[a++]}return n}function f0t(s,n,a){let u=b=>a(b).replace(/\s+/g,""),f=u(s),g=u(n);if(f!==g){let b=Math.min(f.length,g.length),C=0;for(;C<b&&f[C]===g[C];)C++;let k=20,B=f.slice(Math.max(0,C-k),C+k),K=g.slice(Math.max(0,C-k),C+k);return`Formatter changed content at position ${C}: "${B}" vs "${K}"`}return null}function n5(s,n){return n?.lookup(s)}function m0t(s,n,a,u,f){let g=f(s,n,a);if(g)return g;if(u){let b=u.lookup(s);if(b&&b.source.uri!==a)return b}}function r5(s){return s?s.query({}).map(n=>n.completion):[]}function ww(s){if(!s.isInitialized())return{edits:[]};let n=s.parse(s.text);if(!n)return{edits:[]};let a=s.getFormatOptions(s.uri),u;try{u=s.formatAst(n.rootNode,a)}catch(g){let b=g instanceof Error?g.message:String(g);return Jo(`${s.languageName} formatter error: ${b}`),{edits:[],warning:`${s.languageName} formatter error: ${b}`}}let f=f0t(s.text,u.text,s.stripComments);return f?(Jo(`${s.languageName} formatter validation failed: ${f}`),{edits:[],warning:`${s.languageName} formatter validation failed: ${f}`}):{edits:d0t(s.text,u.text)}}var w3e=ta(ff());var fvn=["array","any","bit","bool","float","int","list","map","mixed","ObjectPtr","string"],mvn=["array","bit","bool","filename","ids","int","list","map","resref","string"],_vn=["list","map"],gvn=[...new Set([...fvn,...mvn,..._vn])].sort(),Q_e=gvn.join("|"),QJ=["param","arg"],ZJ=["ret","return","returns"],e$=["type","deprecated"],_0t=[...QJ,...ZJ,...e$].sort();var hvn={title:"",command:"editor.action.triggerSuggest"},g0t=new Set([...QJ,...ZJ,e$[0]]),yvn=new Map([...QJ.map((s,n)=>[s,n===0?"Function parameter":`Function parameter (alias for @${QJ[0]})`]),...ZJ.map((s,n)=>[s,n===0?"Return type":`Return type (alias for @${ZJ[0]})`]),[e$[0],"Variable type"],[e$[1],"Mark as deprecated"]]),vvn=new RegExp(`@(?:${[...g0t].join("|")})\\s+\\{?\\w*$`),bvn=/@\w*$/;function Svn(s){return vvn.test(s)?"type":bvn.test(s)?"tag":"none"}function Z_e(s,n){let a=Svn(n);return a==="tag"?Evn():a==="type"?xvn(s):[]}function Evn(){return[..._0t].map(s=>{let n=g0t.has(s),a=n?" ":"";return{label:`@${s}`,insertText:`${s}${a}`,filterText:s,kind:w3e.CompletionItemKind.Keyword,detail:yvn.get(s)??s,...n?{command:hvn}:{}}})}function xvn(s){return[...s].map(([n,{detail:a}])=>({label:n,detail:a,kind:w3e.CompletionItemKind.TypeParameter}))}var h0t=new Map([["array",{detail:"Array type"}],["any",{detail:"Any type"}],["bit",{detail:"Bit type"}],["bool",{detail:"Boolean type"}],["float",{detail:"Floating point type"}],["int",{detail:"Integer type"}],["list",{detail:"List type"}],["map",{detail:"Map type"}],["mixed",{detail:"Mixed type (int or float)"}],["ObjectPtr",{detail:"Object pointer"}],["string",{detail:"String type"}]]);var C0t=require("url");var tge=ta(require("fs")),dW=ta(require("path")),x0t=ta(E0t());function Tvn(s,n){if(n==="*")return!0;if(n.startsWith("*.")){let a=n.slice(2),u=a.match(/^\{(.+)\}$/);return u&&u[1]?u[1].split(",").some(g=>s.endsWith("."+g.trim())):s.endsWith("."+a)}return s===n}function T0t(s){let n=dW.basename(s),a=dW.dirname(s),u={indentSize:null,maxLineLength:null};for(;;){let f=dW.join(a,".editorconfig");if(tge.existsSync(f))try{let b=tge.readFileSync(f,"utf-8"),C=(0,x0t.parse)(b);for(let k of Object.keys(C))if(Tvn(n,k)){let B=C[k],K=B.indent_size;if(typeof K=="number")u.indentSize=K;else if(typeof K=="string"){let q=parseInt(K,10);isNaN(q)||(u.indentSize=q)}let re=B.max_line_length;if(typeof re=="number")u.maxLineLength=re;else if(typeof re=="string"&&re!=="off"){let q=parseInt(re,10);isNaN(q)||(u.maxLineLength=q)}}if(u.indentSize!==null&&u.maxLineLength!==null)return u;if(C.root===!0||C.root==="true")break}catch{}let g=dW.dirname(a);if(g===a)break;a=g}return u}var N0t=4,A0t=120;function Ow(s){try{let n=(0,C0t.fileURLToPath)(s),a=T0t(n);return{indentSize:a.indentSize??N0t,lineLimit:a.maxLineLength??A0t}}catch{return{indentSize:N0t,lineLimit:A0t}}}function wc(s,n=0,a=0){if(!s)return"";if(s.type==="ERROR")return s.text;switch(s.type){case"binary_expr":return Nvn(s,n,a);case"unary_expr":return Avn(s);case"ternary_expr":return Cvn(s);case"call_expr":return I0t(s,n,a);case"subscript_expr":return Ivn(s);case"member_expr":return Dvn(s);case"paren_expr":{let u=s.children[1];return(!u||u.type==="comment"||u.type==="line_comment")&&t$(`Unexpected paren_expr structure: ${s.text}`,s.startPosition.row+1,s.startPosition.column+1),`(${wc(u,n+1,a>0?a-1:0)})`}case"array_expr":return Pvn(s,n,a);case"map_expr":return Rvn(s,n,a);case"proc_ref":{let u=s.children[1];return(!u||u.type!=="identifier")&&t$(`Unexpected proc_ref structure: ${s.text}`,s.startPosition.row+1,s.startPosition.column+1),`@${u.text}`}case"identifier":return s.text;case"number":case"boolean":case"string":return s.text;case"for_var_decl":{let u=s.childForFieldName("name"),f=s.childForFieldName("value");return(!u||!f)&&t$(`Malformed for_var_decl: ${s.text}`,s.startPosition.row+1,s.startPosition.column+1),`variable ${u.text} = ${wc(f)}`}case"for_init_assign":{let u=s.childForFieldName("name"),f=s.childForFieldName("value");(!u||!f)&&t$(`Malformed for_init_assign: ${s.text}`,s.startPosition.row+1,s.startPosition.column+1);let g=s.children.find(b=>b.text===":="||b.text==="=")?.text||"=";return`${u.text} ${g} ${wc(f)}`}default:return s.text}}function W3e(s){return s.childForFieldName("op")?.text??""}function B3e(s,n){let a=s.childForFieldName("left"),u=s.childForFieldName("right"),f=[];return a?.type==="binary_expr"&&W3e(a)===n?f.push(...B3e(a,n)):a&&f.push(a),u?.type==="binary_expr"&&W3e(u)===n?f.push(...B3e(u,n)):u&&f.push(u),f}function Nvn(s,n=0,a=0){let u=qS(),f=s.childForFieldName("left"),g=s.childForFieldName("right"),b=W3e(s);if(["or","and","bwor","bwand","bwxor"].includes(b)){let K=B3e(s,b),q=K.map(St=>wc(St)).join(` ${b} `);if(n+q.length+a<=u.lineLimit)return q;let Me=n+b.length+1,Te=K.map((St,Ot)=>wc(St,Ot===0?n:Me)),Ee=" ".repeat(n);return Te.join(`
30671
30671
  ${Ee}${b} `)}let k=wc(f,n),B=n+k.length+b.length+2;return`${k} ${b} ${wc(g,B)}`}function Avn(s){let n=s.childForFieldName("op")?.text||"",a=s.childForFieldName("expr");return s.children[0]?.text==="++"||s.children[0]?.text==="--"?`${n}${wc(a)}`:s.children[1]?.text==="++"||s.children[1]?.text==="--"?`${wc(a)}${n}`:n==="-"?`${n}${wc(a)}`:`${n} ${wc(a)}`}function Cvn(s){let n=s.childForFieldName("true_value"),a=s.childForFieldName("cond"),u=s.childForFieldName("false_value");return`${wc(n)} if ${wc(a)} else ${wc(u)}`}function I0t(s,n=0,a=0){let u=qS(),g=s.childForFieldName("func")?.text||"",C=s.namedChildren.slice(1).filter(K=>K.type!=="comment").map(K=>wc(K)),k=`${g}(${C.join(", ")})`;if(n+k.length+a<=u.lineLimit||C.length<=1)return k;let B=" ".repeat(n+g.length+1);return`${g}(${C.join(`,
30672
30672
  `+B)})`}function Ivn(s){let n=s.childForFieldName("object"),a=s.childForFieldName("index");return`${wc(n)}[${wc(a)}]`}function Dvn(s){let n=s.childForFieldName("object"),a=s.childForFieldName("member");return`${wc(n)}.${a?.text||""}`}function Pvn(s,n=0,a=0){let u=qS(),f=[];for(let C of s.children)C.type!=="["&&C.type!=="]"&&C.type!==","&&!rL(C)&&f.push(wc(C));let g=`[${f.join(", ")}]`;if(n+g.length+a<=u.lineLimit||f.length<=1)return g;let b=" ".repeat(n+1);return`[${f.join(`,
30673
30673
  `+b)}]`}function Rvn(s,n=0,a=0){let u=qS(),f=[];for(let C of s.children)if(C.type==="map_entry"){let k=C.childForFieldName("key"),B=C.childForFieldName("value");f.push(`${wc(k)}: ${wc(B)}`)}let g=`{${f.join(", ")}}`;if(n+g.length+a<=u.lineLimit||f.length<=1)return g;let b=" ".repeat(n+1);return`{${f.join(`,
@@ -30718,7 +30718,7 @@ ${hh.indent.repeat(n)}end${g}`}var z0t=ta(ff()),Vvn=new Set(["comment","line_com
30718
30718
 
30719
30719
  `+s.description),s.paramTable&&(n+=`
30720
30720
 
30721
- `+s.paramTable),n+=nge(s.deprecated),n}var ige=new Map([["array",{detail:"Array type",category:"int"}],["bool",{detail:"Boolean type",category:"int"}],["filename",{detail:"File name",category:"str"}],["ids",{detail:"IDS reference",category:"str"}],["int",{detail:"Integer type",category:"int"}],["list",{detail:"List type",category:"int"}],["map",{detail:"Map type",category:"int"}],["resref",{detail:"Resource reference",category:"str"}],["byte array offset",{detail:"Byte array (offset field)",category:"int"}],["char array offset",{detail:"Char array (offset field)",category:"int"}],["resref offset",{detail:"Resource reference (offset field)",category:"str"}],["string",{detail:"String type",category:"str"}]]),abn="https://ielib.bgforge.net/types/#";function K0t(s){if(!s)return"";if(!ige.has(s))return s;let n=s.split(" ",1)[0];return`[${s}](${abn}${n})`}function U3e(s){let n=s.filter(u=>u.rows.length>0);if(n.length===0)return"";let a=["| | | | |","|-:|:-|:-|:-|"];for(let u of n){let[f,g]=u.label.split(" ");a.push(`|**${f}**|**${g}**|||`);for(let b of u.rows){let C=K0t(b.type),k=sbn(b),B=b.description?`&nbsp;&nbsp;${b.description}`:"";a.push(`|${C}|${b.name}|${k}|${B}|`)}}return a.join(`
30721
+ `+s.paramTable),n+=nge(s.deprecated),n}var ige=new Map([["array",{detail:"Array type",category:"int"}],["bit",{detail:"Bit type",category:"int"}],["bool",{detail:"Boolean type",category:"int"}],["filename",{detail:"File name",category:"str"}],["ids",{detail:"IDS reference",category:"str"}],["int",{detail:"Integer type",category:"int"}],["list",{detail:"List type",category:"int"}],["map",{detail:"Map type",category:"int"}],["resref",{detail:"Resource reference",category:"str"}],["byte array offset",{detail:"Byte array (offset field)",category:"int"}],["char array offset",{detail:"Char array (offset field)",category:"int"}],["resref offset",{detail:"Resource reference (offset field)",category:"str"}],["string",{detail:"String type",category:"str"}]]),abn="https://ielib.bgforge.net/types/#";function K0t(s){if(!s)return"";if(!ige.has(s))return s;let n=s.split(" ",1)[0];return`[${s}](${abn}${n})`}function U3e(s){let n=s.filter(u=>u.rows.length>0);if(n.length===0)return"";let a=["| | | | |","|-:|:-|:-|:-|"];for(let u of n){let[f,g]=u.label.split(" ");a.push(`|**${f}**|**${g}**|||`);for(let b of u.rows){let C=K0t(b.type),k=sbn(b),B=b.description?`&nbsp;&nbsp;${b.description}`:"";a.push(`|${C}|${b.name}|${k}|${B}|`)}}return a.join(`
30722
30722
  `)}function sbn(s){return s.required?"_required_":s.default!==void 0?`=&nbsp;${s.default}`:""}function V3e(s){let n=s.filter(u=>u.description);if(n.length===0)return"";let a=["|||","|:-|:-|"];for(let u of n)a.push(`|\`${u.name}\`|&nbsp;&nbsp;${u.description}|`);return a.join(`
30723
30723
  `)}function H0t(s){let n=`
30724
30724
  ---
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bgforge/mls-server",
3
3
  "description": "LSP server for Fallout SSL, WeiDU (BAF/D/TP2), and related modding languages",
4
- "version": "3.4.0",
4
+ "version": "3.5.0",
5
5
  "author": "BGforge",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",
7
7
  "main": "out/server.js",