@univerjs-pro/thread-comment-datasource 0.8.3 → 0.9.1-nightly.202507041607
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';const _0x57f153=_0xcc83;(function(_0x37eeea,_0x46e676){const _0x29b1e3=_0xcc83,_0x4cbb8b=_0x37eeea();while(!![]){try{const _0x153581=parseInt(_0x29b1e3(0xda))/0x1*(parseInt(_0x29b1e3(0xed))/0x2)+parseInt(_0x29b1e3(0x75))/0x3+-parseInt(_0x29b1e3(0xbf))/0x4+-parseInt(_0x29b1e3(0xe8))/0x5+parseInt(_0x29b1e3(0xce))/0x6+parseInt(_0x29b1e3(0xe4))/0x7*(parseInt(_0x29b1e3(0xb7))/0x8)+-parseInt(_0x29b1e3(0xdb))/0x9;if(_0x153581===_0x46e676)break;else _0x4cbb8b['push'](_0x4cbb8b['shift']());}catch(_0x3b426e){_0x4cbb8b['push'](_0x4cbb8b['shift']());}}}(_0x5648,0xc3d6f));function _0x5648(){const _0x1fa216=['8NUjldy','format','slice','post','Delete','onReady','forEach','Solved','6016712dZyxnZ','_initUserSync','OpenOrReOpen','_threadCommentDataSource','_sessionService','@univerjs/core','payload','root','/delete','UniverThreadCommentDataSourcePlugin','getUnit','@univerjs/network','reply','_configService','getUser','7097568rELiel','getComment','Module','addComment','UniverThreadCommentUIPlugin','UniverInstanceType','replyId','createTimestamp','getOwnPropertyDescriptor','type','@univerjs/thread-comment','deleteComment','79179RsfCkY','11206665KESbcz','add','solved','_config','body','_threadCommentModel','code','IConfigService','userId','3118521xNJtog','Edit','resolved','find','2540200oUAXAr','Injector','onStarting','@univerjs-pro/license','users','30Koduji','Add','subscribe','length','3730338QPaBmS','Plugin','symbol','/edit','saveCommentToSnapshot','UniverCollaborationClientPlugin','commentUpdate$','rxjs','CustomRangeType','@univerjs/thread-comment-ui','/universer-api/comment/unit/','parse','/reply','pipe','ref','Inject','_threadCommentDataSourceService','_httpService','merge','_init','Disposable','updateComment','user','addUser','personId','_initDataSource','resolveComment','threadId','userID','disposeWithMe','error','UNRECOGNIZED','stringify','_userService','content','replies','Solve','bufferTime','get','comments','filter','ThreadCommentModel','toStringTag','CollaborationSessionService','comment','rangeId','HTTPService','unitId','/add','DependentOn','@univerjs-pro/collaboration-client','_injector','getMemberID','Reply','IThreadCommentDataSourceService','delete','requireSession','UserManagerService','map','UniverLicensePlugin','dayjs','customRanges','syncUpdateMutationToColla','_commentService','CommentService','Unknown'];_0x5648=function(){return _0x1fa216;};return _0x5648();}Object['defineProperty'](exports,Symbol[_0x57f153(0x9f)],{'value':_0x57f153(0xd0)});const b=require(_0x57f153(0xa7)),T=require(_0x57f153(0xeb)),c=require(_0x57f153(0xc4)),j=require(_0x57f153(0x7e)),M=require(_0x57f153(0xd8)),w=require(_0x57f153(0x7c)),P=require(_0x57f153(0xca)),U='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0xe46c6a=>(_0xe46c6a[_0xe46c6a[_0x57f153(0xc1)]=0x0]=_0x57f153(0xc1),_0xe46c6a[_0xe46c6a[_0x57f153(0xbe)]=0x1]=_0x57f153(0xbe),_0xe46c6a[_0xe46c6a[_0x57f153(0x94)]=-0x1]=_0x57f153(0x94),_0xe46c6a))(I||{}),v=(_0x4160b1=>(_0x4160b1[_0x4160b1[_0x57f153(0xb6)]=0x0]='Unknown',_0x4160b1[_0x4160b1[_0x57f153(0xee)]=0x1]='Add',_0x4160b1[_0x4160b1['Reply']=0x2]=_0x57f153(0xaa),_0x4160b1[_0x4160b1[_0x57f153(0xe5)]=0x3]=_0x57f153(0xe5),_0x4160b1[_0x4160b1[_0x57f153(0xbb)]=0x4]=_0x57f153(0xbb),_0x4160b1[_0x4160b1['Solve']=0x5]=_0x57f153(0x99),_0x4160b1[_0x4160b1[_0x57f153(0x94)]=-0x1]='UNRECOGNIZED',_0x4160b1))(v||{});const f=_0x51814e=>c[_0x57f153(0xb1)](new Date(+_0x51814e))[_0x57f153(0xb8)]('YYYY/MM/DD\x20HH:mm'),R=async(_0x1c5f22,_0x1e9fd0)=>{const _0x5abf11=_0x57f153,_0x1eadb4=_0x1c5f22[_0x5abf11(0x9b)](c[_0x5abf11(0xae)]),_0x305cf9=_0x1c5f22[_0x5abf11(0x9b)](P[_0x5abf11(0xa3)]);_0x1e9fd0[_0x5abf11(0xbd)](_0x23987e=>{const _0x2dcffb=_0x5abf11;_0x1eadb4[_0x2dcffb(0xcd)](_0x23987e)&&_0x1e9fd0[_0x2dcffb(0xac)](_0x23987e);}),_0x1e9fd0['size']&&(await _0x305cf9[_0x5abf11(0x9b)]('/universer-api/user/list',{'params':{'userIDs':[..._0x1e9fd0]}}))['body'][_0x5abf11(0xec)][_0x5abf11(0xbd)](_0x9e9546=>{_0x9e9546&&_0x1eadb4['addUser'](_0x9e9546);});};var $=Object['getOwnPropertyDescriptor'],E=(_0x4c8319,_0x21020f,_0x2b0d27,_0x53339a)=>{for(var _0x3539ee=_0x53339a>0x1?void 0x0:_0x53339a?$(_0x21020f,_0x2b0d27):_0x21020f,_0x36eba4=_0x4c8319['length']-0x1,_0x5618b3;_0x36eba4>=0x0;_0x36eba4--)(_0x5618b3=_0x4c8319[_0x36eba4])&&(_0x3539ee=_0x5618b3(_0x3539ee)||_0x3539ee);return _0x3539ee;},S=(_0x2746e1,_0x4a70ed)=>(_0x4460f3,_0x4cf49b)=>_0x4a70ed(_0x4460f3,_0x4cf49b,_0x2746e1);let p=class extends c[_0x57f153(0x89)]{constructor(_0x4a3f89,_0x431854,_0x5362c4,_0x48cf7e){const _0x126084=_0x57f153;super(),this[_0x126084(0xb4)]=_0x4a3f89,this[_0x126084(0xe0)]=_0x431854,this[_0x126084(0x96)]=_0x5362c4,this[_0x126084(0xa8)]=_0x48cf7e,this[_0x126084(0x88)](),this[_0x126084(0xc0)]();}['_initUserSync'](){const _0x4a9460=_0x57f153;this[_0x4a9460(0x92)](this[_0x4a9460(0xe0)]['commentUpdate$'][_0x4a9460(0x82)](w[_0x4a9460(0x9a)](0x10))[_0x4a9460(0x73)](_0x411910=>{const _0x1ec7ff=_0x4a9460,_0x5553a4=new Set();_0x411910[_0x1ec7ff(0xbd)](_0x3096b4=>{const _0x449fb3=_0x1ec7ff;switch(_0x3096b4['type']){case _0x449fb3(0xdc):{const _0x450fd8=_0x3096b4[_0x449fb3(0xc5)][_0x449fb3(0x8d)];_0x5553a4[_0x449fb3(0xdc)](_0x450fd8);break;}}}),R(this[_0x1ec7ff(0xa8)],_0x5553a4);}));}['_init'](){const _0x5ceda2=_0x57f153;this[_0x5ceda2(0x92)](this[_0x5ceda2(0xb4)][_0x5ceda2(0x7b)][_0x5ceda2(0x73)](async _0x2d8f70=>{const _0x40d780=_0x5ceda2;var _0x57de52,_0x5c5193,_0x3eab24,_0x28159e;const _0x2f21c7=(_0x57de52=this[_0x40d780(0xe0)][_0x40d780(0xc9)](_0x2d8f70[_0x40d780(0xa4)])[_0x40d780(0xe7)](_0x458c8d=>_0x458c8d[_0x40d780(0x90)]===_0x2d8f70['threadId']))==null?void 0x0:_0x57de52['root'];if(!_0x2f21c7)return;const {unitId:_0x25e5f7,subUnitId:_0x478891}=_0x2f21c7;switch(_0x2d8f70['user']&&this[_0x40d780(0x96)]['addUser'](_0x2d8f70[_0x40d780(0x8b)]),_0x2d8f70[_0x40d780(0xd7)]){case v['Add']:break;case v[_0x40d780(0xaa)]:{this[_0x40d780(0xe0)][_0x40d780(0xd1)](_0x25e5f7,_0x478891,{'unitId':_0x25e5f7,'subUnitId':_0x478891,'ref':'','id':_0x2d8f70[_0x40d780(0xd4)],'dT':f(+_0x2d8f70['createTimestamp']),'threadId':_0x2d8f70[_0x40d780(0x90)],'personId':(_0x3eab24=(_0x5c5193=_0x2d8f70[_0x40d780(0x8b)])==null?void 0x0:_0x5c5193[_0x40d780(0x91)])!=null?_0x3eab24:_0x2d8f70[_0x40d780(0xe3)],'text':JSON[_0x40d780(0x80)](_0x2d8f70[_0x40d780(0x97)]),'parentId':_0x2f21c7['id']});break;}case v['Delete']:{const _0x27280b=this[_0x40d780(0xe0)][_0x40d780(0xcf)](_0x25e5f7,_0x478891,_0x2d8f70[_0x40d780(0xd4)]);_0x27280b&&_0x27280b['parentId']&&this[_0x40d780(0xe0)]['deleteComment'](_0x25e5f7,_0x478891,_0x2d8f70[_0x40d780(0xd4)]);break;}case v['Edit']:{this[_0x40d780(0xe0)][_0x40d780(0x8a)](_0x25e5f7,_0x478891,{'commentId':_0x2d8f70['replyId'],'text':JSON[_0x40d780(0x80)](_0x2d8f70[_0x40d780(0x97)])});break;}case v[_0x40d780(0x99)]:{const _0x3083cf=(_0x28159e=this['_threadCommentModel'][_0x40d780(0xc9)](_0x2d8f70[_0x40d780(0xa4)])[_0x40d780(0xe7)](_0x488433=>_0x488433['threadId']===_0x2d8f70[_0x40d780(0x90)]))==null?void 0x0:_0x28159e[_0x40d780(0xc6)];_0x3083cf&&this[_0x40d780(0xe0)][_0x40d780(0x8f)](_0x25e5f7,_0x478891,_0x3083cf['id'],_0x2d8f70[_0x40d780(0xdd)]===I[_0x40d780(0xbe)]);break;}}}));}};p=E([S(0x0,c[_0x57f153(0x84)](b[_0x57f153(0xb5)])),S(0x1,c[_0x57f153(0x84)](M[_0x57f153(0x9e)])),S(0x2,c[_0x57f153(0x84)](c['UserManagerService'])),S(0x3,c[_0x57f153(0x84)](c[_0x57f153(0xe9)]))],p);const q='thread-comment-data-source.config',D={};var A=Object[_0x57f153(0xd6)],x=(_0x503c31,_0x3a9cee,_0x106d15,_0x35895a)=>{const _0x1858f1=_0x57f153;for(var _0x13f3a3=_0x35895a>0x1?void 0x0:_0x35895a?A(_0x3a9cee,_0x106d15):_0x3a9cee,_0x1a3249=_0x503c31[_0x1858f1(0x74)]-0x1,_0x23c3ba;_0x1a3249>=0x0;_0x1a3249--)(_0x23c3ba=_0x503c31[_0x1a3249])&&(_0x13f3a3=_0x23c3ba(_0x13f3a3)||_0x13f3a3);return _0x13f3a3;},_=(_0x2dd997,_0x56c24f)=>(_0xb0ffa2,_0x1413d4)=>_0x56c24f(_0xb0ffa2,_0x1413d4,_0x2dd997);function Y(_0x242c3f,_0x4e0c11){const _0x261c77=_0x57f153,_0x5435a9=_0x242c3f['replies'][0x0];return{..._0x4e0c11,'id':_0x5435a9['replyId'],'resolved':_0x242c3f[_0x261c77(0xdd)]===0x1,'dT':f(_0x5435a9['createTimestamp']),'personId':_0x5435a9['userId'],'threadId':_0x5435a9[_0x261c77(0x90)]};}function G(_0x3e10c3,_0x5b31e8,_0x58f707){const _0x338175=_0x57f153;var _0x16e1e6,_0x5bea08;if(((_0x5bea08=(_0x16e1e6=_0x3e10c3==null?void 0x0:_0x3e10c3[_0x338175(0x98)])==null?void 0x0:_0x16e1e6['length'])!=null?_0x5bea08:0x0)>0x0){const _0x1d8c75=(_0x55d4da,_0x472946)=>({'id':_0x55d4da[_0x338175(0xd4)],'threadId':_0x55d4da['threadId'],'dT':f(_0x55d4da[_0x338175(0xd5)]),'personId':_0x55d4da[_0x338175(0xe3)],'resolved':_0x3e10c3[_0x338175(0xdd)]===I[_0x338175(0xbe)],'unitId':_0x5b31e8,'subUnitId':_0x58f707,'text':JSON['parse'](_0x55d4da['content']),'parentId':_0x472946}),_0x1b69c2=_0x1d8c75(_0x3e10c3[_0x338175(0x98)][0x0]);return{..._0x1b69c2,'children':_0x3e10c3[_0x338175(0x98)][_0x338175(0xb9)](0x1)[_0x338175(0xaf)](_0x13615b=>_0x1d8c75(_0x13615b,_0x1b69c2['id']))};}return null;}let g=class{constructor(_0x4e02ce,_0x2c527d,_0x2fc219,_0x582ca2){const _0x36c6e6=_0x57f153;this[_0x36c6e6(0x86)]=_0x4e02ce,this[_0x36c6e6(0x96)]=_0x2c527d,this[_0x36c6e6(0xc3)]=_0x2fc219,this[_0x36c6e6(0xa8)]=_0x582ca2;}async[_0x57f153(0xd1)](_0x318e12){const _0x2a3de2=_0x57f153;var _0x2d95ac,_0x3c4b1b;const {parentId:_0x36a6aa,unitId:_0x2df06f,text:_0x2b9a04,threadId:_0x19fd09}=_0x318e12,_0x104f59=(_0x3c4b1b=(_0x2d95ac=_0x2b9a04[_0x2a3de2(0xb2)])==null?void 0x0:_0x2d95ac[_0x2a3de2(0x9d)](_0x3a0665=>_0x3a0665['rangeType']===c[_0x2a3de2(0x7d)]['COMMENT'])[_0x2a3de2(0xaf)](_0x26d22e=>_0x26d22e['rangeId']))!=null?_0x3c4b1b:[],_0x3a92eb=JSON['stringify'](_0x2b9a04),_0x4db227=(await this[_0x2a3de2(0xc3)][_0x2a3de2(0xad)](_0x2df06f))['getMemberID']();if(_0x36a6aa){const _0x57e580={'memberId':_0x4db227,'unitId':_0x2df06f,'content':_0x3a92eb,'mention':_0x104f59,'threadId':_0x19fd09},_0x3d56df=(await this['_httpService'][_0x2a3de2(0xba)](_0x2a3de2(0x7f)+_0x2df06f+_0x2a3de2(0x81),{'body':_0x57e580}))[_0x2a3de2(0xdf)][_0x2a3de2(0xcb)];return{..._0x318e12,'id':_0x3d56df['replyId'],'dT':c[_0x2a3de2(0xb1)](+_0x3d56df[_0x2a3de2(0xd5)])[_0x2a3de2(0xb8)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x3d56df['userId']};}else{const _0x570e00={'memberId':_0x4db227,'unitId':_0x2df06f,'content':_0x3a92eb,'mention':_0x104f59},_0x4b6f9c=await this['_httpService'][_0x2a3de2(0xba)](_0x2a3de2(0x7f)+_0x2df06f+_0x2a3de2(0xa5),{'body':_0x570e00});return Y(_0x4b6f9c[_0x2a3de2(0xdf)][_0x2a3de2(0xa1)],_0x318e12);}}async['updateComment'](_0x918751){const _0x2cd9a4=_0x57f153;var _0x1b097d,_0x216aa3;const {text:_0x357be8,unitId:_0x17c38c}=_0x918751,_0x2dc4ea=(_0x216aa3=(_0x1b097d=_0x357be8[_0x2cd9a4(0xb2)])==null?void 0x0:_0x1b097d['filter'](_0x2d7e80=>_0x2d7e80['rangeType']===c[_0x2cd9a4(0x7d)]['COMMENT'])[_0x2cd9a4(0xaf)](_0x22ffc9=>_0x22ffc9[_0x2cd9a4(0xa2)]))!=null?_0x216aa3:[],_0x4e4fc3=JSON[_0x2cd9a4(0x95)](_0x357be8),_0x44fd25=_0x918751['threadId'],_0x15b3e3=_0x918751['id'],_0x12d61b={'memberId':(await this[_0x2cd9a4(0xc3)][_0x2cd9a4(0xad)](_0x17c38c))[_0x2cd9a4(0xa9)](),'unitId':_0x17c38c,'threadId':_0x44fd25,'mention':_0x2dc4ea,'content':_0x4e4fc3,'replyId':_0x15b3e3},_0x9d1bad=await this[_0x2cd9a4(0x86)]['post']('/universer-api/comment/unit/'+_0x17c38c+_0x2cd9a4(0x78),{'body':_0x12d61b});return!_0x9d1bad[_0x2cd9a4(0xdf)][_0x2cd9a4(0x93)]||_0x9d1bad[_0x2cd9a4(0xdf)]['error']['code']===0x1;}async[_0x57f153(0x8f)](_0x1ffa6d){const _0x105c55=_0x57f153,{unitId:_0x211140}=_0x1ffa6d,_0x2ae18c=_0x1ffa6d[_0x105c55(0x90)],_0x53909f={'memberId':this[_0x105c55(0x96)]['getCurrentUser']()[_0x105c55(0x91)],'unitId':_0x211140,'threadId':_0x2ae18c,'solved':_0x1ffa6d[_0x105c55(0xe6)]?I['Solved']:I[_0x105c55(0xc1)]},_0x4f0e17=await this[_0x105c55(0x86)][_0x105c55(0xba)](_0x105c55(0x7f)+_0x211140+'/solved',{'body':_0x53909f});return!_0x4f0e17[_0x105c55(0xdf)]['error']||_0x4f0e17[_0x105c55(0xdf)]['error'][_0x105c55(0xe1)]===0x1;}async[_0x57f153(0xd9)](_0x1e6cda,_0x488c09,_0x16d0d8,_0x4b7734){const _0x28a830=_0x57f153,_0x26c2fc={'memberId':(await this[_0x28a830(0xc3)][_0x28a830(0xad)](_0x1e6cda))[_0x28a830(0xa9)](),'threadId':_0x16d0d8,'replyId':_0x4b7734,'unitId':_0x1e6cda},_0x53e0c3=await this[_0x28a830(0x86)][_0x28a830(0xba)](_0x28a830(0x7f)+_0x1e6cda+_0x28a830(0xc7),{'body':_0x26c2fc});return!_0x53e0c3['body'][_0x28a830(0x93)]||_0x53e0c3[_0x28a830(0xdf)][_0x28a830(0x93)]['code']===0x1;}async['listComments'](_0x304d97,_0x47094a,_0x26b2f5){const _0x56da94=_0x57f153,_0x292394={'unitId':_0x304d97,'threadId':_0x26b2f5},_0x395121=await this[_0x56da94(0x86)][_0x56da94(0xba)](_0x56da94(0x7f)+_0x304d97+'/list',{'body':_0x292394}),_0x37a082=_0x26b2f5[_0x56da94(0xaf)](_0x10f674=>G(_0x395121[_0x56da94(0xdf)][_0x56da94(0x9c)][_0x10f674],_0x304d97,_0x47094a))[_0x56da94(0x9d)](Boolean);return Object['values'](_0x395121[_0x56da94(0xdf)][_0x56da94(0xec)])['forEach'](_0x484dd4=>{const _0x313161=_0x56da94;this['_userService'][_0x313161(0x8c)](_0x484dd4);}),_0x37a082;}[_0x57f153(0x79)](_0x1024e9){const _0x3a9fb8=_0x57f153;return{'id':_0x1024e9['id'],'threadId':_0x1024e9[_0x3a9fb8(0x90)],'ref':_0x1024e9[_0x3a9fb8(0x83)]};}};g=x([_(0x0,c[_0x57f153(0x84)](P[_0x57f153(0xa3)])),_(0x1,c['Inject'](c[_0x57f153(0xae)])),_(0x2,c['Inject'](b[_0x57f153(0xa0)])),_(0x3,c[_0x57f153(0x84)](c[_0x57f153(0xe9)]))],g);var H=Object[_0x57f153(0xd6)],J=(_0x472e52,_0x21165c,_0x41ccd6,_0x200b42)=>{const _0x374087=_0x57f153;for(var _0xae44fe=_0x200b42>0x1?void 0x0:_0x200b42?H(_0x21165c,_0x41ccd6):_0x21165c,_0x308937=_0x472e52[_0x374087(0x74)]-0x1,_0x386364;_0x308937>=0x0;_0x308937--)(_0x386364=_0x472e52[_0x308937])&&(_0xae44fe=_0x386364(_0xae44fe)||_0xae44fe);return _0xae44fe;},y=(_0x3dc01d,_0x3c3b32)=>(_0x20a0a1,_0x33cab1)=>_0x3c3b32(_0x20a0a1,_0x33cab1,_0x3dc01d);let C=class extends c['Disposable']{constructor(_0x9bd1b3,_0x50d5ea){const _0x5a22db=_0x57f153;super(),this['_threadCommentDataSourceService']=_0x9bd1b3,this[_0x5a22db(0xc2)]=_0x50d5ea,this['_initDataSource']();}[_0x57f153(0x8e)](){const _0x2ad3ab=_0x57f153;this[_0x2ad3ab(0x85)]['dataSource']=this[_0x2ad3ab(0xc2)],this['_threadCommentDataSourceService'][_0x2ad3ab(0xb3)]=!0x1;}};C=J([y(0x0,M[_0x57f153(0xab)]),y(0x1,c[_0x57f153(0x84)](g))],C);function _0xcc83(_0x5b400c,_0x33b677){const _0x5648a5=_0x5648();return _0xcc83=function(_0xcc838b,_0x7a968d){_0xcc838b=_0xcc838b-0x73;let _0x14359a=_0x5648a5[_0xcc838b];return _0x14359a;},_0xcc83(_0x5b400c,_0x33b677);}var F=Object['defineProperty'],L=Object['getOwnPropertyDescriptor'],Z=(_0xbf1604,_0x366523,_0x1b3279)=>_0x366523 in _0xbf1604?F(_0xbf1604,_0x366523,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x1b3279}):_0xbf1604[_0x366523]=_0x1b3279,W=(_0x6db242,_0x70b166,_0x50103a,_0x5c03a3)=>{const _0x56a52b=_0x57f153;for(var _0x564a6f=_0x5c03a3>0x1?void 0x0:_0x5c03a3?L(_0x70b166,_0x50103a):_0x70b166,_0x3c5f80=_0x6db242[_0x56a52b(0x74)]-0x1,_0x290c3c;_0x3c5f80>=0x0;_0x3c5f80--)(_0x290c3c=_0x6db242[_0x3c5f80])&&(_0x564a6f=_0x290c3c(_0x564a6f)||_0x564a6f);return _0x564a6f;},O=(_0x3e4fa6,_0x421266)=>(_0x189863,_0x3b8ab5)=>_0x421266(_0x189863,_0x3b8ab5,_0x3e4fa6),N=(_0x53d15c,_0x57402d,_0x223778)=>Z(_0x53d15c,typeof _0x57402d!=_0x57f153(0x77)?_0x57402d+'':_0x57402d,_0x223778);exports[_0x57f153(0xc8)]=class extends c[_0x57f153(0x76)]{constructor(_0x13f657=D,_0x5d66b9,_0x1831e0){const _0x10fcd5=_0x57f153;super(),this['_config']=_0x13f657,this['_injector']=_0x5d66b9,this[_0x10fcd5(0xcc)]=_0x1831e0;const {..._0x2749d7}=c[_0x10fcd5(0x87)]({},D,this[_0x10fcd5(0xde)]);this['_configService']['setConfig'](q,_0x2749d7);}[_0x57f153(0xea)](){const _0xbfb8e0=_0x57f153;[[g],[C],[p]][_0xbfb8e0(0xbd)](_0x10595e=>{const _0x22a383=_0xbfb8e0;this[_0x22a383(0xa8)][_0x22a383(0xdc)](_0x10595e);});}[_0x57f153(0xbc)](){const _0x1d9151=_0x57f153;this[_0x1d9151(0xa8)][_0x1d9151(0x9b)](C),this['_injector'][_0x1d9151(0x9b)](p);}},N(exports[_0x57f153(0xc8)],'pluginName',U),N(exports['UniverThreadCommentDataSourcePlugin'],_0x57f153(0xd7),c[_0x57f153(0xd3)]['UNIVER_UNKNOWN']),exports[_0x57f153(0xc8)]=W([c[_0x57f153(0xa6)](j[_0x57f153(0xd2)],b[_0x57f153(0x7a)],T[_0x57f153(0xb0)]),O(0x1,c[_0x57f153(0x84)](c[_0x57f153(0xe9)])),O(0x2,c[_0x57f153(0xe2)])],exports[_0x57f153(0xc8)]);
|
|
1
|
+
'use strict';const _0x347084=_0x4776;(function(_0x453905,_0x116c3f){const _0x1a6a04=_0x4776,_0x1a4966=_0x453905();while(!![]){try{const _0x88c851=-parseInt(_0x1a6a04(0x248))/0x1+-parseInt(_0x1a6a04(0x20a))/0x2*(-parseInt(_0x1a6a04(0x1f3))/0x3)+-parseInt(_0x1a6a04(0x202))/0x4+parseInt(_0x1a6a04(0x20c))/0x5+-parseInt(_0x1a6a04(0x21e))/0x6*(parseInt(_0x1a6a04(0x234))/0x7)+parseInt(_0x1a6a04(0x1eb))/0x8+-parseInt(_0x1a6a04(0x24d))/0x9;if(_0x88c851===_0x116c3f)break;else _0x1a4966['push'](_0x1a4966['shift']());}catch(_0x45c40e){_0x1a4966['push'](_0x1a4966['shift']());}}}(_0x5ba4,0x42acb));function _0x4776(_0x510854,_0x31bb3b){const _0x5ba441=_0x5ba4();return _0x4776=function(_0x477615,_0x5e53d8){_0x477615=_0x477615-0x1de;let _0xf18d08=_0x5ba441[_0x477615];return _0xf18d08;},_0x4776(_0x510854,_0x31bb3b);}Object[_0x347084(0x240)](exports,Symbol['toStringTag'],{'value':_0x347084(0x1f8)});const b=require('@univerjs-pro/collaboration-client'),T=require('@univerjs-pro/license'),c=require('@univerjs/core'),j=require('@univerjs/thread-comment-ui'),M=require('@univerjs/thread-comment'),w=require('rxjs'),P=require('@univerjs/network'),U='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x4a2390=>(_0x4a2390[_0x4a2390['OpenOrReOpen']=0x0]=_0x347084(0x216),_0x4a2390[_0x4a2390[_0x347084(0x22c)]=0x1]='Solved',_0x4a2390[_0x4a2390[_0x347084(0x24f)]=-0x1]=_0x347084(0x24f),_0x4a2390))(I||{}),v=(_0x1baf7a=>(_0x1baf7a[_0x1baf7a[_0x347084(0x1e6)]=0x0]='Unknown',_0x1baf7a[_0x1baf7a[_0x347084(0x210)]=0x1]=_0x347084(0x210),_0x1baf7a[_0x1baf7a['Reply']=0x2]=_0x347084(0x24c),_0x1baf7a[_0x1baf7a[_0x347084(0x23a)]=0x3]='Edit',_0x1baf7a[_0x1baf7a[_0x347084(0x1e9)]=0x4]=_0x347084(0x1e9),_0x1baf7a[_0x1baf7a[_0x347084(0x1ec)]=0x5]=_0x347084(0x1ec),_0x1baf7a[_0x1baf7a[_0x347084(0x24f)]=-0x1]=_0x347084(0x24f),_0x1baf7a))(v||{});const f=_0x5e5114=>c[_0x347084(0x23e)](new Date(+_0x5e5114))[_0x347084(0x1f0)](_0x347084(0x228)),R=async(_0x1cc0d5,_0x5d52e3)=>{const _0x3b4c8f=_0x347084,_0x2c15cd=_0x1cc0d5[_0x3b4c8f(0x222)](c[_0x3b4c8f(0x241)]),_0x54a0bb=_0x1cc0d5['get'](P['HTTPService']);_0x5d52e3[_0x3b4c8f(0x1e2)](_0x185188=>{const _0xf5e62c=_0x3b4c8f;_0x2c15cd[_0xf5e62c(0x21f)](_0x185188)&&_0x5d52e3[_0xf5e62c(0x215)](_0x185188);}),_0x5d52e3[_0x3b4c8f(0x207)]&&(await _0x54a0bb[_0x3b4c8f(0x222)](_0x3b4c8f(0x230),{'params':{'userIDs':[..._0x5d52e3]}}))[_0x3b4c8f(0x24b)][_0x3b4c8f(0x1e0)][_0x3b4c8f(0x1e2)](_0x32f571=>{const _0x25454b=_0x3b4c8f;_0x32f571&&_0x2c15cd[_0x25454b(0x233)](_0x32f571);});};var $=Object[_0x347084(0x219)],E=(_0x9546db,_0x345c16,_0x26cfa3,_0x302d5a)=>{const _0xbfc91f=_0x347084;for(var _0x37cbba=_0x302d5a>0x1?void 0x0:_0x302d5a?$(_0x345c16,_0x26cfa3):_0x345c16,_0x404259=_0x9546db[_0xbfc91f(0x22e)]-0x1,_0x5b9bcc;_0x404259>=0x0;_0x404259--)(_0x5b9bcc=_0x9546db[_0x404259])&&(_0x37cbba=_0x5b9bcc(_0x37cbba)||_0x37cbba);return _0x37cbba;},S=(_0x24092,_0x47552b)=>(_0x2744ea,_0x1e9742)=>_0x47552b(_0x2744ea,_0x1e9742,_0x24092);let p=class extends c['Disposable']{constructor(_0x73b320,_0x49fac9,_0x2f2eca,_0x144978){const _0x3144bb=_0x347084;super(),this[_0x3144bb(0x21c)]=_0x73b320,this['_threadCommentModel']=_0x49fac9,this[_0x3144bb(0x243)]=_0x2f2eca,this['_injector']=_0x144978,this[_0x3144bb(0x224)](),this[_0x3144bb(0x255)]();}[_0x347084(0x255)](){const _0x461fc5=_0x347084;this['disposeWithMe'](this[_0x461fc5(0x212)]['commentUpdate$'][_0x461fc5(0x223)](w[_0x461fc5(0x1f5)](0x10))[_0x461fc5(0x236)](_0x22cea4=>{const _0x4c3aaa=_0x461fc5,_0x4e92a8=new Set();_0x22cea4[_0x4c3aaa(0x1e2)](_0x225b8c=>{const _0x49e558=_0x4c3aaa;switch(_0x225b8c[_0x49e558(0x242)]){case'add':{const _0x1575e6=_0x225b8c['payload']['personId'];_0x4e92a8[_0x49e558(0x231)](_0x1575e6);break;}}}),R(this['_injector'],_0x4e92a8);}));}['_init'](){const _0x42a141=_0x347084;this[_0x42a141(0x22b)](this[_0x42a141(0x21c)]['commentUpdate$']['subscribe'](async _0xf52fee=>{const _0x2c29be=_0x42a141;var _0x3c3eab,_0x284d80,_0xf67595,_0x5c1784;const _0x1ae3cf=(_0x3c3eab=this['_threadCommentModel'][_0x2c29be(0x22f)](_0xf52fee[_0x2c29be(0x22a)])[_0x2c29be(0x1ed)](_0x56805e=>_0x56805e['threadId']===_0xf52fee[_0x2c29be(0x238)]))==null?void 0x0:_0x3c3eab[_0x2c29be(0x208)];if(!_0x1ae3cf)return;const {unitId:_0xd5b860,subUnitId:_0x3ce8f1}=_0x1ae3cf;switch(_0xf52fee[_0x2c29be(0x1f6)]&&this[_0x2c29be(0x243)][_0x2c29be(0x233)](_0xf52fee[_0x2c29be(0x1f6)]),_0xf52fee[_0x2c29be(0x242)]){case v['Add']:break;case v[_0x2c29be(0x24c)]:{this[_0x2c29be(0x212)]['addComment'](_0xd5b860,_0x3ce8f1,{'unitId':_0xd5b860,'subUnitId':_0x3ce8f1,'ref':'','id':_0xf52fee[_0x2c29be(0x217)],'dT':f(+_0xf52fee['createTimestamp']),'threadId':_0xf52fee[_0x2c29be(0x238)],'personId':(_0xf67595=(_0x284d80=_0xf52fee[_0x2c29be(0x1f6)])==null?void 0x0:_0x284d80[_0x2c29be(0x1f1)])!=null?_0xf67595:_0xf52fee[_0x2c29be(0x225)],'text':JSON[_0x2c29be(0x20b)](_0xf52fee['content']),'parentId':_0x1ae3cf['id']});break;}case v[_0x2c29be(0x1e9)]:{const _0x567d24=this[_0x2c29be(0x212)][_0x2c29be(0x252)](_0xd5b860,_0x3ce8f1,_0xf52fee[_0x2c29be(0x217)]);_0x567d24&&_0x567d24['parentId']&&this[_0x2c29be(0x212)][_0x2c29be(0x1fd)](_0xd5b860,_0x3ce8f1,_0xf52fee[_0x2c29be(0x217)]);break;}case v['Edit']:{this[_0x2c29be(0x212)][_0x2c29be(0x23f)](_0xd5b860,_0x3ce8f1,{'commentId':_0xf52fee[_0x2c29be(0x217)],'text':JSON[_0x2c29be(0x20b)](_0xf52fee[_0x2c29be(0x21d)])});break;}case v[_0x2c29be(0x1ec)]:{const _0x1db5a1=(_0x5c1784=this[_0x2c29be(0x212)]['getUnit'](_0xf52fee['unitId'])[_0x2c29be(0x1ed)](_0x2c67ab=>_0x2c67ab['threadId']===_0xf52fee[_0x2c29be(0x238)]))==null?void 0x0:_0x5c1784[_0x2c29be(0x208)];_0x1db5a1&&this[_0x2c29be(0x212)][_0x2c29be(0x1ef)](_0xd5b860,_0x3ce8f1,_0x1db5a1['id'],_0xf52fee['solved']===I[_0x2c29be(0x22c)]);break;}}}));}};p=E([S(0x0,c[_0x347084(0x235)](b[_0x347084(0x246)])),S(0x1,c[_0x347084(0x235)](M[_0x347084(0x1f7)])),S(0x2,c['Inject'](c[_0x347084(0x241)])),S(0x3,c['Inject'](c[_0x347084(0x213)]))],p);const q=_0x347084(0x21b),D={};var A=Object[_0x347084(0x219)],x=(_0xefb70f,_0x51c742,_0x354ea7,_0x17cd5e)=>{for(var _0x576b40=_0x17cd5e>0x1?void 0x0:_0x17cd5e?A(_0x51c742,_0x354ea7):_0x51c742,_0x5a6bc0=_0xefb70f['length']-0x1,_0x286e47;_0x5a6bc0>=0x0;_0x5a6bc0--)(_0x286e47=_0xefb70f[_0x5a6bc0])&&(_0x576b40=_0x286e47(_0x576b40)||_0x576b40);return _0x576b40;},_=(_0x1b32bf,_0x46e5c3)=>(_0xd94bed,_0x5e117d)=>_0x46e5c3(_0xd94bed,_0x5e117d,_0x1b32bf);function Y(_0x1416b2,_0x24fb53){const _0x177688=_0x347084,_0x3246f9=_0x1416b2[_0x177688(0x1ff)][0x0];return{..._0x24fb53,'id':_0x3246f9[_0x177688(0x217)],'resolved':_0x1416b2[_0x177688(0x203)]===0x1,'dT':f(_0x3246f9[_0x177688(0x251)]),'personId':_0x3246f9[_0x177688(0x225)],'threadId':_0x3246f9[_0x177688(0x238)]};}function _0x5ba4(){const _0x46c5a5=['UNRECOGNIZED','slice','createTimestamp','getComment','error','CustomRangeType','_initUserSync','UniverInstanceType','code','users','/list','forEach','onStarting','rangeId','listComments','Unknown','post','merge','Delete','HTTPService','2538456dSGcGS','Solve','find','UniverThreadCommentDataSourcePlugin','resolveComment','format','userID','/edit','3MGiMGH','_threadCommentDataSource','bufferTime','user','ThreadCommentModel','Module','_initDataSource','setConfig','requireSession','_threadCommentDataSourceService','deleteComment','UniverCollaborationClientPlugin','replies','/add','filter','1531264gtaRaJ','solved','comments','resolved','/delete','size','root','IConfigService','1055732UNRpzH','parse','2289630hOvWQo','UniverThreadCommentUIPlugin','UNIVER_UNKNOWN','onReady','Add','Plugin','_threadCommentModel','Injector','addComment','delete','OpenOrReOpen','replyId','symbol','getOwnPropertyDescriptor','_httpService','thread-comment-data-source.config','_commentService','content','60xrkjwG','getUser','CollaborationSessionService','/universer-api/comment/unit/','get','pipe','_init','userId','Disposable','rangeType','YYYY/MM/DD\x20HH:mm','_sessionService','unitId','disposeWithMe','Solved','_config','length','getUnit','/universer-api/user/list','add','saveCommentToSnapshot','addUser','132146PqiKJb','Inject','subscribe','COMMENT','threadId','UniverLicensePlugin','Edit','syncUpdateMutationToColla','_configService','stringify','dayjs','updateComment','defineProperty','UserManagerService','type','_userService','_injector','comment','CommentService','map','355238mKuJwm','customRanges','pluginName','body','Reply','928494qjwKHk','values'];_0x5ba4=function(){return _0x46c5a5;};return _0x5ba4();}function G(_0x1b59b0,_0x4d3128,_0x38f183){const _0x14ddd8=_0x347084;var _0x39bc04,_0xbdda2a;if(((_0xbdda2a=(_0x39bc04=_0x1b59b0==null?void 0x0:_0x1b59b0['replies'])==null?void 0x0:_0x39bc04[_0x14ddd8(0x22e)])!=null?_0xbdda2a:0x0)>0x0){const _0xcc5ac1=(_0x2ecb91,_0x5c7734)=>({'id':_0x2ecb91[_0x14ddd8(0x217)],'threadId':_0x2ecb91[_0x14ddd8(0x238)],'dT':f(_0x2ecb91[_0x14ddd8(0x251)]),'personId':_0x2ecb91[_0x14ddd8(0x225)],'resolved':_0x1b59b0['solved']===I[_0x14ddd8(0x22c)],'unitId':_0x4d3128,'subUnitId':_0x38f183,'text':JSON['parse'](_0x2ecb91['content']),'parentId':_0x5c7734}),_0x2264a6=_0xcc5ac1(_0x1b59b0[_0x14ddd8(0x1ff)][0x0]);return{..._0x2264a6,'children':_0x1b59b0[_0x14ddd8(0x1ff)][_0x14ddd8(0x250)](0x1)['map'](_0x5507dd=>_0xcc5ac1(_0x5507dd,_0x2264a6['id']))};}return null;}let g=class{constructor(_0x41a525,_0xa7d7bb,_0xe96236,_0x3aa911){const _0x3b83bf=_0x347084;this['_httpService']=_0x41a525,this['_userService']=_0xa7d7bb,this[_0x3b83bf(0x229)]=_0xe96236,this[_0x3b83bf(0x244)]=_0x3aa911;}async[_0x347084(0x214)](_0x4cca6c){const _0x5d3b91=_0x347084;var _0x61f202,_0x2a3729;const {parentId:_0x22ea19,unitId:_0x1f75cb,text:_0x2cf3de,threadId:_0x3e5e85}=_0x4cca6c,_0x3d414e=(_0x2a3729=(_0x61f202=_0x2cf3de[_0x5d3b91(0x249)])==null?void 0x0:_0x61f202['filter'](_0x4d8e0a=>_0x4d8e0a[_0x5d3b91(0x227)]===c['CustomRangeType'][_0x5d3b91(0x237)])['map'](_0x5783d5=>_0x5783d5['rangeId']))!=null?_0x2a3729:[],_0x890c9a=JSON['stringify'](_0x2cf3de),_0x4b93b2=(await this[_0x5d3b91(0x229)][_0x5d3b91(0x1fb)](_0x1f75cb))['getMemberID']();if(_0x22ea19){const _0x202aef={'memberId':_0x4b93b2,'unitId':_0x1f75cb,'content':_0x890c9a,'mention':_0x3d414e,'threadId':_0x3e5e85},_0x2f8d72=(await this['_httpService'][_0x5d3b91(0x1e7)]('/universer-api/comment/unit/'+_0x1f75cb+'/reply',{'body':_0x202aef}))[_0x5d3b91(0x24b)]['reply'];return{..._0x4cca6c,'id':_0x2f8d72[_0x5d3b91(0x217)],'dT':c[_0x5d3b91(0x23e)](+_0x2f8d72['createTimestamp'])[_0x5d3b91(0x1f0)](_0x5d3b91(0x228)),'personId':_0x2f8d72[_0x5d3b91(0x225)]};}else{const _0x1ff11b={'memberId':_0x4b93b2,'unitId':_0x1f75cb,'content':_0x890c9a,'mention':_0x3d414e},_0x36a846=await this[_0x5d3b91(0x21a)][_0x5d3b91(0x1e7)]('/universer-api/comment/unit/'+_0x1f75cb+_0x5d3b91(0x200),{'body':_0x1ff11b});return Y(_0x36a846['body'][_0x5d3b91(0x245)],_0x4cca6c);}}async[_0x347084(0x23f)](_0x3d21dd){const _0x1e648f=_0x347084;var _0xb05680,_0x5311d5;const {text:_0x320d70,unitId:_0x3ff537}=_0x3d21dd,_0x23974d=(_0x5311d5=(_0xb05680=_0x320d70[_0x1e648f(0x249)])==null?void 0x0:_0xb05680[_0x1e648f(0x201)](_0x20d0a4=>_0x20d0a4[_0x1e648f(0x227)]===c[_0x1e648f(0x254)][_0x1e648f(0x237)])['map'](_0x4842f9=>_0x4842f9[_0x1e648f(0x1e4)]))!=null?_0x5311d5:[],_0x5804e8=JSON[_0x1e648f(0x23d)](_0x320d70),_0x484fff=_0x3d21dd['threadId'],_0x438d33=_0x3d21dd['id'],_0x2270ce={'memberId':(await this[_0x1e648f(0x229)]['requireSession'](_0x3ff537))['getMemberID'](),'unitId':_0x3ff537,'threadId':_0x484fff,'mention':_0x23974d,'content':_0x5804e8,'replyId':_0x438d33},_0x4ba91c=await this[_0x1e648f(0x21a)][_0x1e648f(0x1e7)]('/universer-api/comment/unit/'+_0x3ff537+_0x1e648f(0x1f2),{'body':_0x2270ce});return!_0x4ba91c['body']['error']||_0x4ba91c['body']['error'][_0x1e648f(0x1df)]===0x1;}async[_0x347084(0x1ef)](_0x586171){const _0x45e425=_0x347084,{unitId:_0x27d8d6}=_0x586171,_0x17c88e=_0x586171['threadId'],_0x576183={'memberId':this[_0x45e425(0x243)]['getCurrentUser']()['userID'],'unitId':_0x27d8d6,'threadId':_0x17c88e,'solved':_0x586171[_0x45e425(0x205)]?I['Solved']:I[_0x45e425(0x216)]},_0x93b3d5=await this['_httpService'][_0x45e425(0x1e7)]('/universer-api/comment/unit/'+_0x27d8d6+'/solved',{'body':_0x576183});return!_0x93b3d5['body'][_0x45e425(0x253)]||_0x93b3d5['body'][_0x45e425(0x253)][_0x45e425(0x1df)]===0x1;}async[_0x347084(0x1fd)](_0x42c63f,_0x48f6ac,_0x2e4a92,_0x2be286){const _0x4f9d20=_0x347084,_0x5e5d42={'memberId':(await this['_sessionService'][_0x4f9d20(0x1fb)](_0x42c63f))['getMemberID'](),'threadId':_0x2e4a92,'replyId':_0x2be286,'unitId':_0x42c63f},_0x98a617=await this['_httpService'][_0x4f9d20(0x1e7)](_0x4f9d20(0x221)+_0x42c63f+_0x4f9d20(0x206),{'body':_0x5e5d42});return!_0x98a617['body'][_0x4f9d20(0x253)]||_0x98a617[_0x4f9d20(0x24b)]['error'][_0x4f9d20(0x1df)]===0x1;}async[_0x347084(0x1e5)](_0x48038f,_0x43e55c,_0x504017){const _0x400754=_0x347084,_0x4ce622={'unitId':_0x48038f,'threadId':_0x504017},_0x22c09d=await this['_httpService'][_0x400754(0x1e7)](_0x400754(0x221)+_0x48038f+_0x400754(0x1e1),{'body':_0x4ce622}),_0x20904f=_0x504017[_0x400754(0x247)](_0x10cb80=>G(_0x22c09d['body'][_0x400754(0x204)][_0x10cb80],_0x48038f,_0x43e55c))[_0x400754(0x201)](Boolean);return Object[_0x400754(0x24e)](_0x22c09d[_0x400754(0x24b)][_0x400754(0x1e0)])[_0x400754(0x1e2)](_0x85cb91=>{const _0x572345=_0x400754;this[_0x572345(0x243)][_0x572345(0x233)](_0x85cb91);}),_0x20904f;}[_0x347084(0x232)](_0x57a31e){const _0xa5ca16=_0x347084;return{'id':_0x57a31e['id'],'threadId':_0x57a31e[_0xa5ca16(0x238)],'ref':_0x57a31e['ref']};}};g=x([_(0x0,c['Inject'](P[_0x347084(0x1ea)])),_(0x1,c[_0x347084(0x235)](c[_0x347084(0x241)])),_(0x2,c[_0x347084(0x235)](b[_0x347084(0x220)])),_(0x3,c[_0x347084(0x235)](c[_0x347084(0x213)]))],g);var H=Object[_0x347084(0x219)],J=(_0x1429b1,_0x2db0ed,_0x28b031,_0x4f1507)=>{const _0x17438a=_0x347084;for(var _0x531942=_0x4f1507>0x1?void 0x0:_0x4f1507?H(_0x2db0ed,_0x28b031):_0x2db0ed,_0x5335d5=_0x1429b1[_0x17438a(0x22e)]-0x1,_0x1d894a;_0x5335d5>=0x0;_0x5335d5--)(_0x1d894a=_0x1429b1[_0x5335d5])&&(_0x531942=_0x1d894a(_0x531942)||_0x531942);return _0x531942;},y=(_0x19da57,_0x128bcd)=>(_0x17e7cd,_0x585671)=>_0x128bcd(_0x17e7cd,_0x585671,_0x19da57);let C=class extends c[_0x347084(0x226)]{constructor(_0xe65574,_0x3006a1){const _0x280c35=_0x347084;super(),this[_0x280c35(0x1fc)]=_0xe65574,this['_threadCommentDataSource']=_0x3006a1,this[_0x280c35(0x1f9)]();}[_0x347084(0x1f9)](){const _0x22d662=_0x347084;this['_threadCommentDataSourceService']['dataSource']=this[_0x22d662(0x1f4)],this[_0x22d662(0x1fc)][_0x22d662(0x23b)]=!0x1;}};C=J([y(0x0,M['IThreadCommentDataSourceService']),y(0x1,c[_0x347084(0x235)](g))],C);var F=Object['defineProperty'],L=Object['getOwnPropertyDescriptor'],Z=(_0x2eadc3,_0x4100b2,_0x4ac010)=>_0x4100b2 in _0x2eadc3?F(_0x2eadc3,_0x4100b2,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x4ac010}):_0x2eadc3[_0x4100b2]=_0x4ac010,W=(_0x24022d,_0x29b1f5,_0x5eec74,_0x5dcde1)=>{const _0x4fc8ad=_0x347084;for(var _0x8b18dd=_0x5dcde1>0x1?void 0x0:_0x5dcde1?L(_0x29b1f5,_0x5eec74):_0x29b1f5,_0x3b85ef=_0x24022d[_0x4fc8ad(0x22e)]-0x1,_0x57d638;_0x3b85ef>=0x0;_0x3b85ef--)(_0x57d638=_0x24022d[_0x3b85ef])&&(_0x8b18dd=_0x57d638(_0x8b18dd)||_0x8b18dd);return _0x8b18dd;},O=(_0x1580bc,_0x2f746a)=>(_0x4c4df7,_0x35457c)=>_0x2f746a(_0x4c4df7,_0x35457c,_0x1580bc),N=(_0x53ea26,_0x32c70a,_0x3f8c39)=>Z(_0x53ea26,typeof _0x32c70a!=_0x347084(0x218)?_0x32c70a+'':_0x32c70a,_0x3f8c39);exports[_0x347084(0x1ee)]=class extends c[_0x347084(0x211)]{constructor(_0x26b856=D,_0x2a86a0,_0xd27f04){const _0x1837af=_0x347084;super(),this['_config']=_0x26b856,this[_0x1837af(0x244)]=_0x2a86a0,this[_0x1837af(0x23c)]=_0xd27f04;const {..._0x3fe716}=c[_0x1837af(0x1e8)]({},D,this[_0x1837af(0x22d)]);this[_0x1837af(0x23c)][_0x1837af(0x1fa)](q,_0x3fe716);}[_0x347084(0x1e3)](){[[g],[C],[p]]['forEach'](_0x439b7f=>{const _0x5d96ba=_0x4776;this['_injector'][_0x5d96ba(0x231)](_0x439b7f);});}[_0x347084(0x20f)](){const _0x33945a=_0x347084;this[_0x33945a(0x244)][_0x33945a(0x222)](C),this[_0x33945a(0x244)]['get'](p);}},N(exports[_0x347084(0x1ee)],_0x347084(0x24a),U),N(exports['UniverThreadCommentDataSourcePlugin'],_0x347084(0x242),c[_0x347084(0x1de)][_0x347084(0x20e)]),exports[_0x347084(0x1ee)]=W([c['DependentOn'](j[_0x347084(0x20d)],b[_0x347084(0x1fe)],T[_0x347084(0x239)]),O(0x1,c[_0x347084(0x235)](c[_0x347084(0x213)])),O(0x2,c[_0x347084(0x209)])],exports['UniverThreadCommentDataSourcePlugin']);
|
package/lib/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x46d2fa=_0x5ceb;(function(_0x3e207f,_0x1088b3){const _0x20bc28=_0x5ceb,_0x2ad90b=_0x3e207f();while(!![]){try{const _0x4f7ec6=parseInt(_0x20bc28(0x1b3))/0x1+-parseInt(_0x20bc28(0x1cf))/0x2*(parseInt(_0x20bc28(0x1a7))/0x3)+parseInt(_0x20bc28(0x1dc))/0x4+-parseInt(_0x20bc28(0x1ee))/0x5*(-parseInt(_0x20bc28(0x1dd))/0x6)+parseInt(_0x20bc28(0x1c2))/0x7+parseInt(_0x20bc28(0x1a5))/0x8+-parseInt(_0x20bc28(0x1bc))/0x9;if(_0x4f7ec6===_0x1088b3)break;else _0x2ad90b['push'](_0x2ad90b['shift']());}catch(_0xa203da){_0x2ad90b['push'](_0x2ad90b['shift']());}}}(_0x1e5d,0x7736f));function _0x1e5d(){const _0x433806=['_configService','_userService','get','syncUpdateMutationToColla','size','3514772okpvvZ','82590fhhIAW','unitId','updateComment','filter','_threadCommentDataSourceService','getMemberID','_config','/universer-api/comment/unit/','COMMENT','format','body','post','_threadCommentDataSource','find','reply','_injector','getOwnPropertyDescriptor','25szWgfg','_httpService','_init','length','_commentService','payload','slice','/edit','addUser','saveCommentToSnapshot','forEach','_initDataSource','Unknown','UNRECOGNIZED','YYYY/MM/DD\x20HH:mm','UNIVER_UNKNOWN','/universer-api/user/list','/reply','user','getUser','ref','addComment','threadId','resolveComment','2722592APMdOa','Solved','204921YrQnsk','_threadCommentModel','Delete','pluginName','/add','commentUpdate$','map','values','replies','symbol','listComments','/solved','874760iSDZds','subscribe','Edit','root','parse','content','code','customRanges','type','14619438axidjf','add','Solve','createTimestamp','userId','error','2041326qYVcry','userID','users','Add','rangeId','delete','rangeType','Reply','OpenOrReOpen','pipe','_initUserSync','solved','_sessionService','10pYfYFM','personId','replyId','dataSource','comment','setConfig','requireSession','getUnit'];_0x1e5d=function(){return _0x433806;};return _0x1e5d();}import{CommentService as _0x5421d4,CollaborationSessionService as _0x5af098,UniverCollaborationClientPlugin as _0x5405d4}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x2412db}from'@univerjs-pro/license';import{dayjs as _0x149772,UserManagerService as _0x224c99,Inject as _0x50a740,Injector as _0x200e6d,Disposable as _0x27b1be,CustomRangeType as _0x14d9e1,UniverInstanceType as _0x11f02,DependentOn as _0x3b928,IConfigService as _0x5c76a5,Plugin as _0x521887,merge as _0x3abfd9}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x556e2d}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x2a8cea,IThreadCommentDataSourceService as _0x2b2d44}from'@univerjs/thread-comment';import{bufferTime as _0x16ab60}from'rxjs';import{HTTPService as _0x2e7ffa}from'@univerjs/network';const W='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x490fa6=>(_0x490fa6[_0x490fa6[_0x46d2fa(0x1ca)]=0x0]=_0x46d2fa(0x1ca),_0x490fa6[_0x490fa6[_0x46d2fa(0x1a6)]=0x1]='Solved',_0x490fa6[_0x490fa6[_0x46d2fa(0x1fb)]=-0x1]='UNRECOGNIZED',_0x490fa6))(I||{}),v=(_0x9381d8=>(_0x9381d8[_0x9381d8[_0x46d2fa(0x1fa)]=0x0]=_0x46d2fa(0x1fa),_0x9381d8[_0x9381d8['Add']=0x1]=_0x46d2fa(0x1c5),_0x9381d8[_0x9381d8[_0x46d2fa(0x1c9)]=0x2]=_0x46d2fa(0x1c9),_0x9381d8[_0x9381d8[_0x46d2fa(0x1b5)]=0x3]='Edit',_0x9381d8[_0x9381d8[_0x46d2fa(0x1a9)]=0x4]=_0x46d2fa(0x1a9),_0x9381d8[_0x9381d8[_0x46d2fa(0x1be)]=0x5]=_0x46d2fa(0x1be),_0x9381d8[_0x9381d8['UNRECOGNIZED']=-0x1]=_0x46d2fa(0x1fb),_0x9381d8))(v||{});const D=_0x397342=>_0x149772(new Date(+_0x397342))[_0x46d2fa(0x1e6)](_0x46d2fa(0x1fc)),B=async(_0x146543,_0x344315)=>{const _0x22d546=_0x46d2fa,_0x4386e0=_0x146543[_0x22d546(0x1d9)](_0x224c99),_0x594bac=_0x146543[_0x22d546(0x1d9)](_0x2e7ffa);_0x344315[_0x22d546(0x1f8)](_0x56decc=>{const _0x2ddc44=_0x22d546;_0x4386e0[_0x2ddc44(0x1a0)](_0x56decc)&&_0x344315[_0x2ddc44(0x1c7)](_0x56decc);}),_0x344315[_0x22d546(0x1db)]&&(await _0x594bac[_0x22d546(0x1d9)](_0x22d546(0x1fe),{'params':{'userIDs':[..._0x344315]}}))[_0x22d546(0x1e7)]['users'][_0x22d546(0x1f8)](_0x532046=>{const _0x384f86=_0x22d546;_0x532046&&_0x4386e0[_0x384f86(0x1f6)](_0x532046);});};var K=Object[_0x46d2fa(0x1ed)],V=(_0x36fa27,_0x333002,_0x30718e,_0x5d7879)=>{const _0x496164=_0x46d2fa;for(var _0x1d566f=_0x5d7879>0x1?void 0x0:_0x5d7879?K(_0x333002,_0x30718e):_0x333002,_0x4fb6db=_0x36fa27[_0x496164(0x1f1)]-0x1,_0x4b1722;_0x4fb6db>=0x0;_0x4fb6db--)(_0x4b1722=_0x36fa27[_0x4fb6db])&&(_0x1d566f=_0x4b1722(_0x1d566f)||_0x1d566f);return _0x1d566f;},p=(_0x10e41d,_0x1c4127)=>(_0x4698d4,_0x5a95e5)=>_0x1c4127(_0x4698d4,_0x5a95e5,_0x10e41d);let S=class extends _0x27b1be{constructor(_0x2f0b7c,_0x429c17,_0x5af4de,_0x21977d){const _0x5f2de8=_0x46d2fa;super(),this[_0x5f2de8(0x1f2)]=_0x2f0b7c,this[_0x5f2de8(0x1a8)]=_0x429c17,this['_userService']=_0x5af4de,this[_0x5f2de8(0x1ec)]=_0x21977d,this[_0x5f2de8(0x1f0)](),this[_0x5f2de8(0x1cc)]();}['_initUserSync'](){const _0x5ed2ff=_0x46d2fa;this['disposeWithMe'](this['_threadCommentModel'][_0x5ed2ff(0x1ac)][_0x5ed2ff(0x1cb)](_0x16ab60(0x10))['subscribe'](_0x3aa191=>{const _0x5894bf=_0x5ed2ff,_0x36efd3=new Set();_0x3aa191[_0x5894bf(0x1f8)](_0x5527bb=>{const _0x38f8e9=_0x5894bf;switch(_0x5527bb[_0x38f8e9(0x1bb)]){case _0x38f8e9(0x1bd):{const _0x446eeb=_0x5527bb[_0x38f8e9(0x1f3)][_0x38f8e9(0x1d0)];_0x36efd3[_0x38f8e9(0x1bd)](_0x446eeb);break;}}}),B(this[_0x5894bf(0x1ec)],_0x36efd3);}));}[_0x46d2fa(0x1f0)](){const _0x4cbd7c=_0x46d2fa;this['disposeWithMe'](this[_0x4cbd7c(0x1f2)]['commentUpdate$'][_0x4cbd7c(0x1b4)](async _0x3a56fa=>{const _0x13d551=_0x4cbd7c;var _0x1ae10c,_0x27265e,_0x97c46c,_0xed3687;const _0x1e4f61=(_0x1ae10c=this['_threadCommentModel'][_0x13d551(0x1d6)](_0x3a56fa[_0x13d551(0x1de)])[_0x13d551(0x1ea)](_0x27cbf0=>_0x27cbf0['threadId']===_0x3a56fa[_0x13d551(0x1a3)]))==null?void 0x0:_0x1ae10c['root'];if(!_0x1e4f61)return;const {unitId:_0x4a5bea,subUnitId:_0x10fa98}=_0x1e4f61;switch(_0x3a56fa[_0x13d551(0x19f)]&&this[_0x13d551(0x1d8)]['addUser'](_0x3a56fa[_0x13d551(0x19f)]),_0x3a56fa[_0x13d551(0x1bb)]){case v['Add']:break;case v[_0x13d551(0x1c9)]:{this[_0x13d551(0x1a8)][_0x13d551(0x1a2)](_0x4a5bea,_0x10fa98,{'unitId':_0x4a5bea,'subUnitId':_0x10fa98,'ref':'','id':_0x3a56fa[_0x13d551(0x1d1)],'dT':D(+_0x3a56fa[_0x13d551(0x1bf)]),'threadId':_0x3a56fa[_0x13d551(0x1a3)],'personId':(_0x97c46c=(_0x27265e=_0x3a56fa[_0x13d551(0x19f)])==null?void 0x0:_0x27265e[_0x13d551(0x1c3)])!=null?_0x97c46c:_0x3a56fa[_0x13d551(0x1c0)],'text':JSON[_0x13d551(0x1b7)](_0x3a56fa[_0x13d551(0x1b8)]),'parentId':_0x1e4f61['id']});break;}case v[_0x13d551(0x1a9)]:{const _0x1ed07b=this[_0x13d551(0x1a8)]['getComment'](_0x4a5bea,_0x10fa98,_0x3a56fa[_0x13d551(0x1d1)]);_0x1ed07b&&_0x1ed07b['parentId']&&this[_0x13d551(0x1a8)]['deleteComment'](_0x4a5bea,_0x10fa98,_0x3a56fa[_0x13d551(0x1d1)]);break;}case v[_0x13d551(0x1b5)]:{this['_threadCommentModel'][_0x13d551(0x1df)](_0x4a5bea,_0x10fa98,{'commentId':_0x3a56fa[_0x13d551(0x1d1)],'text':JSON[_0x13d551(0x1b7)](_0x3a56fa[_0x13d551(0x1b8)])});break;}case v[_0x13d551(0x1be)]:{const _0x8fca65=(_0xed3687=this[_0x13d551(0x1a8)][_0x13d551(0x1d6)](_0x3a56fa['unitId'])['find'](_0x220b98=>_0x220b98['threadId']===_0x3a56fa['threadId']))==null?void 0x0:_0xed3687[_0x13d551(0x1b6)];_0x8fca65&&this['_threadCommentModel']['resolveComment'](_0x4a5bea,_0x10fa98,_0x8fca65['id'],_0x3a56fa[_0x13d551(0x1cd)]===I[_0x13d551(0x1a6)]);break;}}}));}};S=V([p(0x0,_0x50a740(_0x5421d4)),p(0x1,_0x50a740(_0x2a8cea)),p(0x2,_0x50a740(_0x224c99)),p(0x3,_0x50a740(_0x200e6d))],S);const z='thread-comment-data-source.config',M={};var k=Object[_0x46d2fa(0x1ed)],Q=(_0x4f89bd,_0x141376,_0x38a18b,_0x2eb133)=>{const _0x1ddc4a=_0x46d2fa;for(var _0x391ddb=_0x2eb133>0x1?void 0x0:_0x2eb133?k(_0x141376,_0x38a18b):_0x141376,_0x34e3f1=_0x4f89bd[_0x1ddc4a(0x1f1)]-0x1,_0x2a9f46;_0x34e3f1>=0x0;_0x34e3f1--)(_0x2a9f46=_0x4f89bd[_0x34e3f1])&&(_0x391ddb=_0x2a9f46(_0x391ddb)||_0x391ddb);return _0x391ddb;},_=(_0x1c2bd7,_0xfa69d2)=>(_0x4813b2,_0x13fba6)=>_0xfa69d2(_0x4813b2,_0x13fba6,_0x1c2bd7);function X(_0x17c8b5,_0x47c02d){const _0x5f1080=_0x46d2fa,_0x54b448=_0x17c8b5['replies'][0x0];return{..._0x47c02d,'id':_0x54b448['replyId'],'resolved':_0x17c8b5[_0x5f1080(0x1cd)]===0x1,'dT':D(_0x54b448['createTimestamp']),'personId':_0x54b448[_0x5f1080(0x1c0)],'threadId':_0x54b448[_0x5f1080(0x1a3)]};}function ee(_0x4c0bee,_0x252add,_0x58ee6f){const _0x1b8ed7=_0x46d2fa;var _0x4ab315,_0x1293cc;if(((_0x1293cc=(_0x4ab315=_0x4c0bee==null?void 0x0:_0x4c0bee[_0x1b8ed7(0x1af)])==null?void 0x0:_0x4ab315['length'])!=null?_0x1293cc:0x0)>0x0){const _0x4f71ac=(_0x3025af,_0x145a17)=>({'id':_0x3025af[_0x1b8ed7(0x1d1)],'threadId':_0x3025af[_0x1b8ed7(0x1a3)],'dT':D(_0x3025af[_0x1b8ed7(0x1bf)]),'personId':_0x3025af[_0x1b8ed7(0x1c0)],'resolved':_0x4c0bee[_0x1b8ed7(0x1cd)]===I['Solved'],'unitId':_0x252add,'subUnitId':_0x58ee6f,'text':JSON['parse'](_0x3025af[_0x1b8ed7(0x1b8)]),'parentId':_0x145a17}),_0x18b6ca=_0x4f71ac(_0x4c0bee[_0x1b8ed7(0x1af)][0x0]);return{..._0x18b6ca,'children':_0x4c0bee['replies'][_0x1b8ed7(0x1f4)](0x1)[_0x1b8ed7(0x1ad)](_0x481285=>_0x4f71ac(_0x481285,_0x18b6ca['id']))};}return null;}function _0x5ceb(_0x152dbf,_0x3be14c){const _0x1e5d4f=_0x1e5d();return _0x5ceb=function(_0x5cebb3,_0x3a6146){_0x5cebb3=_0x5cebb3-0x19e;let _0x4f2ea9=_0x1e5d4f[_0x5cebb3];return _0x4f2ea9;},_0x5ceb(_0x152dbf,_0x3be14c);}let f=class{constructor(_0x441fa2,_0x1c9584,_0x21332a,_0x39f9b1){const _0x24e37d=_0x46d2fa;this[_0x24e37d(0x1ef)]=_0x441fa2,this['_userService']=_0x1c9584,this[_0x24e37d(0x1ce)]=_0x21332a,this[_0x24e37d(0x1ec)]=_0x39f9b1;}async[_0x46d2fa(0x1a2)](_0x45f2d3){const _0x56ce23=_0x46d2fa;var _0xb42bc7,_0x49cf89;const {parentId:_0x572ad3,unitId:_0x30f1bc,text:_0x3f4341,threadId:_0x81102d}=_0x45f2d3,_0x750f37=(_0x49cf89=(_0xb42bc7=_0x3f4341[_0x56ce23(0x1ba)])==null?void 0x0:_0xb42bc7[_0x56ce23(0x1e0)](_0x1087eb=>_0x1087eb['rangeType']===_0x14d9e1[_0x56ce23(0x1e5)])[_0x56ce23(0x1ad)](_0x262499=>_0x262499[_0x56ce23(0x1c6)]))!=null?_0x49cf89:[],_0x36c45e=JSON['stringify'](_0x3f4341),_0x1ec53a=(await this[_0x56ce23(0x1ce)]['requireSession'](_0x30f1bc))[_0x56ce23(0x1e2)]();if(_0x572ad3){const _0x3eed3c={'memberId':_0x1ec53a,'unitId':_0x30f1bc,'content':_0x36c45e,'mention':_0x750f37,'threadId':_0x81102d},_0xe9eb9a=(await this[_0x56ce23(0x1ef)]['post'](_0x56ce23(0x1e4)+_0x30f1bc+_0x56ce23(0x19e),{'body':_0x3eed3c}))[_0x56ce23(0x1e7)][_0x56ce23(0x1eb)];return{..._0x45f2d3,'id':_0xe9eb9a[_0x56ce23(0x1d1)],'dT':_0x149772(+_0xe9eb9a[_0x56ce23(0x1bf)])[_0x56ce23(0x1e6)](_0x56ce23(0x1fc)),'personId':_0xe9eb9a[_0x56ce23(0x1c0)]};}else{const _0x59e0f4={'memberId':_0x1ec53a,'unitId':_0x30f1bc,'content':_0x36c45e,'mention':_0x750f37},_0x6494e9=await this['_httpService']['post'](_0x56ce23(0x1e4)+_0x30f1bc+_0x56ce23(0x1ab),{'body':_0x59e0f4});return X(_0x6494e9['body'][_0x56ce23(0x1d3)],_0x45f2d3);}}async[_0x46d2fa(0x1df)](_0x4402b5){const _0x18be6e=_0x46d2fa;var _0x121819,_0x2bf8f3;const {text:_0x1c0f36,unitId:_0x1b47ae}=_0x4402b5,_0x283aec=(_0x2bf8f3=(_0x121819=_0x1c0f36[_0x18be6e(0x1ba)])==null?void 0x0:_0x121819['filter'](_0x1a08dc=>_0x1a08dc[_0x18be6e(0x1c8)]===_0x14d9e1[_0x18be6e(0x1e5)])[_0x18be6e(0x1ad)](_0x50475e=>_0x50475e[_0x18be6e(0x1c6)]))!=null?_0x2bf8f3:[],_0x162ec6=JSON['stringify'](_0x1c0f36),_0x21f6bb=_0x4402b5[_0x18be6e(0x1a3)],_0x6848d7=_0x4402b5['id'],_0x47b15d={'memberId':(await this['_sessionService'][_0x18be6e(0x1d5)](_0x1b47ae))['getMemberID'](),'unitId':_0x1b47ae,'threadId':_0x21f6bb,'mention':_0x283aec,'content':_0x162ec6,'replyId':_0x6848d7},_0x16e733=await this[_0x18be6e(0x1ef)][_0x18be6e(0x1e8)]('/universer-api/comment/unit/'+_0x1b47ae+_0x18be6e(0x1f5),{'body':_0x47b15d});return!_0x16e733[_0x18be6e(0x1e7)]['error']||_0x16e733[_0x18be6e(0x1e7)]['error']['code']===0x1;}async[_0x46d2fa(0x1a4)](_0xac97a6){const _0xeca959=_0x46d2fa,{unitId:_0x359757}=_0xac97a6,_0x2e32be=_0xac97a6[_0xeca959(0x1a3)],_0x33c7be={'memberId':this['_userService']['getCurrentUser']()[_0xeca959(0x1c3)],'unitId':_0x359757,'threadId':_0x2e32be,'solved':_0xac97a6['resolved']?I[_0xeca959(0x1a6)]:I['OpenOrReOpen']},_0x144f01=await this[_0xeca959(0x1ef)][_0xeca959(0x1e8)]('/universer-api/comment/unit/'+_0x359757+_0xeca959(0x1b2),{'body':_0x33c7be});return!_0x144f01[_0xeca959(0x1e7)][_0xeca959(0x1c1)]||_0x144f01['body'][_0xeca959(0x1c1)]['code']===0x1;}async['deleteComment'](_0x3576cc,_0x5bf75f,_0x44000a,_0x33ee22){const _0x31f9f2=_0x46d2fa,_0x26ba08={'memberId':(await this['_sessionService'][_0x31f9f2(0x1d5)](_0x3576cc))[_0x31f9f2(0x1e2)](),'threadId':_0x44000a,'replyId':_0x33ee22,'unitId':_0x3576cc},_0x5203da=await this[_0x31f9f2(0x1ef)][_0x31f9f2(0x1e8)](_0x31f9f2(0x1e4)+_0x3576cc+'/delete',{'body':_0x26ba08});return!_0x5203da['body'][_0x31f9f2(0x1c1)]||_0x5203da[_0x31f9f2(0x1e7)][_0x31f9f2(0x1c1)][_0x31f9f2(0x1b9)]===0x1;}async[_0x46d2fa(0x1b1)](_0x44ae94,_0x2f5ecf,_0x3db479){const _0x4ae777=_0x46d2fa,_0x37eb8e={'unitId':_0x44ae94,'threadId':_0x3db479},_0x8bd8b3=await this[_0x4ae777(0x1ef)][_0x4ae777(0x1e8)](_0x4ae777(0x1e4)+_0x44ae94+'/list',{'body':_0x37eb8e}),_0x320987=_0x3db479['map'](_0x20743d=>ee(_0x8bd8b3['body']['comments'][_0x20743d],_0x44ae94,_0x2f5ecf))[_0x4ae777(0x1e0)](Boolean);return Object[_0x4ae777(0x1ae)](_0x8bd8b3[_0x4ae777(0x1e7)][_0x4ae777(0x1c4)])[_0x4ae777(0x1f8)](_0x1673e7=>{const _0x5dfb80=_0x4ae777;this[_0x5dfb80(0x1d8)]['addUser'](_0x1673e7);}),_0x320987;}[_0x46d2fa(0x1f7)](_0x1eb0cf){const _0x1f6079=_0x46d2fa;return{'id':_0x1eb0cf['id'],'threadId':_0x1eb0cf[_0x1f6079(0x1a3)],'ref':_0x1eb0cf[_0x1f6079(0x1a1)]};}};f=Q([_(0x0,_0x50a740(_0x2e7ffa)),_(0x1,_0x50a740(_0x224c99)),_(0x2,_0x50a740(_0x5af098)),_(0x3,_0x50a740(_0x200e6d))],f);var re=Object[_0x46d2fa(0x1ed)],te=(_0xd1f1d3,_0x5c5474,_0x4a8445,_0x41e9bd)=>{for(var _0x5e241c=_0x41e9bd>0x1?void 0x0:_0x41e9bd?re(_0x5c5474,_0x4a8445):_0x5c5474,_0x32ba60=_0xd1f1d3['length']-0x1,_0x1eeea8;_0x32ba60>=0x0;_0x32ba60--)(_0x1eeea8=_0xd1f1d3[_0x32ba60])&&(_0x5e241c=_0x1eeea8(_0x5e241c)||_0x5e241c);return _0x5e241c;},N=(_0x3f11dc,_0x5790b5)=>(_0x52e7bc,_0x360147)=>_0x5790b5(_0x52e7bc,_0x360147,_0x3f11dc);let g=class extends _0x27b1be{constructor(_0x1108ed,_0x215fc0){const _0x42e3d6=_0x46d2fa;super(),this['_threadCommentDataSourceService']=_0x1108ed,this[_0x42e3d6(0x1e9)]=_0x215fc0,this[_0x42e3d6(0x1f9)]();}[_0x46d2fa(0x1f9)](){const _0x9ab650=_0x46d2fa;this[_0x9ab650(0x1e1)][_0x9ab650(0x1d2)]=this[_0x9ab650(0x1e9)],this['_threadCommentDataSourceService'][_0x9ab650(0x1da)]=!0x1;}};g=te([N(0x0,_0x2b2d44),N(0x1,_0x50a740(f))],g);var se=Object['defineProperty'],oe=Object[_0x46d2fa(0x1ed)],ne=(_0x36c071,_0x3203f6,_0xf7b927)=>_0x3203f6 in _0x36c071?se(_0x36c071,_0x3203f6,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0xf7b927}):_0x36c071[_0x3203f6]=_0xf7b927,ie=(_0x4a34fc,_0x4d8907,_0x559e60,_0x487031)=>{const _0x4b8652=_0x46d2fa;for(var _0x2c619d=_0x487031>0x1?void 0x0:_0x487031?oe(_0x4d8907,_0x559e60):_0x4d8907,_0x34e012=_0x4a34fc[_0x4b8652(0x1f1)]-0x1,_0x5a485b;_0x34e012>=0x0;_0x34e012--)(_0x5a485b=_0x4a34fc[_0x34e012])&&(_0x2c619d=_0x5a485b(_0x2c619d)||_0x2c619d);return _0x2c619d;},w=(_0xb45c13,_0x46ebc6)=>(_0x299847,_0x56551f)=>_0x46ebc6(_0x299847,_0x56551f,_0xb45c13),$=(_0x91929d,_0x211b51,_0x551f48)=>ne(_0x91929d,typeof _0x211b51!=_0x46d2fa(0x1b0)?_0x211b51+'':_0x211b51,_0x551f48);let b=class extends _0x521887{constructor(_0x40f057=M,_0x6e2c3a,_0x34b61f){const _0x2b5167=_0x46d2fa;super(),this[_0x2b5167(0x1e3)]=_0x40f057,this[_0x2b5167(0x1ec)]=_0x6e2c3a,this[_0x2b5167(0x1d7)]=_0x34b61f;const {..._0x525ed0}=_0x3abfd9({},M,this[_0x2b5167(0x1e3)]);this['_configService'][_0x2b5167(0x1d4)](z,_0x525ed0);}['onStarting'](){const _0x582b60=_0x46d2fa;[[f],[g],[S]][_0x582b60(0x1f8)](_0x45cfe7=>{const _0x233275=_0x582b60;this[_0x233275(0x1ec)]['add'](_0x45cfe7);});}['onReady'](){const _0x3c76e2=_0x46d2fa;this[_0x3c76e2(0x1ec)][_0x3c76e2(0x1d9)](g),this[_0x3c76e2(0x1ec)][_0x3c76e2(0x1d9)](S);}};$(b,_0x46d2fa(0x1aa),W),$(b,_0x46d2fa(0x1bb),_0x11f02[_0x46d2fa(0x1fd)]),b=ie([_0x3b928(_0x556e2d,_0x5405d4,_0x2412db),w(0x1,_0x50a740(_0x200e6d)),w(0x2,_0x5c76a5)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0xbf68e1=_0x1c41;(function(_0x2be46d,_0x201409){const _0x166ef4=_0x1c41,_0xe90126=_0x2be46d();while(!![]){try{const _0x18c2e5=parseInt(_0x166ef4(0x148))/0x1+-parseInt(_0x166ef4(0x14b))/0x2*(parseInt(_0x166ef4(0x14e))/0x3)+-parseInt(_0x166ef4(0x130))/0x4*(-parseInt(_0x166ef4(0x17b))/0x5)+parseInt(_0x166ef4(0x165))/0x6+-parseInt(_0x166ef4(0x121))/0x7*(parseInt(_0x166ef4(0x17a))/0x8)+parseInt(_0x166ef4(0x167))/0x9*(parseInt(_0x166ef4(0x14d))/0xa)+-parseInt(_0x166ef4(0x12e))/0xb;if(_0x18c2e5===_0x201409)break;else _0xe90126['push'](_0xe90126['shift']());}catch(_0x55eefc){_0xe90126['push'](_0xe90126['shift']());}}}(_0x39fc,0x3dc1c));import{CommentService as _0x24bf5a,CollaborationSessionService as _0x28cbe3,UniverCollaborationClientPlugin as _0x9525d4}from'@univerjs-pro/collaboration-client';function _0x39fc(){const _0x45054d=['post','_configService','ref','COMMENT','replies','get','getUser','defineProperty','/reply','921930HYOshG','forEach','549QiXcri','rangeType','symbol','Edit','content','user','_threadCommentModel','subscribe','OpenOrReOpen','_initUserSync','pipe','comments','disposeWithMe','parse','_threadCommentDataSourceService','/list','code','getOwnPropertyDescriptor','deleteComment','8cHYvvG','2502155fuuGXf','userId','/universer-api/user/list','slice','_initDataSource','onStarting','customRanges','addUser','Delete','updateComment','map','addComment','delete','getUnit','1170218oiFXSJ','getCurrentUser','body','stringify','length','personId','threadId','UNRECOGNIZED','_userService','userID','users','payload','_sessionService','648197DEFwbZ','add','4LUUVNH','resolveComment','Add','type','values','/solved','comment','setConfig','requireSession','_commentService','replyId','filter','error','/universer-api/comment/unit/','resolved','YYYY/MM/DD\x20HH:mm','getComment','_httpService','listComments','pluginName','root','solved','_config','/edit','138038DmcZue','Reply','/add','64850pfUMdo','Solved','17780OoBxTA','39WcDrPS','Solve','unitId','_injector','commentUpdate$','Unknown','format','_init','getMemberID','_threadCommentDataSource','reply','find','createTimestamp','/delete'];_0x39fc=function(){return _0x45054d;};return _0x39fc();}import{UniverLicensePlugin as _0x864633}from'@univerjs-pro/license';import{dayjs as _0x5e2681,UserManagerService as _0x4eab9e,Inject as _0x4f3a21,Injector as _0x8d5e07,Disposable as _0x5a933e,CustomRangeType as _0x1a431c,UniverInstanceType as _0x536cd8,DependentOn as _0x38802e,IConfigService as _0x350c90,Plugin as _0x32d5ff,merge as _0x40e613}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x4b97b3}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x5aae77,IThreadCommentDataSourceService as _0xe116fb}from'@univerjs/thread-comment';import{bufferTime as _0x363eac}from'rxjs';import{HTTPService as _0x36f428}from'@univerjs/network';const W='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x3b924d=>(_0x3b924d[_0x3b924d['OpenOrReOpen']=0x0]=_0xbf68e1(0x16f),_0x3b924d[_0x3b924d[_0xbf68e1(0x14c)]=0x1]=_0xbf68e1(0x14c),_0x3b924d[_0x3b924d[_0xbf68e1(0x128)]=-0x1]='UNRECOGNIZED',_0x3b924d))(I||{}),v=(_0x3663c9=>(_0x3663c9[_0x3663c9[_0xbf68e1(0x153)]=0x0]='Unknown',_0x3663c9[_0x3663c9[_0xbf68e1(0x132)]=0x1]=_0xbf68e1(0x132),_0x3663c9[_0x3663c9[_0xbf68e1(0x149)]=0x2]='Reply',_0x3663c9[_0x3663c9[_0xbf68e1(0x16a)]=0x3]=_0xbf68e1(0x16a),_0x3663c9[_0x3663c9['Delete']=0x4]=_0xbf68e1(0x11b),_0x3663c9[_0x3663c9[_0xbf68e1(0x14f)]=0x5]='Solve',_0x3663c9[_0x3663c9[_0xbf68e1(0x128)]=-0x1]=_0xbf68e1(0x128),_0x3663c9))(v||{});const D=_0x13cf56=>_0x5e2681(new Date(+_0x13cf56))[_0xbf68e1(0x154)](_0xbf68e1(0x13f)),B=async(_0x2a7abd,_0xe2218c)=>{const _0x28c80b=_0xbf68e1,_0x4eb165=_0x2a7abd[_0x28c80b(0x161)](_0x4eab9e),_0xcb30bd=_0x2a7abd['get'](_0x36f428);_0xe2218c[_0x28c80b(0x166)](_0x4c3a2a=>{const _0x547855=_0x28c80b;_0x4eb165[_0x547855(0x162)](_0x4c3a2a)&&_0xe2218c[_0x547855(0x11f)](_0x4c3a2a);}),_0xe2218c['size']&&(await _0xcb30bd[_0x28c80b(0x161)](_0x28c80b(0x115),{'params':{'userIDs':[..._0xe2218c]}}))[_0x28c80b(0x123)]['users']['forEach'](_0x4e7eba=>{const _0x115dba=_0x28c80b;_0x4e7eba&&_0x4eb165[_0x115dba(0x11a)](_0x4e7eba);});};var K=Object[_0xbf68e1(0x178)],V=(_0x59a755,_0x382e52,_0x3f76e9,_0x5d4827)=>{const _0x3c7999=_0xbf68e1;for(var _0x429bc1=_0x5d4827>0x1?void 0x0:_0x5d4827?K(_0x382e52,_0x3f76e9):_0x382e52,_0x510dc0=_0x59a755[_0x3c7999(0x125)]-0x1,_0x253dc0;_0x510dc0>=0x0;_0x510dc0--)(_0x253dc0=_0x59a755[_0x510dc0])&&(_0x429bc1=_0x253dc0(_0x429bc1)||_0x429bc1);return _0x429bc1;},p=(_0x37ddb4,_0x5082f3)=>(_0x4d8057,_0x105950)=>_0x5082f3(_0x4d8057,_0x105950,_0x37ddb4);function _0x1c41(_0x396f2b,_0x59e721){const _0x39fc90=_0x39fc();return _0x1c41=function(_0x1c41d2,_0x4b933d){_0x1c41d2=_0x1c41d2-0x115;let _0x186892=_0x39fc90[_0x1c41d2];return _0x186892;},_0x1c41(_0x396f2b,_0x59e721);}let S=class extends _0x5a933e{constructor(_0x4e3d93,_0x3cd519,_0x4ab288,_0x1843ee){const _0x4f773d=_0xbf68e1;super(),this[_0x4f773d(0x139)]=_0x4e3d93,this[_0x4f773d(0x16d)]=_0x3cd519,this[_0x4f773d(0x129)]=_0x4ab288,this['_injector']=_0x1843ee,this[_0x4f773d(0x155)](),this[_0x4f773d(0x170)]();}['_initUserSync'](){const _0x1dd83a=_0xbf68e1;this[_0x1dd83a(0x173)](this[_0x1dd83a(0x16d)][_0x1dd83a(0x152)][_0x1dd83a(0x171)](_0x363eac(0x10))[_0x1dd83a(0x16e)](_0x112690=>{const _0x49d524=_0x1dd83a,_0x5479b=new Set();_0x112690[_0x49d524(0x166)](_0x20eec5=>{const _0x3ae9fa=_0x49d524;switch(_0x20eec5['type']){case _0x3ae9fa(0x12f):{const _0x4691de=_0x20eec5[_0x3ae9fa(0x12c)][_0x3ae9fa(0x126)];_0x5479b['add'](_0x4691de);break;}}}),B(this[_0x49d524(0x151)],_0x5479b);}));}[_0xbf68e1(0x155)](){const _0x487e35=_0xbf68e1;this['disposeWithMe'](this[_0x487e35(0x139)][_0x487e35(0x152)][_0x487e35(0x16e)](async _0x41f182=>{const _0x25ec51=_0x487e35;var _0x6e1861,_0x434a5c,_0x47cd03,_0x34fbfb;const _0x191590=(_0x6e1861=this[_0x25ec51(0x16d)][_0x25ec51(0x120)](_0x41f182[_0x25ec51(0x150)])[_0x25ec51(0x159)](_0x205a71=>_0x205a71[_0x25ec51(0x127)]===_0x41f182[_0x25ec51(0x127)]))==null?void 0x0:_0x6e1861[_0x25ec51(0x144)];if(!_0x191590)return;const {unitId:_0x1d2cf4,subUnitId:_0x554e0b}=_0x191590;switch(_0x41f182[_0x25ec51(0x16c)]&&this[_0x25ec51(0x129)][_0x25ec51(0x11a)](_0x41f182[_0x25ec51(0x16c)]),_0x41f182['type']){case v[_0x25ec51(0x132)]:break;case v[_0x25ec51(0x149)]:{this[_0x25ec51(0x16d)]['addComment'](_0x1d2cf4,_0x554e0b,{'unitId':_0x1d2cf4,'subUnitId':_0x554e0b,'ref':'','id':_0x41f182['replyId'],'dT':D(+_0x41f182[_0x25ec51(0x15a)]),'threadId':_0x41f182['threadId'],'personId':(_0x47cd03=(_0x434a5c=_0x41f182[_0x25ec51(0x16c)])==null?void 0x0:_0x434a5c[_0x25ec51(0x12a)])!=null?_0x47cd03:_0x41f182['userId'],'text':JSON[_0x25ec51(0x174)](_0x41f182['content']),'parentId':_0x191590['id']});break;}case v[_0x25ec51(0x11b)]:{const _0x2580ce=this[_0x25ec51(0x16d)][_0x25ec51(0x140)](_0x1d2cf4,_0x554e0b,_0x41f182[_0x25ec51(0x13a)]);_0x2580ce&&_0x2580ce['parentId']&&this[_0x25ec51(0x16d)][_0x25ec51(0x179)](_0x1d2cf4,_0x554e0b,_0x41f182['replyId']);break;}case v[_0x25ec51(0x16a)]:{this['_threadCommentModel'][_0x25ec51(0x11c)](_0x1d2cf4,_0x554e0b,{'commentId':_0x41f182['replyId'],'text':JSON[_0x25ec51(0x174)](_0x41f182['content'])});break;}case v[_0x25ec51(0x14f)]:{const _0x226b6d=(_0x34fbfb=this[_0x25ec51(0x16d)][_0x25ec51(0x120)](_0x41f182[_0x25ec51(0x150)])[_0x25ec51(0x159)](_0x1f0c9c=>_0x1f0c9c[_0x25ec51(0x127)]===_0x41f182['threadId']))==null?void 0x0:_0x34fbfb[_0x25ec51(0x144)];_0x226b6d&&this['_threadCommentModel'][_0x25ec51(0x131)](_0x1d2cf4,_0x554e0b,_0x226b6d['id'],_0x41f182['solved']===I[_0x25ec51(0x14c)]);break;}}}));}};S=V([p(0x0,_0x4f3a21(_0x24bf5a)),p(0x1,_0x4f3a21(_0x5aae77)),p(0x2,_0x4f3a21(_0x4eab9e)),p(0x3,_0x4f3a21(_0x8d5e07))],S);const z='thread-comment-data-source.config',M={};var k=Object['getOwnPropertyDescriptor'],Q=(_0x255c02,_0xa0e69f,_0x25383d,_0x1519fd)=>{for(var _0x32de6a=_0x1519fd>0x1?void 0x0:_0x1519fd?k(_0xa0e69f,_0x25383d):_0xa0e69f,_0x48e18c=_0x255c02['length']-0x1,_0x28dfe3;_0x48e18c>=0x0;_0x48e18c--)(_0x28dfe3=_0x255c02[_0x48e18c])&&(_0x32de6a=_0x28dfe3(_0x32de6a)||_0x32de6a);return _0x32de6a;},_=(_0x3a289f,_0x1d6a32)=>(_0x37f1bb,_0x307b91)=>_0x1d6a32(_0x37f1bb,_0x307b91,_0x3a289f);function X(_0x40bf0a,_0x2abb47){const _0x14012f=_0xbf68e1,_0x217399=_0x40bf0a[_0x14012f(0x160)][0x0];return{..._0x2abb47,'id':_0x217399[_0x14012f(0x13a)],'resolved':_0x40bf0a[_0x14012f(0x145)]===0x1,'dT':D(_0x217399[_0x14012f(0x15a)]),'personId':_0x217399['userId'],'threadId':_0x217399[_0x14012f(0x127)]};}function ee(_0x1f96d6,_0x247b6f,_0x343b81){const _0x215786=_0xbf68e1;var _0x17e4e1,_0xbdea56;if(((_0xbdea56=(_0x17e4e1=_0x1f96d6==null?void 0x0:_0x1f96d6[_0x215786(0x160)])==null?void 0x0:_0x17e4e1[_0x215786(0x125)])!=null?_0xbdea56:0x0)>0x0){const _0x2bf7b7=(_0x8034a4,_0x4857c9)=>({'id':_0x8034a4[_0x215786(0x13a)],'threadId':_0x8034a4[_0x215786(0x127)],'dT':D(_0x8034a4[_0x215786(0x15a)]),'personId':_0x8034a4[_0x215786(0x17c)],'resolved':_0x1f96d6['solved']===I['Solved'],'unitId':_0x247b6f,'subUnitId':_0x343b81,'text':JSON['parse'](_0x8034a4[_0x215786(0x16b)]),'parentId':_0x4857c9}),_0x150b4b=_0x2bf7b7(_0x1f96d6[_0x215786(0x160)][0x0]);return{..._0x150b4b,'children':_0x1f96d6[_0x215786(0x160)][_0x215786(0x116)](0x1)[_0x215786(0x11d)](_0x234aaf=>_0x2bf7b7(_0x234aaf,_0x150b4b['id']))};}return null;}let f=class{constructor(_0xa200ee,_0x1df30a,_0x115f26,_0x2b7729){const _0x363a7c=_0xbf68e1;this[_0x363a7c(0x141)]=_0xa200ee,this[_0x363a7c(0x129)]=_0x1df30a,this[_0x363a7c(0x12d)]=_0x115f26,this[_0x363a7c(0x151)]=_0x2b7729;}async[_0xbf68e1(0x11e)](_0x11e6f4){const _0x3d6a56=_0xbf68e1;var _0x575978,_0x5f24cc;const {parentId:_0x110641,unitId:_0x342b4c,text:_0x252a1a,threadId:_0x400bad}=_0x11e6f4,_0x3bbe0b=(_0x5f24cc=(_0x575978=_0x252a1a[_0x3d6a56(0x119)])==null?void 0x0:_0x575978[_0x3d6a56(0x13b)](_0xe1f76a=>_0xe1f76a[_0x3d6a56(0x168)]===_0x1a431c[_0x3d6a56(0x15f)])['map'](_0xb1f29c=>_0xb1f29c['rangeId']))!=null?_0x5f24cc:[],_0x4ffe3c=JSON[_0x3d6a56(0x124)](_0x252a1a),_0x1e00d7=(await this[_0x3d6a56(0x12d)][_0x3d6a56(0x138)](_0x342b4c))[_0x3d6a56(0x156)]();if(_0x110641){const _0x31797d={'memberId':_0x1e00d7,'unitId':_0x342b4c,'content':_0x4ffe3c,'mention':_0x3bbe0b,'threadId':_0x400bad},_0x1784cc=(await this[_0x3d6a56(0x141)][_0x3d6a56(0x15c)](_0x3d6a56(0x13d)+_0x342b4c+_0x3d6a56(0x164),{'body':_0x31797d}))[_0x3d6a56(0x123)][_0x3d6a56(0x158)];return{..._0x11e6f4,'id':_0x1784cc[_0x3d6a56(0x13a)],'dT':_0x5e2681(+_0x1784cc[_0x3d6a56(0x15a)])[_0x3d6a56(0x154)](_0x3d6a56(0x13f)),'personId':_0x1784cc[_0x3d6a56(0x17c)]};}else{const _0x4f68be={'memberId':_0x1e00d7,'unitId':_0x342b4c,'content':_0x4ffe3c,'mention':_0x3bbe0b},_0x54ebc7=await this['_httpService'][_0x3d6a56(0x15c)]('/universer-api/comment/unit/'+_0x342b4c+_0x3d6a56(0x14a),{'body':_0x4f68be});return X(_0x54ebc7[_0x3d6a56(0x123)][_0x3d6a56(0x136)],_0x11e6f4);}}async['updateComment'](_0x77a8af){const _0x5229b8=_0xbf68e1;var _0x5942eb,_0x57cb38;const {text:_0x376793,unitId:_0x5c14d5}=_0x77a8af,_0x256637=(_0x57cb38=(_0x5942eb=_0x376793[_0x5229b8(0x119)])==null?void 0x0:_0x5942eb[_0x5229b8(0x13b)](_0x4fb5ce=>_0x4fb5ce['rangeType']===_0x1a431c[_0x5229b8(0x15f)])[_0x5229b8(0x11d)](_0x265ea5=>_0x265ea5['rangeId']))!=null?_0x57cb38:[],_0xe22770=JSON['stringify'](_0x376793),_0x58c073=_0x77a8af['threadId'],_0x370bc3=_0x77a8af['id'],_0x15b891={'memberId':(await this[_0x5229b8(0x12d)]['requireSession'](_0x5c14d5))[_0x5229b8(0x156)](),'unitId':_0x5c14d5,'threadId':_0x58c073,'mention':_0x256637,'content':_0xe22770,'replyId':_0x370bc3},_0x2d9d46=await this[_0x5229b8(0x141)][_0x5229b8(0x15c)](_0x5229b8(0x13d)+_0x5c14d5+_0x5229b8(0x147),{'body':_0x15b891});return!_0x2d9d46[_0x5229b8(0x123)][_0x5229b8(0x13c)]||_0x2d9d46[_0x5229b8(0x123)]['error'][_0x5229b8(0x177)]===0x1;}async[_0xbf68e1(0x131)](_0x47a996){const _0x1a038d=_0xbf68e1,{unitId:_0x476854}=_0x47a996,_0x339186=_0x47a996[_0x1a038d(0x127)],_0x2ba622={'memberId':this[_0x1a038d(0x129)][_0x1a038d(0x122)]()[_0x1a038d(0x12a)],'unitId':_0x476854,'threadId':_0x339186,'solved':_0x47a996[_0x1a038d(0x13e)]?I[_0x1a038d(0x14c)]:I['OpenOrReOpen']},_0x10bddc=await this[_0x1a038d(0x141)][_0x1a038d(0x15c)](_0x1a038d(0x13d)+_0x476854+_0x1a038d(0x135),{'body':_0x2ba622});return!_0x10bddc[_0x1a038d(0x123)][_0x1a038d(0x13c)]||_0x10bddc[_0x1a038d(0x123)][_0x1a038d(0x13c)]['code']===0x1;}async['deleteComment'](_0x3347b2,_0x2033d4,_0x1ef2bf,_0x29ebd5){const _0x344709=_0xbf68e1,_0x575194={'memberId':(await this['_sessionService'][_0x344709(0x138)](_0x3347b2))['getMemberID'](),'threadId':_0x1ef2bf,'replyId':_0x29ebd5,'unitId':_0x3347b2},_0x5e4cf6=await this[_0x344709(0x141)][_0x344709(0x15c)](_0x344709(0x13d)+_0x3347b2+_0x344709(0x15b),{'body':_0x575194});return!_0x5e4cf6[_0x344709(0x123)][_0x344709(0x13c)]||_0x5e4cf6['body'][_0x344709(0x13c)][_0x344709(0x177)]===0x1;}async[_0xbf68e1(0x142)](_0x42e936,_0x3cd446,_0x3e4fd3){const _0x1d2485=_0xbf68e1,_0xcf860f={'unitId':_0x42e936,'threadId':_0x3e4fd3},_0x1b0b49=await this[_0x1d2485(0x141)][_0x1d2485(0x15c)](_0x1d2485(0x13d)+_0x42e936+_0x1d2485(0x176),{'body':_0xcf860f}),_0x56c260=_0x3e4fd3[_0x1d2485(0x11d)](_0x46a2e1=>ee(_0x1b0b49[_0x1d2485(0x123)][_0x1d2485(0x172)][_0x46a2e1],_0x42e936,_0x3cd446))[_0x1d2485(0x13b)](Boolean);return Object[_0x1d2485(0x134)](_0x1b0b49[_0x1d2485(0x123)][_0x1d2485(0x12b)])[_0x1d2485(0x166)](_0x30ca58=>{const _0x256439=_0x1d2485;this[_0x256439(0x129)]['addUser'](_0x30ca58);}),_0x56c260;}['saveCommentToSnapshot'](_0x78d2e0){const _0x3a3e19=_0xbf68e1;return{'id':_0x78d2e0['id'],'threadId':_0x78d2e0['threadId'],'ref':_0x78d2e0[_0x3a3e19(0x15e)]};}};f=Q([_(0x0,_0x4f3a21(_0x36f428)),_(0x1,_0x4f3a21(_0x4eab9e)),_(0x2,_0x4f3a21(_0x28cbe3)),_(0x3,_0x4f3a21(_0x8d5e07))],f);var re=Object[_0xbf68e1(0x178)],te=(_0x5845b6,_0x46f690,_0x52b141,_0x453933)=>{const _0x11a8a0=_0xbf68e1;for(var _0x59b20d=_0x453933>0x1?void 0x0:_0x453933?re(_0x46f690,_0x52b141):_0x46f690,_0x4c4aa6=_0x5845b6[_0x11a8a0(0x125)]-0x1,_0x47346c;_0x4c4aa6>=0x0;_0x4c4aa6--)(_0x47346c=_0x5845b6[_0x4c4aa6])&&(_0x59b20d=_0x47346c(_0x59b20d)||_0x59b20d);return _0x59b20d;},N=(_0x19e5d2,_0x1686db)=>(_0x4d9ef4,_0x4d4a0b)=>_0x1686db(_0x4d9ef4,_0x4d4a0b,_0x19e5d2);let g=class extends _0x5a933e{constructor(_0x1386e0,_0x411940){const _0x2bb172=_0xbf68e1;super(),this[_0x2bb172(0x175)]=_0x1386e0,this['_threadCommentDataSource']=_0x411940,this[_0x2bb172(0x117)]();}[_0xbf68e1(0x117)](){const _0x4e4959=_0xbf68e1;this[_0x4e4959(0x175)]['dataSource']=this[_0x4e4959(0x157)],this[_0x4e4959(0x175)]['syncUpdateMutationToColla']=!0x1;}};g=te([N(0x0,_0xe116fb),N(0x1,_0x4f3a21(f))],g);var se=Object[_0xbf68e1(0x163)],oe=Object['getOwnPropertyDescriptor'],ne=(_0x112488,_0x361639,_0x2ca661)=>_0x361639 in _0x112488?se(_0x112488,_0x361639,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x2ca661}):_0x112488[_0x361639]=_0x2ca661,ie=(_0x3a3ca9,_0x1d8911,_0x27bba6,_0x1b3536)=>{const _0x6ec18d=_0xbf68e1;for(var _0x1fe28f=_0x1b3536>0x1?void 0x0:_0x1b3536?oe(_0x1d8911,_0x27bba6):_0x1d8911,_0x482e95=_0x3a3ca9[_0x6ec18d(0x125)]-0x1,_0x5d22af;_0x482e95>=0x0;_0x482e95--)(_0x5d22af=_0x3a3ca9[_0x482e95])&&(_0x1fe28f=_0x5d22af(_0x1fe28f)||_0x1fe28f);return _0x1fe28f;},w=(_0x113109,_0x126625)=>(_0x2189b3,_0x5ffa6f)=>_0x126625(_0x2189b3,_0x5ffa6f,_0x113109),$=(_0x11a43c,_0x456808,_0x189106)=>ne(_0x11a43c,typeof _0x456808!=_0xbf68e1(0x169)?_0x456808+'':_0x456808,_0x189106);let b=class extends _0x32d5ff{constructor(_0xb71a87=M,_0x17be08,_0x11d6f2){const _0x4d9ffd=_0xbf68e1;super(),this[_0x4d9ffd(0x146)]=_0xb71a87,this[_0x4d9ffd(0x151)]=_0x17be08,this[_0x4d9ffd(0x15d)]=_0x11d6f2;const {..._0x18e461}=_0x40e613({},M,this[_0x4d9ffd(0x146)]);this['_configService'][_0x4d9ffd(0x137)](z,_0x18e461);}[_0xbf68e1(0x118)](){const _0x3ad986=_0xbf68e1;[[f],[g],[S]][_0x3ad986(0x166)](_0x28bc58=>{const _0x3ca970=_0x3ad986;this[_0x3ca970(0x151)][_0x3ca970(0x12f)](_0x28bc58);});}['onReady'](){const _0x8738b8=_0xbf68e1;this[_0x8738b8(0x151)][_0x8738b8(0x161)](g),this[_0x8738b8(0x151)][_0x8738b8(0x161)](S);}};$(b,_0xbf68e1(0x143),W),$(b,_0xbf68e1(0x133),_0x536cd8['UNIVER_UNKNOWN']),b=ie([_0x38802e(_0x4b97b3,_0x9525d4,_0x864633),w(0x1,_0x4f3a21(_0x8d5e07)),w(0x2,_0x350c90)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x46d2fa=_0x5ceb;(function(_0x3e207f,_0x1088b3){const _0x20bc28=_0x5ceb,_0x2ad90b=_0x3e207f();while(!![]){try{const _0x4f7ec6=parseInt(_0x20bc28(0x1b3))/0x1+-parseInt(_0x20bc28(0x1cf))/0x2*(parseInt(_0x20bc28(0x1a7))/0x3)+parseInt(_0x20bc28(0x1dc))/0x4+-parseInt(_0x20bc28(0x1ee))/0x5*(-parseInt(_0x20bc28(0x1dd))/0x6)+parseInt(_0x20bc28(0x1c2))/0x7+parseInt(_0x20bc28(0x1a5))/0x8+-parseInt(_0x20bc28(0x1bc))/0x9;if(_0x4f7ec6===_0x1088b3)break;else _0x2ad90b['push'](_0x2ad90b['shift']());}catch(_0xa203da){_0x2ad90b['push'](_0x2ad90b['shift']());}}}(_0x1e5d,0x7736f));function _0x1e5d(){const _0x433806=['_configService','_userService','get','syncUpdateMutationToColla','size','3514772okpvvZ','82590fhhIAW','unitId','updateComment','filter','_threadCommentDataSourceService','getMemberID','_config','/universer-api/comment/unit/','COMMENT','format','body','post','_threadCommentDataSource','find','reply','_injector','getOwnPropertyDescriptor','25szWgfg','_httpService','_init','length','_commentService','payload','slice','/edit','addUser','saveCommentToSnapshot','forEach','_initDataSource','Unknown','UNRECOGNIZED','YYYY/MM/DD\x20HH:mm','UNIVER_UNKNOWN','/universer-api/user/list','/reply','user','getUser','ref','addComment','threadId','resolveComment','2722592APMdOa','Solved','204921YrQnsk','_threadCommentModel','Delete','pluginName','/add','commentUpdate$','map','values','replies','symbol','listComments','/solved','874760iSDZds','subscribe','Edit','root','parse','content','code','customRanges','type','14619438axidjf','add','Solve','createTimestamp','userId','error','2041326qYVcry','userID','users','Add','rangeId','delete','rangeType','Reply','OpenOrReOpen','pipe','_initUserSync','solved','_sessionService','10pYfYFM','personId','replyId','dataSource','comment','setConfig','requireSession','getUnit'];_0x1e5d=function(){return _0x433806;};return _0x1e5d();}import{CommentService as _0x5421d4,CollaborationSessionService as _0x5af098,UniverCollaborationClientPlugin as _0x5405d4}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x2412db}from'@univerjs-pro/license';import{dayjs as _0x149772,UserManagerService as _0x224c99,Inject as _0x50a740,Injector as _0x200e6d,Disposable as _0x27b1be,CustomRangeType as _0x14d9e1,UniverInstanceType as _0x11f02,DependentOn as _0x3b928,IConfigService as _0x5c76a5,Plugin as _0x521887,merge as _0x3abfd9}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x556e2d}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x2a8cea,IThreadCommentDataSourceService as _0x2b2d44}from'@univerjs/thread-comment';import{bufferTime as _0x16ab60}from'rxjs';import{HTTPService as _0x2e7ffa}from'@univerjs/network';const W='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x490fa6=>(_0x490fa6[_0x490fa6[_0x46d2fa(0x1ca)]=0x0]=_0x46d2fa(0x1ca),_0x490fa6[_0x490fa6[_0x46d2fa(0x1a6)]=0x1]='Solved',_0x490fa6[_0x490fa6[_0x46d2fa(0x1fb)]=-0x1]='UNRECOGNIZED',_0x490fa6))(I||{}),v=(_0x9381d8=>(_0x9381d8[_0x9381d8[_0x46d2fa(0x1fa)]=0x0]=_0x46d2fa(0x1fa),_0x9381d8[_0x9381d8['Add']=0x1]=_0x46d2fa(0x1c5),_0x9381d8[_0x9381d8[_0x46d2fa(0x1c9)]=0x2]=_0x46d2fa(0x1c9),_0x9381d8[_0x9381d8[_0x46d2fa(0x1b5)]=0x3]='Edit',_0x9381d8[_0x9381d8[_0x46d2fa(0x1a9)]=0x4]=_0x46d2fa(0x1a9),_0x9381d8[_0x9381d8[_0x46d2fa(0x1be)]=0x5]=_0x46d2fa(0x1be),_0x9381d8[_0x9381d8['UNRECOGNIZED']=-0x1]=_0x46d2fa(0x1fb),_0x9381d8))(v||{});const D=_0x397342=>_0x149772(new Date(+_0x397342))[_0x46d2fa(0x1e6)](_0x46d2fa(0x1fc)),B=async(_0x146543,_0x344315)=>{const _0x22d546=_0x46d2fa,_0x4386e0=_0x146543[_0x22d546(0x1d9)](_0x224c99),_0x594bac=_0x146543[_0x22d546(0x1d9)](_0x2e7ffa);_0x344315[_0x22d546(0x1f8)](_0x56decc=>{const _0x2ddc44=_0x22d546;_0x4386e0[_0x2ddc44(0x1a0)](_0x56decc)&&_0x344315[_0x2ddc44(0x1c7)](_0x56decc);}),_0x344315[_0x22d546(0x1db)]&&(await _0x594bac[_0x22d546(0x1d9)](_0x22d546(0x1fe),{'params':{'userIDs':[..._0x344315]}}))[_0x22d546(0x1e7)]['users'][_0x22d546(0x1f8)](_0x532046=>{const _0x384f86=_0x22d546;_0x532046&&_0x4386e0[_0x384f86(0x1f6)](_0x532046);});};var K=Object[_0x46d2fa(0x1ed)],V=(_0x36fa27,_0x333002,_0x30718e,_0x5d7879)=>{const _0x496164=_0x46d2fa;for(var _0x1d566f=_0x5d7879>0x1?void 0x0:_0x5d7879?K(_0x333002,_0x30718e):_0x333002,_0x4fb6db=_0x36fa27[_0x496164(0x1f1)]-0x1,_0x4b1722;_0x4fb6db>=0x0;_0x4fb6db--)(_0x4b1722=_0x36fa27[_0x4fb6db])&&(_0x1d566f=_0x4b1722(_0x1d566f)||_0x1d566f);return _0x1d566f;},p=(_0x10e41d,_0x1c4127)=>(_0x4698d4,_0x5a95e5)=>_0x1c4127(_0x4698d4,_0x5a95e5,_0x10e41d);let S=class extends _0x27b1be{constructor(_0x2f0b7c,_0x429c17,_0x5af4de,_0x21977d){const _0x5f2de8=_0x46d2fa;super(),this[_0x5f2de8(0x1f2)]=_0x2f0b7c,this[_0x5f2de8(0x1a8)]=_0x429c17,this['_userService']=_0x5af4de,this[_0x5f2de8(0x1ec)]=_0x21977d,this[_0x5f2de8(0x1f0)](),this[_0x5f2de8(0x1cc)]();}['_initUserSync'](){const _0x5ed2ff=_0x46d2fa;this['disposeWithMe'](this['_threadCommentModel'][_0x5ed2ff(0x1ac)][_0x5ed2ff(0x1cb)](_0x16ab60(0x10))['subscribe'](_0x3aa191=>{const _0x5894bf=_0x5ed2ff,_0x36efd3=new Set();_0x3aa191[_0x5894bf(0x1f8)](_0x5527bb=>{const _0x38f8e9=_0x5894bf;switch(_0x5527bb[_0x38f8e9(0x1bb)]){case _0x38f8e9(0x1bd):{const _0x446eeb=_0x5527bb[_0x38f8e9(0x1f3)][_0x38f8e9(0x1d0)];_0x36efd3[_0x38f8e9(0x1bd)](_0x446eeb);break;}}}),B(this[_0x5894bf(0x1ec)],_0x36efd3);}));}[_0x46d2fa(0x1f0)](){const _0x4cbd7c=_0x46d2fa;this['disposeWithMe'](this[_0x4cbd7c(0x1f2)]['commentUpdate$'][_0x4cbd7c(0x1b4)](async _0x3a56fa=>{const _0x13d551=_0x4cbd7c;var _0x1ae10c,_0x27265e,_0x97c46c,_0xed3687;const _0x1e4f61=(_0x1ae10c=this['_threadCommentModel'][_0x13d551(0x1d6)](_0x3a56fa[_0x13d551(0x1de)])[_0x13d551(0x1ea)](_0x27cbf0=>_0x27cbf0['threadId']===_0x3a56fa[_0x13d551(0x1a3)]))==null?void 0x0:_0x1ae10c['root'];if(!_0x1e4f61)return;const {unitId:_0x4a5bea,subUnitId:_0x10fa98}=_0x1e4f61;switch(_0x3a56fa[_0x13d551(0x19f)]&&this[_0x13d551(0x1d8)]['addUser'](_0x3a56fa[_0x13d551(0x19f)]),_0x3a56fa[_0x13d551(0x1bb)]){case v['Add']:break;case v[_0x13d551(0x1c9)]:{this[_0x13d551(0x1a8)][_0x13d551(0x1a2)](_0x4a5bea,_0x10fa98,{'unitId':_0x4a5bea,'subUnitId':_0x10fa98,'ref':'','id':_0x3a56fa[_0x13d551(0x1d1)],'dT':D(+_0x3a56fa[_0x13d551(0x1bf)]),'threadId':_0x3a56fa[_0x13d551(0x1a3)],'personId':(_0x97c46c=(_0x27265e=_0x3a56fa[_0x13d551(0x19f)])==null?void 0x0:_0x27265e[_0x13d551(0x1c3)])!=null?_0x97c46c:_0x3a56fa[_0x13d551(0x1c0)],'text':JSON[_0x13d551(0x1b7)](_0x3a56fa[_0x13d551(0x1b8)]),'parentId':_0x1e4f61['id']});break;}case v[_0x13d551(0x1a9)]:{const _0x1ed07b=this[_0x13d551(0x1a8)]['getComment'](_0x4a5bea,_0x10fa98,_0x3a56fa[_0x13d551(0x1d1)]);_0x1ed07b&&_0x1ed07b['parentId']&&this[_0x13d551(0x1a8)]['deleteComment'](_0x4a5bea,_0x10fa98,_0x3a56fa[_0x13d551(0x1d1)]);break;}case v[_0x13d551(0x1b5)]:{this['_threadCommentModel'][_0x13d551(0x1df)](_0x4a5bea,_0x10fa98,{'commentId':_0x3a56fa[_0x13d551(0x1d1)],'text':JSON[_0x13d551(0x1b7)](_0x3a56fa[_0x13d551(0x1b8)])});break;}case v[_0x13d551(0x1be)]:{const _0x8fca65=(_0xed3687=this[_0x13d551(0x1a8)][_0x13d551(0x1d6)](_0x3a56fa['unitId'])['find'](_0x220b98=>_0x220b98['threadId']===_0x3a56fa['threadId']))==null?void 0x0:_0xed3687[_0x13d551(0x1b6)];_0x8fca65&&this['_threadCommentModel']['resolveComment'](_0x4a5bea,_0x10fa98,_0x8fca65['id'],_0x3a56fa[_0x13d551(0x1cd)]===I[_0x13d551(0x1a6)]);break;}}}));}};S=V([p(0x0,_0x50a740(_0x5421d4)),p(0x1,_0x50a740(_0x2a8cea)),p(0x2,_0x50a740(_0x224c99)),p(0x3,_0x50a740(_0x200e6d))],S);const z='thread-comment-data-source.config',M={};var k=Object[_0x46d2fa(0x1ed)],Q=(_0x4f89bd,_0x141376,_0x38a18b,_0x2eb133)=>{const _0x1ddc4a=_0x46d2fa;for(var _0x391ddb=_0x2eb133>0x1?void 0x0:_0x2eb133?k(_0x141376,_0x38a18b):_0x141376,_0x34e3f1=_0x4f89bd[_0x1ddc4a(0x1f1)]-0x1,_0x2a9f46;_0x34e3f1>=0x0;_0x34e3f1--)(_0x2a9f46=_0x4f89bd[_0x34e3f1])&&(_0x391ddb=_0x2a9f46(_0x391ddb)||_0x391ddb);return _0x391ddb;},_=(_0x1c2bd7,_0xfa69d2)=>(_0x4813b2,_0x13fba6)=>_0xfa69d2(_0x4813b2,_0x13fba6,_0x1c2bd7);function X(_0x17c8b5,_0x47c02d){const _0x5f1080=_0x46d2fa,_0x54b448=_0x17c8b5['replies'][0x0];return{..._0x47c02d,'id':_0x54b448['replyId'],'resolved':_0x17c8b5[_0x5f1080(0x1cd)]===0x1,'dT':D(_0x54b448['createTimestamp']),'personId':_0x54b448[_0x5f1080(0x1c0)],'threadId':_0x54b448[_0x5f1080(0x1a3)]};}function ee(_0x4c0bee,_0x252add,_0x58ee6f){const _0x1b8ed7=_0x46d2fa;var _0x4ab315,_0x1293cc;if(((_0x1293cc=(_0x4ab315=_0x4c0bee==null?void 0x0:_0x4c0bee[_0x1b8ed7(0x1af)])==null?void 0x0:_0x4ab315['length'])!=null?_0x1293cc:0x0)>0x0){const _0x4f71ac=(_0x3025af,_0x145a17)=>({'id':_0x3025af[_0x1b8ed7(0x1d1)],'threadId':_0x3025af[_0x1b8ed7(0x1a3)],'dT':D(_0x3025af[_0x1b8ed7(0x1bf)]),'personId':_0x3025af[_0x1b8ed7(0x1c0)],'resolved':_0x4c0bee[_0x1b8ed7(0x1cd)]===I['Solved'],'unitId':_0x252add,'subUnitId':_0x58ee6f,'text':JSON['parse'](_0x3025af[_0x1b8ed7(0x1b8)]),'parentId':_0x145a17}),_0x18b6ca=_0x4f71ac(_0x4c0bee[_0x1b8ed7(0x1af)][0x0]);return{..._0x18b6ca,'children':_0x4c0bee['replies'][_0x1b8ed7(0x1f4)](0x1)[_0x1b8ed7(0x1ad)](_0x481285=>_0x4f71ac(_0x481285,_0x18b6ca['id']))};}return null;}function _0x5ceb(_0x152dbf,_0x3be14c){const _0x1e5d4f=_0x1e5d();return _0x5ceb=function(_0x5cebb3,_0x3a6146){_0x5cebb3=_0x5cebb3-0x19e;let _0x4f2ea9=_0x1e5d4f[_0x5cebb3];return _0x4f2ea9;},_0x5ceb(_0x152dbf,_0x3be14c);}let f=class{constructor(_0x441fa2,_0x1c9584,_0x21332a,_0x39f9b1){const _0x24e37d=_0x46d2fa;this[_0x24e37d(0x1ef)]=_0x441fa2,this['_userService']=_0x1c9584,this[_0x24e37d(0x1ce)]=_0x21332a,this[_0x24e37d(0x1ec)]=_0x39f9b1;}async[_0x46d2fa(0x1a2)](_0x45f2d3){const _0x56ce23=_0x46d2fa;var _0xb42bc7,_0x49cf89;const {parentId:_0x572ad3,unitId:_0x30f1bc,text:_0x3f4341,threadId:_0x81102d}=_0x45f2d3,_0x750f37=(_0x49cf89=(_0xb42bc7=_0x3f4341[_0x56ce23(0x1ba)])==null?void 0x0:_0xb42bc7[_0x56ce23(0x1e0)](_0x1087eb=>_0x1087eb['rangeType']===_0x14d9e1[_0x56ce23(0x1e5)])[_0x56ce23(0x1ad)](_0x262499=>_0x262499[_0x56ce23(0x1c6)]))!=null?_0x49cf89:[],_0x36c45e=JSON['stringify'](_0x3f4341),_0x1ec53a=(await this[_0x56ce23(0x1ce)]['requireSession'](_0x30f1bc))[_0x56ce23(0x1e2)]();if(_0x572ad3){const _0x3eed3c={'memberId':_0x1ec53a,'unitId':_0x30f1bc,'content':_0x36c45e,'mention':_0x750f37,'threadId':_0x81102d},_0xe9eb9a=(await this[_0x56ce23(0x1ef)]['post'](_0x56ce23(0x1e4)+_0x30f1bc+_0x56ce23(0x19e),{'body':_0x3eed3c}))[_0x56ce23(0x1e7)][_0x56ce23(0x1eb)];return{..._0x45f2d3,'id':_0xe9eb9a[_0x56ce23(0x1d1)],'dT':_0x149772(+_0xe9eb9a[_0x56ce23(0x1bf)])[_0x56ce23(0x1e6)](_0x56ce23(0x1fc)),'personId':_0xe9eb9a[_0x56ce23(0x1c0)]};}else{const _0x59e0f4={'memberId':_0x1ec53a,'unitId':_0x30f1bc,'content':_0x36c45e,'mention':_0x750f37},_0x6494e9=await this['_httpService']['post'](_0x56ce23(0x1e4)+_0x30f1bc+_0x56ce23(0x1ab),{'body':_0x59e0f4});return X(_0x6494e9['body'][_0x56ce23(0x1d3)],_0x45f2d3);}}async[_0x46d2fa(0x1df)](_0x4402b5){const _0x18be6e=_0x46d2fa;var _0x121819,_0x2bf8f3;const {text:_0x1c0f36,unitId:_0x1b47ae}=_0x4402b5,_0x283aec=(_0x2bf8f3=(_0x121819=_0x1c0f36[_0x18be6e(0x1ba)])==null?void 0x0:_0x121819['filter'](_0x1a08dc=>_0x1a08dc[_0x18be6e(0x1c8)]===_0x14d9e1[_0x18be6e(0x1e5)])[_0x18be6e(0x1ad)](_0x50475e=>_0x50475e[_0x18be6e(0x1c6)]))!=null?_0x2bf8f3:[],_0x162ec6=JSON['stringify'](_0x1c0f36),_0x21f6bb=_0x4402b5[_0x18be6e(0x1a3)],_0x6848d7=_0x4402b5['id'],_0x47b15d={'memberId':(await this['_sessionService'][_0x18be6e(0x1d5)](_0x1b47ae))['getMemberID'](),'unitId':_0x1b47ae,'threadId':_0x21f6bb,'mention':_0x283aec,'content':_0x162ec6,'replyId':_0x6848d7},_0x16e733=await this[_0x18be6e(0x1ef)][_0x18be6e(0x1e8)]('/universer-api/comment/unit/'+_0x1b47ae+_0x18be6e(0x1f5),{'body':_0x47b15d});return!_0x16e733[_0x18be6e(0x1e7)]['error']||_0x16e733[_0x18be6e(0x1e7)]['error']['code']===0x1;}async[_0x46d2fa(0x1a4)](_0xac97a6){const _0xeca959=_0x46d2fa,{unitId:_0x359757}=_0xac97a6,_0x2e32be=_0xac97a6[_0xeca959(0x1a3)],_0x33c7be={'memberId':this['_userService']['getCurrentUser']()[_0xeca959(0x1c3)],'unitId':_0x359757,'threadId':_0x2e32be,'solved':_0xac97a6['resolved']?I[_0xeca959(0x1a6)]:I['OpenOrReOpen']},_0x144f01=await this[_0xeca959(0x1ef)][_0xeca959(0x1e8)]('/universer-api/comment/unit/'+_0x359757+_0xeca959(0x1b2),{'body':_0x33c7be});return!_0x144f01[_0xeca959(0x1e7)][_0xeca959(0x1c1)]||_0x144f01['body'][_0xeca959(0x1c1)]['code']===0x1;}async['deleteComment'](_0x3576cc,_0x5bf75f,_0x44000a,_0x33ee22){const _0x31f9f2=_0x46d2fa,_0x26ba08={'memberId':(await this['_sessionService'][_0x31f9f2(0x1d5)](_0x3576cc))[_0x31f9f2(0x1e2)](),'threadId':_0x44000a,'replyId':_0x33ee22,'unitId':_0x3576cc},_0x5203da=await this[_0x31f9f2(0x1ef)][_0x31f9f2(0x1e8)](_0x31f9f2(0x1e4)+_0x3576cc+'/delete',{'body':_0x26ba08});return!_0x5203da['body'][_0x31f9f2(0x1c1)]||_0x5203da[_0x31f9f2(0x1e7)][_0x31f9f2(0x1c1)][_0x31f9f2(0x1b9)]===0x1;}async[_0x46d2fa(0x1b1)](_0x44ae94,_0x2f5ecf,_0x3db479){const _0x4ae777=_0x46d2fa,_0x37eb8e={'unitId':_0x44ae94,'threadId':_0x3db479},_0x8bd8b3=await this[_0x4ae777(0x1ef)][_0x4ae777(0x1e8)](_0x4ae777(0x1e4)+_0x44ae94+'/list',{'body':_0x37eb8e}),_0x320987=_0x3db479['map'](_0x20743d=>ee(_0x8bd8b3['body']['comments'][_0x20743d],_0x44ae94,_0x2f5ecf))[_0x4ae777(0x1e0)](Boolean);return Object[_0x4ae777(0x1ae)](_0x8bd8b3[_0x4ae777(0x1e7)][_0x4ae777(0x1c4)])[_0x4ae777(0x1f8)](_0x1673e7=>{const _0x5dfb80=_0x4ae777;this[_0x5dfb80(0x1d8)]['addUser'](_0x1673e7);}),_0x320987;}[_0x46d2fa(0x1f7)](_0x1eb0cf){const _0x1f6079=_0x46d2fa;return{'id':_0x1eb0cf['id'],'threadId':_0x1eb0cf[_0x1f6079(0x1a3)],'ref':_0x1eb0cf[_0x1f6079(0x1a1)]};}};f=Q([_(0x0,_0x50a740(_0x2e7ffa)),_(0x1,_0x50a740(_0x224c99)),_(0x2,_0x50a740(_0x5af098)),_(0x3,_0x50a740(_0x200e6d))],f);var re=Object[_0x46d2fa(0x1ed)],te=(_0xd1f1d3,_0x5c5474,_0x4a8445,_0x41e9bd)=>{for(var _0x5e241c=_0x41e9bd>0x1?void 0x0:_0x41e9bd?re(_0x5c5474,_0x4a8445):_0x5c5474,_0x32ba60=_0xd1f1d3['length']-0x1,_0x1eeea8;_0x32ba60>=0x0;_0x32ba60--)(_0x1eeea8=_0xd1f1d3[_0x32ba60])&&(_0x5e241c=_0x1eeea8(_0x5e241c)||_0x5e241c);return _0x5e241c;},N=(_0x3f11dc,_0x5790b5)=>(_0x52e7bc,_0x360147)=>_0x5790b5(_0x52e7bc,_0x360147,_0x3f11dc);let g=class extends _0x27b1be{constructor(_0x1108ed,_0x215fc0){const _0x42e3d6=_0x46d2fa;super(),this['_threadCommentDataSourceService']=_0x1108ed,this[_0x42e3d6(0x1e9)]=_0x215fc0,this[_0x42e3d6(0x1f9)]();}[_0x46d2fa(0x1f9)](){const _0x9ab650=_0x46d2fa;this[_0x9ab650(0x1e1)][_0x9ab650(0x1d2)]=this[_0x9ab650(0x1e9)],this['_threadCommentDataSourceService'][_0x9ab650(0x1da)]=!0x1;}};g=te([N(0x0,_0x2b2d44),N(0x1,_0x50a740(f))],g);var se=Object['defineProperty'],oe=Object[_0x46d2fa(0x1ed)],ne=(_0x36c071,_0x3203f6,_0xf7b927)=>_0x3203f6 in _0x36c071?se(_0x36c071,_0x3203f6,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0xf7b927}):_0x36c071[_0x3203f6]=_0xf7b927,ie=(_0x4a34fc,_0x4d8907,_0x559e60,_0x487031)=>{const _0x4b8652=_0x46d2fa;for(var _0x2c619d=_0x487031>0x1?void 0x0:_0x487031?oe(_0x4d8907,_0x559e60):_0x4d8907,_0x34e012=_0x4a34fc[_0x4b8652(0x1f1)]-0x1,_0x5a485b;_0x34e012>=0x0;_0x34e012--)(_0x5a485b=_0x4a34fc[_0x34e012])&&(_0x2c619d=_0x5a485b(_0x2c619d)||_0x2c619d);return _0x2c619d;},w=(_0xb45c13,_0x46ebc6)=>(_0x299847,_0x56551f)=>_0x46ebc6(_0x299847,_0x56551f,_0xb45c13),$=(_0x91929d,_0x211b51,_0x551f48)=>ne(_0x91929d,typeof _0x211b51!=_0x46d2fa(0x1b0)?_0x211b51+'':_0x211b51,_0x551f48);let b=class extends _0x521887{constructor(_0x40f057=M,_0x6e2c3a,_0x34b61f){const _0x2b5167=_0x46d2fa;super(),this[_0x2b5167(0x1e3)]=_0x40f057,this[_0x2b5167(0x1ec)]=_0x6e2c3a,this[_0x2b5167(0x1d7)]=_0x34b61f;const {..._0x525ed0}=_0x3abfd9({},M,this[_0x2b5167(0x1e3)]);this['_configService'][_0x2b5167(0x1d4)](z,_0x525ed0);}['onStarting'](){const _0x582b60=_0x46d2fa;[[f],[g],[S]][_0x582b60(0x1f8)](_0x45cfe7=>{const _0x233275=_0x582b60;this[_0x233275(0x1ec)]['add'](_0x45cfe7);});}['onReady'](){const _0x3c76e2=_0x46d2fa;this[_0x3c76e2(0x1ec)][_0x3c76e2(0x1d9)](g),this[_0x3c76e2(0x1ec)][_0x3c76e2(0x1d9)](S);}};$(b,_0x46d2fa(0x1aa),W),$(b,_0x46d2fa(0x1bb),_0x11f02[_0x46d2fa(0x1fd)]),b=ie([_0x3b928(_0x556e2d,_0x5405d4,_0x2412db),w(0x1,_0x50a740(_0x200e6d)),w(0x2,_0x5c76a5)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0xbf68e1=_0x1c41;(function(_0x2be46d,_0x201409){const _0x166ef4=_0x1c41,_0xe90126=_0x2be46d();while(!![]){try{const _0x18c2e5=parseInt(_0x166ef4(0x148))/0x1+-parseInt(_0x166ef4(0x14b))/0x2*(parseInt(_0x166ef4(0x14e))/0x3)+-parseInt(_0x166ef4(0x130))/0x4*(-parseInt(_0x166ef4(0x17b))/0x5)+parseInt(_0x166ef4(0x165))/0x6+-parseInt(_0x166ef4(0x121))/0x7*(parseInt(_0x166ef4(0x17a))/0x8)+parseInt(_0x166ef4(0x167))/0x9*(parseInt(_0x166ef4(0x14d))/0xa)+-parseInt(_0x166ef4(0x12e))/0xb;if(_0x18c2e5===_0x201409)break;else _0xe90126['push'](_0xe90126['shift']());}catch(_0x55eefc){_0xe90126['push'](_0xe90126['shift']());}}}(_0x39fc,0x3dc1c));import{CommentService as _0x24bf5a,CollaborationSessionService as _0x28cbe3,UniverCollaborationClientPlugin as _0x9525d4}from'@univerjs-pro/collaboration-client';function _0x39fc(){const _0x45054d=['post','_configService','ref','COMMENT','replies','get','getUser','defineProperty','/reply','921930HYOshG','forEach','549QiXcri','rangeType','symbol','Edit','content','user','_threadCommentModel','subscribe','OpenOrReOpen','_initUserSync','pipe','comments','disposeWithMe','parse','_threadCommentDataSourceService','/list','code','getOwnPropertyDescriptor','deleteComment','8cHYvvG','2502155fuuGXf','userId','/universer-api/user/list','slice','_initDataSource','onStarting','customRanges','addUser','Delete','updateComment','map','addComment','delete','getUnit','1170218oiFXSJ','getCurrentUser','body','stringify','length','personId','threadId','UNRECOGNIZED','_userService','userID','users','payload','_sessionService','648197DEFwbZ','add','4LUUVNH','resolveComment','Add','type','values','/solved','comment','setConfig','requireSession','_commentService','replyId','filter','error','/universer-api/comment/unit/','resolved','YYYY/MM/DD\x20HH:mm','getComment','_httpService','listComments','pluginName','root','solved','_config','/edit','138038DmcZue','Reply','/add','64850pfUMdo','Solved','17780OoBxTA','39WcDrPS','Solve','unitId','_injector','commentUpdate$','Unknown','format','_init','getMemberID','_threadCommentDataSource','reply','find','createTimestamp','/delete'];_0x39fc=function(){return _0x45054d;};return _0x39fc();}import{UniverLicensePlugin as _0x864633}from'@univerjs-pro/license';import{dayjs as _0x5e2681,UserManagerService as _0x4eab9e,Inject as _0x4f3a21,Injector as _0x8d5e07,Disposable as _0x5a933e,CustomRangeType as _0x1a431c,UniverInstanceType as _0x536cd8,DependentOn as _0x38802e,IConfigService as _0x350c90,Plugin as _0x32d5ff,merge as _0x40e613}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x4b97b3}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x5aae77,IThreadCommentDataSourceService as _0xe116fb}from'@univerjs/thread-comment';import{bufferTime as _0x363eac}from'rxjs';import{HTTPService as _0x36f428}from'@univerjs/network';const W='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x3b924d=>(_0x3b924d[_0x3b924d['OpenOrReOpen']=0x0]=_0xbf68e1(0x16f),_0x3b924d[_0x3b924d[_0xbf68e1(0x14c)]=0x1]=_0xbf68e1(0x14c),_0x3b924d[_0x3b924d[_0xbf68e1(0x128)]=-0x1]='UNRECOGNIZED',_0x3b924d))(I||{}),v=(_0x3663c9=>(_0x3663c9[_0x3663c9[_0xbf68e1(0x153)]=0x0]='Unknown',_0x3663c9[_0x3663c9[_0xbf68e1(0x132)]=0x1]=_0xbf68e1(0x132),_0x3663c9[_0x3663c9[_0xbf68e1(0x149)]=0x2]='Reply',_0x3663c9[_0x3663c9[_0xbf68e1(0x16a)]=0x3]=_0xbf68e1(0x16a),_0x3663c9[_0x3663c9['Delete']=0x4]=_0xbf68e1(0x11b),_0x3663c9[_0x3663c9[_0xbf68e1(0x14f)]=0x5]='Solve',_0x3663c9[_0x3663c9[_0xbf68e1(0x128)]=-0x1]=_0xbf68e1(0x128),_0x3663c9))(v||{});const D=_0x13cf56=>_0x5e2681(new Date(+_0x13cf56))[_0xbf68e1(0x154)](_0xbf68e1(0x13f)),B=async(_0x2a7abd,_0xe2218c)=>{const _0x28c80b=_0xbf68e1,_0x4eb165=_0x2a7abd[_0x28c80b(0x161)](_0x4eab9e),_0xcb30bd=_0x2a7abd['get'](_0x36f428);_0xe2218c[_0x28c80b(0x166)](_0x4c3a2a=>{const _0x547855=_0x28c80b;_0x4eb165[_0x547855(0x162)](_0x4c3a2a)&&_0xe2218c[_0x547855(0x11f)](_0x4c3a2a);}),_0xe2218c['size']&&(await _0xcb30bd[_0x28c80b(0x161)](_0x28c80b(0x115),{'params':{'userIDs':[..._0xe2218c]}}))[_0x28c80b(0x123)]['users']['forEach'](_0x4e7eba=>{const _0x115dba=_0x28c80b;_0x4e7eba&&_0x4eb165[_0x115dba(0x11a)](_0x4e7eba);});};var K=Object[_0xbf68e1(0x178)],V=(_0x59a755,_0x382e52,_0x3f76e9,_0x5d4827)=>{const _0x3c7999=_0xbf68e1;for(var _0x429bc1=_0x5d4827>0x1?void 0x0:_0x5d4827?K(_0x382e52,_0x3f76e9):_0x382e52,_0x510dc0=_0x59a755[_0x3c7999(0x125)]-0x1,_0x253dc0;_0x510dc0>=0x0;_0x510dc0--)(_0x253dc0=_0x59a755[_0x510dc0])&&(_0x429bc1=_0x253dc0(_0x429bc1)||_0x429bc1);return _0x429bc1;},p=(_0x37ddb4,_0x5082f3)=>(_0x4d8057,_0x105950)=>_0x5082f3(_0x4d8057,_0x105950,_0x37ddb4);function _0x1c41(_0x396f2b,_0x59e721){const _0x39fc90=_0x39fc();return _0x1c41=function(_0x1c41d2,_0x4b933d){_0x1c41d2=_0x1c41d2-0x115;let _0x186892=_0x39fc90[_0x1c41d2];return _0x186892;},_0x1c41(_0x396f2b,_0x59e721);}let S=class extends _0x5a933e{constructor(_0x4e3d93,_0x3cd519,_0x4ab288,_0x1843ee){const _0x4f773d=_0xbf68e1;super(),this[_0x4f773d(0x139)]=_0x4e3d93,this[_0x4f773d(0x16d)]=_0x3cd519,this[_0x4f773d(0x129)]=_0x4ab288,this['_injector']=_0x1843ee,this[_0x4f773d(0x155)](),this[_0x4f773d(0x170)]();}['_initUserSync'](){const _0x1dd83a=_0xbf68e1;this[_0x1dd83a(0x173)](this[_0x1dd83a(0x16d)][_0x1dd83a(0x152)][_0x1dd83a(0x171)](_0x363eac(0x10))[_0x1dd83a(0x16e)](_0x112690=>{const _0x49d524=_0x1dd83a,_0x5479b=new Set();_0x112690[_0x49d524(0x166)](_0x20eec5=>{const _0x3ae9fa=_0x49d524;switch(_0x20eec5['type']){case _0x3ae9fa(0x12f):{const _0x4691de=_0x20eec5[_0x3ae9fa(0x12c)][_0x3ae9fa(0x126)];_0x5479b['add'](_0x4691de);break;}}}),B(this[_0x49d524(0x151)],_0x5479b);}));}[_0xbf68e1(0x155)](){const _0x487e35=_0xbf68e1;this['disposeWithMe'](this[_0x487e35(0x139)][_0x487e35(0x152)][_0x487e35(0x16e)](async _0x41f182=>{const _0x25ec51=_0x487e35;var _0x6e1861,_0x434a5c,_0x47cd03,_0x34fbfb;const _0x191590=(_0x6e1861=this[_0x25ec51(0x16d)][_0x25ec51(0x120)](_0x41f182[_0x25ec51(0x150)])[_0x25ec51(0x159)](_0x205a71=>_0x205a71[_0x25ec51(0x127)]===_0x41f182[_0x25ec51(0x127)]))==null?void 0x0:_0x6e1861[_0x25ec51(0x144)];if(!_0x191590)return;const {unitId:_0x1d2cf4,subUnitId:_0x554e0b}=_0x191590;switch(_0x41f182[_0x25ec51(0x16c)]&&this[_0x25ec51(0x129)][_0x25ec51(0x11a)](_0x41f182[_0x25ec51(0x16c)]),_0x41f182['type']){case v[_0x25ec51(0x132)]:break;case v[_0x25ec51(0x149)]:{this[_0x25ec51(0x16d)]['addComment'](_0x1d2cf4,_0x554e0b,{'unitId':_0x1d2cf4,'subUnitId':_0x554e0b,'ref':'','id':_0x41f182['replyId'],'dT':D(+_0x41f182[_0x25ec51(0x15a)]),'threadId':_0x41f182['threadId'],'personId':(_0x47cd03=(_0x434a5c=_0x41f182[_0x25ec51(0x16c)])==null?void 0x0:_0x434a5c[_0x25ec51(0x12a)])!=null?_0x47cd03:_0x41f182['userId'],'text':JSON[_0x25ec51(0x174)](_0x41f182['content']),'parentId':_0x191590['id']});break;}case v[_0x25ec51(0x11b)]:{const _0x2580ce=this[_0x25ec51(0x16d)][_0x25ec51(0x140)](_0x1d2cf4,_0x554e0b,_0x41f182[_0x25ec51(0x13a)]);_0x2580ce&&_0x2580ce['parentId']&&this[_0x25ec51(0x16d)][_0x25ec51(0x179)](_0x1d2cf4,_0x554e0b,_0x41f182['replyId']);break;}case v[_0x25ec51(0x16a)]:{this['_threadCommentModel'][_0x25ec51(0x11c)](_0x1d2cf4,_0x554e0b,{'commentId':_0x41f182['replyId'],'text':JSON[_0x25ec51(0x174)](_0x41f182['content'])});break;}case v[_0x25ec51(0x14f)]:{const _0x226b6d=(_0x34fbfb=this[_0x25ec51(0x16d)][_0x25ec51(0x120)](_0x41f182[_0x25ec51(0x150)])[_0x25ec51(0x159)](_0x1f0c9c=>_0x1f0c9c[_0x25ec51(0x127)]===_0x41f182['threadId']))==null?void 0x0:_0x34fbfb[_0x25ec51(0x144)];_0x226b6d&&this['_threadCommentModel'][_0x25ec51(0x131)](_0x1d2cf4,_0x554e0b,_0x226b6d['id'],_0x41f182['solved']===I[_0x25ec51(0x14c)]);break;}}}));}};S=V([p(0x0,_0x4f3a21(_0x24bf5a)),p(0x1,_0x4f3a21(_0x5aae77)),p(0x2,_0x4f3a21(_0x4eab9e)),p(0x3,_0x4f3a21(_0x8d5e07))],S);const z='thread-comment-data-source.config',M={};var k=Object['getOwnPropertyDescriptor'],Q=(_0x255c02,_0xa0e69f,_0x25383d,_0x1519fd)=>{for(var _0x32de6a=_0x1519fd>0x1?void 0x0:_0x1519fd?k(_0xa0e69f,_0x25383d):_0xa0e69f,_0x48e18c=_0x255c02['length']-0x1,_0x28dfe3;_0x48e18c>=0x0;_0x48e18c--)(_0x28dfe3=_0x255c02[_0x48e18c])&&(_0x32de6a=_0x28dfe3(_0x32de6a)||_0x32de6a);return _0x32de6a;},_=(_0x3a289f,_0x1d6a32)=>(_0x37f1bb,_0x307b91)=>_0x1d6a32(_0x37f1bb,_0x307b91,_0x3a289f);function X(_0x40bf0a,_0x2abb47){const _0x14012f=_0xbf68e1,_0x217399=_0x40bf0a[_0x14012f(0x160)][0x0];return{..._0x2abb47,'id':_0x217399[_0x14012f(0x13a)],'resolved':_0x40bf0a[_0x14012f(0x145)]===0x1,'dT':D(_0x217399[_0x14012f(0x15a)]),'personId':_0x217399['userId'],'threadId':_0x217399[_0x14012f(0x127)]};}function ee(_0x1f96d6,_0x247b6f,_0x343b81){const _0x215786=_0xbf68e1;var _0x17e4e1,_0xbdea56;if(((_0xbdea56=(_0x17e4e1=_0x1f96d6==null?void 0x0:_0x1f96d6[_0x215786(0x160)])==null?void 0x0:_0x17e4e1[_0x215786(0x125)])!=null?_0xbdea56:0x0)>0x0){const _0x2bf7b7=(_0x8034a4,_0x4857c9)=>({'id':_0x8034a4[_0x215786(0x13a)],'threadId':_0x8034a4[_0x215786(0x127)],'dT':D(_0x8034a4[_0x215786(0x15a)]),'personId':_0x8034a4[_0x215786(0x17c)],'resolved':_0x1f96d6['solved']===I['Solved'],'unitId':_0x247b6f,'subUnitId':_0x343b81,'text':JSON['parse'](_0x8034a4[_0x215786(0x16b)]),'parentId':_0x4857c9}),_0x150b4b=_0x2bf7b7(_0x1f96d6[_0x215786(0x160)][0x0]);return{..._0x150b4b,'children':_0x1f96d6[_0x215786(0x160)][_0x215786(0x116)](0x1)[_0x215786(0x11d)](_0x234aaf=>_0x2bf7b7(_0x234aaf,_0x150b4b['id']))};}return null;}let f=class{constructor(_0xa200ee,_0x1df30a,_0x115f26,_0x2b7729){const _0x363a7c=_0xbf68e1;this[_0x363a7c(0x141)]=_0xa200ee,this[_0x363a7c(0x129)]=_0x1df30a,this[_0x363a7c(0x12d)]=_0x115f26,this[_0x363a7c(0x151)]=_0x2b7729;}async[_0xbf68e1(0x11e)](_0x11e6f4){const _0x3d6a56=_0xbf68e1;var _0x575978,_0x5f24cc;const {parentId:_0x110641,unitId:_0x342b4c,text:_0x252a1a,threadId:_0x400bad}=_0x11e6f4,_0x3bbe0b=(_0x5f24cc=(_0x575978=_0x252a1a[_0x3d6a56(0x119)])==null?void 0x0:_0x575978[_0x3d6a56(0x13b)](_0xe1f76a=>_0xe1f76a[_0x3d6a56(0x168)]===_0x1a431c[_0x3d6a56(0x15f)])['map'](_0xb1f29c=>_0xb1f29c['rangeId']))!=null?_0x5f24cc:[],_0x4ffe3c=JSON[_0x3d6a56(0x124)](_0x252a1a),_0x1e00d7=(await this[_0x3d6a56(0x12d)][_0x3d6a56(0x138)](_0x342b4c))[_0x3d6a56(0x156)]();if(_0x110641){const _0x31797d={'memberId':_0x1e00d7,'unitId':_0x342b4c,'content':_0x4ffe3c,'mention':_0x3bbe0b,'threadId':_0x400bad},_0x1784cc=(await this[_0x3d6a56(0x141)][_0x3d6a56(0x15c)](_0x3d6a56(0x13d)+_0x342b4c+_0x3d6a56(0x164),{'body':_0x31797d}))[_0x3d6a56(0x123)][_0x3d6a56(0x158)];return{..._0x11e6f4,'id':_0x1784cc[_0x3d6a56(0x13a)],'dT':_0x5e2681(+_0x1784cc[_0x3d6a56(0x15a)])[_0x3d6a56(0x154)](_0x3d6a56(0x13f)),'personId':_0x1784cc[_0x3d6a56(0x17c)]};}else{const _0x4f68be={'memberId':_0x1e00d7,'unitId':_0x342b4c,'content':_0x4ffe3c,'mention':_0x3bbe0b},_0x54ebc7=await this['_httpService'][_0x3d6a56(0x15c)]('/universer-api/comment/unit/'+_0x342b4c+_0x3d6a56(0x14a),{'body':_0x4f68be});return X(_0x54ebc7[_0x3d6a56(0x123)][_0x3d6a56(0x136)],_0x11e6f4);}}async['updateComment'](_0x77a8af){const _0x5229b8=_0xbf68e1;var _0x5942eb,_0x57cb38;const {text:_0x376793,unitId:_0x5c14d5}=_0x77a8af,_0x256637=(_0x57cb38=(_0x5942eb=_0x376793[_0x5229b8(0x119)])==null?void 0x0:_0x5942eb[_0x5229b8(0x13b)](_0x4fb5ce=>_0x4fb5ce['rangeType']===_0x1a431c[_0x5229b8(0x15f)])[_0x5229b8(0x11d)](_0x265ea5=>_0x265ea5['rangeId']))!=null?_0x57cb38:[],_0xe22770=JSON['stringify'](_0x376793),_0x58c073=_0x77a8af['threadId'],_0x370bc3=_0x77a8af['id'],_0x15b891={'memberId':(await this[_0x5229b8(0x12d)]['requireSession'](_0x5c14d5))[_0x5229b8(0x156)](),'unitId':_0x5c14d5,'threadId':_0x58c073,'mention':_0x256637,'content':_0xe22770,'replyId':_0x370bc3},_0x2d9d46=await this[_0x5229b8(0x141)][_0x5229b8(0x15c)](_0x5229b8(0x13d)+_0x5c14d5+_0x5229b8(0x147),{'body':_0x15b891});return!_0x2d9d46[_0x5229b8(0x123)][_0x5229b8(0x13c)]||_0x2d9d46[_0x5229b8(0x123)]['error'][_0x5229b8(0x177)]===0x1;}async[_0xbf68e1(0x131)](_0x47a996){const _0x1a038d=_0xbf68e1,{unitId:_0x476854}=_0x47a996,_0x339186=_0x47a996[_0x1a038d(0x127)],_0x2ba622={'memberId':this[_0x1a038d(0x129)][_0x1a038d(0x122)]()[_0x1a038d(0x12a)],'unitId':_0x476854,'threadId':_0x339186,'solved':_0x47a996[_0x1a038d(0x13e)]?I[_0x1a038d(0x14c)]:I['OpenOrReOpen']},_0x10bddc=await this[_0x1a038d(0x141)][_0x1a038d(0x15c)](_0x1a038d(0x13d)+_0x476854+_0x1a038d(0x135),{'body':_0x2ba622});return!_0x10bddc[_0x1a038d(0x123)][_0x1a038d(0x13c)]||_0x10bddc[_0x1a038d(0x123)][_0x1a038d(0x13c)]['code']===0x1;}async['deleteComment'](_0x3347b2,_0x2033d4,_0x1ef2bf,_0x29ebd5){const _0x344709=_0xbf68e1,_0x575194={'memberId':(await this['_sessionService'][_0x344709(0x138)](_0x3347b2))['getMemberID'](),'threadId':_0x1ef2bf,'replyId':_0x29ebd5,'unitId':_0x3347b2},_0x5e4cf6=await this[_0x344709(0x141)][_0x344709(0x15c)](_0x344709(0x13d)+_0x3347b2+_0x344709(0x15b),{'body':_0x575194});return!_0x5e4cf6[_0x344709(0x123)][_0x344709(0x13c)]||_0x5e4cf6['body'][_0x344709(0x13c)][_0x344709(0x177)]===0x1;}async[_0xbf68e1(0x142)](_0x42e936,_0x3cd446,_0x3e4fd3){const _0x1d2485=_0xbf68e1,_0xcf860f={'unitId':_0x42e936,'threadId':_0x3e4fd3},_0x1b0b49=await this[_0x1d2485(0x141)][_0x1d2485(0x15c)](_0x1d2485(0x13d)+_0x42e936+_0x1d2485(0x176),{'body':_0xcf860f}),_0x56c260=_0x3e4fd3[_0x1d2485(0x11d)](_0x46a2e1=>ee(_0x1b0b49[_0x1d2485(0x123)][_0x1d2485(0x172)][_0x46a2e1],_0x42e936,_0x3cd446))[_0x1d2485(0x13b)](Boolean);return Object[_0x1d2485(0x134)](_0x1b0b49[_0x1d2485(0x123)][_0x1d2485(0x12b)])[_0x1d2485(0x166)](_0x30ca58=>{const _0x256439=_0x1d2485;this[_0x256439(0x129)]['addUser'](_0x30ca58);}),_0x56c260;}['saveCommentToSnapshot'](_0x78d2e0){const _0x3a3e19=_0xbf68e1;return{'id':_0x78d2e0['id'],'threadId':_0x78d2e0['threadId'],'ref':_0x78d2e0[_0x3a3e19(0x15e)]};}};f=Q([_(0x0,_0x4f3a21(_0x36f428)),_(0x1,_0x4f3a21(_0x4eab9e)),_(0x2,_0x4f3a21(_0x28cbe3)),_(0x3,_0x4f3a21(_0x8d5e07))],f);var re=Object[_0xbf68e1(0x178)],te=(_0x5845b6,_0x46f690,_0x52b141,_0x453933)=>{const _0x11a8a0=_0xbf68e1;for(var _0x59b20d=_0x453933>0x1?void 0x0:_0x453933?re(_0x46f690,_0x52b141):_0x46f690,_0x4c4aa6=_0x5845b6[_0x11a8a0(0x125)]-0x1,_0x47346c;_0x4c4aa6>=0x0;_0x4c4aa6--)(_0x47346c=_0x5845b6[_0x4c4aa6])&&(_0x59b20d=_0x47346c(_0x59b20d)||_0x59b20d);return _0x59b20d;},N=(_0x19e5d2,_0x1686db)=>(_0x4d9ef4,_0x4d4a0b)=>_0x1686db(_0x4d9ef4,_0x4d4a0b,_0x19e5d2);let g=class extends _0x5a933e{constructor(_0x1386e0,_0x411940){const _0x2bb172=_0xbf68e1;super(),this[_0x2bb172(0x175)]=_0x1386e0,this['_threadCommentDataSource']=_0x411940,this[_0x2bb172(0x117)]();}[_0xbf68e1(0x117)](){const _0x4e4959=_0xbf68e1;this[_0x4e4959(0x175)]['dataSource']=this[_0x4e4959(0x157)],this[_0x4e4959(0x175)]['syncUpdateMutationToColla']=!0x1;}};g=te([N(0x0,_0xe116fb),N(0x1,_0x4f3a21(f))],g);var se=Object[_0xbf68e1(0x163)],oe=Object['getOwnPropertyDescriptor'],ne=(_0x112488,_0x361639,_0x2ca661)=>_0x361639 in _0x112488?se(_0x112488,_0x361639,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x2ca661}):_0x112488[_0x361639]=_0x2ca661,ie=(_0x3a3ca9,_0x1d8911,_0x27bba6,_0x1b3536)=>{const _0x6ec18d=_0xbf68e1;for(var _0x1fe28f=_0x1b3536>0x1?void 0x0:_0x1b3536?oe(_0x1d8911,_0x27bba6):_0x1d8911,_0x482e95=_0x3a3ca9[_0x6ec18d(0x125)]-0x1,_0x5d22af;_0x482e95>=0x0;_0x482e95--)(_0x5d22af=_0x3a3ca9[_0x482e95])&&(_0x1fe28f=_0x5d22af(_0x1fe28f)||_0x1fe28f);return _0x1fe28f;},w=(_0x113109,_0x126625)=>(_0x2189b3,_0x5ffa6f)=>_0x126625(_0x2189b3,_0x5ffa6f,_0x113109),$=(_0x11a43c,_0x456808,_0x189106)=>ne(_0x11a43c,typeof _0x456808!=_0xbf68e1(0x169)?_0x456808+'':_0x456808,_0x189106);let b=class extends _0x32d5ff{constructor(_0xb71a87=M,_0x17be08,_0x11d6f2){const _0x4d9ffd=_0xbf68e1;super(),this[_0x4d9ffd(0x146)]=_0xb71a87,this[_0x4d9ffd(0x151)]=_0x17be08,this[_0x4d9ffd(0x15d)]=_0x11d6f2;const {..._0x18e461}=_0x40e613({},M,this[_0x4d9ffd(0x146)]);this['_configService'][_0x4d9ffd(0x137)](z,_0x18e461);}[_0xbf68e1(0x118)](){const _0x3ad986=_0xbf68e1;[[f],[g],[S]][_0x3ad986(0x166)](_0x28bc58=>{const _0x3ca970=_0x3ad986;this[_0x3ca970(0x151)][_0x3ca970(0x12f)](_0x28bc58);});}['onReady'](){const _0x8738b8=_0xbf68e1;this[_0x8738b8(0x151)][_0x8738b8(0x161)](g),this[_0x8738b8(0x151)][_0x8738b8(0x161)](S);}};$(b,_0xbf68e1(0x143),W),$(b,_0xbf68e1(0x133),_0x536cd8['UNIVER_UNKNOWN']),b=ie([_0x38802e(_0x4b97b3,_0x9525d4,_0x864633),w(0x1,_0x4f3a21(_0x8d5e07)),w(0x2,_0x350c90)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { CommentService } from '@univerjs-pro/collaboration-client';
|
|
1
2
|
import { Disposable, Injector, UserManagerService } from '@univerjs/core';
|
|
2
3
|
import { ThreadCommentModel } from '@univerjs/thread-comment';
|
|
3
|
-
import { CommentService } from '@univerjs-pro/collaboration-client';
|
|
4
4
|
export declare class ThreadCommentCollaUpdateController extends Disposable {
|
|
5
5
|
private readonly _commentService;
|
|
6
6
|
private readonly _threadCommentModel;
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1cb80c,_0x5c2e31){const _0x51ba81=_0x429b,_0x5c7e22=_0x1cb80c();while(!![]){try{const _0x177398=-parseInt(_0x51ba81(0xda))/0x1+parseInt(_0x51ba81(0xe4))/0x2*(-parseInt(_0x51ba81(0xc8))/0x3)+-parseInt(_0x51ba81(0xc5))/0x4*(parseInt(_0x51ba81(0x12c))/0x5)+-parseInt(_0x51ba81(0x107))/0x6+-parseInt(_0x51ba81(0x105))/0x7*(parseInt(_0x51ba81(0x113))/0x8)+parseInt(_0x51ba81(0x12a))/0x9+-parseInt(_0x51ba81(0xbf))/0xa*(-parseInt(_0x51ba81(0x112))/0xb);if(_0x177398===_0x5c2e31)break;else _0x5c7e22['push'](_0x5c7e22['shift']());}catch(_0x46ed41){_0x5c7e22['push'](_0x5c7e22['shift']());}}}(_0x1ce3,0x5bb6a),function(_0x314432,_0xaf26a9){const _0x1f0f23=_0x429b;typeof exports==_0x1f0f23(0xe0)&&typeof module<'u'?_0xaf26a9(exports,require('@univerjs-pro/collaboration-client'),require(_0x1f0f23(0xea)),require(_0x1f0f23(0xb5)),require('@univerjs/thread-comment-ui'),require(_0x1f0f23(0x101)),require(_0x1f0f23(0xbd)),require('@univerjs/network')):typeof define==_0x1f0f23(0xfd)&&define[_0x1f0f23(0xc6)]?define([_0x1f0f23(0xd1),_0x1f0f23(0xe6),_0x1f0f23(0xea),_0x1f0f23(0xb5),_0x1f0f23(0xb1),_0x1f0f23(0x101),_0x1f0f23(0xbd),'@univerjs/network'],_0xaf26a9):(_0x314432=typeof globalThis<'u'?globalThis:_0x314432||self,_0xaf26a9(_0x314432['UniverProThreadCommentDatasource']={},_0x314432[_0x1f0f23(0xc3)],_0x314432[_0x1f0f23(0xcb)],_0x314432[_0x1f0f23(0x119)],_0x314432['UniverThreadCommentUi'],_0x314432[_0x1f0f23(0xba)],_0x314432[_0x1f0f23(0xbd)],_0x314432[_0x1f0f23(0xf8)]));}(this,function(_0x58f319,_0xceb99c,_0x22e5e1,_0x199161,_0x59639f,_0x313bc5,_0x211293,_0x48082b){'use strict';const _0x4c01f8=_0x429b;const _0x54e18f=_0x4c01f8(0xb6);var _0x2a3227=(_0x585cdb=>(_0x585cdb[_0x585cdb[_0x4c01f8(0xe2)]=0x0]='OpenOrReOpen',_0x585cdb[_0x585cdb[_0x4c01f8(0xdd)]=0x1]=_0x4c01f8(0xdd),_0x585cdb[_0x585cdb['UNRECOGNIZED']=-0x1]=_0x4c01f8(0x12b),_0x585cdb))(_0x2a3227||{}),_0x333e78=(_0x34a3be=>(_0x34a3be[_0x34a3be[_0x4c01f8(0x11d)]=0x0]='Unknown',_0x34a3be[_0x34a3be[_0x4c01f8(0x12e)]=0x1]='Add',_0x34a3be[_0x34a3be[_0x4c01f8(0xf4)]=0x2]=_0x4c01f8(0xf4),_0x34a3be[_0x34a3be[_0x4c01f8(0xe8)]=0x3]=_0x4c01f8(0xe8),_0x34a3be[_0x34a3be[_0x4c01f8(0x108)]=0x4]='Delete',_0x34a3be[_0x34a3be[_0x4c01f8(0xeb)]=0x5]='Solve',_0x34a3be[_0x34a3be[_0x4c01f8(0x12b)]=-0x1]=_0x4c01f8(0x12b),_0x34a3be))(_0x333e78||{});const _0x2aa7db=_0x3f2573=>_0x199161[_0x4c01f8(0x121)](new Date(+_0x3f2573))[_0x4c01f8(0xd5)](_0x4c01f8(0xcf)),_0x38f609=async(_0x23aad4,_0xeb8a31)=>{const _0x12dcbb=_0x4c01f8,_0x4d0591=_0x23aad4['get'](_0x199161[_0x12dcbb(0xed)]),_0x418337=_0x23aad4[_0x12dcbb(0xb7)](_0x48082b[_0x12dcbb(0xf7)]);_0xeb8a31[_0x12dcbb(0xc0)](_0x413245=>{_0x4d0591['getUser'](_0x413245)&&_0xeb8a31['delete'](_0x413245);}),_0xeb8a31[_0x12dcbb(0xe5)]&&(await _0x418337['get'](_0x12dcbb(0xf5),{'params':{'userIDs':[..._0xeb8a31]}}))[_0x12dcbb(0xb0)][_0x12dcbb(0x11f)]['forEach'](_0x5f0623=>{const _0x4527bb=_0x12dcbb;_0x5f0623&&_0x4d0591[_0x4527bb(0xd0)](_0x5f0623);});};var _0x4f4744=Object[_0x4c01f8(0x11c)],_0x1116a4=(_0x3cfc81,_0x3d87ab,_0x5d2b15,_0x2452b7)=>{const _0x56c00d=_0x4c01f8;for(var _0x44d795=_0x2452b7>0x1?void 0x0:_0x2452b7?_0x4f4744(_0x3d87ab,_0x5d2b15):_0x3d87ab,_0x2e4c65=_0x3cfc81[_0x56c00d(0xfa)]-0x1,_0x19a87c;_0x2e4c65>=0x0;_0x2e4c65--)(_0x19a87c=_0x3cfc81[_0x2e4c65])&&(_0x44d795=_0x19a87c(_0x44d795)||_0x44d795);return _0x44d795;},_0x51f0b4=(_0x3bc8eb,_0x2fd6fa)=>(_0x2a458c,_0x41e4f3)=>_0x2fd6fa(_0x2a458c,_0x41e4f3,_0x3bc8eb);let _0x2f3ca1=class extends _0x199161[_0x4c01f8(0x11a)]{constructor(_0x58ecf5,_0x2ceac9,_0x534d78,_0x2016ff){const _0x24c7be=_0x4c01f8;super(),this[_0x24c7be(0xf9)]=_0x58ecf5,this[_0x24c7be(0x12d)]=_0x2ceac9,this[_0x24c7be(0xd4)]=_0x534d78,this[_0x24c7be(0x115)]=_0x2016ff,this[_0x24c7be(0x104)](),this['_initUserSync']();}[_0x4c01f8(0x133)](){const _0x45aa7e=_0x4c01f8;this[_0x45aa7e(0xca)](this[_0x45aa7e(0x12d)][_0x45aa7e(0x11b)]['pipe'](_0x211293[_0x45aa7e(0x10b)](0x10))[_0x45aa7e(0xde)](_0xa85d99=>{const _0x3dfc6e=_0x45aa7e,_0x2ee701=new Set();_0xa85d99['forEach'](_0x133fce=>{const _0xe3fe86=_0x429b;switch(_0x133fce[_0xe3fe86(0xd2)]){case _0xe3fe86(0xc7):{const _0x57235e=_0x133fce[_0xe3fe86(0xdc)][_0xe3fe86(0x111)];_0x2ee701[_0xe3fe86(0xc7)](_0x57235e);break;}}}),_0x38f609(this[_0x3dfc6e(0x115)],_0x2ee701);}));}['_init'](){const _0x1d8f5e=_0x4c01f8;this['disposeWithMe'](this[_0x1d8f5e(0xf9)][_0x1d8f5e(0x11b)][_0x1d8f5e(0xde)](async _0x4053c1=>{const _0x258181=_0x1d8f5e;var _0x4ef9b2,_0x5cf580,_0x5c5790,_0x4f62fe;const _0x516273=(_0x4ef9b2=this['_threadCommentModel'][_0x258181(0xff)](_0x4053c1[_0x258181(0xd6)])['find'](_0x72d03=>_0x72d03['threadId']===_0x4053c1['threadId']))==null?void 0x0:_0x4ef9b2[_0x258181(0xef)];if(!_0x516273)return;const {unitId:_0x55a99a,subUnitId:_0x3ed5a0}=_0x516273;switch(_0x4053c1['user']&&this[_0x258181(0xd4)]['addUser'](_0x4053c1['user']),_0x4053c1[_0x258181(0xd2)]){case _0x333e78['Add']:break;case _0x333e78[_0x258181(0xf4)]:{this[_0x258181(0x12d)]['addComment'](_0x55a99a,_0x3ed5a0,{'unitId':_0x55a99a,'subUnitId':_0x3ed5a0,'ref':'','id':_0x4053c1['replyId'],'dT':_0x2aa7db(+_0x4053c1[_0x258181(0xb8)]),'threadId':_0x4053c1[_0x258181(0x135)],'personId':(_0x5c5790=(_0x5cf580=_0x4053c1['user'])==null?void 0x0:_0x5cf580[_0x258181(0x109)])!=null?_0x5c5790:_0x4053c1[_0x258181(0x100)],'text':JSON[_0x258181(0xbc)](_0x4053c1[_0x258181(0xe1)]),'parentId':_0x516273['id']});break;}case _0x333e78[_0x258181(0x108)]:{const _0xb706a5=this[_0x258181(0x12d)][_0x258181(0x120)](_0x55a99a,_0x3ed5a0,_0x4053c1[_0x258181(0x136)]);_0xb706a5&&_0xb706a5[_0x258181(0xe9)]&&this[_0x258181(0x12d)][_0x258181(0x10d)](_0x55a99a,_0x3ed5a0,_0x4053c1[_0x258181(0x136)]);break;}case _0x333e78[_0x258181(0xe8)]:{this['_threadCommentModel']['updateComment'](_0x55a99a,_0x3ed5a0,{'commentId':_0x4053c1[_0x258181(0x136)],'text':JSON[_0x258181(0xbc)](_0x4053c1[_0x258181(0xe1)])});break;}case _0x333e78[_0x258181(0xeb)]:{const _0x15b143=(_0x4f62fe=this[_0x258181(0x12d)][_0x258181(0xff)](_0x4053c1[_0x258181(0xd6)])['find'](_0x5c5a2d=>_0x5c5a2d[_0x258181(0x135)]===_0x4053c1[_0x258181(0x135)]))==null?void 0x0:_0x4f62fe[_0x258181(0xef)];_0x15b143&&this[_0x258181(0x12d)][_0x258181(0xfb)](_0x55a99a,_0x3ed5a0,_0x15b143['id'],_0x4053c1[_0x258181(0x134)]===_0x2a3227[_0x258181(0xdd)]);break;}}}));}};_0x2f3ca1=_0x1116a4([_0x51f0b4(0x0,_0x199161[_0x4c01f8(0xc1)](_0xceb99c[_0x4c01f8(0xc9)])),_0x51f0b4(0x1,_0x199161[_0x4c01f8(0xc1)](_0x313bc5[_0x4c01f8(0x117)])),_0x51f0b4(0x2,_0x199161[_0x4c01f8(0xc1)](_0x199161[_0x4c01f8(0xed)])),_0x51f0b4(0x3,_0x199161['Inject'](_0x199161[_0x4c01f8(0x10a)]))],_0x2f3ca1);const _0x2eadfa=_0x4c01f8(0xf0),_0x369557={};var _0x46daeb=Object[_0x4c01f8(0x11c)],_0x47fbec=(_0x2fa22a,_0x1c1994,_0xdadf66,_0x21a397)=>{const _0x58665f=_0x4c01f8;for(var _0x6cab33=_0x21a397>0x1?void 0x0:_0x21a397?_0x46daeb(_0x1c1994,_0xdadf66):_0x1c1994,_0x43b24a=_0x2fa22a[_0x58665f(0xfa)]-0x1,_0x1a6475;_0x43b24a>=0x0;_0x43b24a--)(_0x1a6475=_0x2fa22a[_0x43b24a])&&(_0x6cab33=_0x1a6475(_0x6cab33)||_0x6cab33);return _0x6cab33;},_0x37d4ee=(_0x72fe35,_0x4144e7)=>(_0x8c00b7,_0xf01003)=>_0x4144e7(_0x8c00b7,_0xf01003,_0x72fe35);function _0x2839bd(_0x38ef2a,_0x2119d0){const _0x3afd10=_0x4c01f8,_0xfc37f3=_0x38ef2a[_0x3afd10(0xb9)][0x0];return{..._0x2119d0,'id':_0xfc37f3[_0x3afd10(0x136)],'resolved':_0x38ef2a[_0x3afd10(0x134)]===0x1,'dT':_0x2aa7db(_0xfc37f3[_0x3afd10(0xb8)]),'personId':_0xfc37f3[_0x3afd10(0x100)],'threadId':_0xfc37f3['threadId']};}function _0xbd643e(_0xa42924,_0x28d2d5,_0x3a7d42){const _0x3715ce=_0x4c01f8;var _0x1df0ce,_0x353ebf;if(((_0x353ebf=(_0x1df0ce=_0xa42924==null?void 0x0:_0xa42924[_0x3715ce(0xb9)])==null?void 0x0:_0x1df0ce['length'])!=null?_0x353ebf:0x0)>0x0){const _0x453921=(_0x549b6f,_0x404852)=>({'id':_0x549b6f[_0x3715ce(0x136)],'threadId':_0x549b6f[_0x3715ce(0x135)],'dT':_0x2aa7db(_0x549b6f[_0x3715ce(0xb8)]),'personId':_0x549b6f['userId'],'resolved':_0xa42924[_0x3715ce(0x134)]===_0x2a3227[_0x3715ce(0xdd)],'unitId':_0x28d2d5,'subUnitId':_0x3a7d42,'text':JSON[_0x3715ce(0xbc)](_0x549b6f[_0x3715ce(0xe1)]),'parentId':_0x404852}),_0x44cab1=_0x453921(_0xa42924['replies'][0x0]);return{..._0x44cab1,'children':_0xa42924[_0x3715ce(0xb9)]['slice'](0x1)['map'](_0x4d6b95=>_0x453921(_0x4d6b95,_0x44cab1['id']))};}return null;}let _0x18650a=class{constructor(_0x276355,_0x19f94b,_0x332b06,_0x351849){const _0x5c204b=_0x4c01f8;this[_0x5c204b(0x106)]=_0x276355,this[_0x5c204b(0xd4)]=_0x19f94b,this[_0x5c204b(0x102)]=_0x332b06,this[_0x5c204b(0x115)]=_0x351849;}async[_0x4c01f8(0xf1)](_0x1df1a3){const _0x38ee40=_0x4c01f8;var _0x3189db,_0x43d8dc;const {parentId:_0x34f732,unitId:_0xe4805f,text:_0x3711af,threadId:_0x14b467}=_0x1df1a3,_0x27a591=(_0x43d8dc=(_0x3189db=_0x3711af['customRanges'])==null?void 0x0:_0x3189db[_0x38ee40(0x123)](_0x469d52=>_0x469d52[_0x38ee40(0x10f)]===_0x199161[_0x38ee40(0xbe)][_0x38ee40(0x110)])['map'](_0x19550a=>_0x19550a[_0x38ee40(0xb2)]))!=null?_0x43d8dc:[],_0x1ccd43=JSON[_0x38ee40(0xd7)](_0x3711af),_0x4124da=(await this[_0x38ee40(0x102)][_0x38ee40(0xcd)](_0xe4805f))[_0x38ee40(0xf2)]();if(_0x34f732){const _0x519ba5={'memberId':_0x4124da,'unitId':_0xe4805f,'content':_0x1ccd43,'mention':_0x27a591,'threadId':_0x14b467},_0x480eff=(await this[_0x38ee40(0x106)][_0x38ee40(0x118)](_0x38ee40(0x131)+_0xe4805f+'/reply',{'body':_0x519ba5}))[_0x38ee40(0xb0)]['reply'];return{..._0x1df1a3,'id':_0x480eff[_0x38ee40(0x136)],'dT':_0x199161['dayjs'](+_0x480eff[_0x38ee40(0xb8)])['format'](_0x38ee40(0xcf)),'personId':_0x480eff['userId']};}else{const _0x3560d3={'memberId':_0x4124da,'unitId':_0xe4805f,'content':_0x1ccd43,'mention':_0x27a591},_0x56f1b6=await this[_0x38ee40(0x106)][_0x38ee40(0x118)]('/universer-api/comment/unit/'+_0xe4805f+'/add',{'body':_0x3560d3});return _0x2839bd(_0x56f1b6[_0x38ee40(0xb0)][_0x38ee40(0xd9)],_0x1df1a3);}}async[_0x4c01f8(0x116)](_0x41bc83){const _0x2f4563=_0x4c01f8;var _0x191102,_0x44ed37;const {text:_0x36b138,unitId:_0x3172aa}=_0x41bc83,_0x271ea4=(_0x44ed37=(_0x191102=_0x36b138[_0x2f4563(0xec)])==null?void 0x0:_0x191102[_0x2f4563(0x123)](_0x586267=>_0x586267[_0x2f4563(0x10f)]===_0x199161[_0x2f4563(0xbe)]['COMMENT'])[_0x2f4563(0xce)](_0x2935f3=>_0x2935f3[_0x2f4563(0xb2)]))!=null?_0x44ed37:[],_0x3e625e=JSON[_0x2f4563(0xd7)](_0x36b138),_0x3c78c6=_0x41bc83[_0x2f4563(0x135)],_0x12a629=_0x41bc83['id'],_0xef3f82={'memberId':(await this[_0x2f4563(0x102)][_0x2f4563(0xcd)](_0x3172aa))['getMemberID'](),'unitId':_0x3172aa,'threadId':_0x3c78c6,'mention':_0x271ea4,'content':_0x3e625e,'replyId':_0x12a629},_0x128d2c=await this[_0x2f4563(0x106)][_0x2f4563(0x118)](_0x2f4563(0x131)+_0x3172aa+'/edit',{'body':_0xef3f82});return!_0x128d2c[_0x2f4563(0xb0)][_0x2f4563(0xdb)]||_0x128d2c['body'][_0x2f4563(0xdb)][_0x2f4563(0x12f)]===0x1;}async['resolveComment'](_0x3c65e7){const _0x4e1bc0=_0x4c01f8,{unitId:_0x51226a}=_0x3c65e7,_0x133065=_0x3c65e7['threadId'],_0x3c84a6={'memberId':this['_userService'][_0x4e1bc0(0x114)]()[_0x4e1bc0(0x109)],'unitId':_0x51226a,'threadId':_0x133065,'solved':_0x3c65e7[_0x4e1bc0(0x11e)]?_0x2a3227[_0x4e1bc0(0xdd)]:_0x2a3227['OpenOrReOpen']},_0x42c4a6=await this[_0x4e1bc0(0x106)]['post'](_0x4e1bc0(0x131)+_0x51226a+'/solved',{'body':_0x3c84a6});return!_0x42c4a6[_0x4e1bc0(0xb0)][_0x4e1bc0(0xdb)]||_0x42c4a6[_0x4e1bc0(0xb0)][_0x4e1bc0(0xdb)][_0x4e1bc0(0x12f)]===0x1;}async[_0x4c01f8(0x10d)](_0x32e183,_0x2dcad2,_0x1670e4,_0x1402bd){const _0x4469dc=_0x4c01f8,_0x5697c3={'memberId':(await this[_0x4469dc(0x102)][_0x4469dc(0xcd)](_0x32e183))['getMemberID'](),'threadId':_0x1670e4,'replyId':_0x1402bd,'unitId':_0x32e183},_0x13eb8a=await this['_httpService'][_0x4469dc(0x118)](_0x4469dc(0x131)+_0x32e183+_0x4469dc(0xb4),{'body':_0x5697c3});return!_0x13eb8a['body'][_0x4469dc(0xdb)]||_0x13eb8a[_0x4469dc(0xb0)][_0x4469dc(0xdb)][_0x4469dc(0x12f)]===0x1;}async[_0x4c01f8(0xaf)](_0x25996b,_0x3507d2,_0xeb0fe1){const _0x539141=_0x4c01f8,_0x282120={'unitId':_0x25996b,'threadId':_0xeb0fe1},_0x4cc698=await this['_httpService']['post']('/universer-api/comment/unit/'+_0x25996b+_0x539141(0xc2),{'body':_0x282120}),_0x48bb59=_0xeb0fe1['map'](_0xf1d1fb=>_0xbd643e(_0x4cc698[_0x539141(0xb0)][_0x539141(0xfc)][_0xf1d1fb],_0x25996b,_0x3507d2))[_0x539141(0x123)](Boolean);return Object[_0x539141(0x103)](_0x4cc698[_0x539141(0xb0)][_0x539141(0x11f)])[_0x539141(0xc0)](_0x4f01b8=>{const _0x43b152=_0x539141;this[_0x43b152(0xd4)][_0x43b152(0xd0)](_0x4f01b8);}),_0x48bb59;}['saveCommentToSnapshot'](_0x55a7fd){const _0x4aa0a8=_0x4c01f8;return{'id':_0x55a7fd['id'],'threadId':_0x55a7fd[_0x4aa0a8(0x135)],'ref':_0x55a7fd[_0x4aa0a8(0x125)]};}};_0x18650a=_0x47fbec([_0x37d4ee(0x0,_0x199161[_0x4c01f8(0xc1)](_0x48082b[_0x4c01f8(0xf7)])),_0x37d4ee(0x1,_0x199161[_0x4c01f8(0xc1)](_0x199161[_0x4c01f8(0xed)])),_0x37d4ee(0x2,_0x199161[_0x4c01f8(0xc1)](_0xceb99c['CollaborationSessionService'])),_0x37d4ee(0x3,_0x199161[_0x4c01f8(0xc1)](_0x199161[_0x4c01f8(0x10a)]))],_0x18650a);var _0x274bdb=Object['getOwnPropertyDescriptor'],_0x568fe7=(_0x4468e0,_0x26de9d,_0x2fa9e6,_0x31042b)=>{const _0x5472b1=_0x4c01f8;for(var _0x2b81f9=_0x31042b>0x1?void 0x0:_0x31042b?_0x274bdb(_0x26de9d,_0x2fa9e6):_0x26de9d,_0x453a2f=_0x4468e0[_0x5472b1(0xfa)]-0x1,_0x49e1f2;_0x453a2f>=0x0;_0x453a2f--)(_0x49e1f2=_0x4468e0[_0x453a2f])&&(_0x2b81f9=_0x49e1f2(_0x2b81f9)||_0x2b81f9);return _0x2b81f9;},_0x2e0a2d=(_0x16577d,_0x46c489)=>(_0x2b669d,_0x1f1b69)=>_0x46c489(_0x2b669d,_0x1f1b69,_0x16577d);let _0x428ba6=class extends _0x199161[_0x4c01f8(0x11a)]{constructor(_0x1b998d,_0x40aae7){const _0x5c27d1=_0x4c01f8;super(),this[_0x5c27d1(0x124)]=_0x1b998d,this[_0x5c27d1(0x128)]=_0x40aae7,this[_0x5c27d1(0xe3)]();}[_0x4c01f8(0xe3)](){const _0x19e12b=_0x4c01f8;this[_0x19e12b(0x124)][_0x19e12b(0xbb)]=this[_0x19e12b(0x128)],this[_0x19e12b(0x124)][_0x19e12b(0xf6)]=!0x1;}};_0x428ba6=_0x568fe7([_0x2e0a2d(0x0,_0x313bc5[_0x4c01f8(0xfe)]),_0x2e0a2d(0x1,_0x199161[_0x4c01f8(0xc1)](_0x18650a))],_0x428ba6);var _0x153f72=Object[_0x4c01f8(0x122)],_0x203c0c=Object[_0x4c01f8(0x11c)],_0x5c04e5=(_0x2f2e6c,_0x329364,_0xe8ebab)=>_0x329364 in _0x2f2e6c?_0x153f72(_0x2f2e6c,_0x329364,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0xe8ebab}):_0x2f2e6c[_0x329364]=_0xe8ebab,_0x29c621=(_0x4e5caa,_0x23af89,_0x339f06,_0x372b43)=>{const _0x50884d=_0x4c01f8;for(var _0x4e7337=_0x372b43>0x1?void 0x0:_0x372b43?_0x203c0c(_0x23af89,_0x339f06):_0x23af89,_0x5c239f=_0x4e5caa[_0x50884d(0xfa)]-0x1,_0xee7bd8;_0x5c239f>=0x0;_0x5c239f--)(_0xee7bd8=_0x4e5caa[_0x5c239f])&&(_0x4e7337=_0xee7bd8(_0x4e7337)||_0x4e7337);return _0x4e7337;},_0x3cc47b=(_0x1adf61,_0x448dad)=>(_0x5723eb,_0x1374fb)=>_0x448dad(_0x5723eb,_0x1374fb,_0x1adf61),_0x106854=(_0x434a01,_0xd294e9,_0x56eb8c)=>_0x5c04e5(_0x434a01,typeof _0xd294e9!='symbol'?_0xd294e9+'':_0xd294e9,_0x56eb8c);_0x58f319[_0x4c01f8(0x126)]=class extends _0x199161[_0x4c01f8(0xd8)]{constructor(_0x3a29b9=_0x369557,_0xde5783,_0x578882){const _0x18b955=_0x4c01f8;super(),this[_0x18b955(0x10e)]=_0x3a29b9,this['_injector']=_0xde5783,this[_0x18b955(0x10c)]=_0x578882;const {..._0x4f2e66}=_0x199161[_0x18b955(0xf3)]({},_0x369557,this['_config']);this[_0x18b955(0x10c)][_0x18b955(0xc4)](_0x2eadfa,_0x4f2e66);}['onStarting'](){const _0xad5c5e=_0x4c01f8;[[_0x18650a],[_0x428ba6],[_0x2f3ca1]][_0xad5c5e(0xc0)](_0x43b23a=>{const _0x523937=_0xad5c5e;this[_0x523937(0x115)][_0x523937(0xc7)](_0x43b23a);});}[_0x4c01f8(0x129)](){const _0x1504bd=_0x4c01f8;this[_0x1504bd(0x115)]['get'](_0x428ba6),this['_injector']['get'](_0x2f3ca1);}},_0x106854(_0x58f319['UniverThreadCommentDataSourcePlugin'],_0x4c01f8(0x127),_0x54e18f),_0x106854(_0x58f319[_0x4c01f8(0x126)],_0x4c01f8(0xd2),_0x199161[_0x4c01f8(0xee)][_0x4c01f8(0xcc)]),_0x58f319[_0x4c01f8(0x126)]=_0x29c621([_0x199161['DependentOn'](_0x59639f[_0x4c01f8(0xdf)],_0xceb99c[_0x4c01f8(0xd3)],_0x22e5e1[_0x4c01f8(0x132)]),_0x3cc47b(0x1,_0x199161[_0x4c01f8(0xc1)](_0x199161[_0x4c01f8(0x10a)])),_0x3cc47b(0x2,_0x199161[_0x4c01f8(0x130)])],_0x58f319[_0x4c01f8(0x126)]),Object[_0x4c01f8(0x122)](_0x58f319,Symbol[_0x4c01f8(0xe7)],{'value':_0x4c01f8(0xb3)});}));function _0x429b(_0x453daf,_0x5ac6ea){const _0x1ce316=_0x1ce3();return _0x429b=function(_0x429b22,_0x4ff317){_0x429b22=_0x429b22-0xaf;let _0x309c15=_0x1ce316[_0x429b22];return _0x309c15;},_0x429b(_0x453daf,_0x5ac6ea);}function _0x1ce3(){const _0x4a1ff3=['forEach','Inject','/list','UniverProCollaborationClient','setConfig','4LBiFoY','amd','add','3BuZCSg','CommentService','disposeWithMe','UniverProLicense','UNIVER_UNKNOWN','requireSession','map','YYYY/MM/DD\x20HH:mm','addUser','exports','type','UniverCollaborationClientPlugin','_userService','format','unitId','stringify','Plugin','comment','748088laLsHr','error','payload','Solved','subscribe','UniverThreadCommentUIPlugin','object','content','OpenOrReOpen','_initDataSource','1149176mnKQms','size','@univerjs-pro/collaboration-client','toStringTag','Edit','parentId','@univerjs-pro/license','Solve','customRanges','UserManagerService','UniverInstanceType','root','thread-comment-data-source.config','addComment','getMemberID','merge','Reply','/universer-api/user/list','syncUpdateMutationToColla','HTTPService','UniverNetwork','_commentService','length','resolveComment','comments','function','IThreadCommentDataSourceService','getUnit','userId','@univerjs/thread-comment','_sessionService','values','_init','2793ucSToE','_httpService','2505648iJbdEE','Delete','userID','Injector','bufferTime','_configService','deleteComment','_config','rangeType','COMMENT','personId','33670087AVTEqt','12344hStVZy','getCurrentUser','_injector','updateComment','ThreadCommentModel','post','UniverCore','Disposable','commentUpdate$','getOwnPropertyDescriptor','Unknown','resolved','users','getComment','dayjs','defineProperty','filter','_threadCommentDataSourceService','ref','UniverThreadCommentDataSourcePlugin','pluginName','_threadCommentDataSource','onReady','3205161hgfiTk','UNRECOGNIZED','3427235wzBJyB','_threadCommentModel','Add','code','IConfigService','/universer-api/comment/unit/','UniverLicensePlugin','_initUserSync','solved','threadId','replyId','listComments','body','@univerjs/thread-comment-ui','rangeId','Module','/delete','@univerjs/core','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','get','createTimestamp','replies','UniverThreadComment','dataSource','parse','rxjs','CustomRangeType','10RVYHiM'];_0x1ce3=function(){return _0x4a1ff3;};return _0x1ce3();}
|
|
1
|
+
(function(_0x37ae13,_0x5a5cbe){const _0x48274e=_0x2267,_0x369138=_0x37ae13();while(!![]){try{const _0x2c36fa=-parseInt(_0x48274e(0x1a5))/0x1*(parseInt(_0x48274e(0x138))/0x2)+-parseInt(_0x48274e(0x124))/0x3+parseInt(_0x48274e(0x13a))/0x4+parseInt(_0x48274e(0x155))/0x5*(-parseInt(_0x48274e(0x1a0))/0x6)+-parseInt(_0x48274e(0x19c))/0x7*(-parseInt(_0x48274e(0x157))/0x8)+parseInt(_0x48274e(0x126))/0x9*(parseInt(_0x48274e(0x12c))/0xa)+-parseInt(_0x48274e(0x16f))/0xb*(-parseInt(_0x48274e(0x19b))/0xc);if(_0x2c36fa===_0x5a5cbe)break;else _0x369138['push'](_0x369138['shift']());}catch(_0x1c8e54){_0x369138['push'](_0x369138['shift']());}}}(_0x2455,0xd2e20),function(_0x2b867e,_0x16f207){const _0x43d61f=_0x2267;typeof exports==_0x43d61f(0x1a3)&&typeof module<'u'?_0x16f207(exports,require('@univerjs-pro/collaboration-client'),require('@univerjs-pro/license'),require('@univerjs/core'),require('@univerjs/thread-comment-ui'),require('@univerjs/thread-comment'),require('rxjs'),require('@univerjs/network')):typeof define==_0x43d61f(0x175)&&define[_0x43d61f(0x150)]?define([_0x43d61f(0x159),_0x43d61f(0x143),_0x43d61f(0x133),'@univerjs/core',_0x43d61f(0x127),_0x43d61f(0x193),_0x43d61f(0x15d),'@univerjs/network'],_0x16f207):(_0x2b867e=typeof globalThis<'u'?globalThis:_0x2b867e||self,_0x16f207(_0x2b867e[_0x43d61f(0x199)]={},_0x2b867e['UniverProCollaborationClient'],_0x2b867e[_0x43d61f(0x1a7)],_0x2b867e['UniverCore'],_0x2b867e[_0x43d61f(0x154)],_0x2b867e[_0x43d61f(0x17c)],_0x2b867e[_0x43d61f(0x15d)],_0x2b867e[_0x43d61f(0x12b)]));}(this,function(_0x18e5b4,_0x5f3c61,_0x11fede,_0x501cc3,_0x418467,_0x24abdc,_0x5510be,_0x1311d3){'use strict';const _0x2baaa9=_0x2267;const _0x174803='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var _0xa4547d=(_0x2495f4=>(_0x2495f4[_0x2495f4[_0x2baaa9(0x132)]=0x0]=_0x2baaa9(0x132),_0x2495f4[_0x2495f4['Solved']=0x1]=_0x2baaa9(0x14f),_0x2495f4[_0x2495f4[_0x2baaa9(0x179)]=-0x1]=_0x2baaa9(0x179),_0x2495f4))(_0xa4547d||{}),_0x3dc639=(_0xa9a032=>(_0xa9a032[_0xa9a032[_0x2baaa9(0x14a)]=0x0]='Unknown',_0xa9a032[_0xa9a032['Add']=0x1]=_0x2baaa9(0x192),_0xa9a032[_0xa9a032[_0x2baaa9(0x12e)]=0x2]=_0x2baaa9(0x12e),_0xa9a032[_0xa9a032[_0x2baaa9(0x15c)]=0x3]=_0x2baaa9(0x15c),_0xa9a032[_0xa9a032[_0x2baaa9(0x12a)]=0x4]='Delete',_0xa9a032[_0xa9a032[_0x2baaa9(0x152)]=0x5]=_0x2baaa9(0x152),_0xa9a032[_0xa9a032[_0x2baaa9(0x179)]=-0x1]='UNRECOGNIZED',_0xa9a032))(_0x3dc639||{});const _0x1d4ebb=_0x3a193b=>_0x501cc3[_0x2baaa9(0x144)](new Date(+_0x3a193b))['format'](_0x2baaa9(0x194)),_0x59220f=async(_0x1abdf2,_0x317bad)=>{const _0x5ed52b=_0x2baaa9,_0x585fd1=_0x1abdf2[_0x5ed52b(0x136)](_0x501cc3['UserManagerService']),_0xede2d6=_0x1abdf2[_0x5ed52b(0x136)](_0x1311d3[_0x5ed52b(0x148)]);_0x317bad[_0x5ed52b(0x189)](_0x2b38ba=>{const _0x174e69=_0x5ed52b;_0x585fd1[_0x174e69(0x183)](_0x2b38ba)&&_0x317bad[_0x174e69(0x170)](_0x2b38ba);}),_0x317bad['size']&&(await _0xede2d6[_0x5ed52b(0x136)]('/universer-api/user/list',{'params':{'userIDs':[..._0x317bad]}}))['body']['users'][_0x5ed52b(0x189)](_0x4c22a=>{const _0x93ffba=_0x5ed52b;_0x4c22a&&_0x585fd1[_0x93ffba(0x182)](_0x4c22a);});};var _0xbac97=Object[_0x2baaa9(0x13b)],_0x844ec0=(_0x2beb31,_0x1cd827,_0x54b6bb,_0x1b365)=>{const _0xdfe69d=_0x2baaa9;for(var _0x12d335=_0x1b365>0x1?void 0x0:_0x1b365?_0xbac97(_0x1cd827,_0x54b6bb):_0x1cd827,_0x13223f=_0x2beb31[_0xdfe69d(0x14b)]-0x1,_0x2994ba;_0x13223f>=0x0;_0x13223f--)(_0x2994ba=_0x2beb31[_0x13223f])&&(_0x12d335=_0x2994ba(_0x12d335)||_0x12d335);return _0x12d335;},_0x473db9=(_0x35725d,_0x19e3ad)=>(_0x69dacd,_0x4d7879)=>_0x19e3ad(_0x69dacd,_0x4d7879,_0x35725d);let _0x4a3036=class extends _0x501cc3[_0x2baaa9(0x180)]{constructor(_0x1b3c15,_0x4c2acf,_0xbacdfb,_0x3c37ed){const _0x426d90=_0x2baaa9;super(),this['_commentService']=_0x1b3c15,this[_0x426d90(0x19d)]=_0x4c2acf,this['_userService']=_0xbacdfb,this[_0x426d90(0x134)]=_0x3c37ed,this[_0x426d90(0x16e)](),this[_0x426d90(0x18c)]();}[_0x2baaa9(0x18c)](){const _0x13646c=_0x2baaa9;this['disposeWithMe'](this['_threadCommentModel'][_0x13646c(0x17f)]['pipe'](_0x5510be[_0x13646c(0x18d)](0x10))['subscribe'](_0x4f3197=>{const _0x111ed6=_0x13646c,_0x5dc08e=new Set();_0x4f3197[_0x111ed6(0x189)](_0x4ea432=>{const _0x381b3b=_0x111ed6;switch(_0x4ea432[_0x381b3b(0x15e)]){case _0x381b3b(0x162):{const _0x58ac66=_0x4ea432[_0x381b3b(0x16a)][_0x381b3b(0x171)];_0x5dc08e['add'](_0x58ac66);break;}}}),_0x59220f(this['_injector'],_0x5dc08e);}));}['_init'](){const _0x129fed=_0x2baaa9;this[_0x129fed(0x169)](this[_0x129fed(0x14c)][_0x129fed(0x17f)][_0x129fed(0x18e)](async _0x132817=>{const _0x3bec6d=_0x129fed;var _0x15fb9c,_0x14c88a,_0x3200cb,_0x24d51e;const _0x4fea29=(_0x15fb9c=this[_0x3bec6d(0x19d)][_0x3bec6d(0x15b)](_0x132817[_0x3bec6d(0x18f)])[_0x3bec6d(0x149)](_0x1eb50e=>_0x1eb50e[_0x3bec6d(0x176)]===_0x132817['threadId']))==null?void 0x0:_0x15fb9c[_0x3bec6d(0x131)];if(!_0x4fea29)return;const {unitId:_0x4de98e,subUnitId:_0x46be9b}=_0x4fea29;switch(_0x132817['user']&&this[_0x3bec6d(0x156)][_0x3bec6d(0x182)](_0x132817[_0x3bec6d(0x186)]),_0x132817['type']){case _0x3dc639[_0x3bec6d(0x192)]:break;case _0x3dc639['Reply']:{this[_0x3bec6d(0x19d)]['addComment'](_0x4de98e,_0x46be9b,{'unitId':_0x4de98e,'subUnitId':_0x46be9b,'ref':'','id':_0x132817['replyId'],'dT':_0x1d4ebb(+_0x132817[_0x3bec6d(0x173)]),'threadId':_0x132817[_0x3bec6d(0x176)],'personId':(_0x3200cb=(_0x14c88a=_0x132817[_0x3bec6d(0x186)])==null?void 0x0:_0x14c88a['userID'])!=null?_0x3200cb:_0x132817[_0x3bec6d(0x184)],'text':JSON[_0x3bec6d(0x160)](_0x132817['content']),'parentId':_0x4fea29['id']});break;}case _0x3dc639[_0x3bec6d(0x12a)]:{const _0x30162a=this['_threadCommentModel'][_0x3bec6d(0x13c)](_0x4de98e,_0x46be9b,_0x132817[_0x3bec6d(0x145)]);_0x30162a&&_0x30162a[_0x3bec6d(0x19e)]&&this[_0x3bec6d(0x19d)][_0x3bec6d(0x197)](_0x4de98e,_0x46be9b,_0x132817[_0x3bec6d(0x145)]);break;}case _0x3dc639['Edit']:{this[_0x3bec6d(0x19d)][_0x3bec6d(0x17e)](_0x4de98e,_0x46be9b,{'commentId':_0x132817['replyId'],'text':JSON[_0x3bec6d(0x160)](_0x132817[_0x3bec6d(0x140)])});break;}case _0x3dc639[_0x3bec6d(0x152)]:{const _0x44ceff=(_0x24d51e=this[_0x3bec6d(0x19d)][_0x3bec6d(0x15b)](_0x132817[_0x3bec6d(0x18f)])[_0x3bec6d(0x149)](_0x4b260a=>_0x4b260a['threadId']===_0x132817[_0x3bec6d(0x176)]))==null?void 0x0:_0x24d51e[_0x3bec6d(0x131)];_0x44ceff&&this['_threadCommentModel'][_0x3bec6d(0x14d)](_0x4de98e,_0x46be9b,_0x44ceff['id'],_0x132817[_0x3bec6d(0x18a)]===_0xa4547d[_0x3bec6d(0x14f)]);break;}}}));}};_0x4a3036=_0x844ec0([_0x473db9(0x0,_0x501cc3['Inject'](_0x5f3c61['CommentService'])),_0x473db9(0x1,_0x501cc3[_0x2baaa9(0x142)](_0x24abdc[_0x2baaa9(0x161)])),_0x473db9(0x2,_0x501cc3[_0x2baaa9(0x142)](_0x501cc3[_0x2baaa9(0x137)])),_0x473db9(0x3,_0x501cc3['Inject'](_0x501cc3[_0x2baaa9(0x1a4)]))],_0x4a3036);const _0x593c3c=_0x2baaa9(0x187),_0x112cff={};var _0x2a0bd3=Object[_0x2baaa9(0x13b)],_0x5ef65a=(_0x481cd5,_0x18a98a,_0x58298,_0x2e7d31)=>{const _0x30f800=_0x2baaa9;for(var _0x4ba74d=_0x2e7d31>0x1?void 0x0:_0x2e7d31?_0x2a0bd3(_0x18a98a,_0x58298):_0x18a98a,_0x30f1d0=_0x481cd5[_0x30f800(0x14b)]-0x1,_0x444753;_0x30f1d0>=0x0;_0x30f1d0--)(_0x444753=_0x481cd5[_0x30f1d0])&&(_0x4ba74d=_0x444753(_0x4ba74d)||_0x4ba74d);return _0x4ba74d;},_0x16178c=(_0x3e7bcf,_0x3b3eb7)=>(_0x179dcc,_0x164099)=>_0x3b3eb7(_0x179dcc,_0x164099,_0x3e7bcf);function _0x3a7773(_0xd60066,_0x4b22d5){const _0x4e9c1f=_0x2baaa9,_0x193a83=_0xd60066[_0x4e9c1f(0x190)][0x0];return{..._0x4b22d5,'id':_0x193a83[_0x4e9c1f(0x145)],'resolved':_0xd60066[_0x4e9c1f(0x18a)]===0x1,'dT':_0x1d4ebb(_0x193a83[_0x4e9c1f(0x173)]),'personId':_0x193a83[_0x4e9c1f(0x184)],'threadId':_0x193a83[_0x4e9c1f(0x176)]};}function _0x3a55da(_0x46c22c,_0x16aa4a,_0x3a66af){const _0x2ac836=_0x2baaa9;var _0x1889ba,_0x1c397a;if(((_0x1c397a=(_0x1889ba=_0x46c22c==null?void 0x0:_0x46c22c[_0x2ac836(0x190)])==null?void 0x0:_0x1889ba[_0x2ac836(0x14b)])!=null?_0x1c397a:0x0)>0x0){const _0x5ec54a=(_0x32436b,_0x5b6f82)=>({'id':_0x32436b[_0x2ac836(0x145)],'threadId':_0x32436b[_0x2ac836(0x176)],'dT':_0x1d4ebb(_0x32436b[_0x2ac836(0x173)]),'personId':_0x32436b['userId'],'resolved':_0x46c22c[_0x2ac836(0x18a)]===_0xa4547d[_0x2ac836(0x14f)],'unitId':_0x16aa4a,'subUnitId':_0x3a66af,'text':JSON[_0x2ac836(0x160)](_0x32436b[_0x2ac836(0x140)]),'parentId':_0x5b6f82}),_0x2a048d=_0x5ec54a(_0x46c22c['replies'][0x0]);return{..._0x2a048d,'children':_0x46c22c[_0x2ac836(0x190)][_0x2ac836(0x17b)](0x1)[_0x2ac836(0x146)](_0x1e9731=>_0x5ec54a(_0x1e9731,_0x2a048d['id']))};}return null;}let _0x4a09a1=class{constructor(_0x500474,_0x2211df,_0x3e4ca3,_0xb69cf8){const _0x29bc55=_0x2baaa9;this['_httpService']=_0x500474,this[_0x29bc55(0x156)]=_0x2211df,this[_0x29bc55(0x15f)]=_0x3e4ca3,this[_0x29bc55(0x134)]=_0xb69cf8;}async['addComment'](_0x21683c){const _0x477650=_0x2baaa9;var _0x3e935c,_0x2f3a21;const {parentId:_0x36fd15,unitId:_0x528350,text:_0x958ff2,threadId:_0x417487}=_0x21683c,_0x3a52eb=(_0x2f3a21=(_0x3e935c=_0x958ff2[_0x477650(0x195)])==null?void 0x0:_0x3e935c[_0x477650(0x15a)](_0x4bdefd=>_0x4bdefd[_0x477650(0x181)]===_0x501cc3[_0x477650(0x13d)][_0x477650(0x16d)])[_0x477650(0x146)](_0x5d09d9=>_0x5d09d9['rangeId']))!=null?_0x2f3a21:[],_0x22d2d=JSON[_0x477650(0x185)](_0x958ff2),_0xacbe57=(await this[_0x477650(0x15f)][_0x477650(0x147)](_0x528350))[_0x477650(0x19f)]();if(_0x36fd15){const _0x4fa1cc={'memberId':_0xacbe57,'unitId':_0x528350,'content':_0x22d2d,'mention':_0x3a52eb,'threadId':_0x417487},_0x3f1933=(await this[_0x477650(0x17a)]['post'](_0x477650(0x163)+_0x528350+_0x477650(0x188),{'body':_0x4fa1cc}))[_0x477650(0x151)]['reply'];return{..._0x21683c,'id':_0x3f1933[_0x477650(0x145)],'dT':_0x501cc3[_0x477650(0x144)](+_0x3f1933[_0x477650(0x173)])[_0x477650(0x14e)](_0x477650(0x194)),'personId':_0x3f1933[_0x477650(0x184)]};}else{const _0x3ec239={'memberId':_0xacbe57,'unitId':_0x528350,'content':_0x22d2d,'mention':_0x3a52eb},_0x17b483=await this[_0x477650(0x17a)][_0x477650(0x129)](_0x477650(0x163)+_0x528350+_0x477650(0x174),{'body':_0x3ec239});return _0x3a7773(_0x17b483[_0x477650(0x151)]['comment'],_0x21683c);}}async[_0x2baaa9(0x17e)](_0x58ccb6){const _0x3e27cb=_0x2baaa9;var _0x4c9974,_0x1d9d08;const {text:_0x3975a0,unitId:_0x1f8191}=_0x58ccb6,_0x556969=(_0x1d9d08=(_0x4c9974=_0x3975a0['customRanges'])==null?void 0x0:_0x4c9974['filter'](_0x5e0dce=>_0x5e0dce[_0x3e27cb(0x181)]===_0x501cc3[_0x3e27cb(0x13d)][_0x3e27cb(0x16d)])[_0x3e27cb(0x146)](_0x46cc89=>_0x46cc89['rangeId']))!=null?_0x1d9d08:[],_0x22bfb1=JSON[_0x3e27cb(0x185)](_0x3975a0),_0x58fa5c=_0x58ccb6[_0x3e27cb(0x176)],_0xe89cce=_0x58ccb6['id'],_0x25a4b0={'memberId':(await this[_0x3e27cb(0x15f)][_0x3e27cb(0x147)](_0x1f8191))[_0x3e27cb(0x19f)](),'unitId':_0x1f8191,'threadId':_0x58fa5c,'mention':_0x556969,'content':_0x22bfb1,'replyId':_0xe89cce},_0x17f970=await this[_0x3e27cb(0x17a)][_0x3e27cb(0x129)](_0x3e27cb(0x163)+_0x1f8191+_0x3e27cb(0x130),{'body':_0x25a4b0});return!_0x17f970[_0x3e27cb(0x151)][_0x3e27cb(0x139)]||_0x17f970[_0x3e27cb(0x151)]['error']['code']===0x1;}async[_0x2baaa9(0x14d)](_0x55d329){const _0x373a5f=_0x2baaa9,{unitId:_0xa644c9}=_0x55d329,_0x445278=_0x55d329[_0x373a5f(0x176)],_0x4c0fc5={'memberId':this[_0x373a5f(0x156)][_0x373a5f(0x196)]()['userID'],'unitId':_0xa644c9,'threadId':_0x445278,'solved':_0x55d329[_0x373a5f(0x153)]?_0xa4547d[_0x373a5f(0x14f)]:_0xa4547d[_0x373a5f(0x132)]},_0x4c3441=await this[_0x373a5f(0x17a)][_0x373a5f(0x129)]('/universer-api/comment/unit/'+_0xa644c9+_0x373a5f(0x198),{'body':_0x4c0fc5});return!_0x4c3441[_0x373a5f(0x151)][_0x373a5f(0x139)]||_0x4c3441[_0x373a5f(0x151)][_0x373a5f(0x139)][_0x373a5f(0x16b)]===0x1;}async[_0x2baaa9(0x197)](_0x21c5db,_0x3a00ed,_0x15a23a,_0x543e34){const _0x5a5f0=_0x2baaa9,_0x2f194f={'memberId':(await this[_0x5a5f0(0x15f)][_0x5a5f0(0x147)](_0x21c5db))[_0x5a5f0(0x19f)](),'threadId':_0x15a23a,'replyId':_0x543e34,'unitId':_0x21c5db},_0x2f0988=await this[_0x5a5f0(0x17a)]['post'](_0x5a5f0(0x163)+_0x21c5db+_0x5a5f0(0x168),{'body':_0x2f194f});return!_0x2f0988[_0x5a5f0(0x151)][_0x5a5f0(0x139)]||_0x2f0988[_0x5a5f0(0x151)][_0x5a5f0(0x139)][_0x5a5f0(0x16b)]===0x1;}async['listComments'](_0xfb0e29,_0x1a4224,_0x4dfaba){const _0x2f0f03=_0x2baaa9,_0x5c87a6={'unitId':_0xfb0e29,'threadId':_0x4dfaba},_0x383b64=await this[_0x2f0f03(0x17a)][_0x2f0f03(0x129)](_0x2f0f03(0x163)+_0xfb0e29+_0x2f0f03(0x177),{'body':_0x5c87a6}),_0x22d53b=_0x4dfaba['map'](_0x213a6a=>_0x3a55da(_0x383b64[_0x2f0f03(0x151)][_0x2f0f03(0x178)][_0x213a6a],_0xfb0e29,_0x1a4224))[_0x2f0f03(0x15a)](Boolean);return Object[_0x2f0f03(0x13e)](_0x383b64[_0x2f0f03(0x151)][_0x2f0f03(0x158)])[_0x2f0f03(0x189)](_0xb1e878=>{const _0x1378f3=_0x2f0f03;this['_userService'][_0x1378f3(0x182)](_0xb1e878);}),_0x22d53b;}[_0x2baaa9(0x12d)](_0x471735){const _0x9806ea=_0x2baaa9;return{'id':_0x471735['id'],'threadId':_0x471735['threadId'],'ref':_0x471735[_0x9806ea(0x1a6)]};}};_0x4a09a1=_0x5ef65a([_0x16178c(0x0,_0x501cc3['Inject'](_0x1311d3[_0x2baaa9(0x148)])),_0x16178c(0x1,_0x501cc3[_0x2baaa9(0x142)](_0x501cc3[_0x2baaa9(0x137)])),_0x16178c(0x2,_0x501cc3[_0x2baaa9(0x142)](_0x5f3c61[_0x2baaa9(0x18b)])),_0x16178c(0x3,_0x501cc3[_0x2baaa9(0x142)](_0x501cc3[_0x2baaa9(0x1a4)]))],_0x4a09a1);var _0x1b819d=Object[_0x2baaa9(0x13b)],_0x241cc5=(_0x1f3afd,_0x4f27f0,_0x55266d,_0x1a54a0)=>{const _0x5edf39=_0x2baaa9;for(var _0x28ba91=_0x1a54a0>0x1?void 0x0:_0x1a54a0?_0x1b819d(_0x4f27f0,_0x55266d):_0x4f27f0,_0x24fbfe=_0x1f3afd[_0x5edf39(0x14b)]-0x1,_0xea4827;_0x24fbfe>=0x0;_0x24fbfe--)(_0xea4827=_0x1f3afd[_0x24fbfe])&&(_0x28ba91=_0xea4827(_0x28ba91)||_0x28ba91);return _0x28ba91;},_0x53fba2=(_0xbed04a,_0xc7887d)=>(_0x1c8624,_0xd89f6d)=>_0xc7887d(_0x1c8624,_0xd89f6d,_0xbed04a);let _0x5a72e8=class extends _0x501cc3[_0x2baaa9(0x180)]{constructor(_0x37fde5,_0x44c06c){const _0x43967b=_0x2baaa9;super(),this[_0x43967b(0x141)]=_0x37fde5,this['_threadCommentDataSource']=_0x44c06c,this[_0x43967b(0x172)]();}['_initDataSource'](){const _0x580ecd=_0x2baaa9;this[_0x580ecd(0x141)][_0x580ecd(0x165)]=this[_0x580ecd(0x135)],this[_0x580ecd(0x141)]['syncUpdateMutationToColla']=!0x1;}};_0x5a72e8=_0x241cc5([_0x53fba2(0x0,_0x24abdc['IThreadCommentDataSourceService']),_0x53fba2(0x1,_0x501cc3[_0x2baaa9(0x142)](_0x4a09a1))],_0x5a72e8);var _0x1706a9=Object['defineProperty'],_0x45938e=Object[_0x2baaa9(0x13b)],_0x271ffa=(_0x155705,_0x275e7e,_0x477101)=>_0x275e7e in _0x155705?_0x1706a9(_0x155705,_0x275e7e,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x477101}):_0x155705[_0x275e7e]=_0x477101,_0x1bc9d0=(_0xff431,_0x2e63bf,_0x510b46,_0x4bf814)=>{const _0x325988=_0x2baaa9;for(var _0xe1f790=_0x4bf814>0x1?void 0x0:_0x4bf814?_0x45938e(_0x2e63bf,_0x510b46):_0x2e63bf,_0x2a3050=_0xff431[_0x325988(0x14b)]-0x1,_0x539467;_0x2a3050>=0x0;_0x2a3050--)(_0x539467=_0xff431[_0x2a3050])&&(_0xe1f790=_0x539467(_0xe1f790)||_0xe1f790);return _0xe1f790;},_0x3e6875=(_0x547f10,_0x594276)=>(_0x449ad1,_0x33c177)=>_0x594276(_0x449ad1,_0x33c177,_0x547f10),_0x1f5204=(_0x1f8449,_0x42cf6b,_0xe8eda2)=>_0x271ffa(_0x1f8449,typeof _0x42cf6b!=_0x2baaa9(0x164)?_0x42cf6b+'':_0x42cf6b,_0xe8eda2);_0x18e5b4[_0x2baaa9(0x16c)]=class extends _0x501cc3[_0x2baaa9(0x167)]{constructor(_0x3a309e=_0x112cff,_0x30e43c,_0x255c35){const _0x1dfdc1=_0x2baaa9;super(),this[_0x1dfdc1(0x128)]=_0x3a309e,this[_0x1dfdc1(0x134)]=_0x30e43c,this['_configService']=_0x255c35;const {..._0x53b5c7}=_0x501cc3[_0x1dfdc1(0x19a)]({},_0x112cff,this[_0x1dfdc1(0x128)]);this['_configService'][_0x1dfdc1(0x166)](_0x593c3c,_0x53b5c7);}[_0x2baaa9(0x1a2)](){const _0x5adeed=_0x2baaa9;[[_0x4a09a1],[_0x5a72e8],[_0x4a3036]][_0x5adeed(0x189)](_0x2ce39a=>{const _0x4c6dea=_0x5adeed;this['_injector'][_0x4c6dea(0x162)](_0x2ce39a);});}[_0x2baaa9(0x17d)](){const _0x1880a0=_0x2baaa9;this[_0x1880a0(0x134)][_0x1880a0(0x136)](_0x5a72e8),this[_0x1880a0(0x134)]['get'](_0x4a3036);}},_0x1f5204(_0x18e5b4[_0x2baaa9(0x16c)],'pluginName',_0x174803),_0x1f5204(_0x18e5b4[_0x2baaa9(0x16c)],_0x2baaa9(0x15e),_0x501cc3[_0x2baaa9(0x125)][_0x2baaa9(0x1a1)]),_0x18e5b4[_0x2baaa9(0x16c)]=_0x1bc9d0([_0x501cc3['DependentOn'](_0x418467['UniverThreadCommentUIPlugin'],_0x5f3c61['UniverCollaborationClientPlugin'],_0x11fede['UniverLicensePlugin']),_0x3e6875(0x1,_0x501cc3[_0x2baaa9(0x142)](_0x501cc3[_0x2baaa9(0x1a4)])),_0x3e6875(0x2,_0x501cc3[_0x2baaa9(0x12f)])],_0x18e5b4['UniverThreadCommentDataSourcePlugin']),Object[_0x2baaa9(0x13f)](_0x18e5b4,Symbol['toStringTag'],{'value':_0x2baaa9(0x191)});}));function _0x2267(_0x3f7a0e,_0x211d0f){const _0x245545=_0x2455();return _0x2267=function(_0x226774,_0x52293f){_0x226774=_0x226774-0x124;let _0x28683e=_0x245545[_0x226774];return _0x28683e;},_0x2267(_0x3f7a0e,_0x211d0f);}function _0x2455(){const _0x1741fa=['object','Injector','1qNWWLq','ref','UniverProLicense','4325610RofXLy','UniverInstanceType','27pAnDJS','@univerjs/thread-comment-ui','_config','post','Delete','UniverNetwork','496420JvrBeC','saveCommentToSnapshot','Reply','IConfigService','/edit','root','OpenOrReOpen','@univerjs-pro/license','_injector','_threadCommentDataSource','get','UserManagerService','908042qXlyRA','error','6218000gVmkxT','getOwnPropertyDescriptor','getComment','CustomRangeType','values','defineProperty','content','_threadCommentDataSourceService','Inject','@univerjs-pro/collaboration-client','dayjs','replyId','map','requireSession','HTTPService','find','Unknown','length','_commentService','resolveComment','format','Solved','amd','body','Solve','resolved','UniverThreadCommentUi','2845GmYhfr','_userService','19360KxRrDA','users','exports','filter','getUnit','Edit','rxjs','type','_sessionService','parse','ThreadCommentModel','add','/universer-api/comment/unit/','symbol','dataSource','setConfig','Plugin','/delete','disposeWithMe','payload','code','UniverThreadCommentDataSourcePlugin','COMMENT','_init','5841cLgDys','delete','personId','_initDataSource','createTimestamp','/add','function','threadId','/list','comments','UNRECOGNIZED','_httpService','slice','UniverThreadComment','onReady','updateComment','commentUpdate$','Disposable','rangeType','addUser','getUser','userId','stringify','user','thread-comment-data-source.config','/reply','forEach','solved','CollaborationSessionService','_initUserSync','bufferTime','subscribe','unitId','replies','Module','Add','@univerjs/thread-comment','YYYY/MM/DD\x20HH:mm','customRanges','getCurrentUser','deleteComment','/solved','UniverProThreadCommentDatasource','merge','36828rTZOUj','616GtKSkE','_threadCommentModel','parentId','getMemberID','8292taVckK','UNIVER_UNKNOWN','onStarting'];_0x2455=function(){return _0x1741fa;};return _0x2455();}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs-pro/thread-comment-datasource",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1-nightly.202507041607",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -45,20 +45,20 @@
|
|
|
45
45
|
"rxjs": ">=7.0.0"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@univerjs-pro/collaboration-client": "0.
|
|
49
|
-
"@univerjs/
|
|
50
|
-
"@univerjs
|
|
51
|
-
"@univerjs/network": "0.8.3",
|
|
52
|
-
"@univerjs/thread-comment": "0.8.3",
|
|
48
|
+
"@univerjs-pro/collaboration-client": "0.9.1-nightly.202507041607",
|
|
49
|
+
"@univerjs-pro/license": "0.9.1-nightly.202507041607",
|
|
50
|
+
"@univerjs/network": "0.9.1-nightly.202507041607",
|
|
53
51
|
"@univerjs/protocol": "0.1.47-alpha.0",
|
|
54
|
-
"@univerjs/
|
|
52
|
+
"@univerjs/core": "0.9.1-nightly.202507041607",
|
|
53
|
+
"@univerjs/thread-comment": "0.9.1-nightly.202507041607",
|
|
54
|
+
"@univerjs/thread-comment-ui": "0.9.1-nightly.202507041607"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"rxjs": "7.8.2",
|
|
58
58
|
"typescript": "^5.8.3",
|
|
59
59
|
"vite": "^6.3.5",
|
|
60
60
|
"vitest": "^3.2.4",
|
|
61
|
-
"@univerjs-infra/shared": "0.
|
|
61
|
+
"@univerjs-infra/shared": "0.9.1"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"test": "vitest run",
|