const _0x30c5e9=_0xe9ce;(function(_0x594cd1,_0x246ac1){const _0xd6bcdc=_0xe9ce,_0x105e1d=_0x594cd1();while(!![]){try{const _0x55c5e9=parseInt(_0xd6bcdc(0xbf))/0x1*(parseInt(_0xd6bcdc(0x16e))/0x2)+-parseInt(_0xd6bcdc(0x114))/0x3+parseInt(_0xd6bcdc(0x27b))/0x4*(parseInt(_0xd6bcdc(0xcb))/0x5)+parseInt(_0xd6bcdc(0x1f5))/0x6*(parseInt(_0xd6bcdc(0x243))/0x7)+-parseInt(_0xd6bcdc(0x120))/0x8+parseInt(_0xd6bcdc(0x17a))/0x9+parseInt(_0xd6bcdc(0x1c8))/0xa;if(_0x55c5e9===_0x246ac1)break;else _0x105e1d['push'](_0x105e1d['shift']());}catch(_0x54499a){_0x105e1d['push'](_0x105e1d['shift']());}}}(_0x1d12,0xd4239));import{getContext}from'/scripts/extensions.js';import*as _0x1d6382 from'../core/rag-processor.js';import*as _0x15d4ce from'../core/historiographer.js';import*as _0x7530ec from'../core/utils/context-utils.js';import*as _0x536e9e from'../core/ingestion-manager.js';import{showContentModal,showHtmlModal}from'./page-window.js';import{extractBlocksByTags,applyExclusionRules}from'../core/utils/rag-tag-extractor.js';import{filterWorldbooks,filterWorldbookEntries,highlightSearchMatch,debounce}from'../core/rag-processor.js';_0x30c5e9(0x211);function setupGlobalEventHandlers(){const _0x167668=_0x30c5e9;window[_0x167668(0x200)]=()=>saveSettingsFromUI(![]),window[_0x167668(0x19c)]=resetSettingsToUI,window[_0x167668(0x25b)]=testApi,window[_0x167668(0x1f8)]=fetchHLYEmbeddingModels,window[_0x167668(0x1b4)]=fetchHLYRerankModels,window['updateHLYMemoryCount']=updatePanelStatus,window[_0x167668(0x116)]=purgeStorage,window[_0x167668(0x1bd)]=startCondensation,window['previewHLYCondensation']=previewCondensation,window[_0x167668(0xf9)]=ingestManualText,window[_0x167668(0x207)]=log,window[_0x167668(0x271)]=showStats,window[_0x167668(0x155)]=startHistoriography;}function updateAndSaveSetting(_0x5854a4,_0xc3c4a9){const _0x1bb610=_0x30c5e9,_0x7035ec=_0x1d6382[_0x1bb610(0x108)]();if(!_0x7035ec)return;const _0x12be85=_0x5854a4['split']('.');let _0x241c4a=_0x7035ec;for(let _0x34f38c=0x0;_0x34f38c<_0x12be85['length']-0x1;_0x34f38c++){_0x241c4a=_0x241c4a[_0x12be85[_0x34f38c]]=_0x241c4a[_0x12be85[_0x34f38c]]||{};}_0x241c4a[_0x12be85[_0x12be85[_0x1bb610(0x174)]-0x1]]=_0xc3c4a9,_0x1d6382[_0x1bb610(0x1af)](),log(_0x1bb610(0x125)+_0x5854a4+'\x27\x20已更新为:\x20'+JSON['stringify'](_0xc3c4a9),_0x1bb610(0x140));}function bindAutoSaveEvents(){const _0x2ee5d2=_0x30c5e9,_0x33c679=document[_0x2ee5d2(0x14b)](_0x2ee5d2(0x1fd));if(!_0x33c679)return;_0x33c679[_0x2ee5d2(0xfc)](_0x2ee5d2(0x1ff),_0x46b375=>{const _0x4a1d2a=_0x2ee5d2,_0x15c35f=_0x46b375[_0x4a1d2a(0x17e)],_0x237228=_0x15c35f[_0x4a1d2a(0x111)][_0x4a1d2a(0x188)];if(!_0x237228)return;let _0x39faa3;const _0x192304=_0x15c35f['dataset'][_0x4a1d2a(0xa7)]||'string';if(_0x15c35f['type']===_0x4a1d2a(0x1f7))_0x39faa3=_0x15c35f[_0x4a1d2a(0x28c)];else{if(_0x15c35f[_0x4a1d2a(0xa7)]===_0x4a1d2a(0xf2)){if(_0x15c35f[_0x4a1d2a(0x28c)]){const _0x25b395=_0x33c679[_0x4a1d2a(0x1e1)]('input[name=\x22'+_0x15c35f[_0x4a1d2a(0x206)]+'\x22]'),_0x3ece3b=Array['from'](_0x25b395)[_0x4a1d2a(0x278)](_0x449a7d=>_0x449a7d['checked']);_0x39faa3=_0x3ece3b[_0x4a1d2a(0x1b2)];}else return;}else _0x39faa3=_0x15c35f['value'];}switch(_0x192304){case _0x4a1d2a(0x280):_0x39faa3=parseInt(_0x39faa3,0xa);break;case _0x4a1d2a(0xac):_0x39faa3=parseFloat(_0x39faa3);break;case _0x4a1d2a(0x237):typeof _0x39faa3!=='boolean'&&(_0x39faa3=_0x39faa3===_0x4a1d2a(0xb9));break;}if(_0x15c35f[_0x4a1d2a(0xa7)]==='radio'&&!_0x15c35f[_0x4a1d2a(0x28c)])return;updateAndSaveSetting(_0x237228,_0x39faa3);});}export function bindHanlinyuanEvents(){const _0x1ca1f2=_0x30c5e9,_0x143205=getContext();if(!_0x143205){console[_0x1ca1f2(0x277)]('[翰林院-枢纽]\x20未能获取SillyTavern上下文,绑定失败。');return;}setupGlobalEventHandlers(),bindPanelToggleEvents(),bindInternalUIEvents(),bindTutorialEvents(),bindAutoSaveEvents(),bindSessionLockEvent(),initializeUnifiedInjectionEditor();if(_0x1d6382[_0x1ca1f2(0x1aa)])_0x1d6382[_0x1ca1f2(0x1aa)]();else{console['error'](_0x1ca1f2(0x23d));return;}loadSettingsToUI(),loadWorldbookList(),log('[翰林院-枢纽]\x20已成功连接各部,政令畅通。',_0x1ca1f2(0x185));const _0x298ac1=document[_0x1ca1f2(0x14b)](_0x1ca1f2(0x17c)),_0xb48dbe=document[_0x1ca1f2(0x14b)](_0x1ca1f2(0x18f)),_0x44be8b=document[_0x1ca1f2(0x14b)](_0x1ca1f2(0x168)),_0x204318=document['getElementById']('hanlinyuan-ingest-abort'),_0x16c21d=document['getElementById']('hanlinyuan-ingest-progress-container'),_0x57bb8c=document[_0x1ca1f2(0x14b)]('hanlinyuan-ingest-progress-bar'),_0x455685=document[_0x1ca1f2(0x14b)](_0x1ca1f2(0x28d)),_0x2fd3e2=document[_0x1ca1f2(0x14b)](_0x1ca1f2(0x28b));let _0x2c723d=null,_0x42c91a=null;_0x298ac1[_0x1ca1f2(0xfc)](_0x1ca1f2(0x1ff),_0x3a6e72=>{const _0x200552=_0x1ca1f2;_0x2c723d=_0x3a6e72[_0x200552(0x17e)][_0x200552(0x130)][0x0],_0x2c723d?(_0xb48dbe[_0x200552(0x24d)]=_0x2c723d['name'],_0xb48dbe[_0x200552(0x251)]=_0x2c723d[_0x200552(0x206)]):_0xb48dbe[_0x200552(0x24d)]=_0x200552(0x183);}),_0x44be8b['addEventListener'](_0x1ca1f2(0x10f),async()=>{const _0x3a3ab3=_0x1ca1f2;if(!_0x2c723d){toastr[_0x3a3ab3(0x146)](_0x3a3ab3(0x229));return;}let _0xb1533c=0x0;const _0x18fe2c=_0x536e9e[_0x3a3ab3(0x163)](_0x2c723d),_0x1944fc=_0x536e9e['loadProgress'](_0x18fe2c);if(_0x1944fc){const _0x16e95c=(_0x1944fc[_0x3a3ab3(0x21e)]/_0x1944fc['totalChunks']*0x64)[_0x3a3ab3(0xc4)](0x1),_0x13f0b7=confirm(_0x3a3ab3(0x1a8)+_0x16e95c+_0x3a3ab3(0x16c));_0x13f0b7?(_0xb1533c=_0x1944fc['processedChunks'],toastr[_0x3a3ab3(0x185)]('遵命,将从第\x20'+(_0xb1533c+0x1)+_0x3a3ab3(0x16b),_0x3a3ab3(0x1a9)),log(_0x3a3ab3(0x241)+_0x18fe2c+_0x3a3ab3(0x190)+_0xb1533c+_0x3a3ab3(0xbe),'info')):(_0x536e9e[_0x3a3ab3(0x15f)](_0x18fe2c),toastr[_0x3a3ab3(0x185)](_0x3a3ab3(0x1b5),_0x3a3ab3(0x1a9)),log(_0x3a3ab3(0xc5)+_0x18fe2c+',重新开始。',_0x3a3ab3(0x1b7)));}_0x42c91a=new AbortController();const _0x137dbe=_0x42c91a[_0x3a3ab3(0xe8)];_0x2fd3e2[_0x3a3ab3(0x109)][_0x3a3ab3(0x1b0)]=_0x3a3ab3(0x1be),_0x16c21d['style'][_0x3a3ab3(0x1b0)]='block',_0x455685['textContent']=_0x3a3ab3(0x147),_0x57bb8c[_0x3a3ab3(0x1b2)]=0x0;try{const _0x360904=await _0x2c723d[_0x3a3ab3(0xcc)](),_0x1ed705=_0x1aa988=>{const _0xf1c65d=_0x3a3ab3;_0x455685[_0xf1c65d(0x24d)]=_0xf1c65d(0x177)+_0x1aa988[_0xf1c65d(0x250)]+'\x20('+_0x1aa988['processed']+'/'+_0x1aa988[_0xf1c65d(0x221)]+')',_0x57bb8c['value']=_0x1aa988[_0xf1c65d(0xc9)]/_0x1aa988[_0xf1c65d(0x221)]*0x64;},_0x16aedc=()=>{const _0x8c33fd=_0x3a3ab3;updatePanelStatus(),log(_0x8c33fd(0x205),_0x8c33fd(0x185));},_0x4022d2=await _0x1d6382[_0x3a3ab3(0xa0)](_0x360904,_0x3a3ab3(0x172),{'sourceName':_0x2c723d[_0x3a3ab3(0x206)]},_0x1ed705,_0x137dbe,log,_0x16aedc,_0x18fe2c,_0xb1533c);if(_0x4022d2[_0x3a3ab3(0x140)])toastr['success']('成功录入\x20'+_0x4022d2[_0x3a3ab3(0x1db)]+'\x20个知识块'),_0x455685[_0x3a3ab3(0x24d)]='任务完成!成功录入\x20'+_0x4022d2[_0x3a3ab3(0x1db)]+_0x3a3ab3(0x121),_0x57bb8c[_0x3a3ab3(0x1b2)]=0x64,updatePanelStatus();else throw new Error(_0x4022d2[_0x3a3ab3(0x277)]||_0x3a3ab3(0x26b));}catch(_0x35bbae){_0x35bbae[_0x3a3ab3(0x206)]===_0x3a3ab3(0xf3)?(toastr[_0x3a3ab3(0x185)](_0x3a3ab3(0x1a7)),_0x455685[_0x3a3ab3(0x24d)]=_0x3a3ab3(0xc1)):(toastr['error'](_0x3a3ab3(0x18c)+_0x35bbae[_0x3a3ab3(0x250)]+'。进度已保存,可稍后重试。'),_0x455685[_0x3a3ab3(0x24d)]=_0x3a3ab3(0x139)+_0x35bbae[_0x3a3ab3(0x250)]);}finally{setTimeout(()=>{const _0x5496a4=_0x3a3ab3;_0x2fd3e2[_0x5496a4(0x109)][_0x5496a4(0x1b0)]=_0x5496a4(0x257),_0x16c21d[_0x5496a4(0x109)][_0x5496a4(0x1b0)]='none',_0x298ac1[_0x5496a4(0x1b2)]='',_0x2c723d=null,_0xb48dbe[_0x5496a4(0x24d)]=_0x5496a4(0x183);},0xbb8);}}),_0x204318[_0x1ca1f2(0xfc)]('click',()=>{const _0x35eaed=_0x1ca1f2;_0x42c91a&&_0x42c91a[_0x35eaed(0x10e)]();});}function bindSessionLockEvent(){const _0x4f578f=_0x30c5e9,_0xc9a714=document[_0x4f578f(0x14b)](_0x4f578f(0x179));if(!_0xc9a714)return;_0xc9a714[_0x4f578f(0xfc)]('click',async()=>{const _0x460227=_0x4f578f,_0x14adad=await _0x1d6382['toggleSessionLock']();updateSessionLockUI(_0x14adad);if(_0x14adad){const _0x52d3af=_0x1d6382['getLockedSessionInfo']();_0x52d3af&&(toastr[_0x460227(0x140)](_0x460227(0x256)+_0x52d3af['id'],_0x460227(0x187)),log('会话已锁定到宝库:\x20'+_0x52d3af['id'],_0x460227(0x140)));}else toastr[_0x460227(0x185)]('会话已解锁,将跟随当前角色。','诏曰'),log(_0x460227(0x19f),_0x460227(0x185));updatePanelStatus();}),updateSessionLockUI(_0x1d6382[_0x4f578f(0x23e)]());}function updateSessionLockUI(_0x41d3e3){const _0x14fdcb=_0x30c5e9,_0x308ddb=document['getElementById']('hly-session-lock-btn');if(!_0x308ddb)return;const _0x4f064c=_0x308ddb[_0x14fdcb(0x242)]('i'),_0x184033=_0x308ddb[_0x14fdcb(0x242)]('span');_0x41d3e3?(_0x308ddb[_0x14fdcb(0x167)][_0x14fdcb(0x152)]('active'),_0x4f064c[_0x14fdcb(0x1ab)]='fas\x20fa-lock',_0x184033['textContent']=_0x14fdcb(0x17f),_0x308ddb['title']=_0x14fdcb(0x261)):(_0x308ddb[_0x14fdcb(0x167)][_0x14fdcb(0x160)](_0x14fdcb(0x230)),_0x4f064c['className']=_0x14fdcb(0x124),_0x184033[_0x14fdcb(0x24d)]='锁定会话',_0x308ddb[_0x14fdcb(0x251)]=_0x14fdcb(0x212));}function bindPanelToggleEvents(){const _0x272b49=_0x30c5e9,_0x52f6fd=document[_0x272b49(0x14b)](_0x272b49(0x173));if(_0x52f6fd){}}function bindTutorialEvents(){const _0x550fad=_0x30c5e9,_0x32bfda=document[_0x550fad(0x14b)]('amily2_open_hanlin_tutorial');_0x32bfda&&_0x32bfda['addEventListener'](_0x550fad(0x10f),()=>{const _0x97d7a5=_0x550fad;showContentModal(_0x97d7a5(0xc7),'scripts/extensions/third-party/ST-Amily2-Chat-Optimisation/HanLin.md');});}function bindInternalUIEvents(){const _0x124c7d=_0x30c5e9,_0x5f0655=document['querySelectorAll']('.hly-nav-item');_0x5f0655['forEach'](_0x1df02b=>{const _0x40de3d=_0xe9ce;_0x1df02b[_0x40de3d(0xfc)](_0x40de3d(0x10f),()=>{const _0x5ea329=_0x40de3d,_0xc6d747=_0x1df02b[_0x5ea329(0x111)][_0x5ea329(0x27d)],_0x4c1af3='hly-'+_0xc6d747+_0x5ea329(0x113);document[_0x5ea329(0x1e1)](_0x5ea329(0x1c4))[_0x5ea329(0x1e5)](_0x13ec8d=>{const _0x13ce9a=_0x5ea329;_0x13ec8d[_0x13ce9a(0x167)][_0x13ce9a(0x1ea)](_0x13ce9a(0x230),_0x13ec8d['id']===_0x4c1af3);}),_0x5f0655[_0x5ea329(0x1e5)](_0x215319=>_0x215319[_0x5ea329(0x167)][_0x5ea329(0x1ea)]('active',_0x215319===_0x1df02b));});});const _0x348b99=document[_0x124c7d(0x14b)](_0x124c7d(0x228));_0x348b99&&_0x348b99['addEventListener']('change',handleApiModeChange);const _0x621561=document['getElementById'](_0x124c7d(0x13d)),_0x1ddf62=document[_0x124c7d(0x14b)](_0x124c7d(0x1f0));_0x621561&&_0x1ddf62&&_0x621561[_0x124c7d(0xfc)](_0x124c7d(0x1ff),()=>{const _0x469633=_0x124c7d;_0x1ddf62[_0x469633(0x109)]['display']=_0x621561['checked']?'block':_0x469633(0x1be);});const _0x30a5f5=document['getElementById'](_0x124c7d(0x1ec));_0x30a5f5&&_0x30a5f5[_0x124c7d(0xfc)](_0x124c7d(0x1ff),handleWorldbookSelectionChange);const _0x4da639=document[_0x124c7d(0x14b)]('hly-exclusion-rules-btn');_0x4da639&&_0x4da639['addEventListener']('click',showExclusionRulesModal);const _0xb57d01=document[_0x124c7d(0x14b)](_0x124c7d(0x269)),_0x52810d=document[_0x124c7d(0x14b)](_0x124c7d(0x253));_0xb57d01&&_0x52810d&&(_0xb57d01[_0x124c7d(0xfc)](_0x124c7d(0x10f),_0x2b49c4=>{const _0x13a3ca=_0x124c7d;_0x2b49c4[_0x13a3ca(0x1c9)]();const _0x2209ec=_0x52810d['style'][_0x13a3ca(0x1b0)]===_0x13a3ca(0xb4);_0x52810d[_0x13a3ca(0x109)][_0x13a3ca(0x1b0)]=_0x2209ec?_0x13a3ca(0x1be):_0x13a3ca(0xb4);}),_0x52810d[_0x124c7d(0xfc)](_0x124c7d(0x1ff),_0xbff031=>{const _0x27da60=_0x124c7d,_0x35e85d=_0xbff031[_0x27da60(0x17e)];if(_0x35e85d[_0x27da60(0xa7)]!=='checkbox')return;const _0x440158=_0x52810d['querySelectorAll'](_0x27da60(0xe3)),_0x502e4f=document[_0x27da60(0x14b)]('hly-hist-select-all-entries');if(_0x35e85d['id']===_0x27da60(0x255))_0x440158['forEach'](_0x5b6b2d=>_0x5b6b2d[_0x27da60(0x28c)]=_0x35e85d[_0x27da60(0x28c)]);else{const _0x1a2f64=Array[_0x27da60(0x25c)](_0x440158)['every'](_0x1009ea=>_0x1009ea[_0x27da60(0x28c)]);_0x502e4f[_0x27da60(0x28c)]=_0x1a2f64;}const _0x3a5280=_0x52810d[_0x27da60(0x1e1)]('.hly-hist-entry-checkbox:checked')['length'],_0x168cce=_0x440158[_0x27da60(0x174)];_0xb57d01['querySelector']('span')[_0x27da60(0x24d)]=_0x27da60(0x1a0)+_0x3a5280+_0x27da60(0x263)+_0x168cce+_0x27da60(0xdf);}),document[_0x124c7d(0xfc)](_0x124c7d(0x10f),_0x514576=>{const _0x58f492=_0x124c7d;!_0xb57d01[_0x58f492(0x1c6)](_0x514576[_0x58f492(0x17e)])&&!_0x52810d['contains'](_0x514576[_0x58f492(0x17e)])&&(_0x52810d[_0x58f492(0x109)]['display']=_0x58f492(0x1be));}));const _0x28f27e=document[_0x124c7d(0x14b)](_0x124c7d(0x182));_0x28f27e&&_0x28f27e[_0x124c7d(0xfc)](_0x124c7d(0x10f),deleteAllLocalKnowledgeBases);const _0x45eebc=document[_0x124c7d(0x14b)](_0x124c7d(0x16d));_0x45eebc&&_0x45eebc[_0x124c7d(0xfc)](_0x124c7d(0x10f),()=>moveAllKnowledgeBases(_0x124c7d(0x1ca)));const _0x2390e8=document[_0x124c7d(0x14b)](_0x124c7d(0x1e9));_0x2390e8&&_0x2390e8[_0x124c7d(0xfc)](_0x124c7d(0x10f),()=>moveAllKnowledgeBases(_0x124c7d(0x20a)));const _0x2ead3a=['hly-kb-list-local',_0x124c7d(0x11d)];_0x2ead3a['forEach'](_0x54c950=>{const _0x30619d=_0x124c7d,_0x516433=document[_0x30619d(0x14b)](_0x54c950);_0x516433&&(_0x516433[_0x30619d(0xfc)](_0x30619d(0x10f),handleKbAction),_0x516433[_0x30619d(0xfc)](_0x30619d(0x1ff),handleKbAction));}),document['getElementById'](_0x124c7d(0x279))[_0x124c7d(0xfc)](_0x124c7d(0x1ff),_0x5120cd=>handleSelectAll(_0x5120cd,'global')),document[_0x124c7d(0x14b)](_0x124c7d(0x184))[_0x124c7d(0xfc)](_0x124c7d(0x1ff),_0x12c0e9=>handleSelectAll(_0x12c0e9,'local')),document[_0x124c7d(0x14b)](_0x124c7d(0x274))[_0x124c7d(0xfc)]('click',_0x13eede=>handleBulkAction(_0x13eede,_0x124c7d(0x220))),document[_0x124c7d(0x14b)](_0x124c7d(0x166))[_0x124c7d(0xfc)]('click',_0x5e9eb9=>handleBulkAction(_0x5e9eb9,'local'));}function initializeUnifiedInjectionEditor(){const _0x3bae20=_0x30c5e9,_0x5d09f9=document[_0x3bae20(0x14b)](_0x3bae20(0x132)),_0x182885=document[_0x3bae20(0x14b)](_0x3bae20(0x218)),_0xac9c55=document[_0x3bae20(0x14b)](_0x3bae20(0x26c)),_0x503cb9=document[_0x3bae20(0x1e1)]('input[name=\x22hly-unified-injection-position\x22]'),_0x549f88=document['getElementById'](_0x3bae20(0xc0)),_0x48110a=document[_0x3bae20(0x14b)](_0x3bae20(0x194));if(!_0x5d09f9)return;const _0x9e0fac={'novel':'{{novel_text}}','chat':_0x3bae20(0x225),'lorebook':_0x3bae20(0x198),'manual':'{{manual_text}}'};function _0x25d0d6(){const _0xa82f80=_0x3bae20,_0x1d4f8d=_0x5d09f9[_0xa82f80(0x1b2)],_0x359b0c=_0x1d6382[_0xa82f80(0x108)](),_0x4a2dc2=_0x359b0c[_0xa82f80(0x12c)+_0x1d4f8d]||{};_0x182885[_0xa82f80(0x1b2)]=_0x4a2dc2['template']||'',_0xac9c55[_0xa82f80(0x24d)]='以\x20'+(_0x9e0fac[_0x1d4f8d]||_0xa82f80(0x178))+'\x20为占位符。';const _0x5c5668=_0x4a2dc2[_0xa82f80(0x10d)]!==undefined?String(_0x4a2dc2['position']):'2';_0x503cb9['forEach'](_0x41782b=>_0x41782b[_0xa82f80(0x28c)]=_0x41782b[_0xa82f80(0x1b2)]===_0x5c5668),_0x549f88['value']=_0x4a2dc2[_0xa82f80(0xe9)]||0x0,_0x48110a['value']=_0x4a2dc2[_0xa82f80(0x1d7)]!==undefined?String(_0x4a2dc2[_0xa82f80(0x1d7)]):'0';const _0x267a59=_0x5c5668==='1';_0x549f88[_0xa82f80(0xab)]=!_0x267a59,_0x48110a['disabled']=!_0x267a59;}function _0x5296bb(){const _0x1c2120=_0x3bae20,_0x69c9e1=_0x5d09f9['value'];updateAndSaveSetting('injection_'+_0x69c9e1+'.template',_0x182885[_0x1c2120(0x1b2)]);const _0x397b9b=document[_0x1c2120(0x242)](_0x1c2120(0x153));_0x397b9b&&updateAndSaveSetting(_0x1c2120(0x12c)+_0x69c9e1+_0x1c2120(0x180),parseInt(_0x397b9b[_0x1c2120(0x1b2)],0xa)),updateAndSaveSetting(_0x1c2120(0x12c)+_0x69c9e1+_0x1c2120(0xf8),parseInt(_0x549f88['value'],0xa)),updateAndSaveSetting(_0x1c2120(0x12c)+_0x69c9e1+_0x1c2120(0x1c7),parseInt(_0x48110a[_0x1c2120(0x1b2)],0xa));}_0x5d09f9[_0x3bae20(0xfc)](_0x3bae20(0x1ff),_0x25d0d6);const _0x318433=debounce(_0x5296bb,0x12c);_0x182885[_0x3bae20(0xfc)](_0x3bae20(0xb5),_0x318433),_0x549f88[_0x3bae20(0xfc)](_0x3bae20(0x1ff),_0x5296bb),_0x48110a[_0x3bae20(0xfc)](_0x3bae20(0x1ff),_0x5296bb),_0x503cb9[_0x3bae20(0x1e5)](_0x1e9dfd=>_0x1e9dfd[_0x3bae20(0xfc)](_0x3bae20(0x1ff),()=>{const _0x2172a4=_0x3bae20;_0x5296bb();const _0xc7dfd0=_0x1e9dfd[_0x2172a4(0x1b2)]==='1'&&_0x1e9dfd[_0x2172a4(0x28c)];_0x549f88['disabled']=!_0xc7dfd0,_0x48110a[_0x2172a4(0xab)]=!_0xc7dfd0;})),_0x25d0d6();}function handleApiModeChange(){const _0x533f64=_0x30c5e9,_0x170099=document[_0x533f64(0x14b)](_0x533f64(0x228))[_0x533f64(0x1b2)],_0x5a8b7e=document[_0x533f64(0x14b)]('hly-custom-endpoint-docket'),_0x2c3cc9=document[_0x533f64(0x14b)](_0x533f64(0x12a)),_0xa09168=document['getElementById']('hly-embedding-model'),_0x35a9ae=_0xa09168['previousElementSibling'];if(!_0x5a8b7e||!_0x2c3cc9)return;_0x5a8b7e['style'][_0x533f64(0x1b0)]=_0x533f64(0xb4),_0x2c3cc9[_0x533f64(0x109)]['display']=_0x533f64(0xb4);switch(_0x170099){case _0x533f64(0xbd):_0x5a8b7e[_0x533f64(0x109)]['display']=_0x533f64(0x1be),_0x2c3cc9['querySelector'](_0x533f64(0x176))[_0x533f64(0x24d)]='Google\x20API\x20Key:',_0x2c3cc9[_0x533f64(0x242)]('input')['placeholder']='请输入您的Google\x20API\x20Key';break;case _0x533f64(0x1cb):_0x5a8b7e[_0x533f64(0x242)]('label')[_0x533f64(0x24d)]=_0x533f64(0xf6),_0x5a8b7e[_0x533f64(0x242)]('input')['placeholder']=_0x533f64(0x21f),_0x2c3cc9[_0x533f64(0x109)]['display']=_0x533f64(0x1be);break;case _0x533f64(0xef):default:_0x5a8b7e[_0x533f64(0x242)]('label')[_0x533f64(0x24d)]=_0x533f64(0x282),_0x5a8b7e[_0x533f64(0x242)](_0x533f64(0xb5))[_0x533f64(0xcd)]=_0x533f64(0x117),_0x2c3cc9[_0x533f64(0x242)](_0x533f64(0x176))[_0x533f64(0x24d)]=_0x533f64(0x28e);break;}}function loadSettingsToUI(){const _0x3f1d5c=_0x30c5e9,_0x50a151=_0x1d6382[_0x3f1d5c(0x108)]();if(!_0x50a151)return;document['getElementById'](_0x3f1d5c(0x22c))[_0x3f1d5c(0x28c)]=_0x50a151['retrieval'][_0x3f1d5c(0xf7)],document[_0x3f1d5c(0x14b)](_0x3f1d5c(0x228))[_0x3f1d5c(0x1b2)]=_0x50a151[_0x3f1d5c(0x24e)][_0x3f1d5c(0x25f)],document['getElementById'](_0x3f1d5c(0x272))['value']=_0x50a151['retrieval']['customApiUrl'],document[_0x3f1d5c(0x14b)](_0x3f1d5c(0x1d9))[_0x3f1d5c(0x1b2)]=_0x50a151['retrieval']['apiKey'];const _0x1e5082=document[_0x3f1d5c(0x14b)](_0x3f1d5c(0x1fe));if(_0x1e5082['options'][_0x3f1d5c(0x174)]===0x0){const _0x139fbd=_0x50a151['retrieval']['embeddingModel'],_0x332ee4=new Option(_0x139fbd,_0x139fbd,!![],!![]);_0x1e5082['add'](_0x332ee4);}_0x1e5082[_0x3f1d5c(0x1b2)]=_0x50a151[_0x3f1d5c(0x24e)][_0x3f1d5c(0x127)],document[_0x3f1d5c(0x14b)]('hly-retrieval-notify')[_0x3f1d5c(0x28c)]=_0x50a151['retrieval']['notify'],document[_0x3f1d5c(0x14b)](_0x3f1d5c(0x24b))[_0x3f1d5c(0x1b2)]=_0x50a151[_0x3f1d5c(0x15b)]['chunkSize'],document['getElementById']('hly-overlap-size')[_0x3f1d5c(0x1b2)]=_0x50a151[_0x3f1d5c(0x15b)]['overlap'],document[_0x3f1d5c(0x14b)](_0x3f1d5c(0x1f2))[_0x3f1d5c(0x1b2)]=_0x50a151['advanced'][_0x3f1d5c(0x287)],document['getElementById'](_0x3f1d5c(0x106))['value']=_0x50a151[_0x3f1d5c(0x15b)][_0x3f1d5c(0x248)],document['getElementById'](_0x3f1d5c(0x27e))['value']=_0x50a151[_0x3f1d5c(0x15b)]['maxResults'],document[_0x3f1d5c(0x14b)](_0x3f1d5c(0x1d1))['value']=_0x50a151[_0x3f1d5c(0x24e)]['batchSize'],handleApiModeChange(),document[_0x3f1d5c(0x14b)]('hly-condensation-enabled')[_0x3f1d5c(0x28c)]=_0x50a151[_0x3f1d5c(0x129)][_0x3f1d5c(0xf7)],document['getElementById'](_0x3f1d5c(0x284))[_0x3f1d5c(0x1b2)]=_0x50a151[_0x3f1d5c(0x129)][_0x3f1d5c(0x137)],document[_0x3f1d5c(0x14b)](_0x3f1d5c(0x103))['value']=_0x50a151['condensation'][_0x3f1d5c(0x240)],document[_0x3f1d5c(0x14b)](_0x3f1d5c(0xd9))['checked']=_0x50a151[_0x3f1d5c(0x129)][_0x3f1d5c(0x289)][_0x3f1d5c(0x13c)],document[_0x3f1d5c(0x14b)]('hly-include-ai')[_0x3f1d5c(0x28c)]=_0x50a151[_0x3f1d5c(0x129)]['messageTypes']['ai'];const _0x3519ff=document['getElementById'](_0x3f1d5c(0x13d)),_0x3dcf57=document[_0x3f1d5c(0x14b)](_0x3f1d5c(0x1ce)),_0xba4534=document[_0x3f1d5c(0x14b)](_0x3f1d5c(0x1f0));_0x3519ff[_0x3f1d5c(0x28c)]=_0x50a151[_0x3f1d5c(0x129)][_0x3f1d5c(0x144)],_0x3dcf57[_0x3f1d5c(0x1b2)]=_0x50a151[_0x3f1d5c(0x129)][_0x3f1d5c(0x19e)],_0xba4534[_0x3f1d5c(0x109)][_0x3f1d5c(0x1b0)]=_0x3519ff[_0x3f1d5c(0x28c)]?_0x3f1d5c(0xb4):'none',document[_0x3f1d5c(0x14b)]('hly-rerank-enabled')['checked']=_0x50a151[_0x3f1d5c(0xda)][_0x3f1d5c(0xf7)],document[_0x3f1d5c(0x14b)](_0x3f1d5c(0xd5))[_0x3f1d5c(0x1b2)]=_0x50a151[_0x3f1d5c(0xda)][_0x3f1d5c(0xaf)],document[_0x3f1d5c(0x14b)]('hly-rerank-api-key')['value']=_0x50a151[_0x3f1d5c(0xda)][_0x3f1d5c(0x110)];const _0x3eb593=document['getElementById'](_0x3f1d5c(0x27f));if(_0x3eb593['options'][_0x3f1d5c(0x174)]===0x0){const _0x36e174=_0x50a151[_0x3f1d5c(0xda)][_0x3f1d5c(0x164)];if(_0x36e174){const _0xf8c80f=new Option(_0x36e174,_0x36e174,!![],!![]);_0x3eb593['add'](_0xf8c80f);}}_0x3eb593[_0x3f1d5c(0x1b2)]=_0x50a151[_0x3f1d5c(0xda)][_0x3f1d5c(0x164)],document[_0x3f1d5c(0x14b)](_0x3f1d5c(0xd7))[_0x3f1d5c(0x1b2)]=_0x50a151['rerank'][_0x3f1d5c(0x11e)],document[_0x3f1d5c(0x14b)]('hly-rerank-hybrid-alpha')[_0x3f1d5c(0x1b2)]=_0x50a151['rerank'][_0x3f1d5c(0x1a5)],document[_0x3f1d5c(0x14b)](_0x3f1d5c(0x1f1))['checked']=_0x50a151[_0x3f1d5c(0xda)][_0x3f1d5c(0x1b9)];}function saveSettingsFromUI(_0x348d2d=!![]){const _0x5621d5=_0x30c5e9,_0x326763=document[_0x5621d5(0x14b)](_0x5621d5(0x1fd));if(!_0x326763)return;const _0x35c442=_0x326763['querySelectorAll'](_0x5621d5(0x1a4));_0x35c442[_0x5621d5(0x1e5)](_0x3d1fd6=>{const _0xb3ded4=_0x5621d5,_0x216ece=_0x3d1fd6['dataset'][_0xb3ded4(0x188)];if(!_0x216ece)return;let _0x1964e6;const _0x27876e=_0x3d1fd6['dataset'][_0xb3ded4(0xa7)]||_0xb3ded4(0x222);if(_0x3d1fd6[_0xb3ded4(0xa7)]===_0xb3ded4(0x1f7))_0x1964e6=_0x3d1fd6[_0xb3ded4(0x28c)];else{if(_0x3d1fd6[_0xb3ded4(0xa7)]==='radio'){if(!_0x3d1fd6['checked'])return;_0x1964e6=_0x3d1fd6[_0xb3ded4(0x1b2)];}else _0x1964e6=_0x3d1fd6[_0xb3ded4(0x1b2)];}switch(_0x27876e){case'integer':_0x1964e6=parseInt(_0x1964e6,0xa);break;case _0xb3ded4(0xac):_0x1964e6=parseFloat(_0x1964e6);break;case _0xb3ded4(0x237):if(typeof _0x1964e6!==_0xb3ded4(0x237))_0x1964e6=_0x1964e6==='true';break;}const _0x389fa3=_0x1d6382[_0xb3ded4(0x108)](),_0x620704=_0x216ece[_0xb3ded4(0x23a)]('.');let _0x492855=_0x389fa3;for(let _0x52173e=0x0;_0x52173e<_0x620704[_0xb3ded4(0x174)]-0x1;_0x52173e++){_0x492855=_0x492855[_0x620704[_0x52173e]]=_0x492855[_0x620704[_0x52173e]]||{};}_0x492855[_0x620704[_0x620704[_0xb3ded4(0x174)]-0x1]]=_0x1964e6;}),_0x1d6382['saveSettings'](),!_0x348d2d&&(log('【手动存档】所有设定已存档封印。',_0x5621d5(0x140)),toastr[_0x5621d5(0x140)](_0x5621d5(0xdd),_0x5621d5(0x1a9)));}function resetSettingsToUI(){const _0x362648=_0x30c5e9;confirm(_0x362648(0xd8))&&(_0x1d6382[_0x362648(0x219)](),loadSettingsToUI(),toastr['info'](_0x362648(0x203),'诏曰'));}async function updatePanelStatus(){const _0x5e0d2c=_0x30c5e9,_0x21b5df=_0x1d6382[_0x5e0d2c(0x23e)](),_0x496702=document[_0x5e0d2c(0x14b)](_0x5e0d2c(0xf1)),_0x4e63da=document['getElementById'](_0x5e0d2c(0x131));if(_0x21b5df){const _0x1450c9=_0x1d6382['getLockedSessionInfo']();_0x1450c9&&(_0x496702[_0x5e0d2c(0x24d)]=_0x5e0d2c(0xae),_0x4e63da[_0x5e0d2c(0x24d)]=_0x1450c9['id'],_0x4e63da[_0x5e0d2c(0x251)]=_0x5e0d2c(0x10a)+_0x1450c9['id'],_0x496702['classList']['add'](_0x5e0d2c(0x1e3)),_0x4e63da['classList'][_0x5e0d2c(0x152)](_0x5e0d2c(0x1e3)));}else _0x496702[_0x5e0d2c(0x24d)]=_0x7530ec[_0x5e0d2c(0xad)](),_0x4e63da[_0x5e0d2c(0x24d)]=_0x7530ec[_0x5e0d2c(0x1ed)]()||'无',_0x4e63da[_0x5e0d2c(0x251)]='',_0x496702[_0x5e0d2c(0x167)][_0x5e0d2c(0x160)](_0x5e0d2c(0x1e3)),_0x4e63da[_0x5e0d2c(0x167)][_0x5e0d2c(0x160)](_0x5e0d2c(0x1e3));const _0x30acdd=document[_0x5e0d2c(0x14b)](_0x5e0d2c(0x9d));_0x30acdd[_0x5e0d2c(0x24d)]='...';try{const _0x1e7248=await _0x1d6382[_0x5e0d2c(0x273)]();_0x30acdd[_0x5e0d2c(0x24d)]=_0x1e7248;}catch(_0x3cbdc2){console[_0x5e0d2c(0x277)](_0x5e0d2c(0xf4),_0x3cbdc2),_0x30acdd[_0x5e0d2c(0x24d)]=_0x5e0d2c(0x157),_0x30acdd[_0x5e0d2c(0x251)]=_0x5e0d2c(0x1df)+_0x3cbdc2[_0x5e0d2c(0x250)];}const _0x4efecd=document[_0x5e0d2c(0x14b)](_0x5e0d2c(0x13b));if(_0x4efecd&&!_0x4efecd[_0x5e0d2c(0x111)][_0x5e0d2c(0xd4)]){const _0x22e0b6=_0x1d6382[_0x5e0d2c(0x108)](),_0x57b4dc=await _0x1d6382[_0x5e0d2c(0x100)]();if(_0x22e0b6[_0x5e0d2c(0x27a)]&&_0x22e0b6[_0x5e0d2c(0x27a)][_0x57b4dc]){const _0x21bd92=_0x22e0b6[_0x5e0d2c(0x27a)][_0x57b4dc];_0x4efecd[_0x5e0d2c(0xff)]=_0x5e0d2c(0x1e0)+_0x21bd92[_0x5e0d2c(0xa1)]+_0x5e0d2c(0x19b)+_0x21bd92[_0x5e0d2c(0x288)]+_0x5e0d2c(0x1e6);}else _0x4efecd['innerHTML']=_0x5e0d2c(0x210);}renderKnowledgeBases();}async function moveAllKnowledgeBases(_0x22455b){const _0x33f157=_0x30c5e9,_0x1e395c=_0x22455b===_0x33f157(0x1ca),_0x116226=_0x1e395c?_0x33f157(0x220):_0x33f157(0x202),_0x1606f6=_0x1e395c?'局部':'全局',_0x3dc9be=_0x1e395c?_0x1d6382['getGlobalKnowledgeBases']():_0x1d6382[_0x33f157(0xba)](),_0x4d375d=Object['keys'](_0x3dc9be);if(_0x4d375d[_0x33f157(0x174)]===0x0){toastr[_0x33f157(0x185)](_0x33f157(0xce)+(_0x1e395c?'全局':'局部')+_0x33f157(0xc6),'圣谕');return;}if(!confirm(_0x33f157(0x16a)+_0x4d375d['length']+'\x20个知识库从【'+(_0x1e395c?'全局':'局部')+_0x33f157(0xe5)+_0x1606f6+_0x33f157(0x213)))return;log('开始将\x20'+_0x4d375d[_0x33f157(0x174)]+_0x33f157(0x118)+_0x116226+_0x33f157(0xf5)+(_0x1e395c?_0x33f157(0x202):_0x33f157(0x220))+_0x33f157(0x21d),_0x33f157(0x185));const _0x586501=_0x4d375d[_0x33f157(0x18d)](_0x966a14=>_0x1d6382[_0x33f157(0x14c)](_0x966a14,_0x116226));try{await Promise[_0x33f157(0x11f)](_0x586501),toastr[_0x33f157(0x140)]('所有\x20'+_0x4d375d[_0x33f157(0x174)]+_0x33f157(0x175),_0x33f157(0x260)),log(_0x33f157(0x20b),'success');}catch(_0x4098fd){toastr[_0x33f157(0x277)](_0x33f157(0x101)+_0x4098fd[_0x33f157(0x250)],'警报'),log(_0x33f157(0x227)+_0x4098fd[_0x33f157(0x250)],_0x33f157(0x277));}finally{await updatePanelStatus();}}async function deleteAllLocalKnowledgeBases(){const _0x498322=_0x30c5e9,_0x4470c4=_0x1d6382[_0x498322(0xba)](),_0x1373ae=Object[_0x498322(0xc8)](_0x4470c4);if(_0x1373ae[_0x498322(0x174)]===0x0){toastr[_0x498322(0x185)]('当前角色没有任何局部知识库可供删除。','圣谕');return;}if(!confirm(_0x498322(0x10b)+_0x1373ae[_0x498322(0x174)]+_0x498322(0x20c)))return;toastr['info']('正在删除\x20'+_0x1373ae[_0x498322(0x174)]+_0x498322(0xb6),'圣旨'),log(_0x498322(0x143)+_0x1373ae[_0x498322(0x174)]+_0x498322(0xb6),_0x498322(0x1b7));let _0x29b1b2=0x0,_0x59ef36=0x0;for(const _0x2ad48b of _0x1373ae){try{await _0x1d6382[_0x498322(0x170)](_0x2ad48b,_0x498322(0x202)),_0x29b1b2++;}catch(_0xb002ad){_0x59ef36++,log('删除局部知识库\x20'+_0x2ad48b+_0x498322(0x1b6)+_0xb002ad[_0x498322(0x250)],_0x498322(0x277));}}_0x59ef36>0x0?toastr[_0x498322(0x277)](_0x498322(0x1a1)+_0x59ef36+_0x498322(0x270),'警报'):toastr['success'](_0x498322(0x112)+_0x29b1b2+'\x20个局部知识库均已成功删除。',_0x498322(0x260)),log(_0x498322(0x193)+_0x29b1b2+_0x498322(0x26f)+_0x59ef36,_0x498322(0x185)),await updatePanelStatus();}async function renderKnowledgeBases(){const _0xb5923f=_0x30c5e9,_0x283e56=document['getElementById']('hly-kb-list-local'),_0x297f42=document['getElementById'](_0xb5923f(0x11d)),_0xb0e43f=document['getElementById'](_0xb5923f(0x148));if(!_0x283e56||!_0x297f42||!_0xb0e43f)return;_0xb0e43f[_0xb5923f(0x24d)]=_0x7530ec[_0xb5923f(0xad)]()||_0xb5923f(0x23b);try{const _0xffae2=_0x1d6382[_0xb5923f(0xba)](),_0x3e6791=_0x1d6382['getGlobalKnowledgeBases']();await _renderKbList(_0xffae2,_0x283e56,'local',_0xb5923f(0x135)),await _renderKbList(_0x3e6791,_0x297f42,_0xb5923f(0x220),_0xb5923f(0x169));}catch(_0x158095){console[_0xb5923f(0x277)](_0xb5923f(0x238),_0x158095),_0x283e56[_0xb5923f(0xff)]='
加载失败:\x20'+_0x158095[_0xb5923f(0x250)]+_0xb5923f(0x266),_0x297f42[_0xb5923f(0xff)]=_0xb5923f(0x145)+_0x158095[_0xb5923f(0x250)]+_0xb5923f(0x266);}}async function _renderKbList(_0x45ce1e,_0x4fef30,_0x4e3e03,_0x216863){const _0x6c1c33=_0x30c5e9,_0x1da59c=document['getElementById'](_0x216863);_0x4fef30[_0x6c1c33(0xff)]='',_0x4fef30[_0x6c1c33(0x283)](_0x1da59c);if(Object['keys'](_0x45ce1e)[_0x6c1c33(0x174)]===0x0){_0x1da59c[_0x6c1c33(0x109)][_0x6c1c33(0x1b0)]=_0x6c1c33(0xb4);return;}_0x1da59c[_0x6c1c33(0x109)][_0x6c1c33(0x1b0)]=_0x6c1c33(0x1be);for(const [_0x100b65,_0x1adddf]of Object[_0x6c1c33(0x1d0)](_0x45ce1e)){const _0x199652=document[_0x6c1c33(0x12e)](_0x6c1c33(0x11a));_0x199652[_0x6c1c33(0x1ab)]=_0x6c1c33(0x276),_0x199652[_0x6c1c33(0x111)]['kbId']=_0x100b65,_0x199652[_0x6c1c33(0x111)][_0x6c1c33(0x154)]=_0x4e3e03;const _0x3bd7f6=await _0x1d6382[_0x6c1c33(0x273)](_0x100b65,_0x4e3e03),_0x2aaeaa=_0x4e3e03===_0x6c1c33(0x202)?_0x6c1c33(0x11b):_0x6c1c33(0xa6);_0x199652[_0x6c1c33(0xff)]=_0x6c1c33(0x18b)+_0x100b65+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x1adddf['name']+'\x20('+_0x3bd7f6+_0x6c1c33(0x1bb)+_0x2aaeaa+_0x6c1c33(0x231)+(_0x1adddf['enabled']?'checked':'')+_0x6c1c33(0x23c),_0x4fef30[_0x6c1c33(0x283)](_0x199652);}}async function handleKbAction(_0x5c7312){const _0x8266ae=_0x30c5e9,_0x336c40=_0x5c7312[_0x8266ae(0x17e)],_0xe3f6d5=_0x336c40[_0x8266ae(0x224)]('.hly-kb-list-item');if(!_0xe3f6d5)return;const _0x1b546c=_0xe3f6d5[_0x8266ae(0x111)]['kbId'],_0x4e05f0=_0xe3f6d5[_0x8266ae(0x111)][_0x8266ae(0x154)],_0x1945c1=_0xe3f6d5[_0x8266ae(0x242)](_0x8266ae(0x264))[_0x8266ae(0x24d)][_0x8266ae(0x23a)]('\x20(')[0x0];if(_0x336c40[_0x8266ae(0x167)][_0x8266ae(0x1c6)](_0x8266ae(0x265))){if(confirm(_0x8266ae(0x28a)+_0x1945c1+_0x8266ae(0x25a)))try{await _0x1d6382['removeKnowledgeBase'](_0x1b546c,_0x4e05f0),log(_0x8266ae(0xd3)+_0x1945c1+'\x20(ID:\x20'+_0x1b546c+')\x20已被删除',_0x8266ae(0x140)),toastr[_0x8266ae(0x140)]('知识库【'+_0x1945c1+'】已删除。'),await updatePanelStatus();}catch(_0x2adf76){log(_0x8266ae(0x151)+_0x1945c1+_0x8266ae(0x1b6)+_0x2adf76[_0x8266ae(0x250)],_0x8266ae(0x277)),toastr[_0x8266ae(0x277)]('删除失败:\x20'+_0x2adf76[_0x8266ae(0x250)]);}}if(_0x336c40[_0x8266ae(0x224)]('.hly-kb-move-btn')){const _0x51f0b7=_0x4e05f0===_0x8266ae(0x202)?'全局':'局部';if(confirm('您确定要将知识库【'+_0x1945c1+'】移动到【'+_0x51f0b7+_0x8266ae(0x213)))try{await _0x1d6382[_0x8266ae(0x14c)](_0x1b546c,_0x4e05f0),await updatePanelStatus();}catch(_0xb676bd){log(_0x8266ae(0x25d)+_0x1945c1+_0x8266ae(0x1b6)+_0xb676bd[_0x8266ae(0x250)],'error'),toastr[_0x8266ae(0x277)]('移动失败:\x20'+_0xb676bd[_0x8266ae(0x250)]);}}if(_0x336c40['classList'][_0x8266ae(0x1c6)](_0x8266ae(0x1a2))&&_0x5c7312['type']===_0x8266ae(0x1ff))try{await _0x1d6382[_0x8266ae(0x133)](_0x1b546c,_0x4e05f0),log(_0x8266ae(0xd3)+_0x1945c1+_0x8266ae(0x22d),_0x8266ae(0x140));}catch(_0x1b5558){log(_0x8266ae(0x10c)+_0x1945c1+'\x20状态失败:\x20'+_0x1b5558['message'],_0x8266ae(0x277)),toastr[_0x8266ae(0x277)](_0x8266ae(0x24c)+_0x1b5558[_0x8266ae(0x250)]),_0x336c40[_0x8266ae(0x28c)]=!_0x336c40[_0x8266ae(0x28c)];}_0x336c40[_0x8266ae(0x167)][_0x8266ae(0x1c6)](_0x8266ae(0x1f3))&&_0x5c7312[_0x8266ae(0xa7)]===_0x8266ae(0x1ff)&&updateBulkActionUI(_0x4e05f0);}function handleSelectAll(_0x20dfe4,_0x1ab805){const _0x3712a6=_0x30c5e9,_0x2a6228=_0x20dfe4[_0x3712a6(0x17e)][_0x3712a6(0x28c)],_0x1d7608=document[_0x3712a6(0x14b)](_0x3712a6(0x226)+_0x1ab805),_0x2cca16=_0x1d7608[_0x3712a6(0x1e1)](_0x3712a6(0x217));_0x2cca16[_0x3712a6(0x1e5)](_0x157554=>_0x157554[_0x3712a6(0x28c)]=_0x2a6228),updateBulkActionUI(_0x1ab805);}function _0x1d12(){const _0x3bd6ad=['所有\x20','-tab','1258467YGXQAA','','\x20楼到\x20','hly-kb-list-global','top_n','all','13350656IQWPbp','\x20个知识块。','\x20个条目进行批量编纂...','move','fas\x20fa-lock-open','[自动保存]\x20设置项\x20\x27','内容排除规则已保存。','embeddingModel','log-success','condensation','hly-api-key-group','fa-exclamation-triangle','injection_','成功加载\x20','createElement','\x20个知识库吗?此操作无法恢复!','files','hly-current-chat-id','hly-injection-source-selector','toggleKnowledgeBase','\x20个Rerank模型。','hly-kb-list-local-placeholder','收到手动录入请求,文本长度:\x20','layerStart','[翰林院-枢纽]\x20获取Rerank模型列表失败:','错误:\x20','您确定要将选中的\x20','hly-condensation-results','user','hly-tag-extraction-toggle','正在准备凝识...','清空宝库失败。','success','stringify','手动录入成功,新增\x20','开始批量删除\x20','tagExtractionEnabled',' 加载失败:\x20','warning','正在读取文件...','hly-local-kb-char-name','hly-delete-rule-btn','\x20条忆识。','getElementById','moveKnowledgeBase','\x20条消息,开始凝识...','chat','\x0a忆识总数:\x20','\x0a所用模型:\x20','删除知识库\x20','add','input[name=\x22hly-unified-injection-position\x22]:checked','kbScope','startHLYHistoriography','toLocaleTimeString','N/A','[翰林院-枢纽]\x20获取模型列表失败:','hly-kb-bulk-actions-','\x20个知识库移动到【','advanced','批量编纂任务已完成,但有部分错误。','确认并更新预览','fa-circle-info','clearJob','remove','preventDefault','#hly-rules-list','generateJobId','model','宝库状态','hly-kb-bulk-actions-local','classList','hanlinyuan-ingest-novel-start','hly-kb-list-global-placeholder','您确定要将\x20','\x20块继续录入。','%。是否从上次中断之处继续?','hly-kb-move-all-to-local','18oKeGBQ','\x20条有效条目),请点击“开始凝识”进入自动向量化流程。','removeKnowledgeBase','成功切换了\x20','novel','amily2_open_rag_palace','length','\x20个知识库均已成功移动。','label','处理中:\x20','{{text}}','hly-session-lock-btn','6106086MRzTLa','selectedIndex','hanlinyuan-ingest-novel-file-input','批量编纂任务已完成。','target','解锁会话','.position','totalSuccess','hly-kb-delete-local-btn','未选择文件','hly-kb-select-all-local','info','正在处理您确认后的文书...','圣旨已下','settingKey','insertAdjacentHTML','val','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20获取失败','tags','会话已解锁。','已选择\x20','操作完成,但有\x20','hly-kb-toggle','#hly-add-rule-btn','[data-setting-key]','hybrid_alpha','preview-item-','任务已由用户中止。进度已保存,可随时继续。','启禀大人,发现此书上次录入已完成\x20','圣旨已达','initialize','className','圣谕不明','beforeend','未检测到预览文本,按标准流程采集消息...','saveSettings','display','removeEventListener','value','\x22\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\x20\x20\x20\x20\x20\x20\x20\x20\x20data-send-date=\x22','fetchHLYRerankModels','遵命,将从头开始录入此书。','\x20失败:\x20','warn','》获取条目列表...','notify','option','条) 上次已从第\x20','querySelectorAll','totalVectors','hly-locked-status','data','forEach','\x20楼。 可在此预览凝识结果。 在这里定义需要从提取内容中排除的文本片段。例如,排除HTML注释,可以设置开始字符为\x20``。