univer-cli 0.1.12 → 0.1.13

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.
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const _0x16bd54=_0x3d8e;(function(_0x493ef8,_0x35ad08){const _0xc338e6=_0x3d8e,_0x576201=_0x493ef8();while(!![]){try{const _0x31db97=-parseInt(_0xc338e6(0xe3))/0x1+-parseInt(_0xc338e6(0xd6))/0x2+-parseInt(_0xc338e6(0x89))/0x3+parseInt(_0xc338e6(0xc8))/0x4+parseInt(_0xc338e6(0x99))/0x5+-parseInt(_0xc338e6(0xd8))/0x6+parseInt(_0xc338e6(0x81))/0x7;if(_0x31db97===_0x35ad08)break;else _0x576201['push'](_0x576201['shift']());}catch(_0x1b69cb){_0x576201['push'](_0x576201['shift']());}}}(_0x48fb,0x3bf31));import'../chunks/vendor-DHdfSSPw.js';import{a as _0x21d3fe,i as _0xfa3d09,n,o as _0x297950,r as _0x360543,t as _0x56d3ea}from'../chunks/trace-DPfd8LdJ.js';import{c as _0x268a72,f as _0xae3ea7,l as _0x1787b9,r as _0x34b881,s as _0x4fe062,t as _0x9d579f}from'../chunks/node-DzdmhTvA.js';import{t as _0x2888e9}from'../chunks/build-id-Coc3wh1M.js';import{n as _0x568989}from'../chunks/runtime-manifest-Bdf66z_K.js';import{existsSync as _0x781da2}from'node:fs';import{chmod as _0x36612c,mkdir as _0x3882f1,readFile as _0x583151,rm as _0x551a38,writeFile as _0x4bafc5}from'node:fs/promises';import _0x2ff25e from'node:net';function _0x48fb(){const _0x40b33b=['DaemonStart','DaemonRpcError','sizeBytes','listen','resolveIdentity','242925cKwCeg','getWorkbookSession','logRequestError','SessionExportWorkbookFile','SessionEvalJs','createdAt','Method\x20not\x20found:\x20','workbookData','session','destroyAll','rpc-shutdown','getSession','DaemonRpcStart','getSessionCount','utf8','close','28655hUcfSA','info','evalJs','DaemonRpcFinish','loadWorkbookDataReplayPack','event','loadWorkbook','toString','min','value','method','packageIdentity','withContext','getSessionIdleTtlMs','Health','loadWorkbookData','code','metaPath','sessionId','UNIVER_CLI_VERSION','DaemonRpcServer','stringify','SessionGetWorkbook','logRequestEvent','toISOString','SessionLoadWorkbook','indexOf','length','trim','Daemon\x20handler\x20not\x20ready:\x20','catch','eventName','DaemonStop','Runtime','finally','socketPath','exportWorkbookFile','unloadIdleSessions','now','timestamp','current','SIGINT','sessionHost','max','modulePath','runtimeExecutionPlaneEntry','homeDir','1094356fkOkwl','exportWorkbookData','absolutePath','sigint','connect','serve','local','dispose','format','mutations','baseWorkbookData','Daemon','sessionRoot','flush','726722CZPAQF','outputPath','1110546WQvXMS','unref','parse','meta','2.0','cwd','sigterm','withSpan','createServer','buildId','message','63413EkdiDZ','exit','createWorkbook','UNIVER_CLI_BUILD_ID','slice','Unknown\x20daemon\x20subcommand:\x20','name','env','error','durationMs','Shutdown','mutates','once','pid','isFinite','SessionExportWorkbookData','execArgv','SessionLoadWorkbookDataReplayPack','lockPath','traceparent','4613511qJGCPP','params','createConnection'];_0x48fb=function(){return _0x40b33b;};return _0x48fb();}import _0x18d7ce from'node:process';var S=new _0x9d579f();async function C(_0x3a966e={}){const _0x2d16f3=_0x3d8e;let _0x5ad1d3=_0x3a966e[_0x2d16f3(0x74)]??_0x18d7ce[_0x2d16f3(0x74)],_0x4ef7b8=_0x268a72(_0x5ad1d3),_0x6a0368=_0x568989(_0x5ad1d3),_0x4c65a7=_0x3a966e[_0x2d16f3(0xc3)]??E(new _0x34b881({'env':_0x5ad1d3,'logger':_0x1787b9({'env':_0x5ad1d3,'role':_0x21d3fe[_0x2d16f3(0xba)]}),'resolveExecutionPlaneOptions':()=>({'execArgv':[..._0x6a0368['runtimeExecutionPlaneEntry'][_0x2d16f3(0x7d)]],'modulePath':_0x6a0368[_0x2d16f3(0xc6)][_0x2d16f3(0xc5)]})})),_0x497076=_0x2888e9(_0x5ad1d3),_0x3afbdf=new Date()['toISOString']();if(await _0x3882f1(_0x4ef7b8['daemonDir'],{'recursive':!0x0,'mode':0x1c0}),await _0x3882f1(_0x4ef7b8[_0x2d16f3(0xd4)],{'recursive':!0x0,'mode':0x1c0}),!await M(_0x4ef7b8[_0x2d16f3(0x7f)],_0x4ef7b8['pidPath'])){if(await N(_0x4ef7b8[_0x2d16f3(0xbc)]))return;throw Error('Another\x20daemon\x20startup\x20owns\x20'+_0x4ef7b8[_0x2d16f3(0x7f)]);}await j(_0x4ef7b8);let _0x392d14=_0x1787b9({'env':_0x5ad1d3,'role':_0x21d3fe[_0x2d16f3(0xd3)]}),_0x288761=k({'buildId':_0x497076,'env':_0x5ad1d3,'pid':_0x18d7ce[_0x2d16f3(0x7a)]}),_0x4e678f=!0x1,_0x312b47={},_0x534ffd=async _0x28d489=>z(null,-0x7f5b,Error(_0x2d16f3(0xb6)+_0x28d489)),_0x38c980=_0x2ff25e[_0x2d16f3(0xe0)](_0x3ac168=>{let _0x3c70f3='';_0x3ac168['on']('data',_0x32ee2a=>{const _0xbea537=_0x3d8e;_0x3c70f3+=_0x32ee2a[_0xbea537(0xa0)]('utf8'),_0x5d9fe1();}),_0x3ac168['on']('error',()=>void 0x0);let _0x5d9fe1=async()=>{const _0x364c65=_0x3d8e;for(;;){let _0x22eef1=_0x3c70f3[_0x364c65(0xb3)]('\x0a');if(_0x22eef1<0x0)return;let _0x3d54a4=_0x3c70f3[_0x364c65(0xe7)](0x0,_0x22eef1)[_0x364c65(0xb5)]();if(_0x3c70f3=_0x3c70f3['slice'](_0x22eef1+0x1),!_0x3d54a4)continue;let _0x2e3977=await _0x534ffd(_0x3d54a4);_0x3ac168['write'](JSON[_0x364c65(0xae)](_0x2e3977)+'\x0a');}};});_0x534ffd=w({'buildId':_0x497076,'logRequestEvent':async _0x3e3d79=>{const _0x1c8e5d=_0x2d16f3;_0x392d14[_0x1c8e5d(0x9e)]({'level':_0x3e3d79[_0x1c8e5d(0xb8)]===_0xfa3d09[_0x1c8e5d(0x85)]?_0x1c8e5d(0x75):_0x1c8e5d(0x9a),'event_name':_0x3e3d79[_0x1c8e5d(0xb8)],'component':_0x360543[_0x1c8e5d(0xd3)],'process_role':_0x21d3fe[_0x1c8e5d(0xd3)],..._0x3e3d79[_0x1c8e5d(0x75)]===void 0x0?{}:{'error':_0x3e3d79[_0x1c8e5d(0x75)]},'fields':{..._0x288761,..._0x3e3d79['durationMs']===void 0x0?{}:{'duration_ms':_0x3e3d79[_0x1c8e5d(0x76)]},'method':_0x3e3d79[_0x1c8e5d(0xa3)],'timestamp':_0x3e3d79[_0x1c8e5d(0xc0)]}});},'logRequestError':async _0x438249=>{const _0x49196e=_0x2d16f3;_0x392d14['error']({'event_name':_0xfa3d09[_0x49196e(0x85)],'component':_0x360543['Daemon'],'process_role':_0x21d3fe[_0x49196e(0xd3)],'error':_0x438249[_0x49196e(0x75)],'fields':{..._0x288761,'method':_0x438249[_0x49196e(0xa3)],'timestamp':_0x438249[_0x49196e(0xc0)]}});},'onShutdownRequest':()=>{const _0x1a7f17=_0x2d16f3;_0x16dd46(_0x1a7f17(0x93))[_0x1a7f17(0xbb)](()=>{const _0x2abf8b=_0x1a7f17;_0x18d7ce[_0x2abf8b(0xe4)](0x0);});},'pid':_0x18d7ce['pid'],'runtimeRoot':_0x4ef7b8[_0x2d16f3(0xc7)],'sessionHost':_0x4c65a7,'socketPath':_0x4ef7b8[_0x2d16f3(0xbc)],'startedAt':_0x3afbdf}),await new Promise((_0x3bacc8,_0x17257d)=>{const _0x59a60a=_0x2d16f3;_0x38c980['once'](_0x59a60a(0x75),_0x17257d),_0x38c980[_0x59a60a(0x87)](_0x4ef7b8[_0x59a60a(0xbc)],_0x3bacc8);}),_0x4fe062(_0x4ef7b8['socketPath'])||await _0x36612c(_0x4ef7b8[_0x2d16f3(0xbc)],0x180);let _0x5a4b03={'pid':_0x18d7ce[_0x2d16f3(0x7a)],'startedAt':_0x3afbdf,'socketPath':_0x4ef7b8[_0x2d16f3(0xbc)],'runtimeRoot':_0x4ef7b8[_0x2d16f3(0xc7)],'buildId':_0x497076};await _0x4bafc5(_0x4ef7b8['pidPath'],String(_0x18d7ce['pid']),_0x2d16f3(0x97)),await _0x4bafc5(_0x4ef7b8[_0x2d16f3(0xaa)],JSON[_0x2d16f3(0xae)](_0x5a4b03,null,0x2),'utf8'),_0x392d14[_0x2d16f3(0x9a)]({'event_name':_0xfa3d09[_0x2d16f3(0x84)],'component':_0x360543[_0x2d16f3(0xd3)],'process_role':_0x21d3fe[_0x2d16f3(0xd3)],'fields':{..._0x288761,'pid':_0x18d7ce[_0x2d16f3(0x7a)],'runtime_root':_0x4ef7b8[_0x2d16f3(0xc7)],'socket_path':_0x4ef7b8[_0x2d16f3(0xbc)],'started_at':_0x3afbdf}}),await _0x392d14[_0x2d16f3(0xd5)]();let _0x3ee591=setInterval(()=>{const _0x107da2=_0x2d16f3;_0x4c65a7[_0x107da2(0xbe)]();},Math[_0x2d16f3(0xc4)](0x3e8,Math[_0x2d16f3(0xa1)](_0x4c65a7['getSessionIdleTtlMs'](),0xea60)));_0x3ee591[_0x2d16f3(0xd9)](),_0x312b47[_0x2d16f3(0xc1)]=_0x3ee591;async function _0x16dd46(_0x207b64){const _0x2ca544=_0x2d16f3;_0x4e678f||(_0x4e678f=!0x0,_0x312b47[_0x2ca544(0xc1)]!==void 0x0&&clearInterval(_0x312b47[_0x2ca544(0xc1)]),_0x392d14[_0x2ca544(0x9a)]({'event_name':_0xfa3d09[_0x2ca544(0xb9)],'component':_0x360543[_0x2ca544(0xd3)],'process_role':_0x21d3fe[_0x2ca544(0xd3)],'fields':{..._0x288761,'pid':_0x18d7ce['pid'],'reason':_0x207b64,'timestamp':new Date()[_0x2ca544(0xb1)]()}}),await _0x392d14[_0x2ca544(0xd5)](),await _0x4c65a7[_0x2ca544(0x92)](_0x207b64),await new Promise(_0x244a7f=>{const _0x5b38c8=_0x2ca544;_0x38c980[_0x5b38c8(0x98)](()=>_0x244a7f());}),await F(_0x4ef7b8['socketPath']),await _0x551a38(_0x4ef7b8['pidPath'],{'force':!0x0})[_0x2ca544(0xb7)](()=>void 0x0),await _0x551a38(_0x4ef7b8['metaPath'],{'force':!0x0})[_0x2ca544(0xb7)](()=>void 0x0),await _0x551a38(_0x4ef7b8[_0x2ca544(0x7f)],{'recursive':!0x0,'force':!0x0})[_0x2ca544(0xb7)](()=>void 0x0));}_0x18d7ce['on'](_0x2d16f3(0xc2),()=>{const _0x2b3f9c=_0x2d16f3;_0x16dd46(_0x2b3f9c(0xcb))[_0x2b3f9c(0xbb)](()=>{const _0x1d0891=_0x2b3f9c;_0x18d7ce[_0x1d0891(0xe4)](0x0);});}),_0x18d7ce['on']('SIGTERM',()=>{const _0x143d20=_0x2d16f3;_0x16dd46(_0x143d20(0xde))[_0x143d20(0xbb)](()=>{const _0x3ab30d=_0x143d20;_0x18d7ce[_0x3ab30d(0xe4)](0x0);});});}function w(_0x16cf15){return async _0x487354=>{const _0x5722b=_0x3d8e;let _0x1aa5e6;try{_0x1aa5e6=JSON[_0x5722b(0xda)](_0x487354);}catch(_0x712120){return z(null,-0x7fbc,_0x712120);}let _0x578d47=_0x56d3ea(_0x1aa5e6[_0x5722b(0xdb)]?.[_0x5722b(0x80)]),_0x2a89bd=async()=>await n[_0x5722b(0xdf)]({'name':_0x297950[_0x5722b(0xad)],'kind':'server'},async()=>{const _0x81ac45=_0x5722b;let _0x56ac76=Date['now']();await _0x16cf15['logRequestEvent']?.({'eventName':_0xfa3d09[_0x81ac45(0x95)],'method':_0x1aa5e6[_0x81ac45(0xa3)],'timestamp':new Date()[_0x81ac45(0xb1)]()});try{let _0x4d9b41=await T(_0x1aa5e6,_0x16cf15);return await _0x16cf15[_0x81ac45(0xb0)]?.({'durationMs':Date['now']()-_0x56ac76,'eventName':_0xfa3d09[_0x81ac45(0x9c)],'method':_0x1aa5e6['method'],'timestamp':new Date()[_0x81ac45(0xb1)]()}),_0x4d9b41;}catch(_0x4a8e49){return await _0x16cf15[_0x81ac45(0xb0)]?.({'durationMs':Date[_0x81ac45(0xbf)]()-_0x56ac76,'eventName':_0xfa3d09[_0x81ac45(0x85)],'method':_0x1aa5e6[_0x81ac45(0xa3)],'error':_0x4a8e49,'timestamp':new Date()[_0x81ac45(0xb1)]()}),_0x16cf15[_0x81ac45(0xb0)]===void 0x0&&await _0x16cf15[_0x81ac45(0x8b)]?.({'method':_0x1aa5e6[_0x81ac45(0xa3)],'error':_0x4a8e49 instanceof Error?_0x4a8e49[_0x81ac45(0xe2)]:String(_0x4a8e49),'timestamp':new Date()[_0x81ac45(0xb1)]()}),z(_0x1aa5e6['id'],-0x7f5b,_0x4a8e49);}});return _0x578d47===void 0x0?await _0x2a89bd():await n[_0x5722b(0xa5)](_0x578d47,_0x2a89bd);};}async function T(_0x6e039b,_0x2eca3f){const _0x3a597b=_0x3d8e;switch(_0x6e039b['method']){case _0xae3ea7[_0x3a597b(0xa7)]:return{'jsonrpc':_0x3a597b(0xdc),'id':_0x6e039b['id'],'result':{'ok':!0x0,'pid':_0x2eca3f[_0x3a597b(0x7a)],'startedAt':_0x2eca3f['startedAt'],'socketPath':_0x2eca3f[_0x3a597b(0xbc)],'runtimeRoot':_0x2eca3f['runtimeRoot'],'buildId':_0x2eca3f[_0x3a597b(0xe1)],'sessionCount':_0x2eca3f[_0x3a597b(0xc3)]['getSessionCount']()}};case _0xae3ea7[_0x3a597b(0x77)]:return _0x2eca3f['onShutdownRequest']?.(),{'jsonrpc':_0x3a597b(0xdc),'id':_0x6e039b['id'],'result':{'stopping':!0x0}};case _0xae3ea7[_0x3a597b(0xb2)]:{let _0x25ab1e=await _0x2eca3f[_0x3a597b(0xc3)][_0x3a597b(0x9f)](_0x6e039b[_0x3a597b(0x82)]);return R(_0x6e039b['id'],_0x25ab1e);}case _0xae3ea7[_0x3a597b(0x7e)]:{let _0x27f456=await _0x2eca3f[_0x3a597b(0xc3)][_0x3a597b(0x9d)](_0x6e039b[_0x3a597b(0x82)]);return R(_0x6e039b['id'],_0x27f456);}case _0xae3ea7['SessionCreateWorkbook']:{let _0x1184db=await _0x2eca3f[_0x3a597b(0xc3)][_0x3a597b(0xe5)](_0x6e039b['params']);return R(_0x6e039b['id'],_0x1184db);}case _0xae3ea7[_0x3a597b(0x8d)]:{let _0x11eaa8=await _0x2eca3f[_0x3a597b(0xc3)][_0x3a597b(0x9b)](_0x6e039b['params']);return R(_0x6e039b['id'],_0x11eaa8);}case _0xae3ea7[_0x3a597b(0x8c)]:{let _0x5cd315=await _0x2eca3f['sessionHost']['exportWorkbookFile'](_0x6e039b[_0x3a597b(0x82)]);return R(_0x6e039b['id'],_0x5cd315);}case _0xae3ea7[_0x3a597b(0x7c)]:{let _0x52ca74=_0x6e039b['params'],_0x28bd3e=await _0x2eca3f[_0x3a597b(0xc3)][_0x3a597b(0xc9)](_0x52ca74);return R(_0x6e039b['id'],_0x28bd3e);}case _0xae3ea7['SessionDispose']:{let _0xdfe5e9=await _0x2eca3f[_0x3a597b(0xc3)][_0x3a597b(0xcf)](_0x6e039b[_0x3a597b(0x82)]);return R(_0x6e039b['id'],_0xdfe5e9);}case _0xae3ea7[_0x3a597b(0xaf)]:{let _0x18c820=await _0x2eca3f['sessionHost'][_0x3a597b(0x8a)](_0x6e039b[_0x3a597b(0x82)]);return R(_0x6e039b['id'],_0x18c820);}default:return z(_0x6e039b['id'],-0x7f59,Error(_0x3a597b(0x8f)+_0x6e039b['method']));}}function E(_0x3b9a21){return{async 'createWorkbook'(_0x485ced){const _0x475057=_0x3d8e;let _0x3e52ab=await D(_0x485ced),_0x55bdf7=await _0x3b9a21['createWorkbook']({..._0x485ced['cwd']===void 0x0?{}:{'cwd':_0x485ced[_0x475057(0xdd)]},'identity':_0x3e52ab,..._0x485ced['id']===void 0x0?{}:{'workbookId':_0x485ced['id']},..._0x485ced[_0x475057(0x73)]===void 0x0?{}:{'workbookName':_0x485ced['name']}});return{'success':!0x0,'workbookData':_0x55bdf7[_0x475057(0x90)],'session':O(_0x55bdf7[_0x475057(0x91)])};},async 'dispose'(_0x304e27){const _0xf37f2=_0x3d8e;let _0x22165f=await D(_0x304e27);return await _0x3b9a21[_0xf37f2(0xcf)]({..._0x304e27[_0xf37f2(0xdd)]===void 0x0?{}:{'cwd':_0x304e27['cwd']},'identity':_0x22165f}),{'disposed':!0x0,'workbookIdentity':_0x22165f[_0xf37f2(0xca)]};},async 'destroyAll'(_0x4ecf24){const _0x5221bb=_0x3d8e;await _0x3b9a21[_0x5221bb(0x92)]?.(_0x4ecf24);},async 'evalJs'(_0x8afe20){const _0x183f5b=_0x3d8e;let _0x3ddac2=await D(_0x8afe20),_0xf11b47=await _0x3b9a21['evalJs']({'code':_0x8afe20[_0x183f5b(0xa9)],..._0x8afe20[_0x183f5b(0xdd)]===void 0x0?{}:{'cwd':_0x8afe20[_0x183f5b(0xdd)]},'identity':_0x3ddac2,..._0x8afe20[_0x183f5b(0x78)]===void 0x0?{}:{'mutates':_0x8afe20[_0x183f5b(0x78)]}});return{..._0xf11b47[_0x183f5b(0xd1)]===void 0x0?{}:{'mutations':_0xf11b47[_0x183f5b(0xd1)]},'success':!0x0,'value':_0xf11b47[_0x183f5b(0xa2)],'session':O(_0xf11b47[_0x183f5b(0x91)])};},async 'exportWorkbookData'(_0x444fec){const _0x1f86ab=_0x3d8e;let _0x42f882=await D(_0x444fec),_0xd02882=await _0x3b9a21[_0x1f86ab(0xc9)]({..._0x444fec['cwd']===void 0x0?{}:{'cwd':_0x444fec[_0x1f86ab(0xdd)]},'identity':_0x42f882});return{'success':!0x0,'workbookData':_0xd02882[_0x1f86ab(0x90)],'session':O(_0xd02882[_0x1f86ab(0x91)])};},async 'exportWorkbookFile'(_0x31096f){const _0x50eff8=_0x3d8e;let _0x5211e3=await D(_0x31096f),_0x3fd6de=await _0x3b9a21[_0x50eff8(0xbd)]({..._0x31096f[_0x50eff8(0xdd)]===void 0x0?{}:{'cwd':_0x31096f['cwd']},'format':_0x31096f[_0x50eff8(0xd0)],'identity':_0x5211e3,'outputPath':_0x31096f[_0x50eff8(0xd7)]});return{'success':!0x0,'format':_0x3fd6de[_0x50eff8(0xd0)],'outputPath':_0x3fd6de['outputPath'],'sizeBytes':_0x3fd6de[_0x50eff8(0x86)],'session':O(_0x3fd6de[_0x50eff8(0x91)])};},async 'getWorkbookSession'(_0x264ad7){const _0x236de4=_0x3d8e;let _0x3aa882=await D(_0x264ad7),_0x4fde14=await _0x3b9a21[_0x236de4(0x94)]({..._0x264ad7['cwd']===void 0x0?{}:{'cwd':_0x264ad7['cwd']},'identity':_0x3aa882});return{'exists':_0x4fde14!==null,'session':_0x4fde14===null?null:O(_0x4fde14)};},'getSessionCount'(){const _0x131f19=_0x3d8e;return _0x3b9a21[_0x131f19(0x96)]?.()??0x0;},'getSessionIdleTtlMs'(){const _0x3e9c40=_0x3d8e;return _0x3b9a21[_0x3e9c40(0xa6)]?.()??0xea60;},async 'loadWorkbook'(_0x25f8ef){const _0xa41ef3=_0x3d8e;let _0x37e243=await D(_0x25f8ef),_0x2b1829=await _0x3b9a21[_0xa41ef3(0xa8)]({..._0x25f8ef[_0xa41ef3(0xdd)]===void 0x0?{}:{'cwd':_0x25f8ef[_0xa41ef3(0xdd)]},'identity':_0x37e243,'workbookData':_0x25f8ef['workbookData']});return{'success':!0x0,'workbookData':_0x2b1829[_0xa41ef3(0x90)],'session':O(_0x2b1829[_0xa41ef3(0x91)])};},async 'loadWorkbookDataReplayPack'(_0x26abc5){const _0x269ef0=_0x3d8e;let _0x5c304b=await D(_0x26abc5),_0x36a316=await _0x3b9a21[_0x269ef0(0x9d)]({..._0x26abc5[_0x269ef0(0xdd)]===void 0x0?{}:{'cwd':_0x26abc5[_0x269ef0(0xdd)]},'identity':_0x5c304b,'replayPack':{'baseWorkbookData':_0x26abc5[_0x269ef0(0xd2)],'mutations':_0x26abc5[_0x269ef0(0xd1)]}});return{'success':!0x0,'workbookData':_0x36a316[_0x269ef0(0x90)],'session':O(_0x36a316[_0x269ef0(0x91)])};},async 'unloadIdleSessions'(){const _0x2d28eb=_0x3d8e;await _0x3b9a21[_0x2d28eb(0xbe)]?.();}};}async function D(_0x13f6e0){const _0x51f0dd=_0x3d8e;return await S[_0x51f0dd(0x88)](_0x13f6e0);}function O(_0x36cba7){const _0xa6656a=_0x3d8e;return{'createdAt':_0x36cba7[_0xa6656a(0x8e)]??'','lastAccessedAt':_0x36cba7['lastAccessedAt']??'','sessionId':_0x36cba7[_0xa6656a(0xab)],'workbookIdentity':_0x36cba7[_0xa6656a(0xa4)][_0xa6656a(0xca)]};}function k(_0x37095c){const _0x3f07db=_0x3d8e;return{'build.id':A(_0x37095c[_0x3f07db(0x74)],_0x3f07db(0xe6))??_0x37095c[_0x3f07db(0xe1)],'deployment.environment.name':_0x3f07db(0xce),'distribution.channel':A(_0x37095c[_0x3f07db(0x74)],'UNIVER_DISTRIBUTION_CHANNEL')??'unknown','service.instance.id':String(_0x37095c[_0x3f07db(0x7a)]),'service.name':'univer-daemon',...A(_0x37095c[_0x3f07db(0x74)],_0x3f07db(0xac))===void 0x0?{}:{'service.version':A(_0x37095c['env'],_0x3f07db(0xac))}};}function A(_0x15fff6,_0x366790){const _0x26ed70=_0x3d8e;let _0x4d6918=_0x15fff6[_0x366790]?.[_0x26ed70(0xb5)]();return _0x4d6918===void 0x0||_0x4d6918[_0x26ed70(0xb4)]===0x0?void 0x0:_0x4d6918;}async function j(_0x1269d1){const _0x5054b0=_0x3d8e;P(_0x1269d1[_0x5054b0(0xbc)])&&!await N(_0x1269d1['socketPath'])&&await F(_0x1269d1[_0x5054b0(0xbc)]);let _0x460c79=await I(_0x1269d1['pidPath']);_0x460c79!==null&&!L(_0x460c79)&&(await _0x551a38(_0x1269d1['pidPath'],{'force':!0x0})[_0x5054b0(0xb7)](()=>void 0x0),await _0x551a38(_0x1269d1[_0x5054b0(0xaa)],{'force':!0x0})[_0x5054b0(0xb7)](()=>void 0x0),await _0x551a38(_0x1269d1[_0x5054b0(0x7f)],{'recursive':!0x0,'force':!0x0})['catch'](()=>void 0x0));}async function M(_0x9cf2c9,_0x10f5c9){const _0x3e6357=_0x3d8e;try{return await _0x3882f1(_0x9cf2c9,{'recursive':!0x1,'mode':0x1c0}),!0x0;}catch(_0xa50f34){if(_0xa50f34[_0x3e6357(0xa9)]!=='EEXIST')throw _0xa50f34;let _0x27fbe9=await I(_0x10f5c9);return _0x27fbe9!==null&&L(_0x27fbe9)?!0x1:(await _0x551a38(_0x9cf2c9,{'recursive':!0x0,'force':!0x0}),await _0x3882f1(_0x9cf2c9,{'recursive':!0x1,'mode':0x1c0}),!0x0);}}async function N(_0x484b03){return await new Promise(_0x3f3002=>{const _0x3ae0f1=_0x3d8e;let _0x33d25f=_0x2ff25e[_0x3ae0f1(0x83)](_0x484b03);_0x33d25f[_0x3ae0f1(0x79)](_0x3ae0f1(0xcc),()=>{_0x33d25f['end'](),_0x3f3002(!0x0);}),_0x33d25f[_0x3ae0f1(0x79)](_0x3ae0f1(0x75),()=>{_0x3f3002(!0x1);});});}function P(_0x44f4d3){return _0x4fe062(_0x44f4d3)?!0x1:_0x781da2(_0x44f4d3);}async function F(_0x1accbd){const _0x17085e=_0x3d8e;_0x4fe062(_0x1accbd)||await _0x551a38(_0x1accbd,{'force':!0x0})[_0x17085e(0xb7)](()=>void 0x0);}async function I(_0x3f6126){const _0xdc7483=_0x3d8e;try{let _0x43df69=await _0x583151(_0x3f6126,'utf8'),_0x13ee82=Number(_0x43df69[_0xdc7483(0xb5)]());return Number[_0xdc7483(0x7b)](_0x13ee82)?_0x13ee82:null;}catch{return null;}}function L(_0x5b7483){try{return _0x18d7ce['kill'](_0x5b7483,0x0),!0x0;}catch{return!0x1;}}function R(_0x175e9c,_0x296a74){const _0x4a34a5=_0x3d8e;return{'jsonrpc':_0x4a34a5(0xdc),'id':_0x175e9c,'result':_0x296a74};}function z(_0x138972,_0x685e57,_0x4e03a6){const _0x7b69f=_0x3d8e;return{'jsonrpc':_0x7b69f(0xdc),'id':_0x138972,'error':{'code':_0x685e57,'message':_0x4e03a6 instanceof Error?_0x4e03a6[_0x7b69f(0xe2)]:String(_0x4e03a6)}};}function _0x3d8e(_0x1db5da,_0x196ad0){_0x1db5da=_0x1db5da-0x72;const _0x48fb2d=_0x48fb();let _0x3d8ef9=_0x48fb2d[_0x1db5da];return _0x3d8ef9;}var B=process['argv'][0x2]??_0x16bd54(0xcd);B!==_0x16bd54(0xcd)&&(console[_0x16bd54(0x75)](_0x16bd54(0x72)+B),process[_0x16bd54(0xe4)](0x1)),C()['catch'](_0x59d3db=>{const _0x438294=_0x16bd54;console[_0x438294(0x75)](_0x59d3db instanceof Error?_0x59d3db[_0x438294(0xe2)]:String(_0x59d3db)),process[_0x438294(0xe4)](0x1);});
2
+ const _0x5c6f73=_0x3f4c;(function(_0x54fc96,_0xfa0cd4){const _0x1b7368=_0x3f4c,_0x48d38c=_0x54fc96();while(!![]){try{const _0x117d5b=-parseInt(_0x1b7368(0x134))/0x1+-parseInt(_0x1b7368(0x106))/0x2*(-parseInt(_0x1b7368(0x156))/0x3)+parseInt(_0x1b7368(0x13a))/0x4*(-parseInt(_0x1b7368(0x12a))/0x5)+parseInt(_0x1b7368(0x114))/0x6+-parseInt(_0x1b7368(0x125))/0x7*(-parseInt(_0x1b7368(0x14a))/0x8)+-parseInt(_0x1b7368(0x177))/0x9+parseInt(_0x1b7368(0x10d))/0xa;if(_0x117d5b===_0xfa0cd4)break;else _0x48d38c['push'](_0x48d38c['shift']());}catch(_0x2600ff){_0x48d38c['push'](_0x48d38c['shift']());}}}(_0x5165,0x636f5));import'../chunks/vendor-BzHSCzgc.js';import{a as _0x1ee5a9,i as _0x3b6e1d,n,o as _0x45fed2,r as _0x16cace,t as _0x41ff89}from'../chunks/trace-DPfd8LdJ.js';import{c as _0x35bc55,f as _0xc2acfd,l as _0x2d93ec,r as _0x1169be,s as _0x4beca5,t as _0x1fe616}from'../chunks/node-BD_3Mfir.js';import{t as _0x573793}from'../chunks/build-id-Coc3wh1M.js';import{n as _0x42751c}from'../chunks/runtime-manifest-Bdf66z_K.js';import{existsSync as _0x1b8eb4}from'node:fs';import{chmod as _0x5e1dc0,mkdir as _0x471cc2,readFile as _0x4cdcd5,rm as _0x562f50,writeFile as _0xb93581}from'node:fs/promises';import _0x195171 from'node:net';import _0x2d85b7 from'node:process';var S=new _0x1fe616();async function C(_0x13b1bc={}){const _0x155be8=_0x3f4c;let _0x2ff796=_0x13b1bc[_0x155be8(0x124)]??_0x2d85b7[_0x155be8(0x124)],_0x1c841f=_0x35bc55(_0x2ff796),_0xc9444c=_0x42751c(_0x2ff796),_0x566051=_0x13b1bc['sessionHost']??E(new _0x1169be({'env':_0x2ff796,'logger':_0x2d93ec({'env':_0x2ff796,'role':_0x1ee5a9[_0x155be8(0x17c)]}),'resolveExecutionPlaneOptions':()=>({'execArgv':[..._0xc9444c[_0x155be8(0x11c)]['execArgv']],'modulePath':_0xc9444c['runtimeExecutionPlaneEntry']['modulePath']})})),_0x592107=_0x573793(_0x2ff796),_0x331ec2=new Date()[_0x155be8(0x137)]();if(await _0x471cc2(_0x1c841f[_0x155be8(0x14d)],{'recursive':!0x0,'mode':0x1c0}),await _0x471cc2(_0x1c841f[_0x155be8(0x132)],{'recursive':!0x0,'mode':0x1c0}),!await M(_0x1c841f[_0x155be8(0x16d)],_0x1c841f['pidPath'])){if(await N(_0x1c841f['socketPath']))return;throw Error(_0x155be8(0x14f)+_0x1c841f[_0x155be8(0x16d)]);}await j(_0x1c841f);let _0x5c2ba0=_0x2d93ec({'env':_0x2ff796,'role':_0x1ee5a9[_0x155be8(0x11a)]}),_0x5e9a4c=k({'buildId':_0x592107,'env':_0x2ff796,'pid':_0x2d85b7[_0x155be8(0x176)]}),_0x333f8c=!0x1,_0x28ce7c={},_0x3f5a90=async _0xabebbf=>z(null,-0x7f5b,Error('Daemon\x20handler\x20not\x20ready:\x20'+_0xabebbf)),_0x18e26e=_0x195171[_0x155be8(0x123)](_0x2c82ca=>{const _0x1e0bed=_0x155be8;let _0x4a1539='';_0x2c82ca['on'](_0x1e0bed(0x12c),_0x5d2b56=>{const _0x1cf1bd=_0x1e0bed;_0x4a1539+=_0x5d2b56[_0x1cf1bd(0x140)](_0x1cf1bd(0x11f)),_0x2e14d6();}),_0x2c82ca['on'](_0x1e0bed(0x11d),()=>void 0x0);let _0x2e14d6=async()=>{const _0x3cfcc4=_0x1e0bed;for(;;){let _0xd25b1=_0x4a1539[_0x3cfcc4(0x112)]('\x0a');if(_0xd25b1<0x0)return;let _0x312f66=_0x4a1539[_0x3cfcc4(0x15c)](0x0,_0xd25b1)[_0x3cfcc4(0x141)]();if(_0x4a1539=_0x4a1539['slice'](_0xd25b1+0x1),!_0x312f66)continue;let _0x4f07be=await _0x3f5a90(_0x312f66);_0x2c82ca[_0x3cfcc4(0x13d)](JSON[_0x3cfcc4(0x160)](_0x4f07be)+'\x0a');}};});_0x3f5a90=w({'buildId':_0x592107,'logRequestEvent':async _0x508dfc=>{const _0xdd1b34=_0x155be8;_0x5c2ba0['event']({'level':_0x508dfc[_0xdd1b34(0x174)]===_0x3b6e1d[_0xdd1b34(0x121)]?'error':_0xdd1b34(0x14b),'event_name':_0x508dfc[_0xdd1b34(0x174)],'component':_0x16cace[_0xdd1b34(0x11a)],'process_role':_0x1ee5a9[_0xdd1b34(0x11a)],..._0x508dfc['error']===void 0x0?{}:{'error':_0x508dfc[_0xdd1b34(0x11d)]},'fields':{..._0x5e9a4c,..._0x508dfc[_0xdd1b34(0x149)]===void 0x0?{}:{'duration_ms':_0x508dfc[_0xdd1b34(0x149)]},'method':_0x508dfc[_0xdd1b34(0x113)],'timestamp':_0x508dfc[_0xdd1b34(0x15b)]}});},'logRequestError':async _0x3cf8ab=>{const _0x349fa0=_0x155be8;_0x5c2ba0[_0x349fa0(0x11d)]({'event_name':_0x3b6e1d[_0x349fa0(0x121)],'component':_0x16cace[_0x349fa0(0x11a)],'process_role':_0x1ee5a9[_0x349fa0(0x11a)],'error':_0x3cf8ab['error'],'fields':{..._0x5e9a4c,'method':_0x3cf8ab['method'],'timestamp':_0x3cf8ab[_0x349fa0(0x15b)]}});},'onShutdownRequest':()=>{const _0xadc595=_0x155be8;_0x54630e(_0xadc595(0x107))[_0xadc595(0x16a)](()=>{_0x2d85b7['exit'](0x0);});},'pid':_0x2d85b7[_0x155be8(0x176)],'runtimeRoot':_0x1c841f['homeDir'],'sessionHost':_0x566051,'socketPath':_0x1c841f[_0x155be8(0x159)],'startedAt':_0x331ec2}),await new Promise((_0x57086c,_0x149340)=>{const _0x371b3e=_0x155be8;_0x18e26e[_0x371b3e(0x14e)](_0x371b3e(0x11d),_0x149340),_0x18e26e['listen'](_0x1c841f[_0x371b3e(0x159)],_0x57086c);}),_0x4beca5(_0x1c841f[_0x155be8(0x159)])||await _0x5e1dc0(_0x1c841f['socketPath'],0x180);let _0x442c56={'pid':_0x2d85b7['pid'],'startedAt':_0x331ec2,'socketPath':_0x1c841f[_0x155be8(0x159)],'runtimeRoot':_0x1c841f[_0x155be8(0x133)],'buildId':_0x592107};await _0xb93581(_0x1c841f[_0x155be8(0x120)],String(_0x2d85b7['pid']),_0x155be8(0x11f)),await _0xb93581(_0x1c841f[_0x155be8(0x16f)],JSON[_0x155be8(0x160)](_0x442c56,null,0x2),'utf8'),_0x5c2ba0['info']({'event_name':_0x3b6e1d[_0x155be8(0x15a)],'component':_0x16cace[_0x155be8(0x11a)],'process_role':_0x1ee5a9[_0x155be8(0x11a)],'fields':{..._0x5e9a4c,'pid':_0x2d85b7['pid'],'runtime_root':_0x1c841f[_0x155be8(0x133)],'socket_path':_0x1c841f[_0x155be8(0x159)],'started_at':_0x331ec2}}),await _0x5c2ba0[_0x155be8(0x10c)]();let _0x511d5f=setInterval(()=>{_0x566051['unloadIdleSessions']();},Math[_0x155be8(0x166)](0x3e8,Math['min'](_0x566051[_0x155be8(0x129)](),0xea60)));_0x511d5f['unref'](),_0x28ce7c[_0x155be8(0x161)]=_0x511d5f;async function _0x54630e(_0x2f9b83){const _0x3621f9=_0x155be8;_0x333f8c||(_0x333f8c=!0x0,_0x28ce7c[_0x3621f9(0x161)]!==void 0x0&&clearInterval(_0x28ce7c[_0x3621f9(0x161)]),_0x5c2ba0[_0x3621f9(0x14b)]({'event_name':_0x3b6e1d['DaemonStop'],'component':_0x16cace['Daemon'],'process_role':_0x1ee5a9['Daemon'],'fields':{..._0x5e9a4c,'pid':_0x2d85b7[_0x3621f9(0x176)],'reason':_0x2f9b83,'timestamp':new Date()[_0x3621f9(0x137)]()}}),await _0x5c2ba0['flush'](),await _0x566051[_0x3621f9(0x131)](_0x2f9b83),await new Promise(_0x2e5536=>{_0x18e26e['close'](()=>_0x2e5536());}),await F(_0x1c841f[_0x3621f9(0x159)]),await _0x562f50(_0x1c841f[_0x3621f9(0x120)],{'force':!0x0})['catch'](()=>void 0x0),await _0x562f50(_0x1c841f[_0x3621f9(0x16f)],{'force':!0x0})[_0x3621f9(0x14c)](()=>void 0x0),await _0x562f50(_0x1c841f[_0x3621f9(0x16d)],{'recursive':!0x0,'force':!0x0})['catch'](()=>void 0x0));}_0x2d85b7['on'](_0x155be8(0x16c),()=>{const _0x59ebc6=_0x155be8;_0x54630e(_0x59ebc6(0x169))['finally'](()=>{const _0x6a2905=_0x59ebc6;_0x2d85b7[_0x6a2905(0x148)](0x0);});}),_0x2d85b7['on'](_0x155be8(0x162),()=>{const _0x394c3e=_0x155be8;_0x54630e(_0x394c3e(0x109))['finally'](()=>{_0x2d85b7['exit'](0x0);});});}function _0x5165(){const _0x534110=['lockPath','argv','metaPath','sizeBytes','value','2.0','createConnection','eventName','packageIdentity','pid','4060404hejKZJ','resolveIdentity','baseWorkbookData','Unknown\x20daemon\x20subcommand:\x20','SessionGetWorkbook','Runtime','sessionHost','loadWorkbookDataReplayPack','1518LJquQm','rpc-shutdown','format','sigterm','EEXIST','meta','flush','5013300wCcNbV','univer-daemon','now','exportWorkbookFile','Method\x20not\x20found:\x20','indexOf','method','3103626FiFJfm','outputPath','code','evalJs','dispose','Shutdown','Daemon','withContext','runtimeExecutionPlaneEntry','error','SessionDispose','utf8','pidPath','DaemonRpcError','SessionExportWorkbookData','createServer','env','3795953sAbIIc','workbookData','onShutdownRequest','name','getSessionIdleTtlMs','35180QZdEKZ','DaemonRpcFinish','data','end','session','SessionLoadWorkbook','UNIVER_CLI_BUILD_ID','destroyAll','sessionRoot','homeDir','243176VkzNkv','logRequestEvent','Health','toISOString','getSessionCount','UNIVER_CLI_VERSION','416XokObH','createdAt','UNIVER_DISTRIBUTION_CHANNEL','write','loadWorkbookData','SessionEvalJs','toString','trim','cwd','absolutePath','withSpan','message','mutations','connect','exit','durationMs','8qmocHM','info','catch','daemonDir','once','Another\x20daemon\x20startup\x20owns\x20','buildId','runtimeRoot','logRequestError','SessionExportWorkbookFile','params','loadWorkbook','1077IUJTlL','isFinite','getWorkbookSession','socketPath','DaemonStart','timestamp','slice','mutates','serve','SessionCreateWorkbook','stringify','current','SIGTERM','createWorkbook','traceparent','SessionLoadWorkbookDataReplayPack','max','server','getSession','sigint','finally','exportWorkbookData','SIGINT'];_0x5165=function(){return _0x534110;};return _0x5165();}function _0x3f4c(_0x42b679,_0x4b93af){_0x42b679=_0x42b679-0x104;const _0x5165cf=_0x5165();let _0x3f4ca7=_0x5165cf[_0x42b679];return _0x3f4ca7;}function w(_0x5e04fa){return async _0x15aaba=>{const _0x542e40=_0x3f4c;let _0x4b105c;try{_0x4b105c=JSON['parse'](_0x15aaba);}catch(_0xa4bfdd){return z(null,-0x7fbc,_0xa4bfdd);}let _0x244ffe=_0x41ff89(_0x4b105c[_0x542e40(0x10b)]?.[_0x542e40(0x164)]),_0x2a4317=async()=>await n[_0x542e40(0x144)]({'name':_0x45fed2['DaemonRpcServer'],'kind':_0x542e40(0x167)},async()=>{const _0x208129=_0x542e40;let _0x139cd1=Date[_0x208129(0x10f)]();await _0x5e04fa['logRequestEvent']?.({'eventName':_0x3b6e1d['DaemonRpcStart'],'method':_0x4b105c[_0x208129(0x113)],'timestamp':new Date()[_0x208129(0x137)]()});try{let _0x28ddd1=await T(_0x4b105c,_0x5e04fa);return await _0x5e04fa['logRequestEvent']?.({'durationMs':Date[_0x208129(0x10f)]()-_0x139cd1,'eventName':_0x3b6e1d[_0x208129(0x12b)],'method':_0x4b105c[_0x208129(0x113)],'timestamp':new Date()[_0x208129(0x137)]()}),_0x28ddd1;}catch(_0x5619bd){return await _0x5e04fa[_0x208129(0x135)]?.({'durationMs':Date[_0x208129(0x10f)]()-_0x139cd1,'eventName':_0x3b6e1d[_0x208129(0x121)],'method':_0x4b105c[_0x208129(0x113)],'error':_0x5619bd,'timestamp':new Date()[_0x208129(0x137)]()}),_0x5e04fa['logRequestEvent']===void 0x0&&await _0x5e04fa[_0x208129(0x152)]?.({'method':_0x4b105c['method'],'error':_0x5619bd instanceof Error?_0x5619bd[_0x208129(0x145)]:String(_0x5619bd),'timestamp':new Date()[_0x208129(0x137)]()}),z(_0x4b105c['id'],-0x7f5b,_0x5619bd);}});return _0x244ffe===void 0x0?await _0x2a4317():await n[_0x542e40(0x11b)](_0x244ffe,_0x2a4317);};}async function T(_0xbaaefc,_0x5a6997){const _0x2b0550=_0x3f4c;switch(_0xbaaefc[_0x2b0550(0x113)]){case _0xc2acfd[_0x2b0550(0x136)]:return{'jsonrpc':_0x2b0550(0x172),'id':_0xbaaefc['id'],'result':{'ok':!0x0,'pid':_0x5a6997[_0x2b0550(0x176)],'startedAt':_0x5a6997['startedAt'],'socketPath':_0x5a6997['socketPath'],'runtimeRoot':_0x5a6997[_0x2b0550(0x151)],'buildId':_0x5a6997[_0x2b0550(0x150)],'sessionCount':_0x5a6997[_0x2b0550(0x104)][_0x2b0550(0x138)]()}};case _0xc2acfd[_0x2b0550(0x119)]:return _0x5a6997[_0x2b0550(0x127)]?.(),{'jsonrpc':_0x2b0550(0x172),'id':_0xbaaefc['id'],'result':{'stopping':!0x0}};case _0xc2acfd[_0x2b0550(0x12f)]:{let _0x388905=await _0x5a6997[_0x2b0550(0x104)][_0x2b0550(0x155)](_0xbaaefc[_0x2b0550(0x154)]);return R(_0xbaaefc['id'],_0x388905);}case _0xc2acfd[_0x2b0550(0x165)]:{let _0x4e4efe=await _0x5a6997[_0x2b0550(0x104)][_0x2b0550(0x105)](_0xbaaefc[_0x2b0550(0x154)]);return R(_0xbaaefc['id'],_0x4e4efe);}case _0xc2acfd[_0x2b0550(0x15f)]:{let _0x5b4e51=await _0x5a6997[_0x2b0550(0x104)][_0x2b0550(0x163)](_0xbaaefc['params']);return R(_0xbaaefc['id'],_0x5b4e51);}case _0xc2acfd[_0x2b0550(0x13f)]:{let _0x1f1f5c=await _0x5a6997[_0x2b0550(0x104)][_0x2b0550(0x117)](_0xbaaefc[_0x2b0550(0x154)]);return R(_0xbaaefc['id'],_0x1f1f5c);}case _0xc2acfd[_0x2b0550(0x153)]:{let _0x1a5704=await _0x5a6997[_0x2b0550(0x104)][_0x2b0550(0x110)](_0xbaaefc[_0x2b0550(0x154)]);return R(_0xbaaefc['id'],_0x1a5704);}case _0xc2acfd[_0x2b0550(0x122)]:{let _0x52cf8b=_0xbaaefc['params'],_0x3ff198=await _0x5a6997[_0x2b0550(0x104)][_0x2b0550(0x16b)](_0x52cf8b);return R(_0xbaaefc['id'],_0x3ff198);}case _0xc2acfd[_0x2b0550(0x11e)]:{let _0x2fef13=await _0x5a6997[_0x2b0550(0x104)][_0x2b0550(0x118)](_0xbaaefc[_0x2b0550(0x154)]);return R(_0xbaaefc['id'],_0x2fef13);}case _0xc2acfd[_0x2b0550(0x17b)]:{let _0x4b7193=await _0x5a6997['sessionHost'][_0x2b0550(0x158)](_0xbaaefc['params']);return R(_0xbaaefc['id'],_0x4b7193);}default:return z(_0xbaaefc['id'],-0x7f59,Error(_0x2b0550(0x111)+_0xbaaefc[_0x2b0550(0x113)]));}}function E(_0x4178d4){return{async 'createWorkbook'(_0x55e554){const _0x195d98=_0x3f4c;let _0x25e853=await D(_0x55e554),_0x320681=await _0x4178d4[_0x195d98(0x163)]({..._0x55e554['cwd']===void 0x0?{}:{'cwd':_0x55e554[_0x195d98(0x142)]},'identity':_0x25e853,..._0x55e554['id']===void 0x0?{}:{'workbookId':_0x55e554['id']},..._0x55e554[_0x195d98(0x128)]===void 0x0?{}:{'workbookName':_0x55e554[_0x195d98(0x128)]}});return{'success':!0x0,'workbookData':_0x320681[_0x195d98(0x126)],'session':O(_0x320681[_0x195d98(0x12e)])};},async 'dispose'(_0x4fd4dd){const _0x36fcf6=_0x3f4c;let _0x541cb0=await D(_0x4fd4dd);return await _0x4178d4[_0x36fcf6(0x118)]({..._0x4fd4dd[_0x36fcf6(0x142)]===void 0x0?{}:{'cwd':_0x4fd4dd['cwd']},'identity':_0x541cb0}),{'disposed':!0x0,'workbookIdentity':_0x541cb0[_0x36fcf6(0x143)]};},async 'destroyAll'(_0x1019bf){await _0x4178d4['destroyAll']?.(_0x1019bf);},async 'evalJs'(_0x395caf){const _0x1e69f4=_0x3f4c;let _0xaf8274=await D(_0x395caf),_0x3d5f67=await _0x4178d4[_0x1e69f4(0x117)]({'code':_0x395caf['code'],..._0x395caf[_0x1e69f4(0x142)]===void 0x0?{}:{'cwd':_0x395caf[_0x1e69f4(0x142)]},'identity':_0xaf8274,..._0x395caf[_0x1e69f4(0x15d)]===void 0x0?{}:{'mutates':_0x395caf[_0x1e69f4(0x15d)]}});return{..._0x3d5f67[_0x1e69f4(0x146)]===void 0x0?{}:{'mutations':_0x3d5f67['mutations']},'success':!0x0,'value':_0x3d5f67[_0x1e69f4(0x171)],'session':O(_0x3d5f67[_0x1e69f4(0x12e)])};},async 'exportWorkbookData'(_0xa151d0){const _0x569375=_0x3f4c;let _0x383d61=await D(_0xa151d0),_0x2f2971=await _0x4178d4[_0x569375(0x16b)]({..._0xa151d0[_0x569375(0x142)]===void 0x0?{}:{'cwd':_0xa151d0['cwd']},'identity':_0x383d61});return{'success':!0x0,'workbookData':_0x2f2971[_0x569375(0x126)],'session':O(_0x2f2971['session'])};},async 'exportWorkbookFile'(_0xb3d896){const _0x5c27cc=_0x3f4c;let _0x3b8d91=await D(_0xb3d896),_0x58d4db=await _0x4178d4[_0x5c27cc(0x110)]({..._0xb3d896[_0x5c27cc(0x142)]===void 0x0?{}:{'cwd':_0xb3d896[_0x5c27cc(0x142)]},'format':_0xb3d896['format'],'identity':_0x3b8d91,'outputPath':_0xb3d896[_0x5c27cc(0x115)]});return{'success':!0x0,'format':_0x58d4db[_0x5c27cc(0x108)],'outputPath':_0x58d4db['outputPath'],'sizeBytes':_0x58d4db[_0x5c27cc(0x170)],'session':O(_0x58d4db[_0x5c27cc(0x12e)])};},async 'getWorkbookSession'(_0x4cade7){const _0x211c7e=_0x3f4c;let _0x2b61d1=await D(_0x4cade7),_0x4e2432=await _0x4178d4[_0x211c7e(0x168)]({..._0x4cade7[_0x211c7e(0x142)]===void 0x0?{}:{'cwd':_0x4cade7[_0x211c7e(0x142)]},'identity':_0x2b61d1});return{'exists':_0x4e2432!==null,'session':_0x4e2432===null?null:O(_0x4e2432)};},'getSessionCount'(){return _0x4178d4['getSessionCount']?.()??0x0;},'getSessionIdleTtlMs'(){const _0x439bd8=_0x3f4c;return _0x4178d4[_0x439bd8(0x129)]?.()??0xea60;},async 'loadWorkbook'(_0x5dbf26){const _0x565e3e=_0x3f4c;let _0x58e200=await D(_0x5dbf26),_0x2be461=await _0x4178d4[_0x565e3e(0x13e)]({..._0x5dbf26[_0x565e3e(0x142)]===void 0x0?{}:{'cwd':_0x5dbf26['cwd']},'identity':_0x58e200,'workbookData':_0x5dbf26[_0x565e3e(0x126)]});return{'success':!0x0,'workbookData':_0x2be461['workbookData'],'session':O(_0x2be461[_0x565e3e(0x12e)])};},async 'loadWorkbookDataReplayPack'(_0x187bfd){const _0x51bf54=_0x3f4c;let _0x523b1a=await D(_0x187bfd),_0x135171=await _0x4178d4[_0x51bf54(0x105)]({..._0x187bfd[_0x51bf54(0x142)]===void 0x0?{}:{'cwd':_0x187bfd[_0x51bf54(0x142)]},'identity':_0x523b1a,'replayPack':{'baseWorkbookData':_0x187bfd[_0x51bf54(0x179)],'mutations':_0x187bfd[_0x51bf54(0x146)]}});return{'success':!0x0,'workbookData':_0x135171[_0x51bf54(0x126)],'session':O(_0x135171['session'])};},async 'unloadIdleSessions'(){await _0x4178d4['unloadIdleSessions']?.();}};}async function D(_0x535445){const _0x43674c=_0x3f4c;return await S[_0x43674c(0x178)](_0x535445);}function O(_0x290d37){const _0x4778b9=_0x3f4c;return{'createdAt':_0x290d37[_0x4778b9(0x13b)]??'','lastAccessedAt':_0x290d37['lastAccessedAt']??'','sessionId':_0x290d37['sessionId'],'workbookIdentity':_0x290d37[_0x4778b9(0x175)][_0x4778b9(0x143)]};}function k(_0x467c4c){const _0xe926d3=_0x3f4c;return{'build.id':A(_0x467c4c['env'],_0xe926d3(0x130))??_0x467c4c[_0xe926d3(0x150)],'deployment.environment.name':'local','distribution.channel':A(_0x467c4c[_0xe926d3(0x124)],_0xe926d3(0x13c))??'unknown','service.instance.id':String(_0x467c4c[_0xe926d3(0x176)]),'service.name':_0xe926d3(0x10e),...A(_0x467c4c[_0xe926d3(0x124)],_0xe926d3(0x139))===void 0x0?{}:{'service.version':A(_0x467c4c[_0xe926d3(0x124)],_0xe926d3(0x139))}};}function A(_0x6fd27e,_0xf7a309){const _0xbc98c=_0x3f4c;let _0x4762c1=_0x6fd27e[_0xf7a309]?.[_0xbc98c(0x141)]();return _0x4762c1===void 0x0||_0x4762c1['length']===0x0?void 0x0:_0x4762c1;}async function j(_0x35d3e9){const _0x5eff9b=_0x3f4c;P(_0x35d3e9[_0x5eff9b(0x159)])&&!await N(_0x35d3e9[_0x5eff9b(0x159)])&&await F(_0x35d3e9['socketPath']);let _0x2558f6=await I(_0x35d3e9[_0x5eff9b(0x120)]);_0x2558f6!==null&&!L(_0x2558f6)&&(await _0x562f50(_0x35d3e9[_0x5eff9b(0x120)],{'force':!0x0})['catch'](()=>void 0x0),await _0x562f50(_0x35d3e9[_0x5eff9b(0x16f)],{'force':!0x0})[_0x5eff9b(0x14c)](()=>void 0x0),await _0x562f50(_0x35d3e9['lockPath'],{'recursive':!0x0,'force':!0x0})[_0x5eff9b(0x14c)](()=>void 0x0));}async function M(_0x2135e2,_0x1c8cbe){const _0x1cb674=_0x3f4c;try{return await _0x471cc2(_0x2135e2,{'recursive':!0x1,'mode':0x1c0}),!0x0;}catch(_0x14c50c){if(_0x14c50c[_0x1cb674(0x116)]!==_0x1cb674(0x10a))throw _0x14c50c;let _0x2e22df=await I(_0x1c8cbe);return _0x2e22df!==null&&L(_0x2e22df)?!0x1:(await _0x562f50(_0x2135e2,{'recursive':!0x0,'force':!0x0}),await _0x471cc2(_0x2135e2,{'recursive':!0x1,'mode':0x1c0}),!0x0);}}async function N(_0xdecea1){return await new Promise(_0x439418=>{const _0x2cc774=_0x3f4c;let _0x163bd2=_0x195171[_0x2cc774(0x173)](_0xdecea1);_0x163bd2[_0x2cc774(0x14e)](_0x2cc774(0x147),()=>{const _0x190d27=_0x2cc774;_0x163bd2[_0x190d27(0x12d)](),_0x439418(!0x0);}),_0x163bd2[_0x2cc774(0x14e)]('error',()=>{_0x439418(!0x1);});});}function P(_0x40153d){return _0x4beca5(_0x40153d)?!0x1:_0x1b8eb4(_0x40153d);}async function F(_0x851adb){_0x4beca5(_0x851adb)||await _0x562f50(_0x851adb,{'force':!0x0})['catch'](()=>void 0x0);}async function I(_0x315b1d){const _0x56b8d3=_0x3f4c;try{let _0x24ce3d=await _0x4cdcd5(_0x315b1d,_0x56b8d3(0x11f)),_0x3ef74a=Number(_0x24ce3d['trim']());return Number[_0x56b8d3(0x157)](_0x3ef74a)?_0x3ef74a:null;}catch{return null;}}function L(_0x1ea149){try{return _0x2d85b7['kill'](_0x1ea149,0x0),!0x0;}catch{return!0x1;}}function R(_0x34cc07,_0x53f9fe){const _0x4804c5=_0x3f4c;return{'jsonrpc':_0x4804c5(0x172),'id':_0x34cc07,'result':_0x53f9fe};}function z(_0x540fae,_0x1343da,_0x24de4f){const _0xe641ff=_0x3f4c;return{'jsonrpc':_0xe641ff(0x172),'id':_0x540fae,'error':{'code':_0x1343da,'message':_0x24de4f instanceof Error?_0x24de4f[_0xe641ff(0x145)]:String(_0x24de4f)}};}var B=process[_0x5c6f73(0x16e)][0x2]??_0x5c6f73(0x15e);B!==_0x5c6f73(0x15e)&&(console[_0x5c6f73(0x11d)](_0x5c6f73(0x17a)+B),process['exit'](0x1)),C()[_0x5c6f73(0x14c)](_0x5b35af=>{const _0x26f24a=_0x5c6f73;console[_0x26f24a(0x11d)](_0x5b35af instanceof Error?_0x5b35af['message']:String(_0x5b35af)),process[_0x26f24a(0x148)](0x1);});
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const _0x27129f=_0x5ccb;(function(_0x3fa448,_0x1c7266){const _0x1053ea=_0x5ccb,_0x1f2a03=_0x3fa448();while(!![]){try{const _0x3f6b79=parseInt(_0x1053ea(0x15c))/0x1*(parseInt(_0x1053ea(0x18d))/0x2)+parseInt(_0x1053ea(0x19c))/0x3*(parseInt(_0x1053ea(0x173))/0x4)+parseInt(_0x1053ea(0x16f))/0x5*(-parseInt(_0x1053ea(0x168))/0x6)+parseInt(_0x1053ea(0x197))/0x7*(-parseInt(_0x1053ea(0x1a6))/0x8)+-parseInt(_0x1053ea(0x169))/0x9+parseInt(_0x1053ea(0x185))/0xa*(parseInt(_0x1053ea(0x164))/0xb)+parseInt(_0x1053ea(0x1a9))/0xc*(parseInt(_0x1053ea(0x172))/0xd);if(_0x3f6b79===_0x1c7266)break;else _0x1f2a03['push'](_0x1f2a03['shift']());}catch(_0x279bc8){_0x1f2a03['push'](_0x1f2a03['shift']());}}}(_0x1dbe,0x33a59));import{t as _0x16dcb0}from'../chunks/build-info-BnEE6trg.js';import{n as _0x2a4303}from'../chunks/runtime-manifest-Bdf66z_K.js';import{readFileSync as _0x41e9fd}from'node:fs';function _0x5ccb(_0x71dc52,_0x498ac4){_0x71dc52=_0x71dc52-0x158;const _0x1dbec2=_0x1dbe();let _0x5ccb01=_0x1dbec2[_0x71dc52];return _0x5ccb01;}import{mkdir as _0x287c0d,readFile as _0x275bb5,rename as _0x148af6,writeFile as _0xc8a368}from'node:fs/promises';import{dirname as _0x233df6,join as _0x2a1a19,resolve as _0x3e615c}from'node:path';import{homedir as _0x26e6ed,platform as _0x500b4e}from'node:os';import{randomUUID as _0x2ffc2f}from'node:crypto';async function p(_0x3f9f59){const _0x334813=_0x5ccb;let _0x1d574e=_0x3f9f59['env']??process.env,_0xc24c7c=_0x3f9f59[_0x334813(0x177)]??_0x2a4303(_0x1d574e);if(_0xc24c7c[_0x334813(0x198)]!==_0x334813(0x171))return{'reason':_0x334813(0x17f),'status':_0x334813(0x190)};let _0x2402ab=_0x3f9f59[_0x334813(0x1a2)]??await E(_0xc24c7c['packageRoot']);if(_0x2402ab[_0x334813(0x188)]['length']===0x0)return{'reason':'missing-endpoint','status':_0x334813(0x190)};let _0x3f007=_0x3f9f59[_0x334813(0x18e)]??new Date(),_0x402181=_0x3f9f59[_0x334813(0x187)]??_0x16dcb0,_0x457a1a=_0x3f9f59[_0x334813(0x166)]??g({'env':_0x1d574e}),_0x59492c=await v({'path':_0x457a1a,..._0x3f9f59[_0x334813(0x1ab)]===void 0x0?{}:{'randomId':_0x3f9f59[_0x334813(0x1ab)]},..._0x3f9f59['stateIo']===void 0x0?{}:{'stateIo':_0x3f9f59[_0x334813(0x18b)]}});if(_0x59492c[_0x334813(0x19e)]===void 0x0)return{'reason':'state-unavailable','status':_0x334813(0x190)};if(_0x3f9f59[_0x334813(0x15d)]==='cli_first_opened'&&_0x59492c[_0x334813(0x19e)][_0x334813(0x1a8)]['cli_first_opened']!==void 0x0)return{'reason':_0x334813(0x160),'status':_0x334813(0x190)};let _0x2ed6a2=S({'buildInfo':_0x402181,'eventName':_0x3f9f59[_0x334813(0x15d)],'now':_0x3f007,'state':_0x59492c['state']});await x({'path':_0x457a1a,'state':_0x2ed6a2,..._0x3f9f59[_0x334813(0x18b)]===void 0x0?{}:{'stateIo':_0x3f9f59[_0x334813(0x18b)]}});let _0x24be91=C({'buildInfo':_0x402181,'env':_0x1d574e,'eventName':_0x3f9f59[_0x334813(0x15d)],'eventSource':_0x3f9f59[_0x334813(0x17b)],'manifest':_0xc24c7c,'state':_0x2ed6a2});try{return await(_0x3f9f59[_0x334813(0x19f)]??new O())[_0x334813(0x189)]({'capture':_0x24be91,'config':_0x2402ab}),{'status':'captured'};}catch{return{'reason':_0x334813(0x1a0),'status':_0x334813(0x190)};}}async function m(_0x409b7c={}){const _0x45a919=_0x5ccb;return await p({..._0x409b7c,'eventName':_0x45a919(0x16a),'eventSource':_0x45a919(0x182)});}async function h(_0x53ec1e={}){const _0x28ff73=_0x5ccb;return await p({..._0x53ec1e,'eventName':_0x28ff73(0x170),'eventSource':_0x28ff73(0x1a7)});}function g(_0x3ae1cf={}){const _0x2e2b7e=_0x5ccb;let _0x546cfd=(_0x3ae1cf[_0x2e2b7e(0x1aa)]??process.env)['UNIVER_HOME']?.[_0x2e2b7e(0x17d)]();return _0x3e615c(_0x546cfd&&_0x546cfd[_0x2e2b7e(0x174)]>0x0?_0x546cfd:_0x2a1a19(_0x3ae1cf[_0x2e2b7e(0x17c)]??_0x26e6ed(),_0x2e2b7e(0x19b)),'telemetry',_0x2e2b7e(0x16e));}function _(_0x361f5c={}){return{'anonymousInstallId':_0x361f5c['randomId']?.()??_0x2ffc2f(),'events':{},'version':0x1};}async function v(_0x25f555){const _0x1e9e53=_0x5ccb;let _0x775aab=_0x25f555[_0x1e9e53(0x18b)]?.[_0x1e9e53(0x19d)]??_0x275bb5;try{return{'state':y(await _0x775aab(_0x25f555[_0x1e9e53(0x17a)],_0x1e9e53(0x180)))};}catch{return{'state':_({..._0x25f555[_0x1e9e53(0x1ab)]===void 0x0?{}:{'randomId':_0x25f555[_0x1e9e53(0x1ab)]}})};}}function y(_0xb7948){const _0x3ea82e=_0x5ccb;let _0x1fe3e4=JSON['parse'](_0xb7948);if(!F(_0x1fe3e4)||_0x1fe3e4[_0x3ea82e(0x16b)]!==0x1)throw Error(_0x3ea82e(0x15a));if(typeof _0x1fe3e4[_0x3ea82e(0x16d)]!='string'||_0x1fe3e4['anonymousInstallId'][_0x3ea82e(0x174)]===0x0)throw Error('Invalid\x20product\x20telemetry\x20anonymous\x20install\x20id.');let _0xd3cdaa=F(_0x1fe3e4['events'])?_0x1fe3e4[_0x3ea82e(0x1a8)]:{};return{'anonymousInstallId':_0x1fe3e4[_0x3ea82e(0x16d)],'events':{...j(_0xd3cdaa['cli_installed'],_0x3ea82e(0x16a)),...j(_0xd3cdaa[_0x3ea82e(0x170)],'cli_first_opened')},'version':0x1};}function b(_0x4d8a7e){const _0x483b06=_0x5ccb;return JSON[_0x483b06(0x192)](_0x4d8a7e,null,0x2)+'\x0a';}async function x(_0x39a5a5){const _0x58717e=_0x5ccb;let _0x6b2641=_0x39a5a5['stateIo']?.[_0x58717e(0x191)]??_0xc8a368,_0x35a9f1=_0x39a5a5[_0x58717e(0x18b)]?.[_0x58717e(0x195)]??_0x148af6,_0x4d720a=_0x39a5a5[_0x58717e(0x17a)]+'.'+process[_0x58717e(0x163)]+'.'+Date[_0x58717e(0x18e)]()+_0x58717e(0x17e);try{await _0x287c0d(_0x233df6(_0x39a5a5[_0x58717e(0x17a)]),{'mode':0x1c0,'recursive':!0x0}),await _0x6b2641(_0x4d720a,b(_0x39a5a5['state']),{'encoding':_0x58717e(0x180),'mode':0x180}),await _0x35a9f1(_0x4d720a,_0x39a5a5[_0x58717e(0x17a)]);}catch{}}function S(_0x250249){const _0x210ebd=_0x5ccb;return{..._0x250249['state'],'events':{..._0x250249[_0x210ebd(0x19e)]['events'],[_0x250249[_0x210ebd(0x15d)]]:{'attemptedAt':_0x250249[_0x210ebd(0x18e)][_0x210ebd(0x1ac)](),'buildCommit':_0x250249[_0x210ebd(0x187)][_0x210ebd(0x15b)],'cliVersion':_0x250249[_0x210ebd(0x187)][_0x210ebd(0x16b)]}}};}function C(_0xe3a702){const _0x1c11c9=_0x5ccb;return{'distinctId':_0xe3a702[_0x1c11c9(0x19e)][_0x1c11c9(0x16d)],'event':_0xe3a702[_0x1c11c9(0x15d)],'properties':w(_0xe3a702)};}function w(_0x100828){const _0x2cad68=_0x5ccb;return{'arch':process[_0x2cad68(0x175)],'build_commit':_0x100828[_0x2cad68(0x187)]['commitHash'],'cli_version':_0x100828[_0x2cad68(0x187)][_0x2cad68(0x16b)],'distribution_channel':A(_0x100828['manifest']),'event_source':_0x100828[_0x2cad68(0x17b)],'install_manager':T(_0x100828[_0x2cad68(0x1aa)]??process.env),'node_major_version':M(process[_0x2cad68(0x178)][_0x2cad68(0x158)]),'package_name':k(_0x100828[_0x2cad68(0x177)]),'platform':_0x500b4e(),'telemetry_state_version':0x1};}function T(_0x3645be=process.env){const _0xcd7380=_0x5ccb;let _0x549a80=process[_0xcd7380(0x178)];if(typeof _0x549a80[_0xcd7380(0x159)]==_0xcd7380(0x186)&&_0x549a80['bun'][_0xcd7380(0x174)]>0x0)return _0xcd7380(0x159);let _0x4890e2=_0x3645be[_0xcd7380(0x167)]??'';if(/\bbun\//u[_0xcd7380(0x1ad)](_0x4890e2))return _0xcd7380(0x159);if(/\bpnpm\//u['test'](_0x4890e2))return _0xcd7380(0x1a1);if(/\byarn\//u['test'](_0x4890e2))return _0xcd7380(0x16c);if(/\bnpm\//u[_0xcd7380(0x1ad)](_0x4890e2))return'npm';let _0x1bc32b=_0x3645be['npm_execpath']??'';return/(^|[/\\])bun(?:\.exe)?$/u['test'](_0x1bc32b)?'bun':/(^|[/\\])pnpm(?:\.cmd|\.ps1|\.exe)?$/u['test'](_0x1bc32b)?'pnpm':/(^|[/\\])yarn(?:\.cmd|\.ps1|\.exe)?$/u[_0xcd7380(0x1ad)](_0x1bc32b)?'yarn':/(^|[/\\])npm(?:\.cmd|\.ps1|\.exe)?$/u[_0xcd7380(0x1ad)](_0x1bc32b)?_0xcd7380(0x184):_0x3645be[_0xcd7380(0x196)]==='1'?_0xcd7380(0x159):_0x3645be['UNIVER_MANAGED_BY_NPM']==='1'?_0xcd7380(0x184):_0xcd7380(0x18a);}async function E(_0x3edb2a){const _0x2fda76=_0x5ccb;try{let _0x46af9a=await _0x275bb5(_0x2a1a19(_0x3edb2a,'internal','product-telemetry.json'),_0x2fda76(0x180));return D(JSON['parse'](_0x46af9a));}catch{return D({});}}function D(_0x53c863){const _0x5876a4=_0x5ccb;let _0x39bb43=F(_0x53c863)?_0x53c863:{};return{'endpoint':N(_0x39bb43['endpoint'],_0x5876a4(0x1a4)),'timeoutMs':P(_0x39bb43['timeoutMs'],0x2ee)};}var O=class{async['capture'](_0x3b37cf){const _0x26c9d5=_0x5ccb;let _0x5bb496=await fetch(_0x3b37cf[_0x26c9d5(0x1a2)][_0x26c9d5(0x188)],{'body':JSON[_0x26c9d5(0x192)]({'distinctId':_0x3b37cf[_0x26c9d5(0x189)][_0x26c9d5(0x1a3)],'event':_0x3b37cf[_0x26c9d5(0x189)]['event'],'properties':_0x3b37cf[_0x26c9d5(0x189)]['properties']}),'headers':{'content-type':_0x26c9d5(0x19a)},'method':'POST','signal':AbortSignal[_0x26c9d5(0x179)](_0x3b37cf[_0x26c9d5(0x1a2)]['timeoutMs'])});if(!_0x5bb496['ok'])throw Error('CLI\x20telemetry\x20proxy\x20failed\x20with\x20status\x20'+_0x5bb496[_0x26c9d5(0x181)]);}};function k(_0x255a34){const _0x3496ad=_0x5ccb;try{let _0x51047f=JSON['parse'](_0x41e9fd(_0x2a1a19(_0x255a34[_0x3496ad(0x1a5)],_0x3496ad(0x18f)),'utf8'));return typeof _0x51047f['name']=='string'&&_0x51047f[_0x3496ad(0x15f)][_0x3496ad(0x17d)]()[_0x3496ad(0x174)]>0x0?_0x51047f[_0x3496ad(0x15f)]:_0x3496ad(0x199);}catch{return _0x3496ad(0x199);}}function A(_0x323978){const _0x3ae389=_0x5ccb;let _0xa0e864=k(_0x323978);return _0xa0e864===_0x3ae389(0x18c)?'internal-github':_0xa0e864===_0x3ae389(0x199)?'public-npm':_0x323978[_0x3ae389(0x198)];}function j(_0x3b280d,_0x88a99a){const _0x30c50a=_0x5ccb;return!F(_0x3b280d)||typeof _0x3b280d['attemptedAt']!=_0x30c50a(0x186)||typeof _0x3b280d[_0x30c50a(0x1ae)]!=_0x30c50a(0x186)||typeof _0x3b280d[_0x30c50a(0x176)]!=_0x30c50a(0x186)?{}:{[_0x88a99a]:{'attemptedAt':_0x3b280d[_0x30c50a(0x165)],'buildCommit':_0x3b280d[_0x30c50a(0x1ae)],'cliVersion':_0x3b280d['cliVersion']}};}function _0x1dbe(){const _0x31c5f7=['env','randomId','toISOString','test','buildCommit','node','bun','Invalid\x20product\x20telemetry\x20state\x20version.','commitHash','9AfLNca','eventName','first-open','name','already-attempted','number','argv','pid','2563682eAgafC','attemptedAt','statePath','npm_config_user_agent','810384ZefbxN','1560879JQxDbu','cli_installed','version','yarn','anonymousInstallId','state.json','10VeaiAL','cli_first_opened','packaged','2817542AoZzNY','4eOePqp','length','arch','cliVersion','manifest','versions','timeout','path','eventSource','homeDir','trim','.tmp','not-packaged','utf8','status','postinstall','object','npm','10ONDXCi','string','buildInfo','endpoint','capture','unknown','stateIo','@dream-num/univer-cli','9786viSGgq','now','package.json','skipped','writeFile','stringify','isSafeInteger','split','rename','UNIVER_MANAGED_BY_BUN','14jHKJGB','mode','univer-cli','application/json','.univer','657171ornxKV','readFile','state','transport','capture-failed','pnpm','config','distinctId','https://univer.ai/api/telemetry/cli','packageRoot','231144rCAeiu','cli-startup','events','12gTbdbi'];_0x1dbe=function(){return _0x31c5f7;};return _0x1dbe();}function M(_0x27b92a){const _0x543694=_0x5ccb;let _0x184f1e=Number(_0x27b92a[_0x543694(0x194)]('.')[0x0]);return Number[_0x543694(0x193)](_0x184f1e)&&_0x184f1e>0x0?_0x184f1e:void 0x0;}function N(_0x431563,_0x2937c6){const _0x1d9cef=_0x5ccb;return typeof _0x431563==_0x1d9cef(0x186)&&_0x431563['trim']()[_0x1d9cef(0x174)]>0x0?_0x431563[_0x1d9cef(0x17d)]():_0x2937c6;}function P(_0x3eb55b,_0xf36a94){const _0x7ee06=_0x5ccb;return typeof _0x3eb55b==_0x7ee06(0x161)&&Number['isSafeInteger'](_0x3eb55b)&&_0x3eb55b>0x0?_0x3eb55b:_0xf36a94;}function F(_0x10fd47){const _0x18c92a=_0x5ccb;return typeof _0x10fd47==_0x18c92a(0x183)&&!!_0x10fd47;}var I=process[_0x27129f(0x162)][0x2];try{I===_0x27129f(0x15e)?await h():I===_0x27129f(0x182)&&await m();}catch{}
2
+ const _0x244bcb=_0x53e1;(function(_0x36eb40,_0x99db7c){const _0x409d70=_0x53e1,_0x5063de=_0x36eb40();while(!![]){try{const _0x59b336=-parseInt(_0x409d70(0x192))/0x1+parseInt(_0x409d70(0x186))/0x2+-parseInt(_0x409d70(0x196))/0x3+parseInt(_0x409d70(0x1c2))/0x4*(-parseInt(_0x409d70(0x1ac))/0x5)+-parseInt(_0x409d70(0x18c))/0x6+-parseInt(_0x409d70(0x1a3))/0x7+-parseInt(_0x409d70(0x1b6))/0x8*(-parseInt(_0x409d70(0x19e))/0x9);if(_0x59b336===_0x99db7c)break;else _0x5063de['push'](_0x5063de['shift']());}catch(_0x338299){_0x5063de['push'](_0x5063de['shift']());}}}(_0x3a6e,0x28e72));import{t as _0x39e8b0}from'../chunks/build-info-Co38QUsZ.js';import{n as _0x4f5a19}from'../chunks/runtime-manifest-Bdf66z_K.js';import{readFileSync as _0x41ffaf}from'node:fs';function _0x53e1(_0x5ad5b8,_0x4dd83b){_0x5ad5b8=_0x5ad5b8-0x179;const _0x3a6e9c=_0x3a6e();let _0x53e166=_0x3a6e9c[_0x5ad5b8];return _0x53e166;}import{mkdir as _0x1cd8a9,readFile as _0x109b7b,rename as _0xdf72ab,writeFile as _0xcbb0e1}from'node:fs/promises';import{dirname as _0x17811f,join as _0x4ba13b,resolve as _0xec7717}from'node:path';import{homedir as _0x171a64,platform as _0x31b47a}from'node:os';import{randomUUID as _0x31519b}from'node:crypto';async function p(_0x34881f){const _0x47c9b1=_0x53e1;let _0x9c76cd=_0x34881f['env']??process.env,_0x5218c6=_0x34881f[_0x47c9b1(0x189)]??_0x4f5a19(_0x9c76cd);if(_0x5218c6['mode']!==_0x47c9b1(0x198))return{'reason':_0x47c9b1(0x17e),'status':_0x47c9b1(0x1c0)};let _0x1e4d49=_0x34881f[_0x47c9b1(0x1d1)]??await E(_0x5218c6[_0x47c9b1(0x1b0)]);if(_0x1e4d49['endpoint'][_0x47c9b1(0x19b)]===0x0)return{'reason':'missing-endpoint','status':_0x47c9b1(0x1c0)};let _0x1be4e6=_0x34881f[_0x47c9b1(0x1a2)]??new Date(),_0x8f6c1c=_0x34881f[_0x47c9b1(0x1ab)]??_0x39e8b0,_0x180db9=_0x34881f['statePath']??g({'env':_0x9c76cd}),_0x14a84f=await v({'path':_0x180db9,..._0x34881f[_0x47c9b1(0x179)]===void 0x0?{}:{'randomId':_0x34881f[_0x47c9b1(0x179)]},..._0x34881f[_0x47c9b1(0x1a4)]===void 0x0?{}:{'stateIo':_0x34881f['stateIo']}});if(_0x14a84f[_0x47c9b1(0x1ce)]===void 0x0)return{'reason':_0x47c9b1(0x1d2),'status':_0x47c9b1(0x1c0)};if(_0x34881f['eventName']==='cli_first_opened'&&_0x14a84f[_0x47c9b1(0x1ce)][_0x47c9b1(0x17f)][_0x47c9b1(0x1b4)]!==void 0x0)return{'reason':_0x47c9b1(0x18f),'status':_0x47c9b1(0x1c0)};let _0x3cd5c2=S({'buildInfo':_0x8f6c1c,'eventName':_0x34881f[_0x47c9b1(0x1c7)],'now':_0x1be4e6,'state':_0x14a84f['state']});await x({'path':_0x180db9,'state':_0x3cd5c2,..._0x34881f[_0x47c9b1(0x1a4)]===void 0x0?{}:{'stateIo':_0x34881f[_0x47c9b1(0x1a4)]}});let _0x5cef79=C({'buildInfo':_0x8f6c1c,'env':_0x9c76cd,'eventName':_0x34881f[_0x47c9b1(0x1c7)],'eventSource':_0x34881f[_0x47c9b1(0x1b7)],'manifest':_0x5218c6,'state':_0x3cd5c2});try{return await(_0x34881f[_0x47c9b1(0x1cf)]??new O())[_0x47c9b1(0x182)]({'capture':_0x5cef79,'config':_0x1e4d49}),{'status':_0x47c9b1(0x19a)};}catch{return{'reason':_0x47c9b1(0x1a9),'status':_0x47c9b1(0x1c0)};}}async function m(_0x5ad075={}){const _0x415721=_0x53e1;return await p({..._0x5ad075,'eventName':_0x415721(0x1c5),'eventSource':'postinstall'});}async function h(_0x1ceb34={}){const _0x4d4d9b=_0x53e1;return await p({..._0x1ceb34,'eventName':_0x4d4d9b(0x1b4),'eventSource':_0x4d4d9b(0x1ba)});}function g(_0x121e35={}){const _0x2721e0=_0x53e1;let _0x22831c=(_0x121e35['env']??process.env)[_0x2721e0(0x1c1)]?.[_0x2721e0(0x1c3)]();return _0xec7717(_0x22831c&&_0x22831c[_0x2721e0(0x19b)]>0x0?_0x22831c:_0x4ba13b(_0x121e35[_0x2721e0(0x17c)]??_0x171a64(),_0x2721e0(0x18d)),_0x2721e0(0x19d),_0x2721e0(0x17d));}function _(_0x456c7c={}){const _0x54ad33=_0x53e1;return{'anonymousInstallId':_0x456c7c[_0x54ad33(0x179)]?.()??_0x31519b(),'events':{},'version':0x1};}async function v(_0x36ab00){const _0x327d40=_0x53e1;let _0x2caccb=_0x36ab00[_0x327d40(0x1a4)]?.[_0x327d40(0x1bf)]??_0x109b7b;try{return{'state':y(await _0x2caccb(_0x36ab00[_0x327d40(0x1ae)],'utf8'))};}catch{return{'state':_({..._0x36ab00[_0x327d40(0x179)]===void 0x0?{}:{'randomId':_0x36ab00[_0x327d40(0x179)]}})};}}function y(_0x578d30){const _0x19291e=_0x53e1;let _0x16fca2=JSON['parse'](_0x578d30);if(!F(_0x16fca2)||_0x16fca2[_0x19291e(0x1b9)]!==0x1)throw Error(_0x19291e(0x1a0));if(typeof _0x16fca2[_0x19291e(0x19f)]!=_0x19291e(0x1bb)||_0x16fca2[_0x19291e(0x19f)]['length']===0x0)throw Error('Invalid\x20product\x20telemetry\x20anonymous\x20install\x20id.');let _0x3cbce9=F(_0x16fca2['events'])?_0x16fca2['events']:{};return{'anonymousInstallId':_0x16fca2[_0x19291e(0x19f)],'events':{...j(_0x3cbce9[_0x19291e(0x1c5)],_0x19291e(0x1c5)),...j(_0x3cbce9[_0x19291e(0x1b4)],'cli_first_opened')},'version':0x1};}function b(_0x4457df){return JSON['stringify'](_0x4457df,null,0x2)+'\x0a';}async function x(_0x3b4dbe){const _0x36d3ee=_0x53e1;let _0xc5f3a4=_0x3b4dbe['stateIo']?.[_0x36d3ee(0x1c4)]??_0xcbb0e1,_0x26faa4=_0x3b4dbe[_0x36d3ee(0x1a4)]?.[_0x36d3ee(0x1b1)]??_0xdf72ab,_0x33c5f4=_0x3b4dbe[_0x36d3ee(0x1ae)]+'.'+process[_0x36d3ee(0x1cc)]+'.'+Date['now']()+_0x36d3ee(0x1b3);try{await _0x1cd8a9(_0x17811f(_0x3b4dbe[_0x36d3ee(0x1ae)]),{'mode':0x1c0,'recursive':!0x0}),await _0xc5f3a4(_0x33c5f4,b(_0x3b4dbe['state']),{'encoding':_0x36d3ee(0x1a7),'mode':0x180}),await _0x26faa4(_0x33c5f4,_0x3b4dbe['path']);}catch{}}function S(_0x1a9949){const _0x26f85f=_0x53e1;return{..._0x1a9949[_0x26f85f(0x1ce)],'events':{..._0x1a9949[_0x26f85f(0x1ce)][_0x26f85f(0x17f)],[_0x1a9949[_0x26f85f(0x1c7)]]:{'attemptedAt':_0x1a9949[_0x26f85f(0x1a2)][_0x26f85f(0x1af)](),'buildCommit':_0x1a9949[_0x26f85f(0x1ab)][_0x26f85f(0x1a5)],'cliVersion':_0x1a9949[_0x26f85f(0x1ab)][_0x26f85f(0x1b9)]}}};}function C(_0x29f668){const _0x5df908=_0x53e1;return{'distinctId':_0x29f668[_0x5df908(0x1ce)][_0x5df908(0x19f)],'event':_0x29f668[_0x5df908(0x1c7)],'properties':w(_0x29f668)};}function w(_0x164fa6){const _0xac861=_0x53e1;return{'arch':process[_0xac861(0x1a1)],'build_commit':_0x164fa6[_0xac861(0x1ab)]['commitHash'],'cli_version':_0x164fa6[_0xac861(0x1ab)][_0xac861(0x1b9)],'distribution_channel':A(_0x164fa6['manifest']),'event_source':_0x164fa6[_0xac861(0x1b7)],'install_manager':T(_0x164fa6[_0xac861(0x193)]??process.env),'node_major_version':M(process[_0xac861(0x181)][_0xac861(0x1b5)]),'package_name':k(_0x164fa6[_0xac861(0x189)]),'platform':_0x31b47a(),'telemetry_state_version':0x1};}function T(_0x352617=process.env){const _0x472aad=_0x53e1;let _0x35f602=process['versions'];if(typeof _0x35f602[_0x472aad(0x184)]==_0x472aad(0x1bb)&&_0x35f602['bun']['length']>0x0)return'bun';let _0x1c35df=_0x352617[_0x472aad(0x190)]??'';if(/\bbun\//u[_0x472aad(0x1bd)](_0x1c35df))return'bun';if(/\bpnpm\//u[_0x472aad(0x1bd)](_0x1c35df))return _0x472aad(0x1cd);if(/\byarn\//u[_0x472aad(0x1bd)](_0x1c35df))return'yarn';if(/\bnpm\//u[_0x472aad(0x1bd)](_0x1c35df))return _0x472aad(0x1b2);let _0x4c3391=_0x352617[_0x472aad(0x18a)]??'';return/(^|[/\\])bun(?:\.exe)?$/u[_0x472aad(0x1bd)](_0x4c3391)?_0x472aad(0x184):/(^|[/\\])pnpm(?:\.cmd|\.ps1|\.exe)?$/u['test'](_0x4c3391)?_0x472aad(0x1cd):/(^|[/\\])yarn(?:\.cmd|\.ps1|\.exe)?$/u[_0x472aad(0x1bd)](_0x4c3391)?_0x472aad(0x17a):/(^|[/\\])npm(?:\.cmd|\.ps1|\.exe)?$/u['test'](_0x4c3391)?_0x472aad(0x1b2):_0x352617[_0x472aad(0x18e)]==='1'?_0x472aad(0x184):_0x352617[_0x472aad(0x183)]==='1'?'npm':_0x472aad(0x195);}async function E(_0x1d7be1){const _0x4fb8e2=_0x53e1;try{let _0x25695e=await _0x109b7b(_0x4ba13b(_0x1d7be1,_0x4fb8e2(0x191),_0x4fb8e2(0x197)),'utf8');return D(JSON[_0x4fb8e2(0x19c)](_0x25695e));}catch{return D({});}}function D(_0xc1df37){const _0x2685a9=_0x53e1;let _0x5b45bc=F(_0xc1df37)?_0xc1df37:{};return{'endpoint':N(_0x5b45bc['endpoint'],_0x2685a9(0x18b)),'timeoutMs':P(_0x5b45bc['timeoutMs'],0x2ee)};}var O=class{async[_0x244bcb(0x182)](_0x406a3b){const _0x4878f8=_0x244bcb;let _0x47814b=await fetch(_0x406a3b[_0x4878f8(0x1d1)][_0x4878f8(0x1d3)],{'body':JSON[_0x4878f8(0x194)]({'distinctId':_0x406a3b[_0x4878f8(0x182)]['distinctId'],'event':_0x406a3b[_0x4878f8(0x182)][_0x4878f8(0x1ad)],'properties':_0x406a3b['capture'][_0x4878f8(0x1c8)]}),'headers':{'content-type':_0x4878f8(0x1d0)},'method':_0x4878f8(0x1ca),'signal':AbortSignal[_0x4878f8(0x1a8)](_0x406a3b[_0x4878f8(0x1d1)][_0x4878f8(0x1bc)])});if(!_0x47814b['ok'])throw Error('CLI\x20telemetry\x20proxy\x20failed\x20with\x20status\x20'+_0x47814b[_0x4878f8(0x1c6)]);}};function k(_0x13f1e3){const _0x43de22=_0x244bcb;try{let _0x5b9ea2=JSON[_0x43de22(0x19c)](_0x41ffaf(_0x4ba13b(_0x13f1e3[_0x43de22(0x1b0)],'package.json'),_0x43de22(0x1a7)));return typeof _0x5b9ea2[_0x43de22(0x1b8)]==_0x43de22(0x1bb)&&_0x5b9ea2[_0x43de22(0x1b8)][_0x43de22(0x1c3)]()['length']>0x0?_0x5b9ea2[_0x43de22(0x1b8)]:_0x43de22(0x1aa);}catch{return _0x43de22(0x1aa);}}function A(_0x536b96){const _0x26bd67=_0x244bcb;let _0x27f026=k(_0x536b96);return _0x27f026===_0x26bd67(0x17b)?'internal-github':_0x27f026===_0x26bd67(0x1aa)?_0x26bd67(0x1cb):_0x536b96['mode'];}function _0x3a6e(){const _0x1c1a40=['UNIVER_HOME','548UPxsgX','trim','writeFile','cli_installed','status','eventName','properties','buildCommit','POST','public-npm','pid','pnpm','state','transport','application/json','config','state-unavailable','endpoint','randomId','yarn','@dream-num/univer-cli','homeDir','state.json','not-packaged','events','number','versions','capture','UNIVER_MANAGED_BY_NPM','bun','attemptedAt','200336ebMuaV','cliVersion','object','manifest','npm_execpath','https://univer.ai/api/telemetry/cli','658236JQXHmd','.univer','UNIVER_MANAGED_BY_BUN','already-attempted','npm_config_user_agent','internal','276654CwfrXa','env','stringify','unknown','523659RVTwtO','product-telemetry.json','packaged','split','captured','length','parse','telemetry','63SCJAeg','anonymousInstallId','Invalid\x20product\x20telemetry\x20state\x20version.','arch','now','111202RHqSEx','stateIo','commitHash','argv','utf8','timeout','capture-failed','univer-cli','buildInfo','10945ZLZMAc','event','path','toISOString','packageRoot','rename','npm','.tmp','cli_first_opened','node','1078928pUuLXN','eventSource','name','version','cli-startup','string','timeoutMs','test','first-open','readFile','skipped'];_0x3a6e=function(){return _0x1c1a40;};return _0x3a6e();}function j(_0x52c0bf,_0x45d45d){const _0x3de57a=_0x244bcb;return!F(_0x52c0bf)||typeof _0x52c0bf[_0x3de57a(0x185)]!=_0x3de57a(0x1bb)||typeof _0x52c0bf['buildCommit']!=_0x3de57a(0x1bb)||typeof _0x52c0bf[_0x3de57a(0x187)]!=_0x3de57a(0x1bb)?{}:{[_0x45d45d]:{'attemptedAt':_0x52c0bf[_0x3de57a(0x185)],'buildCommit':_0x52c0bf[_0x3de57a(0x1c9)],'cliVersion':_0x52c0bf['cliVersion']}};}function M(_0x2f7d7c){const _0x54c986=_0x244bcb;let _0x2abba0=Number(_0x2f7d7c[_0x54c986(0x199)]('.')[0x0]);return Number['isSafeInteger'](_0x2abba0)&&_0x2abba0>0x0?_0x2abba0:void 0x0;}function N(_0x3936d9,_0x48edd6){const _0x40a8ed=_0x244bcb;return typeof _0x3936d9==_0x40a8ed(0x1bb)&&_0x3936d9['trim']()['length']>0x0?_0x3936d9[_0x40a8ed(0x1c3)]():_0x48edd6;}function P(_0x5aab2c,_0x18f6a6){const _0x1bb360=_0x244bcb;return typeof _0x5aab2c==_0x1bb360(0x180)&&Number['isSafeInteger'](_0x5aab2c)&&_0x5aab2c>0x0?_0x5aab2c:_0x18f6a6;}function F(_0x5f3c27){const _0xefcfcd=_0x244bcb;return typeof _0x5f3c27==_0xefcfcd(0x188)&&!!_0x5f3c27;}var I=process[_0x244bcb(0x1a6)][0x2];try{I===_0x244bcb(0x1be)?await h():I==='postinstall'&&await m();}catch{}
@@ -1 +1 @@
1
- const _0x1d97fe=_0x5741;(function(_0x1ce011,_0x4c0ad3){const _0x4e04ba=_0x5741,_0x408327=_0x1ce011();while(!![]){try{const _0x5ec859=parseInt(_0x4e04ba(0x8e))/0x1*(-parseInt(_0x4e04ba(0x9a))/0x2)+parseInt(_0x4e04ba(0xb0))/0x3*(-parseInt(_0x4e04ba(0xb1))/0x4)+-parseInt(_0x4e04ba(0xb4))/0x5+-parseInt(_0x4e04ba(0x9d))/0x6+parseInt(_0x4e04ba(0xac))/0x7+parseInt(_0x4e04ba(0x97))/0x8*(parseInt(_0x4e04ba(0xad))/0x9)+parseInt(_0x4e04ba(0x8c))/0xa;if(_0x5ec859===_0x4c0ad3)break;else _0x408327['push'](_0x408327['shift']());}catch(_0x506010){_0x408327['push'](_0x408327['shift']());}}}(_0x2c40,0x42440));import'../chunks/vendor-DHdfSSPw.js';import{t as _0x18ed3e}from'../chunks/headless-univer-DJXH7ZfL.js';import{n as _0x357112,o as _0x167590,t as _0x2dff01}from'../chunks/trace-DPfd8LdJ.js';let i=function(_0x1a0cef){const _0x158a56=_0x5741;return _0x1a0cef[_0x158a56(0x98)]=_0x158a56(0x9e),_0x1a0cef[_0x158a56(0xa3)]=_0x158a56(0x92),_0x1a0cef['ExportWorkbookFile']=_0x158a56(0x96),_0x1a0cef[_0x158a56(0x9b)]=_0x158a56(0x90),_0x1a0cef[_0x158a56(0xb5)]=_0x158a56(0xa6),_0x1a0cef[_0x158a56(0x99)]=_0x158a56(0x9f),_0x1a0cef;}({});var a=class{[_0x1d97fe(0xa8)]=Promise['resolve']();async[_0x1d97fe(0xb2)](_0x4f0542){const _0x2bb59f=_0x1d97fe;let _0xdf4c5d=this[_0x2bb59f(0xa8)],_0x17aee5;this[_0x2bb59f(0xa8)]=new Promise(_0x4a5ca9=>{_0x17aee5=_0x4a5ca9;}),await _0xdf4c5d;try{return await _0x4f0542();}finally{_0x17aee5?.();}}},o=_0x18ed3e(),s=new a();process['send']?.({'type':'ready'}),process['on'](_0x1d97fe(0x95),async _0x3dfc45=>{const _0x641970=_0x1d97fe;if(_0x3dfc45?.[_0x641970(0x8f)]!==_0x641970(0xae))return;let _0x564a99=await c(_0x3dfc45['data']);process['send']?.({'type':'rpc-response','id':_0x3dfc45['id'],'data':_0x564a99});}),process['on'](_0x1d97fe(0xa0),()=>{const _0x13dbe4=_0x1d97fe;o[_0x13dbe4(0xa1)](),process['exit'](0x0);}),process['on']('SIGTERM',()=>{const _0x43def1=_0x1d97fe;o[_0x43def1(0xa1)](),process[_0x43def1(0xb6)](0x0);});function _0x5741(_0x5b96a4,_0x54eaec){_0x5b96a4=_0x5b96a4-0x8b;const _0x2c40d3=_0x2c40();let _0x574149=_0x2c40d3[_0x5b96a4];return _0x574149;}async function c(_0x613df8){const _0x3c8a36=_0x1d97fe;let _0x1847da=_0x2dff01(_0x613df8[_0x3c8a36(0xa5)]?.[_0x3c8a36(0xb7)]),_0x758939=async()=>await _0x357112[_0x3c8a36(0x93)]({'name':_0x167590[_0x3c8a36(0xa2)],'kind':'server'},async()=>await l(_0x613df8));return _0x1847da===void 0x0?await _0x758939():await _0x357112[_0x3c8a36(0xa9)](_0x1847da,_0x758939);}async function l(_0x4c4c8a){const _0x551bb5=_0x1d97fe;try{switch(_0x4c4c8a[_0x551bb5(0x91)]){case i[_0x551bb5(0x98)]:{let _0xd06d97=o[_0x551bb5(0x9e)](_0x4c4c8a[_0x551bb5(0x8d)]??{});return{'jsonrpc':_0x551bb5(0xb3),'id':_0x4c4c8a['id'],'result':{'success':!0x0,'workbookData':_0xd06d97}};}case i[_0x551bb5(0xb5)]:{let _0x351818=o[_0x551bb5(0xab)](_0x4c4c8a['params']['workbookData']);return{'jsonrpc':'2.0','id':_0x4c4c8a['id'],'result':{'success':!0x0,'workbookData':_0x351818}};}case i[_0x551bb5(0x99)]:{let _0x358541=await o[_0x551bb5(0x9f)](_0x4c4c8a[_0x551bb5(0x8d)]);return{'jsonrpc':_0x551bb5(0xb3),'id':_0x4c4c8a['id'],'result':{'success':!0x0,'workbookData':_0x358541}};}case i[_0x551bb5(0x9b)]:return{'jsonrpc':_0x551bb5(0xb3),'id':_0x4c4c8a['id'],'result':{'success':!0x0,'workbookData':o[_0x551bb5(0x90)]()}};case i[_0x551bb5(0xa7)]:{let _0x1545ec=_0x4c4c8a[_0x551bb5(0x8d)],_0x11db0d=await o[_0x551bb5(0x96)](_0x1545ec[_0x551bb5(0x94)],_0x1545ec['format']);return{'jsonrpc':_0x551bb5(0xb3),'id':_0x4c4c8a['id'],'result':{'success':!0x0,..._0x11db0d}};}case i[_0x551bb5(0xa3)]:{let _0x533081=_0x4c4c8a['params']??{},_0x461147=async()=>{const _0x5f0ca8=_0x551bb5;let _0x2e0999=_0x533081[_0x5f0ca8(0xa4)]?await o['evalJsWithMutationCapture'](_0x533081[_0x5f0ca8(0x9c)]):{'value':await o[_0x5f0ca8(0x8b)](_0x533081[_0x5f0ca8(0x9c)]),'mutations':void 0x0};return{'success':!0x0,..._0x2e0999[_0x5f0ca8(0xaf)]===void 0x0?{}:{'mutations':_0x2e0999[_0x5f0ca8(0xaf)]},'value':_0x2e0999[_0x5f0ca8(0xaa)]};},_0x37960b=_0x533081['mutates']?await s['enqueue'](_0x461147):await _0x461147();return{'jsonrpc':_0x551bb5(0xb3),'id':_0x4c4c8a['id'],'result':_0x37960b};}default:throw Error('Method\x20not\x20implemented:\x20'+String(_0x4c4c8a['method']));}}catch(_0x438f6f){return{'jsonrpc':_0x551bb5(0xb3),'id':_0x4c4c8a['id'],'error':{'code':-0x7f5b,'message':_0x438f6f instanceof Error?_0x438f6f['message']:String(_0x438f6f)}};}}function _0x2c40(){const _0x1ece24=['14248320hPIkng','params','32QZTNem','type','exportWorkbookData','method','evaljs','withSpan','outputPath','message','exportWorkbookFile','56bzgiyT','CreateWorkbook','LoadWorkbookDataReplayPack','15292eJAvOB','ExportWorkbookData','code','1574676HuCJxE','createWorkbook','loadWorkbookDataReplayPack','disconnect','dispose','RuntimeRpcClient','EvalJs','mutates','meta','loadWorkbook','ExportWorkbookFile','tail','withContext','value','loadWorkbookData','500633YjZIIc','202491DHAhDv','rpc-request','mutations','423PnODLm','12452bVcTqF','enqueue','2.0','2181845ePWtmn','LoadWorkbook','exit','traceparent','evalJs'];_0x2c40=function(){return _0x1ece24;};return _0x2c40();}
1
+ const _0x3e0c18=_0x4dac;(function(_0x1b5a63,_0x4a897b){const _0x105af0=_0x4dac,_0x41d34f=_0x1b5a63();while(!![]){try{const _0x188267=parseInt(_0x105af0(0x17d))/0x1*(parseInt(_0x105af0(0x18c))/0x2)+parseInt(_0x105af0(0x179))/0x3*(parseInt(_0x105af0(0x19e))/0x4)+-parseInt(_0x105af0(0x185))/0x5+-parseInt(_0x105af0(0x17f))/0x6*(parseInt(_0x105af0(0x1a6))/0x7)+-parseInt(_0x105af0(0x182))/0x8+parseInt(_0x105af0(0x1a0))/0x9*(-parseInt(_0x105af0(0x181))/0xa)+parseInt(_0x105af0(0x19c))/0xb;if(_0x188267===_0x4a897b)break;else _0x41d34f['push'](_0x41d34f['shift']());}catch(_0x281e89){_0x41d34f['push'](_0x41d34f['shift']());}}}(_0x5a51,0x9f90c));function _0x4dac(_0x45e69a,_0x405a1f){_0x45e69a=_0x45e69a-0x178;const _0x5a512e=_0x5a51();let _0x4dacbe=_0x5a512e[_0x45e69a];return _0x4dacbe;}import'../chunks/vendor-BzHSCzgc.js';import{t as _0x20734c}from'../chunks/headless-univer-BHRYaTxY.js';import{n as _0x44111e,o as _0xfdb43c,t as _0x2239a9}from'../chunks/trace-DPfd8LdJ.js';let i=function(_0x30b23b){const _0x455485=_0x4dac;return _0x30b23b[_0x455485(0x190)]='createWorkbook',_0x30b23b[_0x455485(0x187)]=_0x455485(0x194),_0x30b23b['ExportWorkbookFile']=_0x455485(0x17a),_0x30b23b['ExportWorkbookData']='exportWorkbookData',_0x30b23b[_0x455485(0x184)]='loadWorkbook',_0x30b23b[_0x455485(0x1a7)]=_0x455485(0x18e),_0x30b23b;}({});var a=class{[_0x3e0c18(0x189)]=Promise['resolve']();async['enqueue'](_0x2e7542){const _0x358b7d=_0x3e0c18;let _0x2f1e69=this[_0x358b7d(0x189)],_0x2ce364;this[_0x358b7d(0x189)]=new Promise(_0x20d17e=>{_0x2ce364=_0x20d17e;}),await _0x2f1e69;try{return await _0x2e7542();}finally{_0x2ce364?.();}}},o=_0x20734c(),s=new a();process[_0x3e0c18(0x19a)]?.({'type':_0x3e0c18(0x188)}),process['on']('message',async _0x29b9e6=>{const _0x393350=_0x3e0c18;if(_0x29b9e6?.[_0x393350(0x193)]!==_0x393350(0x191))return;let _0x2b22c3=await c(_0x29b9e6[_0x393350(0x192)]);process[_0x393350(0x19a)]?.({'type':_0x393350(0x195),'id':_0x29b9e6['id'],'data':_0x2b22c3});}),process['on']('disconnect',()=>{const _0x3e6dda=_0x3e0c18;o[_0x3e6dda(0x18a)](),process[_0x3e6dda(0x17c)](0x0);}),process['on'](_0x3e0c18(0x1a1),()=>{const _0x9f7347=_0x3e0c18;o[_0x9f7347(0x18a)](),process[_0x9f7347(0x17c)](0x0);});async function c(_0xfeb80e){const _0x15d148=_0x3e0c18;let _0x1e1d0e=_0x2239a9(_0xfeb80e[_0x15d148(0x19f)]?.[_0x15d148(0x1a2)]),_0x57486e=async()=>await _0x44111e[_0x15d148(0x19d)]({'name':_0xfdb43c[_0x15d148(0x178)],'kind':'server'},async()=>await l(_0xfeb80e));return _0x1e1d0e===void 0x0?await _0x57486e():await _0x44111e['withContext'](_0x1e1d0e,_0x57486e);}async function l(_0x4363f9){const _0x12338e=_0x3e0c18;try{switch(_0x4363f9['method']){case i[_0x12338e(0x190)]:{let _0x4ebfee=o[_0x12338e(0x17b)](_0x4363f9[_0x12338e(0x1a4)]??{});return{'jsonrpc':'2.0','id':_0x4363f9['id'],'result':{'success':!0x0,'workbookData':_0x4ebfee}};}case i[_0x12338e(0x184)]:{let _0x31967a=o['loadWorkbookData'](_0x4363f9['params'][_0x12338e(0x196)]);return{'jsonrpc':'2.0','id':_0x4363f9['id'],'result':{'success':!0x0,'workbookData':_0x31967a}};}case i[_0x12338e(0x1a7)]:{let _0x331741=await o[_0x12338e(0x18e)](_0x4363f9[_0x12338e(0x1a4)]);return{'jsonrpc':_0x12338e(0x183),'id':_0x4363f9['id'],'result':{'success':!0x0,'workbookData':_0x331741}};}case i['ExportWorkbookData']:return{'jsonrpc':_0x12338e(0x183),'id':_0x4363f9['id'],'result':{'success':!0x0,'workbookData':o[_0x12338e(0x19b)]()}};case i[_0x12338e(0x180)]:{let _0x4a9fb5=_0x4363f9['params'],_0x150edb=await o[_0x12338e(0x17a)](_0x4a9fb5[_0x12338e(0x186)],_0x4a9fb5['format']);return{'jsonrpc':'2.0','id':_0x4363f9['id'],'result':{'success':!0x0,..._0x150edb}};}case i[_0x12338e(0x187)]:{let _0x17f8ac=_0x4363f9[_0x12338e(0x1a4)]??{},_0x3188fc=async()=>{const _0xe1ce9e=_0x12338e;let _0x27d1ec=_0x17f8ac[_0xe1ce9e(0x199)]?await o[_0xe1ce9e(0x1a8)](_0x17f8ac[_0xe1ce9e(0x17e)]):{'value':await o[_0xe1ce9e(0x197)](_0x17f8ac[_0xe1ce9e(0x17e)]),'mutations':void 0x0};return{'success':!0x0,..._0x27d1ec[_0xe1ce9e(0x198)]===void 0x0?{}:{'mutations':_0x27d1ec[_0xe1ce9e(0x198)]},'value':_0x27d1ec[_0xe1ce9e(0x18b)]};},_0x249162=_0x17f8ac[_0x12338e(0x199)]?await s[_0x12338e(0x1a5)](_0x3188fc):await _0x3188fc();return{'jsonrpc':_0x12338e(0x183),'id':_0x4363f9['id'],'result':_0x249162};}default:throw Error(_0x12338e(0x18d)+String(_0x4363f9[_0x12338e(0x1a3)]));}}catch(_0x1fbc1b){return{'jsonrpc':'2.0','id':_0x4363f9['id'],'error':{'code':-0x7f5b,'message':_0x1fbc1b instanceof Error?_0x1fbc1b[_0x12338e(0x18f)]:String(_0x1fbc1b)}};}}function _0x5a51(){const _0x57b188=['10surUcz','1832880xiXoQb','2.0','LoadWorkbook','3954290cUvWlC','outputPath','EvalJs','ready','tail','dispose','value','302oIeYWj','Method\x20not\x20implemented:\x20','loadWorkbookDataReplayPack','message','CreateWorkbook','rpc-request','data','type','evaljs','rpc-response','workbookData','evalJs','mutations','mutates','send','exportWorkbookData','18961338qQrwET','withSpan','49528jNiGmb','meta','3711321SkLdYb','SIGTERM','traceparent','method','params','enqueue','1463dJkFpX','LoadWorkbookDataReplayPack','evalJsWithMutationCapture','RuntimeRpcClient','237amFKEO','exportWorkbookFile','createWorkbook','exit','362TcpExP','code','19254IQbWrI','ExportWorkbookFile'];_0x5a51=function(){return _0x57b188;};return _0x5a51();}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "univer-cli",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "Command-line tools for local Univer workbook automation.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -43,19 +43,140 @@ univer run ./sales.univer --code 'async () => {
43
43
 
44
44
  `ChartType.Column` is the common column chart enum value. Other enum values are available from `univerAPI.Enum.ChartType`.
45
45
 
46
+ ## Chart Type Enum Values
47
+
48
+ Use `univerAPI.Enum.ChartType.<Name>` with `setChartType()` when building chart metadata.
49
+
50
+ ```javascript
51
+ const chartInfo = sheet
52
+ .newChart()
53
+ .setChartType(univerAPI.Enum.ChartType.Column)
54
+ .addRange("A1:C4")
55
+ .build();
56
+ ```
57
+
58
+ Available chart type enum values:
59
+
60
+ | Facade enum value | Chart type |
61
+ | ----------------------------------------------- | ------------------------------------------------------------------------------------------ |
62
+ | `univerAPI.Enum.ChartType.None` | No chart type. This is a sentinel value and should not be used for normal chart insertion. |
63
+ | `univerAPI.Enum.ChartType.Line` | Line chart |
64
+ | `univerAPI.Enum.ChartType.Column` | Column chart |
65
+ | `univerAPI.Enum.ChartType.ColumnStacked` | Stacked column chart |
66
+ | `univerAPI.Enum.ChartType.ColumnPercentStacked` | Percent stacked column chart |
67
+ | `univerAPI.Enum.ChartType.Bar` | Bar chart |
68
+ | `univerAPI.Enum.ChartType.BarStacked` | Stacked bar chart |
69
+ | `univerAPI.Enum.ChartType.BarPercentStacked` | Percent stacked bar chart |
70
+ | `univerAPI.Enum.ChartType.Pie` | Pie chart |
71
+ | `univerAPI.Enum.ChartType.Doughnut` | Doughnut chart |
72
+ | `univerAPI.Enum.ChartType.Area` | Area chart |
73
+ | `univerAPI.Enum.ChartType.AreaStacked` | Stacked area chart |
74
+ | `univerAPI.Enum.ChartType.AreaPercentStacked` | Percent stacked area chart |
75
+ | `univerAPI.Enum.ChartType.Radar` | Radar chart |
76
+ | `univerAPI.Enum.ChartType.Scatter` | Scatter chart |
77
+ | `univerAPI.Enum.ChartType.Combination` | Combination chart |
78
+ | `univerAPI.Enum.ChartType.WordCloud` | Word cloud chart |
79
+ | `univerAPI.Enum.ChartType.Funnel` | Funnel chart |
80
+ | `univerAPI.Enum.ChartType.Bubble` | Bubble chart |
81
+ | `univerAPI.Enum.ChartType.Relation` | Relationship diagram |
82
+ | `univerAPI.Enum.ChartType.Waterfall` | Waterfall chart |
83
+ | `univerAPI.Enum.ChartType.Pareto` | Pareto chart |
84
+ | `univerAPI.Enum.ChartType.Sankey` | Sankey chart |
85
+ | `univerAPI.Enum.ChartType.Heatmap` | Heatmap chart |
86
+ | `univerAPI.Enum.ChartType.Boxplot` | Box plot chart |
87
+
88
+ ## Chart Facade Enum Examples
89
+
90
+ The chart facade also exposes option enums through `univerAPI.Enum`. Use these with specialized builder methods or `setOptions(path, value)`.
91
+
92
+ ```javascript
93
+ const chartInfo = sheet
94
+ .newChart()
95
+ .asLineChart()
96
+ .addRange("A1:D6")
97
+ .setPosition(1, 4, 0, 0)
98
+ .setOptions("title.position", univerAPI.Enum.TitlePositionEnum.Top)
99
+ .setOptions("legend.position", univerAPI.Enum.LegendPositionEnum.Right)
100
+ .setOptions("legend.selectMode", univerAPI.Enum.SelectModeEnum.Multiple)
101
+ .setXAxisTextStyle({
102
+ content: "Month",
103
+ axisAlignment: univerAPI.Enum.AxisAlignEnum.End
104
+ })
105
+ .setAxisPointerStyle({
106
+ indicatorLineType: univerAPI.Enum.ChartBorderDashType.Dashed,
107
+ indicatorLineColor: "#1677ff",
108
+ indicatorLabelColor: "#e6f4ff",
109
+ indicatorLabelTextColor: "#0958d9"
110
+ })
111
+ .setDataPointShape(univerAPI.Enum.LinePointShape.Circle)
112
+ .build();
113
+ ```
114
+
115
+ Common chart facade enums:
116
+
117
+ | Facade enum | Example values | Typical use |
118
+ | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
119
+ | `univerAPI.Enum.LegendPositionEnum` | `Top`, `Bottom`, `Left`, `Right`, `Hide` | `setOptions("legend.position", value)` |
120
+ | `univerAPI.Enum.SelectModeEnum` | `Single`, `Multiple`, `Close` | `setOptions("legend.selectMode", value)` |
121
+ | `univerAPI.Enum.TitlePositionEnum` | `Top`, `Bottom`, `Left`, `Right`, `Hide` | `setOptions("title.position", value)` |
122
+ | `univerAPI.Enum.AxisAlignEnum` | `Start`, `Center`, `End` | `setXAxisTextStyle({ axisAlignment: value })`, `setYAxisTextStyle({ axisAlignment: value })` |
123
+ | `univerAPI.Enum.ChartBorderDashType` | `Solid`, `Dashed`, `Dotted` | `setAxisPointerStyle({ indicatorLineType: value })`, series border `dashType` |
124
+ | `univerAPI.Enum.LinePointShape` | `Circle`, `Square`, `Triangle`, `Diamond`, `Rect`, `RoundRect`, `Pin`, `Arrow`, `None`, `EmptyCircle`, `EmptySquare`, `EmptyTriangle`, `EmptyDiamond`, `EmptyRect`, `EmptyRoundRect`, `EmptyPin`, `EmptyArrow` | `setDataPointShape(value)` |
125
+ | `univerAPI.Enum.RadarShape` | `Polygon`, `Circle` | `asRadarChart().setShape(value)` |
126
+
46
127
  ## Chart Builder
47
128
 
48
- Common builder calls:
129
+ `sheet.newChart()` returns the shared chart builder. The builder only prepares chart metadata. `build()` does not draw anything by itself; insert a new chart with `insertChart(chartInfo)` or update an existing chart with `updateChart(chartInfo)`.
130
+
131
+ Core builder methods:
49
132
 
133
+ - `getChartType()` returns the chart type currently configured on the builder.
50
134
  - `setChartType(univerAPI.Enum.ChartType.Column)` chooses the chart type.
51
135
  - `addRange("A1:C4")` binds the source range. A sheet-qualified range can target another sheet.
136
+ - `clearRange()` removes the current source range from the builder.
52
137
  - `setPosition(row, column, rowOffset, columnOffset)` anchors the chart to the grid.
53
138
  - `setAbsolutePosition(x, y)` places the chart by absolute canvas coordinates.
54
139
  - `setWidth(width)` and `setHeight(height)` set the rendered chart size.
55
- - `setOptions(path, value)` sets chart options such as `title.content` or `legend.position`.
56
140
  - `setTransposeRowsAndColumns(true)` swaps the category and series orientation.
141
+ - `build()` returns chart metadata for `insertChart(chartInfo)` or `updateChart(chartInfo)`.
142
+
143
+ Option and style methods:
144
+
145
+ - `setOptions(path, value)` sets a nested chart option such as `title.content`, `title.position`, `legend.position`, or `legend.selectMode`. Use an empty path, `setOptions("", options)`, to merge a root options object.
146
+ - `setTheme(themeName)` applies a registered chart theme.
147
+ - `setXAxisTitle(title)`, `setYAxisTitle(title)`, and `setRightYAxisTitle(title)` set axis title text.
148
+ - `setXAxisTextStyle(style)`, `setYAxisTextStyle(style)`, and `setRightYAxisTextStyle(style)` set axis title text style. Use `axisAlignment: univerAPI.Enum.AxisAlignEnum.End` for axis-title alignment.
149
+ - `setInvalidValueStrategy(univerAPI.Enum.InvalidValueType.Zero)` controls how line-like charts handle invalid values. Common values are `Zero`, `Break`, and `Link`.
150
+ - `setAxisPointerStyle(style)` configures axis pointer labels and line style. Use `univerAPI.Enum.ChartBorderDashType` for `indicatorLineType`.
151
+ - `setAllSeriesStyle(style)` applies style defaults across all series.
152
+ - `setSeriesStyle(index, style)` applies style to one series. Use `chart.getSeriesData()` readback to find stable series indexes when updating an existing chart.
153
+
154
+ Specialized builder entrypoints:
155
+
156
+ - `asLineChart()` returns a `LineChartBuilder`.
157
+ - `asPieChart()` returns a `PieChartBuilder`.
158
+ - `asRadarChart()` returns a `RadarChartBuilder`.
159
+
160
+ Line chart builder methods:
161
+
162
+ - `setLineStyle("line" | "smooth" | "step")` controls line interpolation.
163
+ - `setDataPointShape(univerAPI.Enum.LinePointShape.Circle)` sets the marker shape.
164
+ - `setDataPointColor(color)` sets marker color.
165
+ - `setDataPointSize(size)` sets marker size.
166
+
167
+ Pie chart builder methods:
168
+
169
+ - `setDoughnutHole(value)` sets the center hole size from `0` to `1`.
170
+ - `setBorderColor(color)` sets pie border color.
171
+ - `setHasPaddingAngle(true)` enables slice padding.
172
+ - `setIsHalfPie(true)` renders a half pie.
173
+ - `setRosePie(true)` renders a rose pie.
174
+ - `setShowLabelLine(true)` toggles label leader lines.
175
+
176
+ Radar chart builder methods:
57
177
 
58
- The builder only prepares chart metadata. `build()` does not draw anything by itself; insert a new chart with `insertChart(chartInfo)` or update an existing chart with `updateChart(chartInfo)`.
178
+ - `setShape(univerAPI.Enum.RadarShape.Polygon)` sets the radar shape. Common values are `Polygon` and `Circle`.
179
+ - `setFill(true)` fills the radar area.
59
180
 
60
181
  ## Source Data Shapes
61
182
 
@@ -125,7 +246,7 @@ const chartInfo = sheet
125
246
  .addRange("A1:D6")
126
247
  .setPosition(1, 4, 0, 0)
127
248
  .setLineStyle("step")
128
- .setDataPointShape(univerAPI.Enum.LinePointShape.CIRCLE)
249
+ .setDataPointShape(univerAPI.Enum.LinePointShape.Circle)
129
250
  .setDataPointColor("#ff0000")
130
251
  .setDataPointSize(10)
131
252
  .build();
@@ -0,0 +1,207 @@
1
+ # Images
2
+
3
+ Images are workbook-local worksheet resources. Use `univer run` to create or maintain floating images through the Sheets Drawing facade, then use facade readback to verify command-line results.
4
+
5
+ This topic covers floating images only. It does not cover cell images, floating DOM, screenshot export, local image upload helpers, or a top-level `univer image` command.
6
+
7
+ For visual verification, open the workbook with `univer view`.
8
+
9
+ ## Core Workflow
10
+
11
+ Look up the workbook and worksheet, configure a floating image builder with `newOverGridImage()`, call `buildAsync()`, then pass the result to `insertImages([image])`.
12
+
13
+ ```bash
14
+ univer run ./report.univer --code 'async () => {
15
+ const workbook = univerAPI.getActiveWorkbook();
16
+ const sheet = workbook.getSheetByName("Sheet1");
17
+ if (!sheet) return { success: false, error: "Sheet1 not found" };
18
+
19
+ const image = await sheet
20
+ .newOverGridImage()
21
+ .setSource("https://example.com/logo.png", univerAPI.Enum.ImageSourceType.URL)
22
+ .setColumn(5)
23
+ .setRow(5)
24
+ .setColumnOffset(10)
25
+ .setRowOffset(10)
26
+ .setWidth(240)
27
+ .setHeight(120)
28
+ .setAnchorType(univerAPI.Enum.SheetDrawingAnchorType.Position)
29
+ .buildAsync();
30
+
31
+ sheet.insertImages([image]);
32
+ const [inserted] = sheet.getImages();
33
+
34
+ return {
35
+ success: true,
36
+ imageCount: sheet.getImages().length,
37
+ imageId: inserted?.getId()
38
+ };
39
+ }'
40
+ ```
41
+
42
+ `ImageSourceType.URL` is the common source type for web and data URLs. Other enum values are available from `univerAPI.Enum.ImageSourceType`.
43
+
44
+ ## Image Builder
45
+
46
+ Common builder calls:
47
+
48
+ - `setSource(source, univerAPI.Enum.ImageSourceType.URL)` sets the image source.
49
+ - `setColumn(column)` and `setRow(row)` set the zero-based grid anchor.
50
+ - `setColumnOffset(offset)` and `setRowOffset(offset)` set pixel offsets from the anchor cell.
51
+ - `setWidth(width)` and `setHeight(height)` set the rendered image size in pixels.
52
+ - `setAnchorType(univerAPI.Enum.SheetDrawingAnchorType.Position)` controls whether position or size follows row and column changes.
53
+ - `setCropTop(top)`, `setCropLeft(left)`, `setCropBottom(bottom)`, and `setCropRight(right)` crop the visible source region.
54
+ - `setRotate(angle)` rotates the image.
55
+
56
+ The builder only prepares image metadata. `buildAsync()` resolves the image data needed by Univer; insert a new image with `insertImages([image])` or update an existing image with `updateImages([newImage])`.
57
+
58
+ ## Enum Usage
59
+
60
+ Use the source enum to describe how Univer should interpret the `source` argument:
61
+
62
+ - `univerAPI.Enum.ImageSourceType.URL`: use for HTTP(S) image URLs and full data URLs such as `data:image/png;base64,...` or `data:image/svg+xml;base64,...`.
63
+ - `univerAPI.Enum.ImageSourceType.BASE64`: use when `source` is the raw base64 payload without a `data:image/...;base64,` prefix.
64
+ - `univerAPI.Enum.ImageSourceType.UUID`: use when the image is already managed by Univer storage and the `source` is the existing image/file UUID. Do not use it for web URLs, data URLs, or raw base64 strings.
65
+
66
+ Source examples:
67
+
68
+ ```javascript
69
+ builder.setSource("https://example.com/logo.png", univerAPI.Enum.ImageSourceType.URL);
70
+ builder.setSource("data:image/png;base64,iVBORw0KGgo...", univerAPI.Enum.ImageSourceType.URL);
71
+ builder.setSource("iVBORw0KGgo...", univerAPI.Enum.ImageSourceType.BASE64);
72
+ builder.setSource("existing-image-file-uuid", univerAPI.Enum.ImageSourceType.UUID);
73
+ ```
74
+
75
+ Use the anchor enum to describe how the image follows sheet layout changes:
76
+
77
+ - `univerAPI.Enum.SheetDrawingAnchorType.Position`: keep the explicit position anchor. Use this for dashboards, logos, stamps, and screenshots where the image should stay at a chosen grid position with its configured size.
78
+ - `univerAPI.Enum.SheetDrawingAnchorType.Both`: follow both position and size changes from the surrounding sheet layout. Use this when the image should resize with row or column changes around its anchor area.
79
+ - `univerAPI.Enum.SheetDrawingAnchorType.None`: keep the image independent from row and column layout changes. Use this for absolute overlays or decorative assets that should not move or resize when the grid layout changes.
80
+
81
+ Anchor examples:
82
+
83
+ ```javascript
84
+ builder.setAnchorType(univerAPI.Enum.SheetDrawingAnchorType.Position); // common reports, logos, stamps
85
+ builder.setAnchorType(univerAPI.Enum.SheetDrawingAnchorType.Both); // resize with the sheet layout
86
+ builder.setAnchorType(univerAPI.Enum.SheetDrawingAnchorType.None); // absolute overlay independent of grid layout
87
+ ```
88
+
89
+ For most CLI-created floating images, start with `ImageSourceType.URL` for web or data URLs and `SheetDrawingAnchorType.Position` for predictable placement.
90
+
91
+ ## Simple Insert Shortcut
92
+
93
+ For simple URL images, `insertImage(url, column, row, offsetX, offsetY)` inserts directly and returns a boolean result.
94
+
95
+ ```javascript
96
+ const inserted = await sheet.insertImage("https://example.com/logo.png", 5, 5, 10, 10);
97
+ ```
98
+
99
+ Use `newOverGridImage()` when you need width, height, anchor, crop, rotate, or deterministic builder readback.
100
+
101
+ ## Readback And Maintenance
102
+
103
+ Use public facade APIs for stable command-line verification:
104
+
105
+ ```javascript
106
+ const images = sheet.getImages();
107
+ const image = images[0];
108
+
109
+ return {
110
+ imageCount: images.length,
111
+ imageId: image?.getId(),
112
+ source: image?.toBuilder().getSource(),
113
+ sourceType: image?.toBuilder().getSourceType()
114
+ };
115
+ ```
116
+
117
+ Useful readback and lookup APIs include:
118
+
119
+ - `getImages()` returns all floating images on the worksheet.
120
+ - `getImageById(id)` returns a single floating image facade object or `null`.
121
+ - `getActiveImages()` returns selected images when a selection exists.
122
+ - `image.getId()` returns the image drawing id.
123
+ - `image.toBuilder().getSource()` returns the current source.
124
+ - `image.toBuilder().getSourceType()` returns the current source type.
125
+
126
+ Avoid asserting private workbook resource storage. Prefer facade evidence such as image count, id, source, source type, and update results.
127
+
128
+ ## Update Image
129
+
130
+ To update via builder state, initialize from an existing image with `toBuilder()`, then call `updateImages([newImage])`.
131
+
132
+ ```bash
133
+ univer run ./report.univer --code 'async () => {
134
+ const workbook = univerAPI.getActiveWorkbook();
135
+ const sheet = workbook.getSheetByName("Sheet1");
136
+ if (!sheet) return { success: false, error: "Sheet1 not found" };
137
+
138
+ const image = sheet.getImages()[0];
139
+ if (!image) return { success: false, error: "No floating image found" };
140
+
141
+ const newImage = await image
142
+ .toBuilder()
143
+ .setWidth(120)
144
+ .setHeight(60)
145
+ .buildAsync();
146
+ sheet.updateImages([newImage]);
147
+
148
+ return {
149
+ success: true,
150
+ imageId: image.getId(),
151
+ imageCount: sheet.getImages().length
152
+ };
153
+ }'
154
+ ```
155
+
156
+ For direct updates, use methods on `FOverGridImage`:
157
+
158
+ ```javascript
159
+ const image = sheet.getImages()[0];
160
+ const resized = await image.setSizeAsync(120, 60);
161
+ const moved = await image.setPositionAsync(5, 5, 10, 10);
162
+ const sourceChanged = image.setSource(
163
+ "https://example.com/updated-logo.png",
164
+ univerAPI.Enum.ImageSourceType.URL
165
+ );
166
+ ```
167
+
168
+ ## Delete Image
169
+
170
+ To delete images in bulk, pass facade image objects to `deleteImages([image])`.
171
+
172
+ ```bash
173
+ univer run ./report.univer --code 'async () => {
174
+ const workbook = univerAPI.getActiveWorkbook();
175
+ const sheet = workbook.getSheetByName("Sheet1");
176
+ if (!sheet) return { success: false, error: "Sheet1 not found" };
177
+
178
+ const image = sheet.getImages()[0];
179
+ if (!image) {
180
+ return {
181
+ success: true,
182
+ removed: false,
183
+ remaining: 0
184
+ };
185
+ }
186
+
187
+ sheet.deleteImages([image]);
188
+
189
+ return {
190
+ success: true,
191
+ removed: true,
192
+ remaining: sheet.getImages().length
193
+ };
194
+ }'
195
+ ```
196
+
197
+ You can also call `remove()` on a single `FOverGridImage`:
198
+
199
+ ```javascript
200
+ const removed = sheet.getImages()[0]?.remove() ?? false;
201
+ ```
202
+
203
+ ## Headless And Viewer Boundary
204
+
205
+ Headless `univer run` scripts should verify floating images by reading facade state: `getImages()`, `getImageById(id)`, `getId()`, `toBuilder().getSource()`, and update or delete return values.
206
+
207
+ Browser rendering belongs to `univer view`, where the readonly workbook viewer loads Drawing UI plugins and paints the visible floating image surface.