@univerjs-pro/collaboration-client 1.0.0-alpha.2 → 1.0.0-alpha.3

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 (96) hide show
  1. package/README.md +8 -2
  2. package/lib/cjs/facade.js +1 -1
  3. package/lib/cjs/index.js +1 -1
  4. package/lib/cjs/locale/ar-SA.js +1 -1
  5. package/lib/cjs/locale/ca-ES.js +1 -1
  6. package/lib/cjs/locale/de-DE.js +1 -1
  7. package/lib/cjs/locale/en-US.js +1 -1
  8. package/lib/cjs/locale/es-ES.js +1 -1
  9. package/lib/cjs/locale/fa-IR.js +1 -1
  10. package/lib/cjs/locale/fr-FR.js +1 -1
  11. package/lib/cjs/locale/id-ID.js +1 -1
  12. package/lib/cjs/locale/it-IT.js +1 -1
  13. package/lib/cjs/locale/ja-JP.js +1 -1
  14. package/lib/cjs/locale/ko-KR.js +1 -1
  15. package/lib/cjs/locale/pl-PL.js +1 -1
  16. package/lib/cjs/locale/pt-BR.js +1 -1
  17. package/lib/cjs/locale/ru-RU.js +1 -1
  18. package/lib/cjs/locale/sk-SK.js +1 -1
  19. package/lib/cjs/locale/vi-VN.js +1 -1
  20. package/lib/cjs/locale/zh-CN.js +1 -1
  21. package/lib/cjs/locale/zh-HK.js +1 -1
  22. package/lib/cjs/locale/zh-TW.js +1 -1
  23. package/lib/es/facade.js +1 -1
  24. package/lib/es/index.js +1 -1
  25. package/lib/es/locale/ar-SA.js +1 -1
  26. package/lib/es/locale/ca-ES.js +1 -1
  27. package/lib/es/locale/de-DE.js +1 -1
  28. package/lib/es/locale/en-US.js +1 -1
  29. package/lib/es/locale/es-ES.js +1 -1
  30. package/lib/es/locale/fa-IR.js +1 -1
  31. package/lib/es/locale/fr-FR.js +1 -1
  32. package/lib/es/locale/id-ID.js +1 -1
  33. package/lib/es/locale/it-IT.js +1 -1
  34. package/lib/es/locale/ja-JP.js +1 -1
  35. package/lib/es/locale/ko-KR.js +1 -1
  36. package/lib/es/locale/pl-PL.js +1 -1
  37. package/lib/es/locale/pt-BR.js +1 -1
  38. package/lib/es/locale/ru-RU.js +1 -1
  39. package/lib/es/locale/sk-SK.js +1 -1
  40. package/lib/es/locale/vi-VN.js +1 -1
  41. package/lib/es/locale/zh-CN.js +1 -1
  42. package/lib/es/locale/zh-HK.js +1 -1
  43. package/lib/es/locale/zh-TW.js +1 -1
  44. package/lib/facade.js +1 -1
  45. package/lib/index.js +1 -1
  46. package/lib/locale/ar-SA.js +1 -1
  47. package/lib/locale/ca-ES.js +1 -1
  48. package/lib/locale/de-DE.js +1 -1
  49. package/lib/locale/en-US.js +1 -1
  50. package/lib/locale/es-ES.js +1 -1
  51. package/lib/locale/fa-IR.js +1 -1
  52. package/lib/locale/fr-FR.js +1 -1
  53. package/lib/locale/id-ID.js +1 -1
  54. package/lib/locale/it-IT.js +1 -1
  55. package/lib/locale/ja-JP.js +1 -1
  56. package/lib/locale/ko-KR.js +1 -1
  57. package/lib/locale/pl-PL.js +1 -1
  58. package/lib/locale/pt-BR.js +1 -1
  59. package/lib/locale/ru-RU.js +1 -1
  60. package/lib/locale/sk-SK.js +1 -1
  61. package/lib/locale/vi-VN.js +1 -1
  62. package/lib/locale/zh-CN.js +1 -1
  63. package/lib/locale/zh-HK.js +1 -1
  64. package/lib/locale/zh-TW.js +1 -1
  65. package/lib/types/controllers/collaboration/collaboration-entity.d.ts +6 -0
  66. package/lib/types/controllers/collaboration/utils/changeset-utils.d.ts +0 -2
  67. package/lib/types/facade/f-collaboration.d.ts +40 -0
  68. package/lib/types/index.d.ts +6 -3
  69. package/lib/types/services/attachment-remote/attachment-io.service.d.ts +1 -4
  70. package/lib/types/services/collaboration-session/collaboration-changeset-translator.d.ts +4 -0
  71. package/lib/types/services/collaboration-session/collaboration-client-adapter.d.ts +39 -0
  72. package/lib/types/services/collaboration-session/collaboration-session.d.ts +5 -4
  73. package/lib/types/services/collaboration-session/collaboration-session.service.d.ts +14 -14
  74. package/lib/types/services/image-remote/image-io.service.d.ts +2 -4
  75. package/lib/umd/facade.js +1 -1
  76. package/lib/umd/index.js +1 -1
  77. package/lib/umd/locale/ar-SA.js +1 -1
  78. package/lib/umd/locale/ca-ES.js +1 -1
  79. package/lib/umd/locale/de-DE.js +1 -1
  80. package/lib/umd/locale/en-US.js +1 -1
  81. package/lib/umd/locale/es-ES.js +1 -1
  82. package/lib/umd/locale/fa-IR.js +1 -1
  83. package/lib/umd/locale/fr-FR.js +1 -1
  84. package/lib/umd/locale/id-ID.js +1 -1
  85. package/lib/umd/locale/it-IT.js +1 -1
  86. package/lib/umd/locale/ja-JP.js +1 -1
  87. package/lib/umd/locale/ko-KR.js +1 -1
  88. package/lib/umd/locale/pl-PL.js +1 -1
  89. package/lib/umd/locale/pt-BR.js +1 -1
  90. package/lib/umd/locale/ru-RU.js +1 -1
  91. package/lib/umd/locale/sk-SK.js +1 -1
  92. package/lib/umd/locale/vi-VN.js +1 -1
  93. package/lib/umd/locale/zh-CN.js +1 -1
  94. package/lib/umd/locale/zh-HK.js +1 -1
  95. package/lib/umd/locale/zh-TW.js +1 -1
  96. package/package.json +15 -16
