@opensumi/cli-engine 3.8.3-next-1743422663.0 → 3.8.3-next-1743493833.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.
@@ -31941,7 +31941,7 @@ body.vscode-high-contrast #scroll-to-top:hover {
31941
31941
  `;(O=M[P].children)===null||O===void 0||O.forEach(B=>{const j=B.contentResult;L=L+`${j.line},${j.matchStart}: ${j.renderLineText}
31942
31942
  `}),R+=L,P<k&&(R+=`
31943
31943
  `)}this.clipboardService.writeText(R)}}),D.registerCommand(o.SEARCH_COMMANDS.MENU_COPY_PATH,{execute:I=>{this.clipboardService.writeText(I.resource.codeUri.fsPath.toString())}})}registerMenus(D){D.registerMenuItem(m.MenuId.SearchContext,{command:o.SEARCH_COMMANDS.MENU_REPLACE.id,order:1,group:"0_operator"}),D.registerMenuItem(m.MenuId.SearchContext,{command:o.SEARCH_COMMANDS.MENU_REPLACE_ALL.id,order:2,group:"0_operator"}),D.registerMenuItem(m.MenuId.SearchContext,{command:o.SEARCH_COMMANDS.MENU_HIDE.id,order:3,group:"0_operator"}),D.registerMenuItem(m.MenuId.SearchContext,{command:o.SEARCH_COMMANDS.MENU_COPY.id,order:1,group:"1_copy"}),D.registerMenuItem(m.MenuId.SearchContext,{command:o.SEARCH_COMMANDS.MENU_COPY_PATH.id,order:2,group:"1_copy"}),D.registerMenuItem(m.MenuId.SearchContext,{command:o.SEARCH_COMMANDS.MENU_COPY_ALL.id,order:3,group:"1_copy"})}registerKeybindings(D){D.registerKeybinding({command:o.SEARCH_COMMANDS.OPEN_SEARCH.id,keybinding:"ctrlcmd+shift+f"}),D.registerKeybinding({command:o.SEARCH_COMMANDS.GET_BACK_RECENT_SEARCH_WORD.id,keybinding:"down",when:p.SearchInputBoxFocusedKey.raw}),D.registerKeybinding({command:o.SEARCH_COMMANDS.GET_RECENT_SEARCH_WORD.id,keybinding:"up",when:p.SearchInputBoxFocusedKey.raw})}registerComponent(D){D.register("@opensumi/ide-search",[],{containerId:c.SEARCH_CONTAINER_ID,iconClass:(0,o.getIcon)("search"),title:(0,o.localize)("search.title"),component:b.Search,priority:9,activateKeyBinding:"ctrlcmd+shift+f"})}registerToolbarItems(D){D.registerItem({id:o.SEARCH_COMMANDS.CLEAN.id,command:o.SEARCH_COMMANDS.CLEAN.id,viewId:c.SEARCH_CONTAINER_ID,tooltip:(0,o.localize)("search.ClearSearchResultsAction.label"),enabledWhen:"canClearSearchResult"}),D.registerItem({id:o.SEARCH_COMMANDS.REFRESH.id,command:o.SEARCH_COMMANDS.REFRESH.id,viewId:c.SEARCH_CONTAINER_ID,tooltip:(0,o.localize)("search.RefreshAction.label"),enabledWhen:"canRefreshSearchResult"})}onDidRender(){const D=this.mainLayoutService.getTabbarHandler(c.SEARCH_CONTAINER_ID);D&&(this.searchTreeService.viewReady.then(()=>{D.isActivated()&&this.searchModelService.activate()}),D.onActivate(()=>{this.searchBrowserService.initSearchHistory(),this.searchBrowserService.focus(),this.searchModelService.activate()}),D.onInActivate(()=>{this.searchTreeService.removeHighlightRange(),this.searchBrowserService.blur(),this.searchModelService.deactivate()}))}dispose(){this.toDispose.dispose()}};t.SearchContribution=w,n.__decorate([(0,r.Autowired)(h.IMainLayoutService),n.__metadata("design:type",Object)],w.prototype,"mainLayoutService",void 0),n.__decorate([(0,r.Autowired)(E.IContentSearchClientService),n.__metadata("design:type",Object)],w.prototype,"searchBrowserService",void 0),n.__decorate([(0,r.Autowired)(y.SearchTreeService),n.__metadata("design:type",y.SearchTreeService)],w.prototype,"searchTreeService",void 0),n.__decorate([(0,r.Autowired)(g.IEditorDocumentModelService),n.__metadata("design:type",Object)],w.prototype,"documentModelManager",void 0),n.__decorate([(0,r.Autowired)(d.IWorkspaceEditService),n.__metadata("design:type",Object)],w.prototype,"workspaceEditService",void 0),n.__decorate([(0,r.Autowired)(u.IDialogService),n.__metadata("design:type",Object)],w.prototype,"dialogService",void 0),n.__decorate([(0,r.Autowired)(A.SearchModelService),n.__metadata("design:type",A.SearchModelService)],w.prototype,"searchModelService",void 0),n.__decorate([(0,r.Autowired)(o.IClipboardService),n.__metadata("design:type",Object)],w.prototype,"clipboardService",void 0),t.SearchContribution=w=n.__decorate([(0,s.Domain)(o.ClientAppContribution,_.CommandContribution,o.KeybindingContribution,o.ComponentContribution,v.TabBarToolbarContribution,o.PreferenceContribution,l.MainLayoutContribution,m.MenuContribution)],w)},79904:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchInputWidget=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(97267),p=e(67304),v=e(33783),m=n.__importDefault(e(66653)),_=(0,o.memo)(({isDetailOpen:g,onDetailToggle:l})=>o.default.createElement("p",{className:m.default.search_input_title},o.default.createElement("span",{className:m.default.search_title},(0,v.localize)("search.input.title")),o.default.createElement(c.CheckBox,{className:(0,r.default)(m.default.checkbox),label:(0,v.localize)("search.input.checkbox"),checked:g,id:"search-input",onChange:l})),(g,l)=>g.isDetailOpen===l.isDetailOpen);function s(g,l){return g.isDetailOpen===l.isDetailOpen&&g.isMatchCase===l.isMatchCase&&g.isWholeWord===l.isWholeWord&&g.isRegex===l.isRegex&&g.searchValue===l.searchValue&&g.isShowValidateMessage===l.isShowValidateMessage&&g.validateMessage===l.validateMessage}t.SearchInputWidget=(0,o.memo)((0,o.forwardRef)(({isDetailOpen:g,onDetailToggle:l,onSearchFocus:h,onSearchBlur:u,isMatchCase:d,onMatchCaseToggle:E,isWholeWord:f,onWholeWordToggle:a,isRegex:b,onRegexToggle:y,searchValue:A,onSearch:S,onSearchInputChange:w,isShowValidateMessage:T,validateMessage:D},I)=>o.default.createElement("div",{className:m.default.search_and_replace_container},o.default.createElement("div",{className:m.default.search_and_replace_fields},o.default.createElement("div",{className:m.default.search_field_container},o.default.createElement(_,{isDetailOpen:g,onDetailToggle:l}),o.default.createElement("div",{className:m.default.search_field},o.default.createElement(c.ValidateInput,{id:"search-input-field",title:(0,v.localize)("search.input.placeholder"),type:"text",value:A,placeholder:(0,v.localize)("search.input.title"),onFocus:h,onBlur:u,onKeyUp:S,onChange:w,ref:I,validateMessage:T?D:void 0,addonAfter:[o.default.createElement("span",{key:(0,v.localize)("search.caseDescription"),className:(0,r.default)((0,p.getIcon)("ab"),m.default["match-case"],m.default.search_option,{[m.default.select]:d}),title:(0,v.localize)("search.caseDescription"),onClick:E}),o.default.createElement("span",{key:(0,v.localize)("search.wordsDescription"),className:(0,r.default)((0,p.getIcon)("abl"),m.default["whole-word"],m.default.search_option,{[m.default.select]:f}),title:(0,v.localize)("search.wordsDescription"),onClick:a}),o.default.createElement("span",{key:(0,v.localize)("search.regexDescription"),className:(0,r.default)((0,p.getIcon)("regex"),m.default["use-regexp"],m.default.search_option,{[m.default.select]:b}),title:(0,v.localize)("search.regexDescription"),onClick:y})]})))))),s)},67640:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchReplaceWidget=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),c=e(97267),p=e(33783),v=n.__importDefault(e(66653));t.SearchReplaceWidget=o.default.memo(({replaceValue:m,disabled:_=!0,onSearch:s,onReplaceRuleChange:g,replaceAll:l})=>o.default.createElement("div",{className:v.default.search_and_replace_container},o.default.createElement("div",{className:v.default.search_and_replace_fields},o.default.createElement("div",{className:v.default.replace_field},o.default.createElement(c.Input,{value:m,id:"replace-input-field",title:(0,p.localize)("search.replace.label"),type:"text",placeholder:(0,p.localize)("search.replace.title"),onKeyUp:s,onChange:g}),o.default.createElement("div",{className:(0,r.default)(v.default.replace_all_button,_&&v.default.disabled),onClick:l},o.default.createElement("span",null,(0,p.localize)("search.replaceAll.label")))))))},12781:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchRulesWidget=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),c=e(97267),p=e(11050),v=e(67304),m=e(33783),_=e(92553),s=n.__importDefault(e(66653)),g=()=>o.default.createElement("div",{className:(0,r.default)(s.default.include_rule_content)},o.default.createElement("ul",null,o.default.createElement("li",null,", : ",(0,m.localize)("search.help.concatRule")),o.default.createElement("li",null,"* : ",(0,m.localize)("search.help.matchOneOrMoreRule")),o.default.createElement("li",null,"? : ",(0,m.localize)("search.help.matchOne")),o.default.createElement("li",null,"** : ",(0,m.localize)("search.help.matchAny")),o.default.createElement("li",null," : ",(0,m.localize)("search.help.matchWithGroup")),o.default.createElement("li",null,"[] : ",(0,m.localize)("search.help.matchRange")))),l=o.default.memo(()=>{const E=o.default.useContext(p.ConfigContext),{injector:f}=E,a=f.get(_.IContentSearchClientService),b=o.default.useMemo(()=>a.getPreferenceSearchExcludes(),[a]);return o.default.createElement("div",{className:(0,r.default)(s.default.exclude_rule_content)},o.default.createElement("div",null,b.map((y,A)=>A===b.length-1?y:`${y}, `)))}),h=o.default.memo(({includeValue:E,isOnlyOpenEditors:f,onSearch:a,onChangeInclude:b,onOnlyOpenEditorsToggle:y})=>o.default.createElement("div",{className:(0,r.default)(s.default.glob_field)},o.default.createElement("div",{className:(0,r.default)(s.default.label)},o.default.createElement("span",{className:s.default.limit},(0,m.localize)("search.includes")),o.default.createElement("span",{className:(0,r.default)(s.default.include_rule)},o.default.createElement(c.Popover,{id:"show_include_rule",title:(0,m.localize)("search.help.supportRule"),content:o.default.createElement(g,null),trigger:c.PopoverTriggerType.hover,delay:.5,position:c.PopoverPosition.right},o.default.createElement("a",null,(0,m.localize)("search.help.showIncludeRule"))))),o.default.createElement(c.Input,{value:E,type:"text",placeholder:(0,m.localize)("search.includes.description"),onKeyUp:a,onChange:b,id:"include-input-field",addonAfter:[o.default.createElement("span",{key:"onlyOpenEditors",className:(0,r.default)((0,v.getExternalIcon)("book"),s.default.search_option,{[s.default.select]:f}),title:(0,m.localize)("search.onlyOpenEditors"),onClick:y})]})),(E,f)=>E.includeValue===f.includeValue&&E.isOnlyOpenEditors===f.isOnlyOpenEditors),u=o.default.memo(({isIncludeIgnored:E,excludeValue:f,onIncludeIgnoredToggle:a,onChangeExclude:b,onOpenPreference:y,onSearch:A})=>o.default.createElement("div",{className:(0,r.default)(s.default.glob_field,s.default.search_excludes)},o.default.createElement("div",{className:s.default.label},o.default.createElement("span",{className:s.default.limit},(0,m.localize)("search.excludes")),o.default.createElement("div",{className:s.default.use_default_excludes_wrapper},o.default.createElement(c.CheckBox,{className:(0,r.default)(s.default.checkbox),label:(0,m.localize)("search.excludes.default.enable"),checked:!E,id:"search-input-isIncludeIgnored",onChange:a}),o.default.createElement(c.Popover,{title:(0,m.localize)("search.help.excludeList"),overlayClassName:(0,r.default)(s.default.search_excludes_description),id:"search_excludes",action:(0,m.localize)("search.help.modify"),onClickAction:y,content:o.default.createElement(l,null),trigger:c.PopoverTriggerType.hover,delay:.5,position:c.PopoverPosition.right},o.default.createElement("span",{className:(0,r.default)((0,v.getIcon)("question-circle"),s.default.search_option),style:{opacity:"0.7",cursor:"pointer"}})))),o.default.createElement(c.Input,{type:"text",value:f,placeholder:(0,m.localize)("search.includes.description"),onKeyUp:A,onChange:b,id:"exclude-input-field"})),(E,f)=>E.excludeValue===f.excludeValue&&E.isIncludeIgnored===f.isIncludeIgnored);function d(E,f){return E.includeValue===f.includeValue&&E.excludeValue===f.excludeValue&&E.isOnlyOpenEditors===f.isOnlyOpenEditors&&E.isIncludeIgnored===f.isIncludeIgnored}t.SearchRulesWidget=o.default.memo(({includeValue:E,excludeValue:f,onChangeExclude:a,onChangeInclude:b,isOnlyOpenEditors:y,onOnlyOpenEditorsToggle:A,isIncludeIgnored:S,onIncludeIgnoredToggle:w,onSearch:T,onOpenPreference:D})=>o.default.createElement("div",{className:"glob_field-container"},o.default.createElement(h,{includeValue:E,onSearch:T,onChangeInclude:b,isOnlyOpenEditors:y,onOnlyOpenEditorsToggle:A}),o.default.createElement(u,{isIncludeIgnored:S,excludeValue:f,onIncludeIgnoredToggle:w,onChangeExclude:a,onOpenPreference:D,onSearch:T})),d)},51495:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContentSearchClientService=void 0;const n=e(85608),r=n.__importDefault(e(12784)),o=e(76003),c=e(97267),p=e(41869),v=e(18193),m=e(7369),_=e(43718),s=e(54414),g=e(57517),l=n.__importStar(e(20868)),h=e(72665),u=e(51500),d=e(26199),E=e(52925),f=e(3956),a=e(96895),b=e(33301),y=e(9767);function A(w){return w.length>0?w.split(",").map(T=>T.trim()):[]}let S=class extends _.Disposable{get onDidChange(){return this.onDidChangeEmitter.event}get onDidTitleChange(){return this.onDidTitleChangeEmitter.event}get onDidUIStateChange(){return this.onDidUIStateChangeEmitter.event}get onDidSearchStateChange(){return this.onDidSearchStateChangeEmitter.event}constructor(){super(),this.onDidChangeEmitter=new p.Emitter,this.onDidTitleChangeEmitter=new p.Emitter,this.onDidUIStateChangeEmitter=new p.Emitter,this.onDidSearchStateChangeEmitter=new p.Emitter,this.UIState={isToggleOpen:!0,isDetailOpen:!1,isMatchCase:!1,isWholeWord:!1,isUseRegexp:!1,isIncludeIgnored:!1,isOnlyOpenEditors:!1},this.searchResults=new Map,this.searchError="",this.resultTotal={resultNum:0,fileNum:0},this.isReplacing=!1,this.isSearching=!1,this.isShowValidateMessage=!0,this.replaceValue="",this.searchValue="",this.includeValue="",this.excludeValue="",this._docModelSearchedList=[],this._currentSearchId=-1,this.searchResultCollection=new y.SearchResultCollection,this.reporter=null,this.searchId=new Date().getTime(),this.EMPTY_SELECTION=new l.Range(0,0,0,0),this.onSearchInputChange=D=>{this.searchValue=D,this.isShowValidateMessage=!1,this.searchOnTyping()},this.onReplaceInputChange=D=>{this.replaceValue=D},this.onSearchExcludeChange=D=>{this.excludeValue=D,this.searchOnTyping()},this.onSearchIncludeChange=D=>{this.includeValue=D,this.searchOnTyping()},this.searchEditorSelection=()=>{const D=this.workbenchEditorService.currentOrPreviousFocusedEditor;if(D){const I=D.getSelections();if(I&&I.length>0&&D.currentDocumentModel){const{selectionStartLineNumber:O,selectionStartColumn:M,positionLineNumber:R,positionColumn:P}=I[0],k=D.currentDocumentModel.getText(new l.Range(O,M,R,P)),F=p.strings.trim(k)===""?this.searchValue:k;this.searchValue=F}}},this.shouldSearch=D=>["isWholeWord","isMatchCase","isUseRegexp","isIncludeIgnored","isOnlyOpenEditors"].some(I=>D[I]!==void 0&&D[I]!==this.UIState[I]),this.updateUIState=D=>{const I=Object.assign({},this.UIState,D);this.shouldSearch(D)&&this.search(I),this.UIState=I,this.onDidUIStateChangeEmitter.fire(I),this.browserStorageService.setData("search.UIState",I)},this.replaceAll=()=>{this.isReplacing||(this.isReplacing=!0,(0,f.replaceAll)(this.documentModelManager,this.workspaceEditService,this.searchResults,this.replaceValue,this.searchValue,this.UIState.isUseRegexp,this.dialogService,this.messageService,this.resultTotal).then(D=>{this.isReplacing=!1,D&&this.search()}))},this.setDefaultIncludeValue(),this.recoverUIState(),this.searchOnType=this.searchPreferences["search.searchOnType"]||!0;const T=this.searchPreferences["search.searchOnTypeDebouncePeriod"]||300;this.searchDebounce=(0,r.default)(()=>{this.search()},T,{trailing:!0,maxWait:T*5})}searchOnTyping(){this.searchOnType&&this.searchDebounce()}async search(T){const D=this.searchValue;if(this.cleanSearchResults(),!D){this.onDidChangeEmitter.fire();return}this.searchCancelToken&&!this.searchCancelToken.token.isCancellationRequested&&this.searchCancelToken.cancel(),this.searchCancelToken=new _.CancellationTokenSource;const I=T||this.UIState;await this.doSearch(D,I,this.searchCancelToken.token)}async doSearch(T,D,I){var O,M,R;const P={maxResults:D.maxResults||2e3,matchCase:D.isMatchCase,matchWholeWord:D.isWholeWord,useRegExp:D.isUseRegexp,includeIgnored:D.isIncludeIgnored,include:D.include||A(this.includeValue||""),exclude:D.exclude||A(this.excludeValue||"")};P.exclude=this.getExcludeWithSetting(P,D),this.searchHistory.setSearchHistory(T),this.isShowValidateMessage=!0,this.isSearching=!0,this._currentSearchId>-1&&(this.contentSearchServer.cancel(this._currentSearchId),this._currentSearchId=this._currentSearchId+1,this.reporter=null);const k=new Set;if(this.workspaceService.tryGetRoots().forEach(B=>{const j=new p.URI(B.uri);j.scheme===p.Schemes.file&&k.add(j.toString())}),P.encoding=this.preferenceService.get("files.encoding",void 0,(O=k.values().next())===null||O===void 0?void 0:O.value),D.isOnlyOpenEditors){k.clear();const B=p.arrays.coalesce(p.arrays.flatten(this.workbenchEditorService.editorGroups.map($=>$.resources))),j=((M=P.include)===null||M===void 0?void 0:M.map($=>(0,p.parseGlob)((0,E.anchorGlob)($))))||[],W=((R=P.exclude)===null||R===void 0?void 0:R.map($=>(0,p.parseGlob)((0,E.anchorGlob)($))))||[],U=B.filter($=>{const Y=$.uri.path.toString();return!(W.length>0&&W.some(z=>z(Y))||j.length>0&&!j.some(z=>z(Y)))}),Q=[],V=$=>!!$.codeUri.path&&$.codeUri.path[0]==="/";U.forEach(({uri:$})=>{var Y;if($.scheme!==p.Schemes.walkThrough)if(V($)){const z=(Y=this.workspaceService.getWorkspaceRootUri($))!==null&&Y!==void 0?Y:$.withPath($.path.dir),H=z.path.relative($.path);k.add(z.toString()),H&&Q.push(`./${H.toString()}`)}else $.codeUri.fsPath&&Q.push($.codeUri.fsPath)}),P.include=Q,P.exclude=Q.length>0?void 0:["**/*"]}const F=Array.from(k),L=await this.searchAllFromDocModel({searchValue:T,searchOptions:P,documentModelManager:this.documentModelManager,rootDirs:F});if(I.isCancellationRequested){this.isSearching=!1;return}this._currentSearchId=this.searchId++,this.reporter={timer:this.reporterService.time(_.REPORT_NAME.SEARCH_MEASURE),value:T},this.contentSearchServer.search(this._currentSearchId,T,F,P).then(B=>{I.isCancellationRequested||this._onSearchResult({id:B,data:L.result,searchState:E.SEARCH_STATE.doing,docModelSearchedList:L.searchedList})}),this.watchDocModelContentChange(P,F)}setEditorSelections(T,D){var I;(I=this.lastEditor)===null||I===void 0||I.setSelection(this.EMPTY_SELECTION),this.lastEditor=T,this.lastSelection=D,this.applyEditorSelections()}applyEditorSelections(){this.lastEditor&&this.lastSelection&&this.lastEditor.setSelection(this.lastSelection)}clearEditorSelections(T=!1){this.lastEditor&&this.lastEditor.setSelection(this.EMPTY_SELECTION),T&&(this.lastSelection=void 0,this.lastEditor=void 0)}watchDocModelContentChange(T,D){this.eventBusDisposer&&this.eventBusDisposer.dispose(),this.eventBusDisposer=this.eventBus.on(g.EditorDocumentModelContentChangedEvent,I=>{const O=I.payload;if(!this.searchResults||this.isReplacing||O.uri.scheme!==p.Schemes.file)return;const M=O.uri.toString(),R=this.documentModelManager.getModelReference(O.uri);if(!R)return;const P=this.searchFromDocModel(T,R.instance,this.searchValue,D),k=this.searchResults.get(M);k?P.result.length<1?(this.searchResults.delete(M),this.resultTotal.fileNum=this.resultTotal.fileNum-1,this.resultTotal.resultNum=this.resultTotal.resultNum-k.length):P.result.length!==k?.length&&(this.resultTotal.resultNum=this.resultTotal.resultNum-k.length+P.result.length):P.result.length>0&&(this.resultTotal.fileNum++,this.resultTotal.resultNum=this.resultTotal.resultNum+P.result.length),P.result.length>0&&this.searchResults.set(M,P.result),this.onDidChangeEmitter.fire(),R.dispose()})}cleanSearchResults(){this._docModelSearchedList=[],this.searchResults.clear(),this.resultTotal={resultNum:0,fileNum:0},this.clearEditorSelections(!0)}onSearchResult(T){this.searchResultCollection.pushAndGetResultList(T).forEach(I=>{this._onSearchResult(I)})}_onSearchResult(T){const{id:D,data:I,searchState:O,error:M,docModelSearchedList:R}=T;if(I&&(D>this._currentSearchId&&(this.isSearching=!0,this._currentSearchId=D,this.cleanSearchResults()),!(this._currentSearchId&&this._currentSearchId>D))){if(O&&(this.searchState=O,(O===E.SEARCH_STATE.done||O===E.SEARCH_STATE.error)&&(this.isSearching=!1,this._currentSearchId=-1),O===E.SEARCH_STATE.done&&this.reporter)){const{timer:P,value:k}=this.reporter;P.timeEnd(k,{...this.resultTotal}),this.reporter=null}M&&(this.isSearching=!1,this.searchError=M.toString(),this.reporter=null),this.mergeSameUriResult(I,this.searchResults,this._docModelSearchedList,this.resultTotal),R&&(this._docModelSearchedList=R),this.onDidChangeEmitter.fire()}}focus(){window.requestAnimationFrame(()=>{this.onDidSearchStateChangeEmitter.fire(this.searchValue),this.applyEditorSelections()})}blur(){this.clearEditorSelections()}refreshIsEnable(){return!!(this.searchState!==E.SEARCH_STATE.doing&&this.searchValue)}initSearchHistory(){return this.searchHistory.initSearchHistory()}setBackRecentSearchWord(){return this.searchHistory.setBackRecentSearchWord()}setRecentSearchWord(){return this.searchHistory.setRecentSearchWord()}clean(){this.searchResults.clear(),this.resultTotal={resultNum:0,fileNum:0},this.searchState=E.SEARCH_STATE.todo,this.searchValue="",this.replaceValue="",this.excludeValue="",this.includeValue="",this.searchError=""}cleanIsEnable(){return!!(this.searchValue||this.replaceValue||this.excludeValue||this.includeValue||this.searchError||this.searchResults&&this.searchResults.size>0)}foldIsEnable(){return!!(this.searchResults&&this.searchResults.size>0)}getPreferenceSearchExcludes(){const T=[],D=this.corePreferences["files.exclude"],I=this.searchPreferences["search.exclude"],O=Object.assign({},D,I);for(const M of Object.keys(O))O[M]&&T.push(M);return T}openPreference(){this.commandService.executeCommand(p.COMMON_COMMANDS.OPEN_PREFERENCES.id,"files.watcherExclude")}get searchHistory(){return this._searchHistory||(this._searchHistory=new a.SearchHistory(this,this.recentStorage)),this._searchHistory}get validateMessage(){if(this.resultTotal.resultNum>=E.DEFAULT_SEARCH_IN_WORKSPACE_LIMIT)return{message:(0,_.localize)("search.too.many.results"),type:c.VALIDATE_TYPE.WARNING}}async recoverUIState(){const T=await this.browserStorageService.getData("search.UIState");this.updateUIState(T||{})}getExcludeWithSetting(T,D){let I=[];return T.exclude&&(I=I.concat(T.exclude)),D.isIncludeIgnored||(I=I.concat(this.getPreferenceSearchExcludes())),I}setDefaultIncludeValue(){const T=this.searchPreferences["search.include"]||{};this.includeValue=Object.keys(T).reduce((D,I)=>(T[I]&&D.push(I),D),[]).join(","),this.includeValue&&this.updateUIState({isDetailOpen:!0})}mergeSameUriResult(T,D,I,O){const M=O||{fileNum:0,resultNum:0};return T.forEach(R=>{const P=D.get(R.fileUri);I.indexOf(R.fileUri)>-1||(P?(P.push(R),D.set(R.fileUri,P),M.resultNum++):(D.set(R.fileUri,[R]),M.fileNum++,M.resultNum++))}),{searchResultMap:D,total:M}}searchFromDocModel(T,D,I,O,M){let R=[];const P=D.uri.toString(),k=[],F=[];if(!O.some(j=>P.startsWith(j)))return{result:k,searchedList:F};if(T.include&&T.include.length>0){T.include.forEach(W=>{R.push((0,p.parseGlob)((0,E.anchorGlob)(W)))});const j=R.some(W=>W(P));if(R=[],!j)return{result:k,searchedList:F}}if(T.exclude&&T.exclude.length>0){T.exclude.forEach(W=>{R.push((0,p.parseGlob)((0,E.anchorGlob)(W)))});const j=R.some(W=>W(P));if(R=[],j)return{result:k,searchedList:F}}const L=D.getMonacoModel();return F.push(D.uri.toString()),L.findMatches(I,!0,!!T.useRegExp,!!T.matchCase,T.matchWholeWord?`\`~!@#$%^&*()-=+[{]}\\|;:'",.<>/?
31944
- `:null,!1).forEach((j,W)=>{W===0&&M&&this.setEditorSelections(M,j.range),k.push((0,E.cutShortSearchResult)({fileUri:D.uri.toString(),line:j.range.startLineNumber,matchStart:j.range.startColumn,matchLength:j.range.endColumn-j.range.startColumn,lineText:L.getLineContent(j.range.startLineNumber)}))}),{result:k,searchedList:F}}async searchAllFromDocModel(T){const D=T.searchValue,I=T.searchOptions,O=T.documentModelManager,M=T.rootDirs;let R=[],P=[];const k=O.getAllModels(),F=this.workbenchEditorService.currentEditorGroup,L=new E.FilterFileWithGlobRelativePath(M,I.include||[]);return await Promise.all(k.map(async B=>{const j=B.uri.toString();if(B.uri.scheme!==p.Schemes.file)return;const W=await this.resourceService.getResource(B.uri);if(!W||W.deleted||!L.test(j))return;const U=this.searchFromDocModel(I,B,D,M,F.codeEditor);R=R.concat(U.result),P=P.concat(U.searchedList)})),{result:R,searchedList:P}}fireTitleChange(){this.onDidTitleChangeEmitter.fire()}refresh(){this.search()}dispose(){var T;super.dispose(),(T=this.eventBusDisposer)===null||T===void 0||T.dispose(),this.blur()}};t.ContentSearchClientService=S,n.__decorate([(0,o.Autowired)(_.IEventBus),n.__metadata("design:type",Object)],S.prototype,"eventBus",void 0),n.__decorate([(0,o.Autowired)(b.SearchPreferences),n.__metadata("design:type",Object)],S.prototype,"searchPreferences",void 0),n.__decorate([(0,o.Autowired)(v.CorePreferences),n.__metadata("design:type",Object)],S.prototype,"corePreferences",void 0),n.__decorate([(0,o.Autowired)(E.ContentSearchServerPath),n.__metadata("design:type",Object)],S.prototype,"contentSearchServer",void 0),n.__decorate([(0,o.Autowired)(u.IWorkspaceService),n.__metadata("design:type",Object)],S.prototype,"workspaceService",void 0),n.__decorate([(0,o.Autowired)(p.RecentStorage),n.__metadata("design:type",p.RecentStorage)],S.prototype,"recentStorage",void 0),n.__decorate([(0,o.Autowired)(g.IEditorDocumentModelService),n.__metadata("design:type",Object)],S.prototype,"documentModelManager",void 0),n.__decorate([(0,o.Autowired)(p.CommandService),n.__metadata("design:type",Object)],S.prototype,"commandService",void 0),n.__decorate([(0,o.Autowired)(m.GlobalBrowserStorageService),n.__metadata("design:type",m.GlobalBrowserStorageService)],S.prototype,"browserStorageService",void 0),n.__decorate([(0,o.Autowired)(h.IDialogService),n.__metadata("design:type",Object)],S.prototype,"dialogService",void 0),n.__decorate([(0,o.Autowired)(h.IMessageService),n.__metadata("design:type",Object)],S.prototype,"messageService",void 0),n.__decorate([(0,o.Autowired)(d.IWorkspaceEditService),n.__metadata("design:type",Object)],S.prototype,"workspaceEditService",void 0),n.__decorate([(0,o.Autowired)(_.IReporterService),n.__metadata("design:type",Object)],S.prototype,"reporterService",void 0),n.__decorate([(0,o.Autowired)(p.PreferenceService),n.__metadata("design:type",Object)],S.prototype,"preferenceService",void 0),n.__decorate([(0,o.Autowired)(s.WorkbenchEditorService),n.__metadata("design:type",s.WorkbenchEditorService)],S.prototype,"workbenchEditorService",void 0),n.__decorate([(0,o.Autowired)(),n.__metadata("design:type",g.ResourceService)],S.prototype,"resourceService",void 0),t.ContentSearchClientService=S=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],S)},14851:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Search=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(41869),p=e(68974),v=e(52925),m=e(79904),_=n.__importDefault(e(66653)),s=e(67640),g=e(12781),l=e(68267);t.Search=(0,o.memo)(({viewState:h})=>{const u=(0,o.useRef)(null),d=(0,o.useRef)(null),E=(0,c.useInjectable)(v.ISearchTreeService),f=(0,c.useInjectable)(v.IContentSearchClientService),[a,b]=(0,o.useState)(0),[y,A]=(0,o.useState)({results:new Map,total:{resultNum:0,fileNum:0},isSearching:!1,state:v.SEARCH_STATE.done,searchError:"",isShowValidateMessage:!1}),[S,w]=(0,o.useState)(""),[T,D]=(0,o.useState)(""),{replaceAll:I,updateUIState:O,UIState:M}=f,[R,P]=(0,o.useState)(M.isDetailOpen),k=(0,o.useRef)(),F=(0,o.useRef)(new c.DisposableCollection),L=(0,o.useCallback)(()=>{P(f.UIState.isDetailOpen)},[R,f]),B=(0,o.useCallback)(()=>{O({isDetailOpen:!f.UIState.isDetailOpen})},[f]),j=(0,o.useCallback)(()=>{E.contextKey.searchInputBoxFocusedKey.set(!0)},[E]),W=(0,o.useCallback)(()=>{E.contextKey.searchInputBoxFocusedKey.set(!1)},[f]),U=(0,o.useCallback)(()=>{O({isMatchCase:!f.UIState.isMatchCase})},[f]),Q=(0,o.useCallback)(()=>{O({isUseRegexp:!f.UIState.isUseRegexp})},[f]),V=(0,o.useCallback)(()=>{O({isWholeWord:!f.UIState.isWholeWord})},[f]),$=(0,o.useCallback)(()=>{O({isOnlyOpenEditors:!f.UIState.isOnlyOpenEditors})},[f]),Y=(0,o.useCallback)(()=>{O({isIncludeIgnored:!f.UIState.isIncludeIgnored})},[f]);(0,o.useEffect)(()=>{b(u.current&&u.current.clientHeight||0)},[a,u.current,y,f,M.isDetailOpen]);const z={width:h.width||"100%",height:h.height},H=(0,o.useMemo)(()=>o.default.createElement("div",{className:_.default["loading-wrap"]},o.default.createElement(p.Progress,{loading:y.isSearching})),[y]),K=(0,o.useCallback)(te=>{te&&te.key!==c.Key.ENTER.code||(A({...y,results:new Map}),f.search())},[f,y]),Z=(0,o.useCallback)(te=>{f.onSearchInputChange(te.currentTarget.value||""),D(te.currentTarget.value)},[f]),X=(0,o.useCallback)(te=>{f.onSearchIncludeChange(te.currentTarget.value||"")},[f]),ie=(0,o.useCallback)(()=>{f.openPreference()},[f]),oe=(0,o.useCallback)(te=>{f.onSearchExcludeChange(te.currentTarget.value||"")},[f]),le=(0,o.useCallback)(te=>{f.onReplaceInputChange(te.currentTarget.value||""),w(te.currentTarget.value)},[S,f]),pe=(0,o.useCallback)(()=>{A({results:f.searchResults,total:f.resultTotal,isSearching:f.isSearching,state:f.searchState,searchError:f.searchError,isShowValidateMessage:f.isShowValidateMessage,validateMessage:f.validateMessage})},[y,f]),q=(0,o.useCallback)(te=>{var ge,Te;D(te),(ge=k.current)===null||ge===void 0||ge.focus(),(Te=k.current)===null||Te===void 0||Te.select()},[k.current,T]);(0,o.useEffect)(()=>(F.current.push(f.onDidChange(pe)),F.current.push(f.onDidTitleChange(pe)),F.current.push(f.onDidUIStateChange(L)),F.current.push(f.onDidSearchStateChange(q)),()=>{F.current.dispose()}),[]),(0,o.useEffect)(()=>{d.current&&E.initContextKey(d.current)},[]);const Ee=(0,o.useCallback)(()=>y.results.size>0?o.default.createElement(l.SearchTree,{offsetTop:a,viewState:h,state:y.state,total:y.total,search:T,replace:S,isUseRegexp:f.UIState.isUseRegexp,isMatchCase:f.UIState.isMatchCase}):y.state===v.SEARCH_STATE.done?o.default.createElement("div",{className:_.default.result_describe},T&&(0,c.localize)("search.noResultsFound")):null,[y,f,a,T,S]),_e=(0,o.useCallback)(()=>y.searchError||y.state===v.SEARCH_STATE.error?o.default.createElement("div",{className:_.default.result_error},y.searchError):Ee(),[y,f,a,T,S]);return o.default.createElement("div",{className:_.default.search_container,style:z,ref:d},H,o.default.createElement("div",{className:_.default.search_options,ref:u},o.default.createElement(m.SearchInputWidget,{isDetailOpen:M.isDetailOpen,onDetailToggle:B,isMatchCase:M.isMatchCase,onMatchCaseToggle:U,isRegex:M.isUseRegexp,onRegexToggle:Q,isWholeWord:M.isWholeWord,onWholeWordToggle:V,isShowValidateMessage:y.isShowValidateMessage,validateMessage:y.validateMessage,onSearchFocus:j,onSearchBlur:W,ref:te=>te&&(k.current=te),searchValue:f.searchValue,onSearchInputChange:Z,onSearch:K}),o.default.createElement(s.SearchReplaceWidget,{replaceValue:f.replaceValue,onSearch:K,onReplaceRuleChange:le,replaceAll:I,disabled:y.total.fileNum<=0}),o.default.createElement("div",{className:(0,r.default)(_.default.search_details)},R&&o.default.createElement(g.SearchRulesWidget,{includeValue:f.includeValue,excludeValue:f.excludeValue,onSearch:K,onChangeInclude:X,onChangeExclude:oe,isOnlyOpenEditors:M.isOnlyOpenEditors,isIncludeIgnored:M.isIncludeIgnored,onOnlyOpenEditorsToggle:$,onIncludeIgnoredToggle:Y,onOpenPreference:ie}))),_e())})},78182:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SEARCH_TREE_NODE_HEIGHT=t.SearchNodeRendered=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(97267),p=e(41869),v=e(86109),m=n.__importDefault(e(2037)),_=({item:s,search:g,replace:l,defaultLeftPadding:h=8,leftPadding:u=8,decorations:d,onClick:E,onDoubleClick:f,onContextMenu:a,commandService:b,isUseRegexp:y,isMatchCase:A})=>{const S=(0,p.useDesignStyles)(m.default.expansion_toggle,"expansion_toggle"),w=(0,o.useCallback)(U=>{E(U,s)},[E]),T=(0,o.useCallback)(U=>{f(U,s)},[f]),D=(0,o.useCallback)(U=>{U.stopPropagation(),U.preventDefault(),a(U,s)},[a]),I=`${h+(s.depth||0)*(u||0)+(v.SearchFileNode.is(s)?0:8)}px`,O={height:t.SEARCH_TREE_NODE_HEIGHT,lineHeight:`${t.SEARCH_TREE_NODE_HEIGHT}px`,paddingLeft:I},M=(0,o.useCallback)(U=>v.SearchFileNode.is(U)?o.default.createElement("div",{className:(0,r.default)(m.default.icon,v.SearchFileNode.is(U)?U.icon:""),style:{height:t.SEARCH_TREE_NODE_HEIGHT,lineHeight:`${t.SEARCH_TREE_NODE_HEIGHT}px`}}):null,[]),R=(0,o.useCallback)(U=>o.default.createElement("div",{className:(0,r.default)(m.default.segment,m.default.displayname)},U.displayName),[]),P=(0,o.useCallback)(U=>{if(v.SearchFileNode.is(U))return o.default.createElement("div",{className:(0,r.default)(m.default.segment_grow,m.default.description)},U.description);{const{start:Q,end:V}=U.highlight;if(y){let $;try{$=new RegExp(g,A?"":"i")}catch{$=null}const Y=U.description.match($);if(!$||!Y)return o.default.createElement("div",{className:(0,r.default)(m.default.segment_grow,m.default.description)},U.description);const z=Y[0];if(z&&(0,p.isDefined)(Q)){const H=z.replace($,l);return o.default.createElement("div",{className:(0,r.default)(m.default.segment_grow,m.default.description)},U.description.slice(0,Q),o.default.createElement("span",{className:(0,r.default)(m.default.match,l&&m.default.replace)},z),H&&o.default.createElement("span",{className:m.default.replace},H),U.description.slice(V))}}else{let $=-1;return A?$=U.description.indexOf(g):$=U.description.toLocaleLowerCase().indexOf(g.toLocaleLowerCase()),$>=0?o.default.createElement("div",{className:(0,r.default)(m.default.segment_grow,m.default.description)},U.description.slice(0,Q),o.default.createElement("span",{className:(0,r.default)(m.default.match,l&&m.default.replace)},U.description.slice(Q,V)),l&&o.default.createElement("span",{className:m.default.replace},l),U.description.slice(V)):o.default.createElement("div",{className:(0,r.default)(m.default.segment_grow,m.default.description)},U.description)}}},[l,g,y,A]),k=(0,o.useCallback)(U=>o.default.createElement("div",{className:(0,r.default)(m.default.segment,m.default.tail)},F(U)),[]),F=(0,o.useCallback)(U=>{if(v.SearchFileNode.is(U))return o.default.createElement(c.Badge,{className:m.default.status},U.badge)},[]),L=(0,o.useCallback)(U=>o.default.createElement("div",{className:(0,r.default)(m.default.segment,S,(0,p.getIcon)("arrow-right"),{[`${m.default.mod_collapsed}`]:!U.expanded})}),[]),B=(0,o.useCallback)(U=>{if(v.SearchFileNode.is(U))return L(U)},[]),j=(0,o.useCallback)(()=>s.tooltip,[s]),W=(0,o.useCallback)(U=>{let Q;return v.SearchFileNode.is(s)?Q=[{icon:(0,p.getExternalIcon)("replace-all"),title:(0,p.localize)("search.replace.title"),command:p.SEARCH_COMMANDS.MENU_REPLACE_ALL.id},{icon:(0,p.getIcon)("eye-close"),title:(0,p.localize)("search.result.hide"),command:p.SEARCH_COMMANDS.MENU_HIDE.id}]:Q=[{icon:(0,p.getExternalIcon)("replace-all"),title:(0,p.localize)("search.replace.title"),command:p.SEARCH_COMMANDS.MENU_REPLACE.id},{icon:(0,p.getIcon)("eye-close"),title:(0,p.localize)("search.result.hide"),command:p.SEARCH_COMMANDS.MENU_HIDE.id}],o.default.createElement("div",{className:m.default.action_bar,style:{height:t.SEARCH_TREE_NODE_HEIGHT,lineHeight:`${t.SEARCH_TREE_NODE_HEIGHT}px`}},Q.map(V=>{const $=Y=>{Y.stopPropagation(),Y.preventDefault(),b.executeCommand(V.command,U)};return o.default.createElement(c.Button,{type:"icon",key:`${U.id}-${V.command}`,iconClass:(0,r.default)(m.default.action_icon,V.icon),title:V.title,onClick:$})}))},[]);return o.default.createElement("div",{key:s.id,onClick:w,onDoubleClick:T,onContextMenu:D,title:j(),className:(0,r.default)(m.default.search_node,d?d.classlist:null),style:O,"data-id":s.id},o.default.createElement("div",{className:m.default.content},B(s),M(s),o.default.createElement("div",{className:m.default.overflow_wrap},R(s),P(s)),W(s),k(s)))};t.SearchNodeRendered=_,t.SEARCH_TREE_NODE_HEIGHT=22},5439:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SearchTreeService=t.ReplaceDocumentModelContentProvider=t.RangeHighlightDecorations=void 0;const r=e(85608),o=e(76003),c=e(41869),p=e(43718),v=e(57517),m=e(42933),_=r.__importStar(e(20868)),s=e(51500),g=e(26199),l=e(92553),h=e(3956),u=e(50845),d=e(86109);let E=n=class{constructor(){this.preDeltaDecoration=null,this._model=null,this._modelRef=null,this._modelDisposables=new p.DisposableStore}removeHighlightRange(){this._model&&this.preDeltaDecoration&&this._model.deltaDecorations(this.preDeltaDecoration,[]),this.preDeltaDecoration=null}highlightRange(y,A){let S=null;if(p.URI.isUri(y)){const w=this.documentModelManager.getModelReference(y,"highlight-range");w&&(S=w.instance.getMonacoModel(),this._modelRef=w)}else S=y;S&&this.doHighlightRange(S,A)}doHighlightRange(y,A){this.removeHighlightRange(),this.preDeltaDecoration=y.deltaDecorations([],this.createEditorDecorations(A)),this.setModel(y)}createEditorDecorations(y){return[{range:y,options:n.RANGE_HIGHLIGHT_DECORATION}]}setModel(y){this._modelRef&&(this._modelRef.dispose(),this._modelRef=null),this._model!==y&&(this.clearModelListeners(),this._model=y,this._modelDisposables.add(this._model.onWillDispose(()=>{this.clearModelListeners(),this.removeHighlightRange(),this._model=null})))}clearModelListeners(){this._modelDisposables.clear()}dispose(){this._model&&(this.removeHighlightRange(),this._modelDisposables.dispose(),this._model=null)}};t.RangeHighlightDecorations=E,E.RANGE_HIGHLIGHT_DECORATION={className:"rangeHighlight",stickiness:_.editor.TrackedRangeStickiness.GrowsOnlyWhenTypingBefore,isWholeLine:!0},r.__decorate([(0,o.Autowired)(v.IEditorDocumentModelService),r.__metadata("design:type",Object)],E.prototype,"documentModelManager",void 0),t.RangeHighlightDecorations=E=n=r.__decorate([(0,o.Injectable)()],E);let f=class{constructor(){this.contentMap=new Map,this.onDidChangeContentEvent=new p.Emitter,this.onDidChangeContent=this.onDidChangeContentEvent.event}handlesScheme(y){return y===p.Schemes.internal}provideEditorDocumentModelContent(y){return this.contentMap.get(y.toString())||""}isReadonly(){return!0}async updateContent(y){const A=y.withScheme(JSON.parse(y.query).scheme).withoutQuery().withoutFragment();let S=this.searchBrowserService.searchResults.get(A.toString());if(!S)return"";const w=this.documentModelManager.getModelReference(A)||await this.documentModelManager.createModelReference(A),D=w.instance.getText(),I=this.documentModelManager.getModelReference(y)||await this.documentModelManager.createModelReference(y),O=I.instance;O.updateContent(D),S=S.map(M=>Object.assign({},M,{fileUri:y.toString()})),await(0,h.replace)(this.documentModelManager,this.workspaceEditService,S,this.searchBrowserService.replaceValue,this.searchBrowserService.searchValue,this.searchBrowserService.UIState.isUseRegexp),this.contentMap.set(y.toString(),O.getText()),I.dispose(),w.dispose()}delete(y){this.contentMap.delete(y.toString())}clear(){this.contentMap.clear()}};t.ReplaceDocumentModelContentProvider=f,r.__decorate([(0,o.Autowired)(v.IEditorDocumentModelService),r.__metadata("design:type",Object)],f.prototype,"documentModelManager",void 0),r.__decorate([(0,o.Autowired)(l.IContentSearchClientService),r.__metadata("design:type",Object)],f.prototype,"searchBrowserService",void 0),r.__decorate([(0,o.Autowired)(g.IWorkspaceEditService),r.__metadata("design:type",Object)],f.prototype,"workspaceEditService",void 0),t.ReplaceDocumentModelContentProvider=f=r.__decorate([(0,o.Injectable)()],f);let a=class extends p.Disposable{get viewReady(){return this.viewReadyDeferered.promise}constructor(){super(),this.viewReadyDeferered=new p.Deferred,this.addDispose(this.rangeHighlightDecorations),this.addDispose(this.contentRegistry.registerEditorDocumentModelContentProvider(this.replaceDocumentModelContentProvider))}get replaceValue(){return this.searchBrowserService.replaceValue}get resultTotal(){return this.searchBrowserService.resultTotal}get contextKey(){return this.searchContextKey}initContextKey(y){this.contextKey.initScopedContext(y),this.viewReadyDeferered.resolve()}removeHighlightRange(){this.rangeHighlightDecorations.removeHighlightRange()}async resolveChildren(y){var A;if(y){if(y)if(d.SearchRoot.isRoot(y)){const S=this.searchBrowserService.searchResults;if(!S)return[];const w=[];for(const T of S){const D=T[0],I=T[1],O=new p.URI(D),M=(A=await this.workspaceService.asRelativePath(O.parent))===null||A===void 0?void 0:A.path;!I||I.length<1||w.push(new d.SearchFileNode(this,I,M,await this.getReadableTooltip(O),this.labelService.getIcon(O),O,y))}return w}else return y.contentResults.map(w=>{const T=(w.renderStart||w.matchStart)-1,D=T+w.matchLength,I=w.renderLineText||w.lineText;return new d.SearchContentNode(this,w,I,{start:T,end:D},y.resource,y)})}else return[new d.SearchRoot(this)];return[]}async getCurrentUserHome(){if(!this.userhomePath)try{const y=await this.fileServiceClient.getCurrentUserHome();y&&(this.userhomePath=new p.URI(y.uri))}catch{}return this.userhomePath}async getReadableTooltip(y){const A=y.toString(),S=await this.getCurrentUserHome();if(!S)return decodeURIComponent(y.withScheme("").toString());if(S.isEqualOrParent(y)){const w=S&&S.toString();return decodeURIComponent(A.replace(w,"~"))}return decodeURIComponent(y.withScheme("").toString())}};t.SearchTreeService=a,r.__decorate([(0,o.Autowired)(l.IContentSearchClientService),r.__metadata("design:type",Object)],a.prototype,"searchBrowserService",void 0),r.__decorate([(0,o.Autowired)(s.IWorkspaceService),r.__metadata("design:type",Object)],a.prototype,"workspaceService",void 0),r.__decorate([(0,o.Autowired)(v.IEditorDocumentModelContentRegistry),r.__metadata("design:type",Object)],a.prototype,"contentRegistry",void 0),r.__decorate([(0,o.Autowired)(f),r.__metadata("design:type",f)],a.prototype,"replaceDocumentModelContentProvider",void 0),r.__decorate([(0,o.Autowired)(E),r.__metadata("design:type",E)],a.prototype,"rangeHighlightDecorations",void 0),r.__decorate([(0,o.Autowired)(m.IFileServiceClient),r.__metadata("design:type",Object)],a.prototype,"fileServiceClient",void 0),r.__decorate([(0,o.Autowired)(u.SearchContextKey),r.__metadata("design:type",u.SearchContextKey)],a.prototype,"searchContextKey",void 0),r.__decorate([(0,o.Autowired)(c.LabelService),r.__metadata("design:type",c.LabelService)],a.prototype,"labelService",void 0),r.__decorate([p.memoize,r.__metadata("design:type",Function),r.__metadata("design:paramtypes",[]),r.__metadata("design:returntype",Promise)],a.prototype,"getCurrentUserHome",null),t.SearchTreeService=a=r.__decorate([(0,o.Injectable)(),r.__metadata("design:paramtypes",[])],a)},68267:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchTree=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(97267),p=e(41869),v=e(92553),m=n.__importDefault(e(66653)),_=e(78182),s=e(13072),g=({total:h,state:u,model:d})=>{const[E,f]=(0,o.useState)(!1),a=(0,p.useInjectable)(s.SearchModelService),b=(0,o.useCallback)(()=>{a.clearSearchResults()},[a]),y=(0,o.useCallback)(()=>{const S=!E;f(S),S?a.collapsedAll():a.expandAll()},[E,a]),A=(0,o.useCallback)(()=>{a.refresh()},[a]);return(0,o.useEffect)(()=>{if(!d)return;const S=d.root.watcher.on(c.TreeNodeEvent.DidChangeExpansionState,()=>{E&&f(!E)});return()=>{S.dispose()}},[d,E]),h.resultNum>0?o.default.createElement("p",{className:m.default.result_describe},o.default.createElement("span",{className:m.default.text},(0,p.formatLocalize)("search.files.result",String(h.resultNum),String(h.fileNum))),o.default.createElement(c.Button,{className:(0,r.default)(m.default.result_fold,{[m.default.disabled]:u===v.SEARCH_STATE.doing}),onClick:b,type:"icon",icon:"clear",title:(0,p.localize)("search.ClearSearchResultsAction.label")}),o.default.createElement(c.Button,{className:(0,r.default)(m.default.result_fresh,{[m.default.disabled]:u===v.SEARCH_STATE.doing}),onClick:A,type:"icon",icon:"refresh",title:(0,p.localize)("search.RefreshAction.label")}),o.default.createElement(c.Button,{className:(0,r.default)(m.default.result_fold,{[m.default.disabled]:u===v.SEARCH_STATE.doing}),onClick:y,type:"icon",icon:E?"expand-all":"collapse-all",title:(0,p.localize)(E?"search.ExpandDeepestExpandedLevelAction.label":"search.CollapseDeepestExpandedLevelAction.label")})):null},l=({offsetTop:h,total:u,state:d,replace:E,search:f,viewState:a,isUseRegexp:b,isMatchCase:y})=>{const[A,S]=(0,o.useState)(),w=(0,p.useInjectable)(s.SearchModelService),T=(0,p.useInjectable)(p.CommandService),D=(0,o.useRef)(null),I=(0,o.useRef)(null),[O,M]=(0,o.useState)(0),{handleTreeBlur:R,handleTreeFocus:P}=w;(0,o.useEffect)(()=>{S(w.treeModel);const B=w.onDidUpdateTreeModel(j=>{S(j)});return()=>{B.dispose()}},[]),(0,o.useEffect)(()=>{I.current&&M(I.current.clientHeight)},[I.current]);const k=(0,o.useCallback)(B=>{w.handleTreeHandler(B)},[w]),F=(0,o.useCallback)(B=>o.default.createElement(_.SearchNodeRendered,{item:B.item,itemType:B.itemType,decorations:w.decorations.getDecorations(B.item),defaultLeftPadding:8,search:f,replace:E,onClick:w.handleItemClick,onDoubleClick:w.handleItemDoubleClick,onContextMenu:w.handleContextMenu,leftPadding:8,isUseRegexp:b,isMatchCase:y,commandService:T}),[A,f,E,b,y]),L=(0,o.useCallback)(()=>{if(A)return o.default.createElement(c.RecycleTree,{height:a.height-h-O,itemHeight:_.SEARCH_TREE_NODE_HEIGHT,onReady:k,model:A},F)},[A,O,h,f,E,b,y,a]);return o.default.createElement("div",{className:m.default.tree,tabIndex:-1,onBlur:R,onFocus:P,ref:D},o.default.createElement("div",{ref:I},o.default.createElement(g,{total:u,state:d,model:A})),L())};t.SearchTree=l},13072:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchModelService=t.SearchTreeModel=void 0;const n=e(85608),r=e(76003),o=e(97267),c=e(41869),p=e(93899),v=e(54414),m=n.__importStar(e(20868)),_=e(92553),s=e(33301),g=e(5439),l=e(86109),h=n.__importDefault(e(2037));let u=class extends o.TreeModel{constructor(f){super(),this.init(f)}};t.SearchTreeModel=u,t.SearchTreeModel=u=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[l.SearchRoot])],u);let d=class extends c.Disposable{constructor(){super(),this.selectedDecoration=new o.Decoration(h.default.mod_selected),this.focusedDecoration=new o.Decoration(h.default.mod_focused),this.contextMenuDecoration=new o.Decoration(h.default.mod_actived),this._selectedNodes=[],this.onDidUpdateTreeModelEmitter=new c.Emitter,this.disposableCollection=new c.DisposableCollection,this.treeIsDirty=!1,this.applyFocusedDecoration=(f,a=!0)=>{var b;if(this.contextMenuNode&&(this.focusedDecoration.removeTarget(this.contextMenuNode),this.selectedDecoration.removeTarget(this.contextMenuNode),this.contextMenuDecoration.removeTarget(this.contextMenuNode),this._contextMenuNode=null),f){for(const y of this._selectedNodes)this.selectedDecoration.removeTarget(y);this.focusedNode&&this.focusedDecoration.removeTarget(this.focusedNode),this.selectedDecoration.addTarget(f),this.focusedDecoration.addTarget(f),this._focusedNode=f,this._selectedNodes=[f],a&&((b=this.treeModel)===null||b===void 0||b.dispatchChange())}},this.applyContextMenuDecoration=f=>{this.contextMenuNode&&this.contextMenuDecoration.removeTarget(this.contextMenuNode),this.focusedNode&&(this.focusedDecoration.removeTarget(this.focusedNode),this._focusedNode=null),this.contextMenuDecoration.addTarget(f),this._contextMenuNode=f,this.treeModel.dispatchChange()},this.removeFocusedDecoration=()=>{var f;this.focusedNode&&(this.focusedDecoration.removeTarget(this.focusedNode),(f=this.treeModel)===null||f===void 0||f.dispatchChange()),this._focusedNode=null},this.handleTreeBlur=()=>{this.searchTreeService.contextKey.searchViewFocusedKey.set(!1),this.removeFocusedDecoration()},this.handleTreeFocus=()=>{this.searchTreeService.contextKey.searchViewFocusedKey.set(!0)},this.handleContextMenu=(f,a)=>{if(!a){this.removeFocusedDecoration();return}this.applyContextMenuDecoration(a);const b=this.contextMenuService.createMenu({id:p.MenuId.SearchContext,contextKeyService:this.searchTreeService.contextKey.service}),y=b.getMergedMenuNodes();b.dispose();const{x:A,y:S}=f.nativeEvent;this.ctxMenuRenderer.show({anchor:{x:A,y:S},menuNodes:y,args:[a]})},this.handleItemClick=async(f,a,b=!0)=>{if(this.applyFocusedDecoration(a),l.SearchFileNode.is(a))this.toggleDirectory(a);else if(a.contentResult){const y=a.contentResult;if(this.searchPreferences["search.useReplacePreview"]&&this.searchTreeService.replaceValue){const S=new c.URI(y.fileUri),w=this.toReplaceResource(S);await this.replaceDocumentModelContentProvider.updateContent(w);const T=await this.workbenchEditorService.open(c.URI.from({scheme:"diff",query:c.URI.stringifyQuery({name:(0,c.formatLocalize)("search.fileReplaceChanges",S.displayName,w.displayName),original:S,modified:w})}),{preview:b,supportsRevive:!1});if(T){const I=T.group.currentEditor;I&&I.monacoEditor.revealLineInCenter(y.line)}this.replaceDocumentModelContentProvider.delete(w)}else{const S=new c.URI(y.fileUri),w=await this.workbenchEditorService.open(new c.URI(y.fileUri),{preview:b,focus:!b,range:{startLineNumber:y.line,startColumn:y.matchStart,endLineNumber:y.line,endColumn:y.matchStart+y.matchLength}});w&&!w.resource.deleted&&this.rangeHighlightDecorations.highlightRange(S,new m.Range(y.line,y.matchStart,y.line,y.matchStart+y.matchLength))}}},this.handleItemDoubleClick=(f,a)=>{l.SearchFileNode.is(a)||this.handleItemClick(f,a,!1)},this.toggleDirectory=f=>{f.expanded?this.searchTreeHandle.collapseNode(f):this.searchTreeHandle.expandNode(f)},this._whenReady=this.initTreeModel(),this.addDispose(this.rangeHighlightDecorations)}get onDidUpdateTreeModel(){return this.onDidUpdateTreeModelEmitter.event}get whenReady(){return this._whenReady}get searchTreeHandle(){return this._searchTreeHandle}get decorations(){return this._decorations}get treeModel(){return this._treeModel}get focusedNode(){return this._focusedNode}get selectedNodes(){return this._selectedNodes}get contextMenuNode(){return this._contextMenuNode}async initTreeModel(){const f=await this.searchTreeService.resolveChildren();if(!f)return;const a=f[0];a&&(this._treeModel=this.injector.get(u,[a]),await this._treeModel.ensureReady,this.initDecorations(a),this.disposables.push(this.searchService.onDidChange(()=>{this.searchService.searchResults.size>0?this.searchTreeService.contextKey.hasSearchResults.set(!0):this.searchTreeService.contextKey.hasSearchResults.set(!1),this.refresh()})),this.onDidUpdateTreeModelEmitter.fire(this._treeModel))}initDecorations(f){return this._decorations=new o.DecorationsManager(f),this._decorations.addDecoration(this.selectedDecoration),this._decorations.addDecoration(this.focusedDecoration),this._decorations.addDecoration(this.contextMenuDecoration),this._decorations}handleTreeHandler(f){this._searchTreeHandle=f}async refresh(){await this.whenReady,await this.searchTreeService.viewReady,(0,c.runWhenIdle)(()=>{this.searchTreeService.contextKey&&this.searchTreeService.contextKey.searchViewVisibleKey.get()?this.treeModel.root.refresh():this.treeIsDirty=!0})}collapsedAll(){return this.treeModel.root.collapsedAll()}expandAll(){return this.treeModel.root.expandedAll()}clearSearchResults(){this.searchService.clean(),this.searchService.search()}toReplaceResource(f){return f.withScheme(c.Schemes.internal).withFragment("replacePreview").withQuery(JSON.stringify({scheme:f.scheme}))}activate(){this.searchTreeService.contextKey&&this.searchTreeService.contextKey.searchViewVisibleKey.set(!0),this.treeIsDirty&&(this.refresh(),this.treeIsDirty=!1)}deactivate(){this.searchTreeService.contextKey&&this.searchTreeService.contextKey.searchViewVisibleKey.set(!1)}dispose(){this.disposableCollection.dispose()}};t.SearchModelService=d,n.__decorate([(0,r.Autowired)(_.ISearchTreeService),n.__metadata("design:type",g.SearchTreeService)],d.prototype,"searchTreeService",void 0),n.__decorate([(0,r.Autowired)(_.IContentSearchClientService),n.__metadata("design:type",Object)],d.prototype,"searchService",void 0),n.__decorate([(0,r.Autowired)(v.WorkbenchEditorService),n.__metadata("design:type",v.WorkbenchEditorService)],d.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(g.ReplaceDocumentModelContentProvider),n.__metadata("design:type",g.ReplaceDocumentModelContentProvider)],d.prototype,"replaceDocumentModelContentProvider",void 0),n.__decorate([(0,r.Autowired)(g.RangeHighlightDecorations),n.__metadata("design:type",g.RangeHighlightDecorations)],d.prototype,"rangeHighlightDecorations",void 0),n.__decorate([(0,r.Autowired)(p.ICtxMenuRenderer),n.__metadata("design:type",p.ICtxMenuRenderer)],d.prototype,"ctxMenuRenderer",void 0),n.__decorate([(0,r.Autowired)(p.AbstractContextMenuService),n.__metadata("design:type",p.AbstractContextMenuService)],d.prototype,"contextMenuService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],d.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(s.SearchPreferences),n.__metadata("design:type",Object)],d.prototype,"searchPreferences",void 0),t.SearchModelService=d=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],d)},86109:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchContentNode=t.SearchFileNode=t.SearchRoot=void 0;const n=e(97267);class r extends n.CompositeTreeNode{static is(v){return!!v&&!v.parent}constructor(v){super(v,void 0)}get expanded(){return!0}}t.SearchRoot=r;class o extends n.CompositeTreeNode{constructor(v,m,_="",s,g,l,h){super(v,h),this.contentResults=m,this.description=_,this.tooltip=s,this.icon=g,this.resource=l,this.isExpanded=!0}get displayName(){return this.resource.displayName}get badge(){return this.branchSize}get highlight(){return{}}}t.SearchFileNode=o;class c extends n.TreeNode{constructor(v,m,_="",s,g,l){super(v,l),this.contentResult=m,this.description=_,this.highlight=s,this.resource=g}get displayName(){return""}get tooltip(){if(this.description&&this.highlight){const{start:v,end:m}=this.highlight;return`${this.description.slice(0,v)}${this._tree.replaceValue||this.description.slice(v,m)}${this.description.slice(m)}`.slice(0,999)}return""}}t.SearchContentNode=c},92553:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FilterFileWithGlobRelativePath=t.SEARCH_STATE=t.ISearchTreeService=t.IContentSearchClientService=t.DEFAULT_SEARCH_IN_WORKSPACE_LIMIT=t.IContentSearchServer=t.ContentSearchServerPath=void 0,t.anchorGlob=o,t.getRoot=c,t.cutShortSearchResult=p;const n=e(43718);t.ContentSearchServerPath="ContentSearchServerPath",t.IContentSearchServer=Symbol("ContentSearchService"),t.DEFAULT_SEARCH_IN_WORKSPACE_LIMIT=2e3,t.IContentSearchClientService=Symbol("IContentSearchClientService"),t.ISearchTreeService=Symbol("ISearchTreeService");var r;(function(m){m[m.todo=0]="todo",m[m.doing=1]="doing",m[m.done=2]="done",m[m.error=3]="error"})(r||(t.SEARCH_STATE=r={}));function o(m,_){const s=_===!1?"":"**/";return n.strings.startsWith(m,"./")&&(m=m.replace(/^.\//,"")),n.strings.endsWith(m,"/")?`${s}${m}**`:!/[*{(+@!^|?]/.test(m)&&!/\.[A-Za-z0-9]+$/.test(m)?`${s}${m}/**`:n.strings.startsWith(m,s)?m:`${s}${m}`}function c(m,_){let s="";return!m||!_||m.some(g=>{if(_.indexOf(g)===0)return s=g,!0}),s}function p(m){const _=Object.assign({},m),{lineText:s,matchLength:g,matchStart:l}=_,h=500,u=h;if(!s)return _;if(s.length>h){const E=l-20>-1?l-20:0;return _.renderLineText=s.slice(E,E+500),delete _.lineText,_.renderStart=l-E,_.matchLength=g>u?u:g,_}else{const E=l-40>-1?l-40:0;return _.renderLineText=s.slice(E,s.length),delete _.lineText,_.renderStart=l-E,_}}class v{constructor(_,s){this.matcherList=[],!(_.length<1||s.length<1)&&_.forEach(g=>{const l=new n.URI(g);s.forEach(h=>{if(n.strings.startsWith(h,"./")){const u=(0,n.parseGlob)(o(h));h=h.slice(2,h.length);const d=l.resolve(o(h,!1)).path.toString();this.matcherList.push({relative:u,absolute:(0,n.parseGlob)(d)})}})})}test(_){let s=!0;if(this.matcherList.length<1)return s;const g=new n.URI(_).path.toString();return this.matcherList.some(l=>{if(l.relative(g))s=!1;else return;return s=l.absolute(g),s}),s}}t.FilterFileWithGlobRelativePath=v},52925:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(92553),t)},13439:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(52925),t)},97462:(x,t,e)=>{"use strict";var n;n={value:!0},n=t.$h=void 0;const r=e(73827),o=e(32004),c=e(54230),p=e(41869),v=e(33969),m=e(4958),_=e(17242),s=e(57517),g=e(59027),l=e(40731),h=e(38105),u=e(53599),d=e(52568),E=e(96708),f=e(83709),a=e(21774),b=e(83507),y=e(7480),A=e(93374),S=e(99669),w=e(64523),T=e(62663),D=e(72106),I=e(31379),O=e(46608),M=e(89549),R=e(96194),P=e(58408),k=e(96534),F=e(31435),L=e(6556),B=e(16158),j=e(28639),W=e(95737),U=e(17236),Q=e(26874),V=e(7443),$=e(47289),Y=e(40968),z=e(65046),H=e(41103),K=e(7284);t.$h=[y.MainLayoutModule,R.OverlayModule,b.LogModule,p.ClientCommonModule,w.MenuBarModule,T.MonacoModule,B.StatusBarModule,s.EditorModule,g.ExplorerModule,f.FileTreeNextModule,E.FileServiceClientModule,L.SearchModule,d.FileSchemeModule,M.OutputModule,k.QuickOpenModule,S.MarkersModule,V.ThemeModule,H.WorkspaceModule,u.ExtensionStorageModule,j.StorageModule,I.OpenedEditorModule,O.OutlineModule,P.PreferencesModule,$.ToolbarModule,z.WebviewModule,A.MarkdownModule,K.WorkspaceEditModule,F.SCMModule,m.DecorationModule,v.DebugModule,Y.VariableModule,a.KeymapsModule,U.TerminalNextModule,l.ExtensionModule,h.OpenVsxExtensionManagerModule,D.MonacoEnhanceModule,r.ClientAddonModule,c.CommentsModule,W.TaskModule,Q.TestingModule],n=[_.DesignModule,o.AINativeModule]},16158:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatusBarModule=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(26542),p=e(52172),v=e(60643);let m=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:c.IStatusBarService,useClass:v.StatusBarService},p.StatusBarContribution]}};t.StatusBarModule=m,t.StatusBarModule=m=n.__decorate([(0,r.Injectable)()],m)},92237:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatusBarItem=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(97267),p=e(41869),v=e(48560),m=e(43718),_=e(52416),s=n.__importDefault(e(6373)),g=(0,o.memo)(l=>{const h=(0,v.useInjectable)(m.CommandService),u=(0,v.useInjectable)(_.IIconService),{contents:d}=l,E=(0,o.useCallback)(f=>{f&&h.executeCommand(f.id,...f.arguments||[])},[]);return o.default.createElement("div",null,d.map((f,a)=>o.default.createElement("div",{key:`${f.title}-${a}`,className:s.default.popover_content},o.default.createElement("span",null,f.title&&(0,p.transformLabelWithCodicon)(f.title,{},u.fromString.bind(u)),f.name&&` - ${f.name}`),f.command&&o.default.createElement(c.Button,{type:"link",title:f.command.tooltip,onClick:()=>E(f.command)},f.command.title))))});t.StatusBarItem=(0,o.memo)(l=>{const{entryId:h,text:u,onClick:d,tooltip:E,command:f,ariaLabel:a,iconClass:b,className:y,role:A="button",hoverContents:S,color:w,backgroundColor:T,side:D}=l,I=(0,v.useInjectable)(_.IThemeService),O=(0,v.useInjectable)(p.IOpenerService),M=(0,v.useInjectable)(_.IIconService),R=(0,o.useMemo)(()=>!E&&!S,[E,S]),P=(0,o.useMemo)(()=>{if(S)return o.default.createElement(g,{contents:S});if(E&&E.value){const F=(0,p.toMarkdownHtml)(E.value),L=(0,p.transformLabelWithCodiconHtml)(F,M.fromString.bind(M));return(0,p.toMarkdown)(L,O,void 0,!0)}return(0,m.isString)(E)&&o.default.createElement("div",{className:s.default.popover_tooltip},(0,p.transformLabelWithCodicon)(E,{},M.fromString.bind(M)))},[E]),k=F=>{var L,B;return F?(0,m.isThemeColor)(F)?(B=(L=I.getColor(F))===null||L===void 0?void 0:L.toString())!==null&&B!==void 0?B:"":F:""};return o.default.createElement("div",{id:h,className:(0,r.default)(s.default.element,y,{[s.default.hasCommand]:f||d}),onClick:d,style:{color:k(w),backgroundColor:k(T)},"aria-label":a},o.default.createElement(c.Popover,{id:`${h}-popover`,content:P,trigger:c.PopoverTriggerType.hover,delay:.2,position:D==="left"?c.PopoverPosition.topLeft:D==="right"?c.PopoverPosition.topRight:c.PopoverPosition.top,disable:R},o.default.createElement("div",{className:s.default.popover_item},b&&o.default.createElement("span",{key:-1,className:(0,r.default)(s.default.icon,b)}),u&&(0,p.transformLabelWithCodicon)(u,{},M.fromString.bind(M),(F,L)=>o.default.createElement("span",{key:`${F}-${L}`,style:{height:"22px",lineHeight:"22px"},"aria-label":a,role:A},(0,p.replaceLocalizePlaceholder)(F))))))})},52172:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatusBarContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(68456),p=e(26542),v=e(67899),m=e(29079);let _=class{registerComponent(g){g.register("@opensumi/ide-status-bar",{component:m.StatusBarView,id:"ide-status-bar"},{size:24})}registerCommands(g){g.registerCommand(p.StatusBarCommand.changeBackgroundColor,{execute:l=>this.statusBarService.setBackgroundColor(l)}),g.registerCommand(p.StatusBarCommand.changeColor,{execute:l=>this.statusBarService.setColor(l)}),g.registerCommand(p.StatusBarCommand.addElement,{execute:(l,h)=>this.statusBarService.addElement(l,h)}),g.registerCommand(p.StatusBarCommand.toggleElement,{execute:l=>{this.statusBarService.toggleElement(l)}})}};t.StatusBarContribution=_,n.__decorate([(0,r.Autowired)(v.IStatusBarService),n.__metadata("design:type",Object)],_.prototype,"statusBarService",void 0),t.StatusBarContribution=_=n.__decorate([(0,o.Domain)(c.ComponentContribution,o.CommandContribution)],_)},60643:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatusBarService=void 0;const n=e(85608),r=e(76003),o=e(40396),c=e(41869),p=e(95416),v=e(93899),m=e(40191),_=e(26542),s=e(43718),g=e(28423);let l=class extends c.Disposable{constructor(){super(...arguments),this.emitter=this.registerDispose(new o.EventEmitter),this.entriesObservable=(0,g.observableValue)(this,new Map),this.disposableCollection=new Map,this.entriesArray=(0,g.derived)(this,u=>{const d=this.entriesObservable.read(u);return Array.from(d.values()).sort((E,f)=>{const a=E.priority||0;return(f.priority||0)-a})}),this.leftEntries=(0,g.derived)(this,u=>this.entriesArray.read(u).filter(E=>!E.hidden&&E.alignment===_.StatusBarAlignment.LEFT)),this.rightEntries=(0,g.derived)(this,u=>this.entriesArray.read(u).filter(E=>!E.hidden&&E.alignment===_.StatusBarAlignment.RIGHT))}getBackgroundColor(){return this.appConfig.extensionDevelopmentHost?"var(--kt-statusBar-extensionDebuggingBackground)":this.background}getColor(){return this.foreground}setBackgroundColor(u){this.background=u,this.emitter.emit("backgroundColor",u)}setColor(u){this.foreground=u,this.emitter.emit("color",u)}getElementConfig(u,d){return d.command&&(d.onClick=this.onclick(d)),d.entryId=u,(0,c.isUndefined)(d.id)&&(d.id=u),d}getEntriesById(u){return this.entriesArray.get().filter(d=>d.id===u)}getStorageState(u){return this.layoutState.getState(p.LAYOUT_STATE.STATUSBAR,{})[u]}setStorageState(u,d){this.layoutState.setState(p.LAYOUT_STATE.STATUSBAR,{...this.layoutState.getState(p.LAYOUT_STATE.STATUSBAR,{}),[u]:d})}addElement(u,d){var E,f,a,b;const y=new s.DisposableCollection;d=this.getElementConfig(u,d);const A=d.id,S=(f=(E=this.getStorageState(A))===null||E===void 0?void 0:E.hidden)!==null&&f!==void 0?f:d.hidden;if(d.hidden=S,d.name&&this.getEntriesById(A).length===0){const T=new m.RawContextKey(`${A}:toggle`,!S);T.bind(this.contextKeyService);const D=d.alignment===_.StatusBarAlignment.LEFT?-1*((a=d.priority)!==null&&a!==void 0?a:0):Number.MAX_SAFE_INTEGER-((b=d.priority)!==null&&b!==void 0?b:0),I=this.menuRegistry.registerMenuItem(v.MenuId.StatusBarContext,{command:{id:_.StatusBarCommand.toggleElement.id,label:d.name},order:D,extraTailArgs:[u],toggledWhen:T.raw});y.push(I)}const w=this.entriesObservable.get();return w.set(u,d),(0,g.transaction)(T=>{this.entriesObservable.set(new Map(w),T)}),y.push(c.Disposable.create(()=>{const T=this.entriesObservable.get();T.delete(u),(0,g.transaction)(D=>{this.entriesObservable.set(new Map(T),D)})})),this.disposableCollection.set(u,y),{dispose:()=>{this.removeElement(u)},update:T=>{this.setElement(u,T)}}}toggleElement(u){const E=this.entriesObservable.get().get(u);if(E?.id){const f=`${E.id}:toggle`,a=!E.hidden;this.contextKeyService.createKey(f,!a),this.setStorageState(E.id,{hidden:a});for(const b of this.getEntriesById(E.id))b.hidden=!b.hidden}}setElement(u,d){const E=this.entriesObservable.get(),f=E.get(u);if(f){const a={...f,...d};E.set(u,this.getElementConfig(u,a)),(0,g.transaction)(b=>{this.entriesObservable.set(new Map(E),b)})}else throw new Error(`not found id is ${u} element`)}removeElement(u){var d;(d=this.disposableCollection.get(u))===null||d===void 0||d.dispose(),this.disposableCollection.delete(u)}onclick(u){return()=>{if(u.command){const d=u.arguments||[];this.commandService.executeCommand(u.command,...d)}}}get contextKeyService(){return this.registerDispose(this.globalContextKeyService.createScoped())}get contextMenu(){return this.registerDispose(this.menuService.createMenu(v.MenuId.StatusBarContext,this.contextKeyService))}};t.StatusBarService=l,n.__decorate([(0,r.Autowired)(s.CommandService),n.__metadata("design:type",Object)],l.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(c.AppConfig),n.__metadata("design:type",Object)],l.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(v.IMenuRegistry),n.__metadata("design:type",v.IMenuRegistry)],l.prototype,"menuRegistry",void 0),n.__decorate([(0,r.Autowired)(v.AbstractMenuService),n.__metadata("design:type",v.AbstractMenuService)],l.prototype,"menuService",void 0),n.__decorate([(0,r.Autowired)(c.IContextKeyService),n.__metadata("design:type",Object)],l.prototype,"globalContextKeyService",void 0),n.__decorate([(0,r.Autowired)(p.LayoutState),n.__metadata("design:type",p.LayoutState)],l.prototype,"layoutState",void 0),n.__decorate([s.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],l.prototype,"contextKeyService",null),n.__decorate([s.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],l.prototype,"contextMenu",null),t.StatusBarService=l=n.__decorate([(0,r.Injectable)()],l)},29079:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatusBarView=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(41869),p=e(1149),v=e(63373),m=e(93899),_=e(48560),s=e(26542),g=e(92237),l=n.__importDefault(e(6373));t.StatusBarView=(0,o.memo)(()=>{const h=(0,_.useInjectable)(s.IStatusBarService),u=(0,c.useAutorun)(h.leftEntries),d=(0,c.useAutorun)(h.rightEntries),E=(0,_.useInjectable)(m.ICtxMenuRenderer),f=(0,_.useInjectable)(p.LayoutViewSizeConfig),a=(0,c.useEventDrivenState)(h.emitter,"backgroundColor",()=>h.getBackgroundColor()),b=(0,c.useEventDrivenState)(h.emitter,"color",()=>h.getColor()),y=(0,o.useCallback)(A=>{A.preventDefault();const S=(0,m.generateCtxMenu)({menus:h.contextMenu,args:[]});E.show({anchor:{x:A.clientX,y:A.clientY},menuNodes:S[1]})},[]);return o.default.createElement("div",{id:v.VIEW_CONTAINERS.STATUSBAR,className:l.default.statusBar,style:{backgroundColor:a,height:f.statusBarHeight+"px"},onContextMenu:y},o.default.createElement("div",{className:(0,r.default)(l.default.area,l.default.left)},u.length?u.map((A,S)=>o.default.createElement(g.StatusBarItem,{side:"left",key:`${A.entryId}-${S}`,...A,color:b??A.color})):null),o.default.createElement("div",{className:(0,r.default)(l.default.area,l.default.right)},d.length?d.map((A,S)=>o.default.createElement(g.StatusBarItem,{side:"right",key:`${A.entryId}-${S}`,...A,color:b??A.color})):null))}),t.StatusBarView.displayName="StatusBar"},67899:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IStatusBarService=void 0;var n=e(26542);Object.defineProperty(t,"IStatusBarService",{enumerable:!0,get:function(){return n.IStatusBarService}})},40293:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(67899),t)},28639:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StorageModule=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(22992),p=e(2948),v=e(53920),m=e(57919);let _=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:c.IStoragePathServer,useClass:p.StoragePathServer},{token:c.IGlobalStorageServer,useClass:m.GlobalStorageServer},{token:c.IWorkspaceStorageServer,useClass:m.WorkspaceStorageServer},v.DatabaseStorageContribution]}};t.StorageModule=_,t.StorageModule=_=n.__decorate([(0,r.Injectable)()],_)},2948:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StoragePathServer=void 0;const n=e(85608),r=e(76003),o=e(43718),c=e(14951),{Path:p}=o.path;let v=class{constructor(){this.windowsDataFolders=[o.StoragePaths.WINDOWS_APP_DATA_DIR,o.StoragePaths.WINDOWS_ROAMING_DIR],this.ensureStorageDirPromises=new Map,this.init()}async init(){this.deferredWorkspaceStoragePath=new o.Deferred,this.deferredGlobalStoragePath=new o.Deferred,this.workspaceStoragePathInitialized=!1,this.globalStoragePathInitialized=!1,this._userHome=this.getUserHomeDir()}get userHome(){return this._userHome}async ensureStorageDir(_){if(this.ensureStorageDirPromises.has(_))return await this.ensureStorageDirPromises.get(_);const s=this.doEnsureStorageDir(_);return this.ensureStorageDirPromises.set(_,s),await s}async doEnsureStorageDir(_){try{await this.fileSystem.access(_)||await this.fileSystem.createFolder(_)}catch(s){this.logger.error(s)}}async provideWorkspaceStorageDirPath(_){if(this.cachedWorkspaceStoragePath)return this.cachedWorkspaceStoragePath;const s=await this.getBaseStorageDirPath(_),g=o.URI.file(s).resolve(o.StoragePaths.DEFAULT_DATA_DIR_NAME).toString();if(!s)throw new Error("Unable to get parent storage directory");return this.workspaceStoragePathInitialized||await this.ensureStorageDir(g),this.deferredWorkspaceStoragePath.resolve(g),this.workspaceStoragePathInitialized=!0,this.cachedWorkspaceStoragePath=g}async provideGlobalStorageDirPath(_){if(this.cachedGlobalStoragePath)return this.cachedGlobalStoragePath;const s=await this.getBaseStorageDirPath(_),g=o.URI.file(s).toString();if(!s)throw new Error("Unable to get parent storage directory");return this.globalStoragePathInitialized||await this.ensureStorageDir(g),this.deferredGlobalStoragePath.resolve(g),this.globalStoragePathInitialized=!0,this.cachedGlobalStoragePath=g}async getBaseStorageDirPath(_){return await this.getDataDirPath(_)}async getDataDirPath(_){const s=await this.userHome,g=_||o.StoragePaths.DEFAULT_STORAGE_DIR_NAME;return new p(s).join(...o.isWindows?this.windowsDataFolders:[""],g).toString()}async getUserHomeDir(){const _=await this.fileSystem.getCurrentUserHome();if(!_)throw new Error("Unable to get user home directory");return await this.fileSystem.getFsPath(_.uri)||""}async getLastWorkspaceStoragePath(){return this.workspaceStoragePathInitialized?this.cachedWorkspaceStoragePath:this.deferredWorkspaceStoragePath.promise}async getLastGlobalStoragePath(){return this.globalStoragePathInitialized?this.cachedGlobalStoragePath:this.deferredGlobalStoragePath.promise}};t.StoragePathServer=v,n.__decorate([(0,r.Autowired)(c.IFileServiceClient),n.__metadata("design:type",Object)],v.prototype,"fileSystem",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],v.prototype,"logger",void 0),t.StoragePathServer=v=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],v)},53920:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DatabaseStorageContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(51500),p=e(22992),v=e(93046);let m=class{constructor(){this.cache=new Map}async resolve(s){const g=s.path.toString();let l;const h=this.cache.get(s.toString());if(h)l=h;else{if(s.scheme===o.STORAGE_SCHEMA.SCOPE)this.isBuiltinStorage(s)?l=new v.Storage(this.workspaceStorage,this.workspaceService,this.appConfig,g,!1,this.scopedLocalStorage):l=new v.Storage(this.workspaceStorage,this.workspaceService,this.appConfig,g,!1);else if(s.scheme===o.STORAGE_SCHEMA.GLOBAL)this.isBuiltinStorage(s)?l=new v.Storage(this.globalStorage,this.workspaceService,this.appConfig,g,!0,this.globalLocalStorage):l=new v.Storage(this.globalStorage,this.workspaceService,this.appConfig,g,!0);else return;this.cache.set(s.toString(),l)}return await l.whenReady,l}isBuiltinStorage(s){const g=Object.keys(o.STORAGE_NAMESPACE);for(const l of g)if(s.isEqual(o.STORAGE_NAMESPACE[l]))return!0;return!1}};t.DatabaseStorageContribution=m,n.__decorate([(0,r.Autowired)(p.IWorkspaceStorageServer),n.__metadata("design:type",Object)],m.prototype,"workspaceStorage",void 0),n.__decorate([(0,r.Autowired)(p.IGlobalStorageServer),n.__metadata("design:type",Object)],m.prototype,"globalStorage",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],m.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(c.IWorkspaceService),n.__metadata("design:type",Object)],m.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(o.GlobalBrowserStorageService),n.__metadata("design:type",o.GlobalBrowserStorageService)],m.prototype,"globalLocalStorage",void 0),n.__decorate([(0,r.Autowired)(o.ScopedBrowserStorageService),n.__metadata("design:type",o.ScopedBrowserStorageService)],m.prototype,"scopedLocalStorage",void 0),t.DatabaseStorageContribution=m=n.__decorate([(0,o.Domain)(o.StorageResolverContribution)],m)},93046:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Storage=void 0;const n=e(43718);var r;(function(c){c[c.None=0]="None",c[c.Initialized=1]="Initialized",c[c.Closed=2]="Closed"})(r||(r={}));class o{constructor(p,v,m,_,s=!0,g){this.database=p,this.workspace=v,this.appConfig=m,this.storageName=_,this.isGlobal=s,this.browserLocalStorage=g,this._onDidChangeStorage=new n.Emitter,this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=r.None,this.cache=new Map,this.pendingDeletes=new Set,this.pendingInserts=new Map,this.toDisposableCollection=new n.DisposableCollection,this.logger=(0,n.getDebugLogger)(),this.readyDeferred=new n.Deferred,this.whenReadyToWriteDeferred=new n.Deferred,this.toDisposableCollection.push(this._onDidChangeStorage),this.flushDelayer=new n.ThrottledDelayer(o.DEFAULT_FLUSH_DELAY),this.init(_).then(()=>{this.toDisposableCollection.push(this.workspace.onWorkspaceChanged(()=>{this.init(_)}))})}get whenReady(){return this.readyDeferred.promise}get whenReadyToWrite(){return this.whenReadyToWriteDeferred.promise}get items(){return this.cache}get size(){return this.cache.size}async init(p){var v;const m=((v=this.workspace.workspace)===null||v===void 0?void 0:v.uri)||n.URI.file(this.appConfig.workspaceDir).toString();let _;this.browserLocalStorage&&(_=await this.browserLocalStorage.getData(p)),_?this.database.init(this.appConfig.storageDirName,this.isGlobal?void 0:m).then(()=>{this.database.getItems(p).then(async s=>{var g;this.cache=this.jsonToMap(s),(g=this.browserLocalStorage)===null||g===void 0||g.setData(p,s),this.whenReadyToWriteDeferred.resolve()})}):(await this.database.init(this.appConfig.storageDirName,this.isGlobal?void 0:m),_=await this.database.getItems(p),this.browserLocalStorage&&this.browserLocalStorage.setData(p,_),this.whenReadyToWriteDeferred.resolve()),this.cache=this.jsonToMap(_),this.state=r.Initialized,this.readyDeferred.resolve()}async reConnectInit(){this.readyDeferred=new n.Deferred,this.init(this.storageName)}dispose(){this.toDisposableCollection.dispose()}get(p,v){let m=this.cache.get(p);if((0,n.isUndefinedOrNull)(m))return v;try{m=JSON.parse(m)}catch(_){this.logger.error("Could not parse value: ",m,_)}return m}getBoolean(p,v){const m=this.get(p);return(0,n.isUndefinedOrNull)(m)?v:m==="true"}getNumber(p,v){const m=this.get(p);return(0,n.isUndefinedOrNull)(m)?v:parseInt(m,10)}set(p,v){if(this.state===r.Closed)return Promise.resolve();if((0,n.isUndefinedOrNull)(v))return this.delete(p);const m=JSON.stringify(v);return this.cache.get(p)===m?Promise.resolve():(this.cache.set(p,m),this.pendingInserts.set(p,m),this.pendingDeletes.delete(p),this._onDidChangeStorage.fire(p),this.flushDelayer.trigger(()=>this.flushPending()))}delete(p){return this.state===r.Closed||!this.cache.delete(p)?Promise.resolve():(this.pendingDeletes.has(p)||this.pendingDeletes.add(p),this.pendingInserts.delete(p),this._onDidChangeStorage.fire(p),this.flushDelayer.trigger(()=>this.flushPending()))}async close(){if(this.state===r.Closed)return Promise.resolve();this.state=r.Closed;try{await this.flushDelayer.trigger(()=>this.flushPending(),0)}catch{}await this.database.close(()=>this.cache)}async flushPending(){if(await this.whenReadyToWrite,this.pendingInserts.size===0&&this.pendingDeletes.size===0)return Promise.resolve();const p={insert:this.mapToJson(this.pendingInserts),delete:Array.from(this.pendingDeletes)};if(this.browserLocalStorage){let v=this.mapToJson(this.cache);for(const m of p?.delete||[])delete v[m];v={...v,...p.insert},this.browserLocalStorage.setData(this.storageName,v)}return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(this.storageName,p)}mapToJson(p){const v=Object.create(null);for(const[m,_]of p)v[m]=_;return v}jsonToMap(p){if(typeof p=="string")try{p=JSON.parse(p)}catch(m){return this.logger.debug(m),p}const v=new Map;for(const m of Object.keys(p))v.set(m,p[m]);return v}}t.Storage=o,o.DEFAULT_FLUSH_DELAY=200},57919:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalStorageServer=t.WorkspaceStorageServer=t.StorageServer=void 0;const n=e(85608),r=e(76003),o=e(43718),c=e(14951),p=e(22992),{Path:v}=o.path;let m=class{constructor(){this.storageExistPromises=new Map,this._cache={},this.onDidChangeEmitter=new o.Emitter,this.onDidChange=this.onDidChangeEmitter.event}async close(l){}async asAccess(l,h){if(h)return await this.fileSystem.access(l);if(!this.storageExistPromises.has(l)){const u=this.fileSystem.access(l);this.storageExistPromises.set(l,u)}return await this.storageExistPromises.get(l)}async setupDirectories(l,h){if(!this.deferredStorageDirPath){this.deferredStorageDirPath=new o.Deferred;let u;l===o.STORAGE_SCHEMA.GLOBAL?u=this.dataStoragePathServer.provideGlobalStorageDirPath:u=this.dataStoragePathServer.provideWorkspaceStorageDirPath;const d=await u.apply(this.dataStoragePathServer,[h]);return this.deferredStorageDirPath.resolve(d),this.databaseStorageDirPath=d,d}return this.databaseStorageDirPath}async getStoragePath(l,h){this.databaseStorageDirPath||await this.deferredStorageDirPath.promise;const u=h.indexOf(v.separator)>=0;let d;l===o.STORAGE_SCHEMA.GLOBAL?d=this.dataStoragePathServer.getLastGlobalStoragePath:d=this.dataStoragePathServer.getLastWorkspaceStoragePath;const E=await d.apply(this.dataStoragePathServer);if(u){const f=new v(h);h=f.name;const a=new o.URI(E).resolve(f.dir).toString();return await this.fileSystem.access(a)||await this.fileSystem.createFolder(a),E?new o.URI(a).resolve(`${h}.json`).toString():void 0}return E?new o.URI(E).resolve(`${h}.json`).toString():void 0}};t.StorageServer=m,n.__decorate([(0,r.Autowired)(c.IFileServiceClient),n.__metadata("design:type",Object)],m.prototype,"fileSystem",void 0),n.__decorate([(0,r.Autowired)(p.IStoragePathServer),n.__metadata("design:type",Object)],m.prototype,"dataStoragePathServer",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],m.prototype,"logger",void 0),t.StorageServer=m=n.__decorate([(0,r.Injectable)()],m);let _=class extends m{constructor(){super(...arguments),this.readyDeferred=new o.Deferred}get whenReady(){return this.readyDeferred.promise}async init(l,h){return this.workspaceNamespace=h,await this.setupDirectories(o.STORAGE_SCHEMA.SCOPE,l)}async getItems(l){if(this._cache[l])return this._cache[l];let h={};const u=this.workspaceNamespace,d=await this.getStoragePath(o.STORAGE_SCHEMA.SCOPE,l);if(!d)this.logger.error(`Storage [${l}] is invalid.`);else{const E=new o.URI(d).toString();if(await this.asAccess(E,!0)){const f=await this.fileSystem.readFile(E);try{h=JSON.parse(f.content.toString())}catch(a){this.logger.error(`Storage [${l}] content can not be parse with path ${E}. Error: ${a.stack}`),h={}}}}return this._cache[l]=h,u&&(h=h[u]||{}),this.readyDeferred.resolve(),h}async updateItems(l,h){await this.whenReady;let u={};const d=this.workspaceNamespace;this._cache[l]?u=this._cache[l]:(u=await this.getItems(l),d&&(u=u[d])),h.insert&&(d?u[d]={...u[d],...h.insert}:u={...u,...h.insert}),h.delete&&h.delete.length>0&&new Set(h.delete).forEach(a=>{d?u[d][a]&&delete u[d][a]:u[a]&&delete u[a]}),this._cache[l]=u;const E=await this.getStoragePath(o.STORAGE_SCHEMA.SCOPE,l);if(E){const f=new o.URI(E).toString();let a=await this.fileSystem.getFileStat(f);a||(a=await this.fileSystem.createFile(f)),await this.fileSystem.setContent(a,JSON.stringify(u));const b={path:a.uri,data:JSON.stringify(u)};this.onDidChangeEmitter.fire(b)}}};t.WorkspaceStorageServer=_,t.WorkspaceStorageServer=_=n.__decorate([(0,r.Injectable)()],_);let s=class extends m{constructor(){super(...arguments),this.readyDeferred=new o.Deferred}get whenReady(){return this.readyDeferred.promise}async init(l){return await this.setupDirectories(o.STORAGE_SCHEMA.GLOBAL,l)}async getItems(l){if(this._cache[l])return this._cache[l];let h={};const u=await this.getStoragePath(o.STORAGE_SCHEMA.GLOBAL,l);if(!u)this.logger.error(`Storage [${l}] is invalid.`);else{const d=new o.URI(u).toString();if(await this.asAccess(d,!0)){const E=await this.fileSystem.readFile(d);try{h=JSON.parse(E.content.toString())}catch(f){this.logger.error(`Storage [${l}] content can not be parse. Error: ${f.stack}`),h={}}}}return this._cache[l]=h,this.readyDeferred.resolve(),h}async updateItems(l,h){await this.whenReady;let u={};this._cache[l]?u=this._cache[l]:u=await this.getItems(l),h.insert&&(u={...u,...h.insert}),h.delete&&h.delete.length>0&&new Set(h.delete).forEach(f=>{u[f]&&delete u[f]}),this._cache[l]=u;const d=await this.getStoragePath(o.STORAGE_SCHEMA.GLOBAL,l);if(d){let E=await this.fileSystem.getFileStat(d);E||(E=await this.fileSystem.createFile(d,{content:""})),await this.fileSystem.setContent(E,JSON.stringify(u));const f={path:E.uri,data:JSON.stringify(u)};this.onDidChangeEmitter.fire(f)}}};t.GlobalStorageServer=s,t.GlobalStorageServer=s=n.__decorate([(0,r.Injectable)()],s)},22992:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(62025),t),n.__exportStar(e(5597),t)},5597:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IStoragePathServer=void 0,t.IStoragePathServer=Symbol("IStoragePathServer")},62025:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IGlobalStorageServer=t.IWorkspaceStorageServer=void 0,t.IWorkspaceStorageServer="IWorkspaceStorageServer",t.IGlobalStorageServer="IGlobalStorageServer"},95737:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskModule=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(91825),p=e(93950),v=e(27347),m=e(41824),_=e(77554),s=e(95521),g=e(66893);let l=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[_.TaskContribution,v.TaskPreferencesContribution,{token:c.FolderFilePreferenceProvider,useClass:m.TaskFolderPreferenceProvider,dropdownForTag:!0,tag:"tasks"},{token:p.ITaskService,useClass:s.TaskService},{token:p.ITaskSystem,useClass:g.TerminalTaskSystem}]}};t.TaskModule=l,t.TaskModule=l=n.__decorate([(0,r.Injectable)()],l)},17654:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProblemMatcherParser=t.ProblemPatternParser=t.Config=t.Parser=t.ValidationStatus=void 0;const n=e(43718),{deepClone:r}=n.objects;class o{constructor(){this._state=0}get state(){return this._state}set state(s){s>this._state&&(this._state=s)}isOK(){return this._state===0}isFatal(){return this._state===4}}t.ValidationStatus=o;class c{constructor(s){this._problemReporter=s}reset(){this._problemReporter.status.state=0}get problemReporter(){return this._problemReporter}info(s){this._problemReporter.info(s)}warn(s){this._problemReporter.warn(s)}error(s){this._problemReporter.error(s)}fatal(s){this._problemReporter.fatal(s)}}t.Parser=c;var p;(function(_){let s;(function(f){function a(b){const y=b;return y&&(0,n.isString)(y.regexp)}f.is=a})(s=_.CheckedProblemPattern||(_.CheckedProblemPattern={}));let g;(function(f){function a(b){const y=b;return y&&(0,n.isString)(y.name)}f.is=a})(g=_.NamedProblemPattern||(_.NamedProblemPattern={}));let l;(function(f){function a(b){const y=b;return y&&g.is(y)&&(0,n.isString)(y.regexp)}f.is=a})(l=_.NamedCheckedProblemPattern||(_.NamedCheckedProblemPattern={}));let h;(function(f){function a(b){return b&&(0,n.isArray)(b)}f.is=a})(h=_.MultiLineProblemPattern||(_.MultiLineProblemPattern={}));let u;(function(f){function a(b){if(!h.is(b))return!1;for(const y of b)if(!_.CheckedProblemPattern.is(y))return!1;return!0}f.is=a})(u=_.MultiLineCheckedProblemPattern||(_.MultiLineCheckedProblemPattern={}));let d;(function(f){function a(b){const y=b;return y&&(0,n.isString)(y.name)&&(0,n.isArray)(y.patterns)&&u.is(y.patterns)}f.is=a})(d=_.NamedMultiLineCheckedProblemPattern||(_.NamedMultiLineCheckedProblemPattern={}));function E(f){return(0,n.isString)(f.name)}_.isNamedProblemMatcher=E})(p||(t.Config=p={}));class v extends c{constructor(s){super(s)}parse(s){if(p.NamedMultiLineCheckedProblemPattern.is(s))return this.createNamedMultiLineProblemPattern(s);if(p.MultiLineCheckedProblemPattern.is(s))return this.createMultiLineProblemPattern(s);if(p.NamedCheckedProblemPattern.is(s)){const g=this.createSingleProblemPattern(s);return g.name=s.name,g}else return p.CheckedProblemPattern.is(s)?this.createSingleProblemPattern(s):(this.error((0,n.localize)("ProblemPatternParser.problemPattern.missingRegExp","The problem pattern is missing a regular expression.")),null)}createSingleProblemPattern(s){const g=this.doCreateSingleProblemPattern(s,!0);return g===void 0?null:(g.kind===void 0&&(g.kind=n.ProblemLocationKind.Location),this.validateProblemPattern([g])?g:null)}createNamedMultiLineProblemPattern(s){const g=this.createMultiLineProblemPattern(s.patterns);return g?{name:s.name,label:s.label?s.label:s.name,patterns:g}:null}createMultiLineProblemPattern(s){const g=[];for(let l=0;l<s.length;l++){const h=this.doCreateSingleProblemPattern(s[l],!1);if(h===void 0)return null;l<s.length-1&&!(0,n.isUndefined)(h.loop)&&h.loop&&(h.loop=!1,this.error((0,n.localize)("ProblemPatternParser.loopProperty.notLast","The loop property is only supported on the last line matcher."))),g.push(h)}return g[0].kind===void 0&&(g[0].kind=n.ProblemLocationKind.Location),this.validateProblemPattern(g)?g:null}doCreateSingleProblemPattern(s,g){const l=this.createRegularExpression(s.regexp);if(l===void 0)return;let h={regexp:l};s.kind&&(h.kind=n.ProblemLocationKind.fromString(s.kind));function u(d,E,f,a){const b=E[a];typeof b=="number"&&(d[f]=b)}if(u(h,s,"file","file"),u(h,s,"location","location"),u(h,s,"line","line"),u(h,s,"character","column"),u(h,s,"endLine","endLine"),u(h,s,"endCharacter","endColumn"),u(h,s,"severity","severity"),u(h,s,"code","code"),u(h,s,"message","message"),(s.loop===!0||s.loop===!1)&&(h.loop=s.loop),g)if(h.location||h.kind===n.ProblemLocationKind.File){const d={file:1,message:0};h=(0,n.mixin)(h,d,!1)}else{const d={file:1,line:2,character:3,message:0};h=(0,n.mixin)(h,d,!1)}return h}validateProblemPattern(s){let g=!1,l=!1,h=!1,u=!1;const d=s[0].kind===void 0?n.ProblemLocationKind.Location:s[0].kind;return s.forEach((E,f)=>{f!==0&&E.kind&&this.error((0,n.localize)("ProblemPatternParser.problemPattern.kindProperty.notFirst","The problem pattern is invalid. The kind property must be provided only in the first element")),g=g||!(0,n.isUndefined)(E.file),l=l||!(0,n.isUndefined)(E.message),h=h||!(0,n.isUndefined)(E.location),u=u||!(0,n.isUndefined)(E.line)}),g&&l?d===n.ProblemLocationKind.Location&&!(h||u)?(this.error((0,n.localize)("ProblemPatternParser.problemPattern.missingLocation",'The problem pattern is invalid. It must either have kind: "file" or have a line or location match group.')),!1):!0:(this.error((0,n.localize)("ProblemPatternParser.problemPattern.missingProperty","The problem pattern is invalid. It must have at least have a file and a message.")),!1)}createRegularExpression(s){let g;try{g=new RegExp(s)}catch{this.error((0,n.localize)("ProblemPatternParser.invalidRegexp",`Error: The string {0} is not a valid regular expression.
31944
+ `:null,!1).forEach((j,W)=>{W===0&&M&&this.setEditorSelections(M,j.range),k.push((0,E.cutShortSearchResult)({fileUri:D.uri.toString(),line:j.range.startLineNumber,matchStart:j.range.startColumn,matchLength:j.range.endColumn-j.range.startColumn,lineText:L.getLineContent(j.range.startLineNumber)}))}),{result:k,searchedList:F}}async searchAllFromDocModel(T){const D=T.searchValue,I=T.searchOptions,O=T.documentModelManager,M=T.rootDirs;let R=[],P=[];const k=O.getAllModels(),F=this.workbenchEditorService.currentEditorGroup,L=new E.FilterFileWithGlobRelativePath(M,I.include||[]);return await Promise.all(k.map(async B=>{const j=B.uri.toString();if(B.uri.scheme!==p.Schemes.file)return;const W=await this.resourceService.getResource(B.uri);if(!W||W.deleted||!L.test(j))return;const U=this.searchFromDocModel(I,B,D,M,F.codeEditor);R=R.concat(U.result),P=P.concat(U.searchedList)})),{result:R,searchedList:P}}fireTitleChange(){this.onDidTitleChangeEmitter.fire()}refresh(){this.search()}dispose(){var T;super.dispose(),(T=this.eventBusDisposer)===null||T===void 0||T.dispose(),this.blur()}};t.ContentSearchClientService=S,n.__decorate([(0,o.Autowired)(_.IEventBus),n.__metadata("design:type",Object)],S.prototype,"eventBus",void 0),n.__decorate([(0,o.Autowired)(b.SearchPreferences),n.__metadata("design:type",Object)],S.prototype,"searchPreferences",void 0),n.__decorate([(0,o.Autowired)(v.CorePreferences),n.__metadata("design:type",Object)],S.prototype,"corePreferences",void 0),n.__decorate([(0,o.Autowired)(E.ContentSearchServerPath),n.__metadata("design:type",Object)],S.prototype,"contentSearchServer",void 0),n.__decorate([(0,o.Autowired)(u.IWorkspaceService),n.__metadata("design:type",Object)],S.prototype,"workspaceService",void 0),n.__decorate([(0,o.Autowired)(p.RecentStorage),n.__metadata("design:type",p.RecentStorage)],S.prototype,"recentStorage",void 0),n.__decorate([(0,o.Autowired)(g.IEditorDocumentModelService),n.__metadata("design:type",Object)],S.prototype,"documentModelManager",void 0),n.__decorate([(0,o.Autowired)(p.CommandService),n.__metadata("design:type",Object)],S.prototype,"commandService",void 0),n.__decorate([(0,o.Autowired)(m.GlobalBrowserStorageService),n.__metadata("design:type",m.GlobalBrowserStorageService)],S.prototype,"browserStorageService",void 0),n.__decorate([(0,o.Autowired)(h.IDialogService),n.__metadata("design:type",Object)],S.prototype,"dialogService",void 0),n.__decorate([(0,o.Autowired)(h.IMessageService),n.__metadata("design:type",Object)],S.prototype,"messageService",void 0),n.__decorate([(0,o.Autowired)(d.IWorkspaceEditService),n.__metadata("design:type",Object)],S.prototype,"workspaceEditService",void 0),n.__decorate([(0,o.Autowired)(_.IReporterService),n.__metadata("design:type",Object)],S.prototype,"reporterService",void 0),n.__decorate([(0,o.Autowired)(p.PreferenceService),n.__metadata("design:type",Object)],S.prototype,"preferenceService",void 0),n.__decorate([(0,o.Autowired)(s.WorkbenchEditorService),n.__metadata("design:type",s.WorkbenchEditorService)],S.prototype,"workbenchEditorService",void 0),n.__decorate([(0,o.Autowired)(),n.__metadata("design:type",g.ResourceService)],S.prototype,"resourceService",void 0),t.ContentSearchClientService=S=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],S)},14851:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Search=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(41869),p=e(68974),v=e(52925),m=e(79904),_=n.__importDefault(e(66653)),s=e(67640),g=e(12781),l=e(68267);t.Search=(0,o.memo)(({viewState:h})=>{const u=(0,o.useRef)(null),d=(0,o.useRef)(null),E=(0,c.useInjectable)(v.ISearchTreeService),f=(0,c.useInjectable)(v.IContentSearchClientService),[a,b]=(0,o.useState)(0),[y,A]=(0,o.useState)({results:new Map,total:{resultNum:0,fileNum:0},isSearching:!1,state:v.SEARCH_STATE.done,searchError:"",isShowValidateMessage:!1}),[S,w]=(0,o.useState)(""),[T,D]=(0,o.useState)(""),{replaceAll:I,updateUIState:O,UIState:M}=f,[R,P]=(0,o.useState)(M.isDetailOpen),k=(0,o.useRef)(),F=(0,o.useRef)(new c.DisposableCollection),L=(0,o.useCallback)(()=>{P(f.UIState.isDetailOpen)},[R,f]),B=(0,o.useCallback)(()=>{O({isDetailOpen:!f.UIState.isDetailOpen})},[f]),j=(0,o.useCallback)(()=>{E.contextKey.searchInputBoxFocusedKey.set(!0)},[E]),W=(0,o.useCallback)(()=>{E.contextKey.searchInputBoxFocusedKey.set(!1)},[f]),U=(0,o.useCallback)(()=>{O({isMatchCase:!f.UIState.isMatchCase})},[f]),Q=(0,o.useCallback)(()=>{O({isUseRegexp:!f.UIState.isUseRegexp})},[f]),V=(0,o.useCallback)(()=>{O({isWholeWord:!f.UIState.isWholeWord})},[f]),$=(0,o.useCallback)(()=>{O({isOnlyOpenEditors:!f.UIState.isOnlyOpenEditors})},[f]),Y=(0,o.useCallback)(()=>{O({isIncludeIgnored:!f.UIState.isIncludeIgnored})},[f]);(0,o.useEffect)(()=>{b(u.current&&u.current.clientHeight||0)},[a,u.current,y,f,M.isDetailOpen]);const z={width:h.width||"100%",height:h.height},H=(0,o.useMemo)(()=>o.default.createElement("div",{className:_.default["loading-wrap"]},o.default.createElement(p.Progress,{loading:y.isSearching})),[y]),K=(0,o.useCallback)(te=>{te&&te.key!==c.Key.ENTER.code||(A({...y,results:new Map}),f.search())},[f,y]),Z=(0,o.useCallback)(te=>{f.onSearchInputChange(te.currentTarget.value||""),D(te.currentTarget.value)},[f]),X=(0,o.useCallback)(te=>{f.onSearchIncludeChange(te.currentTarget.value||"")},[f]),ie=(0,o.useCallback)(()=>{f.openPreference()},[f]),oe=(0,o.useCallback)(te=>{f.onSearchExcludeChange(te.currentTarget.value||"")},[f]),le=(0,o.useCallback)(te=>{f.onReplaceInputChange(te.currentTarget.value||""),w(te.currentTarget.value)},[S,f]),pe=(0,o.useCallback)(()=>{A({results:f.searchResults,total:f.resultTotal,isSearching:f.isSearching,state:f.searchState,searchError:f.searchError,isShowValidateMessage:f.isShowValidateMessage,validateMessage:f.validateMessage})},[y,f]),q=(0,o.useCallback)(te=>{var ge,Te;D(te),(ge=k.current)===null||ge===void 0||ge.focus(),(Te=k.current)===null||Te===void 0||Te.select()},[k.current,T]);(0,o.useEffect)(()=>(F.current.push(f.onDidChange(pe)),F.current.push(f.onDidTitleChange(pe)),F.current.push(f.onDidUIStateChange(L)),F.current.push(f.onDidSearchStateChange(q)),()=>{F.current.dispose()}),[]),(0,o.useEffect)(()=>{d.current&&E.initContextKey(d.current)},[]);const Ee=(0,o.useCallback)(()=>y.results.size>0?o.default.createElement(l.SearchTree,{offsetTop:a,viewState:h,state:y.state,total:y.total,search:T,replace:S,isUseRegexp:f.UIState.isUseRegexp,isMatchCase:f.UIState.isMatchCase}):y.state===v.SEARCH_STATE.done?o.default.createElement("div",{className:_.default.result_describe},T&&(0,c.localize)("search.noResultsFound")):null,[y,f,a,T,S]),_e=(0,o.useCallback)(()=>y.searchError||y.state===v.SEARCH_STATE.error?o.default.createElement("div",{className:_.default.result_error},y.searchError):Ee(),[y,f,a,T,S]);return o.default.createElement("div",{className:_.default.search_container,style:z,ref:d},H,o.default.createElement("div",{className:_.default.search_options,ref:u},o.default.createElement(m.SearchInputWidget,{isDetailOpen:M.isDetailOpen,onDetailToggle:B,isMatchCase:M.isMatchCase,onMatchCaseToggle:U,isRegex:M.isUseRegexp,onRegexToggle:Q,isWholeWord:M.isWholeWord,onWholeWordToggle:V,isShowValidateMessage:y.isShowValidateMessage,validateMessage:y.validateMessage,onSearchFocus:j,onSearchBlur:W,ref:te=>te&&(k.current=te),searchValue:f.searchValue,onSearchInputChange:Z,onSearch:K}),o.default.createElement(s.SearchReplaceWidget,{replaceValue:f.replaceValue,onSearch:K,onReplaceRuleChange:le,replaceAll:I,disabled:y.total.fileNum<=0}),o.default.createElement("div",{className:(0,r.default)(_.default.search_details)},R&&o.default.createElement(g.SearchRulesWidget,{includeValue:f.includeValue,excludeValue:f.excludeValue,onSearch:K,onChangeInclude:X,onChangeExclude:oe,isOnlyOpenEditors:M.isOnlyOpenEditors,isIncludeIgnored:M.isIncludeIgnored,onOnlyOpenEditorsToggle:$,onIncludeIgnoredToggle:Y,onOpenPreference:ie}))),_e())})},78182:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SEARCH_TREE_NODE_HEIGHT=t.SearchNodeRendered=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(97267),p=e(41869),v=e(86109),m=n.__importDefault(e(2037)),_=({item:s,search:g,replace:l,defaultLeftPadding:h=8,leftPadding:u=8,decorations:d,onClick:E,onDoubleClick:f,onContextMenu:a,commandService:b,isUseRegexp:y,isMatchCase:A})=>{const S=(0,p.useDesignStyles)(m.default.expansion_toggle,"expansion_toggle"),w=(0,o.useCallback)(U=>{E(U,s)},[E]),T=(0,o.useCallback)(U=>{f(U,s)},[f]),D=(0,o.useCallback)(U=>{U.stopPropagation(),U.preventDefault(),a(U,s)},[a]),I=`${h+(s.depth||0)*(u||0)+(v.SearchFileNode.is(s)?0:8)}px`,O={height:t.SEARCH_TREE_NODE_HEIGHT,lineHeight:`${t.SEARCH_TREE_NODE_HEIGHT}px`,paddingLeft:I},M=(0,o.useCallback)(U=>v.SearchFileNode.is(U)?o.default.createElement("div",{className:(0,r.default)(m.default.icon,v.SearchFileNode.is(U)?U.icon:""),style:{height:t.SEARCH_TREE_NODE_HEIGHT,lineHeight:`${t.SEARCH_TREE_NODE_HEIGHT}px`}}):null,[]),R=(0,o.useCallback)(U=>o.default.createElement("div",{className:(0,r.default)(m.default.segment,m.default.displayname)},U.displayName),[]),P=(0,o.useCallback)(U=>{if(v.SearchFileNode.is(U))return o.default.createElement("div",{className:(0,r.default)(m.default.segment_grow,m.default.description)},U.description);{const{start:Q,end:V}=U.highlight;if(y){let $;try{$=new RegExp(g,A?"":"i")}catch{$=null}const Y=U.description.match($);if(!$||!Y)return o.default.createElement("div",{className:(0,r.default)(m.default.segment_grow,m.default.description)},U.description);const z=Y[0];if(z&&(0,p.isDefined)(Q)){const H=z.replace($,l);return o.default.createElement("div",{className:(0,r.default)(m.default.segment_grow,m.default.description)},U.description.slice(0,Q),o.default.createElement("span",{className:(0,r.default)(m.default.match,l&&m.default.replace)},z),H&&o.default.createElement("span",{className:m.default.replace},H),U.description.slice(V))}}else{let $=-1;return A?$=U.description.indexOf(g):$=U.description.toLocaleLowerCase().indexOf(g.toLocaleLowerCase()),$>=0?o.default.createElement("div",{className:(0,r.default)(m.default.segment_grow,m.default.description)},U.description.slice(0,Q),o.default.createElement("span",{className:(0,r.default)(m.default.match,l&&m.default.replace)},U.description.slice(Q,V)),l&&o.default.createElement("span",{className:m.default.replace},l),U.description.slice(V)):o.default.createElement("div",{className:(0,r.default)(m.default.segment_grow,m.default.description)},U.description)}}},[l,g,y,A]),k=(0,o.useCallback)(U=>o.default.createElement("div",{className:(0,r.default)(m.default.segment,m.default.tail)},F(U)),[]),F=(0,o.useCallback)(U=>{if(v.SearchFileNode.is(U))return o.default.createElement(c.Badge,{className:m.default.status},U.badge)},[]),L=(0,o.useCallback)(U=>o.default.createElement("div",{className:(0,r.default)(m.default.segment,S,(0,p.getIcon)("arrow-right"),{[`${m.default.mod_collapsed}`]:!U.expanded})}),[]),B=(0,o.useCallback)(U=>{if(v.SearchFileNode.is(U))return L(U)},[]),j=(0,o.useCallback)(()=>s.tooltip,[s]),W=(0,o.useCallback)(U=>{let Q;return v.SearchFileNode.is(s)?Q=[{icon:(0,p.getExternalIcon)("replace-all"),title:(0,p.localize)("search.replace.title"),command:p.SEARCH_COMMANDS.MENU_REPLACE_ALL.id},{icon:(0,p.getIcon)("eye-close"),title:(0,p.localize)("search.result.hide"),command:p.SEARCH_COMMANDS.MENU_HIDE.id}]:Q=[{icon:(0,p.getExternalIcon)("replace-all"),title:(0,p.localize)("search.replace.title"),command:p.SEARCH_COMMANDS.MENU_REPLACE.id},{icon:(0,p.getIcon)("eye-close"),title:(0,p.localize)("search.result.hide"),command:p.SEARCH_COMMANDS.MENU_HIDE.id}],o.default.createElement("div",{className:m.default.action_bar,style:{height:t.SEARCH_TREE_NODE_HEIGHT,lineHeight:`${t.SEARCH_TREE_NODE_HEIGHT}px`}},Q.map(V=>{const $=Y=>{Y.stopPropagation(),Y.preventDefault(),b.executeCommand(V.command,U)};return o.default.createElement(c.Button,{type:"icon",key:`${U.id}-${V.command}`,iconClass:(0,r.default)(m.default.action_icon,V.icon),title:V.title,onClick:$})}))},[]);return o.default.createElement("div",{key:s.id,onClick:w,onDoubleClick:T,onContextMenu:D,title:j(),className:(0,r.default)(m.default.search_node,d?d.classlist:null),style:O,"data-id":s.id},o.default.createElement("div",{className:m.default.content},B(s),M(s),o.default.createElement("div",{className:m.default.overflow_wrap},R(s),P(s)),W(s),k(s)))};t.SearchNodeRendered=_,t.SEARCH_TREE_NODE_HEIGHT=22},5439:(x,t,e)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.SearchTreeService=t.ReplaceDocumentModelContentProvider=t.RangeHighlightDecorations=void 0;const r=e(85608),o=e(76003),c=e(41869),p=e(43718),v=e(57517),m=e(42933),_=r.__importStar(e(20868)),s=e(51500),g=e(26199),l=e(92553),h=e(3956),u=e(50845),d=e(86109);let E=n=class{constructor(){this.preDeltaDecoration=null,this._model=null,this._modelRef=null,this._modelDisposables=new p.DisposableStore}removeHighlightRange(){this._model&&this.preDeltaDecoration&&this._model.deltaDecorations(this.preDeltaDecoration,[]),this.preDeltaDecoration=null}highlightRange(y,A){let S=null;if(p.URI.isUri(y)){const w=this.documentModelManager.getModelReference(y,"highlight-range");w&&(S=w.instance.getMonacoModel(),this._modelRef=w)}else S=y;S&&this.doHighlightRange(S,A)}doHighlightRange(y,A){this.removeHighlightRange(),this.preDeltaDecoration=y.deltaDecorations([],this.createEditorDecorations(A)),this.setModel(y)}createEditorDecorations(y){return[{range:y,options:n.RANGE_HIGHLIGHT_DECORATION}]}setModel(y){this._modelRef&&(this._modelRef.dispose(),this._modelRef=null),this._model!==y&&(this.clearModelListeners(),this._model=y,this._modelDisposables.add(this._model.onWillDispose(()=>{this.clearModelListeners(),this.removeHighlightRange(),this._model=null})))}clearModelListeners(){this._modelDisposables.clear()}dispose(){this._model&&(this.removeHighlightRange(),this._modelDisposables.dispose(),this._model=null)}};t.RangeHighlightDecorations=E,E.RANGE_HIGHLIGHT_DECORATION={className:"rangeHighlight",stickiness:_.editor.TrackedRangeStickiness.GrowsOnlyWhenTypingBefore,isWholeLine:!0},r.__decorate([(0,o.Autowired)(v.IEditorDocumentModelService),r.__metadata("design:type",Object)],E.prototype,"documentModelManager",void 0),t.RangeHighlightDecorations=E=n=r.__decorate([(0,o.Injectable)()],E);let f=class{constructor(){this.contentMap=new Map,this.onDidChangeContentEvent=new p.Emitter,this.onDidChangeContent=this.onDidChangeContentEvent.event}handlesScheme(y){return y===p.Schemes.internal}provideEditorDocumentModelContent(y){return this.contentMap.get(y.toString())||""}isReadonly(){return!0}async updateContent(y){const A=y.withScheme(JSON.parse(y.query).scheme).withoutQuery().withoutFragment();let S=this.searchBrowserService.searchResults.get(A.toString());if(!S)return"";const w=this.documentModelManager.getModelReference(A)||await this.documentModelManager.createModelReference(A),D=w.instance.getText(),I=this.documentModelManager.getModelReference(y)||await this.documentModelManager.createModelReference(y),O=I.instance;O.updateContent(D),S=S.map(M=>Object.assign({},M,{fileUri:y.toString()})),await(0,h.replace)(this.documentModelManager,this.workspaceEditService,S,this.searchBrowserService.replaceValue,this.searchBrowserService.searchValue,this.searchBrowserService.UIState.isUseRegexp),this.contentMap.set(y.toString(),O.getText()),I.dispose(),w.dispose()}delete(y){this.contentMap.delete(y.toString())}clear(){this.contentMap.clear()}};t.ReplaceDocumentModelContentProvider=f,r.__decorate([(0,o.Autowired)(v.IEditorDocumentModelService),r.__metadata("design:type",Object)],f.prototype,"documentModelManager",void 0),r.__decorate([(0,o.Autowired)(l.IContentSearchClientService),r.__metadata("design:type",Object)],f.prototype,"searchBrowserService",void 0),r.__decorate([(0,o.Autowired)(g.IWorkspaceEditService),r.__metadata("design:type",Object)],f.prototype,"workspaceEditService",void 0),t.ReplaceDocumentModelContentProvider=f=r.__decorate([(0,o.Injectable)()],f);let a=class extends p.Disposable{get viewReady(){return this.viewReadyDeferered.promise}constructor(){super(),this.viewReadyDeferered=new p.Deferred,this.addDispose(this.rangeHighlightDecorations),this.addDispose(this.contentRegistry.registerEditorDocumentModelContentProvider(this.replaceDocumentModelContentProvider))}get replaceValue(){return this.searchBrowserService.replaceValue}get resultTotal(){return this.searchBrowserService.resultTotal}get contextKey(){return this.searchContextKey}initContextKey(y){this.contextKey.initScopedContext(y),this.viewReadyDeferered.resolve()}removeHighlightRange(){this.rangeHighlightDecorations.removeHighlightRange()}async resolveChildren(y){var A;if(y){if(y)if(d.SearchRoot.isRoot(y)){const S=this.searchBrowserService.searchResults;if(!S)return[];const w=[];for(const T of S){const D=T[0],I=T[1],O=new p.URI(D),M=(A=await this.workspaceService.asRelativePath(O.parent))===null||A===void 0?void 0:A.path;!I||I.length<1||w.push(new d.SearchFileNode(this,I,M,await this.getReadableTooltip(O),this.labelService.getIcon(O),O,y))}return w}else return y.contentResults.map(w=>{const T=(w.renderStart||w.matchStart)-1,D=T+w.matchLength,I=w.renderLineText||w.lineText;return new d.SearchContentNode(this,w,I,{start:T,end:D},y.resource,y)})}else return[new d.SearchRoot(this)];return[]}async getCurrentUserHome(){if(!this.userhomePath)try{const y=await this.fileServiceClient.getCurrentUserHome();y&&(this.userhomePath=new p.URI(y.uri))}catch{}return this.userhomePath}async getReadableTooltip(y){const A=y.toString(),S=await this.getCurrentUserHome();if(!S)return decodeURIComponent(y.withScheme("").toString());if(S.isEqualOrParent(y)){const w=S&&S.toString();return decodeURIComponent(A.replace(w,"~"))}return decodeURIComponent(y.withScheme("").toString())}};t.SearchTreeService=a,r.__decorate([(0,o.Autowired)(l.IContentSearchClientService),r.__metadata("design:type",Object)],a.prototype,"searchBrowserService",void 0),r.__decorate([(0,o.Autowired)(s.IWorkspaceService),r.__metadata("design:type",Object)],a.prototype,"workspaceService",void 0),r.__decorate([(0,o.Autowired)(v.IEditorDocumentModelContentRegistry),r.__metadata("design:type",Object)],a.prototype,"contentRegistry",void 0),r.__decorate([(0,o.Autowired)(f),r.__metadata("design:type",f)],a.prototype,"replaceDocumentModelContentProvider",void 0),r.__decorate([(0,o.Autowired)(E),r.__metadata("design:type",E)],a.prototype,"rangeHighlightDecorations",void 0),r.__decorate([(0,o.Autowired)(m.IFileServiceClient),r.__metadata("design:type",Object)],a.prototype,"fileServiceClient",void 0),r.__decorate([(0,o.Autowired)(u.SearchContextKey),r.__metadata("design:type",u.SearchContextKey)],a.prototype,"searchContextKey",void 0),r.__decorate([(0,o.Autowired)(c.LabelService),r.__metadata("design:type",c.LabelService)],a.prototype,"labelService",void 0),r.__decorate([p.memoize,r.__metadata("design:type",Function),r.__metadata("design:paramtypes",[]),r.__metadata("design:returntype",Promise)],a.prototype,"getCurrentUserHome",null),t.SearchTreeService=a=r.__decorate([(0,o.Injectable)(),r.__metadata("design:paramtypes",[])],a)},68267:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchTree=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(97267),p=e(41869),v=e(92553),m=n.__importDefault(e(66653)),_=e(78182),s=e(13072),g=({total:h,state:u,model:d})=>{const[E,f]=(0,o.useState)(!1),a=(0,p.useInjectable)(s.SearchModelService),b=(0,o.useCallback)(()=>{a.clearSearchResults()},[a]),y=(0,o.useCallback)(()=>{const S=!E;f(S),S?a.collapsedAll():a.expandAll()},[E,a]),A=(0,o.useCallback)(()=>{a.refresh()},[a]);return(0,o.useEffect)(()=>{if(!d)return;const S=d.root.watcher.on(c.TreeNodeEvent.DidChangeExpansionState,()=>{E&&f(!E)});return()=>{S.dispose()}},[d,E]),h.resultNum>0?o.default.createElement("p",{className:m.default.result_describe},o.default.createElement("span",{className:m.default.text},(0,p.formatLocalize)("search.files.result",String(h.resultNum),String(h.fileNum))),o.default.createElement(c.Button,{className:(0,r.default)(m.default.result_fold,{[m.default.disabled]:u===v.SEARCH_STATE.doing}),onClick:b,type:"icon",icon:"clear",title:(0,p.localize)("search.ClearSearchResultsAction.label")}),o.default.createElement(c.Button,{className:(0,r.default)(m.default.result_fresh,{[m.default.disabled]:u===v.SEARCH_STATE.doing}),onClick:A,type:"icon",icon:"refresh",title:(0,p.localize)("search.RefreshAction.label")}),o.default.createElement(c.Button,{className:(0,r.default)(m.default.result_fold,{[m.default.disabled]:u===v.SEARCH_STATE.doing}),onClick:y,type:"icon",icon:E?"expand-all":"collapse-all",title:(0,p.localize)(E?"search.ExpandDeepestExpandedLevelAction.label":"search.CollapseDeepestExpandedLevelAction.label")})):null},l=({offsetTop:h,total:u,state:d,replace:E,search:f,viewState:a,isUseRegexp:b,isMatchCase:y})=>{const[A,S]=(0,o.useState)(),w=(0,p.useInjectable)(s.SearchModelService),T=(0,p.useInjectable)(p.CommandService),D=(0,o.useRef)(null),I=(0,o.useRef)(null),[O,M]=(0,o.useState)(0),{handleTreeBlur:R,handleTreeFocus:P}=w;(0,o.useEffect)(()=>{S(w.treeModel);const B=w.onDidUpdateTreeModel(j=>{S(j)});return()=>{B.dispose()}},[]),(0,o.useEffect)(()=>{I.current&&M(I.current.clientHeight)},[I.current]);const k=(0,o.useCallback)(B=>{w.handleTreeHandler(B)},[w]),F=(0,o.useCallback)(B=>o.default.createElement(_.SearchNodeRendered,{item:B.item,itemType:B.itemType,decorations:w.decorations.getDecorations(B.item),defaultLeftPadding:8,search:f,replace:E,onClick:w.handleItemClick,onDoubleClick:w.handleItemDoubleClick,onContextMenu:w.handleContextMenu,leftPadding:8,isUseRegexp:b,isMatchCase:y,commandService:T}),[A,f,E,b,y]),L=(0,o.useCallback)(()=>{if(A)return o.default.createElement(c.RecycleTree,{height:a.height-h-O,itemHeight:_.SEARCH_TREE_NODE_HEIGHT,onReady:k,model:A},F)},[A,O,h,f,E,b,y,a]);return o.default.createElement("div",{className:m.default.tree,tabIndex:-1,onBlur:R,onFocus:P,ref:D},o.default.createElement("div",{ref:I},o.default.createElement(g,{total:u,state:d,model:A})),L())};t.SearchTree=l},13072:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchModelService=t.SearchTreeModel=void 0;const n=e(85608),r=e(76003),o=e(97267),c=e(41869),p=e(93899),v=e(54414),m=n.__importStar(e(20868)),_=e(92553),s=e(33301),g=e(5439),l=e(86109),h=n.__importDefault(e(2037));let u=class extends o.TreeModel{constructor(f){super(),this.init(f)}};t.SearchTreeModel=u,t.SearchTreeModel=u=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[l.SearchRoot])],u);let d=class extends c.Disposable{constructor(){super(),this.selectedDecoration=new o.Decoration(h.default.mod_selected),this.focusedDecoration=new o.Decoration(h.default.mod_focused),this.contextMenuDecoration=new o.Decoration(h.default.mod_actived),this._selectedNodes=[],this.onDidUpdateTreeModelEmitter=new c.Emitter,this.disposableCollection=new c.DisposableCollection,this.treeIsDirty=!1,this.applyFocusedDecoration=(f,a=!0)=>{var b;if(this.contextMenuNode&&(this.focusedDecoration.removeTarget(this.contextMenuNode),this.selectedDecoration.removeTarget(this.contextMenuNode),this.contextMenuDecoration.removeTarget(this.contextMenuNode),this._contextMenuNode=null),f){for(const y of this._selectedNodes)this.selectedDecoration.removeTarget(y);this.focusedNode&&this.focusedDecoration.removeTarget(this.focusedNode),this.selectedDecoration.addTarget(f),this.focusedDecoration.addTarget(f),this._focusedNode=f,this._selectedNodes=[f],a&&((b=this.treeModel)===null||b===void 0||b.dispatchChange())}},this.applyContextMenuDecoration=f=>{this.contextMenuNode&&this.contextMenuDecoration.removeTarget(this.contextMenuNode),this.focusedNode&&(this.focusedDecoration.removeTarget(this.focusedNode),this._focusedNode=null),this.contextMenuDecoration.addTarget(f),this._contextMenuNode=f,this.treeModel.dispatchChange()},this.removeFocusedDecoration=()=>{var f;this.focusedNode&&(this.focusedDecoration.removeTarget(this.focusedNode),(f=this.treeModel)===null||f===void 0||f.dispatchChange()),this._focusedNode=null},this.handleTreeBlur=()=>{this.searchTreeService.contextKey.searchViewFocusedKey.set(!1),this.removeFocusedDecoration()},this.handleTreeFocus=()=>{this.searchTreeService.contextKey.searchViewFocusedKey.set(!0)},this.handleContextMenu=(f,a)=>{if(!a){this.removeFocusedDecoration();return}this.applyContextMenuDecoration(a);const b=this.contextMenuService.createMenu({id:p.MenuId.SearchContext,contextKeyService:this.searchTreeService.contextKey.service}),y=b.getMergedMenuNodes();b.dispose();const{x:A,y:S}=f.nativeEvent;this.ctxMenuRenderer.show({anchor:{x:A,y:S},menuNodes:y,args:[a]})},this.handleItemClick=async(f,a,b=!0)=>{if(this.applyFocusedDecoration(a),l.SearchFileNode.is(a))this.toggleDirectory(a);else if(a.contentResult){const y=a.contentResult;if(this.searchPreferences["search.useReplacePreview"]&&this.searchTreeService.replaceValue){const S=new c.URI(y.fileUri),w=this.toReplaceResource(S);await this.replaceDocumentModelContentProvider.updateContent(w);const T=await this.workbenchEditorService.open(c.URI.from({scheme:"diff",query:c.URI.stringifyQuery({name:(0,c.formatLocalize)("search.fileReplaceChanges",S.displayName,w.displayName),original:S,modified:w})}),{preview:b,supportsRevive:!1});if(T){const I=T.group.currentEditor;I&&I.monacoEditor.revealLineInCenter(y.line)}this.replaceDocumentModelContentProvider.delete(w)}else{const S=new c.URI(y.fileUri),w=await this.workbenchEditorService.open(new c.URI(y.fileUri),{preview:b,focus:!b,range:{startLineNumber:y.line,startColumn:y.matchStart,endLineNumber:y.line,endColumn:y.matchStart+y.matchLength}});w&&!w.resource.deleted&&this.rangeHighlightDecorations.highlightRange(S,new m.Range(y.line,y.matchStart,y.line,y.matchStart+y.matchLength))}}},this.handleItemDoubleClick=(f,a)=>{l.SearchFileNode.is(a)||this.handleItemClick(f,a,!1)},this.toggleDirectory=f=>{f.expanded?this.searchTreeHandle.collapseNode(f):this.searchTreeHandle.expandNode(f)},this._whenReady=this.initTreeModel(),this.addDispose(this.rangeHighlightDecorations)}get onDidUpdateTreeModel(){return this.onDidUpdateTreeModelEmitter.event}get whenReady(){return this._whenReady}get searchTreeHandle(){return this._searchTreeHandle}get decorations(){return this._decorations}get treeModel(){return this._treeModel}get focusedNode(){return this._focusedNode}get selectedNodes(){return this._selectedNodes}get contextMenuNode(){return this._contextMenuNode}async initTreeModel(){const f=await this.searchTreeService.resolveChildren();if(!f)return;const a=f[0];a&&(this._treeModel=this.injector.get(u,[a]),await this._treeModel.ensureReady,this.initDecorations(a),this.disposables.push(this.searchService.onDidChange(()=>{this.searchService.searchResults.size>0?this.searchTreeService.contextKey.hasSearchResults.set(!0):this.searchTreeService.contextKey.hasSearchResults.set(!1),this.refresh()})),this.onDidUpdateTreeModelEmitter.fire(this._treeModel))}initDecorations(f){return this._decorations=new o.DecorationsManager(f),this._decorations.addDecoration(this.selectedDecoration),this._decorations.addDecoration(this.focusedDecoration),this._decorations.addDecoration(this.contextMenuDecoration),this._decorations}handleTreeHandler(f){this._searchTreeHandle=f}async refresh(){await this.whenReady,await this.searchTreeService.viewReady,(0,c.runWhenIdle)(()=>{this.searchTreeService.contextKey&&this.searchTreeService.contextKey.searchViewVisibleKey.get()?this.treeModel.root.refresh():this.treeIsDirty=!0})}collapsedAll(){return this.treeModel.root.collapsedAll()}expandAll(){return this.treeModel.root.expandedAll()}clearSearchResults(){this.searchService.clean(),this.searchService.search()}toReplaceResource(f){return f.withScheme(c.Schemes.internal).withFragment("replacePreview").withQuery(JSON.stringify({scheme:f.scheme}))}activate(){this.searchTreeService.contextKey&&this.searchTreeService.contextKey.searchViewVisibleKey.set(!0),this.treeIsDirty&&(this.refresh(),this.treeIsDirty=!1)}deactivate(){this.searchTreeService.contextKey&&this.searchTreeService.contextKey.searchViewVisibleKey.set(!1)}dispose(){this.disposableCollection.dispose()}};t.SearchModelService=d,n.__decorate([(0,r.Autowired)(_.ISearchTreeService),n.__metadata("design:type",g.SearchTreeService)],d.prototype,"searchTreeService",void 0),n.__decorate([(0,r.Autowired)(_.IContentSearchClientService),n.__metadata("design:type",Object)],d.prototype,"searchService",void 0),n.__decorate([(0,r.Autowired)(v.WorkbenchEditorService),n.__metadata("design:type",v.WorkbenchEditorService)],d.prototype,"workbenchEditorService",void 0),n.__decorate([(0,r.Autowired)(g.ReplaceDocumentModelContentProvider),n.__metadata("design:type",g.ReplaceDocumentModelContentProvider)],d.prototype,"replaceDocumentModelContentProvider",void 0),n.__decorate([(0,r.Autowired)(g.RangeHighlightDecorations),n.__metadata("design:type",g.RangeHighlightDecorations)],d.prototype,"rangeHighlightDecorations",void 0),n.__decorate([(0,r.Autowired)(p.ICtxMenuRenderer),n.__metadata("design:type",p.ICtxMenuRenderer)],d.prototype,"ctxMenuRenderer",void 0),n.__decorate([(0,r.Autowired)(p.AbstractContextMenuService),n.__metadata("design:type",p.AbstractContextMenuService)],d.prototype,"contextMenuService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],d.prototype,"injector",void 0),n.__decorate([(0,r.Autowired)(s.SearchPreferences),n.__metadata("design:type",Object)],d.prototype,"searchPreferences",void 0),t.SearchModelService=d=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],d)},86109:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchContentNode=t.SearchFileNode=t.SearchRoot=void 0;const n=e(97267);class r extends n.CompositeTreeNode{static is(v){return!!v&&!v.parent}constructor(v){super(v,void 0)}get expanded(){return!0}}t.SearchRoot=r;class o extends n.CompositeTreeNode{constructor(v,m,_="",s,g,l,h){super(v,h),this.contentResults=m,this.description=_,this.tooltip=s,this.icon=g,this.resource=l,this.isExpanded=!0}get displayName(){return this.resource.displayName}get badge(){return this.branchSize}get highlight(){return{}}}t.SearchFileNode=o;class c extends n.TreeNode{constructor(v,m,_="",s,g,l){super(v,l),this.contentResult=m,this.description=_,this.highlight=s,this.resource=g}get displayName(){return""}get tooltip(){if(this.description&&this.highlight){const{start:v,end:m}=this.highlight;return`${this.description.slice(0,v)}${this._tree.replaceValue||this.description.slice(v,m)}${this.description.slice(m)}`.slice(0,999)}return""}}t.SearchContentNode=c},92553:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FilterFileWithGlobRelativePath=t.SEARCH_STATE=t.ISearchTreeService=t.IContentSearchClientService=t.DEFAULT_SEARCH_IN_WORKSPACE_LIMIT=t.IContentSearchServer=t.ContentSearchServerPath=void 0,t.anchorGlob=o,t.getRoot=c,t.cutShortSearchResult=p;const n=e(43718);t.ContentSearchServerPath="ContentSearchServerPath",t.IContentSearchServer=Symbol("ContentSearchService"),t.DEFAULT_SEARCH_IN_WORKSPACE_LIMIT=2e3,t.IContentSearchClientService=Symbol("IContentSearchClientService"),t.ISearchTreeService=Symbol("ISearchTreeService");var r;(function(m){m[m.todo=0]="todo",m[m.doing=1]="doing",m[m.done=2]="done",m[m.error=3]="error"})(r||(t.SEARCH_STATE=r={}));function o(m,_){const s=_===!1?"":"**/";return n.strings.startsWith(m,"./")&&(m=m.replace(/^.\//,"")),n.strings.endsWith(m,"/")?`${s}${m}**`:!/[*{(+@!^|?]/.test(m)&&!/\.[A-Za-z0-9]+$/.test(m)?`${s}${m}/**`:n.strings.startsWith(m,s)?m:`${s}${m}`}function c(m,_){let s="";return!m||!_||m.some(g=>{if(_.indexOf(g)===0)return s=g,!0}),s}function p(m){const _=Object.assign({},m),{lineText:s,matchLength:g,matchStart:l}=_,h=500,u=h;if(!s)return _;if(s.length>h){const E=l-20>-1?l-20:0;return _.renderLineText=s.slice(E,E+500),delete _.lineText,_.renderStart=l-E,_.matchLength=g>u?u:g,_}else{const E=l-40>-1?l-40:0;return _.renderLineText=s.slice(E,s.length),delete _.lineText,_.renderStart=l-E,_}}class v{constructor(_,s){this.matcherList=[],!(_.length<1||s.length<1)&&_.forEach(g=>{const l=new n.URI(g);s.forEach(h=>{if(n.strings.startsWith(h,"./")){const u=(0,n.parseGlob)(o(h));h=h.slice(2,h.length);const d=l.resolve(o(h,!1)).path.toString();this.matcherList.push({relative:u,absolute:(0,n.parseGlob)(d)})}})})}test(_){let s=!0;if(this.matcherList.length<1)return s;const g=new n.URI(_).path.toString();return this.matcherList.some(l=>{if(l.relative(g))s=!1;else return;return s=l.absolute(g),s}),s}}t.FilterFileWithGlobRelativePath=v},52925:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(92553),t)},13439:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(52925),t)},97462:(x,t,e)=>{"use strict";var n;n={value:!0},n=t.$h=void 0;const r=e(73827),o=e(32004),c=e(54230),p=e(41869),v=e(33969),m=e(4958),_=e(17242),s=e(57517),g=e(59027),l=e(40731),h=e(38105),u=e(53599),d=e(52568),E=e(96708),f=e(83709),a=e(21774),b=e(83507),y=e(7480),A=e(93374),S=e(99669),w=e(64523),T=e(62663),D=e(72106),I=e(31379),O=e(46608),M=e(89549),R=e(96194),P=e(58408),k=e(96534),F=e(31435),L=e(6556),B=e(16158),j=e(28639),W=e(95737),U=e(17236),Q=e(26874),V=e(7443),$=e(47289),Y=e(40968),z=e(65046),H=e(41103),K=e(7284);t.$h=[y.MainLayoutModule,R.OverlayModule,b.LogModule,p.ClientCommonModule,w.MenuBarModule,T.MonacoModule,B.StatusBarModule,s.EditorModule,g.ExplorerModule,f.FileTreeNextModule,E.FileServiceClientModule,L.SearchModule,d.FileSchemeModule,M.OutputModule,k.QuickOpenModule,S.MarkersModule,V.ThemeModule,H.WorkspaceModule,u.ExtensionStorageModule,j.StorageModule,I.OpenedEditorModule,O.OutlineModule,P.PreferencesModule,$.ToolbarModule,z.WebviewModule,A.MarkdownModule,K.WorkspaceEditModule,F.SCMModule,m.DecorationModule,v.DebugModule,Y.VariableModule,a.KeymapsModule,U.TerminalNextModule,l.ExtensionModule,h.OpenVsxExtensionManagerModule,D.MonacoEnhanceModule,r.ClientAddonModule,c.CommentsModule,W.TaskModule,Q.TestingModule],n=[_.DesignModule,o.AINativeModule]},16158:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatusBarModule=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(26542),p=e(52172),v=e(60643);let m=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:c.IStatusBarService,useClass:v.StatusBarService},p.StatusBarContribution]}};t.StatusBarModule=m,t.StatusBarModule=m=n.__decorate([(0,r.Injectable)()],m)},92237:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatusBarItem=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(97267),p=e(41869),v=e(48560),m=e(43718),_=e(52416),s=n.__importDefault(e(6373)),g=(0,o.memo)(l=>{const h=(0,v.useInjectable)(m.CommandService),u=(0,v.useInjectable)(_.IIconService),{contents:d}=l,E=(0,o.useCallback)(f=>{f&&h.executeCommand(f.id,...f.arguments||[])},[]);return o.default.createElement("div",null,d.map((f,a)=>o.default.createElement("div",{key:`${f.title}-${a}`,className:s.default.popover_content},o.default.createElement("span",null,f.title&&(0,p.transformLabelWithCodicon)(f.title,{},u.fromString.bind(u)),f.name&&` - ${f.name}`),f.command&&o.default.createElement(c.Button,{type:"link",title:f.command.tooltip,onClick:()=>E(f.command)},f.command.title))))});t.StatusBarItem=(0,o.memo)(l=>{const{entryId:h,text:u,onClick:d,tooltip:E,command:f,ariaLabel:a,iconClass:b,className:y,role:A="button",hoverContents:S,color:w,backgroundColor:T,side:D}=l,I=(0,v.useInjectable)(_.IThemeService),O=(0,v.useInjectable)(p.IOpenerService),M=(0,v.useInjectable)(_.IIconService),R=(0,o.useMemo)(()=>!E&&!S,[E,S]),P=(0,o.useMemo)(()=>{if(S)return o.default.createElement(g,{contents:S});if(E&&E.value){const F=(0,p.toMarkdownHtml)(E.value),L=(0,p.transformLabelWithCodiconHtml)(F,M.fromString.bind(M));return(0,p.toMarkdown)(L,O,void 0,!0)}return(0,m.isString)(E)&&o.default.createElement("div",{className:s.default.popover_tooltip},(0,p.transformLabelWithCodicon)(E,{},M.fromString.bind(M)))},[E]),k=F=>{var L,B;return F?(0,m.isThemeColor)(F)?(B=(L=I.getColor(F))===null||L===void 0?void 0:L.toString())!==null&&B!==void 0?B:"":F:""};return o.default.createElement("div",{id:h,className:(0,r.default)(s.default.element,y,{[s.default.hasCommand]:f||d}),onClick:d,style:{color:k(w),backgroundColor:k(T)},"aria-label":a},o.default.createElement(c.Popover,{id:`${h}-popover`,content:P,trigger:c.PopoverTriggerType.hover,delay:.2,position:D==="left"?c.PopoverPosition.topLeft:D==="right"?c.PopoverPosition.topRight:c.PopoverPosition.top,disable:R},o.default.createElement("div",{className:s.default.popover_item},b&&o.default.createElement("span",{key:-1,className:(0,r.default)(s.default.icon,b)}),typeof u=="string"?(0,p.transformLabelWithCodicon)(u,{},M.fromString.bind(M),(F,L)=>o.default.createElement("span",{key:`${F}-${L}`,style:{height:"22px",lineHeight:"22px"},"aria-label":a,role:A},(0,p.replaceLocalizePlaceholder)(F))):u)))})},52172:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatusBarContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(68456),p=e(26542),v=e(67899),m=e(29079);let _=class{registerComponent(g){g.register("@opensumi/ide-status-bar",{component:m.StatusBarView,id:"ide-status-bar"},{size:24})}registerCommands(g){g.registerCommand(p.StatusBarCommand.changeBackgroundColor,{execute:l=>this.statusBarService.setBackgroundColor(l)}),g.registerCommand(p.StatusBarCommand.changeColor,{execute:l=>this.statusBarService.setColor(l)}),g.registerCommand(p.StatusBarCommand.addElement,{execute:(l,h)=>this.statusBarService.addElement(l,h)}),g.registerCommand(p.StatusBarCommand.toggleElement,{execute:l=>{this.statusBarService.toggleElement(l)}})}};t.StatusBarContribution=_,n.__decorate([(0,r.Autowired)(v.IStatusBarService),n.__metadata("design:type",Object)],_.prototype,"statusBarService",void 0),t.StatusBarContribution=_=n.__decorate([(0,o.Domain)(c.ComponentContribution,o.CommandContribution)],_)},60643:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatusBarService=void 0;const n=e(85608),r=e(76003),o=e(40396),c=e(41869),p=e(95416),v=e(93899),m=e(40191),_=e(26542),s=e(43718),g=e(28423);let l=class extends c.Disposable{constructor(){super(...arguments),this.emitter=this.registerDispose(new o.EventEmitter),this.entriesObservable=(0,g.observableValue)(this,new Map),this.disposableCollection=new Map,this.entriesArray=(0,g.derived)(this,u=>{const d=this.entriesObservable.read(u);return Array.from(d.values()).sort((E,f)=>{const a=E.priority||0;return(f.priority||0)-a})}),this.leftEntries=(0,g.derived)(this,u=>this.entriesArray.read(u).filter(E=>!E.hidden&&E.alignment===_.StatusBarAlignment.LEFT)),this.rightEntries=(0,g.derived)(this,u=>this.entriesArray.read(u).filter(E=>!E.hidden&&E.alignment===_.StatusBarAlignment.RIGHT))}getBackgroundColor(){return this.appConfig.extensionDevelopmentHost?"var(--kt-statusBar-extensionDebuggingBackground)":this.background}getColor(){return this.foreground}setBackgroundColor(u){this.background=u,this.emitter.emit("backgroundColor",u)}setColor(u){this.foreground=u,this.emitter.emit("color",u)}getElementConfig(u,d){return d.command&&(d.onClick=this.onclick(d)),d.entryId=u,(0,c.isUndefined)(d.id)&&(d.id=u),d}getEntriesById(u){return this.entriesArray.get().filter(d=>d.id===u)}getStorageState(u){return this.layoutState.getState(p.LAYOUT_STATE.STATUSBAR,{})[u]}setStorageState(u,d){this.layoutState.setState(p.LAYOUT_STATE.STATUSBAR,{...this.layoutState.getState(p.LAYOUT_STATE.STATUSBAR,{}),[u]:d})}addElement(u,d){var E,f,a,b;const y=new s.DisposableCollection;d=this.getElementConfig(u,d);const A=d.id,S=(f=(E=this.getStorageState(A))===null||E===void 0?void 0:E.hidden)!==null&&f!==void 0?f:d.hidden;if(d.hidden=S,d.name&&this.getEntriesById(A).length===0){const T=new m.RawContextKey(`${A}:toggle`,!S);T.bind(this.contextKeyService);const D=d.alignment===_.StatusBarAlignment.LEFT?-1*((a=d.priority)!==null&&a!==void 0?a:0):Number.MAX_SAFE_INTEGER-((b=d.priority)!==null&&b!==void 0?b:0),I=this.menuRegistry.registerMenuItem(v.MenuId.StatusBarContext,{command:{id:_.StatusBarCommand.toggleElement.id,label:d.name},order:D,extraTailArgs:[u],toggledWhen:T.raw});y.push(I)}const w=this.entriesObservable.get();return w.set(u,d),(0,g.transaction)(T=>{this.entriesObservable.set(new Map(w),T)}),y.push(c.Disposable.create(()=>{const T=this.entriesObservable.get();T.delete(u),(0,g.transaction)(D=>{this.entriesObservable.set(new Map(T),D)})})),this.disposableCollection.set(u,y),{dispose:()=>{this.removeElement(u)},update:T=>{this.setElement(u,T)}}}toggleElement(u){const E=this.entriesObservable.get().get(u);if(E?.id){const f=`${E.id}:toggle`,a=!E.hidden;this.contextKeyService.createKey(f,!a),this.setStorageState(E.id,{hidden:a});for(const b of this.getEntriesById(E.id))b.hidden=!b.hidden}}setElement(u,d){const E=this.entriesObservable.get(),f=E.get(u);if(f){const a={...f,...d};E.set(u,this.getElementConfig(u,a)),(0,g.transaction)(b=>{this.entriesObservable.set(new Map(E),b)})}else throw new Error(`not found id is ${u} element`)}removeElement(u){var d;(d=this.disposableCollection.get(u))===null||d===void 0||d.dispose(),this.disposableCollection.delete(u)}onclick(u){return()=>{if(u.command){const d=u.arguments||[];this.commandService.executeCommand(u.command,...d)}}}get contextKeyService(){return this.registerDispose(this.globalContextKeyService.createScoped())}get contextMenu(){return this.registerDispose(this.menuService.createMenu(v.MenuId.StatusBarContext,this.contextKeyService))}};t.StatusBarService=l,n.__decorate([(0,r.Autowired)(s.CommandService),n.__metadata("design:type",Object)],l.prototype,"commandService",void 0),n.__decorate([(0,r.Autowired)(c.AppConfig),n.__metadata("design:type",Object)],l.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(v.IMenuRegistry),n.__metadata("design:type",v.IMenuRegistry)],l.prototype,"menuRegistry",void 0),n.__decorate([(0,r.Autowired)(v.AbstractMenuService),n.__metadata("design:type",v.AbstractMenuService)],l.prototype,"menuService",void 0),n.__decorate([(0,r.Autowired)(c.IContextKeyService),n.__metadata("design:type",Object)],l.prototype,"globalContextKeyService",void 0),n.__decorate([(0,r.Autowired)(p.LayoutState),n.__metadata("design:type",p.LayoutState)],l.prototype,"layoutState",void 0),n.__decorate([s.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],l.prototype,"contextKeyService",null),n.__decorate([s.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],l.prototype,"contextMenu",null),t.StatusBarService=l=n.__decorate([(0,r.Injectable)()],l)},29079:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StatusBarView=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importStar(e(14041)),c=e(41869),p=e(1149),v=e(63373),m=e(93899),_=e(48560),s=e(26542),g=e(92237),l=n.__importDefault(e(6373));t.StatusBarView=(0,o.memo)(()=>{const h=(0,_.useInjectable)(s.IStatusBarService),u=(0,c.useAutorun)(h.leftEntries),d=(0,c.useAutorun)(h.rightEntries),E=(0,_.useInjectable)(m.ICtxMenuRenderer),f=(0,_.useInjectable)(p.LayoutViewSizeConfig),a=(0,c.useEventDrivenState)(h.emitter,"backgroundColor",()=>h.getBackgroundColor()),b=(0,c.useEventDrivenState)(h.emitter,"color",()=>h.getColor()),y=(0,o.useCallback)(A=>{A.preventDefault();const S=(0,m.generateCtxMenu)({menus:h.contextMenu,args:[]});E.show({anchor:{x:A.clientX,y:A.clientY},menuNodes:S[1]})},[]);return o.default.createElement("div",{id:v.VIEW_CONTAINERS.STATUSBAR,className:l.default.statusBar,style:{backgroundColor:a,height:f.statusBarHeight+"px"},onContextMenu:y},o.default.createElement("div",{className:(0,r.default)(l.default.area,l.default.left)},u.length?u.map((A,S)=>o.default.createElement(g.StatusBarItem,{side:"left",key:`${A.entryId}-${S}`,...A,color:b??A.color})):null),o.default.createElement("div",{className:(0,r.default)(l.default.area,l.default.right)},d.length?d.map((A,S)=>o.default.createElement(g.StatusBarItem,{side:"right",key:`${A.entryId}-${S}`,...A,color:b??A.color})):null))}),t.StatusBarView.displayName="StatusBar"},67899:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IStatusBarService=void 0;var n=e(26542);Object.defineProperty(t,"IStatusBarService",{enumerable:!0,get:function(){return n.IStatusBarService}})},40293:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(67899),t)},28639:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StorageModule=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(22992),p=e(2948),v=e(53920),m=e(57919);let _=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:c.IStoragePathServer,useClass:p.StoragePathServer},{token:c.IGlobalStorageServer,useClass:m.GlobalStorageServer},{token:c.IWorkspaceStorageServer,useClass:m.WorkspaceStorageServer},v.DatabaseStorageContribution]}};t.StorageModule=_,t.StorageModule=_=n.__decorate([(0,r.Injectable)()],_)},2948:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StoragePathServer=void 0;const n=e(85608),r=e(76003),o=e(43718),c=e(14951),{Path:p}=o.path;let v=class{constructor(){this.windowsDataFolders=[o.StoragePaths.WINDOWS_APP_DATA_DIR,o.StoragePaths.WINDOWS_ROAMING_DIR],this.ensureStorageDirPromises=new Map,this.init()}async init(){this.deferredWorkspaceStoragePath=new o.Deferred,this.deferredGlobalStoragePath=new o.Deferred,this.workspaceStoragePathInitialized=!1,this.globalStoragePathInitialized=!1,this._userHome=this.getUserHomeDir()}get userHome(){return this._userHome}async ensureStorageDir(_){if(this.ensureStorageDirPromises.has(_))return await this.ensureStorageDirPromises.get(_);const s=this.doEnsureStorageDir(_);return this.ensureStorageDirPromises.set(_,s),await s}async doEnsureStorageDir(_){try{await this.fileSystem.access(_)||await this.fileSystem.createFolder(_)}catch(s){this.logger.error(s)}}async provideWorkspaceStorageDirPath(_){if(this.cachedWorkspaceStoragePath)return this.cachedWorkspaceStoragePath;const s=await this.getBaseStorageDirPath(_),g=o.URI.file(s).resolve(o.StoragePaths.DEFAULT_DATA_DIR_NAME).toString();if(!s)throw new Error("Unable to get parent storage directory");return this.workspaceStoragePathInitialized||await this.ensureStorageDir(g),this.deferredWorkspaceStoragePath.resolve(g),this.workspaceStoragePathInitialized=!0,this.cachedWorkspaceStoragePath=g}async provideGlobalStorageDirPath(_){if(this.cachedGlobalStoragePath)return this.cachedGlobalStoragePath;const s=await this.getBaseStorageDirPath(_),g=o.URI.file(s).toString();if(!s)throw new Error("Unable to get parent storage directory");return this.globalStoragePathInitialized||await this.ensureStorageDir(g),this.deferredGlobalStoragePath.resolve(g),this.globalStoragePathInitialized=!0,this.cachedGlobalStoragePath=g}async getBaseStorageDirPath(_){return await this.getDataDirPath(_)}async getDataDirPath(_){const s=await this.userHome,g=_||o.StoragePaths.DEFAULT_STORAGE_DIR_NAME;return new p(s).join(...o.isWindows?this.windowsDataFolders:[""],g).toString()}async getUserHomeDir(){const _=await this.fileSystem.getCurrentUserHome();if(!_)throw new Error("Unable to get user home directory");return await this.fileSystem.getFsPath(_.uri)||""}async getLastWorkspaceStoragePath(){return this.workspaceStoragePathInitialized?this.cachedWorkspaceStoragePath:this.deferredWorkspaceStoragePath.promise}async getLastGlobalStoragePath(){return this.globalStoragePathInitialized?this.cachedGlobalStoragePath:this.deferredGlobalStoragePath.promise}};t.StoragePathServer=v,n.__decorate([(0,r.Autowired)(c.IFileServiceClient),n.__metadata("design:type",Object)],v.prototype,"fileSystem",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],v.prototype,"logger",void 0),t.StoragePathServer=v=n.__decorate([(0,r.Injectable)(),n.__metadata("design:paramtypes",[])],v)},53920:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DatabaseStorageContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(51500),p=e(22992),v=e(93046);let m=class{constructor(){this.cache=new Map}async resolve(s){const g=s.path.toString();let l;const h=this.cache.get(s.toString());if(h)l=h;else{if(s.scheme===o.STORAGE_SCHEMA.SCOPE)this.isBuiltinStorage(s)?l=new v.Storage(this.workspaceStorage,this.workspaceService,this.appConfig,g,!1,this.scopedLocalStorage):l=new v.Storage(this.workspaceStorage,this.workspaceService,this.appConfig,g,!1);else if(s.scheme===o.STORAGE_SCHEMA.GLOBAL)this.isBuiltinStorage(s)?l=new v.Storage(this.globalStorage,this.workspaceService,this.appConfig,g,!0,this.globalLocalStorage):l=new v.Storage(this.globalStorage,this.workspaceService,this.appConfig,g,!0);else return;this.cache.set(s.toString(),l)}return await l.whenReady,l}isBuiltinStorage(s){const g=Object.keys(o.STORAGE_NAMESPACE);for(const l of g)if(s.isEqual(o.STORAGE_NAMESPACE[l]))return!0;return!1}};t.DatabaseStorageContribution=m,n.__decorate([(0,r.Autowired)(p.IWorkspaceStorageServer),n.__metadata("design:type",Object)],m.prototype,"workspaceStorage",void 0),n.__decorate([(0,r.Autowired)(p.IGlobalStorageServer),n.__metadata("design:type",Object)],m.prototype,"globalStorage",void 0),n.__decorate([(0,r.Autowired)(o.AppConfig),n.__metadata("design:type",Object)],m.prototype,"appConfig",void 0),n.__decorate([(0,r.Autowired)(c.IWorkspaceService),n.__metadata("design:type",Object)],m.prototype,"workspaceService",void 0),n.__decorate([(0,r.Autowired)(o.GlobalBrowserStorageService),n.__metadata("design:type",o.GlobalBrowserStorageService)],m.prototype,"globalLocalStorage",void 0),n.__decorate([(0,r.Autowired)(o.ScopedBrowserStorageService),n.__metadata("design:type",o.ScopedBrowserStorageService)],m.prototype,"scopedLocalStorage",void 0),t.DatabaseStorageContribution=m=n.__decorate([(0,o.Domain)(o.StorageResolverContribution)],m)},93046:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Storage=void 0;const n=e(43718);var r;(function(c){c[c.None=0]="None",c[c.Initialized=1]="Initialized",c[c.Closed=2]="Closed"})(r||(r={}));class o{constructor(p,v,m,_,s=!0,g){this.database=p,this.workspace=v,this.appConfig=m,this.storageName=_,this.isGlobal=s,this.browserLocalStorage=g,this._onDidChangeStorage=new n.Emitter,this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=r.None,this.cache=new Map,this.pendingDeletes=new Set,this.pendingInserts=new Map,this.toDisposableCollection=new n.DisposableCollection,this.logger=(0,n.getDebugLogger)(),this.readyDeferred=new n.Deferred,this.whenReadyToWriteDeferred=new n.Deferred,this.toDisposableCollection.push(this._onDidChangeStorage),this.flushDelayer=new n.ThrottledDelayer(o.DEFAULT_FLUSH_DELAY),this.init(_).then(()=>{this.toDisposableCollection.push(this.workspace.onWorkspaceChanged(()=>{this.init(_)}))})}get whenReady(){return this.readyDeferred.promise}get whenReadyToWrite(){return this.whenReadyToWriteDeferred.promise}get items(){return this.cache}get size(){return this.cache.size}async init(p){var v;const m=((v=this.workspace.workspace)===null||v===void 0?void 0:v.uri)||n.URI.file(this.appConfig.workspaceDir).toString();let _;this.browserLocalStorage&&(_=await this.browserLocalStorage.getData(p)),_?this.database.init(this.appConfig.storageDirName,this.isGlobal?void 0:m).then(()=>{this.database.getItems(p).then(async s=>{var g;this.cache=this.jsonToMap(s),(g=this.browserLocalStorage)===null||g===void 0||g.setData(p,s),this.whenReadyToWriteDeferred.resolve()})}):(await this.database.init(this.appConfig.storageDirName,this.isGlobal?void 0:m),_=await this.database.getItems(p),this.browserLocalStorage&&this.browserLocalStorage.setData(p,_),this.whenReadyToWriteDeferred.resolve()),this.cache=this.jsonToMap(_),this.state=r.Initialized,this.readyDeferred.resolve()}async reConnectInit(){this.readyDeferred=new n.Deferred,this.init(this.storageName)}dispose(){this.toDisposableCollection.dispose()}get(p,v){let m=this.cache.get(p);if((0,n.isUndefinedOrNull)(m))return v;try{m=JSON.parse(m)}catch(_){this.logger.error("Could not parse value: ",m,_)}return m}getBoolean(p,v){const m=this.get(p);return(0,n.isUndefinedOrNull)(m)?v:m==="true"}getNumber(p,v){const m=this.get(p);return(0,n.isUndefinedOrNull)(m)?v:parseInt(m,10)}set(p,v){if(this.state===r.Closed)return Promise.resolve();if((0,n.isUndefinedOrNull)(v))return this.delete(p);const m=JSON.stringify(v);return this.cache.get(p)===m?Promise.resolve():(this.cache.set(p,m),this.pendingInserts.set(p,m),this.pendingDeletes.delete(p),this._onDidChangeStorage.fire(p),this.flushDelayer.trigger(()=>this.flushPending()))}delete(p){return this.state===r.Closed||!this.cache.delete(p)?Promise.resolve():(this.pendingDeletes.has(p)||this.pendingDeletes.add(p),this.pendingInserts.delete(p),this._onDidChangeStorage.fire(p),this.flushDelayer.trigger(()=>this.flushPending()))}async close(){if(this.state===r.Closed)return Promise.resolve();this.state=r.Closed;try{await this.flushDelayer.trigger(()=>this.flushPending(),0)}catch{}await this.database.close(()=>this.cache)}async flushPending(){if(await this.whenReadyToWrite,this.pendingInserts.size===0&&this.pendingDeletes.size===0)return Promise.resolve();const p={insert:this.mapToJson(this.pendingInserts),delete:Array.from(this.pendingDeletes)};if(this.browserLocalStorage){let v=this.mapToJson(this.cache);for(const m of p?.delete||[])delete v[m];v={...v,...p.insert},this.browserLocalStorage.setData(this.storageName,v)}return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(this.storageName,p)}mapToJson(p){const v=Object.create(null);for(const[m,_]of p)v[m]=_;return v}jsonToMap(p){if(typeof p=="string")try{p=JSON.parse(p)}catch(m){return this.logger.debug(m),p}const v=new Map;for(const m of Object.keys(p))v.set(m,p[m]);return v}}t.Storage=o,o.DEFAULT_FLUSH_DELAY=200},57919:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalStorageServer=t.WorkspaceStorageServer=t.StorageServer=void 0;const n=e(85608),r=e(76003),o=e(43718),c=e(14951),p=e(22992),{Path:v}=o.path;let m=class{constructor(){this.storageExistPromises=new Map,this._cache={},this.onDidChangeEmitter=new o.Emitter,this.onDidChange=this.onDidChangeEmitter.event}async close(l){}async asAccess(l,h){if(h)return await this.fileSystem.access(l);if(!this.storageExistPromises.has(l)){const u=this.fileSystem.access(l);this.storageExistPromises.set(l,u)}return await this.storageExistPromises.get(l)}async setupDirectories(l,h){if(!this.deferredStorageDirPath){this.deferredStorageDirPath=new o.Deferred;let u;l===o.STORAGE_SCHEMA.GLOBAL?u=this.dataStoragePathServer.provideGlobalStorageDirPath:u=this.dataStoragePathServer.provideWorkspaceStorageDirPath;const d=await u.apply(this.dataStoragePathServer,[h]);return this.deferredStorageDirPath.resolve(d),this.databaseStorageDirPath=d,d}return this.databaseStorageDirPath}async getStoragePath(l,h){this.databaseStorageDirPath||await this.deferredStorageDirPath.promise;const u=h.indexOf(v.separator)>=0;let d;l===o.STORAGE_SCHEMA.GLOBAL?d=this.dataStoragePathServer.getLastGlobalStoragePath:d=this.dataStoragePathServer.getLastWorkspaceStoragePath;const E=await d.apply(this.dataStoragePathServer);if(u){const f=new v(h);h=f.name;const a=new o.URI(E).resolve(f.dir).toString();return await this.fileSystem.access(a)||await this.fileSystem.createFolder(a),E?new o.URI(a).resolve(`${h}.json`).toString():void 0}return E?new o.URI(E).resolve(`${h}.json`).toString():void 0}};t.StorageServer=m,n.__decorate([(0,r.Autowired)(c.IFileServiceClient),n.__metadata("design:type",Object)],m.prototype,"fileSystem",void 0),n.__decorate([(0,r.Autowired)(p.IStoragePathServer),n.__metadata("design:type",Object)],m.prototype,"dataStoragePathServer",void 0),n.__decorate([(0,r.Autowired)(o.ILogger),n.__metadata("design:type",Object)],m.prototype,"logger",void 0),t.StorageServer=m=n.__decorate([(0,r.Injectable)()],m);let _=class extends m{constructor(){super(...arguments),this.readyDeferred=new o.Deferred}get whenReady(){return this.readyDeferred.promise}async init(l,h){return this.workspaceNamespace=h,await this.setupDirectories(o.STORAGE_SCHEMA.SCOPE,l)}async getItems(l){if(this._cache[l])return this._cache[l];let h={};const u=this.workspaceNamespace,d=await this.getStoragePath(o.STORAGE_SCHEMA.SCOPE,l);if(!d)this.logger.error(`Storage [${l}] is invalid.`);else{const E=new o.URI(d).toString();if(await this.asAccess(E,!0)){const f=await this.fileSystem.readFile(E);try{h=JSON.parse(f.content.toString())}catch(a){this.logger.error(`Storage [${l}] content can not be parse with path ${E}. Error: ${a.stack}`),h={}}}}return this._cache[l]=h,u&&(h=h[u]||{}),this.readyDeferred.resolve(),h}async updateItems(l,h){await this.whenReady;let u={};const d=this.workspaceNamespace;this._cache[l]?u=this._cache[l]:(u=await this.getItems(l),d&&(u=u[d])),h.insert&&(d?u[d]={...u[d],...h.insert}:u={...u,...h.insert}),h.delete&&h.delete.length>0&&new Set(h.delete).forEach(a=>{d?u[d][a]&&delete u[d][a]:u[a]&&delete u[a]}),this._cache[l]=u;const E=await this.getStoragePath(o.STORAGE_SCHEMA.SCOPE,l);if(E){const f=new o.URI(E).toString();let a=await this.fileSystem.getFileStat(f);a||(a=await this.fileSystem.createFile(f)),await this.fileSystem.setContent(a,JSON.stringify(u));const b={path:a.uri,data:JSON.stringify(u)};this.onDidChangeEmitter.fire(b)}}};t.WorkspaceStorageServer=_,t.WorkspaceStorageServer=_=n.__decorate([(0,r.Injectable)()],_);let s=class extends m{constructor(){super(...arguments),this.readyDeferred=new o.Deferred}get whenReady(){return this.readyDeferred.promise}async init(l){return await this.setupDirectories(o.STORAGE_SCHEMA.GLOBAL,l)}async getItems(l){if(this._cache[l])return this._cache[l];let h={};const u=await this.getStoragePath(o.STORAGE_SCHEMA.GLOBAL,l);if(!u)this.logger.error(`Storage [${l}] is invalid.`);else{const d=new o.URI(u).toString();if(await this.asAccess(d,!0)){const E=await this.fileSystem.readFile(d);try{h=JSON.parse(E.content.toString())}catch(f){this.logger.error(`Storage [${l}] content can not be parse. Error: ${f.stack}`),h={}}}}return this._cache[l]=h,this.readyDeferred.resolve(),h}async updateItems(l,h){await this.whenReady;let u={};this._cache[l]?u=this._cache[l]:u=await this.getItems(l),h.insert&&(u={...u,...h.insert}),h.delete&&h.delete.length>0&&new Set(h.delete).forEach(f=>{u[f]&&delete u[f]}),this._cache[l]=u;const d=await this.getStoragePath(o.STORAGE_SCHEMA.GLOBAL,l);if(d){let E=await this.fileSystem.getFileStat(d);E||(E=await this.fileSystem.createFile(d,{content:""})),await this.fileSystem.setContent(E,JSON.stringify(u));const f={path:E.uri,data:JSON.stringify(u)};this.onDidChangeEmitter.fire(f)}}};t.GlobalStorageServer=s,t.GlobalStorageServer=s=n.__decorate([(0,r.Injectable)()],s)},22992:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=e(85608);n.__exportStar(e(62025),t),n.__exportStar(e(5597),t)},5597:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IStoragePathServer=void 0,t.IStoragePathServer=Symbol("IStoragePathServer")},62025:(x,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IGlobalStorageServer=t.IWorkspaceStorageServer=void 0,t.IWorkspaceStorageServer="IWorkspaceStorageServer",t.IGlobalStorageServer="IGlobalStorageServer"},95737:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TaskModule=void 0;const n=e(85608),r=e(76003),o=e(41869),c=e(91825),p=e(93950),v=e(27347),m=e(41824),_=e(77554),s=e(95521),g=e(66893);let l=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[_.TaskContribution,v.TaskPreferencesContribution,{token:c.FolderFilePreferenceProvider,useClass:m.TaskFolderPreferenceProvider,dropdownForTag:!0,tag:"tasks"},{token:p.ITaskService,useClass:s.TaskService},{token:p.ITaskSystem,useClass:g.TerminalTaskSystem}]}};t.TaskModule=l,t.TaskModule=l=n.__decorate([(0,r.Injectable)()],l)},17654:(x,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProblemMatcherParser=t.ProblemPatternParser=t.Config=t.Parser=t.ValidationStatus=void 0;const n=e(43718),{deepClone:r}=n.objects;class o{constructor(){this._state=0}get state(){return this._state}set state(s){s>this._state&&(this._state=s)}isOK(){return this._state===0}isFatal(){return this._state===4}}t.ValidationStatus=o;class c{constructor(s){this._problemReporter=s}reset(){this._problemReporter.status.state=0}get problemReporter(){return this._problemReporter}info(s){this._problemReporter.info(s)}warn(s){this._problemReporter.warn(s)}error(s){this._problemReporter.error(s)}fatal(s){this._problemReporter.fatal(s)}}t.Parser=c;var p;(function(_){let s;(function(f){function a(b){const y=b;return y&&(0,n.isString)(y.regexp)}f.is=a})(s=_.CheckedProblemPattern||(_.CheckedProblemPattern={}));let g;(function(f){function a(b){const y=b;return y&&(0,n.isString)(y.name)}f.is=a})(g=_.NamedProblemPattern||(_.NamedProblemPattern={}));let l;(function(f){function a(b){const y=b;return y&&g.is(y)&&(0,n.isString)(y.regexp)}f.is=a})(l=_.NamedCheckedProblemPattern||(_.NamedCheckedProblemPattern={}));let h;(function(f){function a(b){return b&&(0,n.isArray)(b)}f.is=a})(h=_.MultiLineProblemPattern||(_.MultiLineProblemPattern={}));let u;(function(f){function a(b){if(!h.is(b))return!1;for(const y of b)if(!_.CheckedProblemPattern.is(y))return!1;return!0}f.is=a})(u=_.MultiLineCheckedProblemPattern||(_.MultiLineCheckedProblemPattern={}));let d;(function(f){function a(b){const y=b;return y&&(0,n.isString)(y.name)&&(0,n.isArray)(y.patterns)&&u.is(y.patterns)}f.is=a})(d=_.NamedMultiLineCheckedProblemPattern||(_.NamedMultiLineCheckedProblemPattern={}));function E(f){return(0,n.isString)(f.name)}_.isNamedProblemMatcher=E})(p||(t.Config=p={}));class v extends c{constructor(s){super(s)}parse(s){if(p.NamedMultiLineCheckedProblemPattern.is(s))return this.createNamedMultiLineProblemPattern(s);if(p.MultiLineCheckedProblemPattern.is(s))return this.createMultiLineProblemPattern(s);if(p.NamedCheckedProblemPattern.is(s)){const g=this.createSingleProblemPattern(s);return g.name=s.name,g}else return p.CheckedProblemPattern.is(s)?this.createSingleProblemPattern(s):(this.error((0,n.localize)("ProblemPatternParser.problemPattern.missingRegExp","The problem pattern is missing a regular expression.")),null)}createSingleProblemPattern(s){const g=this.doCreateSingleProblemPattern(s,!0);return g===void 0?null:(g.kind===void 0&&(g.kind=n.ProblemLocationKind.Location),this.validateProblemPattern([g])?g:null)}createNamedMultiLineProblemPattern(s){const g=this.createMultiLineProblemPattern(s.patterns);return g?{name:s.name,label:s.label?s.label:s.name,patterns:g}:null}createMultiLineProblemPattern(s){const g=[];for(let l=0;l<s.length;l++){const h=this.doCreateSingleProblemPattern(s[l],!1);if(h===void 0)return null;l<s.length-1&&!(0,n.isUndefined)(h.loop)&&h.loop&&(h.loop=!1,this.error((0,n.localize)("ProblemPatternParser.loopProperty.notLast","The loop property is only supported on the last line matcher."))),g.push(h)}return g[0].kind===void 0&&(g[0].kind=n.ProblemLocationKind.Location),this.validateProblemPattern(g)?g:null}doCreateSingleProblemPattern(s,g){const l=this.createRegularExpression(s.regexp);if(l===void 0)return;let h={regexp:l};s.kind&&(h.kind=n.ProblemLocationKind.fromString(s.kind));function u(d,E,f,a){const b=E[a];typeof b=="number"&&(d[f]=b)}if(u(h,s,"file","file"),u(h,s,"location","location"),u(h,s,"line","line"),u(h,s,"character","column"),u(h,s,"endLine","endLine"),u(h,s,"endCharacter","endColumn"),u(h,s,"severity","severity"),u(h,s,"code","code"),u(h,s,"message","message"),(s.loop===!0||s.loop===!1)&&(h.loop=s.loop),g)if(h.location||h.kind===n.ProblemLocationKind.File){const d={file:1,message:0};h=(0,n.mixin)(h,d,!1)}else{const d={file:1,line:2,character:3,message:0};h=(0,n.mixin)(h,d,!1)}return h}validateProblemPattern(s){let g=!1,l=!1,h=!1,u=!1;const d=s[0].kind===void 0?n.ProblemLocationKind.Location:s[0].kind;return s.forEach((E,f)=>{f!==0&&E.kind&&this.error((0,n.localize)("ProblemPatternParser.problemPattern.kindProperty.notFirst","The problem pattern is invalid. The kind property must be provided only in the first element")),g=g||!(0,n.isUndefined)(E.file),l=l||!(0,n.isUndefined)(E.message),h=h||!(0,n.isUndefined)(E.location),u=u||!(0,n.isUndefined)(E.line)}),g&&l?d===n.ProblemLocationKind.Location&&!(h||u)?(this.error((0,n.localize)("ProblemPatternParser.problemPattern.missingLocation",'The problem pattern is invalid. It must either have kind: "file" or have a line or location match group.')),!1):!0:(this.error((0,n.localize)("ProblemPatternParser.problemPattern.missingProperty","The problem pattern is invalid. It must have at least have a file and a message.")),!1)}createRegularExpression(s){let g;try{g=new RegExp(s)}catch{this.error((0,n.localize)("ProblemPatternParser.invalidRegexp",`Error: The string {0} is not a valid regular expression.
31945
31945
  `,s))}return g}}t.ProblemPatternParser=v;class m extends c{constructor(s){super(s)}parse(s,g,l){const h=this.createProblemMatcher(s,g,l);if(this.checkProblemMatcherValid(s,h))return this.addWatchingMatcher(s,h),h}checkProblemMatcherValid(s,g){return g?g.pattern?g.owner?(0,n.isUndefined)(g.fileLocation)?(this.error((0,n.localize)("ProblemMatcherParser.noFileLocation",`Error: the description doesn't define a file location:
31946
31946
  {0}
31947
31947
  `,JSON.stringify(s,null,4))),!1):!0:(this.error((0,n.localize)("ProblemMatcherParser.noOwner",`Error: the description doesn't define an owner:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensumi/cli-engine",
3
- "version": "3.8.3-next-1743422663.0",
3
+ "version": "3.8.3-next-1743493833.0",
4
4
  "description": "Integration engine runtime for opensumi-cli and opensumi extension",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -26,14 +26,14 @@
26
26
  "dependencies": {
27
27
  "@koa/cors": "^5.0.0",
28
28
  "@opensumi/di": "^1.8.0",
29
- "@opensumi/ide-core-browser": "3.8.3-next-1743422663.0",
30
- "@opensumi/ide-core-common": "3.8.3-next-1743422663.0",
31
- "@opensumi/ide-core-node": "3.8.3-next-1743422663.0",
32
- "@opensumi/ide-express-file-server": "3.8.3-next-1743422663.0",
33
- "@opensumi/ide-extension": "3.8.3-next-1743422663.0",
34
- "@opensumi/ide-i18n": "3.8.3-next-1743422663.0",
35
- "@opensumi/ide-main-layout": "3.8.3-next-1743422663.0",
36
- "@opensumi/ide-startup": "3.8.3-next-1743422663.0",
29
+ "@opensumi/ide-core-browser": "3.8.3-next-1743493833.0",
30
+ "@opensumi/ide-core-common": "3.8.3-next-1743493833.0",
31
+ "@opensumi/ide-core-node": "3.8.3-next-1743493833.0",
32
+ "@opensumi/ide-express-file-server": "3.8.3-next-1743493833.0",
33
+ "@opensumi/ide-extension": "3.8.3-next-1743493833.0",
34
+ "@opensumi/ide-i18n": "3.8.3-next-1743493833.0",
35
+ "@opensumi/ide-main-layout": "3.8.3-next-1743493833.0",
36
+ "@opensumi/ide-startup": "3.8.3-next-1743493833.0",
37
37
  "chalk": "^4.1.2",
38
38
  "ejs": "^3.1.7",
39
39
  "ip": "^1.1.8",
@@ -72,5 +72,5 @@
72
72
  "webpack": "^5.90.0",
73
73
  "webpack-cli": "^5.1.4"
74
74
  },
75
- "gitHead": "ed5280be9fdee6af885db78d980e118698281934"
75
+ "gitHead": "58f75a1976ad08a2945cf9a471f5f77daf229235"
76
76
  }