@univerjs/sheets-thread-comment 0.1.12 → 0.1.13-nightly.202406041140

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/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var re=Object.defineProperty;var oe=(i,r,e)=>r in i?re(i,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[r]=e;var S=(i,r,e)=>(oe(i,typeof r!="symbol"?r+"":r,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@wendellhu/redi"),c=require("@univerjs/core"),P=require("@univerjs/thread-comment-ui"),_=require("@univerjs/ui"),U=require("@univerjs/sheets"),M=require("@univerjs/engine-formula"),D=require("@univerjs/sheets-ui"),v=require("@univerjs/thread-comment"),y=require("@wendellhu/redi/react-bindings"),g=require("react"),q=require("rxjs"),ie=require("@univerjs/engine-render");var T=function(){return T=Object.assign||function(i){for(var r,e=1,t=arguments.length;e<t;e++){r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(i[n]=r[n])}return i},T.apply(this,arguments)},se=function(i,r){var e={};for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&r.indexOf(t)<0&&(e[t]=i[t]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,t=Object.getOwnPropertySymbols(i);n<t.length;n++)r.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(i,t[n])&&(e[t[n]]=i[t[n]]);return e},J=g.forwardRef(function(i,r){var e=i.icon,t=i.id,n=i.className,o=i.extend,s=se(i,["icon","id","className","extend"]),a="univerjs-icon univerjs-icon-".concat(t," ").concat(n||"").trim(),m=g.useRef("_".concat(me()));return Q(e,"".concat(t),{defIds:e.defIds,idSuffix:m.current},T({ref:r,className:a},s),o)});function Q(i,r,e,t,n){return g.createElement(i.tag,T(T({key:r},ae(i,e,n)),t),(ce(i,e).children||[]).map(function(o,s){return Q(o,"".concat(r,"-").concat(i.tag,"-").concat(s),e,void 0,n)}))}function ae(i,r,e){var t=T({},i.attrs);e!=null&&e.colorChannel1&&t.fill==="colorChannel1"&&(t.fill=e.colorChannel1);var n=r.defIds;return!n||n.length===0||(i.tag==="use"&&t["xlink:href"]&&(t["xlink:href"]=t["xlink:href"]+r.idSuffix),Object.entries(t).forEach(function(o){var s=o[0],a=o[1];typeof a=="string"&&(t[s]=a.replace(/url\(#(.*)\)/,"url(#$1".concat(r.idSuffix,")")))})),t}function ce(i,r){var e,t=r.defIds;return!t||t.length===0?i:i.tag==="defs"&&(!((e=i.children)===null||e===void 0)&&e.length)?T(T({},i),{children:i.children.map(function(n){return typeof n.attrs.id=="string"&&t&&t.indexOf(n.attrs.id)>-1?T(T({},n),{attrs:T(T({},n.attrs),{id:n.attrs.id+r.idSuffix})}):n})}):i}function me(){return Math.random().toString(36).substring(2,8)}J.displayName="UniverIcon";var de={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521C5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345ZM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521C8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345ZM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521C11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521 5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345zM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521 8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345zM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521 11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.84351 3.41861C1.84351 3.01861 2.15531 2.69434 2.53993 2.69434H14.9381C15.3228 2.69434 15.6346 3.01861 15.6346 3.41861V12.4611C15.6346 12.8612 15.3228 13.1854 14.9381 13.1854H8.82117L6.06643 14.6179C5.85054 14.7301 5.59416 14.7181 5.38884 14.5862C5.18352 14.4542 5.05855 14.2211 5.05855 13.9701V13.1854H2.53993C2.15531 13.1854 1.84351 12.8612 1.84351 12.4611L1.84351 3.41861ZM6.45141 12.7982L8.34531 12.0135C8.44201 11.9632 8.54864 11.9371 8.65676 11.9371H14.2417C14.3522 11.9371 14.4417 11.8475 14.4417 11.7371V4.14271C14.4417 4.03225 14.3522 3.94271 14.2417 3.94271H3.23636C3.12591 3.94271 3.03636 4.03225 3.03636 4.14271L3.03636 11.7371C3.03636 11.8475 3.12591 11.9371 3.23636 11.9371L5.75498 11.9371C6.1396 11.9371 6.45141 12.0611 6.45141 12.4611V12.7982Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ee=g.forwardRef(function(i,r){return g.createElement(J,Object.assign({},i,{id:"comment-single",ref:r,icon:de}))});ee.displayName="CommentSingle";var he=Object.defineProperty,ue=Object.getOwnPropertyDescriptor,le=(i,r,e,t)=>{for(var n=t>1?void 0:t?ue(r,e):r,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(t?s(r,e,n):s(n))||n);return t&&n&&he(r,e,n),n},K=(i,r)=>(e,t)=>r(e,t,i);exports.SheetsThreadCommentModel=class extends c.Disposable{constructor(e,t){super();S(this,"_matrixMap",new Map);S(this,"_locationMap",new Map);S(this,"_commentUpdate$",new q.Subject);S(this,"commentUpdate$",this._commentUpdate$.asObservable());this._threadCommentModel=e,this._univerInstanceService=t,this._init()}_init(){this._initData(),this._initUpdateTransform()}_ensureCommentMatrix(e,t){let n=this._matrixMap.get(e);n||(n=new Map,this._matrixMap.set(e,n));let o=n.get(t);return o||(o=new c.ObjectMatrix,n.set(t,o)),o}_ensureCommentLocationMap(e,t){let n=this._locationMap.get(e);n||(n=new Map,this._locationMap.set(e,n));let o=n.get(t);return o||(o=new Map,n.set(t,o)),o}_ensure(e,t){const n=this._ensureCommentMatrix(e,t),o=this._ensureCommentLocationMap(e,t);return{matrix:n,locationMap:o}}_initData(){const e=this._threadCommentModel.getAll();for(const t in e){const n=e[t];for(const o in n){const s=n[o];for(const a in s){const m=s[a];this._addComment(t,o,m)}}}}_addComment(e,t,n){const o=M.singleReferenceToGrid(n.ref),s=n.parentId,{row:a,column:m}=o,d=n.id,{matrix:h,locationMap:u}=this._ensure(e,t);!s&&a>=0&&m>=0&&(h.setValue(a,m,d),u.set(d,{row:a,column:m})),this._commentUpdate$.next({unitId:e,subUnitId:t,payload:n,type:"add",...o})}_initUpdateTransform(){this.disposeWithMe(this._threadCommentModel.commentUpdate$.subscribe(e=>{const{unitId:t,subUnitId:n}=e;try{if(this._univerInstanceService.getUnitType(t)!==c.UniverInstanceType.UNIVER_SHEET)return}catch{}const{matrix:o,locationMap:s}=this._ensure(t,n);switch(e.type){case"add":{this._addComment(e.unitId,e.subUnitId,e.payload);break}case"delete":{const{isRoot:a,comment:m}=e.payload,d=M.singleReferenceToGrid(m.ref);if(a){const{row:h,column:u}=d;h>=0&&u>=0&&o.realDeleteValue(h,u)}this._commentUpdate$.next({...e,...d});break}case"update":{const{commentId:a}=e.payload,m=this._threadCommentModel.getComment(t,n,a);if(!m)return;const d=M.singleReferenceToGrid(m.ref);this._commentUpdate$.next({...e,...d});break}case"updateRef":{const a=M.singleReferenceToGrid(e.payload.ref),{commentId:m}=e.payload,d=s.get(m);if(!d)return;const{row:h,column:u}=d;o.getValue(h,u)===m&&(o.realDeleteValue(h,u),s.delete(m)),a.row>=0&&a.column>=0&&(o.setValue(a.row,a.column,m),s.set(m,{row:a.row,column:a.column})),this._commentUpdate$.next({...e,...a});break}}}))}getByLocation(e,t,n,o){return this._ensureCommentMatrix(e,t).getValue(n,o)}getComment(e,t,n){return this._threadCommentModel.getComment(e,t,n)}getCommentWithChildren(e,t,n,o){const a=this._ensureCommentMatrix(e,t).getValue(n,o);if(a)return this._threadCommentModel.getCommentWithChildren(e,t,a)}showCommentMarker(e,t,n,o){const s=this.getByLocation(e,t,n,o);if(!s)return!1;const a=this.getComment(e,t,s);return!!(a&&!a.resolved)}};exports.SheetsThreadCommentModel=le([K(0,l.Inject(v.ThreadCommentModel)),K(1,c.IUniverInstanceService)],exports.SheetsThreadCommentModel);const te="univer.sheet.thread-comment-modal",z="comment-single",Z="univer.sheet.thread-comment";var pe=Object.defineProperty,Ce=Object.getOwnPropertyDescriptor,ve=(i,r,e,t)=>{for(var n=t>1?void 0:t?Ce(r,e):r,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(t?s(r,e,n):s(n))||n);return t&&n&&pe(r,e,n),n},k=(i,r)=>(e,t)=>r(e,t,i);exports.SheetsThreadCommentPopupService=class extends c.Disposable{constructor(e,t){super();S(this,"_lastPopup",null);S(this,"_activePopup");S(this,"_activePopup$",new q.BehaviorSubject(null));S(this,"activePopup$",this._activePopup$.asObservable());this._canvasPopupManagerService=e,this._zenZoneService=t,this._initZenVisible()}get activePopup(){return this._activePopup}_initZenVisible(){this.disposeWithMe(this._zenZoneService.visible$.subscribe(e=>{e&&this.hidePopup()}))}showPopup(e,t){var h;const{row:n,col:o,unitId:s,subUnitId:a}=e;if(this._activePopup&&n===this._activePopup.row&&o===this._activePopup.col&&s===this._activePopup.unitId&&a===((h=this.activePopup)==null?void 0:h.subUnitId)){this._activePopup=e,this._activePopup$.next(e);return}if(this._lastPopup&&this._lastPopup.dispose(),this._zenZoneService.visible)return;this._activePopup=e,this._activePopup$.next(e);const m=this._canvasPopupManagerService.attachPopupToCell(n,o,{componentKey:te,onClickOutside:()=>{this.hidePopup()},direction:"horizontal",excludeOutside:[...Array.from(document.querySelectorAll(".univer-thread-comment")),document.getElementById("thread-comment-add")].filter(Boolean)});if(!m)throw new Error("[SheetsThreadCommentPopupService]: cannot show popup!");const d=new c.DisposableCollection;d.add(m),d.add({dispose:()=>{t==null||t()}}),this._lastPopup=d}hidePopup(){this._activePopup&&(this._lastPopup&&this._lastPopup.dispose(),this._lastPopup=null,this._activePopup=null,this._activePopup$.next(null))}persistPopup(){!this._activePopup||!this._activePopup.temp||(this._activePopup={...this._activePopup,temp:!1},this._activePopup$.next(this._activePopup))}};exports.SheetsThreadCommentPopupService=ve([k(0,l.Inject(D.SheetCanvasPopManagerService)),k(1,_.IZenZoneService)],exports.SheetsThreadCommentPopupService);const _e=()=>{const i=y.useDependency(c.IUniverInstanceService),r=y.useDependency(exports.SheetsThreadCommentPopupService),e=_.useObservable(r.activePopup$),t=y.useDependency(exports.SheetsThreadCommentModel);if(_.useObservable(t.commentUpdate$),!e)return null;const{row:n,col:o,unitId:s,subUnitId:a,trigger:m}=e,d=t.getByLocation(s,a,n,o),h=`${c.Tools.chatAtABC(o)}${n+1}`,u=()=>{r.hidePopup()},b=j=>{var R,w,$;return($=(w=(R=i.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET))==null?void 0:R.getSheetBySheetId(j))==null?void 0:w.getName())!=null?$:""};return g.createElement(P.ThreadCommentTree,{onClick:()=>{r.persistPopup()},prefix:"cell",id:d,unitId:s,subUnitId:a,type:c.UniverInstanceType.UNIVER_SHEET,refStr:h,onClose:u,getSubUnitName:b,autoFocus:m==="context-menu"})},H={type:c.CommandType.OPERATION,id:"sheets.operation.show-comment-modal",handler(i){var w;const r=i.get(U.SelectionManagerService),e=i.get(c.IUniverInstanceService),t=i.get(exports.SheetsThreadCommentPopupService),n=i.get(P.ThreadCommentPanelService),o=(w=r.getFirst())==null?void 0:w.primary,s=r.getCurrent(),a=i.get(exports.SheetsThreadCommentModel);if(!s||!o)return!1;const{unitId:m,sheetId:d}=s,h=U.getSheetCommandTarget(e,{unitId:m,subUnitId:d});if(!h)return!1;const{workbook:u,worksheet:b}=h,j={workbook:u,worksheet:b,unitId:m,subUnitId:d,row:o.actualRow,col:o.startColumn};t.showPopup(j);const R=a.getByLocation(m,d,o.actualRow,o.startColumn);return R&&n.setActiveComment({unitId:m,subUnitId:d,commentId:R,trigger:"context-menu"}),!0}},fe=()=>{const i=y.useDependency(D.IMarkSelectionService),r=y.useDependency(c.IUniverInstanceService),e=y.useDependency(v.ThreadCommentModel),t=y.useDependency(exports.SheetsThreadCommentPopupService),n=r.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET);if(!n)return null;const o=n.getUnitId(),s=y.useDependency(c.ICommandService),a=g.useMemo(()=>n.activeSheet$.pipe(q.map(p=>p==null?void 0:p.getSheetId())),[n.activeSheet$]),m=y.useObservable(a,n.getActiveSheet().getSheetId()),d=g.useRef(),h=y.useDependency(P.ThreadCommentPanelService),u=y.useObservable(h.activeCommentId$),b=g.useCallback(p=>{const C=n.getSheets(),I={};return C.forEach((f,O)=>{I[f.getSheetId()]=O}),p.map(f=>{var G;const O=M.singleReferenceToGrid(f.ref),ne=[(G=I[f.subUnitId])!=null?G:0,O.row,O.column];return{...f,p:ne}}).sort((f,O)=>f.p[0]===O.p[0]?f.p[1]===O.p[1]?f.p[2]-O.p[2]:f.p[1]-O.p[1]:f.p[0]-O.p[0])},[n]),j=g.useCallback(p=>{if(p.unitId===o&&p.subUnitId===m&&!p.resolved){const{row:C,column:I}=M.singleReferenceToGrid(p.ref);if(!Number.isNaN(C)&&!Number.isNaN(I))return i.addShape({range:{startColumn:I,endColumn:I,startRow:C,endRow:C},style:{hasAutoFill:!1,fill:"rgb(255, 189, 55, 0.35)",strokeWidth:1,stroke:"#FFBD37",widgets:{}},primary:null})}},[i,m,o]),R=p=>{var C,I;return(I=(C=n.getSheetBySheetId(p))==null?void 0:C.getName())!=null?I:""},w=()=>{s.executeCommand(H.id)},$=()=>{t.hidePopup()},N=p=>{u&&u.unitId===p.unitId&&u.subUnitId===p.subUnitId&&u.commentId===p.id||(d.current&&(i.removeShape(d.current),d.current=null),d.current=j(p))},L=()=>{d.current&&(i.removeShape(d.current),d.current=null)};return g.useEffect(()=>{if(!u)return;const p=e.getComment(u.unitId,u.subUnitId,u.commentId);if(!p)return;const C=j(p);return()=>{C&&i.removeShape(C)}},[j,u,e,i]),g.createElement(P.ThreadCommentPanel,{unitId:o,subUnitId$:a,type:c.UniverInstanceType.UNIVER_SHEET,onAdd:w,getSubUnitName:R,onResolve:$,sortComments:b,onItemEnter:N,onItemLeave:L})},Se={sheetThreadComment:{menu:{addComment:"添加评论",commentManagement:"评论管理"}}},Ie=i=>({id:H.id,type:_.MenuItemType.BUTTON,positions:[_.MenuPosition.CONTEXT_MENU],icon:z,title:"sheetThreadComment.menu.addComment",hidden$:_.getMenuHiddenObservable(i,c.UniverInstanceType.UNIVER_SHEET)}),ge=i=>({id:P.ToggleSheetCommentPanelOperation.id,type:_.MenuItemType.BUTTON,icon:z,tooltip:"sheetThreadComment.menu.commentManagement",positions:_.MenuPosition.TOOLBAR_START,hidden$:_.getMenuHiddenObservable(i,c.UniverInstanceType.UNIVER_SHEET)}),Te={id:H.id,binding:_.KeyCode.M|_.MetaKeys.CTRL_COMMAND|_.MetaKeys.ALT,preconditions:D.whenSheetEditorFocused};var Me=Object.defineProperty,Pe=Object.getOwnPropertyDescriptor,be=(i,r,e,t)=>{for(var n=t>1?void 0:t?Pe(r,e):r,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(t?s(r,e,n):s(n))||n);return t&&n&&Me(r,e,n),n},E=(i,r)=>(e,t)=>r(e,t,i);const ye={};exports.SheetsThreadCommentController=class extends c.Disposable{constructor(r,e,t,n,o,s,a,m,d,h,u){super(),this._config=r,this._menuService=e,this._injector=t,this._componentManager=n,this._localeService=o,this._commandService=s,this._sheetsThreadCommentPopupService=a,this._sheetsThreadCommentModel=m,this._threadCommentPanelService=d,this._shortcutService=h,this._univerInstanceService=u,this._initMenu(),this._initShortcut(),this._initComponent(),this._initLocale(),this._initCommandListener(),this._initPanelListener()}_initShortcut(){this._shortcutService.registerShortcut(Te)}_initCommandListener(){this._commandService.onCommandExecuted(r=>{if(r.id===U.SetSelectionsOperation.id){const e=r.params,{unitId:t,subUnitId:n,selections:o,type:s}=e;if((s===U.SelectionMoveType.MOVE_END||s===void 0)&&o[0].primary){const a=o[0].primary.actualRow,m=o[0].primary.actualColumn;if(!this._sheetsThreadCommentModel.showCommentMarker(t,n,a,m)){this._threadCommentPanelService.activeCommentId&&this._commandService.executeCommand(P.SetActiveCommentOperation.id);return}const d=this._sheetsThreadCommentModel.getByLocation(t,n,a,m);d&&this._commandService.executeCommand(P.SetActiveCommentOperation.id,{unitId:t,subUnitId:n,commentId:d})}}if(r.id===v.DeleteCommentMutation.id){const e=r.params,t=this._sheetsThreadCommentPopupService.activePopup;if(!t)return;const{unitId:n,subUnitId:o,commentId:s}=t;e.unitId===n&&e.subUnitId===o&&e.commentId===s&&this._sheetsThreadCommentPopupService.hidePopup()}})}_initMenu(){const{menu:r={}}=this._config;[Ie,ge].forEach(e=>{this._menuService.addMenuItem(e(this._injector),r)})}_initComponent(){[[te,_e],[P.THREAD_COMMENT_PANEL,fe],[z,ee]].forEach(([r,e])=>{this._componentManager.register(r,e)})}_initLocale(){this._localeService.load({zhCN:Se})}_initPanelListener(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(async r=>{if(r){const{unitId:e,subUnitId:t,commentId:n,trigger:o}=r,s=this._sheetsThreadCommentModel.getComment(e,t,n);if(!s||s.resolved)return;const a=this._univerInstanceService.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET);if(!a||a.getUnitId()!==e)return;a.getActiveSheet().getSheetId()!==t&&await this._commandService.executeCommand(U.SetWorksheetActiveOperation.id,{unitId:e,subUnitId:t});const h=M.singleReferenceToGrid(s.ref);await this._commandService.executeCommand(D.ScrollToCellCommand.id,{range:{startColumn:h.column,endColumn:h.column,startRow:h.row,endRow:h.row}}),this._sheetsThreadCommentPopupService.showPopup({unitId:e,subUnitId:t,row:h.row,col:h.column,commentId:s.id,trigger:o})}else this._sheetsThreadCommentPopupService.hidePopup()}))}};exports.SheetsThreadCommentController=be([c.OnLifecycle(c.LifecycleStages.Starting,exports.SheetsThreadCommentController),E(1,_.IMenuService),E(2,l.Inject(l.Injector)),E(3,l.Inject(_.ComponentManager)),E(4,l.Inject(c.LocaleService)),E(5,c.ICommandService),E(6,l.Inject(exports.SheetsThreadCommentPopupService)),E(7,l.Inject(exports.SheetsThreadCommentModel)),E(8,l.Inject(P.ThreadCommentPanelService)),E(9,_.IShortcutService),E(10,c.IUniverInstanceService)],exports.SheetsThreadCommentController);var Ue=Object.defineProperty,Re=Object.getOwnPropertyDescriptor,we=(i,r,e,t)=>{for(var n=t>1?void 0:t?Re(r,e):r,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(t?s(r,e,n):s(n))||n);return t&&n&&Ue(r,e,n),n},B=(i,r)=>(e,t)=>r(e,t,i);exports.SheetsThreadCommentRefRangeController=class extends c.Disposable{constructor(e,t,n){super();S(this,"_disposableMap",new Map);this._refRangeService=e,this._sheetsThreadCommentModel=t,this._threadCommentModel=n,this._initData(),this._initRefRange()}_getIdWithUnitId(e,t,n){return`${e}-${t}-${n}`}_register(e,t,n){const o=n.id,s={startColumn:n.column,endColumn:n.column,startRow:n.row,endRow:n.row},a=m=>{const d=U.handleDefaultRangeChangeWithEffectRefCommands(s,m);return d&&d.startColumn===s.startColumn&&d.startRow===s.startRow?{undos:[],redos:[]}:d?{redos:[{id:v.UpdateCommentRefMutation.id,params:{unitId:e,subUnitId:t,payload:{ref:M.serializeRange(d),commentId:o}}}],undos:[{id:v.UpdateCommentRefMutation.id,params:{unitId:e,subUnitId:t,payload:{ref:M.serializeRange(s),commentId:o}}}]}:{redos:[{id:v.DeleteCommentMutation.id,params:{unitId:e,subUnitId:t,commentId:o}}],undos:[{id:v.AddCommentMutation.id,params:{unitId:e,subUnitId:t,comment:n}}]}};this._disposableMap.set(this._getIdWithUnitId(e,t,o),this._refRangeService.registerRefRange(s,a,e,t))}_initData(){const e=this._threadCommentModel.getAll();for(const t in e){const n=e[t];for(const o in n){const s=n[o];for(const a in s){const m=s[a],d=m.ref,h=M.singleReferenceToGrid(d);this._register(t,o,{...m,...h})}}}}_initRefRange(){this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.subscribe(e=>{const{unitId:t,subUnitId:n}=e;switch(e.type){case"add":{const o=e.payload;this._register(e.unitId,e.subUnitId,{...o,row:e.row,column:e.column});break}case"delete":{const o=this._disposableMap.get(this._getIdWithUnitId(t,n,e.payload.commentId));o==null||o.dispose();break}case"updateRef":{const o=this._sheetsThreadCommentModel.getComment(t,n,e.payload.commentId);if(!o)return;const s=this._disposableMap.get(this._getIdWithUnitId(t,n,o.id));s==null||s.dispose(),this._register(e.unitId,e.subUnitId,{...o,row:e.row,column:e.column});break}}})),this.disposeWithMe(c.toDisposable(()=>{this._disposableMap.forEach(e=>{e.dispose()}),this._disposableMap.clear()}))}};exports.SheetsThreadCommentRefRangeController=we([c.OnLifecycle(c.LifecycleStages.Starting,exports.SheetsThreadCommentRefRangeController),B(0,l.Inject(U.RefRangeService)),B(1,l.Inject(exports.SheetsThreadCommentModel)),B(2,l.Inject(v.ThreadCommentModel))],exports.SheetsThreadCommentRefRangeController);var Oe=Object.defineProperty,Ee=Object.getOwnPropertyDescriptor,je=(i,r,e,t)=>{for(var n=t>1?void 0:t?Ee(r,e):r,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(t?s(r,e,n):s(n))||n);return t&&n&&Oe(r,e,n),n},x=(i,r)=>(e,t)=>r(e,t,i);let A=class extends c.Disposable{constructor(i,r,e,t,n){super(),this._sheetInterceptorService=i,this._sheetsThreadCommentModel=r,this._univerInstanceService=e,this._sheetSkeletonManagerService=t,this._renderManagerService=n,this._initViewModelIntercept(),this._initSkeletonChange()}_initViewModelIntercept(){this.disposeWithMe(this._sheetInterceptorService.intercept(U.INTERCEPTOR_POINT.CELL_CONTENT,{handler:(i,r,e)=>{const{row:t,col:n,unitId:o,subUnitId:s}=r;return this._sheetsThreadCommentModel.showCommentMarker(o,s,t,n)?e({...i,markers:{...i==null?void 0:i.markers,tr:{color:"#FFBD37",size:6}}}):e(i)},priority:100}))}_initSkeletonChange(){const i=()=>{const r=this._univerInstanceService.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET);if(!r)return;const e=r.getUnitId(),t=r.getActiveSheet().getSheetId(),n=this._sheetSkeletonManagerService.getOrCreateSkeleton({unitId:e,sheetId:t}),o=this._renderManagerService.getRenderById(e);n==null||n.makeDirty(!0),n==null||n.calculate(),o&&o.mainComponent.makeForceDirty()};this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.subscribe(()=>{i()}))}};A=je([c.OnLifecycle(c.LifecycleStages.Ready,A),x(0,l.Inject(U.SheetInterceptorService)),x(1,l.Inject(exports.SheetsThreadCommentModel)),x(2,c.IUniverInstanceService),x(3,l.Inject(D.SheetSkeletonManagerService)),x(4,ie.IRenderManagerService)],A);var De=Object.defineProperty,$e=Object.getOwnPropertyDescriptor,xe=(i,r,e,t)=>{for(var n=t>1?void 0:t?$e(r,e):r,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(t?s(r,e,n):s(n))||n);return t&&n&&De(r,e,n),n},Y=(i,r)=>(e,t)=>r(e,t,i);const Ne=(i,r,e)=>{const t=M.singleReferenceToGrid(i),n=e.row-r.row,o=e.column-r.column,s={startColumn:t.column+o,startRow:t.row+n,endColumn:t.column+o,endRow:t.row+n};return M.serializeRange(s)};exports.SheetsThreadCommentCopyPasteController=class extends c.Disposable{constructor(e,t){super();S(this,"_copyInfo");this._sheetClipboardService=e,this._sheetsThreadCommentModel=t,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:Z,onBeforeCopy:(e,t,n)=>{this._copyInfo={unitId:e,subUnitId:t,range:n}},onPasteCells:(e,t,n,o)=>{const{unitId:s,subUnitId:a,range:m}=t,d={row:m.rows[0],column:m.cols[0]};if(o.copyType===D.COPY_TYPE.CUT&&this._copyInfo){const{range:h,unitId:u,subUnitId:b}=this._copyInfo,j={row:h.startRow,column:h.startColumn};if(!(s===u&&a===b)){const R=[];c.Range.foreach(h,(C,I)=>{const f=this._sheetsThreadCommentModel.getCommentWithChildren(u,b,C,I);f&&R.push(f)});const w=[],$=[],N=[],L=[],p=C=>{w.unshift({id:v.DeleteCommentMutation.id,params:{unitId:u,subUnitId:b,commentId:C.id}}),N.push({id:v.AddCommentMutation.id,params:{unitId:s,subUnitId:a,comment:{...C,ref:Ne(C.ref,j,d),unitId:s,subUnitId:a}}}),$.push({id:v.AddCommentMutation.id,params:{unitId:u,subUnitId:b,comment:C}}),L.unshift({id:v.DeleteCommentMutation.id,params:{unitId:s,subUnitId:a,commentId:C.id}})};return R.forEach(C=>{p(C.root),C.children.forEach(I=>{p(I)})}),{redos:[...w,...N],undos:[...L,...$]}}}return{redos:[],undos:[]}}}))}};exports.SheetsThreadCommentCopyPasteController=xe([c.OnLifecycle(c.LifecycleStages.Rendered,exports.SheetsThreadCommentCopyPasteController),Y(0,l.Inject(D.ISheetClipboardService)),Y(1,l.Inject(exports.SheetsThreadCommentModel))],exports.SheetsThreadCommentCopyPasteController);var Le=Object.defineProperty,Ve=Object.getOwnPropertyDescriptor,Ae=(i,r,e,t)=>{for(var n=t>1?void 0:t?Ve(r,e):r,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(t?s(r,e,n):s(n))||n);return t&&n&&Le(r,e,n),n},F=(i,r)=>(e,t)=>r(e,t,i);exports.SheetsThreadCommentHoverController=class extends c.Disposable{constructor(r,e,t){super(),this._hoverManagerService=r,this._sheetsThreadCommentPopupService=e,this._sheetsThreadCommentModel=t,this._initHoverEvent()}_initHoverEvent(){this._hoverManagerService.currentCell$.subscribe(r=>{const e=this._sheetsThreadCommentPopupService.activePopup;if(r&&(e&&e.temp||!e)){const{location:t}=r,{unitId:n,subUnitId:o,row:s,col:a}=t,m=this._sheetsThreadCommentModel.getByLocation(n,o,s,a);if(m){const d=this._sheetsThreadCommentModel.getComment(n,o,m);d&&!d.resolved&&this._sheetsThreadCommentPopupService.showPopup({unitId:n,subUnitId:o,row:s,col:a,commentId:m,temp:!0})}else e&&this._sheetsThreadCommentPopupService.hidePopup()}})}};exports.SheetsThreadCommentHoverController=Ae([c.OnLifecycle(c.LifecycleStages.Rendered,exports.SheetsThreadCommentHoverController),F(0,l.Inject(D.HoverManagerService)),F(1,l.Inject(exports.SheetsThreadCommentPopupService)),F(2,l.Inject(exports.SheetsThreadCommentModel))],exports.SheetsThreadCommentHoverController);var He=Object.defineProperty,Be=Object.getOwnPropertyDescriptor,Fe=(i,r,e,t)=>{for(var n=t>1?void 0:t?Be(r,e):r,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(t?s(r,e,n):s(n))||n);return t&&n&&He(r,e,n),n},W=(i,r)=>(e,t)=>r(e,t,i);exports.ThreadCommentRemoveSheetsController=class extends c.Disposable{constructor(r,e,t){super(),this._sheetInterceptorService=r,this._univerInstanceService=e,this._threadCommentModel=t,this._initSheetChange()}_initSheetChange(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:r=>{if(r.id===U.RemoveSheetCommand.id){const e=r.params,t=e.unitId?this._univerInstanceService.getUnit(e.unitId):this._univerInstanceService.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET);if(!t)return{redos:[],undos:[]};const n=t.getUnitId(),o=e.subUnitId||t.getActiveSheet().getSheetId(),{commentMap:s}=this._threadCommentModel.ensureMap(n,o),a=Array.from(Object.keys(s)),m=Array.from(Object.values(s)),d=a.map(u=>({id:v.DeleteCommentMutation.id,params:{unitId:n,subUnitId:o,commentId:u}})),h=m.map(u=>({id:v.AddCommentMutation.id,params:{unitId:n,subUnitId:o,comment:u}}));return{redos:d,undos:h}}return{redos:[],undos:[]}}}))}};exports.ThreadCommentRemoveSheetsController=Fe([c.OnLifecycle(c.LifecycleStages.Ready,exports.ThreadCommentRemoveSheetsController),W(0,l.Inject(U.SheetInterceptorService)),W(1,c.IUniverInstanceService),W(2,l.Inject(v.ThreadCommentModel))],exports.ThreadCommentRemoveSheetsController);var We=Object.defineProperty,qe=Object.getOwnPropertyDescriptor,ze=(i,r,e,t)=>{for(var n=t>1?void 0:t?qe(r,e):r,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(t?s(r,e,n):s(n))||n);return t&&n&&We(r,e,n),n},X=(i,r)=>(e,t)=>r(e,t,i),V;exports.UniverSheetsThreadCommentPlugin=(V=class extends P.UniverThreadCommentUIPlugin{constructor(e={},t,n){super(e,t,n);S(this,"_pluginConfig");this._injector=t,this._commandService=n,this._pluginConfig=c.Tools.deepMerge({},ye,e)}onStarting(e){super.onStarting(e),[[exports.SheetsThreadCommentModel],[exports.SheetsThreadCommentController,{useFactory:()=>this._injector.createInstance(exports.SheetsThreadCommentController,this._pluginConfig)}],[exports.SheetsThreadCommentRefRangeController],[A],[exports.SheetsThreadCommentCopyPasteController],[exports.SheetsThreadCommentHoverController],[exports.ThreadCommentRemoveSheetsController],[exports.SheetsThreadCommentPopupService]].forEach(t=>{this._injector.add(t)}),[H].forEach(t=>{this._commandService.registerCommand(t)})}},S(V,"pluginName",Z),S(V,"type",c.UniverInstanceType.UNIVER_SHEET),V);exports.UniverSheetsThreadCommentPlugin=ze([X(1,l.Inject(l.Injector)),X(2,l.Inject(c.ICommandService))],exports.UniverSheetsThreadCommentPlugin);Object.defineProperty(exports,"Inject",{enumerable:!0,get:()=>l.Inject});Object.defineProperty(exports,"Injector",{enumerable:!0,get:()=>l.Injector});Object.defineProperty(exports,"ICommandService",{enumerable:!0,get:()=>c.ICommandService});Object.defineProperty(exports,"Plugin",{enumerable:!0,get:()=>c.Plugin});Object.defineProperty(exports,"UniverInstanceType",{enumerable:!0,get:()=>c.UniverInstanceType});Object.defineProperty(exports,"IThreadCommentMentionDataService",{enumerable:!0,get:()=>P.IThreadCommentMentionDataService});Object.defineProperty(exports,"UniverThreadCommentUIPlugin",{enumerable:!0,get:()=>P.UniverThreadCommentUIPlugin});Object.defineProperty(exports,"IThreadCommentDataSourceService",{enumerable:!0,get:()=>v.IThreadCommentDataSourceService});exports.SHEETS_THREAD_COMMENT=Z;
1
+ "use strict";var re=Object.defineProperty;var oe=(o,i,e)=>i in o?re(o,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[i]=e;var I=(o,i,e)=>(oe(o,typeof i!="symbol"?i+"":i,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@wendellhu/redi"),c=require("@univerjs/core"),b=require("@univerjs/thread-comment-ui"),S=require("@univerjs/ui"),v=require("@univerjs/sheets"),y=require("@univerjs/engine-formula"),k=require("@univerjs/sheets-ui"),f=require("@univerjs/thread-comment"),U=require("@wendellhu/redi/react-bindings"),T=require("react"),V=require("rxjs"),ie=require("@univerjs/engine-render");var M=function(){return M=Object.assign||function(o){for(var i,e=1,n=arguments.length;e<n;e++){i=arguments[e];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(o[t]=i[t])}return o},M.apply(this,arguments)},se=function(o,i){var e={};for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&i.indexOf(n)<0&&(e[n]=o[n]);if(o!=null&&typeof Object.getOwnPropertySymbols=="function")for(var t=0,n=Object.getOwnPropertySymbols(o);t<n.length;t++)i.indexOf(n[t])<0&&Object.prototype.propertyIsEnumerable.call(o,n[t])&&(e[n[t]]=o[n[t]]);return e},X=T.forwardRef(function(o,i){var e=o.icon,n=o.id,t=o.className,r=o.extend,s=se(o,["icon","id","className","extend"]),a="univerjs-icon univerjs-icon-".concat(n," ").concat(t||"").trim(),m=T.useRef("_".concat(me()));return J(e,"".concat(n),{defIds:e.defIds,idSuffix:m.current},M({ref:i,className:a},s),r)});function J(o,i,e,n,t){return T.createElement(o.tag,M(M({key:i},ae(o,e,t)),n),(ce(o,e).children||[]).map(function(r,s){return J(r,"".concat(i,"-").concat(o.tag,"-").concat(s),e,void 0,t)}))}function ae(o,i,e){var n=M({},o.attrs);e!=null&&e.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=e.colorChannel1);var t=i.defIds;return!t||t.length===0||(o.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+i.idSuffix),Object.entries(n).forEach(function(r){var s=r[0],a=r[1];typeof a=="string"&&(n[s]=a.replace(/url\(#(.*)\)/,"url(#$1".concat(i.idSuffix,")")))})),n}function ce(o,i){var e,n=i.defIds;return!n||n.length===0?o:o.tag==="defs"&&(!((e=o.children)===null||e===void 0)&&e.length)?M(M({},o),{children:o.children.map(function(t){return typeof t.attrs.id=="string"&&n&&n.indexOf(t.attrs.id)>-1?M(M({},t),{attrs:M(M({},t.attrs),{id:t.attrs.id+i.idSuffix})}):t})}):o}function me(){return Math.random().toString(36).substring(2,8)}X.displayName="UniverIcon";var de={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521C5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345ZM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521C8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345ZM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521C11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M5.83725 6.78345C6.22188 6.78345 6.53368 7.10742 6.53368 7.50706V8.41159C6.53368 8.81123 6.22188 9.13521 5.83725 9.13521 5.45263 9.13521 5.14082 8.81123 5.14082 8.41159V7.50706C5.14082 7.10742 5.45263 6.78345 5.83725 6.78345zM8.73904 6.78345C9.12366 6.78345 9.43546 7.10742 9.43546 7.50706V8.41159C9.43546 8.81123 9.12366 9.13521 8.73904 9.13521 8.35441 9.13521 8.04261 8.81123 8.04261 8.41159V7.50706C8.04261 7.10742 8.35441 6.78345 8.73904 6.78345zM11.6408 6.78345C12.0254 6.78345 12.3372 7.10742 12.3372 7.50706V8.41159C12.3372 8.81123 12.0254 9.13521 11.6408 9.13521 11.2562 9.13521 10.9444 8.81123 10.9444 8.41159V7.50706C10.9444 7.10742 11.2562 6.78345 11.6408 6.78345z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.84351 3.41861C1.84351 3.01861 2.15531 2.69434 2.53993 2.69434H14.9381C15.3228 2.69434 15.6346 3.01861 15.6346 3.41861V12.4611C15.6346 12.8612 15.3228 13.1854 14.9381 13.1854H8.82117L6.06643 14.6179C5.85054 14.7301 5.59416 14.7181 5.38884 14.5862C5.18352 14.4542 5.05855 14.2211 5.05855 13.9701V13.1854H2.53993C2.15531 13.1854 1.84351 12.8612 1.84351 12.4611L1.84351 3.41861ZM6.45141 12.7982L8.34531 12.0135C8.44201 11.9632 8.54864 11.9371 8.65676 11.9371H14.2417C14.3522 11.9371 14.4417 11.8475 14.4417 11.7371V4.14271C14.4417 4.03225 14.3522 3.94271 14.2417 3.94271H3.23636C3.12591 3.94271 3.03636 4.03225 3.03636 4.14271L3.03636 11.7371C3.03636 11.8475 3.12591 11.9371 3.23636 11.9371L5.75498 11.9371C6.1396 11.9371 6.45141 12.0611 6.45141 12.4611V12.7982Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Q=T.forwardRef(function(o,i){return T.createElement(X,Object.assign({},o,{id:"comment-single",ref:i,icon:de}))});Q.displayName="CommentSingle";var he=(o,i,e,n)=>{for(var t=i,r=o.length-1,s;r>=0;r--)(s=o[r])&&(t=s(t)||t);return t},z=(o,i)=>(e,n)=>i(e,n,o);exports.SheetsThreadCommentModel=class extends c.Disposable{constructor(e,n){super();I(this,"_matrixMap",new Map);I(this,"_locationMap",new Map);I(this,"_commentUpdate$",new V.Subject);I(this,"commentUpdate$",this._commentUpdate$.asObservable());this._threadCommentModel=e,this._univerInstanceService=n,this._init()}_init(){this._initData(),this._initUpdateTransform()}_ensureCommentMatrix(e,n){let t=this._matrixMap.get(e);t||(t=new Map,this._matrixMap.set(e,t));let r=t.get(n);return r||(r=new c.ObjectMatrix,t.set(n,r)),r}_ensureCommentLocationMap(e,n){let t=this._locationMap.get(e);t||(t=new Map,this._locationMap.set(e,t));let r=t.get(n);return r||(r=new Map,t.set(n,r)),r}_ensure(e,n){const t=this._ensureCommentMatrix(e,n),r=this._ensureCommentLocationMap(e,n);return{matrix:t,locationMap:r}}_initData(){const e=this._threadCommentModel.getAll();for(const n in e){const t=e[n];for(const r in t){const s=t[r];for(const a in s){const m=s[a];this._addComment(n,r,m)}}}}_addComment(e,n,t){const r=y.singleReferenceToGrid(t.ref),s=t.parentId,{row:a,column:m}=r,d=t.id,{matrix:h,locationMap:u}=this._ensure(e,n);!s&&a>=0&&m>=0&&(h.setValue(a,m,d),u.set(d,{row:a,column:m})),this._commentUpdate$.next({unitId:e,subUnitId:n,payload:t,type:"add",...r})}_initUpdateTransform(){this.disposeWithMe(this._threadCommentModel.commentUpdate$.subscribe(e=>{const{unitId:n,subUnitId:t}=e;try{if(this._univerInstanceService.getUnitType(n)!==c.UniverInstanceType.UNIVER_SHEET)return}catch{}const{matrix:r,locationMap:s}=this._ensure(n,t);switch(e.type){case"add":{this._addComment(e.unitId,e.subUnitId,e.payload);break}case"delete":{const{isRoot:a,comment:m}=e.payload,d=y.singleReferenceToGrid(m.ref);if(a){const{row:h,column:u}=d;h>=0&&u>=0&&r.realDeleteValue(h,u)}this._commentUpdate$.next({...e,...d});break}case"update":{const{commentId:a}=e.payload,m=this._threadCommentModel.getComment(n,t,a);if(!m)return;const d=y.singleReferenceToGrid(m.ref);this._commentUpdate$.next({...e,...d});break}case"updateRef":{const a=y.singleReferenceToGrid(e.payload.ref),{commentId:m}=e.payload,d=s.get(m);if(!d)return;const{row:h,column:u}=d;r.getValue(h,u)===m&&(r.realDeleteValue(h,u),s.delete(m)),a.row>=0&&a.column>=0&&(r.setValue(a.row,a.column,m),s.set(m,{row:a.row,column:a.column})),this._commentUpdate$.next({...e,...a});break}}}))}getByLocation(e,n,t,r){return this._ensureCommentMatrix(e,n).getValue(t,r)}getComment(e,n,t){return this._threadCommentModel.getComment(e,n,t)}getCommentWithChildren(e,n,t,r){const a=this._ensureCommentMatrix(e,n).getValue(t,r);if(a)return this._threadCommentModel.getCommentWithChildren(e,n,a)}showCommentMarker(e,n,t,r){const s=this.getByLocation(e,n,t,r);if(!s)return!1;const a=this.getComment(e,n,s);return!!(a&&!a.resolved)}};exports.SheetsThreadCommentModel=he([z(0,l.Inject(f.ThreadCommentModel)),z(1,c.IUniverInstanceService)],exports.SheetsThreadCommentModel);const ee="univer.sheet.thread-comment-modal",F="comment-single",q="univer.sheet.thread-comment";var ue=(o,i,e,n)=>{for(var t=i,r=o.length-1,s;r>=0;r--)(s=o[r])&&(t=s(t)||t);return t},G=(o,i)=>(e,n)=>i(e,n,o);exports.SheetsThreadCommentPopupService=class extends c.Disposable{constructor(e,n){super();I(this,"_lastPopup",null);I(this,"_activePopup");I(this,"_activePopup$",new V.BehaviorSubject(null));I(this,"activePopup$",this._activePopup$.asObservable());this._canvasPopupManagerService=e,this._zenZoneService=n,this._initZenVisible()}get activePopup(){return this._activePopup}_initZenVisible(){this.disposeWithMe(this._zenZoneService.visible$.subscribe(e=>{e&&this.hidePopup()}))}showPopup(e,n){var h;const{row:t,col:r,unitId:s,subUnitId:a}=e;if(this._activePopup&&t===this._activePopup.row&&r===this._activePopup.col&&s===this._activePopup.unitId&&a===((h=this.activePopup)==null?void 0:h.subUnitId)){this._activePopup=e,this._activePopup$.next(e);return}if(this._lastPopup&&this._lastPopup.dispose(),this._zenZoneService.visible)return;this._activePopup=e,this._activePopup$.next(e);const m=this._canvasPopupManagerService.attachPopupToCell(t,r,{componentKey:ee,onClickOutside:()=>{this.hidePopup()},direction:"horizontal",excludeOutside:[...Array.from(document.querySelectorAll(".univer-thread-comment")),document.getElementById("thread-comment-add")].filter(Boolean)});if(!m)throw new Error("[SheetsThreadCommentPopupService]: cannot show popup!");const d=new c.DisposableCollection;d.add(m),d.add({dispose:()=>{n==null||n()}}),this._lastPopup=d}hidePopup(){this._activePopup&&(this._lastPopup&&this._lastPopup.dispose(),this._lastPopup=null,this._activePopup=null,this._activePopup$.next(null))}persistPopup(){!this._activePopup||!this._activePopup.temp||(this._activePopup={...this._activePopup,temp:!1},this._activePopup$.next(this._activePopup))}};exports.SheetsThreadCommentPopupService=ue([G(0,l.Inject(k.SheetCanvasPopManagerService)),G(1,S.IZenZoneService)],exports.SheetsThreadCommentPopupService);const le=()=>{const o=U.useDependency(c.IUniverInstanceService),i=U.useDependency(exports.SheetsThreadCommentPopupService),e=S.useObservable(i.activePopup$),n=U.useDependency(exports.SheetsThreadCommentModel);if(S.useObservable(n.commentUpdate$),!e)return null;const{row:t,col:r,unitId:s,subUnitId:a,trigger:m}=e,d=n.getByLocation(s,a,t,r),h=`${c.Tools.chatAtABC(r)}${t+1}`,u=()=>{i.hidePopup()},P=j=>{var R,w,x;return(x=(w=(R=o.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET))==null?void 0:R.getSheetBySheetId(j))==null?void 0:w.getName())!=null?x:""};return T.createElement(b.ThreadCommentTree,{onClick:()=>{i.persistPopup()},prefix:"cell",id:d,unitId:s,subUnitId:a,type:c.UniverInstanceType.UNIVER_SHEET,refStr:h,onClose:u,getSubUnitName:P,autoFocus:m==="context-menu"})},A={type:c.CommandType.OPERATION,id:"sheets.operation.show-comment-modal",handler(o){var w;const i=o.get(v.SelectionManagerService),e=o.get(c.IUniverInstanceService),n=o.get(exports.SheetsThreadCommentPopupService),t=o.get(b.ThreadCommentPanelService),r=(w=i.getFirst())==null?void 0:w.primary,s=i.getCurrent(),a=o.get(exports.SheetsThreadCommentModel);if(!s||!r)return!1;const{unitId:m,sheetId:d}=s,h=v.getSheetCommandTarget(e,{unitId:m,subUnitId:d});if(!h)return!1;const{workbook:u,worksheet:P}=h,j={workbook:u,worksheet:P,unitId:m,subUnitId:d,row:r.actualRow,col:r.startColumn};n.showPopup(j);const R=a.getByLocation(m,d,r.actualRow,r.startColumn);return R&&t.setActiveComment({unitId:m,subUnitId:d,commentId:R,trigger:"context-menu"}),!0}},pe=()=>{const o=U.useDependency(k.IMarkSelectionService),i=U.useDependency(c.IUniverInstanceService),e=U.useDependency(f.ThreadCommentModel),n=U.useDependency(exports.SheetsThreadCommentPopupService),t=i.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET);if(!t)return null;const r=t.getUnitId(),s=U.useDependency(c.ICommandService),a=T.useMemo(()=>t.activeSheet$.pipe(V.map(p=>p==null?void 0:p.getSheetId())),[t.activeSheet$]),m=U.useObservable(a,t.getActiveSheet().getSheetId()),d=T.useRef(),h=U.useDependency(b.ThreadCommentPanelService),u=U.useObservable(h.activeCommentId$),P=T.useCallback(p=>{const C=t.getSheets(),g={};return C.forEach((_,E)=>{g[_.getSheetId()]=E}),p.map(_=>{var Z;const E=y.singleReferenceToGrid(_.ref),ne=[(Z=g[_.subUnitId])!=null?Z:0,E.row,E.column];return{..._,p:ne}}).sort((_,E)=>_.p[0]===E.p[0]?_.p[1]===E.p[1]?_.p[2]-E.p[2]:_.p[1]-E.p[1]:_.p[0]-E.p[0])},[t]),j=T.useCallback(p=>{if(p.unitId===r&&p.subUnitId===m&&!p.resolved){const{row:C,column:g}=y.singleReferenceToGrid(p.ref);if(!Number.isNaN(C)&&!Number.isNaN(g))return o.addShape({range:{startColumn:g,endColumn:g,startRow:C,endRow:C},style:{hasAutoFill:!1,fill:"rgb(255, 189, 55, 0.35)",strokeWidth:1,stroke:"#FFBD37",widgets:{}},primary:null})}},[o,m,r]),R=p=>{var C,g;return(g=(C=t.getSheetBySheetId(p))==null?void 0:C.getName())!=null?g:""},w=()=>{s.executeCommand(A.id)},x=()=>{n.hidePopup()},D=p=>{u&&u.unitId===p.unitId&&u.subUnitId===p.subUnitId&&u.commentId===p.id||(d.current&&(o.removeShape(d.current),d.current=null),d.current=j(p))},N=()=>{d.current&&(o.removeShape(d.current),d.current=null)};return T.useEffect(()=>{if(!u)return;const p=e.getComment(u.unitId,u.subUnitId,u.commentId);if(!p)return;const C=j(p);return()=>{C&&o.removeShape(C)}},[j,u,e,o]),T.createElement(b.ThreadCommentPanel,{unitId:r,subUnitId$:a,type:c.UniverInstanceType.UNIVER_SHEET,onAdd:w,getSubUnitName:R,onResolve:x,sortComments:P,onItemEnter:D,onItemLeave:N})},Ce=o=>({id:A.id,type:S.MenuItemType.BUTTON,positions:[S.MenuPosition.CONTEXT_MENU],icon:F,title:"sheetThreadComment.menu.addComment",hidden$:S.getMenuHiddenObservable(o,c.UniverInstanceType.UNIVER_SHEET),disabled$:k.getCommentDisable$(o,{workbookTypes:[v.WorkbookCommentPermission],worksheetTypes:[v.WorksheetViewPermission],rangeTypes:[v.RangeProtectionPermissionEditPoint]})}),ve=o=>({id:b.ToggleSheetCommentPanelOperation.id,type:S.MenuItemType.BUTTON,icon:F,tooltip:"sheetThreadComment.menu.commentManagement",positions:S.MenuPosition.TOOLBAR_START,group:S.MenuGroup.TOOLBAR_OTHERS,disabled$:k.getCommentDisable$(o,{workbookTypes:[v.WorkbookCommentPermission],worksheetTypes:[v.WorksheetViewPermission],rangeTypes:[v.RangeProtectionPermissionEditPoint]}),hidden$:S.getMenuHiddenObservable(o,c.UniverInstanceType.UNIVER_SHEET)}),Se={id:A.id,binding:S.KeyCode.M|S.MetaKeys.CTRL_COMMAND|S.MetaKeys.ALT,preconditions:k.whenSheetEditorFocused};var fe=(o,i,e,n)=>{for(var t=i,r=o.length-1,s;r>=0;r--)(s=o[r])&&(t=s(t)||t);return t},O=(o,i)=>(e,n)=>i(e,n,o);const _e={};exports.SheetsThreadCommentController=class extends c.Disposable{constructor(i,e,n,t,r,s,a,m,d,h,u){super(),this._config=i,this._menuService=e,this._injector=n,this._componentManager=t,this._localeService=r,this._commandService=s,this._sheetsThreadCommentPopupService=a,this._sheetsThreadCommentModel=m,this._threadCommentPanelService=d,this._shortcutService=h,this._univerInstanceService=u,this._initMenu(),this._initShortcut(),this._initComponent(),this._initCommandListener(),this._initPanelListener()}_initShortcut(){this._shortcutService.registerShortcut(Se)}_initCommandListener(){this._commandService.onCommandExecuted(i=>{if(i.id===v.SetSelectionsOperation.id){const e=i.params,{unitId:n,subUnitId:t,selections:r,type:s}=e;if((s===v.SelectionMoveType.MOVE_END||s===void 0)&&r[0].primary){const a=r[0].primary.actualRow,m=r[0].primary.actualColumn;if(!this._sheetsThreadCommentModel.showCommentMarker(n,t,a,m)){this._threadCommentPanelService.activeCommentId&&this._commandService.executeCommand(b.SetActiveCommentOperation.id);return}const d=this._sheetsThreadCommentModel.getByLocation(n,t,a,m);d&&this._commandService.executeCommand(b.SetActiveCommentOperation.id,{unitId:n,subUnitId:t,commentId:d})}}if(i.id===f.DeleteCommentMutation.id){const e=i.params,n=this._sheetsThreadCommentPopupService.activePopup;if(!n)return;const{unitId:t,subUnitId:r,commentId:s}=n;e.unitId===t&&e.subUnitId===r&&e.commentId===s&&this._sheetsThreadCommentPopupService.hidePopup()}})}_initMenu(){const{menu:i={}}=this._config;[Ce,ve].forEach(e=>{this._menuService.addMenuItem(e(this._injector),i)})}_initComponent(){[[ee,le],[b.THREAD_COMMENT_PANEL,pe],[F,Q]].forEach(([i,e])=>{this._componentManager.register(i,e)})}_initPanelListener(){this.disposeWithMe(this._threadCommentPanelService.activeCommentId$.subscribe(async i=>{if(i){const{unitId:e,subUnitId:n,commentId:t,trigger:r}=i,s=this._sheetsThreadCommentModel.getComment(e,n,t);if(!s||s.resolved)return;const a=this._univerInstanceService.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET);if(!a||a.getUnitId()!==e)return;a.getActiveSheet().getSheetId()!==n&&await this._commandService.executeCommand(v.SetWorksheetActiveOperation.id,{unitId:e,subUnitId:n});const h=y.singleReferenceToGrid(s.ref);await this._commandService.executeCommand(k.ScrollToCellCommand.id,{range:{startColumn:h.column,endColumn:h.column,startRow:h.row,endRow:h.row}}),this._sheetsThreadCommentPopupService.showPopup({unitId:e,subUnitId:n,row:h.row,col:h.column,commentId:s.id,trigger:r})}else this._sheetsThreadCommentPopupService.hidePopup()}))}};exports.SheetsThreadCommentController=fe([c.OnLifecycle(c.LifecycleStages.Starting,exports.SheetsThreadCommentController),O(1,S.IMenuService),O(2,l.Inject(l.Injector)),O(3,l.Inject(S.ComponentManager)),O(4,l.Inject(c.LocaleService)),O(5,c.ICommandService),O(6,l.Inject(exports.SheetsThreadCommentPopupService)),O(7,l.Inject(exports.SheetsThreadCommentModel)),O(8,l.Inject(b.ThreadCommentPanelService)),O(9,S.IShortcutService),O(10,c.IUniverInstanceService)],exports.SheetsThreadCommentController);var ge=(o,i,e,n)=>{for(var t=i,r=o.length-1,s;r>=0;r--)(s=o[r])&&(t=s(t)||t);return t},H=(o,i)=>(e,n)=>i(e,n,o);exports.SheetsThreadCommentRefRangeController=class extends c.Disposable{constructor(e,n,t){super();I(this,"_disposableMap",new Map);this._refRangeService=e,this._sheetsThreadCommentModel=n,this._threadCommentModel=t,this._initData(),this._initRefRange()}_getIdWithUnitId(e,n,t){return`${e}-${n}-${t}`}_register(e,n,t){const r=t.id,s={startColumn:t.column,endColumn:t.column,startRow:t.row,endRow:t.row},a=m=>{const d=v.handleDefaultRangeChangeWithEffectRefCommands(s,m);return d&&d.startColumn===s.startColumn&&d.startRow===s.startRow?{undos:[],redos:[]}:d?{redos:[{id:f.UpdateCommentRefMutation.id,params:{unitId:e,subUnitId:n,payload:{ref:y.serializeRange(d),commentId:r}}}],undos:[{id:f.UpdateCommentRefMutation.id,params:{unitId:e,subUnitId:n,payload:{ref:y.serializeRange(s),commentId:r}}}]}:{redos:[{id:f.DeleteCommentMutation.id,params:{unitId:e,subUnitId:n,commentId:r}}],undos:[{id:f.AddCommentMutation.id,params:{unitId:e,subUnitId:n,comment:t}}]}};this._disposableMap.set(this._getIdWithUnitId(e,n,r),this._refRangeService.registerRefRange(s,a,e,n))}_initData(){const e=this._threadCommentModel.getAll();for(const n in e){const t=e[n];for(const r in t){const s=t[r];for(const a in s){const m=s[a],d=m.ref,h=y.singleReferenceToGrid(d);this._register(n,r,{...m,...h})}}}}_initRefRange(){this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.subscribe(e=>{const{unitId:n,subUnitId:t}=e;switch(e.type){case"add":{const r=e.payload;this._register(e.unitId,e.subUnitId,{...r,row:e.row,column:e.column});break}case"delete":{const r=this._disposableMap.get(this._getIdWithUnitId(n,t,e.payload.commentId));r==null||r.dispose();break}case"updateRef":{const r=this._sheetsThreadCommentModel.getComment(n,t,e.payload.commentId);if(!r)return;const s=this._disposableMap.get(this._getIdWithUnitId(n,t,r.id));s==null||s.dispose(),this._register(e.unitId,e.subUnitId,{...r,row:e.row,column:e.column});break}}})),this.disposeWithMe(c.toDisposable(()=>{this._disposableMap.forEach(e=>{e.dispose()}),this._disposableMap.clear()}))}};exports.SheetsThreadCommentRefRangeController=ge([c.OnLifecycle(c.LifecycleStages.Starting,exports.SheetsThreadCommentRefRangeController),H(0,l.Inject(v.RefRangeService)),H(1,l.Inject(exports.SheetsThreadCommentModel)),H(2,l.Inject(f.ThreadCommentModel))],exports.SheetsThreadCommentRefRangeController);var Ie=(o,i,e,n)=>{for(var t=i,r=o.length-1,s;r>=0;r--)(s=o[r])&&(t=s(t)||t);return t},$=(o,i)=>(e,n)=>i(e,n,o);let L=class extends c.Disposable{constructor(o,i,e,n,t){super(),this._sheetInterceptorService=o,this._sheetsThreadCommentModel=i,this._univerInstanceService=e,this._sheetSkeletonManagerService=n,this._renderManagerService=t,this._initViewModelIntercept(),this._initSkeletonChange()}_initViewModelIntercept(){this.disposeWithMe(this._sheetInterceptorService.intercept(v.INTERCEPTOR_POINT.CELL_CONTENT,{handler:(o,i,e)=>{const{row:n,col:t,unitId:r,subUnitId:s}=i;return this._sheetsThreadCommentModel.showCommentMarker(r,s,n,t)?e({...o,markers:{...o==null?void 0:o.markers,tr:{color:"#FFBD37",size:6}}}):e(o)},priority:100}))}_initSkeletonChange(){const o=()=>{const i=this._univerInstanceService.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET);if(!i)return;const e=i.getUnitId(),n=i.getActiveSheet().getSheetId(),t=this._sheetSkeletonManagerService.getOrCreateSkeleton({unitId:e,sheetId:n}),r=this._renderManagerService.getRenderById(e);t==null||t.makeDirty(!0),t==null||t.calculate(),r&&r.mainComponent.makeForceDirty()};this.disposeWithMe(this._sheetsThreadCommentModel.commentUpdate$.subscribe(()=>{o()}))}};L=Ie([c.OnLifecycle(c.LifecycleStages.Ready,L),$(0,l.Inject(v.SheetInterceptorService)),$(1,l.Inject(exports.SheetsThreadCommentModel)),$(2,c.IUniverInstanceService),$(3,l.Inject(k.SheetSkeletonManagerService)),$(4,ie.IRenderManagerService)],L);var Te=(o,i,e,n)=>{for(var t=i,r=o.length-1,s;r>=0;r--)(s=o[r])&&(t=s(t)||t);return t},K=(o,i)=>(e,n)=>i(e,n,o);const Me=(o,i,e)=>{const n=y.singleReferenceToGrid(o),t=e.row-i.row,r=e.column-i.column,s={startColumn:n.column+r,startRow:n.row+t,endColumn:n.column+r,endRow:n.row+t};return y.serializeRange(s)};exports.SheetsThreadCommentCopyPasteController=class extends c.Disposable{constructor(e,n){super();I(this,"_copyInfo");this._sheetClipboardService=e,this._sheetsThreadCommentModel=n,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:q,onBeforeCopy:(e,n,t)=>{this._copyInfo={unitId:e,subUnitId:n,range:t}},onPasteCells:(e,n,t,r)=>{const{unitId:s,subUnitId:a,range:m}=n,d={row:m.rows[0],column:m.cols[0]};if(r.copyType===k.COPY_TYPE.CUT&&this._copyInfo){const{range:h,unitId:u,subUnitId:P}=this._copyInfo,j={row:h.startRow,column:h.startColumn};if(!(s===u&&a===P)){const R=[];c.Range.foreach(h,(C,g)=>{const _=this._sheetsThreadCommentModel.getCommentWithChildren(u,P,C,g);_&&R.push(_)});const w=[],x=[],D=[],N=[],p=C=>{w.unshift({id:f.DeleteCommentMutation.id,params:{unitId:u,subUnitId:P,commentId:C.id}}),D.push({id:f.AddCommentMutation.id,params:{unitId:s,subUnitId:a,comment:{...C,ref:Me(C.ref,j,d),unitId:s,subUnitId:a}}}),x.push({id:f.AddCommentMutation.id,params:{unitId:u,subUnitId:P,comment:C}}),N.unshift({id:f.DeleteCommentMutation.id,params:{unitId:s,subUnitId:a,commentId:C.id}})};return R.forEach(C=>{p(C.root),C.children.forEach(g=>{p(g)})}),{redos:[...w,...D],undos:[...N,...x]}}}return{redos:[],undos:[]}}}))}};exports.SheetsThreadCommentCopyPasteController=Te([c.OnLifecycle(c.LifecycleStages.Rendered,exports.SheetsThreadCommentCopyPasteController),K(0,l.Inject(k.ISheetClipboardService)),K(1,l.Inject(exports.SheetsThreadCommentModel))],exports.SheetsThreadCommentCopyPasteController);var ye=(o,i,e,n)=>{for(var t=i,r=o.length-1,s;r>=0;r--)(s=o[r])&&(t=s(t)||t);return t},W=(o,i)=>(e,n)=>i(e,n,o);exports.SheetsThreadCommentHoverController=class extends c.Disposable{constructor(i,e,n){super(),this._hoverManagerService=i,this._sheetsThreadCommentPopupService=e,this._sheetsThreadCommentModel=n,this._initHoverEvent()}_initHoverEvent(){this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(V.debounceTime(100)).subscribe(i=>{const e=this._sheetsThreadCommentPopupService.activePopup;if(i&&(e&&e.temp||!e)){const{location:n}=i,{unitId:t,subUnitId:r,row:s,col:a}=n,m=this._sheetsThreadCommentModel.getByLocation(t,r,s,a);if(m){const d=this._sheetsThreadCommentModel.getComment(t,r,m);d&&!d.resolved&&this._sheetsThreadCommentPopupService.showPopup({unitId:t,subUnitId:r,row:s,col:a,commentId:m,temp:!0})}else e&&this._sheetsThreadCommentPopupService.hidePopup()}}))}};exports.SheetsThreadCommentHoverController=ye([c.OnLifecycle(c.LifecycleStages.Rendered,exports.SheetsThreadCommentHoverController),W(0,l.Inject(k.HoverManagerService)),W(1,l.Inject(exports.SheetsThreadCommentPopupService)),W(2,l.Inject(exports.SheetsThreadCommentModel))],exports.SheetsThreadCommentHoverController);var be=(o,i,e,n)=>{for(var t=i,r=o.length-1,s;r>=0;r--)(s=o[r])&&(t=s(t)||t);return t},B=(o,i)=>(e,n)=>i(e,n,o);exports.ThreadCommentRemoveSheetsController=class extends c.Disposable{constructor(i,e,n){super(),this._sheetInterceptorService=i,this._univerInstanceService=e,this._threadCommentModel=n,this._initSheetChange()}_initSheetChange(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:i=>{if(i.id===v.RemoveSheetCommand.id){const e=i.params,n=e.unitId?this._univerInstanceService.getUnit(e.unitId):this._univerInstanceService.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET);if(!n)return{redos:[],undos:[]};const t=n.getUnitId(),r=e.subUnitId||n.getActiveSheet().getSheetId(),{commentMap:s}=this._threadCommentModel.ensureMap(t,r),a=Array.from(Object.keys(s)),m=Array.from(Object.values(s)),d=a.map(u=>({id:f.DeleteCommentMutation.id,params:{unitId:t,subUnitId:r,commentId:u}})),h=m.map(u=>({id:f.AddCommentMutation.id,params:{unitId:t,subUnitId:r,comment:u}}));return{redos:d,undos:h}}return{redos:[],undos:[]}}}))}};exports.ThreadCommentRemoveSheetsController=be([c.OnLifecycle(c.LifecycleStages.Ready,exports.ThreadCommentRemoveSheetsController),B(0,l.Inject(v.SheetInterceptorService)),B(1,c.IUniverInstanceService),B(2,l.Inject(f.ThreadCommentModel))],exports.ThreadCommentRemoveSheetsController);var Pe=Object.defineProperty,Ue=(o,i,e)=>i in o?Pe(o,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[i]=e,Re=(o,i,e,n)=>{for(var t=i,r=o.length-1,s;r>=0;r--)(s=o[r])&&(t=s(t)||t);return t},Y=(o,i)=>(e,n)=>i(e,n,o),te=(o,i,e)=>(Ue(o,typeof i!="symbol"?i+"":i,e),e);exports.UniverSheetsThreadCommentPlugin=class extends c.Plugin{constructor(e={},n,t){super();I(this,"_pluginConfig");this._injector=n,this._commandService=t,this._pluginConfig=c.Tools.deepMerge({},_e,e)}onStarting(e){[[exports.SheetsThreadCommentModel],[exports.SheetsThreadCommentController,{useFactory:()=>this._injector.createInstance(exports.SheetsThreadCommentController,this._pluginConfig)}],[exports.SheetsThreadCommentRefRangeController],[L],[exports.SheetsThreadCommentCopyPasteController],[exports.SheetsThreadCommentHoverController],[exports.ThreadCommentRemoveSheetsController],[exports.SheetsThreadCommentPopupService]].forEach(n=>{e.add(n)}),[A].forEach(n=>{this._commandService.registerCommand(n)})}};te(exports.UniverSheetsThreadCommentPlugin,"pluginName",q);te(exports.UniverSheetsThreadCommentPlugin,"type",c.UniverInstanceType.UNIVER_SHEET);exports.UniverSheetsThreadCommentPlugin=Re([c.DependentOn(b.UniverThreadCommentUIPlugin),Y(1,l.Inject(l.Injector)),Y(2,l.Inject(c.ICommandService))],exports.UniverSheetsThreadCommentPlugin);Object.defineProperty(exports,"Inject",{enumerable:!0,get:()=>l.Inject});Object.defineProperty(exports,"Injector",{enumerable:!0,get:()=>l.Injector});Object.defineProperty(exports,"ICommandService",{enumerable:!0,get:()=>c.ICommandService});Object.defineProperty(exports,"Plugin",{enumerable:!0,get:()=>c.Plugin});Object.defineProperty(exports,"UniverInstanceType",{enumerable:!0,get:()=>c.UniverInstanceType});Object.defineProperty(exports,"IThreadCommentMentionDataService",{enumerable:!0,get:()=>b.IThreadCommentMentionDataService});Object.defineProperty(exports,"UniverThreadCommentUIPlugin",{enumerable:!0,get:()=>b.UniverThreadCommentUIPlugin});Object.defineProperty(exports,"IThreadCommentDataSourceService",{enumerable:!0,get:()=>f.IThreadCommentDataSourceService});exports.SHEETS_THREAD_COMMENT=q;