@@ -1 +1 @@
1
- const _0x3d2533=_0x25c8;function _0x27b1(){const _0x37c3db=['216BuLsuT','您的操作與伺服器權限存在衝突。請將您的本機編輯儲存至其他地方,重新整理頁面後將會被捨棄。','編輯衝突','343532JhilrH','此文件協作人數已達上限,您的編輯將暫存於本機。','69915bbtlCz','伺服器未回應協作請求,您的編輯將儲存在本機。','492oBGPYn','連線失敗,請檢查您的網路。','加入協作失敗,您的編輯將暫存於本機。','已離線,編輯將儲存在本機','同步中...','您的本機文件與伺服器文件存在衝突。請將您的本機編輯儲存至其他地方,因為重新整理頁面後將會遺失。','正在擷取伺服器資料...','點擊重新連線','87965inQleH','連線失敗,將在稍後重試連線。','5612406FheadX','5444248OMNDEm','協作文件數量超過限制,您的編輯將暫存於本機。','協作衝突','您的登入已過期,點擊「確定」重新登入,點擊「取消」儲存您的本機編輯。','61602NWGCcS','46049157sIYXFm'];_0x27b1=function(){return _0x37c3db;};return _0x27b1();}(function(_0x251d85,_0x3ea4d9){const _0x149bdd=_0x25c8,_0x1f1665=_0x251d85();while(!![]){try{const _0x2463e1=parseInt(_0x149bdd(0x8b))/0x1+parseInt(_0x149bdd(0x84))/0x2+parseInt(_0x149bdd(0x7f))/0x3+parseInt(_0x149bdd(0x80))/0x4+-parseInt(_0x149bdd(0x7d))/0x5*(-parseInt(_0x149bdd(0x8d))/0x6)+parseInt(_0x149bdd(0x89))/0x7*(parseInt(_0x149bdd(0x86))/0x8)+-parseInt(_0x149bdd(0x85))/0x9;if(_0x2463e1===_0x3ea4d9)break;else _0x1f1665['push'](_0x1f1665['shift']());}catch(_0x19ddbc){_0x1f1665['push'](_0x1f1665['shift']());}}}(_0x27b1,0xf0285));const e={'collaboration-client':{'collabClient':{'tooltip':{'reconnect':_0x3d2533(0x7c)}},'collabStatus':{'fetchMiss':_0x3d2533(0x7b),'conflict':_0x3d2533(0x88),'notCollab':'本機檔案','synced':'已同步','syncing':_0x3d2533(0x91),'offline':_0x3d2533(0x90)},'session':{'connection-failed':_0x3d2533(0x8e),'will-retry':_0x3d2533(0x7e),'room-full':_0x3d2533(0x8a),'join-failed':'加入協作失敗,請稍後重試,您的編輯將暫存於本機。','room-not-exists':_0x3d2533(0x8f),'room-permission-denied':'沒有協作權限,您的編輯將暫存於本機。','room-cnt-exceeds':_0x3d2533(0x81),'collaboration-timeout':_0x3d2533(0x8c)},'conflict':{'title':_0x3d2533(0x82),'content':_0x3d2533(0x92)},'permission':{'title':'認證錯誤','content':_0x3d2533(0x87)},'collaboration':{'single-unit':{'warning':'您在另一個分頁開啟了同一個檔案。為避免資料遺失,此分頁將無法進行編輯。'},'closeRoom':'由於協作房間已關閉,編輯權限已被收回。'},'auth':{'needGotoLoginAlert':_0x3d2533(0x83)}}};function _0x25c8(_0x1141fa,_0x282a30){_0x1141fa=_0x1141fa-0x7b;const _0x27b152=_0x27b1();let _0x25c80c=_0x27b152[_0x1141fa];return _0x25c80c;}export{e as default};
1
+ function _0x3aaa(_0x4a700a,_0x2500b5){_0x4a700a=_0x4a700a-0x86;const _0x30af31=_0x30af();let _0x3aaa09=_0x30af31[_0x4a700a];return _0x3aaa09;}function _0x30af(){const _0x4fda45=['124yrulDw','連線失敗,將在稍後重試連線。','由於協作房間已關閉,編輯權限已被收回。','此文件協作人數已達上限,您的編輯將暫存於本機。','9AiplCq','1222944DoFFDs','編輯衝突','2468505duTJLi','390EUzXfc','已同步','協作衝突','正在擷取伺服器資料...','您的登入已過期,點擊「確定」重新登入,點擊「取消」儲存您的本機編輯。','認證錯誤','伺服器未回應協作請求,您的編輯將儲存在本機。','您的本機文件與伺服器文件存在衝突。請將您的本機編輯儲存至其他地方,因為重新整理頁面後將會遺失。','209bVsziQ','4603WFmGBB','28070NLwlBR','3511412YfiksO','本機檔案','協作文件數量超過限制,您的編輯將暫存於本機。','加入協作失敗,您的編輯將暫存於本機。','32UEniai','2463909ThuZuN','已離線,編輯將儲存在本機','同步中...','您在另一個分頁開啟了同一個檔案。為避免資料遺失,此分頁將無法進行編輯。','5275740rjwQcz'];_0x30af=function(){return _0x4fda45;};return _0x30af();}const _0x38b178=_0x3aaa;(function(_0x5fe9fa,_0x47265e){const _0x5cc2e9=_0x3aaa,_0x291924=_0x5fe9fa();while(!![]){try{const _0x22e615=-parseInt(_0x5cc2e9(0x88))/0x1*(-parseInt(_0x5cc2e9(0x94))/0x2)+-parseInt(_0x5cc2e9(0x9b))/0x3+parseInt(_0x5cc2e9(0x8a))/0x4+-parseInt(_0x5cc2e9(0x89))/0x5*(-parseInt(_0x5cc2e9(0x9c))/0x6)+-parseInt(_0x5cc2e9(0x8f))/0x7*(parseInt(_0x5cc2e9(0x8e))/0x8)+parseInt(_0x5cc2e9(0x98))/0x9*(-parseInt(_0x5cc2e9(0x93))/0xa)+parseInt(_0x5cc2e9(0x87))/0xb*(parseInt(_0x5cc2e9(0x99))/0xc);if(_0x22e615===_0x47265e)break;else _0x291924['push'](_0x291924['shift']());}catch(_0x5bb7df){_0x291924['push'](_0x291924['shift']());}}}(_0x30af,0xac648));const e={'collaboration-client':{'collabClient':{'tooltip':{'reconnect':'點擊重新連線'}},'collabStatus':{'fetchMiss':_0x38b178(0x9f),'conflict':_0x38b178(0x9a),'notCollab':_0x38b178(0x8b),'synced':_0x38b178(0x9d),'syncing':_0x38b178(0x91),'offline':_0x38b178(0x90)},'session':{'connection-failed':'連線失敗,請檢查您的網路。','will-retry':_0x38b178(0x95),'room-full':_0x38b178(0x97),'join-failed':'加入協作失敗,請稍後重試,您的編輯將暫存於本機。','room-not-exists':_0x38b178(0x8d),'room-permission-denied':'沒有協作權限,您的編輯將暫存於本機。','room-cnt-exceeds':_0x38b178(0x8c),'collaboration-timeout':_0x38b178(0xa2)},'conflict':{'title':_0x38b178(0x9e),'content':_0x38b178(0x86)},'permission':{'title':_0x38b178(0xa1),'content':'您的操作與伺服器權限存在衝突。請將您的本機編輯儲存至其他地方,重新整理頁面後將會被捨棄。'},'collaboration':{'single-unit':{'warning':_0x38b178(0x92)},'closeRoom':_0x38b178(0x96)},'auth':{'needGotoLoginAlert':_0x38b178(0xa0)}}};export{e as default};
@@ -108,3 +108,9 @@ export declare class SlideCollaborationEntity extends CollaborationEntity {
108
108
  constructor(unitID: string, type: UniverInstanceType, session: CollaborationSession, injector: Injector, compressMutationService: CompressMutationService, localeService: LocaleService, revisionService: RevisionService, eventService: CollaborationUIEventService, univerInstanceService: IUniverInstanceService, logService: ILogService, commandService: ICommandService, permissionService: IPermissionService, singleActiveUnitService?: ISingleActiveUnitService, localCacheService?: ILocalCacheService);
109
109
  protected _init(): Promise<CollaborationState>;
110
110
  }
111
+ export declare class BoardCollaborationEntity extends CollaborationEntity {
112
+ readonly unitID: string;
113
+ readonly type: UniverInstanceType;
114
+ constructor(unitID: string, type: UniverInstanceType, session: CollaborationSession, injector: Injector, compressMutationService: CompressMutationService, localeService: LocaleService, revisionService: RevisionService, eventService: CollaborationUIEventService, univerInstanceService: IUniverInstanceService, logService: ILogService, commandService: ICommandService, permissionService: IPermissionService, singleActiveUnitService?: ISingleActiveUnitService, localCacheService?: ILocalCacheService);
115
+ protected _init(): Promise<CollaborationState>;
116
+ }
@@ -18,8 +18,6 @@ export declare const SINGLE_CHANGESET_MUTATIONS: Set<string>;
18
18
  export declare const SLIDE_SINGLE_CHANGESET_MUTATIONS: Set<string>;
19
19
  export declare function takeMutationsForChangeset(pendingMutations: IMutationInfo[], singleChangesetMutations?: Set<string>): IMutationInfo[];
20
20
  export declare function assembleMutationChangeset(pendingMutations: IMutationInfo[], unitID: string, univerInstanceService: IUniverInstanceService, revisionService: RevisionService, memberService: MemberService): IAssembledChangeset;
21
- export declare const assembleSheetChangeset: typeof assembleMutationChangeset;
22
- export declare function assembleBaseChangeset(pendingMutations: IMutationInfo[], unitID: string, univerInstanceService: IUniverInstanceService, revisionService: RevisionService, memberService: MemberService): IAssembledChangeset;
23
21
  export declare function assembleSlideChangeset(pendingMutations: IMutationInfo[], unitID: string, univerInstanceService: IUniverInstanceService, revisionService: RevisionService, memberService: MemberService): IAssembledChangeset;
