','placeholder','hly-embedding-model','请先选择一个书库并至少选择一个要编纂的条目。','.hly-exclusion-rule-row','count','[实时刷新]\x20批次完成,忆识总数已更新。','hly-tag-input','hanlinyuan-ingest-novel-file-name','\x20楼的内容(共\x20','会话已锁定到宝库:\x20','hly-current-character-name'];_0x242e=function(){return _0x18c636;};return _0x242e();}function saveSettingsFromUI(_0x53620a=!![]){const _0x372568=_0x4b9993,_0x4b4639=document['getElementById'](_0x372568(0x32d));if(!_0x4b4639)return;const _0x23ca87=_0x4b4639[_0x372568(0x2c9)](_0x372568(0x1e4));_0x23ca87[_0x372568(0x1c6)](_0x40ba53=>{const _0x18cc80=_0x372568,_0x3bfe24=_0x40ba53[_0x18cc80(0x329)]['settingKey'];if(!_0x3bfe24)return;let _0x52a1d0;const _0x38ba72=_0x40ba53[_0x18cc80(0x329)][_0x18cc80(0x279)]||'string';if(_0x40ba53['type']===_0x18cc80(0x266))_0x52a1d0=_0x40ba53[_0x18cc80(0x27e)];else{if(_0x40ba53[_0x18cc80(0x279)]===_0x18cc80(0x1f4)){if(!_0x40ba53[_0x18cc80(0x27e)])return;_0x52a1d0=_0x40ba53[_0x18cc80(0x20b)];}else _0x52a1d0=_0x40ba53['value'];}switch(_0x38ba72){case _0x18cc80(0x1d0):_0x52a1d0=parseInt(_0x52a1d0,0xa);break;case _0x18cc80(0x1f6):_0x52a1d0=parseFloat(_0x52a1d0);break;case _0x18cc80(0x1ff):if(typeof _0x52a1d0!==_0x18cc80(0x1ff))_0x52a1d0=_0x52a1d0===_0x18cc80(0x24b);break;}const _0x545a6c=_0x753c4[_0x18cc80(0x231)](),_0xc788a3=_0x3bfe24['split']('.');let _0x2eda2c=_0x545a6c;for(let _0x1ec80a=0x0;_0x1ec80a<_0xc788a3[_0x18cc80(0x273)]-0x1;_0x1ec80a++){_0x2eda2c=_0x2eda2c[_0xc788a3[_0x1ec80a]]=_0x2eda2c[_0xc788a3[_0x1ec80a]]||{};}_0x2eda2c[_0xc788a3[_0xc788a3[_0x18cc80(0x273)]-0x1]]=_0x52a1d0;}),_0x753c4['saveSettings'](),!_0x53620a&&(log(_0x372568(0x1e3),'success'),toastr['success'](_0x372568(0x2bd),'圣旨已达'));}function resetSettingsToUI(){const _0x3c3dc4=_0x4b9993;confirm(_0x3c3dc4(0x210))&&(_0x753c4[_0x3c3dc4(0x364)](),loadSettingsToUI(),toastr[_0x3c3dc4(0x206)](_0x3c3dc4(0x2a8),'诏曰'));}async function updatePanelStatus(){const _0x88065c=_0x4b9993,_0x201d5d=_0x753c4[_0x88065c(0x1ee)](),_0x1730cf=document[_0x88065c(0x292)](_0x88065c(0x350)),_0x463509=document[_0x88065c(0x292)](_0x88065c(0x2af));if(_0x201d5d){const _0x171ed2=_0x753c4['getLockedSessionInfo']();_0x171ed2&&(_0x1730cf['textContent']='会话已锁定',_0x463509['textContent']=_0x171ed2['id'],_0x463509['title']=_0x88065c(0x26e)+_0x171ed2['id'],_0x1730cf[_0x88065c(0x223)][_0x88065c(0x1ed)](_0x88065c(0x354)),_0x463509[_0x88065c(0x223)][_0x88065c(0x1ed)](_0x88065c(0x354)));}else _0x1730cf[_0x88065c(0x2ce)]=_0x57912b[_0x88065c(0x224)](),_0x463509['textContent']=_0x57912b[_0x88065c(0x25d)]()||'无',_0x463509[_0x88065c(0x368)]='',_0x1730cf[_0x88065c(0x223)]['remove'](_0x88065c(0x354)),_0x463509[_0x88065c(0x223)][_0x88065c(0x24e)](_0x88065c(0x354));const _0x341774=document[_0x88065c(0x292)](_0x88065c(0x261));_0x341774[_0x88065c(0x2ce)]=_0x88065c(0x21b);try{const _0x296c96=await _0x753c4[_0x88065c(0x287)]();_0x341774[_0x88065c(0x2ce)]=_0x296c96;}catch(_0x3341f6){console[_0x88065c(0x288)]('[翰林院-枢纽]\x20更新忆识数量失败:',_0x3341f6),_0x341774['textContent']=_0x88065c(0x2e0),_0x341774[_0x88065c(0x368)]=_0x88065c(0x2d5)+_0x3341f6[_0x88065c(0x216)];}const _0x1b11d1=document['getElementById']('hly-condensation-results');if(_0x1b11d1&&!_0x1b11d1['dataset'][_0x88065c(0x1f1)]){const _0x21d041=_0x753c4[_0x88065c(0x231)](),_0x3e129e=await _0x753c4[_0x88065c(0x1ea)]();if(_0x21d041[_0x88065c(0x33a)]&&_0x21d041[_0x88065c(0x33a)][_0x3e129e]){const _0x54188c=_0x21d041[_0x88065c(0x33a)][_0x3e129e];_0x1b11d1[_0x88065c(0x1ec)]='
上次已从第\x20'+_0x54188c['start']+_0x88065c(0x36d)+_0x54188c['end']+_0x88065c(0x338);}else _0x1b11d1[_0x88065c(0x1ec)]=_0x88065c(0x21e);}renderKnowledgeBases();}async function deleteAllKnowledgeBases(){const _0x3f91ef=_0x4b9993,_0x33b210=await _0x753c4[_0x3f91ef(0x32a)](),_0x4fe09e=Object[_0x3f91ef(0x30d)](_0x33b210);if(_0x4fe09e['length']===0x0){toastr[_0x3f91ef(0x206)](_0x3f91ef(0x1eb),'圣谕');return;}if(!confirm(_0x3f91ef(0x319)+_0x4fe09e['length']+_0x3f91ef(0x2f0)))return;toastr[_0x3f91ef(0x206)](_0x3f91ef(0x2c6)+_0x4fe09e['length']+'\x20个知识库。','圣旨'),log(_0x3f91ef(0x356)+_0x4fe09e['length']+'\x20个知识库...',_0x3f91ef(0x323));let _0x103faf=0x0,_0x2bdc71=0x0;for(const _0x139939 of _0x4fe09e){try{await _0x753c4[_0x3f91ef(0x2dc)](_0x139939),_0x103faf++;}catch(_0x201521){_0x2bdc71++,log(_0x3f91ef(0x244)+_0x139939+'\x20失败:\x20'+_0x201521[_0x3f91ef(0x216)],'error');}}_0x2bdc71>0x0?toastr[_0x3f91ef(0x288)](_0x3f91ef(0x1e1)+_0x2bdc71+_0x3f91ef(0x2bb),'警报'):toastr[_0x3f91ef(0x22b)]('所有\x20'+_0x103faf+_0x3f91ef(0x2a2),_0x3f91ef(0x229)),log('批量删除完成。成功:\x20'+_0x103faf+_0x3f91ef(0x20f)+_0x2bdc71,_0x3f91ef(0x206)),await updatePanelStatus();}async function renderKnowledgeBases(){const _0x5b1c59=_0x4b9993,_0xd49703=document[_0x5b1c59(0x292)](_0x5b1c59(0x29a));if(!_0xd49703)return;try{const _0x3124e7=await _0x753c4['getKnowledgeBases']();_0xd49703['innerHTML']='';if(Object[_0x5b1c59(0x30d)](_0x3124e7)[_0x5b1c59(0x273)]===0x0){_0xd49703[_0x5b1c59(0x1ec)]=_0x5b1c59(0x316);return;}for(const [_0x279ae7,_0x4ffb70]of Object[_0x5b1c59(0x29b)](_0x3124e7)){const _0x6ada35=document[_0x5b1c59(0x2a4)](_0x5b1c59(0x260));_0x6ada35[_0x5b1c59(0x2b8)]=_0x5b1c59(0x238),_0x6ada35[_0x5b1c59(0x329)]['kbId']=_0x279ae7;const _0x1e5585=await _0x753c4[_0x5b1c59(0x287)](_0x279ae7);_0x6ada35['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x4ffb70['name']+'\x20('+_0x1e5585+_0x5b1c59(0x29e)+(_0x4ffb70[_0x5b1c59(0x1f0)]?_0x5b1c59(0x27e):'')+_0x5b1c59(0x251),_0xd49703[_0x5b1c59(0x309)](_0x6ada35);}_0xd49703[_0x5b1c59(0x2c9)](_0x5b1c59(0x255))[_0x5b1c59(0x1c6)](_0xca85f6=>{const _0x5e0f89=_0x5b1c59;_0xca85f6[_0x5e0f89(0x252)](_0x5e0f89(0x230),async _0x1eede5=>{const _0x3d0ba5=_0x5e0f89,_0x1a52a5=_0x1eede5[_0x3d0ba5(0x280)][_0x3d0ba5(0x362)](_0x3d0ba5(0x284))[_0x3d0ba5(0x329)][_0x3d0ba5(0x1de)],_0x352b67=_0x1eede5[_0x3d0ba5(0x280)][_0x3d0ba5(0x27e)];await _0x753c4[_0x3d0ba5(0x1fe)](_0x1a52a5,_0x352b67),log(_0x3d0ba5(0x28b)+_0x1a52a5+'\x20已'+(_0x352b67?'启用':'禁用'),_0x3d0ba5(0x22b)),updatePanelStatus();});}),_0xd49703['querySelectorAll'](_0x5b1c59(0x30f))[_0x5b1c59(0x1c6)](_0x5e63b2=>{const _0x53bb19=_0x5b1c59;_0x5e63b2[_0x53bb19(0x252)](_0x53bb19(0x1be),async _0x223fdc=>{const _0x26cab4=_0x53bb19,_0x266213=_0x223fdc[_0x26cab4(0x280)][_0x26cab4(0x362)](_0x26cab4(0x284)),_0x3df6ef=_0x266213[_0x26cab4(0x329)][_0x26cab4(0x1de)],_0x219b7b=_0x266213[_0x26cab4(0x2eb)]('.hly-kb-name')[_0x26cab4(0x2ce)][_0x26cab4(0x275)]('\x20(')[0x0];if(confirm(_0x26cab4(0x274)+_0x219b7b+_0x26cab4(0x22d)))try{await _0x753c4[_0x26cab4(0x2dc)](_0x3df6ef),log('知识库\x20'+_0x219b7b+_0x26cab4(0x2c4)+_0x3df6ef+_0x26cab4(0x325),_0x26cab4(0x22b)),toastr['success']('知识库【'+_0x219b7b+_0x26cab4(0x236)),updatePanelStatus();}catch(_0x5afc89){log('删除知识库\x20'+_0x219b7b+_0x26cab4(0x227)+_0x5afc89[_0x26cab4(0x216)],'error'),toastr[_0x26cab4(0x288)](_0x26cab4(0x2f7)+_0x5afc89[_0x26cab4(0x216)]);}});});}catch(_0x26f1f9){console[_0x5b1c59(0x288)](_0x5b1c59(0x2c7),_0x26f1f9),_0xd49703[_0x5b1c59(0x1ec)]=_0x5b1c59(0x352)+_0x26f1f9[_0x5b1c59(0x216)]+'
';}}async function testApi(){const _0x30f2f6=_0x4b9993;toastr[_0x30f2f6(0x206)](_0x30f2f6(0x277),'圣旨');try{await _0x753c4[_0x30f2f6(0x2ea)](),toastr['success'](_0x30f2f6(0x2cf),'圣意');}catch(_0x1c247e){toastr[_0x30f2f6(0x288)](_0x30f2f6(0x2a7)+_0x1c247e[_0x30f2f6(0x216)],'警报');}}async function fetchHLYEmbeddingModels(){const _0x574995=_0x4b9993,_0x2e666a=document['getElementById'](_0x574995(0x347)),_0x498540=_0x2e666a[_0x574995(0x20b)];_0x2e666a['innerHTML']='
',_0x2e666a['disabled']=!![];try{log(_0x574995(0x26f),_0x574995(0x206));const _0x508fcb=await _0x753c4[_0x574995(0x278)]();_0x2e666a[_0x574995(0x1ec)]='';if(_0x508fcb[_0x574995(0x273)]===0x0){_0x2e666a['innerHTML']=_0x574995(0x2b4),toastr['warn'](_0x574995(0x317),_0x574995(0x264)),log(_0x574995(0x317),'warn');return;}_0x508fcb[_0x574995(0x1c6)](_0x434778=>{const _0xfc55ca=new Option(_0x434778,_0x434778);_0x2e666a['add'](_0xfc55ca);}),_0x508fcb[_0x574995(0x202)](_0x498540)?_0x2e666a[_0x574995(0x20b)]=_0x498540:_0x2e666a[_0x574995(0x35c)]=0x0,toastr[_0x574995(0x22b)](_0x574995(0x303)+_0x508fcb[_0x574995(0x273)]+_0x574995(0x322),'圣意'),log(_0x574995(0x303)+_0x508fcb[_0x574995(0x273)]+'\x20个模型。',_0x574995(0x22b));}catch(_0x2a9e3c){console[_0x574995(0x288)]('[翰林院-枢纽]\x20获取模型列表失败:',_0x2a9e3c),toastr[_0x574995(0x288)](_0x574995(0x30a)+_0x2a9e3c[_0x574995(0x216)],_0x574995(0x1ef)),log(_0x574995(0x30a)+_0x2a9e3c['message'],_0x574995(0x288)),_0x2e666a[_0x574995(0x1ec)]=_0x574995(0x24d);}finally{_0x2e666a[_0x574995(0x1fa)]=![];}}async function fetchHLYRerankModels(){const _0xcdabcc=_0x4b9993,_0x283706=document[_0xcdabcc(0x292)](_0xcdabcc(0x240)),_0x2a241f=_0x283706[_0xcdabcc(0x20b)];_0x283706['innerHTML']='
',_0x283706[_0xcdabcc(0x1fa)]=!![];try{log(_0xcdabcc(0x326),_0xcdabcc(0x206));const _0xaa6c23=await _0x753c4[_0xcdabcc(0x301)]();_0x283706[_0xcdabcc(0x1ec)]='';if(_0xaa6c23[_0xcdabcc(0x273)]===0x0){_0x283706[_0xcdabcc(0x1ec)]='
',toastr[_0xcdabcc(0x323)](_0xcdabcc(0x21f),_0xcdabcc(0x264)),log(_0xcdabcc(0x21f),_0xcdabcc(0x323));return;}_0xaa6c23[_0xcdabcc(0x1c6)](_0x1bfeb6=>{const _0xaa60fb=_0xcdabcc,_0x15249a=new Option(_0x1bfeb6,_0x1bfeb6);_0x283706[_0xaa60fb(0x1ed)](_0x15249a);}),_0xaa6c23[_0xcdabcc(0x202)](_0x2a241f)?_0x283706[_0xcdabcc(0x20b)]=_0x2a241f:_0x283706[_0xcdabcc(0x35c)]=0x0,toastr[_0xcdabcc(0x22b)](_0xcdabcc(0x303)+_0xaa6c23['length']+_0xcdabcc(0x2bf),'圣意'),log(_0xcdabcc(0x303)+_0xaa6c23[_0xcdabcc(0x273)]+_0xcdabcc(0x2bf),_0xcdabcc(0x22b));}catch(_0x529309){console[_0xcdabcc(0x288)]('[翰林院-枢纽]\x20获取Rerank模型列表失败:',_0x529309),toastr[_0xcdabcc(0x288)]('获取Rerank模型失败:\x20'+_0x529309[_0xcdabcc(0x216)],_0xcdabcc(0x1ef)),log(_0xcdabcc(0x262)+_0x529309[_0xcdabcc(0x216)],_0xcdabcc(0x288)),_0x283706[_0xcdabcc(0x1ec)]=_0xcdabcc(0x24d);}finally{_0x283706[_0xcdabcc(0x1fa)]=![];}}async function purgeStorage(){const _0xb1ad7d=_0x4b9993;if(confirm('此操作将彻底清空当前角色的所有忆识(向量),且无法恢复。您确定要继续吗?')){toastr[_0xb1ad7d(0x206)](_0xb1ad7d(0x2ba),'圣旨');const _0x3f48a4=await _0x753c4['purgeStorage']();_0x3f48a4?toastr[_0xb1ad7d(0x22b)](_0xb1ad7d(0x25b),'圣意'):toastr[_0xb1ad7d(0x288)](_0xb1ad7d(0x293),'警报'),await updatePanelStatus();}}async function startCondensation(){const _0x1a947d=_0x4b9993,_0xc7ed0b=document[_0x1a947d(0x292)]('hly-condensation-results'),_0x55dba1=_0xc7ed0b[_0x1a947d(0x329)][_0x1a947d(0x2e9)],_0x446515=document['getElementById']('hly-layer-start')[_0x1a947d(0x20b)],_0x42bc76=document[_0x1a947d(0x292)](_0x1a947d(0x23c))[_0x1a947d(0x20b)],_0x11e1af={'start':parseInt(_0x446515),'end':parseInt(_0x42bc76)};try{let _0x484109;_0x55dba1?(log(_0x1a947d(0x305),'info'),toastr[_0x1a947d(0x206)](_0x1a947d(0x344),'圣旨'),_0x484109=JSON['parse'](_0x55dba1),delete _0xc7ed0b['dataset'][_0x1a947d(0x2e9)]):(log(_0x1a947d(0x24f),'info'),toastr[_0x1a947d(0x206)](_0x1a947d(0x2e8),'圣旨'),_0x484109=_0x753c4[_0x1a947d(0x2fa)]());if(!_0x484109||_0x484109['length']===0x0){toastr[_0x1a947d(0x1ce)]('未找到符合条件的消息可供凝识。','翰林院启奏'),_0xc7ed0b[_0x1a947d(0x2ce)]=_0x1a947d(0x1ba);return;}_0xc7ed0b[_0x1a947d(0x2ce)]='已采集\x20'+_0x484109[_0x1a947d(0x273)]+_0x1a947d(0x32b),toastr[_0x1a947d(0x206)](_0x1a947d(0x226)+_0x484109[_0x1a947d(0x273)]+_0x1a947d(0x32b),_0x1a947d(0x264));const _0x3de712=await _0x753c4[_0x1a947d(0x23b)](_0x484109,log,_0x11e1af);if(_0x3de712['success']){toastr[_0x1a947d(0x22b)](_0x1a947d(0x2e4)+_0x3de712['count']+_0x1a947d(0x254),'大功告成');const _0x22ac0b=_0x11e1af[_0x1a947d(0x215)]===0x0?getContext()[_0x1a947d(0x245)]['length']:_0x11e1af[_0x1a947d(0x215)];_0xc7ed0b[_0x1a947d(0x2ce)]=_0x1a947d(0x2cb)+_0x11e1af[_0x1a947d(0x295)]+_0x1a947d(0x212)+_0x22ac0b+_0x1a947d(0x247)+_0x3de712[_0x1a947d(0x34a)]+_0x1a947d(0x254);}else throw new Error(_0x3de712[_0x1a947d(0x288)]||_0x1a947d(0x307));}catch(_0x135a02){console[_0x1a947d(0x288)]('[翰林院-枢纽]\x20凝识过程发生错误:',_0x135a02),toastr[_0x1a947d(0x288)](_0x1a947d(0x327)+_0x135a02['message'],'严重错误'),_0xc7ed0b[_0x1a947d(0x2ce)]=_0x1a947d(0x327)+_0x135a02[_0x1a947d(0x216)];}finally{await updatePanelStatus();}}function _0x2c1a(_0x3c61eb,_0x384ef6){const _0x242e25=_0x242e();return _0x2c1a=function(_0x2c1ae9,_0x211f22){_0x2c1ae9=_0x2c1ae9-0x1b9;let _0x45a560=_0x242e25[_0x2c1ae9];return _0x45a560;},_0x2c1a(_0x3c61eb,_0x384ef6);}async function loadWorldbookList(){const _0x26a16b=_0x4b9993,_0x400be3=document[_0x26a16b(0x292)](_0x26a16b(0x297));if(!_0x400be3)return;try{log(_0x26a16b(0x20c),_0x26a16b(0x206));const _0x67c573=await _0x5408b8[_0x26a16b(0x339)]();_0x400be3[_0x26a16b(0x1ec)]=_0x26a16b(0x314);if(_0x67c573[_0x26a16b(0x273)]===0x0){_0x400be3[_0x26a16b(0x1ec)]=_0x26a16b(0x1d1);return;}_0x67c573[_0x26a16b(0x1c6)](_0x41bc6b=>{const _0x1aaa83=new Option(_0x41bc6b,_0x41bc6b);_0x400be3['add'](_0x1aaa83);}),log(_0x26a16b(0x26b)+_0x67c573[_0x26a16b(0x273)]+_0x26a16b(0x2ff),_0x26a16b(0x22b));}catch(_0x50710a){console[_0x26a16b(0x288)](_0x26a16b(0x269),_0x50710a),log(_0x26a16b(0x1fd)+_0x50710a['message'],_0x26a16b(0x288)),_0x400be3[_0x26a16b(0x1ec)]=_0x26a16b(0x359);}}async function handleWorldbookSelectionChange(){const _0x44bafe=_0x4b9993,_0x2e4a2d=document[_0x44bafe(0x292)](_0x44bafe(0x297)),_0x3a5277=document[_0x44bafe(0x292)](_0x44bafe(0x308)),_0x4e2bf1=document[_0x44bafe(0x292)](_0x44bafe(0x207)),_0x25deba=_0x2e4a2d[_0x44bafe(0x20b)];_0x3a5277[_0x44bafe(0x1fa)]=!![],_0x3a5277['querySelector'](_0x44bafe(0x26c))[_0x44bafe(0x2ce)]=_0x44bafe(0x2f5),_0x4e2bf1[_0x44bafe(0x1ec)]='',_0x4e2bf1[_0x44bafe(0x1f5)][_0x44bafe(0x328)]='none';if(!_0x25deba){_0x3a5277[_0x44bafe(0x2eb)](_0x44bafe(0x26c))['textContent']='请先选择书库';return;}try{log(_0x44bafe(0x35a)+_0x25deba+_0x44bafe(0x366),_0x44bafe(0x206));const _0x4282b7=await _0x5408b8[_0x44bafe(0x33f)](_0x25deba);if(_0x4282b7['length']===0x0){_0x3a5277[_0x44bafe(0x2eb)](_0x44bafe(0x26c))['textContent']=_0x44bafe(0x2e5);return;}const _0x418689='\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
';_0x4e2bf1[_0x44bafe(0x1d5)]('beforeend',_0x418689),_0x4282b7['forEach'](_0x5cf193=>{const _0x503a2b=_0x44bafe,_0x44c12c=_0x503a2b(0x1cc)+_0x5cf193[_0x503a2b(0x357)]+_0x503a2b(0x286)+_0x5cf193[_0x503a2b(0x330)]+')\x22>\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';_0x4e2bf1[_0x503a2b(0x1d5)]('beforeend',_0x44c12c);}),log(_0x44bafe(0x26b)+_0x4282b7['length']+_0x44bafe(0x25e),_0x44bafe(0x22b)),_0x3a5277[_0x44bafe(0x2eb)](_0x44bafe(0x26c))[_0x44bafe(0x2ce)]='已选择\x200\x20/\x20'+_0x4282b7[_0x44bafe(0x273)]+_0x44bafe(0x2fb);}catch(_0x1d4a32){console[_0x44bafe(0x288)](_0x44bafe(0x29c)+_0x25deba+_0x44bafe(0x268),_0x1d4a32),log(_0x44bafe(0x299)+_0x1d4a32[_0x44bafe(0x216)],_0x44bafe(0x288)),_0x3a5277[_0x44bafe(0x2eb)](_0x44bafe(0x26c))['textContent']=_0x44bafe(0x1c7);}finally{_0x3a5277['disabled']=![];}}async function startHistoriography(){const _0x52d87f=_0x4b9993,_0x277461=document[_0x52d87f(0x292)](_0x52d87f(0x297))[_0x52d87f(0x20b)],_0x2e6f7b=document[_0x52d87f(0x292)](_0x52d87f(0x207)),_0x24da76=document[_0x52d87f(0x292)](_0x52d87f(0x334)),_0x378d0b=Array['from'](_0x2e6f7b[_0x52d87f(0x2c9)](_0x52d87f(0x26d)))[_0x52d87f(0x21c)](_0x423246=>_0x423246[_0x52d87f(0x20b)]);if(!_0x277461||_0x378d0b['length']===0x0){toastr[_0x52d87f(0x1ce)](_0x52d87f(0x348),_0x52d87f(0x363));return;}_0x24da76[_0x52d87f(0x2ce)]=_0x52d87f(0x222)+_0x277461+_0x52d87f(0x22e)+_0x378d0b['length']+_0x52d87f(0x1cb),toastr[_0x52d87f(0x206)](_0x52d87f(0x332),'圣旨'),log('开始对《'+_0x277461+'》中的\x20'+_0x378d0b[_0x52d87f(0x273)]+_0x52d87f(0x241),_0x52d87f(0x206));try{const _0xf4bd25=await _0x5408b8[_0x52d87f(0x290)](_0x277461,_0x378d0b);_0x24da76['textContent']=_0xf4bd25[_0x52d87f(0x283)],_0xf4bd25[_0x52d87f(0x22b)]?toastr[_0x52d87f(0x22b)](_0x52d87f(0x200),_0x52d87f(0x229)):toastr[_0x52d87f(0x1ce)](_0x52d87f(0x2db),'圣谕'),log('对《'+_0x277461+_0x52d87f(0x246)+_0xf4bd25['totalSuccess']+_0x52d87f(0x29d)+_0xf4bd25['totalVectors'],_0x52d87f(0x22b));}catch(_0xe2e1a5){console[_0x52d87f(0x288)](_0x52d87f(0x1c2),_0xe2e1a5),toastr[_0x52d87f(0x288)](_0x52d87f(0x312)+_0xe2e1a5[_0x52d87f(0x216)],'严重错误'),_0x24da76['textContent']=_0x52d87f(0x312)+_0xe2e1a5[_0x52d87f(0x216)];}finally{await updatePanelStatus();}}async function showStats(){const _0x131238=_0x4b9993;try{log('用户请求查看宝库状态。',_0x131238(0x206)),toastr[_0x131238(0x206)]('正在查询宝库状态...','圣旨');const _0x42e4e3=await _0x753c4[_0x131238(0x287)](),_0x53e79f=await _0x753c4[_0x131238(0x1ea)](),_0x448de9=_0x753c4['getSettings'](),_0x46f4b3=_0x131238(0x340)+_0x53e79f+'\x0a忆识总数:\x20'+_0x42e4e3+_0x131238(0x1f3)+_0x448de9[_0x131238(0x228)][_0x131238(0x2f4)]+_0x131238(0x25f)+_0x448de9[_0x131238(0x228)]['embeddingModel']+_0x131238(0x27c);toastr[_0x131238(0x206)](_0x46f4b3,_0x131238(0x213),{'timeOut':0x3a98,'extendedTimeOut':0x1388,'tapToDismiss':!![],'closeButton':!![]}),log(_0x131238(0x1d2)+_0x53e79f+_0x131238(0x33b)+_0x42e4e3,_0x131238(0x22b));}catch(_0x557465){console[_0x131238(0x288)](_0x131238(0x1c1),_0x557465),toastr[_0x131238(0x288)]('查询宝库状态失败:\x20'+_0x557465[_0x131238(0x216)],_0x131238(0x1ef)),log('查询宝库状态失败:\x20'+_0x557465[_0x131238(0x216)],_0x131238(0x288));}}function showExclusionRulesModal(){const _0x3fe3c8=_0x4b9993,_0x3cb188=_0x753c4[_0x3fe3c8(0x231)](),_0x4339a6=_0x3cb188[_0x3fe3c8(0x220)][_0x3fe3c8(0x20e)]||[],_0x2f8621=(_0x3171eb={'start':'','end':''},_0x36497d)=>_0x3fe3c8(0x2be)+_0x36497d+_0x3fe3c8(0x2ca)+_0x3171eb[_0x3fe3c8(0x295)]+_0x3fe3c8(0x271)+_0x3171eb[_0x3fe3c8(0x215)]+_0x3fe3c8(0x2ac),_0x277611=_0x4339a6[_0x3fe3c8(0x21c)](_0x2f8621)['join'](''),_0x35e47d=_0x3fe3c8(0x345)+_0x277611+_0x3fe3c8(0x28c);showHtmlModal(_0x3fe3c8(0x21d),_0x35e47d,{'okText':_0x3fe3c8(0x1c3),'onOk':_0x3ef523=>{const _0x96c686=_0x3fe3c8,_0x4a4ebe=[];_0x3ef523[_0x96c686(0x336)](_0x96c686(0x349))['each'](function(){const _0x3f4df9=_0x96c686,_0x2ff650=$(this)['find']('input')['eq'](0x0)[_0x3f4df9(0x221)]()['trim'](),_0x3c3079=$(this)['find'](_0x3f4df9(0x2f8))['eq'](0x1)['val']()['trim']();_0x2ff650&&_0x3c3079&&_0x4a4ebe[_0x3f4df9(0x2ec)]({'start':_0x2ff650,'end':_0x3c3079});}),updateAndSaveSetting(_0x96c686(0x2d7),_0x4a4ebe),toastr[_0x96c686(0x22b)](_0x96c686(0x27a),'圣旨已达');}});const _0x109df9=document[_0x3fe3c8(0x292)]('hly-exclusion-rules-container'),_0x4fbc1a=_0x109df9['querySelector'](_0x3fe3c8(0x2c0));_0x109df9[_0x3fe3c8(0x2eb)](_0x3fe3c8(0x22a))['addEventListener']('click',()=>{const _0x153066=_0x3fe3c8,_0x331189=_0x4fbc1a['children'][_0x153066(0x273)],_0x266bd2=_0x2f8621({'start':'','end':''},_0x331189);_0x4fbc1a[_0x153066(0x1d5)](_0x153066(0x20a),_0x266bd2);}),_0x4fbc1a['addEventListener'](_0x3fe3c8(0x1be),_0x41a542=>{const _0x52528d=_0x3fe3c8;_0x41a542[_0x52528d(0x280)]['classList']['contains']('hly-delete-rule-btn')&&_0x41a542[_0x52528d(0x280)][_0x52528d(0x362)](_0x52528d(0x349))[_0x52528d(0x24e)]();});}function previewCondensation(){const _0x40756f=_0x4b9993,_0x254a98=document['getElementById'](_0x40756f(0x33c));try{const _0x320842=_0x753c4[_0x40756f(0x231)](),_0x53537b=_0x320842[_0x40756f(0x220)][_0x40756f(0x20e)]||[],_0x23ff07={'user':document[_0x40756f(0x292)](_0x40756f(0x259))[_0x40756f(0x27e)],'ai':document[_0x40756f(0x292)]('hly-include-ai')[_0x40756f(0x27e)]},_0x3d8a71=document[_0x40756f(0x292)](_0x40756f(0x35f))[_0x40756f(0x27e)],_0x4997d6=_0x3d8a71?document[_0x40756f(0x292)](_0x40756f(0x34c))[_0x40756f(0x20b)][_0x40756f(0x275)](',')[_0x40756f(0x21c)](_0x2c8459=>_0x2c8459['trim']())[_0x40756f(0x2a9)](Boolean):[],_0x207c84=_0x753c4[_0x40756f(0x2fa)](_0x23ff07);if(!_0x207c84||_0x207c84[_0x40756f(0x273)]===0x0){_0x254a98[_0x40756f(0x2ce)]=_0x40756f(0x2d6),toastr[_0x40756f(0x1ce)](_0x40756f(0x1ba),_0x40756f(0x264));return;}const _0x5e0d83=getContext()[_0x40756f(0x245)],_0xe03599=_0x207c84[_0x40756f(0x21c)]((_0x1e4171,_0x5c933d)=>{const _0x2e305a=_0x40756f;let _0x139cb0;if(_0x1e4171[_0x2e305a(0x361)])_0x139cb0=_0x1e4171[_0x2e305a(0x2a3)];else{if(_0x3d8a71&&_0x4997d6[_0x2e305a(0x273)]>0x0){const _0x35aa34=extractBlocksByTags(_0x1e4171['mes'],_0x4997d6);_0x139cb0=_0x35aa34['join']('\x0a\x0a');}else _0x139cb0=_0x1e4171['mes'];_0x139cb0=applyExclusionRules(_0x139cb0,_0x53537b);}const _0x1f582a=_0x5e0d83[_0x2e305a(0x341)](_0x41bca5=>_0x41bca5===_0x1e4171),_0x59eb7d=_0x1f582a!==-0x1?_0x1f582a+0x1:-0x1;return{'id':'preview-item-'+_0x5c933d,'name':_0x1e4171[_0x2e305a(0x21a)],'content':_0x139cb0[_0x2e305a(0x324)](),'floor':_0x59eb7d,'is_user':_0x1e4171[_0x2e305a(0x361)],'send_date':_0x1e4171['send_date']};})['filter'](_0x1e27c2=>_0x1e27c2[_0x40756f(0x283)]);if(_0xe03599['length']===0x0){_0x254a98[_0x40756f(0x2ce)]=_0x40756f(0x270),toastr['warning'](_0x40756f(0x270),'翰林院启奏');return;}const _0x5741cd=_0xe03599[_0x40756f(0x21c)]((_0x33bb2a,_0x4a7af8)=>_0x40756f(0x2de)+_0x33bb2a['id']+_0x40756f(0x2b3)+_0x33bb2a[_0x40756f(0x1c4)]+_0x40756f(0x2f3)+_0x33bb2a[_0x40756f(0x21a)]+_0x40756f(0x2ab)+_0x33bb2a['floor']+_0x40756f(0x2a0)+_0x33bb2a[_0x40756f(0x361)]+_0x40756f(0x235)+_0x33bb2a[_0x40756f(0x2b7)]+'\x22>'+_0x33bb2a['content']+'\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\x20\x20\x20\x20