@opensumi/cli-engine 3.1.5-next-1720162510.0 → 3.1.5-next-1720167024.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.
- package/lib/browser/browser.js +1 -1
- package/package.json +10 -10
package/lib/browser/browser.js
CHANGED
|
@@ -28189,7 +28189,7 @@ body.vscode-high-contrast #scroll-to-top:hover {
|
|
|
28189
28189
|
`),this.eventBus.fire(new b.ContentChangeEvent(new b.ContentChangeEventPayload(this.name,b.ContentChangeType.appendLine,h,this.outputLines))),this.doAppend(d(h)),this.shouldLogToBrowser&&console.log(`%c[${this.name}]%c ${c}}`,"background:rgb(50, 150, 250); color: #fff","background: none; color: inherit")}replace(c){this.outputLines=[],this.modelReady.promise.then(()=>this.monacoModel.setValue("")),this.append(c)}clear(){this.outputLines=[],this.modelReady.promise.then(()=>this.monacoModel.setValue((0,g.localize)("output.channel.none","\u8FD8\u6CA1\u6709\u4EFB\u4F55\u8F93\u51FA"))),this.eventBus.fire(new b.ContentChangeEvent(new b.ContentChangeEventPayload(this.name,b.ContentChangeType.appendLine,"",this.outputLines)))}setVisibility(c){if(this.visible=c,c){const h=this.layoutService.getTabbarHandler(I.OUTPUT_CONTAINER_ID);if(!h)return;h.isVisible||h.activate()}}async setLanguageId(c){await this.modelReady.promise,this.outputModel.instance.languageId=c}get isVisible(){return this.visible}};n.__decorate([(0,a.Autowired)(G.IMainLayoutService),n.__metadata("design:type",Object)],l.prototype,"layoutService",void 0),n.__decorate([(0,a.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],l.prototype,"preferenceService",void 0),n.__decorate([(0,a.Autowired)(m.OutputPreferences),n.__metadata("design:type",Object)],l.prototype,"outputPreferences",void 0),n.__decorate([(0,a.Autowired)(u.IEditorDocumentModelService),n.__metadata("design:type",Object)],l.prototype,"documentService",void 0),n.__decorate([(0,a.Autowired)(g.IEventBus),n.__metadata("design:type",Object)],l.prototype,"eventBus",void 0),l=n.__decorate([(0,a.Injectable)({multiple:!0}),n.__param(0,(0,a.Optional)()),n.__metadata("design:paramtypes",[String])],l),e.OutputChannel=l},83145:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OutputService=void 0;const n=t(85608),a=t(83794),o=t(76003),I=t(41869),g=t(43718),u=t(57517),G=t(56285);let p=class extends g.WithEventBus{get onDidSelectedChannelChange(){return this.onDidSelectedChannelChangeEmitter.event}constructor(){super(),this.channels=a.observable.map(),this.onDidSelectedChannelChangeEmitter=new g.Emitter,this.keys=""+Math.random(),this.autoReveal=!0,this.enableSmartScroll=!0,(0,a.makeObservable)(this),this.enableSmartScroll=!!this.preferenceService.get("output.enableSmartScroll"),this.addDispose(this.preferenceService.onPreferenceChanged(m=>{m.preferenceName==="output.enableSmartScroll"&&m.newValue!==this.enableSmartScroll&&(this.enableSmartScroll=m.newValue)}))}updateSelectedChannel(m){this.monacoDispose&&this.monacoDispose.dispose(),this.selectedChannel=m,this.onDidSelectedChannelChangeEmitter.fire(m),this.selectedChannel.modelReady.promise.then(()=>{var d,r;const l=this.selectedChannel.outputModel.instance.getMonacoModel();(d=this.outputEditor)===null||d===void 0||d.open(this.selectedChannel.outputModel),this.enableSmartScroll&&((r=this.outputEditor)===null||r===void 0||r.monacoEditor.revealLine(l.getLineCount()),this.autoReveal=!0),this.monacoDispose=l.onDidChangeContent(()=>{var s;this.autoReveal&&this.enableSmartScroll&&((s=this.outputEditor)===null||s===void 0||s.monacoEditor.revealLine(l.getLineCount(),0))})})}set viewHeight(m){this._viewHeight=m}get viewHeight(){return this._viewHeight}getChannel(m){const d=this.channels.get(m);if(d)return d;const r=this.config.injector.get(G.OutputChannel,[m]);return this.channels.set(m,r),this.channels.size===1&&this.updateSelectedChannel(r),r}deleteChannel(m){this.channels.delete(m)}getChannels(){return Array.from(this.channels.values())}async initOutputMonacoInstance(m){this.outputEditor&&this.outputEditor.dispose(),this.outputEditor=this.editorCollectionService.createCodeEditor(m,Object.assign(Object.assign({},(0,u.getSimpleEditorOptions)()),{lineDecorationsWidth:20,automaticLayout:!0,readOnly:!0,domReadOnly:!0,extraEditorClassName:"kt-output-monaco",scrollbar:{useShadows:!1}})),this.selectedChannel&&this.updateSelectedChannel(this.selectedChannel),this.addDispose(this.outputEditor.monacoEditor.onMouseUp(d=>{var r,l;if(this.enableSmartScroll){const{range:s}=d.target,c=(l=(r=this.outputEditor)===null||r===void 0?void 0:r.currentDocumentModel)===null||l===void 0?void 0:l.getMonacoModel().getLineCount();s?.startLineNumber<c&&(this.autoReveal=!1),s?.startLineNumber>=c&&(this.autoReveal=!0)}}))}};n.__decorate([(0,o.Autowired)(I.AppConfig),n.__metadata("design:type",Object)],p.prototype,"config",void 0),n.__decorate([(0,o.Autowired)(u.EditorCollectionService),n.__metadata("design:type",u.EditorCollectionService)],p.prototype,"editorCollectionService",void 0),n.__decorate([(0,o.Autowired)(u.IEditorDocumentModelService),n.__metadata("design:type",Object)],p.prototype,"documentService",void 0),n.__decorate([(0,o.Autowired)(I.PreferenceService),n.__metadata("design:type",Object)],p.prototype,"preferenceService",void 0),n.__decorate([a.observable.shallow,n.__metadata("design:type",Object)],p.prototype,"channels",void 0),n.__decorate([a.observable,n.__metadata("design:type",String)],p.prototype,"keys",void 0),n.__decorate([a.observable,n.__metadata("design:type",String)],p.prototype,"_viewHeight",void 0),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[String]),n.__metadata("design:returntype",G.OutputChannel)],p.prototype,"getChannel",null),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[String]),n.__metadata("design:returntype",void 0)],p.prototype,"deleteChannel",null),p=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],p),e.OutputService=p},12481:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ChannelSelector=e.Output=void 0;const n=t(85608),a=t(25150),o=n.__importStar(t(14041)),I=t(97267),g=t(41869),u=t(30144),G=t(77331),p=t(72260),b=n.__importDefault(t(33395)),m=t(83145);e.Output=(0,a.observer)(({viewState:d})=>{const r=(0,g.useInjectable)(m.OutputService),l=(0,o.useRef)(null),s=(0,g.useInjectable)(p.IMainLayoutService);return(0,o.useEffect)(()=>{r.viewHeight=String(d.height)},[d.height]),(0,o.useEffect)(()=>{if(l.current){const c=s.getTabbarHandler(u.OUTPUT_CONTAINER_ID);if(c?.isActivated())r.initOutputMonacoInstance(l.current);else{const h=c?.onActivate(()=>{r.initOutputMonacoInstance(l.current),h?.dispose()})}}},[]),o.default.createElement(o.default.Fragment,null,o.default.createElement("div",{className:b.default.output,ref:l}))}),e.ChannelSelector=(0,a.observer)(()=>{const d="<no channels>",r=(0,g.useInjectable)(g.AppConfig),l=(0,g.useInjectable)(m.OutputService),s=[],[c,h]=o.default.useState("");l.getChannels().forEach((f,W)=>{s.push(r.isElectronRenderer?o.default.createElement("option",{value:f.name,key:`${W} - ${f.name}`},f.name):o.default.createElement(I.Option,{value:f.name,key:`${W} - ${f.name}`},f.name))}),(0,o.useEffect)(()=>{const f=l.onDidSelectedChannelChange(W=>{h(W.name)});return()=>{f.dispose()}},[]),s.length===0&&s.push(r.isElectronRenderer?o.default.createElement("option",{key:d,value:d},d):o.default.createElement(I.Option,{key:d,value:d},d));async function v(f){let W;typeof f=="object"?W=f.target.value:W=f,W!==d&&l.updateSelectedChannel(l.getChannel(W))}return r.isElectronRenderer?o.default.createElement(G.Select,{value:c||d,onChange:v},s):o.default.createElement(I.Select,{value:c||d,className:b.default.select,size:"small",maxHeight:l.viewHeight,onChange:v},s)})},69178:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContentChangeEvent=e.ContentChangeEventPayload=e.ContentChangeType=void 0;const n=t(43718);var a;(function(g){g[g.appendLine=0]="appendLine",g[g.append=1]="append",g[g.clear=2]="clear"})(a=e.ContentChangeType||(e.ContentChangeType={}));class o{constructor(u,G,p,b){this.channelName=u,this.changeType=G,this.value=p,this.lines=b}}e.ContentChangeEventPayload=o;class I extends n.BasicEvent{}e.ContentChangeEvent=I},31388:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BrowserCtxMenuService=void 0;const n=t(85608),a=t(83794),o=t(76003);let I=class{constructor(){this.visible=!1,this.onHide=void 0,this.point=void 0,this.context=void 0,this.menuNodes=a.observable.array([]),(0,a.makeObservable)(this)}show(u){const{anchor:G,onHide:p,args:b,menuNodes:m}=u;if(!Array.isArray(m)||!m.length)return;this.context=b,this.menuNodes.splice(0,this.menuNodes.length,...m);const{x:d,y:r}=G instanceof window.MouseEvent?{x:G.clientX,y:G.clientY}:G;this.onHide=p,this.point={pageX:d,pageY:r},this.visible=!0}hide(u){typeof this.onHide=="function"&&this.onHide(u),this.reset()}reset(){this.visible=!1}};n.__decorate([a.observable,n.__metadata("design:type",Object)],I.prototype,"visible",void 0),n.__decorate([a.observable,n.__metadata("design:type",Object)],I.prototype,"onHide",void 0),n.__decorate([a.observable,n.__metadata("design:type",Object)],I.prototype,"point",void 0),n.__decorate([a.observable,n.__metadata("design:type",Object)],I.prototype,"context",void 0),n.__decorate([a.observable,n.__metadata("design:type",Array)],I.prototype,"menuNodes",void 0),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[Object]),n.__metadata("design:returntype",void 0)],I.prototype,"show",null),n.__decorate([a.action.bound,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[Boolean]),n.__metadata("design:returntype",void 0)],I.prototype,"hide",null),n.__decorate([a.action.bound,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",void 0)],I.prototype,"reset",null),I=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],I),e.BrowserCtxMenuService=I},5454:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CtxMenu=void 0;const n=t(85608),a=t(25150),o=n.__importDefault(t(14041)),I=n.__importDefault(t(26737)),g=t(97267),u=t(41869),G=t(25918),p=n.__importDefault(t(17647)),b=t(97222),m=t(42912);t(34728),e.CtxMenu=(0,a.observer)(()=>{const d=(0,u.useInjectable)(b.IBrowserCtxMenu),r=(0,u.useInjectable)(m.IIconService),l=o.default.useCallback(()=>{d.hide(!1)},[]),s=o.default.useCallback(()=>{d.visible&&d.hide(!0)},[d.visible]);return o.default.createElement(I.default,{popupPlacement:"bottomLeft",popupVisible:d.visible,action:["contextMenu"],popupAlign:{overflow:{adjustX:1,adjustY:1},offset:[window.scrollX,window.scrollY]},point:d.point||{},popupClassName:"point-popup",builtinPlacements:p.default,popup:o.default.createElement(g.ClickOutside,{mouseEvents:["click","contextmenu"],onOutsideClick:s},o.default.createElement(G.MenuActionList,{data:d.menuNodes,afterClick:l,context:d.context,iconService:r,renderSubMenuTitle:d.renderSubMenuTitle,renderMenuItem:d.renderMenuItem})),alignPoint:!0})}),e.CtxMenu.displayName="CtxMenu"},54490:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DialogContextKey=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(20162);let g=class{constructor(){this._contextKeyService=this.globalContextKeyService,this.dialogViewVisibleContext=I.DialogViewVisibleContext.bind(this._contextKeyService)}};n.__decorate([(0,a.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],g.prototype,"globalContextKeyService",void 0),g=n.__decorate([(0,a.Injectable)(),n.__metadata("design:paramtypes",[])],g),e.DialogContextKey=g},73618:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DialogContribution=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(20162),g=t(25751);let u=class{registerCommands(p){p.registerCommand({id:o.DIALOG_COMMANDS.ENSURE.id,label:(0,o.localize)("dialog.ensure")},{execute:()=>{const b=this.dialogService.getButtons();this.dialogService.hide(b?.[b.length-1])}})}registerKeybindings(p){p.registerKeybinding({command:o.DIALOG_COMMANDS.ENSURE.id,keybinding:"enter",when:`${I.DialogViewVisibleContext.raw}`})}};n.__decorate([(0,a.Autowired)(g.IDialogService),n.__metadata("design:type",Object)],u.prototype,"dialogService",void 0),u=n.__decorate([(0,o.Domain)(o.CommandContribution,o.KeybindingContribution)],u),e.DialogContribution=u},16417:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DialogService=void 0;const n=t(85608),a=t(76003),o=t(43718),I=t(25751),g=t(54490);let u=class extends I.AbstractMessageService{constructor(){super(...arguments),this._visible=!1,this.message="",this.title="",this.closable=!0,this.props={},this.onDidDialogVisibleChangeEmitter=new o.Emitter}get onDidDialogVisibleChange(){return this.onDidDialogVisibleChangeEmitter.event}get visible(){return this._visible}open(p,b,m,d=!0,r,l){return this.deferred=new o.Deferred,this.type=b,this.message=p,this._visible=!0,this.closable=d,this.props=l??{},this.buttons=m,this.onDidDialogVisibleChangeEmitter.fire(this._visible),this.contextkeyService.dialogViewVisibleContext.set(!0),this.deferred.promise}hide(p){this._visible=!1,this.onDidDialogVisibleChangeEmitter.fire(this._visible),this.contextkeyService.dialogViewVisibleContext.set(!1),this.deferred.resolve(p)}reset(){this.type=void 0,this.message="",this.buttons=[],this.props={}}getMessage(){return this.message}getType(){return this.type}getIcon(){switch(this.type){case o.MessageType.Error:return{color:"var(--notificationsErrorIcon-foreground)",className:"close-circle"};case o.MessageType.Info:return{color:"var(--notificationsInfoIcon-foreground)",className:"info-circle"};case o.MessageType.Warning:return{color:"var(--notificationsWarningIcon-foreground)",className:"question-circle"};default:break}}getButtons(){return this.buttons}getProps(){return this.props}};n.__decorate([(0,a.Autowired)(g.DialogContextKey),n.__metadata("design:type",g.DialogContextKey)],u.prototype,"contextkeyService",void 0),u=n.__decorate([(0,a.Injectable)()],u),e.DialogService=u},21705:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Dialog=void 0;const a=t(85608).__importStar(t(14041)),o=t(97267),I=t(41869),g=t(25751),u=()=>{var G;const p=(0,I.useInjectable)(g.IDialogService),b=p.getIcon(),m=p.getMessage(),d=p.getButtons(),r=p.getType(),[l,s]=(0,a.useState)(p.visible),c=p.getProps(),h=(0,a.useCallback)(()=>{p.reset()},[p]),v=(0,a.useCallback)(()=>{p.hide()},[p]),f=(0,a.useCallback)(W=>{p.hide(W)},[p]);return(0,a.useEffect)(()=>{const W=p.onDidDialogVisibleChange(N=>{s(N)});return()=>{W.dispose()}},[]),a.default.createElement(o.Dialog,Object.assign({visible:l,onClose:v,closable:(G=p.closable)!==null&&G!==void 0?G:!0,afterClose:h,message:m,type:"confirm",messageType:r,icon:b,keyboard:!0,buttons:d?d.map((W,N)=>a.default.createElement(o.Button,{size:"large",onClick:()=>f(W),key:W,type:N===d.length-1?"primary":"secondary"},I.strings.mnemonicButtonLabel(W,!0))):a.default.createElement(o.Button,{size:"large",onClick:v,type:"primary"},(0,I.localize)("dialog.confirm"))},c))};e.Dialog=u},96194:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OverlayModule=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(97222),g=t(25751),u=t(31388),G=t(54490),p=t(73618),b=t(16417),m=t(38543),d=t(75124);let r=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:G.DialogContextKey,useClass:G.DialogContextKey},{token:g.IDialogService,useClass:b.DialogService},{token:g.IMessageService,useClass:d.MessageService},{token:I.IBrowserCtxMenu,useClass:u.BrowserCtxMenuService},p.DialogContribution],this.isOverlay=!0,this.component=m.Overlay}};r=n.__decorate([(0,a.Injectable)()],r),e.OverlayModule=r},38543:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Overlay=void 0;const n=t(85608),a=t(25150),o=n.__importDefault(t(14041)),I=t(41869),g=t(5454),u=t(21705);t(90311),e.Overlay=(0,a.observer)(()=>{const G=(0,I.useInjectable)(I.ComponentRegistry),p=(0,I.useInjectable)(I.IClientApp),[b,m]=o.default.useState([]),d=(0,I.useInjectable)(I.AppConfig);return o.default.useEffect(()=>{p.appInitialized.promise.then(()=>{var r;if(!((r=d.layoutConfig[I.SlotLocation.extra])===null||r===void 0)&&r.modules){const l=[];d.layoutConfig[I.SlotLocation.extra].modules.forEach(s=>{const c=G.getComponentRegistryInfo(s);c&&(c.views||[]).forEach(h=>{h.component&&l.push(h.component)})}),m(l)}})},[]),o.default.createElement("div",{id:"ide-overlay",className:"ide-overlay"},o.default.createElement(u.Dialog,null),o.default.createElement(g.CtxMenu,null),o.default.createElement(I.ComponentRenderer,{Component:b}))})},75124:(L,e,t)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.MessageService=void 0;const a=t(85608),o=t(76003),I=t(97267),g=t(84605),u=t(41869),G=t(43718),p=t(25751);let b=n=class extends p.AbstractMessageService{constructor(){super(...arguments),this.showTime=0}open(d,r,l,s=!0,c){if(!d)return Promise.resolve(void 0);let h=d;if(Date.now()-this.showTime<n.SAME_MESSAGE_DURATION_MS&&typeof h=="string"&&this.preMessage===h)return Promise.resolve(void 0);this.preMessage=typeof h=="string"&&h,this.showTime=Date.now(),typeof d=="string"&&d.length>p.MAX_MESSAGE_LENGTH&&(h=`${d.substr(0,p.MAX_MESSAGE_LENGTH)}...`);const v=c&&typeof c=="string"?`${(0,G.localize)("component.message.origin")}: ${c}`:"",f=(0,G.uuid)();return(0,I.open)((0,u.toMarkdown)(h,this.openerService,{walkTokens:g.parseWithoutEscape}),r,s,f,l,v,n.DURATION[r])||Promise.resolve(void 0)}hide(){I.notification.destroy()}};b.SAME_MESSAGE_DURATION_MS=3e3,b.DURATION={[G.MessageType.Info]:15,[G.MessageType.Warning]:18,[G.MessageType.Error]:20},a.__decorate([(0,o.Autowired)(u.IOpenerService),a.__metadata("design:type",Object)],b.prototype,"openerService",void 0),b=n=a.__decorate([(0,o.Injectable)()],b),e.MessageService=b},25751:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IOpenDialogOptions=e.ISaveDialogOptions=e.IWindowDialogService=e.AbstractMessageService=e.IDialogService=e.MAX_MESSAGE_LENGTH=e.IMessageService=void 0;const n=t(43718);e.IMessageService=Symbol("IMessageService"),e.MAX_MESSAGE_LENGTH=1e3,e.IDialogService=Symbol("IDialogService");class a{info(u,G,p,b){return this.open(u,n.MessageType.Info,G,p,void 0,b)}warning(u,G,p,b){return this.open(u,n.MessageType.Warning,G,p,void 0,b)}error(u,G,p,b){return this.open(u,n.MessageType.Error,G,p,void 0,b)}}e.AbstractMessageService=a,e.IWindowDialogService=Symbol("IWindowDialogService");var o;(function(g){function u(G){return"saveLabel"in G||"showNameInput"in G||"defaultFileName"in G}g.is=u})(o=e.ISaveDialogOptions||(e.ISaveDialogOptions={}));var I;(function(g){function u(G){return"canSelectFiles"in G||"canSelectFolders"in G||"canSelectMany"in G||"openLabel"in G}g.is=u})(I=e.IOpenDialogOptions||(e.IOpenDialogOptions={}))},72665:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),t(85608).__exportStar(t(25751),e)},11461:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractResourcePreferenceProvider=e.OVERRIDE_PROPERTY_PATTERN=void 0;const n=t(85608),a=n.__importStar(t(23304)),o=t(76003),I=t(41869),g=t(14951),u="\\[(.*)\\]$";e.OVERRIDE_PROPERTY_PATTERN=new RegExp(u);let G=class extends I.PreferenceProvider{constructor(){super(),this.preferences={default:{},languageSpecific:{}},this.preferenceThrottler=new I.Throttler,this.preferenceTasks=[],this.loaded=!1,this.listen()}listen(){if(this.fileSystem.handlesScheme(I.Schemes.file)&&this.fileSystem.handlesScheme(I.Schemes.userStorage))this.init();else{const b=this.fileSystem.onFileProviderChanged(m=>{this.fileSystem.handlesScheme(I.Schemes.file)&&this.fileSystem.handlesScheme(I.Schemes.userStorage)&&(this.init(),b.dispose())})}}async init(){this.readPreferences().then(()=>this._ready.resolve()).catch(()=>this._ready.resolve());const b=this.getUri(),m=await this.fileSystem.watchFileChanges(b.parent);this.toDispose.push(m),m.onFilesChanged(d=>{if(d.find(l=>l.uri.startsWith(b.parent.toString())))return this.readPreferences()}),this.toDispose.push(I.Disposable.create(()=>this.reset()))}getConfigUri(b){return b?this.contains(b)?this.getUri():void 0:this.getUri()}contains(b){if(!b)return!0;const m=this.getDomain();if(!m)return!0;const d=new I.URI(b).path;return m.some(r=>new I.URI(r).path.relativity(d)>=0)}getPreferences(b,m){return this.loaded&&this.contains(b)?this.getOnePreference(m):void 0}getLanguagePreferences(b){return this.loaded&&this.contains(b)?this.preferences.languageSpecific:void 0}getOnePreference(b){return b?this.preferences.languageSpecific[b]||{}:this.preferences.default}async resolvePreferenceTasks(b){const m=this.getUri();this.resource=this.fileSystem.getFileStat(m.toString());let d=await this.resource,r=(await this.readContents()||"").trim();for(const l of b){const{path:s,value:c}=l;if((!r||s.length===0)&&(0,I.isUndefined)(c))continue;const h={tabSize:2,insertSpaces:!0,eol:""},v=a.modify(r,s,c,{formattingOptions:h});r=a.applyEdits(r,v)}try{return d||(d=await this.fileSystem.createFile(m.toString())),await this.fileSystem.setContent(d,r),await this.readPreferences(r),!0}catch(l){return this.logger.error(`${l.toString()}`),!1}}doSetPreferenceTask(){const b=this.preferenceTasks.slice(0);return this.preferenceTasks=[],this.resolvePreferenceTasks(b)}async doSetPreference(b,m,d,r){if(!this.contains(d))return!1;const l=this.getPath(b,r);return l?(this.preferenceTasks.push({path:l,key:b,value:m}),await this.preferenceThrottler.queue(this.doSetPreferenceTask.bind(this))):!1}getPath(b,m){return m?[`[${m}]`,b]:[b]}async readPreferences(b){const m=b||await this.readContents();this.loaded=!(0,I.isUndefined)(m);const d=m?this.getParsedContent(m):{default:{},languageSpecific:{}};this.handlePreferenceChanges(d)}async readContents(){const b=this.getUri();try{const{content:m}=await this.fileSystem.readFile(b.toString());return m.toString()}catch{if(this.appConfig.useVSCodeWorkspaceConfiguration&&b.scheme===I.Schemes.file){const d=b.parent.parent.resolve(I.VSCODE_WORKSPACE_CONFIGURATION_DIR_NAME).resolve(b.displayName);try{const{content:r}=await this.fileSystem.readFile(d.toString());return r.toString()}catch{return}}return}}getParsedContent(b){const m=this.parse(b),d={default:{},languageSpecific:{}};if(typeof m!="object")return d;for(const r of Object.keys(m)){const l=m[r];if(e.OVERRIDE_PROPERTY_PATTERN.test(r)){const s=r.match(e.OVERRIDE_PROPERTY_PATTERN)[1];d.languageSpecific[s]=d.languageSpecific[s]||{};for(const c in l){const h=l[c];d.languageSpecific[s][`${c}`]=h}}else d.default[r]=l}return d}validate(b,m){return this.configurations.getPath(this.getUri())!==this.configurations.getPaths()[0]?!0:(0,I.isUndefined)(m)||this.schemaProvider.validate(b,m).valid}parse(b){if(b=b.trim(),!b)return;const m=a.stripComments(b);return a.parse(m)}handlePreferenceChanges(b){const m=Object.assign({},this.preferences);this.preferences=b;const d=this.collectChanges(this.preferences,m);(Object.keys(d.default).length>0||Object.keys(d.languageSpecific).length>0)&&this.emitPreferencesChangedEvent(d)}reset(){const b=this.preferences;this.preferences={default:{},languageSpecific:{}};const m=this.collectChanges(this.preferences,b);(Object.keys(m.default).length>0||Object.keys(m.languageSpecific).length>0)&&this.emitPreferencesChangedEvent(m)}collectChanges(b,m){const d={default:this.collectOneChanges(b.default,m.default),languageSpecific:{}},r=new Set([...Object.keys(b.languageSpecific),...Object.keys(m.languageSpecific)]);for(const l of r){const s=this.collectOneChanges(b.languageSpecific[l],m.languageSpecific[l]);Object.keys(s).length>0&&(d.languageSpecific[l]=s)}return d}collectOneChanges(b,m){const d=new Set([...Object.keys(m||{}),...Object.keys(b||{})]),r={},l=this.getUri();for(const s of d){const c=m[s],h=b[s],v=this.schemaProvider.getCombinedSchema().properties[s];if(v){const f=v.scope;if(!this.schemaProvider.isValidInScope(s,this.getScope())){this.logger.warn(`Preference ${s} in ${l} can only be defined in scopes: ${I.PreferenceScope.getScopeNames(f).join(", ")}.`);continue}}((0,I.isUndefined)(h)&&c!==h||(0,I.isUndefined)(c)&&h!==c||!I.JSONUtils.deepEqual(c,h))&&(r[s]={preferenceName:s,newValue:h,oldValue:c,scope:this.getScope(),domain:this.getDomain()})}return r}};n.__decorate([(0,o.Autowired)(I.PreferenceSchemaProvider),n.__metadata("design:type",I.PreferenceSchemaProvider)],G.prototype,"schemaProvider",void 0),n.__decorate([(0,o.Autowired)(I.PreferenceConfigurations),n.__metadata("design:type",I.PreferenceConfigurations)],G.prototype,"configurations",void 0),n.__decorate([(0,o.Autowired)(g.IFileServiceClient),n.__metadata("design:type",Object)],G.prototype,"fileSystem",void 0),n.__decorate([(0,o.Autowired)(I.AppConfig),n.__metadata("design:type",Object)],G.prototype,"appConfig",void 0),n.__decorate([(0,o.Autowired)(I.ILogger),n.__metadata("design:type",Object)],G.prototype,"logger",void 0),G=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],G),e.AbstractResourcePreferenceProvider=G},91825:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FolderFilePreferenceProvider=e.FolderFilePreferenceProviderOptions=e.FolderFilePreferenceProviderFactory=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(10560),g=t(11461);e.FolderFilePreferenceProviderFactory=Symbol("FolderFilePreferenceProviderFactory"),e.FolderFilePreferenceProviderOptions=Symbol("FolderFilePreferenceProviderOptions");let u=class extends g.AbstractResourcePreferenceProvider{get folderUri(){return this._folderUri||(this._folderUri=new o.URI(this.options.folder.uri)),this._folderUri}getUri(){return this.options.configUri}getScope(){return this.workspaceService.isMultiRootWorkspaceOpened?o.PreferenceScope.Folder:o.PreferenceScope.Workspace}getDomain(){return[this.folderUri.toString()]}};n.__decorate([(0,a.Autowired)(e.FolderFilePreferenceProviderOptions),n.__metadata("design:type",Object)],u.prototype,"options",void 0),n.__decorate([(0,a.Autowired)(I.IWorkspaceService),n.__metadata("design:type",Object)],u.prototype,"workspaceService",void 0),u=n.__decorate([(0,a.Injectable)()],u),e.FolderFilePreferenceProvider=u},16814:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FoldersPreferencesProvider=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(79929),g=t(51500),u=t(91825);let G=class extends o.PreferenceProvider{constructor(){super(),this.providers=new Map,this.init()}async init(){await this.workspaceService.roots,this.updateProviders(),this.workspaceService.onWorkspaceChanged(()=>this.updateProviders());const b=[];for(const m of this.providers.values())b.push(m.ready.catch(d=>this.logger.error(d)));b.length>0?Promise.all(b).then(()=>this._ready.resolve()):this._ready.resolve()}updateProviders(){const b=this.workspaceService.tryGetRoots(),m=new Set(this.providers.keys());for(const d of b){const r=new o.URI(d.uri);for(const l of this.configurations.getPaths())for(const s of[...this.configurations.getSectionNames(),this.configurations.getConfigName()]){const c=this.configurations.createUri(r,l,s),h=c.toString();if(m.delete(h),!this.providers.has(h)){const v=this.createProvider({folder:d,configUri:c});this.providers.set(h,v)}}}for(const d of m){const r=this.providers.get(d);r&&(this.providers.delete(d),r.dispose())}}getConfigUri(b){for(const m of this.getFolderProviders(b)){const d=m.getConfigUri(b);if(this.configurations.isConfigUri(d))return d}}getContainingConfigUri(b){for(const m of this.getFolderProviders(b)){const d=m.getConfigUri();if(this.configurations.isConfigUri(d)&&m.contains(b))return d}}getDomain(){return this.workspaceService.tryGetRoots().map(b=>b.uri)}doResolve(b,m,d){const r={},l=this.groupProvidersByConfigName(m);for(const s of l.values())for(const c of s){const{value:h,configUri:v}=c.resolve(b,m,d);if(v&&h!==void 0){r.configUri=v,r.value=o.PreferenceProvider.merge(r.value,h);break}}return r}getPreferences(b,m){let d;const r=this.groupProvidersByConfigName(b);for(const l of r.values())for(const s of l)if(s.getConfigUri(b)){const c=s.getPreferences(void 0,m);c&&(d=o.PreferenceProvider.merge(d,c));break}return d}getLanguagePreferences(b){let m;const d=this.groupProvidersByConfigName(b);for(const r of d.values())for(const l of r)if(l.getConfigUri(b)){const s=l.getLanguagePreferences();s&&(m=o.PreferenceProvider.merge(m,s));break}return m}async doSetPreference(b,m,d,r){const l=b.split(".",1)[0],s=this.configurations.isSectionName(l)?l:this.configurations.getConfigName(),c=this.getFolderProviders(d);let h;for(const v of c){if(h===void 0){const f=v.getConfigUri(d);f&&(h=this.configurations.getPath(f))}if(this.configurations.getName(v.getConfigUri())===s){if(v.getConfigUri(d)){if(await v.setPreference(b,m,d,r))return!0}else if(this.configurations.getPath(v.getConfigUri())===h){if(await v.setPreference(b,m,d,r))return!0}else if(await v.setPreference(b,m,d,r))return!0}}return!1}groupProvidersByConfigName(b){const m=new Map,d=this.getFolderProviders(b);for(const r of[this.configurations.getConfigName(),...this.configurations.getSectionNames()]){const l=[];for(const s of d)this.configurations.getName(s.getConfigUri())===r&&l.push(s);m.set(r,l)}return m}getFolderProviders(b){if(!b)return[];const m=new o.URI(b).path;let d={relativity:Number.MAX_SAFE_INTEGER};const r=new Map;for(const l of this.providers.values()){const s=l.folderUri.toString(),c=r.get(s)||[];c.push(l),r.set(s,c);const h=l.folderUri.path.relativity(m);h>=0&&d.relativity>h&&(d={relativity:h,uri:s})}return d.uri&&r.get(d.uri)||[]}createProvider(b){const m=this.FolderFilePreferenceProviderFactory(b);return this.toDispose.push(m),this.toDispose.push(m.onDidPreferencesChanged(d=>{this.emitPreferencesChangedEvent(d)})),m}};n.__decorate([(0,a.Autowired)(u.FolderFilePreferenceProviderFactory),n.__metadata("design:type",Function)],G.prototype,"FolderFilePreferenceProviderFactory",void 0),n.__decorate([(0,a.Autowired)(o.PreferenceConfigurations),n.__metadata("design:type",o.PreferenceConfigurations)],G.prototype,"configurations",void 0),n.__decorate([(0,a.Autowired)(g.IWorkspaceService),n.__metadata("design:type",Object)],G.prototype,"workspaceService",void 0),n.__decorate([(0,a.Autowired)(I.IFileServiceClient),n.__metadata("design:type",Object)],G.prototype,"fileSystem",void 0),n.__decorate([(0,a.Autowired)(o.ILogger),n.__metadata("design:type",Object)],G.prototype,"logger",void 0),G=n.__decorate([(0,a.Injectable)(),n.__metadata("design:paramtypes",[])],G),e.FoldersPreferencesProvider=G},58408:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createPreferenceProviders=e.injectPreferenceProviders=e.injectWorkspaceFilePreferenceProvider=e.injectFolderPreferenceProvider=e.PreferencesModule=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(78132),g=t(83569),u=t(91825),G=t(16814),p=t(65146),b=t(90184),m=t(76773),d=t(25947),r=t(46392),l=t(58705);let s=class extends o.BrowserModule{constructor(){super(...arguments),this.contributionProvider=g.SettingContribution,this.providers=[...f(),{token:g.IUserStorageService,useClass:d.UserStorageServiceImpl},{token:I.IPreferenceSettingsService,useClass:b.PreferenceSettingsService},p.PreferenceContribution,d.UserStorageContribution],this.preferences=v}};s=n.__decorate([(0,a.Injectable)()],s),e.PreferencesModule=s;function c(W){W.addProviders({token:u.FolderFilePreferenceProviderFactory,useFactory:()=>N=>{const Z=W.get(I.PreferenceConfigurations),y=Z.getName(N.configUri),E=W.createChild([{token:u.FolderFilePreferenceProviderOptions,useValue:N}],{dropdownForTag:!0,tag:y});return Z.isConfigUri(N.configUri)?(E.addProviders({token:u.FolderFilePreferenceProvider,useClass:u.FolderFilePreferenceProvider}),E.get(u.FolderFilePreferenceProvider)):E.get(u.FolderFilePreferenceProvider,{tag:y,multiple:!0})}})}e.injectFolderPreferenceProvider=c;function h(W){W.addProviders({token:r.WorkspaceFilePreferenceProviderFactory,useFactory:()=>N=>W.createChild([{token:r.WorkspaceFilePreferenceProviderOptions,useValue:N},{token:r.WorkspaceFilePreferenceProvider,useClass:r.WorkspaceFilePreferenceProvider}]).get(r.WorkspaceFilePreferenceProvider)})}e.injectWorkspaceFilePreferenceProvider=h;function v(W){c(W),h(W)}e.injectPreferenceProviders=v;function f(){return[{token:I.PreferenceProvider,tag:I.PreferenceScope.Folder,useClass:G.FoldersPreferencesProvider},{token:I.PreferenceProvider,tag:I.PreferenceScope.Workspace,useClass:l.WorkspacePreferenceProvider},{token:I.PreferenceProvider,tag:I.PreferenceScope.User,useClass:m.UserPreferenceProvider}]}e.createPreferenceProviders=f},65146:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PreferenceContribution=e.PREFERENCE_COMMANDS=e.PreferenceContextMenu=e.PrefResourceProvider=void 0;const n=t(85608),a=n.__importStar(t(23304)),o=t(76003),I=t(41869),g=t(93899),u=t(57517),G=t(42933),p=t(83569),b=t(90184),m=t(26551),d=t(99187),r=t(76773),l=t(58705),s="pref-preview",{addElement:c}=I.arrays;let h=class extends I.WithEventBus{constructor(){super(),this.scheme=p.PREF_SCHEME}provideResource(Z){return{supportsRevive:!0,name:(0,I.localize)("preference.tab.name"),icon:(0,I.getIcon)("setting"),uri:Z}}provideResourceSubname(Z,y){return null}async shouldCloseResource(Z,y){return!0}};h=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],h),e.PrefResourceProvider=h;var v;(function(N){N.OPEN="1_open"})(v=e.PreferenceContextMenu||(e.PreferenceContextMenu={}));var f;(function(N){const Z="preference";N.OPEN_USER_SETTING_FILE={id:"preference.open.user",label:"%preference.editorTitle.openUserSource%",category:Z},N.OPEN_WORKSPACE_SETTING_FILE={id:"preference.open.workspace",label:"%preference.editorTitle.openWorkspaceSource%",category:Z},N.OPEN_SOURCE_FILE={id:"preference.open.source",label:"%preference.editorTitle.openSource%",category:Z},N.PREFERENCE_INPUT_FOCUS={id:"preference.input.focus",category:Z}})(f=e.PREFERENCE_COMMANDS||(e.PREFERENCE_COMMANDS={}));let W=class{constructor(){this.settingGroupsWillRegister=b.defaultSettingGroup,this.settingSectionsWillRegister=b.defaultSettingSections}onStart(){this.saveSettings(),this.handleSettingGroups(),this.handleSettingSections(),this.registerSettings(),this.registerSettingSections()}registerCommands(Z){Z.registerCommand(I.COMMON_COMMANDS.OPEN_PREFERENCES,{execute:async y=>{await this.openPreferences(y),this.preferenceService.focusInput()}}),Z.registerCommand(I.COMMON_COMMANDS.LOCATE_PREFERENCES,{execute:async y=>(await this.openPreferences(),await this.preferenceService.scrollToGroup(y))}),Z.registerCommand(f.OPEN_USER_SETTING_FILE,{execute:()=>{this.openResource(I.PreferenceScope.User)}}),Z.registerCommand(f.OPEN_WORKSPACE_SETTING_FILE,{execute:()=>{this.openResource(I.PreferenceScope.Workspace)}}),Z.registerCommand(f.OPEN_SOURCE_FILE,{execute:async(y,E)=>{!y||typeof y!="number"?this.openResource():this.openResource(y,E)}}),Z.registerCommand(f.PREFERENCE_INPUT_FOCUS,{execute:()=>{this.preferenceService.focusInput()}})}registerMenus(Z){Z.registerMenuItem(g.MenuId.SettingsIconMenu,{command:I.COMMON_COMMANDS.OPEN_PREFERENCES.id,group:v.OPEN}),Z.registerMenuItem(g.MenuId.EditorTitle,{command:f.OPEN_SOURCE_FILE.id,iconClass:(0,I.getIcon)("open"),group:"navigation",order:4,when:`resourceScheme == ${p.PREF_SCHEME}`}),Z.registerMenuItem(g.MenuId.EditorTitle,{command:I.COMMON_COMMANDS.OPEN_PREFERENCES.id,iconClass:(0,I.getIcon)("open"),group:"navigation",order:4,when:"resourceFilename =~ /settings.json/"})}registerKeybindings(Z){Z.registerKeybinding({command:I.COMMON_COMMANDS.OPEN_PREFERENCES.id,keybinding:"ctrlcmd+,"}),Z.registerKeybinding({command:f.PREFERENCE_INPUT_FOCUS.id,keybinding:"ctrlcmd+f",when:"resourceScheme == pref"})}handleSettingGroups(){for(const Z of this.contributions.getContributions())Z.handleSettingGroup&&(this.settingGroupsWillRegister=Z.handleSettingGroup(this.settingGroupsWillRegister))}handleSettingSections(){for(const Z of this.contributions.getContributions())Z.handleSettingSections&&(this.settingSectionsWillRegister=Z.handleSettingSections(Object.assign({},this.settingSectionsWillRegister)))}saveSettings(){for(const Z of this.contributions.getContributions())Z.registerSetting&&Z.registerSetting({registerSettingGroup:y=>c(this.settingGroupsWillRegister,y),registerSettingSection:(y,E)=>((A=>Object.keys(this.settingSectionsWillRegister).includes(A))(y)||(this.settingSectionsWillRegister[y]=[]),c(this.settingSectionsWillRegister[y],E))})}registerSettings(){this.settingGroupsWillRegister.forEach(Z=>{this.preferenceService.registerSettingGroup(Z)})}registerSettingSections(){Object.keys(this.settingSectionsWillRegister).forEach(Z=>{this.settingSectionsWillRegister[Z].forEach(y=>{this.preferenceService.registerSettingSection(Z,y)})})}async openPreferences(Z,y){await this.commandService.executeCommand(I.EDITOR_COMMANDS.OPEN_RESOURCE.id,new I.URI("/").withScheme(p.PREF_SCHEME),{preview:!1}),(0,I.isString)(Z)?this.preferenceService.search(Z):(0,I.isString)(y)&&this.preferenceService.scrollToPreference(y)}async openResource(Z,y){var E,R,A;const w=await this.preferenceService.getCurrentPreferenceUrl(Z),F=await this.commandService.executeCommand(I.EDITOR_COMMANDS.OPEN_RESOURCE.id,new I.URI(w),{focus:!0,groupIndex:this.workbenchEditorService.currentEditorGroup.index});if(F&&y){const V=(E=this.workbenchEditorService.editorGroups.find(Y=>Y.name===F.groupId))===null||E===void 0?void 0:E.currentEditor;if(V){const{_commandService:Y}=V.monacoEditor;let _=V.monacoEditor.getValue(),H,S,X,Q;const{index:O}=_.match(new RegExp(`\\"${y}\\"`))||{};if(O&&O>=0)S=((R=_.slice(0,O).match(new RegExp("\\n","g")))===null||R===void 0?void 0:R.length)||0,S>0&&(H=_.split(`
|
|
28190
28190
|
`),X=H[S],Q=S);else{const x={tabSize:2,insertSpaces:!0,eol:""},B=a.modify(_,[y],"",{formattingOptions:x}),D=a.applyEdits(_,B);V.monacoEditor.setValue(D),_=D,S=((A=_.slice(0,O).match(new RegExp("\\n","g")))===null||A===void 0?void 0:A.length)||-1,S>1&&(H=_.split(`
|
|
28191
28191
|
`),X=H[S-1],Q=S-1)}if(!(X&&Q))return;const M=`\\s+\\"${y}\\":\\s?["|{|t|f|[]`,T=new RegExp(M,"g").exec(X);if(T){const x=T[0].slice(-1)==='"';V.monacoEditor.setPosition({lineNumber:Q+1,column:T[0].length+1}),setTimeout(()=>{V.monacoEditor.revealPositionInCenter({lineNumber:Q+1,column:T[0].length+1},1)}),x&&await Y.executeCommand("editor.action.triggerSuggest")}}}}initialize(){this.schemaProvider.onDidPreferenceSchemaChanged(()=>{this.registerSchema(this.schemaRegistry)})}registerSchema(Z){Z.registerSchema("vscode://schemas/settings/user",this.schemaProvider.getCombinedSchema(),["settings.json",r.USER_PREFERENCE_URI.toString()])}registerResource(Z){Z.registerResourceProvider(this.prefResourceProvider)}registerEditorComponent(Z){Z.registerEditorComponent({component:d.PreferenceView,uid:s,scheme:p.PREF_SCHEME}),Z.registerEditorComponentResolver(p.PREF_SCHEME,(y,E,R)=>{R([{type:u.EditorOpenType.component,componentId:s}])})}registerEditorFeature(Z){Z.registerEditorFeatureContribution({contribute:y=>this.injector.get(m.EditPreferenceDecorationsContribution,[y]).contribute()})}};n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],W.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(I.PreferenceSchemaProvider),n.__metadata("design:type",I.PreferenceSchemaProvider)],W.prototype,"schemaProvider",void 0),n.__decorate([(0,o.Autowired)(I.PreferenceProvider,{tag:I.PreferenceScope.Workspace}),n.__metadata("design:type",l.WorkspacePreferenceProvider)],W.prototype,"workspacePreferenceProvider",void 0),n.__decorate([(0,o.Autowired)(G.IFileServiceClient),n.__metadata("design:type",Object)],W.prototype,"filesystem",void 0),n.__decorate([(0,o.Autowired)(h),n.__metadata("design:type",h)],W.prototype,"prefResourceProvider",void 0),n.__decorate([(0,o.Autowired)(I.CommandService),n.__metadata("design:type",Object)],W.prototype,"commandService",void 0),n.__decorate([(0,o.Autowired)(I.IJSONSchemaRegistry),n.__metadata("design:type",Object)],W.prototype,"schemaRegistry",void 0),n.__decorate([(0,o.Autowired)(I.IPreferenceSettingsService),n.__metadata("design:type",b.PreferenceSettingsService)],W.prototype,"preferenceService",void 0),n.__decorate([(0,o.Autowired)(p.SettingContribution),n.__metadata("design:type",Object)],W.prototype,"contributions",void 0),n.__decorate([(0,o.Autowired)(u.WorkbenchEditorService),n.__metadata("design:type",u.WorkbenchEditorService)],W.prototype,"workbenchEditorService",void 0),W=n.__decorate([(0,I.Domain)(I.CommandContribution,I.KeybindingContribution,I.ClientAppContribution,u.BrowserEditorContribution,g.MenuContribution,I.JsonSchemaContribution)],W),e.PreferenceContribution=W},90184:(L,e,t)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.defaultSettingSections=e.defaultSettingGroup=e.PreferenceSettingsService=void 0;const a=t(85608),o=t(76003),I=t(40396),g=t(41869),u=t(14951),G=t(83569),p=t(65146),{addElement:b}=g.arrays;class m{constructor(){this.version=new Map}get(l){return this.version.get(l)||0}increase(l){this.version.set(l,(this.version.get(l)||0)+1)}}let d=n=class extends g.Disposable{get currentScope(){return this._currentScope.id}get currentSelectId(){return this._currentSelectId}set currentSelectId(l){this._currentSelectId=l,this.emitter.emit("currentSelectIdChange",l)}constructor(){super(),this.emitter=this.registerDispose(new I.EventEmitter),this.currentSearch="",this.tabIndex=0,this.tabList=[g.WorkspaceScope,g.UserScope],this._currentScope=this.tabList[0],this._currentSelectId="",this.settingsGroups=[],this.settingsSections=new Map,this.settingsSectionsVersioned=new m,this.enumLabels=new Map,this.cachedGroupSection=new Map,this.onDidEnumLabelsChangeDispatcher=this.registerDispose(new g.Dispatcher),this.openJSON=(s,c)=>{this.commandService.executeCommand(p.PREFERENCE_COMMANDS.OPEN_SOURCE_FILE.id,s,c)},this.handleListHandler=s=>{this._listHandler=s},this.handleTreeHandler=s=>{this._treeHandler=s},this.search=s=>{this.doSearch(s)},this._onFocus=new g.Emitter,this.setEnumLabels("general.language",new Proxy({},{get:(s,c)=>{var h;return(h=(0,g.getAvailableLanguages)().find(v=>v.languageId===c))===null||h===void 0?void 0:h.localizedLanguageName}})),this.setEnumLabels("files.eol",{"\n":"LF","\r\n":"CRLF",auto:"auto"});const l=this.preferenceService.get("settings.userBeforeWorkspace",!1);l&&this.updateTabList(l),this.addDispose([this.preferenceService.onSpecificPreferenceChange("settings.userBeforeWorkspace",s=>{this.updateTabList(s.newValue)}),this.emitter.on("tabListChange",()=>{this.updateCurrentScope()}),this.emitter.on("tabIndexChange",()=>{this.updateCurrentScope()})])}updateTabList(l){let s;l?s=[g.UserScope,g.WorkspaceScope]:s=[g.WorkspaceScope,g.UserScope],this.tabList=s,this.emitter.emit("tabListChange")}updateCurrentScope(){this._currentScope=this.tabList[this.tabIndex],this.emitter.emit("currentScopeChange")}scrollToGroup(l){l&&(this.currentSelectId="group:"+l)}scrollToSection(l){l&&(this.currentSelectId="section:"+l)}scrollToPreference(l){l&&(this.currentSelectId="preference:"+l)}updateTabIndex(l){this.tabIndex=l,this.emitter.emit("tabIndexChange")}selectScope(l){let s=this.tabList.findIndex(c=>c.id===l);s===-1&&(s=0),this.updateTabIndex(s)}onDidEnumLabelsChange(l){return this.onDidEnumLabelsChangeDispatcher.on(l)}isContainSearchValue(l,s){return l.toLocaleLowerCase().indexOf(s.toLocaleLowerCase())>-1}shouldHiddenInScope(l,s){return Array.isArray(l.hiddenInScope)&&l.hiddenInScope.includes(s)}doSearch(l){l?this.currentSearch=l:this.currentSearch="",this.emitter.emit("currentSearchChange")}async setPreference(l,s,c){await this.preferenceService.set(l,s,c)}get listHandler(){return this._listHandler}get treeHandler(){return this._treeHandler}getSettingGroups(l,s){return this.settingsGroups.slice().filter(h=>this.getResolvedSections(h.id,l,s).length>0)}async hasThisScopeSetting(l){const s=await this.getPreferenceUrl(l);return s?await this.fileServiceClient.access(s):void 0}registerSettingGroup(l){const s=b(this.settingsGroups,Object.assign(Object.assign({},l),{title:(0,g.replaceLocalizePlaceholder)(l.title)||l.title}));return this.emitter.emit("settingsGroupsChange"),g.Disposable.create(()=>{s.dispose(),this.emitter.emit("settingsGroupsChange")})}registerSettingSection(l,s){this.settingsSections.has(l)||this.settingsSections.set(l,[]),this.cachedGroupSection.clear();const c=b(this.settingsSections.get(l),s);return this.settingsSectionsVersioned.increase(l),this.emitter.emit("settingsSectionsChange",l),{dispose:()=>{c.dispose(),this.settingsSectionsVersioned.increase(l),this.emitter.emit("settingsSectionsChange",l)}}}visitSection(l,s){if(l.preferences){for(const c of l.preferences)if(s(c))return c}if(l.subSections&&Array.isArray(l.subSections))for(const c of l.subSections)return this.visitSection(c,s)}getPreferenceViewDesc(l){const s=this.settingsSections.values();for(const c of s)for(const h of c){const v=this.visitSection(h,f=>{if(!(0,g.isString)(f)&&f.id===l)return!0});if(v)return v}}getResolvedSections(l,s=this.currentScope,c=this.currentSearch){var h;if(c.startsWith(n.EXTENSION_SETTINGS_PREFIX)&&l!=="extension")return[];const v=this.settingsSectionsVersioned.get(l),f=[l,s,c||"",v].join("-");if(this.cachedGroupSection.has(f))return this.cachedGroupSection.get(f);let W;if(n.EXTENSION_SETTINGS_REGX.test(c)){const y=n.EXTENSION_SETTINGS_REGX.exec(c);y&&(W=y[1],c=(h=y[2])===null||h===void 0?void 0:h.trim())}const N=[],Z=y=>({preferences:y.preferences.filter(R=>!this.shouldHiddenInScope(R,s)).map(R=>{const A=typeof R=="string"?R:R.id,w=this.schemaProvider.getPreferenceProperty(A),F=typeof R=="string"?(0,G.toPreferenceReadableName)(R):(0,G.getPreferenceItemLabel)(R),V=w&&(0,g.replaceLocalizePlaceholder)(w.description),Y=w&&(0,g.replaceLocalizePlaceholder)(w.markdownDescription);return{id:A,label:F,_description:Y??V,markdownDescription:Y,description:V}}).filter(R=>c?this.isContainSearchValue(R.id,c)||this.isContainSearchValue(R.label,c)||R.description&&this.isContainSearchValue(R.description,c)||R.markdownDescription&&this.isContainSearchValue(R.markdownDescription,c):!0)});return(this.settingsSections.get(l)||[]).filter(y=>!this.shouldHiddenInScope(y,s)&&(!W||W&&W===y.extensionId)).forEach(y=>{const E=Object.assign({},y);if(y.preferences){const{preferences:R}=Z(y);E.preferences=R}if(y.subSections){const R=y.subSections.map(A=>{const{preferences:w}=Z(A);if(w.length>0)return Object.assign(Object.assign({},A),{preferences:w})}).filter(Boolean);E.subSections=R}(E.preferences&&E.preferences.length>0||E.subSections&&E.subSections.length>0)&&N.push(E)}),this.cachedGroupSection.set(f.toLocaleLowerCase(),N),N}getPreference(l,s,c=!1){const{value:h}=this.preferenceService.resolve(l,void 0,void 0,void 0,s)||{value:void 0,scope:g.PreferenceScope.Default},{scope:v}=this.preferenceService.resolve(l)||{value:void 0,scope:g.PreferenceScope.Default};return{value:h,effectingScope:v||g.PreferenceScope.Default}}getEnumLabels(l){return this.enumLabels.get(l)||{}}setEnumLabels(l,s){this.onDidEnumLabelsChangeDispatcher.dispatch(l),this.enumLabels.set(l,s)}async reset(l,s){await this.preferenceService.set(l,void 0,s)}async getPreferenceUrl(l){var s;const c=this.providerProvider(l),h=await c.resource;return h?h.uri:(s=c.getConfigUri())===null||s===void 0?void 0:s.toString()}async getCurrentPreferenceUrl(l){const s=await this.getPreferenceUrl(l||this.currentScope||g.PreferenceScope.User);if(!s)return;if(!await this.fileServiceClient.access(s)){const h=await this.fileServiceClient.createFile(s);h&&await this.fileServiceClient.setContent(h,`{
|
|
28192
|
-
}`)}return s}get onFocus(){return this._onFocus.event}focusInput(){this._onFocus.fire()}};d.EXTENSION_SETTINGS_PREFIX="@ext:",d.EXTENSION_SETTINGS_REGX=/^@ext:(\S+)(.+)?/,d.DEFAULT_CHANGE_DELAY=200,a.__decorate([(0,o.Autowired)(g.PreferenceService),a.__metadata("design:type",Object)],d.prototype,"preferenceService",void 0),a.__decorate([(0,o.Autowired)(g.PreferenceSchemaProvider),a.__metadata("design:type",g.PreferenceSchemaProvider)],d.prototype,"schemaProvider",void 0),a.__decorate([(0,o.Autowired)(g.PreferenceProviderProvider),a.__metadata("design:type",Function)],d.prototype,"providerProvider",void 0),a.__decorate([(0,o.Autowired)(u.IFileServiceClient),a.__metadata("design:type",Object)],d.prototype,"fileServiceClient",void 0),a.__decorate([(0,o.Autowired)(g.CommandService),a.__metadata("design:type",Object)],d.prototype,"commandService",void 0),d=n=a.__decorate([(0,o.Injectable)(),a.__metadata("design:paramtypes",[])],d),e.PreferenceSettingsService=d,e.defaultSettingGroup=[{id:G.PreferenceSettingId.General,title:"%settings.group.general%",iconClass:(0,g.getIcon)("setting")},{id:G.PreferenceSettingId.Terminal,title:"%settings.group.terminal%",iconClass:(0,g.getIcon)("terminal")},{id:G.PreferenceSettingId.Editor,title:"%settings.group.editor%",iconClass:(0,g.getIcon)("editor")},{id:G.PreferenceSettingId.View,title:"%settings.group.view%",iconClass:(0,g.getIcon)("detail")},{id:G.PreferenceSettingId.Feature,title:"%settings.group.feature%",iconClass:(0,g.getIcon)("file-text")}],e.defaultSettingSections={[G.PreferenceSettingId.General]:[{preferences:[{id:"general.theme",localized:"preference.general.theme"},{id:"general.icon",localized:"preference.general.icon"},{id:"general.productIconTheme",localized:"preference.general.productIconTheme"},{id:"general.language",localized:"preference.general.language",hiddenInScope:[g.PreferenceScope.Workspace]}]}],[G.PreferenceSettingId.Editor]:[{title:"Editor",preferences:[{id:"editor.previewMode"},{id:"editor.enablePreviewFromCodeNavigation"},{id:"editor.autoSave",localized:"preference.editor.autoSave"},{id:"editor.autoSaveDelay",localized:"preference.editor.autoSaveDelay"},{id:"workbench.refactoringChanges.showPreviewStrategy",localized:"preference.workbench.refactoringChanges.showPreviewStrategy.title"},{id:"editor.askIfDiff",localized:"preference.editor.askIfDiff"},{id:"editor.cursorStyle",localized:"preference.editor.cursorStyle"},{id:"editor.fontSize",localized:"preference.editor.fontSize"},{id:"editor.fontWeight",localized:"preference.editor.fontWeight"},{id:"editor.fontFamily",localized:"preference.editor.fontFamily"},{id:"editor.lineHeight",localized:"preference.editor.lineHeight"},{id:"editor.trimAutoWhitespace"},{id:"editor.quickSuggestionsDelay",localized:"preference.editor.quickSuggestionsDelay"},{id:"editor.suggestOnTriggerCharacters"},{id:"editor.acceptSuggestionOnEnter"},{id:"editor.acceptSuggestionOnCommitCharacter"},{id:"editor.snippetSuggestions"},{id:"editor.wordBasedSuggestions"},{id:"editor.suggestSelection"},{id:"editor.suggestFontSize"},{id:"editor.suggestLineHeight"},{id:"editor.tabCompletion"},{id:"editor.suggest.filteredTypes"},{id:"editor.suggest.insertMode"},{id:"editor.suggest.filterGraceful"},{id:"editor.suggest.localityBonus"},{id:"editor.suggest.shareSuggestSelections"},{id:"editor.suggest.snippetsPreventQuickSuggestions"},{id:"editor.suggest.showIcons"},{id:"editor.suggest.maxVisibleSuggestions"},{id:"editor.suggest.showMethods"},{id:"editor.suggest.showFunctions"},{id:"editor.suggest.showConstructors"},{id:"editor.suggest.showFields"},{id:"editor.suggest.showVariables"},{id:"editor.suggest.showClasses"},{id:"editor.suggest.showStructs"},{id:"editor.suggest.showInterfaces"},{id:"editor.suggest.showModules"},{id:"editor.suggest.showProperties"},{id:"editor.suggest.showEvents"},{id:"editor.suggest.showOperators"},{id:"editor.suggest.showUnits"},{id:"editor.suggest.showValues"},{id:"editor.suggest.showConstants"},{id:"editor.suggest.showEnums"},{id:"editor.suggest.showEnumMembers"},{id:"editor.suggest.showKeywords"},{id:"editor.suggest.showWords"},{id:"editor.suggest.showColors"},{id:"editor.suggest.showFiles"},{id:"editor.suggest.showReferences"},{id:"editor.suggest.showCustomcolors"},{id:"editor.suggest.showFolders"},{id:"editor.suggest.showTypeParameters"},{id:"editor.suggest.showSnippets"},{id:"editor.suggest.showUsers"},{id:"editor.suggest.showIssues"},{id:"editor.suggest.preview"},{id:"editor.suggest.details.visible"},{id:"editor.inlineSuggest.enabled",localized:"preference.editor.inlineSuggest.enabled"},{id:"editor.inlineSuggest.showToolbar"},{id:"editor.experimental.stickyScroll.enabled",localized:"preference.editor.experimental.stickyScroll.enabled"},{id:"editor.guides.bracketPairs",localized:"preference.editor.guides.bracketPairs"},{id:"editor.guides.indentation",localized:"preference.editor.guides.indentation"},{id:"editor.guides.highlightActiveIndentation",localized:"preference.editor.guides.highlightActiveIndentation"},{id:"editor.detectIndentation",localized:"preference.editor.detectIndentation"},{id:"editor.tabSize",localized:"preference.editor.tabSize"},{id:"editor.insertSpaces",localized:"preference.editor.insertSpace"},{id:"editor.wrapTab",localized:"preference.editor.wrapTab"},{id:"editor.wordWrap",localized:"preference.editor.wordWrap"},{id:"editor.renderLineHighlight",localized:"preference.editor.renderLineHighlight"},{id:"editor.renderWhitespace",localized:"preference.editor.renderWhitespace"},{id:"editor.minimap",localized:"preference.editor.minimap"},{id:"editor.preferredFormatter",localized:"preference.editor.preferredFormatter"},{id:"editor.formatOnSave",localized:"preference.editor.formatOnSave"},{id:"editor.formatOnSaveTimeout",localized:"preference.editor.formatOnSaveTimeout"},{id:"editor.formatOnPaste",localized:"preference.editor.formatOnPaste"},{id:"editor.codeActionsOnSave",localized:"preference.editor.saveCodeActions"},{id:"editor.codeActionsOnSaveNotification",localized:"preference.editor.saveCodeActionsNotification"},{id:"editor.gotoLocation.multiple"},{id:"editor.maxTokenizationLineLength",localized:"preference.editor.maxTokenizationLineLength"},{id:"editor.largeFile",localized:"preference.editor.largeFile"},{id:"editor.readonlyFiles",localized:"preference.editor.readonlyFiles"},{id:"editor.bracketPairColorization.enabled",localized:"preference.editor.bracketPairColorization.enabled"},{id:"workbench.editorAssociations"},{id:"editor.unicodeHighlight.ambiguousCharacters"}]},{title:"Diff Editor",preferences:[{id:"diffEditor.renderSideBySide",localized:"preference.diffEditor.renderSideBySide"},{id:"diffEditor.ignoreTrimWhitespace",localized:"preference.diffEditor.ignoreTrimWhitespace"}]},{title:"Merge Editor",preferences:[{id:"mergeEditor.autoApplyNonConflictChanges",localized:"preference.mergeEditor.autoApplyNonConflictChanges"}]},{title:"Files",preferences:[{id:"files.autoGuessEncoding",localized:"preference.files.autoGuessEncoding.title"},{id:"files.encoding",localized:"preference.files.encoding.title"},{id:"files.eol",localized:"preference.files.eol"},{id:"files.trimFinalNewlines",localized:"preference.files.trimFinalNewlines"},{id:"files.trimTrailingWhitespace",localized:"preference.files.trimTrailingWhitespace"},{id:"files.insertFinalNewline",localized:"preference.files.insertFinalNewline"},{id:"files.exclude",localized:"preference.files.exclude.title"},{id:"files.watcherExclude",localized:"preference.files.watcherExclude.title"},{id:"files.associations",localized:"preference.files.associations.title"}]}],[G.PreferenceSettingId.View]:[{title:"MenuBar",preferences:[{id:"menubar.compactMode",localized:"preference.menubar.mode.compact"}]},{title:"Layout",preferences:[{id:"view.saveLayoutWithWorkspace",localized:"preference.view.saveLayoutWithWorkspace.title"}]},{title:"File Tree",preferences:[]},{title:"Explorer",preferences:[{id:"explorer.fileTree.baseIndent",localized:"preference.explorer.fileTree.baseIndent.title"},{id:"explorer.fileTree.indent",localized:"preference.explorer.fileTree.indent.title"},{id:"explorer.compactFolders",localized:"preference.explorer.compactFolders.title"},{id:"explorer.autoReveal",localized:"preference.explorer.autoReveal"}]},{title:"QuickOpen",preferences:[{id:"workbench.quickOpen.preserveInput"}]},{title:"Search",preferences:[{id:"search.include"},{id:"search.exclude",localized:"preference.search.exclude.title"},{id:"search.useReplacePreview"},{id:"search.searchOnType"},{id:"search.searchOnTypeDebouncePeriod"}]},{title:"Output",preferences:[{id:"output.maxChannelLine",localized:"output.maxChannelLine"},{id:"output.enableLogHighlight",localized:"output.enableLogHighlight"},{id:"output.enableSmartScroll",localized:"output.enableSmartScroll"}]},{title:"Debug",preferences:[{id:"debug.console.wordWrap",localized:"preference.debug.console.wordWrap"},{id:"debug.inline.values",localized:"preference.debug.inline.values"},{id:"debug.toolbar.float",localized:"preference.debug.toolbar.float.title"},{id:"debug.breakpoint.editorHint",localized:"preference.debug.breakpoint.editorHint.title"},{id:"debug.breakpoint.showBreakpointsInOverviewRuler",localized:"preference.debug.breakpoint.showBreakpointsInOverviewRuler"}]}],[G.PreferenceSettingId.Terminal]:[{preferences:[{id:"terminal.type",localized:"preference.terminal.type"},{id:"terminal.fontFamily",localized:"preference.terminal.fontFamily"},{id:"terminal.fontSize",localized:"preference.terminal.fontSize"},{id:"terminal.fontWeight",localized:"preference.terminal.fontWeight"},{id:"terminal.lineHeight",localized:"preference.terminal.lineHeight"},{id:"terminal.cursorBlink",localized:"preference.terminal.cursorBlink"},{id:"terminal.scrollback",localized:"preference.terminal.scrollback"},{id:"terminal.integrated.shellArgs.linux",localized:"preference.terminal.integrated.shellArgs.linux"},{id:"terminal.integrated.copyOnSelection",localized:"preference.terminal.integrated.copyOnSelection"},{id:"terminal.integrated.localEchoEnabled",localized:"preference.terminal.integrated.localEchoEnabled"},{id:"terminal.integrated.localEchoLatencyThreshold",localized:"preference.terminal.integrated.localEchoLatencyThreshold"},{id:"terminal.integrated.localEchoExcludePrograms",localized:"preference.terminal.integrated.localEchoExcludePrograms"},{id:"terminal.integrated.cursorStyle",localized:"preference.terminal.integrated.cursorStyle"},{id:"terminal.integrated.localEchoStyle",localized:"preference.terminal.integrated.localEchoStyle"},{id:"terminal.integrated.xtermRenderType",localized:"preference.terminal.integrated.xtermRenderType"}]}],[G.PreferenceSettingId.Feature]:[{title:"Misc",preferences:[]},{title:"Tree Component",preferences:[{id:"workbench.list.openMode",localized:"preference.workbench.list.openMode.title"}]}]}},26551:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EditPreferenceDecorationsContribution=void 0;const n=t(85608),a=t(76003),o=t(97267),I=t(41869),g=t(93899),u=t(43718),G=t(57517),p=t(14951),b=n.__importStar(t(20868)),m=t(90684),d=t(19582),r=t(60295),l=t(90184),s=t(76773);let c=class{constructor(v){this.editor=v,this.disposer=new u.Disposable,this._preferences=[],this._currentLine=0,this._editPreferenceDecoration=this.editor.monacoEditor.createDecorationsCollection()}verifyEditor(){var v;return((v=this.editor.currentUri)===null||v===void 0?void 0:v.toString())===s.USER_PREFERENCE_URI.toString()}async getPreferenceUrl(){const v=await this.preferenceSettingsService.getPreferenceUrl(u.PreferenceScope.User);if(v){const f=await this.fileServiceClient.getFileStat(v);return f?u.URI.parse(f.uri):void 0}}async getDocumentModelRef(v){const f=this.editorDocumentModelService.getModelReference(v);return f||this.editorDocumentModelService.createModelReference(v)}contribute(){return this.disposer.addDispose(this.editor.monacoEditor.onMouseDown(async v=>{var f;((f=v.target.range)===null||f===void 0?void 0:f.startLineNumber)!==this.currentLine&&!this.verifyEditor()||v.target.type!==d.MouseTargetType.GUTTER_GLYPH_MARGIN||v.target.detail.isAfterLines||!this.isVisible()||(this.registerMenuItems(this.preferences),this.showContextMenu(v))})),this.disposer.addDispose(this.editor.monacoEditor.onDidChangeCursorPosition(v=>{this.verifyEditor()&&this.onPositionChanged(v)})),this.disposer.addDispose(this.editor.monacoEditor.onContextMenu(v=>(v.event.preventDefault(),v.event.stopPropagation(),!1))),this.disposer.addDispose(this.editor.monacoEditor.onDidChangeConfiguration(()=>{this.editor.monacoEditor.getOption(b.editor.EditorOption.glyphMargin)||this.hide()})),this.disposer.addDispose(u.Disposable.create(()=>{this.hide(),this.menuRegistry.unregisterMenuId(g.MenuId.SettingJSONGlyphMarginContext)})),this.disposer.addDispose(this.commandRegistry.registerCommand(r.SettingJSONGlyphMarginEdit,{execute:(v,f)=>{v&&f&&(f==="true"&&(f=!0),f==="false"&&(f=!1),this.preferenceSettingsService.setPreference(v,f,u.PreferenceScope.User))}})),this.disposer}get preferences(){return this._preferences}get currentLine(){return this._currentLine}show(v,f,W){this._preferences=W;const N=[];N.push({options:{description:"edit-preference-widget-decoration",glyphMarginClassName:(0,o.getIcon)("edit")+" setting-edit-glyph",glyphMarginHoverMessage:new m.MarkdownString().appendText(f),stickiness:b.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges},range:{startLineNumber:v,startColumn:1,endLineNumber:v,endColumn:1}}),this._editPreferenceDecoration.set(N)}hide(){this._editPreferenceDecoration.clear()}isVisible(){return this._editPreferenceDecoration.length>0}async getPreferencesKeyAtLineNumber(v){const f=new RegExp(/\"((?!,).)*\"+((\s+?)?)\:/g),W=await this.getPreferenceUrl();if(!W)return[];const N=await this.getDocumentModelRef(W),y=N.instance.getMonacoModel().getLineContent(v);N.dispose();const R=(y.match(f)||[]).map(w=>{const F=/\"(.*?)\"/g.exec(w);return F&&F[1]||""}),A=this.preferenceSchemaProvider.getCombinedSchema().properties;return R.filter(w=>{const F=A[w];return F?F.type==="boolean"||F.enum:!1})}async onPositionChanged(v){this.hide();const{position:{lineNumber:f}}=v;this._currentLine=f;const W=await this.getPreferencesKeyAtLineNumber(f);W.length>0?this.editor.monacoEditor.getOption(b.editor.EditorOption.glyphMargin)&&this.marginFreeFromOtherDecorations(f)&&this.show(f,(0,u.localize)("editTtile"),W):this.hide()}marginFreeFromOtherDecorations(v){const f=this.editor.monacoEditor.getLineDecorations(v);if(f){for(const{options:W}of f)if(W.glyphMarginClassName&&W.glyphMarginClassName.indexOf((0,o.getIcon)("edit"))===-1)return!1}return!0}async registerMenuItems(v){if(v.length===1){const f=this.getActions(v[0]);this.disposer.addDispose(this.menuRegistry.registerMenuItems(g.MenuId.SettingJSONGlyphMarginContext,f.map(W=>({command:{id:r.SettingJSONGlyphMarginEdit.id,label:W},group:"navigation",extraTailArgs:[v[0],W]}))))}else v.forEach(f=>{const W=`${g.MenuId.SubSettingJSONGlyphMarginContext}_${f}`;this.disposer.addDispose(this.menuRegistry.registerMenuItem(g.MenuId.SettingJSONGlyphMarginContext,{submenu:W,label:f,group:"navigation"}));const N=this.getActions(f);this.disposer.addDispose(this.menuRegistry.registerMenuItems(W,N.map(Z=>({command:{id:r.SettingJSONGlyphMarginEdit.id,label:Z},group:"navigation",extraTailArgs:[f,Z]}))))})}getActions(v){const W=this.preferenceSchemaProvider.getCombinedSchema().properties[v];return W.type==="boolean"?["true","false"]:W.enum?W.enum.map(N=>N.toString()):[]}showContextMenu(v){v.event.preventDefault(),v.event.stopPropagation();const f=this.menuService.createMenu({id:g.MenuId.SettingJSONGlyphMarginContext,config:{separator:"inline"}}),W=f.getMergedMenuNodes();f.dispose(),setTimeout(()=>{this.ctxMenuRenderer.show({anchor:v.event.browserEvent,menuNodes:W,onHide:()=>{const N=(Z,y="menu")=>this.menuRegistry.getMenuItems(Z).map(E=>y==="sub"?E.submenu:E.command).filter(Boolean);N(g.MenuId.SettingJSONGlyphMarginContext,"sub").forEach(Z=>{this.menuRegistry.unregisterMenuItem(g.MenuId.SettingJSONGlyphMarginContext,Z),N(Z).forEach(y=>{this.menuRegistry.unregisterMenuItem(Z,y.id)})}),N(g.MenuId.SettingJSONGlyphMarginContext).forEach(Z=>{this.menuRegistry.unregisterMenuItem(g.MenuId.SettingJSONGlyphMarginContext,Z.id)}),this.menuRegistry.unregisterMenuItem(g.MenuId.SettingJSONGlyphMarginContext,g.MenuId.SubSettingJSONGlyphMarginContext)}})},10)}};n.__decorate([(0,a.Autowired)(I.IPreferenceSettingsService),n.__metadata("design:type",l.PreferenceSettingsService)],c.prototype,"preferenceSettingsService",void 0),n.__decorate([(0,a.Autowired)(g.ICtxMenuRenderer),n.__metadata("design:type",g.ICtxMenuRenderer)],c.prototype,"ctxMenuRenderer",void 0),n.__decorate([(0,a.Autowired)(I.PreferenceSchemaProvider),n.__metadata("design:type",I.PreferenceSchemaProvider)],c.prototype,"preferenceSchemaProvider",void 0),n.__decorate([(0,a.Autowired)(G.IEditorDocumentModelService),n.__metadata("design:type",Object)],c.prototype,"editorDocumentModelService",void 0),n.__decorate([(0,a.Autowired)(p.IFileServiceClient),n.__metadata("design:type",Object)],c.prototype,"fileServiceClient",void 0),n.__decorate([(0,a.Autowired)(g.AbstractContextMenuService),n.__metadata("design:type",g.AbstractContextMenuService)],c.prototype,"menuService",void 0),n.__decorate([(0,a.Autowired)(g.IMenuRegistry),n.__metadata("design:type",g.IMenuRegistry)],c.prototype,"menuRegistry",void 0),n.__decorate([(0,a.Autowired)(u.CommandRegistry),n.__metadata("design:type",Object)],c.prototype,"commandRegistry",void 0),c=n.__decorate([(0,a.Injectable)({multiple:!0}),n.__param(0,(0,a.Optional)()),n.__metadata("design:paramtypes",[Object])],c),e.EditPreferenceDecorationsContribution=c},15789:(L,e,t)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.NextPreferenceItem=void 0;const a=t(85608),o=a.__importDefault(t(53373)),I=a.__importDefault(t(12784)),g=a.__importStar(t(14041)),u=t(76003),G=t(97267),p=t(56849),b=t(41869),m=t(83569),d=t(90184),r=a.__importDefault(t(80881)),l=/`#(.+)#`/gi,s="none",c=({preferenceId:w,localizedName:F,preference:V,scope:Y})=>{var _;const H=(0,b.useInjectable)(b.PreferenceService),S=(0,b.useInjectable)(b.IPreferenceSettingsService),X=(0,b.useInjectable)(b.PreferenceSchemaProvider),Q=H.getProvider(Y),{value:O,effectingScope:M}=S.getPreference(w,Y),[T,x]=(0,g.useState)(Q.get(w)),[B,D]=(0,g.useState)(),[J,k]=(0,g.useState)(()=>S.getEnumLabels(w));(0,g.useEffect)(()=>{const re=X.getPreferenceProperty(w);D(re);const ae=new b.DisposableCollection;return ae.push(Q.onDidPreferencesChanged(he=>{if(he.default&&Object.prototype.hasOwnProperty.call(he.default,w)&&he.default[w].scope===Y){const ee=he.default[w].newValue;x(ee)}})),ae.push(S.onDidEnumLabelsChange(w)((0,I.default)(()=>{D(X.getPreferenceProperty(w)),k(S.getEnumLabels(w))},d.PreferenceSettingsService.DEFAULT_CHANGE_DELAY))),()=>{ae.dispose()}},[]);let z=B;if(z||(z=X.getPreferenceProperty(w)),!z)return g.default.createElement("div",{className:(0,o.default)({[r.default.preference_item]:!0})},w," schema not found.");const P=(_=H.resolve(w,void 0,void 0,void 0,b.PreferenceScope.Default).value)!==null&&_!==void 0?_:z.default,U=T!==void 0&&String(T)!==String(P),oe=()=>{if(z){const re={preferenceName:w,scope:Y,effectingScope:M,schema:z,labels:J,currentValue:T===void 0?O:T,defaultValue:P,localizedName:F,localizedDescription:{description:V.description,markdownDescription:V.markdownDescription},renderedDescription:W({name:F,description:V.description,markdownDescription:V.markdownDescription}),hasValueInScope:T!==void 0,isModified:U};switch(z.type){case"boolean":return g.default.createElement(y,Object.assign({},re));case"integer":case"number":return z.enum?g.default.createElement(E,Object.assign({},re)):g.default.createElement(Z,Object.assign({},re,{isNumber:!0}));case"string":return z.enum?g.default.createElement(E,Object.assign({},re)):g.default.createElement(Z,Object.assign({},re));case"array":return z.items&&z.items.type==="string"?g.default.createElement(A,Object.assign({},re)):g.default.createElement(R,Object.assign({},re));default:return g.default.createElement(R,Object.assign({},re))}}};return g.default.createElement("div",{className:(0,o.default)({[r.default.preference_item]:!0,[r.default.modified]:U}),"data-id":w},oe())};e.NextPreferenceItem=c;const h=w=>{var F;const V=(0,b.useInjectable)(b.IPreferenceSettingsService);if(!w)return null;const Y=w.match(l);if(!Y)return w;let _=w;const H=[];for(const S of Y){if(!_)continue;const X=S.slice(2,S.length-2),Q=(F=m.knownPrefIdMappings[X])!==null&&F!==void 0?F:X,O=V.getPreferenceViewDesc(Q);if(O){const M=(0,m.getPreferenceItemLabel)(O),[T,x]=_.split(S,2);T&&H.push(g.default.createElement("span",{key:H.length},T)),_=x;const B=g.default.createElement("a",{onClick:()=>{V.search(M)},key:Q},M);H.push(B)}}return _&&H.push(g.default.createElement("span",{key:H.length},_)),H};let v=n=class extends p.DefaultMarkedRenderer{codespan(F){var V;if(F.startsWith("#")&&F.endsWith("#")){const Y=F.slice(1,F.length-1),_=(V=m.knownPrefIdMappings[Y])!==null&&V!==void 0?V:Y,H=this.preferenceSettingService.getPreferenceViewDesc(_);if(H){const S=(0,m.getPreferenceItemLabel)(H);return(0,p.linkify)(`${n.openerScheme}${S}`,_,S)}return super.codespan(_)}return super.codespan(F)}};v.openerScheme="prefTitle://",a.__decorate([(0,u.Autowired)(b.IPreferenceSettingsService),a.__metadata("design:type",d.PreferenceSettingsService)],v.prototype,"preferenceSettingService",void 0),v=n=a.__decorate([(0,u.Injectable)()],v);const f=w=>{const F=(0,b.useInjectable)(b.IOpenerService),V=(0,b.useInjectable)(v),Y=(0,b.useInjectable)(b.IPreferenceSettingsService);return g.default.createElement(p.Markdown,{opener:{open(_){if(_.startsWith(v.openerScheme)){const H=_.slice(v.openerScheme.length);return Y.search(H),!0}return F.open(_)}},value:w,renderer:V})},W=w=>{var F;const V=(0,b.replaceLocalizePlaceholder)((F=w.description)!==null&&F!==void 0?F:w.markdownDescription);return V?g.default.createElement("div",{className:r.default.desc},w.markdownDescription?f(V):h(V)):g.default.createElement("div",{className:r.default.desc},w.name)},N=({preferenceName:w,scope:F,effectingScope:V,showReset:Y})=>{const _=(0,b.useInjectable)(b.IPreferenceSettingsService);return g.default.createElement("span",{className:r.default.preference_status},V===b.PreferenceScope.Workspace&&F===b.PreferenceScope.User?g.default.createElement("span",{onClick:()=>{_.selectScope(b.PreferenceScope.Workspace),_.scrollToPreference(w)},className:r.default.preference_overwritten},(0,b.localize)("preference.overwrittenInWorkspace")):void 0,V===b.PreferenceScope.User&&F===b.PreferenceScope.Workspace?g.default.createElement("span",{onClick:()=>{_.selectScope(b.PreferenceScope.User),_.scrollToPreference(w)},className:r.default.preference_overwritten},(0,b.localize)("preference.overwrittenInUser")):void 0,Y?g.default.createElement("span",{className:(0,o.default)(r.default.preference_reset,(0,b.getIcon)("rollback")),onClick:()=>{_.reset(w,F)}}):void 0)};function Z({preferenceName:w,localizedName:F,currentValue:V,renderedDescription:Y,isNumber:_,effectingScope:H,scope:S,isModified:X}){const Q=(0,b.useInjectable)(b.PreferenceService),O=(0,b.useInjectable)(b.PreferenceSchemaProvider),[M,T]=(0,g.useState)();(0,g.useEffect)(()=>{T(V)},[V]);const x=D=>{B(_&&/^[0-9]+$/.test(D)?Number(D):D)||Q.set(w,D,S)};function B(D){const J=O.validate(w,D);if(!J.valid)return{type:2,message:J.reason}}return g.default.createElement(g.default.Fragment,null,g.default.createElement("div",{className:(0,o.default)(r.default.key,r.default.item)},F," ",g.default.createElement(N,{preferenceName:w,scope:S,effectingScope:H,showReset:X})),Y,g.default.createElement("div",{className:r.default.control_wrap},g.default.createElement("div",{className:r.default.text_control},g.default.createElement(G.ValidateInput,{type:_?"number":"text",validate:B,onBlur:()=>{x(M)},onValueChange:D=>{T(D)},value:M}))))}function y({preferenceName:w,localizedName:F,renderedDescription:V,currentValue:Y,effectingScope:_,scope:H,isModified:S}){const X=(0,b.useInjectable)(b.PreferenceService),[Q,O]=(0,g.useState)();(0,g.useEffect)(()=>{O(Y)},[Y]);const M=T=>{O(T),X.set(w,T,H)};return g.default.createElement(g.default.Fragment,null,g.default.createElement("div",{className:(0,o.default)(r.default.key)},F," ",g.default.createElement(N,{preferenceName:w,scope:H,effectingScope:_,showReset:S})),g.default.createElement("div",{className:r.default.check},g.default.createElement(G.CheckBox,{checked:Q,onChange:T=>{M(T.target.checked)}}),V))}function E({preferenceName:w,localizedName:F,renderedDescription:V,currentValue:Y,defaultValue:_,schema:H,labels:S,effectingScope:X,scope:Q,isModified:O}){const M=(0,b.useInjectable)(b.PreferenceService),T=(0,b.useInjectable)(b.ILogger),x=Y??_,B=(0,g.useMemo)(()=>H.enumDescriptions&&H.enum&&H.enumDescriptions[H.enum.indexOf(Y)]||"",[H]),[D,J]=(0,g.useState)(B),k=(0,g.useCallback)(re=>{M.set(w,re,Q)},[M]),z=(0,g.useCallback)(()=>{const re=H.enum?[...H.enum]:[];return _&&!re.includes(_)&&(T.warn(`default value(${_}) of ${w} not found in its enum field`),re.push(_)),re.map((ae,he)=>{typeof ae=="boolean"&&(ae=String(ae));const ee=(0,b.replaceLocalizePlaceholder)(String(S[ae]||ae));return g.default.createElement(G.Option,{value:ae,label:ee,key:`${he}-${ee}`,className:r.default.select_option},ee,String(ae)===String(_)&&g.default.createElement("div",{className:r.default.select_default_option_tips},(0,b.localize)("preference.enum.default")))})},[H.enum,S]),P=()=>g.default.createElement(G.Option,{value:(0,b.localize)("preference.stringArray.none"),key:s,label:(0,b.localize)("preference.stringArray.none"),disabled:!0},(0,b.localize)("preference.stringArray.none")),U=H.enum&&H.enum.length>0?z():P(),oe=(0,g.useCallback)((re,ae)=>{if(H.enumDescriptions){const he=H.enumDescriptions[ae];J(he||"")}},[H.enumDescriptions,J]);return g.default.createElement(g.default.Fragment,null,g.default.createElement("div",{className:r.default.key},F," ",g.default.createElement(N,{preferenceName:w,scope:Q,effectingScope:X,showReset:O})),V,g.default.createElement("div",{className:r.default.control_wrap},g.default.createElement(G.Select,{dropdownRenderType:"absolute",maxHeight:"200",onChange:k,value:x,className:r.default.select_control,description:D,onMouseEnter:oe,notMatchWarning:O?(0,b.formatLocalize)("preference.item.notValid",x):""},U)))}function R({preferenceName:w,localizedName:F,renderedDescription:V,effectingScope:Y,scope:_,hasValueInScope:H}){const S=(0,b.useInjectable)(b.IPreferenceSettingsService),X=async()=>{S.openJSON(_,w)};return g.default.createElement(g.default.Fragment,null,g.default.createElement("div",{className:r.default.key},F," ",g.default.createElement(N,{preferenceName:w,scope:_,effectingScope:Y,showReset:H})),V,g.default.createElement("div",{className:r.default.control_wrap},g.default.createElement("a",{onClick:X},(0,b.localize)("preference.editSettingsJson"))))}function A({preferenceName:w,localizedName:F,currentValue:V,renderedDescription:Y,effectingScope:_,scope:H,isModified:S}){const X=(0,b.useInjectable)(b.PreferenceService),[Q,O]=(0,g.useState)([]),[M,T]=(0,g.useState)(),[x,B]=(0,g.useState)(),[D,J]=(0,g.useState)(-1);(0,g.useEffect)(()=>{O(V||[])},[V]),(0,g.useEffect)(()=>{D>=0?B(Q[D]):B("")},[D]);const k=he=>{O(he),X.set(w,he,H)},z=()=>{if(M){const he=Q.slice(0);if(he.indexOf(M)>-1)return;he.push(M),T(""),k(he)}},P=he=>{const ee=Q.slice(0);ee.splice(he,1),ee.length?k(ee):k([])},U=he=>{J(he)},oe=he=>{T(he)},re=Q.map((he,ee)=>{const pe=JSON.stringify(he);return D>=0&&D===ee?g.default.createElement("li",{className:r.default.array_items,key:`${ee}-${pe}`}):g.default.createElement("li",{className:r.default.array_items,key:`${ee}-${pe}`},g.default.createElement("div",{className:r.default.array_item},typeof he=="string"?he:pe),g.default.createElement("div",{className:r.default.operate},g.default.createElement(G.Button,{type:"icon",title:(0,b.localize)("preference.stringArray.operate.edit"),onClick:()=>{U(ee)},className:(0,o.default)((0,b.getIcon)("edit"),r.default.array_item)}),g.default.createElement(G.Button,{type:"icon",title:(0,b.localize)("preference.stringArray.operate.delete"),onClick:()=>{P(ee)},className:(0,o.default)((0,b.getIcon)("delete"),r.default.array_item)})))}),ae=()=>{const he=()=>{const pe=Q.slice(0);x?pe[D]=x:pe.splice(D,1),O(pe),X.set(w,pe,H),J(-1)},ee=pe=>{B(pe)};if(D>=0)return g.default.createElement("div",{className:r.default.array_edit_wrapper,style:{top:D*24}},g.default.createElement(G.Input,{type:"text",className:r.default.array_edit_input,value:x,onValueChange:ee,onPressEnter:he,addonAfter:[g.default.createElement("div",{className:r.default.array_edit_input_tip},(0,b.localize)("preference.stringArray.operate.editTip"))]}))};return g.default.createElement(g.default.Fragment,null,g.default.createElement("div",{className:r.default.key},F," ",g.default.createElement(N,{preferenceName:w,scope:H,effectingScope:_,showReset:S})),Y,g.default.createElement("div",{className:r.default.control_wrap},g.default.createElement("ul",{className:r.default.array_items_wrapper},re,ae()),g.default.createElement("div",{className:r.default.preferences_flex_row},g.default.createElement(G.Input,{type:"text",className:r.default.text_control,value:M,onValueChange:oe}),g.default.createElement(G.Button,{className:r.default.add_button,onClick:z},(0,b.localize)("preference.array.additem","Add")))))}},99187:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PreferenceItem=e.PreferenceView=void 0;const n=t(85608),a=n.__importDefault(t(12784)),o=n.__importStar(t(14041)),I=n.__importDefault(t(19686)),g=t(97267),u=t(91802),G=t(41869),p=t(99333),b=n.__importDefault(t(39572)),m=t(83569),d=t(15789),r=n.__importDefault(t(80881)),l="preferenceViewIndexTree",s=8,c=()=>{const N=(0,G.useInjectable)(G.IPreferenceSettingsService),[Z,y]=(0,o.useState)([]),[E,R]=(0,o.useState)([]),A=(0,b.default)(()=>{const X=N.currentScope,Q=N.currentSearch,O=N.getSettingGroups(X,Q),M=[],T=[];for(let D=0;D<O.length;D++){const J=O[D],k=N.getResolvedSections(J.id,X,Q);M.push(...x(J,k)),T.push(B(D,J,k))}y(M),R(T);function x(D,J){const k=[],z=(P,U="")=>{let oe=U;P.title&&(oe=U+"/"+P.title);const re=[];return P.component?re.push({component:P.component,scope:X}):P.preferences?re.push(...P.preferences.map(ae=>({id:"preference:"+ae.id,preference:ae,scope:X,_path:oe}))):P.subSections&&P.subSections.forEach(ae=>{const he=z(ae,oe);re.push(...he)}),re.length>0&&P.title&&re.unshift({id:"section:"+P.title,title:P.title,scope:X,_path:oe}),re};for(const P of J){const U=z(P,D.title);k.push(...U)}return k.length>0&&D.title&&k.unshift({title:D.title,id:"group:"+D.id,scope:X,_path:D.title}),k}function B(D,J,k){const{id:z,title:P,iconClass:U}=J,oe={label:(0,m.toNormalCase)(P),iconClassName:U,groupId:z,order:D,className:r.default.group_item},re=[];return k.forEach((ae,he)=>{const ee=v(z,ae,he,1);ee&&re.push(ee)}),oe.children=re,re.length>0?oe.expandable=!0:oe.expandable=!1,oe}},16);(0,o.useEffect)(()=>{const X=new G.Disposable(N.emitter.on("settingsGroupsChange",()=>{A.run()}),N.emitter.on("currentSearchChange",()=>{A.run()}),N.emitter.on("currentScopeChange",()=>{A.run()}),N.emitter.on("settingsSectionsChange",()=>{A.run()}));return A.run(),()=>{X.dispose()}},[]);const w=(0,G.useInjectable)(G.LabelService),F=(0,o.useCallback)((X,Q)=>w.getIcon(G.URI.parse(X),Q),[]),V=(0,o.useRef)(null),Y=(0,a.default)(X=>{N.search(X)},100,{maxWait:300});(0,o.useEffect)(()=>{const X=N.onFocus(()=>{V&&V.current&&(V.current.focus(),V.current.select())});return()=>{X.dispose()}},[]);const _=(0,G.useEventDrivenState)(N.emitter,"currentSearchChange",()=>N.currentSearch),H=(0,G.useEventDrivenState)(N.emitter,"tabListChange",()=>N.tabList),S=(0,G.useEventDrivenState)(N.emitter,"tabIndexChange",()=>N.tabIndex);return o.default.createElement(g.ComponentContextProvider,{value:{getIcon:G.getIcon,localize:G.localize,getResourceIcon:F}},o.default.createElement("div",{className:r.default.preferences},o.default.createElement("div",{className:r.default.preferences_header},o.default.createElement(g.Tabs,{className:r.default.tabs,value:S,onChange:X=>{N.updateTabIndex(X)},tabs:H.map(X=>(0,G.localize)(X.label))}),o.default.createElement("div",{className:r.default.search_pref},o.default.createElement(g.Input,{autoFocus:!0,value:_,placeholder:(0,G.localize)("preference.searchPlaceholder"),onValueChange:Y,ref:V,hasClear:!0}))),Z.length>0?o.default.createElement(p.SplitPanel,{id:"preference-panel",resizeHandleClassName:r.default.devider,className:r.default.preferences_body,direction:"left-to-right"},o.default.createElement(f,{treeData:E,"data-sp-defaultSize":180,"data-sp-minSize":150}),o.default.createElement(W,{tabIndex:S,items:Z,"data-sp-flex":1})):o.default.createElement("div",{className:r.default.preference_noResults},_?(0,G.formatLocalize)("preference.noResults",_):(0,G.formatLocalize)("preference.empty"))))};e.PreferenceView=c;const h=({data:N,index:Z})=>{var y;if(N.title)return!((y=N.id)===null||y===void 0)&&y.startsWith("group:")?o.default.createElement("div",{className:r.default.group_title,id:N.id},N.title):o.default.createElement("div",{className:r.default.section_title,id:N.id},N.title);if(N.component)return o.default.createElement(N.component,{scope:N.scope});if(N.preference)return o.default.createElement(d.NextPreferenceItem,{key:`${Z} - ${N.preference.id} - ${N.scope}`,preference:N.preference,preferenceId:N.preference.id,localizedName:N.preference.label,scope:N.scope})};e.PreferenceItem=h;const v=(N,Z,y,E)=>{let R;Z.title&&(R={label:Z.title,section:Z.title,groupId:N,order:y,indentOffset:E===1?-s:-(s>>1),className:r.default.index_item});const A=[];return Z.subSections&&Z.subSections.forEach((w,F)=>{const V=v(N,w,F,E+1);V&&A.push(V)}),R&&A&&A.length>0&&(R.children=A,R.expandable=!0),R},f=N=>{const Z=(0,G.useInjectable)(G.IPreferenceSettingsService),{treeData:y}=N;return o.default.createElement(I.default,{className:r.default.preferences_indexes},({width:E,height:R})=>o.default.createElement(g.BasicRecycleTree,{treeName:l,sortComparator:(A,w)=>{if(typeof A.order<"u"&&typeof w.order<"u")return A.order>w.order?1:A.order<w.order?-1:0},height:R,width:E,itemHeight:26,baseIndent:s,indent:12,treeData:y,onClick:(A,w)=>{const F=w&&w._raw;F&&(F.section?Z.scrollToSection(F.section):F.groupId&&Z.scrollToGroup(F.groupId))},onReady:A=>{Z.handleTreeHandler(A)}}))},W=N=>{const Z=(0,G.useInjectable)(G.IPreferenceSettingsService),[y,E]=(0,o.useState)(void 0),{items:R}=N;(0,o.useEffect)(()=>{var V;y&&(!((V=Z.treeHandler)===null||V===void 0)&&V.focusItem)&&Z.treeHandler.focusItem(y)},[N.tabIndex,Z.treeHandler,y]);const A=V=>{var Y;if(V){const _=R.findIndex(H=>H.id===V);_>=0&&((Y=Z.listHandler)===null||Y===void 0||Y.scrollToIndex({index:_,behavior:"auto",align:"start"}))}},w=(0,b.default)(V=>{const Y=R[V.startIndex+1];Y&&Y._path&&E(Y._path)},16*3,{leading:!0,trailing:!0}),F=(0,G.useEventDrivenState)(Z.emitter,"currentSelectIdChange",()=>Z.currentSelectId);return(0,o.useEffect)(()=>{F&&A(F)},[R,F]),o.default.createElement("div",{className:r.default.preferences_items},o.default.createElement(u.VirtualList,{data:R,template:e.PreferenceItem,className:r.default.preference_section,refSetter:Z.handleListHandler,onRangeChanged:w.run}))}},76773:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserPreferenceProvider=e.USER_PREFERENCE_URI=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(78132),g=t(11461);e.USER_PREFERENCE_URI=new o.URI().withScheme(o.Schemes.userStorage).withPath("settings.json");let u=class extends g.AbstractResourcePreferenceProvider{getUri(){return e.USER_PREFERENCE_URI}getScope(){return I.PreferenceScope.User}};u=n.__decorate([(0,a.Injectable)()],u),e.UserPreferenceProvider=u},25947:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=t(85608);n.__exportStar(t(84017),e),n.__exportStar(t(57506),e)},57506:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserStorageContribution=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(14951),g=t(2156),u=t(83569);let G=class{initialize(){this.fileSystem.registerProvider(o.Schemes.userStorage,this.userStorageService)}};n.__decorate([(0,a.Autowired)(u.IUserStorageService),n.__metadata("design:type",Object)],G.prototype,"userStorageService",void 0),n.__decorate([(0,a.Autowired)(I.IFileServiceClient),n.__metadata("design:type",g.FileServiceClient)],G.prototype,"fileSystem",void 0),G=n.__decorate([(0,o.Domain)(o.ClientAppContribution)],G),e.UserStorageContribution=G},84017:(L,e,t)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.UserStorageServiceImpl=e.DEFAULT_USER_STORAGE_FOLDER=void 0;const a=t(85608),o=a.__importDefault(t(82451)),I=t(76003),g=t(41869),u=t(43718),G=t(42933);e.DEFAULT_USER_STORAGE_FOLDER=".sumi";const p={recursive:!1,excludes:["**/logs/**"]};let b=n=class{static toUserStorageUri(d,r){const l=this.getRelativeUserStoragePath(d,r);return new g.URI("").withScheme(u.Schemes.userStorage).withPath(l).withFragment(r.fragment).withQuery(r.query)}static getRelativeUserStoragePath(d,r){return r.toString().slice(d.toString().length+1)}static toFilesystemURI(d,r){return d.withPath(d.path.join(r.path.toString()))}constructor(){this.capabilities=2,this.onDidChangeCapabilities=u.Event.None,this.toDispose=new g.DisposableCollection,this.onDidChangeFileEmitter=new g.Emitter,this._whenReady=this.init()}get whenReady(){return this._whenReady}get onDidChangeFile(){return this.onDidChangeFileEmitter.event}async init(){const d=await this.fileServiceClient.getCurrentUserHome();if(d){const r=new g.URI(d.uri).resolve(this.appConfig.userPreferenceDirName||this.appConfig.preferenceDirName||e.DEFAULT_USER_STORAGE_FOLDER);await this.fileServiceClient.access(r.toString())||await this.fileServiceClient.createFolder(r.toString()),this.userStorageFolder=r}this.toDispose.push(this.onDidChangeFileEmitter)}readDirectory(d){throw new Error("Method not implemented.")}createDirectory(d){throw new Error("Method not implemented.")}async watch(d,r){await this.whenReady;const l=n.toFilesystemURI(this.userStorageFolder,g.URI.from(d)),s=(0,o.default)(p,r),c=await this.fileServiceClient.watchFileChanges(l.parent,s.excludes);return this.toDispose.push(c),this.toDispose.push(c.onFilesChanged(h=>{const v=[];for(const f of h)f.uri===l.toString()&&v.push(f);v.length>0&&this.onDidChangeFileEmitter.fire(v.map(f=>({uri:n.toUserStorageUri(this.userStorageFolder,new g.URI(f.uri)).toString(),type:f.type})))})),c.watchId}async readFile(d){await this.whenReady;const r=n.toFilesystemURI(this.userStorageFolder,g.URI.from(d));try{const{content:l}=await this.fileServiceClient.readFile(r.toString());return l.buffer}catch(l){throw new Error(l)}}async writeFile(d,r,l){await this.whenReady;const s=n.toFilesystemURI(this.userStorageFolder,g.URI.from(d));try{let c=await this.fileServiceClient.getFileStat(s.toString());c?await this.fileServiceClient.setContent(c,r,l):(c=await this.fileServiceClient.createFile(s.toString()),await this.fileServiceClient.setContent(c,r,l))}catch(c){throw new Error(c)}}delete(d,r){throw new Error("Method not implemented.")}rename(d,r,l){throw new Error("Method not implemented.")}copy(d,r,l){throw new Error("Method not implemented.")}async stat(d){await this.whenReady;const r=n.toFilesystemURI(this.userStorageFolder,g.URI.from(d)),l=await this.fileServiceClient.getFileStat(r.toString());if(l)return l}async access(d,r){await this.whenReady;const l=n.toFilesystemURI(this.userStorageFolder,g.URI.from(d));return this.fileServiceClient.access(l.toString(),r)}};a.__decorate([(0,I.Autowired)(G.IFileServiceClient),a.__metadata("design:type",Object)],b.prototype,"fileServiceClient",void 0),a.__decorate([(0,I.Autowired)(g.ILogger),a.__metadata("design:type",Object)],b.prototype,"logger",void 0),a.__decorate([(0,I.Autowired)(g.AppConfig),a.__metadata("design:type",Object)],b.prototype,"appConfig",void 0),b=n=a.__decorate([(0,I.Injectable)(),a.__metadata("design:paramtypes",[])],b),e.UserStorageServiceImpl=b},46392:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceFilePreferenceProvider=e.WorkspaceFilePreferenceProviderFactory=e.WorkspaceFilePreferenceProviderOptions=void 0;const n=t(85608),a=t(76003),o=t(78132),I=t(51500),g=t(84435),u=t(11461);let G=class{};G=n.__decorate([(0,a.Injectable)()],G),e.WorkspaceFilePreferenceProviderOptions=G,e.WorkspaceFilePreferenceProviderFactory=Symbol("WorkspaceFilePreferenceProviderFactory");let p=class extends u.AbstractResourcePreferenceProvider{getUri(){return this.options.workspaceUri}parse(m){const d=super.parse(m);return g.WorkspaceData.is(d)?d.settings||{}:{}}getPath(m){return["settings",m]}getScope(){return o.PreferenceScope.Workspace}getDomain(){return this.workspaceService.tryGetRoots().map(m=>m.uri)}};n.__decorate([(0,a.Autowired)(I.IWorkspaceService),n.__metadata("design:type",Object)],p.prototype,"workspaceService",void 0),n.__decorate([(0,a.Autowired)(G),n.__metadata("design:type",G)],p.prototype,"options",void 0),p=n.__decorate([(0,a.Injectable)()],p),e.WorkspaceFilePreferenceProvider=p},58705:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspacePreferenceProvider=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(78132),g=t(51500),u=t(46392);let G=class extends I.PreferenceProvider{constructor(){super(),this.toDisposeOnEnsureDelegateUpToDate=new o.DisposableCollection,this.init()}async init(){this._ready.resolve(),this.ensureDelegateUpToDate(),this.workspaceService.onWorkspaceLocationChanged(()=>this.ensureDelegateUpToDate())}getConfigUri(b=this.ensureResourceUri()){const m=this.delegate;return m&&m.getConfigUri(b)}get delegate(){return this._delegate||this.ensureDelegateUpToDate(),this._delegate}ensureDelegateUpToDate(){const b=this.createDelegate();this._delegate!==b&&(this.toDisposeOnEnsureDelegateUpToDate.dispose(),this.toDispose.push(this.toDisposeOnEnsureDelegateUpToDate),this._delegate=b,b&&this.toDisposeOnEnsureDelegateUpToDate.pushAll([b,b.onDidPreferencesChanged(m=>{this.emitPreferencesChangedEvent(m)})]))}createDelegate(){const b=this.workspaceService.workspace;if(b)return this.workspaceService.isMultiRootWorkspaceOpened?this.workspaceFileProviderFactory({workspaceUri:new o.URI(b.uri)}):this.foldersPreferenceProvider}doGet(b,m=this.ensureResourceUri(),d){const r=this.delegate;return r?r.get(b,m,d):void 0}doResolve(b,m=this.ensureResourceUri(),d){const r=this.delegate;return r?r.resolve(b,m,d):{}}getPreferences(b=this.ensureResourceUri(),m){const d=this.delegate;return d?d.getPreferences(b,m):void 0}getLanguagePreferences(b=this.ensureResourceUri()){const m=this.delegate;return m?m.getLanguagePreferences(b):void 0}async doSetPreference(b,m,d=this.ensureResourceUri(),r){const l=this.delegate;return l?l.setPreference(b,m,d,r):!1}ensureResourceUri(){if(this.workspaceService.workspace&&!this.workspaceService.isMultiRootWorkspaceOpened)return this.workspaceService.workspace.uri}};n.__decorate([(0,a.Autowired)(g.IWorkspaceService),n.__metadata("design:type",Object)],G.prototype,"workspaceService",void 0),n.__decorate([(0,a.Autowired)(u.WorkspaceFilePreferenceProviderFactory),n.__metadata("design:type",Function)],G.prototype,"workspaceFileProviderFactory",void 0),n.__decorate([(0,a.Autowired)(I.PreferenceProvider,{tag:I.PreferenceScope.Folder}),n.__metadata("design:type",I.PreferenceProvider)],G.prototype,"foldersPreferenceProvider",void 0),G=n.__decorate([(0,a.Injectable)(),n.__metadata("design:paramtypes",[])],G),e.WorkspacePreferenceProvider=G},60295:(L,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SettingJSONGlyphMarginEdit=void 0,e.SettingJSONGlyphMarginEdit={id:"preference.setting.glyphMargin.edit"}},83569:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=t(85608);n.__exportStar(t(99112),e),n.__exportStar(t(36858),e),n.__exportStar(t(49132),e),n.__exportStar(t(29728),e)},49132:(L,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.knownPrefIdMappings=e.PreferenceSettingId=void 0;var t;(function(n){n.General="general",n.Editor="editor",n.Terminal="terminal",n.Feature="feature",n.View="view"})(t=e.PreferenceSettingId||(e.PreferenceSettingId={})),e.knownPrefIdMappings={"workbench.editor.enablePreview":"editor.previewMode"}},99112:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toNormalCase=e.getPreferenceItemLabel=e.toPreferenceReadableName=e.knownTermMappings=e.PREF_SCHEME=void 0;const n=t(41869);e.PREF_SCHEME="pref",e.knownTermMappings=new Map,e.knownTermMappings.set("power shell","PowerShell"),e.knownTermMappings.set("powershell","PowerShell"),e.knownTermMappings.set("javascript","JavaScript"),e.knownTermMappings.set("typescript","TypeScript"),["css","html","scss","less","json","js","ts","ie","id","php","scm","npm"].forEach(u=>{e.knownTermMappings.set(u,u.toUpperCase())});function a(u){const G=u.toLowerCase();return e.knownTermMappings.has(G)?e.knownTermMappings.get(G):g(u)}function o(u){const G=u.split(".");let p=a(G[0]);return G[1]&&(p+=" > "+g(G[1])),G[2]&&(p+=" : "+g(G[2])),G.slice(3).length>0&&(p+=". "+G.slice(3).join(" ")),p}e.toPreferenceReadableName=o;function I(u){let G;return u.localized&&(G=(0,n.localize)(u.localized)),G||(G=o(u.id)),G}e.getPreferenceItemLabel=I;function g(u){return u.substr(0,1).toUpperCase()+u.substr(1).replace(/([^A-Z])([A-Z])/g,"$1 $2")}e.toNormalCase=g},29728:(L,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SettingContribution=void 0,e.SettingContribution=Symbol("SettingContribution")},36858:(L,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IUserStorageService=void 0,e.IUserStorageService=Symbol("IUserStorageService")},46507:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),t(85608).__exportStar(t(83569),e)},70716:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HighlightLabel=void 0;const a=t(85608).__importDefault(t(14041)),o=t(41869),I=t(48560),g=t(52416),u=({text:G="",highlights:p=[],className:b="",labelClassName:m="",labelIconClassName:d="",hightLightClassName:r="",OutElementType:l="span"})=>{const s=(0,I.useInjectable)(g.IIconService),c=a.default.useMemo(()=>{const h=[];let v=0;for(const f of p){if(f.end===f.start)continue;if(v<f.start){const N=G.substring(v,f.start);h.push(a.default.createElement("span",{className:m,key:`${h.length}-${N}`},(0,o.transformLabelWithCodicon)(N,d,s.fromString.bind(s)))),v=f.end}const W=G.substring(f.start,f.end);h.push(a.default.createElement("span",{className:r,key:`${h.length}-${W}`},(0,o.transformLabelWithCodicon)(W,d,s.fromString.bind(s)))),v=f.end}if(v<G.length){const f=G.substring(v);h.push(a.default.createElement("span",{className:m,key:`${h.length}-${f}`},(0,o.transformLabelWithCodicon)(f,d,s.fromString.bind(s))))}return h},[G,p]);return a.default.createElement(l,{title:G,className:b},c)};e.HighlightLabel=u},52644:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KeybindingView=void 0;const n=t(85608),a=n.__importDefault(t(53373)),o=n.__importDefault(t(14041)),I=t(41869),g=n.__importDefault(t(26739)),u=({keybinding:G,className:p,sequenceClassName:b,keyClassName:m})=>{const d=(0,I.useInjectable)(I.KeybindingRegistry),r=o.default.useMemo(()=>d.acceleratorFor(G," "),[G]);return o.default.createElement("div",{className:(0,a.default)(g.default.keybinding,p)},r?r.map((l,s)=>{const c=l.split(" ");return o.default.createElement("div",{key:`${l}_${s}`,title:l,className:(0,a.default)(g.default.key_sequence,b)},c.map((h,v)=>o.default.createElement("span",{className:(0,a.default)(g.default.key,m),key:`${h}_${s}_${v}`},h)))}):null)};e.KeybindingView=u},47005:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QuickOpenTabs=void 0;const n=t(85608),a=n.__importDefault(t(53373)),o=n.__importDefault(t(14041)),I=t(41869),g=t(63373),u=t(52644),G=n.__importDefault(t(78539)),p=({tabs:b,activePrefix:m,onChange:d,toggleTab:r})=>{const l=(0,I.useInjectable)(I.KeybindingRegistry),s=c=>{const h=l.getKeybindingsForCommand(c);return h?h[0]:void 0};return o.default.createElement("div",{id:g.VIEW_CONTAINERS.QUICKPICK_TABS,className:G.default.quickopen_tabs},o.default.createElement("div",{className:G.default.quickopen_tabs_left},b.map(({title:c,prefix:h,commandId:v,order:f},W)=>{const N=s(v);return o.default.createElement("div",{key:h,className:G.default.quickopen_tabs_left_item,onMouseDown:Z=>Z.preventDefault(),onClick:()=>{h!==m&&d(h)}},o.default.createElement("div",{className:(0,a.default)(G.default.quickopen_tabs_left_item_text,{[G.default.selected]:m===h})},c),N&&o.default.createElement(u.KeybindingView,{keybinding:N,className:G.default.keybinding,keyClassName:G.default.tab_key}))})),o.default.createElement("div",{style:{flex:1}}),o.default.createElement("div",{className:G.default.quickopen_tabs_tip,onClick:()=>{r?.()}},(0,I.localize)("quickopen.tab.tip.prefix"),o.default.createElement("span",{className:G.default.tab_key},"Tab"),(0,I.localize)("quickopen.tab.tip.suffix")))};e.QuickOpenTabs=p},96534:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QuickOpenModule=e.CoreQuickOpenModule=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(74404),g=t(80490),u=t(99066),G=t(65028),p=t(43131),b=t(13978);let m=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:I.PrefixQuickOpenService,useClass:g.PrefixQuickOpenServiceImpl},{token:o.QuickOpenService,useClass:p.MonacoQuickOpenService},{token:I.QuickPickService,useClass:b.QuickPickServiceImpl},{token:I.IQuickInputService,useClass:u.QuickInputService},G.CoreQuickOpenContribution],this.contributionProvider=g.QuickOpenContribution}};m=n.__decorate([(0,a.Injectable)()],m),e.CoreQuickOpenModule=m;let d=class extends m{constructor(){super(...arguments),this.providers=this.providers.concat(G.QuickOpenFeatureContribution)}};d=n.__decorate([(0,a.Injectable)()],d),e.QuickOpenModule=d},80490:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PrefixQuickOpenServiceImpl=e.QuickOpenHandlerRegistry=e.QuickOpenContribution=void 0;const n=t(85608),a=n.__importDefault(t(14041)),o=t(76003),I=t(41869),g=t(18193),u=t(74404),G=t(43718),p=t(47005),b=t(50426);var m=t(74404);Object.defineProperty(e,"QuickOpenContribution",{enumerable:!0,get:function(){return m.QuickOpenContribution}});let d=class extends G.Disposable{constructor(){super(...arguments),this.handlers=new Map,this.tabs=[],this.sortedTabs=null,this.handlerTabMap=new Map}registerHandler(s,c){if(this.handlers.has(s.prefix))return this.logger.warn(`The handler function of the \`${s.prefix}\` is already registered`),G.Disposable.NULL;this.handlers.set(s.prefix,s);const h={dispose:()=>this.handlers.delete(s.prefix)};if(this.addDispose(h),s.default&&(this.defaultHandler=s),c&&!c.hideTab){const v=[],{sub:f}=c,W=n.__rest(c,["sub"]);f&&Object.keys(f).forEach(N=>{v.push(Object.assign({prefix:`${s.prefix}${N}`},f[N]))}),v.push(Object.assign({prefix:s.prefix},W)),this.handlerTabMap.set(s,v),this.tabs.push(...v),this.sortedTabs=null,this.addDispose({dispose:()=>{const N=this.handlerTabMap.get(s);N&&(this.handlerTabMap.delete(s),this.tabs=this.tabs.filter(Z=>!N.includes(Z)),this.sortedTabs=null)}})}return h}getDefaultHandler(){return this.defaultHandler}isDefaultHandler(s){return s===this.getDefaultHandler()}getHandlers(){return[...this.handlers.values()]}getHandlerOrDefault(s){for(const c of this.handlers.values())if(s.startsWith(c.prefix))return c;return this.getDefaultHandler()}getSortedTabs(){return this.sortedTabs||(this.sortedTabs=this.tabs.slice().sort((s,c)=>s.order-c.order)),this.sortedTabs}getTabByHandler(s,c){if(this.handlerTabMap.has(s)){let h=c;return this.isDefaultHandler(s)&&!c.startsWith(s.prefix)&&(h=`${s.prefix}${c}`),this.handlerTabMap.get(s).find(v=>h.startsWith(v.prefix))}}};n.__decorate([(0,o.Autowired)(G.ILogger),n.__metadata("design:type",Object)],d.prototype,"logger",void 0),d=n.__decorate([(0,o.Injectable)()],d),e.QuickOpenHandlerRegistry=d;let r=class{constructor(){this.activePrefix="",this.currentLookFor="",this.toDisposeCurrent=new G.DisposableCollection}open(s,c){const h=this.handlers.getHandlerOrDefault(s);let v=!1;c?s=`${s}${c}`:this.corePreferences["workbench.quickOpen.preserveInput"]&&h&&h===this.currentHandler&&this.currentLookFor&&this.handlers.getTabByHandler(h,this.currentLookFor)===this.handlers.getTabByHandler(h,s)?(s=this.currentLookFor,v=!0):this.currentLookFor="",this.setCurrentHandler(s,h,v)}async setCurrentHandler(s,c,h){var v,f;if(c!==this.currentHandler&&(this.toDisposeCurrent.dispose(),this.currentHandler=c,this.toDisposeCurrent.push(G.Disposable.create(()=>{const E=c&&c.getOptions().onClose;E&&E(!0)}))),!c){this.doOpen();return}c.init&&await c.init(),this.setActivePrefix(c,s);let W=s;this.handlers.isDefaultHandler(c)&&s.startsWith(c.prefix)&&(W=s.substring(c.prefix.length));const N=this.handlers.isDefaultHandler(c)?0:((f=(v=this.handlers.getTabByHandler(c,s))===null||v===void 0?void 0:v.prefix)!==null&&f!==void 0?f:c.prefix).length,Z=c.getOptions(),y=()=>{var E;(E=c.onToggle)===null||E===void 0||E.call(c);const R=this.handlers.getSortedTabs();let A=null;if(this.activePrefix){let w=R.findIndex(F=>F.prefix===this.activePrefix);w=w===R.length-1?0:w+1,A=R[w]}else A=R[0];A&&this.open(A.prefix)};this.doOpen(Object.assign(Object.assign({prefix:W,skipPrefix:N,valueSelection:h?[N,s.length]:void 0},Z),{onClose:E=>{Z.onClose&&Z.onClose(E),c.onClose&&c.onClose(E)},renderTab:()=>a.default.createElement(p.QuickOpenTabs,{tabs:this.handlers.getSortedTabs(),activePrefix:this.activePrefix,onChange:E=>{var R;(R=c.onToggle)===null||R===void 0||R.call(c),this.open(E)},toggleTab:()=>{y()}}),toggleTab:()=>{y()}}))}doOpen(s){this.quickTitleBar.isAttached&&this.quickTitleBar.hide(),this.quickOpenService.open({onType:(c,h)=>this.onType(c,h)},s)}onType(s,c){this.currentLookFor=s;const h=this.handlers.getHandlerOrDefault(s);if(h===void 0){const v=[];v.push(new u.QuickOpenItem({label:(0,I.localize)("quickopen.command.nohandler")})),c(v)}else if(h!==this.currentHandler)this.setCurrentHandler(s,h);else{const v=h.getModel(),f=this.handlers.isDefaultHandler(h)?s:s.substr(h.prefix.length);v.onType(f,(W,N)=>c(W,N)),this.setActivePrefix(h,s)}}setActivePrefix(s,c){var h,v;this.activePrefix=(v=(h=this.handlers.getTabByHandler(s,c))===null||h===void 0?void 0:h.prefix)!==null&&v!==void 0?v:""}};n.__decorate([(0,o.Autowired)(d),n.__metadata("design:type",d)],r.prototype,"handlers",void 0),n.__decorate([(0,o.Autowired)(u.QuickOpenService),n.__metadata("design:type",Object)],r.prototype,"quickOpenService",void 0),n.__decorate([(0,o.Autowired)(b.QuickTitleBar),n.__metadata("design:type",b.QuickTitleBar)],r.prototype,"quickTitleBar",void 0),n.__decorate([(0,o.Autowired)(g.CorePreferences),n.__metadata("design:type",Object)],r.prototype,"corePreferences",void 0),r=n.__decorate([(0,o.Injectable)()],r),e.PrefixQuickOpenServiceImpl=r},99066:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QuickInputService=void 0;const n=t(85608),a=t(76003),o=t(97267),I=t(74404),g=t(43718),u=t(50426),G=t(44854);let p=class{constructor(){this.onDidAcceptEmitter=new g.Emitter,this.onDidChangeValueEmitter=new g.Emitter}open(m){this.inputBox&&this.inputBox.hide();const d=new g.Deferred,r=m&&m.validateInput;m.hideOnDidAccept===void 0&&(m.hideOnDidAccept=!0);const l=this.injector.get(G.InputBoxImpl,[m]);return this.inputBox=l,l.onDidAccept(s=>{d.resolve(s),this.onDidAcceptEmitter.fire()}),l.getDerivedOptionsFromValue=async s=>{var c;const h=r&&s!==void 0?(0,g.withNullAsUndefined)(await r(s)):void 0;return{validationMessage:typeof h=="string"?h:h?.message,validationType:typeof h=="string"?o.VALIDATE_TYPE.ERROR:(c=h?.type)!==null&&c!==void 0?c:o.VALIDATE_TYPE.ERROR}},l.onDidChangeValue(async s=>{this.onDidChangeValueEmitter.fire(s)}),l.onDidHide(()=>{d.resolve(void 0)}),l.open(),d.promise}refresh(){var m;(m=this.inputBox)===null||m===void 0||m.refresh()}hide(){var m;(m=this.inputBox)===null||m===void 0||m.hide()}dispose(){var m;(m=this.inputBox)===null||m===void 0||m.dispose()}get onDidAccept(){return this.onDidAcceptEmitter.event}get onDidChangeValue(){return this.onDidChangeValueEmitter.event}};n.__decorate([(0,a.Autowired)(I.QuickOpenService),n.__metadata("design:type",Object)],p.prototype,"quickOpenService",void 0),n.__decorate([(0,a.Autowired)(u.QuickTitleBar),n.__metadata("design:type",u.QuickTitleBar)],p.prototype,"quickTitleBar",void 0),n.__decorate([(0,a.Autowired)(a.INJECTOR_TOKEN),n.__metadata("design:type",a.Injector)],p.prototype,"injector",void 0),p=n.__decorate([(0,a.Injectable)()],p),e.QuickInputService=p},11143:(L,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QuickOpenBaseAction=void 0;class t{constructor(a){this.options=a}get id(){return this.options.id}get label(){return this.options.label||""}set label(a){this.options.label=a}get tooltip(){return this.options.tooltip||""}set tooltip(a){this.options.tooltip=a}get class(){return this.options.class||""}set class(a){this.options.class=a}get enabled(){return this.options.enabled||!0}set enabled(a){this.options.enabled=a}get checked(){return this.options.checked||!1}set checked(a){this.options.checked=a}get radio(){return this.options.radio||!1}set radio(a){this.options.radio=a}dispose(){}}e.QuickOpenBaseAction=t},78245:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QuickOpenItemService=void 0;const n=t(85608),a=t(76003),o=t(40827),I=t(43718),g=t(52416),u=t(89802);let G=class{constructor(){this.onDidTriggerItemButtonEmitter=new I.Emitter}get onDidTriggerItemButton(){return this.onDidTriggerItemButtonEmitter.event}fireDidTriggerItemButton(b,m){this.onDidTriggerItemButtonEmitter.fire({button:m,item:{handle:b}})}getButtons(b){return b.length===0?[]:b.map((m,d)=>{const r=(0,u.iconPath2URI)(m.iconPath,this.themeService.getCurrentThemeSync().type),l=r&&this.staticResourceService.resolveStaticResource(r).toString(),s=l&&this.iconService.fromIcon("",l,g.IconType.Background);return Object.assign(Object.assign({},m),{iconClass:s,handle:d})})}};n.__decorate([(0,a.Autowired)(g.IThemeService),n.__metadata("design:type",Object)],G.prototype,"themeService",void 0),n.__decorate([(0,a.Autowired)(),n.__metadata("design:type",o.StaticResourceService)],G.prototype,"staticResourceService",void 0),n.__decorate([(0,a.Autowired)(g.IIconService),n.__metadata("design:type",Object)],G.prototype,"iconService",void 0),G=n.__decorate([(0,a.Injectable)()],G),e.QuickOpenItemService=G},90404:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CommandQuickOpenItem=e.QuickCommandHandler=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(18193),g=t(93899),u=t(74404),G=t(43718),p=t(77714),b=t(51500);let m=class{constructor(){this.prefix=">",this.description=(0,o.localize)("quickopen.command.description"),this.initDeferred=new G.Deferred,this.initRecentlyUsedCommands()}async init(){await this.initDeferred.promise,this.items=this.getItems()}async initRecentlyUsedCommands(){const s=(await this.workspaceService.getMostRecentlyUsedCommands()).map(c=>this.commandRegistry.getCommand(c)).filter(c=>!!c).reverse();this.commandRegistry.setRecentCommands(s),this.initDeferred.resolve()}getModel(){return{onType:(l,s)=>{s(this.items),this.reporterService.point(G.REPORT_NAME.QUICK_OPEN_MEASURE,"command",{lookFor:l})}}}getOptions(){return{placeholder:(0,o.localize)("quickopen.command.placeholder"),fuzzyMatchLabel:{enableSeparateSubstringMatching:!0},fuzzyMatchDetail:{enableSeparateSubstringMatching:!0},fuzzySort:!1,getPlaceholderItem:()=>new u.QuickOpenItem({label:(0,o.localize)("quickopen.commands.notfound"),run:()=>!1})}}onClose(){this.commandService.executeCommand(o.EDITOR_COMMANDS.FOCUS.id)}getItems(){const l=[],{recent:s,other:c}=this.getCommands();return l.push(...s.map((h,v)=>this.injector.get(d,[h,{groupLabel:v===0?(0,o.localize)("quickopen.recent-commands"):"",showBorder:!1}])),...c.map((h,v)=>this.injector.get(d,[h,{groupLabel:s.length<=0?"":v===0?(0,o.localize)("quickopen.other-commands"):"",showBorder:s.length<=0?!1:v===0}]))),l}getCommands(){const l=this.menuService.createMenu(g.MenuId.CommandPalette,this.contextKeyService),s=this.getValidCommands(this.commandRegistry.getRecentCommands()),c=this.corePreferences["workbench.commandPalette.history"],h=s.slice(0,c),v=new Set(h.map(Z=>Z.id)),f=new Set,W=[],N=[];for(const[,Z]of l.getMenuNodes())for(const y of Z){if(!(y instanceof g.MenuItemNode)||y.disabled||f.has(y.id)||(f.add(y.id),v.has(y.id)))continue;W.push(y);const E=this.commandRegistry.getCommand(y.id);E&&N.push(Object.assign(Object.assign({},E),{label:y.label}))}for(let Z=h.length-1;Z>=0;Z--){const y=h[Z];f.has(y.id)||h.splice(Z,1)}return l.dispose(),{recent:h,other:N.sort((Z,y)=>G.Command.compareCommands(Z,y))}}getValidCommands(l){return l.filter(s=>s.label&&this.commandRegistry.isVisible(s.id)&&this.commandRegistry.isEnabled(s.id))}};n.__decorate([(0,a.Autowired)(G.CommandService),n.__metadata("design:type",Object)],m.prototype,"commandService",void 0),n.__decorate([(0,a.Autowired)(a.INJECTOR_TOKEN),n.__metadata("design:type",a.Injector)],m.prototype,"injector",void 0),n.__decorate([(0,a.Autowired)(G.CommandRegistry),n.__metadata("design:type",Object)],m.prototype,"commandRegistry",void 0),n.__decorate([(0,a.Autowired)(b.IWorkspaceService),n.__metadata("design:type",Object)],m.prototype,"workspaceService",void 0),n.__decorate([(0,a.Autowired)(I.CorePreferences),n.__metadata("design:type",Object)],m.prototype,"corePreferences",void 0),n.__decorate([(0,a.Autowired)(g.AbstractMenuService),n.__metadata("design:type",g.AbstractMenuService)],m.prototype,"menuService",void 0),n.__decorate([(0,a.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],m.prototype,"contextKeyService",void 0),n.__decorate([(0,a.Autowired)(G.IReporterService),n.__metadata("design:type",Object)],m.prototype,"reporterService",void 0),m=n.__decorate([(0,a.Injectable)(),n.__metadata("design:paramtypes",[])],m),e.QuickCommandHandler=m;let d=class extends u.QuickOpenItem{constructor(l,s){super(s),this.command=l,this.commandOptions=s}getLabel(){return this.command.category?`${(0,p.uppercaseFirstLetter)(this.command.category)}: `+this.command.label:this.command.label}isHidden(){return super.isHidden()}getDetail(){var l,s;if(!this.command.labelLocalized)return;let c;const{alias:h,localized:v}=this.command.labelLocalized;if(h!==v){const f=(s=(l=this.command.categoryLocalized)===null||l===void 0?void 0:l.alias)!==null&&s!==void 0?s:this.command.category;f?c=`${(0,p.uppercaseFirstLetter)(f)}: ${h}`:c=h}return c}getKeybinding(){const l=this.keybindings.getKeybindingsForCommand(this.command.id);return l?l[0]:void 0}run(l){return l!==u.Mode.OPEN?!1:(setTimeout(()=>{this.commandService.executeCommand(this.command.id),this.commandRegistry.setRecentCommands([this.command]),this.workspaceService.setMostRecentlyUsedCommand(this.command.id)},50),!0)}};n.__decorate([(0,a.Autowired)(G.CommandService),n.__metadata("design:type",Object)],d.prototype,"commandService",void 0),n.__decorate([(0,a.Autowired)(G.CommandRegistry),n.__metadata("design:type",Object)],d.prototype,"commandRegistry",void 0),n.__decorate([(0,a.Autowired)(o.KeybindingRegistry),n.__metadata("design:type",Object)],d.prototype,"keybindings",void 0),n.__decorate([(0,a.Autowired)(b.IWorkspaceService),n.__metadata("design:type",Object)],d.prototype,"workspaceService",void 0),d=n.__decorate([(0,a.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Object])],d),e.CommandQuickOpenItem=d},65028:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QuickOpenFeatureContribution=e.CoreQuickOpenContribution=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(93899),g=t(74404),u=t(80490),G=t(90404),p=t(77116);let b=class{onStart(){for(const r of this.quickOpenContributionProvider.getContributions())r.registerQuickOpenHandlers(this.quickOpenHandlerRegistry)}};n.__decorate([(0,a.Autowired)(),n.__metadata("design:type",u.QuickOpenHandlerRegistry)],b.prototype,"quickOpenHandlerRegistry",void 0),n.__decorate([(0,a.Autowired)(u.QuickOpenContribution),n.__metadata("design:type",Object)],b.prototype,"quickOpenContributionProvider",void 0),b=n.__decorate([(0,o.Domain)(o.ClientAppContribution)],b),e.CoreQuickOpenContribution=b;let m=class{registerCommands(r){r.registerCommand(o.QUICK_OPEN_COMMANDS.OPEN,{execute:()=>this.prefixQuickOpenService.open(">")}),r.registerCommand(o.QUICK_OPEN_COMMANDS.OPEN_OUTLINE,{execute:()=>this.prefixQuickOpenService.open("@")}),r.registerCommand(o.QUICK_OPEN_COMMANDS.OPEN_VIEW,{execute:()=>this.prefixQuickOpenService.open("view ")}),r.registerCommand(o.QUICK_OPEN_COMMANDS.OPEN_WITH_COMMAND,{execute:l=>this.prefixQuickOpenService.open(">",l)})}registerKeybindings(r){r.registerKeybinding({command:o.QUICK_OPEN_COMMANDS.OPEN.id,keybinding:"ctrlcmd+shift+p"})}registerMenus(r){r.registerMenuItem(I.MenuId.MenubarViewMenu,{command:{id:o.QUICK_OPEN_COMMANDS.OPEN.id,label:(0,o.localize)("menu-bar.view.quick.command")},group:"0_primary"}),r.registerMenuItem(I.MenuId.MenubarViewMenu,{command:{id:o.LAYOUT_COMMANDS.OPEN_VIEW.id,label:o.LAYOUT_COMMANDS.OPEN_VIEW.label},group:"0_primary"})}registerQuickOpenHandlers(r){r.registerHandler(this.quickCommandHandler,{title:(0,o.localize)("quickopen.tab.command"),commandId:o.QUICK_OPEN_COMMANDS.OPEN.id,order:4}),r.registerHandler(this.helpQuickOpenHandler)}};n.__decorate([(0,a.Autowired)(a.INJECTOR_TOKEN),n.__metadata("design:type",a.Injector)],m.prototype,"injector",void 0),n.__decorate([(0,a.Autowired)(g.PrefixQuickOpenService),n.__metadata("design:type",Object)],m.prototype,"prefixQuickOpenService",void 0),n.__decorate([(0,a.Autowired)(),n.__metadata("design:type",G.QuickCommandHandler)],m.prototype,"quickCommandHandler",void 0),n.__decorate([(0,a.Autowired)(),n.__metadata("design:type",p.HelpQuickOpenHandler)],m.prototype,"helpQuickOpenHandler",void 0),m=n.__decorate([(0,o.Domain)(o.CommandContribution,o.KeybindingContribution,I.MenuContribution,u.QuickOpenContribution)],m),e.QuickOpenFeatureContribution=m},77116:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HelpQuickOpenHandler=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(74404),g=t(80490);let u=class{constructor(){this.prefix="?",this.description=""}init(){this.items=this.handlers.getHandlers().filter(p=>p.prefix!==this.prefix).sort((p,b)=>this.comparePrefix(p.prefix,b.prefix)).map(p=>new I.QuickOpenItem({label:p.prefix,description:p.description,run:b=>(b!==I.Mode.OPEN||this.quickOpenService.open(p.prefix),!1)}))}getModel(){return{onType:(p,b)=>{b(this.items)}}}getOptions(){return{}}onClose(){this.commandService.executeCommand(o.EDITOR_COMMANDS.FOCUS.id)}comparePrefix(p,b){return p.toLowerCase().localeCompare(b.toLowerCase())}};n.__decorate([(0,a.Autowired)(g.QuickOpenHandlerRegistry),n.__metadata("design:type",g.QuickOpenHandlerRegistry)],u.prototype,"handlers",void 0),n.__decorate([(0,a.Autowired)(I.PrefixQuickOpenService),n.__metadata("design:type",Object)],u.prototype,"quickOpenService",void 0),n.__decorate([(0,a.Autowired)(o.CommandService),n.__metadata("design:type",Object)],u.prototype,"commandService",void 0),u=n.__decorate([(0,a.Injectable)()],u),e.HelpQuickOpenHandler=u},43131:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KaitianQuickOpenControllerOpts=e.MonacoQuickOpenService=void 0;const n=t(85608),a=n.__importDefault(t(14041)),o=n.__importDefault(t(25873)),I=t(76003),g=t(41869),u=t(63373),G=t(68969),p=t(74404),b=t(70238),m=t(52596),d=t(65694),r=t(6399),l=t(98462);let s=class{constructor(){this.preLookFor=""}get inQuickOpenContextKey(){return this.contextKeyService.createKey("inQuickOpen",!1)}appendQuickOpenContainer(){var v;const f=(v=this.appConfig.designLayout)===null||v===void 0?void 0:v.quickOpenContainerStyle,W=document.querySelector("#ide-overlay");if(!W)throw new Error("ide-overlay is requried");const N=document.createElement("div");N.classList.add("quick-open-overlay"),W.appendChild(N);const Z=this.container=document.createElement("quick-open-container");Z.style.position="fixed",Z.style.top=f?.top||"0px",Z.style.right=f?.right||"50%",Z.style.zIndex="1000000",N.appendChild(Z)}open(v,f){const W=new c(v,this.keybindingRegistry,f);this.progressDispose=this.progressService.registerProgressIndicator(u.VIEW_CONTAINERS.QUICKPICK_PROGRESS),this.hideDecoration(),this.internalOpen(W)}hide(v){this.widget.hide(v),this.progressDispose.dispose()}internalOpen(v){var f;this.opts=v,this.widget.show(this.opts.prefix||"",{placeholder:v.inputAriaLabel,password:v.password,inputEnable:(f=v.enabled)!==null&&f!==void 0?f:!0,valueSelection:v.valueSelection,canSelectMany:v.canSelectMany,keepScrollPosition:v.keepScrollPosition,busy:v.busy,renderTab:v.renderTab,toggleTab:v.toggleTab}),this.inQuickOpenContextKey.set(!0)}updateOptions(v){this.opts.updateOptions(v),this.widget.updateOptions(v)}refresh(){this.onType(this.widget.inputValue)}get widget(){return this._widget?this._widget:(this.appendQuickOpenContainer(),this._widget=this.injector.get(l.QuickOpenWidget,[{onOk:()=>{this.previousActiveElement=void 0,this.onClose(!1)},onCancel:()=>{this.previousActiveElement instanceof HTMLElement&&this.previousActiveElement.focus(),this.previousActiveElement=void 0,this.onClose(!0)},onType:v=>this.onType(v||""),onFocusLost:()=>this.opts&&this.opts.ignoreFocusOut!==void 0?(this.opts.ignoreFocusOut===!1&&this.onClose(!0),this.opts.ignoreFocusOut):!1,onHide:()=>{this.inQuickOpenContextKey.set(!1)},onSelect:(v,f)=>{this.opts.onSelect&&this.opts.onSelect(v,f)},onConfirm:v=>{this.opts.onConfirm&&this.opts.onConfirm(v)},onKeyMods:v=>{this.opts.onKeyMods&&this.opts.onKeyMods(v)}}]),this.initWidgetView(this._widget),this._widget)}initWidgetView(v){o.default.createRoot(this.container).render(a.default.createElement(g.ConfigProvider,{value:this.appConfig},a.default.createElement(d.QuickOpenContext.Provider,{value:{widget:v}},a.default.createElement(r.QuickOpenView,null))))}onClose(v){var f,W;(W=(f=this.opts).onClose)===null||W===void 0||W.call(f,v)}async onType(v){const f=this.opts;this.widget&&f.onType&&f.onType(v,W=>(this.preLookFor!==v&&this.opts.onChangeValue(v),this.preLookFor=v,this.widget.setInput(W,f.getAutoFocus(v),f.inputAriaLabel)))}onFocusLost(){return!!this.opts.ignoreFocusOut}showDecoration(v){this.widget.validateType=v}hideDecoration(){this.widget.validateType=void 0}};n.__decorate([(0,I.Autowired)(g.KeybindingRegistry),n.__metadata("design:type",Object)],s.prototype,"keybindingRegistry",void 0),n.__decorate([(0,I.Autowired)(b.MonacoContextKeyService),n.__metadata("design:type",b.MonacoContextKeyService)],s.prototype,"monacoContextKeyService",void 0),n.__decorate([(0,I.Autowired)(g.IContextKeyService),n.__metadata("design:type",Object)],s.prototype,"contextKeyService",void 0),n.__decorate([(0,I.Autowired)(I.INJECTOR_TOKEN),n.__metadata("design:type",I.Injector)],s.prototype,"injector",void 0),n.__decorate([(0,I.Autowired)(g.AppConfig),n.__metadata("design:type",Object)],s.prototype,"appConfig",void 0),n.__decorate([(0,I.Autowired)(G.IProgressService),n.__metadata("design:type",Object)],s.prototype,"progressService",void 0),s=n.__decorate([(0,I.Injectable)()],s),e.MonacoQuickOpenService=s;class c{constructor(v,f,W){this.model=v,this.keybindingRegistry=f,this.model=v,this.options=p.QuickOpenOptions.resolve(W)}get prefix(){return this.options.prefix}get inputAriaLabel(){return this.options.placeholder||""}get ignoreFocusOut(){return this.options.ignoreFocusOut}get password(){return this.options.password}get enabled(){return this.options.enabled}get valueSelection(){return this.options.valueSelection}get keepScrollPosition(){return this.options.keepScrollPosition}get busy(){return this.options.busy}get renderTab(){return this.options.renderTab}get toggleTab(){return this.options.toggleTab}get canSelectMany(){return this.options.canPickMany}onClose(v){this.options.onClose(v)}onSelect(v,f){this.options.onSelect(v,f)}onConfirm(v){this.options.onConfirm(v)}onType(v,f){this.model.onType(v,(W,N)=>{const Z=this.toOpenModel(v,W,N);f(Z)})}onKeyMods(v){this.options.onKeyMods&&this.options.onKeyMods(v)}onChangeValue(v){this.options.onChangeValue&&this.options.onChangeValue(v)}updateOptions(v){this.options=p.QuickOpenOptions.resolve(v)}compareEntries(v,f,W){const N=v.getHighlights()[0]||[],Z=f.getHighlights()[0]||[];if(N.length&&!Z.length)return-1;if(!N.length&&Z.length)return 1;const y=v.getLabel(),E=f.getLabel();return(0,g.compareAnything)(y,E,W)}toOpenModel(v,f,W){const N=v;this.options.skipPrefix&&(v=v.substring(this.options.skipPrefix).trim()),W&&W.getValidateInput&&(v=W.getValidateInput(v));const Z=f.filter(E=>!!this.fuzzyQuickOpenItem(E,v));this.options.fuzzySort&&Z.sort((E,R)=>this.compareEntries(E,R,v));const{getPlaceholderItem:y}=this.options;return!Z.length&&y&&Z.push(y(v,N)),{items:Z,actionProvider:W}}fuzzyQuickOpenItem(v,f){const{fuzzyMatchLabel:W,fuzzyMatchDescription:N,fuzzyMatchDetail:Z}=this.options,y=W?(0,m.matchesFuzzyIconAware)(f,(0,m.parseLabelWithIcons)(v.getLabel()||""),typeof W=="object"&&W.enableSeparateSubstringMatching):v.getLabelHighlights(),E=this.options.fuzzyMatchDescription?(0,m.matchesFuzzyIconAware)(f,(0,m.parseLabelWithIcons)(v.getDescription()||""),typeof N=="object"&&N.enableSeparateSubstringMatching):v.getDescriptionHighlights(),R=this.options.fuzzyMatchDetail?(0,m.matchesFuzzyIconAware)(f,(0,m.parseLabelWithIcons)(v.getDetail()||""),typeof Z=="object"&&Z.enableSeparateSubstringMatching):v.getDetailHighlights();if(!(f&&!y&&!E&&(!R||R.length===0)&&!this.options.showItemsWithoutHighlight))return v.setHighlights(y||[],E||[],R||[]),v}getAutoFocus(v){if(this.options.selectIndex){const f=this.options.selectIndex(v);if(f>=0)return{autoFocusIndex:f}}return{autoFocusFirstEntry:!0,autoFocusPrefixMatch:v}}}e.KaitianQuickOpenControllerOpts=c},65694:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QuickOpenContext=void 0;const a=t(85608).__importDefault(t(14041));e.QuickOpenContext=a.default.createContext({widget:null})},6399:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QuickOpenView=e.QuickOpenProgress=e.QuickOpenList=e.QuickOpenInput=e.QuickOpenHeader=void 0;const n=t(85608),a=n.__importDefault(t(53373)),o=t(25150),I=n.__importDefault(t(14041)),g=t(97267),u=t(41869),G=t(63373),p=t(68969),b=t(68974),m=t(74404),d=t(89647),r=t(85139),l=t(70716),s=t(52644),c=t(78245),h=t(65694),v=t(50426),f=n.__importDefault(t(91449)),W=(0,o.observer)(Z=>{var{button:y}=Z,E=n.__rest(Z,["button"]);return I.default.createElement(g.Button,Object.assign({},E,{key:y.tooltip,type:"icon",iconClass:y.iconClass,title:y.tooltip}))});e.QuickOpenHeader=(0,o.observer)(()=>{const Z=(0,u.useInjectable)(v.QuickTitleBar),y=I.default.useMemo(()=>{const R=()=>Z.step&&Z.totalSteps?`${Z.step}/${Z.totalSteps}`:Z.step?String(Z.step):"";return Z.title&&Z.step?`${Z.title} (${R()})`:Z.title?Z.title:Z.step?R():""},[Z.title,Z.step,Z.totalSteps]),E=I.default.useCallback((R,A)=>{R.stopPropagation(),Z.fireDidTriggerButton(A)},[Z.fireDidTriggerButton]);return Z.isAttached?I.default.createElement("div",{className:f.default.title_bar},I.default.createElement("div",{className:f.default.title_bar_button},Z.leftButtons.map(R=>I.default.createElement(W,{onMouseDown:A=>E(A,R),button:R}))),I.default.createElement("div",null,y),I.default.createElement("div",{className:f.default.title_bar_button},Z.rightButtons.map(R=>I.default.createElement(W,{onMouseDown:A=>E(A,R),button:R})))):null}),e.QuickOpenInput=(0,o.observer)(()=>{const{widget:Z}=I.default.useContext(h.QuickOpenContext),y=I.default.useRef(null),E=I.default.useCallback(V=>{const Y=V.target.value;Z.setInputValue(Y),Z.callbacks.onType(Y)},[Z]),R=I.default.useMemo(()=>Z.isPassword?"password":"text",[Z.isPassword]);I.default.useEffect(()=>{setTimeout(()=>{var V;(V=y.current)===null||V===void 0||V.focus()},0)},[Z.items]),I.default.useEffect(()=>{var V;if(Z.inputValue&&Z.valueSelection){const[Y,_]=Z.valueSelection;(V=y.current)===null||V===void 0||V.setSelectionRange(Y,_)}},[Z.valueSelection]);const A=I.default.useMemo(()=>{if(!(0,u.isUndefined)(Z.validateType))return{type:Z.validateType,message:""}},[Z.validateType]),w=I.default.useCallback(V=>{const Y=V.target.checked;for(const _ of Z.items)_.checked=Y},[]),F=I.default.useCallback(()=>{Z.callbacks.onConfirm(Z.items.filter(V=>V.checked)),Z.hide(m.HideReason.ELEMENT_SELECTED)},[]);return I.default.createElement("div",{tabIndex:0,className:f.default.input},Z.canSelectMany&&I.default.createElement(g.CheckBox,{checked:Z.selectAll,wrapTabIndex:0,onChange:w}),I.default.createElement(g.ValidateInput,{validateMessage:A,ref:y,type:R,"aria-label":Z.inputPlaceholder,placeholder:Z.inputPlaceholder,value:Z.inputValue,readOnly:!Z.inputEnable,onChange:E,id:G.VIEW_CONTAINERS.QUICKPICK_INPUT}),Z.canSelectMany&&I.default.createElement(g.Button,{className:f.default.input_button,onClick:F},(0,u.localize)("ButtonOK")))});const N=(0,o.observer)(({data:Z,index:y})=>{const{widget:E}=I.default.useContext(h.QuickOpenContext),R=(0,u.useInjectable)(c.QuickOpenItemService),A=I.default.useMemo(()=>Z.getLabel(),[Z]),w=I.default.useMemo(()=>Z.getDescription(),[Z]),F=I.default.useMemo(()=>Z.getDetail(),[Z]),V=I.default.useMemo(()=>Z.getIconClass(),[Z]),Y=I.default.useMemo(()=>Z.getKeybinding(),[Z]),_=I.default.useMemo(()=>Z.getGroupLabel(),[Z]),H=I.default.useMemo(()=>Z.showBorder(),[Z]),S=I.default.useMemo(()=>R.getButtons(Z.getButtons()),[Z]),[X,Q,O]=I.default.useMemo(()=>Z.getHighlights(),[Z]),[M,T]=I.default.useState(!1),x=I.default.useMemo(()=>{const k=E.actionProvider;if(k&&k.hasActions(Z))return k.getActions(Z)},[Z]),B=I.default.useCallback(k=>{E.canSelectMany?(Z.checked=!Z.checked,k.stopPropagation()):(k.button===1?Z.run(m.QuickOpenMode.OPEN_IN_BACKGROUND):Z.run(m.QuickOpenMode.OPEN))&&E.hide(m.HideReason.ELEMENT_SELECTED)},[Z]),D=I.default.useCallback(k=>{k.run(Z),E.hide(m.HideReason.ELEMENT_SELECTED)},[Z]),J=I.default.useCallback((k,z)=>{k.stopPropagation(),R.fireDidTriggerItemButton(y,z)},[Z]);return I.default.createElement("div",{id:G.VIEW_CONTAINERS.QUICKPICK_ITEM,tabIndex:0,className:(0,a.default)({[f.default.item_selected]:E.selectIndex===y,[f.default.item_border]:H},f.default.item),onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),"aria-label":A},E.canSelectMany&&I.default.createElement(g.CheckBox,{wrapTabIndex:0,checked:Z.checked,onChange:k=>Z.checked=k.target.checked}),I.default.createElement("div",{tabIndex:0,className:f.default.item_label_container,onMouseDown:B},I.default.createElement("div",{className:f.default.item_label},V&&I.default.createElement("span",{className:(0,a.default)(f.default.item_icon,V)}),I.default.createElement(l.HighlightLabel,{className:f.default.item_label_name,labelClassName:f.default.label_icon_container,labelIconClassName:f.default.item_label_name_icon,hightLightClassName:(0,a.default)(f.default.item_label_highlight),text:A,highlights:X}),w&&I.default.createElement(l.HighlightLabel,{className:f.default.item_label_description,labelClassName:(0,a.default)(f.default.label_icon_container,f.default.item_label_description_label),labelIconClassName:(0,a.default)(f.default.label_has_icon,f.default.item_label_description_icon),hightLightClassName:(0,a.default)(f.default.item_label_description_highlight),text:w,highlights:Q})),F&&I.default.createElement(l.HighlightLabel,{OutElementType:"div",className:f.default.item_label_detail,labelClassName:(0,a.default)(f.default.label_icon_container,f.default.item_label_description_label),labelIconClassName:(0,a.default)(f.default.label_has_icon,f.default.item_label_detail_icon),hightLightClassName:(0,a.default)(f.default.item_label_description_highlight),text:F,highlights:O})),Y&&I.default.createElement(s.KeybindingView,{keybinding:Y}),_&&I.default.createElement("span",{title:_,className:f.default.item_group_label},_),x?.map(k=>I.default.createElement("span",{key:k.id,onMouseDown:()=>D(k),title:k.tooltip||k.label,className:(0,a.default)(f.default.item_action,k.class)})),(M||E.selectIndex===y)&&S?.map(k=>I.default.createElement(W,{onMouseDown:z=>J(z,k),button:k})))});e.QuickOpenList=(0,o.observer)(({onReady:Z,onScroll:y})=>{const{widget:E}=I.default.useContext(h.QuickOpenContext),R=(0,u.useDesignStyles)(f.default.quickopen_list,"quickopen_list"),A=I.default.useCallback(w=>{const F=E.items[w];return F?.getDetail()?44:22},[E.items]);return E.items.length>0?I.default.createElement(g.RecycleList,{onReady:Z,onScroll:y,className:(0,a.default)(R,{[f.default.validate_error]:E.validateType===g.VALIDATE_TYPE.ERROR,[f.default.validate_warning]:E.validateType===g.VALIDATE_TYPE.WARNING}),data:E.items,template:N,getSize:A,maxHeight:E.items.length?E.MAX_HEIGHT:0,hiddenHorizontalScrollbar:!0}):null}),e.QuickOpenProgress=(0,o.observer)(()=>{const{widget:Z}=I.default.useContext(h.QuickOpenContext),E=(0,u.useInjectable)(p.IProgressService).getIndicator(G.VIEW_CONTAINERS.QUICKPICK_PROGRESS);return I.default.useEffect(()=>{Z.updateProgressStatus(!!Z.busy)},[Z.busy]),I.default.createElement("div",{id:G.VIEW_CONTAINERS.QUICKPICK_PROGRESS,className:f.default.progress_bar},I.default.createElement(b.ProgressBar,{progressModel:E.progressModel}))}),e.QuickOpenView=(0,o.observer)(()=>{var Z;const{widget:y}=I.default.useContext(h.QuickOpenContext),E=I.default.useRef(),R=I.default.useRef(0),A=I.default.useCallback(({relatedTarget:_,currentTarget:H})=>{if(_===null)return!1;let S=_.parentNode;for(;S!==null;){if(S===H)return!0;S=S.parentNode}return!1},[]),w=I.default.useCallback(_=>{A(_)||y.blur()},[y]),F=I.default.useCallback(_=>{E.current=_},[y]),V=I.default.useCallback(_=>{R.current=_.scrollOffset},[y]);I.default.useEffect(()=>{const{items:_,autoFocus:H}=y;if(H){if(H.autoFocusPrefixMatch){let S,X;const Q=H.autoFocusPrefixMatch,O=Q.toLowerCase();for(const T of _){const x=T.getLabel()||"";if(!S&&x.indexOf(Q)===0?S=T:!X&&x.toLowerCase().indexOf(O)===0&&(X=T),S&&X)break}const M=S||X;if(M){const T=_.indexOf(M);y.setSelectIndex(T);return}}H.autoFocusFirstEntry?y.setSelectIndex(0):typeof H.autoFocusIndex=="number"?_.length>H.autoFocusIndex&&y.setSelectIndex(H.autoFocusIndex):H.autoFocusSecondEntry?_.length>1&&y.setSelectIndex(1):H.autoFocusLastEntry&&_.length>1&&y.setSelectIndex(_.length-1)}},[y.items,y.autoFocus]),I.default.useEffect(()=>{var _,H;if(y.keepScrollPosition?(_=E.current)===null||_===void 0||_.scrollTo(R.current):(H=E.current)===null||H===void 0||H.scrollToIndex(y.selectIndex,"smart"),y.items.length===0)return;const S=y.items[y.selectIndex];S&&(S.run(m.QuickOpenMode.PREVIEW),y.callbacks.onSelect(S,y.selectIndex))},[y.items,y.selectIndex,y.keepScrollPosition]);const Y=I.default.useCallback(_=>{if(d.KEY_CODE_MAP[_.nativeEvent.keyCode]===r.KeyCode.KEY_IN_COMPOSITION)return;const{key:H}=u.KeyCode.createKeyCode(_.nativeEvent);if(!H)return;const S=y.items.length;switch(H.keyCode){case u.Key.ARROW_UP.keyCode:{_.preventDefault(),_.stopPropagation();const X=y.selectIndex-1;y.setSelectIndex((S+X%S)%S);break}case u.Key.ARROW_DOWN.keyCode:{_.preventDefault(),_.stopPropagation();const X=y.selectIndex+1;y.setSelectIndex(X%S);break}case u.Key.ESCAPE.keyCode:{_.preventDefault(),_.stopPropagation(),y.hide(m.HideReason.CANCELED);break}case u.Key.ENTER.keyCode:{_.preventDefault(),_.stopPropagation();const X=y.items[y.selectIndex];if(!X)return;X.run(m.QuickOpenMode.OPEN)&&y.hide(m.HideReason.ELEMENT_SELECTED);break}case u.Key.TAB.keyCode:{y.toggleTab&&(_.preventDefault(),_.stopPropagation(),y.toggleTab());break}}},[]);return y.isShow?I.default.createElement("div",{id:G.VIEW_CONTAINERS.QUICKPICK,tabIndex:0,className:f.default.container,onKeyDown:Y,onBlur:w},I.default.createElement(e.QuickOpenHeader,null),I.default.createElement(e.QuickOpenInput,null),I.default.createElement(e.QuickOpenProgress,null),(Z=y.renderTab)===null||Z===void 0?void 0:Z.call(y),I.default.createElement(e.QuickOpenList,{onReady:F,onScroll:V})):null})},98462:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QuickOpenWidget=void 0;const n=t(85608),a=t(83794),o=t(76003),I=t(41869),g=t(81878),u=t(63373),G=t(68969);let p=class{get isShow(){return this._isShow}get isPassword(){return this._isPassword}get selectAll(){return this.items.every(m=>m.checked)}get valueSelection(){return this._valueSelection}get canSelectMany(){return this._canSelectMany}get items(){return this._items||[]}get inputPlaceholder(){return this._inputPlaceholder}get inputEnable(){return this._inputEnable}get actionProvider(){return this._actionProvider}get autoFocus(){return this._autoFocus}get keepScrollPosition(){return this._keepScrollPosition}get busy(){return this._busy}constructor(m){this.callbacks=m,this.MAX_HEIGHT=440,this.inputValue="",this._isShow=!1,this._items=a.observable.array([]),this._actionProvider=null,this._autoFocus=null,this._isPassword=!1,this._keepScrollPosition=!1,this._busy=!1,this.selectIndex=0,this.modifierListeners=new I.DisposableCollection,(0,a.makeObservable)(this)}setSelectIndex(m){this.selectIndex=m}setInputValue(m){this.inputValue=m}show(m,d){this._isShow=!0,this.inputValue=m,this._inputPlaceholder=d.placeholder,this._isPassword=!!d.password,this._inputEnable=d.inputEnable,this._valueSelection=d.valueSelection,this._canSelectMany=d.canSelectMany,this._keepScrollPosition=!!d.keepScrollPosition,this._busy=!!d.busy,this.renderTab=d.renderTab,this.toggleTab=d.toggleTab,this.callbacks.onType(m),this.registerKeyModsListeners()}hide(m){this.modifierListeners.disposed||this.modifierListeners.dispose(),this._isShow&&(this._isShow=!1,this._items=[],m===I.HideReason.ELEMENT_SELECTED?this.callbacks.onOk():this.callbacks.onCancel(),this.callbacks.onHide(m))}blur(){if(!this._isShow)return;this.callbacks.onFocusLost()||this.hide(I.HideReason.FOCUS_LOST)}setInput(m,d,r){this._items=m.items,this._actionProvider=m.actionProvider||null,this._autoFocus=d}updateOptions(m){Object.keys(m).forEach(d=>{const r=`_${d}`;Object.hasOwn(this,r)&&(this[r]=m[d])})}updateProgressStatus(m){m===!0?this.progressService.withProgress({location:u.VIEW_CONTAINERS.QUICKPICK_PROGRESS},()=>new Promise(d=>this.progressResolve=d)):this.progressResolve&&(this.progressResolve(),this.progressResolve=void 0)}registerKeyModsListeners(){const m=d=>{const r={ctrlCmd:d.ctrlKey||d.metaKey,alt:d.altKey};this.callbacks.onKeyMods(r)};this.modifierListeners.push((0,I.addDisposableListener)(window,I.EventType.KEY_DOWN,m,!0)),this.modifierListeners.push((0,I.addDisposableListener)(window,I.EventType.KEY_UP,m,!0)),this.modifierListeners.push((0,I.addDisposableListener)(window,I.EventType.MOUSE_DOWN,m,!0))}};n.__decorate([a.observable,n.__metadata("design:type",Object)],p.prototype,"inputValue",void 0),n.__decorate([a.observable,n.__metadata("design:type",Object)],p.prototype,"_isShow",void 0),n.__decorate([a.observable,n.__metadata("design:type",Number)],p.prototype,"validateType",void 0),n.__decorate([a.observable.shallow,n.__metadata("design:type",Array)],p.prototype,"_items",void 0),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],p.prototype,"isShow",null),n.__decorate([a.observable.ref,n.__metadata("design:type",Object)],p.prototype,"_actionProvider",void 0),n.__decorate([a.observable.ref,n.__metadata("design:type",Object)],p.prototype,"_autoFocus",void 0),n.__decorate([a.observable,n.__metadata("design:type",Object)],p.prototype,"_isPassword",void 0),n.__decorate([a.observable,n.__metadata("design:type",Object)],p.prototype,"_keepScrollPosition",void 0),n.__decorate([a.observable,n.__metadata("design:type",Object)],p.prototype,"_busy",void 0),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],p.prototype,"isPassword",null),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],p.prototype,"selectAll",null),n.__decorate([a.observable,n.__metadata("design:type",Array)],p.prototype,"_valueSelection",void 0),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],p.prototype,"valueSelection",null),n.__decorate([a.observable,n.__metadata("design:type",Boolean)],p.prototype,"_canSelectMany",void 0),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],p.prototype,"canSelectMany",null),n.__decorate([a.observable,n.__metadata("design:type",Object)],p.prototype,"selectIndex",void 0),n.__decorate([a.computed,n.__metadata("design:type",Array),n.__metadata("design:paramtypes",[])],p.prototype,"items",null),n.__decorate([a.observable,n.__metadata("design:type",String)],p.prototype,"_inputPlaceholder",void 0),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],p.prototype,"inputPlaceholder",null),n.__decorate([a.observable,n.__metadata("design:type",Boolean)],p.prototype,"_inputEnable",void 0),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],p.prototype,"inputEnable",null),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],p.prototype,"actionProvider",null),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],p.prototype,"autoFocus",null),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],p.prototype,"keepScrollPosition",null),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],p.prototype,"busy",null),n.__decorate([(0,o.Autowired)(G.IProgressService),n.__metadata("design:type",Object)],p.prototype,"progressService",void 0),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[Number]),n.__metadata("design:returntype",void 0)],p.prototype,"setSelectIndex",null),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[String]),n.__metadata("design:returntype",void 0)],p.prototype,"setInputValue",null),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[String,Object]),n.__metadata("design:returntype",void 0)],p.prototype,"show",null),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[Number]),n.__metadata("design:returntype",void 0)],p.prototype,"hide",null),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",void 0)],p.prototype,"blur",null),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[Object,Object,String]),n.__metadata("design:returntype",void 0)],p.prototype,"setInput",null),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[Object]),n.__metadata("design:returntype",void 0)],p.prototype,"updateOptions",null),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[Boolean]),n.__metadata("design:returntype",void 0)],p.prototype,"updateProgressStatus",null),p=n.__decorate([(0,o.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object])],p),e.QuickOpenWidget=p},13978:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QuickPickServiceImpl=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(74404),g=t(43718),u=t(50426);let G=class{constructor(){this.onDidAcceptEmitter=new g.Emitter,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActiveItemsEmitter=new g.Emitter,this.onDidChangeActiveItems=this.onDidChangeActiveItemsEmitter.event}async show(b,m){return new Promise(d=>{const r=this.toItems(b,d);m&&this.quickTitleBar.shouldShowTitleBar(m.title,m.step,m.buttons)&&this.quickTitleBar.attachTitleBar(m.title,m.step,m.totalSteps,m.buttons);const l=m&&m.value?m.value:"";this.quickOpenService.open({onType:(s,c)=>{c(r),this.onDidChangeActiveItemsEmitter.fire(r)}},Object.assign({onClose:()=>{this.quickTitleBar.hide(),d(void 0)},onConfirm:s=>{this.quickTitleBar.hide(),d(s.map(c=>c.getValue()))},fuzzyMatchLabel:!0,fuzzyMatchDescription:!0,prefix:l},m))})}hide(b){this.quickOpenService.hide(b)}toItems(b,m){const d=[];for(const r of b){const l=this.toItemOptions(r,m);d.push(new I.QuickOpenItem(l))}return d}toItemOptions(b,m){let d=typeof b=="string"?b:b.label,r=typeof b=="string"?void 0:b.iconClass;const l=typeof b=="string"?b:b.value,s=typeof b=="string"?void 0:b.description,c=typeof b=="string"?void 0:b.detail,h=typeof b=="string"?void 0:b.groupLabel,v=typeof b=="string"?void 0:b.showBorder,f=typeof b=="string"?void 0:b.buttons,[W,N]=(0,o.getIconClass)(d);return W&&(r=(0,o.getIcon)(W)||(0,o.getExternalIcon)(W),d=` ${N}`),{label:d,description:s,detail:c,iconClass:r,groupLabel:h,showBorder:v,buttons:f,run:Z=>Z!==I.Mode.OPEN?!1:(m(l),this.onDidAcceptEmitter.fire(void 0),!0),value:l}}};n.__decorate([(0,a.Autowired)(u.QuickTitleBar),n.__metadata("design:type",u.QuickTitleBar)],G.prototype,"quickTitleBar",void 0),n.__decorate([(0,a.Autowired)(I.QuickOpenService),n.__metadata("design:type",Object)],G.prototype,"quickOpenService",void 0),G=n.__decorate([(0,a.Injectable)()],G),e.QuickPickServiceImpl=G},50426:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QuickTitleBar=void 0;const n=t(85608),a=t(83794),o=t(76003),I=t(74404),g=t(40827),u=t(43718);t(50279);const G=t(52416),p=t(89802);let b=class{get title(){return this._title}constructor(){this.onDidTriggerButtonEmitter=new u.Emitter,this._buttons=[],(0,a.makeObservable)(this)}get onDidTriggerButton(){return this.onDidTriggerButtonEmitter.event}fireDidTriggerButton(d){this.onDidTriggerButtonEmitter.fire(d)}get isAttached(){return this._isAttached}get step(){return this._step}get totalSteps(){return this._totalSteps}get buttons(){return this._buttons===void 0||this._buttons.length===0?[]:this._buttons.map((d,r)=>{const l=(0,p.iconPath2URI)(d.iconPath,this.themeService.getCurrentThemeSync().type),s=l&&this.staticResourceService.resolveStaticResource(l).toString(),c=s&&this.iconService.fromIcon("",s,G.IconType.Background);return Object.assign(Object.assign({},d),{iconClass:c,handler:r})})}get leftButtons(){return this.buttons.filter(d=>d.side===I.QuickTitleButtonSide.LEFT)}get rightButtons(){return this.buttons.filter(d=>d.side===I.QuickTitleButtonSide.RIGHT||typeof d.side>"u")}attachTitleBar(d,r,l,s){this._title=d,this._step=r,this._totalSteps=l,s&&(this._buttons=s),this._isAttached=!0}hide(){this._title=void 0,this._buttons=[],this._step=void 0,this._totalSteps=void 0,this._isAttached=!1}shouldShowTitleBar(d,r,l){return!(0,u.isUndefined)(d)||!(0,u.isUndefined)(r)||!(0,u.isUndefined)(l)&&!!l.length}};n.__decorate([(0,o.Autowired)(G.IThemeService),n.__metadata("design:type",Object)],b.prototype,"themeService",void 0),n.__decorate([(0,o.Autowired)(),n.__metadata("design:type",g.StaticResourceService)],b.prototype,"staticResourceService",void 0),n.__decorate([(0,o.Autowired)(G.IIconService),n.__metadata("design:type",Object)],b.prototype,"iconService",void 0),n.__decorate([a.observable,n.__metadata("design:type",Boolean)],b.prototype,"_isAttached",void 0),n.__decorate([a.observable,n.__metadata("design:type",Object)],b.prototype,"_title",void 0),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],b.prototype,"title",null),n.__decorate([a.observable,n.__metadata("design:type",Object)],b.prototype,"_step",void 0),n.__decorate([a.observable,n.__metadata("design:type",Object)],b.prototype,"_totalSteps",void 0),n.__decorate([a.observable.shallow,n.__metadata("design:type",Array)],b.prototype,"_buttons",void 0),n.__decorate([a.computed,n.__metadata("design:type",Boolean),n.__metadata("design:paramtypes",[])],b.prototype,"isAttached",null),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],b.prototype,"step",null),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],b.prototype,"totalSteps",null),n.__decorate([a.computed,n.__metadata("design:type",Array),n.__metadata("design:paramtypes",[])],b.prototype,"buttons",null),n.__decorate([a.computed,n.__metadata("design:type",Array),n.__metadata("design:paramtypes",[])],b.prototype,"leftButtons",null),n.__decorate([a.computed,n.__metadata("design:type",Array),n.__metadata("design:paramtypes",[])],b.prototype,"rightButtons",null),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[Object,Object,Object,Object]),n.__metadata("design:returntype",void 0)],b.prototype,"attachTitleBar",null),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",void 0)],b.prototype,"hide",null),b=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],b),e.QuickTitleBar=b},44854:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InputBoxImpl=void 0;const n=t(85608),a=t(76003),o=t(81878),I=t(74404),g=t(43718),u=t(50426);let G=class{constructor(b){this._options={},this.onDidAcceptEmitter=new g.Emitter,this.onDidChangeValueEmitter=new g.Emitter,this.onDidTriggerButtonEmitter=new g.Emitter,this.onDidHideEmitter=new g.Emitter,this._options=b}shouldUpdate(b,m){return m.value!==b.value||m.prompt!==b.prompt||m.placeHolder!==b.placeHolder||m.password!==b.password||m.ignoreFocusOut!==b.ignoreFocusOut||m.enabled!==b.enabled||m.valueSelection!==b.valueSelection||m.title!==b.title||m.step!==b.step||m.totalSteps!==b.totalSteps||m.buttons!==b.buttons||m.validationMessage!==b.validationMessage||m.validationType!==b.validationType||m.busy!==b.busy}updateOptions(b,m=!1){if(!b)return;const d=Object.assign({},this._options);this._options=Object.assign(Object.assign({},this._options),b),!m&&this.shouldUpdate(b,d)&&(this.quickOpenService.updateOptions(b),this.refresh())}refresh(){this.quickOpenService.refresh()}get options(){return this._options}set options(b){this._options=b}open(){let b="",m=!1;this.quickTitleBar.onDidTriggerButton(d=>{this.onDidTriggerButtonEmitter.fire(d.handler)}),this.quickOpenService.open({onType:async(d,r)=>{var l;if(b!==d){if(b=d,this.getDerivedOptionsFromValue){const f=await this.getDerivedOptionsFromValue(d);this.updateOptions(f,!0)}this.onDidChangeValueEmitter.fire(d),m=!0}let s=this.options.prompt;const c=(0,g.localize)("quickopen.quickinput.prompt");this.options&&this.quickTitleBar.shouldShowTitleBar(this.options.title,this.options.step,this.options.buttons)&&this.quickTitleBar.attachTitleBar(this.options.title,this.options.step,this.options.totalSteps,this.options.buttons);const h=this.options.validationMessage;h?this.quickOpenService.showDecoration((l=this.options.validationType)!==null&&l!==void 0?l:o.VALIDATE_TYPE.ERROR):this.quickOpenService.hideDecoration(),s=h||s;const v={run:f=>m&&!h&&f===I.Mode.OPEN&&(this.onDidAcceptEmitter.fire(d),this.options.hideOnDidAccept)?(this.quickTitleBar.hide(),!0):!1};s?(v.label=s,v.detail=c):v.label=c,r([new I.QuickOpenItem(v)])}},{prefix:this.options.value,placeholder:this.options.placeHolder,password:this.options.password,ignoreFocusOut:this.options.ignoreFocusOut,enabled:this.options.enabled,valueSelection:this.options.valueSelection,busy:this.options.busy,onClose:d=>{d&&this.onDidHideEmitter.fire(),this.quickTitleBar.hide()}})}dispose(){this.onDidAcceptEmitter.dispose(),this.onDidChangeValueEmitter.dispose(),this.onDidHideEmitter.dispose(),this.onDidTriggerButtonEmitter.dispose()}hide(){this.quickOpenService.hideDecoration(),this.quickOpenService.hide()}get onDidAccept(){return this.onDidAcceptEmitter.event}get onDidChangeValue(){return this.onDidChangeValueEmitter.event}get onDidTriggerButton(){return this.onDidTriggerButtonEmitter.event}get onDidHide(){return this.onDidHideEmitter.event}};n.__decorate([(0,a.Autowired)(I.QuickOpenService),n.__metadata("design:type",Object)],G.prototype,"quickOpenService",void 0),n.__decorate([(0,a.Autowired)(u.QuickTitleBar),n.__metadata("design:type",u.QuickTitleBar)],G.prototype,"quickTitleBar",void 0),G=n.__decorate([(0,a.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object])],G),e.InputBoxImpl=G},89802:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.iconPath2URI=void 0;const n=t(43718);function a(o,I){if(n.URI.isUri(o))return o;if((o.dark||o.light)&&I)return I==="dark"?new n.URI(o.dark.toString()):new n.URI(o.light.toString())}e.iconPath2URI=a},74435:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=t(85608);n.__exportStar(t(74404),e),n.__exportStar(t(11143),e)},97821:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),t(85608).__exportStar(t(74435),e)},57492:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMProviderList=void 0;const n=t(85608),a=n.__importDefault(t(53373)),o=n.__importStar(t(14041)),I=t(97267),g=t(41869),u=t(93899),G=t(40293),p=t(92237),b=t(36367),m=n.__importDefault(t(38201)),d=l=>{var{repository:s,selected:c}=l,h=n.__rest(l,["repository","selected"]);const{provider:v}=s,{title:f,type:W}=(0,b.getSCMRepositoryDesc)(s),N=(0,g.useInjectable)(G.IStatusBarService),Z=(v.statusBarCommands||[]).map((y,E)=>N.getElementConfig(`scm.repo.${E}`,{text:y.title,command:y.id,arguments:y.arguments,tooltip:y.tooltip,iconset:"octicon"}));return o.default.createElement("div",Object.assign({className:(0,a.default)(m.default.provider,{[m.default.selected]:c})},h),o.default.createElement("div",{className:m.default.info},o.default.createElement("div",{className:m.default.title},f,"\xA0"),o.default.createElement("div",{className:m.default.type},W,"\xA0"),v.count&&v.count>0?o.default.createElement(I.Badge,null,v.count):null),o.default.createElement("div",{className:m.default.toolbar},Z.map(y=>o.default.createElement(p.StatusBarItem,Object.assign({key:y.id,entryId:y.id,className:m.default.status},y)))))},r=({repositoryList:l,selectedRepository:s})=>{if(!s)return null;const c=(0,g.useInjectable)(u.ICtxMenuRenderer),h=(0,g.useInjectable)(u.AbstractContextMenuService),v=(0,o.useCallback)(W=>{W.setSelected(!0),W.focus()},[]),f=(0,o.useCallback)((W,N)=>{N.preventDefault(),N.stopPropagation();const{x:Z,y}=N.nativeEvent,E=h.createMenu({id:u.MenuId.SCMSourceControl}),R=E.getMergedMenuNodes();E.dispose(),c.show({anchor:{x:Z,y},menuNodes:R,args:[W.provider.toJSON()]})},[]);return o.default.createElement("div",{className:m.default.scmSelect},l.map(W=>o.default.createElement(d,{key:W.provider.id,selected:W.provider.id===s.provider.id,onClick:v.bind(null,W),onContextMenu:f.bind(null,W),repository:W})))};e.SCMProviderList=r,e.SCMProviderList.displayName="SCMProviderList"},37751:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMResourceInput=e.convertValidationType=void 0;const n=t(85608),a=n.__importStar(t(14041)),o=t(41869),I=t(25918),g=t(40525),u=t(43718),G=t(5567),p=t(52416),b=t(64964),m=n.__importDefault(t(87906));function d(s){return["info","warning","error"][s]}e.convertValidationType=d;function r(s){return o.strings.format(s.input.placeholder,o.isMacintosh?"\u2318Enter":"Ctrl+Enter")}const l=({repository:s,menus:c})=>{const h=(0,o.useInjectable)(u.CommandService),v=(0,o.useInjectable)(p.IIconService),f=(0,o.useDesignStyles)(m.default.scmMenu,"scmMenu"),[W,N]=(0,a.useState)(""),[Z,y]=(0,a.useState)(""),[E,R]=(0,a.useState)(!0),[A,w]=(0,a.useState)({}),F=(0,a.useCallback)(X=>{s.input.value=X},[s]),V=(0,a.useCallback)(X=>{const{addonAfter:Q,addonBefore:O}=X,M=Q,T=O;w(Object.assign(Object.assign(Object.assign({},X),Q?{addonAfter:(0,u.isFunction)(M)?a.default.createElement(M,null):Q}:{}),O?{addonBefore:(0,u.isFunction)(T)?a.default.createElement(T,null):O}:{}))},[s.input.props]);(0,a.useEffect)(()=>{s.input.props&&V(s.input.props)},[s.input.props]),(0,a.useEffect)(()=>{const X=new o.DisposableStore;return X.add(s.input.onDidChangeProps(Q=>{V(Q)})),X.add(s.input.onDidChange(Q=>{N(Q)})),X.add(s.input.onDidChangePlaceholder(()=>{y(r(s))})),X.add(s.input.onDidChangeEnablement(Q=>{R(Q)})),y(r(s)),()=>{X.dispose()}},[s]);const Y=(0,a.useCallback)(()=>{if(!s||!s.provider.acceptInputCommand)return;const{id:X,arguments:Q=[]}=s.provider.acceptInputCommand;X&&h.executeCommand(X,...Q)},[s]),{onKeyDown:_,onKeyUp:H}=(0,g.useHotKey)([o.isMacintosh?"command":"ctrl","enter"],Y),S=s&&s.provider&&c;return a.default.createElement(a.default.Fragment,null,a.default.createElement("div",{className:m.default.scmHeader},a.default.createElement(G.AutoFocusedInput,Object.assign({containerId:b.scmContainerId,className:m.default.scmInput,placeholder:Z,value:W,disabled:!E,onKeyDown:X=>_(X.keyCode),onKeyUp:H,onValueChange:F},A))),S&&a.default.createElement(I.InlineMenuBar,{className:f,context:[s.provider,W],type:"button",moreIcon:"down",iconService:v,regroup:(X,Q)=>[[X[0]].filter(Boolean),[...X.slice(1),...Q]],menus:c}))};e.SCMResourceInput=l,e.SCMResourceInput.displayName="SCMResourceInput"},24748:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMResourceTree=e.TREE_FIELD_NAME=void 0;const n=t(85608),a=n.__importDefault(t(53373)),o=n.__importStar(t(14041)),I=t(97267),g=t(41869),u=t(48560),G=t(49914),p=n.__importDefault(t(91873)),b=t(11579),m=t(74568),d=t(63451);e.TREE_FIELD_NAME="SCM_TREE_TREE_FIELD",e.SCMResourceTree=(0,o.memo)(({height:s})=>{const[c,h]=(0,o.useState)(!1),[v,f]=(0,o.useState)(),W=(0,o.useRef)(!1),N=(0,o.useRef)(null),Z=(0,u.useInjectable)(b.SCMTreeModelService),y=(0,u.useInjectable)(G.ViewModelContext),[E,R]=(0,o.useState)(y.alwaysShowActions),A=(0,o.useCallback)(async()=>{Z.init(),await Z.whenReady,Z.treeModel&&await Z.treeModel.ensureReady,!W.current&&h(!0)},[c,Z]);(0,o.useEffect)(()=>{const X=y.onAlwaysShowActionsChange(Q=>{R(Q)});return A(),()=>{W.current=!0,X.dispose()}},[]),(0,o.useEffect)(()=>{c&&(f(Z.treeModel),Z.onDidTreeModelChange(async X=>{X&&await X.ensureReady,f(X)}))},[c]),(0,o.useEffect)(()=>{var X;const Q=()=>{Z.handleTreeBlur()};return(X=N.current)===null||X===void 0||X.addEventListener("blur",Q,!0),()=>{var O;(O=N.current)===null||O===void 0||O.removeEventListener("blur",Q,!0),Z.handleTreeBlur()}},[N.current]);const w=(0,o.useCallback)(X=>{Z.handleTreeHandler(Object.assign(Object.assign({},X),{getModel:()=>Z.treeModel,hasDirectFocus:()=>N.current===document.activeElement}))},[]),F=(0,o.useCallback)(X=>V(X)?!1:X.shiftKey,[]),V=(0,o.useCallback)(X=>{const{metaKey:Q,ctrlKey:O}=X;return g.isOSX&&Q||O},[]),Y=(0,o.useCallback)((X,Q,O)=>{if(X.stopPropagation(),!Q)return;const M=F(X),T=V(X);M?Z.handleItemRangeClick(Q,O):T?Z.handleItemToggleClick(Q,O):Z.handleItemClick(Q,O)},[]),_=(0,o.useCallback)((X,Q)=>{X.stopPropagation(),Z.toggleDirectory(Q)},[]),H=(0,o.useCallback)((X,Q,O)=>{X.stopPropagation(),Q&&Z.handleItemDoubleClick(Q,O)},[]),S=(0,o.useCallback)((X,Q,O)=>{X.preventDefault(),Z.handleContextMenu(X,Q,O)},[]);return o.default.createElement("div",{className:(0,a.default)(p.default.scm_tree_container,{"scm-show-actions":E}),tabIndex:-1,ref:N,"data-name":e.TREE_FIELD_NAME},o.default.createElement(l,{isReady:c,model:v,height:s,onTreeReady:w,onItemClick:Y,onItemDoubleClick:H,onTwistierClick:_,onContextMenu:S}))}),e.SCMResourceTree.displayName="SCMResourceTree";function r(s,c){return s.isReady===c.isReady&&s.model===c.model&&s.height===c.height}const l=(0,o.memo)(({isReady:s,model:c,height:h,onTreeReady:v,onItemClick:f,onItemDoubleClick:W,onTwistierClick:N,onContextMenu:Z})=>{const y=(0,u.useInjectable)(b.SCMTreeModelService),E=(0,u.useInjectable)(d.SCMTreeService),R=(0,o.useCallback)(A=>o.default.createElement(m.SCMTreeNode,{item:A.item,itemType:A.itemType,decorationService:y.decorationService,labelService:y.labelService,commandService:y.commandService,decorations:y.decorations.getDecorations(A.item),onClick:f,onDoubleClick:W,onTwistierClick:N,onContextMenu:Z,defaultLeftPadding:E.isTreeMode?-4:4,leftPadding:E.isTreeMode?8:0,iconTheme:y.iconThemeDesc}),[c,E,y]);return s&&c?o.default.createElement(I.RecycleTree,{height:h,itemHeight:m.SCM_TREE_NODE_HEIGHT,onReady:v,model:c,overScanCount:100},R):o.default.createElement("span",{className:p.default.scm_tree_empty_text})},r);l.displayName="SCMResourceTreeView"},38563:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMTreeAPI=e.collectSCMResourceDesc=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(43718),g=t(64964),u=t(49914),G=t(36367),{Path:p}=I.path;function b(d,r){d.type==="file"&&r.push(d.resource);for(const l of d.children)b(l,r);return r}e.collectSCMResourceDesc=b;let m=class extends I.Disposable{constructor(){super(),this.shouldCompactFolders=!1,this.shouldCompactFolders=this.preferenceService.get("scm.listView.compactFolders",!1),this.addDispose(this.preferenceService.onSpecificPreferenceChange("scm.listView.compactFolders",r=>{this.shouldCompactFolders=r.newValue}))}getSCMResource(r){const l=this.getSCMResourceGroups(),s=r.toString();for(const c of l)for(const h of c.elements)if(h.sourceUri.toString()===s)return h}getSCMResourceGroups(){return this.viewModel.scmList.filter(G.isSCMResourceGroup)}get providerId(){var r;return(r=this.viewModel.selectedRepo)===null||r===void 0?void 0:r.provider.id}init(r=g.SCMViewModelMode.Tree){return this.getSCMResourceGroups().map(s=>({id:this.providerId+"_"+s.id,name:s.id,children:r===g.SCMViewModelMode.Tree?this.pathToTree(s.elements):this.pathToList(s.elements),resource:s,type:"group"}))}pathToList(r){return r.map(l=>{const s=this._getPathDesc(l);return{id:`${this.providerId}_${l.resourceGroup.id}_${s}`,name:s,pathname:s,children:[],resource:l,type:"file"}})}pathToTree(r){const l=[],s=Symbol("result"),c=this._initPlainCounterObject(s,l);return r.forEach(h=>{this._getPathDesc(h).split(p.separator).filter(Boolean).reduce((f,W,N,Z)=>{if(!f[W]){f[W]=this._initPlainCounterObject(s,[]);const y=Z.slice(0,N+1).join(p.separator),E=N===Z.length-1?"file":"folder",R={id:`${this.providerId}_${h.resourceGroup.id}_${y}`,name:W,pathname:y,children:f[W][s],resource:E==="file"?h:Object.assign(Object.assign({},h),{sourceUri:o.URI.from(h.sourceUri).parent.codeUri}),type:E};f[s].push(R)}return f[W]},c)}),this.shouldCompactFolders&&this.walkTreeToFold(l),l}_initPlainCounterObject(r,l){const s=Object.create(null);return s[r]=l,s}walkTreeToFold(r){const l=[...r];for(;l.length;){const s=l.pop();s&&(this.foldOnlyChild(s),l.push(...s.children))}}foldOnlyChild(r){for(;r.children.length===1&&r.children[0].children.length;){const l=r.children[0];r.name=`${r.name}${p.separator}${l.name}`,r.pathname=l.pathname,r.children=l.children,r.id=l.id,r.isCompact=!0}}_getPathDesc(r){return I.path.relative(r.resourceGroup.provider.rootUri.path,r.sourceUri.path)}};n.__decorate([(0,a.Autowired)(u.ViewModelContext),n.__metadata("design:type",u.ViewModelContext)],m.prototype,"viewModel",void 0),n.__decorate([(0,a.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],m.prototype,"preferenceService",void 0),m=n.__decorate([(0,a.Injectable)(),n.__metadata("design:paramtypes",[])],m),e.SCMTreeAPI=m},36556:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMTreeDecorationService=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(41893),g=t(52416);let u=class{constructor(){this.disposeCollection=new o.DisposableCollection,this.onDidChangeEmitter=new o.Emitter,this.disposeCollection.pushAll([this.decorationsService.onDidChangeDecorations(()=>{this.onDidChangeEmitter.fire()}),this.themeService.onThemeChange(()=>{this.onDidChangeEmitter.fire()})])}get onDidChange(){return this.onDidChangeEmitter.event}getDecoration(p,b=!1){p instanceof o.URI&&(p=o.Uri.parse(p.toString()));const m=this.decorationsService.getDecoration(p,b);return m?Object.assign(Object.assign({},m),{color:this.themeService.getColor({id:m.color})}):{color:"",tooltip:"",badge:""}}dispose(){this.disposeCollection.dispose()}};n.__decorate([(0,a.Autowired)(I.IDecorationsService),n.__metadata("design:type",I.IDecorationsService)],u.prototype,"decorationsService",void 0),n.__decorate([(0,a.Autowired)(g.IThemeService),n.__metadata("design:type",Object)],u.prototype,"themeService",void 0),u=n.__decorate([(0,a.Injectable)(),n.__metadata("design:paramtypes",[])],u),e.SCMTreeDecorationService=u},12466:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMTreeModel=void 0;const n=t(85608),a=t(76003),o=t(97267),I=t(36556);let g=class extends o.TreeModel{constructor(G){super(),this.init(G)}init(G){this.root=G,this.root.watcher.on(o.TreeNodeEvent.BranchDidUpdate,()=>{this.dispatchChange()}),this.decorationService.onDidChange(this.dispatchChange)}};n.__decorate([(0,a.Autowired)(I.SCMTreeDecorationService),n.__metadata("design:type",I.SCMTreeDecorationService)],g.prototype,"decorationService",void 0),g=n.__decorate([(0,a.Injectable)({multiple:!0}),n.__param(0,(0,a.Optional)()),n.__metadata("design:paramtypes",[Object])],g),e.SCMTreeModel=g},11579:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMTreeModelService=e.SCMTreeTypes=void 0;const n=t(85608),a=t(83794),o=t(76003),I=t(97267),g=t(41869),u=t(77661),G=t(68969),p=t(26542),b=t(54414),m=t(52416),d=t(51500),r=t(64964),l=t(49914),s=t(36556),c=t(12466),h=t(28087),v=n.__importDefault(t(87440)),f=t(63451);var W;(function(y){y[y.List=1]="List",y[y.Tree=2]="Tree"})(W=e.SCMTreeTypes||(e.SCMTreeTypes={}));const N={hasFolderIcons:!0,hasFileIcons:!0,hidesExplorerArrows:!0};let Z=class{constructor(){this._selectedFiles=[],this.disposableCollection=new g.DisposableCollection,this.onDidRefreshedEmitter=new g.Emitter,this.onDidTreeModelChangeEmitter=new g.Emitter,this.treeModelCache=new Map,this.iconThemeDesc=N,this.clearFileSelectedDecoration=()=>{this._selectedFiles.forEach(E=>{this.selectedDecoration.removeTarget(E)}),this._selectedFiles=[]},this.activeFileDecoration=E=>{if(this.contextMenuFile&&(this.contextMenuDecoration.removeTarget(this.contextMenuFile),this._contextMenuFile=void 0),E){if(this.selectedFiles.length>0)for(const R of this.selectedFiles)this.selectedDecoration.removeTarget(R);this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.selectedDecoration.addTarget(E),this.focusedDecoration.addTarget(E),this._focusedFile=E,this._selectedFiles=[E],this.treeModel.dispatchChange()}},this.selectFileDecoration=E=>{this.contextMenuFile&&(this.contextMenuDecoration.removeTarget(this.contextMenuFile),this._contextMenuFile=void 0),E&&(this.selectedFiles.length>0&&this.selectedFiles.forEach(R=>{this.selectedDecoration.removeTarget(R)}),this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.selectedDecoration.addTarget(E),this._selectedFiles=[E],this.treeModel.dispatchChange())},this.activeFileFocusedDecoration=(E,R=!1)=>{E!==this.treeModel.root&&(this.focusedFile!==E&&(R?(this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this._contextMenuFile=E):this.focusedFile&&(this._contextMenuFile=void 0,this.focusedDecoration.removeTarget(this.focusedFile)),E&&(this._selectedFiles.indexOf(E)<0&&(this.selectedDecoration.addTarget(E),this._selectedFiles.push(E)),this.focusedDecoration.addTarget(E),this._focusedFile=E)),this.treeModel.dispatchChange())},this.activeFileSelectedDecoration=E=>{this._selectedFiles.indexOf(E)>-1||(this._selectedFiles.push(E),this.selectedDecoration.addTarget(E),this.treeModel.dispatchChange())},this.toggleFileSelectedDecoration=E=>{const R=this._selectedFiles.indexOf(E);R>-1?(this.focusedFile===E&&(this._focusedDecoration.removeTarget(this.focusedFile),this._focusedFile=void 0),this._selectedFiles.splice(R,1),this.selectedDecoration.removeTarget(E)):(this._selectedFiles.push(E),this.selectedDecoration.addTarget(E),this.focusedFile&&this._focusedDecoration.removeTarget(this.focusedFile),this._focusedFile=E,this.focusedDecoration.addTarget(E)),this.treeModel.dispatchChange()},this.enactiveFileDecoration=()=>{var E;this.focusedFile&&(this.focusedDecoration.removeTarget(this.focusedFile),this._focusedFile=void 0),this.contextMenuFile&&this.contextMenuDecoration.removeTarget(this.contextMenuFile),(E=this.treeModel)===null||E===void 0||E.dispatchChange()},this.activeFileActivedDecoration=E=>{this.contextMenuFile&&this.contextMenuDecoration.removeTarget(this.contextMenuFile),this.focusedFile&&(this.focusedDecoration.removeTarget(this.focusedFile),this._focusedFile=void 0),this.contextMenuDecoration.addTarget(E),this._contextMenuFile=E,this.treeModel.dispatchChange()},this.handleTreeBlur=()=>{this.enactiveFileDecoration()},this._isMutiSelected=!1,this.handleItemRangeClick=(E,R)=>{if(!this.focusedFile)this.handleItemClick(E,R);else if(this.focusedFile&&this.focusedFile!==E){this._isMutiSelected=!0;const A=this.treeModel.root.getIndexAtTreeNode(E),w=this.treeModel.root.getIndexAtTreeNode(this.focusedFile);w>A?this.activeFileDecorationByRange(A,w,A):w<A&&this.activeFileDecorationByRange(w,A,A)}},this.handleItemToggleClick=(E,R)=>{this._isMutiSelected=!0,!(R!==I.TreeNodeType.CompositeTreeNode&&R!==I.TreeNodeType.TreeNode)&&this.toggleFileSelectedDecoration(E)},this.handleContextMenu=(E,R,A)=>{const{x:w,y:F}=E.nativeEvent;if(!R)return;const V=h.SCMResourceGroup.is(R)?R.resource:R.resource.resourceGroup,Y=this.viewModel.menus.getRepositoryMenus(V.provider);if(!Y)return;R?this.activeFileActivedDecoration(R):this.enactiveFileDecoration();let _;if(h.SCMResourceFolder.is(R)?_=R.arguments:_=this._isMutiSelected?this._getSelectedFiles().map(H=>H.resource.toJSON()):[R.resource.toJSON()],A===I.TreeNodeType.TreeNode){const H=R.resource;this.ctxMenuRenderer.show({anchor:{x:w,y:F},menuNodes:Y.getResourceMenu(H).getGroupedMenuNodes()[1],args:_})}else h.SCMResourceGroup.is(R)?this.ctxMenuRenderer.show({anchor:{x:w,y:F},menuNodes:Y.getResourceGroupMenu(V).getGroupedMenuNodes()[1],args:_}):this.ctxMenuRenderer.show({anchor:{x:w,y:F},menuNodes:Y.getResourceFolderMenu(V).getGroupedMenuNodes()[1],args:_})},this.activeFileDecorationByRange=(E,R,A)=>{this.clearFileSelectedDecoration();for(const w of this.focusedDecoration.appliedTargets.keys())this.focusedDecoration.removeTarget(w);for(;E<=R;E++){const w=this.treeModel.root.getTreeNodeAtIndex(E);w&&(E===A?this.focusedDecoration.addTarget(w):this.focusedDecoration.hasTarget(w)&&this.focusedDecoration.removeTarget(w),this._selectedFiles.push(w),this.selectedDecoration.addTarget(w))}this.treeModel.dispatchChange()},this.handleItemDoubleClick=(E,R)=>{if(this.listOpenMode==="doubleClick"&&(R===I.TreeNodeType.TreeNode?this.openFile(E):this.toggleDirectory(E)),R===I.TreeNodeType.TreeNode){const{currentEditorGroup:A,currentEditor:w}=this.workbenchEditorService;A&&w&&w.currentUri&&g.URI.from(E.resource.sourceUri).isEqual(w.currentUri)&&A.pin(w.currentUri)}},this.handleItemClick=(E,R)=>{this._isMutiSelected=!1,this.activeFileDecoration(E),this.listOpenMode==="singleClick"&&(R===I.TreeNodeType.TreeNode?this.openFile(E):this.toggleDirectory(E))},this.openFile=E=>{var R,A;const w=E,F=(R=w.resource.command)===null||R===void 0?void 0:R.id;F===g.EDITOR_COMMANDS.API_OPEN_EDITOR_COMMAND_ID||F===g.EDITOR_COMMANDS.API_OPEN_DIFF_EDITOR_COMMAND_ID?this.commandService.executeCommand(F,...((A=w.resource.command)===null||A===void 0?void 0:A.arguments)||[]).catch(V=>this.logger.error("Failed to execute command:",V,F)):E.resource.open(!0)},this.toggleDirectory=E=>{E.expanded?this.scmTreeHandle.collapseNode(E):this.scmTreeHandle.expandNode(E)},(0,a.makeObservable)(this)}init(){this.showProgress(this._whenReady=this.initTreeModel(this.scmTreeService.isTreeMode)),this._whenReady.then(()=>{this.disposableCollection.push(this.scmTreeService.onDidTreeModeChange(R=>{this.showProgress(this._whenReady=this.initTreeModel(R))}))}),this.disposableCollection.push(this.viewModel.onDidSelectedRepoChange(R=>{var A;this._whenReady=this.initTreeModel(this.scmTreeService.isTreeMode,(A=R.provider.rootUri)===null||A===void 0?void 0:A.toString())}));const E=g.Event.any(g.Event.map(this.labelService.onDidChange,()=>{}),this.viewModel.onDidSCMListChange,g.Event.map(g.Event.filter(this.preferenceService.onPreferenceChanged,R=>R.preferenceName==="scm.listView.compactFolders"&&this.scmTreeService.isTreeMode),()=>{}));this.disposableCollection.push(E(()=>{this.refresh()})),this.setIconThemeDesc(this.iconService.currentTheme||N),this.disposableCollection.push(this.iconService.onThemeChange(R=>{this.setIconThemeDesc(R)}))}setIconThemeDesc(E){this.iconThemeDesc={hasFolderIcons:!!E.hasFolderIcons,hasFileIcons:!!E.hasFileIcons,hidesExplorerArrows:!!E.hidesExplorerArrows}}showProgress(E){this.progressService.withProgress({location:r.scmResourceViewId},()=>E)}get scmTreeHandle(){return this._scmTreeHandle}get contextMenuFile(){return this._contextMenuFile}get selectedDecoration(){return this._selectedDecoration}get focusedDecoration(){return this._focusedDecoration}get contextMenuDecoration(){return this._contextMenuDecoration}get decorations(){return this._activeDecorations}get treeModel(){return this._activeTreeModel}get whenReady(){return this._whenReady}get focusedFile(){return this._focusedFile}get selectedFiles(){return this._selectedFiles}get onDidRefreshed(){return this.onDidRefreshedEmitter.event}get onDidTreeModelChange(){return this.onDidTreeModelChangeEmitter.event}async collapseAll(){await this.treeModel.root.collapsedAll()}async getCacheKey(E=W.List,R){var A;return R||(R=(A=(await this.workspaceService.roots)[0])===null||A===void 0?void 0:A.uri),`${R}_git_${E===W.List?"list":"tree"}`}async initTreeModel(E,R){this.treeModelDisposableCollection&&this.treeModelDisposableCollection.dispose();const A=E?W.Tree:W.List,w=await this.getCacheKey(A,R);if(this.treeModelCache.has(w)){const{treeModel:F,decorations:V,selectedDecoration:Y,focusedDecoration:_,contextMenuDecoration:H}=this.treeModelCache.get(w);this._activeTreeModel=F,this._activeDecorations=V,this._selectedDecoration=Y,this._focusedDecoration=_,this._contextMenuDecoration=H,await this.refresh()}else{const F=(await this.scmTreeService.resolveChildren())[0];if(!F)return;this._activeTreeModel=this.injector.get(c.SCMTreeModel,[F]),this._activeDecorations=this.initDecorations(F),this.disposableCollection.push(this._activeDecorations),this.treeModelCache.set(w,{treeModel:this._activeTreeModel,decorations:this._activeDecorations,selectedDecoration:this._selectedDecoration,focusedDecoration:this._focusedDecoration,contextMenuDecoration:this._contextMenuDecoration})}this.treeModelDisposableCollection=new g.DisposableCollection,this.onDidTreeModelChangeEmitter.fire(this._activeTreeModel)}dispose(){this.disposableCollection.dispose()}initDecorations(E){return this._activeDecorations=new I.DecorationsManager(E),this._selectedDecoration=new I.Decoration(v.default.mod_selected),this._focusedDecoration=new I.Decoration(v.default.mod_focused),this._contextMenuDecoration=new I.Decoration(v.default.mod_actived),this._activeDecorations.addDecoration(this.selectedDecoration),this._activeDecorations.addDecoration(this.focusedDecoration),this._activeDecorations.addDecoration(this.contextMenuDecoration),this._activeDecorations}handleTreeHandler(E){this._scmTreeHandle=E}_getSelectedFiles(){return this._selectedFiles.filter(E=>!!E&&!h.SCMResourceGroup.is(E))}get listOpenMode(){return this.corePreferences["workbench.list.openMode"]}async refresh(E){var R;E===void 0&&(E=(R=this.treeModel)===null||R===void 0?void 0:R.root),E&&(this.refreshCancelToken&&!this.refreshCancelToken.token.isCancellationRequested&&this.refreshCancelToken.cancel(),this.refreshCancelToken=new g.CancellationTokenSource,await E.refresh(this.refreshCancelToken),this.refreshCancelToken=null)}};n.__decorate([(0,o.Autowired)(p.LabelService),n.__metadata("design:type",p.LabelService)],Z.prototype,"labelService",void 0),n.__decorate([(0,o.Autowired)(s.SCMTreeDecorationService),n.__metadata("design:type",s.SCMTreeDecorationService)],Z.prototype,"decorationService",void 0),n.__decorate([(0,o.Autowired)(g.CommandService),n.__metadata("design:type",Object)],Z.prototype,"commandService",void 0),n.__decorate([(0,o.Autowired)(G.IProgressService),n.__metadata("design:type",Object)],Z.prototype,"progressService",void 0),n.__decorate([(0,o.Autowired)(m.IIconService),n.__metadata("design:type",Object)],Z.prototype,"iconService",void 0),n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],Z.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(f.SCMTreeService),n.__metadata("design:type",f.SCMTreeService)],Z.prototype,"scmTreeService",void 0),n.__decorate([(0,o.Autowired)(l.ViewModelContext),n.__metadata("design:type",l.ViewModelContext)],Z.prototype,"viewModel",void 0),n.__decorate([(0,o.Autowired)(u.ICtxMenuRenderer),n.__metadata("design:type",u.ICtxMenuRenderer)],Z.prototype,"ctxMenuRenderer",void 0),n.__decorate([(0,o.Autowired)(g.CorePreferences),n.__metadata("design:type",Object)],Z.prototype,"corePreferences",void 0),n.__decorate([(0,o.Autowired)(b.WorkbenchEditorService),n.__metadata("design:type",b.WorkbenchEditorService)],Z.prototype,"workbenchEditorService",void 0),n.__decorate([(0,o.Autowired)(g.PreferenceService),n.__metadata("design:type",Object)],Z.prototype,"preferenceService",void 0),n.__decorate([(0,o.Autowired)(d.IWorkspaceService),n.__metadata("design:type",Object)],Z.prototype,"workspaceService",void 0),n.__decorate([(0,o.Autowired)(g.ILogger),n.__metadata("design:type",Object)],Z.prototype,"logger",void 0),n.__decorate([a.observable.deep,n.__metadata("design:type",Object)],Z.prototype,"iconThemeDesc",void 0),Z=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],Z),e.SCMTreeModelService=Z},28087:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMResourceFile=e.SCMResourceFolder=e.SCMResourceGroup=e.SCMResourceRoot=void 0;const n=t(85608),a=t(97267),o=t(41869),I=t(36367),g=t(38563);class u extends a.CompositeTreeNode{static is(d){return!!d&&!d.parent}constructor(d,r){super(d,void 0),this.isTree=r}get name(){return`SCMTree_${this.isTree?"Tree":"List"}_${this.id}`}get expanded(){return!0}dispose(){super.dispose()}}e.SCMResourceRoot=u;class G extends a.CompositeTreeNode{static is(d){return a.CompositeTreeNode.is(d)&&!!d.resource&&(0,I.isSCMResourceGroup)(d.resource)}constructor(d,r,l,s){super(d,r),this.raw=l,this.resource=s,this.isExpanded=!0}get displayName(){return this.resource.label}get uri(){return new o.URI(`scm-group://${this.resource.id}`)}}n.__decorate([o.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],G.prototype,"displayName",null),n.__decorate([o.memoize,n.__metadata("design:type",o.URI),n.__metadata("design:paramtypes",[])],G.prototype,"uri",null),e.SCMResourceGroup=G;class p extends a.CompositeTreeNode{constructor(d,r,l,s,c){super(d,r,void 0,{name:c?l.name:l.pathname}),this.raw=l,this.resource=s,this.description="",this.isExpanded=!0}get displayName(){return this.raw.name}get uri(){return new o.URI(this.raw.resource.sourceUri)}get tooltip(){const d=this.resource;return o.path.join(d.resourceGroup.provider.rootUri.path,this.raw.pathname)}get arguments(){return(0,g.collectSCMResourceDesc)(this.raw,[])}}n.__decorate([o.memoize,n.__metadata("design:type",String),n.__metadata("design:paramtypes",[])],p.prototype,"displayName",null),n.__decorate([o.memoize,n.__metadata("design:type",o.URI),n.__metadata("design:paramtypes",[])],p.prototype,"uri",null),n.__decorate([o.memoize,n.__metadata("design:type",String),n.__metadata("design:paramtypes",[])],p.prototype,"tooltip",null),e.SCMResourceFolder=p;class b extends a.TreeNode{constructor(d,r,l,s,c){super(d,r,void 0,{name:c?l.name:l.pathname}),this.raw=l,this.resource=s,this.isTree=c}get displayName(){return this.raw.name}get uri(){return new o.URI(this.raw.resource.sourceUri)}get description(){if(this.isTree)return"";const d=this.resource,r=o.path.parse(d.sourceUri.path);return o.path.relative(d.resourceGroup.provider.rootUri.path,r.dir)}get tooltip(){return this.resource.sourceUri.path}}n.__decorate([o.memoize,n.__metadata("design:type",String),n.__metadata("design:paramtypes",[])],b.prototype,"displayName",null),n.__decorate([o.memoize,n.__metadata("design:type",o.URI),n.__metadata("design:paramtypes",[])],b.prototype,"uri",null),n.__decorate([o.memoize,n.__metadata("design:type",String),n.__metadata("design:paramtypes",[])],b.prototype,"description",null),n.__decorate([o.memoize,n.__metadata("design:type",String),n.__metadata("design:paramtypes",[])],b.prototype,"tooltip",null),e.SCMResourceFile=b},74568:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMTreeNode=e.SCMResourceNode=e.SCMResourceGroupNode=e.SCM_BADGE_LIMIT=e.SCM_TREE_NODE_HEIGHT=void 0;const n=t(85608),a=n.__importDefault(t(53373)),o=n.__importStar(t(14041)),I=t(97267),g=t(41869),u=t(25918),G=t(52416),p=t(49914),b=t(28087),m=n.__importDefault(t(87440));e.SCM_TREE_NODE_HEIGHT=22,e.SCM_BADGE_LIMIT=99;const d=({item:s,defaultLeftPadding:c=8,leftPadding:h=8,onClick:v,onDoubleClick:f,onContextMenu:W,itemType:N,decorations:Z,onTwistierClick:y})=>{const E=(0,g.useInjectable)(p.ViewModelContext),R=`${c+(s.depth||0)*(h||0)}px`,A=(0,g.useDesignStyles)(m.default.expansion_toggle,"expansion_toggle"),w=(0,g.useDesignStyles)(m.default.scm_tree_node,"scm_tree_node"),F=s.resource,V=o.default.useCallback(()=>{const O=E.menus.getRepositoryMenus(F.provider).getResourceGroupMenu(F);return o.default.createElement("div",{className:m.default.scm_tree_node_actions},o.default.createElement(u.InlineMenuBar,{context:[F],menus:O,separator:"inline"}))},[F]),Y=(0,o.useCallback)(Q=>{Q.nativeEvent.which!==0&&W(Q,s,N)},[W]),_=(0,o.useCallback)(Q=>{v(Q,s,N)},[v]),H=(0,o.useCallback)(Q=>{f(Q,s,N)},[f]),S=(0,o.useCallback)((Q,O)=>Z&&Z?.classlist.indexOf(m.default.mod_loading)>-1?o.default.createElement(I.Loading,null):o.default.createElement("div",{onClick:O,className:(0,a.default)(m.default.scm_tree_node_segment,A,(0,g.getIcon)("arrow-right"),{[`${m.default.mod_collapsed}`]:!Q.expanded})}),[Z]),X=(0,o.useCallback)(Q=>{(N===I.TreeNodeType.TreeNode||N===I.TreeNodeType.CompositeTreeNode)&&(y?y(Q,s,N):v(Q,s,N))},[y,v]);return o.default.createElement("div",{key:s.id,onClick:_,onDoubleClick:H,onContextMenu:Y,className:(0,a.default)(w,Z?Z.classlist:null),style:{height:e.SCM_TREE_NODE_HEIGHT,lineHeight:`${e.SCM_TREE_NODE_HEIGHT}px`,paddingLeft:R},"data-id":s.id},o.default.createElement("div",{className:(0,a.default)(m.default.scm_tree_node_content)},S(s,X),o.default.createElement("div",{className:m.default.scm_tree_node_overflow_wrap},o.default.createElement("div",{className:(0,a.default)(m.default.scm_tree_node_segment,m.default.scm_tree_node_displayname)},s.displayName)),V(),o.default.createElement("div",{className:(0,a.default)(m.default.scm_tree_node_segment,m.default.scm_tree_node_tail)},o.default.createElement(I.Badge,null,s.resource.elements.length))))};e.SCMResourceGroupNode=d;const r=({item:s,defaultLeftPadding:c=8,leftPadding:h=8,onClick:v,onDoubleClick:f,onTwistierClick:W,onContextMenu:N,itemType:Z,decorationService:y,labelService:E,decorations:R,iconTheme:A})=>{const w=(0,g.useInjectable)(p.ViewModelContext),F=b.SCMResourceGroup.is(s)?null:y.getDecoration(s.uri,!1),V=(0,g.useDesignStyles)(m.default.expansion_toggle,"expansion_toggle"),Y=(0,g.useDesignStyles)(m.default.scm_tree_node,"scm_tree_node"),_=s.resource,H=(0,o.useCallback)(()=>{const re=w.menus.getRepositoryMenus(_.resourceGroup.provider);let ae,he;return Z===I.TreeNodeType.TreeNode?(ae=re.getResourceMenu(_),he=[_]):(ae=re.getResourceFolderMenu(_.resourceGroup),he=s.arguments),o.default.createElement("div",{className:m.default.scm_tree_node_actions},o.default.createElement(u.InlineMenuBar,{menus:ae,context:he,separator:"inline"}))},[Z,_.resourceGroup]),S=(0,o.useCallback)(re=>{v(re,s,Z)},[v]),X=(0,o.useCallback)(re=>{f(re,s,Z)},[f]),Q=(0,o.useCallback)(re=>{re.nativeEvent.which!==0&&N(re,s,Z)},[N]),O=b.SCMResourceFolder.is(s),{hidesExplorerArrows:M,hasFolderIcons:T}=A,x=`${c+(s.depth||0)*(h||0)+(O?0:T?M?0:20:0)}px`,B=re=>{const ae=E.getIcon(re.uri,{isDirectory:b.SCMResourceFolder.is(re)});return o.default.createElement("div",{className:(0,a.default)(m.default.file_icon,ae),style:{height:e.SCM_TREE_NODE_HEIGHT,lineHeight:`${e.SCM_TREE_NODE_HEIGHT}px`}})},D=(0,o.useCallback)(re=>o.default.createElement("div",{className:(0,a.default)(m.default.scm_tree_node_segment,m.default.scm_tree_node_displayname)},b.SCMResourceFolder.is(re)?re.displayName:E.getName(re.uri)),[E]),J=(0,o.useCallback)(re=>o.default.createElement("div",{className:(0,a.default)(m.default.scm_tree_node_segment_grow,m.default.scm_tree_node_description)},re.description),[]),k=(0,g.useInjectable)(G.IThemeService),z=()=>{if(!F)return null;const re=F.badge||s.resource.decorations.letter||"",ae=F.color||s.resource.decorations.color,he=ae&&k.getColor({id:ae});return o.default.createElement("div",{className:m.default.scm_tree_node_status,style:{color:he}},re.slice())},P=(0,o.useCallback)(()=>{let re=s.tooltip;return F&&F.badge&&(re+=` \u2022 ${F.tooltip||s.resource.decorations.tooltip||""}`),re},[s]),U=(0,o.useCallback)(re=>{(Z===I.TreeNodeType.TreeNode||Z===I.TreeNodeType.CompositeTreeNode)&&(W?W(re,s,Z):v(re,s,Z))},[W,v]),oe=(0,o.useCallback)((re,ae)=>b.SCMResourceFolder.is(re)?R&&R?.classlist.indexOf(m.default.mod_loading)>-1?o.default.createElement(I.Loading,null):o.default.createElement("div",{onClick:ae,className:(0,a.default)(m.default.scm_tree_node_segment,V,(0,g.getIcon)("arrow-right"),{[`${m.default.mod_collapsed}`]:!re.expanded})}):null,[R]);return o.default.createElement("div",{key:s.id,onClick:S,onDoubleClick:X,onContextMenu:Q,title:P(),className:(0,a.default)(Y,R?R.classlist:null),style:{color:F?F.color:"",paddingLeft:x,height:e.SCM_TREE_NODE_HEIGHT,lineHeight:`${e.SCM_TREE_NODE_HEIGHT}px`},"data-id":s.id},o.default.createElement("div",{className:(0,a.default)(m.default.scm_tree_node_content)},oe(s,U),B(s),o.default.createElement("div",{className:m.default.scm_tree_node_overflow_wrap,style:{textDecoration:F&&F.badge==="D"?"line-through":"none"}},D(s),J(s)),H(),o.default.createElement("div",{className:(0,a.default)(m.default.scm_tree_node_segment,m.default.scm_tree_node_tail)},z())))};e.SCMResourceNode=r;const l=s=>{const{item:c}=s,h=n.__rest(s,["item"]);return b.SCMResourceGroup.is(c)?o.default.createElement(e.SCMResourceGroupNode,Object.assign({item:c},h)):o.default.createElement(e.SCMResourceNode,Object.assign({},s,{item:c}))};e.SCMTreeNode=l},63451:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMTreeService=void 0;const n=t(85608),a=t(76003),o=t(97267),I=t(41869),g=t(43718),u=t(64964),G=t(38563),p=t(28087);let b=class extends o.Tree{get isTreeMode(){return this._isTreeMode}get onDidTreeModeChange(){return this.onDidTreeModeChangeEmitter.event}constructor(){super(),this.onDidTreeModeChangeEmitter=new I.Emitter,this._isTreeMode=this.preferenceService.get("scm.defaultViewMode")===u.SCMViewModelMode.Tree,this.toDispose.push(this.preferenceService.onSpecificPreferenceChange("scm.defaultViewMode",d=>{const r=d.newValue===u.SCMViewModelMode.Tree;r!==this._isTreeMode&&(this._isTreeMode=r,this.onDidTreeModeChangeEmitter.fire(this._isTreeMode))}))}changeTreeMode(d){this.preferenceService.set("scm.defaultViewMode",d?u.SCMViewModelMode.Tree:u.SCMViewModelMode.List,g.PreferenceScope.User)}async resolveChildren(d){let r=[];if(!d)this._root=new p.SCMResourceRoot(this,this._isTreeMode),r=[this._root];else if(p.SCMResourceRoot.is(d)){const l=this.scmTreeAPI.init(this._isTreeMode?u.SCMViewModelMode.Tree:u.SCMViewModelMode.List);r.push(...l.map(s=>this.toNode(s,d,this._isTreeMode)))}else if(d.raw){const l=d.raw.children;r.push(...l.map(s=>this.toNode(s,d,this._isTreeMode)))}return r}toNode(d,r,l){if(d.type==="group"){const c=d;return new p.SCMResourceGroup(this,r,c,c.resource)}const s=d;return d.type==="file"?new p.SCMResourceFile(this,r,s,s.resource,l):new p.SCMResourceFolder(this,r,s,s.resource,l)}sortComparator(d,r){if(p.SCMResourceGroup.is(d)&&p.SCMResourceGroup.is(r)){const l={merge:3,index:2,workingTree:1};return l[r.resource.id]-l[d.resource.id]}return super.sortComparator(d,r)}};n.__decorate([(0,a.Autowired)(G.SCMTreeAPI),n.__metadata("design:type",G.SCMTreeAPI)],b.prototype,"scmTreeAPI",void 0),n.__decorate([(0,a.Autowired)(I.PreferenceService),n.__metadata("design:type",Object)],b.prototype,"preferenceService",void 0),b=n.__decorate([(0,a.Injectable)(),n.__metadata("design:paramtypes",[])],b),e.SCMTreeService=b},42126:(L,e,t)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.DirtyDiffDecorator=void 0;const a=t(85608),o=t(76003),I=t(41869),g=t(54414),u=t(52416),G=a.__importStar(t(43255)),p=a.__importStar(t(88104)),b=t(7168),m=t(73018),d=t(24870),r=t(84416);let l=n=class extends I.Disposable{static createDecoration(c,h){const v={description:"dirty-diff-decoration",isWholeLine:h.isWholeLine};return h.gutter&&(v.linesDecorationsClassName=`dirty-diff-glyph ${c}`),h.overview.active&&(v.overviewRuler={color:(0,u.themeColorFromId)(h.overview.color),position:g.OverviewRulerLane.Left}),h.minimap.active&&(v.minimap={color:(0,u.themeColorFromId)(h.minimap.color),position:G.MinimapPosition.Gutter}),p.ModelDecorationOptions.createDynamic(v)}constructor(c,h){super(),this.model=h,this.decorations=[],this.editorModel=c;const v=this.scmPreferences["scm.diffDecorations"],f=v==="all"||v==="gutter",W=v==="all"||v==="overview",N=v==="all"||v==="minimap";this.modifiedOptions=n.createDecoration("dirty-diff-modified",{gutter:f,overview:{active:W,color:b.overviewRulerModifiedForeground},minimap:{active:N,color:b.minimapGutterModifiedBackground},isWholeLine:!0}),this.addedOptions=n.createDecoration("dirty-diff-added",{gutter:f,overview:{active:W,color:b.overviewRulerAddedForeground},minimap:{active:N,color:b.minimapGutterAddedBackground},isWholeLine:!0}),this.deletedOptions=n.createDecoration("dirty-diff-deleted",{gutter:f,overview:{active:W,color:b.overviewRulerDeletedForeground},minimap:{active:N,color:b.minimapGutterDeletedBackground},isWholeLine:!1}),this.addDispose(h.onDidChange(this.onDidChange,this))}onDidChange(){if(!this.editorModel)return;const c=this.model.changes.map(h=>{const v=(0,r.getChangeType)(h),f=h[2],W=h[3]-1||f-1;switch(v){case r.ChangeType.Add:return{range:{startLineNumber:f,startColumn:1,endLineNumber:W,endColumn:1},options:this.addedOptions};case r.ChangeType.Delete:return{range:{startLineNumber:f-1,startColumn:Number.MAX_VALUE,endLineNumber:f>0?f-1:f,endColumn:Number.MAX_VALUE},options:this.deletedOptions};case r.ChangeType.Modify:return{range:{startLineNumber:f,startColumn:1,endLineNumber:W,endColumn:1},options:this.modifiedOptions}}});this.decorations=this.editorModel.getMonacoModel().deltaDecorations(this.decorations,c)}dispose(){super.dispose(),this.editorModel&&!this.editorModel.getMonacoModel().isDisposed()&&this.editorModel.getMonacoModel().deltaDecorations(this.decorations,[]),this.editorModel=null,this.decorations=[]}};a.__decorate([(0,o.Autowired)(m.SCMPreferences),a.__metadata("design:type",Object)],l.prototype,"scmPreferences",void 0),l=n=a.__decorate([(0,o.Injectable)({multiple:!0}),a.__param(0,(0,o.Optional)()),a.__param(1,(0,o.Optional)()),a.__metadata("design:paramtypes",[Object,d.DirtyDiffModel])],l),e.DirtyDiffDecorator=l},24870:(L,e,t)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.DirtyDiffModel=e.isDirtyDiffVisible=void 0;const a=t(85608),o=t(76003),I=t(41869),g=t(40191),u=t(54414),G=t(57517),p=a.__importStar(t(20868)),b=t(28240),m=t(83e3),d=t(64964),r=t(84416),{sortedDiff:l}=I.arrays;e.isDirtyDiffVisible=new g.RawContextKey("dirtyDiffVisible",!1);let s=n=class extends I.Disposable{get original(){return this._originalModel}get modified(){return this._editorModel}get changes(){return this._changes}get editorWorkerService(){return m.StandaloneServices.get(b.IEditorWorkerService)}constructor(h){super(),this.repositoryDisposables=new Set,this._onDidChange=new I.Emitter,this.onDidChange=this._onDidChange.event,this._changes=[],this._editorModel=h,this.diffDelayer=new I.ThrottledDelayer(200),this.addDispose(I.Disposable.create(()=>{this.diffDelayer&&(this.diffDelayer.isTriggered()||this.diffDelayer.cancel(),this.diffDelayer=null)})),this.addDispose(h.getMonacoModel().onDidChangeContent(()=>this.triggerDiff())),this.addDispose(h.onDidChangeEncoding(()=>{var v;(v=this.diffDelayer)===null||v===void 0||v.cancel(),this._originalModel=null,this._originalURIPromise=void 0,this._changes=[],this.triggerDiff()})),this.addDispose(this.scmService.onDidAddRepository(this.onDidAddRepository,this)),this.scmService.repositories.forEach(v=>this.onDidAddRepository(v)),this.triggerDiff(),this.originalModelDisposables=new I.DisposableStore,this.addDispose(this.originalModelDisposables),this.isDirtyDiffVisible=e.isDirtyDiffVisible.bind(this.contextKeyService)}onDidAddRepository(h){const v=new I.DisposableStore;this.repositoryDisposables.add(v),v.add((0,I.toDisposable)(()=>this.repositoryDisposables.delete(v)));const f=I.Event.any(h.provider.onDidChange,h.provider.onDidChangeResources);v.add(f(this.triggerDiff,this));const W=I.Event.filter(this.scmService.onDidRemoveRepository,N=>N===h);v.add(W(()=>(0,I.dispose)(v),null)),this.triggerDiff()}triggerDiff(){return this.diffDelayer?this.diffDelayer.trigger(()=>this.diff()).then(h=>{if(!this._editorModel||this._editorModel.getMonacoModel().isDisposed()||!this._originalModel||this._originalModel.getMonacoModel().isDisposed())return;(!h||this._originalModel.getMonacoModel().getValueLength()===0)&&(h=[]);const v=l(this.changes,h,r.compareChanges);this._changes=h,v.length>0&&this._onDidChange.fire(v)}):Promise.resolve(null)}canSyncModelForDiff(h){if(!h)return!1;const v=n.maxFileSize*1024*1024,f=h.getValueLength();return v===0||f<=v}async diff(){var h;const v=await this.getOriginalURIPromise();if(!this._editorModel||this._editorModel.getMonacoModel().isDisposed()||!v)return[];if(!this.canSyncModelForDiff((h=this._originalModel)===null||h===void 0?void 0:h.getMonacoModel())||!this.canSyncModelForDiff(this._editorModel.getMonacoModel()))return[];const f=await this.editorWorkerService.computeDiff(v,this._editorModel.getMonacoModel().uri,{ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3,computeMoves:!1},"advanced");return f&&this.getLineChanges(f.changes)}getLineChanges(h){return h.map(v=>{var f;return[v.original.startLineNumber,v.original.endLineNumberExclusive,v.modified.startLineNumber,v.modified.endLineNumberExclusive,(f=v.innerChanges)===null||f===void 0?void 0:f.map(W=>[W.originalRange.startLineNumber,W.originalRange.startColumn,W.originalRange.endLineNumber,W.originalRange.endColumn,W.modifiedRange.startLineNumber,W.modifiedRange.startColumn,W.modifiedRange.endLineNumber,W.modifiedRange.endColumn])]})}getOriginalURIPromise(){return this._originalURIPromise?this._originalURIPromise:(this._originalURIPromise=this.getOriginalResource().then(h=>this._editorModel?h?this._originalModel&&this._originalModel.uri.toString()===h.toString()?h:this.documentModelManager.createModelReference(new I.URI(h)).then(v=>{if(!this._editorModel||!v)return null;this._originalModel=v.instance,this._originalModel.updateEncoding(this._editorModel.encoding);const f=this._originalModel.getMonacoModel();return this.originalModelDisposables.clear(),this.originalModelDisposables.add(v),this.originalModelDisposables.add(f.onDidChangeContent(()=>this.triggerDiff())),h}):(this._originalModel=null,null):null),this._originalURIPromise.finally(()=>{this._originalURIPromise=void 0}))}getOriginalResource(){if(!this._editorModel)return Promise.resolve(null);const h=this._editorModel.getMonacoModel().uri;return(0,I.first)(this.scmService.repositories.map(v=>()=>v.provider.getOriginalResource(h)))}findNextClosestChange(h,v=!0){for(let f=0;f<this.changes.length;f++){const W=this.changes[f];if(v){if((0,r.getModifiedEndLineNumber)(W)>=h)return f}else if(W[2]>h)return f}return 0}findNextClosestChangeLineNumber(h,v=!0){const f=this.findNextClosestChange(h,v);return this.changes[f][2]}findPreviousClosestChange(h,v=!0){for(let f=this.changes.length-1;f>=0;f--){const W=this.changes[f];if(v){if(W[2]<=h)return f}else if((0,r.getModifiedEndLineNumber)(W)<h)return f}return this.changes.length-1}findPreviousClosestChangeLineNumber(h,v=!0){const f=this.findPreviousClosestChange(h,v);return this.changes[f][2]}getChangeFromRange(h){const v=this.findNextClosestChange(h.startLineNumber);return{change:this.changes[v],count:v+1}}async onClickDecoration(h,v){if(this._widget)if(this._widget===h){this._widget.dispose();return}else this._widget.dispose();if(this._widget=h,this._originalModel&&this._editorModel){let w=function(F,V){h.updateCurrent(F),h.show(p.positionToRange(V[3]-1),n.heightInLines),E.isDirtyDiffVisible.set(!0)};const f=this._originalModel.uri,W=this._editorModel.uri,N=this.editorService.createDiffEditor(h.getContentNode(),{automaticLayout:!0,renderSideBySide:!1,hideUnchangedRegions:{enabled:!1}}),Z=await this.documentModelManager.createModelReference(f),y=await this.documentModelManager.createModelReference(W);N.compare(Z,y),N.modifiedEditor.monacoEditor.updateOptions({readOnly:!0}),N.originalEditor.monacoEditor.updateOptions({readOnly:!0}),N.modifiedEditor.monacoEditor.revealLineInCenter(v.startLineNumber-Math.round(n.heightInLines/2)),h.addDispose(N.originalEditor.monacoEditor.onDidChangeModelContent(()=>{h.relayout(n.heightInLines)}));const E=this;h.addDispose(this.onDidChange(()=>{const{change:F,count:V}=this.getChangeFromRange(v)||{};w(V,F)}));const{change:R,count:A}=this.getChangeFromRange(v)||{};A&&R&&w(A,R),h.onDispose(()=>{this._widget=null,E.isDirtyDiffVisible.set(!1)})}}dispose(){super.dispose(),this._editorModel=null,this._originalModel=null,this.repositoryDisposables.forEach(h=>(0,I.dispose)(h)),this.repositoryDisposables.clear()}};s.heightInLines=10,s.maxFileSize=50,a.__decorate([(0,o.Autowired)(I.IContextKeyService),a.__metadata("design:type",Object)],s.prototype,"contextKeyService",void 0),a.__decorate([(0,o.Autowired)(d.SCMService),a.__metadata("design:type",d.SCMService)],s.prototype,"scmService",void 0),a.__decorate([(0,o.Autowired)(G.IEditorDocumentModelService),a.__metadata("design:type",Object)],s.prototype,"documentModelManager",void 0),a.__decorate([(0,o.Autowired)(u.EditorCollectionService),a.__metadata("design:type",u.EditorCollectionService)],s.prototype,"editorService",void 0),s=n=a.__decorate([(0,o.Injectable)({multiple:!0}),a.__param(0,(0,o.Optional)()),a.__metadata("design:paramtypes",[Object])],s),e.DirtyDiffModel=s},84416:(L,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toChange=e.getChangeType=e.ChangeType=e.getModifiedEndLineNumber=e.compareChanges=void 0;function t(g,u){let G=g[2]-u[2];return G!==0||(G=g[3]-u[3],G!==0)||(G=g[0]-u[0],G!==0)?G:g[1]-u[1]}e.compareChanges=t;function n(g){return g[3]===0?g[2]===0?1:g[2]:g[3]}e.getModifiedEndLineNumber=n;var a;(function(g){g.Modify="Modify",g.Add="Add",g.Delete="Delete"})(a=e.ChangeType||(e.ChangeType={}));function o(g){return g[1]-g[0]===0?a.Add:g[1]>g[0]&&g[2]===g[3]?a.Delete:a.Modify}e.getChangeType=o;function I(g){switch(o(g)){case a.Add:return{originalStartLineNumber:g[0],originalEndLineNumber:0,modifiedStartLineNumber:g[2],modifiedEndLineNumber:g[3]};case a.Modify:return{originalStartLineNumber:g[0],originalEndLineNumber:g[1],modifiedStartLineNumber:g[2],modifiedEndLineNumber:g[3]};case a.Delete:return{originalStartLineNumber:g[0],originalEndLineNumber:g[1],modifiedStartLineNumber:g[2],modifiedEndLineNumber:0};default:return{originalStartLineNumber:g[0],originalEndLineNumber:g[1],modifiedStartLineNumber:g[2],modifiedEndLineNumber:g[3]}}}e.toChange=I},54595:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirtyDiffWidget=e.DirtyDiffWidgetActionType=void 0;const n=t(41869),a=t(87308),o=t(31324),I=t(64964),g=t(84416);var u;(function(p){p[p.close=0]="close",p[p.save=1]="save",p[p.reset=2]="reset",p[p.next=3]="next",p[p.previous=4]="previous"})(u=e.DirtyDiffWidgetActionType||(e.DirtyDiffWidgetActionType={}));class G extends a.ZoneWidget{_fillContainer(b){}get uri(){return n.URI.from(this.editor.getModel().uri)}constructor(b,m,d){super(b),this.commandService=d,this._currentChangeIndex=0,this._model=m,this._wrapper=document.createElement("div"),this._head=document.createElement("div"),this._content=document.createElement("div"),this._container.appendChild(this._wrapper),this._wrapper.appendChild(this._head),this._wrapper.appendChild(this._content)}get currentIndex(){return this._currentChangeIndex}updateCurrent(b){this._currentChangeIndex=b}applyStyle(){if(!this._title)return;this._title.children[0]&&this._title.removeChild(this._title.children[0]);const b=document.createElement("span");b.className="dirty-diff-widget-title-detail",b.innerText=(0,n.formatLocalize)("scm.dirtyDiff.changes",this._currentChangeIndex,this._model.changes.length),this._title.appendChild(b)}getBorderColor(b){switch(b){case g.ChangeType.Add:return"var(--editorGutter-addedBackground)";case g.ChangeType.Modify:return"var(--editorGutter-modifiedBackground)";case g.ChangeType.Delete:return"var(--editorGutter-deletedBackground)"}}applyClass(){this._wrapper.className="dirty-diff-widget-wrapper",this._head.className="dirty-diff-widget-header",this._content.className="dirty-diff-widget-content";const b=this._model.changes[this._currentChangeIndex-1],m=(0,g.getChangeType)(b),d=this.getBorderColor(m);this._head.style.borderTopColor=d,this._head.style.borderBottomColor=d,this._content.style.borderBottomColor=d;const r=this.editor.getOption(o.EditorOption.lineHeight),l=Math.ceil(r*1.2);this._head.style.height=`${l}px`,this._renderTitle();const s=this.editor.getModel();if(!s)throw new Error("Not found model");this._title.innerText=n.path.basename(s.uri.path),this._title.className="file-name",this._actions.className="file-actions",this._renderActions()}getContentNode(){return this._content}_renderTitle(){this._head.children.length===0&&(this._title=document.createElement("div"),this._actions=document.createElement("div"),this._head.appendChild(this._title),this._head.appendChild(this._actions))}_addAction(b,m){const d=document.createElement("div");return d.className=`kt-icon codicon codicon-${b}`,this._actions.appendChild(d),d.onclick=()=>this.handleAction(m),d}_renderActions(){this._actions.children.length===0&&(this._addAction("add",u.save),this._addAction("discard",u.reset),this._addAction("arrow-up",u.next),this._addAction("arrow-down",u.previous),this._addAction("close",u.close))}relayout(b){this._relayout(b)}handleAction(b){let m;const d=this.currentRange,r=[this.uri,this._model.changes.map(g.toChange),this._currentChangeIndex-1];switch(b){case u.next:m=this._model.findNextClosestChangeLineNumber(d.startLineNumber,!1),m&&m!==d.startLineNumber&&this.commandService.executeCommand(I.OPEN_DIRTY_DIFF_WIDGET.id,m);break;case u.previous:m=this._model.findPreviousClosestChangeLineNumber(d.startLineNumber,!1),m&&m!==d.startLineNumber&&this.commandService.executeCommand(I.OPEN_DIRTY_DIFF_WIDGET.id,m);break;case u.save:this.commandService.executeCommand("git.stageChange",...r),this.dispose();break;case u.reset:this.commandService.executeCommand("git.revertChange",...r),this.dispose();break;case u.close:this.dispose();break;default:break}}}e.DirtyDiffWidget=G},71972:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirtyDiffWorkbenchController=e.DirtyDiffItem=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(43718),g=t(54414),u=t(57517),G=n.__importStar(t(20868)),p=t(62663),b=t(64964),m=t(73018),d=t(42126),r=t(24870),l=t(54595);t(22861);class s{constructor(v,f){this.model=v,this.decorator=f}dispose(){this.decorator.dispose(),this.model.dispose()}}e.DirtyDiffItem=s;let c=class extends o.Disposable{constructor(){super(),this.enabled=!1,this.models=[],this.widgets=new Map,this.items=Object.create(null),this.transientDisposables=new o.DisposableStore,this.keybindingRegistry.registerKeybinding({command:b.CLOSE_DIRTY_DIFF_WIDGET.id,keybinding:"esc",when:r.isDirtyDiffVisible.equalsTo(!0)})}start(){const v=o.Event.filter(this.scmPreferences.onPreferenceChanged,W=>W.affects("scm.diffDecorations"));this.addDispose(v(this.onDidChangeConfiguration,this)),this.onDidChangeConfiguration(),o.Event.filter(this.scmPreferences.onPreferenceChanged,W=>W.affects("scm.diffDecorationsGutterWidth"))(this.onDidChangeDiffWidthConfiguration,this),this.onDidChangeDiffWidthConfiguration(),this.addDispose(this.editorFeatureRegistry.registerEditorFeatureContribution({contribute:W=>this.attachEvents(W.monacoEditor)})),this.addDispose(this.scmPreferences.onPreferenceChanged(W=>{W.preferenceName==="scm.alwaysShowDiffWidget"&&W.newValue===!1&&this.widgets.forEach(N=>{N.dispose()})}))}onDidChangeConfiguration(){this.scmPreferences["scm.diffDecorations"]!=="none"?this.enable():this.disable()}onDidChangeDiffWidthConfiguration(){let v=this.scmPreferences["scm.diffDecorationsGutterWidth"];(isNaN(v)||v<=0||v>5)&&(v=3)}enable(){this.enabled&&this.disable(),this.transientDisposables.add(this.eventBus.on(u.EditorGroupChangeEvent,()=>{this.onEditorsChanged()})),this.onEditorsChanged(),this.enabled=!0}disable(){this.enabled&&(this.transientDisposables.clear(),this.models.forEach(v=>{const f=this.items[v.id];f&&f.dispose()}),this.models=[],this.items=Object.create(null),this.enabled=!1)}onEditorsChanged(){const v=this.editorService.editorGroups.filter(N=>N.currentOpenType&&N.currentOpenType.type===u.EditorOpenType.code).map(N=>{const Z=N.currentEditor;return Z?Z.currentDocumentModel:null}).filter((N,Z,y)=>!!N&&!!N.uri&&y.indexOf(N,Z+1)===-1),f=v.filter(N=>this.models.every(Z=>N!==Z));this.models.filter(N=>v.every(Z=>Z!==N)).forEach(N=>this.onModelInvisible(N)),f.forEach(N=>this.onModelVisible(N)),this.models=v}onModelVisible(v){const f=this.injector.get(r.DirtyDiffModel,[v]),W=this.injector.get(d.DirtyDiffDecorator,[v,f]);this.items[v.id]=new s(f,W)}onModelInvisible(v){this.items[v.id].dispose(),delete this.items[v.id]}closeDirtyDiffWidget(v){const f=this.widgets.get(v.getId());f&&f.dispose()}toggleDirtyDiffWidget(v,f){const W=v.getModel();if(W&&f){let N=this.widgets.get(v.getId());const Z=this.getModel(W);if(Z){if(N){const{currentIndex:y}=N,{count:E}=Z.getChangeFromRange(G.positionToRange(f));if(N.dispose(),y===E)return}N=new l.DirtyDiffWidget(v,Z,this.commandService),N.onDispose(()=>{this.widgets.delete(v.getId())}),Z.onClickDecoration(N,G.positionToRange(f)),this.widgets.set(v.getId(),N)}}}_doMouseDown(v,{target:f}){if(!f)return;const{position:W,type:N,element:Z}=f;if(N===p.monacoBrowser.editor.MouseTargetType.GUTTER_LINE_DECORATIONS&&Z&&Z.className.indexOf("dirty-diff-glyph")>-1&&W){const y=Z.offsetLeft;if(f.detail.offsetX-y<5)this.toggleDirtyDiffWidget(v,W);else{const R=this.widgets.get(v.getId());R&&(R.dispose(),this.widgets.delete(v.getId()))}}}attachEvents(v){const f=new o.DisposableCollection;return f.push(v.onMouseDown(W=>{this.scmPreferences["scm.alwaysShowDiffWidget"]&&this._doMouseDown(v,W)})),f.push(v.onDidChangeModel(({oldModelUrl:W})=>{if(W){const N=this.widgets.get(v.getId());N&&N.dispose()}})),f.push(v.onDidDispose(()=>{f.dispose()})),f}getModel(v){const f=this.items[v.id];return f?f.model:null}dispose(){this.disable(),this.widgets.forEach(v=>v.dispose()),this.widgets.clear(),super.dispose()}};n.__decorate([(0,a.Autowired)(m.SCMPreferences),n.__metadata("design:type",Object)],c.prototype,"scmPreferences",void 0),n.__decorate([(0,a.Autowired)(g.WorkbenchEditorService),n.__metadata("design:type",g.WorkbenchEditorService)],c.prototype,"editorService",void 0),n.__decorate([(0,a.Autowired)(u.IEditorFeatureRegistry),n.__metadata("design:type",Object)],c.prototype,"editorFeatureRegistry",void 0),n.__decorate([(0,a.Autowired)(I.IEventBus),n.__metadata("design:type",Object)],c.prototype,"eventBus",void 0),n.__decorate([(0,a.Autowired)(a.INJECTOR_TOKEN),n.__metadata("design:type",a.Injector)],c.prototype,"injector",void 0),n.__decorate([(0,a.Autowired)(I.CommandService),n.__metadata("design:type",Object)],c.prototype,"commandService",void 0),n.__decorate([(0,a.Autowired)(o.KeybindingRegistry),n.__metadata("design:type",Object)],c.prototype,"keybindingRegistry",void 0),c=n.__decorate([(0,a.Injectable)(),n.__metadata("design:paramtypes",[])],c),e.DirtyDiffWorkbenchController=c},31435:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMModule=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(64964),g=t(71972),u=t(7114),G=t(38672),p=t(73018),b=t(75756);let m=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[b.SCMContribution,I.SCMService,u.SCMBadgeController,u.SCMStatusBarController,{token:I.ISCMMenus,useClass:G.SCMMenus},{token:I.IDirtyDiffWorkbenchController,useClass:g.DirtyDiffWorkbenchController}],this.preferences=p.bindSCMPreference}};m=n.__decorate([(0,a.Injectable)()],m),e.SCMModule=m},7114:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMStatusBarController=e.SCMBadgeController=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(26542),g=t(43718),u=t(54414),G=t(63067),p=t(64964);let b=class{constructor(){this.disposables=[]}start(){for(const r of this.scmService.repositories)this.onDidAddRepository(r);this.scmService.onDidAddRepository(this.onDidAddRepository,this,this.disposables),this.render()}onDidAddRepository(r){const l=r.provider,c=o.Event.any(l.onDidChange,l.onDidChangeResources)(()=>this.render()),v=o.Event.filter(this.scmService.onDidRemoveRepository,W=>W===r)(()=>{f.dispose(),this.disposables=this.disposables.filter(W=>W!==v),this.render()}),f=(0,o.combinedDisposable)([c,v]);this.disposables.push(f)}render(){const r=this.scmService.repositories.reduce((l,s)=>typeof s.provider.count=="number"?l+s.provider.count:l+s.provider.groups.elements.reduce((c,h)=>c+h.elements.length,0),0);r>0?this.setSCMTarbarBadge(`${r}`):this.setSCMTarbarBadge("")}setSCMTarbarBadge(r){const l=this.layoutService.getTabbarHandler(p.scmContainerId);l&&l.setBadge(r)}dispose(){this.disposables=(0,o.dispose)(this.disposables)}};n.__decorate([(0,a.Autowired)(p.SCMService),n.__metadata("design:type",p.SCMService)],b.prototype,"scmService",void 0),n.__decorate([(0,a.Autowired)(G.IMainLayoutService),n.__metadata("design:type",Object)],b.prototype,"layoutService",void 0),b=n.__decorate([(0,a.Injectable)()],b),e.SCMBadgeController=b;let m=class{constructor(){this.focusDisposable=o.Disposable.None,this.focusedRepository=void 0,this.disposables=[]}start(){this.scmService.onDidAddRepository(this.onDidAddRepository,this,this.disposables);for(const r of this.scmService.repositories)this.onDidAddRepository(r);this.workbenchEditorService.onActiveResourceChange(this.onDidActiveResouceChange,this,this.disposables)}onDidAddRepository(r){const l=r.onDidFocus(()=>this.onDidFocusRepository(r)),c=o.Event.filter(this.scmService.onDidRemoveRepository,v=>v===r)(()=>{h.dispose(),this.disposables=this.disposables.filter(v=>v!==c),this.scmService.repositories.length===0?this.onDidFocusRepository(void 0):this.focusedRepository===r&&this.scmService.repositories[0].focus()}),h=(0,o.combinedDisposable)([l,c]);this.disposables.push(h),this.focusedRepository||this.onDidFocusRepository(r)}onDidActiveResouceChange(){const r=this.workbenchEditorService.currentResource;if(!r||r.uri.scheme!==g.Schemes.file)return;let l=null,s=Number.NEGATIVE_INFINITY;for(const c of this.scmService.repositories){const h=c.provider.rootUri;if(!h)continue;const v=h.fsPath,f=o.strings.commonPrefixLength(v,r.uri.codeUri.fsPath);f===v.length&&f>s&&(l=c,s=f)}l&&this.onDidFocusRepository(l)}onDidFocusRepository(r){this.focusedRepository!==r&&(this.focusedRepository=r,this.focusDisposable.dispose(),r&&r.provider.onDidChangeStatusBarCommands&&(this.focusDisposable=r.provider.onDidChangeStatusBarCommands(()=>this.render(r))),this.render(r))}render(r){if(!r)return;const l=r.provider.statusBarCommands||[];if(!l.length)return;const s=this.getRepoLabel(r);l.forEach((c,h)=>{this.disposables.push(this.statusbarService.addElement(`status.scm.repo.${h}`,{id:"status.scm",text:c.title,name:(0,g.localize)("status-bar.scm"),priority:1e4,alignment:I.StatusBarAlignment.LEFT,command:c.id,arguments:c.arguments,tooltip:`${s} - ${c.tooltip||c.title}`}))})}getRepoLabel(r){return r.provider.rootUri?`${o.path.basename(r.provider.rootUri.path)} (${r.provider.label})`:r.provider.label}dispose(){this.focusDisposable.dispose(),this.disposables=(0,o.dispose)(this.disposables)}};n.__decorate([(0,a.Autowired)(p.SCMService),n.__metadata("design:type",p.SCMService)],m.prototype,"scmService",void 0),n.__decorate([(0,a.Autowired)(I.IStatusBarService),n.__metadata("design:type",Object)],m.prototype,"statusbarService",void 0),n.__decorate([(0,a.Autowired)(u.WorkbenchEditorService),n.__metadata("design:type",u.WorkbenchEditorService)],m.prototype,"workbenchEditorService",void 0),m=n.__decorate([(0,a.Injectable)()],m),e.SCMStatusBarController=m},7168:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.overviewRulerDeletedForeground=e.overviewRulerAddedForeground=e.overviewRulerModifiedForeground=e.minimapGutterDeletedBackground=e.minimapGutterAddedBackground=e.minimapGutterModifiedBackground=e.editorGutterDeletedBackground=e.editorGutterAddedBackground=e.editorGutterModifiedBackground=void 0;const n=t(43718),a=t(52416);e.editorGutterModifiedBackground=(0,a.registerColor)("editorGutter.modifiedBackground",{dark:new a.Color(new a.RGBA(27,129,168)),light:new a.Color(new a.RGBA(32,144,211)),hcDark:new a.Color(new a.RGBA(27,128,168)),hcLight:new a.Color(new a.RGBA(32,144,211))},(0,n.localize)("editorGutterModifiedBackground","Editor gutter background color for lines that are modified.")),e.editorGutterAddedBackground=(0,a.registerColor)("editorGutter.addedBackground",{dark:new a.Color(new a.RGBA(72,126,2)),light:new a.Color(new a.RGBA(72,152,93)),hcDark:new a.Color(new a.RGBA(72,126,2)),hcLight:new a.Color(new a.RGBA(72,152,93))},(0,n.localize)("editorGutterAddedBackground","Editor gutter background color for lines that are added.")),e.editorGutterDeletedBackground=(0,a.registerColor)("editorGutter.deletedBackground",{dark:a.editorErrorForeground,light:a.editorErrorForeground,hcDark:a.editorErrorForeground,hcLight:a.editorErrorForeground},(0,n.localize)("editorGutterDeletedBackground","Editor gutter background color for lines that are deleted.")),e.minimapGutterModifiedBackground=(0,a.registerColor)("minimapGutter.modifiedBackground",{dark:e.editorGutterModifiedBackground,light:e.editorGutterModifiedBackground,hcDark:e.editorGutterModifiedBackground,hcLight:e.editorGutterModifiedBackground},(0,n.localize)("minimapGutterModifiedBackground","Minimap gutter background color for lines that are modified.")),e.minimapGutterAddedBackground=(0,a.registerColor)("minimapGutter.addedBackground",{dark:e.editorGutterAddedBackground,light:e.editorGutterAddedBackground,hcDark:e.editorGutterAddedBackground,hcLight:e.editorGutterAddedBackground},(0,n.localize)("minimapGutterAddedBackground","Minimap gutter background color for lines that are added.")),e.minimapGutterDeletedBackground=(0,a.registerColor)("minimapGutter.deletedBackground",{dark:e.editorGutterDeletedBackground,light:e.editorGutterDeletedBackground,hcDark:e.editorGutterDeletedBackground,hcLight:e.editorGutterDeletedBackground},(0,n.localize)("minimapGutterDeletedBackground","Minimap gutter background color for lines that are deleted.")),e.overviewRulerModifiedForeground=(0,a.registerColor)("editorOverviewRuler.modifiedForeground",{dark:(0,a.transparent)(e.editorGutterModifiedBackground,.6),light:(0,a.transparent)(e.editorGutterModifiedBackground,.6),hcDark:(0,a.transparent)(e.editorGutterModifiedBackground,.6),hcLight:(0,a.transparent)(e.editorGutterModifiedBackground,.6)},(0,n.localize)("overviewRulerModifiedForeground","Overview ruler marker color for modified content.")),e.overviewRulerAddedForeground=(0,a.registerColor)("editorOverviewRuler.addedForeground",{dark:(0,a.transparent)(e.editorGutterAddedBackground,.6),light:(0,a.transparent)(e.editorGutterAddedBackground,.6),hcDark:(0,a.transparent)(e.editorGutterAddedBackground,.6),hcLight:(0,a.transparent)(e.editorGutterAddedBackground,.6)},(0,n.localize)("overviewRulerAddedForeground","Overview ruler marker color for added content.")),e.overviewRulerDeletedForeground=(0,a.registerColor)("editorOverviewRuler.deletedForeground",{dark:(0,a.transparent)(e.editorGutterDeletedBackground,.6),light:(0,a.transparent)(e.editorGutterDeletedBackground,.6),hcDark:(0,a.transparent)(e.editorGutterDeletedBackground,.6),hcLight:(0,a.transparent)(e.editorGutterDeletedBackground,.6)},(0,n.localize)("overviewRulerDeletedForeground","Overview ruler marker color for deleted content."))},38672:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMMenus=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(93899),g=t(43718),u=t(64964),G=t(36367);let p=class extends g.Disposable{constructor(r){super(),this.contextKeyService=r}get resourceGroupMenu(){return this._resourceGroupMenu||(this._resourceGroupMenu=this.registerDispose(this.menuService.createMenu({id:I.MenuId.SCMResourceGroupContext,contextKeyService:this.contextKeyService,config:{separator:"inline"}}))),this._resourceGroupMenu}get resourceFolderMenu(){return this._resourceFolderMenu||(this._resourceFolderMenu=this.registerDispose(this.menuService.createMenu({id:I.MenuId.SCMResourceFolderContext,contextKeyService:this.contextKeyService,config:{separator:"inline"}}))),this._resourceFolderMenu}getResourceMenu(r){const l=r.contextValue;if(typeof l>"u")return this.resourceMenu||(this.resourceMenu=this.registerDispose(this.menuService.createMenu({id:I.MenuId.SCMResourceContext,contextKeyService:this.contextKeyService,config:{separator:"inline"}}))),this.resourceMenu;this.contextualResourceMenu||(this.contextualResourceMenu=new Map);let s=this.contextualResourceMenu.get(l);if(!s){const c=this.contextKeyService.createScoped();(0,G.isSCMResource)(r)&&c.createKey("scmResourceState",l),s=this.registerDispose(this.menuService.createMenu({id:I.MenuId.SCMResourceContext,contextKeyService:c,config:{separator:"inline"}})),this.addDispose(c),this.contextualResourceMenu.set(l,s)}return s}dispose(){var r,l;super.dispose(),(r=this.resourceGroupMenu)===null||r===void 0||r.dispose(),(l=this.resourceMenu)===null||l===void 0||l.dispose(),this.contextualResourceMenu&&(this.contextualResourceMenu.clear(),this.contextualResourceMenu=void 0)}};n.__decorate([(0,a.Autowired)(I.AbstractContextMenuService),n.__metadata("design:type",I.AbstractContextMenuService)],p.prototype,"menuService",void 0),p=n.__decorate([(0,a.Injectable)({multiple:!0}),n.__param(0,(0,a.Optional)()),n.__metadata("design:paramtypes",[Object])],p);let b=class extends g.Disposable{constructor(r){var l;super(),this.resourceGroups=[],this.resourceGroupMenusItems=new Map;const s=this.injector.get(o.IContextKeyService);this.scopedContextKeyService=this.registerDispose(s.createScoped()),this.scopedContextKeyService.createKey("scmProvider",r.contextValue),this.scopedContextKeyService.createKey("scmProviderRootUri",(l=r.rootUri)===null||l===void 0?void 0:l.toString()),this.scopedContextKeyService.createKey("scmProviderHasRootUri",!!r.rootUri),this.onDidSpliceGroups({start:0,deleteCount:0,toInsert:r.groups.elements}),r.groups.onDidSplice(this.onDidSpliceGroups,this,this.disposables)}onDidSpliceGroups({start:r,deleteCount:l,toInsert:s}){const c=this.resourceGroups.splice(r,l,...s);for(const h of c){const v=this.resourceGroupMenusItems.get(h);v?.dispose(),this.resourceGroupMenusItems.delete(h)}}dispose(){super.dispose(),this.resourceGroupMenusItems.forEach(r=>r.dispose())}getResourceGroupMenu(r){return this.getResourceGroupMenus(r).resourceGroupMenu}getResourceMenu(r){return this.getResourceGroupMenus(r.resourceGroup).getResourceMenu(r)}getResourceFolderMenu(r){return this.getResourceGroupMenus(r).resourceFolderMenu}getResourceGroupMenus(r){let l=this.resourceGroupMenusItems.get(r);if(!l){const s=this.registerDispose(this.scopedContextKeyService.createScoped());s.createKey("scmResourceGroup",r.id),l=this.registerDispose(this.injector.get(p,[s])),this.resourceGroupMenusItems.set(r,l)}return l}get titleMenu(){return this._titleMenu||(this._titleMenu=this.registerDispose(this.menuService.createMenu({id:I.MenuId.SCMTitle,contextKeyService:this.scopedContextKeyService}))),this._titleMenu}get inputMenu(){return this._inputMenu||(this._inputMenu=this.registerDispose(this.menuService.createMenu({id:I.MenuId.SCMInput,contextKeyService:this.scopedContextKeyService}))),this._inputMenu}};n.__decorate([(0,a.Autowired)(I.AbstractContextMenuService),n.__metadata("design:type",I.AbstractContextMenuService)],b.prototype,"menuService",void 0),n.__decorate([(0,a.Autowired)(a.INJECTOR_TOKEN),n.__metadata("design:type",a.Injector)],b.prototype,"injector",void 0),b=n.__decorate([(0,a.Injectable)({multiple:!0}),n.__param(0,(0,a.Optional)()),n.__metadata("design:paramtypes",[Object])],b);let m=class extends g.Disposable{constructor(){super(),this.menus=new Map,this.scmService.onDidRemoveRepository(this.onDidRemoveRepository,this,this.disposables)}onDidRemoveRepository(r){const l=this.menus.get(r.provider);l?.dispose(),this.menus.delete(r.provider)}getRepositoryMenus(r){let l=this.menus.get(r);if(!l){const s=this.injector.get(b,[r]);l={menus:s,dispose:()=>{s.dispose(),this.menus.delete(r)}},this.menus.set(r,l)}return l.menus}};n.__decorate([(0,a.Autowired)(a.INJECTOR_TOKEN),n.__metadata("design:type",a.Injector)],m.prototype,"injector",void 0),n.__decorate([(0,a.Autowired)(u.SCMService),n.__metadata("design:type",u.SCMService)],m.prototype,"scmService",void 0),m=n.__decorate([(0,a.Injectable)(),n.__metadata("design:paramtypes",[])],m),e.SCMMenus=m},49914:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ViewModelContext=e.ResourceGroupSplicer=void 0;const n=t(85608),a=t(83794),o=t(76003),I=t(41869),g=t(43718),u=t(64964);class G{constructor(d){this.repository=d,this.items=[],this.disposables=[],this._onDidSplice=new g.Emitter,this.onDidSplice=this._onDidSplice.event}run(){const d=this.repository.provider.groups;d.onDidSplice(this.onDidSpliceGroups,this,this.disposables),this.onDidSpliceGroups({start:0,deleteCount:0,toInsert:d.elements})}onDidSpliceGroups({start:d,deleteCount:r,toInsert:l}){let s=0;for(let W=0;W<d;W++){const N=this.items[W];s+=(N.visible?1:0)+N.group.elements.length}let c=0;for(let W=0;W<r;W++){const N=this.items[d+W];c+=(N.visible?1:0)+N.group.elements.length}const h=[],v=[];for(const W of l){const N=p(W);N&&v.push(W);for(const y of W.elements)v.push(y);const Z=(0,g.combinedDisposable)([W.onDidChange(()=>this.onDidChangeGroup(W)),W.onDidSplice(y=>this.onDidSpliceGroup(W,y))]);h.push({group:W,visible:N,disposable:Z})}const f=this.items.splice(d,r,...h);for(const W of f)W.disposable.dispose();this._onDidSplice.fire({target:this.repository,index:s,deleteCount:c,elements:v})}onDidChangeGroup(d){const r=this.items.findIndex(h=>h.group===d);if(r<0)return;const l=this.items[r],s=p(d);if(l.visible===s)return;let c=0;for(let h=0;h<r;h++){const v=this.items[h];c+=(v.visible?1:0)+v.group.elements.length}s?this._onDidSplice.fire({target:this.repository,index:c,deleteCount:0,elements:[d,...d.elements]}):this._onDidSplice.fire({target:this.repository,index:c,deleteCount:1+d.elements.length,elements:[]}),l.visible=s}onDidSpliceGroup(d,{start:r,deleteCount:l,toInsert:s}){const c=this.items.findIndex(W=>W.group===d);if(c<0)return;const h=this.items[c],v=p(d);if(!h.visible&&!v)return;let f=r;for(let W=0;W<c;W++){const N=this.items[W];f+=(N.visible?1:0)+N.group.elements.length}h.visible&&!v?this._onDidSplice.fire({target:this.repository,index:f,deleteCount:1+l,elements:s}):!h.visible&&v?this._onDidSplice.fire({target:this.repository,index:f,deleteCount:l,elements:[d,...s]}):this._onDidSplice.fire({target:this.repository,index:f+1,deleteCount:l,elements:s}),h.visible=v}dispose(){this.onDidSpliceGroups({start:0,deleteCount:this.items.length,toInsert:[]}),this.disposables=(0,g.dispose)(this.disposables)}}e.ResourceGroupSplicer=G;function p(m){return m.elements.length>0||!m.hideWhenEmpty}let b=class extends g.Disposable{get onDidSelectedRepoChange(){return this.onDidSelectedRepoChangeEmitter.event}get onAlwaysShowActionsChange(){return this.onAlwaysShowActionsChangeEmitter.event}get menus(){return this._menus}constructor(){super(),this.onDidSelectedRepoChangeEmitter=new g.Emitter,this.onAlwaysShowActionsChangeEmitter=new g.Emitter,this.onDidSCMListChangeEmitter=new g.Emitter,this.onDidSCMListChange=this.onDidSCMListChangeEmitter.event,this.onDidSCMRepoListChangeEmitter=new g.Emitter,this.onDidSCMRepoListChange=this.onDidSCMRepoListChangeEmitter.event,this.repoList=[],this.scmList=new Array,this.selectedRepos=a.observable.array([]),this.spliceSCMList=(d,r,l,...s)=>{!this._currentWorkspace||this._currentWorkspace.toString()===d.toString()?this.scmList.splice(r,l,...s):this.scmList=[...s],this._currentWorkspace=d,this.onDidSCMListChangeEmitter.fire()},(0,a.makeObservable)(this),this.start(),this.initTreeAlwaysShowActions(),this.scmService.onDidChangeSelectedRepositories(this._handleSelectedRepoChanged,this,this.disposables),this._handleSelectedRepoChanged(this.scmService.selectedRepositories)}_handleSelectedRepoChanged(d){const[r]=d;r&&(this.toDisposableListener&&(this.toDisposableListener.dispose(),this.toDisposableListener=null),this.toDisposableListener=this.listenToCurrentRepo(r))}listenToCurrentRepo(d){const r=new g.DisposableStore,l=new G(d),s=g.Event.filter(l.onDidSplice,c=>c.target===d);return r.add(s(({index:c,deleteCount:h,elements:v})=>{if(v.some(f=>f.id==="merge")){const f=[],W={};v.forEach(N=>{Array.isArray(N.elements)&&N.elements.forEach(Z=>{f.push(Z.sourceUri),W[Z.sourceUri.toString()]=!0})}),this.commandService.executeCommand("setContext","git.mergeChanges",f),this.commandService.executeCommand("setContext","git.mergeChangesObj",W)}d.provider.rootUri&&this.spliceSCMList(d.provider.rootUri,c,h,...v)})),l.run(),r.add(l),(0,g.toDisposable)(()=>{r.clear()})}initTreeAlwaysShowActions(){this.alwaysShowActions=!!this.preferenceService.get("scm.alwaysShowActions"),this.disposables.push(this.preferenceService.onSpecificPreferenceChange("scm.alwaysShowActions",d=>{this.alwaysShowActions!==d.newValue&&this.updateAlwaysShowActions(d.newValue)}))}start(){this.scmService.onDidAddRepository(d=>{this.addRepo(d)},this,this.disposables),this.scmService.onDidRemoveRepository(d=>{this.deleteRepo(d)},this,this.disposables),this.scmService.onDidChangeSelectedRepositories(d=>{this.changeSelectedRepos(d)},this,this.disposables),this.scmService.repositories.forEach(d=>{this.addRepo(d)})}updateAlwaysShowActions(d){this.alwaysShowActions=d,this.onAlwaysShowActionsChangeEmitter.fire(d)}addRepo(d){if(this.repoList.find(r=>{var l,s;return((l=r.provider.rootUri)===null||l===void 0?void 0:l.toString())===((s=d.provider.rootUri)===null||s===void 0?void 0:s.toString())})){this.logger.warn("duplicate scm repo",d);return}this.repoList.push(d),d.selected&&this.repoList.length===1&&this.changeSelectedRepos([d]),this.onDidSCMRepoListChangeEmitter.fire(this.repoList)}deleteRepo(d){const r=this.repoList.indexOf(d);if(r<0){this.logger.warn("no such scm repo",d);return}this.repoList.splice(r,1),this.onDidSCMRepoListChangeEmitter.fire(this.repoList)}changeSelectedRepos(d){this.selectedRepos.replace(d);const r=d[0];this.selectedRepo=r,this.onDidSelectedRepoChangeEmitter.fire(r)}};n.__decorate([(0,o.Autowired)(u.SCMService),n.__metadata("design:type",u.SCMService)],b.prototype,"scmService",void 0),n.__decorate([(0,o.Autowired)(u.ISCMMenus),n.__metadata("design:type",Object)],b.prototype,"_menus",void 0),n.__decorate([(0,o.Autowired)(I.PreferenceService),n.__metadata("design:type",Object)],b.prototype,"preferenceService",void 0),n.__decorate([(0,o.Autowired)(g.CommandService),n.__metadata("design:type",Object)],b.prototype,"commandService",void 0),n.__decorate([(0,o.Autowired)(g.ILogger),n.__metadata("design:type",Object)],b.prototype,"logger",void 0),n.__decorate([a.observable,n.__metadata("design:type",Object)],b.prototype,"selectedRepos",void 0),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[Array]),n.__metadata("design:returntype",void 0)],b.prototype,"changeSelectedRepos",null),b=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],b),e.ViewModelContext=b},73018:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.bindSCMPreference=e.SCMPreferences=e.scmPreferenceSchema=void 0;const n=t(41869),a=t(64964);e.scmPreferenceSchema={id:"scm",order:5,title:(0,n.localize)("scmConfigurationTitle","SCM"),type:"object",properties:{"scm.alwaysShowProviders":{type:"boolean",description:(0,n.localize)("alwaysShowProviders","Controls whether to always show the Source Control Provider section."),default:!1},"scm.providers.visible":{type:"number",description:(0,n.localize)("providersVisible","Controls how many providers are visible in the Source Control Provider section. Set to `0` to be able to manually resize the view."),default:10},"scm.diffDecorations":{type:"string",enum:["all","gutter","overview","none"],default:"all",description:(0,n.localize)("diffDecorations","Controls diff decorations in the editor.")},"scm.alwaysShowDiffWidget":{type:"boolean",description:(0,n.localize)("alwaysShowDiffWidget","Controls whether to always click to show the Dirty Diff Widget."),default:!0},"scm.diffDecorationsGutterWidth":{type:"number",enum:[1,2,3,4,5],default:3,description:(0,n.localize)("diffGutterWidth","Controls the width(px) of diff decorations in gutter (added & modified).")},"scm.alwaysShowActions":{type:"boolean",description:(0,n.localize)("alwaysShowActions","Controls whether inline actions are always visible in the Source Control view."),default:!1},"scm.defaultViewMode":{type:"string",enum:[a.SCMViewModelMode.Tree,a.SCMViewModelMode.List],description:(0,n.localize)("scm.defaultViewMode","Controls the default Source Control repository view mode."),default:a.SCMViewModelMode.List},"scm.listView.compactFolders":{type:"boolean",description:(0,n.localize)("scmListViewCompactFolders","Controls whether the source control view should render folders in a compact form. In such a form, single child folders will be compressed in a combined tree element."),default:!0}}},e.SCMPreferences=Symbol("SCMPreferences");function o(I){I.addProviders({token:e.SCMPreferences,useFactory:g=>{const u=g.get(n.PreferenceService);return(0,n.createPreferenceProxy)(u,e.scmPreferenceSchema)}})}e.bindSCMPreference=o},36367:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getSCMRepositoryDesc=e.getSCMResourceGroupContextValue=e.isSCMResourceGroup=e.isSCMResource=void 0;const n=t(41869),{basename:a}=n.path;function o(G){return!!G.sourceUri&&I(G.resourceGroup)}e.isSCMResource=o;function I(G){return!!G.provider&&!!G.elements}e.isSCMResourceGroup=I;function g(G){return o(G)?G.resourceGroup.id:G.id}e.getSCMResourceGroupContextValue=g;function u(G){const p=G.provider.rootUri,b=p?a(G.provider.rootUri.path):G.provider.label,m=p?G.provider.label:"";return{title:b,type:m}}e.getSCMRepositoryDesc=u},94556:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMViewContainer=e.SCMProvidersView=e.SCMResourcesViewWrapper=e.SCMResourcesView=void 0;const n=t(85608),a=t(25150),o=n.__importStar(t(14041)),I=t(41869),g=t(25918),u=t(1149),G=t(93899),p=t(43718),b=t(70936),m=t(91527),d=t(24429),r=t(64964),l=t(57492),s=t(37751),c=t(24748),h=t(49914),v=t(36367),f=n.__importDefault(t(41373)),W=38,N=38,Z=10;e.SCMResourcesView=(0,a.observer)(({repository:E,viewState:R})=>{const A=(0,I.useInjectable)(I.IContextKeyService),w=(0,I.useInjectable)(G.IMenuRegistry),F=(0,I.useInjectable)(h.ViewModelContext),V=(0,o.useRef)(null),Y=(0,o.useRef)(),_=(0,o.useRef)({}),[H,S]=(0,o.useState)();(0,o.useEffect)(()=>{V&&V.current&&(_.current.ctx=A.createScoped(V.current))},[]),(0,o.useEffect)(()=>{_.current.ctx&&_.current.ctx.createKey("scmRepository",E),X();const M=E.provider.onDidChange(()=>{X()});return()=>{M.dispose()}},[E]);const X=(0,o.useCallback)(()=>{var M;if((M=Y.current)===null||M===void 0||M.dispose(),Y.current=new p.DisposableCollection,!!E.provider.actionButton){if(Y.current.push(w.registerMenuItem(G.MenuId.SCMInput,{command:{id:E.provider.actionButton.command.id,label:E.provider.actionButton.command.title},extraTailArgs:E.provider.actionButton.command.arguments,group:"navigation",type:"primary",enabledWhen:E.provider.actionButton.enabled?"true":"false"})),Array.isArray(E.provider.actionButton.secondaryCommands))for(let T=0;T<E.provider.actionButton.secondaryCommands.length;T++)for(const x of E.provider.actionButton.secondaryCommands[T])Y.current.push(w.registerMenuItem(G.MenuId.SCMInput,{command:{id:x.id,label:x.title},extraTailArgs:x.arguments,group:`${T}_secondary`,enabledWhen:E.provider.actionButton.enabled?"true":"false"}));Q()}},[E,Y.current]),Q=(0,o.useCallback)(()=>{const M=F.menus.getRepositoryMenus(E.provider);M&&S(M.inputMenu)},[E,H]),O=E&&E.provider&&H;return o.default.createElement("div",{className:f.default.view,ref:V},o.default.createElement("div",{className:f.default.scm,style:{paddingTop:Z}},o.default.createElement(s.SCMResourceInput,{repository:E,menus:H}),o.default.createElement(c.SCMResourceTree,{height:R.height-W-Z-(O?N:0)})))}),e.SCMResourcesView.displayName="SCMResourcesView",e.SCMResourcesViewWrapper=(0,a.observer)(E=>{const R=(0,I.useInjectable)(h.ViewModelContext);if(!R.selectedRepos.length)return o.default.createElement(d.WelcomeView,{viewId:r.SCM_WELCOME_ID});const A=R.selectedRepos[0];return!A||!A.provider?null:o.default.createElement(e.SCMResourcesView,{repository:A,viewState:E.viewState})}),e.SCMResourcesViewWrapper.displayName="SCMResourcesViewWrapper",e.SCMProvidersView=(0,o.memo)(({viewState:E,repoList:R,selectedRepo:A})=>o.default.createElement("div",{className:f.default.view},R.length>1&&o.default.createElement(l.SCMProviderList,{viewState:E,repositoryList:R,selectedRepository:A}))),e.SCMProvidersView.displayName="SCMProvidersView";const y=E=>{const R=(0,I.useInjectable)(h.ViewModelContext),A=(0,I.useInjectable)(I.AppConfig),w=R.selectedRepo,F=(0,I.useInjectable)(u.LayoutViewSizeConfig),[V,Y]=(0,o.useState)([]),_=(0,o.useCallback)(()=>{Y([...R.repoList])},[V,R]);(0,o.useEffect)(()=>{const M=new p.DisposableCollection;return M.push(R.onDidSCMListChange(_)),M.push(R.onDidSCMRepoListChange(_)),()=>{M.dispose()}},[R]);const H=V.length>1,S=(0,o.useMemo)(()=>V.length===1&&w?`${(0,p.localize)("scm.title")}: ${w.provider.label}`:(0,p.localize)("scm.title"),[V,w]),X=(0,o.useMemo)(()=>{let M=(0,p.localize)("scm.title");if(H&&w){const{title:T,type:x}=(0,v.getSCMRepositoryDesc)(w);M=T+"-"+x}return M},[H,w]),Q=(0,o.useMemo)(()=>{if(w)return R.menus.getRepositoryMenus(w?.provider).titleMenu},[w]),O=(0,o.useMemo)(()=>{const M={component:e.SCMProvidersView,id:r.scmProviderViewId,name:(0,p.localize)("scm.provider.title"),initialProps:{viewState:E.viewState,repoList:V,selectedRepo:w},priority:0},T={component:e.SCMResourcesViewWrapper,id:r.scmResourceViewId,name:X,titleMenu:H&&Q||void 0,titleMenuContext:w&&w.provider&&[w.provider],priority:1};return(H?[M]:[]).concat(T)},[H,X,w,V]);return o.default.createElement("div",{className:f.default.view},o.default.createElement(m.TitleBar,{title:S,height:F.panelTitleBarHeight,menubar:!H&&Q?o.default.createElement(g.InlineMenuBar,{menus:Q,context:w&&w.provider&&[w.provider],moreTitle:(0,p.localize)("scm.action.git.more","More Actions")}):null}),o.default.createElement(b.AccordionContainer,{views:O,containerId:r.scmContainerId,style:{height:`calc(100% - ${F.panelTitleBarHeight}px)`}}))};e.SCMViewContainer=y,e.SCMViewContainer.displayName="SCMViewContainer"},75756:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMContribution=e.SCM_ACCEPT_INPUT=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(21634),g=t(68456),u=t(93899),G=t(43718),p=t(98295),b=t(23418),m=t(63067),d=t(64964),r=t(38563),l=t(63451),s=t(71972),c=t(7114),h=t(73018),v=t(94556);e.SCM_ACCEPT_INPUT={id:"scm.acceptInput"};let f=class{constructor(){this.toDispose=new o.Disposable,this.schema=h.scmPreferenceSchema,this.diffChangesIndex=new Map}onStart(){this.viewsRegistry.registerViewWelcomeContent(d.scmResourceViewId,{content:(0,G.localize)("welcome-view.noOpenRepo","No source control providers registered."),when:"default"}),this.extensionsPointService.appendExtensionPoint(["browserViews","properties"],{extensionPoint:d.scmContainerId,frameworkKind:["opensumi"],jsonSchema:Object.assign(Object.assign({},I.browserViews.properties),{description:(0,G.formatLocalize)("sumiContributes.browserViews.location.custom",(0,G.localize)("status-bar.scm"))})})}onDidRender(){[this.statusUpdater,this.statusBarController,this.dirtyDiffWorkbenchController].forEach(N=>{N.start(),this.toDispose.addDispose(N)})}onStop(){this.toDispose.dispose()}registerCommands(N){N.registerCommand(d.OPEN_DIRTY_DIFF_WIDGET,{execute:async Z=>{const y=this.editorService.currentEditor;if(y){const E=y.monacoEditor;this.dirtyDiffWorkbenchController.toggleDirtyDiffWidget(E,{lineNumber:Z,column:1}),setTimeout(()=>{E.revealLineInCenter(Z)},0)}}}),N.registerCommand(d.CLOSE_DIRTY_DIFF_WIDGET,{execute:async()=>{const Z=this.editorService.currentEditor;if(Z){const y=Z.monacoEditor;this.dirtyDiffWorkbenchController.closeDirtyDiffWidget(y)}}}),N.registerCommand(d.GOTO_PREVIOUS_CHANGE,{execute:()=>{var Z;const y=this.editorService.currentEditor;if(y&&y.currentUri){const E=this.getDiffChangeLineNumber(y.currentUri,y,"previous");y.monacoEditor.focus();const R=(Z=y.monacoEditor.getPosition())===null||Z===void 0?void 0:Z.with(E,0);y.monacoEditor.setPosition(R),y.monacoEditor.revealLineInCenter(E)}}}),N.registerCommand(d.GOTO_NEXT_CHANGE,{execute:()=>{var Z;const y=this.editorService.currentEditor;if(y&&y.currentUri){const E=this.getDiffChangeLineNumber(y.currentUri,y,"next");y.monacoEditor.focus();const R=(Z=y.monacoEditor.getPosition())===null||Z===void 0?void 0:Z.with(E,0);y.monacoEditor.setPosition(R),y.monacoEditor.revealLineInCenter(E)}}}),N.registerCommand(d.TOGGLE_DIFF_SIDE_BY_SIDE,{execute:()=>{const Z=!this.preferenceService.get("diffEditor.renderSideBySide");this.preferenceService.set("diffEditor.renderSideBySide",Z,G.PreferenceScope.User)}}),N.registerCommand(d.SET_SCM_TREE_VIEW_MODE,{execute:()=>{this.scmTreeService.changeTreeMode(!0)}}),N.registerCommand(d.SET_SCM_LIST_VIEW_MODE,{execute:()=>{this.scmTreeService.changeTreeMode(!1)}}),N.registerCommand(o.SCM_COMMANDS.GetSCMResource,{execute:async Z=>this.scmTreeAPI.getSCMResource(Z)})}registerComponent(N){N.register("@opensumi/ide-scm",[],{iconClass:(0,o.getIcon)("scm"),title:(0,G.localize)("scm.title"),priority:8,containerId:d.scmContainerId,component:v.SCMViewContainer,activateKeyBinding:"ctrlcmd+shift+g"})}registerMenus(N){N.registerMenuItem(u.MenuId.EditorTitle,{command:{id:d.GOTO_PREVIOUS_CHANGE.id,label:(0,G.localize)("scm.diff.change.previous")},when:"isInDiffEditor",iconClass:(0,o.getIcon)("arrowup"),group:"navigation"}),N.registerMenuItem(u.MenuId.EditorTitle,{command:{id:d.GOTO_NEXT_CHANGE.id,label:(0,G.localize)("scm.diff.change.next")},iconClass:(0,o.getIcon)("arrowdown"),when:"isInDiffEditor",group:"navigation"}),N.registerMenuItem(u.MenuId.EditorTitle,{command:{id:d.TOGGLE_DIFF_SIDE_BY_SIDE.id,label:(0,G.localize)("scm.diff.toggle.renderSideBySide")},when:"isInDiffEditor",group:"1_internal"}),N.registerMenuItem(u.MenuId.SCMTitle,{command:{id:d.SET_SCM_TREE_VIEW_MODE.id,label:(0,G.localize)("setTreeViewMode","View as Tree")},iconClass:(0,o.getExternalIcon)("list-tree"),when:`config.scm.defaultViewMode == ${d.SCMViewModelMode.List}`,group:"navigation",order:-1}),N.registerMenuItem(u.MenuId.SCMTitle,{command:{id:d.SET_SCM_LIST_VIEW_MODE.id,label:(0,G.localize)("setListViewMode","View as List")},iconClass:(0,o.getExternalIcon)("list-flat"),when:`config.scm.defaultViewMode == ${d.SCMViewModelMode.Tree}`,group:"navigation",order:-1})}getDiffChangesIndex(N,Z){return this.diffChangesIndex.has(N)||(Z.onDispose(()=>{this.diffChangesIndex.delete(N)}),this.diffChangesIndex.set(N,0)),this.diffChangesIndex.get(N)}getDiffEditor(N){const Z=N.getId(),[y]=this.editorCollectionService.listDiffEditors().filter(E=>E.modifiedEditor.getId()===Z||E.originalEditor.getId()===Z);return y}getDiffChangeLineNumber(N,Z,y){const E=this.getDiffChangesIndex(N,Z),A=this.getDiffEditor(Z).getLineChanges()||[];if(!A||A.length===0)return 0;let w=0;return y==="previous"?w=E-1<0?A.length-1:E-1:w=E>=A.length-1?0:E+1,this.diffChangesIndex.set(N,w),A[w][2]}};n.__decorate([(0,a.Autowired)(c.SCMBadgeController),n.__metadata("design:type",c.SCMBadgeController)],f.prototype,"statusUpdater",void 0),n.__decorate([(0,a.Autowired)(c.SCMStatusBarController),n.__metadata("design:type",c.SCMStatusBarController)],f.prototype,"statusBarController",void 0),n.__decorate([(0,a.Autowired)(b.WorkbenchEditorService),n.__metadata("design:type",b.WorkbenchEditorService)],f.prototype,"editorService",void 0),n.__decorate([(0,a.Autowired)(d.IDirtyDiffWorkbenchController),n.__metadata("design:type",s.DirtyDiffWorkbenchController)],f.prototype,"dirtyDiffWorkbenchController",void 0),n.__decorate([(0,a.Autowired)(b.EditorCollectionService),n.__metadata("design:type",b.EditorCollectionService)],f.prototype,"editorCollectionService",void 0),n.__decorate([(0,a.Autowired)(m.IMainLayoutService),n.__metadata("design:type",Object)],f.prototype,"mainlayoutService",void 0),n.__decorate([(0,a.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],f.prototype,"preferenceService",void 0),n.__decorate([(0,a.Autowired)(),n.__metadata("design:type",l.SCMTreeService)],f.prototype,"scmTreeService",void 0),n.__decorate([(0,a.Autowired)(),n.__metadata("design:type",r.SCMTreeAPI)],f.prototype,"scmTreeAPI",void 0),n.__decorate([(0,a.Autowired)(m.IViewsRegistry),n.__metadata("design:type",Object)],f.prototype,"viewsRegistry",void 0),n.__decorate([(0,a.Autowired)(G.IExtensionsSchemaService),n.__metadata("design:type",Object)],f.prototype,"extensionsPointService",void 0),f=n.__decorate([(0,p.Domain)(o.ClientAppContribution,G.CommandContribution,g.ComponentContribution,o.PreferenceContribution,m.MainLayoutContribution,u.MenuContribution)],f),e.SCMContribution=f},49814:(L,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GOTO_PREVIOUS_CHANGE=e.GOTO_NEXT_CHANGE=e.CLOSE_DIRTY_DIFF_WIDGET=e.OPEN_DIRTY_DIFF_WIDGET=e.IDirtyDiffWorkbenchController=void 0,e.IDirtyDiffWorkbenchController=Symbol("DirtyDiffWorkbenchController"),e.OPEN_DIRTY_DIFF_WIDGET={id:"OPEN_DIRTY_DIFF_WIDGET"},e.CLOSE_DIRTY_DIFF_WIDGET={id:"CLOSE_DIRTY_DIFF_WIDGET"},e.GOTO_NEXT_CHANGE={id:"workbench.action.compareEditor.nextChange"},e.GOTO_PREVIOUS_CHANGE={id:"workbench.action.compareEditor.previousChange"}},64964:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ViewModelSortKey=e.SCMViewModelMode=e.SET_SCM_LIST_VIEW_MODE=e.SET_SCM_TREE_VIEW_MODE=e.TOGGLE_DIFF_SIDE_BY_SIDE=e.scmItemLineHeight=e.SCM_WELCOME_ID=e.scmResourceViewId=e.scmProviderViewId=e.scmContainerId=void 0;const n=t(85608),a=t(30144);e.scmContainerId=a.SCM_CONTAINER_ID,e.scmProviderViewId="scm_provider",e.scmResourceViewId="scm_view",e.SCM_WELCOME_ID="scm-welcome",e.scmItemLineHeight=22,e.TOGGLE_DIFF_SIDE_BY_SIDE={id:"toggle.diff.renderSideBySide"},e.SET_SCM_TREE_VIEW_MODE={id:"workbench.scm.action.setTreeViewMode"},e.SET_SCM_LIST_VIEW_MODE={id:"workbench.scm.action.setListViewMode"};var o;(function(g){g.List="list",g.Tree="tree"})(o=e.SCMViewModelMode||(e.SCMViewModelMode={}));var I;(function(g){g.Path="path",g.Name="name",g.Status="status"})(I=e.ViewModelSortKey||(e.ViewModelSortKey={})),n.__exportStar(t(49697),e),n.__exportStar(t(66224),e),n.__exportStar(t(95588),e),n.__exportStar(t(49814),e),n.__exportStar(t(480),e)},480:(L,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},95588:(L,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ISCMMenus=void 0,e.ISCMMenus=Symbol("ISCMMenus")},49697:(L,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ISCMService=void 0;class t{}e.ISCMService=t},66224:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMService=void 0;const n=t(85608),a=t(83794),o=t(76003),I=t(43718),{equals:g}=I.arrays;class u{constructor(){this._value="",this._onDidChange=new I.Emitter,this.onDidChange=this._onDidChange.event,this._placeholder="",this._onDidChangePlaceholder=new I.Emitter,this.onDidChangePlaceholder=this._onDidChangePlaceholder.event,this._visible=!0,this._props={},this._onDidChangeProps=new I.Emitter,this.onDidChangeProps=this._onDidChangeProps.event,this._onDidChangeVisibility=new I.Emitter,this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._enabled=!0,this._onDidChangeEnablement=new I.Emitter,this.onDidChangeEnablement=this._onDidChangeEnablement.event,this._validateInput=()=>Promise.resolve(void 0),this._onDidChangeValidateInput=new I.Emitter,this.onDidChangeValidateInput=this._onDidChangeValidateInput.event,this._onDidChangeActionButton=new I.Emitter,this.onDidChangeActionButton=this._onDidChangeActionButton.event}get value(){return this._value}set value(m){this._value=m,this._onDidChange.fire(m)}get placeholder(){return this._placeholder}set placeholder(m){this._placeholder=m,this._onDidChangePlaceholder.fire(m)}get visible(){return this._visible}set visible(m){this._visible=m,this._onDidChangeVisibility.fire(m)}get props(){return this._props}set props(m){this._props=m,this._onDidChangeProps.fire(this._props)}appendProps(m){this._props=Object.assign(Object.assign({},this._props),m),this._onDidChangeProps.fire(this._props)}get enabled(){return this._enabled}set enabled(m){this._enabled=m,this._onDidChangeEnablement.fire(m)}get validateInput(){return this._validateInput}set validateInput(m){this._validateInput=m,this._onDidChangeValidateInput.fire()}get actionButton(){return this._actionButton}set actionButton(m){this._actionButton=m,this._onDidChangeActionButton.fire()}}class G{get selected(){return this._selected}constructor(m,d){this.provider=m,this.disposable=d,this._onDidFocus=new I.Emitter,this.onDidFocus=this._onDidFocus.event,this._selected=!1,this._onDidChangeSelection=new I.Emitter,this.onDidChangeSelection=this._onDidChangeSelection.event,this.input=new u,(0,a.makeObservable)(this)}focus(){this._onDidFocus.fire()}setSelected(m){this._selected=m,this._onDidChangeSelection.fire(this)}dispose(){this.disposable.dispose(),this.provider.dispose()}}n.__decorate([a.observable,n.__metadata("design:type",Object)],G.prototype,"_selected",void 0),n.__decorate([a.computed,n.__metadata("design:type",Boolean),n.__metadata("design:paramtypes",[])],G.prototype,"selected",null),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[Boolean]),n.__metadata("design:returntype",void 0)],G.prototype,"setSelected",null);let p=class{constructor(){this._selectedRepositories=[],this._providerIds=new Set,this._repositories=[],this._onDidChangeSelectedRepositories=new I.Emitter,this.onDidChangeSelectedRepositories=this._onDidChangeSelectedRepositories.event,this._onDidAddProvider=new I.Emitter,this.onDidAddRepository=this._onDidAddProvider.event,this._onDidRemoveProvider=new I.Emitter,this.onDidRemoveRepository=this._onDidRemoveProvider.event,this.logger=(0,I.getDebugLogger)()}get selectedRepositories(){return[...this._selectedRepositories]}get repositories(){return[...this._repositories]}registerSCMProvider(m){if(this.logger.log("SCMService#registerSCMProvider"),this._providerIds.has(m.id))throw new Error(`SCM Provider ${m.id} already exists.`);this._providerIds.add(m.id);const d=(0,I.toDisposable)(()=>{const s=this._repositories.indexOf(r);s<0||(l.dispose(),this._providerIds.delete(m.id),this._repositories.splice(s,1),this._onDidRemoveProvider.fire(r),r.selected&&this._repositories.length>0&&this._repositories[0].setSelected(!0))}),r=new G(m,d),l=I.Event.filter(r.onDidChangeSelection,s=>s.selected)(this.onDidChangeSelection,this);return this._repositories.push(r),this._onDidAddProvider.fire(r),this._repositories.length===1&&r.setSelected(!0),r}setInputProps(m){this._repositories.forEach(d=>{d.input.props=m})}appendInputProps(m){this._repositories.forEach(d=>{d.input.appendProps(m)})}onDidChangeSelection(m){g(this._selectedRepositories,[m])||(this._repositories.filter(d=>d!==m).forEach(d=>{d.setSelected(!1)}),this._selectedRepositories=this._repositories.filter(d=>d.selected),this._onDidChangeSelectedRepositories.fire(this.selectedRepositories))}};p=n.__decorate([(0,o.Injectable)()],p),e.SCMService=p},61656:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),t(85608).__exportStar(t(64964),e)},6556:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SearchModule=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(52925),g=t(50845),u=t(33301),G=t(86952),p=t(51495),b=t(5439);let m=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:g.SearchContextKey,useClass:g.SearchContextKey},{token:I.IContentSearchClientService,useClass:p.ContentSearchClientService},{token:I.ISearchTreeService,useClass:b.SearchTreeService},G.SearchContribution],this.backServices=[{servicePath:I.ContentSearchServerPath,clientToken:I.IContentSearchClientService}],this.preferences=u.bindSearchPreference}};m=n.__decorate([(0,a.Injectable)()],m),e.SearchModule=m},3956:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.replace=e.getSelection=e.replaceAll=void 0;const n=t(85608),a=t(41869),o=t(43718),I=n.__importStar(t(20868));async function g(p,b,m,d,r,l,s,c,h){if(m.size<1)return!1;const v=Object.assign({},h);if(s&&v){const f={[(0,a.localize)("search.replace.buttonCancel")]:!1,[(0,a.localize)("search.replace.buttonOK")]:!0},W=await s.open((0,o.formatLocalize)("search.removeAll.occurrences.files.confirmation.message",String(v.resultNum),String(v.fileNum),d),o.MessageType.Warning,Object.keys(f));if(!f[W])return f[W]}for(const f of m){const W=f[1];await G(p,b,W,d,r,l)}return c&&v&&c.info((0,o.formatLocalize)("search.replaceAll.occurrencesMessage",String(v.resultNum),String(v.fileNum),d)),!0}e.replaceAll=g;function u(p){return[new I.Selection(p.line,p.matchStart,p.line,p.matchStart+p.matchLength)]}e.getSelection=u;async function G(p,b,m,d,r,l){var s;const c=m.map(v=>p.getModelReference(new o.URI(v.fileUri))).filter(v=>v?.instance&&!v.instance.dirty),h=[];for(const v of m){let f=d;if(l&&d){let W;try{W=new RegExp(r)}catch{continue}const N=(s=v.renderLineText)===null||s===void 0?void 0:s.slice(v.matchStart-1,v.matchStart+v.matchLength-1);N&&(f=N.replace(W,d))}h.push({options:{dirtyIfInEditor:!0},resource:new o.URI(v.fileUri),textEdit:{range:new I.Range(v.line,v.matchStart,v.line,v.matchStart+v.matchLength),text:f}})}await b.apply({edits:h}),c.forEach(v=>{v.instance.save()})}e.replace=G},50845:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SearchContextKey=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(67386);let g=class{initScopedContext(G){this._contextKeyService=this.globalContextkeyService.createScoped(G),this.searchViewFocusedKey=I.SearchViewFocusedKey.bind(this._contextKeyService),this.searchInputBoxFocusedKey=I.SearchInputBoxFocusedKey.bind(this._contextKeyService),this.hasSearchResults=I.HasSearchResults.bind(this._contextKeyService),this.searchViewVisibleKey=I.SearchViewVisibleKey.bind(this._contextKeyService)}get service(){return this._contextKeyService}};n.__decorate([(0,a.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],g.prototype,"globalContextkeyService",void 0),g=n.__decorate([(0,a.Injectable)()],g),e.SearchContextKey=g},96895:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SearchHistory=e.SEARCH_WORD_SCOPE=void 0;const n=t(41869);e.SEARCH_WORD_SCOPE="SEARCH_WORD";class a{constructor(I,g){this.searchHistoryList=[],this.currentIndex=-1,this.searchServiceClient=I,this.recentStorage=g}setRecentSearchWord(){this.currentIndex===-1&&(this.currentIndex=this.searchHistoryList.length),this.currentIndex=this.currentIndex-1;let I=this.searchHistoryList[this.currentIndex];if(this.currentIndex<0)return this.currentIndex=0,I=this.searchHistoryList[this.currentIndex],this.setSearchValue(I);if(I){if(this.searchServiceClient.searchValue===I)return this.setRecentSearchWord();this.setSearchValue(I)}}setBackRecentSearchWord(){this.currentIndex=this.currentIndex+1;let I=this.searchHistoryList[this.currentIndex];if(this.currentIndex>=this.searchHistoryList.length)return this.currentIndex=this.searchHistoryList.length-1,I=this.searchHistoryList[this.currentIndex],this.setSearchValue(I);if(I){if(this.searchServiceClient.searchValue===I)return this.setBackRecentSearchWord();this.setSearchValue(I)}}async initSearchHistory(){if(this.searchHistoryList.length>0)return;const I=await this.getMostRecentlySearchWord();this.searchHistoryList=this.searchHistoryList.concat(I||[])}async setSearchHistory(I){this.searchHistoryList.some(g=>g===I)||(this.searchHistoryList.push(I),await this.setMostRecentlySearchWord(I))}async getMostRecentlySearchWord(){return await(await this.recentStorage.getScopeStorage()).get(e.SEARCH_WORD_SCOPE)||[]}async setMostRecentlySearchWord(I){const g=await this.recentStorage.getScopeStorage();let u=[];const G=await this.getMostRecentlySearchWord()||[];(0,n.isArray)(I)?u=u.concat(I):u.push(I),u=G.concat(u),u=Array.from(new Set(u)),u=u.slice(u.length-10,u.length),g.set(e.SEARCH_WORD_SCOPE,u)}setSearchValue(I){this.searchServiceClient.searchValue=I,this.searchServiceClient.searchDebounce()}reset(){this.currentIndex=-1}}e.SearchHistory=a},33301:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.bindSearchPreference=e.createSearchPreferencesProvider=e.SearchPreferences=e.searchPreferenceSchema=void 0;const n=t(41869);e.searchPreferenceSchema={id:"search",order:5,title:(0,n.localize)("Search","\u641C\u7D22"),type:"object",properties:{"search.exclude":{type:"object",markdownDescription:"%preference.search.exclude%",default:{"**/node_modules":!0,"**/bower_components":!0,"**/.git":!0,"**/.svn":!0,"**/.hg":!0,"**/CVS":!0,"**/.DS_Store":!0,"**/Thumbs.db":!0}},"search.include":{type:"object",description:"%preference.search.include%",default:{}},"search.useReplacePreview":{type:"boolean",description:"%preference.search.useReplacePreview%",default:!0},"search.searchOnType":{type:"boolean",description:"%preference.search.searchOnType%",default:!0},"search.searchOnTypeDebouncePeriod":{type:"number",description:"%preference.search.searchOnTypeDebouncePeriod%",default:300}}},e.SearchPreferences=Symbol("SearchPreferences");const a=I=>({token:e.SearchPreferences,useFactory:()=>{const g=I.get(n.PreferenceService);return(0,n.createPreferenceProxy)(g,e.searchPreferenceSchema)}});e.createSearchPreferencesProvider=a;function o(I){I.addProviders((0,e.createSearchPreferencesProvider)(I))}e.bindSearchPreference=o},9767:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SearchResultCollection=void 0;const n=t(52925);class a{constructor(){this.list=[],this.maxLength=5}pushAndGetResultList(I){const{id:g,data:u,searchState:G}=I,p=[];if(G===n.SEARCH_STATE.error||G===n.SEARCH_STATE.done){const b=this.getTempResult();return b&&p.push(b),p.push(I),p}if(u.length<1)return p.push(I),p;if(this.list.length>0)if(g===this.list[0].id)this.pushTempResult(I);else{const b=this.getTempResult();b&&p.push(b),this.pushTempResult(I)}else this.pushTempResult(I);return this.list.length>=this.maxLength&&p.push(this.getTempResult()),p}getTempResult(){let I;return this.list.length<1||(this.list.forEach((g,u)=>{u!==0&&(this.list[0].data=this.list[0].data.concat(g.data))}),I=this.list[0],this.list=[]),I}pushTempResult(I){this.list.push(I)}}e.SearchResultCollection=a},86952:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SearchContribution=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(30144),g=t(67386),u=t(68456),G=t(93899),p=t(43718),b=t(98295),m=t(57517),d=t(63067),r=t(17793),l=t(72665),s=t(26199),c=t(52925),h=t(3956),v=t(33301),f=t(14851),W=t(5439),N=t(13072),Z=t(86109);let y=class{constructor(){this.schema=v.searchPreferenceSchema,this.toDispose=new p.DisposableCollection}registerCommands(R){R.registerCommand(o.SEARCH_COMMANDS.OPEN_SEARCH,{execute:A=>{const w=this.mainLayoutService.getTabbarHandler(I.SEARCH_CONTAINER_ID);if(w){if(w.activate(),A&&A.includeValue){this.searchBrowserService.includeValue=A.includeValue,this.searchBrowserService.updateUIState({isDetailOpen:!0}),this.searchBrowserService.search();return}this.searchBrowserService.searchEditorSelection(),this.searchBrowserService.focus(),this.searchBrowserService.search()}}}),R.registerCommand(o.SEARCH_COMMANDS.REFRESH,{execute:()=>{this.searchBrowserService.search()}}),R.registerCommand(o.SEARCH_COMMANDS.CLEAN,{execute:()=>{this.searchBrowserService.clean()}}),R.registerCommand(o.SEARCH_COMMANDS.GET_RECENT_SEARCH_WORD,{execute:A=>{this.searchBrowserService.setRecentSearchWord()}}),R.registerCommand(o.SEARCH_COMMANDS.GET_BACK_RECENT_SEARCH_WORD,{execute:()=>{this.searchBrowserService.setBackRecentSearchWord()}}),R.registerCommand(o.SEARCH_COMMANDS.MENU_REPLACE,{execute:async A=>{if(!Z.SearchFileNode.is(A)){const w=new Map;w.set(A.resource.toString(),[A.contentResult]),await(0,h.replaceAll)(this.documentModelManager,this.workspaceEditService,w,this.searchBrowserService.replaceValue,this.searchBrowserService.searchValue,this.searchBrowserService.UIState.isUseRegexp)}},isVisible:()=>!Z.SearchFileNode.is(this.searchModelService.contextMenuNode)}),R.registerCommand(o.SEARCH_COMMANDS.MENU_REPLACE_ALL,{execute:async A=>{if(!Z.SearchFileNode.is(A))return;const w=new Map;if(!A.children)return;const F=A.children.map(_=>_.contentResult),V={[(0,o.localize)("search.replace.buttonCancel")]:!1,[(0,o.localize)("search.replace.buttonOK")]:!0},Y=await this.dialogService.open((0,p.formatLocalize)("search.removeAll.occurrences.file.confirmation.message",String(F.length)),p.MessageType.Warning,Object.keys(V));if(Y&&!V[Y])return V[Y];w.set(A.resource.toString(),F),await(0,h.replaceAll)(this.documentModelManager,this.workspaceEditService,w,this.searchBrowserService.replaceValue,this.searchBrowserService.searchValue,this.searchBrowserService.UIState.isUseRegexp)},isVisible:()=>!Z.SearchFileNode.is(this.searchModelService.contextMenuNode)}),R.registerCommand(o.SEARCH_COMMANDS.MENU_HIDE,{execute:A=>{var w,F;Z.SearchFileNode.is(A)?(this.searchBrowserService.resultTotal.fileNum-=1,this.searchBrowserService.resultTotal.resultNum-=A.branchSize,this.searchModelService.treeModel.root.unlinkItem(A)):(this.searchBrowserService.resultTotal.resultNum-=1,((F=(w=A.parent)===null||w===void 0?void 0:w.children)===null||F===void 0?void 0:F.length)===1&&(this.searchBrowserService.resultTotal.fileNum-=1,this.searchModelService.treeModel.root.unlinkItem(A.parent)),A.parent.unlinkItem(A)),this.searchBrowserService.fireTitleChange()}}),R.registerCommand(o.SEARCH_COMMANDS.MENU_COPY,{execute:A=>{var w;if(Z.SearchFileNode.is(A)){let V=`${A.resource.codeUri.fsPath.toString()}
|
|
28192
|
+
}`)}return s}get onFocus(){return this._onFocus.event}focusInput(){this._onFocus.fire()}};d.EXTENSION_SETTINGS_PREFIX="@ext:",d.EXTENSION_SETTINGS_REGX=/^@ext:(\S+)(.+)?/,d.DEFAULT_CHANGE_DELAY=200,a.__decorate([(0,o.Autowired)(g.PreferenceService),a.__metadata("design:type",Object)],d.prototype,"preferenceService",void 0),a.__decorate([(0,o.Autowired)(g.PreferenceSchemaProvider),a.__metadata("design:type",g.PreferenceSchemaProvider)],d.prototype,"schemaProvider",void 0),a.__decorate([(0,o.Autowired)(g.PreferenceProviderProvider),a.__metadata("design:type",Function)],d.prototype,"providerProvider",void 0),a.__decorate([(0,o.Autowired)(u.IFileServiceClient),a.__metadata("design:type",Object)],d.prototype,"fileServiceClient",void 0),a.__decorate([(0,o.Autowired)(g.CommandService),a.__metadata("design:type",Object)],d.prototype,"commandService",void 0),d=n=a.__decorate([(0,o.Injectable)(),a.__metadata("design:paramtypes",[])],d),e.PreferenceSettingsService=d,e.defaultSettingGroup=[{id:G.PreferenceSettingId.General,title:"%settings.group.general%",iconClass:(0,g.getIcon)("setting")},{id:G.PreferenceSettingId.Terminal,title:"%settings.group.terminal%",iconClass:(0,g.getIcon)("terminal")},{id:G.PreferenceSettingId.Editor,title:"%settings.group.editor%",iconClass:(0,g.getIcon)("editor")},{id:G.PreferenceSettingId.View,title:"%settings.group.view%",iconClass:(0,g.getIcon)("detail")},{id:G.PreferenceSettingId.Feature,title:"%settings.group.feature%",iconClass:(0,g.getIcon)("file-text")}],e.defaultSettingSections={[G.PreferenceSettingId.General]:[{preferences:[{id:"general.theme",localized:"preference.general.theme"},{id:"general.icon",localized:"preference.general.icon"},{id:"general.productIconTheme",localized:"preference.general.productIconTheme"},{id:"general.language",localized:"preference.general.language",hiddenInScope:[g.PreferenceScope.Workspace]}]}],[G.PreferenceSettingId.Editor]:[{title:"Editor",preferences:[{id:"editor.previewMode"},{id:"editor.enablePreviewFromCodeNavigation"},{id:"editor.autoSave",localized:"preference.editor.autoSave"},{id:"editor.autoSaveDelay",localized:"preference.editor.autoSaveDelay"},{id:"workbench.refactoringChanges.showPreviewStrategy",localized:"preference.workbench.refactoringChanges.showPreviewStrategy.title"},{id:"editor.askIfDiff",localized:"preference.editor.askIfDiff"},{id:"editor.cursorStyle",localized:"preference.editor.cursorStyle"},{id:"editor.fontSize",localized:"preference.editor.fontSize"},{id:"editor.fontWeight",localized:"preference.editor.fontWeight"},{id:"editor.fontFamily",localized:"preference.editor.fontFamily"},{id:"editor.lineHeight",localized:"preference.editor.lineHeight"},{id:"editor.trimAutoWhitespace"},{id:"editor.quickSuggestionsDelay",localized:"preference.editor.quickSuggestionsDelay"},{id:"editor.suggestOnTriggerCharacters"},{id:"editor.acceptSuggestionOnEnter"},{id:"editor.acceptSuggestionOnCommitCharacter"},{id:"editor.snippetSuggestions"},{id:"editor.wordBasedSuggestions"},{id:"editor.suggestSelection"},{id:"editor.suggestFontSize"},{id:"editor.suggestLineHeight"},{id:"editor.tabCompletion"},{id:"editor.suggest.filteredTypes"},{id:"editor.suggest.insertMode"},{id:"editor.suggest.filterGraceful"},{id:"editor.suggest.localityBonus"},{id:"editor.suggest.shareSuggestSelections"},{id:"editor.suggest.snippetsPreventQuickSuggestions"},{id:"editor.suggest.showIcons"},{id:"editor.suggest.maxVisibleSuggestions"},{id:"editor.suggest.showMethods"},{id:"editor.suggest.showFunctions"},{id:"editor.suggest.showConstructors"},{id:"editor.suggest.showFields"},{id:"editor.suggest.showVariables"},{id:"editor.suggest.showClasses"},{id:"editor.suggest.showStructs"},{id:"editor.suggest.showInterfaces"},{id:"editor.suggest.showModules"},{id:"editor.suggest.showProperties"},{id:"editor.suggest.showEvents"},{id:"editor.suggest.showOperators"},{id:"editor.suggest.showUnits"},{id:"editor.suggest.showValues"},{id:"editor.suggest.showConstants"},{id:"editor.suggest.showEnums"},{id:"editor.suggest.showEnumMembers"},{id:"editor.suggest.showKeywords"},{id:"editor.suggest.showWords"},{id:"editor.suggest.showColors"},{id:"editor.suggest.showFiles"},{id:"editor.suggest.showReferences"},{id:"editor.suggest.showCustomcolors"},{id:"editor.suggest.showFolders"},{id:"editor.suggest.showTypeParameters"},{id:"editor.suggest.showSnippets"},{id:"editor.suggest.showUsers"},{id:"editor.suggest.showIssues"},{id:"editor.suggest.preview"},{id:"editor.suggest.details.visible"},{id:"editor.inlineSuggest.enabled",localized:"preference.editor.inlineSuggest.enabled"},{id:"editor.inlineSuggest.showToolbar"},{id:"editor.experimental.stickyScroll.enabled",localized:"preference.editor.experimental.stickyScroll.enabled"},{id:"editor.guides.bracketPairs",localized:"preference.editor.guides.bracketPairs"},{id:"editor.guides.indentation",localized:"preference.editor.guides.indentation"},{id:"editor.guides.highlightActiveIndentation",localized:"preference.editor.guides.highlightActiveIndentation"},{id:"editor.detectIndentation",localized:"preference.editor.detectIndentation"},{id:"editor.tabSize",localized:"preference.editor.tabSize"},{id:"editor.insertSpaces",localized:"preference.editor.insertSpace"},{id:"editor.wrapTab",localized:"preference.editor.wrapTab"},{id:"editor.wordWrap",localized:"preference.editor.wordWrap"},{id:"editor.renderLineHighlight",localized:"preference.editor.renderLineHighlight"},{id:"editor.renderWhitespace",localized:"preference.editor.renderWhitespace"},{id:"editor.minimap",localized:"preference.editor.minimap"},{id:"editor.preferredFormatter",localized:"preference.editor.preferredFormatter"},{id:"editor.formatOnSave",localized:"preference.editor.formatOnSave"},{id:"editor.formatOnSaveTimeout",localized:"preference.editor.formatOnSaveTimeout"},{id:"editor.formatOnPaste",localized:"preference.editor.formatOnPaste"},{id:"editor.codeActionsOnSave",localized:"preference.editor.saveCodeActions"},{id:"editor.codeActionsOnSaveNotification",localized:"preference.editor.saveCodeActionsNotification"},{id:"editor.gotoLocation.multiple"},{id:"editor.maxTokenizationLineLength",localized:"preference.editor.maxTokenizationLineLength"},{id:"editor.largeFile",localized:"preference.editor.largeFile"},{id:"editor.readonlyFiles",localized:"preference.editor.readonlyFiles"},{id:"editor.bracketPairColorization.enabled",localized:"preference.editor.bracketPairColorization.enabled"},{id:"workbench.editorAssociations"},{id:"editor.unicodeHighlight.ambiguousCharacters"}]},{title:"Diff Editor",preferences:[{id:"diffEditor.renderSideBySide",localized:"preference.diffEditor.renderSideBySide"},{id:"diffEditor.ignoreTrimWhitespace",localized:"preference.diffEditor.ignoreTrimWhitespace"}]},{title:"Merge Editor",preferences:[{id:"mergeEditor.autoApplyNonConflictChanges",localized:"preference.mergeEditor.autoApplyNonConflictChanges"}]},{title:"Files",preferences:[{id:"files.autoGuessEncoding",localized:"preference.files.autoGuessEncoding.title"},{id:"files.encoding",localized:"preference.files.encoding.title"},{id:"files.eol",localized:"preference.files.eol"},{id:"files.trimFinalNewlines",localized:"preference.files.trimFinalNewlines"},{id:"files.trimTrailingWhitespace",localized:"preference.files.trimTrailingWhitespace"},{id:"files.insertFinalNewline",localized:"preference.files.insertFinalNewline"},{id:"files.exclude",localized:"preference.files.exclude.title"},{id:"files.watcherExclude",localized:"preference.files.watcherExclude.title"},{id:"files.associations",localized:"preference.files.associations.title"}]}],[G.PreferenceSettingId.View]:[{title:"MenuBar",preferences:[{id:"menubar.compactMode",localized:"preference.menubar.mode.compact"}]},{title:"Layout",preferences:[{id:"view.saveLayoutWithWorkspace",localized:"preference.view.saveLayoutWithWorkspace.title"}]},{title:"File Tree",preferences:[]},{title:"Explorer",preferences:[{id:"explorer.fileTree.baseIndent",localized:"preference.explorer.fileTree.baseIndent.title"},{id:"explorer.fileTree.indent",localized:"preference.explorer.fileTree.indent.title"},{id:"explorer.compactFolders",localized:"preference.explorer.compactFolders.title"},{id:"explorer.autoReveal",localized:"preference.explorer.autoReveal"}]},{title:"QuickOpen",preferences:[{id:"workbench.quickOpen.preserveInput"}]},{title:"Search",preferences:[{id:"search.include"},{id:"search.exclude",localized:"preference.search.exclude.title"},{id:"search.useReplacePreview"},{id:"search.searchOnType"},{id:"search.searchOnTypeDebouncePeriod"}]},{title:"Output",preferences:[{id:"output.maxChannelLine",localized:"output.maxChannelLine"},{id:"output.enableLogHighlight",localized:"output.enableLogHighlight"},{id:"output.enableSmartScroll",localized:"output.enableSmartScroll"}]},{title:"Debug",preferences:[{id:"debug.console.wordWrap",localized:"preference.debug.console.wordWrap"},{id:"debug.inline.values",localized:"preference.debug.inline.values"},{id:"debug.toolbar.float",localized:"preference.debug.toolbar.float.title"},{id:"debug.breakpoint.editorHint",localized:"preference.debug.breakpoint.editorHint.title"},{id:"debug.breakpoint.showBreakpointsInOverviewRuler",localized:"preference.debug.breakpoint.showBreakpointsInOverviewRuler"}]}],[G.PreferenceSettingId.Terminal]:[{preferences:[{id:"terminal.type",localized:"preference.terminal.type"},{id:"terminal.fontFamily",localized:"preference.terminal.fontFamily"},{id:"terminal.fontSize",localized:"preference.terminal.fontSize"},{id:"terminal.fontWeight",localized:"preference.terminal.fontWeight"},{id:"terminal.lineHeight",localized:"preference.terminal.lineHeight"},{id:"terminal.cursorBlink",localized:"preference.terminal.cursorBlink"},{id:"terminal.scrollback",localized:"preference.terminal.scrollback"},{id:"terminal.integrated.shellArgs.linux",localized:"preference.terminal.integrated.shellArgs.linux"},{id:"terminal.integrated.copyOnSelection",localized:"preference.terminal.integrated.copyOnSelection"},{id:"terminal.integrated.localEchoEnabled",localized:"preference.terminal.integrated.localEchoEnabled"},{id:"terminal.integrated.localEchoLatencyThreshold",localized:"preference.terminal.integrated.localEchoLatencyThreshold"},{id:"terminal.integrated.localEchoExcludePrograms",localized:"preference.terminal.integrated.localEchoExcludePrograms"},{id:"terminal.integrated.cursorStyle",localized:"preference.terminal.integrated.cursorStyle"},{id:"terminal.integrated.localEchoStyle",localized:"preference.terminal.integrated.localEchoStyle"},{id:"terminal.integrated.xtermRenderType",localized:"preference.terminal.integrated.xtermRenderType"}]}],[G.PreferenceSettingId.Feature]:[{title:"Misc",preferences:[]},{title:"Tree Component",preferences:[{id:"workbench.list.openMode",localized:"preference.workbench.list.openMode.title"}]}]}},26551:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EditPreferenceDecorationsContribution=void 0;const n=t(85608),a=t(76003),o=t(97267),I=t(41869),g=t(93899),u=t(43718),G=t(57517),p=t(14951),b=n.__importStar(t(20868)),m=t(90684),d=t(19582),r=t(60295),l=t(90184),s=t(76773);let c=class{constructor(v){this.editor=v,this.disposer=new u.Disposable,this._preferences=[],this._currentLine=0,this._editPreferenceDecoration=this.editor.monacoEditor.createDecorationsCollection()}verifyEditor(){var v;return((v=this.editor.currentUri)===null||v===void 0?void 0:v.toString())===s.USER_PREFERENCE_URI.toString()}async getPreferenceUrl(){const v=await this.preferenceSettingsService.getPreferenceUrl(u.PreferenceScope.User);if(v){const f=await this.fileServiceClient.getFileStat(v);return f?u.URI.parse(f.uri):void 0}}async getDocumentModelRef(v){const f=this.editorDocumentModelService.getModelReference(v);return f||this.editorDocumentModelService.createModelReference(v)}contribute(){return this.disposer.addDispose(this.editor.monacoEditor.onMouseDown(async v=>{var f;((f=v.target.range)===null||f===void 0?void 0:f.startLineNumber)!==this.currentLine&&!this.verifyEditor()||v.target.type!==d.MouseTargetType.GUTTER_GLYPH_MARGIN||v.target.detail.isAfterLines||!this.isVisible()||(this.registerMenuItems(this.preferences),this.showContextMenu(v))})),this.disposer.addDispose(this.editor.monacoEditor.onDidChangeCursorPosition(v=>{this.verifyEditor()&&this.onPositionChanged(v)})),this.disposer.addDispose(this.editor.monacoEditor.onContextMenu(v=>(v.event.preventDefault(),v.event.stopPropagation(),!1))),this.disposer.addDispose(this.editor.monacoEditor.onDidChangeConfiguration(()=>{this.editor.monacoEditor.getOption(b.editor.EditorOption.glyphMargin)||this.hide()})),this.disposer.addDispose(u.Disposable.create(()=>{this.hide(),this.menuRegistry.unregisterMenuId(g.MenuId.SettingJSONGlyphMarginContext)})),this.disposer.addDispose(this.commandRegistry.registerCommand(r.SettingJSONGlyphMarginEdit,{execute:(v,f)=>{v&&f&&(f==="true"&&(f=!0),f==="false"&&(f=!1),this.preferenceSettingsService.setPreference(v,f,u.PreferenceScope.User))}})),this.disposer}get preferences(){return this._preferences}get currentLine(){return this._currentLine}show(v,f,W){this._preferences=W;const N=[];N.push({options:{description:"edit-preference-widget-decoration",glyphMarginClassName:(0,o.getIcon)("edit")+" setting-edit-glyph",glyphMarginHoverMessage:new m.MarkdownString().appendText(f),stickiness:b.editor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges},range:{startLineNumber:v,startColumn:1,endLineNumber:v,endColumn:1}}),this._editPreferenceDecoration.set(N)}hide(){this._editPreferenceDecoration.clear()}isVisible(){return this._editPreferenceDecoration.length>0}async getPreferencesKeyAtLineNumber(v){const f=new RegExp(/\"((?!,).)*\"+((\s+?)?)\:/g),W=await this.getPreferenceUrl();if(!W)return[];const N=await this.getDocumentModelRef(W),y=N.instance.getMonacoModel().getLineContent(v);N.dispose();const R=(y.match(f)||[]).map(w=>{const F=/\"(.*?)\"/g.exec(w);return F&&F[1]||""}),A=this.preferenceSchemaProvider.getCombinedSchema().properties;return R.filter(w=>{const F=A[w];return F?F.type==="boolean"||F.enum:!1})}async onPositionChanged(v){this.hide();const{position:{lineNumber:f}}=v;this._currentLine=f;const W=await this.getPreferencesKeyAtLineNumber(f);W.length>0?this.editor.monacoEditor.getOption(b.editor.EditorOption.glyphMargin)&&this.marginFreeFromOtherDecorations(f)&&this.show(f,(0,u.localize)("editTtile"),W):this.hide()}marginFreeFromOtherDecorations(v){const f=this.editor.monacoEditor.getLineDecorations(v);if(f){for(const{options:W}of f)if(W.glyphMarginClassName&&W.glyphMarginClassName.indexOf((0,o.getIcon)("edit"))===-1)return!1}return!0}async registerMenuItems(v){if(v.length===1){const f=this.getActions(v[0]);this.disposer.addDispose(this.menuRegistry.registerMenuItems(g.MenuId.SettingJSONGlyphMarginContext,f.map(W=>({command:{id:r.SettingJSONGlyphMarginEdit.id,label:W},group:"navigation",extraTailArgs:[v[0],W]}))))}else v.forEach(f=>{const W=`${g.MenuId.SubSettingJSONGlyphMarginContext}_${f}`;this.disposer.addDispose(this.menuRegistry.registerMenuItem(g.MenuId.SettingJSONGlyphMarginContext,{submenu:W,label:f,group:"navigation"}));const N=this.getActions(f);this.disposer.addDispose(this.menuRegistry.registerMenuItems(W,N.map(Z=>({command:{id:r.SettingJSONGlyphMarginEdit.id,label:Z},group:"navigation",extraTailArgs:[f,Z]}))))})}getActions(v){const W=this.preferenceSchemaProvider.getCombinedSchema().properties[v];return W.type==="boolean"?["true","false"]:W.enum?W.enum.map(N=>N.toString()):[]}showContextMenu(v){v.event.preventDefault(),v.event.stopPropagation();const f=this.menuService.createMenu({id:g.MenuId.SettingJSONGlyphMarginContext,config:{separator:"inline"}}),W=f.getMergedMenuNodes();f.dispose(),setTimeout(()=>{this.ctxMenuRenderer.show({anchor:v.event.browserEvent,menuNodes:W,onHide:()=>{const N=(Z,y="menu")=>this.menuRegistry.getMenuItems(Z).map(E=>y==="sub"?E.submenu:E.command).filter(Boolean);N(g.MenuId.SettingJSONGlyphMarginContext,"sub").forEach(Z=>{this.menuRegistry.unregisterMenuItem(g.MenuId.SettingJSONGlyphMarginContext,Z),N(Z).forEach(y=>{this.menuRegistry.unregisterMenuItem(Z,y.id)})}),N(g.MenuId.SettingJSONGlyphMarginContext).forEach(Z=>{this.menuRegistry.unregisterMenuItem(g.MenuId.SettingJSONGlyphMarginContext,Z.id)}),this.menuRegistry.unregisterMenuItem(g.MenuId.SettingJSONGlyphMarginContext,g.MenuId.SubSettingJSONGlyphMarginContext)}})},10)}};n.__decorate([(0,a.Autowired)(I.IPreferenceSettingsService),n.__metadata("design:type",l.PreferenceSettingsService)],c.prototype,"preferenceSettingsService",void 0),n.__decorate([(0,a.Autowired)(g.ICtxMenuRenderer),n.__metadata("design:type",g.ICtxMenuRenderer)],c.prototype,"ctxMenuRenderer",void 0),n.__decorate([(0,a.Autowired)(I.PreferenceSchemaProvider),n.__metadata("design:type",I.PreferenceSchemaProvider)],c.prototype,"preferenceSchemaProvider",void 0),n.__decorate([(0,a.Autowired)(G.IEditorDocumentModelService),n.__metadata("design:type",Object)],c.prototype,"editorDocumentModelService",void 0),n.__decorate([(0,a.Autowired)(p.IFileServiceClient),n.__metadata("design:type",Object)],c.prototype,"fileServiceClient",void 0),n.__decorate([(0,a.Autowired)(g.AbstractContextMenuService),n.__metadata("design:type",g.AbstractContextMenuService)],c.prototype,"menuService",void 0),n.__decorate([(0,a.Autowired)(g.IMenuRegistry),n.__metadata("design:type",g.IMenuRegistry)],c.prototype,"menuRegistry",void 0),n.__decorate([(0,a.Autowired)(u.CommandRegistry),n.__metadata("design:type",Object)],c.prototype,"commandRegistry",void 0),c=n.__decorate([(0,a.Injectable)({multiple:!0}),n.__param(0,(0,a.Optional)()),n.__metadata("design:paramtypes",[Object])],c),e.EditPreferenceDecorationsContribution=c},15789:(L,e,t)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.NextPreferenceItem=void 0;const a=t(85608),o=a.__importDefault(t(53373)),I=a.__importDefault(t(12784)),g=a.__importStar(t(14041)),u=t(76003),G=t(97267),p=t(56849),b=t(41869),m=t(83569),d=t(90184),r=a.__importDefault(t(80881)),l=/`#(.+)#`/gi,s="none",c=({preferenceId:w,localizedName:F,preference:V,scope:Y})=>{var _;const H=(0,b.useInjectable)(b.PreferenceService),S=(0,b.useInjectable)(b.IPreferenceSettingsService),X=(0,b.useInjectable)(b.PreferenceSchemaProvider),Q=H.getProvider(Y),{value:O,effectingScope:M}=S.getPreference(w,Y),[T,x]=(0,g.useState)(Q.get(w)),[B,D]=(0,g.useState)(),[J,k]=(0,g.useState)(()=>S.getEnumLabels(w));(0,g.useEffect)(()=>{const re=X.getPreferenceProperty(w);D(re);const ae=new b.DisposableCollection;return ae.push(Q.onDidPreferencesChanged(he=>{if(he.default&&Object.prototype.hasOwnProperty.call(he.default,w)&&he.default[w].scope===Y){const ee=he.default[w].newValue;x(ee)}})),ae.push(S.onDidEnumLabelsChange(w)((0,I.default)(()=>{D(X.getPreferenceProperty(w)),k(S.getEnumLabels(w))},d.PreferenceSettingsService.DEFAULT_CHANGE_DELAY))),()=>{ae.dispose()}},[]);let z=B;if(z||(z=X.getPreferenceProperty(w)),!z)return g.default.createElement("div",{className:(0,o.default)({[r.default.preference_item]:!0})},w," schema not found.");const P=(_=H.resolve(w,void 0,void 0,void 0,b.PreferenceScope.Default).value)!==null&&_!==void 0?_:z.default,U=T!==void 0&&String(T)!==String(P),oe=()=>{if(z){const re={preferenceName:w,scope:Y,effectingScope:M,schema:z,labels:J,currentValue:T===void 0?O:T,defaultValue:P,localizedName:F,localizedDescription:{description:V.description,markdownDescription:V.markdownDescription},renderedDescription:W({name:F,description:V.description,markdownDescription:V.markdownDescription}),hasValueInScope:T!==void 0,isModified:U};switch(z.type){case"boolean":return g.default.createElement(y,Object.assign({},re));case"integer":case"number":return z.enum?g.default.createElement(E,Object.assign({},re)):g.default.createElement(Z,Object.assign({},re,{isNumber:!0}));case"string":return z.enum?g.default.createElement(E,Object.assign({},re)):g.default.createElement(Z,Object.assign({},re));case"array":return z.items&&z.items.type==="string"?g.default.createElement(A,Object.assign({},re)):g.default.createElement(R,Object.assign({},re));default:return g.default.createElement(R,Object.assign({},re))}}};return g.default.createElement("div",{className:(0,o.default)({[r.default.preference_item]:!0,[r.default.modified]:U}),"data-id":w},oe())};e.NextPreferenceItem=c;const h=w=>{var F;const V=(0,b.useInjectable)(b.IPreferenceSettingsService);if(!w)return null;const Y=w.match(l);if(!Y)return w;let _=w;const H=[];for(const S of Y){if(!_)continue;const X=S.slice(2,S.length-2),Q=(F=m.knownPrefIdMappings[X])!==null&&F!==void 0?F:X,O=V.getPreferenceViewDesc(Q);if(O){const M=(0,m.getPreferenceItemLabel)(O),[T,x]=_.split(S,2);T&&H.push(g.default.createElement("span",{key:H.length},T)),_=x;const B=g.default.createElement("a",{onClick:()=>{V.search(M)},key:Q},M);H.push(B)}}return _&&H.push(g.default.createElement("span",{key:H.length},_)),H};let v=n=class extends p.DefaultMarkedRenderer{codespan(F){var V;if(F.startsWith("#")&&F.endsWith("#")){const Y=F.slice(1,F.length-1),_=(V=m.knownPrefIdMappings[Y])!==null&&V!==void 0?V:Y,H=this.preferenceSettingService.getPreferenceViewDesc(_);if(H){const S=(0,m.getPreferenceItemLabel)(H);return(0,p.linkify)(`${n.openerScheme}${S}`,_,S)}return super.codespan(_)}return super.codespan(F)}};v.openerScheme="prefTitle://",a.__decorate([(0,u.Autowired)(b.IPreferenceSettingsService),a.__metadata("design:type",d.PreferenceSettingsService)],v.prototype,"preferenceSettingService",void 0),v=n=a.__decorate([(0,u.Injectable)()],v);const f=w=>{const F=(0,b.useInjectable)(b.IOpenerService),V=(0,b.useInjectable)(v),Y=(0,b.useInjectable)(b.IPreferenceSettingsService);return g.default.createElement(p.Markdown,{opener:{open(_){if(_.startsWith(v.openerScheme)){const H=_.slice(v.openerScheme.length);return Y.search(H),!0}return F.open(_)}},value:w,renderer:V})},W=w=>{var F;const V=(0,b.replaceLocalizePlaceholder)((F=w.description)!==null&&F!==void 0?F:w.markdownDescription);return V?g.default.createElement("div",{className:r.default.desc},w.markdownDescription?f(V):h(V)):g.default.createElement("div",{className:r.default.desc},w.name)},N=({preferenceName:w,scope:F,effectingScope:V,showReset:Y})=>{const _=(0,b.useInjectable)(b.IPreferenceSettingsService);return g.default.createElement("span",{className:r.default.preference_status},V===b.PreferenceScope.Workspace&&F===b.PreferenceScope.User?g.default.createElement("span",{onClick:()=>{_.selectScope(b.PreferenceScope.Workspace),_.scrollToPreference(w)},className:r.default.preference_overwritten},(0,b.localize)("preference.overwrittenInWorkspace")):void 0,V===b.PreferenceScope.User&&F===b.PreferenceScope.Workspace?g.default.createElement("span",{onClick:()=>{_.selectScope(b.PreferenceScope.User),_.scrollToPreference(w)},className:r.default.preference_overwritten},(0,b.localize)("preference.overwrittenInUser")):void 0,Y?g.default.createElement("span",{className:(0,o.default)(r.default.preference_reset,(0,b.getIcon)("rollback")),onClick:()=>{_.reset(w,F)}}):void 0)};function Z({preferenceName:w,localizedName:F,currentValue:V,renderedDescription:Y,isNumber:_,effectingScope:H,scope:S,isModified:X}){const Q=(0,b.useInjectable)(b.PreferenceService),O=(0,b.useInjectable)(b.PreferenceSchemaProvider),[M,T]=(0,g.useState)();(0,g.useEffect)(()=>{T(V)},[V]);const x=D=>{B(_&&/^[0-9]+$/.test(D)?Number(D):D)||Q.set(w,D,S)};function B(D){const J=O.validate(w,D);if(!J.valid)return{type:2,message:J.reason}}return g.default.createElement(g.default.Fragment,null,g.default.createElement("div",{className:(0,o.default)(r.default.key,r.default.item)},F," ",g.default.createElement(N,{preferenceName:w,scope:S,effectingScope:H,showReset:X})),Y,g.default.createElement("div",{className:r.default.control_wrap},g.default.createElement("div",{className:r.default.text_control},g.default.createElement(G.ValidateInput,{type:_?"number":"text",validate:B,onBlur:()=>{x(M)},onValueChange:D=>{T(D)},value:M}))))}function y({preferenceName:w,localizedName:F,renderedDescription:V,currentValue:Y,effectingScope:_,scope:H,isModified:S}){const X=(0,b.useInjectable)(b.PreferenceService),[Q,O]=(0,g.useState)();(0,g.useEffect)(()=>{O(Y)},[Y]);const M=T=>{O(T),X.set(w,T,H)};return g.default.createElement(g.default.Fragment,null,g.default.createElement("div",{className:(0,o.default)(r.default.key)},F," ",g.default.createElement(N,{preferenceName:w,scope:H,effectingScope:_,showReset:S})),g.default.createElement("div",{className:r.default.check},g.default.createElement(G.CheckBox,{checked:Q,onChange:T=>{M(T.target.checked)}}),V))}function E({preferenceName:w,localizedName:F,renderedDescription:V,currentValue:Y,defaultValue:_,schema:H,labels:S,effectingScope:X,scope:Q,isModified:O}){const M=(0,b.useInjectable)(b.PreferenceService),T=(0,b.useInjectable)(b.ILogger),x=Y??_,B=(0,g.useMemo)(()=>H.enumDescriptions&&H.enum&&H.enumDescriptions[H.enum.indexOf(Y)]||"",[H]),[D,J]=(0,g.useState)(B),k=(0,g.useCallback)(re=>{M.set(w,re,Q)},[M]),z=(0,g.useCallback)(()=>{const re=H.enum?[...H.enum]:[];return _&&!re.includes(_)&&(T.warn(`default value(${_}) of ${w} not found in its enum field`),re.push(_)),re.map((ae,he)=>{typeof ae=="boolean"&&(ae=String(ae));const ee=(0,b.replaceLocalizePlaceholder)(String(S[ae]||ae));return g.default.createElement(G.Option,{value:ae,label:ee,key:`${he}-${ee}`,className:r.default.select_option},ee,String(ae)===String(_)&&g.default.createElement("div",{className:r.default.select_default_option_tips},(0,b.localize)("preference.enum.default")))})},[H.enum,S]),P=()=>g.default.createElement(G.Option,{value:(0,b.localize)("preference.stringArray.none"),key:s,label:(0,b.localize)("preference.stringArray.none"),disabled:!0},(0,b.localize)("preference.stringArray.none")),U=H.enum&&H.enum.length>0?z():P(),oe=(0,g.useCallback)((re,ae)=>{if(H.enumDescriptions){const he=H.enumDescriptions[ae];J(he||"")}},[H.enumDescriptions,J]);return g.default.createElement(g.default.Fragment,null,g.default.createElement("div",{className:r.default.key},F," ",g.default.createElement(N,{preferenceName:w,scope:Q,effectingScope:X,showReset:O})),V,g.default.createElement("div",{className:r.default.control_wrap},g.default.createElement(G.Select,{dropdownRenderType:"absolute",maxHeight:"200",onChange:k,value:x,className:r.default.select_control,description:D,onMouseEnter:oe,notMatchWarning:O?(0,b.formatLocalize)("preference.item.notValid",x):""},U)))}function R({preferenceName:w,localizedName:F,renderedDescription:V,effectingScope:Y,scope:_,hasValueInScope:H}){const S=(0,b.useInjectable)(b.IPreferenceSettingsService),X=async()=>{S.openJSON(_,w)};return g.default.createElement(g.default.Fragment,null,g.default.createElement("div",{className:r.default.key},F," ",g.default.createElement(N,{preferenceName:w,scope:_,effectingScope:Y,showReset:H})),V,g.default.createElement("div",{className:r.default.control_wrap},g.default.createElement("a",{onClick:X},(0,b.localize)("preference.editSettingsJson"))))}function A({preferenceName:w,localizedName:F,currentValue:V,renderedDescription:Y,effectingScope:_,scope:H,isModified:S}){const X=(0,b.useInjectable)(b.PreferenceService),[Q,O]=(0,g.useState)([]),[M,T]=(0,g.useState)(),[x,B]=(0,g.useState)(),[D,J]=(0,g.useState)(-1);(0,g.useEffect)(()=>{O(V||[])},[V]),(0,g.useEffect)(()=>{D>=0?B(Q[D]):B("")},[D]);const k=he=>{O(he),X.set(w,he,H)},z=()=>{if(M){const he=Q.slice(0);if(he.indexOf(M)>-1)return;he.push(M),T(""),k(he)}},P=he=>{const ee=Q.slice(0);ee.splice(he,1),ee.length?k(ee):k([])},U=he=>{J(he)},oe=he=>{T(he)},re=Q.map((he,ee)=>{const pe=JSON.stringify(he);return D>=0&&D===ee?g.default.createElement("li",{className:r.default.array_items,key:`${ee}-${pe}`}):g.default.createElement("li",{className:r.default.array_items,key:`${ee}-${pe}`},g.default.createElement("div",{className:r.default.array_item},typeof he=="string"?he:pe),g.default.createElement("div",{className:r.default.operate},g.default.createElement(G.Button,{type:"icon",title:(0,b.localize)("preference.stringArray.operate.edit"),onClick:()=>{U(ee)},className:(0,o.default)((0,b.getIcon)("edit"),r.default.array_item)}),g.default.createElement(G.Button,{type:"icon",title:(0,b.localize)("preference.stringArray.operate.delete"),onClick:()=>{P(ee)},className:(0,o.default)((0,b.getIcon)("delete"),r.default.array_item)})))}),ae=()=>{const he=()=>{const pe=Q.slice(0);x?pe[D]=x:pe.splice(D,1),O(pe),X.set(w,pe,H),J(-1)},ee=pe=>{B(pe)};if(D>=0)return g.default.createElement("div",{className:r.default.array_edit_wrapper,style:{top:D*24}},g.default.createElement(G.Input,{type:"text",className:r.default.array_edit_input,value:x,onValueChange:ee,onPressEnter:he,addonAfter:[g.default.createElement("div",{className:r.default.array_edit_input_tip},(0,b.localize)("preference.stringArray.operate.editTip"))]}))};return g.default.createElement(g.default.Fragment,null,g.default.createElement("div",{className:r.default.key},F," ",g.default.createElement(N,{preferenceName:w,scope:H,effectingScope:_,showReset:S})),Y,g.default.createElement("div",{className:r.default.control_wrap},g.default.createElement("ul",{className:r.default.array_items_wrapper},re,ae()),g.default.createElement("div",{className:r.default.preferences_flex_row},g.default.createElement(G.Input,{type:"text",className:r.default.text_control,value:M,onValueChange:oe}),g.default.createElement(G.Button,{className:r.default.add_button,onClick:z},(0,b.localize)("preference.array.additem","Add")))))}},99187:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PreferenceItem=e.PreferenceView=void 0;const n=t(85608),a=n.__importDefault(t(12784)),o=n.__importStar(t(14041)),I=n.__importDefault(t(19686)),g=t(97267),u=t(91802),G=t(41869),p=t(99333),b=n.__importDefault(t(39572)),m=t(83569),d=t(15789),r=n.__importDefault(t(80881)),l="preferenceViewIndexTree",s=8,c=()=>{const N=(0,G.useInjectable)(G.IPreferenceSettingsService),[Z,y]=(0,o.useState)([]),[E,R]=(0,o.useState)([]),A=(0,b.default)(()=>{const X=N.currentScope,Q=N.currentSearch,O=N.getSettingGroups(X,Q),M=[],T=[];for(let D=0;D<O.length;D++){const J=O[D],k=N.getResolvedSections(J.id,X,Q);M.push(...x(J,k)),T.push(B(D,J,k))}y(M),R(T);function x(D,J){const k=[],z=(P,U="")=>{let oe=U;P.title&&(oe=U+"/"+P.title);const re=[];return P.component?re.push({component:P.component,scope:X}):P.preferences?re.push(...P.preferences.map(ae=>({id:"preference:"+ae.id,preference:ae,scope:X,_path:oe}))):P.subSections&&P.subSections.forEach(ae=>{const he=z(ae,oe);re.push(...he)}),re.length>0&&P.title&&re.unshift({id:"section:"+P.title,title:P.title,scope:X,_path:oe}),re};for(const P of J){const U=z(P,D.title);k.push(...U)}return k.length>0&&D.title&&k.unshift({title:D.title,id:"group:"+D.id,scope:X,_path:D.title}),k}function B(D,J,k){const{id:z,title:P,iconClass:U}=J,oe={label:(0,m.toNormalCase)(P),iconClassName:U,groupId:z,order:D,className:r.default.group_item},re=[];return k.forEach((ae,he)=>{const ee=v(z,ae,he,1);ee&&re.push(ee)}),oe.children=re,re.length>0?oe.expandable=!0:oe.expandable=!1,oe}},16);(0,o.useEffect)(()=>{const X=new G.Disposable(N.emitter.on("settingsGroupsChange",()=>{A.run()}),N.emitter.on("currentSearchChange",()=>{A.run()}),N.emitter.on("currentScopeChange",()=>{A.run()}),N.emitter.on("settingsSectionsChange",()=>{A.run()}));return A.run(),()=>{X.dispose()}},[]);const w=(0,G.useInjectable)(G.LabelService),F=(0,o.useCallback)((X,Q)=>w.getIcon(G.URI.parse(X),Q),[]),V=(0,o.useRef)(null),Y=(0,a.default)(X=>{N.search(X)},100,{maxWait:300});(0,o.useEffect)(()=>{const X=N.onFocus(()=>{V&&V.current&&(V.current.focus(),V.current.select())});return()=>{X.dispose()}},[]);const _=(0,G.useEventDrivenState)(N.emitter,"currentSearchChange",()=>N.currentSearch),H=(0,G.useEventDrivenState)(N.emitter,"tabListChange",()=>N.tabList),S=(0,G.useEventDrivenState)(N.emitter,"tabIndexChange",()=>N.tabIndex);return o.default.createElement(g.ComponentContextProvider,{value:{getIcon:G.getIcon,localize:G.localize,getResourceIcon:F}},o.default.createElement("div",{className:r.default.preferences},o.default.createElement("div",{className:r.default.preferences_header},o.default.createElement(g.Tabs,{className:r.default.tabs,value:S,onChange:X=>{N.updateTabIndex(X)},tabs:H.map(X=>(0,G.localize)(X.label))}),o.default.createElement("div",{className:r.default.search_pref},o.default.createElement(g.Input,{autoFocus:!0,value:_,placeholder:(0,G.localize)("preference.searchPlaceholder"),onValueChange:Y,ref:V,hasClear:!0}))),Z.length>0?o.default.createElement(p.SplitPanel,{id:"preference-panel",resizeHandleClassName:r.default.devider,className:r.default.preferences_body,direction:"left-to-right"},o.default.createElement(f,{treeData:E,"data-sp-defaultSize":180,"data-sp-minSize":150}),o.default.createElement(W,{tabIndex:S,items:Z,"data-sp-flex":1})):o.default.createElement("div",{className:r.default.preference_noResults},_?(0,G.formatLocalize)("preference.noResults",_):(0,G.formatLocalize)("preference.empty"))))};e.PreferenceView=c;const h=({data:N,index:Z})=>{var y;if(N.title)return!((y=N.id)===null||y===void 0)&&y.startsWith("group:")?o.default.createElement("div",{className:r.default.group_title,id:N.id},N.title):o.default.createElement("div",{className:r.default.section_title,id:N.id},N.title);if(N.component)return o.default.createElement(N.component,{scope:N.scope});if(N.preference)return o.default.createElement(d.NextPreferenceItem,{key:`${Z} - ${N.preference.id} - ${N.scope}`,preference:N.preference,preferenceId:N.preference.id,localizedName:N.preference.label,scope:N.scope})};e.PreferenceItem=h;const v=(N,Z,y,E)=>{let R;Z.title&&(R={label:Z.title,section:Z.title,groupId:N,order:y,indentOffset:E===1?-s:-(s>>1),className:r.default.index_item});const A=[];return Z.subSections&&Z.subSections.forEach((w,F)=>{const V=v(N,w,F,E+1);V&&A.push(V)}),R&&A&&A.length>0&&(R.children=A,R.expandable=!0),R},f=N=>{const Z=(0,G.useInjectable)(G.IPreferenceSettingsService),{treeData:y}=N;return o.default.createElement(I.default,{className:r.default.preferences_indexes},({width:E,height:R})=>o.default.createElement(g.BasicRecycleTree,{treeName:l,sortComparator:(A,w)=>{if(typeof A.order<"u"&&typeof w.order<"u")return A.order>w.order?1:A.order<w.order?-1:0},height:R,width:E,itemHeight:26,baseIndent:s,indent:12,treeData:y,onClick:(A,w)=>{const F=w&&w._raw;F&&(F.section?Z.scrollToSection(F.section):F.groupId&&Z.scrollToGroup(F.groupId))},onReady:A=>{Z.handleTreeHandler(A)}}))},W=N=>{const Z=(0,G.useInjectable)(G.IPreferenceSettingsService),[y,E]=(0,o.useState)(void 0),{items:R}=N;(0,o.useEffect)(()=>{var V;y&&(!((V=Z.treeHandler)===null||V===void 0)&&V.focusItem)&&Z.treeHandler.focusItem(y)},[N.tabIndex,Z.treeHandler,y]);const A=V=>{var Y;if(V){const _=R.findIndex(H=>H.id===V);_>=0&&((Y=Z.listHandler)===null||Y===void 0||Y.scrollToIndex({index:_,behavior:"auto",align:"start"}))}},w=(0,b.default)(V=>{const Y=R[V.startIndex+1];Y&&Y._path&&E(Y._path)},16*3,{leading:!0,trailing:!0}),F=(0,G.useEventDrivenState)(Z.emitter,"currentSelectIdChange",()=>Z.currentSelectId);return(0,o.useEffect)(()=>{F&&A(F)},[R,F]),o.default.createElement("div",{className:r.default.preferences_items},o.default.createElement(u.VirtualList,{data:R,template:e.PreferenceItem,className:r.default.preference_section,refSetter:Z.handleListHandler,onRangeChanged:w.run}))}},76773:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserPreferenceProvider=e.USER_PREFERENCE_URI=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(78132),g=t(11461);e.USER_PREFERENCE_URI=new o.URI().withScheme(o.Schemes.userStorage).withPath("settings.json");let u=class extends g.AbstractResourcePreferenceProvider{getUri(){return e.USER_PREFERENCE_URI}getScope(){return I.PreferenceScope.User}};u=n.__decorate([(0,a.Injectable)()],u),e.UserPreferenceProvider=u},25947:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=t(85608);n.__exportStar(t(84017),e),n.__exportStar(t(57506),e)},57506:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UserStorageContribution=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(14951),g=t(2156),u=t(83569);let G=class{initialize(){this.fileSystem.registerProvider(o.Schemes.userStorage,this.userStorageService)}};n.__decorate([(0,a.Autowired)(u.IUserStorageService),n.__metadata("design:type",Object)],G.prototype,"userStorageService",void 0),n.__decorate([(0,a.Autowired)(I.IFileServiceClient),n.__metadata("design:type",g.FileServiceClient)],G.prototype,"fileSystem",void 0),G=n.__decorate([(0,o.Domain)(o.ClientAppContribution)],G),e.UserStorageContribution=G},84017:(L,e,t)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.UserStorageServiceImpl=e.DEFAULT_USER_STORAGE_FOLDER=void 0;const a=t(85608),o=a.__importDefault(t(82451)),I=t(76003),g=t(41869),u=t(43718),G=t(42933);e.DEFAULT_USER_STORAGE_FOLDER=".sumi";const p={recursive:!1,excludes:["**/logs/**"]};let b=n=class{static toUserStorageUri(d,r){const l=this.getRelativeUserStoragePath(d,r);return new g.URI("").withScheme(u.Schemes.userStorage).withPath(l).withFragment(r.fragment).withQuery(r.query)}static getRelativeUserStoragePath(d,r){return r.toString().slice(d.toString().length+1)}static toFilesystemURI(d,r){return d.withPath(d.path.join(r.path.toString()))}constructor(){this.capabilities=2,this.onDidChangeCapabilities=u.Event.None,this.toDispose=new g.DisposableCollection,this.onDidChangeFileEmitter=new g.Emitter,this._whenReady=this.init()}get whenReady(){return this._whenReady}get onDidChangeFile(){return this.onDidChangeFileEmitter.event}async init(){const d=await this.fileServiceClient.getCurrentUserHome();if(d){const r=new g.URI(d.uri).resolve(this.appConfig.userPreferenceDirName||this.appConfig.preferenceDirName||e.DEFAULT_USER_STORAGE_FOLDER);await this.fileServiceClient.access(r.toString())||await this.fileServiceClient.createFolder(r.toString()),this.userStorageFolder=r}this.toDispose.push(this.onDidChangeFileEmitter)}readDirectory(d){throw new Error("Method not implemented.")}createDirectory(d){throw new Error("Method not implemented.")}async watch(d,r){await this.whenReady;const l=n.toFilesystemURI(this.userStorageFolder,g.URI.from(d)),s=(0,o.default)(p,r),c=await this.fileServiceClient.watchFileChanges(l.parent,s.excludes);return this.toDispose.push(c),this.toDispose.push(c.onFilesChanged(h=>{const v=[];for(const f of h)f.uri===l.toString()&&v.push(f);v.length>0&&this.onDidChangeFileEmitter.fire(v.map(f=>({uri:n.toUserStorageUri(this.userStorageFolder,new g.URI(f.uri)).toString(),type:f.type})))})),c.watchId}async readFile(d){await this.whenReady;const r=n.toFilesystemURI(this.userStorageFolder,g.URI.from(d));try{const{content:l}=await this.fileServiceClient.readFile(r.toString());return l.buffer}catch(l){throw new Error(l)}}async writeFile(d,r,l){await this.whenReady;const s=n.toFilesystemURI(this.userStorageFolder,g.URI.from(d));try{let c=await this.fileServiceClient.getFileStat(s.toString());c?await this.fileServiceClient.setContent(c,r,l):(c=await this.fileServiceClient.createFile(s.toString()),await this.fileServiceClient.setContent(c,r,l))}catch(c){throw new Error(c)}}delete(d,r){throw new Error("Method not implemented.")}rename(d,r,l){throw new Error("Method not implemented.")}copy(d,r,l){throw new Error("Method not implemented.")}async stat(d){await this.whenReady;const r=n.toFilesystemURI(this.userStorageFolder,g.URI.from(d)),l=await this.fileServiceClient.getFileStat(r.toString());if(l)return l}async access(d,r){await this.whenReady;const l=n.toFilesystemURI(this.userStorageFolder,g.URI.from(d));return this.fileServiceClient.access(l.toString(),r)}};a.__decorate([(0,I.Autowired)(G.IFileServiceClient),a.__metadata("design:type",Object)],b.prototype,"fileServiceClient",void 0),a.__decorate([(0,I.Autowired)(g.ILogger),a.__metadata("design:type",Object)],b.prototype,"logger",void 0),a.__decorate([(0,I.Autowired)(g.AppConfig),a.__metadata("design:type",Object)],b.prototype,"appConfig",void 0),b=n=a.__decorate([(0,I.Injectable)(),a.__metadata("design:paramtypes",[])],b),e.UserStorageServiceImpl=b},46392:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceFilePreferenceProvider=e.WorkspaceFilePreferenceProviderFactory=e.WorkspaceFilePreferenceProviderOptions=void 0;const n=t(85608),a=t(76003),o=t(78132),I=t(51500),g=t(84435),u=t(11461);let G=class{};G=n.__decorate([(0,a.Injectable)()],G),e.WorkspaceFilePreferenceProviderOptions=G,e.WorkspaceFilePreferenceProviderFactory=Symbol("WorkspaceFilePreferenceProviderFactory");let p=class extends u.AbstractResourcePreferenceProvider{getUri(){return this.options.workspaceUri}parse(m){const d=super.parse(m);return g.WorkspaceData.is(d)?d.settings||{}:{}}getPath(m){return["settings",m]}getScope(){return o.PreferenceScope.Workspace}getDomain(){return this.workspaceService.tryGetRoots().map(m=>m.uri)}};n.__decorate([(0,a.Autowired)(I.IWorkspaceService),n.__metadata("design:type",Object)],p.prototype,"workspaceService",void 0),n.__decorate([(0,a.Autowired)(G),n.__metadata("design:type",G)],p.prototype,"options",void 0),p=n.__decorate([(0,a.Injectable)()],p),e.WorkspaceFilePreferenceProvider=p},58705:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspacePreferenceProvider=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(78132),g=t(51500),u=t(46392);let G=class extends I.PreferenceProvider{constructor(){super(),this.toDisposeOnEnsureDelegateUpToDate=new o.DisposableCollection,this.init()}async init(){this._ready.resolve(),this.ensureDelegateUpToDate(),this.workspaceService.onWorkspaceLocationChanged(()=>this.ensureDelegateUpToDate())}getConfigUri(b=this.ensureResourceUri()){const m=this.delegate;return m&&m.getConfigUri(b)}get delegate(){return this._delegate||this.ensureDelegateUpToDate(),this._delegate}ensureDelegateUpToDate(){const b=this.createDelegate();this._delegate!==b&&(this.toDisposeOnEnsureDelegateUpToDate.dispose(),this.toDispose.push(this.toDisposeOnEnsureDelegateUpToDate),this._delegate=b,b&&this.toDisposeOnEnsureDelegateUpToDate.pushAll([b,b.onDidPreferencesChanged(m=>{this.emitPreferencesChangedEvent(m)})]))}createDelegate(){const b=this.workspaceService.workspace;if(b)return this.workspaceService.isMultiRootWorkspaceOpened?this.workspaceFileProviderFactory({workspaceUri:new o.URI(b.uri)}):this.foldersPreferenceProvider}doGet(b,m=this.ensureResourceUri(),d){const r=this.delegate;return r?r.get(b,m,d):void 0}doResolve(b,m=this.ensureResourceUri(),d){const r=this.delegate;return r?r.resolve(b,m,d):{}}getPreferences(b=this.ensureResourceUri(),m){const d=this.delegate;return d?d.getPreferences(b,m):void 0}getLanguagePreferences(b=this.ensureResourceUri()){const m=this.delegate;return m?m.getLanguagePreferences(b):void 0}async doSetPreference(b,m,d=this.ensureResourceUri(),r){const l=this.delegate;return l?l.setPreference(b,m,d,r):!1}ensureResourceUri(){if(this.workspaceService.workspace&&!this.workspaceService.isMultiRootWorkspaceOpened)return this.workspaceService.workspace.uri}};n.__decorate([(0,a.Autowired)(g.IWorkspaceService),n.__metadata("design:type",Object)],G.prototype,"workspaceService",void 0),n.__decorate([(0,a.Autowired)(u.WorkspaceFilePreferenceProviderFactory),n.__metadata("design:type",Function)],G.prototype,"workspaceFileProviderFactory",void 0),n.__decorate([(0,a.Autowired)(I.PreferenceProvider,{tag:I.PreferenceScope.Folder}),n.__metadata("design:type",I.PreferenceProvider)],G.prototype,"foldersPreferenceProvider",void 0),G=n.__decorate([(0,a.Injectable)(),n.__metadata("design:paramtypes",[])],G),e.WorkspacePreferenceProvider=G},60295:(L,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SettingJSONGlyphMarginEdit=void 0,e.SettingJSONGlyphMarginEdit={id:"preference.setting.glyphMargin.edit"}},83569:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=t(85608);n.__exportStar(t(99112),e),n.__exportStar(t(36858),e),n.__exportStar(t(49132),e),n.__exportStar(t(29728),e)},49132:(L,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.knownPrefIdMappings=e.PreferenceSettingId=void 0;var t;(function(n){n.General="general",n.Editor="editor",n.Terminal="terminal",n.Feature="feature",n.View="view"})(t=e.PreferenceSettingId||(e.PreferenceSettingId={})),e.knownPrefIdMappings={"workbench.editor.enablePreview":"editor.previewMode"}},99112:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toNormalCase=e.getPreferenceItemLabel=e.toPreferenceReadableName=e.knownTermMappings=e.PREF_SCHEME=void 0;const n=t(41869);e.PREF_SCHEME="pref",e.knownTermMappings=new Map,e.knownTermMappings.set("power shell","PowerShell"),e.knownTermMappings.set("powershell","PowerShell"),e.knownTermMappings.set("javascript","JavaScript"),e.knownTermMappings.set("typescript","TypeScript"),["css","html","scss","less","json","js","ts","ie","id","php","scm","npm"].forEach(u=>{e.knownTermMappings.set(u,u.toUpperCase())});function a(u){const G=u.toLowerCase();return e.knownTermMappings.has(G)?e.knownTermMappings.get(G):g(u)}function o(u){const G=u.split(".");let p=a(G[0]);return G[1]&&(p+=" > "+g(G[1])),G[2]&&(p+=" : "+g(G[2])),G.slice(3).length>0&&(p+=". "+G.slice(3).join(" ")),p}e.toPreferenceReadableName=o;function I(u){let G;return u.localized&&(G=(0,n.localize)(u.localized)),G||(G=o(u.id)),G}e.getPreferenceItemLabel=I;function g(u){return u.substr(0,1).toUpperCase()+u.substr(1).replace(/([^A-Z])([A-Z])/g,"$1 $2")}e.toNormalCase=g},29728:(L,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SettingContribution=void 0,e.SettingContribution=Symbol("SettingContribution")},36858:(L,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IUserStorageService=void 0,e.IUserStorageService=Symbol("IUserStorageService")},46507:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),t(85608).__exportStar(t(83569),e)},70716:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HighlightLabel=void 0;const a=t(85608).__importDefault(t(14041)),o=t(41869),I=t(48560),g=t(52416),u=({text:G="",highlights:p=[],className:b="",labelClassName:m="",labelIconClassName:d="",hightLightClassName:r="",OutElementType:l="span"})=>{const s=(0,I.useInjectable)(g.IIconService),c=a.default.useMemo(()=>{const h=[];let v=0;for(const f of p){if(f.end===f.start)continue;if(v<f.start){const N=G.substring(v,f.start);h.push(a.default.createElement("span",{className:m,key:`${h.length}-${N}`},(0,o.transformLabelWithCodicon)(N,d,s.fromString.bind(s)))),v=f.end}const W=G.substring(f.start,f.end);h.push(a.default.createElement("span",{className:r,key:`${h.length}-${W}`},(0,o.transformLabelWithCodicon)(W,d,s.fromString.bind(s)))),v=f.end}if(v<G.length){const f=G.substring(v);h.push(a.default.createElement("span",{className:m,key:`${h.length}-${f}`},(0,o.transformLabelWithCodicon)(f,d,s.fromString.bind(s))))}return h},[G,p]);return a.default.createElement(l,{title:G,className:b},c)};e.HighlightLabel=u},52644:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KeybindingView=void 0;const n=t(85608),a=n.__importDefault(t(53373)),o=n.__importDefault(t(14041)),I=t(41869),g=n.__importDefault(t(26739)),u=({keybinding:G,className:p,sequenceClassName:b,keyClassName:m})=>{const d=(0,I.useInjectable)(I.KeybindingRegistry),r=o.default.useMemo(()=>d.acceleratorFor(G," "),[G]);return o.default.createElement("div",{className:(0,a.default)(g.default.keybinding,p)},r?r.map((l,s)=>{const c=l.split(" ");return o.default.createElement("div",{key:`${l}_${s}`,title:l,className:(0,a.default)(g.default.key_sequence,b)},c.map((h,v)=>o.default.createElement("span",{className:(0,a.default)(g.default.key,m),key:`${h}_${s}_${v}`},h)))}):null)};e.KeybindingView=u},47005:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QuickOpenTabs=void 0;const n=t(85608),a=n.__importDefault(t(53373)),o=n.__importDefault(t(14041)),I=t(41869),g=t(63373),u=t(52644),G=n.__importDefault(t(78539)),p=({tabs:b,activePrefix:m,onChange:d,toggleTab:r})=>{const l=(0,I.useInjectable)(I.KeybindingRegistry),s=c=>{const h=l.getKeybindingsForCommand(c);return h?h[0]:void 0};return o.default.createElement("div",{id:g.VIEW_CONTAINERS.QUICKPICK_TABS,className:G.default.quickopen_tabs},o.default.createElement("div",{className:G.default.quickopen_tabs_left},b.map(({title:c,prefix:h,commandId:v,order:f},W)=>{const N=s(v);return o.default.createElement("div",{key:h,className:G.default.quickopen_tabs_left_item,onMouseDown:Z=>Z.preventDefault(),onClick:()=>{h!==m&&d(h)}},o.default.createElement("div",{className:(0,a.default)(G.default.quickopen_tabs_left_item_text,{[G.default.selected]:m===h})},c),N&&o.default.createElement(u.KeybindingView,{keybinding:N,className:G.default.keybinding,keyClassName:G.default.tab_key}))})),o.default.createElement("div",{style:{flex:1}}),o.default.createElement("div",{className:G.default.quickopen_tabs_tip,onClick:()=>{r?.()}},(0,I.localize)("quickopen.tab.tip.prefix"),o.default.createElement("span",{className:G.default.tab_key},"Tab"),(0,I.localize)("quickopen.tab.tip.suffix")))};e.QuickOpenTabs=p},96534:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QuickOpenModule=e.CoreQuickOpenModule=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(74404),g=t(80490),u=t(99066),G=t(65028),p=t(43131),b=t(13978);let m=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:I.PrefixQuickOpenService,useClass:g.PrefixQuickOpenServiceImpl},{token:o.QuickOpenService,useClass:p.MonacoQuickOpenService},{token:I.QuickPickService,useClass:b.QuickPickServiceImpl},{token:I.IQuickInputService,useClass:u.QuickInputService},G.CoreQuickOpenContribution],this.contributionProvider=g.QuickOpenContribution}};m=n.__decorate([(0,a.Injectable)()],m),e.CoreQuickOpenModule=m;let d=class extends m{constructor(){super(...arguments),this.providers=this.providers.concat(G.QuickOpenFeatureContribution)}};d=n.__decorate([(0,a.Injectable)()],d),e.QuickOpenModule=d},80490:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PrefixQuickOpenServiceImpl=e.QuickOpenHandlerRegistry=e.QuickOpenContribution=void 0;const n=t(85608),a=n.__importDefault(t(14041)),o=t(76003),I=t(41869),g=t(18193),u=t(74404),G=t(43718),p=t(47005),b=t(50426);var m=t(74404);Object.defineProperty(e,"QuickOpenContribution",{enumerable:!0,get:function(){return m.QuickOpenContribution}});let d=class extends G.Disposable{constructor(){super(...arguments),this.handlers=new Map,this.tabs=[],this.sortedTabs=null,this.handlerTabMap=new Map}registerHandler(s,c){if(this.handlers.has(s.prefix))return this.logger.warn(`The handler function of the \`${s.prefix}\` is already registered`),G.Disposable.NULL;this.handlers.set(s.prefix,s);const h={dispose:()=>this.handlers.delete(s.prefix)};if(this.addDispose(h),s.default&&(this.defaultHandler=s),c&&!c.hideTab){const v=[],{sub:f}=c,W=n.__rest(c,["sub"]);f&&Object.keys(f).forEach(N=>{v.push(Object.assign({prefix:`${s.prefix}${N}`},f[N]))}),v.push(Object.assign({prefix:s.prefix},W)),this.handlerTabMap.set(s,v),this.tabs.push(...v),this.sortedTabs=null,this.addDispose({dispose:()=>{const N=this.handlerTabMap.get(s);N&&(this.handlerTabMap.delete(s),this.tabs=this.tabs.filter(Z=>!N.includes(Z)),this.sortedTabs=null)}})}return h}getDefaultHandler(){return this.defaultHandler}isDefaultHandler(s){return s===this.getDefaultHandler()}getHandlers(){return[...this.handlers.values()]}getHandlerOrDefault(s){for(const c of this.handlers.values())if(s.startsWith(c.prefix))return c;return this.getDefaultHandler()}getSortedTabs(){return this.sortedTabs||(this.sortedTabs=this.tabs.slice().sort((s,c)=>s.order-c.order)),this.sortedTabs}getTabByHandler(s,c){if(this.handlerTabMap.has(s)){let h=c;return this.isDefaultHandler(s)&&!c.startsWith(s.prefix)&&(h=`${s.prefix}${c}`),this.handlerTabMap.get(s).find(v=>h.startsWith(v.prefix))}}};n.__decorate([(0,o.Autowired)(G.ILogger),n.__metadata("design:type",Object)],d.prototype,"logger",void 0),d=n.__decorate([(0,o.Injectable)()],d),e.QuickOpenHandlerRegistry=d;let r=class{constructor(){this.activePrefix="",this.currentLookFor="",this.toDisposeCurrent=new G.DisposableCollection}open(s,c){const h=this.handlers.getHandlerOrDefault(s);let v=!1;c?s=`${s}${c}`:this.corePreferences["workbench.quickOpen.preserveInput"]&&h&&h===this.currentHandler&&this.currentLookFor&&this.handlers.getTabByHandler(h,this.currentLookFor)===this.handlers.getTabByHandler(h,s)?(s=this.currentLookFor,v=!0):this.currentLookFor="",this.setCurrentHandler(s,h,v)}async setCurrentHandler(s,c,h){var v,f;if(c!==this.currentHandler&&(this.toDisposeCurrent.dispose(),this.currentHandler=c,this.toDisposeCurrent.push(G.Disposable.create(()=>{const E=c&&c.getOptions().onClose;E&&E(!0)}))),!c){this.doOpen();return}c.init&&await c.init(),this.setActivePrefix(c,s);let W=s;this.handlers.isDefaultHandler(c)&&s.startsWith(c.prefix)&&(W=s.substring(c.prefix.length));const N=this.handlers.isDefaultHandler(c)?0:((f=(v=this.handlers.getTabByHandler(c,s))===null||v===void 0?void 0:v.prefix)!==null&&f!==void 0?f:c.prefix).length,Z=c.getOptions(),y=()=>{var E;(E=c.onToggle)===null||E===void 0||E.call(c);const R=this.handlers.getSortedTabs();let A=null;if(this.activePrefix){let w=R.findIndex(F=>F.prefix===this.activePrefix);w=w===R.length-1?0:w+1,A=R[w]}else A=R[0];A&&this.open(A.prefix)};this.doOpen(Object.assign(Object.assign({prefix:W,skipPrefix:N,valueSelection:h?[N,s.length]:void 0},Z),{onClose:E=>{Z.onClose&&Z.onClose(E),c.onClose&&c.onClose(E)},renderTab:()=>a.default.createElement(p.QuickOpenTabs,{tabs:this.handlers.getSortedTabs(),activePrefix:this.activePrefix,onChange:E=>{var R;(R=c.onToggle)===null||R===void 0||R.call(c),this.open(E)},toggleTab:()=>{y()}}),toggleTab:()=>{y()}}))}doOpen(s){this.quickTitleBar.isAttached&&this.quickTitleBar.hide(),this.quickOpenService.open({onType:(c,h)=>this.onType(c,h)},s)}onType(s,c){this.currentLookFor=s;const h=this.handlers.getHandlerOrDefault(s);if(h===void 0){const v=[];v.push(new u.QuickOpenItem({label:(0,I.localize)("quickopen.command.nohandler")})),c(v)}else if(h!==this.currentHandler)this.setCurrentHandler(s,h);else{const v=h.getModel(),f=this.handlers.isDefaultHandler(h)?s:s.substr(h.prefix.length);v.onType(f,(W,N)=>c(W,N)),this.setActivePrefix(h,s)}}setActivePrefix(s,c){var h,v;this.activePrefix=(v=(h=this.handlers.getTabByHandler(s,c))===null||h===void 0?void 0:h.prefix)!==null&&v!==void 0?v:""}};n.__decorate([(0,o.Autowired)(d),n.__metadata("design:type",d)],r.prototype,"handlers",void 0),n.__decorate([(0,o.Autowired)(u.QuickOpenService),n.__metadata("design:type",Object)],r.prototype,"quickOpenService",void 0),n.__decorate([(0,o.Autowired)(b.QuickTitleBar),n.__metadata("design:type",b.QuickTitleBar)],r.prototype,"quickTitleBar",void 0),n.__decorate([(0,o.Autowired)(g.CorePreferences),n.__metadata("design:type",Object)],r.prototype,"corePreferences",void 0),r=n.__decorate([(0,o.Injectable)()],r),e.PrefixQuickOpenServiceImpl=r},99066:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QuickInputService=void 0;const n=t(85608),a=t(76003),o=t(97267),I=t(74404),g=t(43718),u=t(50426),G=t(44854);let p=class{constructor(){this.onDidAcceptEmitter=new g.Emitter,this.onDidChangeValueEmitter=new g.Emitter}open(m){this.inputBox&&this.inputBox.hide();const d=new g.Deferred,r=m&&m.validateInput;m.hideOnDidAccept===void 0&&(m.hideOnDidAccept=!0);const l=this.injector.get(G.InputBoxImpl,[m]);return this.inputBox=l,l.onDidAccept(s=>{d.resolve(s),this.onDidAcceptEmitter.fire()}),l.getDerivedOptionsFromValue=async s=>{var c;const h=r&&s!==void 0?(0,g.withNullAsUndefined)(await r(s)):void 0;return{validationMessage:typeof h=="string"?h:h?.message,validationType:typeof h=="string"?o.VALIDATE_TYPE.ERROR:(c=h?.type)!==null&&c!==void 0?c:o.VALIDATE_TYPE.ERROR}},l.onDidChangeValue(async s=>{this.onDidChangeValueEmitter.fire(s)}),l.onDidHide(()=>{d.resolve(void 0)}),l.open(),d.promise}refresh(){var m;(m=this.inputBox)===null||m===void 0||m.refresh()}hide(){var m;(m=this.inputBox)===null||m===void 0||m.hide()}dispose(){var m;(m=this.inputBox)===null||m===void 0||m.dispose()}get onDidAccept(){return this.onDidAcceptEmitter.event}get onDidChangeValue(){return this.onDidChangeValueEmitter.event}};n.__decorate([(0,a.Autowired)(I.QuickOpenService),n.__metadata("design:type",Object)],p.prototype,"quickOpenService",void 0),n.__decorate([(0,a.Autowired)(u.QuickTitleBar),n.__metadata("design:type",u.QuickTitleBar)],p.prototype,"quickTitleBar",void 0),n.__decorate([(0,a.Autowired)(a.INJECTOR_TOKEN),n.__metadata("design:type",a.Injector)],p.prototype,"injector",void 0),p=n.__decorate([(0,a.Injectable)()],p),e.QuickInputService=p},11143:(L,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QuickOpenBaseAction=void 0;class t{constructor(a){this.options=a}get id(){return this.options.id}get label(){return this.options.label||""}set label(a){this.options.label=a}get tooltip(){return this.options.tooltip||""}set tooltip(a){this.options.tooltip=a}get class(){return this.options.class||""}set class(a){this.options.class=a}get enabled(){return this.options.enabled||!0}set enabled(a){this.options.enabled=a}get checked(){return this.options.checked||!1}set checked(a){this.options.checked=a}get radio(){return this.options.radio||!1}set radio(a){this.options.radio=a}dispose(){}}e.QuickOpenBaseAction=t},78245:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QuickOpenItemService=void 0;const n=t(85608),a=t(76003),o=t(40827),I=t(43718),g=t(52416),u=t(89802);let G=class{constructor(){this.onDidTriggerItemButtonEmitter=new I.Emitter}get onDidTriggerItemButton(){return this.onDidTriggerItemButtonEmitter.event}fireDidTriggerItemButton(b,m){this.onDidTriggerItemButtonEmitter.fire({button:m,item:{handle:b}})}getButtons(b){return b.length===0?[]:b.map((m,d)=>{const r=(0,u.iconPath2URI)(m.iconPath,this.themeService.getCurrentThemeSync().type),l=r&&this.staticResourceService.resolveStaticResource(r).toString(),s=l&&this.iconService.fromIcon("",l,g.IconType.Background);return Object.assign(Object.assign({},m),{iconClass:s,handle:d})})}};n.__decorate([(0,a.Autowired)(g.IThemeService),n.__metadata("design:type",Object)],G.prototype,"themeService",void 0),n.__decorate([(0,a.Autowired)(),n.__metadata("design:type",o.StaticResourceService)],G.prototype,"staticResourceService",void 0),n.__decorate([(0,a.Autowired)(g.IIconService),n.__metadata("design:type",Object)],G.prototype,"iconService",void 0),G=n.__decorate([(0,a.Injectable)()],G),e.QuickOpenItemService=G},90404:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CommandQuickOpenItem=e.QuickCommandHandler=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(18193),g=t(93899),u=t(74404),G=t(43718),p=t(77714),b=t(51500);let m=class{constructor(){this.prefix=">",this.description=(0,o.localize)("quickopen.command.description"),this.initDeferred=new G.Deferred,this.initRecentlyUsedCommands()}async init(){await this.initDeferred.promise,this.items=this.getItems()}async initRecentlyUsedCommands(){const s=(await this.workspaceService.getMostRecentlyUsedCommands()).map(c=>this.commandRegistry.getCommand(c)).filter(c=>!!c).reverse();this.commandRegistry.setRecentCommands(s),this.initDeferred.resolve()}getModel(){return{onType:(l,s)=>{s(this.items),this.reporterService.point(G.REPORT_NAME.QUICK_OPEN_MEASURE,"command",{lookFor:l})}}}getOptions(){return{placeholder:(0,o.localize)("quickopen.command.placeholder"),fuzzyMatchLabel:{enableSeparateSubstringMatching:!0},fuzzyMatchDetail:{enableSeparateSubstringMatching:!0},fuzzySort:!1,getPlaceholderItem:()=>new u.QuickOpenItem({label:(0,o.localize)("quickopen.commands.notfound"),run:()=>!1})}}onClose(){this.commandService.executeCommand(o.EDITOR_COMMANDS.FOCUS.id)}getItems(){const l=[],{recent:s,other:c}=this.getCommands();return l.push(...s.map((h,v)=>this.injector.get(d,[h,{groupLabel:v===0?(0,o.localize)("quickopen.recent-commands"):"",showBorder:!1}])),...c.map((h,v)=>this.injector.get(d,[h,{groupLabel:s.length<=0?"":v===0?(0,o.localize)("quickopen.other-commands"):"",showBorder:s.length<=0?!1:v===0}]))),l}getCommands(){const l=this.menuService.createMenu(g.MenuId.CommandPalette,this.contextKeyService),s=this.getValidCommands(this.commandRegistry.getRecentCommands()),c=this.corePreferences["workbench.commandPalette.history"],h=s.slice(0,c),v=new Set(h.map(Z=>Z.id)),f=new Set,W=[],N=[];for(const[,Z]of l.getMenuNodes())for(const y of Z){if(!(y instanceof g.MenuItemNode)||y.disabled||f.has(y.id)||(f.add(y.id),v.has(y.id)))continue;W.push(y);const E=this.commandRegistry.getCommand(y.id);E&&N.push(Object.assign(Object.assign({},E),{label:y.label}))}for(let Z=h.length-1;Z>=0;Z--){const y=h[Z];f.has(y.id)||h.splice(Z,1)}return l.dispose(),{recent:h,other:N.sort((Z,y)=>G.Command.compareCommands(Z,y))}}getValidCommands(l){return l.filter(s=>s.label&&this.commandRegistry.isVisible(s.id)&&this.commandRegistry.isEnabled(s.id))}};n.__decorate([(0,a.Autowired)(G.CommandService),n.__metadata("design:type",Object)],m.prototype,"commandService",void 0),n.__decorate([(0,a.Autowired)(a.INJECTOR_TOKEN),n.__metadata("design:type",a.Injector)],m.prototype,"injector",void 0),n.__decorate([(0,a.Autowired)(G.CommandRegistry),n.__metadata("design:type",Object)],m.prototype,"commandRegistry",void 0),n.__decorate([(0,a.Autowired)(b.IWorkspaceService),n.__metadata("design:type",Object)],m.prototype,"workspaceService",void 0),n.__decorate([(0,a.Autowired)(I.CorePreferences),n.__metadata("design:type",Object)],m.prototype,"corePreferences",void 0),n.__decorate([(0,a.Autowired)(g.AbstractMenuService),n.__metadata("design:type",g.AbstractMenuService)],m.prototype,"menuService",void 0),n.__decorate([(0,a.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],m.prototype,"contextKeyService",void 0),n.__decorate([(0,a.Autowired)(G.IReporterService),n.__metadata("design:type",Object)],m.prototype,"reporterService",void 0),m=n.__decorate([(0,a.Injectable)(),n.__metadata("design:paramtypes",[])],m),e.QuickCommandHandler=m;let d=class extends u.QuickOpenItem{constructor(l,s){super(s),this.command=l,this.commandOptions=s}getLabel(){return this.command.category?`${(0,p.uppercaseFirstLetter)(this.command.category)}: `+this.command.label:this.command.label}isHidden(){return super.isHidden()}getDetail(){var l,s;if(!this.command.labelLocalized)return;let c;const{alias:h,localized:v}=this.command.labelLocalized;if(h!==v){const f=(s=(l=this.command.categoryLocalized)===null||l===void 0?void 0:l.alias)!==null&&s!==void 0?s:this.command.category;f?c=`${(0,p.uppercaseFirstLetter)(f)}: ${h}`:c=h}return c}getKeybinding(){const l=this.keybindings.getKeybindingsForCommand(this.command.id);return l?l[0]:void 0}run(l){return l!==u.Mode.OPEN?!1:(setTimeout(()=>{this.commandService.executeCommand(this.command.id),this.commandRegistry.setRecentCommands([this.command]),this.workspaceService.setMostRecentlyUsedCommand(this.command.id)},50),!0)}};n.__decorate([(0,a.Autowired)(G.CommandService),n.__metadata("design:type",Object)],d.prototype,"commandService",void 0),n.__decorate([(0,a.Autowired)(G.CommandRegistry),n.__metadata("design:type",Object)],d.prototype,"commandRegistry",void 0),n.__decorate([(0,a.Autowired)(o.KeybindingRegistry),n.__metadata("design:type",Object)],d.prototype,"keybindings",void 0),n.__decorate([(0,a.Autowired)(b.IWorkspaceService),n.__metadata("design:type",Object)],d.prototype,"workspaceService",void 0),d=n.__decorate([(0,a.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Object])],d),e.CommandQuickOpenItem=d},65028:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QuickOpenFeatureContribution=e.CoreQuickOpenContribution=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(93899),g=t(74404),u=t(80490),G=t(90404),p=t(77116);let b=class{onStart(){for(const r of this.quickOpenContributionProvider.getContributions())r.registerQuickOpenHandlers(this.quickOpenHandlerRegistry)}};n.__decorate([(0,a.Autowired)(),n.__metadata("design:type",u.QuickOpenHandlerRegistry)],b.prototype,"quickOpenHandlerRegistry",void 0),n.__decorate([(0,a.Autowired)(u.QuickOpenContribution),n.__metadata("design:type",Object)],b.prototype,"quickOpenContributionProvider",void 0),b=n.__decorate([(0,o.Domain)(o.ClientAppContribution)],b),e.CoreQuickOpenContribution=b;let m=class{registerCommands(r){r.registerCommand(o.QUICK_OPEN_COMMANDS.OPEN,{execute:()=>this.prefixQuickOpenService.open(">")}),r.registerCommand(o.QUICK_OPEN_COMMANDS.OPEN_OUTLINE,{execute:()=>this.prefixQuickOpenService.open("@")}),r.registerCommand(o.QUICK_OPEN_COMMANDS.OPEN_VIEW,{execute:()=>this.prefixQuickOpenService.open("view ")}),r.registerCommand(o.QUICK_OPEN_COMMANDS.OPEN_WITH_COMMAND,{execute:l=>this.prefixQuickOpenService.open(">",l)})}registerKeybindings(r){r.registerKeybinding({command:o.QUICK_OPEN_COMMANDS.OPEN.id,keybinding:"ctrlcmd+shift+p"})}registerMenus(r){r.registerMenuItem(I.MenuId.MenubarViewMenu,{command:{id:o.QUICK_OPEN_COMMANDS.OPEN.id,label:(0,o.localize)("menu-bar.view.quick.command")},group:"0_primary"}),r.registerMenuItem(I.MenuId.MenubarViewMenu,{command:{id:o.LAYOUT_COMMANDS.OPEN_VIEW.id,label:o.LAYOUT_COMMANDS.OPEN_VIEW.label},group:"0_primary"})}registerQuickOpenHandlers(r){r.registerHandler(this.quickCommandHandler,{title:(0,o.localize)("quickopen.tab.command"),commandId:o.QUICK_OPEN_COMMANDS.OPEN.id,order:4}),r.registerHandler(this.helpQuickOpenHandler)}};n.__decorate([(0,a.Autowired)(a.INJECTOR_TOKEN),n.__metadata("design:type",a.Injector)],m.prototype,"injector",void 0),n.__decorate([(0,a.Autowired)(g.PrefixQuickOpenService),n.__metadata("design:type",Object)],m.prototype,"prefixQuickOpenService",void 0),n.__decorate([(0,a.Autowired)(),n.__metadata("design:type",G.QuickCommandHandler)],m.prototype,"quickCommandHandler",void 0),n.__decorate([(0,a.Autowired)(),n.__metadata("design:type",p.HelpQuickOpenHandler)],m.prototype,"helpQuickOpenHandler",void 0),m=n.__decorate([(0,o.Domain)(o.CommandContribution,o.KeybindingContribution,I.MenuContribution,u.QuickOpenContribution)],m),e.QuickOpenFeatureContribution=m},77116:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HelpQuickOpenHandler=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(74404),g=t(80490);let u=class{constructor(){this.prefix="?",this.description=""}init(){this.items=this.handlers.getHandlers().filter(p=>p.prefix!==this.prefix).sort((p,b)=>this.comparePrefix(p.prefix,b.prefix)).map(p=>new I.QuickOpenItem({label:p.prefix,description:p.description,run:b=>(b!==I.Mode.OPEN||this.quickOpenService.open(p.prefix),!1)}))}getModel(){return{onType:(p,b)=>{b(this.items)}}}getOptions(){return{}}onClose(){this.commandService.executeCommand(o.EDITOR_COMMANDS.FOCUS.id)}comparePrefix(p,b){return p.toLowerCase().localeCompare(b.toLowerCase())}};n.__decorate([(0,a.Autowired)(g.QuickOpenHandlerRegistry),n.__metadata("design:type",g.QuickOpenHandlerRegistry)],u.prototype,"handlers",void 0),n.__decorate([(0,a.Autowired)(I.PrefixQuickOpenService),n.__metadata("design:type",Object)],u.prototype,"quickOpenService",void 0),n.__decorate([(0,a.Autowired)(o.CommandService),n.__metadata("design:type",Object)],u.prototype,"commandService",void 0),u=n.__decorate([(0,a.Injectable)()],u),e.HelpQuickOpenHandler=u},43131:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KaitianQuickOpenControllerOpts=e.MonacoQuickOpenService=void 0;const n=t(85608),a=n.__importDefault(t(14041)),o=n.__importDefault(t(25873)),I=t(76003),g=t(41869),u=t(63373),G=t(68969),p=t(74404),b=t(70238),m=t(52596),d=t(65694),r=t(6399),l=t(98462);let s=class{constructor(){this.preLookFor=""}get inQuickOpenContextKey(){return this.contextKeyService.createKey("inQuickOpen",!1)}appendQuickOpenContainer(){var v;const f=(v=this.appConfig.designLayout)===null||v===void 0?void 0:v.quickOpenContainerStyle,W=document.querySelector("#ide-overlay");if(!W)throw new Error("ide-overlay is requried");const N=document.createElement("div"),Z={position:"fixed",top:0,right:"50%",zIndex:"1000000"};N.classList.add("quick-open-overlay"),W.appendChild(N);const y=this.container=document.createElement("quick-open-container");this.setContainerStyle(f||Z),N.appendChild(y)}open(v,f){const W=new c(v,this.keybindingRegistry,f);this.progressDispose=this.progressService.registerProgressIndicator(u.VIEW_CONTAINERS.QUICKPICK_PROGRESS),this.hideDecoration(),this.internalOpen(W)}hide(v){this.widget.hide(v),this.progressDispose.dispose()}internalOpen(v){var f;this.opts=v,this.widget.show(this.opts.prefix||"",{placeholder:v.inputAriaLabel,password:v.password,inputEnable:(f=v.enabled)!==null&&f!==void 0?f:!0,valueSelection:v.valueSelection,canSelectMany:v.canSelectMany,keepScrollPosition:v.keepScrollPosition,busy:v.busy,renderTab:v.renderTab,toggleTab:v.toggleTab}),this.inQuickOpenContextKey.set(!0)}updateOptions(v){this.opts.updateOptions(v),this.widget.updateOptions(v)}refresh(){this.onType(this.widget.inputValue)}get widget(){return this._widget?this._widget:(this.appendQuickOpenContainer(),this._widget=this.injector.get(l.QuickOpenWidget,[{onOk:()=>{this.previousActiveElement=void 0,this.onClose(!1)},onCancel:()=>{this.previousActiveElement instanceof HTMLElement&&this.previousActiveElement.focus(),this.previousActiveElement=void 0,this.onClose(!0)},onType:v=>this.onType(v||""),onFocusLost:()=>this.opts&&this.opts.ignoreFocusOut!==void 0?(this.opts.ignoreFocusOut===!1&&this.onClose(!0),this.opts.ignoreFocusOut):!1,onHide:()=>{this.inQuickOpenContextKey.set(!1)},onSelect:(v,f)=>{this.opts.onSelect&&this.opts.onSelect(v,f)},onConfirm:v=>{this.opts.onConfirm&&this.opts.onConfirm(v)},onKeyMods:v=>{this.opts.onKeyMods&&this.opts.onKeyMods(v)}}]),this.initWidgetView(this._widget),this._widget)}initWidgetView(v){o.default.createRoot(this.container).render(a.default.createElement(g.ConfigProvider,{value:this.appConfig},a.default.createElement(d.QuickOpenContext.Provider,{value:{widget:v}},a.default.createElement(r.QuickOpenView,null))))}setContainerStyle(v){var f;const W=Object.keys(v);for(const N of W)Object.prototype.hasOwnProperty.call((f=this.container)===null||f===void 0?void 0:f.style,N)&&(this.container.style[N]=v[N])}onClose(v){var f,W;(W=(f=this.opts).onClose)===null||W===void 0||W.call(f,v)}async onType(v){const f=this.opts;this.widget&&f.onType&&f.onType(v,W=>(this.preLookFor!==v&&this.opts.onChangeValue(v),this.preLookFor=v,this.widget.setInput(W,f.getAutoFocus(v),f.inputAriaLabel)))}onFocusLost(){return!!this.opts.ignoreFocusOut}showDecoration(v){this.widget.validateType=v}hideDecoration(){this.widget.validateType=void 0}};n.__decorate([(0,I.Autowired)(g.KeybindingRegistry),n.__metadata("design:type",Object)],s.prototype,"keybindingRegistry",void 0),n.__decorate([(0,I.Autowired)(b.MonacoContextKeyService),n.__metadata("design:type",b.MonacoContextKeyService)],s.prototype,"monacoContextKeyService",void 0),n.__decorate([(0,I.Autowired)(g.IContextKeyService),n.__metadata("design:type",Object)],s.prototype,"contextKeyService",void 0),n.__decorate([(0,I.Autowired)(I.INJECTOR_TOKEN),n.__metadata("design:type",I.Injector)],s.prototype,"injector",void 0),n.__decorate([(0,I.Autowired)(g.AppConfig),n.__metadata("design:type",Object)],s.prototype,"appConfig",void 0),n.__decorate([(0,I.Autowired)(G.IProgressService),n.__metadata("design:type",Object)],s.prototype,"progressService",void 0),s=n.__decorate([(0,I.Injectable)()],s),e.MonacoQuickOpenService=s;class c{constructor(v,f,W){this.model=v,this.keybindingRegistry=f,this.model=v,this.options=p.QuickOpenOptions.resolve(W)}get prefix(){return this.options.prefix}get inputAriaLabel(){return this.options.placeholder||""}get ignoreFocusOut(){return this.options.ignoreFocusOut}get password(){return this.options.password}get enabled(){return this.options.enabled}get valueSelection(){return this.options.valueSelection}get keepScrollPosition(){return this.options.keepScrollPosition}get busy(){return this.options.busy}get renderTab(){return this.options.renderTab}get toggleTab(){return this.options.toggleTab}get canSelectMany(){return this.options.canPickMany}onClose(v){this.options.onClose(v)}onSelect(v,f){this.options.onSelect(v,f)}onConfirm(v){this.options.onConfirm(v)}onType(v,f){this.model.onType(v,(W,N)=>{const Z=this.toOpenModel(v,W,N);f(Z)})}onKeyMods(v){this.options.onKeyMods&&this.options.onKeyMods(v)}onChangeValue(v){this.options.onChangeValue&&this.options.onChangeValue(v)}updateOptions(v){this.options=p.QuickOpenOptions.resolve(v)}compareEntries(v,f,W){const N=v.getHighlights()[0]||[],Z=f.getHighlights()[0]||[];if(N.length&&!Z.length)return-1;if(!N.length&&Z.length)return 1;const y=v.getLabel(),E=f.getLabel();return(0,g.compareAnything)(y,E,W)}toOpenModel(v,f,W){const N=v;this.options.skipPrefix&&(v=v.substring(this.options.skipPrefix).trim()),W&&W.getValidateInput&&(v=W.getValidateInput(v));const Z=f.filter(E=>!!this.fuzzyQuickOpenItem(E,v));this.options.fuzzySort&&Z.sort((E,R)=>this.compareEntries(E,R,v));const{getPlaceholderItem:y}=this.options;return!Z.length&&y&&Z.push(y(v,N)),{items:Z,actionProvider:W}}fuzzyQuickOpenItem(v,f){const{fuzzyMatchLabel:W,fuzzyMatchDescription:N,fuzzyMatchDetail:Z}=this.options,y=W?(0,m.matchesFuzzyIconAware)(f,(0,m.parseLabelWithIcons)(v.getLabel()||""),typeof W=="object"&&W.enableSeparateSubstringMatching):v.getLabelHighlights(),E=this.options.fuzzyMatchDescription?(0,m.matchesFuzzyIconAware)(f,(0,m.parseLabelWithIcons)(v.getDescription()||""),typeof N=="object"&&N.enableSeparateSubstringMatching):v.getDescriptionHighlights(),R=this.options.fuzzyMatchDetail?(0,m.matchesFuzzyIconAware)(f,(0,m.parseLabelWithIcons)(v.getDetail()||""),typeof Z=="object"&&Z.enableSeparateSubstringMatching):v.getDetailHighlights();if(!(f&&!y&&!E&&(!R||R.length===0)&&!this.options.showItemsWithoutHighlight))return v.setHighlights(y||[],E||[],R||[]),v}getAutoFocus(v){if(this.options.selectIndex){const f=this.options.selectIndex(v);if(f>=0)return{autoFocusIndex:f}}return{autoFocusFirstEntry:!0,autoFocusPrefixMatch:v}}}e.KaitianQuickOpenControllerOpts=c},65694:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QuickOpenContext=void 0;const a=t(85608).__importDefault(t(14041));e.QuickOpenContext=a.default.createContext({widget:null})},6399:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QuickOpenView=e.QuickOpenProgress=e.QuickOpenList=e.QuickOpenInput=e.QuickOpenHeader=void 0;const n=t(85608),a=n.__importDefault(t(53373)),o=t(25150),I=n.__importDefault(t(14041)),g=t(97267),u=t(41869),G=t(63373),p=t(68969),b=t(68974),m=t(74404),d=t(89647),r=t(85139),l=t(70716),s=t(52644),c=t(78245),h=t(65694),v=t(50426),f=n.__importDefault(t(91449)),W=(0,o.observer)(Z=>{var{button:y}=Z,E=n.__rest(Z,["button"]);return I.default.createElement(g.Button,Object.assign({},E,{key:y.tooltip,type:"icon",iconClass:y.iconClass,title:y.tooltip}))});e.QuickOpenHeader=(0,o.observer)(()=>{const Z=(0,u.useInjectable)(v.QuickTitleBar),y=I.default.useMemo(()=>{const R=()=>Z.step&&Z.totalSteps?`${Z.step}/${Z.totalSteps}`:Z.step?String(Z.step):"";return Z.title&&Z.step?`${Z.title} (${R()})`:Z.title?Z.title:Z.step?R():""},[Z.title,Z.step,Z.totalSteps]),E=I.default.useCallback((R,A)=>{R.stopPropagation(),Z.fireDidTriggerButton(A)},[Z.fireDidTriggerButton]);return Z.isAttached?I.default.createElement("div",{className:f.default.title_bar},I.default.createElement("div",{className:f.default.title_bar_button},Z.leftButtons.map(R=>I.default.createElement(W,{onMouseDown:A=>E(A,R),button:R}))),I.default.createElement("div",null,y),I.default.createElement("div",{className:f.default.title_bar_button},Z.rightButtons.map(R=>I.default.createElement(W,{onMouseDown:A=>E(A,R),button:R})))):null}),e.QuickOpenInput=(0,o.observer)(()=>{const{widget:Z}=I.default.useContext(h.QuickOpenContext),y=I.default.useRef(null),E=I.default.useCallback(V=>{const Y=V.target.value;Z.setInputValue(Y),Z.callbacks.onType(Y)},[Z]),R=I.default.useMemo(()=>Z.isPassword?"password":"text",[Z.isPassword]);I.default.useEffect(()=>{setTimeout(()=>{var V;(V=y.current)===null||V===void 0||V.focus()},0)},[Z.items]),I.default.useEffect(()=>{var V;if(Z.inputValue&&Z.valueSelection){const[Y,_]=Z.valueSelection;(V=y.current)===null||V===void 0||V.setSelectionRange(Y,_)}},[Z.valueSelection]);const A=I.default.useMemo(()=>{if(!(0,u.isUndefined)(Z.validateType))return{type:Z.validateType,message:""}},[Z.validateType]),w=I.default.useCallback(V=>{const Y=V.target.checked;for(const _ of Z.items)_.checked=Y},[]),F=I.default.useCallback(()=>{Z.callbacks.onConfirm(Z.items.filter(V=>V.checked)),Z.hide(m.HideReason.ELEMENT_SELECTED)},[]);return I.default.createElement("div",{tabIndex:0,className:f.default.input},Z.canSelectMany&&I.default.createElement(g.CheckBox,{checked:Z.selectAll,wrapTabIndex:0,onChange:w}),I.default.createElement(g.ValidateInput,{validateMessage:A,ref:y,type:R,"aria-label":Z.inputPlaceholder,placeholder:Z.inputPlaceholder,value:Z.inputValue,readOnly:!Z.inputEnable,onChange:E,id:G.VIEW_CONTAINERS.QUICKPICK_INPUT}),Z.canSelectMany&&I.default.createElement(g.Button,{className:f.default.input_button,onClick:F},(0,u.localize)("ButtonOK")))});const N=(0,o.observer)(({data:Z,index:y})=>{const{widget:E}=I.default.useContext(h.QuickOpenContext),R=(0,u.useInjectable)(c.QuickOpenItemService),A=I.default.useMemo(()=>Z.getLabel(),[Z]),w=I.default.useMemo(()=>Z.getDescription(),[Z]),F=I.default.useMemo(()=>Z.getDetail(),[Z]),V=I.default.useMemo(()=>Z.getIconClass(),[Z]),Y=I.default.useMemo(()=>Z.getKeybinding(),[Z]),_=I.default.useMemo(()=>Z.getGroupLabel(),[Z]),H=I.default.useMemo(()=>Z.showBorder(),[Z]),S=I.default.useMemo(()=>R.getButtons(Z.getButtons()),[Z]),[X,Q,O]=I.default.useMemo(()=>Z.getHighlights(),[Z]),[M,T]=I.default.useState(!1),x=I.default.useMemo(()=>{const k=E.actionProvider;if(k&&k.hasActions(Z))return k.getActions(Z)},[Z]),B=I.default.useCallback(k=>{E.canSelectMany?(Z.checked=!Z.checked,k.stopPropagation()):(k.button===1?Z.run(m.QuickOpenMode.OPEN_IN_BACKGROUND):Z.run(m.QuickOpenMode.OPEN))&&E.hide(m.HideReason.ELEMENT_SELECTED)},[Z]),D=I.default.useCallback(k=>{k.run(Z),E.hide(m.HideReason.ELEMENT_SELECTED)},[Z]),J=I.default.useCallback((k,z)=>{k.stopPropagation(),R.fireDidTriggerItemButton(y,z)},[Z]);return I.default.createElement("div",{id:G.VIEW_CONTAINERS.QUICKPICK_ITEM,tabIndex:0,className:(0,a.default)({[f.default.item_selected]:E.selectIndex===y,[f.default.item_border]:H},f.default.item),onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),"aria-label":A},E.canSelectMany&&I.default.createElement(g.CheckBox,{wrapTabIndex:0,checked:Z.checked,onChange:k=>Z.checked=k.target.checked}),I.default.createElement("div",{tabIndex:0,className:f.default.item_label_container,onMouseDown:B},I.default.createElement("div",{className:f.default.item_label},V&&I.default.createElement("span",{className:(0,a.default)(f.default.item_icon,V)}),I.default.createElement(l.HighlightLabel,{className:f.default.item_label_name,labelClassName:f.default.label_icon_container,labelIconClassName:f.default.item_label_name_icon,hightLightClassName:(0,a.default)(f.default.item_label_highlight),text:A,highlights:X}),w&&I.default.createElement(l.HighlightLabel,{className:f.default.item_label_description,labelClassName:(0,a.default)(f.default.label_icon_container,f.default.item_label_description_label),labelIconClassName:(0,a.default)(f.default.label_has_icon,f.default.item_label_description_icon),hightLightClassName:(0,a.default)(f.default.item_label_description_highlight),text:w,highlights:Q})),F&&I.default.createElement(l.HighlightLabel,{OutElementType:"div",className:f.default.item_label_detail,labelClassName:(0,a.default)(f.default.label_icon_container,f.default.item_label_description_label),labelIconClassName:(0,a.default)(f.default.label_has_icon,f.default.item_label_detail_icon),hightLightClassName:(0,a.default)(f.default.item_label_description_highlight),text:F,highlights:O})),Y&&I.default.createElement(s.KeybindingView,{keybinding:Y}),_&&I.default.createElement("span",{title:_,className:f.default.item_group_label},_),x?.map(k=>I.default.createElement("span",{key:k.id,onMouseDown:()=>D(k),title:k.tooltip||k.label,className:(0,a.default)(f.default.item_action,k.class)})),(M||E.selectIndex===y)&&S?.map(k=>I.default.createElement(W,{onMouseDown:z=>J(z,k),button:k})))});e.QuickOpenList=(0,o.observer)(({onReady:Z,onScroll:y})=>{const{widget:E}=I.default.useContext(h.QuickOpenContext),R=(0,u.useDesignStyles)(f.default.quickopen_list,"quickopen_list"),A=I.default.useCallback(w=>{const F=E.items[w];return F?.getDetail()?44:22},[E.items]);return E.items.length>0?I.default.createElement(g.RecycleList,{onReady:Z,onScroll:y,className:(0,a.default)(R,{[f.default.validate_error]:E.validateType===g.VALIDATE_TYPE.ERROR,[f.default.validate_warning]:E.validateType===g.VALIDATE_TYPE.WARNING}),data:E.items,template:N,getSize:A,maxHeight:E.items.length?E.MAX_HEIGHT:0,hiddenHorizontalScrollbar:!0}):null}),e.QuickOpenProgress=(0,o.observer)(()=>{const{widget:Z}=I.default.useContext(h.QuickOpenContext),E=(0,u.useInjectable)(p.IProgressService).getIndicator(G.VIEW_CONTAINERS.QUICKPICK_PROGRESS);return I.default.useEffect(()=>{Z.updateProgressStatus(!!Z.busy)},[Z.busy]),I.default.createElement("div",{id:G.VIEW_CONTAINERS.QUICKPICK_PROGRESS,className:f.default.progress_bar},I.default.createElement(b.ProgressBar,{progressModel:E.progressModel}))}),e.QuickOpenView=(0,o.observer)(()=>{var Z;const{widget:y}=I.default.useContext(h.QuickOpenContext),E=I.default.useRef(),R=I.default.useRef(0),A=I.default.useCallback(({relatedTarget:_,currentTarget:H})=>{if(_===null)return!1;let S=_.parentNode;for(;S!==null;){if(S===H)return!0;S=S.parentNode}return!1},[]),w=I.default.useCallback(_=>{A(_)||y.blur()},[y]),F=I.default.useCallback(_=>{E.current=_},[y]),V=I.default.useCallback(_=>{R.current=_.scrollOffset},[y]);I.default.useEffect(()=>{const{items:_,autoFocus:H}=y;if(H){if(H.autoFocusPrefixMatch){let S,X;const Q=H.autoFocusPrefixMatch,O=Q.toLowerCase();for(const T of _){const x=T.getLabel()||"";if(!S&&x.indexOf(Q)===0?S=T:!X&&x.toLowerCase().indexOf(O)===0&&(X=T),S&&X)break}const M=S||X;if(M){const T=_.indexOf(M);y.setSelectIndex(T);return}}H.autoFocusFirstEntry?y.setSelectIndex(0):typeof H.autoFocusIndex=="number"?_.length>H.autoFocusIndex&&y.setSelectIndex(H.autoFocusIndex):H.autoFocusSecondEntry?_.length>1&&y.setSelectIndex(1):H.autoFocusLastEntry&&_.length>1&&y.setSelectIndex(_.length-1)}},[y.items,y.autoFocus]),I.default.useEffect(()=>{var _,H;if(y.keepScrollPosition?(_=E.current)===null||_===void 0||_.scrollTo(R.current):(H=E.current)===null||H===void 0||H.scrollToIndex(y.selectIndex,"smart"),y.items.length===0)return;const S=y.items[y.selectIndex];S&&(S.run(m.QuickOpenMode.PREVIEW),y.callbacks.onSelect(S,y.selectIndex))},[y.items,y.selectIndex,y.keepScrollPosition]);const Y=I.default.useCallback(_=>{if(d.KEY_CODE_MAP[_.nativeEvent.keyCode]===r.KeyCode.KEY_IN_COMPOSITION)return;const{key:H}=u.KeyCode.createKeyCode(_.nativeEvent);if(!H)return;const S=y.items.length;switch(H.keyCode){case u.Key.ARROW_UP.keyCode:{_.preventDefault(),_.stopPropagation();const X=y.selectIndex-1;y.setSelectIndex((S+X%S)%S);break}case u.Key.ARROW_DOWN.keyCode:{_.preventDefault(),_.stopPropagation();const X=y.selectIndex+1;y.setSelectIndex(X%S);break}case u.Key.ESCAPE.keyCode:{_.preventDefault(),_.stopPropagation(),y.hide(m.HideReason.CANCELED);break}case u.Key.ENTER.keyCode:{_.preventDefault(),_.stopPropagation();const X=y.items[y.selectIndex];if(!X)return;X.run(m.QuickOpenMode.OPEN)&&y.hide(m.HideReason.ELEMENT_SELECTED);break}case u.Key.TAB.keyCode:{y.toggleTab&&(_.preventDefault(),_.stopPropagation(),y.toggleTab());break}}},[]);return y.isShow?I.default.createElement("div",{id:G.VIEW_CONTAINERS.QUICKPICK,tabIndex:0,className:f.default.container,onKeyDown:Y,onBlur:w},I.default.createElement(e.QuickOpenHeader,null),I.default.createElement(e.QuickOpenInput,null),I.default.createElement(e.QuickOpenProgress,null),(Z=y.renderTab)===null||Z===void 0?void 0:Z.call(y),I.default.createElement(e.QuickOpenList,{onReady:F,onScroll:V})):null})},98462:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QuickOpenWidget=void 0;const n=t(85608),a=t(83794),o=t(76003),I=t(41869),g=t(81878),u=t(63373),G=t(68969);let p=class{get isShow(){return this._isShow}get isPassword(){return this._isPassword}get selectAll(){return this.items.every(m=>m.checked)}get valueSelection(){return this._valueSelection}get canSelectMany(){return this._canSelectMany}get items(){return this._items||[]}get inputPlaceholder(){return this._inputPlaceholder}get inputEnable(){return this._inputEnable}get actionProvider(){return this._actionProvider}get autoFocus(){return this._autoFocus}get keepScrollPosition(){return this._keepScrollPosition}get busy(){return this._busy}constructor(m){this.callbacks=m,this.MAX_HEIGHT=440,this.inputValue="",this._isShow=!1,this._items=a.observable.array([]),this._actionProvider=null,this._autoFocus=null,this._isPassword=!1,this._keepScrollPosition=!1,this._busy=!1,this.selectIndex=0,this.modifierListeners=new I.DisposableCollection,(0,a.makeObservable)(this)}setSelectIndex(m){this.selectIndex=m}setInputValue(m){this.inputValue=m}show(m,d){this._isShow=!0,this.inputValue=m,this._inputPlaceholder=d.placeholder,this._isPassword=!!d.password,this._inputEnable=d.inputEnable,this._valueSelection=d.valueSelection,this._canSelectMany=d.canSelectMany,this._keepScrollPosition=!!d.keepScrollPosition,this._busy=!!d.busy,this.renderTab=d.renderTab,this.toggleTab=d.toggleTab,this.callbacks.onType(m),this.registerKeyModsListeners()}hide(m){this.modifierListeners.disposed||this.modifierListeners.dispose(),this._isShow&&(this._isShow=!1,this._items=[],m===I.HideReason.ELEMENT_SELECTED?this.callbacks.onOk():this.callbacks.onCancel(),this.callbacks.onHide(m))}blur(){if(!this._isShow)return;this.callbacks.onFocusLost()||this.hide(I.HideReason.FOCUS_LOST)}setInput(m,d,r){this._items=m.items,this._actionProvider=m.actionProvider||null,this._autoFocus=d}updateOptions(m){Object.keys(m).forEach(d=>{const r=`_${d}`;Object.hasOwn(this,r)&&(this[r]=m[d])})}updateProgressStatus(m){m===!0?this.progressService.withProgress({location:u.VIEW_CONTAINERS.QUICKPICK_PROGRESS},()=>new Promise(d=>this.progressResolve=d)):this.progressResolve&&(this.progressResolve(),this.progressResolve=void 0)}registerKeyModsListeners(){const m=d=>{const r={ctrlCmd:d.ctrlKey||d.metaKey,alt:d.altKey};this.callbacks.onKeyMods(r)};this.modifierListeners.push((0,I.addDisposableListener)(window,I.EventType.KEY_DOWN,m,!0)),this.modifierListeners.push((0,I.addDisposableListener)(window,I.EventType.KEY_UP,m,!0)),this.modifierListeners.push((0,I.addDisposableListener)(window,I.EventType.MOUSE_DOWN,m,!0))}};n.__decorate([a.observable,n.__metadata("design:type",Object)],p.prototype,"inputValue",void 0),n.__decorate([a.observable,n.__metadata("design:type",Object)],p.prototype,"_isShow",void 0),n.__decorate([a.observable,n.__metadata("design:type",Number)],p.prototype,"validateType",void 0),n.__decorate([a.observable.shallow,n.__metadata("design:type",Array)],p.prototype,"_items",void 0),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],p.prototype,"isShow",null),n.__decorate([a.observable.ref,n.__metadata("design:type",Object)],p.prototype,"_actionProvider",void 0),n.__decorate([a.observable.ref,n.__metadata("design:type",Object)],p.prototype,"_autoFocus",void 0),n.__decorate([a.observable,n.__metadata("design:type",Object)],p.prototype,"_isPassword",void 0),n.__decorate([a.observable,n.__metadata("design:type",Object)],p.prototype,"_keepScrollPosition",void 0),n.__decorate([a.observable,n.__metadata("design:type",Object)],p.prototype,"_busy",void 0),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],p.prototype,"isPassword",null),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],p.prototype,"selectAll",null),n.__decorate([a.observable,n.__metadata("design:type",Array)],p.prototype,"_valueSelection",void 0),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],p.prototype,"valueSelection",null),n.__decorate([a.observable,n.__metadata("design:type",Boolean)],p.prototype,"_canSelectMany",void 0),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],p.prototype,"canSelectMany",null),n.__decorate([a.observable,n.__metadata("design:type",Object)],p.prototype,"selectIndex",void 0),n.__decorate([a.computed,n.__metadata("design:type",Array),n.__metadata("design:paramtypes",[])],p.prototype,"items",null),n.__decorate([a.observable,n.__metadata("design:type",String)],p.prototype,"_inputPlaceholder",void 0),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],p.prototype,"inputPlaceholder",null),n.__decorate([a.observable,n.__metadata("design:type",Boolean)],p.prototype,"_inputEnable",void 0),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],p.prototype,"inputEnable",null),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],p.prototype,"actionProvider",null),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],p.prototype,"autoFocus",null),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],p.prototype,"keepScrollPosition",null),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],p.prototype,"busy",null),n.__decorate([(0,o.Autowired)(G.IProgressService),n.__metadata("design:type",Object)],p.prototype,"progressService",void 0),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[Number]),n.__metadata("design:returntype",void 0)],p.prototype,"setSelectIndex",null),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[String]),n.__metadata("design:returntype",void 0)],p.prototype,"setInputValue",null),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[String,Object]),n.__metadata("design:returntype",void 0)],p.prototype,"show",null),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[Number]),n.__metadata("design:returntype",void 0)],p.prototype,"hide",null),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",void 0)],p.prototype,"blur",null),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[Object,Object,String]),n.__metadata("design:returntype",void 0)],p.prototype,"setInput",null),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[Object]),n.__metadata("design:returntype",void 0)],p.prototype,"updateOptions",null),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[Boolean]),n.__metadata("design:returntype",void 0)],p.prototype,"updateProgressStatus",null),p=n.__decorate([(0,o.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object])],p),e.QuickOpenWidget=p},13978:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QuickPickServiceImpl=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(74404),g=t(43718),u=t(50426);let G=class{constructor(){this.onDidAcceptEmitter=new g.Emitter,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActiveItemsEmitter=new g.Emitter,this.onDidChangeActiveItems=this.onDidChangeActiveItemsEmitter.event}async show(b,m){return new Promise(d=>{const r=this.toItems(b,d);m&&this.quickTitleBar.shouldShowTitleBar(m.title,m.step,m.buttons)&&this.quickTitleBar.attachTitleBar(m.title,m.step,m.totalSteps,m.buttons);const l=m&&m.value?m.value:"";this.quickOpenService.open({onType:(s,c)=>{c(r),this.onDidChangeActiveItemsEmitter.fire(r)}},Object.assign({onClose:()=>{this.quickTitleBar.hide(),d(void 0)},onConfirm:s=>{this.quickTitleBar.hide(),d(s.map(c=>c.getValue()))},fuzzyMatchLabel:!0,fuzzyMatchDescription:!0,prefix:l},m))})}hide(b){this.quickOpenService.hide(b)}toItems(b,m){const d=[];for(const r of b){const l=this.toItemOptions(r,m);d.push(new I.QuickOpenItem(l))}return d}toItemOptions(b,m){let d=typeof b=="string"?b:b.label,r=typeof b=="string"?void 0:b.iconClass;const l=typeof b=="string"?b:b.value,s=typeof b=="string"?void 0:b.description,c=typeof b=="string"?void 0:b.detail,h=typeof b=="string"?void 0:b.groupLabel,v=typeof b=="string"?void 0:b.showBorder,f=typeof b=="string"?void 0:b.buttons,[W,N]=(0,o.getIconClass)(d);return W&&(r=(0,o.getIcon)(W)||(0,o.getExternalIcon)(W),d=` ${N}`),{label:d,description:s,detail:c,iconClass:r,groupLabel:h,showBorder:v,buttons:f,run:Z=>Z!==I.Mode.OPEN?!1:(m(l),this.onDidAcceptEmitter.fire(void 0),!0),value:l}}};n.__decorate([(0,a.Autowired)(u.QuickTitleBar),n.__metadata("design:type",u.QuickTitleBar)],G.prototype,"quickTitleBar",void 0),n.__decorate([(0,a.Autowired)(I.QuickOpenService),n.__metadata("design:type",Object)],G.prototype,"quickOpenService",void 0),G=n.__decorate([(0,a.Injectable)()],G),e.QuickPickServiceImpl=G},50426:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QuickTitleBar=void 0;const n=t(85608),a=t(83794),o=t(76003),I=t(74404),g=t(40827),u=t(43718);t(50279);const G=t(52416),p=t(89802);let b=class{get title(){return this._title}constructor(){this.onDidTriggerButtonEmitter=new u.Emitter,this._buttons=[],(0,a.makeObservable)(this)}get onDidTriggerButton(){return this.onDidTriggerButtonEmitter.event}fireDidTriggerButton(d){this.onDidTriggerButtonEmitter.fire(d)}get isAttached(){return this._isAttached}get step(){return this._step}get totalSteps(){return this._totalSteps}get buttons(){return this._buttons===void 0||this._buttons.length===0?[]:this._buttons.map((d,r)=>{const l=(0,p.iconPath2URI)(d.iconPath,this.themeService.getCurrentThemeSync().type),s=l&&this.staticResourceService.resolveStaticResource(l).toString(),c=s&&this.iconService.fromIcon("",s,G.IconType.Background);return Object.assign(Object.assign({},d),{iconClass:c,handler:r})})}get leftButtons(){return this.buttons.filter(d=>d.side===I.QuickTitleButtonSide.LEFT)}get rightButtons(){return this.buttons.filter(d=>d.side===I.QuickTitleButtonSide.RIGHT||typeof d.side>"u")}attachTitleBar(d,r,l,s){this._title=d,this._step=r,this._totalSteps=l,s&&(this._buttons=s),this._isAttached=!0}hide(){this._title=void 0,this._buttons=[],this._step=void 0,this._totalSteps=void 0,this._isAttached=!1}shouldShowTitleBar(d,r,l){return!(0,u.isUndefined)(d)||!(0,u.isUndefined)(r)||!(0,u.isUndefined)(l)&&!!l.length}};n.__decorate([(0,o.Autowired)(G.IThemeService),n.__metadata("design:type",Object)],b.prototype,"themeService",void 0),n.__decorate([(0,o.Autowired)(),n.__metadata("design:type",g.StaticResourceService)],b.prototype,"staticResourceService",void 0),n.__decorate([(0,o.Autowired)(G.IIconService),n.__metadata("design:type",Object)],b.prototype,"iconService",void 0),n.__decorate([a.observable,n.__metadata("design:type",Boolean)],b.prototype,"_isAttached",void 0),n.__decorate([a.observable,n.__metadata("design:type",Object)],b.prototype,"_title",void 0),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],b.prototype,"title",null),n.__decorate([a.observable,n.__metadata("design:type",Object)],b.prototype,"_step",void 0),n.__decorate([a.observable,n.__metadata("design:type",Object)],b.prototype,"_totalSteps",void 0),n.__decorate([a.observable.shallow,n.__metadata("design:type",Array)],b.prototype,"_buttons",void 0),n.__decorate([a.computed,n.__metadata("design:type",Boolean),n.__metadata("design:paramtypes",[])],b.prototype,"isAttached",null),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],b.prototype,"step",null),n.__decorate([a.computed,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],b.prototype,"totalSteps",null),n.__decorate([a.computed,n.__metadata("design:type",Array),n.__metadata("design:paramtypes",[])],b.prototype,"buttons",null),n.__decorate([a.computed,n.__metadata("design:type",Array),n.__metadata("design:paramtypes",[])],b.prototype,"leftButtons",null),n.__decorate([a.computed,n.__metadata("design:type",Array),n.__metadata("design:paramtypes",[])],b.prototype,"rightButtons",null),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[Object,Object,Object,Object]),n.__metadata("design:returntype",void 0)],b.prototype,"attachTitleBar",null),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[]),n.__metadata("design:returntype",void 0)],b.prototype,"hide",null),b=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],b),e.QuickTitleBar=b},44854:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InputBoxImpl=void 0;const n=t(85608),a=t(76003),o=t(81878),I=t(74404),g=t(43718),u=t(50426);let G=class{constructor(b){this._options={},this.onDidAcceptEmitter=new g.Emitter,this.onDidChangeValueEmitter=new g.Emitter,this.onDidTriggerButtonEmitter=new g.Emitter,this.onDidHideEmitter=new g.Emitter,this._options=b}shouldUpdate(b,m){return m.value!==b.value||m.prompt!==b.prompt||m.placeHolder!==b.placeHolder||m.password!==b.password||m.ignoreFocusOut!==b.ignoreFocusOut||m.enabled!==b.enabled||m.valueSelection!==b.valueSelection||m.title!==b.title||m.step!==b.step||m.totalSteps!==b.totalSteps||m.buttons!==b.buttons||m.validationMessage!==b.validationMessage||m.validationType!==b.validationType||m.busy!==b.busy}updateOptions(b,m=!1){if(!b)return;const d=Object.assign({},this._options);this._options=Object.assign(Object.assign({},this._options),b),!m&&this.shouldUpdate(b,d)&&(this.quickOpenService.updateOptions(b),this.refresh())}refresh(){this.quickOpenService.refresh()}get options(){return this._options}set options(b){this._options=b}open(){let b="",m=!1;this.quickTitleBar.onDidTriggerButton(d=>{this.onDidTriggerButtonEmitter.fire(d.handler)}),this.quickOpenService.open({onType:async(d,r)=>{var l;if(b!==d){if(b=d,this.getDerivedOptionsFromValue){const f=await this.getDerivedOptionsFromValue(d);this.updateOptions(f,!0)}this.onDidChangeValueEmitter.fire(d),m=!0}let s=this.options.prompt;const c=(0,g.localize)("quickopen.quickinput.prompt");this.options&&this.quickTitleBar.shouldShowTitleBar(this.options.title,this.options.step,this.options.buttons)&&this.quickTitleBar.attachTitleBar(this.options.title,this.options.step,this.options.totalSteps,this.options.buttons);const h=this.options.validationMessage;h?this.quickOpenService.showDecoration((l=this.options.validationType)!==null&&l!==void 0?l:o.VALIDATE_TYPE.ERROR):this.quickOpenService.hideDecoration(),s=h||s;const v={run:f=>m&&!h&&f===I.Mode.OPEN&&(this.onDidAcceptEmitter.fire(d),this.options.hideOnDidAccept)?(this.quickTitleBar.hide(),!0):!1};s?(v.label=s,v.detail=c):v.label=c,r([new I.QuickOpenItem(v)])}},{prefix:this.options.value,placeholder:this.options.placeHolder,password:this.options.password,ignoreFocusOut:this.options.ignoreFocusOut,enabled:this.options.enabled,valueSelection:this.options.valueSelection,busy:this.options.busy,onClose:d=>{d&&this.onDidHideEmitter.fire(),this.quickTitleBar.hide()}})}dispose(){this.onDidAcceptEmitter.dispose(),this.onDidChangeValueEmitter.dispose(),this.onDidHideEmitter.dispose(),this.onDidTriggerButtonEmitter.dispose()}hide(){this.quickOpenService.hideDecoration(),this.quickOpenService.hide()}get onDidAccept(){return this.onDidAcceptEmitter.event}get onDidChangeValue(){return this.onDidChangeValueEmitter.event}get onDidTriggerButton(){return this.onDidTriggerButtonEmitter.event}get onDidHide(){return this.onDidHideEmitter.event}};n.__decorate([(0,a.Autowired)(I.QuickOpenService),n.__metadata("design:type",Object)],G.prototype,"quickOpenService",void 0),n.__decorate([(0,a.Autowired)(u.QuickTitleBar),n.__metadata("design:type",u.QuickTitleBar)],G.prototype,"quickTitleBar",void 0),G=n.__decorate([(0,a.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object])],G),e.InputBoxImpl=G},89802:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.iconPath2URI=void 0;const n=t(43718);function a(o,I){if(n.URI.isUri(o))return o;if((o.dark||o.light)&&I)return I==="dark"?new n.URI(o.dark.toString()):new n.URI(o.light.toString())}e.iconPath2URI=a},74435:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=t(85608);n.__exportStar(t(74404),e),n.__exportStar(t(11143),e)},97821:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),t(85608).__exportStar(t(74435),e)},57492:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMProviderList=void 0;const n=t(85608),a=n.__importDefault(t(53373)),o=n.__importStar(t(14041)),I=t(97267),g=t(41869),u=t(93899),G=t(40293),p=t(92237),b=t(36367),m=n.__importDefault(t(38201)),d=l=>{var{repository:s,selected:c}=l,h=n.__rest(l,["repository","selected"]);const{provider:v}=s,{title:f,type:W}=(0,b.getSCMRepositoryDesc)(s),N=(0,g.useInjectable)(G.IStatusBarService),Z=(v.statusBarCommands||[]).map((y,E)=>N.getElementConfig(`scm.repo.${E}`,{text:y.title,command:y.id,arguments:y.arguments,tooltip:y.tooltip,iconset:"octicon"}));return o.default.createElement("div",Object.assign({className:(0,a.default)(m.default.provider,{[m.default.selected]:c})},h),o.default.createElement("div",{className:m.default.info},o.default.createElement("div",{className:m.default.title},f,"\xA0"),o.default.createElement("div",{className:m.default.type},W,"\xA0"),v.count&&v.count>0?o.default.createElement(I.Badge,null,v.count):null),o.default.createElement("div",{className:m.default.toolbar},Z.map(y=>o.default.createElement(p.StatusBarItem,Object.assign({key:y.id,entryId:y.id,className:m.default.status},y)))))},r=({repositoryList:l,selectedRepository:s})=>{if(!s)return null;const c=(0,g.useInjectable)(u.ICtxMenuRenderer),h=(0,g.useInjectable)(u.AbstractContextMenuService),v=(0,o.useCallback)(W=>{W.setSelected(!0),W.focus()},[]),f=(0,o.useCallback)((W,N)=>{N.preventDefault(),N.stopPropagation();const{x:Z,y}=N.nativeEvent,E=h.createMenu({id:u.MenuId.SCMSourceControl}),R=E.getMergedMenuNodes();E.dispose(),c.show({anchor:{x:Z,y},menuNodes:R,args:[W.provider.toJSON()]})},[]);return o.default.createElement("div",{className:m.default.scmSelect},l.map(W=>o.default.createElement(d,{key:W.provider.id,selected:W.provider.id===s.provider.id,onClick:v.bind(null,W),onContextMenu:f.bind(null,W),repository:W})))};e.SCMProviderList=r,e.SCMProviderList.displayName="SCMProviderList"},37751:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMResourceInput=e.convertValidationType=void 0;const n=t(85608),a=n.__importStar(t(14041)),o=t(41869),I=t(25918),g=t(40525),u=t(43718),G=t(5567),p=t(52416),b=t(64964),m=n.__importDefault(t(87906));function d(s){return["info","warning","error"][s]}e.convertValidationType=d;function r(s){return o.strings.format(s.input.placeholder,o.isMacintosh?"\u2318Enter":"Ctrl+Enter")}const l=({repository:s,menus:c})=>{const h=(0,o.useInjectable)(u.CommandService),v=(0,o.useInjectable)(p.IIconService),f=(0,o.useDesignStyles)(m.default.scmMenu,"scmMenu"),[W,N]=(0,a.useState)(""),[Z,y]=(0,a.useState)(""),[E,R]=(0,a.useState)(!0),[A,w]=(0,a.useState)({}),F=(0,a.useCallback)(X=>{s.input.value=X},[s]),V=(0,a.useCallback)(X=>{const{addonAfter:Q,addonBefore:O}=X,M=Q,T=O;w(Object.assign(Object.assign(Object.assign({},X),Q?{addonAfter:(0,u.isFunction)(M)?a.default.createElement(M,null):Q}:{}),O?{addonBefore:(0,u.isFunction)(T)?a.default.createElement(T,null):O}:{}))},[s.input.props]);(0,a.useEffect)(()=>{s.input.props&&V(s.input.props)},[s.input.props]),(0,a.useEffect)(()=>{const X=new o.DisposableStore;return X.add(s.input.onDidChangeProps(Q=>{V(Q)})),X.add(s.input.onDidChange(Q=>{N(Q)})),X.add(s.input.onDidChangePlaceholder(()=>{y(r(s))})),X.add(s.input.onDidChangeEnablement(Q=>{R(Q)})),y(r(s)),()=>{X.dispose()}},[s]);const Y=(0,a.useCallback)(()=>{if(!s||!s.provider.acceptInputCommand)return;const{id:X,arguments:Q=[]}=s.provider.acceptInputCommand;X&&h.executeCommand(X,...Q)},[s]),{onKeyDown:_,onKeyUp:H}=(0,g.useHotKey)([o.isMacintosh?"command":"ctrl","enter"],Y),S=s&&s.provider&&c;return a.default.createElement(a.default.Fragment,null,a.default.createElement("div",{className:m.default.scmHeader},a.default.createElement(G.AutoFocusedInput,Object.assign({containerId:b.scmContainerId,className:m.default.scmInput,placeholder:Z,value:W,disabled:!E,onKeyDown:X=>_(X.keyCode),onKeyUp:H,onValueChange:F},A))),S&&a.default.createElement(I.InlineMenuBar,{className:f,context:[s.provider,W],type:"button",moreIcon:"down",iconService:v,regroup:(X,Q)=>[[X[0]].filter(Boolean),[...X.slice(1),...Q]],menus:c}))};e.SCMResourceInput=l,e.SCMResourceInput.displayName="SCMResourceInput"},24748:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMResourceTree=e.TREE_FIELD_NAME=void 0;const n=t(85608),a=n.__importDefault(t(53373)),o=n.__importStar(t(14041)),I=t(97267),g=t(41869),u=t(48560),G=t(49914),p=n.__importDefault(t(91873)),b=t(11579),m=t(74568),d=t(63451);e.TREE_FIELD_NAME="SCM_TREE_TREE_FIELD",e.SCMResourceTree=(0,o.memo)(({height:s})=>{const[c,h]=(0,o.useState)(!1),[v,f]=(0,o.useState)(),W=(0,o.useRef)(!1),N=(0,o.useRef)(null),Z=(0,u.useInjectable)(b.SCMTreeModelService),y=(0,u.useInjectable)(G.ViewModelContext),[E,R]=(0,o.useState)(y.alwaysShowActions),A=(0,o.useCallback)(async()=>{Z.init(),await Z.whenReady,Z.treeModel&&await Z.treeModel.ensureReady,!W.current&&h(!0)},[c,Z]);(0,o.useEffect)(()=>{const X=y.onAlwaysShowActionsChange(Q=>{R(Q)});return A(),()=>{W.current=!0,X.dispose()}},[]),(0,o.useEffect)(()=>{c&&(f(Z.treeModel),Z.onDidTreeModelChange(async X=>{X&&await X.ensureReady,f(X)}))},[c]),(0,o.useEffect)(()=>{var X;const Q=()=>{Z.handleTreeBlur()};return(X=N.current)===null||X===void 0||X.addEventListener("blur",Q,!0),()=>{var O;(O=N.current)===null||O===void 0||O.removeEventListener("blur",Q,!0),Z.handleTreeBlur()}},[N.current]);const w=(0,o.useCallback)(X=>{Z.handleTreeHandler(Object.assign(Object.assign({},X),{getModel:()=>Z.treeModel,hasDirectFocus:()=>N.current===document.activeElement}))},[]),F=(0,o.useCallback)(X=>V(X)?!1:X.shiftKey,[]),V=(0,o.useCallback)(X=>{const{metaKey:Q,ctrlKey:O}=X;return g.isOSX&&Q||O},[]),Y=(0,o.useCallback)((X,Q,O)=>{if(X.stopPropagation(),!Q)return;const M=F(X),T=V(X);M?Z.handleItemRangeClick(Q,O):T?Z.handleItemToggleClick(Q,O):Z.handleItemClick(Q,O)},[]),_=(0,o.useCallback)((X,Q)=>{X.stopPropagation(),Z.toggleDirectory(Q)},[]),H=(0,o.useCallback)((X,Q,O)=>{X.stopPropagation(),Q&&Z.handleItemDoubleClick(Q,O)},[]),S=(0,o.useCallback)((X,Q,O)=>{X.preventDefault(),Z.handleContextMenu(X,Q,O)},[]);return o.default.createElement("div",{className:(0,a.default)(p.default.scm_tree_container,{"scm-show-actions":E}),tabIndex:-1,ref:N,"data-name":e.TREE_FIELD_NAME},o.default.createElement(l,{isReady:c,model:v,height:s,onTreeReady:w,onItemClick:Y,onItemDoubleClick:H,onTwistierClick:_,onContextMenu:S}))}),e.SCMResourceTree.displayName="SCMResourceTree";function r(s,c){return s.isReady===c.isReady&&s.model===c.model&&s.height===c.height}const l=(0,o.memo)(({isReady:s,model:c,height:h,onTreeReady:v,onItemClick:f,onItemDoubleClick:W,onTwistierClick:N,onContextMenu:Z})=>{const y=(0,u.useInjectable)(b.SCMTreeModelService),E=(0,u.useInjectable)(d.SCMTreeService),R=(0,o.useCallback)(A=>o.default.createElement(m.SCMTreeNode,{item:A.item,itemType:A.itemType,decorationService:y.decorationService,labelService:y.labelService,commandService:y.commandService,decorations:y.decorations.getDecorations(A.item),onClick:f,onDoubleClick:W,onTwistierClick:N,onContextMenu:Z,defaultLeftPadding:E.isTreeMode?-4:4,leftPadding:E.isTreeMode?8:0,iconTheme:y.iconThemeDesc}),[c,E,y]);return s&&c?o.default.createElement(I.RecycleTree,{height:h,itemHeight:m.SCM_TREE_NODE_HEIGHT,onReady:v,model:c,overScanCount:100},R):o.default.createElement("span",{className:p.default.scm_tree_empty_text})},r);l.displayName="SCMResourceTreeView"},38563:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMTreeAPI=e.collectSCMResourceDesc=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(43718),g=t(64964),u=t(49914),G=t(36367),{Path:p}=I.path;function b(d,r){d.type==="file"&&r.push(d.resource);for(const l of d.children)b(l,r);return r}e.collectSCMResourceDesc=b;let m=class extends I.Disposable{constructor(){super(),this.shouldCompactFolders=!1,this.shouldCompactFolders=this.preferenceService.get("scm.listView.compactFolders",!1),this.addDispose(this.preferenceService.onSpecificPreferenceChange("scm.listView.compactFolders",r=>{this.shouldCompactFolders=r.newValue}))}getSCMResource(r){const l=this.getSCMResourceGroups(),s=r.toString();for(const c of l)for(const h of c.elements)if(h.sourceUri.toString()===s)return h}getSCMResourceGroups(){return this.viewModel.scmList.filter(G.isSCMResourceGroup)}get providerId(){var r;return(r=this.viewModel.selectedRepo)===null||r===void 0?void 0:r.provider.id}init(r=g.SCMViewModelMode.Tree){return this.getSCMResourceGroups().map(s=>({id:this.providerId+"_"+s.id,name:s.id,children:r===g.SCMViewModelMode.Tree?this.pathToTree(s.elements):this.pathToList(s.elements),resource:s,type:"group"}))}pathToList(r){return r.map(l=>{const s=this._getPathDesc(l);return{id:`${this.providerId}_${l.resourceGroup.id}_${s}`,name:s,pathname:s,children:[],resource:l,type:"file"}})}pathToTree(r){const l=[],s=Symbol("result"),c=this._initPlainCounterObject(s,l);return r.forEach(h=>{this._getPathDesc(h).split(p.separator).filter(Boolean).reduce((f,W,N,Z)=>{if(!f[W]){f[W]=this._initPlainCounterObject(s,[]);const y=Z.slice(0,N+1).join(p.separator),E=N===Z.length-1?"file":"folder",R={id:`${this.providerId}_${h.resourceGroup.id}_${y}`,name:W,pathname:y,children:f[W][s],resource:E==="file"?h:Object.assign(Object.assign({},h),{sourceUri:o.URI.from(h.sourceUri).parent.codeUri}),type:E};f[s].push(R)}return f[W]},c)}),this.shouldCompactFolders&&this.walkTreeToFold(l),l}_initPlainCounterObject(r,l){const s=Object.create(null);return s[r]=l,s}walkTreeToFold(r){const l=[...r];for(;l.length;){const s=l.pop();s&&(this.foldOnlyChild(s),l.push(...s.children))}}foldOnlyChild(r){for(;r.children.length===1&&r.children[0].children.length;){const l=r.children[0];r.name=`${r.name}${p.separator}${l.name}`,r.pathname=l.pathname,r.children=l.children,r.id=l.id,r.isCompact=!0}}_getPathDesc(r){return I.path.relative(r.resourceGroup.provider.rootUri.path,r.sourceUri.path)}};n.__decorate([(0,a.Autowired)(u.ViewModelContext),n.__metadata("design:type",u.ViewModelContext)],m.prototype,"viewModel",void 0),n.__decorate([(0,a.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],m.prototype,"preferenceService",void 0),m=n.__decorate([(0,a.Injectable)(),n.__metadata("design:paramtypes",[])],m),e.SCMTreeAPI=m},36556:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMTreeDecorationService=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(41893),g=t(52416);let u=class{constructor(){this.disposeCollection=new o.DisposableCollection,this.onDidChangeEmitter=new o.Emitter,this.disposeCollection.pushAll([this.decorationsService.onDidChangeDecorations(()=>{this.onDidChangeEmitter.fire()}),this.themeService.onThemeChange(()=>{this.onDidChangeEmitter.fire()})])}get onDidChange(){return this.onDidChangeEmitter.event}getDecoration(p,b=!1){p instanceof o.URI&&(p=o.Uri.parse(p.toString()));const m=this.decorationsService.getDecoration(p,b);return m?Object.assign(Object.assign({},m),{color:this.themeService.getColor({id:m.color})}):{color:"",tooltip:"",badge:""}}dispose(){this.disposeCollection.dispose()}};n.__decorate([(0,a.Autowired)(I.IDecorationsService),n.__metadata("design:type",I.IDecorationsService)],u.prototype,"decorationsService",void 0),n.__decorate([(0,a.Autowired)(g.IThemeService),n.__metadata("design:type",Object)],u.prototype,"themeService",void 0),u=n.__decorate([(0,a.Injectable)(),n.__metadata("design:paramtypes",[])],u),e.SCMTreeDecorationService=u},12466:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMTreeModel=void 0;const n=t(85608),a=t(76003),o=t(97267),I=t(36556);let g=class extends o.TreeModel{constructor(G){super(),this.init(G)}init(G){this.root=G,this.root.watcher.on(o.TreeNodeEvent.BranchDidUpdate,()=>{this.dispatchChange()}),this.decorationService.onDidChange(this.dispatchChange)}};n.__decorate([(0,a.Autowired)(I.SCMTreeDecorationService),n.__metadata("design:type",I.SCMTreeDecorationService)],g.prototype,"decorationService",void 0),g=n.__decorate([(0,a.Injectable)({multiple:!0}),n.__param(0,(0,a.Optional)()),n.__metadata("design:paramtypes",[Object])],g),e.SCMTreeModel=g},11579:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMTreeModelService=e.SCMTreeTypes=void 0;const n=t(85608),a=t(83794),o=t(76003),I=t(97267),g=t(41869),u=t(77661),G=t(68969),p=t(26542),b=t(54414),m=t(52416),d=t(51500),r=t(64964),l=t(49914),s=t(36556),c=t(12466),h=t(28087),v=n.__importDefault(t(87440)),f=t(63451);var W;(function(y){y[y.List=1]="List",y[y.Tree=2]="Tree"})(W=e.SCMTreeTypes||(e.SCMTreeTypes={}));const N={hasFolderIcons:!0,hasFileIcons:!0,hidesExplorerArrows:!0};let Z=class{constructor(){this._selectedFiles=[],this.disposableCollection=new g.DisposableCollection,this.onDidRefreshedEmitter=new g.Emitter,this.onDidTreeModelChangeEmitter=new g.Emitter,this.treeModelCache=new Map,this.iconThemeDesc=N,this.clearFileSelectedDecoration=()=>{this._selectedFiles.forEach(E=>{this.selectedDecoration.removeTarget(E)}),this._selectedFiles=[]},this.activeFileDecoration=E=>{if(this.contextMenuFile&&(this.contextMenuDecoration.removeTarget(this.contextMenuFile),this._contextMenuFile=void 0),E){if(this.selectedFiles.length>0)for(const R of this.selectedFiles)this.selectedDecoration.removeTarget(R);this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.selectedDecoration.addTarget(E),this.focusedDecoration.addTarget(E),this._focusedFile=E,this._selectedFiles=[E],this.treeModel.dispatchChange()}},this.selectFileDecoration=E=>{this.contextMenuFile&&(this.contextMenuDecoration.removeTarget(this.contextMenuFile),this._contextMenuFile=void 0),E&&(this.selectedFiles.length>0&&this.selectedFiles.forEach(R=>{this.selectedDecoration.removeTarget(R)}),this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this.selectedDecoration.addTarget(E),this._selectedFiles=[E],this.treeModel.dispatchChange())},this.activeFileFocusedDecoration=(E,R=!1)=>{E!==this.treeModel.root&&(this.focusedFile!==E&&(R?(this.focusedFile&&this.focusedDecoration.removeTarget(this.focusedFile),this._contextMenuFile=E):this.focusedFile&&(this._contextMenuFile=void 0,this.focusedDecoration.removeTarget(this.focusedFile)),E&&(this._selectedFiles.indexOf(E)<0&&(this.selectedDecoration.addTarget(E),this._selectedFiles.push(E)),this.focusedDecoration.addTarget(E),this._focusedFile=E)),this.treeModel.dispatchChange())},this.activeFileSelectedDecoration=E=>{this._selectedFiles.indexOf(E)>-1||(this._selectedFiles.push(E),this.selectedDecoration.addTarget(E),this.treeModel.dispatchChange())},this.toggleFileSelectedDecoration=E=>{const R=this._selectedFiles.indexOf(E);R>-1?(this.focusedFile===E&&(this._focusedDecoration.removeTarget(this.focusedFile),this._focusedFile=void 0),this._selectedFiles.splice(R,1),this.selectedDecoration.removeTarget(E)):(this._selectedFiles.push(E),this.selectedDecoration.addTarget(E),this.focusedFile&&this._focusedDecoration.removeTarget(this.focusedFile),this._focusedFile=E,this.focusedDecoration.addTarget(E)),this.treeModel.dispatchChange()},this.enactiveFileDecoration=()=>{var E;this.focusedFile&&(this.focusedDecoration.removeTarget(this.focusedFile),this._focusedFile=void 0),this.contextMenuFile&&this.contextMenuDecoration.removeTarget(this.contextMenuFile),(E=this.treeModel)===null||E===void 0||E.dispatchChange()},this.activeFileActivedDecoration=E=>{this.contextMenuFile&&this.contextMenuDecoration.removeTarget(this.contextMenuFile),this.focusedFile&&(this.focusedDecoration.removeTarget(this.focusedFile),this._focusedFile=void 0),this.contextMenuDecoration.addTarget(E),this._contextMenuFile=E,this.treeModel.dispatchChange()},this.handleTreeBlur=()=>{this.enactiveFileDecoration()},this._isMutiSelected=!1,this.handleItemRangeClick=(E,R)=>{if(!this.focusedFile)this.handleItemClick(E,R);else if(this.focusedFile&&this.focusedFile!==E){this._isMutiSelected=!0;const A=this.treeModel.root.getIndexAtTreeNode(E),w=this.treeModel.root.getIndexAtTreeNode(this.focusedFile);w>A?this.activeFileDecorationByRange(A,w,A):w<A&&this.activeFileDecorationByRange(w,A,A)}},this.handleItemToggleClick=(E,R)=>{this._isMutiSelected=!0,!(R!==I.TreeNodeType.CompositeTreeNode&&R!==I.TreeNodeType.TreeNode)&&this.toggleFileSelectedDecoration(E)},this.handleContextMenu=(E,R,A)=>{const{x:w,y:F}=E.nativeEvent;if(!R)return;const V=h.SCMResourceGroup.is(R)?R.resource:R.resource.resourceGroup,Y=this.viewModel.menus.getRepositoryMenus(V.provider);if(!Y)return;R?this.activeFileActivedDecoration(R):this.enactiveFileDecoration();let _;if(h.SCMResourceFolder.is(R)?_=R.arguments:_=this._isMutiSelected?this._getSelectedFiles().map(H=>H.resource.toJSON()):[R.resource.toJSON()],A===I.TreeNodeType.TreeNode){const H=R.resource;this.ctxMenuRenderer.show({anchor:{x:w,y:F},menuNodes:Y.getResourceMenu(H).getGroupedMenuNodes()[1],args:_})}else h.SCMResourceGroup.is(R)?this.ctxMenuRenderer.show({anchor:{x:w,y:F},menuNodes:Y.getResourceGroupMenu(V).getGroupedMenuNodes()[1],args:_}):this.ctxMenuRenderer.show({anchor:{x:w,y:F},menuNodes:Y.getResourceFolderMenu(V).getGroupedMenuNodes()[1],args:_})},this.activeFileDecorationByRange=(E,R,A)=>{this.clearFileSelectedDecoration();for(const w of this.focusedDecoration.appliedTargets.keys())this.focusedDecoration.removeTarget(w);for(;E<=R;E++){const w=this.treeModel.root.getTreeNodeAtIndex(E);w&&(E===A?this.focusedDecoration.addTarget(w):this.focusedDecoration.hasTarget(w)&&this.focusedDecoration.removeTarget(w),this._selectedFiles.push(w),this.selectedDecoration.addTarget(w))}this.treeModel.dispatchChange()},this.handleItemDoubleClick=(E,R)=>{if(this.listOpenMode==="doubleClick"&&(R===I.TreeNodeType.TreeNode?this.openFile(E):this.toggleDirectory(E)),R===I.TreeNodeType.TreeNode){const{currentEditorGroup:A,currentEditor:w}=this.workbenchEditorService;A&&w&&w.currentUri&&g.URI.from(E.resource.sourceUri).isEqual(w.currentUri)&&A.pin(w.currentUri)}},this.handleItemClick=(E,R)=>{this._isMutiSelected=!1,this.activeFileDecoration(E),this.listOpenMode==="singleClick"&&(R===I.TreeNodeType.TreeNode?this.openFile(E):this.toggleDirectory(E))},this.openFile=E=>{var R,A;const w=E,F=(R=w.resource.command)===null||R===void 0?void 0:R.id;F===g.EDITOR_COMMANDS.API_OPEN_EDITOR_COMMAND_ID||F===g.EDITOR_COMMANDS.API_OPEN_DIFF_EDITOR_COMMAND_ID?this.commandService.executeCommand(F,...((A=w.resource.command)===null||A===void 0?void 0:A.arguments)||[]).catch(V=>this.logger.error("Failed to execute command:",V,F)):E.resource.open(!0)},this.toggleDirectory=E=>{E.expanded?this.scmTreeHandle.collapseNode(E):this.scmTreeHandle.expandNode(E)},(0,a.makeObservable)(this)}init(){this.showProgress(this._whenReady=this.initTreeModel(this.scmTreeService.isTreeMode)),this._whenReady.then(()=>{this.disposableCollection.push(this.scmTreeService.onDidTreeModeChange(R=>{this.showProgress(this._whenReady=this.initTreeModel(R))}))}),this.disposableCollection.push(this.viewModel.onDidSelectedRepoChange(R=>{var A;this._whenReady=this.initTreeModel(this.scmTreeService.isTreeMode,(A=R.provider.rootUri)===null||A===void 0?void 0:A.toString())}));const E=g.Event.any(g.Event.map(this.labelService.onDidChange,()=>{}),this.viewModel.onDidSCMListChange,g.Event.map(g.Event.filter(this.preferenceService.onPreferenceChanged,R=>R.preferenceName==="scm.listView.compactFolders"&&this.scmTreeService.isTreeMode),()=>{}));this.disposableCollection.push(E(()=>{this.refresh()})),this.setIconThemeDesc(this.iconService.currentTheme||N),this.disposableCollection.push(this.iconService.onThemeChange(R=>{this.setIconThemeDesc(R)}))}setIconThemeDesc(E){this.iconThemeDesc={hasFolderIcons:!!E.hasFolderIcons,hasFileIcons:!!E.hasFileIcons,hidesExplorerArrows:!!E.hidesExplorerArrows}}showProgress(E){this.progressService.withProgress({location:r.scmResourceViewId},()=>E)}get scmTreeHandle(){return this._scmTreeHandle}get contextMenuFile(){return this._contextMenuFile}get selectedDecoration(){return this._selectedDecoration}get focusedDecoration(){return this._focusedDecoration}get contextMenuDecoration(){return this._contextMenuDecoration}get decorations(){return this._activeDecorations}get treeModel(){return this._activeTreeModel}get whenReady(){return this._whenReady}get focusedFile(){return this._focusedFile}get selectedFiles(){return this._selectedFiles}get onDidRefreshed(){return this.onDidRefreshedEmitter.event}get onDidTreeModelChange(){return this.onDidTreeModelChangeEmitter.event}async collapseAll(){await this.treeModel.root.collapsedAll()}async getCacheKey(E=W.List,R){var A;return R||(R=(A=(await this.workspaceService.roots)[0])===null||A===void 0?void 0:A.uri),`${R}_git_${E===W.List?"list":"tree"}`}async initTreeModel(E,R){this.treeModelDisposableCollection&&this.treeModelDisposableCollection.dispose();const A=E?W.Tree:W.List,w=await this.getCacheKey(A,R);if(this.treeModelCache.has(w)){const{treeModel:F,decorations:V,selectedDecoration:Y,focusedDecoration:_,contextMenuDecoration:H}=this.treeModelCache.get(w);this._activeTreeModel=F,this._activeDecorations=V,this._selectedDecoration=Y,this._focusedDecoration=_,this._contextMenuDecoration=H,await this.refresh()}else{const F=(await this.scmTreeService.resolveChildren())[0];if(!F)return;this._activeTreeModel=this.injector.get(c.SCMTreeModel,[F]),this._activeDecorations=this.initDecorations(F),this.disposableCollection.push(this._activeDecorations),this.treeModelCache.set(w,{treeModel:this._activeTreeModel,decorations:this._activeDecorations,selectedDecoration:this._selectedDecoration,focusedDecoration:this._focusedDecoration,contextMenuDecoration:this._contextMenuDecoration})}this.treeModelDisposableCollection=new g.DisposableCollection,this.onDidTreeModelChangeEmitter.fire(this._activeTreeModel)}dispose(){this.disposableCollection.dispose()}initDecorations(E){return this._activeDecorations=new I.DecorationsManager(E),this._selectedDecoration=new I.Decoration(v.default.mod_selected),this._focusedDecoration=new I.Decoration(v.default.mod_focused),this._contextMenuDecoration=new I.Decoration(v.default.mod_actived),this._activeDecorations.addDecoration(this.selectedDecoration),this._activeDecorations.addDecoration(this.focusedDecoration),this._activeDecorations.addDecoration(this.contextMenuDecoration),this._activeDecorations}handleTreeHandler(E){this._scmTreeHandle=E}_getSelectedFiles(){return this._selectedFiles.filter(E=>!!E&&!h.SCMResourceGroup.is(E))}get listOpenMode(){return this.corePreferences["workbench.list.openMode"]}async refresh(E){var R;E===void 0&&(E=(R=this.treeModel)===null||R===void 0?void 0:R.root),E&&(this.refreshCancelToken&&!this.refreshCancelToken.token.isCancellationRequested&&this.refreshCancelToken.cancel(),this.refreshCancelToken=new g.CancellationTokenSource,await E.refresh(this.refreshCancelToken),this.refreshCancelToken=null)}};n.__decorate([(0,o.Autowired)(p.LabelService),n.__metadata("design:type",p.LabelService)],Z.prototype,"labelService",void 0),n.__decorate([(0,o.Autowired)(s.SCMTreeDecorationService),n.__metadata("design:type",s.SCMTreeDecorationService)],Z.prototype,"decorationService",void 0),n.__decorate([(0,o.Autowired)(g.CommandService),n.__metadata("design:type",Object)],Z.prototype,"commandService",void 0),n.__decorate([(0,o.Autowired)(G.IProgressService),n.__metadata("design:type",Object)],Z.prototype,"progressService",void 0),n.__decorate([(0,o.Autowired)(m.IIconService),n.__metadata("design:type",Object)],Z.prototype,"iconService",void 0),n.__decorate([(0,o.Autowired)(o.INJECTOR_TOKEN),n.__metadata("design:type",o.Injector)],Z.prototype,"injector",void 0),n.__decorate([(0,o.Autowired)(f.SCMTreeService),n.__metadata("design:type",f.SCMTreeService)],Z.prototype,"scmTreeService",void 0),n.__decorate([(0,o.Autowired)(l.ViewModelContext),n.__metadata("design:type",l.ViewModelContext)],Z.prototype,"viewModel",void 0),n.__decorate([(0,o.Autowired)(u.ICtxMenuRenderer),n.__metadata("design:type",u.ICtxMenuRenderer)],Z.prototype,"ctxMenuRenderer",void 0),n.__decorate([(0,o.Autowired)(g.CorePreferences),n.__metadata("design:type",Object)],Z.prototype,"corePreferences",void 0),n.__decorate([(0,o.Autowired)(b.WorkbenchEditorService),n.__metadata("design:type",b.WorkbenchEditorService)],Z.prototype,"workbenchEditorService",void 0),n.__decorate([(0,o.Autowired)(g.PreferenceService),n.__metadata("design:type",Object)],Z.prototype,"preferenceService",void 0),n.__decorate([(0,o.Autowired)(d.IWorkspaceService),n.__metadata("design:type",Object)],Z.prototype,"workspaceService",void 0),n.__decorate([(0,o.Autowired)(g.ILogger),n.__metadata("design:type",Object)],Z.prototype,"logger",void 0),n.__decorate([a.observable.deep,n.__metadata("design:type",Object)],Z.prototype,"iconThemeDesc",void 0),Z=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],Z),e.SCMTreeModelService=Z},28087:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMResourceFile=e.SCMResourceFolder=e.SCMResourceGroup=e.SCMResourceRoot=void 0;const n=t(85608),a=t(97267),o=t(41869),I=t(36367),g=t(38563);class u extends a.CompositeTreeNode{static is(d){return!!d&&!d.parent}constructor(d,r){super(d,void 0),this.isTree=r}get name(){return`SCMTree_${this.isTree?"Tree":"List"}_${this.id}`}get expanded(){return!0}dispose(){super.dispose()}}e.SCMResourceRoot=u;class G extends a.CompositeTreeNode{static is(d){return a.CompositeTreeNode.is(d)&&!!d.resource&&(0,I.isSCMResourceGroup)(d.resource)}constructor(d,r,l,s){super(d,r),this.raw=l,this.resource=s,this.isExpanded=!0}get displayName(){return this.resource.label}get uri(){return new o.URI(`scm-group://${this.resource.id}`)}}n.__decorate([o.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],G.prototype,"displayName",null),n.__decorate([o.memoize,n.__metadata("design:type",o.URI),n.__metadata("design:paramtypes",[])],G.prototype,"uri",null),e.SCMResourceGroup=G;class p extends a.CompositeTreeNode{constructor(d,r,l,s,c){super(d,r,void 0,{name:c?l.name:l.pathname}),this.raw=l,this.resource=s,this.description="",this.isExpanded=!0}get displayName(){return this.raw.name}get uri(){return new o.URI(this.raw.resource.sourceUri)}get tooltip(){const d=this.resource;return o.path.join(d.resourceGroup.provider.rootUri.path,this.raw.pathname)}get arguments(){return(0,g.collectSCMResourceDesc)(this.raw,[])}}n.__decorate([o.memoize,n.__metadata("design:type",String),n.__metadata("design:paramtypes",[])],p.prototype,"displayName",null),n.__decorate([o.memoize,n.__metadata("design:type",o.URI),n.__metadata("design:paramtypes",[])],p.prototype,"uri",null),n.__decorate([o.memoize,n.__metadata("design:type",String),n.__metadata("design:paramtypes",[])],p.prototype,"tooltip",null),e.SCMResourceFolder=p;class b extends a.TreeNode{constructor(d,r,l,s,c){super(d,r,void 0,{name:c?l.name:l.pathname}),this.raw=l,this.resource=s,this.isTree=c}get displayName(){return this.raw.name}get uri(){return new o.URI(this.raw.resource.sourceUri)}get description(){if(this.isTree)return"";const d=this.resource,r=o.path.parse(d.sourceUri.path);return o.path.relative(d.resourceGroup.provider.rootUri.path,r.dir)}get tooltip(){return this.resource.sourceUri.path}}n.__decorate([o.memoize,n.__metadata("design:type",String),n.__metadata("design:paramtypes",[])],b.prototype,"displayName",null),n.__decorate([o.memoize,n.__metadata("design:type",o.URI),n.__metadata("design:paramtypes",[])],b.prototype,"uri",null),n.__decorate([o.memoize,n.__metadata("design:type",String),n.__metadata("design:paramtypes",[])],b.prototype,"description",null),n.__decorate([o.memoize,n.__metadata("design:type",String),n.__metadata("design:paramtypes",[])],b.prototype,"tooltip",null),e.SCMResourceFile=b},74568:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMTreeNode=e.SCMResourceNode=e.SCMResourceGroupNode=e.SCM_BADGE_LIMIT=e.SCM_TREE_NODE_HEIGHT=void 0;const n=t(85608),a=n.__importDefault(t(53373)),o=n.__importStar(t(14041)),I=t(97267),g=t(41869),u=t(25918),G=t(52416),p=t(49914),b=t(28087),m=n.__importDefault(t(87440));e.SCM_TREE_NODE_HEIGHT=22,e.SCM_BADGE_LIMIT=99;const d=({item:s,defaultLeftPadding:c=8,leftPadding:h=8,onClick:v,onDoubleClick:f,onContextMenu:W,itemType:N,decorations:Z,onTwistierClick:y})=>{const E=(0,g.useInjectable)(p.ViewModelContext),R=`${c+(s.depth||0)*(h||0)}px`,A=(0,g.useDesignStyles)(m.default.expansion_toggle,"expansion_toggle"),w=(0,g.useDesignStyles)(m.default.scm_tree_node,"scm_tree_node"),F=s.resource,V=o.default.useCallback(()=>{const O=E.menus.getRepositoryMenus(F.provider).getResourceGroupMenu(F);return o.default.createElement("div",{className:m.default.scm_tree_node_actions},o.default.createElement(u.InlineMenuBar,{context:[F],menus:O,separator:"inline"}))},[F]),Y=(0,o.useCallback)(Q=>{Q.nativeEvent.which!==0&&W(Q,s,N)},[W]),_=(0,o.useCallback)(Q=>{v(Q,s,N)},[v]),H=(0,o.useCallback)(Q=>{f(Q,s,N)},[f]),S=(0,o.useCallback)((Q,O)=>Z&&Z?.classlist.indexOf(m.default.mod_loading)>-1?o.default.createElement(I.Loading,null):o.default.createElement("div",{onClick:O,className:(0,a.default)(m.default.scm_tree_node_segment,A,(0,g.getIcon)("arrow-right"),{[`${m.default.mod_collapsed}`]:!Q.expanded})}),[Z]),X=(0,o.useCallback)(Q=>{(N===I.TreeNodeType.TreeNode||N===I.TreeNodeType.CompositeTreeNode)&&(y?y(Q,s,N):v(Q,s,N))},[y,v]);return o.default.createElement("div",{key:s.id,onClick:_,onDoubleClick:H,onContextMenu:Y,className:(0,a.default)(w,Z?Z.classlist:null),style:{height:e.SCM_TREE_NODE_HEIGHT,lineHeight:`${e.SCM_TREE_NODE_HEIGHT}px`,paddingLeft:R},"data-id":s.id},o.default.createElement("div",{className:(0,a.default)(m.default.scm_tree_node_content)},S(s,X),o.default.createElement("div",{className:m.default.scm_tree_node_overflow_wrap},o.default.createElement("div",{className:(0,a.default)(m.default.scm_tree_node_segment,m.default.scm_tree_node_displayname)},s.displayName)),V(),o.default.createElement("div",{className:(0,a.default)(m.default.scm_tree_node_segment,m.default.scm_tree_node_tail)},o.default.createElement(I.Badge,null,s.resource.elements.length))))};e.SCMResourceGroupNode=d;const r=({item:s,defaultLeftPadding:c=8,leftPadding:h=8,onClick:v,onDoubleClick:f,onTwistierClick:W,onContextMenu:N,itemType:Z,decorationService:y,labelService:E,decorations:R,iconTheme:A})=>{const w=(0,g.useInjectable)(p.ViewModelContext),F=b.SCMResourceGroup.is(s)?null:y.getDecoration(s.uri,!1),V=(0,g.useDesignStyles)(m.default.expansion_toggle,"expansion_toggle"),Y=(0,g.useDesignStyles)(m.default.scm_tree_node,"scm_tree_node"),_=s.resource,H=(0,o.useCallback)(()=>{const re=w.menus.getRepositoryMenus(_.resourceGroup.provider);let ae,he;return Z===I.TreeNodeType.TreeNode?(ae=re.getResourceMenu(_),he=[_]):(ae=re.getResourceFolderMenu(_.resourceGroup),he=s.arguments),o.default.createElement("div",{className:m.default.scm_tree_node_actions},o.default.createElement(u.InlineMenuBar,{menus:ae,context:he,separator:"inline"}))},[Z,_.resourceGroup]),S=(0,o.useCallback)(re=>{v(re,s,Z)},[v]),X=(0,o.useCallback)(re=>{f(re,s,Z)},[f]),Q=(0,o.useCallback)(re=>{re.nativeEvent.which!==0&&N(re,s,Z)},[N]),O=b.SCMResourceFolder.is(s),{hidesExplorerArrows:M,hasFolderIcons:T}=A,x=`${c+(s.depth||0)*(h||0)+(O?0:T?M?0:20:0)}px`,B=re=>{const ae=E.getIcon(re.uri,{isDirectory:b.SCMResourceFolder.is(re)});return o.default.createElement("div",{className:(0,a.default)(m.default.file_icon,ae),style:{height:e.SCM_TREE_NODE_HEIGHT,lineHeight:`${e.SCM_TREE_NODE_HEIGHT}px`}})},D=(0,o.useCallback)(re=>o.default.createElement("div",{className:(0,a.default)(m.default.scm_tree_node_segment,m.default.scm_tree_node_displayname)},b.SCMResourceFolder.is(re)?re.displayName:E.getName(re.uri)),[E]),J=(0,o.useCallback)(re=>o.default.createElement("div",{className:(0,a.default)(m.default.scm_tree_node_segment_grow,m.default.scm_tree_node_description)},re.description),[]),k=(0,g.useInjectable)(G.IThemeService),z=()=>{if(!F)return null;const re=F.badge||s.resource.decorations.letter||"",ae=F.color||s.resource.decorations.color,he=ae&&k.getColor({id:ae});return o.default.createElement("div",{className:m.default.scm_tree_node_status,style:{color:he}},re.slice())},P=(0,o.useCallback)(()=>{let re=s.tooltip;return F&&F.badge&&(re+=` \u2022 ${F.tooltip||s.resource.decorations.tooltip||""}`),re},[s]),U=(0,o.useCallback)(re=>{(Z===I.TreeNodeType.TreeNode||Z===I.TreeNodeType.CompositeTreeNode)&&(W?W(re,s,Z):v(re,s,Z))},[W,v]),oe=(0,o.useCallback)((re,ae)=>b.SCMResourceFolder.is(re)?R&&R?.classlist.indexOf(m.default.mod_loading)>-1?o.default.createElement(I.Loading,null):o.default.createElement("div",{onClick:ae,className:(0,a.default)(m.default.scm_tree_node_segment,V,(0,g.getIcon)("arrow-right"),{[`${m.default.mod_collapsed}`]:!re.expanded})}):null,[R]);return o.default.createElement("div",{key:s.id,onClick:S,onDoubleClick:X,onContextMenu:Q,title:P(),className:(0,a.default)(Y,R?R.classlist:null),style:{color:F?F.color:"",paddingLeft:x,height:e.SCM_TREE_NODE_HEIGHT,lineHeight:`${e.SCM_TREE_NODE_HEIGHT}px`},"data-id":s.id},o.default.createElement("div",{className:(0,a.default)(m.default.scm_tree_node_content)},oe(s,U),B(s),o.default.createElement("div",{className:m.default.scm_tree_node_overflow_wrap,style:{textDecoration:F&&F.badge==="D"?"line-through":"none"}},D(s),J(s)),H(),o.default.createElement("div",{className:(0,a.default)(m.default.scm_tree_node_segment,m.default.scm_tree_node_tail)},z())))};e.SCMResourceNode=r;const l=s=>{const{item:c}=s,h=n.__rest(s,["item"]);return b.SCMResourceGroup.is(c)?o.default.createElement(e.SCMResourceGroupNode,Object.assign({item:c},h)):o.default.createElement(e.SCMResourceNode,Object.assign({},s,{item:c}))};e.SCMTreeNode=l},63451:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMTreeService=void 0;const n=t(85608),a=t(76003),o=t(97267),I=t(41869),g=t(43718),u=t(64964),G=t(38563),p=t(28087);let b=class extends o.Tree{get isTreeMode(){return this._isTreeMode}get onDidTreeModeChange(){return this.onDidTreeModeChangeEmitter.event}constructor(){super(),this.onDidTreeModeChangeEmitter=new I.Emitter,this._isTreeMode=this.preferenceService.get("scm.defaultViewMode")===u.SCMViewModelMode.Tree,this.toDispose.push(this.preferenceService.onSpecificPreferenceChange("scm.defaultViewMode",d=>{const r=d.newValue===u.SCMViewModelMode.Tree;r!==this._isTreeMode&&(this._isTreeMode=r,this.onDidTreeModeChangeEmitter.fire(this._isTreeMode))}))}changeTreeMode(d){this.preferenceService.set("scm.defaultViewMode",d?u.SCMViewModelMode.Tree:u.SCMViewModelMode.List,g.PreferenceScope.User)}async resolveChildren(d){let r=[];if(!d)this._root=new p.SCMResourceRoot(this,this._isTreeMode),r=[this._root];else if(p.SCMResourceRoot.is(d)){const l=this.scmTreeAPI.init(this._isTreeMode?u.SCMViewModelMode.Tree:u.SCMViewModelMode.List);r.push(...l.map(s=>this.toNode(s,d,this._isTreeMode)))}else if(d.raw){const l=d.raw.children;r.push(...l.map(s=>this.toNode(s,d,this._isTreeMode)))}return r}toNode(d,r,l){if(d.type==="group"){const c=d;return new p.SCMResourceGroup(this,r,c,c.resource)}const s=d;return d.type==="file"?new p.SCMResourceFile(this,r,s,s.resource,l):new p.SCMResourceFolder(this,r,s,s.resource,l)}sortComparator(d,r){if(p.SCMResourceGroup.is(d)&&p.SCMResourceGroup.is(r)){const l={merge:3,index:2,workingTree:1};return l[r.resource.id]-l[d.resource.id]}return super.sortComparator(d,r)}};n.__decorate([(0,a.Autowired)(G.SCMTreeAPI),n.__metadata("design:type",G.SCMTreeAPI)],b.prototype,"scmTreeAPI",void 0),n.__decorate([(0,a.Autowired)(I.PreferenceService),n.__metadata("design:type",Object)],b.prototype,"preferenceService",void 0),b=n.__decorate([(0,a.Injectable)(),n.__metadata("design:paramtypes",[])],b),e.SCMTreeService=b},42126:(L,e,t)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.DirtyDiffDecorator=void 0;const a=t(85608),o=t(76003),I=t(41869),g=t(54414),u=t(52416),G=a.__importStar(t(43255)),p=a.__importStar(t(88104)),b=t(7168),m=t(73018),d=t(24870),r=t(84416);let l=n=class extends I.Disposable{static createDecoration(c,h){const v={description:"dirty-diff-decoration",isWholeLine:h.isWholeLine};return h.gutter&&(v.linesDecorationsClassName=`dirty-diff-glyph ${c}`),h.overview.active&&(v.overviewRuler={color:(0,u.themeColorFromId)(h.overview.color),position:g.OverviewRulerLane.Left}),h.minimap.active&&(v.minimap={color:(0,u.themeColorFromId)(h.minimap.color),position:G.MinimapPosition.Gutter}),p.ModelDecorationOptions.createDynamic(v)}constructor(c,h){super(),this.model=h,this.decorations=[],this.editorModel=c;const v=this.scmPreferences["scm.diffDecorations"],f=v==="all"||v==="gutter",W=v==="all"||v==="overview",N=v==="all"||v==="minimap";this.modifiedOptions=n.createDecoration("dirty-diff-modified",{gutter:f,overview:{active:W,color:b.overviewRulerModifiedForeground},minimap:{active:N,color:b.minimapGutterModifiedBackground},isWholeLine:!0}),this.addedOptions=n.createDecoration("dirty-diff-added",{gutter:f,overview:{active:W,color:b.overviewRulerAddedForeground},minimap:{active:N,color:b.minimapGutterAddedBackground},isWholeLine:!0}),this.deletedOptions=n.createDecoration("dirty-diff-deleted",{gutter:f,overview:{active:W,color:b.overviewRulerDeletedForeground},minimap:{active:N,color:b.minimapGutterDeletedBackground},isWholeLine:!1}),this.addDispose(h.onDidChange(this.onDidChange,this))}onDidChange(){if(!this.editorModel)return;const c=this.model.changes.map(h=>{const v=(0,r.getChangeType)(h),f=h[2],W=h[3]-1||f-1;switch(v){case r.ChangeType.Add:return{range:{startLineNumber:f,startColumn:1,endLineNumber:W,endColumn:1},options:this.addedOptions};case r.ChangeType.Delete:return{range:{startLineNumber:f-1,startColumn:Number.MAX_VALUE,endLineNumber:f>0?f-1:f,endColumn:Number.MAX_VALUE},options:this.deletedOptions};case r.ChangeType.Modify:return{range:{startLineNumber:f,startColumn:1,endLineNumber:W,endColumn:1},options:this.modifiedOptions}}});this.decorations=this.editorModel.getMonacoModel().deltaDecorations(this.decorations,c)}dispose(){super.dispose(),this.editorModel&&!this.editorModel.getMonacoModel().isDisposed()&&this.editorModel.getMonacoModel().deltaDecorations(this.decorations,[]),this.editorModel=null,this.decorations=[]}};a.__decorate([(0,o.Autowired)(m.SCMPreferences),a.__metadata("design:type",Object)],l.prototype,"scmPreferences",void 0),l=n=a.__decorate([(0,o.Injectable)({multiple:!0}),a.__param(0,(0,o.Optional)()),a.__param(1,(0,o.Optional)()),a.__metadata("design:paramtypes",[Object,d.DirtyDiffModel])],l),e.DirtyDiffDecorator=l},24870:(L,e,t)=>{"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.DirtyDiffModel=e.isDirtyDiffVisible=void 0;const a=t(85608),o=t(76003),I=t(41869),g=t(40191),u=t(54414),G=t(57517),p=a.__importStar(t(20868)),b=t(28240),m=t(83e3),d=t(64964),r=t(84416),{sortedDiff:l}=I.arrays;e.isDirtyDiffVisible=new g.RawContextKey("dirtyDiffVisible",!1);let s=n=class extends I.Disposable{get original(){return this._originalModel}get modified(){return this._editorModel}get changes(){return this._changes}get editorWorkerService(){return m.StandaloneServices.get(b.IEditorWorkerService)}constructor(h){super(),this.repositoryDisposables=new Set,this._onDidChange=new I.Emitter,this.onDidChange=this._onDidChange.event,this._changes=[],this._editorModel=h,this.diffDelayer=new I.ThrottledDelayer(200),this.addDispose(I.Disposable.create(()=>{this.diffDelayer&&(this.diffDelayer.isTriggered()||this.diffDelayer.cancel(),this.diffDelayer=null)})),this.addDispose(h.getMonacoModel().onDidChangeContent(()=>this.triggerDiff())),this.addDispose(h.onDidChangeEncoding(()=>{var v;(v=this.diffDelayer)===null||v===void 0||v.cancel(),this._originalModel=null,this._originalURIPromise=void 0,this._changes=[],this.triggerDiff()})),this.addDispose(this.scmService.onDidAddRepository(this.onDidAddRepository,this)),this.scmService.repositories.forEach(v=>this.onDidAddRepository(v)),this.triggerDiff(),this.originalModelDisposables=new I.DisposableStore,this.addDispose(this.originalModelDisposables),this.isDirtyDiffVisible=e.isDirtyDiffVisible.bind(this.contextKeyService)}onDidAddRepository(h){const v=new I.DisposableStore;this.repositoryDisposables.add(v),v.add((0,I.toDisposable)(()=>this.repositoryDisposables.delete(v)));const f=I.Event.any(h.provider.onDidChange,h.provider.onDidChangeResources);v.add(f(this.triggerDiff,this));const W=I.Event.filter(this.scmService.onDidRemoveRepository,N=>N===h);v.add(W(()=>(0,I.dispose)(v),null)),this.triggerDiff()}triggerDiff(){return this.diffDelayer?this.diffDelayer.trigger(()=>this.diff()).then(h=>{if(!this._editorModel||this._editorModel.getMonacoModel().isDisposed()||!this._originalModel||this._originalModel.getMonacoModel().isDisposed())return;(!h||this._originalModel.getMonacoModel().getValueLength()===0)&&(h=[]);const v=l(this.changes,h,r.compareChanges);this._changes=h,v.length>0&&this._onDidChange.fire(v)}):Promise.resolve(null)}canSyncModelForDiff(h){if(!h)return!1;const v=n.maxFileSize*1024*1024,f=h.getValueLength();return v===0||f<=v}async diff(){var h;const v=await this.getOriginalURIPromise();if(!this._editorModel||this._editorModel.getMonacoModel().isDisposed()||!v)return[];if(!this.canSyncModelForDiff((h=this._originalModel)===null||h===void 0?void 0:h.getMonacoModel())||!this.canSyncModelForDiff(this._editorModel.getMonacoModel()))return[];const f=await this.editorWorkerService.computeDiff(v,this._editorModel.getMonacoModel().uri,{ignoreTrimWhitespace:!1,maxComputationTimeMs:1e3,computeMoves:!1},"advanced");return f&&this.getLineChanges(f.changes)}getLineChanges(h){return h.map(v=>{var f;return[v.original.startLineNumber,v.original.endLineNumberExclusive,v.modified.startLineNumber,v.modified.endLineNumberExclusive,(f=v.innerChanges)===null||f===void 0?void 0:f.map(W=>[W.originalRange.startLineNumber,W.originalRange.startColumn,W.originalRange.endLineNumber,W.originalRange.endColumn,W.modifiedRange.startLineNumber,W.modifiedRange.startColumn,W.modifiedRange.endLineNumber,W.modifiedRange.endColumn])]})}getOriginalURIPromise(){return this._originalURIPromise?this._originalURIPromise:(this._originalURIPromise=this.getOriginalResource().then(h=>this._editorModel?h?this._originalModel&&this._originalModel.uri.toString()===h.toString()?h:this.documentModelManager.createModelReference(new I.URI(h)).then(v=>{if(!this._editorModel||!v)return null;this._originalModel=v.instance,this._originalModel.updateEncoding(this._editorModel.encoding);const f=this._originalModel.getMonacoModel();return this.originalModelDisposables.clear(),this.originalModelDisposables.add(v),this.originalModelDisposables.add(f.onDidChangeContent(()=>this.triggerDiff())),h}):(this._originalModel=null,null):null),this._originalURIPromise.finally(()=>{this._originalURIPromise=void 0}))}getOriginalResource(){if(!this._editorModel)return Promise.resolve(null);const h=this._editorModel.getMonacoModel().uri;return(0,I.first)(this.scmService.repositories.map(v=>()=>v.provider.getOriginalResource(h)))}findNextClosestChange(h,v=!0){for(let f=0;f<this.changes.length;f++){const W=this.changes[f];if(v){if((0,r.getModifiedEndLineNumber)(W)>=h)return f}else if(W[2]>h)return f}return 0}findNextClosestChangeLineNumber(h,v=!0){const f=this.findNextClosestChange(h,v);return this.changes[f][2]}findPreviousClosestChange(h,v=!0){for(let f=this.changes.length-1;f>=0;f--){const W=this.changes[f];if(v){if(W[2]<=h)return f}else if((0,r.getModifiedEndLineNumber)(W)<h)return f}return this.changes.length-1}findPreviousClosestChangeLineNumber(h,v=!0){const f=this.findPreviousClosestChange(h,v);return this.changes[f][2]}getChangeFromRange(h){const v=this.findNextClosestChange(h.startLineNumber);return{change:this.changes[v],count:v+1}}async onClickDecoration(h,v){if(this._widget)if(this._widget===h){this._widget.dispose();return}else this._widget.dispose();if(this._widget=h,this._originalModel&&this._editorModel){let w=function(F,V){h.updateCurrent(F),h.show(p.positionToRange(V[3]-1),n.heightInLines),E.isDirtyDiffVisible.set(!0)};const f=this._originalModel.uri,W=this._editorModel.uri,N=this.editorService.createDiffEditor(h.getContentNode(),{automaticLayout:!0,renderSideBySide:!1,hideUnchangedRegions:{enabled:!1}}),Z=await this.documentModelManager.createModelReference(f),y=await this.documentModelManager.createModelReference(W);N.compare(Z,y),N.modifiedEditor.monacoEditor.updateOptions({readOnly:!0}),N.originalEditor.monacoEditor.updateOptions({readOnly:!0}),N.modifiedEditor.monacoEditor.revealLineInCenter(v.startLineNumber-Math.round(n.heightInLines/2)),h.addDispose(N.originalEditor.monacoEditor.onDidChangeModelContent(()=>{h.relayout(n.heightInLines)}));const E=this;h.addDispose(this.onDidChange(()=>{const{change:F,count:V}=this.getChangeFromRange(v)||{};w(V,F)}));const{change:R,count:A}=this.getChangeFromRange(v)||{};A&&R&&w(A,R),h.onDispose(()=>{this._widget=null,E.isDirtyDiffVisible.set(!1)})}}dispose(){super.dispose(),this._editorModel=null,this._originalModel=null,this.repositoryDisposables.forEach(h=>(0,I.dispose)(h)),this.repositoryDisposables.clear()}};s.heightInLines=10,s.maxFileSize=50,a.__decorate([(0,o.Autowired)(I.IContextKeyService),a.__metadata("design:type",Object)],s.prototype,"contextKeyService",void 0),a.__decorate([(0,o.Autowired)(d.SCMService),a.__metadata("design:type",d.SCMService)],s.prototype,"scmService",void 0),a.__decorate([(0,o.Autowired)(G.IEditorDocumentModelService),a.__metadata("design:type",Object)],s.prototype,"documentModelManager",void 0),a.__decorate([(0,o.Autowired)(u.EditorCollectionService),a.__metadata("design:type",u.EditorCollectionService)],s.prototype,"editorService",void 0),s=n=a.__decorate([(0,o.Injectable)({multiple:!0}),a.__param(0,(0,o.Optional)()),a.__metadata("design:paramtypes",[Object])],s),e.DirtyDiffModel=s},84416:(L,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toChange=e.getChangeType=e.ChangeType=e.getModifiedEndLineNumber=e.compareChanges=void 0;function t(g,u){let G=g[2]-u[2];return G!==0||(G=g[3]-u[3],G!==0)||(G=g[0]-u[0],G!==0)?G:g[1]-u[1]}e.compareChanges=t;function n(g){return g[3]===0?g[2]===0?1:g[2]:g[3]}e.getModifiedEndLineNumber=n;var a;(function(g){g.Modify="Modify",g.Add="Add",g.Delete="Delete"})(a=e.ChangeType||(e.ChangeType={}));function o(g){return g[1]-g[0]===0?a.Add:g[1]>g[0]&&g[2]===g[3]?a.Delete:a.Modify}e.getChangeType=o;function I(g){switch(o(g)){case a.Add:return{originalStartLineNumber:g[0],originalEndLineNumber:0,modifiedStartLineNumber:g[2],modifiedEndLineNumber:g[3]};case a.Modify:return{originalStartLineNumber:g[0],originalEndLineNumber:g[1],modifiedStartLineNumber:g[2],modifiedEndLineNumber:g[3]};case a.Delete:return{originalStartLineNumber:g[0],originalEndLineNumber:g[1],modifiedStartLineNumber:g[2],modifiedEndLineNumber:0};default:return{originalStartLineNumber:g[0],originalEndLineNumber:g[1],modifiedStartLineNumber:g[2],modifiedEndLineNumber:g[3]}}}e.toChange=I},54595:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirtyDiffWidget=e.DirtyDiffWidgetActionType=void 0;const n=t(41869),a=t(87308),o=t(31324),I=t(64964),g=t(84416);var u;(function(p){p[p.close=0]="close",p[p.save=1]="save",p[p.reset=2]="reset",p[p.next=3]="next",p[p.previous=4]="previous"})(u=e.DirtyDiffWidgetActionType||(e.DirtyDiffWidgetActionType={}));class G extends a.ZoneWidget{_fillContainer(b){}get uri(){return n.URI.from(this.editor.getModel().uri)}constructor(b,m,d){super(b),this.commandService=d,this._currentChangeIndex=0,this._model=m,this._wrapper=document.createElement("div"),this._head=document.createElement("div"),this._content=document.createElement("div"),this._container.appendChild(this._wrapper),this._wrapper.appendChild(this._head),this._wrapper.appendChild(this._content)}get currentIndex(){return this._currentChangeIndex}updateCurrent(b){this._currentChangeIndex=b}applyStyle(){if(!this._title)return;this._title.children[0]&&this._title.removeChild(this._title.children[0]);const b=document.createElement("span");b.className="dirty-diff-widget-title-detail",b.innerText=(0,n.formatLocalize)("scm.dirtyDiff.changes",this._currentChangeIndex,this._model.changes.length),this._title.appendChild(b)}getBorderColor(b){switch(b){case g.ChangeType.Add:return"var(--editorGutter-addedBackground)";case g.ChangeType.Modify:return"var(--editorGutter-modifiedBackground)";case g.ChangeType.Delete:return"var(--editorGutter-deletedBackground)"}}applyClass(){this._wrapper.className="dirty-diff-widget-wrapper",this._head.className="dirty-diff-widget-header",this._content.className="dirty-diff-widget-content";const b=this._model.changes[this._currentChangeIndex-1],m=(0,g.getChangeType)(b),d=this.getBorderColor(m);this._head.style.borderTopColor=d,this._head.style.borderBottomColor=d,this._content.style.borderBottomColor=d;const r=this.editor.getOption(o.EditorOption.lineHeight),l=Math.ceil(r*1.2);this._head.style.height=`${l}px`,this._renderTitle();const s=this.editor.getModel();if(!s)throw new Error("Not found model");this._title.innerText=n.path.basename(s.uri.path),this._title.className="file-name",this._actions.className="file-actions",this._renderActions()}getContentNode(){return this._content}_renderTitle(){this._head.children.length===0&&(this._title=document.createElement("div"),this._actions=document.createElement("div"),this._head.appendChild(this._title),this._head.appendChild(this._actions))}_addAction(b,m){const d=document.createElement("div");return d.className=`kt-icon codicon codicon-${b}`,this._actions.appendChild(d),d.onclick=()=>this.handleAction(m),d}_renderActions(){this._actions.children.length===0&&(this._addAction("add",u.save),this._addAction("discard",u.reset),this._addAction("arrow-up",u.next),this._addAction("arrow-down",u.previous),this._addAction("close",u.close))}relayout(b){this._relayout(b)}handleAction(b){let m;const d=this.currentRange,r=[this.uri,this._model.changes.map(g.toChange),this._currentChangeIndex-1];switch(b){case u.next:m=this._model.findNextClosestChangeLineNumber(d.startLineNumber,!1),m&&m!==d.startLineNumber&&this.commandService.executeCommand(I.OPEN_DIRTY_DIFF_WIDGET.id,m);break;case u.previous:m=this._model.findPreviousClosestChangeLineNumber(d.startLineNumber,!1),m&&m!==d.startLineNumber&&this.commandService.executeCommand(I.OPEN_DIRTY_DIFF_WIDGET.id,m);break;case u.save:this.commandService.executeCommand("git.stageChange",...r),this.dispose();break;case u.reset:this.commandService.executeCommand("git.revertChange",...r),this.dispose();break;case u.close:this.dispose();break;default:break}}}e.DirtyDiffWidget=G},71972:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirtyDiffWorkbenchController=e.DirtyDiffItem=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(43718),g=t(54414),u=t(57517),G=n.__importStar(t(20868)),p=t(62663),b=t(64964),m=t(73018),d=t(42126),r=t(24870),l=t(54595);t(22861);class s{constructor(v,f){this.model=v,this.decorator=f}dispose(){this.decorator.dispose(),this.model.dispose()}}e.DirtyDiffItem=s;let c=class extends o.Disposable{constructor(){super(),this.enabled=!1,this.models=[],this.widgets=new Map,this.items=Object.create(null),this.transientDisposables=new o.DisposableStore,this.keybindingRegistry.registerKeybinding({command:b.CLOSE_DIRTY_DIFF_WIDGET.id,keybinding:"esc",when:r.isDirtyDiffVisible.equalsTo(!0)})}start(){const v=o.Event.filter(this.scmPreferences.onPreferenceChanged,W=>W.affects("scm.diffDecorations"));this.addDispose(v(this.onDidChangeConfiguration,this)),this.onDidChangeConfiguration(),o.Event.filter(this.scmPreferences.onPreferenceChanged,W=>W.affects("scm.diffDecorationsGutterWidth"))(this.onDidChangeDiffWidthConfiguration,this),this.onDidChangeDiffWidthConfiguration(),this.addDispose(this.editorFeatureRegistry.registerEditorFeatureContribution({contribute:W=>this.attachEvents(W.monacoEditor)})),this.addDispose(this.scmPreferences.onPreferenceChanged(W=>{W.preferenceName==="scm.alwaysShowDiffWidget"&&W.newValue===!1&&this.widgets.forEach(N=>{N.dispose()})}))}onDidChangeConfiguration(){this.scmPreferences["scm.diffDecorations"]!=="none"?this.enable():this.disable()}onDidChangeDiffWidthConfiguration(){let v=this.scmPreferences["scm.diffDecorationsGutterWidth"];(isNaN(v)||v<=0||v>5)&&(v=3)}enable(){this.enabled&&this.disable(),this.transientDisposables.add(this.eventBus.on(u.EditorGroupChangeEvent,()=>{this.onEditorsChanged()})),this.onEditorsChanged(),this.enabled=!0}disable(){this.enabled&&(this.transientDisposables.clear(),this.models.forEach(v=>{const f=this.items[v.id];f&&f.dispose()}),this.models=[],this.items=Object.create(null),this.enabled=!1)}onEditorsChanged(){const v=this.editorService.editorGroups.filter(N=>N.currentOpenType&&N.currentOpenType.type===u.EditorOpenType.code).map(N=>{const Z=N.currentEditor;return Z?Z.currentDocumentModel:null}).filter((N,Z,y)=>!!N&&!!N.uri&&y.indexOf(N,Z+1)===-1),f=v.filter(N=>this.models.every(Z=>N!==Z));this.models.filter(N=>v.every(Z=>Z!==N)).forEach(N=>this.onModelInvisible(N)),f.forEach(N=>this.onModelVisible(N)),this.models=v}onModelVisible(v){const f=this.injector.get(r.DirtyDiffModel,[v]),W=this.injector.get(d.DirtyDiffDecorator,[v,f]);this.items[v.id]=new s(f,W)}onModelInvisible(v){this.items[v.id].dispose(),delete this.items[v.id]}closeDirtyDiffWidget(v){const f=this.widgets.get(v.getId());f&&f.dispose()}toggleDirtyDiffWidget(v,f){const W=v.getModel();if(W&&f){let N=this.widgets.get(v.getId());const Z=this.getModel(W);if(Z){if(N){const{currentIndex:y}=N,{count:E}=Z.getChangeFromRange(G.positionToRange(f));if(N.dispose(),y===E)return}N=new l.DirtyDiffWidget(v,Z,this.commandService),N.onDispose(()=>{this.widgets.delete(v.getId())}),Z.onClickDecoration(N,G.positionToRange(f)),this.widgets.set(v.getId(),N)}}}_doMouseDown(v,{target:f}){if(!f)return;const{position:W,type:N,element:Z}=f;if(N===p.monacoBrowser.editor.MouseTargetType.GUTTER_LINE_DECORATIONS&&Z&&Z.className.indexOf("dirty-diff-glyph")>-1&&W){const y=Z.offsetLeft;if(f.detail.offsetX-y<5)this.toggleDirtyDiffWidget(v,W);else{const R=this.widgets.get(v.getId());R&&(R.dispose(),this.widgets.delete(v.getId()))}}}attachEvents(v){const f=new o.DisposableCollection;return f.push(v.onMouseDown(W=>{this.scmPreferences["scm.alwaysShowDiffWidget"]&&this._doMouseDown(v,W)})),f.push(v.onDidChangeModel(({oldModelUrl:W})=>{if(W){const N=this.widgets.get(v.getId());N&&N.dispose()}})),f.push(v.onDidDispose(()=>{f.dispose()})),f}getModel(v){const f=this.items[v.id];return f?f.model:null}dispose(){this.disable(),this.widgets.forEach(v=>v.dispose()),this.widgets.clear(),super.dispose()}};n.__decorate([(0,a.Autowired)(m.SCMPreferences),n.__metadata("design:type",Object)],c.prototype,"scmPreferences",void 0),n.__decorate([(0,a.Autowired)(g.WorkbenchEditorService),n.__metadata("design:type",g.WorkbenchEditorService)],c.prototype,"editorService",void 0),n.__decorate([(0,a.Autowired)(u.IEditorFeatureRegistry),n.__metadata("design:type",Object)],c.prototype,"editorFeatureRegistry",void 0),n.__decorate([(0,a.Autowired)(I.IEventBus),n.__metadata("design:type",Object)],c.prototype,"eventBus",void 0),n.__decorate([(0,a.Autowired)(a.INJECTOR_TOKEN),n.__metadata("design:type",a.Injector)],c.prototype,"injector",void 0),n.__decorate([(0,a.Autowired)(I.CommandService),n.__metadata("design:type",Object)],c.prototype,"commandService",void 0),n.__decorate([(0,a.Autowired)(o.KeybindingRegistry),n.__metadata("design:type",Object)],c.prototype,"keybindingRegistry",void 0),c=n.__decorate([(0,a.Injectable)(),n.__metadata("design:paramtypes",[])],c),e.DirtyDiffWorkbenchController=c},31435:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMModule=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(64964),g=t(71972),u=t(7114),G=t(38672),p=t(73018),b=t(75756);let m=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[b.SCMContribution,I.SCMService,u.SCMBadgeController,u.SCMStatusBarController,{token:I.ISCMMenus,useClass:G.SCMMenus},{token:I.IDirtyDiffWorkbenchController,useClass:g.DirtyDiffWorkbenchController}],this.preferences=p.bindSCMPreference}};m=n.__decorate([(0,a.Injectable)()],m),e.SCMModule=m},7114:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMStatusBarController=e.SCMBadgeController=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(26542),g=t(43718),u=t(54414),G=t(63067),p=t(64964);let b=class{constructor(){this.disposables=[]}start(){for(const r of this.scmService.repositories)this.onDidAddRepository(r);this.scmService.onDidAddRepository(this.onDidAddRepository,this,this.disposables),this.render()}onDidAddRepository(r){const l=r.provider,c=o.Event.any(l.onDidChange,l.onDidChangeResources)(()=>this.render()),v=o.Event.filter(this.scmService.onDidRemoveRepository,W=>W===r)(()=>{f.dispose(),this.disposables=this.disposables.filter(W=>W!==v),this.render()}),f=(0,o.combinedDisposable)([c,v]);this.disposables.push(f)}render(){const r=this.scmService.repositories.reduce((l,s)=>typeof s.provider.count=="number"?l+s.provider.count:l+s.provider.groups.elements.reduce((c,h)=>c+h.elements.length,0),0);r>0?this.setSCMTarbarBadge(`${r}`):this.setSCMTarbarBadge("")}setSCMTarbarBadge(r){const l=this.layoutService.getTabbarHandler(p.scmContainerId);l&&l.setBadge(r)}dispose(){this.disposables=(0,o.dispose)(this.disposables)}};n.__decorate([(0,a.Autowired)(p.SCMService),n.__metadata("design:type",p.SCMService)],b.prototype,"scmService",void 0),n.__decorate([(0,a.Autowired)(G.IMainLayoutService),n.__metadata("design:type",Object)],b.prototype,"layoutService",void 0),b=n.__decorate([(0,a.Injectable)()],b),e.SCMBadgeController=b;let m=class{constructor(){this.focusDisposable=o.Disposable.None,this.focusedRepository=void 0,this.disposables=[]}start(){this.scmService.onDidAddRepository(this.onDidAddRepository,this,this.disposables);for(const r of this.scmService.repositories)this.onDidAddRepository(r);this.workbenchEditorService.onActiveResourceChange(this.onDidActiveResouceChange,this,this.disposables)}onDidAddRepository(r){const l=r.onDidFocus(()=>this.onDidFocusRepository(r)),c=o.Event.filter(this.scmService.onDidRemoveRepository,v=>v===r)(()=>{h.dispose(),this.disposables=this.disposables.filter(v=>v!==c),this.scmService.repositories.length===0?this.onDidFocusRepository(void 0):this.focusedRepository===r&&this.scmService.repositories[0].focus()}),h=(0,o.combinedDisposable)([l,c]);this.disposables.push(h),this.focusedRepository||this.onDidFocusRepository(r)}onDidActiveResouceChange(){const r=this.workbenchEditorService.currentResource;if(!r||r.uri.scheme!==g.Schemes.file)return;let l=null,s=Number.NEGATIVE_INFINITY;for(const c of this.scmService.repositories){const h=c.provider.rootUri;if(!h)continue;const v=h.fsPath,f=o.strings.commonPrefixLength(v,r.uri.codeUri.fsPath);f===v.length&&f>s&&(l=c,s=f)}l&&this.onDidFocusRepository(l)}onDidFocusRepository(r){this.focusedRepository!==r&&(this.focusedRepository=r,this.focusDisposable.dispose(),r&&r.provider.onDidChangeStatusBarCommands&&(this.focusDisposable=r.provider.onDidChangeStatusBarCommands(()=>this.render(r))),this.render(r))}render(r){if(!r)return;const l=r.provider.statusBarCommands||[];if(!l.length)return;const s=this.getRepoLabel(r);l.forEach((c,h)=>{this.disposables.push(this.statusbarService.addElement(`status.scm.repo.${h}`,{id:"status.scm",text:c.title,name:(0,g.localize)("status-bar.scm"),priority:1e4,alignment:I.StatusBarAlignment.LEFT,command:c.id,arguments:c.arguments,tooltip:`${s} - ${c.tooltip||c.title}`}))})}getRepoLabel(r){return r.provider.rootUri?`${o.path.basename(r.provider.rootUri.path)} (${r.provider.label})`:r.provider.label}dispose(){this.focusDisposable.dispose(),this.disposables=(0,o.dispose)(this.disposables)}};n.__decorate([(0,a.Autowired)(p.SCMService),n.__metadata("design:type",p.SCMService)],m.prototype,"scmService",void 0),n.__decorate([(0,a.Autowired)(I.IStatusBarService),n.__metadata("design:type",Object)],m.prototype,"statusbarService",void 0),n.__decorate([(0,a.Autowired)(u.WorkbenchEditorService),n.__metadata("design:type",u.WorkbenchEditorService)],m.prototype,"workbenchEditorService",void 0),m=n.__decorate([(0,a.Injectable)()],m),e.SCMStatusBarController=m},7168:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.overviewRulerDeletedForeground=e.overviewRulerAddedForeground=e.overviewRulerModifiedForeground=e.minimapGutterDeletedBackground=e.minimapGutterAddedBackground=e.minimapGutterModifiedBackground=e.editorGutterDeletedBackground=e.editorGutterAddedBackground=e.editorGutterModifiedBackground=void 0;const n=t(43718),a=t(52416);e.editorGutterModifiedBackground=(0,a.registerColor)("editorGutter.modifiedBackground",{dark:new a.Color(new a.RGBA(27,129,168)),light:new a.Color(new a.RGBA(32,144,211)),hcDark:new a.Color(new a.RGBA(27,128,168)),hcLight:new a.Color(new a.RGBA(32,144,211))},(0,n.localize)("editorGutterModifiedBackground","Editor gutter background color for lines that are modified.")),e.editorGutterAddedBackground=(0,a.registerColor)("editorGutter.addedBackground",{dark:new a.Color(new a.RGBA(72,126,2)),light:new a.Color(new a.RGBA(72,152,93)),hcDark:new a.Color(new a.RGBA(72,126,2)),hcLight:new a.Color(new a.RGBA(72,152,93))},(0,n.localize)("editorGutterAddedBackground","Editor gutter background color for lines that are added.")),e.editorGutterDeletedBackground=(0,a.registerColor)("editorGutter.deletedBackground",{dark:a.editorErrorForeground,light:a.editorErrorForeground,hcDark:a.editorErrorForeground,hcLight:a.editorErrorForeground},(0,n.localize)("editorGutterDeletedBackground","Editor gutter background color for lines that are deleted.")),e.minimapGutterModifiedBackground=(0,a.registerColor)("minimapGutter.modifiedBackground",{dark:e.editorGutterModifiedBackground,light:e.editorGutterModifiedBackground,hcDark:e.editorGutterModifiedBackground,hcLight:e.editorGutterModifiedBackground},(0,n.localize)("minimapGutterModifiedBackground","Minimap gutter background color for lines that are modified.")),e.minimapGutterAddedBackground=(0,a.registerColor)("minimapGutter.addedBackground",{dark:e.editorGutterAddedBackground,light:e.editorGutterAddedBackground,hcDark:e.editorGutterAddedBackground,hcLight:e.editorGutterAddedBackground},(0,n.localize)("minimapGutterAddedBackground","Minimap gutter background color for lines that are added.")),e.minimapGutterDeletedBackground=(0,a.registerColor)("minimapGutter.deletedBackground",{dark:e.editorGutterDeletedBackground,light:e.editorGutterDeletedBackground,hcDark:e.editorGutterDeletedBackground,hcLight:e.editorGutterDeletedBackground},(0,n.localize)("minimapGutterDeletedBackground","Minimap gutter background color for lines that are deleted.")),e.overviewRulerModifiedForeground=(0,a.registerColor)("editorOverviewRuler.modifiedForeground",{dark:(0,a.transparent)(e.editorGutterModifiedBackground,.6),light:(0,a.transparent)(e.editorGutterModifiedBackground,.6),hcDark:(0,a.transparent)(e.editorGutterModifiedBackground,.6),hcLight:(0,a.transparent)(e.editorGutterModifiedBackground,.6)},(0,n.localize)("overviewRulerModifiedForeground","Overview ruler marker color for modified content.")),e.overviewRulerAddedForeground=(0,a.registerColor)("editorOverviewRuler.addedForeground",{dark:(0,a.transparent)(e.editorGutterAddedBackground,.6),light:(0,a.transparent)(e.editorGutterAddedBackground,.6),hcDark:(0,a.transparent)(e.editorGutterAddedBackground,.6),hcLight:(0,a.transparent)(e.editorGutterAddedBackground,.6)},(0,n.localize)("overviewRulerAddedForeground","Overview ruler marker color for added content.")),e.overviewRulerDeletedForeground=(0,a.registerColor)("editorOverviewRuler.deletedForeground",{dark:(0,a.transparent)(e.editorGutterDeletedBackground,.6),light:(0,a.transparent)(e.editorGutterDeletedBackground,.6),hcDark:(0,a.transparent)(e.editorGutterDeletedBackground,.6),hcLight:(0,a.transparent)(e.editorGutterDeletedBackground,.6)},(0,n.localize)("overviewRulerDeletedForeground","Overview ruler marker color for deleted content."))},38672:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMMenus=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(93899),g=t(43718),u=t(64964),G=t(36367);let p=class extends g.Disposable{constructor(r){super(),this.contextKeyService=r}get resourceGroupMenu(){return this._resourceGroupMenu||(this._resourceGroupMenu=this.registerDispose(this.menuService.createMenu({id:I.MenuId.SCMResourceGroupContext,contextKeyService:this.contextKeyService,config:{separator:"inline"}}))),this._resourceGroupMenu}get resourceFolderMenu(){return this._resourceFolderMenu||(this._resourceFolderMenu=this.registerDispose(this.menuService.createMenu({id:I.MenuId.SCMResourceFolderContext,contextKeyService:this.contextKeyService,config:{separator:"inline"}}))),this._resourceFolderMenu}getResourceMenu(r){const l=r.contextValue;if(typeof l>"u")return this.resourceMenu||(this.resourceMenu=this.registerDispose(this.menuService.createMenu({id:I.MenuId.SCMResourceContext,contextKeyService:this.contextKeyService,config:{separator:"inline"}}))),this.resourceMenu;this.contextualResourceMenu||(this.contextualResourceMenu=new Map);let s=this.contextualResourceMenu.get(l);if(!s){const c=this.contextKeyService.createScoped();(0,G.isSCMResource)(r)&&c.createKey("scmResourceState",l),s=this.registerDispose(this.menuService.createMenu({id:I.MenuId.SCMResourceContext,contextKeyService:c,config:{separator:"inline"}})),this.addDispose(c),this.contextualResourceMenu.set(l,s)}return s}dispose(){var r,l;super.dispose(),(r=this.resourceGroupMenu)===null||r===void 0||r.dispose(),(l=this.resourceMenu)===null||l===void 0||l.dispose(),this.contextualResourceMenu&&(this.contextualResourceMenu.clear(),this.contextualResourceMenu=void 0)}};n.__decorate([(0,a.Autowired)(I.AbstractContextMenuService),n.__metadata("design:type",I.AbstractContextMenuService)],p.prototype,"menuService",void 0),p=n.__decorate([(0,a.Injectable)({multiple:!0}),n.__param(0,(0,a.Optional)()),n.__metadata("design:paramtypes",[Object])],p);let b=class extends g.Disposable{constructor(r){var l;super(),this.resourceGroups=[],this.resourceGroupMenusItems=new Map;const s=this.injector.get(o.IContextKeyService);this.scopedContextKeyService=this.registerDispose(s.createScoped()),this.scopedContextKeyService.createKey("scmProvider",r.contextValue),this.scopedContextKeyService.createKey("scmProviderRootUri",(l=r.rootUri)===null||l===void 0?void 0:l.toString()),this.scopedContextKeyService.createKey("scmProviderHasRootUri",!!r.rootUri),this.onDidSpliceGroups({start:0,deleteCount:0,toInsert:r.groups.elements}),r.groups.onDidSplice(this.onDidSpliceGroups,this,this.disposables)}onDidSpliceGroups({start:r,deleteCount:l,toInsert:s}){const c=this.resourceGroups.splice(r,l,...s);for(const h of c){const v=this.resourceGroupMenusItems.get(h);v?.dispose(),this.resourceGroupMenusItems.delete(h)}}dispose(){super.dispose(),this.resourceGroupMenusItems.forEach(r=>r.dispose())}getResourceGroupMenu(r){return this.getResourceGroupMenus(r).resourceGroupMenu}getResourceMenu(r){return this.getResourceGroupMenus(r.resourceGroup).getResourceMenu(r)}getResourceFolderMenu(r){return this.getResourceGroupMenus(r).resourceFolderMenu}getResourceGroupMenus(r){let l=this.resourceGroupMenusItems.get(r);if(!l){const s=this.registerDispose(this.scopedContextKeyService.createScoped());s.createKey("scmResourceGroup",r.id),l=this.registerDispose(this.injector.get(p,[s])),this.resourceGroupMenusItems.set(r,l)}return l}get titleMenu(){return this._titleMenu||(this._titleMenu=this.registerDispose(this.menuService.createMenu({id:I.MenuId.SCMTitle,contextKeyService:this.scopedContextKeyService}))),this._titleMenu}get inputMenu(){return this._inputMenu||(this._inputMenu=this.registerDispose(this.menuService.createMenu({id:I.MenuId.SCMInput,contextKeyService:this.scopedContextKeyService}))),this._inputMenu}};n.__decorate([(0,a.Autowired)(I.AbstractContextMenuService),n.__metadata("design:type",I.AbstractContextMenuService)],b.prototype,"menuService",void 0),n.__decorate([(0,a.Autowired)(a.INJECTOR_TOKEN),n.__metadata("design:type",a.Injector)],b.prototype,"injector",void 0),b=n.__decorate([(0,a.Injectable)({multiple:!0}),n.__param(0,(0,a.Optional)()),n.__metadata("design:paramtypes",[Object])],b);let m=class extends g.Disposable{constructor(){super(),this.menus=new Map,this.scmService.onDidRemoveRepository(this.onDidRemoveRepository,this,this.disposables)}onDidRemoveRepository(r){const l=this.menus.get(r.provider);l?.dispose(),this.menus.delete(r.provider)}getRepositoryMenus(r){let l=this.menus.get(r);if(!l){const s=this.injector.get(b,[r]);l={menus:s,dispose:()=>{s.dispose(),this.menus.delete(r)}},this.menus.set(r,l)}return l.menus}};n.__decorate([(0,a.Autowired)(a.INJECTOR_TOKEN),n.__metadata("design:type",a.Injector)],m.prototype,"injector",void 0),n.__decorate([(0,a.Autowired)(u.SCMService),n.__metadata("design:type",u.SCMService)],m.prototype,"scmService",void 0),m=n.__decorate([(0,a.Injectable)(),n.__metadata("design:paramtypes",[])],m),e.SCMMenus=m},49914:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ViewModelContext=e.ResourceGroupSplicer=void 0;const n=t(85608),a=t(83794),o=t(76003),I=t(41869),g=t(43718),u=t(64964);class G{constructor(d){this.repository=d,this.items=[],this.disposables=[],this._onDidSplice=new g.Emitter,this.onDidSplice=this._onDidSplice.event}run(){const d=this.repository.provider.groups;d.onDidSplice(this.onDidSpliceGroups,this,this.disposables),this.onDidSpliceGroups({start:0,deleteCount:0,toInsert:d.elements})}onDidSpliceGroups({start:d,deleteCount:r,toInsert:l}){let s=0;for(let W=0;W<d;W++){const N=this.items[W];s+=(N.visible?1:0)+N.group.elements.length}let c=0;for(let W=0;W<r;W++){const N=this.items[d+W];c+=(N.visible?1:0)+N.group.elements.length}const h=[],v=[];for(const W of l){const N=p(W);N&&v.push(W);for(const y of W.elements)v.push(y);const Z=(0,g.combinedDisposable)([W.onDidChange(()=>this.onDidChangeGroup(W)),W.onDidSplice(y=>this.onDidSpliceGroup(W,y))]);h.push({group:W,visible:N,disposable:Z})}const f=this.items.splice(d,r,...h);for(const W of f)W.disposable.dispose();this._onDidSplice.fire({target:this.repository,index:s,deleteCount:c,elements:v})}onDidChangeGroup(d){const r=this.items.findIndex(h=>h.group===d);if(r<0)return;const l=this.items[r],s=p(d);if(l.visible===s)return;let c=0;for(let h=0;h<r;h++){const v=this.items[h];c+=(v.visible?1:0)+v.group.elements.length}s?this._onDidSplice.fire({target:this.repository,index:c,deleteCount:0,elements:[d,...d.elements]}):this._onDidSplice.fire({target:this.repository,index:c,deleteCount:1+d.elements.length,elements:[]}),l.visible=s}onDidSpliceGroup(d,{start:r,deleteCount:l,toInsert:s}){const c=this.items.findIndex(W=>W.group===d);if(c<0)return;const h=this.items[c],v=p(d);if(!h.visible&&!v)return;let f=r;for(let W=0;W<c;W++){const N=this.items[W];f+=(N.visible?1:0)+N.group.elements.length}h.visible&&!v?this._onDidSplice.fire({target:this.repository,index:f,deleteCount:1+l,elements:s}):!h.visible&&v?this._onDidSplice.fire({target:this.repository,index:f,deleteCount:l,elements:[d,...s]}):this._onDidSplice.fire({target:this.repository,index:f+1,deleteCount:l,elements:s}),h.visible=v}dispose(){this.onDidSpliceGroups({start:0,deleteCount:this.items.length,toInsert:[]}),this.disposables=(0,g.dispose)(this.disposables)}}e.ResourceGroupSplicer=G;function p(m){return m.elements.length>0||!m.hideWhenEmpty}let b=class extends g.Disposable{get onDidSelectedRepoChange(){return this.onDidSelectedRepoChangeEmitter.event}get onAlwaysShowActionsChange(){return this.onAlwaysShowActionsChangeEmitter.event}get menus(){return this._menus}constructor(){super(),this.onDidSelectedRepoChangeEmitter=new g.Emitter,this.onAlwaysShowActionsChangeEmitter=new g.Emitter,this.onDidSCMListChangeEmitter=new g.Emitter,this.onDidSCMListChange=this.onDidSCMListChangeEmitter.event,this.onDidSCMRepoListChangeEmitter=new g.Emitter,this.onDidSCMRepoListChange=this.onDidSCMRepoListChangeEmitter.event,this.repoList=[],this.scmList=new Array,this.selectedRepos=a.observable.array([]),this.spliceSCMList=(d,r,l,...s)=>{!this._currentWorkspace||this._currentWorkspace.toString()===d.toString()?this.scmList.splice(r,l,...s):this.scmList=[...s],this._currentWorkspace=d,this.onDidSCMListChangeEmitter.fire()},(0,a.makeObservable)(this),this.start(),this.initTreeAlwaysShowActions(),this.scmService.onDidChangeSelectedRepositories(this._handleSelectedRepoChanged,this,this.disposables),this._handleSelectedRepoChanged(this.scmService.selectedRepositories)}_handleSelectedRepoChanged(d){const[r]=d;r&&(this.toDisposableListener&&(this.toDisposableListener.dispose(),this.toDisposableListener=null),this.toDisposableListener=this.listenToCurrentRepo(r))}listenToCurrentRepo(d){const r=new g.DisposableStore,l=new G(d),s=g.Event.filter(l.onDidSplice,c=>c.target===d);return r.add(s(({index:c,deleteCount:h,elements:v})=>{if(v.some(f=>f.id==="merge")){const f=[],W={};v.forEach(N=>{Array.isArray(N.elements)&&N.elements.forEach(Z=>{f.push(Z.sourceUri),W[Z.sourceUri.toString()]=!0})}),this.commandService.executeCommand("setContext","git.mergeChanges",f),this.commandService.executeCommand("setContext","git.mergeChangesObj",W)}d.provider.rootUri&&this.spliceSCMList(d.provider.rootUri,c,h,...v)})),l.run(),r.add(l),(0,g.toDisposable)(()=>{r.clear()})}initTreeAlwaysShowActions(){this.alwaysShowActions=!!this.preferenceService.get("scm.alwaysShowActions"),this.disposables.push(this.preferenceService.onSpecificPreferenceChange("scm.alwaysShowActions",d=>{this.alwaysShowActions!==d.newValue&&this.updateAlwaysShowActions(d.newValue)}))}start(){this.scmService.onDidAddRepository(d=>{this.addRepo(d)},this,this.disposables),this.scmService.onDidRemoveRepository(d=>{this.deleteRepo(d)},this,this.disposables),this.scmService.onDidChangeSelectedRepositories(d=>{this.changeSelectedRepos(d)},this,this.disposables),this.scmService.repositories.forEach(d=>{this.addRepo(d)})}updateAlwaysShowActions(d){this.alwaysShowActions=d,this.onAlwaysShowActionsChangeEmitter.fire(d)}addRepo(d){if(this.repoList.find(r=>{var l,s;return((l=r.provider.rootUri)===null||l===void 0?void 0:l.toString())===((s=d.provider.rootUri)===null||s===void 0?void 0:s.toString())})){this.logger.warn("duplicate scm repo",d);return}this.repoList.push(d),d.selected&&this.repoList.length===1&&this.changeSelectedRepos([d]),this.onDidSCMRepoListChangeEmitter.fire(this.repoList)}deleteRepo(d){const r=this.repoList.indexOf(d);if(r<0){this.logger.warn("no such scm repo",d);return}this.repoList.splice(r,1),this.onDidSCMRepoListChangeEmitter.fire(this.repoList)}changeSelectedRepos(d){this.selectedRepos.replace(d);const r=d[0];this.selectedRepo=r,this.onDidSelectedRepoChangeEmitter.fire(r)}};n.__decorate([(0,o.Autowired)(u.SCMService),n.__metadata("design:type",u.SCMService)],b.prototype,"scmService",void 0),n.__decorate([(0,o.Autowired)(u.ISCMMenus),n.__metadata("design:type",Object)],b.prototype,"_menus",void 0),n.__decorate([(0,o.Autowired)(I.PreferenceService),n.__metadata("design:type",Object)],b.prototype,"preferenceService",void 0),n.__decorate([(0,o.Autowired)(g.CommandService),n.__metadata("design:type",Object)],b.prototype,"commandService",void 0),n.__decorate([(0,o.Autowired)(g.ILogger),n.__metadata("design:type",Object)],b.prototype,"logger",void 0),n.__decorate([a.observable,n.__metadata("design:type",Object)],b.prototype,"selectedRepos",void 0),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[Array]),n.__metadata("design:returntype",void 0)],b.prototype,"changeSelectedRepos",null),b=n.__decorate([(0,o.Injectable)(),n.__metadata("design:paramtypes",[])],b),e.ViewModelContext=b},73018:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.bindSCMPreference=e.SCMPreferences=e.scmPreferenceSchema=void 0;const n=t(41869),a=t(64964);e.scmPreferenceSchema={id:"scm",order:5,title:(0,n.localize)("scmConfigurationTitle","SCM"),type:"object",properties:{"scm.alwaysShowProviders":{type:"boolean",description:(0,n.localize)("alwaysShowProviders","Controls whether to always show the Source Control Provider section."),default:!1},"scm.providers.visible":{type:"number",description:(0,n.localize)("providersVisible","Controls how many providers are visible in the Source Control Provider section. Set to `0` to be able to manually resize the view."),default:10},"scm.diffDecorations":{type:"string",enum:["all","gutter","overview","none"],default:"all",description:(0,n.localize)("diffDecorations","Controls diff decorations in the editor.")},"scm.alwaysShowDiffWidget":{type:"boolean",description:(0,n.localize)("alwaysShowDiffWidget","Controls whether to always click to show the Dirty Diff Widget."),default:!0},"scm.diffDecorationsGutterWidth":{type:"number",enum:[1,2,3,4,5],default:3,description:(0,n.localize)("diffGutterWidth","Controls the width(px) of diff decorations in gutter (added & modified).")},"scm.alwaysShowActions":{type:"boolean",description:(0,n.localize)("alwaysShowActions","Controls whether inline actions are always visible in the Source Control view."),default:!1},"scm.defaultViewMode":{type:"string",enum:[a.SCMViewModelMode.Tree,a.SCMViewModelMode.List],description:(0,n.localize)("scm.defaultViewMode","Controls the default Source Control repository view mode."),default:a.SCMViewModelMode.List},"scm.listView.compactFolders":{type:"boolean",description:(0,n.localize)("scmListViewCompactFolders","Controls whether the source control view should render folders in a compact form. In such a form, single child folders will be compressed in a combined tree element."),default:!0}}},e.SCMPreferences=Symbol("SCMPreferences");function o(I){I.addProviders({token:e.SCMPreferences,useFactory:g=>{const u=g.get(n.PreferenceService);return(0,n.createPreferenceProxy)(u,e.scmPreferenceSchema)}})}e.bindSCMPreference=o},36367:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getSCMRepositoryDesc=e.getSCMResourceGroupContextValue=e.isSCMResourceGroup=e.isSCMResource=void 0;const n=t(41869),{basename:a}=n.path;function o(G){return!!G.sourceUri&&I(G.resourceGroup)}e.isSCMResource=o;function I(G){return!!G.provider&&!!G.elements}e.isSCMResourceGroup=I;function g(G){return o(G)?G.resourceGroup.id:G.id}e.getSCMResourceGroupContextValue=g;function u(G){const p=G.provider.rootUri,b=p?a(G.provider.rootUri.path):G.provider.label,m=p?G.provider.label:"";return{title:b,type:m}}e.getSCMRepositoryDesc=u},94556:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMViewContainer=e.SCMProvidersView=e.SCMResourcesViewWrapper=e.SCMResourcesView=void 0;const n=t(85608),a=t(25150),o=n.__importStar(t(14041)),I=t(41869),g=t(25918),u=t(1149),G=t(93899),p=t(43718),b=t(70936),m=t(91527),d=t(24429),r=t(64964),l=t(57492),s=t(37751),c=t(24748),h=t(49914),v=t(36367),f=n.__importDefault(t(41373)),W=38,N=38,Z=10;e.SCMResourcesView=(0,a.observer)(({repository:E,viewState:R})=>{const A=(0,I.useInjectable)(I.IContextKeyService),w=(0,I.useInjectable)(G.IMenuRegistry),F=(0,I.useInjectable)(h.ViewModelContext),V=(0,o.useRef)(null),Y=(0,o.useRef)(),_=(0,o.useRef)({}),[H,S]=(0,o.useState)();(0,o.useEffect)(()=>{V&&V.current&&(_.current.ctx=A.createScoped(V.current))},[]),(0,o.useEffect)(()=>{_.current.ctx&&_.current.ctx.createKey("scmRepository",E),X();const M=E.provider.onDidChange(()=>{X()});return()=>{M.dispose()}},[E]);const X=(0,o.useCallback)(()=>{var M;if((M=Y.current)===null||M===void 0||M.dispose(),Y.current=new p.DisposableCollection,!!E.provider.actionButton){if(Y.current.push(w.registerMenuItem(G.MenuId.SCMInput,{command:{id:E.provider.actionButton.command.id,label:E.provider.actionButton.command.title},extraTailArgs:E.provider.actionButton.command.arguments,group:"navigation",type:"primary",enabledWhen:E.provider.actionButton.enabled?"true":"false"})),Array.isArray(E.provider.actionButton.secondaryCommands))for(let T=0;T<E.provider.actionButton.secondaryCommands.length;T++)for(const x of E.provider.actionButton.secondaryCommands[T])Y.current.push(w.registerMenuItem(G.MenuId.SCMInput,{command:{id:x.id,label:x.title},extraTailArgs:x.arguments,group:`${T}_secondary`,enabledWhen:E.provider.actionButton.enabled?"true":"false"}));Q()}},[E,Y.current]),Q=(0,o.useCallback)(()=>{const M=F.menus.getRepositoryMenus(E.provider);M&&S(M.inputMenu)},[E,H]),O=E&&E.provider&&H;return o.default.createElement("div",{className:f.default.view,ref:V},o.default.createElement("div",{className:f.default.scm,style:{paddingTop:Z}},o.default.createElement(s.SCMResourceInput,{repository:E,menus:H}),o.default.createElement(c.SCMResourceTree,{height:R.height-W-Z-(O?N:0)})))}),e.SCMResourcesView.displayName="SCMResourcesView",e.SCMResourcesViewWrapper=(0,a.observer)(E=>{const R=(0,I.useInjectable)(h.ViewModelContext);if(!R.selectedRepos.length)return o.default.createElement(d.WelcomeView,{viewId:r.SCM_WELCOME_ID});const A=R.selectedRepos[0];return!A||!A.provider?null:o.default.createElement(e.SCMResourcesView,{repository:A,viewState:E.viewState})}),e.SCMResourcesViewWrapper.displayName="SCMResourcesViewWrapper",e.SCMProvidersView=(0,o.memo)(({viewState:E,repoList:R,selectedRepo:A})=>o.default.createElement("div",{className:f.default.view},R.length>1&&o.default.createElement(l.SCMProviderList,{viewState:E,repositoryList:R,selectedRepository:A}))),e.SCMProvidersView.displayName="SCMProvidersView";const y=E=>{const R=(0,I.useInjectable)(h.ViewModelContext),A=(0,I.useInjectable)(I.AppConfig),w=R.selectedRepo,F=(0,I.useInjectable)(u.LayoutViewSizeConfig),[V,Y]=(0,o.useState)([]),_=(0,o.useCallback)(()=>{Y([...R.repoList])},[V,R]);(0,o.useEffect)(()=>{const M=new p.DisposableCollection;return M.push(R.onDidSCMListChange(_)),M.push(R.onDidSCMRepoListChange(_)),()=>{M.dispose()}},[R]);const H=V.length>1,S=(0,o.useMemo)(()=>V.length===1&&w?`${(0,p.localize)("scm.title")}: ${w.provider.label}`:(0,p.localize)("scm.title"),[V,w]),X=(0,o.useMemo)(()=>{let M=(0,p.localize)("scm.title");if(H&&w){const{title:T,type:x}=(0,v.getSCMRepositoryDesc)(w);M=T+"-"+x}return M},[H,w]),Q=(0,o.useMemo)(()=>{if(w)return R.menus.getRepositoryMenus(w?.provider).titleMenu},[w]),O=(0,o.useMemo)(()=>{const M={component:e.SCMProvidersView,id:r.scmProviderViewId,name:(0,p.localize)("scm.provider.title"),initialProps:{viewState:E.viewState,repoList:V,selectedRepo:w},priority:0},T={component:e.SCMResourcesViewWrapper,id:r.scmResourceViewId,name:X,titleMenu:H&&Q||void 0,titleMenuContext:w&&w.provider&&[w.provider],priority:1};return(H?[M]:[]).concat(T)},[H,X,w,V]);return o.default.createElement("div",{className:f.default.view},o.default.createElement(m.TitleBar,{title:S,height:F.panelTitleBarHeight,menubar:!H&&Q?o.default.createElement(g.InlineMenuBar,{menus:Q,context:w&&w.provider&&[w.provider],moreTitle:(0,p.localize)("scm.action.git.more","More Actions")}):null}),o.default.createElement(b.AccordionContainer,{views:O,containerId:r.scmContainerId,style:{height:`calc(100% - ${F.panelTitleBarHeight}px)`}}))};e.SCMViewContainer=y,e.SCMViewContainer.displayName="SCMViewContainer"},75756:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMContribution=e.SCM_ACCEPT_INPUT=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(21634),g=t(68456),u=t(93899),G=t(43718),p=t(98295),b=t(23418),m=t(63067),d=t(64964),r=t(38563),l=t(63451),s=t(71972),c=t(7114),h=t(73018),v=t(94556);e.SCM_ACCEPT_INPUT={id:"scm.acceptInput"};let f=class{constructor(){this.toDispose=new o.Disposable,this.schema=h.scmPreferenceSchema,this.diffChangesIndex=new Map}onStart(){this.viewsRegistry.registerViewWelcomeContent(d.scmResourceViewId,{content:(0,G.localize)("welcome-view.noOpenRepo","No source control providers registered."),when:"default"}),this.extensionsPointService.appendExtensionPoint(["browserViews","properties"],{extensionPoint:d.scmContainerId,frameworkKind:["opensumi"],jsonSchema:Object.assign(Object.assign({},I.browserViews.properties),{description:(0,G.formatLocalize)("sumiContributes.browserViews.location.custom",(0,G.localize)("status-bar.scm"))})})}onDidRender(){[this.statusUpdater,this.statusBarController,this.dirtyDiffWorkbenchController].forEach(N=>{N.start(),this.toDispose.addDispose(N)})}onStop(){this.toDispose.dispose()}registerCommands(N){N.registerCommand(d.OPEN_DIRTY_DIFF_WIDGET,{execute:async Z=>{const y=this.editorService.currentEditor;if(y){const E=y.monacoEditor;this.dirtyDiffWorkbenchController.toggleDirtyDiffWidget(E,{lineNumber:Z,column:1}),setTimeout(()=>{E.revealLineInCenter(Z)},0)}}}),N.registerCommand(d.CLOSE_DIRTY_DIFF_WIDGET,{execute:async()=>{const Z=this.editorService.currentEditor;if(Z){const y=Z.monacoEditor;this.dirtyDiffWorkbenchController.closeDirtyDiffWidget(y)}}}),N.registerCommand(d.GOTO_PREVIOUS_CHANGE,{execute:()=>{var Z;const y=this.editorService.currentEditor;if(y&&y.currentUri){const E=this.getDiffChangeLineNumber(y.currentUri,y,"previous");y.monacoEditor.focus();const R=(Z=y.monacoEditor.getPosition())===null||Z===void 0?void 0:Z.with(E,0);y.monacoEditor.setPosition(R),y.monacoEditor.revealLineInCenter(E)}}}),N.registerCommand(d.GOTO_NEXT_CHANGE,{execute:()=>{var Z;const y=this.editorService.currentEditor;if(y&&y.currentUri){const E=this.getDiffChangeLineNumber(y.currentUri,y,"next");y.monacoEditor.focus();const R=(Z=y.monacoEditor.getPosition())===null||Z===void 0?void 0:Z.with(E,0);y.monacoEditor.setPosition(R),y.monacoEditor.revealLineInCenter(E)}}}),N.registerCommand(d.TOGGLE_DIFF_SIDE_BY_SIDE,{execute:()=>{const Z=!this.preferenceService.get("diffEditor.renderSideBySide");this.preferenceService.set("diffEditor.renderSideBySide",Z,G.PreferenceScope.User)}}),N.registerCommand(d.SET_SCM_TREE_VIEW_MODE,{execute:()=>{this.scmTreeService.changeTreeMode(!0)}}),N.registerCommand(d.SET_SCM_LIST_VIEW_MODE,{execute:()=>{this.scmTreeService.changeTreeMode(!1)}}),N.registerCommand(o.SCM_COMMANDS.GetSCMResource,{execute:async Z=>this.scmTreeAPI.getSCMResource(Z)})}registerComponent(N){N.register("@opensumi/ide-scm",[],{iconClass:(0,o.getIcon)("scm"),title:(0,G.localize)("scm.title"),priority:8,containerId:d.scmContainerId,component:v.SCMViewContainer,activateKeyBinding:"ctrlcmd+shift+g"})}registerMenus(N){N.registerMenuItem(u.MenuId.EditorTitle,{command:{id:d.GOTO_PREVIOUS_CHANGE.id,label:(0,G.localize)("scm.diff.change.previous")},when:"isInDiffEditor",iconClass:(0,o.getIcon)("arrowup"),group:"navigation"}),N.registerMenuItem(u.MenuId.EditorTitle,{command:{id:d.GOTO_NEXT_CHANGE.id,label:(0,G.localize)("scm.diff.change.next")},iconClass:(0,o.getIcon)("arrowdown"),when:"isInDiffEditor",group:"navigation"}),N.registerMenuItem(u.MenuId.EditorTitle,{command:{id:d.TOGGLE_DIFF_SIDE_BY_SIDE.id,label:(0,G.localize)("scm.diff.toggle.renderSideBySide")},when:"isInDiffEditor",group:"1_internal"}),N.registerMenuItem(u.MenuId.SCMTitle,{command:{id:d.SET_SCM_TREE_VIEW_MODE.id,label:(0,G.localize)("setTreeViewMode","View as Tree")},iconClass:(0,o.getExternalIcon)("list-tree"),when:`config.scm.defaultViewMode == ${d.SCMViewModelMode.List}`,group:"navigation",order:-1}),N.registerMenuItem(u.MenuId.SCMTitle,{command:{id:d.SET_SCM_LIST_VIEW_MODE.id,label:(0,G.localize)("setListViewMode","View as List")},iconClass:(0,o.getExternalIcon)("list-flat"),when:`config.scm.defaultViewMode == ${d.SCMViewModelMode.Tree}`,group:"navigation",order:-1})}getDiffChangesIndex(N,Z){return this.diffChangesIndex.has(N)||(Z.onDispose(()=>{this.diffChangesIndex.delete(N)}),this.diffChangesIndex.set(N,0)),this.diffChangesIndex.get(N)}getDiffEditor(N){const Z=N.getId(),[y]=this.editorCollectionService.listDiffEditors().filter(E=>E.modifiedEditor.getId()===Z||E.originalEditor.getId()===Z);return y}getDiffChangeLineNumber(N,Z,y){const E=this.getDiffChangesIndex(N,Z),A=this.getDiffEditor(Z).getLineChanges()||[];if(!A||A.length===0)return 0;let w=0;return y==="previous"?w=E-1<0?A.length-1:E-1:w=E>=A.length-1?0:E+1,this.diffChangesIndex.set(N,w),A[w][2]}};n.__decorate([(0,a.Autowired)(c.SCMBadgeController),n.__metadata("design:type",c.SCMBadgeController)],f.prototype,"statusUpdater",void 0),n.__decorate([(0,a.Autowired)(c.SCMStatusBarController),n.__metadata("design:type",c.SCMStatusBarController)],f.prototype,"statusBarController",void 0),n.__decorate([(0,a.Autowired)(b.WorkbenchEditorService),n.__metadata("design:type",b.WorkbenchEditorService)],f.prototype,"editorService",void 0),n.__decorate([(0,a.Autowired)(d.IDirtyDiffWorkbenchController),n.__metadata("design:type",s.DirtyDiffWorkbenchController)],f.prototype,"dirtyDiffWorkbenchController",void 0),n.__decorate([(0,a.Autowired)(b.EditorCollectionService),n.__metadata("design:type",b.EditorCollectionService)],f.prototype,"editorCollectionService",void 0),n.__decorate([(0,a.Autowired)(m.IMainLayoutService),n.__metadata("design:type",Object)],f.prototype,"mainlayoutService",void 0),n.__decorate([(0,a.Autowired)(o.PreferenceService),n.__metadata("design:type",Object)],f.prototype,"preferenceService",void 0),n.__decorate([(0,a.Autowired)(),n.__metadata("design:type",l.SCMTreeService)],f.prototype,"scmTreeService",void 0),n.__decorate([(0,a.Autowired)(),n.__metadata("design:type",r.SCMTreeAPI)],f.prototype,"scmTreeAPI",void 0),n.__decorate([(0,a.Autowired)(m.IViewsRegistry),n.__metadata("design:type",Object)],f.prototype,"viewsRegistry",void 0),n.__decorate([(0,a.Autowired)(G.IExtensionsSchemaService),n.__metadata("design:type",Object)],f.prototype,"extensionsPointService",void 0),f=n.__decorate([(0,p.Domain)(o.ClientAppContribution,G.CommandContribution,g.ComponentContribution,o.PreferenceContribution,m.MainLayoutContribution,u.MenuContribution)],f),e.SCMContribution=f},49814:(L,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GOTO_PREVIOUS_CHANGE=e.GOTO_NEXT_CHANGE=e.CLOSE_DIRTY_DIFF_WIDGET=e.OPEN_DIRTY_DIFF_WIDGET=e.IDirtyDiffWorkbenchController=void 0,e.IDirtyDiffWorkbenchController=Symbol("DirtyDiffWorkbenchController"),e.OPEN_DIRTY_DIFF_WIDGET={id:"OPEN_DIRTY_DIFF_WIDGET"},e.CLOSE_DIRTY_DIFF_WIDGET={id:"CLOSE_DIRTY_DIFF_WIDGET"},e.GOTO_NEXT_CHANGE={id:"workbench.action.compareEditor.nextChange"},e.GOTO_PREVIOUS_CHANGE={id:"workbench.action.compareEditor.previousChange"}},64964:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ViewModelSortKey=e.SCMViewModelMode=e.SET_SCM_LIST_VIEW_MODE=e.SET_SCM_TREE_VIEW_MODE=e.TOGGLE_DIFF_SIDE_BY_SIDE=e.scmItemLineHeight=e.SCM_WELCOME_ID=e.scmResourceViewId=e.scmProviderViewId=e.scmContainerId=void 0;const n=t(85608),a=t(30144);e.scmContainerId=a.SCM_CONTAINER_ID,e.scmProviderViewId="scm_provider",e.scmResourceViewId="scm_view",e.SCM_WELCOME_ID="scm-welcome",e.scmItemLineHeight=22,e.TOGGLE_DIFF_SIDE_BY_SIDE={id:"toggle.diff.renderSideBySide"},e.SET_SCM_TREE_VIEW_MODE={id:"workbench.scm.action.setTreeViewMode"},e.SET_SCM_LIST_VIEW_MODE={id:"workbench.scm.action.setListViewMode"};var o;(function(g){g.List="list",g.Tree="tree"})(o=e.SCMViewModelMode||(e.SCMViewModelMode={}));var I;(function(g){g.Path="path",g.Name="name",g.Status="status"})(I=e.ViewModelSortKey||(e.ViewModelSortKey={})),n.__exportStar(t(49697),e),n.__exportStar(t(66224),e),n.__exportStar(t(95588),e),n.__exportStar(t(49814),e),n.__exportStar(t(480),e)},480:(L,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},95588:(L,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ISCMMenus=void 0,e.ISCMMenus=Symbol("ISCMMenus")},49697:(L,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ISCMService=void 0;class t{}e.ISCMService=t},66224:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SCMService=void 0;const n=t(85608),a=t(83794),o=t(76003),I=t(43718),{equals:g}=I.arrays;class u{constructor(){this._value="",this._onDidChange=new I.Emitter,this.onDidChange=this._onDidChange.event,this._placeholder="",this._onDidChangePlaceholder=new I.Emitter,this.onDidChangePlaceholder=this._onDidChangePlaceholder.event,this._visible=!0,this._props={},this._onDidChangeProps=new I.Emitter,this.onDidChangeProps=this._onDidChangeProps.event,this._onDidChangeVisibility=new I.Emitter,this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._enabled=!0,this._onDidChangeEnablement=new I.Emitter,this.onDidChangeEnablement=this._onDidChangeEnablement.event,this._validateInput=()=>Promise.resolve(void 0),this._onDidChangeValidateInput=new I.Emitter,this.onDidChangeValidateInput=this._onDidChangeValidateInput.event,this._onDidChangeActionButton=new I.Emitter,this.onDidChangeActionButton=this._onDidChangeActionButton.event}get value(){return this._value}set value(m){this._value=m,this._onDidChange.fire(m)}get placeholder(){return this._placeholder}set placeholder(m){this._placeholder=m,this._onDidChangePlaceholder.fire(m)}get visible(){return this._visible}set visible(m){this._visible=m,this._onDidChangeVisibility.fire(m)}get props(){return this._props}set props(m){this._props=m,this._onDidChangeProps.fire(this._props)}appendProps(m){this._props=Object.assign(Object.assign({},this._props),m),this._onDidChangeProps.fire(this._props)}get enabled(){return this._enabled}set enabled(m){this._enabled=m,this._onDidChangeEnablement.fire(m)}get validateInput(){return this._validateInput}set validateInput(m){this._validateInput=m,this._onDidChangeValidateInput.fire()}get actionButton(){return this._actionButton}set actionButton(m){this._actionButton=m,this._onDidChangeActionButton.fire()}}class G{get selected(){return this._selected}constructor(m,d){this.provider=m,this.disposable=d,this._onDidFocus=new I.Emitter,this.onDidFocus=this._onDidFocus.event,this._selected=!1,this._onDidChangeSelection=new I.Emitter,this.onDidChangeSelection=this._onDidChangeSelection.event,this.input=new u,(0,a.makeObservable)(this)}focus(){this._onDidFocus.fire()}setSelected(m){this._selected=m,this._onDidChangeSelection.fire(this)}dispose(){this.disposable.dispose(),this.provider.dispose()}}n.__decorate([a.observable,n.__metadata("design:type",Object)],G.prototype,"_selected",void 0),n.__decorate([a.computed,n.__metadata("design:type",Boolean),n.__metadata("design:paramtypes",[])],G.prototype,"selected",null),n.__decorate([a.action,n.__metadata("design:type",Function),n.__metadata("design:paramtypes",[Boolean]),n.__metadata("design:returntype",void 0)],G.prototype,"setSelected",null);let p=class{constructor(){this._selectedRepositories=[],this._providerIds=new Set,this._repositories=[],this._onDidChangeSelectedRepositories=new I.Emitter,this.onDidChangeSelectedRepositories=this._onDidChangeSelectedRepositories.event,this._onDidAddProvider=new I.Emitter,this.onDidAddRepository=this._onDidAddProvider.event,this._onDidRemoveProvider=new I.Emitter,this.onDidRemoveRepository=this._onDidRemoveProvider.event,this.logger=(0,I.getDebugLogger)()}get selectedRepositories(){return[...this._selectedRepositories]}get repositories(){return[...this._repositories]}registerSCMProvider(m){if(this.logger.log("SCMService#registerSCMProvider"),this._providerIds.has(m.id))throw new Error(`SCM Provider ${m.id} already exists.`);this._providerIds.add(m.id);const d=(0,I.toDisposable)(()=>{const s=this._repositories.indexOf(r);s<0||(l.dispose(),this._providerIds.delete(m.id),this._repositories.splice(s,1),this._onDidRemoveProvider.fire(r),r.selected&&this._repositories.length>0&&this._repositories[0].setSelected(!0))}),r=new G(m,d),l=I.Event.filter(r.onDidChangeSelection,s=>s.selected)(this.onDidChangeSelection,this);return this._repositories.push(r),this._onDidAddProvider.fire(r),this._repositories.length===1&&r.setSelected(!0),r}setInputProps(m){this._repositories.forEach(d=>{d.input.props=m})}appendInputProps(m){this._repositories.forEach(d=>{d.input.appendProps(m)})}onDidChangeSelection(m){g(this._selectedRepositories,[m])||(this._repositories.filter(d=>d!==m).forEach(d=>{d.setSelected(!1)}),this._selectedRepositories=this._repositories.filter(d=>d.selected),this._onDidChangeSelectedRepositories.fire(this.selectedRepositories))}};p=n.__decorate([(0,o.Injectable)()],p),e.SCMService=p},61656:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),t(85608).__exportStar(t(64964),e)},6556:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SearchModule=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(52925),g=t(50845),u=t(33301),G=t(86952),p=t(51495),b=t(5439);let m=class extends o.BrowserModule{constructor(){super(...arguments),this.providers=[{token:g.SearchContextKey,useClass:g.SearchContextKey},{token:I.IContentSearchClientService,useClass:p.ContentSearchClientService},{token:I.ISearchTreeService,useClass:b.SearchTreeService},G.SearchContribution],this.backServices=[{servicePath:I.ContentSearchServerPath,clientToken:I.IContentSearchClientService}],this.preferences=u.bindSearchPreference}};m=n.__decorate([(0,a.Injectable)()],m),e.SearchModule=m},3956:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.replace=e.getSelection=e.replaceAll=void 0;const n=t(85608),a=t(41869),o=t(43718),I=n.__importStar(t(20868));async function g(p,b,m,d,r,l,s,c,h){if(m.size<1)return!1;const v=Object.assign({},h);if(s&&v){const f={[(0,a.localize)("search.replace.buttonCancel")]:!1,[(0,a.localize)("search.replace.buttonOK")]:!0},W=await s.open((0,o.formatLocalize)("search.removeAll.occurrences.files.confirmation.message",String(v.resultNum),String(v.fileNum),d),o.MessageType.Warning,Object.keys(f));if(!f[W])return f[W]}for(const f of m){const W=f[1];await G(p,b,W,d,r,l)}return c&&v&&c.info((0,o.formatLocalize)("search.replaceAll.occurrencesMessage",String(v.resultNum),String(v.fileNum),d)),!0}e.replaceAll=g;function u(p){return[new I.Selection(p.line,p.matchStart,p.line,p.matchStart+p.matchLength)]}e.getSelection=u;async function G(p,b,m,d,r,l){var s;const c=m.map(v=>p.getModelReference(new o.URI(v.fileUri))).filter(v=>v?.instance&&!v.instance.dirty),h=[];for(const v of m){let f=d;if(l&&d){let W;try{W=new RegExp(r)}catch{continue}const N=(s=v.renderLineText)===null||s===void 0?void 0:s.slice(v.matchStart-1,v.matchStart+v.matchLength-1);N&&(f=N.replace(W,d))}h.push({options:{dirtyIfInEditor:!0},resource:new o.URI(v.fileUri),textEdit:{range:new I.Range(v.line,v.matchStart,v.line,v.matchStart+v.matchLength),text:f}})}await b.apply({edits:h}),c.forEach(v=>{v.instance.save()})}e.replace=G},50845:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SearchContextKey=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(67386);let g=class{initScopedContext(G){this._contextKeyService=this.globalContextkeyService.createScoped(G),this.searchViewFocusedKey=I.SearchViewFocusedKey.bind(this._contextKeyService),this.searchInputBoxFocusedKey=I.SearchInputBoxFocusedKey.bind(this._contextKeyService),this.hasSearchResults=I.HasSearchResults.bind(this._contextKeyService),this.searchViewVisibleKey=I.SearchViewVisibleKey.bind(this._contextKeyService)}get service(){return this._contextKeyService}};n.__decorate([(0,a.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],g.prototype,"globalContextkeyService",void 0),g=n.__decorate([(0,a.Injectable)()],g),e.SearchContextKey=g},96895:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SearchHistory=e.SEARCH_WORD_SCOPE=void 0;const n=t(41869);e.SEARCH_WORD_SCOPE="SEARCH_WORD";class a{constructor(I,g){this.searchHistoryList=[],this.currentIndex=-1,this.searchServiceClient=I,this.recentStorage=g}setRecentSearchWord(){this.currentIndex===-1&&(this.currentIndex=this.searchHistoryList.length),this.currentIndex=this.currentIndex-1;let I=this.searchHistoryList[this.currentIndex];if(this.currentIndex<0)return this.currentIndex=0,I=this.searchHistoryList[this.currentIndex],this.setSearchValue(I);if(I){if(this.searchServiceClient.searchValue===I)return this.setRecentSearchWord();this.setSearchValue(I)}}setBackRecentSearchWord(){this.currentIndex=this.currentIndex+1;let I=this.searchHistoryList[this.currentIndex];if(this.currentIndex>=this.searchHistoryList.length)return this.currentIndex=this.searchHistoryList.length-1,I=this.searchHistoryList[this.currentIndex],this.setSearchValue(I);if(I){if(this.searchServiceClient.searchValue===I)return this.setBackRecentSearchWord();this.setSearchValue(I)}}async initSearchHistory(){if(this.searchHistoryList.length>0)return;const I=await this.getMostRecentlySearchWord();this.searchHistoryList=this.searchHistoryList.concat(I||[])}async setSearchHistory(I){this.searchHistoryList.some(g=>g===I)||(this.searchHistoryList.push(I),await this.setMostRecentlySearchWord(I))}async getMostRecentlySearchWord(){return await(await this.recentStorage.getScopeStorage()).get(e.SEARCH_WORD_SCOPE)||[]}async setMostRecentlySearchWord(I){const g=await this.recentStorage.getScopeStorage();let u=[];const G=await this.getMostRecentlySearchWord()||[];(0,n.isArray)(I)?u=u.concat(I):u.push(I),u=G.concat(u),u=Array.from(new Set(u)),u=u.slice(u.length-10,u.length),g.set(e.SEARCH_WORD_SCOPE,u)}setSearchValue(I){this.searchServiceClient.searchValue=I,this.searchServiceClient.searchDebounce()}reset(){this.currentIndex=-1}}e.SearchHistory=a},33301:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.bindSearchPreference=e.createSearchPreferencesProvider=e.SearchPreferences=e.searchPreferenceSchema=void 0;const n=t(41869);e.searchPreferenceSchema={id:"search",order:5,title:(0,n.localize)("Search","\u641C\u7D22"),type:"object",properties:{"search.exclude":{type:"object",markdownDescription:"%preference.search.exclude%",default:{"**/node_modules":!0,"**/bower_components":!0,"**/.git":!0,"**/.svn":!0,"**/.hg":!0,"**/CVS":!0,"**/.DS_Store":!0,"**/Thumbs.db":!0}},"search.include":{type:"object",description:"%preference.search.include%",default:{}},"search.useReplacePreview":{type:"boolean",description:"%preference.search.useReplacePreview%",default:!0},"search.searchOnType":{type:"boolean",description:"%preference.search.searchOnType%",default:!0},"search.searchOnTypeDebouncePeriod":{type:"number",description:"%preference.search.searchOnTypeDebouncePeriod%",default:300}}},e.SearchPreferences=Symbol("SearchPreferences");const a=I=>({token:e.SearchPreferences,useFactory:()=>{const g=I.get(n.PreferenceService);return(0,n.createPreferenceProxy)(g,e.searchPreferenceSchema)}});e.createSearchPreferencesProvider=a;function o(I){I.addProviders((0,e.createSearchPreferencesProvider)(I))}e.bindSearchPreference=o},9767:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SearchResultCollection=void 0;const n=t(52925);class a{constructor(){this.list=[],this.maxLength=5}pushAndGetResultList(I){const{id:g,data:u,searchState:G}=I,p=[];if(G===n.SEARCH_STATE.error||G===n.SEARCH_STATE.done){const b=this.getTempResult();return b&&p.push(b),p.push(I),p}if(u.length<1)return p.push(I),p;if(this.list.length>0)if(g===this.list[0].id)this.pushTempResult(I);else{const b=this.getTempResult();b&&p.push(b),this.pushTempResult(I)}else this.pushTempResult(I);return this.list.length>=this.maxLength&&p.push(this.getTempResult()),p}getTempResult(){let I;return this.list.length<1||(this.list.forEach((g,u)=>{u!==0&&(this.list[0].data=this.list[0].data.concat(g.data))}),I=this.list[0],this.list=[]),I}pushTempResult(I){this.list.push(I)}}e.SearchResultCollection=a},86952:(L,e,t)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SearchContribution=void 0;const n=t(85608),a=t(76003),o=t(41869),I=t(30144),g=t(67386),u=t(68456),G=t(93899),p=t(43718),b=t(98295),m=t(57517),d=t(63067),r=t(17793),l=t(72665),s=t(26199),c=t(52925),h=t(3956),v=t(33301),f=t(14851),W=t(5439),N=t(13072),Z=t(86109);let y=class{constructor(){this.schema=v.searchPreferenceSchema,this.toDispose=new p.DisposableCollection}registerCommands(R){R.registerCommand(o.SEARCH_COMMANDS.OPEN_SEARCH,{execute:A=>{const w=this.mainLayoutService.getTabbarHandler(I.SEARCH_CONTAINER_ID);if(w){if(w.activate(),A&&A.includeValue){this.searchBrowserService.includeValue=A.includeValue,this.searchBrowserService.updateUIState({isDetailOpen:!0}),this.searchBrowserService.search();return}this.searchBrowserService.searchEditorSelection(),this.searchBrowserService.focus(),this.searchBrowserService.search()}}}),R.registerCommand(o.SEARCH_COMMANDS.REFRESH,{execute:()=>{this.searchBrowserService.search()}}),R.registerCommand(o.SEARCH_COMMANDS.CLEAN,{execute:()=>{this.searchBrowserService.clean()}}),R.registerCommand(o.SEARCH_COMMANDS.GET_RECENT_SEARCH_WORD,{execute:A=>{this.searchBrowserService.setRecentSearchWord()}}),R.registerCommand(o.SEARCH_COMMANDS.GET_BACK_RECENT_SEARCH_WORD,{execute:()=>{this.searchBrowserService.setBackRecentSearchWord()}}),R.registerCommand(o.SEARCH_COMMANDS.MENU_REPLACE,{execute:async A=>{if(!Z.SearchFileNode.is(A)){const w=new Map;w.set(A.resource.toString(),[A.contentResult]),await(0,h.replaceAll)(this.documentModelManager,this.workspaceEditService,w,this.searchBrowserService.replaceValue,this.searchBrowserService.searchValue,this.searchBrowserService.UIState.isUseRegexp)}},isVisible:()=>!Z.SearchFileNode.is(this.searchModelService.contextMenuNode)}),R.registerCommand(o.SEARCH_COMMANDS.MENU_REPLACE_ALL,{execute:async A=>{if(!Z.SearchFileNode.is(A))return;const w=new Map;if(!A.children)return;const F=A.children.map(_=>_.contentResult),V={[(0,o.localize)("search.replace.buttonCancel")]:!1,[(0,o.localize)("search.replace.buttonOK")]:!0},Y=await this.dialogService.open((0,p.formatLocalize)("search.removeAll.occurrences.file.confirmation.message",String(F.length)),p.MessageType.Warning,Object.keys(V));if(Y&&!V[Y])return V[Y];w.set(A.resource.toString(),F),await(0,h.replaceAll)(this.documentModelManager,this.workspaceEditService,w,this.searchBrowserService.replaceValue,this.searchBrowserService.searchValue,this.searchBrowserService.UIState.isUseRegexp)},isVisible:()=>!Z.SearchFileNode.is(this.searchModelService.contextMenuNode)}),R.registerCommand(o.SEARCH_COMMANDS.MENU_HIDE,{execute:A=>{var w,F;Z.SearchFileNode.is(A)?(this.searchBrowserService.resultTotal.fileNum-=1,this.searchBrowserService.resultTotal.resultNum-=A.branchSize,this.searchModelService.treeModel.root.unlinkItem(A)):(this.searchBrowserService.resultTotal.resultNum-=1,((F=(w=A.parent)===null||w===void 0?void 0:w.children)===null||F===void 0?void 0:F.length)===1&&(this.searchBrowserService.resultTotal.fileNum-=1,this.searchModelService.treeModel.root.unlinkItem(A.parent)),A.parent.unlinkItem(A)),this.searchBrowserService.fireTitleChange()}}),R.registerCommand(o.SEARCH_COMMANDS.MENU_COPY,{execute:A=>{var w;if(Z.SearchFileNode.is(A)){let V=`${A.resource.codeUri.fsPath.toString()}
|
|
28193
28193
|
`;(w=A.children)===null||w===void 0||w.forEach(Y=>{const _=Y.contentResult;V=V+`${_.line},${_.matchStart}: ${_.renderLineText}
|
|
28194
28194
|
`}),this.clipboardService.writeText(V)}else{const F=A.contentResult;this.clipboardService.writeText(`${F.line},${F.matchStart}: ${F.renderLineText}`)}}}),R.registerCommand(o.SEARCH_COMMANDS.MENU_COPY_ALL,{execute:A=>{var w;let F;if(A?Z.SearchFileNode.is(A)?F=[A]:F=[A.parent]:F=this.searchModelService.treeModel.root.children,!F)return;let V="";for(let Y=0,_=F.length;Y<_;Y++){let S=`${F[Y].resource.codeUri.fsPath.toString()}
|
|
28195
28195
|
`;(w=F[Y].children)===null||w===void 0||w.forEach(X=>{const Q=X.contentResult;S=S+`${Q.line},${Q.matchStart}: ${Q.renderLineText}
|