@opensumi/cli-engine 3.9.1-next-1749550928.0 → 3.9.1-next-1749610621.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 +6 -6
- package/package.json +10 -10
package/lib/browser/browser.js
CHANGED
|
@@ -8181,22 +8181,22 @@ html li {
|
|
|
8181
8181
|
margin-top: 0;
|
|
8182
8182
|
}
|
|
8183
8183
|
.monaco-component.multiDiffEditor .multiDiffEntry .status:empty {
|
|
8184
|
-
color: var(--
|
|
8184
|
+
color: var(--kt-decoration-modifiedResourceForeground);
|
|
8185
8185
|
}
|
|
8186
8186
|
.monaco-component.multiDiffEditor .multiDiffEntry .status:empty::before {
|
|
8187
8187
|
content: 'M';
|
|
8188
8188
|
}
|
|
8189
8189
|
.monaco-component.multiDiffEditor .multiDiffEntry .status.added {
|
|
8190
|
-
color: var(--
|
|
8190
|
+
color: var(--kt-decoration-addedResourceForeground);
|
|
8191
8191
|
}
|
|
8192
8192
|
.monaco-component.multiDiffEditor .multiDiffEntry .status.deleted {
|
|
8193
|
-
color: var(--
|
|
8193
|
+
color: var(--kt-decoration-deletedResourceForeground);
|
|
8194
8194
|
}
|
|
8195
8195
|
.monaco-component.multiDiffEditor .multiDiffEntry .status.renamed {
|
|
8196
|
-
color: var(--
|
|
8196
|
+
color: var(--kt-decoration-deletedResourceForeground);
|
|
8197
8197
|
}
|
|
8198
8198
|
.monaco-component.multiDiffEditor .multiDiffEntry .status.modified {
|
|
8199
|
-
color: var(--
|
|
8199
|
+
color: var(--kt-decoration-modifiedResourceForeground);
|
|
8200
8200
|
}
|
|
8201
8201
|
`,""]);const v=_},86145:(P,t,e)=>{"use strict";e.d(t,{A:()=>v});var n=e(36758),r=e.n(n),o=e(40935),l=e.n(o),_=l()(r());_.push([P.id,`.quick-title-container {
|
|
8202
8202
|
display: flex;
|
|
@@ -33223,7 +33223,7 @@ You MUST use the following format when citing code regions or blocks:
|
|
|
33223
33223
|
\`\`\`
|
|
33224
33224
|
This is the ONLY acceptable format for code citations. The format is \`\`\`startLine:endLine:filepath where startLine and endLine are line numbers.`},58196:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ToolInvocationRegistryManagerImpl=t.ToolInvocationRegistryManager=t.ToolInvocationRegistryImpl=t.ToolProvider=t.ToolInvocationRegistry=t.ToolRequest=t.ToolParameterSchema=void 0;const n=e(85608),r=e(75995),o=e(76003);t.ToolParameterSchema=r.z.object({type:r.z.enum(["string","number","boolean","object","array"]),description:r.z.string().optional(),enum:r.z.array(r.z.any()).optional(),items:r.z.lazy(()=>t.ToolParameterSchema).optional(),properties:r.z.record(r.z.lazy(()=>t.ToolParameterSchema)).optional(),required:r.z.array(r.z.string()).optional()});var l;(function(p){function m(s){return t.ToolParameterSchema.safeParse(s).success}p.isToolParameter=m})(l||(t.ToolRequest=l={})),t.ToolInvocationRegistry=Symbol("ToolInvocationRegistry"),t.ToolProvider=Symbol("ToolProvider");class _{constructor(){this.tools=new Map}unregisterProviderTools(m){const s=[];for(const[g,a]of this.tools.entries())a.providerName===m&&s.push(g);s.forEach(g=>this.tools.delete(g))}getAllFunctions(){return Array.from(this.tools.values())}registerTool(m){this.tools.has(m.id)?this.tools.set(m.id,m):this.tools.set(m.id,m)}getFunction(m){return this.tools.get(m)}getFunctions(...m){return m.map(g=>{const a=this.tools.get(g);if(a)return a;throw new Error(`\u627E\u4E0D\u5230 ID \u4E3A ${g} \u7684\u51FD\u6570`)})}}t.ToolInvocationRegistryImpl=_,t.ToolInvocationRegistryManager=Symbol("ToolInvocationRegistryManager");let v=class{constructor(){this.registries=new Map}getRegistry(m){let s=this.registries.get(m);return s||(s=new _,this.registries.set(m,s)),s}removeRegistry(m){this.registries.delete(m)}hasRegistry(m){return this.registries.has(m)}};t.ToolInvocationRegistryManagerImpl=v,t.ToolInvocationRegistryManagerImpl=v=n.__decorate([(0,o.Injectable)()],v)},69820:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EPartialEdit=t.MCP_SERVER_TYPE=t.NearestCodeBlockType=void 0;var e;(function(o){o.Block="block",o.Line="line"})(e||(t.NearestCodeBlockType=e={}));var n;(function(o){o.STDIO="stdio",o.SSE="sse",o.BUILTIN="builtin"})(n||(t.MCP_SERVER_TYPE=n={}));var r;(function(o){o.accept="accept",o.discard="discard"})(r||(t.EPartialEdit=r={}))},98864:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cleanAttachedTextWrapper=t.getToolName=t.TOOL_NAME_SEPARATOR=t.toClaudeToolName=t.extractCodeBlocks=t.isDocumentValid=t.isDocumentTooShort=t.isDocumentTooLarge=void 0;const n=e(19413),r="```",o=10,l=a=>{try{a.getText()}catch(h){if(h instanceof RangeError)return!0}return!1};t.isDocumentTooLarge=l;const _=a=>a.getText().length<o;t.isDocumentTooShort=_;const v=a=>!((0,t.isDocumentTooLarge)(a)||(0,t.isDocumentTooShort)(a));t.isDocumentValid=v;const p=a=>{const h=a.split(`
|
|
33225
33225
|
`);let u=[],c=!1,E=0;return h.forEach((f,d)=>{if(!c&&f.trim().startsWith(r))c=!0,E=d+1;else if(c&&f.trim().startsWith(r)){c=!1;const y=d;u=h.slice(E,y)}c&&E!==d+1&&u.push(f)}),u.join(`
|
|
33226
|
-
`)};t.extractCodeBlocks=p;const m=a=>a.replace(/[^a-zA-Z0-9_-]/g,"").slice(0,64);t.toClaudeToolName=m,t.TOOL_NAME_SEPARATOR="__";const s=(a,h)=>h===n.BUILTIN_MCP_SERVER_NAME?a:(0,t.toClaudeToolName)(`mcp${t.TOOL_NAME_SEPARATOR}${h}${t.TOOL_NAME_SEPARATOR}${a}`);t.getToolName=s;const g=a=>{const h=/`<attached_file>(.*)`/g,u=/`<attached_folder>(.*)`/g;return a=a.replace(h,"$1"),a=a.replace(u,"$1"),a};t.cleanAttachedTextWrapper=g},26471:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(19413),t)},15504:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentReactions=t.CommentReactionSwitcher=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(41869),l=e(81878),_=e(25918),v=e(93899),p=e(52416),m=e(69635),s=n.__importDefault(e(38877)),g=({thread:h,comment:u,className:c})=>{const E=`${h.providerId}_${h.id}_${u.id}`,f=`${v.MenuId.CommentReactionSwitcherMenu}_${E}`,d=(0,o.useInjectable)(v.IMenuRegistry),y=(0,o.useInjectable)(v.AbstractMenuService);r.default.useEffect(()=>{const A=new o.Disposable,S=`${v.MenuId.CommentReactionSwitcherSubmenu}_${E}`;return A.addDispose(d.registerMenuItem(f,{submenu:S,label:S,iconClass:(0,o.getExternalIcon)("reactions"),group:"navigation"})),A.addDispose(d.registerMenuItems(S,u.reactions.map(D=>({command:{id:m.SwitchCommandReaction,label:D.label},extraTailArgs:[{thread:h,comment:u,reaction:D}]})))),()=>A.dispose()},[]);const b=r.default.useMemo(()=>y.createMenu(f),[]);return r.default.createElement(_.InlineActionBar,{className:c,menus:b,regroup:A=>[A,[]],type:"icon"})};t.CommentReactionSwitcher=g;const a=({thread:h,comment:u})=>{var c;const E=(0,o.useInjectable)(o.IEventBus),f=(0,o.useInjectable)(p.IIconService),d=r.default.useCallback(y=>{E.fire(new m.CommentReactionClick({thread:h,comment:u,reaction:y}))},[]);return r.default.createElement("div",{className:s.default.comment_reactions},(c=u.reactions)===null||c===void 0?void 0:c.filter(y=>y.count!==0).map(y=>r.default.createElement(l.Button,{key:y.label,onClick:()=>d(y),type:"secondary",size:"small",title:y.label,className:s.default.comment_reaction,iconClass:f.fromIcon("",y.iconPath.toString(),p.IconType.Background)},"\xA0",y.count)))};t.CommentReactions=a},54143:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsBody=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=n.__importDefault(e(43144)),l=e(84605),_=n.__importDefault(e(38877)),v=e(70154),p=({root:m,children:s})=>o.default.createPortal(s,m);t.CommentsBody=r.default.memo(({body:m})=>{const s=r.default.useRef(null),[g,a]=r.default.useState(null),h=r.default.useMemo(()=>{const u=(0,l.createMarkedRenderer)();return u.link=({href:c,title:E,text:f})=>`<a target="_blank" rel="noopener" href="${c}" title="${E||""}">${f}</a>`,u},[]);return r.default.useEffect(()=>{if(s.current){const u=s.current.attachShadow({mode:"open"});g||a(u)}},[]),r.default.createElement("div",{ref:s,className:_.default.comment_shadow_box},g&&r.default.createElement(p,{root:g},r.default.createElement("style",null,v.markdownCss),r.default.createElement("div",{dangerouslySetInnerHTML:{__html:(0,l.toMarkdownHtml)(typeof m=="string"?m:m.value,{gfm:!0,breaks:!1,pedantic:!1,renderer:h})}})))})},66480:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsFeatureRegistry=void 0;const n=e(85608),r=e(76003);let o=class{constructor(){this.config={},this.options={},this.panelTreeNodeHandlers=[],this.mentionsOptions={},this.providerFeature=new Map}registerConfig(_){this.config={...this.config,..._}}registerPanelTreeNodeHandler(_){this.panelTreeNodeHandlers.push(_)}registerPanelOptions(_){this.options={...this.options,..._}}registerFileUploadHandler(_){this.fileUploadHandler=_}registerMentionsOptions(_){this.mentionsOptions=_}registerZoneWidgetRender(_){this.zoneWidgetRender=_}getConfig(){return this.config}getCommentsPanelOptions(){return this.options}getCommentsPanelTreeNodeHandlers(){return this.panelTreeNodeHandlers}getFileUploadHandler(){return this.fileUploadHandler}getMentionsOptions(){return this.mentionsOptions}getZoneWidgetRender(){return this.zoneWidgetRender}registerProviderFeature(_,v){this.providerFeature.set(_,v)}getProviderFeature(_){return this.providerFeature.get(_)}};t.CommentsFeatureRegistry=o,t.CommentsFeatureRegistry=o=n.__decorate([(0,r.Injectable)()],o)},37357:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentItem=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(97267),l=e(41869),_=e(25918),v=e(93899),p=e(69635),m=e(15504),s=e(54143),g=e(42018),a=n.__importDefault(e(38877)),h=({timestamp:f})=>{const d=r.default.useMemo(()=>{const y=new Date(f);return(0,l.toLocalString)(y)},[f]);return r.default.createElement("span",{className:a.default.comment_item_timestamp},d)},u=(f,d)=>{const y=(0,l.useInjectable)(v.AbstractMenuService),{body:b,contextValue:A}=d,[S,D]=r.default.useState(""),I=(0,l.useInjectable)(p.ICommentsFeatureRegistry),w=r.default.useMemo(()=>I.getFileUploadHandler(),[]);r.default.useEffect(()=>{D(b)},[b]);const T=r.default.useMemo(()=>f.createScoped(),[]),R=r.default.useMemo(()=>T.createKey("commentIsEmpty",!d.body),[]),M=r.default.useMemo(()=>y.createMenu(v.MenuId.CommentsCommentContext,T),[]),O=r.default.useMemo(()=>y.createMenu(v.MenuId.CommentsCommentTitle,T),[]),x=r.default.useRef(T.createKey("comment",A));r.default.useEffect(()=>{x.current.set(A)},[A]);const k=r.default.useCallback(L=>{R.set(!L.target.value),D(L.target.value)},[]),F=r.default.useCallback(async L=>{if(w){const B=await w(S,L);D(U=>{const W=U+B;return R.set(!W),W})}},[S]);return[S,D,k,M,O,F]},c=({reply:f,thread:d})=>{var y;const{contextKeyService:b}=d,{author:A,label:S,body:D,mode:I,timestamp:w}=f,T=(y=A.iconPath)===null||y===void 0?void 0:y.toString(),[R,M,O,x,k,F]=u(b,f),L=r.default.useMemo(()=>{const B=(0,l.toMarkdownHtml)(typeof D=="string"?D:D.value);return/^\<p\>[^<>]+\<\/p\>\n$/.test(B)},[D]);return r.default.createElement("div",{className:a.default.reply_item},(0,l.isUndefined)(I)||I===p.CommentMode.Preview?r.default.createElement("div",null,L?r.default.createElement(r.default.Fragment,null,T&&r.default.createElement("img",{className:a.default.reply_item_icon,src:T,alt:A.name}),r.default.createElement("span",{className:a.default.comment_item_author_name},A.name),w&&r.default.createElement(h,{timestamp:w}),typeof S=="string"?r.default.createElement("span",{className:a.default.comment_item_label},S):S," : ",r.default.createElement("span",{className:a.default.comment_item_body},typeof D=="string"?D:D.value),f.reactions&&f.reactions.length>0&&r.default.createElement(m.CommentReactionSwitcher,{className:a.default.reply_item_title,thread:d,comment:f}),r.default.createElement(_.InlineActionBar,{separator:"inline",className:a.default.reply_item_title,menus:k,context:[{thread:d,comment:f,menuId:v.MenuId.CommentsCommentTitle}],type:"icon"})):r.default.createElement(r.default.Fragment,null,r.default.createElement("div",{className:a.default.comment_item_markdown_header},r.default.createElement("div",null,T&&r.default.createElement("img",{className:a.default.reply_item_icon,src:T,alt:A.name}),r.default.createElement("span",{className:a.default.comment_item_author_name},A.name),w&&r.default.createElement(h,{timestamp:w}),typeof S=="string"?r.default.createElement("span",{className:a.default.comment_item_label},S):S," : "),r.default.createElement(_.InlineActionBar,{separator:"inline",className:a.default.reply_item_title,menus:k,context:[{thread:d,comment:f,menuId:v.MenuId.CommentsCommentTitle}],type:"icon"})),r.default.createElement(s.CommentsBody,{body:D}))):r.default.createElement("div",null,r.default.createElement(g.CommentsTextArea,{value:typeof R=="string"?R:R.value,autoFocus:!0,onChange:O,dragFiles:F}),r.default.createElement(_.InlineActionBar,{className:a.default.comment_item_reply,menus:x,context:[{thread:d,comment:f,body:R,menuId:v.MenuId.CommentsCommentContext}],type:"button",separator:"inline",afterClick:()=>{M(D)}})),f.reactions&&f.reactions.length>0&&r.default.createElement(m.CommentReactions,{thread:d,comment:f}))},E=({thread:f,commentThreadContext:d,widget:y})=>{var b,A;const[S,D]=r.default.useState(!1),[I,w]=r.default.useState(""),{contextKeyService:T}=f,R=(0,l.useAutorun)(f.readOnly),[M,...O]=(0,l.useAutorun)(f.comments),{author:x,label:k,body:F,mode:L,timestamp:B}=M,U=(0,l.isString)(x.iconPath)?x.iconPath:!((b=x.iconPath)===null||b===void 0)&&b.authority?(A=x.iconPath)===null||A===void 0?void 0:A.toString():"",[W,j,Q,G,Z,$]=u(T,M),V=(0,l.useInjectable)(p.ICommentsFeatureRegistry),H=r.default.useMemo(()=>V.getFileUploadHandler(),[]),K=r.default.useMemo(()=>T.createKey("commentIsEmpty",!0),[]);function Y(re){K.set(!re.target.value),w(re.target.value)}const X=r.default.useCallback(async re=>{if(H){const oe=await H(W,re);w(he=>{const me=he+oe;return K.set(!me),me})}},[I]);return r.default.createElement("div",{className:a.default.comment_item},U&&r.default.createElement("img",{className:a.default.comment_item_icon,src:U,alt:x.name}),r.default.createElement("div",{className:a.default.comment_item_content},r.default.createElement("div",{className:a.default.comment_item_head},r.default.createElement("div",{className:a.default.comment_item_name},r.default.createElement("span",{className:a.default.comment_item_author_name},x.name),B&&r.default.createElement(h,{timestamp:B}),typeof k=="string"?r.default.createElement("span",{className:a.default.comment_item_label},k):k),r.default.createElement("div",{className:a.default.comment_item_actions},M.reactions&&M.reactions.length>0&&r.default.createElement(m.CommentReactionSwitcher,{thread:f,comment:M}),!R&&r.default.createElement(o.Button,{className:a.default.comment_item_reply_button,size:"small",type:"secondary",onClick:()=>D(!0)},(0,l.localize)("comments.thread.action.reply")),r.default.createElement(_.InlineActionBar,{menus:Z,context:[{thread:f,comment:M,menuId:v.MenuId.CommentsCommentTitle}],type:"button"}))),(0,l.isUndefined)(L)||L===p.CommentMode.Preview?r.default.createElement(s.CommentsBody,{body:F}):r.default.createElement("div",null,r.default.createElement(g.CommentsTextArea,{value:typeof W=="string"?W:W.value,autoFocus:!0,onChange:Q,dragFiles:$}),r.default.createElement(_.InlineActionBar,{className:a.default.comment_item_context,menus:G,context:[{thread:f,comment:M,body:W,menuId:v.MenuId.CommentsCommentContext}],separator:"inline",type:"button",afterClick:()=>{j(F)}})),M.reactions&&M.reactions.length>0&&r.default.createElement(m.CommentReactions,{thread:f,comment:M}),(O.length>0||S)&&r.default.createElement("div",{className:a.default.comment_item_reply_wrap},O.map(re=>r.default.createElement(c,{key:re.id,thread:f,reply:re})),S&&r.default.createElement("div",null,r.default.createElement(g.CommentsTextArea,{autoFocus:!0,value:I,onChange:Y,placeholder:`${(0,l.localize)("comments.reply.placeholder")}...`,dragFiles:X}),r.default.createElement(_.InlineActionBar,{className:a.default.comment_item_reply,menus:d,context:[{thread:f,text:I,widget:y,menuId:v.MenuId.CommentsCommentThreadContext}],separator:"inline",type:"button",afterClick:()=>{w(""),D(!1)}})))))};t.CommentItem=E},53878:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsPanel=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),l=e(41869),_=e(69635),v=n.__importDefault(e(38877)),p=e(5167),m=e(47842),s=({viewState:g})=>{const a=(0,l.useInjectable)(m.CommentModelService),[h,u]=(0,r.useState)(),c=(0,r.useRef)(null),E=(0,l.useInjectable)(_.ICommentsFeatureRegistry),{handleTreeBlur:f}=a;(0,r.useEffect)(()=>{u(a.treeModel);const I=a.onDidUpdateTreeModel(w=>{u(w)});return()=>{I.dispose()}},[]);const d=(0,r.useCallback)(I=>{a.handleTreeHandler(I)},[a]),y=(0,r.useCallback)(I=>r.default.createElement(p.CommentNodeRendered,{item:I.item,itemType:I.itemType,decorations:a.decorations.getDecorations(I.item),defaultLeftPadding:8,onTwistierClick:a.handleTwistierClick,onClick:a.handleItemClick,leftPadding:8}),[h]),b=(0,r.useMemo)(()=>E.getCommentsPanelOptions(),[]),A=(0,r.useMemo)(()=>b.header,[b]),S=(0,r.useMemo)(()=>r.default.createElement("div",{className:v.default.panel_placeholder},b.defaultPlaceholder||(0,l.localize)("comments.panel.placeholder")),[b]),D=(0,r.useCallback)(()=>h?r.default.createElement(o.RecycleTree,{height:g.height-(A?.height||0),itemHeight:p.COMMENT_TREE_NODE_HEIGHT,onReady:d,model:h,placeholder:()=>S},y):S,[h,A,g.height]);return r.default.createElement("div",{className:v.default.comment_panel,tabIndex:-1,onBlur:f,ref:c},A?.component,D())};t.CommentsPanel=s},42018:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsTextArea=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(34801),l=e(97267),_=e(41869),v=e(69635),p=e(54143),m=n.__importDefault(e(38877)),s=e(73136),g="@",a="@[__display__](__id__)",h=(u,c)=>`@${c}`;t.CommentsTextArea=r.default.forwardRef((u,c)=>{const{focusDelay:E=0,autoFocus:f=!1,placeholder:d="",onFocus:y,onBlur:b,onChange:A,maxRows:S=10,minRows:D=2,value:I,initialHeight:w,dragFiles:T}=u,[R,M]=r.default.useState(0),O=(0,_.useInjectable)(v.ICommentsFeatureRegistry),x=r.default.useRef(null),k=r.default.useRef(null),F=r.default.useRef(null);r.default.useImperativeHandle(c,()=>x.current);const L=r.default.useCallback(async Z=>{var $;Z.stopPropagation(),Z.preventDefault();const V=($=Z.clipboardData)===null||$===void 0?void 0:$.files;V&&T&&await T(V),x.current&&(x.current.focus(),W(x.current.value))},[T]),B=r.default.useCallback(async Z=>{var $;Z.stopPropagation(),Z.preventDefault();const V=($=Z.dataTransfer)===null||$===void 0?void 0:$.files;V&&T&&await T(V),x.current&&(x.current.focus(),W(x.current.value))},[T]),U=r.default.useCallback(Z=>{Z.stopPropagation(),Z.preventDefault(),Z.dataTransfer.dropEffect="copy"},[]),W=r.default.useCallback(Z=>{const $=x.current;if($){const V=Z.toString().length;$.setSelectionRange(V,V)}},[]);r.default.useEffect(()=>{var Z;const $=x.current;if(!$)return;w&&$.style&&($.style.height=w),E&&setTimeout(()=>{$.focus({preventScroll:!0})},E),W(I);function V(H){var K,Y,X;const re=H.target;re&&(re.nodeName.toUpperCase()==="TEXTAREA"&&re.scrollHeight>re.clientHeight||re.nodeName.toUpperCase()==="UL"||((K=re.parentElement)===null||K===void 0?void 0:K.nodeName.toUpperCase())==="UL"||((X=(Y=re.parentElement)===null||Y===void 0?void 0:Y.parentElement)===null||X===void 0?void 0:X.nodeName.toUpperCase())==="UL")&&H.stopPropagation()}return(Z=k.current)===null||Z===void 0||Z.addEventListener("mousewheel",V,!0),()=>{var H;(H=k.current)===null||H===void 0||H.removeEventListener("mousewheel",V,!0)}},[]),r.default.useEffect(()=>{R===0&&(setTimeout(()=>{var Z;(Z=x.current)===null||Z===void 0||Z.focus({preventScroll:!0})},E),W(I))},[R]);const j=r.default.useMemo(()=>(0,s.getMentionBoxStyle)({minRows:D,maxRows:S}),[D,S]),Q=r.default.useMemo(()=>O.getMentionsOptions(),[O]),G=r.default.useCallback(async(Z,$)=>{if(Q.providerData){const V=await Q.providerData(Z);$(V)}else $([])},[Q]);return r.default.createElement("div",{className:m.default.textarea_container},r.default.createElement(l.Tabs,{mini:!0,value:R,onChange:Z=>M(Z),tabs:[(0,_.localize)("comments.thread.textarea.write"),(0,_.localize)("comments.thread.textarea.preview")]}),r.default.createElement("div",null,R===0?r.default.createElement("div",{ref:k},r.default.createElement(o.MentionsInput,{autoFocus:f,onPaste:L,inputRef:x,onDragOver:U,onDrop:B,ref:F,value:I,placeholder:d,onChange:A,onFocus:y,onBlur:b,style:j},r.default.createElement(o.Mention,{markup:Q.markup||a,renderSuggestion:Q.renderSuggestion,trigger:g,data:G,displayTransform:Q.displayTransform||h}))):r.default.createElement("div",{className:m.default.textarea_preview},r.default.createElement(p.CommentsBody,{body:I}))))})},49867:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsThread=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(91830),_=e(54414),v=e(28423),p=e(69635),m=e(90366);let s=class extends o.Disposable{set contextValue(a){this._contextKeyService.createKey("thread",a)}get contextValue(){return this._contextKeyService.getContextKeyValue("thread")}get onDidChangeCollapsibleState(){return this.onDidChangeCollapsibleStateEmitter.event}get onDidChange(){return this.onDidChangeEmitter.event}constructor(a,h,u,c){super(),this.uri=a,this.range=h,this.providerId=u,this.options=c,this.comments=(0,v.observableValue)(this,[]),this.label=(0,v.observableValue)(this,void 0),this.readOnly=(0,v.observableValue)(this,!1),this.isCollapsed=(0,v.observableValue)(this,!1),this.onDidChangeCollapsibleStateEmitter=new o.Emitter,this.widgets=new Map,this._id=`thread_${(0,o.uuid)()}`,this.onDidChangeEmitter=new o.Emitter,this.pendingShowTimeouts=new Set,this.threadHeaderTitle=(0,v.derived)(this,S=>{const D=this.label.read(S);if(D)return D;const I=this.comments.read(S);if(I.length){const w=new Set(I.map(T=>`@${T.author.name}`));return`${(0,o.localize)("comments.participants")}: `+[...w].join(" ")}else return(0,o.localize)("comments.zone.title")}),this.toggle=S=>{if(this.comments.get().length>0){const I=this.widgets.get(S);I&&I.toggle()}else this.dispose()},this.updateComments(c.comments?c.comments.map(S=>({...S,id:(0,o.uuid)()})):[]),this.data=this.options.data,this._contextKeyService=this.registerDispose(this.globalContextKeyService.createScoped()),new l.ResourceContextKey(this._contextKeyService).set(a),this._contextKeyService.createKey("thread",c.contextValue),(0,v.transaction)(S=>{this.setReadOnly(!!c.readOnly),this.label.set(c.label,S),this.isCollapsed.set(!!this.options.isCollapsed,S)});const f=this._contextKeyService.createKey("threadsLength",this.commentsService.getThreadsByUri(a).length),d=this.comments.get(),y=this._contextKeyService.createKey("commentsLength",d.length),b=this._contextKeyService.createKey("commentThreadIsEmpty",!d.length);this._contextKeyService.createKey("commentController",u),this.addDispose((0,v.autorun)(S=>{const D=this.comments.read(S).length;y.set(D),b.set(!D)})),this.getEditorsByUri(this.uri).forEach(S=>{this.widgets.get(S)||this.addWidgetByEditor(S)}),this.addDispose((0,v.autorun)(S=>{this.isCollapsed.read(S)?this.hideAll():this.showAll()})),this.addDispose(this.commentsService.onThreadsChanged(S=>{S.uri.isEqual(a)&&f.set(this.commentsService.getThreadsByUri(a).length)})),this.addDispose({dispose:()=>{this.updateComments([]),this.pendingShowTimeouts.forEach(S=>clearTimeout(S)),this.pendingShowTimeouts.clear()}}),this.onDidChangeEmitter.fire()}updateComments(a){(0,v.transaction)(h=>{this.comments.set(a,h)})}getWidgetByEditor(a){return this.widgets.get(a)}get id(){return this._id}get contextKeyService(){return this._contextKeyService}setReadOnly(a){(0,v.transaction)(h=>{this.readOnly.set(a,h),this._contextKeyService.createKey("readOnly",a)})}getEditorsByUri(a){return this.editorCollectionService.listEditors().filter(h=>{var u;return(u=h.currentUri)===null||u===void 0?void 0:u.isEqual(a)})}addWidgetByEditor(a){const h=this.injector.get(m.CommentsZoneWidget,[a,this,{arrowColor:"var(--peekView-border)"}]);return this.addDispose(h.onChangeZoneWidget(()=>{const u=this.commentsService.commentsThreads.filter(f=>this.isEqual(f)),c=u.findIndex(f=>f===this),E=u.slice(c+1);for(const f of E)if(f.isShowWidget(a)){const d=f.getWidgetByEditor(a);d?.resize()}})),this.addDispose(h),this.widgets.set(a,h),a.onDispose(()=>{h.dispose(),this.widgets.delete(a)}),h}show(a){if(a){let h=this.widgets.get(a);h||(h=this.addWidgetByEditor(a)),h.show()}else this.getEditorsByUri(this.uri).forEach(u=>{var c;let E=this.widgets.get(u);E||(E=this.addWidgetByEditor(u)),E&&(!((c=u.currentUri)===null||c===void 0)&&c.isEqual(this.uri))&&E.show()})}removePaddingShowedWidgets(){this.pendingShowTimeouts.forEach(a=>clearTimeout(a)),this.pendingShowTimeouts.clear()}showWidgetsIfShowed(){var a;this.pendingShowTimeouts.forEach(h=>clearTimeout(h)),this.pendingShowTimeouts.clear();for(const h of this.getEditorsByUri(this.uri)){let u=this.widgets.get(h);if(u||(u=this.addWidgetByEditor(h)),!((a=h.currentUri)===null||a===void 0)&&a.isEqual(this.uri)){const c=setTimeout(()=>{var E;u&&(!((E=h.currentUri)===null||E===void 0)&&E.isEqual(this.uri))&&u.show(),this.pendingShowTimeouts.delete(c)},100);this.pendingShowTimeouts.add(c)}}}hideWidgetsByDispose(){var a;for(const[h,u]of this.widgets)!(!((a=h.currentUri)===null||a===void 0)&&a.isEqual(this.uri))&&u.dispose()}isShowWidget(a){if(a){const h=this.widgets.get(a);return h?h.isShow:!1}else{for(const[,h]of this.widgets)return h.isShow;return!1}}hide(a){if(a){const h=this.widgets.get(a);h?.hide()}else this.hideAll()}showAll(){(0,v.transaction)(a=>{this.isCollapsed.set(!1,a)});for(const[,a]of this.widgets)a.show();this.onDidChangeCollapsibleStateEmitter.fire(p.CommentThreadCollapsibleState.Expanded)}hideAll(a){var h;(0,v.transaction)(u=>{this.isCollapsed.set(!0,u)});for(const[u,c]of this.widgets)a?!(!((h=u.currentUri)===null||h===void 0)&&h.isEqual(this.uri))&&c.dispose():c.hide();this.onDidChangeCollapsibleStateEmitter.fire(p.CommentThreadCollapsibleState.Collapsed)}addComment(...a){const h=this.comments.get();(0,v.transaction)(u=>{this.comments.set([...h,...a.map(c=>({...c,id:(0,o.uuid)()}))],u)}),this.onDidChangeEmitter.fire()}removeComment(a){(0,v.transaction)(h=>{this.comments.set(this.comments.get().filter(u=>u!==a),h)}),this.onDidChangeEmitter.fire()}isEqual(a){return a.uri.isEqual(this.uri)&&a.range.startLineNumber===this.range.startLineNumber&&a.range.endLineNumber===this.range.endLineNumber}};t.CommentsThread=s,n.__decorate([(0,r.Autowired)(p.ICommentsService),n.__metadata("design:type",Object)],s.prototype,"commentsService",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],s.prototype,"globalContextKeyService",void 0),n.__decorate([(0,r.Autowired)(_.EditorCollectionService),n.__metadata("design:type",_.EditorCollectionService)],s.prototype,"editorCollectionService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],s.prototype,"injector",void 0),t.CommentsThread=s=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[o.URI,Object,String,Object])],s)},73804:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsZoneService=void 0;const n=e(85608),r=e(76003),o=e(93899),l=e(43718),_=e(69635),v=e(49867);let p=class extends l.Disposable{constructor(s){super(),this.thread=s}setCurrentCommentThread(s){this.commentService.setCurrentCommentThread(s)}get commentThreadTitle(){return this.registerDispose(this.menuService.createMenu(o.MenuId.CommentsCommentThreadTitle,this.thread.contextKeyService))}get commentThreadContext(){return this.registerDispose(this.menuService.createMenu(o.MenuId.CommentsCommentThreadContext,this.thread.contextKeyService))}};t.CommentsZoneService=p,n.__decorate([(0,r.Autowired)(o.AbstractMenuService),n.__metadata("design:type",o.AbstractMenuService)],p.prototype,"menuService",void 0),n.__decorate([(0,r.Autowired)(_.ICommentsService),n.__metadata("design:type",Object)],p.prototype,"commentService",void 0),n.__decorate([l.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],p.prototype,"commentThreadTitle",null),n.__decorate([l.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],p.prototype,"commentThreadContext",null),t.CommentsZoneService=p=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[v.CommentsThread])],p)},90366:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsZoneWidget=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),l=n.__importDefault(e(25873)),_=e(76003),v=e(41869),p=e(25918),m=e(93899),s=e(20303),g=e(69635),a=e(37357),h=e(42018),u=e(73804),c=n.__importDefault(e(38877)),E=({thread:d,widget:y})=>{const{contextKeyService:b}=d,A=(0,v.useAutorun)(d.comments),S=(0,v.useAutorun)(d.threadHeaderTitle),I=(0,v.useInjectable)(_.INJECTOR_TOKEN).get(u.CommentsZoneService,[d]),w=(0,v.useInjectable)(g.ICommentsFeatureRegistry),T=o.default.useMemo(()=>w.getFileUploadHandler(),[]),[R,M]=o.default.useState(""),O=o.default.useMemo(()=>b.createKey("commentIsEmpty",!R),[]),x=I.commentThreadTitle,k=I.commentThreadContext,F=o.default.useCallback(G=>{const{value:Z}=G.target;M(Z),O.set(!Z)},[]),L=o.default.useMemo(()=>{var G;return((G=w.getProviderFeature(d.providerId))===null||G===void 0?void 0:G.placeholder)||`${(0,v.localize)("comments.reply.placeholder")}...`},[]),B=o.default.useCallback(async G=>{if(T){const Z=await T(R,G);M($=>{const V=$+Z;return O.set(!V),V})}},[R]);o.default.useEffect(()=>{const G=y.onFirstDisplay(()=>{setTimeout(()=>{y.coreEditor.monacoEditor.revealLine(d.range.endLineNumber+1)},0)});return()=>{G.dispose()}},[]);const U=o.default.useCallback(()=>{I.setCurrentCommentThread(I.thread)},[]),W=o.default.useCallback(()=>{I.setCurrentCommentThread(void 0)},[]),j=o.default.useCallback(()=>{I.setCurrentCommentThread(I.thread)},[]),Q=o.default.useCallback(()=>{I.setCurrentCommentThread(void 0)},[]);return o.default.createElement("div",{tabIndex:-1,onMouseOver:U,onMouseOut:W,onFocus:j,onBlur:Q,className:(0,r.default)(d.options.threadClassName,c.default.comment_container)},o.default.createElement("div",{className:(0,r.default)(d.options.threadHeadClassName,c.default.head)},o.default.createElement("div",{className:c.default.review_title},S),o.default.createElement(p.InlineActionBar,{menus:x,context:[{thread:d,widget:y,menuId:m.MenuId.CommentsCommentThreadTitle}],separator:"inline",type:"icon"})),o.default.createElement("div",{className:c.default.comment_body},A.length>0?o.default.createElement(a.CommentItem,{widget:y,commentThreadContext:k,thread:d}):o.default.createElement("div",null,o.default.createElement(h.CommentsTextArea,{focusDelay:100,initialHeight:"auto",value:R,onChange:F,placeholder:L,dragFiles:B}),o.default.createElement("div",{className:c.default.comment_bottom_actions},o.default.createElement(p.InlineActionBar,{className:c.default.comment_reply_actions,separator:"inline",type:"button",context:[{text:R,widget:y,thread:d,menuId:m.MenuId.CommentsCommentThreadContext}],menus:k})))))};let f=class extends s.ResizeZoneWidget{_fillContainer(){}constructor(y,b,A){super(y.monacoEditor,b.range,{...A,showInHiddenAreas:!0}),this.thread=b,this._onShow=new v.Emitter,this.onShow=this._onShow.event,this._onHide=new v.Emitter,this.onHide=this._onHide.event,this._editor=y,this._isShow=!b.isCollapsed.get();const S=document.createElement("div");this._container.appendChild(S),this.observeContainer(S);const D=this.commentsFeatureRegistry.getZoneWidgetRender();this.wrapperRoot=l.default.createRoot(S),this.wrapperRoot.render(o.default.createElement(v.ConfigProvider,{value:this.appConfig},D?D(this.thread,this):o.default.createElement(E,{thread:this.thread,widget:this})));const I=y.monacoEditor.onDidChangeModel(()=>{b.hide()});this.addDispose({dispose:()=>{var w;(w=this.wrapperRoot)===null||w===void 0||w.unmount(),this.wrapperRoot=void 0,I.dispose()}})}get coreEditor(){return this._editor}get isShow(){return this._isShow}show(){super.show(),this._isShow=!0,this._onShow.fire()}hide(){super.hide(),this._isShow=!1,this._onHide.fire()}toggle(){this._isShow?this.hide():this.show()}applyClass(){}applyStyle(){}};t.CommentsZoneWidget=f,n.__decorate([(0,_.Autowired)(v.AppConfig),n.__metadata("design:type",Object)],f.prototype,"appConfig",void 0),n.__decorate([(0,_.Autowired)(g.ICommentsFeatureRegistry),n.__metadata("design:type",Object)],f.prototype,"commentsFeatureRegistry",void 0),t.CommentsZoneWidget=f=n.__decorate([(0,_.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Object,Object])],f)},62604:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsBrowserContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(93899),_=e(57517),v=e(63067),p=e(69635),m=e(47842);let s=class extends o.Disposable{onStart(){this.registerCommentsFeature(),this.listenToCreateCommentsPanel(),this.commentsService.init()}get panelBadge(){const a=this.commentsService.commentsThreads.length;return a?a+"":""}registerCommands(a){a.registerCommand({id:p.CollapseId,label:"%comments.panel.action.collapse%",iconClass:(0,o.getIcon)("collapse-all")},{execute:()=>{this.commentModelService.collapsedAll()}}),a.registerCommand({id:p.CloseThreadId,label:"%comments.thread.action.close%",iconClass:(0,o.getIcon)("up")},{execute:h=>{const{thread:u,widget:c}=h;u.comments.get().length?c.isShow&&c.toggle():u.dispose()}}),a.registerCommand({id:p.SwitchCommandReaction},{execute:h=>{this.eventBus.fire(new p.CommentReactionClick(h))}})}registerMenus(a){a.registerMenuItem(l.MenuId.CommentsCommentThreadTitle,{command:p.CloseThreadId,group:"inline",order:Number.MAX_SAFE_INTEGER})}registerToolbarItems(a){a.registerItem({id:p.CollapseId,viewId:p.CommentPanelId,command:p.CollapseId,tooltip:(0,o.localize)("comments.panel.action.collapse")})}registerCommentsFeature(){this.contributions.getContributions().forEach((a,h)=>{this.addDispose(this.commentsService.registerCommentRangeProvider(`contribution_${h}`,{getCommentingRanges:u=>a.provideCommentingRanges(u)})),a.registerCommentsFeature&&a.registerCommentsFeature(this.commentsFeatureRegistry)})}listenToCreateCommentsPanel(){this.commentsFeatureRegistry.getCommentsPanelOptions().defaultShow?this.commentsService.registerCommentPanel():o.Event.once(this.commentsService.onThreadsCreated)(()=>{this.commentsService.registerCommentPanel()}),this.addDispose(o.Event.debounce(this.commentsService.onThreadsChanged,()=>{},100)(()=>{const a=this.layoutService.getTabbarHandler(p.CommentPanelId);a?.setBadge(this.panelBadge)},this))}registerEditorFeature(a){a.registerEditorFeatureContribution({contribute:h=>this.commentsService.handleOnCreateEditor(h),provideEditorOptionsForUri:async h=>(await this.commentsService.getContributionRanges(h)).length?{lineDecorationsWidth:25,lineNumbersMinChars:5}:{}})}};t.CommentsBrowserContribution=s,n.__decorate([(0,r.Autowired)(p.ICommentsService),n.__metadata("design:type",Object)],s.prototype,"commentsService",void 0),n.__decorate([(0,r.Autowired)(v.IMainLayoutService),n.__metadata("design:type",Object)],s.prototype,"layoutService",void 0),n.__decorate([(0,r.Autowired)(p.ICommentsFeatureRegistry),n.__metadata("design:type",Object)],s.prototype,"commentsFeatureRegistry",void 0),n.__decorate([(0,r.Autowired)(p.CommentsContribution),n.__metadata("design:type",Object)],s.prototype,"contributions",void 0),n.__decorate([(0,r.Autowired)(o.IEventBus),n.__metadata("design:type",Object)],s.prototype,"eventBus",void 0),n.__decorate([(0,r.Autowired)(m.CommentModelService),n.__metadata("design:type",m.CommentModelService)],s.prototype,"commentModelService",void 0),t.CommentsBrowserContribution=s=n.__decorate([(0,o.Domain)(o.ClientAppContribution,_.BrowserEditorContribution,o.CommandContribution,o.TabBarToolbarContribution,l.MenuContribution)],s)},55011:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsService=void 0;const n=e(85608),r=n.__importDefault(e(53435)),o=n.__importDefault(e(87809)),l=e(76003),_=e(41869),v=e(54414),p=e(57517),m=e(63067),s=e(20868),g=n.__importStar(e(20868)),a=e(62663),h=e(52416),u=n.__importStar(e(24347)),c=e(69635),E=e(53878),f=e(49867),d=e(53711);let y=class extends _.Disposable{constructor(){super(...arguments),this.decorationChangeEmitter=new _.Emitter,this.threads=new Map,this.threadsChangeEmitter=new _.Emitter,this.threadsCommentChangeEmitter=new _.Emitter,this.commentRangeProviderChangeEmitter=new _.Emitter,this.onDidChangeCurrentCommentThreadEmitter=new _.Emitter,this.threadsCreatedEmitter=new _.Emitter,this.rangeProviderMap=new Map,this.rangeOwner=new Map,this.providerDecorationCache=new _.LRUCache(1e4),this.commentRangeDecorationMap=new Map,this.shouldShowCommentsSchemes=new Set(["file","git","diff"]),this.decorationProviderDisposer=_.Disposable.NULL,this.editorRenderAbortControllers=new Map,this.activeThreadDecorationIds=[],this.allEditors=[],this.editorDisposerMap=new Map,this.editorCommentingRangeSpaceReservedMap=new Map,this.editorLineDecorationsWidthMap=new Map}get commentsThreads(){return[...this.threads.values()]}get isMultiCommentsForSingleLine(){var A;return!!(!((A=this.commentsFeatureRegistry.getConfig())===null||A===void 0)&&A.isMultiCommentsForSingleLine)}get currentAuthorAvatar(){var A,S;return(S=(A=this.commentsFeatureRegistry.getConfig())===null||A===void 0?void 0:A.author)===null||S===void 0?void 0:S.avatar}get filterThreadDecoration(){var A;return(A=this.commentsFeatureRegistry.getConfig())===null||A===void 0?void 0:A.filterThreadDecoration}get onThreadsChanged(){return this.threadsChangeEmitter.event}get onThreadsCommentChange(){return this.threadsCommentChangeEmitter.event}get onThreadsCreated(){return this.threadsCreatedEmitter.event}get onCommentRangeProviderChange(){return this.commentRangeProviderChangeEmitter.event}get onDidChangeCurrentCommentThread(){return this.onDidChangeCurrentCommentThreadEmitter.event}setCurrentCommentThread(A){this.onDidChangeCurrentCommentThreadEmitter.fire(A)}createThreadDecoration(A){var S;const D=A.comments.get(),I=D.length===0?this.currentAuthorAvatar:(S=D[0].author.iconPath)===null||S===void 0?void 0:S.toString(),w=I?`${this.iconService.fromIcon("",I,h.IconType.Background)} avatar-icon`:this.iconService.fromString("$(comment)"),T={description:"comments-thread-decoration",glyphMarginClassName:I?["comment-thread",w].join(" "):["comment-range","comment-thread",w].join(" ")};return u.ModelDecorationOptions.createDynamic(T)}updateActiveThreadDecoration(A){var S;const D=this.getCurrentEditor(A?.uri);if(!D)return;(S=this.currentThreadCollapseStateListener)===null||S===void 0||S.dispose();const I=[];if(A){const w=A.range;A.isCollapsed.get()||(this.currentThreadCollapseStateListener=A.onDidChangeCollapsibleState(T=>{T===c.CommentThreadCollapsibleState.Collapsed&&this.updateActiveThreadDecoration(void 0)}),I.push({range:w,options:this.createThreadRangeActiveDecoration()}))}this.activeThreadDecorationIds=D.monacoEditor.deltaDecorations(this.activeThreadDecorationIds,I)}createDottedRangeDecoration(){const A={description:"comments-multiline-hover-decoration",linesDecorationsClassName:["comment-range","multiline-add"].join(" ")};return u.ModelDecorationOptions.createDynamic(A)}createHoverDecoration(){const A={description:"comments-hover-decoration",linesDecorationsClassName:["comment-range","line-hover","comment-add"].join(" ")};return u.ModelDecorationOptions.createDynamic(A)}createThreadRangeActiveDecoration(){const A={description:"comments-thread-range-active-decoration",isWholeLine:!1,zIndex:20,className:"comment-thread-range-current",shouldFillLineOnLineBreak:!0};return u.ModelDecorationOptions.createDynamic(A)}createThreadRangeDecoration(){const A={description:"comments-thread-range-decoration",isWholeLine:!1,zIndex:20,className:"comment-thread-range",shouldFillLineOnLineBreak:!0};return u.ModelDecorationOptions.createDynamic(A)}createCommentRangeDecoration(){const A={description:"comments-range-decoration",linesDecorationsClassName:["comment-range","comment-diff-added"].join(" ")};return u.ModelDecorationOptions.createDynamic(A)}init(){const A=this.resourceService.getSupportedSchemes();for(const S of A)this.shouldShowCommentsSchemes.add(S);this.addDispose(this.resourceService.onRegisterResourceProvider(S=>{S.scheme&&(this.shouldShowCommentsSchemes.add(S.scheme),this.registerDecorationProvider())})),this.addDispose(this.resourceService.onUnregisterResourceProvider(S=>{S.scheme&&(this.shouldShowCommentsSchemes.delete(S.scheme),this.registerDecorationProvider())})),this.registerDecorationProvider()}getCurrentEditor(A){var S;if(A){for(const D of this.allEditors)if(!((S=D.currentUri)===null||S===void 0)&&S.isEqual(A))return this.editor=D,D}return this.editor}handleOnCreateEditor(A){const S=new _.Disposable;if(this.allEditors.some(w=>w.monacoEditor.getId()===A.monacoEditor.getId()))return this.editorDisposerMap.get(A.monacoEditor.getId())||S;this.editorDisposerMap.set(A.monacoEditor.getId(),S),this.allEditors.push(A),S.addDispose(_.Disposable.create(()=>{const w=this.editorRenderAbortControllers.get(A.getId());w&&(w.abort(),this.editorRenderAbortControllers.delete(A.getId()))})),this.editor=A;let D=[],I=!1;return S.addDispose(A.monacoEditor.onMouseDown(w=>{if(w.target.type===a.monacoBrowser.editor.MouseTargetType.GUTTER_LINE_DECORATIONS&&w.target.element&&w.target.element.className.indexOf("comment-add")>-1){const{target:T}=w;if(T&&T.range){const{range:R}=T;this.startCommentRange=R,w.event.stopPropagation()}}else if(w.target.type===a.monacoBrowser.editor.MouseTargetType.GUTTER_GLYPH_MARGIN&&w.target.element&&w.target.element.className.indexOf("comment-thread")>-1){const{target:T}=w;if(T&&T.range){const{range:R}=T,M=this.commentsThreads.filter(O=>A.currentUri&&O.uri.isEqual(A.currentUri)&&O.range.endLineNumber===R.endLineNumber);M.length&&(M.some(x=>x.isShowWidget(A))?M.forEach(x=>x.hide(A)):M.forEach(x=>x.show(A)))}w.event.stopPropagation()}})),S.addDispose(A.monacoEditor.onMouseUp(async w=>{if(this.startCommentRange){if(I){this.renderCommentRange(A),I=!1,this.startCommentRange=null,this.endCommentRange=null;return}let T=this.startCommentRange;this.endCommentRange&&(this.endCommentRange.startLineNumber<this.startCommentRange.startLineNumber?(T.startColumn=this.endCommentRange.startColumn,T.startLineNumber=this.endCommentRange.startLineNumber):(T.endColumn=this.endCommentRange.endColumn,T.endLineNumber=this.endCommentRange.endLineNumber)),A.currentUri&&(T=await this.getValidRange(T,A.currentUri)),T&&(this.commentsThreads.some(R=>R.comments.get().length===0&&A.currentUri&&R.uri.isEqual(A.currentUri)&&R.range.startLineNumber===T.startLineNumber&&R.range.endLineNumber===T.endLineNumber)||this.createThread(A.currentUri,T).show(A),w.event.stopPropagation())}else if(w.target.type===a.monacoBrowser.editor.MouseTargetType.GUTTER_LINE_DECORATIONS&&w.target.element&&w.target.element.className.indexOf("comment-range")>-1&&w.target.element.className.indexOf("comment-thread")<0){const{target:T}=w,R=T.range;R&&(this.commentsThreads.some(M=>M.comments.get().length===0&&A.currentUri&&M.uri.isEqual(A.currentUri)&&M.range.startLineNumber===R.startLineNumber&&M.range.endLineNumber===R.endLineNumber)||this.createThread(A.currentUri,R).show(A),w.event.stopPropagation())}this.startCommentRange=null,this.endCommentRange=null})),S.addDispose(A.monacoEditor.onMouseMove(async w=>{var T,R,M;const O=A.currentUri,x=w.target.range;if(this.startCommentRange){if(!((T=w.target.element)===null||T===void 0)&&T.className||!((M=(R=w.target.element)===null||R===void 0?void 0:R.offsetParent)===null||M===void 0)&&M.className.includes("diff-hidden-lines")&&(I=!0),O&&x){let k={startLineNumber:this.startCommentRange.startLineNumber,endLineNumber:x.endLineNumber,startColumn:this.startCommentRange.startColumn,endColumn:x.endColumn};this.startCommentRange.startLineNumber>x.startLineNumber&&(k={startLineNumber:x.startLineNumber,endLineNumber:this.startCommentRange.endLineNumber,startColumn:x.startColumn,endColumn:this.startCommentRange.endColumn}),this.renderCommentRange(A,k),this.endCommentRange=x}}else if(O&&x&&await this.shouldShowHoverDecoration(O,x)){const k=[{range:(0,s.positionToRange)(x.startLineNumber),options:this.createHoverDecoration()}];D=A.monacoEditor.deltaDecorations(D,k)}})),S.addDispose(A.monacoEditor.onMouseLeave(async w=>{var T;const R=(T=w.target)===null||T===void 0?void 0:T.range,M=[];!this.startCommentRange&&R&&M.push({range:(0,s.positionToRange)(R.startLineNumber),options:this.createCommentRangeDecoration()}),D=A.monacoEditor.deltaDecorations(D,M)})),S.addDispose(this.onCommentRangeProviderChange(()=>{this.renderCommentRange(A)})),S.addDispose(_.Event.any(this.onThreadsChanged,this.onThreadsCommentChange,this.onThreadsCreated)(w=>{const T=this.getCurrentEditor(w.uri);T&&this.renderCommentRange(T),this.updateActiveThreadDecoration(void 0)})),S.addDispose(this.onDidChangeCurrentCommentThread(w=>{this.updateActiveThreadDecoration(w)})),this.tryUpdateReservedSpace(A),S.addDispose(A.monacoEditor.onDidChangeModel(w=>{var T;const{newModelUrl:R}=w;R&&this.editorCollectionService.listMultiDiffEditors()[0]&&((T=A.updateDocumentModel)===null||T===void 0||T.call(A,_.URI.from(R))),this.renderCommentRange(A).then(()=>{this.tryUpdateReservedSpace(A)})})),S}async getValidRange(A,S){if(!S)return A;const D=await this.getContributionRanges(S);if(D.length===0)return A;const I=D.find(w=>{if(A.startLineNumber>=w.startLineNumber&&A.startLineNumber<=w.endLineNumber)return!0});return I&&I.endLineNumber<A.endLineNumber?{startLineNumber:A.startLineNumber,startColumn:A.startColumn,endLineNumber:I.endLineNumber,endColumn:I.endColumn}:A}ensureCommentingRangeReservedAmount(A){const S=this.getExistingCommentEditorOptions(A),D=this.editorLineDecorationsWidthMap.get(A.getId());S.lineDecorationsWidth!==D&&A.updateOptions({lineDecorationsWidth:this.getWithCommentsLineDecorationWidth(A,S.lineDecorationsWidth)})}tryUpdateReservedSpace(A){if(!A)return;let S=this.editorCommentingRangeSpaceReservedMap.get(A.getId())||!1;const D=A.currentUri?this.shouldShowCommentsSchemes.has(A.currentUri.scheme):!1,I=this.commentsThreads.some(T=>A.currentUri&&T.uri.isEqual(A.currentUri)&&T.comments.get().length>0),w=D||I;if(w)if(S)this.ensureCommentingRangeReservedAmount(A);else{S=!0;const{lineDecorationsWidth:T,extraEditorClassName:R}=this.getExistingCommentEditorOptions(A),M=this.getWithCommentsEditorOptions(A,R,T);this.updateEditorLayoutOptions(A,M.extraEditorClassName,M.lineDecorationsWidth)}else if(!w&&S){S=!1;const{lineDecorationsWidth:T,extraEditorClassName:R}=this.getExistingCommentEditorOptions(A),M=this.getWithoutCommentsEditorOptions(A,R,T);this.updateEditorLayoutOptions(A,M.extraEditorClassName,M.lineDecorationsWidth)}this.editorCommentingRangeSpaceReservedMap.set(A.getId(),S)}getExistingCommentEditorOptions(A){const S=A.monacoEditor.getOption(g.EditorOption.lineDecorationsWidth);let D=[];const I=A.monacoEditor.getRawOptions().extraEditorClassName;return I&&(D=I.split(" ")),{lineDecorationsWidth:S,extraEditorClassName:D}}getWithoutCommentsEditorOptions(A,S,D){let I=D;const w=S.findIndex(R=>R==="inline-comment");w>=0&&S.splice(w,1);const T=A.monacoEditor.getOptions();return T.get(g.EditorOption.folding)&&T.get(g.EditorOption.showFoldingControls)!=="never"&&(I+=11),I-=24,{extraEditorClassName:S,lineDecorationsWidth:I}}updateEditorLayoutOptions(A,S,D){A.updateOptions({extraEditorClassName:S.join(" "),lineDecorationsWidth:D})}getWithCommentsEditorOptions(A,S,D){return S.push("inline-comment"),{lineDecorationsWidth:this.getWithCommentsLineDecorationWidth(A,D),extraEditorClassName:S}}getWithCommentsLineDecorationWidth(A,S){let D=S;const I=A.monacoEditor.getOptions();return I.get(g.EditorOption.folding)&&I.get(g.EditorOption.showFoldingControls)!=="never"&&(D-=11),D+=24,this.editorLineDecorationsWidthMap.set(A.getId(),D),D}async renderCommentRange(A,S={startLineNumber:0,endLineNumber:0,startColumn:0,endColumn:0}){if(!A.currentUri)return;const D=this.editorRenderAbortControllers.get(A.getId());D&&D.abort();const I=new AbortController;this.editorRenderAbortControllers.set(A.getId(),I);try{const w=await this.getContributionRanges(A.currentUri);if(I.signal.aborted)return;if(w.length>0){const T=[];if(w.map(M=>{if(!I.signal.aborted){if(S.startLineNumber===0&&S.endLineNumber===0)T.push({range:M,options:this.createCommentRangeDecoration()});else if(S.startLineNumber<=M.startLineNumber&&S.endLineNumber>=M.endLineNumber)T.push({range:M,options:this.createDottedRangeDecoration()},{range:M,options:this.createThreadRangeDecoration()});else if(S.endLineNumber>=M.endLineNumber)if(S.startLineNumber<=M.endLineNumber){const O={startLineNumber:S.startLineNumber,endLineNumber:M.endLineNumber,startColumn:S.startColumn,endColumn:S.endColumn},x={startLineNumber:M.startLineNumber,endLineNumber:O.startLineNumber-1,startColumn:M.startColumn,endColumn:O.endColumn};T.push({range:x,options:this.createCommentRangeDecoration()},{range:O,options:this.createDottedRangeDecoration()},{range:O,options:this.createThreadRangeDecoration()})}else T.push({range:M,options:this.createCommentRangeDecoration()});else if(S.endLineNumber<M.endLineNumber)if(S.endLineNumber>=M.startLineNumber)if(S.startLineNumber>=M.startLineNumber){const O={startLineNumber:M.startLineNumber,startColumn:M.startColumn,endLineNumber:S.startLineNumber-1,endColumn:S.startColumn},x={startLineNumber:S.endLineNumber+1,startColumn:S.endColumn,endLineNumber:M.endLineNumber,endColumn:M.endColumn},k=S.startLineNumber!==M.startLineNumber?[{range:O,options:this.createCommentRangeDecoration()}]:[];k.push({range:S,options:this.createDottedRangeDecoration()}),k.push({range:S,options:this.createThreadRangeDecoration()}),k.push({range:x,options:this.createCommentRangeDecoration()}),T.push(...k)}else{const O={startLineNumber:M.startLineNumber,startColumn:M.startColumn,endLineNumber:S.endLineNumber,endColumn:S.endColumn},x={startLineNumber:O.endLineNumber+1,startColumn:O.endColumn,endLineNumber:M.endLineNumber,endColumn:M.endColumn};T.push({range:O,options:this.createDottedRangeDecoration()},{range:O,options:this.createThreadRangeDecoration()},{range:x,options:this.createCommentRangeDecoration()})}else T.push({range:M,options:this.createCommentRangeDecoration()})}}),I.signal.aborted)return;const R=this.commentRangeDecorationMap.get(A.currentUri.toString())||[];this.commentRangeDecorationMap.set(A.currentUri.toString(),A.monacoEditor.deltaDecorations(R,T))}else this.commentRangeDecorationMap.set(A.currentUri.toString(),[])}finally{this.editorRenderAbortControllers.get(A.getId())===I&&this.editorRenderAbortControllers.delete(A.getId())}}async shouldShowHoverDecoration(A,S){return this.shouldShowCommentsSchemes.has(A.scheme)?(await this.getContributionRanges(A)).some(w=>S.startLineNumber<=w.endLineNumber):!1}createThread(A,S,D={comments:[],readOnly:!1}){const I=this.getProviderIdsByLine(S.endLineNumber)[0],w=this.injector.get(f.CommentsThread,[A,S,I,D]);return w.onDispose(()=>{this.threads.delete(w.id),this.threadsChangeEmitter.fire(w),this.decorationChangeEmitter.fire(A)}),w.onDidChange(()=>{this.threadsChangeEmitter.fire(w)}),this.threads.set(w.id,w),this.addDispose(w),this.threadsChangeEmitter.fire(w),this.threadsCreatedEmitter.fire(w),this.decorationChangeEmitter.fire(A),w}getThreadsByUri(A){return this.commentsThreads.filter(S=>S.uri.isEqual(A)).sort((S,D)=>S.range.startLineNumber-D.range.startLineNumber)}handleCommentFileNode(A){const S=[],D=[...this.threads.values()].filter(w=>w.comments.get().length),I=(0,o.default)(D,w=>w.uri);return Object.keys(I).map(w=>{var T;const R=I[w];if(R.length===0)return;const M=new _.URI(this.appConfig.workspaceDir),O=new _.URI(w),x=(T=M.relative(O))===null||T===void 0?void 0:T.toString();S.push(new d.CommentFileNode(this,R,x,O.codeUri.fsPath,this.labelService.getIcon(O),O,A))}),S}handleCommentContentNode(A){var S;const D=[];for(const I of A.threads){const w=I.comments.get(),[T]=w,R=typeof T.body=="string"?T.body:T.body.value;let M=`[Ln ${I.range.startLineNumber}]`;I.range.startLineNumber!==I.range.endLineNumber&&(M=`[Ln ${I.range.startLineNumber}-${I.range.endLineNumber}]`),D.push(new d.CommentContentNode(this,I,R,M,T.author.iconPath&&(!((S=T.author.iconPath)===null||S===void 0)&&S.authority)?this.iconService.fromIcon("",T.author.iconPath.toString(),h.IconType.Background):(0,_.getIcon)("message"),T.author,A.resource,A))}return D}handleCommentReplyNode(A){const S=[],D=A.thread,I=D.comments.get(),[w,...T]=I,R=T[T.length-1].author.name;return S.push(new d.CommentReplyNode(this,D,(0,_.formatLocalize)("comment.reply.count",T?.length||0),(0,_.formatLocalize)("comment.reply.lastReply",R),"",A.resource,A)),S}async resolveChildren(A){let S=[];if(A?d.CommentRoot.isRoot(A)?S=this.handleCommentFileNode(A):d.CommentFileNode.is(A)?S=this.handleCommentContentNode(A):d.CommentContentNode.is(A)&&(S=this.handleCommentReplyNode(A)):S.push(new d.CommentRoot(this)),S.length===1&&d.CommentRoot.isRoot(S[0]))return S;const D=this.commentsFeatureRegistry.getCommentsPanelTreeNodeHandlers();if(D.length>0)for(const I of D)S=I(S);return S}async getContributionRanges(A){const S=this.providerDecorationCache.get(A.toString());if(S)return await S.promise;const D=this.documentService.getModelReference(A,"Get Comment Range"),I=[];for(const M of this.rangeProviderMap){const[O,x]=M;I.push((async()=>{if(!D?.instance)return;const k=await x.getCommentingRanges(D.instance);return k&&k.length&&this.rangeOwner.set(O,k),k})())}const w=new _.Deferred;this.providerDecorationCache.set(A.toString(),w);const T=(await Promise.all(I)).filter(Boolean);D?.dispose();const R=(0,r.default)(T).filter(Boolean);return w.resolve(R),R}fireThreadCommentChange(A){this.threadsCommentChangeEmitter.fire(A)}registerDecorationProvider(){this.decorationProviderDisposer.dispose(),this.decorationProviderDisposer=this.editorDecorationCollectionService.registerDecorationProvider({schemes:[...this.shouldShowCommentsSchemes.values()],key:"comments",onDidDecorationChange:this.decorationChangeEmitter.event,provideEditorDecoration:A=>this.commentsThreads.map(S=>{if(S.uri.isEqual(A)){const D=this.editorCollectionService.getEditorByUri(S.uri);D?S.show(D):S.hide()}else S.hide();return S}).filter(S=>{const D=S.uri.isEqual(A);return this.filterThreadDecoration?D&&this.filterThreadDecoration(S):D}).map(S=>({range:{startLineNumber:S.range.endLineNumber,endLineNumber:S.range.endLineNumber,startColumn:S.range.endColumn,endColumn:S.range.endColumn},options:this.createThreadDecoration(S)}))}),this.addDispose(this.decorationProviderDisposer)}registerCommentPanel(){this.layoutService.getTabbarHandler(c.CommentPanelId)||this.layoutService.collectTabbarComponent([{id:c.CommentPanelId,component:E.CommentsPanel}],{badge:this.panelBadge,containerId:c.CommentPanelId,title:(0,_.localize)("comments").toUpperCase(),hidden:!1,activateKeyBinding:"ctrlcmd+shift+c",...this.commentsFeatureRegistry.getCommentsPanelOptions()},"bottom")}get panelBadge(){const A=this.commentsThreads.length;return A?A+"":""}registerCommentRangeProvider(A,S){return this.rangeProviderMap.set(A,S),this.providerDecorationCache.clear(),this.commentRangeProviderChangeEmitter.fire(),_.Disposable.create(()=>{this.rangeProviderMap.delete(A),this.rangeOwner.delete(A),this.providerDecorationCache.clear()})}forceUpdateDecoration(){var A,S,D;const I=(A=this.workbenchEditorService.currentEditor)===null||A===void 0?void 0:A.currentUri;I&&this.decorationChangeEmitter.fire(I);const w=(D=(S=this.workbenchEditorService.currentEditorGroup)===null||S===void 0?void 0:S.diffEditor)===null||D===void 0?void 0:D.originalEditor.currentUri;w&&this.decorationChangeEmitter.fire(w)}getProviderIdsByLine(A){const S=[];if(this.rangeOwner.size===1)return[this.rangeOwner.keys().next().value];for(const D of this.rangeOwner){const[I,w]=D;w&&w.some(T=>T.startLineNumber<=A&&A<=T.endLineNumber)&&S.push(I)}return S}};t.CommentsService=y,n.__decorate([(0,l.Autowired)(l.INJECTOR_TOKEN),n.__metadata("design:type",l.Injector)],y.prototype,"injector",void 0),n.__decorate([(0,l.Autowired)(_.AppConfig),n.__metadata("design:type",Object)],y.prototype,"appConfig",void 0),n.__decorate([(0,l.Autowired)(p.IEditorDecorationCollectionService),n.__metadata("design:type",Object)],y.prototype,"editorDecorationCollectionService",void 0),n.__decorate([(0,l.Autowired)(h.IIconService),n.__metadata("design:type",Object)],y.prototype,"iconService",void 0),n.__decorate([(0,l.Autowired)(_.LabelService),n.__metadata("design:type",_.LabelService)],y.prototype,"labelService",void 0),n.__decorate([(0,l.Autowired)(c.ICommentsFeatureRegistry),n.__metadata("design:type",Object)],y.prototype,"commentsFeatureRegistry",void 0),n.__decorate([(0,l.Autowired)(p.IEditorDocumentModelService),n.__metadata("design:type",Object)],y.prototype,"documentService",void 0),n.__decorate([(0,l.Autowired)(m.IMainLayoutService),n.__metadata("design:type",Object)],y.prototype,"layoutService",void 0),n.__decorate([(0,l.Autowired)(p.WorkbenchEditorService),n.__metadata("design:type",p.WorkbenchEditorService)],y.prototype,"workbenchEditorService",void 0),n.__decorate([(0,l.Autowired)(v.EditorCollectionService),n.__metadata("design:type",v.EditorCollectionService)],y.prototype,"editorCollectionService",void 0),n.__decorate([(0,l.Autowired)(p.ResourceService),n.__metadata("design:type",p.ResourceService)],y.prototype,"resourceService",void 0),n.__decorate([_.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],y.prototype,"isMultiCommentsForSingleLine",null),n.__decorate([_.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],y.prototype,"currentAuthorAvatar",null),n.__decorate([_.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],y.prototype,"filterThreadDecoration",null),t.CommentsService=y=n.__decorate([(0,l.Injectable)()],y)},54230:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(69635),_=e(66480),v=e(62604),p=e(55011),m=e(47842);let s=class extends o.BrowserModule{constructor(){super(...arguments),this.contributionProvider=l.CommentsContribution,this.providers=[{token:l.ICommentsService,useClass:p.CommentsService},{token:m.CommentModelService,useClass:m.CommentModelService},{token:l.ICommentsFeatureRegistry,useClass:_.CommentsFeatureRegistry},v.CommentsBrowserContribution]}};t.CommentsModule=s,t.CommentsModule=s=n.__decorate([(0,r.Injectable)()],s)},70154:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.markdownCss=void 0,t.markdownCss=`
|
|
33226
|
+
`)};t.extractCodeBlocks=p;const m=a=>a.replace(/[^a-zA-Z0-9_-]/g,"").slice(0,64);t.toClaudeToolName=m,t.TOOL_NAME_SEPARATOR="__";const s=(a,h)=>h===n.BUILTIN_MCP_SERVER_NAME?a:(0,t.toClaudeToolName)(`mcp${t.TOOL_NAME_SEPARATOR}${h}${t.TOOL_NAME_SEPARATOR}${a}`);t.getToolName=s;const g=a=>{const h=/`<attached_file>(.*)`/g,u=/`<attached_folder>(.*)`/g;return a=a.replace(h,"$1"),a=a.replace(u,"$1"),a};t.cleanAttachedTextWrapper=g},26471:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),e(85608).__exportStar(e(19413),t)},15504:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentReactions=t.CommentReactionSwitcher=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(41869),l=e(81878),_=e(25918),v=e(93899),p=e(52416),m=e(69635),s=n.__importDefault(e(38877)),g=({thread:h,comment:u,className:c})=>{const E=`${h.providerId}_${h.id}_${u.id}`,f=`${v.MenuId.CommentReactionSwitcherMenu}_${E}`,d=(0,o.useInjectable)(v.IMenuRegistry),y=(0,o.useInjectable)(v.AbstractMenuService);r.default.useEffect(()=>{const A=new o.Disposable,S=`${v.MenuId.CommentReactionSwitcherSubmenu}_${E}`;return A.addDispose(d.registerMenuItem(f,{submenu:S,label:S,iconClass:(0,o.getExternalIcon)("reactions"),group:"navigation"})),A.addDispose(d.registerMenuItems(S,u.reactions.map(D=>({command:{id:m.SwitchCommandReaction,label:D.label},extraTailArgs:[{thread:h,comment:u,reaction:D}]})))),()=>A.dispose()},[]);const b=r.default.useMemo(()=>y.createMenu(f),[]);return r.default.createElement(_.InlineActionBar,{className:c,menus:b,regroup:A=>[A,[]],type:"icon"})};t.CommentReactionSwitcher=g;const a=({thread:h,comment:u})=>{var c;const E=(0,o.useInjectable)(o.IEventBus),f=(0,o.useInjectable)(p.IIconService),d=r.default.useCallback(y=>{E.fire(new m.CommentReactionClick({thread:h,comment:u,reaction:y}))},[]);return r.default.createElement("div",{className:s.default.comment_reactions},(c=u.reactions)===null||c===void 0?void 0:c.filter(y=>y.count!==0).map(y=>r.default.createElement(l.Button,{key:y.label,onClick:()=>d(y),type:"secondary",size:"small",title:y.label,className:s.default.comment_reaction,iconClass:f.fromIcon("",y.iconPath.toString(),p.IconType.Background)},"\xA0",y.count)))};t.CommentReactions=a},54143:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsBody=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=n.__importDefault(e(43144)),l=e(84605),_=n.__importDefault(e(38877)),v=e(70154),p=({root:m,children:s})=>o.default.createPortal(s,m);t.CommentsBody=r.default.memo(({body:m})=>{const s=r.default.useRef(null),[g,a]=r.default.useState(null),h=r.default.useMemo(()=>{const u=(0,l.createMarkedRenderer)();return u.link=({href:c,title:E,text:f})=>`<a target="_blank" rel="noopener" href="${c}" title="${E||""}">${f}</a>`,u},[]);return r.default.useEffect(()=>{if(s.current){const u=s.current.attachShadow({mode:"open"});g||a(u)}},[]),r.default.createElement("div",{ref:s,className:_.default.comment_shadow_box},g&&r.default.createElement(p,{root:g},r.default.createElement("style",null,v.markdownCss),r.default.createElement("div",{dangerouslySetInnerHTML:{__html:(0,l.toMarkdownHtml)(typeof m=="string"?m:m.value,{gfm:!0,breaks:!1,pedantic:!1,renderer:h})}})))})},66480:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsFeatureRegistry=void 0;const n=e(85608),r=e(76003);let o=class{constructor(){this.config={},this.options={},this.panelTreeNodeHandlers=[],this.mentionsOptions={},this.providerFeature=new Map}registerConfig(_){this.config={...this.config,..._}}registerPanelTreeNodeHandler(_){this.panelTreeNodeHandlers.push(_)}registerPanelOptions(_){this.options={...this.options,..._}}registerFileUploadHandler(_){this.fileUploadHandler=_}registerMentionsOptions(_){this.mentionsOptions=_}registerZoneWidgetRender(_){this.zoneWidgetRender=_}getConfig(){return this.config}getCommentsPanelOptions(){return this.options}getCommentsPanelTreeNodeHandlers(){return this.panelTreeNodeHandlers}getFileUploadHandler(){return this.fileUploadHandler}getMentionsOptions(){return this.mentionsOptions}getZoneWidgetRender(){return this.zoneWidgetRender}registerProviderFeature(_,v){this.providerFeature.set(_,v)}getProviderFeature(_){return this.providerFeature.get(_)}};t.CommentsFeatureRegistry=o,t.CommentsFeatureRegistry=o=n.__decorate([(0,r.Injectable)()],o)},37357:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentItem=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(97267),l=e(41869),_=e(25918),v=e(93899),p=e(69635),m=e(15504),s=e(54143),g=e(42018),a=n.__importDefault(e(38877)),h=({timestamp:f})=>{const d=r.default.useMemo(()=>{const y=new Date(f);return(0,l.toLocalString)(y)},[f]);return r.default.createElement("span",{className:a.default.comment_item_timestamp},d)},u=(f,d)=>{const y=(0,l.useInjectable)(v.AbstractMenuService),{body:b,contextValue:A}=d,[S,D]=r.default.useState(""),I=(0,l.useInjectable)(p.ICommentsFeatureRegistry),w=r.default.useMemo(()=>I.getFileUploadHandler(),[]);r.default.useEffect(()=>{D(b)},[b]);const T=r.default.useMemo(()=>f.createScoped(),[]),R=r.default.useMemo(()=>T.createKey("commentIsEmpty",!d.body),[]),M=r.default.useMemo(()=>y.createMenu(v.MenuId.CommentsCommentContext,T),[]),O=r.default.useMemo(()=>y.createMenu(v.MenuId.CommentsCommentTitle,T),[]),x=r.default.useRef(T.createKey("comment",A));r.default.useEffect(()=>{x.current.set(A)},[A]);const k=r.default.useCallback(L=>{R.set(!L.target.value),D(L.target.value)},[]),F=r.default.useCallback(async L=>{if(w){const B=await w(S,L);D(U=>{const W=U+B;return R.set(!W),W})}},[S]);return[S,D,k,M,O,F]},c=({reply:f,thread:d})=>{var y;const{contextKeyService:b}=d,{author:A,label:S,body:D,mode:I,timestamp:w}=f,T=(y=A.iconPath)===null||y===void 0?void 0:y.toString(),[R,M,O,x,k,F]=u(b,f),L=r.default.useMemo(()=>{const B=(0,l.toMarkdownHtml)(typeof D=="string"?D:D.value);return/^\<p\>[^<>]+\<\/p\>\n$/.test(B)},[D]);return r.default.createElement("div",{className:a.default.reply_item},(0,l.isUndefined)(I)||I===p.CommentMode.Preview?r.default.createElement("div",null,L?r.default.createElement(r.default.Fragment,null,T&&r.default.createElement("img",{className:a.default.reply_item_icon,src:T,alt:A.name}),r.default.createElement("span",{className:a.default.comment_item_author_name},A.name),w&&r.default.createElement(h,{timestamp:w}),typeof S=="string"?r.default.createElement("span",{className:a.default.comment_item_label},S):S," : ",r.default.createElement("span",{className:a.default.comment_item_body},typeof D=="string"?D:D.value),f.reactions&&f.reactions.length>0&&r.default.createElement(m.CommentReactionSwitcher,{className:a.default.reply_item_title,thread:d,comment:f}),r.default.createElement(_.InlineActionBar,{separator:"inline",className:a.default.reply_item_title,menus:k,context:[{thread:d,comment:f,menuId:v.MenuId.CommentsCommentTitle}],type:"icon"})):r.default.createElement(r.default.Fragment,null,r.default.createElement("div",{className:a.default.comment_item_markdown_header},r.default.createElement("div",null,T&&r.default.createElement("img",{className:a.default.reply_item_icon,src:T,alt:A.name}),r.default.createElement("span",{className:a.default.comment_item_author_name},A.name),w&&r.default.createElement(h,{timestamp:w}),typeof S=="string"?r.default.createElement("span",{className:a.default.comment_item_label},S):S," : "),r.default.createElement(_.InlineActionBar,{separator:"inline",className:a.default.reply_item_title,menus:k,context:[{thread:d,comment:f,menuId:v.MenuId.CommentsCommentTitle}],type:"icon"})),r.default.createElement(s.CommentsBody,{body:D}))):r.default.createElement("div",null,r.default.createElement(g.CommentsTextArea,{value:typeof R=="string"?R:R.value,autoFocus:!0,onChange:O,dragFiles:F}),r.default.createElement(_.InlineActionBar,{className:a.default.comment_item_reply,menus:x,context:[{thread:d,comment:f,body:R,menuId:v.MenuId.CommentsCommentContext}],type:"button",separator:"inline",afterClick:()=>{M(D)}})),f.reactions&&f.reactions.length>0&&r.default.createElement(m.CommentReactions,{thread:d,comment:f}))},E=({thread:f,commentThreadContext:d,widget:y})=>{var b,A;const[S,D]=r.default.useState(!1),[I,w]=r.default.useState(""),{contextKeyService:T}=f,R=(0,l.useAutorun)(f.readOnly),[M,...O]=(0,l.useAutorun)(f.comments),{author:x,label:k,body:F,mode:L,timestamp:B}=M,U=(0,l.isString)(x.iconPath)?x.iconPath:!((b=x.iconPath)===null||b===void 0)&&b.authority?(A=x.iconPath)===null||A===void 0?void 0:A.toString():"",[W,j,Q,G,Z,$]=u(T,M),V=(0,l.useInjectable)(p.ICommentsFeatureRegistry),H=r.default.useMemo(()=>V.getFileUploadHandler(),[]),K=r.default.useMemo(()=>T.createKey("commentIsEmpty",!0),[]);function Y(re){K.set(!re.target.value),w(re.target.value)}const X=r.default.useCallback(async re=>{if(H){const oe=await H(W,re);w(he=>{const me=he+oe;return K.set(!me),me})}},[I]);return r.default.createElement("div",{className:a.default.comment_item},U&&r.default.createElement("img",{className:a.default.comment_item_icon,src:U,alt:x.name}),r.default.createElement("div",{className:a.default.comment_item_content},r.default.createElement("div",{className:a.default.comment_item_head},r.default.createElement("div",{className:a.default.comment_item_name},r.default.createElement("span",{className:a.default.comment_item_author_name},x.name),B&&r.default.createElement(h,{timestamp:B}),typeof k=="string"?r.default.createElement("span",{className:a.default.comment_item_label},k):k),r.default.createElement("div",{className:a.default.comment_item_actions},M.reactions&&M.reactions.length>0&&r.default.createElement(m.CommentReactionSwitcher,{thread:f,comment:M}),!R&&r.default.createElement(o.Button,{className:a.default.comment_item_reply_button,size:"small",type:"secondary",onClick:()=>D(!0)},(0,l.localize)("comments.thread.action.reply")),r.default.createElement(_.InlineActionBar,{menus:Z,context:[{thread:f,comment:M,menuId:v.MenuId.CommentsCommentTitle}],type:"button"}))),(0,l.isUndefined)(L)||L===p.CommentMode.Preview?r.default.createElement(s.CommentsBody,{body:F}):r.default.createElement("div",null,r.default.createElement(g.CommentsTextArea,{value:typeof W=="string"?W:W.value,autoFocus:!0,onChange:Q,dragFiles:$}),r.default.createElement(_.InlineActionBar,{className:a.default.comment_item_context,menus:G,context:[{thread:f,comment:M,body:W,menuId:v.MenuId.CommentsCommentContext}],separator:"inline",type:"button",afterClick:()=>{j(F)}})),M.reactions&&M.reactions.length>0&&r.default.createElement(m.CommentReactions,{thread:f,comment:M}),(O.length>0||S)&&r.default.createElement("div",{className:a.default.comment_item_reply_wrap},O.map(re=>r.default.createElement(c,{key:re.id,thread:f,reply:re})),S&&r.default.createElement("div",null,r.default.createElement(g.CommentsTextArea,{autoFocus:!0,value:I,onChange:Y,placeholder:`${(0,l.localize)("comments.reply.placeholder")}...`,dragFiles:X}),r.default.createElement(_.InlineActionBar,{className:a.default.comment_item_reply,menus:d,context:[{thread:f,text:I,widget:y,menuId:v.MenuId.CommentsCommentThreadContext}],separator:"inline",type:"button",afterClick:()=>{w(""),D(!1)}})))))};t.CommentItem=E},53878:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsPanel=void 0;const n=e(85608),r=n.__importStar(e(14041)),o=e(97267),l=e(41869),_=e(69635),v=n.__importDefault(e(38877)),p=e(5167),m=e(47842),s=({viewState:g})=>{const a=(0,l.useInjectable)(m.CommentModelService),[h,u]=(0,r.useState)(),c=(0,r.useRef)(null),E=(0,l.useInjectable)(_.ICommentsFeatureRegistry),{handleTreeBlur:f}=a;(0,r.useEffect)(()=>{u(a.treeModel);const I=a.onDidUpdateTreeModel(w=>{u(w)});return()=>{I.dispose()}},[]);const d=(0,r.useCallback)(I=>{a.handleTreeHandler(I)},[a]),y=(0,r.useCallback)(I=>r.default.createElement(p.CommentNodeRendered,{item:I.item,itemType:I.itemType,decorations:a.decorations.getDecorations(I.item),defaultLeftPadding:8,onTwistierClick:a.handleTwistierClick,onClick:a.handleItemClick,leftPadding:8}),[h]),b=(0,r.useMemo)(()=>E.getCommentsPanelOptions(),[]),A=(0,r.useMemo)(()=>b.header,[b]),S=(0,r.useMemo)(()=>r.default.createElement("div",{className:v.default.panel_placeholder},b.defaultPlaceholder||(0,l.localize)("comments.panel.placeholder")),[b]),D=(0,r.useCallback)(()=>h?r.default.createElement(o.RecycleTree,{height:g.height-(A?.height||0),itemHeight:p.COMMENT_TREE_NODE_HEIGHT,onReady:d,model:h,placeholder:()=>S},y):S,[h,A,g.height]);return r.default.createElement("div",{className:v.default.comment_panel,tabIndex:-1,onBlur:f,ref:c},A?.component,D())};t.CommentsPanel=s},42018:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsTextArea=void 0;const n=e(85608),r=n.__importDefault(e(14041)),o=e(34801),l=e(97267),_=e(41869),v=e(69635),p=e(54143),m=n.__importDefault(e(38877)),s=e(73136),g="@",a="@[__display__](__id__)",h=(u,c)=>`@${c}`;t.CommentsTextArea=r.default.forwardRef((u,c)=>{const{focusDelay:E=0,autoFocus:f=!1,placeholder:d="",onFocus:y,onBlur:b,onChange:A,maxRows:S=10,minRows:D=2,value:I,initialHeight:w,dragFiles:T}=u,[R,M]=r.default.useState(0),O=(0,_.useInjectable)(v.ICommentsFeatureRegistry),x=r.default.useRef(null),k=r.default.useRef(null),F=r.default.useRef(null);r.default.useImperativeHandle(c,()=>x.current);const L=r.default.useCallback(async Z=>{var $;Z.stopPropagation(),Z.preventDefault();const V=($=Z.clipboardData)===null||$===void 0?void 0:$.files;V&&T&&await T(V),x.current&&(x.current.focus(),W(x.current.value))},[T]),B=r.default.useCallback(async Z=>{var $;Z.stopPropagation(),Z.preventDefault();const V=($=Z.dataTransfer)===null||$===void 0?void 0:$.files;V&&T&&await T(V),x.current&&(x.current.focus(),W(x.current.value))},[T]),U=r.default.useCallback(Z=>{Z.stopPropagation(),Z.preventDefault(),Z.dataTransfer.dropEffect="copy"},[]),W=r.default.useCallback(Z=>{const $=x.current;if($){const V=Z.toString().length;$.setSelectionRange(V,V)}},[]);r.default.useEffect(()=>{var Z;const $=x.current;if(!$)return;w&&$.style&&($.style.height=w),E&&setTimeout(()=>{$.focus({preventScroll:!0})},E),W(I);function V(H){var K,Y,X;const re=H.target;re&&(re.nodeName.toUpperCase()==="TEXTAREA"&&re.scrollHeight>re.clientHeight||re.nodeName.toUpperCase()==="UL"||((K=re.parentElement)===null||K===void 0?void 0:K.nodeName.toUpperCase())==="UL"||((X=(Y=re.parentElement)===null||Y===void 0?void 0:Y.parentElement)===null||X===void 0?void 0:X.nodeName.toUpperCase())==="UL")&&H.stopPropagation()}return(Z=k.current)===null||Z===void 0||Z.addEventListener("mousewheel",V,!0),()=>{var H;(H=k.current)===null||H===void 0||H.removeEventListener("mousewheel",V,!0)}},[]),r.default.useEffect(()=>{R===0&&(setTimeout(()=>{var Z;(Z=x.current)===null||Z===void 0||Z.focus({preventScroll:!0})},E),W(I))},[R]);const j=r.default.useMemo(()=>(0,s.getMentionBoxStyle)({minRows:D,maxRows:S}),[D,S]),Q=r.default.useMemo(()=>O.getMentionsOptions(),[O]),G=r.default.useCallback(async(Z,$)=>{if(Q.providerData){const V=await Q.providerData(Z);$(V)}else $([])},[Q]);return r.default.createElement("div",{className:m.default.textarea_container},r.default.createElement(l.Tabs,{mini:!0,value:R,onChange:Z=>M(Z),tabs:[(0,_.localize)("comments.thread.textarea.write"),(0,_.localize)("comments.thread.textarea.preview")]}),r.default.createElement("div",null,R===0?r.default.createElement("div",{ref:k},r.default.createElement(o.MentionsInput,{autoFocus:f,onPaste:L,inputRef:x,onDragOver:U,onDrop:B,ref:F,value:I,placeholder:d,onChange:A,onFocus:y,onBlur:b,style:j},r.default.createElement(o.Mention,{markup:Q.markup||a,renderSuggestion:Q.renderSuggestion,trigger:g,data:G,displayTransform:Q.displayTransform||h}))):r.default.createElement("div",{className:m.default.textarea_preview},r.default.createElement(p.CommentsBody,{body:I}))))})},49867:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsThread=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(91830),_=e(54414),v=e(28423),p=e(69635),m=e(90366);let s=class extends o.Disposable{set contextValue(a){this._contextKeyService.createKey("thread",a)}get contextValue(){return this._contextKeyService.getContextKeyValue("thread")}get onDidChangeCollapsibleState(){return this.onDidChangeCollapsibleStateEmitter.event}get onDidChange(){return this.onDidChangeEmitter.event}constructor(a,h,u,c){super(),this.uri=a,this.range=h,this.providerId=u,this.options=c,this.comments=(0,v.observableValue)(this,[]),this.label=(0,v.observableValue)(this,void 0),this.readOnly=(0,v.observableValue)(this,!1),this.isCollapsed=(0,v.observableValue)(this,!1),this.onDidChangeCollapsibleStateEmitter=new o.Emitter,this.widgets=new Map,this._id=`thread_${(0,o.uuid)()}`,this.onDidChangeEmitter=new o.Emitter,this.pendingShowTimeouts=new Set,this.threadHeaderTitle=(0,v.derived)(this,S=>{const D=this.label.read(S);if(D)return D;const I=this.comments.read(S);if(I.length){const w=new Set(I.map(T=>`@${T.author.name}`));return`${(0,o.localize)("comments.participants")}: `+[...w].join(" ")}else return(0,o.localize)("comments.zone.title")}),this.toggle=S=>{if(this.comments.get().length>0){const I=this.widgets.get(S);I&&I.toggle()}else this.dispose()},this.updateComments(c.comments?c.comments.map(S=>({...S,id:(0,o.uuid)()})):[]),this.data=this.options.data,this._contextKeyService=this.registerDispose(this.globalContextKeyService.createScoped()),new l.ResourceContextKey(this._contextKeyService).set(a),this._contextKeyService.createKey("thread",c.contextValue),(0,v.transaction)(S=>{this.setReadOnly(!!c.readOnly),this.label.set(c.label,S),this.isCollapsed.set(!!this.options.isCollapsed,S)});const f=this._contextKeyService.createKey("threadsLength",this.commentsService.getThreadsByUri(a).length),d=this.comments.get(),y=this._contextKeyService.createKey("commentsLength",d.length),b=this._contextKeyService.createKey("commentThreadIsEmpty",!d.length);this._contextKeyService.createKey("commentController",u),this.addDispose((0,v.autorun)(S=>{const D=this.comments.read(S).length;y.set(D),b.set(!D)})),this.getEditorsByUri(this.uri).forEach(S=>{this.widgets.get(S)||this.addWidgetByEditor(S)}),this.addDispose((0,v.autorun)(S=>{this.isCollapsed.read(S)?this.hideAll():this.showAll()})),this.addDispose(this.commentsService.onThreadsChanged(S=>{S.uri.isEqual(a)&&f.set(this.commentsService.getThreadsByUri(a).length)})),this.addDispose({dispose:()=>{this.updateComments([]),this.pendingShowTimeouts.forEach(S=>clearTimeout(S)),this.pendingShowTimeouts.clear()}}),this.onDidChangeEmitter.fire()}updateComments(a){(0,v.transaction)(h=>{this.comments.set(a,h)})}getWidgetByEditor(a){return this.widgets.get(a)}get id(){return this._id}get contextKeyService(){return this._contextKeyService}setReadOnly(a){(0,v.transaction)(h=>{this.readOnly.set(a,h),this._contextKeyService.createKey("readOnly",a)})}getEditorsByUri(a){return this.editorCollectionService.listEditors().filter(h=>{var u;return(u=h.currentUri)===null||u===void 0?void 0:u.isEqual(a)})}addWidgetByEditor(a){const h=this.injector.get(m.CommentsZoneWidget,[a,this,{arrowColor:"var(--peekView-border)"}]);return this.addDispose(h.onChangeZoneWidget(()=>{const u=this.commentsService.commentsThreads.filter(f=>this.isEqual(f)),c=u.findIndex(f=>f===this),E=u.slice(c+1);for(const f of E)if(f.isShowWidget(a)){const d=f.getWidgetByEditor(a);d?.resize()}})),this.addDispose(h),this.widgets.set(a,h),a.onDispose(()=>{h.dispose(),this.widgets.delete(a)}),h}show(a){if(a){let h=this.widgets.get(a);h||(h=this.addWidgetByEditor(a)),h.show()}else this.getEditorsByUri(this.uri).forEach(u=>{var c;let E=this.widgets.get(u);E||(E=this.addWidgetByEditor(u)),E&&(!((c=u.currentUri)===null||c===void 0)&&c.isEqual(this.uri))&&E.show()})}removePaddingShowedWidgets(){this.pendingShowTimeouts.forEach(a=>clearTimeout(a)),this.pendingShowTimeouts.clear()}showWidgetsIfShowed(){var a;this.pendingShowTimeouts.forEach(h=>clearTimeout(h)),this.pendingShowTimeouts.clear();for(const h of this.getEditorsByUri(this.uri)){let u=this.widgets.get(h);if(u||(u=this.addWidgetByEditor(h)),!((a=h.currentUri)===null||a===void 0)&&a.isEqual(this.uri)){const c=setTimeout(()=>{var E;u&&(!((E=h.currentUri)===null||E===void 0)&&E.isEqual(this.uri))&&u.show(),this.pendingShowTimeouts.delete(c)},100);this.pendingShowTimeouts.add(c)}}}hideWidgetsByDispose(){var a;for(const[h,u]of this.widgets)!(!((a=h.currentUri)===null||a===void 0)&&a.isEqual(this.uri))&&u.dispose()}isShowWidget(a){if(a){const h=this.widgets.get(a);return h?h.isShow:!1}else{for(const[,h]of this.widgets)return h.isShow;return!1}}hide(a){if(a){const h=this.widgets.get(a);h?.hide()}else this.hideAll()}showAll(){(0,v.transaction)(a=>{this.isCollapsed.set(!1,a)});for(const[,a]of this.widgets)a.show();this.onDidChangeCollapsibleStateEmitter.fire(p.CommentThreadCollapsibleState.Expanded)}hideAll(a){var h;(0,v.transaction)(u=>{this.isCollapsed.set(!0,u)});for(const[u,c]of this.widgets)a?!(!((h=u.currentUri)===null||h===void 0)&&h.isEqual(this.uri))&&c.dispose():c.hide();this.onDidChangeCollapsibleStateEmitter.fire(p.CommentThreadCollapsibleState.Collapsed)}addComment(...a){const h=this.comments.get();(0,v.transaction)(u=>{this.comments.set([...h,...a.map(c=>({...c,id:(0,o.uuid)()}))],u)}),this.onDidChangeEmitter.fire()}removeComment(a){(0,v.transaction)(h=>{this.comments.set(this.comments.get().filter(u=>u!==a),h)}),this.onDidChangeEmitter.fire()}isEqual(a){return a.uri.isEqual(this.uri)&&a.range.startLineNumber===this.range.startLineNumber&&a.range.endLineNumber===this.range.endLineNumber}};t.CommentsThread=s,n.__decorate([(0,r.Autowired)(p.ICommentsService),n.__metadata("design:type",Object)],s.prototype,"commentsService",void 0),n.__decorate([(0,r.Autowired)(o.IContextKeyService),n.__metadata("design:type",Object)],s.prototype,"globalContextKeyService",void 0),n.__decorate([(0,r.Autowired)(_.EditorCollectionService),n.__metadata("design:type",_.EditorCollectionService)],s.prototype,"editorCollectionService",void 0),n.__decorate([(0,r.Autowired)(r.INJECTOR_TOKEN),n.__metadata("design:type",r.Injector)],s.prototype,"injector",void 0),t.CommentsThread=s=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[o.URI,Object,String,Object])],s)},73804:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsZoneService=void 0;const n=e(85608),r=e(76003),o=e(93899),l=e(43718),_=e(69635),v=e(49867);let p=class extends l.Disposable{constructor(s){super(),this.thread=s}setCurrentCommentThread(s){this.commentService.setCurrentCommentThread(s)}get commentThreadTitle(){return this.registerDispose(this.menuService.createMenu(o.MenuId.CommentsCommentThreadTitle,this.thread.contextKeyService))}get commentThreadContext(){return this.registerDispose(this.menuService.createMenu(o.MenuId.CommentsCommentThreadContext,this.thread.contextKeyService))}};t.CommentsZoneService=p,n.__decorate([(0,r.Autowired)(o.AbstractMenuService),n.__metadata("design:type",o.AbstractMenuService)],p.prototype,"menuService",void 0),n.__decorate([(0,r.Autowired)(_.ICommentsService),n.__metadata("design:type",Object)],p.prototype,"commentService",void 0),n.__decorate([l.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],p.prototype,"commentThreadTitle",null),n.__decorate([l.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],p.prototype,"commentThreadContext",null),t.CommentsZoneService=p=n.__decorate([(0,r.Injectable)({multiple:!0}),n.__param(0,(0,r.Optional)()),n.__metadata("design:paramtypes",[v.CommentsThread])],p)},90366:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsZoneWidget=void 0;const n=e(85608),r=n.__importDefault(e(53373)),o=n.__importDefault(e(14041)),l=n.__importDefault(e(25873)),_=e(76003),v=e(41869),p=e(25918),m=e(93899),s=e(20303),g=e(69635),a=e(37357),h=e(42018),u=e(73804),c=n.__importDefault(e(38877)),E=({thread:d,widget:y})=>{const{contextKeyService:b}=d,A=(0,v.useAutorun)(d.comments),S=(0,v.useAutorun)(d.threadHeaderTitle),I=(0,v.useInjectable)(_.INJECTOR_TOKEN).get(u.CommentsZoneService,[d]),w=(0,v.useInjectable)(g.ICommentsFeatureRegistry),T=o.default.useMemo(()=>w.getFileUploadHandler(),[]),[R,M]=o.default.useState(""),O=o.default.useMemo(()=>b.createKey("commentIsEmpty",!R),[]),x=I.commentThreadTitle,k=I.commentThreadContext,F=o.default.useCallback(G=>{const{value:Z}=G.target;M(Z),O.set(!Z)},[]),L=o.default.useMemo(()=>{var G;return((G=w.getProviderFeature(d.providerId))===null||G===void 0?void 0:G.placeholder)||`${(0,v.localize)("comments.reply.placeholder")}...`},[]),B=o.default.useCallback(async G=>{if(T){const Z=await T(R,G);M($=>{const V=$+Z;return O.set(!V),V})}},[R]);o.default.useEffect(()=>{const G=y.onFirstDisplay(()=>{setTimeout(()=>{y.coreEditor.monacoEditor.revealLine(d.range.endLineNumber+1)},0)});return()=>{G.dispose()}},[]);const U=o.default.useCallback(()=>{I.setCurrentCommentThread(I.thread)},[]),W=o.default.useCallback(()=>{I.setCurrentCommentThread(void 0)},[]),j=o.default.useCallback(()=>{I.setCurrentCommentThread(I.thread)},[]),Q=o.default.useCallback(()=>{I.setCurrentCommentThread(void 0)},[]);return o.default.createElement("div",{tabIndex:-1,onMouseOver:U,onMouseOut:W,onFocus:j,onBlur:Q,className:(0,r.default)(d.options.threadClassName,c.default.comment_container)},o.default.createElement("div",{className:(0,r.default)(d.options.threadHeadClassName,c.default.head)},o.default.createElement("div",{className:c.default.review_title},S),o.default.createElement(p.InlineActionBar,{menus:x,context:[{thread:d,widget:y,menuId:m.MenuId.CommentsCommentThreadTitle}],separator:"inline",type:"icon"})),o.default.createElement("div",{className:c.default.comment_body},A.length>0?o.default.createElement(a.CommentItem,{widget:y,commentThreadContext:k,thread:d}):o.default.createElement("div",null,o.default.createElement(h.CommentsTextArea,{focusDelay:100,initialHeight:"auto",value:R,onChange:F,placeholder:L,dragFiles:B}),o.default.createElement("div",{className:c.default.comment_bottom_actions},o.default.createElement(p.InlineActionBar,{className:c.default.comment_reply_actions,separator:"inline",type:"button",context:[{text:R,widget:y,thread:d,menuId:m.MenuId.CommentsCommentThreadContext}],menus:k})))))};let f=class extends s.ResizeZoneWidget{_fillContainer(){}constructor(y,b,A){super(y.monacoEditor,b.range,{...A,showInHiddenAreas:!0}),this.thread=b,this._onShow=new v.Emitter,this.onShow=this._onShow.event,this._onHide=new v.Emitter,this.onHide=this._onHide.event,this._editor=y,this._isShow=!b.isCollapsed.get();const S=document.createElement("div");this._container.appendChild(S),this.observeContainer(S);const D=this.commentsFeatureRegistry.getZoneWidgetRender();this.wrapperRoot=l.default.createRoot(S),this.wrapperRoot.render(o.default.createElement(v.ConfigProvider,{value:this.appConfig},D?D(this.thread,this):o.default.createElement(E,{thread:this.thread,widget:this})));const I=y.monacoEditor.onDidChangeModel(()=>{b.hide()});this.addDispose({dispose:()=>{var w;(w=this.wrapperRoot)===null||w===void 0||w.unmount(),this.wrapperRoot=void 0,I.dispose()}})}get coreEditor(){return this._editor}get isShow(){return this._isShow}show(){super.show(),this._isShow=!0,this._onShow.fire()}hide(){super.hide(),this._isShow=!1,this._onHide.fire()}toggle(){this._isShow?this.hide():this.show()}applyClass(){}applyStyle(){}};t.CommentsZoneWidget=f,n.__decorate([(0,_.Autowired)(v.AppConfig),n.__metadata("design:type",Object)],f.prototype,"appConfig",void 0),n.__decorate([(0,_.Autowired)(g.ICommentsFeatureRegistry),n.__metadata("design:type",Object)],f.prototype,"commentsFeatureRegistry",void 0),t.CommentsZoneWidget=f=n.__decorate([(0,_.Injectable)({multiple:!0}),n.__metadata("design:paramtypes",[Object,Object,Object])],f)},62604:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsBrowserContribution=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(93899),_=e(57517),v=e(63067),p=e(69635),m=e(47842);let s=class extends o.Disposable{onStart(){this.registerCommentsFeature(),this.listenToCreateCommentsPanel(),this.commentsService.init()}get panelBadge(){const a=this.commentsService.commentsThreads.length;return a?a+"":""}registerCommands(a){a.registerCommand({id:p.CollapseId,label:"%comments.panel.action.collapse%",iconClass:(0,o.getIcon)("collapse-all")},{execute:()=>{this.commentModelService.collapsedAll()}}),a.registerCommand({id:p.CloseThreadId,label:"%comments.thread.action.close%",iconClass:(0,o.getIcon)("up")},{execute:h=>{const{thread:u,widget:c}=h;u.comments.get().length?c.isShow&&c.toggle():u.dispose()}}),a.registerCommand({id:p.SwitchCommandReaction},{execute:h=>{this.eventBus.fire(new p.CommentReactionClick(h))}})}registerMenus(a){a.registerMenuItem(l.MenuId.CommentsCommentThreadTitle,{command:p.CloseThreadId,group:"inline",order:Number.MAX_SAFE_INTEGER})}registerToolbarItems(a){a.registerItem({id:p.CollapseId,viewId:p.CommentPanelId,command:p.CollapseId,tooltip:(0,o.localize)("comments.panel.action.collapse")})}registerCommentsFeature(){this.contributions.getContributions().forEach((a,h)=>{this.addDispose(this.commentsService.registerCommentRangeProvider(`contribution_${h}`,{getCommentingRanges:u=>a.provideCommentingRanges(u)})),a.registerCommentsFeature&&a.registerCommentsFeature(this.commentsFeatureRegistry)})}listenToCreateCommentsPanel(){this.commentsFeatureRegistry.getCommentsPanelOptions().defaultShow?this.commentsService.registerCommentPanel():o.Event.once(this.commentsService.onThreadsCreated)(()=>{this.commentsService.registerCommentPanel()}),this.addDispose(o.Event.debounce(this.commentsService.onThreadsChanged,()=>{},100)(()=>{const a=this.layoutService.getTabbarHandler(p.CommentPanelId);a?.setBadge(this.panelBadge)},this))}registerEditorFeature(a){a.registerEditorFeatureContribution({contribute:h=>this.commentsService.handleOnCreateEditor(h),provideEditorOptionsForUri:async h=>(await this.commentsService.getContributionRanges(h)).length?{lineDecorationsWidth:25,lineNumbersMinChars:5}:{}})}};t.CommentsBrowserContribution=s,n.__decorate([(0,r.Autowired)(p.ICommentsService),n.__metadata("design:type",Object)],s.prototype,"commentsService",void 0),n.__decorate([(0,r.Autowired)(v.IMainLayoutService),n.__metadata("design:type",Object)],s.prototype,"layoutService",void 0),n.__decorate([(0,r.Autowired)(p.ICommentsFeatureRegistry),n.__metadata("design:type",Object)],s.prototype,"commentsFeatureRegistry",void 0),n.__decorate([(0,r.Autowired)(p.CommentsContribution),n.__metadata("design:type",Object)],s.prototype,"contributions",void 0),n.__decorate([(0,r.Autowired)(o.IEventBus),n.__metadata("design:type",Object)],s.prototype,"eventBus",void 0),n.__decorate([(0,r.Autowired)(m.CommentModelService),n.__metadata("design:type",m.CommentModelService)],s.prototype,"commentModelService",void 0),t.CommentsBrowserContribution=s=n.__decorate([(0,o.Domain)(o.ClientAppContribution,_.BrowserEditorContribution,o.CommandContribution,o.TabBarToolbarContribution,l.MenuContribution)],s)},55011:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsService=void 0;const n=e(85608),r=n.__importDefault(e(53435)),o=n.__importDefault(e(87809)),l=e(76003),_=e(41869),v=e(54414),p=e(57517),m=e(63067),s=e(20868),g=n.__importStar(e(20868)),a=e(62663),h=e(52416),u=n.__importStar(e(24347)),c=e(69635),E=e(53878),f=e(49867),d=e(53711);let y=class extends _.Disposable{constructor(){super(...arguments),this.decorationChangeEmitter=new _.Emitter,this.threads=new Map,this.threadsChangeEmitter=new _.Emitter,this.threadsCommentChangeEmitter=new _.Emitter,this.commentRangeProviderChangeEmitter=new _.Emitter,this.onDidChangeCurrentCommentThreadEmitter=new _.Emitter,this.threadsCreatedEmitter=new _.Emitter,this.rangeProviderMap=new Map,this.rangeOwner=new Map,this.providerDecorationCache=new _.LRUCache(1e4),this.commentRangeDecorationMap=new Map,this.shouldShowCommentsSchemes=new Set(["file","git","diff"]),this.decorationProviderDisposer=_.Disposable.NULL,this.editorRenderAbortControllers=new Map,this.activeThreadDecorationIds=[],this.allEditors=[],this.editorDisposerMap=new Map,this.editorCommentingRangeSpaceReservedMap=new Map,this.editorLineDecorationsWidthMap=new Map}get commentsThreads(){return[...this.threads.values()]}get isMultiCommentsForSingleLine(){var A;return!!(!((A=this.commentsFeatureRegistry.getConfig())===null||A===void 0)&&A.isMultiCommentsForSingleLine)}get currentAuthorAvatar(){var A,S;return(S=(A=this.commentsFeatureRegistry.getConfig())===null||A===void 0?void 0:A.author)===null||S===void 0?void 0:S.avatar}get filterThreadDecoration(){var A;return(A=this.commentsFeatureRegistry.getConfig())===null||A===void 0?void 0:A.filterThreadDecoration}get onThreadsChanged(){return this.threadsChangeEmitter.event}get onThreadsCommentChange(){return this.threadsCommentChangeEmitter.event}get onThreadsCreated(){return this.threadsCreatedEmitter.event}get onCommentRangeProviderChange(){return this.commentRangeProviderChangeEmitter.event}get onDidChangeCurrentCommentThread(){return this.onDidChangeCurrentCommentThreadEmitter.event}setCurrentCommentThread(A){this.onDidChangeCurrentCommentThreadEmitter.fire(A)}createThreadDecoration(A){var S;const D=A.comments.get(),I=D.length===0?this.currentAuthorAvatar:(S=D[0].author.iconPath)===null||S===void 0?void 0:S.toString(),w=I?`${this.iconService.fromIcon("",I,h.IconType.Background)} avatar-icon`:this.iconService.fromString("$(comment)"),T={description:"comments-thread-decoration",glyphMarginClassName:I?["comment-thread",w].join(" "):["comment-range","comment-thread",w].join(" ")};return u.ModelDecorationOptions.createDynamic(T)}updateActiveThreadDecoration(A){var S;const D=this.getCurrentEditor(A?.uri);if(!D)return;(S=this.currentThreadCollapseStateListener)===null||S===void 0||S.dispose();const I=[];if(A){const w=A.range;A.isCollapsed.get()||(this.currentThreadCollapseStateListener=A.onDidChangeCollapsibleState(T=>{T===c.CommentThreadCollapsibleState.Collapsed&&this.updateActiveThreadDecoration(void 0)}),I.push({range:w,options:this.createThreadRangeActiveDecoration()}))}this.activeThreadDecorationIds=D.monacoEditor.deltaDecorations(this.activeThreadDecorationIds,I)}createDottedRangeDecoration(){const A={description:"comments-multiline-hover-decoration",linesDecorationsClassName:["comment-range","multiline-add"].join(" ")};return u.ModelDecorationOptions.createDynamic(A)}createHoverDecoration(){const A={description:"comments-hover-decoration",linesDecorationsClassName:["comment-range","line-hover","comment-add"].join(" ")};return u.ModelDecorationOptions.createDynamic(A)}createThreadRangeActiveDecoration(){const A={description:"comments-thread-range-active-decoration",isWholeLine:!1,zIndex:20,className:"comment-thread-range-current",shouldFillLineOnLineBreak:!0};return u.ModelDecorationOptions.createDynamic(A)}createThreadRangeDecoration(){const A={description:"comments-thread-range-decoration",isWholeLine:!1,zIndex:20,className:"comment-thread-range",shouldFillLineOnLineBreak:!0};return u.ModelDecorationOptions.createDynamic(A)}createCommentRangeDecoration(){const A={description:"comments-range-decoration",linesDecorationsClassName:["comment-range","comment-diff-added"].join(" ")};return u.ModelDecorationOptions.createDynamic(A)}init(){const A=this.resourceService.getSupportedSchemes();for(const S of A)this.shouldShowCommentsSchemes.add(S);this.addDispose(this.resourceService.onRegisterResourceProvider(S=>{S.scheme&&(this.shouldShowCommentsSchemes.add(S.scheme),this.registerDecorationProvider())})),this.addDispose(this.resourceService.onUnregisterResourceProvider(S=>{S.scheme&&(this.shouldShowCommentsSchemes.delete(S.scheme),this.registerDecorationProvider())})),this.registerDecorationProvider()}getCurrentEditor(A){var S;if(A){for(const D of this.allEditors)if(!((S=D.currentUri)===null||S===void 0)&&S.isEqual(A))return this.editor=D,D}return this.editor}handleOnCreateEditor(A){const S=new _.Disposable;if(this.allEditors.some(w=>w.monacoEditor.getId()===A.monacoEditor.getId()))return this.editorDisposerMap.get(A.monacoEditor.getId())||S;this.editorDisposerMap.set(A.monacoEditor.getId(),S),this.allEditors.push(A),S.addDispose(_.Disposable.create(()=>{const w=this.editorRenderAbortControllers.get(A.getId());w&&(w.abort(),this.editorRenderAbortControllers.delete(A.getId()))})),this.editor=A;let D=[],I=!1;return S.addDispose(A.monacoEditor.onMouseDown(w=>{if(w.target.type===a.monacoBrowser.editor.MouseTargetType.GUTTER_LINE_DECORATIONS&&w.target.element&&w.target.element.className.indexOf("comment-add")>-1){const{target:T}=w;if(T&&T.range){const{range:R}=T;this.startCommentRange=R,w.event.stopPropagation()}}else if(w.target.type===a.monacoBrowser.editor.MouseTargetType.GUTTER_GLYPH_MARGIN&&w.target.element&&w.target.element.className.indexOf("comment-thread")>-1){const{target:T}=w;if(T&&T.range){const{range:R}=T,M=this.commentsThreads.filter(O=>A.currentUri&&O.uri.isEqual(A.currentUri)&&O.range.endLineNumber===R.endLineNumber);M.length&&(M.some(x=>x.isShowWidget(A))?M.forEach(x=>x.hide(A)):M.forEach(x=>x.show(A)))}w.event.stopPropagation()}})),S.addDispose(A.monacoEditor.onMouseUp(async w=>{if(this.startCommentRange){if(I){this.renderCommentRange(A),I=!1,this.startCommentRange=null,this.endCommentRange=null;return}let T=this.startCommentRange;this.endCommentRange&&(this.endCommentRange.startLineNumber<this.startCommentRange.startLineNumber?(T.startColumn=this.endCommentRange.startColumn,T.startLineNumber=this.endCommentRange.startLineNumber):(T.endColumn=this.endCommentRange.endColumn,T.endLineNumber=this.endCommentRange.endLineNumber)),A.currentUri&&(T=await this.getValidRange(T,A.currentUri)),T&&(this.commentsThreads.some(R=>R.comments.get().length===0&&A.currentUri&&R.uri.isEqual(A.currentUri)&&R.range.startLineNumber===T.startLineNumber&&R.range.endLineNumber===T.endLineNumber)||this.createThread(A.currentUri,T).show(A),w.event.stopPropagation())}else if(w.target.type===a.monacoBrowser.editor.MouseTargetType.GUTTER_LINE_DECORATIONS&&w.target.element&&w.target.element.className.indexOf("comment-range")>-1&&w.target.element.className.indexOf("comment-thread")<0){const{target:T}=w,R=T.range;R&&(this.commentsThreads.some(M=>M.comments.get().length===0&&A.currentUri&&M.uri.isEqual(A.currentUri)&&M.range.startLineNumber===R.startLineNumber&&M.range.endLineNumber===R.endLineNumber)||this.createThread(A.currentUri,R).show(A),w.event.stopPropagation())}this.startCommentRange=null,this.endCommentRange=null})),S.addDispose(A.monacoEditor.onMouseMove(async w=>{var T,R,M;const O=A.currentUri,x=w.target.range;if(this.startCommentRange){if(!((T=w.target.element)===null||T===void 0)&&T.className||!((M=(R=w.target.element)===null||R===void 0?void 0:R.offsetParent)===null||M===void 0)&&M.className.includes("diff-hidden-lines")&&(I=!0),O&&x){let k={startLineNumber:this.startCommentRange.startLineNumber,endLineNumber:x.endLineNumber,startColumn:this.startCommentRange.startColumn,endColumn:x.endColumn};this.startCommentRange.startLineNumber>x.startLineNumber&&(k={startLineNumber:x.startLineNumber,endLineNumber:this.startCommentRange.endLineNumber,startColumn:x.startColumn,endColumn:this.startCommentRange.endColumn}),this.renderCommentRange(A,k),this.endCommentRange=x}}else if(O&&x&&await this.shouldShowHoverDecoration(O,x)){const k=[{range:(0,s.positionToRange)(x.startLineNumber),options:this.createHoverDecoration()}];D=A.monacoEditor.deltaDecorations(D,k)}})),S.addDispose(A.monacoEditor.onMouseLeave(async w=>{var T;const R=(T=w.target)===null||T===void 0?void 0:T.range,M=[];!this.startCommentRange&&R&&M.push({range:(0,s.positionToRange)(R.startLineNumber),options:this.createCommentRangeDecoration()}),D=A.monacoEditor.deltaDecorations(D,M)})),S.addDispose(this.onCommentRangeProviderChange(()=>{this.renderCommentRange(A)})),S.addDispose(_.Event.any(this.onThreadsChanged,this.onThreadsCommentChange,this.onThreadsCreated)(w=>{const T=this.getCurrentEditor(w.uri);T&&this.renderCommentRange(T),this.updateActiveThreadDecoration(void 0)})),S.addDispose(this.onDidChangeCurrentCommentThread(w=>{this.updateActiveThreadDecoration(w)})),this.tryUpdateReservedSpace(A),S.addDispose(A.monacoEditor.onDidChangeModel(w=>{var T;const{newModelUrl:R}=w;R&&this.editorCollectionService.listMultiDiffEditors()[0]&&((T=A.updateDocumentModel)===null||T===void 0||T.call(A,_.URI.from(R))),this.renderCommentRange(A).then(()=>{this.tryUpdateReservedSpace(A)})})),S}async getValidRange(A,S){if(!S)return A;const D=await this.getContributionRanges(S);if(D.length===0)return A;const I=D.find(w=>{if(A.startLineNumber>=w.startLineNumber&&A.startLineNumber<=w.endLineNumber)return!0});return I&&I.endLineNumber<A.endLineNumber?{startLineNumber:A.startLineNumber,startColumn:A.startColumn,endLineNumber:I.endLineNumber,endColumn:I.endColumn}:A}ensureCommentingRangeReservedAmount(A){const S=this.getExistingCommentEditorOptions(A),D=this.editorLineDecorationsWidthMap.get(A.getId());S.lineDecorationsWidth!==D&&A.updateOptions({lineDecorationsWidth:this.getWithCommentsLineDecorationWidth(A,S.lineDecorationsWidth)})}tryUpdateReservedSpace(A){if(!A)return;let S=this.editorCommentingRangeSpaceReservedMap.get(A.getId())||!1;const D=A.currentUri?this.shouldShowCommentsSchemes.has(A.currentUri.scheme):!1,I=this.commentsThreads.some(T=>A.currentUri&&T.uri.isEqual(A.currentUri)&&T.comments.get().length>0),w=D||I;if(w)if(S)this.ensureCommentingRangeReservedAmount(A);else{S=!0;const{lineDecorationsWidth:T,extraEditorClassName:R}=this.getExistingCommentEditorOptions(A),M=this.getWithCommentsEditorOptions(A,R,T);this.updateEditorLayoutOptions(A,M.extraEditorClassName,M.lineDecorationsWidth)}else if(!w&&S){S=!1;const{lineDecorationsWidth:T,extraEditorClassName:R}=this.getExistingCommentEditorOptions(A),M=this.getWithoutCommentsEditorOptions(A,R,T);this.updateEditorLayoutOptions(A,M.extraEditorClassName,M.lineDecorationsWidth)}this.editorCommentingRangeSpaceReservedMap.set(A.getId(),S)}getExistingCommentEditorOptions(A){const S=A.monacoEditor.getOption(g.EditorOption.lineDecorationsWidth);let D=[];const I=A.monacoEditor.getRawOptions().extraEditorClassName;return I&&(D=I.split(" ")),{lineDecorationsWidth:S,extraEditorClassName:D}}getWithoutCommentsEditorOptions(A,S,D){let I=D;const w=S.findIndex(R=>R==="inline-comment");w>=0&&S.splice(w,1);const T=A.monacoEditor.getOptions();return T.get(g.EditorOption.folding)&&T.get(g.EditorOption.showFoldingControls)!=="never"&&(I+=11),I-=24,{extraEditorClassName:S,lineDecorationsWidth:I}}updateEditorLayoutOptions(A,S,D){A.updateOptions({extraEditorClassName:S.join(" "),lineDecorationsWidth:D})}getWithCommentsEditorOptions(A,S,D){return S.push("inline-comment"),{lineDecorationsWidth:this.getWithCommentsLineDecorationWidth(A,D),extraEditorClassName:S}}getWithCommentsLineDecorationWidth(A,S){let D=S;const I=A.monacoEditor.getOptions();return I.get(g.EditorOption.folding)&&I.get(g.EditorOption.showFoldingControls)!=="never"&&(D-=11),D+=24,this.editorLineDecorationsWidthMap.set(A.getId(),D),D}async renderCommentRange(A,S={startLineNumber:0,endLineNumber:0,startColumn:0,endColumn:0}){if(!A.currentUri)return;const D=this.editorRenderAbortControllers.get(A.getId());D&&D.abort();const I=new AbortController;this.editorRenderAbortControllers.set(A.getId(),I);try{const w=await this.getContributionRanges(A.currentUri);if(I.signal.aborted)return;if(w.length>0){const T=[];if(w.map(M=>{if(!I.signal.aborted){if(S.startLineNumber===0&&S.endLineNumber===0)T.push({range:M,options:this.createCommentRangeDecoration()});else if(S.startLineNumber<=M.startLineNumber&&S.endLineNumber>=M.endLineNumber)T.push({range:M,options:this.createDottedRangeDecoration()},{range:M,options:this.createThreadRangeDecoration()});else if(S.endLineNumber>=M.endLineNumber)if(S.startLineNumber<=M.endLineNumber){const O={startLineNumber:S.startLineNumber,endLineNumber:M.endLineNumber,startColumn:S.startColumn,endColumn:S.endColumn},x={startLineNumber:M.startLineNumber,endLineNumber:O.startLineNumber-1,startColumn:M.startColumn,endColumn:O.endColumn};T.push({range:x,options:this.createCommentRangeDecoration()},{range:O,options:this.createDottedRangeDecoration()},{range:O,options:this.createThreadRangeDecoration()})}else T.push({range:M,options:this.createCommentRangeDecoration()});else if(S.endLineNumber<M.endLineNumber)if(S.endLineNumber>=M.startLineNumber)if(S.startLineNumber>=M.startLineNumber){const O={startLineNumber:M.startLineNumber,startColumn:M.startColumn,endLineNumber:S.startLineNumber-1,endColumn:S.startColumn},x={startLineNumber:S.endLineNumber+1,startColumn:S.endColumn,endLineNumber:M.endLineNumber,endColumn:M.endColumn},k=S.startLineNumber!==M.startLineNumber?[{range:O,options:this.createCommentRangeDecoration()}]:[];k.push({range:S,options:this.createDottedRangeDecoration()}),k.push({range:S,options:this.createThreadRangeDecoration()}),k.push({range:x,options:this.createCommentRangeDecoration()}),T.push(...k)}else{const O={startLineNumber:M.startLineNumber,startColumn:M.startColumn,endLineNumber:S.endLineNumber,endColumn:S.endColumn},x={startLineNumber:O.endLineNumber+1,startColumn:O.endColumn,endLineNumber:M.endLineNumber,endColumn:M.endColumn};T.push({range:O,options:this.createDottedRangeDecoration()},{range:O,options:this.createThreadRangeDecoration()},{range:x,options:this.createCommentRangeDecoration()})}else T.push({range:M,options:this.createCommentRangeDecoration()})}}),I.signal.aborted)return;const R=this.commentRangeDecorationMap.get(A.currentUri.toString())||[];this.commentRangeDecorationMap.set(A.currentUri.toString(),A.monacoEditor.deltaDecorations(R,T))}else this.commentRangeDecorationMap.set(A.currentUri.toString(),[])}finally{this.editorRenderAbortControllers.get(A.getId())===I&&this.editorRenderAbortControllers.delete(A.getId())}}async shouldShowHoverDecoration(A,S){return this.shouldShowCommentsSchemes.has(A.scheme)?(await this.getContributionRanges(A)).some(w=>S.startLineNumber<=w.endLineNumber):!1}createThread(A,S,D={comments:[],readOnly:!1}){const I=this.getProviderIdsByLine(S.endLineNumber)[0],w=this.injector.get(f.CommentsThread,[A,S,I,D]);return w.onDispose(()=>{this.threads.delete(w.id),this.threadsChangeEmitter.fire(w),this.decorationChangeEmitter.fire(A)}),w.onDidChange(()=>{this.threadsChangeEmitter.fire(w)}),this.threads.set(w.id,w),this.addDispose(w),this.threadsChangeEmitter.fire(w),this.threadsCreatedEmitter.fire(w),this.decorationChangeEmitter.fire(A),w}getThreadsByUri(A){return this.commentsThreads.filter(S=>S.uri.isEqual(A)).sort((S,D)=>S.range.startLineNumber-D.range.startLineNumber)}handleCommentFileNode(A){const S=[],D=[...this.threads.values()].filter(w=>w.comments.get().length),I=(0,o.default)(D,w=>w.uri);return Object.keys(I).map(w=>{var T;const R=I[w];if(R.length===0)return;const M=new _.URI(this.appConfig.workspaceDir),O=new _.URI(w),x=(T=M.relative(O))===null||T===void 0?void 0:T.toString();S.push(new d.CommentFileNode(this,R,x,O.codeUri.fsPath,this.labelService.getIcon(O),O,A))}),S}handleCommentContentNode(A){var S;const D=[];for(const I of A.threads){const w=I.comments.get(),[T]=w,R=typeof T.body=="string"?T.body:T.body.value;let M=`[Ln ${I.range.startLineNumber}]`;I.range.startLineNumber!==I.range.endLineNumber&&(M=`[Ln ${I.range.startLineNumber}-${I.range.endLineNumber}]`),D.push(new d.CommentContentNode(this,I,R,M,T.author.iconPath&&(!((S=T.author.iconPath)===null||S===void 0)&&S.authority)?this.iconService.fromIcon("",T.author.iconPath.toString(),h.IconType.Background):(0,_.getIcon)("message"),T.author,A.resource,A))}return D}handleCommentReplyNode(A){const S=[],D=A.thread,I=D.comments.get(),[w,...T]=I,R=T[T.length-1].author.name;return S.push(new d.CommentReplyNode(this,D,(0,_.formatLocalize)("comment.reply.count",T?.length||0),(0,_.formatLocalize)("comment.reply.lastReply",R),"",A.resource,A)),S}async resolveChildren(A){let S=[];if(A?d.CommentRoot.isRoot(A)?S=this.handleCommentFileNode(A):d.CommentFileNode.is(A)?S=this.handleCommentContentNode(A):d.CommentContentNode.is(A)&&(S=this.handleCommentReplyNode(A)):S.push(new d.CommentRoot(this)),S.length===1&&d.CommentRoot.isRoot(S[0]))return S;const D=this.commentsFeatureRegistry.getCommentsPanelTreeNodeHandlers();if(D.length>0)for(const I of D)S=I(S);return S}async getContributionRanges(A){const S=this.providerDecorationCache.get(A.toString());if(S)return await S.promise;const D=this.documentService.getModelReference(A,"Get Comment Range"),I=[];for(const M of this.rangeProviderMap){const[O,x]=M;I.push((async()=>{if(!D?.instance)return;const k=await x.getCommentingRanges(D.instance);return k&&k.length&&this.rangeOwner.set(O,k),k})())}const w=new _.Deferred;this.providerDecorationCache.set(A.toString(),w);const T=(await Promise.all(I)).filter(Boolean);D?.dispose();const R=(0,r.default)(T).filter(Boolean);return w.resolve(R),R}fireThreadCommentChange(A){this.threadsCommentChangeEmitter.fire(A)}registerDecorationProvider(){this.decorationProviderDisposer.dispose(),this.decorationProviderDisposer=this.editorDecorationCollectionService.registerDecorationProvider({schemes:[...this.shouldShowCommentsSchemes.values()],key:"comments",onDidDecorationChange:this.decorationChangeEmitter.event,provideEditorDecoration:A=>this.commentsThreads.map(S=>{if(S.uri.isEqual(A)){const D=this.editorCollectionService.getEditorByUri(S.uri);D?setTimeout(()=>{S.show(D)},_.FRAME_THREE):S.hide()}else S.hide();return S}).filter(S=>{const D=S.uri.isEqual(A);return this.filterThreadDecoration?D&&this.filterThreadDecoration(S):D}).map(S=>({range:{startLineNumber:S.range.endLineNumber,endLineNumber:S.range.endLineNumber,startColumn:S.range.endColumn,endColumn:S.range.endColumn},options:this.createThreadDecoration(S)}))}),this.addDispose(this.decorationProviderDisposer)}registerCommentPanel(){this.layoutService.getTabbarHandler(c.CommentPanelId)||this.layoutService.collectTabbarComponent([{id:c.CommentPanelId,component:E.CommentsPanel}],{badge:this.panelBadge,containerId:c.CommentPanelId,title:(0,_.localize)("comments").toUpperCase(),hidden:!1,activateKeyBinding:"ctrlcmd+shift+c",...this.commentsFeatureRegistry.getCommentsPanelOptions()},"bottom")}get panelBadge(){const A=this.commentsThreads.length;return A?A+"":""}registerCommentRangeProvider(A,S){return this.rangeProviderMap.set(A,S),this.providerDecorationCache.clear(),this.commentRangeProviderChangeEmitter.fire(),_.Disposable.create(()=>{this.rangeProviderMap.delete(A),this.rangeOwner.delete(A),this.providerDecorationCache.clear()})}forceUpdateDecoration(){var A,S,D;const I=(A=this.workbenchEditorService.currentEditor)===null||A===void 0?void 0:A.currentUri;I&&this.decorationChangeEmitter.fire(I);const w=(D=(S=this.workbenchEditorService.currentEditorGroup)===null||S===void 0?void 0:S.diffEditor)===null||D===void 0?void 0:D.originalEditor.currentUri;w&&this.decorationChangeEmitter.fire(w)}getProviderIdsByLine(A){const S=[];if(this.rangeOwner.size===1)return[this.rangeOwner.keys().next().value];for(const D of this.rangeOwner){const[I,w]=D;w&&w.some(T=>T.startLineNumber<=A&&A<=T.endLineNumber)&&S.push(I)}return S}};t.CommentsService=y,n.__decorate([(0,l.Autowired)(l.INJECTOR_TOKEN),n.__metadata("design:type",l.Injector)],y.prototype,"injector",void 0),n.__decorate([(0,l.Autowired)(_.AppConfig),n.__metadata("design:type",Object)],y.prototype,"appConfig",void 0),n.__decorate([(0,l.Autowired)(p.IEditorDecorationCollectionService),n.__metadata("design:type",Object)],y.prototype,"editorDecorationCollectionService",void 0),n.__decorate([(0,l.Autowired)(h.IIconService),n.__metadata("design:type",Object)],y.prototype,"iconService",void 0),n.__decorate([(0,l.Autowired)(_.LabelService),n.__metadata("design:type",_.LabelService)],y.prototype,"labelService",void 0),n.__decorate([(0,l.Autowired)(c.ICommentsFeatureRegistry),n.__metadata("design:type",Object)],y.prototype,"commentsFeatureRegistry",void 0),n.__decorate([(0,l.Autowired)(p.IEditorDocumentModelService),n.__metadata("design:type",Object)],y.prototype,"documentService",void 0),n.__decorate([(0,l.Autowired)(m.IMainLayoutService),n.__metadata("design:type",Object)],y.prototype,"layoutService",void 0),n.__decorate([(0,l.Autowired)(p.WorkbenchEditorService),n.__metadata("design:type",p.WorkbenchEditorService)],y.prototype,"workbenchEditorService",void 0),n.__decorate([(0,l.Autowired)(v.EditorCollectionService),n.__metadata("design:type",v.EditorCollectionService)],y.prototype,"editorCollectionService",void 0),n.__decorate([(0,l.Autowired)(p.ResourceService),n.__metadata("design:type",p.ResourceService)],y.prototype,"resourceService",void 0),n.__decorate([_.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],y.prototype,"isMultiCommentsForSingleLine",null),n.__decorate([_.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],y.prototype,"currentAuthorAvatar",null),n.__decorate([_.memoize,n.__metadata("design:type",Object),n.__metadata("design:paramtypes",[])],y.prototype,"filterThreadDecoration",null),t.CommentsService=y=n.__decorate([(0,l.Injectable)()],y)},54230:(P,t,e)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CommentsModule=void 0;const n=e(85608),r=e(76003),o=e(41869),l=e(69635),_=e(66480),v=e(62604),p=e(55011),m=e(47842);let s=class extends o.BrowserModule{constructor(){super(...arguments),this.contributionProvider=l.CommentsContribution,this.providers=[{token:l.ICommentsService,useClass:p.CommentsService},{token:m.CommentModelService,useClass:m.CommentModelService},{token:l.ICommentsFeatureRegistry,useClass:_.CommentsFeatureRegistry},v.CommentsBrowserContribution]}};t.CommentsModule=s,t.CommentsModule=s=n.__decorate([(0,r.Injectable)()],s)},70154:(P,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.markdownCss=void 0,t.markdownCss=`
|
|
33227
33227
|
h1, h2, h3, h4, h5, h6, p {
|
|
33228
33228
|
color: var(--foreground);
|
|
33229
33229
|
word-break: break-all;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opensumi/cli-engine",
|
|
3
|
-
"version": "3.9.1-next-
|
|
3
|
+
"version": "3.9.1-next-1749610621.0",
|
|
4
4
|
"description": "Integration engine runtime for opensumi-cli and opensumi extension",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@koa/cors": "^5.0.0",
|
|
28
28
|
"@opensumi/di": "^1.8.0",
|
|
29
|
-
"@opensumi/ide-core-browser": "3.9.1-next-
|
|
30
|
-
"@opensumi/ide-core-common": "3.9.1-next-
|
|
31
|
-
"@opensumi/ide-core-node": "3.9.1-next-
|
|
32
|
-
"@opensumi/ide-express-file-server": "3.9.1-next-
|
|
33
|
-
"@opensumi/ide-extension": "3.9.1-next-
|
|
34
|
-
"@opensumi/ide-i18n": "3.9.1-next-
|
|
35
|
-
"@opensumi/ide-main-layout": "3.9.1-next-
|
|
36
|
-
"@opensumi/ide-startup": "3.9.1-next-
|
|
29
|
+
"@opensumi/ide-core-browser": "3.9.1-next-1749610621.0",
|
|
30
|
+
"@opensumi/ide-core-common": "3.9.1-next-1749610621.0",
|
|
31
|
+
"@opensumi/ide-core-node": "3.9.1-next-1749610621.0",
|
|
32
|
+
"@opensumi/ide-express-file-server": "3.9.1-next-1749610621.0",
|
|
33
|
+
"@opensumi/ide-extension": "3.9.1-next-1749610621.0",
|
|
34
|
+
"@opensumi/ide-i18n": "3.9.1-next-1749610621.0",
|
|
35
|
+
"@opensumi/ide-main-layout": "3.9.1-next-1749610621.0",
|
|
36
|
+
"@opensumi/ide-startup": "3.9.1-next-1749610621.0",
|
|
37
37
|
"chalk": "^4.1.2",
|
|
38
38
|
"ejs": "^3.1.7",
|
|
39
39
|
"ip": "^1.1.8",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"webpack": "^5.90.0",
|
|
73
73
|
"webpack-cli": "^5.1.4"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "93aaad1c072967fa868873817bdde5327c824717"
|
|
76
76
|
}
|