diff --git a/core/table-system/executor.js b/core/table-system/executor.js index 30973f8..ac93866 100644 --- a/core/table-system/executor.js +++ b/core/table-system/executor.js @@ -1 +1 @@ -function _0xd88d(_0x409147,_0x1e061a){const _0x460473=_0x4604();return _0xd88d=function(_0xd88d87,_0x581cd9){_0xd88d87=_0xd88d87-0xea;let _0x25ad85=_0x460473[_0xd88d87];return _0x25ad85;},_0xd88d(_0x409147,_0x1e061a);}(function(_0x3d239a,_0x259163){const _0x3f9ec9=_0xd88d,_0x17235a=_0x3d239a();while(!![]){try{const _0x2a8fed=-parseInt(_0x3f9ec9(0xec))/0x1*(-parseInt(_0x3f9ec9(0x103))/0x2)+parseInt(_0x3f9ec9(0xfd))/0x3*(-parseInt(_0x3f9ec9(0xf4))/0x4)+-parseInt(_0x3f9ec9(0x102))/0x5*(parseInt(_0x3f9ec9(0xed))/0x6)+parseInt(_0x3f9ec9(0xf6))/0x7+-parseInt(_0x3f9ec9(0xf7))/0x8+parseInt(_0x3f9ec9(0xf2))/0x9+parseInt(_0x3f9ec9(0xea))/0xa;if(_0x2a8fed===_0x259163)break;else _0x17235a['push'](_0x17235a['shift']());}catch(_0x2e53f6){_0x17235a['push'](_0x17235a['shift']());}}}(_0x4604,0x48cd5));import{log}from'./logger.js';function insertRow(_0x43387b,_0x3abc03,_0x11b900){const _0x250a06=_0xd88d;if(!_0x43387b[_0x3abc03])return log(_0x250a06(0x106)+_0x3abc03+'\x20中插入行。',_0x250a06(0xee)),_0x43387b;const _0x57284a=_0x43387b[_0x3abc03],_0x29479f=_0x57284a[_0x250a06(0xfa)][_0x250a06(0x109)],_0x168954=Array(_0x29479f)['fill']('');for(const _0x10009a in _0x11b900){parseInt(_0x10009a,0xa)<_0x29479f&&(_0x168954[_0x10009a]=_0x11b900[_0x10009a]);}return _0x57284a[_0x250a06(0x10b)][_0x250a06(0xef)](_0x168954),_0x43387b;}function updateRow(_0x39a32f,_0xc6603c,_0x35b2be,_0x23ef80){const _0x5841f8=_0xd88d;if(!_0x39a32f[_0xc6603c])return log(_0x5841f8(0xff)+_0xc6603c+'。',_0x5841f8(0xee)),_0x39a32f;const _0x191e3c=_0x39a32f[_0xc6603c];if(_0x35b2be>=_0x191e3c[_0x5841f8(0x10b)][_0x5841f8(0x109)])return log('AI指令修正:updateRow\x20的行索引\x20'+_0x35b2be+_0x5841f8(0xf9),'warn'),insertRow(_0x39a32f,_0xc6603c,_0x23ef80);const _0x3ddb97=_0x191e3c[_0x5841f8(0x10b)][_0x35b2be];for(const _0x16d120 in _0x23ef80){parseInt(_0x16d120,0xa)<_0x3ddb97[_0x5841f8(0x109)]&&(_0x3ddb97[_0x16d120]=_0x23ef80[_0x16d120]);}return _0x39a32f;}function deleteRow(_0x2b30d8,_0x11743b,_0x370868){const _0x28b06=_0xd88d;if(!_0x2b30d8[_0x11743b]||!_0x2b30d8[_0x11743b][_0x28b06(0x10b)][_0x370868])return log(_0x28b06(0xf8)+_0x11743b+_0x28b06(0x108)+_0x370868+'。','error'),_0x2b30d8;return _0x2b30d8[_0x11743b][_0x28b06(0x10b)]['splice'](_0x370868,0x1),_0x2b30d8;}const allowedFunctions={'insertRow':insertRow,'updateRow':updateRow,'deleteRow':deleteRow};function parseFunctionCall(_0x50d17c){const _0x87fb74=_0xd88d,_0x138a3b=_0x50d17c[_0x87fb74(0xfe)]()['match'](/(\w+)\((.*)\)/);if(!_0x138a3b)return log(_0x87fb74(0x100)+_0x50d17c+'\x22',_0x87fb74(0xee)),null;const _0x5c55ea=_0x138a3b[0x1],_0x22f7af=_0x138a3b[0x2];if(!allowedFunctions[_0x5c55ea])return log(_0x87fb74(0xf3)+_0x5c55ea+'\x22。已阻止执行。',_0x87fb74(0xee)),null;try{const _0x20adac=new Function('return\x20['+_0x22f7af+']')();return{'name':_0x5c55ea,'args':_0x20adac};}catch(_0x5cc00f){return log(_0x87fb74(0x107)+_0x5c55ea+_0x87fb74(0x101)+_0x5cc00f[_0x87fb74(0x10a)],_0x87fb74(0xee)),null;}}export function executeCommands(_0x3af477,_0x447002){const _0x34dfdb=_0xd88d,_0xa0c6dd=/([\s\S]*?)<\/Amily2Edit>/,_0x1c8cea=_0x3af477['match'](_0xa0c6dd);if(!_0x1c8cea)return{'finalState':_0x447002,'hasChanges':![]};log('检测到AI指令块,开始推演...',_0x34dfdb(0x10c));const _0x217613=_0x1c8cea[0x1][_0x34dfdb(0x10d)](//g,'')['trim']();if(!_0x217613)return{'finalState':_0x447002,'hasChanges':![]};const _0x4c0997=_0x217613[_0x34dfdb(0x104)]('\x0a')[_0x34dfdb(0x10e)](_0xd700c6=>_0xd700c6['trim']()!=='');if(_0x4c0997[_0x34dfdb(0x109)]===0x0)return{'finalState':_0x447002,'hasChanges':![]};let _0x313ba1=JSON[_0x34dfdb(0x105)](JSON[_0x34dfdb(0xf5)](_0x447002)),_0x1b2ef3=![];return _0x4c0997['forEach'](_0x31b80a=>{const _0x3cde78=_0x34dfdb,_0x4a9370=parseFunctionCall(_0x31b80a);if(_0x4a9370)try{_0x313ba1=allowedFunctions[_0x4a9370[_0x3cde78(0xf0)]](_0x313ba1,..._0x4a9370[_0x3cde78(0xfc)]),log(_0x3cde78(0xf1)+_0x31b80a,_0x3cde78(0xeb)),_0x1b2ef3=!![];}catch(_0x20b025){log(_0x3cde78(0xfb)+_0x31b80a+'\x22\x20时发生运行时错误:\x20'+_0x20b025[_0x3cde78(0x10a)],'error');}}),{'finalState':_0x313ba1,'hasChanges':_0x1b2ef3};}function _0x4604(){const _0x1fcb08=['\x22\x20的参数时出错:\x20','5bXXhil','1272KJePSo','split','parse','AI指令错误:尝试在不存在的表格索引\x20','解析函数\x20\x22','\x20或行\x20','length','message','rows','info','replace','filter','11871680vLKNqB','success','199SVZwzV','3328086kzCLcC','error','push','name','成功推演指令:\x20','1838475RfFCzw','检测到非法函数调用:\x20\x22','596dwmQtO','stringify','207298sUeGGB','1083176qPLmxz','AI指令错误:尝试删除不存在的表格\x20','\x20超出范围,自动转换为\x20insertRow。','headers','推演指令\x20\x22','args','11262hemfBI','trim','AI指令错误:尝试更新不存在的表格\x20','指令格式错误,无法解析:\x20\x22'];_0x4604=function(){return _0x1fcb08;};return _0x4604();} \ No newline at end of file +(function(_0x35fff5,_0x383545){const _0x3f7c5f=_0xd439,_0x45b015=_0x35fff5();while(!![]){try{const _0x1cfd06=parseInt(_0x3f7c5f(0x1be))/0x1+-parseInt(_0x3f7c5f(0x1b5))/0x2*(parseInt(_0x3f7c5f(0x1bf))/0x3)+parseInt(_0x3f7c5f(0x1c1))/0x4+parseInt(_0x3f7c5f(0x1c0))/0x5*(-parseInt(_0x3f7c5f(0x1d0))/0x6)+parseInt(_0x3f7c5f(0x1cc))/0x7*(-parseInt(_0x3f7c5f(0x1b7))/0x8)+-parseInt(_0x3f7c5f(0x1ce))/0x9+parseInt(_0x3f7c5f(0x1c9))/0xa;if(_0x1cfd06===_0x383545)break;else _0x45b015['push'](_0x45b015['shift']());}catch(_0x32ca2){_0x45b015['push'](_0x45b015['shift']());}}}(_0x5089,0x6d631));import{log}from'./logger.js';function insertRow(_0x4aa2f9,_0x242786,_0x478a79){const _0x13bda2=_0xd439;if(!_0x4aa2f9[_0x242786])return log(_0x13bda2(0x1d2)+_0x242786+_0x13bda2(0x1ca),_0x13bda2(0x1cd)),_0x4aa2f9;const _0xa55d28=_0x4aa2f9[_0x242786],_0x1f7667=_0xa55d28[_0x13bda2(0x1c4)][_0x13bda2(0x1d9)],_0x2da063=Array(_0x1f7667)[_0x13bda2(0x1d7)]('');for(const _0x581313 in _0x478a79){parseInt(_0x581313,0xa)<_0x1f7667&&(_0x2da063[_0x581313]=_0x478a79[_0x581313]);}return _0xa55d28['rows'][_0x13bda2(0x1bd)](_0x2da063),_0x4aa2f9;}function updateRow(_0x1c9bb0,_0xa4c79,_0x12da50,_0x280882){const _0x111353=_0xd439;if(!_0x1c9bb0[_0xa4c79])return log('AI指令错误:尝试更新不存在的表格\x20'+_0xa4c79+'。','error'),_0x1c9bb0;const _0x458d5c=_0x1c9bb0[_0xa4c79];if(_0x12da50>=_0x458d5c[_0x111353(0x1cb)][_0x111353(0x1d9)])return log(_0x111353(0x1d5)+_0x12da50+_0x111353(0x1b4),'warn'),insertRow(_0x1c9bb0,_0xa4c79,_0x280882);const _0x28c416=_0x458d5c[_0x111353(0x1cb)][_0x12da50];for(const _0x4032e6 in _0x280882){parseInt(_0x4032e6,0xa)<_0x28c416['length']&&(_0x28c416[_0x4032e6]=_0x280882[_0x4032e6]);}return _0x1c9bb0;}function _0xd439(_0x1b2a0b,_0x525da7){const _0x508956=_0x5089();return _0xd439=function(_0xd4398d,_0x4535a4){_0xd4398d=_0xd4398d-0x1b4;let _0x22f7fb=_0x508956[_0xd4398d];return _0x22f7fb;},_0xd439(_0x1b2a0b,_0x525da7);}function deleteRow(_0x2d06bf,_0x3760f4,_0x279b5a){const _0x3dad52=_0xd439;if(!_0x2d06bf[_0x3760f4]||!_0x2d06bf[_0x3760f4][_0x3dad52(0x1cb)][_0x279b5a])return log(_0x3dad52(0x1c5)+_0x3760f4+_0x3dad52(0x1d4)+_0x279b5a+'。',_0x3dad52(0x1cd)),_0x2d06bf;return _0x2d06bf[_0x3760f4][_0x3dad52(0x1cb)][_0x3dad52(0x1ba)](_0x279b5a,0x1),_0x2d06bf;}const allowedFunctions={'insertRow':insertRow,'updateRow':updateRow,'deleteRow':deleteRow};function parseFunctionCall(_0x42498d){const _0xed1a2e=_0xd439,_0x407ff1=_0x42498d[_0xed1a2e(0x1c7)]()[_0xed1a2e(0x1d1)](/(\w+)\((.*)\)/);if(!_0x407ff1)return log(_0xed1a2e(0x1bc)+_0x42498d+'\x22',_0xed1a2e(0x1cd)),null;const _0x74ac2=_0x407ff1[0x1],_0x1c4d6c=_0x407ff1[0x2];if(!allowedFunctions[_0x74ac2])return log(_0xed1a2e(0x1c2)+_0x74ac2+_0xed1a2e(0x1c3),_0xed1a2e(0x1cd)),null;try{const _0x2e2e09=new Function(_0xed1a2e(0x1bb)+_0x1c4d6c+']')();return{'name':_0x74ac2,'args':_0x2e2e09};}catch(_0x2abd29){return log('解析函数\x20\x22'+_0x74ac2+'\x22\x20的参数时出错:\x20'+_0x2abd29[_0xed1a2e(0x1b9)],_0xed1a2e(0x1cd)),null;}}export function executeCommands(_0x39f37d,_0x130c57){const _0x47352c=_0xd439,_0x31b83c=/([\s\S]*?)<\/Amily2Edit>/,_0x37993b=_0x39f37d['match'](_0x31b83c);if(!_0x37993b)return{'finalState':_0x130c57,'hasChanges':![]};log(_0x47352c(0x1d8),_0x47352c(0x1c8));const _0x1a0a32=_0x37993b[0x1]['replace'](//g,'')[_0x47352c(0x1c7)]();if(!_0x1a0a32)return{'finalState':_0x130c57,'hasChanges':![]};const _0x167aaf=_0x1a0a32['split']('\x0a')['filter'](_0x216c21=>_0x216c21[_0x47352c(0x1c7)]()!=='');if(_0x167aaf['length']===0x0)return{'finalState':_0x130c57,'hasChanges':![]};let _0x3757fe=JSON['parse'](JSON[_0x47352c(0x1b6)](_0x130c57)),_0x1ebbd8=![];return _0x167aaf[_0x47352c(0x1c6)](_0x22ecbf=>{const _0x101569=_0x47352c,_0xd996c1=_0x22ecbf[_0x101569(0x1c7)]();if(_0xd996c1[_0x101569(0x1cf)](_0x101569(0x1d3))||_0xd996c1[_0x101569(0x1cf)]('deleteRow(')||_0xd996c1[_0x101569(0x1cf)](_0x101569(0x1b8))){const _0x2b3035=parseFunctionCall(_0xd996c1);if(_0x2b3035)try{_0x3757fe=allowedFunctions[_0x2b3035[_0x101569(0x1da)]](_0x3757fe,..._0x2b3035[_0x101569(0x1d6)]),log('成功推演指令:\x20'+_0x22ecbf,'success'),_0x1ebbd8=!![];}catch(_0x6d72f3){log('推演指令\x20\x22'+_0x22ecbf+'\x22\x20时发生运行时错误:\x20'+_0x6d72f3['message'],'error');}}}),{'finalState':_0x3757fe,'hasChanges':_0x1ebbd8};}function _0x5089(){const _0x838e03=['308667XyUnXk','75FshzOy','5JkvenN','2237788jGByNf','检测到非法函数调用:\x20\x22','\x22。已阻止执行。','headers','AI指令错误:尝试删除不存在的表格\x20','forEach','trim','info','10202500YYVPgw','\x20中插入行。','rows','304486tDzpay','error','2308959tNHaCL','startsWith','4547418RZbVtg','match','AI指令错误:尝试在不存在的表格索引\x20','insertRow(','\x20或行\x20','AI指令修正:updateRow\x20的行索引\x20','args','fill','检测到AI指令块,开始推演...','length','name','\x20超出范围,自动转换为\x20insertRow。','9710wAadNk','stringify','56eqsaPX','updateRow(','message','splice','return\x20[','指令格式错误,无法解析:\x20\x22','push'];_0x5089=function(){return _0x838e03;};return _0x5089();}