const _0x3fb332=_0x5ea8;(function(_0x3f2db3,_0x25a51c){const _0x1d4385=_0x5ea8,_0x587e72=_0x3f2db3();while(!![]){try{const _0x1bc200=-parseInt(_0x1d4385(0x114))/0x1*(-parseInt(_0x1d4385(0xf1))/0x2)+-parseInt(_0x1d4385(0x1e3))/0x3*(-parseInt(_0x1d4385(0xfd))/0x4)+-parseInt(_0x1d4385(0x197))/0x5*(parseInt(_0x1d4385(0x1bf))/0x6)+-parseInt(_0x1d4385(0x1bc))/0x7+parseInt(_0x1d4385(0x13c))/0x8*(-parseInt(_0x1d4385(0x169))/0x9)+-parseInt(_0x1d4385(0xe7))/0xa+parseInt(_0x1d4385(0x19d))/0xb;if(_0x1bc200===_0x25a51c)break;else _0x587e72['push'](_0x587e72['shift']());}catch(_0xf64f6f){_0x587e72['push'](_0x587e72['shift']());}}}(_0xd81b,0x3d055));import*as _0x5cc481 from'../core/table-system/manager.js';import{log}from'../core/table-system/logger.js';import{extension_settings}from'/scripts/extensions.js';import{extensionName}from'../utils/settings.js';import{saveSettingsDebounced}from'/script.js';import{startBatchFilling}from'../core/table-system/batch-filler.js';import{DEFAULT_AI_RULE_TEMPLATE,DEFAULT_AI_FLOW_TEMPLATE}from'../core/table-system/settings.js';function _0x5ea8(_0x35c3ee,_0x8caac3){const _0xd81bbc=_0xd81b();return _0x5ea8=function(_0x5ea840,_0x3dbb41){_0x5ea840=_0x5ea840-0xe3;let _0x27615a=_0xd81bbc[_0x5ea840];return _0x27615a;},_0x5ea8(_0x35c3ee,_0x8caac3);}const getAllTablesContainer=()=>document[_0x3fb332(0x143)](_0x3fb332(0x175));function toggleRowContextMenu(_0x597439){const _0x1110de=_0x3fb332;_0x597439[_0x1110de(0x1bb)](),_0x597439[_0x1110de(0x1d3)]();const _0x279a00=_0x597439[_0x1110de(0x1d7)][_0x1110de(0xed)]('td.index-col');if(!_0x279a00)return;const _0xa74312=_0x279a00['querySelector'](_0x1110de(0x11c));if(!_0xa74312)return;const _0x4322bc=_0xa74312['classList'][_0x1110de(0x171)](_0x1110de(0x18e));document[_0x1110de(0x15a)]('.amily2-context-menu.amily2-menu-active')[_0x1110de(0xf0)](_0x2cf5ba=>{const _0x7e1aad=_0x1110de;_0x2cf5ba[_0x7e1aad(0x110)][_0x7e1aad(0x1ba)](_0x7e1aad(0x18e));});!_0x4322bc&&_0xa74312[_0x1110de(0x110)]['add']('amily2-menu-active');const _0x3574af=_0x267ae4=>{const _0x24f290=_0x1110de;!_0xa74312[_0x24f290(0x171)](_0x267ae4[_0x24f290(0x1d7)])&&(_0xa74312[_0x24f290(0x110)][_0x24f290(0x1ba)](_0x24f290(0x18e)),document[_0x24f290(0xe4)](_0x24f290(0x1ed),_0x3574af,!![]));};setTimeout(()=>{const _0x149625=_0x1110de;_0xa74312[_0x149625(0x110)]['contains'](_0x149625(0x18e))&&document[_0x149625(0x131)](_0x149625(0x1ed),_0x3574af,!![]);},0x0);}function toggleColumnContextMenu(_0x5163e8){const _0x2c8f63=_0x3fb332;_0x5163e8[_0x2c8f63(0x1bb)](),_0x5163e8[_0x2c8f63(0x1d3)]();const _0x5e46f0=_0x5163e8['target'][_0x2c8f63(0xed)]('th');if(!_0x5e46f0)return;const _0x5c7bc6=_0x5e46f0[_0x2c8f63(0x110)][_0x2c8f63(0x171)]('amily2-menu-open');document[_0x2c8f63(0x15a)]('th.amily2-menu-open')[_0x2c8f63(0xf0)](_0x4d382f=>{const _0x446fef=_0x2c8f63;_0x4d382f[_0x446fef(0x110)][_0x446fef(0x1ba)](_0x446fef(0x1c2));});!_0x5c7bc6&&_0x5e46f0['classList'][_0x2c8f63(0x160)](_0x2c8f63(0x1c2));const _0x55d9b5=_0x5249e2=>{const _0x3d2c23=_0x2c8f63;!_0x5e46f0[_0x3d2c23(0x171)](_0x5249e2['target'])&&(_0x5e46f0['classList'][_0x3d2c23(0x1ba)](_0x3d2c23(0x1c2)),document[_0x3d2c23(0xe4)](_0x3d2c23(0x1ed),_0x55d9b5,!![]));};setTimeout(()=>{const _0x321508=_0x2c8f63;_0x5e46f0[_0x321508(0x110)]['contains']('amily2-menu-open')&&document['addEventListener'](_0x321508(0x1ed),_0x55d9b5,!![]);},0x0);}function showColumnNameEditor(_0x57a436,_0x541a71,_0x101de7){const _0xa51574=_0x3fb332,_0x2d4cfb=_0xa51574(0x1ce)+_0x101de7+_0xa51574(0x14a),_0x14ee5e=$(_0x2d4cfb)['appendTo'](_0xa51574(0x19e)),_0x14de1f=_0x14ee5e[_0xa51574(0x1b0)]('#column-name-input'),_0x178fce=()=>{const _0x3b5545=_0xa51574;_0x14ee5e[0x0][_0x3b5545(0xf9)](),_0x14ee5e[_0x3b5545(0x1ba)]();};_0x14ee5e[_0xa51574(0x1b0)](_0xa51574(0x134))['on']('click',()=>{const _0x482c86=_0xa51574,_0x3c3488=_0x14de1f[_0x482c86(0x16b)]()[_0x482c86(0x198)]();if(_0x3c3488&&_0x3c3488!==_0x101de7)_0x5cc481[_0x482c86(0x100)](_0x57a436,_0x541a71,_0x3c3488),renderTables(),toastr[_0x482c86(0x193)](_0x482c86(0x1a7)+_0x3c3488+'\x22');else{if(!_0x3c3488){toastr[_0x482c86(0xe3)](_0x482c86(0x156)),_0x14de1f[_0x482c86(0x1eb)]();return;}}_0x178fce();}),_0x14ee5e[_0xa51574(0x1b0)]('.popup-button-cancel')['on']('click',_0x178fce),_0x14de1f['on'](_0xa51574(0x155),_0x84e050=>{const _0x45b6d6=_0xa51574;_0x84e050[_0x45b6d6(0x1e0)]===0xd&&_0x14ee5e['find'](_0x45b6d6(0x134))[_0x45b6d6(0x1ed)]();}),_0x14de1f['on']('keydown',_0x41555b=>{const _0x4ce23a=_0xa51574;_0x41555b[_0x4ce23a(0x1e0)]===0x1b&&_0x178fce();}),_0x14ee5e[0x0][_0xa51574(0x1a0)](),_0x14de1f[_0xa51574(0x1eb)]()[_0xa51574(0x1e1)]();}function positionContextMenu(_0x2df2b7,_0x4d16cd){const _0x533c60=_0x3fb332;_0x2df2b7[_0x533c60(0x12e)][_0x533c60(0x14f)]=_0x533c60(0x127),_0x2df2b7[_0x533c60(0x12e)][_0x533c60(0x1a2)]=_0x533c60(0x1ab),_0x2df2b7['style'][_0x533c60(0x16f)]='0',_0x2df2b7[_0x533c60(0x12e)][_0x533c60(0xe9)]=_0x533c60(0x1d2),_0x2df2b7[_0x533c60(0x12e)][_0x533c60(0x1cf)]='',_0x2df2b7[_0x533c60(0x12e)][_0x533c60(0x13a)]='',_0x2df2b7[_0x533c60(0x12e)][_0x533c60(0x15d)]='',_0x2df2b7['style']['overflowY']='';const _0xf12810=window[_0x533c60(0x12c)],_0x224021=_0x4d16cd['getBoundingClientRect'](),_0x5731a8=0xc8,_0x48ab77=_0x4d16cd[_0x533c60(0xed)]('.hly-scroll'),_0x1866d4=_0x48ab77?_0x48ab77[_0x533c60(0x11f)]():{'top':0x0,'bottom':_0xf12810},_0x936bdf=Math[_0x533c60(0x128)](_0xf12810,_0x1866d4['bottom'])-_0x224021[_0x533c60(0x182)],_0x817e9d=_0x224021[_0x533c60(0xe5)]-Math['max'](0x0,_0x1866d4[_0x533c60(0xe5)]);_0x936bdf<_0x5731a8&&_0x817e9d>_0x936bdf?(_0x2df2b7[_0x533c60(0x12e)][_0x533c60(0xe5)]=_0x533c60(0x1d2),_0x2df2b7['style'][_0x533c60(0x182)]=_0x533c60(0x142),_0x2df2b7[_0x533c60(0x12e)][_0x533c60(0x13a)]=_0x533c60(0x13f)):(_0x2df2b7['style'][_0x533c60(0xe5)]=_0x533c60(0x142),_0x2df2b7[_0x533c60(0x12e)][_0x533c60(0x182)]='auto',_0x2df2b7[_0x533c60(0x12e)][_0x533c60(0x1cf)]='2px');const _0xf99fc4=0xa0,_0x5aa737=_0x4d16cd['closest'](_0x533c60(0x1d9)),_0x36a2e5=_0x5aa737?_0x5aa737['closest']('div[style*=\x22overflowX\x22]'):null;if(_0x36a2e5){const _0x261c8c=_0x36a2e5[_0x533c60(0x11f)](),_0x4e1372=_0x224021['left']-_0x261c8c[_0x533c60(0x16f)];_0x4e1372+_0xf99fc4>_0x261c8c[_0x533c60(0x1b5)]-0x14&&(_0x2df2b7[_0x533c60(0x12e)][_0x533c60(0x16f)]=_0x533c60(0x1d2),_0x2df2b7['style']['right']='0');}}function _0xd81b(){const _0x20501f=['dataset','input[name=\x22filling-mode\x22]','button','startFloorRangeFilling','表格系统总开关已关闭,请先启用总开关。','.move-table-up-btn','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','add-left','colIndex','【最终警告】您确定要永久废黜表格\x20“[','error','classList','#rule-note','table-controls','您确定要将规则提示词恢复为默认设置吗?','393QAoIHs','向左移动','note','currentEventBound','在上加行','depth','amily2-context-menu','loadTables','.amily2-context-menu','delete','add-below','getBoundingClientRect','down','fa-plus-circle','流程提示词已保存。','createElement','table-injection-depth','appendTo','在左加列','absolute','min','0.5','contenteditable','addTable','innerHeight','filling_mode','style','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20