@univer-cli/univer-collaboration-runtime-pool 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +1 -1
- package/dist/worker-child.mjs +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x974b1b=_0x27b6;(function(_0x3850a9,_0x4d7923){const _0x3c2d21=_0x27b6,_0xa6fd21=_0x3850a9();while(!![]){try{const _0x24e4e6=parseInt(_0x3c2d21(0x10e))/0x1+parseInt(_0x3c2d21(0xc6))/0x2*(parseInt(_0x3c2d21(0x94))/0x3)+-parseInt(_0x3c2d21(0xba))/0x4*(-parseInt(_0x3c2d21(0xab))/0x5)+-parseInt(_0x3c2d21(0xa9))/0x6+-parseInt(_0x3c2d21(0xd7))/0x7+parseInt(_0x3c2d21(0x93))/0x8+-parseInt(_0x3c2d21(0xff))/0x9;if(_0x24e4e6===_0x4d7923)break;else _0xa6fd21['push'](_0xa6fd21['shift']());}catch(_0x34d0ff){_0xa6fd21['push'](_0xa6fd21['shift']());}}}(_0x28d0,0xe5eae));import{InstancePoolError as _0x313aff,createGenericKeyedInstancePool as _0x36e515}from'@univer-cli/generic-keyed-instance-pool';import{CollaborationRuntimeError as _0x381d05}from'@univer-cli/univer-collaboration-runtime';import{fork as _0x4cb686}from'node:child_process';import{dirname as _0x2fd8da,extname as _0x39a1bb,join as _0xda19bf}from'node:path';import{fileURLToPath as _0xd44346}from'node:url';var c=class extends Error{[_0x974b1b(0x116)];[_0x974b1b(0x10f)];constructor(_0x3c1691,_0x126dfb,_0x4bd26e={}){const _0x1f4d7e=_0x974b1b;super(_0x126dfb,_0x4bd26e),this[_0x1f4d7e(0xd2)]=_0x1f4d7e(0xe0),this[_0x1f4d7e(0x116)]=_0x3c1691,this[_0x1f4d7e(0x10f)]=_0x4bd26e[_0x1f4d7e(0x10f)]??!0x1;}};async function l(_0x20aee6){const _0x33ee00=_0x974b1b;let _0x7023d6=_0xd44346(import.meta.url),_0x5aa7fe=_0x2fd8da(_0x7023d6),_0x523d3d=_0xda19bf(_0x5aa7fe,_0x39a1bb(_0x7023d6)===_0x33ee00(0xb5)?_0x33ee00(0x9a):_0x33ee00(0xd3)),_0x506954=u(_0x4cb686(_0x523d3d,[],{..._0x20aee6[_0x33ee00(0x99)]===void 0x0?{}:{'env':_0x20aee6[_0x33ee00(0x99)]},'serialization':_0x33ee00(0xeb),'stdio':[_0x33ee00(0xdf),'ignore',_0x33ee00(0xdf),_0x33ee00(0xe3)]}),_0x20aee6['key']);try{let _0x5ad730=d(await _0x506954['request']({'entry':_0x20aee6[_0x33ee00(0xb3)],'id':_0x506954['nextId'](),'init':_0x20aee6['init'],'type':_0x33ee00(0xb0)},_0x20aee6[_0x33ee00(0xa8)],_0x33ee00(0xb6))),_0x1850d8,_0x2b8c79=async _0x56ddc6=>await _0x506954[_0x33ee00(0xa5)]({..._0x56ddc6,'id':_0x506954[_0x33ee00(0x8b)]()},_0x20aee6['operationTimeoutMs']);return{..._0x5ad730,async 'close'(){const _0x53c59a=_0x33ee00;_0x1850d8??=_0x506954[_0x53c59a(0xda)](),await _0x1850d8;},async 'getState'(){const _0x3dfe6b=_0x33ee00;return f(await _0x2b8c79({'type':_0x3dfe6b(0xef)}));},async 'getPendingMutations'(){const _0x370c2a=_0x33ee00;let _0x146ee0=await _0x2b8c79({'type':_0x370c2a(0x96)});if(!C(_0x146ee0))throw _(_0x370c2a(0x118));return _0x146ee0;},async 'executeReadCode'(_0x508732){const _0x28590a=_0x33ee00;let _0x5c7c9c=p(await _0x2b8c79({'code':_0x508732,'type':'execute-read'}));if(!(_0x28590a(0x98)in _0x5c7c9c)||!w(_0x5c7c9c[_0x28590a(0x98)]))throw _(_0x28590a(0xde));return _0x5c7c9c;},async 'executeWriteCode'(_0x2e7db5){const _0x523051=_0x33ee00;let _0x3e88b9=p(await _0x2b8c79({'code':_0x2e7db5,'type':_0x523051(0xcb)}));if(!w(_0x3e88b9[_0x523051(0x98)])||!C(_0x3e88b9[_0x523051(0xe9)]))throw _('Worker\x20returned\x20an\x20invalid\x20write\x20result');return _0x3e88b9;},async 'replacePendingMutations'(_0x2b2cb3){const _0x4d7773=_0x33ee00;let _0x3e9e8a=p(await _0x2b8c79({'mutations':_0x2b2cb3,'type':_0x4d7773(0xd4)}));if(!T(_0x3e9e8a[_0x4d7773(0x109)])||!T(_0x3e9e8a[_0x4d7773(0x9b)]))throw _('Worker\x20returned\x20an\x20invalid\x20mutation\x20replacement\x20result');return _0x3e9e8a;},async 'fetch'(){const _0xd4285e=_0x33ee00;return m(await _0x2b8c79({'type':_0xd4285e(0xcd)}),[_0xd4285e(0xc8),'fetched']);},async 'pull'(){const _0x5c67d0=_0x33ee00;return m(await _0x2b8c79({'type':'pull'}),[_0x5c67d0(0x107),_0x5c67d0(0xed),_0x5c67d0(0xf7)]);},async 'commit'(){const _0x395131=_0x33ee00;return m(await _0x2b8c79({'type':_0x395131(0x9f)}),[_0x395131(0xce),_0x395131(0xfd),_0x395131(0x8d),_0x395131(0xe7),_0x395131(0xa3),_0x395131(0xf7)]);},async 'exportUnitData'(){const _0x4d2364=_0x33ee00;let _0x20669c=await _0x2b8c79({'type':_0x4d2364(0x108)});if(!E(_0x20669c))throw _(_0x4d2364(0xd8));return _0x20669c;}};}catch(_0x50198a){throw await _0x506954[_0x33ee00(0xda)](),_0x50198a;}}function u(_0x5e4eed,_0x2b47c5){const _0x7a5d26=_0x974b1b;let _0x494dc=new Map(),_0x1cf736=0x0,_0x580ced,_0x25461c=!0x1,_0x17d159,_0x3a4795,_0x3d9278=new Promise(_0x3c6aac=>{_0x3a4795=_0x3c6aac;});return _0x5e4eed['on']('message',_0x2ecc13=>{const _0x1a471f=_0x27b6;if(!v(_0x2ecc13))return;let _0x1f1490=_0x494dc[_0x1a471f(0x9d)](_0x2ecc13['id']);_0x1f1490&&(_0x494dc[_0x1a471f(0xec)](_0x2ecc13['id']),_0x1f1490[_0x1a471f(0x101)]&&clearTimeout(_0x1f1490[_0x1a471f(0x101)]),_0x2ecc13[_0x1a471f(0x10c)]===_0x1a471f(0xac)?_0x1f1490[_0x1a471f(0xe8)](h(_0x2ecc13[_0x1a471f(0xac)])):_0x1f1490[_0x1a471f(0xf1)](_0x2ecc13['result']));}),_0x5e4eed['on'](_0x7a5d26(0xac),_0x25b501=>_0xad94c2(g(_0x7a5d26(0xf6)+_0x2b47c5+_0x7a5d26(0xf2)+_0x25b501[_0x7a5d26(0x11a)],_0x25b501))),_0x5e4eed['on'](_0x7a5d26(0xdc),(_0xef32e,_0x2bf4a9)=>{const _0xda12a8=_0x7a5d26;_0x25461c||_0xad94c2(g(_0xda12a8(0xf6)+_0x2b47c5+_0xda12a8(0xf3)+(_0x2bf4a9?_0xda12a8(0xbc)+_0x2bf4a9:_0xda12a8(0xe5)+String(_0xef32e))));}),_0x5e4eed['on'](_0x7a5d26(0xda),()=>_0x3a4795()),{async 'close'(){if(_0x17d159)return await _0x17d159;_0x17d159=_0x2c9998(),await _0x17d159;},'nextId'(){return++_0x1cf736;},async 'request'(_0x424c41,_0x3fd960,_0x1ac87c=_0x7a5d26(0x90)){if(_0x580ced)throw _0x580ced;return await new Promise((_0x5cbc43,_0x45e0ed)=>{const _0x30d380=_0x27b6;let _0x3e5635={'reject':_0x45e0ed,'resolve':_0x5cbc43,'timer':setTimeout(()=>{_0xad94c2(new c(_0x1ac87c,'Collaboration\x20worker\x20'+_0x2b47c5+'\x20timed\x20out\x20after\x20'+_0x3fd960+'ms',{'invalidatesInstance':!0x0})),_0x4cdf20();},_0x3fd960)};_0x494dc['set'](_0x424c41['id'],_0x3e5635),_0x5e4eed[_0x30d380(0xe1)](_0x424c41,_0x2167d8=>{const _0x39c21c=_0x30d380;_0x2167d8&&_0xad94c2(g(_0x39c21c(0xdb)+_0x2b47c5,_0x2167d8));});});}};async function _0x2c9998(){const _0x53ccfc=_0x7a5d26;if(_0x25461c=!0x0,!_0x580ced&&_0x5e4eed[_0x53ccfc(0xcf)])try{await Promise[_0x53ccfc(0x110)]([new Promise((_0x26d621,_0x1e8741)=>{const _0x1d785b=_0x53ccfc;let _0x5eb685=++_0x1cf736;_0x494dc[_0x1d785b(0xbe)](_0x5eb685,{'reject':_0x1e8741,'resolve':_0x26d621}),_0x5e4eed[_0x1d785b(0xe1)]({'id':_0x5eb685,'type':_0x1d785b(0xda)},_0x249ff2=>{_0x249ff2&&_0x1e8741(_0x249ff2);});}),new Promise((_0x358e69,_0x18d082)=>{const _0x1c25ef=_0x53ccfc;setTimeout(()=>_0x18d082(Error(_0x1c25ef(0xd5))),0x1388)[_0x1c25ef(0x11b)]();})]);}catch{}_0x4cdf20(),await _0x3d9278,_0xad94c2(new c(_0x53ccfc(0xd1),'Collaboration\x20worker\x20'+_0x2b47c5+'\x20is\x20closed',{'invalidatesInstance':!0x0}));}function _0xad94c2(_0x508c57){const _0x544222=_0x7a5d26;_0x580ced??=_0x508c57;for(let _0x4b1646 of _0x494dc['values']())_0x4b1646[_0x544222(0x101)]&&clearTimeout(_0x4b1646['timer']),_0x4b1646[_0x544222(0xe8)](_0x580ced);_0x494dc['clear']();}function _0x4cdf20(){const _0x2beedf=_0x7a5d26;_0x5e4eed[_0x2beedf(0xa0)]===null&&_0x5e4eed[_0x2beedf(0xc2)]===null&&_0x5e4eed[_0x2beedf(0x113)]('SIGKILL');}}function d(_0x4acda7){const _0x2fb0f7=_0x974b1b;if(!E(_0x4acda7)||typeof _0x4acda7['unitId']!=_0x2fb0f7(0xc5)||!y(_0x4acda7[_0x2fb0f7(0xa1)]))throw _(_0x2fb0f7(0xf4));return{'unitId':_0x4acda7['unitId'],'unitType':_0x4acda7[_0x2fb0f7(0xa1)]};}function f(_0x46f8b9){const _0x8b7163=_0x974b1b;if(!E(_0x46f8b9)||!b(_0x46f8b9[_0x8b7163(0x115)])||!T(_0x46f8b9[_0x8b7163(0x11d)])||!T(_0x46f8b9[_0x8b7163(0x111)])||Number(_0x46f8b9[_0x8b7163(0x111)])<Number(_0x46f8b9[_0x8b7163(0x11d)])||!T(_0x46f8b9['pendingMutationCount'])||!T(_0x46f8b9[_0x8b7163(0xca)])||!x(_0x46f8b9[_0x8b7163(0xb8)])||!S(_0x46f8b9['conflict']))throw _(_0x8b7163(0xfa));return _0x46f8b9;}function p(_0x39cc1e){const _0x213151=_0x974b1b;if(!E(_0x39cc1e))throw _(_0x213151(0xae));return{..._0x39cc1e,'state':f(_0x39cc1e[_0x213151(0x105)])};}function m(_0x3199f3,_0x216af9){const _0x5087f2=_0x974b1b;let _0x3f0de3=p(_0x3199f3);if(typeof _0x3f0de3['status']!=_0x5087f2(0xc5)||!_0x216af9[_0x5087f2(0xa7)](_0x3f0de3['status']))throw _(_0x5087f2(0xa6));return _0x3f0de3;}function h(_0x4d5bea){const _0x5c453f=_0x974b1b;if(_0x4d5bea[_0x5c453f(0x116)]?.[_0x5c453f(0x92)](_0x5c453f(0xc0))&&!_0x4d5bea[_0x5c453f(0x116)]['startsWith'](_0x5c453f(0xe6))){let _0x48b251=new _0x381d05(_0x4d5bea[_0x5c453f(0x116)],_0x4d5bea[_0x5c453f(0x11a)],{'retryable':_0x4d5bea[_0x5c453f(0xb4)]??!0x1});return _0x4d5bea[_0x5c453f(0x95)]!==void 0x0&&(_0x48b251[_0x5c453f(0x95)]=_0x4d5bea[_0x5c453f(0x95)]),_0x4d5bea[_0x5c453f(0x10f)]&&Object[_0x5c453f(0x8c)](_0x48b251,{'invalidatesInstance':!0x0}),_0x48b251;}let _0x4e1993=Error(_0x4d5bea[_0x5c453f(0x11a)]);return _0x4e1993[_0x5c453f(0xd2)]=_0x4d5bea[_0x5c453f(0xd2)],_0x4d5bea[_0x5c453f(0x116)]!==void 0x0&&Object[_0x5c453f(0x8c)](_0x4e1993,{'code':_0x4d5bea[_0x5c453f(0x116)]}),_0x4d5bea['invalidatesInstance']&&Object[_0x5c453f(0x8c)](_0x4e1993,{'invalidatesInstance':!0x0}),_0x4d5bea[_0x5c453f(0x95)]!==void 0x0&&(_0x4e1993[_0x5c453f(0x95)]=_0x4d5bea[_0x5c453f(0x95)]),_0x4e1993;}function _0x28d0(){const _0x35ed4f=['get-state','executeReadCode','resolve','\x20failed:\x20','\x20exited\x20unexpectedly\x20with\x20','Worker\x20returned\x20invalid\x20collaboration\x20runtime\x20metadata','INSTANCE_POOL_CLOSED','Worker\x20','conflict','href','every','Worker\x20returned\x20invalid\x20collaboration\x20runtime\x20state','isArray','UNKNOWN','pull-required','operationTimeoutMs','31194351PTDTKW','operation','timer','mode','write','length','state','offline','up-to-date','export','previousMutationCount','now','reconnecting','type','mutationCount','1788887zRaqmf','invalidatesInstance','race','knownHeadRevision','COLLABORATION_LEASE_CLOSED','kill','values','connection','code','pull','Worker\x20returned\x20invalid\x20pending\x20mutations','isSafeInteger','message','unref','revision','baseRevision','nextId','assign','confirmed','reqId','entry\x20must\x20be\x20an\x20absolute\x20file\x20URL\x20or\x20another\x20importable\x20URL','COLLABORATION_WORKER_OPERATION_TIMEOUT','\x20is\x20closed','startsWith','6040912iGJLMg','21uuKzDF','stack','get-pending-mutations','COLLABORATION_POOL_CAPACITY_EXCEEDED','value','env','worker-child.ts','pendingMutationCount','number','get','cache','commit','exitCode','unitType','online','unknown','permission-rejected','request','Worker\x20returned\x20an\x20invalid\x20operation\x20status','includes','openTimeoutMs','173262RNGCcb','changeset-rejected','828560UWvtEG','error','reason','Worker\x20returned\x20an\x20invalid\x20operation\x20result','unitId','open','entry\x20must\x20not\x20be\x20empty','read','entry','retryable','.ts','COLLABORATION_WORKER_OPEN_TIMEOUT','\x20must\x20be\x20a\x20finite\x20positive\x20number','awaitingChangeset','COLLABORATION_WORKER_CRASHED','28jGojgb','COLLABORATION_LOAD_FAILED','signal\x20','result','set','object','COLLABORATION_','COLLABORATION_WORKER_PROTOCOL_ERROR','signalCode','replacePendingMutations','release','string','358040PlkzKb','key','unchanged','instance','bufferedChangesetCount','execute-write','isFinite','fetch','nothing-to-commit','connected','invalidate','COLLABORATION_WORKER_CLOSED','name','worker-child.mjs','replace-mutations','Worker\x20close\x20timed\x20out','acquire','3643269RvcouY','Worker\x20returned\x20invalid\x20UnitData','instance-failed','close','Failed\x20to\x20send\x20a\x20request\x20to\x20worker\x20','exit','sid','Worker\x20returned\x20an\x20invalid\x20read\x20value','ignore','UniverCollaborationRuntimePoolError','send','pending-mutations','ipc','COLLABORATION_POOL_INVALID_INPUT','exit\x20code\x20','COLLABORATION_WORKER_','retry','reject','mutations','COLLABORATION_CLOSED','advanced','delete','pulled','boolean'];_0x28d0=function(){return _0x35ed4f;};return _0x28d0();}function g(_0x42a483,_0x5ab9a5){const _0x116a88=_0x974b1b;return new c(_0x116a88(0xb9),_0x42a483,{..._0x5ab9a5===void 0x0?{}:{'cause':_0x5ab9a5},'invalidatesInstance':!0x0});}function _(_0x530327){const _0x34696b=_0x974b1b;return new c(_0x34696b(0xc1),_0x530327,{'invalidatesInstance':!0x0});}function v(_0x4d6d4b){const _0x37e56c=_0x974b1b;return E(_0x4d6d4b)&&Number[_0x37e56c(0x119)](_0x4d6d4b['id'])&&(_0x4d6d4b[_0x37e56c(0x10c)]===_0x37e56c(0xbd)||_0x4d6d4b[_0x37e56c(0x10c)]===_0x37e56c(0xac));}function y(_0x33e590){return _0x33e590===0x1||_0x33e590===0x2||_0x33e590===0x3||_0x33e590===0x5||_0x33e590===0x6;}function b(_0x5bf778){const _0x4015e7=_0x974b1b;return _0x5bf778===_0x4015e7(0xa2)||_0x5bf778===_0x4015e7(0x10b)||_0x5bf778===_0x4015e7(0x106)||_0x5bf778==='closed';}function x(_0x2c2772){const _0x59bbde=_0x974b1b;return _0x2c2772===null||E(_0x2c2772)&&T(_0x2c2772[_0x59bbde(0x11d)])&&T(_0x2c2772[_0x59bbde(0x11c)])&&T(_0x2c2772[_0x59bbde(0x10d)])&&(_0x2c2772[_0x59bbde(0xdd)]===void 0x0||typeof _0x2c2772[_0x59bbde(0xdd)]==_0x59bbde(0xc5))&&(_0x2c2772[_0x59bbde(0x8e)]===void 0x0||T(_0x2c2772[_0x59bbde(0x8e)]));}function S(_0x2f6e4f){const _0x17266e=_0x974b1b;return _0x2f6e4f===null||E(_0x2f6e4f)&&(_0x2f6e4f[_0x17266e(0x100)]===_0x17266e(0x117)||_0x2f6e4f['operation']===_0x17266e(0x9f))&&(_0x2f6e4f[_0x17266e(0xad)]==='transform-failed'||_0x2f6e4f[_0x17266e(0xad)]===_0x17266e(0xaa)||_0x2f6e4f[_0x17266e(0xad)]===_0x17266e(0xa4))&&typeof _0x2f6e4f['message']==_0x17266e(0xc5);}function C(_0x28ad69){const _0x54eb7c=_0x974b1b;return Array[_0x54eb7c(0xfb)](_0x28ad69)&&_0x28ad69[_0x54eb7c(0xf9)](_0x4c94a3=>E(_0x4c94a3)&&typeof _0x4c94a3['id']==_0x54eb7c(0xc5)&&_0x4c94a3['id'][_0x54eb7c(0x104)]>0x0&&typeof _0x4c94a3['data']=='string');}function w(_0x1d4326){const _0x24cd87=_0x974b1b;return _0x1d4326===null||typeof _0x1d4326==_0x24cd87(0xee)||typeof _0x1d4326==_0x24cd87(0xc5)||typeof _0x1d4326==_0x24cd87(0x9c)&&Number['isFinite'](_0x1d4326)?!0x0:Array['isArray'](_0x1d4326)?_0x1d4326[_0x24cd87(0xf9)](w):E(_0x1d4326)&&Object[_0x24cd87(0x114)](_0x1d4326)['every'](w);}function T(_0x49990f){const _0x18a029=_0x974b1b;return Number[_0x18a029(0x119)](_0x49990f)&&Number(_0x49990f)>=0x0;}function E(_0x2fd79c){const _0x22d05f=_0x974b1b;return typeof _0x2fd79c=='object'&&!!_0x2fd79c&&!Array[_0x22d05f(0xfb)](_0x2fd79c);}function _0x27b6(_0x175dbe,_0x4246b3){_0x175dbe=_0x175dbe-0x8b;const _0x28d07c=_0x28d0();let _0x27b6fa=_0x28d07c[_0x175dbe];return _0x27b6fa;}var D=0x7530,O=0x7530;function k(_0x2b308f){const _0x3a2ab0=_0x974b1b;let _0x3e715f=A(_0x2b308f[_0x3a2ab0(0xb3)]),_0x3a2c80=_0x2b308f[_0x3a2ab0(0xa8)]??D,_0x40b07a=_0x2b308f[_0x3a2ab0(0xfe)]??O;j(_0x3a2c80,_0x3a2ab0(0xa8)),j(_0x40b07a,_0x3a2ab0(0xfe));let _0x3487a4;try{_0x3487a4=_0x36e515({'factory':{async 'create'(_0x36dbd3){const _0x3e8dbc=_0x3a2ab0;return await l({'entry':_0x3e715f,..._0x2b308f[_0x3e8dbc(0x99)]===void 0x0?{}:{'env':_0x2b308f[_0x3e8dbc(0x99)]},'init':_0x36dbd3['init'],'key':_0x36dbd3['key'],'openTimeoutMs':_0x3a2c80,'operationTimeoutMs':_0x40b07a});},async 'destroy'({instance:_0x4969ac}){const _0x453add=_0x3a2ab0;await _0x4969ac[_0x453add(0xda)]();}},..._0x2b308f[_0x3a2ab0(0x9e)]===void 0x0?{}:{'cache':_0x2b308f[_0x3a2ab0(0x9e)]},'onEvent':_0x1872bd});}catch(_0x498fc0){throw M(_0x498fc0);}return{async 'acquire'(_0x34bd96){const _0x55c4c3=_0x3a2ab0;let _0x4b80b4;try{_0x4b80b4=await _0x3487a4[_0x55c4c3(0xd6)](_0x34bd96);}catch(_0x151315){throw M(_0x151315);}return _0x1ed710(_0x4b80b4);},async 'close'(){const _0x217a44=_0x3a2ab0;try{await _0x3487a4[_0x217a44(0xda)]();}catch(_0x4b9e58){throw M(_0x4b9e58);}}};function _0x1ed710(_0x5f18b6){const _0x3e0a6e=_0x3a2ab0;let _0x380c7a=_0x5f18b6[_0x3e0a6e(0xc9)],_0x1f5c2b=!0x1,_0x5786ae,_0x2ea509=!0x1;return{'key':_0x5f18b6[_0x3e0a6e(0xc7)],'unitId':_0x380c7a[_0x3e0a6e(0xaf)],'unitType':_0x380c7a[_0x3e0a6e(0xa1)],async 'getState'(){const _0x903139=_0x3e0a6e;return await _0x57e949(_0x903139(0x105),async()=>await _0x380c7a['getState']());},async 'getPendingMutations'(){const _0xa969ef=_0x3e0a6e;return await _0x57e949(_0xa969ef(0xe2),async()=>await _0x380c7a['getPendingMutations']());},async 'execute'(_0xf8198c){const _0x5aa715=_0x3e0a6e;return _0xf8198c[_0x5aa715(0x102)]===_0x5aa715(0xb2)?await _0x57e949(_0x5aa715(0xb2),async()=>await _0x380c7a[_0x5aa715(0xf0)](_0xf8198c['code'])):await _0x57e949(_0x5aa715(0x103),async()=>await _0x380c7a['executeWriteCode'](_0xf8198c[_0x5aa715(0x116)]));},async 'replacePendingMutations'(_0x29228e){const _0x1571bd=_0x3e0a6e;return await _0x57e949(_0x1571bd(0xd4),async()=>await _0x380c7a[_0x1571bd(0xc3)](_0x29228e));},async 'fetch'(){const _0x1ae01c=_0x3e0a6e;return await _0x57e949('fetch',async()=>await _0x380c7a[_0x1ae01c(0xcd)]());},async 'pull'(){const _0x4d28d4=_0x3e0a6e;return await _0x57e949(_0x4d28d4(0x117),async()=>await _0x380c7a[_0x4d28d4(0x117)]());},async 'commit'(){const _0x487f8d=_0x3e0a6e;return await _0x57e949(_0x487f8d(0x9f),async()=>await _0x380c7a[_0x487f8d(0x9f)]());},async 'exportUnitData'(){const _0xf3cb04=_0x3e0a6e;return await _0x57e949(_0xf3cb04(0x108),async()=>await _0x380c7a['exportUnitData']());},async 'invalidate'(){const _0x3ed67f=_0x3e0a6e;_0x1f5c2b||(_0x1f5c2b=!0x0,await _0x5f18b6[_0x3ed67f(0xd0)]());},async 'release'(){const _0x3536f4=_0x3e0a6e;_0x1f5c2b||(_0x1f5c2b=!0x0,_0x2ea509?await _0x5f18b6['invalidate']():await _0x5f18b6[_0x3536f4(0xc4)]());}};async function _0x57e949(_0x26b74e,_0x40240d){const _0x4c0994=_0x3e0a6e;_0x17cb17();try{return await _0x2098dc(_0x5f18b6[_0x4c0994(0xc7)],_0x26b74e,_0x40240d);}catch(_0x2b0bb9){throw _0xe8c841(_0x2b0bb9),_0x2b0bb9;}}function _0x17cb17(){const _0x4c7a11=_0x3e0a6e;if(_0x1f5c2b)throw new c(_0x4c7a11(0x112),'Collaboration\x20runtime\x20lease\x20'+_0x5f18b6['key']+_0x4c7a11(0x91));if(_0x5786ae)throw _0x5786ae;}function _0xe8c841(_0x3b2b8f){const _0x2c50c0=_0x3e0a6e;(_0x3b2b8f instanceof c&&_0x3b2b8f[_0x2c50c0(0x10f)]||_0x3b2b8f instanceof _0x381d05&&(_0x3b2b8f[_0x2c50c0(0x116)]==='COLLABORATION_PROTOCOL_ERROR'||_0x3b2b8f[_0x2c50c0(0x116)]===_0x2c50c0(0xea)||_0x3b2b8f[_0x2c50c0(0x116)]===_0x2c50c0(0xbb))||typeof _0x3b2b8f==_0x2c50c0(0xbf)&&_0x3b2b8f&&'invalidatesInstance'in _0x3b2b8f&&_0x3b2b8f[_0x2c50c0(0x10f)]===!0x0)&&(_0x2ea509=!0x0,_0x5786ae=_0x3b2b8f,_0x32ec32({'errorCode':N(_0x3b2b8f),'key':_0x5f18b6['key'],'type':_0x2c50c0(0xd9)}));}}async function _0x2098dc(_0x4a4c72,_0x4ef015,_0xa14811){const _0x150993=_0x3a2ab0;let _0x3ed876=Date['now'](),_0x1ea65a=await _0xa14811();return _0x32ec32({'durationMs':Date[_0x150993(0x10a)]()-_0x3ed876,'key':_0x4a4c72,'operation':_0x4ef015,'type':'operation-complete'}),_0x1ea65a;}function _0x1872bd(_0x168f96){_0x32ec32(_0x168f96);}function _0x32ec32(_0x510bdf){try{_0x2b308f['onEvent']?.(_0x510bdf);}catch{}}}function A(_0x248b65){const _0x40a710=_0x974b1b;let _0x149dcb=_0x248b65 instanceof URL?_0x248b65[_0x40a710(0xf8)]:_0x248b65;if(_0x149dcb['length']===0x0)throw new c(_0x40a710(0xe4),_0x40a710(0xb1));try{return new URL(_0x149dcb)['href'];}catch{throw new c(_0x40a710(0xe4),_0x40a710(0x8f));}}function j(_0x163c10,_0x56db87){const _0x4189c9=_0x974b1b;if(!Number[_0x4189c9(0xcc)](_0x163c10)||_0x163c10<=0x0)throw new c(_0x4189c9(0xe4),_0x56db87+_0x4189c9(0xb7));}function M(_0x4167af){const _0x17d0ef=_0x974b1b;return _0x4167af instanceof _0x313aff?new c(_0x4167af['code']==='INSTANCE_POOL_CAPACITY_EXCEEDED'?_0x17d0ef(0x97):_0x4167af['code']===_0x17d0ef(0xf5)?'COLLABORATION_POOL_CLOSED':_0x17d0ef(0xe4),_0x4167af['message'],{'cause':_0x4167af}):_0x4167af;}function N(_0x3b9146){const _0x4fb4f0=_0x974b1b;return typeof _0x3b9146==_0x4fb4f0(0xbf)&&_0x3b9146&&_0x4fb4f0(0x116)in _0x3b9146&&typeof _0x3b9146['code']=='string'?_0x3b9146[_0x4fb4f0(0x116)]:_0x4fb4f0(0xfc);}function P(_0x39e1c4){return _0x39e1c4;}export{c as UniverCollaborationRuntimePoolError,k as createUniverCollaborationRuntimePool,P as defineUniverCollaborationRuntimeWorker};
|
|
1
|
+
const _0x455690=_0x3990;(function(_0x2d8cb9,_0x49c740){const _0x5c9bae=_0x3990,_0x41a0cb=_0x2d8cb9();while(!![]){try{const _0xc10cd5=parseInt(_0x5c9bae(0xfa))/0x1+parseInt(_0x5c9bae(0xd9))/0x2*(-parseInt(_0x5c9bae(0x111))/0x3)+parseInt(_0x5c9bae(0xea))/0x4+-parseInt(_0x5c9bae(0xce))/0x5*(parseInt(_0x5c9bae(0xc9))/0x6)+parseInt(_0x5c9bae(0xb1))/0x7*(-parseInt(_0x5c9bae(0xa5))/0x8)+parseInt(_0x5c9bae(0xb9))/0x9+parseInt(_0x5c9bae(0x107))/0xa*(parseInt(_0x5c9bae(0x8a))/0xb);if(_0xc10cd5===_0x49c740)break;else _0x41a0cb['push'](_0x41a0cb['shift']());}catch(_0x145187){_0x41a0cb['push'](_0x41a0cb['shift']());}}}(_0x47ac,0xe6858));import{InstancePoolError as _0x864955,createGenericKeyedInstancePool as _0x1d77f1}from'@univer-cli/generic-keyed-instance-pool';import{CollaborationRuntimeError as _0x30582d}from'@univer-cli/univer-collaboration-runtime';import{fork as _0x4a2718}from'node:child_process';import{dirname as _0x693c81,extname as _0x36529f,join as _0x2fdb3c}from'node:path';import{fileURLToPath as _0x1cf822}from'node:url';var c=class extends Error{[_0x455690(0x101)];[_0x455690(0xd5)];constructor(_0x4601a5,_0x3d8d98,_0x2bf840={}){const _0xc19628=_0x455690;super(_0x3d8d98,_0x2bf840),this[_0xc19628(0xd6)]=_0xc19628(0x105),this[_0xc19628(0x101)]=_0x4601a5,this[_0xc19628(0xd5)]=_0x2bf840[_0xc19628(0xd5)]??!0x1;}};async function l(_0x126685){const _0x641816=_0x455690;let _0x4e194f=_0x1cf822(import.meta.url),_0x71c089=_0x693c81(_0x4e194f),_0x3f9316=_0x2fdb3c(_0x71c089,_0x36529f(_0x4e194f)===_0x641816(0xef)?_0x641816(0x93):_0x641816(0xf8)),_0xd497ab=u(_0x4a2718(_0x3f9316,[],{..._0x126685[_0x641816(0x10d)]===void 0x0?{}:{'env':_0x126685[_0x641816(0x10d)]},'serialization':_0x641816(0x9b),'stdio':['ignore',_0x641816(0xc4),_0x641816(0xc4),_0x641816(0xe2)]}),_0x126685[_0x641816(0xb0)]);try{let _0x30a0a5=d(await _0xd497ab[_0x641816(0x114)]({'entry':_0x126685[_0x641816(0xff)],'id':_0xd497ab[_0x641816(0xfb)](),'init':_0x126685[_0x641816(0xe0)],'type':_0x641816(0x10b)},_0x126685['openTimeoutMs'],_0x641816(0xa7))),_0x21c10c,_0x1a1007=async _0x178f98=>await _0xd497ab[_0x641816(0x114)]({..._0x178f98,'id':_0xd497ab[_0x641816(0xfb)]()},_0x126685[_0x641816(0xe8)]);return{..._0x30a0a5,async 'close'(){const _0xb72170=_0x641816;_0x21c10c??=_0xd497ab[_0xb72170(0xc2)](),await _0x21c10c;},async 'getState'(){const _0x2b85ed=_0x641816;return f(await _0x1a1007({'type':_0x2b85ed(0xa4)}));},async 'getPendingMutations'(){let _0x1de10e=await _0x1a1007({'type':'get-pending-mutations'});if(!C(_0x1de10e))throw _('Worker\x20returned\x20invalid\x20pending\x20mutations');return _0x1de10e;},async 'executeReadCode'(_0x29af62){const _0x13db90=_0x641816;let _0x5015fe=p(await _0x1a1007({'code':_0x29af62,'type':'execute-read'}));if(!(_0x13db90(0x94)in _0x5015fe)||!w(_0x5015fe[_0x13db90(0x94)]))throw _(_0x13db90(0x98));return _0x5015fe;},async 'executeWriteCode'(_0x37325e){const _0x4e09c6=_0x641816;let _0x1e14a2=p(await _0x1a1007({'code':_0x37325e,'type':_0x4e09c6(0xed)}));if(!w(_0x1e14a2['value'])||!C(_0x1e14a2[_0x4e09c6(0x106)]))throw _(_0x4e09c6(0x10f));return _0x1e14a2;},async 'replacePendingMutations'(_0x9d16a3){const _0x4b65a0=_0x641816;let _0x3a46f9=p(await _0x1a1007({'mutations':_0x9d16a3,'type':_0x4b65a0(0xdb)}));if(!T(_0x3a46f9[_0x4b65a0(0x9c)])||!T(_0x3a46f9[_0x4b65a0(0xa3)]))throw _(_0x4b65a0(0xf5));return _0x3a46f9;},async 'fetch'(){const _0x300673=_0x641816;return m(await _0x1a1007({'type':'fetch'}),[_0x300673(0xe4),'fetched']);},async 'pull'(){const _0x573567=_0x641816;return m(await _0x1a1007({'type':_0x573567(0x10e)}),[_0x573567(0xc1),_0x573567(0xe9),_0x573567(0xdd)]);},async 'commit'(){const _0x12f1b9=_0x641816;return m(await _0x1a1007({'type':_0x12f1b9(0xd2)}),['nothing-to-commit',_0x12f1b9(0xad),_0x12f1b9(0xf6),_0x12f1b9(0xca),'unknown',_0x12f1b9(0xdd)]);},async 'exportUnitData'(){const _0x309997=_0x641816;let _0x2a17f6=await _0x1a1007({'type':_0x309997(0xbe)});if(!E(_0x2a17f6))throw _(_0x309997(0xcd));return _0x2a17f6;}};}catch(_0x3d6101){throw await _0xd497ab['close'](),_0x3d6101;}}function u(_0x299888,_0x4f1b6e){const _0xe13c1d=_0x455690;let _0x120168=new Map(),_0x3df1e8=0x0,_0x873725,_0x419621=!0x1,_0x38fee1,_0x1a34d1,_0x3ee572=new Promise(_0x3ec7cb=>{_0x1a34d1=_0x3ec7cb;});return _0x299888['on']('message',_0x2b1fd9=>{const _0x227a71=_0x3990;if(!v(_0x2b1fd9))return;let _0x12ac6c=_0x120168[_0x227a71(0xc3)](_0x2b1fd9['id']);_0x12ac6c&&(_0x120168[_0x227a71(0x110)](_0x2b1fd9['id']),_0x12ac6c[_0x227a71(0x88)]&&clearTimeout(_0x12ac6c[_0x227a71(0x88)]),_0x2b1fd9['type']===_0x227a71(0x100)?_0x12ac6c[_0x227a71(0xa0)](h(_0x2b1fd9[_0x227a71(0x100)])):_0x12ac6c['resolve'](_0x2b1fd9['result']));}),_0x299888['on']('error',_0x247829=>_0x20f523(g(_0xe13c1d(0x9f)+_0x4f1b6e+_0xe13c1d(0xaf)+_0x247829[_0xe13c1d(0xac)],_0x247829))),_0x299888['on'](_0xe13c1d(0xf9),(_0x58eb7b,_0x3f4b84)=>{const _0x4f3b9d=_0xe13c1d;_0x419621||_0x20f523(g('Worker\x20'+_0x4f1b6e+'\x20exited\x20unexpectedly\x20with\x20'+(_0x3f4b84?_0x4f3b9d(0xf4)+_0x3f4b84:_0x4f3b9d(0x9e)+String(_0x58eb7b))));}),_0x299888['on']('close',()=>_0x1a34d1()),{async 'close'(){if(_0x38fee1)return await _0x38fee1;_0x38fee1=_0x42ca7c(),await _0x38fee1;},'nextId'(){return++_0x3df1e8;},async 'request'(_0x4ef1bc,_0x513ea9,_0x2743e1='COLLABORATION_WORKER_OPERATION_TIMEOUT'){if(_0x873725)throw _0x873725;return await new Promise((_0x3513e8,_0x1d5f67)=>{const _0x4d4696=_0x3990;let _0xa9349a={'reject':_0x1d5f67,'resolve':_0x3513e8,'timer':setTimeout(()=>{const _0x1cd96b=_0x3990;_0x20f523(new c(_0x2743e1,_0x1cd96b(0xd4)+_0x4f1b6e+'\x20timed\x20out\x20after\x20'+_0x513ea9+'ms',{'invalidatesInstance':!0x0})),_0xa84d87();},_0x513ea9)};_0x120168[_0x4d4696(0xc5)](_0x4ef1bc['id'],_0xa9349a),_0x299888[_0x4d4696(0xb6)](_0x4ef1bc,_0x5c20a8=>{const _0x4d14bf=_0x4d4696;_0x5c20a8&&_0x20f523(g(_0x4d14bf(0xaa)+_0x4f1b6e,_0x5c20a8));});});}};async function _0x42ca7c(){const _0x4faaa0=_0xe13c1d;if(_0x419621=!0x0,!_0x873725&&_0x299888['connected'])try{await Promise[_0x4faaa0(0xd7)]([new Promise((_0x456433,_0x2c6247)=>{const _0x22c4f2=_0x4faaa0;let _0x23ea16=++_0x3df1e8;_0x120168['set'](_0x23ea16,{'reject':_0x2c6247,'resolve':_0x456433}),_0x299888[_0x22c4f2(0xb6)]({'id':_0x23ea16,'type':_0x22c4f2(0xc2)},_0x18618f=>{_0x18618f&&_0x2c6247(_0x18618f);});}),new Promise((_0x58315f,_0x3a54d3)=>{const _0xe83ed7=_0x4faaa0;setTimeout(()=>_0x3a54d3(Error('Worker\x20close\x20timed\x20out')),0x1388)[_0xe83ed7(0xfd)]();})]);}catch{}_0xa84d87(),await _0x3ee572,_0x20f523(new c(_0x4faaa0(0x109),_0x4faaa0(0xd4)+_0x4f1b6e+'\x20is\x20closed',{'invalidatesInstance':!0x0}));}function _0x20f523(_0x15dcad){const _0x1e74b1=_0xe13c1d;_0x873725??=_0x15dcad;for(let _0xa59e5d of _0x120168[_0x1e74b1(0xd8)]())_0xa59e5d[_0x1e74b1(0x88)]&&clearTimeout(_0xa59e5d[_0x1e74b1(0x88)]),_0xa59e5d['reject'](_0x873725);_0x120168[_0x1e74b1(0xf2)]();}function _0xa84d87(){const _0x2d46ef=_0xe13c1d;_0x299888['exitCode']===null&&_0x299888['signalCode']===null&&_0x299888[_0x2d46ef(0xeb)](_0x2d46ef(0x108));}}function d(_0x2b2137){const _0x20d388=_0x455690;if(!E(_0x2b2137)||typeof _0x2b2137[_0x20d388(0xae)]!=_0x20d388(0xdc)||!y(_0x2b2137[_0x20d388(0x104)]))throw _(_0x20d388(0xda));return{'unitId':_0x2b2137['unitId'],'unitType':_0x2b2137[_0x20d388(0x104)]};}function f(_0x166f93){const _0x3df691=_0x455690;if(!E(_0x166f93)||!b(_0x166f93[_0x3df691(0x90)])||!T(_0x166f93[_0x3df691(0xbc)])||!T(_0x166f93[_0x3df691(0x112)])||Number(_0x166f93['knownHeadRevision'])<Number(_0x166f93['baseRevision'])||!T(_0x166f93[_0x3df691(0xa3)])||!T(_0x166f93[_0x3df691(0xf0)])||!x(_0x166f93[_0x3df691(0xcb)])||!S(_0x166f93['conflict']))throw _(_0x3df691(0xcc));return _0x166f93;}function p(_0x3a673d){const _0x154c02=_0x455690;if(!E(_0x3a673d))throw _(_0x154c02(0xa6));return{..._0x3a673d,'state':f(_0x3a673d[_0x154c02(0xab)])};}function m(_0x2fe84b,_0x1b83c1){const _0x526dfc=_0x455690;let _0x4a032c=p(_0x2fe84b);if(typeof _0x4a032c['status']!=_0x526dfc(0xdc)||!_0x1b83c1[_0x526dfc(0xe5)](_0x4a032c['status']))throw _(_0x526dfc(0xe3));return _0x4a032c;}function h(_0x13d7b2){const _0x3599e2=_0x455690;if(_0x13d7b2[_0x3599e2(0x101)]?.['startsWith'](_0x3599e2(0xb5))&&!_0x13d7b2[_0x3599e2(0x101)][_0x3599e2(0xe6)]('COLLABORATION_WORKER_')){let _0x419223=new _0x30582d(_0x13d7b2['code'],_0x13d7b2['message'],{'retryable':_0x13d7b2[_0x3599e2(0x96)]??!0x1});return _0x13d7b2['stack']!==void 0x0&&(_0x419223[_0x3599e2(0xa9)]=_0x13d7b2[_0x3599e2(0xa9)]),_0x13d7b2[_0x3599e2(0xd5)]&&Object[_0x3599e2(0x8f)](_0x419223,{'invalidatesInstance':!0x0}),_0x419223;}let _0x5b9223=Error(_0x13d7b2[_0x3599e2(0xac)]);return _0x5b9223[_0x3599e2(0xd6)]=_0x13d7b2[_0x3599e2(0xd6)],_0x13d7b2[_0x3599e2(0x101)]!==void 0x0&&Object[_0x3599e2(0x8f)](_0x5b9223,{'code':_0x13d7b2[_0x3599e2(0x101)]}),_0x13d7b2['invalidatesInstance']&&Object[_0x3599e2(0x8f)](_0x5b9223,{'invalidatesInstance':!0x0}),_0x13d7b2['stack']!==void 0x0&&(_0x5b9223[_0x3599e2(0xa9)]=_0x13d7b2[_0x3599e2(0xa9)]),_0x5b9223;}function g(_0x3a858f,_0x2c3dba){const _0x492ffc=_0x455690;return new c(_0x492ffc(0xa8),_0x3a858f,{..._0x2c3dba===void 0x0?{}:{'cause':_0x2c3dba},'invalidatesInstance':!0x0});}function _(_0x1234ba){const _0x1183cf=_0x455690;return new c(_0x1183cf(0x103),_0x1234ba,{'invalidatesInstance':!0x0});}function v(_0x507aaf){const _0x53058b=_0x455690;return E(_0x507aaf)&&Number[_0x53058b(0x99)](_0x507aaf['id'])&&(_0x507aaf[_0x53058b(0xd3)]===_0x53058b(0xa1)||_0x507aaf[_0x53058b(0xd3)]===_0x53058b(0x100));}function y(_0x4c0a60){return _0x4c0a60===0x1||_0x4c0a60===0x2||_0x4c0a60===0x3||_0x4c0a60===0x5||_0x4c0a60===0x6;}function b(_0x2105d7){const _0x2a51d7=_0x455690;return _0x2105d7==='online'||_0x2105d7===_0x2a51d7(0x8d)||_0x2105d7===_0x2a51d7(0xa2)||_0x2105d7===_0x2a51d7(0x95);}function x(_0x171af1){const _0x213d71=_0x455690;return _0x171af1===null||E(_0x171af1)&&T(_0x171af1[_0x213d71(0xbc)])&&T(_0x171af1[_0x213d71(0x10a)])&&T(_0x171af1[_0x213d71(0xc8)])&&(_0x171af1['sid']===void 0x0||typeof _0x171af1['sid']==_0x213d71(0xdc))&&(_0x171af1[_0x213d71(0xee)]===void 0x0||T(_0x171af1[_0x213d71(0xee)]));}function S(_0x513f4c){const _0x1bca7b=_0x455690;return _0x513f4c===null||E(_0x513f4c)&&(_0x513f4c[_0x1bca7b(0xfc)]===_0x1bca7b(0x10e)||_0x513f4c[_0x1bca7b(0xfc)]===_0x1bca7b(0xd2))&&(_0x513f4c[_0x1bca7b(0xdf)]==='transform-failed'||_0x513f4c[_0x1bca7b(0xdf)]===_0x1bca7b(0xc6)||_0x513f4c['reason']===_0x1bca7b(0x9d))&&typeof _0x513f4c[_0x1bca7b(0xac)]==_0x1bca7b(0xdc);}function C(_0x2ea4b1){const _0x5b5ae1=_0x455690;return Array[_0x5b5ae1(0xd1)](_0x2ea4b1)&&_0x2ea4b1['every'](_0x507fd1=>E(_0x507fd1)&&typeof _0x507fd1['id']==_0x5b5ae1(0xdc)&&_0x507fd1['id']['length']>0x0&&typeof _0x507fd1['data']=='string');}function w(_0x29696e){const _0x4556d4=_0x455690;return _0x29696e===null||typeof _0x29696e=='boolean'||typeof _0x29696e==_0x4556d4(0xdc)||typeof _0x29696e==_0x4556d4(0xbd)&&Number['isFinite'](_0x29696e)?!0x0:Array[_0x4556d4(0xd1)](_0x29696e)?_0x29696e[_0x4556d4(0xde)](w):E(_0x29696e)&&Object[_0x4556d4(0xd8)](_0x29696e)[_0x4556d4(0xde)](w);}function T(_0x4c1222){const _0x5a5d15=_0x455690;return Number[_0x5a5d15(0x99)](_0x4c1222)&&Number(_0x4c1222)>=0x0;}function E(_0x597e5f){const _0x258b8b=_0x455690;return typeof _0x597e5f==_0x258b8b(0xcf)&&!!_0x597e5f&&!Array['isArray'](_0x597e5f);}var D=0x7530,O=0x7530;function k(_0x54af05){const _0x43ef8a=_0x455690;let _0x28e32f=A(_0x54af05[_0x43ef8a(0xff)]),_0x403f58=_0x54af05[_0x43ef8a(0xfe)]??D,_0x5c1bb4=_0x54af05[_0x43ef8a(0xe8)]??O;j(_0x403f58,'openTimeoutMs'),j(_0x5c1bb4,_0x43ef8a(0xe8));let _0x483156;try{_0x483156=_0x1d77f1({'factory':{async 'create'(_0x339833){const _0xb8fdc7=_0x43ef8a;return await l({'entry':_0x28e32f,..._0x54af05[_0xb8fdc7(0x10d)]===void 0x0?{}:{'env':_0x54af05[_0xb8fdc7(0x10d)]},'init':_0x339833[_0xb8fdc7(0xe0)],'key':_0x339833[_0xb8fdc7(0xb0)],'openTimeoutMs':_0x403f58,'operationTimeoutMs':_0x5c1bb4});},async 'destroy'({instance:_0x4cff39}){const _0x57aae2=_0x43ef8a;await _0x4cff39[_0x57aae2(0xc2)]();}},..._0x54af05[_0x43ef8a(0x10c)]===void 0x0?{}:{'cache':_0x54af05[_0x43ef8a(0x10c)]},'onEvent':_0x2203b1});}catch(_0x31b000){throw M(_0x31b000);}return{async 'acquire'(_0x102426){const _0x510a3f=_0x43ef8a;let _0x386417;try{_0x386417=await _0x483156[_0x510a3f(0xf1)](_0x102426);}catch(_0x25c46a){throw M(_0x25c46a);}return _0x32f4ea(_0x386417);},async 'close'(){try{await _0x483156['close']();}catch(_0x2374f8){throw M(_0x2374f8);}}};function _0x32f4ea(_0x3d2511){const _0x2895fc=_0x43ef8a;let _0x20e702=_0x3d2511['instance'],_0x56a1af=!0x1,_0x5ba04f,_0x360e38=!0x1;return{'key':_0x3d2511[_0x2895fc(0xb0)],'unitId':_0x20e702[_0x2895fc(0xae)],'unitType':_0x20e702[_0x2895fc(0x104)],async 'getState'(){const _0xa08aa9=_0x2895fc;return await _0x3904d3(_0xa08aa9(0xab),async()=>await _0x20e702[_0xa08aa9(0xd0)]());},async 'getPendingMutations'(){const _0x4b8b49=_0x2895fc;return await _0x3904d3(_0x4b8b49(0x89),async()=>await _0x20e702[_0x4b8b49(0xe1)]());},async 'execute'(_0x3b0661){const _0x30cb90=_0x2895fc;return _0x3b0661[_0x30cb90(0xb2)]==='read'?await _0x3904d3(_0x30cb90(0xf7),async()=>await _0x20e702['executeReadCode'](_0x3b0661[_0x30cb90(0x101)])):await _0x3904d3('write',async()=>await _0x20e702[_0x30cb90(0x87)](_0x3b0661['code']));},async 'replacePendingMutations'(_0x87e8bd){const _0x20c017=_0x2895fc;return await _0x3904d3(_0x20c017(0xdb),async()=>await _0x20e702['replacePendingMutations'](_0x87e8bd));},async 'fetch'(){const _0x283c9d=_0x2895fc;return await _0x3904d3(_0x283c9d(0xba),async()=>await _0x20e702['fetch']());},async 'pull'(){const _0x5ba9d0=_0x2895fc;return await _0x3904d3(_0x5ba9d0(0x10e),async()=>await _0x20e702[_0x5ba9d0(0x10e)]());},async 'commit'(){const _0x204bdc=_0x2895fc;return await _0x3904d3('commit',async()=>await _0x20e702[_0x204bdc(0xd2)]());},async 'exportUnitData'(){return await _0x3904d3('export',async()=>await _0x20e702['exportUnitData']());},async 'invalidate'(){_0x56a1af||(_0x56a1af=!0x0,await _0x3d2511['invalidate']());},async 'release'(){const _0x171ac5=_0x2895fc;_0x56a1af||(_0x56a1af=!0x0,_0x360e38?await _0x3d2511[_0x171ac5(0xb3)]():await _0x3d2511[_0x171ac5(0xf3)]());}};async function _0x3904d3(_0x48a536,_0x31aa6e){const _0x4d7138=_0x2895fc;_0x1fdebe();try{return await _0xa81315(_0x3d2511[_0x4d7138(0xb0)],_0x48a536,_0x31aa6e);}catch(_0x46aa87){throw _0x3ef7d7(_0x46aa87),_0x46aa87;}}function _0x1fdebe(){const _0xc4fce1=_0x2895fc;if(_0x56a1af)throw new c(_0xc4fce1(0x113),_0xc4fce1(0x9a)+_0x3d2511[_0xc4fce1(0xb0)]+_0xc4fce1(0xc0));if(_0x5ba04f)throw _0x5ba04f;}function _0x3ef7d7(_0x399822){const _0x39fb8b=_0x2895fc;(_0x399822 instanceof c&&_0x399822['invalidatesInstance']||_0x399822 instanceof _0x30582d&&(_0x399822[_0x39fb8b(0x101)]===_0x39fb8b(0xbf)||_0x399822[_0x39fb8b(0x101)]===_0x39fb8b(0xec)||_0x399822['code']==='COLLABORATION_LOAD_FAILED')||typeof _0x399822==_0x39fb8b(0xcf)&&_0x399822&&_0x39fb8b(0xd5)in _0x399822&&_0x399822['invalidatesInstance']===!0x0)&&(_0x360e38=!0x0,_0x5ba04f=_0x399822,_0x42bc21({'errorCode':N(_0x399822),'key':_0x3d2511['key'],'type':_0x39fb8b(0xbb)}));}}async function _0xa81315(_0x244ca8,_0x6051d6,_0x32e9f3){const _0x911848=_0x43ef8a;let _0x13aaa5=Date[_0x911848(0x91)](),_0x4d44bc=await _0x32e9f3();return _0x42bc21({'durationMs':Date['now']()-_0x13aaa5,'key':_0x244ca8,'operation':_0x6051d6,'type':_0x911848(0x8e)}),_0x4d44bc;}function _0x2203b1(_0x345b6c){_0x42bc21(_0x345b6c);}function _0x42bc21(_0xda1640){const _0x2dc4a8=_0x43ef8a;try{_0x54af05[_0x2dc4a8(0xb7)]?.(_0xda1640);}catch{}}}function A(_0x10feaa){const _0x58c8da=_0x455690;let _0x3b45c3=_0x10feaa instanceof URL?_0x10feaa[_0x58c8da(0xb4)]:_0x10feaa;if(_0x3b45c3['length']===0x0)throw new c(_0x58c8da(0x8c),_0x58c8da(0x97));try{return new URL(_0x3b45c3)['href'];}catch{throw new c('COLLABORATION_POOL_INVALID_INPUT',_0x58c8da(0xe7));}}function j(_0x3d7052,_0x107506){const _0x3b5518=_0x455690;if(!Number[_0x3b5518(0x8b)](_0x3d7052)||_0x3d7052<=0x0)throw new c('COLLABORATION_POOL_INVALID_INPUT',_0x107506+_0x3b5518(0x102));}function _0x3990(_0x4f0bb0,_0x163587){_0x4f0bb0=_0x4f0bb0-0x87;const _0x47ac08=_0x47ac();let _0x399024=_0x47ac08[_0x4f0bb0];return _0x399024;}function M(_0x197d04){const _0x8ac19a=_0x455690;return _0x197d04 instanceof _0x864955?new c(_0x197d04['code']===_0x8ac19a(0xb8)?'COLLABORATION_POOL_CAPACITY_EXCEEDED':_0x197d04['code']===_0x8ac19a(0xc7)?_0x8ac19a(0x92):_0x8ac19a(0x8c),_0x197d04['message'],{'cause':_0x197d04}):_0x197d04;}function _0x47ac(){const _0x52ae73=['getPendingMutations','ipc','Worker\x20returned\x20an\x20invalid\x20operation\x20status','unchanged','includes','startsWith','entry\x20must\x20be\x20an\x20absolute\x20file\x20URL\x20or\x20another\x20importable\x20URL','operationTimeoutMs','pulled','2774964rkQCyz','kill','COLLABORATION_CLOSED','execute-write','reqId','.ts','bufferedChangesetCount','acquire','clear','release','signal\x20','Worker\x20returned\x20an\x20invalid\x20mutation\x20replacement\x20result','confirmed','read','worker-child.mjs','exit','1255710FszxoE','nextId','operation','unref','openTimeoutMs','entry','error','code','\x20must\x20be\x20a\x20finite\x20positive\x20number','COLLABORATION_WORKER_PROTOCOL_ERROR','unitType','UniverCollaborationRuntimePoolError','mutations','132670eUoCaQ','SIGKILL','COLLABORATION_WORKER_CLOSED','revision','open','cache','env','pull','Worker\x20returned\x20an\x20invalid\x20write\x20result','delete','34683Bwtwfy','knownHeadRevision','COLLABORATION_LEASE_CLOSED','request','executeWriteCode','timer','pending-mutations','1001LOCrrv','isFinite','COLLABORATION_POOL_INVALID_INPUT','reconnecting','operation-complete','assign','connection','now','COLLABORATION_POOL_CLOSED','worker-child.ts','value','closed','retryable','entry\x20must\x20not\x20be\x20empty','Worker\x20returned\x20an\x20invalid\x20read\x20value','isSafeInteger','Collaboration\x20runtime\x20lease\x20','advanced','previousMutationCount','permission-rejected','exit\x20code\x20','Worker\x20','reject','result','offline','pendingMutationCount','get-state','19408ubvxks','Worker\x20returned\x20an\x20invalid\x20operation\x20result','COLLABORATION_WORKER_OPEN_TIMEOUT','COLLABORATION_WORKER_CRASHED','stack','Failed\x20to\x20send\x20a\x20request\x20to\x20worker\x20','state','message','pull-required','unitId','\x20failed:\x20','key','5173JSLTcz','mode','invalidate','href','COLLABORATION_','send','onEvent','INSTANCE_POOL_CAPACITY_EXCEEDED','12865365FFRGxN','fetch','instance-failed','baseRevision','number','export','COLLABORATION_PROTOCOL_ERROR','\x20is\x20closed','up-to-date','close','get','ignore','set','changeset-rejected','INSTANCE_POOL_CLOSED','mutationCount','9228CmavkE','retry','awaitingChangeset','Worker\x20returned\x20invalid\x20collaboration\x20runtime\x20state','Worker\x20returned\x20invalid\x20UnitData','1915hdpXqR','object','getState','isArray','commit','type','Collaboration\x20worker\x20','invalidatesInstance','name','race','values','218UuiUgJ','Worker\x20returned\x20invalid\x20collaboration\x20runtime\x20metadata','replace-mutations','string','conflict','every','reason','init'];_0x47ac=function(){return _0x52ae73;};return _0x47ac();}function N(_0x2e86cf){const _0x581e11=_0x455690;return typeof _0x2e86cf==_0x581e11(0xcf)&&_0x2e86cf&&_0x581e11(0x101)in _0x2e86cf&&typeof _0x2e86cf['code']=='string'?_0x2e86cf[_0x581e11(0x101)]:'UNKNOWN';}function P(_0xf251a4){return _0xf251a4;}export{c as UniverCollaborationRuntimePoolError,k as createUniverCollaborationRuntimePool,P as defineUniverCollaborationRuntimeWorker};
|
package/dist/worker-child.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const _0x5d7a06=_0x3516;function _0x17f3(){const _0x1d745a=['3212920ynkNPJ','Collaboration\x20worker\x20is\x20already\x20open','3867661ZMnbCX','11338dWSbfo','code','send','Error','commit','read','pull','4298976DGEJpa','Collaboration\x20worker\x20is\x20not\x20open','object','3789810vIGGaJ','createRuntime','6LvDktD','mutations','2872800kpFLft','stack','function','exportUnitData','message','default','closed','init','string','write','close','60108cEoRJc','execute-write','fetch','execute','unitType','54iQLkRS','replace-mutations','retryable','connected','name','Collaboration\x20worker\x20entry\x20must\x20default-export\x20a\x20worker\x20definition','replacePendingMutations','execute-read','89UQoGLo','error','getState','isSafeInteger','result','type'];_0x17f3=function(){return _0x1d745a;};return _0x17f3();}(function(_0x652d21,_0x55e56b){const _0x739723=_0x3516,_0x299a25=_0x652d21();while(!![]){try{const _0x4e4972=parseInt(_0x739723(0x1d6))/0x1*(-parseInt(_0x739723(0x1df))/0x2)+parseInt(_0x739723(0x1ce))/0x3*(-parseInt(_0x739723(0x1f8))/0x4)+-parseInt(_0x739723(0x1ed))/0x5+parseInt(_0x739723(0x1eb))/0x6*(parseInt(_0x739723(0x1de))/0x7)+parseInt(_0x739723(0x1dc))/0x8+parseInt(_0x739723(0x1e6))/0x9+parseInt(_0x739723(0x1e9))/0xa;if(_0x4e4972===_0x55e56b)break;else _0x299a25['push'](_0x299a25['shift']());}catch(_0x143f7b){_0x299a25['push'](_0x299a25['shift']());}}}(_0x17f3,0x7098c));var e;process['on'](_0x5d7a06(0x1f1),_0x315e9c=>{const _0x127eb2=_0x5d7a06;a(_0x315e9c)&&t(_0x315e9c)['then'](_0x1e5989=>s({'id':_0x315e9c['id'],'result':_0x1e5989,'type':_0x127eb2(0x1da)}),_0x4f841f=>s({'error':o(_0x4f841f,e?.[_0x127eb2(0x1d8)]()['connection']===_0x127eb2(0x1f3)),'id':_0x315e9c['id'],'type':_0x127eb2(0x1d7)}));});function _0x3516(_0x5a2bd6,_0xe490e2){_0x5a2bd6=_0x5a2bd6-0x1ca;const _0x17f375=_0x17f3();let _0x351675=_0x17f375[_0x5a2bd6];return _0x351675;}async function t(_0x5c2158){const _0x3b14e6=_0x5d7a06;if(_0x5c2158[_0x3b14e6(0x1db)]==='open'){if(e!==void 0x0)throw Error(_0x3b14e6(0x1dd));let _0x382f6f=await import(_0x5c2158.entry);if(!i(_0x382f6f['default']))throw Error(_0x3b14e6(0x1d3));return e=await _0x382f6f[_0x3b14e6(0x1f2)]['createRuntime'](_0x5c2158[_0x3b14e6(0x1f4)]),r(e);}if(_0x5c2158['type']===_0x3b14e6(0x1f7))return await e?.[_0x3b14e6(0x1f7)](),e=void 0x0,null;let _0x1a2d5f=n();return _0x5c2158['type']==='get-state'?_0x1a2d5f[_0x3b14e6(0x1d8)]():_0x5c2158['type']==='get-pending-mutations'?_0x1a2d5f['getPendingMutations']():_0x5c2158[_0x3b14e6(0x1db)]===_0x3b14e6(0x1d5)?await _0x1a2d5f[_0x3b14e6(0x1cc)]({'code':_0x5c2158['code'],'mode':_0x3b14e6(0x1e4)}):_0x5c2158[_0x3b14e6(0x1db)]===_0x3b14e6(0x1ca)?await _0x1a2d5f[_0x3b14e6(0x1cc)]({'code':_0x5c2158['code'],'mode':_0x3b14e6(0x1f6)}):_0x5c2158[_0x3b14e6(0x1db)]===_0x3b14e6(0x1cf)?await _0x1a2d5f[_0x3b14e6(0x1d4)](_0x5c2158[_0x3b14e6(0x1ec)]):_0x5c2158[_0x3b14e6(0x1db)]===_0x3b14e6(0x1cb)?await _0x1a2d5f[_0x3b14e6(0x1cb)]():_0x5c2158[_0x3b14e6(0x1db)]===_0x3b14e6(0x1e5)?await _0x1a2d5f[_0x3b14e6(0x1e5)]():_0x5c2158[_0x3b14e6(0x1db)]===_0x3b14e6(0x1e3)?await _0x1a2d5f['commit']():await _0x1a2d5f[_0x3b14e6(0x1f0)]();}function n(){const _0x1f4d37=_0x5d7a06;if(!e)throw Error(_0x1f4d37(0x1e7));return e;}function r(_0x227e64){const _0x20fc63=_0x5d7a06;return{'unitId':_0x227e64['unitId'],'unitType':_0x227e64[_0x20fc63(0x1cd)]};}function i(_0x116c6e){const _0x100e3d=_0x5d7a06;return typeof _0x116c6e=='object'&&!!_0x116c6e&&_0x100e3d(0x1ea)in _0x116c6e&&typeof _0x116c6e[_0x100e3d(0x1ea)]==_0x100e3d(0x1ef);}function a(_0x2c144d){const _0x38a312=_0x5d7a06;return typeof _0x2c144d==_0x38a312(0x1e8)&&!!_0x2c144d&&'id'in _0x2c144d&&Number[_0x38a312(0x1d9)](_0x2c144d['id'])&&_0x38a312(0x1db)in _0x2c144d&&typeof _0x2c144d[_0x38a312(0x1db)]==_0x38a312(0x1f5);}function o(_0x4ab9d6,_0x370ecb){const _0x22ab5e=_0x5d7a06;if(!(_0x4ab9d6 instanceof Error))return{'invalidatesInstance':_0x370ecb,'message':String(_0x4ab9d6),'name':_0x22ab5e(0x1e2)};let _0x376cfb=_0x4ab9d6;return{...typeof _0x376cfb[_0x22ab5e(0x1e0)]==_0x22ab5e(0x1f5)?{'code':_0x376cfb['code']}:{},..._0x370ecb?{'invalidatesInstance':!0x0}:{},'message':_0x4ab9d6[_0x22ab5e(0x1f1)],'name':_0x4ab9d6[_0x22ab5e(0x1d2)],...typeof _0x376cfb[_0x22ab5e(0x1d0)]=='boolean'?{'retryable':_0x376cfb[_0x22ab5e(0x1d0)]}:{},..._0x4ab9d6[_0x22ab5e(0x1ee)]===void 0x0?{}:{'stack':_0x4ab9d6[_0x22ab5e(0x1ee)]}};}function s(_0x4db34b){const _0x20041f=_0x5d7a06;process[_0x20041f(0x1d1)]&&process[_0x20041f(0x1e1)]?.(_0x4db34b);}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univer-cli/univer-collaboration-runtime-pool",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"README.zh-CN.md"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@univer-cli/generic-keyed-instance-pool": "1.
|
|
22
|
-
"@univer-cli/univer-collaboration-runtime": "1.
|
|
23
|
-
"@univerjs/protocol": "1.
|
|
21
|
+
"@univer-cli/generic-keyed-instance-pool": "1.2.0",
|
|
22
|
+
"@univer-cli/univer-collaboration-runtime": "1.2.0",
|
|
23
|
+
"@univerjs/protocol": "1.2.0"
|
|
24
24
|
}
|
|
25
25
|
}
|