@univer-cli/univer-collaboration-runtime 1.0.0 → 1.0.2

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 (2) hide show
  1. package/dist/index.mjs +1 -1
  2. package/package.json +12 -12
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- const _0x5e6b2d=_0x67e3;(function(_0x18d7cb,_0x423073){const _0xb55c68=_0x67e3,_0x4f633f=_0x18d7cb();while(!![]){try{const _0x53c35c=-parseInt(_0xb55c68(0x1af))/0x1*(-parseInt(_0xb55c68(0x1c6))/0x2)+-parseInt(_0xb55c68(0x2e5))/0x3+parseInt(_0xb55c68(0x291))/0x4+parseInt(_0xb55c68(0x2fd))/0x5*(parseInt(_0xb55c68(0x2ea))/0x6)+-parseInt(_0xb55c68(0x315))/0x7*(parseInt(_0xb55c68(0x230))/0x8)+parseInt(_0xb55c68(0x24b))/0x9+-parseInt(_0xb55c68(0x1b6))/0xa;if(_0x53c35c===_0x423073)break;else _0x4f633f['push'](_0x4f633f['shift']());}catch(_0x18e37c){_0x4f633f['push'](_0x4f633f['shift']());}}}(_0x1384,0xd8e4f));import{CommandType as _0x583014,DependentOn as _0x57fa7a,ICommandService as _0x4398d7,IUniverInstanceService as _0x36c186,Inject as _0x191d9f,Injector as _0x857fc3,Plugin as _0x3590eb,UniverInstanceType as _0x35327a,registerDependencies as _0x2bb7ea,sequenceExecute as _0x200257,toDisposable as _0x21f8ea}from'@univerjs/core';import{CompressMutationService as _0x125608,ISnapshotServerService as _0x32e3ff,ITransformService as _0x1a5c37,RevertRevisionMutation as _0x5c912b,RevisionService as _0x2dad72,SnapshotService as _0x16d22b,UniverCollaborationPlugin as _0x59c157,isTransformMutationsSuccess as _0x5569a7,parseChangesetToProtocol as _0x14fe0e,parseMutationToProtocol as _0x46de9d,parseProtocolChangeset as _0x22f50a,transformSnapshotToBaseData as _0x3ded75,transformSnapshotToBoardData as _0x4c8227,transformSnapshotToDocumentData as _0x1dbd3a,transformSnapshotToSlideData as _0x226a08,transformSnapshotToWorkbookData as _0x2c2b13}from'@univerjs-pro/collaboration';import{FormulaCalculationSessionService as _0x1a0611}from'@univerjs/engine-formula';import{CmdRspCode as _0x21c0c8,CombCmd as _0x53cd9f,isError as _0x3e8af9}from'@univerjs/protocol';import{PersistFormulaLastValuesCommand as _0x565be5}from'@univerjs-pro/engine-formula';import{DocStateChangeManagerService as _0xe139b,RichTextEditingMutation as _0x21bc91}from'@univerjs/docs';import{IRenderManagerService as _0x1756f2}from'@univerjs/engine-render';import{FUniver as _0x23ff19}from'@univerjs/core/facade';import'@univerjs-pro/bases/facade';import'@univerjs-pro/boards/facade';import'@univerjs-pro/slides/facade';import'@univerjs/docs/facade';import'@univerjs/sheets/facade';import _0x4cf2f2 from'@oxc-project/runtime/helpers/decorateParam';import _0x2174d4 from'@oxc-project/runtime/helpers/decorate';var j=class extends Error{['code'];['retryable'];constructor(_0x5eb151,_0x55f2af,_0x1cb9a2={}){const _0x4b1519=_0x67e3;super(_0x55f2af,_0x1cb9a2),this[_0x4b1519(0x286)]='CollaborationRuntimeError',this[_0x4b1519(0x207)]=_0x5eb151,this['retryable']=_0x1cb9a2[_0x4b1519(0x24c)]??!0x1;}},se=class{[_0x5e6b2d(0x321)];[_0x5e6b2d(0x20a)];[_0x5e6b2d(0x2ae)]=[];[_0x5e6b2d(0x1d6)]=[];['_suppressionDepth']=0x0;constructor(_0x120bb2,_0x4a42a3,_0x28386c){const _0x1bd113=_0x5e6b2d;this[_0x1bd113(0x321)]=_0x120bb2,this['_unitId']=_0x4a42a3,this[_0x1bd113(0x1d6)]['push'](_0x120bb2[_0x1bd113(0x23e)][_0x1bd113(0x233)]((_0x2d7f71,_0x1debdd)=>{const _0x87d56b=_0x1bd113;this[_0x87d56b(0x1de)](_0x2d7f71,_0x1debdd,_0x28386c);})),_0x28386c===_0x35327a[_0x1bd113(0x2de)]&&(_0x120bb2[_0x1bd113(0x269)][_0x1bd113(0x31e)](_0x1756f2),this[_0x1bd113(0x2f1)]());}get[_0x5e6b2d(0x242)](){const _0x582851=_0x5e6b2d;return this[_0x582851(0x2ae)];}[_0x5e6b2d(0x1e3)](_0x341ac1){const _0x559e29=_0x5e6b2d;return this[_0x559e29(0x2ae)]['slice'](_0x341ac1);}[_0x5e6b2d(0x1ee)](_0x3d8bf8){const _0x2fe100=_0x5e6b2d;this[_0x2fe100(0x2ae)][_0x2fe100(0x2b9)](0x0,this[_0x2fe100(0x2ae)][_0x2fe100(0x31c)],..._0x3d8bf8);}['takePending'](){const _0x3e2247=_0x5e6b2d;return this[_0x3e2247(0x2ae)][_0x3e2247(0x2b9)](0x0);}[_0x5e6b2d(0x246)](_0x944f72){const _0x2d6a38=_0x5e6b2d;this['_pending'][_0x2d6a38(0x303)](..._0x944f72);}async['suppress'](_0x40953d){const _0x578073=_0x5e6b2d;this[_0x578073(0x29c)]+=0x1;try{return await _0x40953d();}finally{--this[_0x578073(0x29c)];}}['dispose'](){const _0x103394=_0x5e6b2d;for(let _0x7129c5 of this[_0x103394(0x1d6)]['splice'](0x0))_0x7129c5[_0x103394(0x24a)]();}[_0x5e6b2d(0x1de)](_0xc2401f,_0x2f0de9,_0x33a9d6){const _0x46dbe7=_0x5e6b2d;if(this[_0x46dbe7(0x29c)]>0x0||_0xc2401f[_0x46dbe7(0x1ce)]!==_0x583014[_0x46dbe7(0x2f4)]||_0x2f0de9?.[_0x46dbe7(0x1f2)]||_0x2f0de9?.[_0x46dbe7(0x296)]||_0x2f0de9?.['onlyLocal'])return;let _0xa95c44=_0xc2401f['params'];if(_0xa95c44?.[_0x46dbe7(0x274)]!==void 0x0&&_0xa95c44['unitId']!==this[_0x46dbe7(0x20a)]){if(_0xa95c44[_0x46dbe7(0x1bc)]===_0x565be5['id'])return;throw new j('COLLABORATION_INVALID_INPUT','Runtime\x20for\x20'+this['_unitId']+_0x46dbe7(0x201)+_0xc2401f['id']+_0x46dbe7(0x29f)+String(_0xa95c44['unitId']));}if(_0xa95c44?.['unitId']===void 0x0||_0x33a9d6===_0x35327a[_0x46dbe7(0x2de)]&&_0xc2401f['id']===_0x21bc91['id'])return;if(_0xc2401f['id']===_0x5c912b['id'])throw new j(_0x46dbe7(0x2bf),_0x46dbe7(0x1be));let _0x3649e5=_0xc2401f,_0xbb025a=this[_0x46dbe7(0x321)][_0x46dbe7(0x2f2)][_0x46dbe7(0x2d8)][_0x46dbe7(0x2d9)]()[_0x46dbe7(0x2ee)],_0x35ce6d=(this[_0x46dbe7(0x321)]['compressMutationService'][_0x46dbe7(0x2d8)][_0x46dbe7(0x1ed)](_0xbb025a)([_0x3649e5],this['_kernel'][_0x46dbe7(0x297)])??[_0x3649e5])[0x0];_0x35ce6d&&this['_pending']['push'](_0x46de9d(_0x35ce6d));}[_0x5e6b2d(0x2f1)](){const _0x536276=_0x5e6b2d;let _0x5de587=this[_0x536276(0x321)][_0x536276(0x269)][_0x536276(0x31e)](_0xe139b)[_0x536276(0x20b)][_0x536276(0x2ba)](_0x46c99e=>{const _0x3bea02=_0x536276;if(this[_0x3bea02(0x29c)]>0x0||_0x46c99e?.['unitId']!==this[_0x3bea02(0x20a)])return;let _0x1d09fe={'id':_0x46c99e['commandId'],'params':{'actions':_0x46c99e[_0x3bea02(0x300)]['actions'],'textRanges':null,'unitId':_0x46c99e['unitId']},'type':_0x583014[_0x3bea02(0x2f4)]};this[_0x3bea02(0x2ae)][_0x3bea02(0x1d8)](_0x46de9d(_0x1d09fe));});this[_0x536276(0x1d6)][_0x536276(0x1d8)](_0x21f8ea(()=>_0x5de587[_0x536276(0x237)]()));}},ce=new Set([_0x5e6b2d(0x1e1),_0x5e6b2d(0x200),_0x5e6b2d(0x217),_0x5e6b2d(0x316),_0x5e6b2d(0x1e9),_0x5e6b2d(0x1e0),_0x5e6b2d(0x20e)]),le=new Set([_0x5e6b2d(0x236),_0x5e6b2d(0x306),'createWorkbook',_0x5e6b2d(0x280),'createPresentation','createUniverSheet','disposeUnit']);function ue(_0x325e6d,_0x1d4b63,_0x24487c){const _0x1056d5=_0x5e6b2d;let _0x443915=_0x23ff19[_0x1056d5(0x1cf)](_0x325e6d);return{async 'execute'(_0x5b528e,_0x403684){const _0x4a9eaa=_0x1056d5;if(_0x5b528e[_0x4a9eaa(0x31c)]>_0x24487c)throw new j(_0x4a9eaa(0x2bf),_0x4a9eaa(0x1f5)+_0x24487c+_0x4a9eaa(0x1cc));let _0x1add65=_0x403684===_0x4a9eaa(0x307)?M(_0x443915):void 0x0,_0x42e4d1=de(_0x443915,_0x1d4b63);try{return await Function('univerAPI',_0x4a9eaa(0x253)+_0x5b528e+_0x4a9eaa(0x2eb))(_0x42e4d1);}finally{_0x1add65?.[_0x4a9eaa(0x24a)]();}}};}function de(_0x58a501,_0x360fdf){return new Proxy(_0x58a501,{'get'(_0x21341f,_0x37bd63,_0x4cdd0a){const _0x786e14=_0x67e3;return le[_0x786e14(0x30d)](_0x37bd63)?()=>{const _0x52b291=_0x786e14;throw new j('COLLABORATION_INVALID_INPUT',_0x52b291(0x1fc)+_0x360fdf+'\x20cannot\x20call\x20'+String(_0x37bd63));}:Reflect['get'](_0x21341f,_0x37bd63,_0x4cdd0a);}});}function M(_0x459ada){const _0x4655a5=_0x5e6b2d;return _0x459ada['addEvent'](_0x459ada[_0x4655a5(0x216)]['BeforeCommandExecute'],_0x2e00b5=>{const _0x4b95af=_0x4655a5;let _0x342459=_0x2e00b5;if(N(_0x342459))throw _0x342459[_0x4b95af(0x229)]=!0x0,new j('COLLABORATION_INVALID_INPUT',_0x4b95af(0x2a9)+_0x342459['id']);});}function N(_0x53e69e){const _0x2a4f6b=_0x5e6b2d;return _0x53e69e['type']===_0x583014['COMMAND']||_0x53e69e[_0x2a4f6b(0x1ce)]===_0x583014['MUTATION']&&!ce[_0x2a4f6b(0x30d)](_0x53e69e['id']);}function P(_0x3aedfe){const _0x2ea103=_0x5e6b2d;if(_0x3aedfe===void 0x0)return null;if(_0x3aedfe===null||typeof _0x3aedfe==_0x2ea103(0x276)||typeof _0x3aedfe=='string')return _0x3aedfe;if(typeof _0x3aedfe==_0x2ea103(0x1df)){if(Number['isFinite'](_0x3aedfe))return _0x3aedfe;throw I();}if(Array[_0x2ea103(0x31d)](_0x3aedfe))return _0x3aedfe[_0x2ea103(0x1db)](P);if(F(_0x3aedfe))return Object[_0x2ea103(0x26b)](Object[_0x2ea103(0x261)](_0x3aedfe)[_0x2ea103(0x1db)](([_0x42670d,_0x3d5277])=>[_0x42670d,P(_0x3d5277)]));throw I();}function F(_0x6998e){const _0x59e54b=_0x5e6b2d;if(typeof _0x6998e!='object'||!_0x6998e)return!0x1;let _0xa4e254=Object[_0x59e54b(0x2e9)](_0x6998e);return _0xa4e254===Object['prototype']||_0xa4e254===null;}function I(){const _0xb488ef=_0x5e6b2d;return new j(_0xb488ef(0x2bf),_0xb488ef(0x1c4));}var L=class{[_0x5e6b2d(0x30f)]=Promise[_0x5e6b2d(0x232)]();[_0x5e6b2d(0x223)](_0x209990){const _0x48969c=_0x5e6b2d;let _0xe016a3=this[_0x48969c(0x30f)][_0x48969c(0x1e7)](_0x209990,_0x209990);return this['_tail']=_0xe016a3[_0x48969c(0x1e7)](()=>void 0x0,()=>void 0x0),_0xe016a3;}};function R(_0x273a66,_0x5b7159,_0x2ac1d1,_0x550984){const _0x2a78aa=_0x5e6b2d;if(!Array[_0x2a78aa(0x31d)](_0x273a66))throw new j(_0x2a78aa(0x21d),_0x2a78aa(0x290));let _0x734ef1=[..._0x273a66]['sort']((_0x2737df,_0x480dfc)=>_0x2737df[_0x2a78aa(0x2f6)]-_0x480dfc[_0x2a78aa(0x2f6)]),_0xef61d4=_0x550984;for(let _0x4fa432 of _0x734ef1){if(!_0x4fa432||typeof _0x4fa432!=_0x2a78aa(0x23f)||!Array[_0x2a78aa(0x31d)](_0x4fa432[_0x2a78aa(0x2ab)])||_0x4fa432[_0x2a78aa(0x2ab)][_0x2a78aa(0x1c2)](_0x36e677=>!_0x36e677||typeof _0x36e677!=_0x2a78aa(0x23f)||!('id'in _0x36e677)||typeof _0x36e677['id']!=_0x2a78aa(0x241)||!('data'in _0x36e677)||typeof _0x36e677[_0x2a78aa(0x295)]!=_0x2a78aa(0x241))||!Number[_0x2a78aa(0x1b1)](_0x4fa432[_0x2a78aa(0x324)])||!Number[_0x2a78aa(0x1b1)](_0x4fa432[_0x2a78aa(0x2f6)])||_0x4fa432[_0x2a78aa(0x23b)]!==_0x5b7159||_0x4fa432[_0x2a78aa(0x1ce)]!==_0x2ac1d1||_0x4fa432[_0x2a78aa(0x324)]!==_0xef61d4||_0x4fa432['revision']!==_0xef61d4+0x1)throw new j(_0x2a78aa(0x21d),_0x2a78aa(0x289));_0xef61d4=_0x4fa432[_0x2a78aa(0x2f6)];}return _0x734ef1;}function z(_0x4ee90d){const _0x1951d0=_0x5e6b2d;return{'baseRevision':_0x4ee90d[_0x1951d0(0x324)],'mutationCount':_0x4ee90d[_0x1951d0(0x2ab)][_0x1951d0(0x31c)],'revision':_0x4ee90d[_0x1951d0(0x2f6)],..._0x4ee90d[_0x1951d0(0x287)]===void 0x0?{}:{'sid':_0x4ee90d[_0x1951d0(0x287)]},..._0x4ee90d[_0x1951d0(0x2df)]===void 0x0?{}:{'reqId':_0x4ee90d[_0x1951d0(0x2df)]}};}function B(_0x341338,_0x185351,_0x536c58,_0x308068,_0xf54baa,_0x5c6a6e='initial'){const _0x124d15=_0x5e6b2d;if(_0xf54baa[_0x124d15(0x1c2)](_0xea8157=>_0xea8157[_0x124d15(0x2ab)][_0x124d15(0x1c2)](_0x155f81=>_0x155f81['id']===_0x5c912b['id'])))throw new j(_0x124d15(0x21d),_0x124d15(0x1c7));let _0x20b908=_0x308068;for(let _0x203d96 of _0xf54baa){let _0x18b0c5=_0x20b908+0x1;if(_0x203d96['unitID']!==_0x185351||_0x203d96[_0x124d15(0x1ce)]!==_0x536c58||_0x203d96[_0x124d15(0x324)]!==_0x20b908||_0x203d96['revision']!==_0x18b0c5)throw new j(_0x124d15(0x21d),_0x124d15(0x2c5));let _0x61a760=_0x22f50a(_0x203d96),_0x4ead8e=_0x341338[_0x124d15(0x2f2)]['interceptor'][_0x124d15(0x2d9)]()['COMPRESS_MUTATION_APPLY'],_0x44431f=_0x341338[_0x124d15(0x2f2)][_0x124d15(0x2d8)]['fetchThroughInterceptors'](_0x4ead8e)(_0x61a760[_0x124d15(0x2ab)],null)??_0x61a760[_0x124d15(0x2ab)],_0x31225b=_0x200257(_0x44431f,_0x341338[_0x124d15(0x23e)],_0x5c6a6e===_0x124d15(0x20d)?{'fromChangeset':!0x0}:{'fromCollab':!0x0});if(!_0x31225b['result'])throw new j('COLLABORATION_LOAD_FAILED',_0x124d15(0x282)+_0x31225b[_0x124d15(0x25a)]+':\x20'+String(_0x31225b['error']));let _0x4063ca=_0x341338[_0x124d15(0x1b8)][_0x124d15(0x2b0)](_0x185351);if(_0x4063ca!==_0x18b0c5)throw new j(_0x124d15(0x21d),'Univer\x20revision\x20did\x20not\x20advance\x20to\x20the\x20confirmed\x20changeset\x20revision');_0x20b908=_0x4063ca;}return _0x20b908;}function V(_0x283ae2,_0x38c978,_0x145650){const _0x48c54a=_0x5e6b2d;let _0x305eeb=_0x23ff19['newAPI'](_0x283ae2);switch(_0x145650){case _0x35327a[_0x48c54a(0x304)]:return H(_0x305eeb[_0x48c54a(0x1cd)](_0x38c978)?.[_0x48c54a(0x2c2)](),_0x38c978);case _0x35327a['UNIVER_DOC']:return H(_0x305eeb[_0x48c54a(0x288)](_0x38c978)?.['save'](),_0x38c978);case _0x35327a['UNIVER_SLIDE']:return H(_0x305eeb[_0x48c54a(0x2ef)](_0x38c978)?.[_0x48c54a(0x2c2)](),_0x38c978);case _0x35327a[_0x48c54a(0x26e)]:return H(_0x305eeb[_0x48c54a(0x2b7)](_0x38c978)?.[_0x48c54a(0x2c2)](),_0x38c978);case _0x35327a[_0x48c54a(0x2dd)]:return H(_0x305eeb[_0x48c54a(0x218)](_0x38c978)?.[_0x48c54a(0x2c2)](),_0x38c978);default:throw new j(_0x48c54a(0x2bf),'Unsupported\x20collaboration\x20Unit\x20type:\x20'+_0x145650);}}function H(_0x4b3271,_0x46b41a){const _0x4a66e0=_0x5e6b2d;if(_0x4b3271===void 0x0)throw new j(_0x4a66e0(0x302),_0x4a66e0(0x2a8)+_0x46b41a+_0x4a66e0(0x213));return structuredClone(_0x4b3271);}function _0x1384(){const _0x273b85=['read','collabSubmitChangesetUrl','board','transformMutations','fetchmissing','race','has','Backend\x20latest\x20revision\x20does\x20not\x20match\x20the\x20initial\x20continuous\x20changeset\x20range','_tail','transform-failed','Session\x20ticket\x20request\x20failed\x20with\x20HTTP\x20','Collaboration\x20HTTP\x20request\x20failed','_injector','\x20after\x20the\x20collaboration\x20runtime\x20entered\x20conflict','2179646eprfMN','formula.mutation.set-calculation-result','JOIN','unitId\x20must\x20not\x20be\x20empty','unit','sessionTicket','Collaboration\x20HTTP\x20request\x20failed\x20with\x20status\x20','length','isArray','get','OPEN','pull-required','_kernel','No\x20active\x20Unit\x20leases','newCsEvent','baseRev','max','Failed\x20to\x20rejoin\x20Unit\x20room','HEARTBEAT','_memberId','_replayRemoteChangesets','target','731267kLmIcQ','join','isSafeInteger','The\x20same\x20changeset\x20submission\x20is\x20already\x20in\x20flight','offline','Snapshot\x20contains\x20duplicate\x20block\x20ids','_inbound','17263800gRtwPq','acceptedChangeset','revisionService','_handleMessage','\x20uses\x20an\x20unsupported\x20protocol','_closed','trigger','_setTransformConflict','Historical\x20restore\x20requires\x20reloading\x20the\x20Unit\x20and\x20is\x20not\x20supported\x20by\x20this\x20runtime','ticket','Historical\x20restore\x20requires\x20reloading\x20the\x20Unit\x20and\x20cannot\x20be\x20pulled\x20in\x20place','_socket','some','Backend\x20returned\x20an\x20ACK\x20that\x20does\x20not\x20match\x20the\x20submitted\x20changeset','Collaboration\x20runtime\x20result\x20must\x20be\x20JSON-compatible','_config','2OdSLIu','Historical\x20restore\x20requires\x20reloading\x20the\x20Unit\x20and\x20cannot\x20be\x20replayed\x20in\x20place','Collaboration\x20runtime\x20is\x20closing\x20or\x20closed','wsSessionTicketUrl','new_changes','commit','\x20character\x20limit','getWorkbook','type','newAPI','_ensureConnected','_connection','RECV','findIndex','Collaboration\x20WebSocket\x20is\x20not\x20online','block','_disposables','UNIVER_SLIDE','push','_handle','values','map','Snapshot\x20revision\x20must\x20be\x20a\x20positive\x20safe\x20integer','unitData','_captureCommandMutation','number','formula.mutation.set-formula-data','formula.mutation.set-trigger-formula-calculation-start','_fetchChangesets','snapshotFrom','parse','getConnectionState','_release','then','_validateAcceptedChangeset','formula.mutation.set-array-formula-data','_failCommandWaiters','Changeset\x20submission\x20was\x20rejected','unchanged','fetchThroughInterceptors','replacePending','getPendingMutations','Failed\x20to\x20send\x20Collaboration\x20WebSocket\x20command','Replacement\x20mutations\x20must\x20contain\x20non-empty\x20id\x20and\x20string\x20data\x20fields','fromCollab','invalid-changeset','Heartbeat\x20failed','Code\x20is\x20longer\x20than\x20the\x20','Collaboration\x20WebSocket\x20closed','Backend\x20returned\x20no\x20Unit\x20snapshot','error','closed','accepted','transformService','Single-Unit\x20runtime\x20for\x20','removeEventListener','commitTimeoutMs','routeKey','formula.mutation.set-trigger-formula-calculation-stop','\x20cannot\x20capture\x20mutation\x20','invalid-revision','finally','submitChangeset','_bufferedChangesets','conflict','code','memberId','from','_unitId','docStateChange$','clear','initial','sheet.mutation.send-init-pivot-text-local','Backend\x20failed\x20to\x20close\x20the\x20initial\x20revision\x20gap','maxCodeLength','backend','pulled','\x20is\x20unavailable','json','Sheet-shaped\x20snapshot\x20is\x20missing\x20workbook\x20metadata','Event','formula.mutation.set-trigger-formula-calculation','getBoard','Backend\x20returned\x20an\x20ACK\x20whose\x20mutations\x20do\x20not\x20match\x20the\x20submitted\x20changeset','Failed\x20to\x20establish\x20Collaboration\x20WebSocket','snapshotServerService','trim','COLLABORATION_PROTOCOL_ERROR','_reconnectTimer','protocol','open','https:','permission_rej','run','_knownHeadRevision','all','timer','replacePendingMutations','_conflict','cancel','onStarting','_scheduleReconnect','Checkpoint\x20revision\x20must\x20be\x20a\x20positive\x20safe\x20integer','GET','Timed\x20out\x20establishing\x20Collaboration\x20WebSocket','application/json','32VPYFEJ','snapshot','resolve','onMutationExecutedForCollab','changeset_should_retry','HELLO','createBase','unsubscribe','_reconnectAttempts','permission-rejected','blockMeta','unitID','getSheetBlock','createUnit','commandService','object','Replacement\x20mutations\x20must\x20be\x20an\x20array','string','pending','add','mode','latestRevision','prependPending','precedingChangesets','_awaiting','set','dispose','12604761exXqRc','retryable','m2Prime','_join','status','wss:','replace','close','return\x20(async\x20()\x20=>\x20{\x20','reconnecting','fetched','_rejectIfNotAccepting','getState','_nextReqId','stringify','index','Backend\x20latest\x20revision\x20does\x20not\x20match\x20its\x20continuous\x20changeset\x20range','Manual\x20collaboration\x20plugin\x20did\x20not\x20reach\x20the\x20Starting\x20lifecycle','changeset_ack','_connectPromise','Cannot\x20','_commandWaiters','entries','_requestCommand','sheets','csRejEvent','addEventListener','awaitingMutations','retry','_heartbeat','injector','changesets','fromEntries','_acceptingOperations','size','UNIVER_BASE','waitForSubmission','httpRequest','reason','getUnitData','unknown','unitId','_submissionWaiters','boolean','_waitForSubmission','kind','write','createUniver','new_changesets','format','pathname','fetch','message','createDocument','_closePromise','Confirmed\x20mutation\x20replay\x20failed\x20at\x20index\x20','_lease','changeset_rej','_handleCollaborationEvent','name','sid','getDocument','Backend\x20returned\x20a\x20non-contiguous\x20changeset\x20range','cmd','Timed\x20out\x20waiting\x20for\x20Collaboration\x20command\x20','_operations','fetchChangesets','COLLABORATION_CLOSED','Buffered\x20changeset\x20does\x20not\x20match\x20the\x20canonical\x20preceding\x20changeset','Backend\x20changesets\x20must\x20be\x20an\x20array','5845012YfLXZN','_createAwaitingFromPending','awaiting-ack','The\x20same\x20Unit\x20id\x20cannot\x20be\x20joined\x20with\x20two\x20Unit\x20types','data','fromChangeset','instanceService','getUnitOnRev','Unsupported\x20collaboration\x20Unit\x20type:\x20','COLLABORATION_UNAVAILABLE','LEAVE','_suppressionDepth','permission','csShouldRetryEvent','\x20for\x20Unit\x20','Session\x20ticket\x20response\x20is\x20missing\x20a\x20ticket','includes','memberID','Connection\x20timed\x20out','_closeAfterFatalError','\x20request\x20is\x20already\x20active\x20for\x20','_baseRevision','originalMeta','Unit\x20','Read\x20execution\x20cannot\x20run\x20persistable\x20action\x20','m1Prime','mutations','permissionRejEvent','reject','_pending','pull','incrementRevOfUnit','delete','collaMsg','acquire','rev','registerPlugin','_closeOwnedResources','getBase','searchParams','splice','subscribe','remote','Changeset\x20submission\x20was\x20denied','promise','takeInboundChangesets','COLLABORATION_INVALID_INPUT','ws:','readyState','save','_executor','online','Confirmed\x20changeset\x20history\x20is\x20not\x20contiguous','changeset-rejected','confirmed','_target','Failed\x20to\x20open\x20the\x20collaboration\x20backend','pluginName','_connect','unit-data','_stopHeartbeat','_consumeBufferedPrecedingChangesets','execute','replace\x20mutations','timeout','Checkpoint\x20Unit\x20type\x20does\x20not\x20match\x20the\x20requested\x20Unit\x20type','_univer','snapshotServerUrl','invalid','_reconcilePrecedingChangesets','suppress','interceptor','getInterceptPoints','Awaiting\x20changeset\x20echo\x20does\x20not\x20follow\x20the\x20current\x20revision','_sid','rejected','UNIVER_BOARD','UNIVER_DOC','reqId','ack','Failed\x20to\x20join\x20Unit\x20room','_joined','ACK\x20revision\x20does\x20not\x20follow\x20the\x20applied\x20confirmed\x20revision','ensureOnline','562266SWzoiW','\x20returned\x20a\x20different\x20block\x20identity','workbook','csAckEvent','getPrototypeOf','48YWQgVg','\x20})();','permission-denied','leases','COMPRESS_MUTATION_SEND','getPresentation','http:','_subscribeToDocumentState','compressMutationService','_capture','MUTATION','Failed\x20to\x20create\x20the\x20collaboration\x20runtime','revision','collabWebSocketUrl','find','_state','catch','POST','unitType','284165QLyAFs','changeset','eventID','redoState','Cannot\x20replace\x20mutations\x20after\x20a\x20changeset\x20is\x20awaiting\x20confirmation','COLLABORATION_LOAD_FAILED','unshift','UNIVER_SHEET','_assertMutableState','createBoard'];_0x1384=function(){return _0x273b85;};return _0x1384();}var fe=class{[_0x5e6b2d(0x274)];['unitType'];[_0x5e6b2d(0x2a6)];[_0x5e6b2d(0x1d9)];['_univer'];['_kernel'];[_0x5e6b2d(0x281)];[_0x5e6b2d(0x26c)]=!0x0;[_0x5e6b2d(0x1bb)]=!0x1;[_0x5e6b2d(0x2f3)];['_executor'];['_operations']=new L();[_0x5e6b2d(0x205)]=[];[_0x5e6b2d(0x224)];[_0x5e6b2d(0x228)]=null;['_awaiting']=null;[_0x5e6b2d(0x2db)]=crypto['randomUUID']();['_nextReqId']=0x1;constructor(_0x41662c,_0x3c266a,_0x1ffd11,_0x366642,_0x3a306e,_0x54bd1a,_0x3a0971){const _0x13561f=_0x5e6b2d;this[_0x13561f(0x274)]=_0x41662c,this[_0x13561f(0x2fc)]=_0x3c266a,this[_0x13561f(0x2a6)]=_0x1ffd11,this[_0x13561f(0x1d9)]=_0x366642,this[_0x13561f(0x2d3)]=_0x3a306e,this[_0x13561f(0x321)]=_0x54bd1a,this[_0x13561f(0x224)]=_0x1ffd11,this[_0x13561f(0x2f3)]=new se(_0x54bd1a,_0x41662c,_0x3c266a),this['_executor']=ue(_0x3a306e,_0x41662c,_0x3a0971);}[_0x5e6b2d(0x257)](){const _0x13caec=_0x5e6b2d;return{'awaitingChangeset':this[_0x13caec(0x248)]===null?null:U(this['_awaiting']),'baseRevision':this[_0x13caec(0x2a6)],'bufferedChangesetCount':this[_0x13caec(0x205)][_0x13caec(0x31c)],'conflict':this[_0x13caec(0x228)],'connection':this['_closed']?_0x13caec(0x1f9):this['_handle'][_0x13caec(0x1e5)](),'knownHeadRevision':this[_0x13caec(0x224)],'pendingMutationCount':this['_capture'][_0x13caec(0x242)]['length']};}[_0x5e6b2d(0x1ef)](){const _0xd2acf5=_0x5e6b2d;return structuredClone(this[_0xd2acf5(0x2f3)]['pending']);}[_0x5e6b2d(0x27e)](){const _0x3972cc=_0x5e6b2d;return this[_0x3972cc(0x256)]()||this[_0x3972cc(0x28c)][_0x3972cc(0x223)](async()=>(this[_0x3972cc(0x305)](_0x3972cc(0x27e)),await this[_0x3972cc(0x1e2)]()));}[_0x5e6b2d(0x2af)](){const _0x38b86a=_0x5e6b2d;return this['_rejectIfNotAccepting']()||this[_0x38b86a(0x28c)][_0x38b86a(0x223)](async()=>{const _0x373537=_0x38b86a;if(this[_0x373537(0x305)](_0x373537(0x2af)),await this[_0x373537(0x1e2)](),this['_bufferedChangesets'][_0x373537(0x31c)]===0x0)return{'state':this[_0x373537(0x257)](),'status':'up-to-date'};let _0x1eb9ec=[...this['_bufferedChangesets']];if(_0x1eb9ec[_0x373537(0x1c2)](_0x51e035=>_0x51e035[_0x373537(0x2ab)][_0x373537(0x1c2)](_0x367da8=>_0x367da8['id']===_0x5c912b['id'])))throw new j('COLLABORATION_PROTOCOL_ERROR',_0x373537(0x1c0));let _0x315845=this['_baseRevision'],_0x1352b8=this[_0x373537(0x248)]?W(this[_0x373537(0x248)][_0x373537(0x2ab)],this['unitId'],this['unitType'],this[_0x373537(0x2a6)]):null,_0x3f3581=_0x22f50a({'baseRev':this[_0x373537(0x2a6)],'memberID':'','mutations':[...this[_0x373537(0x2f3)][_0x373537(0x242)]],'revision':0x0,'type':this['unitType'],'unitID':this[_0x373537(0x274)],'userID':''})['mutations'],_0x56138e=[];for(let _0x16e78b of _0x1eb9ec){let _0x5e87ee=_0x22f50a(_0x16e78b);if(this[_0x373537(0x248)]!==null&&_0x16e78b['sid']===this[_0x373537(0x248)][_0x373537(0x287)]&&_0x16e78b[_0x373537(0x2df)]===this[_0x373537(0x248)]['reqId']){let _0x4926ad=(_0x1352b8??[])[_0x373537(0x1db)](_0x46de9d);G(_0x16e78b[_0x373537(0x2ab)],_0x4926ad)||await this[_0x373537(0x2a4)](new j(_0x373537(0x21d),'Awaiting\x20changeset\x20echo\x20does\x20not\x20match\x20the\x20transformed\x20local\x20mutations')),_0x56138e[_0x373537(0x1d8)]({'changeset':_0x16e78b,'kind':_0x373537(0x293)}),_0x1352b8=null;continue;}let _0x72e664=_0x5e87ee[_0x373537(0x2ab)];if(_0x1352b8!==null){let _0x40b000=this[_0x373537(0x321)][_0x373537(0x1fb)]['transformMutations'](_0x72e664,_0x1352b8,!0x1);if(!_0x5569a7(_0x40b000))return this[_0x373537(0x228)]={'message':_0x40b000[_0x373537(0x1f8)][_0x373537(0x27f)],'operation':_0x373537(0x2af),'reason':_0x373537(0x310)},{'conflict':this['_conflict'],'state':this['getState'](),'status':'conflict'};_0x72e664=_0x40b000[_0x373537(0x2aa)],_0x1352b8=_0x40b000[_0x373537(0x24d)];}let _0x4ad8ba=this[_0x373537(0x321)]['transformService'][_0x373537(0x30a)](_0x72e664,_0x3f3581,!0x1);if(!_0x5569a7(_0x4ad8ba))return this['_conflict']={'message':_0x4ad8ba[_0x373537(0x1f8)][_0x373537(0x27f)],'operation':_0x373537(0x2af),'reason':'transform-failed'},{'conflict':this[_0x373537(0x228)],'state':this[_0x373537(0x257)](),'status':'conflict'};_0x56138e[_0x373537(0x1d8)]({'changeset':_0x14fe0e({..._0x5e87ee,'mutations':_0x4ad8ba[_0x373537(0x2aa)]}),'kind':_0x373537(0x2bb)}),_0x3f3581=_0x4ad8ba['m2Prime'];}let _0x29b669=_0x315845;for(let _0xe23950 of _0x56138e){if(_0xe23950[_0x373537(0x278)]===_0x373537(0x293)){let _0x390ec8=this['_kernel']['revisionService']['incrementRevOfUnit'](this[_0x373537(0x274)]);_0x390ec8!==_0xe23950[_0x373537(0x2fe)][_0x373537(0x2f6)]&&await this[_0x373537(0x2a4)](new j(_0x373537(0x21d),_0x373537(0x2da))),_0x29b669=_0x390ec8;continue;}_0x29b669=await this[_0x373537(0x1ad)](_0x29b669,[_0xe23950['changeset']]);}return this[_0x373537(0x2f3)][_0x373537(0x1ee)](_0x3f3581[_0x373537(0x1db)](_0x46de9d)),this['_awaiting']!==null&&(this['_awaiting']=_0x1352b8===null?null:{...this[_0x373537(0x248)],'baseRev':_0x29b669,'mutations':_0x1352b8[_0x373537(0x1db)](_0x46de9d)}),this[_0x373537(0x2a6)]=_0x29b669,this[_0x373537(0x205)]['splice'](0x0),{'appliedChangesets':_0x1eb9ec[_0x373537(0x1db)](z),'fromRevision':_0x315845,'state':this[_0x373537(0x257)](),'status':_0x373537(0x212),'toRevision':_0x29b669,'transformedPendingMutationCount':_0x3f3581[_0x373537(0x31c)]};});}[_0x5e6b2d(0x1cb)](){const _0x1998b7=_0x5e6b2d;return this[_0x1998b7(0x256)]()||this[_0x1998b7(0x28c)][_0x1998b7(0x223)](async()=>{const _0x424610=_0x1998b7;this[_0x424610(0x305)]('commit');let _0x537a9e=[],_0xb0eb5e=[];if(this[_0x424610(0x248)]===null){if(this[_0x424610(0x2f3)][_0x424610(0x242)][_0x424610(0x31c)]===0x0)return{'state':this['getState'](),'status':'nothing-to-commit'};if(await this[_0x424610(0x1e2)](),this[_0x424610(0x205)]['length']>0x0)return{'baseRevision':this[_0x424610(0x2a6)],'confirmedChangesets':_0x537a9e,'knownHeadRevision':this['_knownHeadRevision'],'state':this['getState'](),'status':_0x424610(0x320)};this['_createAwaitingFromPending']();}for(;this[_0x424610(0x248)]!==null;){let _0x251b24=this[_0x424610(0x248)],_0x5d3604;try{_0x5d3604=await this['_handle'][_0x424610(0x204)](_0x251b24);}catch{return{'changeset':U(_0x251b24),'confirmedChangesets':_0x537a9e,'state':this['getState'](),'status':_0x424610(0x273)};}if(_0x5d3604[_0x424610(0x24f)]===_0x424610(0x267)||_0x5d3604['status']===_0x424610(0x273))return{'changeset':U(_0x251b24),'confirmedChangesets':_0x537a9e,'state':this[_0x424610(0x257)](),'status':_0x5d3604[_0x424610(0x24f)]};if(_0x5d3604['status']==='rejected')return _0x5d3604[_0x424610(0x271)]==='invalid-revision'?(this[_0x424610(0x2f3)][_0x424610(0x246)](_0x251b24['mutations']),this[_0x424610(0x248)]=null,await this['_fetchChangesets'](),{'baseRevision':this['_baseRevision'],'confirmedChangesets':_0x537a9e,'knownHeadRevision':this[_0x424610(0x224)],'state':this[_0x424610(0x257)](),'status':_0x424610(0x320)}):(this[_0x424610(0x228)]={'message':_0x5d3604[_0x424610(0x27f)],'operation':_0x424610(0x1cb),'reason':_0x5d3604[_0x424610(0x271)]===_0x424610(0x2ec)?_0x424610(0x239):_0x424610(0x2c6)},{'conflict':this[_0x424610(0x228)],'confirmedChangesets':_0x537a9e,'state':this[_0x424610(0x257)](),'status':_0x424610(0x206)});let _0x65068b=_0x5d3604[_0x424610(0x1b7)];try{this['_validateAcceptedChangeset'](_0x251b24,_0x5d3604[_0x424610(0x247)],_0x65068b);}catch(_0x5e0c5b){await this[_0x424610(0x2a4)](_0x5e0c5b);}let _0x2f2a38=_0x251b24['mutations'];if(_0x5d3604[_0x424610(0x247)][_0x424610(0x31c)]>0x0){let _0x158e63=await this[_0x424610(0x2d6)](_0x251b24,_0x5d3604[_0x424610(0x247)]);if(_0x158e63===null)return{'conflict':this[_0x424610(0x228)],'confirmedChangesets':_0x537a9e,'state':this[_0x424610(0x257)](),'status':'conflict'};_0x2f2a38=_0x158e63[_0x424610(0x266)];try{this['_consumeBufferedPrecedingChangesets'](_0x5d3604['precedingChangesets']);}catch(_0xdca64f){await this[_0x424610(0x2a4)](_0xdca64f);}_0xb0eb5e[_0x424610(0x1d8)](..._0x5d3604['precedingChangesets']['map'](z));}G(_0x65068b[_0x424610(0x2ab)],_0x2f2a38)||await this[_0x424610(0x2a4)](new j('COLLABORATION_PROTOCOL_ERROR',_0x424610(0x219)));let _0x1b4bc9=this[_0x424610(0x321)][_0x424610(0x1b8)][_0x424610(0x2b0)](this[_0x424610(0x274)]);if(_0x1b4bc9!==_0x65068b[_0x424610(0x2f6)]&&await this['_closeAfterFatalError'](new j(_0x424610(0x21d),_0x424610(0x2e3))),this[_0x424610(0x2a6)]=_0x1b4bc9,this[_0x424610(0x224)]=Math[_0x424610(0x325)](this[_0x424610(0x224)],_0x1b4bc9),this[_0x424610(0x248)]=null,_0x537a9e['push'](z(_0x65068b)),this[_0x424610(0x2f3)]['pending'][_0x424610(0x31c)]===0x0)break;this['_createAwaitingFromPending']();}return{'confirmedChangesets':_0x537a9e,'reconciledChangesets':_0xb0eb5e,'state':this[_0x424610(0x257)](),'status':_0x424610(0x2c7)};});}async[_0x5e6b2d(0x1e2)](){const _0x156f18=_0x5e6b2d;let _0x3497f0=this[_0x156f18(0x224)],_0x505228=await this[_0x156f18(0x1d9)]['fetchChangesets'](_0x3497f0,void 0x0);if(_0x3e8af9(_0x505228[_0x156f18(0x1f8)])){let _0x4472b0=_0x505228[_0x156f18(0x1f8)];throw new j('COLLABORATION_UNAVAILABLE',_0x4472b0?.['message']||'Backend\x20failed\x20to\x20fetch\x20changesets',{'retryable':!0x0});}let _0x58b86f=R(_0x505228[_0x156f18(0x26a)],this[_0x156f18(0x274)],this[_0x156f18(0x2fc)],_0x3497f0),_0x5019a1=_0x58b86f['at'](-0x1)?.[_0x156f18(0x2f6)]??_0x3497f0;if(_0x505228[_0x156f18(0x245)]!==void 0x0&&_0x505228[_0x156f18(0x245)]!==_0x5019a1)throw new j(_0x156f18(0x21d),_0x156f18(0x25b));return _0x58b86f[_0x156f18(0x31c)]===0x0?{'knownHeadRevision':this['_knownHeadRevision'],'state':this[_0x156f18(0x257)](),'status':_0x156f18(0x1ec)}:(this[_0x156f18(0x205)]['push'](..._0x58b86f),this[_0x156f18(0x224)]=_0x5019a1,{'changesets':_0x58b86f[_0x156f18(0x1db)](z),'fromRevision':_0x3497f0,'state':this[_0x156f18(0x257)](),'status':_0x156f18(0x255),'toRevision':_0x5019a1});}[_0x5e6b2d(0x292)](){const _0x451b46=_0x5e6b2d;let _0x2b30b3=this[_0x451b46(0x2f3)]['takePending']();this[_0x451b46(0x248)]={'baseRev':this['_baseRevision'],'mutations':_0x2b30b3,'reqId':this[_0x451b46(0x258)],'sid':this[_0x451b46(0x2db)]},this[_0x451b46(0x258)]+=0x1;}[_0x5e6b2d(0x1e8)](_0x431565,_0xf684b6,_0x36e34c){const _0x564e8d=_0x5e6b2d;let _0x985d5c=R(_0xf684b6,this[_0x564e8d(0x274)],this[_0x564e8d(0x2fc)],this[_0x564e8d(0x2a6)])['at'](-0x1)?.[_0x564e8d(0x2f6)]??this['_baseRevision'];if(_0x36e34c[_0x564e8d(0x23b)]!==this[_0x564e8d(0x274)]||_0x36e34c[_0x564e8d(0x1ce)]!==this[_0x564e8d(0x2fc)]||_0x36e34c[_0x564e8d(0x287)]!==_0x431565[_0x564e8d(0x287)]||_0x36e34c[_0x564e8d(0x2df)]!==_0x431565['reqId']||_0x36e34c['baseRev']!==_0x985d5c||_0x36e34c[_0x564e8d(0x2f6)]!==_0x985d5c+0x1)throw new j(_0x564e8d(0x21d),_0x564e8d(0x1c3));}async[_0x5e6b2d(0x2d6)](_0x335f43,_0x5c8ad1){const _0x285df7=_0x5e6b2d;let _0x41c336=W(_0x335f43[_0x285df7(0x2ab)],this[_0x285df7(0x274)],this['unitType'],this[_0x285df7(0x2a6)]),_0x5e5909=W(this[_0x285df7(0x2f3)][_0x285df7(0x242)],this[_0x285df7(0x274)],this[_0x285df7(0x2fc)],this['_baseRevision']),_0x2980a7=[];for(let _0x4dd84a of _0x5c8ad1){let _0x3d56fc=_0x22f50a(_0x4dd84a),_0x12115f=this['_kernel']['transformService'][_0x285df7(0x30a)](_0x3d56fc[_0x285df7(0x2ab)],_0x41c336,!0x1);if(!_0x5569a7(_0x12115f))return this[_0x285df7(0x1bd)]('commit',_0x12115f[_0x285df7(0x1f8)]),null;_0x41c336=_0x12115f[_0x285df7(0x24d)];let _0x32350e=this['_kernel'][_0x285df7(0x1fb)][_0x285df7(0x30a)](_0x12115f[_0x285df7(0x2aa)],_0x5e5909,!0x1);if(!_0x5569a7(_0x32350e))return this[_0x285df7(0x1bd)](_0x285df7(0x1cb),_0x32350e[_0x285df7(0x1f8)]),null;_0x5e5909=_0x32350e[_0x285df7(0x24d)],_0x2980a7[_0x285df7(0x1d8)](_0x14fe0e({..._0x3d56fc,'mutations':_0x32350e[_0x285df7(0x2aa)]}));}let _0x2ae501=await this[_0x285df7(0x1ad)](this[_0x285df7(0x2a6)],_0x2980a7);return this[_0x285df7(0x2f3)]['replacePending'](_0x5e5909[_0x285df7(0x1db)](_0x46de9d)),this[_0x285df7(0x2a6)]=_0x2ae501,{'awaitingMutations':_0x41c336[_0x285df7(0x1db)](_0x46de9d),'revision':_0x2ae501};}[_0x5e6b2d(0x1bd)](_0x1a4d12,_0x28ac9a){const _0x257857=_0x5e6b2d;this[_0x257857(0x228)]={'message':_0x28ac9a['message'],'operation':_0x1a4d12,'reason':_0x257857(0x310)};}async[_0x5e6b2d(0x1ad)](_0x5e84e5,_0x5ccfce){const _0x149f16=_0x5e6b2d;try{return await this[_0x149f16(0x2f3)][_0x149f16(0x2d7)](async()=>B(this[_0x149f16(0x321)],this[_0x149f16(0x274)],this[_0x149f16(0x2fc)],_0x5e84e5,_0x5ccfce,'remote'));}catch(_0x17fe4d){return await this[_0x149f16(0x2a4)](_0x17fe4d);}}async[_0x5e6b2d(0x2a4)](_0x25c5f0){const _0x5391ad=_0x5e6b2d;this[_0x5391ad(0x26c)]=!0x1,this[_0x5391ad(0x281)]??=this['_closeOwnedResources']();try{await this[_0x5391ad(0x281)];}catch{}throw _0x25c5f0;}[_0x5e6b2d(0x2ce)](_0xab4df0){const _0x9e3e7b=_0x5e6b2d;let _0x3cb66c=_0xab4df0['at'](-0x1)?.['revision'];if(_0x3cb66c===void 0x0||this['_bufferedChangesets'][_0x9e3e7b(0x31c)]===0x0)return;let _0x1c8fae=this[_0x9e3e7b(0x205)][_0x9e3e7b(0x1d3)](({revision:_0x5c52c4})=>_0x5c52c4>_0x3cb66c),_0x2b9e57=this[_0x9e3e7b(0x205)]['slice'](0x0,_0x1c8fae===-0x1?this[_0x9e3e7b(0x205)][_0x9e3e7b(0x31c)]:_0x1c8fae);for(let _0x2f266e of _0x2b9e57){let _0x1a8f09=_0xab4df0[_0x9e3e7b(0x2f8)](({revision:_0x20c7ca})=>_0x20c7ca===_0x2f266e['revision']);if(!_0x1a8f09||!pe(_0x2f266e,_0x1a8f09))throw new j('COLLABORATION_PROTOCOL_ERROR',_0x9e3e7b(0x28f));}this['_bufferedChangesets'][_0x9e3e7b(0x2b9)](0x0,_0x2b9e57[_0x9e3e7b(0x31c)]);}['execute'](_0x4e8803){const _0x2becdf=_0x5e6b2d;return this['_rejectIfNotAccepting']()||this['_operations'][_0x2becdf(0x223)](async()=>{const _0x1f5460=_0x2becdf;_0x4e8803[_0x1f5460(0x244)]===_0x1f5460(0x279)&&this[_0x1f5460(0x305)]('write');let _0x462235=this['_capture'][_0x1f5460(0x242)]['length'],_0x1e7e34=P(await this[_0x1f5460(0x2c3)][_0x1f5460(0x2cf)](_0x4e8803[_0x1f5460(0x207)],_0x4e8803[_0x1f5460(0x244)]));return _0x4e8803[_0x1f5460(0x244)]===_0x1f5460(0x307)?{'state':this['getState'](),'value':_0x1e7e34}:{'mutations':this['_capture'][_0x1f5460(0x1e3)](_0x462235),'state':this[_0x1f5460(0x257)](),'value':_0x1e7e34};});}[_0x5e6b2d(0x227)](_0x22db6e){const _0x161fee=_0x5e6b2d;return this[_0x161fee(0x256)]()||this['_operations'][_0x161fee(0x223)](async()=>{const _0x5f35ed=_0x161fee;if(this[_0x5f35ed(0x305)](_0x5f35ed(0x2d0)),this['_awaiting']!==null)throw new j(_0x5f35ed(0x2bf),_0x5f35ed(0x301));let _0x42bdf0=me(_0x22db6e),_0x401920=[...this[_0x5f35ed(0x2f3)][_0x5f35ed(0x242)]];this['_capture'][_0x5f35ed(0x1ee)](_0x42bdf0);let _0x1c180b=this[_0x5f35ed(0x257)]();return{'pendingMutationCount':_0x42bdf0[_0x5f35ed(0x31c)],'previousMutationCount':_0x401920['length'],'state':_0x1c180b};});}['exportUnitData'](){const _0x2d79b6=_0x5e6b2d;return this[_0x2d79b6(0x256)]()||this[_0x2d79b6(0x28c)][_0x2d79b6(0x223)](async()=>V(this[_0x2d79b6(0x2d3)],this[_0x2d79b6(0x274)],this[_0x2d79b6(0x2fc)]));}[_0x5e6b2d(0x252)](){const _0x562b14=_0x5e6b2d;return this[_0x562b14(0x281)]?this[_0x562b14(0x281)]:(this['_acceptingOperations']=!0x1,this['_closePromise']=this[_0x562b14(0x28c)][_0x562b14(0x223)](async()=>await this['_closeOwnedResources']()),this[_0x562b14(0x281)]);}async[_0x5e6b2d(0x2b6)](){const _0x194e19=_0x5e6b2d;try{this[_0x194e19(0x2f3)][_0x194e19(0x24a)](),await this['_handle']['close']();}finally{try{this[_0x194e19(0x2d3)]['dispose']();}finally{this[_0x194e19(0x1bb)]=!0x0;}}}[_0x5e6b2d(0x256)](){const _0x31141d=_0x5e6b2d;return this[_0x31141d(0x26c)]?null:Promise['reject'](new j(_0x31141d(0x28e),_0x31141d(0x1c8)));}[_0x5e6b2d(0x305)](_0x4bf413){const _0x2398a8=_0x5e6b2d;if(this[_0x2398a8(0x228)]!==null)throw new j('COLLABORATION_INVALID_INPUT',_0x2398a8(0x25f)+_0x4bf413+_0x2398a8(0x314));}};function U(_0x40b4e8){const _0x1b04d3=_0x5e6b2d;return{'baseRevision':_0x40b4e8[_0x1b04d3(0x324)],'mutationCount':_0x40b4e8[_0x1b04d3(0x2ab)][_0x1b04d3(0x31c)],'reqId':_0x40b4e8[_0x1b04d3(0x2df)],'revision':0x0,'sid':_0x40b4e8[_0x1b04d3(0x287)]};}function W(_0x13c76c,_0x5b2991,_0x26e01c,_0x27a13d){return _0x22f50a({'baseRev':_0x27a13d,'memberID':'','mutations':[..._0x13c76c],'revision':0x0,'type':_0x26e01c,'unitID':_0x5b2991,'userID':''})['mutations'];}function pe(_0x29850a,_0x171cb4){const _0x304f14=_0x5e6b2d;return _0x29850a['unitID']===_0x171cb4['unitID']&&_0x29850a[_0x304f14(0x1ce)]===_0x171cb4['type']&&_0x29850a['baseRev']===_0x171cb4[_0x304f14(0x324)]&&_0x29850a[_0x304f14(0x2f6)]===_0x171cb4[_0x304f14(0x2f6)]&&_0x29850a[_0x304f14(0x287)]===_0x171cb4[_0x304f14(0x287)]&&_0x29850a[_0x304f14(0x2df)]===_0x171cb4[_0x304f14(0x2df)]&&JSON[_0x304f14(0x259)](_0x29850a[_0x304f14(0x2ab)])===JSON[_0x304f14(0x259)](_0x171cb4[_0x304f14(0x2ab)]);}function G(_0x530d76,_0x402c4d){const _0x25a48b=_0x5e6b2d;return _0x530d76[_0x25a48b(0x31c)]===_0x402c4d['length']&&_0x530d76['every']((_0x5e5d0d,_0x2d2a15)=>_0x5e5d0d['id']===_0x402c4d[_0x2d2a15]?.['id']&&_0x5e5d0d['data']===_0x402c4d[_0x2d2a15]?.[_0x25a48b(0x295)]);}function me(_0x5683e3){const _0x3ac151=_0x5e6b2d;if(!Array[_0x3ac151(0x31d)](_0x5683e3))throw new j(_0x3ac151(0x2bf),_0x3ac151(0x240));return _0x5683e3[_0x3ac151(0x1db)](_0x14f5e6=>{const _0x41fe01=_0x3ac151;if(!_0x14f5e6||typeof _0x14f5e6!=_0x41fe01(0x23f)||typeof _0x14f5e6['id']!='string'||_0x14f5e6['id'][_0x41fe01(0x31c)]===0x0||typeof _0x14f5e6['data']!=_0x41fe01(0x241))throw new j(_0x41fe01(0x2bf),_0x41fe01(0x1f1));return{'data':_0x14f5e6[_0x41fe01(0x295)],'id':_0x14f5e6['id']};});}var K=class extends _0x3590eb{['_config'];[_0x5e6b2d(0x313)];static [_0x5e6b2d(0x2ca)]='UNIVER_CLI_SDK_MANUAL_COLLABORATION_PLUGIN';constructor(_0x4147ac,_0x4ad59d){const _0xcdb319=_0x5e6b2d;super(),this[_0xcdb319(0x1c5)]=_0x4147ac,this[_0xcdb319(0x313)]=_0x4ad59d;}[_0x5e6b2d(0x22a)](){const _0x5d56d7=_0x5e6b2d;this[_0x5d56d7(0x1c5)]['snapshotServerService']!==void 0x0&&_0x2bb7ea(this[_0x5d56d7(0x313)],[[_0x32e3ff,{'useValue':this[_0x5d56d7(0x1c5)]['snapshotServerService']}]]),this['_config'][_0x5d56d7(0x22a)]({'commandService':this[_0x5d56d7(0x313)]['get'](_0x4398d7),'compressMutationService':this[_0x5d56d7(0x313)]['get'](_0x125608),'instanceService':this[_0x5d56d7(0x313)][_0x5d56d7(0x31e)](_0x36c186),'injector':this[_0x5d56d7(0x313)],'revisionService':this[_0x5d56d7(0x313)][_0x5d56d7(0x31e)](_0x2dad72),'transformService':this[_0x5d56d7(0x313)]['get'](_0x1a5c37)});}};K=_0x2174d4([_0x57fa7a(_0x59c157),_0x4cf2f2(0x1,_0x191d9f(_0x857fc3))],K);function he(_0x3d77e4,_0x5b8587){const _0x7b233f=_0x5e6b2d;let _0x4ccc17;if(_0x3d77e4[_0x7b233f(0x2b5)](K,{'onStarting'(_0xf38616){_0x4ccc17=_0xf38616;},..._0x5b8587===void 0x0?{}:{'snapshotServerService':_0x5b8587}}),!_0x4ccc17)throw Error(_0x7b233f(0x25c));return _0x4ccc17;}async function ge(_0x2265c0,_0x46744c,_0x324b77){const _0x223693=_0x5e6b2d;let _0x25bb9b=await _0x2265c0[_0x223693(0x298)](0x0);if(_0x3e8af9(_0x25bb9b[_0x223693(0x1f8)])){let _0x44e1ac=_0x25bb9b[_0x223693(0x1f8)];throw new j('COLLABORATION_LOAD_FAILED',_0x44e1ac?.[_0x223693(0x27f)]||'Backend\x20failed\x20to\x20load\x20the\x20Unit\x20snapshot');}let _0x5d8cc9=_0x25bb9b['snapshot'];if(!_0x5d8cc9)throw new j(_0x223693(0x302),_0x223693(0x1f7));_e(_0x5d8cc9,_0x46744c,_0x324b77);try{switch(_0x324b77){case _0x35327a[_0x223693(0x304)]:return{'changesets':_0x25bb9b[_0x223693(0x26a)],'unitData':await _0x2c2b13(_0x5d8cc9,await q(_0x2265c0,_0x5d8cc9)),'unitType':_0x324b77};case _0x35327a['UNIVER_DOC']:return{'changesets':_0x25bb9b[_0x223693(0x26a)],'unitData':_0x1dbd3a(_0x5d8cc9),'unitType':_0x324b77};case _0x35327a[_0x223693(0x1d7)]:return{'changesets':_0x25bb9b['changesets'],'unitData':_0x226a08(_0x5d8cc9),'unitType':_0x324b77};case _0x35327a[_0x223693(0x26e)]:return{'changesets':_0x25bb9b[_0x223693(0x26a)],'unitData':await _0x3ded75(_0x5d8cc9,await q(_0x2265c0,_0x5d8cc9)),'unitType':_0x324b77};case _0x35327a[_0x223693(0x2dd)]:return{'changesets':_0x25bb9b[_0x223693(0x26a)],'unitData':_0x4c8227(_0x5d8cc9),'unitType':_0x324b77};default:throw new j(_0x223693(0x2bf),_0x223693(0x299)+_0x324b77);}}catch(_0x4252d6){throw _0x4252d6 instanceof j?_0x4252d6:new j('COLLABORATION_LOAD_FAILED','Failed\x20to\x20transform\x20the\x20Unit\x20snapshot',{'cause':_0x4252d6});}}function _e(_0x5bc7f8,_0x11d7c0,_0x1fc2f3){const _0x11bcc2=_0x5e6b2d;if(_0x5bc7f8[_0x11bcc2(0x23b)]!==_0x11d7c0||_0x5bc7f8[_0x11bcc2(0x1ce)]!==_0x1fc2f3)throw new j(_0x11bcc2(0x302),'Snapshot\x20Unit\x20identity\x20does\x20not\x20match\x20the\x20requested\x20Unit');if(!Number['isSafeInteger'](_0x5bc7f8[_0x11bcc2(0x2b4)])||_0x5bc7f8['rev']<0x1)throw new j(_0x11bcc2(0x302),_0x11bcc2(0x1dc));}async function q(_0x34944d,_0x4a0339){const _0x1faefd=_0x5e6b2d;let _0x1ad05c=_0x4a0339[_0x1faefd(0x2e7)];if(!_0x1ad05c)throw new j('COLLABORATION_LOAD_FAILED',_0x1faefd(0x215));let _0x109a8b=Object[_0x1faefd(0x1da)](_0x1ad05c[_0x1faefd(0x23a)])['flatMap'](({blocks:_0x394709})=>_0x394709);if(new Set(_0x109a8b)[_0x1faefd(0x26d)]!==_0x109a8b['length'])throw new j(_0x1faefd(0x302),_0x1faefd(0x1b4));return await Promise[_0x1faefd(0x225)](_0x109a8b[_0x1faefd(0x1db)](async _0x477622=>{const _0x332fa9=_0x1faefd;let _0x460532=await _0x34944d[_0x332fa9(0x23c)](_0x477622);if(_0x3e8af9(_0x460532['error'])||!_0x460532[_0x332fa9(0x1d5)])throw new j(_0x332fa9(0x302),_0x460532[_0x332fa9(0x1f8)]?.[_0x332fa9(0x27f)]||'Snapshot\x20block\x20'+_0x477622+_0x332fa9(0x213));if(_0x460532[_0x332fa9(0x1d5)]['id']!==_0x477622)throw new j(_0x332fa9(0x302),'Snapshot\x20block\x20'+_0x477622+_0x332fa9(0x2e6));return _0x460532[_0x332fa9(0x1d5)];}));}function ve(_0x2b6c2f){const _0x48bdd7=_0x5e6b2d;let _0x42f687=_0x2b6c2f[_0x48bdd7(0x210)]??0xa00000;if(!Number[_0x48bdd7(0x1b1)](_0x42f687)||_0x42f687<=0x0)throw new j(_0x48bdd7(0x2bf),'maxCodeLength\x20must\x20be\x20a\x20positive\x20safe\x20integer');return{async 'load'(_0x5a95bf,_0x24e172){const _0x2ae629=_0x48bdd7;be(_0x5a95bf,_0x24e172);let _0x50fada,_0x4ab515={'unitId':_0x5a95bf,'unitType':_0x24e172},_0x1c83a7={'unitId':_0x5a95bf,'unitType':_0x24e172,..._0x2b6c2f[_0x2ae629(0x21b)]===void 0x0?{}:{'resolveSnapshotService':()=>{const _0x3239e4=_0x2ae629;if(_0x50fada===void 0x0)throw new j(_0x3239e4(0x302),'SnapshotService\x20is\x20not\x20ready\x20until\x20the\x20Univer\x20factory\x20has\x20returned');return _0x50fada;}}},_0x20f013;try{_0x20f013=await _0x2b6c2f[_0x2ae629(0x211)][_0x2ae629(0x220)](_0x4ab515);}catch(_0x1d33e9){throw new j(_0x2ae629(0x29a),_0x2ae629(0x2c9),{'cause':_0x1d33e9,'retryable':!0x0});}let _0xf03f82;try{_0xf03f82=await _0x2b6c2f[_0x2ae629(0x27a)](_0x1c83a7);let _0x3e72e4=he(_0xf03f82,_0x2b6c2f[_0x2ae629(0x21b)]);_0x2b6c2f[_0x2ae629(0x21b)]!==void 0x0&&(_0x50fada=_0x3e72e4['injector'][_0x2ae629(0x31e)](_0x16d22b));let _0x24ef43=await xe(_0x20f013,_0x5a95bf,_0x24e172);Se(_0x24ef43,_0x4ab515),Ce(_0xf03f82,_0x24ef43);let _0x238616=B(_0x3e72e4,_0x5a95bf,_0x24e172,J(_0x24ef43['unitData']),_0x24ef43[_0x2ae629(0x26a)]),_0x3a7306=await _0x20f013['fetchChangesets'](_0x238616,void 0x0);if(_0x3e8af9(_0x3a7306[_0x2ae629(0x1f8)])){let _0x564f0f=_0x3a7306['error'];throw new j(_0x2ae629(0x29a),_0x564f0f?.[_0x2ae629(0x27f)]||_0x2ae629(0x20f),{'retryable':!0x0});}let _0x316755=R(_0x3a7306['changesets'],_0x5a95bf,_0x24e172,_0x238616),_0x4e4b92=_0x316755['at'](-0x1)?.['revision']??_0x238616;if(_0x3a7306[_0x2ae629(0x245)]!==void 0x0&&_0x3a7306['latestRevision']!==_0x4e4b92)throw new j('COLLABORATION_PROTOCOL_ERROR',_0x2ae629(0x30e));return _0x238616=B(_0x3e72e4,_0x5a95bf,_0x24e172,_0x238616,_0x316755),await ye(_0x3e72e4),new fe(_0x5a95bf,_0x24e172,_0x238616,_0x20f013,_0xf03f82,_0x3e72e4,_0x42f687);}catch(_0x43dada){try{await _0x20f013[_0x2ae629(0x252)]();}catch{}try{_0xf03f82?.[_0x2ae629(0x24a)]();}catch{}throw _0x43dada instanceof j?_0x43dada:new j(_0x2ae629(0x302),_0x2ae629(0x2f5),{'cause':_0x43dada});}}};}async function ye(_0x1dbf4f){const _0x43cc65=_0x5e6b2d;_0x1dbf4f['injector']['has'](_0x1a0611)&&await _0x1dbf4f[_0x43cc65(0x269)]['get'](_0x1a0611)['waitForLatestApplied']();}function be(_0x47f85c,_0x21de7d){const _0x2881d6=_0x5e6b2d;if(_0x47f85c[_0x2881d6(0x21c)]()[_0x2881d6(0x31c)]===0x0)throw new j(_0x2881d6(0x2bf),_0x2881d6(0x318));if(_0x21de7d!==_0x35327a[_0x2881d6(0x304)]&&_0x21de7d!==_0x35327a[_0x2881d6(0x2de)]&&_0x21de7d!==_0x35327a[_0x2881d6(0x1d7)]&&_0x21de7d!==_0x35327a[_0x2881d6(0x26e)]&&_0x21de7d!==_0x35327a['UNIVER_BOARD'])throw new j(_0x2881d6(0x2bf),'Unsupported\x20collaboration\x20Unit\x20type:\x20'+_0x21de7d);}async function xe(_0x76bbea,_0x58a8cd,_0x2e2466){const _0x3d79fe=_0x5e6b2d;return _0x76bbea[_0x3d79fe(0x27c)]===_0x3d79fe(0x2cc)?await _0x76bbea[_0x3d79fe(0x272)]():await ge(_0x76bbea,_0x58a8cd,_0x2e2466);}function Se(_0x6778fa,_0x5911a9){const _0x1bfa7b=_0x5e6b2d;if(_0x6778fa[_0x1bfa7b(0x2fc)]!==_0x5911a9[_0x1bfa7b(0x2fc)])throw new j('COLLABORATION_LOAD_FAILED',_0x1bfa7b(0x2d2));if(_0x6778fa[_0x1bfa7b(0x1dd)]['id']!==_0x5911a9[_0x1bfa7b(0x274)])throw new j(_0x1bfa7b(0x302),'Checkpoint\x20Unit\x20id\x20does\x20not\x20match\x20the\x20requested\x20Unit\x20id');J(_0x6778fa[_0x1bfa7b(0x1dd)]);}function J(_0x3d23b0){const _0x1a16ac=_0x5e6b2d;let _0x534732=_0x3d23b0[_0x1a16ac(0x2b4)];if(!Number['isSafeInteger'](_0x534732)||_0x534732===void 0x0||_0x534732<0x1)throw new j(_0x1a16ac(0x302),_0x1a16ac(0x22c));return _0x534732;}function Ce(_0x34b5b6,_0x99b9c){const _0x3f3ee0=_0x5e6b2d;switch(_0x99b9c[_0x3f3ee0(0x2fc)]){case _0x35327a[_0x3f3ee0(0x304)]:_0x34b5b6['createUnit'](_0x99b9c[_0x3f3ee0(0x2fc)],structuredClone(_0x99b9c['unitData']));return;case _0x35327a['UNIVER_DOC']:_0x34b5b6['createUnit'](_0x99b9c['unitType'],structuredClone(_0x99b9c['unitData']));return;case _0x35327a['UNIVER_SLIDE']:_0x34b5b6['createUnit'](_0x99b9c[_0x3f3ee0(0x2fc)],structuredClone(_0x99b9c[_0x3f3ee0(0x1dd)]));return;case _0x35327a['UNIVER_BASE']:_0x34b5b6[_0x3f3ee0(0x23d)](_0x99b9c[_0x3f3ee0(0x2fc)],structuredClone(_0x99b9c['unitData']));return;case _0x35327a[_0x3f3ee0(0x2dd)]:_0x34b5b6[_0x3f3ee0(0x23d)](_0x99b9c[_0x3f3ee0(0x2fc)],structuredClone(_0x99b9c[_0x3f3ee0(0x1dd)]));return;}}var we=class{['_config'];[_0x5e6b2d(0x2c8)];[_0x5e6b2d(0x283)];[_0x5e6b2d(0x27c)]=_0x5e6b2d(0x231);constructor(_0x2e3d27,_0x5f0166,_0x4755a2){const _0x1fb303=_0x5e6b2d;this[_0x1fb303(0x1c5)]=_0x2e3d27,this[_0x1fb303(0x2c8)]=_0x5f0166,this[_0x1fb303(0x283)]=_0x4755a2;}[_0x5e6b2d(0x1e5)](){const _0x2896b6=_0x5e6b2d;return this[_0x2896b6(0x283)]['getConnectionState']();}async[_0x5e6b2d(0x298)](_0x56b0e6=0x0){const _0x3aff09=_0x5e6b2d;let _0xc0b31e=X(this['_config'][_0x3aff09(0x2d4)],this['_target'][_0x3aff09(0x2fc)],_0x3aff09(0x319),this[_0x3aff09(0x2c8)]['unitId'],_0x3aff09(0x2b4),_0x56b0e6),_0x37a0a2=await Y(this[_0x3aff09(0x1c5)],_0xc0b31e);return Te(_0x37a0a2['snapshot']),_0x37a0a2;}async[_0x5e6b2d(0x23c)](_0x832a46){const _0x17fdcb=_0x5e6b2d;let _0x3bf1e4=X(this['_config'][_0x17fdcb(0x2d4)],this[_0x17fdcb(0x2c8)][_0x17fdcb(0x2fc)],_0x17fdcb(0x319),this[_0x17fdcb(0x2c8)][_0x17fdcb(0x274)],'block',_0x832a46),_0xf84af5=await Y(this[_0x17fdcb(0x1c5)],_0x3bf1e4);return _0xf84af5['block']&&typeof _0xf84af5[_0x17fdcb(0x1d5)][_0x17fdcb(0x295)]==_0x17fdcb(0x241)&&(_0xf84af5['block'][_0x17fdcb(0x295)]=Z(_0xf84af5[_0x17fdcb(0x1d5)][_0x17fdcb(0x295)])),_0xf84af5;}async[_0x5e6b2d(0x28d)](_0x173599,_0x56be63=0x0){const _0x2f463a=_0x5e6b2d;let _0xdfdfed=X(this[_0x2f463a(0x1c5)][_0x2f463a(0x2d4)],this[_0x2f463a(0x2c8)][_0x2f463a(0x2fc)],'unit',this[_0x2f463a(0x2c8)][_0x2f463a(0x274)],_0x2f463a(0x30b));_0xdfdfed['searchParams'][_0x2f463a(0x249)](_0x2f463a(0x209),String(_0x173599)),_0xdfdfed[_0x2f463a(0x2b8)][_0x2f463a(0x249)]('to',String(_0x56be63));let _0x37b0fb=await Y(this[_0x2f463a(0x1c5)],_0xdfdfed);return this['_lease'][_0x2f463a(0x2be)](),_0x37b0fb;}async['submitChangeset'](_0x58a94d){const _0x3db965=_0x5e6b2d;await this['_lease'][_0x3db965(0x2e4)]();let _0x41f5d7=this[_0x3db965(0x283)][_0x3db965(0x26f)](_0x58a94d['sid'],_0x58a94d[_0x3db965(0x2df)]),_0x31b08d={..._0x58a94d,'memberID':this['_lease'][_0x3db965(0x208)],'revision':0x0,'type':this['_target']['unitType'],'unitID':this[_0x3db965(0x2c8)][_0x3db965(0x274)],'userID':''},_0x238e7f=X(this['_config'][_0x3db965(0x308)],this['_target'][_0x3db965(0x2fc)],_0x3db965(0x319),this[_0x3db965(0x2c8)]['unitId'],_0x3db965(0x1ca)),_0x2675a3=this[_0x3db965(0x1c5)][_0x3db965(0x270)](_0x238e7f,{'body':JSON[_0x3db965(0x259)]({'changeset':_0x31b08d,'memberID':this[_0x3db965(0x283)][_0x3db965(0x208)],'type':this[_0x3db965(0x2c8)][_0x3db965(0x2fc)],'unitID':this['_target'][_0x3db965(0x274)]}),'headers':{'content-type':'application/json'},'method':_0x3db965(0x2fb)})[_0x3db965(0x1e7)](async _0x34a2bd=>_0x34a2bd['status']===0x191||_0x34a2bd[_0x3db965(0x24f)]===0x193?_0x3db965(0x29d):_0x34a2bd[_0x3db965(0x24f)]===0x190||_0x34a2bd[_0x3db965(0x24f)]===0x199?_0x3db965(0x2d5):_0x34a2bd['ok']?_0x3db965(0x1fa):'unknown')[_0x3db965(0x2fa)](()=>'unknown'),_0x7c1ae0=Ee(this[_0x3db965(0x1c5)][_0x3db965(0x1fe)]),_0x3dd285=_0x2675a3[_0x3db965(0x1e7)](_0x153dea=>_0x153dea===_0x3db965(0x29d)?{'status':_0x3db965(0x239)}:_0x153dea===_0x3db965(0x2d5)?{'status':_0x3db965(0x2c6)}:new Promise(()=>void 0x0)),_0x40b4e7=await Promise[_0x3db965(0x30c)]([_0x41f5d7[_0x3db965(0x2bd)],_0x3dd285,_0x7c1ae0[_0x3db965(0x2bd)][_0x3db965(0x1e7)](()=>({'status':_0x3db965(0x2d1)}))])[_0x3db965(0x203)](()=>{const _0xebed92=_0x3db965;_0x41f5d7[_0xebed92(0x229)](),_0x7c1ae0[_0xebed92(0x229)]();});if(_0x40b4e7[_0x3db965(0x24f)]==='timeout'){let _0x979feb=await _0x2675a3;return _0x979feb===_0x3db965(0x29d)?{'message':_0x3db965(0x2bc),'reason':_0x3db965(0x2ec),'status':'rejected'}:_0x979feb==='invalid'?{'message':_0x3db965(0x1eb),'reason':_0x3db965(0x1f3),'status':_0x3db965(0x2dc)}:{'status':_0x3db965(0x273)};}if(_0x40b4e7[_0x3db965(0x24f)]===_0x3db965(0x1f9))return{'status':_0x3db965(0x273)};if(_0x40b4e7['status']===_0x3db965(0x267))return{'status':_0x3db965(0x267)};if(_0x40b4e7[_0x3db965(0x24f)]===_0x3db965(0x239))return{'message':_0x3db965(0x2bc),'reason':_0x3db965(0x2ec),'status':_0x3db965(0x2dc)};if(_0x40b4e7[_0x3db965(0x24f)]===_0x3db965(0x2c6)){let _0x282889=await this[_0x3db965(0x28d)](_0x58a94d[_0x3db965(0x324)],_0x58a94d[_0x3db965(0x324)]);return{'message':_0x3db965(0x1eb),'reason':_0x282889[_0x3db965(0x245)]!==void 0x0&&_0x282889[_0x3db965(0x245)]<_0x58a94d[_0x3db965(0x324)]?_0x3db965(0x202):_0x3db965(0x1f3),'status':_0x3db965(0x2dc)};}let _0x55c10e=_0x40b4e7[_0x3db965(0x2fe)],_0x3c394b=await this[_0x3db965(0x28d)](_0x58a94d[_0x3db965(0x324)],_0x55c10e[_0x3db965(0x2f6)]-0x1);if(_0x3e8af9(_0x3c394b['error'])){let _0x1b2829=_0x3c394b['error'];throw new j('COLLABORATION_UNAVAILABLE',_0x1b2829?.[_0x3db965(0x27f)]||'Failed\x20to\x20fetch\x20preceding\x20changesets',{'retryable':!0x0});}return{'acceptedChangeset':_0x55c10e,'precedingChangesets':_0x3c394b['changesets'],'status':_0x3db965(0x2c7)};}async[_0x5e6b2d(0x252)](){const _0x2e6412=_0x5e6b2d;await this[_0x2e6412(0x283)]['close']();}};async function Y(_0x66ffeb,_0x5b8957){const _0x406c38=_0x5e6b2d;let _0x3be458;try{_0x3be458=await _0x66ffeb['httpRequest'](_0x5b8957,{'method':_0x406c38(0x22d)});}catch(_0x51a003){throw new j('COLLABORATION_UNAVAILABLE',_0x406c38(0x312),{'cause':_0x51a003,'retryable':!0x0});}if(!_0x3be458['ok'])throw new j(_0x406c38(0x29a),_0x406c38(0x31b)+_0x3be458[_0x406c38(0x24f)],{'retryable':_0x3be458['status']>=0x1f4});try{return await _0x3be458[_0x406c38(0x214)]();}catch(_0x1c9015){throw new j('COLLABORATION_PROTOCOL_ERROR','Collaboration\x20HTTP\x20response\x20is\x20not\x20valid\x20JSON',{'cause':_0x1c9015});}}function X(_0xa1aceb,..._0x1037b8){const _0x787d59=_0x5e6b2d;let _0x987640=new URL(_0xa1aceb);return _0x987640[_0x787d59(0x27d)]=_0x987640['pathname'][_0x787d59(0x251)](/\/$/,'')+'/'+_0x1037b8[_0x787d59(0x1db)](_0x4b2da0=>encodeURIComponent(String(_0x4b2da0)))[_0x787d59(0x1b0)]('/'),_0x987640;}function Te(_0x49b15e){const _0x2b9440=_0x5e6b2d;if(!_0x49b15e)return;let _0x272400=[_0x49b15e[_0x2b9440(0x2e7)],_0x49b15e['doc'],_0x49b15e['slide'],_0x49b15e[_0x2b9440(0x309)]];for(let _0x494b4c of _0x272400)_0x494b4c&&typeof _0x494b4c[_0x2b9440(0x2a7)]==_0x2b9440(0x241)&&(_0x494b4c[_0x2b9440(0x2a7)]=Z(_0x494b4c[_0x2b9440(0x2a7)]));if(_0x49b15e[_0x2b9440(0x2e7)]){for(let _0x5a160e of Object['values'](_0x49b15e[_0x2b9440(0x2e7)][_0x2b9440(0x263)]))typeof _0x5a160e[_0x2b9440(0x2a7)]=='string'&&(_0x5a160e[_0x2b9440(0x2a7)]=Z(_0x5a160e[_0x2b9440(0x2a7)]));}}function _0x67e3(_0x126240,_0x5b0725){_0x126240=_0x126240-0x1ad;const _0x1384d3=_0x1384();let _0x67e357=_0x1384d3[_0x126240];return _0x67e357;}function Z(_0x1c84f2){const _0x37ca71=_0x5e6b2d;return Uint8Array['from'](Buffer[_0x37ca71(0x209)](_0x1c84f2,'base64'));}function Ee(_0x38dc0b){let _0x300cc5;return{'cancel':()=>{_0x300cc5!==void 0x0&&clearTimeout(_0x300cc5);},'promise':new Promise(_0x4c5fe4=>{_0x300cc5=setTimeout(_0x4c5fe4,_0x38dc0b);})};}var De=class{['_config'];[_0x5e6b2d(0x2f9)]=_0x5e6b2d(0x1b3);['_socket'];[_0x5e6b2d(0x25e)];['_memberId']='';[_0x5e6b2d(0x2e2)]=new Map();['_commandWaiters']=new Map();[_0x5e6b2d(0x275)]=new Map();[_0x5e6b2d(0x1b5)]=new Map();[_0x5e6b2d(0x268)];['_reconnectTimer'];[_0x5e6b2d(0x238)]=0x0;constructor(_0x593e3c){const _0x91d3db=_0x5e6b2d;this[_0x91d3db(0x1c5)]=_0x593e3c;}async[_0x5e6b2d(0x2b3)](_0x17bdfa){const _0x58d504=_0x5e6b2d;let _0x1ef7ff=this['_joined'][_0x58d504(0x31e)](_0x17bdfa['unitId']);if(_0x1ef7ff&&_0x1ef7ff[_0x58d504(0x1ae)][_0x58d504(0x2fc)]!==_0x17bdfa[_0x58d504(0x2fc)])throw new j(_0x58d504(0x2bf),_0x58d504(0x294));if(await this[_0x58d504(0x1d0)](),_0x1ef7ff)_0x1ef7ff[_0x58d504(0x2ed)]+=0x1;else{try{await this[_0x58d504(0x24e)](_0x17bdfa);}catch(_0x136b3f){throw this[_0x58d504(0x2e2)][_0x58d504(0x26d)]===0x0&&(this['_state']='closed',this[_0x58d504(0x2cd)](),this[_0x58d504(0x1c1)]?.[_0x58d504(0x252)](0x3e8,'Initial\x20Unit\x20JOIN\x20failed'),this[_0x58d504(0x1c1)]=void 0x0,this[_0x58d504(0x328)]=''),_0x136b3f;}this['_joined'][_0x58d504(0x249)](_0x17bdfa['unitId'],{'leases':0x1,'target':_0x17bdfa});}let _0x4e8ae5=!0x1,_0x1ec984=()=>this['_memberId'],_0x62a432=new Set();return{'close':async()=>{const _0x4718e0=_0x58d504;if(!_0x4e8ae5){_0x4e8ae5=!0x0;for(let _0x6d49 of _0x62a432)_0x6d49[_0x4718e0(0x229)]();_0x62a432[_0x4718e0(0x20c)](),await this['_release'](_0x17bdfa[_0x4718e0(0x274)]);}},'ensureOnline':async()=>await this[_0x58d504(0x1d0)](),'getConnectionState':()=>_0x4e8ae5?_0x58d504(0x1f9):this['_state'],get 'memberId'(){return _0x1ec984();},'takeInboundChangesets':()=>{const _0x484e63=_0x58d504;let _0x5f5fae=this[_0x484e63(0x1b5)][_0x484e63(0x31e)](_0x17bdfa['unitId'])??[];return this['_inbound']['delete'](_0x17bdfa['unitId']),_0x5f5fae;},'waitForSubmission':(_0x40ad49,_0x12d0ab)=>{const _0x1e5e63=_0x58d504;let _0x346fa0=this['_waitForSubmission'](_0x40ad49,_0x12d0ab);return _0x62a432[_0x1e5e63(0x243)](_0x346fa0),_0x346fa0['promise'][_0x1e5e63(0x1e7)](()=>_0x62a432[_0x1e5e63(0x2b1)](_0x346fa0),()=>_0x62a432['delete'](_0x346fa0)),{'cancel':()=>{const _0xadbbcb=_0x1e5e63;_0x62a432[_0xadbbcb(0x2b1)](_0x346fa0),_0x346fa0['cancel']();},'promise':_0x346fa0[_0x1e5e63(0x2bd)]};}};}async[_0x5e6b2d(0x1d0)](){const _0x56e080=_0x5e6b2d;if(this[_0x56e080(0x2f9)]!==_0x56e080(0x2c4)||this['_socket']?.['readyState']!==WebSocket[_0x56e080(0x31f)]){this[_0x56e080(0x21e)]!==void 0x0&&clearTimeout(this['_reconnectTimer']),this[_0x56e080(0x21e)]=void 0x0,this[_0x56e080(0x25e)]??=this[_0x56e080(0x2cb)]();try{await this['_connectPromise'];}finally{this[_0x56e080(0x25e)]=void 0x0;}}}async['_connect'](){const _0x5702ed=_0x5e6b2d;this['_state']=_0x5702ed(0x254);let _0x310865=await this[_0x5702ed(0x1c5)][_0x5702ed(0x270)](this[_0x5702ed(0x1c5)]['wsSessionTicketUrl'],{'headers':{'content-type':_0x5702ed(0x22f)},'method':_0x5702ed(0x22d)});if(!_0x310865['ok'])throw this[_0x5702ed(0x2f9)]=_0x5702ed(0x1b3),new j(_0x5702ed(0x29a),_0x5702ed(0x311)+_0x310865[_0x5702ed(0x24f)],{'retryable':_0x310865[_0x5702ed(0x24f)]>=0x1f4});let _0x24b83e=await _0x310865[_0x5702ed(0x214)]();if(typeof _0x24b83e['ticket']!=_0x5702ed(0x241)||_0x24b83e[_0x5702ed(0x1bf)][_0x5702ed(0x31c)]===0x0)throw this['_state']=_0x5702ed(0x1b3),new j(_0x5702ed(0x21d),_0x5702ed(0x2a0));let _0x5dad11=new URL(this['_config']['collabWebSocketUrl']);_0x5dad11[_0x5702ed(0x2b8)]['set'](_0x5702ed(0x31a),_0x24b83e[_0x5702ed(0x1bf)]);let _0x1ad289=new WebSocket(_0x5dad11);this[_0x5702ed(0x1c1)]=_0x1ad289,_0x1ad289[_0x5702ed(0x265)](_0x5702ed(0x27f),_0x286b2d=>this['_handleMessage'](_0x286b2d)),_0x1ad289[_0x5702ed(0x265)]('close',()=>{const _0x398a43=_0x5702ed;this[_0x398a43(0x1c1)]===_0x1ad289&&(this[_0x398a43(0x2cd)](),this[_0x398a43(0x1ea)](new j('COLLABORATION_UNAVAILABLE',_0x398a43(0x1f6),{'retryable':!0x0})),this[_0x398a43(0x2f9)]=this['_joined'][_0x398a43(0x26d)]===0x0?'closed':_0x398a43(0x254),this[_0x398a43(0x2e2)][_0x398a43(0x26d)]>0x0&&this[_0x398a43(0x22b)]());}),await Oe(_0x1ad289);let _0x2d22fa=await this[_0x5702ed(0x262)](_0x53cd9f['HELLO'],'',{'cmd':_0x53cd9f['HELLO'],'routeKey':''});if(_0x2d22fa[_0x5702ed(0x207)]!==_0x21c0c8['OK']||typeof _0x2d22fa['infoRsp']?.[_0x5702ed(0x2a2)]!=_0x5702ed(0x241))throw _0x1ad289['close'](),new j(_0x5702ed(0x21d),'Collaboration\x20HELLO\x20response\x20is\x20invalid');this[_0x5702ed(0x328)]=_0x2d22fa['infoRsp'][_0x5702ed(0x2a2)],this[_0x5702ed(0x2f9)]=_0x5702ed(0x2c4);for(let {target:_0x9e0986}of this['_joined'][_0x5702ed(0x1da)]())try{await this[_0x5702ed(0x24e)](_0x9e0986);}catch(_0x34a21d){throw _0x1ad289[_0x5702ed(0x252)](0x3f3,_0x5702ed(0x326)),_0x34a21d;}this[_0x5702ed(0x238)]=0x0,this['_startHeartbeat']();}async[_0x5e6b2d(0x24e)](_0x2dbc27){const _0x1772d6=_0x5e6b2d;let _0x5e5338=await this[_0x1772d6(0x262)](_0x53cd9f['JOIN'],_0x2dbc27[_0x1772d6(0x274)],{'cmd':_0x53cd9f[_0x1772d6(0x317)],'joinReq':{'rooms':[{'args':'','roomID':_0x2dbc27[_0x1772d6(0x274)]}]},'routeKey':_0x2dbc27[_0x1772d6(0x274)]});if(_0x5e5338[_0x1772d6(0x207)]!==_0x21c0c8['OK'])throw new j(_0x1772d6(0x29a),typeof _0x5e5338['reason']==_0x1772d6(0x241)?_0x5e5338[_0x1772d6(0x271)]:_0x1772d6(0x2e1));}[_0x5e6b2d(0x262)](_0x3076f4,_0x595332,_0x56c230){const _0x9877c7=_0x5e6b2d;let _0x47dbdf=this[_0x9877c7(0x1c1)];if(!_0x47dbdf||_0x47dbdf[_0x9877c7(0x2c1)]!==WebSocket[_0x9877c7(0x31f)])return Promise[_0x9877c7(0x2ad)](new j('COLLABORATION_UNAVAILABLE',_0x9877c7(0x1d4),{'retryable':!0x0}));let _0x182939=_0x3076f4+':'+_0x595332;return new Promise((_0x54c274,_0x2b8887)=>{const _0x596f98=_0x9877c7;if(this[_0x596f98(0x260)][_0x596f98(0x30d)](_0x182939)){_0x2b8887(new j('COLLABORATION_PROTOCOL_ERROR','A\x20'+_0x3076f4+_0x596f98(0x2a5)+_0x595332));return;}let _0x161b58=setTimeout(()=>{const _0x544cf2=_0x596f98;this[_0x544cf2(0x260)][_0x544cf2(0x2b1)](_0x182939),_0x2b8887(new j(_0x544cf2(0x29a),_0x544cf2(0x28b)+_0x3076f4,{'retryable':!0x0}));},0x7530);this[_0x596f98(0x260)]['set'](_0x182939,{'reject':_0x2b8887,'resolve':_0x54c274,'timer':_0x161b58});try{_0x47dbdf['send'](JSON[_0x596f98(0x259)](_0x56c230));}catch(_0x2ee49f){this[_0x596f98(0x260)][_0x596f98(0x2b1)](_0x182939),clearTimeout(_0x161b58),_0x2b8887(new j(_0x596f98(0x29a),_0x596f98(0x1f0),{'cause':_0x2ee49f,'retryable':!0x0}));}});}[_0x5e6b2d(0x1b9)](_0x2bbefe){const _0x4cddf9=_0x5e6b2d;if(typeof _0x2bbefe[_0x4cddf9(0x295)]!='string')return;let _0x5ec1b9;try{_0x5ec1b9=JSON[_0x4cddf9(0x1e4)](_0x2bbefe[_0x4cddf9(0x295)]);}catch{this[_0x4cddf9(0x1c1)]?.[_0x4cddf9(0x252)](0x3eb,'Invalid\x20JSON\x20response');return;}let _0x3b9631=typeof _0x5ec1b9[_0x4cddf9(0x1ff)]==_0x4cddf9(0x241)?_0x5ec1b9[_0x4cddf9(0x1ff)]:'';if(_0x5ec1b9['cmd']===_0x53cd9f[_0x4cddf9(0x235)]||_0x5ec1b9[_0x4cddf9(0x28a)]===_0x53cd9f[_0x4cddf9(0x317)]||_0x5ec1b9[_0x4cddf9(0x28a)]===_0x53cd9f[_0x4cddf9(0x327)]){let _0x1ab09a=_0x5ec1b9[_0x4cddf9(0x28a)]+':'+_0x3b9631,_0x2f7448=this['_commandWaiters'][_0x4cddf9(0x31e)](_0x1ab09a);_0x2f7448&&(this[_0x4cddf9(0x260)][_0x4cddf9(0x2b1)](_0x1ab09a),clearTimeout(_0x2f7448[_0x4cddf9(0x226)]),_0x2f7448['resolve'](_0x5ec1b9));return;}_0x5ec1b9['cmd']!==_0x53cd9f[_0x4cddf9(0x1d2)]||!_0x5ec1b9[_0x4cddf9(0x2b2)]||this[_0x4cddf9(0x285)](_0x3b9631,_0x5ec1b9[_0x4cddf9(0x2b2)]);}['_handleCollaborationEvent'](_0x3b3380,_0x571228){const _0x556576=_0x5e6b2d;let _0x4203dc=_0x571228[_0x556576(0x2ff)],_0x277474=_0x4203dc===_0x556576(0x25d)?_0x556576(0x2e8):_0x4203dc===_0x556576(0x284)?_0x556576(0x264):_0x4203dc===_0x556576(0x234)?_0x556576(0x29e):_0x4203dc===_0x556576(0x222)?_0x556576(0x2ac):_0x4203dc===_0x556576(0x27b)?_0x556576(0x323):void 0x0;if(!_0x277474)return;let _0x1f84b4=ke(_0x571228[_0x277474]);if(!_0x1f84b4||_0x1f84b4[_0x556576(0x23b)]!==_0x3b3380)return;if(_0x4203dc===_0x556576(0x27b)){let _0x5c0419=this[_0x556576(0x1b5)][_0x556576(0x31e)](_0x3b3380)??[];_0x5c0419[_0x556576(0x1d8)](_0x1f84b4),this[_0x556576(0x1b5)][_0x556576(0x249)](_0x3b3380,_0x5c0419);return;}let _0x3bf8ef=Q(_0x1f84b4['sid'],_0x1f84b4[_0x556576(0x2df)]),_0x355feb=this[_0x556576(0x275)]['get'](_0x3bf8ef);_0x355feb&&_0x355feb(_0x4203dc===_0x556576(0x25d)?{'changeset':_0x1f84b4,'status':_0x556576(0x2e0)}:_0x4203dc===_0x556576(0x234)?{'status':'retry'}:_0x4203dc==='permission_rej'?{'status':_0x556576(0x239)}:{'status':_0x556576(0x2c6)});}[_0x5e6b2d(0x277)](_0xa3019c,_0x5bb06b){const _0x2fb354=_0x5e6b2d;let _0x1f4899=Q(_0xa3019c,_0x5bb06b);if(this[_0x2fb354(0x275)][_0x2fb354(0x30d)](_0x1f4899))return{'cancel':()=>void 0x0,'promise':Promise[_0x2fb354(0x2ad)](new j(_0x2fb354(0x2bf),_0x2fb354(0x1b2)))};let _0x1dcc75=()=>void 0x0;return{'cancel':()=>_0x1dcc75({'status':_0x2fb354(0x1f9)}),'promise':new Promise(_0x178cc7=>{const _0xb4f109=_0x2fb354;_0x1dcc75=_0x540780=>{const _0x5af6b3=_0x67e3;this[_0x5af6b3(0x275)][_0x5af6b3(0x2b1)](_0x1f4899)&&_0x178cc7(_0x540780);},this[_0xb4f109(0x275)][_0xb4f109(0x249)](_0x1f4899,_0x1dcc75);})};}async[_0x5e6b2d(0x1e6)](_0x4672fa){const _0x2bce36=_0x5e6b2d;let _0x11a21a=this[_0x2bce36(0x2e2)][_0x2bce36(0x31e)](_0x4672fa);_0x11a21a&&(--_0x11a21a['leases'],!(_0x11a21a[_0x2bce36(0x2ed)]>0x0)&&(this['_joined'][_0x2bce36(0x2b1)](_0x4672fa),this[_0x2bce36(0x1b5)]['delete'](_0x4672fa),this[_0x2bce36(0x1c1)]?.[_0x2bce36(0x2c1)]===WebSocket[_0x2bce36(0x31f)]&&this[_0x2bce36(0x1c1)]['send'](JSON[_0x2bce36(0x259)]({'cmd':_0x53cd9f[_0x2bce36(0x29b)],'leaveReq':{'args':'','roomID':_0x4672fa},'routeKey':_0x4672fa})),this['_joined'][_0x2bce36(0x26d)]===0x0&&(this[_0x2bce36(0x2f9)]=_0x2bce36(0x1f9),this[_0x2bce36(0x21e)]!==void 0x0&&clearTimeout(this[_0x2bce36(0x21e)]),this[_0x2bce36(0x21e)]=void 0x0,this['_stopHeartbeat'](),this[_0x2bce36(0x1c1)]?.[_0x2bce36(0x252)](0x3e8,_0x2bce36(0x322)),this[_0x2bce36(0x1c1)]=void 0x0,this[_0x2bce36(0x328)]='')));}[_0x5e6b2d(0x22b)](){const _0x41ed03=_0x5e6b2d;if(this[_0x41ed03(0x21e)]!==void 0x0||this['_reconnectAttempts']>=0x3){this['_reconnectAttempts']>=0x3&&(this[_0x41ed03(0x2f9)]=_0x41ed03(0x1b3));return;}let _0x1573df=Math['min'](0x3e8*0x2**this[_0x41ed03(0x238)],0x4e20);this[_0x41ed03(0x238)]+=0x1,this['_reconnectTimer']=setTimeout(()=>{const _0x5d734d=_0x41ed03;this[_0x5d734d(0x21e)]=void 0x0,this[_0x5d734d(0x25e)]??=this[_0x5d734d(0x2cb)](),this[_0x5d734d(0x25e)][_0x5d734d(0x2fa)](()=>this['_scheduleReconnect']())[_0x5d734d(0x203)](()=>{const _0x1d31d3=_0x5d734d;this[_0x1d31d3(0x25e)]=void 0x0;});},_0x1573df);}['_startHeartbeat'](){const _0x4be435=_0x5e6b2d;this['_stopHeartbeat'](),this[_0x4be435(0x268)]=setInterval(()=>{const _0xd9f780=_0x4be435;this[_0xd9f780(0x2f9)]===_0xd9f780(0x2c4)&&this[_0xd9f780(0x262)](_0x53cd9f[_0xd9f780(0x327)],'',{'cmd':_0x53cd9f['HEARTBEAT'],'routeKey':''})['catch'](()=>this[_0xd9f780(0x1c1)]?.[_0xd9f780(0x252)](0x3f3,_0xd9f780(0x1f4)));},0x7530);}[_0x5e6b2d(0x2cd)](){const _0x3e014b=_0x5e6b2d;this[_0x3e014b(0x268)]!==void 0x0&&clearInterval(this[_0x3e014b(0x268)]),this['_heartbeat']=void 0x0;}['_failCommandWaiters'](_0x263616){const _0x8bca22=_0x5e6b2d;for(let _0x58ab22 of this['_commandWaiters']['values']())clearTimeout(_0x58ab22[_0x8bca22(0x226)]),_0x58ab22['reject'](_0x263616);this[_0x8bca22(0x260)][_0x8bca22(0x20c)]();}};function Oe(_0x3c7982){return new Promise((_0x5b6e82,_0x5b84fb)=>{const _0x410072=_0x67e3;let _0x30adc0=()=>{const _0x125860=_0x67e3;clearTimeout(_0x2e8a63),_0x3c7982['removeEventListener']('close',_0x110a5b),_0x3c7982[_0x125860(0x1fd)](_0x125860(0x1f8),_0x559a24),_0x3c7982[_0x125860(0x1fd)](_0x125860(0x220),_0x2ec262);},_0x49229f=_0x5a940a=>{_0x30adc0(),_0x5b84fb(new j('COLLABORATION_UNAVAILABLE',_0x5a940a,{'retryable':!0x0}));},_0x110a5b=()=>_0x49229f('Collaboration\x20WebSocket\x20closed\x20before\x20opening'),_0x559a24=()=>_0x49229f(_0x410072(0x21a)),_0x2ec262=()=>{_0x30adc0(),_0x5b6e82();},_0x2e8a63=setTimeout(()=>{const _0x5daefa=_0x410072;_0x49229f(_0x5daefa(0x22e)),_0x3c7982[_0x5daefa(0x252)](0x3e8,_0x5daefa(0x2a3));},0x7530);_0x3c7982[_0x410072(0x265)]('close',_0x110a5b,{'once':!0x0}),_0x3c7982[_0x410072(0x265)](_0x410072(0x1f8),_0x559a24,{'once':!0x0}),_0x3c7982['addEventListener']('open',_0x2ec262,{'once':!0x0});});}function ke(_0xcd3372){const _0x42ebbe=_0x5e6b2d;if(!_0xcd3372||typeof _0xcd3372!=_0x42ebbe(0x23f))return null;let _0x2a5a36=_0xcd3372['cs'];return _0x2a5a36&&typeof _0x2a5a36==_0x42ebbe(0x23f)?_0x2a5a36:null;}function Q(_0x57d2c7,_0x118998){return(_0x57d2c7??'')+':'+(_0x118998??0x0);}var Ae=class{[_0x5e6b2d(0x1c5)];['_connection'];constructor(_0x49f00b){const _0x35e099=_0x5e6b2d;this[_0x35e099(0x1c5)]=je(_0x49f00b),this[_0x35e099(0x1d1)]=new De(this[_0x35e099(0x1c5)]);}async[_0x5e6b2d(0x220)](_0x19abd3){const _0x4e65a6=_0x5e6b2d;let _0x267390=await this[_0x4e65a6(0x1d1)][_0x4e65a6(0x2b3)](_0x19abd3);return new we(this['_config'],_0x19abd3,_0x267390);}};function je(_0x267911){const _0x2df132=_0x5e6b2d;let _0x44bf35=$(_0x267911[_0x2df132(0x2d4)],'snapshotServerUrl',[_0x2df132(0x2f0),'https:']),_0x407079=$(_0x267911['collabSubmitChangesetUrl'],_0x2df132(0x308),['http:','https:']),_0x27d5cf=$(_0x267911[_0x2df132(0x2f7)],_0x2df132(0x2f7),[_0x2df132(0x2c0),'wss:',_0x2df132(0x2f0),_0x2df132(0x221)]);_0x27d5cf[_0x2df132(0x21f)]==='http:'&&(_0x27d5cf[_0x2df132(0x21f)]=_0x2df132(0x2c0)),_0x27d5cf['protocol']==='https:'&&(_0x27d5cf[_0x2df132(0x21f)]=_0x2df132(0x250));let _0x28bbcf=$(_0x267911[_0x2df132(0x1c9)],_0x2df132(0x1c9),[_0x2df132(0x2f0),_0x2df132(0x221)]),_0x5f4aac=_0x267911[_0x2df132(0x1fe)]??0x7530;if(!Number['isSafeInteger'](_0x5f4aac)||_0x5f4aac<=0x0)throw new j(_0x2df132(0x2bf),'commitTimeoutMs\x20must\x20be\x20a\x20positive\x20safe\x20integer');return{'collabSubmitChangesetUrl':_0x407079,'collabWebSocketUrl':_0x27d5cf,'commitTimeoutMs':_0x5f4aac,'httpRequest':_0x267911[_0x2df132(0x270)]??globalThis[_0x2df132(0x27e)]['bind'](globalThis),'snapshotServerUrl':_0x44bf35,'wsSessionTicketUrl':_0x28bbcf};}function $(_0x585c39,_0x3eef5f,_0x1d55cd){const _0x4da14f=_0x5e6b2d;let _0x189c1f;try{_0x189c1f=new URL(_0x585c39);}catch{throw new j(_0x4da14f(0x2bf),_0x3eef5f+'\x20must\x20be\x20an\x20absolute\x20URL');}if(!_0x1d55cd[_0x4da14f(0x2a1)](_0x189c1f[_0x4da14f(0x21f)]))throw new j(_0x4da14f(0x2bf),_0x3eef5f+_0x4da14f(0x1ba));return _0x189c1f;}function Me(_0x3b8e3f){return new Ae(_0x3b8e3f);}export{j as CollaborationRuntimeError,Me as createCollaborationServerAdapter,ve as createUniverCollaborationRuntimeFactory};
1
+ const _0x28a351=_0x2b76;(function(_0x2ad9db,_0x1f1a92){const _0x2f2ee3=_0x2b76,_0x46b724=_0x2ad9db();while(!![]){try{const _0x28f08c=-parseInt(_0x2f2ee3(0x266))/0x1+parseInt(_0x2f2ee3(0x265))/0x2+parseInt(_0x2f2ee3(0x2c4))/0x3*(-parseInt(_0x2f2ee3(0x237))/0x4)+-parseInt(_0x2f2ee3(0x337))/0x5+parseInt(_0x2f2ee3(0x2cc))/0x6*(-parseInt(_0x2f2ee3(0x345))/0x7)+-parseInt(_0x2f2ee3(0x2e6))/0x8*(parseInt(_0x2f2ee3(0x284))/0x9)+-parseInt(_0x2f2ee3(0x1ff))/0xa*(-parseInt(_0x2f2ee3(0x249))/0xb);if(_0x28f08c===_0x1f1a92)break;else _0x46b724['push'](_0x46b724['shift']());}catch(_0x385133){_0x46b724['push'](_0x46b724['shift']());}}}(_0x2e3a,0x958dd));import{CommandType as _0x56c714,DependentOn as _0x47e19f,ICommandService as _0x24a215,IUniverInstanceService as _0x4f82f9,Inject as _0x407b4d,Injector as _0x419b26,Plugin as _0x45c71a,UniverInstanceType as _0x27cc9f,registerDependencies as _0x9caa23,sequenceExecute as _0x2648cd,toDisposable as _0x1752eb}from'@univerjs/core';function _0x2e3a(){const _0x5e2b40=['1010201qfgxMU','_closeAfterFatalError','formula.mutation.set-trigger-formula-calculation-stop','readyState','permission','save','_scheduleReconnect','splice','protocol','_setTransformConflict','OPEN','closed','Collaboration\x20WebSocket\x20is\x20not\x20online','type','COLLABORATION_INVALID_INPUT','permission-denied','collaMsg','RECV','suppress','latestRevision','m2Prime','UNIVER_SLIDE','_awaiting','mutations','acceptedChangeset','status','Snapshot\x20revision\x20must\x20be\x20a\x20positive\x20safe\x20integer','has','Collaboration\x20HELLO\x20response\x20is\x20invalid','randomUUID','45BGSuwq','dispose','pathname','UNIVER_BOARD','takeInboundChangesets','_tail','awaiting-ack','up-to-date','\x20cannot\x20capture\x20mutation\x20','cmd','online','_ensureConnected','createPresentation','unknown','univerAPI','COLLABORATION_CLOSED','onMutationExecutedForCollab','Collaboration\x20runtime\x20result\x20must\x20be\x20JSON-compatible','snapshotServerService','Changeset\x20submission\x20was\x20rejected','reject','searchParams','min','_nextReqId','slice','getBoard','memberId','open','application/json','Session\x20ticket\x20request\x20failed\x20with\x20HTTP\x20','_socket','pending','permission_rej','isArray','_capture','index','board','fetchThroughInterceptors','formula.mutation.set-calculation-result','wsSessionTicketUrl','Event','changesets','\x20cannot\x20call\x20','Buffered\x20changeset\x20does\x20not\x20match\x20the\x20canonical\x20preceding\x20changeset','_suppressionDepth','findIndex','ticket','promise','Failed\x20to\x20transform\x20the\x20Unit\x20snapshot','subscribe','length','leases','ack','kind','http:','_injector','registerPlugin','POST','createDocument','changeset_should_retry','values','_connect','Awaiting\x20changeset\x20echo\x20does\x20not\x20follow\x20the\x20current\x20revision','_joined','387eNieAN','MUTATION','catch','_waitForSubmission','result','workbook','data','snapshotServerUrl','6hicmZd','_connection','snapshot','_replayRemoteChangesets','createBase','_config','prependPending','\x20returned\x20a\x20different\x20block\x20identity','revisionService','Failed\x20to\x20establish\x20Collaboration\x20WebSocket','permission-rejected','maxCodeLength','pull','read','compressMutationService','Historical\x20restore\x20requires\x20reloading\x20the\x20Unit\x20and\x20cannot\x20be\x20replayed\x20in\x20place','fetchmissing','entries','formula.mutation.set-formula-data','formula.mutation.set-trigger-formula-calculation-start','return\x20(async\x20()\x20=>\x20{\x20','object','write','some','createBoard','routeKey','1262264frYPwe','unit','backend','incrementRevOfUnit','reconnecting','prototype','sort','maxCodeLength\x20must\x20be\x20a\x20positive\x20safe\x20integer','getDocument','Historical\x20restore\x20requires\x20reloading\x20the\x20Unit\x20and\x20cannot\x20be\x20pulled\x20in\x20place','target','blockMeta','unsubscribe','COMPRESS_MUTATION_SEND','fetchChangesets','json','rejected','close','unitData','_state','unchanged','commitTimeoutMs','_closeOwnedResources','_reconnectTimer','_baseRevision','_closePromise','ws:','Awaiting\x20changeset\x20echo\x20does\x20not\x20match\x20the\x20transformed\x20local\x20mutations','Snapshot\x20Unit\x20identity\x20does\x20not\x20match\x20the\x20requested\x20Unit','_validateAcceptedChangeset','_join','createUnit','_requestCommand','_startHeartbeat','sheet.mutation.send-init-pivot-text-local','UNIVER_CLI_SDK_MANUAL_COLLABORATION_PLUGIN','docStateChange$','Single-Unit\x20runtime\x20for\x20','string','UNIVER_DOC','changeset_rej','_executor','Collaboration\x20WebSocket\x20closed','Backend\x20returned\x20a\x20non-contiguous\x20changeset\x20range','Failed\x20to\x20rejoin\x20Unit\x20room','HELLO','UNIVER_BASE','takePending','csAckEvent','offline','find','Failed\x20to\x20join\x20Unit\x20room','_captureCommandMutation','_closed','Unit\x20','Timed\x20out\x20waiting\x20for\x20Collaboration\x20command\x20','collabSubmitChangesetUrl','newCsEvent','_bufferedChangesets','originalMeta','COMPRESS_MUTATION_APPLY','onlyLocal','LEAVE','interceptor','stringify','clear','_unitId','Unsupported\x20collaboration\x20Unit\x20type:\x20','nothing-to-commit','error','SnapshotService\x20is\x20not\x20ready\x20until\x20the\x20Univer\x20factory\x20has\x20returned','redoState','unit-data','_release','execute','transform-failed','rev','sid','fetch','pull-required','injector','5490055cDXqCK','conflict','COLLABORATION_PROTOCOL_ERROR','_target','Univer\x20revision\x20did\x20not\x20advance\x20to\x20the\x20confirmed\x20changeset\x20revision','COLLABORATION_LOAD_FAILED','includes','acquire','exportUnitData','_subscribeToDocumentState','getBase','delete','createWorkbook','Session\x20ticket\x20response\x20is\x20missing\x20a\x20ticket','6742582HaQQdo','Runtime\x20for\x20','reqId','onStarting','addEventListener','BeforeCommandExecute','new_changes','isSafeInteger','UNIVER_SHEET','_operations','GET','run','_createAwaitingFromPending','Cannot\x20replace\x20mutations\x20after\x20a\x20changeset\x20is\x20awaiting\x20confirmation','eventID','changeset-rejected','_consumeBufferedPrecedingChangesets','isFinite','JOIN','_commandWaiters','confirmed','getState','size','_handleCollaborationEvent','memberID','unitId','m1Prime','COMMAND','snapshotFrom','_lease','transformService','commitTimeoutMs\x20must\x20be\x20a\x20positive\x20safe\x20integer','Collaboration\x20HTTP\x20request\x20failed\x20with\x20status\x20','map','actions','_sid','https:','Historical\x20restore\x20requires\x20reloading\x20the\x20Unit\x20and\x20is\x20not\x20supported\x20by\x20this\x20runtime','sheets','timer','\x20after\x20the\x20collaboration\x20runtime\x20entered\x20conflict','Collaboration\x20WebSocket\x20closed\x20before\x20opening','\x20})();','_handle','_univer','transformMutations','invalid','replace','Backend\x20changesets\x20must\x20be\x20an\x20array','get','Collaboration\x20HTTP\x20request\x20failed','awaitingMutations','10GMvvXK','block','then','unitID','remote','HEARTBEAT','removeEventListener','collabWebSocketUrl','all','resolve','send','boolean','infoRsp','Backend\x20latest\x20revision\x20does\x20not\x20match\x20its\x20continuous\x20changeset\x20range','getPrototypeOf','changeset','_stopHeartbeat','_inbound','commandId','submitChangeset','Sheet-shaped\x20snapshot\x20is\x20missing\x20workbook\x20metadata','unitType','COLLABORATION_UNAVAILABLE','instanceService','changeset_ack','race','_kernel','Code\x20is\x20longer\x20than\x20the\x20','\x20for\x20Unit\x20','revision','Confirmed\x20mutation\x20replay\x20failed\x20at\x20index\x20','disposeUnit','_pending','The\x20same\x20Unit\x20id\x20cannot\x20be\x20joined\x20with\x20two\x20Unit\x20types','timeout','_submissionWaiters','ensureOnline','format','replacePending','_handleMessage','trim','retry','getPresentation','baseRev','_reconcilePrecedingChangesets','push','getConnectionState','Backend\x20returned\x20no\x20Unit\x20snapshot','_disposables','_fetchChangesets','_conflict','\x20character\x20limit','ACK\x20revision\x20does\x20not\x20follow\x20the\x20applied\x20confirmed\x20revision','_heartbeat','replacePendingMutations','code','23496IsiThq','sessionTicket','message','new_changesets','unshift','csRejEvent','Changeset\x20submission\x20was\x20denied','from','_assertMutableState','getInterceptPoints','httpRequest','parse','Confirmed\x20changeset\x20history\x20is\x20not\x20contiguous','mode','_knownHeadRevision','Failed\x20to\x20fetch\x20preceding\x20changesets','\x20request\x20is\x20already\x20active\x20for\x20','reason','51723001abtrtH','cancel','retryable','add','_reconnectAttempts','Backend\x20failed\x20to\x20load\x20the\x20Unit\x20snapshot','set','fromEntries','Backend\x20failed\x20to\x20close\x20the\x20initial\x20revision\x20gap','\x20is\x20unavailable','addEvent','bind','number','Checkpoint\x20revision\x20must\x20be\x20a\x20positive\x20safe\x20integer','Connection\x20timed\x20out','createUniver','commandService','fetched','_rejectIfNotAccepting','_memberId','precedingChangesets','commit','Snapshot\x20block\x20','invalid-revision','Failed\x20to\x20create\x20the\x20collaboration\x20runtime','wss:','No\x20active\x20Unit\x20leases','_connectPromise','1057162blCWKk'];_0x2e3a=function(){return _0x5e2b40;};return _0x2e3a();}import{CompressMutationService as _0x45cd35,ISnapshotServerService as _0x2114fe,ITransformService as _0x309abf,RevertRevisionMutation as _0x4d191d,RevisionService as _0x56a7c3,SnapshotService as _0x3e3e5b,UniverCollaborationPlugin as _0x91edc2,isTransformMutationsSuccess as _0x74ccd6,parseChangesetToProtocol as _0x54e5d7,parseMutationToProtocol as _0x4dcbdd,parseProtocolChangeset as _0xeb2c40,transformSnapshotToBaseData as _0x16c6bc,transformSnapshotToBoardData as _0x641f7a,transformSnapshotToDocumentData as _0x6ffd28,transformSnapshotToSlideData as _0x1ce93e,transformSnapshotToWorkbookData as _0x25d93a}from'@univerjs-pro/collaboration';import{FormulaCalculationSessionService as _0x3c1c2d}from'@univerjs/engine-formula';import{CmdRspCode as _0x90bf3a,CombCmd as _0x9b7859,isError as _0x1d0608}from'@univerjs/protocol';import{PersistFormulaLastValuesCommand as _0x564f99}from'@univerjs-pro/engine-formula';import{DocStateChangeManagerService as _0x27b5b6,RichTextEditingMutation as _0x21e09d}from'@univerjs/docs';import{IRenderManagerService as _0x12089b}from'@univerjs/engine-render';import{FUniver as _0x264464}from'@univerjs/core/facade';import'@univerjs-pro/bases/facade';import'@univerjs-pro/boards/facade';import'@univerjs-pro/slides/facade';import'@univerjs/docs/facade';import'@univerjs/sheets/facade';import _0x45e199 from'@oxc-project/runtime/helpers/decorateParam';import _0x5bf473 from'@oxc-project/runtime/helpers/decorate';function _0x2b76(_0x1112d3,_0x30c2cc){_0x1112d3=_0x1112d3-0x1f2;const _0x2e3ab5=_0x2e3a();let _0x2b760f=_0x2e3ab5[_0x1112d3];return _0x2b760f;}var j=class extends Error{[_0x28a351(0x236)];[_0x28a351(0x24b)];constructor(_0x407ec0,_0x2da8be,_0x183878={}){const _0x214b03=_0x28a351;super(_0x2da8be,_0x183878),this['name']='CollaborationRuntimeError',this['code']=_0x407ec0,this[_0x214b03(0x24b)]=_0x183878['retryable']??!0x1;}},se=class{[_0x28a351(0x219)];[_0x28a351(0x328)];[_0x28a351(0x21f)]=[];[_0x28a351(0x22f)]=[];[_0x28a351(0x2b0)]=0x0;constructor(_0x4a8f4b,_0x334e1f,_0x274cb1){const _0x32ddf3=_0x28a351;this['_kernel']=_0x4a8f4b,this[_0x32ddf3(0x328)]=_0x334e1f,this[_0x32ddf3(0x22f)][_0x32ddf3(0x22c)](_0x4a8f4b[_0x32ddf3(0x259)][_0x32ddf3(0x294)]((_0x4f1fd3,_0x767716)=>{const _0x55fae2=_0x32ddf3;this[_0x55fae2(0x31a)](_0x4f1fd3,_0x767716,_0x274cb1);})),_0x274cb1===_0x27cc9f[_0x32ddf3(0x30d)]&&(_0x4a8f4b[_0x32ddf3(0x336)][_0x32ddf3(0x1fc)](_0x12089b),this[_0x32ddf3(0x340)]());}get['pending'](){const _0x52d10c=_0x28a351;return this[_0x52d10c(0x21f)];}[_0x28a351(0x361)](_0x3d53e9){const _0x3d69ca=_0x28a351;return this[_0x3d69ca(0x21f)]['slice'](_0x3d53e9);}[_0x28a351(0x225)](_0x46d258){const _0x4f1af2=_0x28a351;this['_pending']['splice'](0x0,this[_0x4f1af2(0x21f)][_0x4f1af2(0x2b6)],..._0x46d258);}[_0x28a351(0x315)](){const _0x1db120=_0x28a351;return this['_pending'][_0x1db120(0x26d)](0x0);}['prependPending'](_0x362002){const _0x4fac40=_0x28a351;this[_0x4fac40(0x21f)][_0x4fac40(0x23b)](..._0x362002);}async[_0x28a351(0x278)](_0x47b19e){const _0x10f312=_0x28a351;this[_0x10f312(0x2b0)]+=0x1;try{return await _0x47b19e();}finally{--this[_0x10f312(0x2b0)];}}[_0x28a351(0x285)](){const _0x50272f=_0x28a351;for(let _0x17bfb4 of this[_0x50272f(0x22f)]['splice'](0x0))_0x17bfb4[_0x50272f(0x285)]();}['_captureCommandMutation'](_0x368e2b,_0xcc3c51,_0x45e06c){const _0x115f06=_0x28a351;if(this[_0x115f06(0x2b0)]>0x0||_0x368e2b[_0x115f06(0x273)]!==_0x56c714[_0x115f06(0x2c5)]||_0xcc3c51?.['fromCollab']||_0xcc3c51?.['fromChangeset']||_0xcc3c51?.[_0x115f06(0x323)])return;let _0x39df56=_0x368e2b['params'];if(_0x39df56?.[_0x115f06(0x35e)]!==void 0x0&&_0x39df56[_0x115f06(0x35e)]!==this[_0x115f06(0x328)]){if(_0x39df56['trigger']===_0x564f99['id'])return;throw new j('COLLABORATION_INVALID_INPUT',_0x115f06(0x346)+this[_0x115f06(0x328)]+_0x115f06(0x28c)+_0x368e2b['id']+_0x115f06(0x21b)+String(_0x39df56['unitId']));}if(_0x39df56?.[_0x115f06(0x35e)]===void 0x0||_0x45e06c===_0x27cc9f[_0x115f06(0x30d)]&&_0x368e2b['id']===_0x21e09d['id'])return;if(_0x368e2b['id']===_0x4d191d['id'])throw new j('COLLABORATION_INVALID_INPUT',_0x115f06(0x36a));let _0x3b9076=_0x368e2b,_0x2fafd8=this[_0x115f06(0x219)][_0x115f06(0x2da)][_0x115f06(0x325)][_0x115f06(0x240)]()[_0x115f06(0x2f3)],_0x1328aa=(this[_0x115f06(0x219)][_0x115f06(0x2da)][_0x115f06(0x325)]['fetchThroughInterceptors'](_0x2fafd8)([_0x3b9076],this[_0x115f06(0x219)][_0x115f06(0x216)])??[_0x3b9076])[0x0];_0x1328aa&&this[_0x115f06(0x21f)]['push'](_0x4dcbdd(_0x1328aa));}[_0x28a351(0x340)](){const _0x105ff3=_0x28a351;let _0x12a6e5=this[_0x105ff3(0x219)][_0x105ff3(0x336)][_0x105ff3(0x1fc)](_0x27b5b6)[_0x105ff3(0x30a)][_0x105ff3(0x2b5)](_0x4d8aa4=>{const _0x2ae199=_0x105ff3;if(this['_suppressionDepth']>0x0||_0x4d8aa4?.[_0x2ae199(0x35e)]!==this[_0x2ae199(0x328)])return;let _0x40644c={'id':_0x4d8aa4[_0x2ae199(0x211)],'params':{'actions':_0x4d8aa4[_0x2ae199(0x32d)][_0x2ae199(0x367)],'textRanges':null,'unitId':_0x4d8aa4[_0x2ae199(0x35e)]},'type':_0x56c714[_0x2ae199(0x2c5)]};this[_0x2ae199(0x21f)]['push'](_0x4dcbdd(_0x40644c));});this[_0x105ff3(0x22f)][_0x105ff3(0x22c)](_0x1752eb(()=>_0x12a6e5[_0x105ff3(0x2f2)]()));}},ce=new Set([_0x28a351(0x2df),_0x28a351(0x268),'formula.mutation.set-trigger-formula-calculation',_0x28a351(0x2aa),'formula.mutation.set-array-formula-data',_0x28a351(0x2de),_0x28a351(0x308)]),le=new Set([_0x28a351(0x2d0),_0x28a351(0x2e4),_0x28a351(0x343),_0x28a351(0x2be),_0x28a351(0x290),'createUniverSheet',_0x28a351(0x21e)]);function ue(_0x1915e7,_0x42067e,_0x43b00e){let _0x4abcf7=_0x264464['newAPI'](_0x1915e7);return{async 'execute'(_0x16077e,_0x3e1105){const _0x4f3531=_0x2b76;if(_0x16077e[_0x4f3531(0x2b6)]>_0x43b00e)throw new j(_0x4f3531(0x274),_0x4f3531(0x21a)+_0x43b00e+_0x4f3531(0x232));let _0xec9be3=_0x3e1105===_0x4f3531(0x2d9)?M(_0x4abcf7):void 0x0,_0x51a4a4=de(_0x4abcf7,_0x42067e);try{return await Function(_0x4f3531(0x292),_0x4f3531(0x2e0)+_0x16077e+_0x4f3531(0x1f5))(_0x51a4a4);}finally{_0xec9be3?.[_0x4f3531(0x285)]();}}};}function de(_0x268c0b,_0x37dd51){return new Proxy(_0x268c0b,{'get'(_0x4438f1,_0xaead89,_0x58aa86){const _0x3d84e8=_0x2b76;return le[_0x3d84e8(0x281)](_0xaead89)?()=>{const _0x5c8314=_0x3d84e8;throw new j('COLLABORATION_INVALID_INPUT',_0x5c8314(0x30b)+_0x37dd51+_0x5c8314(0x2ae)+String(_0xaead89));}:Reflect[_0x3d84e8(0x1fc)](_0x4438f1,_0xaead89,_0x58aa86);}});}function M(_0x1c08a6){const _0x22d95e=_0x28a351;return _0x1c08a6[_0x22d95e(0x253)](_0x1c08a6[_0x22d95e(0x2ac)][_0x22d95e(0x34a)],_0x1b88a0=>{const _0xe6e842=_0x22d95e;let _0x104d91=_0x1b88a0;if(N(_0x104d91))throw _0x104d91[_0xe6e842(0x24a)]=!0x0,new j('COLLABORATION_INVALID_INPUT','Read\x20execution\x20cannot\x20run\x20persistable\x20action\x20'+_0x104d91['id']);});}function N(_0x5452af){const _0x1449dc=_0x28a351;return _0x5452af['type']===_0x56c714[_0x1449dc(0x360)]||_0x5452af['type']===_0x56c714[_0x1449dc(0x2c5)]&&!ce[_0x1449dc(0x281)](_0x5452af['id']);}function P(_0xac4d7c){const _0x1a5a25=_0x28a351;if(_0xac4d7c===void 0x0)return null;if(_0xac4d7c===null||typeof _0xac4d7c==_0x1a5a25(0x20a)||typeof _0xac4d7c==_0x1a5a25(0x30c))return _0xac4d7c;if(typeof _0xac4d7c==_0x1a5a25(0x255)){if(Number[_0x1a5a25(0x356)](_0xac4d7c))return _0xac4d7c;throw I();}if(Array[_0x1a5a25(0x2a5)](_0xac4d7c))return _0xac4d7c[_0x1a5a25(0x366)](P);if(F(_0xac4d7c))return Object[_0x1a5a25(0x250)](Object[_0x1a5a25(0x2dd)](_0xac4d7c)['map'](([_0x57b0cd,_0x43d133])=>[_0x57b0cd,P(_0x43d133)]));throw I();}function F(_0x354545){const _0x18bcb8=_0x28a351;if(typeof _0x354545!=_0x18bcb8(0x2e1)||!_0x354545)return!0x1;let _0x2708b3=Object[_0x18bcb8(0x20d)](_0x354545);return _0x2708b3===Object[_0x18bcb8(0x2eb)]||_0x2708b3===null;}function I(){const _0x5172ee=_0x28a351;return new j(_0x5172ee(0x274),_0x5172ee(0x295));}var L=class{[_0x28a351(0x289)]=Promise[_0x28a351(0x208)]();[_0x28a351(0x350)](_0x2f9385){const _0x346e99=_0x28a351;let _0x113bc6=this['_tail'][_0x346e99(0x201)](_0x2f9385,_0x2f9385);return this[_0x346e99(0x289)]=_0x113bc6[_0x346e99(0x201)](()=>void 0x0,()=>void 0x0),_0x113bc6;}};function R(_0x1cb8e0,_0x4f5031,_0x1b1f15,_0x3610a8){const _0x68132f=_0x28a351;if(!Array[_0x68132f(0x2a5)](_0x1cb8e0))throw new j('COLLABORATION_PROTOCOL_ERROR',_0x68132f(0x1fb));let _0x3f21d5=[..._0x1cb8e0][_0x68132f(0x2ec)]((_0x2ccca9,_0x419e5a)=>_0x2ccca9[_0x68132f(0x21c)]-_0x419e5a[_0x68132f(0x21c)]),_0x4a7bc7=_0x3610a8;for(let _0x5567a5 of _0x3f21d5){if(!_0x5567a5||typeof _0x5567a5!=_0x68132f(0x2e1)||!Array[_0x68132f(0x2a5)](_0x5567a5[_0x68132f(0x27d)])||_0x5567a5[_0x68132f(0x27d)]['some'](_0x5cbbe7=>!_0x5cbbe7||typeof _0x5cbbe7!=_0x68132f(0x2e1)||!('id'in _0x5cbbe7)||typeof _0x5cbbe7['id']!=_0x68132f(0x30c)||!('data'in _0x5cbbe7)||typeof _0x5cbbe7[_0x68132f(0x2ca)]!=_0x68132f(0x30c))||!Number[_0x68132f(0x34c)](_0x5567a5[_0x68132f(0x22a)])||!Number[_0x68132f(0x34c)](_0x5567a5[_0x68132f(0x21c)])||_0x5567a5[_0x68132f(0x202)]!==_0x4f5031||_0x5567a5['type']!==_0x1b1f15||_0x5567a5['baseRev']!==_0x4a7bc7||_0x5567a5['revision']!==_0x4a7bc7+0x1)throw new j(_0x68132f(0x339),_0x68132f(0x311));_0x4a7bc7=_0x5567a5[_0x68132f(0x21c)];}return _0x3f21d5;}function z(_0x4a608a){const _0x4236eb=_0x28a351;return{'baseRevision':_0x4a608a[_0x4236eb(0x22a)],'mutationCount':_0x4a608a[_0x4236eb(0x27d)][_0x4236eb(0x2b6)],'revision':_0x4a608a[_0x4236eb(0x21c)],..._0x4a608a[_0x4236eb(0x333)]===void 0x0?{}:{'sid':_0x4a608a[_0x4236eb(0x333)]},..._0x4a608a[_0x4236eb(0x347)]===void 0x0?{}:{'reqId':_0x4a608a[_0x4236eb(0x347)]}};}function B(_0x395568,_0x336574,_0x20b82c,_0x428633,_0x583445,_0x340c29='initial'){const _0x3b505c=_0x28a351;if(_0x583445[_0x3b505c(0x2e3)](_0x40cb7c=>_0x40cb7c[_0x3b505c(0x27d)]['some'](_0x2a8d81=>_0x2a8d81['id']===_0x4d191d['id'])))throw new j('COLLABORATION_PROTOCOL_ERROR',_0x3b505c(0x2db));let _0xf0b43e=_0x428633;for(let _0x23a24f of _0x583445){let _0xfdbcd0=_0xf0b43e+0x1;if(_0x23a24f['unitID']!==_0x336574||_0x23a24f['type']!==_0x20b82c||_0x23a24f['baseRev']!==_0xf0b43e||_0x23a24f['revision']!==_0xfdbcd0)throw new j(_0x3b505c(0x339),_0x3b505c(0x243));let _0x3dd3e4=_0xeb2c40(_0x23a24f),_0x52a5e5=_0x395568['compressMutationService'][_0x3b505c(0x325)][_0x3b505c(0x240)]()[_0x3b505c(0x322)],_0x4caeef=_0x395568[_0x3b505c(0x2da)][_0x3b505c(0x325)][_0x3b505c(0x2a9)](_0x52a5e5)(_0x3dd3e4['mutations'],null)??_0x3dd3e4['mutations'],_0xfd54f0=_0x2648cd(_0x4caeef,_0x395568[_0x3b505c(0x259)],_0x340c29==='initial'?{'fromChangeset':!0x0}:{'fromCollab':!0x0});if(!_0xfd54f0[_0x3b505c(0x2c8)])throw new j(_0x3b505c(0x33c),_0x3b505c(0x21d)+_0xfd54f0[_0x3b505c(0x2a7)]+':\x20'+String(_0xfd54f0['error']));let _0x3e306c=_0x395568[_0x3b505c(0x2d4)]['incrementRevOfUnit'](_0x336574);if(_0x3e306c!==_0xfdbcd0)throw new j(_0x3b505c(0x339),_0x3b505c(0x33b));_0xf0b43e=_0x3e306c;}return _0xf0b43e;}function V(_0x5adeb2,_0x5e6682,_0x4bf1d9){const _0x25595d=_0x28a351;let _0x5a13e0=_0x264464['newAPI'](_0x5adeb2);switch(_0x4bf1d9){case _0x27cc9f[_0x25595d(0x34d)]:return H(_0x5a13e0['getWorkbook'](_0x5e6682)?.[_0x25595d(0x26b)](),_0x5e6682);case _0x27cc9f[_0x25595d(0x30d)]:return H(_0x5a13e0[_0x25595d(0x2ee)](_0x5e6682)?.[_0x25595d(0x26b)](),_0x5e6682);case _0x27cc9f['UNIVER_SLIDE']:return H(_0x5a13e0[_0x25595d(0x229)](_0x5e6682)?.[_0x25595d(0x26b)](),_0x5e6682);case _0x27cc9f[_0x25595d(0x314)]:return H(_0x5a13e0[_0x25595d(0x341)](_0x5e6682)?.[_0x25595d(0x26b)](),_0x5e6682);case _0x27cc9f[_0x25595d(0x287)]:return H(_0x5a13e0[_0x25595d(0x29d)](_0x5e6682)?.['save'](),_0x5e6682);default:throw new j(_0x25595d(0x274),_0x25595d(0x329)+_0x4bf1d9);}}function H(_0x2a263f,_0x3722ad){const _0x2bb8c5=_0x28a351;if(_0x2a263f===void 0x0)throw new j(_0x2bb8c5(0x33c),_0x2bb8c5(0x31c)+_0x3722ad+_0x2bb8c5(0x252));return structuredClone(_0x2a263f);}var fe=class{['unitId'];['unitType'];[_0x28a351(0x2fe)];[_0x28a351(0x1f6)];[_0x28a351(0x1f7)];[_0x28a351(0x219)];['_closePromise'];['_acceptingOperations']=!0x0;['_closed']=!0x1;[_0x28a351(0x2a6)];[_0x28a351(0x30f)];['_operations']=new L();[_0x28a351(0x320)]=[];['_knownHeadRevision'];[_0x28a351(0x231)]=null;['_awaiting']=null;[_0x28a351(0x368)]=crypto[_0x28a351(0x283)]();[_0x28a351(0x29b)]=0x1;constructor(_0x3e265a,_0x5d5ace,_0x358dd3,_0x1f263f,_0x3d5bc4,_0x514476,_0x1a5140){const _0x41ac87=_0x28a351;this[_0x41ac87(0x35e)]=_0x3e265a,this[_0x41ac87(0x214)]=_0x5d5ace,this['_baseRevision']=_0x358dd3,this['_handle']=_0x1f263f,this[_0x41ac87(0x1f7)]=_0x3d5bc4,this[_0x41ac87(0x219)]=_0x514476,this[_0x41ac87(0x245)]=_0x358dd3,this[_0x41ac87(0x2a6)]=new se(_0x514476,_0x3e265a,_0x5d5ace),this[_0x41ac87(0x30f)]=ue(_0x3d5bc4,_0x3e265a,_0x1a5140);}[_0x28a351(0x35a)](){const _0x422229=_0x28a351;return{'awaitingChangeset':this[_0x422229(0x27c)]===null?null:U(this[_0x422229(0x27c)]),'baseRevision':this[_0x422229(0x2fe)],'bufferedChangesetCount':this['_bufferedChangesets'][_0x422229(0x2b6)],'conflict':this[_0x422229(0x231)],'connection':this[_0x422229(0x31b)]?_0x422229(0x271):this['_handle'][_0x422229(0x22d)](),'knownHeadRevision':this['_knownHeadRevision'],'pendingMutationCount':this[_0x422229(0x2a6)]['pending'][_0x422229(0x2b6)]};}['getPendingMutations'](){const _0x3cfb81=_0x28a351;return structuredClone(this['_capture'][_0x3cfb81(0x2a3)]);}[_0x28a351(0x334)](){const _0x1175d8=_0x28a351;return this[_0x1175d8(0x25b)]()||this[_0x1175d8(0x34e)][_0x1175d8(0x350)](async()=>(this[_0x1175d8(0x23f)](_0x1175d8(0x334)),await this['_fetchChangesets']()));}['pull'](){const _0x47c47b=_0x28a351;return this[_0x47c47b(0x25b)]()||this[_0x47c47b(0x34e)][_0x47c47b(0x350)](async()=>{const _0x45d567=_0x47c47b;if(this[_0x45d567(0x23f)](_0x45d567(0x2d8)),await this[_0x45d567(0x230)](),this[_0x45d567(0x320)][_0x45d567(0x2b6)]===0x0)return{'state':this[_0x45d567(0x35a)](),'status':_0x45d567(0x28b)};let _0x24bba0=[...this[_0x45d567(0x320)]];if(_0x24bba0['some'](_0x337cd4=>_0x337cd4[_0x45d567(0x27d)][_0x45d567(0x2e3)](_0x941a5c=>_0x941a5c['id']===_0x4d191d['id'])))throw new j(_0x45d567(0x339),_0x45d567(0x2ef));let _0x267a96=this['_baseRevision'],_0x4fbefd=this[_0x45d567(0x27c)]?W(this[_0x45d567(0x27c)]['mutations'],this[_0x45d567(0x35e)],this[_0x45d567(0x214)],this['_baseRevision']):null,_0x51a6e6=_0xeb2c40({'baseRev':this[_0x45d567(0x2fe)],'memberID':'','mutations':[...this['_capture']['pending']],'revision':0x0,'type':this['unitType'],'unitID':this['unitId'],'userID':''})[_0x45d567(0x27d)],_0x1f61ac=[];for(let _0x247bad of _0x24bba0){let _0x2cb592=_0xeb2c40(_0x247bad);if(this[_0x45d567(0x27c)]!==null&&_0x247bad['sid']===this[_0x45d567(0x27c)][_0x45d567(0x333)]&&_0x247bad[_0x45d567(0x347)]===this[_0x45d567(0x27c)][_0x45d567(0x347)]){let _0x1792c3=(_0x4fbefd??[])[_0x45d567(0x366)](_0x4dcbdd);G(_0x247bad[_0x45d567(0x27d)],_0x1792c3)||await this['_closeAfterFatalError'](new j('COLLABORATION_PROTOCOL_ERROR',_0x45d567(0x301))),_0x1f61ac[_0x45d567(0x22c)]({'changeset':_0x247bad,'kind':_0x45d567(0x28a)}),_0x4fbefd=null;continue;}let _0x3bd524=_0x2cb592['mutations'];if(_0x4fbefd!==null){let _0x5397ac=this[_0x45d567(0x219)][_0x45d567(0x363)][_0x45d567(0x1f8)](_0x3bd524,_0x4fbefd,!0x1);if(!_0x74ccd6(_0x5397ac))return this[_0x45d567(0x231)]={'message':_0x5397ac[_0x45d567(0x32b)][_0x45d567(0x239)],'operation':'pull','reason':_0x45d567(0x331)},{'conflict':this['_conflict'],'state':this['getState'](),'status':_0x45d567(0x338)};_0x3bd524=_0x5397ac[_0x45d567(0x35f)],_0x4fbefd=_0x5397ac[_0x45d567(0x27a)];}let _0x2a85d3=this[_0x45d567(0x219)][_0x45d567(0x363)][_0x45d567(0x1f8)](_0x3bd524,_0x51a6e6,!0x1);if(!_0x74ccd6(_0x2a85d3))return this['_conflict']={'message':_0x2a85d3[_0x45d567(0x32b)][_0x45d567(0x239)],'operation':_0x45d567(0x2d8),'reason':_0x45d567(0x331)},{'conflict':this[_0x45d567(0x231)],'state':this[_0x45d567(0x35a)](),'status':'conflict'};_0x1f61ac['push']({'changeset':_0x54e5d7({..._0x2cb592,'mutations':_0x2a85d3['m1Prime']}),'kind':'remote'}),_0x51a6e6=_0x2a85d3['m2Prime'];}let _0x3443cb=_0x267a96;for(let _0x3a28a5 of _0x1f61ac){if(_0x3a28a5[_0x45d567(0x2b9)]==='awaiting-ack'){let _0x511c4f=this[_0x45d567(0x219)][_0x45d567(0x2d4)][_0x45d567(0x2e9)](this[_0x45d567(0x35e)]);_0x511c4f!==_0x3a28a5[_0x45d567(0x20e)][_0x45d567(0x21c)]&&await this[_0x45d567(0x267)](new j('COLLABORATION_PROTOCOL_ERROR',_0x45d567(0x2c2))),_0x3443cb=_0x511c4f;continue;}_0x3443cb=await this['_replayRemoteChangesets'](_0x3443cb,[_0x3a28a5[_0x45d567(0x20e)]]);}return this['_capture'][_0x45d567(0x225)](_0x51a6e6[_0x45d567(0x366)](_0x4dcbdd)),this[_0x45d567(0x27c)]!==null&&(this['_awaiting']=_0x4fbefd===null?null:{...this[_0x45d567(0x27c)],'baseRev':_0x3443cb,'mutations':_0x4fbefd[_0x45d567(0x366)](_0x4dcbdd)}),this[_0x45d567(0x2fe)]=_0x3443cb,this['_bufferedChangesets'][_0x45d567(0x26d)](0x0),{'appliedChangesets':_0x24bba0[_0x45d567(0x366)](z),'fromRevision':_0x267a96,'state':this[_0x45d567(0x35a)](),'status':'pulled','toRevision':_0x3443cb,'transformedPendingMutationCount':_0x51a6e6['length']};});}['commit'](){const _0x2b06f5=_0x28a351;return this[_0x2b06f5(0x25b)]()||this[_0x2b06f5(0x34e)]['run'](async()=>{const _0x42fd70=_0x2b06f5;this[_0x42fd70(0x23f)](_0x42fd70(0x25e));let _0x5d1868=[],_0x1c8e11=[];if(this[_0x42fd70(0x27c)]===null){if(this['_capture']['pending'][_0x42fd70(0x2b6)]===0x0)return{'state':this[_0x42fd70(0x35a)](),'status':_0x42fd70(0x32a)};if(await this[_0x42fd70(0x230)](),this['_bufferedChangesets']['length']>0x0)return{'baseRevision':this[_0x42fd70(0x2fe)],'confirmedChangesets':_0x5d1868,'knownHeadRevision':this[_0x42fd70(0x245)],'state':this[_0x42fd70(0x35a)](),'status':_0x42fd70(0x335)};this[_0x42fd70(0x351)]();}for(;this[_0x42fd70(0x27c)]!==null;){let _0x52b2c9=this[_0x42fd70(0x27c)],_0x167703;try{_0x167703=await this[_0x42fd70(0x1f6)][_0x42fd70(0x212)](_0x52b2c9);}catch{return{'changeset':U(_0x52b2c9),'confirmedChangesets':_0x5d1868,'state':this[_0x42fd70(0x35a)](),'status':'unknown'};}if(_0x167703[_0x42fd70(0x27f)]===_0x42fd70(0x228)||_0x167703[_0x42fd70(0x27f)]==='unknown')return{'changeset':U(_0x52b2c9),'confirmedChangesets':_0x5d1868,'state':this[_0x42fd70(0x35a)](),'status':_0x167703[_0x42fd70(0x27f)]};if(_0x167703[_0x42fd70(0x27f)]===_0x42fd70(0x2f6))return _0x167703['reason']===_0x42fd70(0x260)?(this['_capture'][_0x42fd70(0x2d2)](_0x52b2c9['mutations']),this[_0x42fd70(0x27c)]=null,await this['_fetchChangesets'](),{'baseRevision':this[_0x42fd70(0x2fe)],'confirmedChangesets':_0x5d1868,'knownHeadRevision':this[_0x42fd70(0x245)],'state':this[_0x42fd70(0x35a)](),'status':_0x42fd70(0x335)}):(this[_0x42fd70(0x231)]={'message':_0x167703[_0x42fd70(0x239)],'operation':_0x42fd70(0x25e),'reason':_0x167703['reason']===_0x42fd70(0x275)?_0x42fd70(0x2d6):_0x42fd70(0x354)},{'conflict':this[_0x42fd70(0x231)],'confirmedChangesets':_0x5d1868,'state':this[_0x42fd70(0x35a)](),'status':_0x42fd70(0x338)});let _0x40d47f=_0x167703[_0x42fd70(0x27e)];try{this[_0x42fd70(0x303)](_0x52b2c9,_0x167703[_0x42fd70(0x25d)],_0x40d47f);}catch(_0x251dd1){await this[_0x42fd70(0x267)](_0x251dd1);}let _0x2243c4=_0x52b2c9['mutations'];if(_0x167703[_0x42fd70(0x25d)][_0x42fd70(0x2b6)]>0x0){let _0x300fb1=await this[_0x42fd70(0x22b)](_0x52b2c9,_0x167703[_0x42fd70(0x25d)]);if(_0x300fb1===null)return{'conflict':this[_0x42fd70(0x231)],'confirmedChangesets':_0x5d1868,'state':this[_0x42fd70(0x35a)](),'status':_0x42fd70(0x338)};_0x2243c4=_0x300fb1[_0x42fd70(0x1fe)];try{this[_0x42fd70(0x355)](_0x167703['precedingChangesets']);}catch(_0x19872a){await this['_closeAfterFatalError'](_0x19872a);}_0x1c8e11[_0x42fd70(0x22c)](..._0x167703[_0x42fd70(0x25d)][_0x42fd70(0x366)](z));}G(_0x40d47f['mutations'],_0x2243c4)||await this['_closeAfterFatalError'](new j(_0x42fd70(0x339),'Backend\x20returned\x20an\x20ACK\x20whose\x20mutations\x20do\x20not\x20match\x20the\x20submitted\x20changeset'));let _0xb231fa=this[_0x42fd70(0x219)][_0x42fd70(0x2d4)]['incrementRevOfUnit'](this[_0x42fd70(0x35e)]);if(_0xb231fa!==_0x40d47f[_0x42fd70(0x21c)]&&await this['_closeAfterFatalError'](new j(_0x42fd70(0x339),_0x42fd70(0x233))),this[_0x42fd70(0x2fe)]=_0xb231fa,this[_0x42fd70(0x245)]=Math['max'](this[_0x42fd70(0x245)],_0xb231fa),this[_0x42fd70(0x27c)]=null,_0x5d1868[_0x42fd70(0x22c)](z(_0x40d47f)),this[_0x42fd70(0x2a6)][_0x42fd70(0x2a3)][_0x42fd70(0x2b6)]===0x0)break;this['_createAwaitingFromPending']();}return{'confirmedChangesets':_0x5d1868,'reconciledChangesets':_0x1c8e11,'state':this[_0x42fd70(0x35a)](),'status':'confirmed'};});}async['_fetchChangesets'](){const _0x2d2a16=_0x28a351;let _0x511128=this[_0x2d2a16(0x245)],_0x5bf891=await this[_0x2d2a16(0x1f6)][_0x2d2a16(0x2f4)](_0x511128,void 0x0);if(_0x1d0608(_0x5bf891['error'])){let _0x44dc50=_0x5bf891[_0x2d2a16(0x32b)];throw new j(_0x2d2a16(0x215),_0x44dc50?.[_0x2d2a16(0x239)]||'Backend\x20failed\x20to\x20fetch\x20changesets',{'retryable':!0x0});}let _0x2f17ac=R(_0x5bf891[_0x2d2a16(0x2ad)],this[_0x2d2a16(0x35e)],this[_0x2d2a16(0x214)],_0x511128),_0x4a101d=_0x2f17ac['at'](-0x1)?.['revision']??_0x511128;if(_0x5bf891[_0x2d2a16(0x279)]!==void 0x0&&_0x5bf891['latestRevision']!==_0x4a101d)throw new j(_0x2d2a16(0x339),_0x2d2a16(0x20c));return _0x2f17ac[_0x2d2a16(0x2b6)]===0x0?{'knownHeadRevision':this[_0x2d2a16(0x245)],'state':this[_0x2d2a16(0x35a)](),'status':_0x2d2a16(0x2fa)}:(this['_bufferedChangesets'][_0x2d2a16(0x22c)](..._0x2f17ac),this['_knownHeadRevision']=_0x4a101d,{'changesets':_0x2f17ac[_0x2d2a16(0x366)](z),'fromRevision':_0x511128,'state':this[_0x2d2a16(0x35a)](),'status':_0x2d2a16(0x25a),'toRevision':_0x4a101d});}[_0x28a351(0x351)](){const _0x11d735=_0x28a351;let _0x255a8b=this[_0x11d735(0x2a6)][_0x11d735(0x315)]();this[_0x11d735(0x27c)]={'baseRev':this[_0x11d735(0x2fe)],'mutations':_0x255a8b,'reqId':this[_0x11d735(0x29b)],'sid':this['_sid']},this[_0x11d735(0x29b)]+=0x1;}[_0x28a351(0x303)](_0x28bbed,_0x2c16ff,_0x22c075){const _0x16861d=_0x28a351;let _0x15f185=R(_0x2c16ff,this[_0x16861d(0x35e)],this[_0x16861d(0x214)],this[_0x16861d(0x2fe)])['at'](-0x1)?.[_0x16861d(0x21c)]??this['_baseRevision'];if(_0x22c075[_0x16861d(0x202)]!==this[_0x16861d(0x35e)]||_0x22c075[_0x16861d(0x273)]!==this[_0x16861d(0x214)]||_0x22c075[_0x16861d(0x333)]!==_0x28bbed[_0x16861d(0x333)]||_0x22c075[_0x16861d(0x347)]!==_0x28bbed[_0x16861d(0x347)]||_0x22c075[_0x16861d(0x22a)]!==_0x15f185||_0x22c075[_0x16861d(0x21c)]!==_0x15f185+0x1)throw new j(_0x16861d(0x339),'Backend\x20returned\x20an\x20ACK\x20that\x20does\x20not\x20match\x20the\x20submitted\x20changeset');}async['_reconcilePrecedingChangesets'](_0x1f7a18,_0x2e683e){const _0x462844=_0x28a351;let _0x49bd9a=W(_0x1f7a18[_0x462844(0x27d)],this[_0x462844(0x35e)],this[_0x462844(0x214)],this[_0x462844(0x2fe)]),_0x8b8565=W(this[_0x462844(0x2a6)][_0x462844(0x2a3)],this[_0x462844(0x35e)],this[_0x462844(0x214)],this[_0x462844(0x2fe)]),_0xa56e9e=[];for(let _0x46eda8 of _0x2e683e){let _0x1787d7=_0xeb2c40(_0x46eda8),_0xabebbe=this[_0x462844(0x219)][_0x462844(0x363)][_0x462844(0x1f8)](_0x1787d7[_0x462844(0x27d)],_0x49bd9a,!0x1);if(!_0x74ccd6(_0xabebbe))return this[_0x462844(0x26f)](_0x462844(0x25e),_0xabebbe[_0x462844(0x32b)]),null;_0x49bd9a=_0xabebbe['m2Prime'];let _0x1223f6=this['_kernel'][_0x462844(0x363)][_0x462844(0x1f8)](_0xabebbe[_0x462844(0x35f)],_0x8b8565,!0x1);if(!_0x74ccd6(_0x1223f6))return this['_setTransformConflict'](_0x462844(0x25e),_0x1223f6['error']),null;_0x8b8565=_0x1223f6[_0x462844(0x27a)],_0xa56e9e['push'](_0x54e5d7({..._0x1787d7,'mutations':_0x1223f6[_0x462844(0x35f)]}));}let _0x57149a=await this['_replayRemoteChangesets'](this['_baseRevision'],_0xa56e9e);return this['_capture'][_0x462844(0x225)](_0x8b8565[_0x462844(0x366)](_0x4dcbdd)),this[_0x462844(0x2fe)]=_0x57149a,{'awaitingMutations':_0x49bd9a[_0x462844(0x366)](_0x4dcbdd),'revision':_0x57149a};}[_0x28a351(0x26f)](_0x40f67e,_0x2eb99b){const _0xcf3eda=_0x28a351;this[_0xcf3eda(0x231)]={'message':_0x2eb99b[_0xcf3eda(0x239)],'operation':_0x40f67e,'reason':_0xcf3eda(0x331)};}async[_0x28a351(0x2cf)](_0x143a39,_0x3838c1){const _0xdb1c06=_0x28a351;try{return await this['_capture'][_0xdb1c06(0x278)](async()=>B(this['_kernel'],this[_0xdb1c06(0x35e)],this['unitType'],_0x143a39,_0x3838c1,_0xdb1c06(0x203)));}catch(_0x5ad12b){return await this['_closeAfterFatalError'](_0x5ad12b);}}async[_0x28a351(0x267)](_0x103bab){const _0x48e56f=_0x28a351;this['_acceptingOperations']=!0x1,this[_0x48e56f(0x2ff)]??=this[_0x48e56f(0x2fc)]();try{await this[_0x48e56f(0x2ff)];}catch{}throw _0x103bab;}['_consumeBufferedPrecedingChangesets'](_0x1337fa){const _0x310270=_0x28a351;let _0x412ada=_0x1337fa['at'](-0x1)?.[_0x310270(0x21c)];if(_0x412ada===void 0x0||this['_bufferedChangesets'][_0x310270(0x2b6)]===0x0)return;let _0x2dde5a=this['_bufferedChangesets'][_0x310270(0x2b1)](({revision:_0x2f3144})=>_0x2f3144>_0x412ada),_0x10bd1f=this[_0x310270(0x320)][_0x310270(0x29c)](0x0,_0x2dde5a===-0x1?this[_0x310270(0x320)][_0x310270(0x2b6)]:_0x2dde5a);for(let _0x49bf1e of _0x10bd1f){let _0x4587aa=_0x1337fa[_0x310270(0x318)](({revision:_0x757a0e})=>_0x757a0e===_0x49bf1e['revision']);if(!_0x4587aa||!pe(_0x49bf1e,_0x4587aa))throw new j(_0x310270(0x339),_0x310270(0x2af));}this[_0x310270(0x320)]['splice'](0x0,_0x10bd1f['length']);}[_0x28a351(0x330)](_0x297624){const _0x19e756=_0x28a351;return this[_0x19e756(0x25b)]()||this[_0x19e756(0x34e)][_0x19e756(0x350)](async()=>{const _0x57c968=_0x19e756;_0x297624[_0x57c968(0x244)]===_0x57c968(0x2e2)&&this['_assertMutableState'](_0x57c968(0x2e2));let _0x50cbaf=this[_0x57c968(0x2a6)][_0x57c968(0x2a3)][_0x57c968(0x2b6)],_0x506fc1=P(await this[_0x57c968(0x30f)][_0x57c968(0x330)](_0x297624['code'],_0x297624['mode']));return _0x297624['mode']===_0x57c968(0x2d9)?{'state':this['getState'](),'value':_0x506fc1}:{'mutations':this['_capture'][_0x57c968(0x361)](_0x50cbaf),'state':this[_0x57c968(0x35a)](),'value':_0x506fc1};});}[_0x28a351(0x235)](_0x379ece){const _0x2cf981=_0x28a351;return this['_rejectIfNotAccepting']()||this[_0x2cf981(0x34e)]['run'](async()=>{const _0x98aa00=_0x2cf981;if(this[_0x98aa00(0x23f)]('replace\x20mutations'),this[_0x98aa00(0x27c)]!==null)throw new j(_0x98aa00(0x274),_0x98aa00(0x352));let _0x4b2b1d=me(_0x379ece),_0x58d3b5=[...this['_capture'][_0x98aa00(0x2a3)]];this[_0x98aa00(0x2a6)]['replacePending'](_0x4b2b1d);let _0x1a4250=this['getState']();return{'pendingMutationCount':_0x4b2b1d[_0x98aa00(0x2b6)],'previousMutationCount':_0x58d3b5[_0x98aa00(0x2b6)],'state':_0x1a4250};});}[_0x28a351(0x33f)](){const _0xdf58cb=_0x28a351;return this[_0xdf58cb(0x25b)]()||this[_0xdf58cb(0x34e)][_0xdf58cb(0x350)](async()=>V(this['_univer'],this[_0xdf58cb(0x35e)],this[_0xdf58cb(0x214)]));}[_0x28a351(0x2f7)](){const _0x25bb3c=_0x28a351;return this['_closePromise']?this[_0x25bb3c(0x2ff)]:(this['_acceptingOperations']=!0x1,this[_0x25bb3c(0x2ff)]=this[_0x25bb3c(0x34e)][_0x25bb3c(0x350)](async()=>await this[_0x25bb3c(0x2fc)]()),this[_0x25bb3c(0x2ff)]);}async[_0x28a351(0x2fc)](){const _0x4903ad=_0x28a351;try{this['_capture'][_0x4903ad(0x285)](),await this[_0x4903ad(0x1f6)][_0x4903ad(0x2f7)]();}finally{try{this[_0x4903ad(0x1f7)][_0x4903ad(0x285)]();}finally{this[_0x4903ad(0x31b)]=!0x0;}}}['_rejectIfNotAccepting'](){const _0x42f481=_0x28a351;return this['_acceptingOperations']?null:Promise[_0x42f481(0x298)](new j(_0x42f481(0x293),'Collaboration\x20runtime\x20is\x20closing\x20or\x20closed'));}['_assertMutableState'](_0x27d61d){const _0x39eccb=_0x28a351;if(this[_0x39eccb(0x231)]!==null)throw new j(_0x39eccb(0x274),'Cannot\x20'+_0x27d61d+_0x39eccb(0x1f3));}};function U(_0xbee2d0){const _0x3f0cc6=_0x28a351;return{'baseRevision':_0xbee2d0[_0x3f0cc6(0x22a)],'mutationCount':_0xbee2d0[_0x3f0cc6(0x27d)][_0x3f0cc6(0x2b6)],'reqId':_0xbee2d0[_0x3f0cc6(0x347)],'revision':0x0,'sid':_0xbee2d0[_0x3f0cc6(0x333)]};}function W(_0xbd5e4a,_0x356f1c,_0x1ea63d,_0x224d85){const _0x5cf181=_0x28a351;return _0xeb2c40({'baseRev':_0x224d85,'memberID':'','mutations':[..._0xbd5e4a],'revision':0x0,'type':_0x1ea63d,'unitID':_0x356f1c,'userID':''})[_0x5cf181(0x27d)];}function pe(_0xd65412,_0x545986){const _0x15d709=_0x28a351;return _0xd65412[_0x15d709(0x202)]===_0x545986[_0x15d709(0x202)]&&_0xd65412[_0x15d709(0x273)]===_0x545986[_0x15d709(0x273)]&&_0xd65412['baseRev']===_0x545986['baseRev']&&_0xd65412[_0x15d709(0x21c)]===_0x545986['revision']&&_0xd65412['sid']===_0x545986[_0x15d709(0x333)]&&_0xd65412[_0x15d709(0x347)]===_0x545986[_0x15d709(0x347)]&&JSON['stringify'](_0xd65412[_0x15d709(0x27d)])===JSON[_0x15d709(0x326)](_0x545986[_0x15d709(0x27d)]);}function G(_0x1383ec,_0x48bed1){const _0x38c23a=_0x28a351;return _0x1383ec[_0x38c23a(0x2b6)]===_0x48bed1[_0x38c23a(0x2b6)]&&_0x1383ec['every']((_0x51f9fc,_0x155f3d)=>_0x51f9fc['id']===_0x48bed1[_0x155f3d]?.['id']&&_0x51f9fc[_0x38c23a(0x2ca)]===_0x48bed1[_0x155f3d]?.[_0x38c23a(0x2ca)]);}function me(_0x11aa9f){const _0xb54418=_0x28a351;if(!Array['isArray'](_0x11aa9f))throw new j(_0xb54418(0x274),'Replacement\x20mutations\x20must\x20be\x20an\x20array');return _0x11aa9f[_0xb54418(0x366)](_0x193497=>{const _0x1763b5=_0xb54418;if(!_0x193497||typeof _0x193497!='object'||typeof _0x193497['id']!='string'||_0x193497['id'][_0x1763b5(0x2b6)]===0x0||typeof _0x193497['data']!=_0x1763b5(0x30c))throw new j(_0x1763b5(0x274),'Replacement\x20mutations\x20must\x20contain\x20non-empty\x20id\x20and\x20string\x20data\x20fields');return{'data':_0x193497[_0x1763b5(0x2ca)],'id':_0x193497['id']};});}var K=class extends _0x45c71a{['_config'];[_0x28a351(0x2bb)];static ['pluginName']=_0x28a351(0x309);constructor(_0x13c6e7,_0x43e55a){const _0x2e6442=_0x28a351;super(),this[_0x2e6442(0x2d1)]=_0x13c6e7,this['_injector']=_0x43e55a;}[_0x28a351(0x348)](){const _0x1e7867=_0x28a351;this['_config'][_0x1e7867(0x296)]!==void 0x0&&_0x9caa23(this[_0x1e7867(0x2bb)],[[_0x2114fe,{'useValue':this[_0x1e7867(0x2d1)]['snapshotServerService']}]]),this[_0x1e7867(0x2d1)][_0x1e7867(0x348)]({'commandService':this[_0x1e7867(0x2bb)]['get'](_0x24a215),'compressMutationService':this['_injector'][_0x1e7867(0x1fc)](_0x45cd35),'instanceService':this[_0x1e7867(0x2bb)][_0x1e7867(0x1fc)](_0x4f82f9),'injector':this[_0x1e7867(0x2bb)],'revisionService':this[_0x1e7867(0x2bb)][_0x1e7867(0x1fc)](_0x56a7c3),'transformService':this[_0x1e7867(0x2bb)][_0x1e7867(0x1fc)](_0x309abf)});}};K=_0x5bf473([_0x47e19f(_0x91edc2),_0x45e199(0x1,_0x407b4d(_0x419b26))],K);function he(_0xf07488,_0x1ca6da){const _0x1260ac=_0x28a351;let _0x409ce4;if(_0xf07488[_0x1260ac(0x2bc)](K,{'onStarting'(_0xc544d5){_0x409ce4=_0xc544d5;},..._0x1ca6da===void 0x0?{}:{'snapshotServerService':_0x1ca6da}}),!_0x409ce4)throw Error('Manual\x20collaboration\x20plugin\x20did\x20not\x20reach\x20the\x20Starting\x20lifecycle');return _0x409ce4;}async function ge(_0x1adf9b,_0x2a4472,_0xe24771){const _0x53f509=_0x28a351;let _0x2cabd7=await _0x1adf9b['getUnitOnRev'](0x0);if(_0x1d0608(_0x2cabd7[_0x53f509(0x32b)])){let _0x18f087=_0x2cabd7[_0x53f509(0x32b)];throw new j('COLLABORATION_LOAD_FAILED',_0x18f087?.[_0x53f509(0x239)]||_0x53f509(0x24e));}let _0x42f6b7=_0x2cabd7['snapshot'];if(!_0x42f6b7)throw new j(_0x53f509(0x33c),_0x53f509(0x22e));_e(_0x42f6b7,_0x2a4472,_0xe24771);try{switch(_0xe24771){case _0x27cc9f['UNIVER_SHEET']:return{'changesets':_0x2cabd7[_0x53f509(0x2ad)],'unitData':await _0x25d93a(_0x42f6b7,await q(_0x1adf9b,_0x42f6b7)),'unitType':_0xe24771};case _0x27cc9f[_0x53f509(0x30d)]:return{'changesets':_0x2cabd7[_0x53f509(0x2ad)],'unitData':_0x6ffd28(_0x42f6b7),'unitType':_0xe24771};case _0x27cc9f[_0x53f509(0x27b)]:return{'changesets':_0x2cabd7[_0x53f509(0x2ad)],'unitData':_0x1ce93e(_0x42f6b7),'unitType':_0xe24771};case _0x27cc9f[_0x53f509(0x314)]:return{'changesets':_0x2cabd7[_0x53f509(0x2ad)],'unitData':await _0x16c6bc(_0x42f6b7,await q(_0x1adf9b,_0x42f6b7)),'unitType':_0xe24771};case _0x27cc9f['UNIVER_BOARD']:return{'changesets':_0x2cabd7[_0x53f509(0x2ad)],'unitData':_0x641f7a(_0x42f6b7),'unitType':_0xe24771};default:throw new j('COLLABORATION_INVALID_INPUT',_0x53f509(0x329)+_0xe24771);}}catch(_0x79c59f){throw _0x79c59f instanceof j?_0x79c59f:new j(_0x53f509(0x33c),_0x53f509(0x2b4),{'cause':_0x79c59f});}}function _e(_0x33bddd,_0x19bb2e,_0x218abb){const _0x509d61=_0x28a351;if(_0x33bddd[_0x509d61(0x202)]!==_0x19bb2e||_0x33bddd[_0x509d61(0x273)]!==_0x218abb)throw new j(_0x509d61(0x33c),_0x509d61(0x302));if(!Number[_0x509d61(0x34c)](_0x33bddd['rev'])||_0x33bddd[_0x509d61(0x332)]<0x1)throw new j(_0x509d61(0x33c),_0x509d61(0x280));}async function q(_0x3e6191,_0x39af6c){const _0x361d84=_0x28a351;let _0x4dee71=_0x39af6c['workbook'];if(!_0x4dee71)throw new j(_0x361d84(0x33c),_0x361d84(0x213));let _0x46c330=Object[_0x361d84(0x2c0)](_0x4dee71[_0x361d84(0x2f1)])['flatMap'](({blocks:_0x222826})=>_0x222826);if(new Set(_0x46c330)['size']!==_0x46c330['length'])throw new j(_0x361d84(0x33c),'Snapshot\x20contains\x20duplicate\x20block\x20ids');return await Promise[_0x361d84(0x207)](_0x46c330[_0x361d84(0x366)](async _0x493db7=>{const _0xf96ed8=_0x361d84;let _0x374b36=await _0x3e6191['getSheetBlock'](_0x493db7);if(_0x1d0608(_0x374b36[_0xf96ed8(0x32b)])||!_0x374b36[_0xf96ed8(0x200)])throw new j('COLLABORATION_LOAD_FAILED',_0x374b36[_0xf96ed8(0x32b)]?.[_0xf96ed8(0x239)]||_0xf96ed8(0x25f)+_0x493db7+'\x20is\x20unavailable');if(_0x374b36[_0xf96ed8(0x200)]['id']!==_0x493db7)throw new j(_0xf96ed8(0x33c),_0xf96ed8(0x25f)+_0x493db7+_0xf96ed8(0x2d3));return _0x374b36['block'];}));}function ve(_0x1a7642){const _0xcab7ad=_0x28a351;let _0x362da0=_0x1a7642[_0xcab7ad(0x2d7)]??0xa00000;if(!Number[_0xcab7ad(0x34c)](_0x362da0)||_0x362da0<=0x0)throw new j(_0xcab7ad(0x274),_0xcab7ad(0x2ed));return{async 'load'(_0xca669f,_0x232a06){const _0x2a3805=_0xcab7ad;be(_0xca669f,_0x232a06);let _0x62a189,_0x532810={'unitId':_0xca669f,'unitType':_0x232a06},_0x120d31={'unitId':_0xca669f,'unitType':_0x232a06,..._0x1a7642['snapshotServerService']===void 0x0?{}:{'resolveSnapshotService':()=>{const _0x12ea2c=_0x2b76;if(_0x62a189===void 0x0)throw new j(_0x12ea2c(0x33c),_0x12ea2c(0x32c));return _0x62a189;}}},_0x57cd07;try{_0x57cd07=await _0x1a7642[_0x2a3805(0x2e8)][_0x2a3805(0x29f)](_0x532810);}catch(_0x263b2a){throw new j(_0x2a3805(0x215),'Failed\x20to\x20open\x20the\x20collaboration\x20backend',{'cause':_0x263b2a,'retryable':!0x0});}let _0x31cc16;try{_0x31cc16=await _0x1a7642[_0x2a3805(0x258)](_0x120d31);let _0x37bcdd=he(_0x31cc16,_0x1a7642[_0x2a3805(0x296)]);_0x1a7642[_0x2a3805(0x296)]!==void 0x0&&(_0x62a189=_0x37bcdd['injector'][_0x2a3805(0x1fc)](_0x3e3e5b));let _0x42de48=await xe(_0x57cd07,_0xca669f,_0x232a06);Se(_0x42de48,_0x532810),Ce(_0x31cc16,_0x42de48);let _0x5913a1=B(_0x37bcdd,_0xca669f,_0x232a06,J(_0x42de48[_0x2a3805(0x2f8)]),_0x42de48[_0x2a3805(0x2ad)]),_0x56f844=await _0x57cd07[_0x2a3805(0x2f4)](_0x5913a1,void 0x0);if(_0x1d0608(_0x56f844[_0x2a3805(0x32b)])){let _0x42be9d=_0x56f844['error'];throw new j(_0x2a3805(0x215),_0x42be9d?.[_0x2a3805(0x239)]||_0x2a3805(0x251),{'retryable':!0x0});}let _0x4fa8d9=R(_0x56f844[_0x2a3805(0x2ad)],_0xca669f,_0x232a06,_0x5913a1),_0x89871a=_0x4fa8d9['at'](-0x1)?.[_0x2a3805(0x21c)]??_0x5913a1;if(_0x56f844['latestRevision']!==void 0x0&&_0x56f844['latestRevision']!==_0x89871a)throw new j(_0x2a3805(0x339),'Backend\x20latest\x20revision\x20does\x20not\x20match\x20the\x20initial\x20continuous\x20changeset\x20range');return _0x5913a1=B(_0x37bcdd,_0xca669f,_0x232a06,_0x5913a1,_0x4fa8d9),await ye(_0x37bcdd),new fe(_0xca669f,_0x232a06,_0x5913a1,_0x57cd07,_0x31cc16,_0x37bcdd,_0x362da0);}catch(_0x4b2902){try{await _0x57cd07[_0x2a3805(0x2f7)]();}catch{}try{_0x31cc16?.[_0x2a3805(0x285)]();}catch{}throw _0x4b2902 instanceof j?_0x4b2902:new j(_0x2a3805(0x33c),_0x2a3805(0x261),{'cause':_0x4b2902});}}};}async function ye(_0x5b5282){const _0x1d1b0f=_0x28a351;_0x5b5282['injector'][_0x1d1b0f(0x281)](_0x3c1c2d)&&await _0x5b5282[_0x1d1b0f(0x336)][_0x1d1b0f(0x1fc)](_0x3c1c2d)['waitForLatestApplied']();}function be(_0x294f24,_0x3ae24e){const _0x19cc8d=_0x28a351;if(_0x294f24[_0x19cc8d(0x227)]()[_0x19cc8d(0x2b6)]===0x0)throw new j(_0x19cc8d(0x274),'unitId\x20must\x20not\x20be\x20empty');if(_0x3ae24e!==_0x27cc9f[_0x19cc8d(0x34d)]&&_0x3ae24e!==_0x27cc9f[_0x19cc8d(0x30d)]&&_0x3ae24e!==_0x27cc9f['UNIVER_SLIDE']&&_0x3ae24e!==_0x27cc9f[_0x19cc8d(0x314)]&&_0x3ae24e!==_0x27cc9f[_0x19cc8d(0x287)])throw new j(_0x19cc8d(0x274),_0x19cc8d(0x329)+_0x3ae24e);}async function xe(_0x58deee,_0x5a64fa,_0x2147d0){const _0x1563b8=_0x28a351;return _0x58deee[_0x1563b8(0x224)]===_0x1563b8(0x32e)?await _0x58deee['getUnitData']():await ge(_0x58deee,_0x5a64fa,_0x2147d0);}function Se(_0x187856,_0x5f4bcc){const _0x263e0d=_0x28a351;if(_0x187856[_0x263e0d(0x214)]!==_0x5f4bcc[_0x263e0d(0x214)])throw new j(_0x263e0d(0x33c),'Checkpoint\x20Unit\x20type\x20does\x20not\x20match\x20the\x20requested\x20Unit\x20type');if(_0x187856[_0x263e0d(0x2f8)]['id']!==_0x5f4bcc[_0x263e0d(0x35e)])throw new j(_0x263e0d(0x33c),'Checkpoint\x20Unit\x20id\x20does\x20not\x20match\x20the\x20requested\x20Unit\x20id');J(_0x187856['unitData']);}function J(_0x39f194){const _0x8c1f12=_0x28a351;let _0x3646be=_0x39f194['rev'];if(!Number[_0x8c1f12(0x34c)](_0x3646be)||_0x3646be===void 0x0||_0x3646be<0x1)throw new j(_0x8c1f12(0x33c),_0x8c1f12(0x256));return _0x3646be;}function Ce(_0x35efa3,_0x2a899d){const _0x3f5ab8=_0x28a351;switch(_0x2a899d['unitType']){case _0x27cc9f[_0x3f5ab8(0x34d)]:_0x35efa3[_0x3f5ab8(0x305)](_0x2a899d[_0x3f5ab8(0x214)],structuredClone(_0x2a899d[_0x3f5ab8(0x2f8)]));return;case _0x27cc9f[_0x3f5ab8(0x30d)]:_0x35efa3[_0x3f5ab8(0x305)](_0x2a899d[_0x3f5ab8(0x214)],structuredClone(_0x2a899d[_0x3f5ab8(0x2f8)]));return;case _0x27cc9f['UNIVER_SLIDE']:_0x35efa3[_0x3f5ab8(0x305)](_0x2a899d[_0x3f5ab8(0x214)],structuredClone(_0x2a899d[_0x3f5ab8(0x2f8)]));return;case _0x27cc9f[_0x3f5ab8(0x314)]:_0x35efa3[_0x3f5ab8(0x305)](_0x2a899d['unitType'],structuredClone(_0x2a899d['unitData']));return;case _0x27cc9f[_0x3f5ab8(0x287)]:_0x35efa3['createUnit'](_0x2a899d[_0x3f5ab8(0x214)],structuredClone(_0x2a899d[_0x3f5ab8(0x2f8)]));return;}}var we=class{[_0x28a351(0x2d1)];[_0x28a351(0x33a)];['_lease'];['format']=_0x28a351(0x2ce);constructor(_0x70606f,_0x2674ce,_0x5e7f07){const _0x14e8a9=_0x28a351;this[_0x14e8a9(0x2d1)]=_0x70606f,this['_target']=_0x2674ce,this[_0x14e8a9(0x362)]=_0x5e7f07;}[_0x28a351(0x22d)](){const _0x5c0cbd=_0x28a351;return this['_lease'][_0x5c0cbd(0x22d)]();}async['getUnitOnRev'](_0x523ff5=0x0){const _0x435ac3=_0x28a351;let _0x1ef906=X(this[_0x435ac3(0x2d1)][_0x435ac3(0x2cb)],this[_0x435ac3(0x33a)][_0x435ac3(0x214)],'unit',this[_0x435ac3(0x33a)][_0x435ac3(0x35e)],_0x435ac3(0x332),_0x523ff5),_0x55652d=await Y(this[_0x435ac3(0x2d1)],_0x1ef906);return Te(_0x55652d[_0x435ac3(0x2ce)]),_0x55652d;}async['getSheetBlock'](_0x33300c){const _0x2d84fb=_0x28a351;let _0x464f49=X(this[_0x2d84fb(0x2d1)][_0x2d84fb(0x2cb)],this[_0x2d84fb(0x33a)][_0x2d84fb(0x214)],_0x2d84fb(0x2e7),this[_0x2d84fb(0x33a)]['unitId'],'block',_0x33300c),_0x160346=await Y(this[_0x2d84fb(0x2d1)],_0x464f49);return _0x160346[_0x2d84fb(0x200)]&&typeof _0x160346[_0x2d84fb(0x200)][_0x2d84fb(0x2ca)]==_0x2d84fb(0x30c)&&(_0x160346[_0x2d84fb(0x200)][_0x2d84fb(0x2ca)]=Z(_0x160346[_0x2d84fb(0x200)]['data'])),_0x160346;}async[_0x28a351(0x2f4)](_0x10606c,_0x2cd081=0x0){const _0x253736=_0x28a351;let _0x278290=X(this[_0x253736(0x2d1)]['snapshotServerUrl'],this[_0x253736(0x33a)][_0x253736(0x214)],'unit',this[_0x253736(0x33a)]['unitId'],_0x253736(0x2dc));_0x278290[_0x253736(0x299)][_0x253736(0x24f)](_0x253736(0x23e),String(_0x10606c)),_0x278290[_0x253736(0x299)][_0x253736(0x24f)]('to',String(_0x2cd081));let _0x426e91=await Y(this[_0x253736(0x2d1)],_0x278290);return this[_0x253736(0x362)][_0x253736(0x288)](),_0x426e91;}async[_0x28a351(0x212)](_0x1d74aa){const _0x221179=_0x28a351;await this['_lease'][_0x221179(0x223)]();let _0x1b454a=this[_0x221179(0x362)]['waitForSubmission'](_0x1d74aa[_0x221179(0x333)],_0x1d74aa['reqId']),_0x2b1e8b={..._0x1d74aa,'memberID':this[_0x221179(0x362)][_0x221179(0x29e)],'revision':0x0,'type':this[_0x221179(0x33a)]['unitType'],'unitID':this[_0x221179(0x33a)][_0x221179(0x35e)],'userID':''},_0x27f835=X(this[_0x221179(0x2d1)][_0x221179(0x31e)],this['_target'][_0x221179(0x214)],_0x221179(0x2e7),this[_0x221179(0x33a)]['unitId'],_0x221179(0x34b)),_0x416c75=this[_0x221179(0x2d1)][_0x221179(0x241)](_0x27f835,{'body':JSON[_0x221179(0x326)]({'changeset':_0x2b1e8b,'memberID':this[_0x221179(0x362)][_0x221179(0x29e)],'type':this[_0x221179(0x33a)][_0x221179(0x214)],'unitID':this[_0x221179(0x33a)][_0x221179(0x35e)]}),'headers':{'content-type':_0x221179(0x2a0)},'method':_0x221179(0x2bd)})[_0x221179(0x201)](async _0x543f19=>_0x543f19[_0x221179(0x27f)]===0x191||_0x543f19[_0x221179(0x27f)]===0x193?_0x221179(0x26a):_0x543f19[_0x221179(0x27f)]===0x190||_0x543f19['status']===0x199?_0x221179(0x1f9):_0x543f19['ok']?'accepted':_0x221179(0x291))[_0x221179(0x2c6)](()=>_0x221179(0x291)),_0x21ac53=Ee(this['_config']['commitTimeoutMs']),_0x453708=_0x416c75['then'](_0x23b30d=>_0x23b30d===_0x221179(0x26a)?{'status':_0x221179(0x2d6)}:_0x23b30d===_0x221179(0x1f9)?{'status':_0x221179(0x354)}:new Promise(()=>void 0x0)),_0x376e66=await Promise[_0x221179(0x218)]([_0x1b454a['promise'],_0x453708,_0x21ac53[_0x221179(0x2b3)][_0x221179(0x201)](()=>({'status':'timeout'}))])['finally'](()=>{const _0x2447e9=_0x221179;_0x1b454a[_0x2447e9(0x24a)](),_0x21ac53[_0x2447e9(0x24a)]();});if(_0x376e66[_0x221179(0x27f)]===_0x221179(0x221)){let _0x2e9352=await _0x416c75;return _0x2e9352==='permission'?{'message':'Changeset\x20submission\x20was\x20denied','reason':_0x221179(0x275),'status':_0x221179(0x2f6)}:_0x2e9352===_0x221179(0x1f9)?{'message':_0x221179(0x297),'reason':'invalid-changeset','status':_0x221179(0x2f6)}:{'status':_0x221179(0x291)};}if(_0x376e66['status']==='closed')return{'status':_0x221179(0x291)};if(_0x376e66[_0x221179(0x27f)]==='retry')return{'status':_0x221179(0x228)};if(_0x376e66[_0x221179(0x27f)]===_0x221179(0x2d6))return{'message':_0x221179(0x23d),'reason':'permission-denied','status':_0x221179(0x2f6)};if(_0x376e66[_0x221179(0x27f)]===_0x221179(0x354)){let _0x1c589e=await this[_0x221179(0x2f4)](_0x1d74aa['baseRev'],_0x1d74aa['baseRev']);return{'message':_0x221179(0x297),'reason':_0x1c589e[_0x221179(0x279)]!==void 0x0&&_0x1c589e[_0x221179(0x279)]<_0x1d74aa[_0x221179(0x22a)]?'invalid-revision':'invalid-changeset','status':'rejected'};}let _0x417133=_0x376e66[_0x221179(0x20e)],_0x4a949b=await this[_0x221179(0x2f4)](_0x1d74aa[_0x221179(0x22a)],_0x417133[_0x221179(0x21c)]-0x1);if(_0x1d0608(_0x4a949b[_0x221179(0x32b)])){let _0x28bf7f=_0x4a949b['error'];throw new j(_0x221179(0x215),_0x28bf7f?.[_0x221179(0x239)]||_0x221179(0x246),{'retryable':!0x0});}return{'acceptedChangeset':_0x417133,'precedingChangesets':_0x4a949b[_0x221179(0x2ad)],'status':_0x221179(0x359)};}async[_0x28a351(0x2f7)](){const _0x544007=_0x28a351;await this['_lease'][_0x544007(0x2f7)]();}};async function Y(_0x2628c7,_0x20e4d1){const _0x380303=_0x28a351;let _0x38f634;try{_0x38f634=await _0x2628c7[_0x380303(0x241)](_0x20e4d1,{'method':'GET'});}catch(_0x83a00b){throw new j(_0x380303(0x215),_0x380303(0x1fd),{'cause':_0x83a00b,'retryable':!0x0});}if(!_0x38f634['ok'])throw new j(_0x380303(0x215),_0x380303(0x365)+_0x38f634[_0x380303(0x27f)],{'retryable':_0x38f634[_0x380303(0x27f)]>=0x1f4});try{return await _0x38f634[_0x380303(0x2f5)]();}catch(_0x158a5c){throw new j(_0x380303(0x339),'Collaboration\x20HTTP\x20response\x20is\x20not\x20valid\x20JSON',{'cause':_0x158a5c});}}function X(_0x13131d,..._0x45fc92){const _0x4ab38c=_0x28a351;let _0x1a15e4=new URL(_0x13131d);return _0x1a15e4[_0x4ab38c(0x286)]=_0x1a15e4[_0x4ab38c(0x286)][_0x4ab38c(0x1fa)](/\/$/,'')+'/'+_0x45fc92[_0x4ab38c(0x366)](_0x691694=>encodeURIComponent(String(_0x691694)))['join']('/'),_0x1a15e4;}function Te(_0xa7ada0){const _0x50f83f=_0x28a351;if(!_0xa7ada0)return;let _0x1203a7=[_0xa7ada0['workbook'],_0xa7ada0['doc'],_0xa7ada0['slide'],_0xa7ada0[_0x50f83f(0x2a8)]];for(let _0x468615 of _0x1203a7)_0x468615&&typeof _0x468615[_0x50f83f(0x321)]==_0x50f83f(0x30c)&&(_0x468615[_0x50f83f(0x321)]=Z(_0x468615[_0x50f83f(0x321)]));if(_0xa7ada0['workbook']){for(let _0x32598a of Object[_0x50f83f(0x2c0)](_0xa7ada0[_0x50f83f(0x2c9)][_0x50f83f(0x36b)]))typeof _0x32598a[_0x50f83f(0x321)]=='string'&&(_0x32598a[_0x50f83f(0x321)]=Z(_0x32598a[_0x50f83f(0x321)]));}}function Z(_0x34ddad){const _0x5da7be=_0x28a351;return Uint8Array[_0x5da7be(0x23e)](Buffer[_0x5da7be(0x23e)](_0x34ddad,'base64'));}function Ee(_0x20da55){let _0x489c6a;return{'cancel':()=>{_0x489c6a!==void 0x0&&clearTimeout(_0x489c6a);},'promise':new Promise(_0x4a3549=>{_0x489c6a=setTimeout(_0x4a3549,_0x20da55);})};}var De=class{[_0x28a351(0x2d1)];[_0x28a351(0x2f9)]='offline';['_socket'];[_0x28a351(0x264)];[_0x28a351(0x25c)]='';[_0x28a351(0x2c3)]=new Map();[_0x28a351(0x358)]=new Map();[_0x28a351(0x222)]=new Map();[_0x28a351(0x210)]=new Map();[_0x28a351(0x234)];['_reconnectTimer'];[_0x28a351(0x24d)]=0x0;constructor(_0x219382){const _0x5b3a28=_0x28a351;this[_0x5b3a28(0x2d1)]=_0x219382;}async[_0x28a351(0x33e)](_0x53bf2c){const _0x22e7d9=_0x28a351;let _0xa280bd=this[_0x22e7d9(0x2c3)][_0x22e7d9(0x1fc)](_0x53bf2c['unitId']);if(_0xa280bd&&_0xa280bd[_0x22e7d9(0x2f0)][_0x22e7d9(0x214)]!==_0x53bf2c[_0x22e7d9(0x214)])throw new j(_0x22e7d9(0x274),_0x22e7d9(0x220));if(await this['_ensureConnected'](),_0xa280bd)_0xa280bd[_0x22e7d9(0x2b7)]+=0x1;else{try{await this[_0x22e7d9(0x304)](_0x53bf2c);}catch(_0x264f09){throw this['_joined'][_0x22e7d9(0x35b)]===0x0&&(this['_state']=_0x22e7d9(0x271),this[_0x22e7d9(0x20f)](),this[_0x22e7d9(0x2a2)]?.[_0x22e7d9(0x2f7)](0x3e8,'Initial\x20Unit\x20JOIN\x20failed'),this[_0x22e7d9(0x2a2)]=void 0x0,this[_0x22e7d9(0x25c)]=''),_0x264f09;}this[_0x22e7d9(0x2c3)][_0x22e7d9(0x24f)](_0x53bf2c[_0x22e7d9(0x35e)],{'leases':0x1,'target':_0x53bf2c});}let _0x12d6ed=!0x1,_0x576d26=()=>this['_memberId'],_0x20b210=new Set();return{'close':async()=>{const _0x26861f=_0x22e7d9;if(!_0x12d6ed){_0x12d6ed=!0x0;for(let _0x463d34 of _0x20b210)_0x463d34[_0x26861f(0x24a)]();_0x20b210[_0x26861f(0x327)](),await this[_0x26861f(0x32f)](_0x53bf2c['unitId']);}},'ensureOnline':async()=>await this[_0x22e7d9(0x28f)](),'getConnectionState':()=>_0x12d6ed?_0x22e7d9(0x271):this[_0x22e7d9(0x2f9)],get 'memberId'(){return _0x576d26();},'takeInboundChangesets':()=>{const _0x57b78c=_0x22e7d9;let _0x182f7f=this[_0x57b78c(0x210)][_0x57b78c(0x1fc)](_0x53bf2c[_0x57b78c(0x35e)])??[];return this[_0x57b78c(0x210)][_0x57b78c(0x342)](_0x53bf2c[_0x57b78c(0x35e)]),_0x182f7f;},'waitForSubmission':(_0x29b89b,_0x283063)=>{const _0x12b2bb=_0x22e7d9;let _0x668040=this[_0x12b2bb(0x2c7)](_0x29b89b,_0x283063);return _0x20b210[_0x12b2bb(0x24c)](_0x668040),_0x668040[_0x12b2bb(0x2b3)][_0x12b2bb(0x201)](()=>_0x20b210['delete'](_0x668040),()=>_0x20b210[_0x12b2bb(0x342)](_0x668040)),{'cancel':()=>{const _0x5912dd=_0x12b2bb;_0x20b210[_0x5912dd(0x342)](_0x668040),_0x668040[_0x5912dd(0x24a)]();},'promise':_0x668040[_0x12b2bb(0x2b3)]};}};}async[_0x28a351(0x28f)](){const _0x57a9db=_0x28a351;if(this[_0x57a9db(0x2f9)]!=='online'||this[_0x57a9db(0x2a2)]?.[_0x57a9db(0x269)]!==WebSocket[_0x57a9db(0x270)]){this[_0x57a9db(0x2fd)]!==void 0x0&&clearTimeout(this[_0x57a9db(0x2fd)]),this[_0x57a9db(0x2fd)]=void 0x0,this[_0x57a9db(0x264)]??=this[_0x57a9db(0x2c1)]();try{await this[_0x57a9db(0x264)];}finally{this[_0x57a9db(0x264)]=void 0x0;}}}async[_0x28a351(0x2c1)](){const _0xd94e01=_0x28a351;this['_state']=_0xd94e01(0x2ea);let _0x12c2e9=await this[_0xd94e01(0x2d1)][_0xd94e01(0x241)](this[_0xd94e01(0x2d1)][_0xd94e01(0x2ab)],{'headers':{'content-type':_0xd94e01(0x2a0)},'method':_0xd94e01(0x34f)});if(!_0x12c2e9['ok'])throw this['_state']=_0xd94e01(0x317),new j(_0xd94e01(0x215),_0xd94e01(0x2a1)+_0x12c2e9[_0xd94e01(0x27f)],{'retryable':_0x12c2e9[_0xd94e01(0x27f)]>=0x1f4});let _0x43d872=await _0x12c2e9[_0xd94e01(0x2f5)]();if(typeof _0x43d872[_0xd94e01(0x2b2)]!='string'||_0x43d872['ticket'][_0xd94e01(0x2b6)]===0x0)throw this[_0xd94e01(0x2f9)]='offline',new j(_0xd94e01(0x339),_0xd94e01(0x344));let _0x4caa4b=new URL(this[_0xd94e01(0x2d1)][_0xd94e01(0x206)]);_0x4caa4b[_0xd94e01(0x299)][_0xd94e01(0x24f)](_0xd94e01(0x238),_0x43d872[_0xd94e01(0x2b2)]);let _0x470c58=new WebSocket(_0x4caa4b);this[_0xd94e01(0x2a2)]=_0x470c58,_0x470c58[_0xd94e01(0x349)](_0xd94e01(0x239),_0x2487cc=>this[_0xd94e01(0x226)](_0x2487cc)),_0x470c58['addEventListener']('close',()=>{const _0x20fd07=_0xd94e01;this[_0x20fd07(0x2a2)]===_0x470c58&&(this[_0x20fd07(0x20f)](),this['_failCommandWaiters'](new j('COLLABORATION_UNAVAILABLE',_0x20fd07(0x310),{'retryable':!0x0})),this[_0x20fd07(0x2f9)]=this[_0x20fd07(0x2c3)][_0x20fd07(0x35b)]===0x0?_0x20fd07(0x271):_0x20fd07(0x2ea),this['_joined'][_0x20fd07(0x35b)]>0x0&&this[_0x20fd07(0x26c)]());}),await Oe(_0x470c58);let _0x372be2=await this[_0xd94e01(0x306)](_0x9b7859[_0xd94e01(0x313)],'',{'cmd':_0x9b7859[_0xd94e01(0x313)],'routeKey':''});if(_0x372be2[_0xd94e01(0x236)]!==_0x90bf3a['OK']||typeof _0x372be2[_0xd94e01(0x20b)]?.[_0xd94e01(0x35d)]!='string')throw _0x470c58[_0xd94e01(0x2f7)](),new j(_0xd94e01(0x339),_0xd94e01(0x282));this['_memberId']=_0x372be2[_0xd94e01(0x20b)][_0xd94e01(0x35d)],this[_0xd94e01(0x2f9)]=_0xd94e01(0x28e);for(let {target:_0x290f1b}of this[_0xd94e01(0x2c3)]['values']())try{await this[_0xd94e01(0x304)](_0x290f1b);}catch(_0x4abd55){throw _0x470c58[_0xd94e01(0x2f7)](0x3f3,_0xd94e01(0x312)),_0x4abd55;}this[_0xd94e01(0x24d)]=0x0,this[_0xd94e01(0x307)]();}async[_0x28a351(0x304)](_0x2616f0){const _0x14f407=_0x28a351;let _0x47aa78=await this[_0x14f407(0x306)](_0x9b7859['JOIN'],_0x2616f0[_0x14f407(0x35e)],{'cmd':_0x9b7859['JOIN'],'joinReq':{'rooms':[{'args':'','roomID':_0x2616f0[_0x14f407(0x35e)]}]},'routeKey':_0x2616f0[_0x14f407(0x35e)]});if(_0x47aa78[_0x14f407(0x236)]!==_0x90bf3a['OK'])throw new j('COLLABORATION_UNAVAILABLE',typeof _0x47aa78[_0x14f407(0x248)]==_0x14f407(0x30c)?_0x47aa78[_0x14f407(0x248)]:_0x14f407(0x319));}[_0x28a351(0x306)](_0x5a1e4e,_0x1acae0,_0x2681ea){const _0x29c247=_0x28a351;let _0x456c00=this[_0x29c247(0x2a2)];if(!_0x456c00||_0x456c00['readyState']!==WebSocket[_0x29c247(0x270)])return Promise['reject'](new j(_0x29c247(0x215),_0x29c247(0x272),{'retryable':!0x0}));let _0x4d2e8d=_0x5a1e4e+':'+_0x1acae0;return new Promise((_0x31c9b1,_0x483d0c)=>{const _0x1860bd=_0x29c247;if(this[_0x1860bd(0x358)][_0x1860bd(0x281)](_0x4d2e8d)){_0x483d0c(new j(_0x1860bd(0x339),'A\x20'+_0x5a1e4e+_0x1860bd(0x247)+_0x1acae0));return;}let _0x33334f=setTimeout(()=>{const _0x53a27f=_0x1860bd;this['_commandWaiters'][_0x53a27f(0x342)](_0x4d2e8d),_0x483d0c(new j(_0x53a27f(0x215),_0x53a27f(0x31d)+_0x5a1e4e,{'retryable':!0x0}));},0x7530);this[_0x1860bd(0x358)][_0x1860bd(0x24f)](_0x4d2e8d,{'reject':_0x483d0c,'resolve':_0x31c9b1,'timer':_0x33334f});try{_0x456c00[_0x1860bd(0x209)](JSON[_0x1860bd(0x326)](_0x2681ea));}catch(_0x4c4e92){this['_commandWaiters'][_0x1860bd(0x342)](_0x4d2e8d),clearTimeout(_0x33334f),_0x483d0c(new j(_0x1860bd(0x215),'Failed\x20to\x20send\x20Collaboration\x20WebSocket\x20command',{'cause':_0x4c4e92,'retryable':!0x0}));}});}[_0x28a351(0x226)](_0x3b6017){const _0xd17c37=_0x28a351;if(typeof _0x3b6017['data']!=_0xd17c37(0x30c))return;let _0x56f461;try{_0x56f461=JSON[_0xd17c37(0x242)](_0x3b6017[_0xd17c37(0x2ca)]);}catch{this[_0xd17c37(0x2a2)]?.[_0xd17c37(0x2f7)](0x3eb,'Invalid\x20JSON\x20response');return;}let _0x112735=typeof _0x56f461[_0xd17c37(0x2e5)]==_0xd17c37(0x30c)?_0x56f461[_0xd17c37(0x2e5)]:'';if(_0x56f461['cmd']===_0x9b7859[_0xd17c37(0x313)]||_0x56f461[_0xd17c37(0x28d)]===_0x9b7859[_0xd17c37(0x357)]||_0x56f461[_0xd17c37(0x28d)]===_0x9b7859['HEARTBEAT']){let _0x8ddf80=_0x56f461['cmd']+':'+_0x112735,_0x130d06=this[_0xd17c37(0x358)][_0xd17c37(0x1fc)](_0x8ddf80);_0x130d06&&(this[_0xd17c37(0x358)][_0xd17c37(0x342)](_0x8ddf80),clearTimeout(_0x130d06[_0xd17c37(0x1f2)]),_0x130d06[_0xd17c37(0x208)](_0x56f461));return;}_0x56f461[_0xd17c37(0x28d)]!==_0x9b7859[_0xd17c37(0x277)]||!_0x56f461['collaMsg']||this[_0xd17c37(0x35c)](_0x112735,_0x56f461[_0xd17c37(0x276)]);}[_0x28a351(0x35c)](_0xe5df58,_0x84292d){const _0x1ff846=_0x28a351;let _0x2aaa06=_0x84292d[_0x1ff846(0x353)],_0x31da67=_0x2aaa06===_0x1ff846(0x217)?_0x1ff846(0x316):_0x2aaa06===_0x1ff846(0x30e)?_0x1ff846(0x23c):_0x2aaa06===_0x1ff846(0x2bf)?'csShouldRetryEvent':_0x2aaa06==='permission_rej'?'permissionRejEvent':_0x2aaa06===_0x1ff846(0x23a)?_0x1ff846(0x31f):void 0x0;if(!_0x31da67)return;let _0x3231f9=ke(_0x84292d[_0x31da67]);if(!_0x3231f9||_0x3231f9['unitID']!==_0xe5df58)return;if(_0x2aaa06==='new_changesets'){let _0x50d304=this[_0x1ff846(0x210)]['get'](_0xe5df58)??[];_0x50d304['push'](_0x3231f9),this['_inbound'][_0x1ff846(0x24f)](_0xe5df58,_0x50d304);return;}let _0x5066e1=Q(_0x3231f9[_0x1ff846(0x333)],_0x3231f9[_0x1ff846(0x347)]),_0x20a4bc=this['_submissionWaiters'][_0x1ff846(0x1fc)](_0x5066e1);_0x20a4bc&&_0x20a4bc(_0x2aaa06===_0x1ff846(0x217)?{'changeset':_0x3231f9,'status':_0x1ff846(0x2b8)}:_0x2aaa06==='changeset_should_retry'?{'status':_0x1ff846(0x228)}:_0x2aaa06===_0x1ff846(0x2a4)?{'status':_0x1ff846(0x2d6)}:{'status':_0x1ff846(0x354)});}['_waitForSubmission'](_0x389e73,_0x2a42b1){const _0x5f1393=_0x28a351;let _0xaa9725=Q(_0x389e73,_0x2a42b1);if(this['_submissionWaiters']['has'](_0xaa9725))return{'cancel':()=>void 0x0,'promise':Promise[_0x5f1393(0x298)](new j(_0x5f1393(0x274),'The\x20same\x20changeset\x20submission\x20is\x20already\x20in\x20flight'))};let _0x5d862b=()=>void 0x0;return{'cancel':()=>_0x5d862b({'status':'closed'}),'promise':new Promise(_0x5e1e56=>{const _0x482225=_0x5f1393;_0x5d862b=_0x40b2d4=>{const _0x3d5906=_0x2b76;this[_0x3d5906(0x222)][_0x3d5906(0x342)](_0xaa9725)&&_0x5e1e56(_0x40b2d4);},this[_0x482225(0x222)][_0x482225(0x24f)](_0xaa9725,_0x5d862b);})};}async[_0x28a351(0x32f)](_0x54bade){const _0x50c802=_0x28a351;let _0x35639b=this[_0x50c802(0x2c3)][_0x50c802(0x1fc)](_0x54bade);_0x35639b&&(--_0x35639b['leases'],!(_0x35639b['leases']>0x0)&&(this[_0x50c802(0x2c3)][_0x50c802(0x342)](_0x54bade),this[_0x50c802(0x210)][_0x50c802(0x342)](_0x54bade),this[_0x50c802(0x2a2)]?.[_0x50c802(0x269)]===WebSocket[_0x50c802(0x270)]&&this[_0x50c802(0x2a2)][_0x50c802(0x209)](JSON['stringify']({'cmd':_0x9b7859[_0x50c802(0x324)],'leaveReq':{'args':'','roomID':_0x54bade},'routeKey':_0x54bade})),this[_0x50c802(0x2c3)]['size']===0x0&&(this[_0x50c802(0x2f9)]=_0x50c802(0x271),this[_0x50c802(0x2fd)]!==void 0x0&&clearTimeout(this[_0x50c802(0x2fd)]),this[_0x50c802(0x2fd)]=void 0x0,this['_stopHeartbeat'](),this[_0x50c802(0x2a2)]?.['close'](0x3e8,_0x50c802(0x263)),this['_socket']=void 0x0,this[_0x50c802(0x25c)]='')));}[_0x28a351(0x26c)](){const _0x580da2=_0x28a351;if(this[_0x580da2(0x2fd)]!==void 0x0||this[_0x580da2(0x24d)]>=0x3){this['_reconnectAttempts']>=0x3&&(this[_0x580da2(0x2f9)]=_0x580da2(0x317));return;}let _0x2de381=Math[_0x580da2(0x29a)](0x3e8*0x2**this['_reconnectAttempts'],0x4e20);this[_0x580da2(0x24d)]+=0x1,this[_0x580da2(0x2fd)]=setTimeout(()=>{const _0x5229a9=_0x580da2;this['_reconnectTimer']=void 0x0,this[_0x5229a9(0x264)]??=this[_0x5229a9(0x2c1)](),this['_connectPromise'][_0x5229a9(0x2c6)](()=>this[_0x5229a9(0x26c)]())['finally'](()=>{const _0x1a3206=_0x5229a9;this[_0x1a3206(0x264)]=void 0x0;});},_0x2de381);}[_0x28a351(0x307)](){const _0x21aae6=_0x28a351;this['_stopHeartbeat'](),this[_0x21aae6(0x234)]=setInterval(()=>{const _0x5157ca=_0x21aae6;this['_state']==='online'&&this['_requestCommand'](_0x9b7859['HEARTBEAT'],'',{'cmd':_0x9b7859[_0x5157ca(0x204)],'routeKey':''})[_0x5157ca(0x2c6)](()=>this[_0x5157ca(0x2a2)]?.[_0x5157ca(0x2f7)](0x3f3,'Heartbeat\x20failed'));},0x7530);}[_0x28a351(0x20f)](){const _0x4aedc0=_0x28a351;this['_heartbeat']!==void 0x0&&clearInterval(this[_0x4aedc0(0x234)]),this[_0x4aedc0(0x234)]=void 0x0;}['_failCommandWaiters'](_0x16e359){const _0xf3725b=_0x28a351;for(let _0x531925 of this['_commandWaiters'][_0xf3725b(0x2c0)]())clearTimeout(_0x531925['timer']),_0x531925['reject'](_0x16e359);this[_0xf3725b(0x358)][_0xf3725b(0x327)]();}};function Oe(_0x5116b4){return new Promise((_0xbf8474,_0x20cfc6)=>{const _0xaf17ca=_0x2b76;let _0x23844c=()=>{const _0x2e4825=_0x2b76;clearTimeout(_0x1da7f7),_0x5116b4[_0x2e4825(0x205)]('close',_0x5544eb),_0x5116b4[_0x2e4825(0x205)](_0x2e4825(0x32b),_0x1e7e74),_0x5116b4[_0x2e4825(0x205)](_0x2e4825(0x29f),_0x592937);},_0x2b967c=_0x4220c1=>{_0x23844c(),_0x20cfc6(new j('COLLABORATION_UNAVAILABLE',_0x4220c1,{'retryable':!0x0}));},_0x5544eb=()=>_0x2b967c(_0xaf17ca(0x1f4)),_0x1e7e74=()=>_0x2b967c(_0xaf17ca(0x2d5)),_0x592937=()=>{_0x23844c(),_0xbf8474();},_0x1da7f7=setTimeout(()=>{const _0xe8c6c2=_0xaf17ca;_0x2b967c('Timed\x20out\x20establishing\x20Collaboration\x20WebSocket'),_0x5116b4[_0xe8c6c2(0x2f7)](0x3e8,_0xe8c6c2(0x257));},0x7530);_0x5116b4[_0xaf17ca(0x349)](_0xaf17ca(0x2f7),_0x5544eb,{'once':!0x0}),_0x5116b4[_0xaf17ca(0x349)](_0xaf17ca(0x32b),_0x1e7e74,{'once':!0x0}),_0x5116b4[_0xaf17ca(0x349)](_0xaf17ca(0x29f),_0x592937,{'once':!0x0});});}function ke(_0x252cb9){const _0x15049a=_0x28a351;if(!_0x252cb9||typeof _0x252cb9!=_0x15049a(0x2e1))return null;let _0x3d8764=_0x252cb9['cs'];return _0x3d8764&&typeof _0x3d8764=='object'?_0x3d8764:null;}function Q(_0x2da2eb,_0x168ce9){return(_0x2da2eb??'')+':'+(_0x168ce9??0x0);}var Ae=class{[_0x28a351(0x2d1)];[_0x28a351(0x2cd)];constructor(_0x9e8a97){const _0x15e102=_0x28a351;this['_config']=je(_0x9e8a97),this[_0x15e102(0x2cd)]=new De(this[_0x15e102(0x2d1)]);}async[_0x28a351(0x29f)](_0x2e8750){const _0x2e6ef8=_0x28a351;let _0x4d29e1=await this[_0x2e6ef8(0x2cd)][_0x2e6ef8(0x33e)](_0x2e8750);return new we(this[_0x2e6ef8(0x2d1)],_0x2e8750,_0x4d29e1);}};function je(_0x4827f3){const _0x4d2a9e=_0x28a351;let _0x4c5f87=$(_0x4827f3[_0x4d2a9e(0x2cb)],'snapshotServerUrl',[_0x4d2a9e(0x2ba),_0x4d2a9e(0x369)]),_0x566b83=$(_0x4827f3['collabSubmitChangesetUrl'],_0x4d2a9e(0x31e),[_0x4d2a9e(0x2ba),_0x4d2a9e(0x369)]),_0x14b636=$(_0x4827f3[_0x4d2a9e(0x206)],_0x4d2a9e(0x206),[_0x4d2a9e(0x300),_0x4d2a9e(0x262),_0x4d2a9e(0x2ba),_0x4d2a9e(0x369)]);_0x14b636['protocol']===_0x4d2a9e(0x2ba)&&(_0x14b636['protocol']='ws:'),_0x14b636['protocol']===_0x4d2a9e(0x369)&&(_0x14b636['protocol']=_0x4d2a9e(0x262));let _0x2ff778=$(_0x4827f3['wsSessionTicketUrl'],'wsSessionTicketUrl',[_0x4d2a9e(0x2ba),_0x4d2a9e(0x369)]),_0x36f54b=_0x4827f3[_0x4d2a9e(0x2fb)]??0x7530;if(!Number['isSafeInteger'](_0x36f54b)||_0x36f54b<=0x0)throw new j(_0x4d2a9e(0x274),_0x4d2a9e(0x364));return{'collabSubmitChangesetUrl':_0x566b83,'collabWebSocketUrl':_0x14b636,'commitTimeoutMs':_0x36f54b,'httpRequest':_0x4827f3[_0x4d2a9e(0x241)]??globalThis['fetch'][_0x4d2a9e(0x254)](globalThis),'snapshotServerUrl':_0x4c5f87,'wsSessionTicketUrl':_0x2ff778};}function $(_0x4f9062,_0x53fb1b,_0x55bec9){const _0x3a750f=_0x28a351;let _0x25cffa;try{_0x25cffa=new URL(_0x4f9062);}catch{throw new j(_0x3a750f(0x274),_0x53fb1b+'\x20must\x20be\x20an\x20absolute\x20URL');}if(!_0x55bec9[_0x3a750f(0x33d)](_0x25cffa[_0x3a750f(0x26e)]))throw new j(_0x3a750f(0x274),_0x53fb1b+'\x20uses\x20an\x20unsupported\x20protocol');return _0x25cffa;}function Me(_0xca302f){return new Ae(_0xca302f);}export{j as CollaborationRuntimeError,Me as createCollaborationServerAdapter,ve as createUniverCollaborationRuntimeFactory};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@univer-cli/univer-collaboration-runtime",
3
3
  "type": "module",
