From 8475d51d5be1e058b74cf9a49d70376909794d62 Mon Sep 17 00:00:00 2001 From: Wx-2025 <351320169@qq.com> Date: Mon, 21 Jul 2025 07:19:26 +0800 Subject: [PATCH] Update state.js --- ui/state.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/state.js b/ui/state.js index 2120b70..31e58c2 100644 --- a/ui/state.js +++ b/ui/state.js @@ -1 +1 @@ -(function(_0x554f81,_0x111bae){const _0x31b014=_0xe52b,_0x5405aa=_0x554f81();while(!![]){try{const _0x5207a9=parseInt(_0x31b014(0x16f))/0x1*(-parseInt(_0x31b014(0x17e))/0x2)+-parseInt(_0x31b014(0x184))/0x3+-parseInt(_0x31b014(0x14e))/0x4+parseInt(_0x31b014(0x15f))/0x5+parseInt(_0x31b014(0x163))/0x6*(parseInt(_0x31b014(0x15e))/0x7)+-parseInt(_0x31b014(0x144))/0x8*(-parseInt(_0x31b014(0x167))/0x9)+parseInt(_0x31b014(0x151))/0xa;if(_0x5207a9===_0x111bae)break;else _0x5405aa['push'](_0x5405aa['shift']());}catch(_0x2b102e){_0x5405aa['push'](_0x5405aa['shift']());}}}(_0x1b44,0x31285));import{extension_settings}from'/scripts/extensions.js';function _0x1b44(){const _0x8fc850=['#amily2_summarization_prompt','#amily2_lore_depth_container','at_depth','loreActivationMode','49sPywfJ','130010WLgAVF','checked','--\x20选择模型\x20--','已加载\x20','264828JRhUtj','enabled','lorebookTarget','#amily2_lore_depth_input','153PZdsZS','show','','#amily2_summarization_enabled','.plugin-features','contextMessages','empty','请检查API配置后点击\x22刷新模型\x22','89705iAQBwL','#amily2_api_key','#amily2_mhb_small_trigger_count','input[name=\x22amily2_lorebook_target\x22][value=\x22','iconLocation','summarizationPrompt','hide','#amily2_suppress_toast','suppressToast','#amily2_max_tokens','#amily2_system_prompt','autoHideThreshold','#amily2_update_indicator','prop','#amily2_context_messages','2TWOikv','text','model','worldbookEnabled','val','#amily2_temperature_value','265614zAyiPo','#amily2_auto_hide_threshold','input[name=\x22amily2_icon_location\x22][value=\x22','apiKey','#amily2_output_format_prompt','#amily2_model_notes','length','maxTokens','attr','#amily2_api_url','temperature','#amily2_temperature','已选择:\x20','136816xiBCXn','#amily2_lore_activation_mode','optimizationEnabled','forEach','summarizationEnabled','authorized','#amily2_optimization_target_tag','#auth_panel','loreInsertionPosition','','1492292lVeZHV','historiographySmallAutoEnable','#amily2_mhb_small_auto_enabled','1269630HtiTzd','#amily2_lore_insertion_position','selected','append','historiographySmallTriggerThreshold','mainPrompt','#amily2_enabled','html','无可用模型,请刷新'];_0x1b44=function(){return _0x8fc850;};return _0x1b44();}import{extensionName}from'../utils/settings.js';import{pluginAuthStatus}from'../utils/auth.js';let availableModels=[],latestUpdateInfo=null,newVersionAvailable=![];export function setUpdateInfo(_0x188fab,_0x29c0fa){newVersionAvailable=_0x188fab,latestUpdateInfo=_0x29c0fa;}export function applyUpdateIndicator(){const _0x582139=_0xe52b;if(newVersionAvailable)$(_0x582139(0x17b))[_0x582139(0x168)]();else{}}export function getLatestUpdateInfo(){return latestUpdateInfo;}export function setAvailableModels(_0xecffa2){availableModels=_0xecffa2;}export function populateModelDropdown(){const _0x5b5717=_0xe52b,_0x4f1b13=$('#amily2_model'),_0x20191c=$(_0x5b5717(0x189));_0x4f1b13[_0x5b5717(0x16d)]();const _0x5b6bd7=extension_settings[extensionName]?.[_0x5b5717(0x180)]||'';if(availableModels['length']===0x0){_0x4f1b13[_0x5b5717(0x154)](_0x5b5717(0x159)),_0x20191c[_0x5b5717(0x158)](_0x5b5717(0x16e));return;}const _0x3d1286=$(_0x5b5717(0x169))['val']('')['text'](_0x5b5717(0x161));_0x4f1b13[_0x5b5717(0x154)](_0x3d1286),availableModels[_0x5b5717(0x147)](_0x20420e=>{const _0x3eb33b=_0x5b5717,_0x5afe8a=$(_0x3eb33b(0x169))[_0x3eb33b(0x182)](_0x20420e)[_0x3eb33b(0x17f)](_0x20420e);_0x20420e===_0x5b6bd7&&_0x5afe8a[_0x3eb33b(0x13f)](_0x3eb33b(0x153),_0x3eb33b(0x153)),_0x4f1b13[_0x3eb33b(0x154)](_0x5afe8a);}),_0x5b6bd7&&_0x4f1b13[_0x5b5717(0x182)]()===_0x5b6bd7?_0x20191c[_0x5b5717(0x158)](_0x5b5717(0x143)+_0x5b6bd7+_0x5b5717(0x14d)):_0x20191c[_0x5b5717(0x158)](_0x5b5717(0x162)+availableModels[_0x5b5717(0x13d)]+'\x20个可用模型');}function _0xe52b(_0xfcfbc6,_0x37ed65){const _0x1b4407=_0x1b44();return _0xe52b=function(_0xe52b88,_0x257407){_0xe52b88=_0xe52b88-0x13d;let _0x51d3f3=_0x1b4407[_0xe52b88];return _0x51d3f3;},_0xe52b(_0xfcfbc6,_0x37ed65);}export function updateUI(){const _0x4bfa9a=_0xe52b;if(!pluginAuthStatus[_0x4bfa9a(0x149)])$('#auth_panel')['show'](),$(_0x4bfa9a(0x16b))['hide']();else{$(_0x4bfa9a(0x14b))[_0x4bfa9a(0x175)](),$(_0x4bfa9a(0x16b))[_0x4bfa9a(0x168)]();const _0x26ff3e=extension_settings[extensionName];if(!_0x26ff3e)return;$(_0x4bfa9a(0x157))['prop'](_0x4bfa9a(0x160),_0x26ff3e[_0x4bfa9a(0x164)]),$(_0x4bfa9a(0x140))[_0x4bfa9a(0x182)](_0x26ff3e['apiUrl']),$(_0x4bfa9a(0x170))['val'](_0x26ff3e[_0x4bfa9a(0x187)]),$('#amily2_model')[_0x4bfa9a(0x182)](_0x26ff3e[_0x4bfa9a(0x180)]),$(_0x4bfa9a(0x178))[_0x4bfa9a(0x182)](_0x26ff3e['maxTokens']),$('#amily2_max_tokens_value')[_0x4bfa9a(0x17f)](_0x26ff3e[_0x4bfa9a(0x13e)]),$(_0x4bfa9a(0x142))[_0x4bfa9a(0x182)](_0x26ff3e[_0x4bfa9a(0x141)]),$(_0x4bfa9a(0x183))['text'](_0x26ff3e[_0x4bfa9a(0x141)]),$(_0x4bfa9a(0x17d))['val'](_0x26ff3e[_0x4bfa9a(0x16c)]),$('#amily2_context_messages_value')[_0x4bfa9a(0x17f)](_0x26ff3e[_0x4bfa9a(0x16c)]),$(_0x4bfa9a(0x14a))['val'](_0x26ff3e['optimizationTargetTag']),$('input[name=\x22amily2_optimization_mode\x22][value=\x22'+_0x26ff3e['optimizationMode']+'\x22]')['prop'](_0x4bfa9a(0x160),!![]),$('#amily2_optimization_enabled')[_0x4bfa9a(0x17c)](_0x4bfa9a(0x160),_0x26ff3e[_0x4bfa9a(0x146)]),$('#amily2_show_optimization_toast')[_0x4bfa9a(0x17c)](_0x4bfa9a(0x160),_0x26ff3e['showOptimizationToast']),$(_0x4bfa9a(0x176))[_0x4bfa9a(0x17c)](_0x4bfa9a(0x160),_0x26ff3e[_0x4bfa9a(0x177)]),$(_0x4bfa9a(0x179))[_0x4bfa9a(0x182)](_0x26ff3e['systemPrompt']),$('#amily2_main_prompt')[_0x4bfa9a(0x182)](_0x26ff3e[_0x4bfa9a(0x156)]),$(_0x4bfa9a(0x188))[_0x4bfa9a(0x182)](_0x26ff3e['outputFormatPrompt']),$(_0x4bfa9a(0x15a))[_0x4bfa9a(0x182)](_0x26ff3e[_0x4bfa9a(0x174)]),$('#amily2_worldbook_enabled')[_0x4bfa9a(0x17c)](_0x4bfa9a(0x160),_0x26ff3e[_0x4bfa9a(0x181)]),$(_0x4bfa9a(0x16a))[_0x4bfa9a(0x17c)]('checked',_0x26ff3e[_0x4bfa9a(0x148)]),$(_0x4bfa9a(0x172)+_0x26ff3e[_0x4bfa9a(0x165)]+'\x22]')[_0x4bfa9a(0x17c)](_0x4bfa9a(0x160),!![]),$(_0x4bfa9a(0x186)+_0x26ff3e[_0x4bfa9a(0x173)]+'\x22]')[_0x4bfa9a(0x17c)](_0x4bfa9a(0x160),!![]),$('#amily2_auto_hide_enabled')['prop']('checked',_0x26ff3e['autoHideEnabled']),$(_0x4bfa9a(0x185))['val'](_0x26ff3e[_0x4bfa9a(0x17a)]),$('#amily2_auto_hide_threshold_value')[_0x4bfa9a(0x17f)](_0x26ff3e[_0x4bfa9a(0x17a)]),$(_0x4bfa9a(0x145))[_0x4bfa9a(0x182)](_0x26ff3e[_0x4bfa9a(0x15d)]),$(_0x4bfa9a(0x152))[_0x4bfa9a(0x182)](_0x26ff3e[_0x4bfa9a(0x14c)]),$(_0x4bfa9a(0x166))[_0x4bfa9a(0x182)](_0x26ff3e['loreDepth']),_0x26ff3e[_0x4bfa9a(0x14c)]===_0x4bfa9a(0x15c)?$(_0x4bfa9a(0x15b))[_0x4bfa9a(0x168)]():$('#amily2_lore_depth_container')[_0x4bfa9a(0x175)](),_0x26ff3e[_0x4bfa9a(0x14f)]!==undefined&&$(_0x4bfa9a(0x150))[_0x4bfa9a(0x17c)]('checked',_0x26ff3e[_0x4bfa9a(0x14f)]),_0x26ff3e[_0x4bfa9a(0x155)]!==undefined&&$(_0x4bfa9a(0x171))['val'](_0x26ff3e['historiographySmallTriggerThreshold']),populateModelDropdown();}} +function _0x13df(){const _0x47d610=['maxTokens','apiUrl','#amily2_model','optimizationTargetTag','systemPrompt','#amily2_temperature','#amily2_summarization_enabled','#amily2_lore_depth_input','#amily2_context_messages','loreDepth','1600efXTSA','请检查API配置后点击\x22刷新模型\x22','hide','#amily2_api_url','2608245UcBJQB','#amily2_auto_hide_threshold_value','#amily2_output_format_prompt','已选择:\x20','#amily2_max_tokens_value','#auth_panel','mainPrompt','show','checked','input[name=\x22amily2_lorebook_target\x22][value=\x22','#amily2_temperature_value','4593970pTFMrZ','','38KQwLTP','selected','11FlhtsO','loreInsertionPosition','已加载\x20','2637790CBNeCy','#amily2_main_prompt','attr','autoHideEnabled','contextMessages','13979yyvuti','html','#amily2_mhb_small_auto_enabled','input[name=\x22amily2_optimization_mode\x22][value=\x22','text','#amily2_context_messages_value','3918HRtUNZ','#amily2_enabled','#amily2_lore_depth_container','.plugin-features','#amily2_worldbook_enabled','autoHideThreshold','#amily2_optimization_enabled','lorebookTarget','#amily2_show_optimization_toast','693318adBwMA','prop','showOptimizationToast','input[name=\x22amily2_icon_location\x22][value=\x22','historiographySmallAutoEnable','append','1027950sWhadr','summarizationEnabled','historiographySmallTriggerThreshold','length','#amily2_max_tokens','suppressToast','#amily2_optimization_target_tag','','empty','at_depth','val','#amily2_suppress_toast','worldbookEnabled','4rCIAoz','authorized','#amily2_summarization_prompt','forEach','#amily2_model_notes'];_0x13df=function(){return _0x47d610;};return _0x13df();}(function(_0xb5c45a,_0x5b32d2){const _0x3c5c0c=_0x521b,_0x4a5fbb=_0xb5c45a();while(!![]){try{const _0x4b91b7=-parseInt(_0x3c5c0c(0x14e))/0x1*(-parseInt(_0x3c5c0c(0x18a))/0x2)+parseInt(_0x3c5c0c(0x157))/0x3*(-parseInt(_0x3c5c0c(0x16a))/0x4)+parseInt(_0x3c5c0c(0x143))/0x5+-parseInt(_0x3c5c0c(0x15d))/0x6+parseInt(_0x3c5c0c(0x148))/0x7*(-parseInt(_0x3c5c0c(0x179))/0x8)+parseInt(_0x3c5c0c(0x17d))/0x9+parseInt(_0x3c5c0c(0x188))/0xa*(parseInt(_0x3c5c0c(0x18c))/0xb);if(_0x4b91b7===_0x5b32d2)break;else _0x4a5fbb['push'](_0x4a5fbb['shift']());}catch(_0x252f52){_0x4a5fbb['push'](_0x4a5fbb['shift']());}}}(_0x13df,0x861fb));import{extension_settings}from'/scripts/extensions.js';import{extensionName}from'../utils/settings.js';import{pluginAuthStatus}from'../utils/auth.js';let availableModels=[],latestUpdateInfo=null,newVersionAvailable=![];export function setUpdateInfo(_0x54361a,_0x2e2957){newVersionAvailable=_0x54361a,latestUpdateInfo=_0x2e2957;}export function applyUpdateIndicator(){const _0x5ee720=_0x521b;if(newVersionAvailable)$('#amily2_update_indicator')[_0x5ee720(0x184)]();else{}}function _0x521b(_0xce26cc,_0x501069){const _0x13df70=_0x13df();return _0x521b=function(_0x521bf8,_0x433e4a){_0x521bf8=_0x521bf8-0x143;let _0x216f11=_0x13df70[_0x521bf8];return _0x216f11;},_0x521b(_0xce26cc,_0x501069);}export function getLatestUpdateInfo(){return latestUpdateInfo;}export function setAvailableModels(_0xd5f627){availableModels=_0xd5f627;}export function populateModelDropdown(){const _0x2eb2a5=_0x521b,_0x5edf38=$(_0x2eb2a5(0x171)),_0x19dcec=$(_0x2eb2a5(0x16e));_0x5edf38[_0x2eb2a5(0x165)]();const _0x2a7d27=extension_settings[extensionName]?.['model']||'';if(availableModels[_0x2eb2a5(0x160)]===0x0){_0x5edf38[_0x2eb2a5(0x15c)]('无可用模型,请刷新'),_0x19dcec[_0x2eb2a5(0x149)](_0x2eb2a5(0x17a));return;}const _0x3e8083=$(_0x2eb2a5(0x164))[_0x2eb2a5(0x167)]('')[_0x2eb2a5(0x14c)]('--\x20选择模型\x20--');_0x5edf38[_0x2eb2a5(0x15c)](_0x3e8083),availableModels[_0x2eb2a5(0x16d)](_0x3268f3=>{const _0x1eca1e=_0x2eb2a5,_0x50bcd1=$(_0x1eca1e(0x164))[_0x1eca1e(0x167)](_0x3268f3)['text'](_0x3268f3);_0x3268f3===_0x2a7d27&&_0x50bcd1[_0x1eca1e(0x145)]('selected',_0x1eca1e(0x18b)),_0x5edf38[_0x1eca1e(0x15c)](_0x50bcd1);}),_0x2a7d27&&_0x5edf38['val']()===_0x2a7d27?_0x19dcec[_0x2eb2a5(0x149)](_0x2eb2a5(0x180)+_0x2a7d27+_0x2eb2a5(0x189)):_0x19dcec[_0x2eb2a5(0x149)](_0x2eb2a5(0x18e)+availableModels[_0x2eb2a5(0x160)]+'\x20个可用模型');}export function updateUI(){const _0x2e0995=_0x521b;if(!pluginAuthStatus[_0x2e0995(0x16b)])$(_0x2e0995(0x182))[_0x2e0995(0x184)](),$(_0x2e0995(0x151))['hide']();else{$(_0x2e0995(0x182))[_0x2e0995(0x17b)](),$(_0x2e0995(0x151))[_0x2e0995(0x184)]();const _0x4823d6=extension_settings[extensionName];if(!_0x4823d6)return;$(_0x2e0995(0x14f))['prop'](_0x2e0995(0x185),_0x4823d6['enabled']),$(_0x2e0995(0x17c))['val'](_0x4823d6[_0x2e0995(0x170)]),$('#amily2_api_key')[_0x2e0995(0x167)](_0x4823d6['apiKey']),$(_0x2e0995(0x171))[_0x2e0995(0x167)](_0x4823d6['model']),$(_0x2e0995(0x161))['val'](_0x4823d6[_0x2e0995(0x16f)]),$(_0x2e0995(0x181))[_0x2e0995(0x14c)](_0x4823d6[_0x2e0995(0x16f)]),$(_0x2e0995(0x174))[_0x2e0995(0x167)](_0x4823d6['temperature']),$(_0x2e0995(0x187))['text'](_0x4823d6['temperature']),$(_0x2e0995(0x177))[_0x2e0995(0x167)](_0x4823d6['contextMessages']),$(_0x2e0995(0x14d))['text'](_0x4823d6[_0x2e0995(0x147)]),$(_0x2e0995(0x163))[_0x2e0995(0x167)](_0x4823d6[_0x2e0995(0x172)]),$(_0x2e0995(0x14b)+_0x4823d6['optimizationMode']+'\x22]')[_0x2e0995(0x158)](_0x2e0995(0x185),!![]),$(_0x2e0995(0x154))[_0x2e0995(0x158)](_0x2e0995(0x185),_0x4823d6['optimizationEnabled']),$(_0x2e0995(0x156))[_0x2e0995(0x158)](_0x2e0995(0x185),_0x4823d6[_0x2e0995(0x159)]),$(_0x2e0995(0x168))[_0x2e0995(0x158)](_0x2e0995(0x185),_0x4823d6[_0x2e0995(0x162)]),$('#amily2_system_prompt')[_0x2e0995(0x167)](_0x4823d6[_0x2e0995(0x173)]),$(_0x2e0995(0x144))[_0x2e0995(0x167)](_0x4823d6[_0x2e0995(0x183)]),$(_0x2e0995(0x17f))['val'](_0x4823d6['outputFormatPrompt']),$(_0x2e0995(0x16c))['val'](_0x4823d6['summarizationPrompt']),$(_0x2e0995(0x152))[_0x2e0995(0x158)](_0x2e0995(0x185),_0x4823d6[_0x2e0995(0x169)]),$(_0x2e0995(0x175))[_0x2e0995(0x158)]('checked',_0x4823d6[_0x2e0995(0x15e)]),$(_0x2e0995(0x186)+_0x4823d6[_0x2e0995(0x155)]+'\x22]')[_0x2e0995(0x158)](_0x2e0995(0x185),!![]),$(_0x2e0995(0x15a)+_0x4823d6['iconLocation']+'\x22]')[_0x2e0995(0x158)](_0x2e0995(0x185),!![]),$('#amily2_auto_hide_enabled')[_0x2e0995(0x158)]('checked',_0x4823d6[_0x2e0995(0x146)]),$('#amily2_auto_hide_threshold')['val'](_0x4823d6['autoHideThreshold']),$(_0x2e0995(0x17e))[_0x2e0995(0x14c)](_0x4823d6[_0x2e0995(0x153)]),$('#amily2_lore_activation_mode')[_0x2e0995(0x167)](_0x4823d6['loreActivationMode']),$('#amily2_lore_insertion_position')[_0x2e0995(0x167)](_0x4823d6['loreInsertionPosition']),$(_0x2e0995(0x176))[_0x2e0995(0x167)](_0x4823d6[_0x2e0995(0x178)]),_0x4823d6[_0x2e0995(0x18d)]===_0x2e0995(0x166)?$(_0x2e0995(0x150))[_0x2e0995(0x184)]():$(_0x2e0995(0x150))[_0x2e0995(0x17b)](),_0x4823d6[_0x2e0995(0x15b)]!==undefined&&$(_0x2e0995(0x14a))[_0x2e0995(0x158)](_0x2e0995(0x185),_0x4823d6[_0x2e0995(0x15b)]),_0x4823d6[_0x2e0995(0x15f)]!==undefined&&$('#amily2_mhb_small_trigger_count')[_0x2e0995(0x167)](_0x4823d6[_0x2e0995(0x15f)]),populateModelDropdown();}}