24
22
  export declare function assembleDocChangeset(pendingMutations: IMutationInfo[], unitID: string, univerInstanceService: IUniverInstanceService, revisionService: RevisionService, memberService: MemberService): IAssembledChangeset;
25
23
  export declare function createTimerObservable$<T>(ms: number, options: T): Observable<T>;
@@ -1,4 +1,5 @@
1
1
  import type { FBase as FBaseFacade } from '@univerjs-pro/bases/facade';
2
+ import type { FBoard } from '@univerjs-pro/boards/facade';
2
3
  import type { ILogContext } from '@univerjs-pro/collaboration';
3
4
  import type { FPresentation } from '@univerjs-pro/slides/facade';
4
5
  import type { IDisposable } from '@univerjs/core';
@@ -9,6 +10,13 @@ import { SnapshotService } from '@univerjs-pro/collaboration';
9
10
  import { CollaborationController, CollaborationStatus } from '@univerjs-pro/collaboration-client';
10
11
  import { Injector, IUniverInstanceService } from '@univerjs/core';
11
12
  import { FBase } from '@univerjs/core/facade';
13
+ export interface ICollaborationFlushOptions {
14
+ /**
15
+ * Maximum time to wait for local collaboration changes to reach SYNCED.
16
+ * Defaults to 30 seconds.
17
+ */
18
+ timeout?: number;
19
+ }
12
20
  /**
13
21
  * The Facade API object for the Collaboration module. It provides methods to interact with the
14
22
  * Univer Collaboration backend server, such as loading Univer Sheets and subscribing to collaborators.
@@ -25,6 +33,7 @@ export declare class FCollaboration extends FBase {
25
33
  getDocument: (id: string) => FDocument | null;
26
34
  getPresentation: (id: string) => FPresentation | null;
27
35
  getBase: (id: string) => FBaseFacade | null;
36
+ getBoard: (id: string) => FBoard | null;
28
37
  }, _injector: Injector, _univerInstanceService: IUniverInstanceService, _snapshotService: SnapshotService, _collaborationController: CollaborationController);
29
38
  /**
30
39
  * Load a Univer Sheet from the server with a unit ID.
@@ -74,6 +83,18 @@ export declare class FCollaboration extends FBase {
74
83
  * ```
75
84
  */
76
85
  loadSlideAsync(unitId: string, context?: ILogContext): Promise<FPresentation | null>;
86
+ /**
87
+ * Load a Univer Board from the server with a unit ID.
88
+ * @param {string} unitId ID of the Univer Board that you would like to load.
89
+ * @param {ILogContext} [context] Optional context.
90
+ * @returns {Promise<FBoard | null>} The {@link FBoard} or null if ID cannot be associated with a Univer Board.
91
+ * @example
92
+ * ```typescript
93
+ * const collaboration = univerAPI.getCollaboration();
94
+ * const board = await collaboration.loadBoardAsync('your-unit-id');
95
+ * ```
96
+ */
97
+ loadBoardAsync(unitId: string, context?: ILogContext): Promise<FBoard | null>;
77
98
  /**
78
99
  * Subscribe collaborators of a Univer file.
79
100
  *
@@ -126,4 +147,23 @@ export declare class FCollaboration extends FBase {
126
147
  * ```
127
148
  */
128
149
  getCollaborationStatus(unitId?: string): CollaborationStatus;
150
+ /**
151
+ * Wait until all currently queued collaboration changes for a unit are synchronized.
152
+ *
153
+ * This is intended as an explicit barrier for scripts, agents, and tests after a batch of
154
+ * facade mutations. It does not make individual facade APIs asynchronous.
155
+ *
156
+ * @param {string} [unitId] Optional unit ID. If omitted, uses the focused unit.
157
+ * @param {ICollaborationFlushOptions} [options] Optional timeout configuration.
158
+ * @returns {Promise<void>} Resolves when the unit reaches CollaborationStatus.SYNCED.
159
+ *
160
+ * @example
161
+ * ```typescript
162
+ * const collaboration = univerAPI.getCollaboration();
163
+ * document.insertText(0, 'Saved through collaboration');
164
+ * await collaboration.flush(document.getId());
165
+ * ```
166
+ */
167
+ flush(unitId?: string, options?: ICollaborationFlushOptions): Promise<void>;
168
+ private _resolveUnitId;
129
169
  }
