@univerjs-pro/sheets-mcp 0.16.1 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/facade.js CHANGED
@@ -1 +1 @@
1
- const _0x1fa7ab=_0x28b2;(function(_0x3e399c,_0x35509f){const _0x6bc310=_0x28b2,_0x1386ce=_0x3e399c();while(!![]){try{const _0x26b4f7=parseInt(_0x6bc310(0x20c))/0x1+-parseInt(_0x6bc310(0x225))/0x2*(parseInt(_0x6bc310(0x224))/0x3)+-parseInt(_0x6bc310(0x1f5))/0x4+parseInt(_0x6bc310(0x212))/0x5+-parseInt(_0x6bc310(0x206))/0x6*(-parseInt(_0x6bc310(0x234))/0x7)+-parseInt(_0x6bc310(0x1fe))/0x8+-parseInt(_0x6bc310(0x215))/0x9;if(_0x26b4f7===_0x35509f)break;else _0x1386ce['push'](_0x1386ce['shift']());}catch(_0xeb7d34){_0x1386ce['push'](_0x1386ce['shift']());}}}(_0x3385,0x3385b));import{FUniver as _0x22cfa3}from'@univerjs/core/facade';import'@univerjs/sheets-formula/facade';function _0x28b2(_0x262c71,_0x33803f){_0x262c71=_0x262c71-0x1f0;const _0x3385eb=_0x3385();let _0x28b200=_0x3385eb[_0x262c71];return _0x28b200;}import'@univerjs/sheets-data-validation/facade';import{FWorkbook as _0x17b694,FWorksheet as _0x159cf2,FRange as _0x3973ed}from'@univerjs/sheets/facade';import{FormulaDataModel as _0x5b93c8,serializeRangeWithSheet as _0xcd0117}from'@univerjs/engine-formula';import{IFormulaUsageAnalyzer as _0x6d7373,formulaToA1 as _0x5d49ad,IStyleUsageAnalyzer as _0x142752,styleToA1 as _0x5188f6,ISizeUsageAnalyzer as _0x3721fb}from'@univerjs-pro/sheets-mcp';import{getIntersectRange as _0x75d51}from'@univerjs/core';class b extends _0x22cfa3{async[_0x1fa7ab(0x1fa)](){const _0x1fa8fd=_0x1fa7ab;return this[_0x1fa8fd(0x1fc)]()[_0x1fa8fd(0x1fa)]();}}_0x22cfa3['extend'](b);class V extends _0x17b694{[_0x1fa7ab(0x1f7)](){const _0x382c62=_0x1fa7ab;Object['defineProperty'](this,_0x382c62(0x222),{'get'(){const _0x45d2dd=_0x382c62;return this[_0x45d2dd(0x1fb)][_0x45d2dd(0x1fd)](_0x5b93c8);}});}[_0x1fa7ab(0x1f8)](_0x49fb05,_0x2f4a60={}){const _0x32f87d=_0x1fa7ab,{caseSensitive:_0x48d5e8=!0x1,matchEntireCell:_0x1ad169=!0x1,specificRanges:_0x35f5b7,specificTypes:_0x387911,searchMultipleTextsCondition:_0x538aa5='OR'}=_0x2f4a60;let _0x1d2010=(Array['isArray'](_0x49fb05)?_0x49fb05:[_0x49fb05])[_0x32f87d(0x235)](_0x56be21=>_0x56be21['trim']())[_0x32f87d(0x213)](_0x422022=>_0x422022);if(_0x48d5e8||(_0x1d2010=_0x1d2010[_0x32f87d(0x235)](_0x1e3028=>_0x1e3028[_0x32f87d(0x20e)]())),_0x1d2010[_0x32f87d(0x219)]===0x0)return[];const _0x12e32a={'caseSensitive':_0x48d5e8,'matchEntireCell':_0x1ad169,'searchMultipleTextsCondition':_0x538aa5,'isSearchByRawValue':!_0x387911||_0x387911[_0x32f87d(0x22f)](_0x32f87d(0x232)),'isSearchByDisplayValue':!_0x387911||_0x387911[_0x32f87d(0x22f)]('displayValue'),'isSearchByFormula':!_0x387911||_0x387911[_0x32f87d(0x22f)](_0x32f87d(0x229))},_0x1085ca=this[_0x32f87d(0x205)](),_0x1a7d80=[];if(_0x35f5b7)for(const {sheetId:_0x50d116,ranges:_0x759f6}of _0x35f5b7){const _0x56001f=_0x1085ca[_0x32f87d(0x238)](_0x50d116);if(!_0x56001f){console[_0x32f87d(0x21c)](_0x32f87d(0x1f6)+_0x50d116+_0x32f87d(0x20b));continue;}const _0x7f1ae9=_0x56001f[_0x32f87d(0x200)]();if(_0x759f6&&_0x759f6[_0x32f87d(0x219)]>0x0){for(const _0x17cfdf of _0x759f6)for(let _0x18c919=_0x17cfdf[_0x32f87d(0x20f)];_0x18c919<=_0x17cfdf['endRow'];_0x18c919++)for(let _0x5e0dc6=_0x17cfdf[_0x32f87d(0x23a)];_0x5e0dc6<=_0x17cfdf[_0x32f87d(0x21d)];_0x5e0dc6++){const _0xed0972=_0x7f1ae9[_0x32f87d(0x21a)](_0x18c919,_0x5e0dc6);if(!_0xed0972)continue;const _0x4cc928=this[_0x32f87d(0x1f3)](_0xed0972,_0x1d2010,{..._0x12e32a,'worksheet':_0x56001f,'row':_0x18c919,'col':_0x5e0dc6});_0x4cc928&&_0x1a7d80[_0x32f87d(0x204)]({..._0x4cc928,'sheetId':_0x56001f['getSheetId']()});}}else _0x7f1ae9[_0x32f87d(0x231)]((_0x4bda2e,_0x47b79e,_0x11fc9b)=>{const _0x36fcb8=_0x32f87d;if(_0x11fc9b){const _0x36808f=this[_0x36fcb8(0x1f3)](_0x11fc9b,_0x1d2010,{..._0x12e32a,'worksheet':_0x56001f,'row':_0x4bda2e,'col':_0x47b79e});_0x36808f&&_0x1a7d80[_0x36fcb8(0x204)]({..._0x36808f,'sheetId':_0x56001f[_0x36fcb8(0x223)]()});}});}else{const _0x29acf1=_0x1085ca['getSheets']();for(const _0x4a7053 of _0x29acf1)_0x4a7053['getCellMatrix']()[_0x32f87d(0x231)]((_0x27a88e,_0x2f2907,_0x18e8fc)=>{const _0x3f8437=_0x32f87d;if(_0x18e8fc){const _0x2448d1=this[_0x3f8437(0x1f3)](_0x18e8fc,_0x1d2010,{..._0x12e32a,'worksheet':_0x4a7053,'row':_0x27a88e,'col':_0x2f2907});_0x2448d1&&_0x1a7d80['push']({..._0x2448d1,'sheetId':_0x4a7053['getSheetId']()});}});}return _0x1a7d80;}['_cellMatchesSearch'](_0x44107a,_0x65818f,_0x202d59){const _0x381ef3=_0x1fa7ab;var _0x1f2db0,_0x1e9752,_0x3896df,_0x5dfdc0,_0x17c264;const {caseSensitive:_0x49b37c,matchEntireCell:_0x29b283,searchMultipleTextsCondition:_0x22e911,isSearchByRawValue:_0x1b7422,isSearchByDisplayValue:_0x52c20f,isSearchByFormula:_0x8f9a9d,worksheet:_0x19b515,row:_0x44f3a3,col:_0x5df545}=_0x202d59;if(_0x1b7422){const _0x4f2d67=((_0x1e9752=(_0x1f2db0=_0x44107a['p'])==null?void 0x0:_0x1f2db0['body'])==null?void 0x0:_0x1e9752['dataStream'])||_0x44107a['v'];if(_0x4f2d67){const _0x34854f=_0x49b37c?_0x4f2d67[_0x381ef3(0x1f4)]():_0x4f2d67[_0x381ef3(0x1f4)]()[_0x381ef3(0x20e)]();if(this[_0x381ef3(0x230)](_0x34854f,_0x65818f,_0x29b283,_0x22e911))return{'row':_0x44f3a3,'col':_0x5df545,'reference':_0xcd0117(_0x19b515[_0x381ef3(0x1f9)](),{'startRow':_0x44f3a3,'endRow':_0x44f3a3,'startColumn':_0x5df545,'endColumn':_0x5df545}),'cellData':{..._0x44107a,'rawValue':_0x4f2d67}};}}if(_0x8f9a9d&&(_0x44107a['f']||_0x44107a['si'])){const _0x2847f0=this[_0x381ef3(0x222)][_0x381ef3(0x221)](_0x44f3a3,_0x5df545,_0x19b515[_0x381ef3(0x223)](),this[_0x381ef3(0x205)]()[_0x381ef3(0x236)]());if(_0x2847f0){const _0x6ff37e=_0x49b37c?_0x2847f0:_0x2847f0['toLowerCase']();if(this['_isMatch'](_0x6ff37e,_0x65818f,_0x29b283,_0x22e911))return{'row':_0x44f3a3,'col':_0x5df545,'reference':_0xcd0117(_0x19b515[_0x381ef3(0x1f9)](),{'startRow':_0x44f3a3,'endRow':_0x44f3a3,'startColumn':_0x5df545,'endColumn':_0x5df545}),'cellData':{..._0x44107a,'formulaString':_0x2847f0}};}}if(_0x52c20f){let _0x2bd126=(_0x5dfdc0=(_0x3896df=_0x44107a['p'])==null?void 0x0:_0x3896df[_0x381ef3(0x23b)])==null?void 0x0:_0x5dfdc0[_0x381ef3(0x1f0)];if(_0x2bd126||(_0x2bd126=(_0x17c264=_0x19b515['getCell'](_0x44f3a3,_0x5df545))==null?void 0x0:_0x17c264['v']),_0x2bd126){const _0x3a4ee4=_0x49b37c?_0x2bd126[_0x381ef3(0x1f4)]():_0x2bd126[_0x381ef3(0x1f4)]()[_0x381ef3(0x20e)]();if(this['_isMatch'](_0x3a4ee4,_0x65818f,_0x29b283,_0x22e911))return{'row':_0x44f3a3,'col':_0x5df545,'reference':_0xcd0117(_0x19b515[_0x381ef3(0x1f9)](),{'startRow':_0x44f3a3,'endRow':_0x44f3a3,'startColumn':_0x5df545,'endColumn':_0x5df545}),'cellData':{..._0x44107a,'displayValue':_0x2bd126[_0x381ef3(0x1f4)]()}};}}return!0x1;}['_isMatch'](_0xd4010a,_0x561fee,_0x5c6baf,_0x44f740){const _0x5ca149=_0x1fa7ab;return _0x561fee['length']>0x1&&_0x44f740===_0x5ca149(0x21f)?_0x561fee[_0x5ca149(0x214)](_0x3019dc=>_0x5c6baf?_0xd4010a===_0x3019dc:_0xd4010a['indexOf'](_0x3019dc)>-0x1):_0x561fee[_0x5ca149(0x22e)](_0x2faaa0=>_0x5c6baf?_0xd4010a===_0x2faaa0:_0xd4010a['indexOf'](_0x2faaa0)>-0x1);}}_0x17b694[_0x1fa7ab(0x218)](V);class v extends _0x17b694{async[_0x1fa7ab(0x1fa)](){const _0x382241=_0x1fa7ab,_0x2a1ce7=this[_0x382241(0x20a)](),_0x3eec3c=await this[_0x382241(0x202)]();return{'formulaErrors':_0x2a1ce7,'dataValidationErrors':_0x3eec3c};}}_0x17b694[_0x1fa7ab(0x218)](v);class j extends _0x159cf2{async[_0x1fa7ab(0x1f2)](){const _0x1950ab=_0x1fa7ab,_0x4e37ad=this[_0x1950ab(0x1fb)][_0x1950ab(0x1fd)](_0x6d7373),_0x59c030=this[_0x1950ab(0x237)](0x0,0x0,this[_0x1950ab(0x22a)](),this[_0x1950ab(0x233)]())[_0x1950ab(0x21b)]();return await _0x4e37ad['getAllFormulaUsages'](_0x59c030);}async[_0x1fa7ab(0x226)](){const _0x208419=_0x1fa7ab;return(await this[_0x208419(0x1f2)]())['map'](_0x5d49ad);}[_0x1fa7ab(0x209)](_0x8b8e0){const _0x57778e=_0x1fa7ab,_0x5a44f0=this[_0x57778e(0x1fb)][_0x57778e(0x1fd)](_0x142752),_0x53729a=this[_0x57778e(0x237)](0x0,0x0,this['getMaxRows'](),this[_0x57778e(0x233)]())[_0x57778e(0x21b)]();return _0x5a44f0[_0x57778e(0x228)](_0x8b8e0),_0x5a44f0[_0x57778e(0x210)](_0x53729a,this[_0x57778e(0x22d)],this['_worksheet']);}[_0x1fa7ab(0x203)](_0x4751c0){const _0xba6fd2=_0x1fa7ab;return this[_0xba6fd2(0x209)](_0x4751c0)['map'](_0x5188f6);}[_0x1fa7ab(0x201)](_0x54c982){const _0x5798d7=_0x1fa7ab,_0x503dbd=this[_0x5798d7(0x1fb)][_0x5798d7(0x1fd)](_0x3721fb);return _0x503dbd['updateConfig'](_0x54c982),_0x503dbd[_0x5798d7(0x227)](this['_worksheet']);}['getSizeUsagesAsA1'](_0x4a2ff0){const _0x14812d=_0x1fa7ab,_0x54a2b3=this[_0x14812d(0x1fb)][_0x14812d(0x1fd)](_0x3721fb);_0x54a2b3['updateConfig'](_0x4a2ff0);const _0x2fd95f=_0x54a2b3['getAllSizeUsages'](this['_worksheet']);return _0x54a2b3['toA1'](_0x2fd95f);}}_0x159cf2[_0x1fa7ab(0x218)](j);class W extends _0x3973ed{[_0x1fa7ab(0x217)](_0x172369){const _0x4d80ef=_0x1fa7ab;var _0x350fa8;const _0x5cec2b=(_0x350fa8=_0x172369==null?void 0x0:_0x172369[_0x4d80ef(0x22b)])!=null?_0x350fa8:!0x0,_0x4fe0a8=this[_0x4d80ef(0x237)](),_0x19f219=this['_worksheet']['getRowManager'](),_0x569040=this[_0x4d80ef(0x22c)][_0x4d80ef(0x208)](),_0x3a8ec0={};let _0x30fa99=0x0;for(let _0x310998=_0x4fe0a8[_0x4d80ef(0x20f)];_0x310998<=_0x4fe0a8[_0x4d80ef(0x1ff)];_0x310998++){const _0x575ac9=_0x19f219[_0x4d80ef(0x1f1)](_0x310998),_0x38e4cc=!_0x5cec2b||this['_worksheet'][_0x4d80ef(0x239)](_0x310998)?_0x575ac9:0x0;_0x30fa99+=_0x38e4cc,_0x3a8ec0[_0x310998]={'h':_0x38e4cc};}const _0x30ed5b={};let _0x5300c0=0x0;for(let _0xe4b4ee=_0x4fe0a8['startColumn'];_0xe4b4ee<=_0x4fe0a8['endColumn'];_0xe4b4ee++){const _0x3e41ec=_0x569040['getColumnWidth'](_0xe4b4ee),_0x3d113b=!_0x5cec2b||this[_0x4d80ef(0x22c)]['getColVisible'](_0xe4b4ee)?_0x3e41ec:0x0;_0x5300c0+=_0x3d113b,_0x30ed5b[_0xe4b4ee]={'w':_0x3d113b};}return{'w':_0x5300c0,'h':_0x30fa99,'rowData':_0x3a8ec0,'columnData':_0x30ed5b};}async[_0x1fa7ab(0x1f2)](){const _0x4c79ea=_0x1fa7ab,_0x1ea08f=this[_0x4c79ea(0x1fb)][_0x4c79ea(0x1fd)](_0x6d7373),_0x19f8fc=(({startRow:_0x5ad5bb,endRow:_0x454ea7,startColumn:_0x37d74d,endColumn:_0x4aeb56})=>{const _0x399396=_0x4c79ea,_0x1ab172=[];for(let _0x4e5992=_0x5ad5bb;_0x4e5992<=_0x454ea7;_0x4e5992++){const _0x3dc425=[];for(let _0x46ead8=_0x37d74d;_0x46ead8<=_0x4aeb56;_0x46ead8++)_0x3dc425[_0x399396(0x204)](this['_worksheet'][_0x399396(0x21e)](_0x4e5992,_0x46ead8));_0x1ab172[_0x399396(0x204)](_0x3dc425);}return _0x1ab172;})({'startRow':0x0,'endRow':this[_0x4c79ea(0x22c)][_0x4c79ea(0x22a)](),'startColumn':0x0,'endColumn':this['_worksheet'][_0x4c79ea(0x233)]()}),_0x513ec4=await _0x1ea08f[_0x4c79ea(0x20d)](_0x19f8fc),_0x56c517=this[_0x4c79ea(0x237)](),_0x2e23bd=[];for(let _0x247322=0x0;_0x247322<_0x513ec4['length'];_0x247322++){const _0x41a61b=_0x513ec4[_0x247322],_0x327c9b=_0x41a61b[_0x4c79ea(0x207)],_0x4607d4=[];for(let _0xbf9f42=0x0;_0xbf9f42<_0x327c9b['length'];_0xbf9f42++){const _0x362435=_0x327c9b[_0xbf9f42],_0x545c2d=_0x75d51(_0x362435,_0x56c517);_0x545c2d&&_0x4607d4['push'](_0x545c2d);}if(_0x4607d4[_0x4c79ea(0x219)]>0x0){if(_0x41a61b[_0x4c79ea(0x207)]=_0x4607d4,!(_0x41a61b[_0x4c79ea(0x220)][_0x4c79ea(0x20f)]>=_0x56c517['startRow']&&_0x41a61b[_0x4c79ea(0x220)][_0x4c79ea(0x20f)]<=_0x56c517['endRow']&&_0x41a61b[_0x4c79ea(0x220)][_0x4c79ea(0x23a)]>=_0x56c517[_0x4c79ea(0x23a)]&&_0x41a61b[_0x4c79ea(0x220)][_0x4c79ea(0x23a)]<=_0x56c517[_0x4c79ea(0x21d)])){const _0x2a8cd1=_0x4607d4[0x0],_0x2a28fd=_0x2a8cd1[_0x4c79ea(0x20f)]-_0x41a61b[_0x4c79ea(0x220)][_0x4c79ea(0x20f)],_0x4df505=_0x2a8cd1[_0x4c79ea(0x23a)]-_0x41a61b['firstOccurrence'][_0x4c79ea(0x23a)];_0x41a61b[_0x4c79ea(0x229)]=await _0x1ea08f[_0x4c79ea(0x216)](_0x41a61b[_0x4c79ea(0x229)],_0x4df505,_0x2a28fd),_0x41a61b[_0x4c79ea(0x220)]={'startRow':_0x2a8cd1[_0x4c79ea(0x20f)],'endRow':_0x2a8cd1[_0x4c79ea(0x20f)],'startColumn':_0x2a8cd1['startColumn'],'endColumn':_0x2a8cd1[_0x4c79ea(0x23a)]};}_0x2e23bd[_0x4c79ea(0x204)](_0x41a61b);}}return _0x2e23bd;}async[_0x1fa7ab(0x226)](){return(await this['getFormulaUsages']())['map'](_0x5d49ad);}[_0x1fa7ab(0x209)](_0x403e42){const _0x1a1177=_0x1fa7ab,_0x4a0163=this[_0x1a1177(0x1fb)]['get'](_0x142752),_0x50f1ae=(({startRow:_0x458aeb,endRow:_0x477f7c,startColumn:_0x8dc023,endColumn:_0x42c3b4})=>{const _0x284e08=_0x1a1177,_0x3337e4=[];for(let _0x2ade18=_0x458aeb;_0x2ade18<=_0x477f7c;_0x2ade18++){const _0x2a4552=[];for(let _0x44fcec=_0x8dc023;_0x44fcec<=_0x42c3b4;_0x44fcec++)_0x2a4552[_0x284e08(0x204)](this[_0x284e08(0x22c)][_0x284e08(0x21e)](_0x2ade18,_0x44fcec));_0x3337e4[_0x284e08(0x204)](_0x2a4552);}return _0x3337e4;})({'startRow':0x0,'endRow':this[_0x1a1177(0x22c)][_0x1a1177(0x22a)](),'startColumn':0x0,'endColumn':this[_0x1a1177(0x22c)][_0x1a1177(0x233)]()});_0x4a0163[_0x1a1177(0x228)](_0x403e42);const _0x7f2413=_0x4a0163[_0x1a1177(0x210)](_0x50f1ae,this[_0x1a1177(0x22d)],this['_worksheet']),_0x5b3e6f=this[_0x1a1177(0x237)](),_0x5a3b26=[];for(let _0x4123b3=0x0;_0x4123b3<_0x7f2413['length'];_0x4123b3++){const _0x1b231e=_0x7f2413[_0x4123b3],_0x1bb2df=_0x1b231e['filledRanges'],_0x495bed=[];for(let _0x3350b7=0x0;_0x3350b7<_0x1bb2df[_0x1a1177(0x219)];_0x3350b7++){const _0x140a0d=_0x1bb2df[_0x3350b7],_0x20fef1=_0x75d51(_0x140a0d,_0x5b3e6f);_0x20fef1&&_0x495bed[_0x1a1177(0x204)](_0x20fef1);}_0x495bed[_0x1a1177(0x219)]>0x0&&(_0x1b231e[_0x1a1177(0x207)]=_0x495bed,_0x5a3b26[_0x1a1177(0x204)](_0x1b231e));}return _0x5a3b26;}[_0x1fa7ab(0x203)](_0x527594){const _0x5e3b57=_0x1fa7ab;return this['getStyleUsages'](_0x527594)[_0x5e3b57(0x235)](_0x5188f6);}[_0x1fa7ab(0x201)](_0x55490f){const _0x5be3ac=_0x1fa7ab,_0x29adde=this[_0x5be3ac(0x1fb)][_0x5be3ac(0x1fd)](_0x3721fb),_0x1ad545=this[_0x5be3ac(0x237)]();return _0x29adde[_0x5be3ac(0x228)](_0x55490f),_0x29adde[_0x5be3ac(0x227)](this[_0x5be3ac(0x22c)],_0x1ad545[_0x5be3ac(0x20f)],_0x1ad545[_0x5be3ac(0x1ff)],_0x1ad545[_0x5be3ac(0x23a)],_0x1ad545[_0x5be3ac(0x21d)]);}['getSizeUsagesAsA1'](_0x1183c7){const _0x21afb5=_0x1fa7ab,_0x383927=this[_0x21afb5(0x201)](_0x1183c7);return this[_0x21afb5(0x1fb)]['get'](_0x3721fb)['toA1'](_0x383927);}['getRectArea'](_0x2d5e2d){const _0x1c720d=_0x1fa7ab,_0x4a9fa9=this[_0x1c720d(0x217)](_0x2d5e2d);return{'w':_0x4a9fa9['w'],'h':_0x4a9fa9['h']};}[_0x1fa7ab(0x211)](_0x2f998d){const _0x23a3c6=_0x1fa7ab;return this[_0x23a3c6(0x217)](_0x2f998d);}}function _0x3385(){const _0x2e3a56=['toLowerCase','startRow','getAllStyleUsages','getRectAreaData','2035110gDTlGg','filter','every','948114LPDMGm','moveFormulaRefOffset','_collectRectAreaData','extend','length','getValue','getCellDataGrid','warn','endColumn','getCellRaw','AND','firstOccurrence','getFormulaStringByCell','_formulaDataModel','getSheetId','70107YWxjlB','16WohPnY','getFormulaUsagesAsA1','getAllSizeUsages','updateConfig','formula','getMaxRows','visibleOnly','_worksheet','_workbook','some','includes','_isMatch','forValue','rawValue','getMaxColumns','35GLqiTf','map','getUnitId','getRange','getSheetBySheetId','getRowVisible','startColumn','body','dataStream','getRowHeight','getFormulaUsages','_cellMatchesSearch','toString','1054824vGANjp','Sheet\x20with\x20ID\x20','_initialize','searchCells','getName','getLintErrors','_injector','getActiveWorkbook','get','1700200RYxsue','endRow','getCellMatrix','getSizeUsages','getAllDataValidationErrorAsync','getStyleUsagesAsA1','push','getWorkbook','368556TpIYct','filledRanges','getColumnManager','getStyleUsages','getAllFormulaError','\x20not\x20found.\x20Skipping.','265412wctqeK','getAllFormulaUsages'];_0x3385=function(){return _0x2e3a56;};return _0x3385();}_0x3973ed['extend'](W);
1
+ const _0x21da04=_0x49ac;(function(_0x5b4049,_0x5e6a24){const _0x27c47d=_0x49ac,_0x24db5d=_0x5b4049();while(!![]){try{const _0x9abb6d=parseInt(_0x27c47d(0x14a))/0x1+parseInt(_0x27c47d(0x13b))/0x2+parseInt(_0x27c47d(0x125))/0x3+parseInt(_0x27c47d(0x12a))/0x4+parseInt(_0x27c47d(0x152))/0x5*(-parseInt(_0x27c47d(0x157))/0x6)+parseInt(_0x27c47d(0x14e))/0x7+-parseInt(_0x27c47d(0x11a))/0x8;if(_0x9abb6d===_0x5e6a24)break;else _0x24db5d['push'](_0x24db5d['shift']());}catch(_0x1815a5){_0x24db5d['push'](_0x24db5d['shift']());}}}(_0x352e,0xb746e));import{FUniver as _0x2446aa}from'@univerjs/core/facade';import'@univerjs/sheets-formula/facade';import'@univerjs/sheets-data-validation/facade';import{FWorkbook as _0x5cc0ba,FWorksheet as _0x3a59f7,FRange as _0x1d57f6}from'@univerjs/sheets/facade';import{FormulaDataModel as _0x4a6cc8,serializeRangeWithSheet as _0x1e64a8}from'@univerjs/engine-formula';function _0x352e(){const _0x26e27d=['getCellDataGrid','_injector','getRectAreaData','getName','get','getSheetId','moveFormulaRefOffset','22537456AuxtUR','_initialize','includes','filledRanges','defineProperty','getCellRaw','getColumnWidth','getAllStyleUsages','dataStream','_formulaDataModel','getFormulaUsagesAsA1','1945311hIIgCz','Sheet\x20with\x20ID\x20','_worksheet','_isMatch','formula','3294400YcbsDd','getColVisible','getAllSizeUsages','_collectRectAreaData','endColumn','getValue','trim','firstOccurrence','displayValue','push','length','body','getColumnManager','toLowerCase','getLintErrors','getRowVisible','getMaxRows','635024oBdwyT','getCellMatrix','getSheets','getCell','getActiveWorkbook','_cellMatchesSearch','getRange','getWorkbook','map','toString','extend','getRectArea','getRowManager','getFormulaStringByCell','getFormulaUsages','1149586eQpVLW','toA1','indexOf','endRow','4905943FwrnXp','startRow','forValue','searchCells','1750elpXRF','getSizeUsages','filter','getStyleUsagesAsA1','getAllFormulaUsages','1236NTteNl','getSizeUsagesAsA1','getSheetBySheetId','rawValue','startColumn','getUnitId','updateConfig','_workbook','getMaxColumns','getStyleUsages'];_0x352e=function(){return _0x26e27d;};return _0x352e();}import{IFormulaUsageAnalyzer as _0x3e9534,formulaToA1 as _0x2b8b65,IStyleUsageAnalyzer as _0x525d79,styleToA1 as _0x1d9b0d,ISizeUsageAnalyzer as _0x393ae1}from'@univerjs-pro/sheets-mcp';function _0x49ac(_0x1ad109,_0x382f36){_0x1ad109=_0x1ad109-0x118;const _0x352e6a=_0x352e();let _0x49ac41=_0x352e6a[_0x1ad109];return _0x49ac41;}import{getIntersectRange as _0x12746f}from'@univerjs/core';class b extends _0x2446aa{async['getLintErrors'](){const _0x58e527=_0x49ac;return this[_0x58e527(0x13f)]()[_0x58e527(0x138)]();}}_0x2446aa['extend'](b);class V extends _0x5cc0ba{[_0x21da04(0x11b)](){const _0x2c7f28=_0x21da04;Object[_0x2c7f28(0x11e)](this,_0x2c7f28(0x123),{'get'(){const _0x46f979=_0x2c7f28;return this[_0x46f979(0x162)]['get'](_0x4a6cc8);}});}[_0x21da04(0x151)](_0xa0eedf,_0x2c06ac={}){const _0x308f62=_0x21da04,{caseSensitive:_0x2e9fa0=!0x1,matchEntireCell:_0x242a87=!0x1,specificRanges:_0x405a97,specificTypes:_0x5edd3f,searchMultipleTextsCondition:_0x5eeb5a='OR'}=_0x2c06ac;let _0x6426ff=(Array['isArray'](_0xa0eedf)?_0xa0eedf:[_0xa0eedf])[_0x308f62(0x143)](_0x5b1f91=>_0x5b1f91[_0x308f62(0x130)]())[_0x308f62(0x154)](_0x4d827f=>_0x4d827f);if(_0x2e9fa0||(_0x6426ff=_0x6426ff[_0x308f62(0x143)](_0x597f04=>_0x597f04[_0x308f62(0x137)]())),_0x6426ff['length']===0x0)return[];const _0x2c5551={'caseSensitive':_0x2e9fa0,'matchEntireCell':_0x242a87,'searchMultipleTextsCondition':_0x5eeb5a,'isSearchByRawValue':!_0x5edd3f||_0x5edd3f[_0x308f62(0x11c)](_0x308f62(0x15a)),'isSearchByDisplayValue':!_0x5edd3f||_0x5edd3f['includes'](_0x308f62(0x132)),'isSearchByFormula':!_0x5edd3f||_0x5edd3f[_0x308f62(0x11c)](_0x308f62(0x129))},_0x29fd47=this[_0x308f62(0x142)](),_0x34ef5a=[];if(_0x405a97)for(const {sheetId:_0x53b4a8,ranges:_0x17d0c}of _0x405a97){const _0xad91c2=_0x29fd47[_0x308f62(0x159)](_0x53b4a8);if(!_0xad91c2){console['warn'](_0x308f62(0x126)+_0x53b4a8+'\x20not\x20found.\x20Skipping.');continue;}const _0x25e317=_0xad91c2['getCellMatrix']();if(_0x17d0c&&_0x17d0c[_0x308f62(0x134)]>0x0){for(const _0x1ccda7 of _0x17d0c)for(let _0x139d31=_0x1ccda7[_0x308f62(0x14f)];_0x139d31<=_0x1ccda7[_0x308f62(0x14d)];_0x139d31++)for(let _0xc620c7=_0x1ccda7[_0x308f62(0x15b)];_0xc620c7<=_0x1ccda7['endColumn'];_0xc620c7++){const _0x5f1943=_0x25e317[_0x308f62(0x12f)](_0x139d31,_0xc620c7);if(!_0x5f1943)continue;const _0x23b0a2=this[_0x308f62(0x140)](_0x5f1943,_0x6426ff,{..._0x2c5551,'worksheet':_0xad91c2,'row':_0x139d31,'col':_0xc620c7});_0x23b0a2&&_0x34ef5a['push']({..._0x23b0a2,'sheetId':_0xad91c2['getSheetId']()});}}else _0x25e317[_0x308f62(0x150)]((_0x18cea5,_0x2de67,_0x3b16d8)=>{const _0x527f32=_0x308f62;if(_0x3b16d8){const _0x453f1a=this['_cellMatchesSearch'](_0x3b16d8,_0x6426ff,{..._0x2c5551,'worksheet':_0xad91c2,'row':_0x18cea5,'col':_0x2de67});_0x453f1a&&_0x34ef5a[_0x527f32(0x133)]({..._0x453f1a,'sheetId':_0xad91c2[_0x527f32(0x118)]()});}});}else{const _0x26190e=_0x29fd47[_0x308f62(0x13d)]();for(const _0x3935aa of _0x26190e)_0x3935aa[_0x308f62(0x13c)]()[_0x308f62(0x150)]((_0x16cd3b,_0x4fc9f5,_0x582a31)=>{const _0x192220=_0x308f62;if(_0x582a31){const _0x3aee28=this[_0x192220(0x140)](_0x582a31,_0x6426ff,{..._0x2c5551,'worksheet':_0x3935aa,'row':_0x16cd3b,'col':_0x4fc9f5});_0x3aee28&&_0x34ef5a[_0x192220(0x133)]({..._0x3aee28,'sheetId':_0x3935aa['getSheetId']()});}});}return _0x34ef5a;}[_0x21da04(0x140)](_0x42a0ea,_0x32cf8f,_0x230c48){const _0x35aea0=_0x21da04;var _0x58bd7c,_0x50d89f,_0x367a8d,_0x246aa4,_0x4329e0;const {caseSensitive:_0x23a457,matchEntireCell:_0x117d8b,searchMultipleTextsCondition:_0x56b0da,isSearchByRawValue:_0x43ca45,isSearchByDisplayValue:_0x3adc67,isSearchByFormula:_0x261eb6,worksheet:_0x9c6020,row:_0x573699,col:_0x3487de}=_0x230c48;if(_0x43ca45){const _0x5e6d2f=((_0x50d89f=(_0x58bd7c=_0x42a0ea['p'])==null?void 0x0:_0x58bd7c[_0x35aea0(0x135)])==null?void 0x0:_0x50d89f[_0x35aea0(0x122)])||_0x42a0ea['v'];if(_0x5e6d2f){const _0x2d1608=_0x23a457?_0x5e6d2f[_0x35aea0(0x144)]():_0x5e6d2f[_0x35aea0(0x144)]()[_0x35aea0(0x137)]();if(this[_0x35aea0(0x128)](_0x2d1608,_0x32cf8f,_0x117d8b,_0x56b0da))return{'row':_0x573699,'col':_0x3487de,'reference':_0x1e64a8(_0x9c6020[_0x35aea0(0x164)](),{'startRow':_0x573699,'endRow':_0x573699,'startColumn':_0x3487de,'endColumn':_0x3487de}),'cellData':{..._0x42a0ea,'rawValue':_0x5e6d2f}};}}if(_0x261eb6&&(_0x42a0ea['f']||_0x42a0ea['si'])){const _0x2b623d=this[_0x35aea0(0x123)][_0x35aea0(0x148)](_0x573699,_0x3487de,_0x9c6020[_0x35aea0(0x118)](),this[_0x35aea0(0x142)]()[_0x35aea0(0x15c)]());if(_0x2b623d){const _0x1521c3=_0x23a457?_0x2b623d:_0x2b623d['toLowerCase']();if(this['_isMatch'](_0x1521c3,_0x32cf8f,_0x117d8b,_0x56b0da))return{'row':_0x573699,'col':_0x3487de,'reference':_0x1e64a8(_0x9c6020['getName'](),{'startRow':_0x573699,'endRow':_0x573699,'startColumn':_0x3487de,'endColumn':_0x3487de}),'cellData':{..._0x42a0ea,'formulaString':_0x2b623d}};}}if(_0x3adc67){let _0x27a487=(_0x246aa4=(_0x367a8d=_0x42a0ea['p'])==null?void 0x0:_0x367a8d['body'])==null?void 0x0:_0x246aa4[_0x35aea0(0x122)];if(_0x27a487||(_0x27a487=(_0x4329e0=_0x9c6020[_0x35aea0(0x13e)](_0x573699,_0x3487de))==null?void 0x0:_0x4329e0['v']),_0x27a487){const _0x3fd6de=_0x23a457?_0x27a487[_0x35aea0(0x144)]():_0x27a487[_0x35aea0(0x144)]()[_0x35aea0(0x137)]();if(this[_0x35aea0(0x128)](_0x3fd6de,_0x32cf8f,_0x117d8b,_0x56b0da))return{'row':_0x573699,'col':_0x3487de,'reference':_0x1e64a8(_0x9c6020[_0x35aea0(0x164)](),{'startRow':_0x573699,'endRow':_0x573699,'startColumn':_0x3487de,'endColumn':_0x3487de}),'cellData':{..._0x42a0ea,'displayValue':_0x27a487[_0x35aea0(0x144)]()}};}}return!0x1;}[_0x21da04(0x128)](_0x1b9e5b,_0x55d37a,_0x81772e,_0xa2e3e9){const _0xad014f=_0x21da04;return _0x55d37a['length']>0x1&&_0xa2e3e9==='AND'?_0x55d37a['every'](_0x4fd779=>_0x81772e?_0x1b9e5b===_0x4fd779:_0x1b9e5b['indexOf'](_0x4fd779)>-0x1):_0x55d37a['some'](_0x57580d=>_0x81772e?_0x1b9e5b===_0x57580d:_0x1b9e5b[_0xad014f(0x14c)](_0x57580d)>-0x1);}}_0x5cc0ba[_0x21da04(0x145)](V);class v extends _0x5cc0ba{async[_0x21da04(0x138)](){const _0x3cb5ec=this['getAllFormulaError'](),_0x5addc9=await this['getAllDataValidationErrorAsync']();return{'formulaErrors':_0x3cb5ec,'dataValidationErrors':_0x5addc9};}}_0x5cc0ba['extend'](v);class j extends _0x3a59f7{async[_0x21da04(0x149)](){const _0x22f417=_0x21da04,_0x1c1104=this[_0x22f417(0x162)]['get'](_0x3e9534),_0x5b3f34=this['getRange'](0x0,0x0,this['getMaxRows'](),this[_0x22f417(0x15f)]())[_0x22f417(0x161)]();return await _0x1c1104[_0x22f417(0x156)](_0x5b3f34);}async[_0x21da04(0x124)](){const _0x50b4f7=_0x21da04;return(await this[_0x50b4f7(0x149)]())[_0x50b4f7(0x143)](_0x2b8b65);}['getStyleUsages'](_0x4d99ea){const _0x1a478c=_0x21da04,_0x4b417d=this[_0x1a478c(0x162)][_0x1a478c(0x165)](_0x525d79),_0x190fcd=this[_0x1a478c(0x141)](0x0,0x0,this[_0x1a478c(0x13a)](),this[_0x1a478c(0x15f)]())[_0x1a478c(0x161)]();return _0x4b417d[_0x1a478c(0x15d)](_0x4d99ea),_0x4b417d['getAllStyleUsages'](_0x190fcd,this[_0x1a478c(0x15e)],this[_0x1a478c(0x127)]);}[_0x21da04(0x155)](_0x15c86c){const _0x180ff8=_0x21da04;return this[_0x180ff8(0x160)](_0x15c86c)[_0x180ff8(0x143)](_0x1d9b0d);}[_0x21da04(0x153)](_0x1634f7){const _0x1813ac=_0x21da04,_0x3eb17f=this['_injector']['get'](_0x393ae1);return _0x3eb17f[_0x1813ac(0x15d)](_0x1634f7),_0x3eb17f[_0x1813ac(0x12c)](this[_0x1813ac(0x127)]);}[_0x21da04(0x158)](_0x161a46){const _0x3f58c6=_0x21da04,_0x39d561=this[_0x3f58c6(0x162)][_0x3f58c6(0x165)](_0x393ae1);_0x39d561[_0x3f58c6(0x15d)](_0x161a46);const _0x494819=_0x39d561['getAllSizeUsages'](this[_0x3f58c6(0x127)]);return _0x39d561[_0x3f58c6(0x14b)](_0x494819);}}_0x3a59f7[_0x21da04(0x145)](j);class W extends _0x1d57f6{[_0x21da04(0x12d)](_0xe7c60d){const _0x4af060=_0x21da04;var _0x45d8ff;const _0x2ae98a=(_0x45d8ff=_0xe7c60d==null?void 0x0:_0xe7c60d['visibleOnly'])!=null?_0x45d8ff:!0x0,_0x4814ec=this[_0x4af060(0x141)](),_0x5ccc66=this[_0x4af060(0x127)][_0x4af060(0x147)](),_0x53aa9b=this[_0x4af060(0x127)][_0x4af060(0x136)](),_0x33eb73={};let _0x4bf12e=0x0;for(let _0x230553=_0x4814ec['startRow'];_0x230553<=_0x4814ec[_0x4af060(0x14d)];_0x230553++){const _0x56ef85=_0x5ccc66['getRowHeight'](_0x230553),_0x207c61=!_0x2ae98a||this[_0x4af060(0x127)][_0x4af060(0x139)](_0x230553)?_0x56ef85:0x0;_0x4bf12e+=_0x207c61,_0x33eb73[_0x230553]={'h':_0x207c61};}const _0x45d39d={};let _0x28dfc3=0x0;for(let _0x31052f=_0x4814ec[_0x4af060(0x15b)];_0x31052f<=_0x4814ec[_0x4af060(0x12e)];_0x31052f++){const _0x155008=_0x53aa9b[_0x4af060(0x120)](_0x31052f),_0x218994=!_0x2ae98a||this['_worksheet'][_0x4af060(0x12b)](_0x31052f)?_0x155008:0x0;_0x28dfc3+=_0x218994,_0x45d39d[_0x31052f]={'w':_0x218994};}return{'w':_0x28dfc3,'h':_0x4bf12e,'rowData':_0x33eb73,'columnData':_0x45d39d};}async[_0x21da04(0x149)](){const _0x582dc0=_0x21da04,_0x2ffdb0=this[_0x582dc0(0x162)][_0x582dc0(0x165)](_0x3e9534),_0x1cd593=(({startRow:_0x5a5e52,endRow:_0x1a33d0,startColumn:_0x31732a,endColumn:_0x40f1fa})=>{const _0x3d1488=_0x582dc0,_0x8b38bb=[];for(let _0x2f3341=_0x5a5e52;_0x2f3341<=_0x1a33d0;_0x2f3341++){const _0x1880ad=[];for(let _0x331150=_0x31732a;_0x331150<=_0x40f1fa;_0x331150++)_0x1880ad[_0x3d1488(0x133)](this['_worksheet'][_0x3d1488(0x11f)](_0x2f3341,_0x331150));_0x8b38bb['push'](_0x1880ad);}return _0x8b38bb;})({'startRow':0x0,'endRow':this[_0x582dc0(0x127)][_0x582dc0(0x13a)](),'startColumn':0x0,'endColumn':this[_0x582dc0(0x127)][_0x582dc0(0x15f)]()}),_0x5198d4=await _0x2ffdb0[_0x582dc0(0x156)](_0x1cd593),_0x5b3c10=this['getRange'](),_0x4cafa8=[];for(let _0x565f67=0x0;_0x565f67<_0x5198d4[_0x582dc0(0x134)];_0x565f67++){const _0x58b532=_0x5198d4[_0x565f67],_0x3426d2=_0x58b532[_0x582dc0(0x11d)],_0x2733e1=[];for(let _0x326918=0x0;_0x326918<_0x3426d2['length'];_0x326918++){const _0x26a127=_0x3426d2[_0x326918],_0x3ddfe1=_0x12746f(_0x26a127,_0x5b3c10);_0x3ddfe1&&_0x2733e1[_0x582dc0(0x133)](_0x3ddfe1);}if(_0x2733e1[_0x582dc0(0x134)]>0x0){if(_0x58b532['filledRanges']=_0x2733e1,!(_0x58b532[_0x582dc0(0x131)]['startRow']>=_0x5b3c10[_0x582dc0(0x14f)]&&_0x58b532[_0x582dc0(0x131)][_0x582dc0(0x14f)]<=_0x5b3c10[_0x582dc0(0x14d)]&&_0x58b532[_0x582dc0(0x131)]['startColumn']>=_0x5b3c10[_0x582dc0(0x15b)]&&_0x58b532[_0x582dc0(0x131)][_0x582dc0(0x15b)]<=_0x5b3c10['endColumn'])){const _0x13b93e=_0x2733e1[0x0],_0x1f084f=_0x13b93e[_0x582dc0(0x14f)]-_0x58b532[_0x582dc0(0x131)][_0x582dc0(0x14f)],_0x48c82d=_0x13b93e[_0x582dc0(0x15b)]-_0x58b532[_0x582dc0(0x131)][_0x582dc0(0x15b)];_0x58b532[_0x582dc0(0x129)]=await _0x2ffdb0[_0x582dc0(0x119)](_0x58b532[_0x582dc0(0x129)],_0x48c82d,_0x1f084f),_0x58b532[_0x582dc0(0x131)]={'startRow':_0x13b93e[_0x582dc0(0x14f)],'endRow':_0x13b93e[_0x582dc0(0x14f)],'startColumn':_0x13b93e[_0x582dc0(0x15b)],'endColumn':_0x13b93e[_0x582dc0(0x15b)]};}_0x4cafa8[_0x582dc0(0x133)](_0x58b532);}}return _0x4cafa8;}async[_0x21da04(0x124)](){const _0x30b567=_0x21da04;return(await this[_0x30b567(0x149)]())['map'](_0x2b8b65);}['getStyleUsages'](_0x51bd3b){const _0x34a15c=_0x21da04,_0x14fde0=this[_0x34a15c(0x162)][_0x34a15c(0x165)](_0x525d79),_0x64da7c=(({startRow:_0x1923ed,endRow:_0x55e831,startColumn:_0x9bf553,endColumn:_0x245f52})=>{const _0xf9dfaf=_0x34a15c,_0x5be27f=[];for(let _0x3986d4=_0x1923ed;_0x3986d4<=_0x55e831;_0x3986d4++){const _0x14636b=[];for(let _0x155496=_0x9bf553;_0x155496<=_0x245f52;_0x155496++)_0x14636b[_0xf9dfaf(0x133)](this[_0xf9dfaf(0x127)][_0xf9dfaf(0x11f)](_0x3986d4,_0x155496));_0x5be27f[_0xf9dfaf(0x133)](_0x14636b);}return _0x5be27f;})({'startRow':0x0,'endRow':this[_0x34a15c(0x127)][_0x34a15c(0x13a)](),'startColumn':0x0,'endColumn':this[_0x34a15c(0x127)][_0x34a15c(0x15f)]()});_0x14fde0[_0x34a15c(0x15d)](_0x51bd3b);const _0x3b82d5=_0x14fde0[_0x34a15c(0x121)](_0x64da7c,this[_0x34a15c(0x15e)],this['_worksheet']),_0x3b8b21=this['getRange'](),_0x2e94ee=[];for(let _0x5e4022=0x0;_0x5e4022<_0x3b82d5[_0x34a15c(0x134)];_0x5e4022++){const _0x180fed=_0x3b82d5[_0x5e4022],_0xc30030=_0x180fed[_0x34a15c(0x11d)],_0x26a805=[];for(let _0x2edc42=0x0;_0x2edc42<_0xc30030[_0x34a15c(0x134)];_0x2edc42++){const _0x3c8b8c=_0xc30030[_0x2edc42],_0x21eb30=_0x12746f(_0x3c8b8c,_0x3b8b21);_0x21eb30&&_0x26a805[_0x34a15c(0x133)](_0x21eb30);}_0x26a805['length']>0x0&&(_0x180fed[_0x34a15c(0x11d)]=_0x26a805,_0x2e94ee[_0x34a15c(0x133)](_0x180fed));}return _0x2e94ee;}['getStyleUsagesAsA1'](_0x12e5a4){const _0x488c07=_0x21da04;return this['getStyleUsages'](_0x12e5a4)[_0x488c07(0x143)](_0x1d9b0d);}['getSizeUsages'](_0x369258){const _0x3dd617=_0x21da04,_0x5cd52d=this[_0x3dd617(0x162)][_0x3dd617(0x165)](_0x393ae1),_0x399853=this[_0x3dd617(0x141)]();return _0x5cd52d[_0x3dd617(0x15d)](_0x369258),_0x5cd52d[_0x3dd617(0x12c)](this[_0x3dd617(0x127)],_0x399853[_0x3dd617(0x14f)],_0x399853['endRow'],_0x399853[_0x3dd617(0x15b)],_0x399853['endColumn']);}['getSizeUsagesAsA1'](_0x58358a){const _0x248d09=_0x21da04,_0x1dc79d=this[_0x248d09(0x153)](_0x58358a);return this[_0x248d09(0x162)][_0x248d09(0x165)](_0x393ae1)[_0x248d09(0x14b)](_0x1dc79d);}[_0x21da04(0x146)](_0x599556){const _0x407d04=this['_collectRectAreaData'](_0x599556);return{'w':_0x407d04['w'],'h':_0x407d04['h']};}[_0x21da04(0x163)](_0x5cf79e){return this['_collectRectAreaData'](_0x5cf79e);}}_0x1d57f6[_0x21da04(0x145)](W);