@univer-cli/content-inspection 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.mjs +1 -1
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- (function(_0x36deb9,_0x29f040){const _0x3ad5c8=_0x5e7e,_0x194492=_0x36deb9();while(!![]){try{const _0x9cc72c=parseInt(_0x3ad5c8(0x1fe))/0x1*(-parseInt(_0x3ad5c8(0x200))/0x2)+parseInt(_0x3ad5c8(0x1ce))/0x3*(parseInt(_0x3ad5c8(0x20a))/0x4)+parseInt(_0x3ad5c8(0x1fc))/0x5+-parseInt(_0x3ad5c8(0x1f9))/0x6+parseInt(_0x3ad5c8(0x1d1))/0x7+parseInt(_0x3ad5c8(0x1aa))/0x8+parseInt(_0x3ad5c8(0x19c))/0x9;if(_0x9cc72c===_0x29f040)break;else _0x194492['push'](_0x194492['shift']());}catch(_0x33a0f5){_0x194492['push'](_0x194492['shift']());}}}(_0x372d,0xb5899));var e=class extends Error{['code'];['details'];constructor(_0x4a9c5e,_0x18ae8f,_0x2e2388){const _0x1ae575=_0x5e7e;super(_0x18ae8f),this['code']=_0x4a9c5e,this[_0x1ae575(0x1a0)]=_0x2e2388,this[_0x1ae575(0x1c5)]=_0x1ae575(0x1fd);}};function t(_0x120390){const _0x5961db=_0x5e7e;if(!_(_0x120390)||typeof _0x120390['ok']!=_0x5961db(0x1e0))throw g(_0x5961db(0x1b4));if(_0x120390['ok']===!0x0&&'value'in _0x120390)return _0x120390['value'];let _0x369a83=_0x120390[_0x5961db(0x202)];if(_0x120390['ok']===!0x1&&_(_0x369a83)){let _0x1f2fe9=_0x369a83[_0x5961db(0x1ac)],_0x3a15a5=_0x369a83[_0x5961db(0x201)];if(v(_0x1f2fe9)&&typeof _0x3a15a5==_0x5961db(0x1b6))throw new e(_0x1f2fe9,_0x3a15a5,_0x369a83[_0x5961db(0x1a0)]);}throw g(_0x5961db(0x1a3));}function n(_0x49aa25,_0x13f1dc){const _0x4a26a2=_0x5e7e;if(!_(_0x49aa25)||_0x49aa25[_0x4a26a2(0x1c7)]!==_0x13f1dc||typeof _0x49aa25[_0x4a26a2(0x1b2)]!=_0x4a26a2(0x1b6)||!(_0x13f1dc===_0x4a26a2(0x1f8)?p(_0x49aa25):_0x13f1dc===_0x4a26a2(0x1c6)?typeof _0x49aa25[_0x4a26a2(0x1c5)]=='string'&&Array[_0x4a26a2(0x204)](_0x49aa25[_0x4a26a2(0x1c0)]):_0x13f1dc==='worksheet'?Array[_0x4a26a2(0x204)](_0x49aa25['worksheets']):_0x13f1dc===_0x4a26a2(0x1bf)?Array[_0x4a26a2(0x204)](_0x49aa25['ranges']):_0x13f1dc===_0x4a26a2(0x1b3)?typeof _0x49aa25[_0x4a26a2(0x1c5)]=='string'&&Array[_0x4a26a2(0x204)](_0x49aa25[_0x4a26a2(0x1bc)]):_0x13f1dc===_0x4a26a2(0x1ba)?Array['isArray'](_0x49aa25['slides']):_0x13f1dc===_0x4a26a2(0x20c)?typeof _0x49aa25[_0x4a26a2(0x207)]==_0x4a26a2(0x1b6)&&Array[_0x4a26a2(0x204)](_0x49aa25[_0x4a26a2(0x1a9)]):_0x13f1dc===_0x4a26a2(0x20b)?Array[_0x4a26a2(0x204)](_0x49aa25['paragraphs']):_0x13f1dc===_0x4a26a2(0x1bd)?r(_0x49aa25):_0x13f1dc===_0x4a26a2(0x1dc)&&i(_0x49aa25)))throw g(_0x4a26a2(0x1ef)+_0x13f1dc+_0x4a26a2(0x20e));}function r(_0x4436cd){const _0x55bf72=_0x5e7e;let _0x209893=_0x4436cd[_0x55bf72(0x205)];return typeof _0x4436cd[_0x55bf72(0x1c5)]==_0x55bf72(0x1b6)&&_0x55bf72(0x1a4)in _0x4436cd&&_(_0x209893)&&m(_0x209893[_0x55bf72(0x1d4)])&&_(_0x209893['byType'])&&Object['values'](_0x209893[_0x55bf72(0x1a5)])[_0x55bf72(0x1c2)](m)&&Array[_0x55bf72(0x204)](_0x4436cd['elements'])&&_0x209893[_0x55bf72(0x1d4)]===_0x4436cd[_0x55bf72(0x208)]['length']&&Object[_0x55bf72(0x1d2)](_0x209893[_0x55bf72(0x1a5)])['reduce']((_0x18a94a,_0x35b49f)=>_0x18a94a+Number(_0x35b49f),0x0)===_0x209893[_0x55bf72(0x1d4)]&&_0x4436cd[_0x55bf72(0x208)][_0x55bf72(0x1c2)](a);}function i(_0x38e349){const _0x178277=_0x5e7e;return Array['isArray'](_0x38e349['elements'])&&_0x38e349[_0x178277(0x208)][_0x178277(0x1c2)](o);}function a(_0x3bb3d2){const _0x312fd6=_0x5e7e;return _(_0x3bb3d2)&&typeof _0x3bb3d2['id']==_0x312fd6(0x1b6)&&m(_0x3bb3d2[_0x312fd6(0x1a1)])&&typeof _0x3bb3d2[_0x312fd6(0x1e5)]==_0x312fd6(0x1b6)&&typeof _0x3bb3d2[_0x312fd6(0x197)]=='boolean'&&typeof _0x3bb3d2[_0x312fd6(0x1c8)]==_0x312fd6(0x1e0)&&typeof _0x3bb3d2[_0x312fd6(0x1fb)]==_0x312fd6(0x1e0)&&_(_0x3bb3d2[_0x312fd6(0x1ed)])&&f(_0x3bb3d2[_0x312fd6(0x1c5)])&&f(_0x3bb3d2['description'])&&f(_0x3bb3d2[_0x312fd6(0x1e9)])&&f(_0x3bb3d2[_0x312fd6(0x1a6)])&&(_0x3bb3d2[_0x312fd6(0x1cf)]===null||l(_0x3bb3d2['bounds']));}function o(_0x39cd53){const _0x4a92cb=_0x5e7e;return!a(_0x39cd53)||_0x4a92cb(0x19b)in _0x39cd53||_0x4a92cb(0x1a0)in _0x39cd53||_0x4a92cb(0x1ad)in _0x39cd53?!0x1:_0x39cd53[_0x4a92cb(0x1e5)]===_0x4a92cb(0x1e7)?'shapeData'in _0x39cd53:_0x39cd53[_0x4a92cb(0x1e5)]===_0x4a92cb(0x1b9)?!('startElementId'in _0x39cd53)&&!(_0x4a92cb(0x1be)in _0x39cd53)&&!(_0x4a92cb(0x1eb)in _0x39cd53)&&!(_0x4a92cb(0x199)in _0x39cd53)&&s(_0x39cd53['connection'])&&'style'in _0x39cd53&&Array[_0x4a92cb(0x204)](_0x39cd53[_0x4a92cb(0x1a2)])&&_0x39cd53[_0x4a92cb(0x1a2)]['every'](_0x5121fa=>_(_0x5121fa)&&typeof _0x5121fa['id']=='string')&&'labelText'in _0x39cd53&&_0x4a92cb(0x206)in _0x39cd53:_0x39cd53[_0x4a92cb(0x1e5)]===_0x4a92cb(0x199)?_0x4a92cb(0x1cc)in _0x39cd53&&_0x4a92cb(0x1ee)in _0x39cd53:_0x39cd53['type']===_0x4a92cb(0x1f2)||_0x39cd53[_0x4a92cb(0x1e5)]==='media'?typeof _0x39cd53[_0x4a92cb(0x1da)]=='string':_0x39cd53[_0x4a92cb(0x1e5)]==='chart'?typeof _0x39cd53['chartId']==_0x4a92cb(0x1b6):_0x39cd53[_0x4a92cb(0x1e5)]==='container'?_0x4a92cb(0x1cd)in _0x39cd53:_0x39cd53[_0x4a92cb(0x1e5)]===_0x4a92cb(0x1c1)?_0x4a92cb(0x1a7)in _0x39cd53:_0x39cd53[_0x4a92cb(0x1e5)]==='table'?typeof _0x39cd53[_0x4a92cb(0x1c9)]=='string':_0x39cd53[_0x4a92cb(0x1e5)]===_0x4a92cb(0x1f4)?Array[_0x4a92cb(0x204)](_0x39cd53[_0x4a92cb(0x1b8)])&&_0x39cd53['children'][_0x4a92cb(0x1c2)](_0xd82b0d=>typeof _0xd82b0d==_0x4a92cb(0x1b6)):_0x39cd53[_0x4a92cb(0x1e5)]===_0x4a92cb(0x1d6)?_0x4a92cb(0x1d6)in _0x39cd53:_0x39cd53[_0x4a92cb(0x1e5)]===_0x4a92cb(0x1d9)&&typeof _0x39cd53[_0x4a92cb(0x1af)]==_0x4a92cb(0x1b6)&&_0x4a92cb(0x1a7)in _0x39cd53;}function s(_0x2b9f26){const _0x44fe2d=_0x5e7e;return _(_0x2b9f26)&&c(_0x2b9f26[_0x44fe2d(0x210)])&&c(_0x2b9f26[_0x44fe2d(0x211)])&&(_0x2b9f26['routing']===_0x44fe2d(0x1db)||_0x2b9f26[_0x44fe2d(0x1c4)]===_0x44fe2d(0x1ea)||_0x2b9f26[_0x44fe2d(0x1c4)]==='curve'||_0x2b9f26[_0x44fe2d(0x1c4)]==='freePolyline')&&(_0x2b9f26['routingMode']===_0x44fe2d(0x1c3)||_0x2b9f26[_0x44fe2d(0x1fa)]===_0x44fe2d(0x1cb)||_0x2b9f26[_0x44fe2d(0x1fa)]==='mixed')&&Array[_0x44fe2d(0x204)](_0x2b9f26[_0x44fe2d(0x209)])&&_0x2b9f26[_0x44fe2d(0x209)]['every'](_0x54ab12=>_(_0x54ab12)&&typeof _0x54ab12['id']=='string'&&(_0x54ab12[_0x44fe2d(0x1c7)]==='auto'||_0x54ab12[_0x44fe2d(0x1c7)]===_0x44fe2d(0x1cb))&&u(_0x54ab12));}function _0x5e7e(_0x3fd91d,_0x5cd75d){_0x3fd91d=_0x3fd91d-0x197;const _0x372d20=_0x372d();let _0x5e7ec0=_0x372d20[_0x3fd91d];return _0x5e7ec0;}function c(_0x424b28){const _0x165cc9=_0x5e7e;return!_(_0x424b28)||typeof _0x424b28[_0x165cc9(0x1c7)]!=_0x165cc9(0x1b6)?!0x1:_0x424b28[_0x165cc9(0x1c7)]===_0x165cc9(0x1ab)?u(_0x424b28):_0x424b28[_0x165cc9(0x1c7)]===_0x165cc9(0x1d5)?typeof _0x424b28[_0x165cc9(0x1e6)]==_0x165cc9(0x1b6)&&typeof _0x424b28['offsetY']==_0x165cc9(0x1dd):_0x424b28[_0x165cc9(0x1c7)]===_0x165cc9(0x1b0)?typeof _0x424b28[_0x165cc9(0x1e6)]==_0x165cc9(0x1b6)&&typeof _0x424b28[_0x165cc9(0x1d8)]==_0x165cc9(0x1dd)&&d(_0x424b28['connectionPosition']):_0x424b28[_0x165cc9(0x1c7)]==='shapeBoundary'&&typeof _0x424b28[_0x165cc9(0x1e6)]==_0x165cc9(0x1b6)&&typeof _0x424b28['outlineIndex']==_0x165cc9(0x1dd)&&typeof _0x424b28[_0x165cc9(0x212)]==_0x165cc9(0x1dd)&&typeof _0x424b28['segmentT']=='number';}function l(_0x33a65a){const _0x3fbff9=_0x5e7e;return _(_0x33a65a)&&typeof _0x33a65a[_0x3fbff9(0x1b1)]==_0x3fbff9(0x1dd)&&typeof _0x33a65a[_0x3fbff9(0x1ae)]==_0x3fbff9(0x1dd)&&typeof _0x33a65a[_0x3fbff9(0x1bb)]==_0x3fbff9(0x1dd)&&typeof _0x33a65a['height']==_0x3fbff9(0x1dd);}function u(_0x43bcd8){const _0x1e582f=_0x5e7e;return _(_0x43bcd8)&&typeof _0x43bcd8['x']==_0x1e582f(0x1dd)&&typeof _0x43bcd8['y']==_0x1e582f(0x1dd);}function d(_0x5beafc){return _0x5beafc===void 0x0||typeof _0x5beafc=='number';}function f(_0x5a2061){return _0x5a2061===void 0x0||typeof _0x5a2061=='string';}function _0x372d(){const _0x255546=['straight','board-element','number','recordCount','length','boolean',';\x0aconst\x20fail\x20=\x20(code,\x20message,\x20details)\x20=>\x20({\x20ok:\x20false,\x20error:\x20{\x20code,\x20message,\x20...(details\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20details\x20})\x20}\x20});\x0aconst\x20success\x20=\x20(value)\x20=>\x20({\x20ok:\x20true,\x20value\x20});\x0aconst\x20document\x20=\x20univerAPI.getDocument(input.unitId);\x0aif\x20(!document)\x20return\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Document\x20\x22\x20+\x20input.unitId\x20+\x20\x22\x20is\x20not\x20available\x20in\x20the\x20runtime\x22);\x0aconst\x20snapshot\x20=\x20document.save();\x0aconst\x20body\x20=\x20snapshot.body\x20||\x20{};\x0aconst\x20stream\x20=\x20typeof\x20body.dataStream\x20===\x20\x22string\x22\x20?\x20body.dataStream\x20:\x20\x22\x22;\x0aconst\x20rawParagraphs\x20=\x20Array.isArray(body.paragraphs)\x20?\x20body.paragraphs\x20:\x20[];\x0a\x0afunction\x20cleanPreview(text)\x20{\x0a\x20\x20const\x20normalized\x20=\x20text.replace(/[\x5cu0000-\x5cu001f]+/g,\x20\x22\x20\x22).replace(/\x5cs+/g,\x20\x22\x20\x22).trim();\x0a\x20\x20return\x20normalized.length\x20<=\x20120\x20?\x20normalized\x20:\x20normalized.slice(0,\x20117)\x20+\x20\x22...\x22;\x0a}\x0a\x0afunction\x20resolveParagraphs()\x20{\x0a\x20\x20let\x20start\x20=\x200;\x0a\x20\x20return\x20rawParagraphs.map((paragraph,\x20index)\x20=>\x20{\x0a\x20\x20\x20\x20const\x20end\x20=\x20Number.isInteger(paragraph.startIndex)\x20?\x20paragraph.startIndex\x20:\x20start;\x0a\x20\x20\x20\x20const\x20result\x20=\x20{\x0a\x20\x20\x20\x20\x20\x20id:\x20typeof\x20paragraph.paragraphId\x20===\x20\x22string\x22\x20?\x20paragraph.paragraphId\x20:\x20String(index),\x0a\x20\x20\x20\x20\x20\x20index,\x0a\x20\x20\x20\x20\x20\x20text:\x20stream.slice(start,\x20end),\x0a\x20\x20\x20\x20\x20\x20start,\x0a\x20\x20\x20\x20\x20\x20end,\x0a\x20\x20\x20\x20\x20\x20raw:\x20paragraph,\x0a\x20\x20\x20\x20};\x0a\x20\x20\x20\x20start\x20=\x20end\x20+\x201;\x0a\x20\x20\x20\x20return\x20result;\x0a\x20\x20});\x0a}\x0a\x0aconst\x20paragraphs\x20=\x20resolveParagraphs();\x0a\x0afunction\x20resolveParagraph(selector)\x20{\x0a\x20\x20if\x20(!selector\x20||\x20typeof\x20selector\x20!==\x20\x22object\x22)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Paragraph\x20selector\x20must\x20be\x20an\x20object\x22)\x20};\x0a\x20\x20const\x20keys\x20=\x20[\x22id\x22,\x20\x22index\x22].filter((key)\x20=>\x20Object.hasOwn(selector,\x20key));\x0a\x20\x20if\x20(keys.length\x20!==\x201)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Paragraph\x20selector\x20must\x20contain\x20exactly\x20one\x20of\x20id\x20or\x20index\x22,\x20selector)\x20};\x0a\x20\x20let\x20matches\x20=\x20[];\x0a\x20\x20if\x20(keys[0]\x20===\x20\x22id\x22\x20&&\x20typeof\x20selector.id\x20===\x20\x22string\x22\x20&&\x20selector.id.length\x20>\x200)\x20matches\x20=\x20paragraphs.filter((paragraph)\x20=>\x20paragraph.id\x20===\x20selector.id);\x0a\x20\x20else\x20if\x20(keys[0]\x20===\x20\x22index\x22\x20&&\x20Number.isInteger(selector.index)\x20&&\x20selector.index\x20>=\x200)\x20matches\x20=\x20paragraphs[selector.index]\x20?\x20[paragraphs[selector.index]]\x20:\x20[];\x0a\x20\x20else\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Paragraph\x20selector\x20value\x20is\x20invalid\x22,\x20selector)\x20};\x0a\x20\x20if\x20(matches.length\x20===\x200)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_NOT_FOUND\x22,\x20\x22Paragraph\x20selector\x20did\x20not\x20match\x20a\x20paragraph\x22,\x20selector)\x20};\x0a\x20\x20if\x20(matches.length\x20>\x201)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_AMBIGUOUS\x22,\x20\x22Paragraph\x20selector\x20matched\x20more\x20than\x20one\x20paragraph\x22,\x20selector)\x20};\x0a\x20\x20return\x20{\x20paragraph:\x20matches[0]\x20};\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22document\x22)\x20{\x0a\x20\x20const\x20mode\x20=\x20typeof\x20document.isModern\x20===\x20\x22function\x22\x20&&\x20document.isModern()\x0a\x20\x20\x20\x20?\x20\x22modern\x22\x0a\x20\x20\x20\x20:\x20typeof\x20document.isTraditional\x20===\x20\x22function\x22\x20&&\x20document.isTraditional()\x0a\x20\x20\x20\x20\x20\x20?\x20\x22paginated\x22\x0a\x20\x20\x20\x20\x20\x20:\x20\x22unspecified\x22;\x0a\x20\x20return\x20success({\x0a\x20\x20\x20\x20kind:\x20\x22document\x22,\x0a\x20\x20\x20\x20unitId:\x20input.unitId,\x0a\x20\x20\x20\x20title:\x20document.getName(),\x0a\x20\x20\x20\x20mode,\x0a\x20\x20\x20\x20paragraphCount:\x20paragraphs.length,\x0a\x20\x20\x20\x20characterCount:\x20paragraphs.reduce((total,\x20paragraph)\x20=>\x20total\x20+\x20paragraph.text.length,\x200),\x0a\x20\x20\x20\x20features:\x20{\x0a\x20\x20\x20\x20\x20\x20tables:\x20Array.isArray(body.tables)\x20?\x20body.tables.length\x20:\x200,\x0a\x20\x20\x20\x20\x20\x20lists:\x20paragraphs.filter((paragraph)\x20=>\x20paragraph.raw.bullet\x20!==\x20undefined).length,\x0a\x20\x20\x20\x20\x20\x20drawings:\x20snapshot.drawings\x20&&\x20typeof\x20snapshot.drawings\x20===\x20\x22object\x22\x20?\x20Object.keys(snapshot.drawings).length\x20:\x200,\x0a\x20\x20\x20\x20\x20\x20customBlocks:\x20Array.isArray(body.customBlocks)\x20?\x20body.customBlocks.length\x20:\x200,\x0a\x20\x20\x20\x20\x20\x20blockRanges:\x20Array.isArray(body.blockRanges)\x20?\x20body.blockRanges.length\x20:\x200,\x0a\x20\x20\x20\x20},\x0a\x20\x20\x20\x20paragraphs:\x20paragraphs.map((paragraph)\x20=>\x20({\x20id:\x20paragraph.id,\x20index:\x20paragraph.index,\x20textPreview:\x20cleanPreview(paragraph.text)\x20})),\x0a\x20\x20});\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22paragraph\x22)\x20{\x0a\x20\x20const\x20selected\x20=\x20[];\x0a\x20\x20for\x20(const\x20selector\x20of\x20input.query.paragraphs\x20||\x20[])\x20{\x0a\x20\x20\x20\x20const\x20item\x20=\x20resolveParagraph(selector);\x0a\x20\x20\x20\x20if\x20(item.error)\x20return\x20item.error;\x0a\x20\x20\x20\x20const\x20paragraph\x20=\x20item.paragraph;\x0a\x20\x20\x20\x20const\x20runs\x20=\x20(Array.isArray(body.textRuns)\x20?\x20body.textRuns\x20:\x20[]).filter((run)\x20=>\x20(run.ed\x20||\x200)\x20>\x20paragraph.start\x20&&\x20(run.st\x20||\x200)\x20<\x20paragraph.end);\x0a\x20\x20\x20\x20const\x20bullet\x20=\x20paragraph.raw.bullet;\x0a\x20\x20\x20\x20const\x20listId\x20=\x20bullet\x20&&\x20bullet.listId;\x0a\x20\x20\x20\x20const\x20list\x20=\x20typeof\x20listId\x20===\x20\x22string\x22\x20&&\x20snapshot.lists\x20&&\x20snapshot.lists[listId];\x0a\x20\x20\x20\x20selected.push({\x0a\x20\x20\x20\x20\x20\x20id:\x20paragraph.id,\x0a\x20\x20\x20\x20\x20\x20index:\x20paragraph.index,\x0a\x20\x20\x20\x20\x20\x20text:\x20paragraph.text,\x0a\x20\x20\x20\x20\x20\x20...(paragraph.raw.paragraphStyle\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20style:\x20paragraph.raw.paragraphStyle\x20}),\x0a\x20\x20\x20\x20\x20\x20...(bullet\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20bullet\x20}),\x0a\x20\x20\x20\x20\x20\x20...(list\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20list\x20}),\x0a\x20\x20\x20\x20\x20\x20textRuns:\x20runs,\x0a\x20\x20\x20\x20});\x0a\x20\x20}\x0a\x20\x20return\x20success({\x20kind:\x20\x22paragraph\x22,\x20unitId:\x20input.unitId,\x20paragraphs:\x20selected\x20});\x0a}\x0a\x0areturn\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Unsupported\x20document\x20inspection\x20target\x22);\x0a','index','execute','stringify','type','shapeId','shape','read','parentId','orthogonal','subtype','tables','transform','textStyle','Inspection\x20runtime\x20returned\x20an\x20invalid\x20','config','INSPECTION_SELECTOR_INVALID','image',';\x0aconst\x20fail\x20=\x20(code,\x20message,\x20details)\x20=>\x20({\x20ok:\x20false,\x20error:\x20{\x20code,\x20message,\x20...(details\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20details\x20})\x20}\x20});\x0aconst\x20success\x20=\x20(value)\x20=>\x20({\x20ok:\x20true,\x20value:\x20JSON.parse(JSON.stringify(value))\x20});\x0aconst\x20board\x20=\x20univerAPI.getBoard(input.unitId);\x0aif\x20(!board)\x20return\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Board\x20\x22\x20+\x20input.unitId\x20+\x20\x22\x20is\x20not\x20available\x20in\x20the\x20runtime\x22);\x0a\x0aconst\x20descriptors\x20=\x20board.describeElements();\x0aconst\x20descriptorsById\x20=\x20new\x20Map(descriptors.map((descriptor)\x20=>\x20[descriptor.id,\x20descriptor]));\x0a\x0afunction\x20elementCounts()\x20{\x0a\x20\x20const\x20byType\x20=\x20{};\x0a\x20\x20for\x20(const\x20descriptor\x20of\x20descriptors)\x20{\x0a\x20\x20\x20\x20const\x20type\x20=\x20String(descriptor.type\x20||\x20\x22unknown\x22);\x0a\x20\x20\x20\x20byType[type]\x20=\x20(byType[type]\x20||\x200)\x20+\x201;\x0a\x20\x20}\x0a\x20\x20return\x20{\x20total:\x20descriptors.length,\x20byType\x20};\x0a}\x0a\x0afunction\x20inspectionBase(element,\x20descriptor)\x20{\x0a\x20\x20return\x20{\x0a\x20\x20\x20\x20id:\x20element.id,\x0a\x20\x20\x20\x20orderIndex:\x20descriptor.orderIndex,\x0a\x20\x20\x20\x20type:\x20String(element.type\x20||\x20\x22unknown\x22),\x0a\x20\x20\x20\x20...(descriptor.name\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20name:\x20descriptor.name\x20}),\x0a\x20\x20\x20\x20...(descriptor.description\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20description:\x20descriptor.description\x20}),\x0a\x20\x20\x20\x20...(descriptor.parentId\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20parentId:\x20descriptor.parentId\x20}),\x0a\x20\x20\x20\x20...(descriptor.laneId\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20laneId:\x20descriptor.laneId\x20}),\x0a\x20\x20\x20\x20visible:\x20descriptor.visible,\x0a\x20\x20\x20\x20selectable:\x20descriptor.selectable,\x0a\x20\x20\x20\x20locked:\x20descriptor.locked,\x0a\x20\x20\x20\x20transform:\x20element.transform\x20||\x20{},\x0a\x20\x20\x20\x20bounds:\x20descriptor.bounds,\x0a\x20\x20};\x0a}\x0a\x0afunction\x20richTextData(value)\x20{\x0a\x20\x20return\x20value\x20?\x20value.getData()\x20:\x20null;\x0a}\x0a\x0afunction\x20inspectElement(element,\x20descriptor)\x20{\x0a\x20\x20const\x20base\x20=\x20inspectionBase(element,\x20descriptor);\x0a\x20\x20if\x20(element.type\x20===\x20\x22shape\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x20...base,\x20type:\x20\x22shape\x22,\x20shapeData:\x20element.shapeData\x20||\x20{}\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22connector\x22)\x20{\x0a\x20\x20\x20\x20const\x20connection\x20=\x20board.getConnectorConnection(element.id);\x0a\x20\x20\x20\x20if\x20(!connection)\x20return\x20null;\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22connector\x22,\x0a\x20\x20\x20\x20\x20\x20connection,\x0a\x20\x20\x20\x20\x20\x20style:\x20board.getConnectorStyle(element.id),\x0a\x20\x20\x20\x20\x20\x20labels:\x20board.getConnectorLabels(element.id),\x0a\x20\x20\x20\x20\x20\x20labelText:\x20richTextData(board.getConnectorLabelText(element.id)),\x0a\x20\x20\x20\x20\x20\x20labelStyle:\x20board.getConnectorLabelStyle(element.id),\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22text\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22text\x22,\x0a\x20\x20\x20\x20\x20\x20textContent:\x20richTextData(board.getTextContent(element.id)),\x0a\x20\x20\x20\x20\x20\x20textStyle:\x20element.textStyle\x20||\x20null,\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22image\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22image\x22,\x0a\x20\x20\x20\x20\x20\x20source:\x20element.source,\x0a\x20\x20\x20\x20\x20\x20...(element.imageSourceType\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20imageSourceType:\x20element.imageSourceType\x20}),\x0a\x20\x20\x20\x20\x20\x20...(element.crop\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20crop:\x20element.crop\x20}),\x0a\x20\x20\x20\x20\x20\x20...(element.prstGeom\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20prstGeom:\x20element.prstGeom\x20}),\x0a\x20\x20\x20\x20\x20\x20...(element.adjustValues\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20adjustValues:\x20element.adjustValues\x20}),\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22chart\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22chart\x22,\x0a\x20\x20\x20\x20\x20\x20chartId:\x20element.chartId,\x0a\x20\x20\x20\x20\x20\x20...(element.placeholder\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20placeholder:\x20element.placeholder\x20}),\x0a\x20\x20\x20\x20\x20\x20...(element.stroke\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20stroke:\x20element.stroke\x20}),\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22container\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x20...base,\x20type:\x20\x22container\x22,\x20containerData:\x20element.containerData\x20||\x20{}\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22diagram\x22)\x20{\x0a\x20\x20\x20\x20const\x20{\x20id,\x20type,\x20transform,\x20parentId,\x20laneId,\x20name,\x20description,\x20visible,\x20selectable,\x20locked,\x20...data\x20}\x20=\x20element;\x0a\x20\x20\x20\x20return\x20{\x20...base,\x20type:\x20\x22diagram\x22,\x20data\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22table\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22table\x22,\x0a\x20\x20\x20\x20\x20\x20tableId:\x20element.tableId,\x0a\x20\x20\x20\x20\x20\x20...(element.placeholder\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20placeholder:\x20element.placeholder\x20}),\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22group\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x20...base,\x20type:\x20\x22group\x22,\x20children:\x20Array.isArray(element.children)\x20?\x20element.children\x20:\x20[]\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22media\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22media\x22,\x0a\x20\x20\x20\x20\x20\x20mediaType:\x20String(element.mediaType\x20||\x20\x22unknown\x22),\x0a\x20\x20\x20\x20\x20\x20source:\x20element.source,\x0a\x20\x20\x20\x20\x20\x20...(element.poster\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20poster:\x20element.poster\x20}),\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22placeholder\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22placeholder\x22,\x0a\x20\x20\x20\x20\x20\x20placeholder:\x20element.placeholder\x20||\x20{},\x0a\x20\x20\x20\x20\x20\x20...(element.text\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20text:\x20element.text\x20}),\x0a\x20\x20\x20\x20\x20\x20...(element.style\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20style:\x20element.style\x20}),\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20const\x20{\x20id,\x20type,\x20transform,\x20parentId,\x20laneId,\x20name,\x20description,\x20visible,\x20selectable,\x20locked,\x20...data\x20}\x20=\x20element;\x0a\x20\x20return\x20{\x20...base,\x20type:\x20\x22unknown\x22,\x20originalType:\x20String(type\x20||\x20\x22unknown\x22),\x20data\x20};\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22board\x22)\x20{\x0a\x20\x20const\x20background\x20=\x20board.getBackground();\x0a\x20\x20return\x20success({\x0a\x20\x20\x20\x20kind:\x20\x22board\x22,\x0a\x20\x20\x20\x20unitId:\x20input.unitId,\x0a\x20\x20\x20\x20name:\x20board.getName(),\x0a\x20\x20\x20\x20...(background\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20background\x20}),\x0a\x20\x20\x20\x20themeData:\x20board.getThemeData(),\x0a\x20\x20\x20\x20elementCounts:\x20elementCounts(),\x0a\x20\x20\x20\x20elements:\x20descriptors,\x0a\x20\x20});\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22board-element\x22)\x20{\x0a\x20\x20const\x20selected\x20=\x20[];\x0a\x20\x20for\x20(const\x20selector\x20of\x20input.query.elements\x20||\x20[])\x20{\x0a\x20\x20\x20\x20if\x20(!selector\x20||\x20typeof\x20selector\x20!==\x20\x22object\x22\x20||\x20Object.keys(selector).length\x20!==\x201\x20||\x20typeof\x20selector.id\x20!==\x20\x22string\x22\x20||\x20selector.id.length\x20===\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20return\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Board\x20element\x20selector\x20must\x20contain\x20exactly\x20one\x20non-empty\x20id\x22,\x20selector);\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20const\x20descriptor\x20=\x20descriptorsById.get(selector.id);\x0a\x20\x20\x20\x20const\x20element\x20=\x20board.getElement(selector.id);\x0a\x20\x20\x20\x20if\x20(!descriptor\x20||\x20!element)\x20{\x0a\x20\x20\x20\x20\x20\x20return\x20fail(\x22INSPECTION_SELECTOR_NOT_FOUND\x22,\x20\x22Board\x20element\x20selector\x20did\x20not\x20match\x20an\x20element\x22,\x20selector);\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20const\x20inspection\x20=\x20inspectElement(element,\x20descriptor);\x0a\x20\x20\x20\x20if\x20(!inspection)\x20{\x0a\x20\x20\x20\x20\x20\x20return\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Board\x20element\x20\x22\x20+\x20selector.id\x20+\x20\x22\x20could\x20not\x20be\x20inspected\x22);\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20selected.push(inspection);\x0a\x20\x20}\x0a\x20\x20return\x20success({\x20kind:\x20\x22board-element\x22,\x20unitId:\x20input.unitId,\x20elements:\x20selected\x20});\x0a}\x0a\x0areturn\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Unsupported\x20Board\x20inspection\x20target\x22);\x0a','group',';\x0aconst\x20fail\x20=\x20(code,\x20message,\x20details)\x20=>\x20({\x20ok:\x20false,\x20error:\x20{\x20code,\x20message,\x20...(details\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20details\x20})\x20}\x20});\x0aconst\x20success\x20=\x20(value)\x20=>\x20({\x20ok:\x20true,\x20value\x20});\x0aconst\x20workbook\x20=\x20univerAPI.getWorkbook(input.unitId);\x0aif\x20(!workbook)\x20return\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Workbook\x20\x22\x20+\x20input.unitId\x20+\x20\x22\x20is\x20not\x20available\x20in\x20the\x20runtime\x22);\x0aconst\x20sheets\x20=\x20workbook.getSheets();\x0aconst\x20snapshot\x20=\x20workbook.save();\x0a\x0afunction\x20columnName(column)\x20{\x0a\x20\x20let\x20value\x20=\x20column\x20+\x201;\x0a\x20\x20let\x20name\x20=\x20\x22\x22;\x0a\x20\x20while\x20(value\x20>\x200)\x20{\x0a\x20\x20\x20\x20const\x20remainder\x20=\x20(value\x20-\x201)\x20%\x2026;\x0a\x20\x20\x20\x20name\x20=\x20String.fromCharCode(65\x20+\x20remainder)\x20+\x20name;\x0a\x20\x20\x20\x20value\x20=\x20Math.floor((value\x20-\x201)\x20/\x2026);\x0a\x20\x20}\x0a\x20\x20return\x20name;\x0a}\x0a\x0afunction\x20rangeNotation(range)\x20{\x0a\x20\x20const\x20start\x20=\x20columnName(range.startColumn)\x20+\x20String(range.startRow\x20+\x201);\x0a\x20\x20const\x20end\x20=\x20columnName(range.endColumn)\x20+\x20String(range.endRow\x20+\x201);\x0a\x20\x20return\x20start\x20===\x20end\x20?\x20start\x20:\x20start\x20+\x20\x22:\x22\x20+\x20end;\x0a}\x0a\x0afunction\x20parseA1Range(notation)\x20{\x0a\x20\x20const\x20match\x20=\x20/^\x5c$?([A-Za-z]+)\x5c$?(\x5cd+)(?::\x5c$?([A-Za-z]+)\x5c$?(\x5cd+))?$/.exec(notation);\x0a\x20\x20if\x20(!match)\x20return\x20null;\x0a\x20\x20const\x20columnIndex\x20=\x20(name)\x20=>\x20{\x0a\x20\x20\x20\x20let\x20column\x20=\x200;\x0a\x20\x20\x20\x20for\x20(const\x20character\x20of\x20name.toUpperCase())\x20column\x20=\x20column\x20*\x2026\x20+\x20character.charCodeAt(0)\x20-\x2064;\x0a\x20\x20\x20\x20return\x20column\x20-\x201;\x0a\x20\x20};\x0a\x20\x20const\x20startColumn\x20=\x20columnIndex(match[1]);\x0a\x20\x20const\x20startRow\x20=\x20Number(match[2])\x20-\x201;\x0a\x20\x20const\x20endColumn\x20=\x20columnIndex(match[3]\x20||\x20match[1]);\x0a\x20\x20const\x20endRow\x20=\x20Number(match[4]\x20||\x20match[2])\x20-\x201;\x0a\x20\x20if\x20(!Number.isSafeInteger(startRow)\x20||\x20!Number.isSafeInteger(endRow)\x20||\x20startRow\x20<\x200\x20||\x20endRow\x20<\x20startRow\x20||\x20endColumn\x20<\x20startColumn)\x20return\x20null;\x0a\x20\x20return\x20{\x20startRow,\x20endRow,\x20startColumn,\x20endColumn\x20};\x0a}\x0a\x0afunction\x20normalizeCellData(cellData)\x20{\x0a\x20\x20const\x20cells\x20=\x20[];\x0a\x20\x20for\x20(const\x20[rowKey,\x20columns]\x20of\x20Object.entries(cellData\x20||\x20{}))\x20{\x0a\x20\x20\x20\x20const\x20row\x20=\x20Number(rowKey);\x0a\x20\x20\x20\x20if\x20(!Number.isInteger(row)\x20||\x20!columns\x20||\x20typeof\x20columns\x20!==\x20\x22object\x22)\x20continue;\x0a\x20\x20\x20\x20for\x20(const\x20[columnKey,\x20cell]\x20of\x20Object.entries(columns))\x20{\x0a\x20\x20\x20\x20\x20\x20const\x20column\x20=\x20Number(columnKey);\x0a\x20\x20\x20\x20\x20\x20if\x20(Number.isInteger(column)\x20&&\x20cell\x20&&\x20typeof\x20cell\x20===\x20\x22object\x22)\x20cells.push({\x20row,\x20column,\x20cell\x20});\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x20\x20cells.sort((left,\x20right)\x20=>\x20left.row\x20-\x20right.row\x20||\x20left.column\x20-\x20right.column);\x0a\x20\x20return\x20cells;\x0a}\x0a\x0a//\x20TODO:\x20profile\x20large\x20sparse\x20worksheets\x20and\x20move\x20this\x20scan\x20behind\x20an\x20incremental\x20index\x20if\x20needed.\x0afunction\x20compactUsedRanges(cells,\x20predicate)\x20{\x0a\x20\x20const\x20horizontal\x20=\x20[];\x0a\x20\x20let\x20active\x20=\x20null;\x0a\x20\x20for\x20(const\x20entry\x20of\x20cells)\x20{\x0a\x20\x20\x20\x20if\x20(!predicate(entry.cell))\x20continue;\x0a\x20\x20\x20\x20if\x20(active\x20&&\x20active.startRow\x20===\x20entry.row\x20&&\x20active.endColumn\x20+\x201\x20===\x20entry.column)\x20{\x0a\x20\x20\x20\x20\x20\x20active.endColumn\x20=\x20entry.column;\x0a\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20active\x20=\x20{\x20startRow:\x20entry.row,\x20endRow:\x20entry.row,\x20startColumn:\x20entry.column,\x20endColumn:\x20entry.column\x20};\x0a\x20\x20\x20\x20\x20\x20horizontal.push(active);\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x20\x20const\x20rectangles\x20=\x20[];\x0a\x20\x20const\x20previousRow\x20=\x20new\x20Map();\x0a\x20\x20let\x20currentRow\x20=\x20-1;\x0a\x20\x20let\x20current\x20=\x20new\x20Map();\x0a\x20\x20for\x20(const\x20span\x20of\x20horizontal)\x20{\x0a\x20\x20\x20\x20if\x20(span.startRow\x20!==\x20currentRow)\x20{\x0a\x20\x20\x20\x20\x20\x20previousRow.clear();\x0a\x20\x20\x20\x20\x20\x20for\x20(const\x20[key,\x20value]\x20of\x20current)\x20previousRow.set(key,\x20value);\x0a\x20\x20\x20\x20\x20\x20current\x20=\x20new\x20Map();\x0a\x20\x20\x20\x20\x20\x20currentRow\x20=\x20span.startRow;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20const\x20key\x20=\x20span.startColumn\x20+\x20\x22:\x22\x20+\x20span.endColumn;\x0a\x20\x20\x20\x20const\x20prior\x20=\x20previousRow.get(key);\x0a\x20\x20\x20\x20if\x20(prior\x20&&\x20prior.endRow\x20+\x201\x20===\x20span.startRow)\x20{\x0a\x20\x20\x20\x20\x20\x20prior.endRow\x20=\x20span.startRow;\x0a\x20\x20\x20\x20\x20\x20current.set(key,\x20prior);\x0a\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20const\x20rectangle\x20=\x20{\x20...span\x20};\x0a\x20\x20\x20\x20\x20\x20rectangles.push(rectangle);\x0a\x20\x20\x20\x20\x20\x20current.set(key,\x20rectangle);\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x20\x20return\x20rectangles.map(rangeNotation);\x0a}\x0a\x0afunction\x20hasValue(cell)\x20{\x0a\x20\x20return\x20Object.entries(cell).some(([key,\x20value])\x20=>\x20key\x20!==\x20\x22s\x22\x20&&\x20key\x20!==\x20\x22t\x22\x20&&\x20value\x20!==\x20null\x20&&\x20value\x20!==\x20undefined\x20&&\x20value\x20!==\x20\x22\x22);\x0a}\x0a\x0afunction\x20hasFormula(cell)\x20{\x0a\x20\x20return\x20(typeof\x20cell.f\x20===\x20\x22string\x22\x20&&\x20cell.f.length\x20>\x200)\x20||\x20cell.si\x20!==\x20null\x20&&\x20cell.si\x20!==\x20undefined\x20&&\x20cell.si\x20!==\x20\x22\x22;\x0a}\x0a\x0afunction\x20hasStyle(cell)\x20{\x0a\x20\x20return\x20cell.s\x20!==\x20null\x20&&\x20cell.s\x20!==\x20undefined;\x0a}\x0a\x0afunction\x20uniqueRanges(ranges)\x20{\x0a\x20\x20return\x20[...new\x20Set(ranges.map(rangeNotation))].sort();\x0a}\x0a\x0afunction\x20worksheetIdentity(sheet,\x20index)\x20{\x0a\x20\x20return\x20{\x20id:\x20sheet.getSheetId(),\x20index,\x20name:\x20sheet.getSheetName()\x20};\x0a}\x0a\x0afunction\x20worksheetOverview(sheet,\x20index)\x20{\x0a\x20\x20const\x20identity\x20=\x20worksheetIdentity(sheet,\x20index);\x0a\x20\x20const\x20sheetData\x20=\x20snapshot.sheets\x20&&\x20snapshot.sheets[identity.id]\x20||\x20{};\x0a\x20\x20const\x20cells\x20=\x20normalizeCellData(sheetData.cellData);\x0a\x20\x20const\x20conditionalRules\x20=\x20typeof\x20sheet.getConditionalFormattingRules\x20===\x20\x22function\x22\x20?\x20sheet.getConditionalFormattingRules()\x20:\x20[];\x0a\x20\x20const\x20validationRules\x20=\x20typeof\x20sheet.getDataValidations\x20===\x20\x22function\x22\x20?\x20sheet.getDataValidations()\x20:\x20[];\x0a\x20\x20const\x20tables\x20=\x20typeof\x20sheet.getSubTableInfos\x20===\x20\x22function\x22\x20?\x20sheet.getSubTableInfos()\x20:\x20[];\x0a\x20\x20const\x20images\x20=\x20typeof\x20sheet.getImages\x20===\x20\x22function\x22\x20?\x20sheet.getImages().length\x20:\x200;\x0a\x20\x20const\x20shapes\x20=\x20typeof\x20sheet.getShapes\x20===\x20\x22function\x22\x20?\x20sheet.getShapes().length\x20:\x200;\x0a\x20\x20const\x20charts\x20=\x20sheet.charts\x20&&\x20typeof\x20sheet.charts.list\x20===\x20\x22function\x22\x20?\x20sheet.charts.list().length\x20:\x200;\x0a\x20\x20return\x20{\x0a\x20\x20\x20\x20...identity,\x0a\x20\x20\x20\x20rowCount:\x20sheet.getMaxRows(),\x0a\x20\x20\x20\x20columnCount:\x20sheet.getMaxColumns(),\x0a\x20\x20\x20\x20valueUsedRanges:\x20compactUsedRanges(cells,\x20hasValue),\x0a\x20\x20\x20\x20formulaUsedRanges:\x20compactUsedRanges(cells,\x20hasFormula),\x0a\x20\x20\x20\x20styleUsedRanges:\x20compactUsedRanges(cells,\x20hasStyle),\x0a\x20\x20\x20\x20mergedRanges:\x20sheet.getMergedRanges().map((range)\x20=>\x20range.getA1Notation()),\x0a\x20\x20\x20\x20tables:\x20tables.map((table)\x20=>\x20({\x20id:\x20table.id,\x20name:\x20table.name,\x20range:\x20rangeNotation(table.range)\x20})),\x0a\x20\x20\x20\x20conditionalFormatting:\x20{\x0a\x20\x20\x20\x20\x20\x20count:\x20conditionalRules.length,\x0a\x20\x20\x20\x20\x20\x20ranges:\x20uniqueRanges(conditionalRules.flatMap((rule)\x20=>\x20Array.isArray(rule.ranges)\x20?\x20rule.ranges\x20:\x20[])),\x0a\x20\x20\x20\x20},\x0a\x20\x20\x20\x20dataValidation:\x20{\x0a\x20\x20\x20\x20\x20\x20count:\x20validationRules.length,\x0a\x20\x20\x20\x20\x20\x20ranges:\x20uniqueRanges(validationRules.flatMap((validation)\x20=>\x20Array.isArray(validation.rule\x20&&\x20validation.rule.ranges)\x20?\x20validation.rule.ranges\x20:\x20[])),\x0a\x20\x20\x20\x20},\x0a\x20\x20\x20\x20drawings:\x20{\x20total:\x20charts\x20+\x20images\x20+\x20shapes,\x20charts,\x20images,\x20shapes\x20},\x0a\x20\x20};\x0a}\x0a\x0afunction\x20resolveWorksheet(selector)\x20{\x0a\x20\x20if\x20(!selector\x20||\x20typeof\x20selector\x20!==\x20\x22object\x22)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Worksheet\x20selector\x20must\x20be\x20an\x20object\x22)\x20};\x0a\x20\x20const\x20keys\x20=\x20[\x22id\x22,\x20\x22index\x22,\x20\x22name\x22].filter((key)\x20=>\x20Object.hasOwn(selector,\x20key));\x0a\x20\x20if\x20(keys.length\x20!==\x201)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Worksheet\x20selector\x20must\x20contain\x20exactly\x20one\x20of\x20id,\x20index,\x20or\x20name\x22,\x20selector)\x20};\x0a\x20\x20let\x20matches\x20=\x20[];\x0a\x20\x20if\x20(keys[0]\x20===\x20\x22id\x22\x20&&\x20typeof\x20selector.id\x20===\x20\x22string\x22\x20&&\x20selector.id.length\x20>\x200)\x20matches\x20=\x20sheets.filter((sheet)\x20=>\x20sheet.getSheetId()\x20===\x20selector.id);\x0a\x20\x20else\x20if\x20(keys[0]\x20===\x20\x22name\x22\x20&&\x20typeof\x20selector.name\x20===\x20\x22string\x22\x20&&\x20selector.name.length\x20>\x200)\x20matches\x20=\x20sheets.filter((sheet)\x20=>\x20sheet.getSheetName()\x20===\x20selector.name);\x0a\x20\x20else\x20if\x20(keys[0]\x20===\x20\x22index\x22\x20&&\x20Number.isInteger(selector.index)\x20&&\x20selector.index\x20>=\x200)\x20matches\x20=\x20sheets[selector.index]\x20?\x20[sheets[selector.index]]\x20:\x20[];\x0a\x20\x20else\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Worksheet\x20selector\x20value\x20is\x20invalid\x22,\x20selector)\x20};\x0a\x20\x20if\x20(matches.length\x20===\x200)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_NOT_FOUND\x22,\x20\x22Worksheet\x20selector\x20did\x20not\x20match\x20a\x20worksheet\x22,\x20selector)\x20};\x0a\x20\x20if\x20(matches.length\x20>\x201)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_AMBIGUOUS\x22,\x20\x22Worksheet\x20selector\x20matched\x20more\x20than\x20one\x20worksheet\x22,\x20selector)\x20};\x0a\x20\x20const\x20sheet\x20=\x20matches[0];\x0a\x20\x20return\x20{\x20sheet,\x20index:\x20sheets.indexOf(sheet)\x20};\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22workbook\x22)\x20{\x0a\x20\x20return\x20success({\x20kind:\x20\x22workbook\x22,\x20unitId:\x20input.unitId,\x20name:\x20workbook.getName(),\x20worksheets:\x20sheets.map(worksheetOverview)\x20});\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22worksheet\x22)\x20{\x0a\x20\x20const\x20resolved\x20=\x20[];\x0a\x20\x20for\x20(const\x20selector\x20of\x20input.query.worksheets\x20||\x20[])\x20{\x0a\x20\x20\x20\x20const\x20item\x20=\x20resolveWorksheet(selector);\x0a\x20\x20\x20\x20if\x20(item.error)\x20return\x20item.error;\x0a\x20\x20\x20\x20resolved.push(worksheetOverview(item.sheet,\x20item.index));\x0a\x20\x20}\x0a\x20\x20return\x20success({\x20kind:\x20\x22worksheet\x22,\x20unitId:\x20input.unitId,\x20worksheets:\x20resolved\x20});\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22worksheet-range\x22)\x20{\x0a\x20\x20const\x20resolved\x20=\x20[];\x0a\x20\x20for\x20(const\x20request\x20of\x20input.query.ranges\x20||\x20[])\x20{\x0a\x20\x20\x20\x20const\x20item\x20=\x20resolveWorksheet(request.worksheet);\x0a\x20\x20\x20\x20if\x20(item.error)\x20return\x20item.error;\x0a\x20\x20\x20\x20if\x20(typeof\x20request.range\x20!==\x20\x22string\x22\x20||\x20request.range.length\x20===\x200)\x20return\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Worksheet\x20range\x20must\x20be\x20a\x20non-empty\x20A1\x20notation\x22,\x20request);\x0a\x20\x20\x20\x20const\x20parsed\x20=\x20parseA1Range(request.range);\x0a\x20\x20\x20\x20if\x20(!parsed)\x20{\x0a\x20\x20\x20\x20\x20\x20return\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Invalid\x20worksheet\x20A1\x20range:\x20\x22\x20+\x20request.range,\x20request);\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20const\x20maxRow\x20=\x20item.sheet.getMaxRows()\x20-\x201;\x0a\x20\x20\x20\x20const\x20maxColumn\x20=\x20item.sheet.getMaxColumns()\x20-\x201;\x0a\x20\x20\x20\x20if\x20(parsed.endRow\x20<\x200\x20||\x20parsed.endColumn\x20<\x200\x20||\x20parsed.startRow\x20>\x20maxRow\x20||\x20parsed.startColumn\x20>\x20maxColumn)\x20{\x0a\x20\x20\x20\x20\x20\x20return\x20fail(\x22INSPECTION_RANGE_OUT_OF_BOUNDS\x22,\x20\x22Worksheet\x20range\x20is\x20outside\x20the\x20worksheet\x20bounds:\x20\x22\x20+\x20request.range,\x20request);\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20const\x20clippedRange\x20=\x20{\x0a\x20\x20\x20\x20\x20\x20startRow:\x20Math.max(0,\x20parsed.startRow),\x0a\x20\x20\x20\x20\x20\x20endRow:\x20Math.min(maxRow,\x20parsed.endRow),\x0a\x20\x20\x20\x20\x20\x20startColumn:\x20Math.max(0,\x20parsed.startColumn),\x0a\x20\x20\x20\x20\x20\x20endColumn:\x20Math.min(maxColumn,\x20parsed.endColumn),\x0a\x20\x20\x20\x20};\x0a\x20\x20\x20\x20const\x20facadeRange\x20=\x20item.sheet.getRange(clippedRange.startRow,\x20clippedRange.startColumn,\x20clippedRange.endRow\x20-\x20clippedRange.startRow\x20+\x201,\x20clippedRange.endColumn\x20-\x20clippedRange.startColumn\x20+\x201);\x0a\x20\x20\x20\x20const\x20rawCells\x20=\x20facadeRange.getCellDatas();\x0a\x20\x20\x20\x20const\x20displayValues\x20=\x20facadeRange.getDisplayValues();\x0a\x20\x20\x20\x20const\x20cellData\x20=\x20rawCells.map((row)\x20=>\x20row.map((cell)\x20=>\x20cell\x20===\x20undefined\x20?\x20null\x20:\x20cell));\x0a\x20\x20\x20\x20const\x20clipped\x20=\x20clippedRange.startRow\x20!==\x20parsed.startRow\x20||\x20clippedRange.endRow\x20!==\x20parsed.endRow\x20||\x20clippedRange.startColumn\x20!==\x20parsed.startColumn\x20||\x20clippedRange.endColumn\x20!==\x20parsed.endColumn;\x0a\x20\x20\x20\x20resolved.push({\x0a\x20\x20\x20\x20\x20\x20worksheet:\x20worksheetIdentity(item.sheet,\x20item.index),\x0a\x20\x20\x20\x20\x20\x20requestedRange:\x20request.range,\x0a\x20\x20\x20\x20\x20\x20resolvedRange:\x20rangeNotation(clippedRange),\x0a\x20\x20\x20\x20\x20\x20clipped,\x0a\x20\x20\x20\x20\x20\x20cellData,\x0a\x20\x20\x20\x20\x20\x20displayValues,\x0a\x20\x20\x20\x20});\x0a\x20\x20}\x0a\x20\x20return\x20success({\x20kind:\x20\x22worksheet-range\x22,\x20unitId:\x20input.unitId,\x20ranges:\x20resolved\x20});\x0a}\x0a\x0areturn\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Unsupported\x20sheet\x20inspection\x20target\x22);\x0a','worksheet','primaryFieldId','base','8324550mdFRKY','routingMode','locked','40380iteeOZ','ContentInspectionError','12CRsIem','INSPECTION_SELECTOR_NOT_FOUND','63302EqUxbK','message','error','isSafeInteger','isArray','elementCounts','labelStyle','title','elements','waypoints','4eTkBMK','paragraph','document','\x0aconst\x20input\x20=\x20','\x20result','INSPECTION_RANGE_OUT_OF_BOUNDS','start','end','segmentIndex','visible','isReadonly','text','sheet','descriptor','8903466qWTPLh','doc',';\x0aconst\x20fail\x20=\x20(code,\x20message,\x20details)\x20=>\x20({\x20ok:\x20false,\x20error:\x20{\x20code,\x20message,\x20...(details\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20details\x20})\x20}\x20});\x0aconst\x20success\x20=\x20(value)\x20=>\x20({\x20ok:\x20true,\x20value\x20});\x0aconst\x20base\x20=\x20univerAPI.getBase(input.unitId);\x0aif\x20(!base)\x20return\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Base\x20\x22\x20+\x20input.unitId\x20+\x20\x22\x20is\x20not\x20available\x20in\x20the\x20runtime\x22);\x0aconst\x20schema\x20=\x20base.getSchema();\x0areturn\x20success({\x0a\x20\x20kind:\x20\x22base\x22,\x0a\x20\x20unitId:\x20input.unitId,\x0a\x20\x20name:\x20schema.name,\x0a\x20\x20tables:\x20schema.tables.map((table,\x20index)\x20=>\x20({\x0a\x20\x20\x20\x20id:\x20table.id,\x0a\x20\x20\x20\x20index,\x0a\x20\x20\x20\x20name:\x20table.name,\x0a\x20\x20\x20\x20formulaName:\x20table.formulaName,\x0a\x20\x20\x20\x20primaryFieldId:\x20table.primaryFieldId,\x0a\x20\x20\x20\x20recordCount:\x20table.recordCount,\x0a\x20\x20\x20\x20fields:\x20table.fields.map((field,\x20fieldIndex)\x20=>\x20({\x0a\x20\x20\x20\x20\x20\x20id:\x20field.id,\x0a\x20\x20\x20\x20\x20\x20index:\x20fieldIndex,\x0a\x20\x20\x20\x20\x20\x20name:\x20field.name,\x0a\x20\x20\x20\x20\x20\x20type:\x20field.type,\x0a\x20\x20\x20\x20\x20\x20config:\x20field.config\x20??\x20{},\x0a\x20\x20\x20\x20\x20\x20isReadonly:\x20field.readonly\x20===\x20true,\x0a\x20\x20\x20\x20})),\x0a\x20\x20\x20\x20views:\x20table.views.map((view,\x20viewIndex)\x20=>\x20({\x0a\x20\x20\x20\x20\x20\x20id:\x20view.id,\x0a\x20\x20\x20\x20\x20\x20index:\x20viewIndex,\x0a\x20\x20\x20\x20\x20\x20name:\x20view.name,\x0a\x20\x20\x20\x20\x20\x20type:\x20view.type,\x0a\x20\x20\x20\x20})),\x0a\x20\x20})),\x0a});\x0a','views','details','orderIndex','labels','Inspection\x20runtime\x20returned\x20an\x20invalid\x20error\x20envelope','themeData','byType','laneId','data',';\x0aconst\x20fail\x20=\x20(code,\x20message,\x20details)\x20=>\x20({\x20ok:\x20false,\x20error:\x20{\x20code,\x20message,\x20...(details\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20details\x20})\x20}\x20});\x0aconst\x20success\x20=\x20(value)\x20=>\x20({\x20ok:\x20true,\x20value\x20});\x0aconst\x20presentation\x20=\x20univerAPI.getPresentation(input.unitId);\x0aif\x20(!presentation)\x20return\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Presentation\x20\x22\x20+\x20input.unitId\x20+\x20\x22\x20is\x20not\x20available\x20in\x20the\x20runtime\x22);\x0aconst\x20snapshot\x20=\x20presentation.save();\x0aconst\x20slideIds\x20=\x20Array.isArray(snapshot.slideOrder)\x20?\x20snapshot.slideOrder\x20:\x20Object.keys(snapshot.slides\x20||\x20{});\x0aconst\x20slides\x20=\x20slideIds.map((id)\x20=>\x20snapshot.slides\x20&&\x20snapshot.slides[id]).filter(Boolean);\x0a\x0afunction\x20documentText(documentData)\x20{\x0a\x20\x20const\x20stream\x20=\x20documentData\x20&&\x20documentData.body\x20&&\x20documentData.body.dataStream;\x0a\x20\x20return\x20typeof\x20stream\x20===\x20\x22string\x22\x20?\x20stream.replace(/\x5cr/g,\x20\x22\x5cn\x22).replace(/[\x5cu0000-\x5cu0009\x5cu000b-\x5cu001f]+/g,\x20\x22\x22).replace(/\x5cn+$/g,\x20\x22\x22)\x20:\x20\x22\x22;\x0a}\x0a\x0afunction\x20elementText(element)\x20{\x0a\x20\x20if\x20(typeof\x20element.text\x20===\x20\x22string\x22)\x20return\x20element.text;\x0a\x20\x20if\x20(element.textData)\x20return\x20documentText(element.textData);\x0a\x20\x20const\x20shapeData\x20=\x20element.shapeData\x20||\x20element.connectorData;\x0a\x20\x20const\x20shapeText\x20=\x20shapeData\x20&&\x20shapeData.shapeText;\x0a\x20\x20if\x20(shapeText\x20&&\x20typeof\x20shapeText.text\x20===\x20\x22string\x22)\x20return\x20shapeText.text;\x0a\x20\x20if\x20(shapeText\x20&&\x20shapeText.dataModel\x20&&\x20shapeText.dataModel.doc)\x20return\x20documentText(shapeText.dataModel.doc);\x0a\x20\x20return\x20\x22\x22;\x0a}\x0a\x0afunction\x20elementCountType(type)\x20{\x0a\x20\x20if\x20(type\x20===\x20\x22chart\x22)\x20return\x20\x22charts\x22;\x0a\x20\x20if\x20(type\x20===\x20\x22image\x22)\x20return\x20\x22images\x22;\x0a\x20\x20if\x20(type\x20===\x20\x22table\x22)\x20return\x20\x22tables\x22;\x0a\x20\x20if\x20(type\x20===\x20\x22group\x22)\x20return\x20\x22groups\x22;\x0a\x20\x20if\x20(type\x20===\x20\x22text\x22\x20||\x20type\x20===\x20\x22placeholder\x22)\x20return\x20\x22text\x22;\x0a\x20\x20return\x20\x22shapes\x22;\x0a}\x0a\x0afunction\x20collectElements(slide)\x20{\x0a\x20\x20const\x20elements\x20=\x20slide.elements\x20||\x20{};\x0a\x20\x20const\x20visited\x20=\x20new\x20Set();\x0a\x20\x20const\x20output\x20=\x20[];\x0a\x20\x20function\x20visit(id)\x20{\x0a\x20\x20\x20\x20if\x20(visited.has(id))\x20return;\x0a\x20\x20\x20\x20visited.add(id);\x0a\x20\x20\x20\x20const\x20element\x20=\x20elements[id];\x0a\x20\x20\x20\x20if\x20(!element)\x20return;\x0a\x20\x20\x20\x20output.push(element);\x0a\x20\x20\x20\x20if\x20(element.type\x20===\x20\x22group\x22\x20&&\x20Array.isArray(element.children))\x20element.children.forEach(visit);\x0a\x20\x20}\x0a\x20\x20(Array.isArray(slide.elementOrder)\x20?\x20slide.elementOrder\x20:\x20Object.keys(elements)).forEach(visit);\x0a\x20\x20Object.keys(elements).forEach(visit);\x0a\x20\x20return\x20output;\x0a}\x0a\x0afunction\x20elementCounts(slide)\x20{\x0a\x20\x20const\x20counts\x20=\x20{\x20total:\x200,\x20text:\x200,\x20shapes:\x200,\x20images:\x200,\x20charts:\x200,\x20tables:\x200,\x20groups:\x200\x20};\x0a\x20\x20for\x20(const\x20element\x20of\x20collectElements(slide))\x20{\x0a\x20\x20\x20\x20counts.total\x20+=\x201;\x0a\x20\x20\x20\x20counts[elementCountType(element.type)]\x20+=\x201;\x0a\x20\x20}\x0a\x20\x20return\x20counts;\x0a}\x0a\x0afunction\x20slideSummary(slide,\x20index)\x20{\x0a\x20\x20const\x20text\x20=\x20collectElements(slide).map(elementText).filter(Boolean).join(\x22\x20|\x20\x22).replace(/\x5cs+/g,\x20\x22\x20\x22).trim();\x0a\x20\x20const\x20preview\x20=\x20text.length\x20<=\x20160\x20?\x20text\x20:\x20text.slice(0,\x20157)\x20+\x20\x22...\x22;\x0a\x20\x20return\x20{\x0a\x20\x20\x20\x20id:\x20slide.id,\x0a\x20\x20\x20\x20index,\x0a\x20\x20\x20\x20name:\x20slide.name\x20||\x20\x22\x22,\x0a\x20\x20\x20\x20elementCounts:\x20elementCounts(slide),\x0a\x20\x20\x20\x20...(preview\x20===\x20\x22\x22\x20?\x20{}\x20:\x20{\x20textPreview:\x20preview\x20}),\x0a\x20\x20\x20\x20hasSpeakerNotes:\x20typeof\x20slide.speakerNotes\x20===\x20\x22string\x22\x20&&\x20slide.speakerNotes.length\x20>\x200,\x0a\x20\x20};\x0a}\x0a\x0afunction\x20parseTableResources()\x20{\x0a\x20\x20const\x20resource\x20=\x20(Array.isArray(snapshot.resources)\x20?\x20snapshot.resources\x20:\x20[]).find((item)\x20=>\x20item\x20&&\x20item.name\x20===\x20\x22SLIDE_TABLE_PLUGIN\x22);\x0a\x20\x20if\x20(!resource\x20||\x20typeof\x20resource.data\x20!==\x20\x22string\x22)\x20return\x20{};\x0a\x20\x20try\x20{\x0a\x20\x20\x20\x20const\x20parsed\x20=\x20JSON.parse(resource.data);\x0a\x20\x20\x20\x20return\x20parsed\x20&&\x20typeof\x20parsed.tables\x20===\x20\x22object\x22\x20?\x20parsed.tables\x20:\x20{};\x0a\x20\x20}\x20catch\x20{\x0a\x20\x20\x20\x20return\x20{};\x0a\x20\x20}\x0a}\x0a\x0aconst\x20tableResources\x20=\x20parseTableResources();\x0a\x0afunction\x20tableText(tableId)\x20{\x0a\x20\x20const\x20table\x20=\x20tableResources[tableId];\x0a\x20\x20if\x20(!table\x20||\x20!Array.isArray(table.rows))\x20return\x20undefined;\x0a\x20\x20return\x20table.rows.map((row)\x20=>\x20(Array.isArray(row.cells)\x20?\x20row.cells\x20:\x20[]).map((cell)\x20=>\x20documentText(cell\x20&&\x20cell.textData)));\x0a}\x0a\x0afunction\x20finite(value)\x20{\x0a\x20\x20return\x20typeof\x20value\x20===\x20\x22number\x22\x20&&\x20Number.isFinite(value)\x20?\x20value\x20:\x20undefined;\x0a}\x0a\x0afunction\x20transformOf(element)\x20{\x0a\x20\x20const\x20transform\x20=\x20element.transform\x20||\x20{};\x0a\x20\x20const\x20result\x20=\x20{};\x0a\x20\x20const\x20left\x20=\x20finite(transform.left\x20??\x20transform.x);\x0a\x20\x20const\x20top\x20=\x20finite(transform.top\x20??\x20transform.y);\x0a\x20\x20const\x20width\x20=\x20finite(transform.width);\x0a\x20\x20const\x20height\x20=\x20finite(transform.height);\x0a\x20\x20const\x20angle\x20=\x20finite(transform.angle\x20??\x20transform.rotation);\x0a\x20\x20if\x20(left\x20!==\x20undefined)\x20result.left\x20=\x20left;\x0a\x20\x20if\x20(top\x20!==\x20undefined)\x20result.top\x20=\x20top;\x0a\x20\x20if\x20(width\x20!==\x20undefined)\x20result.width\x20=\x20width;\x0a\x20\x20if\x20(height\x20!==\x20undefined)\x20result.height\x20=\x20height;\x0a\x20\x20if\x20(angle\x20!==\x20undefined)\x20result.angle\x20=\x20angle;\x0a\x20\x20return\x20Object.keys(result).length\x20===\x200\x20?\x20undefined\x20:\x20result;\x0a}\x0a\x0afunction\x20inspectElement(element,\x20elements,\x20ancestors)\x20{\x0a\x20\x20const\x20shapeData\x20=\x20element.shapeData\x20||\x20element.connectorData\x20||\x20{};\x0a\x20\x20const\x20shapeText\x20=\x20shapeData.shapeText\x20||\x20{};\x0a\x20\x20const\x20text\x20=\x20elementText(element);\x0a\x20\x20const\x20output\x20=\x20{\x0a\x20\x20\x20\x20id:\x20element.id,\x0a\x20\x20\x20\x20type:\x20String(element.type\x20||\x20\x22unknown\x22),\x0a\x20\x20\x20\x20name:\x20typeof\x20element.name\x20===\x20\x22string\x22\x20?\x20element.name\x20:\x20\x22\x22,\x0a\x20\x20\x20\x20visible:\x20element.visible\x20!==\x20false,\x0a\x20\x20};\x0a\x20\x20const\x20transform\x20=\x20transformOf(element);\x0a\x20\x20if\x20(transform)\x20output.transform\x20=\x20transform;\x0a\x20\x20if\x20(shapeData.fill\x20!==\x20undefined)\x20output.fill\x20=\x20shapeData.fill;\x0a\x20\x20if\x20((shapeData.stroke\x20??\x20element.stroke)\x20!==\x20undefined)\x20output.stroke\x20=\x20shapeData.stroke\x20??\x20element.stroke;\x0a\x20\x20if\x20(text\x20!==\x20\x22\x22)\x20{\x0a\x20\x20\x20\x20const\x20textDetails\x20=\x20{\x20text\x20};\x0a\x20\x20\x20\x20const\x20horizontal\x20=\x20shapeText.dataModel\x20&&\x20shapeText.dataModel.ha;\x0a\x20\x20\x20\x20const\x20vertical\x20=\x20shapeText.dataModel\x20&&\x20shapeText.dataModel.va;\x0a\x20\x20\x20\x20if\x20(horizontal\x20!==\x20undefined\x20||\x20vertical\x20!==\x20undefined)\x20textDetails.alignment\x20=\x20{\x0a\x20\x20\x20\x20\x20\x20...(horizontal\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20horizontal\x20}),\x0a\x20\x20\x20\x20\x20\x20...(vertical\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20vertical\x20}),\x0a\x20\x20\x20\x20};\x0a\x20\x20\x20\x20if\x20(shapeText.padding\x20!==\x20undefined\x20||\x20shapeText.insets\x20!==\x20undefined)\x20textDetails.insets\x20=\x20shapeText.padding\x20??\x20shapeText.insets;\x0a\x20\x20\x20\x20output.text\x20=\x20textDetails;\x0a\x20\x20}\x0a\x20\x20if\x20(typeof\x20element.chartId\x20===\x20\x22string\x22)\x20output.chartId\x20=\x20element.chartId;\x0a\x20\x20if\x20(typeof\x20element.tableId\x20===\x20\x22string\x22)\x20{\x0a\x20\x20\x20\x20output.tableId\x20=\x20element.tableId;\x0a\x20\x20\x20\x20const\x20grid\x20=\x20tableText(element.tableId);\x0a\x20\x20\x20\x20if\x20(grid)\x20output.tableText\x20=\x20grid;\x0a\x20\x20}\x0a\x20\x20if\x20(typeof\x20element.mediaType\x20===\x20\x22string\x22)\x20output.mediaType\x20=\x20element.mediaType;\x0a\x20\x20if\x20(element.type\x20===\x20\x22group\x22\x20&&\x20Array.isArray(element.children))\x20{\x0a\x20\x20\x20\x20output.children\x20=\x20element.children.filter((id)\x20=>\x20!ancestors.has(id)\x20&&\x20elements[id]).map((id)\x20=>\x20{\x0a\x20\x20\x20\x20\x20\x20const\x20next\x20=\x20new\x20Set(ancestors);\x0a\x20\x20\x20\x20\x20\x20next.add(id);\x0a\x20\x20\x20\x20\x20\x20return\x20inspectElement(elements[id],\x20elements,\x20next);\x0a\x20\x20\x20\x20});\x0a\x20\x20}\x0a\x20\x20return\x20output;\x0a}\x0a\x0afunction\x20slideDetails(slide,\x20index)\x20{\x0a\x20\x20const\x20summary\x20=\x20slideSummary(slide,\x20index);\x0a\x20\x20const\x20elements\x20=\x20slide.elements\x20||\x20{};\x0a\x20\x20const\x20ordered\x20=\x20Array.isArray(slide.elementOrder)\x20?\x20slide.elementOrder\x20:\x20Object.keys(elements);\x0a\x20\x20return\x20{\x0a\x20\x20\x20\x20...summary,\x0a\x20\x20\x20\x20speakerNotes:\x20typeof\x20slide.speakerNotes\x20===\x20\x22string\x22\x20?\x20slide.speakerNotes\x20:\x20\x22\x22,\x0a\x20\x20\x20\x20elements:\x20ordered.filter((id)\x20=>\x20elements[id]).map((id)\x20=>\x20inspectElement(elements[id],\x20elements,\x20new\x20Set([id]))),\x0a\x20\x20};\x0a}\x0a\x0afunction\x20resolveSlide(selector)\x20{\x0a\x20\x20if\x20(!selector\x20||\x20typeof\x20selector\x20!==\x20\x22object\x22)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Slide\x20selector\x20must\x20be\x20an\x20object\x22)\x20};\x0a\x20\x20const\x20keys\x20=\x20[\x22id\x22,\x20\x22index\x22].filter((key)\x20=>\x20Object.hasOwn(selector,\x20key));\x0a\x20\x20if\x20(keys.length\x20!==\x201)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Slide\x20selector\x20must\x20contain\x20exactly\x20one\x20of\x20id\x20or\x20index\x22,\x20selector)\x20};\x0a\x20\x20let\x20matches\x20=\x20[];\x0a\x20\x20if\x20(keys[0]\x20===\x20\x22id\x22\x20&&\x20typeof\x20selector.id\x20===\x20\x22string\x22\x20&&\x20selector.id.length\x20>\x200)\x20matches\x20=\x20slides.filter((slide)\x20=>\x20slide.id\x20===\x20selector.id);\x0a\x20\x20else\x20if\x20(keys[0]\x20===\x20\x22index\x22\x20&&\x20Number.isInteger(selector.index)\x20&&\x20selector.index\x20>=\x200)\x20matches\x20=\x20slides[selector.index]\x20?\x20[slides[selector.index]]\x20:\x20[];\x0a\x20\x20else\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Slide\x20selector\x20value\x20is\x20invalid\x22,\x20selector)\x20};\x0a\x20\x20if\x20(matches.length\x20===\x200)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_NOT_FOUND\x22,\x20\x22Slide\x20selector\x20did\x20not\x20match\x20a\x20slide\x22,\x20selector)\x20};\x0a\x20\x20if\x20(matches.length\x20>\x201)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_AMBIGUOUS\x22,\x20\x22Slide\x20selector\x20matched\x20more\x20than\x20one\x20slide\x22,\x20selector)\x20};\x0a\x20\x20return\x20{\x20slide:\x20matches[0],\x20index:\x20slides.indexOf(matches[0])\x20};\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22presentation\x22)\x20{\x0a\x20\x20const\x20size\x20=\x20presentation.getPageSize();\x0a\x20\x20return\x20success({\x0a\x20\x20\x20\x20kind:\x20\x22presentation\x22,\x0a\x20\x20\x20\x20unitId:\x20input.unitId,\x0a\x20\x20\x20\x20name:\x20presentation.getName(),\x0a\x20\x20\x20\x20size:\x20{\x20width:\x20size.width,\x20height:\x20size.height\x20},\x0a\x20\x20\x20\x20masterSlideCount:\x20Array.isArray(snapshot.masterPageOrder)\x20?\x20snapshot.masterPageOrder.length\x20:\x20Object.keys(snapshot.masterPages\x20||\x20{}).length,\x0a\x20\x20\x20\x20layoutSlideCount:\x20Array.isArray(snapshot.layoutPageOrder)\x20?\x20snapshot.layoutPageOrder.length\x20:\x20Object.keys(snapshot.layoutPages\x20||\x20{}).length,\x0a\x20\x20\x20\x20slides:\x20slides.map(slideSummary),\x0a\x20\x20});\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22slide\x22)\x20{\x0a\x20\x20const\x20selected\x20=\x20[];\x0a\x20\x20for\x20(const\x20selector\x20of\x20input.query.slides\x20||\x20[])\x20{\x0a\x20\x20\x20\x20const\x20item\x20=\x20resolveSlide(selector);\x0a\x20\x20\x20\x20if\x20(item.error)\x20return\x20item.error;\x0a\x20\x20\x20\x20selected.push(slideDetails(item.slide,\x20item.index));\x0a\x20\x20}\x0a\x20\x20return\x20success({\x20kind:\x20\x22slide\x22,\x20unitId:\x20input.unitId,\x20slides:\x20selected\x20});\x0a}\x0a\x0areturn\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Unsupported\x20slide\x20inspection\x20target\x22);\x0a','paragraphs','1928848eIzuym','free','code','connectorData','top','originalType','shapeSite','left','unitId','presentation','Inspection\x20runtime\x20returned\x20an\x20invalid\x20envelope','INSPECTION_UNIT_TYPE_MISMATCH','string','object','children','connector','slide','width','slides','board','endElementId','worksheet-range','worksheets','diagram','every','auto','routing','name','workbook','kind','selectable','tableId','INSPECTION_RESULT_INVALID','manual','textContent','containerData','1369158mXrPKd','bounds','\x20runtime,\x20received\x20','5711804RNvSAf','values','value','total','lifeline','placeholder','unitType','connectionSiteId','unknown','source'];_0x372d=function(){return _0x255546;};return _0x372d();}function p(_0x9e64e1){const _0x59368d=_0x5e7e;return typeof _0x9e64e1[_0x59368d(0x1c5)]==_0x59368d(0x1b6)&&Array[_0x59368d(0x204)](_0x9e64e1[_0x59368d(0x1ec)])&&_0x9e64e1[_0x59368d(0x1ec)][_0x59368d(0x1c2)]((_0x55975a,_0x55866f)=>_(_0x55975a)&&m(_0x55975a[_0x59368d(0x1e2)])&&_0x55975a['index']===_0x55866f&&typeof _0x55975a['id']==_0x59368d(0x1b6)&&typeof _0x55975a['name']==_0x59368d(0x1b6)&&typeof _0x55975a['formulaName']=='string'&&typeof _0x55975a[_0x59368d(0x1f7)]=='string'&&m(_0x55975a[_0x59368d(0x1de)])&&Array[_0x59368d(0x204)](_0x55975a['fields'])&&_0x55975a['fields'][_0x59368d(0x1c2)]((_0x16e0df,_0x35401e)=>_(_0x16e0df)&&m(_0x16e0df['index'])&&_0x16e0df[_0x59368d(0x1e2)]===_0x35401e&&typeof _0x16e0df['id']==_0x59368d(0x1b6)&&typeof _0x16e0df[_0x59368d(0x1c5)]==_0x59368d(0x1b6)&&typeof _0x16e0df[_0x59368d(0x1e5)]==_0x59368d(0x1b6)&&typeof _0x16e0df[_0x59368d(0x198)]==_0x59368d(0x1e0)&&_0x59368d(0x1f0)in _0x16e0df&&h(_0x16e0df['config']))&&Array['isArray'](_0x55975a[_0x59368d(0x19f)])&&_0x55975a['views']['every']((_0x3884e8,_0x4784e5)=>_(_0x3884e8)&&m(_0x3884e8['index'])&&_0x3884e8[_0x59368d(0x1e2)]===_0x4784e5&&typeof _0x3884e8['id']==_0x59368d(0x1b6)&&typeof _0x3884e8['name']==_0x59368d(0x1b6)&&typeof _0x3884e8[_0x59368d(0x1e5)]=='string'));}function m(_0x1387d7){const _0x574df2=_0x5e7e;return typeof _0x1387d7==_0x574df2(0x1dd)&&Number[_0x574df2(0x203)](_0x1387d7)&&_0x1387d7>=0x0;}function h(_0x55b2bf){const _0xcb6959=_0x5e7e;return _0x55b2bf===null||typeof _0x55b2bf==_0xcb6959(0x1e0)||typeof _0x55b2bf==_0xcb6959(0x1b6)||typeof _0x55b2bf==_0xcb6959(0x1dd)&&Number['isFinite'](_0x55b2bf)?!0x0:Array[_0xcb6959(0x204)](_0x55b2bf)?_0x55b2bf[_0xcb6959(0x1c2)](h):_(_0x55b2bf)&&Object['values'](_0x55b2bf)['every'](h);}function g(_0x5235e1){const _0x3a62c9=_0x5e7e;return new e(_0x3a62c9(0x1ca),_0x5235e1);}function _(_0x1b61a8){const _0x109b90=_0x5e7e;return typeof _0x1b61a8==_0x109b90(0x1b7)&&!!_0x1b61a8&&!Array[_0x109b90(0x204)](_0x1b61a8);}function v(_0x3e7254){const _0x285ad4=_0x5e7e;return _0x3e7254===_0x285ad4(0x20f)||_0x3e7254==='INSPECTION_RESULT_INVALID'||_0x3e7254==='INSPECTION_SELECTOR_AMBIGUOUS'||_0x3e7254==='INSPECTION_SELECTOR_INVALID'||_0x3e7254===_0x285ad4(0x1ff)||_0x3e7254===_0x285ad4(0x1b5);}function y(_0x4b4c4e){const _0x6238f6=_0x5e7e;return _0x6238f6(0x20d)+JSON[_0x6238f6(0x1e4)]({'unitId':_0x4b4c4e})+_0x6238f6(0x19e);}function b(_0x4e7d69,_0x458f86){const _0x2077c9=_0x5e7e;return _0x2077c9(0x20d)+JSON[_0x2077c9(0x1e4)]({'query':_0x458f86,'unitId':_0x4e7d69})+_0x2077c9(0x1f3);}function x(_0x11173a,_0x1ef898){const _0x1572ff=_0x5e7e;return _0x1572ff(0x20d)+JSON[_0x1572ff(0x1e4)]({'query':_0x1ef898,'unitId':_0x11173a})+_0x1572ff(0x1e1);}function S(_0x2030e6,_0x503c47){const _0x3714ec=_0x5e7e;return'\x0aconst\x20input\x20=\x20'+JSON[_0x3714ec(0x1e4)]({'query':_0x503c47,'unitId':_0x2030e6})+_0x3714ec(0x1f5);}function C(_0xa2d379,_0x58f990){const _0x1f9cf3=_0x5e7e;return _0x1f9cf3(0x20d)+JSON['stringify']({'query':_0x58f990,'unitId':_0xa2d379})+_0x1f9cf3(0x1a8);}async function w(_0x411340,_0x5a542e){const _0x102349=_0x5e7e;E(_0x5a542e),D(_0x411340[_0x102349(0x1d7)],_0x5a542e[_0x102349(0x1c7)]);let _0x218403=T(_0x411340[_0x102349(0x1b2)],_0x5a542e),_0x2f8f75=t((await _0x411340[_0x102349(0x1e3)]({'code':_0x218403,'mode':_0x102349(0x1e8)}))[_0x102349(0x1d3)]);return n(_0x2f8f75,_0x5a542e['kind']),_0x2f8f75;}function T(_0x18dcac,_0x14ce2b){const _0x277404=_0x5e7e;switch(_0x14ce2b[_0x277404(0x1c7)]){case _0x277404(0x1c6):case _0x277404(0x1f6):case _0x277404(0x1bf):return S(_0x18dcac,_0x14ce2b);case _0x277404(0x20c):case _0x277404(0x20b):return x(_0x18dcac,_0x14ce2b);case _0x277404(0x1b3):case _0x277404(0x1ba):return C(_0x18dcac,_0x14ce2b);case _0x277404(0x1f8):return y(_0x18dcac);case _0x277404(0x1bd):case _0x277404(0x1dc):return b(_0x18dcac,_0x14ce2b);}}function E(_0x141308){const _0x411adb=_0x5e7e;let _0x145dc4=_0x141308[_0x411adb(0x1c7)]===_0x411adb(0x1f6)?_0x141308['worksheets']:_0x141308[_0x411adb(0x1c7)]===_0x411adb(0x1bf)?_0x141308['ranges']:_0x141308['kind']===_0x411adb(0x1ba)?_0x141308['slides']:_0x141308['kind']===_0x411adb(0x20b)?_0x141308['paragraphs']:_0x141308[_0x411adb(0x1c7)]===_0x411adb(0x1dc)?_0x141308['elements']:null;if(_0x145dc4!==null&&_0x145dc4[_0x411adb(0x1df)]===0x0)throw new e(_0x411adb(0x1f1),_0x141308[_0x411adb(0x1c7)]+'\x20inspection\x20requires\x20at\x20least\x20one\x20selector');}function D(_0x68a47a,_0x5833ae){const _0x4e5c3d=_0x5e7e;let _0x581f88=_0x5833ae===_0x4e5c3d(0x1f8)?_0x4e5c3d(0x1f8):_0x5833ae===_0x4e5c3d(0x1bd)||_0x5833ae===_0x4e5c3d(0x1dc)?_0x4e5c3d(0x1bd):_0x5833ae===_0x4e5c3d(0x1c6)||_0x5833ae==='worksheet'||_0x5833ae===_0x4e5c3d(0x1bf)?_0x4e5c3d(0x19a):_0x5833ae===_0x4e5c3d(0x1b3)||_0x5833ae===_0x4e5c3d(0x1ba)?_0x4e5c3d(0x1ba):_0x4e5c3d(0x19d);if(_0x68a47a!==_0x581f88)throw new e(_0x4e5c3d(0x1b5),_0x5833ae+'\x20inspection\x20requires\x20a\x20'+_0x581f88+_0x4e5c3d(0x1d0)+_0x68a47a,{'actual':_0x68a47a,'expected':_0x581f88,'kind':_0x5833ae});}export{e as ContentInspectionError,w as inspectContent};
1
+ const _0x56f609=_0x5403;function _0x5403(_0xfc74cd,_0x2d72e3){_0xfc74cd=_0xfc74cd-0x1c5;const _0x32ca16=_0x32ca();let _0x540318=_0x32ca16[_0xfc74cd];return _0x540318;}(function(_0x54ec48,_0x3956d1){const _0x1a021c=_0x5403,_0xd4fda8=_0x54ec48();while(!![]){try{const _0x543dc6=parseInt(_0x1a021c(0x22b))/0x1*(parseInt(_0x1a021c(0x1c9))/0x2)+-parseInt(_0x1a021c(0x204))/0x3+-parseInt(_0x1a021c(0x20e))/0x4+parseInt(_0x1a021c(0x23d))/0x5*(parseInt(_0x1a021c(0x227))/0x6)+parseInt(_0x1a021c(0x209))/0x7*(-parseInt(_0x1a021c(0x23c))/0x8)+-parseInt(_0x1a021c(0x200))/0x9+parseInt(_0x1a021c(0x20c))/0xa*(parseInt(_0x1a021c(0x234))/0xb);if(_0x543dc6===_0x3956d1)break;else _0xd4fda8['push'](_0xd4fda8['shift']());}catch(_0x43b3d6){_0xd4fda8['push'](_0xd4fda8['shift']());}}}(_0x32ca,0xe932c));var e=class extends Error{['code'];[_0x56f609(0x232)];constructor(_0x581b87,_0x2d7f3d,_0x10c978){const _0x3f7687=_0x56f609;super(_0x2d7f3d),this[_0x3f7687(0x1ed)]=_0x581b87,this['details']=_0x10c978,this[_0x3f7687(0x211)]='ContentInspectionError';}};function t(_0x2cf30b){const _0x2006d0=_0x56f609;if(!_(_0x2cf30b)||typeof _0x2cf30b['ok']!=_0x2006d0(0x22c))throw g(_0x2006d0(0x1c5));if(_0x2cf30b['ok']===!0x0&&_0x2006d0(0x1d8)in _0x2cf30b)return _0x2cf30b[_0x2006d0(0x1d8)];let _0x232bdd=_0x2cf30b['error'];if(_0x2cf30b['ok']===!0x1&&_(_0x232bdd)){let _0x3d393f=_0x232bdd[_0x2006d0(0x1ed)],_0x55916e=_0x232bdd['message'];if(v(_0x3d393f)&&typeof _0x55916e==_0x2006d0(0x202))throw new e(_0x3d393f,_0x55916e,_0x232bdd[_0x2006d0(0x232)]);}throw g('Inspection\x20runtime\x20returned\x20an\x20invalid\x20error\x20envelope');}function n(_0xfef553,_0x3f4355){const _0x5d1fc8=_0x56f609;if(!_(_0xfef553)||_0xfef553[_0x5d1fc8(0x208)]!==_0x3f4355||typeof _0xfef553[_0x5d1fc8(0x228)]!=_0x5d1fc8(0x202)||!(_0x3f4355===_0x5d1fc8(0x1f5)?p(_0xfef553):_0x3f4355===_0x5d1fc8(0x1e2)?typeof _0xfef553[_0x5d1fc8(0x211)]==_0x5d1fc8(0x202)&&Array[_0x5d1fc8(0x223)](_0xfef553['worksheets']):_0x3f4355===_0x5d1fc8(0x216)?Array[_0x5d1fc8(0x223)](_0xfef553[_0x5d1fc8(0x1d5)]):_0x3f4355===_0x5d1fc8(0x222)?Array['isArray'](_0xfef553['ranges']):_0x3f4355===_0x5d1fc8(0x226)?typeof _0xfef553['name']==_0x5d1fc8(0x202)&&Array[_0x5d1fc8(0x223)](_0xfef553[_0x5d1fc8(0x1f9)]):_0x3f4355===_0x5d1fc8(0x1d3)?Array[_0x5d1fc8(0x223)](_0xfef553[_0x5d1fc8(0x1f9)]):_0x3f4355==='document'?typeof _0xfef553[_0x5d1fc8(0x1e4)]=='string'&&Array[_0x5d1fc8(0x223)](_0xfef553[_0x5d1fc8(0x1dd)]):_0x3f4355===_0x5d1fc8(0x1fc)?Array[_0x5d1fc8(0x223)](_0xfef553[_0x5d1fc8(0x1dd)]):_0x3f4355===_0x5d1fc8(0x237)?r(_0xfef553):_0x3f4355==='board-element'&&i(_0xfef553)))throw g(_0x5d1fc8(0x206)+_0x3f4355+_0x5d1fc8(0x1ca));}function r(_0x5d1f69){const _0xacaad8=_0x56f609;let _0x57127e=_0x5d1f69['elementCounts'];return typeof _0x5d1f69[_0xacaad8(0x211)]==_0xacaad8(0x202)&&_0xacaad8(0x1f8)in _0x5d1f69&&_(_0x57127e)&&m(_0x57127e[_0xacaad8(0x1eb)])&&_(_0x57127e[_0xacaad8(0x1fa)])&&Object[_0xacaad8(0x1d6)](_0x57127e['byType'])[_0xacaad8(0x1c8)](m)&&Array[_0xacaad8(0x223)](_0x5d1f69['elements'])&&_0x57127e['total']===_0x5d1f69[_0xacaad8(0x1d9)][_0xacaad8(0x217)]&&Object[_0xacaad8(0x1d6)](_0x57127e['byType'])[_0xacaad8(0x1e8)]((_0x404daf,_0x37cc3a)=>_0x404daf+Number(_0x37cc3a),0x0)===_0x57127e[_0xacaad8(0x1eb)]&&_0x5d1f69[_0xacaad8(0x1d9)][_0xacaad8(0x1c8)](a);}function i(_0x41ec7f){const _0x58fd7f=_0x56f609;return Array[_0x58fd7f(0x223)](_0x41ec7f[_0x58fd7f(0x1d9)])&&_0x41ec7f[_0x58fd7f(0x1d9)][_0x58fd7f(0x1c8)](o);}function a(_0x3e149a){const _0xbfd8ee=_0x56f609;return _(_0x3e149a)&&typeof _0x3e149a['id']=='string'&&m(_0x3e149a['orderIndex'])&&typeof _0x3e149a[_0xbfd8ee(0x229)]=='string'&&typeof _0x3e149a[_0xbfd8ee(0x1ce)]=='boolean'&&typeof _0x3e149a[_0xbfd8ee(0x210)]==_0xbfd8ee(0x22c)&&typeof _0x3e149a[_0xbfd8ee(0x218)]=='boolean'&&_(_0x3e149a[_0xbfd8ee(0x1e1)])&&f(_0x3e149a['name'])&&f(_0x3e149a[_0xbfd8ee(0x21f)])&&f(_0x3e149a[_0xbfd8ee(0x22f)])&&f(_0x3e149a[_0xbfd8ee(0x20d)])&&(_0x3e149a[_0xbfd8ee(0x205)]===null||l(_0x3e149a[_0xbfd8ee(0x205)]));}function o(_0x24c092){const _0x2e7853=_0x56f609;return!a(_0x24c092)||_0x2e7853(0x1f0)in _0x24c092||_0x2e7853(0x232)in _0x24c092||'connectorData'in _0x24c092?!0x1:_0x24c092[_0x2e7853(0x229)]==='shape'?'shapeData'in _0x24c092:_0x24c092['type']===_0x2e7853(0x1de)?!(_0x2e7853(0x1f7)in _0x24c092)&&!('endElementId'in _0x24c092)&&!(_0x2e7853(0x1ef)in _0x24c092)&&!(_0x2e7853(0x225)in _0x24c092)&&s(_0x24c092['connection'])&&_0x2e7853(0x1ec)in _0x24c092&&Array[_0x2e7853(0x223)](_0x24c092['labels'])&&_0x24c092['labels']['every'](_0x5ca6c4=>_(_0x5ca6c4)&&typeof _0x5ca6c4['id']=='string')&&_0x2e7853(0x22e)in _0x24c092&&_0x2e7853(0x1da)in _0x24c092:_0x24c092['type']===_0x2e7853(0x225)?_0x2e7853(0x1e5)in _0x24c092&&_0x2e7853(0x20a)in _0x24c092:_0x24c092['type']===_0x2e7853(0x1ee)||_0x24c092[_0x2e7853(0x229)]==='media'?typeof _0x24c092[_0x2e7853(0x1d0)]==_0x2e7853(0x202):_0x24c092[_0x2e7853(0x229)]==='chart'?typeof _0x24c092[_0x2e7853(0x1f4)]==_0x2e7853(0x202):_0x24c092[_0x2e7853(0x229)]===_0x2e7853(0x238)?_0x2e7853(0x1c7)in _0x24c092:_0x24c092[_0x2e7853(0x229)]===_0x2e7853(0x1fb)?_0x2e7853(0x21d)in _0x24c092:_0x24c092[_0x2e7853(0x229)]===_0x2e7853(0x239)?typeof _0x24c092[_0x2e7853(0x21c)]==_0x2e7853(0x202):_0x24c092['type']===_0x2e7853(0x224)?Array[_0x2e7853(0x223)](_0x24c092[_0x2e7853(0x1f1)])&&_0x24c092[_0x2e7853(0x1f1)][_0x2e7853(0x1c8)](_0x48d53e=>typeof _0x48d53e==_0x2e7853(0x202)):_0x24c092[_0x2e7853(0x229)]===_0x2e7853(0x1cb)?'placeholder'in _0x24c092:_0x24c092['type']==='unknown'&&typeof _0x24c092[_0x2e7853(0x220)]=='string'&&_0x2e7853(0x21d)in _0x24c092;}function s(_0x1bf098){const _0x2a59cd=_0x56f609;return _(_0x1bf098)&&c(_0x1bf098['start'])&&c(_0x1bf098[_0x2a59cd(0x212)])&&(_0x1bf098['routing']==='straight'||_0x1bf098[_0x2a59cd(0x20b)]===_0x2a59cd(0x221)||_0x1bf098['routing']==='curve'||_0x1bf098['routing']===_0x2a59cd(0x1d4))&&(_0x1bf098['routingMode']===_0x2a59cd(0x22d)||_0x1bf098[_0x2a59cd(0x23a)]===_0x2a59cd(0x235)||_0x1bf098['routingMode']===_0x2a59cd(0x23e))&&Array[_0x2a59cd(0x223)](_0x1bf098[_0x2a59cd(0x233)])&&_0x1bf098['waypoints']['every'](_0x1543de=>_(_0x1543de)&&typeof _0x1543de['id']==_0x2a59cd(0x202)&&(_0x1543de[_0x2a59cd(0x208)]==='auto'||_0x1543de[_0x2a59cd(0x208)]===_0x2a59cd(0x235))&&u(_0x1543de));}function c(_0x62ec93){const _0x25155f=_0x56f609;return!_(_0x62ec93)||typeof _0x62ec93[_0x25155f(0x208)]!=_0x25155f(0x202)?!0x1:_0x62ec93[_0x25155f(0x208)]==='free'?u(_0x62ec93):_0x62ec93[_0x25155f(0x208)]===_0x25155f(0x21b)?typeof _0x62ec93[_0x25155f(0x1f2)]==_0x25155f(0x202)&&typeof _0x62ec93[_0x25155f(0x1ff)]==_0x25155f(0x1f6):_0x62ec93[_0x25155f(0x208)]==='shapeSite'?typeof _0x62ec93[_0x25155f(0x1f2)]==_0x25155f(0x202)&&typeof _0x62ec93[_0x25155f(0x1cc)]==_0x25155f(0x1f6)&&d(_0x62ec93['connectionPosition']):_0x62ec93[_0x25155f(0x208)]===_0x25155f(0x23f)&&typeof _0x62ec93[_0x25155f(0x1f2)]==_0x25155f(0x202)&&typeof _0x62ec93['outlineIndex']==_0x25155f(0x1f6)&&typeof _0x62ec93[_0x25155f(0x1e0)]==_0x25155f(0x1f6)&&typeof _0x62ec93[_0x25155f(0x1f3)]==_0x25155f(0x1f6);}function l(_0xa90ba7){const _0x4f7e1c=_0x56f609;return _(_0xa90ba7)&&typeof _0xa90ba7[_0x4f7e1c(0x1e6)]==_0x4f7e1c(0x1f6)&&typeof _0xa90ba7[_0x4f7e1c(0x1fd)]==_0x4f7e1c(0x1f6)&&typeof _0xa90ba7['width']==_0x4f7e1c(0x1f6)&&typeof _0xa90ba7[_0x4f7e1c(0x230)]==_0x4f7e1c(0x1f6);}function u(_0x512b53){const _0x39fa89=_0x56f609;return _(_0x512b53)&&typeof _0x512b53['x']==_0x39fa89(0x1f6)&&typeof _0x512b53['y']==_0x39fa89(0x1f6);}function d(_0xbc69cb){const _0x123430=_0x56f609;return _0xbc69cb===void 0x0||typeof _0xbc69cb==_0x123430(0x1f6);}function f(_0x27036c){const _0x10c193=_0x56f609;return _0x27036c===void 0x0||typeof _0x27036c==_0x10c193(0x202);}function p(_0x13c647){const _0x464f07=_0x56f609;return typeof _0x13c647['name']==_0x464f07(0x202)&&Array[_0x464f07(0x223)](_0x13c647[_0x464f07(0x1c6)])&&_0x13c647[_0x464f07(0x1c6)][_0x464f07(0x1c8)]((_0x5b3d1f,_0xd551ab)=>_(_0x5b3d1f)&&m(_0x5b3d1f[_0x464f07(0x236)])&&_0x5b3d1f['index']===_0xd551ab&&typeof _0x5b3d1f['id']==_0x464f07(0x202)&&typeof _0x5b3d1f['name']=='string'&&typeof _0x5b3d1f[_0x464f07(0x219)]==_0x464f07(0x202)&&typeof _0x5b3d1f[_0x464f07(0x1e3)]==_0x464f07(0x202)&&m(_0x5b3d1f[_0x464f07(0x1d1)])&&Array[_0x464f07(0x223)](_0x5b3d1f[_0x464f07(0x213)])&&_0x5b3d1f['fields'][_0x464f07(0x1c8)]((_0x2645f7,_0x13069c)=>_(_0x2645f7)&&m(_0x2645f7[_0x464f07(0x236)])&&_0x2645f7[_0x464f07(0x236)]===_0x13069c&&typeof _0x2645f7['id']==_0x464f07(0x202)&&typeof _0x2645f7[_0x464f07(0x211)]==_0x464f07(0x202)&&typeof _0x2645f7['type']=='string'&&typeof _0x2645f7[_0x464f07(0x1fe)]==_0x464f07(0x22c)&&'config'in _0x2645f7&&h(_0x2645f7[_0x464f07(0x215)]))&&Array[_0x464f07(0x223)](_0x5b3d1f[_0x464f07(0x1e9)])&&_0x5b3d1f[_0x464f07(0x1e9)][_0x464f07(0x1c8)]((_0x416204,_0x4aaba2)=>_(_0x416204)&&m(_0x416204[_0x464f07(0x236)])&&_0x416204[_0x464f07(0x236)]===_0x4aaba2&&typeof _0x416204['id']==_0x464f07(0x202)&&typeof _0x416204[_0x464f07(0x211)]==_0x464f07(0x202)&&typeof _0x416204[_0x464f07(0x229)]==_0x464f07(0x202)));}function m(_0x43ae51){return typeof _0x43ae51=='number'&&Number['isSafeInteger'](_0x43ae51)&&_0x43ae51>=0x0;}function h(_0x12dec5){const _0x23bd98=_0x56f609;return _0x12dec5===null||typeof _0x12dec5==_0x23bd98(0x22c)||typeof _0x12dec5==_0x23bd98(0x202)||typeof _0x12dec5==_0x23bd98(0x1f6)&&Number[_0x23bd98(0x1ea)](_0x12dec5)?!0x0:Array[_0x23bd98(0x223)](_0x12dec5)?_0x12dec5[_0x23bd98(0x1c8)](h):_(_0x12dec5)&&Object[_0x23bd98(0x1d6)](_0x12dec5)[_0x23bd98(0x1c8)](h);}function g(_0x558082){return new e('INSPECTION_RESULT_INVALID',_0x558082);}function _0x32ca(){const _0x2871cc=['laneId','3980548ASyCoW','sheet','selectable','name','end','fields',';\x0aconst\x20fail\x20=\x20(code,\x20message,\x20details)\x20=>\x20({\x20ok:\x20false,\x20error:\x20{\x20code,\x20message,\x20...(details\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20details\x20})\x20}\x20});\x0aconst\x20success\x20=\x20(value)\x20=>\x20({\x20ok:\x20true,\x20value\x20});\x0aconst\x20presentation\x20=\x20univerAPI.getPresentation(input.unitId);\x0aif\x20(!presentation)\x20return\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Presentation\x20\x22\x20+\x20input.unitId\x20+\x20\x22\x20is\x20not\x20available\x20in\x20the\x20runtime\x22);\x0aconst\x20snapshot\x20=\x20presentation.save();\x0aconst\x20slideIds\x20=\x20Array.isArray(snapshot.slideOrder)\x20?\x20snapshot.slideOrder\x20:\x20Object.keys(snapshot.slides\x20||\x20{});\x0aconst\x20slides\x20=\x20slideIds.map((id)\x20=>\x20snapshot.slides\x20&&\x20snapshot.slides[id]).filter(Boolean);\x0a\x0afunction\x20documentText(documentData)\x20{\x0a\x20\x20const\x20stream\x20=\x20documentData\x20&&\x20documentData.body\x20&&\x20documentData.body.dataStream;\x0a\x20\x20return\x20typeof\x20stream\x20===\x20\x22string\x22\x20?\x20stream.replace(/\x5cr/g,\x20\x22\x5cn\x22).replace(/[\x5cu0000-\x5cu0009\x5cu000b-\x5cu001f]+/g,\x20\x22\x22).replace(/\x5cn+$/g,\x20\x22\x22)\x20:\x20\x22\x22;\x0a}\x0a\x0afunction\x20elementText(element)\x20{\x0a\x20\x20if\x20(typeof\x20element.text\x20===\x20\x22string\x22)\x20return\x20element.text;\x0a\x20\x20if\x20(element.textData)\x20return\x20documentText(element.textData);\x0a\x20\x20const\x20shapeData\x20=\x20element.shapeData\x20||\x20element.connectorData;\x0a\x20\x20const\x20shapeText\x20=\x20shapeData\x20&&\x20shapeData.shapeText;\x0a\x20\x20if\x20(shapeText\x20&&\x20typeof\x20shapeText.text\x20===\x20\x22string\x22)\x20return\x20shapeText.text;\x0a\x20\x20if\x20(shapeText\x20&&\x20shapeText.dataModel\x20&&\x20shapeText.dataModel.doc)\x20return\x20documentText(shapeText.dataModel.doc);\x0a\x20\x20return\x20\x22\x22;\x0a}\x0a\x0afunction\x20elementCountType(type)\x20{\x0a\x20\x20if\x20(type\x20===\x20\x22chart\x22)\x20return\x20\x22charts\x22;\x0a\x20\x20if\x20(type\x20===\x20\x22image\x22)\x20return\x20\x22images\x22;\x0a\x20\x20if\x20(type\x20===\x20\x22table\x22)\x20return\x20\x22tables\x22;\x0a\x20\x20if\x20(type\x20===\x20\x22group\x22)\x20return\x20\x22groups\x22;\x0a\x20\x20if\x20(type\x20===\x20\x22text\x22\x20||\x20type\x20===\x20\x22placeholder\x22)\x20return\x20\x22text\x22;\x0a\x20\x20return\x20\x22shapes\x22;\x0a}\x0a\x0afunction\x20collectElements(slide)\x20{\x0a\x20\x20const\x20elements\x20=\x20slide.elements\x20||\x20{};\x0a\x20\x20const\x20visited\x20=\x20new\x20Set();\x0a\x20\x20const\x20output\x20=\x20[];\x0a\x20\x20function\x20visit(id)\x20{\x0a\x20\x20\x20\x20if\x20(visited.has(id))\x20return;\x0a\x20\x20\x20\x20visited.add(id);\x0a\x20\x20\x20\x20const\x20element\x20=\x20elements[id];\x0a\x20\x20\x20\x20if\x20(!element)\x20return;\x0a\x20\x20\x20\x20output.push(element);\x0a\x20\x20\x20\x20if\x20(element.type\x20===\x20\x22group\x22\x20&&\x20Array.isArray(element.children))\x20element.children.forEach(visit);\x0a\x20\x20}\x0a\x20\x20(Array.isArray(slide.elementOrder)\x20?\x20slide.elementOrder\x20:\x20Object.keys(elements)).forEach(visit);\x0a\x20\x20Object.keys(elements).forEach(visit);\x0a\x20\x20return\x20output;\x0a}\x0a\x0afunction\x20elementCounts(slide)\x20{\x0a\x20\x20const\x20counts\x20=\x20{\x20total:\x200,\x20text:\x200,\x20shapes:\x200,\x20images:\x200,\x20charts:\x200,\x20tables:\x200,\x20groups:\x200\x20};\x0a\x20\x20for\x20(const\x20element\x20of\x20collectElements(slide))\x20{\x0a\x20\x20\x20\x20counts.total\x20+=\x201;\x0a\x20\x20\x20\x20counts[elementCountType(element.type)]\x20+=\x201;\x0a\x20\x20}\x0a\x20\x20return\x20counts;\x0a}\x0a\x0afunction\x20slideSummary(slide,\x20index)\x20{\x0a\x20\x20const\x20text\x20=\x20collectElements(slide).map(elementText).filter(Boolean).join(\x22\x20|\x20\x22).replace(/\x5cs+/g,\x20\x22\x20\x22).trim();\x0a\x20\x20const\x20preview\x20=\x20text.length\x20<=\x20160\x20?\x20text\x20:\x20text.slice(0,\x20157)\x20+\x20\x22...\x22;\x0a\x20\x20return\x20{\x0a\x20\x20\x20\x20id:\x20slide.id,\x0a\x20\x20\x20\x20index,\x0a\x20\x20\x20\x20name:\x20slide.name\x20||\x20\x22\x22,\x0a\x20\x20\x20\x20elementCounts:\x20elementCounts(slide),\x0a\x20\x20\x20\x20...(preview\x20===\x20\x22\x22\x20?\x20{}\x20:\x20{\x20textPreview:\x20preview\x20}),\x0a\x20\x20\x20\x20hasSpeakerNotes:\x20typeof\x20slide.speakerNotes\x20===\x20\x22string\x22\x20&&\x20slide.speakerNotes.length\x20>\x200,\x0a\x20\x20};\x0a}\x0a\x0afunction\x20parseTableResources()\x20{\x0a\x20\x20const\x20resource\x20=\x20(Array.isArray(snapshot.resources)\x20?\x20snapshot.resources\x20:\x20[]).find((item)\x20=>\x20item\x20&&\x20item.name\x20===\x20\x22SLIDE_TABLE_PLUGIN\x22);\x0a\x20\x20if\x20(!resource\x20||\x20typeof\x20resource.data\x20!==\x20\x22string\x22)\x20return\x20{};\x0a\x20\x20try\x20{\x0a\x20\x20\x20\x20const\x20parsed\x20=\x20JSON.parse(resource.data);\x0a\x20\x20\x20\x20return\x20parsed\x20&&\x20typeof\x20parsed.tables\x20===\x20\x22object\x22\x20?\x20parsed.tables\x20:\x20{};\x0a\x20\x20}\x20catch\x20{\x0a\x20\x20\x20\x20return\x20{};\x0a\x20\x20}\x0a}\x0a\x0aconst\x20tableResources\x20=\x20parseTableResources();\x0a\x0afunction\x20tableText(tableId)\x20{\x0a\x20\x20const\x20table\x20=\x20tableResources[tableId];\x0a\x20\x20if\x20(!table\x20||\x20!Array.isArray(table.rows))\x20return\x20undefined;\x0a\x20\x20return\x20table.rows.map((row)\x20=>\x20(Array.isArray(row.cells)\x20?\x20row.cells\x20:\x20[]).map((cell)\x20=>\x20documentText(cell\x20&&\x20cell.textData)));\x0a}\x0a\x0afunction\x20finite(value)\x20{\x0a\x20\x20return\x20typeof\x20value\x20===\x20\x22number\x22\x20&&\x20Number.isFinite(value)\x20?\x20value\x20:\x20undefined;\x0a}\x0a\x0afunction\x20transformOf(element)\x20{\x0a\x20\x20const\x20transform\x20=\x20element.transform\x20||\x20{};\x0a\x20\x20const\x20result\x20=\x20{};\x0a\x20\x20const\x20left\x20=\x20finite(transform.left\x20??\x20transform.x);\x0a\x20\x20const\x20top\x20=\x20finite(transform.top\x20??\x20transform.y);\x0a\x20\x20const\x20width\x20=\x20finite(transform.width);\x0a\x20\x20const\x20height\x20=\x20finite(transform.height);\x0a\x20\x20const\x20angle\x20=\x20finite(transform.angle\x20??\x20transform.rotation);\x0a\x20\x20if\x20(left\x20!==\x20undefined)\x20result.left\x20=\x20left;\x0a\x20\x20if\x20(top\x20!==\x20undefined)\x20result.top\x20=\x20top;\x0a\x20\x20if\x20(width\x20!==\x20undefined)\x20result.width\x20=\x20width;\x0a\x20\x20if\x20(height\x20!==\x20undefined)\x20result.height\x20=\x20height;\x0a\x20\x20if\x20(angle\x20!==\x20undefined)\x20result.angle\x20=\x20angle;\x0a\x20\x20return\x20Object.keys(result).length\x20===\x200\x20?\x20undefined\x20:\x20result;\x0a}\x0a\x0afunction\x20inspectElement(element,\x20elements,\x20ancestors)\x20{\x0a\x20\x20const\x20shapeData\x20=\x20element.shapeData\x20||\x20element.connectorData\x20||\x20{};\x0a\x20\x20const\x20shapeText\x20=\x20shapeData.shapeText\x20||\x20{};\x0a\x20\x20const\x20text\x20=\x20elementText(element);\x0a\x20\x20const\x20output\x20=\x20{\x0a\x20\x20\x20\x20id:\x20element.id,\x0a\x20\x20\x20\x20type:\x20String(element.type\x20||\x20\x22unknown\x22),\x0a\x20\x20\x20\x20name:\x20typeof\x20element.name\x20===\x20\x22string\x22\x20?\x20element.name\x20:\x20\x22\x22,\x0a\x20\x20\x20\x20visible:\x20element.visible\x20!==\x20false,\x0a\x20\x20};\x0a\x20\x20const\x20transform\x20=\x20transformOf(element);\x0a\x20\x20if\x20(transform)\x20output.transform\x20=\x20transform;\x0a\x20\x20if\x20(shapeData.fill\x20!==\x20undefined)\x20output.fill\x20=\x20shapeData.fill;\x0a\x20\x20if\x20((shapeData.stroke\x20??\x20element.stroke)\x20!==\x20undefined)\x20output.stroke\x20=\x20shapeData.stroke\x20??\x20element.stroke;\x0a\x20\x20if\x20(text\x20!==\x20\x22\x22)\x20{\x0a\x20\x20\x20\x20const\x20textDetails\x20=\x20{\x20text\x20};\x0a\x20\x20\x20\x20const\x20horizontal\x20=\x20shapeText.dataModel\x20&&\x20shapeText.dataModel.ha;\x0a\x20\x20\x20\x20const\x20vertical\x20=\x20shapeText.dataModel\x20&&\x20shapeText.dataModel.va;\x0a\x20\x20\x20\x20if\x20(horizontal\x20!==\x20undefined\x20||\x20vertical\x20!==\x20undefined)\x20textDetails.alignment\x20=\x20{\x0a\x20\x20\x20\x20\x20\x20...(horizontal\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20horizontal\x20}),\x0a\x20\x20\x20\x20\x20\x20...(vertical\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20vertical\x20}),\x0a\x20\x20\x20\x20};\x0a\x20\x20\x20\x20if\x20(shapeText.padding\x20!==\x20undefined\x20||\x20shapeText.insets\x20!==\x20undefined)\x20textDetails.insets\x20=\x20shapeText.padding\x20??\x20shapeText.insets;\x0a\x20\x20\x20\x20output.text\x20=\x20textDetails;\x0a\x20\x20}\x0a\x20\x20if\x20(typeof\x20element.chartId\x20===\x20\x22string\x22)\x20output.chartId\x20=\x20element.chartId;\x0a\x20\x20if\x20(typeof\x20element.tableId\x20===\x20\x22string\x22)\x20{\x0a\x20\x20\x20\x20output.tableId\x20=\x20element.tableId;\x0a\x20\x20\x20\x20const\x20grid\x20=\x20tableText(element.tableId);\x0a\x20\x20\x20\x20if\x20(grid)\x20output.tableText\x20=\x20grid;\x0a\x20\x20}\x0a\x20\x20if\x20(typeof\x20element.mediaType\x20===\x20\x22string\x22)\x20output.mediaType\x20=\x20element.mediaType;\x0a\x20\x20if\x20(element.type\x20===\x20\x22group\x22\x20&&\x20Array.isArray(element.children))\x20{\x0a\x20\x20\x20\x20output.children\x20=\x20element.children.filter((id)\x20=>\x20!ancestors.has(id)\x20&&\x20elements[id]).map((id)\x20=>\x20{\x0a\x20\x20\x20\x20\x20\x20const\x20next\x20=\x20new\x20Set(ancestors);\x0a\x20\x20\x20\x20\x20\x20next.add(id);\x0a\x20\x20\x20\x20\x20\x20return\x20inspectElement(elements[id],\x20elements,\x20next);\x0a\x20\x20\x20\x20});\x0a\x20\x20}\x0a\x20\x20return\x20output;\x0a}\x0a\x0afunction\x20slideDetails(slide,\x20index)\x20{\x0a\x20\x20const\x20summary\x20=\x20slideSummary(slide,\x20index);\x0a\x20\x20const\x20elements\x20=\x20slide.elements\x20||\x20{};\x0a\x20\x20const\x20ordered\x20=\x20Array.isArray(slide.elementOrder)\x20?\x20slide.elementOrder\x20:\x20Object.keys(elements);\x0a\x20\x20return\x20{\x0a\x20\x20\x20\x20...summary,\x0a\x20\x20\x20\x20speakerNotes:\x20typeof\x20slide.speakerNotes\x20===\x20\x22string\x22\x20?\x20slide.speakerNotes\x20:\x20\x22\x22,\x0a\x20\x20\x20\x20elements:\x20ordered.filter((id)\x20=>\x20elements[id]).map((id)\x20=>\x20inspectElement(elements[id],\x20elements,\x20new\x20Set([id]))),\x0a\x20\x20};\x0a}\x0a\x0afunction\x20resolveSlide(selector)\x20{\x0a\x20\x20if\x20(!selector\x20||\x20typeof\x20selector\x20!==\x20\x22object\x22)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Slide\x20selector\x20must\x20be\x20an\x20object\x22)\x20};\x0a\x20\x20const\x20keys\x20=\x20[\x22id\x22,\x20\x22index\x22].filter((key)\x20=>\x20Object.hasOwn(selector,\x20key));\x0a\x20\x20if\x20(keys.length\x20!==\x201)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Slide\x20selector\x20must\x20contain\x20exactly\x20one\x20of\x20id\x20or\x20index\x22,\x20selector)\x20};\x0a\x20\x20let\x20matches\x20=\x20[];\x0a\x20\x20if\x20(keys[0]\x20===\x20\x22id\x22\x20&&\x20typeof\x20selector.id\x20===\x20\x22string\x22\x20&&\x20selector.id.length\x20>\x200)\x20matches\x20=\x20slides.filter((slide)\x20=>\x20slide.id\x20===\x20selector.id);\x0a\x20\x20else\x20if\x20(keys[0]\x20===\x20\x22index\x22\x20&&\x20Number.isInteger(selector.index)\x20&&\x20selector.index\x20>=\x200)\x20matches\x20=\x20slides[selector.index]\x20?\x20[slides[selector.index]]\x20:\x20[];\x0a\x20\x20else\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Slide\x20selector\x20value\x20is\x20invalid\x22,\x20selector)\x20};\x0a\x20\x20if\x20(matches.length\x20===\x200)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_NOT_FOUND\x22,\x20\x22Slide\x20selector\x20did\x20not\x20match\x20a\x20slide\x22,\x20selector)\x20};\x0a\x20\x20if\x20(matches.length\x20>\x201)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_AMBIGUOUS\x22,\x20\x22Slide\x20selector\x20matched\x20more\x20than\x20one\x20slide\x22,\x20selector)\x20};\x0a\x20\x20return\x20{\x20slide:\x20matches[0],\x20index:\x20slides.indexOf(matches[0])\x20};\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22presentation\x22)\x20{\x0a\x20\x20const\x20size\x20=\x20presentation.getPageSize();\x0a\x20\x20return\x20success({\x0a\x20\x20\x20\x20kind:\x20\x22presentation\x22,\x0a\x20\x20\x20\x20unitId:\x20input.unitId,\x0a\x20\x20\x20\x20name:\x20presentation.getName(),\x0a\x20\x20\x20\x20size:\x20{\x20width:\x20size.width,\x20height:\x20size.height\x20},\x0a\x20\x20\x20\x20masterSlideCount:\x20Array.isArray(snapshot.masterPageOrder)\x20?\x20snapshot.masterPageOrder.length\x20:\x20Object.keys(snapshot.masterPages\x20||\x20{}).length,\x0a\x20\x20\x20\x20layoutSlideCount:\x20Array.isArray(snapshot.layoutPageOrder)\x20?\x20snapshot.layoutPageOrder.length\x20:\x20Object.keys(snapshot.layoutPages\x20||\x20{}).length,\x0a\x20\x20\x20\x20slides:\x20slides.map(slideSummary),\x0a\x20\x20});\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22slide\x22)\x20{\x0a\x20\x20const\x20selected\x20=\x20[];\x0a\x20\x20for\x20(const\x20selector\x20of\x20input.query.slides\x20||\x20[])\x20{\x0a\x20\x20\x20\x20const\x20item\x20=\x20resolveSlide(selector);\x0a\x20\x20\x20\x20if\x20(item.error)\x20return\x20item.error;\x0a\x20\x20\x20\x20selected.push(slideDetails(item.slide,\x20item.index));\x0a\x20\x20}\x0a\x20\x20return\x20success({\x20kind:\x20\x22slide\x22,\x20unitId:\x20input.unitId,\x20slides:\x20selected\x20});\x0a}\x0a\x0areturn\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Unsupported\x20slide\x20inspection\x20target\x22);\x0a','config','worksheet','length','locked','formulaName','unitType','lifeline','tableId','data','board-element','description','originalType','orthogonal','worksheet-range','isArray','group','text','presentation','54ZAEDoK','unitId','type','\x20inspection\x20requires\x20a\x20','21SXWOra','boolean','auto','labelText','parentId','height','stringify','details','waypoints','22QfzCtr','manual','index','board','container','table','routingMode','\x20inspection\x20requires\x20at\x20least\x20one\x20selector','24bvBUSV','361855POLeDr','mixed','shapeBoundary','ranges','Inspection\x20runtime\x20returned\x20an\x20invalid\x20envelope','tables','containerData','every','106114PaOMHV','\x20result','placeholder','connectionSiteId','INSPECTION_RANGE_OUT_OF_BOUNDS','visible','\x20runtime,\x20received\x20','source','recordCount','INSPECTION_RESULT_INVALID','slide','freePolyline','worksheets','values','execute','value','elements','labelStyle','INSPECTION_UNIT_TYPE_MISMATCH',';\x0aconst\x20fail\x20=\x20(code,\x20message,\x20details)\x20=>\x20({\x20ok:\x20false,\x20error:\x20{\x20code,\x20message,\x20...(details\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20details\x20})\x20}\x20});\x0aconst\x20success\x20=\x20(value)\x20=>\x20({\x20ok:\x20true,\x20value:\x20JSON.parse(JSON.stringify(value))\x20});\x0aconst\x20board\x20=\x20univerAPI.getBoard(input.unitId);\x0aif\x20(!board)\x20return\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Board\x20\x22\x20+\x20input.unitId\x20+\x20\x22\x20is\x20not\x20available\x20in\x20the\x20runtime\x22);\x0a\x0aconst\x20descriptors\x20=\x20board.describeElements();\x0aconst\x20descriptorsById\x20=\x20new\x20Map(descriptors.map((descriptor)\x20=>\x20[descriptor.id,\x20descriptor]));\x0a\x0afunction\x20elementCounts()\x20{\x0a\x20\x20const\x20byType\x20=\x20{};\x0a\x20\x20for\x20(const\x20descriptor\x20of\x20descriptors)\x20{\x0a\x20\x20\x20\x20const\x20type\x20=\x20String(descriptor.type\x20||\x20\x22unknown\x22);\x0a\x20\x20\x20\x20byType[type]\x20=\x20(byType[type]\x20||\x200)\x20+\x201;\x0a\x20\x20}\x0a\x20\x20return\x20{\x20total:\x20descriptors.length,\x20byType\x20};\x0a}\x0a\x0afunction\x20inspectionBase(element,\x20descriptor)\x20{\x0a\x20\x20return\x20{\x0a\x20\x20\x20\x20id:\x20element.id,\x0a\x20\x20\x20\x20orderIndex:\x20descriptor.orderIndex,\x0a\x20\x20\x20\x20type:\x20String(element.type\x20||\x20\x22unknown\x22),\x0a\x20\x20\x20\x20...(descriptor.name\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20name:\x20descriptor.name\x20}),\x0a\x20\x20\x20\x20...(descriptor.description\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20description:\x20descriptor.description\x20}),\x0a\x20\x20\x20\x20...(descriptor.parentId\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20parentId:\x20descriptor.parentId\x20}),\x0a\x20\x20\x20\x20...(descriptor.laneId\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20laneId:\x20descriptor.laneId\x20}),\x0a\x20\x20\x20\x20visible:\x20descriptor.visible,\x0a\x20\x20\x20\x20selectable:\x20descriptor.selectable,\x0a\x20\x20\x20\x20locked:\x20descriptor.locked,\x0a\x20\x20\x20\x20transform:\x20element.transform\x20||\x20{},\x0a\x20\x20\x20\x20bounds:\x20descriptor.bounds,\x0a\x20\x20};\x0a}\x0a\x0afunction\x20richTextData(value)\x20{\x0a\x20\x20return\x20value\x20?\x20value.getData()\x20:\x20null;\x0a}\x0a\x0afunction\x20inspectElement(element,\x20descriptor)\x20{\x0a\x20\x20const\x20base\x20=\x20inspectionBase(element,\x20descriptor);\x0a\x20\x20if\x20(element.type\x20===\x20\x22shape\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x20...base,\x20type:\x20\x22shape\x22,\x20shapeData:\x20element.shapeData\x20||\x20{}\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22connector\x22)\x20{\x0a\x20\x20\x20\x20const\x20connection\x20=\x20board.getConnectorConnection(element.id);\x0a\x20\x20\x20\x20if\x20(!connection)\x20return\x20null;\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22connector\x22,\x0a\x20\x20\x20\x20\x20\x20connection,\x0a\x20\x20\x20\x20\x20\x20style:\x20board.getConnectorStyle(element.id),\x0a\x20\x20\x20\x20\x20\x20labels:\x20board.getConnectorLabels(element.id),\x0a\x20\x20\x20\x20\x20\x20labelText:\x20richTextData(board.getConnectorLabelText(element.id)),\x0a\x20\x20\x20\x20\x20\x20labelStyle:\x20board.getConnectorLabelStyle(element.id),\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22text\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22text\x22,\x0a\x20\x20\x20\x20\x20\x20textContent:\x20richTextData(board.getTextContent(element.id)),\x0a\x20\x20\x20\x20\x20\x20textStyle:\x20element.textStyle\x20||\x20null,\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22image\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22image\x22,\x0a\x20\x20\x20\x20\x20\x20source:\x20element.source,\x0a\x20\x20\x20\x20\x20\x20...(element.imageSourceType\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20imageSourceType:\x20element.imageSourceType\x20}),\x0a\x20\x20\x20\x20\x20\x20...(element.crop\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20crop:\x20element.crop\x20}),\x0a\x20\x20\x20\x20\x20\x20...(element.prstGeom\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20prstGeom:\x20element.prstGeom\x20}),\x0a\x20\x20\x20\x20\x20\x20...(element.adjustValues\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20adjustValues:\x20element.adjustValues\x20}),\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22chart\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22chart\x22,\x0a\x20\x20\x20\x20\x20\x20chartId:\x20element.chartId,\x0a\x20\x20\x20\x20\x20\x20...(element.placeholder\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20placeholder:\x20element.placeholder\x20}),\x0a\x20\x20\x20\x20\x20\x20...(element.stroke\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20stroke:\x20element.stroke\x20}),\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22container\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x20...base,\x20type:\x20\x22container\x22,\x20containerData:\x20element.containerData\x20||\x20{}\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22diagram\x22)\x20{\x0a\x20\x20\x20\x20const\x20{\x20id,\x20type,\x20transform,\x20parentId,\x20laneId,\x20name,\x20description,\x20visible,\x20selectable,\x20locked,\x20...data\x20}\x20=\x20element;\x0a\x20\x20\x20\x20return\x20{\x20...base,\x20type:\x20\x22diagram\x22,\x20data\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22table\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22table\x22,\x0a\x20\x20\x20\x20\x20\x20tableId:\x20element.tableId,\x0a\x20\x20\x20\x20\x20\x20...(element.placeholder\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20placeholder:\x20element.placeholder\x20}),\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22group\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x20...base,\x20type:\x20\x22group\x22,\x20children:\x20Array.isArray(element.children)\x20?\x20element.children\x20:\x20[]\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22media\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22media\x22,\x0a\x20\x20\x20\x20\x20\x20mediaType:\x20String(element.mediaType\x20||\x20\x22unknown\x22),\x0a\x20\x20\x20\x20\x20\x20source:\x20element.source,\x0a\x20\x20\x20\x20\x20\x20...(element.poster\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20poster:\x20element.poster\x20}),\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20if\x20(element.type\x20===\x20\x22placeholder\x22)\x20{\x0a\x20\x20\x20\x20return\x20{\x0a\x20\x20\x20\x20\x20\x20...base,\x0a\x20\x20\x20\x20\x20\x20type:\x20\x22placeholder\x22,\x0a\x20\x20\x20\x20\x20\x20placeholder:\x20element.placeholder\x20||\x20{},\x0a\x20\x20\x20\x20\x20\x20...(element.text\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20text:\x20element.text\x20}),\x0a\x20\x20\x20\x20\x20\x20...(element.style\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20style:\x20element.style\x20}),\x0a\x20\x20\x20\x20};\x0a\x20\x20}\x0a\x20\x20const\x20{\x20id,\x20type,\x20transform,\x20parentId,\x20laneId,\x20name,\x20description,\x20visible,\x20selectable,\x20locked,\x20...data\x20}\x20=\x20element;\x0a\x20\x20return\x20{\x20...base,\x20type:\x20\x22unknown\x22,\x20originalType:\x20String(type\x20||\x20\x22unknown\x22),\x20data\x20};\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22board\x22)\x20{\x0a\x20\x20const\x20background\x20=\x20board.getBackground();\x0a\x20\x20return\x20success({\x0a\x20\x20\x20\x20kind:\x20\x22board\x22,\x0a\x20\x20\x20\x20unitId:\x20input.unitId,\x0a\x20\x20\x20\x20name:\x20board.getName(),\x0a\x20\x20\x20\x20...(background\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20background\x20}),\x0a\x20\x20\x20\x20themeData:\x20board.getThemeData(),\x0a\x20\x20\x20\x20elementCounts:\x20elementCounts(),\x0a\x20\x20\x20\x20elements:\x20descriptors,\x0a\x20\x20});\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22board-element\x22)\x20{\x0a\x20\x20const\x20selected\x20=\x20[];\x0a\x20\x20for\x20(const\x20selector\x20of\x20input.query.elements\x20||\x20[])\x20{\x0a\x20\x20\x20\x20if\x20(!selector\x20||\x20typeof\x20selector\x20!==\x20\x22object\x22\x20||\x20Object.keys(selector).length\x20!==\x201\x20||\x20typeof\x20selector.id\x20!==\x20\x22string\x22\x20||\x20selector.id.length\x20===\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20return\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Board\x20element\x20selector\x20must\x20contain\x20exactly\x20one\x20non-empty\x20id\x22,\x20selector);\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20const\x20descriptor\x20=\x20descriptorsById.get(selector.id);\x0a\x20\x20\x20\x20const\x20element\x20=\x20board.getElement(selector.id);\x0a\x20\x20\x20\x20if\x20(!descriptor\x20||\x20!element)\x20{\x0a\x20\x20\x20\x20\x20\x20return\x20fail(\x22INSPECTION_SELECTOR_NOT_FOUND\x22,\x20\x22Board\x20element\x20selector\x20did\x20not\x20match\x20an\x20element\x22,\x20selector);\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20const\x20inspection\x20=\x20inspectElement(element,\x20descriptor);\x0a\x20\x20\x20\x20if\x20(!inspection)\x20{\x0a\x20\x20\x20\x20\x20\x20return\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Board\x20element\x20\x22\x20+\x20selector.id\x20+\x20\x22\x20could\x20not\x20be\x20inspected\x22);\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20selected.push(inspection);\x0a\x20\x20}\x0a\x20\x20return\x20success({\x20kind:\x20\x22board-element\x22,\x20unitId:\x20input.unitId,\x20elements:\x20selected\x20});\x0a}\x0a\x0areturn\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Unsupported\x20Board\x20inspection\x20target\x22);\x0a','paragraphs','connector','INSPECTION_SELECTOR_NOT_FOUND','segmentIndex','transform','workbook','primaryFieldId','title','textContent','left','\x0aconst\x20input\x20=\x20','reduce','views','isFinite','total','style','code','image','subtype','descriptor','children','shapeId','segmentT','chartId','base','number','startElementId','themeData','slides','byType','diagram','paragraph','top','isReadonly','offsetY','4619178bzyTbB','doc','string',';\x0aconst\x20fail\x20=\x20(code,\x20message,\x20details)\x20=>\x20({\x20ok:\x20false,\x20error:\x20{\x20code,\x20message,\x20...(details\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20details\x20})\x20}\x20});\x0aconst\x20success\x20=\x20(value)\x20=>\x20({\x20ok:\x20true,\x20value\x20});\x0aconst\x20base\x20=\x20univerAPI.getBase(input.unitId);\x0aif\x20(!base)\x20return\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Base\x20\x22\x20+\x20input.unitId\x20+\x20\x22\x20is\x20not\x20available\x20in\x20the\x20runtime\x22);\x0aconst\x20schema\x20=\x20base.getSchema();\x0areturn\x20success({\x0a\x20\x20kind:\x20\x22base\x22,\x0a\x20\x20unitId:\x20input.unitId,\x0a\x20\x20name:\x20schema.name,\x0a\x20\x20tables:\x20schema.tables.map((table,\x20index)\x20=>\x20({\x0a\x20\x20\x20\x20id:\x20table.id,\x0a\x20\x20\x20\x20index,\x0a\x20\x20\x20\x20name:\x20table.name,\x0a\x20\x20\x20\x20formulaName:\x20table.formulaName,\x0a\x20\x20\x20\x20primaryFieldId:\x20table.primaryFieldId,\x0a\x20\x20\x20\x20recordCount:\x20table.recordCount,\x0a\x20\x20\x20\x20fields:\x20table.fields.map((field,\x20fieldIndex)\x20=>\x20({\x0a\x20\x20\x20\x20\x20\x20id:\x20field.id,\x0a\x20\x20\x20\x20\x20\x20index:\x20fieldIndex,\x0a\x20\x20\x20\x20\x20\x20name:\x20field.name,\x0a\x20\x20\x20\x20\x20\x20type:\x20field.type,\x0a\x20\x20\x20\x20\x20\x20config:\x20field.config\x20??\x20{},\x0a\x20\x20\x20\x20\x20\x20isReadonly:\x20field.readonly\x20===\x20true,\x0a\x20\x20\x20\x20})),\x0a\x20\x20\x20\x20views:\x20table.views.map((view,\x20viewIndex)\x20=>\x20({\x0a\x20\x20\x20\x20\x20\x20id:\x20view.id,\x0a\x20\x20\x20\x20\x20\x20index:\x20viewIndex,\x0a\x20\x20\x20\x20\x20\x20name:\x20view.name,\x0a\x20\x20\x20\x20\x20\x20type:\x20view.type,\x0a\x20\x20\x20\x20})),\x0a\x20\x20})),\x0a});\x0a','944733sYqeTL','bounds','Inspection\x20runtime\x20returned\x20an\x20invalid\x20','read','kind','1954274KaeAEa','textStyle','routing','9252400jFewSC'];_0x32ca=function(){return _0x2871cc;};return _0x32ca();}function _(_0x182bfd){const _0x3a01e0=_0x56f609;return typeof _0x182bfd=='object'&&!!_0x182bfd&&!Array[_0x3a01e0(0x223)](_0x182bfd);}function v(_0x15ab01){const _0x12cfcc=_0x56f609;return _0x15ab01===_0x12cfcc(0x1cd)||_0x15ab01===_0x12cfcc(0x1d2)||_0x15ab01==='INSPECTION_SELECTOR_AMBIGUOUS'||_0x15ab01==='INSPECTION_SELECTOR_INVALID'||_0x15ab01===_0x12cfcc(0x1df)||_0x15ab01===_0x12cfcc(0x1db);}function y(_0x1c83f1){const _0x297f67=_0x56f609;return _0x297f67(0x1e7)+JSON[_0x297f67(0x231)]({'unitId':_0x1c83f1})+_0x297f67(0x203);}function b(_0x2119fa,_0x486ee9){const _0x29c47d=_0x56f609;return'\x0aconst\x20input\x20=\x20'+JSON[_0x29c47d(0x231)]({'query':_0x486ee9,'unitId':_0x2119fa})+_0x29c47d(0x1dc);}function x(_0x56db25,_0x3de9f5){const _0x4656f2=_0x56f609;return _0x4656f2(0x1e7)+JSON[_0x4656f2(0x231)]({'query':_0x3de9f5,'unitId':_0x56db25})+';\x0aconst\x20fail\x20=\x20(code,\x20message,\x20details)\x20=>\x20({\x20ok:\x20false,\x20error:\x20{\x20code,\x20message,\x20...(details\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20details\x20})\x20}\x20});\x0aconst\x20success\x20=\x20(value)\x20=>\x20({\x20ok:\x20true,\x20value\x20});\x0aconst\x20document\x20=\x20univerAPI.getDocument(input.unitId);\x0aif\x20(!document)\x20return\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Document\x20\x22\x20+\x20input.unitId\x20+\x20\x22\x20is\x20not\x20available\x20in\x20the\x20runtime\x22);\x0aconst\x20snapshot\x20=\x20document.save();\x0aconst\x20body\x20=\x20snapshot.body\x20||\x20{};\x0aconst\x20stream\x20=\x20typeof\x20body.dataStream\x20===\x20\x22string\x22\x20?\x20body.dataStream\x20:\x20\x22\x22;\x0aconst\x20rawParagraphs\x20=\x20Array.isArray(body.paragraphs)\x20?\x20body.paragraphs\x20:\x20[];\x0a\x0afunction\x20cleanPreview(text)\x20{\x0a\x20\x20const\x20normalized\x20=\x20text.replace(/[\x5cu0000-\x5cu001f]+/g,\x20\x22\x20\x22).replace(/\x5cs+/g,\x20\x22\x20\x22).trim();\x0a\x20\x20return\x20normalized.length\x20<=\x20120\x20?\x20normalized\x20:\x20normalized.slice(0,\x20117)\x20+\x20\x22...\x22;\x0a}\x0a\x0afunction\x20resolveParagraphs()\x20{\x0a\x20\x20let\x20start\x20=\x200;\x0a\x20\x20return\x20rawParagraphs.map((paragraph,\x20index)\x20=>\x20{\x0a\x20\x20\x20\x20const\x20end\x20=\x20Number.isInteger(paragraph.startIndex)\x20?\x20paragraph.startIndex\x20:\x20start;\x0a\x20\x20\x20\x20const\x20result\x20=\x20{\x0a\x20\x20\x20\x20\x20\x20id:\x20typeof\x20paragraph.paragraphId\x20===\x20\x22string\x22\x20?\x20paragraph.paragraphId\x20:\x20String(index),\x0a\x20\x20\x20\x20\x20\x20index,\x0a\x20\x20\x20\x20\x20\x20text:\x20stream.slice(start,\x20end),\x0a\x20\x20\x20\x20\x20\x20start,\x0a\x20\x20\x20\x20\x20\x20end,\x0a\x20\x20\x20\x20\x20\x20raw:\x20paragraph,\x0a\x20\x20\x20\x20};\x0a\x20\x20\x20\x20start\x20=\x20end\x20+\x201;\x0a\x20\x20\x20\x20return\x20result;\x0a\x20\x20});\x0a}\x0a\x0aconst\x20paragraphs\x20=\x20resolveParagraphs();\x0a\x0afunction\x20resolveParagraph(selector)\x20{\x0a\x20\x20if\x20(!selector\x20||\x20typeof\x20selector\x20!==\x20\x22object\x22)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Paragraph\x20selector\x20must\x20be\x20an\x20object\x22)\x20};\x0a\x20\x20const\x20keys\x20=\x20[\x22id\x22,\x20\x22index\x22].filter((key)\x20=>\x20Object.hasOwn(selector,\x20key));\x0a\x20\x20if\x20(keys.length\x20!==\x201)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Paragraph\x20selector\x20must\x20contain\x20exactly\x20one\x20of\x20id\x20or\x20index\x22,\x20selector)\x20};\x0a\x20\x20let\x20matches\x20=\x20[];\x0a\x20\x20if\x20(keys[0]\x20===\x20\x22id\x22\x20&&\x20typeof\x20selector.id\x20===\x20\x22string\x22\x20&&\x20selector.id.length\x20>\x200)\x20matches\x20=\x20paragraphs.filter((paragraph)\x20=>\x20paragraph.id\x20===\x20selector.id);\x0a\x20\x20else\x20if\x20(keys[0]\x20===\x20\x22index\x22\x20&&\x20Number.isInteger(selector.index)\x20&&\x20selector.index\x20>=\x200)\x20matches\x20=\x20paragraphs[selector.index]\x20?\x20[paragraphs[selector.index]]\x20:\x20[];\x0a\x20\x20else\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Paragraph\x20selector\x20value\x20is\x20invalid\x22,\x20selector)\x20};\x0a\x20\x20if\x20(matches.length\x20===\x200)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_NOT_FOUND\x22,\x20\x22Paragraph\x20selector\x20did\x20not\x20match\x20a\x20paragraph\x22,\x20selector)\x20};\x0a\x20\x20if\x20(matches.length\x20>\x201)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_AMBIGUOUS\x22,\x20\x22Paragraph\x20selector\x20matched\x20more\x20than\x20one\x20paragraph\x22,\x20selector)\x20};\x0a\x20\x20return\x20{\x20paragraph:\x20matches[0]\x20};\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22document\x22)\x20{\x0a\x20\x20const\x20mode\x20=\x20typeof\x20document.isModern\x20===\x20\x22function\x22\x20&&\x20document.isModern()\x0a\x20\x20\x20\x20?\x20\x22modern\x22\x0a\x20\x20\x20\x20:\x20typeof\x20document.isTraditional\x20===\x20\x22function\x22\x20&&\x20document.isTraditional()\x0a\x20\x20\x20\x20\x20\x20?\x20\x22paginated\x22\x0a\x20\x20\x20\x20\x20\x20:\x20\x22unspecified\x22;\x0a\x20\x20return\x20success({\x0a\x20\x20\x20\x20kind:\x20\x22document\x22,\x0a\x20\x20\x20\x20unitId:\x20input.unitId,\x0a\x20\x20\x20\x20title:\x20document.getName(),\x0a\x20\x20\x20\x20mode,\x0a\x20\x20\x20\x20paragraphCount:\x20paragraphs.length,\x0a\x20\x20\x20\x20characterCount:\x20paragraphs.reduce((total,\x20paragraph)\x20=>\x20total\x20+\x20paragraph.text.length,\x200),\x0a\x20\x20\x20\x20features:\x20{\x0a\x20\x20\x20\x20\x20\x20tables:\x20Array.isArray(body.tables)\x20?\x20body.tables.length\x20:\x200,\x0a\x20\x20\x20\x20\x20\x20lists:\x20paragraphs.filter((paragraph)\x20=>\x20paragraph.raw.bullet\x20!==\x20undefined).length,\x0a\x20\x20\x20\x20\x20\x20drawings:\x20snapshot.drawings\x20&&\x20typeof\x20snapshot.drawings\x20===\x20\x22object\x22\x20?\x20Object.keys(snapshot.drawings).length\x20:\x200,\x0a\x20\x20\x20\x20\x20\x20customBlocks:\x20Array.isArray(body.customBlocks)\x20?\x20body.customBlocks.length\x20:\x200,\x0a\x20\x20\x20\x20\x20\x20blockRanges:\x20Array.isArray(body.blockRanges)\x20?\x20body.blockRanges.length\x20:\x200,\x0a\x20\x20\x20\x20},\x0a\x20\x20\x20\x20paragraphs:\x20paragraphs.map((paragraph)\x20=>\x20({\x20id:\x20paragraph.id,\x20index:\x20paragraph.index,\x20textPreview:\x20cleanPreview(paragraph.text)\x20})),\x0a\x20\x20});\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22paragraph\x22)\x20{\x0a\x20\x20const\x20selected\x20=\x20[];\x0a\x20\x20for\x20(const\x20selector\x20of\x20input.query.paragraphs\x20||\x20[])\x20{\x0a\x20\x20\x20\x20const\x20item\x20=\x20resolveParagraph(selector);\x0a\x20\x20\x20\x20if\x20(item.error)\x20return\x20item.error;\x0a\x20\x20\x20\x20const\x20paragraph\x20=\x20item.paragraph;\x0a\x20\x20\x20\x20const\x20runs\x20=\x20(Array.isArray(body.textRuns)\x20?\x20body.textRuns\x20:\x20[]).filter((run)\x20=>\x20(run.ed\x20||\x200)\x20>\x20paragraph.start\x20&&\x20(run.st\x20||\x200)\x20<\x20paragraph.end);\x0a\x20\x20\x20\x20const\x20bullet\x20=\x20paragraph.raw.bullet;\x0a\x20\x20\x20\x20const\x20listId\x20=\x20bullet\x20&&\x20bullet.listId;\x0a\x20\x20\x20\x20const\x20list\x20=\x20typeof\x20listId\x20===\x20\x22string\x22\x20&&\x20snapshot.lists\x20&&\x20snapshot.lists[listId];\x0a\x20\x20\x20\x20selected.push({\x0a\x20\x20\x20\x20\x20\x20id:\x20paragraph.id,\x0a\x20\x20\x20\x20\x20\x20index:\x20paragraph.index,\x0a\x20\x20\x20\x20\x20\x20text:\x20paragraph.text,\x0a\x20\x20\x20\x20\x20\x20...(paragraph.raw.paragraphStyle\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20style:\x20paragraph.raw.paragraphStyle\x20}),\x0a\x20\x20\x20\x20\x20\x20...(bullet\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20bullet\x20}),\x0a\x20\x20\x20\x20\x20\x20...(list\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20list\x20}),\x0a\x20\x20\x20\x20\x20\x20textRuns:\x20runs,\x0a\x20\x20\x20\x20});\x0a\x20\x20}\x0a\x20\x20return\x20success({\x20kind:\x20\x22paragraph\x22,\x20unitId:\x20input.unitId,\x20paragraphs:\x20selected\x20});\x0a}\x0a\x0areturn\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Unsupported\x20document\x20inspection\x20target\x22);\x0a';}function S(_0x51beba,_0x4a7cf3){const _0x34090a=_0x56f609;return _0x34090a(0x1e7)+JSON[_0x34090a(0x231)]({'query':_0x4a7cf3,'unitId':_0x51beba})+';\x0aconst\x20fail\x20=\x20(code,\x20message,\x20details)\x20=>\x20({\x20ok:\x20false,\x20error:\x20{\x20code,\x20message,\x20...(details\x20===\x20undefined\x20?\x20{}\x20:\x20{\x20details\x20})\x20}\x20});\x0aconst\x20success\x20=\x20(value)\x20=>\x20({\x20ok:\x20true,\x20value\x20});\x0aconst\x20workbook\x20=\x20univerAPI.getWorkbook(input.unitId);\x0aif\x20(!workbook)\x20return\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Workbook\x20\x22\x20+\x20input.unitId\x20+\x20\x22\x20is\x20not\x20available\x20in\x20the\x20runtime\x22);\x0aconst\x20sheets\x20=\x20workbook.getSheets();\x0aconst\x20snapshot\x20=\x20workbook.save();\x0a\x0afunction\x20columnName(column)\x20{\x0a\x20\x20let\x20value\x20=\x20column\x20+\x201;\x0a\x20\x20let\x20name\x20=\x20\x22\x22;\x0a\x20\x20while\x20(value\x20>\x200)\x20{\x0a\x20\x20\x20\x20const\x20remainder\x20=\x20(value\x20-\x201)\x20%\x2026;\x0a\x20\x20\x20\x20name\x20=\x20String.fromCharCode(65\x20+\x20remainder)\x20+\x20name;\x0a\x20\x20\x20\x20value\x20=\x20Math.floor((value\x20-\x201)\x20/\x2026);\x0a\x20\x20}\x0a\x20\x20return\x20name;\x0a}\x0a\x0afunction\x20rangeNotation(range)\x20{\x0a\x20\x20const\x20start\x20=\x20columnName(range.startColumn)\x20+\x20String(range.startRow\x20+\x201);\x0a\x20\x20const\x20end\x20=\x20columnName(range.endColumn)\x20+\x20String(range.endRow\x20+\x201);\x0a\x20\x20return\x20start\x20===\x20end\x20?\x20start\x20:\x20start\x20+\x20\x22:\x22\x20+\x20end;\x0a}\x0a\x0afunction\x20parseA1Range(notation)\x20{\x0a\x20\x20const\x20match\x20=\x20/^\x5c$?([A-Za-z]+)\x5c$?(\x5cd+)(?::\x5c$?([A-Za-z]+)\x5c$?(\x5cd+))?$/.exec(notation);\x0a\x20\x20if\x20(!match)\x20return\x20null;\x0a\x20\x20const\x20columnIndex\x20=\x20(name)\x20=>\x20{\x0a\x20\x20\x20\x20let\x20column\x20=\x200;\x0a\x20\x20\x20\x20for\x20(const\x20character\x20of\x20name.toUpperCase())\x20column\x20=\x20column\x20*\x2026\x20+\x20character.charCodeAt(0)\x20-\x2064;\x0a\x20\x20\x20\x20return\x20column\x20-\x201;\x0a\x20\x20};\x0a\x20\x20const\x20startColumn\x20=\x20columnIndex(match[1]);\x0a\x20\x20const\x20startRow\x20=\x20Number(match[2])\x20-\x201;\x0a\x20\x20const\x20endColumn\x20=\x20columnIndex(match[3]\x20||\x20match[1]);\x0a\x20\x20const\x20endRow\x20=\x20Number(match[4]\x20||\x20match[2])\x20-\x201;\x0a\x20\x20if\x20(!Number.isSafeInteger(startRow)\x20||\x20!Number.isSafeInteger(endRow)\x20||\x20startRow\x20<\x200\x20||\x20endRow\x20<\x20startRow\x20||\x20endColumn\x20<\x20startColumn)\x20return\x20null;\x0a\x20\x20return\x20{\x20startRow,\x20endRow,\x20startColumn,\x20endColumn\x20};\x0a}\x0a\x0afunction\x20normalizeCellData(cellData)\x20{\x0a\x20\x20const\x20cells\x20=\x20[];\x0a\x20\x20for\x20(const\x20[rowKey,\x20columns]\x20of\x20Object.entries(cellData\x20||\x20{}))\x20{\x0a\x20\x20\x20\x20const\x20row\x20=\x20Number(rowKey);\x0a\x20\x20\x20\x20if\x20(!Number.isInteger(row)\x20||\x20!columns\x20||\x20typeof\x20columns\x20!==\x20\x22object\x22)\x20continue;\x0a\x20\x20\x20\x20for\x20(const\x20[columnKey,\x20cell]\x20of\x20Object.entries(columns))\x20{\x0a\x20\x20\x20\x20\x20\x20const\x20column\x20=\x20Number(columnKey);\x0a\x20\x20\x20\x20\x20\x20if\x20(Number.isInteger(column)\x20&&\x20cell\x20&&\x20typeof\x20cell\x20===\x20\x22object\x22)\x20cells.push({\x20row,\x20column,\x20cell\x20});\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x20\x20cells.sort((left,\x20right)\x20=>\x20left.row\x20-\x20right.row\x20||\x20left.column\x20-\x20right.column);\x0a\x20\x20return\x20cells;\x0a}\x0a\x0a//\x20TODO:\x20profile\x20large\x20sparse\x20worksheets\x20and\x20move\x20this\x20scan\x20behind\x20an\x20incremental\x20index\x20if\x20needed.\x0afunction\x20compactUsedRanges(cells,\x20predicate)\x20{\x0a\x20\x20const\x20horizontal\x20=\x20[];\x0a\x20\x20let\x20active\x20=\x20null;\x0a\x20\x20for\x20(const\x20entry\x20of\x20cells)\x20{\x0a\x20\x20\x20\x20if\x20(!predicate(entry.cell))\x20continue;\x0a\x20\x20\x20\x20if\x20(active\x20&&\x20active.startRow\x20===\x20entry.row\x20&&\x20active.endColumn\x20+\x201\x20===\x20entry.column)\x20{\x0a\x20\x20\x20\x20\x20\x20active.endColumn\x20=\x20entry.column;\x0a\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20active\x20=\x20{\x20startRow:\x20entry.row,\x20endRow:\x20entry.row,\x20startColumn:\x20entry.column,\x20endColumn:\x20entry.column\x20};\x0a\x20\x20\x20\x20\x20\x20horizontal.push(active);\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x20\x20const\x20rectangles\x20=\x20[];\x0a\x20\x20const\x20previousRow\x20=\x20new\x20Map();\x0a\x20\x20let\x20currentRow\x20=\x20-1;\x0a\x20\x20let\x20current\x20=\x20new\x20Map();\x0a\x20\x20for\x20(const\x20span\x20of\x20horizontal)\x20{\x0a\x20\x20\x20\x20if\x20(span.startRow\x20!==\x20currentRow)\x20{\x0a\x20\x20\x20\x20\x20\x20previousRow.clear();\x0a\x20\x20\x20\x20\x20\x20for\x20(const\x20[key,\x20value]\x20of\x20current)\x20previousRow.set(key,\x20value);\x0a\x20\x20\x20\x20\x20\x20current\x20=\x20new\x20Map();\x0a\x20\x20\x20\x20\x20\x20currentRow\x20=\x20span.startRow;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20const\x20key\x20=\x20span.startColumn\x20+\x20\x22:\x22\x20+\x20span.endColumn;\x0a\x20\x20\x20\x20const\x20prior\x20=\x20previousRow.get(key);\x0a\x20\x20\x20\x20if\x20(prior\x20&&\x20prior.endRow\x20+\x201\x20===\x20span.startRow)\x20{\x0a\x20\x20\x20\x20\x20\x20prior.endRow\x20=\x20span.startRow;\x0a\x20\x20\x20\x20\x20\x20current.set(key,\x20prior);\x0a\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20const\x20rectangle\x20=\x20{\x20...span\x20};\x0a\x20\x20\x20\x20\x20\x20rectangles.push(rectangle);\x0a\x20\x20\x20\x20\x20\x20current.set(key,\x20rectangle);\x0a\x20\x20\x20\x20}\x0a\x20\x20}\x0a\x20\x20return\x20rectangles.map(rangeNotation);\x0a}\x0a\x0afunction\x20hasValue(cell)\x20{\x0a\x20\x20return\x20Object.entries(cell).some(([key,\x20value])\x20=>\x20key\x20!==\x20\x22s\x22\x20&&\x20key\x20!==\x20\x22t\x22\x20&&\x20value\x20!==\x20null\x20&&\x20value\x20!==\x20undefined\x20&&\x20value\x20!==\x20\x22\x22);\x0a}\x0a\x0afunction\x20hasFormula(cell)\x20{\x0a\x20\x20return\x20(typeof\x20cell.f\x20===\x20\x22string\x22\x20&&\x20cell.f.length\x20>\x200)\x20||\x20cell.si\x20!==\x20null\x20&&\x20cell.si\x20!==\x20undefined\x20&&\x20cell.si\x20!==\x20\x22\x22;\x0a}\x0a\x0afunction\x20hasStyle(cell)\x20{\x0a\x20\x20return\x20cell.s\x20!==\x20null\x20&&\x20cell.s\x20!==\x20undefined;\x0a}\x0a\x0afunction\x20uniqueRanges(ranges)\x20{\x0a\x20\x20return\x20[...new\x20Set(ranges.map(rangeNotation))].sort();\x0a}\x0a\x0afunction\x20worksheetIdentity(sheet,\x20index)\x20{\x0a\x20\x20return\x20{\x20id:\x20sheet.getSheetId(),\x20index,\x20name:\x20sheet.getSheetName()\x20};\x0a}\x0a\x0afunction\x20worksheetOverview(sheet,\x20index)\x20{\x0a\x20\x20const\x20identity\x20=\x20worksheetIdentity(sheet,\x20index);\x0a\x20\x20const\x20sheetData\x20=\x20snapshot.sheets\x20&&\x20snapshot.sheets[identity.id]\x20||\x20{};\x0a\x20\x20const\x20cells\x20=\x20normalizeCellData(sheetData.cellData);\x0a\x20\x20const\x20conditionalRules\x20=\x20typeof\x20sheet.getConditionalFormattingRules\x20===\x20\x22function\x22\x20?\x20sheet.getConditionalFormattingRules()\x20:\x20[];\x0a\x20\x20const\x20validationRules\x20=\x20typeof\x20sheet.getDataValidations\x20===\x20\x22function\x22\x20?\x20sheet.getDataValidations()\x20:\x20[];\x0a\x20\x20const\x20tables\x20=\x20typeof\x20sheet.getSubTableInfos\x20===\x20\x22function\x22\x20?\x20sheet.getSubTableInfos()\x20:\x20[];\x0a\x20\x20const\x20images\x20=\x20typeof\x20sheet.getImages\x20===\x20\x22function\x22\x20?\x20sheet.getImages().length\x20:\x200;\x0a\x20\x20const\x20shapes\x20=\x20typeof\x20sheet.getShapes\x20===\x20\x22function\x22\x20?\x20sheet.getShapes().length\x20:\x200;\x0a\x20\x20const\x20charts\x20=\x20sheet.charts\x20&&\x20typeof\x20sheet.charts.list\x20===\x20\x22function\x22\x20?\x20sheet.charts.list().length\x20:\x200;\x0a\x20\x20return\x20{\x0a\x20\x20\x20\x20...identity,\x0a\x20\x20\x20\x20rowCount:\x20sheet.getMaxRows(),\x0a\x20\x20\x20\x20columnCount:\x20sheet.getMaxColumns(),\x0a\x20\x20\x20\x20valueUsedRanges:\x20compactUsedRanges(cells,\x20hasValue),\x0a\x20\x20\x20\x20formulaUsedRanges:\x20compactUsedRanges(cells,\x20hasFormula),\x0a\x20\x20\x20\x20styleUsedRanges:\x20compactUsedRanges(cells,\x20hasStyle),\x0a\x20\x20\x20\x20mergedRanges:\x20sheet.getMergedRanges().map((range)\x20=>\x20range.getA1Notation()),\x0a\x20\x20\x20\x20tables:\x20tables.map((table)\x20=>\x20({\x20id:\x20table.id,\x20name:\x20table.name,\x20range:\x20rangeNotation(table.range)\x20})),\x0a\x20\x20\x20\x20conditionalFormatting:\x20{\x0a\x20\x20\x20\x20\x20\x20count:\x20conditionalRules.length,\x0a\x20\x20\x20\x20\x20\x20ranges:\x20uniqueRanges(conditionalRules.flatMap((rule)\x20=>\x20Array.isArray(rule.ranges)\x20?\x20rule.ranges\x20:\x20[])),\x0a\x20\x20\x20\x20},\x0a\x20\x20\x20\x20dataValidation:\x20{\x0a\x20\x20\x20\x20\x20\x20count:\x20validationRules.length,\x0a\x20\x20\x20\x20\x20\x20ranges:\x20uniqueRanges(validationRules.flatMap((validation)\x20=>\x20Array.isArray(validation.rule\x20&&\x20validation.rule.ranges)\x20?\x20validation.rule.ranges\x20:\x20[])),\x0a\x20\x20\x20\x20},\x0a\x20\x20\x20\x20drawings:\x20{\x20total:\x20charts\x20+\x20images\x20+\x20shapes,\x20charts,\x20images,\x20shapes\x20},\x0a\x20\x20};\x0a}\x0a\x0afunction\x20resolveWorksheet(selector)\x20{\x0a\x20\x20if\x20(!selector\x20||\x20typeof\x20selector\x20!==\x20\x22object\x22)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Worksheet\x20selector\x20must\x20be\x20an\x20object\x22)\x20};\x0a\x20\x20const\x20keys\x20=\x20[\x22id\x22,\x20\x22index\x22,\x20\x22name\x22].filter((key)\x20=>\x20Object.hasOwn(selector,\x20key));\x0a\x20\x20if\x20(keys.length\x20!==\x201)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Worksheet\x20selector\x20must\x20contain\x20exactly\x20one\x20of\x20id,\x20index,\x20or\x20name\x22,\x20selector)\x20};\x0a\x20\x20let\x20matches\x20=\x20[];\x0a\x20\x20if\x20(keys[0]\x20===\x20\x22id\x22\x20&&\x20typeof\x20selector.id\x20===\x20\x22string\x22\x20&&\x20selector.id.length\x20>\x200)\x20matches\x20=\x20sheets.filter((sheet)\x20=>\x20sheet.getSheetId()\x20===\x20selector.id);\x0a\x20\x20else\x20if\x20(keys[0]\x20===\x20\x22name\x22\x20&&\x20typeof\x20selector.name\x20===\x20\x22string\x22\x20&&\x20selector.name.length\x20>\x200)\x20matches\x20=\x20sheets.filter((sheet)\x20=>\x20sheet.getSheetName()\x20===\x20selector.name);\x0a\x20\x20else\x20if\x20(keys[0]\x20===\x20\x22index\x22\x20&&\x20Number.isInteger(selector.index)\x20&&\x20selector.index\x20>=\x200)\x20matches\x20=\x20sheets[selector.index]\x20?\x20[sheets[selector.index]]\x20:\x20[];\x0a\x20\x20else\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Worksheet\x20selector\x20value\x20is\x20invalid\x22,\x20selector)\x20};\x0a\x20\x20if\x20(matches.length\x20===\x200)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_NOT_FOUND\x22,\x20\x22Worksheet\x20selector\x20did\x20not\x20match\x20a\x20worksheet\x22,\x20selector)\x20};\x0a\x20\x20if\x20(matches.length\x20>\x201)\x20return\x20{\x20error:\x20fail(\x22INSPECTION_SELECTOR_AMBIGUOUS\x22,\x20\x22Worksheet\x20selector\x20matched\x20more\x20than\x20one\x20worksheet\x22,\x20selector)\x20};\x0a\x20\x20const\x20sheet\x20=\x20matches[0];\x0a\x20\x20return\x20{\x20sheet,\x20index:\x20sheets.indexOf(sheet)\x20};\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22workbook\x22)\x20{\x0a\x20\x20return\x20success({\x20kind:\x20\x22workbook\x22,\x20unitId:\x20input.unitId,\x20name:\x20workbook.getName(),\x20worksheets:\x20sheets.map(worksheetOverview)\x20});\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22worksheet\x22)\x20{\x0a\x20\x20const\x20resolved\x20=\x20[];\x0a\x20\x20for\x20(const\x20selector\x20of\x20input.query.worksheets\x20||\x20[])\x20{\x0a\x20\x20\x20\x20const\x20item\x20=\x20resolveWorksheet(selector);\x0a\x20\x20\x20\x20if\x20(item.error)\x20return\x20item.error;\x0a\x20\x20\x20\x20resolved.push(worksheetOverview(item.sheet,\x20item.index));\x0a\x20\x20}\x0a\x20\x20return\x20success({\x20kind:\x20\x22worksheet\x22,\x20unitId:\x20input.unitId,\x20worksheets:\x20resolved\x20});\x0a}\x0a\x0aif\x20(input.query.kind\x20===\x20\x22worksheet-range\x22)\x20{\x0a\x20\x20const\x20resolved\x20=\x20[];\x0a\x20\x20for\x20(const\x20request\x20of\x20input.query.ranges\x20||\x20[])\x20{\x0a\x20\x20\x20\x20const\x20item\x20=\x20resolveWorksheet(request.worksheet);\x0a\x20\x20\x20\x20if\x20(item.error)\x20return\x20item.error;\x0a\x20\x20\x20\x20if\x20(typeof\x20request.range\x20!==\x20\x22string\x22\x20||\x20request.range.length\x20===\x200)\x20return\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Worksheet\x20range\x20must\x20be\x20a\x20non-empty\x20A1\x20notation\x22,\x20request);\x0a\x20\x20\x20\x20const\x20parsed\x20=\x20parseA1Range(request.range);\x0a\x20\x20\x20\x20if\x20(!parsed)\x20{\x0a\x20\x20\x20\x20\x20\x20return\x20fail(\x22INSPECTION_SELECTOR_INVALID\x22,\x20\x22Invalid\x20worksheet\x20A1\x20range:\x20\x22\x20+\x20request.range,\x20request);\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20const\x20maxRow\x20=\x20item.sheet.getMaxRows()\x20-\x201;\x0a\x20\x20\x20\x20const\x20maxColumn\x20=\x20item.sheet.getMaxColumns()\x20-\x201;\x0a\x20\x20\x20\x20if\x20(parsed.endRow\x20<\x200\x20||\x20parsed.endColumn\x20<\x200\x20||\x20parsed.startRow\x20>\x20maxRow\x20||\x20parsed.startColumn\x20>\x20maxColumn)\x20{\x0a\x20\x20\x20\x20\x20\x20return\x20fail(\x22INSPECTION_RANGE_OUT_OF_BOUNDS\x22,\x20\x22Worksheet\x20range\x20is\x20outside\x20the\x20worksheet\x20bounds:\x20\x22\x20+\x20request.range,\x20request);\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20const\x20clippedRange\x20=\x20{\x0a\x20\x20\x20\x20\x20\x20startRow:\x20Math.max(0,\x20parsed.startRow),\x0a\x20\x20\x20\x20\x20\x20endRow:\x20Math.min(maxRow,\x20parsed.endRow),\x0a\x20\x20\x20\x20\x20\x20startColumn:\x20Math.max(0,\x20parsed.startColumn),\x0a\x20\x20\x20\x20\x20\x20endColumn:\x20Math.min(maxColumn,\x20parsed.endColumn),\x0a\x20\x20\x20\x20};\x0a\x20\x20\x20\x20const\x20facadeRange\x20=\x20item.sheet.getRange(clippedRange.startRow,\x20clippedRange.startColumn,\x20clippedRange.endRow\x20-\x20clippedRange.startRow\x20+\x201,\x20clippedRange.endColumn\x20-\x20clippedRange.startColumn\x20+\x201);\x0a\x20\x20\x20\x20const\x20rawCells\x20=\x20facadeRange.getCellDatas();\x0a\x20\x20\x20\x20const\x20displayValues\x20=\x20facadeRange.getDisplayValues();\x0a\x20\x20\x20\x20const\x20cellData\x20=\x20rawCells.map((row)\x20=>\x20row.map((cell)\x20=>\x20cell\x20===\x20undefined\x20?\x20null\x20:\x20cell));\x0a\x20\x20\x20\x20const\x20clipped\x20=\x20clippedRange.startRow\x20!==\x20parsed.startRow\x20||\x20clippedRange.endRow\x20!==\x20parsed.endRow\x20||\x20clippedRange.startColumn\x20!==\x20parsed.startColumn\x20||\x20clippedRange.endColumn\x20!==\x20parsed.endColumn;\x0a\x20\x20\x20\x20resolved.push({\x0a\x20\x20\x20\x20\x20\x20worksheet:\x20worksheetIdentity(item.sheet,\x20item.index),\x0a\x20\x20\x20\x20\x20\x20requestedRange:\x20request.range,\x0a\x20\x20\x20\x20\x20\x20resolvedRange:\x20rangeNotation(clippedRange),\x0a\x20\x20\x20\x20\x20\x20clipped,\x0a\x20\x20\x20\x20\x20\x20cellData,\x0a\x20\x20\x20\x20\x20\x20displayValues,\x0a\x20\x20\x20\x20});\x0a\x20\x20}\x0a\x20\x20return\x20success({\x20kind:\x20\x22worksheet-range\x22,\x20unitId:\x20input.unitId,\x20ranges:\x20resolved\x20});\x0a}\x0a\x0areturn\x20fail(\x22INSPECTION_RESULT_INVALID\x22,\x20\x22Unsupported\x20sheet\x20inspection\x20target\x22);\x0a';}function C(_0x5e5f8f,_0x12a338){const _0x4ef969=_0x56f609;return _0x4ef969(0x1e7)+JSON[_0x4ef969(0x231)]({'query':_0x12a338,'unitId':_0x5e5f8f})+_0x4ef969(0x214);}async function w(_0x15e9c8,_0x411293){const _0x9eda31=_0x56f609;E(_0x411293),D(_0x15e9c8[_0x9eda31(0x21a)],_0x411293['kind']);let _0x1c7d6f=T(_0x15e9c8[_0x9eda31(0x228)],_0x411293),_0x2d64c5=t((await _0x15e9c8[_0x9eda31(0x1d7)]({'code':_0x1c7d6f,'mode':_0x9eda31(0x207)}))['value']);return n(_0x2d64c5,_0x411293[_0x9eda31(0x208)]),_0x2d64c5;}function T(_0x1b265e,_0x49f349){const _0x26419f=_0x56f609;switch(_0x49f349['kind']){case'workbook':case _0x26419f(0x216):case _0x26419f(0x222):return S(_0x1b265e,_0x49f349);case'document':case _0x26419f(0x1fc):return x(_0x1b265e,_0x49f349);case _0x26419f(0x226):case'slide':return C(_0x1b265e,_0x49f349);case _0x26419f(0x1f5):return y(_0x1b265e);case'board':case _0x26419f(0x21e):return b(_0x1b265e,_0x49f349);}}function E(_0xc4b66){const _0x32d1ed=_0x56f609;let _0x102b19=_0xc4b66[_0x32d1ed(0x208)]===_0x32d1ed(0x216)?_0xc4b66['worksheets']:_0xc4b66[_0x32d1ed(0x208)]===_0x32d1ed(0x222)?_0xc4b66[_0x32d1ed(0x240)]:_0xc4b66['kind']===_0x32d1ed(0x1d3)?_0xc4b66['slides']:_0xc4b66[_0x32d1ed(0x208)]===_0x32d1ed(0x1fc)?_0xc4b66[_0x32d1ed(0x1dd)]:_0xc4b66[_0x32d1ed(0x208)]===_0x32d1ed(0x21e)?_0xc4b66[_0x32d1ed(0x1d9)]:null;if(_0x102b19!==null&&_0x102b19[_0x32d1ed(0x217)]===0x0)throw new e('INSPECTION_SELECTOR_INVALID',_0xc4b66['kind']+_0x32d1ed(0x23b));}function D(_0xc59b,_0x5a5298){const _0x172718=_0x56f609;let _0x3b8390=_0x5a5298===_0x172718(0x1f5)?_0x172718(0x1f5):_0x5a5298===_0x172718(0x237)||_0x5a5298===_0x172718(0x21e)?_0x172718(0x237):_0x5a5298===_0x172718(0x1e2)||_0x5a5298===_0x172718(0x216)||_0x5a5298==='worksheet-range'?_0x172718(0x20f):_0x5a5298==='presentation'||_0x5a5298==='slide'?'slide':_0x172718(0x201);if(_0xc59b!==_0x3b8390)throw new e(_0x172718(0x1db),_0x5a5298+_0x172718(0x22a)+_0x3b8390+_0x172718(0x1cf)+_0xc59b,{'actual':_0xc59b,'expected':_0x3b8390,'kind':_0x5a5298});}export{e as ContentInspectionError,w as inspectContent};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@univer-cli/content-inspection",
3
3
  "type": "module",
4
- "version": "1.0.2",
4
+ "version": "1.0.3",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",
@@ -18,6 +18,6 @@
18
18
  "README.zh-CN.md"
19
19
  ],
20
20
  "dependencies": {
21
- "@univerjs/core": "1.0.2"
21
+ "@univerjs/core": "1.0.3"
22
22
  }
23
23
  }