@@ -2,14 +2,17 @@ export { DEFAULT_WS_SESSION_TICKET_URL, HEARTBEAT_INTERVAL_KEY, HEARTBEAT_TIMEOU
2
2
  export { DEFAULT_COLLAB_WEB_SOCKET_URL, DEFAULT_REMOTE_UNISCRIPT_EXECUTION_ENDPOINT, REMOTE_UNISCRIPT_EXECUTION_ENDPOINT_KEY, } from './config/config';
3
3
  export type { IUniverCollaborationClientConfig } from './config/config';
4
4
  export { COLLABORATION_CLIENT_PLUGIN_CONFIG_KEY } from './config/config';
5
- export { CollaborationEntity, DocCollaborationEntity, SheetCollaborationEntity, } from './controllers/collaboration/collaboration-entity';
5
+ export { BaseCollaborationEntity, BoardCollaborationEntity, CollaborationEntity, DocCollaborationEntity, SheetCollaborationEntity, SlideCollaborationEntity, } from './controllers/collaboration/collaboration-entity';
6
6
  export type { IDocCollaborationEntityCallback } from './controllers/collaboration/collaboration-entity';
7
7
  export { AwaitingState, AwaitingWithPendingState, CollaborationStatus, ConflictState, FetchingMissState, OfflineState, PendingState, SyncedState, } from './controllers/collaboration/collaboration-state';
8
8
  export { CollaborationController } from './controllers/collaboration/collaboration.controller';
9
9
  export { UniverCollaborationClientPlugin } from './plugin';
10
- export { AttachmentSourceType, CollaborationAttachmentIoService, IAttachmentIoService, } from './services/attachment-remote/attachment-io.service';
11
- export type { AttachmentValue, IAttachmentIoService as IAttachmentIoServiceType, IAttachmentUploadOptions, IAttachmentValue, } from './services/attachment-remote/attachment-io.service';
10
+ export { CollaborationAttachmentIoService, IAttachmentIoService, } from './services/attachment-remote/attachment-io.service';
11
+ export { AttachmentSourceType } from './services/attachment-remote/types';
12
+ export type { AttachmentValue, IAttachmentUploadOptions, IAttachmentValue, } from './services/attachment-remote/types';
12
13
  export { AuthzIoHttpService } from './services/auth-server/authz-io-http.service';
14
+ export { createUniverCollaborationAdapter, ICollaborationClientAdapterService, } from './services/collaboration-session/collaboration-client-adapter';
15
+ export type { ICollaborationAdapterResolveContext, ICollaborationAdapterTransformContext, ICollaborationChangesetAdapter, ICollaborationClientAdapter, ICollaborationSessionIdentity, ICollaborationTarget, ICollaborationUnitResolution, ICreateUniverCollaborationAdapterOptions, } from './services/collaboration-session/collaboration-client-adapter';
13
16
  export { CollaborationSession, SessionStatus } from './services/collaboration-session/collaboration-session';
14
17
  export { CollaborationSessionService } from './services/collaboration-session/collaboration-session.service';
15
18
  export { CollaborationUIEventId, CollaborationUIEventService, } from './services/collaboration-ui-event/collaboration-ui-event';
@@ -1,9 +1,6 @@
1
- import type { AttachmentValue, IAttachmentUploadOptions, IAttachmentValue } from './types';
1
+ import type { IAttachmentUploadOptions, IAttachmentValue } from './types';
2
2
  import { IConfigService, IUniverInstanceService } from '@univerjs/core';
3
3
  import { HTTPService } from '@univerjs/network';
4
- import { AttachmentSourceType } from './types';
5
- export { AttachmentSourceType };
6
- export type { AttachmentValue, IAttachmentUploadOptions, IAttachmentValue };
7
4
  export interface IAttachmentIoService {
8
5
  getUploadOptions(): IAttachmentUploadOptions;
9
6
  saveAttachment(file: File): Promise<IAttachmentValue>;
@@ -0,0 +1,4 @@
1
+ import type { ICollaborationEvent } from '@univerjs-pro/collaboration';
2
+ import type { ICollaborationSessionIdentity } from './collaboration-client-adapter';
3
+ export declare function toRemoteCollaborationEvent(identity: ICollaborationSessionIdentity, event: ICollaborationEvent): ICollaborationEvent;
4
+ export declare function toLocalCollaborationEvents(identity: ICollaborationSessionIdentity, event: ICollaborationEvent): ICollaborationEvent[];
@@ -0,0 +1,39 @@
1
+ import type { IChangeset } from '@univerjs-pro/collaboration';
2
+ import type { UniverInstanceType } from '@univerjs/core';
3
+ export interface ICollaborationTarget {
4
+ endpoint?: string;
5
+ unitId: string;
6
+ unitType?: UniverInstanceType;
7
+ }
8
+ export interface ICollaborationAdapterResolveContext {
9
+ unitId: string;
10
+ unitType?: UniverInstanceType;
11
+ }
12
+ export interface ICollaborationAdapterTransformContext {
13
+ localUnitId: string;
14
+ unitType?: UniverInstanceType;
15
+ target: ICollaborationTarget;
16
+ }
17
+ export interface ICollaborationChangesetAdapter {
18
+ toRemote(changeset: IChangeset, context: ICollaborationAdapterTransformContext): IChangeset;
19
+ toLocal(changeset: IChangeset, context: ICollaborationAdapterTransformContext): IChangeset;
20
+ }
21
+ export interface ICollaborationUnitResolution {
22
+ target: ICollaborationTarget;
23
+ changeset?: ICollaborationChangesetAdapter;
24
+ }
25
+ export interface ICollaborationClientAdapter {
26
+ resolveUnit(context: ICollaborationAdapterResolveContext): ICollaborationUnitResolution | Promise<ICollaborationUnitResolution>;
27
+ }
28
+ export interface ICreateUniverCollaborationAdapterOptions {
29
+ resolveUnit?: ICollaborationClientAdapter['resolveUnit'];
30
+ }
31
+ export interface ICollaborationSessionIdentity {
32
+ localUnitId: string;
33
+ unitType?: UniverInstanceType;
34
+ target: ICollaborationTarget;
35
+ changeset?: ICollaborationChangesetAdapter;
36
+ }
37
+ export declare const ICollaborationClientAdapterService: import("@wendellhu/redi").IdentifierDecorator<ICollaborationClientAdapter>;
38
+ export declare function createUniverCollaborationAdapter(options?: ICreateUniverCollaborationAdapterOptions): ICollaborationClientAdapter;
39
+ export declare function normalizeCollaborationSessionIdentity(localUnitId: string, unitType: UniverInstanceType | undefined, resolution: ICollaborationUnitResolution): ICollaborationSessionIdentity;
@@ -2,6 +2,7 @@ import type { ICollaborationEvent } from '@univerjs-pro/collaboration';
2
2
  import type { IDisposable, Nullable } from '@univerjs/core';
3
3
  import type { Observable } from 'rxjs';
4
4
  import type { ICollaborationSocket } from '../socket/collaboration-socket.service';
5
+ import type { ICollaborationSessionIdentity } from './collaboration-client-adapter';
5
6
  import { IConfigService, ILogService, RxDisposable } from '@univerjs/core';
6
7
  import { ITelemetryService } from '@univerjs/telemetry';
7
8
  import { CollaborationUIEventService } from '../collaboration-ui-event/collaboration-ui-event';
@@ -23,10 +24,10 @@ export declare const FailedReason: {
23
24
  /**
24
25
  * The data structure to represent a collaboration session. It also manages the collaborator's identity.
25
26
  *
26
- * An collaboration session maps to a unit.
27
+ * A collaboration session maps one local unit to one collaboration target.
27
28
  */
28
29
  export declare class CollaborationSession extends RxDisposable implements IDisposable {
29
- private readonly _unitID;
30
+ private readonly _identity;
30
31
  private readonly _logService;
31
32
  private readonly _configService;
32
33
  private readonly _memberService;
@@ -40,7 +41,7 @@ export declare class CollaborationSession extends RxDisposable implements IDispo
40
41
  readonly event$: Observable<ICollaborationEvent>;
41
42
  private _socket;
42
43
  private _socketMessageSubscription;
43
- constructor(_unitID: string, socket$: Observable<Nullable<ICollaborationSocket>>, _logService: ILogService, _configService: IConfigService, _memberService: MemberService, _commentService: CommentService, _collaborationUIEventService: CollaborationUIEventService, _telemetryService?: ITelemetryService | undefined);
44
+ constructor(_identity: ICollaborationSessionIdentity, socket$: Observable<Nullable<ICollaborationSocket>>, _logService: ILogService, _configService: IConfigService, _memberService: MemberService, _commentService: CommentService, _collaborationUIEventService: CollaborationUIEventService, _telemetryService?: ITelemetryService | undefined);
44
45
  getMemberID(): string | null;
45
46
  dispose(): void;
46
47
  close(): void;
@@ -53,7 +54,7 @@ export declare class CollaborationSession extends RxDisposable implements IDispo
53
54
  /**
54
55
  * Send event to the collaboration server.
55
56
  */
56
- send(event: ICollaborationEvent, unitID: string): Promise<void>;
57
+ send(event: ICollaborationEvent, _unitID: string): Promise<void>;
57
58
  private _collaborationTimeoutTimer;
58
59
  private _scheduleCollaborationTimeoutTimer;
59
60
  private _clearCollaborationTimeoutTimer;
@@ -1,5 +1,6 @@
1
- import type { Nullable } from '@univerjs/core';
1
+ import type { Nullable, UniverInstanceType } from '@univerjs/core';
2
2
  import type { ICollaborationSocket } from '../socket/collaboration-socket.service';
3
+ import type { ICollaborationClientAdapter } from './collaboration-client-adapter';
3
4
  import { Disposable, IConfigService, ILogService, Injector } from '@univerjs/core';
4
5
  import { CollaborationUIEventService } from '../collaboration-ui-event/collaboration-ui-event';
5
6
  import { INetworkConditionService } from '../network-condition/network-condition.service';
@@ -15,22 +16,19 @@ export declare class CollaborationSessionService extends Disposable {
15
16
  private readonly _configService;
16
17
  private readonly _socketService;
17
18
  private readonly _collaborationUIEventService;
19
+ private readonly _adapter;
18
20
  private readonly _networkConditionService?;
21
+ private _sessions;
22
+ private _pendingSessions;
23
+ private _sessionChannels;
24
+ private _socketChannels;
19
25
  /**
20
- * Socket for collaboration sessions. Session are by unitID but the socket is share by collaboration sessions.
26
+ * Socket for collaboration sessions on the default endpoint.
21
27
  */
22
- private _socket$;
23
28
  readonly socket$: import("rxjs").Observable<Nullable<ICollaborationSocket>>;
24
- private get _socket();
25
- private _candidateSocket;
26
- private _sessions;
27
29
  private _status$;
28
30
  status$: import("rxjs").Observable<SessionStatus>;
29
- private _socketReady;
30
- private _retryConnectingTimer;
31
- private _retryCount;
32
- private _socketMessageSubscription;
33
- constructor(_injector: Injector, _logService: ILogService, _configService: IConfigService, _socketService: ICollaborationSocketService, _collaborationUIEventService: CollaborationUIEventService, _networkConditionService?: INetworkConditionService | undefined);
31
+ constructor(_injector: Injector, _logService: ILogService, _configService: IConfigService, _socketService: ICollaborationSocketService, _collaborationUIEventService: CollaborationUIEventService, _adapter: ICollaborationClientAdapter, _networkConditionService?: INetworkConditionService | undefined);
34
32
  private _listenToNetworkCondition;
35
33
  dispose(): void;
36
34
  /**
@@ -38,7 +36,8 @@ export declare class CollaborationSessionService extends Disposable {
38
36
  * @param unitID
39
37
  * @returns a collaboration session.
40
38
  */
41
- requireSession(unitID: string): Promise<CollaborationSession>;
39
+ requireSession(unitID: string, unitType?: UniverInstanceType): Promise<CollaborationSession>;
40
+ private _createSession;
42
41
  closeSession(unitID: string): void;
43
42
  reconnect(): void;
44
43
  private _clearRetryConnectingTimer;
@@ -63,9 +62,10 @@ export declare class CollaborationSessionService extends Disposable {
63
62
  private _onOffline;
64
63
  private _onConnectionFailed;
65
64
  private _tryReconnect;
65
+ private _resolveSessionIdentity;
66
66
  private _onMessage;
67
- private _sendHeartbeatTimer;
68
- private _timeoutTimer;
67
+ private _hasSessionsForEndpoint;
68
+ private _getSocketChannel;
69
69
  private _rescheduleHeartbeat;
70
70
  private _sendHeartbeat;
71
71
  private _waitForHeartbeatResponse;
@@ -1,9 +1,7 @@
1
- import type { Nullable } from '@univerjs/core';
2
- import type { IImageIoService, IImageIoServiceParam } from '@univerjs/drawing';
1
+ import type { IImageIoService, IImageIoServiceParam, Nullable } from '@univerjs/core';
3
2
  import type { IError } from '@univerjs/protocol';
4
3
  import type { Observable } from 'rxjs';
5
- import { IConfigService, IUniverInstanceService } from '@univerjs/core';
6
- import { ImageSourceType } from '@univerjs/drawing';
4
+ import { IConfigService, ImageSourceType, IUniverInstanceService } from '@univerjs/core';
7
5
  import { HTTPService } from '@univerjs/network';
8
6
  export interface ISignUrlResponse {
9
7
  error: IError | undefined;
package/lib/umd/facade.js CHANGED
@@ -1 +1 @@
1
- function _0x39a8(){const _0x52c00c=['pipe','Inject','unitID','1792710nVQWDS','loadSheet','FCollaboration','switchMap','_snapshotService','readyForCollab','getOwnPropertyDescriptor','loadServerUnitOfRevision','UniverProCollaborationClient','943236bcepRm','registerEventHandler','loadSlideAsync','DataLoaderService','length','UniverCoreFacade','loadDocAsync','loadServerUnit','add','1015689QzrrYU','702824dSlfXs','@univerjs/core','@univerjs/core/facade','status$','loadUnitOfRevision','extend','values','_initialize','state','getWorkbook','getCollabEntity','4xKmiNm','toDisposable','toStringTag','getFocusedUnit','1625294pFXSEb','MemberService','exports','from','UniverProCollaboration','_handler','18NNkVJV','Event','CollaborationStatus','FUniver','members$','18NQzqLg','Injector','subscribe','_injector','loadBaseAsync','getCollaborationStatus','createInstance','waitForRoom$','subscribeCollaborators','function','getDocument','get','NOT_COLLAB','decorate','object','514270jpHVuZ','loadSlide','1YKBHJp','495714mwxAkm','CollaborationController','fireEvent','getPresentation','loadBase','rxjs','loadSheetAsync','UniverProCollaborationClientFacade','loadUnit','FEventName','getBase','FEnum','UniverCore','Module','status','_collaborationController','SnapshotService','defineProperty','CollaborationStatusChanged'];_0x39a8=function(){return _0x52c00c;};return _0x39a8();}function _0x4427(_0x166e43,_0x32c7c5){_0x166e43=_0x166e43-0x171;const _0x39a819=_0x39a8();let _0x4427d8=_0x39a819[_0x166e43];return _0x4427d8;}(function(_0x16e95c,_0x6ad17e){const _0x6242e8=_0x4427,_0x4e1e6c=_0x16e95c();while(!![]){try{const _0x7a5d9d=-parseInt(_0x6242e8(0x185))/0x1*(-parseInt(_0x6242e8(0x186))/0x2)+-parseInt(_0x6242e8(0x1ae))/0x3*(parseInt(_0x6242e8(0x1ba))/0x4)+parseInt(_0x6242e8(0x183))/0x5*(parseInt(_0x6242e8(0x174))/0x6)+parseInt(_0x6242e8(0x1a5))/0x7+-parseInt(_0x6242e8(0x1af))/0x8*(-parseInt(_0x6242e8(0x1c4))/0x9)+-parseInt(_0x6242e8(0x19c))/0xa+-parseInt(_0x6242e8(0x1be))/0xb;if(_0x7a5d9d===_0x6ad17e)break;else _0x4e1e6c['push'](_0x4e1e6c['shift']());}catch(_0x5719e6){_0x4e1e6c['push'](_0x4e1e6c['shift']());}}}(_0x39a8,0x31245),function(_0x4e2c60,_0x7df73d){const _0xb78b3e=_0x4427;typeof exports==_0xb78b3e(0x182)&&typeof module<'u'?_0x7df73d(exports,require('@univerjs-pro/collaboration-client'),require('@univerjs/core/facade'),require('@univerjs/core'),require('@univerjs-pro/collaboration'),require('rxjs')):typeof define=='function'&&define['amd']?define([_0xb78b3e(0x1c0),'@univerjs-pro/collaboration-client',_0xb78b3e(0x1b1),_0xb78b3e(0x1b0),'@univerjs-pro/collaboration',_0xb78b3e(0x18b)],_0x7df73d):(_0x4e2c60=typeof globalThis<'u'?globalThis:_0x4e2c60||self,_0x7df73d(_0x4e2c60[_0xb78b3e(0x18d)]={},_0x4e2c60[_0xb78b3e(0x1a4)],_0x4e2c60[_0xb78b3e(0x1aa)],_0x4e2c60[_0xb78b3e(0x192)],_0x4e2c60[_0xb78b3e(0x1c2)],_0x4e2c60[_0xb78b3e(0x18b)]));}(this,function(_0x1a6e23,_0xb89e0b,_0x2d30eb,_0x51cdf5,_0xd5626b,_0x20fd6a){const _0x3a0109=_0x4427;Object[_0x3a0109(0x197)](_0x1a6e23,Symbol[_0x3a0109(0x1bc)],{'value':_0x3a0109(0x193)});var _0x40fcf4=class extends _0x2d30eb[_0x3a0109(0x191)]{get[_0x3a0109(0x171)](){const _0x4e3e89=_0x3a0109;return _0xb89e0b[_0x4e3e89(0x171)];}};_0x2d30eb[_0x3a0109(0x191)][_0x3a0109(0x1b4)](_0x40fcf4);var _0x1cfdff=class extends _0x2d30eb[_0x3a0109(0x18f)]{get[_0x3a0109(0x198)](){const _0x14fef9=_0x3a0109;return _0x14fef9(0x198);}};_0x2d30eb[_0x3a0109(0x18f)][_0x3a0109(0x1b4)](_0x1cfdff);function _0x59df80(_0x45ef82,_0x2a9b63){return function(_0x572f9d,_0x3bb5ca){_0x2a9b63(_0x572f9d,_0x3bb5ca,_0x45ef82);};}function _0x4534ac(_0x1f6df0,_0xaa2071,_0x35ce14,_0x171ac5){const _0xe3b83a=_0x3a0109;var _0x51ed83=arguments[_0xe3b83a(0x1a9)],_0x20cc5a=_0x51ed83<0x3?_0xaa2071:_0x171ac5===null?_0x171ac5=Object[_0xe3b83a(0x1a2)](_0xaa2071,_0x35ce14):_0x171ac5,_0x4524d1;if(typeof Reflect==_0xe3b83a(0x182)&&typeof Reflect[_0xe3b83a(0x181)]==_0xe3b83a(0x17d))_0x20cc5a=Reflect[_0xe3b83a(0x181)](_0x1f6df0,_0xaa2071,_0x35ce14,_0x171ac5);else{for(var _0x249fb9=_0x1f6df0['length']-0x1;_0x249fb9>=0x0;_0x249fb9--)(_0x4524d1=_0x1f6df0[_0x249fb9])&&(_0x20cc5a=(_0x51ed83<0x3?_0x4524d1(_0x20cc5a):_0x51ed83>0x3?_0x4524d1(_0xaa2071,_0x35ce14,_0x20cc5a):_0x4524d1(_0xaa2071,_0x35ce14))||_0x20cc5a);}return _0x51ed83>0x3&&_0x20cc5a&&Object[_0xe3b83a(0x197)](_0xaa2071,_0x35ce14,_0x20cc5a),_0x20cc5a;}let _0x2f85da=class extends _0x2d30eb['FBase']{constructor(_0x534f93,_0x35c81c,_0x328b98,_0x73bea5,_0x258601){const _0x521483=_0x3a0109;super(),this[_0x521483(0x1c3)]=_0x534f93,this[_0x521483(0x177)]=_0x35c81c,this['_univerInstanceService']=_0x328b98,this[_0x521483(0x1a0)]=_0x73bea5,this[_0x521483(0x195)]=_0x258601;}async[_0x3a0109(0x18c)](_0x4c4c78,_0x45d671){const _0x4355b2=_0x3a0109;return await this[_0x4355b2(0x1a0)][_0x4355b2(0x19d)](_0x4c4c78,0x0,_0x45d671)?(await this['_collaborationController'][_0x4355b2(0x1a1)](_0x4c4c78),this['_handler'][_0x4355b2(0x1b8)](_0x4c4c78)):null;}async[_0x3a0109(0x1ab)](_0x399053,_0x2fc7a7){const _0x5ae2b5=_0x3a0109;return await this[_0x5ae2b5(0x1a0)]['loadDoc'](_0x399053,0x0,_0x2fc7a7)?(await this[_0x5ae2b5(0x195)][_0x5ae2b5(0x1a1)](_0x399053),this[_0x5ae2b5(0x1c3)][_0x5ae2b5(0x17e)](_0x399053)):null;}async[_0x3a0109(0x178)](_0x549daf,_0x362340){const _0x852f9e=_0x3a0109;return await this[_0x852f9e(0x1a0)][_0x852f9e(0x18a)](_0x549daf,0x0,_0x362340)?(await this['_collaborationController'][_0x852f9e(0x1a1)](_0x549daf),this[_0x852f9e(0x1c3)][_0x852f9e(0x190)](_0x549daf)):null;}async[_0x3a0109(0x1a7)](_0x3b081e,_0x5d2b6a){const _0x55292b=_0x3a0109;return await this[_0x55292b(0x1a0)][_0x55292b(0x184)](_0x3b081e,0x0,_0x5d2b6a)?(await this[_0x55292b(0x195)]['readyForCollab'](_0x3b081e),this[_0x55292b(0x1c3)]['getPresentation'](_0x3b081e)):null;}[_0x3a0109(0x17c)](_0x4e3104,_0x26820f){const _0x253cb5=_0x3a0109;return(0x0,_0x51cdf5[_0x253cb5(0x1bb)])(this[_0x253cb5(0x177)][_0x253cb5(0x17f)](_0xb89e0b[_0x253cb5(0x1bf)])[_0x253cb5(0x17b)](_0x4e3104)[_0x253cb5(0x199)]((0x0,_0x20fd6a[_0x253cb5(0x19f)])(_0x5cfff2=>_0x5cfff2[_0x253cb5(0x173)]))[_0x253cb5(0x176)](_0x103180=>_0x26820f(Array[_0x253cb5(0x1c1)](_0x103180[_0x253cb5(0x1b5)]()))));}[_0x3a0109(0x179)](_0x3ed15f){const _0x1dc348=_0x3a0109;var _0x2bbc89;let _0x746c8;if(_0x3ed15f)_0x746c8=_0x3ed15f;else{let _0x43ad3c=this['_univerInstanceService'][_0x1dc348(0x1bd)]();_0x746c8=_0x43ad3c==null?void 0x0:_0x43ad3c['getUnitId']();}if(!_0x746c8)return _0xb89e0b[_0x1dc348(0x171)][_0x1dc348(0x180)];let _0x40fb8c=this[_0x1dc348(0x195)][_0x1dc348(0x1b9)](_0x746c8);return(_0x2bbc89=_0x40fb8c==null?void 0x0:_0x40fb8c[_0x1dc348(0x1b7)][_0x1dc348(0x194)])==null?_0xb89e0b['CollaborationStatus'][_0x1dc348(0x180)]:_0x2bbc89;}};_0x2f85da=_0x4534ac([_0x59df80(0x1,(0x0,_0x51cdf5[_0x3a0109(0x19a)])(_0x51cdf5[_0x3a0109(0x175)])),_0x59df80(0x2,_0x51cdf5['IUniverInstanceService']),_0x59df80(0x3,(0x0,_0x51cdf5[_0x3a0109(0x19a)])(_0xd5626b[_0x3a0109(0x196)])),_0x59df80(0x4,(0x0,_0x51cdf5[_0x3a0109(0x19a)])(_0xb89e0b['CollaborationController']))],_0x2f85da);var _0x53ece8=class extends _0x2d30eb[_0x3a0109(0x172)]{[_0x3a0109(0x1b6)](_0x368de0){const _0x758abf=_0x3a0109;let _0x296fa9=_0x368de0['get'](_0xb89e0b[_0x758abf(0x187)]);this['disposeWithMe'](this[_0x758abf(0x1a6)](this['Event'][_0x758abf(0x198)],()=>{const _0xce78d2=_0x758abf;let _0x343165=new _0x51cdf5['DisposableCollection'](),_0x10750d=_0x296fa9['entityInit$'][_0xce78d2(0x176)](_0x2bc429=>{const _0x173f78=_0xce78d2;let _0x58a833=_0x2bc429[_0x173f78(0x1b2)]['subscribe'](_0x13067b=>{const _0x7769c7=_0x173f78;let _0x2b7125={'unitId':_0x2bc429[_0x7769c7(0x19b)],'status':_0x13067b};this[_0x7769c7(0x188)](this[_0x7769c7(0x1c5)][_0x7769c7(0x198)],_0x2b7125);});_0x343165[_0x173f78(0x1ad)]((0x0,_0x51cdf5[_0x173f78(0x1bb)])(_0x58a833));});return _0x343165[_0xce78d2(0x1ad)]((0x0,_0x51cdf5[_0xce78d2(0x1bb)])(_0x10750d)),_0x343165;}));}['getCollaboration'](){const _0x8df78c=_0x3a0109;return this['_injector'][_0x8df78c(0x17a)](_0x2f85da,{'getWorkbook':_0x37af1c=>this[_0x8df78c(0x1b8)](_0x37af1c),'getDocument':_0x3c850b=>this[_0x8df78c(0x17e)](_0x3c850b),'getPresentation':_0x269830=>this[_0x8df78c(0x189)](_0x269830),'getBase':_0x17b8f4=>this[_0x8df78c(0x190)](_0x17b8f4)});}[_0x3a0109(0x1ac)](_0x2a666e,_0x569cf6,_0x28f7d5){const _0x5859d2=_0x3a0109;return this[_0x5859d2(0x177)][_0x5859d2(0x17f)](_0xb89e0b[_0x5859d2(0x1a8)])[_0x5859d2(0x18e)](_0x2a666e,_0x569cf6,_0x28f7d5);}[_0x3a0109(0x1a3)](_0x49f8f2,_0x1f578b,_0x5c16a3){const _0x540acb=_0x3a0109;return this[_0x540acb(0x177)][_0x540acb(0x17f)](_0xb89e0b[_0x540acb(0x1a8)])[_0x540acb(0x1b3)](_0x49f8f2,_0x1f578b,_0x5c16a3);}};_0x2d30eb[_0x3a0109(0x172)][_0x3a0109(0x1b4)](_0x53ece8),Object[_0x3a0109(0x197)](_0x1a6e23,_0x3a0109(0x19e),{'enumerable':!0x0,'get':function(){return _0x2f85da;}});}));
1
+ (function(_0x29fe18,_0x47abbc){const _0x1dae1c=_0x3e43,_0x4bb106=_0x29fe18();while(!![]){try{const _0x1bb982=-parseInt(_0x1dae1c(0x233))/0x1+parseInt(_0x1dae1c(0x248))/0x2*(parseInt(_0x1dae1c(0x249))/0x3)+parseInt(_0x1dae1c(0x215))/0x4+-parseInt(_0x1dae1c(0x1fb))/0x5+-parseInt(_0x1dae1c(0x22e))/0x6+-parseInt(_0x1dae1c(0x20a))/0x7+-parseInt(_0x1dae1c(0x200))/0x8*(-parseInt(_0x1dae1c(0x24a))/0x9);if(_0x1bb982===_0x47abbc)break;else _0x4bb106['push'](_0x4bb106['shift']());}catch(_0x574d56){_0x4bb106['push'](_0x4bb106['shift']());}}}(_0x1b54,0x6a738),function(_0x57e7c5,_0x213d25){const _0x4539af=_0x3e43;typeof exports=='object'&&typeof module<'u'?_0x213d25(exports,require('@univerjs-pro/collaboration-client'),require('@univerjs/core/facade'),require('@univerjs/core'),require('@univerjs-pro/collaboration'),require('rxjs')):typeof define=='function'&&define[_0x4539af(0x22b)]?define([_0x4539af(0x228),_0x4539af(0x235),_0x4539af(0x20f),_0x4539af(0x211),_0x4539af(0x234),_0x4539af(0x1fd)],_0x213d25):(_0x57e7c5=typeof globalThis<'u'?globalThis:_0x57e7c5||self,_0x213d25(_0x57e7c5[_0x4539af(0x23c)]={},_0x57e7c5[_0x4539af(0x202)],_0x57e7c5[_0x4539af(0x223)],_0x57e7c5[_0x4539af(0x206)],_0x57e7c5[_0x4539af(0x246)],_0x57e7c5[_0x4539af(0x1fd)]));}(this,function(_0x38c5b1,_0x2e361e,_0x280377,_0x1ca07a,_0x307cc5,_0x2dbb1a){const _0x2323f8=_0x3e43;Object[_0x2323f8(0x204)](_0x38c5b1,Symbol[_0x2323f8(0x20c)],{'value':_0x2323f8(0x230)});var _0x159d97=class extends _0x280377[_0x2323f8(0x245)]{get['CollaborationStatus'](){const _0x2b35bd=_0x2323f8;return _0x2e361e[_0x2b35bd(0x222)];}};_0x280377['FEnum'][_0x2323f8(0x22a)](_0x159d97);var _0x328501=class extends _0x280377[_0x2323f8(0x236)]{get[_0x2323f8(0x213)](){return'CollaborationStatusChanged';}};_0x280377[_0x2323f8(0x236)][_0x2323f8(0x22a)](_0x328501);function _0x6a3b9f(_0xd06144,_0x2c3635){return function(_0x57dcae,_0x51230e){_0x2c3635(_0x57dcae,_0x51230e,_0xd06144);};}function _0x59a918(_0x3a0667,_0x2fc364,_0x12bb61,_0x43349c){const _0x46c525=_0x2323f8;var _0xbba3ee=arguments[_0x46c525(0x209)],_0x37d3a9=_0xbba3ee<0x3?_0x2fc364:_0x43349c===null?_0x43349c=Object[_0x46c525(0x1ef)](_0x2fc364,_0x12bb61):_0x43349c,_0xf5576a;if(typeof Reflect=='object'&&typeof Reflect[_0x46c525(0x247)]==_0x46c525(0x214))_0x37d3a9=Reflect[_0x46c525(0x247)](_0x3a0667,_0x2fc364,_0x12bb61,_0x43349c);else{for(var _0x5d9b1c=_0x3a0667[_0x46c525(0x209)]-0x1;_0x5d9b1c>=0x0;_0x5d9b1c--)(_0xf5576a=_0x3a0667[_0x5d9b1c])&&(_0x37d3a9=(_0xbba3ee<0x3?_0xf5576a(_0x37d3a9):_0xbba3ee>0x3?_0xf5576a(_0x2fc364,_0x12bb61,_0x37d3a9):_0xf5576a(_0x2fc364,_0x12bb61))||_0x37d3a9);}return _0xbba3ee>0x3&&_0x37d3a9&&Object[_0x46c525(0x204)](_0x2fc364,_0x12bb61,_0x37d3a9),_0x37d3a9;}let _0x4a5feb=class extends _0x280377[_0x2323f8(0x23e)]{constructor(_0x5010af,_0xd7dc74,_0x2c83af,_0x2cfd16,_0x1c27e0){const _0xcae31d=_0x2323f8;super(),this['_handler']=_0x5010af,this[_0xcae31d(0x22f)]=_0xd7dc74,this[_0xcae31d(0x1ee)]=_0x2c83af,this[_0xcae31d(0x227)]=_0x2cfd16,this[_0xcae31d(0x216)]=_0x1c27e0;}async['loadSheetAsync'](_0x421c22,_0x34b98c){const _0x3944c4=_0x2323f8;return await this['_snapshotService'][_0x3944c4(0x221)](_0x421c22,0x0,_0x34b98c)?(await this[_0x3944c4(0x216)][_0x3944c4(0x21c)](_0x421c22),this[_0x3944c4(0x205)]['getWorkbook'](_0x421c22)):null;}async[_0x2323f8(0x243)](_0x63e2eb,_0x102c99){const _0x471129=_0x2323f8;return await this[_0x471129(0x227)][_0x471129(0x232)](_0x63e2eb,0x0,_0x102c99)?(await this[_0x471129(0x216)][_0x471129(0x21c)](_0x63e2eb),this[_0x471129(0x205)][_0x471129(0x212)](_0x63e2eb)):null;}async['loadBaseAsync'](_0xd0294,_0x2b1b8c){const _0x174b62=_0x2323f8;return await this[_0x174b62(0x227)][_0x174b62(0x244)](_0xd0294,0x0,_0x2b1b8c)?(await this[_0x174b62(0x216)][_0x174b62(0x21c)](_0xd0294),this['_handler'][_0x174b62(0x20d)](_0xd0294)):null;}async[_0x2323f8(0x201)](_0x55b0c4,_0x4e7552){const _0x3b374d=_0x2323f8;return await this[_0x3b374d(0x227)]['loadSlide'](_0x55b0c4,0x0,_0x4e7552)?(await this[_0x3b374d(0x216)][_0x3b374d(0x21c)](_0x55b0c4),this[_0x3b374d(0x205)][_0x3b374d(0x1f6)](_0x55b0c4)):null;}async[_0x2323f8(0x21d)](_0x29e98b,_0x14646d){const _0x27d48f=_0x2323f8;return await this['_snapshotService'][_0x27d48f(0x1ff)](_0x29e98b,0x0,_0x14646d)?(await this['_collaborationController'][_0x27d48f(0x21c)](_0x29e98b),this[_0x27d48f(0x205)][_0x27d48f(0x1fe)](_0x29e98b)):null;}[_0x2323f8(0x1f1)](_0x3efd08,_0x4a3bb0){const _0x130b06=_0x2323f8;return(0x0,_0x1ca07a['toDisposable'])(this['_injector'][_0x130b06(0x1ed)](_0x2e361e[_0x130b06(0x208)])[_0x130b06(0x237)](_0x3efd08)[_0x130b06(0x207)]((0x0,_0x2dbb1a[_0x130b06(0x24d)])(_0x28b5bc=>_0x28b5bc[_0x130b06(0x23d)]))[_0x130b06(0x239)](_0x2b0c17=>_0x4a3bb0(Array[_0x130b06(0x21f)](_0x2b0c17[_0x130b06(0x1f4)]()))));}[_0x2323f8(0x231)](_0xb3db25){const _0x51decf=_0x2323f8;var _0x158721;let _0x431fe5=this['_resolveUnitId'](_0xb3db25);if(!_0x431fe5)return _0x2e361e['CollaborationStatus'][_0x51decf(0x1f9)];let _0x1a9012=this[_0x51decf(0x216)]['getCollabEntity'](_0x431fe5);return(_0x158721=_0x1a9012==null?void 0x0:_0x1a9012[_0x51decf(0x1fa)][_0x51decf(0x22c)])==null?_0x2e361e[_0x51decf(0x222)][_0x51decf(0x1f9)]:_0x158721;}[_0x2323f8(0x1fc)](_0x2b80b1,_0x49078f={}){const _0x4dd211=_0x2323f8;var _0x32340e;let _0x48126b=this[_0x4dd211(0x24c)](_0x2b80b1);if(!_0x48126b)return Promise[_0x4dd211(0x21a)](Error(_0x4dd211(0x23f)));let _0x2c0a4b=this[_0x4dd211(0x216)][_0x4dd211(0x218)](_0x48126b);if(!_0x2c0a4b)return Promise['reject'](Error('[FCollaboration]:\x20Unit\x20\x22'+_0x48126b+_0x4dd211(0x240)));let _0x3082ba=_0x2c0a4b[_0x4dd211(0x1fa)]['status'];if(_0x3082ba===_0x2e361e[_0x4dd211(0x222)]['SYNCED'])return Promise['resolve']();let _0x163b49=_0x51b5a8(_0x48126b,_0x3082ba);if(_0x163b49)return Promise[_0x4dd211(0x21a)](_0x163b49);let _0x1a84a4=(_0x32340e=_0x49078f['timeout'])==null?0x7530:_0x32340e;return new Promise((_0x19da00,_0x2bebd8)=>{const _0x40457a=_0x4dd211;let _0x42f17b=!0x1,_0x39ab63=null,_0xedbaad=setTimeout(()=>{const _0x43dedc=_0x3e43;_0x42f17b=!0x0,_0x39ab63==null||_0x39ab63['unsubscribe'](),_0x2bebd8(Error(_0x43dedc(0x238)+_0x48126b+_0x43dedc(0x219)+_0x1a84a4+_0x43dedc(0x225)));},_0x1a84a4),_0x9d4e53=()=>{const _0x11e746=_0x3e43;_0x42f17b=!0x0,clearTimeout(_0xedbaad),_0x39ab63==null||_0x39ab63[_0x11e746(0x242)]();};_0x39ab63=_0x2c0a4b[_0x40457a(0x21b)]['subscribe'](_0xe39911=>{const _0x238ef2=_0x40457a;if(_0x42f17b)return;if(_0xe39911===_0x2e361e['CollaborationStatus'][_0x238ef2(0x226)]){_0x9d4e53(),_0x19da00();return;}let _0x22e950=_0x51b5a8(_0x48126b,_0xe39911);_0x22e950&&(_0x9d4e53(),_0x2bebd8(_0x22e950));});});}[_0x2323f8(0x24c)](_0x261106){const _0x4f906e=_0x2323f8;var _0x28dc69;return _0x261106||((_0x28dc69=this[_0x4f906e(0x1ee)][_0x4f906e(0x210)]())==null?void 0x0:_0x28dc69[_0x4f906e(0x1f2)]());}};_0x4a5feb=_0x59a918([_0x6a3b9f(0x1,(0x0,_0x1ca07a[_0x2323f8(0x1f0)])(_0x1ca07a[_0x2323f8(0x241)])),_0x6a3b9f(0x2,_0x1ca07a[_0x2323f8(0x224)]),_0x6a3b9f(0x3,(0x0,_0x1ca07a[_0x2323f8(0x1f0)])(_0x307cc5[_0x2323f8(0x21e)])),_0x6a3b9f(0x4,(0x0,_0x1ca07a[_0x2323f8(0x1f0)])(_0x2e361e[_0x2323f8(0x203)]))],_0x4a5feb);function _0x51b5a8(_0x5b3892,_0x50b6cd){const _0x2cf28d=_0x2323f8;return _0x50b6cd===_0x2e361e[_0x2cf28d(0x222)]['CONFLICT']||_0x50b6cd===_0x2e361e[_0x2cf28d(0x222)]['NOT_COLLAB']?Error(_0x2cf28d(0x217)+_0x5b3892+_0x2cf28d(0x1ec)+_0x50b6cd+'.'):null;}var _0x327b1c=class extends _0x280377[_0x2323f8(0x1f7)]{[_0x2323f8(0x23b)](_0x63949e){const _0x53714e=_0x2323f8;let _0x23b5bb=_0x63949e[_0x53714e(0x1ed)](_0x2e361e[_0x53714e(0x203)]);this['disposeWithMe'](this[_0x53714e(0x23a)](this['Event'][_0x53714e(0x213)],()=>{const _0x3ea29d=_0x53714e;let _0x3bd43b=new _0x1ca07a[(_0x3ea29d(0x1f8))](),_0x509e52=_0x23b5bb[_0x3ea29d(0x20e)][_0x3ea29d(0x239)](_0x510518=>{const _0x5916dc=_0x3ea29d;let _0x5a9cc6=_0x510518[_0x5916dc(0x21b)][_0x5916dc(0x239)](_0x3ed7fd=>{let _0x200ce4={'unitId':_0x510518['unitID'],'status':_0x3ed7fd};this['fireEvent'](this['Event']['CollaborationStatusChanged'],_0x200ce4);});_0x3bd43b[_0x5916dc(0x24b)]((0x0,_0x1ca07a[_0x5916dc(0x22d)])(_0x5a9cc6));});return _0x3bd43b[_0x3ea29d(0x24b)]((0x0,_0x1ca07a[_0x3ea29d(0x22d)])(_0x509e52)),_0x3bd43b;}));}[_0x2323f8(0x1f5)](){const _0x3581b8=_0x2323f8;return this['_injector'][_0x3581b8(0x1f3)](_0x4a5feb,{'getWorkbook':_0x530542=>this[_0x3581b8(0x20b)](_0x530542),'getDocument':_0x1718ee=>this[_0x3581b8(0x212)](_0x1718ee),'getPresentation':_0x6c4c49=>this[_0x3581b8(0x1f6)](_0x6c4c49),'getBase':_0x11c29e=>this[_0x3581b8(0x20d)](_0x11c29e),'getBoard':_0xa0f90=>this[_0x3581b8(0x1fe)](_0xa0f90)});}['loadServerUnit'](_0x172f7c,_0x8787b6,_0x1823d8){const _0x36c2d8=_0x2323f8;return this[_0x36c2d8(0x22f)][_0x36c2d8(0x1ed)](_0x2e361e['DataLoaderService'])['loadUnit'](_0x172f7c,_0x8787b6,_0x1823d8);}['loadServerUnitOfRevision'](_0x23c50c,_0xe3e29b,_0x5c04e0){const _0x45c974=_0x2323f8;return this['_injector'][_0x45c974(0x1ed)](_0x2e361e['DataLoaderService'])[_0x45c974(0x220)](_0x23c50c,_0xe3e29b,_0x5c04e0);}};_0x280377[_0x2323f8(0x1f7)][_0x2323f8(0x22a)](_0x327b1c),Object[_0x2323f8(0x204)](_0x38c5b1,_0x2323f8(0x229),{'enumerable':!0x0,'get':function(){return _0x4a5feb;}});}));function _0x3e43(_0x5c931d,_0x261820){_0x5c931d=_0x5c931d-0x1ec;const _0x1b5492=_0x1b54();let _0x3e43e4=_0x1b5492[_0x5c931d];return _0x3e43e4;}function _0x1b54(){const _0xb42b99=['loadSlideAsync','UniverProCollaborationClient','CollaborationController','defineProperty','_handler','UniverCore','pipe','MemberService','length','4222225PSwJqe','getWorkbook','toStringTag','getBase','entityInit$','@univerjs/core/facade','getFocusedUnit','@univerjs/core','getDocument','CollaborationStatusChanged','function','2755200UYBVSA','_collaborationController','[FCollaboration]:\x20Cannot\x20flush\x20unit\x20\x22','getCollabEntity','\x22\x20after\x20','reject','status$','readyForCollab','loadBoardAsync','SnapshotService','from','loadUnitOfRevision','loadSheet','CollaborationStatus','UniverCoreFacade','IUniverInstanceService','ms.','SYNCED','_snapshotService','exports','FCollaboration','extend','amd','status','toDisposable','4790922scXXAd','_injector','Module','getCollaborationStatus','loadDoc','733830McVuHq','@univerjs-pro/collaboration','@univerjs-pro/collaboration-client','FEventName','waitForRoom$','[FCollaboration]:\x20Timed\x20out\x20flushing\x20unit\x20\x22','subscribe','registerEventHandler','_initialize','UniverProCollaborationClientFacade','members$','FBase','[FCollaboration]:\x20Cannot\x20flush\x20because\x20no\x20unit\x20is\x20focused\x20or\x20specified.','\x22\x20is\x20not\x20in\x20collaboration\x20mode.','Injector','unsubscribe','loadDocAsync','loadBase','FEnum','UniverProCollaboration','decorate','333930BwjNnO','6TzMHjS','15039126cAAdmM','add','_resolveUnitId','switchMap','\x22\x20while\x20collaboration\x20status\x20is\x20','get','_univerInstanceService','getOwnPropertyDescriptor','Inject','subscribeCollaborators','getUnitId','createInstance','values','getCollaboration','getPresentation','FUniver','DisposableCollection','NOT_COLLAB','state','611140XOlWpS','flush','rxjs','getBoard','loadBoard','8DcqpWn'];_0x1b54=function(){return _0xb42b99;};return _0x1b54();}