diff --git a/ui/hanlinyuan-bindings.js b/ui/hanlinyuan-bindings.js index 28fb69f..ead5dad 100644 --- a/ui/hanlinyuan-bindings.js +++ b/ui/hanlinyuan-bindings.js @@ -1 +1 @@ -const _0x34a9aa=_0x2a3e;(function(_0x2f1c95,_0x1baf57){const _0x5eb2ee=_0x2a3e,_0xe7c316=_0x2f1c95();while(!![]){try{const _0x5f506e=-parseInt(_0x5eb2ee(0xd9))/0x1+-parseInt(_0x5eb2ee(0x17c))/0x2+-parseInt(_0x5eb2ee(0x127))/0x3*(-parseInt(_0x5eb2ee(0x1a7))/0x4)+parseInt(_0x5eb2ee(0x1df))/0x5*(parseInt(_0x5eb2ee(0x1b8))/0x6)+parseInt(_0x5eb2ee(0x163))/0x7+parseInt(_0x5eb2ee(0x1b1))/0x8+parseInt(_0x5eb2ee(0x18d))/0x9;if(_0x5f506e===_0x1baf57)break;else _0xe7c316['push'](_0xe7c316['shift']());}catch(_0x375de8){_0xe7c316['push'](_0xe7c316['shift']());}}}(_0x22ab,0x844a7));import{getContext}from'/scripts/extensions.js';import*as _0x1750b8 from'../core/rag-processor.js';import*as _0x41ee77 from'../core/historiographer.js';import*as _0x3e1193 from'../core/utils/context-utils.js';import*as _0x58a2b6 from'../core/ingestion-manager.js';import{showContentModal,showHtmlModal}from'./page-window.js';function _0x22ab(){const _0x5cf9be=['from','请选择一个书库...','清空宝库失败。','hly-overlap-size','\x20块继续录入。','开始获取Rerank模型列表...','children','》中条目\x20(Key:\x20','ingestTextToHanlinyuan','未能获取到任何Rerank模型。','scripts/extensions/third-party/ST-Amily2-Chat-Optimisation/HanLin.md','signal','\x22\x20placeholder=\x22开始字符,\x20如\x20`。

\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','您确定要将所有设定恢复为出厂默认值吗?','checkbox','integer','hlyLog','hly-modal-container','\x20楼:\x20[','加载失败','loadProgress','fas\x20fa-lock-open','\x20个Rerank模型。','hanlinyuan-ingest-novel-controls','fetchHLYRerankModels','hanlinyuan-ingest-novel-file-input','hly-rerank-top-n','此书库为空','resetHLYSettings','display','[翰林院-枢纽]\x20获取Rerank模型列表失败:','[翰林院-枢纽]\x20核心法典未能提供初始化圣旨!','】已成功编纂入库。','hly-locked-status','根据标签提取或内容排除条件,未找到任何有效内容。','》中的条目\x20(Key:\x20','','hly-injection-role','finalText','检测到预览后待处理的文本,开始直接凝识...','amily2_open_rag_palace','成功获取\x20','未找到任何书库','hanlinyuan-ingest-progress-bar','内容排除规则已保存。','正在处理预览后的文本...','none','未知错误','\x22\x20title=\x22删除此条\x22>×\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20','float','hanlinyuan-ingest-progress-container','radio',',\x20忆识总数=','hly-retrieval-enabled','chat_history','getCharacterName','className','position','翰林院使用教程','任务完成!成功录入\x20','锁定会话','retrieval','根据当前勾选条件,未找到符合的消息可供预览。','预览内容已更新,可随时开始凝识。','hly-hist-select-entry','当前所有操作都将指向这个锁定的宝库:','innerHTML','hly-layer-start','\x20个条目。','\x20进行编纂...','initialize','-tab','请先选择一个\x20.txt\x20文件','此操作将彻底清空当前角色的所有忆识(向量),且无法恢复。您确定要继续吗?','聊天记录\x20','manual','fas\x20fa-lock','hly-api-endpoint','key','点击以解锁,让翰林院跟随当前角色','hly-current-vector-count','message','开始获取模型列表...','》获取条目列表...','processedChunks','\x20楼。

','custom','\x20楼已成功凝识,新增\x20','val','.hly-exclusion-rule-row','hly-condensation-enabled','用户尝试录入空文本。','getMessagesForCondensation','会话已锁定到宝库:\x20','815283jHBuEm','正在清空宝库...','start','info','\x20条消息,开始凝识...','','已选择\x20','azure','正在准备凝识...','未选择文件','length','未找到符合条件的消息。','preventDefault','active','total','startHLYHistoriography','','condensation','includes','toLocaleTimeString','warn','hanlinyuan-ingest-novel-start','name','\x22>\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\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\x20\x20\x20\x20\x20\x20\x20\x20','编纂失败:\x20','正在处理您提交的文书...','classList','翰林院启奏','model','split','hly-tag-input-container','可在此预览凝识结果。

','tags','fa-circle-info','%。是否从上次中断之处继续?','stringify','严重错误','手动录入失败:\x20','222MQxHzD','use\x20strict','用户请求查看宝库状态。','请先选择一个书库和要编纂的条目。','ingestHLYManualText','is_user','[翰林院-枢纽]\x20加载书库列表失败:','手动录入','count','.hly-tab-pane','input','hly-injection-depth','hly-batch-size','hly-rerank-model','预览失败:\x20','加载条目失败:\x20','成功加载\x20','hly-match-threshold','preview-item-','hly-rerank-api-key','\x20条有效条目),请点击“开始凝识”进入自动向量化流程。','log-info','forEach','#hly-add-rule-btn','AbortError','任务已中止。','','\x27\x20已更新为:\x20','#hly-rules-list','[翰林院-枢纽]\x20已成功连接各部,政令畅通。','join','value','rerank','chat','comment','手动录入成功,新增\x20','toggle','layerStart','trim','injection','hly-injection-template','未知的编纂错误','正在处理您确认后的文书...','hly-max-results','请先选择书库','error','[翰林院-枢纽]\x20凝识过程发生错误:','input[name=\x22hly-injection-position\x22][value=\x22','add','[翰林院-枢纽]\x20编纂过程发生错误:','会话已锁定','tab','hly-condensation-results','toggleSessionLock','聊天记录从第\x20','','selectedIndex','mes','fa-exclamation-triangle','\x0a\x0a---\x0a\x0a','4640041wvuFzE','testApiConnection','queryMessageCount','getLockedSessionInfo','log-warn','fetchRerankModels'];_0x22ab=function(){return _0x5cf9be;};return _0x22ab();}import{extractBlocksByTags,applyExclusionRules}from'../core/utils/rag-tag-extractor.js';_0x34a9aa(0x128);function setupGlobalEventHandlers(){const _0x5d2a10=_0x34a9aa;window['saveHLYSettings']=()=>saveSettingsFromUI(![]),window[_0x5d2a10(0x203)]=resetSettingsToUI,window[_0x5d2a10(0x1b2)]=testApi,window['fetchHLYEmbeddingModels']=fetchHLYEmbeddingModels,window[_0x5d2a10(0x1ff)]=fetchHLYRerankModels,window['updateHLYMemoryCount']=updatePanelStatus,window['purgeHLYStorage']=purgeStorage,window['startHLYCondensation']=startCondensation,window['previewHLYCondensation']=previewCondensation,window[_0x5d2a10(0x12b)]=ingestManualText,window[_0x5d2a10(0x1f7)]=log,window['showHLYStats']=showStats,window[_0x5d2a10(0xe8)]=startHistoriography;}function updateAndSaveSetting(_0x4f6a9a,_0x348cf9){const _0x52b2c4=_0x34a9aa,_0x2ae122=_0x1750b8[_0x52b2c4(0x1e1)]();if(!_0x2ae122)return;const _0xdd281a=_0x4f6a9a[_0x52b2c4(0x11e)]('.');let _0x87009b=_0x2ae122;for(let _0x4c93d9=0x0;_0x4c93d9<_0xdd281a[_0x52b2c4(0xe3)]-0x1;_0x4c93d9++){_0x87009b=_0x87009b[_0xdd281a[_0x4c93d9]]=_0x87009b[_0xdd281a[_0x4c93d9]]||{};}_0x87009b[_0xdd281a[_0xdd281a[_0x52b2c4(0xe3)]-0x1]]=_0x348cf9,_0x1750b8[_0x52b2c4(0x1a1)](),log('[自动保存]\x20设置项\x20\x27'+_0x4f6a9a+_0x52b2c4(0x142)+JSON[_0x52b2c4(0x124)](_0x348cf9),_0x52b2c4(0x1d3));}function bindAutoSaveEvents(){const _0x4fc348=_0x34a9aa,_0x4b25c6=document['getElementById'](_0x4fc348(0x1f8));if(!_0x4b25c6)return;_0x4b25c6[_0x4fc348(0x1b0)](_0x4fc348(0x18f),_0x5d6aac=>{const _0x5e1ff7=_0x4fc348,_0x2da7d8=_0x5d6aac[_0x5e1ff7(0x104)],_0x1e3f45=_0x2da7d8[_0x5e1ff7(0x188)][_0x5e1ff7(0x1ef)];if(!_0x1e3f45)return;let _0x588b9a;const _0x2bf221=_0x2da7d8[_0x5e1ff7(0x188)]['type']||_0x5e1ff7(0x1c7);if(_0x2da7d8[_0x5e1ff7(0x1a8)]===_0x5e1ff7(0x1f5))_0x588b9a=_0x2da7d8[_0x5e1ff7(0x1a4)];else{if(_0x2da7d8[_0x5e1ff7(0x1a8)]==='radio'){if(_0x2da7d8['checked']){const _0x411feb=_0x4b25c6[_0x5e1ff7(0x1d0)](_0x5e1ff7(0x1bb)+_0x2da7d8['name']+'\x22]'),_0x384def=Array[_0x5e1ff7(0x169)](_0x411feb)[_0x5e1ff7(0x1c0)](_0x3501b3=>_0x3501b3[_0x5e1ff7(0x1a4)]);_0x588b9a=_0x384def[_0x5e1ff7(0x146)];}else return;}else _0x588b9a=_0x2da7d8[_0x5e1ff7(0x146)];}switch(_0x2bf221){case _0x5e1ff7(0x1f6):_0x588b9a=parseInt(_0x588b9a,0xa);break;case _0x5e1ff7(0x218):_0x588b9a=parseFloat(_0x588b9a);break;case _0x5e1ff7(0x1e4):typeof _0x588b9a!==_0x5e1ff7(0x1e4)&&(_0x588b9a=_0x588b9a===_0x5e1ff7(0x108));break;}if(_0x2da7d8[_0x5e1ff7(0x1a8)]===_0x5e1ff7(0x21a)&&!_0x2da7d8[_0x5e1ff7(0x1a4)])return;updateAndSaveSetting(_0x1e3f45,_0x588b9a);});}export function bindHanlinyuanEvents(){const _0x5745e2=_0x34a9aa,_0x506a83=getContext();if(!_0x506a83){console[_0x5745e2(0x154)](_0x5745e2(0xfe));return;}setupGlobalEventHandlers(),bindPanelToggleEvents(),bindInternalUIEvents(),bindTutorialEvents(),bindAutoSaveEvents(),bindSessionLockEvent();if(_0x1750b8[_0x5745e2(0x22d)])_0x1750b8[_0x5745e2(0x22d)]();else{console[_0x5745e2(0x154)](_0x5745e2(0x206));return;}loadSettingsToUI(),loadWorldbookList(),log(_0x5745e2(0x144),_0x5745e2(0xdc));const _0x47e735=document['getElementById'](_0x5745e2(0x200)),_0x43665e=document[_0x5745e2(0x1bf)](_0x5745e2(0x10a)),_0x567273=document[_0x5745e2(0x1bf)](_0x5745e2(0xee)),_0x36275c=document[_0x5745e2(0x1bf)]('hanlinyuan-ingest-abort'),_0x35e8f7=document['getElementById'](_0x5745e2(0x219)),_0x1c1c93=document[_0x5745e2(0x1bf)](_0x5745e2(0x212)),_0x33bafb=document[_0x5745e2(0x1bf)]('hanlinyuan-ingest-status'),_0x2a937e=document['getElementById'](_0x5745e2(0x1fe));let _0x5b28c6=null,_0x4b415c=null;_0x47e735['addEventListener']('change',_0x112de2=>{const _0x230c42=_0x5745e2;_0x5b28c6=_0x112de2['target'][_0x230c42(0x1a5)][0x0],_0x5b28c6?(_0x43665e[_0x230c42(0x1ed)]=_0x5b28c6[_0x230c42(0xef)],_0x43665e[_0x230c42(0x189)]=_0x5b28c6[_0x230c42(0xef)]):_0x43665e[_0x230c42(0x1ed)]='未选择文件';}),_0x567273[_0x5745e2(0x1b0)](_0x5745e2(0x18e),async()=>{const _0x2851e6=_0x5745e2;if(!_0x5b28c6){toastr['warning'](_0x2851e6(0x22f));return;}let _0x58f60f=0x0;const _0x3ba3fc=_0x58a2b6[_0x2851e6(0x1e3)](_0x5b28c6),_0x53052d=_0x58a2b6[_0x2851e6(0x1fb)](_0x3ba3fc);if(_0x53052d){const _0x1169a8=(_0x53052d['processedChunks']/_0x53052d[_0x2851e6(0x196)]*0x64)['toFixed'](0x1),_0x19459c=confirm('启禀大人,发现此书上次录入已完成\x20'+_0x1169a8+_0x2851e6(0x123));_0x19459c?(_0x58f60f=_0x53052d[_0x2851e6(0x23b)],toastr[_0x2851e6(0xdc)]('遵命,将从第\x20'+(_0x58f60f+0x1)+_0x2851e6(0x16e),_0x2851e6(0x197)),log(_0x2851e6(0x1c9)+_0x3ba3fc+_0x2851e6(0x1e6)+_0x58f60f+'\x20块开始。',_0x2851e6(0xdc))):(_0x58a2b6[_0x2851e6(0x1d5)](_0x3ba3fc),toastr[_0x2851e6(0xdc)]('遵命,将从头开始录入此书。','圣旨已达'),log('[断点续传]\x20用户选择放弃旧任务\x20'+_0x3ba3fc+',重新开始。',_0x2851e6(0xed)));}_0x4b415c=new AbortController();const _0x17efb7=_0x4b415c[_0x2851e6(0x175)];_0x2a937e[_0x2851e6(0x1de)]['display']=_0x2851e6(0x215),_0x35e8f7[_0x2851e6(0x1de)][_0x2851e6(0x204)]='block',_0x33bafb[_0x2851e6(0x1ed)]='正在读取文件...',_0x1c1c93[_0x2851e6(0x146)]=0x0;try{const _0x5efe7a=await _0x5b28c6[_0x2851e6(0x18b)](),_0x401bcd=_0x411fb6=>{const _0x5c6c23=_0x2851e6;_0x33bafb['textContent']=_0x5c6c23(0x10c)+_0x411fb6[_0x5c6c23(0x238)]+'\x20('+_0x411fb6[_0x5c6c23(0x1aa)]+'/'+_0x411fb6[_0x5c6c23(0xe7)]+')',_0x1c1c93[_0x5c6c23(0x146)]=_0x411fb6[_0x5c6c23(0x1aa)]/_0x411fb6['total']*0x64;},_0x2f33d3=()=>{const _0x547377=_0x2851e6;updatePanelStatus(),log('[实时刷新]\x20批次完成,忆识总数已更新。',_0x547377(0xdc));},_0x48c08c=await _0x1750b8[_0x2851e6(0x172)](_0x5efe7a,'novel',_0x5b28c6[_0x2851e6(0xef)],_0x401bcd,_0x17efb7,log,_0x2f33d3,_0x3ba3fc,_0x58f60f);if(_0x48c08c[_0x2851e6(0x1d3)])toastr[_0x2851e6(0x1d3)](_0x2851e6(0x1e0)+_0x48c08c[_0x2851e6(0x12f)]+'\x20个知识块'),_0x33bafb[_0x2851e6(0x1ed)]=_0x2851e6(0x222)+_0x48c08c['count']+'\x20个知识块。',_0x1c1c93[_0x2851e6(0x146)]=0x64,updatePanelStatus();else throw new Error(_0x48c08c[_0x2851e6(0x154)]||'未知错误');}catch(_0x529ea8){_0x529ea8[_0x2851e6(0xef)]===_0x2851e6(0x13f)?(toastr[_0x2851e6(0xdc)]('任务已由用户中止。进度已保存,可随时继续。'),_0x33bafb[_0x2851e6(0x1ed)]=_0x2851e6(0x140)):(toastr[_0x2851e6(0x154)]('录入失败:\x20'+_0x529ea8[_0x2851e6(0x238)]+_0x2851e6(0x1ad)),_0x33bafb[_0x2851e6(0x1ed)]=_0x2851e6(0xf9)+_0x529ea8['message']);}finally{setTimeout(()=>{const _0x379c5a=_0x2851e6;_0x2a937e[_0x379c5a(0x1de)][_0x379c5a(0x204)]=_0x379c5a(0xf8),_0x35e8f7[_0x379c5a(0x1de)][_0x379c5a(0x204)]=_0x379c5a(0x215),_0x47e735[_0x379c5a(0x146)]='',_0x5b28c6=null,_0x43665e[_0x379c5a(0x1ed)]=_0x379c5a(0xe2);},0xbb8);}}),_0x36275c[_0x5745e2(0x1b0)]('click',()=>{const _0x4436f6=_0x5745e2;_0x4b415c&&_0x4b415c[_0x4436f6(0x187)]();});}function bindSessionLockEvent(){const _0x35824c=_0x34a9aa,_0x2c13a8=document[_0x35824c(0x1bf)](_0x35824c(0x1b7));if(!_0x2c13a8)return;_0x2c13a8['addEventListener'](_0x35824c(0x18e),()=>{const _0x1edf09=_0x35824c,_0x43142d=_0x1750b8[_0x1edf09(0x15c)]();updateSessionLockUI(_0x43142d);if(_0x43142d){const _0x2b031c=_0x1750b8[_0x1edf09(0x166)]();toastr[_0x1edf09(0x1d3)]('会话已锁定到:\x20'+_0x2b031c['id'],_0x1edf09(0x1c4)),log(_0x1edf09(0xd8)+_0x2b031c['id'],_0x1edf09(0x1d3));}else toastr[_0x1edf09(0xdc)]('会话已解锁,将跟随当前角色。','诏曰'),log(_0x1edf09(0x1c5),'info');updatePanelStatus();}),updateSessionLockUI(_0x1750b8[_0x35824c(0xff)]());}function _0x2a3e(_0x424898,_0x4029f0){const _0x22ab15=_0x22ab();return _0x2a3e=function(_0x2a3ec8,_0x19ddad){_0x2a3ec8=_0x2a3ec8-0xd3;let _0x459762=_0x22ab15[_0x2a3ec8];return _0x459762;},_0x2a3e(_0x424898,_0x4029f0);}function updateSessionLockUI(_0x2c99e5){const _0x205ebf=_0x34a9aa,_0x45a59e=document[_0x205ebf(0x1bf)](_0x205ebf(0x1b7));if(!_0x45a59e)return;const _0x3511e5=_0x45a59e[_0x205ebf(0x115)]('i'),_0x5465fb=_0x45a59e['querySelector'](_0x205ebf(0x1cc));_0x2c99e5?(_0x45a59e[_0x205ebf(0x11b)]['add'](_0x205ebf(0xe6)),_0x3511e5[_0x205ebf(0x21f)]=_0x205ebf(0x233),_0x5465fb[_0x205ebf(0x1ed)]=_0x205ebf(0x109),_0x45a59e[_0x205ebf(0x189)]=_0x205ebf(0x236)):(_0x45a59e[_0x205ebf(0x11b)][_0x205ebf(0xf4)](_0x205ebf(0xe6)),_0x3511e5[_0x205ebf(0x21f)]=_0x205ebf(0x1fc),_0x5465fb['textContent']=_0x205ebf(0x223),_0x45a59e[_0x205ebf(0x189)]='点击以锁定,让翰林院固定操作当前角色的宝库');}function bindPanelToggleEvents(){const _0x3338a8=_0x34a9aa,_0x2f7c52=document[_0x3338a8(0x1bf)](_0x3338a8(0x20f));if(_0x2f7c52){}}function bindTutorialEvents(){const _0x504026=_0x34a9aa,_0x192654=document[_0x504026(0x1bf)]('amily2_open_hanlin_tutorial');_0x192654&&_0x192654[_0x504026(0x1b0)](_0x504026(0x18e),()=>{const _0x416253=_0x504026;showContentModal(_0x416253(0x221),_0x416253(0x174));});}function bindInternalUIEvents(){const _0x589c4d=_0x34a9aa,_0xe3d428=document[_0x589c4d(0x1d0)]('.hly-nav-item');_0xe3d428[_0x589c4d(0x13d)](_0x42f33a=>{const _0x23a7ac=_0x589c4d;_0x42f33a[_0x23a7ac(0x1b0)]('click',()=>{const _0x7049bb=_0x23a7ac,_0x18d7f9=_0x42f33a[_0x7049bb(0x188)][_0x7049bb(0x15a)],_0x20107c=_0x7049bb(0x10b)+_0x18d7f9+_0x7049bb(0x22e);document[_0x7049bb(0x1d0)](_0x7049bb(0x130))[_0x7049bb(0x13d)](_0x377ed3=>{const _0x34a6fd=_0x7049bb;_0x377ed3['classList'][_0x34a6fd(0x14b)](_0x34a6fd(0xe6),_0x377ed3['id']===_0x20107c);}),_0xe3d428[_0x7049bb(0x13d)](_0x56dd80=>_0x56dd80['classList'][_0x7049bb(0x14b)](_0x7049bb(0xe6),_0x56dd80===_0x42f33a));});});const _0x598d14=document[_0x589c4d(0x1bf)](_0x589c4d(0x234));_0x598d14&&_0x598d14[_0x589c4d(0x1b0)](_0x589c4d(0x18f),toggleCustomEndpointDocket);const _0x40af14=document[_0x589c4d(0x1d0)](_0x589c4d(0x178));_0x40af14[_0x589c4d(0x13d)](_0x5219d5=>{const _0x2c22b6=_0x589c4d;_0x5219d5[_0x2c22b6(0x1b0)](_0x2c22b6(0x18f),toggleInjectionDetails);});const _0x41dc34=document[_0x589c4d(0x1bf)](_0x589c4d(0x1eb)),_0x2cb1a6=document[_0x589c4d(0x1bf)](_0x589c4d(0x11f));_0x41dc34&&_0x2cb1a6&&_0x41dc34[_0x589c4d(0x1b0)](_0x589c4d(0x18f),()=>{const _0x195067=_0x589c4d;_0x2cb1a6['style'][_0x195067(0x204)]=_0x41dc34[_0x195067(0x1a4)]?'block':_0x195067(0x215);});const _0x45a57f=document['getElementById'](_0x589c4d(0xf1));_0x45a57f&&_0x45a57f[_0x589c4d(0x1b0)]('change',handleWorldbookSelectionChange);const _0x20abd7=document[_0x589c4d(0x1bf)]('hly-exclusion-rules-btn');_0x20abd7&&_0x20abd7[_0x589c4d(0x1b0)](_0x589c4d(0x18e),showExclusionRulesModal);}function toggleInjectionDetails(){const _0x10fc24=_0x34a9aa,_0x17621d=document[_0x10fc24(0x115)](_0x10fc24(0xf5))[_0x10fc24(0x146)],_0x8f97e=document[_0x10fc24(0x1bf)](_0x10fc24(0x132)),_0xa5eb66=document[_0x10fc24(0x1bf)](_0x10fc24(0x20c)),_0x4e6bc0=_0x17621d==='1';_0x8f97e[_0x10fc24(0x19e)]=!_0x4e6bc0,_0xa5eb66[_0x10fc24(0x19e)]=!_0x4e6bc0;}function toggleCustomEndpointDocket(){const _0x1fdcd9=_0x34a9aa,_0x2723b8=document[_0x1fdcd9(0x1bf)](_0x1fdcd9(0x234))[_0x1fdcd9(0x146)],_0x31f9e9=document[_0x1fdcd9(0x1bf)]('hly-custom-endpoint-docket');_0x31f9e9&&(_0x31f9e9[_0x1fdcd9(0x1de)][_0x1fdcd9(0x204)]=_0x2723b8===_0x1fdcd9(0x23d)||_0x2723b8===_0x1fdcd9(0xe0)?_0x1fdcd9(0x105):_0x1fdcd9(0x215));}function loadSettingsToUI(){const _0x53ccfe=_0x34a9aa,_0x322a13=_0x1750b8[_0x53ccfe(0x1e1)]();if(!_0x322a13)return;document[_0x53ccfe(0x1bf)](_0x53ccfe(0x21c))[_0x53ccfe(0x1a4)]=_0x322a13[_0x53ccfe(0x224)][_0x53ccfe(0x199)],document['getElementById']('hly-api-endpoint')[_0x53ccfe(0x146)]=_0x322a13[_0x53ccfe(0x224)][_0x53ccfe(0x19b)],document['getElementById'](_0x53ccfe(0x17a))[_0x53ccfe(0x146)]=_0x322a13['retrieval']['customApiUrl'],document[_0x53ccfe(0x1bf)]('hly-api-key')[_0x53ccfe(0x146)]=_0x322a13[_0x53ccfe(0x224)][_0x53ccfe(0x1ce)];const _0x2b222e=document[_0x53ccfe(0x1bf)](_0x53ccfe(0x1ec));if(_0x2b222e['options'][_0x53ccfe(0xe3)]===0x0){const _0x30c757=_0x322a13[_0x53ccfe(0x224)]['embeddingModel'],_0x3216ca=new Option(_0x30c757,_0x30c757,!![],!![]);_0x2b222e[_0x53ccfe(0x157)](_0x3216ca);}_0x2b222e[_0x53ccfe(0x146)]=_0x322a13[_0x53ccfe(0x224)]['embeddingModel'],document[_0x53ccfe(0x1bf)](_0x53ccfe(0xf6))[_0x53ccfe(0x1a4)]=_0x322a13[_0x53ccfe(0x224)][_0x53ccfe(0x185)],document[_0x53ccfe(0x1bf)]('hly-chunk-size')[_0x53ccfe(0x146)]=_0x322a13[_0x53ccfe(0x114)]['chunkSize'],document[_0x53ccfe(0x1bf)](_0x53ccfe(0x16d))[_0x53ccfe(0x146)]=_0x322a13[_0x53ccfe(0x114)][_0x53ccfe(0xf7)],document['getElementById'](_0x53ccfe(0x138))[_0x53ccfe(0x146)]=_0x322a13[_0x53ccfe(0x114)]['matchThreshold'],document['getElementById'](_0x53ccfe(0x113))['value']=_0x322a13[_0x53ccfe(0x114)][_0x53ccfe(0x165)],document[_0x53ccfe(0x1bf)](_0x53ccfe(0x152))[_0x53ccfe(0x146)]=_0x322a13[_0x53ccfe(0x114)]['maxResults'],document[_0x53ccfe(0x1bf)](_0x53ccfe(0x133))[_0x53ccfe(0x146)]=_0x322a13['retrieval'][_0x53ccfe(0x192)],document[_0x53ccfe(0x1bf)](_0x53ccfe(0x14f))[_0x53ccfe(0x146)]=_0x322a13[_0x53ccfe(0x14e)][_0x53ccfe(0x100)];const _0x1ee224=document[_0x53ccfe(0x115)](_0x53ccfe(0x156)+_0x322a13[_0x53ccfe(0x14e)][_0x53ccfe(0x220)]+'\x22]');_0x1ee224&&(_0x1ee224[_0x53ccfe(0x1a4)]=!![]);document[_0x53ccfe(0x1bf)](_0x53ccfe(0x132))['value']=_0x322a13[_0x53ccfe(0x14e)][_0x53ccfe(0x1c2)],document['getElementById'](_0x53ccfe(0x20c))[_0x53ccfe(0x146)]=_0x322a13[_0x53ccfe(0x14e)][_0x53ccfe(0x1cb)],toggleInjectionDetails(),document['getElementById'](_0x53ccfe(0xd5))[_0x53ccfe(0x1a4)]=_0x322a13[_0x53ccfe(0xea)][_0x53ccfe(0x199)],document['getElementById'](_0x53ccfe(0x22a))['value']=_0x322a13[_0x53ccfe(0xea)][_0x53ccfe(0x14c)],document[_0x53ccfe(0x1bf)]('hly-layer-end')[_0x53ccfe(0x146)]=_0x322a13['condensation']['layerEnd'],document[_0x53ccfe(0x1bf)]('hly-include-user')[_0x53ccfe(0x1a4)]=_0x322a13[_0x53ccfe(0xea)][_0x53ccfe(0x1a3)][_0x53ccfe(0x110)],document[_0x53ccfe(0x1bf)](_0x53ccfe(0x191))[_0x53ccfe(0x1a4)]=_0x322a13['condensation'][_0x53ccfe(0x1a3)]['ai'];const _0x57d9ce=document[_0x53ccfe(0x1bf)](_0x53ccfe(0x1eb)),_0x48f06a=document[_0x53ccfe(0x1bf)]('hly-tag-input'),_0x359330=document['getElementById'](_0x53ccfe(0x11f));_0x57d9ce[_0x53ccfe(0x1a4)]=_0x322a13[_0x53ccfe(0xea)]['tagExtractionEnabled'],_0x48f06a[_0x53ccfe(0x146)]=_0x322a13[_0x53ccfe(0xea)][_0x53ccfe(0x121)],_0x359330[_0x53ccfe(0x1de)][_0x53ccfe(0x204)]=_0x57d9ce[_0x53ccfe(0x1a4)]?_0x53ccfe(0x105):_0x53ccfe(0x215),document[_0x53ccfe(0x1bf)]('hly-rerank-enabled')[_0x53ccfe(0x1a4)]=_0x322a13[_0x53ccfe(0x147)]['enabled'],document[_0x53ccfe(0x1bf)]('hly-rerank-url')[_0x53ccfe(0x146)]=_0x322a13['rerank']['url'],document[_0x53ccfe(0x1bf)](_0x53ccfe(0x13a))[_0x53ccfe(0x146)]=_0x322a13[_0x53ccfe(0x147)][_0x53ccfe(0x1ce)];const _0x5a81ef=document['getElementById'](_0x53ccfe(0x134));if(_0x5a81ef[_0x53ccfe(0x1f0)][_0x53ccfe(0xe3)]===0x0){const _0x38a52f=_0x322a13[_0x53ccfe(0x147)][_0x53ccfe(0x11d)];if(_0x38a52f){const _0x352f00=new Option(_0x38a52f,_0x38a52f,!![],!![]);_0x5a81ef[_0x53ccfe(0x157)](_0x352f00);}}_0x5a81ef['value']=_0x322a13[_0x53ccfe(0x147)][_0x53ccfe(0x11d)],document[_0x53ccfe(0x1bf)](_0x53ccfe(0x201))['value']=_0x322a13[_0x53ccfe(0x147)][_0x53ccfe(0x180)],document['getElementById']('hly-rerank-hybrid-alpha')['value']=_0x322a13['rerank'][_0x53ccfe(0x183)],document['getElementById'](_0x53ccfe(0x10d))[_0x53ccfe(0x1a4)]=_0x322a13[_0x53ccfe(0x147)][_0x53ccfe(0x185)],toggleCustomEndpointDocket();}function saveSettingsFromUI(_0x1a629e=!![]){const _0x47879d=_0x34a9aa,_0x30a827=document[_0x47879d(0x1bf)]('hly-modal-container');if(!_0x30a827)return;const _0x52e951=_0x30a827[_0x47879d(0x1d0)]('[data-setting-key]');_0x52e951[_0x47879d(0x13d)](_0x53e076=>{const _0x126531=_0x47879d,_0x4d1123=_0x53e076[_0x126531(0x188)]['settingKey'];if(!_0x4d1123)return;let _0x12e2db;const _0x8d79a9=_0x53e076['dataset'][_0x126531(0x1a8)]||_0x126531(0x1c7);if(_0x53e076[_0x126531(0x1a8)]===_0x126531(0x1f5))_0x12e2db=_0x53e076[_0x126531(0x1a4)];else{if(_0x53e076[_0x126531(0x1a8)]==='radio'){if(!_0x53e076['checked'])return;_0x12e2db=_0x53e076['value'];}else _0x12e2db=_0x53e076[_0x126531(0x146)];}switch(_0x8d79a9){case _0x126531(0x1f6):_0x12e2db=parseInt(_0x12e2db,0xa);break;case _0x126531(0x218):_0x12e2db=parseFloat(_0x12e2db);break;case _0x126531(0x1e4):if(typeof _0x12e2db!==_0x126531(0x1e4))_0x12e2db=_0x12e2db===_0x126531(0x108);break;}const _0xa4699b=_0x1750b8[_0x126531(0x1e1)](),_0x4ee61f=_0x4d1123['split']('.');let _0x569222=_0xa4699b;for(let _0x2929a4=0x0;_0x2929a4<_0x4ee61f[_0x126531(0xe3)]-0x1;_0x2929a4++){_0x569222=_0x569222[_0x4ee61f[_0x2929a4]]=_0x569222[_0x4ee61f[_0x2929a4]]||{};}_0x569222[_0x4ee61f[_0x4ee61f[_0x126531(0xe3)]-0x1]]=_0x12e2db;}),_0x1750b8[_0x47879d(0x1a1)](),!_0x1a629e&&(log('【手动存档】所有设定已存档封印。',_0x47879d(0x1d3)),toastr['success'](_0x47879d(0x101),_0x47879d(0x197)));}function resetSettingsToUI(){const _0x1dd817=_0x34a9aa;confirm(_0x1dd817(0x1f4))&&(_0x1750b8['resetSettings'](),loadSettingsToUI(),toastr[_0x1dd817(0xdc)](_0x1dd817(0x1a9),'诏曰'));}async function updatePanelStatus(){const _0x25db05=_0x34a9aa,_0x488587=_0x1750b8['isSessionLocked'](),_0x18efd5=document['getElementById'](_0x25db05(0xf3)),_0x3ff3ca=document[_0x25db05(0x1bf)]('hly-current-chat-id');if(_0x488587){const _0x232c5f=_0x1750b8['getLockedSessionInfo']();_0x18efd5[_0x25db05(0x1ed)]=_0x25db05(0x159),_0x3ff3ca['textContent']=_0x232c5f['id'],_0x3ff3ca[_0x25db05(0x189)]=_0x25db05(0x228)+_0x232c5f['id'],_0x18efd5[_0x25db05(0x11b)]['add'](_0x25db05(0x208)),_0x3ff3ca[_0x25db05(0x11b)][_0x25db05(0x157)](_0x25db05(0x208));}else _0x18efd5[_0x25db05(0x1ed)]=_0x3e1193[_0x25db05(0x21e)](),_0x3ff3ca[_0x25db05(0x1ed)]=_0x3e1193[_0x25db05(0x19f)]()||'无',_0x3ff3ca['title']='',_0x18efd5[_0x25db05(0x11b)]['remove'](_0x25db05(0x208)),_0x3ff3ca[_0x25db05(0x11b)]['remove'](_0x25db05(0x208));const _0x5b8a63=document[_0x25db05(0x1bf)](_0x25db05(0x237));_0x5b8a63[_0x25db05(0x1ed)]=_0x25db05(0x1d7);try{const _0x5795ec=await _0x1750b8[_0x25db05(0x1ea)]();_0x5b8a63[_0x25db05(0x1ed)]=_0x5795ec;}catch(_0x5db4d0){console[_0x25db05(0x154)](_0x25db05(0x1b3),_0x5db4d0),_0x5b8a63[_0x25db05(0x1ed)]=_0x25db05(0x190),_0x5b8a63[_0x25db05(0x189)]='无法获取总数:\x20'+_0x5db4d0[_0x25db05(0x238)];}const _0x4d1e89=document[_0x25db05(0x1bf)](_0x25db05(0x15b));if(_0x4d1e89&&!_0x4d1e89['dataset'][_0x25db05(0x20d)]){const _0x1df04f=_0x1750b8['getSettings'](),_0xd9a31a=_0x1750b8['getCollectionId']();if(_0x1df04f[_0x25db05(0x193)]&&_0x1df04f[_0x25db05(0x193)][_0xd9a31a]){const _0x176b3f=_0x1df04f['condensationHistory'][_0xd9a31a];_0x4d1e89[_0x25db05(0x229)]='上次已从第\x20'+_0x176b3f[_0x25db05(0xdb)]+_0x25db05(0x17b)+_0x176b3f['end']+_0x25db05(0x23c);}else _0x4d1e89[_0x25db05(0x229)]=_0x25db05(0x120);}}async function testApi(){const _0x33cac0=_0x34a9aa;toastr[_0x33cac0(0xdc)]('正在测试神力连接...','圣旨');try{await _0x1750b8[_0x33cac0(0x164)](),toastr[_0x33cac0(0x1d3)](_0x33cac0(0x19d),'圣意');}catch(_0xb41add){toastr['error'](_0x33cac0(0x107)+_0xb41add[_0x33cac0(0x238)],'警报');}}async function fetchHLYEmbeddingModels(){const _0x429a9f=_0x34a9aa,_0x5793c3=document[_0x429a9f(0x1bf)](_0x429a9f(0x1ec)),_0x1c1d07=_0x5793c3['value'];_0x5793c3['innerHTML']=_0x429a9f(0xe9),_0x5793c3[_0x429a9f(0x19e)]=!![];try{log(_0x429a9f(0x239),_0x429a9f(0xdc));const _0x11eb99=await _0x1750b8[_0x429a9f(0x1da)]();_0x5793c3[_0x429a9f(0x229)]='';if(_0x11eb99['length']===0x0){_0x5793c3[_0x429a9f(0x229)]='',toastr[_0x429a9f(0xed)]('未能获取到任何模型。',_0x429a9f(0x11c)),log('未能获取到任何模型。','warn');return;}_0x11eb99['forEach'](_0xd8971a=>{const _0x5c907d=new Option(_0xd8971a,_0xd8971a);_0x5793c3['add'](_0x5c907d);}),_0x11eb99['includes'](_0x1c1d07)?_0x5793c3[_0x429a9f(0x146)]=_0x1c1d07:_0x5793c3[_0x429a9f(0x15f)]=0x0,toastr[_0x429a9f(0x1d3)](_0x429a9f(0x210)+_0x11eb99['length']+'\x20个模型。','圣意'),log(_0x429a9f(0x210)+_0x11eb99[_0x429a9f(0xe3)]+_0x429a9f(0x1f1),_0x429a9f(0x1d3));}catch(_0x5afd81){console[_0x429a9f(0x154)](_0x429a9f(0x184),_0x5afd81),toastr[_0x429a9f(0x154)](_0x429a9f(0x1af)+_0x5afd81[_0x429a9f(0x238)],_0x429a9f(0x125)),log(_0x429a9f(0x1af)+_0x5afd81['message'],_0x429a9f(0x154)),_0x5793c3[_0x429a9f(0x229)]=_0x429a9f(0x15e);}finally{_0x5793c3[_0x429a9f(0x19e)]=![];}}async function fetchHLYRerankModels(){const _0x339c0d=_0x34a9aa,_0x3edfd3=document[_0x339c0d(0x1bf)](_0x339c0d(0x134)),_0x589ece=_0x3edfd3[_0x339c0d(0x146)];_0x3edfd3[_0x339c0d(0x229)]=_0x339c0d(0xe9),_0x3edfd3[_0x339c0d(0x19e)]=!![];try{log(_0x339c0d(0x16f),_0x339c0d(0xdc));const _0x4b80ee=await _0x1750b8[_0x339c0d(0x168)]();_0x3edfd3['innerHTML']='';if(_0x4b80ee[_0x339c0d(0xe3)]===0x0){_0x3edfd3[_0x339c0d(0x229)]=_0x339c0d(0x141),toastr[_0x339c0d(0xed)](_0x339c0d(0x173),_0x339c0d(0x11c)),log(_0x339c0d(0x173),_0x339c0d(0xed));return;}_0x4b80ee['forEach'](_0x414326=>{const _0x4e70b5=new Option(_0x414326,_0x414326);_0x3edfd3['add'](_0x4e70b5);}),_0x4b80ee[_0x339c0d(0xeb)](_0x589ece)?_0x3edfd3[_0x339c0d(0x146)]=_0x589ece:_0x3edfd3[_0x339c0d(0x15f)]=0x0,toastr[_0x339c0d(0x1d3)]('成功获取\x20'+_0x4b80ee[_0x339c0d(0xe3)]+_0x339c0d(0x1fd),'圣意'),log(_0x339c0d(0x210)+_0x4b80ee[_0x339c0d(0xe3)]+_0x339c0d(0x1fd),_0x339c0d(0x1d3));}catch(_0x2318db){console['error'](_0x339c0d(0x205),_0x2318db),toastr['error'](_0x339c0d(0x1db)+_0x2318db[_0x339c0d(0x238)],_0x339c0d(0x125)),log('获取Rerank模型失败:\x20'+_0x2318db[_0x339c0d(0x238)],_0x339c0d(0x154)),_0x3edfd3[_0x339c0d(0x229)]=_0x339c0d(0x15e);}finally{_0x3edfd3[_0x339c0d(0x19e)]=![];}}async function purgeStorage(){const _0x3b7ea6=_0x34a9aa;if(confirm(_0x3b7ea6(0x230))){toastr[_0x3b7ea6(0xdc)](_0x3b7ea6(0xda),'圣旨');const _0x246a73=await _0x1750b8[_0x3b7ea6(0x17d)]();_0x246a73?toastr[_0x3b7ea6(0x1d3)]('宝库已清空。','圣意'):toastr[_0x3b7ea6(0x154)](_0x3b7ea6(0x16c),'警报'),await updatePanelStatus();}}async function startCondensation(){const _0x5076ea=_0x34a9aa,_0x37c567=document[_0x5076ea(0x1bf)]('hly-condensation-results'),_0x15e2a1=_0x37c567['dataset'][_0x5076ea(0x20d)],_0x14f74b=document[_0x5076ea(0x1bf)]('hly-layer-start')[_0x5076ea(0x146)],_0x5157cf=document[_0x5076ea(0x1bf)]('hly-layer-end')[_0x5076ea(0x146)],_0x26e650={'start':parseInt(_0x14f74b),'end':parseInt(_0x5157cf)};try{if(_0x15e2a1&&_0x15e2a1[_0x5076ea(0x14d)]()){log(_0x5076ea(0x20e),_0x5076ea(0xdc)),toastr[_0x5076ea(0xdc)](_0x5076ea(0x151),'圣旨'),_0x37c567['textContent']=_0x5076ea(0x214);const _0x22bc6c=await _0x1750b8['ingestTextToHanlinyuan'](_0x15e2a1,_0x5076ea(0x21d),_0x5076ea(0x231)+_0x26e650['start']+'-'+_0x26e650[_0x5076ea(0x1f2)],()=>{},null,log,()=>{},null,0x0,_0x26e650);if(_0x22bc6c[_0x5076ea(0x1d3)]){toastr[_0x5076ea(0x1d3)](_0x5076ea(0x179)+_0x22bc6c['count']+_0x5076ea(0x1cd),_0x5076ea(0x1cf)),log(_0x5076ea(0x181)+_0x22bc6c[_0x5076ea(0x12f)]+_0x5076ea(0x1cd),'success');const _0x341b60=_0x26e650['end']===0x0?getContext()[_0x5076ea(0x148)][_0x5076ea(0xe3)]:_0x26e650[_0x5076ea(0x1f2)];_0x37c567[_0x5076ea(0x1ed)]=_0x5076ea(0x15d)+_0x26e650[_0x5076ea(0xdb)]+'\x20楼到第\x20'+_0x341b60+'\x20楼已成功凝识,新增\x20'+_0x22bc6c[_0x5076ea(0x12f)]+'\x20条忆识。',delete _0x37c567[_0x5076ea(0x188)][_0x5076ea(0x20d)];}else throw new Error(_0x22bc6c[_0x5076ea(0x154)]||_0x5076ea(0x216));}else{_0x37c567[_0x5076ea(0x1ed)]='正在采集消息...',toastr[_0x5076ea(0xdc)](_0x5076ea(0xe1),'圣旨'),log('未检测到预览文本,按标准流程采集消息...',_0x5076ea(0xdc));const _0xb1e147=_0x1750b8[_0x5076ea(0xd7)]();if(!_0xb1e147||_0xb1e147[_0x5076ea(0xe3)]===0x0){toastr[_0x5076ea(0x17e)](_0x5076ea(0x1a6),_0x5076ea(0x11c)),_0x37c567[_0x5076ea(0x1ed)]=_0x5076ea(0xe4);return;}_0x37c567[_0x5076ea(0x1ed)]=_0x5076ea(0xfc)+_0xb1e147[_0x5076ea(0xe3)]+_0x5076ea(0xdd),toastr[_0x5076ea(0xdc)](_0x5076ea(0xfc)+_0xb1e147[_0x5076ea(0xe3)]+'\x20条消息,开始凝识...','翰林院启奏');const _0x3385e1=await _0x1750b8[_0x5076ea(0x1e5)](_0xb1e147,log,_0x26e650);if(_0x3385e1[_0x5076ea(0x1d3)]){toastr[_0x5076ea(0x1d3)](_0x5076ea(0x1ac)+_0x3385e1[_0x5076ea(0x12f)]+_0x5076ea(0x1cd),_0x5076ea(0x1cf));const _0x23075a=_0x26e650['end']===0x0?getContext()[_0x5076ea(0x148)][_0x5076ea(0xe3)]:_0x26e650[_0x5076ea(0x1f2)];_0x37c567[_0x5076ea(0x1ed)]=_0x5076ea(0x15d)+_0x26e650[_0x5076ea(0xdb)]+_0x5076ea(0x111)+_0x23075a+_0x5076ea(0x23e)+_0x3385e1['count']+_0x5076ea(0x1cd);}else throw new Error(_0x3385e1['error']||_0x5076ea(0x216));}}catch(_0x21b87f){console[_0x5076ea(0x154)](_0x5076ea(0x155),_0x21b87f),toastr['error']('凝识失败:\x20'+_0x21b87f['message'],_0x5076ea(0x125)),_0x37c567[_0x5076ea(0x1ed)]='凝识失败:\x20'+_0x21b87f['message'];}finally{await updatePanelStatus();}}async function loadWorldbookList(){const _0x308526=_0x34a9aa,_0x16947e=document[_0x308526(0x1bf)](_0x308526(0xf1));if(!_0x16947e)return;try{log('正在获取可用书库列表...','info');const _0x5d3d82=await _0x41ee77['getAvailableWorldbooks']();_0x16947e['innerHTML']=_0x308526(0x16b);if(_0x5d3d82['length']===0x0){_0x16947e['innerHTML']=_0x308526(0x211);return;}_0x5d3d82[_0x308526(0x13d)](_0x370e3d=>{const _0x20c0a1=_0x308526,_0x17fcf3=new Option(_0x370e3d,_0x370e3d);_0x16947e[_0x20c0a1(0x157)](_0x17fcf3);}),log(_0x308526(0x137)+_0x5d3d82[_0x308526(0xe3)]+_0x308526(0x106),_0x308526(0x1d3));}catch(_0x4dc907){console[_0x308526(0x154)](_0x308526(0x12d),_0x4dc907),log('加载书库列表失败:\x20'+_0x4dc907[_0x308526(0x238)],_0x308526(0x154)),_0x16947e[_0x308526(0x229)]=_0x308526(0x1fa);}}async function handleWorldbookSelectionChange(){const _0x209036=_0x34a9aa,_0x316f79=document[_0x209036(0x1bf)](_0x209036(0xf1)),_0x56d907=document[_0x209036(0x1bf)](_0x209036(0x227)),_0x4fe0df=_0x316f79['value'];_0x56d907[_0x209036(0x229)]=_0x209036(0x1ca),_0x56d907[_0x209036(0x19e)]=!![];if(!_0x4fe0df){_0x56d907[_0x209036(0x229)]=_0x209036(0x153);return;}try{log('正在为《'+_0x4fe0df+_0x209036(0x23a),'info');const _0x41b598=await _0x41ee77[_0x209036(0x1bd)](_0x4fe0df);_0x56d907[_0x209036(0x229)]=_0x209036(0x1d2);if(_0x41b598[_0x209036(0xe3)]===0x0){_0x56d907['innerHTML']=_0x209036(0x202);return;}_0x41b598[_0x209036(0x13d)](_0x1658a6=>{const _0x2a2a68=_0x209036,_0x255ebb=new Option(_0x1658a6[_0x2a2a68(0x149)]+_0x2a2a68(0x10e)+_0x1658a6[_0x2a2a68(0x235)]+')',_0x1658a6[_0x2a2a68(0x235)]);_0x56d907[_0x2a2a68(0x157)](_0x255ebb);}),log(_0x209036(0x137)+_0x41b598[_0x209036(0xe3)]+_0x209036(0x22b),_0x209036(0x1d3));}catch(_0x5cd36d){console[_0x209036(0x154)](_0x209036(0x103)+_0x4fe0df+'》的条目失败:',_0x5cd36d),log(_0x209036(0x136)+_0x5cd36d[_0x209036(0x238)],_0x209036(0x154)),_0x56d907[_0x209036(0x229)]='加载失败';}finally{_0x56d907['disabled']=![];}}async function startHistoriography(){const _0x2fca0c=_0x34a9aa,_0x4f8ef6=document['getElementById'](_0x2fca0c(0xf1))[_0x2fca0c(0x146)],_0x44af13=document['getElementById'](_0x2fca0c(0x227))[_0x2fca0c(0x146)],_0x2e02ba=document[_0x2fca0c(0x1bf)]('hly-historiography-results');if(!_0x4f8ef6||!_0x44af13){toastr[_0x2fca0c(0x17e)](_0x2fca0c(0x12a),_0x2fca0c(0x18a));return;}_0x2e02ba['textContent']=_0x2fca0c(0xfd)+_0x4f8ef6+_0x2fca0c(0x20a)+_0x44af13+_0x2fca0c(0x117),toastr[_0x2fca0c(0xdc)](_0x2fca0c(0x17f),'圣旨'),log(_0x2fca0c(0x1c1)+_0x4f8ef6+'》-'+_0x44af13+_0x2fca0c(0x22c),_0x2fca0c(0xdc));try{const _0xbc959b=await _0x41ee77[_0x2fca0c(0x1e9)](_0x4f8ef6,_0x44af13);if(_0xbc959b[_0x2fca0c(0x1d3)]){const _0x2dca18=document[_0x2fca0c(0x1bf)](_0x2fca0c(0x227)),_0x59804f=_0x2dca18[_0x2fca0c(0x1f0)][_0x2dca18['selectedIndex']]['text'],_0x678382='《'+_0x4f8ef6+'》中的条目【'+_0x59804f+_0x2fca0c(0x207);_0x2e02ba[_0x2fca0c(0x1ed)]=_0x678382,toastr['success'](_0x2fca0c(0x1d4),'大功告成'),log('对《'+_0x4f8ef6+_0x2fca0c(0x171)+_0x44af13+')\x20的编纂任务已完成。',_0x2fca0c(0x1d3));}else throw new Error(_0xbc959b['error']||_0x2fca0c(0x150));}catch(_0x50d411){console[_0x2fca0c(0x154)](_0x2fca0c(0x158),_0x50d411),toastr[_0x2fca0c(0x154)](_0x2fca0c(0x119)+_0x50d411[_0x2fca0c(0x238)],_0x2fca0c(0x125)),_0x2e02ba['textContent']=_0x2fca0c(0x119)+_0x50d411[_0x2fca0c(0x238)];}}async function showStats(){const _0x1ae9d9=_0x34a9aa;try{log(_0x1ae9d9(0x129),_0x1ae9d9(0xdc)),toastr[_0x1ae9d9(0xdc)](_0x1ae9d9(0x1ba),'圣旨');const _0x57c968=await _0x1750b8[_0x1ae9d9(0x1ea)](),_0x5a3649=_0x1750b8[_0x1ae9d9(0x112)](),_0x3cf900=_0x1750b8['getSettings'](),_0x301d08=_0x1ae9d9(0x186)+_0x5a3649+_0x1ae9d9(0x1d6)+_0x57c968+'\x0a--------------------\x0aAPI端点:\x20'+_0x3cf900['retrieval'][_0x1ae9d9(0x19b)]+'\x0a所用模型:\x20'+_0x3cf900[_0x1ae9d9(0x224)][_0x1ae9d9(0x1b9)]+'\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20';toastr[_0x1ae9d9(0xdc)](_0x301d08,'宝库状态',{'timeOut':0x3a98,'extendedTimeOut':0x1388,'tapToDismiss':!![],'closeButton':!![]}),log(_0x1ae9d9(0x182)+_0x5a3649+_0x1ae9d9(0x21b)+_0x57c968,'success');}catch(_0x1f3586){console[_0x1ae9d9(0x154)]('[翰林院-枢纽]\x20查询宝库状态失败:',_0x1f3586),toastr['error'](_0x1ae9d9(0x177)+_0x1f3586[_0x1ae9d9(0x238)],'严重错误'),log(_0x1ae9d9(0x177)+_0x1f3586[_0x1ae9d9(0x238)],_0x1ae9d9(0x154));}}function showExclusionRulesModal(){const _0x209f78=_0x34a9aa,_0x492ca8=_0x1750b8[_0x209f78(0x1e1)](),_0x4fd468=_0x492ca8['condensation'][_0x209f78(0x1a0)]||[],_0x26d5a6=(_0x261144={'start':'','end':''},_0x3aa8c9)=>_0x209f78(0x1e7)+_0x3aa8c9+_0x209f78(0xf0)+_0x261144[_0x209f78(0xdb)]+_0x209f78(0x176)+_0x261144['end']+'\x22\x20placeholder=\x22结束字符,\x20如\x20-->\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20×\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20',_0x4e1d58=_0x4fd468[_0x209f78(0x1b5)](_0x26d5a6)[_0x209f78(0x145)](''),_0x356969=_0x209f78(0x1f3)+_0x4e1d58+'\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\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20';showHtmlModal('编辑内容排除规则',_0x356969,{'okText':'保存规则','onOk':_0x459df0=>{const _0x3d108e=_0x209f78,_0xb478db=[];_0x459df0['find'](_0x3d108e(0xd4))[_0x3d108e(0x102)](function(){const _0x53f4fc=_0x3d108e,_0x453b55=$(this)[_0x53f4fc(0x1c0)](_0x53f4fc(0x131))['eq'](0x0)[_0x53f4fc(0xd3)]()[_0x53f4fc(0x14d)](),_0x1a1d51=$(this)[_0x53f4fc(0x1c0)]('input')['eq'](0x1)['val']()[_0x53f4fc(0x14d)]();_0x453b55&&_0x1a1d51&&_0xb478db[_0x53f4fc(0x1c8)]({'start':_0x453b55,'end':_0x1a1d51});}),updateAndSaveSetting('condensation.exclusionRules',_0xb478db),toastr[_0x3d108e(0x1d3)](_0x3d108e(0x213),_0x3d108e(0x197));}});const _0x24abb7=document[_0x209f78(0x1bf)]('hly-exclusion-rules-container'),_0x2a5308=_0x24abb7[_0x209f78(0x115)](_0x209f78(0x143));_0x24abb7[_0x209f78(0x115)](_0x209f78(0x13e))[_0x209f78(0x1b0)]('click',()=>{const _0xdd662=_0x209f78,_0x4e5237=_0x2a5308[_0xdd662(0x170)][_0xdd662(0xe3)],_0x5e5439=_0x26d5a6({'start':'','end':''},_0x4e5237);_0x2a5308['insertAdjacentHTML'](_0xdd662(0x1ae),_0x5e5439);}),_0x2a5308['addEventListener'](_0x209f78(0x18e),_0x46cad4=>{const _0x178666=_0x209f78;_0x46cad4['target']['classList'][_0x178666(0xfa)]('hly-delete-rule-btn')&&_0x46cad4[_0x178666(0x104)][_0x178666(0x194)](_0x178666(0xd4))[_0x178666(0xf4)]();});}function previewCondensation(){const _0x314d8d=_0x34a9aa,_0x148943=document['getElementById'](_0x314d8d(0x15b));try{const _0x21757a=_0x1750b8[_0x314d8d(0x1e1)](),_0x45b768=_0x21757a[_0x314d8d(0xea)]['exclusionRules']||[],_0x287f06={'user':document[_0x314d8d(0x1bf)]('hly-include-user')['checked'],'ai':document['getElementById'](_0x314d8d(0x191))['checked']},_0x50d2f2=document[_0x314d8d(0x1bf)]('hly-tag-extraction-toggle')['checked'],_0x41abcc=_0x50d2f2?document['getElementById'](_0x314d8d(0x1b4))[_0x314d8d(0x146)][_0x314d8d(0x11e)](',')['map'](_0x474c6b=>_0x474c6b[_0x314d8d(0x14d)]())[_0x314d8d(0x1ab)](Boolean):[],_0x13a751=_0x1750b8[_0x314d8d(0xd7)](_0x287f06);if(!_0x13a751||_0x13a751[_0x314d8d(0xe3)]===0x0){_0x148943[_0x314d8d(0x1ed)]=_0x314d8d(0x225),toastr[_0x314d8d(0x17e)](_0x314d8d(0xe4),_0x314d8d(0x11c));return;}const _0x37e283=_0x13a751[_0x314d8d(0x1b5)]((_0x2c7586,_0x1cc6aa)=>{const _0x335b95=_0x314d8d;let _0x1b9c7d;if(_0x2c7586[_0x335b95(0x12c)])_0x1b9c7d=_0x2c7586[_0x335b95(0x160)];else{if(_0x50d2f2&&_0x41abcc['length']>0x0){const _0x233549=extractBlocksByTags(_0x2c7586[_0x335b95(0x160)],_0x41abcc);_0x1b9c7d=_0x233549[_0x335b95(0x145)]('\x0a\x0a');}else _0x1b9c7d=_0x2c7586[_0x335b95(0x160)];_0x1b9c7d=applyExclusionRules(_0x1b9c7d,_0x45b768);}return{'id':_0x335b95(0x139)+_0x1cc6aa,'name':_0x2c7586[_0x335b95(0xef)],'content':_0x1b9c7d[_0x335b95(0x14d)]()};})[_0x314d8d(0x1ab)](_0x6c0b1b=>_0x6c0b1b['content']);if(_0x37e283['length']===0x0){_0x148943['textContent']='根据标签提取或内容排除条件,未找到任何有效内容。',toastr[_0x314d8d(0x17e)](_0x314d8d(0x209),_0x314d8d(0x11c));return;}const _0x35e20c=_0x37e283[_0x314d8d(0x1b5)]((_0x2d878c,_0x1f15b7)=>'\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\x20\x20\x20\x20\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\x20\x20\x20\x20\x20\x20\x20\x20第\x20'+(_0x1f15b7+0x1)+_0x314d8d(0x1f9)+_0x2d878c['name']+_0x314d8d(0x118)+_0x2d878c[_0x314d8d(0x1e8)]+'\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{const _0x28c145=_0x314d8d,_0x812433=[];_0x41e1e8[_0x28c145(0x1c0)](_0x28c145(0x1c3))[_0x28c145(0x102)](function(){const _0x43b049=_0x28c145,_0x3c6f09=$(this)[_0x43b049(0x1c0)]('.hly-preview-textarea')['val']();_0x3c6f09[_0x43b049(0x14d)]()&&_0x812433['push'](_0x3c6f09);});const _0x20eeb4=_0x812433[_0x28c145(0x145)](_0x28c145(0x162)),_0x5f28dc=document[_0x28c145(0x1bf)](_0x28c145(0x22a))[_0x28c145(0x146)],_0x2ad06b=document[_0x28c145(0x1bf)](_0x28c145(0x1e2))[_0x28c145(0x146)];_0x148943[_0x28c145(0x1ed)]=_0x28c145(0xdf)+_0x5f28dc+'\x20楼到\x20'+_0x2ad06b+'\x20楼的内容(共\x20'+_0x812433[_0x28c145(0xe3)]+_0x28c145(0x13b),_0x148943[_0x28c145(0x188)][_0x28c145(0x20d)]=_0x20eeb4,toastr[_0x28c145(0x1d3)](_0x28c145(0x226),_0x28c145(0x197));}}),$(_0x314d8d(0x19a))['on'](_0x314d8d(0x18e),function(_0x5d6578){const _0x3ab938=_0x314d8d;_0x5d6578[_0x3ab938(0xe5)]();const _0x52045f=$(this)['data'](_0x3ab938(0x104));$('#'+_0x52045f)[_0x3ab938(0xf4)]();});}catch(_0x509b60){console['error'](_0x314d8d(0x10f),_0x509b60),_0x148943[_0x314d8d(0x1ed)]=_0x314d8d(0x135)+_0x509b60[_0x314d8d(0x238)],toastr['error'](_0x314d8d(0x135)+_0x509b60['message'],_0x314d8d(0x125));}}function log(_0x1a055c,_0x429d02=_0x34a9aa(0xdc)){const _0x5507be=_0x34a9aa,_0x4bc8a2=document[_0x5507be(0x1bf)](_0x5507be(0x1bc));if(!_0x4bc8a2)return;const _0x760fde=document[_0x5507be(0x1ee)]('p'),_0x3095c7=new Date()[_0x5507be(0xec)]();let _0x35beba=_0x5507be(0x122),_0x28908a=_0x5507be(0x13c);switch(_0x429d02){case _0x5507be(0x1d3):_0x35beba=_0x5507be(0x195),_0x28908a='log-success';break;case'error':_0x35beba=_0x5507be(0x1a2),_0x28908a=_0x5507be(0x1d8);break;case _0x5507be(0xed):_0x35beba=_0x5507be(0x161),_0x28908a=_0x5507be(0x167);break;}_0x760fde[_0x5507be(0x21f)]=_0x5507be(0x1be)+_0x28908a,_0x760fde['innerHTML']=_0x5507be(0x16a)+_0x35beba+_0x5507be(0x1b6)+_0x3095c7+']\x20'+_0x1a055c;const _0x207b33=_0x4bc8a2[_0x5507be(0x115)](_0x5507be(0xfb));_0x207b33&&_0x207b33[_0x5507be(0xf4)](),_0x4bc8a2[_0x5507be(0x1dc)](_0x760fde),_0x4bc8a2[_0x5507be(0x1dd)]=_0x4bc8a2[_0x5507be(0x1c6)];}async function ingestManualText(){const _0xb75136=_0x34a9aa,_0x48eaa0=document[_0xb75136(0x1bf)](_0xb75136(0x116)),_0x427ac7=_0x48eaa0['value'][_0xb75136(0x14d)]();if(!_0x427ac7){toastr['warning'](_0xb75136(0x1d1),_0xb75136(0x11c)),log(_0xb75136(0xd6),_0xb75136(0xed));return;}log(_0xb75136(0x19c)+_0x427ac7[_0xb75136(0xe3)],_0xb75136(0xdc)),toastr[_0xb75136(0xdc)](_0xb75136(0x11a),'圣旨');try{const _0x27aeee=await _0x1750b8['ingestTextToHanlinyuan'](_0x427ac7,_0xb75136(0x232),_0xb75136(0x12e));if(_0x27aeee[_0xb75136(0x1d3)])toastr[_0xb75136(0x1d3)](_0xb75136(0x179)+_0x27aeee[_0xb75136(0x12f)]+_0xb75136(0x1cd),_0xb75136(0x1cf)),log(_0xb75136(0x14a)+_0x27aeee[_0xb75136(0x12f)]+_0xb75136(0x1cd),_0xb75136(0x1d3)),_0x48eaa0[_0xb75136(0x146)]='';else throw new Error(_0x27aeee[_0xb75136(0x154)]||'未知错误');}catch(_0x5eda10){console[_0xb75136(0x154)](_0xb75136(0xf2),_0x5eda10),toastr[_0xb75136(0x154)](_0xb75136(0x18c)+_0x5eda10[_0xb75136(0x238)],_0xb75136(0x125)),log(_0xb75136(0x126)+_0x5eda10[_0xb75136(0x238)],_0xb75136(0x154));}finally{await updatePanelStatus();}} \ No newline at end of file +const _0x3ad8df=_0x2a4d;(function(_0xd21b7d,_0x43c720){const _0x29a77a=_0x2a4d,_0x3315f1=_0xd21b7d();while(!![]){try{const _0x1e44ff=-parseInt(_0x29a77a(0x23a))/0x1+-parseInt(_0x29a77a(0x2f2))/0x2+parseInt(_0x29a77a(0x2d8))/0x3+-parseInt(_0x29a77a(0x1da))/0x4+-parseInt(_0x29a77a(0x285))/0x5*(parseInt(_0x29a77a(0x1bc))/0x6)+parseInt(_0x29a77a(0x1af))/0x7+-parseInt(_0x29a77a(0x275))/0x8*(-parseInt(_0x29a77a(0x1ac))/0x9);if(_0x1e44ff===_0x43c720)break;else _0x3315f1['push'](_0x3315f1['shift']());}catch(_0x13b10a){_0x3315f1['push'](_0x3315f1['shift']());}}}(_0x34d8,0x730f7));import{getContext}from'/scripts/extensions.js';import*as _0x3ae7b8 from'../core/rag-processor.js';import*as _0x3162d4 from'../core/historiographer.js';import*as _0x376d9a from'../core/utils/context-utils.js';import*as _0x3cc817 from'../core/ingestion-manager.js';import{showContentModal,showHtmlModal}from'./page-window.js';function _0x2a4d(_0x27f132,_0x188e02){const _0x34d828=_0x34d8();return _0x2a4d=function(_0x2a4d4f,_0x23f97f){_0x2a4d4f=_0x2a4d4f-0x196;let _0x2e78b4=_0x34d828[_0x2a4d4f];return _0x2e78b4;},_0x2a4d(_0x27f132,_0x188e02);}import{extractBlocksByTags,applyExclusionRules}from'../core/utils/rag-tag-extractor.js';_0x3ad8df(0x1a6);function setupGlobalEventHandlers(){const _0x364a18=_0x3ad8df;window[_0x364a18(0x1b8)]=()=>saveSettingsFromUI(![]),window[_0x364a18(0x1e8)]=resetSettingsToUI,window['testHLYApi']=testApi,window['fetchHLYEmbeddingModels']=fetchHLYEmbeddingModels,window[_0x364a18(0x2e9)]=fetchHLYRerankModels,window['updateHLYMemoryCount']=updatePanelStatus,window['purgeHLYStorage']=purgeStorage,window[_0x364a18(0x29a)]=startCondensation,window['previewHLYCondensation']=previewCondensation,window[_0x364a18(0x1db)]=ingestManualText,window[_0x364a18(0x204)]=log,window[_0x364a18(0x2bf)]=showStats,window['startHLYHistoriography']=startHistoriography;}function updateAndSaveSetting(_0x15f64a,_0x245a44){const _0x2f2482=_0x3ad8df,_0x1ba27e=_0x3ae7b8[_0x2f2482(0x2a4)]();if(!_0x1ba27e)return;const _0x4a3799=_0x15f64a[_0x2f2482(0x23d)]('.');let _0x473997=_0x1ba27e;for(let _0x4dc3bc=0x0;_0x4dc3bc<_0x4a3799[_0x2f2482(0x2fa)]-0x1;_0x4dc3bc++){_0x473997=_0x473997[_0x4a3799[_0x4dc3bc]]=_0x473997[_0x4a3799[_0x4dc3bc]]||{};}_0x473997[_0x4a3799[_0x4a3799[_0x2f2482(0x2fa)]-0x1]]=_0x245a44,_0x3ae7b8[_0x2f2482(0x200)](),log(_0x2f2482(0x248)+_0x15f64a+_0x2f2482(0x2ae)+JSON[_0x2f2482(0x289)](_0x245a44),_0x2f2482(0x2aa));}function bindAutoSaveEvents(){const _0x219c80=_0x3ad8df,_0x5e4c2d=document[_0x219c80(0x2ce)]('hly-modal-container');if(!_0x5e4c2d)return;_0x5e4c2d['addEventListener']('change',_0x119baf=>{const _0xbf507a=_0x219c80,_0x18fce7=_0x119baf[_0xbf507a(0x257)],_0x5c76c4=_0x18fce7[_0xbf507a(0x25e)][_0xbf507a(0x26f)];if(!_0x5c76c4)return;let _0x1e0fa7;const _0x253afa=_0x18fce7['dataset'][_0xbf507a(0x1a1)]||_0xbf507a(0x201);if(_0x18fce7[_0xbf507a(0x1a1)]===_0xbf507a(0x24e))_0x1e0fa7=_0x18fce7[_0xbf507a(0x2d3)];else{if(_0x18fce7[_0xbf507a(0x1a1)]==='radio'){if(_0x18fce7[_0xbf507a(0x2d3)]){const _0x40ecf1=_0x5e4c2d[_0xbf507a(0x2d4)]('input[name=\x22'+_0x18fce7[_0xbf507a(0x1b3)]+'\x22]'),_0x563b1e=Array[_0xbf507a(0x1b6)](_0x40ecf1)[_0xbf507a(0x1d4)](_0x239479=>_0x239479[_0xbf507a(0x2d3)]);_0x1e0fa7=_0x563b1e[_0xbf507a(0x232)];}else return;}else _0x1e0fa7=_0x18fce7['value'];}switch(_0x253afa){case'integer':_0x1e0fa7=parseInt(_0x1e0fa7,0xa);break;case _0xbf507a(0x2f5):_0x1e0fa7=parseFloat(_0x1e0fa7);break;case _0xbf507a(0x2d6):typeof _0x1e0fa7!==_0xbf507a(0x2d6)&&(_0x1e0fa7=_0x1e0fa7===_0xbf507a(0x249));break;}if(_0x18fce7['type']===_0xbf507a(0x2ee)&&!_0x18fce7[_0xbf507a(0x2d3)])return;updateAndSaveSetting(_0x5c76c4,_0x1e0fa7);});}export function bindHanlinyuanEvents(){const _0x417f13=_0x3ad8df,_0x59a51c=getContext();if(!_0x59a51c){console[_0x417f13(0x262)](_0x417f13(0x287));return;}setupGlobalEventHandlers(),bindPanelToggleEvents(),bindInternalUIEvents(),bindTutorialEvents(),bindAutoSaveEvents(),bindSessionLockEvent();if(_0x3ae7b8['initialize'])_0x3ae7b8[_0x417f13(0x2a3)]();else{console[_0x417f13(0x262)](_0x417f13(0x241));return;}loadSettingsToUI(),loadWorldbookList(),log(_0x417f13(0x239),_0x417f13(0x2ef));const _0x275b76=document[_0x417f13(0x2ce)]('hanlinyuan-ingest-novel-file-input'),_0x4949ca=document['getElementById'](_0x417f13(0x244)),_0x1672ab=document[_0x417f13(0x2ce)](_0x417f13(0x265)),_0x27bd03=document['getElementById']('hanlinyuan-ingest-abort'),_0x11c07c=document['getElementById'](_0x417f13(0x1f0)),_0x465d82=document[_0x417f13(0x2ce)](_0x417f13(0x1c9)),_0x2f060c=document['getElementById'](_0x417f13(0x2fc)),_0x13ab74=document[_0x417f13(0x2ce)](_0x417f13(0x1be));let _0x1793eb=null,_0x1c3492=null;_0x275b76[_0x417f13(0x2f1)](_0x417f13(0x27e),_0x557352=>{const _0x1942e5=_0x417f13;_0x1793eb=_0x557352['target'][_0x1942e5(0x20c)][0x0],_0x1793eb?(_0x4949ca['textContent']=_0x1793eb[_0x1942e5(0x1b3)],_0x4949ca[_0x1942e5(0x240)]=_0x1793eb['name']):_0x4949ca['textContent']=_0x1942e5(0x258);}),_0x1672ab['addEventListener'](_0x417f13(0x27c),async()=>{const _0x2e81d8=_0x417f13;if(!_0x1793eb){toastr['warning'](_0x2e81d8(0x235));return;}let _0x56f9df=0x0;const _0x241c49=_0x3cc817[_0x2e81d8(0x2e2)](_0x1793eb),_0x208509=_0x3cc817['loadProgress'](_0x241c49);if(_0x208509){const _0x3ab78b=(_0x208509[_0x2e81d8(0x21c)]/_0x208509['totalChunks']*0x64)[_0x2e81d8(0x2b7)](0x1),_0x74f031=confirm(_0x2e81d8(0x2f0)+_0x3ab78b+_0x2e81d8(0x24f));_0x74f031?(_0x56f9df=_0x208509['processedChunks'],toastr[_0x2e81d8(0x2ef)](_0x2e81d8(0x19e)+(_0x56f9df+0x1)+_0x2e81d8(0x254),_0x2e81d8(0x1dc)),log(_0x2e81d8(0x1c7)+_0x241c49+_0x2e81d8(0x271)+_0x56f9df+_0x2e81d8(0x1a4),'info')):(_0x3cc817[_0x2e81d8(0x213)](_0x241c49),toastr[_0x2e81d8(0x2ef)](_0x2e81d8(0x227),_0x2e81d8(0x1dc)),log(_0x2e81d8(0x222)+_0x241c49+',重新开始。','warn'));}_0x1c3492=new AbortController();const _0x1c3467=_0x1c3492['signal'];_0x13ab74['style'][_0x2e81d8(0x1e6)]=_0x2e81d8(0x2d1),_0x11c07c['style']['display']=_0x2e81d8(0x1c8),_0x2f060c[_0x2e81d8(0x1e9)]=_0x2e81d8(0x1f5),_0x465d82[_0x2e81d8(0x232)]=0x0;try{const _0x82198=await _0x1793eb[_0x2e81d8(0x251)](),_0x105c1c=_0x1b1d19=>{const _0x51fd43=_0x2e81d8;_0x2f060c['textContent']=_0x51fd43(0x1a3)+_0x1b1d19['message']+'\x20('+_0x1b1d19[_0x51fd43(0x2e7)]+'/'+_0x1b1d19[_0x51fd43(0x1ec)]+')',_0x465d82['value']=_0x1b1d19[_0x51fd43(0x2e7)]/_0x1b1d19[_0x51fd43(0x1ec)]*0x64;},_0x548904=()=>{const _0x1ed63c=_0x2e81d8;updatePanelStatus(),log('[实时刷新]\x20批次完成,忆识总数已更新。',_0x1ed63c(0x2ef));},_0x20ef38=await _0x3ae7b8[_0x2e81d8(0x26d)](_0x82198,'novel',_0x1793eb[_0x2e81d8(0x1b3)],_0x105c1c,_0x1c3467,log,_0x548904,_0x241c49,_0x56f9df);if(_0x20ef38[_0x2e81d8(0x2aa)])toastr[_0x2e81d8(0x2aa)](_0x2e81d8(0x1c5)+_0x20ef38[_0x2e81d8(0x1d9)]+'\x20个知识块'),_0x2f060c[_0x2e81d8(0x1e9)]=_0x2e81d8(0x1ad)+_0x20ef38[_0x2e81d8(0x1d9)]+_0x2e81d8(0x24a),_0x465d82[_0x2e81d8(0x232)]=0x64,updatePanelStatus();else throw new Error(_0x20ef38[_0x2e81d8(0x262)]||_0x2e81d8(0x2b2));}catch(_0x5073f5){_0x5073f5[_0x2e81d8(0x1b3)]===_0x2e81d8(0x2a8)?(toastr[_0x2e81d8(0x2ef)](_0x2e81d8(0x29c)),_0x2f060c[_0x2e81d8(0x1e9)]=_0x2e81d8(0x266)):(toastr[_0x2e81d8(0x262)](_0x2e81d8(0x1bb)+_0x5073f5['message']+_0x2e81d8(0x24b)),_0x2f060c[_0x2e81d8(0x1e9)]='错误:\x20'+_0x5073f5[_0x2e81d8(0x1c4)]);}finally{setTimeout(()=>{const _0x4ad322=_0x2e81d8;_0x13ab74['style'][_0x4ad322(0x1e6)]='flex',_0x11c07c[_0x4ad322(0x2d0)][_0x4ad322(0x1e6)]=_0x4ad322(0x2d1),_0x275b76[_0x4ad322(0x232)]='',_0x1793eb=null,_0x4949ca[_0x4ad322(0x1e9)]='未选择文件';},0xbb8);}}),_0x27bd03[_0x417f13(0x2f1)](_0x417f13(0x27c),()=>{_0x1c3492&&_0x1c3492['abort']();});}function bindSessionLockEvent(){const _0x4c87f8=_0x3ad8df,_0x52b9ed=document[_0x4c87f8(0x2ce)](_0x4c87f8(0x2df));if(!_0x52b9ed)return;_0x52b9ed[_0x4c87f8(0x2f1)](_0x4c87f8(0x27c),async()=>{const _0x3173bc=_0x4c87f8,_0x1f75eb=await _0x3ae7b8[_0x3173bc(0x1de)]();updateSessionLockUI(_0x1f75eb);if(_0x1f75eb){const _0x28953a=_0x3ae7b8[_0x3173bc(0x1e7)]();_0x28953a&&(toastr['success'](_0x3173bc(0x22c)+_0x28953a['id'],_0x3173bc(0x273)),log('会话已锁定到宝库:\x20'+_0x28953a['id'],_0x3173bc(0x2aa)));}else toastr[_0x3173bc(0x2ef)](_0x3173bc(0x22a),'诏曰'),log(_0x3173bc(0x250),_0x3173bc(0x2ef));updatePanelStatus();}),updateSessionLockUI(_0x3ae7b8[_0x4c87f8(0x27d)]());}function _0x34d8(){const _0x25505a=['title','[翰林院-枢纽]\x20核心法典未能提供初始化圣旨!','\x20条忆识。','根据标签提取或内容排除条件,未找到任何有效内容。','hanlinyuan-ingest-novel-file-name','appendChild','rerank','hly-rerank-hybrid-alpha','[自动保存]\x20设置项\x20\x27','true','\x20个知识块。','。进度已保存,可稍后重试。','成功加载\x20','hly-','checkbox','%。是否从上次中断之处继续?','会话已解锁。','text','hly-log-output','content','\x20块继续录入。','hly-match-threshold','检测到预览后待处理的文本,开始直接凝识...','target','未选择文件','innerHTML','\x20进行编纂...','大功告成','请选择一个书库...','用户尝试录入空文本。','dataset','手动录入成功,新增\x20','点击以解锁,让翰林院跟随当前角色','comment','error','查看宝库状态成功:集合ID=','[翰林院-枢纽]\x20获取Rerank模型列表失败:','hanlinyuan-ingest-novel-start','任务已中止。','hly-exclusion-rules-btn','.hly-preview-item-v2','翰林院使用教程','queryMessageCount','手动录入','testApiConnection','ingestTextToHanlinyuan','用户请求查看宝库状态。','settingKey','fetchRerankModels',',从第\x20','hly-historiography-results','圣旨已下','聊天记录从第\x20','7556368gQnRVB','\x22>\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\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20第\x20','》获取条目列表...','retrieval','凝识完成!新增\x20','hly-layer-start','template','click','isSessionLocked','change','\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20正在加载条目...','depth','hly-delete-rule-btn','hly-layer-end','加载书库列表失败:\x20','\x20楼凝识至第\x20','请先选择一个书库和要编纂的条目。','预览并编辑凝识内容','hly-retrieval-enabled','hly-rerank-url','\x0a所用模型:\x20','hly-api-endpoint',')\x20的编纂任务已完成。','startHLYCondensation','beforeend','任务已由用户中止。进度已保存,可随时继续。','hly-include-ai','condensationHistory','点击以锁定,让翰林院固定操作当前角色的宝库','createElement','\x20个书库。','hly-current-chat-id','initialize','getSettings','join','hly-embedding-model','上次已从第\x20','AbortError','编纂任务已完成。','success','\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加载失败','','url','enabled','hly-tag-extraction-toggle','\x20个Rerank模型。','getElementById','手动录入失败:\x20','style','none','.hly-preview-textarea','checked','querySelectorAll','hly-batch-size','boolean','请选择一个条目...','422841tzRyYj','tab','forEach','chunkSize','圣谕不明','embeddingModel','\x0a
\x0a翰林院宝库状态\x0a--------------------\x0a集合ID:\x20','hly-session-lock-btn','warning','preview-item-','generateJobId','push','神力连接通畅!','已选择\x20','未能获取到任何模型。','processed','预览后文本录入成功,新增\x20','fetchHLYRerankModels','翰林院设定已存档封印。','span','fa-circle-info','notify','radio','info','启禀大人,发现此书上次录入已完成\x20','addEventListener','116292dCGxAw','hly-chunk-size','翰林院启奏','float','condensation','key','未找到任何书库','remove','length','hly-tag-input-container','hanlinyuan-ingest-status','》中的条目【','未能获取到任何Rerank模型。','batchSize','会话已锁定','解锁会话','根据当前勾选条件,未找到符合的消息可供预览。','hly-condensation-results','凝识失败:\x20','processCondensation','hly-rerank-model','custom','\x22\x20title=\x22删除此条\x22>×\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20','injection','getMessagesForCondensation','遵命,将从第\x20','\x20条消息,开始凝识...','model','type','trim','处理中:\x20','\x20块开始。','hly-condensation-enabled','use\x20strict','add','maxResults','\x22\x20placeholder=\x22开始字符,\x20如\x20\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20×\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20','hly-log-entry\x20','count','1946892cEDaFH','ingestHLYManualText','圣旨已达','获取Rerank模型失败:\x20','toggleSessionLock','manual','\x22>\x20[','\x20个模型。','[翰林院-枢纽]\x20编纂过程发生错误:','未知的编纂错误','hly-injection-template','\x20楼到第\x20','display','getLockedSessionInfo','resetHLYSettings','textContent','#hly-rules-list','','total','fa-check-circle','finalText','\x0a
\x0a\x20\x20\x20\x20\x20\x20\x20\x20','hanlinyuan-ingest-progress-container','end','purgeStorage','includes','','正在读取文件...','\x20楼已成功凝识,新增\x20','position','\x0a\x0a---\x0a\x0a','\x0a忆识总数:\x20','selectedIndex','此操作将彻底清空当前角色的所有忆识(向量),且无法恢复。您确定要继续吗?','预览失败:\x20','integer','清空宝库失败。','文书录入失败:\x20','saveSettings','string','hly-exclusion-rules-container','文书已成功录入宝库,新增\x20','hlyLog','\x20个条目。','fas\x20fa-lock-open','hly-overlap-size','hly-current-vector-count','.hly-exclusion-rule-row','fetchEmbeddingModels','classList','files','已采集\x20','严重错误','fas\x20fa-lock','toggle','[翰林院-枢纽]\x20更新忆识数量失败:','chat','clearJob','\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\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\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20','编纂失败:\x20','hly-hist-select-entry','\x20楼到\x20','className','layerEnd','data','getLoresForWorldbook','processedChunks','\x20楼。

','》的条目失败:','》中的条目\x20(Key:\x20','[翰林院-枢纽]\x20预览过程发生错误:','编辑内容排除规则','[断点续传]\x20用户选择放弃旧任务\x20','hly-hist-select-library','disabled','each','advanced','遵命,将从头开始录入此书。','收到手动录入请求,文本长度:\x20','input[name=\x22hly-injection-position\x22]:checked','会话已解锁,将跟随当前角色。','成功获取\x20','会话已锁定到:\x20','请先选择书库','获取模型失败:\x20','filter','exclusionRules','录入内容不能为空。','value','hly-rerank-notify','hly-include-user','请先选择一个\x20.txt\x20文件',']\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\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','编纂任务已开始...','customApiUrl','[翰林院-枢纽]\x20已成功连接各部,政令畅通。','186497RIQkPJ','开始获取模型列表...','apiEndpoint','split','未找到符合条件的消息。','查询宝库状态失败:\x20'];_0x34d8=function(){return _0x25505a;};return _0x34d8();}function updateSessionLockUI(_0x2c6a8e){const _0x48c223=_0x3ad8df,_0x4a02ab=document['getElementById'](_0x48c223(0x2df));if(!_0x4a02ab)return;const _0x25617b=_0x4a02ab[_0x48c223(0x2c5)]('i'),_0x10ce2f=_0x4a02ab[_0x48c223(0x2c5)](_0x48c223(0x2eb));_0x2c6a8e?(_0x4a02ab[_0x48c223(0x20b)][_0x48c223(0x1a7)]('active'),_0x25617b[_0x48c223(0x218)]=_0x48c223(0x20f),_0x10ce2f[_0x48c223(0x1e9)]=_0x48c223(0x301),_0x4a02ab['title']=_0x48c223(0x260)):(_0x4a02ab['classList'][_0x48c223(0x2f9)]('active'),_0x25617b[_0x48c223(0x218)]=_0x48c223(0x206),_0x10ce2f['textContent']=_0x48c223(0x286),_0x4a02ab[_0x48c223(0x240)]=_0x48c223(0x29f));}function bindPanelToggleEvents(){const _0x3f40a5=_0x3ad8df,_0x34b52a=document[_0x3f40a5(0x2ce)]('amily2_open_rag_palace');if(_0x34b52a){}}function bindTutorialEvents(){const _0x2770d2=_0x3ad8df,_0xf47b7a=document[_0x2770d2(0x2ce)](_0x2770d2(0x1c2));_0xf47b7a&&_0xf47b7a[_0x2770d2(0x2f1)](_0x2770d2(0x27c),()=>{const _0xab79cc=_0x2770d2;showContentModal(_0xab79cc(0x269),'scripts/extensions/third-party/ST-Amily2-Chat-Optimisation/HanLin.md');});}function bindInternalUIEvents(){const _0x5d2130=_0x3ad8df,_0x12b14e=document[_0x5d2130(0x2d4)](_0x5d2130(0x2be));_0x12b14e[_0x5d2130(0x2da)](_0x28a958=>{const _0x83f71d=_0x5d2130;_0x28a958['addEventListener'](_0x83f71d(0x27c),()=>{const _0x57dc0d=_0x83f71d,_0x5ea7fa=_0x28a958[_0x57dc0d(0x25e)][_0x57dc0d(0x2d9)],_0xf000a0=_0x57dc0d(0x24d)+_0x5ea7fa+_0x57dc0d(0x1c0);document[_0x57dc0d(0x2d4)](_0x57dc0d(0x2c0))[_0x57dc0d(0x2da)](_0x471315=>{const _0x2e774e=_0x57dc0d;_0x471315[_0x2e774e(0x20b)][_0x2e774e(0x210)](_0x2e774e(0x1cd),_0x471315['id']===_0xf000a0);}),_0x12b14e[_0x57dc0d(0x2da)](_0x50eaf8=>_0x50eaf8[_0x57dc0d(0x20b)]['toggle'](_0x57dc0d(0x1cd),_0x50eaf8===_0x28a958));});});const _0x5165e6=document['getElementById']('hly-api-endpoint');_0x5165e6&&_0x5165e6[_0x5d2130(0x2f1)](_0x5d2130(0x27e),toggleCustomEndpointDocket);const _0x3dce1b=document[_0x5d2130(0x2d4)]('input[name=\x22hly-injection-position\x22]');_0x3dce1b['forEach'](_0x37e0c1=>{const _0x146532=_0x5d2130;_0x37e0c1[_0x146532(0x2f1)]('change',toggleInjectionDetails);});const _0x139af2=document['getElementById'](_0x5d2130(0x2cc)),_0x1ad02f=document[_0x5d2130(0x2ce)](_0x5d2130(0x2fb));_0x139af2&&_0x1ad02f&&_0x139af2['addEventListener'](_0x5d2130(0x27e),()=>{const _0x45b877=_0x5d2130;_0x1ad02f[_0x45b877(0x2d0)][_0x45b877(0x1e6)]=_0x139af2[_0x45b877(0x2d3)]?_0x45b877(0x1c8):_0x45b877(0x2d1);});const _0xecd252=document[_0x5d2130(0x2ce)](_0x5d2130(0x223));_0xecd252&&_0xecd252[_0x5d2130(0x2f1)](_0x5d2130(0x27e),handleWorldbookSelectionChange);const _0x13f258=document['getElementById'](_0x5d2130(0x267));_0x13f258&&_0x13f258[_0x5d2130(0x2f1)](_0x5d2130(0x27c),showExclusionRulesModal);}function toggleInjectionDetails(){const _0x5b5964=_0x3ad8df,_0x41dae2=document[_0x5b5964(0x2c5)](_0x5b5964(0x229))[_0x5b5964(0x232)],_0x52c2ab=document[_0x5b5964(0x2ce)](_0x5b5964(0x2b5)),_0x8b08b4=document[_0x5b5964(0x2ce)](_0x5b5964(0x2b0)),_0x33653a=_0x41dae2==='1';_0x52c2ab[_0x5b5964(0x224)]=!_0x33653a,_0x8b08b4[_0x5b5964(0x224)]=!_0x33653a;}function toggleCustomEndpointDocket(){const _0x516e4d=_0x3ad8df,_0x4c2300=document[_0x516e4d(0x2ce)](_0x516e4d(0x298))[_0x516e4d(0x232)],_0xc464fe=document['getElementById']('hly-custom-endpoint-docket');_0xc464fe&&(_0xc464fe['style'][_0x516e4d(0x1e6)]=_0x4c2300===_0x516e4d(0x19a)||_0x4c2300===_0x516e4d(0x1d2)?_0x516e4d(0x1c8):'none');}function loadSettingsToUI(){const _0x36656b=_0x3ad8df,_0x3c66db=_0x3ae7b8[_0x36656b(0x2a4)]();if(!_0x3c66db)return;document['getElementById'](_0x36656b(0x295))[_0x36656b(0x2d3)]=_0x3c66db['retrieval']['enabled'],document[_0x36656b(0x2ce)](_0x36656b(0x298))[_0x36656b(0x232)]=_0x3c66db[_0x36656b(0x278)][_0x36656b(0x23c)],document[_0x36656b(0x2ce)]('hly-custom-api-url')[_0x36656b(0x232)]=_0x3c66db[_0x36656b(0x278)][_0x36656b(0x238)],document[_0x36656b(0x2ce)]('hly-api-key')[_0x36656b(0x232)]=_0x3c66db[_0x36656b(0x278)][_0x36656b(0x1d3)];const _0x534754=document[_0x36656b(0x2ce)](_0x36656b(0x2a6));if(_0x534754[_0x36656b(0x1cb)]['length']===0x0){const _0x3a5bd6=_0x3c66db['retrieval']['embeddingModel'],_0x4fb46d=new Option(_0x3a5bd6,_0x3a5bd6,!![],!![]);_0x534754['add'](_0x4fb46d);}_0x534754[_0x36656b(0x232)]=_0x3c66db[_0x36656b(0x278)][_0x36656b(0x2dd)],document[_0x36656b(0x2ce)](_0x36656b(0x2b1))[_0x36656b(0x2d3)]=_0x3c66db[_0x36656b(0x278)][_0x36656b(0x2ed)],document[_0x36656b(0x2ce)](_0x36656b(0x2f3))[_0x36656b(0x232)]=_0x3c66db[_0x36656b(0x226)][_0x36656b(0x2db)],document[_0x36656b(0x2ce)](_0x36656b(0x207))[_0x36656b(0x232)]=_0x3c66db['advanced']['overlap'],document['getElementById'](_0x36656b(0x255))[_0x36656b(0x232)]=_0x3c66db[_0x36656b(0x226)][_0x36656b(0x28c)],document[_0x36656b(0x2ce)]('hly-query-message-count')[_0x36656b(0x232)]=_0x3c66db[_0x36656b(0x226)][_0x36656b(0x26a)],document[_0x36656b(0x2ce)]('hly-max-results')[_0x36656b(0x232)]=_0x3c66db[_0x36656b(0x226)][_0x36656b(0x1a8)],document[_0x36656b(0x2ce)](_0x36656b(0x2d5))['value']=_0x3c66db[_0x36656b(0x278)][_0x36656b(0x2ff)],document[_0x36656b(0x2ce)](_0x36656b(0x1e4))[_0x36656b(0x232)]=_0x3c66db[_0x36656b(0x19c)][_0x36656b(0x27b)];const _0x4fcd6f=document[_0x36656b(0x2c5)](_0x36656b(0x1b7)+_0x3c66db[_0x36656b(0x19c)][_0x36656b(0x1f7)]+'\x22]');_0x4fcd6f&&(_0x4fcd6f[_0x36656b(0x2d3)]=!![]);document['getElementById']('hly-injection-depth')['value']=_0x3c66db[_0x36656b(0x19c)][_0x36656b(0x28e)],document[_0x36656b(0x2ce)](_0x36656b(0x2b0))[_0x36656b(0x232)]=_0x3c66db['injection'][_0x36656b(0x2af)],toggleInjectionDetails(),document['getElementById'](_0x36656b(0x1a5))[_0x36656b(0x2d3)]=_0x3c66db['condensation'][_0x36656b(0x2cb)],document['getElementById'](_0x36656b(0x27a))[_0x36656b(0x232)]=_0x3c66db[_0x36656b(0x2f6)]['layerStart'],document['getElementById']('hly-layer-end')['value']=_0x3c66db[_0x36656b(0x2f6)][_0x36656b(0x219)],document['getElementById'](_0x36656b(0x234))['checked']=_0x3c66db[_0x36656b(0x2f6)]['messageTypes']['user'],document[_0x36656b(0x2ce)](_0x36656b(0x29d))[_0x36656b(0x2d3)]=_0x3c66db[_0x36656b(0x2f6)][_0x36656b(0x1cf)]['ai'];const _0x16bdf7=document[_0x36656b(0x2ce)](_0x36656b(0x2cc)),_0x1a36e9=document['getElementById']('hly-tag-input'),_0x30498b=document[_0x36656b(0x2ce)](_0x36656b(0x2fb));_0x16bdf7['checked']=_0x3c66db['condensation']['tagExtractionEnabled'],_0x1a36e9['value']=_0x3c66db[_0x36656b(0x2f6)][_0x36656b(0x2bc)],_0x30498b[_0x36656b(0x2d0)][_0x36656b(0x1e6)]=_0x16bdf7[_0x36656b(0x2d3)]?'block':_0x36656b(0x2d1),document['getElementById']('hly-rerank-enabled')[_0x36656b(0x2d3)]=_0x3c66db[_0x36656b(0x246)][_0x36656b(0x2cb)],document[_0x36656b(0x2ce)](_0x36656b(0x296))[_0x36656b(0x232)]=_0x3c66db[_0x36656b(0x246)][_0x36656b(0x2ca)],document[_0x36656b(0x2ce)]('hly-rerank-api-key')[_0x36656b(0x232)]=_0x3c66db[_0x36656b(0x246)][_0x36656b(0x1d3)];const _0x54b9b5=document[_0x36656b(0x2ce)](_0x36656b(0x199));if(_0x54b9b5[_0x36656b(0x1cb)]['length']===0x0){const _0x4eec9f=_0x3c66db['rerank'][_0x36656b(0x1a0)];if(_0x4eec9f){const _0x3ccc16=new Option(_0x4eec9f,_0x4eec9f,!![],!![]);_0x54b9b5['add'](_0x3ccc16);}}_0x54b9b5[_0x36656b(0x232)]=_0x3c66db['rerank']['model'],document[_0x36656b(0x2ce)]('hly-rerank-top-n')[_0x36656b(0x232)]=_0x3c66db['rerank']['top_n'],document[_0x36656b(0x2ce)](_0x36656b(0x247))[_0x36656b(0x232)]=_0x3c66db['rerank']['hybrid_alpha'],document[_0x36656b(0x2ce)](_0x36656b(0x233))[_0x36656b(0x2d3)]=_0x3c66db[_0x36656b(0x246)][_0x36656b(0x2ed)],toggleCustomEndpointDocket();}function saveSettingsFromUI(_0x4e9a12=!![]){const _0x3096db=_0x3ad8df,_0x2f1b4c=document[_0x3096db(0x2ce)]('hly-modal-container');if(!_0x2f1b4c)return;const _0x54521e=_0x2f1b4c[_0x3096db(0x2d4)]('[data-setting-key]');_0x54521e[_0x3096db(0x2da)](_0x585468=>{const _0x37bb30=_0x3096db,_0x35e440=_0x585468['dataset'][_0x37bb30(0x26f)];if(!_0x35e440)return;let _0x190170;const _0x8ad6b=_0x585468[_0x37bb30(0x25e)][_0x37bb30(0x1a1)]||_0x37bb30(0x201);if(_0x585468['type']===_0x37bb30(0x24e))_0x190170=_0x585468['checked'];else{if(_0x585468['type']===_0x37bb30(0x2ee)){if(!_0x585468[_0x37bb30(0x2d3)])return;_0x190170=_0x585468[_0x37bb30(0x232)];}else _0x190170=_0x585468[_0x37bb30(0x232)];}switch(_0x8ad6b){case _0x37bb30(0x1fd):_0x190170=parseInt(_0x190170,0xa);break;case'float':_0x190170=parseFloat(_0x190170);break;case'boolean':if(typeof _0x190170!==_0x37bb30(0x2d6))_0x190170=_0x190170===_0x37bb30(0x249);break;}const _0x53753b=_0x3ae7b8['getSettings'](),_0xe23284=_0x35e440['split']('.');let _0x314fa4=_0x53753b;for(let _0x3229f6=0x0;_0x3229f6<_0xe23284[_0x37bb30(0x2fa)]-0x1;_0x3229f6++){_0x314fa4=_0x314fa4[_0xe23284[_0x3229f6]]=_0x314fa4[_0xe23284[_0x3229f6]]||{};}_0x314fa4[_0xe23284[_0xe23284['length']-0x1]]=_0x190170;}),_0x3ae7b8[_0x3096db(0x200)](),!_0x4e9a12&&(log(_0x3096db(0x2b4),_0x3096db(0x2aa)),toastr[_0x3096db(0x2aa)](_0x3096db(0x2ea),_0x3096db(0x1dc)));}function resetSettingsToUI(){const _0x1afab0=_0x3ad8df;confirm('您确定要将所有设定恢复为出厂默认值吗?')&&(_0x3ae7b8['resetSettings'](),loadSettingsToUI(),toastr[_0x1afab0(0x2ef)]('翰林院设定已重置为初始状态。','诏曰'));}async function updatePanelStatus(){const _0x1c054e=_0x3ad8df,_0x50c501=_0x3ae7b8[_0x1c054e(0x27d)](),_0x5a7b6a=document[_0x1c054e(0x2ce)]('hly-current-character-name'),_0x239402=document[_0x1c054e(0x2ce)](_0x1c054e(0x2a2));if(_0x50c501){const _0x450b1e=_0x3ae7b8['getLockedSessionInfo']();_0x450b1e&&(_0x5a7b6a[_0x1c054e(0x1e9)]=_0x1c054e(0x300),_0x239402[_0x1c054e(0x1e9)]=_0x450b1e['id'],_0x239402[_0x1c054e(0x240)]=_0x1c054e(0x284)+_0x450b1e['id'],_0x5a7b6a[_0x1c054e(0x20b)][_0x1c054e(0x1a7)]('hly-locked-status'),_0x239402[_0x1c054e(0x20b)][_0x1c054e(0x1a7)](_0x1c054e(0x2ac)));}else _0x5a7b6a[_0x1c054e(0x1e9)]=_0x376d9a[_0x1c054e(0x2c4)](),_0x239402[_0x1c054e(0x1e9)]=_0x376d9a['getChatId']()||'无',_0x239402[_0x1c054e(0x240)]='',_0x5a7b6a[_0x1c054e(0x20b)]['remove'](_0x1c054e(0x2ac)),_0x239402['classList'][_0x1c054e(0x2f9)]('hly-locked-status');const _0x5587c3=document[_0x1c054e(0x2ce)](_0x1c054e(0x208));_0x5587c3[_0x1c054e(0x1e9)]=_0x1c054e(0x1b0);try{const _0x17f835=await _0x3ae7b8[_0x1c054e(0x1aa)]();_0x5587c3[_0x1c054e(0x1e9)]=_0x17f835;}catch(_0x16b193){console[_0x1c054e(0x262)](_0x1c054e(0x211),_0x16b193),_0x5587c3[_0x1c054e(0x1e9)]=_0x1c054e(0x2bd),_0x5587c3['title']=_0x1c054e(0x288)+_0x16b193['message'];}const _0x4c695f=document['getElementById']('hly-condensation-results');if(_0x4c695f&&!_0x4c695f[_0x1c054e(0x25e)][_0x1c054e(0x1ee)]){const _0x1b9d47=_0x3ae7b8[_0x1c054e(0x2a4)](),_0x3b817f=await _0x3ae7b8[_0x1c054e(0x1b9)]();if(_0x1b9d47[_0x1c054e(0x29e)]&&_0x1b9d47['condensationHistory'][_0x3b817f]){const _0x2e40e2=_0x1b9d47[_0x1c054e(0x29e)][_0x3b817f];_0x4c695f['innerHTML']=_0x1c054e(0x2a7)+_0x2e40e2['start']+_0x1c054e(0x292)+_0x2e40e2[_0x1c054e(0x1f1)]+_0x1c054e(0x21d);}else _0x4c695f['innerHTML']='可在此预览凝识结果。

';}}async function testApi(){const _0x5845cc=_0x3ad8df;toastr[_0x5845cc(0x2ef)]('正在测试神力连接...','圣旨');try{await _0x3ae7b8[_0x5845cc(0x26c)](),toastr[_0x5845cc(0x2aa)](_0x5845cc(0x2e4),'圣意');}catch(_0x14cabf){toastr[_0x5845cc(0x262)]('神力连接失败:\x20'+_0x14cabf['message'],'警报');}}async function fetchHLYEmbeddingModels(){const _0x354375=_0x3ad8df,_0x16d8d4=document[_0x354375(0x2ce)]('hly-embedding-model'),_0x58e60c=_0x16d8d4[_0x354375(0x232)];_0x16d8d4[_0x354375(0x259)]='',_0x16d8d4['disabled']=!![];try{log(_0x354375(0x23b),_0x354375(0x2ef));const _0x4d789c=await _0x3ae7b8[_0x354375(0x20a)]();_0x16d8d4['innerHTML']='';if(_0x4d789c[_0x354375(0x2fa)]===0x0){_0x16d8d4[_0x354375(0x259)]=_0x354375(0x1eb),toastr[_0x354375(0x1ab)]('未能获取到任何模型。','翰林院启奏'),log(_0x354375(0x2e6),_0x354375(0x1ab));return;}_0x4d789c[_0x354375(0x2da)](_0x59fff2=>{const _0x196768=_0x354375,_0x45126d=new Option(_0x59fff2,_0x59fff2);_0x16d8d4[_0x196768(0x1a7)](_0x45126d);}),_0x4d789c[_0x354375(0x1f3)](_0x58e60c)?_0x16d8d4[_0x354375(0x232)]=_0x58e60c:_0x16d8d4[_0x354375(0x1fa)]=0x0,toastr[_0x354375(0x2aa)]('成功获取\x20'+_0x4d789c[_0x354375(0x2fa)]+_0x354375(0x1e1),'圣意'),log(_0x354375(0x22b)+_0x4d789c['length']+_0x354375(0x1e1),_0x354375(0x2aa));}catch(_0x48cd4d){console[_0x354375(0x262)]('[翰林院-枢纽]\x20获取模型列表失败:',_0x48cd4d),toastr['error'](_0x354375(0x22e)+_0x48cd4d['message'],'严重错误'),log('获取模型失败:\x20'+_0x48cd4d[_0x354375(0x1c4)],'error'),_0x16d8d4['innerHTML']=_0x354375(0x2c9);}finally{_0x16d8d4[_0x354375(0x224)]=![];}}async function fetchHLYRerankModels(){const _0x308ee5=_0x3ad8df,_0x3d34e2=document[_0x308ee5(0x2ce)]('hly-rerank-model'),_0x156b87=_0x3d34e2[_0x308ee5(0x232)];_0x3d34e2[_0x308ee5(0x259)]=_0x308ee5(0x1f4),_0x3d34e2['disabled']=!![];try{log('开始获取Rerank模型列表...',_0x308ee5(0x2ef));const _0x477aa1=await _0x3ae7b8[_0x308ee5(0x270)]();_0x3d34e2[_0x308ee5(0x259)]='';if(_0x477aa1['length']===0x0){_0x3d34e2[_0x308ee5(0x259)]=_0x308ee5(0x1eb),toastr[_0x308ee5(0x1ab)]('未能获取到任何Rerank模型。',_0x308ee5(0x2f4)),log(_0x308ee5(0x2fe),'warn');return;}_0x477aa1['forEach'](_0x26acd8=>{const _0x3e0dd9=_0x308ee5,_0x7e97c9=new Option(_0x26acd8,_0x26acd8);_0x3d34e2[_0x3e0dd9(0x1a7)](_0x7e97c9);}),_0x477aa1['includes'](_0x156b87)?_0x3d34e2[_0x308ee5(0x232)]=_0x156b87:_0x3d34e2[_0x308ee5(0x1fa)]=0x0,toastr[_0x308ee5(0x2aa)]('成功获取\x20'+_0x477aa1[_0x308ee5(0x2fa)]+_0x308ee5(0x2cd),'圣意'),log('成功获取\x20'+_0x477aa1['length']+_0x308ee5(0x2cd),_0x308ee5(0x2aa));}catch(_0x3e3ac2){console['error'](_0x308ee5(0x264),_0x3e3ac2),toastr[_0x308ee5(0x262)](_0x308ee5(0x1dd)+_0x3e3ac2[_0x308ee5(0x1c4)],_0x308ee5(0x20e)),log(_0x308ee5(0x1dd)+_0x3e3ac2[_0x308ee5(0x1c4)],_0x308ee5(0x262)),_0x3d34e2[_0x308ee5(0x259)]=_0x308ee5(0x2c9);}finally{_0x3d34e2[_0x308ee5(0x224)]=![];}}async function purgeStorage(){const _0x1a4bec=_0x3ad8df;if(confirm(_0x1a4bec(0x1fb))){toastr[_0x1a4bec(0x2ef)]('正在清空宝库...','圣旨');const _0x150b08=await _0x3ae7b8[_0x1a4bec(0x1f2)]();_0x150b08?toastr[_0x1a4bec(0x2aa)](_0x1a4bec(0x2c7),'圣意'):toastr[_0x1a4bec(0x262)](_0x1a4bec(0x1fe),'警报'),await updatePanelStatus();}}async function startCondensation(){const _0x1a54eb=_0x3ad8df,_0x13c1ff=document[_0x1a54eb(0x2ce)]('hly-condensation-results'),_0x5874d9=_0x13c1ff['dataset'][_0x1a54eb(0x1ee)],_0x356ae2=document['getElementById']('hly-layer-start')['value'],_0x14d298=document['getElementById'](_0x1a54eb(0x290))[_0x1a54eb(0x232)],_0x11a6a7={'start':parseInt(_0x356ae2),'end':parseInt(_0x14d298)};try{if(_0x5874d9&&_0x5874d9[_0x1a54eb(0x1a2)]()){log(_0x1a54eb(0x256),_0x1a54eb(0x2ef)),toastr[_0x1a54eb(0x2ef)](_0x1a54eb(0x2ad),'圣旨'),_0x13c1ff[_0x1a54eb(0x1e9)]=_0x1a54eb(0x2b9);const _0x532be5=await _0x3ae7b8[_0x1a54eb(0x26d)](_0x5874d9,'chat_history',_0x1a54eb(0x1b1)+_0x11a6a7[_0x1a54eb(0x1c1)]+'-'+_0x11a6a7[_0x1a54eb(0x1f1)],()=>{},null,log,()=>{},null,0x0,_0x11a6a7);if(_0x532be5[_0x1a54eb(0x2aa)]){toastr[_0x1a54eb(0x2aa)](_0x1a54eb(0x203)+_0x532be5[_0x1a54eb(0x1d9)]+_0x1a54eb(0x242),_0x1a54eb(0x25b)),log(_0x1a54eb(0x2e8)+_0x532be5[_0x1a54eb(0x1d9)]+'\x20条忆识。',_0x1a54eb(0x2aa));const _0x3c643d=_0x11a6a7[_0x1a54eb(0x1f1)]===0x0?getContext()['chat'][_0x1a54eb(0x2fa)]:_0x11a6a7[_0x1a54eb(0x1f1)];_0x13c1ff[_0x1a54eb(0x1e9)]=_0x1a54eb(0x274)+_0x11a6a7[_0x1a54eb(0x1c1)]+_0x1a54eb(0x1e5)+_0x3c643d+_0x1a54eb(0x1f6)+_0x532be5[_0x1a54eb(0x1d9)]+_0x1a54eb(0x242),delete _0x13c1ff['dataset'][_0x1a54eb(0x1ee)];}else throw new Error(_0x532be5['error']||'未知错误');}else{_0x13c1ff['textContent']=_0x1a54eb(0x2c6),toastr[_0x1a54eb(0x2ef)](_0x1a54eb(0x283),'圣旨'),log('未检测到预览文本,按标准流程采集消息...','info');const _0x3b6e43=_0x3ae7b8[_0x1a54eb(0x19d)]();if(!_0x3b6e43||_0x3b6e43[_0x1a54eb(0x2fa)]===0x0){toastr['warning']('未找到符合条件的消息可供凝识。',_0x1a54eb(0x2f4)),_0x13c1ff[_0x1a54eb(0x1e9)]=_0x1a54eb(0x23e);return;}_0x13c1ff[_0x1a54eb(0x1e9)]=_0x1a54eb(0x20d)+_0x3b6e43[_0x1a54eb(0x2fa)]+_0x1a54eb(0x19f),toastr[_0x1a54eb(0x2ef)](_0x1a54eb(0x20d)+_0x3b6e43[_0x1a54eb(0x2fa)]+_0x1a54eb(0x19f),_0x1a54eb(0x2f4));const _0x593db2=await _0x3ae7b8[_0x1a54eb(0x198)](_0x3b6e43,log,_0x11a6a7);if(_0x593db2['success']){toastr[_0x1a54eb(0x2aa)](_0x1a54eb(0x279)+_0x593db2[_0x1a54eb(0x1d9)]+_0x1a54eb(0x242),_0x1a54eb(0x25b));const _0xd83830=_0x11a6a7[_0x1a54eb(0x1f1)]===0x0?getContext()[_0x1a54eb(0x212)][_0x1a54eb(0x2fa)]:_0x11a6a7[_0x1a54eb(0x1f1)];_0x13c1ff[_0x1a54eb(0x1e9)]='聊天记录从第\x20'+_0x11a6a7[_0x1a54eb(0x1c1)]+_0x1a54eb(0x1e5)+_0xd83830+_0x1a54eb(0x1f6)+_0x593db2[_0x1a54eb(0x1d9)]+_0x1a54eb(0x242);}else throw new Error(_0x593db2[_0x1a54eb(0x262)]||_0x1a54eb(0x2b2));}}catch(_0x526058){console['error']('[翰林院-枢纽]\x20凝识过程发生错误:',_0x526058),toastr[_0x1a54eb(0x262)]('凝识失败:\x20'+_0x526058[_0x1a54eb(0x1c4)],_0x1a54eb(0x20e)),_0x13c1ff[_0x1a54eb(0x1e9)]=_0x1a54eb(0x197)+_0x526058['message'];}finally{await updatePanelStatus();}}async function loadWorldbookList(){const _0xb47aa1=_0x3ad8df,_0x46901e=document['getElementById'](_0xb47aa1(0x223));if(!_0x46901e)return;try{log(_0xb47aa1(0x1c3),_0xb47aa1(0x2ef));const _0x1c63b8=await _0x3162d4['getAvailableWorldbooks']();_0x46901e['innerHTML']=_0xb47aa1(0x25c);if(_0x1c63b8[_0xb47aa1(0x2fa)]===0x0){_0x46901e[_0xb47aa1(0x259)]=_0xb47aa1(0x2f8);return;}_0x1c63b8[_0xb47aa1(0x2da)](_0x474fb0=>{const _0xc29708=_0xb47aa1,_0x47df5c=new Option(_0x474fb0,_0x474fb0);_0x46901e[_0xc29708(0x1a7)](_0x47df5c);}),log(_0xb47aa1(0x24c)+_0x1c63b8[_0xb47aa1(0x2fa)]+_0xb47aa1(0x2a1),_0xb47aa1(0x2aa));}catch(_0x943d89){console[_0xb47aa1(0x262)](_0xb47aa1(0x28a),_0x943d89),log(_0xb47aa1(0x291)+_0x943d89['message'],_0xb47aa1(0x262)),_0x46901e['innerHTML']=_0xb47aa1(0x2c8);}}async function handleWorldbookSelectionChange(){const _0x5a165b=_0x3ad8df,_0x299862=document[_0x5a165b(0x2ce)]('hly-hist-select-library'),_0x53cd47=document['getElementById'](_0x5a165b(0x216)),_0x3d07ed=_0x299862[_0x5a165b(0x232)];_0x53cd47[_0x5a165b(0x259)]=_0x5a165b(0x28d),_0x53cd47[_0x5a165b(0x224)]=!![];if(!_0x3d07ed){_0x53cd47[_0x5a165b(0x259)]=_0x5a165b(0x22d);return;}try{log(_0x5a165b(0x1bf)+_0x3d07ed+_0x5a165b(0x277),'info');const _0x501161=await _0x3162d4[_0x5a165b(0x21b)](_0x3d07ed);_0x53cd47[_0x5a165b(0x259)]=_0x5a165b(0x2d7);if(_0x501161[_0x5a165b(0x2fa)]===0x0){_0x53cd47[_0x5a165b(0x259)]='此书库为空';return;}_0x501161[_0x5a165b(0x2da)](_0x34b6ff=>{const _0x1da58c=_0x5a165b,_0x5d6b2b=new Option(_0x34b6ff[_0x1da58c(0x261)]+'\x20(Key:\x20'+_0x34b6ff['key']+')',_0x34b6ff[_0x1da58c(0x2f7)]);_0x53cd47[_0x1da58c(0x1a7)](_0x5d6b2b);}),log(_0x5a165b(0x24c)+_0x501161[_0x5a165b(0x2fa)]+_0x5a165b(0x205),_0x5a165b(0x2aa));}catch(_0x4f78b7){console[_0x5a165b(0x262)]('[翰林院-枢纽]\x20加载《'+_0x3d07ed+_0x5a165b(0x21e),_0x4f78b7),log(_0x5a165b(0x1c6)+_0x4f78b7[_0x5a165b(0x1c4)],_0x5a165b(0x262)),_0x53cd47[_0x5a165b(0x259)]=_0x5a165b(0x2c8);}finally{_0x53cd47[_0x5a165b(0x224)]=![];}}async function startHistoriography(){const _0xebb27f=_0x3ad8df,_0x57bea5=document['getElementById']('hly-hist-select-library')[_0xebb27f(0x232)],_0x3df4fa=document[_0xebb27f(0x2ce)]('hly-hist-select-entry')[_0xebb27f(0x232)],_0x52accd=document[_0xebb27f(0x2ce)](_0xebb27f(0x272));if(!_0x57bea5||!_0x3df4fa){toastr[_0xebb27f(0x2e0)](_0xebb27f(0x293),_0xebb27f(0x2dc));return;}_0x52accd[_0xebb27f(0x1e9)]=_0xebb27f(0x2c3)+_0x57bea5+_0xebb27f(0x21f)+_0x3df4fa+_0xebb27f(0x282),toastr['info'](_0xebb27f(0x237),'圣旨'),log(_0xebb27f(0x28b)+_0x57bea5+'》-'+_0x3df4fa+_0xebb27f(0x25a),_0xebb27f(0x2ef));try{const _0x4cca1a=await _0x3162d4['executeCompilation'](_0x57bea5,_0x3df4fa);if(_0x4cca1a[_0xebb27f(0x2aa)]){const _0x4765a5=document[_0xebb27f(0x2ce)](_0xebb27f(0x216)),_0x3edf61=_0x4765a5[_0xebb27f(0x1cb)][_0x4765a5['selectedIndex']][_0xebb27f(0x251)],_0x1d7f08='《'+_0x57bea5+_0xebb27f(0x2fd)+_0x3edf61+_0xebb27f(0x1d1);_0x52accd[_0xebb27f(0x1e9)]=_0x1d7f08,toastr['success'](_0xebb27f(0x2a9),_0xebb27f(0x25b)),log('对《'+_0x57bea5+'》中条目\x20(Key:\x20'+_0x3df4fa+_0xebb27f(0x299),_0xebb27f(0x2aa));}else throw new Error(_0x4cca1a[_0xebb27f(0x262)]||_0xebb27f(0x1e3));}catch(_0xa1da00){console[_0xebb27f(0x262)](_0xebb27f(0x1e2),_0xa1da00),toastr[_0xebb27f(0x262)](_0xebb27f(0x215)+_0xa1da00[_0xebb27f(0x1c4)],_0xebb27f(0x20e)),_0x52accd[_0xebb27f(0x1e9)]='编纂失败:\x20'+_0xa1da00['message'];}}async function showStats(){const _0x15e74c=_0x3ad8df;try{log(_0x15e74c(0x26e),_0x15e74c(0x2ef)),toastr[_0x15e74c(0x2ef)](_0x15e74c(0x280),'圣旨');const _0x34dde5=await _0x3ae7b8['getVectorCount'](),_0xefc2df=await _0x3ae7b8[_0x15e74c(0x1b9)](),_0x4525af=_0x3ae7b8['getSettings'](),_0x2e7984=_0x15e74c(0x2de)+_0xefc2df+_0x15e74c(0x1f9)+_0x34dde5+'\x0a--------------------\x0aAPI端点:\x20'+_0x4525af[_0x15e74c(0x278)][_0x15e74c(0x23c)]+_0x15e74c(0x297)+_0x4525af[_0x15e74c(0x278)][_0x15e74c(0x2dd)]+_0x15e74c(0x1ef);toastr[_0x15e74c(0x2ef)](_0x2e7984,_0x15e74c(0x2c2),{'timeOut':0x3a98,'extendedTimeOut':0x1388,'tapToDismiss':!![],'closeButton':!![]}),log(_0x15e74c(0x263)+_0xefc2df+',\x20忆识总数='+_0x34dde5,'success');}catch(_0x1e4cf0){console[_0x15e74c(0x262)]('[翰林院-枢纽]\x20查询宝库状态失败:',_0x1e4cf0),toastr[_0x15e74c(0x262)]('查询宝库状态失败:\x20'+_0x1e4cf0[_0x15e74c(0x1c4)],_0x15e74c(0x20e)),log(_0x15e74c(0x23f)+_0x1e4cf0['message'],_0x15e74c(0x262));}}function showExclusionRulesModal(){const _0x121b26=_0x3ad8df,_0x391b3a=_0x3ae7b8[_0x121b26(0x2a4)](),_0x2101d1=_0x391b3a['condensation'][_0x121b26(0x230)]||[],_0x5b5fcd=(_0x2a1385={'start':'','end':''},_0x2b9fea)=>_0x121b26(0x1cc)+_0x2b9fea+_0x121b26(0x27f)+_0x2a1385[_0x121b26(0x1c1)]+_0x121b26(0x1a9)+_0x2a1385[_0x121b26(0x1f1)]+_0x121b26(0x1d7),_0x538860=_0x2101d1[_0x121b26(0x1d0)](_0x5b5fcd)[_0x121b26(0x2a5)](''),_0x3eea51='\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20在这里定义需要从提取内容中排除的文本片段。例如,排除HTML注释,可以设置开始字符为\x20``。

\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x538860+_0x121b26(0x214);showHtmlModal(_0x121b26(0x221),_0x3eea51,{'okText':'保存规则','onOk':_0x40fca6=>{const _0x34239b=_0x121b26,_0x137930=[];_0x40fca6[_0x34239b(0x1d4)](_0x34239b(0x209))['each'](function(){const _0xdd39d1=_0x34239b,_0x568531=$(this)[_0xdd39d1(0x1d4)](_0xdd39d1(0x1b5))['eq'](0x0)[_0xdd39d1(0x1d6)]()[_0xdd39d1(0x1a2)](),_0x1ce6ad=$(this)[_0xdd39d1(0x1d4)](_0xdd39d1(0x1b5))['eq'](0x1)[_0xdd39d1(0x1d6)]()[_0xdd39d1(0x1a2)]();_0x568531&&_0x1ce6ad&&_0x137930[_0xdd39d1(0x2e3)]({'start':_0x568531,'end':_0x1ce6ad});}),updateAndSaveSetting('condensation.exclusionRules',_0x137930),toastr[_0x34239b(0x2aa)](_0x34239b(0x1ba),_0x34239b(0x1dc));}});const _0x322ac7=document[_0x121b26(0x2ce)](_0x121b26(0x202)),_0xcd2243=_0x322ac7['querySelector'](_0x121b26(0x1ea));_0x322ac7[_0x121b26(0x2c5)]('#hly-add-rule-btn')[_0x121b26(0x2f1)](_0x121b26(0x27c),()=>{const _0x1a1261=_0x121b26,_0x4704cf=_0xcd2243['children'][_0x1a1261(0x2fa)],_0x5954a2=_0x5b5fcd({'start':'','end':''},_0x4704cf);_0xcd2243[_0x1a1261(0x2b6)](_0x1a1261(0x29b),_0x5954a2);}),_0xcd2243['addEventListener'](_0x121b26(0x27c),_0x517bb6=>{const _0x368fe9=_0x121b26;_0x517bb6['target'][_0x368fe9(0x20b)][_0x368fe9(0x1bd)](_0x368fe9(0x28f))&&_0x517bb6[_0x368fe9(0x257)]['closest'](_0x368fe9(0x209))['remove']();});}function previewCondensation(){const _0x26ff9c=_0x3ad8df,_0xd7817a=document[_0x26ff9c(0x2ce)](_0x26ff9c(0x196));try{const _0xe5af8e=_0x3ae7b8[_0x26ff9c(0x2a4)](),_0x49102b=_0xe5af8e['condensation'][_0x26ff9c(0x230)]||[],_0xe59339={'user':document['getElementById'](_0x26ff9c(0x234))[_0x26ff9c(0x2d3)],'ai':document[_0x26ff9c(0x2ce)](_0x26ff9c(0x29d))[_0x26ff9c(0x2d3)]},_0x47b031=document[_0x26ff9c(0x2ce)](_0x26ff9c(0x2cc))['checked'],_0x4c152c=_0x47b031?document[_0x26ff9c(0x2ce)]('hly-tag-input')[_0x26ff9c(0x232)][_0x26ff9c(0x23d)](',')[_0x26ff9c(0x1d0)](_0x3b7c3e=>_0x3b7c3e[_0x26ff9c(0x1a2)]())[_0x26ff9c(0x22f)](Boolean):[],_0x491340=_0x3ae7b8['getMessagesForCondensation'](_0xe59339);if(!_0x491340||_0x491340[_0x26ff9c(0x2fa)]===0x0){_0xd7817a['textContent']=_0x26ff9c(0x302),toastr[_0x26ff9c(0x2e0)](_0x26ff9c(0x23e),_0x26ff9c(0x2f4));return;}const _0x5df05c=_0x491340['map']((_0x455dd7,_0x52b443)=>{const _0x334910=_0x26ff9c;let _0x53a180;if(_0x455dd7['is_user'])_0x53a180=_0x455dd7['mes'];else{if(_0x47b031&&_0x4c152c[_0x334910(0x2fa)]>0x0){const _0x1c9cec=extractBlocksByTags(_0x455dd7[_0x334910(0x281)],_0x4c152c);_0x53a180=_0x1c9cec[_0x334910(0x2a5)]('\x0a\x0a');}else _0x53a180=_0x455dd7[_0x334910(0x281)];_0x53a180=applyExclusionRules(_0x53a180,_0x49102b);}return{'id':_0x334910(0x2e1)+_0x52b443,'name':_0x455dd7[_0x334910(0x1b3)],'content':_0x53a180[_0x334910(0x1a2)]()};})[_0x26ff9c(0x22f)](_0x5d85af=>_0x5d85af[_0x26ff9c(0x253)]);if(_0x5df05c[_0x26ff9c(0x2fa)]===0x0){_0xd7817a[_0x26ff9c(0x1e9)]=_0x26ff9c(0x243),toastr['warning']('根据标签提取或内容排除条件,未找到任何有效内容。','翰林院启奏');return;}const _0x5e2fed=_0x5df05c[_0x26ff9c(0x1d0)]((_0x2fabb5,_0x289ac5)=>_0x26ff9c(0x1d5)+_0x2fabb5['id']+_0x26ff9c(0x276)+(_0x289ac5+0x1)+_0x26ff9c(0x1b4)+_0x2fabb5[_0x26ff9c(0x1b3)]+_0x26ff9c(0x236)+_0x2fabb5[_0x26ff9c(0x253)]+_0x26ff9c(0x2ab)+_0x2fabb5['id']+_0x26ff9c(0x19b))[_0x26ff9c(0x2a5)]('');showHtmlModal(_0x26ff9c(0x294),''+_0x5e2fed+'',{'okText':'确认并更新预览','onOk':_0x1597d3=>{const _0x3d5bc0=_0x26ff9c,_0x13c9fd=[];_0x1597d3[_0x3d5bc0(0x1d4)](_0x3d5bc0(0x268))[_0x3d5bc0(0x225)](function(){const _0x3a26a0=_0x3d5bc0,_0x161ce2=$(this)[_0x3a26a0(0x1d4)](_0x3a26a0(0x2d2))[_0x3a26a0(0x1d6)]();_0x161ce2[_0x3a26a0(0x1a2)]()&&_0x13c9fd[_0x3a26a0(0x2e3)](_0x161ce2);});const _0x264f2e=_0x13c9fd['join'](_0x3d5bc0(0x1f8)),_0x2fc6f0=document['getElementById']('hly-layer-start')[_0x3d5bc0(0x232)],_0x31f519=document[_0x3d5bc0(0x2ce)](_0x3d5bc0(0x290))[_0x3d5bc0(0x232)];_0xd7817a['textContent']=_0x3d5bc0(0x2e5)+_0x2fc6f0+_0x3d5bc0(0x217)+_0x31f519+_0x3d5bc0(0x2ba)+_0x13c9fd['length']+'\x20条有效条目),请点击“开始凝识”进入自动向量化流程。',_0xd7817a[_0x3d5bc0(0x25e)][_0x3d5bc0(0x1ee)]=_0x264f2e,toastr[_0x3d5bc0(0x2aa)]('预览内容已更新,可随时开始凝识。','圣旨已达');}}),$(_0x26ff9c(0x1b2))['on'](_0x26ff9c(0x27c),function(_0x388157){const _0x5a2905=_0x26ff9c;_0x388157['preventDefault']();const _0x525a98=$(this)[_0x5a2905(0x21a)]('target');$('#'+_0x525a98)[_0x5a2905(0x2f9)]();});}catch(_0x49c8bd){console['error'](_0x26ff9c(0x220),_0x49c8bd),_0xd7817a[_0x26ff9c(0x1e9)]=_0x26ff9c(0x1fc)+_0x49c8bd[_0x26ff9c(0x1c4)],toastr[_0x26ff9c(0x262)](_0x26ff9c(0x1fc)+_0x49c8bd[_0x26ff9c(0x1c4)],_0x26ff9c(0x20e));}}function log(_0x91a448,_0x46545c=_0x3ad8df(0x2ef)){const _0x34c887=_0x3ad8df,_0x44ae7d=document[_0x34c887(0x2ce)](_0x34c887(0x252));if(!_0x44ae7d)return;const _0x26a4ee=document[_0x34c887(0x2a0)]('p'),_0x46d3d4=new Date()[_0x34c887(0x1ae)]();let _0x4e6da6=_0x34c887(0x2ec),_0x41bf51='log-info';switch(_0x46545c){case _0x34c887(0x2aa):_0x4e6da6=_0x34c887(0x1ed),_0x41bf51=_0x34c887(0x2b3);break;case _0x34c887(0x262):_0x4e6da6='fa-times-circle',_0x41bf51=_0x34c887(0x2b8);break;case'warn':_0x4e6da6='fa-exclamation-triangle',_0x41bf51='log-warn';break;}_0x26a4ee[_0x34c887(0x218)]=_0x34c887(0x1d8)+_0x41bf51,_0x26a4ee[_0x34c887(0x259)]='