4
- "version": "1.0.0",
4
+ "version": "1.0.2",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",
@@ -19,16 +19,16 @@
19
19
  ],
20
20
  "dependencies": {
21
21
  "@oxc-project/runtime": "0.142.0",
22
- "@univerjs-pro/bases": "1.0.0",
23
- "@univerjs-pro/boards": "1.0.0",
24
- "@univerjs-pro/collaboration": "1.0.0",
25
- "@univerjs-pro/engine-formula": "1.0.0",
26
- "@univerjs-pro/slides": "1.0.0",
27
- "@univerjs/core": "1.0.0",
28
- "@univerjs/docs": "1.0.0",
29
- "@univerjs/engine-formula": "1.0.0",
30
- "@univerjs/engine-render": "1.0.0",
31
- "@univerjs/protocol": "1.0.0",
32
- "@univerjs/sheets": "1.0.0"
22
+ "@univerjs-pro/bases": "1.0.2",
23
+ "@univerjs-pro/boards": "1.0.2",
24
+ "@univerjs-pro/collaboration": "1.0.2",
25
+ "@univerjs-pro/engine-formula": "1.0.2",
26
+ "@univerjs-pro/slides": "1.0.2",
27
+ "@univerjs/core": "1.0.2",
28
+ "@univerjs/docs": "1.0.2",
29
+ "@univerjs/engine-formula": "1.0.2",
30
+ "@univerjs/engine-render": "1.0.2",
31
+ "@univerjs/protocol": "1.0.2",
32
+ "@univerjs/sheets": "1.0.2"
33
33
  }
34
34
  }