@univerjs-pro/thread-comment-datasource 0.8.0-beta.0 → 0.8.0-beta.1
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/umd/index.js +1 -1
- package/package.json +8 -8
package/lib/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const _0x24cd7f=_0x48cf;(function(_0x2e5aa8,_0x3a4b0e){const _0x596b5f=_0x48cf,_0x20b676=_0x2e5aa8();while(!![]){try{const _0x25c708=-parseInt(_0x596b5f(0x10b))/0x1+parseInt(_0x596b5f(0xdc))/0x2+parseInt(_0x596b5f(0xc6))/0x3*(parseInt(_0x596b5f(0x10e))/0x4)+parseInt(_0x596b5f(0xbb))/0x5*(-parseInt(_0x596b5f(0x134))/0x6)+parseInt(_0x596b5f(0x117))/0x7*(parseInt(_0x596b5f(0xf5))/0x8)+parseInt(_0x596b5f(0x122))/0x9+-parseInt(_0x596b5f(0xdd))/0xa*(parseInt(_0x596b5f(0x11f))/0xb);if(_0x25c708===_0x3a4b0e)break;else _0x20b676['push'](_0x20b676['shift']());}catch(_0x3ec97b){_0x20b676['push'](_0x20b676['shift']());}}}(_0xf7c7,0x2c742));Object['defineProperty'](exports,Symbol['toStringTag'],{'value':_0x24cd7f(0xcc)});const b=require('@univerjs-pro/collaboration-client'),T=require(_0x24cd7f(0xeb)),c=require(_0x24cd7f(0xba)),j=require(_0x24cd7f(0xcf)),M=require('@univerjs/thread-comment'),w=require('rxjs'),P=require('@univerjs/network'),U=_0x24cd7f(0x119);var I=(_0x5dfb21=>(_0x5dfb21[_0x5dfb21['OpenOrReOpen']=0x0]=_0x24cd7f(0xf2),_0x5dfb21[_0x5dfb21[_0x24cd7f(0x12d)]=0x1]='Solved',_0x5dfb21[_0x5dfb21['UNRECOGNIZED']=-0x1]=_0x24cd7f(0xdb),_0x5dfb21))(I||{}),v=(_0x379c1d=>(_0x379c1d[_0x379c1d[_0x24cd7f(0xf8)]=0x0]=_0x24cd7f(0xf8),_0x379c1d[_0x379c1d[_0x24cd7f(0xc9)]=0x1]='Add',_0x379c1d[_0x379c1d[_0x24cd7f(0x104)]=0x2]=_0x24cd7f(0x104),_0x379c1d[_0x379c1d[_0x24cd7f(0xff)]=0x3]=_0x24cd7f(0xff),_0x379c1d[_0x379c1d[_0x24cd7f(0x114)]=0x4]=_0x24cd7f(0x114),_0x379c1d[_0x379c1d[_0x24cd7f(0x123)]=0x5]='Solve',_0x379c1d[_0x379c1d[_0x24cd7f(0xdb)]=-0x1]='UNRECOGNIZED',_0x379c1d))(v||{});function _0xf7c7(){const _0x1c5888=['filter','pipe','/reply','content','/universer-api/user/list','Delete','solved','_initDataSource','14917ytkCKI','unitId','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','onReady','bufferTime','_init','_configService','body','88aJXnFZ','error','map','1108296kifsTu','Solve','getUser','UniverLicensePlugin','reply','Plugin','/solved','addComment','type','DependentOn','HTTPService','Solved','comments','disposeWithMe','onStarting','personId','deleteComment','CustomRangeType','110652fxqfgI','defineProperty','size','addUser','threadId','@univerjs/core','85HDwawR','_initUserSync','code','users','payload','forEach','slice','_injector','userID','UniverThreadCommentDataSourcePlugin','Disposable','3UXCjIO','_config','UniverThreadCommentUIPlugin','Add','_threadCommentDataSourceService','dataSource','Module','getMemberID','delete','@univerjs/thread-comment-ui','Injector','_httpService','get','replies','CollaborationSessionService','ThreadCommentModel','COMMENT','/universer-api/comment/unit/','replyId','Inject','commentUpdate$','UNRECOGNIZED','690140RYqVFt','141050RVoQQd','UserManagerService','_userService','_commentService','userId','createTimestamp','rangeId','pluginName','symbol','/list','resolveComment','root','_threadCommentModel','updateComment','@univerjs-pro/license','_sessionService','ref','subscribe','getUnit','post','add','OpenOrReOpen','find','format','552yNkHfi','stringify','getOwnPropertyDescriptor','Unknown','syncUpdateMutationToColla','_threadCommentDataSource','YYYY/MM/DD\x20HH:mm','merge','/add','user','Edit','customRanges','parse','IThreadCommentDataSourceService','length','Reply','parentId','UNIVER_UNKNOWN','comment','listComments','IConfigService','saveCommentToSnapshot','326766gcCKCA','requireSession','thread-comment-data-source.config','1279796jLTXkS'];_0xf7c7=function(){return _0x1c5888;};return _0xf7c7();}const f=_0x2ec48a=>c['dayjs'](new Date(+_0x2ec48a))[_0x24cd7f(0xf4)](_0x24cd7f(0xfb)),R=async(_0x479c9b,_0x151f08)=>{const _0x4d57f5=_0x24cd7f,_0x54c409=_0x479c9b[_0x4d57f5(0xd2)](c[_0x4d57f5(0xde)]),_0x4cefec=_0x479c9b[_0x4d57f5(0xd2)](P[_0x4d57f5(0x12c)]);_0x151f08[_0x4d57f5(0xc0)](_0x38fa52=>{const _0x1fc802=_0x4d57f5;_0x54c409[_0x1fc802(0x124)](_0x38fa52)&&_0x151f08[_0x1fc802(0xce)](_0x38fa52);}),_0x151f08[_0x4d57f5(0xb7)]&&(await _0x4cefec['get'](_0x4d57f5(0x113),{'params':{'userIDs':[..._0x151f08]}}))[_0x4d57f5(0x11e)][_0x4d57f5(0xbe)][_0x4d57f5(0xc0)](_0x41b9ae=>{const _0x3c460e=_0x4d57f5;_0x41b9ae&&_0x54c409[_0x3c460e(0xb8)](_0x41b9ae);});};var $=Object[_0x24cd7f(0xf7)],E=(_0x5c3653,_0x1f4f2e,_0xa3397b,_0x233ac2)=>{const _0x51ffee=_0x24cd7f;for(var _0x26c193=_0x233ac2>0x1?void 0x0:_0x233ac2?$(_0x1f4f2e,_0xa3397b):_0x1f4f2e,_0x47add2=_0x5c3653[_0x51ffee(0x103)]-0x1,_0x3a6785;_0x47add2>=0x0;_0x47add2--)(_0x3a6785=_0x5c3653[_0x47add2])&&(_0x26c193=_0x3a6785(_0x26c193)||_0x26c193);return _0x26c193;},S=(_0x40090a,_0x2efe13)=>(_0xb110b0,_0x2ca2e8)=>_0x2efe13(_0xb110b0,_0x2ca2e8,_0x40090a);let p=class extends c[_0x24cd7f(0xc5)]{constructor(_0x3a2fb9,_0xdacefd,_0xbfa23b,_0x5691da){const _0x5a2990=_0x24cd7f;super(),this[_0x5a2990(0xe0)]=_0x3a2fb9,this[_0x5a2990(0xe9)]=_0xdacefd,this[_0x5a2990(0xdf)]=_0xbfa23b,this[_0x5a2990(0xc2)]=_0x5691da,this[_0x5a2990(0x11c)](),this[_0x5a2990(0xbc)]();}[_0x24cd7f(0xbc)](){const _0x3a74b7=_0x24cd7f;this[_0x3a74b7(0x12f)](this['_threadCommentModel'][_0x3a74b7(0xda)][_0x3a74b7(0x110)](w[_0x3a74b7(0x11b)](0x10))[_0x3a74b7(0xee)](_0x5c26a0=>{const _0x112582=_0x3a74b7,_0x302d5e=new Set();_0x5c26a0[_0x112582(0xc0)](_0x4fa186=>{const _0x5c133f=_0x112582;switch(_0x4fa186[_0x5c133f(0x12a)]){case _0x5c133f(0xf1):{const _0x30b30e=_0x4fa186[_0x5c133f(0xbf)][_0x5c133f(0x131)];_0x302d5e[_0x5c133f(0xf1)](_0x30b30e);break;}}}),R(this[_0x112582(0xc2)],_0x302d5e);}));}[_0x24cd7f(0x11c)](){this['disposeWithMe'](this['_commentService']['commentUpdate$']['subscribe'](async _0x41257a=>{const _0x2552b0=_0x48cf;var _0xb88aa7,_0x208c3b,_0x17bd03,_0x383091;const _0x139182=(_0xb88aa7=this['_threadCommentModel'][_0x2552b0(0xef)](_0x41257a[_0x2552b0(0x118)])[_0x2552b0(0xf3)](_0x3ea0e4=>_0x3ea0e4[_0x2552b0(0xb9)]===_0x41257a[_0x2552b0(0xb9)]))==null?void 0x0:_0xb88aa7[_0x2552b0(0xe8)];if(!_0x139182)return;const {unitId:_0x519515,subUnitId:_0x6b23c}=_0x139182;switch(_0x41257a[_0x2552b0(0xfe)]&&this[_0x2552b0(0xdf)][_0x2552b0(0xb8)](_0x41257a['user']),_0x41257a[_0x2552b0(0x12a)]){case v[_0x2552b0(0xc9)]:break;case v['Reply']:{this[_0x2552b0(0xe9)][_0x2552b0(0x129)](_0x519515,_0x6b23c,{'unitId':_0x519515,'subUnitId':_0x6b23c,'ref':'','id':_0x41257a[_0x2552b0(0xd8)],'dT':f(+_0x41257a['createTimestamp']),'threadId':_0x41257a['threadId'],'personId':(_0x17bd03=(_0x208c3b=_0x41257a[_0x2552b0(0xfe)])==null?void 0x0:_0x208c3b[_0x2552b0(0xc3)])!=null?_0x17bd03:_0x41257a[_0x2552b0(0xe1)],'text':JSON[_0x2552b0(0x101)](_0x41257a[_0x2552b0(0x112)]),'parentId':_0x139182['id']});break;}case v[_0x2552b0(0x114)]:{const _0xae078a=this[_0x2552b0(0xe9)]['getComment'](_0x519515,_0x6b23c,_0x41257a[_0x2552b0(0xd8)]);_0xae078a&&_0xae078a[_0x2552b0(0x105)]&&this['_threadCommentModel']['deleteComment'](_0x519515,_0x6b23c,_0x41257a[_0x2552b0(0xd8)]);break;}case v[_0x2552b0(0xff)]:{this[_0x2552b0(0xe9)][_0x2552b0(0xea)](_0x519515,_0x6b23c,{'commentId':_0x41257a[_0x2552b0(0xd8)],'text':JSON[_0x2552b0(0x101)](_0x41257a[_0x2552b0(0x112)])});break;}case v[_0x2552b0(0x123)]:{const _0x204500=(_0x383091=this[_0x2552b0(0xe9)][_0x2552b0(0xef)](_0x41257a[_0x2552b0(0x118)])[_0x2552b0(0xf3)](_0x3af9fe=>_0x3af9fe['threadId']===_0x41257a['threadId']))==null?void 0x0:_0x383091[_0x2552b0(0xe8)];_0x204500&&this['_threadCommentModel'][_0x2552b0(0xe7)](_0x519515,_0x6b23c,_0x204500['id'],_0x41257a[_0x2552b0(0x115)]===I[_0x2552b0(0x12d)]);break;}}}));}};p=E([S(0x0,c[_0x24cd7f(0xd9)](b['CommentService'])),S(0x1,c[_0x24cd7f(0xd9)](M[_0x24cd7f(0xd5)])),S(0x2,c['Inject'](c[_0x24cd7f(0xde)])),S(0x3,c[_0x24cd7f(0xd9)](c[_0x24cd7f(0xd0)]))],p);const q=_0x24cd7f(0x10d),D={};var A=Object[_0x24cd7f(0xf7)],x=(_0x105fd3,_0x491c3b,_0x13a3c8,_0x5cb772)=>{for(var _0x469438=_0x5cb772>0x1?void 0x0:_0x5cb772?A(_0x491c3b,_0x13a3c8):_0x491c3b,_0x51e1a1=_0x105fd3['length']-0x1,_0x165db2;_0x51e1a1>=0x0;_0x51e1a1--)(_0x165db2=_0x105fd3[_0x51e1a1])&&(_0x469438=_0x165db2(_0x469438)||_0x469438);return _0x469438;},_=(_0x3b6bd8,_0x1ad0d0)=>(_0x46a18d,_0x2a0720)=>_0x1ad0d0(_0x46a18d,_0x2a0720,_0x3b6bd8);function Y(_0x6e2f35,_0x26e03d){const _0x5be93f=_0x24cd7f,_0x5ab89d=_0x6e2f35[_0x5be93f(0xd3)][0x0];return{..._0x26e03d,'id':_0x5ab89d[_0x5be93f(0xd8)],'resolved':_0x6e2f35[_0x5be93f(0x115)]===0x1,'dT':f(_0x5ab89d[_0x5be93f(0xe2)]),'personId':_0x5ab89d[_0x5be93f(0xe1)],'threadId':_0x5ab89d['threadId']};}function _0x48cf(_0x30cc5d,_0x25e750){const _0xf7c7f8=_0xf7c7();return _0x48cf=function(_0x48cf82,_0x3231d1){_0x48cf82=_0x48cf82-0xb7;let _0x1687d3=_0xf7c7f8[_0x48cf82];return _0x1687d3;},_0x48cf(_0x30cc5d,_0x25e750);}function G(_0x168684,_0x520577,_0xf09982){const _0x56e814=_0x24cd7f;var _0x29ad35,_0x29c570;if(((_0x29c570=(_0x29ad35=_0x168684==null?void 0x0:_0x168684[_0x56e814(0xd3)])==null?void 0x0:_0x29ad35['length'])!=null?_0x29c570:0x0)>0x0){const _0x521c68=(_0x4d5cff,_0x11e879)=>({'id':_0x4d5cff[_0x56e814(0xd8)],'threadId':_0x4d5cff['threadId'],'dT':f(_0x4d5cff['createTimestamp']),'personId':_0x4d5cff[_0x56e814(0xe1)],'resolved':_0x168684[_0x56e814(0x115)]===I[_0x56e814(0x12d)],'unitId':_0x520577,'subUnitId':_0xf09982,'text':JSON[_0x56e814(0x101)](_0x4d5cff[_0x56e814(0x112)]),'parentId':_0x11e879}),_0x172d7a=_0x521c68(_0x168684[_0x56e814(0xd3)][0x0]);return{..._0x172d7a,'children':_0x168684[_0x56e814(0xd3)][_0x56e814(0xc1)](0x1)[_0x56e814(0x121)](_0x4b8737=>_0x521c68(_0x4b8737,_0x172d7a['id']))};}return null;}let g=class{constructor(_0x24fa46,_0x10415a,_0x4d68bf,_0x5d80eb){const _0xe25e88=_0x24cd7f;this[_0xe25e88(0xd1)]=_0x24fa46,this[_0xe25e88(0xdf)]=_0x10415a,this[_0xe25e88(0xec)]=_0x4d68bf,this['_injector']=_0x5d80eb;}async[_0x24cd7f(0x129)](_0x3cea79){const _0xdb57c7=_0x24cd7f;var _0x4157ac,_0x440567;const {parentId:_0x17a3c5,unitId:_0x2add0d,text:_0x18baa5,threadId:_0x589b73}=_0x3cea79,_0x2fa42=(_0x440567=(_0x4157ac=_0x18baa5[_0xdb57c7(0x100)])==null?void 0x0:_0x4157ac[_0xdb57c7(0x10f)](_0x134781=>_0x134781['rangeType']===c[_0xdb57c7(0x133)][_0xdb57c7(0xd6)])['map'](_0x4db88d=>_0x4db88d['rangeId']))!=null?_0x440567:[],_0x47cab2=JSON[_0xdb57c7(0xf6)](_0x18baa5),_0x25328b=(await this[_0xdb57c7(0xec)]['requireSession'](_0x2add0d))[_0xdb57c7(0xcd)]();if(_0x17a3c5){const _0x3f10dd={'memberId':_0x25328b,'unitId':_0x2add0d,'content':_0x47cab2,'mention':_0x2fa42,'threadId':_0x589b73},_0x1bd0c5=(await this[_0xdb57c7(0xd1)][_0xdb57c7(0xf0)](_0xdb57c7(0xd7)+_0x2add0d+_0xdb57c7(0x111),{'body':_0x3f10dd}))[_0xdb57c7(0x11e)][_0xdb57c7(0x126)];return{..._0x3cea79,'id':_0x1bd0c5['replyId'],'dT':c['dayjs'](+_0x1bd0c5['createTimestamp'])[_0xdb57c7(0xf4)](_0xdb57c7(0xfb)),'personId':_0x1bd0c5[_0xdb57c7(0xe1)]};}else{const _0x57cdb7={'memberId':_0x25328b,'unitId':_0x2add0d,'content':_0x47cab2,'mention':_0x2fa42},_0x44f028=await this['_httpService'][_0xdb57c7(0xf0)](_0xdb57c7(0xd7)+_0x2add0d+_0xdb57c7(0xfd),{'body':_0x57cdb7});return Y(_0x44f028['body'][_0xdb57c7(0x107)],_0x3cea79);}}async['updateComment'](_0x21b14e){const _0x47213c=_0x24cd7f;var _0x5f051b,_0xe97167;const {text:_0x38cefe,unitId:_0x1cdf49}=_0x21b14e,_0x54608c=(_0xe97167=(_0x5f051b=_0x38cefe[_0x47213c(0x100)])==null?void 0x0:_0x5f051b[_0x47213c(0x10f)](_0x2ce8e1=>_0x2ce8e1['rangeType']===c[_0x47213c(0x133)][_0x47213c(0xd6)])[_0x47213c(0x121)](_0x3606bb=>_0x3606bb[_0x47213c(0xe3)]))!=null?_0xe97167:[],_0x44a8bc=JSON[_0x47213c(0xf6)](_0x38cefe),_0x544622=_0x21b14e[_0x47213c(0xb9)],_0x43d7cc=_0x21b14e['id'],_0x267335={'memberId':(await this['_sessionService'][_0x47213c(0x10c)](_0x1cdf49))[_0x47213c(0xcd)](),'unitId':_0x1cdf49,'threadId':_0x544622,'mention':_0x54608c,'content':_0x44a8bc,'replyId':_0x43d7cc},_0x94106f=await this[_0x47213c(0xd1)][_0x47213c(0xf0)](_0x47213c(0xd7)+_0x1cdf49+'/edit',{'body':_0x267335});return!_0x94106f['body']['error']||_0x94106f[_0x47213c(0x11e)][_0x47213c(0x120)]['code']===0x1;}async['resolveComment'](_0x2ae74c){const _0x33574a=_0x24cd7f,{unitId:_0x405af1}=_0x2ae74c,_0x5bf048=_0x2ae74c['threadId'],_0x5a318a={'memberId':this['_userService']['getCurrentUser']()[_0x33574a(0xc3)],'unitId':_0x405af1,'threadId':_0x5bf048,'solved':_0x2ae74c['resolved']?I[_0x33574a(0x12d)]:I[_0x33574a(0xf2)]},_0x890cea=await this[_0x33574a(0xd1)][_0x33574a(0xf0)]('/universer-api/comment/unit/'+_0x405af1+_0x33574a(0x128),{'body':_0x5a318a});return!_0x890cea[_0x33574a(0x11e)][_0x33574a(0x120)]||_0x890cea[_0x33574a(0x11e)][_0x33574a(0x120)][_0x33574a(0xbd)]===0x1;}async[_0x24cd7f(0x132)](_0x1fa43b,_0x3d9d65,_0x4e1cd,_0xae5bba){const _0x9dc541=_0x24cd7f,_0x486317={'memberId':(await this['_sessionService'][_0x9dc541(0x10c)](_0x1fa43b))[_0x9dc541(0xcd)](),'threadId':_0x4e1cd,'replyId':_0xae5bba,'unitId':_0x1fa43b},_0x5a6e5b=await this['_httpService'][_0x9dc541(0xf0)](_0x9dc541(0xd7)+_0x1fa43b+'/delete',{'body':_0x486317});return!_0x5a6e5b[_0x9dc541(0x11e)][_0x9dc541(0x120)]||_0x5a6e5b[_0x9dc541(0x11e)]['error'][_0x9dc541(0xbd)]===0x1;}async[_0x24cd7f(0x108)](_0x17fec5,_0x44a24d,_0x3757f7){const _0x5a3280=_0x24cd7f,_0x526aab={'unitId':_0x17fec5,'threadId':_0x3757f7},_0x1f4a1d=await this['_httpService'][_0x5a3280(0xf0)](_0x5a3280(0xd7)+_0x17fec5+_0x5a3280(0xe6),{'body':_0x526aab}),_0x2f5da4=_0x3757f7['map'](_0x5f25cb=>G(_0x1f4a1d[_0x5a3280(0x11e)][_0x5a3280(0x12e)][_0x5f25cb],_0x17fec5,_0x44a24d))[_0x5a3280(0x10f)](Boolean);return Object['values'](_0x1f4a1d['body'][_0x5a3280(0xbe)])[_0x5a3280(0xc0)](_0xe3937f=>{const _0x58950f=_0x5a3280;this[_0x58950f(0xdf)]['addUser'](_0xe3937f);}),_0x2f5da4;}[_0x24cd7f(0x10a)](_0x4ea6dd){const _0x256dec=_0x24cd7f;return{'id':_0x4ea6dd['id'],'threadId':_0x4ea6dd[_0x256dec(0xb9)],'ref':_0x4ea6dd[_0x256dec(0xed)]};}};g=x([_(0x0,c['Inject'](P[_0x24cd7f(0x12c)])),_(0x1,c[_0x24cd7f(0xd9)](c[_0x24cd7f(0xde)])),_(0x2,c[_0x24cd7f(0xd9)](b[_0x24cd7f(0xd4)])),_(0x3,c['Inject'](c[_0x24cd7f(0xd0)]))],g);var H=Object[_0x24cd7f(0xf7)],J=(_0x247382,_0x531161,_0x3cc8c8,_0x4dda94)=>{const _0x3d95fb=_0x24cd7f;for(var _0xe172d8=_0x4dda94>0x1?void 0x0:_0x4dda94?H(_0x531161,_0x3cc8c8):_0x531161,_0x4c3319=_0x247382[_0x3d95fb(0x103)]-0x1,_0x2dd14e;_0x4c3319>=0x0;_0x4c3319--)(_0x2dd14e=_0x247382[_0x4c3319])&&(_0xe172d8=_0x2dd14e(_0xe172d8)||_0xe172d8);return _0xe172d8;},y=(_0x5260da,_0xf40068)=>(_0x103204,_0x154be4)=>_0xf40068(_0x103204,_0x154be4,_0x5260da);let C=class extends c[_0x24cd7f(0xc5)]{constructor(_0x4354f7,_0x5f5305){const _0x4a71b1=_0x24cd7f;super(),this['_threadCommentDataSourceService']=_0x4354f7,this[_0x4a71b1(0xfa)]=_0x5f5305,this[_0x4a71b1(0x116)]();}['_initDataSource'](){const _0x4102c3=_0x24cd7f;this['_threadCommentDataSourceService'][_0x4102c3(0xcb)]=this[_0x4102c3(0xfa)],this[_0x4102c3(0xca)][_0x4102c3(0xf9)]=!0x1;}};C=J([y(0x0,M[_0x24cd7f(0x102)]),y(0x1,c[_0x24cd7f(0xd9)](g))],C);var F=Object[_0x24cd7f(0x135)],L=Object['getOwnPropertyDescriptor'],Z=(_0x38c5dc,_0xf19c4,_0x5b9478)=>_0xf19c4 in _0x38c5dc?F(_0x38c5dc,_0xf19c4,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x5b9478}):_0x38c5dc[_0xf19c4]=_0x5b9478,W=(_0x337cbc,_0x1facc5,_0x10d4db,_0x4a9594)=>{const _0x25caed=_0x24cd7f;for(var _0x1299d0=_0x4a9594>0x1?void 0x0:_0x4a9594?L(_0x1facc5,_0x10d4db):_0x1facc5,_0x2bc413=_0x337cbc[_0x25caed(0x103)]-0x1,_0x48b1ad;_0x2bc413>=0x0;_0x2bc413--)(_0x48b1ad=_0x337cbc[_0x2bc413])&&(_0x1299d0=_0x48b1ad(_0x1299d0)||_0x1299d0);return _0x1299d0;},O=(_0x515aa7,_0x4d6b01)=>(_0x5a329b,_0x3a8c78)=>_0x4d6b01(_0x5a329b,_0x3a8c78,_0x515aa7),N=(_0x3e9ce7,_0x4a8d3c,_0x2abfd1)=>Z(_0x3e9ce7,typeof _0x4a8d3c!=_0x24cd7f(0xe5)?_0x4a8d3c+'':_0x4a8d3c,_0x2abfd1);exports[_0x24cd7f(0xc4)]=class extends c[_0x24cd7f(0x127)]{constructor(_0x1fa87b=D,_0x28a78f,_0x250814){const _0x5aaf66=_0x24cd7f;super(),this[_0x5aaf66(0xc7)]=_0x1fa87b,this['_injector']=_0x28a78f,this[_0x5aaf66(0x11d)]=_0x250814;const {..._0x582a69}=c[_0x5aaf66(0xfc)]({},D,this['_config']);this[_0x5aaf66(0x11d)]['setConfig'](q,_0x582a69);}[_0x24cd7f(0x130)](){const _0x4c9884=_0x24cd7f;[[g],[C],[p]][_0x4c9884(0xc0)](_0x4fec74=>{const _0x1cee96=_0x4c9884;this[_0x1cee96(0xc2)][_0x1cee96(0xf1)](_0x4fec74);});}[_0x24cd7f(0x11a)](){const _0x48f178=_0x24cd7f;this[_0x48f178(0xc2)]['get'](C),this[_0x48f178(0xc2)]['get'](p);}},N(exports['UniverThreadCommentDataSourcePlugin'],_0x24cd7f(0xe4),U),N(exports[_0x24cd7f(0xc4)],_0x24cd7f(0x12a),c['UniverInstanceType'][_0x24cd7f(0x106)]),exports[_0x24cd7f(0xc4)]=W([c[_0x24cd7f(0x12b)](j[_0x24cd7f(0xc8)],b['UniverCollaborationClientPlugin'],T[_0x24cd7f(0x125)]),O(0x1,c['Inject'](c[_0x24cd7f(0xd0)])),O(0x2,c[_0x24cd7f(0x109)])],exports['UniverThreadCommentDataSourcePlugin']);
|
|
1
|
+
'use strict';const _0x39cfa9=_0x496b;(function(_0x558e15,_0xa75ac0){const _0x2be261=_0x496b,_0xba8ab=_0x558e15();while(!![]){try{const _0x393555=-parseInt(_0x2be261(0x10c))/0x1*(parseInt(_0x2be261(0x13e))/0x2)+parseInt(_0x2be261(0x168))/0x3*(parseInt(_0x2be261(0x175))/0x4)+parseInt(_0x2be261(0x163))/0x5*(-parseInt(_0x2be261(0xf5))/0x6)+-parseInt(_0x2be261(0x150))/0x7+-parseInt(_0x2be261(0x115))/0x8*(-parseInt(_0x2be261(0x15f))/0x9)+-parseInt(_0x2be261(0x15c))/0xa*(parseInt(_0x2be261(0x122))/0xb)+-parseInt(_0x2be261(0x105))/0xc*(-parseInt(_0x2be261(0x16f))/0xd);if(_0x393555===_0xa75ac0)break;else _0xba8ab['push'](_0xba8ab['shift']());}catch(_0x51e5f2){_0xba8ab['push'](_0xba8ab['shift']());}}}(_0x44fe,0xa01e3));function _0x496b(_0x4c45cd,_0x3babff){const _0x44fe77=_0x44fe();return _0x496b=function(_0x496b48,_0x198dfd){_0x496b48=_0x496b48-0xf2;let _0x169d79=_0x44fe77[_0x496b48];return _0x169d79;},_0x496b(_0x4c45cd,_0x3babff);}Object[_0x39cfa9(0x148)](exports,Symbol['toStringTag'],{'value':_0x39cfa9(0x169)});const b=require(_0x39cfa9(0x134)),T=require(_0x39cfa9(0x12b)),c=require(_0x39cfa9(0x174)),j=require(_0x39cfa9(0x14e)),M=require(_0x39cfa9(0x146)),w=require(_0x39cfa9(0x152)),P=require('@univerjs/network'),U=_0x39cfa9(0x116);var I=(_0x23f544=>(_0x23f544[_0x23f544['OpenOrReOpen']=0x0]=_0x39cfa9(0x166),_0x23f544[_0x23f544[_0x39cfa9(0x16d)]=0x1]=_0x39cfa9(0x16d),_0x23f544[_0x23f544[_0x39cfa9(0x137)]=-0x1]=_0x39cfa9(0x137),_0x23f544))(I||{}),v=(_0x40ffb9=>(_0x40ffb9[_0x40ffb9[_0x39cfa9(0x110)]=0x0]=_0x39cfa9(0x110),_0x40ffb9[_0x40ffb9[_0x39cfa9(0xf6)]=0x1]='Add',_0x40ffb9[_0x40ffb9['Reply']=0x2]=_0x39cfa9(0x113),_0x40ffb9[_0x40ffb9['Edit']=0x3]=_0x39cfa9(0x164),_0x40ffb9[_0x40ffb9[_0x39cfa9(0x101)]=0x4]='Delete',_0x40ffb9[_0x40ffb9['Solve']=0x5]=_0x39cfa9(0x11d),_0x40ffb9[_0x40ffb9[_0x39cfa9(0x137)]=-0x1]='UNRECOGNIZED',_0x40ffb9))(v||{});const f=_0x3d346b=>c[_0x39cfa9(0x13b)](new Date(+_0x3d346b))[_0x39cfa9(0x10b)](_0x39cfa9(0xf7)),R=async(_0x2f2a40,_0x42be4e)=>{const _0x581ed8=_0x39cfa9,_0x4cb127=_0x2f2a40['get'](c['UserManagerService']),_0x327821=_0x2f2a40['get'](P['HTTPService']);_0x42be4e[_0x581ed8(0x153)](_0x37a2af=>{const _0x5189ec=_0x581ed8;_0x4cb127[_0x5189ec(0x15a)](_0x37a2af)&&_0x42be4e[_0x5189ec(0x141)](_0x37a2af);}),_0x42be4e[_0x581ed8(0x16c)]&&(await _0x327821[_0x581ed8(0x128)](_0x581ed8(0x159),{'params':{'userIDs':[..._0x42be4e]}}))[_0x581ed8(0xfc)]['users'][_0x581ed8(0x153)](_0x532eb7=>{const _0x1e4173=_0x581ed8;_0x532eb7&&_0x4cb127[_0x1e4173(0x106)](_0x532eb7);});};var $=Object['getOwnPropertyDescriptor'],E=(_0x13b178,_0x34650a,_0x3e79bd,_0x20290d)=>{const _0x53d820=_0x39cfa9;for(var _0x2e0fe7=_0x20290d>0x1?void 0x0:_0x20290d?$(_0x34650a,_0x3e79bd):_0x34650a,_0x43b931=_0x13b178[_0x53d820(0x14d)]-0x1,_0x1f91e8;_0x43b931>=0x0;_0x43b931--)(_0x1f91e8=_0x13b178[_0x43b931])&&(_0x2e0fe7=_0x1f91e8(_0x2e0fe7)||_0x2e0fe7);return _0x2e0fe7;},S=(_0x351f62,_0x45f73c)=>(_0x19a18e,_0x50313b)=>_0x45f73c(_0x19a18e,_0x50313b,_0x351f62);let p=class extends c['Disposable']{constructor(_0x29d2bf,_0x4eb3f1,_0x503669,_0x4d8c70){const _0x576160=_0x39cfa9;super(),this[_0x576160(0x14a)]=_0x29d2bf,this[_0x576160(0xf8)]=_0x4eb3f1,this[_0x576160(0x11f)]=_0x503669,this[_0x576160(0x140)]=_0x4d8c70,this[_0x576160(0x125)](),this[_0x576160(0x12e)]();}[_0x39cfa9(0x12e)](){const _0x144b37=_0x39cfa9;this[_0x144b37(0x100)](this[_0x144b37(0xf8)][_0x144b37(0xf9)][_0x144b37(0x155)](w[_0x144b37(0x173)](0x10))['subscribe'](_0x569ac8=>{const _0x221e70=_0x144b37,_0x280f77=new Set();_0x569ac8[_0x221e70(0x153)](_0x29ab3a=>{const _0x59ea88=_0x221e70;switch(_0x29ab3a[_0x59ea88(0x118)]){case _0x59ea88(0x10e):{const _0x279223=_0x29ab3a[_0x59ea88(0x12a)][_0x59ea88(0x11a)];_0x280f77['add'](_0x279223);break;}}}),R(this[_0x221e70(0x140)],_0x280f77);}));}[_0x39cfa9(0x125)](){const _0x4858d5=_0x39cfa9;this[_0x4858d5(0x100)](this[_0x4858d5(0x14a)][_0x4858d5(0xf9)][_0x4858d5(0x156)](async _0xfda666=>{const _0x34c126=_0x4858d5;var _0x41a2af,_0x5d46bf,_0x4dc9d7,_0x4da52d;const _0x5ec197=(_0x41a2af=this[_0x34c126(0xf8)]['getUnit'](_0xfda666[_0x34c126(0x11c)])['find'](_0x5f23d0=>_0x5f23d0[_0x34c126(0x171)]===_0xfda666[_0x34c126(0x171)]))==null?void 0x0:_0x41a2af['root'];if(!_0x5ec197)return;const {unitId:_0x4317ba,subUnitId:_0x4e4e43}=_0x5ec197;switch(_0xfda666[_0x34c126(0x131)]&&this[_0x34c126(0x11f)]['addUser'](_0xfda666['user']),_0xfda666['type']){case v[_0x34c126(0xf6)]:break;case v[_0x34c126(0x113)]:{this[_0x34c126(0xf8)][_0x34c126(0x13c)](_0x4317ba,_0x4e4e43,{'unitId':_0x4317ba,'subUnitId':_0x4e4e43,'ref':'','id':_0xfda666[_0x34c126(0x135)],'dT':f(+_0xfda666[_0x34c126(0x112)]),'threadId':_0xfda666[_0x34c126(0x171)],'personId':(_0x4dc9d7=(_0x5d46bf=_0xfda666[_0x34c126(0x131)])==null?void 0x0:_0x5d46bf[_0x34c126(0x136)])!=null?_0x4dc9d7:_0xfda666[_0x34c126(0x14c)],'text':JSON[_0x34c126(0x123)](_0xfda666['content']),'parentId':_0x5ec197['id']});break;}case v[_0x34c126(0x101)]:{const _0x31f202=this[_0x34c126(0xf8)][_0x34c126(0x109)](_0x4317ba,_0x4e4e43,_0xfda666['replyId']);_0x31f202&&_0x31f202[_0x34c126(0x13f)]&&this['_threadCommentModel'][_0x34c126(0x12c)](_0x4317ba,_0x4e4e43,_0xfda666[_0x34c126(0x135)]);break;}case v[_0x34c126(0x164)]:{this[_0x34c126(0xf8)][_0x34c126(0x124)](_0x4317ba,_0x4e4e43,{'commentId':_0xfda666['replyId'],'text':JSON[_0x34c126(0x123)](_0xfda666[_0x34c126(0x15d)])});break;}case v[_0x34c126(0x11d)]:{const _0x3fbba3=(_0x4da52d=this[_0x34c126(0xf8)][_0x34c126(0x172)](_0xfda666[_0x34c126(0x11c)])[_0x34c126(0x12d)](_0x30f7ef=>_0x30f7ef[_0x34c126(0x171)]===_0xfda666[_0x34c126(0x171)]))==null?void 0x0:_0x4da52d['root'];_0x3fbba3&&this[_0x34c126(0xf8)][_0x34c126(0x147)](_0x4317ba,_0x4e4e43,_0x3fbba3['id'],_0xfda666[_0x34c126(0x144)]===I[_0x34c126(0x16d)]);break;}}}));}};p=E([S(0x0,c['Inject'](b[_0x39cfa9(0x102)])),S(0x1,c[_0x39cfa9(0x170)](M[_0x39cfa9(0x162)])),S(0x2,c[_0x39cfa9(0x170)](c[_0x39cfa9(0x176)])),S(0x3,c[_0x39cfa9(0x170)](c['Injector']))],p);const q=_0x39cfa9(0x16e),D={};var A=Object[_0x39cfa9(0x138)],x=(_0x2e2aff,_0x15e49e,_0x1dd1ea,_0x242544)=>{const _0x392567=_0x39cfa9;for(var _0x207067=_0x242544>0x1?void 0x0:_0x242544?A(_0x15e49e,_0x1dd1ea):_0x15e49e,_0x476082=_0x2e2aff[_0x392567(0x14d)]-0x1,_0x107dc1;_0x476082>=0x0;_0x476082--)(_0x107dc1=_0x2e2aff[_0x476082])&&(_0x207067=_0x107dc1(_0x207067)||_0x207067);return _0x207067;},_=(_0x5cc69d,_0x459d8b)=>(_0x2e0c77,_0x4c278d)=>_0x459d8b(_0x2e0c77,_0x4c278d,_0x5cc69d);function Y(_0x1d5699,_0x275431){const _0x18309c=_0x39cfa9,_0x59ede4=_0x1d5699[_0x18309c(0x13d)][0x0];return{..._0x275431,'id':_0x59ede4[_0x18309c(0x135)],'resolved':_0x1d5699['solved']===0x1,'dT':f(_0x59ede4[_0x18309c(0x112)]),'personId':_0x59ede4[_0x18309c(0x14c)],'threadId':_0x59ede4[_0x18309c(0x171)]};}function G(_0x3d99ae,_0x2e13c2,_0x4e1caf){const _0x369aff=_0x39cfa9;var _0x15097f,_0x5360ff;if(((_0x5360ff=(_0x15097f=_0x3d99ae==null?void 0x0:_0x3d99ae[_0x369aff(0x13d)])==null?void 0x0:_0x15097f[_0x369aff(0x14d)])!=null?_0x5360ff:0x0)>0x0){const _0x5b0e5f=(_0x5807fb,_0x2b231e)=>({'id':_0x5807fb[_0x369aff(0x135)],'threadId':_0x5807fb[_0x369aff(0x171)],'dT':f(_0x5807fb[_0x369aff(0x112)]),'personId':_0x5807fb['userId'],'resolved':_0x3d99ae[_0x369aff(0x144)]===I[_0x369aff(0x16d)],'unitId':_0x2e13c2,'subUnitId':_0x4e1caf,'text':JSON[_0x369aff(0x123)](_0x5807fb[_0x369aff(0x15d)]),'parentId':_0x2b231e}),_0x477c71=_0x5b0e5f(_0x3d99ae[_0x369aff(0x13d)][0x0]);return{..._0x477c71,'children':_0x3d99ae[_0x369aff(0x13d)][_0x369aff(0x11b)](0x1)[_0x369aff(0x127)](_0x5124cc=>_0x5b0e5f(_0x5124cc,_0x477c71['id']))};}return null;}let g=class{constructor(_0x34c84d,_0x4dfbd1,_0x3bba66,_0x31fb82){const _0xfa1cc2=_0x39cfa9;this[_0xfa1cc2(0xfd)]=_0x34c84d,this['_userService']=_0x4dfbd1,this[_0xfa1cc2(0x154)]=_0x3bba66,this[_0xfa1cc2(0x140)]=_0x31fb82;}async[_0x39cfa9(0x13c)](_0x600efd){const _0x20ba6f=_0x39cfa9;var _0x59a666,_0x2bf699;const {parentId:_0x36eee3,unitId:_0x290325,text:_0x16f41b,threadId:_0x1f4a99}=_0x600efd,_0x222299=(_0x2bf699=(_0x59a666=_0x16f41b['customRanges'])==null?void 0x0:_0x59a666[_0x20ba6f(0x145)](_0x46a2a9=>_0x46a2a9[_0x20ba6f(0x132)]===c[_0x20ba6f(0x108)][_0x20ba6f(0x12f)])[_0x20ba6f(0x127)](_0x1113e2=>_0x1113e2[_0x20ba6f(0x10d)]))!=null?_0x2bf699:[],_0xea195=JSON['stringify'](_0x16f41b),_0x4da7ef=(await this['_sessionService'][_0x20ba6f(0xfe)](_0x290325))[_0x20ba6f(0x111)]();if(_0x36eee3){const _0x46037e={'memberId':_0x4da7ef,'unitId':_0x290325,'content':_0xea195,'mention':_0x222299,'threadId':_0x1f4a99},_0x496919=(await this[_0x20ba6f(0xfd)][_0x20ba6f(0x14b)]('/universer-api/comment/unit/'+_0x290325+_0x20ba6f(0x130),{'body':_0x46037e}))[_0x20ba6f(0xfc)]['reply'];return{..._0x600efd,'id':_0x496919[_0x20ba6f(0x135)],'dT':c['dayjs'](+_0x496919['createTimestamp'])['format'](_0x20ba6f(0xf7)),'personId':_0x496919[_0x20ba6f(0x14c)]};}else{const _0x44b52f={'memberId':_0x4da7ef,'unitId':_0x290325,'content':_0xea195,'mention':_0x222299},_0x140203=await this[_0x20ba6f(0xfd)][_0x20ba6f(0x14b)](_0x20ba6f(0x104)+_0x290325+_0x20ba6f(0x103),{'body':_0x44b52f});return Y(_0x140203[_0x20ba6f(0xfc)]['comment'],_0x600efd);}}async[_0x39cfa9(0x124)](_0x1fa654){const _0x1f7892=_0x39cfa9;var _0x4fc03e,_0x53240b;const {text:_0xd51861,unitId:_0x2bb2fa}=_0x1fa654,_0x51f715=(_0x53240b=(_0x4fc03e=_0xd51861['customRanges'])==null?void 0x0:_0x4fc03e[_0x1f7892(0x145)](_0x42e7d4=>_0x42e7d4[_0x1f7892(0x132)]===c['CustomRangeType'][_0x1f7892(0x12f)])[_0x1f7892(0x127)](_0x4fa6e8=>_0x4fa6e8[_0x1f7892(0x10d)]))!=null?_0x53240b:[],_0x2647f8=JSON[_0x1f7892(0x161)](_0xd51861),_0x25d07e=_0x1fa654[_0x1f7892(0x171)],_0x398fd2=_0x1fa654['id'],_0x292970={'memberId':(await this['_sessionService'][_0x1f7892(0xfe)](_0x2bb2fa))[_0x1f7892(0x111)](),'unitId':_0x2bb2fa,'threadId':_0x25d07e,'mention':_0x51f715,'content':_0x2647f8,'replyId':_0x398fd2},_0x262635=await this['_httpService']['post'](_0x1f7892(0x104)+_0x2bb2fa+'/edit',{'body':_0x292970});return!_0x262635['body'][_0x1f7892(0x14f)]||_0x262635['body'][_0x1f7892(0x14f)]['code']===0x1;}async[_0x39cfa9(0x147)](_0x12429a){const _0x80328f=_0x39cfa9,{unitId:_0x46fb6b}=_0x12429a,_0x97791=_0x12429a[_0x80328f(0x171)],_0x4b241b={'memberId':this[_0x80328f(0x11f)][_0x80328f(0x107)]()[_0x80328f(0x136)],'unitId':_0x46fb6b,'threadId':_0x97791,'solved':_0x12429a['resolved']?I[_0x80328f(0x16d)]:I[_0x80328f(0x166)]},_0x1ade9a=await this[_0x80328f(0xfd)][_0x80328f(0x14b)]('/universer-api/comment/unit/'+_0x46fb6b+_0x80328f(0x139),{'body':_0x4b241b});return!_0x1ade9a[_0x80328f(0xfc)][_0x80328f(0x14f)]||_0x1ade9a['body'][_0x80328f(0x14f)]['code']===0x1;}async[_0x39cfa9(0x12c)](_0x4a8ff1,_0x989671,_0x135d1a,_0x1cd497){const _0x32bb88=_0x39cfa9,_0x190b09={'memberId':(await this[_0x32bb88(0x154)][_0x32bb88(0xfe)](_0x4a8ff1))['getMemberID'](),'threadId':_0x135d1a,'replyId':_0x1cd497,'unitId':_0x4a8ff1},_0x46fe64=await this[_0x32bb88(0xfd)]['post'](_0x32bb88(0x104)+_0x4a8ff1+_0x32bb88(0x160),{'body':_0x190b09});return!_0x46fe64['body'][_0x32bb88(0x14f)]||_0x46fe64['body']['error'][_0x32bb88(0x16a)]===0x1;}async[_0x39cfa9(0xfa)](_0xe48bc0,_0x40bdad,_0x3cebd3){const _0x131e5d=_0x39cfa9,_0x2884eb={'unitId':_0xe48bc0,'threadId':_0x3cebd3},_0x2d2ef5=await this[_0x131e5d(0xfd)][_0x131e5d(0x14b)](_0x131e5d(0x104)+_0xe48bc0+_0x131e5d(0x114),{'body':_0x2884eb}),_0x5a8979=_0x3cebd3[_0x131e5d(0x127)](_0x295548=>G(_0x2d2ef5[_0x131e5d(0xfc)][_0x131e5d(0x167)][_0x295548],_0xe48bc0,_0x40bdad))['filter'](Boolean);return Object[_0x131e5d(0x10f)](_0x2d2ef5[_0x131e5d(0xfc)][_0x131e5d(0xf2)])[_0x131e5d(0x153)](_0x1dbe7d=>{const _0x371482=_0x131e5d;this['_userService'][_0x371482(0x106)](_0x1dbe7d);}),_0x5a8979;}[_0x39cfa9(0xfb)](_0x26403f){const _0x1b036a=_0x39cfa9;return{'id':_0x26403f['id'],'threadId':_0x26403f[_0x1b036a(0x171)],'ref':_0x26403f[_0x1b036a(0x121)]};}};g=x([_(0x0,c[_0x39cfa9(0x170)](P[_0x39cfa9(0x133)])),_(0x1,c['Inject'](c['UserManagerService'])),_(0x2,c[_0x39cfa9(0x170)](b[_0x39cfa9(0x11e)])),_(0x3,c[_0x39cfa9(0x170)](c[_0x39cfa9(0xff)]))],g);var H=Object[_0x39cfa9(0x138)],J=(_0x3ae4bd,_0x133e44,_0x37f5b7,_0x433e1e)=>{for(var _0x15f9e4=_0x433e1e>0x1?void 0x0:_0x433e1e?H(_0x133e44,_0x37f5b7):_0x133e44,_0x460100=_0x3ae4bd['length']-0x1,_0x427df8;_0x460100>=0x0;_0x460100--)(_0x427df8=_0x3ae4bd[_0x460100])&&(_0x15f9e4=_0x427df8(_0x15f9e4)||_0x15f9e4);return _0x15f9e4;},y=(_0xbf736b,_0x392bc6)=>(_0x2a4b5d,_0x1f00f9)=>_0x392bc6(_0x2a4b5d,_0x1f00f9,_0xbf736b);let C=class extends c[_0x39cfa9(0x158)]{constructor(_0x1ec9a7,_0x13e95c){const _0x9e3a7a=_0x39cfa9;super(),this['_threadCommentDataSourceService']=_0x1ec9a7,this[_0x9e3a7a(0x15b)]=_0x13e95c,this[_0x9e3a7a(0x13a)]();}['_initDataSource'](){const _0x4e113b=_0x39cfa9;this[_0x4e113b(0xf3)]['dataSource']=this['_threadCommentDataSource'],this[_0x4e113b(0xf3)][_0x4e113b(0x119)]=!0x1;}};C=J([y(0x0,M[_0x39cfa9(0x129)]),y(0x1,c[_0x39cfa9(0x170)](g))],C);function _0x44fe(){const _0x3712a7=['filter','@univerjs/thread-comment','resolveComment','defineProperty','_configService','_commentService','post','userId','length','@univerjs/thread-comment-ui','error','5549243ciqfhg','_config','rxjs','forEach','_sessionService','pipe','subscribe','UniverThreadCommentDataSourcePlugin','Disposable','/universer-api/user/list','getUser','_threadCommentDataSource','80LiORrW','content','IConfigService','18trzjoR','/delete','stringify','ThreadCommentModel','1275zUWHew','Edit','pluginName','OpenOrReOpen','comments','18oCsYxk','Module','code','merge','size','Solved','thread-comment-data-source.config','41616822RSWPLH','Inject','threadId','getUnit','bufferTime','@univerjs/core','47164QQzVbz','UserManagerService','users','_threadCommentDataSourceService','Plugin','15510bXvxZd','Add','YYYY/MM/DD\x20HH:mm','_threadCommentModel','commentUpdate$','listComments','saveCommentToSnapshot','body','_httpService','requireSession','Injector','disposeWithMe','Delete','CommentService','/add','/universer-api/comment/unit/','12gXSSkO','addUser','getCurrentUser','CustomRangeType','getComment','UniverInstanceType','format','948611LaSuFk','rangeId','add','values','Unknown','getMemberID','createTimestamp','Reply','/list','977128SRZSyP','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','UniverLicensePlugin','type','syncUpdateMutationToColla','personId','slice','unitId','Solve','CollaborationSessionService','_userService','onReady','ref','632423ZetClI','parse','updateComment','_init','UniverCollaborationClientPlugin','map','get','IThreadCommentDataSourceService','payload','@univerjs-pro/license','deleteComment','find','_initUserSync','COMMENT','/reply','user','rangeType','HTTPService','@univerjs-pro/collaboration-client','replyId','userID','UNRECOGNIZED','getOwnPropertyDescriptor','/solved','_initDataSource','dayjs','addComment','replies','2PPCuzk','parentId','_injector','delete','DependentOn','UniverThreadCommentUIPlugin','solved'];_0x44fe=function(){return _0x3712a7;};return _0x44fe();}var F=Object['defineProperty'],L=Object[_0x39cfa9(0x138)],Z=(_0x3388db,_0x154878,_0x1ef1ec)=>_0x154878 in _0x3388db?F(_0x3388db,_0x154878,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x1ef1ec}):_0x3388db[_0x154878]=_0x1ef1ec,W=(_0x303b9d,_0x56456b,_0x53d654,_0x155166)=>{const _0x5c1054=_0x39cfa9;for(var _0x46966a=_0x155166>0x1?void 0x0:_0x155166?L(_0x56456b,_0x53d654):_0x56456b,_0x712608=_0x303b9d[_0x5c1054(0x14d)]-0x1,_0x415e39;_0x712608>=0x0;_0x712608--)(_0x415e39=_0x303b9d[_0x712608])&&(_0x46966a=_0x415e39(_0x46966a)||_0x46966a);return _0x46966a;},O=(_0x4ba7c5,_0x276e9d)=>(_0x598b8a,_0x2e875d)=>_0x276e9d(_0x598b8a,_0x2e875d,_0x4ba7c5),N=(_0x8a9aea,_0x55b828,_0xec7562)=>Z(_0x8a9aea,typeof _0x55b828!='symbol'?_0x55b828+'':_0x55b828,_0xec7562);exports[_0x39cfa9(0x157)]=class extends c[_0x39cfa9(0xf4)]{constructor(_0xd83c05=D,_0x6ea53d,_0x24d914){const _0x245361=_0x39cfa9;super(),this[_0x245361(0x151)]=_0xd83c05,this[_0x245361(0x140)]=_0x6ea53d,this[_0x245361(0x149)]=_0x24d914;const {..._0x227743}=c[_0x245361(0x16b)]({},D,this[_0x245361(0x151)]);this['_configService']['setConfig'](q,_0x227743);}['onStarting'](){const _0x589d43=_0x39cfa9;[[g],[C],[p]][_0x589d43(0x153)](_0x21fbb4=>{const _0x594778=_0x589d43;this[_0x594778(0x140)]['add'](_0x21fbb4);});}[_0x39cfa9(0x120)](){const _0x3b0b8f=_0x39cfa9;this['_injector'][_0x3b0b8f(0x128)](C),this[_0x3b0b8f(0x140)][_0x3b0b8f(0x128)](p);}},N(exports[_0x39cfa9(0x157)],_0x39cfa9(0x165),U),N(exports[_0x39cfa9(0x157)],_0x39cfa9(0x118),c[_0x39cfa9(0x10a)]['UNIVER_UNKNOWN']),exports[_0x39cfa9(0x157)]=W([c[_0x39cfa9(0x142)](j[_0x39cfa9(0x143)],b[_0x39cfa9(0x126)],T[_0x39cfa9(0x117)]),O(0x1,c[_0x39cfa9(0x170)](c[_0x39cfa9(0xff)])),O(0x2,c[_0x39cfa9(0x15e)])],exports[_0x39cfa9(0x157)]);
|
package/lib/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x2d5350=_0x5b24;function _0x5282(){const _0x322b26=['format','OpenOrReOpen','getCurrentUser','/edit','body','symbol','requireSession','/universer-api/comment/unit/','onReady','size','rangeType','userId','Reply','deleteComment','user','ref','getComment','comments','/solved','31920240NEnvaB','get','Unknown','listComments','content','forEach','_httpService','1763512CQnKvL','stringify','parse','root','_configService','replies','_injector','Add','code','Delete','_threadCommentDataSourceService','Solve','getMemberID','_threadCommentDataSource','/add','Solved','_commentService','UNIVER_UNKNOWN','6986168DhicmD','threadId','solved','5801478JeRctW','onStarting','defineProperty','reply','delete','post','updateComment','userID','find','dataSource','subscribe','_sessionService','getUser','disposeWithMe','users','9ZHbwiz','_config','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','_threadCommentModel','Edit','getUnit','customRanges','add','1208Pbenet','/list','replyId','_initUserSync','addUser','unitId','5638824XeUNfj','commentUpdate$','1IrWvpq','2885427rweuQJ','_initDataSource','rangeId','COMMENT','filter','type','resolveComment','_userService','createTimestamp','13085twpSKB','UNRECOGNIZED','length','pluginName','map','pipe','error','getOwnPropertyDescriptor'];_0x5282=function(){return _0x322b26;};return _0x5282();}(function(_0x4f49c9,_0x1d89f0){const _0xa95a08=_0x5b24,_0x3a6338=_0x4f49c9();while(!![]){try{const _0x5300d0=parseInt(_0xa95a08(0xed))/0x1*(parseInt(_0xa95a08(0x119))/0x2)+parseInt(_0xa95a08(0xee))/0x3+parseInt(_0xa95a08(0xe5))/0x4*(parseInt(_0xa95a08(0xf7))/0x5)+parseInt(_0xa95a08(0xce))/0x6+parseInt(_0xa95a08(0xcb))/0x7+parseInt(_0xa95a08(0xeb))/0x8*(-parseInt(_0xa95a08(0xdd))/0x9)+-parseInt(_0xa95a08(0x112))/0xa;if(_0x5300d0===_0x1d89f0)break;else _0x3a6338['push'](_0x3a6338['shift']());}catch(_0xee8e77){_0x3a6338['push'](_0x3a6338['shift']());}}}(_0x5282,0xab607));import{CommentService as _0x5646f3,CollaborationSessionService as _0x242f6a,UniverCollaborationClientPlugin as _0x1f9298}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x3137d0}from'@univerjs-pro/license';import{dayjs as _0x4b79be,UserManagerService as _0x48e2a5,Inject as _0x82e101,Injector as _0x2de2a0,Disposable as _0xd7e540,CustomRangeType as _0x27a3d3,UniverInstanceType as _0x5b3885,DependentOn as _0xfde2f5,IConfigService as _0x14ce99,Plugin as _0x419499,merge as _0x4682c7}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x55cac6}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x1ba485,IThreadCommentDataSourceService as _0x4fae4e}from'@univerjs/thread-comment';import{bufferTime as _0x1ee30f}from'rxjs';function _0x5b24(_0x1cdd0e,_0x5af263){const _0x5282bc=_0x5282();return _0x5b24=function(_0x5b240b,_0x2b21c8){_0x5b240b=_0x5b240b-0xc8;let _0x1acb8b=_0x5282bc[_0x5b240b];return _0x1acb8b;},_0x5b24(_0x1cdd0e,_0x5af263);}import{HTTPService as _0x16aa01}from'@univerjs/network';const W=_0x2d5350(0xdf);var I=(_0x3024b4=>(_0x3024b4[_0x3024b4[_0x2d5350(0x100)]=0x0]='OpenOrReOpen',_0x3024b4[_0x3024b4['Solved']=0x1]='Solved',_0x3024b4[_0x3024b4[_0x2d5350(0xf8)]=-0x1]='UNRECOGNIZED',_0x3024b4))(I||{}),v=(_0x124b25=>(_0x124b25[_0x124b25[_0x2d5350(0x114)]=0x0]=_0x2d5350(0x114),_0x124b25[_0x124b25[_0x2d5350(0x120)]=0x1]=_0x2d5350(0x120),_0x124b25[_0x124b25[_0x2d5350(0x10b)]=0x2]=_0x2d5350(0x10b),_0x124b25[_0x124b25[_0x2d5350(0xe1)]=0x3]=_0x2d5350(0xe1),_0x124b25[_0x124b25[_0x2d5350(0x122)]=0x4]=_0x2d5350(0x122),_0x124b25[_0x124b25[_0x2d5350(0x124)]=0x5]=_0x2d5350(0x124),_0x124b25[_0x124b25[_0x2d5350(0xf8)]=-0x1]=_0x2d5350(0xf8),_0x124b25))(v||{});const D=_0x35cca1=>_0x4b79be(new Date(+_0x35cca1))[_0x2d5350(0xff)]('YYYY/MM/DD\x20HH:mm'),B=async(_0x3e423b,_0x367b81)=>{const _0x8e92fc=_0x2d5350,_0x379b67=_0x3e423b[_0x8e92fc(0x113)](_0x48e2a5),_0xa89619=_0x3e423b['get'](_0x16aa01);_0x367b81['forEach'](_0x16088e=>{const _0x3d4f42=_0x8e92fc;_0x379b67[_0x3d4f42(0xda)](_0x16088e)&&_0x367b81[_0x3d4f42(0xd2)](_0x16088e);}),_0x367b81[_0x8e92fc(0x108)]&&(await _0xa89619[_0x8e92fc(0x113)]('/universer-api/user/list',{'params':{'userIDs':[..._0x367b81]}}))[_0x8e92fc(0x103)][_0x8e92fc(0xdc)][_0x8e92fc(0x117)](_0x402337=>{const _0x2ffb06=_0x8e92fc;_0x402337&&_0x379b67[_0x2ffb06(0xe9)](_0x402337);});};var K=Object[_0x2d5350(0xfe)],V=(_0xcb8fcf,_0x975fa6,_0x305288,_0x4242cf)=>{const _0x5429ec=_0x2d5350;for(var _0x17ad9a=_0x4242cf>0x1?void 0x0:_0x4242cf?K(_0x975fa6,_0x305288):_0x975fa6,_0x48544c=_0xcb8fcf[_0x5429ec(0xf9)]-0x1,_0x1bd1ac;_0x48544c>=0x0;_0x48544c--)(_0x1bd1ac=_0xcb8fcf[_0x48544c])&&(_0x17ad9a=_0x1bd1ac(_0x17ad9a)||_0x17ad9a);return _0x17ad9a;},p=(_0x54ffd1,_0x234003)=>(_0x22f624,_0x47e8ec)=>_0x234003(_0x22f624,_0x47e8ec,_0x54ffd1);let S=class extends _0xd7e540{constructor(_0x1c8253,_0x50c327,_0x11a5e8,_0x4f4a1c){const _0x431fd6=_0x2d5350;super(),this[_0x431fd6(0xc9)]=_0x1c8253,this[_0x431fd6(0xe0)]=_0x50c327,this[_0x431fd6(0xf5)]=_0x11a5e8,this[_0x431fd6(0x11f)]=_0x4f4a1c,this['_init'](),this[_0x431fd6(0xe8)]();}[_0x2d5350(0xe8)](){const _0x430198=_0x2d5350;this[_0x430198(0xdb)](this['_threadCommentModel'][_0x430198(0xec)][_0x430198(0xfc)](_0x1ee30f(0x10))['subscribe'](_0x387b63=>{const _0x35251e=_0x430198,_0xe145be=new Set();_0x387b63[_0x35251e(0x117)](_0x128904=>{const _0x400e9b=_0x35251e;switch(_0x128904[_0x400e9b(0xf3)]){case'add':{const _0x35594e=_0x128904['payload']['personId'];_0xe145be[_0x400e9b(0xe4)](_0x35594e);break;}}}),B(this[_0x35251e(0x11f)],_0xe145be);}));}['_init'](){const _0x10548d=_0x2d5350;this[_0x10548d(0xdb)](this[_0x10548d(0xc9)][_0x10548d(0xec)][_0x10548d(0xd8)](async _0x79bf6a=>{const _0x1b120d=_0x10548d;var _0x2a947d,_0x45f03f,_0x33dc3b,_0x5c655c;const _0x35e463=(_0x2a947d=this[_0x1b120d(0xe0)][_0x1b120d(0xe2)](_0x79bf6a[_0x1b120d(0xea)])[_0x1b120d(0xd6)](_0x5cfb28=>_0x5cfb28[_0x1b120d(0xcc)]===_0x79bf6a[_0x1b120d(0xcc)]))==null?void 0x0:_0x2a947d[_0x1b120d(0x11c)];if(!_0x35e463)return;const {unitId:_0x41d88e,subUnitId:_0x456ee6}=_0x35e463;switch(_0x79bf6a[_0x1b120d(0x10d)]&&this['_userService'][_0x1b120d(0xe9)](_0x79bf6a[_0x1b120d(0x10d)]),_0x79bf6a[_0x1b120d(0xf3)]){case v[_0x1b120d(0x120)]:break;case v['Reply']:{this[_0x1b120d(0xe0)]['addComment'](_0x41d88e,_0x456ee6,{'unitId':_0x41d88e,'subUnitId':_0x456ee6,'ref':'','id':_0x79bf6a['replyId'],'dT':D(+_0x79bf6a[_0x1b120d(0xf6)]),'threadId':_0x79bf6a['threadId'],'personId':(_0x33dc3b=(_0x45f03f=_0x79bf6a[_0x1b120d(0x10d)])==null?void 0x0:_0x45f03f[_0x1b120d(0xd5)])!=null?_0x33dc3b:_0x79bf6a['userId'],'text':JSON[_0x1b120d(0x11b)](_0x79bf6a[_0x1b120d(0x116)]),'parentId':_0x35e463['id']});break;}case v[_0x1b120d(0x122)]:{const _0x151700=this['_threadCommentModel'][_0x1b120d(0x10f)](_0x41d88e,_0x456ee6,_0x79bf6a[_0x1b120d(0xe7)]);_0x151700&&_0x151700['parentId']&&this[_0x1b120d(0xe0)]['deleteComment'](_0x41d88e,_0x456ee6,_0x79bf6a[_0x1b120d(0xe7)]);break;}case v[_0x1b120d(0xe1)]:{this['_threadCommentModel']['updateComment'](_0x41d88e,_0x456ee6,{'commentId':_0x79bf6a['replyId'],'text':JSON[_0x1b120d(0x11b)](_0x79bf6a[_0x1b120d(0x116)])});break;}case v[_0x1b120d(0x124)]:{const _0x3d510d=(_0x5c655c=this[_0x1b120d(0xe0)][_0x1b120d(0xe2)](_0x79bf6a['unitId'])[_0x1b120d(0xd6)](_0x167fe3=>_0x167fe3['threadId']===_0x79bf6a[_0x1b120d(0xcc)]))==null?void 0x0:_0x5c655c[_0x1b120d(0x11c)];_0x3d510d&&this[_0x1b120d(0xe0)][_0x1b120d(0xf4)](_0x41d88e,_0x456ee6,_0x3d510d['id'],_0x79bf6a[_0x1b120d(0xcd)]===I[_0x1b120d(0xc8)]);break;}}}));}};S=V([p(0x0,_0x82e101(_0x5646f3)),p(0x1,_0x82e101(_0x1ba485)),p(0x2,_0x82e101(_0x48e2a5)),p(0x3,_0x82e101(_0x2de2a0))],S);const z='thread-comment-data-source.config',M={};var k=Object['getOwnPropertyDescriptor'],Q=(_0x1df013,_0x388f42,_0x986144,_0x5354af)=>{const _0x4b08f0=_0x2d5350;for(var _0x27d257=_0x5354af>0x1?void 0x0:_0x5354af?k(_0x388f42,_0x986144):_0x388f42,_0x2e01c4=_0x1df013[_0x4b08f0(0xf9)]-0x1,_0x26e628;_0x2e01c4>=0x0;_0x2e01c4--)(_0x26e628=_0x1df013[_0x2e01c4])&&(_0x27d257=_0x26e628(_0x27d257)||_0x27d257);return _0x27d257;},_=(_0x4bdda0,_0x36d52c)=>(_0x520d65,_0x141c4e)=>_0x36d52c(_0x520d65,_0x141c4e,_0x4bdda0);function X(_0x5e74aa,_0x413701){const _0x2f8e15=_0x2d5350,_0x5ac38b=_0x5e74aa[_0x2f8e15(0x11e)][0x0];return{..._0x413701,'id':_0x5ac38b[_0x2f8e15(0xe7)],'resolved':_0x5e74aa[_0x2f8e15(0xcd)]===0x1,'dT':D(_0x5ac38b[_0x2f8e15(0xf6)]),'personId':_0x5ac38b[_0x2f8e15(0x10a)],'threadId':_0x5ac38b[_0x2f8e15(0xcc)]};}function ee(_0x2417a,_0x1931a0,_0x5b039b){const _0xee6606=_0x2d5350;var _0x2dc4af,_0x85328f;if(((_0x85328f=(_0x2dc4af=_0x2417a==null?void 0x0:_0x2417a[_0xee6606(0x11e)])==null?void 0x0:_0x2dc4af[_0xee6606(0xf9)])!=null?_0x85328f:0x0)>0x0){const _0x395103=(_0x360bdc,_0x38d607)=>({'id':_0x360bdc['replyId'],'threadId':_0x360bdc[_0xee6606(0xcc)],'dT':D(_0x360bdc[_0xee6606(0xf6)]),'personId':_0x360bdc[_0xee6606(0x10a)],'resolved':_0x2417a[_0xee6606(0xcd)]===I[_0xee6606(0xc8)],'unitId':_0x1931a0,'subUnitId':_0x5b039b,'text':JSON[_0xee6606(0x11b)](_0x360bdc[_0xee6606(0x116)]),'parentId':_0x38d607}),_0x4dce44=_0x395103(_0x2417a[_0xee6606(0x11e)][0x0]);return{..._0x4dce44,'children':_0x2417a['replies']['slice'](0x1)[_0xee6606(0xfb)](_0x5bbbba=>_0x395103(_0x5bbbba,_0x4dce44['id']))};}return null;}let f=class{constructor(_0x27a508,_0x576c22,_0x28db77,_0x1180f6){const _0x12defe=_0x2d5350;this[_0x12defe(0x118)]=_0x27a508,this['_userService']=_0x576c22,this[_0x12defe(0xd9)]=_0x28db77,this['_injector']=_0x1180f6;}async['addComment'](_0x2610cc){const _0x30c68b=_0x2d5350;var _0x4071d5,_0x4a7861;const {parentId:_0x324571,unitId:_0x17f5e0,text:_0x81fbea,threadId:_0x151e10}=_0x2610cc,_0x2e0da6=(_0x4a7861=(_0x4071d5=_0x81fbea[_0x30c68b(0xe3)])==null?void 0x0:_0x4071d5[_0x30c68b(0xf2)](_0x43d350=>_0x43d350[_0x30c68b(0x109)]===_0x27a3d3[_0x30c68b(0xf1)])[_0x30c68b(0xfb)](_0x6c75c5=>_0x6c75c5[_0x30c68b(0xf0)]))!=null?_0x4a7861:[],_0x1a50a4=JSON[_0x30c68b(0x11a)](_0x81fbea),_0x55db86=(await this[_0x30c68b(0xd9)]['requireSession'](_0x17f5e0))[_0x30c68b(0x125)]();if(_0x324571){const _0x580ad2={'memberId':_0x55db86,'unitId':_0x17f5e0,'content':_0x1a50a4,'mention':_0x2e0da6,'threadId':_0x151e10},_0x2d770c=(await this['_httpService']['post'](_0x30c68b(0x106)+_0x17f5e0+'/reply',{'body':_0x580ad2}))[_0x30c68b(0x103)][_0x30c68b(0xd1)];return{..._0x2610cc,'id':_0x2d770c[_0x30c68b(0xe7)],'dT':_0x4b79be(+_0x2d770c[_0x30c68b(0xf6)])[_0x30c68b(0xff)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x2d770c[_0x30c68b(0x10a)]};}else{const _0xceb580={'memberId':_0x55db86,'unitId':_0x17f5e0,'content':_0x1a50a4,'mention':_0x2e0da6},_0x168c13=await this['_httpService'][_0x30c68b(0xd3)](_0x30c68b(0x106)+_0x17f5e0+_0x30c68b(0x127),{'body':_0xceb580});return X(_0x168c13['body']['comment'],_0x2610cc);}}async[_0x2d5350(0xd4)](_0x47e27d){const _0x85ce6a=_0x2d5350;var _0x31e541,_0x49498e;const {text:_0x1951c8,unitId:_0x195b3f}=_0x47e27d,_0x2f6d65=(_0x49498e=(_0x31e541=_0x1951c8['customRanges'])==null?void 0x0:_0x31e541[_0x85ce6a(0xf2)](_0x111feb=>_0x111feb['rangeType']===_0x27a3d3[_0x85ce6a(0xf1)])[_0x85ce6a(0xfb)](_0x35fdd7=>_0x35fdd7['rangeId']))!=null?_0x49498e:[],_0x713cf1=JSON[_0x85ce6a(0x11a)](_0x1951c8),_0x4fc30d=_0x47e27d[_0x85ce6a(0xcc)],_0x1e5033=_0x47e27d['id'],_0x487d62={'memberId':(await this[_0x85ce6a(0xd9)][_0x85ce6a(0x105)](_0x195b3f))[_0x85ce6a(0x125)](),'unitId':_0x195b3f,'threadId':_0x4fc30d,'mention':_0x2f6d65,'content':_0x713cf1,'replyId':_0x1e5033},_0x236b07=await this[_0x85ce6a(0x118)][_0x85ce6a(0xd3)](_0x85ce6a(0x106)+_0x195b3f+_0x85ce6a(0x102),{'body':_0x487d62});return!_0x236b07['body'][_0x85ce6a(0xfd)]||_0x236b07[_0x85ce6a(0x103)]['error'][_0x85ce6a(0x121)]===0x1;}async[_0x2d5350(0xf4)](_0x675f29){const _0x43c343=_0x2d5350,{unitId:_0x27a660}=_0x675f29,_0x448c66=_0x675f29[_0x43c343(0xcc)],_0x14a711={'memberId':this[_0x43c343(0xf5)][_0x43c343(0x101)]()['userID'],'unitId':_0x27a660,'threadId':_0x448c66,'solved':_0x675f29['resolved']?I['Solved']:I['OpenOrReOpen']},_0x282023=await this[_0x43c343(0x118)][_0x43c343(0xd3)]('/universer-api/comment/unit/'+_0x27a660+_0x43c343(0x111),{'body':_0x14a711});return!_0x282023[_0x43c343(0x103)][_0x43c343(0xfd)]||_0x282023[_0x43c343(0x103)][_0x43c343(0xfd)]['code']===0x1;}async[_0x2d5350(0x10c)](_0x3776f5,_0x3ba336,_0x1779c9,_0x5ae9b3){const _0xbafe49=_0x2d5350,_0x3d9aad={'memberId':(await this['_sessionService'][_0xbafe49(0x105)](_0x3776f5))[_0xbafe49(0x125)](),'threadId':_0x1779c9,'replyId':_0x5ae9b3,'unitId':_0x3776f5},_0x2d252c=await this['_httpService']['post'](_0xbafe49(0x106)+_0x3776f5+'/delete',{'body':_0x3d9aad});return!_0x2d252c[_0xbafe49(0x103)][_0xbafe49(0xfd)]||_0x2d252c[_0xbafe49(0x103)][_0xbafe49(0xfd)][_0xbafe49(0x121)]===0x1;}async[_0x2d5350(0x115)](_0x5bc84b,_0x124577,_0x144626){const _0x32ed26=_0x2d5350,_0x5c63f8={'unitId':_0x5bc84b,'threadId':_0x144626},_0x28f4ec=await this[_0x32ed26(0x118)][_0x32ed26(0xd3)]('/universer-api/comment/unit/'+_0x5bc84b+_0x32ed26(0xe6),{'body':_0x5c63f8}),_0x49ddfc=_0x144626[_0x32ed26(0xfb)](_0x1fab8e=>ee(_0x28f4ec['body'][_0x32ed26(0x110)][_0x1fab8e],_0x5bc84b,_0x124577))['filter'](Boolean);return Object['values'](_0x28f4ec[_0x32ed26(0x103)][_0x32ed26(0xdc)])[_0x32ed26(0x117)](_0xd5d441=>{const _0x1af91d=_0x32ed26;this[_0x1af91d(0xf5)][_0x1af91d(0xe9)](_0xd5d441);}),_0x49ddfc;}['saveCommentToSnapshot'](_0x172d15){const _0x52eb70=_0x2d5350;return{'id':_0x172d15['id'],'threadId':_0x172d15['threadId'],'ref':_0x172d15[_0x52eb70(0x10e)]};}};f=Q([_(0x0,_0x82e101(_0x16aa01)),_(0x1,_0x82e101(_0x48e2a5)),_(0x2,_0x82e101(_0x242f6a)),_(0x3,_0x82e101(_0x2de2a0))],f);var re=Object[_0x2d5350(0xfe)],te=(_0x161bb3,_0x4e6a7b,_0x316e49,_0x3b8236)=>{const _0x99020e=_0x2d5350;for(var _0x38d524=_0x3b8236>0x1?void 0x0:_0x3b8236?re(_0x4e6a7b,_0x316e49):_0x4e6a7b,_0x39255b=_0x161bb3[_0x99020e(0xf9)]-0x1,_0x1341c9;_0x39255b>=0x0;_0x39255b--)(_0x1341c9=_0x161bb3[_0x39255b])&&(_0x38d524=_0x1341c9(_0x38d524)||_0x38d524);return _0x38d524;},N=(_0x31621c,_0xad4c0f)=>(_0x2024d5,_0x394031)=>_0xad4c0f(_0x2024d5,_0x394031,_0x31621c);let g=class extends _0xd7e540{constructor(_0x2e1c38,_0x31f48d){const _0x61a7bc=_0x2d5350;super(),this[_0x61a7bc(0x123)]=_0x2e1c38,this[_0x61a7bc(0x126)]=_0x31f48d,this[_0x61a7bc(0xef)]();}['_initDataSource'](){const _0x99b2e2=_0x2d5350;this[_0x99b2e2(0x123)][_0x99b2e2(0xd7)]=this[_0x99b2e2(0x126)],this[_0x99b2e2(0x123)]['syncUpdateMutationToColla']=!0x1;}};g=te([N(0x0,_0x4fae4e),N(0x1,_0x82e101(f))],g);var se=Object[_0x2d5350(0xd0)],oe=Object['getOwnPropertyDescriptor'],ne=(_0x1d8100,_0xb2340,_0x542ef7)=>_0xb2340 in _0x1d8100?se(_0x1d8100,_0xb2340,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x542ef7}):_0x1d8100[_0xb2340]=_0x542ef7,ie=(_0x42f1d8,_0x4548d8,_0x54b53c,_0x4c2c1f)=>{for(var _0x5dbc5d=_0x4c2c1f>0x1?void 0x0:_0x4c2c1f?oe(_0x4548d8,_0x54b53c):_0x4548d8,_0xdae79f=_0x42f1d8['length']-0x1,_0x2c1c90;_0xdae79f>=0x0;_0xdae79f--)(_0x2c1c90=_0x42f1d8[_0xdae79f])&&(_0x5dbc5d=_0x2c1c90(_0x5dbc5d)||_0x5dbc5d);return _0x5dbc5d;},w=(_0xbd0b62,_0x57b92e)=>(_0x2f69b6,_0x5c7479)=>_0x57b92e(_0x2f69b6,_0x5c7479,_0xbd0b62),$=(_0x52dd39,_0x1a4a83,_0x1fdefe)=>ne(_0x52dd39,typeof _0x1a4a83!=_0x2d5350(0x104)?_0x1a4a83+'':_0x1a4a83,_0x1fdefe);let b=class extends _0x419499{constructor(_0x418a10=M,_0x4b4bbc,_0x16863c){const _0x421808=_0x2d5350;super(),this['_config']=_0x418a10,this[_0x421808(0x11f)]=_0x4b4bbc,this[_0x421808(0x11d)]=_0x16863c;const {..._0x5da4ff}=_0x4682c7({},M,this[_0x421808(0xde)]);this['_configService']['setConfig'](z,_0x5da4ff);}[_0x2d5350(0xcf)](){const _0x173f0d=_0x2d5350;[[f],[g],[S]][_0x173f0d(0x117)](_0x43f6e8=>{const _0x41eb1d=_0x173f0d;this['_injector'][_0x41eb1d(0xe4)](_0x43f6e8);});}[_0x2d5350(0x107)](){const _0x51c706=_0x2d5350;this[_0x51c706(0x11f)][_0x51c706(0x113)](g),this[_0x51c706(0x11f)]['get'](S);}};$(b,_0x2d5350(0xfa),W),$(b,'type',_0x5b3885[_0x2d5350(0xca)]),b=ie([_0xfde2f5(_0x55cac6,_0x1f9298,_0x3137d0),w(0x1,_0x82e101(_0x2de2a0)),w(0x2,_0x14ce99)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x1d302e=_0x1e2f;(function(_0x1fc926,_0x3b0f4c){const _0x3318d7=_0x1e2f,_0x341fd4=_0x1fc926();while(!![]){try{const _0x196724=-parseInt(_0x3318d7(0x144))/0x1+-parseInt(_0x3318d7(0x165))/0x2+-parseInt(_0x3318d7(0x19a))/0x3+-parseInt(_0x3318d7(0x182))/0x4*(-parseInt(_0x3318d7(0x14d))/0x5)+-parseInt(_0x3318d7(0x19e))/0x6+-parseInt(_0x3318d7(0x187))/0x7*(-parseInt(_0x3318d7(0x184))/0x8)+parseInt(_0x3318d7(0x14e))/0x9;if(_0x196724===_0x3b0f4c)break;else _0x341fd4['push'](_0x341fd4['shift']());}catch(_0x1c55eb){_0x341fd4['push'](_0x341fd4['shift']());}}}(_0x13fb,0x86d7b));import{CommentService as _0x4e0010,CollaborationSessionService as _0x220aff,UniverCollaborationClientPlugin as _0x1dcdc4}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x4d8b32}from'@univerjs-pro/license';import{dayjs as _0x1237a9,UserManagerService as _0x330e6e,Inject as _0x768f6c,Injector as _0x3c3e98,Disposable as _0x6596eb,CustomRangeType as _0x1139a9,UniverInstanceType as _0x1d77ae,DependentOn as _0x1a2e8d,IConfigService as _0x2bfd3c,Plugin as _0x14328e,merge as _0x7f9811}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x1de634}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x32fa12,IThreadCommentDataSourceService as _0x57ecc3}from'@univerjs/thread-comment';import{bufferTime as _0x4f0216}from'rxjs';import{HTTPService as _0x130cb1}from'@univerjs/network';const W='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x5e9b61=>(_0x5e9b61[_0x5e9b61[_0x1d302e(0x171)]=0x0]=_0x1d302e(0x171),_0x5e9b61[_0x5e9b61[_0x1d302e(0x176)]=0x1]=_0x1d302e(0x176),_0x5e9b61[_0x5e9b61[_0x1d302e(0x157)]=-0x1]=_0x1d302e(0x157),_0x5e9b61))(I||{}),v=(_0x4f044f=>(_0x4f044f[_0x4f044f[_0x1d302e(0x174)]=0x0]=_0x1d302e(0x174),_0x4f044f[_0x4f044f[_0x1d302e(0x156)]=0x1]=_0x1d302e(0x156),_0x4f044f[_0x4f044f[_0x1d302e(0x190)]=0x2]='Reply',_0x4f044f[_0x4f044f['Edit']=0x3]=_0x1d302e(0x168),_0x4f044f[_0x4f044f[_0x1d302e(0x16e)]=0x4]=_0x1d302e(0x16e),_0x4f044f[_0x4f044f[_0x1d302e(0x16a)]=0x5]=_0x1d302e(0x16a),_0x4f044f[_0x4f044f[_0x1d302e(0x157)]=-0x1]=_0x1d302e(0x157),_0x4f044f))(v||{});const D=_0x529f43=>_0x1237a9(new Date(+_0x529f43))['format']('YYYY/MM/DD\x20HH:mm'),B=async(_0x228784,_0x32208a)=>{const _0x4e43c9=_0x1d302e,_0x51ac74=_0x228784[_0x4e43c9(0x199)](_0x330e6e),_0x177b6e=_0x228784[_0x4e43c9(0x199)](_0x130cb1);_0x32208a[_0x4e43c9(0x150)](_0x385a8d=>{const _0xa7b9eb=_0x4e43c9;_0x51ac74[_0xa7b9eb(0x170)](_0x385a8d)&&_0x32208a[_0xa7b9eb(0x195)](_0x385a8d);}),_0x32208a[_0x4e43c9(0x149)]&&(await _0x177b6e['get']('/universer-api/user/list',{'params':{'userIDs':[..._0x32208a]}}))[_0x4e43c9(0x175)]['users'][_0x4e43c9(0x150)](_0x27d7d6=>{_0x27d7d6&&_0x51ac74['addUser'](_0x27d7d6);});};function _0x1e2f(_0x81746a,_0x592a1b){const _0x13fb74=_0x13fb();return _0x1e2f=function(_0x1e2f6b,_0xfd2e08){_0x1e2f6b=_0x1e2f6b-0x144;let _0x99b005=_0x13fb74[_0x1e2f6b];return _0x99b005;},_0x1e2f(_0x81746a,_0x592a1b);}var K=Object[_0x1d302e(0x16d)],V=(_0x5b5d0f,_0x5ef976,_0x23367e,_0xb7ebe7)=>{const _0x4ba3da=_0x1d302e;for(var _0x24a596=_0xb7ebe7>0x1?void 0x0:_0xb7ebe7?K(_0x5ef976,_0x23367e):_0x5ef976,_0x4d3aa6=_0x5b5d0f[_0x4ba3da(0x148)]-0x1,_0x198c96;_0x4d3aa6>=0x0;_0x4d3aa6--)(_0x198c96=_0x5b5d0f[_0x4d3aa6])&&(_0x24a596=_0x198c96(_0x24a596)||_0x24a596);return _0x24a596;},p=(_0x243097,_0x10e5b8)=>(_0x7985,_0x59d60c)=>_0x10e5b8(_0x7985,_0x59d60c,_0x243097);let S=class extends _0x6596eb{constructor(_0x1d252e,_0x19ddb4,_0x3f97d8,_0x16b8ba){const _0x3b6b8c=_0x1d302e;super(),this['_commentService']=_0x1d252e,this[_0x3b6b8c(0x169)]=_0x19ddb4,this['_userService']=_0x3f97d8,this['_injector']=_0x16b8ba,this[_0x3b6b8c(0x16b)](),this[_0x3b6b8c(0x146)]();}[_0x1d302e(0x146)](){const _0x56684d=_0x1d302e;this[_0x56684d(0x14f)](this[_0x56684d(0x169)]['commentUpdate$'][_0x56684d(0x18c)](_0x4f0216(0x10))[_0x56684d(0x197)](_0x145531=>{const _0x3a897d=_0x56684d,_0x4732e8=new Set();_0x145531[_0x3a897d(0x150)](_0x7f31bc=>{const _0xe63097=_0x3a897d;switch(_0x7f31bc[_0xe63097(0x145)]){case _0xe63097(0x15f):{const _0x1b44bb=_0x7f31bc[_0xe63097(0x17c)][_0xe63097(0x180)];_0x4732e8[_0xe63097(0x15f)](_0x1b44bb);break;}}}),B(this[_0x3a897d(0x17f)],_0x4732e8);}));}[_0x1d302e(0x16b)](){const _0x5527fe=_0x1d302e;this[_0x5527fe(0x14f)](this[_0x5527fe(0x159)][_0x5527fe(0x14b)][_0x5527fe(0x197)](async _0x24f079=>{const _0x5c26fe=_0x5527fe;var _0x3522d3,_0x382a0c,_0x13897c,_0x458fea;const _0x2e3285=(_0x3522d3=this['_threadCommentModel'][_0x5c26fe(0x158)](_0x24f079['unitId'])[_0x5c26fe(0x16f)](_0x10fb90=>_0x10fb90['threadId']===_0x24f079['threadId']))==null?void 0x0:_0x3522d3['root'];if(!_0x2e3285)return;const {unitId:_0x2eb054,subUnitId:_0x3cb463}=_0x2e3285;switch(_0x24f079[_0x5c26fe(0x194)]&&this[_0x5c26fe(0x186)]['addUser'](_0x24f079[_0x5c26fe(0x194)]),_0x24f079[_0x5c26fe(0x145)]){case v[_0x5c26fe(0x156)]:break;case v[_0x5c26fe(0x190)]:{this[_0x5c26fe(0x169)]['addComment'](_0x2eb054,_0x3cb463,{'unitId':_0x2eb054,'subUnitId':_0x3cb463,'ref':'','id':_0x24f079[_0x5c26fe(0x163)],'dT':D(+_0x24f079[_0x5c26fe(0x181)]),'threadId':_0x24f079[_0x5c26fe(0x18f)],'personId':(_0x13897c=(_0x382a0c=_0x24f079[_0x5c26fe(0x194)])==null?void 0x0:_0x382a0c[_0x5c26fe(0x1a0)])!=null?_0x13897c:_0x24f079[_0x5c26fe(0x164)],'text':JSON['parse'](_0x24f079['content']),'parentId':_0x2e3285['id']});break;}case v['Delete']:{const _0x135494=this[_0x5c26fe(0x169)][_0x5c26fe(0x17e)](_0x2eb054,_0x3cb463,_0x24f079[_0x5c26fe(0x163)]);_0x135494&&_0x135494[_0x5c26fe(0x155)]&&this[_0x5c26fe(0x169)][_0x5c26fe(0x16c)](_0x2eb054,_0x3cb463,_0x24f079[_0x5c26fe(0x163)]);break;}case v[_0x5c26fe(0x168)]:{this['_threadCommentModel']['updateComment'](_0x2eb054,_0x3cb463,{'commentId':_0x24f079[_0x5c26fe(0x163)],'text':JSON['parse'](_0x24f079['content'])});break;}case v[_0x5c26fe(0x16a)]:{const _0x2b6c60=(_0x458fea=this[_0x5c26fe(0x169)][_0x5c26fe(0x158)](_0x24f079[_0x5c26fe(0x188)])[_0x5c26fe(0x16f)](_0x27b965=>_0x27b965['threadId']===_0x24f079['threadId']))==null?void 0x0:_0x458fea['root'];_0x2b6c60&&this['_threadCommentModel']['resolveComment'](_0x2eb054,_0x3cb463,_0x2b6c60['id'],_0x24f079[_0x5c26fe(0x147)]===I[_0x5c26fe(0x176)]);break;}}}));}};S=V([p(0x0,_0x768f6c(_0x4e0010)),p(0x1,_0x768f6c(_0x32fa12)),p(0x2,_0x768f6c(_0x330e6e)),p(0x3,_0x768f6c(_0x3c3e98))],S);const z=_0x1d302e(0x15a),M={};var k=Object[_0x1d302e(0x16d)],Q=(_0x3f6b5d,_0x30ec78,_0x5124d9,_0xe07f02)=>{const _0x418084=_0x1d302e;for(var _0x565ffe=_0xe07f02>0x1?void 0x0:_0xe07f02?k(_0x30ec78,_0x5124d9):_0x30ec78,_0x48a9fa=_0x3f6b5d[_0x418084(0x148)]-0x1,_0xba9bca;_0x48a9fa>=0x0;_0x48a9fa--)(_0xba9bca=_0x3f6b5d[_0x48a9fa])&&(_0x565ffe=_0xba9bca(_0x565ffe)||_0x565ffe);return _0x565ffe;},_=(_0x20c738,_0x53225d)=>(_0x3fcb31,_0x40ada7)=>_0x53225d(_0x3fcb31,_0x40ada7,_0x20c738);function X(_0x623bb5,_0x392986){const _0x4d7fef=_0x1d302e,_0x39685a=_0x623bb5[_0x4d7fef(0x15b)][0x0];return{..._0x392986,'id':_0x39685a[_0x4d7fef(0x163)],'resolved':_0x623bb5['solved']===0x1,'dT':D(_0x39685a['createTimestamp']),'personId':_0x39685a['userId'],'threadId':_0x39685a[_0x4d7fef(0x18f)]};}function ee(_0x421e28,_0x140d4a,_0xe3ba42){const _0x2241e8=_0x1d302e;var _0x28c1cb,_0x5ec6a0;if(((_0x5ec6a0=(_0x28c1cb=_0x421e28==null?void 0x0:_0x421e28[_0x2241e8(0x15b)])==null?void 0x0:_0x28c1cb['length'])!=null?_0x5ec6a0:0x0)>0x0){const _0x7efdc2=(_0x1225c0,_0x2d0853)=>({'id':_0x1225c0[_0x2241e8(0x163)],'threadId':_0x1225c0[_0x2241e8(0x18f)],'dT':D(_0x1225c0['createTimestamp']),'personId':_0x1225c0[_0x2241e8(0x164)],'resolved':_0x421e28['solved']===I[_0x2241e8(0x176)],'unitId':_0x140d4a,'subUnitId':_0xe3ba42,'text':JSON[_0x2241e8(0x177)](_0x1225c0[_0x2241e8(0x191)]),'parentId':_0x2d0853}),_0x1d572a=_0x7efdc2(_0x421e28['replies'][0x0]);return{..._0x1d572a,'children':_0x421e28[_0x2241e8(0x15b)]['slice'](0x1)[_0x2241e8(0x183)](_0x21ab79=>_0x7efdc2(_0x21ab79,_0x1d572a['id']))};}return null;}let f=class{constructor(_0x1ffbb7,_0xb34232,_0x467f1f,_0x1f695a){const _0x5e7819=_0x1d302e;this['_httpService']=_0x1ffbb7,this[_0x5e7819(0x186)]=_0xb34232,this['_sessionService']=_0x467f1f,this['_injector']=_0x1f695a;}async[_0x1d302e(0x178)](_0x36c8c9){const _0x44fba1=_0x1d302e;var _0x4fcbff,_0x3c3e6e;const {parentId:_0xa76e45,unitId:_0x2ef2dc,text:_0x5889ee,threadId:_0xc8ac93}=_0x36c8c9,_0x5df288=(_0x3c3e6e=(_0x4fcbff=_0x5889ee['customRanges'])==null?void 0x0:_0x4fcbff[_0x44fba1(0x14a)](_0x9e57b8=>_0x9e57b8[_0x44fba1(0x19b)]===_0x1139a9[_0x44fba1(0x15c)])[_0x44fba1(0x183)](_0x2e23fa=>_0x2e23fa['rangeId']))!=null?_0x3c3e6e:[],_0x1c0d34=JSON[_0x44fba1(0x14c)](_0x5889ee),_0x2207a4=(await this[_0x44fba1(0x17b)]['requireSession'](_0x2ef2dc))[_0x44fba1(0x151)]();if(_0xa76e45){const _0x614378={'memberId':_0x2207a4,'unitId':_0x2ef2dc,'content':_0x1c0d34,'mention':_0x5df288,'threadId':_0xc8ac93},_0x3d9d71=(await this[_0x44fba1(0x18d)][_0x44fba1(0x152)](_0x44fba1(0x198)+_0x2ef2dc+_0x44fba1(0x189),{'body':_0x614378}))[_0x44fba1(0x175)]['reply'];return{..._0x36c8c9,'id':_0x3d9d71[_0x44fba1(0x163)],'dT':_0x1237a9(+_0x3d9d71[_0x44fba1(0x181)])['format'](_0x44fba1(0x179)),'personId':_0x3d9d71['userId']};}else{const _0x3e1269={'memberId':_0x2207a4,'unitId':_0x2ef2dc,'content':_0x1c0d34,'mention':_0x5df288},_0x482aa2=await this[_0x44fba1(0x18d)]['post'](_0x44fba1(0x198)+_0x2ef2dc+'/add',{'body':_0x3e1269});return X(_0x482aa2[_0x44fba1(0x175)]['comment'],_0x36c8c9);}}async['updateComment'](_0x1c763a){const _0xf12c=_0x1d302e;var _0x551dd1,_0x13b02a;const {text:_0x1fb226,unitId:_0x5c645e}=_0x1c763a,_0x35f3c0=(_0x13b02a=(_0x551dd1=_0x1fb226['customRanges'])==null?void 0x0:_0x551dd1['filter'](_0x4c845e=>_0x4c845e[_0xf12c(0x19b)]===_0x1139a9[_0xf12c(0x15c)])[_0xf12c(0x183)](_0x1d344a=>_0x1d344a['rangeId']))!=null?_0x13b02a:[],_0x543678=JSON[_0xf12c(0x14c)](_0x1fb226),_0x49c028=_0x1c763a[_0xf12c(0x18f)],_0x376635=_0x1c763a['id'],_0x5e12bd={'memberId':(await this[_0xf12c(0x17b)][_0xf12c(0x192)](_0x5c645e))[_0xf12c(0x151)](),'unitId':_0x5c645e,'threadId':_0x49c028,'mention':_0x35f3c0,'content':_0x543678,'replyId':_0x376635},_0x1c7479=await this[_0xf12c(0x18d)]['post'](_0xf12c(0x198)+_0x5c645e+_0xf12c(0x15e),{'body':_0x5e12bd});return!_0x1c7479['body']['error']||_0x1c7479[_0xf12c(0x175)][_0xf12c(0x173)][_0xf12c(0x161)]===0x1;}async[_0x1d302e(0x15d)](_0x47e32d){const _0x5dd3ff=_0x1d302e,{unitId:_0x26640e}=_0x47e32d,_0x39e6c7=_0x47e32d['threadId'],_0x273242={'memberId':this['_userService']['getCurrentUser']()[_0x5dd3ff(0x1a0)],'unitId':_0x26640e,'threadId':_0x39e6c7,'solved':_0x47e32d[_0x5dd3ff(0x19f)]?I[_0x5dd3ff(0x176)]:I[_0x5dd3ff(0x171)]},_0x2c8223=await this['_httpService'][_0x5dd3ff(0x152)](_0x5dd3ff(0x198)+_0x26640e+_0x5dd3ff(0x18a),{'body':_0x273242});return!_0x2c8223['body']['error']||_0x2c8223[_0x5dd3ff(0x175)][_0x5dd3ff(0x173)][_0x5dd3ff(0x161)]===0x1;}async[_0x1d302e(0x16c)](_0x43c5a3,_0x5dd986,_0x1c1e4d,_0x572ebe){const _0x5e668c=_0x1d302e,_0x7d82ad={'memberId':(await this[_0x5e668c(0x17b)][_0x5e668c(0x192)](_0x43c5a3))[_0x5e668c(0x151)](),'threadId':_0x1c1e4d,'replyId':_0x572ebe,'unitId':_0x43c5a3},_0x5116df=await this['_httpService'][_0x5e668c(0x152)]('/universer-api/comment/unit/'+_0x43c5a3+_0x5e668c(0x19c),{'body':_0x7d82ad});return!_0x5116df['body'][_0x5e668c(0x173)]||_0x5116df[_0x5e668c(0x175)][_0x5e668c(0x173)][_0x5e668c(0x161)]===0x1;}async[_0x1d302e(0x166)](_0x510ca9,_0x197e9d,_0x18fbda){const _0x4cd19f=_0x1d302e,_0x3483e4={'unitId':_0x510ca9,'threadId':_0x18fbda},_0x4e1716=await this[_0x4cd19f(0x18d)][_0x4cd19f(0x152)]('/universer-api/comment/unit/'+_0x510ca9+_0x4cd19f(0x1a1),{'body':_0x3483e4}),_0x2295f2=_0x18fbda[_0x4cd19f(0x183)](_0x13ed2e=>ee(_0x4e1716[_0x4cd19f(0x175)]['comments'][_0x13ed2e],_0x510ca9,_0x197e9d))['filter'](Boolean);return Object['values'](_0x4e1716[_0x4cd19f(0x175)]['users'])[_0x4cd19f(0x150)](_0x4fad1b=>{const _0x27da98=_0x4cd19f;this[_0x27da98(0x186)][_0x27da98(0x160)](_0x4fad1b);}),_0x2295f2;}[_0x1d302e(0x172)](_0x2095b6){const _0x452969=_0x1d302e;return{'id':_0x2095b6['id'],'threadId':_0x2095b6['threadId'],'ref':_0x2095b6[_0x452969(0x185)]};}};f=Q([_(0x0,_0x768f6c(_0x130cb1)),_(0x1,_0x768f6c(_0x330e6e)),_(0x2,_0x768f6c(_0x220aff)),_(0x3,_0x768f6c(_0x3c3e98))],f);var re=Object[_0x1d302e(0x16d)],te=(_0x2e7b,_0x2df40c,_0x4f1bec,_0x3105b4)=>{const _0x535f40=_0x1d302e;for(var _0x52c833=_0x3105b4>0x1?void 0x0:_0x3105b4?re(_0x2df40c,_0x4f1bec):_0x2df40c,_0xd7a2fc=_0x2e7b[_0x535f40(0x148)]-0x1,_0x48c2cf;_0xd7a2fc>=0x0;_0xd7a2fc--)(_0x48c2cf=_0x2e7b[_0xd7a2fc])&&(_0x52c833=_0x48c2cf(_0x52c833)||_0x52c833);return _0x52c833;},N=(_0x3e0918,_0x14c97d)=>(_0x224dc6,_0xe4ab1)=>_0x14c97d(_0x224dc6,_0xe4ab1,_0x3e0918);let g=class extends _0x6596eb{constructor(_0x1a0f71,_0x3db004){const _0x36d92c=_0x1d302e;super(),this[_0x36d92c(0x18e)]=_0x1a0f71,this[_0x36d92c(0x17a)]=_0x3db004,this[_0x36d92c(0x162)]();}[_0x1d302e(0x162)](){const _0x35becd=_0x1d302e;this[_0x35becd(0x18e)][_0x35becd(0x19d)]=this[_0x35becd(0x17a)],this['_threadCommentDataSourceService'][_0x35becd(0x17d)]=!0x1;}};g=te([N(0x0,_0x57ecc3),N(0x1,_0x768f6c(f))],g);function _0x13fb(){const _0x44903c=['userId','1903138nnxJMP','listComments','pluginName','Edit','_threadCommentModel','Solve','_init','deleteComment','getOwnPropertyDescriptor','Delete','find','getUser','OpenOrReOpen','saveCommentToSnapshot','error','Unknown','body','Solved','parse','addComment','YYYY/MM/DD\x20HH:mm','_threadCommentDataSource','_sessionService','payload','syncUpdateMutationToColla','getComment','_injector','personId','createTimestamp','4ePWKUE','map','4365640WalMVK','ref','_userService','7VGzCCS','unitId','/reply','/solved','setConfig','pipe','_httpService','_threadCommentDataSourceService','threadId','Reply','content','requireSession','onStarting','user','delete','symbol','subscribe','/universer-api/comment/unit/','get','884583NvQggC','rangeType','/delete','dataSource','5465184QpaTRI','resolved','userID','/list','68712eysXIS','type','_initUserSync','solved','length','size','filter','commentUpdate$','stringify','1513390UGPpid','17369442DcosuM','disposeWithMe','forEach','getMemberID','post','_configService','defineProperty','parentId','Add','UNRECOGNIZED','getUnit','_commentService','thread-comment-data-source.config','replies','COMMENT','resolveComment','/edit','add','addUser','code','_initDataSource','replyId'];_0x13fb=function(){return _0x44903c;};return _0x13fb();}var se=Object[_0x1d302e(0x154)],oe=Object[_0x1d302e(0x16d)],ne=(_0xd27e82,_0x432fba,_0x36085e)=>_0x432fba in _0xd27e82?se(_0xd27e82,_0x432fba,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x36085e}):_0xd27e82[_0x432fba]=_0x36085e,ie=(_0x5a8c6b,_0x15b351,_0x5145fd,_0x5e0fce)=>{const _0x4e8d47=_0x1d302e;for(var _0x1000b8=_0x5e0fce>0x1?void 0x0:_0x5e0fce?oe(_0x15b351,_0x5145fd):_0x15b351,_0x3377cf=_0x5a8c6b[_0x4e8d47(0x148)]-0x1,_0x14ad20;_0x3377cf>=0x0;_0x3377cf--)(_0x14ad20=_0x5a8c6b[_0x3377cf])&&(_0x1000b8=_0x14ad20(_0x1000b8)||_0x1000b8);return _0x1000b8;},w=(_0x209a82,_0x354ee0)=>(_0x33b192,_0x234dc8)=>_0x354ee0(_0x33b192,_0x234dc8,_0x209a82),$=(_0x4cdacf,_0x5faeb4,_0x5a2e16)=>ne(_0x4cdacf,typeof _0x5faeb4!=_0x1d302e(0x196)?_0x5faeb4+'':_0x5faeb4,_0x5a2e16);let b=class extends _0x14328e{constructor(_0x476217=M,_0x32d012,_0x14ec37){const _0x547139=_0x1d302e;super(),this['_config']=_0x476217,this[_0x547139(0x17f)]=_0x32d012,this['_configService']=_0x14ec37;const {..._0xf8bb6c}=_0x7f9811({},M,this['_config']);this[_0x547139(0x153)][_0x547139(0x18b)](z,_0xf8bb6c);}[_0x1d302e(0x193)](){const _0x3dc5d3=_0x1d302e;[[f],[g],[S]][_0x3dc5d3(0x150)](_0xf7d2ce=>{const _0x271ffa=_0x3dc5d3;this[_0x271ffa(0x17f)]['add'](_0xf7d2ce);});}['onReady'](){const _0x2af4d0=_0x1d302e;this[_0x2af4d0(0x17f)]['get'](g),this[_0x2af4d0(0x17f)][_0x2af4d0(0x199)](S);}};$(b,_0x1d302e(0x167),W),$(b,_0x1d302e(0x145),_0x1d77ae['UNIVER_UNKNOWN']),b=ie([_0x1a2e8d(_0x1de634,_0x1dcdc4,_0x4d8b32),w(0x1,_0x768f6c(_0x3c3e98)),w(0x2,_0x2bfd3c)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x2d5350=_0x5b24;function _0x5282(){const _0x322b26=['format','OpenOrReOpen','getCurrentUser','/edit','body','symbol','requireSession','/universer-api/comment/unit/','onReady','size','rangeType','userId','Reply','deleteComment','user','ref','getComment','comments','/solved','31920240NEnvaB','get','Unknown','listComments','content','forEach','_httpService','1763512CQnKvL','stringify','parse','root','_configService','replies','_injector','Add','code','Delete','_threadCommentDataSourceService','Solve','getMemberID','_threadCommentDataSource','/add','Solved','_commentService','UNIVER_UNKNOWN','6986168DhicmD','threadId','solved','5801478JeRctW','onStarting','defineProperty','reply','delete','post','updateComment','userID','find','dataSource','subscribe','_sessionService','getUser','disposeWithMe','users','9ZHbwiz','_config','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','_threadCommentModel','Edit','getUnit','customRanges','add','1208Pbenet','/list','replyId','_initUserSync','addUser','unitId','5638824XeUNfj','commentUpdate$','1IrWvpq','2885427rweuQJ','_initDataSource','rangeId','COMMENT','filter','type','resolveComment','_userService','createTimestamp','13085twpSKB','UNRECOGNIZED','length','pluginName','map','pipe','error','getOwnPropertyDescriptor'];_0x5282=function(){return _0x322b26;};return _0x5282();}(function(_0x4f49c9,_0x1d89f0){const _0xa95a08=_0x5b24,_0x3a6338=_0x4f49c9();while(!![]){try{const _0x5300d0=parseInt(_0xa95a08(0xed))/0x1*(parseInt(_0xa95a08(0x119))/0x2)+parseInt(_0xa95a08(0xee))/0x3+parseInt(_0xa95a08(0xe5))/0x4*(parseInt(_0xa95a08(0xf7))/0x5)+parseInt(_0xa95a08(0xce))/0x6+parseInt(_0xa95a08(0xcb))/0x7+parseInt(_0xa95a08(0xeb))/0x8*(-parseInt(_0xa95a08(0xdd))/0x9)+-parseInt(_0xa95a08(0x112))/0xa;if(_0x5300d0===_0x1d89f0)break;else _0x3a6338['push'](_0x3a6338['shift']());}catch(_0xee8e77){_0x3a6338['push'](_0x3a6338['shift']());}}}(_0x5282,0xab607));import{CommentService as _0x5646f3,CollaborationSessionService as _0x242f6a,UniverCollaborationClientPlugin as _0x1f9298}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x3137d0}from'@univerjs-pro/license';import{dayjs as _0x4b79be,UserManagerService as _0x48e2a5,Inject as _0x82e101,Injector as _0x2de2a0,Disposable as _0xd7e540,CustomRangeType as _0x27a3d3,UniverInstanceType as _0x5b3885,DependentOn as _0xfde2f5,IConfigService as _0x14ce99,Plugin as _0x419499,merge as _0x4682c7}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x55cac6}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x1ba485,IThreadCommentDataSourceService as _0x4fae4e}from'@univerjs/thread-comment';import{bufferTime as _0x1ee30f}from'rxjs';function _0x5b24(_0x1cdd0e,_0x5af263){const _0x5282bc=_0x5282();return _0x5b24=function(_0x5b240b,_0x2b21c8){_0x5b240b=_0x5b240b-0xc8;let _0x1acb8b=_0x5282bc[_0x5b240b];return _0x1acb8b;},_0x5b24(_0x1cdd0e,_0x5af263);}import{HTTPService as _0x16aa01}from'@univerjs/network';const W=_0x2d5350(0xdf);var I=(_0x3024b4=>(_0x3024b4[_0x3024b4[_0x2d5350(0x100)]=0x0]='OpenOrReOpen',_0x3024b4[_0x3024b4['Solved']=0x1]='Solved',_0x3024b4[_0x3024b4[_0x2d5350(0xf8)]=-0x1]='UNRECOGNIZED',_0x3024b4))(I||{}),v=(_0x124b25=>(_0x124b25[_0x124b25[_0x2d5350(0x114)]=0x0]=_0x2d5350(0x114),_0x124b25[_0x124b25[_0x2d5350(0x120)]=0x1]=_0x2d5350(0x120),_0x124b25[_0x124b25[_0x2d5350(0x10b)]=0x2]=_0x2d5350(0x10b),_0x124b25[_0x124b25[_0x2d5350(0xe1)]=0x3]=_0x2d5350(0xe1),_0x124b25[_0x124b25[_0x2d5350(0x122)]=0x4]=_0x2d5350(0x122),_0x124b25[_0x124b25[_0x2d5350(0x124)]=0x5]=_0x2d5350(0x124),_0x124b25[_0x124b25[_0x2d5350(0xf8)]=-0x1]=_0x2d5350(0xf8),_0x124b25))(v||{});const D=_0x35cca1=>_0x4b79be(new Date(+_0x35cca1))[_0x2d5350(0xff)]('YYYY/MM/DD\x20HH:mm'),B=async(_0x3e423b,_0x367b81)=>{const _0x8e92fc=_0x2d5350,_0x379b67=_0x3e423b[_0x8e92fc(0x113)](_0x48e2a5),_0xa89619=_0x3e423b['get'](_0x16aa01);_0x367b81['forEach'](_0x16088e=>{const _0x3d4f42=_0x8e92fc;_0x379b67[_0x3d4f42(0xda)](_0x16088e)&&_0x367b81[_0x3d4f42(0xd2)](_0x16088e);}),_0x367b81[_0x8e92fc(0x108)]&&(await _0xa89619[_0x8e92fc(0x113)]('/universer-api/user/list',{'params':{'userIDs':[..._0x367b81]}}))[_0x8e92fc(0x103)][_0x8e92fc(0xdc)][_0x8e92fc(0x117)](_0x402337=>{const _0x2ffb06=_0x8e92fc;_0x402337&&_0x379b67[_0x2ffb06(0xe9)](_0x402337);});};var K=Object[_0x2d5350(0xfe)],V=(_0xcb8fcf,_0x975fa6,_0x305288,_0x4242cf)=>{const _0x5429ec=_0x2d5350;for(var _0x17ad9a=_0x4242cf>0x1?void 0x0:_0x4242cf?K(_0x975fa6,_0x305288):_0x975fa6,_0x48544c=_0xcb8fcf[_0x5429ec(0xf9)]-0x1,_0x1bd1ac;_0x48544c>=0x0;_0x48544c--)(_0x1bd1ac=_0xcb8fcf[_0x48544c])&&(_0x17ad9a=_0x1bd1ac(_0x17ad9a)||_0x17ad9a);return _0x17ad9a;},p=(_0x54ffd1,_0x234003)=>(_0x22f624,_0x47e8ec)=>_0x234003(_0x22f624,_0x47e8ec,_0x54ffd1);let S=class extends _0xd7e540{constructor(_0x1c8253,_0x50c327,_0x11a5e8,_0x4f4a1c){const _0x431fd6=_0x2d5350;super(),this[_0x431fd6(0xc9)]=_0x1c8253,this[_0x431fd6(0xe0)]=_0x50c327,this[_0x431fd6(0xf5)]=_0x11a5e8,this[_0x431fd6(0x11f)]=_0x4f4a1c,this['_init'](),this[_0x431fd6(0xe8)]();}[_0x2d5350(0xe8)](){const _0x430198=_0x2d5350;this[_0x430198(0xdb)](this['_threadCommentModel'][_0x430198(0xec)][_0x430198(0xfc)](_0x1ee30f(0x10))['subscribe'](_0x387b63=>{const _0x35251e=_0x430198,_0xe145be=new Set();_0x387b63[_0x35251e(0x117)](_0x128904=>{const _0x400e9b=_0x35251e;switch(_0x128904[_0x400e9b(0xf3)]){case'add':{const _0x35594e=_0x128904['payload']['personId'];_0xe145be[_0x400e9b(0xe4)](_0x35594e);break;}}}),B(this[_0x35251e(0x11f)],_0xe145be);}));}['_init'](){const _0x10548d=_0x2d5350;this[_0x10548d(0xdb)](this[_0x10548d(0xc9)][_0x10548d(0xec)][_0x10548d(0xd8)](async _0x79bf6a=>{const _0x1b120d=_0x10548d;var _0x2a947d,_0x45f03f,_0x33dc3b,_0x5c655c;const _0x35e463=(_0x2a947d=this[_0x1b120d(0xe0)][_0x1b120d(0xe2)](_0x79bf6a[_0x1b120d(0xea)])[_0x1b120d(0xd6)](_0x5cfb28=>_0x5cfb28[_0x1b120d(0xcc)]===_0x79bf6a[_0x1b120d(0xcc)]))==null?void 0x0:_0x2a947d[_0x1b120d(0x11c)];if(!_0x35e463)return;const {unitId:_0x41d88e,subUnitId:_0x456ee6}=_0x35e463;switch(_0x79bf6a[_0x1b120d(0x10d)]&&this['_userService'][_0x1b120d(0xe9)](_0x79bf6a[_0x1b120d(0x10d)]),_0x79bf6a[_0x1b120d(0xf3)]){case v[_0x1b120d(0x120)]:break;case v['Reply']:{this[_0x1b120d(0xe0)]['addComment'](_0x41d88e,_0x456ee6,{'unitId':_0x41d88e,'subUnitId':_0x456ee6,'ref':'','id':_0x79bf6a['replyId'],'dT':D(+_0x79bf6a[_0x1b120d(0xf6)]),'threadId':_0x79bf6a['threadId'],'personId':(_0x33dc3b=(_0x45f03f=_0x79bf6a[_0x1b120d(0x10d)])==null?void 0x0:_0x45f03f[_0x1b120d(0xd5)])!=null?_0x33dc3b:_0x79bf6a['userId'],'text':JSON[_0x1b120d(0x11b)](_0x79bf6a[_0x1b120d(0x116)]),'parentId':_0x35e463['id']});break;}case v[_0x1b120d(0x122)]:{const _0x151700=this['_threadCommentModel'][_0x1b120d(0x10f)](_0x41d88e,_0x456ee6,_0x79bf6a[_0x1b120d(0xe7)]);_0x151700&&_0x151700['parentId']&&this[_0x1b120d(0xe0)]['deleteComment'](_0x41d88e,_0x456ee6,_0x79bf6a[_0x1b120d(0xe7)]);break;}case v[_0x1b120d(0xe1)]:{this['_threadCommentModel']['updateComment'](_0x41d88e,_0x456ee6,{'commentId':_0x79bf6a['replyId'],'text':JSON[_0x1b120d(0x11b)](_0x79bf6a[_0x1b120d(0x116)])});break;}case v[_0x1b120d(0x124)]:{const _0x3d510d=(_0x5c655c=this[_0x1b120d(0xe0)][_0x1b120d(0xe2)](_0x79bf6a['unitId'])[_0x1b120d(0xd6)](_0x167fe3=>_0x167fe3['threadId']===_0x79bf6a[_0x1b120d(0xcc)]))==null?void 0x0:_0x5c655c[_0x1b120d(0x11c)];_0x3d510d&&this[_0x1b120d(0xe0)][_0x1b120d(0xf4)](_0x41d88e,_0x456ee6,_0x3d510d['id'],_0x79bf6a[_0x1b120d(0xcd)]===I[_0x1b120d(0xc8)]);break;}}}));}};S=V([p(0x0,_0x82e101(_0x5646f3)),p(0x1,_0x82e101(_0x1ba485)),p(0x2,_0x82e101(_0x48e2a5)),p(0x3,_0x82e101(_0x2de2a0))],S);const z='thread-comment-data-source.config',M={};var k=Object['getOwnPropertyDescriptor'],Q=(_0x1df013,_0x388f42,_0x986144,_0x5354af)=>{const _0x4b08f0=_0x2d5350;for(var _0x27d257=_0x5354af>0x1?void 0x0:_0x5354af?k(_0x388f42,_0x986144):_0x388f42,_0x2e01c4=_0x1df013[_0x4b08f0(0xf9)]-0x1,_0x26e628;_0x2e01c4>=0x0;_0x2e01c4--)(_0x26e628=_0x1df013[_0x2e01c4])&&(_0x27d257=_0x26e628(_0x27d257)||_0x27d257);return _0x27d257;},_=(_0x4bdda0,_0x36d52c)=>(_0x520d65,_0x141c4e)=>_0x36d52c(_0x520d65,_0x141c4e,_0x4bdda0);function X(_0x5e74aa,_0x413701){const _0x2f8e15=_0x2d5350,_0x5ac38b=_0x5e74aa[_0x2f8e15(0x11e)][0x0];return{..._0x413701,'id':_0x5ac38b[_0x2f8e15(0xe7)],'resolved':_0x5e74aa[_0x2f8e15(0xcd)]===0x1,'dT':D(_0x5ac38b[_0x2f8e15(0xf6)]),'personId':_0x5ac38b[_0x2f8e15(0x10a)],'threadId':_0x5ac38b[_0x2f8e15(0xcc)]};}function ee(_0x2417a,_0x1931a0,_0x5b039b){const _0xee6606=_0x2d5350;var _0x2dc4af,_0x85328f;if(((_0x85328f=(_0x2dc4af=_0x2417a==null?void 0x0:_0x2417a[_0xee6606(0x11e)])==null?void 0x0:_0x2dc4af[_0xee6606(0xf9)])!=null?_0x85328f:0x0)>0x0){const _0x395103=(_0x360bdc,_0x38d607)=>({'id':_0x360bdc['replyId'],'threadId':_0x360bdc[_0xee6606(0xcc)],'dT':D(_0x360bdc[_0xee6606(0xf6)]),'personId':_0x360bdc[_0xee6606(0x10a)],'resolved':_0x2417a[_0xee6606(0xcd)]===I[_0xee6606(0xc8)],'unitId':_0x1931a0,'subUnitId':_0x5b039b,'text':JSON[_0xee6606(0x11b)](_0x360bdc[_0xee6606(0x116)]),'parentId':_0x38d607}),_0x4dce44=_0x395103(_0x2417a[_0xee6606(0x11e)][0x0]);return{..._0x4dce44,'children':_0x2417a['replies']['slice'](0x1)[_0xee6606(0xfb)](_0x5bbbba=>_0x395103(_0x5bbbba,_0x4dce44['id']))};}return null;}let f=class{constructor(_0x27a508,_0x576c22,_0x28db77,_0x1180f6){const _0x12defe=_0x2d5350;this[_0x12defe(0x118)]=_0x27a508,this['_userService']=_0x576c22,this[_0x12defe(0xd9)]=_0x28db77,this['_injector']=_0x1180f6;}async['addComment'](_0x2610cc){const _0x30c68b=_0x2d5350;var _0x4071d5,_0x4a7861;const {parentId:_0x324571,unitId:_0x17f5e0,text:_0x81fbea,threadId:_0x151e10}=_0x2610cc,_0x2e0da6=(_0x4a7861=(_0x4071d5=_0x81fbea[_0x30c68b(0xe3)])==null?void 0x0:_0x4071d5[_0x30c68b(0xf2)](_0x43d350=>_0x43d350[_0x30c68b(0x109)]===_0x27a3d3[_0x30c68b(0xf1)])[_0x30c68b(0xfb)](_0x6c75c5=>_0x6c75c5[_0x30c68b(0xf0)]))!=null?_0x4a7861:[],_0x1a50a4=JSON[_0x30c68b(0x11a)](_0x81fbea),_0x55db86=(await this[_0x30c68b(0xd9)]['requireSession'](_0x17f5e0))[_0x30c68b(0x125)]();if(_0x324571){const _0x580ad2={'memberId':_0x55db86,'unitId':_0x17f5e0,'content':_0x1a50a4,'mention':_0x2e0da6,'threadId':_0x151e10},_0x2d770c=(await this['_httpService']['post'](_0x30c68b(0x106)+_0x17f5e0+'/reply',{'body':_0x580ad2}))[_0x30c68b(0x103)][_0x30c68b(0xd1)];return{..._0x2610cc,'id':_0x2d770c[_0x30c68b(0xe7)],'dT':_0x4b79be(+_0x2d770c[_0x30c68b(0xf6)])[_0x30c68b(0xff)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x2d770c[_0x30c68b(0x10a)]};}else{const _0xceb580={'memberId':_0x55db86,'unitId':_0x17f5e0,'content':_0x1a50a4,'mention':_0x2e0da6},_0x168c13=await this['_httpService'][_0x30c68b(0xd3)](_0x30c68b(0x106)+_0x17f5e0+_0x30c68b(0x127),{'body':_0xceb580});return X(_0x168c13['body']['comment'],_0x2610cc);}}async[_0x2d5350(0xd4)](_0x47e27d){const _0x85ce6a=_0x2d5350;var _0x31e541,_0x49498e;const {text:_0x1951c8,unitId:_0x195b3f}=_0x47e27d,_0x2f6d65=(_0x49498e=(_0x31e541=_0x1951c8['customRanges'])==null?void 0x0:_0x31e541[_0x85ce6a(0xf2)](_0x111feb=>_0x111feb['rangeType']===_0x27a3d3[_0x85ce6a(0xf1)])[_0x85ce6a(0xfb)](_0x35fdd7=>_0x35fdd7['rangeId']))!=null?_0x49498e:[],_0x713cf1=JSON[_0x85ce6a(0x11a)](_0x1951c8),_0x4fc30d=_0x47e27d[_0x85ce6a(0xcc)],_0x1e5033=_0x47e27d['id'],_0x487d62={'memberId':(await this[_0x85ce6a(0xd9)][_0x85ce6a(0x105)](_0x195b3f))[_0x85ce6a(0x125)](),'unitId':_0x195b3f,'threadId':_0x4fc30d,'mention':_0x2f6d65,'content':_0x713cf1,'replyId':_0x1e5033},_0x236b07=await this[_0x85ce6a(0x118)][_0x85ce6a(0xd3)](_0x85ce6a(0x106)+_0x195b3f+_0x85ce6a(0x102),{'body':_0x487d62});return!_0x236b07['body'][_0x85ce6a(0xfd)]||_0x236b07[_0x85ce6a(0x103)]['error'][_0x85ce6a(0x121)]===0x1;}async[_0x2d5350(0xf4)](_0x675f29){const _0x43c343=_0x2d5350,{unitId:_0x27a660}=_0x675f29,_0x448c66=_0x675f29[_0x43c343(0xcc)],_0x14a711={'memberId':this[_0x43c343(0xf5)][_0x43c343(0x101)]()['userID'],'unitId':_0x27a660,'threadId':_0x448c66,'solved':_0x675f29['resolved']?I['Solved']:I['OpenOrReOpen']},_0x282023=await this[_0x43c343(0x118)][_0x43c343(0xd3)]('/universer-api/comment/unit/'+_0x27a660+_0x43c343(0x111),{'body':_0x14a711});return!_0x282023[_0x43c343(0x103)][_0x43c343(0xfd)]||_0x282023[_0x43c343(0x103)][_0x43c343(0xfd)]['code']===0x1;}async[_0x2d5350(0x10c)](_0x3776f5,_0x3ba336,_0x1779c9,_0x5ae9b3){const _0xbafe49=_0x2d5350,_0x3d9aad={'memberId':(await this['_sessionService'][_0xbafe49(0x105)](_0x3776f5))[_0xbafe49(0x125)](),'threadId':_0x1779c9,'replyId':_0x5ae9b3,'unitId':_0x3776f5},_0x2d252c=await this['_httpService']['post'](_0xbafe49(0x106)+_0x3776f5+'/delete',{'body':_0x3d9aad});return!_0x2d252c[_0xbafe49(0x103)][_0xbafe49(0xfd)]||_0x2d252c[_0xbafe49(0x103)][_0xbafe49(0xfd)][_0xbafe49(0x121)]===0x1;}async[_0x2d5350(0x115)](_0x5bc84b,_0x124577,_0x144626){const _0x32ed26=_0x2d5350,_0x5c63f8={'unitId':_0x5bc84b,'threadId':_0x144626},_0x28f4ec=await this[_0x32ed26(0x118)][_0x32ed26(0xd3)]('/universer-api/comment/unit/'+_0x5bc84b+_0x32ed26(0xe6),{'body':_0x5c63f8}),_0x49ddfc=_0x144626[_0x32ed26(0xfb)](_0x1fab8e=>ee(_0x28f4ec['body'][_0x32ed26(0x110)][_0x1fab8e],_0x5bc84b,_0x124577))['filter'](Boolean);return Object['values'](_0x28f4ec[_0x32ed26(0x103)][_0x32ed26(0xdc)])[_0x32ed26(0x117)](_0xd5d441=>{const _0x1af91d=_0x32ed26;this[_0x1af91d(0xf5)][_0x1af91d(0xe9)](_0xd5d441);}),_0x49ddfc;}['saveCommentToSnapshot'](_0x172d15){const _0x52eb70=_0x2d5350;return{'id':_0x172d15['id'],'threadId':_0x172d15['threadId'],'ref':_0x172d15[_0x52eb70(0x10e)]};}};f=Q([_(0x0,_0x82e101(_0x16aa01)),_(0x1,_0x82e101(_0x48e2a5)),_(0x2,_0x82e101(_0x242f6a)),_(0x3,_0x82e101(_0x2de2a0))],f);var re=Object[_0x2d5350(0xfe)],te=(_0x161bb3,_0x4e6a7b,_0x316e49,_0x3b8236)=>{const _0x99020e=_0x2d5350;for(var _0x38d524=_0x3b8236>0x1?void 0x0:_0x3b8236?re(_0x4e6a7b,_0x316e49):_0x4e6a7b,_0x39255b=_0x161bb3[_0x99020e(0xf9)]-0x1,_0x1341c9;_0x39255b>=0x0;_0x39255b--)(_0x1341c9=_0x161bb3[_0x39255b])&&(_0x38d524=_0x1341c9(_0x38d524)||_0x38d524);return _0x38d524;},N=(_0x31621c,_0xad4c0f)=>(_0x2024d5,_0x394031)=>_0xad4c0f(_0x2024d5,_0x394031,_0x31621c);let g=class extends _0xd7e540{constructor(_0x2e1c38,_0x31f48d){const _0x61a7bc=_0x2d5350;super(),this[_0x61a7bc(0x123)]=_0x2e1c38,this[_0x61a7bc(0x126)]=_0x31f48d,this[_0x61a7bc(0xef)]();}['_initDataSource'](){const _0x99b2e2=_0x2d5350;this[_0x99b2e2(0x123)][_0x99b2e2(0xd7)]=this[_0x99b2e2(0x126)],this[_0x99b2e2(0x123)]['syncUpdateMutationToColla']=!0x1;}};g=te([N(0x0,_0x4fae4e),N(0x1,_0x82e101(f))],g);var se=Object[_0x2d5350(0xd0)],oe=Object['getOwnPropertyDescriptor'],ne=(_0x1d8100,_0xb2340,_0x542ef7)=>_0xb2340 in _0x1d8100?se(_0x1d8100,_0xb2340,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x542ef7}):_0x1d8100[_0xb2340]=_0x542ef7,ie=(_0x42f1d8,_0x4548d8,_0x54b53c,_0x4c2c1f)=>{for(var _0x5dbc5d=_0x4c2c1f>0x1?void 0x0:_0x4c2c1f?oe(_0x4548d8,_0x54b53c):_0x4548d8,_0xdae79f=_0x42f1d8['length']-0x1,_0x2c1c90;_0xdae79f>=0x0;_0xdae79f--)(_0x2c1c90=_0x42f1d8[_0xdae79f])&&(_0x5dbc5d=_0x2c1c90(_0x5dbc5d)||_0x5dbc5d);return _0x5dbc5d;},w=(_0xbd0b62,_0x57b92e)=>(_0x2f69b6,_0x5c7479)=>_0x57b92e(_0x2f69b6,_0x5c7479,_0xbd0b62),$=(_0x52dd39,_0x1a4a83,_0x1fdefe)=>ne(_0x52dd39,typeof _0x1a4a83!=_0x2d5350(0x104)?_0x1a4a83+'':_0x1a4a83,_0x1fdefe);let b=class extends _0x419499{constructor(_0x418a10=M,_0x4b4bbc,_0x16863c){const _0x421808=_0x2d5350;super(),this['_config']=_0x418a10,this[_0x421808(0x11f)]=_0x4b4bbc,this[_0x421808(0x11d)]=_0x16863c;const {..._0x5da4ff}=_0x4682c7({},M,this[_0x421808(0xde)]);this['_configService']['setConfig'](z,_0x5da4ff);}[_0x2d5350(0xcf)](){const _0x173f0d=_0x2d5350;[[f],[g],[S]][_0x173f0d(0x117)](_0x43f6e8=>{const _0x41eb1d=_0x173f0d;this['_injector'][_0x41eb1d(0xe4)](_0x43f6e8);});}[_0x2d5350(0x107)](){const _0x51c706=_0x2d5350;this[_0x51c706(0x11f)][_0x51c706(0x113)](g),this[_0x51c706(0x11f)]['get'](S);}};$(b,_0x2d5350(0xfa),W),$(b,'type',_0x5b3885[_0x2d5350(0xca)]),b=ie([_0xfde2f5(_0x55cac6,_0x1f9298,_0x3137d0),w(0x1,_0x82e101(_0x2de2a0)),w(0x2,_0x14ce99)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x1d302e=_0x1e2f;(function(_0x1fc926,_0x3b0f4c){const _0x3318d7=_0x1e2f,_0x341fd4=_0x1fc926();while(!![]){try{const _0x196724=-parseInt(_0x3318d7(0x144))/0x1+-parseInt(_0x3318d7(0x165))/0x2+-parseInt(_0x3318d7(0x19a))/0x3+-parseInt(_0x3318d7(0x182))/0x4*(-parseInt(_0x3318d7(0x14d))/0x5)+-parseInt(_0x3318d7(0x19e))/0x6+-parseInt(_0x3318d7(0x187))/0x7*(-parseInt(_0x3318d7(0x184))/0x8)+parseInt(_0x3318d7(0x14e))/0x9;if(_0x196724===_0x3b0f4c)break;else _0x341fd4['push'](_0x341fd4['shift']());}catch(_0x1c55eb){_0x341fd4['push'](_0x341fd4['shift']());}}}(_0x13fb,0x86d7b));import{CommentService as _0x4e0010,CollaborationSessionService as _0x220aff,UniverCollaborationClientPlugin as _0x1dcdc4}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x4d8b32}from'@univerjs-pro/license';import{dayjs as _0x1237a9,UserManagerService as _0x330e6e,Inject as _0x768f6c,Injector as _0x3c3e98,Disposable as _0x6596eb,CustomRangeType as _0x1139a9,UniverInstanceType as _0x1d77ae,DependentOn as _0x1a2e8d,IConfigService as _0x2bfd3c,Plugin as _0x14328e,merge as _0x7f9811}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x1de634}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x32fa12,IThreadCommentDataSourceService as _0x57ecc3}from'@univerjs/thread-comment';import{bufferTime as _0x4f0216}from'rxjs';import{HTTPService as _0x130cb1}from'@univerjs/network';const W='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x5e9b61=>(_0x5e9b61[_0x5e9b61[_0x1d302e(0x171)]=0x0]=_0x1d302e(0x171),_0x5e9b61[_0x5e9b61[_0x1d302e(0x176)]=0x1]=_0x1d302e(0x176),_0x5e9b61[_0x5e9b61[_0x1d302e(0x157)]=-0x1]=_0x1d302e(0x157),_0x5e9b61))(I||{}),v=(_0x4f044f=>(_0x4f044f[_0x4f044f[_0x1d302e(0x174)]=0x0]=_0x1d302e(0x174),_0x4f044f[_0x4f044f[_0x1d302e(0x156)]=0x1]=_0x1d302e(0x156),_0x4f044f[_0x4f044f[_0x1d302e(0x190)]=0x2]='Reply',_0x4f044f[_0x4f044f['Edit']=0x3]=_0x1d302e(0x168),_0x4f044f[_0x4f044f[_0x1d302e(0x16e)]=0x4]=_0x1d302e(0x16e),_0x4f044f[_0x4f044f[_0x1d302e(0x16a)]=0x5]=_0x1d302e(0x16a),_0x4f044f[_0x4f044f[_0x1d302e(0x157)]=-0x1]=_0x1d302e(0x157),_0x4f044f))(v||{});const D=_0x529f43=>_0x1237a9(new Date(+_0x529f43))['format']('YYYY/MM/DD\x20HH:mm'),B=async(_0x228784,_0x32208a)=>{const _0x4e43c9=_0x1d302e,_0x51ac74=_0x228784[_0x4e43c9(0x199)](_0x330e6e),_0x177b6e=_0x228784[_0x4e43c9(0x199)](_0x130cb1);_0x32208a[_0x4e43c9(0x150)](_0x385a8d=>{const _0xa7b9eb=_0x4e43c9;_0x51ac74[_0xa7b9eb(0x170)](_0x385a8d)&&_0x32208a[_0xa7b9eb(0x195)](_0x385a8d);}),_0x32208a[_0x4e43c9(0x149)]&&(await _0x177b6e['get']('/universer-api/user/list',{'params':{'userIDs':[..._0x32208a]}}))[_0x4e43c9(0x175)]['users'][_0x4e43c9(0x150)](_0x27d7d6=>{_0x27d7d6&&_0x51ac74['addUser'](_0x27d7d6);});};function _0x1e2f(_0x81746a,_0x592a1b){const _0x13fb74=_0x13fb();return _0x1e2f=function(_0x1e2f6b,_0xfd2e08){_0x1e2f6b=_0x1e2f6b-0x144;let _0x99b005=_0x13fb74[_0x1e2f6b];return _0x99b005;},_0x1e2f(_0x81746a,_0x592a1b);}var K=Object[_0x1d302e(0x16d)],V=(_0x5b5d0f,_0x5ef976,_0x23367e,_0xb7ebe7)=>{const _0x4ba3da=_0x1d302e;for(var _0x24a596=_0xb7ebe7>0x1?void 0x0:_0xb7ebe7?K(_0x5ef976,_0x23367e):_0x5ef976,_0x4d3aa6=_0x5b5d0f[_0x4ba3da(0x148)]-0x1,_0x198c96;_0x4d3aa6>=0x0;_0x4d3aa6--)(_0x198c96=_0x5b5d0f[_0x4d3aa6])&&(_0x24a596=_0x198c96(_0x24a596)||_0x24a596);return _0x24a596;},p=(_0x243097,_0x10e5b8)=>(_0x7985,_0x59d60c)=>_0x10e5b8(_0x7985,_0x59d60c,_0x243097);let S=class extends _0x6596eb{constructor(_0x1d252e,_0x19ddb4,_0x3f97d8,_0x16b8ba){const _0x3b6b8c=_0x1d302e;super(),this['_commentService']=_0x1d252e,this[_0x3b6b8c(0x169)]=_0x19ddb4,this['_userService']=_0x3f97d8,this['_injector']=_0x16b8ba,this[_0x3b6b8c(0x16b)](),this[_0x3b6b8c(0x146)]();}[_0x1d302e(0x146)](){const _0x56684d=_0x1d302e;this[_0x56684d(0x14f)](this[_0x56684d(0x169)]['commentUpdate$'][_0x56684d(0x18c)](_0x4f0216(0x10))[_0x56684d(0x197)](_0x145531=>{const _0x3a897d=_0x56684d,_0x4732e8=new Set();_0x145531[_0x3a897d(0x150)](_0x7f31bc=>{const _0xe63097=_0x3a897d;switch(_0x7f31bc[_0xe63097(0x145)]){case _0xe63097(0x15f):{const _0x1b44bb=_0x7f31bc[_0xe63097(0x17c)][_0xe63097(0x180)];_0x4732e8[_0xe63097(0x15f)](_0x1b44bb);break;}}}),B(this[_0x3a897d(0x17f)],_0x4732e8);}));}[_0x1d302e(0x16b)](){const _0x5527fe=_0x1d302e;this[_0x5527fe(0x14f)](this[_0x5527fe(0x159)][_0x5527fe(0x14b)][_0x5527fe(0x197)](async _0x24f079=>{const _0x5c26fe=_0x5527fe;var _0x3522d3,_0x382a0c,_0x13897c,_0x458fea;const _0x2e3285=(_0x3522d3=this['_threadCommentModel'][_0x5c26fe(0x158)](_0x24f079['unitId'])[_0x5c26fe(0x16f)](_0x10fb90=>_0x10fb90['threadId']===_0x24f079['threadId']))==null?void 0x0:_0x3522d3['root'];if(!_0x2e3285)return;const {unitId:_0x2eb054,subUnitId:_0x3cb463}=_0x2e3285;switch(_0x24f079[_0x5c26fe(0x194)]&&this[_0x5c26fe(0x186)]['addUser'](_0x24f079[_0x5c26fe(0x194)]),_0x24f079[_0x5c26fe(0x145)]){case v[_0x5c26fe(0x156)]:break;case v[_0x5c26fe(0x190)]:{this[_0x5c26fe(0x169)]['addComment'](_0x2eb054,_0x3cb463,{'unitId':_0x2eb054,'subUnitId':_0x3cb463,'ref':'','id':_0x24f079[_0x5c26fe(0x163)],'dT':D(+_0x24f079[_0x5c26fe(0x181)]),'threadId':_0x24f079[_0x5c26fe(0x18f)],'personId':(_0x13897c=(_0x382a0c=_0x24f079[_0x5c26fe(0x194)])==null?void 0x0:_0x382a0c[_0x5c26fe(0x1a0)])!=null?_0x13897c:_0x24f079[_0x5c26fe(0x164)],'text':JSON['parse'](_0x24f079['content']),'parentId':_0x2e3285['id']});break;}case v['Delete']:{const _0x135494=this[_0x5c26fe(0x169)][_0x5c26fe(0x17e)](_0x2eb054,_0x3cb463,_0x24f079[_0x5c26fe(0x163)]);_0x135494&&_0x135494[_0x5c26fe(0x155)]&&this[_0x5c26fe(0x169)][_0x5c26fe(0x16c)](_0x2eb054,_0x3cb463,_0x24f079[_0x5c26fe(0x163)]);break;}case v[_0x5c26fe(0x168)]:{this['_threadCommentModel']['updateComment'](_0x2eb054,_0x3cb463,{'commentId':_0x24f079[_0x5c26fe(0x163)],'text':JSON['parse'](_0x24f079['content'])});break;}case v[_0x5c26fe(0x16a)]:{const _0x2b6c60=(_0x458fea=this[_0x5c26fe(0x169)][_0x5c26fe(0x158)](_0x24f079[_0x5c26fe(0x188)])[_0x5c26fe(0x16f)](_0x27b965=>_0x27b965['threadId']===_0x24f079['threadId']))==null?void 0x0:_0x458fea['root'];_0x2b6c60&&this['_threadCommentModel']['resolveComment'](_0x2eb054,_0x3cb463,_0x2b6c60['id'],_0x24f079[_0x5c26fe(0x147)]===I[_0x5c26fe(0x176)]);break;}}}));}};S=V([p(0x0,_0x768f6c(_0x4e0010)),p(0x1,_0x768f6c(_0x32fa12)),p(0x2,_0x768f6c(_0x330e6e)),p(0x3,_0x768f6c(_0x3c3e98))],S);const z=_0x1d302e(0x15a),M={};var k=Object[_0x1d302e(0x16d)],Q=(_0x3f6b5d,_0x30ec78,_0x5124d9,_0xe07f02)=>{const _0x418084=_0x1d302e;for(var _0x565ffe=_0xe07f02>0x1?void 0x0:_0xe07f02?k(_0x30ec78,_0x5124d9):_0x30ec78,_0x48a9fa=_0x3f6b5d[_0x418084(0x148)]-0x1,_0xba9bca;_0x48a9fa>=0x0;_0x48a9fa--)(_0xba9bca=_0x3f6b5d[_0x48a9fa])&&(_0x565ffe=_0xba9bca(_0x565ffe)||_0x565ffe);return _0x565ffe;},_=(_0x20c738,_0x53225d)=>(_0x3fcb31,_0x40ada7)=>_0x53225d(_0x3fcb31,_0x40ada7,_0x20c738);function X(_0x623bb5,_0x392986){const _0x4d7fef=_0x1d302e,_0x39685a=_0x623bb5[_0x4d7fef(0x15b)][0x0];return{..._0x392986,'id':_0x39685a[_0x4d7fef(0x163)],'resolved':_0x623bb5['solved']===0x1,'dT':D(_0x39685a['createTimestamp']),'personId':_0x39685a['userId'],'threadId':_0x39685a[_0x4d7fef(0x18f)]};}function ee(_0x421e28,_0x140d4a,_0xe3ba42){const _0x2241e8=_0x1d302e;var _0x28c1cb,_0x5ec6a0;if(((_0x5ec6a0=(_0x28c1cb=_0x421e28==null?void 0x0:_0x421e28[_0x2241e8(0x15b)])==null?void 0x0:_0x28c1cb['length'])!=null?_0x5ec6a0:0x0)>0x0){const _0x7efdc2=(_0x1225c0,_0x2d0853)=>({'id':_0x1225c0[_0x2241e8(0x163)],'threadId':_0x1225c0[_0x2241e8(0x18f)],'dT':D(_0x1225c0['createTimestamp']),'personId':_0x1225c0[_0x2241e8(0x164)],'resolved':_0x421e28['solved']===I[_0x2241e8(0x176)],'unitId':_0x140d4a,'subUnitId':_0xe3ba42,'text':JSON[_0x2241e8(0x177)](_0x1225c0[_0x2241e8(0x191)]),'parentId':_0x2d0853}),_0x1d572a=_0x7efdc2(_0x421e28['replies'][0x0]);return{..._0x1d572a,'children':_0x421e28[_0x2241e8(0x15b)]['slice'](0x1)[_0x2241e8(0x183)](_0x21ab79=>_0x7efdc2(_0x21ab79,_0x1d572a['id']))};}return null;}let f=class{constructor(_0x1ffbb7,_0xb34232,_0x467f1f,_0x1f695a){const _0x5e7819=_0x1d302e;this['_httpService']=_0x1ffbb7,this[_0x5e7819(0x186)]=_0xb34232,this['_sessionService']=_0x467f1f,this['_injector']=_0x1f695a;}async[_0x1d302e(0x178)](_0x36c8c9){const _0x44fba1=_0x1d302e;var _0x4fcbff,_0x3c3e6e;const {parentId:_0xa76e45,unitId:_0x2ef2dc,text:_0x5889ee,threadId:_0xc8ac93}=_0x36c8c9,_0x5df288=(_0x3c3e6e=(_0x4fcbff=_0x5889ee['customRanges'])==null?void 0x0:_0x4fcbff[_0x44fba1(0x14a)](_0x9e57b8=>_0x9e57b8[_0x44fba1(0x19b)]===_0x1139a9[_0x44fba1(0x15c)])[_0x44fba1(0x183)](_0x2e23fa=>_0x2e23fa['rangeId']))!=null?_0x3c3e6e:[],_0x1c0d34=JSON[_0x44fba1(0x14c)](_0x5889ee),_0x2207a4=(await this[_0x44fba1(0x17b)]['requireSession'](_0x2ef2dc))[_0x44fba1(0x151)]();if(_0xa76e45){const _0x614378={'memberId':_0x2207a4,'unitId':_0x2ef2dc,'content':_0x1c0d34,'mention':_0x5df288,'threadId':_0xc8ac93},_0x3d9d71=(await this[_0x44fba1(0x18d)][_0x44fba1(0x152)](_0x44fba1(0x198)+_0x2ef2dc+_0x44fba1(0x189),{'body':_0x614378}))[_0x44fba1(0x175)]['reply'];return{..._0x36c8c9,'id':_0x3d9d71[_0x44fba1(0x163)],'dT':_0x1237a9(+_0x3d9d71[_0x44fba1(0x181)])['format'](_0x44fba1(0x179)),'personId':_0x3d9d71['userId']};}else{const _0x3e1269={'memberId':_0x2207a4,'unitId':_0x2ef2dc,'content':_0x1c0d34,'mention':_0x5df288},_0x482aa2=await this[_0x44fba1(0x18d)]['post'](_0x44fba1(0x198)+_0x2ef2dc+'/add',{'body':_0x3e1269});return X(_0x482aa2[_0x44fba1(0x175)]['comment'],_0x36c8c9);}}async['updateComment'](_0x1c763a){const _0xf12c=_0x1d302e;var _0x551dd1,_0x13b02a;const {text:_0x1fb226,unitId:_0x5c645e}=_0x1c763a,_0x35f3c0=(_0x13b02a=(_0x551dd1=_0x1fb226['customRanges'])==null?void 0x0:_0x551dd1['filter'](_0x4c845e=>_0x4c845e[_0xf12c(0x19b)]===_0x1139a9[_0xf12c(0x15c)])[_0xf12c(0x183)](_0x1d344a=>_0x1d344a['rangeId']))!=null?_0x13b02a:[],_0x543678=JSON[_0xf12c(0x14c)](_0x1fb226),_0x49c028=_0x1c763a[_0xf12c(0x18f)],_0x376635=_0x1c763a['id'],_0x5e12bd={'memberId':(await this[_0xf12c(0x17b)][_0xf12c(0x192)](_0x5c645e))[_0xf12c(0x151)](),'unitId':_0x5c645e,'threadId':_0x49c028,'mention':_0x35f3c0,'content':_0x543678,'replyId':_0x376635},_0x1c7479=await this[_0xf12c(0x18d)]['post'](_0xf12c(0x198)+_0x5c645e+_0xf12c(0x15e),{'body':_0x5e12bd});return!_0x1c7479['body']['error']||_0x1c7479[_0xf12c(0x175)][_0xf12c(0x173)][_0xf12c(0x161)]===0x1;}async[_0x1d302e(0x15d)](_0x47e32d){const _0x5dd3ff=_0x1d302e,{unitId:_0x26640e}=_0x47e32d,_0x39e6c7=_0x47e32d['threadId'],_0x273242={'memberId':this['_userService']['getCurrentUser']()[_0x5dd3ff(0x1a0)],'unitId':_0x26640e,'threadId':_0x39e6c7,'solved':_0x47e32d[_0x5dd3ff(0x19f)]?I[_0x5dd3ff(0x176)]:I[_0x5dd3ff(0x171)]},_0x2c8223=await this['_httpService'][_0x5dd3ff(0x152)](_0x5dd3ff(0x198)+_0x26640e+_0x5dd3ff(0x18a),{'body':_0x273242});return!_0x2c8223['body']['error']||_0x2c8223[_0x5dd3ff(0x175)][_0x5dd3ff(0x173)][_0x5dd3ff(0x161)]===0x1;}async[_0x1d302e(0x16c)](_0x43c5a3,_0x5dd986,_0x1c1e4d,_0x572ebe){const _0x5e668c=_0x1d302e,_0x7d82ad={'memberId':(await this[_0x5e668c(0x17b)][_0x5e668c(0x192)](_0x43c5a3))[_0x5e668c(0x151)](),'threadId':_0x1c1e4d,'replyId':_0x572ebe,'unitId':_0x43c5a3},_0x5116df=await this['_httpService'][_0x5e668c(0x152)]('/universer-api/comment/unit/'+_0x43c5a3+_0x5e668c(0x19c),{'body':_0x7d82ad});return!_0x5116df['body'][_0x5e668c(0x173)]||_0x5116df[_0x5e668c(0x175)][_0x5e668c(0x173)][_0x5e668c(0x161)]===0x1;}async[_0x1d302e(0x166)](_0x510ca9,_0x197e9d,_0x18fbda){const _0x4cd19f=_0x1d302e,_0x3483e4={'unitId':_0x510ca9,'threadId':_0x18fbda},_0x4e1716=await this[_0x4cd19f(0x18d)][_0x4cd19f(0x152)]('/universer-api/comment/unit/'+_0x510ca9+_0x4cd19f(0x1a1),{'body':_0x3483e4}),_0x2295f2=_0x18fbda[_0x4cd19f(0x183)](_0x13ed2e=>ee(_0x4e1716[_0x4cd19f(0x175)]['comments'][_0x13ed2e],_0x510ca9,_0x197e9d))['filter'](Boolean);return Object['values'](_0x4e1716[_0x4cd19f(0x175)]['users'])[_0x4cd19f(0x150)](_0x4fad1b=>{const _0x27da98=_0x4cd19f;this[_0x27da98(0x186)][_0x27da98(0x160)](_0x4fad1b);}),_0x2295f2;}[_0x1d302e(0x172)](_0x2095b6){const _0x452969=_0x1d302e;return{'id':_0x2095b6['id'],'threadId':_0x2095b6['threadId'],'ref':_0x2095b6[_0x452969(0x185)]};}};f=Q([_(0x0,_0x768f6c(_0x130cb1)),_(0x1,_0x768f6c(_0x330e6e)),_(0x2,_0x768f6c(_0x220aff)),_(0x3,_0x768f6c(_0x3c3e98))],f);var re=Object[_0x1d302e(0x16d)],te=(_0x2e7b,_0x2df40c,_0x4f1bec,_0x3105b4)=>{const _0x535f40=_0x1d302e;for(var _0x52c833=_0x3105b4>0x1?void 0x0:_0x3105b4?re(_0x2df40c,_0x4f1bec):_0x2df40c,_0xd7a2fc=_0x2e7b[_0x535f40(0x148)]-0x1,_0x48c2cf;_0xd7a2fc>=0x0;_0xd7a2fc--)(_0x48c2cf=_0x2e7b[_0xd7a2fc])&&(_0x52c833=_0x48c2cf(_0x52c833)||_0x52c833);return _0x52c833;},N=(_0x3e0918,_0x14c97d)=>(_0x224dc6,_0xe4ab1)=>_0x14c97d(_0x224dc6,_0xe4ab1,_0x3e0918);let g=class extends _0x6596eb{constructor(_0x1a0f71,_0x3db004){const _0x36d92c=_0x1d302e;super(),this[_0x36d92c(0x18e)]=_0x1a0f71,this[_0x36d92c(0x17a)]=_0x3db004,this[_0x36d92c(0x162)]();}[_0x1d302e(0x162)](){const _0x35becd=_0x1d302e;this[_0x35becd(0x18e)][_0x35becd(0x19d)]=this[_0x35becd(0x17a)],this['_threadCommentDataSourceService'][_0x35becd(0x17d)]=!0x1;}};g=te([N(0x0,_0x57ecc3),N(0x1,_0x768f6c(f))],g);function _0x13fb(){const _0x44903c=['userId','1903138nnxJMP','listComments','pluginName','Edit','_threadCommentModel','Solve','_init','deleteComment','getOwnPropertyDescriptor','Delete','find','getUser','OpenOrReOpen','saveCommentToSnapshot','error','Unknown','body','Solved','parse','addComment','YYYY/MM/DD\x20HH:mm','_threadCommentDataSource','_sessionService','payload','syncUpdateMutationToColla','getComment','_injector','personId','createTimestamp','4ePWKUE','map','4365640WalMVK','ref','_userService','7VGzCCS','unitId','/reply','/solved','setConfig','pipe','_httpService','_threadCommentDataSourceService','threadId','Reply','content','requireSession','onStarting','user','delete','symbol','subscribe','/universer-api/comment/unit/','get','884583NvQggC','rangeType','/delete','dataSource','5465184QpaTRI','resolved','userID','/list','68712eysXIS','type','_initUserSync','solved','length','size','filter','commentUpdate$','stringify','1513390UGPpid','17369442DcosuM','disposeWithMe','forEach','getMemberID','post','_configService','defineProperty','parentId','Add','UNRECOGNIZED','getUnit','_commentService','thread-comment-data-source.config','replies','COMMENT','resolveComment','/edit','add','addUser','code','_initDataSource','replyId'];_0x13fb=function(){return _0x44903c;};return _0x13fb();}var se=Object[_0x1d302e(0x154)],oe=Object[_0x1d302e(0x16d)],ne=(_0xd27e82,_0x432fba,_0x36085e)=>_0x432fba in _0xd27e82?se(_0xd27e82,_0x432fba,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x36085e}):_0xd27e82[_0x432fba]=_0x36085e,ie=(_0x5a8c6b,_0x15b351,_0x5145fd,_0x5e0fce)=>{const _0x4e8d47=_0x1d302e;for(var _0x1000b8=_0x5e0fce>0x1?void 0x0:_0x5e0fce?oe(_0x15b351,_0x5145fd):_0x15b351,_0x3377cf=_0x5a8c6b[_0x4e8d47(0x148)]-0x1,_0x14ad20;_0x3377cf>=0x0;_0x3377cf--)(_0x14ad20=_0x5a8c6b[_0x3377cf])&&(_0x1000b8=_0x14ad20(_0x1000b8)||_0x1000b8);return _0x1000b8;},w=(_0x209a82,_0x354ee0)=>(_0x33b192,_0x234dc8)=>_0x354ee0(_0x33b192,_0x234dc8,_0x209a82),$=(_0x4cdacf,_0x5faeb4,_0x5a2e16)=>ne(_0x4cdacf,typeof _0x5faeb4!=_0x1d302e(0x196)?_0x5faeb4+'':_0x5faeb4,_0x5a2e16);let b=class extends _0x14328e{constructor(_0x476217=M,_0x32d012,_0x14ec37){const _0x547139=_0x1d302e;super(),this['_config']=_0x476217,this[_0x547139(0x17f)]=_0x32d012,this['_configService']=_0x14ec37;const {..._0xf8bb6c}=_0x7f9811({},M,this['_config']);this[_0x547139(0x153)][_0x547139(0x18b)](z,_0xf8bb6c);}[_0x1d302e(0x193)](){const _0x3dc5d3=_0x1d302e;[[f],[g],[S]][_0x3dc5d3(0x150)](_0xf7d2ce=>{const _0x271ffa=_0x3dc5d3;this[_0x271ffa(0x17f)]['add'](_0xf7d2ce);});}['onReady'](){const _0x2af4d0=_0x1d302e;this[_0x2af4d0(0x17f)]['get'](g),this[_0x2af4d0(0x17f)][_0x2af4d0(0x199)](S);}};$(b,_0x1d302e(0x167),W),$(b,_0x1d302e(0x145),_0x1d77ae['UNIVER_UNKNOWN']),b=ie([_0x1a2e8d(_0x1de634,_0x1dcdc4,_0x4d8b32),w(0x1,_0x768f6c(_0x3c3e98)),w(0x2,_0x2bfd3c)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x8c6a(_0x1e4ec5,_0x3a5205){const _0x5c169b=_0x5c16();return _0x8c6a=function(_0x8c6ab,_0x108e47){_0x8c6ab=_0x8c6ab-0x175;let _0x134f9c=_0x5c169b[_0x8c6ab];return _0x134f9c;},_0x8c6a(_0x1e4ec5,_0x3a5205);}(function(_0x4873a7,_0x496b74){const _0x2ecdf7=_0x8c6a,_0x370cbb=_0x4873a7();while(!![]){try{const _0x296036=parseInt(_0x2ecdf7(0x1ea))/0x1*(parseInt(_0x2ecdf7(0x194))/0x2)+-parseInt(_0x2ecdf7(0x1cc))/0x3+-parseInt(_0x2ecdf7(0x1f1))/0x4*(parseInt(_0x2ecdf7(0x1a0))/0x5)+-parseInt(_0x2ecdf7(0x1ca))/0x6*(parseInt(_0x2ecdf7(0x17f))/0x7)+parseInt(_0x2ecdf7(0x1d6))/0x8*(-parseInt(_0x2ecdf7(0x189))/0x9)+-parseInt(_0x2ecdf7(0x190))/0xa+-parseInt(_0x2ecdf7(0x1b5))/0xb*(-parseInt(_0x2ecdf7(0x1cf))/0xc);if(_0x296036===_0x496b74)break;else _0x370cbb['push'](_0x370cbb['shift']());}catch(_0x43cfa2){_0x370cbb['push'](_0x370cbb['shift']());}}}(_0x5c16,0x5d3ce),function(_0x559d2f,_0x928144){const _0x19e11c=_0x8c6a;typeof exports==_0x19e11c(0x17a)&&typeof module<'u'?_0x928144(exports,require(_0x19e11c(0x1a8)),require(_0x19e11c(0x1e6)),require('@univerjs/core'),require(_0x19e11c(0x176)),require(_0x19e11c(0x1b7)),require(_0x19e11c(0x195)),require(_0x19e11c(0x1e1))):typeof define==_0x19e11c(0x1a2)&&define[_0x19e11c(0x1e8)]?define(['exports',_0x19e11c(0x1a8),_0x19e11c(0x1e6),'@univerjs/core',_0x19e11c(0x176),_0x19e11c(0x1b7),_0x19e11c(0x195),'@univerjs/network'],_0x928144):(_0x559d2f=typeof globalThis<'u'?globalThis:_0x559d2f||self,_0x928144(_0x559d2f[_0x19e11c(0x1fa)]={},_0x559d2f[_0x19e11c(0x19c)],_0x559d2f[_0x19e11c(0x19e)],_0x559d2f[_0x19e11c(0x183)],_0x559d2f['UniverThreadCommentUi'],_0x559d2f[_0x19e11c(0x1cb)],_0x559d2f[_0x19e11c(0x195)],_0x559d2f[_0x19e11c(0x1dd)]));}(this,function(_0x5a7c67,_0x3871da,_0x46729d,_0x533e70,_0x2a2413,_0x3ce02e,_0x363ffb,_0x457d43){'use strict';const _0xd67764=_0x8c6a;const _0x322963=_0xd67764(0x17b);var _0x3c522a=(_0x4a6efc=>(_0x4a6efc[_0x4a6efc[_0xd67764(0x1af)]=0x0]=_0xd67764(0x1af),_0x4a6efc[_0x4a6efc[_0xd67764(0x1d0)]=0x1]=_0xd67764(0x1d0),_0x4a6efc[_0x4a6efc[_0xd67764(0x1c9)]=-0x1]=_0xd67764(0x1c9),_0x4a6efc))(_0x3c522a||{}),_0x447af1=(_0xacf8ce=>(_0xacf8ce[_0xacf8ce['Unknown']=0x0]='Unknown',_0xacf8ce[_0xacf8ce[_0xd67764(0x19f)]=0x1]=_0xd67764(0x19f),_0xacf8ce[_0xacf8ce[_0xd67764(0x1eb)]=0x2]=_0xd67764(0x1eb),_0xacf8ce[_0xacf8ce[_0xd67764(0x1a5)]=0x3]=_0xd67764(0x1a5),_0xacf8ce[_0xacf8ce[_0xd67764(0x179)]=0x4]=_0xd67764(0x179),_0xacf8ce[_0xacf8ce[_0xd67764(0x186)]=0x5]=_0xd67764(0x186),_0xacf8ce[_0xacf8ce[_0xd67764(0x1c9)]=-0x1]=_0xd67764(0x1c9),_0xacf8ce))(_0x447af1||{});const _0x36926e=_0x4a96ec=>_0x533e70['dayjs'](new Date(+_0x4a96ec))['format'](_0xd67764(0x1b4)),_0xa1bb66=async(_0x5a0b69,_0x5c34f8)=>{const _0x26b86d=_0xd67764,_0x23c5ff=_0x5a0b69[_0x26b86d(0x1e4)](_0x533e70[_0x26b86d(0x1c5)]),_0x5ac5d9=_0x5a0b69[_0x26b86d(0x1e4)](_0x457d43['HTTPService']);_0x5c34f8['forEach'](_0x5508a7=>{const _0x5bd936=_0x26b86d;_0x23c5ff[_0x5bd936(0x1a7)](_0x5508a7)&&_0x5c34f8[_0x5bd936(0x1b0)](_0x5508a7);}),_0x5c34f8['size']&&(await _0x5ac5d9[_0x26b86d(0x1e4)]('/universer-api/user/list',{'params':{'userIDs':[..._0x5c34f8]}}))[_0x26b86d(0x1ae)]['users'][_0x26b86d(0x1a9)](_0x1c6d5b=>{const _0x37ad39=_0x26b86d;_0x1c6d5b&&_0x23c5ff[_0x37ad39(0x177)](_0x1c6d5b);});};var _0x363d00=Object[_0xd67764(0x178)],_0x1965bd=(_0x9a3bd0,_0x6fb14a,_0xa98c8e,_0x47ae64)=>{for(var _0x5173cf=_0x47ae64>0x1?void 0x0:_0x47ae64?_0x363d00(_0x6fb14a,_0xa98c8e):_0x6fb14a,_0x44ef59=_0x9a3bd0['length']-0x1,_0x1ea466;_0x44ef59>=0x0;_0x44ef59--)(_0x1ea466=_0x9a3bd0[_0x44ef59])&&(_0x5173cf=_0x1ea466(_0x5173cf)||_0x5173cf);return _0x5173cf;},_0xc19667=(_0x34cb81,_0x48c081)=>(_0x7025ca,_0xc7fbdb)=>_0x48c081(_0x7025ca,_0xc7fbdb,_0x34cb81);let _0x8f3511=class extends _0x533e70[_0xd67764(0x1b1)]{constructor(_0x41e5aa,_0x34828c,_0x544c69,_0x46ecbf){const _0x5a51b2=_0xd67764;super(),this[_0x5a51b2(0x1ba)]=_0x41e5aa,this[_0x5a51b2(0x1ac)]=_0x34828c,this[_0x5a51b2(0x1e7)]=_0x544c69,this['_injector']=_0x46ecbf,this[_0x5a51b2(0x1f5)](),this[_0x5a51b2(0x1e0)]();}['_initUserSync'](){const _0x2a1466=_0xd67764;this[_0x2a1466(0x1aa)](this[_0x2a1466(0x1ac)][_0x2a1466(0x17e)][_0x2a1466(0x184)](_0x363ffb[_0x2a1466(0x18e)](0x10))[_0x2a1466(0x1cd)](_0x4087ce=>{const _0x60c112=_0x2a1466,_0x41f083=new Set();_0x4087ce[_0x60c112(0x1a9)](_0x4f18b0=>{const _0x266f64=_0x60c112;switch(_0x4f18b0[_0x266f64(0x17c)]){case _0x266f64(0x1ec):{const _0x1eb637=_0x4f18b0[_0x266f64(0x1f8)][_0x266f64(0x1a1)];_0x41f083[_0x266f64(0x1ec)](_0x1eb637);break;}}}),_0xa1bb66(this[_0x60c112(0x19d)],_0x41f083);}));}[_0xd67764(0x1f5)](){const _0x3468b0=_0xd67764;this[_0x3468b0(0x1aa)](this['_commentService'][_0x3468b0(0x17e)][_0x3468b0(0x1cd)](async _0x3bf02c=>{const _0x45649f=_0x3468b0;var _0x130acf,_0x37f5c5,_0x5886ba,_0xfc4603;const _0x5f1ed9=(_0x130acf=this['_threadCommentModel'][_0x45649f(0x191)](_0x3bf02c[_0x45649f(0x193)])[_0x45649f(0x1fc)](_0x2773e0=>_0x2773e0[_0x45649f(0x199)]===_0x3bf02c['threadId']))==null?void 0x0:_0x130acf[_0x45649f(0x1d2)];if(!_0x5f1ed9)return;const {unitId:_0x4642a0,subUnitId:_0x3ae869}=_0x5f1ed9;switch(_0x3bf02c[_0x45649f(0x18b)]&&this['_userService'][_0x45649f(0x177)](_0x3bf02c[_0x45649f(0x18b)]),_0x3bf02c[_0x45649f(0x17c)]){case _0x447af1[_0x45649f(0x19f)]:break;case _0x447af1[_0x45649f(0x1eb)]:{this[_0x45649f(0x1ac)][_0x45649f(0x1c0)](_0x4642a0,_0x3ae869,{'unitId':_0x4642a0,'subUnitId':_0x3ae869,'ref':'','id':_0x3bf02c['replyId'],'dT':_0x36926e(+_0x3bf02c[_0x45649f(0x192)]),'threadId':_0x3bf02c[_0x45649f(0x199)],'personId':(_0x5886ba=(_0x37f5c5=_0x3bf02c[_0x45649f(0x18b)])==null?void 0x0:_0x37f5c5[_0x45649f(0x1ed)])!=null?_0x5886ba:_0x3bf02c[_0x45649f(0x1a6)],'text':JSON['parse'](_0x3bf02c['content']),'parentId':_0x5f1ed9['id']});break;}case _0x447af1[_0x45649f(0x179)]:{const _0x167d79=this[_0x45649f(0x1ac)][_0x45649f(0x180)](_0x4642a0,_0x3ae869,_0x3bf02c[_0x45649f(0x1df)]);_0x167d79&&_0x167d79[_0x45649f(0x1f2)]&&this[_0x45649f(0x1ac)][_0x45649f(0x18f)](_0x4642a0,_0x3ae869,_0x3bf02c[_0x45649f(0x1df)]);break;}case _0x447af1[_0x45649f(0x1a5)]:{this[_0x45649f(0x1ac)][_0x45649f(0x1bb)](_0x4642a0,_0x3ae869,{'commentId':_0x3bf02c['replyId'],'text':JSON[_0x45649f(0x1d3)](_0x3bf02c[_0x45649f(0x1dc)])});break;}case _0x447af1['Solve']:{const _0x24b78b=(_0xfc4603=this['_threadCommentModel']['getUnit'](_0x3bf02c[_0x45649f(0x193)])[_0x45649f(0x1fc)](_0x186c65=>_0x186c65[_0x45649f(0x199)]===_0x3bf02c[_0x45649f(0x199)]))==null?void 0x0:_0xfc4603[_0x45649f(0x1d2)];_0x24b78b&&this[_0x45649f(0x1ac)][_0x45649f(0x1db)](_0x4642a0,_0x3ae869,_0x24b78b['id'],_0x3bf02c[_0x45649f(0x198)]===_0x3c522a[_0x45649f(0x1d0)]);break;}}}));}};_0x8f3511=_0x1965bd([_0xc19667(0x0,_0x533e70['Inject'](_0x3871da[_0xd67764(0x1d7)])),_0xc19667(0x1,_0x533e70[_0xd67764(0x1ee)](_0x3ce02e['ThreadCommentModel'])),_0xc19667(0x2,_0x533e70[_0xd67764(0x1ee)](_0x533e70[_0xd67764(0x1c5)])),_0xc19667(0x3,_0x533e70[_0xd67764(0x1ee)](_0x533e70['Injector']))],_0x8f3511);const _0x36b3b0='thread-comment-data-source.config',_0x4d9c69={};var _0x2bd032=Object[_0xd67764(0x178)],_0x3efbd8=(_0x1eb7f0,_0x3427ce,_0x588bb3,_0x16ed3f)=>{for(var _0x5315b6=_0x16ed3f>0x1?void 0x0:_0x16ed3f?_0x2bd032(_0x3427ce,_0x588bb3):_0x3427ce,_0x40605a=_0x1eb7f0['length']-0x1,_0x189777;_0x40605a>=0x0;_0x40605a--)(_0x189777=_0x1eb7f0[_0x40605a])&&(_0x5315b6=_0x189777(_0x5315b6)||_0x5315b6);return _0x5315b6;},_0x4ff84b=(_0x2e0d24,_0x230135)=>(_0x4bf249,_0x419074)=>_0x230135(_0x4bf249,_0x419074,_0x2e0d24);function _0x145529(_0x32cb57,_0x26cda5){const _0xbb4276=_0xd67764,_0x50fa2e=_0x32cb57[_0xbb4276(0x1c2)][0x0];return{..._0x26cda5,'id':_0x50fa2e[_0xbb4276(0x1df)],'resolved':_0x32cb57[_0xbb4276(0x198)]===0x1,'dT':_0x36926e(_0x50fa2e[_0xbb4276(0x192)]),'personId':_0x50fa2e['userId'],'threadId':_0x50fa2e[_0xbb4276(0x199)]};}function _0x35ea8c(_0x4dde6e,_0x29a0ff,_0x447ae){const _0x16e1a2=_0xd67764;var _0x4e7aac,_0x47d0fd;if(((_0x47d0fd=(_0x4e7aac=_0x4dde6e==null?void 0x0:_0x4dde6e['replies'])==null?void 0x0:_0x4e7aac['length'])!=null?_0x47d0fd:0x0)>0x0){const _0x544a18=(_0x3ca6ba,_0x543b9e)=>({'id':_0x3ca6ba[_0x16e1a2(0x1df)],'threadId':_0x3ca6ba[_0x16e1a2(0x199)],'dT':_0x36926e(_0x3ca6ba[_0x16e1a2(0x192)]),'personId':_0x3ca6ba[_0x16e1a2(0x1a6)],'resolved':_0x4dde6e[_0x16e1a2(0x198)]===_0x3c522a[_0x16e1a2(0x1d0)],'unitId':_0x29a0ff,'subUnitId':_0x447ae,'text':JSON[_0x16e1a2(0x1d3)](_0x3ca6ba[_0x16e1a2(0x1dc)]),'parentId':_0x543b9e}),_0x11b197=_0x544a18(_0x4dde6e[_0x16e1a2(0x1c2)][0x0]);return{..._0x11b197,'children':_0x4dde6e['replies'][_0x16e1a2(0x1bd)](0x1)[_0x16e1a2(0x17d)](_0x5945e2=>_0x544a18(_0x5945e2,_0x11b197['id']))};}return null;}let _0x407eca=class{constructor(_0x4d87ec,_0x9e6a15,_0x52ecaf,_0x55ba50){const _0x12c01d=_0xd67764;this[_0x12c01d(0x1d1)]=_0x4d87ec,this[_0x12c01d(0x1e7)]=_0x9e6a15,this[_0x12c01d(0x175)]=_0x52ecaf,this[_0x12c01d(0x19d)]=_0x55ba50;}async['addComment'](_0x4e9d0e){const _0x3a8471=_0xd67764;var _0x462d73,_0x1ad62d;const {parentId:_0x216302,unitId:_0x53aca3,text:_0x25479f,threadId:_0x5df593}=_0x4e9d0e,_0x1de09=(_0x1ad62d=(_0x462d73=_0x25479f[_0x3a8471(0x1ab)])==null?void 0x0:_0x462d73[_0x3a8471(0x1b9)](_0x4ab3d0=>_0x4ab3d0[_0x3a8471(0x1e3)]===_0x533e70[_0x3a8471(0x19b)][_0x3a8471(0x1de)])[_0x3a8471(0x17d)](_0x3bd196=>_0x3bd196[_0x3a8471(0x1a4)]))!=null?_0x1ad62d:[],_0x21e251=JSON['stringify'](_0x25479f),_0xb4dd94=(await this[_0x3a8471(0x175)]['requireSession'](_0x53aca3))['getMemberID']();if(_0x216302){const _0x3f81af={'memberId':_0xb4dd94,'unitId':_0x53aca3,'content':_0x21e251,'mention':_0x1de09,'threadId':_0x5df593},_0x590108=(await this['_httpService'][_0x3a8471(0x1c1)](_0x3a8471(0x1a3)+_0x53aca3+_0x3a8471(0x18c),{'body':_0x3f81af}))[_0x3a8471(0x1ae)][_0x3a8471(0x1e9)];return{..._0x4e9d0e,'id':_0x590108['replyId'],'dT':_0x533e70[_0x3a8471(0x181)](+_0x590108[_0x3a8471(0x192)])['format'](_0x3a8471(0x1b4)),'personId':_0x590108[_0x3a8471(0x1a6)]};}else{const _0x241094={'memberId':_0xb4dd94,'unitId':_0x53aca3,'content':_0x21e251,'mention':_0x1de09},_0xc27d9b=await this[_0x3a8471(0x1d1)][_0x3a8471(0x1c1)](_0x3a8471(0x1a3)+_0x53aca3+_0x3a8471(0x1f4),{'body':_0x241094});return _0x145529(_0xc27d9b[_0x3a8471(0x1ae)]['comment'],_0x4e9d0e);}}async[_0xd67764(0x1bb)](_0x16baec){const _0x4a0be9=_0xd67764;var _0x545ba7,_0x1aff1d;const {text:_0x2e55eb,unitId:_0x4d4372}=_0x16baec,_0x3be248=(_0x1aff1d=(_0x545ba7=_0x2e55eb[_0x4a0be9(0x1ab)])==null?void 0x0:_0x545ba7[_0x4a0be9(0x1b9)](_0x49b258=>_0x49b258[_0x4a0be9(0x1e3)]===_0x533e70[_0x4a0be9(0x19b)][_0x4a0be9(0x1de)])[_0x4a0be9(0x17d)](_0x1dc274=>_0x1dc274[_0x4a0be9(0x1a4)]))!=null?_0x1aff1d:[],_0x1118d8=JSON[_0x4a0be9(0x1b3)](_0x2e55eb),_0xf70581=_0x16baec[_0x4a0be9(0x199)],_0x5a0348=_0x16baec['id'],_0x1e721d={'memberId':(await this[_0x4a0be9(0x175)]['requireSession'](_0x4d4372))[_0x4a0be9(0x1d9)](),'unitId':_0x4d4372,'threadId':_0xf70581,'mention':_0x3be248,'content':_0x1118d8,'replyId':_0x5a0348},_0x3b2790=await this[_0x4a0be9(0x1d1)][_0x4a0be9(0x1c1)](_0x4a0be9(0x1a3)+_0x4d4372+_0x4a0be9(0x1ad),{'body':_0x1e721d});return!_0x3b2790[_0x4a0be9(0x1ae)][_0x4a0be9(0x1c6)]||_0x3b2790['body'][_0x4a0be9(0x1c6)][_0x4a0be9(0x1e5)]===0x1;}async[_0xd67764(0x1db)](_0x697dd){const _0xb78577=_0xd67764,{unitId:_0x16e60c}=_0x697dd,_0x1f4d1d=_0x697dd[_0xb78577(0x199)],_0xdf6f5a={'memberId':this[_0xb78577(0x1e7)]['getCurrentUser']()[_0xb78577(0x1ed)],'unitId':_0x16e60c,'threadId':_0x1f4d1d,'solved':_0x697dd['resolved']?_0x3c522a['Solved']:_0x3c522a[_0xb78577(0x1af)]},_0x2428b5=await this[_0xb78577(0x1d1)][_0xb78577(0x1c1)](_0xb78577(0x1a3)+_0x16e60c+_0xb78577(0x187),{'body':_0xdf6f5a});return!_0x2428b5[_0xb78577(0x1ae)][_0xb78577(0x1c6)]||_0x2428b5[_0xb78577(0x1ae)]['error'][_0xb78577(0x1e5)]===0x1;}async[_0xd67764(0x18f)](_0x359ccc,_0x174396,_0x1b6f81,_0x2eedfc){const _0x50ce3f=_0xd67764,_0x9beb9d={'memberId':(await this['_sessionService'][_0x50ce3f(0x18d)](_0x359ccc))[_0x50ce3f(0x1d9)](),'threadId':_0x1b6f81,'replyId':_0x2eedfc,'unitId':_0x359ccc},_0x4d764f=await this[_0x50ce3f(0x1d1)]['post']('/universer-api/comment/unit/'+_0x359ccc+'/delete',{'body':_0x9beb9d});return!_0x4d764f[_0x50ce3f(0x1ae)][_0x50ce3f(0x1c6)]||_0x4d764f[_0x50ce3f(0x1ae)][_0x50ce3f(0x1c6)]['code']===0x1;}async[_0xd67764(0x1f7)](_0x31682f,_0x2d133f,_0x44768c){const _0x127e88=_0xd67764,_0x51817c={'unitId':_0x31682f,'threadId':_0x44768c},_0x3638d8=await this[_0x127e88(0x1d1)][_0x127e88(0x1c1)](_0x127e88(0x1a3)+_0x31682f+_0x127e88(0x1f0),{'body':_0x51817c}),_0x12e74d=_0x44768c[_0x127e88(0x17d)](_0x5bcf3b=>_0x35ea8c(_0x3638d8['body'][_0x127e88(0x1d4)][_0x5bcf3b],_0x31682f,_0x2d133f))[_0x127e88(0x1b9)](Boolean);return Object[_0x127e88(0x1f3)](_0x3638d8['body'][_0x127e88(0x1be)])[_0x127e88(0x1a9)](_0xb17755=>{const _0x1ed35d=_0x127e88;this[_0x1ed35d(0x1e7)]['addUser'](_0xb17755);}),_0x12e74d;}['saveCommentToSnapshot'](_0x4ccf30){const _0xc9a88=_0xd67764;return{'id':_0x4ccf30['id'],'threadId':_0x4ccf30[_0xc9a88(0x199)],'ref':_0x4ccf30[_0xc9a88(0x1ef)]};}};_0x407eca=_0x3efbd8([_0x4ff84b(0x0,_0x533e70[_0xd67764(0x1ee)](_0x457d43[_0xd67764(0x1b2)])),_0x4ff84b(0x1,_0x533e70['Inject'](_0x533e70[_0xd67764(0x1c5)])),_0x4ff84b(0x2,_0x533e70['Inject'](_0x3871da[_0xd67764(0x196)])),_0x4ff84b(0x3,_0x533e70['Inject'](_0x533e70[_0xd67764(0x185)]))],_0x407eca);var _0x28a2b6=Object[_0xd67764(0x178)],_0x2e3a05=(_0x68ee86,_0x465ff7,_0x3da224,_0x176324)=>{for(var _0x4ede24=_0x176324>0x1?void 0x0:_0x176324?_0x28a2b6(_0x465ff7,_0x3da224):_0x465ff7,_0xc629cd=_0x68ee86['length']-0x1,_0x3299e0;_0xc629cd>=0x0;_0xc629cd--)(_0x3299e0=_0x68ee86[_0xc629cd])&&(_0x4ede24=_0x3299e0(_0x4ede24)||_0x4ede24);return _0x4ede24;},_0x72a1ea=(_0x37468d,_0x147258)=>(_0x160e10,_0x29fb51)=>_0x147258(_0x160e10,_0x29fb51,_0x37468d);let _0x307b6a=class extends _0x533e70[_0xd67764(0x1b1)]{constructor(_0x2dd793,_0x4caca1){const _0x3f4cdf=_0xd67764;super(),this[_0x3f4cdf(0x1fb)]=_0x2dd793,this[_0x3f4cdf(0x1bf)]=_0x4caca1,this[_0x3f4cdf(0x1e2)]();}[_0xd67764(0x1e2)](){const _0x1d5e5a=_0xd67764;this[_0x1d5e5a(0x1fb)]['dataSource']=this[_0x1d5e5a(0x1bf)],this[_0x1d5e5a(0x1fb)][_0x1d5e5a(0x1b8)]=!0x1;}};_0x307b6a=_0x2e3a05([_0x72a1ea(0x0,_0x3ce02e[_0xd67764(0x1d8)]),_0x72a1ea(0x1,_0x533e70[_0xd67764(0x1ee)](_0x407eca))],_0x307b6a);var _0x1c3c13=Object[_0xd67764(0x1c8)],_0x17cd52=Object[_0xd67764(0x178)],_0x25ca65=(_0x4211fa,_0x48f40b,_0x4232f1)=>_0x48f40b in _0x4211fa?_0x1c3c13(_0x4211fa,_0x48f40b,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x4232f1}):_0x4211fa[_0x48f40b]=_0x4232f1,_0x4d5234=(_0x411fa9,_0x7ec6c,_0x20b3c8,_0x3d1bcc)=>{const _0x717cf4=_0xd67764;for(var _0x59f714=_0x3d1bcc>0x1?void 0x0:_0x3d1bcc?_0x17cd52(_0x7ec6c,_0x20b3c8):_0x7ec6c,_0x24988d=_0x411fa9[_0x717cf4(0x182)]-0x1,_0x3ba6cf;_0x24988d>=0x0;_0x24988d--)(_0x3ba6cf=_0x411fa9[_0x24988d])&&(_0x59f714=_0x3ba6cf(_0x59f714)||_0x59f714);return _0x59f714;},_0x1be6f4=(_0xdd7980,_0xe881bf)=>(_0x3e7f42,_0x49d6e5)=>_0xe881bf(_0x3e7f42,_0x49d6e5,_0xdd7980),_0x1bfb74=(_0x260e6e,_0x3145e7,_0x2876cf)=>_0x25ca65(_0x260e6e,typeof _0x3145e7!=_0xd67764(0x1ce)?_0x3145e7+'':_0x3145e7,_0x2876cf);_0x5a7c67[_0xd67764(0x1bc)]=class extends _0x533e70['Plugin']{constructor(_0x2f3352=_0x4d9c69,_0x41d564,_0x17f59c){const _0x4197c0=_0xd67764;super(),this[_0x4197c0(0x1c4)]=_0x2f3352,this[_0x4197c0(0x19d)]=_0x41d564,this[_0x4197c0(0x1f6)]=_0x17f59c;const {..._0x50cadc}=_0x533e70[_0x4197c0(0x18a)]({},_0x4d9c69,this[_0x4197c0(0x1c4)]);this[_0x4197c0(0x1f6)]['setConfig'](_0x36b3b0,_0x50cadc);}[_0xd67764(0x1da)](){const _0x5be3f2=_0xd67764;[[_0x407eca],[_0x307b6a],[_0x8f3511]][_0x5be3f2(0x1a9)](_0x40e62f=>{const _0x26c88d=_0x5be3f2;this[_0x26c88d(0x19d)][_0x26c88d(0x1ec)](_0x40e62f);});}['onReady'](){const _0x43d58f=_0xd67764;this[_0x43d58f(0x19d)][_0x43d58f(0x1e4)](_0x307b6a),this[_0x43d58f(0x19d)]['get'](_0x8f3511);}},_0x1bfb74(_0x5a7c67[_0xd67764(0x1bc)],'pluginName',_0x322963),_0x1bfb74(_0x5a7c67['UniverThreadCommentDataSourcePlugin'],_0xd67764(0x17c),_0x533e70[_0xd67764(0x1c7)][_0xd67764(0x197)]),_0x5a7c67['UniverThreadCommentDataSourcePlugin']=_0x4d5234([_0x533e70['DependentOn'](_0x2a2413[_0xd67764(0x1f9)],_0x3871da[_0xd67764(0x1b6)],_0x46729d[_0xd67764(0x1d5)]),_0x1be6f4(0x1,_0x533e70['Inject'](_0x533e70[_0xd67764(0x185)])),_0x1be6f4(0x2,_0x533e70[_0xd67764(0x19a)])],_0x5a7c67[_0xd67764(0x1bc)]),Object['defineProperty'](_0x5a7c67,Symbol[_0xd67764(0x188)],{'value':_0xd67764(0x1c3)});}));function _0x5c16(){const _0x49c782=['comments','UniverLicensePlugin','1496pPnidA','CommentService','IThreadCommentDataSourceService','getMemberID','onStarting','resolveComment','content','UniverNetwork','COMMENT','replyId','_initUserSync','@univerjs/network','_initDataSource','rangeType','get','code','@univerjs-pro/license','_userService','amd','reply','1ESvHtD','Reply','add','userID','Inject','ref','/list','160vEOGZC','parentId','values','/add','_init','_configService','listComments','payload','UniverThreadCommentUIPlugin','UniverProThreadCommentDatasource','_threadCommentDataSourceService','find','_sessionService','@univerjs/thread-comment-ui','addUser','getOwnPropertyDescriptor','Delete','object','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','type','map','commentUpdate$','970354jDfNcp','getComment','dayjs','length','UniverCore','pipe','Injector','Solve','/solved','toStringTag','36117fkrrOb','merge','user','/reply','requireSession','bufferTime','deleteComment','428060CHSyVL','getUnit','createTimestamp','unitId','689382VHfeIN','rxjs','CollaborationSessionService','UNIVER_UNKNOWN','solved','threadId','IConfigService','CustomRangeType','UniverProCollaborationClient','_injector','UniverProLicense','Add','70250vebvLD','personId','function','/universer-api/comment/unit/','rangeId','Edit','userId','getUser','@univerjs-pro/collaboration-client','forEach','disposeWithMe','customRanges','_threadCommentModel','/edit','body','OpenOrReOpen','delete','Disposable','HTTPService','stringify','YYYY/MM/DD\x20HH:mm','21430387nnDsHH','UniverCollaborationClientPlugin','@univerjs/thread-comment','syncUpdateMutationToColla','filter','_commentService','updateComment','UniverThreadCommentDataSourcePlugin','slice','users','_threadCommentDataSource','addComment','post','replies','Module','_config','UserManagerService','error','UniverInstanceType','defineProperty','UNRECOGNIZED','6CbWOWp','UniverThreadComment','1251441gsBtFq','subscribe','symbol','12LvXfLe','Solved','_httpService','root','parse'];_0x5c16=function(){return _0x49c782;};return _0x5c16();}
|
|
1
|
+
function _0x25fe(){const _0x10db70=['CustomRangeType','_init','@univerjs/network','/universer-api/comment/unit/','function','1798aGzFXE','customRanges','Disposable','_config','disposeWithMe','/add','bufferTime','2326626YwJphK','OpenOrReOpen','payload','requireSession','users','syncUpdateMutationToColla','@univerjs/thread-comment','UniverLicensePlugin','dataSource','UniverProCollaborationClient','comment','UniverThreadCommentDataSourcePlugin','commentUpdate$','error','resolveComment','saveCommentToSnapshot','getMemberID','ref','@univerjs-pro/license','UniverThreadCommentUIPlugin','solved','stringify','getOwnPropertyDescriptor','Solved','exports','/reply','rangeId','forEach','CollaborationSessionService','UniverProThreadCommentDatasource','_sessionService','11006964gnNmvG','@univerjs/thread-comment-ui','UserManagerService','format','COMMENT','reply','parentId','object','getComment','Injector','listComments','7acTGts','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','/edit','rangeType','setConfig','user','rxjs','_threadCommentDataSource','UniverThreadCommentUi','addUser','getUser','createTimestamp','IConfigService','_initUserSync','content','Inject','UNRECOGNIZED','resolved','values','map','delete','deleteComment','personId','root','_injector','amd','/solved','Add','addComment','replyId','filter','Unknown','get','userId','1817945mEWvJx','UniverThreadComment','merge','_threadCommentDataSourceService','Plugin','YYYY/MM/DD\x20HH:mm','_threadCommentModel','unitId','HTTPService','type','updateComment','Delete','Solve','1290088ufJEXD','Reply','_httpService','_configService','_commentService','Module','_userService','@univerjs-pro/collaboration-client','slice','DependentOn','userID','Edit','/universer-api/user/list','onReady','post','1942392pMYGEe','parse','@univerjs/core','size','163xLJYYk','add','code','body','length','_initDataSource','5716206pFQBeO','pluginName','threadId','getUnit','IThreadCommentDataSourceService','replies','dayjs','defineProperty'];_0x25fe=function(){return _0x10db70;};return _0x25fe();}function _0x3e29(_0x38c5a5,_0x3ab47a){const _0x25feda=_0x25fe();return _0x3e29=function(_0x3e2974,_0x433da8){_0x3e2974=_0x3e2974-0x143;let _0x2b4a17=_0x25feda[_0x3e2974];return _0x2b4a17;},_0x3e29(_0x38c5a5,_0x3ab47a);}(function(_0x5b5a5d,_0x90a255){const _0x3d89a1=_0x3e29,_0x2ef233=_0x5b5a5d();while(!![]){try{const _0x298082=parseInt(_0x3d89a1(0x17a))/0x1*(parseInt(_0x3d89a1(0x18d))/0x2)+-parseInt(_0x3d89a1(0x194))/0x3+parseInt(_0x3d89a1(0x167))/0x4+parseInt(_0x3d89a1(0x15a))/0x5+-parseInt(_0x3d89a1(0x180))/0x6+-parseInt(_0x3d89a1(0x1be))/0x7*(-parseInt(_0x3d89a1(0x176))/0x8)+parseInt(_0x3d89a1(0x1b3))/0x9;if(_0x298082===_0x90a255)break;else _0x2ef233['push'](_0x2ef233['shift']());}catch(_0x493530){_0x2ef233['push'](_0x2ef233['shift']());}}}(_0x25fe,0x8b358),function(_0x368115,_0x194c62){const _0x7456cf=_0x3e29;typeof exports==_0x7456cf(0x1ba)&&typeof module<'u'?_0x194c62(exports,require('@univerjs-pro/collaboration-client'),require(_0x7456cf(0x1a6)),require(_0x7456cf(0x178)),require(_0x7456cf(0x1b4)),require(_0x7456cf(0x19a)),require(_0x7456cf(0x1c4)),require(_0x7456cf(0x18a))):typeof define==_0x7456cf(0x18c)&&define[_0x7456cf(0x151)]?define([_0x7456cf(0x1ac),_0x7456cf(0x16e),_0x7456cf(0x1a6),_0x7456cf(0x178),_0x7456cf(0x1b4),_0x7456cf(0x19a),_0x7456cf(0x1c4),_0x7456cf(0x18a)],_0x194c62):(_0x368115=typeof globalThis<'u'?globalThis:_0x368115||self,_0x194c62(_0x368115[_0x7456cf(0x1b1)]={},_0x368115[_0x7456cf(0x19d)],_0x368115['UniverProLicense'],_0x368115['UniverCore'],_0x368115[_0x7456cf(0x1c6)],_0x368115[_0x7456cf(0x15b)],_0x368115[_0x7456cf(0x1c4)],_0x368115['UniverNetwork']));}(this,function(_0x2d8bcc,_0x28f217,_0x1856e,_0x246273,_0x4ba1c9,_0x42fda6,_0x3ab731,_0x18347f){'use strict';const _0xbfbb68=_0x3e29;const _0x3db14e=_0xbfbb68(0x1bf);var _0x3a0bd4=(_0x3b8657=>(_0x3b8657[_0x3b8657[_0xbfbb68(0x195)]=0x0]='OpenOrReOpen',_0x3b8657[_0x3b8657['Solved']=0x1]=_0xbfbb68(0x1ab),_0x3b8657[_0x3b8657[_0xbfbb68(0x148)]=-0x1]=_0xbfbb68(0x148),_0x3b8657))(_0x3a0bd4||{}),_0x4c7360=(_0x369f03=>(_0x369f03[_0x369f03[_0xbfbb68(0x157)]=0x0]=_0xbfbb68(0x157),_0x369f03[_0x369f03[_0xbfbb68(0x153)]=0x1]=_0xbfbb68(0x153),_0x369f03[_0x369f03['Reply']=0x2]='Reply',_0x369f03[_0x369f03[_0xbfbb68(0x172)]=0x3]='Edit',_0x369f03[_0x369f03[_0xbfbb68(0x165)]=0x4]='Delete',_0x369f03[_0x369f03[_0xbfbb68(0x166)]=0x5]='Solve',_0x369f03[_0x369f03[_0xbfbb68(0x148)]=-0x1]=_0xbfbb68(0x148),_0x369f03))(_0x4c7360||{});const _0x3b8a25=_0x471489=>_0x246273[_0xbfbb68(0x186)](new Date(+_0x471489))['format'](_0xbfbb68(0x15f)),_0x22e8b8=async(_0x29c91b,_0xc2eac8)=>{const _0x266f50=_0xbfbb68,_0x3537bd=_0x29c91b[_0x266f50(0x158)](_0x246273[_0x266f50(0x1b5)]),_0x1676c7=_0x29c91b[_0x266f50(0x158)](_0x18347f[_0x266f50(0x162)]);_0xc2eac8[_0x266f50(0x1af)](_0x5a7b50=>{const _0x75ff85=_0x266f50;_0x3537bd[_0x75ff85(0x1c8)](_0x5a7b50)&&_0xc2eac8[_0x75ff85(0x14c)](_0x5a7b50);}),_0xc2eac8[_0x266f50(0x179)]&&(await _0x1676c7['get'](_0x266f50(0x173),{'params':{'userIDs':[..._0xc2eac8]}}))[_0x266f50(0x17d)][_0x266f50(0x198)][_0x266f50(0x1af)](_0x4ed60a=>{const _0x6cb27c=_0x266f50;_0x4ed60a&&_0x3537bd[_0x6cb27c(0x1c7)](_0x4ed60a);});};var _0x3fecba=Object[_0xbfbb68(0x1aa)],_0x7e1b9e=(_0x4deb38,_0xa365bc,_0x2412ca,_0x51f396)=>{const _0x37471f=_0xbfbb68;for(var _0x49729e=_0x51f396>0x1?void 0x0:_0x51f396?_0x3fecba(_0xa365bc,_0x2412ca):_0xa365bc,_0x11cb65=_0x4deb38[_0x37471f(0x17e)]-0x1,_0x48b179;_0x11cb65>=0x0;_0x11cb65--)(_0x48b179=_0x4deb38[_0x11cb65])&&(_0x49729e=_0x48b179(_0x49729e)||_0x49729e);return _0x49729e;},_0x54d2e3=(_0x8c64d1,_0x1e42c7)=>(_0x12dba0,_0x512fc0)=>_0x1e42c7(_0x12dba0,_0x512fc0,_0x8c64d1);let _0x43dc89=class extends _0x246273['Disposable']{constructor(_0x1442f2,_0x4a49ae,_0x5b4ad9,_0x3e122e){const _0x1032ce=_0xbfbb68;super(),this['_commentService']=_0x1442f2,this[_0x1032ce(0x160)]=_0x4a49ae,this[_0x1032ce(0x16d)]=_0x5b4ad9,this['_injector']=_0x3e122e,this[_0x1032ce(0x189)](),this[_0x1032ce(0x145)]();}[_0xbfbb68(0x145)](){const _0x45c254=_0xbfbb68;this['disposeWithMe'](this[_0x45c254(0x160)][_0x45c254(0x1a0)]['pipe'](_0x3ab731[_0x45c254(0x193)](0x10))['subscribe'](_0x5e93df=>{const _0x1d99b0=_0x45c254,_0x55789a=new Set();_0x5e93df[_0x1d99b0(0x1af)](_0x2828b9=>{const _0x294cf6=_0x1d99b0;switch(_0x2828b9[_0x294cf6(0x163)]){case _0x294cf6(0x17b):{const _0x3cbb61=_0x2828b9[_0x294cf6(0x196)][_0x294cf6(0x14e)];_0x55789a[_0x294cf6(0x17b)](_0x3cbb61);break;}}}),_0x22e8b8(this[_0x1d99b0(0x150)],_0x55789a);}));}['_init'](){const _0x4caab5=_0xbfbb68;this[_0x4caab5(0x191)](this[_0x4caab5(0x16b)][_0x4caab5(0x1a0)]['subscribe'](async _0x2a7c36=>{const _0x42f5f6=_0x4caab5;var _0x3a6993,_0x3d55d0,_0x3b43f1,_0x374778;const _0x1779eb=(_0x3a6993=this['_threadCommentModel'][_0x42f5f6(0x183)](_0x2a7c36[_0x42f5f6(0x161)])['find'](_0x2f78b0=>_0x2f78b0[_0x42f5f6(0x182)]===_0x2a7c36[_0x42f5f6(0x182)]))==null?void 0x0:_0x3a6993[_0x42f5f6(0x14f)];if(!_0x1779eb)return;const {unitId:_0x18f82c,subUnitId:_0x2a5669}=_0x1779eb;switch(_0x2a7c36[_0x42f5f6(0x1c3)]&&this[_0x42f5f6(0x16d)]['addUser'](_0x2a7c36['user']),_0x2a7c36[_0x42f5f6(0x163)]){case _0x4c7360[_0x42f5f6(0x153)]:break;case _0x4c7360[_0x42f5f6(0x168)]:{this[_0x42f5f6(0x160)]['addComment'](_0x18f82c,_0x2a5669,{'unitId':_0x18f82c,'subUnitId':_0x2a5669,'ref':'','id':_0x2a7c36[_0x42f5f6(0x155)],'dT':_0x3b8a25(+_0x2a7c36[_0x42f5f6(0x143)]),'threadId':_0x2a7c36['threadId'],'personId':(_0x3b43f1=(_0x3d55d0=_0x2a7c36[_0x42f5f6(0x1c3)])==null?void 0x0:_0x3d55d0[_0x42f5f6(0x171)])!=null?_0x3b43f1:_0x2a7c36[_0x42f5f6(0x159)],'text':JSON[_0x42f5f6(0x177)](_0x2a7c36[_0x42f5f6(0x146)]),'parentId':_0x1779eb['id']});break;}case _0x4c7360[_0x42f5f6(0x165)]:{const _0x448fc0=this[_0x42f5f6(0x160)][_0x42f5f6(0x1bb)](_0x18f82c,_0x2a5669,_0x2a7c36[_0x42f5f6(0x155)]);_0x448fc0&&_0x448fc0[_0x42f5f6(0x1b9)]&&this[_0x42f5f6(0x160)][_0x42f5f6(0x14d)](_0x18f82c,_0x2a5669,_0x2a7c36[_0x42f5f6(0x155)]);break;}case _0x4c7360[_0x42f5f6(0x172)]:{this[_0x42f5f6(0x160)][_0x42f5f6(0x164)](_0x18f82c,_0x2a5669,{'commentId':_0x2a7c36['replyId'],'text':JSON['parse'](_0x2a7c36[_0x42f5f6(0x146)])});break;}case _0x4c7360[_0x42f5f6(0x166)]:{const _0x30a558=(_0x374778=this['_threadCommentModel']['getUnit'](_0x2a7c36[_0x42f5f6(0x161)])['find'](_0x59e2fa=>_0x59e2fa[_0x42f5f6(0x182)]===_0x2a7c36['threadId']))==null?void 0x0:_0x374778[_0x42f5f6(0x14f)];_0x30a558&&this[_0x42f5f6(0x160)][_0x42f5f6(0x1a2)](_0x18f82c,_0x2a5669,_0x30a558['id'],_0x2a7c36[_0x42f5f6(0x1a8)]===_0x3a0bd4[_0x42f5f6(0x1ab)]);break;}}}));}};_0x43dc89=_0x7e1b9e([_0x54d2e3(0x0,_0x246273['Inject'](_0x28f217['CommentService'])),_0x54d2e3(0x1,_0x246273[_0xbfbb68(0x147)](_0x42fda6['ThreadCommentModel'])),_0x54d2e3(0x2,_0x246273[_0xbfbb68(0x147)](_0x246273[_0xbfbb68(0x1b5)])),_0x54d2e3(0x3,_0x246273[_0xbfbb68(0x147)](_0x246273[_0xbfbb68(0x1bc)]))],_0x43dc89);const _0x5d590e='thread-comment-data-source.config',_0x3010a9={};var _0x104e8c=Object[_0xbfbb68(0x1aa)],_0x139f50=(_0x36bddd,_0xe9ebd5,_0x5af84b,_0x307c8b)=>{for(var _0x10b735=_0x307c8b>0x1?void 0x0:_0x307c8b?_0x104e8c(_0xe9ebd5,_0x5af84b):_0xe9ebd5,_0x148ef7=_0x36bddd['length']-0x1,_0x38e649;_0x148ef7>=0x0;_0x148ef7--)(_0x38e649=_0x36bddd[_0x148ef7])&&(_0x10b735=_0x38e649(_0x10b735)||_0x10b735);return _0x10b735;},_0x198fc1=(_0x14424c,_0x14bb6f)=>(_0x211058,_0x532dbd)=>_0x14bb6f(_0x211058,_0x532dbd,_0x14424c);function _0x204947(_0xbb3599,_0x45c457){const _0x5ba62f=_0xbfbb68,_0x37d35f=_0xbb3599['replies'][0x0];return{..._0x45c457,'id':_0x37d35f[_0x5ba62f(0x155)],'resolved':_0xbb3599[_0x5ba62f(0x1a8)]===0x1,'dT':_0x3b8a25(_0x37d35f[_0x5ba62f(0x143)]),'personId':_0x37d35f['userId'],'threadId':_0x37d35f['threadId']};}function _0x187e86(_0x103e35,_0x31c1cf,_0x4e5868){const _0x2c3b5e=_0xbfbb68;var _0x77fce1,_0x3e1fed;if(((_0x3e1fed=(_0x77fce1=_0x103e35==null?void 0x0:_0x103e35[_0x2c3b5e(0x185)])==null?void 0x0:_0x77fce1[_0x2c3b5e(0x17e)])!=null?_0x3e1fed:0x0)>0x0){const _0x131aa4=(_0x28da2b,_0x3c363c)=>({'id':_0x28da2b['replyId'],'threadId':_0x28da2b['threadId'],'dT':_0x3b8a25(_0x28da2b[_0x2c3b5e(0x143)]),'personId':_0x28da2b[_0x2c3b5e(0x159)],'resolved':_0x103e35[_0x2c3b5e(0x1a8)]===_0x3a0bd4['Solved'],'unitId':_0x31c1cf,'subUnitId':_0x4e5868,'text':JSON[_0x2c3b5e(0x177)](_0x28da2b['content']),'parentId':_0x3c363c}),_0xf3724f=_0x131aa4(_0x103e35[_0x2c3b5e(0x185)][0x0]);return{..._0xf3724f,'children':_0x103e35['replies'][_0x2c3b5e(0x16f)](0x1)[_0x2c3b5e(0x14b)](_0x488cb5=>_0x131aa4(_0x488cb5,_0xf3724f['id']))};}return null;}let _0x16099b=class{constructor(_0x5968de,_0x55bbee,_0x45f556,_0x15c013){const _0x2bd99e=_0xbfbb68;this[_0x2bd99e(0x169)]=_0x5968de,this['_userService']=_0x55bbee,this[_0x2bd99e(0x1b2)]=_0x45f556,this[_0x2bd99e(0x150)]=_0x15c013;}async[_0xbfbb68(0x154)](_0x16cd77){const _0x45b5be=_0xbfbb68;var _0x457dd8,_0x333c69;const {parentId:_0x2f3697,unitId:_0x242a19,text:_0x970353,threadId:_0x2ec609}=_0x16cd77,_0x27f699=(_0x333c69=(_0x457dd8=_0x970353['customRanges'])==null?void 0x0:_0x457dd8[_0x45b5be(0x156)](_0x783944=>_0x783944[_0x45b5be(0x1c1)]===_0x246273[_0x45b5be(0x188)]['COMMENT'])[_0x45b5be(0x14b)](_0xebde3b=>_0xebde3b['rangeId']))!=null?_0x333c69:[],_0x164f3f=JSON['stringify'](_0x970353),_0x704682=(await this[_0x45b5be(0x1b2)][_0x45b5be(0x197)](_0x242a19))[_0x45b5be(0x1a4)]();if(_0x2f3697){const _0x3c0cb7={'memberId':_0x704682,'unitId':_0x242a19,'content':_0x164f3f,'mention':_0x27f699,'threadId':_0x2ec609},_0x2ddbdf=(await this[_0x45b5be(0x169)][_0x45b5be(0x175)](_0x45b5be(0x18b)+_0x242a19+_0x45b5be(0x1ad),{'body':_0x3c0cb7}))[_0x45b5be(0x17d)][_0x45b5be(0x1b8)];return{..._0x16cd77,'id':_0x2ddbdf[_0x45b5be(0x155)],'dT':_0x246273['dayjs'](+_0x2ddbdf['createTimestamp'])[_0x45b5be(0x1b6)](_0x45b5be(0x15f)),'personId':_0x2ddbdf['userId']};}else{const _0x4313ba={'memberId':_0x704682,'unitId':_0x242a19,'content':_0x164f3f,'mention':_0x27f699},_0x4d3146=await this[_0x45b5be(0x169)]['post'](_0x45b5be(0x18b)+_0x242a19+_0x45b5be(0x192),{'body':_0x4313ba});return _0x204947(_0x4d3146[_0x45b5be(0x17d)][_0x45b5be(0x19e)],_0x16cd77);}}async[_0xbfbb68(0x164)](_0x14dd92){const _0x31c751=_0xbfbb68;var _0x28aa63,_0x897fc0;const {text:_0x7aed7d,unitId:_0x35ea7e}=_0x14dd92,_0x4562df=(_0x897fc0=(_0x28aa63=_0x7aed7d[_0x31c751(0x18e)])==null?void 0x0:_0x28aa63[_0x31c751(0x156)](_0x28ba52=>_0x28ba52[_0x31c751(0x1c1)]===_0x246273[_0x31c751(0x188)][_0x31c751(0x1b7)])['map'](_0x16a2d5=>_0x16a2d5[_0x31c751(0x1ae)]))!=null?_0x897fc0:[],_0x100b38=JSON[_0x31c751(0x1a9)](_0x7aed7d),_0x143d70=_0x14dd92[_0x31c751(0x182)],_0x2fee53=_0x14dd92['id'],_0x5259c7={'memberId':(await this[_0x31c751(0x1b2)]['requireSession'](_0x35ea7e))[_0x31c751(0x1a4)](),'unitId':_0x35ea7e,'threadId':_0x143d70,'mention':_0x4562df,'content':_0x100b38,'replyId':_0x2fee53},_0x2a9539=await this[_0x31c751(0x169)][_0x31c751(0x175)](_0x31c751(0x18b)+_0x35ea7e+_0x31c751(0x1c0),{'body':_0x5259c7});return!_0x2a9539[_0x31c751(0x17d)]['error']||_0x2a9539['body']['error']['code']===0x1;}async[_0xbfbb68(0x1a2)](_0x41ec83){const _0x14925b=_0xbfbb68,{unitId:_0x1187d0}=_0x41ec83,_0x2ac6fc=_0x41ec83['threadId'],_0x5ef55e={'memberId':this['_userService']['getCurrentUser']()[_0x14925b(0x171)],'unitId':_0x1187d0,'threadId':_0x2ac6fc,'solved':_0x41ec83[_0x14925b(0x149)]?_0x3a0bd4[_0x14925b(0x1ab)]:_0x3a0bd4[_0x14925b(0x195)]},_0x127144=await this[_0x14925b(0x169)][_0x14925b(0x175)](_0x14925b(0x18b)+_0x1187d0+_0x14925b(0x152),{'body':_0x5ef55e});return!_0x127144[_0x14925b(0x17d)][_0x14925b(0x1a1)]||_0x127144[_0x14925b(0x17d)][_0x14925b(0x1a1)]['code']===0x1;}async[_0xbfbb68(0x14d)](_0x1ebcce,_0x3a3192,_0x4fe00f,_0x420031){const _0x37a9f9=_0xbfbb68,_0x484d97={'memberId':(await this[_0x37a9f9(0x1b2)][_0x37a9f9(0x197)](_0x1ebcce))[_0x37a9f9(0x1a4)](),'threadId':_0x4fe00f,'replyId':_0x420031,'unitId':_0x1ebcce},_0x2acedc=await this[_0x37a9f9(0x169)][_0x37a9f9(0x175)](_0x37a9f9(0x18b)+_0x1ebcce+'/delete',{'body':_0x484d97});return!_0x2acedc[_0x37a9f9(0x17d)][_0x37a9f9(0x1a1)]||_0x2acedc[_0x37a9f9(0x17d)][_0x37a9f9(0x1a1)][_0x37a9f9(0x17c)]===0x1;}async[_0xbfbb68(0x1bd)](_0x556ed9,_0x414f7f,_0x386fc8){const _0x33ff26=_0xbfbb68,_0x16e4e8={'unitId':_0x556ed9,'threadId':_0x386fc8},_0x16d563=await this['_httpService'][_0x33ff26(0x175)](_0x33ff26(0x18b)+_0x556ed9+'/list',{'body':_0x16e4e8}),_0x592daf=_0x386fc8[_0x33ff26(0x14b)](_0x5b29a1=>_0x187e86(_0x16d563[_0x33ff26(0x17d)]['comments'][_0x5b29a1],_0x556ed9,_0x414f7f))[_0x33ff26(0x156)](Boolean);return Object[_0x33ff26(0x14a)](_0x16d563[_0x33ff26(0x17d)]['users'])[_0x33ff26(0x1af)](_0x5c4a0f=>{const _0x1daf71=_0x33ff26;this[_0x1daf71(0x16d)][_0x1daf71(0x1c7)](_0x5c4a0f);}),_0x592daf;}[_0xbfbb68(0x1a3)](_0x357c35){const _0xee80f6=_0xbfbb68;return{'id':_0x357c35['id'],'threadId':_0x357c35[_0xee80f6(0x182)],'ref':_0x357c35[_0xee80f6(0x1a5)]};}};_0x16099b=_0x139f50([_0x198fc1(0x0,_0x246273['Inject'](_0x18347f[_0xbfbb68(0x162)])),_0x198fc1(0x1,_0x246273[_0xbfbb68(0x147)](_0x246273['UserManagerService'])),_0x198fc1(0x2,_0x246273[_0xbfbb68(0x147)](_0x28f217[_0xbfbb68(0x1b0)])),_0x198fc1(0x3,_0x246273[_0xbfbb68(0x147)](_0x246273[_0xbfbb68(0x1bc)]))],_0x16099b);var _0x38e100=Object[_0xbfbb68(0x1aa)],_0x47b278=(_0x4538a9,_0x3d5b0d,_0x4ecfb4,_0x4213fc)=>{const _0x3b23c0=_0xbfbb68;for(var _0x52a453=_0x4213fc>0x1?void 0x0:_0x4213fc?_0x38e100(_0x3d5b0d,_0x4ecfb4):_0x3d5b0d,_0x2ae433=_0x4538a9[_0x3b23c0(0x17e)]-0x1,_0x331700;_0x2ae433>=0x0;_0x2ae433--)(_0x331700=_0x4538a9[_0x2ae433])&&(_0x52a453=_0x331700(_0x52a453)||_0x52a453);return _0x52a453;},_0x19031f=(_0x297637,_0x10633f)=>(_0x2a2a73,_0x3fe714)=>_0x10633f(_0x2a2a73,_0x3fe714,_0x297637);let _0x59312e=class extends _0x246273[_0xbfbb68(0x18f)]{constructor(_0x4d3b0c,_0x29939b){const _0x5b1119=_0xbfbb68;super(),this[_0x5b1119(0x15d)]=_0x4d3b0c,this[_0x5b1119(0x1c5)]=_0x29939b,this[_0x5b1119(0x17f)]();}[_0xbfbb68(0x17f)](){const _0xa9a5fa=_0xbfbb68;this[_0xa9a5fa(0x15d)][_0xa9a5fa(0x19c)]=this[_0xa9a5fa(0x1c5)],this[_0xa9a5fa(0x15d)][_0xa9a5fa(0x199)]=!0x1;}};_0x59312e=_0x47b278([_0x19031f(0x0,_0x42fda6[_0xbfbb68(0x184)]),_0x19031f(0x1,_0x246273[_0xbfbb68(0x147)](_0x16099b))],_0x59312e);var _0x549dec=Object['defineProperty'],_0x1c2719=Object['getOwnPropertyDescriptor'],_0x421e28=(_0x157f92,_0x478295,_0x5f203d)=>_0x478295 in _0x157f92?_0x549dec(_0x157f92,_0x478295,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x5f203d}):_0x157f92[_0x478295]=_0x5f203d,_0xc67b25=(_0x22e733,_0x27c052,_0x105951,_0x2f81ac)=>{const _0x4be5e5=_0xbfbb68;for(var _0x405d79=_0x2f81ac>0x1?void 0x0:_0x2f81ac?_0x1c2719(_0x27c052,_0x105951):_0x27c052,_0x1066f1=_0x22e733[_0x4be5e5(0x17e)]-0x1,_0x30ce24;_0x1066f1>=0x0;_0x1066f1--)(_0x30ce24=_0x22e733[_0x1066f1])&&(_0x405d79=_0x30ce24(_0x405d79)||_0x405d79);return _0x405d79;},_0x2ac3e0=(_0x226876,_0x2c74fb)=>(_0x429d95,_0x27d162)=>_0x2c74fb(_0x429d95,_0x27d162,_0x226876),_0x16ff9e=(_0x3a644c,_0x1819a4,_0x2fcdb2)=>_0x421e28(_0x3a644c,typeof _0x1819a4!='symbol'?_0x1819a4+'':_0x1819a4,_0x2fcdb2);_0x2d8bcc[_0xbfbb68(0x19f)]=class extends _0x246273[_0xbfbb68(0x15e)]{constructor(_0x49213a=_0x3010a9,_0x1ce026,_0x25f2ca){const _0x128759=_0xbfbb68;super(),this[_0x128759(0x190)]=_0x49213a,this[_0x128759(0x150)]=_0x1ce026,this[_0x128759(0x16a)]=_0x25f2ca;const {..._0x1e1bec}=_0x246273[_0x128759(0x15c)]({},_0x3010a9,this[_0x128759(0x190)]);this[_0x128759(0x16a)][_0x128759(0x1c2)](_0x5d590e,_0x1e1bec);}['onStarting'](){const _0x587b3e=_0xbfbb68;[[_0x16099b],[_0x59312e],[_0x43dc89]][_0x587b3e(0x1af)](_0xf5d9af=>{const _0x299a28=_0x587b3e;this[_0x299a28(0x150)][_0x299a28(0x17b)](_0xf5d9af);});}[_0xbfbb68(0x174)](){const _0x4cd53c=_0xbfbb68;this['_injector'][_0x4cd53c(0x158)](_0x59312e),this[_0x4cd53c(0x150)]['get'](_0x43dc89);}},_0x16ff9e(_0x2d8bcc['UniverThreadCommentDataSourcePlugin'],_0xbfbb68(0x181),_0x3db14e),_0x16ff9e(_0x2d8bcc[_0xbfbb68(0x19f)],_0xbfbb68(0x163),_0x246273['UniverInstanceType']['UNIVER_UNKNOWN']),_0x2d8bcc[_0xbfbb68(0x19f)]=_0xc67b25([_0x246273[_0xbfbb68(0x170)](_0x4ba1c9[_0xbfbb68(0x1a7)],_0x28f217['UniverCollaborationClientPlugin'],_0x1856e[_0xbfbb68(0x19b)]),_0x2ac3e0(0x1,_0x246273['Inject'](_0x246273['Injector'])),_0x2ac3e0(0x2,_0x246273[_0xbfbb68(0x144)])],_0x2d8bcc[_0xbfbb68(0x19f)]),Object[_0xbfbb68(0x187)](_0x2d8bcc,Symbol['toStringTag'],{'value':_0xbfbb68(0x16c)});}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs-pro/thread-comment-datasource",
|
|
3
|
-
"version": "0.8.0-beta.
|
|
3
|
+
"version": "0.8.0-beta.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -45,20 +45,20 @@
|
|
|
45
45
|
"rxjs": ">=7.0.0"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@univerjs-pro/collaboration-client": "0.8.0-beta.
|
|
49
|
-
"@univerjs-pro/license": "0.8.0-beta.
|
|
50
|
-
"@univerjs/
|
|
48
|
+
"@univerjs-pro/collaboration-client": "0.8.0-beta.1",
|
|
49
|
+
"@univerjs-pro/license": "0.8.0-beta.1",
|
|
50
|
+
"@univerjs/core": "0.8.0-beta.1",
|
|
51
|
+
"@univerjs/thread-comment": "0.8.0-beta.1",
|
|
52
|
+
"@univerjs/network": "0.8.0-beta.1",
|
|
51
53
|
"@univerjs/protocol": "0.1.47-alpha.0",
|
|
52
|
-
"@univerjs/
|
|
53
|
-
"@univerjs/thread-comment": "0.8.0-beta.0",
|
|
54
|
-
"@univerjs/thread-comment-ui": "0.8.0-beta.0"
|
|
54
|
+
"@univerjs/thread-comment-ui": "0.8.0-beta.1"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"rxjs": "7.8.2",
|
|
58
58
|
"typescript": "^5.8.3",
|
|
59
59
|
"vite": "^6.3.5",
|
|
60
60
|
"vitest": "^3.1.4",
|
|
61
|
-
"@univerjs-infra/shared": "0.8.0-beta.
|
|
61
|
+
"@univerjs-infra/shared": "0.8.0-beta.1"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"test": "vitest run",
|