@univerjs-pro/collaboration-client 0.21.0 → 0.21.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.
Files changed (57) hide show
  1. package/lib/cjs/facade.js +1 -1
  2. package/lib/cjs/index.js +1 -1
  3. package/lib/cjs/locale/ca-ES.js +1 -1
  4. package/lib/cjs/locale/en-US.js +1 -1
  5. package/lib/cjs/locale/es-ES.js +1 -1
  6. package/lib/cjs/locale/fa-IR.js +1 -1
  7. package/lib/cjs/locale/fr-FR.js +1 -1
  8. package/lib/cjs/locale/ja-JP.js +1 -1
  9. package/lib/cjs/locale/ko-KR.js +1 -1
  10. package/lib/cjs/locale/ru-RU.js +1 -1
  11. package/lib/cjs/locale/sk-SK.js +1 -1
  12. package/lib/cjs/locale/vi-VN.js +1 -1
  13. package/lib/cjs/locale/zh-CN.js +1 -1
  14. package/lib/cjs/locale/zh-TW.js +1 -1
  15. package/lib/es/facade.js +1 -1
  16. package/lib/es/index.js +1 -1
  17. package/lib/es/locale/ca-ES.js +1 -1
  18. package/lib/es/locale/en-US.js +1 -1
  19. package/lib/es/locale/es-ES.js +1 -1
  20. package/lib/es/locale/fa-IR.js +1 -1
  21. package/lib/es/locale/fr-FR.js +1 -1
  22. package/lib/es/locale/ja-JP.js +1 -1
  23. package/lib/es/locale/ko-KR.js +1 -1
  24. package/lib/es/locale/ru-RU.js +1 -1
  25. package/lib/es/locale/sk-SK.js +1 -1
  26. package/lib/es/locale/vi-VN.js +1 -1
  27. package/lib/es/locale/zh-CN.js +1 -1
  28. package/lib/es/locale/zh-TW.js +1 -1
  29. package/lib/facade.js +1 -1
  30. package/lib/index.js +1 -1
  31. package/lib/locale/ca-ES.js +1 -1
  32. package/lib/locale/en-US.js +1 -1
  33. package/lib/locale/es-ES.js +1 -1
  34. package/lib/locale/fa-IR.js +1 -1
  35. package/lib/locale/fr-FR.js +1 -1
  36. package/lib/locale/ja-JP.js +1 -1
  37. package/lib/locale/ko-KR.js +1 -1
  38. package/lib/locale/ru-RU.js +1 -1
  39. package/lib/locale/sk-SK.js +1 -1
  40. package/lib/locale/vi-VN.js +1 -1
  41. package/lib/locale/zh-CN.js +1 -1
  42. package/lib/locale/zh-TW.js +1 -1
  43. package/lib/umd/facade.js +1 -1
  44. package/lib/umd/index.js +1 -1
  45. package/lib/umd/locale/ca-ES.js +1 -1
  46. package/lib/umd/locale/en-US.js +1 -1
  47. package/lib/umd/locale/es-ES.js +1 -1
  48. package/lib/umd/locale/fa-IR.js +1 -1
  49. package/lib/umd/locale/fr-FR.js +1 -1
  50. package/lib/umd/locale/ja-JP.js +1 -1
  51. package/lib/umd/locale/ko-KR.js +1 -1
  52. package/lib/umd/locale/ru-RU.js +1 -1
  53. package/lib/umd/locale/sk-SK.js +1 -1
  54. package/lib/umd/locale/vi-VN.js +1 -1
  55. package/lib/umd/locale/zh-CN.js +1 -1
  56. package/lib/umd/locale/zh-TW.js +1 -1
  57. package/package.json +11 -11
package/lib/es/index.js CHANGED
@@ -1 +1 @@
1
- const _0x584c31=_0x9779;(function(_0x2f2bac,_0x256c27){const _0x1468ab=_0x9779,_0x4814c4=_0x2f2bac();while(!![]){try{const _0xf1304c=-parseInt(_0x1468ab(0x12a))/0x1+parseInt(_0x1468ab(0x298))/0x2*(-parseInt(_0x1468ab(0x22a))/0x3)+-parseInt(_0x1468ab(0x2b3))/0x4*(-parseInt(_0x1468ab(0xc7))/0x5)+parseInt(_0x1468ab(0x300))/0x6+-parseInt(_0x1468ab(0x254))/0x7+-parseInt(_0x1468ab(0xf4))/0x8+parseInt(_0x1468ab(0xd9))/0x9;if(_0xf1304c===_0x256c27)break;else _0x4814c4['push'](_0x4814c4['shift']());}catch(_0x4937a7){_0x4814c4['push'](_0x4814c4['shift']());}}}(_0x4574,0x480ec));import{CollaborationEvent,CompressMutationService,EmptyMutationInfo,ISnapshotServerService,ITransformService,RevisionService,SnapshotService,UniverCollaborationPlugin,b64DecodeUnicode,isTransformChangesetsSuccess,isTransformMutationsWithChangesetFailure,isTransformMutationsWithChangesetSuccess,mapDocumentTypeToUniverInstanceType,parseChangesetToProtocol,parseProtocolChangeset,textEncoder,uuidv4}from'@univerjs-pro/collaboration';import{CommandType,DependentOn,Disposable,DisposableCollection,IAuthzIoService,ICommandService,IConfigService,IContextService,ILogService,IMentionIOService,IPermissionService,IUndoRedoService,IUniverInstanceService,Inject,Injector,JSONX,LocalUndoRedoService,LocaleService,MentionType,Optional,Plugin,Quantity,Rectangle,RxDisposable,Tools,UniverInstanceType,UserManagerService,Workbook,createIdentifier,generateRandomId,isInternalEditorID,merge,mergeOverrideWithDependencies,registerDependencies,resolveWithBasePath,sequenceExecute,toDisposable,touchDependencies}from'@univerjs/core';import{RichTextEditingMutation}from'@univerjs/docs';import{InsertSheetMutation,SetSelectionsOperation,SheetPermissionInitController,SheetsSelectionsService,WorkbookEditablePermission}from'@univerjs/sheets';import{BehaviorSubject,ReplaySubject,Subject,concatMap,firstValueFrom,map,merge as _0x3769d0,of,shareReplay,take,takeUntil}from'rxjs';import{CmdRspCode,CombCmd,ErrorCode,FileSource}from'@univerjs/protocol';import{ITelemetryService}from'@univerjs/telemetry';import{delay,filter,map as _0x12630c,take as _0x1b3341,takeUntil as _0x32491d}from'rxjs/operators';import{HTTPRequest,HTTPService,ISocketService,MergeInterceptorFactory,ThresholdInterceptorFactory,UniverNetworkPlugin}from'@univerjs/network';import{UniverLicensePlugin,getGlobalObject}from'@univerjs-pro/license';import{IImageIoService,ImageSourceType,ImageUploadStatusType}from'@univerjs/drawing';import{cbc}from'@noble/ciphers/aes.js';import{concatBytes,randomBytes,utf8ToBytes}from'@noble/ciphers/utils.js';const DEFAULT_SNAPSHOT_SERVER_URL=_0x584c31(0x2c2),SNAPSHOT_URL_KEY=_0x584c31(0x121),DEFAULT_SEND_CHANGESET_TIMEOUT=0x7d0,DEFAULT_COLLAB_WEB_SOCKET_URL=_0x584c31(0x2ec),DEFAULT_WS_SESSION_TICKET_URL=_0x584c31(0x181),HEARTBEAT_INTERVAL_KEY=_0x584c31(0x2e6),DEFAULT_HEARTBEAT_INTERVAL=0x7530,HEARTBEAT_TIMEOUT_KEY='HEARTBEAT_TIMEOUT',DEFAULT_HEARTBEAT_TIMEOUT=0x4e20,DEFAULT_RETRY_CONNECTING_INTERVAL=0x4e20,RETRY_CONNECTING_MAX_COUNT_KEY=_0x584c31(0x30c),LOCAL_CACHE_INTERVAL_KEY=_0x584c31(0xd3),LOCAL_CACHE_INTERVAL=0x3e8,DEFAULT_COLLAB_SUBMIT_CHANGESET_URL='/universer-api/comb',DEFAULT_LOGIN_URL=_0x584c31(0x2d8),REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY=_0x584c31(0xdf),DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT=_0x584c31(0x296),TELEMETRY_COLLABORATION_NEW_CHANGESET=_0x584c31(0xee);function summaryChangesetSize(_0x3112f3){const _0x34abda=_0x584c31;return JSON[_0x34abda(0x1f5)](_0x3112f3)[_0x34abda(0x2f6)];}function _typeof(_0xe1647f){'@babel/helpers - typeof';const _0x410fc6=_0x584c31;return _typeof=_0x410fc6(0x1fc)==typeof Symbol&&_0x410fc6(0x238)==typeof Symbol[_0x410fc6(0x17f)]?function(_0x1ae20a){return typeof _0x1ae20a;}:function(_0x4f86a1){const _0x262d21=_0x410fc6;return _0x4f86a1&&'function'==typeof Symbol&&_0x4f86a1[_0x262d21(0x1ef)]===Symbol&&_0x4f86a1!==Symbol[_0x262d21(0x1e5)]?_0x262d21(0x238):typeof _0x4f86a1;},_typeof(_0xe1647f);}function toPrimitive(_0x52ea63,_0x3799d5){const _0x5811ff=_0x584c31;if(_0x5811ff(0x1d3)!=_typeof(_0x52ea63)||!_0x52ea63)return _0x52ea63;var _0x497c89=_0x52ea63[Symbol[_0x5811ff(0x2c7)]];if(void 0x0!==_0x497c89){var _0x40f229=_0x497c89[_0x5811ff(0x23e)](_0x52ea63,_0x3799d5||'default');if(_0x5811ff(0x1d3)!=_typeof(_0x40f229))return _0x40f229;throw new TypeError(_0x5811ff(0x1aa));}return(_0x5811ff(0x17d)===_0x3799d5?String:Number)(_0x52ea63);}function toPropertyKey(_0x2df515){var _0x5e07a1=toPrimitive(_0x2df515,'string');return'symbol'==_typeof(_0x5e07a1)?_0x5e07a1:_0x5e07a1+'';}function _defineProperty(_0x19cb8b,_0x3a3cbd,_0x1b39ee){const _0x9f3702=_0x584c31;return(_0x3a3cbd=toPropertyKey(_0x3a3cbd))in _0x19cb8b?Object[_0x9f3702(0x30e)](_0x19cb8b,_0x3a3cbd,{'value':_0x1b39ee,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x19cb8b[_0x3a3cbd]=_0x1b39ee,_0x19cb8b;}let CollaborationUIEventId=function(_0xd6808){const _0x12b39f=_0x584c31;return _0xd6808[_0x12b39f(0x22e)]=_0x12b39f(0x22e),_0xd6808[_0x12b39f(0x1fe)]=_0x12b39f(0x1fe),_0xd6808[_0x12b39f(0x150)]=_0x12b39f(0x150),_0xd6808[_0x12b39f(0x2d6)]=_0x12b39f(0x2d6),_0xd6808[_0x12b39f(0x10f)]='JOIN_ROOM_FAILED',_0xd6808[_0x12b39f(0x2c1)]='SOCKET_FAILED_RETRY',_0xd6808[_0x12b39f(0x228)]=_0x12b39f(0x228),_0xd6808[_0x12b39f(0x168)]=_0x12b39f(0x168),_0xd6808;}({});var CollaborationUIEventService=class{constructor(){const _0x3b2438=_0x584c31;_defineProperty(this,'_event$',new Subject()),_defineProperty(this,_0x3b2438(0x2c8),this[_0x3b2438(0x1fb)][_0x3b2438(0x2be)]());}['emitEvent'](_0x3a053b){const _0x5cfbca=_0x584c31;this[_0x5cfbca(0x1fb)][_0x5cfbca(0x303)](_0x3a053b);}},CommentService=class{constructor(){const _0x1439c2=_0x584c31;_defineProperty(this,'_commentUpdate$',new Subject()),_defineProperty(this,_0x1439c2(0x194),this[_0x1439c2(0x1c6)][_0x1439c2(0x2be)]());}[_0x584c31(0x2aa)](_0x1956c6){const _0x4fb67c=_0x584c31;this[_0x4fb67c(0x1c6)][_0x4fb67c(0x303)](_0x1956c6);}};function __decorateParam(_0x3940fb,_0x15811e){return function(_0x57773b,_0x20d5b1){_0x15811e(_0x57773b,_0x20d5b1,_0x3940fb);};}function _0x9779(_0x257d9c,_0x548219){_0x257d9c=_0x257d9c-0xc4;const _0x457400=_0x4574();let _0x977937=_0x457400[_0x257d9c];return _0x977937;}function __decorate(_0x181286,_0x3afffa,_0x80e501,_0x1f1e6c){const _0x511a69=_0x584c31;var _0x1648f6=arguments[_0x511a69(0x2f6)],_0x3342c2=_0x1648f6<0x3?_0x3afffa:_0x1f1e6c===null?_0x1f1e6c=Object['getOwnPropertyDescriptor'](_0x3afffa,_0x80e501):_0x1f1e6c,_0x1fd90a;if(typeof Reflect===_0x511a69(0x1d3)&&typeof Reflect[_0x511a69(0x24d)]===_0x511a69(0x1fc))_0x3342c2=Reflect['decorate'](_0x181286,_0x3afffa,_0x80e501,_0x1f1e6c);else{for(var _0x3b1445=_0x181286['length']-0x1;_0x3b1445>=0x0;_0x3b1445--)if(_0x1fd90a=_0x181286[_0x3b1445])_0x3342c2=(_0x1648f6<0x3?_0x1fd90a(_0x3342c2):_0x1648f6>0x3?_0x1fd90a(_0x3afffa,_0x80e501,_0x3342c2):_0x1fd90a(_0x3afffa,_0x80e501))||_0x3342c2;}return _0x1648f6>0x3&&_0x3342c2&&Object[_0x511a69(0x30e)](_0x3afffa,_0x80e501,_0x3342c2),_0x3342c2;}let MemberService=class MemberService extends Disposable{constructor(_0x501412,_0x1b597c){const _0x2d7947=_0x584c31;super(),this[_0x2d7947(0xc5)]=_0x501412,this['_userManagerService']=_0x1b597c,_defineProperty(this,_0x2d7947(0x18e),new Map()),_defineProperty(this,_0x2d7947(0x221),new Subject()),this[_0x2d7947(0x103)](_0x3769d0(this[_0x2d7947(0xc5)][_0x2d7947(0x1ce)](UniverInstanceType['UNIVER_SHEET'])[_0x2d7947(0x2cb)](_0x12630c(_0x199f8=>_0x199f8[_0x2d7947(0x2db)]())),this['_univerInstanceService'][_0x2d7947(0x1ce)](UniverInstanceType['UNIVER_DOC'])['pipe'](_0x12630c(_0x3d754a=>_0x3d754a[_0x2d7947(0x2db)]())))[_0x2d7947(0xd2)](_0x3ebbe5=>this[_0x2d7947(0x302)](_0x3ebbe5)));}[_0x584c31(0x2f7)](_0x227567){const _0x3147a8=_0x584c31;if(this[_0x3147a8(0x18e)][_0x3147a8(0x149)](_0x227567))return of(this['_roomMembers'][_0x3147a8(0x1ea)](_0x227567));return this['_roomCreated$'][_0x3147a8(0x2cb)](_0x12630c(_0x551586=>{const _0x3a23a0=_0x3147a8;if(_0x551586===_0x227567)return this[_0x3a23a0(0x18e)]['get'](_0x551586);}));}[_0x584c31(0x316)](_0x560b0a){this['_userManagerService']['setCurrentUser'](_0x560b0a);}['getCurrentUser'](){const _0x397182=_0x584c31;return this[_0x397182(0x24c)]['getCurrentUser']();}[_0x584c31(0x2ff)](_0x946b0,_0x79d2fc){const _0x5c8d8d=_0x584c31;let _0xd2d33=this[_0x5c8d8d(0x18e)][_0x5c8d8d(0x1ea)](_0x946b0);!_0xd2d33&&(_0xd2d33=new RoomMember(),this[_0x5c8d8d(0x18e)][_0x5c8d8d(0x1ec)](_0x946b0,_0xd2d33),this[_0x5c8d8d(0x221)]['next'](_0x946b0)),_0xd2d33[_0x5c8d8d(0x2ff)](_0x79d2fc);}[_0x584c31(0x116)](_0x5f4f7c,_0xe7fdd7){const _0x49e5ff=_0x584c31,_0x192db2=this[_0x49e5ff(0x18e)][_0x49e5ff(0x1ea)](_0x5f4f7c);if(_0x192db2)_0x192db2[_0x49e5ff(0x116)](_0xe7fdd7);}['getRoom'](_0x20e58e){const _0x3747a5=_0x584c31;return this[_0x3747a5(0x18e)]['get'](_0x20e58e);}[_0x584c31(0x132)](_0x6f8141,_0xee3b63){const _0x17f5a3=_0x584c31,_0x4b91a4=this[_0x17f5a3(0x18e)]['get'](_0x6f8141);if(_0x4b91a4)return _0x4b91a4[_0x17f5a3(0x132)](_0xee3b63);}[_0x584c31(0x302)](_0x2f9ad6){const _0x18be16=_0x584c31,_0x410ce8=this[_0x18be16(0x18e)]['get'](_0x2f9ad6);_0x410ce8&&(_0x410ce8[_0x18be16(0x1ff)](),this[_0x18be16(0x18e)][_0x18be16(0x275)](_0x2f9ad6));}['dispose'](){const _0x5cc5c0=_0x584c31;this['_roomMembers']['forEach'](_0x1d876c=>_0x1d876c[_0x5cc5c0(0x1ff)]()),this['_roomMembers']['clear'](),this[_0x5cc5c0(0x221)][_0x5cc5c0(0x13a)]();}};MemberService=__decorate([__decorateParam(0x0,IUniverInstanceService),__decorateParam(0x1,Inject(UserManagerService))],MemberService);var RoomMember=class extends Disposable{constructor(..._0x10939f){const _0x3fb6c4=_0x584c31;super(..._0x10939f),_defineProperty(this,_0x3fb6c4(0x309),new Map()),_defineProperty(this,_0x3fb6c4(0x258),new BehaviorSubject(this['_members'])),_defineProperty(this,_0x3fb6c4(0x274),this[_0x3fb6c4(0x258)][_0x3fb6c4(0x2be)]());}[_0x584c31(0x1ff)](){const _0x222a7b=_0x584c31;this[_0x222a7b(0x309)]['clear']();}[_0x584c31(0x2ff)](_0x486e60){const _0x4bdcf6=_0x584c31;this[_0x4bdcf6(0x309)][_0x4bdcf6(0x1ec)](_0x486e60[_0x4bdcf6(0x14c)],_0x486e60),this[_0x4bdcf6(0xfe)]();}['removeMember'](_0x295c3b){this['_members']['delete'](_0x295c3b);}['getMember'](_0x1ef55e){const _0x11b421=_0x584c31;return this[_0x11b421(0x309)][_0x11b421(0x1ea)](_0x1ef55e);}['getAllMembers'](){const _0x4246af=_0x584c31;return Array['from'](this[_0x4246af(0x309)][_0x4246af(0x193)]());}[_0x584c31(0xfe)](){const _0x4449b5=_0x584c31;this['_members$'][_0x4449b5(0x303)](this['_members']);}};let SessionStatus=function(_0x14b2dc){const _0xc3dd8c=_0x584c31;return _0x14b2dc[_0x14b2dc[_0xc3dd8c(0x108)]=0x0]='IDLE',_0x14b2dc[_0x14b2dc[_0xc3dd8c(0xce)]=0x1]=_0xc3dd8c(0xce),_0x14b2dc[_0x14b2dc['OFFLINE']=0x2]=_0xc3dd8c(0x15d),_0x14b2dc[_0x14b2dc[_0xc3dd8c(0x307)]=0x3]='ONLINE',_0x14b2dc;}({});const FailedReason={[CmdRspCode['FAIL']]:_0x584c31(0x2b2),[CmdRspCode[_0x584c31(0x1be)]]:_0x584c31(0x1e2),[CmdRspCode[_0x584c31(0x17e)]]:_0x584c31(0x25d),[CmdRspCode['JOIN_ROOM_PERMISSION_DENIED']]:'session.room-permission-denied',[CmdRspCode[_0x584c31(0x18a)]]:_0x584c31(0x28d)};let CollaborationSession=class CollaborationSession extends RxDisposable{get[_0x584c31(0x1cf)](){return this['_sessionStatus$']['getValue']();}constructor(_0x38ed82,_0x379f27,_0x48b67c,_0x3abbfe,_0x1a0d42,_0x308646,_0x3a3ba6,_0x3d73fa){const _0x486a05=_0x584c31;super(),this['_unitID']=_0x38ed82,this['_logService']=_0x48b67c,this[_0x486a05(0x295)]=_0x3abbfe,this['_memberService']=_0x1a0d42,this[_0x486a05(0x250)]=_0x308646,this['_collaborationUIEventService']=_0x3a3ba6,this[_0x486a05(0x1a6)]=_0x3d73fa,_defineProperty(this,'_sessionStatus$',new BehaviorSubject(SessionStatus[_0x486a05(0x108)])),_defineProperty(this,_0x486a05(0xdb),this[_0x486a05(0x2ad)][_0x486a05(0x2be)]()),_defineProperty(this,_0x486a05(0x1fb),new Subject()),_defineProperty(this,_0x486a05(0x2c8),this['_event$'][_0x486a05(0x2be)]()),_defineProperty(this,_0x486a05(0x1eb),void 0x0),_defineProperty(this,_0x486a05(0x124),void 0x0),_defineProperty(this,_0x486a05(0x1b3),void 0x0),_defineProperty(this,_0x486a05(0x151),![]),_defineProperty(this,_0x486a05(0x1b5),null),this['_shouldReportTelemetry']=!!this['_telemetryService'],_0x379f27[_0x486a05(0x2cb)](takeUntil(this[_0x486a05(0x305)]))[_0x486a05(0xd2)](_0x435103=>{const _0x22ce44=_0x486a05;if(typeof _0x435103===_0x22ce44(0x199))return;this['_socket']=_0x435103;if(_0x435103)this['_joinRoom'](_0x435103),this[_0x22ce44(0x124)]=_0x435103[_0x22ce44(0x28a)][_0x22ce44(0xd2)](_0x2bf941=>{const _0x3fd71b=_0x22ce44;if(_0x2bf941[_0x3fd71b(0x2ac)]!==this['_unitID'])return;this['_onCombEvent'](_0x2bf941);});else{var _0x215747;this['_throwTelemetryCollaborationNewChangeset'](),this[_0x22ce44(0x2ad)][_0x22ce44(0x303)](SessionStatus[_0x22ce44(0x15d)]),(_0x215747=this[_0x22ce44(0x124)])===null||_0x215747===void 0x0||_0x215747[_0x22ce44(0x1a8)](),this[_0x22ce44(0x124)]=null;}});}[_0x584c31(0x14f)](){var _0xa2c793,_0x540e0f;return(_0xa2c793=(_0x540e0f=this['_socket'])===null||_0x540e0f===void 0x0?void 0x0:_0x540e0f['memberID'])!==null&&_0xa2c793!==void 0x0?_0xa2c793:null;}['dispose'](){const _0x4f5ad0=_0x584c31;super[_0x4f5ad0(0x1ff)](),this[_0x4f5ad0(0x105)](),this[_0x4f5ad0(0x305)][_0x4f5ad0(0x303)](),this['dispose$'][_0x4f5ad0(0x13a)]();}['close'](){const _0x1b1e7d=_0x584c31;var _0x4562b0,_0x59931f;this[_0x1b1e7d(0x2b9)](),(_0x4562b0=this[_0x1b1e7d(0x1eb)])===null||_0x4562b0===void 0x0||_0x4562b0[_0x1b1e7d(0x241)]({'cmd':CombCmd[_0x1b1e7d(0x24a)],'data':{'roomID':this[_0x1b1e7d(0xd6)]}}),(_0x59931f=this[_0x1b1e7d(0x1eb)])===null||_0x59931f===void 0x0||_0x59931f[_0x1b1e7d(0x105)](),this[_0x1b1e7d(0x1fb)]['complete'](),this[_0x1b1e7d(0x2ad)][_0x1b1e7d(0x13a)]();}['_onCombEvent'](_0x4e0eda){const _0x27e39c=_0x584c31;if(_0x4e0eda[_0x27e39c(0x2d4)]===CombCmd[_0x27e39c(0x1ed)])this[_0x27e39c(0x155)](_0x4e0eda);else{if(_0x4e0eda[_0x27e39c(0x2d4)]===CombCmd[_0x27e39c(0x209)])this[_0x27e39c(0x102)](_0x4e0eda);}}[_0x584c31(0x293)](_0x118814){const _0x1fbe86=_0x584c31;this[_0x1fbe86(0x2ad)][_0x1fbe86(0x303)](SessionStatus[_0x1fbe86(0xce)]),_0x118814[_0x1fbe86(0x241)]({'cmd':CombCmd['JOIN'],'routeKey':this[_0x1fbe86(0xd6)],'routeType':'','data':{'rooms':[{'roomID':this['_unitID']}]}});}[_0x584c31(0x155)](_0x2efd60){const _0x558d09=_0x584c31;var _0x479b86;if(_0x2efd60['code']in FailedReason){this['_collaborationUIEventService'][_0x558d09(0x19c)]({'id':CollaborationUIEventId[_0x558d09(0x10f)],'data':FailedReason[_0x2efd60[_0x558d09(0xf9)]]}),this[_0x558d09(0x2ad)]['next'](SessionStatus[_0x558d09(0x15d)]);return;}this[_0x558d09(0x2ad)][_0x558d09(0x303)](SessionStatus[_0x558d09(0x307)]);const _0x417cbb=(_0x479b86=_0x2efd60[_0x558d09(0x2a7)][_0x558d09(0x184)][this[_0x558d09(0xd6)]])===null||_0x479b86===void 0x0?void 0x0:_0x479b86[_0x558d09(0x179)];if(_0x417cbb)_0x417cbb[_0x558d09(0x1a5)](_0x19ddd8=>this[_0x558d09(0xea)]['updateMember'](this[_0x558d09(0xd6)],_0x19ddd8));}[_0x584c31(0x102)](_0x26d9f7){const _0x2e9a7b=_0x584c31;try{const _0x16a3e5=_0x26d9f7['data'];switch(_0x16a3e5[_0x2e9a7b(0x257)]){case CollaborationEvent['USERS_ENTER']:this[_0x2e9a7b(0x114)](_0x16a3e5),this[_0x2e9a7b(0x1fb)][_0x2e9a7b(0x303)](_0x16a3e5);break;case CollaborationEvent[_0x2e9a7b(0x20f)]:this[_0x2e9a7b(0x1a1)](_0x16a3e5),this[_0x2e9a7b(0x1fb)][_0x2e9a7b(0x303)](_0x16a3e5);break;case CollaborationEvent[_0x2e9a7b(0x2d2)]:case CollaborationEvent[_0x2e9a7b(0x2cd)]:this[_0x2e9a7b(0xcd)](),this[_0x2e9a7b(0x115)](),this['_event$'][_0x2e9a7b(0x303)](_0x16a3e5);break;case CollaborationEvent[_0x2e9a7b(0x2cc)]:this['_logService']['error'](_0x2e9a7b(0x278)+JSON['stringify'](_0x16a3e5)),this[_0x2e9a7b(0x1fb)][_0x2e9a7b(0x303)](_0x16a3e5);break;case CollaborationEvent['COMMENT_UPDATE']:this[_0x2e9a7b(0x250)][_0x2e9a7b(0x2aa)](_0x16a3e5[_0x2e9a7b(0x2a7)]),this[_0x2e9a7b(0x1fb)][_0x2e9a7b(0x303)](_0x16a3e5);break;default:this[_0x2e9a7b(0x1fb)]['next'](_0x16a3e5);}}catch(_0x527077){this['_logService']['error'](_0x527077,_0x26d9f7);}}[_0x584c31(0x114)](_0x4a6cec){const _0x3e9736=_0x584c31;this['_memberService'][_0x3e9736(0x2ff)](this[_0x3e9736(0xd6)],_0x4a6cec[_0x3e9736(0x2a7)]);}[_0x584c31(0x1a1)](_0x343f48){const _0x1b376d=_0x584c31;this['_memberService'][_0x1b376d(0x116)](this[_0x1b376d(0xd6)],_0x343f48['data'][_0x1b376d(0x14c)]);}async[_0x584c31(0x241)](_0xb641ef,_0x1d44a1){const _0x102aa6=_0x584c31;if(this[_0x102aa6(0x1cf)]!==SessionStatus[_0x102aa6(0x307)]||!this[_0x102aa6(0x1eb)])throw new Error(_0x102aa6(0x2af));try{_0xb641ef[_0x102aa6(0x257)]===CollaborationEvent[_0x102aa6(0x2bd)]&&(this[_0x102aa6(0x2e1)](),this['_startTelemetryCollaborationNewChangeset'](_0xb641ef)),this['_socket'][_0x102aa6(0x241)]({'cmd':CombCmd[_0x102aa6(0x255)],'routeKey':_0x1d44a1,'routeType':'','data':_0xb641ef});}catch(_0x2e51ad){this[_0x102aa6(0x22b)][_0x102aa6(0xed)](_0x2e51ad);}}[_0x584c31(0x2e1)](){const _0x1e145c=_0x584c31;var _0x4ed12a;this[_0x1e145c(0x1b3)]=setTimeout(()=>{const _0xfc31a6=_0x1e145c;this[_0xfc31a6(0x1b3)]=null,this[_0xfc31a6(0x21b)][_0xfc31a6(0x19c)]({'id':CollaborationUIEventId[_0xfc31a6(0x168)]});},(_0x4ed12a=this[_0x1e145c(0x295)][_0x1e145c(0x1cc)](_0x1e145c(0x280)))!==null&&_0x4ed12a!==void 0x0?_0x4ed12a:DEFAULT_HEARTBEAT_TIMEOUT);}['_clearCollaborationTimeoutTimer'](){const _0x15e612=_0x584c31;this[_0x15e612(0x1b3)]&&(clearTimeout(this[_0x15e612(0x1b3)]),this['_collaborationTimeoutTimer']=null);}[_0x584c31(0x219)](_0x155020){const _0x2b84d1=_0x584c31;if(!this['_shouldReportTelemetry'])return;const {data:_0x239ae8}=_0x155020,{unitID:_0x594878,changeset:_0xa8bab}=_0x239ae8,{mutations:_0xa7396f,type:_0x23d9f0}=_0xa8bab;this[_0x2b84d1(0x1b5)]={'unitId':_0x594878,'type':_0x23d9f0,'startTime':performance[_0x2b84d1(0xf2)](),'stopTime':0x0,'duration':0x0,'size':summaryChangesetSize(_0xa7396f)};}['_stopTelemetryCollaborationNewChangeset'](){const _0x5befb9=_0x584c31;if(!this[_0x5befb9(0x151)])return;if(!this['_telemetryInfo']){this[_0x5befb9(0x22b)][_0x5befb9(0xed)](_0x5befb9(0xf8),'telemetry\x20info\x20is\x20not\x20initialized');return;}this[_0x5befb9(0x1b5)][_0x5befb9(0x2b0)]=performance[_0x5befb9(0xf2)](),this[_0x5befb9(0x1b5)][_0x5befb9(0x311)]=this[_0x5befb9(0x1b5)]['stopTime']-this[_0x5befb9(0x1b5)]['startTime'],this[_0x5befb9(0x1a6)][_0x5befb9(0x1b7)](TELEMETRY_COLLABORATION_NEW_CHANGESET,this['_telemetryInfo']),this[_0x5befb9(0x1b5)]=null;}[_0x584c31(0x2b9)](){const _0x1423c1=_0x584c31;this[_0x1423c1(0x1b5)]=null;}};CollaborationSession=__decorate([__decorateParam(0x2,ILogService),__decorateParam(0x3,IConfigService),__decorateParam(0x4,Inject(MemberService)),__decorateParam(0x5,Inject(CommentService)),__decorateParam(0x6,Inject(CollaborationUIEventService)),__decorateParam(0x7,Optional(ITelemetryService))],CollaborationSession);const ILocalCacheService=createIdentifier(_0x584c31(0x18b));function getLocalCacheKey(_0x2af065){return'unit-cache-'+_0x2af065;}function extractTargetFromFirstChangeset(_0x5a6e8a){const _0x4f3c26=_0x584c31,{unitID:_0x41d242,mutations:_0x236a1f}=_0x5a6e8a;return{'unitId':_0x41d242,'subUnitId':_0x236a1f[_0x4f3c26(0x2f6)]>0x0?_0x236a1f[0x0][_0x4f3c26(0x2de)]['subUnitId']:null};}let SheetTransformSelectionsService=class SheetTransformSelectionsService{constructor(_0x523a40,_0xd44d98,_0x226154){const _0x5209ce=_0x584c31;this[_0x5209ce(0x1ae)]=_0x523a40,this['_transformService']=_0xd44d98,this[_0x5209ce(0xd8)]=_0x226154;}['transformSelections'](_0x4cc93f){const _0x18374a=_0x584c31;var _0x3e648c,_0x388bc9;const _0x211529=this[_0x18374a(0x1ae)][_0x18374a(0x1ea)](SheetsSelectionsService),{unitId:_0x525c1e,subUnitId:_0x167cdb}=extractTargetFromFirstChangeset(_0x4cc93f),_0x58a454=_0x211529===null||_0x211529===void 0x0?void 0x0:_0x211529['getWorkbookSelections'](_0x525c1e)[_0x18374a(0x178)](),_0x3f0fe7=(_0x3e648c=this[_0x18374a(0xd8)]['getUnit'](_0x525c1e))===null||_0x3e648c===void 0x0||(_0x3e648c=_0x3e648c[_0x18374a(0x240)]())===null||_0x3e648c===void 0x0?void 0x0:_0x3e648c[_0x18374a(0x15e)]();if(_0x58a454[_0x18374a(0x2f6)]===0x0||!_0x525c1e||!_0x167cdb)return;const _0x696a8e=[{'id':SetSelectionsOperation['id'],'params':{'unitId':_0x525c1e,'subUnitId':_0x3f0fe7,'selections':Tools[_0x18374a(0xc6)](_0x58a454)}}],_0xb1ac46=this[_0x18374a(0x198)][_0x18374a(0x261)](_0x4cc93f,_0x696a8e);if(!isTransformMutationsWithChangesetSuccess(_0xb1ac46))throw _0xb1ac46[_0x18374a(0xed)];const _0x3390ac=(_0x388bc9=_0xb1ac46['m2Prime'][0x0])===null||_0x388bc9===void 0x0||(_0x388bc9=_0x388bc9[_0x18374a(0x2de)])===null||_0x388bc9===void 0x0?void 0x0:_0x388bc9['selections'];if(Array[_0x18374a(0x281)](_0x3390ac)&&_0x3390ac[_0x18374a(0x2f6)]){if(_0x3390ac[_0x18374a(0x2f6)]===_0x696a8e[0x0][_0x18374a(0x2de)][_0x18374a(0x165)][_0x18374a(0x2f6)]&&_0x3390ac[_0x18374a(0xcc)]((_0x217e08,_0x228b68)=>Rectangle[_0x18374a(0x2f8)](_0x217e08[_0x18374a(0x17b)],_0x696a8e[0x0][_0x18374a(0x2de)][_0x18374a(0x165)][_0x228b68][_0x18374a(0x17b)])))return;this[_0x18374a(0x1ae)][_0x18374a(0x1ea)](ICommandService)[_0x18374a(0x272)](SetSelectionsOperation['id'],{'unitId':_0x525c1e,'subUnitId':_0x3f0fe7,'selections':_0x3390ac});}}};SheetTransformSelectionsService=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,ITransformService),__decorateParam(0x2,IUniverInstanceService)],SheetTransformSelectionsService);const ISingleActiveUnitService=createIdentifier(_0x584c31(0xd4));let UnitStatus=function(_0x834f08){const _0x29c959=_0x584c31;return _0x834f08[_0x834f08[_0x29c959(0x2f3)]=0x0]='NO_OTHER_CLIENTS_EDITING',_0x834f08[_0x834f08[_0x29c959(0x1f1)]=0x1]=_0x29c959(0x1f1),_0x834f08;}({});const COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY=_0x584c31(0x1c0),configSymbol=Symbol(COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),defaultPluginConfig={};function isSplitChunkMutation(_0x12dd54){const _0x171d22=_0x584c31;var _0x207185;return!!((_0x207185=_0x12dd54[_0x171d22(0x2de)])===null||_0x207185===void 0x0?void 0x0:_0x207185[_0x171d22(0x26e)]);}const SINGLE_CHANGESET_MUTATIONS=new Set([InsertSheetMutation['id']]);function assembleSheetChangeset(_0x2bf3e2,_0x2b9fd0,_0x4b5b0e,_0x5e7c7a,_0x48f79c){const _0x2aa46d=_0x584c31;var _0x33860b,_0x9562fa,_0x3c7ab3,_0x21a8ea;const _0x14815d=[];for(const _0x5fa5e2 of _0x2bf3e2){if(SINGLE_CHANGESET_MUTATIONS[_0x2aa46d(0x149)](_0x5fa5e2['id'])){if(_0x14815d[_0x2aa46d(0x2f6)]>0x0)break;_0x14815d[_0x2aa46d(0x125)](_0x5fa5e2);break;}if(isSplitChunkMutation(_0x5fa5e2)){if(_0x14815d['length']>0x0)break;_0x14815d['push'](_0x5fa5e2);break;}_0x14815d['push'](_0x5fa5e2);}const _0x2c7c19=(_0x33860b=(_0x9562fa=_0x48f79c[_0x2aa46d(0x104)]())===null||_0x9562fa===void 0x0?void 0x0:_0x9562fa[_0x2aa46d(0xd0)])!==null&&_0x33860b!==void 0x0?_0x33860b:_0x2aa46d(0x1a4),_0x433be4=(_0x3c7ab3=(_0x21a8ea=_0x48f79c['getCurrentUser']())===null||_0x21a8ea===void 0x0?void 0x0:_0x21a8ea[_0x2aa46d(0x14c)])!==null&&_0x3c7ab3!==void 0x0?_0x3c7ab3:_0x2aa46d(0x1a4);return{'changeset':{'unitID':_0x2b9fd0,'type':mapDocumentTypeToUniverInstanceType(_0x4b5b0e[_0x2aa46d(0x26f)](_0x2b9fd0)),'baseRev':_0x5e7c7a['getCurrentRevOfUnit'](_0x2b9fd0),'revision':0x0,'userID':_0x2c7c19,'memberID':_0x433be4,'mutations':_0x14815d},'pendingMutations':_0x2bf3e2[_0x2aa46d(0xe3)](_0x14815d[_0x2aa46d(0x2f6)])};}function assembleDocChangeset(_0x5213d9,_0xfbaec,_0x21611e,_0x4f4e79,_0x156883){const _0x255bca=_0x584c31;var _0x55bf3d,_0x17d9f6,_0x511c99,_0x5df287;const _0x28695d=[_0x5213d9['reduce']((_0x4ad2c6,_0x556b1c)=>{const _0x387843=_0x9779;var _0x234be2;const {id:_0x374730}=_0x4ad2c6,{id:_0x43d6e5,type:_0x15981b}=_0x556b1c,_0xe649bd=(_0x234be2=_0x4ad2c6[_0x387843(0x2de)])!==null&&_0x234be2!==void 0x0?_0x234be2:{'actions':null},_0x146fa6=_0x556b1c[_0x387843(0x2de)];if(_0x374730&&_0x374730!==_0x43d6e5)throw new Error(_0x387843(0x1bb)+_0x374730+_0x387843(0x188)+_0x43d6e5+'.');return{..._0x4ad2c6,'id':_0x43d6e5,'type':_0x15981b,'params':{'unitId':_0x146fa6[_0x387843(0x1d7)],'textRanges':_0x146fa6[_0x387843(0x27a)],'actions':JSONX[_0x387843(0x236)](_0xe649bd[_0x387843(0x2a9)],_0x146fa6['actions'])}};},{})],_0x431892=(_0x55bf3d=(_0x17d9f6=_0x156883['getCurrentUser']())===null||_0x17d9f6===void 0x0?void 0x0:_0x17d9f6[_0x255bca(0xd0)])!==null&&_0x55bf3d!==void 0x0?_0x55bf3d:_0x255bca(0x1a4),_0x41c8fe=(_0x511c99=(_0x5df287=_0x156883[_0x255bca(0x104)]())===null||_0x5df287===void 0x0?void 0x0:_0x5df287[_0x255bca(0x14c)])!==null&&_0x511c99!==void 0x0?_0x511c99:_0x255bca(0x1a4);return{'changeset':{'unitID':_0xfbaec,'type':mapDocumentTypeToUniverInstanceType(_0x21611e[_0x255bca(0x26f)](_0xfbaec)),'baseRev':_0x4f4e79[_0x255bca(0x2e0)](_0xfbaec),'revision':0x0,'userID':_0x431892,'memberID':_0x41c8fe,'mutations':_0x28695d},'pendingMutations':[]};}function createTimerObservable$(_0x1b669f,_0x339098){const _0x2d49f9=_0x584c31,_0x2002ff=new ReplaySubject(0x1);return setTimeout(()=>_0x2002ff[_0x2d49f9(0x303)](_0x339098),_0x1b669f),_0x2002ff['asObservable']()['pipe'](take(0x1));}var _PendingState,_AwaitingState,_AwaitingWithPendingState;let CollaborationStatus=function(_0x3e24ff){const _0x4f8310=_0x584c31;return _0x3e24ff['NOT_COLLAB']=_0x4f8310(0x2f2),_0x3e24ff[_0x4f8310(0x1cd)]=_0x4f8310(0x197),_0x3e24ff[_0x4f8310(0x28f)]='pending',_0x3e24ff[_0x4f8310(0x2b6)]=_0x4f8310(0x2c5),_0x3e24ff[_0x4f8310(0x118)]=_0x4f8310(0x2ce),_0x3e24ff[_0x4f8310(0x2c4)]=_0x4f8310(0x110),_0x3e24ff[_0x4f8310(0x150)]='conflict',_0x3e24ff[_0x4f8310(0x15d)]=_0x4f8310(0x1ad),_0x3e24ff;}({});const MAX_RETRY_TIMEOUT=0x4e20,MAX_RETRY_TOTAL_TIMEOUT=0x2bf20;var CollaborationState=class{constructor(_0x25151f,_0x1aa3d2,_0x179066,_0x4536fc,_0x321f5d,_0x572163,_0x37fefa,_0x4aca64,_0x9c2635){const _0x15869a=_0x584c31;this[_0x15869a(0x158)]=_0x25151f,this[_0x15869a(0x16d)]=_0x1aa3d2,this[_0x15869a(0x20b)]=_0x321f5d,this[_0x15869a(0x2b8)]=_0x572163,this[_0x15869a(0x2a1)]=_0x37fefa,this[_0x15869a(0x18c)]=_0x4aca64,this[_0x15869a(0x1d4)]=_0x9c2635,_defineProperty(this,_0x15869a(0x2f5),null),_defineProperty(this,'_pendingMutations',[]),this[_0x15869a(0x2f5)]=_0x179066,this[_0x15869a(0x127)]=_0x4536fc;}['_checkMissing'](_0x418ded){const _0x315c1b=_0x584c31,_0x5198de=this['_revisionService'][_0x315c1b(0x2e0)](this[_0x315c1b(0x158)]);if(_0x418ded['revision']>_0x5198de+0x1)return this[_0x315c1b(0x20b)][_0x315c1b(0xc4)]({'from':_0x5198de,'to':_0x418ded['revision']-0x1}),!![];return![];}[_0x584c31(0x22c)](_0x5cc218){const _0x524571=_0x584c31;this['_undoRedoService'][_0x524571(0xe7)](this[_0x524571(0x158)],_0x5cc218);}[_0x584c31(0x26d)](_0x446a0f){const _0x1e9c5b=_0x584c31;var _0x3bcca5,_0x2b64e7;(_0x3bcca5=(_0x2b64e7=this[_0x1e9c5b(0x20b)])[_0x1e9c5b(0xe8)])===null||_0x3bcca5===void 0x0||_0x3bcca5[_0x1e9c5b(0x23e)](_0x2b64e7,_0x446a0f);}['_transformIMECache'](_0x5e8a6e){const _0x3f820f=_0x584c31;var _0x51c26b,_0x3fc796;return(_0x51c26b=(_0x3fc796=this[_0x3f820f(0x20b)])['onTransformIME'])===null||_0x51c26b===void 0x0?void 0x0:_0x51c26b[_0x3f820f(0x23e)](_0x3fc796,_0x5e8a6e);}[_0x584c31(0x28e)](_0x503e40){const _0x555655=_0x584c31;var _0x5e7f01,_0x25b6aa;return(_0x5e7f01=(_0x25b6aa=this[_0x555655(0x20b)])[_0x555655(0x191)])===null||_0x5e7f01===void 0x0?void 0x0:_0x5e7f01[_0x555655(0x23e)](_0x25b6aa,_0x503e40);}['_transformRemoteChangesetByIMECache'](_0x27fd3f){const _0xf2ad73=_0x584c31;var _0x41570f,_0x5ccb6f,_0x3fe69e;return(_0x41570f=(_0x5ccb6f=(_0x3fe69e=this['_handler'])[_0xf2ad73(0x279)])===null||_0x5ccb6f===void 0x0?void 0x0:_0x5ccb6f[_0xf2ad73(0x23e)](_0x3fe69e,_0x27fd3f))!==null&&_0x41570f!==void 0x0?_0x41570f:_0x27fd3f;}['_transformRemoteChangesetByStateCache'](_0x18d707){const _0x2b5da5=_0x584c31;var _0x3e6942,_0x1209b9,_0x5f584c;return(_0x3e6942=(_0x1209b9=(_0x5f584c=this['_handler'])[_0x2b5da5(0x1c3)])===null||_0x1209b9===void 0x0?void 0x0:_0x1209b9[_0x2b5da5(0x23e)](_0x5f584c,_0x18d707))!==null&&_0x3e6942!==void 0x0?_0x3e6942:_0x18d707;}[_0x584c31(0x318)](_0xa3fb5e){const _0x1cee54=_0x584c31;if(this['type']===UniverInstanceType[_0x1cee54(0x264)]){const {unitID:_0x3ac910,mutations:_0x167508,memberID:_0x21cdeb}=_0xa3fb5e,_0x5ee30a=_0x167508['length']>0x0?_0x167508[0x0][_0x1cee54(0x2de)][_0x1cee54(0x27a)]:[];if(Array[_0x1cee54(0x281)](_0x5ee30a)&&_0x5ee30a[_0x1cee54(0x2f6)]>0x0){var _0x21613c,_0x3b341f;(_0x21613c=(_0x3b341f=this['_handler'])[_0x1cee54(0x273)])===null||_0x21613c===void 0x0||_0x21613c['call'](_0x3b341f,{'unitID':_0x3ac910,'memberID':_0x21cdeb,'textRanges':_0x5ee30a});}}}['_updateLocalCache'](){const _0x5a7794=_0x584c31;var _0x40d4ba;(_0x40d4ba=this[_0x5a7794(0x1d4)])===null||_0x40d4ba===void 0x0||_0x40d4ba[_0x5a7794(0xe2)](this[_0x5a7794(0x158)],this['type'],this[_0x5a7794(0x2f5)],this[_0x5a7794(0x127)]);}[_0x584c31(0x12d)](){const _0x55a340=_0x584c31;return this['_revisionService'][_0x55a340(0x2e0)](this[_0x55a340(0x158)]);}[_0x584c31(0x268)](){const _0x1a5731=_0x584c31;this[_0x1a5731(0x18c)]['incrementRevOfUnit'](this['unitID']);}[_0x584c31(0xd7)](_0x313bb1){const _0x35cfc7=_0x584c31;let _0x5002ac=this['_transformRemoteChangesetByIMECache'](_0x313bb1);_0x5002ac=this[_0x35cfc7(0x157)](_0x5002ac);const _0x41d340=sequenceExecute(_0x5002ac['mutations'],this['_commandService'],{'fromCollab':!![]});if(!_0x41d340[_0x35cfc7(0x117)]){var _0x1f23e2;if(_0x41d340[_0x35cfc7(0xed)]instanceof Error)throw _0x41d340[_0x35cfc7(0xed)];throw new Error((_0x1f23e2=_0x41d340['error'])!==null&&_0x1f23e2!==void 0x0?_0x1f23e2:_0x35cfc7(0x11f));}this[_0x35cfc7(0x1f0)](_0x5002ac),this[_0x35cfc7(0x28e)](_0x5002ac),this[_0x35cfc7(0x22c)](_0x313bb1),this['_transformSelections'](_0x5002ac),this['_syncEditingCollabCursor'](_0x5002ac),this[_0x35cfc7(0x268)]();}};let SyncedState=class SyncedState extends CollaborationState{constructor(_0x4426ed,_0x2ec86a,_0x2a1b4c,_0x30fbd1,_0x5238a5,_0xfb2e75,_0xfd7d4e,_0x48a80c,_0x2decfd,_0x24275f){const _0x3f0b0c=_0x584c31;super(_0x4426ed,_0x2ec86a,null,[],_0x2a1b4c,_0xfd7d4e,_0xfb2e75,_0x30fbd1,_0x24275f),this[_0x3f0b0c(0x1ae)]=_0x5238a5,this[_0x3f0b0c(0x22b)]=_0x48a80c,this['_transformService']=_0x2decfd,this['localCacheService']=_0x24275f,_defineProperty(this,_0x3f0b0c(0x196),CollaborationStatus[_0x3f0b0c(0x1cd)]);}[_0x584c31(0x1ba)](_0x231e1f){const _0x20189d=_0x584c31,_0x50cd52=this[_0x20189d(0x1ae)][_0x20189d(0x142)](PendingState,this[_0x20189d(0x158)],this[_0x20189d(0x16d)],[_0x231e1f],this[_0x20189d(0x20b)]);return _0x50cd52[_0x20189d(0x2c6)](),_0x50cd52[_0x20189d(0x31e)](),_0x50cd52;}[_0x584c31(0x113)](_0x15ab00){const _0x1c2f9f=_0x584c31;if(this['_checkMissing'](_0x15ab00))return this['_injector']['createInstance'](FetchingMissState,this[_0x1c2f9f(0x158)],this['type'],null,[],null,[_0x15ab00],this['_handler']);try{const _0x3c7ae3=this[_0x1c2f9f(0x198)][_0x1c2f9f(0x261)](_0x15ab00,[EmptyMutationInfo]);if(isTransformMutationsWithChangesetSuccess(_0x3c7ae3)){const {c1Prime:_0x2170ed}=_0x3c7ae3;return this['_executeRemoteChangeset'](_0x2170ed),this;}throw _0x3c7ae3[_0x1c2f9f(0xed)];}catch(_0x35a091){return this[_0x1c2f9f(0x22b)]['error'](_0x35a091),this[_0x1c2f9f(0x128)](![]);}}[_0x584c31(0x128)](_0x39e90e){const _0x188242=_0x584c31;return this[_0x188242(0x1ae)][_0x188242(0x142)](ConflictState,this['unitID'],this['type'],null,[],this['_handler'],_0x39e90e);}[_0x584c31(0x189)](){const _0x575364=_0x584c31;throw new Error(_0x575364(0x106));}[_0x584c31(0x1b2)](){throw new Error('[SyncedState]:\x20received\x20rejection.');}['onRemoteRetry'](){return this;}[_0x584c31(0x1cb)](){const _0x3de77a=_0x584c31;return this[_0x3de77a(0x1ae)][_0x3de77a(0x142)](OfflineState,this[_0x3de77a(0x158)],this['type'],null,[],this[_0x3de77a(0x20b)]);}[_0x584c31(0x1e4)](){return this;}[_0x584c31(0x2ba)](){const _0x5d2aef=_0x584c31;throw new Error(_0x5d2aef(0x1ac));}[_0x584c31(0x2b7)](){const _0x5be666=_0x584c31,_0x396b14=this[_0x5be666(0x18c)][_0x5be666(0x2e0)](this[_0x5be666(0x158)]);return this['_handler'][_0x5be666(0xc4)]({'from':_0x396b14,'to':0x0}),this[_0x5be666(0x1ae)][_0x5be666(0x142)](FetchingMissState,this[_0x5be666(0x158)],this[_0x5be666(0x16d)],null,[],null,[],this['_handler']);}};SyncedState=__decorate([__decorateParam(0x3,Inject(RevisionService)),__decorateParam(0x4,Inject(Injector)),__decorateParam(0x5,IUndoRedoService),__decorateParam(0x6,ICommandService),__decorateParam(0x7,ILogService),__decorateParam(0x8,ITransformService),__decorateParam(0x9,Optional(ILocalCacheService))],SyncedState);let PendingState=_PendingState=class PendingState extends CollaborationState{constructor(_0x2466dd,_0x177a63,_0x138e32,_0x171ade,_0x47778b,_0xb81a78,_0xd6551e,_0xca1db3,_0x48b45b,_0x2a9864,_0x8cff21,_0x291261,_0x2204ec,_0x356b3a){const _0xd39fe2=_0x584c31;super(_0x2466dd,_0x177a63,null,_0x138e32,_0x171ade,_0x48b45b,_0x2204ec,_0xb81a78,_0x356b3a),this['_injector']=_0x47778b,this[_0xd39fe2(0xea)]=_0xd6551e,this['_logService']=_0xca1db3,this['_configService']=_0x2a9864,this['_transformService']=_0x8cff21,this[_0xd39fe2(0xc5)]=_0x291261,_defineProperty(this,_0xd39fe2(0x196),CollaborationStatus[_0xd39fe2(0x28f)]),_defineProperty(this,_0xd39fe2(0x283),null),_defineProperty(this,_0xd39fe2(0x262),null);}[_0x584c31(0x1ba)](_0x2686d9){const _0x283b8c=_0x584c31;return this[_0x283b8c(0x127)][_0x283b8c(0x125)](_0x2686d9),this[_0x283b8c(0x31e)](),this;}[_0x584c31(0x113)](_0x37930f){const _0x35f781=_0x584c31;if(this[_0x35f781(0xc8)](_0x37930f))return this[_0x35f781(0x1df)](),this[_0x35f781(0x1ae)][_0x35f781(0x142)](FetchingMissState,this[_0x35f781(0x158)],this[_0x35f781(0x16d)],null,this[_0x35f781(0x127)],null,[_0x37930f],this[_0x35f781(0x20b)]);try{const _0x28eb44=this['_transformService'][_0x35f781(0x261)](_0x37930f,this[_0x35f781(0x127)]);if(isTransformMutationsWithChangesetSuccess(_0x28eb44)){const {c1Prime:_0x48b444,m2Prime:_0x2edf21}=_0x28eb44;this[_0x35f781(0xd7)](_0x48b444);const _0x529fff=this['_injector'][_0x35f781(0x142)](_PendingState,this[_0x35f781(0x158)],this[_0x35f781(0x16d)],_0x2edf21,this[_0x35f781(0x20b)]);this[_0x35f781(0x1df)]();const _0x293eba=new Date()[_0x35f781(0x21a)](),_0x59c31b=this[_0x35f781(0x283)]?Math['max'](this[_0x35f781(0x283)]-_0x293eba,0x0):this['_getSendChangesetTimeout']();return _0x529fff[_0x35f781(0x2c6)](_0x59c31b),_0x529fff;}throw _0x28eb44[_0x35f781(0xed)];}catch(_0x58a08c){return this[_0x35f781(0x22b)][_0x35f781(0xed)](_0x58a08c),this['_onConflict'](![]);}}['onRemoteAck'](){const _0x9c68b0=_0x584c31;throw new Error(_0x9c68b0(0x247));}['onRemoteRej'](){const _0x483b14=_0x584c31;throw new Error(_0x483b14(0x299));}['onRemoteRetry'](){return this;}[_0x584c31(0x1cb)](){const _0x4b0261=_0x584c31;return this[_0x4b0261(0x1df)](),this[_0x4b0261(0x1ae)][_0x4b0261(0x142)](OfflineState,this['unitID'],this[_0x4b0261(0x16d)],null,this[_0x4b0261(0x127)],this[_0x4b0261(0x20b)]);}[_0x584c31(0x1e4)](){return this;}[_0x584c31(0x2c6)](_0x18474d){const _0x4021ec=_0x584c31,_0x48a9b4=_0x18474d!==null&&_0x18474d!==void 0x0?_0x18474d:this[_0x4021ec(0x177)]();this['_scheduleCompleteTimestamp']=new Date()[_0x4021ec(0x21a)]()+_0x48a9b4,this['_sendingTimer']=setTimeout(()=>{const _0x3611b9=_0x4021ec;this[_0x3611b9(0x1df)]();let _0x1594d7=null;switch(this[_0x3611b9(0x16d)]){case UniverInstanceType['UNIVER_SHEET']:_0x1594d7=assembleSheetChangeset(this[_0x3611b9(0x127)],this[_0x3611b9(0x158)],this[_0x3611b9(0xc5)],this[_0x3611b9(0x18c)],this[_0x3611b9(0xea)]);break;case UniverInstanceType[_0x3611b9(0x264)]:if(this[_0x3611b9(0x127)]['every'](_0x30a015=>_0x30a015['id']===RichTextEditingMutation['id']))_0x1594d7=assembleDocChangeset(this[_0x3611b9(0x127)],this[_0x3611b9(0x158)],this['_univerInstanceService'],this[_0x3611b9(0x18c)],this[_0x3611b9(0xea)]);else _0x1594d7=assembleSheetChangeset(this[_0x3611b9(0x127)],this[_0x3611b9(0x158)],this[_0x3611b9(0xc5)],this[_0x3611b9(0x18c)],this[_0x3611b9(0xea)]);break;default:throw new Error(_0x3611b9(0x170)+this[_0x3611b9(0x16d)]+'\x20in\x20_schedule.');}const {changeset:_0x2bc1e4,pendingMutations:_0x3c95f5}=_0x1594d7;this[_0x3611b9(0x20b)]['onSendChangeset'](_0x2bc1e4);const _0x26e450=_0x3c95f5['length']?this[_0x3611b9(0x1ae)][_0x3611b9(0x142)](AwaitingWithPendingState,this[_0x3611b9(0x158)],this[_0x3611b9(0x16d)],_0x2bc1e4,_0x3c95f5,this[_0x3611b9(0x20b)],void 0x0):this[_0x3611b9(0x1ae)][_0x3611b9(0x142)](AwaitingState,this['unitID'],this[_0x3611b9(0x16d)],_0x2bc1e4,this['_handler']);_0x26e450[_0x3611b9(0x31e)](),this['_handler'][_0x3611b9(0x164)](this,_0x26e450);},_0x48a9b4);}[_0x584c31(0x177)](){const _0x29d95e=_0x584c31;var _0x59b73e;const _0x1673f4=this[_0x29d95e(0x295)]['getConfig'](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x59b73e=_0x1673f4===null||_0x1673f4===void 0x0?void 0x0:_0x1673f4[_0x29d95e(0x11e)])!==null&&_0x59b73e!==void 0x0?_0x59b73e:DEFAULT_SEND_CHANGESET_TIMEOUT;}[_0x584c31(0x2ba)](){throw new Error('[PendingState]:\x20invalid\x20calling\x20to\x20`resend`.');}[_0x584c31(0x1df)](){const _0x4be243=_0x584c31;this['_sendingTimer']!=null&&(clearTimeout(this['_sendingTimer']),this[_0x4be243(0x262)]=null);}[_0x584c31(0x128)](_0x36e44e){const _0x307dc8=_0x584c31;return this['_clearScheduledTask'](),this['_injector'][_0x307dc8(0x142)](ConflictState,this['unitID'],this[_0x307dc8(0x16d)],null,this[_0x307dc8(0x127)],this[_0x307dc8(0x20b)],_0x36e44e);}};PendingState=_PendingState=__decorate([__decorateParam(0x4,Inject(Injector)),__decorateParam(0x5,Inject(RevisionService)),__decorateParam(0x6,Inject(MemberService)),__decorateParam(0x7,ILogService),__decorateParam(0x8,ICommandService),__decorateParam(0x9,IConfigService),__decorateParam(0xa,ITransformService),__decorateParam(0xb,IUniverInstanceService),__decorateParam(0xc,IUndoRedoService),__decorateParam(0xd,Optional(ILocalCacheService))],PendingState);let AwaitingState=_AwaitingState=class AwaitingState extends CollaborationState{constructor(_0x3dd4d4,_0x136788,_0x4b280b,_0x4f155b,_0x3a94ba,_0x47b929,_0x248811,_0x541b3b,_0x367282,_0x4fffb8,_0x5effa1){const _0x220e35=_0x584c31;super(_0x3dd4d4,_0x136788,_0x4b280b,[],_0x4f155b,_0x248811,_0x4fffb8,_0x47b929,_0x5effa1),this[_0x220e35(0x1ae)]=_0x3a94ba,this[_0x220e35(0x22b)]=_0x541b3b,this[_0x220e35(0x198)]=_0x367282,_defineProperty(this,'status',CollaborationStatus['AWAITING']),_defineProperty(this,_0x220e35(0x204),0x0),_defineProperty(this,_0x220e35(0x224),0x0),_defineProperty(this,'_resendTimer',void 0x0),_defineProperty(this,'_sender',void 0x0);}[_0x584c31(0x1ba)](_0x5d0e34){const _0x2ea54a=_0x584c31;this['_clearScheduledTask']();const _0x1f0d5b=this['_injector'][_0x2ea54a(0x142)](AwaitingWithPendingState,this[_0x2ea54a(0x158)],this[_0x2ea54a(0x16d)],this[_0x2ea54a(0x2f5)],[_0x5d0e34],this[_0x2ea54a(0x20b)],this[_0x2ea54a(0x2df)]);return _0x1f0d5b[_0x2ea54a(0x31e)](),_0x1f0d5b;}[_0x584c31(0x113)](_0x507907){const _0x1e365f=_0x584c31;if(this['_checkMissing'](_0x507907))return this[_0x1e365f(0x1df)](),this[_0x1e365f(0x1ae)][_0x1e365f(0x142)](FetchingMissState,this[_0x1e365f(0x158)],this[_0x1e365f(0x16d)],this[_0x1e365f(0x2f5)],[],null,[_0x507907],this[_0x1e365f(0x20b)]);try{const _0x554726=this[_0x1e365f(0x198)]['transformChangesets']([_0x507907],[this['_awaitingChangeset']],![]);if(isTransformChangesetsSuccess(_0x554726)){const {c1Prime:_0x1dc66f,c2Prime:_0x3fc7e0}=_0x554726;this[_0x1e365f(0xd7)](_0x1dc66f[0x0]),_0x3fc7e0[0x0]['baseRev']=this[_0x1e365f(0x12d)](),this[_0x1e365f(0x1df)]();const _0x33713f=this['_injector'][_0x1e365f(0x142)](_AwaitingState,this[_0x1e365f(0x158)],this[_0x1e365f(0x16d)],_0x3fc7e0[0x0],this[_0x1e365f(0x20b)]);return _0x33713f[_0x1e365f(0x31e)](),_0x33713f;}return this[_0x1e365f(0x128)](![]);}catch(_0x218d9e){return this[_0x1e365f(0x22b)][_0x1e365f(0xed)](_0x218d9e),this[_0x1e365f(0x128)](![]);}}[_0x584c31(0x189)](_0x343030){const _0x48a513=_0x584c31;this['_clearScheduledTask']();const _0x1e1b04=this[_0x48a513(0x18c)]['getCurrentRevOfUnit'](this[_0x48a513(0x158)]);if(_0x343030[_0x48a513(0xfc)]<_0x1e1b04-0x1)return this;if(this[_0x48a513(0xc8)](_0x343030))return this['_injector'][_0x48a513(0x142)](FetchingMissState,this[_0x48a513(0x158)],this[_0x48a513(0x16d)],null,[],this[_0x48a513(0x2f5)],[],this[_0x48a513(0x20b)]);this['_incrementRevisionNumber']();const _0x427e5e=this[_0x48a513(0x1ae)][_0x48a513(0x142)](SyncedState,this[_0x48a513(0x158)],this[_0x48a513(0x16d)],this['_handler']);return _0x427e5e[_0x48a513(0x31e)](),_0x427e5e;}[_0x584c31(0x1b2)](_0x10ad0d){return this['_onConflict'](!!(_0x10ad0d===null||_0x10ad0d===void 0x0?void 0x0:_0x10ad0d['isPermissionRej']));}[_0x584c31(0x259)](_0x794846){const _0x2326f5=_0x584c31;if(this[_0x2326f5(0x224)]>MAX_RETRY_TOTAL_TIMEOUT)return this['toggleOffline']();return this[_0x2326f5(0x2df)]=createTimerObservable$(this[_0x2326f5(0x204)],{'timeout':this[_0x2326f5(0x204)],'reqId':_0x794846[_0x2326f5(0x30a)]}),this['_sender']=this['_resendTimer'][_0x2326f5(0xd2)](({reqId:_0x1a8a9c,timeout:_0x1d589f})=>{this['_resendWithTimeout'](_0x1a8a9c,_0x1d589f);}),this;}[_0x584c31(0x1cb)](){const _0x4529bd=_0x584c31;return this['_clearScheduledTask'](),this[_0x4529bd(0x1ae)][_0x4529bd(0x142)](OfflineState,this['unitID'],this['type'],this[_0x4529bd(0x2f5)],[],this[_0x4529bd(0x20b)]);}[_0x584c31(0x1e4)](){return this;}['resend'](){const _0x2165c8=_0x584c31;this['_handler'][_0x2165c8(0xec)](this[_0x2165c8(0x2f5)]);}[_0x584c31(0x128)](_0x5ddf65){const _0x44e1e9=_0x584c31;return this[_0x44e1e9(0x1df)](),this['_injector'][_0x44e1e9(0x142)](ConflictState,this[_0x44e1e9(0x158)],this[_0x44e1e9(0x16d)],this[_0x44e1e9(0x2f5)],[],this['_handler'],_0x5ddf65);}[_0x584c31(0x1b8)](_0x4f5408,_0x26bf42){const _0x370c60=_0x584c31;var _0x4f9339;_0x4f5408===((_0x4f9339=this[_0x370c60(0x2f5)])===null||_0x4f9339===void 0x0?void 0x0:_0x4f9339[_0x370c60(0x30a)])&&(this[_0x370c60(0x2ba)](),this[_0x370c60(0x204)]=_0x26bf42===0x0?0x3e8:Math[_0x370c60(0x1bd)](_0x26bf42*0x2,MAX_RETRY_TIMEOUT),this[_0x370c60(0x224)]+=this[_0x370c60(0x204)]);}[_0x584c31(0x1df)](){const _0x6e3e8a=_0x584c31;var _0x18843b;(_0x18843b=this[_0x6e3e8a(0x26c)])===null||_0x18843b===void 0x0||_0x18843b[_0x6e3e8a(0x1a8)](),this[_0x6e3e8a(0x204)]=0x0,this[_0x6e3e8a(0x224)]=0x0;}};AwaitingState=_AwaitingState=__decorate([__decorateParam(0x4,Inject(Injector)),__decorateParam(0x5,Inject(RevisionService)),__decorateParam(0x6,ICommandService),__decorateParam(0x7,ILogService),__decorateParam(0x8,ITransformService),__decorateParam(0x9,IUndoRedoService),__decorateParam(0xa,Optional(ILocalCacheService))],AwaitingState);let AwaitingWithPendingState=_AwaitingWithPendingState=class AwaitingWithPendingState extends CollaborationState{constructor(_0x183152,_0x2ddc37,_0x5ceeda,_0x1481e8,_0x4dd19a,_0x3f3adb,_0x17996f,_0xcc4e8c,_0x3966eb,_0x167749,_0x5a9249,_0x49f3c5,_0x3e01ed){const _0x2a1234=_0x584c31;super(_0x183152,_0x2ddc37,_0x5ceeda,_0x1481e8,_0x4dd19a,_0x3966eb,_0x49f3c5,_0xcc4e8c,_0x3e01ed),this['_injector']=_0x17996f,this[_0x2a1234(0x22b)]=_0x167749,this[_0x2a1234(0x198)]=_0x5a9249,this[_0x2a1234(0x16c)]=_0x3e01ed,_defineProperty(this,'status',CollaborationStatus['AWAITING_WITH_PENDING']),_defineProperty(this,_0x2a1234(0x204),0x0),_defineProperty(this,'_maxTotalRetryTimeout',0x0),_defineProperty(this,_0x2a1234(0x2df),void 0x0),_defineProperty(this,'_sender',void 0x0),_0x3f3adb&&(this['_resendTimer']=_0x3f3adb,this[_0x2a1234(0x26c)]=this[_0x2a1234(0x2df)][_0x2a1234(0xd2)](({reqId:_0x26f0b8,timeout:_0x209be5})=>{const _0x26306a=_0x2a1234;this[_0x26306a(0x1b8)](_0x26f0b8,_0x209be5);}));}[_0x584c31(0x1ba)](_0x49681c){const _0x1a12ea=_0x584c31;return this[_0x1a12ea(0x127)][_0x1a12ea(0x125)](_0x49681c),this;}[_0x584c31(0x113)](_0x21bd95){const _0x209cd2=_0x584c31;if(this[_0x209cd2(0xc8)](_0x21bd95))return this[_0x209cd2(0x1df)](),this[_0x209cd2(0x1ae)][_0x209cd2(0x142)](FetchingMissState,this[_0x209cd2(0x158)],this[_0x209cd2(0x16d)],this['_awaitingChangeset'],this['_pendingMutations'],null,[_0x21bd95],this[_0x209cd2(0x20b)]);try{const _0x29b51a=this[_0x209cd2(0x198)][_0x209cd2(0x10b)]([_0x21bd95],[this[_0x209cd2(0x2f5)]],![]);if(isTransformChangesetsSuccess(_0x29b51a)){const {c1Prime:_0x154ef7,c2Prime:_0x246a45}=_0x29b51a,_0x2aac25=this['_transformService'][_0x209cd2(0x261)](_0x154ef7[0x0],this[_0x209cd2(0x127)]);if(isTransformMutationsWithChangesetSuccess(_0x2aac25)){const {c1Prime:_0x1f5e3a,m2Prime:_0x46253d}=_0x2aac25;return this[_0x209cd2(0xd7)](_0x1f5e3a),_0x246a45[0x0][_0x209cd2(0x245)]=this[_0x209cd2(0x12d)](),this[_0x209cd2(0x1df)](),this['_injector'][_0x209cd2(0x142)](_AwaitingWithPendingState,this[_0x209cd2(0x158)],this[_0x209cd2(0x16d)],_0x246a45[0x0],_0x46253d,this[_0x209cd2(0x20b)],void 0x0);}throw _0x2aac25[_0x209cd2(0xed)];}throw _0x29b51a[_0x209cd2(0xed)];}catch(_0x37e953){return this[_0x209cd2(0x22b)][_0x209cd2(0xed)](_0x37e953),this['_onConflict'](![]);}}['onRemoteAck'](_0x454d4f){const _0x4cd315=_0x584c31;this['_clearScheduledTask']();if(this['_checkMissing'](_0x454d4f))return this[_0x4cd315(0x1ae)][_0x4cd315(0x142)](FetchingMissState,this[_0x4cd315(0x158)],this['type'],null,this[_0x4cd315(0x127)],this[_0x4cd315(0x2f5)],[],this[_0x4cd315(0x20b)]);this[_0x4cd315(0x268)]();const _0xa605ea=this[_0x4cd315(0x1ae)][_0x4cd315(0x142)](PendingState,this[_0x4cd315(0x158)],this['type'],this[_0x4cd315(0x127)],this[_0x4cd315(0x20b)]);return _0xa605ea[_0x4cd315(0x2c6)](),_0xa605ea[_0x4cd315(0x31e)](),_0xa605ea;}[_0x584c31(0x1b2)](_0x5108c3){const _0x1aad94=_0x584c31;return this[_0x1aad94(0x128)](!!(_0x5108c3===null||_0x5108c3===void 0x0?void 0x0:_0x5108c3[_0x1aad94(0x256)]));}[_0x584c31(0x259)](_0x5726b6){const _0x4c1778=_0x584c31;if(this[_0x4c1778(0x224)]>MAX_RETRY_TOTAL_TIMEOUT)return this[_0x4c1778(0x1cb)]();return this['_resendTimer']=createTimerObservable$(this[_0x4c1778(0x204)],{'timeout':this[_0x4c1778(0x204)],'reqId':_0x5726b6[_0x4c1778(0x30a)]}),this[_0x4c1778(0x26c)]=this[_0x4c1778(0x2df)][_0x4c1778(0xd2)](({reqId:_0x428535,timeout:_0x4d84e3})=>{const _0x27058d=_0x4c1778;this[_0x27058d(0x1b8)](_0x428535,_0x4d84e3);}),this;}[_0x584c31(0x1cb)](){const _0x101f3c=_0x584c31;return this[_0x101f3c(0x1df)](),this[_0x101f3c(0x1ae)][_0x101f3c(0x142)](OfflineState,this[_0x101f3c(0x158)],this['type'],this[_0x101f3c(0x2f5)],this[_0x101f3c(0x127)],this['_handler']);}['toggleOnline'](){return this;}[_0x584c31(0x2ba)](){const _0x2b2d99=_0x584c31;this['_handler'][_0x2b2d99(0xec)](this[_0x2b2d99(0x2f5)]);}['_onConflict'](_0xc44fb){const _0x167aa0=_0x584c31;return this[_0x167aa0(0x1df)](),this[_0x167aa0(0x1ae)][_0x167aa0(0x142)](ConflictState,this[_0x167aa0(0x158)],this['type'],null,this[_0x167aa0(0x127)],this[_0x167aa0(0x20b)],_0xc44fb);}[_0x584c31(0x1b8)](_0x1ec03a,_0x57d4f4){const _0x153e0b=_0x584c31;var _0x58cb82;_0x1ec03a===((_0x58cb82=this[_0x153e0b(0x2f5)])===null||_0x58cb82===void 0x0?void 0x0:_0x58cb82[_0x153e0b(0x30a)])&&(this[_0x153e0b(0x2ba)](),this[_0x153e0b(0x204)]=_0x57d4f4===0x0?0x3e8:Math[_0x153e0b(0x1bd)](_0x57d4f4*0x2,MAX_RETRY_TIMEOUT),this[_0x153e0b(0x224)]+=this['_resendTimeout']);}['_clearScheduledTask'](){const _0x6a0899=_0x584c31;var _0x3ba005;(_0x3ba005=this[_0x6a0899(0x26c)])===null||_0x3ba005===void 0x0||_0x3ba005[_0x6a0899(0x1a8)](),this[_0x6a0899(0x204)]=0x0,this[_0x6a0899(0x224)]=0x0;}};AwaitingWithPendingState=_AwaitingWithPendingState=__decorate([__decorateParam(0x6,Inject(Injector)),__decorateParam(0x7,Inject(RevisionService)),__decorateParam(0x8,ICommandService),__decorateParam(0x9,ILogService),__decorateParam(0xa,ITransformService),__decorateParam(0xb,IUndoRedoService),__decorateParam(0xc,Optional(ILocalCacheService))],AwaitingWithPendingState);let ConflictState=class ConflictState extends CollaborationState{constructor(_0x5e49df,_0x35a65d,_0x245d63,_0x3a9b33,_0x224960,_0x1e89d3=![],_0x31c253,_0x3a7f19,_0x3424cd,_0x14e1a9,_0x11646,_0x33f54d,_0x410952){const _0x3a53c7=_0x584c31;super(_0x5e49df,_0x35a65d,_0x245d63,_0x3a9b33,_0x224960,_0x3a7f19,_0x3424cd,_0x14e1a9,_0x410952),this[_0x3a53c7(0x2e9)]=_0x1e89d3,this[_0x3a53c7(0x195)]=_0x31c253,this[_0x3a53c7(0x27f)]=_0x11646,this[_0x3a53c7(0x21b)]=_0x33f54d,this['localCacheService']=_0x410952,_defineProperty(this,_0x3a53c7(0x196),CollaborationStatus[_0x3a53c7(0x150)]),this[_0x3a53c7(0x1b4)](),this[_0x3a53c7(0x23a)](),this[_0x3a53c7(0x12c)]();}[_0x584c31(0x1ba)](){return this;}[_0x584c31(0x113)](){return this;}[_0x584c31(0x189)](){return this;}[_0x584c31(0x1b2)](){return this;}[_0x584c31(0x259)](){return this;}[_0x584c31(0x1cb)](){return this;}[_0x584c31(0x1e4)](){return this;}[_0x584c31(0x2ba)](){const _0x246235=_0x584c31;throw new Error(_0x246235(0x1e9));}[_0x584c31(0x23a)](){const _0x353de4=_0x584c31;var _0xcf5d3e;(_0xcf5d3e=this[_0x353de4(0x1d4)])===null||_0xcf5d3e===void 0x0||_0xcf5d3e[_0x353de4(0xe2)](this[_0x353de4(0x158)],this[_0x353de4(0x16d)],null,[]);}[_0x584c31(0x1b4)](){const _0x1e8f02=_0x584c31;if(this[_0x1e8f02(0x2e9)])this[_0x1e8f02(0x21b)][_0x1e8f02(0x19c)]({'id':CollaborationUIEventId[_0x1e8f02(0x1fe)]});else this[_0x1e8f02(0x21b)][_0x1e8f02(0x19c)]({'id':CollaborationUIEventId[_0x1e8f02(0x150)]});}[_0x584c31(0x12c)](){const _0x39d51a=_0x584c31;this[_0x39d51a(0x195)][_0x39d51a(0x2d3)](new WorkbookEditablePermission(this[_0x39d51a(0x158)])['id'],![]);}};ConflictState=__decorate([__decorateParam(0x6,Inject(IPermissionService)),__decorateParam(0x7,ICommandService),__decorateParam(0x8,IUndoRedoService),__decorateParam(0x9,Inject(RevisionService)),__decorateParam(0xa,Inject(LocaleService)),__decorateParam(0xb,Inject(CollaborationUIEventService)),__decorateParam(0xc,Optional(ILocalCacheService))],ConflictState);let OfflineState=class OfflineState extends CollaborationState{constructor(_0x3d82f9,_0x19386e,_0x4363dd,_0x50dd45,_0x319e1e,_0x346612,_0x1131bd,_0x44d27d,_0x309f46,_0x4f38f4){const _0x46dd7e=_0x584c31;super(_0x3d82f9,_0x19386e,_0x4363dd,_0x50dd45,_0x319e1e,_0x44d27d,_0x309f46,_0x1131bd,_0x4f38f4),this[_0x46dd7e(0x1ae)]=_0x346612,_defineProperty(this,_0x46dd7e(0x196),CollaborationStatus[_0x46dd7e(0x15d)]);}['appendMutation'](_0x2b9a5e){const _0x45df60=_0x584c31;return this[_0x45df60(0x127)]['push'](_0x2b9a5e),this[_0x45df60(0x31e)](),this;}[_0x584c31(0x113)](_0xbc10ff){const _0x1ae259=_0x584c31;throw new Error(_0x1ae259(0x2ea));}['onRemoteAck'](){const _0x339a42=_0x584c31;throw new Error(_0x339a42(0x1fa));}[_0x584c31(0x1b2)](){throw new Error('[OfflineState]:\x20received\x20rejection.');}[_0x584c31(0x259)](){return this;}[_0x584c31(0x1cb)](){return this;}[_0x584c31(0x1e4)](){const _0x3bf56b=_0x584c31,{_injector:_0x4f5d49,_pendingMutations:_0x288e42,_awaitingChangeset:_0x4b893b,unitID:_0xc139b9,_handler:_0x96f484,type:_0x1473c9}=this,_0x4d87f5=createOnlineState(_0x4f5d49,_0xc139b9,_0x1473c9,_0x4b893b,_0x288e42,_0x96f484);if(_0x4d87f5 instanceof PendingState)_0x4d87f5[_0x3bf56b(0x2c6)]();else{if(_0x4d87f5 instanceof AwaitingWithPendingState||_0x4d87f5 instanceof AwaitingState)_0x4d87f5['resend']();}return _0x4d87f5;}[_0x584c31(0x2ba)](){throw new Error('[OfflineState]:\x20invalid\x20calling\x20to\x20`resend`.');}};OfflineState=__decorate([__decorateParam(0x5,Inject(Injector)),__decorateParam(0x6,Inject(RevisionService)),__decorateParam(0x7,ICommandService),__decorateParam(0x8,IUndoRedoService),__decorateParam(0x9,Optional(ILocalCacheService))],OfflineState);let FetchingMissState=class FetchingMissState extends CollaborationState{constructor(_0x56e6fb,_0x54c7d7,_0x3c86a2,_0x523b49,_0xd206c7,_0x3ea28b,_0x3e1cb3,_0x3ee269,_0x381ca8,_0x1fd99a,_0x10cf59,_0x343a82,_0x3683c3,_0x26cff3){const _0x222f97=_0x584c31;super(_0x56e6fb,_0x54c7d7,_0x3c86a2,_0x523b49,_0x3e1cb3,_0x10cf59,_0x343a82,_0x381ca8,_0x26cff3),this['_acknowledgedAwaitingChangeset']=_0xd206c7,this[_0x222f97(0x277)]=_0x3ea28b,this[_0x222f97(0x1ae)]=_0x3ee269,this[_0x222f97(0x22b)]=_0x1fd99a,this[_0x222f97(0x198)]=_0x3683c3,this[_0x222f97(0x16c)]=_0x26cff3,_defineProperty(this,_0x222f97(0x196),CollaborationStatus[_0x222f97(0x2c4)]);}[_0x584c31(0x16a)](_0x2a6e6e){const _0x421ce4=_0x584c31;try{const _0xa14e06=[..._0x2a6e6e,...this['_queuedRemoteChangesets']],_0x4f0928=[this[_0x421ce4(0x2f5)]||this['_acknowledgedAwaitingChangeset']][_0x421ce4(0x167)](_0x216cf5=>!!_0x216cf5);let _0x2e8050,_0x344057;if(_0x4f0928[_0x421ce4(0x2f6)]){const _0x5bc23a=this[_0x421ce4(0x198)]['transformChangesets'](_0xa14e06,_0x4f0928,![]);if(!isTransformChangesetsSuccess(_0x5bc23a))throw _0x5bc23a['error'];_0x2e8050=_0x5bc23a[_0x421ce4(0x143)],_0x344057=_0x5bc23a[_0x421ce4(0x215)];}else _0x2e8050=_0xa14e06,_0x344057=[];let _0x443b7a=this[_0x421ce4(0x127)];_0x2e8050[_0x421ce4(0x1a5)](_0x9f15fc=>{const _0x3533aa=_0x421ce4;let _0x478cd4;if(_0x443b7a[_0x3533aa(0x2f6)]){const _0x34cb57=this['_transformService'][_0x3533aa(0x261)](_0x9f15fc,_0x443b7a);if(!isTransformMutationsWithChangesetSuccess(_0x34cb57))throw _0x34cb57[_0x3533aa(0xed)];_0x478cd4=_0x34cb57[_0x3533aa(0x143)],_0x443b7a=_0x34cb57[_0x3533aa(0x22d)];}else _0x478cd4=_0x9f15fc;this['_executeRemoteChangeset'](_0x478cd4);});if(this[_0x421ce4(0x19f)])this['_incrementRevisionNumber']();if(this[_0x421ce4(0x2f5)]&&_0x344057[_0x421ce4(0x2f6)])_0x344057[0x0][_0x421ce4(0x245)]=this[_0x421ce4(0x12d)]();let _0x16741e;if(this['_awaitingChangeset']&&_0x443b7a[_0x421ce4(0x2f6)]!==0x0)_0x16741e=this['_injector']['createInstance'](AwaitingWithPendingState,this[_0x421ce4(0x158)],this[_0x421ce4(0x16d)],_0x344057[0x0],_0x443b7a,this['_handler'],void 0x0);else{if(this[_0x421ce4(0x2f5)]&&_0x443b7a['length']===0x0)_0x344057[0x0]['baseRev']=this['_getCurrentRevision'](),_0x16741e=this[_0x421ce4(0x1ae)]['createInstance'](AwaitingState,this['unitID'],this['type'],_0x344057[0x0],this[_0x421ce4(0x20b)]);else{if(_0x443b7a[_0x421ce4(0x2f6)]!==0x0){const _0x271961=this[_0x421ce4(0x1ae)][_0x421ce4(0x142)](PendingState,this[_0x421ce4(0x158)],this[_0x421ce4(0x16d)],_0x443b7a,this['_handler']);_0x271961[_0x421ce4(0x2c6)](),_0x16741e=_0x271961;}else _0x16741e=this['_injector'][_0x421ce4(0x142)](SyncedState,this[_0x421ce4(0x158)],this['type'],this['_handler']);}}return _0x16741e[_0x421ce4(0x31e)](),_0x16741e;}catch(_0x4524ea){return this[_0x421ce4(0x22b)][_0x421ce4(0xed)](_0x421ce4(0x166),_0x421ce4(0x13e),_0x4524ea),this[_0x421ce4(0x1ae)][_0x421ce4(0x142)](ConflictState,this[_0x421ce4(0x158)],this[_0x421ce4(0x16d)],this['_awaitingChangeset'],this[_0x421ce4(0x127)],this[_0x421ce4(0x20b)],![]);}}[_0x584c31(0x2ba)](){const _0x2780b4=_0x584c31;throw new Error(_0x2780b4(0x27d));}[_0x584c31(0x1ba)](_0x373edb){const _0x1ce4e9=_0x584c31;return this[_0x1ce4e9(0x127)][_0x1ce4e9(0x125)](_0x373edb),this;}[_0x584c31(0x113)](_0x290e30){return this['_queuedRemoteChangesets']['push'](_0x290e30),this;}[_0x584c31(0x189)](_0x5df321){const _0x5c119b=_0x584c31;if(this[_0x5c119b(0x2f5)])return this[_0x5c119b(0x19f)]=this[_0x5c119b(0x2f5)],this[_0x5c119b(0x2f5)]=null,this;throw new Error(_0x5c119b(0x2ca));}[_0x584c31(0x1b2)](_0x1fc99b){const _0x555068=_0x584c31;return this['_onConflict'](!!(_0x1fc99b===null||_0x1fc99b===void 0x0?void 0x0:_0x1fc99b[_0x555068(0x256)]));}[_0x584c31(0x259)](){return this;}['toggleOffline'](){const _0x5ad6c3=_0x584c31;return this[_0x5ad6c3(0x1ae)][_0x5ad6c3(0x142)](OfflineState,this['unitID'],this[_0x5ad6c3(0x16d)],this['_awaitingChangeset'],this['_pendingMutations'],this[_0x5ad6c3(0x20b)]);}[_0x584c31(0x1e4)](){return this;}[_0x584c31(0x128)](_0x37cdc5){const _0xfd875e=_0x584c31;return this[_0xfd875e(0x1ae)]['createInstance'](ConflictState,this[_0xfd875e(0x158)],this[_0xfd875e(0x16d)],this['_awaitingChangeset'],this['_pendingMutations'],this[_0xfd875e(0x20b)],_0x37cdc5);}};FetchingMissState=__decorate([__decorateParam(0x7,Inject(Injector)),__decorateParam(0x8,Inject(RevisionService)),__decorateParam(0x9,ILogService),__decorateParam(0xa,ICommandService),__decorateParam(0xb,IUndoRedoService),__decorateParam(0xc,ITransformService),__decorateParam(0xd,Optional(ILocalCacheService))],FetchingMissState);function createOnlineState(_0x31d2c5,_0x2ea53f,_0x3804eb,_0x313cf1,_0x413414,_0x1e50af){const _0x18a2ff=_0x584c31;if(_0x313cf1&&_0x413414[_0x18a2ff(0x2f6)])return _0x31d2c5['createInstance'](AwaitingWithPendingState,_0x2ea53f,_0x3804eb,_0x313cf1,_0x413414,_0x1e50af,void 0x0);if(_0x313cf1)return _0x31d2c5[_0x18a2ff(0x142)](AwaitingState,_0x2ea53f,_0x3804eb,_0x313cf1,_0x1e50af);if(_0x413414[_0x18a2ff(0x2f6)])return _0x31d2c5[_0x18a2ff(0x142)](PendingState,_0x2ea53f,_0x3804eb,_0x413414,_0x1e50af);return _0x31d2c5[_0x18a2ff(0x142)](SyncedState,_0x2ea53f,_0x3804eb,_0x1e50af);}let CollaborationEntity=class CollaborationEntity extends RxDisposable{get[_0x584c31(0x284)](){const _0x19e578=_0x584c31;return this[_0x19e578(0x13c)];}constructor(_0x5535f6,_0x497764,_0xc085ab,_0x3f4055,_0x30fd8d,_0x254a45,_0x36b30b,_0x3772e8,_0x59d7f7,_0x32f9a4,_0x5af41d,_0x326e9b,_0xddaba8,_0x80d0af){const _0x1fe9dc=_0x584c31;super(),this[_0x1fe9dc(0x158)]=_0x5535f6,this[_0x1fe9dc(0x134)]=_0x497764,this[_0x1fe9dc(0x162)]=_0xc085ab,this[_0x1fe9dc(0x1ae)]=_0x3f4055,this['_compressMutationService']=_0x30fd8d,this[_0x1fe9dc(0x27f)]=_0x254a45,this['_revisionService']=_0x36b30b,this[_0x1fe9dc(0x23f)]=_0x3772e8,this[_0x1fe9dc(0xc5)]=_0x59d7f7,this['_logService']=_0x32f9a4,this[_0x1fe9dc(0x2b8)]=_0x5af41d,this[_0x1fe9dc(0x195)]=_0x326e9b,this[_0x1fe9dc(0x2fa)]=_0xddaba8,this[_0x1fe9dc(0x1d4)]=_0x80d0af,_defineProperty(this,'_state$',new BehaviorSubject(null)),_defineProperty(this,'state$',this[_0x1fe9dc(0x205)][_0x1fe9dc(0x2be)]()),_defineProperty(this,_0x1fe9dc(0x13c),void 0x0),_defineProperty(this,_0x1fe9dc(0x200),![]),_defineProperty(this,_0x1fe9dc(0x187),''),_defineProperty(this,_0x1fe9dc(0x1c7),0x0),_defineProperty(this,_0x1fe9dc(0x1f3),this[_0x1fe9dc(0x1b6)][_0x1fe9dc(0x2cb)](map(_0x121fc2=>{const _0x5fd5d2=_0x1fe9dc;if(_0x121fc2)return _0x121fc2[_0x5fd5d2(0x196)];return CollaborationStatus[_0x5fd5d2(0x15d)];}),shareReplay(0x1))),_defineProperty(this,'_transitionLocked',![]),_defineProperty(this,_0x1fe9dc(0x20c),[]);}async[_0x584c31(0x2f0)](){const _0x333da1=_0x584c31;if(this[_0x333da1(0x284)])throw new Error(_0x333da1(0x2fc));await this[_0x333da1(0x15b)]();}['pauseCollaboration'](){return this['_collaborationPaused']=!![],toDisposable(()=>{const _0x1ee39d=_0x9779;this['_collaborationPaused']=![],this[_0x1ee39d(0x2d5)]();});}['onLocalMutation'](_0x119542){this['_onLocalMutation'](_0x119542);}[_0x584c31(0x153)](_0x3a290e){const _0x596d7a=_0x584c31;this[_0x596d7a(0x13c)]=_0x3a290e,this['_state$']['next'](_0x3a290e);}async[_0x584c31(0x15b)](){const _0x39d46d=_0x584c31;this[_0x39d46d(0x153)](await this[_0x39d46d(0x1a2)]());if(this[_0x39d46d(0x2fa)]){var _0x484a04;(_0x484a04=this[_0x39d46d(0x2fa)])===null||_0x484a04===void 0x0||_0x484a04[_0x39d46d(0x2d0)](this['unitID']),this[_0x39d46d(0x103)](this['_singleActiveUnitService'][_0x39d46d(0x31c)](this[_0x39d46d(0x158)])[_0x39d46d(0xd2)](_0x3bc35c=>{const _0x54f1d4=_0x39d46d;this[_0x54f1d4(0x22b)]['debug'](_0x54f1d4(0x25e),'editing\x20status\x20changed\x20to',_0x3bc35c),_0x3bc35c===UnitStatus['OTHER_CLIENTS_EDITING']?(this[_0x54f1d4(0x23f)][_0x54f1d4(0x19c)]({'id':CollaborationUIEventId['OTHER_CLIENT_EDITING']}),this[_0x54f1d4(0x195)][_0x54f1d4(0x2d3)](new WorkbookEditablePermission(this[_0x54f1d4(0x158)])['id'],![]),this['_permissionService'][_0x54f1d4(0x213)](![])):(this[_0x54f1d4(0x195)]['updatePermissionPoint'](new WorkbookEditablePermission(this[_0x54f1d4(0x158)])['id'],!![]),this[_0x54f1d4(0x195)][_0x54f1d4(0x213)](!![]));}));}let _0x7e2a36=![];return this[_0x39d46d(0x103)](this[_0x39d46d(0x134)][_0x39d46d(0xdb)][_0x39d46d(0xd2)](_0xe30ada=>{const _0x10e3fc=_0x39d46d;if(_0xe30ada===SessionStatus[_0x10e3fc(0x307)])this['_toggleOnline'](_0x7e2a36);else _0xe30ada===SessionStatus[_0x10e3fc(0x15d)]&&(_0x7e2a36=!![],this[_0x10e3fc(0x212)]());})),this[_0x39d46d(0x103)](this[_0x39d46d(0x134)][_0x39d46d(0x2c8)]['subscribe'](_0x29eb85=>{const _0x1cc808=_0x39d46d;try{switch(_0x29eb85[_0x1cc808(0x257)]){case CollaborationEvent[_0x1cc808(0x2fd)]:this[_0x1cc808(0x2b4)](parseProtocolChangeset(_0x29eb85[_0x1cc808(0x2a7)]));break;case CollaborationEvent[_0x1cc808(0x2d2)]:this[_0x1cc808(0x154)](_0x29eb85[_0x1cc808(0x2a7)]);break;case CollaborationEvent['CHANGESET_REJ']:this[_0x1cc808(0x1a7)]();break;case CollaborationEvent[_0x1cc808(0x2cd)]:this['_onRemoteRetry'](_0x29eb85[_0x1cc808(0x2a7)]);break;case CollaborationEvent[_0x1cc808(0x269)]:this['_onFetchMissResult'](_0x29eb85['data'][_0x1cc808(0x123)][_0x1cc808(0x19e)](_0x14e667=>parseProtocolChangeset(_0x14e667)));break;case CollaborationEvent[_0x1cc808(0x2b5)]:this['_onRemoteRejected']({'isPermissionRej':!![]});break;case CollaborationEvent[_0x1cc808(0x122)]:break;}}catch(_0x1c503e){console[_0x1cc808(0xed)]('Error\x20on\x20receiving\x20event',_0x1c503e);throw _0x1c503e;}})),this[_0x39d46d(0x13c)];}[_0x584c31(0x30b)](){this['_transitionLocked']=![];}['_lockTransition'](){const _0x3b9386=_0x584c31;if(this[_0x3b9386(0x289)])throw new Error('[CollaborationEntity]:\x20cannot\x20lock\x20transition\x20twice!\x20This\x20is\x20an\x20implementation\x20error,\x20meaning\x20you\x20transit\x20the\x20collaboration\x20state\x20again\x20in\x20the\x20process\x20of\x20a\x20previous\x20transition.\x20This\x20should\x20never\x20happen.');this[_0x3b9386(0x289)]=!![];}[_0x584c31(0xef)](_0x351164){const _0x4a9ca0=_0x584c31;this[_0x4a9ca0(0x1af)](),this[_0x4a9ca0(0x153)](this[_0x4a9ca0(0x13c)]['appendMutation'](_0x351164)),this[_0x4a9ca0(0x30b)]();}[_0x584c31(0x2b4)](_0x42efeb){const _0x4fbe0c=_0x584c31;if(_0x42efeb['revision']<=this[_0x4fbe0c(0x18c)]['getCurrentRevOfUnit'](this['unitID']))return;if(this['_collaborationPaused']){this['_remoteChangesetQueue'][_0x4fbe0c(0x125)](_0x42efeb);return;}this['_applyRemoteChangeset'](_0x42efeb);}[_0x584c31(0x2d5)](){const _0x186541=_0x584c31;this[_0x186541(0x20c)][_0x186541(0x1a5)](_0x45ae0f=>this[_0x186541(0x1c8)](_0x45ae0f)),this[_0x186541(0x20c)]=[];}[_0x584c31(0x1c8)](_0x4193c4){const _0x1e2095=_0x584c31,_0x11feb2=this[_0x1e2095(0x1e6)][_0x1e2095(0x24b)][_0x1e2095(0xeb)](this['_compressMutationService'][_0x1e2095(0x24b)][_0x1e2095(0x169)]()[_0x1e2095(0x1b1)])(_0x4193c4[_0x1e2095(0x2bb)],null)||_0x4193c4['mutations'],_0x1188ef={..._0x4193c4,'mutations':_0x11feb2};this['_lockTransition'](),this['_updateState'](this[_0x1e2095(0x13c)][_0x1e2095(0x113)](_0x1188ef)),this[_0x1e2095(0x30b)]();}[_0x584c31(0x154)](_0x185406){const _0x395127=_0x584c31;this[_0x395127(0x1af)](),this[_0x395127(0x153)](this['_state'][_0x395127(0x189)](_0x185406)),this[_0x395127(0x30b)]();}[_0x584c31(0x1a7)](_0x13dba7){const _0x858056=_0x584c31;this[_0x858056(0x1af)](),this[_0x858056(0x153)](this['_state'][_0x858056(0x1b2)](_0x13dba7)),this['_unlockTransition']();}[_0x584c31(0xf6)](_0x4a7679){const _0xf123f0=_0x584c31;this[_0xf123f0(0x1af)](),this[_0xf123f0(0x153)](this[_0xf123f0(0x13c)][_0xf123f0(0x259)](_0x4a7679)),this[_0xf123f0(0x30b)]();}['_onFetchMissResult'](_0x4ae487){const _0x3fd7c5=_0x584c31;if(!(this[_0x3fd7c5(0x13c)]instanceof FetchingMissState))throw new TypeError(_0x3fd7c5(0x249));const _0x567fc0=_0x4ae487[_0x3fd7c5(0x19e)](_0x305fa3=>{const _0xb47762=_0x3fd7c5,_0x4621b8=this[_0xb47762(0x1e6)][_0xb47762(0x24b)]['fetchThroughInterceptors'](this[_0xb47762(0x1e6)]['interceptor'][_0xb47762(0x169)]()[_0xb47762(0x1b1)])(_0x305fa3[_0xb47762(0x2bb)],null)||_0x305fa3[_0xb47762(0x2bb)];return{..._0x305fa3,'mutations':_0x4621b8};});this[_0x3fd7c5(0x1af)](),this[_0x3fd7c5(0x153)](this[_0x3fd7c5(0x13c)][_0x3fd7c5(0x16a)](_0x567fc0)),this[_0x3fd7c5(0x30b)]();}[_0x584c31(0x212)](){const _0x43978f=_0x584c31;this[_0x43978f(0x1af)](),this['_updateState'](this[_0x43978f(0x13c)]['toggleOffline']()),this['_unlockTransition']();}[_0x584c31(0x29c)](_0x545e1f=![]){const _0x3c8e31=_0x584c31;this['_lockTransition'](),this[_0x3c8e31(0x153)](this[_0x3c8e31(0x13c)][_0x3c8e31(0x1e4)]()),this[_0x3c8e31(0x30b)]();const _0x1d4c35=this['_state'];_0x545e1f&&_0x1d4c35 instanceof SyncedState&&(this['_lockTransition'](),this['_updateState'](_0x1d4c35[_0x3c8e31(0x2b7)]()),this['_unlockTransition']());}async[_0x584c31(0x1a2)](){return new Promise(_0x4950ef=>{const _0x5a78fd=_0x9779;this[_0x5a78fd(0x134)][_0x5a78fd(0xdb)][_0x5a78fd(0x2cb)](take(0x1))[_0x5a78fd(0xd2)](async _0x316122=>{const _0x1b2574=_0x5a78fd;_0x4950ef(await this['_createInitialStateImpl'](_0x316122===SessionStatus[_0x1b2574(0x307)]));});});}[_0x584c31(0x2e2)](){const _0x45ed1e=_0x584c31,_0x478905=this[_0x45ed1e(0x158)];return{'onStateChange':(_0x52b023,_0x433bae)=>{const _0x2a48d3=_0x45ed1e;if(_0x52b023!==this[_0x2a48d3(0x13c)])throw new Error('[CollaborationEntity]:\x20invalid\x20state\x20transition!\x20State\x20transferred\x20from\x20is\x20not\x20the\x20current\x20state.\x0aBefore:\x20'+_0x52b023[_0x2a48d3(0x196)]+_0x2a48d3(0x1f8)+_0x433bae[_0x2a48d3(0x196)]+_0x2a48d3(0x21d)+this[_0x2a48d3(0x13c)][_0x2a48d3(0x196)]);this[_0x2a48d3(0x153)](_0x433bae);},'onSendChangeset':_0x54a886=>{const _0x568f91=_0x45ed1e;!_0x54a886[_0x568f91(0x12e)]&&(_0x54a886[_0x568f91(0x12e)]=this[_0x568f91(0x187)],_0x54a886[_0x568f91(0x30a)]=++this['_changesetReqId']);const _0x28aa08={'eventID':CollaborationEvent[_0x568f91(0x2bd)],'data':{'unitID':_0x54a886['unitID'],'unitType':this[_0x568f91(0x162)],'changeset':_0x54a886,'memberID':this[_0x568f91(0x134)][_0x568f91(0x14f)]()}};this[_0x568f91(0x134)][_0x568f91(0x241)](_0x28aa08,this[_0x568f91(0x158)]);},'onMissingChangesets':({from:_0x1cb0c0,to:_0x43470a})=>{const _0x5f5c3c=_0x45ed1e;this[_0x5f5c3c(0x22b)][_0x5f5c3c(0x2e7)](_0x5f5c3c(0x25e),_0x5f5c3c(0x24e)+_0x1cb0c0+'\x20to\x20'+_0x43470a);const _0x5661ee={'eventID':CollaborationEvent[_0x5f5c3c(0x14d)],'data':{'unitID':_0x478905,'unitType':this['_type'],'from':_0x1cb0c0,'to':_0x43470a}};this[_0x5f5c3c(0x134)][_0x5f5c3c(0x241)](_0x5661ee,this[_0x5f5c3c(0x158)]);}};}async['_createInitialStateImpl'](_0x478118){const _0x5cd1d7=_0x584c31;var _0x4acc4b,_0x15031e,_0x26a4fd;const _0x54d1e0=await((_0x4acc4b=this[_0x5cd1d7(0x1d4)])===null||_0x4acc4b===void 0x0?void 0x0:_0x4acc4b['loadOfflineData'](this[_0x5cd1d7(0x158)])),_0xa1be45=(_0x15031e=_0x54d1e0===null||_0x54d1e0===void 0x0?void 0x0:_0x54d1e0[_0x5cd1d7(0x2bb)])!==null&&_0x15031e!==void 0x0?_0x15031e:[],_0x5e3683=(_0x26a4fd=_0x54d1e0===null||_0x54d1e0===void 0x0?void 0x0:_0x54d1e0['awaitingChangeset'])!==null&&_0x26a4fd!==void 0x0?_0x26a4fd:null,_0x13da7e=!!(_0x5e3683===null||_0x5e3683===void 0x0?void 0x0:_0x5e3683[_0x5cd1d7(0x12e)])&&!!(_0x5e3683===null||_0x5e3683===void 0x0?void 0x0:_0x5e3683[_0x5cd1d7(0x30a)]);this[_0x5cd1d7(0x187)]=_0x13da7e?_0x5e3683[_0x5cd1d7(0x12e)]:uuidv4(),this['_changesetReqId']=_0x13da7e?_0x5e3683[_0x5cd1d7(0x30a)]:0x0;const _0xa4459f=this['unitID'];try{this[_0x5cd1d7(0x2eb)](_0x5e3683,_0xa1be45);}catch(_0x5d8221){this[_0x5cd1d7(0x22b)][_0x5cd1d7(0xed)](_0x5d8221);}const _0x4f8c8b=this[_0x5cd1d7(0x2e2)]();if(_0x478118){const _0x5d4055=createOnlineState(this[_0x5cd1d7(0x1ae)],_0xa4459f,this['_type'],_0x5e3683,_0xa1be45,_0x4f8c8b);if(_0x5d4055 instanceof PendingState)_0x5d4055['_schedule']();else{if(_0x5d4055 instanceof AwaitingWithPendingState||_0x5d4055 instanceof AwaitingState)_0x5d4055['resend']();}return _0x5d4055;}return this[_0x5cd1d7(0x1ae)]['createInstance'](OfflineState,_0xa4459f,this[_0x5cd1d7(0x162)],_0x5e3683,_0xa1be45,_0x4f8c8b);}[_0x584c31(0x2eb)](_0x25546a,_0x41d16b){const _0x34cf7a=_0x584c31;var _0x196b45,_0xe4fab2;const _0x5cd81=this['_compressMutationService']['interceptor'][_0x34cf7a(0xeb)](this['_compressMutationService'][_0x34cf7a(0x24b)][_0x34cf7a(0x169)]()[_0x34cf7a(0x1b1)]);(_0x196b45=_0x5cd81((_0x25546a===null||_0x25546a===void 0x0?void 0x0:_0x25546a[_0x34cf7a(0x2bb)])||[],null))===null||_0x196b45===void 0x0||_0x196b45[_0x34cf7a(0x1a5)](_0x57b764=>this[_0x34cf7a(0x2b8)][_0x34cf7a(0x272)](_0x57b764['id'],_0x57b764[_0x34cf7a(0x2de)])),(_0xe4fab2=_0x5cd81(_0x41d16b||[],null))===null||_0xe4fab2===void 0x0||_0xe4fab2[_0x34cf7a(0x1a5)](_0x237067=>this[_0x34cf7a(0x2b8)][_0x34cf7a(0x272)](_0x237067['id'],_0x237067[_0x34cf7a(0x2de)]));}};CollaborationEntity=__decorate([__decorateParam(0x3,Inject(Injector)),__decorateParam(0x4,Inject(CompressMutationService)),__decorateParam(0x5,Inject(LocaleService)),__decorateParam(0x6,Inject(RevisionService)),__decorateParam(0x7,Inject(CollaborationUIEventService)),__decorateParam(0x8,IUniverInstanceService),__decorateParam(0x9,ILogService),__decorateParam(0xa,ICommandService),__decorateParam(0xb,IPermissionService),__decorateParam(0xc,Optional(ISingleActiveUnitService)),__decorateParam(0xd,Optional(ILocalCacheService))],CollaborationEntity);let DocCollaborationEntity=class DocCollaborationEntity extends CollaborationEntity{constructor(_0x1317a9,_0x2cc4e3,_0x43cd14,_0x220f0f,_0x3eb5b1,_0x547489,_0x4c57b3,_0x132f11,_0xd18037,_0x1f4e3d,_0x34b3d7,_0x8662e6,_0xb147f5,_0x2af709){const _0x1bb12f=_0x584c31;super(_0x1317a9,_0x43cd14,_0x2cc4e3,_0x220f0f,_0x3eb5b1,_0x547489,_0x4c57b3,_0x132f11,_0xd18037,_0x1f4e3d,_0x34b3d7,_0x8662e6,_0xb147f5,_0x2af709),this[_0x1bb12f(0x158)]=_0x1317a9,this[_0x1bb12f(0x16d)]=_0x2cc4e3,_defineProperty(this,_0x1bb12f(0x248),null);}[_0x584c31(0x15a)](_0x457fea){this['_handlerCallback']=_0x457fea;}[_0x584c31(0x1ff)](){const _0x69f589=_0x584c31;this[_0x69f589(0x248)]=null,super[_0x69f589(0x1ff)]();}[_0x584c31(0x2e2)](){const _0x274856=_0x584c31,_0x4ecf5c=super[_0x274856(0x2e2)]();return _0x4ecf5c[_0x274856(0x139)]=_0x5044a2=>{var _0x58877b,_0x2a46b4;return(_0x58877b=this['_handlerCallback'])===null||_0x58877b===void 0x0||(_0x2a46b4=_0x58877b['onTransformIME'])===null||_0x2a46b4===void 0x0?void 0x0:_0x2a46b4['call'](_0x58877b,_0x5044a2);},_0x4ecf5c[_0x274856(0x191)]=_0x29d5da=>{const _0x3f0009=_0x274856;var _0x54b762,_0x63c037;return(_0x54b762=this[_0x3f0009(0x248)])===null||_0x54b762===void 0x0||(_0x63c037=_0x54b762[_0x3f0009(0x191)])===null||_0x63c037===void 0x0?void 0x0:_0x63c037[_0x3f0009(0x23e)](_0x54b762,_0x29d5da);},_0x4ecf5c['onTransformSelections']=_0x432d91=>{const _0x16cdd6=_0x274856;var _0x348be9,_0x89c33c;return(_0x348be9=this[_0x16cdd6(0x248)])===null||_0x348be9===void 0x0||(_0x89c33c=_0x348be9[_0x16cdd6(0xe8)])===null||_0x89c33c===void 0x0?void 0x0:_0x89c33c[_0x16cdd6(0x23e)](_0x348be9,_0x432d91);},_0x4ecf5c[_0x274856(0x273)]=_0x19a80d=>{const _0x3e5f33=_0x274856;var _0x244552,_0x29b10e;return(_0x244552=this[_0x3e5f33(0x248)])===null||_0x244552===void 0x0||(_0x29b10e=_0x244552[_0x3e5f33(0x273)])===null||_0x29b10e===void 0x0?void 0x0:_0x29b10e[_0x3e5f33(0x23e)](_0x244552,_0x19a80d);},_0x4ecf5c[_0x274856(0x279)]=_0x38b6d6=>{const _0x2938de=_0x274856;var _0x28bee4,_0x2e09e2,_0x38f119;if(!((_0x28bee4=this[_0x2938de(0x248)])===null||_0x28bee4===void 0x0?void 0x0:_0x28bee4[_0x2938de(0x279)]))throw new Error(_0x2938de(0x2e8));return(_0x2e09e2=this[_0x2938de(0x248)])===null||_0x2e09e2===void 0x0||(_0x38f119=_0x2e09e2[_0x2938de(0x279)])===null||_0x38f119===void 0x0?void 0x0:_0x38f119[_0x2938de(0x23e)](_0x2e09e2,_0x38b6d6);},_0x4ecf5c[_0x274856(0x1c3)]=_0x6955aa=>{const _0x5e29e6=_0x274856;var _0x27d6f4,_0x3459a3,_0x4957f8;if(!((_0x27d6f4=this[_0x5e29e6(0x248)])===null||_0x27d6f4===void 0x0?void 0x0:_0x27d6f4[_0x5e29e6(0x1c3)]))throw new Error(_0x5e29e6(0x133));return(_0x3459a3=this[_0x5e29e6(0x248)])===null||_0x3459a3===void 0x0||(_0x4957f8=_0x3459a3[_0x5e29e6(0x1c3)])===null||_0x4957f8===void 0x0?void 0x0:_0x4957f8[_0x5e29e6(0x23e)](_0x3459a3,_0x6955aa);},_0x4ecf5c;}async[_0x584c31(0x15b)](){const _0x5187bc=_0x584c31,_0x8b3a1d=await super[_0x5187bc(0x15b)]();return this[_0x5187bc(0x103)](this['_commandService']['onMutationExecutedForCollab']((_0x256e34,_0x44d9dc)=>{const _0x18b36f=_0x5187bc;if(_0x256e34[_0x18b36f(0x16d)]!==CommandType[_0x18b36f(0x1f4)]||(_0x44d9dc===null||_0x44d9dc===void 0x0?void 0x0:_0x44d9dc[_0x18b36f(0x135)])||(_0x44d9dc===null||_0x44d9dc===void 0x0?void 0x0:_0x44d9dc['onlyLocal']))return;if(_0x256e34['id']===RichTextEditingMutation['id'])return;const _0x1b1cb8=_0x256e34['params'];if((_0x1b1cb8===null||_0x1b1cb8===void 0x0?void 0x0:_0x1b1cb8[_0x18b36f(0x1d7)])!==this[_0x18b36f(0x158)])return;const _0x18dc8e=_0x256e34,_0x5a1b04=this[_0x18b36f(0x1e6)]['interceptor'][_0x18b36f(0xeb)](this['_compressMutationService'][_0x18b36f(0x24b)][_0x18b36f(0x169)]()[_0x18b36f(0x2b1)])([_0x18dc8e],this[_0x18b36f(0xc5)])||[_0x18dc8e];this['_onLocalMutation'](_0x5a1b04[0x0]);})),_0x8b3a1d;}};DocCollaborationEntity=__decorate([__decorateParam(0x3,Inject(Injector)),__decorateParam(0x4,Inject(CompressMutationService)),__decorateParam(0x5,Inject(LocaleService)),__decorateParam(0x6,Inject(RevisionService)),__decorateParam(0x7,Inject(CollaborationUIEventService)),__decorateParam(0x8,IUniverInstanceService),__decorateParam(0x9,ILogService),__decorateParam(0xa,ICommandService),__decorateParam(0xb,IPermissionService),__decorateParam(0xc,Optional(ISingleActiveUnitService)),__decorateParam(0xd,Optional(ILocalCacheService))],DocCollaborationEntity);let SheetCollaborationEntity=class SheetCollaborationEntity extends CollaborationEntity{constructor(_0x5e6242,_0xd69c6c,_0x2de697,_0x576d23,_0x2a9fa7,_0xa25b7f,_0x3bd97e,_0x330c0b,_0x4dab3b,_0x253f8d,_0x2d521f,_0x5b4ada,_0x295d9a,_0x568218,_0x90b80e){const _0x4db4ca=_0x584c31;super(_0x5e6242,_0x2de697,_0xd69c6c,_0x576d23,_0x2a9fa7,_0xa25b7f,_0x3bd97e,_0x4dab3b,_0x253f8d,_0x2d521f,_0x5b4ada,_0x295d9a,_0x568218,_0x90b80e),this[_0x4db4ca(0x158)]=_0x5e6242,this[_0x4db4ca(0x16d)]=_0xd69c6c,this[_0x4db4ca(0x174)]=_0x330c0b;}[_0x584c31(0x2e2)](){const _0x53b7a2=_0x584c31,_0x11e365=super[_0x53b7a2(0x2e2)]();return _0x11e365['onTransformSelections']=_0x13a4fd=>this[_0x53b7a2(0x174)][_0x53b7a2(0x1dd)](_0x13a4fd),_0x11e365;}async['_init'](){const _0x2a9afd=_0x584c31,_0x2f5d18=await super[_0x2a9afd(0x15b)]();return this['disposeWithMe'](this[_0x2a9afd(0x2b8)][_0x2a9afd(0x28c)]((_0x5d28cb,_0x59e9a2)=>{const _0x541243=_0x2a9afd;if(_0x5d28cb[_0x541243(0x16d)]!==CommandType[_0x541243(0x1f4)]||(_0x59e9a2===null||_0x59e9a2===void 0x0?void 0x0:_0x59e9a2['fromCollab'])||(_0x59e9a2===null||_0x59e9a2===void 0x0?void 0x0:_0x59e9a2['onlyLocal']))return;const _0x4d0e01=_0x5d28cb['params'];if((_0x4d0e01===null||_0x4d0e01===void 0x0?void 0x0:_0x4d0e01[_0x541243(0x1d7)])!==this[_0x541243(0x158)])return;const _0x595513=_0x5d28cb,_0x30af98=this['_compressMutationService'][_0x541243(0x24b)]['fetchThroughInterceptors'](this[_0x541243(0x1e6)][_0x541243(0x24b)][_0x541243(0x169)]()[_0x541243(0x2b1)])([_0x595513],this[_0x541243(0xc5)])||[_0x595513];this[_0x541243(0xef)](_0x30af98[0x0]);})),_0x2f5d18;}};SheetCollaborationEntity=__decorate([__decorateParam(0x3,Inject(Injector)),__decorateParam(0x4,Inject(CompressMutationService)),__decorateParam(0x5,Inject(LocaleService)),__decorateParam(0x6,Inject(RevisionService)),__decorateParam(0x7,Inject(SheetTransformSelectionsService)),__decorateParam(0x8,Inject(CollaborationUIEventService)),__decorateParam(0x9,IUniverInstanceService),__decorateParam(0xa,ILogService),__decorateParam(0xb,ICommandService),__decorateParam(0xc,IPermissionService),__decorateParam(0xd,Optional(ISingleActiveUnitService)),__decorateParam(0xe,Optional(ILocalCacheService))],SheetCollaborationEntity);const INetworkConditionService=createIdentifier(_0x584c31(0x229));function deserializeToCombResponse(_0x2b179f){const _0x1923fb=_0x584c31,_0xbd3e3=_0x2b179f[_0x1923fb(0x2a7)],_0x492625=JSON[_0x1923fb(0x1c1)](_0xbd3e3);switch(_0x492625[_0x1923fb(0x2d4)]){case CombCmd['HEARTBEAT']:case CombCmd[_0x1923fb(0x111)]:{const _0x5aad60=_0x492625[_0x1923fb(0x14e)];return{..._0x492625,'data':_0x5aad60,'cmd':_0x492625[_0x1923fb(0x2d4)]};}case CombCmd[_0x1923fb(0x1ed)]:{const _0x2924be=_0x492625['joinRsp'];return{..._0x492625,'data':_0x2924be,'cmd':_0x492625[_0x1923fb(0x2d4)]};}case CombCmd['RECV']:{const _0x70e225=_0x492625['collaMsg'];switch(_0x70e225[_0x1923fb(0x257)]){case CollaborationEvent[_0x1923fb(0x2b5)]:var _0x438eea;return{..._0x492625,'data':{..._0x70e225,'data':(_0x438eea=_0x70e225[_0x1923fb(0x13d)])===null||_0x438eea===void 0x0?void 0x0:_0x438eea['cs']},'cmd':_0x492625[_0x1923fb(0x2d4)]};case CollaborationEvent['CHANGESET_ACK']:var _0x3b94fb;return{..._0x492625,'data':{..._0x70e225,'data':(_0x3b94fb=_0x70e225['csAckEvent'])===null||_0x3b94fb===void 0x0?void 0x0:_0x3b94fb['cs']},'cmd':_0x492625[_0x1923fb(0x2d4)]};case CollaborationEvent[_0x1923fb(0x2fd)]:var _0x162b5a;return{..._0x492625,'data':{..._0x70e225,'data':(_0x162b5a=_0x70e225[_0x1923fb(0x175)])===null||_0x162b5a===void 0x0?void 0x0:_0x162b5a['cs']},'cmd':_0x492625[_0x1923fb(0x2d4)]};case CollaborationEvent['CHANGESET_REJ']:var _0x4d9cef;return{..._0x492625,'data':{..._0x70e225,'data':(_0x4d9cef=_0x70e225[_0x1923fb(0x23c)])===null||_0x4d9cef===void 0x0?void 0x0:_0x4d9cef['cs']},'cmd':_0x492625[_0x1923fb(0x2d4)]};case CollaborationEvent[_0x1923fb(0x2cd)]:var _0xb32327;return{..._0x492625,'data':{..._0x70e225,'data':(_0xb32327=_0x70e225[_0x1923fb(0x23b)])===null||_0xb32327===void 0x0?void 0x0:_0xb32327['cs']},'cmd':_0x492625['cmd']};case CollaborationEvent[_0x1923fb(0x286)]:return{..._0x492625,'data':{..._0x70e225,'data':_0x70e225[_0x1923fb(0x237)]},'cmd':_0x492625[_0x1923fb(0x2d4)]};case CollaborationEvent[_0x1923fb(0x2e4)]:return{..._0x492625,'data':{..._0x70e225,'data':_0x70e225['joinEvent']},'cmd':_0x492625[_0x1923fb(0x2d4)]};case CollaborationEvent[_0x1923fb(0x20f)]:return{..._0x492625,'data':{..._0x70e225,'data':_0x70e225['leaveEvent']},'cmd':_0x492625['cmd']};case CollaborationEvent['LIVESHARE_NEW_HOST']:return{..._0x492625,'data':{..._0x70e225,'data':_0x70e225[_0x1923fb(0xcf)]},'cmd':_0x492625['cmd']};case CollaborationEvent['LIVESHARE_FETCH_OPERATIONS']:case CollaborationEvent[_0x1923fb(0x1d8)]:return{..._0x492625,'data':{..._0x70e225,'data':_0x70e225[_0x1923fb(0x17c)]},'cmd':_0x492625[_0x1923fb(0x2d4)]};case CollaborationEvent[_0x1923fb(0x233)]:return{..._0x492625,'data':{..._0x70e225,'data':_0x70e225[_0x1923fb(0xcf)]},'cmd':_0x492625['cmd']};case CollaborationEvent[_0x1923fb(0x2cc)]:return{..._0x492625,'data':_0x70e225,'cmd':_0x492625['cmd']};case CollaborationEvent[_0x1923fb(0x210)]:return{..._0x492625,'data':{..._0x70e225,'data':_0x70e225[_0x1923fb(0xca)]},'cmd':_0x492625[_0x1923fb(0x2d4)]};case CollaborationEvent['UPDATE_PERMISSION_OBJ']:return{..._0x492625,'data':{..._0x70e225,'data':_0x70e225[_0x1923fb(0xf7)]},'cmd':_0x492625[_0x1923fb(0x2d4)]};case CollaborationEvent[_0x1923fb(0x11c)]:return{..._0x492625,'data':{..._0x70e225,'data':_0x70e225[_0x1923fb(0x13b)]},'cmd':_0x492625[_0x1923fb(0x2d4)]};case CollaborationEvent['UNISCRIPT_RUN']:return{..._0x492625,'data':{..._0x70e225,'data':_0x70e225[_0x1923fb(0x1d6)]},'cmd':_0x492625['cmd']};default:return _0x492625;}}default:return _0x492625;}}function serializeCombRequest(_0x1655a8){const _0x4234c8=_0x584c31;switch(_0x1655a8['cmd']){case CombCmd[_0x4234c8(0x310)]:case CombCmd['HELLO']:return JSON[_0x4234c8(0x1f5)]({'cmd':_0x1655a8['cmd'],'routeKey':_0x1655a8[_0x4234c8(0x2ac)]});case CombCmd[_0x4234c8(0x255)]:{let _0x1d4584;switch(_0x1655a8['data']['eventID']){case CollaborationEvent[_0x4234c8(0x286)]:_0x1d4584={'eventID':CollaborationEvent[_0x4234c8(0x286)],'updateCursorEvent':_0x1655a8[_0x4234c8(0x2a7)][_0x4234c8(0x2a7)]};break;case CollaborationEvent[_0x4234c8(0x20f)]:_0x1d4584={'eventID':CollaborationEvent['USERS_LEAVE'],'leaveEvent':_0x1655a8['data'][_0x4234c8(0x2a7)]};break;case CollaborationEvent[_0x4234c8(0x2e4)]:_0x1d4584={'eventID':CollaborationEvent[_0x4234c8(0x2e4)],'joinEvent':_0x1655a8[_0x4234c8(0x2a7)]['data']};break;case CollaborationEvent[_0x4234c8(0x161)]:_0x1d4584={'eventID':CollaborationEvent[_0x4234c8(0x161)],'liveShareNewHost':_0x1655a8[_0x4234c8(0x2a7)][_0x4234c8(0x2a7)]};break;case CollaborationEvent['LIVESHARE_OPERATION']:_0x1d4584={'eventID':CollaborationEvent[_0x4234c8(0x1d8)],'liveShareOperation':_0x1655a8['data'][_0x4234c8(0x2a7)]};break;case CollaborationEvent['LIVESHARE_TERMINATE']:_0x1d4584={'eventID':CollaborationEvent[_0x4234c8(0x233)],'liveShareTerminate':_0x1655a8[_0x4234c8(0x2a7)]['data']};break;case CollaborationEvent[_0x4234c8(0x10a)]:_0x1d4584={'eventID':CollaborationEvent['LIVESHARE_REQUEST_HOST'],'liveShareRequestHost':_0x1655a8['data'][_0x4234c8(0x2a7)]};break;case CollaborationEvent[_0x4234c8(0xff)]:_0x1d4584={'eventID':CollaborationEvent[_0x4234c8(0xff)]};break;default:_0x1d4584={'eventID':_0x1655a8[_0x4234c8(0x2a7)]['eventID']};}return JSON[_0x4234c8(0x1f5)]({'cmd':_0x1655a8[_0x4234c8(0x2d4)],'routeKey':_0x1655a8[_0x4234c8(0x2ac)],'collaMsg':_0x1d4584});}case CombCmd[_0x4234c8(0x1ed)]:return JSON[_0x4234c8(0x1f5)]({'cmd':_0x1655a8[_0x4234c8(0x2d4)],'routeKey':_0x1655a8['routeKey'],'joinReq':_0x1655a8[_0x4234c8(0x2a7)]});case CombCmd[_0x4234c8(0x24a)]:return JSON[_0x4234c8(0x1f5)]({'cmd':_0x1655a8['cmd'],'routeKey':_0x1655a8['routeKey'],'leaveReq':_0x1655a8[_0x4234c8(0x2a7)]});default:throw new Error(_0x4234c8(0x2c0));}}const ICollaborationSocketService=createIdentifier('univer-pro.collaboration-client-socket-service');function generateSubmitChangesPath(_0x3aa854,_0x3016ca,_0x55f73b){const _0x4c0e59=_0x584c31;return _0x3aa854+'/'+_0x3016ca+_0x4c0e59(0x2ee)+_0x55f73b+_0x4c0e59(0x147);}let CollaborationSocketService=class CollaborationSocketService extends Disposable{constructor(_0x2f97d2,_0x5c65ba,_0x4a8b8b,_0x1e6e47,_0x363a1c){const _0x5ef99a=_0x584c31;super(),this['_injector']=_0x2f97d2,this['_httpService']=_0x5c65ba,this['_configService']=_0x4a8b8b,this[_0x5ef99a(0x22b)]=_0x1e6e47,this['_snapshotServerService']=_0x363a1c;}[_0x584c31(0x1bf)](_0x244660){const _0x1e9464=_0x584c31,_0x74434b=this[_0x1e9464(0x1ae)][_0x1e9464(0x1ea)](ISocketService);if(!_0x74434b)throw new Error(_0x1e9464(0x301));const _0x231e47=_0x74434b['createSocket'](_0x244660);if(!_0x231e47)throw new Error(_0x1e9464(0x101));const _0x2a7863=new DisposableCollection(),_0x5f0403=new Subject();_0x2a7863[_0x1e9464(0x2e5)](_0x231e47[_0x1e9464(0x28b)][_0x1e9464(0xd2)](_0xbf567b=>_0x5f0403['next'](_0xbf567b))),_0x2a7863[_0x1e9464(0x2e5)](toDisposable(()=>_0x5f0403['complete']()));const _0x20412b=new Subject();_0x2a7863[_0x1e9464(0x2e5)](_0x231e47[_0x1e9464(0x201)][_0x1e9464(0xd2)](_0x5814f2=>_0x20412b[_0x1e9464(0x303)](_0x5814f2))),_0x2a7863[_0x1e9464(0x2e5)](toDisposable(()=>_0x20412b[_0x1e9464(0x13a)]()));const _0x3a5b49=new Subject();_0x2a7863[_0x1e9464(0x2e5)](_0x231e47[_0x1e9464(0x28a)][_0x1e9464(0xd2)](_0x33f8c8=>{const _0x40e96f=_0x1e9464,_0x2046c0=deserializeToCombResponse(_0x33f8c8);_0x3a5b49[_0x40e96f(0x303)](_0x2046c0);})),_0x2a7863[_0x1e9464(0x2e5)](toDisposable(()=>_0x3a5b49[_0x1e9464(0x13a)]()));let _0x3f704a;const _0xa38a80=()=>{const _0xe0a956=_0x1e9464;_0x20412b[_0xe0a956(0x303)](new Event(_0xe0a956(0x2bf))),_0x5f0403['next'](new Event('connection\x20error')),_0x3f704a[_0xe0a956(0x105)]();};return _0x3f704a={'memberID':'','close$':_0x5f0403[_0x1e9464(0x2be)](),'error$':_0x20412b[_0x1e9464(0x2be)](),'open$':_0x231e47[_0x1e9464(0x1bc)],'message$':_0x3a5b49['asObservable'](),'send':_0x67be04=>{const _0x4fdf2a=_0x1e9464;if(_0x67be04[_0x4fdf2a(0x2d4)]===CombCmd[_0x4fdf2a(0x255)]){if(_0x67be04['data'][_0x4fdf2a(0x257)]===CollaborationEvent['SUBMIT_CHANGESET']){this[_0x4fdf2a(0x317)](_0x3f704a,_0x67be04[_0x4fdf2a(0x2a7)])['catch'](_0x419a8d=>{const _0x57c571=_0x4fdf2a;this[_0x57c571(0x22b)][_0x57c571(0xed)](_0x419a8d),_0xa38a80();});return;}if(_0x67be04[_0x4fdf2a(0x2a7)][_0x4fdf2a(0x257)]===CollaborationEvent[_0x4fdf2a(0x14d)]){const _0xd4de94=_0x67be04[_0x4fdf2a(0x2a7)];this[_0x4fdf2a(0x160)](_0xd4de94)[_0x4fdf2a(0x2c3)](_0x441fe6=>{const _0x5ae3c2=_0x4fdf2a;_0x3a5b49[_0x5ae3c2(0x303)]({'cmd':CombCmd[_0x5ae3c2(0x209)],'code':CmdRspCode['OK'],'routeKey':_0xd4de94[_0x5ae3c2(0x2a7)][_0x5ae3c2(0x158)],'routeType':'','data':{'eventID':CollaborationEvent['PSEUDO_FETCH_MISSING_RESULT'],'data':{'changesets':_0x441fe6}}});})['catch'](_0x55f93b=>{const _0x2a8deb=_0x4fdf2a;this[_0x2a8deb(0x22b)][_0x2a8deb(0xed)](_0x55f93b),_0xa38a80();});return;}}_0x231e47['send'](serializeCombRequest(_0x67be04));},'close':()=>{const _0xe5f051=_0x1e9464;_0x231e47[_0xe5f051(0x105)](),_0x2a7863[_0xe5f051(0x1ff)]();}},_0x3f704a;}async[_0x584c31(0x317)](_0x1a2138,_0x4ba92d){const _0x388750=_0x584c31;var _0x38ae27;const {unitType:_0x2834db,unitID:_0x485e9e,changeset:_0x29202b}=_0x4ba92d[_0x388750(0x2a7)],_0x10a716={'unitID':_0x485e9e,'memberID':_0x1a2138[_0x388750(0x14c)],'type':_0x2834db,'changeset':parseChangesetToProtocol(_0x29202b)},_0xde58a7=this['_configService']['getConfig'](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),_0x58ab00=generateSubmitChangesPath((_0x38ae27=_0xde58a7===null||_0xde58a7===void 0x0?void 0x0:_0xde58a7['collabSubmitChangesetUrl'])!==null&&_0x38ae27!==void 0x0?_0x38ae27:DEFAULT_COLLAB_SUBMIT_CHANGESET_URL,_0x2834db,_0x485e9e);try{await this['_httpService'][_0x388750(0x1f7)](_0x58ab00,{'body':_0x10a716});}catch(_0x4a285c){this[_0x388750(0x22b)]['error'](_0x388750(0xf8),'submit\x20changeset\x20error!');throw _0x4a285c;}}async[_0x584c31(0x160)](_0x4b90fe){const _0xf2b9f4=_0x584c31,{unitID:_0x2d6fcc,from:_0x14aab0,to:_0x486753,unitType:_0x3bbc81}=_0x4b90fe[_0xf2b9f4(0x2a7)];return(await this[_0xf2b9f4(0x319)][_0xf2b9f4(0x207)]({'metadata':void 0x0},{'unitID':_0x2d6fcc,'type':_0x3bbc81,'from':_0x14aab0,'to':_0x486753}))[_0xf2b9f4(0x123)][_0xf2b9f4(0x19e)](_0x3b67dd=>{const _0x1dfaa9=_0xf2b9f4;if(_0x3b67dd['mutations']===null||_0x3b67dd[_0x1dfaa9(0x2bb)]===void 0x0)_0x3b67dd[_0x1dfaa9(0x2bb)]=[];return _0x3b67dd;});}};CollaborationSocketService=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,Inject(HTTPService)),__decorateParam(0x2,IConfigService),__decorateParam(0x3,ILogService),__decorateParam(0x4,ISnapshotServerService)],CollaborationSocketService);let CollaborationSessionService=class CollaborationSessionService extends Disposable{get[_0x584c31(0x1eb)](){const _0xd9058c=_0x584c31;return this[_0xd9058c(0x156)][_0xd9058c(0xfa)]();}constructor(_0x55023c,_0x489298,_0x4077a4,_0x3bb252,_0x460dea,_0x4c9690){const _0x2308fe=_0x584c31;super(),this['_injector']=_0x55023c,this['_logService']=_0x489298,this[_0x2308fe(0x295)]=_0x4077a4,this[_0x2308fe(0xda)]=_0x3bb252,this['_collaborationUIEventService']=_0x460dea,this[_0x2308fe(0xf5)]=_0x4c9690,_defineProperty(this,'_socket$',new BehaviorSubject(void 0x0)),_defineProperty(this,_0x2308fe(0x2a2),this['_socket$'][_0x2308fe(0x2be)]()),_defineProperty(this,_0x2308fe(0x290),null),_defineProperty(this,'_sessions',new Map()),_defineProperty(this,_0x2308fe(0x107),new BehaviorSubject(SessionStatus[_0x2308fe(0x108)])),_defineProperty(this,_0x2308fe(0x1f3),this[_0x2308fe(0x107)][_0x2308fe(0x2be)]()),_defineProperty(this,_0x2308fe(0xe6),![]),_defineProperty(this,_0x2308fe(0x185),void 0x0),_defineProperty(this,_0x2308fe(0x112),0x0),_defineProperty(this,'_sendHeartbeatTimer',void 0x0),_defineProperty(this,_0x2308fe(0x30f),void 0x0),this[_0x2308fe(0x220)]();}[_0x584c31(0x220)](){const _0x35b16d=_0x584c31;if(!this[_0x35b16d(0xf5)])return;this[_0x35b16d(0x103)](this['_networkConditionService'][_0x35b16d(0x11b)][_0x35b16d(0xd2)](_0x4f7be8=>{if(_0x4f7be8&&!this['_socket'])this['reconnect']();if(!_0x4f7be8)this['_onOffline']();}));}[_0x584c31(0x1ff)](){const _0x9002bf=_0x584c31;super[_0x9002bf(0x1ff)](),this[_0x9002bf(0x1ca)](),this[_0x9002bf(0x141)](),this[_0x9002bf(0x2ed)](),this[_0x9002bf(0x109)][_0x9002bf(0x1a5)](_0x3a6e70=>_0x3a6e70[_0x9002bf(0x1ff)]()),this[_0x9002bf(0x109)]['clear'](),this['_status$'][_0x9002bf(0x13a)]();}async[_0x584c31(0x180)](_0x3a733a){const _0x2d86f0=_0x584c31;if(this[_0x2d86f0(0x109)]['has'](_0x3a733a))return this[_0x2d86f0(0x109)][_0x2d86f0(0x1ea)](_0x3a733a);this['_tryEnsureSocket']();const _0xcc0654=this[_0x2d86f0(0x1ae)][_0x2d86f0(0x142)](CollaborationSession,_0x3a733a,this['_socket$'][_0x2d86f0(0x2be)]());return this['_sessions']['set'](_0x3a733a,_0xcc0654),_0xcc0654;}[_0x584c31(0x314)](_0xbb8d45){const _0x1160d2=_0x584c31,_0x31c024=this[_0x1160d2(0x109)]['get'](_0xbb8d45);_0x31c024&&(this[_0x1160d2(0x109)][_0x1160d2(0x275)](_0xbb8d45),_0x31c024[_0x1160d2(0x105)]());if(!this[_0x1160d2(0x109)][_0x1160d2(0xfd)]){var _0x3fdbf6;(_0x3fdbf6=this[_0x1160d2(0x1eb)])===null||_0x3fdbf6===void 0x0||_0x3fdbf6[_0x1160d2(0x105)]();}}['reconnect'](){const _0x1fff08=_0x584c31;this[_0x1fff08(0x112)]=0x0,this[_0x1fff08(0x1ca)](),this['_tryReconnect']();}['_clearRetryConnectingTimer'](){const _0x2dab95=_0x584c31;this[_0x2dab95(0x185)]!=null&&(clearTimeout(this[_0x2dab95(0x185)]),this['_retryConnectingTimer']=null);}async[_0x584c31(0x17a)](){const _0x357105=_0x584c31;var _0x50c15c;const _0x3d6f33=this[_0x357105(0x295)][_0x357105(0x1cc)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),_0x54a38c=(_0x50c15c=_0x3d6f33===null||_0x3d6f33===void 0x0?void 0x0:_0x3d6f33[_0x357105(0x25c)])!==null&&_0x50c15c!==void 0x0?_0x50c15c:DEFAULT_COLLAB_WEB_SOCKET_URL,_0x3212db=await this[_0x357105(0xda)][_0x357105(0x148)](_0x54a38c);return this[_0x357105(0x290)]=_0x3212db,_0x3212db;}async[_0x584c31(0x1e8)](){const _0x28c6ba=_0x584c31;try{var _0x4b3688,_0x515a9f;const _0x4b5a62=(_0x4b3688=(_0x515a9f=this['_socket'])!==null&&_0x515a9f!==void 0x0?_0x515a9f:this['_candidateSocket'])!==null&&_0x4b3688!==void 0x0?_0x4b3688:await this[_0x28c6ba(0x17a)]();if(_0x4b5a62){const _0x1b473a=_0x4b5a62[_0x28c6ba(0x241)];_0x4b5a62['send']=_0x25f640=>{const _0x38f2f2=_0x28c6ba;if(_0x25f640[_0x38f2f2(0x2d4)]!==CombCmd[_0x38f2f2(0x24a)])this[_0x38f2f2(0x31b)]();return _0x1b473a['apply'](_0x4b5a62,[_0x25f640]);},_0x4b5a62['message$'][_0x28c6ba(0xd2)](_0x4430fb=>this[_0x28c6ba(0x2bc)](_0x4b5a62,_0x4430fb)),_0x4b5a62[_0x28c6ba(0x201)]['pipe'](_0x1b3341(0x1))[_0x28c6ba(0xd2)](_0x3d5005=>this[_0x28c6ba(0x22b)][_0x28c6ba(0xed)](_0x28c6ba(0x263),_0x3d5005)),_0x4b5a62[_0x28c6ba(0x1bc)]['pipe'](_0x1b3341(0x1))[_0x28c6ba(0xd2)](()=>{const _0x1833e6=_0x28c6ba;this[_0x1833e6(0x21c)](_0x4b5a62);}),_0x4b5a62[_0x28c6ba(0x28b)][_0x28c6ba(0x2cb)](_0x1b3341(0x1))[_0x28c6ba(0xd2)](_0x489317=>{const _0x9c15de=_0x28c6ba;this[_0x9c15de(0x22b)]['debug'](_0x9c15de(0x217),_0x9c15de(0x2ef),_0x489317),this[_0x9c15de(0x2da)]();});}}catch(_0x2e85a0){this[_0x28c6ba(0x22b)]['error'](_0x2e85a0),this['_onConnectionFailed']();}}[_0x584c31(0x21c)](_0x5d4a4a){const _0x88c45b=_0x584c31;this[_0x88c45b(0x22b)]['debug'](_0x88c45b(0x217),_0x88c45b(0x176)),_0x5d4a4a[_0x88c45b(0x241)]({'cmd':CombCmd['HELLO']}),this[_0x88c45b(0x31b)]();}[_0x584c31(0x29d)](){const _0x481f7b=_0x584c31;this[_0x481f7b(0xe6)]=![],this[_0x481f7b(0x290)]=null,this['_status$'][_0x481f7b(0x303)](SessionStatus['OFFLINE']),this[_0x481f7b(0x156)][_0x481f7b(0x303)](null),this['_clearTimeoutTimer'](),this[_0x481f7b(0x2ed)]();}['_onConnectionFailed'](){const _0x3c68dc=_0x584c31;var _0x350aed;this[_0x3c68dc(0x29d)]();if(this['_retryCount']<((_0x350aed=this[_0x3c68dc(0x295)]['getConfig'](_0x3c68dc(0x30c)))!==null&&_0x350aed!==void 0x0?_0x350aed:0x3))this['_collaborationUIEventService'][_0x3c68dc(0x19c)]({'id':CollaborationUIEventId[_0x3c68dc(0x2c1)]}),this[_0x3c68dc(0x190)]();else this['_collaborationUIEventService'][_0x3c68dc(0x19c)]({'id':CollaborationUIEventId['SOCKET_FAILED']});}[_0x584c31(0x190)](){const _0x342a38=_0x584c31;var _0x4feace;const _0x1ee968=this[_0x342a38(0x112)],_0x20e520=this[_0x342a38(0x295)][_0x342a38(0x1cc)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),_0x31f576=_0x1ee968===0x0?0x0:((_0x4feace=_0x20e520===null||_0x20e520===void 0x0?void 0x0:_0x20e520[_0x342a38(0x292)])!==null&&_0x4feace!==void 0x0?_0x4feace:DEFAULT_RETRY_CONNECTING_INTERVAL)*0x2**_0x1ee968;this[_0x342a38(0x185)]=setTimeout(()=>{const _0x43a970=_0x342a38;clearTimeout(this[_0x43a970(0x185)]),this['_retryConnectingTimer']=null,this[_0x43a970(0x1e8)]();},_0x31f576),this[_0x342a38(0x112)]+=0x1;}[_0x584c31(0x2bc)](_0x78e776,_0x4b4fcc){const _0x47db11=_0x584c31,{cmd:_0x3e4721}=_0x4b4fcc;_0x3e4721===CombCmd[_0x47db11(0x111)]&&!this[_0x47db11(0xe6)]&&(_0x78e776['memberID']=_0x4b4fcc['data']['memberID'],this[_0x47db11(0x156)][_0x47db11(0x303)](_0x78e776),this[_0x47db11(0x107)]['next'](SessionStatus['ONLINE']),this[_0x47db11(0xe6)]=!![],this[_0x47db11(0x290)]=null);if(_0x3e4721===CombCmd[_0x47db11(0x310)])this[_0x47db11(0x141)]();this['_rescheduleHeartbeat']();}['_rescheduleHeartbeat'](){const _0xa51250=_0x584c31;var _0x9fafd6;this[_0xa51250(0x2ed)](),this['_sendHeartbeatTimer']=setTimeout(()=>this[_0xa51250(0x230)](),(_0x9fafd6=this['_configService']['getConfig'](_0xa51250(0x2e6)))!==null&&_0x9fafd6!==void 0x0?_0x9fafd6:DEFAULT_HEARTBEAT_INTERVAL);}[_0x584c31(0x230)](){const _0x2ce55a=_0x584c31;this[_0x2ce55a(0x1eb)]['send']({'cmd':CombCmd[_0x2ce55a(0x310)]}),this[_0x2ce55a(0xdd)]();}['_waitForHeartbeatResponse'](){const _0x2cc2f2=_0x584c31;var _0x45e72b;this[_0x2cc2f2(0x30f)]=setTimeout(()=>this[_0x2cc2f2(0x2da)](),(_0x45e72b=this['_configService'][_0x2cc2f2(0x1cc)](_0x2cc2f2(0x280)))!==null&&_0x45e72b!==void 0x0?_0x45e72b:DEFAULT_HEARTBEAT_TIMEOUT);}[_0x584c31(0x2ed)](){const _0x3d1405=_0x584c31;this[_0x3d1405(0x2a5)]!=null&&(clearTimeout(this[_0x3d1405(0x2a5)]),this[_0x3d1405(0x2a5)]=null);}['_clearTimeoutTimer'](){const _0x3fc418=_0x584c31;this[_0x3fc418(0x30f)]!=null&&(clearTimeout(this[_0x3fc418(0x30f)]),this[_0x3fc418(0x30f)]=null);}};CollaborationSessionService=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,ILogService),__decorateParam(0x2,IConfigService),__decorateParam(0x3,ICollaborationSocketService),__decorateParam(0x4,Inject(CollaborationUIEventService)),__decorateParam(0x5,Optional(INetworkConditionService))],CollaborationSessionService);let CollaborationController=class CollaborationController extends RxDisposable{constructor(_0x25ed39,_0xf03e40,_0x3a6793,_0x1bee92){const _0x265450=_0x584c31;var _0x3395dd;super(),this['_injector']=_0x25ed39,this[_0x265450(0x208)]=_0xf03e40,this[_0x265450(0x295)]=_0x3a6793,this[_0x265450(0xc5)]=_0x1bee92,_defineProperty(this,_0x265450(0x159),new Map()),_defineProperty(this,_0x265450(0x265),new Subject()),_defineProperty(this,_0x265450(0x222),this['_entityInit$'][_0x265450(0x2be)]());if(((_0x3395dd=this[_0x265450(0x295)]['getConfig'](_0x265450(0x1c0)))===null||_0x3395dd===void 0x0?void 0x0:_0x3395dd['enableCollaboration'])!==![])this[_0x265450(0x15b)]();}[_0x584c31(0x1ff)](){const _0x298590=_0x584c31;super[_0x298590(0x1ff)](),this[_0x298590(0x159)][_0x298590(0x1a5)](_0x2d9b57=>_0x2d9b57[_0x298590(0x1ff)]()),this[_0x298590(0x159)][_0x298590(0x214)]();}[_0x584c31(0x211)](_0x4330ca){const _0x508422=_0x584c31;var _0x355e85;return(_0x355e85=this['_entities'][_0x508422(0x1ea)](_0x4330ca))!==null&&_0x355e85!==void 0x0?_0x355e85:null;}[_0x584c31(0x291)](_0x27bc87){const _0x5dd551=_0x584c31,_0x258249=this[_0x5dd551(0x211)](_0x27bc87);if(_0x258249)return of(_0x258249);return this[_0x5dd551(0x265)]['pipe'](filter(_0x35f7bf=>_0x35f7bf[_0x5dd551(0x158)]===_0x27bc87));}['readyForCollab'](_0x43591f){const _0x3a212e=_0x584c31;return firstValueFrom(this[_0x3a212e(0x291)](_0x43591f)['pipe'](_0x12630c(()=>void 0x0)));}[_0x584c31(0x15b)](){const _0xcecb95=_0x584c31,_0x28a269=0x10;this[_0xcecb95(0xc5)]['getTypeOfUnitAdded$'](UniverInstanceType[_0xcecb95(0x131)])[_0xcecb95(0x2cb)](takeUntil(this['dispose$']),delay(_0x28a269))['subscribe'](async _0x8a3ccd=>{const _0x3b0705=_0xcecb95,_0x2e30a2=_0x8a3ccd[_0x3b0705(0x2db)](),_0x114ce4=await this[_0x3b0705(0x171)](_0x2e30a2,UniverInstanceType[_0x3b0705(0x131)]);this[_0x3b0705(0x159)]['set'](_0x2e30a2,_0x114ce4);}),this[_0xcecb95(0xc5)]['getTypeOfUnitAdded$'](UniverInstanceType[_0xcecb95(0x264)])[_0xcecb95(0x2cb)](takeUntil(this[_0xcecb95(0x305)]),delay(_0x28a269))[_0xcecb95(0x2cb)](filter(_0x5591c0=>{const _0x218859=_0xcecb95;return!_0x5591c0[_0x218859(0x2db)]()[_0x218859(0x1f2)]('__');}))['subscribe'](async _0x2864e6=>{const _0x3c1d27=_0xcecb95,_0x2c08f8=_0x2864e6[_0x3c1d27(0x2db)](),_0xe78798=await this[_0x3c1d27(0x171)](_0x2c08f8,UniverInstanceType[_0x3c1d27(0x264)]);this[_0x3c1d27(0x159)]['set'](_0x2c08f8,_0xe78798);}),_0x3769d0(this[_0xcecb95(0xc5)][_0xcecb95(0x1ce)](UniverInstanceType[_0xcecb95(0x131)]),this[_0xcecb95(0xc5)][_0xcecb95(0x1ce)](UniverInstanceType['UNIVER_DOC']))[_0xcecb95(0x2cb)](takeUntil(this[_0xcecb95(0x305)]))[_0xcecb95(0xd2)](_0xa605a5=>{const _0x36c7ec=_0xcecb95,_0x4b80fe=_0xa605a5[_0x36c7ec(0x2db)](),_0x2dc2e6=this[_0x36c7ec(0x159)][_0x36c7ec(0x1ea)](_0x4b80fe);_0x2dc2e6&&(_0x2dc2e6['dispose'](),this[_0x36c7ec(0x159)][_0x36c7ec(0x275)](_0x4b80fe));});}async[_0x584c31(0x171)](_0x5563b0,_0x952ec3){const _0x33411b=_0x584c31,_0x1c57d0=await this[_0x33411b(0x208)][_0x33411b(0x180)](_0x5563b0),_0x30a0d2=this['_injector'][_0x33411b(0x142)](this[_0x33411b(0x276)](_0x952ec3),_0x5563b0,_0x952ec3,_0x1c57d0);return await _0x30a0d2[_0x33411b(0x2f0)](),this['_entityInit$'][_0x33411b(0x303)](_0x30a0d2),_0x30a0d2;}[_0x584c31(0x276)](_0x8ef892){const _0x2a3050=_0x584c31;switch(_0x8ef892){case UniverInstanceType[_0x2a3050(0x264)]:return DocCollaborationEntity;case UniverInstanceType['UNIVER_SHEET']:return SheetCollaborationEntity;default:throw new Error(_0x2a3050(0x231)+_0x8ef892);}}};CollaborationController=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,Inject(CollaborationSessionService)),__decorateParam(0x2,IConfigService),__decorateParam(0x3,IUniverInstanceService)],CollaborationController);var name=_0x584c31(0x126),version=_0x584c31(0xe9);const DEFAULT_FILE_NAME_KEY=_0x584c31(0x1a9),UNIVER_DEFAULT_FILE_NAME='Univer';let FileNameController=class FileNameController extends Disposable{constructor(_0x6fdc7d,_0x5529c7){const _0x5462d8=_0x584c31;super(),this[_0x5462d8(0xc5)]=_0x6fdc7d,this['_configService']=_0x5529c7,this[_0x5462d8(0x15b)]();}[_0x584c31(0x15b)](){const _0x597009=_0x584c31;this[_0x597009(0x103)](this[_0x597009(0xc5)][_0x597009(0x285)][_0x597009(0xd2)](()=>{const _0x445d32=_0x597009;var _0x102313;const _0x5f40db=this[_0x445d32(0xc5)][_0x445d32(0x29e)]();let _0x1a4a0f=(_0x102313=this[_0x445d32(0x295)][_0x445d32(0x1cc)](_0x445d32(0x1a9)))!==null&&_0x102313!==void 0x0?_0x102313:UNIVER_DEFAULT_FILE_NAME;if(_0x5f40db instanceof Workbook)_0x1a4a0f=_0x5f40db[_0x445d32(0x18d)];document[_0x445d32(0x23d)]=_0x1a4a0f;}));}};FileNameController=__decorate([__decorateParam(0x0,IUniverInstanceService),__decorateParam(0x1,IConfigService)],FileNameController);let AuthServerService=class AuthServerService{constructor(_0x3605ae,_0x20ad61,_0x26b380){const _0x445b74=_0x584c31;this[_0x445b74(0x295)]=_0x3605ae,this[_0x445b74(0xe0)]=_0x20ad61,this[_0x445b74(0x152)]=_0x26b380,this['init']();}['init'](){const _0x24ac18=_0x584c31;this[_0x24ac18(0xe0)][_0x24ac18(0x251)]({'priority':0x1,'interceptor':(_0x5ea24d,_0x3f2b4e)=>{return _0x3f2b4e(_0x5ea24d)['pipe'](concatMap(async _0x21767c=>{const _0x474bd8=_0x9779,_0x11bbca=_0x21767c;if(_0x11bbca['status']===0x191){if(typeof window===_0x474bd8(0x199))throw new Error(_0x474bd8(0x252));if(window[_0x474bd8(0x2a6)](this[_0x474bd8(0x152)]['t'](_0x474bd8(0x14b)))){const _0x261280=window[_0x474bd8(0x243)](window[_0x474bd8(0xde)][_0x474bd8(0x31a)]);window[_0x474bd8(0xde)][_0x474bd8(0x31a)]=this[_0x474bd8(0x1f9)]()+'?url='+_0x261280;}}return _0x11bbca;}));}});}[_0x584c31(0x1f9)](){const _0x3246af=_0x584c31;var _0x353108;const _0x37a421=this['_configService'][_0x3246af(0x1cc)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x353108=_0x37a421===null||_0x37a421===void 0x0?void 0x0:_0x37a421['loginUrlKey'])!==null&&_0x353108!==void 0x0?_0x353108:DEFAULT_LOGIN_URL;}};AuthServerService=__decorate([__decorateParam(0x0,IConfigService),__decorateParam(0x1,Inject(HTTPService)),__decorateParam(0x2,Inject(LocaleService))],AuthServerService);const DEFAULT_AUTHZ_URL_KEY$1=_0x584c31(0x1db);let AuthzIoHttpService=class AuthzIoHttpService extends Disposable{constructor(_0x4300d8,_0x531208){const _0x1713ae=_0x584c31;super(),this[_0x1713ae(0x1d1)]=_0x4300d8,this[_0x1713ae(0x295)]=_0x531208,_defineProperty(this,_0x1713ae(0x225),![]),this[_0x1713ae(0x27b)]();}[_0x584c31(0x27b)](){const _0x132422=_0x584c31,_0x5017e7=this;this[_0x132422(0x103)](this['_HTTPService'][_0x132422(0x251)]({'priority':0x3e7,'interceptor':MergeInterceptorFactory({'isMatch'(_0x431083){const _0x252b58=_0x132422;var _0x3d5816;if(_0x431083[_0x252b58(0x244)]===_0x252b58(0x11a)&&((_0x3d5816=_0x431083[_0x252b58(0x24f)])===null||_0x3d5816===void 0x0?void 0x0:_0x3d5816[_0x252b58(0x10e)])){const {objectID:_0x5ddfc5,objectType:_0x5acd19}=_0x431083[_0x252b58(0x24f)][_0x252b58(0x10e)]||{};if(!_0x5ddfc5||_0x5acd19===void 0x0)return![];const _0x5c8380=_0x5017e7[_0x252b58(0x100)]()+'/'+_0x5acd19+'/object/'+_0x5ddfc5+'/allowed';if(_0x431083[_0x252b58(0x315)]===_0x5c8380)return!![];}return![];},'getParamsFromRequest'(_0x1d4776){const _0x5961ce=_0x132422;var _0x236bbd;return(_0x236bbd=_0x1d4776[_0x5961ce(0x24f)])===null||_0x236bbd===void 0x0?void 0x0:_0x236bbd[_0x5961ce(0x10e)];},'mergeParamsToRequest'(_0x3e7f67,_0x15d12a){const _0x320ae6=_0x132422,_0x36da22=_0x5017e7[_0x320ae6(0x100)]()+'/-/object/-/batch_allowed',_0x212091=_0x3e7f67[_0x320ae6(0xcb)]((_0x2c8aff,_0x784e3e)=>{const _0x2d18ed=_0x320ae6,{unitID:_0x54e1e3,objectID:_0xca8819,objectType:_0x141ccf,actions:_0xdb5a63}=_0x784e3e;if(!_0x2c8aff[_0x54e1e3])_0x2c8aff[_0x54e1e3]={};if(!_0x2c8aff[_0x54e1e3][_0xca8819])_0x2c8aff[_0x54e1e3][_0xca8819]={'objectID':_0xca8819,'objectType':_0x141ccf,'actions':[]};return _0x2c8aff[_0x54e1e3][_0xca8819]['actions'][_0x2d18ed(0x125)](..._0xdb5a63),_0x2c8aff;},{}),_0x5985fe=[];for(const _0x14c04b in _0x212091)for(const _0x340c10 in _0x212091[_0x14c04b]){const {actions:_0x55f1d8,objectType:_0x477dda}=_0x212091[_0x14c04b][_0x340c10],_0x1b1237=[...new Set(_0x55f1d8)];_0x5985fe[_0x320ae6(0x125)]({'unitID':_0x14c04b,'objectID':_0x340c10,'objectType':_0x477dda,'actions':_0x1b1237});}return new HTTPRequest(_0x320ae6(0x11a),_0x36da22,{'headers':_0x15d12a[_0x320ae6(0x216)],'withCredentials':_0x15d12a['withCredentials'],'responseType':_0x15d12a['responseType'],'body':{'requests':_0x5985fe}});}},{'distributeResult'(_0x253c2b,_0x5148ff){const {objectActions:_0xd7cc2f}=_0x253c2b;return _0x5148ff['map'](_0x487eea=>{const _0x209f34=_0x9779,{unitID:_0x3fed1c,objectID:_0xe55e86,actions:_0xd25a0}=_0x487eea,_0x586833=_0xd7cc2f[_0x209f34(0x1e7)](_0x27df51=>_0x27df51[_0x209f34(0x158)]===_0x3fed1c&&_0x27df51[_0x209f34(0x120)]===_0xe55e86);return{'config':_0x487eea,'result':{'actions':_0xd25a0[_0x209f34(0x19e)](_0x3329c2=>_0x586833===null||_0x586833===void 0x0?void 0x0:_0x586833['actions'][_0x209f34(0x1e7)](_0x37df48=>_0x37df48[_0x209f34(0xd1)]===_0x3329c2))[_0x209f34(0x167)](_0x4503a7=>!!_0x4503a7),'error':_0x253c2b['error']}};});}})}));}[_0x584c31(0x100)](){const _0x58e73=_0x584c31;var _0x3a03e8;const _0x186d86=this['_configService']['getConfig'](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x3a03e8=_0x186d86===null||_0x186d86===void 0x0?void 0x0:_0x186d86[_0x58e73(0x130)])!==null&&_0x3a03e8!==void 0x0?_0x3a03e8:DEFAULT_AUTHZ_URL_KEY$1;}async[_0x584c31(0x26a)](_0xc5b4c8){const _0x5a838b=_0x584c31,_0x448a98=this[_0x5a838b(0x100)]()+'/'+_0xc5b4c8[_0x5a838b(0x29f)]+_0x5a838b(0x10d);return(await this[_0x5a838b(0x1d1)][_0x5a838b(0x1f7)](_0x448a98,{'body':_0xc5b4c8}))[_0x5a838b(0x10e)][_0x5a838b(0x120)]||'';}async[_0x584c31(0x270)](_0xdb962b){const _0x5b01f4=_0x584c31,_0x17c5e2=this['_getAPIPrefixPath']()+_0x5b01f4(0x308);return(await this[_0x5b01f4(0x1d1)][_0x5b01f4(0x1f7)](_0x17c5e2,{'body':_0xdb962b}))['body'][_0x5b01f4(0x25b)];}async[_0x584c31(0x129)](_0x5f2d5e){const _0x41de09=_0x584c31;var _0x10900b;const _0x5efb4a=this['_getAPIPrefixPath']()+'/'+_0x5f2d5e[_0x41de09(0x29f)]+_0x41de09(0x2a4)+_0x5f2d5e[_0x41de09(0x120)],_0x3e7fcc=await this['_HTTPService']['put'](_0x5efb4a,{'body':_0x5f2d5e});if((_0x3e7fcc===null||_0x3e7fcc===void 0x0||(_0x10900b=_0x3e7fcc['body'])===null||_0x10900b===void 0x0||(_0x10900b=_0x10900b[_0x41de09(0xed)])===null||_0x10900b===void 0x0?void 0x0:_0x10900b['code'])!==0x1)throw new Error(_0x41de09(0x1c2));}async[_0x584c31(0x1d5)](_0x426a15){const _0x40c592=_0x584c31,_0x2913c2=this[_0x40c592(0x100)]()+'/'+_0x426a15['objectType']+_0x40c592(0x2a4)+_0x426a15[_0x40c592(0x120)]+_0x40c592(0x136);return(await this[_0x40c592(0x1d1)]['post'](_0x2913c2,{'body':_0x426a15}))[_0x40c592(0x10e)]['actions'];}async['batchAllowed'](_0x4880b0){const _0x51680b=_0x584c31,_0x18ed54=this[_0x51680b(0x100)]()+_0x51680b(0x267);return(await this[_0x51680b(0x1d1)][_0x51680b(0x1f7)](_0x18ed54,{'body':{'requests':_0x4880b0}}))[_0x51680b(0x10e)]['objectActions'];}async['listRoles'](_0xeb13ed){const _0x49822e=_0x584c31,_0x518db2=this[_0x49822e(0x100)]()+'/'+_0xeb13ed[_0x49822e(0x29f)]+'/role',_0x179df0=await this[_0x49822e(0x1d1)][_0x49822e(0x1f7)](_0x518db2,{'body':_0xeb13ed});return{'roles':_0x179df0['body'][_0x49822e(0x2f9)],'actions':_0x179df0[_0x49822e(0x10e)]['actions']};}async['deleteCollaborator'](_0x3ce96c){const _0x158943=_0x584c31,_0x2c701d=this['_getAPIPrefixPath']()+'/collaborator';await this['_HTTPService']['delete'](_0x2c701d,{'params':{'collaboratorID':_0x3ce96c['collaboratorID'],'objectID':_0x3ce96c['objectID'],'unitID':_0x3ce96c[_0x158943(0x158)]}});}async[_0x584c31(0x19d)](_0x4b9b34){const _0x2d6684=_0x584c31,_0x412d9b=this[_0x2d6684(0x100)]()+'/collaborator';await this[_0x2d6684(0x1d1)][_0x2d6684(0x15f)](_0x412d9b,{'body':_0x4b9b34});}async[_0x584c31(0x140)](_0x1656e9){const _0x9d8cda=_0x584c31,_0x594334=this['_getAPIPrefixPath']()+_0x9d8cda(0x239);await this[_0x9d8cda(0x1d1)][_0x9d8cda(0x1f7)](_0x594334,{'body':_0x1656e9});}async[_0x584c31(0x294)](_0x4b7698){const _0x33a87a=_0x584c31;var _0xec8f78;const _0x1b96a4=this[_0x33a87a(0x100)]()+'/collaborator',_0x32b01b=await this[_0x33a87a(0x1d1)][_0x33a87a(0x1ea)](_0x1b96a4,{'params':{'objectID':_0x4b7698[_0x33a87a(0x120)],'unitID':_0x4b7698[_0x33a87a(0x158)]}});return this['setCfgEnableObjInherit']((_0xec8f78=_0x32b01b[_0x33a87a(0x10e)][_0x33a87a(0x2d9)])!==null&&_0xec8f78!==void 0x0?_0xec8f78:![]),_0x32b01b[_0x33a87a(0x10e)][_0x33a87a(0x312)];}async[_0x584c31(0x12f)](_0x4c6e92){const _0x228915=_0x584c31,_0x5b22c4=this[_0x228915(0x100)]()+_0x228915(0x239);await this[_0x228915(0x1d1)][_0x228915(0x13f)](_0x5b22c4,{'body':_0x4c6e92});}[_0x584c31(0x306)](_0x21d281){const _0x5c840f=_0x584c31;this[_0x5c840f(0x225)]=_0x21d281;}['getCfgEnableObjInherit'](){const _0x24266f=_0x584c31;return this[_0x24266f(0x225)];}};AuthzIoHttpService=__decorate([__decorateParam(0x0,Inject(HTTPService)),__decorateParam(0x1,Inject(IConfigService))],AuthzIoHttpService);function base64ToBytes(_0x5c1657){const _0x34b921=_0x584c31,_0x580847=atob(_0x5c1657),_0x4506ac=new Uint8Array(_0x580847[_0x34b921(0x2f6)]);for(let _0x719784=0x0;_0x719784<_0x580847[_0x34b921(0x2f6)];_0x719784++)_0x4506ac[_0x719784]=_0x580847['charCodeAt'](_0x719784);return _0x4506ac;}function bytesToBase64(_0xc479ab){const _0x359708=_0x584c31;let _0x28d2d3='';for(let _0x3f4079=0x0;_0x3f4079<_0xc479ab[_0x359708(0x2f6)];_0x3f4079++)_0x28d2d3+=String['fromCharCode'](_0xc479ab[_0x3f4079]);return btoa(_0x28d2d3);}function encrypt(_0x550be6,_0x3cbdba){const _0x4f4cdd=_0x584c31,_0x2ba40c=base64ToBytes(_0x3cbdba),_0x5b6909=randomBytes(0x10);return bytesToBase64(concatBytes(_0x5b6909,cbc(_0x2ba40c,_0x5b6909)[_0x4f4cdd(0x138)](utf8ToBytes(_0x550be6))));}function getAttachHeader(){const _0x515967=_0x584c31,_0x4cba09=getGlobalObject()[_0x515967(0x1c5)];if(typeof window!=='undefined'&&typeof window[_0x515967(0xde)]!=='undefined'&&_0x4cba09){const _0x569ce2={'time':Math[_0x515967(0x2a8)](Date[_0x515967(0xf2)]()/0x3e8),'domain':location[_0x515967(0x1d2)]};return encrypt(JSON[_0x515967(0x1f5)](_0x569ce2),_0x4cba09);}}let DomainRequestService=class DomainRequestService{constructor(_0x50bc07){const _0x393494=_0x584c31;this[_0x393494(0xe0)]=_0x50bc07,this['_initRequestHeader']();}[_0x584c31(0x29a)](){const _0x254aad=_0x584c31;this[_0x254aad(0xe0)]['registerHTTPInterceptor']({'interceptor':(_0x39f22f,_0x26068d)=>{const _0x3268c0=_0x254aad,_0x12d161=getAttachHeader();if(_0x12d161)_0x39f22f[_0x3268c0(0x216)][_0x3268c0(0x1ec)](_0x3268c0(0x246),_0x12d161);return _0x26068d(_0x39f22f);}});}};DomainRequestService=__decorate([__decorateParam(0x0,Inject(HTTPService))],DomainRequestService);let DataLoaderService=class DataLoaderService extends RxDisposable{constructor(_0x55ea9c,_0x4c28d5,_0x356f77){const _0x5a41c6=_0x584c31;super(),this[_0x5a41c6(0x22b)]=_0x55ea9c,this[_0x5a41c6(0x146)]=_0x4c28d5,this['_localCacheService']=_0x356f77,_defineProperty(this,_0x5a41c6(0x20a),new BehaviorSubject(null)),_defineProperty(this,_0x5a41c6(0x1f6),this[_0x5a41c6(0x20a)][_0x5a41c6(0x2be)]());}async[_0x584c31(0x25a)](_0x5554c7,_0x53910b,_0xbe46c5){const _0x2bc9e1=_0x584c31;this[_0x2bc9e1(0x20a)][_0x2bc9e1(0x303)]({'unitId':_0x5554c7,'type':_0x53910b});let _0x2cec68=null;switch(_0x53910b){case UniverInstanceType[_0x2bc9e1(0x131)]:_0x2cec68=await this[_0x2bc9e1(0x146)][_0x2bc9e1(0xf1)](_0x5554c7,_0xbe46c5);break;case UniverInstanceType[_0x2bc9e1(0x264)]:_0x2cec68=await this[_0x2bc9e1(0x146)][_0x2bc9e1(0xfb)](_0x5554c7,_0xbe46c5);break;default:this[_0x2bc9e1(0x22b)][_0x2bc9e1(0xed)](_0x2bc9e1(0x223),_0x2bc9e1(0x26b));break;}return _0x2cec68;}async[_0x584c31(0xc9)](_0x5544c7,_0xb0755a,_0x3588cc){const _0x1f9ff9=_0x584c31;var _0x201ce5;this[_0x1f9ff9(0x20a)][_0x1f9ff9(0x303)]({'unitId':_0x5544c7,'type':_0xb0755a,'subUnitId':_0x3588cc});let _0x5e9131=0x0;const _0x1c778e=await((_0x201ce5=this[_0x1f9ff9(0x1d4)])===null||_0x201ce5===void 0x0?void 0x0:_0x201ce5[_0x1f9ff9(0x182)](_0x5544c7));if(_0x1c778e&&(_0x1c778e['awaitingChangeset']||_0x1c778e[_0x1f9ff9(0x2bb)]['length']!==0x0))_0x5e9131=_0x1c778e[_0x1f9ff9(0x1da)];if(_0x5e9131===0x0)this['_logService'][_0x1f9ff9(0x2e7)](_0x1f9ff9(0x223),_0x1f9ff9(0x15c));return this['loadUnitOfRevision'](_0x5544c7,_0xb0755a,_0x5e9131);}};DataLoaderService=__decorate([__decorateParam(0x0,ILogService),__decorateParam(0x1,Inject(SnapshotService)),__decorateParam(0x2,Optional(ILocalCacheService))],DataLoaderService);const ALLOW_IMAGE_LIST=[_0x584c31(0x27e),_0x584c31(0xf3),'image/jpg',_0x584c31(0x2d1),_0x584c31(0xdc)],ALLOW_IMAGE_SIZE=0x5*0x400*0x400,DEFAULT_EXCHANGE_UPLOAD_FILE_SERVER_URL_KEY=_0x584c31(0x1e1),DEFAULT_EXCHANGE_SIGN_URL_SERVER_URL_KEY=_0x584c31(0x20d);function _0x4574(){const _0x58589a=['_acknowledgedAwaitingChangeset','_imageSourceCache','_onUserLeave','_createInitialState','_registerDependencies','unknown','forEach','_telemetryService','_onRemoteRejected','unsubscribe','DEFAULT_FILE_NAME','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','[UniverCollaborationClientPlugin]','[SyncedState]:\x20invalid\x20calling\x20to\x20`resend`.','offline','_injector','_lockTransition','avatar','COMPRESS_MUTATION_APPLY','onRemoteRej','_collaborationTimeoutTimer','_showConflictNotification','_telemetryInfo','state$','capture','_resendWithTimeout','sheets','appendMutation','Cannot\x20assemble\x20a\x20changeset\x20from\x20multiple\x20mutations\x20of\x20different\x20types:\x20','open$','min','JOIN_ROOM_FULL','_doCreateSocket','collaboration-client.config','parse','Failed\x20to\x20update\x20permission\x20point','onTransformRemoteChangesetByStateCache','originalMeta','__Key__','_commentUpdate$','_changesetReqId','_applyRemoteChangeset','{fileID}','_clearRetryConnectingTimer','toggleOffline','getConfig','SYNCED','getTypeOfUnitDisposed$','sessionStatus','_undoStacks','_HTTPService','hostname','object','_localCacheService','allowed','uniscriptRunEvent','unitId','LIVESHARE_OPERATION','updateSnapshot','rev','/universer-api/authz','toString','transformSelections','&assign=','_clearScheduledTask','UnitEmbedded','/universer-api/stream/file/upload','session.room-full','version','toggleOnline','prototype','_compressMutationService','find','_tryEnsureSocket','[ConflictState]:\x20invalid\x20calling\x20to\x20`resend`.','get','_socket','set','JOIN','splice','constructor','_transformIMECache','OTHER_CLIENTS_EDITING','startsWith','status$','MUTATION','stringify','unitInfo$','post','\x0aAfter:\x20','_getLoginPath','[OfflineState]:\x20received\x20acknowledgement.','_event$','function','_config','PERMISSION_DENIED','dispose','_collaborationPaused','error$','getTypeOfUnitAdded$','ERROR_IMAGE','_resendTimeout','_state$','UNIVER_COLLABORATION_CLIENT_PLUGIN','fetchMissingChangesets','_collabSessionService','RECV','_unitInfo$','_handler','_remoteChangesetQueue','/universer-api/file/{fileID}/sign-url','_getUndoStack','USERS_LEAVE','COMMENT_UPDATE','getCollabEntity','_toggleOffline','setShowComponents','clear','c2Prime','headers','[CollaborationSessionService]','_getRedoStack','_startTelemetryCollaborationNewChangeset','getTime','_collaborationUIEventService','_onConnectionOpen','\x0aCurrent:\x20','getSnapshotAPIPath','target','_listenToNetworkCondition','_roomCreated$','entityInit$','[DataLoaderService]','_maxTotalRetryTimeout','_cfgEnableObjInherit','People','_waitCount','SOCKET_FAILED','univer-pro.collaboration-client.network-condition.service','118614eoJOZc','_logService','_transformUndoredo','m2Prime','OTHER_CLIENT_EDITING','[UniverCollaborationClientPlugin]:\x20you\x20must\x20provide\x20a\x20socketService\x20implementation\x20in\x20config!','_sendHeartbeat','[CollaborationController]:\x20invalid\x20univer\x20type:\x20','you\x20should\x20override\x20\x22IUndoRedoService\x22\x20provided\x20in\x20\x22core\x22\x20package!','LIVESHARE_TERMINATE','setWaitCount','entries','compose','updateCursorEvent','symbol','/collaborator','_clearLocalCache','csShouldRetryEvent','csRejEvent','title','call','_eventService','getActiveSheet','send','_clearRedo','encodeURIComponent','method','baseRev','x-univer-host','[PendingState]:\x20received\x20acknowledgement.','_handlerCallback','[CollaborationEntity]:\x20cannot\x20apply\x20missing\x20results\x20on\x20other\x20states!','LEAVE','interceptor','_userManagerService','decorate','fetching\x20missing\x20changesets\x20from\x20','requestParams','_commentService','registerHTTPInterceptor','[AuthServerService]:\x20you\x20should\x20provide\x20authentication\x20info\x20on\x20Node.js.','readAsDataURL','2821168VxpHld','INGEST','isPermissionRej','eventID','_members$','onRemoteRetry','loadUnitOfRevision','objects','collabWebSocketUrl','session.room-not-exists','[CollaborationEntity]','_substituteRedoStack','reverse','transformMutationsWithChangeset','_sendingTimer','[CollaborationSessionService]:\x20socket\x20error','UNIVER_DOC','_entityInit$','UPDATE_PERMISSION_OBJ','/-/object/-/batch_allowed','_incrementRevisionNumber','PSEUDO_FETCH_MISSING_RESULT','create','Unknown\x20type.\x20Will\x20not\x20load\x20files\x20from\x20remote\x20address.','_sender','_transformSelections','__splitChunk__','getUnitType','list','src','executeCommand','onSyncEditingCollabCursor','members$','delete','_getCtorByUniverInstanceType','_queuedRemoteChangesets','save\x20fail\x20reason\x20is\x20','onTransformRemoteChangesetByIMECache','textRanges','_initMergeInterceptor','_transformStack','[FetchingMissState]:\x20invalid\x20calling\x20to\x20`resend`.','image/png','_localeService','HEARTBEAT_TIMEOUT','isArray','encode','_scheduleCompleteTimestamp','state','focused$','UPDATE_CURSOR','snapshotServerUrl','PERSON','_transitionLocked','message$','close$','onMutationExecutedForCollab','session.room-cnt-exceeds','_transformStateCache','PENDING','_candidateSocket','getCollabEntity$','retryConnectingInterval','_joinRoom','listCollaborators','_configService','/universer-api/uniscript','initWorkbookPermissionChange','8mGVGvu','[PendingState]:\x20received\x20rejection.','_initRequestHeader','[CollaborationUndoRedoService]','_toggleOnline','_onOffline','getFocusedUnit','objectType','_decreaseWaiting','_undoRedoService','socket$','FileId','/object/','_sendHeartbeatTimer','confirm','data','floor','actions','onCommentUpdate','replace','routeKey','_sessionStatus$','saveChangeset','[CollaborationSession]:\x20should\x20not\x20send\x20message\x20when\x20the\x20session\x20is\x20offline!','stopTime','COMPRESS_MUTATION_SEND','session.join-failed','180EPgJiZ','_onRemoteChangeset','PERMISSION_REJ','AWAITING','fetchMiss','_commandService','_throwTelemetryCollaborationNewChangeset','resend','mutations','_onMessage','SUBMIT_CHANGESET','asObservable','connection\x20error','[serializeCombRequest]:\x20should\x20not\x20fall\x20into\x20default\x20branch!','SOCKET_FAILED_RETRY','/universer-api/snapshot','then','FETCH_MISS','awaiting','_schedule','toPrimitive','event$','_updateStatus','[FetchingMissState]:\x20not\x20expected\x20to\x20receive\x20ack\x20when\x20`this._awaitingChangeset`\x20is\x20null!','pipe','MSG_FOR_ERROR','CHANGESET_SHOULD_RETRY','awaiting_with_pending','_initDependencies','editingUnit','image/gif','CHANGESET_ACK','updatePermissionPoint','cmd','_exhaustRemoteChangesetQueue','CLOSE_ROOM','_clearUndo','/universer-api/oidc/authpage','cfgEnableObjInherit','_onConnectionFailed','getUnitId','_getSignURL','_initUnitPermissionChange','params','_resendTimer','getCurrentRevOfUnit','_scheduleCollaborationTimeoutTimer','_createHandler','/rev/','USERS_ENTER','add','HEARTBEAT_INTERVAL','debug','onTransformRemoteChangesetByIMECache\x20callback\x20is\x20not\x20added\x20yet.','_isPermissionRej','[OfflineState]:\x20received\x20changeset.','_replayCachedMutations','ws://127.0.0.1:8000/universer-api/comb/connect','_clearHeartbeatTimer','/unit/','socket\x20close','init','downloadEndpointUrl','not_collab','NO_OTHER_CLIENTS_EDITING','_substituteUndoStack','_awaitingChangeset','length','waitForRoom$','equals','roles','_singleActiveUnitService','override','[CollaborationEntity]:\x20initial\x20state\x20has\x20been\x20created\x20before.\x20You\x20should\x20not\x20call\x20\x22init\x22\x20twice.','NEW_CHANGESETS','This\x20method\x20should\x20not\x20be\x20called\x20on\x20the\x20client\x20side!','updateMember','1684170DMEYtg','[CollaborationSocketService]:\x20failed\x20to\x20get\x20web\x20socket\x20factory!','_removeRoom','next','resolve','dispose$','setCfgEnableObjInherit','ONLINE','/-/object/list','_members','reqId','_unlockTransition','RETRY_CONNECTING_MAX_COUNT','onStarting','defineProperty','_timeoutTimer','HEARTBEAT','duration','collaborators','/block/','closeSession','url','setCurrentUser','_submitChangeset','_syncEditingCollabCursor','_snapshotServerService','href','_rescheduleHeartbeat','getUnitStatus$','_collaborationSessionService','_updateLocalCache','onMissingChangesets','_univerInstanceService','deepClone','865wBlJTe','_checkMissing','loadUnit','commentUpdateEvent','reduce','every','_stopTelemetryCollaborationNewChangeset','JOINING','liveShareNewHost','userID','action','subscribe','LOCAL_CACHE_INTERVAL','univer-pro.collaboration-client.single-active-unit-service','BASE64','_unitID','_executeRemoteChangeset','_instanceService','12224214cSmgyW','_socketService','sessionStatus$','image/bmp','_waitForHeartbeatResponse','location','REMOTE_UNISCRIPT_EXECUTION_ENDPOINT','_httpService','_initCloseConn','updateOfflineData','slice','_change$','copyFileMeta','_socketReady','transformUndoRedo','onTransformSelections','0.21.0','_memberService','fetchThroughInterceptors','onSendChangeset','error','collaboration_new_changeset','_onLocalMutation','/universer-api/snapshot/','loadSheet','now','image/jpeg','4660040JYjSvz','_networkConditionService','_onRemoteRetry','updatePermissionObjEvent','[CollaborationSession]','code','getValue','loadDoc','revision','size','_emitMembers','LIVESHARE_FETCH_OPERATIONS','_getAPIPrefixPath','[CollaborationSocketService]:\x20failed\x20to\x20create\x20socket!','_onRecvEvent','disposeWithMe','getCurrentUser','close','[SyncedState]:\x20received\x20acknowledgement.','_status$','IDLE','_sessions','LIVESHARE_REQUEST_HOST','transformChangesets','addImageSourceCache','/object','body','JOIN_ROOM_FAILED','fetch_missing','HELLO','_retryCount','onRemoteChangeset','_onUserJoin','_clearCollaborationTimeoutTimer','removeMember','result','AWAITING_WITH_PENDING','append','POST','online$','SHOULD_CLOSE_CONN','_getAPIPrefix','sendChangesetTimeout','[CollaborationState]:\x20apply\x20error!','objectID','SNAPSHOT_URL_KEY','UNISCRIPT_RUN','changesets','_socketMessageSubscription','push','@univerjs-pro/collaboration-client','_pendingMutations','_onConflict','update','207897uigaiS','onload','_disableEditing','_getCurrentRevision','sid','putCollaborators','authzUrl','UNIVER_SHEET','getMember','onTransformRemoteChangesetByStateCache\x20callback\x20is\x20not\x20added\x20yet.','session','fromCollab','/allowed','uploadFileServerUrl','encrypt','onTransformIME','complete','shouldCloseConn','_state','permissionRejEvent','failed\x20to\x20apply\x20missed\x20changesets!','put','createCollaborator','_clearTimeoutTimer','createInstance','c1Prime','socketService','getImageSourceCache','_snapshotService','/new_changes','createSocket','has','enableAuthServer','auth.needGotoLoginAlert','memberID','FETCH_MISSING','infoRsp','getMemberID','CONFLICT','_shouldReportTelemetry','localeService','_updateState','_onRemoteACK','_onJoinRoomEvent','_socket$','_transformRemoteChangesetByStateCache','unitID','_entities','addHandlerCallback','_init','fetching\x20the\x20latest\x20document\x20from\x20the\x20server.','OFFLINE','getSheetId','patch','_fetchMissChangesets','LIVESHARE_NEW_HOST','_type','&to=','onStateChange','selections','[FetchMissState]','filter','SUBMIT_CHANGESET_TIMEOUT','getInterceptPoints','onMissedChangesetFetched','_redoStacks','localCacheService','type','workbook','_getUploadFileURL','[PendingState]:\x20unhandled\x20univer\x20type:\x20','_startCollaboration','_replaceFileID','refreshPermission','_sheetTransformSelectionsService','newCsEvent','socket\x20open.','_getSendChangesetTimeout','getCurrentSelections','members','_createSocket','range','liveShareOperation','string','JOIN_ROOM_NOT_EXISTS','iterator','requireSession','/universer-api/user/session-ticket','loadOfflineData','origin','roomInfos','_retryConnectingTimer','subject','_changesetSessionId','\x20-\x20','onRemoteAck','GLOBAL_ROOMS_CNT_EXCEEDS','collaboration-client.local-cache-service','_revisionService','name','_roomMembers','getLatestCsReqIdBySid','_tryReconnect','onTransformState','saveSheetBlock','values','commentUpdate$','_permissionService','status','synced','_transformService','undefined','file','reject','emitEvent','updateCollaborator','map'];_0x4574=function(){return _0x58589a;};return _0x4574();}let CollaborationImageIoService=class CollaborationImageIoService{constructor(_0x329f86,_0x2f7756,_0x3a68a3){const _0x47703b=_0x584c31;this['_httpService']=_0x329f86,this[_0x47703b(0x295)]=_0x2f7756,this[_0x47703b(0xc5)]=_0x3a68a3,_defineProperty(this,_0x47703b(0x227),0x0),_defineProperty(this,'_change$',new Subject()),_defineProperty(this,'change$',this[_0x47703b(0xe4)]),_defineProperty(this,_0x47703b(0x1a0),new Map());}[_0x584c31(0x234)](_0x2ad9ba){const _0x4c4f3c=_0x584c31;this['_waitCount']=_0x2ad9ba,this[_0x4c4f3c(0xe4)]['next'](_0x2ad9ba);}[_0x584c31(0x145)](_0x4ddc1d,_0x2cc0fe){const _0x5d8fc2=_0x584c31;if(_0x2cc0fe===ImageSourceType['BASE64']){const _0xeb3c96=new Image();return _0xeb3c96[_0x5d8fc2(0x271)]=_0x4ddc1d,_0xeb3c96;}return this[_0x5d8fc2(0x1a0)][_0x5d8fc2(0x1ea)](_0x4ddc1d);}[_0x584c31(0x10c)](_0x2a1e9c,_0x45aadb,_0x556c59){const _0xf88925=_0x584c31;if(_0x45aadb===ImageSourceType[_0xf88925(0xd5)]||_0x556c59==null)return;this[_0xf88925(0x1a0)][_0xf88925(0x1ec)](_0x2a1e9c,_0x556c59);}async['getImage'](_0xee96d8){const _0x3acee1=_0x584c31;try{const _0x4b3c73=this['_replaceFileID'](this[_0x3acee1(0x2dc)](),''+_0xee96d8),_0x463c4d=(await this[_0x3acee1(0xe0)][_0x3acee1(0x1ea)](_0x4b3c73))[_0x3acee1(0x10e)];if(_0x463c4d[_0x3acee1(0xed)]&&_0x463c4d[_0x3acee1(0xed)][_0x3acee1(0xf9)]===ErrorCode['OK']){const _0x11eb14=resolveWithBasePath(_0x463c4d[_0x3acee1(0x315)],this['_getDownloadEndpointURL']());return Promise[_0x3acee1(0x304)](_0x11eb14);}return Promise['reject'](_0x463c4d['error']);}catch(_0x1243b6){return Promise[_0x3acee1(0x19b)](_0x1243b6);}}async['saveImage'](_0x59eebf){const _0x42accc=_0x584c31;let _0x5c4fc4='';if(!ALLOW_IMAGE_LIST['includes'](_0x59eebf[_0x42accc(0x16d)]))return this[_0x42accc(0x2a0)](),Promise[_0x42accc(0x19b)](new Error(ImageUploadStatusType['ERROR_IMAGE_TYPE']));if(_0x59eebf[_0x42accc(0xfd)]>ALLOW_IMAGE_SIZE)return this[_0x42accc(0x2a0)](),Promise[_0x42accc(0x19b)](new Error(ImageUploadStatusType['ERROR_EXCEED_SIZE']));try{const _0x42463c=new FormData();_0x42463c[_0x42accc(0x119)](_0x42accc(0x19a),_0x59eebf);const _0x5b9aff=this[_0x42accc(0xc5)]['getFocusedUnit'](),_0x2cebeb=_0x5b9aff===null||_0x5b9aff===void 0x0?void 0x0:_0x5b9aff[_0x42accc(0x2db)]();if(!_0x2cebeb)throw new Error('unitId\x20is\x20not\x20found');const _0x8cbea5=this[_0x42accc(0x16f)]()+'?size='+_0x59eebf[_0x42accc(0xfd)][_0x42accc(0x1dc)]()+'&source='+FileSource[_0x42accc(0x1e0)]+_0x42accc(0x1de)+encodeURIComponent(_0x2cebeb),_0xcb0eda={'body':_0x42463c},_0x5371d6=(await this[_0x42accc(0xe0)]['post'](_0x8cbea5,_0xcb0eda))['body'];if(typeof _0x5371d6[_0x42accc(0x2a3)]!==_0x42accc(0x17d))return this['_decreaseWaiting'](),Promise['reject'](new Error(ImageUploadStatusType[_0x42accc(0x203)]));_0x5c4fc4=_0x5371d6['FileId'];}catch(_0x3b3353){return this[_0x42accc(0x2a0)](),Promise[_0x42accc(0x19b)](new Error(ImageUploadStatusType['ERROR_IMAGE']));}return new Promise((_0x18df94,_0x38dc24)=>{const _0x2a106d=_0x42accc,_0x3b2956=new FileReader();_0x3b2956[_0x2a106d(0x253)](_0x59eebf),_0x3b2956[_0x2a106d(0x12b)]=_0x20c569=>{const _0xf1c7c7=_0x2a106d;var _0x1a106f;const _0x264b31=(_0x1a106f=_0x20c569[_0xf1c7c7(0x21f)])===null||_0x1a106f===void 0x0?void 0x0:_0x1a106f['result'];if(_0x264b31==null){this[_0xf1c7c7(0x2a0)](),_0x38dc24(new Error(ImageUploadStatusType[_0xf1c7c7(0x203)]));return;}_0x18df94({'imageId':generateRandomId(0x6),'imageSourceType':ImageSourceType['UUID'],'source':_0x5c4fc4,'base64Cache':_0x264b31,'status':ImageUploadStatusType['SUCCUSS']}),this['_decreaseWaiting']();};});}[_0x584c31(0x16f)](){const _0x4e896b=_0x584c31;var _0x15fb78;const _0x1bd35e=this[_0x4e896b(0x295)]['getConfig'](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x15fb78=_0x1bd35e===null||_0x1bd35e===void 0x0?void 0x0:_0x1bd35e[_0x4e896b(0x137)])!==null&&_0x15fb78!==void 0x0?_0x15fb78:DEFAULT_EXCHANGE_UPLOAD_FILE_SERVER_URL_KEY;}[_0x584c31(0x2dc)](){var _0x4d91ab;const _0x169e3c=this['_configService']['getConfig'](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x4d91ab=_0x169e3c===null||_0x169e3c===void 0x0?void 0x0:_0x169e3c['signUrlServerUrl'])!==null&&_0x4d91ab!==void 0x0?_0x4d91ab:DEFAULT_EXCHANGE_SIGN_URL_SERVER_URL_KEY;}['_getDownloadEndpointURL'](){const _0x5e5276=_0x584c31;var _0xea1e93;const _0xfb63dc=this[_0x5e5276(0x295)][_0x5e5276(0x1cc)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0xea1e93=_0xfb63dc===null||_0xfb63dc===void 0x0?void 0x0:_0xfb63dc[_0x5e5276(0x2f1)])!==null&&_0xea1e93!==void 0x0?_0xea1e93:location[_0x5e5276(0x183)];}[_0x584c31(0x172)](_0x4fe3a9,_0x53a7ad){const _0x3cd3f7=_0x584c31;return _0x4fe3a9[_0x3cd3f7(0x2ab)](_0x3cd3f7(0x1c9),_0x53a7ad);}[_0x584c31(0x2a0)](){const _0x4460ed=_0x584c31;this[_0x4460ed(0x227)]-=0x1,this['_change$'][_0x4460ed(0x303)](this[_0x4460ed(0x227)]);}};CollaborationImageIoService=__decorate([__decorateParam(0x0,Inject(HTTPService)),__decorateParam(0x1,IConfigService),__decorateParam(0x2,Inject(IUniverInstanceService))],CollaborationImageIoService);const DEFAULT_AUTHZ_URL_KEY=_0x584c31(0x1db);let MentionIoHttpService=class MentionIoHttpService{constructor(_0x498d74,_0x3256ad){const _0x47a38a=_0x584c31;this[_0x47a38a(0x295)]=_0x498d74,this['_HTTPService']=_0x3256ad;}[_0x584c31(0x100)](){const _0xc6ca8a=_0x584c31;var _0x5e44dc;const _0x507588=this[_0xc6ca8a(0x295)][_0xc6ca8a(0x1cc)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x5e44dc=_0x507588===null||_0x507588===void 0x0?void 0x0:_0x507588[_0xc6ca8a(0x130)])!==null&&_0x5e44dc!==void 0x0?_0x5e44dc:DEFAULT_AUTHZ_URL_KEY;}async['list'](_0x54554c){const _0x3a7ae7=_0x584c31,_0x392595=this[_0x3a7ae7(0x100)]()+'/collaborator';return{'list':[{'title':_0x3a7ae7(0x226),'mentions':(await this['_HTTPService'][_0x3a7ae7(0x1ea)](_0x392595,{'params':{'objectID':_0x54554c[_0x3a7ae7(0x1d7)],'unitID':_0x54554c[_0x3a7ae7(0x1d7)]}}))[_0x3a7ae7(0x10e)]['collaborators']['map'](_0x4c5963=>({'objectId':_0x4c5963['id'],'name':_0x4c5963[_0x3a7ae7(0x186)][_0x3a7ae7(0x18d)],'metadata':{'icon':_0x4c5963['subject'][_0x3a7ae7(0x1b0)]},'label':_0x4c5963[_0x3a7ae7(0x186)][_0x3a7ae7(0x18d)],'objectType':MentionType[_0x3a7ae7(0x288)]})),'metadata':{},'type':MentionType[_0x3a7ae7(0x288)]}]};}};MentionIoHttpService=__decorate([__decorateParam(0x0,Inject(IConfigService)),__decorateParam(0x1,Inject(HTTPService))],MentionIoHttpService);let PermissionService=class PermissionService extends RxDisposable{constructor(_0x5d5872,_0x14a6b2,_0x115cce,_0x89168e,_0x470505){const _0xf9dacb=_0x584c31;super(),this[_0xf9dacb(0x1ae)]=_0x5d5872,this[_0xf9dacb(0xc5)]=_0x14a6b2,this[_0xf9dacb(0x195)]=_0x115cce,this[_0xf9dacb(0x31d)]=_0x89168e,this[_0xf9dacb(0x21b)]=_0x470505,this[_0xf9dacb(0x2dd)](),this[_0xf9dacb(0xe1)]();}['_initCloseConn'](){const _0x53531d=_0x584c31,_0x509d4c=async _0x18a44f=>{const _0x3326a1=_0x9779;(await this[_0x3326a1(0x31d)][_0x3326a1(0x180)](_0x18a44f))[_0x3326a1(0x2c8)][_0x3326a1(0x2cb)](filter(_0x37de4a=>_0x37de4a['eventID']===CollaborationEvent['SHOULD_CLOSE_CONN']),_0x32491d(this[_0x3326a1(0x305)]))['subscribe'](_0x5b8d4d=>{const _0x280c3c=_0x3326a1,{reason:_0x2c297b}=_0x5b8d4d[_0x280c3c(0x2a7)];this[_0x280c3c(0x21b)][_0x280c3c(0x19c)]({'id':CollaborationUIEventId[_0x280c3c(0x2d6)],'data':_0x2c297b}),this[_0x280c3c(0x195)][_0x280c3c(0x2d3)](new WorkbookEditablePermission(_0x18a44f)['id'],![]),this['_collaborationSessionService'][_0x280c3c(0x314)](_0x18a44f);});};_0x3769d0(this[_0x53531d(0xc5)][_0x53531d(0x202)](UniverInstanceType[_0x53531d(0x131)]),this[_0x53531d(0xc5)]['getTypeOfUnitAdded$'](UniverInstanceType[_0x53531d(0x264)]))[_0x53531d(0x2cb)](_0x12630c(_0x433bff=>_0x433bff[_0x53531d(0x2db)]()),filter(_0x43060d=>!isInternalEditorID(_0x43060d)),_0x32491d(this[_0x53531d(0x305)]))[_0x53531d(0xd2)](_0x1723bc=>{_0x509d4c(_0x1723bc);});}[_0x584c31(0x2dd)](){const _0x5f0642=_0x584c31,_0x24d120=async _0x3fe880=>{const _0x16adbb=_0x9779,_0x120b3c=await this['_collaborationSessionService'][_0x16adbb(0x180)](_0x3fe880),_0x5dd8a5=this[_0x16adbb(0x1ae)][_0x16adbb(0x1ea)](SheetPermissionInitController);_0x120b3c[_0x16adbb(0x2c8)][_0x16adbb(0x2cb)](filter(_0x1dcebb=>_0x1dcebb[_0x16adbb(0x257)]===CollaborationEvent[_0x16adbb(0x266)]),_0x32491d(this[_0x16adbb(0x305)]))[_0x16adbb(0xd2)](_0xb6519=>{const _0x1f5b0b=_0x16adbb,{objectId:_0x3e3379}=_0xb6519[_0x1f5b0b(0x2a7)];if(_0x3e3379===_0x3fe880)_0x5dd8a5[_0x1f5b0b(0x297)](_0x3fe880);else _0x5dd8a5[_0x1f5b0b(0x173)](_0x3fe880,_0x3e3379);});};_0x3769d0(this['_univerInstanceService'][_0x5f0642(0x202)](UniverInstanceType[_0x5f0642(0x131)]))[_0x5f0642(0x2cb)](_0x12630c(_0x4ba93b=>_0x4ba93b[_0x5f0642(0x2db)]()),filter(_0x104362=>!isInternalEditorID(_0x104362)),_0x32491d(this[_0x5f0642(0x305)]))[_0x5f0642(0xd2)](_0x1e5b2c=>{_0x24d120(_0x1e5b2c);});}};PermissionService=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,IUniverInstanceService),__decorateParam(0x2,IPermissionService),__decorateParam(0x3,Inject(CollaborationSessionService)),__decorateParam(0x4,Inject(CollaborationUIEventService))],PermissionService);let SnapshotServerOverHTTPService=class SnapshotServerOverHTTPService{constructor(_0x52eda6,_0x4f31f7){const _0x172e6f=_0x584c31;this[_0x172e6f(0x295)]=_0x52eda6,this[_0x172e6f(0xe0)]=_0x4f31f7;}async['getUnitOnRev'](_0xb0a14,_0x500e59){const _0x4bdcbe=_0x584c31;var _0x403a15;const {unitID:_0x4c58bc,type:_0x1d6000,revision:revision=0x0}=_0x500e59,_0x298c7a=this[_0x4bdcbe(0x21e)]()+'/'+_0x1d6000+_0x4bdcbe(0x2ee)+_0x4c58bc+_0x4bdcbe(0x2e3)+revision,_0x1415b4=(await this['_httpService']['get'](_0x298c7a))[_0x4bdcbe(0x10e)],_0x5c45e7=(_0x403a15=_0x1415b4['snapshot'])===null||_0x403a15===void 0x0?void 0x0:_0x403a15[_0x4bdcbe(0x16e)];if(_0x5c45e7){const _0x1bda71=_0x5c45e7===null||_0x5c45e7===void 0x0?void 0x0:_0x5c45e7[_0x4bdcbe(0x1c4)];_0x5c45e7[_0x4bdcbe(0x1c4)]=textEncoder['encode'](b64DecodeUnicode(_0x1bda71)),Object[_0x4bdcbe(0x235)](_0x5c45e7[_0x4bdcbe(0x1b9)])['forEach'](([,_0x24ebe6])=>{const _0x170f95=_0x4bdcbe,_0x674e9c=_0x24ebe6['originalMeta'];_0x24ebe6[_0x170f95(0x1c4)]=textEncoder[_0x170f95(0x282)](b64DecodeUnicode(_0x674e9c));});}return _0x1415b4;}async['getSheetBlock'](_0x5de794,_0xaee36e){const _0x417dc6=_0x584c31,{unitID:_0x93277,type:_0x32b77a,blockID:_0x2d49a3}=_0xaee36e,_0x7bd621=this[_0x417dc6(0x11d)]()+'/'+_0x32b77a+_0x417dc6(0x2ee)+_0x93277+_0x417dc6(0x313)+_0x2d49a3;return(await this[_0x417dc6(0xe0)][_0x417dc6(0x1ea)](_0x7bd621))[_0x417dc6(0x10e)];}async['getDeserializedSheetBlock'](_0x518692,_0x25cb85){const _0x287b06=_0x584c31,{unitID:_0x1cccde,type:_0x4b035e,blockID:_0x77da88}=_0x25cb85,_0x3cd8af=this[_0x287b06(0x11d)]()+_0x287b06(0x313)+_0x4b035e+_0x287b06(0x2ee)+_0x1cccde+_0x287b06(0x313)+_0x77da88;return(await this['_httpService'][_0x287b06(0x1ea)](_0x3cd8af))[_0x287b06(0x10e)];}async['fetchMissingChangesets'](_0xeb7876,_0x1cf0b9){const _0xc545f3=_0x584c31,{unitID:_0x417f24,type:_0x54c5d0,from:_0x1f9ee4,to:_0x799903}=_0x1cf0b9,_0x4fae99=this[_0xc545f3(0x11d)]()+'/'+_0x54c5d0+_0xc545f3(0x2ee)+_0x417f24+'/fetchmissing?from='+_0x1f9ee4+_0xc545f3(0x163)+_0x799903;return(await this[_0xc545f3(0xe0)][_0xc545f3(0x1ea)](_0x4fae99))[_0xc545f3(0x10e)];}[_0x584c31(0x21e)](){const _0x52686c=_0x584c31;var _0x3658f9;return(_0x3658f9=this[_0x52686c(0x295)][_0x52686c(0x1cc)](_0x52686c(0x121)))!==null&&_0x3658f9!==void 0x0?_0x3658f9:this[_0x52686c(0x11d)]();}[_0x584c31(0x11d)](){const _0x29fe3b=_0x584c31;var _0x3cf7b3;const _0x504ebd=this[_0x29fe3b(0x295)][_0x29fe3b(0x1cc)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x3cf7b3=_0x504ebd===null||_0x504ebd===void 0x0?void 0x0:_0x504ebd[_0x29fe3b(0x287)])!==null&&_0x3cf7b3!==void 0x0?_0x3cf7b3:DEFAULT_SNAPSHOT_SERVER_URL;}async['getResourcesRequest'](_0x20500c,_0x488878){const _0x31aed5=_0x584c31,_0x3e9bf1=_0x31aed5(0xf0)+_0x488878[_0x31aed5(0x16d)]+_0x31aed5(0x2ee)+_0x488878[_0x31aed5(0x158)]+'/resources';return(await this[_0x31aed5(0xe0)][_0x31aed5(0x1ea)](_0x3e9bf1,{'params':{'resourceId':JSON['stringify'](_0x488878['resourceIDs'])}}))[_0x31aed5(0x10e)];}['saveSnapshot'](){const _0x519337=_0x584c31;throw new Error(_0x519337(0x2fe));}[_0x584c31(0x1d9)](){const _0x2978f4=_0x584c31;throw new Error(_0x2978f4(0x2fe));}[_0x584c31(0x192)](){const _0x1f7ada=_0x584c31;throw new Error(_0x1f7ada(0x2fe));}[_0x584c31(0x2ae)](){throw new Error('This\x20method\x20should\x20not\x20be\x20called\x20on\x20the\x20client\x20side!');}[_0x584c31(0xe5)](){const _0x599676=_0x584c31;throw new Error(_0x599676(0x2fe));}[_0x584c31(0x18f)](){const _0x5ce698=_0x584c31;throw new Error(_0x5ce698(0x2fe));}};SnapshotServerOverHTTPService=__decorate([__decorateParam(0x0,IConfigService),__decorateParam(0x1,Inject(HTTPService))],SnapshotServerOverHTTPService);let CollaborativeUndoRedoService=class CollaborativeUndoRedoService extends LocalUndoRedoService{constructor(_0x22a410,_0x4c496d,_0x4e6481,_0x21ed27,_0x4cff64){const _0x5f1153=_0x584c31;super(_0x22a410,_0x4c496d,_0x4e6481),this['_transformService']=_0x21ed27,this[_0x5f1153(0x22b)]=_0x4cff64;}[_0x584c31(0xe7)](_0x2634bf,_0x279416){const _0x28745f=_0x584c31,_0x5f05dd=this[_0x28745f(0x20e)](_0x2634bf);if(_0x5f05dd)try{const _0x827af4=this[_0x28745f(0x27c)](_0x5f05dd,_0x279416);this[_0x28745f(0x2f4)](_0x2634bf,_0x827af4);}catch(_0x588d6e){this[_0x28745f(0x22b)][_0x28745f(0xed)](_0x28745f(0x29b),_0x588d6e),this[_0x28745f(0x2d7)](_0x2634bf);}const _0x4577cf=this['_getRedoStack'](_0x2634bf);if(_0x4577cf)try{const _0x32df86=this[_0x28745f(0x27c)](_0x4577cf,_0x279416);this[_0x28745f(0x25f)](_0x2634bf,_0x32df86);}catch(_0x1ec8cb){this[_0x28745f(0x22b)][_0x28745f(0xed)](_0x1ec8cb),this[_0x28745f(0x242)](_0x2634bf);}}[_0x584c31(0x2d7)](_0x26bfd3){const _0x197260=_0x584c31,_0x368659=this[_0x197260(0x20e)](_0x26bfd3);_0x368659&&(_0x368659[_0x197260(0x2f6)]=0x0,this[_0x197260(0x2c9)]());}[_0x584c31(0x242)](_0xc75c54){const _0x545fc6=_0x584c31,_0x50c005=this[_0x545fc6(0x218)](_0xc75c54);_0x50c005&&(_0x50c005[_0x545fc6(0x2f6)]=0x0,this[_0x545fc6(0x2c9)]());}[_0x584c31(0x2f4)](_0x23860b,_0x2515a5){const _0x1f9b4f=_0x584c31;this[_0x1f9b4f(0x1d0)][_0x1f9b4f(0x1ec)](_0x23860b,_0x2515a5),this['_updateStatus']();}[_0x584c31(0x25f)](_0x106297,_0x514b45){const _0x4432d1=_0x584c31;this[_0x4432d1(0x16b)][_0x4432d1(0x1ec)](_0x106297,_0x514b45),this['_updateStatus']();}[_0x584c31(0x27c)](_0x384d18,_0x8d756c){const _0xa0fc3f=_0x584c31,_0x1e0418=[];let _0x415194=_0x8d756c,_0x2d84e9=_0x8d756c;for(let _0x219b07=_0x384d18[_0xa0fc3f(0x2f6)]-0x1;_0x219b07>=0x0;_0x219b07--){const {unitID:_0x12a9c9,undoMutations:_0x59d558,redoMutations:_0x337ddf}=_0x384d18[_0x219b07],_0x97d18a=this[_0xa0fc3f(0x198)][_0xa0fc3f(0x261)](_0x415194,_0x59d558),_0x31cd88=this['_transformService']['transformMutationsWithChangeset'](_0x2d84e9,_0x337ddf);if(isTransformMutationsWithChangesetFailure(_0x97d18a)||isTransformMutationsWithChangesetFailure(_0x31cd88)){this['_logService'][_0xa0fc3f(0xed)](_0xa0fc3f(0x29b),'transformStack\x20failed!',_0x97d18a,_0x31cd88);break;}_0x415194=_0x97d18a[_0xa0fc3f(0x143)],_0x2d84e9=_0x31cd88[_0xa0fc3f(0x143)],_0x1e0418[_0xa0fc3f(0x125)]({'unitID':_0x12a9c9,'undoMutations':_0x97d18a[_0xa0fc3f(0x22d)],'redoMutations':_0x31cd88[_0xa0fc3f(0x22d)]});}return _0x1e0418[_0xa0fc3f(0x260)]();}};CollaborativeUndoRedoService=__decorate([__decorateParam(0x0,IUniverInstanceService),__decorateParam(0x1,ICommandService),__decorateParam(0x2,IContextService),__decorateParam(0x3,ITransformService),__decorateParam(0x4,ILogService)],CollaborativeUndoRedoService);let UniverCollaborationClientPlugin=class UniverCollaborationClientPlugin extends Plugin{constructor(_0x2ee49c={},_0x3d6dab,_0x53103c,_0x9f68b){const _0x5d36cb=_0x584c31;super(),this[_0x5d36cb(0x1fd)]=_0x2ee49c,this[_0x5d36cb(0x22b)]=_0x3d6dab,this[_0x5d36cb(0x1ae)]=_0x53103c,this[_0x5d36cb(0x295)]=_0x9f68b;const {..._0x4e7691}=merge({},defaultPluginConfig,_0x2ee49c);if(!_0x4e7691[_0x5d36cb(0x144)])throw new Error(_0x5d36cb(0x22f));this[_0x5d36cb(0x1fd)]=_0x4e7691,this['_configService']['setConfig'](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY,_0x4e7691);}[_0x584c31(0x30d)](){const _0xbc1186=_0x584c31;this[_0xbc1186(0x1a3)](),this[_0xbc1186(0x2cf)]();}['_registerDependencies'](){const _0x2bbb83=_0x584c31;var _0x5b70a5,_0x3f7fe9;if(this['_injector']['has'](IUndoRedoService))this[_0x2bbb83(0x22b)][_0x2bbb83(0xed)](_0x2bbb83(0x1ab),_0x2bbb83(0x232));const _0x8eae8a=mergeOverrideWithDependencies([[IUndoRedoService,{'useClass':CollaborativeUndoRedoService}],[CollaborationSessionService],[MemberService],[SheetTransformSelectionsService],[AuthServerService],[DomainRequestService],[CommentService],[PermissionService],[CollaborationUIEventService],[DataLoaderService],[ICollaborationSocketService,{'useClass':this[_0x2bbb83(0x1fd)][_0x2bbb83(0x144)]}],[ISnapshotServerService,{'useClass':SnapshotServerOverHTTPService}],[IAuthzIoService,{'useClass':AuthzIoHttpService}],[IImageIoService,{'useClass':CollaborationImageIoService}],[IMentionIOService,{'useClass':MentionIoHttpService}],[CollaborationController],[FileNameController]],(_0x5b70a5=this['_config'])===null||_0x5b70a5===void 0x0?void 0x0:_0x5b70a5[_0x2bbb83(0x2fb)]);if(!((_0x3f7fe9=this[_0x2bbb83(0x1fd)])===null||_0x3f7fe9===void 0x0?void 0x0:_0x3f7fe9['enableSingleActiveInstanceLock'])){const _0x357fc8=_0x8eae8a['findIndex'](([_0x258b35])=>_0x258b35===ISingleActiveUnitService);if(_0x357fc8!==-0x1)_0x8eae8a[_0x2bbb83(0x1ee)](_0x357fc8,0x1);}registerDependencies(this[_0x2bbb83(0x1ae)],_0x8eae8a);}[_0x584c31(0x2cf)](){const _0x18834f=_0x584c31;var _0x907da8,_0x115768;this[_0x18834f(0x1ae)][_0x18834f(0x1ea)](HTTPService)[_0x18834f(0x251)]({'priority':0x14,'interceptor':ThresholdInterceptorFactory({'maxParallel':0x6})});if(!((_0x907da8=this[_0x18834f(0x1fd)])===null||_0x907da8===void 0x0?void 0x0:_0x907da8['enableOfflineEditing'])){var _0x10a029;(_0x10a029=this[_0x18834f(0x1ae)]['get'](ILocalCacheService,Quantity['OPTIONAL']))===null||_0x10a029===void 0x0||_0x10a029['disableLocalCache']();}if((_0x115768=this[_0x18834f(0x1fd)])===null||_0x115768===void 0x0?void 0x0:_0x115768[_0x18834f(0x14a)])touchDependencies(this[_0x18834f(0x1ae)],[[AuthServerService]]);touchDependencies(this[_0x18834f(0x1ae)],[[DomainRequestService],[CollaborationController],[PermissionService]]);}};_defineProperty(UniverCollaborationClientPlugin,'pluginName',_0x584c31(0x206)),_defineProperty(UniverCollaborationClientPlugin,'packageName',name),_defineProperty(UniverCollaborationClientPlugin,_0x584c31(0x1e3),version),UniverCollaborationClientPlugin=__decorate([DependentOn(UniverLicensePlugin,UniverCollaborationPlugin,UniverNetworkPlugin),__decorateParam(0x1,ILogService),__decorateParam(0x2,Inject(Injector)),__decorateParam(0x3,IConfigService)],UniverCollaborationClientPlugin);export{AuthzIoHttpService,AwaitingState,AwaitingWithPendingState,COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY,CollaborationController,CollaborationEntity,CollaborationImageIoService,CollaborationSession,CollaborationSessionService,CollaborationSocketService,CollaborationStatus,CollaborationUIEventId,CollaborationUIEventService,CollaborativeUndoRedoService,CommentService,ConflictState,DEFAULT_COLLAB_WEB_SOCKET_URL,DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT,DEFAULT_WS_SESSION_TICKET_URL,DataLoaderService,DocCollaborationEntity,FetchingMissState,HEARTBEAT_INTERVAL_KEY,HEARTBEAT_TIMEOUT_KEY,ICollaborationSocketService,ILocalCacheService,INetworkConditionService,ISingleActiveUnitService,LOCAL_CACHE_INTERVAL,LOCAL_CACHE_INTERVAL_KEY,MemberService,MentionIoHttpService,OfflineState,PendingState,REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY,RETRY_CONNECTING_MAX_COUNT_KEY,SessionStatus,SheetCollaborationEntity,SheetTransformSelectionsService,SnapshotServerOverHTTPService,SyncedState,UnitStatus,UniverCollaborationClientPlugin,deserializeToCombResponse,getLocalCacheKey,serializeCombRequest};
1
+ const _0x187924=_0x5993;(function(_0x258608,_0x24e087){const _0x360b19=_0x5993,_0x5b1042=_0x258608();while(!![]){try{const _0x21f512=parseInt(_0x360b19(0x308))/0x1+-parseInt(_0x360b19(0x23d))/0x2+parseInt(_0x360b19(0x22e))/0x3*(parseInt(_0x360b19(0x34e))/0x4)+parseInt(_0x360b19(0x357))/0x5*(parseInt(_0x360b19(0x1de))/0x6)+-parseInt(_0x360b19(0x15a))/0x7+parseInt(_0x360b19(0x2ce))/0x8*(-parseInt(_0x360b19(0x1fe))/0x9)+parseInt(_0x360b19(0x156))/0xa*(-parseInt(_0x360b19(0x171))/0xb);if(_0x21f512===_0x24e087)break;else _0x5b1042['push'](_0x5b1042['shift']());}catch(_0x285b97){_0x5b1042['push'](_0x5b1042['shift']());}}}(_0x2151,0x198dc));import{CollaborationEvent,CompressMutationService,EmptyMutationInfo,ISnapshotServerService,ITransformService,RevisionService,SnapshotService,UniverCollaborationPlugin,b64DecodeUnicode,isTransformChangesetsSuccess,isTransformMutationsWithChangesetFailure,isTransformMutationsWithChangesetSuccess,mapDocumentTypeToUniverInstanceType,parseChangesetToProtocol,parseProtocolChangeset,textEncoder,uuidv4}from'@univerjs-pro/collaboration';import{CommandType,DependentOn,Disposable,DisposableCollection,IAuthzIoService,ICommandService,IConfigService,IContextService,ILogService,IMentionIOService,IPermissionService,IUndoRedoService,IUniverInstanceService,Inject,Injector,JSONX,LocalUndoRedoService,LocaleService,MentionType,Optional,Plugin,Quantity,Rectangle,RxDisposable,Tools,UniverInstanceType,UserManagerService,Workbook,createIdentifier,generateRandomId,isInternalEditorID,merge,mergeOverrideWithDependencies,registerDependencies,resolveWithBasePath,sequenceExecute,toDisposable,touchDependencies}from'@univerjs/core';import{RichTextEditingMutation}from'@univerjs/docs';import{InsertSheetMutation,SetSelectionsOperation,SheetPermissionInitController,SheetsSelectionsService,WorkbookEditablePermission}from'@univerjs/sheets';import{BehaviorSubject,ReplaySubject,Subject,concatMap,firstValueFrom,map,merge as _0x148a33,of,shareReplay,take,takeUntil}from'rxjs';import{CmdRspCode,CombCmd,ErrorCode,FileSource}from'@univerjs/protocol';function _0x2151(){const _0x1e0d81=['_changesetSessionId','cmd','getCfgEnableObjInherit','PENDING','getSheetId','joinEvent','deepClone','dispose$','_transformUndoredo','createSocket','call','MUTATION','[FetchingMissState]:\x20invalid\x20calling\x20to\x20`resend`.','registerHTTPInterceptor','0.21.1','editingUnit','session.room-permission-denied','commentUpdateEvent','members','317916fbMedO','PERMISSION_DENIED','_createInitialState','_getDownloadEndpointURL','_socketReady','post','_replayCachedMutations','addImageSourceCache','/universer-api/stream/file/upload','AWAITING','_compressMutationService','fromCharCode','save\x20fail\x20reason\x20is\x20','max','&source=','reconnect','revision','&to=','init','FileId','onlyLocal','_entities','unknown','liveShareNewHost','_retryCount','BASE64','data','LIVESHARE_REQUEST_HOST','[CollaborationEntity]:\x20cannot\x20lock\x20transition\x20twice!\x20This\x20is\x20an\x20implementation\x20error,\x20meaning\x20you\x20transit\x20the\x20collaboration\x20state\x20again\x20in\x20the\x20process\x20of\x20a\x20previous\x20transition.\x20This\x20should\x20never\x20happen.','_getCurrentRevision','CLOSE_ROOM','get','filter','_onRemoteACK','add','_clearRedo','ERROR_IMAGE','[CollaborationSessionService]:\x20socket\x20error','target','_remoteChangesetQueue','/fetchmissing?from=','[SyncedState]:\x20invalid\x20calling\x20to\x20`resend`.','append','range','_members','getActiveSheet','onRemoteChangeset','transformUndoRedo','51162QihdRB','_onUserJoin','workbook','_initCloseConn','_snapshotService','_getUndoStack','FETCH_MISSING','resolve','newCsEvent','_eventService','event$','_onConnectionFailed','awaiting_with_pending','/role','getFocusedUnit','344236ADZeIw','_stopTelemetryCollaborationNewChangeset','Cannot\x20assemble\x20a\x20changeset\x20from\x20multiple\x20mutations\x20of\x20different\x20types:\x20','_telemetryService','_configService','[PendingState]:\x20unhandled\x20univer\x20type:\x20','readAsDataURL','_tryEnsureSocket','SUBMIT_CHANGESET_TIMEOUT','_commentUpdate$','_snapshotServerService','_transformService','[PendingState]:\x20received\x20rejection.','ERROR_EXCEED_SIZE','joinRsp','_incrementRevisionNumber','onRemoteRetry','onStateChange','_collaborationUIEventService','_toggleOnline','/object','_localeService','IDLE','onload','c1Prime','/universer-api/authz','session.join-failed','slice','executeCommand','_syncEditingCollabCursor','min','[CollaborationUndoRedoService]','listRoles','batchAllowed','map','status','update','socketService','unitId\x20is\x20not\x20found','liveShareOperation','unitId','getCurrentRevOfUnit','baseRev','code','_transformIMECache','patch','_onCombEvent','telemetry\x20info\x20is\x20not\x20initialized','/-/object/-/batch_allowed','setCfgEnableObjInherit','setConfig','cfgEnableObjInherit','values','_handlerCallback','setWaitCount','csRejEvent','/resources','sheets','FETCH_MISS','href','fetchMissingChangesets','entityInit$','_substituteRedoStack','rev','onRemoteAck','\x0aCurrent:\x20','_acknowledgedAwaitingChangeset','fetching\x20missing\x20changesets\x20from\x20','getConfig','reqId','objectActions','_joinRoom','name','_waitCount','fetchThroughInterceptors','encode','loadOfflineData','_fetchMissChangesets','FAIL','includes','error','_revisionService','RETRY_CONNECTING_MAX_COUNT','snapshotServerUrl','LIVESHARE_FETCH_OPERATIONS','compose','_clearRetryConnectingTimer','RECV','_change$','_getCtorByUniverInstanceType','synced','[CollaborationSocketService]:\x20failed\x20to\x20get\x20web\x20socket\x20factory!','objects','setCurrentUser','close','NEW_CHANGESETS','collabWebSocketUrl','UNISCRIPT_RUN','close$','getMemberID','enableOfflineEditing','open$','size','_createInitialStateImpl','_awaitingChangeset','NOT_COLLAB','encodeURIComponent','getUnitOnRev','transformStack\x20failed!','result','roomInfos','connection\x20error','_univerInstanceService','default','_clearScheduledTask','getTypeOfUnitAdded$','JOIN_ROOM_PERMISSION_DENIED','_collaborationPaused','getImage','pluginName','getTime','_changesetReqId','_shouldReportTelemetry','localeService','UNIVER_SHEET','object','_state','loadUnitOfRevision','startsWith','_commandService','removeMember','fromCollab','_clearLocalCache','image/bmp','ws://127.0.0.1:8000/universer-api/comb/connect','function','getTypeOfUnitDisposed$','ERROR_IMAGE_TYPE','setShowComponents','_pendingMutations','_toggleOffline','COMPRESS_MUTATION_APPLY','method','_members$','_onMessage','8KJgVDy','UNIVER_DOC','interceptor','SNAPSHOT_URL_KEY','_scheduleCompleteTimestamp','/new_changes','SUBMIT_CHANGESET','_clearUndo','roles','_checkMissing','_getRedoStack','HEARTBEAT','_socketMessageSubscription','\x20to\x20','userID','offline','_sessions','getAllMembers','putCollaborators','_userManagerService','state','_onFetchMissResult','[CollaborationSession]','forEach','toString','_unitID','_permissionService','_decreaseWaiting','[UniverCollaborationClientPlugin]:\x20you\x20must\x20provide\x20a\x20socketService\x20implementation\x20in\x20config!','getUnitType','onSendChangeset','/universer-api/uniscript','_updateLocalCache','USERS_ENTER','_resendTimeout','error$','_schedule','_maxTotalRetryTimeout','resourceIDs','/universer-api/snapshot/','_timeoutTimer','unitInfo$','list','routeKey','JOIN_ROOM_FAILED','fetchMiss','_retryConnectingTimer','_removeRoom','initWorkbookPermissionChange','objectType','params','_listenToNetworkCondition','title','onRemoteRej','_transformRemoteChangesetByIMECache','symbol','_transformSelections','transformSelections','207394PJeUWA','file','has','clear','now','onMutationExecutedForCollab','transformMutationsWithChangeset','_onJoinRoomEvent','toggleOnline','getCurrentUser','_tryReconnect','emitEvent','_resendTimer','onTransformRemoteChangesetByStateCache','reject','_singleActiveUnitService','objectID','members$','CHANGESET_ACK','[serializeCombRequest]:\x20should\x20not\x20fall\x20into\x20default\x20branch!','HEARTBEAT_TIMEOUT','deleteCollaborator','[CollaborationEntity]:\x20initial\x20state\x20has\x20been\x20created\x20before.\x20You\x20should\x20not\x20call\x20\x22init\x22\x20twice.','requireSession','onTransformRemoteChangesetByIMECache\x20callback\x20is\x20not\x20added\x20yet.','_unlockTransition','_undoStacks','requestParams','onLocalMutation','apply','_logService','_initUnitPermissionChange','People','capture','_event$','getRoom','loadSheet','_injector','[PendingState]:\x20received\x20acknowledgement.','originalMeta','every','put','not_collab','_onOffline','_handler','[OfflineState]:\x20invalid\x20calling\x20to\x20`resend`.','_commentService','change$','debug','image/gif','_init','textRanges','retryConnectingInterval','univer-pro.collaboration-client-socket-service','editing\x20status\x20changed\x20to','ONLINE','confirm','m2Prime','_collabSessionService','getSnapshotAPIPath','[CollaborationSession]:\x20should\x20not\x20send\x20message\x20when\x20the\x20session\x20is\x20offline!','_onRemoteRejected','_onConnectionOpen','UPDATE_PERMISSION_OBJ','_submitChangeset','HEARTBEAT_INTERVAL','appendMutation','_emitMembers','/universer-api/user/session-ticket','saveSnapshot','36wSYCWs','LIVESHARE_TERMINATE','PERMISSION_REJ','USERS_LEAVE','subscribe','PSEUDO_FETCH_MISSING_RESULT','toggleOffline','duration','undefined','10495UwBHur','send','getMember','length','OTHER_CLIENT_EDITING','subject','_executeRemoteChangeset','[SyncedState]:\x20received\x20acknowledgement.','reduce','subUnitId','image/png','SOCKET_FAILED','enableSingleActiveInstanceLock','unitID','_initDependencies','LIVESHARE_OPERATION','state$','[PendingState]:\x20invalid\x20calling\x20to\x20`resend`.','createInstance','sid','COMMENT_UPDATE','mutations','onTransformRemoteChangesetByIMECache','onCommentUpdate','_lockTransition','memberID','allowed','[CollaborationSessionService]','complete','push','delete','_onRemoteChangeset','online$','saveImage','[OfflineState]:\x20received\x20changeset.','_roomCreated$','_rescheduleHeartbeat','_telemetryInfo','?url=','shouldCloseConn','JOIN','LEAVE','pauseCollaboration','dispose','sendChangesetTimeout','downloadEndpointUrl','authzUrl','pipe','_getSendChangesetTimeout','INGEST','withCredentials','collaboration_new_changeset','LOCAL_CACHE_INTERVAL','enableAuthServer','_exhaustRemoteChangesetQueue','getImageSourceCache','unit','_memberService','_sender','SOCKET_FAILED_RETRY','_replaceFileID','stringify','leaveEvent','JOINING','/block/','_httpService','isArray','/rev/','getResourcesRequest','DEFAULT_FILE_NAME','set','CONFLICT','_imageSourceCache','_transitionLocked','_clearHeartbeatTimer','_socket$','localCacheService','focused$','_networkConditionService','onTransformRemoteChangesetByStateCache\x20callback\x20is\x20not\x20added\x20yet.','saveChangeset','loadDoc','incrementRevOfUnit','_substituteUndoStack','onTransformSelections','getLatestCsReqIdBySid','_createSocket','UUID','decorate','session','UPDATE_CURSOR','Failed\x20to\x20update\x20permission\x20point','_initRequestHeader','failed\x20to\x20apply\x20missed\x20changesets!','unsubscribe','Univer','@univerjs-pro/collaboration-client','_status$','src','responseType','refreshPermission','action','getUnitStatus$','_getLoginPath','_socket','CHANGESET_SHOULD_RETRY','424840RFonZx','_startCollaboration','UNIVER_COLLABORATION_CLIENT_PLUGIN','SUCCUSS','235011pIGdyK','catch','body','AWAITING_WITH_PENDING','_onConflict','isPermissionRej','_clearCollaborationTimeoutTimer','[CollaborationEntity]:\x20invalid\x20state\x20transition!\x20State\x20transferred\x20from\x20is\x20not\x20the\x20current\x20state.\x0aBefore:\x20','_transformStack','_localCacheService','_disableEditing','defineProperty','_sendingTimer','CHANGESET_REJ','onMissingChangesets','_unitInfo$','/universer-api/oidc/authpage','JOIN_ROOM_FULL','OTHER_CLIENTS_EDITING','_candidateSocket','_collaborationSessionService','_applyRemoteChangeset','_config','11SnXtok','JOIN_ROOM_NOT_EXISTS','_onRecvEvent','updateMember','c2Prime','snapshot','override','[FetchMissState]','/collaborator','&assign=','{fileID}','_createHandler','_showConflictNotification','_getUploadFileURL','updateCursorEvent','\x20in\x20_schedule.','REMOTE_UNISCRIPT_EXECUTION_ENDPOINT','sessionStatus','POST','OFFLINE','_waitForHeartbeatResponse','_onLocalMutation','getUnitId','[UniverCollaborationClientPlugin]','_onRemoteRetry','getCollabEntity$','_entityInit$','This\x20method\x20should\x20not\x20be\x20called\x20on\x20the\x20client\x20side!','HELLO','_collaborationTimeoutTimer','socket\x20open.','commentUpdate$','onTransformIME','updatePermissionPoint','_sessionStatus$','_HTTPService','you\x20should\x20override\x20\x22IUndoRedoService\x22\x20provided\x20in\x20\x22core\x22\x20package!','_updateStatus','_queuedRemoteChangesets','_getAPIPrefixPath','replace','_getAPIPrefix','_sheetTransformSelectionsService','_throwTelemetryCollaborationNewChangeset','transformChangesets','startTime','type','_state$','[CollaborationSocketService]:\x20failed\x20to\x20create\x20socket!','_clearTimeoutTimer','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','/unit/','next','_sendHeartbeat','[OfflineState]:\x20received\x20rejection.','/allowed','_socketService','findIndex','string','_instanceService','status$','_undoRedoService','[ConflictState]:\x20invalid\x20calling\x20to\x20`resend`.','disposeWithMe','collaborators','then','[AuthServerService]:\x20you\x20should\x20provide\x20authentication\x20info\x20on\x20Node.js.','_getSignURL','conflict','?size=','uploadFileServerUrl','location','sessionStatus$','_registerDependencies','actions','\x0aAfter:\x20','updateCollaborator','_sendHeartbeatTimer','eventID','_updateState','onSyncEditingCollabCursor','univer-pro.collaboration-client.network-condition.service','Unknown\x20type.\x20Will\x20not\x20load\x20files\x20from\x20remote\x20address.','entries','/universer-api/file/{fileID}/sign-url','/-/object/list','_type','collaboration-client.config','_initMergeInterceptor','[OfflineState]:\x20received\x20acknowledgement.','find','readyForCollab','resend','stopTime','createCollaborator','selections','getInterceptPoints','reverse','/universer-api/snapshot','avatar','_roomMembers','_resendWithTimeout','MSG_FOR_ERROR','awaitingChangeset','image/jpeg','_cfgEnableObjInherit','[FetchingMissState]:\x20not\x20expected\x20to\x20receive\x20ack\x20when\x20`this._awaitingChangeset`\x20is\x20null!','create','closeSession','78LvCDpC','[DataLoaderService]','origin','PERSON','asObservable','getValue','pending','parse','SYNCED','SHOULD_CLOSE_CONN','message$','hostname','getCollabEntity'];_0x2151=function(){return _0x1e0d81;};return _0x2151();}import{ITelemetryService}from'@univerjs/telemetry';import{delay,filter,map as _0x4d57e7,take as _0x4df3da,takeUntil as _0x22954b}from'rxjs/operators';import{HTTPRequest,HTTPService,ISocketService,MergeInterceptorFactory,ThresholdInterceptorFactory,UniverNetworkPlugin}from'@univerjs/network';import{UniverLicensePlugin,getGlobalObject}from'@univerjs-pro/license';import{IImageIoService,ImageSourceType,ImageUploadStatusType}from'@univerjs/drawing';import{cbc}from'@noble/ciphers/aes.js';import{concatBytes,randomBytes,utf8ToBytes}from'@noble/ciphers/utils.js';const DEFAULT_SNAPSHOT_SERVER_URL=_0x187924(0x1d3),SNAPSHOT_URL_KEY=_0x187924(0x2d1),DEFAULT_SEND_CHANGESET_TIMEOUT=0x7d0,DEFAULT_COLLAB_WEB_SOCKET_URL=_0x187924(0x2c3),DEFAULT_WS_SESSION_TICKET_URL=_0x187924(0x34c),HEARTBEAT_INTERVAL_KEY=_0x187924(0x349),DEFAULT_HEARTBEAT_INTERVAL=0x7530,HEARTBEAT_TIMEOUT_KEY=_0x187924(0x31c),DEFAULT_HEARTBEAT_TIMEOUT=0x4e20,DEFAULT_RETRY_CONNECTING_INTERVAL=0x4e20,RETRY_CONNECTING_MAX_COUNT_KEY=_0x187924(0x28f),LOCAL_CACHE_INTERVAL_KEY=_0x187924(0x38b),LOCAL_CACHE_INTERVAL=0x3e8,DEFAULT_COLLAB_SUBMIT_CHANGESET_URL='/universer-api/comb',DEFAULT_LOGIN_URL=_0x187924(0x16a),REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY=_0x187924(0x181),DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT=_0x187924(0x2ed),TELEMETRY_COLLABORATION_NEW_CHANGESET=_0x187924(0x38a);function summaryChangesetSize(_0x2facc7){const _0xee479=_0x187924;return JSON[_0xee479(0x394)](_0x2facc7)[_0xee479(0x35a)];}function _typeof(_0xd47fda){'@babel/helpers - typeof';const _0x494f82=_0x187924;return _typeof=_0x494f82(0x2c4)==typeof Symbol&&_0x494f82(0x305)==typeof Symbol['iterator']?function(_0x26954d){return typeof _0x26954d;}:function(_0x1cdc09){const _0x1ee50b=_0x494f82;return _0x1cdc09&&_0x1ee50b(0x2c4)==typeof Symbol&&_0x1cdc09['constructor']===Symbol&&_0x1cdc09!==Symbol['prototype']?_0x1ee50b(0x305):typeof _0x1cdc09;},_typeof(_0xd47fda);}function toPrimitive(_0x419482,_0x50852c){const _0x5acf22=_0x187924;if('object'!=_typeof(_0x419482)||!_0x419482)return _0x419482;var _0x562660=_0x419482[Symbol['toPrimitive']];if(void 0x0!==_0x562660){var _0x21f59c=_0x562660[_0x5acf22(0x1f5)](_0x419482,_0x50852c||_0x5acf22(0x2ae));if(_0x5acf22(0x2ba)!=_typeof(_0x21f59c))return _0x21f59c;throw new TypeError(_0x5acf22(0x1a3));}return(_0x5acf22(0x1ab)===_0x50852c?String:Number)(_0x419482);}function toPropertyKey(_0x2e87af){const _0x5153aa=_0x187924;var _0x3d044f=toPrimitive(_0x2e87af,_0x5153aa(0x1ab));return'symbol'==_typeof(_0x3d044f)?_0x3d044f:_0x3d044f+'';}function _defineProperty(_0x346f3f,_0x135a1a,_0x3abbdc){const _0x554813=_0x187924;return(_0x135a1a=toPropertyKey(_0x135a1a))in _0x346f3f?Object[_0x554813(0x165)](_0x346f3f,_0x135a1a,{'value':_0x3abbdc,'enumerable':!0x0,'configurable':!0x0,'writable':!0x0}):_0x346f3f[_0x135a1a]=_0x3abbdc,_0x346f3f;}let CollaborationUIEventId=function(_0x1f6894){const _0x200fe1=_0x187924;return _0x1f6894[_0x200fe1(0x35b)]=_0x200fe1(0x35b),_0x1f6894[_0x200fe1(0x1ff)]='PERMISSION_DENIED',_0x1f6894[_0x200fe1(0x39e)]='CONFLICT',_0x1f6894[_0x200fe1(0x21c)]=_0x200fe1(0x21c),_0x1f6894[_0x200fe1(0x2fa)]='JOIN_ROOM_FAILED',_0x1f6894[_0x200fe1(0x392)]=_0x200fe1(0x392),_0x1f6894[_0x200fe1(0x362)]=_0x200fe1(0x362),_0x1f6894[_0x200fe1(0x245)]=_0x200fe1(0x245),_0x1f6894;}({});var CollaborationUIEventService=class{constructor(){const _0x35b4d4=_0x187924;_defineProperty(this,_0x35b4d4(0x32a),new Subject()),_defineProperty(this,'event$',this['_event$'][_0x35b4d4(0x1e2)]());}['emitEvent'](_0x379225){const _0x446538=_0x187924;this[_0x446538(0x32a)][_0x446538(0x1a5)](_0x379225);}},CommentService=class{constructor(){const _0x320c66=_0x187924;_defineProperty(this,_0x320c66(0x246),new Subject()),_defineProperty(this,_0x320c66(0x190),this[_0x320c66(0x246)]['asObservable']());}[_0x187924(0x36e)](_0x317d70){const _0x523d87=_0x187924;this[_0x523d87(0x246)]['next'](_0x317d70);}};function __decorateParam(_0x309fed,_0x22c6c3){return function(_0x371271,_0xedc5c3){_0x22c6c3(_0x371271,_0xedc5c3,_0x309fed);};}function __decorate(_0x3a32bc,_0x526e03,_0x351f7d,_0x3e63f8){const _0x156b76=_0x187924;var _0x4b3163=arguments[_0x156b76(0x35a)],_0x18511e=_0x4b3163<0x3?_0x526e03:_0x3e63f8===null?_0x3e63f8=Object['getOwnPropertyDescriptor'](_0x526e03,_0x351f7d):_0x3e63f8,_0x9bcf33;if(typeof Reflect===_0x156b76(0x2ba)&&typeof Reflect[_0x156b76(0x3af)]===_0x156b76(0x2c4))_0x18511e=Reflect[_0x156b76(0x3af)](_0x3a32bc,_0x526e03,_0x351f7d,_0x3e63f8);else{for(var _0x30b412=_0x3a32bc[_0x156b76(0x35a)]-0x1;_0x30b412>=0x0;_0x30b412--)if(_0x9bcf33=_0x3a32bc[_0x30b412])_0x18511e=(_0x4b3163<0x3?_0x9bcf33(_0x18511e):_0x4b3163>0x3?_0x9bcf33(_0x526e03,_0x351f7d,_0x18511e):_0x9bcf33(_0x526e03,_0x351f7d))||_0x18511e;}return _0x4b3163>0x3&&_0x18511e&&Object[_0x156b76(0x165)](_0x526e03,_0x351f7d,_0x18511e),_0x18511e;}let MemberService=class MemberService extends Disposable{constructor(_0x19f6fc,_0x31c120){const _0x17ac2e=_0x187924;super(),this['_univerInstanceService']=_0x19f6fc,this[_0x17ac2e(0x2e1)]=_0x31c120,_defineProperty(this,_0x17ac2e(0x1d5),new Map()),_defineProperty(this,_0x17ac2e(0x37a),new Subject()),this[_0x17ac2e(0x1b0)](_0x148a33(this[_0x17ac2e(0x2ad)][_0x17ac2e(0x2c5)](UniverInstanceType[_0x17ac2e(0x2b9)])[_0x17ac2e(0x386)](_0x4d57e7(_0x176f97=>_0x176f97[_0x17ac2e(0x187)]())),this[_0x17ac2e(0x2ad)][_0x17ac2e(0x2c5)](UniverInstanceType[_0x17ac2e(0x2cf)])[_0x17ac2e(0x386)](_0x4d57e7(_0x315635=>_0x315635['getUnitId']())))[_0x17ac2e(0x352)](_0x43a6c3=>this[_0x17ac2e(0x2fd)](_0x43a6c3)));}['waitForRoom$'](_0x33e810){const _0x170ba7=_0x187924;if(this['_roomMembers'][_0x170ba7(0x30a)](_0x33e810))return of(this[_0x170ba7(0x1d5)]['get'](_0x33e810));return this[_0x170ba7(0x37a)][_0x170ba7(0x386)](_0x4d57e7(_0x23a779=>{const _0x248597=_0x170ba7;if(_0x23a779===_0x33e810)return this[_0x248597(0x1d5)]['get'](_0x23a779);}));}[_0x187924(0x29a)](_0xad4c4b){const _0xdf1fe3=_0x187924;this[_0xdf1fe3(0x2e1)][_0xdf1fe3(0x29a)](_0xad4c4b);}[_0x187924(0x311)](){const _0x4a62d7=_0x187924;return this[_0x4a62d7(0x2e1)][_0x4a62d7(0x311)]();}[_0x187924(0x174)](_0x15f95a,_0x7ae331){const _0x10e765=_0x187924;let _0x3aedf8=this[_0x10e765(0x1d5)][_0x10e765(0x21d)](_0x15f95a);!_0x3aedf8&&(_0x3aedf8=new RoomMember(),this[_0x10e765(0x1d5)][_0x10e765(0x39d)](_0x15f95a,_0x3aedf8),this[_0x10e765(0x37a)]['next'](_0x15f95a)),_0x3aedf8['updateMember'](_0x7ae331);}[_0x187924(0x2bf)](_0x4456a3,_0x134260){const _0x1623c7=_0x187924,_0x3b6d78=this[_0x1623c7(0x1d5)][_0x1623c7(0x21d)](_0x4456a3);if(_0x3b6d78)_0x3b6d78[_0x1623c7(0x2bf)](_0x134260);}[_0x187924(0x32b)](_0x54c341){const _0x14b371=_0x187924;return this['_roomMembers'][_0x14b371(0x21d)](_0x54c341);}[_0x187924(0x359)](_0x4ea3ec,_0x3a67f3){const _0x26ddd1=_0x187924,_0x256b5c=this[_0x26ddd1(0x1d5)][_0x26ddd1(0x21d)](_0x4ea3ec);if(_0x256b5c)return _0x256b5c['getMember'](_0x3a67f3);}[_0x187924(0x2fd)](_0x129f3d){const _0x3493a7=_0x187924,_0x283e14=this[_0x3493a7(0x1d5)]['get'](_0x129f3d);_0x283e14&&(_0x283e14['dispose'](),this[_0x3493a7(0x1d5)]['delete'](_0x129f3d));}[_0x187924(0x382)](){const _0x19a66e=_0x187924;this[_0x19a66e(0x1d5)]['forEach'](_0x49df70=>_0x49df70[_0x19a66e(0x382)]()),this['_roomMembers'][_0x19a66e(0x30b)](),this[_0x19a66e(0x37a)][_0x19a66e(0x373)]();}};MemberService=__decorate([__decorateParam(0x0,IUniverInstanceService),__decorateParam(0x1,Inject(UserManagerService))],MemberService);var RoomMember=class extends Disposable{constructor(..._0x201509){const _0x1bc7fc=_0x187924;super(..._0x201509),_defineProperty(this,'_members',new Map()),_defineProperty(this,_0x1bc7fc(0x2cc),new BehaviorSubject(this[_0x1bc7fc(0x22a)])),_defineProperty(this,_0x1bc7fc(0x319),this['_members$'][_0x1bc7fc(0x1e2)]());}['dispose'](){const _0x5c2524=_0x187924;this['_members'][_0x5c2524(0x30b)](),this['_members$'][_0x5c2524(0x373)]();}['updateMember'](_0x2e2ea2){const _0x3f688c=_0x187924;this[_0x3f688c(0x22a)][_0x3f688c(0x39d)](_0x2e2ea2['memberID'],_0x2e2ea2),this[_0x3f688c(0x34b)]();}[_0x187924(0x2bf)](_0x3f8bf9){const _0xd53916=_0x187924;this['_members'][_0xd53916(0x375)](_0x3f8bf9),this[_0xd53916(0x34b)]();}['getMember'](_0x29a773){const _0x4a83d9=_0x187924;return this[_0x4a83d9(0x22a)][_0x4a83d9(0x21d)](_0x29a773);}[_0x187924(0x2df)](){const _0x47d851=_0x187924;return Array['from'](this[_0x47d851(0x22a)][_0x47d851(0x271)]());}['_emitMembers'](){const _0x27d0b5=_0x187924;this[_0x27d0b5(0x2cc)][_0x27d0b5(0x1a5)](this['_members']);}};let SessionStatus=function(_0x40a012){const _0x501e06=_0x187924;return _0x40a012[_0x40a012[_0x501e06(0x253)]=0x0]=_0x501e06(0x253),_0x40a012[_0x40a012[_0x501e06(0x396)]=0x1]=_0x501e06(0x396),_0x40a012[_0x40a012[_0x501e06(0x184)]=0x2]=_0x501e06(0x184),_0x40a012[_0x40a012[_0x501e06(0x33f)]=0x3]=_0x501e06(0x33f),_0x40a012;}({});const FailedReason={[CmdRspCode[_0x187924(0x28b)]]:_0x187924(0x257),[CmdRspCode[_0x187924(0x16b)]]:'session.room-full',[CmdRspCode[_0x187924(0x172)]]:'session.room-not-exists',[CmdRspCode[_0x187924(0x2b1)]]:_0x187924(0x1fb),[CmdRspCode['GLOBAL_ROOMS_CNT_EXCEEDS']]:'session.room-cnt-exceeds'};let CollaborationSession=class CollaborationSession extends RxDisposable{get['sessionStatus'](){const _0x7f8525=_0x187924;return this['_sessionStatus$'][_0x7f8525(0x1e3)]();}constructor(_0x5528d0,_0x560b0a,_0x38efd0,_0x404764,_0x54e9c4,_0x4fc0c1,_0x316145,_0x435af2){const _0x398b98=_0x187924;super(),this['_unitID']=_0x5528d0,this[_0x398b98(0x326)]=_0x38efd0,this['_configService']=_0x404764,this[_0x398b98(0x390)]=_0x54e9c4,this[_0x398b98(0x336)]=_0x4fc0c1,this[_0x398b98(0x24f)]=_0x316145,this[_0x398b98(0x240)]=_0x435af2,_defineProperty(this,'_sessionStatus$',new BehaviorSubject(SessionStatus[_0x398b98(0x253)])),_defineProperty(this,'sessionStatus$',this[_0x398b98(0x193)][_0x398b98(0x1e2)]()),_defineProperty(this,_0x398b98(0x32a),new Subject()),_defineProperty(this,_0x398b98(0x238),this['_event$'][_0x398b98(0x1e2)]()),_defineProperty(this,_0x398b98(0x154),void 0x0),_defineProperty(this,'_socketMessageSubscription',void 0x0),_defineProperty(this,'_collaborationTimeoutTimer',void 0x0),_defineProperty(this,_0x398b98(0x2b7),![]),_defineProperty(this,_0x398b98(0x37c),null),this[_0x398b98(0x2b7)]=!!this[_0x398b98(0x240)],_0x560b0a['pipe'](takeUntil(this[_0x398b98(0x1f2)]))[_0x398b98(0x352)](_0x2c33b9=>{const _0x178c3e=_0x398b98;if(typeof _0x2c33b9===_0x178c3e(0x356))return;this[_0x178c3e(0x154)]=_0x2c33b9;if(_0x2c33b9)this[_0x178c3e(0x284)](_0x2c33b9),this[_0x178c3e(0x2da)]=_0x2c33b9[_0x178c3e(0x1e8)][_0x178c3e(0x352)](_0x30043f=>{const _0x2eb5d4=_0x178c3e;if(_0x30043f[_0x2eb5d4(0x2f9)]!==this[_0x2eb5d4(0x2e7)])return;this[_0x2eb5d4(0x26b)](_0x30043f);});else{var _0x4d94ee;this[_0x178c3e(0x19c)](),this[_0x178c3e(0x193)][_0x178c3e(0x1a5)](SessionStatus[_0x178c3e(0x184)]),(_0x4d94ee=this[_0x178c3e(0x2da)])===null||_0x4d94ee===void 0x0||_0x4d94ee[_0x178c3e(0x3b5)](),this[_0x178c3e(0x2da)]=null;}});}[_0x187924(0x2a0)](){const _0xb74b24=_0x187924;var _0x50863d,_0x3ef669;return(_0x50863d=(_0x3ef669=this[_0xb74b24(0x154)])===null||_0x3ef669===void 0x0?void 0x0:_0x3ef669[_0xb74b24(0x370)])!==null&&_0x50863d!==void 0x0?_0x50863d:null;}['dispose'](){const _0x2c7f0d=_0x187924;super[_0x2c7f0d(0x382)](),this['close'](),this[_0x2c7f0d(0x1f2)][_0x2c7f0d(0x1a5)](),this[_0x2c7f0d(0x1f2)][_0x2c7f0d(0x373)]();}[_0x187924(0x29b)](){const _0x578c08=_0x187924;var _0x16480f,_0x491f33;this[_0x578c08(0x19c)](),(_0x16480f=this[_0x578c08(0x154)])===null||_0x16480f===void 0x0||_0x16480f['send']({'cmd':CombCmd[_0x578c08(0x380)],'data':{'roomID':this[_0x578c08(0x2e7)]}}),(_0x491f33=this[_0x578c08(0x154)])===null||_0x491f33===void 0x0||_0x491f33[_0x578c08(0x29b)](),this[_0x578c08(0x32a)][_0x578c08(0x373)](),this[_0x578c08(0x193)][_0x578c08(0x373)]();}[_0x187924(0x26b)](_0x1fcaab){const _0x382c79=_0x187924;if(_0x1fcaab['cmd']===CombCmd[_0x382c79(0x37f)])this[_0x382c79(0x30f)](_0x1fcaab);else{if(_0x1fcaab['cmd']===CombCmd[_0x382c79(0x294)])this[_0x382c79(0x173)](_0x1fcaab);}}[_0x187924(0x284)](_0x147031){const _0x3fdb83=_0x187924;this['_sessionStatus$'][_0x3fdb83(0x1a5)](SessionStatus[_0x3fdb83(0x396)]),_0x147031[_0x3fdb83(0x358)]({'cmd':CombCmd['JOIN'],'routeKey':this[_0x3fdb83(0x2e7)],'routeType':'','data':{'rooms':[{'roomID':this[_0x3fdb83(0x2e7)]}]}});}[_0x187924(0x30f)](_0x585fc5){const _0xb5d3ce=_0x187924;var _0x29936f;if(_0x585fc5[_0xb5d3ce(0x268)]in FailedReason){this[_0xb5d3ce(0x24f)][_0xb5d3ce(0x313)]({'id':CollaborationUIEventId[_0xb5d3ce(0x2fa)],'data':FailedReason[_0x585fc5[_0xb5d3ce(0x268)]]}),this[_0xb5d3ce(0x193)][_0xb5d3ce(0x1a5)](SessionStatus['OFFLINE']);return;}this[_0xb5d3ce(0x193)]['next'](SessionStatus[_0xb5d3ce(0x33f)]);const _0x31a709=(_0x29936f=_0x585fc5[_0xb5d3ce(0x218)][_0xb5d3ce(0x2ab)][this[_0xb5d3ce(0x2e7)]])===null||_0x29936f===void 0x0?void 0x0:_0x29936f[_0xb5d3ce(0x1fd)];if(_0x31a709)_0x31a709[_0xb5d3ce(0x2e5)](_0x537d56=>this[_0xb5d3ce(0x390)][_0xb5d3ce(0x174)](this[_0xb5d3ce(0x2e7)],_0x537d56));}['_onRecvEvent'](_0x375204){const _0x591c57=_0x187924;try{const _0x13db2b=_0x375204[_0x591c57(0x218)];switch(_0x13db2b[_0x591c57(0x1bf)]){case CollaborationEvent[_0x591c57(0x2ef)]:this['_onUserJoin'](_0x13db2b),this[_0x591c57(0x32a)][_0x591c57(0x1a5)](_0x13db2b);break;case CollaborationEvent[_0x591c57(0x351)]:this['_onUserLeave'](_0x13db2b),this[_0x591c57(0x32a)][_0x591c57(0x1a5)](_0x13db2b);break;case CollaborationEvent[_0x591c57(0x31a)]:case CollaborationEvent['CHANGESET_SHOULD_RETRY']:this[_0x591c57(0x23e)](),this[_0x591c57(0x160)](),this[_0x591c57(0x32a)][_0x591c57(0x1a5)](_0x13db2b);break;case CollaborationEvent[_0x591c57(0x1d7)]:this[_0x591c57(0x326)][_0x591c57(0x28d)](_0x591c57(0x20a)+JSON[_0x591c57(0x394)](_0x13db2b)),this[_0x591c57(0x32a)][_0x591c57(0x1a5)](_0x13db2b);break;case CollaborationEvent[_0x591c57(0x36b)]:this[_0x591c57(0x336)][_0x591c57(0x36e)](_0x13db2b['data']),this['_event$'][_0x591c57(0x1a5)](_0x13db2b);break;default:this[_0x591c57(0x32a)][_0x591c57(0x1a5)](_0x13db2b);}}catch(_0x22e6b7){this[_0x591c57(0x326)][_0x591c57(0x28d)](_0x22e6b7,_0x375204);}}[_0x187924(0x22f)](_0x2cc6bc){const _0x3c215e=_0x187924;this['_memberService'][_0x3c215e(0x174)](this['_unitID'],_0x2cc6bc[_0x3c215e(0x218)]);}['_onUserLeave'](_0x48d8bd){const _0x5f5bfb=_0x187924;this['_memberService'][_0x5f5bfb(0x2bf)](this['_unitID'],_0x48d8bd[_0x5f5bfb(0x218)][_0x5f5bfb(0x370)]);}async['send'](_0x4f83c4,_0x5bfe25){const _0x5c30a9=_0x187924;if(this[_0x5c30a9(0x182)]!==SessionStatus[_0x5c30a9(0x33f)]||!this[_0x5c30a9(0x154)])throw new Error(_0x5c30a9(0x344));try{_0x4f83c4['eventID']===CollaborationEvent[_0x5c30a9(0x2d4)]&&(this['_scheduleCollaborationTimeoutTimer'](),this['_startTelemetryCollaborationNewChangeset'](_0x4f83c4)),this['_socket'][_0x5c30a9(0x358)]({'cmd':CombCmd[_0x5c30a9(0x388)],'routeKey':_0x5bfe25,'routeType':'','data':_0x4f83c4});}catch(_0x2859ed){this[_0x5c30a9(0x326)]['error'](_0x2859ed);}}['_scheduleCollaborationTimeoutTimer'](){const _0x259483=_0x187924;var _0x563f74;this['_collaborationTimeoutTimer']=setTimeout(()=>{const _0x3907d5=_0x5993;this[_0x3907d5(0x18e)]=null,this[_0x3907d5(0x24f)]['emitEvent']({'id':CollaborationUIEventId[_0x3907d5(0x245)]});},(_0x563f74=this['_configService'][_0x259483(0x281)]('HEARTBEAT_TIMEOUT'))!==null&&_0x563f74!==void 0x0?_0x563f74:DEFAULT_HEARTBEAT_TIMEOUT);}['_clearCollaborationTimeoutTimer'](){const _0x3f21cc=_0x187924;this['_collaborationTimeoutTimer']&&(clearTimeout(this['_collaborationTimeoutTimer']),this[_0x3f21cc(0x18e)]=null);}['_startTelemetryCollaborationNewChangeset'](_0xe3844e){const _0x4dfa6f=_0x187924;if(!this['_shouldReportTelemetry'])return;const {data:_0x5c2904}=_0xe3844e,{unitID:_0x129f44,changeset:_0x40724e}=_0x5c2904,{mutations:_0x500acf,type:_0x4ce7e1}=_0x40724e;this[_0x4dfa6f(0x37c)]={'unitId':_0x129f44,'type':_0x4ce7e1,'startTime':performance['now'](),'stopTime':0x0,'duration':0x0,'size':summaryChangesetSize(_0x500acf)};}[_0x187924(0x23e)](){const _0x4839b5=_0x187924;if(!this[_0x4839b5(0x2b7)])return;if(!this['_telemetryInfo']){this[_0x4839b5(0x326)][_0x4839b5(0x28d)]('[CollaborationSession]',_0x4839b5(0x26c));return;}this[_0x4839b5(0x37c)]['stopTime']=performance[_0x4839b5(0x30c)](),this[_0x4839b5(0x37c)][_0x4839b5(0x355)]=this[_0x4839b5(0x37c)][_0x4839b5(0x1ce)]-this[_0x4839b5(0x37c)][_0x4839b5(0x19e)],this[_0x4839b5(0x240)][_0x4839b5(0x329)](TELEMETRY_COLLABORATION_NEW_CHANGESET,this[_0x4839b5(0x37c)]),this[_0x4839b5(0x37c)]=null;}[_0x187924(0x19c)](){this['_telemetryInfo']=null;}};CollaborationSession=__decorate([__decorateParam(0x2,ILogService),__decorateParam(0x3,IConfigService),__decorateParam(0x4,Inject(MemberService)),__decorateParam(0x5,Inject(CommentService)),__decorateParam(0x6,Inject(CollaborationUIEventService)),__decorateParam(0x7,Optional(ITelemetryService))],CollaborationSession);const ILocalCacheService=createIdentifier('collaboration-client.local-cache-service');function getLocalCacheKey(_0x2a3403){return'unit-cache-'+_0x2a3403;}function extractTargetFromFirstChangeset(_0x53cc71){const _0x3e7587=_0x187924,{unitID:_0x30aa67,mutations:_0x2d3a2a}=_0x53cc71;return{'unitId':_0x30aa67,'subUnitId':_0x2d3a2a[_0x3e7587(0x35a)]>0x0?_0x2d3a2a[0x0]['params'][_0x3e7587(0x360)]:null};}let SheetTransformSelectionsService=class SheetTransformSelectionsService{constructor(_0x5ab3e5,_0x38c049,_0x35c78d){const _0x5f45f3=_0x187924;this['_injector']=_0x5ab3e5,this[_0x5f45f3(0x248)]=_0x38c049,this[_0x5f45f3(0x1ac)]=_0x35c78d;}[_0x187924(0x307)](_0x52f404){const _0x5e7a23=_0x187924;var _0x596a60,_0x3981bb;const _0x371025=this[_0x5e7a23(0x32d)][_0x5e7a23(0x21d)](SheetsSelectionsService),{unitId:_0x4003af,subUnitId:_0x2b8bc2}=extractTargetFromFirstChangeset(_0x52f404),_0x31b0a7=_0x371025===null||_0x371025===void 0x0?void 0x0:_0x371025['getWorkbookSelections'](_0x4003af)['getCurrentSelections'](),_0x4e5819=(_0x596a60=this[_0x5e7a23(0x1ac)]['getUnit'](_0x4003af))===null||_0x596a60===void 0x0||(_0x596a60=_0x596a60[_0x5e7a23(0x22b)]())===null||_0x596a60===void 0x0?void 0x0:_0x596a60[_0x5e7a23(0x1ef)]();if(_0x31b0a7[_0x5e7a23(0x35a)]===0x0||!_0x4003af||!_0x2b8bc2)return;const _0x203c22=[{'id':SetSelectionsOperation['id'],'params':{'unitId':_0x4003af,'subUnitId':_0x4e5819,'selections':Tools[_0x5e7a23(0x1f1)](_0x31b0a7)}}],_0x37e7e1=this[_0x5e7a23(0x248)][_0x5e7a23(0x30e)](_0x52f404,_0x203c22);if(!isTransformMutationsWithChangesetSuccess(_0x37e7e1))throw _0x37e7e1[_0x5e7a23(0x28d)];const _0x21bd2a=(_0x3981bb=_0x37e7e1['m2Prime'][0x0])===null||_0x3981bb===void 0x0||(_0x3981bb=_0x3981bb[_0x5e7a23(0x300)])===null||_0x3981bb===void 0x0?void 0x0:_0x3981bb[_0x5e7a23(0x1d0)];if(Array[_0x5e7a23(0x399)](_0x21bd2a)&&_0x21bd2a[_0x5e7a23(0x35a)]){if(_0x21bd2a[_0x5e7a23(0x35a)]===_0x203c22[0x0][_0x5e7a23(0x300)][_0x5e7a23(0x1d0)]['length']&&_0x21bd2a[_0x5e7a23(0x330)]((_0x288df8,_0x28a99e)=>Rectangle['equals'](_0x288df8[_0x5e7a23(0x229)],_0x203c22[0x0]['params'][_0x5e7a23(0x1d0)][_0x28a99e][_0x5e7a23(0x229)])))return;this[_0x5e7a23(0x32d)][_0x5e7a23(0x21d)](ICommandService)[_0x5e7a23(0x259)](SetSelectionsOperation['id'],{'unitId':_0x4003af,'subUnitId':_0x4e5819,'selections':_0x21bd2a});}}};SheetTransformSelectionsService=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,ITransformService),__decorateParam(0x2,IUniverInstanceService)],SheetTransformSelectionsService);const ISingleActiveUnitService=createIdentifier('univer-pro.collaboration-client.single-active-unit-service');let UnitStatus=function(_0x524e47){const _0x30b7d5=_0x187924;return _0x524e47[_0x524e47['NO_OTHER_CLIENTS_EDITING']=0x0]='NO_OTHER_CLIENTS_EDITING',_0x524e47[_0x524e47[_0x30b7d5(0x16c)]=0x1]='OTHER_CLIENTS_EDITING',_0x524e47;}({});const COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY=_0x187924(0x1c8),configSymbol=Symbol(COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),defaultPluginConfig={};function isSplitChunkMutation(_0x3da950){const _0x43dc9c=_0x187924;var _0x5de16e;return!!((_0x5de16e=_0x3da950[_0x43dc9c(0x300)])===null||_0x5de16e===void 0x0?void 0x0:_0x5de16e['__splitChunk__']);}const SINGLE_CHANGESET_MUTATIONS=new Set([InsertSheetMutation['id']]);function assembleSheetChangeset(_0x3c5b33,_0x1b4092,_0x6b24c3,_0x37f099,_0x1ff0c3){const _0x517bb5=_0x187924;var _0x13b99b,_0x3154fa,_0x55698b,_0x25aa35;const _0x1184ee=[];for(const _0xe065 of _0x3c5b33){if(SINGLE_CHANGESET_MUTATIONS[_0x517bb5(0x30a)](_0xe065['id'])){if(_0x1184ee[_0x517bb5(0x35a)]>0x0)break;_0x1184ee[_0x517bb5(0x374)](_0xe065);break;}if(isSplitChunkMutation(_0xe065)){if(_0x1184ee['length']>0x0)break;_0x1184ee[_0x517bb5(0x374)](_0xe065);break;}_0x1184ee[_0x517bb5(0x374)](_0xe065);}const _0x852389=(_0x13b99b=(_0x3154fa=_0x1ff0c3[_0x517bb5(0x311)]())===null||_0x3154fa===void 0x0?void 0x0:_0x3154fa[_0x517bb5(0x2dc)])!==null&&_0x13b99b!==void 0x0?_0x13b99b:_0x517bb5(0x214),_0x50f895=(_0x55698b=(_0x25aa35=_0x1ff0c3[_0x517bb5(0x311)]())===null||_0x25aa35===void 0x0?void 0x0:_0x25aa35[_0x517bb5(0x370)])!==null&&_0x55698b!==void 0x0?_0x55698b:_0x517bb5(0x214);return{'changeset':{'unitID':_0x1b4092,'type':mapDocumentTypeToUniverInstanceType(_0x6b24c3[_0x517bb5(0x2eb)](_0x1b4092)),'baseRev':_0x37f099[_0x517bb5(0x266)](_0x1b4092),'revision':0x0,'userID':_0x852389,'memberID':_0x50f895,'mutations':_0x1184ee},'pendingMutations':_0x3c5b33[_0x517bb5(0x258)](_0x1184ee[_0x517bb5(0x35a)])};}function assembleDocChangeset(_0x43dc4d,_0x285f4b,_0xc5333d,_0x180806,_0x29c33d){const _0x31f2aa=_0x187924;var _0x378097,_0x12924c,_0x236975,_0x22ebe3;const _0x5f2879=[_0x43dc4d[_0x31f2aa(0x35f)]((_0x314afd,_0x189f80)=>{const _0x5c90f3=_0x31f2aa;var _0x412a5c;const {id:_0x51ee1e}=_0x314afd,{id:_0x59d3c5,type:_0x59504e}=_0x189f80,_0x132819=(_0x412a5c=_0x314afd['params'])!==null&&_0x412a5c!==void 0x0?_0x412a5c:{'actions':null},_0x59966f=_0x189f80['params'];if(_0x51ee1e&&_0x51ee1e!==_0x59d3c5)throw new Error(_0x5c90f3(0x23f)+_0x51ee1e+'\x20-\x20'+_0x59d3c5+'.');return{..._0x314afd,'id':_0x59d3c5,'type':_0x59504e,'params':{'unitId':_0x59966f[_0x5c90f3(0x265)],'textRanges':_0x59966f[_0x5c90f3(0x33b)],'actions':JSONX[_0x5c90f3(0x292)](_0x132819[_0x5c90f3(0x1bb)],_0x59966f['actions'])}};},{})],_0x552dc2=(_0x378097=(_0x12924c=_0x29c33d[_0x31f2aa(0x311)]())===null||_0x12924c===void 0x0?void 0x0:_0x12924c['userID'])!==null&&_0x378097!==void 0x0?_0x378097:_0x31f2aa(0x214),_0x24f97e=(_0x236975=(_0x22ebe3=_0x29c33d[_0x31f2aa(0x311)]())===null||_0x22ebe3===void 0x0?void 0x0:_0x22ebe3[_0x31f2aa(0x370)])!==null&&_0x236975!==void 0x0?_0x236975:'unknown';return{'changeset':{'unitID':_0x285f4b,'type':mapDocumentTypeToUniverInstanceType(_0xc5333d['getUnitType'](_0x285f4b)),'baseRev':_0x180806[_0x31f2aa(0x266)](_0x285f4b),'revision':0x0,'userID':_0x552dc2,'memberID':_0x24f97e,'mutations':_0x5f2879},'pendingMutations':[]};}function createTimerObservable$(_0x52ae7c,_0x1c8626){const _0x5e8096=_0x187924,_0x5f24df=new ReplaySubject(0x1);return setTimeout(()=>_0x5f24df[_0x5e8096(0x1a5)](_0x1c8626),_0x52ae7c),_0x5f24df[_0x5e8096(0x1e2)]()[_0x5e8096(0x386)](take(0x1));}var _PendingState,_AwaitingState,_AwaitingWithPendingState;let CollaborationStatus=function(_0x9957fc){const _0x5dc481=_0x187924;return _0x9957fc[_0x5dc481(0x2a6)]=_0x5dc481(0x332),_0x9957fc['SYNCED']=_0x5dc481(0x297),_0x9957fc[_0x5dc481(0x1ee)]=_0x5dc481(0x1e4),_0x9957fc[_0x5dc481(0x207)]='awaiting',_0x9957fc[_0x5dc481(0x15d)]=_0x5dc481(0x23a),_0x9957fc['FETCH_MISS']='fetch_missing',_0x9957fc[_0x5dc481(0x39e)]=_0x5dc481(0x1b5),_0x9957fc['OFFLINE']=_0x5dc481(0x2dd),_0x9957fc;}({});const MAX_RETRY_TIMEOUT=0x4e20,MAX_RETRY_TOTAL_TIMEOUT=0x2bf20;var CollaborationState=class{constructor(_0x56ed2b,_0x5d214d,_0xd9bd6,_0xe5c8b6,_0x2e04fb,_0x241d38,_0x13f41d,_0x3d571e,_0x47e807){const _0x5a6952=_0x187924;this[_0x5a6952(0x364)]=_0x56ed2b,this[_0x5a6952(0x19f)]=_0x5d214d,this[_0x5a6952(0x334)]=_0x2e04fb,this[_0x5a6952(0x2be)]=_0x241d38,this[_0x5a6952(0x1ae)]=_0x13f41d,this['_revisionService']=_0x3d571e,this[_0x5a6952(0x163)]=_0x47e807,_defineProperty(this,_0x5a6952(0x2a5),null),_defineProperty(this,_0x5a6952(0x2c8),[]),this[_0x5a6952(0x2a5)]=_0xd9bd6,this['_pendingMutations']=_0xe5c8b6;}[_0x187924(0x2d7)](_0x11000c){const _0x22d1ae=_0x187924,_0x483cef=this[_0x22d1ae(0x28e)]['getCurrentRevOfUnit'](this[_0x22d1ae(0x364)]);if(_0x11000c['revision']>_0x483cef+0x1)return this[_0x22d1ae(0x334)]['onMissingChangesets']({'from':_0x483cef,'to':_0x11000c[_0x22d1ae(0x20e)]-0x1}),!![];return![];}['_transformUndoredo'](_0x356176){const _0x2e1ac0=_0x187924;this['_undoRedoService'][_0x2e1ac0(0x22d)](this[_0x2e1ac0(0x364)],_0x356176);}[_0x187924(0x306)](_0x1c7db8){const _0x1d4036=_0x187924;var _0x5709d5,_0x81b1dc;(_0x5709d5=(_0x81b1dc=this['_handler'])[_0x1d4036(0x3ab)])===null||_0x5709d5===void 0x0||_0x5709d5[_0x1d4036(0x1f5)](_0x81b1dc,_0x1c7db8);}[_0x187924(0x269)](_0x419500){const _0xb13862=_0x187924;var _0x432579,_0x2dc6c7;return(_0x432579=(_0x2dc6c7=this[_0xb13862(0x334)])['onTransformIME'])===null||_0x432579===void 0x0?void 0x0:_0x432579[_0xb13862(0x1f5)](_0x2dc6c7,_0x419500);}['_transformStateCache'](_0x2a8742){const _0x47896d=_0x187924;var _0x2c6b56,_0x12454f;return(_0x2c6b56=(_0x12454f=this[_0x47896d(0x334)])['onTransformState'])===null||_0x2c6b56===void 0x0?void 0x0:_0x2c6b56[_0x47896d(0x1f5)](_0x12454f,_0x2a8742);}[_0x187924(0x304)](_0x15bc23){const _0xa1ee6f=_0x187924;var _0x561f26,_0x3c5ce3,_0x4b5680;return(_0x561f26=(_0x3c5ce3=(_0x4b5680=this[_0xa1ee6f(0x334)])['onTransformRemoteChangesetByIMECache'])===null||_0x3c5ce3===void 0x0?void 0x0:_0x3c5ce3['call'](_0x4b5680,_0x15bc23))!==null&&_0x561f26!==void 0x0?_0x561f26:_0x15bc23;}['_transformRemoteChangesetByStateCache'](_0x1715cb){const _0x2f6d11=_0x187924;var _0x21c008,_0x1a81d5,_0x256d41;return(_0x21c008=(_0x1a81d5=(_0x256d41=this[_0x2f6d11(0x334)])[_0x2f6d11(0x315)])===null||_0x1a81d5===void 0x0?void 0x0:_0x1a81d5['call'](_0x256d41,_0x1715cb))!==null&&_0x21c008!==void 0x0?_0x21c008:_0x1715cb;}[_0x187924(0x25a)](_0x257271){const _0x2db30b=_0x187924;if(this[_0x2db30b(0x19f)]===UniverInstanceType[_0x2db30b(0x2cf)]){const {unitID:_0x1e72a1,mutations:_0x248f35,memberID:_0x2924ca}=_0x257271,_0x14a0d6=_0x248f35[_0x2db30b(0x35a)]>0x0?_0x248f35[0x0]['params'][_0x2db30b(0x33b)]:[];if(Array[_0x2db30b(0x399)](_0x14a0d6)&&_0x14a0d6[_0x2db30b(0x35a)]>0x0){var _0x45e1d7,_0x245d3a;(_0x45e1d7=(_0x245d3a=this[_0x2db30b(0x334)])[_0x2db30b(0x1c1)])===null||_0x45e1d7===void 0x0||_0x45e1d7[_0x2db30b(0x1f5)](_0x245d3a,{'unitID':_0x1e72a1,'memberID':_0x2924ca,'textRanges':_0x14a0d6});}}}[_0x187924(0x2ee)](){const _0x4a20c1=_0x187924;var _0x10c0c2;(_0x10c0c2=this[_0x4a20c1(0x163)])===null||_0x10c0c2===void 0x0||_0x10c0c2['updateOfflineData'](this[_0x4a20c1(0x364)],this[_0x4a20c1(0x19f)],this[_0x4a20c1(0x2a5)],this[_0x4a20c1(0x2c8)]);}[_0x187924(0x21b)](){const _0x59e931=_0x187924;return this['_revisionService'][_0x59e931(0x266)](this[_0x59e931(0x364)]);}[_0x187924(0x24c)](){const _0x3b313e=_0x187924;this[_0x3b313e(0x28e)][_0x3b313e(0x3a9)](this[_0x3b313e(0x364)]);}[_0x187924(0x35d)](_0x4a1e73){const _0x32e76f=_0x187924;let _0x564083=this['_transformRemoteChangesetByIMECache'](_0x4a1e73);_0x564083=this['_transformRemoteChangesetByStateCache'](_0x564083);const _0x231f00=sequenceExecute(_0x564083[_0x32e76f(0x36c)],this[_0x32e76f(0x2be)],{'fromCollab':!![]});if(!_0x231f00[_0x32e76f(0x2aa)]){var _0x273fe8;if(_0x231f00[_0x32e76f(0x28d)]instanceof Error)throw _0x231f00[_0x32e76f(0x28d)];throw new Error((_0x273fe8=_0x231f00[_0x32e76f(0x28d)])!==null&&_0x273fe8!==void 0x0?_0x273fe8:'[CollaborationState]:\x20apply\x20error!');}this[_0x32e76f(0x269)](_0x564083),this['_transformStateCache'](_0x564083),this[_0x32e76f(0x1f3)](_0x4a1e73),this[_0x32e76f(0x306)](_0x564083),this['_syncEditingCollabCursor'](_0x564083),this[_0x32e76f(0x24c)]();}};let SyncedState=class SyncedState extends CollaborationState{constructor(_0x2e3b47,_0x44f941,_0x379ba2,_0x23545b,_0x14e1d1,_0xa84dc2,_0x25e3bf,_0x2d686a,_0x387cf8,_0x4efbc2){const _0x5a73fc=_0x187924;super(_0x2e3b47,_0x44f941,null,[],_0x379ba2,_0x25e3bf,_0xa84dc2,_0x23545b,_0x4efbc2),this['_injector']=_0x14e1d1,this[_0x5a73fc(0x326)]=_0x2d686a,this[_0x5a73fc(0x248)]=_0x387cf8,this[_0x5a73fc(0x3a3)]=_0x4efbc2,_defineProperty(this,_0x5a73fc(0x260),CollaborationStatus[_0x5a73fc(0x1e6)]);}[_0x187924(0x34a)](_0x1602ba){const _0x56178b=_0x187924,_0x1dee83=this[_0x56178b(0x32d)][_0x56178b(0x369)](PendingState,this[_0x56178b(0x364)],this['type'],[_0x1602ba],this['_handler']);return _0x1dee83['_schedule'](),_0x1dee83[_0x56178b(0x2ee)](),_0x1dee83;}[_0x187924(0x22c)](_0x4e4f1a){const _0x4c539f=_0x187924;if(this[_0x4c539f(0x2d7)](_0x4e4f1a))return this[_0x4c539f(0x32d)][_0x4c539f(0x369)](FetchingMissState,this[_0x4c539f(0x364)],this[_0x4c539f(0x19f)],null,[],null,[_0x4e4f1a],this[_0x4c539f(0x334)]);try{const _0x59cfb1=this['_transformService'][_0x4c539f(0x30e)](_0x4e4f1a,[EmptyMutationInfo]);if(isTransformMutationsWithChangesetSuccess(_0x59cfb1)){const {c1Prime:_0x11cdf5}=_0x59cfb1;return this['_executeRemoteChangeset'](_0x11cdf5),this;}throw _0x59cfb1[_0x4c539f(0x28d)];}catch(_0x3cb709){return this[_0x4c539f(0x326)][_0x4c539f(0x28d)](_0x3cb709),this[_0x4c539f(0x15e)](![]);}}['_onConflict'](_0x1d2a77){const _0x30212d=_0x187924;return this[_0x30212d(0x32d)]['createInstance'](ConflictState,this['unitID'],this[_0x30212d(0x19f)],null,[],this[_0x30212d(0x334)],_0x1d2a77);}[_0x187924(0x27d)](){const _0x3620d8=_0x187924;throw new Error(_0x3620d8(0x35e));}[_0x187924(0x303)](){throw new Error('[SyncedState]:\x20received\x20rejection.');}[_0x187924(0x24d)](){return this;}['toggleOffline'](){const _0x4d4be5=_0x187924;return this[_0x4d4be5(0x32d)][_0x4d4be5(0x369)](OfflineState,this[_0x4d4be5(0x364)],this['type'],null,[],this[_0x4d4be5(0x334)]);}['toggleOnline'](){return this;}[_0x187924(0x1cd)](){const _0x5bc2dc=_0x187924;throw new Error(_0x5bc2dc(0x227));}[_0x187924(0x2fb)](){const _0x26212a=_0x187924,_0x1c328d=this[_0x26212a(0x28e)]['getCurrentRevOfUnit'](this[_0x26212a(0x364)]);return this['_handler'][_0x26212a(0x168)]({'from':_0x1c328d,'to':0x0}),this[_0x26212a(0x32d)][_0x26212a(0x369)](FetchingMissState,this[_0x26212a(0x364)],this[_0x26212a(0x19f)],null,[],null,[],this['_handler']);}};SyncedState=__decorate([__decorateParam(0x3,Inject(RevisionService)),__decorateParam(0x4,Inject(Injector)),__decorateParam(0x5,IUndoRedoService),__decorateParam(0x6,ICommandService),__decorateParam(0x7,ILogService),__decorateParam(0x8,ITransformService),__decorateParam(0x9,Optional(ILocalCacheService))],SyncedState);let PendingState=_PendingState=class PendingState extends CollaborationState{constructor(_0x2344e8,_0x5521ab,_0x3ef723,_0x43ee1d,_0x200756,_0x1ac7b5,_0x33859e,_0x162864,_0x5e31f3,_0x45ee1d,_0x3f5c35,_0x57f081,_0x44e285,_0x3bc9b8){const _0x4277ca=_0x187924;super(_0x2344e8,_0x5521ab,null,_0x3ef723,_0x43ee1d,_0x5e31f3,_0x44e285,_0x1ac7b5,_0x3bc9b8),this[_0x4277ca(0x32d)]=_0x200756,this[_0x4277ca(0x390)]=_0x33859e,this['_logService']=_0x162864,this[_0x4277ca(0x241)]=_0x45ee1d,this[_0x4277ca(0x248)]=_0x3f5c35,this['_univerInstanceService']=_0x57f081,_defineProperty(this,'status',CollaborationStatus[_0x4277ca(0x1ee)]),_defineProperty(this,_0x4277ca(0x2d2),null),_defineProperty(this,_0x4277ca(0x166),null);}['appendMutation'](_0x56d767){const _0x44f682=_0x187924;return this[_0x44f682(0x2c8)]['push'](_0x56d767),this['_updateLocalCache'](),this;}['onRemoteChangeset'](_0x367943){const _0x9bd3c8=_0x187924;if(this[_0x9bd3c8(0x2d7)](_0x367943))return this[_0x9bd3c8(0x2af)](),this[_0x9bd3c8(0x32d)][_0x9bd3c8(0x369)](FetchingMissState,this[_0x9bd3c8(0x364)],this[_0x9bd3c8(0x19f)],null,this[_0x9bd3c8(0x2c8)],null,[_0x367943],this[_0x9bd3c8(0x334)]);try{const _0x54dec2=this[_0x9bd3c8(0x248)][_0x9bd3c8(0x30e)](_0x367943,this['_pendingMutations']);if(isTransformMutationsWithChangesetSuccess(_0x54dec2)){const {c1Prime:_0x274c9d,m2Prime:_0x1b15ad}=_0x54dec2;this[_0x9bd3c8(0x35d)](_0x274c9d);const _0x1099e0=this[_0x9bd3c8(0x32d)]['createInstance'](_PendingState,this[_0x9bd3c8(0x364)],this[_0x9bd3c8(0x19f)],_0x1b15ad,this[_0x9bd3c8(0x334)]);this['_clearScheduledTask']();const _0x1a60e5=new Date()[_0x9bd3c8(0x2b5)](),_0x4efc31=this[_0x9bd3c8(0x2d2)]?Math[_0x9bd3c8(0x20b)](this[_0x9bd3c8(0x2d2)]-_0x1a60e5,0x0):this[_0x9bd3c8(0x387)]();return _0x1099e0[_0x9bd3c8(0x2f2)](_0x4efc31),_0x1099e0;}throw _0x54dec2[_0x9bd3c8(0x28d)];}catch(_0x114ce0){return this['_logService'][_0x9bd3c8(0x28d)](_0x114ce0),this[_0x9bd3c8(0x15e)](![]);}}['onRemoteAck'](){const _0xab0848=_0x187924;throw new Error(_0xab0848(0x32e));}[_0x187924(0x303)](){const _0x38143b=_0x187924;throw new Error(_0x38143b(0x249));}[_0x187924(0x24d)](){return this;}[_0x187924(0x354)](){const _0x4b469f=_0x187924;return this[_0x4b469f(0x2af)](),this['_injector'][_0x4b469f(0x369)](OfflineState,this[_0x4b469f(0x364)],this[_0x4b469f(0x19f)],null,this[_0x4b469f(0x2c8)],this['_handler']);}[_0x187924(0x310)](){return this;}[_0x187924(0x2f2)](_0x3c4d55){const _0x29c8be=_0x187924,_0x12bfc5=_0x3c4d55!==null&&_0x3c4d55!==void 0x0?_0x3c4d55:this[_0x29c8be(0x387)]();this[_0x29c8be(0x2d2)]=new Date()[_0x29c8be(0x2b5)]()+_0x12bfc5,this['_sendingTimer']=setTimeout(()=>{const _0x15574b=_0x29c8be;this['_clearScheduledTask']();let _0x6ecbb7=null;switch(this['type']){case UniverInstanceType['UNIVER_SHEET']:_0x6ecbb7=assembleSheetChangeset(this['_pendingMutations'],this['unitID'],this[_0x15574b(0x2ad)],this['_revisionService'],this[_0x15574b(0x390)]);break;case UniverInstanceType[_0x15574b(0x2cf)]:if(this[_0x15574b(0x2c8)][_0x15574b(0x330)](_0x25762d=>_0x25762d['id']===RichTextEditingMutation['id']))_0x6ecbb7=assembleDocChangeset(this[_0x15574b(0x2c8)],this['unitID'],this[_0x15574b(0x2ad)],this[_0x15574b(0x28e)],this[_0x15574b(0x390)]);else _0x6ecbb7=assembleSheetChangeset(this[_0x15574b(0x2c8)],this['unitID'],this[_0x15574b(0x2ad)],this['_revisionService'],this[_0x15574b(0x390)]);break;default:throw new Error(_0x15574b(0x242)+this['type']+_0x15574b(0x180));}const {changeset:_0x3bf0eb,pendingMutations:_0x18c081}=_0x6ecbb7;this[_0x15574b(0x334)][_0x15574b(0x2ec)](_0x3bf0eb);const _0x5985c6=_0x18c081['length']?this[_0x15574b(0x32d)]['createInstance'](AwaitingWithPendingState,this[_0x15574b(0x364)],this[_0x15574b(0x19f)],_0x3bf0eb,_0x18c081,this['_handler'],void 0x0):this[_0x15574b(0x32d)][_0x15574b(0x369)](AwaitingState,this[_0x15574b(0x364)],this[_0x15574b(0x19f)],_0x3bf0eb,this[_0x15574b(0x334)]);_0x5985c6[_0x15574b(0x2ee)](),this[_0x15574b(0x334)][_0x15574b(0x24e)](this,_0x5985c6);},_0x12bfc5);}['_getSendChangesetTimeout'](){const _0xb68e6b=_0x187924;var _0x407567;const _0x4a77c7=this['_configService'][_0xb68e6b(0x281)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x407567=_0x4a77c7===null||_0x4a77c7===void 0x0?void 0x0:_0x4a77c7[_0xb68e6b(0x383)])!==null&&_0x407567!==void 0x0?_0x407567:DEFAULT_SEND_CHANGESET_TIMEOUT;}['resend'](){const _0x130feb=_0x187924;throw new Error(_0x130feb(0x368));}[_0x187924(0x2af)](){const _0x41e5d4=_0x187924;this[_0x41e5d4(0x166)]!=null&&(clearTimeout(this[_0x41e5d4(0x166)]),this[_0x41e5d4(0x166)]=null);}[_0x187924(0x15e)](_0x4181f9){const _0x2a8e10=_0x187924;return this[_0x2a8e10(0x2af)](),this[_0x2a8e10(0x32d)][_0x2a8e10(0x369)](ConflictState,this[_0x2a8e10(0x364)],this['type'],null,this[_0x2a8e10(0x2c8)],this[_0x2a8e10(0x334)],_0x4181f9);}};PendingState=_PendingState=__decorate([__decorateParam(0x4,Inject(Injector)),__decorateParam(0x5,Inject(RevisionService)),__decorateParam(0x6,Inject(MemberService)),__decorateParam(0x7,ILogService),__decorateParam(0x8,ICommandService),__decorateParam(0x9,IConfigService),__decorateParam(0xa,ITransformService),__decorateParam(0xb,IUniverInstanceService),__decorateParam(0xc,IUndoRedoService),__decorateParam(0xd,Optional(ILocalCacheService))],PendingState);let AwaitingState=_AwaitingState=class AwaitingState extends CollaborationState{constructor(_0x2186f4,_0x2e618b,_0xf32404,_0x46a7f0,_0x29f7f1,_0x5f3fd4,_0x2d321e,_0x401e56,_0x182558,_0x3ece25,_0x4dad5a){const _0x2b8a15=_0x187924;super(_0x2186f4,_0x2e618b,_0xf32404,[],_0x46a7f0,_0x2d321e,_0x3ece25,_0x5f3fd4,_0x4dad5a),this['_injector']=_0x29f7f1,this[_0x2b8a15(0x326)]=_0x401e56,this[_0x2b8a15(0x248)]=_0x182558,_defineProperty(this,'status',CollaborationStatus[_0x2b8a15(0x207)]),_defineProperty(this,_0x2b8a15(0x2f0),0x0),_defineProperty(this,_0x2b8a15(0x2f3),0x0),_defineProperty(this,_0x2b8a15(0x314),void 0x0),_defineProperty(this,'_sender',void 0x0);}[_0x187924(0x34a)](_0x4976e8){const _0x2c71e8=_0x187924;this[_0x2c71e8(0x2af)]();const _0x1183b3=this[_0x2c71e8(0x32d)][_0x2c71e8(0x369)](AwaitingWithPendingState,this[_0x2c71e8(0x364)],this[_0x2c71e8(0x19f)],this[_0x2c71e8(0x2a5)],[_0x4976e8],this[_0x2c71e8(0x334)],this[_0x2c71e8(0x314)]);return _0x1183b3['_updateLocalCache'](),_0x1183b3;}[_0x187924(0x22c)](_0x17be15){const _0xb2372b=_0x187924;if(this[_0xb2372b(0x2d7)](_0x17be15))return this[_0xb2372b(0x2af)](),this['_injector']['createInstance'](FetchingMissState,this[_0xb2372b(0x364)],this[_0xb2372b(0x19f)],this['_awaitingChangeset'],[],null,[_0x17be15],this[_0xb2372b(0x334)]);try{const _0x26c90f=this['_transformService'][_0xb2372b(0x19d)]([_0x17be15],[this['_awaitingChangeset']],![]);if(isTransformChangesetsSuccess(_0x26c90f)){const {c1Prime:_0x4ab373,c2Prime:_0x4ce481}=_0x26c90f;this[_0xb2372b(0x35d)](_0x4ab373[0x0]),_0x4ce481[0x0][_0xb2372b(0x267)]=this[_0xb2372b(0x21b)](),this[_0xb2372b(0x2af)]();const _0x11d3c5=this[_0xb2372b(0x32d)]['createInstance'](_AwaitingState,this['unitID'],this[_0xb2372b(0x19f)],_0x4ce481[0x0],this[_0xb2372b(0x334)]);return _0x11d3c5[_0xb2372b(0x2ee)](),_0x11d3c5;}return this[_0xb2372b(0x15e)](![]);}catch(_0x5bf8c0){return this['_logService']['error'](_0x5bf8c0),this[_0xb2372b(0x15e)](![]);}}[_0x187924(0x27d)](_0x4cad0c){const _0x197eff=_0x187924;this[_0x197eff(0x2af)]();const _0x2aedd7=this[_0x197eff(0x28e)]['getCurrentRevOfUnit'](this[_0x197eff(0x364)]);if(_0x4cad0c[_0x197eff(0x20e)]<_0x2aedd7-0x1)return this;if(this[_0x197eff(0x2d7)](_0x4cad0c))return this[_0x197eff(0x32d)][_0x197eff(0x369)](FetchingMissState,this[_0x197eff(0x364)],this[_0x197eff(0x19f)],null,[],this[_0x197eff(0x2a5)],[],this[_0x197eff(0x334)]);this['_incrementRevisionNumber']();const _0x4c252b=this[_0x197eff(0x32d)][_0x197eff(0x369)](SyncedState,this['unitID'],this['type'],this[_0x197eff(0x334)]);return _0x4c252b['_updateLocalCache'](),_0x4c252b;}[_0x187924(0x303)](_0xaec21f){const _0x27dec7=_0x187924;return this[_0x27dec7(0x15e)](!!(_0xaec21f===null||_0xaec21f===void 0x0?void 0x0:_0xaec21f['isPermissionRej']));}['onRemoteRetry'](_0x4dbb22){const _0x4c0289=_0x187924;if(this[_0x4c0289(0x2f3)]>MAX_RETRY_TOTAL_TIMEOUT)return this[_0x4c0289(0x354)]();return this[_0x4c0289(0x314)]=createTimerObservable$(this[_0x4c0289(0x2f0)],{'timeout':this[_0x4c0289(0x2f0)],'reqId':_0x4dbb22[_0x4c0289(0x282)]}),this[_0x4c0289(0x391)]=this[_0x4c0289(0x314)][_0x4c0289(0x352)](({reqId:_0x5d59db,timeout:_0x2facd4})=>{const _0x351e6f=_0x4c0289;this[_0x351e6f(0x1d6)](_0x5d59db,_0x2facd4);}),this;}[_0x187924(0x354)](){const _0x40b018=_0x187924;return this[_0x40b018(0x2af)](),this['_injector'][_0x40b018(0x369)](OfflineState,this['unitID'],this[_0x40b018(0x19f)],this[_0x40b018(0x2a5)],[],this[_0x40b018(0x334)]);}[_0x187924(0x310)](){return this;}[_0x187924(0x1cd)](){const _0x27b0d2=_0x187924;this[_0x27b0d2(0x334)]['onSendChangeset'](this['_awaitingChangeset']);}['_onConflict'](_0x59d25d){const _0x1b420c=_0x187924;return this[_0x1b420c(0x2af)](),this[_0x1b420c(0x32d)]['createInstance'](ConflictState,this[_0x1b420c(0x364)],this[_0x1b420c(0x19f)],this[_0x1b420c(0x2a5)],[],this[_0x1b420c(0x334)],_0x59d25d);}['_resendWithTimeout'](_0x16fa02,_0x32fa88){const _0x3f74e9=_0x187924;var _0x5a67a8;_0x16fa02===((_0x5a67a8=this[_0x3f74e9(0x2a5)])===null||_0x5a67a8===void 0x0?void 0x0:_0x5a67a8[_0x3f74e9(0x282)])&&(this['resend'](),this[_0x3f74e9(0x2f0)]=_0x32fa88===0x0?0x3e8:Math['min'](_0x32fa88*0x2,MAX_RETRY_TIMEOUT),this['_maxTotalRetryTimeout']+=this[_0x3f74e9(0x2f0)]);}[_0x187924(0x2af)](){const _0x393982=_0x187924;var _0x5926e7;(_0x5926e7=this[_0x393982(0x391)])===null||_0x5926e7===void 0x0||_0x5926e7['unsubscribe'](),this[_0x393982(0x2f0)]=0x0,this[_0x393982(0x2f3)]=0x0;}};AwaitingState=_AwaitingState=__decorate([__decorateParam(0x4,Inject(Injector)),__decorateParam(0x5,Inject(RevisionService)),__decorateParam(0x6,ICommandService),__decorateParam(0x7,ILogService),__decorateParam(0x8,ITransformService),__decorateParam(0x9,IUndoRedoService),__decorateParam(0xa,Optional(ILocalCacheService))],AwaitingState);let AwaitingWithPendingState=_AwaitingWithPendingState=class AwaitingWithPendingState extends CollaborationState{constructor(_0x105a02,_0x10cc13,_0x26ccb2,_0x2fc0eb,_0x1ca2c5,_0x25c94b,_0x150971,_0x15103b,_0x8d756e,_0xc6ff7a,_0x36573a,_0x4d3a56,_0x4a6c60){const _0x5b3e3d=_0x187924;super(_0x105a02,_0x10cc13,_0x26ccb2,_0x2fc0eb,_0x1ca2c5,_0x8d756e,_0x4d3a56,_0x15103b,_0x4a6c60),this[_0x5b3e3d(0x32d)]=_0x150971,this[_0x5b3e3d(0x326)]=_0xc6ff7a,this['_transformService']=_0x36573a,this[_0x5b3e3d(0x3a3)]=_0x4a6c60,_defineProperty(this,_0x5b3e3d(0x260),CollaborationStatus['AWAITING_WITH_PENDING']),_defineProperty(this,_0x5b3e3d(0x2f0),0x0),_defineProperty(this,_0x5b3e3d(0x2f3),0x0),_defineProperty(this,'_resendTimer',void 0x0),_defineProperty(this,_0x5b3e3d(0x391),void 0x0),_0x25c94b&&(this[_0x5b3e3d(0x314)]=_0x25c94b,this[_0x5b3e3d(0x391)]=this['_resendTimer']['subscribe'](({reqId:_0xba8ea8,timeout:_0x4cd285})=>{this['_resendWithTimeout'](_0xba8ea8,_0x4cd285);}));}[_0x187924(0x34a)](_0x4967f5){const _0x3a487c=_0x187924;return this[_0x3a487c(0x2c8)][_0x3a487c(0x374)](_0x4967f5),this;}[_0x187924(0x22c)](_0x46cf14){const _0xbdef50=_0x187924;if(this[_0xbdef50(0x2d7)](_0x46cf14))return this[_0xbdef50(0x2af)](),this['_injector'][_0xbdef50(0x369)](FetchingMissState,this['unitID'],this[_0xbdef50(0x19f)],this[_0xbdef50(0x2a5)],this[_0xbdef50(0x2c8)],null,[_0x46cf14],this['_handler']);try{const _0x374313=this['_transformService'][_0xbdef50(0x19d)]([_0x46cf14],[this['_awaitingChangeset']],![]);if(isTransformChangesetsSuccess(_0x374313)){const {c1Prime:_0x1f8cb6,c2Prime:_0x5f3a68}=_0x374313,_0x370004=this[_0xbdef50(0x248)][_0xbdef50(0x30e)](_0x1f8cb6[0x0],this['_pendingMutations']);if(isTransformMutationsWithChangesetSuccess(_0x370004)){const {c1Prime:_0x281249,m2Prime:_0x5e9824}=_0x370004;return this[_0xbdef50(0x35d)](_0x281249),_0x5f3a68[0x0]['baseRev']=this['_getCurrentRevision'](),this['_clearScheduledTask'](),this[_0xbdef50(0x32d)][_0xbdef50(0x369)](_AwaitingWithPendingState,this[_0xbdef50(0x364)],this[_0xbdef50(0x19f)],_0x5f3a68[0x0],_0x5e9824,this[_0xbdef50(0x334)],void 0x0);}throw _0x370004['error'];}throw _0x374313[_0xbdef50(0x28d)];}catch(_0xf17671){return this[_0xbdef50(0x326)][_0xbdef50(0x28d)](_0xf17671),this['_onConflict'](![]);}}['onRemoteAck'](_0x23c59c){const _0x38ee15=_0x187924;this[_0x38ee15(0x2af)]();if(this['_checkMissing'](_0x23c59c))return this['_injector'][_0x38ee15(0x369)](FetchingMissState,this[_0x38ee15(0x364)],this[_0x38ee15(0x19f)],null,this['_pendingMutations'],this[_0x38ee15(0x2a5)],[],this[_0x38ee15(0x334)]);this[_0x38ee15(0x24c)]();const _0x1d2e50=this[_0x38ee15(0x32d)][_0x38ee15(0x369)](PendingState,this['unitID'],this[_0x38ee15(0x19f)],this[_0x38ee15(0x2c8)],this[_0x38ee15(0x334)]);return _0x1d2e50[_0x38ee15(0x2f2)](),_0x1d2e50[_0x38ee15(0x2ee)](),_0x1d2e50;}[_0x187924(0x303)](_0x1cfe5c){const _0x53b4d8=_0x187924;return this[_0x53b4d8(0x15e)](!!(_0x1cfe5c===null||_0x1cfe5c===void 0x0?void 0x0:_0x1cfe5c[_0x53b4d8(0x15f)]));}[_0x187924(0x24d)](_0x3482e8){const _0xa983ee=_0x187924;if(this[_0xa983ee(0x2f3)]>MAX_RETRY_TOTAL_TIMEOUT)return this['toggleOffline']();return this[_0xa983ee(0x314)]=createTimerObservable$(this[_0xa983ee(0x2f0)],{'timeout':this[_0xa983ee(0x2f0)],'reqId':_0x3482e8[_0xa983ee(0x282)]}),this[_0xa983ee(0x391)]=this['_resendTimer'][_0xa983ee(0x352)](({reqId:_0x8e98db,timeout:_0x5a4122})=>{const _0x3b46a2=_0xa983ee;this[_0x3b46a2(0x1d6)](_0x8e98db,_0x5a4122);}),this;}[_0x187924(0x354)](){const _0x347382=_0x187924;return this[_0x347382(0x2af)](),this[_0x347382(0x32d)][_0x347382(0x369)](OfflineState,this[_0x347382(0x364)],this[_0x347382(0x19f)],this['_awaitingChangeset'],this[_0x347382(0x2c8)],this[_0x347382(0x334)]);}[_0x187924(0x310)](){return this;}[_0x187924(0x1cd)](){const _0x1ddd84=_0x187924;this[_0x1ddd84(0x334)][_0x1ddd84(0x2ec)](this[_0x1ddd84(0x2a5)]);}['_onConflict'](_0x103ce2){const _0x15f458=_0x187924;return this[_0x15f458(0x2af)](),this[_0x15f458(0x32d)][_0x15f458(0x369)](ConflictState,this[_0x15f458(0x364)],this[_0x15f458(0x19f)],null,this[_0x15f458(0x2c8)],this['_handler'],_0x103ce2);}[_0x187924(0x1d6)](_0x531056,_0x2ab2fa){const _0x55e66a=_0x187924;var _0x5c33cf;_0x531056===((_0x5c33cf=this[_0x55e66a(0x2a5)])===null||_0x5c33cf===void 0x0?void 0x0:_0x5c33cf[_0x55e66a(0x282)])&&(this[_0x55e66a(0x1cd)](),this[_0x55e66a(0x2f0)]=_0x2ab2fa===0x0?0x3e8:Math[_0x55e66a(0x25b)](_0x2ab2fa*0x2,MAX_RETRY_TIMEOUT),this[_0x55e66a(0x2f3)]+=this[_0x55e66a(0x2f0)]);}[_0x187924(0x2af)](){const _0x43ad59=_0x187924;var _0x40220b;(_0x40220b=this['_sender'])===null||_0x40220b===void 0x0||_0x40220b[_0x43ad59(0x3b5)](),this[_0x43ad59(0x2f0)]=0x0,this['_maxTotalRetryTimeout']=0x0;}};AwaitingWithPendingState=_AwaitingWithPendingState=__decorate([__decorateParam(0x6,Inject(Injector)),__decorateParam(0x7,Inject(RevisionService)),__decorateParam(0x8,ICommandService),__decorateParam(0x9,ILogService),__decorateParam(0xa,ITransformService),__decorateParam(0xb,IUndoRedoService),__decorateParam(0xc,Optional(ILocalCacheService))],AwaitingWithPendingState);let ConflictState=class ConflictState extends CollaborationState{constructor(_0x1b729a,_0x5e112c,_0x2cf33,_0x186057,_0x13b0c4,_0x2e288a=![],_0x2cf605,_0x4c8e63,_0x25045e,_0x23630b,_0xbc321d,_0x4d48dd,_0x20ece0){const _0x26b882=_0x187924;super(_0x1b729a,_0x5e112c,_0x2cf33,_0x186057,_0x13b0c4,_0x4c8e63,_0x25045e,_0x23630b,_0x20ece0),this['_isPermissionRej']=_0x2e288a,this[_0x26b882(0x2e8)]=_0x2cf605,this[_0x26b882(0x252)]=_0xbc321d,this[_0x26b882(0x24f)]=_0x4d48dd,this[_0x26b882(0x3a3)]=_0x20ece0,_defineProperty(this,_0x26b882(0x260),CollaborationStatus[_0x26b882(0x39e)]),this['_showConflictNotification'](),this[_0x26b882(0x2c1)](),this[_0x26b882(0x164)]();}[_0x187924(0x34a)](){return this;}[_0x187924(0x22c)](){return this;}[_0x187924(0x27d)](){return this;}[_0x187924(0x303)](){return this;}[_0x187924(0x24d)](){return this;}[_0x187924(0x354)](){return this;}[_0x187924(0x310)](){return this;}[_0x187924(0x1cd)](){const _0x1cf2b2=_0x187924;throw new Error(_0x1cf2b2(0x1af));}[_0x187924(0x2c1)](){const _0x2ce39b=_0x187924;var _0x1bd410;(_0x1bd410=this[_0x2ce39b(0x163)])===null||_0x1bd410===void 0x0||_0x1bd410['updateOfflineData'](this[_0x2ce39b(0x364)],this['type'],null,[]);}[_0x187924(0x17d)](){const _0xc79584=_0x187924;if(this['_isPermissionRej'])this['_collaborationUIEventService'][_0xc79584(0x313)]({'id':CollaborationUIEventId[_0xc79584(0x1ff)]});else this[_0xc79584(0x24f)][_0xc79584(0x313)]({'id':CollaborationUIEventId['CONFLICT']});}[_0x187924(0x164)](){const _0x2c7dda=_0x187924;this[_0x2c7dda(0x2e8)][_0x2c7dda(0x192)](new WorkbookEditablePermission(this['unitID'])['id'],![]);}};ConflictState=__decorate([__decorateParam(0x6,Inject(IPermissionService)),__decorateParam(0x7,ICommandService),__decorateParam(0x8,IUndoRedoService),__decorateParam(0x9,Inject(RevisionService)),__decorateParam(0xa,Inject(LocaleService)),__decorateParam(0xb,Inject(CollaborationUIEventService)),__decorateParam(0xc,Optional(ILocalCacheService))],ConflictState);let OfflineState=class OfflineState extends CollaborationState{constructor(_0x269a6d,_0x4ff58e,_0x37f2ed,_0x2bb1d5,_0x33a63f,_0x57c6c1,_0x694fbd,_0x26fd57,_0x106ba2,_0x5e9c19){const _0x3e4e4d=_0x187924;super(_0x269a6d,_0x4ff58e,_0x37f2ed,_0x2bb1d5,_0x33a63f,_0x26fd57,_0x106ba2,_0x694fbd,_0x5e9c19),this['_injector']=_0x57c6c1,_defineProperty(this,_0x3e4e4d(0x260),CollaborationStatus[_0x3e4e4d(0x184)]);}[_0x187924(0x34a)](_0x41cfe5){const _0x45e707=_0x187924;return this[_0x45e707(0x2c8)][_0x45e707(0x374)](_0x41cfe5),this['_updateLocalCache'](),this;}['onRemoteChangeset'](_0x488adb){const _0x2e4a38=_0x187924;throw new Error(_0x2e4a38(0x379));}[_0x187924(0x27d)](){const _0x1676f1=_0x187924;throw new Error(_0x1676f1(0x1ca));}[_0x187924(0x303)](){const _0x1d9f80=_0x187924;throw new Error(_0x1d9f80(0x1a7));}[_0x187924(0x24d)](){return this;}['toggleOffline'](){return this;}['toggleOnline'](){const _0x1b8399=_0x187924,{_injector:_0xb7587a,_pendingMutations:_0x3b396a,_awaitingChangeset:_0x3422c4,unitID:_0x870fbd,_handler:_0x451c19,type:_0x86f405}=this,_0x1e8f62=createOnlineState(_0xb7587a,_0x870fbd,_0x86f405,_0x3422c4,_0x3b396a,_0x451c19);if(_0x1e8f62 instanceof PendingState)_0x1e8f62[_0x1b8399(0x2f2)]();else{if(_0x1e8f62 instanceof AwaitingWithPendingState||_0x1e8f62 instanceof AwaitingState)_0x1e8f62['resend']();}return _0x1e8f62;}['resend'](){const _0x266468=_0x187924;throw new Error(_0x266468(0x335));}};OfflineState=__decorate([__decorateParam(0x5,Inject(Injector)),__decorateParam(0x6,Inject(RevisionService)),__decorateParam(0x7,ICommandService),__decorateParam(0x8,IUndoRedoService),__decorateParam(0x9,Optional(ILocalCacheService))],OfflineState);let FetchingMissState=class FetchingMissState extends CollaborationState{constructor(_0xa64bec,_0x9b0655,_0x2bd2e7,_0x5b8a96,_0x3e3c7b,_0x234cff,_0x3ac2b7,_0x835e6d,_0x150921,_0x354b3b,_0x497c9d,_0x1bb74a,_0x48a240,_0x45b23d){const _0x16e84a=_0x187924;super(_0xa64bec,_0x9b0655,_0x2bd2e7,_0x5b8a96,_0x3ac2b7,_0x497c9d,_0x1bb74a,_0x150921,_0x45b23d),this['_acknowledgedAwaitingChangeset']=_0x3e3c7b,this[_0x16e84a(0x197)]=_0x234cff,this[_0x16e84a(0x32d)]=_0x835e6d,this[_0x16e84a(0x326)]=_0x354b3b,this[_0x16e84a(0x248)]=_0x48a240,this[_0x16e84a(0x3a3)]=_0x45b23d,_defineProperty(this,'status',CollaborationStatus[_0x16e84a(0x277)]);}['onMissedChangesetFetched'](_0x65c75f){const _0x537694=_0x187924;try{const _0x11da8=[..._0x65c75f,...this['_queuedRemoteChangesets']],_0x3eebe7=[this[_0x537694(0x2a5)]||this[_0x537694(0x27f)]][_0x537694(0x21e)](_0x201df4=>!!_0x201df4);let _0x1ea740,_0x4b7783;if(_0x3eebe7[_0x537694(0x35a)]){const _0x417045=this['_transformService']['transformChangesets'](_0x11da8,_0x3eebe7,![]);if(!isTransformChangesetsSuccess(_0x417045))throw _0x417045['error'];_0x1ea740=_0x417045[_0x537694(0x255)],_0x4b7783=_0x417045[_0x537694(0x175)];}else _0x1ea740=_0x11da8,_0x4b7783=[];let _0x64a47e=this[_0x537694(0x2c8)];_0x1ea740[_0x537694(0x2e5)](_0xaa0ac9=>{const _0x486420=_0x537694;let _0x289168;if(_0x64a47e[_0x486420(0x35a)]){const _0xfcb392=this[_0x486420(0x248)]['transformMutationsWithChangeset'](_0xaa0ac9,_0x64a47e);if(!isTransformMutationsWithChangesetSuccess(_0xfcb392))throw _0xfcb392[_0x486420(0x28d)];_0x289168=_0xfcb392[_0x486420(0x255)],_0x64a47e=_0xfcb392['m2Prime'];}else _0x289168=_0xaa0ac9;this[_0x486420(0x35d)](_0x289168);});if(this[_0x537694(0x27f)])this[_0x537694(0x24c)]();if(this[_0x537694(0x2a5)]&&_0x4b7783[_0x537694(0x35a)])_0x4b7783[0x0]['baseRev']=this[_0x537694(0x21b)]();let _0x5a0881;if(this['_awaitingChangeset']&&_0x64a47e[_0x537694(0x35a)]!==0x0)_0x5a0881=this[_0x537694(0x32d)][_0x537694(0x369)](AwaitingWithPendingState,this[_0x537694(0x364)],this['type'],_0x4b7783[0x0],_0x64a47e,this['_handler'],void 0x0);else{if(this[_0x537694(0x2a5)]&&_0x64a47e['length']===0x0)_0x4b7783[0x0][_0x537694(0x267)]=this[_0x537694(0x21b)](),_0x5a0881=this[_0x537694(0x32d)][_0x537694(0x369)](AwaitingState,this[_0x537694(0x364)],this[_0x537694(0x19f)],_0x4b7783[0x0],this[_0x537694(0x334)]);else{if(_0x64a47e[_0x537694(0x35a)]!==0x0){const _0x56d64e=this['_injector']['createInstance'](PendingState,this[_0x537694(0x364)],this[_0x537694(0x19f)],_0x64a47e,this[_0x537694(0x334)]);_0x56d64e['_schedule'](),_0x5a0881=_0x56d64e;}else _0x5a0881=this[_0x537694(0x32d)][_0x537694(0x369)](SyncedState,this['unitID'],this[_0x537694(0x19f)],this[_0x537694(0x334)]);}}return _0x5a0881[_0x537694(0x2ee)](),_0x5a0881;}catch(_0x323d14){return this[_0x537694(0x326)]['error'](_0x537694(0x178),_0x537694(0x3b4),_0x323d14),this[_0x537694(0x32d)][_0x537694(0x369)](ConflictState,this[_0x537694(0x364)],this[_0x537694(0x19f)],this[_0x537694(0x2a5)],this[_0x537694(0x2c8)],this[_0x537694(0x334)],![]);}}['resend'](){const _0x4676bb=_0x187924;throw new Error(_0x4676bb(0x1f7));}[_0x187924(0x34a)](_0x48051c){const _0x8365b5=_0x187924;return this['_pendingMutations'][_0x8365b5(0x374)](_0x48051c),this;}[_0x187924(0x22c)](_0x3b417f){const _0x4614c1=_0x187924;return this['_queuedRemoteChangesets'][_0x4614c1(0x374)](_0x3b417f),this;}[_0x187924(0x27d)](_0xd923b6){const _0x3d38bb=_0x187924;if(this[_0x3d38bb(0x2a5)])return this['_acknowledgedAwaitingChangeset']=this[_0x3d38bb(0x2a5)],this[_0x3d38bb(0x2a5)]=null,this;throw new Error(_0x3d38bb(0x1db));}[_0x187924(0x303)](_0x6efcff){const _0x56ceec=_0x187924;return this[_0x56ceec(0x15e)](!!(_0x6efcff===null||_0x6efcff===void 0x0?void 0x0:_0x6efcff['isPermissionRej']));}[_0x187924(0x24d)](){return this;}[_0x187924(0x354)](){const _0x5d0111=_0x187924;return this[_0x5d0111(0x32d)][_0x5d0111(0x369)](OfflineState,this[_0x5d0111(0x364)],this['type'],this[_0x5d0111(0x2a5)],this[_0x5d0111(0x2c8)],this['_handler']);}[_0x187924(0x310)](){return this;}[_0x187924(0x15e)](_0x2bafa8){const _0x4665a9=_0x187924;return this['_injector'][_0x4665a9(0x369)](ConflictState,this[_0x4665a9(0x364)],this[_0x4665a9(0x19f)],this[_0x4665a9(0x2a5)],this[_0x4665a9(0x2c8)],this[_0x4665a9(0x334)],_0x2bafa8);}};FetchingMissState=__decorate([__decorateParam(0x7,Inject(Injector)),__decorateParam(0x8,Inject(RevisionService)),__decorateParam(0x9,ILogService),__decorateParam(0xa,ICommandService),__decorateParam(0xb,IUndoRedoService),__decorateParam(0xc,ITransformService),__decorateParam(0xd,Optional(ILocalCacheService))],FetchingMissState);function createOnlineState(_0x1c26c2,_0x58e171,_0x2cf7dc,_0x4f724d,_0x2e70d6,_0x32fd72){const _0x3dc0c1=_0x187924;if(_0x4f724d&&_0x2e70d6[_0x3dc0c1(0x35a)])return _0x1c26c2[_0x3dc0c1(0x369)](AwaitingWithPendingState,_0x58e171,_0x2cf7dc,_0x4f724d,_0x2e70d6,_0x32fd72,void 0x0);if(_0x4f724d)return _0x1c26c2[_0x3dc0c1(0x369)](AwaitingState,_0x58e171,_0x2cf7dc,_0x4f724d,_0x32fd72);if(_0x2e70d6[_0x3dc0c1(0x35a)])return _0x1c26c2[_0x3dc0c1(0x369)](PendingState,_0x58e171,_0x2cf7dc,_0x2e70d6,_0x32fd72);return _0x1c26c2[_0x3dc0c1(0x369)](SyncedState,_0x58e171,_0x2cf7dc,_0x32fd72);}let CollaborationEntity=class CollaborationEntity extends RxDisposable{get['state'](){const _0x54dd0f=_0x187924;return this[_0x54dd0f(0x2bb)];}constructor(_0x197fed,_0x4f792a,_0x30201d,_0xfb45f7,_0x257fcb,_0x58f855,_0x27929d,_0x10502d,_0x3060f7,_0x1131c2,_0x404001,_0x1e61b1,_0x1651be,_0x4e2421){const _0x30aeee=_0x187924;super(),this[_0x30aeee(0x364)]=_0x197fed,this['session']=_0x4f792a,this['_type']=_0x30201d,this[_0x30aeee(0x32d)]=_0xfb45f7,this[_0x30aeee(0x208)]=_0x257fcb,this['_localeService']=_0x58f855,this[_0x30aeee(0x28e)]=_0x27929d,this['_eventService']=_0x10502d,this[_0x30aeee(0x2ad)]=_0x3060f7,this[_0x30aeee(0x326)]=_0x1131c2,this[_0x30aeee(0x2be)]=_0x404001,this[_0x30aeee(0x2e8)]=_0x1e61b1,this['_singleActiveUnitService']=_0x1651be,this[_0x30aeee(0x163)]=_0x4e2421,_defineProperty(this,_0x30aeee(0x1a0),new BehaviorSubject(null)),_defineProperty(this,_0x30aeee(0x367),this[_0x30aeee(0x1a0)][_0x30aeee(0x1e2)]()),_defineProperty(this,_0x30aeee(0x2bb),void 0x0),_defineProperty(this,_0x30aeee(0x2b2),![]),_defineProperty(this,_0x30aeee(0x1eb),''),_defineProperty(this,_0x30aeee(0x2b6),0x0),_defineProperty(this,_0x30aeee(0x1ad),this[_0x30aeee(0x367)][_0x30aeee(0x386)](map(_0x52a847=>{const _0x5dc48f=_0x30aeee;if(_0x52a847)return _0x52a847[_0x5dc48f(0x260)];return CollaborationStatus[_0x5dc48f(0x184)];}),shareReplay(0x1))),_defineProperty(this,_0x30aeee(0x3a0),![]),_defineProperty(this,_0x30aeee(0x225),[]);}async['init'](){const _0x408100=_0x187924;if(this[_0x408100(0x2e2)])throw new Error(_0x408100(0x31e));await this[_0x408100(0x33a)]();}[_0x187924(0x381)](){const _0x312395=_0x187924;return this[_0x312395(0x2b2)]=!![],toDisposable(()=>{const _0x2ed3a7=_0x312395;this[_0x2ed3a7(0x2b2)]=![],this[_0x2ed3a7(0x38d)]();});}[_0x187924(0x324)](_0x133946){this['_onLocalMutation'](_0x133946);}[_0x187924(0x1c0)](_0x5171b9){const _0x151826=_0x187924;this[_0x151826(0x2bb)]=_0x5171b9,this['_state$'][_0x151826(0x1a5)](_0x5171b9);}async[_0x187924(0x33a)](){const _0x2e20f5=_0x187924;this[_0x2e20f5(0x1c0)](await this[_0x2e20f5(0x200)]());if(this[_0x2e20f5(0x317)]){var _0x26318e;(_0x26318e=this[_0x2e20f5(0x317)])===null||_0x26318e===void 0x0||_0x26318e[_0x2e20f5(0x1fa)](this[_0x2e20f5(0x364)]),this[_0x2e20f5(0x1b0)](this['_singleActiveUnitService'][_0x2e20f5(0x3bd)](this['unitID'])['subscribe'](_0xa1df35=>{const _0x1b795f=_0x2e20f5;this[_0x1b795f(0x326)]['debug']('[CollaborationEntity]',_0x1b795f(0x33e),_0xa1df35),_0xa1df35===UnitStatus['OTHER_CLIENTS_EDITING']?(this[_0x1b795f(0x237)][_0x1b795f(0x313)]({'id':CollaborationUIEventId[_0x1b795f(0x35b)]}),this[_0x1b795f(0x2e8)][_0x1b795f(0x192)](new WorkbookEditablePermission(this['unitID'])['id'],![]),this['_permissionService'][_0x1b795f(0x2c7)](![])):(this[_0x1b795f(0x2e8)][_0x1b795f(0x192)](new WorkbookEditablePermission(this[_0x1b795f(0x364)])['id'],!![]),this['_permissionService'][_0x1b795f(0x2c7)](!![]));}));}let _0x3ccd06=![];return this[_0x2e20f5(0x1b0)](this[_0x2e20f5(0x3b0)][_0x2e20f5(0x1b9)][_0x2e20f5(0x352)](_0x6ad584=>{const _0x214d17=_0x2e20f5;if(_0x6ad584===SessionStatus['ONLINE'])this[_0x214d17(0x250)](_0x3ccd06);else _0x6ad584===SessionStatus[_0x214d17(0x184)]&&(_0x3ccd06=!![],this[_0x214d17(0x2c9)]());})),this[_0x2e20f5(0x1b0)](this['session']['event$'][_0x2e20f5(0x352)](_0x245d60=>{const _0x44725d=_0x2e20f5;try{switch(_0x245d60[_0x44725d(0x1bf)]){case CollaborationEvent[_0x44725d(0x29c)]:this[_0x44725d(0x376)](parseProtocolChangeset(_0x245d60[_0x44725d(0x218)]));break;case CollaborationEvent[_0x44725d(0x31a)]:this[_0x44725d(0x21f)](_0x245d60[_0x44725d(0x218)]);break;case CollaborationEvent['CHANGESET_REJ']:this['_onRemoteRejected']();break;case CollaborationEvent[_0x44725d(0x155)]:this[_0x44725d(0x189)](_0x245d60['data']);break;case CollaborationEvent[_0x44725d(0x353)]:this[_0x44725d(0x2e3)](_0x245d60[_0x44725d(0x218)]['changesets'][_0x44725d(0x25f)](_0x247281=>parseProtocolChangeset(_0x247281)));break;case CollaborationEvent[_0x44725d(0x350)]:this['_onRemoteRejected']({'isPermissionRej':!![]});break;case CollaborationEvent[_0x44725d(0x29e)]:break;}}catch(_0x5b574d){console[_0x44725d(0x28d)]('Error\x20on\x20receiving\x20event',_0x5b574d);throw _0x5b574d;}})),this[_0x2e20f5(0x2bb)];}[_0x187924(0x321)](){const _0x201a3e=_0x187924;this[_0x201a3e(0x3a0)]=![];}[_0x187924(0x36f)](){const _0x436efc=_0x187924;if(this[_0x436efc(0x3a0)])throw new Error(_0x436efc(0x21a));this[_0x436efc(0x3a0)]=!![];}[_0x187924(0x186)](_0x54fef5){const _0x24eaa6=_0x187924;this[_0x24eaa6(0x36f)](),this['_updateState'](this['_state'][_0x24eaa6(0x34a)](_0x54fef5)),this[_0x24eaa6(0x321)]();}[_0x187924(0x376)](_0x524400){const _0x4fc1f7=_0x187924;if(_0x524400[_0x4fc1f7(0x20e)]<=this[_0x4fc1f7(0x28e)][_0x4fc1f7(0x266)](this[_0x4fc1f7(0x364)]))return;if(this[_0x4fc1f7(0x2b2)]){this[_0x4fc1f7(0x225)][_0x4fc1f7(0x374)](_0x524400);return;}this['_applyRemoteChangeset'](_0x524400);}[_0x187924(0x38d)](){const _0x19eb2d=_0x187924;this[_0x19eb2d(0x225)]['forEach'](_0x13ee7b=>this[_0x19eb2d(0x16f)](_0x13ee7b)),this[_0x19eb2d(0x225)]=[];}['_applyRemoteChangeset'](_0x590fd4){const _0x4e6f97=_0x187924,_0x49dddd=this[_0x4e6f97(0x208)][_0x4e6f97(0x2d0)][_0x4e6f97(0x287)](this[_0x4e6f97(0x208)][_0x4e6f97(0x2d0)][_0x4e6f97(0x1d1)]()[_0x4e6f97(0x2ca)])(_0x590fd4[_0x4e6f97(0x36c)],null)||_0x590fd4[_0x4e6f97(0x36c)],_0x294171={..._0x590fd4,'mutations':_0x49dddd};this[_0x4e6f97(0x36f)](),this[_0x4e6f97(0x1c0)](this['_state']['onRemoteChangeset'](_0x294171)),this['_unlockTransition']();}[_0x187924(0x21f)](_0x179930){const _0xff7fb4=_0x187924;this[_0xff7fb4(0x36f)](),this['_updateState'](this['_state'][_0xff7fb4(0x27d)](_0x179930)),this[_0xff7fb4(0x321)]();}[_0x187924(0x345)](_0x13fe08){const _0x434b56=_0x187924;this[_0x434b56(0x36f)](),this[_0x434b56(0x1c0)](this[_0x434b56(0x2bb)]['onRemoteRej'](_0x13fe08)),this[_0x434b56(0x321)]();}[_0x187924(0x189)](_0x44e5bf){const _0x2eb0f0=_0x187924;this[_0x2eb0f0(0x36f)](),this[_0x2eb0f0(0x1c0)](this[_0x2eb0f0(0x2bb)]['onRemoteRetry'](_0x44e5bf)),this[_0x2eb0f0(0x321)]();}[_0x187924(0x2e3)](_0x40d457){const _0x299e82=_0x187924;if(!(this[_0x299e82(0x2bb)]instanceof FetchingMissState))throw new TypeError('[CollaborationEntity]:\x20cannot\x20apply\x20missing\x20results\x20on\x20other\x20states!');const _0x88d12a=_0x40d457[_0x299e82(0x25f)](_0x3b4575=>{const _0x4f0be1=_0x299e82,_0xa080b0=this[_0x4f0be1(0x208)]['interceptor'][_0x4f0be1(0x287)](this['_compressMutationService'][_0x4f0be1(0x2d0)][_0x4f0be1(0x1d1)]()[_0x4f0be1(0x2ca)])(_0x3b4575['mutations'],null)||_0x3b4575[_0x4f0be1(0x36c)];return{..._0x3b4575,'mutations':_0xa080b0};});this[_0x299e82(0x36f)](),this[_0x299e82(0x1c0)](this[_0x299e82(0x2bb)]['onMissedChangesetFetched'](_0x88d12a)),this[_0x299e82(0x321)]();}[_0x187924(0x2c9)](){const _0x2f5809=_0x187924;this[_0x2f5809(0x36f)](),this['_updateState'](this[_0x2f5809(0x2bb)][_0x2f5809(0x354)]()),this['_unlockTransition']();}['_toggleOnline'](_0x45ba7f=![]){const _0x56861a=_0x187924;this['_lockTransition'](),this[_0x56861a(0x1c0)](this[_0x56861a(0x2bb)]['toggleOnline']()),this[_0x56861a(0x321)]();const _0x41812a=this[_0x56861a(0x2bb)];_0x45ba7f&&_0x41812a instanceof SyncedState&&(this[_0x56861a(0x36f)](),this[_0x56861a(0x1c0)](_0x41812a['fetchMiss']()),this[_0x56861a(0x321)]());}async['_createInitialState'](){return new Promise(_0xd4739=>{const _0x1d51ee=_0x5993;this[_0x1d51ee(0x3b0)][_0x1d51ee(0x1b9)]['pipe'](take(0x1))['subscribe'](async _0xb9efa0=>{const _0x547bd3=_0x1d51ee;_0xd4739(await this[_0x547bd3(0x2a4)](_0xb9efa0===SessionStatus['ONLINE']));});});}[_0x187924(0x17c)](){const _0x7dec04=_0x187924,_0x44bbf1=this[_0x7dec04(0x364)];return{'onStateChange':(_0x374ae5,_0x1d6546)=>{const _0x40cb3f=_0x7dec04;if(_0x374ae5!==this[_0x40cb3f(0x2bb)])throw new Error(_0x40cb3f(0x161)+_0x374ae5[_0x40cb3f(0x260)]+_0x40cb3f(0x1bc)+_0x1d6546[_0x40cb3f(0x260)]+_0x40cb3f(0x27e)+this[_0x40cb3f(0x2bb)][_0x40cb3f(0x260)]);this[_0x40cb3f(0x1c0)](_0x1d6546);},'onSendChangeset':_0x2e83d3=>{const _0x739130=_0x7dec04;!_0x2e83d3['sid']&&(_0x2e83d3[_0x739130(0x36a)]=this[_0x739130(0x1eb)],_0x2e83d3['reqId']=++this[_0x739130(0x2b6)]);const _0x32cc1b={'eventID':CollaborationEvent[_0x739130(0x2d4)],'data':{'unitID':_0x2e83d3['unitID'],'unitType':this[_0x739130(0x1c7)],'changeset':_0x2e83d3,'memberID':this[_0x739130(0x3b0)][_0x739130(0x2a0)]()}};this['session'][_0x739130(0x358)](_0x32cc1b,this[_0x739130(0x364)]);},'onMissingChangesets':({from:_0x13e54a,to:_0x4647b2})=>{const _0x18f6af=_0x7dec04;this['_logService'][_0x18f6af(0x338)]('[CollaborationEntity]',_0x18f6af(0x280)+_0x13e54a+_0x18f6af(0x2db)+_0x4647b2);const _0xe37a78={'eventID':CollaborationEvent[_0x18f6af(0x234)],'data':{'unitID':_0x44bbf1,'unitType':this['_type'],'from':_0x13e54a,'to':_0x4647b2}};this[_0x18f6af(0x3b0)][_0x18f6af(0x358)](_0xe37a78,this[_0x18f6af(0x364)]);}};}async[_0x187924(0x2a4)](_0x18bbc4){const _0x344661=_0x187924;var _0x399c0a,_0x28c44b,_0x14140e;const _0x172c76=await((_0x399c0a=this['_localCacheService'])===null||_0x399c0a===void 0x0?void 0x0:_0x399c0a[_0x344661(0x289)](this['unitID'])),_0x58d6b0=(_0x28c44b=_0x172c76===null||_0x172c76===void 0x0?void 0x0:_0x172c76['mutations'])!==null&&_0x28c44b!==void 0x0?_0x28c44b:[],_0x29e121=(_0x14140e=_0x172c76===null||_0x172c76===void 0x0?void 0x0:_0x172c76[_0x344661(0x1d8)])!==null&&_0x14140e!==void 0x0?_0x14140e:null,_0x5cce7c=!!(_0x29e121===null||_0x29e121===void 0x0?void 0x0:_0x29e121[_0x344661(0x36a)])&&!!(_0x29e121===null||_0x29e121===void 0x0?void 0x0:_0x29e121['reqId']);this[_0x344661(0x1eb)]=_0x5cce7c?_0x29e121[_0x344661(0x36a)]:uuidv4(),this[_0x344661(0x2b6)]=_0x5cce7c?_0x29e121[_0x344661(0x282)]:0x0;const _0x5096fc=this[_0x344661(0x364)];try{this[_0x344661(0x204)](_0x29e121,_0x58d6b0);}catch(_0x25b766){this[_0x344661(0x326)][_0x344661(0x28d)](_0x25b766);}const _0x53b08c=this['_createHandler']();if(_0x18bbc4){const _0x50e83e=createOnlineState(this['_injector'],_0x5096fc,this[_0x344661(0x1c7)],_0x29e121,_0x58d6b0,_0x53b08c);if(_0x50e83e instanceof PendingState)_0x50e83e[_0x344661(0x2f2)]();else{if(_0x50e83e instanceof AwaitingWithPendingState||_0x50e83e instanceof AwaitingState)_0x50e83e['resend']();}return _0x50e83e;}return this['_injector'][_0x344661(0x369)](OfflineState,_0x5096fc,this['_type'],_0x29e121,_0x58d6b0,_0x53b08c);}[_0x187924(0x204)](_0x52a16a,_0x154800){const _0x1e261e=_0x187924;var _0x568754,_0x471371;const _0x2e87c3=this[_0x1e261e(0x208)][_0x1e261e(0x2d0)][_0x1e261e(0x287)](this['_compressMutationService']['interceptor'][_0x1e261e(0x1d1)]()[_0x1e261e(0x2ca)]);(_0x568754=_0x2e87c3((_0x52a16a===null||_0x52a16a===void 0x0?void 0x0:_0x52a16a[_0x1e261e(0x36c)])||[],null))===null||_0x568754===void 0x0||_0x568754[_0x1e261e(0x2e5)](_0x3947f9=>this['_commandService'][_0x1e261e(0x259)](_0x3947f9['id'],_0x3947f9[_0x1e261e(0x300)])),(_0x471371=_0x2e87c3(_0x154800||[],null))===null||_0x471371===void 0x0||_0x471371[_0x1e261e(0x2e5)](_0x84f85c=>this[_0x1e261e(0x2be)][_0x1e261e(0x259)](_0x84f85c['id'],_0x84f85c[_0x1e261e(0x300)]));}};CollaborationEntity=__decorate([__decorateParam(0x3,Inject(Injector)),__decorateParam(0x4,Inject(CompressMutationService)),__decorateParam(0x5,Inject(LocaleService)),__decorateParam(0x6,Inject(RevisionService)),__decorateParam(0x7,Inject(CollaborationUIEventService)),__decorateParam(0x8,IUniverInstanceService),__decorateParam(0x9,ILogService),__decorateParam(0xa,ICommandService),__decorateParam(0xb,IPermissionService),__decorateParam(0xc,Optional(ISingleActiveUnitService)),__decorateParam(0xd,Optional(ILocalCacheService))],CollaborationEntity);let DocCollaborationEntity=class DocCollaborationEntity extends CollaborationEntity{constructor(_0x2fa2c9,_0x1e84ed,_0x175fbc,_0xc0792a,_0x157c47,_0x12d9e9,_0x4b0b5a,_0x27cd20,_0x405966,_0x46b6b6,_0x2859bf,_0x3d6bfc,_0x223910,_0x46d453){const _0x39c613=_0x187924;super(_0x2fa2c9,_0x175fbc,_0x1e84ed,_0xc0792a,_0x157c47,_0x12d9e9,_0x4b0b5a,_0x27cd20,_0x405966,_0x46b6b6,_0x2859bf,_0x3d6bfc,_0x223910,_0x46d453),this['unitID']=_0x2fa2c9,this[_0x39c613(0x19f)]=_0x1e84ed,_defineProperty(this,_0x39c613(0x272),null);}['addHandlerCallback'](_0x15ae55){const _0x34b917=_0x187924;this[_0x34b917(0x272)]=_0x15ae55;}['dispose'](){const _0x733c4d=_0x187924;this['_handlerCallback']=null,super[_0x733c4d(0x382)]();}[_0x187924(0x17c)](){const _0x4ef723=_0x187924,_0x3e3a26=super[_0x4ef723(0x17c)]();return _0x3e3a26[_0x4ef723(0x191)]=_0x425a65=>{const _0x4dbc52=_0x4ef723;var _0x3b7d7b,_0x13a6bf;return(_0x3b7d7b=this[_0x4dbc52(0x272)])===null||_0x3b7d7b===void 0x0||(_0x13a6bf=_0x3b7d7b['onTransformIME'])===null||_0x13a6bf===void 0x0?void 0x0:_0x13a6bf[_0x4dbc52(0x1f5)](_0x3b7d7b,_0x425a65);},_0x3e3a26['onTransformState']=_0x2135a3=>{const _0x1e8ace=_0x4ef723;var _0x498e5d,_0x1a96b0;return(_0x498e5d=this['_handlerCallback'])===null||_0x498e5d===void 0x0||(_0x1a96b0=_0x498e5d['onTransformState'])===null||_0x1a96b0===void 0x0?void 0x0:_0x1a96b0[_0x1e8ace(0x1f5)](_0x498e5d,_0x2135a3);},_0x3e3a26[_0x4ef723(0x3ab)]=_0x5903a4=>{const _0x243eaf=_0x4ef723;var _0x5e9346,_0x370ee6;return(_0x5e9346=this[_0x243eaf(0x272)])===null||_0x5e9346===void 0x0||(_0x370ee6=_0x5e9346[_0x243eaf(0x3ab)])===null||_0x370ee6===void 0x0?void 0x0:_0x370ee6['call'](_0x5e9346,_0x5903a4);},_0x3e3a26[_0x4ef723(0x1c1)]=_0x3ad1d9=>{const _0x567a81=_0x4ef723;var _0x15fbdd,_0xc1a4ca;return(_0x15fbdd=this[_0x567a81(0x272)])===null||_0x15fbdd===void 0x0||(_0xc1a4ca=_0x15fbdd['onSyncEditingCollabCursor'])===null||_0xc1a4ca===void 0x0?void 0x0:_0xc1a4ca[_0x567a81(0x1f5)](_0x15fbdd,_0x3ad1d9);},_0x3e3a26[_0x4ef723(0x36d)]=_0x3a9b9=>{const _0x2939b2=_0x4ef723;var _0x49f7f5,_0x48f88a,_0x582645;if(!((_0x49f7f5=this[_0x2939b2(0x272)])===null||_0x49f7f5===void 0x0?void 0x0:_0x49f7f5['onTransformRemoteChangesetByIMECache']))throw new Error(_0x2939b2(0x320));return(_0x48f88a=this['_handlerCallback'])===null||_0x48f88a===void 0x0||(_0x582645=_0x48f88a[_0x2939b2(0x36d)])===null||_0x582645===void 0x0?void 0x0:_0x582645[_0x2939b2(0x1f5)](_0x48f88a,_0x3a9b9);},_0x3e3a26['onTransformRemoteChangesetByStateCache']=_0x18ff7f=>{const _0x370977=_0x4ef723;var _0x21912,_0x3eeb1e,_0x3070ea;if(!((_0x21912=this[_0x370977(0x272)])===null||_0x21912===void 0x0?void 0x0:_0x21912[_0x370977(0x315)]))throw new Error(_0x370977(0x3a6));return(_0x3eeb1e=this[_0x370977(0x272)])===null||_0x3eeb1e===void 0x0||(_0x3070ea=_0x3eeb1e[_0x370977(0x315)])===null||_0x3070ea===void 0x0?void 0x0:_0x3070ea[_0x370977(0x1f5)](_0x3eeb1e,_0x18ff7f);},_0x3e3a26;}async[_0x187924(0x33a)](){const _0x4cfdaa=_0x187924,_0x284ff2=await super[_0x4cfdaa(0x33a)]();return this[_0x4cfdaa(0x1b0)](this[_0x4cfdaa(0x2be)][_0x4cfdaa(0x30d)]((_0x1768b0,_0x57c01b)=>{const _0x5996b3=_0x4cfdaa;if(_0x1768b0[_0x5996b3(0x19f)]!==CommandType['MUTATION']||(_0x57c01b===null||_0x57c01b===void 0x0?void 0x0:_0x57c01b[_0x5996b3(0x2c0)])||(_0x57c01b===null||_0x57c01b===void 0x0?void 0x0:_0x57c01b[_0x5996b3(0x212)]))return;if(_0x1768b0['id']===RichTextEditingMutation['id'])return;const _0x473c69=_0x1768b0[_0x5996b3(0x300)];if((_0x473c69===null||_0x473c69===void 0x0?void 0x0:_0x473c69[_0x5996b3(0x265)])!==this[_0x5996b3(0x364)])return;const _0x484f12=_0x1768b0,_0x13c61c=this[_0x5996b3(0x208)][_0x5996b3(0x2d0)][_0x5996b3(0x287)](this[_0x5996b3(0x208)][_0x5996b3(0x2d0)][_0x5996b3(0x1d1)]()['COMPRESS_MUTATION_SEND'])([_0x484f12],this['_univerInstanceService'])||[_0x484f12];this[_0x5996b3(0x186)](_0x13c61c[0x0]);})),_0x284ff2;}};DocCollaborationEntity=__decorate([__decorateParam(0x3,Inject(Injector)),__decorateParam(0x4,Inject(CompressMutationService)),__decorateParam(0x5,Inject(LocaleService)),__decorateParam(0x6,Inject(RevisionService)),__decorateParam(0x7,Inject(CollaborationUIEventService)),__decorateParam(0x8,IUniverInstanceService),__decorateParam(0x9,ILogService),__decorateParam(0xa,ICommandService),__decorateParam(0xb,IPermissionService),__decorateParam(0xc,Optional(ISingleActiveUnitService)),__decorateParam(0xd,Optional(ILocalCacheService))],DocCollaborationEntity);let SheetCollaborationEntity=class SheetCollaborationEntity extends CollaborationEntity{constructor(_0x395225,_0x28aba0,_0x484c97,_0x5d57fa,_0x500532,_0x33d8c1,_0x169001,_0x2e1ce0,_0x3ab8ac,_0x2dfb67,_0x2fb716,_0x399cbe,_0x45fa8b,_0x41cce8,_0x3b5c73){const _0x21b5dd=_0x187924;super(_0x395225,_0x484c97,_0x28aba0,_0x5d57fa,_0x500532,_0x33d8c1,_0x169001,_0x3ab8ac,_0x2dfb67,_0x2fb716,_0x399cbe,_0x45fa8b,_0x41cce8,_0x3b5c73),this[_0x21b5dd(0x364)]=_0x395225,this['type']=_0x28aba0,this[_0x21b5dd(0x19b)]=_0x2e1ce0;}[_0x187924(0x17c)](){const _0x200cb3=_0x187924,_0x3ebfe5=super[_0x200cb3(0x17c)]();return _0x3ebfe5[_0x200cb3(0x3ab)]=_0x22260b=>this[_0x200cb3(0x19b)]['transformSelections'](_0x22260b),_0x3ebfe5;}async[_0x187924(0x33a)](){const _0x197b73=_0x187924,_0x40909f=await super[_0x197b73(0x33a)]();return this[_0x197b73(0x1b0)](this[_0x197b73(0x2be)]['onMutationExecutedForCollab']((_0x58b9e1,_0x4e9e80)=>{const _0x4a8112=_0x197b73;if(_0x58b9e1[_0x4a8112(0x19f)]!==CommandType[_0x4a8112(0x1f6)]||(_0x4e9e80===null||_0x4e9e80===void 0x0?void 0x0:_0x4e9e80[_0x4a8112(0x2c0)])||(_0x4e9e80===null||_0x4e9e80===void 0x0?void 0x0:_0x4e9e80[_0x4a8112(0x212)]))return;const _0x29eb29=_0x58b9e1['params'];if((_0x29eb29===null||_0x29eb29===void 0x0?void 0x0:_0x29eb29[_0x4a8112(0x265)])!==this[_0x4a8112(0x364)])return;const _0x390883=_0x58b9e1,_0x5164fd=this[_0x4a8112(0x208)][_0x4a8112(0x2d0)][_0x4a8112(0x287)](this[_0x4a8112(0x208)][_0x4a8112(0x2d0)]['getInterceptPoints']()['COMPRESS_MUTATION_SEND'])([_0x390883],this[_0x4a8112(0x2ad)])||[_0x390883];this['_onLocalMutation'](_0x5164fd[0x0]);})),_0x40909f;}};SheetCollaborationEntity=__decorate([__decorateParam(0x3,Inject(Injector)),__decorateParam(0x4,Inject(CompressMutationService)),__decorateParam(0x5,Inject(LocaleService)),__decorateParam(0x6,Inject(RevisionService)),__decorateParam(0x7,Inject(SheetTransformSelectionsService)),__decorateParam(0x8,Inject(CollaborationUIEventService)),__decorateParam(0x9,IUniverInstanceService),__decorateParam(0xa,ILogService),__decorateParam(0xb,ICommandService),__decorateParam(0xc,IPermissionService),__decorateParam(0xd,Optional(ISingleActiveUnitService)),__decorateParam(0xe,Optional(ILocalCacheService))],SheetCollaborationEntity);const INetworkConditionService=createIdentifier(_0x187924(0x1c2));function deserializeToCombResponse(_0x35918e){const _0x1e2b55=_0x187924,_0x56712e=_0x35918e[_0x1e2b55(0x218)],_0x48d2c4=JSON[_0x1e2b55(0x1e5)](_0x56712e);switch(_0x48d2c4[_0x1e2b55(0x1ec)]){case CombCmd[_0x1e2b55(0x2d9)]:case CombCmd[_0x1e2b55(0x18d)]:{const _0x12e52a=_0x48d2c4['infoRsp'];return{..._0x48d2c4,'data':_0x12e52a,'cmd':_0x48d2c4[_0x1e2b55(0x1ec)]};}case CombCmd[_0x1e2b55(0x37f)]:{const _0x34a528=_0x48d2c4[_0x1e2b55(0x24b)];return{..._0x48d2c4,'data':_0x34a528,'cmd':_0x48d2c4['cmd']};}case CombCmd[_0x1e2b55(0x294)]:{const _0x1edfe0=_0x48d2c4['collaMsg'];switch(_0x1edfe0['eventID']){case CollaborationEvent[_0x1e2b55(0x350)]:var _0x3ba8d7;return{..._0x48d2c4,'data':{..._0x1edfe0,'data':(_0x3ba8d7=_0x1edfe0['permissionRejEvent'])===null||_0x3ba8d7===void 0x0?void 0x0:_0x3ba8d7['cs']},'cmd':_0x48d2c4[_0x1e2b55(0x1ec)]};case CollaborationEvent[_0x1e2b55(0x31a)]:var _0x438e9d;return{..._0x48d2c4,'data':{..._0x1edfe0,'data':(_0x438e9d=_0x1edfe0['csAckEvent'])===null||_0x438e9d===void 0x0?void 0x0:_0x438e9d['cs']},'cmd':_0x48d2c4[_0x1e2b55(0x1ec)]};case CollaborationEvent[_0x1e2b55(0x29c)]:var _0x5ce809;return{..._0x48d2c4,'data':{..._0x1edfe0,'data':(_0x5ce809=_0x1edfe0[_0x1e2b55(0x236)])===null||_0x5ce809===void 0x0?void 0x0:_0x5ce809['cs']},'cmd':_0x48d2c4['cmd']};case CollaborationEvent[_0x1e2b55(0x167)]:var _0x12902a;return{..._0x48d2c4,'data':{..._0x1edfe0,'data':(_0x12902a=_0x1edfe0[_0x1e2b55(0x274)])===null||_0x12902a===void 0x0?void 0x0:_0x12902a['cs']},'cmd':_0x48d2c4[_0x1e2b55(0x1ec)]};case CollaborationEvent[_0x1e2b55(0x155)]:var _0x2758df;return{..._0x48d2c4,'data':{..._0x1edfe0,'data':(_0x2758df=_0x1edfe0['csShouldRetryEvent'])===null||_0x2758df===void 0x0?void 0x0:_0x2758df['cs']},'cmd':_0x48d2c4['cmd']};case CollaborationEvent[_0x1e2b55(0x3b1)]:return{..._0x48d2c4,'data':{..._0x1edfe0,'data':_0x1edfe0[_0x1e2b55(0x17f)]},'cmd':_0x48d2c4[_0x1e2b55(0x1ec)]};case CollaborationEvent['USERS_ENTER']:return{..._0x48d2c4,'data':{..._0x1edfe0,'data':_0x1edfe0[_0x1e2b55(0x1f0)]},'cmd':_0x48d2c4[_0x1e2b55(0x1ec)]};case CollaborationEvent['USERS_LEAVE']:return{..._0x48d2c4,'data':{..._0x1edfe0,'data':_0x1edfe0[_0x1e2b55(0x395)]},'cmd':_0x48d2c4[_0x1e2b55(0x1ec)]};case CollaborationEvent['LIVESHARE_NEW_HOST']:return{..._0x48d2c4,'data':{..._0x1edfe0,'data':_0x1edfe0[_0x1e2b55(0x215)]},'cmd':_0x48d2c4['cmd']};case CollaborationEvent['LIVESHARE_FETCH_OPERATIONS']:case CollaborationEvent[_0x1e2b55(0x366)]:return{..._0x48d2c4,'data':{..._0x1edfe0,'data':_0x1edfe0[_0x1e2b55(0x264)]},'cmd':_0x48d2c4[_0x1e2b55(0x1ec)]};case CollaborationEvent[_0x1e2b55(0x34f)]:return{..._0x48d2c4,'data':{..._0x1edfe0,'data':_0x1edfe0['liveShareNewHost']},'cmd':_0x48d2c4[_0x1e2b55(0x1ec)]};case CollaborationEvent['MSG_FOR_ERROR']:return{..._0x48d2c4,'data':_0x1edfe0,'cmd':_0x48d2c4[_0x1e2b55(0x1ec)]};case CollaborationEvent['COMMENT_UPDATE']:return{..._0x48d2c4,'data':{..._0x1edfe0,'data':_0x1edfe0[_0x1e2b55(0x1fc)]},'cmd':_0x48d2c4[_0x1e2b55(0x1ec)]};case CollaborationEvent[_0x1e2b55(0x347)]:return{..._0x48d2c4,'data':{..._0x1edfe0,'data':_0x1edfe0['updatePermissionObjEvent']},'cmd':_0x48d2c4[_0x1e2b55(0x1ec)]};case CollaborationEvent[_0x1e2b55(0x1e7)]:return{..._0x48d2c4,'data':{..._0x1edfe0,'data':_0x1edfe0[_0x1e2b55(0x37e)]},'cmd':_0x48d2c4[_0x1e2b55(0x1ec)]};case CollaborationEvent[_0x1e2b55(0x29e)]:return{..._0x48d2c4,'data':{..._0x1edfe0,'data':_0x1edfe0['uniscriptRunEvent']},'cmd':_0x48d2c4[_0x1e2b55(0x1ec)]};default:return _0x48d2c4;}}default:return _0x48d2c4;}}function serializeCombRequest(_0x21750b){const _0x7baf2=_0x187924;switch(_0x21750b[_0x7baf2(0x1ec)]){case CombCmd[_0x7baf2(0x2d9)]:case CombCmd[_0x7baf2(0x18d)]:return JSON[_0x7baf2(0x394)]({'cmd':_0x21750b[_0x7baf2(0x1ec)],'routeKey':_0x21750b[_0x7baf2(0x2f9)]});case CombCmd[_0x7baf2(0x388)]:{let _0x9eda0;switch(_0x21750b[_0x7baf2(0x218)][_0x7baf2(0x1bf)]){case CollaborationEvent['UPDATE_CURSOR']:_0x9eda0={'eventID':CollaborationEvent[_0x7baf2(0x3b1)],'updateCursorEvent':_0x21750b[_0x7baf2(0x218)][_0x7baf2(0x218)]};break;case CollaborationEvent[_0x7baf2(0x351)]:_0x9eda0={'eventID':CollaborationEvent[_0x7baf2(0x351)],'leaveEvent':_0x21750b['data'][_0x7baf2(0x218)]};break;case CollaborationEvent['USERS_ENTER']:_0x9eda0={'eventID':CollaborationEvent[_0x7baf2(0x2ef)],'joinEvent':_0x21750b['data'][_0x7baf2(0x218)]};break;case CollaborationEvent['LIVESHARE_NEW_HOST']:_0x9eda0={'eventID':CollaborationEvent['LIVESHARE_NEW_HOST'],'liveShareNewHost':_0x21750b[_0x7baf2(0x218)][_0x7baf2(0x218)]};break;case CollaborationEvent['LIVESHARE_OPERATION']:_0x9eda0={'eventID':CollaborationEvent[_0x7baf2(0x366)],'liveShareOperation':_0x21750b[_0x7baf2(0x218)][_0x7baf2(0x218)]};break;case CollaborationEvent[_0x7baf2(0x34f)]:_0x9eda0={'eventID':CollaborationEvent[_0x7baf2(0x34f)],'liveShareTerminate':_0x21750b[_0x7baf2(0x218)][_0x7baf2(0x218)]};break;case CollaborationEvent[_0x7baf2(0x219)]:_0x9eda0={'eventID':CollaborationEvent[_0x7baf2(0x219)],'liveShareRequestHost':_0x21750b[_0x7baf2(0x218)][_0x7baf2(0x218)]};break;case CollaborationEvent[_0x7baf2(0x291)]:_0x9eda0={'eventID':CollaborationEvent[_0x7baf2(0x291)]};break;default:_0x9eda0={'eventID':_0x21750b[_0x7baf2(0x218)]['eventID']};}return JSON[_0x7baf2(0x394)]({'cmd':_0x21750b['cmd'],'routeKey':_0x21750b[_0x7baf2(0x2f9)],'collaMsg':_0x9eda0});}case CombCmd[_0x7baf2(0x37f)]:return JSON[_0x7baf2(0x394)]({'cmd':_0x21750b[_0x7baf2(0x1ec)],'routeKey':_0x21750b['routeKey'],'joinReq':_0x21750b[_0x7baf2(0x218)]});case CombCmd[_0x7baf2(0x380)]:return JSON['stringify']({'cmd':_0x21750b[_0x7baf2(0x1ec)],'routeKey':_0x21750b[_0x7baf2(0x2f9)],'leaveReq':_0x21750b['data']});default:throw new Error(_0x7baf2(0x31b));}}const ICollaborationSocketService=createIdentifier(_0x187924(0x33d));function generateSubmitChangesPath(_0x8445aa,_0x8505c5,_0x1b84f1){const _0x406604=_0x187924;return _0x8445aa+'/'+_0x8505c5+_0x406604(0x1a4)+_0x1b84f1+_0x406604(0x2d3);}let CollaborationSocketService=class CollaborationSocketService extends Disposable{constructor(_0x35b023,_0x1645e2,_0x158e0e,_0xe6af27,_0x437acb){const _0x12983b=_0x187924;super(),this['_injector']=_0x35b023,this[_0x12983b(0x398)]=_0x1645e2,this[_0x12983b(0x241)]=_0x158e0e,this[_0x12983b(0x326)]=_0xe6af27,this[_0x12983b(0x247)]=_0x437acb;}['_doCreateSocket'](_0x247daf){const _0x2e014a=_0x187924,_0x2960c1=this[_0x2e014a(0x32d)][_0x2e014a(0x21d)](ISocketService);if(!_0x2960c1)throw new Error(_0x2e014a(0x298));const _0x67fda5=_0x2960c1[_0x2e014a(0x1f4)](_0x247daf);if(!_0x67fda5)throw new Error(_0x2e014a(0x1a1));const _0x46f2c2=new DisposableCollection(),_0x3b0b2b=new Subject();_0x46f2c2[_0x2e014a(0x220)](_0x67fda5[_0x2e014a(0x29f)][_0x2e014a(0x352)](_0x10bddd=>_0x3b0b2b[_0x2e014a(0x1a5)](_0x10bddd))),_0x46f2c2[_0x2e014a(0x220)](toDisposable(()=>_0x3b0b2b[_0x2e014a(0x373)]()));const _0x4170a0=new Subject();_0x46f2c2[_0x2e014a(0x220)](_0x67fda5[_0x2e014a(0x2f1)][_0x2e014a(0x352)](_0x31240c=>_0x4170a0['next'](_0x31240c))),_0x46f2c2['add'](toDisposable(()=>_0x4170a0['complete']()));const _0x55e940=new Subject();_0x46f2c2[_0x2e014a(0x220)](_0x67fda5['message$']['subscribe'](_0x218894=>{const _0x58b9ab=deserializeToCombResponse(_0x218894);_0x55e940['next'](_0x58b9ab);})),_0x46f2c2[_0x2e014a(0x220)](toDisposable(()=>_0x55e940[_0x2e014a(0x373)]()));let _0xbbb94d;const _0x1f8d31=()=>{const _0x2ea9f3=_0x2e014a;_0x4170a0['next'](new Event(_0x2ea9f3(0x2ac))),_0x3b0b2b[_0x2ea9f3(0x1a5)](new Event(_0x2ea9f3(0x2ac))),_0xbbb94d[_0x2ea9f3(0x29b)]();};return _0xbbb94d={'memberID':'','close$':_0x3b0b2b[_0x2e014a(0x1e2)](),'error$':_0x4170a0[_0x2e014a(0x1e2)](),'open$':_0x67fda5[_0x2e014a(0x2a2)],'message$':_0x55e940[_0x2e014a(0x1e2)](),'send':_0xcbed26=>{const _0xd97b21=_0x2e014a;if(_0xcbed26['cmd']===CombCmd[_0xd97b21(0x388)]){if(_0xcbed26[_0xd97b21(0x218)][_0xd97b21(0x1bf)]===CollaborationEvent[_0xd97b21(0x2d4)]){this[_0xd97b21(0x348)](_0xbbb94d,_0xcbed26['data'])['catch'](_0x8ff0bd=>{const _0x250e5b=_0xd97b21;this[_0x250e5b(0x326)][_0x250e5b(0x28d)](_0x8ff0bd),_0x1f8d31();});return;}if(_0xcbed26[_0xd97b21(0x218)][_0xd97b21(0x1bf)]===CollaborationEvent['FETCH_MISSING']){const _0x2f49b8=_0xcbed26[_0xd97b21(0x218)];this['_fetchMissChangesets'](_0x2f49b8)[_0xd97b21(0x1b2)](_0x15ae9e=>{const _0x49cc09=_0xd97b21;_0x55e940[_0x49cc09(0x1a5)]({'cmd':CombCmd[_0x49cc09(0x294)],'code':CmdRspCode['OK'],'routeKey':_0x2f49b8['data'][_0x49cc09(0x364)],'routeType':'','data':{'eventID':CollaborationEvent[_0x49cc09(0x353)],'data':{'changesets':_0x15ae9e}}});})[_0xd97b21(0x15b)](_0x2ed2d0=>{const _0x45222f=_0xd97b21;this[_0x45222f(0x326)][_0x45222f(0x28d)](_0x2ed2d0),_0x1f8d31();});return;}}_0x67fda5[_0xd97b21(0x358)](serializeCombRequest(_0xcbed26));},'close':()=>{const _0x414533=_0x2e014a;_0x67fda5['close'](),_0x46f2c2[_0x414533(0x382)]();}},_0xbbb94d;}async[_0x187924(0x348)](_0x15e6ee,_0xfcdb6f){const _0x39e9bd=_0x187924;var _0x223ebe;const {unitType:_0x567947,unitID:_0x5c7d61,changeset:_0x139ead}=_0xfcdb6f[_0x39e9bd(0x218)],_0x586a0a={'unitID':_0x5c7d61,'memberID':_0x15e6ee[_0x39e9bd(0x370)],'type':_0x567947,'changeset':parseChangesetToProtocol(_0x139ead)},_0x3534e8=this[_0x39e9bd(0x241)][_0x39e9bd(0x281)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),_0x42c2a4=generateSubmitChangesPath((_0x223ebe=_0x3534e8===null||_0x3534e8===void 0x0?void 0x0:_0x3534e8['collabSubmitChangesetUrl'])!==null&&_0x223ebe!==void 0x0?_0x223ebe:DEFAULT_COLLAB_SUBMIT_CHANGESET_URL,_0x567947,_0x5c7d61);try{await this[_0x39e9bd(0x398)]['post'](_0x42c2a4,{'body':_0x586a0a});}catch(_0x6b0928){this['_logService'][_0x39e9bd(0x28d)](_0x39e9bd(0x2e4),'submit\x20changeset\x20error!');throw _0x6b0928;}}async[_0x187924(0x28a)](_0x489100){const _0x59cc13=_0x187924,{unitID:_0x5cea57,from:_0x1e6926,to:_0x51bacd,unitType:_0x39a9c9}=_0x489100[_0x59cc13(0x218)];return(await this[_0x59cc13(0x247)][_0x59cc13(0x279)]({'metadata':void 0x0},{'unitID':_0x5cea57,'type':_0x39a9c9,'from':_0x1e6926,'to':_0x51bacd}))['changesets'][_0x59cc13(0x25f)](_0x4b3f66=>{const _0x28742b=_0x59cc13;if(_0x4b3f66[_0x28742b(0x36c)]===null||_0x4b3f66[_0x28742b(0x36c)]===void 0x0)_0x4b3f66['mutations']=[];return _0x4b3f66;});}};CollaborationSocketService=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,Inject(HTTPService)),__decorateParam(0x2,IConfigService),__decorateParam(0x3,ILogService),__decorateParam(0x4,ISnapshotServerService)],CollaborationSocketService);let CollaborationSessionService=class CollaborationSessionService extends Disposable{get[_0x187924(0x154)](){const _0x3ef7d2=_0x187924;return this[_0x3ef7d2(0x3a2)][_0x3ef7d2(0x1e3)]();}constructor(_0x271450,_0x4bb79f,_0x3c1cc0,_0x51e2e3,_0x41f050,_0x1a6d92){const _0x735e32=_0x187924;super(),this[_0x735e32(0x32d)]=_0x271450,this[_0x735e32(0x326)]=_0x4bb79f,this[_0x735e32(0x241)]=_0x3c1cc0,this[_0x735e32(0x1a9)]=_0x51e2e3,this['_collaborationUIEventService']=_0x41f050,this[_0x735e32(0x3a5)]=_0x1a6d92,_defineProperty(this,_0x735e32(0x3a2),new BehaviorSubject(void 0x0)),_defineProperty(this,'socket$',this['_socket$'][_0x735e32(0x1e2)]()),_defineProperty(this,_0x735e32(0x16d),null),_defineProperty(this,_0x735e32(0x2de),new Map()),_defineProperty(this,_0x735e32(0x3b8),new BehaviorSubject(SessionStatus[_0x735e32(0x253)])),_defineProperty(this,_0x735e32(0x1ad),this[_0x735e32(0x3b8)][_0x735e32(0x1e2)]()),_defineProperty(this,_0x735e32(0x202),![]),_defineProperty(this,_0x735e32(0x2fc),void 0x0),_defineProperty(this,_0x735e32(0x216),0x0),_defineProperty(this,_0x735e32(0x1be),void 0x0),_defineProperty(this,_0x735e32(0x2f6),void 0x0),this[_0x735e32(0x301)]();}[_0x187924(0x301)](){const _0x5ee7db=_0x187924;if(!this[_0x5ee7db(0x3a5)])return;this['disposeWithMe'](this['_networkConditionService'][_0x5ee7db(0x377)][_0x5ee7db(0x352)](_0x42c850=>{const _0x1f3731=_0x5ee7db;if(_0x42c850&&!this[_0x1f3731(0x154)])this[_0x1f3731(0x20d)]();if(!_0x42c850)this[_0x1f3731(0x333)]();}));}[_0x187924(0x382)](){const _0x38603d=_0x187924;super[_0x38603d(0x382)](),this[_0x38603d(0x293)](),this[_0x38603d(0x1a2)](),this[_0x38603d(0x3a1)](),this[_0x38603d(0x2de)][_0x38603d(0x2e5)](_0x52dadf=>_0x52dadf[_0x38603d(0x382)]()),this[_0x38603d(0x2de)][_0x38603d(0x30b)](),this[_0x38603d(0x3b8)][_0x38603d(0x373)]();}async[_0x187924(0x31f)](_0x321d62){const _0x562148=_0x187924;if(this[_0x562148(0x2de)][_0x562148(0x30a)](_0x321d62))return this['_sessions'][_0x562148(0x21d)](_0x321d62);this[_0x562148(0x244)]();const _0x7cb7b6=this['_injector'][_0x562148(0x369)](CollaborationSession,_0x321d62,this[_0x562148(0x3a2)][_0x562148(0x1e2)]());return this[_0x562148(0x2de)][_0x562148(0x39d)](_0x321d62,_0x7cb7b6),_0x7cb7b6;}[_0x187924(0x1dd)](_0x4ff064){const _0x33b6ed=_0x187924,_0x408869=this[_0x33b6ed(0x2de)][_0x33b6ed(0x21d)](_0x4ff064);_0x408869&&(this[_0x33b6ed(0x2de)][_0x33b6ed(0x375)](_0x4ff064),_0x408869[_0x33b6ed(0x29b)]());if(!this[_0x33b6ed(0x2de)][_0x33b6ed(0x2a3)]){var _0x116ece;(_0x116ece=this[_0x33b6ed(0x154)])===null||_0x116ece===void 0x0||_0x116ece[_0x33b6ed(0x29b)]();}}['reconnect'](){const _0x11a8b7=_0x187924;this[_0x11a8b7(0x216)]=0x0,this[_0x11a8b7(0x293)](),this['_tryReconnect']();}[_0x187924(0x293)](){const _0x1ab2c6=_0x187924;this[_0x1ab2c6(0x2fc)]!=null&&(clearTimeout(this[_0x1ab2c6(0x2fc)]),this[_0x1ab2c6(0x2fc)]=null);}async[_0x187924(0x3ad)](){const _0x3abd1a=_0x187924;var _0x1674c6;const _0x188bc6=this[_0x3abd1a(0x241)][_0x3abd1a(0x281)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),_0x518ca4=(_0x1674c6=_0x188bc6===null||_0x188bc6===void 0x0?void 0x0:_0x188bc6[_0x3abd1a(0x29d)])!==null&&_0x1674c6!==void 0x0?_0x1674c6:DEFAULT_COLLAB_WEB_SOCKET_URL,_0x2c938e=await this['_socketService'][_0x3abd1a(0x1f4)](_0x518ca4);return this[_0x3abd1a(0x16d)]=_0x2c938e,_0x2c938e;}async[_0x187924(0x244)](){const _0x4f0652=_0x187924;try{var _0xbed88c,_0x35c898;const _0x355c5d=(_0xbed88c=(_0x35c898=this[_0x4f0652(0x154)])!==null&&_0x35c898!==void 0x0?_0x35c898:this[_0x4f0652(0x16d)])!==null&&_0xbed88c!==void 0x0?_0xbed88c:await this['_createSocket']();if(_0x355c5d){const _0x47b001=_0x355c5d[_0x4f0652(0x358)];_0x355c5d['send']=_0x3675c9=>{const _0x494c71=_0x4f0652;if(_0x3675c9[_0x494c71(0x1ec)]!==CombCmd[_0x494c71(0x380)])this['_rescheduleHeartbeat']();return _0x47b001[_0x494c71(0x325)](_0x355c5d,[_0x3675c9]);},_0x355c5d[_0x4f0652(0x1e8)][_0x4f0652(0x352)](_0x2dcb3a=>this['_onMessage'](_0x355c5d,_0x2dcb3a)),_0x355c5d[_0x4f0652(0x2f1)][_0x4f0652(0x386)](_0x4df3da(0x1))[_0x4f0652(0x352)](_0x908a8a=>this['_logService'][_0x4f0652(0x28d)](_0x4f0652(0x223),_0x908a8a)),_0x355c5d[_0x4f0652(0x2a2)][_0x4f0652(0x386)](_0x4df3da(0x1))['subscribe'](()=>{const _0x3b15d5=_0x4f0652;this[_0x3b15d5(0x346)](_0x355c5d);}),_0x355c5d[_0x4f0652(0x29f)][_0x4f0652(0x386)](_0x4df3da(0x1))[_0x4f0652(0x352)](_0x1cf4bb=>{const _0x3d3648=_0x4f0652;this[_0x3d3648(0x326)][_0x3d3648(0x338)](_0x3d3648(0x372),'socket\x20close',_0x1cf4bb),this[_0x3d3648(0x239)]();});}}catch(_0x5a2f13){this['_logService']['error'](_0x5a2f13),this[_0x4f0652(0x239)]();}}[_0x187924(0x346)](_0x173f2d){const _0x37cf91=_0x187924;this[_0x37cf91(0x326)][_0x37cf91(0x338)](_0x37cf91(0x372),_0x37cf91(0x18f)),_0x173f2d[_0x37cf91(0x358)]({'cmd':CombCmd[_0x37cf91(0x18d)]}),this[_0x37cf91(0x37b)]();}['_onOffline'](){const _0x4065f2=_0x187924;this[_0x4065f2(0x202)]=![],this[_0x4065f2(0x16d)]=null,this[_0x4065f2(0x3b8)][_0x4065f2(0x1a5)](SessionStatus[_0x4065f2(0x184)]),this[_0x4065f2(0x3a2)][_0x4065f2(0x1a5)](null),this[_0x4065f2(0x1a2)](),this['_clearHeartbeatTimer']();}[_0x187924(0x239)](){const _0x4a08f2=_0x187924;var _0x330924;this[_0x4a08f2(0x333)]();if(this['_retryCount']<((_0x330924=this[_0x4a08f2(0x241)][_0x4a08f2(0x281)](_0x4a08f2(0x28f)))!==null&&_0x330924!==void 0x0?_0x330924:0x3))this[_0x4a08f2(0x24f)]['emitEvent']({'id':CollaborationUIEventId[_0x4a08f2(0x392)]}),this[_0x4a08f2(0x312)]();else this[_0x4a08f2(0x24f)][_0x4a08f2(0x313)]({'id':CollaborationUIEventId[_0x4a08f2(0x362)]});}[_0x187924(0x312)](){const _0x28b737=_0x187924;var _0x26fca4;const _0x287eef=this[_0x28b737(0x216)],_0x3356a1=this['_configService'][_0x28b737(0x281)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY),_0x5297bb=_0x287eef===0x0?0x0:((_0x26fca4=_0x3356a1===null||_0x3356a1===void 0x0?void 0x0:_0x3356a1[_0x28b737(0x33c)])!==null&&_0x26fca4!==void 0x0?_0x26fca4:DEFAULT_RETRY_CONNECTING_INTERVAL)*0x2**_0x287eef;this[_0x28b737(0x2fc)]=setTimeout(()=>{const _0x404e8e=_0x28b737;clearTimeout(this[_0x404e8e(0x2fc)]),this['_retryConnectingTimer']=null,this[_0x404e8e(0x244)]();},_0x5297bb),this[_0x28b737(0x216)]+=0x1;}[_0x187924(0x2cd)](_0x4c4f6a,_0x16ebb3){const _0x1eaba3=_0x187924,{cmd:_0x43136f}=_0x16ebb3;_0x43136f===CombCmd[_0x1eaba3(0x18d)]&&!this[_0x1eaba3(0x202)]&&(_0x4c4f6a[_0x1eaba3(0x370)]=_0x16ebb3[_0x1eaba3(0x218)]['memberID'],this['_socket$'][_0x1eaba3(0x1a5)](_0x4c4f6a),this[_0x1eaba3(0x3b8)][_0x1eaba3(0x1a5)](SessionStatus[_0x1eaba3(0x33f)]),this[_0x1eaba3(0x202)]=!![],this[_0x1eaba3(0x16d)]=null);if(_0x43136f===CombCmd[_0x1eaba3(0x2d9)])this[_0x1eaba3(0x1a2)]();this[_0x1eaba3(0x37b)]();}[_0x187924(0x37b)](){const _0x8d709c=_0x187924;var _0x50cf61;this['_clearHeartbeatTimer'](),this[_0x8d709c(0x1be)]=setTimeout(()=>this[_0x8d709c(0x1a6)](),(_0x50cf61=this[_0x8d709c(0x241)][_0x8d709c(0x281)](_0x8d709c(0x349)))!==null&&_0x50cf61!==void 0x0?_0x50cf61:DEFAULT_HEARTBEAT_INTERVAL);}[_0x187924(0x1a6)](){const _0x18c041=_0x187924;this['_socket'][_0x18c041(0x358)]({'cmd':CombCmd['HEARTBEAT']}),this[_0x18c041(0x185)]();}[_0x187924(0x185)](){const _0x3a5cba=_0x187924;var _0x1768d6;this[_0x3a5cba(0x2f6)]=setTimeout(()=>this['_onConnectionFailed'](),(_0x1768d6=this[_0x3a5cba(0x241)][_0x3a5cba(0x281)]('HEARTBEAT_TIMEOUT'))!==null&&_0x1768d6!==void 0x0?_0x1768d6:DEFAULT_HEARTBEAT_TIMEOUT);}[_0x187924(0x3a1)](){const _0x32b0f3=_0x187924;this[_0x32b0f3(0x1be)]!=null&&(clearTimeout(this[_0x32b0f3(0x1be)]),this['_sendHeartbeatTimer']=null);}[_0x187924(0x1a2)](){const _0x20b0b5=_0x187924;this[_0x20b0b5(0x2f6)]!=null&&(clearTimeout(this[_0x20b0b5(0x2f6)]),this[_0x20b0b5(0x2f6)]=null);}};CollaborationSessionService=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,ILogService),__decorateParam(0x2,IConfigService),__decorateParam(0x3,ICollaborationSocketService),__decorateParam(0x4,Inject(CollaborationUIEventService)),__decorateParam(0x5,Optional(INetworkConditionService))],CollaborationSessionService);let CollaborationController=class CollaborationController extends RxDisposable{constructor(_0xacf675,_0x182507,_0x269fc3,_0x310d21){const _0xe6db89=_0x187924;var _0x36d67;super(),this['_injector']=_0xacf675,this['_collabSessionService']=_0x182507,this[_0xe6db89(0x241)]=_0x269fc3,this[_0xe6db89(0x2ad)]=_0x310d21,_defineProperty(this,_0xe6db89(0x213),new Map()),_defineProperty(this,'_entityInit$',new Subject()),_defineProperty(this,_0xe6db89(0x27a),this['_entityInit$']['asObservable']());if(((_0x36d67=this[_0xe6db89(0x241)][_0xe6db89(0x281)](_0xe6db89(0x1c8)))===null||_0x36d67===void 0x0?void 0x0:_0x36d67['enableCollaboration'])!==![])this[_0xe6db89(0x33a)]();}[_0x187924(0x382)](){const _0x597a69=_0x187924;super[_0x597a69(0x382)](),this[_0x597a69(0x213)][_0x597a69(0x2e5)](_0x1d813f=>_0x1d813f[_0x597a69(0x382)]()),this[_0x597a69(0x213)][_0x597a69(0x30b)]();}[_0x187924(0x1ea)](_0x2c8339){const _0x120197=_0x187924;var _0x430d48;return(_0x430d48=this[_0x120197(0x213)]['get'](_0x2c8339))!==null&&_0x430d48!==void 0x0?_0x430d48:null;}[_0x187924(0x18a)](_0x488c29){const _0x2d7d7d=_0x187924,_0x14d45f=this['getCollabEntity'](_0x488c29);if(_0x14d45f)return of(_0x14d45f);return this[_0x2d7d7d(0x18b)][_0x2d7d7d(0x386)](filter(_0x301a19=>_0x301a19[_0x2d7d7d(0x364)]===_0x488c29));}[_0x187924(0x1cc)](_0xe3b0ea){const _0x5c9905=_0x187924;return firstValueFrom(this[_0x5c9905(0x18a)](_0xe3b0ea)[_0x5c9905(0x386)](_0x4d57e7(()=>void 0x0)));}[_0x187924(0x33a)](){const _0x2d535b=_0x187924,_0x512ee8=0x10;this[_0x2d535b(0x2ad)][_0x2d535b(0x2b0)](UniverInstanceType[_0x2d535b(0x2b9)])[_0x2d535b(0x386)](takeUntil(this[_0x2d535b(0x1f2)]),delay(_0x512ee8))[_0x2d535b(0x352)](async _0x34e9ee=>{const _0x532e86=_0x2d535b,_0x138339=_0x34e9ee[_0x532e86(0x38f)][_0x532e86(0x187)](),_0x55ab7b=await this[_0x532e86(0x157)](_0x138339,UniverInstanceType[_0x532e86(0x2b9)]);this[_0x532e86(0x213)][_0x532e86(0x39d)](_0x138339,_0x55ab7b);}),this[_0x2d535b(0x2ad)][_0x2d535b(0x2b0)](UniverInstanceType[_0x2d535b(0x2cf)])[_0x2d535b(0x386)](takeUntil(this['dispose$']),delay(_0x512ee8))[_0x2d535b(0x386)](filter(_0x457b9b=>{const _0x156afe=_0x2d535b;return!_0x457b9b[_0x156afe(0x38f)][_0x156afe(0x187)]()[_0x156afe(0x2bd)]('__');}))[_0x2d535b(0x352)](async _0x4b5dcb=>{const _0x36a3ca=_0x2d535b,_0x1cae69=_0x4b5dcb['unit']['getUnitId'](),_0x33d8e9=await this[_0x36a3ca(0x157)](_0x1cae69,UniverInstanceType[_0x36a3ca(0x2cf)]);this[_0x36a3ca(0x213)][_0x36a3ca(0x39d)](_0x1cae69,_0x33d8e9);}),_0x148a33(this[_0x2d535b(0x2ad)][_0x2d535b(0x2c5)](UniverInstanceType[_0x2d535b(0x2b9)]),this['_univerInstanceService'][_0x2d535b(0x2c5)](UniverInstanceType[_0x2d535b(0x2cf)]))[_0x2d535b(0x386)](takeUntil(this[_0x2d535b(0x1f2)]))[_0x2d535b(0x352)](_0xa1c7e1=>{const _0x2ba82c=_0x2d535b,_0x126285=_0xa1c7e1[_0x2ba82c(0x187)](),_0x1fc994=this['_entities'][_0x2ba82c(0x21d)](_0x126285);_0x1fc994&&(_0x1fc994[_0x2ba82c(0x382)](),this[_0x2ba82c(0x213)]['delete'](_0x126285));});}async[_0x187924(0x157)](_0x5cc1be,_0x3f8bb1){const _0x19c7a2=_0x187924,_0x237162=await this[_0x19c7a2(0x342)]['requireSession'](_0x5cc1be),_0x41f3c6=this[_0x19c7a2(0x32d)][_0x19c7a2(0x369)](this['_getCtorByUniverInstanceType'](_0x3f8bb1),_0x5cc1be,_0x3f8bb1,_0x237162);return await _0x41f3c6['init'](),this[_0x19c7a2(0x18b)][_0x19c7a2(0x1a5)](_0x41f3c6),_0x41f3c6;}[_0x187924(0x296)](_0x4e130f){const _0x59f152=_0x187924;switch(_0x4e130f){case UniverInstanceType[_0x59f152(0x2cf)]:return DocCollaborationEntity;case UniverInstanceType[_0x59f152(0x2b9)]:return SheetCollaborationEntity;default:throw new Error('[CollaborationController]:\x20invalid\x20univer\x20type:\x20'+_0x4e130f);}}};CollaborationController=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,Inject(CollaborationSessionService)),__decorateParam(0x2,IConfigService),__decorateParam(0x3,IUniverInstanceService)],CollaborationController);var name=_0x187924(0x3b7),version=_0x187924(0x1f9);const DEFAULT_FILE_NAME_KEY='DEFAULT_FILE_NAME',UNIVER_DEFAULT_FILE_NAME=_0x187924(0x3b6);let FileNameController=class FileNameController extends Disposable{constructor(_0x5d3093,_0x16602c){const _0xf56d8a=_0x187924;super(),this[_0xf56d8a(0x2ad)]=_0x5d3093,this[_0xf56d8a(0x241)]=_0x16602c,this[_0xf56d8a(0x33a)]();}[_0x187924(0x33a)](){const _0x328206=_0x187924;this[_0x328206(0x1b0)](this[_0x328206(0x2ad)][_0x328206(0x3a4)][_0x328206(0x352)](()=>{const _0xa1c35e=_0x328206;var _0x354e61;const _0xbc65ce=this[_0xa1c35e(0x2ad)][_0xa1c35e(0x23c)]();let _0x49e9e6=(_0x354e61=this['_configService']['getConfig'](_0xa1c35e(0x39c)))!==null&&_0x354e61!==void 0x0?_0x354e61:UNIVER_DEFAULT_FILE_NAME;if(_0xbc65ce instanceof Workbook)_0x49e9e6=_0xbc65ce[_0xa1c35e(0x285)];document[_0xa1c35e(0x302)]=_0x49e9e6;}));}};FileNameController=__decorate([__decorateParam(0x0,IUniverInstanceService),__decorateParam(0x1,IConfigService)],FileNameController);let AuthServerService=class AuthServerService{constructor(_0x2b259f,_0x2707f3,_0xa48922){const _0x263748=_0x187924;this[_0x263748(0x241)]=_0x2b259f,this[_0x263748(0x398)]=_0x2707f3,this[_0x263748(0x2b8)]=_0xa48922,this[_0x263748(0x210)]();}[_0x187924(0x210)](){const _0x4aa812=_0x187924;this[_0x4aa812(0x398)]['registerHTTPInterceptor']({'priority':0x1,'interceptor':(_0x335ecf,_0x3f0614)=>{return _0x3f0614(_0x335ecf)['pipe'](concatMap(async _0x45017c=>{const _0x30549a=_0x5993,_0x2255d0=_0x45017c;if(_0x2255d0[_0x30549a(0x260)]===0x191){if(typeof window===_0x30549a(0x356))throw new Error(_0x30549a(0x1b3));if(window[_0x30549a(0x340)](this[_0x30549a(0x2b8)]['t']('auth.needGotoLoginAlert'))){const _0x4c0056=window[_0x30549a(0x2a7)](window[_0x30549a(0x1b8)]['href']);window['location'][_0x30549a(0x278)]=this['_getLoginPath']()+_0x30549a(0x37d)+_0x4c0056;}}return _0x2255d0;}));}});}[_0x187924(0x153)](){const _0x1b2b4c=_0x187924;var _0x292a02;const _0x57ea79=this[_0x1b2b4c(0x241)][_0x1b2b4c(0x281)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x292a02=_0x57ea79===null||_0x57ea79===void 0x0?void 0x0:_0x57ea79['loginUrlKey'])!==null&&_0x292a02!==void 0x0?_0x292a02:DEFAULT_LOGIN_URL;}};AuthServerService=__decorate([__decorateParam(0x0,IConfigService),__decorateParam(0x1,Inject(HTTPService)),__decorateParam(0x2,Inject(LocaleService))],AuthServerService);const DEFAULT_AUTHZ_URL_KEY$1=_0x187924(0x256);let AuthzIoHttpService=class AuthzIoHttpService extends Disposable{constructor(_0x475765,_0x17b916){const _0x318b65=_0x187924;super(),this[_0x318b65(0x194)]=_0x475765,this[_0x318b65(0x241)]=_0x17b916,_defineProperty(this,_0x318b65(0x1da),![]),this[_0x318b65(0x1c9)]();}[_0x187924(0x1c9)](){const _0x264f6b=_0x187924,_0xa0cefc=this;this[_0x264f6b(0x1b0)](this[_0x264f6b(0x194)][_0x264f6b(0x1f8)]({'priority':0x3e7,'interceptor':MergeInterceptorFactory({'isMatch'(_0x4ff1cf){const _0x25d184=_0x264f6b;var _0x105baa;if(_0x4ff1cf[_0x25d184(0x2cb)]==='POST'&&((_0x105baa=_0x4ff1cf[_0x25d184(0x323)])===null||_0x105baa===void 0x0?void 0x0:_0x105baa['body'])){const {objectID:_0x29aa69,objectType:_0x471bfd}=_0x4ff1cf[_0x25d184(0x323)][_0x25d184(0x15c)]||{};if(!_0x29aa69||_0x471bfd===void 0x0)return![];const _0x3858ff=_0xa0cefc[_0x25d184(0x198)]()+'/'+_0x471bfd+'/object/'+_0x29aa69+_0x25d184(0x1a8);if(_0x4ff1cf['url']===_0x3858ff)return!![];}return![];},'getParamsFromRequest'(_0x13b02d){const _0x1bfba3=_0x264f6b;var _0x399d18;return(_0x399d18=_0x13b02d['requestParams'])===null||_0x399d18===void 0x0?void 0x0:_0x399d18[_0x1bfba3(0x15c)];},'mergeParamsToRequest'(_0x4c9238,_0x3b0551){const _0x5f0b7c=_0x264f6b,_0xb98809=_0xa0cefc[_0x5f0b7c(0x198)]()+_0x5f0b7c(0x26d),_0xbf022e=_0x4c9238[_0x5f0b7c(0x35f)]((_0x5752ae,_0xf92faa)=>{const _0x4202b3=_0x5f0b7c,{unitID:_0x538328,objectID:_0x129704,objectType:_0x1d1abb,actions:_0x1ef49f}=_0xf92faa;if(!_0x5752ae[_0x538328])_0x5752ae[_0x538328]={};if(!_0x5752ae[_0x538328][_0x129704])_0x5752ae[_0x538328][_0x129704]={'objectID':_0x129704,'objectType':_0x1d1abb,'actions':[]};return _0x5752ae[_0x538328][_0x129704][_0x4202b3(0x1bb)][_0x4202b3(0x374)](..._0x1ef49f),_0x5752ae;},{}),_0x4d659d=[];for(const _0x1ef3d6 in _0xbf022e)for(const _0x46c35c in _0xbf022e[_0x1ef3d6]){const {actions:_0x232b34,objectType:_0x2af2c8}=_0xbf022e[_0x1ef3d6][_0x46c35c],_0x297a52=[...new Set(_0x232b34)];_0x4d659d[_0x5f0b7c(0x374)]({'unitID':_0x1ef3d6,'objectID':_0x46c35c,'objectType':_0x2af2c8,'actions':_0x297a52});}return new HTTPRequest(_0x5f0b7c(0x183),_0xb98809,{'headers':_0x3b0551['headers'],'withCredentials':_0x3b0551[_0x5f0b7c(0x389)],'responseType':_0x3b0551[_0x5f0b7c(0x3ba)],'body':{'requests':_0x4d659d}});}},{'distributeResult'(_0x38b95c,_0x597aee){const {objectActions:_0x350cf7}=_0x38b95c;return _0x597aee['map'](_0x32937e=>{const _0xa0ef36=_0x5993,{unitID:_0x5aedb2,objectID:_0xe02159,actions:_0xa3066c}=_0x32937e,_0x22de23=_0x350cf7[_0xa0ef36(0x1cb)](_0x199795=>_0x199795[_0xa0ef36(0x364)]===_0x5aedb2&&_0x199795[_0xa0ef36(0x318)]===_0xe02159);return{'config':_0x32937e,'result':{'actions':_0xa3066c[_0xa0ef36(0x25f)](_0x4c682a=>_0x22de23===null||_0x22de23===void 0x0?void 0x0:_0x22de23[_0xa0ef36(0x1bb)]['find'](_0x437d17=>_0x437d17[_0xa0ef36(0x3bc)]===_0x4c682a))[_0xa0ef36(0x21e)](_0x33c579=>!!_0x33c579),'error':_0x38b95c[_0xa0ef36(0x28d)]}};});}})}));}[_0x187924(0x198)](){const _0x12c1ab=_0x187924;var _0x381958;const _0x20aded=this['_configService']['getConfig'](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x381958=_0x20aded===null||_0x20aded===void 0x0?void 0x0:_0x20aded[_0x12c1ab(0x385)])!==null&&_0x381958!==void 0x0?_0x381958:DEFAULT_AUTHZ_URL_KEY$1;}async[_0x187924(0x1dc)](_0x46b8bf){const _0x5244fa=_0x187924,_0x5470f2=this[_0x5244fa(0x198)]()+'/'+_0x46b8bf[_0x5244fa(0x2ff)]+_0x5244fa(0x251);return(await this[_0x5244fa(0x194)]['post'](_0x5470f2,{'body':_0x46b8bf}))[_0x5244fa(0x15c)][_0x5244fa(0x318)]||'';}async[_0x187924(0x2f8)](_0x58e95a){const _0x510b67=_0x187924,_0x23002e=this[_0x510b67(0x198)]()+_0x510b67(0x1c6);return(await this['_HTTPService'][_0x510b67(0x203)](_0x23002e,{'body':_0x58e95a}))[_0x510b67(0x15c)][_0x510b67(0x299)];}async[_0x187924(0x261)](_0x26bc83){const _0x4d9168=_0x187924;var _0x3a6219;const _0xf772ee=this[_0x4d9168(0x198)]()+'/'+_0x26bc83[_0x4d9168(0x2ff)]+'/object/'+_0x26bc83['objectID'],_0x5c77dd=await this[_0x4d9168(0x194)]['put'](_0xf772ee,{'body':_0x26bc83});if((_0x5c77dd===null||_0x5c77dd===void 0x0||(_0x3a6219=_0x5c77dd['body'])===null||_0x3a6219===void 0x0||(_0x3a6219=_0x3a6219[_0x4d9168(0x28d)])===null||_0x3a6219===void 0x0?void 0x0:_0x3a6219[_0x4d9168(0x268)])!==0x1)throw new Error(_0x4d9168(0x3b2));}async[_0x187924(0x371)](_0x22a9e6){const _0x4a2f0a=_0x187924,_0x3deb3a=this[_0x4a2f0a(0x198)]()+'/'+_0x22a9e6[_0x4a2f0a(0x2ff)]+'/object/'+_0x22a9e6[_0x4a2f0a(0x318)]+_0x4a2f0a(0x1a8);return(await this[_0x4a2f0a(0x194)]['post'](_0x3deb3a,{'body':_0x22a9e6}))[_0x4a2f0a(0x15c)]['actions'];}async[_0x187924(0x25e)](_0x47ebb5){const _0x535528=_0x187924,_0x575ea0=this[_0x535528(0x198)]()+'/-/object/-/batch_allowed';return(await this[_0x535528(0x194)][_0x535528(0x203)](_0x575ea0,{'body':{'requests':_0x47ebb5}}))[_0x535528(0x15c)][_0x535528(0x283)];}async[_0x187924(0x25d)](_0x30a6b3){const _0x586c7b=_0x187924,_0x7abf2d=this['_getAPIPrefixPath']()+'/'+_0x30a6b3[_0x586c7b(0x2ff)]+_0x586c7b(0x23b),_0x282352=await this['_HTTPService'][_0x586c7b(0x203)](_0x7abf2d,{'body':_0x30a6b3});return{'roles':_0x282352[_0x586c7b(0x15c)][_0x586c7b(0x2d6)],'actions':_0x282352[_0x586c7b(0x15c)]['actions']};}async[_0x187924(0x31d)](_0x1c381d){const _0x2f0642=_0x187924,_0x5d38c0=this[_0x2f0642(0x198)]()+_0x2f0642(0x179);await this[_0x2f0642(0x194)]['delete'](_0x5d38c0,{'params':{'collaboratorID':_0x1c381d['collaboratorID'],'objectID':_0x1c381d[_0x2f0642(0x318)],'unitID':_0x1c381d[_0x2f0642(0x364)]}});}async[_0x187924(0x1bd)](_0x525398){const _0x568f39=_0x187924,_0x592c6a=this[_0x568f39(0x198)]()+_0x568f39(0x179);await this[_0x568f39(0x194)][_0x568f39(0x26a)](_0x592c6a,{'body':_0x525398});}async[_0x187924(0x1cf)](_0x7e91e9){const _0x2ad399=_0x187924,_0x2169a3=this['_getAPIPrefixPath']()+_0x2ad399(0x179);await this['_HTTPService'][_0x2ad399(0x203)](_0x2169a3,{'body':_0x7e91e9});}async['listCollaborators'](_0x4423ab){const _0x396871=_0x187924;var _0x519b3f;const _0x55c66f=this[_0x396871(0x198)]()+_0x396871(0x179),_0x1e1504=await this[_0x396871(0x194)][_0x396871(0x21d)](_0x55c66f,{'params':{'objectID':_0x4423ab[_0x396871(0x318)],'unitID':_0x4423ab['unitID']}});return this['setCfgEnableObjInherit']((_0x519b3f=_0x1e1504[_0x396871(0x15c)][_0x396871(0x270)])!==null&&_0x519b3f!==void 0x0?_0x519b3f:![]),_0x1e1504[_0x396871(0x15c)][_0x396871(0x1b1)];}async[_0x187924(0x2e0)](_0x285816){const _0xd1ff46=_0x187924,_0x40c438=this[_0xd1ff46(0x198)]()+'/collaborator';await this[_0xd1ff46(0x194)][_0xd1ff46(0x331)](_0x40c438,{'body':_0x285816});}[_0x187924(0x26e)](_0xcf3639){const _0x3cef57=_0x187924;this[_0x3cef57(0x1da)]=_0xcf3639;}[_0x187924(0x1ed)](){const _0x297755=_0x187924;return this[_0x297755(0x1da)];}};AuthzIoHttpService=__decorate([__decorateParam(0x0,Inject(HTTPService)),__decorateParam(0x1,Inject(IConfigService))],AuthzIoHttpService);function base64ToBytes(_0x336395){const _0x56fc05=_0x187924,_0x42ab76=atob(_0x336395),_0x907dd5=new Uint8Array(_0x42ab76[_0x56fc05(0x35a)]);for(let _0x5455c4=0x0;_0x5455c4<_0x42ab76[_0x56fc05(0x35a)];_0x5455c4++)_0x907dd5[_0x5455c4]=_0x42ab76['charCodeAt'](_0x5455c4);return _0x907dd5;}function bytesToBase64(_0xc6462){const _0x2f233c=_0x187924;let _0x50c691='';for(let _0x1b1e67=0x0;_0x1b1e67<_0xc6462[_0x2f233c(0x35a)];_0x1b1e67++)_0x50c691+=String[_0x2f233c(0x209)](_0xc6462[_0x1b1e67]);return btoa(_0x50c691);}function encrypt(_0x100e3f,_0x295d0f){const _0x47ff03=base64ToBytes(_0x295d0f),_0x1f6734=randomBytes(0x10);return bytesToBase64(concatBytes(_0x1f6734,cbc(_0x47ff03,_0x1f6734)['encrypt'](utf8ToBytes(_0x100e3f))));}function getAttachHeader(){const _0x568d65=_0x187924,_0x3c813a=getGlobalObject()['__Key__'];if(typeof window!==_0x568d65(0x356)&&typeof window[_0x568d65(0x1b8)]!=='undefined'&&_0x3c813a){const _0x429826={'time':Math['floor'](Date[_0x568d65(0x30c)]()/0x3e8),'domain':location[_0x568d65(0x1e9)]};return encrypt(JSON[_0x568d65(0x394)](_0x429826),_0x3c813a);}}let DomainRequestService=class DomainRequestService{constructor(_0x24fc71){const _0x2eeb54=_0x187924;this[_0x2eeb54(0x398)]=_0x24fc71,this[_0x2eeb54(0x3b3)]();}[_0x187924(0x3b3)](){const _0x477962=_0x187924;this[_0x477962(0x398)][_0x477962(0x1f8)]({'interceptor':(_0x566606,_0x562bbf)=>{const _0x35387b=_0x477962,_0x224b9e=getAttachHeader();if(_0x224b9e)_0x566606['headers'][_0x35387b(0x39d)]('x-univer-host',_0x224b9e);return _0x562bbf(_0x566606);}});}};DomainRequestService=__decorate([__decorateParam(0x0,Inject(HTTPService))],DomainRequestService);let DataLoaderService=class DataLoaderService extends RxDisposable{constructor(_0x2951b5,_0x5972d9,_0x109daa){const _0x1a6317=_0x187924;super(),this[_0x1a6317(0x326)]=_0x2951b5,this[_0x1a6317(0x232)]=_0x5972d9,this['_localCacheService']=_0x109daa,_defineProperty(this,_0x1a6317(0x169),new BehaviorSubject(null)),_defineProperty(this,_0x1a6317(0x2f7),this['_unitInfo$']['asObservable']());}async[_0x187924(0x2bc)](_0x705a4,_0x26bc35,_0x4c219e){const _0x4181cd=_0x187924;this['_unitInfo$'][_0x4181cd(0x1a5)]({'unitId':_0x705a4,'type':_0x26bc35});let _0x26707a=null;switch(_0x26bc35){case UniverInstanceType['UNIVER_SHEET']:_0x26707a=await this['_snapshotService'][_0x4181cd(0x32c)](_0x705a4,_0x4c219e);break;case UniverInstanceType[_0x4181cd(0x2cf)]:_0x26707a=await this[_0x4181cd(0x232)][_0x4181cd(0x3a8)](_0x705a4,_0x4c219e);break;default:this['_logService']['error'](_0x4181cd(0x1df),_0x4181cd(0x1c3));break;}return _0x26707a;}async['loadUnit'](_0x2daa75,_0x2bbee2,_0x57d2d6){const _0x32d4eb=_0x187924;var _0x1b1017;this[_0x32d4eb(0x169)][_0x32d4eb(0x1a5)]({'unitId':_0x2daa75,'type':_0x2bbee2,'subUnitId':_0x57d2d6});let _0x3fa8f7=0x0;const _0x5dad8d=await((_0x1b1017=this[_0x32d4eb(0x163)])===null||_0x1b1017===void 0x0?void 0x0:_0x1b1017[_0x32d4eb(0x289)](_0x2daa75));if(_0x5dad8d&&(_0x5dad8d[_0x32d4eb(0x1d8)]||_0x5dad8d[_0x32d4eb(0x36c)][_0x32d4eb(0x35a)]!==0x0))_0x3fa8f7=_0x5dad8d[_0x32d4eb(0x27c)];if(_0x3fa8f7===0x0)this[_0x32d4eb(0x326)][_0x32d4eb(0x338)](_0x32d4eb(0x1df),'fetching\x20the\x20latest\x20document\x20from\x20the\x20server.');return this['loadUnitOfRevision'](_0x2daa75,_0x2bbee2,_0x3fa8f7);}};DataLoaderService=__decorate([__decorateParam(0x0,ILogService),__decorateParam(0x1,Inject(SnapshotService)),__decorateParam(0x2,Optional(ILocalCacheService))],DataLoaderService);const ALLOW_IMAGE_LIST=[_0x187924(0x361),_0x187924(0x1d9),'image/jpg',_0x187924(0x339),_0x187924(0x2c2)],ALLOW_IMAGE_SIZE=0x5*0x400*0x400,DEFAULT_EXCHANGE_UPLOAD_FILE_SERVER_URL_KEY=_0x187924(0x206),DEFAULT_EXCHANGE_SIGN_URL_SERVER_URL_KEY=_0x187924(0x1c5);let CollaborationImageIoService=class CollaborationImageIoService{constructor(_0x52d439,_0x2e68a3,_0x8080cc){const _0x1975e4=_0x187924;this[_0x1975e4(0x398)]=_0x52d439,this[_0x1975e4(0x241)]=_0x2e68a3,this['_univerInstanceService']=_0x8080cc,_defineProperty(this,_0x1975e4(0x286),0x0),_defineProperty(this,_0x1975e4(0x295),new Subject()),_defineProperty(this,_0x1975e4(0x337),this[_0x1975e4(0x295)]),_defineProperty(this,_0x1975e4(0x39f),new Map());}[_0x187924(0x273)](_0x4a3ea8){const _0x50dad3=_0x187924;this[_0x50dad3(0x286)]=_0x4a3ea8,this[_0x50dad3(0x295)][_0x50dad3(0x1a5)](_0x4a3ea8);}[_0x187924(0x38e)](_0x388c7a,_0x1e51d3){const _0x933bc6=_0x187924;if(_0x1e51d3===ImageSourceType[_0x933bc6(0x217)]){const _0x110032=new Image();return _0x110032[_0x933bc6(0x3b9)]=_0x388c7a,_0x110032;}return this[_0x933bc6(0x39f)]['get'](_0x388c7a);}[_0x187924(0x205)](_0x19da6a,_0x38f1d3,_0x1420fc){const _0x42e571=_0x187924;if(_0x38f1d3===ImageSourceType[_0x42e571(0x217)]||_0x1420fc==null)return;this[_0x42e571(0x39f)][_0x42e571(0x39d)](_0x19da6a,_0x1420fc);}async[_0x187924(0x2b3)](_0x3afb43){const _0x59a7ea=_0x187924;try{const _0xe2b44d=this[_0x59a7ea(0x393)](this['_getSignURL'](),''+_0x3afb43),_0x2720e9=(await this[_0x59a7ea(0x398)]['get'](_0xe2b44d))[_0x59a7ea(0x15c)];if(_0x2720e9[_0x59a7ea(0x28d)]&&_0x2720e9[_0x59a7ea(0x28d)][_0x59a7ea(0x268)]===ErrorCode['OK']){const _0x299ab8=resolveWithBasePath(_0x2720e9['url'],this[_0x59a7ea(0x201)]());return Promise[_0x59a7ea(0x235)](_0x299ab8);}return Promise[_0x59a7ea(0x316)](_0x2720e9[_0x59a7ea(0x28d)]);}catch(_0xdba3f7){return Promise[_0x59a7ea(0x316)](_0xdba3f7);}}async[_0x187924(0x378)](_0xb6ac45){const _0x496b0d=_0x187924;let _0x65b699='';if(!ALLOW_IMAGE_LIST[_0x496b0d(0x28c)](_0xb6ac45['type']))return this[_0x496b0d(0x2e9)](),Promise[_0x496b0d(0x316)](new Error(ImageUploadStatusType[_0x496b0d(0x2c6)]));if(_0xb6ac45[_0x496b0d(0x2a3)]>ALLOW_IMAGE_SIZE)return this[_0x496b0d(0x2e9)](),Promise[_0x496b0d(0x316)](new Error(ImageUploadStatusType[_0x496b0d(0x24a)]));try{const _0x9adf8b=new FormData();_0x9adf8b[_0x496b0d(0x228)](_0x496b0d(0x309),_0xb6ac45);const _0x36f29e=this['_univerInstanceService'][_0x496b0d(0x23c)](),_0x37e01a=_0x36f29e===null||_0x36f29e===void 0x0?void 0x0:_0x36f29e[_0x496b0d(0x187)]();if(!_0x37e01a)throw new Error(_0x496b0d(0x263));const _0x36e947=this[_0x496b0d(0x17e)]()+_0x496b0d(0x1b6)+_0xb6ac45[_0x496b0d(0x2a3)][_0x496b0d(0x2e6)]()+_0x496b0d(0x20c)+FileSource['UnitEmbedded']+_0x496b0d(0x17a)+encodeURIComponent(_0x37e01a),_0x276300={'body':_0x9adf8b},_0x457aa5=(await this['_httpService'][_0x496b0d(0x203)](_0x36e947,_0x276300))['body'];if(typeof _0x457aa5[_0x496b0d(0x211)]!==_0x496b0d(0x1ab))return this[_0x496b0d(0x2e9)](),Promise[_0x496b0d(0x316)](new Error(ImageUploadStatusType['ERROR_IMAGE']));_0x65b699=_0x457aa5[_0x496b0d(0x211)];}catch(_0x11a8cf){return this[_0x496b0d(0x2e9)](),Promise[_0x496b0d(0x316)](new Error(ImageUploadStatusType[_0x496b0d(0x222)]));}return new Promise((_0x254ac0,_0x36f7f3)=>{const _0x4c4a3a=_0x496b0d,_0x5cb123=new FileReader();_0x5cb123[_0x4c4a3a(0x243)](_0xb6ac45),_0x5cb123[_0x4c4a3a(0x254)]=_0x5afa4e=>{const _0x2815a8=_0x4c4a3a;var _0x923386;const _0x3d778b=(_0x923386=_0x5afa4e[_0x2815a8(0x224)])===null||_0x923386===void 0x0?void 0x0:_0x923386['result'];if(_0x3d778b==null){this[_0x2815a8(0x2e9)](),_0x36f7f3(new Error(ImageUploadStatusType[_0x2815a8(0x222)]));return;}_0x254ac0({'imageId':generateRandomId(0x6),'imageSourceType':ImageSourceType[_0x2815a8(0x3ae)],'source':_0x65b699,'base64Cache':_0x3d778b,'status':ImageUploadStatusType[_0x2815a8(0x159)]}),this[_0x2815a8(0x2e9)]();};});}[_0x187924(0x17e)](){const _0x45d248=_0x187924;var _0x2e2681;const _0x2f54c6=this[_0x45d248(0x241)]['getConfig'](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x2e2681=_0x2f54c6===null||_0x2f54c6===void 0x0?void 0x0:_0x2f54c6[_0x45d248(0x1b7)])!==null&&_0x2e2681!==void 0x0?_0x2e2681:DEFAULT_EXCHANGE_UPLOAD_FILE_SERVER_URL_KEY;}[_0x187924(0x1b4)](){const _0x561c63=_0x187924;var _0x38b9af;const _0x1f33d6=this[_0x561c63(0x241)][_0x561c63(0x281)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x38b9af=_0x1f33d6===null||_0x1f33d6===void 0x0?void 0x0:_0x1f33d6['signUrlServerUrl'])!==null&&_0x38b9af!==void 0x0?_0x38b9af:DEFAULT_EXCHANGE_SIGN_URL_SERVER_URL_KEY;}['_getDownloadEndpointURL'](){const _0x3330a5=_0x187924;var _0x3b7483;const _0x1efa03=this[_0x3330a5(0x241)][_0x3330a5(0x281)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x3b7483=_0x1efa03===null||_0x1efa03===void 0x0?void 0x0:_0x1efa03[_0x3330a5(0x384)])!==null&&_0x3b7483!==void 0x0?_0x3b7483:location[_0x3330a5(0x1e0)];}['_replaceFileID'](_0x15ef85,_0x4759ca){const _0xe9ef1=_0x187924;return _0x15ef85[_0xe9ef1(0x199)](_0xe9ef1(0x17b),_0x4759ca);}[_0x187924(0x2e9)](){const _0x191e75=_0x187924;this[_0x191e75(0x286)]-=0x1,this[_0x191e75(0x295)][_0x191e75(0x1a5)](this['_waitCount']);}};CollaborationImageIoService=__decorate([__decorateParam(0x0,Inject(HTTPService)),__decorateParam(0x1,IConfigService),__decorateParam(0x2,Inject(IUniverInstanceService))],CollaborationImageIoService);const DEFAULT_AUTHZ_URL_KEY=_0x187924(0x256);let MentionIoHttpService=class MentionIoHttpService{constructor(_0x468db0,_0x5d8a7b){const _0x2ec8f2=_0x187924;this[_0x2ec8f2(0x241)]=_0x468db0,this[_0x2ec8f2(0x194)]=_0x5d8a7b;}['_getAPIPrefixPath'](){const _0x530839=_0x187924;var _0x3bf1ff;const _0x496434=this[_0x530839(0x241)][_0x530839(0x281)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x3bf1ff=_0x496434===null||_0x496434===void 0x0?void 0x0:_0x496434['authzUrl'])!==null&&_0x3bf1ff!==void 0x0?_0x3bf1ff:DEFAULT_AUTHZ_URL_KEY;}async[_0x187924(0x2f8)](_0x12e609){const _0x48402c=_0x187924,_0x5812d9=this[_0x48402c(0x198)]()+'/collaborator';return{'list':[{'title':_0x48402c(0x328),'mentions':(await this[_0x48402c(0x194)][_0x48402c(0x21d)](_0x5812d9,{'params':{'objectID':_0x12e609['unitId'],'unitID':_0x12e609['unitId']}}))[_0x48402c(0x15c)]['collaborators'][_0x48402c(0x25f)](_0x54cb77=>({'objectId':_0x54cb77['id'],'name':_0x54cb77['subject']['name'],'metadata':{'icon':_0x54cb77[_0x48402c(0x35c)][_0x48402c(0x1d4)]},'label':_0x54cb77[_0x48402c(0x35c)][_0x48402c(0x285)],'objectType':MentionType[_0x48402c(0x1e1)]})),'metadata':{},'type':MentionType['PERSON']}]};}};MentionIoHttpService=__decorate([__decorateParam(0x0,Inject(IConfigService)),__decorateParam(0x1,Inject(HTTPService))],MentionIoHttpService);let PermissionService=class PermissionService extends RxDisposable{constructor(_0x34cb07,_0xffcaf7,_0x261bff,_0x582b89,_0x48971f){const _0x46bafd=_0x187924;super(),this[_0x46bafd(0x32d)]=_0x34cb07,this[_0x46bafd(0x2ad)]=_0xffcaf7,this['_permissionService']=_0x261bff,this[_0x46bafd(0x16e)]=_0x582b89,this[_0x46bafd(0x24f)]=_0x48971f,this[_0x46bafd(0x327)](),this[_0x46bafd(0x231)]();}[_0x187924(0x231)](){const _0x8f58af=_0x187924,_0xd05b04=async _0x12c77c=>{const _0x2db3b9=_0x5993;(await this[_0x2db3b9(0x16e)][_0x2db3b9(0x31f)](_0x12c77c))[_0x2db3b9(0x238)][_0x2db3b9(0x386)](filter(_0x2a604c=>_0x2a604c[_0x2db3b9(0x1bf)]===CollaborationEvent[_0x2db3b9(0x1e7)]),_0x22954b(this[_0x2db3b9(0x1f2)]))[_0x2db3b9(0x352)](_0x24fac1=>{const _0x40bc40=_0x2db3b9,{reason:_0x7c4595}=_0x24fac1[_0x40bc40(0x218)];this[_0x40bc40(0x24f)][_0x40bc40(0x313)]({'id':CollaborationUIEventId[_0x40bc40(0x21c)],'data':_0x7c4595}),this[_0x40bc40(0x2e8)][_0x40bc40(0x192)](new WorkbookEditablePermission(_0x12c77c)['id'],![]),this['_collaborationSessionService'][_0x40bc40(0x1dd)](_0x12c77c);});};_0x148a33(this['_univerInstanceService'][_0x8f58af(0x2b0)](UniverInstanceType[_0x8f58af(0x2b9)]),this[_0x8f58af(0x2ad)][_0x8f58af(0x2b0)](UniverInstanceType[_0x8f58af(0x2cf)]))[_0x8f58af(0x386)](_0x4d57e7(_0x495f97=>_0x495f97['unit']['getUnitId']()),filter(_0x242ea9=>!isInternalEditorID(_0x242ea9)),_0x22954b(this[_0x8f58af(0x1f2)]))['subscribe'](_0x20b062=>{_0xd05b04(_0x20b062);});}[_0x187924(0x327)](){const _0x22d5b1=_0x187924,_0x317c45=async _0x47e9d7=>{const _0x52e073=_0x5993,_0x24810d=await this[_0x52e073(0x16e)][_0x52e073(0x31f)](_0x47e9d7),_0x39800e=this[_0x52e073(0x32d)][_0x52e073(0x21d)](SheetPermissionInitController);_0x24810d[_0x52e073(0x238)][_0x52e073(0x386)](filter(_0x372877=>_0x372877[_0x52e073(0x1bf)]===CollaborationEvent[_0x52e073(0x347)]),_0x22954b(this[_0x52e073(0x1f2)]))[_0x52e073(0x352)](_0x137aaf=>{const _0x4c3bcf=_0x52e073,{objectId:_0x3067b3}=_0x137aaf[_0x4c3bcf(0x218)];if(_0x3067b3===_0x47e9d7)_0x39800e[_0x4c3bcf(0x2fe)](_0x47e9d7);else _0x39800e[_0x4c3bcf(0x3bb)](_0x47e9d7,_0x3067b3);});};_0x148a33(this[_0x22d5b1(0x2ad)]['getTypeOfUnitAdded$'](UniverInstanceType[_0x22d5b1(0x2b9)]))['pipe'](_0x4d57e7(_0x4f3e59=>_0x4f3e59[_0x22d5b1(0x38f)][_0x22d5b1(0x187)]()),filter(_0x2f40d7=>!isInternalEditorID(_0x2f40d7)),_0x22954b(this[_0x22d5b1(0x1f2)]))[_0x22d5b1(0x352)](_0x6a88dc=>{_0x317c45(_0x6a88dc);});}};function _0x5993(_0x22bf14,_0x53b7b4){_0x22bf14=_0x22bf14-0x153;const _0x2151c6=_0x2151();let _0x599316=_0x2151c6[_0x22bf14];return _0x599316;}PermissionService=__decorate([__decorateParam(0x0,Inject(Injector)),__decorateParam(0x1,IUniverInstanceService),__decorateParam(0x2,IPermissionService),__decorateParam(0x3,Inject(CollaborationSessionService)),__decorateParam(0x4,Inject(CollaborationUIEventService))],PermissionService);let SnapshotServerOverHTTPService=class SnapshotServerOverHTTPService{constructor(_0x4ed3ba,_0x45cf53){const _0x178c49=_0x187924;this[_0x178c49(0x241)]=_0x4ed3ba,this[_0x178c49(0x398)]=_0x45cf53;}async[_0x187924(0x2a8)](_0x4adab4,_0x5c3eb2){const _0xcfb5db=_0x187924;var _0x3c2a7;const {unitID:_0x2cbde8,type:_0x205342,revision:revision=0x0}=_0x5c3eb2,_0x5b48b8=this[_0xcfb5db(0x343)]()+'/'+_0x205342+_0xcfb5db(0x1a4)+_0x2cbde8+_0xcfb5db(0x39a)+revision,_0x33a7cb=(await this[_0xcfb5db(0x398)]['get'](_0x5b48b8))['body'],_0x24af81=(_0x3c2a7=_0x33a7cb[_0xcfb5db(0x176)])===null||_0x3c2a7===void 0x0?void 0x0:_0x3c2a7[_0xcfb5db(0x230)];if(_0x24af81){const _0x3bc546=_0x24af81===null||_0x24af81===void 0x0?void 0x0:_0x24af81['originalMeta'];_0x24af81['originalMeta']=textEncoder[_0xcfb5db(0x288)](b64DecodeUnicode(_0x3bc546)),Object[_0xcfb5db(0x1c4)](_0x24af81[_0xcfb5db(0x276)])[_0xcfb5db(0x2e5)](([,_0x41a4c7])=>{const _0x15e65f=_0xcfb5db,_0x130f1a=_0x41a4c7[_0x15e65f(0x32f)];_0x41a4c7[_0x15e65f(0x32f)]=textEncoder[_0x15e65f(0x288)](b64DecodeUnicode(_0x130f1a));});}return _0x33a7cb;}async['getSheetBlock'](_0x406442,_0x3df00c){const _0x4d9d65=_0x187924,{unitID:_0xd59a41,type:_0x1eddc7,blockID:_0x5062fb}=_0x3df00c,_0x4a206b=this[_0x4d9d65(0x19a)]()+'/'+_0x1eddc7+_0x4d9d65(0x1a4)+_0xd59a41+'/block/'+_0x5062fb;return(await this['_httpService'][_0x4d9d65(0x21d)](_0x4a206b))[_0x4d9d65(0x15c)];}async['getDeserializedSheetBlock'](_0x25a6cf,_0x121691){const _0x2166b9=_0x187924,{unitID:_0x1b05f0,type:_0x5bc1af,blockID:_0x2777f3}=_0x121691,_0x508d44=this[_0x2166b9(0x19a)]()+_0x2166b9(0x397)+_0x5bc1af+_0x2166b9(0x1a4)+_0x1b05f0+'/block/'+_0x2777f3;return(await this[_0x2166b9(0x398)][_0x2166b9(0x21d)](_0x508d44))[_0x2166b9(0x15c)];}async[_0x187924(0x279)](_0x219f7f,_0x3168a9){const _0x253f2d=_0x187924,{unitID:_0x4d451d,type:_0x2c92d3,from:_0x446577,to:_0x137784}=_0x3168a9,_0x2b19a6=this[_0x253f2d(0x19a)]()+'/'+_0x2c92d3+_0x253f2d(0x1a4)+_0x4d451d+_0x253f2d(0x226)+_0x446577+_0x253f2d(0x20f)+_0x137784;return(await this[_0x253f2d(0x398)][_0x253f2d(0x21d)](_0x2b19a6))[_0x253f2d(0x15c)];}[_0x187924(0x343)](){const _0x111ef7=_0x187924;var _0x1a5b65;return(_0x1a5b65=this[_0x111ef7(0x241)][_0x111ef7(0x281)](_0x111ef7(0x2d1)))!==null&&_0x1a5b65!==void 0x0?_0x1a5b65:this[_0x111ef7(0x19a)]();}[_0x187924(0x19a)](){const _0x4f61b3=_0x187924;var _0x5645ad;const _0xe9f547=this[_0x4f61b3(0x241)][_0x4f61b3(0x281)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY);return(_0x5645ad=_0xe9f547===null||_0xe9f547===void 0x0?void 0x0:_0xe9f547[_0x4f61b3(0x290)])!==null&&_0x5645ad!==void 0x0?_0x5645ad:DEFAULT_SNAPSHOT_SERVER_URL;}async[_0x187924(0x39b)](_0x5ecccc,_0x1b250e){const _0x290442=_0x187924,_0x10380a=_0x290442(0x2f5)+_0x1b250e[_0x290442(0x19f)]+'/unit/'+_0x1b250e['unitID']+_0x290442(0x275);return(await this[_0x290442(0x398)][_0x290442(0x21d)](_0x10380a,{'params':{'resourceId':JSON[_0x290442(0x394)](_0x1b250e[_0x290442(0x2f4)])}}))['body'];}[_0x187924(0x34d)](){const _0x5f07a5=_0x187924;throw new Error(_0x5f07a5(0x18c));}['updateSnapshot'](){const _0x562743=_0x187924;throw new Error(_0x562743(0x18c));}['saveSheetBlock'](){const _0x4e1533=_0x187924;throw new Error(_0x4e1533(0x18c));}[_0x187924(0x3a7)](){const _0x10b991=_0x187924;throw new Error(_0x10b991(0x18c));}['copyFileMeta'](){const _0x581600=_0x187924;throw new Error(_0x581600(0x18c));}[_0x187924(0x3ac)](){throw new Error('This\x20method\x20should\x20not\x20be\x20called\x20on\x20the\x20client\x20side!');}};SnapshotServerOverHTTPService=__decorate([__decorateParam(0x0,IConfigService),__decorateParam(0x1,Inject(HTTPService))],SnapshotServerOverHTTPService);let CollaborativeUndoRedoService=class CollaborativeUndoRedoService extends LocalUndoRedoService{constructor(_0x43873b,_0x1303af,_0x2c6cff,_0x42f41d,_0x2c7650){const _0x359bdc=_0x187924;super(_0x43873b,_0x1303af,_0x2c6cff),this[_0x359bdc(0x248)]=_0x42f41d,this[_0x359bdc(0x326)]=_0x2c7650;}['transformUndoRedo'](_0x4c6cc5,_0x3c3990){const _0x32f700=_0x187924,_0x11ba6f=this['_getUndoStack'](_0x4c6cc5);if(_0x11ba6f)try{const _0x249c1c=this[_0x32f700(0x162)](_0x11ba6f,_0x3c3990);this[_0x32f700(0x3aa)](_0x4c6cc5,_0x249c1c);}catch(_0x993527){this[_0x32f700(0x326)][_0x32f700(0x28d)](_0x32f700(0x25c),_0x993527),this[_0x32f700(0x2d5)](_0x4c6cc5);}const _0x6ce7de=this['_getRedoStack'](_0x4c6cc5);if(_0x6ce7de)try{const _0xeefbda=this[_0x32f700(0x162)](_0x6ce7de,_0x3c3990);this[_0x32f700(0x27b)](_0x4c6cc5,_0xeefbda);}catch(_0x2b7e88){this[_0x32f700(0x326)]['error'](_0x2b7e88),this['_clearRedo'](_0x4c6cc5);}}[_0x187924(0x2d5)](_0x22b502){const _0x218948=_0x187924,_0x3c0e2c=this[_0x218948(0x233)](_0x22b502);_0x3c0e2c&&(_0x3c0e2c[_0x218948(0x35a)]=0x0,this[_0x218948(0x196)]());}[_0x187924(0x221)](_0x1a97cb){const _0x334cfc=_0x187924,_0x30997f=this[_0x334cfc(0x2d8)](_0x1a97cb);_0x30997f&&(_0x30997f[_0x334cfc(0x35a)]=0x0,this[_0x334cfc(0x196)]());}[_0x187924(0x3aa)](_0x181ff4,_0x163ca0){const _0x2b37fd=_0x187924;this[_0x2b37fd(0x322)]['set'](_0x181ff4,_0x163ca0),this['_updateStatus']();}['_substituteRedoStack'](_0x5b61ac,_0x342ad0){const _0x3ce9cf=_0x187924;this['_redoStacks']['set'](_0x5b61ac,_0x342ad0),this[_0x3ce9cf(0x196)]();}[_0x187924(0x162)](_0x38c215,_0x13c53b){const _0x11d04f=_0x187924,_0x5dfc93=[];let _0x2fc07d=_0x13c53b,_0x1b73d1=_0x13c53b;for(let _0x4c29cb=_0x38c215['length']-0x1;_0x4c29cb>=0x0;_0x4c29cb--){const {unitID:_0x3dabfe,undoMutations:_0xbf5bf5,redoMutations:_0x5d6d77}=_0x38c215[_0x4c29cb],_0xed3d98=this[_0x11d04f(0x248)][_0x11d04f(0x30e)](_0x2fc07d,_0xbf5bf5),_0x78c166=this[_0x11d04f(0x248)]['transformMutationsWithChangeset'](_0x1b73d1,_0x5d6d77);if(isTransformMutationsWithChangesetFailure(_0xed3d98)||isTransformMutationsWithChangesetFailure(_0x78c166)){this[_0x11d04f(0x326)][_0x11d04f(0x28d)](_0x11d04f(0x25c),_0x11d04f(0x2a9),_0xed3d98,_0x78c166);break;}_0x2fc07d=_0xed3d98[_0x11d04f(0x255)],_0x1b73d1=_0x78c166[_0x11d04f(0x255)],_0x5dfc93[_0x11d04f(0x374)]({'unitID':_0x3dabfe,'undoMutations':_0xed3d98[_0x11d04f(0x341)],'redoMutations':_0x78c166[_0x11d04f(0x341)]});}return _0x5dfc93[_0x11d04f(0x1d2)]();}};CollaborativeUndoRedoService=__decorate([__decorateParam(0x0,IUniverInstanceService),__decorateParam(0x1,ICommandService),__decorateParam(0x2,IContextService),__decorateParam(0x3,ITransformService),__decorateParam(0x4,ILogService)],CollaborativeUndoRedoService);let UniverCollaborationClientPlugin=class UniverCollaborationClientPlugin extends Plugin{constructor(_0x164dfd={},_0x1483d4,_0x276ff9,_0x100008){const _0xf217fc=_0x187924;super(),this['_config']=_0x164dfd,this[_0xf217fc(0x326)]=_0x1483d4,this['_injector']=_0x276ff9,this[_0xf217fc(0x241)]=_0x100008;const {..._0x37fbe7}=merge({},defaultPluginConfig,_0x164dfd);if(!_0x37fbe7[_0xf217fc(0x262)])throw new Error(_0xf217fc(0x2ea));this[_0xf217fc(0x170)]=_0x37fbe7,this[_0xf217fc(0x241)][_0xf217fc(0x26f)](COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY,_0x37fbe7);}['onStarting'](){const _0x5b0600=_0x187924;this['_registerDependencies'](),this[_0x5b0600(0x365)]();}[_0x187924(0x1ba)](){const _0x3212df=_0x187924;var _0x1e8259,_0xecf56f;if(this['_injector'][_0x3212df(0x30a)](IUndoRedoService))this['_logService'][_0x3212df(0x28d)](_0x3212df(0x188),_0x3212df(0x195));const _0x2fb9d2=mergeOverrideWithDependencies([[IUndoRedoService,{'useClass':CollaborativeUndoRedoService}],[CollaborationSessionService],[MemberService],[SheetTransformSelectionsService],[AuthServerService],[DomainRequestService],[CommentService],[PermissionService],[CollaborationUIEventService],[DataLoaderService],[ICollaborationSocketService,{'useClass':this['_config'][_0x3212df(0x262)]}],[ISnapshotServerService,{'useClass':SnapshotServerOverHTTPService}],[IAuthzIoService,{'useClass':AuthzIoHttpService}],[IImageIoService,{'useClass':CollaborationImageIoService}],[IMentionIOService,{'useClass':MentionIoHttpService}],[CollaborationController],[FileNameController]],(_0x1e8259=this[_0x3212df(0x170)])===null||_0x1e8259===void 0x0?void 0x0:_0x1e8259[_0x3212df(0x177)]);if(!((_0xecf56f=this[_0x3212df(0x170)])===null||_0xecf56f===void 0x0?void 0x0:_0xecf56f[_0x3212df(0x363)])){const _0x4e4a05=_0x2fb9d2[_0x3212df(0x1aa)](([_0x3cad87])=>_0x3cad87===ISingleActiveUnitService);if(_0x4e4a05!==-0x1)_0x2fb9d2['splice'](_0x4e4a05,0x1);}registerDependencies(this[_0x3212df(0x32d)],_0x2fb9d2);}['_initDependencies'](){const _0x2884f9=_0x187924;var _0x1b940e,_0x318dc3;this[_0x2884f9(0x32d)]['get'](HTTPService)[_0x2884f9(0x1f8)]({'priority':0x14,'interceptor':ThresholdInterceptorFactory({'maxParallel':0x6})});if(!((_0x1b940e=this[_0x2884f9(0x170)])===null||_0x1b940e===void 0x0?void 0x0:_0x1b940e[_0x2884f9(0x2a1)])){var _0x27b610;(_0x27b610=this[_0x2884f9(0x32d)][_0x2884f9(0x21d)](ILocalCacheService,Quantity['OPTIONAL']))===null||_0x27b610===void 0x0||_0x27b610['disableLocalCache']();}if((_0x318dc3=this[_0x2884f9(0x170)])===null||_0x318dc3===void 0x0?void 0x0:_0x318dc3[_0x2884f9(0x38c)])touchDependencies(this['_injector'],[[AuthServerService]]);touchDependencies(this['_injector'],[[DomainRequestService],[CollaborationController],[PermissionService]]);}};_defineProperty(UniverCollaborationClientPlugin,_0x187924(0x2b4),_0x187924(0x158)),_defineProperty(UniverCollaborationClientPlugin,'packageName',name),_defineProperty(UniverCollaborationClientPlugin,'version',version),UniverCollaborationClientPlugin=__decorate([DependentOn(UniverLicensePlugin,UniverCollaborationPlugin,UniverNetworkPlugin),__decorateParam(0x1,ILogService),__decorateParam(0x2,Inject(Injector)),__decorateParam(0x3,IConfigService)],UniverCollaborationClientPlugin);export{AuthzIoHttpService,AwaitingState,AwaitingWithPendingState,COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY,CollaborationController,CollaborationEntity,CollaborationImageIoService,CollaborationSession,CollaborationSessionService,CollaborationSocketService,CollaborationStatus,CollaborationUIEventId,CollaborationUIEventService,CollaborativeUndoRedoService,CommentService,ConflictState,DEFAULT_COLLAB_WEB_SOCKET_URL,DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT,DEFAULT_WS_SESSION_TICKET_URL,DataLoaderService,DocCollaborationEntity,FetchingMissState,HEARTBEAT_INTERVAL_KEY,HEARTBEAT_TIMEOUT_KEY,ICollaborationSocketService,ILocalCacheService,INetworkConditionService,ISingleActiveUnitService,LOCAL_CACHE_INTERVAL,LOCAL_CACHE_INTERVAL_KEY,MemberService,MentionIoHttpService,OfflineState,PendingState,REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY,RETRY_CONNECTING_MAX_COUNT_KEY,SessionStatus,SheetCollaborationEntity,SheetTransformSelectionsService,SnapshotServerOverHTTPService,SyncedState,UnitStatus,UniverCollaborationClientPlugin,deserializeToCombResponse,getLocalCacheKey,serializeCombRequest};