@univerjs-pro/thread-comment-datasource 0.8.0-nightly.202506091607 → 0.8.0-nightly.202506101607
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 +1 -1
- package/lib/es/index.js +1 -1
- package/lib/index.js +1 -1
- package/lib/types/services/comment.data-source.d.ts +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +8 -8
package/lib/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const _0x1d7798=_0x3869;(function(_0x177410,_0x5e7d6b){const _0x24a8dc=_0x3869,_0x470920=_0x177410();while(!![]){try{const _0x15e108=-parseInt(_0x24a8dc(0x21a))/0x1*(-parseInt(_0x24a8dc(0x1e4))/0x2)+-parseInt(_0x24a8dc(0x208))/0x3*(-parseInt(_0x24a8dc(0x1ef))/0x4)+-parseInt(_0x24a8dc(0x1db))/0x5+-parseInt(_0x24a8dc(0x244))/0x6*(-parseInt(_0x24a8dc(0x1e9))/0x7)+parseInt(_0x24a8dc(0x23c))/0x8+parseInt(_0x24a8dc(0x1f9))/0x9*(parseInt(_0x24a8dc(0x20c))/0xa)+-parseInt(_0x24a8dc(0x236))/0xb;if(_0x15e108===_0x5e7d6b)break;else _0x470920['push'](_0x470920['shift']());}catch(_0x490fba){_0x470920['push'](_0x470920['shift']());}}}(_0x36c7,0xd175f));Object[_0x1d7798(0x1fd)](exports,Symbol[_0x1d7798(0x225)],{'value':_0x1d7798(0x209)});const b=require(_0x1d7798(0x246)),T=require(_0x1d7798(0x23b)),c=require('@univerjs/core'),j=require(_0x1d7798(0x23f)),M=require('@univerjs/thread-comment'),w=require('rxjs'),P=require(_0x1d7798(0x239)),U=_0x1d7798(0x217);var I=(_0x2c36a6=>(_0x2c36a6[_0x2c36a6['OpenOrReOpen']=0x0]=_0x1d7798(0x22e),_0x2c36a6[_0x2c36a6[_0x1d7798(0x1e5)]=0x1]=_0x1d7798(0x1e5),_0x2c36a6[_0x2c36a6['UNRECOGNIZED']=-0x1]=_0x1d7798(0x1f5),_0x2c36a6))(I||{}),v=(_0x3aadaf=>(_0x3aadaf[_0x3aadaf[_0x1d7798(0x201)]=0x0]=_0x1d7798(0x201),_0x3aadaf[_0x3aadaf[_0x1d7798(0x1e6)]=0x1]=_0x1d7798(0x1e6),_0x3aadaf[_0x3aadaf[_0x1d7798(0x221)]=0x2]=_0x1d7798(0x221),_0x3aadaf[_0x3aadaf[_0x1d7798(0x20f)]=0x3]=_0x1d7798(0x20f),_0x3aadaf[_0x3aadaf[_0x1d7798(0x1eb)]=0x4]='Delete',_0x3aadaf[_0x3aadaf[_0x1d7798(0x232)]=0x5]=_0x1d7798(0x232),_0x3aadaf[_0x3aadaf[_0x1d7798(0x1f5)]=-0x1]='UNRECOGNIZED',_0x3aadaf))(v||{});const f=_0x2d48fa=>c[_0x1d7798(0x204)](new Date(+_0x2d48fa))[_0x1d7798(0x226)]('YYYY/MM/DD\x20HH:mm'),R=async(_0x5efb1d,_0x44c0b)=>{const _0x5f4044=_0x1d7798,_0x4a739d=_0x5efb1d[_0x5f4044(0x20a)](c['UserManagerService']),_0x18465b=_0x5efb1d[_0x5f4044(0x20a)](P[_0x5f4044(0x1d6)]);_0x44c0b[_0x5f4044(0x1d1)](_0x1d03b1=>{const _0x67974b=_0x5f4044;_0x4a739d[_0x67974b(0x1ec)](_0x1d03b1)&&_0x44c0b[_0x67974b(0x215)](_0x1d03b1);}),_0x44c0b[_0x5f4044(0x1fc)]&&(await _0x18465b[_0x5f4044(0x20a)](_0x5f4044(0x1cb),{'params':{'userIDs':[..._0x44c0b]}}))[_0x5f4044(0x1fa)]['users'][_0x5f4044(0x1d1)](_0xf2eacd=>{const _0x5ce26a=_0x5f4044;_0xf2eacd&&_0x4a739d[_0x5ce26a(0x1ee)](_0xf2eacd);});};var $=Object[_0x1d7798(0x1e2)],E=(_0x1c5e1e,_0x386156,_0x9aa504,_0x5833f2)=>{const _0x5bb9be=_0x1d7798;for(var _0x35fae8=_0x5833f2>0x1?void 0x0:_0x5833f2?$(_0x386156,_0x9aa504):_0x386156,_0x13c441=_0x1c5e1e[_0x5bb9be(0x1d4)]-0x1,_0x382859;_0x13c441>=0x0;_0x13c441--)(_0x382859=_0x1c5e1e[_0x13c441])&&(_0x35fae8=_0x382859(_0x35fae8)||_0x35fae8);return _0x35fae8;},S=(_0x13859a,_0x2bd1a1)=>(_0x1be4e2,_0x3977e2)=>_0x2bd1a1(_0x1be4e2,_0x3977e2,_0x13859a);let p=class extends c[_0x1d7798(0x1f6)]{constructor(_0x2b4ec6,_0x2b2674,_0x253ffe,_0x5a9967){const _0x45225f=_0x1d7798;super(),this[_0x45225f(0x203)]=_0x2b4ec6,this['_threadCommentModel']=_0x2b2674,this[_0x45225f(0x240)]=_0x253ffe,this[_0x45225f(0x202)]=_0x5a9967,this[_0x45225f(0x1f8)](),this[_0x45225f(0x212)]();}[_0x1d7798(0x212)](){const _0x2684cb=_0x1d7798;this['disposeWithMe'](this['_threadCommentModel'][_0x2684cb(0x22f)]['pipe'](w['bufferTime'](0x10))['subscribe'](_0x41d66c=>{const _0x3e73b1=_0x2684cb,_0x426860=new Set();_0x41d66c[_0x3e73b1(0x1d1)](_0x1b3244=>{const _0x105363=_0x3e73b1;switch(_0x1b3244[_0x105363(0x21d)]){case _0x105363(0x228):{const _0x536d46=_0x1b3244[_0x105363(0x231)]['personId'];_0x426860['add'](_0x536d46);break;}}}),R(this[_0x3e73b1(0x202)],_0x426860);}));}['_init'](){const _0x15ea75=_0x1d7798;this[_0x15ea75(0x1d9)](this[_0x15ea75(0x203)]['commentUpdate$'][_0x15ea75(0x23d)](async _0x4ba01c=>{const _0x5367f9=_0x15ea75;var _0x28c56e,_0x465841,_0x10bba1,_0xd90d2d;const _0x2a6986=(_0x28c56e=this[_0x5367f9(0x1f1)]['getUnit'](_0x4ba01c[_0x5367f9(0x1d8)])[_0x5367f9(0x214)](_0x4dbcb5=>_0x4dbcb5[_0x5367f9(0x245)]===_0x4ba01c[_0x5367f9(0x245)]))==null?void 0x0:_0x28c56e[_0x5367f9(0x22d)];if(!_0x2a6986)return;const {unitId:_0x226590,subUnitId:_0xfd97ba}=_0x2a6986;switch(_0x4ba01c['user']&&this['_userService'][_0x5367f9(0x1ee)](_0x4ba01c['user']),_0x4ba01c[_0x5367f9(0x21d)]){case v[_0x5367f9(0x1e6)]:break;case v[_0x5367f9(0x221)]:{this[_0x5367f9(0x1f1)][_0x5367f9(0x213)](_0x226590,_0xfd97ba,{'unitId':_0x226590,'subUnitId':_0xfd97ba,'ref':'','id':_0x4ba01c[_0x5367f9(0x21b)],'dT':f(+_0x4ba01c[_0x5367f9(0x1f3)]),'threadId':_0x4ba01c[_0x5367f9(0x245)],'personId':(_0x10bba1=(_0x465841=_0x4ba01c[_0x5367f9(0x1d3)])==null?void 0x0:_0x465841[_0x5367f9(0x237)])!=null?_0x10bba1:_0x4ba01c[_0x5367f9(0x1f4)],'text':JSON[_0x5367f9(0x210)](_0x4ba01c[_0x5367f9(0x1fe)]),'parentId':_0x2a6986['id']});break;}case v[_0x5367f9(0x1eb)]:{const _0x2b9f21=this[_0x5367f9(0x1f1)][_0x5367f9(0x1cd)](_0x226590,_0xfd97ba,_0x4ba01c['replyId']);_0x2b9f21&&_0x2b9f21[_0x5367f9(0x230)]&&this[_0x5367f9(0x1f1)][_0x5367f9(0x22b)](_0x226590,_0xfd97ba,_0x4ba01c[_0x5367f9(0x21b)]);break;}case v[_0x5367f9(0x20f)]:{this[_0x5367f9(0x1f1)][_0x5367f9(0x242)](_0x226590,_0xfd97ba,{'commentId':_0x4ba01c[_0x5367f9(0x21b)],'text':JSON[_0x5367f9(0x210)](_0x4ba01c[_0x5367f9(0x1fe)])});break;}case v[_0x5367f9(0x232)]:{const _0x4d225f=(_0xd90d2d=this['_threadCommentModel'][_0x5367f9(0x21e)](_0x4ba01c[_0x5367f9(0x1d8)])[_0x5367f9(0x214)](_0x20ebb5=>_0x20ebb5['threadId']===_0x4ba01c[_0x5367f9(0x245)]))==null?void 0x0:_0xd90d2d['root'];_0x4d225f&&this['_threadCommentModel'][_0x5367f9(0x1fb)](_0x226590,_0xfd97ba,_0x4d225f['id'],_0x4ba01c[_0x5367f9(0x1dc)]===I[_0x5367f9(0x1e5)]);break;}}}));}};p=E([S(0x0,c[_0x1d7798(0x1da)](b[_0x1d7798(0x21f)])),S(0x1,c[_0x1d7798(0x1da)](M[_0x1d7798(0x218)])),S(0x2,c['Inject'](c[_0x1d7798(0x22a)])),S(0x3,c[_0x1d7798(0x1da)](c[_0x1d7798(0x1ed)]))],p);const q=_0x1d7798(0x1cc),D={};var A=Object['getOwnPropertyDescriptor'],x=(_0x19dae1,_0x465edc,_0x21955,_0x67b5e8)=>{const _0x462886=_0x1d7798;for(var _0x4a8572=_0x67b5e8>0x1?void 0x0:_0x67b5e8?A(_0x465edc,_0x21955):_0x465edc,_0x5e8654=_0x19dae1[_0x462886(0x1d4)]-0x1,_0x2ef215;_0x5e8654>=0x0;_0x5e8654--)(_0x2ef215=_0x19dae1[_0x5e8654])&&(_0x4a8572=_0x2ef215(_0x4a8572)||_0x4a8572);return _0x4a8572;},_=(_0x113eb9,_0x17a1e5)=>(_0xe82460,_0x2ae5a5)=>_0x17a1e5(_0xe82460,_0x2ae5a5,_0x113eb9);function Y(_0x3958bd,_0x3dc23f){const _0x4748eb=_0x1d7798,_0x86d3e3=_0x3958bd[_0x4748eb(0x219)][0x0];return{..._0x3dc23f,'id':_0x86d3e3[_0x4748eb(0x21b)],'resolved':_0x3958bd[_0x4748eb(0x1dc)]===0x1,'dT':f(_0x86d3e3['createTimestamp']),'personId':_0x86d3e3['userId'],'threadId':_0x86d3e3[_0x4748eb(0x245)]};}function _0x36c7(){const _0x125066=['replyId','dataSource','type','getUnit','CommentService','/universer-api/comment/unit/','Reply','/edit','map','UNIVER_UNKNOWN','toStringTag','format','Plugin','add','UniverLicensePlugin','UserManagerService','deleteComment','DependentOn','root','OpenOrReOpen','commentUpdate$','parentId','payload','Solve','getCurrentUser','listComments','resolved','31775843PeIvIU','userID','requireSession','@univerjs/network','YYYY/MM/DD\x20HH:mm','@univerjs-pro/license','4645840sLxlJC','subscribe','_config','@univerjs/thread-comment-ui','_userService','_initDataSource','updateComment','filter','8429838NihfCL','threadId','@univerjs-pro/collaboration-client','rangeType','/universer-api/user/list','thread-comment-data-source.config','getComment','pluginName','customRanges','_sessionService','forEach','UniverInstanceType','user','length','reply','HTTPService','IConfigService','unitId','disposeWithMe','Inject','8152825UqeLBG','solved','values','UniverThreadCommentDataSourcePlugin','setConfig','post','_configService','getOwnPropertyDescriptor','onReady','1258jjMVUF','Solved','Add','users','/delete','7kyljSi','getMemberID','Delete','getUser','Injector','addUser','88jaWDQM','ref','_threadCommentModel','/reply','createTimestamp','userId','UNRECOGNIZED','Disposable','/solved','_init','198MivWYe','body','resolveComment','size','defineProperty','content','saveCommentToSnapshot','CustomRangeType','Unknown','_injector','_commentService','dayjs','COMMENT','_threadCommentDataSourceService','_threadCommentDataSource','192039VGulDp','Module','get','UniverCollaborationClientPlugin','696190kqbWBC','stringify','_httpService','Edit','parse','code','_initUserSync','addComment','find','delete','error','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','ThreadCommentModel','replies','718XpsqxC'];_0x36c7=function(){return _0x125066;};return _0x36c7();}function G(_0x38a823,_0x2f9ee9,_0x25e3cf){const _0x3cd7ee=_0x1d7798;var _0x5c6d11,_0xb98527;if(((_0xb98527=(_0x5c6d11=_0x38a823==null?void 0x0:_0x38a823[_0x3cd7ee(0x219)])==null?void 0x0:_0x5c6d11['length'])!=null?_0xb98527:0x0)>0x0){const _0x1e515c=(_0x8f14c3,_0x395360)=>({'id':_0x8f14c3[_0x3cd7ee(0x21b)],'threadId':_0x8f14c3[_0x3cd7ee(0x245)],'dT':f(_0x8f14c3[_0x3cd7ee(0x1f3)]),'personId':_0x8f14c3[_0x3cd7ee(0x1f4)],'resolved':_0x38a823[_0x3cd7ee(0x1dc)]===I['Solved'],'unitId':_0x2f9ee9,'subUnitId':_0x25e3cf,'text':JSON[_0x3cd7ee(0x210)](_0x8f14c3[_0x3cd7ee(0x1fe)]),'parentId':_0x395360}),_0x4db97a=_0x1e515c(_0x38a823['replies'][0x0]);return{..._0x4db97a,'children':_0x38a823[_0x3cd7ee(0x219)]['slice'](0x1)[_0x3cd7ee(0x223)](_0x211807=>_0x1e515c(_0x211807,_0x4db97a['id']))};}return null;}function _0x3869(_0x1a0ff3,_0x34160b){const _0x36c742=_0x36c7();return _0x3869=function(_0x3869fe,_0x3746f3){_0x3869fe=_0x3869fe-0x1cb;let _0x1caeda=_0x36c742[_0x3869fe];return _0x1caeda;},_0x3869(_0x1a0ff3,_0x34160b);}let g=class{constructor(_0x1df9f8,_0xccd4a1,_0x574912,_0x12003f){const _0x4c3663=_0x1d7798;this[_0x4c3663(0x20e)]=_0x1df9f8,this['_userService']=_0xccd4a1,this[_0x4c3663(0x1d0)]=_0x574912,this[_0x4c3663(0x202)]=_0x12003f;}async[_0x1d7798(0x213)](_0x18e979){const _0x321b35=_0x1d7798;var _0x4c39d6,_0x326874;const {parentId:_0x1a0867,unitId:_0x2424ac,text:_0xafedba,threadId:_0x46a027}=_0x18e979,_0x182b1a=(_0x326874=(_0x4c39d6=_0xafedba[_0x321b35(0x1cf)])==null?void 0x0:_0x4c39d6['filter'](_0x9f7d00=>_0x9f7d00[_0x321b35(0x247)]===c['CustomRangeType'][_0x321b35(0x205)])[_0x321b35(0x223)](_0x1a41ae=>_0x1a41ae['rangeId']))!=null?_0x326874:[],_0x420b87=JSON['stringify'](_0xafedba),_0x2f796d=(await this[_0x321b35(0x1d0)][_0x321b35(0x238)](_0x2424ac))[_0x321b35(0x1ea)]();if(_0x1a0867){const _0x1e1c3a={'memberId':_0x2f796d,'unitId':_0x2424ac,'content':_0x420b87,'mention':_0x182b1a,'threadId':_0x46a027},_0x5dde0b=(await this['_httpService'][_0x321b35(0x1e0)](_0x321b35(0x220)+_0x2424ac+_0x321b35(0x1f2),{'body':_0x1e1c3a}))[_0x321b35(0x1fa)][_0x321b35(0x1d5)];return{..._0x18e979,'id':_0x5dde0b['replyId'],'dT':c['dayjs'](+_0x5dde0b[_0x321b35(0x1f3)])[_0x321b35(0x226)](_0x321b35(0x23a)),'personId':_0x5dde0b['userId']};}else{const _0x4db070={'memberId':_0x2f796d,'unitId':_0x2424ac,'content':_0x420b87,'mention':_0x182b1a},_0x230dca=await this[_0x321b35(0x20e)][_0x321b35(0x1e0)]('/universer-api/comment/unit/'+_0x2424ac+'/add',{'body':_0x4db070});return Y(_0x230dca['body']['comment'],_0x18e979);}}async[_0x1d7798(0x242)](_0x40e904){const _0x16e57b=_0x1d7798;var _0x59fd00,_0x4ca93b;const {text:_0x4a615b,unitId:_0x329d36}=_0x40e904,_0x8d3adc=(_0x4ca93b=(_0x59fd00=_0x4a615b[_0x16e57b(0x1cf)])==null?void 0x0:_0x59fd00[_0x16e57b(0x243)](_0x1bd5e3=>_0x1bd5e3[_0x16e57b(0x247)]===c[_0x16e57b(0x200)][_0x16e57b(0x205)])[_0x16e57b(0x223)](_0x14ab6b=>_0x14ab6b['rangeId']))!=null?_0x4ca93b:[],_0x583526=JSON[_0x16e57b(0x20d)](_0x4a615b),_0x2bcfd3=_0x40e904[_0x16e57b(0x245)],_0x2214c4=_0x40e904['id'],_0x4f34d5={'memberId':(await this[_0x16e57b(0x1d0)][_0x16e57b(0x238)](_0x329d36))[_0x16e57b(0x1ea)](),'unitId':_0x329d36,'threadId':_0x2bcfd3,'mention':_0x8d3adc,'content':_0x583526,'replyId':_0x2214c4},_0x1512b7=await this[_0x16e57b(0x20e)][_0x16e57b(0x1e0)](_0x16e57b(0x220)+_0x329d36+_0x16e57b(0x222),{'body':_0x4f34d5});return!_0x1512b7['body'][_0x16e57b(0x216)]||_0x1512b7[_0x16e57b(0x1fa)]['error'][_0x16e57b(0x211)]===0x1;}async[_0x1d7798(0x1fb)](_0x2faf0e){const _0x4a24ee=_0x1d7798,{unitId:_0x787e5c}=_0x2faf0e,_0x552626=_0x2faf0e[_0x4a24ee(0x245)],_0x1ea417={'memberId':this[_0x4a24ee(0x240)][_0x4a24ee(0x233)]()[_0x4a24ee(0x237)],'unitId':_0x787e5c,'threadId':_0x552626,'solved':_0x2faf0e[_0x4a24ee(0x235)]?I[_0x4a24ee(0x1e5)]:I[_0x4a24ee(0x22e)]},_0x304c64=await this[_0x4a24ee(0x20e)][_0x4a24ee(0x1e0)](_0x4a24ee(0x220)+_0x787e5c+_0x4a24ee(0x1f7),{'body':_0x1ea417});return!_0x304c64['body'][_0x4a24ee(0x216)]||_0x304c64[_0x4a24ee(0x1fa)]['error'][_0x4a24ee(0x211)]===0x1;}async[_0x1d7798(0x22b)](_0x30fe19,_0x541999,_0x3081ff,_0x1e1496){const _0x3e3d3e=_0x1d7798,_0x42d1b6={'memberId':(await this[_0x3e3d3e(0x1d0)][_0x3e3d3e(0x238)](_0x30fe19))[_0x3e3d3e(0x1ea)](),'threadId':_0x3081ff,'replyId':_0x1e1496,'unitId':_0x30fe19},_0x60f175=await this[_0x3e3d3e(0x20e)]['post'](_0x3e3d3e(0x220)+_0x30fe19+_0x3e3d3e(0x1e8),{'body':_0x42d1b6});return!_0x60f175[_0x3e3d3e(0x1fa)][_0x3e3d3e(0x216)]||_0x60f175[_0x3e3d3e(0x1fa)][_0x3e3d3e(0x216)]['code']===0x1;}async[_0x1d7798(0x234)](_0x1f0d32,_0x20a2cb,_0x2847f2){const _0x483069=_0x1d7798,_0xad3a8f={'unitId':_0x1f0d32,'threadId':_0x2847f2},_0x52da4e=await this[_0x483069(0x20e)][_0x483069(0x1e0)](_0x483069(0x220)+_0x1f0d32+'/list',{'body':_0xad3a8f}),_0x36e866=_0x2847f2[_0x483069(0x223)](_0x4efee2=>G(_0x52da4e[_0x483069(0x1fa)]['comments'][_0x4efee2],_0x1f0d32,_0x20a2cb))[_0x483069(0x243)](Boolean);return Object[_0x483069(0x1dd)](_0x52da4e[_0x483069(0x1fa)][_0x483069(0x1e7)])['forEach'](_0x25467a=>{const _0x1ccc5d=_0x483069;this['_userService'][_0x1ccc5d(0x1ee)](_0x25467a);}),_0x36e866;}[_0x1d7798(0x1ff)](_0x12d2d0){const _0x2b7847=_0x1d7798;return{'id':_0x12d2d0['id'],'threadId':_0x12d2d0[_0x2b7847(0x245)],'ref':_0x12d2d0[_0x2b7847(0x1f0)]};}};g=x([_(0x0,c[_0x1d7798(0x1da)](P[_0x1d7798(0x1d6)])),_(0x1,c[_0x1d7798(0x1da)](c['UserManagerService'])),_(0x2,c['Inject'](b['CollaborationSessionService'])),_(0x3,c[_0x1d7798(0x1da)](c['Injector']))],g);var H=Object[_0x1d7798(0x1e2)],J=(_0x1ebd56,_0x5ec5b1,_0x2542d3,_0x5a905f)=>{const _0x1699ce=_0x1d7798;for(var _0x5a61b0=_0x5a905f>0x1?void 0x0:_0x5a905f?H(_0x5ec5b1,_0x2542d3):_0x5ec5b1,_0x4e869e=_0x1ebd56[_0x1699ce(0x1d4)]-0x1,_0x4bf1d8;_0x4e869e>=0x0;_0x4e869e--)(_0x4bf1d8=_0x1ebd56[_0x4e869e])&&(_0x5a61b0=_0x4bf1d8(_0x5a61b0)||_0x5a61b0);return _0x5a61b0;},y=(_0x3c8be7,_0x5c218c)=>(_0x32a090,_0x495329)=>_0x5c218c(_0x32a090,_0x495329,_0x3c8be7);let C=class extends c[_0x1d7798(0x1f6)]{constructor(_0x4e8038,_0x21b911){const _0x3eb792=_0x1d7798;super(),this[_0x3eb792(0x206)]=_0x4e8038,this[_0x3eb792(0x207)]=_0x21b911,this['_initDataSource']();}[_0x1d7798(0x241)](){const _0x49ba38=_0x1d7798;this[_0x49ba38(0x206)][_0x49ba38(0x21c)]=this['_threadCommentDataSource'],this[_0x49ba38(0x206)]['syncUpdateMutationToColla']=!0x1;}};C=J([y(0x0,M['IThreadCommentDataSourceService']),y(0x1,c['Inject'](g))],C);var F=Object[_0x1d7798(0x1fd)],L=Object[_0x1d7798(0x1e2)],Z=(_0x443e21,_0x1b356e,_0x74c0fb)=>_0x1b356e in _0x443e21?F(_0x443e21,_0x1b356e,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x74c0fb}):_0x443e21[_0x1b356e]=_0x74c0fb,W=(_0xcab3a5,_0xb13cb4,_0x367361,_0x206c69)=>{for(var _0x3c2880=_0x206c69>0x1?void 0x0:_0x206c69?L(_0xb13cb4,_0x367361):_0xb13cb4,_0xa25326=_0xcab3a5['length']-0x1,_0x5c4391;_0xa25326>=0x0;_0xa25326--)(_0x5c4391=_0xcab3a5[_0xa25326])&&(_0x3c2880=_0x5c4391(_0x3c2880)||_0x3c2880);return _0x3c2880;},O=(_0x5dad2b,_0xf7bf78)=>(_0x5bb27d,_0xf894c8)=>_0xf7bf78(_0x5bb27d,_0xf894c8,_0x5dad2b),N=(_0x25d534,_0x4ef787,_0x5da181)=>Z(_0x25d534,typeof _0x4ef787!='symbol'?_0x4ef787+'':_0x4ef787,_0x5da181);exports[_0x1d7798(0x1de)]=class extends c[_0x1d7798(0x227)]{constructor(_0x31b56c=D,_0x503565,_0x50e5c5){const _0x360a15=_0x1d7798;super(),this[_0x360a15(0x23e)]=_0x31b56c,this['_injector']=_0x503565,this[_0x360a15(0x1e1)]=_0x50e5c5;const {..._0x266c6e}=c['merge']({},D,this[_0x360a15(0x23e)]);this[_0x360a15(0x1e1)][_0x360a15(0x1df)](q,_0x266c6e);}['onStarting'](){const _0x4ea53f=_0x1d7798;[[g],[C],[p]][_0x4ea53f(0x1d1)](_0x21939f=>{const _0x8dd500=_0x4ea53f;this[_0x8dd500(0x202)][_0x8dd500(0x228)](_0x21939f);});}[_0x1d7798(0x1e3)](){const _0x1af042=_0x1d7798;this[_0x1af042(0x202)][_0x1af042(0x20a)](C),this[_0x1af042(0x202)][_0x1af042(0x20a)](p);}},N(exports[_0x1d7798(0x1de)],_0x1d7798(0x1ce),U),N(exports[_0x1d7798(0x1de)],'type',c[_0x1d7798(0x1d2)][_0x1d7798(0x224)]),exports[_0x1d7798(0x1de)]=W([c[_0x1d7798(0x22c)](j['UniverThreadCommentUIPlugin'],b[_0x1d7798(0x20b)],T[_0x1d7798(0x229)]),O(0x1,c[_0x1d7798(0x1da)](c[_0x1d7798(0x1ed)])),O(0x2,c[_0x1d7798(0x1d7)])],exports['UniverThreadCommentDataSourcePlugin']);
|
|
1
|
+
'use strict';const _0xc4cba8=_0x4577;(function(_0x5676a5,_0x2fd5c0){const _0x3ac769=_0x4577,_0x1eec18=_0x5676a5();while(!![]){try{const _0x2cd39e=-parseInt(_0x3ac769(0x1cf))/0x1+parseInt(_0x3ac769(0x1df))/0x2*(parseInt(_0x3ac769(0x1dd))/0x3)+parseInt(_0x3ac769(0x1c4))/0x4+parseInt(_0x3ac769(0x1b1))/0x5*(-parseInt(_0x3ac769(0x1ce))/0x6)+-parseInt(_0x3ac769(0x1c3))/0x7*(-parseInt(_0x3ac769(0x18b))/0x8)+-parseInt(_0x3ac769(0x1da))/0x9*(parseInt(_0x3ac769(0x1d3))/0xa)+-parseInt(_0x3ac769(0x1d6))/0xb*(-parseInt(_0x3ac769(0x1c1))/0xc);if(_0x2cd39e===_0x2fd5c0)break;else _0x1eec18['push'](_0x1eec18['shift']());}catch(_0x1bc8cd){_0x1eec18['push'](_0x1eec18['shift']());}}}(_0x4c7c,0xcde42));Object[_0xc4cba8(0x1aa)](exports,Symbol['toStringTag'],{'value':_0xc4cba8(0x1d9)});const b=require(_0xc4cba8(0x17d)),T=require(_0xc4cba8(0x1b6)),c=require('@univerjs/core'),j=require('@univerjs/thread-comment-ui'),M=require(_0xc4cba8(0x1a7)),w=require('rxjs'),P=require(_0xc4cba8(0x1cd)),U='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x2d0a55=>(_0x2d0a55[_0x2d0a55[_0xc4cba8(0x1d8)]=0x0]=_0xc4cba8(0x1d8),_0x2d0a55[_0x2d0a55['Solved']=0x1]=_0xc4cba8(0x1cc),_0x2d0a55[_0x2d0a55[_0xc4cba8(0x1a6)]=-0x1]=_0xc4cba8(0x1a6),_0x2d0a55))(I||{}),v=(_0x16ab1b=>(_0x16ab1b[_0x16ab1b[_0xc4cba8(0x1be)]=0x0]='Unknown',_0x16ab1b[_0x16ab1b[_0xc4cba8(0x1ba)]=0x1]='Add',_0x16ab1b[_0x16ab1b[_0xc4cba8(0x19d)]=0x2]='Reply',_0x16ab1b[_0x16ab1b[_0xc4cba8(0x1b4)]=0x3]=_0xc4cba8(0x1b4),_0x16ab1b[_0x16ab1b['Delete']=0x4]='Delete',_0x16ab1b[_0x16ab1b[_0xc4cba8(0x18e)]=0x5]=_0xc4cba8(0x18e),_0x16ab1b[_0x16ab1b[_0xc4cba8(0x1a6)]=-0x1]=_0xc4cba8(0x1a6),_0x16ab1b))(v||{});const f=_0x12c774=>c['dayjs'](new Date(+_0x12c774))[_0xc4cba8(0x1b0)]('YYYY/MM/DD\x20HH:mm'),R=async(_0x572715,_0x5c2ead)=>{const _0x3836fc=_0xc4cba8,_0x5b13e4=_0x572715[_0x3836fc(0x1a5)](c[_0x3836fc(0x1bf)]),_0xc57886=_0x572715[_0x3836fc(0x1a5)](P[_0x3836fc(0x195)]);_0x5c2ead[_0x3836fc(0x193)](_0x4b5e1f=>{const _0x781974=_0x3836fc;_0x5b13e4[_0x781974(0x1bc)](_0x4b5e1f)&&_0x5c2ead['delete'](_0x4b5e1f);}),_0x5c2ead[_0x3836fc(0x1cb)]&&(await _0xc57886[_0x3836fc(0x1a5)]('/universer-api/user/list',{'params':{'userIDs':[..._0x5c2ead]}}))[_0x3836fc(0x19c)][_0x3836fc(0x1a8)]['forEach'](_0x515360=>{const _0x5c978d=_0x3836fc;_0x515360&&_0x5b13e4[_0x5c978d(0x194)](_0x515360);});};var $=Object[_0xc4cba8(0x1d0)],E=(_0x42dc96,_0x54ffe3,_0x3201b7,_0x318f39)=>{const _0x490b2d=_0xc4cba8;for(var _0x183de8=_0x318f39>0x1?void 0x0:_0x318f39?$(_0x54ffe3,_0x3201b7):_0x54ffe3,_0x53d414=_0x42dc96[_0x490b2d(0x188)]-0x1,_0x41e315;_0x53d414>=0x0;_0x53d414--)(_0x41e315=_0x42dc96[_0x53d414])&&(_0x183de8=_0x41e315(_0x183de8)||_0x183de8);return _0x183de8;},S=(_0xc232f8,_0x5f2f51)=>(_0x57641c,_0x4cccaa)=>_0x5f2f51(_0x57641c,_0x4cccaa,_0xc232f8);let p=class extends c['Disposable']{constructor(_0x14a443,_0x3dd47f,_0x188029,_0x16e356){const _0x154097=_0xc4cba8;super(),this[_0x154097(0x180)]=_0x14a443,this[_0x154097(0x187)]=_0x3dd47f,this[_0x154097(0x190)]=_0x188029,this[_0x154097(0x1d1)]=_0x16e356,this[_0x154097(0x18c)](),this[_0x154097(0x1c8)]();}['_initUserSync'](){const _0x596ccd=_0xc4cba8;this['disposeWithMe'](this[_0x596ccd(0x187)]['commentUpdate$'][_0x596ccd(0x1e3)](w['bufferTime'](0x10))[_0x596ccd(0x19e)](_0x3db895=>{const _0x2db8a1=_0x596ccd,_0x14e597=new Set();_0x3db895[_0x2db8a1(0x193)](_0x3cfee7=>{const _0x2678f0=_0x2db8a1;switch(_0x3cfee7[_0x2678f0(0x177)]){case _0x2678f0(0x198):{const _0x1e4c52=_0x3cfee7[_0x2678f0(0x186)][_0x2678f0(0x185)];_0x14e597[_0x2678f0(0x198)](_0x1e4c52);break;}}}),R(this['_injector'],_0x14e597);}));}[_0xc4cba8(0x18c)](){const _0x2c81d1=_0xc4cba8;this['disposeWithMe'](this[_0x2c81d1(0x180)][_0x2c81d1(0x1c2)]['subscribe'](async _0x5cd385=>{const _0x22b832=_0x2c81d1;var _0x22a00a,_0x3ed4d5,_0x570550,_0xa46408;const _0x249ff3=(_0x22a00a=this[_0x22b832(0x187)][_0x22b832(0x174)](_0x5cd385[_0x22b832(0x1c0)])[_0x22b832(0x18f)](_0x823f21=>_0x823f21[_0x22b832(0x17e)]===_0x5cd385['threadId']))==null?void 0x0:_0x22a00a[_0x22b832(0x179)];if(!_0x249ff3)return;const {unitId:_0x5af4c3,subUnitId:_0x460d6c}=_0x249ff3;switch(_0x5cd385[_0x22b832(0x1b8)]&&this['_userService'][_0x22b832(0x194)](_0x5cd385['user']),_0x5cd385[_0x22b832(0x177)]){case v[_0x22b832(0x1ba)]:break;case v[_0x22b832(0x19d)]:{this[_0x22b832(0x187)][_0x22b832(0x183)](_0x5af4c3,_0x460d6c,{'unitId':_0x5af4c3,'subUnitId':_0x460d6c,'ref':'','id':_0x5cd385[_0x22b832(0x1ab)],'dT':f(+_0x5cd385['createTimestamp']),'threadId':_0x5cd385[_0x22b832(0x17e)],'personId':(_0x570550=(_0x3ed4d5=_0x5cd385[_0x22b832(0x1b8)])==null?void 0x0:_0x3ed4d5[_0x22b832(0x17c)])!=null?_0x570550:_0x5cd385[_0x22b832(0x1a4)],'text':JSON[_0x22b832(0x1ca)](_0x5cd385[_0x22b832(0x1ae)]),'parentId':_0x249ff3['id']});break;}case v[_0x22b832(0x1e0)]:{const _0x3c42ec=this[_0x22b832(0x187)]['getComment'](_0x5af4c3,_0x460d6c,_0x5cd385[_0x22b832(0x1ab)]);_0x3c42ec&&_0x3c42ec['parentId']&&this[_0x22b832(0x187)][_0x22b832(0x1b3)](_0x5af4c3,_0x460d6c,_0x5cd385[_0x22b832(0x1ab)]);break;}case v['Edit']:{this[_0x22b832(0x187)][_0x22b832(0x197)](_0x5af4c3,_0x460d6c,{'commentId':_0x5cd385[_0x22b832(0x1ab)],'text':JSON['parse'](_0x5cd385[_0x22b832(0x1ae)])});break;}case v[_0x22b832(0x18e)]:{const _0x2704f3=(_0xa46408=this[_0x22b832(0x187)]['getUnit'](_0x5cd385[_0x22b832(0x1c0)])['find'](_0x51f0d5=>_0x51f0d5[_0x22b832(0x17e)]===_0x5cd385['threadId']))==null?void 0x0:_0xa46408[_0x22b832(0x179)];_0x2704f3&&this[_0x22b832(0x187)]['resolveComment'](_0x5af4c3,_0x460d6c,_0x2704f3['id'],_0x5cd385['solved']===I[_0x22b832(0x1cc)]);break;}}}));}};p=E([S(0x0,c[_0xc4cba8(0x19b)](b['CommentService'])),S(0x1,c[_0xc4cba8(0x19b)](M['ThreadCommentModel'])),S(0x2,c[_0xc4cba8(0x19b)](c[_0xc4cba8(0x1bf)])),S(0x3,c['Inject'](c[_0xc4cba8(0x1a2)]))],p);const q=_0xc4cba8(0x1c5),D={};function _0x4577(_0x5d1307,_0x2b7568){const _0x4c7c70=_0x4c7c();return _0x4577=function(_0x4577a4,_0x25193d){_0x4577a4=_0x4577a4-0x172;let _0x4cbf15=_0x4c7c70[_0x4577a4];return _0x4cbf15;},_0x4577(_0x5d1307,_0x2b7568);}var A=Object[_0xc4cba8(0x1d0)],x=(_0x1ef5d3,_0x227c59,_0x4983a2,_0x5eb824)=>{const _0x3c0aba=_0xc4cba8;for(var _0xc1e694=_0x5eb824>0x1?void 0x0:_0x5eb824?A(_0x227c59,_0x4983a2):_0x227c59,_0x3d9242=_0x1ef5d3[_0x3c0aba(0x188)]-0x1,_0x29f294;_0x3d9242>=0x0;_0x3d9242--)(_0x29f294=_0x1ef5d3[_0x3d9242])&&(_0xc1e694=_0x29f294(_0xc1e694)||_0xc1e694);return _0xc1e694;},_=(_0xe24f19,_0x1bf003)=>(_0x3d6e95,_0x50432a)=>_0x1bf003(_0x3d6e95,_0x50432a,_0xe24f19);function _0x4c7c(){const _0x5eb80f=['content','IConfigService','format','385zMIaic','CustomRangeType','deleteComment','Edit','error','@univerjs-pro/license','UniverThreadCommentDataSourcePlugin','user','listComments','Add','comments','getUser','syncUpdateMutationToColla','Unknown','UserManagerService','unitId','4647696vDFmZc','commentUpdate$','980xSZXWA','6125192bwpKgu','thread-comment-data-source.config','slice','UniverCollaborationClientPlugin','_initUserSync','ref','parse','size','Solved','@univerjs/network','119118qyljzd','235993tLyBGa','getOwnPropertyDescriptor','_injector','getCurrentUser','24370Ksqryc','/universer-api/comment/unit/','DependentOn','11iALerT','solved','OpenOrReOpen','Module','3420fWRbVr','requireSession','/add','9ECMNVU','_httpService','269732yrNJMi','Delete','filter','resolved','pipe','replies','map','getUnit','_initDataSource','stringify','type','_configService','root','rangeId','customRanges','userID','@univerjs-pro/collaboration-client','threadId','pluginName','_commentService','YYYY/MM/DD\x20HH:mm','UniverThreadCommentUIPlugin','addComment','post','personId','payload','_threadCommentModel','length','_config','dataSource','69192iRLZuo','_init','/list','Solve','find','_userService','/delete','saveCommentToSnapshot','forEach','addUser','HTTPService','CollaborationSessionService','updateComment','add','code','getMemberID','Inject','body','Reply','subscribe','dayjs','_threadCommentDataSourceService','createTimestamp','Injector','UniverInstanceType','userId','get','UNRECOGNIZED','@univerjs/thread-comment','users','_sessionService','defineProperty','replyId','resolveComment','_threadCommentDataSource'];_0x4c7c=function(){return _0x5eb80f;};return _0x4c7c();}function Y(_0x103d11,_0x2fa658){const _0x2d22c9=_0xc4cba8,_0x3a9afa=_0x103d11[_0x2d22c9(0x172)][0x0];return{..._0x2fa658,'id':_0x3a9afa[_0x2d22c9(0x1ab)],'resolved':_0x103d11[_0x2d22c9(0x1d7)]===0x1,'dT':f(_0x3a9afa['createTimestamp']),'personId':_0x3a9afa[_0x2d22c9(0x1a4)],'threadId':_0x3a9afa[_0x2d22c9(0x17e)]};}function G(_0x3bdc0a,_0x2d5801,_0x2f3730){const _0x9539f1=_0xc4cba8;var _0x2f914b,_0x19202c;if(((_0x19202c=(_0x2f914b=_0x3bdc0a==null?void 0x0:_0x3bdc0a['replies'])==null?void 0x0:_0x2f914b[_0x9539f1(0x188)])!=null?_0x19202c:0x0)>0x0){const _0x5a684d=(_0x2fe36e,_0x4d6b09)=>({'id':_0x2fe36e[_0x9539f1(0x1ab)],'threadId':_0x2fe36e[_0x9539f1(0x17e)],'dT':f(_0x2fe36e[_0x9539f1(0x1a1)]),'personId':_0x2fe36e['userId'],'resolved':_0x3bdc0a['solved']===I[_0x9539f1(0x1cc)],'unitId':_0x2d5801,'subUnitId':_0x2f3730,'text':JSON[_0x9539f1(0x1ca)](_0x2fe36e[_0x9539f1(0x1ae)]),'parentId':_0x4d6b09}),_0x264a82=_0x5a684d(_0x3bdc0a['replies'][0x0]);return{..._0x264a82,'children':_0x3bdc0a['replies'][_0x9539f1(0x1c6)](0x1)[_0x9539f1(0x173)](_0x4fcf09=>_0x5a684d(_0x4fcf09,_0x264a82['id']))};}return null;}let g=class{constructor(_0x337d34,_0x509f7e,_0x24c47b,_0x4c46a6){const _0x147f5f=_0xc4cba8;this['_httpService']=_0x337d34,this[_0x147f5f(0x190)]=_0x509f7e,this[_0x147f5f(0x1a9)]=_0x24c47b,this['_injector']=_0x4c46a6;}async[_0xc4cba8(0x183)](_0x54b5f4){const _0x4132ed=_0xc4cba8;var _0x476669,_0x2285aa;const {parentId:_0x239ebf,unitId:_0x3ae9ec,text:_0x3d105a,threadId:_0x1d7fe0}=_0x54b5f4,_0x2097b8=(_0x2285aa=(_0x476669=_0x3d105a[_0x4132ed(0x17b)])==null?void 0x0:_0x476669['filter'](_0x1f7862=>_0x1f7862['rangeType']===c[_0x4132ed(0x1b2)]['COMMENT'])[_0x4132ed(0x173)](_0xfc58b=>_0xfc58b[_0x4132ed(0x17a)]))!=null?_0x2285aa:[],_0x124ff3=JSON[_0x4132ed(0x176)](_0x3d105a),_0x154320=(await this[_0x4132ed(0x1a9)]['requireSession'](_0x3ae9ec))[_0x4132ed(0x19a)]();if(_0x239ebf){const _0x28ec0b={'memberId':_0x154320,'unitId':_0x3ae9ec,'content':_0x124ff3,'mention':_0x2097b8,'threadId':_0x1d7fe0},_0x211892=(await this['_httpService'][_0x4132ed(0x184)](_0x4132ed(0x1d4)+_0x3ae9ec+'/reply',{'body':_0x28ec0b}))[_0x4132ed(0x19c)]['reply'];return{..._0x54b5f4,'id':_0x211892[_0x4132ed(0x1ab)],'dT':c[_0x4132ed(0x19f)](+_0x211892[_0x4132ed(0x1a1)])['format'](_0x4132ed(0x181)),'personId':_0x211892[_0x4132ed(0x1a4)]};}else{const _0x57ae89={'memberId':_0x154320,'unitId':_0x3ae9ec,'content':_0x124ff3,'mention':_0x2097b8},_0xe8fae=await this[_0x4132ed(0x1de)]['post']('/universer-api/comment/unit/'+_0x3ae9ec+_0x4132ed(0x1dc),{'body':_0x57ae89});return Y(_0xe8fae[_0x4132ed(0x19c)]['comment'],_0x54b5f4);}}async[_0xc4cba8(0x197)](_0xbe636a){const _0x494d6d=_0xc4cba8;var _0x45add5,_0x672e8;const {text:_0x1e2bd0,unitId:_0x2c0d25}=_0xbe636a,_0x5e279e=(_0x672e8=(_0x45add5=_0x1e2bd0['customRanges'])==null?void 0x0:_0x45add5[_0x494d6d(0x1e1)](_0x50faec=>_0x50faec['rangeType']===c[_0x494d6d(0x1b2)]['COMMENT'])[_0x494d6d(0x173)](_0x3c2181=>_0x3c2181[_0x494d6d(0x17a)]))!=null?_0x672e8:[],_0x2aaf89=JSON[_0x494d6d(0x176)](_0x1e2bd0),_0x514214=_0xbe636a['threadId'],_0xee1bd8=_0xbe636a['id'],_0x2162ce={'memberId':(await this[_0x494d6d(0x1a9)][_0x494d6d(0x1db)](_0x2c0d25))[_0x494d6d(0x19a)](),'unitId':_0x2c0d25,'threadId':_0x514214,'mention':_0x5e279e,'content':_0x2aaf89,'replyId':_0xee1bd8},_0x5ac3dc=await this['_httpService'][_0x494d6d(0x184)](_0x494d6d(0x1d4)+_0x2c0d25+'/edit',{'body':_0x2162ce});return!_0x5ac3dc[_0x494d6d(0x19c)][_0x494d6d(0x1b5)]||_0x5ac3dc[_0x494d6d(0x19c)][_0x494d6d(0x1b5)][_0x494d6d(0x199)]===0x1;}async[_0xc4cba8(0x1ac)](_0x4fd942){const _0x2002c0=_0xc4cba8,{unitId:_0x5e96ed}=_0x4fd942,_0x407aa5=_0x4fd942[_0x2002c0(0x17e)],_0x11047a={'memberId':this[_0x2002c0(0x190)][_0x2002c0(0x1d2)]()[_0x2002c0(0x17c)],'unitId':_0x5e96ed,'threadId':_0x407aa5,'solved':_0x4fd942[_0x2002c0(0x1e2)]?I[_0x2002c0(0x1cc)]:I[_0x2002c0(0x1d8)]},_0x4b7a69=await this['_httpService']['post']('/universer-api/comment/unit/'+_0x5e96ed+'/solved',{'body':_0x11047a});return!_0x4b7a69['body'][_0x2002c0(0x1b5)]||_0x4b7a69[_0x2002c0(0x19c)][_0x2002c0(0x1b5)]['code']===0x1;}async[_0xc4cba8(0x1b3)](_0x374676,_0x38568a,_0x29009b,_0x11ea73){const _0x42b961=_0xc4cba8,_0x42dc65={'memberId':(await this[_0x42b961(0x1a9)][_0x42b961(0x1db)](_0x374676))[_0x42b961(0x19a)](),'threadId':_0x29009b,'replyId':_0x11ea73,'unitId':_0x374676},_0x52fdd0=await this[_0x42b961(0x1de)][_0x42b961(0x184)](_0x42b961(0x1d4)+_0x374676+_0x42b961(0x191),{'body':_0x42dc65});return!_0x52fdd0['body']['error']||_0x52fdd0[_0x42b961(0x19c)][_0x42b961(0x1b5)][_0x42b961(0x199)]===0x1;}async[_0xc4cba8(0x1b9)](_0xc8e034,_0x1b8f50,_0xdfc69a){const _0x4864a9=_0xc4cba8,_0x191c85={'unitId':_0xc8e034,'threadId':_0xdfc69a},_0x132fc9=await this[_0x4864a9(0x1de)][_0x4864a9(0x184)](_0x4864a9(0x1d4)+_0xc8e034+_0x4864a9(0x18d),{'body':_0x191c85}),_0x578c82=_0xdfc69a['map'](_0x5636b8=>G(_0x132fc9[_0x4864a9(0x19c)][_0x4864a9(0x1bb)][_0x5636b8],_0xc8e034,_0x1b8f50))[_0x4864a9(0x1e1)](Boolean);return Object['values'](_0x132fc9['body'][_0x4864a9(0x1a8)])[_0x4864a9(0x193)](_0x8f16=>{const _0x1cf2dd=_0x4864a9;this[_0x1cf2dd(0x190)]['addUser'](_0x8f16);}),_0x578c82;}[_0xc4cba8(0x192)](_0x23a00c){const _0x4aa716=_0xc4cba8;return{'id':_0x23a00c['id'],'threadId':_0x23a00c[_0x4aa716(0x17e)],'ref':_0x23a00c[_0x4aa716(0x1c9)]};}};g=x([_(0x0,c[_0xc4cba8(0x19b)](P['HTTPService'])),_(0x1,c[_0xc4cba8(0x19b)](c[_0xc4cba8(0x1bf)])),_(0x2,c[_0xc4cba8(0x19b)](b[_0xc4cba8(0x196)])),_(0x3,c['Inject'](c[_0xc4cba8(0x1a2)]))],g);var H=Object[_0xc4cba8(0x1d0)],J=(_0x4a10c3,_0x1fb755,_0x1ea2c8,_0x2986ff)=>{const _0x55c2f0=_0xc4cba8;for(var _0x1da4df=_0x2986ff>0x1?void 0x0:_0x2986ff?H(_0x1fb755,_0x1ea2c8):_0x1fb755,_0x60a24=_0x4a10c3[_0x55c2f0(0x188)]-0x1,_0x160099;_0x60a24>=0x0;_0x60a24--)(_0x160099=_0x4a10c3[_0x60a24])&&(_0x1da4df=_0x160099(_0x1da4df)||_0x1da4df);return _0x1da4df;},y=(_0x2be8e7,_0x62e726)=>(_0x177171,_0x5a071f)=>_0x62e726(_0x177171,_0x5a071f,_0x2be8e7);let C=class extends c['Disposable']{constructor(_0x10239a,_0xb43348){const _0xbdaafc=_0xc4cba8;super(),this[_0xbdaafc(0x1a0)]=_0x10239a,this[_0xbdaafc(0x1ad)]=_0xb43348,this['_initDataSource']();}[_0xc4cba8(0x175)](){const _0x40cf31=_0xc4cba8;this[_0x40cf31(0x1a0)][_0x40cf31(0x18a)]=this['_threadCommentDataSource'],this['_threadCommentDataSourceService'][_0x40cf31(0x1bd)]=!0x1;}};C=J([y(0x0,M['IThreadCommentDataSourceService']),y(0x1,c[_0xc4cba8(0x19b)](g))],C);var F=Object[_0xc4cba8(0x1aa)],L=Object['getOwnPropertyDescriptor'],Z=(_0xcaf893,_0x584b1c,_0x540636)=>_0x584b1c in _0xcaf893?F(_0xcaf893,_0x584b1c,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x540636}):_0xcaf893[_0x584b1c]=_0x540636,W=(_0xc49152,_0x528958,_0x5c7b16,_0x49186c)=>{const _0x19f838=_0xc4cba8;for(var _0x149ab=_0x49186c>0x1?void 0x0:_0x49186c?L(_0x528958,_0x5c7b16):_0x528958,_0xec637f=_0xc49152[_0x19f838(0x188)]-0x1,_0x37792f;_0xec637f>=0x0;_0xec637f--)(_0x37792f=_0xc49152[_0xec637f])&&(_0x149ab=_0x37792f(_0x149ab)||_0x149ab);return _0x149ab;},O=(_0x178d38,_0x222d7f)=>(_0x13cad7,_0x3204c0)=>_0x222d7f(_0x13cad7,_0x3204c0,_0x178d38),N=(_0x4ac73c,_0x37ab73,_0x2472cb)=>Z(_0x4ac73c,typeof _0x37ab73!='symbol'?_0x37ab73+'':_0x37ab73,_0x2472cb);exports[_0xc4cba8(0x1b7)]=class extends c['Plugin']{constructor(_0x5ca669=D,_0x1eec29,_0x2ddfd0){const _0x2d68ef=_0xc4cba8;super(),this[_0x2d68ef(0x189)]=_0x5ca669,this[_0x2d68ef(0x1d1)]=_0x1eec29,this[_0x2d68ef(0x178)]=_0x2ddfd0;const {..._0x10e1f8}=c['merge']({},D,this[_0x2d68ef(0x189)]);this[_0x2d68ef(0x178)]['setConfig'](q,_0x10e1f8);}['onStarting'](){const _0x4354b8=_0xc4cba8;[[g],[C],[p]][_0x4354b8(0x193)](_0x3d8323=>{const _0x1cdb04=_0x4354b8;this[_0x1cdb04(0x1d1)][_0x1cdb04(0x198)](_0x3d8323);});}['onReady'](){const _0x3b168f=_0xc4cba8;this[_0x3b168f(0x1d1)]['get'](C),this[_0x3b168f(0x1d1)][_0x3b168f(0x1a5)](p);}},N(exports['UniverThreadCommentDataSourcePlugin'],_0xc4cba8(0x17f),U),N(exports[_0xc4cba8(0x1b7)],_0xc4cba8(0x177),c[_0xc4cba8(0x1a3)]['UNIVER_UNKNOWN']),exports[_0xc4cba8(0x1b7)]=W([c[_0xc4cba8(0x1d5)](j[_0xc4cba8(0x182)],b[_0xc4cba8(0x1c7)],T['UniverLicensePlugin']),O(0x1,c[_0xc4cba8(0x19b)](c['Injector'])),O(0x2,c[_0xc4cba8(0x1af)])],exports[_0xc4cba8(0x1b7)]);
|
package/lib/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x23fa6f=_0x50e2;(function(_0x34d748,_0x3b8ba5){const _0x26f94b=_0x50e2,_0x16dbaf=_0x34d748();while(!![]){try{const _0x3c29d6=parseInt(_0x26f94b(0x143))/0x1+parseInt(_0x26f94b(0x18f))/0x2+-parseInt(_0x26f94b(0x151))/0x3+-parseInt(_0x26f94b(0x132))/0x4+parseInt(_0x26f94b(0x159))/0x5+-parseInt(_0x26f94b(0x185))/0x6*(-parseInt(_0x26f94b(0x14a))/0x7)+parseInt(_0x26f94b(0x169))/0x8*(parseInt(_0x26f94b(0x173))/0x9);if(_0x3c29d6===_0x3b8ba5)break;else _0x16dbaf['push'](_0x16dbaf['shift']());}catch(_0x4b36c2){_0x16dbaf['push'](_0x16dbaf['shift']());}}}(_0x232d,0x587c4));import{CommentService as _0x20a661,CollaborationSessionService as _0xea13e3,UniverCollaborationClientPlugin as _0x3dcb68}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x1dbdb7}from'@univerjs-pro/license';import{dayjs as _0x3a9660,UserManagerService as _0x469b81,Inject as _0x3c5570,Injector as _0x375bf6,Disposable as _0x34d19b,CustomRangeType as _0x445314,UniverInstanceType as _0x43fc88,DependentOn as _0x1e041b,IConfigService as _0x1e8b56,Plugin as _0x9156f8,merge as _0x110a0b}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x4b0210}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x5f0ff,IThreadCommentDataSourceService as _0x2ecb1d}from'@univerjs/thread-comment';import{bufferTime as _0x5b8e83}from'rxjs';import{HTTPService as _0x46056e}from'@univerjs/network';const W=_0x23fa6f(0x166);var I=(_0x48f0cc=>(_0x48f0cc[_0x48f0cc[_0x23fa6f(0x158)]=0x0]=_0x23fa6f(0x158),_0x48f0cc[_0x48f0cc[_0x23fa6f(0x137)]=0x1]=_0x23fa6f(0x137),_0x48f0cc[_0x48f0cc[_0x23fa6f(0x171)]=-0x1]=_0x23fa6f(0x171),_0x48f0cc))(I||{}),v=(_0x2822d8=>(_0x2822d8[_0x2822d8[_0x23fa6f(0x188)]=0x0]=_0x23fa6f(0x188),_0x2822d8[_0x2822d8['Add']=0x1]='Add',_0x2822d8[_0x2822d8[_0x23fa6f(0x156)]=0x2]='Reply',_0x2822d8[_0x2822d8['Edit']=0x3]='Edit',_0x2822d8[_0x2822d8[_0x23fa6f(0x13d)]=0x4]=_0x23fa6f(0x13d),_0x2822d8[_0x2822d8[_0x23fa6f(0x177)]=0x5]=_0x23fa6f(0x177),_0x2822d8[_0x2822d8[_0x23fa6f(0x171)]=-0x1]=_0x23fa6f(0x171),_0x2822d8))(v||{});const D=_0x57489c=>_0x3a9660(new Date(+_0x57489c))[_0x23fa6f(0x17f)](_0x23fa6f(0x15e)),B=async(_0x1dd44f,_0x40b698)=>{const _0x7afd01=_0x23fa6f,_0x238c72=_0x1dd44f[_0x7afd01(0x13b)](_0x469b81),_0x315977=_0x1dd44f['get'](_0x46056e);_0x40b698['forEach'](_0x53849b=>{const _0x57666f=_0x7afd01;_0x238c72[_0x57666f(0x164)](_0x53849b)&&_0x40b698[_0x57666f(0x16e)](_0x53849b);}),_0x40b698[_0x7afd01(0x14e)]&&(await _0x315977[_0x7afd01(0x13b)]('/universer-api/user/list',{'params':{'userIDs':[..._0x40b698]}}))['body'][_0x7afd01(0x18c)][_0x7afd01(0x193)](_0x2c6970=>{const _0x32f084=_0x7afd01;_0x2c6970&&_0x238c72[_0x32f084(0x138)](_0x2c6970);});};var K=Object[_0x23fa6f(0x191)],V=(_0x240725,_0x301fe1,_0x7f5cca,_0x6aa73)=>{for(var _0x230780=_0x6aa73>0x1?void 0x0:_0x6aa73?K(_0x301fe1,_0x7f5cca):_0x301fe1,_0x2a8a03=_0x240725['length']-0x1,_0x17b4a7;_0x2a8a03>=0x0;_0x2a8a03--)(_0x17b4a7=_0x240725[_0x2a8a03])&&(_0x230780=_0x17b4a7(_0x230780)||_0x230780);return _0x230780;},p=(_0x538cbd,_0x7bae1)=>(_0xa0f7c1,_0x563fe3)=>_0x7bae1(_0xa0f7c1,_0x563fe3,_0x538cbd);let S=class extends _0x34d19b{constructor(_0x6cc892,_0x16fee6,_0x4db590,_0x23de98){const _0x3ffb7d=_0x23fa6f;super(),this[_0x3ffb7d(0x14d)]=_0x6cc892,this['_threadCommentModel']=_0x16fee6,this['_userService']=_0x4db590,this['_injector']=_0x23de98,this['_init'](),this[_0x3ffb7d(0x181)]();}['_initUserSync'](){const _0x19eeb0=_0x23fa6f;this[_0x19eeb0(0x14b)](this['_threadCommentModel']['commentUpdate$']['pipe'](_0x5b8e83(0x10))[_0x19eeb0(0x135)](_0x3b37b8=>{const _0x282ad1=_0x19eeb0,_0x582357=new Set();_0x3b37b8[_0x282ad1(0x193)](_0x514d50=>{const _0x328e3f=_0x282ad1;switch(_0x514d50[_0x328e3f(0x178)]){case _0x328e3f(0x170):{const _0x1e96c4=_0x514d50[_0x328e3f(0x13e)][_0x328e3f(0x144)];_0x582357['add'](_0x1e96c4);break;}}}),B(this[_0x282ad1(0x140)],_0x582357);}));}['_init'](){const _0x33ec78=_0x23fa6f;this[_0x33ec78(0x14b)](this['_commentService'][_0x33ec78(0x134)][_0x33ec78(0x135)](async _0x2ef939=>{const _0xcfd235=_0x33ec78;var _0x52fc42,_0x55b9ab,_0x18afa9,_0x2f5a17;const _0x58bbe5=(_0x52fc42=this[_0xcfd235(0x18d)][_0xcfd235(0x16d)](_0x2ef939['unitId'])[_0xcfd235(0x183)](_0x31f112=>_0x31f112[_0xcfd235(0x149)]===_0x2ef939[_0xcfd235(0x149)]))==null?void 0x0:_0x52fc42[_0xcfd235(0x17d)];if(!_0x58bbe5)return;const {unitId:_0x468376,subUnitId:_0x48c59b}=_0x58bbe5;switch(_0x2ef939[_0xcfd235(0x155)]&&this['_userService'][_0xcfd235(0x138)](_0x2ef939[_0xcfd235(0x155)]),_0x2ef939[_0xcfd235(0x178)]){case v[_0xcfd235(0x17b)]:break;case v['Reply']:{this[_0xcfd235(0x18d)][_0xcfd235(0x162)](_0x468376,_0x48c59b,{'unitId':_0x468376,'subUnitId':_0x48c59b,'ref':'','id':_0x2ef939[_0xcfd235(0x194)],'dT':D(+_0x2ef939[_0xcfd235(0x13a)]),'threadId':_0x2ef939['threadId'],'personId':(_0x18afa9=(_0x55b9ab=_0x2ef939[_0xcfd235(0x155)])==null?void 0x0:_0x55b9ab[_0xcfd235(0x184)])!=null?_0x18afa9:_0x2ef939[_0xcfd235(0x172)],'text':JSON[_0xcfd235(0x17a)](_0x2ef939[_0xcfd235(0x157)]),'parentId':_0x58bbe5['id']});break;}case v['Delete']:{const _0x49e090=this['_threadCommentModel'][_0xcfd235(0x14f)](_0x468376,_0x48c59b,_0x2ef939[_0xcfd235(0x194)]);_0x49e090&&_0x49e090[_0xcfd235(0x196)]&&this[_0xcfd235(0x18d)][_0xcfd235(0x175)](_0x468376,_0x48c59b,_0x2ef939['replyId']);break;}case v[_0xcfd235(0x131)]:{this[_0xcfd235(0x18d)][_0xcfd235(0x163)](_0x468376,_0x48c59b,{'commentId':_0x2ef939['replyId'],'text':JSON[_0xcfd235(0x17a)](_0x2ef939[_0xcfd235(0x157)])});break;}case v['Solve']:{const _0x9465d2=(_0x2f5a17=this[_0xcfd235(0x18d)][_0xcfd235(0x16d)](_0x2ef939[_0xcfd235(0x152)])[_0xcfd235(0x183)](_0x55bd72=>_0x55bd72[_0xcfd235(0x149)]===_0x2ef939[_0xcfd235(0x149)]))==null?void 0x0:_0x2f5a17[_0xcfd235(0x17d)];_0x9465d2&&this['_threadCommentModel'][_0xcfd235(0x150)](_0x468376,_0x48c59b,_0x9465d2['id'],_0x2ef939['solved']===I['Solved']);break;}}}));}};S=V([p(0x0,_0x3c5570(_0x20a661)),p(0x1,_0x3c5570(_0x5f0ff)),p(0x2,_0x3c5570(_0x469b81)),p(0x3,_0x3c5570(_0x375bf6))],S);const z=_0x23fa6f(0x16c),M={};var k=Object['getOwnPropertyDescriptor'],Q=(_0x82b03f,_0x4b6cee,_0x499727,_0x5f1d63)=>{for(var _0x1e114d=_0x5f1d63>0x1?void 0x0:_0x5f1d63?k(_0x4b6cee,_0x499727):_0x4b6cee,_0x3d66e0=_0x82b03f['length']-0x1,_0x467409;_0x3d66e0>=0x0;_0x3d66e0--)(_0x467409=_0x82b03f[_0x3d66e0])&&(_0x1e114d=_0x467409(_0x1e114d)||_0x1e114d);return _0x1e114d;},_=(_0x2ca03f,_0x153acf)=>(_0x988932,_0x25f323)=>_0x153acf(_0x988932,_0x25f323,_0x2ca03f);function X(_0x88b89b,_0x19ffdd){const _0x2ab970=_0x23fa6f,_0x7fee40=_0x88b89b[_0x2ab970(0x15a)][0x0];return{..._0x19ffdd,'id':_0x7fee40[_0x2ab970(0x194)],'resolved':_0x88b89b['solved']===0x1,'dT':D(_0x7fee40[_0x2ab970(0x13a)]),'personId':_0x7fee40[_0x2ab970(0x172)],'threadId':_0x7fee40[_0x2ab970(0x149)]};}function ee(_0x1f58a7,_0x149fdf,_0x153be4){const _0x24b445=_0x23fa6f;var _0x45511a,_0x445262;if(((_0x445262=(_0x45511a=_0x1f58a7==null?void 0x0:_0x1f58a7[_0x24b445(0x15a)])==null?void 0x0:_0x45511a[_0x24b445(0x182)])!=null?_0x445262:0x0)>0x0){const _0xca0303=(_0x48a89e,_0x2e9b24)=>({'id':_0x48a89e[_0x24b445(0x194)],'threadId':_0x48a89e[_0x24b445(0x149)],'dT':D(_0x48a89e['createTimestamp']),'personId':_0x48a89e['userId'],'resolved':_0x1f58a7[_0x24b445(0x15c)]===I[_0x24b445(0x137)],'unitId':_0x149fdf,'subUnitId':_0x153be4,'text':JSON[_0x24b445(0x17a)](_0x48a89e[_0x24b445(0x157)]),'parentId':_0x2e9b24}),_0x45d7e5=_0xca0303(_0x1f58a7[_0x24b445(0x15a)][0x0]);return{..._0x45d7e5,'children':_0x1f58a7[_0x24b445(0x15a)][_0x24b445(0x165)](0x1)[_0x24b445(0x141)](_0x3ded48=>_0xca0303(_0x3ded48,_0x45d7e5['id']))};}return null;}let f=class{constructor(_0x59501d,_0x3353d5,_0x31333c,_0x2b0455){const _0x176980=_0x23fa6f;this[_0x176980(0x16b)]=_0x59501d,this[_0x176980(0x139)]=_0x3353d5,this['_sessionService']=_0x31333c,this[_0x176980(0x140)]=_0x2b0455;}async['addComment'](_0x3369af){const _0x4dfc58=_0x23fa6f;var _0x1f7b0f,_0xdb71e2;const {parentId:_0x1f6c5d,unitId:_0x141d05,text:_0x14ea23,threadId:_0x4de648}=_0x3369af,_0xc577b4=(_0xdb71e2=(_0x1f7b0f=_0x14ea23['customRanges'])==null?void 0x0:_0x1f7b0f[_0x4dfc58(0x13c)](_0x682a48=>_0x682a48[_0x4dfc58(0x154)]===_0x445314[_0x4dfc58(0x15f)])[_0x4dfc58(0x141)](_0x43ddbc=>_0x43ddbc[_0x4dfc58(0x195)]))!=null?_0xdb71e2:[],_0x83fa7b=JSON[_0x4dfc58(0x192)](_0x14ea23),_0x492dcc=(await this[_0x4dfc58(0x186)][_0x4dfc58(0x18a)](_0x141d05))[_0x4dfc58(0x179)]();if(_0x1f6c5d){const _0x55cf12={'memberId':_0x492dcc,'unitId':_0x141d05,'content':_0x83fa7b,'mention':_0xc577b4,'threadId':_0x4de648},_0x569c35=(await this['_httpService'][_0x4dfc58(0x133)]('/universer-api/comment/unit/'+_0x141d05+_0x4dfc58(0x17c),{'body':_0x55cf12}))[_0x4dfc58(0x148)]['reply'];return{..._0x3369af,'id':_0x569c35['replyId'],'dT':_0x3a9660(+_0x569c35[_0x4dfc58(0x13a)])[_0x4dfc58(0x17f)](_0x4dfc58(0x15e)),'personId':_0x569c35[_0x4dfc58(0x172)]};}else{const _0x339d43={'memberId':_0x492dcc,'unitId':_0x141d05,'content':_0x83fa7b,'mention':_0xc577b4},_0x36639c=await this[_0x4dfc58(0x16b)]['post'](_0x4dfc58(0x146)+_0x141d05+_0x4dfc58(0x190),{'body':_0x339d43});return X(_0x36639c['body'][_0x4dfc58(0x136)],_0x3369af);}}async['updateComment'](_0x2272bb){const _0x4a829a=_0x23fa6f;var _0x4ed306,_0x33f969;const {text:_0x3bff7c,unitId:_0xaa685e}=_0x2272bb,_0x1ef3a8=(_0x33f969=(_0x4ed306=_0x3bff7c[_0x4a829a(0x16f)])==null?void 0x0:_0x4ed306[_0x4a829a(0x13c)](_0x505a42=>_0x505a42[_0x4a829a(0x154)]===_0x445314[_0x4a829a(0x15f)])[_0x4a829a(0x141)](_0xd5023c=>_0xd5023c[_0x4a829a(0x195)]))!=null?_0x33f969:[],_0x495eec=JSON[_0x4a829a(0x192)](_0x3bff7c),_0x396c5d=_0x2272bb[_0x4a829a(0x149)],_0x2dbfc2=_0x2272bb['id'],_0x42711a={'memberId':(await this[_0x4a829a(0x186)][_0x4a829a(0x18a)](_0xaa685e))[_0x4a829a(0x179)](),'unitId':_0xaa685e,'threadId':_0x396c5d,'mention':_0x1ef3a8,'content':_0x495eec,'replyId':_0x2dbfc2},_0x228803=await this[_0x4a829a(0x16b)]['post'](_0x4a829a(0x146)+_0xaa685e+_0x4a829a(0x153),{'body':_0x42711a});return!_0x228803[_0x4a829a(0x148)][_0x4a829a(0x13f)]||_0x228803[_0x4a829a(0x148)][_0x4a829a(0x13f)][_0x4a829a(0x187)]===0x1;}async[_0x23fa6f(0x150)](_0x3a102e){const _0x893dad=_0x23fa6f,{unitId:_0x1a4ee8}=_0x3a102e,_0x52948d=_0x3a102e[_0x893dad(0x149)],_0x315da6={'memberId':this[_0x893dad(0x139)][_0x893dad(0x168)]()[_0x893dad(0x184)],'unitId':_0x1a4ee8,'threadId':_0x52948d,'solved':_0x3a102e[_0x893dad(0x180)]?I['Solved']:I[_0x893dad(0x158)]},_0x5daa18=await this[_0x893dad(0x16b)][_0x893dad(0x133)](_0x893dad(0x146)+_0x1a4ee8+'/solved',{'body':_0x315da6});return!_0x5daa18[_0x893dad(0x148)][_0x893dad(0x13f)]||_0x5daa18['body'][_0x893dad(0x13f)]['code']===0x1;}async[_0x23fa6f(0x175)](_0x492fbe,_0x20aa2b,_0x47dc38,_0x43ed9a){const _0x338c77=_0x23fa6f,_0x37979b={'memberId':(await this[_0x338c77(0x186)][_0x338c77(0x18a)](_0x492fbe))[_0x338c77(0x179)](),'threadId':_0x47dc38,'replyId':_0x43ed9a,'unitId':_0x492fbe},_0x2a8e9b=await this[_0x338c77(0x16b)]['post'](_0x338c77(0x146)+_0x492fbe+_0x338c77(0x161),{'body':_0x37979b});return!_0x2a8e9b[_0x338c77(0x148)][_0x338c77(0x13f)]||_0x2a8e9b['body'][_0x338c77(0x13f)]['code']===0x1;}async[_0x23fa6f(0x160)](_0x45031e,_0x5a6ec3,_0x31447f){const _0x1baba2=_0x23fa6f,_0x14c29c={'unitId':_0x45031e,'threadId':_0x31447f},_0x49cb52=await this[_0x1baba2(0x16b)]['post'](_0x1baba2(0x146)+_0x45031e+_0x1baba2(0x189),{'body':_0x14c29c}),_0x2b2ae0=_0x31447f['map'](_0x43a8dc=>ee(_0x49cb52[_0x1baba2(0x148)]['comments'][_0x43a8dc],_0x45031e,_0x5a6ec3))['filter'](Boolean);return Object[_0x1baba2(0x18b)](_0x49cb52[_0x1baba2(0x148)]['users'])[_0x1baba2(0x193)](_0x446848=>{const _0x2db9d7=_0x1baba2;this[_0x2db9d7(0x139)][_0x2db9d7(0x138)](_0x446848);}),_0x2b2ae0;}[_0x23fa6f(0x16a)](_0x5b137d){const _0x42a704=_0x23fa6f;return{'id':_0x5b137d['id'],'threadId':_0x5b137d[_0x42a704(0x149)],'ref':_0x5b137d[_0x42a704(0x17e)]};}};f=Q([_(0x0,_0x3c5570(_0x46056e)),_(0x1,_0x3c5570(_0x469b81)),_(0x2,_0x3c5570(_0xea13e3)),_(0x3,_0x3c5570(_0x375bf6))],f);function _0x232d(){const _0x2cb19f=['UNRECOGNIZED','userId','81fieKZb','_config','deleteComment','_initDataSource','Solve','type','getMemberID','parse','Add','/reply','root','ref','format','resolved','_initUserSync','length','find','userID','1063266tWPabu','_sessionService','code','Unknown','/list','requireSession','values','users','_threadCommentModel','syncUpdateMutationToColla','207964FpCeoe','/add','getOwnPropertyDescriptor','stringify','forEach','replyId','rangeId','parentId','Edit','2124856atNMAs','post','commentUpdate$','subscribe','comment','Solved','addUser','_userService','createTimestamp','get','filter','Delete','payload','error','_injector','map','UNIVER_UNKNOWN','305756dYqwOB','personId','onStarting','/universer-api/comment/unit/','_configService','body','threadId','7WQHcox','disposeWithMe','defineProperty','_commentService','size','getComment','resolveComment','2131896lnGvoZ','unitId','/edit','rangeType','user','Reply','content','OpenOrReOpen','1998990evNXKx','replies','symbol','solved','_threadCommentDataSourceService','YYYY/MM/DD\x20HH:mm','COMMENT','listComments','/delete','addComment','updateComment','getUser','slice','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','pluginName','getCurrentUser','548920WTNLwF','saveCommentToSnapshot','_httpService','thread-comment-data-source.config','getUnit','delete','customRanges','add'];_0x232d=function(){return _0x2cb19f;};return _0x232d();}var re=Object['getOwnPropertyDescriptor'],te=(_0x4cdb3b,_0x5c6053,_0x306b0a,_0x11af14)=>{const _0xd59cd6=_0x23fa6f;for(var _0x4f0cb9=_0x11af14>0x1?void 0x0:_0x11af14?re(_0x5c6053,_0x306b0a):_0x5c6053,_0x27f433=_0x4cdb3b[_0xd59cd6(0x182)]-0x1,_0x228e1d;_0x27f433>=0x0;_0x27f433--)(_0x228e1d=_0x4cdb3b[_0x27f433])&&(_0x4f0cb9=_0x228e1d(_0x4f0cb9)||_0x4f0cb9);return _0x4f0cb9;},N=(_0x4b1047,_0x40107a)=>(_0x4df5fc,_0x3bbf7b)=>_0x40107a(_0x4df5fc,_0x3bbf7b,_0x4b1047);let g=class extends _0x34d19b{constructor(_0x3a2768,_0x29ad6b){const _0x159e26=_0x23fa6f;super(),this['_threadCommentDataSourceService']=_0x3a2768,this['_threadCommentDataSource']=_0x29ad6b,this[_0x159e26(0x176)]();}[_0x23fa6f(0x176)](){const _0x64a5cc=_0x23fa6f;this[_0x64a5cc(0x15d)]['dataSource']=this['_threadCommentDataSource'],this[_0x64a5cc(0x15d)][_0x64a5cc(0x18e)]=!0x1;}};function _0x50e2(_0x767746,_0x4ac769){const _0x232d80=_0x232d();return _0x50e2=function(_0x50e299,_0x5ddb01){_0x50e299=_0x50e299-0x131;let _0x470b70=_0x232d80[_0x50e299];return _0x470b70;},_0x50e2(_0x767746,_0x4ac769);}g=te([N(0x0,_0x2ecb1d),N(0x1,_0x3c5570(f))],g);var se=Object[_0x23fa6f(0x14c)],oe=Object[_0x23fa6f(0x191)],ne=(_0x467322,_0x45c742,_0x1aff4f)=>_0x45c742 in _0x467322?se(_0x467322,_0x45c742,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x1aff4f}):_0x467322[_0x45c742]=_0x1aff4f,ie=(_0x3fff74,_0x8420e7,_0x267e03,_0x3404c7)=>{const _0x199b92=_0x23fa6f;for(var _0x538b59=_0x3404c7>0x1?void 0x0:_0x3404c7?oe(_0x8420e7,_0x267e03):_0x8420e7,_0x23f855=_0x3fff74[_0x199b92(0x182)]-0x1,_0x2c5833;_0x23f855>=0x0;_0x23f855--)(_0x2c5833=_0x3fff74[_0x23f855])&&(_0x538b59=_0x2c5833(_0x538b59)||_0x538b59);return _0x538b59;},w=(_0x40970d,_0x4c0f04)=>(_0x30f643,_0x376f4d)=>_0x4c0f04(_0x30f643,_0x376f4d,_0x40970d),$=(_0x33098c,_0x2bf3a0,_0x1592f6)=>ne(_0x33098c,typeof _0x2bf3a0!=_0x23fa6f(0x15b)?_0x2bf3a0+'':_0x2bf3a0,_0x1592f6);let b=class extends _0x9156f8{constructor(_0x4d938c=M,_0x49d268,_0x4636dc){const _0x1bba38=_0x23fa6f;super(),this[_0x1bba38(0x174)]=_0x4d938c,this[_0x1bba38(0x140)]=_0x49d268,this[_0x1bba38(0x147)]=_0x4636dc;const {..._0x3cd3b9}=_0x110a0b({},M,this[_0x1bba38(0x174)]);this['_configService']['setConfig'](z,_0x3cd3b9);}[_0x23fa6f(0x145)](){const _0x50f6a0=_0x23fa6f;[[f],[g],[S]][_0x50f6a0(0x193)](_0x2ea6bc=>{const _0x4837c2=_0x50f6a0;this['_injector'][_0x4837c2(0x170)](_0x2ea6bc);});}['onReady'](){const _0x1fc511=_0x23fa6f;this[_0x1fc511(0x140)][_0x1fc511(0x13b)](g),this[_0x1fc511(0x140)][_0x1fc511(0x13b)](S);}};$(b,_0x23fa6f(0x167),W),$(b,_0x23fa6f(0x178),_0x43fc88[_0x23fa6f(0x142)]),b=ie([_0x1e041b(_0x4b0210,_0x3dcb68,_0x1dbdb7),w(0x1,_0x3c5570(_0x375bf6)),w(0x2,_0x1e8b56)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x4f9315=_0x1093;function _0x96a8(){const _0x11c432=['addUser','Solved','ref','content','getOwnPropertyDescriptor','setConfig','resolved','/edit','784YKkfsJ','UNRECOGNIZED','_initUserSync','syncUpdateMutationToColla','saveCommentToSnapshot','_injector','error','map','onReady','listComments','/universer-api/user/list','rangeType','_httpService','YYYY/MM/DD\x20HH:mm','/solved','size','userId','symbol','addComment','getMemberID','commentUpdate$','code','Edit','getComment','parentId','stringify','filter','unitId','resolveComment','rangeId','Solve','replyId','_userService','UNIVER_UNKNOWN','deleteComment','dataSource','payload','90oqcliU','solved','comment','6747856yDIypc','pluginName','comments','length','body','_commentService','root','_sessionService','replies','getCurrentUser','users','_threadCommentModel','defineProperty','getUnit','OpenOrReOpen','9627366ZMmpjv','type','slice','1870196FQApxT','/add','/universer-api/comment/unit/','COMMENT','_configService','user','818010nTJToR','4831821BlKIdG','9228hdXaxi','add','thread-comment-data-source.config','Reply','delete','_initDataSource','get','Unknown','format','disposeWithMe','createTimestamp','642795vzmxvy','_threadCommentDataSource','pipe','/list','find','_init','_threadCommentDataSourceService','threadId','post','forEach','30HBAqxF','values','updateComment','userID','parse','Delete','requireSession','Add','customRanges'];_0x96a8=function(){return _0x11c432;};return _0x96a8();}(function(_0x2b693b,_0x563364){const _0x58350a=_0x1093,_0x48d822=_0x2b693b();while(!![]){try{const _0x33833c=-parseInt(_0x58350a(0xe4))/0x1+-parseInt(_0x58350a(0xde))/0x2+-parseInt(_0x58350a(0xe6))/0x3*(-parseInt(_0x58350a(0x10c))/0x4)+parseInt(_0x58350a(0xf1))/0x5*(-parseInt(_0x58350a(0xfb))/0x6)+-parseInt(_0x58350a(0xdb))/0x7+-parseInt(_0x58350a(0x134))/0x8+parseInt(_0x58350a(0xe5))/0x9*(parseInt(_0x58350a(0x131))/0xa);if(_0x33833c===_0x563364)break;else _0x48d822['push'](_0x48d822['shift']());}catch(_0x42f4b5){_0x48d822['push'](_0x48d822['shift']());}}}(_0x96a8,0xc831a));import{CommentService as _0x3ab801,CollaborationSessionService as _0x243c30,UniverCollaborationClientPlugin as _0x589b09}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x10820f}from'@univerjs-pro/license';import{dayjs as _0x113944,UserManagerService as _0x3bc288,Inject as _0x4395a5,Injector as _0x3849c5,Disposable as _0x3f16eb,CustomRangeType as _0x1fdbdf,UniverInstanceType as _0x1d95eb,DependentOn as _0x4b6a7b,IConfigService as _0xd35145,Plugin as _0x290c01,merge as _0x5aa3a4}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x8ab5ff}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x26caec,IThreadCommentDataSourceService as _0xd47b4}from'@univerjs/thread-comment';import{bufferTime as _0x745818}from'rxjs';import{HTTPService as _0x495cf5}from'@univerjs/network';const W='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x2cea32=>(_0x2cea32[_0x2cea32[_0x4f9315(0xda)]=0x0]=_0x4f9315(0xda),_0x2cea32[_0x2cea32[_0x4f9315(0x105)]=0x1]=_0x4f9315(0x105),_0x2cea32[_0x2cea32[_0x4f9315(0x10d)]=-0x1]=_0x4f9315(0x10d),_0x2cea32))(I||{}),v=(_0x14b3a7=>(_0x14b3a7[_0x14b3a7[_0x4f9315(0xed)]=0x0]=_0x4f9315(0xed),_0x14b3a7[_0x14b3a7[_0x4f9315(0x102)]=0x1]='Add',_0x14b3a7[_0x14b3a7[_0x4f9315(0xe9)]=0x2]=_0x4f9315(0xe9),_0x14b3a7[_0x14b3a7[_0x4f9315(0x122)]=0x3]=_0x4f9315(0x122),_0x14b3a7[_0x14b3a7['Delete']=0x4]=_0x4f9315(0x100),_0x14b3a7[_0x14b3a7[_0x4f9315(0x12a)]=0x5]=_0x4f9315(0x12a),_0x14b3a7[_0x14b3a7[_0x4f9315(0x10d)]=-0x1]='UNRECOGNIZED',_0x14b3a7))(v||{});const D=_0x4a736c=>_0x113944(new Date(+_0x4a736c))[_0x4f9315(0xee)]('YYYY/MM/DD\x20HH:mm'),B=async(_0x45e369,_0x42f827)=>{const _0x4f2171=_0x4f9315,_0x141c32=_0x45e369[_0x4f2171(0xec)](_0x3bc288),_0x19cdba=_0x45e369[_0x4f2171(0xec)](_0x495cf5);_0x42f827[_0x4f2171(0xfa)](_0x3e7421=>{const _0x58b955=_0x4f2171;_0x141c32['getUser'](_0x3e7421)&&_0x42f827[_0x58b955(0xea)](_0x3e7421);}),_0x42f827[_0x4f2171(0x11b)]&&(await _0x19cdba[_0x4f2171(0xec)](_0x4f2171(0x116),{'params':{'userIDs':[..._0x42f827]}}))[_0x4f2171(0xd0)][_0x4f2171(0xd6)][_0x4f2171(0xfa)](_0x1fb079=>{const _0x7fd648=_0x4f2171;_0x1fb079&&_0x141c32[_0x7fd648(0x104)](_0x1fb079);});};var K=Object[_0x4f9315(0x108)],V=(_0x20f58a,_0x277ff2,_0x355b37,_0x12fa46)=>{const _0x568e55=_0x4f9315;for(var _0x272374=_0x12fa46>0x1?void 0x0:_0x12fa46?K(_0x277ff2,_0x355b37):_0x277ff2,_0x2aee80=_0x20f58a[_0x568e55(0xcf)]-0x1,_0x2a85c6;_0x2aee80>=0x0;_0x2aee80--)(_0x2a85c6=_0x20f58a[_0x2aee80])&&(_0x272374=_0x2a85c6(_0x272374)||_0x272374);return _0x272374;},p=(_0x43598d,_0xd8f65e)=>(_0x3d172e,_0x23861c)=>_0xd8f65e(_0x3d172e,_0x23861c,_0x43598d);let S=class extends _0x3f16eb{constructor(_0x5499df,_0x3d1d0e,_0x4ffe7a,_0x1a9d47){const _0x31b1d5=_0x4f9315;super(),this[_0x31b1d5(0xd1)]=_0x5499df,this[_0x31b1d5(0xd7)]=_0x3d1d0e,this['_userService']=_0x4ffe7a,this[_0x31b1d5(0x111)]=_0x1a9d47,this[_0x31b1d5(0xf6)](),this[_0x31b1d5(0x10e)]();}[_0x4f9315(0x10e)](){const _0x42caf8=_0x4f9315;this[_0x42caf8(0xef)](this[_0x42caf8(0xd7)][_0x42caf8(0x120)][_0x42caf8(0xf3)](_0x745818(0x10))['subscribe'](_0x20ab19=>{const _0x468743=_0x42caf8,_0x2c0254=new Set();_0x20ab19[_0x468743(0xfa)](_0x475f55=>{const _0x2a4489=_0x468743;switch(_0x475f55[_0x2a4489(0xdc)]){case'add':{const _0x27eb33=_0x475f55[_0x2a4489(0x130)]['personId'];_0x2c0254['add'](_0x27eb33);break;}}}),B(this['_injector'],_0x2c0254);}));}['_init'](){const _0x55fee9=_0x4f9315;this[_0x55fee9(0xef)](this['_commentService'][_0x55fee9(0x120)]['subscribe'](async _0x44860e=>{const _0x3a6bb7=_0x55fee9;var _0x4979be,_0x205623,_0x561492,_0x5100bc;const _0x2e4dcf=(_0x4979be=this[_0x3a6bb7(0xd7)][_0x3a6bb7(0xd9)](_0x44860e['unitId'])['find'](_0x1b0661=>_0x1b0661[_0x3a6bb7(0xf8)]===_0x44860e[_0x3a6bb7(0xf8)]))==null?void 0x0:_0x4979be['root'];if(!_0x2e4dcf)return;const {unitId:_0x2b5af0,subUnitId:_0x59b6b2}=_0x2e4dcf;switch(_0x44860e[_0x3a6bb7(0xe3)]&&this['_userService'][_0x3a6bb7(0x104)](_0x44860e[_0x3a6bb7(0xe3)]),_0x44860e[_0x3a6bb7(0xdc)]){case v[_0x3a6bb7(0x102)]:break;case v[_0x3a6bb7(0xe9)]:{this[_0x3a6bb7(0xd7)][_0x3a6bb7(0x11e)](_0x2b5af0,_0x59b6b2,{'unitId':_0x2b5af0,'subUnitId':_0x59b6b2,'ref':'','id':_0x44860e[_0x3a6bb7(0x12b)],'dT':D(+_0x44860e[_0x3a6bb7(0xf0)]),'threadId':_0x44860e[_0x3a6bb7(0xf8)],'personId':(_0x561492=(_0x205623=_0x44860e[_0x3a6bb7(0xe3)])==null?void 0x0:_0x205623[_0x3a6bb7(0xfe)])!=null?_0x561492:_0x44860e[_0x3a6bb7(0x11c)],'text':JSON[_0x3a6bb7(0xff)](_0x44860e[_0x3a6bb7(0x107)]),'parentId':_0x2e4dcf['id']});break;}case v[_0x3a6bb7(0x100)]:{const _0x2c1f36=this[_0x3a6bb7(0xd7)][_0x3a6bb7(0x123)](_0x2b5af0,_0x59b6b2,_0x44860e['replyId']);_0x2c1f36&&_0x2c1f36[_0x3a6bb7(0x124)]&&this[_0x3a6bb7(0xd7)][_0x3a6bb7(0x12e)](_0x2b5af0,_0x59b6b2,_0x44860e[_0x3a6bb7(0x12b)]);break;}case v['Edit']:{this[_0x3a6bb7(0xd7)][_0x3a6bb7(0xfd)](_0x2b5af0,_0x59b6b2,{'commentId':_0x44860e[_0x3a6bb7(0x12b)],'text':JSON[_0x3a6bb7(0xff)](_0x44860e['content'])});break;}case v[_0x3a6bb7(0x12a)]:{const _0x36f6c0=(_0x5100bc=this[_0x3a6bb7(0xd7)][_0x3a6bb7(0xd9)](_0x44860e[_0x3a6bb7(0x127)])[_0x3a6bb7(0xf5)](_0x33056c=>_0x33056c[_0x3a6bb7(0xf8)]===_0x44860e[_0x3a6bb7(0xf8)]))==null?void 0x0:_0x5100bc[_0x3a6bb7(0xd2)];_0x36f6c0&&this[_0x3a6bb7(0xd7)][_0x3a6bb7(0x128)](_0x2b5af0,_0x59b6b2,_0x36f6c0['id'],_0x44860e[_0x3a6bb7(0x132)]===I[_0x3a6bb7(0x105)]);break;}}}));}};function _0x1093(_0x3857f5,_0x4fd443){const _0x96a8bd=_0x96a8();return _0x1093=function(_0x109304,_0x485c03){_0x109304=_0x109304-0xce;let _0x298a36=_0x96a8bd[_0x109304];return _0x298a36;},_0x1093(_0x3857f5,_0x4fd443);}S=V([p(0x0,_0x4395a5(_0x3ab801)),p(0x1,_0x4395a5(_0x26caec)),p(0x2,_0x4395a5(_0x3bc288)),p(0x3,_0x4395a5(_0x3849c5))],S);const z=_0x4f9315(0xe8),M={};var k=Object[_0x4f9315(0x108)],Q=(_0x1bd5c6,_0x49c3ef,_0x14bbf8,_0x33aeee)=>{const _0x1768b1=_0x4f9315;for(var _0xb3d02=_0x33aeee>0x1?void 0x0:_0x33aeee?k(_0x49c3ef,_0x14bbf8):_0x49c3ef,_0x4a1d54=_0x1bd5c6[_0x1768b1(0xcf)]-0x1,_0x40768f;_0x4a1d54>=0x0;_0x4a1d54--)(_0x40768f=_0x1bd5c6[_0x4a1d54])&&(_0xb3d02=_0x40768f(_0xb3d02)||_0xb3d02);return _0xb3d02;},_=(_0x164b37,_0x3de780)=>(_0x4d7120,_0x39bfb0)=>_0x3de780(_0x4d7120,_0x39bfb0,_0x164b37);function X(_0x40d8b3,_0x3dfea5){const _0x38d0f5=_0x4f9315,_0x3485c1=_0x40d8b3[_0x38d0f5(0xd4)][0x0];return{..._0x3dfea5,'id':_0x3485c1[_0x38d0f5(0x12b)],'resolved':_0x40d8b3[_0x38d0f5(0x132)]===0x1,'dT':D(_0x3485c1[_0x38d0f5(0xf0)]),'personId':_0x3485c1['userId'],'threadId':_0x3485c1[_0x38d0f5(0xf8)]};}function ee(_0x14201c,_0x432a39,_0x82ef9c){const _0x2217ea=_0x4f9315;var _0x212383,_0x2550ff;if(((_0x2550ff=(_0x212383=_0x14201c==null?void 0x0:_0x14201c[_0x2217ea(0xd4)])==null?void 0x0:_0x212383[_0x2217ea(0xcf)])!=null?_0x2550ff:0x0)>0x0){const _0x3d64fa=(_0x16db86,_0x361ee9)=>({'id':_0x16db86['replyId'],'threadId':_0x16db86[_0x2217ea(0xf8)],'dT':D(_0x16db86['createTimestamp']),'personId':_0x16db86[_0x2217ea(0x11c)],'resolved':_0x14201c[_0x2217ea(0x132)]===I[_0x2217ea(0x105)],'unitId':_0x432a39,'subUnitId':_0x82ef9c,'text':JSON[_0x2217ea(0xff)](_0x16db86[_0x2217ea(0x107)]),'parentId':_0x361ee9}),_0x1d45fd=_0x3d64fa(_0x14201c['replies'][0x0]);return{..._0x1d45fd,'children':_0x14201c[_0x2217ea(0xd4)][_0x2217ea(0xdd)](0x1)[_0x2217ea(0x113)](_0xec80be=>_0x3d64fa(_0xec80be,_0x1d45fd['id']))};}return null;}let f=class{constructor(_0x5d2b5c,_0x24bb37,_0x17d125,_0x1f9715){const _0xa76332=_0x4f9315;this[_0xa76332(0x118)]=_0x5d2b5c,this[_0xa76332(0x12c)]=_0x24bb37,this['_sessionService']=_0x17d125,this[_0xa76332(0x111)]=_0x1f9715;}async[_0x4f9315(0x11e)](_0x39cff2){const _0x5e6a1a=_0x4f9315;var _0x606ea8,_0x1d8a59;const {parentId:_0x272415,unitId:_0x1dfb4c,text:_0x32f593,threadId:_0x40a64b}=_0x39cff2,_0x37930d=(_0x1d8a59=(_0x606ea8=_0x32f593[_0x5e6a1a(0x103)])==null?void 0x0:_0x606ea8[_0x5e6a1a(0x126)](_0x19b8b9=>_0x19b8b9[_0x5e6a1a(0x117)]===_0x1fdbdf['COMMENT'])[_0x5e6a1a(0x113)](_0x28d214=>_0x28d214['rangeId']))!=null?_0x1d8a59:[],_0x16ea6e=JSON[_0x5e6a1a(0x125)](_0x32f593),_0x41b451=(await this[_0x5e6a1a(0xd3)][_0x5e6a1a(0x101)](_0x1dfb4c))['getMemberID']();if(_0x272415){const _0x3018bc={'memberId':_0x41b451,'unitId':_0x1dfb4c,'content':_0x16ea6e,'mention':_0x37930d,'threadId':_0x40a64b},_0x3ccac9=(await this[_0x5e6a1a(0x118)][_0x5e6a1a(0xf9)]('/universer-api/comment/unit/'+_0x1dfb4c+'/reply',{'body':_0x3018bc}))[_0x5e6a1a(0xd0)]['reply'];return{..._0x39cff2,'id':_0x3ccac9[_0x5e6a1a(0x12b)],'dT':_0x113944(+_0x3ccac9[_0x5e6a1a(0xf0)])['format'](_0x5e6a1a(0x119)),'personId':_0x3ccac9[_0x5e6a1a(0x11c)]};}else{const _0x11ccd9={'memberId':_0x41b451,'unitId':_0x1dfb4c,'content':_0x16ea6e,'mention':_0x37930d},_0x15ab40=await this[_0x5e6a1a(0x118)][_0x5e6a1a(0xf9)](_0x5e6a1a(0xe0)+_0x1dfb4c+_0x5e6a1a(0xdf),{'body':_0x11ccd9});return X(_0x15ab40[_0x5e6a1a(0xd0)][_0x5e6a1a(0x133)],_0x39cff2);}}async[_0x4f9315(0xfd)](_0x9f708a){const _0x2e244c=_0x4f9315;var _0x1094ab,_0x9eadb1;const {text:_0x136fb3,unitId:_0x4b119a}=_0x9f708a,_0x8bcd7a=(_0x9eadb1=(_0x1094ab=_0x136fb3[_0x2e244c(0x103)])==null?void 0x0:_0x1094ab[_0x2e244c(0x126)](_0x2bdd51=>_0x2bdd51[_0x2e244c(0x117)]===_0x1fdbdf[_0x2e244c(0xe1)])[_0x2e244c(0x113)](_0x17fd80=>_0x17fd80[_0x2e244c(0x129)]))!=null?_0x9eadb1:[],_0x4292ea=JSON[_0x2e244c(0x125)](_0x136fb3),_0x74ef76=_0x9f708a[_0x2e244c(0xf8)],_0x47b62f=_0x9f708a['id'],_0x4cc6b6={'memberId':(await this['_sessionService'][_0x2e244c(0x101)](_0x4b119a))[_0x2e244c(0x11f)](),'unitId':_0x4b119a,'threadId':_0x74ef76,'mention':_0x8bcd7a,'content':_0x4292ea,'replyId':_0x47b62f},_0x17c92d=await this[_0x2e244c(0x118)][_0x2e244c(0xf9)](_0x2e244c(0xe0)+_0x4b119a+_0x2e244c(0x10b),{'body':_0x4cc6b6});return!_0x17c92d['body']['error']||_0x17c92d[_0x2e244c(0xd0)][_0x2e244c(0x112)][_0x2e244c(0x121)]===0x1;}async[_0x4f9315(0x128)](_0x2ae0aa){const _0xd71b21=_0x4f9315,{unitId:_0x2fa12d}=_0x2ae0aa,_0x398e82=_0x2ae0aa[_0xd71b21(0xf8)],_0x5cf04c={'memberId':this[_0xd71b21(0x12c)][_0xd71b21(0xd5)]()[_0xd71b21(0xfe)],'unitId':_0x2fa12d,'threadId':_0x398e82,'solved':_0x2ae0aa[_0xd71b21(0x10a)]?I['Solved']:I[_0xd71b21(0xda)]},_0x3cbf4b=await this[_0xd71b21(0x118)]['post'](_0xd71b21(0xe0)+_0x2fa12d+_0xd71b21(0x11a),{'body':_0x5cf04c});return!_0x3cbf4b['body'][_0xd71b21(0x112)]||_0x3cbf4b[_0xd71b21(0xd0)][_0xd71b21(0x112)][_0xd71b21(0x121)]===0x1;}async['deleteComment'](_0x35a27e,_0x1c2972,_0x1e2eb7,_0x5d94ad){const _0x1a143c=_0x4f9315,_0x4046a3={'memberId':(await this['_sessionService']['requireSession'](_0x35a27e))['getMemberID'](),'threadId':_0x1e2eb7,'replyId':_0x5d94ad,'unitId':_0x35a27e},_0x1097e9=await this[_0x1a143c(0x118)][_0x1a143c(0xf9)]('/universer-api/comment/unit/'+_0x35a27e+'/delete',{'body':_0x4046a3});return!_0x1097e9[_0x1a143c(0xd0)][_0x1a143c(0x112)]||_0x1097e9['body'][_0x1a143c(0x112)][_0x1a143c(0x121)]===0x1;}async[_0x4f9315(0x115)](_0x1c690d,_0x100e25,_0x249390){const _0x232e38=_0x4f9315,_0x3853ed={'unitId':_0x1c690d,'threadId':_0x249390},_0x4d5586=await this[_0x232e38(0x118)][_0x232e38(0xf9)](_0x232e38(0xe0)+_0x1c690d+_0x232e38(0xf4),{'body':_0x3853ed}),_0x35f3e8=_0x249390[_0x232e38(0x113)](_0x23232c=>ee(_0x4d5586['body'][_0x232e38(0xce)][_0x23232c],_0x1c690d,_0x100e25))[_0x232e38(0x126)](Boolean);return Object[_0x232e38(0xfc)](_0x4d5586[_0x232e38(0xd0)]['users'])['forEach'](_0x545a10=>{const _0x2a8ad9=_0x232e38;this['_userService'][_0x2a8ad9(0x104)](_0x545a10);}),_0x35f3e8;}[_0x4f9315(0x110)](_0x4af4cd){const _0x1c34a4=_0x4f9315;return{'id':_0x4af4cd['id'],'threadId':_0x4af4cd[_0x1c34a4(0xf8)],'ref':_0x4af4cd[_0x1c34a4(0x106)]};}};f=Q([_(0x0,_0x4395a5(_0x495cf5)),_(0x1,_0x4395a5(_0x3bc288)),_(0x2,_0x4395a5(_0x243c30)),_(0x3,_0x4395a5(_0x3849c5))],f);var re=Object[_0x4f9315(0x108)],te=(_0xaad7f3,_0x12e457,_0x427f69,_0x1a4463)=>{const _0x4f402c=_0x4f9315;for(var _0x4bc349=_0x1a4463>0x1?void 0x0:_0x1a4463?re(_0x12e457,_0x427f69):_0x12e457,_0x25fed4=_0xaad7f3[_0x4f402c(0xcf)]-0x1,_0x23bb74;_0x25fed4>=0x0;_0x25fed4--)(_0x23bb74=_0xaad7f3[_0x25fed4])&&(_0x4bc349=_0x23bb74(_0x4bc349)||_0x4bc349);return _0x4bc349;},N=(_0x20abad,_0x3bb62e)=>(_0x14fa97,_0x5215f0)=>_0x3bb62e(_0x14fa97,_0x5215f0,_0x20abad);let g=class extends _0x3f16eb{constructor(_0x1c665d,_0x42355f){const _0x1603bd=_0x4f9315;super(),this[_0x1603bd(0xf7)]=_0x1c665d,this[_0x1603bd(0xf2)]=_0x42355f,this[_0x1603bd(0xeb)]();}['_initDataSource'](){const _0xdbe197=_0x4f9315;this['_threadCommentDataSourceService'][_0xdbe197(0x12f)]=this[_0xdbe197(0xf2)],this[_0xdbe197(0xf7)][_0xdbe197(0x10f)]=!0x1;}};g=te([N(0x0,_0xd47b4),N(0x1,_0x4395a5(f))],g);var se=Object[_0x4f9315(0xd8)],oe=Object[_0x4f9315(0x108)],ne=(_0x3f7ab8,_0x1abd36,_0x58fb5b)=>_0x1abd36 in _0x3f7ab8?se(_0x3f7ab8,_0x1abd36,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x58fb5b}):_0x3f7ab8[_0x1abd36]=_0x58fb5b,ie=(_0x2e71ca,_0x3b0fe0,_0x3084a1,_0x2ba560)=>{const _0x19761b=_0x4f9315;for(var _0x2bea22=_0x2ba560>0x1?void 0x0:_0x2ba560?oe(_0x3b0fe0,_0x3084a1):_0x3b0fe0,_0x49d0fd=_0x2e71ca[_0x19761b(0xcf)]-0x1,_0x28df2d;_0x49d0fd>=0x0;_0x49d0fd--)(_0x28df2d=_0x2e71ca[_0x49d0fd])&&(_0x2bea22=_0x28df2d(_0x2bea22)||_0x2bea22);return _0x2bea22;},w=(_0x7f8c09,_0x2e66c9)=>(_0x404563,_0x5155cc)=>_0x2e66c9(_0x404563,_0x5155cc,_0x7f8c09),$=(_0x479723,_0x4ca56f,_0x42df61)=>ne(_0x479723,typeof _0x4ca56f!=_0x4f9315(0x11d)?_0x4ca56f+'':_0x4ca56f,_0x42df61);let b=class extends _0x290c01{constructor(_0x31c138=M,_0x38c186,_0x4ad6b3){const _0x4ce06d=_0x4f9315;super(),this['_config']=_0x31c138,this[_0x4ce06d(0x111)]=_0x38c186,this['_configService']=_0x4ad6b3;const {..._0x2f3327}=_0x5aa3a4({},M,this['_config']);this[_0x4ce06d(0xe2)][_0x4ce06d(0x109)](z,_0x2f3327);}['onStarting'](){const _0x588261=_0x4f9315;[[f],[g],[S]][_0x588261(0xfa)](_0x47773f=>{const _0x24f831=_0x588261;this[_0x24f831(0x111)][_0x24f831(0xe7)](_0x47773f);});}[_0x4f9315(0x114)](){const _0x3ff83a=_0x4f9315;this[_0x3ff83a(0x111)][_0x3ff83a(0xec)](g),this['_injector'][_0x3ff83a(0xec)](S);}};$(b,_0x4f9315(0x135),W),$(b,_0x4f9315(0xdc),_0x1d95eb[_0x4f9315(0x12d)]),b=ie([_0x4b6a7b(_0x8ab5ff,_0x589b09,_0x10820f),w(0x1,_0x4395a5(_0x3849c5)),w(0x2,_0xd35145)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x23fa6f=_0x50e2;(function(_0x34d748,_0x3b8ba5){const _0x26f94b=_0x50e2,_0x16dbaf=_0x34d748();while(!![]){try{const _0x3c29d6=parseInt(_0x26f94b(0x143))/0x1+parseInt(_0x26f94b(0x18f))/0x2+-parseInt(_0x26f94b(0x151))/0x3+-parseInt(_0x26f94b(0x132))/0x4+parseInt(_0x26f94b(0x159))/0x5+-parseInt(_0x26f94b(0x185))/0x6*(-parseInt(_0x26f94b(0x14a))/0x7)+parseInt(_0x26f94b(0x169))/0x8*(parseInt(_0x26f94b(0x173))/0x9);if(_0x3c29d6===_0x3b8ba5)break;else _0x16dbaf['push'](_0x16dbaf['shift']());}catch(_0x4b36c2){_0x16dbaf['push'](_0x16dbaf['shift']());}}}(_0x232d,0x587c4));import{CommentService as _0x20a661,CollaborationSessionService as _0xea13e3,UniverCollaborationClientPlugin as _0x3dcb68}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x1dbdb7}from'@univerjs-pro/license';import{dayjs as _0x3a9660,UserManagerService as _0x469b81,Inject as _0x3c5570,Injector as _0x375bf6,Disposable as _0x34d19b,CustomRangeType as _0x445314,UniverInstanceType as _0x43fc88,DependentOn as _0x1e041b,IConfigService as _0x1e8b56,Plugin as _0x9156f8,merge as _0x110a0b}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x4b0210}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x5f0ff,IThreadCommentDataSourceService as _0x2ecb1d}from'@univerjs/thread-comment';import{bufferTime as _0x5b8e83}from'rxjs';import{HTTPService as _0x46056e}from'@univerjs/network';const W=_0x23fa6f(0x166);var I=(_0x48f0cc=>(_0x48f0cc[_0x48f0cc[_0x23fa6f(0x158)]=0x0]=_0x23fa6f(0x158),_0x48f0cc[_0x48f0cc[_0x23fa6f(0x137)]=0x1]=_0x23fa6f(0x137),_0x48f0cc[_0x48f0cc[_0x23fa6f(0x171)]=-0x1]=_0x23fa6f(0x171),_0x48f0cc))(I||{}),v=(_0x2822d8=>(_0x2822d8[_0x2822d8[_0x23fa6f(0x188)]=0x0]=_0x23fa6f(0x188),_0x2822d8[_0x2822d8['Add']=0x1]='Add',_0x2822d8[_0x2822d8[_0x23fa6f(0x156)]=0x2]='Reply',_0x2822d8[_0x2822d8['Edit']=0x3]='Edit',_0x2822d8[_0x2822d8[_0x23fa6f(0x13d)]=0x4]=_0x23fa6f(0x13d),_0x2822d8[_0x2822d8[_0x23fa6f(0x177)]=0x5]=_0x23fa6f(0x177),_0x2822d8[_0x2822d8[_0x23fa6f(0x171)]=-0x1]=_0x23fa6f(0x171),_0x2822d8))(v||{});const D=_0x57489c=>_0x3a9660(new Date(+_0x57489c))[_0x23fa6f(0x17f)](_0x23fa6f(0x15e)),B=async(_0x1dd44f,_0x40b698)=>{const _0x7afd01=_0x23fa6f,_0x238c72=_0x1dd44f[_0x7afd01(0x13b)](_0x469b81),_0x315977=_0x1dd44f['get'](_0x46056e);_0x40b698['forEach'](_0x53849b=>{const _0x57666f=_0x7afd01;_0x238c72[_0x57666f(0x164)](_0x53849b)&&_0x40b698[_0x57666f(0x16e)](_0x53849b);}),_0x40b698[_0x7afd01(0x14e)]&&(await _0x315977[_0x7afd01(0x13b)]('/universer-api/user/list',{'params':{'userIDs':[..._0x40b698]}}))['body'][_0x7afd01(0x18c)][_0x7afd01(0x193)](_0x2c6970=>{const _0x32f084=_0x7afd01;_0x2c6970&&_0x238c72[_0x32f084(0x138)](_0x2c6970);});};var K=Object[_0x23fa6f(0x191)],V=(_0x240725,_0x301fe1,_0x7f5cca,_0x6aa73)=>{for(var _0x230780=_0x6aa73>0x1?void 0x0:_0x6aa73?K(_0x301fe1,_0x7f5cca):_0x301fe1,_0x2a8a03=_0x240725['length']-0x1,_0x17b4a7;_0x2a8a03>=0x0;_0x2a8a03--)(_0x17b4a7=_0x240725[_0x2a8a03])&&(_0x230780=_0x17b4a7(_0x230780)||_0x230780);return _0x230780;},p=(_0x538cbd,_0x7bae1)=>(_0xa0f7c1,_0x563fe3)=>_0x7bae1(_0xa0f7c1,_0x563fe3,_0x538cbd);let S=class extends _0x34d19b{constructor(_0x6cc892,_0x16fee6,_0x4db590,_0x23de98){const _0x3ffb7d=_0x23fa6f;super(),this[_0x3ffb7d(0x14d)]=_0x6cc892,this['_threadCommentModel']=_0x16fee6,this['_userService']=_0x4db590,this['_injector']=_0x23de98,this['_init'](),this[_0x3ffb7d(0x181)]();}['_initUserSync'](){const _0x19eeb0=_0x23fa6f;this[_0x19eeb0(0x14b)](this['_threadCommentModel']['commentUpdate$']['pipe'](_0x5b8e83(0x10))[_0x19eeb0(0x135)](_0x3b37b8=>{const _0x282ad1=_0x19eeb0,_0x582357=new Set();_0x3b37b8[_0x282ad1(0x193)](_0x514d50=>{const _0x328e3f=_0x282ad1;switch(_0x514d50[_0x328e3f(0x178)]){case _0x328e3f(0x170):{const _0x1e96c4=_0x514d50[_0x328e3f(0x13e)][_0x328e3f(0x144)];_0x582357['add'](_0x1e96c4);break;}}}),B(this[_0x282ad1(0x140)],_0x582357);}));}['_init'](){const _0x33ec78=_0x23fa6f;this[_0x33ec78(0x14b)](this['_commentService'][_0x33ec78(0x134)][_0x33ec78(0x135)](async _0x2ef939=>{const _0xcfd235=_0x33ec78;var _0x52fc42,_0x55b9ab,_0x18afa9,_0x2f5a17;const _0x58bbe5=(_0x52fc42=this[_0xcfd235(0x18d)][_0xcfd235(0x16d)](_0x2ef939['unitId'])[_0xcfd235(0x183)](_0x31f112=>_0x31f112[_0xcfd235(0x149)]===_0x2ef939[_0xcfd235(0x149)]))==null?void 0x0:_0x52fc42[_0xcfd235(0x17d)];if(!_0x58bbe5)return;const {unitId:_0x468376,subUnitId:_0x48c59b}=_0x58bbe5;switch(_0x2ef939[_0xcfd235(0x155)]&&this['_userService'][_0xcfd235(0x138)](_0x2ef939[_0xcfd235(0x155)]),_0x2ef939[_0xcfd235(0x178)]){case v[_0xcfd235(0x17b)]:break;case v['Reply']:{this[_0xcfd235(0x18d)][_0xcfd235(0x162)](_0x468376,_0x48c59b,{'unitId':_0x468376,'subUnitId':_0x48c59b,'ref':'','id':_0x2ef939[_0xcfd235(0x194)],'dT':D(+_0x2ef939[_0xcfd235(0x13a)]),'threadId':_0x2ef939['threadId'],'personId':(_0x18afa9=(_0x55b9ab=_0x2ef939[_0xcfd235(0x155)])==null?void 0x0:_0x55b9ab[_0xcfd235(0x184)])!=null?_0x18afa9:_0x2ef939[_0xcfd235(0x172)],'text':JSON[_0xcfd235(0x17a)](_0x2ef939[_0xcfd235(0x157)]),'parentId':_0x58bbe5['id']});break;}case v['Delete']:{const _0x49e090=this['_threadCommentModel'][_0xcfd235(0x14f)](_0x468376,_0x48c59b,_0x2ef939[_0xcfd235(0x194)]);_0x49e090&&_0x49e090[_0xcfd235(0x196)]&&this[_0xcfd235(0x18d)][_0xcfd235(0x175)](_0x468376,_0x48c59b,_0x2ef939['replyId']);break;}case v[_0xcfd235(0x131)]:{this[_0xcfd235(0x18d)][_0xcfd235(0x163)](_0x468376,_0x48c59b,{'commentId':_0x2ef939['replyId'],'text':JSON[_0xcfd235(0x17a)](_0x2ef939[_0xcfd235(0x157)])});break;}case v['Solve']:{const _0x9465d2=(_0x2f5a17=this[_0xcfd235(0x18d)][_0xcfd235(0x16d)](_0x2ef939[_0xcfd235(0x152)])[_0xcfd235(0x183)](_0x55bd72=>_0x55bd72[_0xcfd235(0x149)]===_0x2ef939[_0xcfd235(0x149)]))==null?void 0x0:_0x2f5a17[_0xcfd235(0x17d)];_0x9465d2&&this['_threadCommentModel'][_0xcfd235(0x150)](_0x468376,_0x48c59b,_0x9465d2['id'],_0x2ef939['solved']===I['Solved']);break;}}}));}};S=V([p(0x0,_0x3c5570(_0x20a661)),p(0x1,_0x3c5570(_0x5f0ff)),p(0x2,_0x3c5570(_0x469b81)),p(0x3,_0x3c5570(_0x375bf6))],S);const z=_0x23fa6f(0x16c),M={};var k=Object['getOwnPropertyDescriptor'],Q=(_0x82b03f,_0x4b6cee,_0x499727,_0x5f1d63)=>{for(var _0x1e114d=_0x5f1d63>0x1?void 0x0:_0x5f1d63?k(_0x4b6cee,_0x499727):_0x4b6cee,_0x3d66e0=_0x82b03f['length']-0x1,_0x467409;_0x3d66e0>=0x0;_0x3d66e0--)(_0x467409=_0x82b03f[_0x3d66e0])&&(_0x1e114d=_0x467409(_0x1e114d)||_0x1e114d);return _0x1e114d;},_=(_0x2ca03f,_0x153acf)=>(_0x988932,_0x25f323)=>_0x153acf(_0x988932,_0x25f323,_0x2ca03f);function X(_0x88b89b,_0x19ffdd){const _0x2ab970=_0x23fa6f,_0x7fee40=_0x88b89b[_0x2ab970(0x15a)][0x0];return{..._0x19ffdd,'id':_0x7fee40[_0x2ab970(0x194)],'resolved':_0x88b89b['solved']===0x1,'dT':D(_0x7fee40[_0x2ab970(0x13a)]),'personId':_0x7fee40[_0x2ab970(0x172)],'threadId':_0x7fee40[_0x2ab970(0x149)]};}function ee(_0x1f58a7,_0x149fdf,_0x153be4){const _0x24b445=_0x23fa6f;var _0x45511a,_0x445262;if(((_0x445262=(_0x45511a=_0x1f58a7==null?void 0x0:_0x1f58a7[_0x24b445(0x15a)])==null?void 0x0:_0x45511a[_0x24b445(0x182)])!=null?_0x445262:0x0)>0x0){const _0xca0303=(_0x48a89e,_0x2e9b24)=>({'id':_0x48a89e[_0x24b445(0x194)],'threadId':_0x48a89e[_0x24b445(0x149)],'dT':D(_0x48a89e['createTimestamp']),'personId':_0x48a89e['userId'],'resolved':_0x1f58a7[_0x24b445(0x15c)]===I[_0x24b445(0x137)],'unitId':_0x149fdf,'subUnitId':_0x153be4,'text':JSON[_0x24b445(0x17a)](_0x48a89e[_0x24b445(0x157)]),'parentId':_0x2e9b24}),_0x45d7e5=_0xca0303(_0x1f58a7[_0x24b445(0x15a)][0x0]);return{..._0x45d7e5,'children':_0x1f58a7[_0x24b445(0x15a)][_0x24b445(0x165)](0x1)[_0x24b445(0x141)](_0x3ded48=>_0xca0303(_0x3ded48,_0x45d7e5['id']))};}return null;}let f=class{constructor(_0x59501d,_0x3353d5,_0x31333c,_0x2b0455){const _0x176980=_0x23fa6f;this[_0x176980(0x16b)]=_0x59501d,this[_0x176980(0x139)]=_0x3353d5,this['_sessionService']=_0x31333c,this[_0x176980(0x140)]=_0x2b0455;}async['addComment'](_0x3369af){const _0x4dfc58=_0x23fa6f;var _0x1f7b0f,_0xdb71e2;const {parentId:_0x1f6c5d,unitId:_0x141d05,text:_0x14ea23,threadId:_0x4de648}=_0x3369af,_0xc577b4=(_0xdb71e2=(_0x1f7b0f=_0x14ea23['customRanges'])==null?void 0x0:_0x1f7b0f[_0x4dfc58(0x13c)](_0x682a48=>_0x682a48[_0x4dfc58(0x154)]===_0x445314[_0x4dfc58(0x15f)])[_0x4dfc58(0x141)](_0x43ddbc=>_0x43ddbc[_0x4dfc58(0x195)]))!=null?_0xdb71e2:[],_0x83fa7b=JSON[_0x4dfc58(0x192)](_0x14ea23),_0x492dcc=(await this[_0x4dfc58(0x186)][_0x4dfc58(0x18a)](_0x141d05))[_0x4dfc58(0x179)]();if(_0x1f6c5d){const _0x55cf12={'memberId':_0x492dcc,'unitId':_0x141d05,'content':_0x83fa7b,'mention':_0xc577b4,'threadId':_0x4de648},_0x569c35=(await this['_httpService'][_0x4dfc58(0x133)]('/universer-api/comment/unit/'+_0x141d05+_0x4dfc58(0x17c),{'body':_0x55cf12}))[_0x4dfc58(0x148)]['reply'];return{..._0x3369af,'id':_0x569c35['replyId'],'dT':_0x3a9660(+_0x569c35[_0x4dfc58(0x13a)])[_0x4dfc58(0x17f)](_0x4dfc58(0x15e)),'personId':_0x569c35[_0x4dfc58(0x172)]};}else{const _0x339d43={'memberId':_0x492dcc,'unitId':_0x141d05,'content':_0x83fa7b,'mention':_0xc577b4},_0x36639c=await this[_0x4dfc58(0x16b)]['post'](_0x4dfc58(0x146)+_0x141d05+_0x4dfc58(0x190),{'body':_0x339d43});return X(_0x36639c['body'][_0x4dfc58(0x136)],_0x3369af);}}async['updateComment'](_0x2272bb){const _0x4a829a=_0x23fa6f;var _0x4ed306,_0x33f969;const {text:_0x3bff7c,unitId:_0xaa685e}=_0x2272bb,_0x1ef3a8=(_0x33f969=(_0x4ed306=_0x3bff7c[_0x4a829a(0x16f)])==null?void 0x0:_0x4ed306[_0x4a829a(0x13c)](_0x505a42=>_0x505a42[_0x4a829a(0x154)]===_0x445314[_0x4a829a(0x15f)])[_0x4a829a(0x141)](_0xd5023c=>_0xd5023c[_0x4a829a(0x195)]))!=null?_0x33f969:[],_0x495eec=JSON[_0x4a829a(0x192)](_0x3bff7c),_0x396c5d=_0x2272bb[_0x4a829a(0x149)],_0x2dbfc2=_0x2272bb['id'],_0x42711a={'memberId':(await this[_0x4a829a(0x186)][_0x4a829a(0x18a)](_0xaa685e))[_0x4a829a(0x179)](),'unitId':_0xaa685e,'threadId':_0x396c5d,'mention':_0x1ef3a8,'content':_0x495eec,'replyId':_0x2dbfc2},_0x228803=await this[_0x4a829a(0x16b)]['post'](_0x4a829a(0x146)+_0xaa685e+_0x4a829a(0x153),{'body':_0x42711a});return!_0x228803[_0x4a829a(0x148)][_0x4a829a(0x13f)]||_0x228803[_0x4a829a(0x148)][_0x4a829a(0x13f)][_0x4a829a(0x187)]===0x1;}async[_0x23fa6f(0x150)](_0x3a102e){const _0x893dad=_0x23fa6f,{unitId:_0x1a4ee8}=_0x3a102e,_0x52948d=_0x3a102e[_0x893dad(0x149)],_0x315da6={'memberId':this[_0x893dad(0x139)][_0x893dad(0x168)]()[_0x893dad(0x184)],'unitId':_0x1a4ee8,'threadId':_0x52948d,'solved':_0x3a102e[_0x893dad(0x180)]?I['Solved']:I[_0x893dad(0x158)]},_0x5daa18=await this[_0x893dad(0x16b)][_0x893dad(0x133)](_0x893dad(0x146)+_0x1a4ee8+'/solved',{'body':_0x315da6});return!_0x5daa18[_0x893dad(0x148)][_0x893dad(0x13f)]||_0x5daa18['body'][_0x893dad(0x13f)]['code']===0x1;}async[_0x23fa6f(0x175)](_0x492fbe,_0x20aa2b,_0x47dc38,_0x43ed9a){const _0x338c77=_0x23fa6f,_0x37979b={'memberId':(await this[_0x338c77(0x186)][_0x338c77(0x18a)](_0x492fbe))[_0x338c77(0x179)](),'threadId':_0x47dc38,'replyId':_0x43ed9a,'unitId':_0x492fbe},_0x2a8e9b=await this[_0x338c77(0x16b)]['post'](_0x338c77(0x146)+_0x492fbe+_0x338c77(0x161),{'body':_0x37979b});return!_0x2a8e9b[_0x338c77(0x148)][_0x338c77(0x13f)]||_0x2a8e9b['body'][_0x338c77(0x13f)]['code']===0x1;}async[_0x23fa6f(0x160)](_0x45031e,_0x5a6ec3,_0x31447f){const _0x1baba2=_0x23fa6f,_0x14c29c={'unitId':_0x45031e,'threadId':_0x31447f},_0x49cb52=await this[_0x1baba2(0x16b)]['post'](_0x1baba2(0x146)+_0x45031e+_0x1baba2(0x189),{'body':_0x14c29c}),_0x2b2ae0=_0x31447f['map'](_0x43a8dc=>ee(_0x49cb52[_0x1baba2(0x148)]['comments'][_0x43a8dc],_0x45031e,_0x5a6ec3))['filter'](Boolean);return Object[_0x1baba2(0x18b)](_0x49cb52[_0x1baba2(0x148)]['users'])[_0x1baba2(0x193)](_0x446848=>{const _0x2db9d7=_0x1baba2;this[_0x2db9d7(0x139)][_0x2db9d7(0x138)](_0x446848);}),_0x2b2ae0;}[_0x23fa6f(0x16a)](_0x5b137d){const _0x42a704=_0x23fa6f;return{'id':_0x5b137d['id'],'threadId':_0x5b137d[_0x42a704(0x149)],'ref':_0x5b137d[_0x42a704(0x17e)]};}};f=Q([_(0x0,_0x3c5570(_0x46056e)),_(0x1,_0x3c5570(_0x469b81)),_(0x2,_0x3c5570(_0xea13e3)),_(0x3,_0x3c5570(_0x375bf6))],f);function _0x232d(){const _0x2cb19f=['UNRECOGNIZED','userId','81fieKZb','_config','deleteComment','_initDataSource','Solve','type','getMemberID','parse','Add','/reply','root','ref','format','resolved','_initUserSync','length','find','userID','1063266tWPabu','_sessionService','code','Unknown','/list','requireSession','values','users','_threadCommentModel','syncUpdateMutationToColla','207964FpCeoe','/add','getOwnPropertyDescriptor','stringify','forEach','replyId','rangeId','parentId','Edit','2124856atNMAs','post','commentUpdate$','subscribe','comment','Solved','addUser','_userService','createTimestamp','get','filter','Delete','payload','error','_injector','map','UNIVER_UNKNOWN','305756dYqwOB','personId','onStarting','/universer-api/comment/unit/','_configService','body','threadId','7WQHcox','disposeWithMe','defineProperty','_commentService','size','getComment','resolveComment','2131896lnGvoZ','unitId','/edit','rangeType','user','Reply','content','OpenOrReOpen','1998990evNXKx','replies','symbol','solved','_threadCommentDataSourceService','YYYY/MM/DD\x20HH:mm','COMMENT','listComments','/delete','addComment','updateComment','getUser','slice','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','pluginName','getCurrentUser','548920WTNLwF','saveCommentToSnapshot','_httpService','thread-comment-data-source.config','getUnit','delete','customRanges','add'];_0x232d=function(){return _0x2cb19f;};return _0x232d();}var re=Object['getOwnPropertyDescriptor'],te=(_0x4cdb3b,_0x5c6053,_0x306b0a,_0x11af14)=>{const _0xd59cd6=_0x23fa6f;for(var _0x4f0cb9=_0x11af14>0x1?void 0x0:_0x11af14?re(_0x5c6053,_0x306b0a):_0x5c6053,_0x27f433=_0x4cdb3b[_0xd59cd6(0x182)]-0x1,_0x228e1d;_0x27f433>=0x0;_0x27f433--)(_0x228e1d=_0x4cdb3b[_0x27f433])&&(_0x4f0cb9=_0x228e1d(_0x4f0cb9)||_0x4f0cb9);return _0x4f0cb9;},N=(_0x4b1047,_0x40107a)=>(_0x4df5fc,_0x3bbf7b)=>_0x40107a(_0x4df5fc,_0x3bbf7b,_0x4b1047);let g=class extends _0x34d19b{constructor(_0x3a2768,_0x29ad6b){const _0x159e26=_0x23fa6f;super(),this['_threadCommentDataSourceService']=_0x3a2768,this['_threadCommentDataSource']=_0x29ad6b,this[_0x159e26(0x176)]();}[_0x23fa6f(0x176)](){const _0x64a5cc=_0x23fa6f;this[_0x64a5cc(0x15d)]['dataSource']=this['_threadCommentDataSource'],this[_0x64a5cc(0x15d)][_0x64a5cc(0x18e)]=!0x1;}};function _0x50e2(_0x767746,_0x4ac769){const _0x232d80=_0x232d();return _0x50e2=function(_0x50e299,_0x5ddb01){_0x50e299=_0x50e299-0x131;let _0x470b70=_0x232d80[_0x50e299];return _0x470b70;},_0x50e2(_0x767746,_0x4ac769);}g=te([N(0x0,_0x2ecb1d),N(0x1,_0x3c5570(f))],g);var se=Object[_0x23fa6f(0x14c)],oe=Object[_0x23fa6f(0x191)],ne=(_0x467322,_0x45c742,_0x1aff4f)=>_0x45c742 in _0x467322?se(_0x467322,_0x45c742,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x1aff4f}):_0x467322[_0x45c742]=_0x1aff4f,ie=(_0x3fff74,_0x8420e7,_0x267e03,_0x3404c7)=>{const _0x199b92=_0x23fa6f;for(var _0x538b59=_0x3404c7>0x1?void 0x0:_0x3404c7?oe(_0x8420e7,_0x267e03):_0x8420e7,_0x23f855=_0x3fff74[_0x199b92(0x182)]-0x1,_0x2c5833;_0x23f855>=0x0;_0x23f855--)(_0x2c5833=_0x3fff74[_0x23f855])&&(_0x538b59=_0x2c5833(_0x538b59)||_0x538b59);return _0x538b59;},w=(_0x40970d,_0x4c0f04)=>(_0x30f643,_0x376f4d)=>_0x4c0f04(_0x30f643,_0x376f4d,_0x40970d),$=(_0x33098c,_0x2bf3a0,_0x1592f6)=>ne(_0x33098c,typeof _0x2bf3a0!=_0x23fa6f(0x15b)?_0x2bf3a0+'':_0x2bf3a0,_0x1592f6);let b=class extends _0x9156f8{constructor(_0x4d938c=M,_0x49d268,_0x4636dc){const _0x1bba38=_0x23fa6f;super(),this[_0x1bba38(0x174)]=_0x4d938c,this[_0x1bba38(0x140)]=_0x49d268,this[_0x1bba38(0x147)]=_0x4636dc;const {..._0x3cd3b9}=_0x110a0b({},M,this[_0x1bba38(0x174)]);this['_configService']['setConfig'](z,_0x3cd3b9);}[_0x23fa6f(0x145)](){const _0x50f6a0=_0x23fa6f;[[f],[g],[S]][_0x50f6a0(0x193)](_0x2ea6bc=>{const _0x4837c2=_0x50f6a0;this['_injector'][_0x4837c2(0x170)](_0x2ea6bc);});}['onReady'](){const _0x1fc511=_0x23fa6f;this[_0x1fc511(0x140)][_0x1fc511(0x13b)](g),this[_0x1fc511(0x140)][_0x1fc511(0x13b)](S);}};$(b,_0x23fa6f(0x167),W),$(b,_0x23fa6f(0x178),_0x43fc88[_0x23fa6f(0x142)]),b=ie([_0x1e041b(_0x4b0210,_0x3dcb68,_0x1dbdb7),w(0x1,_0x3c5570(_0x375bf6)),w(0x2,_0x1e8b56)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x4f9315=_0x1093;function _0x96a8(){const _0x11c432=['addUser','Solved','ref','content','getOwnPropertyDescriptor','setConfig','resolved','/edit','784YKkfsJ','UNRECOGNIZED','_initUserSync','syncUpdateMutationToColla','saveCommentToSnapshot','_injector','error','map','onReady','listComments','/universer-api/user/list','rangeType','_httpService','YYYY/MM/DD\x20HH:mm','/solved','size','userId','symbol','addComment','getMemberID','commentUpdate$','code','Edit','getComment','parentId','stringify','filter','unitId','resolveComment','rangeId','Solve','replyId','_userService','UNIVER_UNKNOWN','deleteComment','dataSource','payload','90oqcliU','solved','comment','6747856yDIypc','pluginName','comments','length','body','_commentService','root','_sessionService','replies','getCurrentUser','users','_threadCommentModel','defineProperty','getUnit','OpenOrReOpen','9627366ZMmpjv','type','slice','1870196FQApxT','/add','/universer-api/comment/unit/','COMMENT','_configService','user','818010nTJToR','4831821BlKIdG','9228hdXaxi','add','thread-comment-data-source.config','Reply','delete','_initDataSource','get','Unknown','format','disposeWithMe','createTimestamp','642795vzmxvy','_threadCommentDataSource','pipe','/list','find','_init','_threadCommentDataSourceService','threadId','post','forEach','30HBAqxF','values','updateComment','userID','parse','Delete','requireSession','Add','customRanges'];_0x96a8=function(){return _0x11c432;};return _0x96a8();}(function(_0x2b693b,_0x563364){const _0x58350a=_0x1093,_0x48d822=_0x2b693b();while(!![]){try{const _0x33833c=-parseInt(_0x58350a(0xe4))/0x1+-parseInt(_0x58350a(0xde))/0x2+-parseInt(_0x58350a(0xe6))/0x3*(-parseInt(_0x58350a(0x10c))/0x4)+parseInt(_0x58350a(0xf1))/0x5*(-parseInt(_0x58350a(0xfb))/0x6)+-parseInt(_0x58350a(0xdb))/0x7+-parseInt(_0x58350a(0x134))/0x8+parseInt(_0x58350a(0xe5))/0x9*(parseInt(_0x58350a(0x131))/0xa);if(_0x33833c===_0x563364)break;else _0x48d822['push'](_0x48d822['shift']());}catch(_0x42f4b5){_0x48d822['push'](_0x48d822['shift']());}}}(_0x96a8,0xc831a));import{CommentService as _0x3ab801,CollaborationSessionService as _0x243c30,UniverCollaborationClientPlugin as _0x589b09}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x10820f}from'@univerjs-pro/license';import{dayjs as _0x113944,UserManagerService as _0x3bc288,Inject as _0x4395a5,Injector as _0x3849c5,Disposable as _0x3f16eb,CustomRangeType as _0x1fdbdf,UniverInstanceType as _0x1d95eb,DependentOn as _0x4b6a7b,IConfigService as _0xd35145,Plugin as _0x290c01,merge as _0x5aa3a4}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x8ab5ff}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x26caec,IThreadCommentDataSourceService as _0xd47b4}from'@univerjs/thread-comment';import{bufferTime as _0x745818}from'rxjs';import{HTTPService as _0x495cf5}from'@univerjs/network';const W='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x2cea32=>(_0x2cea32[_0x2cea32[_0x4f9315(0xda)]=0x0]=_0x4f9315(0xda),_0x2cea32[_0x2cea32[_0x4f9315(0x105)]=0x1]=_0x4f9315(0x105),_0x2cea32[_0x2cea32[_0x4f9315(0x10d)]=-0x1]=_0x4f9315(0x10d),_0x2cea32))(I||{}),v=(_0x14b3a7=>(_0x14b3a7[_0x14b3a7[_0x4f9315(0xed)]=0x0]=_0x4f9315(0xed),_0x14b3a7[_0x14b3a7[_0x4f9315(0x102)]=0x1]='Add',_0x14b3a7[_0x14b3a7[_0x4f9315(0xe9)]=0x2]=_0x4f9315(0xe9),_0x14b3a7[_0x14b3a7[_0x4f9315(0x122)]=0x3]=_0x4f9315(0x122),_0x14b3a7[_0x14b3a7['Delete']=0x4]=_0x4f9315(0x100),_0x14b3a7[_0x14b3a7[_0x4f9315(0x12a)]=0x5]=_0x4f9315(0x12a),_0x14b3a7[_0x14b3a7[_0x4f9315(0x10d)]=-0x1]='UNRECOGNIZED',_0x14b3a7))(v||{});const D=_0x4a736c=>_0x113944(new Date(+_0x4a736c))[_0x4f9315(0xee)]('YYYY/MM/DD\x20HH:mm'),B=async(_0x45e369,_0x42f827)=>{const _0x4f2171=_0x4f9315,_0x141c32=_0x45e369[_0x4f2171(0xec)](_0x3bc288),_0x19cdba=_0x45e369[_0x4f2171(0xec)](_0x495cf5);_0x42f827[_0x4f2171(0xfa)](_0x3e7421=>{const _0x58b955=_0x4f2171;_0x141c32['getUser'](_0x3e7421)&&_0x42f827[_0x58b955(0xea)](_0x3e7421);}),_0x42f827[_0x4f2171(0x11b)]&&(await _0x19cdba[_0x4f2171(0xec)](_0x4f2171(0x116),{'params':{'userIDs':[..._0x42f827]}}))[_0x4f2171(0xd0)][_0x4f2171(0xd6)][_0x4f2171(0xfa)](_0x1fb079=>{const _0x7fd648=_0x4f2171;_0x1fb079&&_0x141c32[_0x7fd648(0x104)](_0x1fb079);});};var K=Object[_0x4f9315(0x108)],V=(_0x20f58a,_0x277ff2,_0x355b37,_0x12fa46)=>{const _0x568e55=_0x4f9315;for(var _0x272374=_0x12fa46>0x1?void 0x0:_0x12fa46?K(_0x277ff2,_0x355b37):_0x277ff2,_0x2aee80=_0x20f58a[_0x568e55(0xcf)]-0x1,_0x2a85c6;_0x2aee80>=0x0;_0x2aee80--)(_0x2a85c6=_0x20f58a[_0x2aee80])&&(_0x272374=_0x2a85c6(_0x272374)||_0x272374);return _0x272374;},p=(_0x43598d,_0xd8f65e)=>(_0x3d172e,_0x23861c)=>_0xd8f65e(_0x3d172e,_0x23861c,_0x43598d);let S=class extends _0x3f16eb{constructor(_0x5499df,_0x3d1d0e,_0x4ffe7a,_0x1a9d47){const _0x31b1d5=_0x4f9315;super(),this[_0x31b1d5(0xd1)]=_0x5499df,this[_0x31b1d5(0xd7)]=_0x3d1d0e,this['_userService']=_0x4ffe7a,this[_0x31b1d5(0x111)]=_0x1a9d47,this[_0x31b1d5(0xf6)](),this[_0x31b1d5(0x10e)]();}[_0x4f9315(0x10e)](){const _0x42caf8=_0x4f9315;this[_0x42caf8(0xef)](this[_0x42caf8(0xd7)][_0x42caf8(0x120)][_0x42caf8(0xf3)](_0x745818(0x10))['subscribe'](_0x20ab19=>{const _0x468743=_0x42caf8,_0x2c0254=new Set();_0x20ab19[_0x468743(0xfa)](_0x475f55=>{const _0x2a4489=_0x468743;switch(_0x475f55[_0x2a4489(0xdc)]){case'add':{const _0x27eb33=_0x475f55[_0x2a4489(0x130)]['personId'];_0x2c0254['add'](_0x27eb33);break;}}}),B(this['_injector'],_0x2c0254);}));}['_init'](){const _0x55fee9=_0x4f9315;this[_0x55fee9(0xef)](this['_commentService'][_0x55fee9(0x120)]['subscribe'](async _0x44860e=>{const _0x3a6bb7=_0x55fee9;var _0x4979be,_0x205623,_0x561492,_0x5100bc;const _0x2e4dcf=(_0x4979be=this[_0x3a6bb7(0xd7)][_0x3a6bb7(0xd9)](_0x44860e['unitId'])['find'](_0x1b0661=>_0x1b0661[_0x3a6bb7(0xf8)]===_0x44860e[_0x3a6bb7(0xf8)]))==null?void 0x0:_0x4979be['root'];if(!_0x2e4dcf)return;const {unitId:_0x2b5af0,subUnitId:_0x59b6b2}=_0x2e4dcf;switch(_0x44860e[_0x3a6bb7(0xe3)]&&this['_userService'][_0x3a6bb7(0x104)](_0x44860e[_0x3a6bb7(0xe3)]),_0x44860e[_0x3a6bb7(0xdc)]){case v[_0x3a6bb7(0x102)]:break;case v[_0x3a6bb7(0xe9)]:{this[_0x3a6bb7(0xd7)][_0x3a6bb7(0x11e)](_0x2b5af0,_0x59b6b2,{'unitId':_0x2b5af0,'subUnitId':_0x59b6b2,'ref':'','id':_0x44860e[_0x3a6bb7(0x12b)],'dT':D(+_0x44860e[_0x3a6bb7(0xf0)]),'threadId':_0x44860e[_0x3a6bb7(0xf8)],'personId':(_0x561492=(_0x205623=_0x44860e[_0x3a6bb7(0xe3)])==null?void 0x0:_0x205623[_0x3a6bb7(0xfe)])!=null?_0x561492:_0x44860e[_0x3a6bb7(0x11c)],'text':JSON[_0x3a6bb7(0xff)](_0x44860e[_0x3a6bb7(0x107)]),'parentId':_0x2e4dcf['id']});break;}case v[_0x3a6bb7(0x100)]:{const _0x2c1f36=this[_0x3a6bb7(0xd7)][_0x3a6bb7(0x123)](_0x2b5af0,_0x59b6b2,_0x44860e['replyId']);_0x2c1f36&&_0x2c1f36[_0x3a6bb7(0x124)]&&this[_0x3a6bb7(0xd7)][_0x3a6bb7(0x12e)](_0x2b5af0,_0x59b6b2,_0x44860e[_0x3a6bb7(0x12b)]);break;}case v['Edit']:{this[_0x3a6bb7(0xd7)][_0x3a6bb7(0xfd)](_0x2b5af0,_0x59b6b2,{'commentId':_0x44860e[_0x3a6bb7(0x12b)],'text':JSON[_0x3a6bb7(0xff)](_0x44860e['content'])});break;}case v[_0x3a6bb7(0x12a)]:{const _0x36f6c0=(_0x5100bc=this[_0x3a6bb7(0xd7)][_0x3a6bb7(0xd9)](_0x44860e[_0x3a6bb7(0x127)])[_0x3a6bb7(0xf5)](_0x33056c=>_0x33056c[_0x3a6bb7(0xf8)]===_0x44860e[_0x3a6bb7(0xf8)]))==null?void 0x0:_0x5100bc[_0x3a6bb7(0xd2)];_0x36f6c0&&this[_0x3a6bb7(0xd7)][_0x3a6bb7(0x128)](_0x2b5af0,_0x59b6b2,_0x36f6c0['id'],_0x44860e[_0x3a6bb7(0x132)]===I[_0x3a6bb7(0x105)]);break;}}}));}};function _0x1093(_0x3857f5,_0x4fd443){const _0x96a8bd=_0x96a8();return _0x1093=function(_0x109304,_0x485c03){_0x109304=_0x109304-0xce;let _0x298a36=_0x96a8bd[_0x109304];return _0x298a36;},_0x1093(_0x3857f5,_0x4fd443);}S=V([p(0x0,_0x4395a5(_0x3ab801)),p(0x1,_0x4395a5(_0x26caec)),p(0x2,_0x4395a5(_0x3bc288)),p(0x3,_0x4395a5(_0x3849c5))],S);const z=_0x4f9315(0xe8),M={};var k=Object[_0x4f9315(0x108)],Q=(_0x1bd5c6,_0x49c3ef,_0x14bbf8,_0x33aeee)=>{const _0x1768b1=_0x4f9315;for(var _0xb3d02=_0x33aeee>0x1?void 0x0:_0x33aeee?k(_0x49c3ef,_0x14bbf8):_0x49c3ef,_0x4a1d54=_0x1bd5c6[_0x1768b1(0xcf)]-0x1,_0x40768f;_0x4a1d54>=0x0;_0x4a1d54--)(_0x40768f=_0x1bd5c6[_0x4a1d54])&&(_0xb3d02=_0x40768f(_0xb3d02)||_0xb3d02);return _0xb3d02;},_=(_0x164b37,_0x3de780)=>(_0x4d7120,_0x39bfb0)=>_0x3de780(_0x4d7120,_0x39bfb0,_0x164b37);function X(_0x40d8b3,_0x3dfea5){const _0x38d0f5=_0x4f9315,_0x3485c1=_0x40d8b3[_0x38d0f5(0xd4)][0x0];return{..._0x3dfea5,'id':_0x3485c1[_0x38d0f5(0x12b)],'resolved':_0x40d8b3[_0x38d0f5(0x132)]===0x1,'dT':D(_0x3485c1[_0x38d0f5(0xf0)]),'personId':_0x3485c1['userId'],'threadId':_0x3485c1[_0x38d0f5(0xf8)]};}function ee(_0x14201c,_0x432a39,_0x82ef9c){const _0x2217ea=_0x4f9315;var _0x212383,_0x2550ff;if(((_0x2550ff=(_0x212383=_0x14201c==null?void 0x0:_0x14201c[_0x2217ea(0xd4)])==null?void 0x0:_0x212383[_0x2217ea(0xcf)])!=null?_0x2550ff:0x0)>0x0){const _0x3d64fa=(_0x16db86,_0x361ee9)=>({'id':_0x16db86['replyId'],'threadId':_0x16db86[_0x2217ea(0xf8)],'dT':D(_0x16db86['createTimestamp']),'personId':_0x16db86[_0x2217ea(0x11c)],'resolved':_0x14201c[_0x2217ea(0x132)]===I[_0x2217ea(0x105)],'unitId':_0x432a39,'subUnitId':_0x82ef9c,'text':JSON[_0x2217ea(0xff)](_0x16db86[_0x2217ea(0x107)]),'parentId':_0x361ee9}),_0x1d45fd=_0x3d64fa(_0x14201c['replies'][0x0]);return{..._0x1d45fd,'children':_0x14201c[_0x2217ea(0xd4)][_0x2217ea(0xdd)](0x1)[_0x2217ea(0x113)](_0xec80be=>_0x3d64fa(_0xec80be,_0x1d45fd['id']))};}return null;}let f=class{constructor(_0x5d2b5c,_0x24bb37,_0x17d125,_0x1f9715){const _0xa76332=_0x4f9315;this[_0xa76332(0x118)]=_0x5d2b5c,this[_0xa76332(0x12c)]=_0x24bb37,this['_sessionService']=_0x17d125,this[_0xa76332(0x111)]=_0x1f9715;}async[_0x4f9315(0x11e)](_0x39cff2){const _0x5e6a1a=_0x4f9315;var _0x606ea8,_0x1d8a59;const {parentId:_0x272415,unitId:_0x1dfb4c,text:_0x32f593,threadId:_0x40a64b}=_0x39cff2,_0x37930d=(_0x1d8a59=(_0x606ea8=_0x32f593[_0x5e6a1a(0x103)])==null?void 0x0:_0x606ea8[_0x5e6a1a(0x126)](_0x19b8b9=>_0x19b8b9[_0x5e6a1a(0x117)]===_0x1fdbdf['COMMENT'])[_0x5e6a1a(0x113)](_0x28d214=>_0x28d214['rangeId']))!=null?_0x1d8a59:[],_0x16ea6e=JSON[_0x5e6a1a(0x125)](_0x32f593),_0x41b451=(await this[_0x5e6a1a(0xd3)][_0x5e6a1a(0x101)](_0x1dfb4c))['getMemberID']();if(_0x272415){const _0x3018bc={'memberId':_0x41b451,'unitId':_0x1dfb4c,'content':_0x16ea6e,'mention':_0x37930d,'threadId':_0x40a64b},_0x3ccac9=(await this[_0x5e6a1a(0x118)][_0x5e6a1a(0xf9)]('/universer-api/comment/unit/'+_0x1dfb4c+'/reply',{'body':_0x3018bc}))[_0x5e6a1a(0xd0)]['reply'];return{..._0x39cff2,'id':_0x3ccac9[_0x5e6a1a(0x12b)],'dT':_0x113944(+_0x3ccac9[_0x5e6a1a(0xf0)])['format'](_0x5e6a1a(0x119)),'personId':_0x3ccac9[_0x5e6a1a(0x11c)]};}else{const _0x11ccd9={'memberId':_0x41b451,'unitId':_0x1dfb4c,'content':_0x16ea6e,'mention':_0x37930d},_0x15ab40=await this[_0x5e6a1a(0x118)][_0x5e6a1a(0xf9)](_0x5e6a1a(0xe0)+_0x1dfb4c+_0x5e6a1a(0xdf),{'body':_0x11ccd9});return X(_0x15ab40[_0x5e6a1a(0xd0)][_0x5e6a1a(0x133)],_0x39cff2);}}async[_0x4f9315(0xfd)](_0x9f708a){const _0x2e244c=_0x4f9315;var _0x1094ab,_0x9eadb1;const {text:_0x136fb3,unitId:_0x4b119a}=_0x9f708a,_0x8bcd7a=(_0x9eadb1=(_0x1094ab=_0x136fb3[_0x2e244c(0x103)])==null?void 0x0:_0x1094ab[_0x2e244c(0x126)](_0x2bdd51=>_0x2bdd51[_0x2e244c(0x117)]===_0x1fdbdf[_0x2e244c(0xe1)])[_0x2e244c(0x113)](_0x17fd80=>_0x17fd80[_0x2e244c(0x129)]))!=null?_0x9eadb1:[],_0x4292ea=JSON[_0x2e244c(0x125)](_0x136fb3),_0x74ef76=_0x9f708a[_0x2e244c(0xf8)],_0x47b62f=_0x9f708a['id'],_0x4cc6b6={'memberId':(await this['_sessionService'][_0x2e244c(0x101)](_0x4b119a))[_0x2e244c(0x11f)](),'unitId':_0x4b119a,'threadId':_0x74ef76,'mention':_0x8bcd7a,'content':_0x4292ea,'replyId':_0x47b62f},_0x17c92d=await this[_0x2e244c(0x118)][_0x2e244c(0xf9)](_0x2e244c(0xe0)+_0x4b119a+_0x2e244c(0x10b),{'body':_0x4cc6b6});return!_0x17c92d['body']['error']||_0x17c92d[_0x2e244c(0xd0)][_0x2e244c(0x112)][_0x2e244c(0x121)]===0x1;}async[_0x4f9315(0x128)](_0x2ae0aa){const _0xd71b21=_0x4f9315,{unitId:_0x2fa12d}=_0x2ae0aa,_0x398e82=_0x2ae0aa[_0xd71b21(0xf8)],_0x5cf04c={'memberId':this[_0xd71b21(0x12c)][_0xd71b21(0xd5)]()[_0xd71b21(0xfe)],'unitId':_0x2fa12d,'threadId':_0x398e82,'solved':_0x2ae0aa[_0xd71b21(0x10a)]?I['Solved']:I[_0xd71b21(0xda)]},_0x3cbf4b=await this[_0xd71b21(0x118)]['post'](_0xd71b21(0xe0)+_0x2fa12d+_0xd71b21(0x11a),{'body':_0x5cf04c});return!_0x3cbf4b['body'][_0xd71b21(0x112)]||_0x3cbf4b[_0xd71b21(0xd0)][_0xd71b21(0x112)][_0xd71b21(0x121)]===0x1;}async['deleteComment'](_0x35a27e,_0x1c2972,_0x1e2eb7,_0x5d94ad){const _0x1a143c=_0x4f9315,_0x4046a3={'memberId':(await this['_sessionService']['requireSession'](_0x35a27e))['getMemberID'](),'threadId':_0x1e2eb7,'replyId':_0x5d94ad,'unitId':_0x35a27e},_0x1097e9=await this[_0x1a143c(0x118)][_0x1a143c(0xf9)]('/universer-api/comment/unit/'+_0x35a27e+'/delete',{'body':_0x4046a3});return!_0x1097e9[_0x1a143c(0xd0)][_0x1a143c(0x112)]||_0x1097e9['body'][_0x1a143c(0x112)][_0x1a143c(0x121)]===0x1;}async[_0x4f9315(0x115)](_0x1c690d,_0x100e25,_0x249390){const _0x232e38=_0x4f9315,_0x3853ed={'unitId':_0x1c690d,'threadId':_0x249390},_0x4d5586=await this[_0x232e38(0x118)][_0x232e38(0xf9)](_0x232e38(0xe0)+_0x1c690d+_0x232e38(0xf4),{'body':_0x3853ed}),_0x35f3e8=_0x249390[_0x232e38(0x113)](_0x23232c=>ee(_0x4d5586['body'][_0x232e38(0xce)][_0x23232c],_0x1c690d,_0x100e25))[_0x232e38(0x126)](Boolean);return Object[_0x232e38(0xfc)](_0x4d5586[_0x232e38(0xd0)]['users'])['forEach'](_0x545a10=>{const _0x2a8ad9=_0x232e38;this['_userService'][_0x2a8ad9(0x104)](_0x545a10);}),_0x35f3e8;}[_0x4f9315(0x110)](_0x4af4cd){const _0x1c34a4=_0x4f9315;return{'id':_0x4af4cd['id'],'threadId':_0x4af4cd[_0x1c34a4(0xf8)],'ref':_0x4af4cd[_0x1c34a4(0x106)]};}};f=Q([_(0x0,_0x4395a5(_0x495cf5)),_(0x1,_0x4395a5(_0x3bc288)),_(0x2,_0x4395a5(_0x243c30)),_(0x3,_0x4395a5(_0x3849c5))],f);var re=Object[_0x4f9315(0x108)],te=(_0xaad7f3,_0x12e457,_0x427f69,_0x1a4463)=>{const _0x4f402c=_0x4f9315;for(var _0x4bc349=_0x1a4463>0x1?void 0x0:_0x1a4463?re(_0x12e457,_0x427f69):_0x12e457,_0x25fed4=_0xaad7f3[_0x4f402c(0xcf)]-0x1,_0x23bb74;_0x25fed4>=0x0;_0x25fed4--)(_0x23bb74=_0xaad7f3[_0x25fed4])&&(_0x4bc349=_0x23bb74(_0x4bc349)||_0x4bc349);return _0x4bc349;},N=(_0x20abad,_0x3bb62e)=>(_0x14fa97,_0x5215f0)=>_0x3bb62e(_0x14fa97,_0x5215f0,_0x20abad);let g=class extends _0x3f16eb{constructor(_0x1c665d,_0x42355f){const _0x1603bd=_0x4f9315;super(),this[_0x1603bd(0xf7)]=_0x1c665d,this[_0x1603bd(0xf2)]=_0x42355f,this[_0x1603bd(0xeb)]();}['_initDataSource'](){const _0xdbe197=_0x4f9315;this['_threadCommentDataSourceService'][_0xdbe197(0x12f)]=this[_0xdbe197(0xf2)],this[_0xdbe197(0xf7)][_0xdbe197(0x10f)]=!0x1;}};g=te([N(0x0,_0xd47b4),N(0x1,_0x4395a5(f))],g);var se=Object[_0x4f9315(0xd8)],oe=Object[_0x4f9315(0x108)],ne=(_0x3f7ab8,_0x1abd36,_0x58fb5b)=>_0x1abd36 in _0x3f7ab8?se(_0x3f7ab8,_0x1abd36,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x58fb5b}):_0x3f7ab8[_0x1abd36]=_0x58fb5b,ie=(_0x2e71ca,_0x3b0fe0,_0x3084a1,_0x2ba560)=>{const _0x19761b=_0x4f9315;for(var _0x2bea22=_0x2ba560>0x1?void 0x0:_0x2ba560?oe(_0x3b0fe0,_0x3084a1):_0x3b0fe0,_0x49d0fd=_0x2e71ca[_0x19761b(0xcf)]-0x1,_0x28df2d;_0x49d0fd>=0x0;_0x49d0fd--)(_0x28df2d=_0x2e71ca[_0x49d0fd])&&(_0x2bea22=_0x28df2d(_0x2bea22)||_0x2bea22);return _0x2bea22;},w=(_0x7f8c09,_0x2e66c9)=>(_0x404563,_0x5155cc)=>_0x2e66c9(_0x404563,_0x5155cc,_0x7f8c09),$=(_0x479723,_0x4ca56f,_0x42df61)=>ne(_0x479723,typeof _0x4ca56f!=_0x4f9315(0x11d)?_0x4ca56f+'':_0x4ca56f,_0x42df61);let b=class extends _0x290c01{constructor(_0x31c138=M,_0x38c186,_0x4ad6b3){const _0x4ce06d=_0x4f9315;super(),this['_config']=_0x31c138,this[_0x4ce06d(0x111)]=_0x38c186,this['_configService']=_0x4ad6b3;const {..._0x2f3327}=_0x5aa3a4({},M,this['_config']);this[_0x4ce06d(0xe2)][_0x4ce06d(0x109)](z,_0x2f3327);}['onStarting'](){const _0x588261=_0x4f9315;[[f],[g],[S]][_0x588261(0xfa)](_0x47773f=>{const _0x24f831=_0x588261;this[_0x24f831(0x111)][_0x24f831(0xe7)](_0x47773f);});}[_0x4f9315(0x114)](){const _0x3ff83a=_0x4f9315;this[_0x3ff83a(0x111)][_0x3ff83a(0xec)](g),this['_injector'][_0x3ff83a(0xec)](S);}};$(b,_0x4f9315(0x135),W),$(b,_0x4f9315(0xdc),_0x1d95eb[_0x4f9315(0x12d)]),b=ie([_0x4b6a7b(_0x8ab5ff,_0x589b09,_0x10820f),w(0x1,_0x4395a5(_0x3849c5)),w(0x2,_0xd35145)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IBaseComment, IThreadComment, IThreadCommentDataSource } from '@univerjs/thread-comment';
|
|
2
|
+
import { CollaborationSessionService } from '@univerjs-pro/collaboration-client';
|
|
2
3
|
import { Injector, UserManagerService } from '@univerjs/core';
|
|
3
4
|
import { HTTPService } from '@univerjs/network';
|
|
4
|
-
import { CollaborationSessionService } from '@univerjs-pro/collaboration-client';
|
|
5
5
|
export declare class ThreadCommentServerDataSource implements IThreadCommentDataSource {
|
|
6
6
|
private readonly _httpService;
|
|
7
7
|
private readonly _userService;
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x484d(_0x31ae11,_0x3f40f5){const _0x2515c7=_0x2515();return _0x484d=function(_0x484db5,_0x3a9436){_0x484db5=_0x484db5-0x179;let _0x2920e0=_0x2515c7[_0x484db5];return _0x2920e0;},_0x484d(_0x31ae11,_0x3f40f5);}function _0x2515(){const _0x16ad8d=['@univerjs-pro/collaboration-client','thread-comment-data-source.config','getComment','@univerjs/core','UniverInstanceType','UserManagerService','619027bbgRGd','UniverThreadCommentDataSourcePlugin','addUser','UniverProCollaborationClient','createTimestamp','function','Add','customRanges','_config','amd','UniverCollaborationClientPlugin','16730YFGOaw','length','getMemberID','2134689PIeWeo','_injector','rangeId','disposeWithMe','forEach','size','_initUserSync','userId','getOwnPropertyDescriptor','UniverCore','commentUpdate$','5093890PsiodC','comments','onStarting','dataSource','UniverProLicense','/edit','Reply','error','@univerjs-pro/license','replies','add','_commentService','rangeType','4hVBuRA','@univerjs/thread-comment-ui','_threadCommentModel','map','OpenOrReOpen','solved','format','UniverThreadCommentUi','10vzcgqS','payload','_threadCommentDataSourceService','root','/list','get','personId','IThreadCommentDataSourceService','addComment','exports','body','post','UNRECOGNIZED','resolveComment','UniverProThreadCommentDatasource','/solved','Edit','getUser','CollaborationSessionService','setConfig','Module','listComments','@univerjs/thread-comment','_configService','getCurrentUser','comment','user','delete','8840227McgQPG','pluginName','dayjs','find','CommentService','defineProperty','_httpService','merge','subscribe','/delete','4wBcLrT','Disposable','Solved','UniverThreadComment','_initDataSource','3787312BJHNXp','slice','updateComment','unitId','_sessionService','YYYY/MM/DD\x20HH:mm','userID','Solve','resolved','CustomRangeType','_threadCommentDataSource','@univerjs/network','parse','_init','Delete','syncUpdateMutationToColla','/universer-api/comment/unit/','requireSession','UNIVER_UNKNOWN','Injector','Plugin','stringify','type','threadId','COMMENT','reply','1398hjoqal','users','Inject','content','object','code','_userService','saveCommentToSnapshot','replyId','getUnit','18CtZiQI','HTTPService','pipe','toStringTag','Unknown','3448464zNrjNd','filter'];_0x2515=function(){return _0x16ad8d;};return _0x2515();}(function(_0x19045f,_0x98417a){const _0x4259e9=_0x484d,_0x40e4f1=_0x19045f();while(!![]){try{const _0x204bd8=-parseInt(_0x4259e9(0x17d))/0x1+parseInt(_0x4259e9(0x1d1))/0x2*(parseInt(_0x4259e9(0x18b))/0x3)+-parseInt(_0x4259e9(0x1a3))/0x4*(parseInt(_0x4259e9(0x196))/0x5)+parseInt(_0x4259e9(0x1f0))/0x6*(parseInt(_0x4259e9(0x188))/0x7)+parseInt(_0x4259e9(0x1d6))/0x8*(parseInt(_0x4259e9(0x1fa))/0x9)+parseInt(_0x4259e9(0x1ab))/0xa*(-parseInt(_0x4259e9(0x1c7))/0xb)+parseInt(_0x4259e9(0x1ff))/0xc;if(_0x204bd8===_0x98417a)break;else _0x40e4f1['push'](_0x40e4f1['shift']());}catch(_0x3866fa){_0x40e4f1['push'](_0x40e4f1['shift']());}}}(_0x2515,0xbca7e),function(_0x40c7e1,_0x555120){const _0x3bb550=_0x484d;typeof exports==_0x3bb550(0x1f4)&&typeof module<'u'?_0x555120(exports,require(_0x3bb550(0x201)),require('@univerjs-pro/license'),require(_0x3bb550(0x17a)),require(_0x3bb550(0x1a4)),require(_0x3bb550(0x1c1)),require('rxjs'),require(_0x3bb550(0x1e1))):typeof define==_0x3bb550(0x182)&&define[_0x3bb550(0x186)]?define([_0x3bb550(0x1b4),_0x3bb550(0x201),_0x3bb550(0x19e),_0x3bb550(0x17a),_0x3bb550(0x1a4),_0x3bb550(0x1c1),'rxjs','@univerjs/network'],_0x555120):(_0x40c7e1=typeof globalThis<'u'?globalThis:_0x40c7e1||self,_0x555120(_0x40c7e1[_0x3bb550(0x1b9)]={},_0x40c7e1[_0x3bb550(0x180)],_0x40c7e1[_0x3bb550(0x19a)],_0x40c7e1[_0x3bb550(0x194)],_0x40c7e1[_0x3bb550(0x1aa)],_0x40c7e1[_0x3bb550(0x1d4)],_0x40c7e1['rxjs'],_0x40c7e1['UniverNetwork']));}(this,function(_0x3fdf36,_0x1bf240,_0x10c06b,_0x34b4ef,_0x54799e,_0x2920d2,_0x3a6403,_0x422bd1){'use strict';const _0x484063=_0x484d;const _0x163e9e='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var _0x4c4f19=(_0x50523f=>(_0x50523f[_0x50523f['OpenOrReOpen']=0x0]=_0x484063(0x1a7),_0x50523f[_0x50523f[_0x484063(0x1d3)]=0x1]='Solved',_0x50523f[_0x50523f[_0x484063(0x1b7)]=-0x1]=_0x484063(0x1b7),_0x50523f))(_0x4c4f19||{}),_0x150b2e=(_0x33b155=>(_0x33b155[_0x33b155[_0x484063(0x1fe)]=0x0]='Unknown',_0x33b155[_0x33b155['Add']=0x1]=_0x484063(0x183),_0x33b155[_0x33b155['Reply']=0x2]='Reply',_0x33b155[_0x33b155[_0x484063(0x1bb)]=0x3]='Edit',_0x33b155[_0x33b155['Delete']=0x4]='Delete',_0x33b155[_0x33b155[_0x484063(0x1dd)]=0x5]=_0x484063(0x1dd),_0x33b155[_0x33b155['UNRECOGNIZED']=-0x1]='UNRECOGNIZED',_0x33b155))(_0x150b2e||{});const _0x13a113=_0x467e19=>_0x34b4ef[_0x484063(0x1c9)](new Date(+_0x467e19))[_0x484063(0x1a9)](_0x484063(0x1db)),_0x45285c=async(_0x587df8,_0x2ee803)=>{const _0x9b42e1=_0x484063,_0x23dce7=_0x587df8['get'](_0x34b4ef['UserManagerService']),_0xc81ee3=_0x587df8[_0x9b42e1(0x1b0)](_0x422bd1['HTTPService']);_0x2ee803[_0x9b42e1(0x18f)](_0xfe9869=>{const _0x535196=_0x9b42e1;_0x23dce7[_0x535196(0x1bc)](_0xfe9869)&&_0x2ee803[_0x535196(0x1c6)](_0xfe9869);}),_0x2ee803[_0x9b42e1(0x190)]&&(await _0xc81ee3['get']('/universer-api/user/list',{'params':{'userIDs':[..._0x2ee803]}}))[_0x9b42e1(0x1b5)][_0x9b42e1(0x1f1)][_0x9b42e1(0x18f)](_0x193c35=>{const _0x1319ec=_0x9b42e1;_0x193c35&&_0x23dce7[_0x1319ec(0x17f)](_0x193c35);});};var _0x2a5fba=Object[_0x484063(0x193)],_0x5f1d92=(_0x3d6629,_0x65c04a,_0x5a7bf5,_0x4e2486)=>{const _0x2dfb84=_0x484063;for(var _0x23990d=_0x4e2486>0x1?void 0x0:_0x4e2486?_0x2a5fba(_0x65c04a,_0x5a7bf5):_0x65c04a,_0xbc36e3=_0x3d6629[_0x2dfb84(0x189)]-0x1,_0x5f27d8;_0xbc36e3>=0x0;_0xbc36e3--)(_0x5f27d8=_0x3d6629[_0xbc36e3])&&(_0x23990d=_0x5f27d8(_0x23990d)||_0x23990d);return _0x23990d;},_0x415f6f=(_0x279836,_0x11337a)=>(_0x25b53d,_0x91a6c1)=>_0x11337a(_0x25b53d,_0x91a6c1,_0x279836);let _0x4fffe9=class extends _0x34b4ef['Disposable']{constructor(_0x275dd7,_0x3a78a5,_0x4e34a0,_0x2cc8fd){const _0x28cf6d=_0x484063;super(),this[_0x28cf6d(0x1a1)]=_0x275dd7,this['_threadCommentModel']=_0x3a78a5,this[_0x28cf6d(0x1f6)]=_0x4e34a0,this['_injector']=_0x2cc8fd,this[_0x28cf6d(0x1e3)](),this[_0x28cf6d(0x191)]();}['_initUserSync'](){const _0x1ca266=_0x484063;this[_0x1ca266(0x18e)](this[_0x1ca266(0x1a5)][_0x1ca266(0x195)][_0x1ca266(0x1fc)](_0x3a6403['bufferTime'](0x10))[_0x1ca266(0x1cf)](_0x8a30ab=>{const _0x19da2c=_0x1ca266,_0x100427=new Set();_0x8a30ab[_0x19da2c(0x18f)](_0x567032=>{const _0x884667=_0x19da2c;switch(_0x567032[_0x884667(0x1ec)]){case _0x884667(0x1a0):{const _0x4fe343=_0x567032[_0x884667(0x1ac)][_0x884667(0x1b1)];_0x100427[_0x884667(0x1a0)](_0x4fe343);break;}}}),_0x45285c(this['_injector'],_0x100427);}));}[_0x484063(0x1e3)](){const _0x53a94a=_0x484063;this[_0x53a94a(0x18e)](this[_0x53a94a(0x1a1)]['commentUpdate$'][_0x53a94a(0x1cf)](async _0x546594=>{const _0x532c54=_0x53a94a;var _0x28c71a,_0x14b135,_0x5e4969,_0x3fbd9a;const _0x5a949c=(_0x28c71a=this[_0x532c54(0x1a5)][_0x532c54(0x1f9)](_0x546594['unitId'])[_0x532c54(0x1ca)](_0x2f757d=>_0x2f757d['threadId']===_0x546594['threadId']))==null?void 0x0:_0x28c71a[_0x532c54(0x1ae)];if(!_0x5a949c)return;const {unitId:_0x239278,subUnitId:_0x3368fd}=_0x5a949c;switch(_0x546594['user']&&this[_0x532c54(0x1f6)][_0x532c54(0x17f)](_0x546594[_0x532c54(0x1c5)]),_0x546594[_0x532c54(0x1ec)]){case _0x150b2e[_0x532c54(0x183)]:break;case _0x150b2e[_0x532c54(0x19c)]:{this[_0x532c54(0x1a5)][_0x532c54(0x1b3)](_0x239278,_0x3368fd,{'unitId':_0x239278,'subUnitId':_0x3368fd,'ref':'','id':_0x546594[_0x532c54(0x1f8)],'dT':_0x13a113(+_0x546594['createTimestamp']),'threadId':_0x546594['threadId'],'personId':(_0x5e4969=(_0x14b135=_0x546594[_0x532c54(0x1c5)])==null?void 0x0:_0x14b135[_0x532c54(0x1dc)])!=null?_0x5e4969:_0x546594[_0x532c54(0x192)],'text':JSON[_0x532c54(0x1e2)](_0x546594[_0x532c54(0x1f3)]),'parentId':_0x5a949c['id']});break;}case _0x150b2e[_0x532c54(0x1e4)]:{const _0x264636=this[_0x532c54(0x1a5)][_0x532c54(0x179)](_0x239278,_0x3368fd,_0x546594[_0x532c54(0x1f8)]);_0x264636&&_0x264636['parentId']&&this[_0x532c54(0x1a5)]['deleteComment'](_0x239278,_0x3368fd,_0x546594[_0x532c54(0x1f8)]);break;}case _0x150b2e[_0x532c54(0x1bb)]:{this[_0x532c54(0x1a5)][_0x532c54(0x1d8)](_0x239278,_0x3368fd,{'commentId':_0x546594['replyId'],'text':JSON['parse'](_0x546594[_0x532c54(0x1f3)])});break;}case _0x150b2e['Solve']:{const _0x5d830f=(_0x3fbd9a=this[_0x532c54(0x1a5)][_0x532c54(0x1f9)](_0x546594[_0x532c54(0x1d9)])[_0x532c54(0x1ca)](_0x58d7d6=>_0x58d7d6[_0x532c54(0x1ed)]===_0x546594['threadId']))==null?void 0x0:_0x3fbd9a['root'];_0x5d830f&&this[_0x532c54(0x1a5)][_0x532c54(0x1b8)](_0x239278,_0x3368fd,_0x5d830f['id'],_0x546594[_0x532c54(0x1a8)]===_0x4c4f19[_0x532c54(0x1d3)]);break;}}}));}};_0x4fffe9=_0x5f1d92([_0x415f6f(0x0,_0x34b4ef[_0x484063(0x1f2)](_0x1bf240[_0x484063(0x1cb)])),_0x415f6f(0x1,_0x34b4ef[_0x484063(0x1f2)](_0x2920d2['ThreadCommentModel'])),_0x415f6f(0x2,_0x34b4ef[_0x484063(0x1f2)](_0x34b4ef[_0x484063(0x17c)])),_0x415f6f(0x3,_0x34b4ef[_0x484063(0x1f2)](_0x34b4ef[_0x484063(0x1e9)]))],_0x4fffe9);const _0xbc477f=_0x484063(0x202),_0x1286f6={};var _0x229259=Object[_0x484063(0x193)],_0x5e2b04=(_0x50ea21,_0x5a57e9,_0x1607b4,_0x4b98f1)=>{for(var _0x4126e6=_0x4b98f1>0x1?void 0x0:_0x4b98f1?_0x229259(_0x5a57e9,_0x1607b4):_0x5a57e9,_0x5ce110=_0x50ea21['length']-0x1,_0x5316d3;_0x5ce110>=0x0;_0x5ce110--)(_0x5316d3=_0x50ea21[_0x5ce110])&&(_0x4126e6=_0x5316d3(_0x4126e6)||_0x4126e6);return _0x4126e6;},_0x27daaf=(_0x419c69,_0x46e1be)=>(_0x5d08b2,_0x38e5e0)=>_0x46e1be(_0x5d08b2,_0x38e5e0,_0x419c69);function _0x9cd3d5(_0x1bab5a,_0x4fbd83){const _0x228d76=_0x484063,_0x10a0db=_0x1bab5a[_0x228d76(0x19f)][0x0];return{..._0x4fbd83,'id':_0x10a0db[_0x228d76(0x1f8)],'resolved':_0x1bab5a[_0x228d76(0x1a8)]===0x1,'dT':_0x13a113(_0x10a0db[_0x228d76(0x181)]),'personId':_0x10a0db[_0x228d76(0x192)],'threadId':_0x10a0db[_0x228d76(0x1ed)]};}function _0x5ea313(_0x4c87fa,_0x294f25,_0x1bb164){const _0x455e8c=_0x484063;var _0x3ea11a,_0x1442ba;if(((_0x1442ba=(_0x3ea11a=_0x4c87fa==null?void 0x0:_0x4c87fa['replies'])==null?void 0x0:_0x3ea11a[_0x455e8c(0x189)])!=null?_0x1442ba:0x0)>0x0){const _0x53143c=(_0x255a87,_0x43ee0f)=>({'id':_0x255a87[_0x455e8c(0x1f8)],'threadId':_0x255a87[_0x455e8c(0x1ed)],'dT':_0x13a113(_0x255a87['createTimestamp']),'personId':_0x255a87[_0x455e8c(0x192)],'resolved':_0x4c87fa[_0x455e8c(0x1a8)]===_0x4c4f19[_0x455e8c(0x1d3)],'unitId':_0x294f25,'subUnitId':_0x1bb164,'text':JSON['parse'](_0x255a87[_0x455e8c(0x1f3)]),'parentId':_0x43ee0f}),_0x50a8ad=_0x53143c(_0x4c87fa['replies'][0x0]);return{..._0x50a8ad,'children':_0x4c87fa[_0x455e8c(0x19f)][_0x455e8c(0x1d7)](0x1)['map'](_0x536bd0=>_0x53143c(_0x536bd0,_0x50a8ad['id']))};}return null;}let _0x335a5d=class{constructor(_0x19fca8,_0x5b394a,_0x1a1c21,_0xec7ace){const _0x5403cb=_0x484063;this[_0x5403cb(0x1cd)]=_0x19fca8,this[_0x5403cb(0x1f6)]=_0x5b394a,this[_0x5403cb(0x1da)]=_0x1a1c21,this['_injector']=_0xec7ace;}async['addComment'](_0x1e69ea){const _0x18ff7e=_0x484063;var _0x54122b,_0x200a86;const {parentId:_0x5f4ee4,unitId:_0xed720c,text:_0x2bf2eb,threadId:_0x2ebe4d}=_0x1e69ea,_0x53d79d=(_0x200a86=(_0x54122b=_0x2bf2eb[_0x18ff7e(0x184)])==null?void 0x0:_0x54122b[_0x18ff7e(0x200)](_0x169f20=>_0x169f20[_0x18ff7e(0x1a2)]===_0x34b4ef[_0x18ff7e(0x1df)][_0x18ff7e(0x1ee)])['map'](_0x48f923=>_0x48f923[_0x18ff7e(0x18d)]))!=null?_0x200a86:[],_0x5c042b=JSON[_0x18ff7e(0x1eb)](_0x2bf2eb),_0x1c3874=(await this[_0x18ff7e(0x1da)][_0x18ff7e(0x1e7)](_0xed720c))[_0x18ff7e(0x18a)]();if(_0x5f4ee4){const _0x3b3524={'memberId':_0x1c3874,'unitId':_0xed720c,'content':_0x5c042b,'mention':_0x53d79d,'threadId':_0x2ebe4d},_0x52864d=(await this['_httpService'][_0x18ff7e(0x1b6)](_0x18ff7e(0x1e6)+_0xed720c+'/reply',{'body':_0x3b3524}))[_0x18ff7e(0x1b5)][_0x18ff7e(0x1ef)];return{..._0x1e69ea,'id':_0x52864d['replyId'],'dT':_0x34b4ef[_0x18ff7e(0x1c9)](+_0x52864d[_0x18ff7e(0x181)])[_0x18ff7e(0x1a9)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x52864d[_0x18ff7e(0x192)]};}else{const _0x5100fa={'memberId':_0x1c3874,'unitId':_0xed720c,'content':_0x5c042b,'mention':_0x53d79d},_0x36b3ff=await this[_0x18ff7e(0x1cd)][_0x18ff7e(0x1b6)](_0x18ff7e(0x1e6)+_0xed720c+'/add',{'body':_0x5100fa});return _0x9cd3d5(_0x36b3ff[_0x18ff7e(0x1b5)][_0x18ff7e(0x1c4)],_0x1e69ea);}}async[_0x484063(0x1d8)](_0x14c4bd){const _0x26d2c8=_0x484063;var _0x52e7ea,_0xb6f8e5;const {text:_0x24e1cf,unitId:_0x305c20}=_0x14c4bd,_0x3d0bbe=(_0xb6f8e5=(_0x52e7ea=_0x24e1cf[_0x26d2c8(0x184)])==null?void 0x0:_0x52e7ea[_0x26d2c8(0x200)](_0xa5a394=>_0xa5a394['rangeType']===_0x34b4ef[_0x26d2c8(0x1df)][_0x26d2c8(0x1ee)])[_0x26d2c8(0x1a6)](_0x3b1183=>_0x3b1183[_0x26d2c8(0x18d)]))!=null?_0xb6f8e5:[],_0x3453ff=JSON[_0x26d2c8(0x1eb)](_0x24e1cf),_0x19a3de=_0x14c4bd[_0x26d2c8(0x1ed)],_0x4ebf63=_0x14c4bd['id'],_0x11fba4={'memberId':(await this[_0x26d2c8(0x1da)][_0x26d2c8(0x1e7)](_0x305c20))[_0x26d2c8(0x18a)](),'unitId':_0x305c20,'threadId':_0x19a3de,'mention':_0x3d0bbe,'content':_0x3453ff,'replyId':_0x4ebf63},_0xd4fc09=await this[_0x26d2c8(0x1cd)]['post'](_0x26d2c8(0x1e6)+_0x305c20+_0x26d2c8(0x19b),{'body':_0x11fba4});return!_0xd4fc09[_0x26d2c8(0x1b5)][_0x26d2c8(0x19d)]||_0xd4fc09[_0x26d2c8(0x1b5)][_0x26d2c8(0x19d)]['code']===0x1;}async[_0x484063(0x1b8)](_0x16b7a3){const _0x53edf6=_0x484063,{unitId:_0x2259bb}=_0x16b7a3,_0x2e80c9=_0x16b7a3[_0x53edf6(0x1ed)],_0x35fc4e={'memberId':this['_userService'][_0x53edf6(0x1c3)]()[_0x53edf6(0x1dc)],'unitId':_0x2259bb,'threadId':_0x2e80c9,'solved':_0x16b7a3[_0x53edf6(0x1de)]?_0x4c4f19[_0x53edf6(0x1d3)]:_0x4c4f19[_0x53edf6(0x1a7)]},_0x452131=await this[_0x53edf6(0x1cd)]['post']('/universer-api/comment/unit/'+_0x2259bb+_0x53edf6(0x1ba),{'body':_0x35fc4e});return!_0x452131[_0x53edf6(0x1b5)][_0x53edf6(0x19d)]||_0x452131[_0x53edf6(0x1b5)][_0x53edf6(0x19d)][_0x53edf6(0x1f5)]===0x1;}async['deleteComment'](_0x4ef713,_0x5a3777,_0x1a3672,_0x5db3d6){const _0x154aa6=_0x484063,_0xf0e353={'memberId':(await this[_0x154aa6(0x1da)][_0x154aa6(0x1e7)](_0x4ef713))[_0x154aa6(0x18a)](),'threadId':_0x1a3672,'replyId':_0x5db3d6,'unitId':_0x4ef713},_0x464e54=await this['_httpService'][_0x154aa6(0x1b6)](_0x154aa6(0x1e6)+_0x4ef713+_0x154aa6(0x1d0),{'body':_0xf0e353});return!_0x464e54['body']['error']||_0x464e54[_0x154aa6(0x1b5)][_0x154aa6(0x19d)][_0x154aa6(0x1f5)]===0x1;}async[_0x484063(0x1c0)](_0x2ac79d,_0x216714,_0x134451){const _0x1b122e=_0x484063,_0x471fb1={'unitId':_0x2ac79d,'threadId':_0x134451},_0x1afbf7=await this[_0x1b122e(0x1cd)][_0x1b122e(0x1b6)](_0x1b122e(0x1e6)+_0x2ac79d+_0x1b122e(0x1af),{'body':_0x471fb1}),_0x5cb3d3=_0x134451[_0x1b122e(0x1a6)](_0x46b6ba=>_0x5ea313(_0x1afbf7[_0x1b122e(0x1b5)][_0x1b122e(0x197)][_0x46b6ba],_0x2ac79d,_0x216714))[_0x1b122e(0x200)](Boolean);return Object['values'](_0x1afbf7[_0x1b122e(0x1b5)][_0x1b122e(0x1f1)])[_0x1b122e(0x18f)](_0x1b4e30=>{const _0x221933=_0x1b122e;this['_userService'][_0x221933(0x17f)](_0x1b4e30);}),_0x5cb3d3;}[_0x484063(0x1f7)](_0x20f106){return{'id':_0x20f106['id'],'threadId':_0x20f106['threadId'],'ref':_0x20f106['ref']};}};_0x335a5d=_0x5e2b04([_0x27daaf(0x0,_0x34b4ef[_0x484063(0x1f2)](_0x422bd1[_0x484063(0x1fb)])),_0x27daaf(0x1,_0x34b4ef[_0x484063(0x1f2)](_0x34b4ef[_0x484063(0x17c)])),_0x27daaf(0x2,_0x34b4ef['Inject'](_0x1bf240[_0x484063(0x1bd)])),_0x27daaf(0x3,_0x34b4ef[_0x484063(0x1f2)](_0x34b4ef[_0x484063(0x1e9)]))],_0x335a5d);var _0x1b68b7=Object[_0x484063(0x193)],_0x205289=(_0x361fac,_0x36b883,_0x1087c8,_0x474f73)=>{const _0xf6e30a=_0x484063;for(var _0x3beea2=_0x474f73>0x1?void 0x0:_0x474f73?_0x1b68b7(_0x36b883,_0x1087c8):_0x36b883,_0xfc7df8=_0x361fac[_0xf6e30a(0x189)]-0x1,_0x4810fe;_0xfc7df8>=0x0;_0xfc7df8--)(_0x4810fe=_0x361fac[_0xfc7df8])&&(_0x3beea2=_0x4810fe(_0x3beea2)||_0x3beea2);return _0x3beea2;},_0x3f38a6=(_0x3c5971,_0x25ed71)=>(_0x1dbe61,_0x1b5c32)=>_0x25ed71(_0x1dbe61,_0x1b5c32,_0x3c5971);let _0x4fcbcf=class extends _0x34b4ef[_0x484063(0x1d2)]{constructor(_0x2bae56,_0x7dc1ce){const _0x4a2acf=_0x484063;super(),this['_threadCommentDataSourceService']=_0x2bae56,this[_0x4a2acf(0x1e0)]=_0x7dc1ce,this[_0x4a2acf(0x1d5)]();}[_0x484063(0x1d5)](){const _0x23eabd=_0x484063;this[_0x23eabd(0x1ad)][_0x23eabd(0x199)]=this['_threadCommentDataSource'],this[_0x23eabd(0x1ad)][_0x23eabd(0x1e5)]=!0x1;}};_0x4fcbcf=_0x205289([_0x3f38a6(0x0,_0x2920d2[_0x484063(0x1b2)]),_0x3f38a6(0x1,_0x34b4ef['Inject'](_0x335a5d))],_0x4fcbcf);var _0x481b92=Object[_0x484063(0x1cc)],_0x8198b4=Object[_0x484063(0x193)],_0x11d010=(_0x107fcc,_0x23ad9c,_0xd32992)=>_0x23ad9c in _0x107fcc?_0x481b92(_0x107fcc,_0x23ad9c,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0xd32992}):_0x107fcc[_0x23ad9c]=_0xd32992,_0x5ae950=(_0x3d6166,_0x5a217f,_0x5d8420,_0x51e913)=>{const _0x427bee=_0x484063;for(var _0x2647ca=_0x51e913>0x1?void 0x0:_0x51e913?_0x8198b4(_0x5a217f,_0x5d8420):_0x5a217f,_0x3246b3=_0x3d6166[_0x427bee(0x189)]-0x1,_0x447571;_0x3246b3>=0x0;_0x3246b3--)(_0x447571=_0x3d6166[_0x3246b3])&&(_0x2647ca=_0x447571(_0x2647ca)||_0x2647ca);return _0x2647ca;},_0x1654b8=(_0x36d800,_0xed8a69)=>(_0x51aa90,_0x20ec7a)=>_0xed8a69(_0x51aa90,_0x20ec7a,_0x36d800),_0x481fe2=(_0x146507,_0x153b2f,_0xc93d25)=>_0x11d010(_0x146507,typeof _0x153b2f!='symbol'?_0x153b2f+'':_0x153b2f,_0xc93d25);_0x3fdf36[_0x484063(0x17e)]=class extends _0x34b4ef[_0x484063(0x1ea)]{constructor(_0x2604d8=_0x1286f6,_0x343d21,_0x66e901){const _0x526890=_0x484063;super(),this[_0x526890(0x185)]=_0x2604d8,this[_0x526890(0x18c)]=_0x343d21,this[_0x526890(0x1c2)]=_0x66e901;const {..._0x46caad}=_0x34b4ef[_0x526890(0x1ce)]({},_0x1286f6,this[_0x526890(0x185)]);this[_0x526890(0x1c2)][_0x526890(0x1be)](_0xbc477f,_0x46caad);}[_0x484063(0x198)](){const _0x38d491=_0x484063;[[_0x335a5d],[_0x4fcbcf],[_0x4fffe9]][_0x38d491(0x18f)](_0x1b1235=>{const _0x5c133c=_0x38d491;this[_0x5c133c(0x18c)][_0x5c133c(0x1a0)](_0x1b1235);});}['onReady'](){const _0x2d0175=_0x484063;this[_0x2d0175(0x18c)][_0x2d0175(0x1b0)](_0x4fcbcf),this[_0x2d0175(0x18c)]['get'](_0x4fffe9);}},_0x481fe2(_0x3fdf36[_0x484063(0x17e)],_0x484063(0x1c8),_0x163e9e),_0x481fe2(_0x3fdf36[_0x484063(0x17e)],_0x484063(0x1ec),_0x34b4ef[_0x484063(0x17b)][_0x484063(0x1e8)]),_0x3fdf36[_0x484063(0x17e)]=_0x5ae950([_0x34b4ef['DependentOn'](_0x54799e['UniverThreadCommentUIPlugin'],_0x1bf240[_0x484063(0x187)],_0x10c06b['UniverLicensePlugin']),_0x1654b8(0x1,_0x34b4ef['Inject'](_0x34b4ef[_0x484063(0x1e9)])),_0x1654b8(0x2,_0x34b4ef['IConfigService'])],_0x3fdf36[_0x484063(0x17e)]),Object[_0x484063(0x1cc)](_0x3fdf36,Symbol[_0x484063(0x1fd)],{'value':_0x484063(0x1bf)});}));
|
|
1
|
+
function _0x25e2(){const _0x400efd=['getUser','UniverLicensePlugin','bufferTime','11hjSEiI','deleteComment','comment','updateComment','Plugin','_initUserSync','code','679827hdQNzB','stringify','_initDataSource','getComment','Disposable','pipe','2019564qQnUvc','unitId','get','defineProperty','UserManagerService','UniverCore','Module','type','_threadCommentDataSourceService','403725ZiOrWy','error','merge','user','threadId','toStringTag','6326RnoPYy','COMMENT','@univerjs/network','content','subscribe','Delete','UniverNetwork','CollaborationSessionService','HTTPService','_httpService','/list','_commentService','/solved','@univerjs/thread-comment','_threadCommentDataSource','UniverThreadComment','@univerjs/thread-comment-ui','Inject','find','users','/delete','personId','109mbFjuY','comments','requireSession','disposeWithMe','ref','format','ThreadCommentModel','map','10FggShh','filter','_threadCommentModel','3553370qKQfQG','UniverInstanceType','createTimestamp','getCurrentUser','reply','/universer-api/comment/unit/','rxjs','getOwnPropertyDescriptor','addUser','Solve','/add','CustomRangeType','amd','Injector','CommentService','payload','UNRECOGNIZED','post','@univerjs-pro/collaboration-client','UniverProLicense','commentUpdate$','syncUpdateMutationToColla','values','dayjs','_injector','Edit','replyId','getMemberID','Add','OpenOrReOpen','forEach','body','IThreadCommentDataSourceService','DependentOn','_userService','pluginName','UniverThreadCommentDataSourcePlugin','userId','YYYY/MM/DD\x20HH:mm','@univerjs-pro/license','/edit','Reply','_sessionService','thread-comment-data-source.config','delete','onStarting','8GNsIlt','parentId','_init','add','_config','symbol','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','@univerjs/core','function','replies','Solved','getUnit','_configService','resolveComment','parse','rangeId','slice','/reply','root','rangeType','Unknown','/universer-api/user/list','67365QWaNgH','471532HZivfh','length','resolved'];_0x25e2=function(){return _0x400efd;};return _0x25e2();}function _0x969c(_0x404604,_0x3f14ea){const _0x25e246=_0x25e2();return _0x969c=function(_0x969c03,_0x29910e){_0x969c03=_0x969c03-0xc5;let _0x12c40f=_0x25e246[_0x969c03];return _0x12c40f;},_0x969c(_0x404604,_0x3f14ea);}(function(_0x5587d8,_0x126045){const _0xb1b5d=_0x969c,_0xf1c6b1=_0x5587d8();while(!![]){try{const _0x2beb92=parseInt(_0xb1b5d(0x119))/0x1*(-parseInt(_0xb1b5d(0x103))/0x2)+parseInt(_0xb1b5d(0xee))/0x3+-parseInt(_0xb1b5d(0xe1))/0x4*(-parseInt(_0xb1b5d(0x121))/0x5)+-parseInt(_0xb1b5d(0xf4))/0x6+parseInt(_0xb1b5d(0xfd))/0x7+parseInt(_0xb1b5d(0xca))/0x8*(-parseInt(_0xb1b5d(0xe0))/0x9)+-parseInt(_0xb1b5d(0x124))/0xa*(-parseInt(_0xb1b5d(0xe7))/0xb);if(_0x2beb92===_0x126045)break;else _0xf1c6b1['push'](_0xf1c6b1['shift']());}catch(_0x30dca1){_0xf1c6b1['push'](_0xf1c6b1['shift']());}}}(_0x25e2,0x2d8ad),function(_0x565a39,_0x1c8ead){const _0x5dee63=_0x969c;typeof exports=='object'&&typeof module<'u'?_0x1c8ead(exports,require(_0x5dee63(0x136)),require(_0x5dee63(0x14b)),require(_0x5dee63(0xd1)),require(_0x5dee63(0x113)),require('@univerjs/thread-comment'),require('rxjs'),require(_0x5dee63(0x105))):typeof define==_0x5dee63(0xd2)&&define[_0x5dee63(0x130)]?define(['exports','@univerjs-pro/collaboration-client',_0x5dee63(0x14b),_0x5dee63(0xd1),_0x5dee63(0x113),_0x5dee63(0x110),_0x5dee63(0x12a),_0x5dee63(0x105)],_0x1c8ead):(_0x565a39=typeof globalThis<'u'?globalThis:_0x565a39||self,_0x1c8ead(_0x565a39['UniverProThreadCommentDatasource']={},_0x565a39['UniverProCollaborationClient'],_0x565a39[_0x5dee63(0x137)],_0x565a39[_0x5dee63(0xf9)],_0x565a39['UniverThreadCommentUi'],_0x565a39[_0x5dee63(0x112)],_0x565a39[_0x5dee63(0x12a)],_0x565a39[_0x5dee63(0x109)]));}(this,function(_0x49da9b,_0x2a6dbd,_0x1f1fb0,_0x1a662a,_0x2eb002,_0x215241,_0x5d3423,_0xf2698a){'use strict';const _0x5ae394=_0x969c;const _0x18e20e=_0x5ae394(0xd0);var _0x48e270=(_0x46cbfd=>(_0x46cbfd[_0x46cbfd[_0x5ae394(0x141)]=0x0]=_0x5ae394(0x141),_0x46cbfd[_0x46cbfd[_0x5ae394(0xd4)]=0x1]=_0x5ae394(0xd4),_0x46cbfd[_0x46cbfd[_0x5ae394(0x134)]=-0x1]=_0x5ae394(0x134),_0x46cbfd))(_0x48e270||{}),_0x257be8=(_0x865118=>(_0x865118[_0x865118[_0x5ae394(0xde)]=0x0]='Unknown',_0x865118[_0x865118[_0x5ae394(0x140)]=0x1]=_0x5ae394(0x140),_0x865118[_0x865118[_0x5ae394(0xc5)]=0x2]='Reply',_0x865118[_0x865118[_0x5ae394(0x13d)]=0x3]='Edit',_0x865118[_0x865118['Delete']=0x4]=_0x5ae394(0x108),_0x865118[_0x865118['Solve']=0x5]=_0x5ae394(0x12d),_0x865118[_0x865118[_0x5ae394(0x134)]=-0x1]=_0x5ae394(0x134),_0x865118))(_0x257be8||{});const _0x28c8ce=_0x45a0cc=>_0x1a662a['dayjs'](new Date(+_0x45a0cc))['format'](_0x5ae394(0x14a)),_0x37279e=async(_0x17d4e5,_0x3dba83)=>{const _0x3f4a4b=_0x5ae394,_0x17ce07=_0x17d4e5[_0x3f4a4b(0xf6)](_0x1a662a[_0x3f4a4b(0xf8)]),_0x2fa6eb=_0x17d4e5[_0x3f4a4b(0xf6)](_0xf2698a[_0x3f4a4b(0x10b)]);_0x3dba83[_0x3f4a4b(0x142)](_0x4b3e1b=>{const _0x571dbc=_0x3f4a4b;_0x17ce07[_0x571dbc(0xe4)](_0x4b3e1b)&&_0x3dba83[_0x571dbc(0xc8)](_0x4b3e1b);}),_0x3dba83['size']&&(await _0x2fa6eb[_0x3f4a4b(0xf6)](_0x3f4a4b(0xdf),{'params':{'userIDs':[..._0x3dba83]}}))[_0x3f4a4b(0x143)][_0x3f4a4b(0x116)][_0x3f4a4b(0x142)](_0x8af7f6=>{_0x8af7f6&&_0x17ce07['addUser'](_0x8af7f6);});};var _0x160436=Object[_0x5ae394(0x12b)],_0x4da777=(_0x4c5e60,_0x534dba,_0x2c6364,_0x4da5c2)=>{const _0xe0b272=_0x5ae394;for(var _0x511ebb=_0x4da5c2>0x1?void 0x0:_0x4da5c2?_0x160436(_0x534dba,_0x2c6364):_0x534dba,_0x7b0fb=_0x4c5e60[_0xe0b272(0xe2)]-0x1,_0x399760;_0x7b0fb>=0x0;_0x7b0fb--)(_0x399760=_0x4c5e60[_0x7b0fb])&&(_0x511ebb=_0x399760(_0x511ebb)||_0x511ebb);return _0x511ebb;},_0x5b11ab=(_0x26e9d4,_0x4c0110)=>(_0x3e9f1b,_0x3f414c)=>_0x4c0110(_0x3e9f1b,_0x3f414c,_0x26e9d4);let _0x4a7b5c=class extends _0x1a662a[_0x5ae394(0xf2)]{constructor(_0x29e9fd,_0x38837a,_0x2a3dd6,_0x35ddda){const _0x2af568=_0x5ae394;super(),this[_0x2af568(0x10e)]=_0x29e9fd,this[_0x2af568(0x123)]=_0x38837a,this[_0x2af568(0x146)]=_0x2a3dd6,this[_0x2af568(0x13c)]=_0x35ddda,this['_init'](),this[_0x2af568(0xec)]();}[_0x5ae394(0xec)](){const _0x5116d8=_0x5ae394;this[_0x5116d8(0x11c)](this[_0x5116d8(0x123)]['commentUpdate$'][_0x5116d8(0xf3)](_0x5d3423[_0x5116d8(0xe6)](0x10))[_0x5116d8(0x107)](_0xe3123c=>{const _0x306f8a=_0x5116d8,_0x4d1482=new Set();_0xe3123c[_0x306f8a(0x142)](_0x51736e=>{const _0x33a4cf=_0x306f8a;switch(_0x51736e['type']){case _0x33a4cf(0xcd):{const _0x144ae3=_0x51736e[_0x33a4cf(0x133)][_0x33a4cf(0x118)];_0x4d1482['add'](_0x144ae3);break;}}}),_0x37279e(this[_0x306f8a(0x13c)],_0x4d1482);}));}[_0x5ae394(0xcc)](){const _0x47bd08=_0x5ae394;this['disposeWithMe'](this[_0x47bd08(0x10e)][_0x47bd08(0x138)][_0x47bd08(0x107)](async _0x3f5ba2=>{const _0xcbda7d=_0x47bd08;var _0x5c73b3,_0x375920,_0xefb171,_0x45834a;const _0xb82980=(_0x5c73b3=this[_0xcbda7d(0x123)]['getUnit'](_0x3f5ba2[_0xcbda7d(0xf5)])[_0xcbda7d(0x115)](_0x1100ba=>_0x1100ba[_0xcbda7d(0x101)]===_0x3f5ba2[_0xcbda7d(0x101)]))==null?void 0x0:_0x5c73b3['root'];if(!_0xb82980)return;const {unitId:_0x137b1a,subUnitId:_0x48ce0d}=_0xb82980;switch(_0x3f5ba2['user']&&this[_0xcbda7d(0x146)][_0xcbda7d(0x12c)](_0x3f5ba2[_0xcbda7d(0x100)]),_0x3f5ba2[_0xcbda7d(0xfb)]){case _0x257be8[_0xcbda7d(0x140)]:break;case _0x257be8['Reply']:{this[_0xcbda7d(0x123)]['addComment'](_0x137b1a,_0x48ce0d,{'unitId':_0x137b1a,'subUnitId':_0x48ce0d,'ref':'','id':_0x3f5ba2[_0xcbda7d(0x13e)],'dT':_0x28c8ce(+_0x3f5ba2[_0xcbda7d(0x126)]),'threadId':_0x3f5ba2[_0xcbda7d(0x101)],'personId':(_0xefb171=(_0x375920=_0x3f5ba2['user'])==null?void 0x0:_0x375920['userID'])!=null?_0xefb171:_0x3f5ba2['userId'],'text':JSON[_0xcbda7d(0xd8)](_0x3f5ba2[_0xcbda7d(0x106)]),'parentId':_0xb82980['id']});break;}case _0x257be8[_0xcbda7d(0x108)]:{const _0x1e508f=this[_0xcbda7d(0x123)][_0xcbda7d(0xf1)](_0x137b1a,_0x48ce0d,_0x3f5ba2[_0xcbda7d(0x13e)]);_0x1e508f&&_0x1e508f[_0xcbda7d(0xcb)]&&this['_threadCommentModel'][_0xcbda7d(0xe8)](_0x137b1a,_0x48ce0d,_0x3f5ba2[_0xcbda7d(0x13e)]);break;}case _0x257be8['Edit']:{this[_0xcbda7d(0x123)][_0xcbda7d(0xea)](_0x137b1a,_0x48ce0d,{'commentId':_0x3f5ba2['replyId'],'text':JSON[_0xcbda7d(0xd8)](_0x3f5ba2['content'])});break;}case _0x257be8[_0xcbda7d(0x12d)]:{const _0x45d6e5=(_0x45834a=this[_0xcbda7d(0x123)][_0xcbda7d(0xd5)](_0x3f5ba2[_0xcbda7d(0xf5)])['find'](_0x2c0132=>_0x2c0132[_0xcbda7d(0x101)]===_0x3f5ba2['threadId']))==null?void 0x0:_0x45834a[_0xcbda7d(0xdc)];_0x45d6e5&&this['_threadCommentModel'][_0xcbda7d(0xd7)](_0x137b1a,_0x48ce0d,_0x45d6e5['id'],_0x3f5ba2['solved']===_0x48e270[_0xcbda7d(0xd4)]);break;}}}));}};_0x4a7b5c=_0x4da777([_0x5b11ab(0x0,_0x1a662a['Inject'](_0x2a6dbd[_0x5ae394(0x132)])),_0x5b11ab(0x1,_0x1a662a['Inject'](_0x215241[_0x5ae394(0x11f)])),_0x5b11ab(0x2,_0x1a662a[_0x5ae394(0x114)](_0x1a662a[_0x5ae394(0xf8)])),_0x5b11ab(0x3,_0x1a662a[_0x5ae394(0x114)](_0x1a662a[_0x5ae394(0x131)]))],_0x4a7b5c);const _0x33ba36=_0x5ae394(0xc7),_0x4c230b={};var _0x4116cf=Object[_0x5ae394(0x12b)],_0x58ee3b=(_0x5e4f34,_0x68c9f1,_0x24c8c5,_0x2d9f12)=>{const _0x4c9b92=_0x5ae394;for(var _0x829725=_0x2d9f12>0x1?void 0x0:_0x2d9f12?_0x4116cf(_0x68c9f1,_0x24c8c5):_0x68c9f1,_0x19cc87=_0x5e4f34[_0x4c9b92(0xe2)]-0x1,_0x4ded57;_0x19cc87>=0x0;_0x19cc87--)(_0x4ded57=_0x5e4f34[_0x19cc87])&&(_0x829725=_0x4ded57(_0x829725)||_0x829725);return _0x829725;},_0x3998b0=(_0x2ac37f,_0xb98011)=>(_0xc91ab6,_0x36e7f6)=>_0xb98011(_0xc91ab6,_0x36e7f6,_0x2ac37f);function _0x1cc6a7(_0xfa3561,_0xf37067){const _0x325eea=_0x5ae394,_0x39fe5f=_0xfa3561[_0x325eea(0xd3)][0x0];return{..._0xf37067,'id':_0x39fe5f[_0x325eea(0x13e)],'resolved':_0xfa3561['solved']===0x1,'dT':_0x28c8ce(_0x39fe5f[_0x325eea(0x126)]),'personId':_0x39fe5f[_0x325eea(0x149)],'threadId':_0x39fe5f[_0x325eea(0x101)]};}function _0x43e166(_0x45ca93,_0x580398,_0x182af3){const _0x22bcf6=_0x5ae394;var _0x4aec7e,_0x447bbe;if(((_0x447bbe=(_0x4aec7e=_0x45ca93==null?void 0x0:_0x45ca93[_0x22bcf6(0xd3)])==null?void 0x0:_0x4aec7e['length'])!=null?_0x447bbe:0x0)>0x0){const _0x5879bc=(_0x142d07,_0x30dea6)=>({'id':_0x142d07[_0x22bcf6(0x13e)],'threadId':_0x142d07[_0x22bcf6(0x101)],'dT':_0x28c8ce(_0x142d07[_0x22bcf6(0x126)]),'personId':_0x142d07[_0x22bcf6(0x149)],'resolved':_0x45ca93['solved']===_0x48e270[_0x22bcf6(0xd4)],'unitId':_0x580398,'subUnitId':_0x182af3,'text':JSON[_0x22bcf6(0xd8)](_0x142d07[_0x22bcf6(0x106)]),'parentId':_0x30dea6}),_0x43bc9b=_0x5879bc(_0x45ca93[_0x22bcf6(0xd3)][0x0]);return{..._0x43bc9b,'children':_0x45ca93[_0x22bcf6(0xd3)][_0x22bcf6(0xda)](0x1)['map'](_0x2bfd2c=>_0x5879bc(_0x2bfd2c,_0x43bc9b['id']))};}return null;}let _0x9f5aa3=class{constructor(_0x51a7b5,_0x39fb9f,_0x1ab626,_0x12953f){const _0x14fef7=_0x5ae394;this[_0x14fef7(0x10c)]=_0x51a7b5,this[_0x14fef7(0x146)]=_0x39fb9f,this[_0x14fef7(0xc6)]=_0x1ab626,this['_injector']=_0x12953f;}async['addComment'](_0x30ab8c){const _0x48998e=_0x5ae394;var _0x443310,_0x3edfa7;const {parentId:_0x52988e,unitId:_0xca6e7e,text:_0x2453ed,threadId:_0x47eec6}=_0x30ab8c,_0x1c1a43=(_0x3edfa7=(_0x443310=_0x2453ed['customRanges'])==null?void 0x0:_0x443310[_0x48998e(0x122)](_0x154a42=>_0x154a42[_0x48998e(0xdd)]===_0x1a662a[_0x48998e(0x12f)][_0x48998e(0x104)])[_0x48998e(0x120)](_0x18ddff=>_0x18ddff[_0x48998e(0xd9)]))!=null?_0x3edfa7:[],_0x4e69ec=JSON[_0x48998e(0xef)](_0x2453ed),_0xab0c67=(await this[_0x48998e(0xc6)][_0x48998e(0x11b)](_0xca6e7e))[_0x48998e(0x13f)]();if(_0x52988e){const _0x219244={'memberId':_0xab0c67,'unitId':_0xca6e7e,'content':_0x4e69ec,'mention':_0x1c1a43,'threadId':_0x47eec6},_0x1f0611=(await this[_0x48998e(0x10c)][_0x48998e(0x135)]('/universer-api/comment/unit/'+_0xca6e7e+_0x48998e(0xdb),{'body':_0x219244}))[_0x48998e(0x143)][_0x48998e(0x128)];return{..._0x30ab8c,'id':_0x1f0611[_0x48998e(0x13e)],'dT':_0x1a662a[_0x48998e(0x13b)](+_0x1f0611['createTimestamp'])[_0x48998e(0x11e)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x1f0611['userId']};}else{const _0x7daf2d={'memberId':_0xab0c67,'unitId':_0xca6e7e,'content':_0x4e69ec,'mention':_0x1c1a43},_0x3e8dab=await this[_0x48998e(0x10c)][_0x48998e(0x135)](_0x48998e(0x129)+_0xca6e7e+_0x48998e(0x12e),{'body':_0x7daf2d});return _0x1cc6a7(_0x3e8dab[_0x48998e(0x143)][_0x48998e(0xe9)],_0x30ab8c);}}async['updateComment'](_0x1bfce7){const _0xd4bc42=_0x5ae394;var _0x39ba72,_0x1963cf;const {text:_0x19fcef,unitId:_0x10a659}=_0x1bfce7,_0x516816=(_0x1963cf=(_0x39ba72=_0x19fcef['customRanges'])==null?void 0x0:_0x39ba72[_0xd4bc42(0x122)](_0x11a098=>_0x11a098[_0xd4bc42(0xdd)]===_0x1a662a[_0xd4bc42(0x12f)][_0xd4bc42(0x104)])[_0xd4bc42(0x120)](_0x55c45d=>_0x55c45d[_0xd4bc42(0xd9)]))!=null?_0x1963cf:[],_0x5ad9bb=JSON['stringify'](_0x19fcef),_0x38dbf8=_0x1bfce7['threadId'],_0x427cc2=_0x1bfce7['id'],_0x19f67f={'memberId':(await this['_sessionService'][_0xd4bc42(0x11b)](_0x10a659))['getMemberID'](),'unitId':_0x10a659,'threadId':_0x38dbf8,'mention':_0x516816,'content':_0x5ad9bb,'replyId':_0x427cc2},_0x190dc0=await this[_0xd4bc42(0x10c)][_0xd4bc42(0x135)](_0xd4bc42(0x129)+_0x10a659+_0xd4bc42(0x14c),{'body':_0x19f67f});return!_0x190dc0['body']['error']||_0x190dc0['body'][_0xd4bc42(0xfe)][_0xd4bc42(0xed)]===0x1;}async[_0x5ae394(0xd7)](_0x126c9e){const _0x2dc894=_0x5ae394,{unitId:_0x576829}=_0x126c9e,_0x328ca7=_0x126c9e[_0x2dc894(0x101)],_0x116442={'memberId':this[_0x2dc894(0x146)][_0x2dc894(0x127)]()['userID'],'unitId':_0x576829,'threadId':_0x328ca7,'solved':_0x126c9e[_0x2dc894(0xe3)]?_0x48e270['Solved']:_0x48e270[_0x2dc894(0x141)]},_0x4fbe09=await this['_httpService']['post'](_0x2dc894(0x129)+_0x576829+_0x2dc894(0x10f),{'body':_0x116442});return!_0x4fbe09[_0x2dc894(0x143)][_0x2dc894(0xfe)]||_0x4fbe09['body']['error'][_0x2dc894(0xed)]===0x1;}async[_0x5ae394(0xe8)](_0x42be1a,_0x19f0c7,_0x26c36b,_0x303287){const _0x4540c5=_0x5ae394,_0x2ce214={'memberId':(await this['_sessionService'][_0x4540c5(0x11b)](_0x42be1a))[_0x4540c5(0x13f)](),'threadId':_0x26c36b,'replyId':_0x303287,'unitId':_0x42be1a},_0x226697=await this[_0x4540c5(0x10c)][_0x4540c5(0x135)](_0x4540c5(0x129)+_0x42be1a+_0x4540c5(0x117),{'body':_0x2ce214});return!_0x226697['body']['error']||_0x226697[_0x4540c5(0x143)][_0x4540c5(0xfe)][_0x4540c5(0xed)]===0x1;}async['listComments'](_0x40f94a,_0x406dfe,_0x48f4af){const _0x431d78=_0x5ae394,_0x437174={'unitId':_0x40f94a,'threadId':_0x48f4af},_0x4f2114=await this[_0x431d78(0x10c)]['post'](_0x431d78(0x129)+_0x40f94a+_0x431d78(0x10d),{'body':_0x437174}),_0x27bbd3=_0x48f4af['map'](_0xb25f9c=>_0x43e166(_0x4f2114[_0x431d78(0x143)][_0x431d78(0x11a)][_0xb25f9c],_0x40f94a,_0x406dfe))[_0x431d78(0x122)](Boolean);return Object[_0x431d78(0x13a)](_0x4f2114['body'][_0x431d78(0x116)])[_0x431d78(0x142)](_0x5a6a28=>{const _0x145173=_0x431d78;this[_0x145173(0x146)][_0x145173(0x12c)](_0x5a6a28);}),_0x27bbd3;}['saveCommentToSnapshot'](_0x5d54ca){const _0x5a886d=_0x5ae394;return{'id':_0x5d54ca['id'],'threadId':_0x5d54ca[_0x5a886d(0x101)],'ref':_0x5d54ca[_0x5a886d(0x11d)]};}};_0x9f5aa3=_0x58ee3b([_0x3998b0(0x0,_0x1a662a[_0x5ae394(0x114)](_0xf2698a[_0x5ae394(0x10b)])),_0x3998b0(0x1,_0x1a662a[_0x5ae394(0x114)](_0x1a662a[_0x5ae394(0xf8)])),_0x3998b0(0x2,_0x1a662a[_0x5ae394(0x114)](_0x2a6dbd[_0x5ae394(0x10a)])),_0x3998b0(0x3,_0x1a662a[_0x5ae394(0x114)](_0x1a662a['Injector']))],_0x9f5aa3);var _0x2d6343=Object[_0x5ae394(0x12b)],_0x5713cb=(_0x20ba95,_0x243504,_0x5babb4,_0x3fd450)=>{const _0xbffcd3=_0x5ae394;for(var _0x31366b=_0x3fd450>0x1?void 0x0:_0x3fd450?_0x2d6343(_0x243504,_0x5babb4):_0x243504,_0x35a987=_0x20ba95[_0xbffcd3(0xe2)]-0x1,_0x230ad0;_0x35a987>=0x0;_0x35a987--)(_0x230ad0=_0x20ba95[_0x35a987])&&(_0x31366b=_0x230ad0(_0x31366b)||_0x31366b);return _0x31366b;},_0x2e9fc9=(_0x554fc0,_0x1fc07e)=>(_0x471049,_0x14f713)=>_0x1fc07e(_0x471049,_0x14f713,_0x554fc0);let _0x49f62c=class extends _0x1a662a[_0x5ae394(0xf2)]{constructor(_0x3cc777,_0x588969){const _0x449808=_0x5ae394;super(),this[_0x449808(0xfc)]=_0x3cc777,this[_0x449808(0x111)]=_0x588969,this[_0x449808(0xf0)]();}[_0x5ae394(0xf0)](){const _0x29fcb4=_0x5ae394;this[_0x29fcb4(0xfc)]['dataSource']=this[_0x29fcb4(0x111)],this['_threadCommentDataSourceService'][_0x29fcb4(0x139)]=!0x1;}};_0x49f62c=_0x5713cb([_0x2e9fc9(0x0,_0x215241[_0x5ae394(0x144)]),_0x2e9fc9(0x1,_0x1a662a[_0x5ae394(0x114)](_0x9f5aa3))],_0x49f62c);var _0x368519=Object[_0x5ae394(0xf7)],_0x1fb961=Object[_0x5ae394(0x12b)],_0xb735d2=(_0x3e1825,_0x3c268e,_0x5e38bb)=>_0x3c268e in _0x3e1825?_0x368519(_0x3e1825,_0x3c268e,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x5e38bb}):_0x3e1825[_0x3c268e]=_0x5e38bb,_0x363879=(_0x5bcd62,_0x5fccc1,_0x2654c0,_0x1b55da)=>{for(var _0x52d67e=_0x1b55da>0x1?void 0x0:_0x1b55da?_0x1fb961(_0x5fccc1,_0x2654c0):_0x5fccc1,_0x216d73=_0x5bcd62['length']-0x1,_0xb0a9dd;_0x216d73>=0x0;_0x216d73--)(_0xb0a9dd=_0x5bcd62[_0x216d73])&&(_0x52d67e=_0xb0a9dd(_0x52d67e)||_0x52d67e);return _0x52d67e;},_0x30038c=(_0x3ef33b,_0x5c4b20)=>(_0x273266,_0xa42293)=>_0x5c4b20(_0x273266,_0xa42293,_0x3ef33b),_0x33718d=(_0x32c9ba,_0x1931f8,_0x4737b8)=>_0xb735d2(_0x32c9ba,typeof _0x1931f8!=_0x5ae394(0xcf)?_0x1931f8+'':_0x1931f8,_0x4737b8);_0x49da9b[_0x5ae394(0x148)]=class extends _0x1a662a[_0x5ae394(0xeb)]{constructor(_0x342e2f=_0x4c230b,_0xecccaa,_0x297dd9){const _0x3c5257=_0x5ae394;super(),this[_0x3c5257(0xce)]=_0x342e2f,this[_0x3c5257(0x13c)]=_0xecccaa,this[_0x3c5257(0xd6)]=_0x297dd9;const {..._0x37ce60}=_0x1a662a[_0x3c5257(0xff)]({},_0x4c230b,this['_config']);this[_0x3c5257(0xd6)]['setConfig'](_0x33ba36,_0x37ce60);}[_0x5ae394(0xc9)](){[[_0x9f5aa3],[_0x49f62c],[_0x4a7b5c]]['forEach'](_0x1775a5=>{const _0x2763b4=_0x969c;this[_0x2763b4(0x13c)]['add'](_0x1775a5);});}['onReady'](){const _0x449a53=_0x5ae394;this[_0x449a53(0x13c)][_0x449a53(0xf6)](_0x49f62c),this[_0x449a53(0x13c)][_0x449a53(0xf6)](_0x4a7b5c);}},_0x33718d(_0x49da9b[_0x5ae394(0x148)],_0x5ae394(0x147),_0x18e20e),_0x33718d(_0x49da9b['UniverThreadCommentDataSourcePlugin'],'type',_0x1a662a[_0x5ae394(0x125)]['UNIVER_UNKNOWN']),_0x49da9b[_0x5ae394(0x148)]=_0x363879([_0x1a662a[_0x5ae394(0x145)](_0x2eb002['UniverThreadCommentUIPlugin'],_0x2a6dbd['UniverCollaborationClientPlugin'],_0x1f1fb0[_0x5ae394(0xe5)]),_0x30038c(0x1,_0x1a662a[_0x5ae394(0x114)](_0x1a662a['Injector'])),_0x30038c(0x2,_0x1a662a['IConfigService'])],_0x49da9b['UniverThreadCommentDataSourcePlugin']),Object[_0x5ae394(0xf7)](_0x49da9b,Symbol[_0x5ae394(0x102)],{'value':_0x5ae394(0xfa)});}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs-pro/thread-comment-datasource",
|
|
3
|
-
"version": "0.8.0-nightly.
|
|
3
|
+
"version": "0.8.0-nightly.202506101607",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -45,13 +45,13 @@
|
|
|
45
45
|
"rxjs": ">=7.0.0"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@univerjs-pro/collaboration-client": "0.8.0-nightly.
|
|
49
|
-
"@univerjs/core": "0.8.0-nightly.
|
|
50
|
-
"@univerjs-pro/license": "0.8.0-nightly.
|
|
51
|
-
"@univerjs/
|
|
52
|
-
"@univerjs/
|
|
53
|
-
"@univerjs/thread-comment": "0.8.0-nightly.
|
|
54
|
-
"@univerjs/
|
|
48
|
+
"@univerjs-pro/collaboration-client": "0.8.0-nightly.202506101607",
|
|
49
|
+
"@univerjs/core": "0.8.0-nightly.202506101607",
|
|
50
|
+
"@univerjs-pro/license": "0.8.0-nightly.202506101607",
|
|
51
|
+
"@univerjs/thread-comment": "0.8.0-nightly.202506101607",
|
|
52
|
+
"@univerjs/network": "0.8.0-nightly.202506101607",
|
|
53
|
+
"@univerjs/thread-comment-ui": "0.8.0-nightly.202506101607",
|
|
54
|
+
"@univerjs/protocol": "0.1.47-alpha.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"rxjs": "7.8.2",
|