@lovrabet/cli 1.2.5-beta.2 → 1.2.5-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/lib/add-page/input-page-router.js +1 -1
  2. package/lib/add-page/main.js +1 -1
  3. package/lib/add-page/select-page-template.js +1 -1
  4. package/lib/ai-setup/AISetupUI.js +1 -0
  5. package/lib/ai-setup/config.js +1 -0
  6. package/lib/api/api-doc-ui.js +1 -1
  7. package/lib/api/api-doc.js +1 -1
  8. package/lib/api/api-pull-ui.js +1 -1
  9. package/lib/api/fetch-model-list.js +1 -1
  10. package/lib/api/generate-api-file.js +1 -1
  11. package/lib/api/main.js +1 -1
  12. package/lib/api/pull-silent.js +1 -1
  13. package/lib/app-menu/app-menu-sync-ui.js +1 -1
  14. package/lib/app-menu/create-menu.js +1 -1
  15. package/lib/app-menu/get-local-pages.js +1 -1
  16. package/lib/app-menu/get-online-menu-list.js +1 -1
  17. package/lib/app-menu/use-get-online-menu-list.js +1 -1
  18. package/lib/app-menu/utils.js +1 -1
  19. package/lib/app-menu/valid-url.js +1 -1
  20. package/lib/app-menu-update-cdn/current-content.js +1 -1
  21. package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
  22. package/lib/app-menu-update-cdn/main.js +1 -1
  23. package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
  24. package/lib/auth/auth-server-ui.js +1 -1
  25. package/lib/auth/auth-server.js +1 -1
  26. package/lib/auth/constant.js +1 -1
  27. package/lib/auth/get-cookie.js +1 -1
  28. package/lib/auth/is-session-valid.js +1 -1
  29. package/lib/auth/logout.js +1 -1
  30. package/lib/cli.js +1 -1
  31. package/lib/cmd/build-watch.js +1 -1
  32. package/lib/cmd/build.js +1 -1
  33. package/lib/cmd/logs.js +1 -1
  34. package/lib/cmd/preview.js +1 -1
  35. package/lib/cmd/start.js +1 -1
  36. package/lib/config/config-help.js +1 -1
  37. package/lib/config/main.js +1 -1
  38. package/lib/constant/domain.js +1 -1
  39. package/lib/constant/env.js +1 -1
  40. package/lib/create-app/enhanced-guided-create.js +1 -1
  41. package/lib/create-app/format-elapsed.js +1 -1
  42. package/lib/create-app/main.js +1 -1
  43. package/lib/create-app/task-finished.js +1 -1
  44. package/lib/create-app/task-loading.js +1 -1
  45. package/lib/create-app/task-running.js +1 -1
  46. package/lib/create-app/task-time.js +1 -1
  47. package/lib/create-app/use-copy-project-template.js +1 -1
  48. package/lib/create-app/use-format-code.js +1 -1
  49. package/lib/create-app/use-install-dependencies.js +1 -1
  50. package/lib/help.js +1 -1
  51. package/lib/init/main.js +1 -1
  52. package/lib/mcp/McpInstallUI.js +1 -0
  53. package/lib/mcp/claude.js +1 -1
  54. package/lib/mcp/cursor.js +1 -1
  55. package/lib/mcp/main.js +1 -1
  56. package/lib/skills/SkillInstallUI.js +1 -0
  57. package/lib/skills/main.js +1 -1
  58. package/lib/utils/check-sdk-version.js +1 -1
  59. package/lib/utils/config.js +1 -1
  60. package/lib/utils/copy-directory.js +1 -1
  61. package/lib/utils/http-client.js +1 -1
  62. package/lib/utils/logger.js +1 -1
  63. package/lib/utils/router-updater.js +1 -1
  64. package/lib/utils/sleep.js +1 -1
  65. package/lib/utils/template-replacer.js +1 -1
  66. package/package.json +1 -1
  67. package/templates/pages/blank/index.tsx.tpl +1 -2
  68. package/templates/pages/sdk-fetch/index.tsx.tpl +1 -2
  69. package/templates/rules/lovrabet_rules.mdc.tpl +109 -0
  70. package/templates/skills/.agent/skills/lovrabet/SKILL.md +258 -0
  71. package/templates/skills/.codebuddy/skills/lovrabet/SKILL.md +258 -0
  72. package/templates/skills/.codex/skills/lovrabet/SKILL.md +258 -0
  73. package/templates/skills/.opencode/skills/lovrabet/SKILL.md +258 -0
  74. package/templates/skills/.qoder/rules/lovrabet.md +258 -0
  75. package/templates/skills/.qoder/skills/lovrabet.md +258 -0
  76. package/templates/skills/.shared/guides/03-antd-style/guide.md +42 -0
  77. package/templates/skills/.trae/skills/lovrabet/SKILL.md +258 -0
@@ -1 +1 @@
1
- (function(_0x39a226,_0x201af5){const _0x25f831=a10_0x3dc7,_0x4cc748=_0x39a226();while(!![]){try{const _0x2116c1=-parseInt(_0x25f831(0xe8))/0x1+-parseInt(_0x25f831(0xf2))/0x2+parseInt(_0x25f831(0xee))/0x3*(-parseInt(_0x25f831(0xc0))/0x4)+-parseInt(_0x25f831(0xbf))/0x5*(parseInt(_0x25f831(0xf6))/0x6)+-parseInt(_0x25f831(0xe1))/0x7*(parseInt(_0x25f831(0xf3))/0x8)+parseInt(_0x25f831(0xef))/0x9+parseInt(_0x25f831(0xd6))/0xa;if(_0x2116c1===_0x201af5)break;else _0x4cc748['push'](_0x4cc748['shift']());}catch(_0xd84836){_0x4cc748['push'](_0x4cc748['shift']());}}}(a10_0x420c,0xa93cd));import{jsx as a10_0x1a39d0,jsxs as a10_0x59cfe5,Fragment as a10_0x3d321e}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a10_0x4dd96a from'ink-spinner';import{useGetOnlineMenuList}from'./use-get-online-menu-list.js';import{getLocalPages}from'./get-local-pages.js';import{createMenus}from'./create-menu.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import.meta.main&&render(a10_0x1a39d0(AppMenuSyncUI,{}));function a10_0x420c(){const _0x5db266=['map','JS\x20链接无法访问','size','\x20命令重新登录','message','delete','菜单名称','has','white','selecting','input-js','backspace','\x20正在获取线上菜单列表...','done','38074940xHDRJj','join','!\x20未找到本地页面,请先创建页面','local','red','length','slice','*\x20请选择要同步的菜单:','return','includes','Lovrabet平台','14TlfziH','green','yellow','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','\x20←\x20','label','trim','1053149usurtT','input-css','filter','创建菜单失败','CSS\x20链接','online','6NtiDrE','756207kEdVmc','downArrow','column','2069278ZjCFJW','883888yuZjes','*\x20CSS\x20链接:\x20','*\x20JS\x20链接:\x20','6XAZAIF','*\x20同步菜单到\x20Lovrabet\x20平台','√\x20菜单创建完成','gray','blue','catch','CSS\x20链接无法访问','已选择菜单','[✓]','\x20输入项目的\x20JS\x20资源链接(https://...)','repeat','\x20输入项目的\x20CSS\x20资源链接(https://...)','3349910zifvwQ','439156EThQDk','path','*\x20正在创建菜单...','add','creating','cyan','test','[\x20]'];a10_0x420c=function(){return _0x5db266;};return a10_0x420c();}function a10_0x3dc7(_0x9d4ee7,_0x261a2d){_0x9d4ee7=_0x9d4ee7-0xb6;const _0x420cda=a10_0x420c();let _0x3dc74f=_0x420cda[_0x9d4ee7];return _0x3dc74f;}export function AppMenuSyncUI(){const _0x2bf1cd=a10_0x3dc7,{exit:_0x3bf69e}=useApp(),{loading:_0x525f77,menuList:_0xab662a,error:_0x27055e}=useGetOnlineMenuList(),_0x4e83b0=getLocalPages(),_0x4b9333=_0xab662a['map'](_0x3e9410=>_0x3e9410[_0x2bf1cd(0xc1)]),_0x2234b5=[_0x2bf1cd(0xce),..._0x4e83b0[_0x2bf1cd(0xc8)](_0x1a712a=>_0x1a712a[_0x2bf1cd(0xe6)])],_0x52c8c1=getStringWidth(getMaxWidth(_0x2234b5,0x4)),_0x424eb9=getStringWidth(getMaxWidth([_0x2bf1cd(0xce)])),[_0x43018f,_0x1d448c]=useState(_0x2bf1cd(0xd1)),[_0x1c8fcf,_0x24d318]=useState(new Set()),[_0xb5ad0e,_0x1b6521]=useState(0x0),[_0x2bbfcf,_0x19d983]=useState(''),[_0x53f877,_0xd5fc82]=useState(''),[_0x5adc56,_0x2908de]=useState(''),[_0x31de1e,_0x3891d9]=useState(''),[_0x27ceb6,_0x4bbf17]=useState([]),_0xfe934f=_0x4e83b0['map'](_0x13acde=>({'label':_0x13acde[_0x2bf1cd(0xe6)],'path':_0x13acde[_0x2bf1cd(0xc1)],'local':!![],'online':_0x4b9333['includes'](_0x13acde[_0x2bf1cd(0xc1)])})),_0x4ce02c=_0x4e83b0[_0x2bf1cd(0xea)](_0x21f04c=>{const _0x3e42ab=_0x2bf1cd;return!_0x4b9333[_0x3e42ab(0xdf)](_0x21f04c[_0x3e42ab(0xc1)]);});useEffect(()=>{const _0x4cf472=_0x2bf1cd;if(!_0x525f77&&_0x4e83b0[_0x4cf472(0xdb)]>0x0&&_0x1c8fcf[_0x4cf472(0xca)]===0x0){const _0x3b4d40=new Set(_0x4e83b0['map']((_0x36bfdb,_0x5dfef9)=>({'page':_0x36bfdb,'index':_0x5dfef9}))[_0x4cf472(0xea)](({page:_0x4e3a34})=>!_0x4b9333[_0x4cf472(0xdf)](_0x4e3a34['path']))['map'](({index:_0x56be9b})=>_0x56be9b));_0x24d318(_0x3b4d40);}},[_0x525f77,_0x4e83b0[_0x2bf1cd(0xdb)],_0x4b9333[_0x2bf1cd(0xdb)]]),useInput(async(_0x407c53,_0x22fd31)=>{const _0x1f7f8c=_0x2bf1cd;if(_0x43018f===_0x1f7f8c(0xd1)){if(_0x22fd31['upArrow']){_0x1b6521(_0x49252c=>_0x49252c>0x0?_0x49252c-0x1:_0x4e83b0[_0x1f7f8c(0xdb)]-0x1);return;}if(_0x22fd31[_0x1f7f8c(0xf0)]){_0x1b6521(_0x1d7dbd=>_0x1d7dbd<_0x4e83b0[_0x1f7f8c(0xdb)]-0x1?_0x1d7dbd+0x1:0x0);return;}if(_0x407c53==='\x20'){_0x24d318(_0x247cd0=>{const _0x44a373=_0x1f7f8c,_0x149974=new Set(_0x247cd0);return _0x149974['has'](_0xb5ad0e)?_0x149974[_0x44a373(0xcd)](_0xb5ad0e):_0x149974[_0x44a373(0xc3)](_0xb5ad0e),_0x149974;});return;}if(_0x407c53==='a'||_0x407c53==='A'){const _0xc02363=new Set(_0x4e83b0[_0x1f7f8c(0xc8)]((_0x5d89ed,_0x552e6d)=>_0x552e6d));_0x24d318(_0xc02363);return;}if(_0x407c53==='i'||_0x407c53==='I'||_0x407c53==='r'||_0x407c53==='R'){_0x24d318(_0x3e520d=>{const _0x5ab77f=_0x1f7f8c,_0x10fa1a=new Set();for(let _0x1330ee=0x0;_0x1330ee<_0x4e83b0[_0x5ab77f(0xdb)];_0x1330ee++){!_0x3e520d[_0x5ab77f(0xcf)](_0x1330ee)&&_0x10fa1a[_0x5ab77f(0xc3)](_0x1330ee);}return _0x10fa1a;});return;}if(_0x407c53==='q'||_0x407c53==='Q'){_0x3bf69e();return;}if(_0x22fd31[_0x1f7f8c(0xde)]){if(_0x1c8fcf[_0x1f7f8c(0xca)]===0x0){_0x3891d9('请至少选择一个菜单');return;}const _0x512cf0=_0x4e83b0['filter']((_0x25f75e,_0x2d0221)=>_0x1c8fcf[_0x1f7f8c(0xcf)](_0x2d0221)),_0x441ef8=_0x512cf0[_0x1f7f8c(0xc8)](_0x461c7b=>_0x461c7b['label'])[_0x1f7f8c(0xd7)](',\x20');_0x4bbf17([{'label':_0x1f7f8c(0xba),'value':_0x1c8fcf[_0x1f7f8c(0xca)]+'\x20个'}]),_0x3891d9(''),_0x1d448c(_0x1f7f8c(0xd2));return;}return;}if(_0x43018f==='input-js'){if(_0x22fd31[_0x1f7f8c(0xde)]){const _0x517292=_0x5adc56[_0x1f7f8c(0xe7)]();if(_0x517292==='')return;if(!isValidJsHttpsUrl(_0x517292)){_0x3891d9('请输入有效的\x20JS\x20https\x20链接');return;}if(!await isUrlReachable(_0x517292)){_0x3891d9(_0x1f7f8c(0xc9));return;}_0x19d983(_0x517292),_0x4bbf17(_0x485951=>[..._0x485951,{'label':'JS\x20链接','value':_0x517292}]),_0x2908de(''),_0x3891d9(''),_0x1d448c(_0x1f7f8c(0xe9));return;}if(_0x22fd31[_0x1f7f8c(0xd3)]||_0x22fd31[_0x1f7f8c(0xcd)]){_0x2908de(_0x400180=>_0x400180['slice'](0x0,-0x1)),_0x3891d9('');return;}_0x2908de(_0x4b593c=>_0x4b593c+_0x407c53);return;}if(_0x43018f===_0x1f7f8c(0xe9)){if(_0x22fd31[_0x1f7f8c(0xde)]){const _0x3b6e0f=_0x5adc56['trim']();if(_0x3b6e0f==='')return;if(!isValidCssHttpsUrl(_0x3b6e0f)){_0x3891d9('请输入有效的\x20CSS\x20https\x20链接');return;}if(!await isUrlReachable(_0x3b6e0f)){_0x3891d9(_0x1f7f8c(0xb9));return;}_0xd5fc82(_0x3b6e0f),_0x4bbf17(_0x12db8c=>[..._0x12db8c,{'label':_0x1f7f8c(0xec),'value':_0x3b6e0f}]),_0x2908de(''),_0x3891d9(''),_0x1d448c(_0x1f7f8c(0xc4));const _0x133269=_0x4e83b0[_0x1f7f8c(0xea)]((_0x2cf11d,_0x2033a5)=>_0x1c8fcf[_0x1f7f8c(0xcf)](_0x2033a5));createMenus(_0x133269,[_0x2bbfcf,_0x3b6e0f])['then'](()=>{const _0x454148=_0x1f7f8c;_0x1d448c(_0x454148(0xd5)),setTimeout(()=>{_0x3bf69e();},0x3e8);})[_0x1f7f8c(0xb8)](_0x495d91=>{const _0x32fafe=_0x1f7f8c;_0x3891d9(_0x495d91[_0x32fafe(0xcc)]||_0x32fafe(0xeb)),_0x1d448c(_0x32fafe(0xd1));});return;}if(_0x22fd31['backspace']||_0x22fd31[_0x1f7f8c(0xcd)]){_0x2908de(_0x17510f=>_0x17510f[_0x1f7f8c(0xdc)](0x0,-0x1)),_0x3891d9('');return;}_0x2908de(_0x4b99be=>_0x4b99be+_0x407c53);return;}});if(_0x525f77)return a10_0x59cfe5(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x1a39d0(Text,{'children':'\x20\x20'}),a10_0x1a39d0(a10_0x4dd96a,{'type':'dots'}),a10_0x1a39d0(Text,{'children':_0x2bf1cd(0xd4)})]});if(_0x27055e)return a10_0x59cfe5(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a10_0x59cfe5(Text,{'color':'red','children':['✗\x20',_0x27055e]}),a10_0x59cfe5(Box,{'marginTop':0x1,'children':[a10_0x1a39d0(Text,{'color':_0x2bf1cd(0xb6),'children':'提示:使用\x20'}),a10_0x1a39d0(Text,{'color':_0x2bf1cd(0xc5),'children':'lovrabet\x20auth'}),a10_0x1a39d0(Text,{'color':_0x2bf1cd(0xb6),'children':_0x2bf1cd(0xcb)})]})]});if(_0x4e83b0[_0x2bf1cd(0xdb)]===0x0)return a10_0x1a39d0(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x1a39d0(Text,{'color':_0x2bf1cd(0xe3),'children':_0x2bf1cd(0xd8)})});return a10_0x59cfe5(Box,{'flexDirection':_0x2bf1cd(0xf1),'marginTop':0x1,'marginBottom':0x1,'children':[_0x43018f===_0x2bf1cd(0xd1)&&a10_0x59cfe5(a10_0x3d321e,{'children':[a10_0x59cfe5(Box,{'children':[a10_0x59cfe5(Text,{'bold':!![],'children':['\x20\x20','菜单名称',getRemainingSpaces(_0x52c8c1,_0x2bf1cd(0xce))]}),a10_0x59cfe5(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x424eb9,_0x2bf1cd(0xce))]}),a10_0x59cfe5(Text,{'bold':!![],'children':[_0x2bf1cd(0xe0),getRemainingSpaces(_0x424eb9,_0x2bf1cd(0xce))]})]}),_0xfe934f[_0x2bf1cd(0xc8)](_0x26ba0c=>a10_0x59cfe5(Box,{'children':[a10_0x59cfe5(Text,{'children':['\x20\x20',_0x26ba0c[_0x2bf1cd(0xe6)],getRemainingSpaces(_0x52c8c1,_0x26ba0c[_0x2bf1cd(0xe6)])]}),a10_0x59cfe5(Text,{'color':'green','children':[_0x26ba0c[_0x2bf1cd(0xd9)]?'✓':'✗',getRemainingSpaces(_0x424eb9,'✓')]}),a10_0x59cfe5(Text,{'color':_0x26ba0c[_0x2bf1cd(0xed)]?_0x2bf1cd(0xe2):_0x2bf1cd(0xda),'children':[_0x26ba0c['online']?'✓':'✗',getRemainingSpaces(_0x424eb9,'✓')]})]},_0x26ba0c[_0x2bf1cd(0xc1)]))]}),_0x43018f===_0x2bf1cd(0xd1)&&_0x27ceb6[_0x2bf1cd(0xdb)]===0x0&&a10_0x1a39d0(Box,{'marginTop':0x1,'children':a10_0x1a39d0(Text,{'color':_0x2bf1cd(0xc5),'children':_0x2bf1cd(0xf7)})}),_0x27ceb6[_0x2bf1cd(0xc8)]((_0x3abf96,_0x4584d2)=>a10_0x59cfe5(Box,{'children':[a10_0x59cfe5(Text,{'color':_0x2bf1cd(0xe2),'children':['√\x20',_0x3abf96[_0x2bf1cd(0xe6)],':\x20']}),a10_0x1a39d0(Text,{'color':_0x2bf1cd(0xc5),'children':_0x3abf96['value']})]},_0x4584d2)),_0x31de1e&&_0x43018f===_0x2bf1cd(0xd1)&&a10_0x1a39d0(Box,{'marginTop':0x1,'children':a10_0x59cfe5(Text,{'color':'red','children':['✗\x20',_0x31de1e]})}),_0x43018f===_0x2bf1cd(0xd1)&&a10_0x1a39d0(a10_0x3d321e,{'children':a10_0x59cfe5(Box,{'marginTop':_0x27ceb6[_0x2bf1cd(0xdb)]>0x0||_0x31de1e?0x1:0x0,'flexDirection':_0x2bf1cd(0xf1),'children':[a10_0x1a39d0(Text,{'bold':!![],'children':_0x2bf1cd(0xdd)}),_0x4e83b0[_0x2bf1cd(0xc8)]((_0x2f8d32,_0x1b5f43)=>{const _0x24762d=_0x2bf1cd,_0x58ab2d=_0xb5ad0e===_0x1b5f43,_0x4f43d4=_0x1c8fcf[_0x24762d(0xcf)](_0x1b5f43),_0x19ba96=_0x4b9333[_0x24762d(0xdf)](_0x2f8d32[_0x24762d(0xc1)]),_0x2bcd35=_0x19ba96?'更新':'新建';return a10_0x1a39d0(Box,{'children':a10_0x59cfe5(Text,{'backgroundColor':_0x58ab2d?_0x24762d(0xb7):undefined,'color':_0x58ab2d?_0x24762d(0xd0):undefined,'children':['\x20\x20',_0x4f43d4?_0x24762d(0xbb):_0x24762d(0xc7),'\x20',_0x2f8d32['label']]})},_0x2f8d32['path']);}),a10_0x1a39d0(Box,{'marginTop':0x1,'children':a10_0x59cfe5(Text,{'color':_0x2bf1cd(0xb6),'children':['\x20',_0x2bf1cd(0xe4)]})})]})}),_0x43018f===_0x2bf1cd(0xd2)&&a10_0x59cfe5(a10_0x3d321e,{'children':[a10_0x59cfe5(Box,{'children':[a10_0x1a39d0(Text,{'children':_0x2bf1cd(0xf5)}),a10_0x1a39d0(Text,{'color':_0x2bf1cd(0xe2),'children':_0x5adc56}),_0x31de1e&&a10_0x59cfe5(Text,{'color':'red','children':[_0x2bf1cd(0xe5),_0x31de1e]})]}),!_0x31de1e&&a10_0x1a39d0(Box,{'children':a10_0x1a39d0(Text,{'color':_0x2bf1cd(0xb6),'children':_0x2bf1cd(0xbc)})})]}),_0x43018f===_0x2bf1cd(0xe9)&&a10_0x59cfe5(a10_0x3d321e,{'children':[a10_0x59cfe5(Box,{'children':[a10_0x1a39d0(Text,{'children':_0x2bf1cd(0xf4)}),a10_0x1a39d0(Text,{'color':_0x2bf1cd(0xe2),'children':_0x5adc56}),_0x31de1e&&a10_0x59cfe5(Text,{'color':_0x2bf1cd(0xda),'children':[_0x2bf1cd(0xe5),_0x31de1e]})]}),!_0x31de1e&&a10_0x1a39d0(Box,{'children':a10_0x1a39d0(Text,{'color':'gray','children':_0x2bf1cd(0xbe)})})]}),_0x43018f==='creating'&&a10_0x1a39d0(Box,{'children':a10_0x1a39d0(Text,{'children':_0x2bf1cd(0xc2)})}),_0x43018f==='done'&&a10_0x1a39d0(Box,{'children':a10_0x1a39d0(Text,{'color':'green','children':_0x2bf1cd(0xf8)})})]});}function getStringWidth(_0x5143fb){const _0x4df681=a10_0x3dc7;let _0x1d0775=0x0;for(const _0x40f342 of _0x5143fb){/[\u4e00-\u9fa5]/[_0x4df681(0xc6)](_0x40f342)?_0x1d0775+=0x2:_0x1d0775+=0x1;}return _0x1d0775;}function getRemainingSpaces(_0x11c9a3,_0x10c7a2){const _0x10fd8b=a10_0x3dc7,_0x3e2b42=getStringWidth(_0x10c7a2);return Array(Math['max'](0x0,_0x11c9a3-_0x3e2b42))['fill']('\x20')[_0x10fd8b(0xd7)]('');}function getMaxWidth(_0x15e702,_0x5f0709=0x2){const _0x83a6c=a10_0x3dc7;let _0x593168='',_0x3c601c=0x0;for(const _0x562c7d of _0x15e702){const _0x34deea=getStringWidth(_0x562c7d);_0x34deea>_0x3c601c&&(_0x3c601c=_0x34deea,_0x593168=_0x562c7d);}return _0x593168+'\x20'[_0x83a6c(0xbd)](_0x5f0709);}
1
+ function a12_0x2e64(){const _0x26d99e=['add','creating','test','!\x20未找到本地页面,请先创建页面','then','upArrow','backspace','[✓]','path','label','[\x20]','lovrabet\x20auth','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','local','134601CVCLKg','has','filter','2666532NPRwJJ','blue','green','gray','请至少选择一个菜单','join','online','length','提示:使用\x20','创建菜单失败','5DjAVqz','downArrow','1929636baCoNO','JS\x20链接无法访问','white','map','3774400oYqtRH','dots','已选择菜单','*\x20同步菜单到\x20Lovrabet\x20平台','column','selecting','catch','7602039UcQBsc','slice','\x20←\x20','11116lgxbDS','cyan','fill','\x20输入项目的\x20JS\x20资源链接(https://...)','菜单名称','*\x20正在创建菜单...','input-css','132vwVZMb','delete','max','red','CSS\x20链接无法访问','return','请输入有效的\x20CSS\x20https\x20链接','3943192vcKTOY','input-js','includes','message','size','done','\x20正在获取线上菜单列表...','√\x20菜单创建完成','trim','请输入有效的\x20JS\x20https\x20链接'];a12_0x2e64=function(){return _0x26d99e;};return a12_0x2e64();}(function(_0x167b79,_0x40e10e){const _0x2d2560=a12_0x5986,_0x28c8f3=_0x167b79();while(!![]){try{const _0x481a01=parseInt(_0x2d2560(0x12f))/0x1+-parseInt(_0x2d2560(0x109))/0x2*(parseInt(_0x2d2560(0x110))/0x3)+parseInt(_0x2d2560(0x132))/0x4*(-parseInt(_0x2d2560(0x13c))/0x5)+parseInt(_0x2d2560(0x13e))/0x6+parseInt(_0x2d2560(0xff))/0x7+-parseInt(_0x2d2560(0x117))/0x8+parseInt(_0x2d2560(0x106))/0x9;if(_0x481a01===_0x40e10e)break;else _0x28c8f3['push'](_0x28c8f3['shift']());}catch(_0x4d6256){_0x28c8f3['push'](_0x28c8f3['shift']());}}}(a12_0x2e64,0x6a71a));import{jsx as a12_0x56e86a,jsxs as a12_0x6b84ed,Fragment as a12_0x20e1c4}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a12_0x29aca0 from'ink-spinner';import{useGetOnlineMenuList}from'./use-get-online-menu-list.js';import{getLocalPages}from'./get-local-pages.js';import{createMenus}from'./create-menu.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';function a12_0x5986(_0x3d0c83,_0x551ae9){_0x3d0c83=_0x3d0c83-0xff;const _0x2e6466=a12_0x2e64();let _0x59861e=_0x2e6466[_0x3d0c83];return _0x59861e;}import.meta.main&&render(a12_0x56e86a(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x30df88=a12_0x5986,{exit:_0x56b365}=useApp(),{loading:_0x20db93,menuList:_0x40aeae,error:_0x55ba5f}=useGetOnlineMenuList(),_0xca285d=getLocalPages(),_0x3fb5c0=_0x40aeae[_0x30df88(0x141)](_0x360736=>_0x360736[_0x30df88(0x129)]),_0xb4af8c=[_0x30df88(0x10d),..._0xca285d[_0x30df88(0x141)](_0x405109=>_0x405109['label'])],_0x2e8800=getStringWidth(getMaxWidth(_0xb4af8c,0x4)),_0x5716d1=getStringWidth(getMaxWidth(['菜单名称'])),[_0x26adb8,_0x28a573]=useState(_0x30df88(0x104)),[_0x433ba0,_0x1b1c9b]=useState(new Set()),[_0xac0b8e,_0x37c76e]=useState(0x0),[_0x2357b4,_0x6ba149]=useState(''),[_0x43d195,_0x151282]=useState(''),[_0x557ea4,_0x992b50]=useState(''),[_0x7d5a29,_0x5df2d0]=useState(''),[_0x10c1e7,_0x174934]=useState([]),_0x334809=_0xca285d[_0x30df88(0x141)](_0x1da65b=>({'label':_0x1da65b[_0x30df88(0x12a)],'path':_0x1da65b['path'],'local':!![],'online':_0x3fb5c0['includes'](_0x1da65b[_0x30df88(0x129)])})),_0x8c7a67=_0xca285d[_0x30df88(0x131)](_0x342f7c=>{const _0xdd929c=_0x30df88;return!_0x3fb5c0[_0xdd929c(0x119)](_0x342f7c[_0xdd929c(0x129)]);});useEffect(()=>{const _0x56dd3c=_0x30df88;if(!_0x20db93&&_0xca285d[_0x56dd3c(0x139)]>0x0&&_0x433ba0['size']===0x0){const _0x464706=new Set(_0xca285d[_0x56dd3c(0x141)]((_0x18461d,_0x8b9d7)=>({'page':_0x18461d,'index':_0x8b9d7}))[_0x56dd3c(0x131)](({page:_0x4a8a50})=>!_0x3fb5c0[_0x56dd3c(0x119)](_0x4a8a50[_0x56dd3c(0x129)]))[_0x56dd3c(0x141)](({index:_0x379ed0})=>_0x379ed0));_0x1b1c9b(_0x464706);}},[_0x20db93,_0xca285d['length'],_0x3fb5c0[_0x30df88(0x139)]]),useInput(async(_0x40203d,_0x4de596)=>{const _0x15f13f=_0x30df88;if(_0x26adb8===_0x15f13f(0x104)){if(_0x4de596[_0x15f13f(0x126)]){_0x37c76e(_0x257dd0=>_0x257dd0>0x0?_0x257dd0-0x1:_0xca285d[_0x15f13f(0x139)]-0x1);return;}if(_0x4de596[_0x15f13f(0x13d)]){_0x37c76e(_0x503312=>_0x503312<_0xca285d[_0x15f13f(0x139)]-0x1?_0x503312+0x1:0x0);return;}if(_0x40203d==='\x20'){_0x1b1c9b(_0x56fb09=>{const _0x230972=_0x15f13f,_0x3b846a=new Set(_0x56fb09);return _0x3b846a[_0x230972(0x130)](_0xac0b8e)?_0x3b846a['delete'](_0xac0b8e):_0x3b846a[_0x230972(0x121)](_0xac0b8e),_0x3b846a;});return;}if(_0x40203d==='a'||_0x40203d==='A'){const _0x2d7aa5=new Set(_0xca285d[_0x15f13f(0x141)]((_0x4ec3ee,_0x2b9e11)=>_0x2b9e11));_0x1b1c9b(_0x2d7aa5);return;}if(_0x40203d==='i'||_0x40203d==='I'||_0x40203d==='r'||_0x40203d==='R'){_0x1b1c9b(_0x417a51=>{const _0x179aed=_0x15f13f,_0x282fb5=new Set();for(let _0x498bba=0x0;_0x498bba<_0xca285d[_0x179aed(0x139)];_0x498bba++){!_0x417a51[_0x179aed(0x130)](_0x498bba)&&_0x282fb5[_0x179aed(0x121)](_0x498bba);}return _0x282fb5;});return;}if(_0x40203d==='q'||_0x40203d==='Q'){_0x56b365();return;}if(_0x4de596[_0x15f13f(0x115)]){if(_0x433ba0[_0x15f13f(0x11b)]===0x0){_0x5df2d0(_0x15f13f(0x136));return;}const _0x58f8ec=_0xca285d[_0x15f13f(0x131)]((_0x1f9ca4,_0xf78611)=>_0x433ba0[_0x15f13f(0x130)](_0xf78611)),_0x11b8a0=_0x58f8ec['map'](_0x486658=>_0x486658[_0x15f13f(0x12a)])[_0x15f13f(0x137)](',\x20');_0x174934([{'label':_0x15f13f(0x101),'value':_0x433ba0[_0x15f13f(0x11b)]+'\x20个'}]),_0x5df2d0(''),_0x28a573(_0x15f13f(0x118));return;}return;}if(_0x26adb8===_0x15f13f(0x118)){if(_0x4de596['return']){const _0x32dd3d=_0x557ea4[_0x15f13f(0x11f)]();if(_0x32dd3d==='')return;if(!isValidJsHttpsUrl(_0x32dd3d)){_0x5df2d0(_0x15f13f(0x120));return;}if(!await isUrlReachable(_0x32dd3d)){_0x5df2d0(_0x15f13f(0x13f));return;}_0x6ba149(_0x32dd3d),_0x174934(_0x45d5d0=>[..._0x45d5d0,{'label':'JS\x20链接','value':_0x32dd3d}]),_0x992b50(''),_0x5df2d0(''),_0x28a573(_0x15f13f(0x10f));return;}if(_0x4de596[_0x15f13f(0x127)]||_0x4de596[_0x15f13f(0x111)]){_0x992b50(_0x3b65ff=>_0x3b65ff[_0x15f13f(0x107)](0x0,-0x1)),_0x5df2d0('');return;}_0x992b50(_0x5d614a=>_0x5d614a+_0x40203d);return;}if(_0x26adb8===_0x15f13f(0x10f)){if(_0x4de596[_0x15f13f(0x115)]){const _0x4a34a3=_0x557ea4[_0x15f13f(0x11f)]();if(_0x4a34a3==='')return;if(!isValidCssHttpsUrl(_0x4a34a3)){_0x5df2d0(_0x15f13f(0x116));return;}if(!await isUrlReachable(_0x4a34a3)){_0x5df2d0(_0x15f13f(0x114));return;}_0x151282(_0x4a34a3),_0x174934(_0x4a7963=>[..._0x4a7963,{'label':'CSS\x20链接','value':_0x4a34a3}]),_0x992b50(''),_0x5df2d0(''),_0x28a573('creating');const _0x27a501=_0xca285d[_0x15f13f(0x131)]((_0x328330,_0x55369d)=>_0x433ba0[_0x15f13f(0x130)](_0x55369d));createMenus(_0x27a501,[_0x2357b4,_0x4a34a3])[_0x15f13f(0x125)](()=>{const _0x5c3c69=_0x15f13f;_0x28a573(_0x5c3c69(0x11c)),setTimeout(()=>{_0x56b365();},0x3e8);})[_0x15f13f(0x105)](_0x5b21bd=>{const _0x599059=_0x15f13f;_0x5df2d0(_0x5b21bd[_0x599059(0x11a)]||_0x599059(0x13b)),_0x28a573('selecting');});return;}if(_0x4de596[_0x15f13f(0x127)]||_0x4de596[_0x15f13f(0x111)]){_0x992b50(_0x278f48=>_0x278f48[_0x15f13f(0x107)](0x0,-0x1)),_0x5df2d0('');return;}_0x992b50(_0x251b3a=>_0x251b3a+_0x40203d);return;}});if(_0x20db93)return a12_0x6b84ed(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a12_0x56e86a(Text,{'children':'\x20\x20'}),a12_0x56e86a(a12_0x29aca0,{'type':_0x30df88(0x100)}),a12_0x56e86a(Text,{'children':_0x30df88(0x11d)})]});if(_0x55ba5f)return a12_0x6b84ed(Box,{'flexDirection':_0x30df88(0x103),'marginTop':0x1,'marginBottom':0x1,'children':[a12_0x6b84ed(Text,{'color':_0x30df88(0x113),'children':['✗\x20',_0x55ba5f]}),a12_0x6b84ed(Box,{'marginTop':0x1,'children':[a12_0x56e86a(Text,{'color':_0x30df88(0x135),'children':_0x30df88(0x13a)}),a12_0x56e86a(Text,{'color':'cyan','children':_0x30df88(0x12c)}),a12_0x56e86a(Text,{'color':_0x30df88(0x135),'children':'\x20命令重新登录'})]})]});if(_0xca285d['length']===0x0)return a12_0x56e86a(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a12_0x56e86a(Text,{'color':'yellow','children':_0x30df88(0x124)})});return a12_0x6b84ed(Box,{'flexDirection':_0x30df88(0x103),'marginTop':0x1,'marginBottom':0x1,'children':[_0x26adb8==='selecting'&&a12_0x6b84ed(a12_0x20e1c4,{'children':[a12_0x6b84ed(Box,{'children':[a12_0x6b84ed(Text,{'bold':!![],'children':['\x20\x20',_0x30df88(0x10d),getRemainingSpaces(_0x2e8800,_0x30df88(0x10d))]}),a12_0x6b84ed(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x5716d1,_0x30df88(0x10d))]}),a12_0x6b84ed(Text,{'bold':!![],'children':['Lovrabet平台',getRemainingSpaces(_0x5716d1,_0x30df88(0x10d))]})]}),_0x334809['map'](_0x453b44=>a12_0x6b84ed(Box,{'children':[a12_0x6b84ed(Text,{'children':['\x20\x20',_0x453b44[_0x30df88(0x12a)],getRemainingSpaces(_0x2e8800,_0x453b44['label'])]}),a12_0x6b84ed(Text,{'color':_0x30df88(0x134),'children':[_0x453b44[_0x30df88(0x12e)]?'✓':'✗',getRemainingSpaces(_0x5716d1,'✓')]}),a12_0x6b84ed(Text,{'color':_0x453b44['online']?_0x30df88(0x134):_0x30df88(0x113),'children':[_0x453b44[_0x30df88(0x138)]?'✓':'✗',getRemainingSpaces(_0x5716d1,'✓')]})]},_0x453b44[_0x30df88(0x129)]))]}),_0x26adb8===_0x30df88(0x104)&&_0x10c1e7[_0x30df88(0x139)]===0x0&&a12_0x56e86a(Box,{'marginTop':0x1,'children':a12_0x56e86a(Text,{'color':'cyan','children':_0x30df88(0x102)})}),_0x10c1e7['map']((_0x3030bb,_0x36b485)=>a12_0x6b84ed(Box,{'children':[a12_0x6b84ed(Text,{'color':_0x30df88(0x134),'children':['√\x20',_0x3030bb[_0x30df88(0x12a)],':\x20']}),a12_0x56e86a(Text,{'color':_0x30df88(0x10a),'children':_0x3030bb['value']})]},_0x36b485)),_0x7d5a29&&_0x26adb8==='selecting'&&a12_0x56e86a(Box,{'marginTop':0x1,'children':a12_0x6b84ed(Text,{'color':_0x30df88(0x113),'children':['✗\x20',_0x7d5a29]})}),_0x26adb8===_0x30df88(0x104)&&a12_0x56e86a(a12_0x20e1c4,{'children':a12_0x6b84ed(Box,{'marginTop':_0x10c1e7['length']>0x0||_0x7d5a29?0x1:0x0,'flexDirection':_0x30df88(0x103),'children':[a12_0x56e86a(Text,{'bold':!![],'children':'*\x20请选择要同步的菜单:'}),_0xca285d[_0x30df88(0x141)]((_0x4c7b18,_0x3329fb)=>{const _0x4d72ad=_0x30df88,_0x9d4be1=_0xac0b8e===_0x3329fb,_0x42971f=_0x433ba0['has'](_0x3329fb),_0xf15141=_0x3fb5c0[_0x4d72ad(0x119)](_0x4c7b18[_0x4d72ad(0x129)]),_0x280740=_0xf15141?'更新':'新建';return a12_0x56e86a(Box,{'children':a12_0x6b84ed(Text,{'backgroundColor':_0x9d4be1?_0x4d72ad(0x133):undefined,'color':_0x9d4be1?_0x4d72ad(0x140):undefined,'children':['\x20\x20',_0x42971f?_0x4d72ad(0x128):_0x4d72ad(0x12b),'\x20',_0x4c7b18[_0x4d72ad(0x12a)]]})},_0x4c7b18[_0x4d72ad(0x129)]);}),a12_0x56e86a(Box,{'marginTop':0x1,'children':a12_0x6b84ed(Text,{'color':_0x30df88(0x135),'children':['\x20',_0x30df88(0x12d)]})})]})}),_0x26adb8===_0x30df88(0x118)&&a12_0x6b84ed(a12_0x20e1c4,{'children':[a12_0x6b84ed(Box,{'children':[a12_0x56e86a(Text,{'children':'*\x20JS\x20链接:\x20'}),a12_0x56e86a(Text,{'color':_0x30df88(0x134),'children':_0x557ea4}),_0x7d5a29&&a12_0x6b84ed(Text,{'color':_0x30df88(0x113),'children':[_0x30df88(0x108),_0x7d5a29]})]}),!_0x7d5a29&&a12_0x56e86a(Box,{'children':a12_0x56e86a(Text,{'color':_0x30df88(0x135),'children':_0x30df88(0x10c)})})]}),_0x26adb8===_0x30df88(0x10f)&&a12_0x6b84ed(a12_0x20e1c4,{'children':[a12_0x6b84ed(Box,{'children':[a12_0x56e86a(Text,{'children':'*\x20CSS\x20链接:\x20'}),a12_0x56e86a(Text,{'color':_0x30df88(0x134),'children':_0x557ea4}),_0x7d5a29&&a12_0x6b84ed(Text,{'color':_0x30df88(0x113),'children':[_0x30df88(0x108),_0x7d5a29]})]}),!_0x7d5a29&&a12_0x56e86a(Box,{'children':a12_0x56e86a(Text,{'color':_0x30df88(0x135),'children':'\x20输入项目的\x20CSS\x20资源链接(https://...)'})})]}),_0x26adb8===_0x30df88(0x122)&&a12_0x56e86a(Box,{'children':a12_0x56e86a(Text,{'children':_0x30df88(0x10e)})}),_0x26adb8===_0x30df88(0x11c)&&a12_0x56e86a(Box,{'children':a12_0x56e86a(Text,{'color':_0x30df88(0x134),'children':_0x30df88(0x11e)})})]});}function getStringWidth(_0x806b67){const _0x21142a=a12_0x5986;let _0x1eaed9=0x0;for(const _0x3b83c2 of _0x806b67){/[\u4e00-\u9fa5]/[_0x21142a(0x123)](_0x3b83c2)?_0x1eaed9+=0x2:_0x1eaed9+=0x1;}return _0x1eaed9;}function getRemainingSpaces(_0x3c5d8d,_0x8e3d9a){const _0x2f96ab=a12_0x5986,_0x527c9a=getStringWidth(_0x8e3d9a);return Array(Math[_0x2f96ab(0x112)](0x0,_0x3c5d8d-_0x527c9a))[_0x2f96ab(0x10b)]('\x20')[_0x2f96ab(0x137)]('');}function getMaxWidth(_0x5af3b9,_0x162be6=0x2){let _0x78b71a='',_0x3b31a1=0x0;for(const _0x2ad441 of _0x5af3b9){const _0xe679c1=getStringWidth(_0x2ad441);_0xe679c1>_0x3b31a1&&(_0x3b31a1=_0xe679c1,_0x78b71a=_0x2ad441);}return _0x78b71a+'\x20'['repeat'](_0x162be6);}
@@ -1 +1 @@
1
- (function(_0x1cde40,_0x56f6c6){const _0x4b7c0e=a11_0x504e,_0x3a6998=_0x1cde40();while(!![]){try{const _0x20f048=parseInt(_0x4b7c0e(0x194))/0x1*(-parseInt(_0x4b7c0e(0x186))/0x2)+parseInt(_0x4b7c0e(0x178))/0x3*(-parseInt(_0x4b7c0e(0x197))/0x4)+-parseInt(_0x4b7c0e(0x19d))/0x5+parseInt(_0x4b7c0e(0x181))/0x6*(-parseInt(_0x4b7c0e(0x17b))/0x7)+-parseInt(_0x4b7c0e(0x170))/0x8*(-parseInt(_0x4b7c0e(0x18e))/0x9)+parseInt(_0x4b7c0e(0x193))/0xa+parseInt(_0x4b7c0e(0x175))/0xb;if(_0x20f048===_0x56f6c6)break;else _0x3a6998['push'](_0x3a6998['shift']());}catch(_0x10fa33){_0x3a6998['push'](_0x3a6998['shift']());}}}(a11_0x1bac,0xd5da7));function a11_0x1bac(){const _0x517e04=['status','length','创建菜单失败:\x20','import','json','map','error','1111626WUwInP','create-menus','path','application/json','stringify','8843110YOicuT','1695175jLzdYi','登录态校验失败,请使用\x20lovrabet\x20auth\x20重新登录','create-menu','2380MqKDcB','errorCode','菜单创建成功:\x20','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','log','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','4631135KLTaFy','0011','data','16RRDkHn','正在创建菜单:\x20','label','批量创建菜单完成,共\x20','includes','36070771xludSJ','all','errorMsg','2727vLSlaK','info','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','868700XgXHeL','resources','!\x20请使用以下方式之一:','appcode','未知错误','创建菜单失败,HTTP状态码:\x20','18MMJjBi','success','未提供应用AppCode,且配置中也没有默认值','/smartapi/menu/create','procode','2VdVPZU'];a11_0x1bac=function(){return _0x517e04;};return a11_0x1bac();}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';const config=readConfig();function a11_0x504e(_0x87927f,_0x4c64f3){_0x87927f=_0x87927f-0x170;const _0x1bac68=a11_0x1bac();let _0x504e31=_0x1bac68[_0x87927f];return _0x504e31;}export async function createMenu(_0x4dafe0){const _0x48f26c=a11_0x504e,_0x28de09=config?.[_0x48f26c(0x17e)];if(!_0x28de09){const _0x4ef02c=_0x48f26c(0x183);logger[_0x48f26c(0x18d)]('create-menu',_0x4ef02c),console[_0x48f26c(0x18d)]('×\x20'+_0x4ef02c),console[_0x48f26c(0x19b)](_0x48f26c(0x17d)),console[_0x48f26c(0x19b)]('\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>'),console[_0x48f26c(0x19b)](_0x48f26c(0x17a));return;}logger['info'](_0x48f26c(0x196),_0x48f26c(0x171)+_0x4dafe0[_0x48f26c(0x172)]+'\x20('+_0x4dafe0[_0x48f26c(0x190)]+')');const _0x1cf8ec={'appCode':_0x28de09,'type':'procode','sort':0x0,'extend':{'loadScriptMode':_0x48f26c(0x18a),'resources':_0x4dafe0[_0x48f26c(0x17c)]?JSON[_0x48f26c(0x192)](_0x4dafe0[_0x48f26c(0x17c)]):undefined},..._0x4dafe0},_0x34e3aa=await fetch(getApiDomain()+_0x48f26c(0x184),{'method':'POST','body':JSON['stringify'](_0x1cf8ec),'headers':{'Content-Type':_0x48f26c(0x191),'Cookie':getCookie()}});if(!_0x34e3aa['ok']){if(_0x34e3aa[_0x48f26c(0x187)]===0x191){const _0x3da837=_0x48f26c(0x19c);logger[_0x48f26c(0x18d)](_0x48f26c(0x196),_0x3da837,{'status':_0x34e3aa[_0x48f26c(0x187)],'menu':_0x4dafe0[_0x48f26c(0x172)]});throw new Error(_0x3da837);}const _0x4b5b65=_0x48f26c(0x180)+_0x34e3aa[_0x48f26c(0x187)];logger[_0x48f26c(0x18d)](_0x48f26c(0x196),_0x4b5b65,{'menu':_0x4dafe0[_0x48f26c(0x172)]});throw new Error(_0x4b5b65);}const _0x31f2a5=await _0x34e3aa['json']();if(!_0x31f2a5[_0x48f26c(0x182)]){const _0x435e95=_0x48f26c(0x189)+(_0x31f2a5['errorMsg']||'未知错误');logger['error']('create-menu',_0x435e95,{'errorCode':_0x31f2a5[_0x48f26c(0x198)],'errorMsg':_0x31f2a5['errorMsg'],'menu':_0x4dafe0[_0x48f26c(0x172)]});throw new Error(_0x435e95);}logger[_0x48f26c(0x179)]('create-menu',_0x48f26c(0x199)+_0x4dafe0['label'],_0x31f2a5[_0x48f26c(0x19f)]),console['log']('创建菜单成功:',_0x31f2a5[_0x48f26c(0x19f)]);}async function _createMenu(_0x2b8fa3,_0x58e9c0){const _0x56dd76=a11_0x504e,_0x46059d=config?.['appcode'];if(!_0x46059d){const _0x19e4b0=_0x56dd76(0x183);logger[_0x56dd76(0x18d)](_0x56dd76(0x196),_0x19e4b0),console[_0x56dd76(0x18d)]('×\x20'+_0x19e4b0),console['log'](_0x56dd76(0x17d)),console[_0x56dd76(0x19b)](_0x56dd76(0x19a)),console[_0x56dd76(0x19b)](_0x56dd76(0x17a));return;}const _0x31fb50={'appCode':_0x46059d,'type':_0x56dd76(0x185),'sort':0x0,'extend':{'loadScriptMode':_0x56dd76(0x18a),'resources':_0x58e9c0?JSON['stringify'](_0x58e9c0):undefined},'label':_0x2b8fa3[_0x56dd76(0x172)],'path':_0x2b8fa3[_0x56dd76(0x190)]},_0x4e5481=await fetch(getApiDomain()+'/smartapi/menu/create',{'method':'POST','body':JSON['stringify'](_0x31fb50),'headers':{'Content-Type':_0x56dd76(0x191),'Cookie':getCookie()}});if(!_0x4e5481['ok']){if(_0x4e5481[_0x56dd76(0x187)]===0x191){const _0x5d0008=_0x56dd76(0x19c);logger[_0x56dd76(0x18d)]('create-menu',_0x5d0008,{'status':_0x4e5481[_0x56dd76(0x187)],'menu':_0x2b8fa3[_0x56dd76(0x172)]});throw new Error(_0x5d0008);}const _0x168e37=_0x56dd76(0x180)+_0x4e5481[_0x56dd76(0x187)];logger[_0x56dd76(0x18d)](_0x56dd76(0x196),_0x168e37,{'menu':_0x2b8fa3[_0x56dd76(0x172)]});throw new Error(_0x168e37);}const _0x4dd174=await _0x4e5481[_0x56dd76(0x18b)]();if(!_0x4dd174['success']){if(_0x4dd174[_0x56dd76(0x198)]===_0x56dd76(0x19e)||_0x4dd174['errorMsg']?.[_0x56dd76(0x174)]('登录')){const _0x24a70d=_0x56dd76(0x195);logger[_0x56dd76(0x18d)](_0x56dd76(0x196),_0x24a70d,{'errorCode':_0x4dd174[_0x56dd76(0x198)],'errorMsg':_0x4dd174[_0x56dd76(0x177)],'menu':_0x2b8fa3['label']});throw new Error(_0x24a70d);}const _0x1bddb1=_0x56dd76(0x189)+(_0x4dd174[_0x56dd76(0x177)]||_0x56dd76(0x17f));logger['error'](_0x56dd76(0x196),_0x1bddb1,{'errorCode':_0x4dd174[_0x56dd76(0x198)],'errorMsg':_0x4dd174['errorMsg'],'menu':_0x2b8fa3[_0x56dd76(0x172)]});throw new Error(_0x1bddb1);}logger['info'](_0x56dd76(0x196),_0x56dd76(0x199)+_0x2b8fa3[_0x56dd76(0x172)]);}export async function createMenus(_0xdf2f1c,_0x5cd323){const _0x4e8cd1=a11_0x504e;logger['info'](_0x4e8cd1(0x18f),'开始批量创建菜单,共\x20'+_0xdf2f1c[_0x4e8cd1(0x188)]+'\x20个'),await Promise[_0x4e8cd1(0x176)](_0xdf2f1c[_0x4e8cd1(0x18c)](async _0x12a2d0=>{await _createMenu(_0x12a2d0,_0x5cd323);})),logger[_0x4e8cd1(0x179)](_0x4e8cd1(0x18f),_0x4e8cd1(0x173)+_0xdf2f1c['length']+'\x20个');}
1
+ (function(_0x2866b4,_0x54bfc1){const _0x59145d=a13_0x4fdd,_0x28e0c2=_0x2866b4();while(!![]){try{const _0xe775e5=parseInt(_0x59145d(0x1d6))/0x1*(-parseInt(_0x59145d(0x1d0))/0x2)+parseInt(_0x59145d(0x1de))/0x3*(-parseInt(_0x59145d(0x1cd))/0x4)+parseInt(_0x59145d(0x1da))/0x5*(parseInt(_0x59145d(0x1fa))/0x6)+-parseInt(_0x59145d(0x1cf))/0x7+-parseInt(_0x59145d(0x1d1))/0x8+-parseInt(_0x59145d(0x1e4))/0x9*(-parseInt(_0x59145d(0x1e7))/0xa)+parseInt(_0x59145d(0x1ef))/0xb*(parseInt(_0x59145d(0x1ec))/0xc);if(_0xe775e5===_0x54bfc1)break;else _0x28e0c2['push'](_0x28e0c2['shift']());}catch(_0x4bf335){_0x28e0c2['push'](_0x28e0c2['shift']());}}}(a13_0x4a8a,0xa16f0));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';function a13_0x4a8a(){const _0x7e057e=['1229olIvYq','resources','POST','0011','2831095wsVzHV','label','创建菜单失败:\x20','未提供应用AppCode,且配置中也没有默认值','206265FCYofS','appcode','path','正在创建菜单:\x20','create-menus','开始批量创建菜单,共\x20','9zZvgSD','stringify','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','3847750BygqEq','errorCode','/smartapi/menu/create','批量创建菜单完成,共\x20','application/json','9437484hvgobR','菜单创建成功:\x20','json','22xIKpOc','length','errorMsg','info','创建菜单成功:','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','status','data','includes','未知错误','procode','6kdRJgM','创建菜单失败,HTTP状态码:\x20','登录态校验失败,请使用\x20lovrabet\x20auth\x20重新登录','create-menu','60BIapxp','error','1576253Widkfu','964BHTDHS','110352XIDMyE','import','success','log','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录'];a13_0x4a8a=function(){return _0x7e057e;};return a13_0x4a8a();}import{logger}from'../utils/logger.js';const config=readConfig();export async function createMenu(_0x296b70){const _0x303a36=a13_0x4fdd,_0x493a14=config?.[_0x303a36(0x1df)];if(!_0x493a14){const _0x5aaecb=_0x303a36(0x1dd);logger[_0x303a36(0x1ce)]('create-menu',_0x5aaecb),console['error']('×\x20'+_0x5aaecb),console['log']('!\x20请使用以下方式之一:'),console[_0x303a36(0x1d4)](_0x303a36(0x1f4)),console[_0x303a36(0x1d4)](_0x303a36(0x1e6));return;}logger['info'](_0x303a36(0x1fd),_0x303a36(0x1e1)+_0x296b70['label']+'\x20('+_0x296b70['path']+')');const _0x15ed1a={'appCode':_0x493a14,'type':_0x303a36(0x1f9),'sort':0x0,'extend':{'loadScriptMode':_0x303a36(0x1d2),'resources':_0x296b70[_0x303a36(0x1d7)]?JSON[_0x303a36(0x1e5)](_0x296b70['resources']):undefined},..._0x296b70},_0x1c0657=await fetch(getApiDomain()+_0x303a36(0x1e9),{'method':_0x303a36(0x1d8),'body':JSON[_0x303a36(0x1e5)](_0x15ed1a),'headers':{'Content-Type':_0x303a36(0x1eb),'Cookie':getCookie()}});if(!_0x1c0657['ok']){if(_0x1c0657[_0x303a36(0x1f5)]===0x191){const _0x261928=_0x303a36(0x1d5);logger['error'](_0x303a36(0x1fd),_0x261928,{'status':_0x1c0657[_0x303a36(0x1f5)],'menu':_0x296b70['label']});throw new Error(_0x261928);}const _0x3fa627=_0x303a36(0x1fb)+_0x1c0657[_0x303a36(0x1f5)];logger[_0x303a36(0x1ce)](_0x303a36(0x1fd),_0x3fa627,{'menu':_0x296b70['label']});throw new Error(_0x3fa627);}const _0x3eaa06=await _0x1c0657[_0x303a36(0x1ee)]();if(!_0x3eaa06[_0x303a36(0x1d3)]){const _0x565386=_0x303a36(0x1dc)+(_0x3eaa06[_0x303a36(0x1f1)]||_0x303a36(0x1f8));logger['error'](_0x303a36(0x1fd),_0x565386,{'errorCode':_0x3eaa06[_0x303a36(0x1e8)],'errorMsg':_0x3eaa06[_0x303a36(0x1f1)],'menu':_0x296b70[_0x303a36(0x1db)]});throw new Error(_0x565386);}logger['info'](_0x303a36(0x1fd),_0x303a36(0x1ed)+_0x296b70[_0x303a36(0x1db)],_0x3eaa06[_0x303a36(0x1f6)]),console[_0x303a36(0x1d4)](_0x303a36(0x1f3),_0x3eaa06[_0x303a36(0x1f6)]);}function a13_0x4fdd(_0xceb194,_0x3b6322){_0xceb194=_0xceb194-0x1cd;const _0x4a8a9f=a13_0x4a8a();let _0x4fdd8f=_0x4a8a9f[_0xceb194];return _0x4fdd8f;}async function _createMenu(_0x476d71,_0xf9d959){const _0x2f8004=a13_0x4fdd,_0x5a118f=config?.[_0x2f8004(0x1df)];if(!_0x5a118f){const _0x5515be='未提供应用AppCode,且配置中也没有默认值';logger[_0x2f8004(0x1ce)](_0x2f8004(0x1fd),_0x5515be),console[_0x2f8004(0x1ce)]('×\x20'+_0x5515be),console[_0x2f8004(0x1d4)]('!\x20请使用以下方式之一:'),console[_0x2f8004(0x1d4)](_0x2f8004(0x1f4)),console[_0x2f8004(0x1d4)](_0x2f8004(0x1e6));return;}const _0x56c3c1={'appCode':_0x5a118f,'type':_0x2f8004(0x1f9),'sort':0x0,'extend':{'loadScriptMode':_0x2f8004(0x1d2),'resources':_0xf9d959?JSON['stringify'](_0xf9d959):undefined},'label':_0x476d71[_0x2f8004(0x1db)],'path':_0x476d71[_0x2f8004(0x1e0)]},_0x1ff262=await fetch(getApiDomain()+_0x2f8004(0x1e9),{'method':_0x2f8004(0x1d8),'body':JSON[_0x2f8004(0x1e5)](_0x56c3c1),'headers':{'Content-Type':'application/json','Cookie':getCookie()}});if(!_0x1ff262['ok']){if(_0x1ff262[_0x2f8004(0x1f5)]===0x191){const _0x4da04c=_0x2f8004(0x1d5);logger[_0x2f8004(0x1ce)](_0x2f8004(0x1fd),_0x4da04c,{'status':_0x1ff262['status'],'menu':_0x476d71[_0x2f8004(0x1db)]});throw new Error(_0x4da04c);}const _0x39f1fc=_0x2f8004(0x1fb)+_0x1ff262[_0x2f8004(0x1f5)];logger['error'](_0x2f8004(0x1fd),_0x39f1fc,{'menu':_0x476d71[_0x2f8004(0x1db)]});throw new Error(_0x39f1fc);}const _0x4ba60c=await _0x1ff262['json']();if(!_0x4ba60c[_0x2f8004(0x1d3)]){if(_0x4ba60c[_0x2f8004(0x1e8)]===_0x2f8004(0x1d9)||_0x4ba60c[_0x2f8004(0x1f1)]?.[_0x2f8004(0x1f7)]('登录')){const _0x36256a=_0x2f8004(0x1fc);logger[_0x2f8004(0x1ce)](_0x2f8004(0x1fd),_0x36256a,{'errorCode':_0x4ba60c[_0x2f8004(0x1e8)],'errorMsg':_0x4ba60c[_0x2f8004(0x1f1)],'menu':_0x476d71['label']});throw new Error(_0x36256a);}const _0x5de143='创建菜单失败:\x20'+(_0x4ba60c['errorMsg']||'未知错误');logger[_0x2f8004(0x1ce)](_0x2f8004(0x1fd),_0x5de143,{'errorCode':_0x4ba60c[_0x2f8004(0x1e8)],'errorMsg':_0x4ba60c['errorMsg'],'menu':_0x476d71[_0x2f8004(0x1db)]});throw new Error(_0x5de143);}logger[_0x2f8004(0x1f2)](_0x2f8004(0x1fd),_0x2f8004(0x1ed)+_0x476d71[_0x2f8004(0x1db)]);}export async function createMenus(_0x154462,_0x9547c8){const _0xfe9281=a13_0x4fdd;logger[_0xfe9281(0x1f2)](_0xfe9281(0x1e2),_0xfe9281(0x1e3)+_0x154462[_0xfe9281(0x1f0)]+'\x20个'),await Promise['all'](_0x154462['map'](async _0x2e30f1=>{await _createMenu(_0x2e30f1,_0x9547c8);})),logger['info'](_0xfe9281(0x1e2),_0xfe9281(0x1ea)+_0x154462['length']+'\x20个');}
@@ -1 +1 @@
1
- const a12_0x2339c5=a12_0x11f5;(function(_0x2df3bf,_0x1f7219){const _0xda48da=a12_0x11f5,_0x413199=_0x2df3bf();while(!![]){try{const _0x3b969f=-parseInt(_0xda48da(0x17b))/0x1+-parseInt(_0xda48da(0x177))/0x2+-parseInt(_0xda48da(0x17e))/0x3*(parseInt(_0xda48da(0x188))/0x4)+parseInt(_0xda48da(0x184))/0x5*(parseInt(_0xda48da(0x171))/0x6)+-parseInt(_0xda48da(0x176))/0x7*(-parseInt(_0xda48da(0x185))/0x8)+parseInt(_0xda48da(0x189))/0x9*(parseInt(_0xda48da(0x186))/0xa)+-parseInt(_0xda48da(0x179))/0xb*(-parseInt(_0xda48da(0x175))/0xc);if(_0x3b969f===_0x1f7219)break;else _0x413199['push'](_0x413199['shift']());}catch(_0x4d8219){_0x413199['push'](_0x413199['shift']());}}}(a12_0x4a9b,0xcca67));import{readdirSync,statSync,readFileSync}from'fs';import{join,relative,resolve}from'path';const pagesDir=resolve(process[a12_0x2339c5(0x18a)](),a12_0x2339c5(0x187));function a12_0x11f5(_0x39338c,_0x41bbdb){_0x39338c=_0x39338c-0x16e;const _0x4a9b80=a12_0x4a9b();let _0x11f55b=_0x4a9b80[_0x39338c];return _0x11f55b;}export function extractTitleFromComment(_0xa0b231){const _0x254bbc=a12_0x2339c5;try{const _0xd28c16=readFileSync(_0xa0b231,'utf-8'),_0xf41aa0=_0xd28c16[_0x254bbc(0x183)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0xf41aa0&&_0xf41aa0[0x1]){const _0x363f40=_0xf41aa0[0x1],_0x4146ac=_0x363f40[_0x254bbc(0x183)](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x4146ac&&_0x4146ac[0x1])return _0x4146ac[0x1][_0x254bbc(0x17d)]();}let _0x5b978b=null;const _0x3d2f14=_0xd28c16['match'](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x3d2f14&&_0x3d2f14[0x1]&&(_0x5b978b=_0x3d2f14[0x1]);if(!_0x5b978b){const _0x1e993f=_0xd28c16[_0x254bbc(0x183)](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x1e993f&&_0x1e993f[0x1]&&(_0x5b978b=_0x1e993f[0x1]);}if(_0x5b978b){const _0x1a8a04=new RegExp('\x5cb'+_0x5b978b+_0x254bbc(0x181)),_0x4f6995=_0xd28c16[_0x254bbc(0x183)](_0x1a8a04);if(_0x4f6995&&_0x4f6995[0x1])return _0x4f6995[0x1];return _0x5b978b;}return null;}catch(_0x28e353){return null;}}export function getLocalPages(_0x3ef59d=pagesDir,_0x47f0ad=pagesDir){const _0xd4f2e5=a12_0x2339c5;let _0x4abe4c=[];const _0x463370=readdirSync(_0x3ef59d);return _0x463370[_0xd4f2e5(0x172)](_0x5d346a=>{const _0x5a8061=_0xd4f2e5,_0xe4a570=join(_0x3ef59d,_0x5d346a),_0x2096d=statSync(_0xe4a570);if(_0x2096d&&_0x2096d[_0x5a8061(0x182)]())_0x4abe4c=_0x4abe4c[_0x5a8061(0x17f)](getLocalPages(_0xe4a570,_0x47f0ad));else{if(_0x5d346a[_0x5a8061(0x174)](_0x5a8061(0x170))){let _0x27c836=relative(_0x47f0ad,_0xe4a570);_0x27c836[_0x5a8061(0x174)](_0x5a8061(0x178))?_0x27c836=_0x27c836[_0x5a8061(0x180)](/index\.tsx$/,''):_0x27c836=_0x27c836['replace'](/\.tsx$/,'');_0x27c836[_0x5a8061(0x174)]('/')&&(_0x27c836=_0x27c836[_0x5a8061(0x173)](0x0,-0x1));const _0x102890=extractTitleFromComment(_0xe4a570),_0x2ef6ef=_0x102890||_0x27c836;_0x4abe4c[_0x5a8061(0x16f)]({'path':_0x27c836[_0x5a8061(0x17a)]('$',':'),'label':_0x2ef6ef});}}}),_0x4abe4c[_0xd4f2e5(0x17c)](_0xf7093a=>_0xf7093a[_0xd4f2e5(0x16e)]!=='');}function a12_0x4a9b(){const _0x46b09c=['endsWith','708TrviAP','6101816YEUiXq','2086876SfPsVC','index.tsx','268235YTbKjD','replaceAll','185518unVerh','filter','trim','729WWRfQQ','concat','replace','\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]','isDirectory','match','1242565MCJpRq','8CTAEmD','769690PKUGNw','src/pages','10628GTSoov','18fGSucP','cwd','path','push','.tsx','6YZSEaF','forEach','slice'];a12_0x4a9b=function(){return _0x46b09c;};return a12_0x4a9b();}
1
+ const a14_0x2734b2=a14_0x251e;function a14_0x3e97(){const _0x281a71=['slice','forEach','index.tsx','148STQieK','replaceAll','19488704WkRAgj','concat','1033460qUXwyz','4145029ADfHyH','39710BgANYO','303714mKGTgu','trim','42049GGkTJm','path','3595182tBqLCV','replace','utf-8','src/pages','endsWith','push','\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]','isDirectory','match'];a14_0x3e97=function(){return _0x281a71;};return a14_0x3e97();}(function(_0xb092bc,_0x2afc0a){const _0x133d29=a14_0x251e,_0x4ca322=_0xb092bc();while(!![]){try{const _0x53c64e=parseInt(_0x133d29(0x191))/0x1+-parseInt(_0x133d29(0x1a3))/0x2+-parseInt(_0x133d29(0x18f))/0x3+parseInt(_0x133d29(0x19f))/0x4*(-parseInt(_0x133d29(0x1a5))/0x5)+-parseInt(_0x133d29(0x193))/0x6+-parseInt(_0x133d29(0x1a4))/0x7+parseInt(_0x133d29(0x1a1))/0x8;if(_0x53c64e===_0x2afc0a)break;else _0x4ca322['push'](_0x4ca322['shift']());}catch(_0x529b26){_0x4ca322['push'](_0x4ca322['shift']());}}}(a14_0x3e97,0x5b8bb));import{readdirSync,statSync,readFileSync}from'fs';import{join,relative,resolve}from'path';function a14_0x251e(_0x203428,_0x35ff98){_0x203428=_0x203428-0x18f;const _0x3e978d=a14_0x3e97();let _0x251e08=_0x3e978d[_0x203428];return _0x251e08;}const pagesDir=resolve(process['cwd'](),a14_0x2734b2(0x196));export function extractTitleFromComment(_0x26d338){const _0x118b79=a14_0x2734b2;try{const _0x41c405=readFileSync(_0x26d338,_0x118b79(0x195)),_0x23bb41=_0x41c405['match'](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x23bb41&&_0x23bb41[0x1]){const _0x1679a3=_0x23bb41[0x1],_0xd766a5=_0x1679a3['match'](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0xd766a5&&_0xd766a5[0x1])return _0xd766a5[0x1][_0x118b79(0x190)]();}let _0x29d7e1=null;const _0x175d73=_0x41c405[_0x118b79(0x19b)](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x175d73&&_0x175d73[0x1]&&(_0x29d7e1=_0x175d73[0x1]);if(!_0x29d7e1){const _0x1ba86b=_0x41c405['match'](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x1ba86b&&_0x1ba86b[0x1]&&(_0x29d7e1=_0x1ba86b[0x1]);}if(_0x29d7e1){const _0x56b0d1=new RegExp('\x5cb'+_0x29d7e1+_0x118b79(0x199)),_0x47ee47=_0x41c405[_0x118b79(0x19b)](_0x56b0d1);if(_0x47ee47&&_0x47ee47[0x1])return _0x47ee47[0x1];return _0x29d7e1;}return null;}catch(_0x6635be){return null;}}export function getLocalPages(_0x55b977=pagesDir,_0x57843c=pagesDir){const _0x2a25fc=a14_0x2734b2;let _0x1890dc=[];const _0xa8c9d0=readdirSync(_0x55b977);return _0xa8c9d0[_0x2a25fc(0x19d)](_0x14b0ae=>{const _0x31aef2=_0x2a25fc,_0x2b940e=join(_0x55b977,_0x14b0ae),_0x258934=statSync(_0x2b940e);if(_0x258934&&_0x258934[_0x31aef2(0x19a)]())_0x1890dc=_0x1890dc[_0x31aef2(0x1a2)](getLocalPages(_0x2b940e,_0x57843c));else{if(_0x14b0ae[_0x31aef2(0x197)]('.tsx')){let _0x1d8817=relative(_0x57843c,_0x2b940e);_0x1d8817[_0x31aef2(0x197)](_0x31aef2(0x19e))?_0x1d8817=_0x1d8817[_0x31aef2(0x194)](/index\.tsx$/,''):_0x1d8817=_0x1d8817[_0x31aef2(0x194)](/\.tsx$/,'');_0x1d8817[_0x31aef2(0x197)]('/')&&(_0x1d8817=_0x1d8817[_0x31aef2(0x19c)](0x0,-0x1));const _0x54678f=extractTitleFromComment(_0x2b940e),_0x29bfdb=_0x54678f||_0x1d8817;_0x1890dc[_0x31aef2(0x198)]({'path':_0x1d8817[_0x31aef2(0x1a0)]('$',':'),'label':_0x29bfdb});}}}),_0x1890dc['filter'](_0x4d5647=>_0x4d5647[_0x2a25fc(0x192)]!=='');}
@@ -1 +1 @@
1
- function a13_0x36b8(_0x2e89bf,_0x544e7f){_0x2e89bf=_0x2e89bf-0x16a;const _0x733148=a13_0x7331();let _0x36b888=_0x733148[_0x2e89bf];return _0x36b888;}(function(_0xd69548,_0x59463b){const _0x111d26=a13_0x36b8,_0x565706=_0xd69548();while(!![]){try{const _0x18e51d=-parseInt(_0x111d26(0x18f))/0x1*(parseInt(_0x111d26(0x16a))/0x2)+parseInt(_0x111d26(0x172))/0x3*(parseInt(_0x111d26(0x177))/0x4)+-parseInt(_0x111d26(0x178))/0x5+parseInt(_0x111d26(0x182))/0x6+parseInt(_0x111d26(0x188))/0x7*(parseInt(_0x111d26(0x18a))/0x8)+-parseInt(_0x111d26(0x190))/0x9*(-parseInt(_0x111d26(0x191))/0xa)+-parseInt(_0x111d26(0x186))/0xb*(parseInt(_0x111d26(0x185))/0xc);if(_0x18e51d===_0x59463b)break;else _0x565706['push'](_0x565706['shift']());}catch(_0x5a6085){_0x565706['push'](_0x565706['shift']());}}}(a13_0x7331,0x3d226));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';function a13_0x7331(){const _0x1d35d6=['983028vdscAJ','55XLECtR','服务端返回空菜单列表','175IlvTpw','children','80336aaAvlI','appcode','flat','\x20个线上菜单','application/json','1JwPCWN','45YEkItK','553370CWtzEO','252508UoFGZc','errorMsg','status','info','获取菜单列表失败,HTTP状态码:\x20','length','正在获取线上菜单列表...\x20(appCode:\x20','isArray','6Hnvkkt','map','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','get-online-menu-list','403356ywFHJO','997465LOryRX','/smartapi/menu/find?appCode=','error','extend','path','success','GET','log','json','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','1538010ycsXSa','获取菜单列表失败:\x20','data'];a13_0x7331=function(){return _0x1d35d6;};return a13_0x7331();}const config=readConfig();export async function getOnlineMenuList(){const _0x22e39a=a13_0x36b8,_0x423ccd=config?.[_0x22e39a(0x18b)];if(!_0x423ccd){const _0x44b351='未提供应用AppCode,且配置中也没有默认值';return logger[_0x22e39a(0x17a)]('get-online-menu-list',_0x44b351),console[_0x22e39a(0x17a)]('×\x20'+_0x44b351),console[_0x22e39a(0x17f)]('!\x20请使用以下方式之一:'),console[_0x22e39a(0x17f)](_0x22e39a(0x181)),console['log'](_0x22e39a(0x174)),[];}logger[_0x22e39a(0x16d)](_0x22e39a(0x176),_0x22e39a(0x170)+_0x423ccd+')');const _0x7ce3b8=await fetch(getApiDomain()+_0x22e39a(0x179)+_0x423ccd,{'method':_0x22e39a(0x17e),'headers':{'Content-Type':_0x22e39a(0x18e),'Cookie':getCookie()}});if(!_0x7ce3b8['ok']){if(_0x7ce3b8['status']===0x191){const _0x2ace67=_0x22e39a(0x175);logger['error']('get-online-menu-list',_0x2ace67,{'status':_0x7ce3b8[_0x22e39a(0x16c)]});throw new Error(_0x2ace67);}const _0x1b5eea=_0x22e39a(0x16e)+_0x7ce3b8['status'];logger['error']('get-online-menu-list',_0x1b5eea);throw new Error(_0x1b5eea);}const _0x4cec48=await _0x7ce3b8[_0x22e39a(0x180)]();if(!_0x4cec48[_0x22e39a(0x17d)]){const _0x194506=_0x22e39a(0x183)+(_0x4cec48['errorMsg']||'未知错误');logger[_0x22e39a(0x17a)]('get-online-menu-list',_0x194506,{'errorCode':_0x4cec48['errorCode'],'errorMsg':_0x4cec48[_0x22e39a(0x16b)]});throw new Error(_0x194506);}if(!_0x4cec48['data'])return logger[_0x22e39a(0x16d)](_0x22e39a(0x176),_0x22e39a(0x187)),[];return logger['info'](_0x22e39a(0x176),'成功获取\x20'+_0x4cec48[_0x22e39a(0x184)]['length']+_0x22e39a(0x18d)),_0x4cec48[_0x22e39a(0x184)][_0x22e39a(0x173)](formatMenuList)[_0x22e39a(0x18c)]();}function formatMenuList(_0x13908c){const _0x4d9b6c=a13_0x36b8;let _0x3309da=[];try{if(_0x13908c[_0x4d9b6c(0x17b)]?.['resources']){const _0x133ab8=JSON['parse'](_0x13908c[_0x4d9b6c(0x17b)]['resources']);Array[_0x4d9b6c(0x171)](_0x133ab8)&&(_0x3309da=_0x133ab8);}}catch(_0x5a1cfc){}const _0x52d52d=[{'id':_0x13908c['id'],'path':_0x13908c[_0x4d9b6c(0x17c)],'label':_0x13908c['label'],'resources':_0x3309da}];if(_0x13908c[_0x4d9b6c(0x189)]&&_0x13908c[_0x4d9b6c(0x189)][_0x4d9b6c(0x16f)]>0x0)for(const _0x4dad70 of _0x13908c[_0x4d9b6c(0x189)]){_0x52d52d['push'](...formatMenuList(_0x4dad70));}return _0x52d52d;}
1
+ (function(_0x30ac50,_0x201dda){const _0xe4d88e=a15_0x1305,_0x33685a=_0x30ac50();while(!![]){try{const _0x151fe0=parseInt(_0xe4d88e(0x1bd))/0x1+-parseInt(_0xe4d88e(0x1d0))/0x2*(-parseInt(_0xe4d88e(0x1c2))/0x3)+-parseInt(_0xe4d88e(0x1c7))/0x4*(-parseInt(_0xe4d88e(0x1b5))/0x5)+-parseInt(_0xe4d88e(0x1b1))/0x6*(-parseInt(_0xe4d88e(0x1d8))/0x7)+-parseInt(_0xe4d88e(0x1c4))/0x8*(parseInt(_0xe4d88e(0x1d4))/0x9)+parseInt(_0xe4d88e(0x1b8))/0xa*(parseInt(_0xe4d88e(0x1b7))/0xb)+-parseInt(_0xe4d88e(0x1da))/0xc*(parseInt(_0xe4d88e(0x1be))/0xd);if(_0x151fe0===_0x201dda)break;else _0x33685a['push'](_0x33685a['shift']());}catch(_0xdaf0a5){_0x33685a['push'](_0x33685a['shift']());}}}(a15_0x5718,0xe7225));function a15_0x1305(_0x33faba,_0x1b84c8){_0x33faba=_0x33faba-0x1b0;const _0x5718aa=a15_0x5718();let _0x13056a=_0x5718aa[_0x33faba];return _0x13056a;}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a15_0x5718(){const _0xcb0a0e=['15576zKRVAd','10410rdxvZG','isArray','!\x20请使用以下方式之一:','errorCode','children','1052350BlPZBp','26NDHQRq','resources','get-online-menu-list','error','443019kpEArf','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','8znQYyr','/smartapi/menu/find?appCode=','log','40aJxwBU','获取菜单列表失败,HTTP状态码:\x20','info','path','GET','success','status','服务端返回空菜单列表','正在获取线上菜单列表...\x20(appCode:\x20','22YOcsCL','length','push','extend','783657jjhRrG','errorMsg','application/json','label','9377011oNDOjA','未知错误','36264324LxoOST','flat','map','json','parse','6inyHXO','data','appcode','成功获取\x20','793735ahNRZJ','\x20个线上菜单'];a15_0x5718=function(){return _0xcb0a0e;};return a15_0x5718();}import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';const config=readConfig();export async function getOnlineMenuList(){const _0x588ff2=a15_0x1305,_0x5dc7d4=config?.[_0x588ff2(0x1b3)];if(!_0x5dc7d4){const _0x2548be='未提供应用AppCode,且配置中也没有默认值';return logger[_0x588ff2(0x1c1)](_0x588ff2(0x1c0),_0x2548be),console[_0x588ff2(0x1c1)]('×\x20'+_0x2548be),console[_0x588ff2(0x1c6)](_0x588ff2(0x1ba)),console[_0x588ff2(0x1c6)](_0x588ff2(0x1c3)),console['log']('\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>'),[];}logger[_0x588ff2(0x1c9)](_0x588ff2(0x1c0),_0x588ff2(0x1cf)+_0x5dc7d4+')');const _0x1ab383=await fetch(getApiDomain()+_0x588ff2(0x1c5)+_0x5dc7d4,{'method':_0x588ff2(0x1cb),'headers':{'Content-Type':_0x588ff2(0x1d6),'Cookie':getCookie()}});if(!_0x1ab383['ok']){if(_0x1ab383[_0x588ff2(0x1cd)]===0x191){const _0x45017b='登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录';logger[_0x588ff2(0x1c1)](_0x588ff2(0x1c0),_0x45017b,{'status':_0x1ab383[_0x588ff2(0x1cd)]});throw new Error(_0x45017b);}const _0x10f947=_0x588ff2(0x1c8)+_0x1ab383['status'];logger['error']('get-online-menu-list',_0x10f947);throw new Error(_0x10f947);}const _0x2fe228=await _0x1ab383[_0x588ff2(0x1dd)]();if(!_0x2fe228[_0x588ff2(0x1cc)]){const _0xb69556='获取菜单列表失败:\x20'+(_0x2fe228['errorMsg']||_0x588ff2(0x1d9));logger[_0x588ff2(0x1c1)](_0x588ff2(0x1c0),_0xb69556,{'errorCode':_0x2fe228[_0x588ff2(0x1bb)],'errorMsg':_0x2fe228[_0x588ff2(0x1d5)]});throw new Error(_0xb69556);}if(!_0x2fe228[_0x588ff2(0x1b2)])return logger[_0x588ff2(0x1c9)]('get-online-menu-list',_0x588ff2(0x1ce)),[];return logger['info'](_0x588ff2(0x1c0),_0x588ff2(0x1b4)+_0x2fe228[_0x588ff2(0x1b2)][_0x588ff2(0x1d1)]+_0x588ff2(0x1b6)),_0x2fe228['data'][_0x588ff2(0x1dc)](formatMenuList)[_0x588ff2(0x1db)]();}function formatMenuList(_0x160354){const _0x25ac12=a15_0x1305;let _0x3088c9=[];try{if(_0x160354[_0x25ac12(0x1d3)]?.[_0x25ac12(0x1bf)]){const _0x128bc7=JSON[_0x25ac12(0x1b0)](_0x160354[_0x25ac12(0x1d3)][_0x25ac12(0x1bf)]);Array[_0x25ac12(0x1b9)](_0x128bc7)&&(_0x3088c9=_0x128bc7);}}catch(_0x9f10b5){}const _0x23703=[{'id':_0x160354['id'],'path':_0x160354[_0x25ac12(0x1ca)],'label':_0x160354[_0x25ac12(0x1d7)],'resources':_0x3088c9}];if(_0x160354[_0x25ac12(0x1bc)]&&_0x160354[_0x25ac12(0x1bc)]['length']>0x0)for(const _0xf2e9c5 of _0x160354[_0x25ac12(0x1bc)]){_0x23703[_0x25ac12(0x1d2)](...formatMenuList(_0xf2e9c5));}return _0x23703;}
@@ -1 +1 @@
1
- (function(_0x3e81bf,_0x27bf45){const _0x4473d2=a15_0x1f0e,_0x2a7a91=_0x3e81bf();while(!![]){try{const _0x1ac07e=-parseInt(_0x4473d2(0x12c))/0x1+parseInt(_0x4473d2(0x136))/0x2+-parseInt(_0x4473d2(0x137))/0x3*(-parseInt(_0x4473d2(0x130))/0x4)+parseInt(_0x4473d2(0x132))/0x5*(parseInt(_0x4473d2(0x135))/0x6)+parseInt(_0x4473d2(0x12f))/0x7*(-parseInt(_0x4473d2(0x131))/0x8)+-parseInt(_0x4473d2(0x139))/0x9*(parseInt(_0x4473d2(0x13a))/0xa)+parseInt(_0x4473d2(0x12b))/0xb;if(_0x1ac07e===_0x27bf45)break;else _0x2a7a91['push'](_0x2a7a91['shift']());}catch(_0x3d1214){_0x2a7a91['push'](_0x2a7a91['shift']());}}}(a15_0xba7c,0x5ba1f));import{useEffect,useState}from'react';function a15_0xba7c(){const _0x5938d7=['631951CWkqFi','获取菜单列表失败','then','1372714lGjsZN','4IoXOij','8tuKGxp','5saWPyC','finally','catch','166932zUgaIb','246996GYPQFo','629388OcLQEc','message','2764683mfVgcj','20QEhacT','16023018fFHnyC'];a15_0xba7c=function(){return _0x5938d7;};return a15_0xba7c();}import{getOnlineMenuList}from'./get-online-menu-list.js';function a15_0x1f0e(_0x41be9d,_0x546718){_0x41be9d=_0x41be9d-0x12b;const _0xba7cb4=a15_0xba7c();let _0x1f0e2a=_0xba7cb4[_0x41be9d];return _0x1f0e2a;}export function useGetOnlineMenuList(){const [_0x3f762b,_0x6a625a]=useState([]),[_0x3c47cb,_0x2e48d2]=useState(!![]),[_0x1f4caa,_0xc1d13a]=useState('');return useEffect(()=>{const _0x37f151=a15_0x1f0e;_0x2e48d2(!![]),_0xc1d13a(''),getOnlineMenuList()[_0x37f151(0x12e)](_0x6a625a)[_0x37f151(0x134)](_0x16170e=>{const _0x1bf740=_0x37f151;_0xc1d13a(_0x16170e[_0x1bf740(0x138)]||_0x1bf740(0x12d));})[_0x37f151(0x133)](()=>_0x2e48d2(![]));},[]),{'menuList':_0x3f762b,'loading':_0x3c47cb,'error':_0x1f4caa};}
1
+ (function(_0x4d3d88,_0x527a0d){const _0x4bb0dd=a17_0x38de,_0x1a789b=_0x4d3d88();while(!![]){try{const _0x503fe8=-parseInt(_0x4bb0dd(0x14a))/0x1+-parseInt(_0x4bb0dd(0x14f))/0x2+parseInt(_0x4bb0dd(0x14d))/0x3*(parseInt(_0x4bb0dd(0x145))/0x4)+parseInt(_0x4bb0dd(0x14c))/0x5+-parseInt(_0x4bb0dd(0x142))/0x6+-parseInt(_0x4bb0dd(0x14b))/0x7*(-parseInt(_0x4bb0dd(0x147))/0x8)+-parseInt(_0x4bb0dd(0x144))/0x9;if(_0x503fe8===_0x527a0d)break;else _0x1a789b['push'](_0x1a789b['shift']());}catch(_0x5a3a5a){_0x1a789b['push'](_0x1a789b['shift']());}}}(a17_0x2a58,0x29160));import{useEffect,useState}from'react';import{getOnlineMenuList}from'./get-online-menu-list.js';function a17_0x38de(_0x2d72d9,_0xde4dc8){_0x2d72d9=_0x2d72d9-0x142;const _0x2a5805=a17_0x2a58();let _0x38de28=_0x2a5805[_0x2d72d9];return _0x38de28;}function a17_0x2a58(){const _0x45339c=['7743jvCMQV','7vzJtVj','216580pQmULg','967317UkYZQG','then','145858VoySqM','944484FseZHT','message','1774368bqwteL','4EGVKTk','获取菜单列表失败','1902168yOcZYu','finally','catch'];a17_0x2a58=function(){return _0x45339c;};return a17_0x2a58();}export function useGetOnlineMenuList(){const [_0x2a54d4,_0x543e49]=useState([]),[_0x215188,_0x2d78f8]=useState(!![]),[_0x4f0895,_0x336753]=useState('');return useEffect(()=>{const _0x2252b9=a17_0x38de;_0x2d78f8(!![]),_0x336753(''),getOnlineMenuList()[_0x2252b9(0x14e)](_0x543e49)[_0x2252b9(0x149)](_0x2acc22=>{const _0x3ca270=_0x2252b9;_0x336753(_0x2acc22[_0x3ca270(0x143)]||_0x3ca270(0x146));})[_0x2252b9(0x148)](()=>_0x2d78f8(![]));},[]),{'menuList':_0x2a54d4,'loading':_0x215188,'error':_0x4f0895};}
@@ -1 +1 @@
1
- (function(_0x34f29f,_0x3eda82){const _0xe6ca64=a16_0x54ac,_0x22c33e=_0x34f29f();while(!![]){try{const _0x324e35=parseInt(_0xe6ca64(0x17b))/0x1*(-parseInt(_0xe6ca64(0x180))/0x2)+parseInt(_0xe6ca64(0x178))/0x3*(-parseInt(_0xe6ca64(0x182))/0x4)+parseInt(_0xe6ca64(0x181))/0x5+-parseInt(_0xe6ca64(0x17e))/0x6+parseInt(_0xe6ca64(0x17c))/0x7*(-parseInt(_0xe6ca64(0x179))/0x8)+parseInt(_0xe6ca64(0x17d))/0x9+-parseInt(_0xe6ca64(0x17f))/0xa;if(_0x324e35===_0x3eda82)break;else _0x22c33e['push'](_0x22c33e['shift']());}catch(_0x490700){_0x22c33e['push'](_0x22c33e['shift']());}}}(a16_0x2465,0x30b41));function a16_0x2465(){const _0x202bd6=['2989620VbAVAm','390396IEmVDE','1272730FQlOMK','113734FfjfWY','1258290IFZeKs','8XXZFnk','fill','max','1371NwlGVX','3544XFBXYV','repeat','1HvkpOO','2121FeVepH'];a16_0x2465=function(){return _0x202bd6;};return a16_0x2465();}export function getRemainingSpaces(_0x37c2c1,_0x1b568b){const _0x36e65e=a16_0x54ac,_0x1365f8=getStringWidth(_0x1b568b);return Array(Math[_0x36e65e(0x177)](0x0,_0x37c2c1-_0x1365f8))[_0x36e65e(0x176)]('\x20')['join']('');}export function getMaxWidth(_0x426e5c,_0x311792=0x2){const _0x1d9457=a16_0x54ac;let _0x1a4c49='',_0x1aa540=0x0;for(const _0x528aa4 of _0x426e5c){const _0x721ef0=getStringWidth(_0x528aa4);_0x721ef0>_0x1aa540&&(_0x1aa540=_0x721ef0,_0x1a4c49=_0x528aa4);}return _0x1a4c49+'\x20'[_0x1d9457(0x17a)](_0x311792);}function a16_0x54ac(_0x3096a5,_0x3ff0e4){_0x3096a5=_0x3096a5-0x176;const _0x2465fb=a16_0x2465();let _0x54acee=_0x2465fb[_0x3096a5];return _0x54acee;}export function getStringWidth(_0x769aa3){let _0x11a0d0=0x0;for(const _0x2599d5 of _0x769aa3){/[\u4e00-\u9fa5]/['test'](_0x2599d5)?_0x11a0d0+=0x2:_0x11a0d0+=0x1;}return _0x11a0d0;}
1
+ (function(_0x31ecd4,_0x20ddae){const _0x1b8b7b=a18_0x11a3,_0xf168a3=_0x31ecd4();while(!![]){try{const _0x46ecb2=parseInt(_0x1b8b7b(0x161))/0x1*(parseInt(_0x1b8b7b(0x15b))/0x2)+-parseInt(_0x1b8b7b(0x158))/0x3+-parseInt(_0x1b8b7b(0x160))/0x4+-parseInt(_0x1b8b7b(0x15a))/0x5*(parseInt(_0x1b8b7b(0x162))/0x6)+-parseInt(_0x1b8b7b(0x15e))/0x7+-parseInt(_0x1b8b7b(0x159))/0x8*(parseInt(_0x1b8b7b(0x164))/0x9)+parseInt(_0x1b8b7b(0x15c))/0xa;if(_0x46ecb2===_0x20ddae)break;else _0xf168a3['push'](_0xf168a3['shift']());}catch(_0x160a90){_0xf168a3['push'](_0xf168a3['shift']());}}}(a18_0x4d5b,0xddab7));function a18_0x11a3(_0x2dbc4b,_0x41695f){_0x2dbc4b=_0x2dbc4b-0x158;const _0x4d5b0a=a18_0x4d5b();let _0x11a3dc=_0x4d5b0a[_0x2dbc4b];return _0x11a3dc;}export function getRemainingSpaces(_0x1baabc,_0x26b050){const _0x42b42b=a18_0x11a3,_0x17256c=getStringWidth(_0x26b050);return Array(Math['max'](0x0,_0x1baabc-_0x17256c))['fill']('\x20')[_0x42b42b(0x163)]('');}function a18_0x4d5b(){const _0x5c7edc=['280TxOupj','105MZidyP','1232018BzmIEV','60151350sFltRL','repeat','7489951oHAzHx','test','6161500jVqrHS','1HKkxhO','411096cVvcuo','join','323424mzeWCj','1248663LdmAxp'];a18_0x4d5b=function(){return _0x5c7edc;};return a18_0x4d5b();}export function getMaxWidth(_0x4f8e8a,_0x59e626=0x2){const _0x3262e2=a18_0x11a3;let _0x99bd42='',_0x5c0909=0x0;for(const _0x3035d3 of _0x4f8e8a){const _0x51666e=getStringWidth(_0x3035d3);_0x51666e>_0x5c0909&&(_0x5c0909=_0x51666e,_0x99bd42=_0x3035d3);}return _0x99bd42+'\x20'[_0x3262e2(0x15d)](_0x59e626);}export function getStringWidth(_0x4cad8b){const _0x16f865=a18_0x11a3;let _0x24ddd2=0x0;for(const _0x54ea61 of _0x4cad8b){/[\u4e00-\u9fa5]/[_0x16f865(0x15f)](_0x54ea61)?_0x24ddd2+=0x2:_0x24ddd2+=0x1;}return _0x24ddd2;}
@@ -1 +1 @@
1
- (function(_0x66850a,_0x2dfb34){const _0x2a3d74=a17_0xc0fa,_0x402e45=_0x66850a();while(!![]){try{const _0x3b68a7=-parseInt(_0x2a3d74(0x147))/0x1*(parseInt(_0x2a3d74(0x142))/0x2)+parseInt(_0x2a3d74(0x141))/0x3+-parseInt(_0x2a3d74(0x143))/0x4+-parseInt(_0x2a3d74(0x140))/0x5*(-parseInt(_0x2a3d74(0x13d))/0x6)+-parseInt(_0x2a3d74(0x145))/0x7+parseInt(_0x2a3d74(0x144))/0x8+parseInt(_0x2a3d74(0x148))/0x9;if(_0x3b68a7===_0x2dfb34)break;else _0x402e45['push'](_0x402e45['shift']());}catch(_0x20d0d9){_0x402e45['push'](_0x402e45['shift']());}}}(a17_0x329a,0xeb6ea));function a17_0xc0fa(_0x7421a3,_0x109f98){_0x7421a3=_0x7421a3-0x13d;const _0x329ace=a17_0x329a();let _0xc0fa7a=_0x329ace[_0x7421a3];return _0xc0fa7a;}export function isValidJsHttpsUrl(_0x29156a){const _0xb992eb=a17_0xc0fa;return/^https:\/\/.+\.js(\?.*)?$/[_0xb992eb(0x13f)](_0x29156a[_0xb992eb(0x146)]());}function a17_0x329a(){const _0x4064b4=['14802nekBWK','4504776rVhAkQ','3529136oUrTFi','4821068lqxeMq','trim','237QAupUF','30669615HJijRU','6EmdHOF','HEAD','test','2464335eFlTUF','574623fkoRgg'];a17_0x329a=function(){return _0x4064b4;};return a17_0x329a();}export function isValidCssHttpsUrl(_0x555c1d){const _0x351b30=a17_0xc0fa;return/^https:\/\/.+\.css(\?.*)?$/[_0x351b30(0x13f)](_0x555c1d[_0x351b30(0x146)]());}export async function isUrlReachable(_0x445c46){const _0x4f5d78=a17_0xc0fa;try{const _0x18ac24=await fetch(_0x445c46,{'method':_0x4f5d78(0x13e)});return _0x18ac24['ok'];}catch{return![];}}
1
+ function a19_0x5618(_0x22c9e6,_0xda401f){_0x22c9e6=_0x22c9e6-0x96;const _0x370330=a19_0x3703();let _0x561880=_0x370330[_0x22c9e6];return _0x561880;}(function(_0x42db2c,_0x164f92){const _0x402803=a19_0x5618,_0x275b12=_0x42db2c();while(!![]){try{const _0xcf481e=-parseInt(_0x402803(0x96))/0x1*(-parseInt(_0x402803(0x97))/0x2)+-parseInt(_0x402803(0x9c))/0x3*(parseInt(_0x402803(0xa3))/0x4)+-parseInt(_0x402803(0xa2))/0x5*(-parseInt(_0x402803(0x9a))/0x6)+parseInt(_0x402803(0x9b))/0x7+-parseInt(_0x402803(0x98))/0x8*(parseInt(_0x402803(0x9d))/0x9)+-parseInt(_0x402803(0x9e))/0xa*(parseInt(_0x402803(0xa0))/0xb)+-parseInt(_0x402803(0x99))/0xc;if(_0xcf481e===_0x164f92)break;else _0x275b12['push'](_0x275b12['shift']());}catch(_0x3ed615){_0x275b12['push'](_0x275b12['shift']());}}}(a19_0x3703,0x703c9));export function isValidJsHttpsUrl(_0x2e521c){return/^https:\/\/.+\.js(\?.*)?$/['test'](_0x2e521c['trim']());}export function isValidCssHttpsUrl(_0x22d0fb){const _0x2507af=a19_0x5618;return/^https:\/\/.+\.css(\?.*)?$/['test'](_0x22d0fb[_0x2507af(0xa1)]());}function a19_0x3703(){const _0x59f8a9=['6980OGMxSO','952ZXGKAV','11vdFFNA','142112lzakzn','13592AhLIAJ','15897036gEAHPz','3444yGdbjZ','5591404wshldF','834aHFYol','2259cliqCM','50LegYuR','HEAD','230131wYfHLe','trim'];a19_0x3703=function(){return _0x59f8a9;};return a19_0x3703();}export async function isUrlReachable(_0x14cdfd){const _0x5a749f=a19_0x5618;try{const _0x4bc51d=await fetch(_0x14cdfd,{'method':_0x5a749f(0x9f)});return _0x4bc51d['ok'];}catch{return![];}}
@@ -1 +1 @@
1
- function a18_0x4747(){const _0x3c98ce=['join','待更新的资源链接:','5625620XQZWIc','12iTupjz','8503821PmqcQa','map','2779325eIrBsa','cyan','4259104RKjCyL','*\x20待更新的菜单&资源链接','resources','flat','length','2258272UiyjFD','filter','78388ISdPSR','待更新的菜单列表:','label','8sitsCm','7selhtF','from','39912GegYXo'];a18_0x4747=function(){return _0x3c98ce;};return a18_0x4747();}(function(_0x464920,_0x5aa050){const _0x8a5125=a18_0x2173,_0x76c5fd=_0x464920();while(!![]){try{const _0x38ea54=-parseInt(_0x8a5125(0x114))/0x1*(parseInt(_0x8a5125(0x111))/0x2)+-parseInt(_0x8a5125(0x101))/0x3+parseInt(_0x8a5125(0x10a))/0x4+parseInt(_0x8a5125(0x108))/0x5*(parseInt(_0x8a5125(0x105))/0x6)+-parseInt(_0x8a5125(0x115))/0x7*(-parseInt(_0x8a5125(0x10f))/0x8)+-parseInt(_0x8a5125(0x106))/0x9+-parseInt(_0x8a5125(0x104))/0xa;if(_0x38ea54===_0x5aa050)break;else _0x76c5fd['push'](_0x76c5fd['shift']());}catch(_0x4f2ca5){_0x76c5fd['push'](_0x76c5fd['shift']());}}}(a18_0x4747,0x98777));function a18_0x2173(_0x1ed983,_0x2cc850){_0x1ed983=_0x1ed983-0x100;const _0x47471d=a18_0x4747();let _0x217371=_0x47471d[_0x1ed983];return _0x217371;}import{jsx as a18_0x50c4b1,jsxs as a18_0x307098}from'react/jsx-runtime';import{Text,Box}from'ink';export function CurrentMenuCdnContent(_0x438aad){const _0x26785a=a18_0x2173,{menuList:_0x4024d1}=_0x438aad,_0x9ff2f6=_0x4024d1[_0x26785a(0x110)](_0x51f029=>_0x51f029[_0x26785a(0x10c)][_0x26785a(0x10e)]),_0x374d89=Array[_0x26785a(0x100)](new Set(_0x4024d1[_0x26785a(0x107)](_0x3eff34=>_0x3eff34[_0x26785a(0x10c)])[_0x26785a(0x10d)]()));return a18_0x307098(Box,{'flexDirection':'column','children':[a18_0x50c4b1(Text,{'color':_0x26785a(0x109),'children':_0x26785a(0x10b)}),a18_0x307098(Box,{'marginTop':0x1,'flexDirection':'column','children':[a18_0x307098(Text,{'bold':!![],'children':['\x20\x20',_0x26785a(0x112)]}),a18_0x307098(Text,{'children':['\x20\x20',_0x9ff2f6['map'](_0x1b58f9=>_0x1b58f9[_0x26785a(0x113)])[_0x26785a(0x102)](',\x20')]})]}),a18_0x50c4b1(Box,{'marginTop':0x1,'children':a18_0x307098(Text,{'bold':!![],'children':['\x20\x20',_0x26785a(0x103)]})}),_0x374d89[_0x26785a(0x107)](_0x2f6f4d=>a18_0x50c4b1(Box,{'children':a18_0x307098(Text,{'children':['\x20\x20',_0x2f6f4d]})},_0x2f6f4d))]});}
1
+ function a20_0x51f5(_0x197c7a,_0x4a68f6){_0x197c7a=_0x197c7a-0xad;const _0x4d4f4c=a20_0x4d4f();let _0x51f5ab=_0x4d4f4c[_0x197c7a];return _0x51f5ab;}(function(_0x521b79,_0x1cd5f6){const _0x291d5b=a20_0x51f5,_0x13422f=_0x521b79();while(!![]){try{const _0x1d36e9=parseInt(_0x291d5b(0xb7))/0x1+-parseInt(_0x291d5b(0xb3))/0x2*(-parseInt(_0x291d5b(0xb1))/0x3)+parseInt(_0x291d5b(0xb4))/0x4+parseInt(_0x291d5b(0xb6))/0x5*(parseInt(_0x291d5b(0xb0))/0x6)+-parseInt(_0x291d5b(0xad))/0x7+parseInt(_0x291d5b(0xb2))/0x8+-parseInt(_0x291d5b(0xbc))/0x9;if(_0x1d36e9===_0x1cd5f6)break;else _0x13422f['push'](_0x13422f['shift']());}catch(_0x43bd23){_0x13422f['push'](_0x13422f['shift']());}}}(a20_0x4d4f,0xeb55f));import{jsx as a20_0x4b4e2a,jsxs as a20_0x2e915e}from'react/jsx-runtime';import{Text,Box}from'ink';function a20_0x4d4f(){const _0x3973c3=['12668616HtWbwD','23976IYXQoE','6010652pRQkXQ','resources','6666985unyRvH','916373InkKrA','label','filter','待更新的菜单列表:','length','46599516gRkniE','flat','待更新的资源链接:','join','cyan','1157653GotuSB','map','column','6KTPXdd','243ZwSZcq'];a20_0x4d4f=function(){return _0x3973c3;};return a20_0x4d4f();}export function CurrentMenuCdnContent(_0x56e1d1){const _0x760b32=a20_0x51f5,{menuList:_0x5767e3}=_0x56e1d1,_0x295350=_0x5767e3[_0x760b32(0xb9)](_0x490a2a=>_0x490a2a[_0x760b32(0xb5)][_0x760b32(0xbb)]),_0x360a62=Array['from'](new Set(_0x5767e3['map'](_0x2ab1c5=>_0x2ab1c5[_0x760b32(0xb5)])[_0x760b32(0xbd)]()));return a20_0x2e915e(Box,{'flexDirection':'column','children':[a20_0x4b4e2a(Text,{'color':_0x760b32(0xc0),'children':'*\x20待更新的菜单&资源链接'}),a20_0x2e915e(Box,{'marginTop':0x1,'flexDirection':_0x760b32(0xaf),'children':[a20_0x2e915e(Text,{'bold':!![],'children':['\x20\x20',_0x760b32(0xba)]}),a20_0x2e915e(Text,{'children':['\x20\x20',_0x295350[_0x760b32(0xae)](_0x5287d1=>_0x5287d1[_0x760b32(0xb8)])[_0x760b32(0xbf)](',\x20')]})]}),a20_0x4b4e2a(Box,{'marginTop':0x1,'children':a20_0x2e915e(Text,{'bold':!![],'children':['\x20\x20',_0x760b32(0xbe)]})}),_0x360a62[_0x760b32(0xae)](_0x320728=>a20_0x4b4e2a(Box,{'children':a20_0x2e915e(Text,{'children':['\x20\x20',_0x320728]})},_0x320728))]});}
@@ -1 +1 @@
1
- (function(_0x10523d,_0xb95773){const _0x242a68=a19_0x2970,_0x21ae79=_0x10523d();while(!![]){try{const _0x3c2a7f=parseInt(_0x242a68(0x80))/0x1*(-parseInt(_0x242a68(0x77))/0x2)+-parseInt(_0x242a68(0x81))/0x3+parseInt(_0x242a68(0x76))/0x4*(-parseInt(_0x242a68(0x74))/0x5)+parseInt(_0x242a68(0x79))/0x6*(parseInt(_0x242a68(0x7a))/0x7)+-parseInt(_0x242a68(0x7c))/0x8*(-parseInt(_0x242a68(0x7b))/0x9)+-parseInt(_0x242a68(0x78))/0xa*(parseInt(_0x242a68(0x7f))/0xb)+parseInt(_0x242a68(0x83))/0xc*(parseInt(_0x242a68(0x82))/0xd);if(_0x3c2a7f===_0xb95773)break;else _0x21ae79['push'](_0x21ae79['shift']());}catch(_0x48508b){_0x21ae79['push'](_0x21ae79['shift']());}}}(a19_0x319f,0xa0e19));function a19_0x2970(_0x1321a7,_0x4b22e2){_0x1321a7=_0x1321a7-0x74;const _0x319fde=a19_0x319f();let _0x29701d=_0x319fde[_0x1321a7];return _0x29701d;}import{jsx as a19_0x8c9cd3,jsxs as a19_0x275e91}from'react/jsx-runtime';function a19_0x319f(){const _0x43fdda=['8877ddxnzs','3rSRkkP','1435020yfxbzY','481QOBxeg','331116RRPrLI','JS\x20链接:\x20','115dyNcWt','green','62096LtBRqy','388478tFXDqb','13480WoGCps','2136174ZaXabI','21lDsxhT','72261mfxsvt','1072kAgfRI','column','cyan'];a19_0x319f=function(){return _0x43fdda;};return a19_0x319f();}import{Text,Box}from'ink';export function InputCdnAsset(_0x585972){const _0x51fbb6=a19_0x2970,{jsCdnUrl:_0xf4836b,cssCdnUrl:_0x45c2f7}=_0x585972;return a19_0x275e91(Box,{'flexDirection':_0x51fbb6(0x7d),'marginTop':0x1,'children':[a19_0x8c9cd3(Text,{'color':_0x51fbb6(0x7e),'children':'*\x20已输入的资源资源'}),a19_0x275e91(Box,{'children':[a19_0x275e91(Text,{'children':['\x20\x20',_0x51fbb6(0x84)]}),a19_0x8c9cd3(Text,{'color':'green','children':_0xf4836b})]}),a19_0x275e91(Box,{'children':[a19_0x275e91(Text,{'children':['\x20\x20','CSS\x20链接:\x20']}),a19_0x8c9cd3(Text,{'color':_0x51fbb6(0x75),'children':_0x45c2f7})]})]});}
1
+ (function(_0x3697df,_0x12a498){const _0x3e9873=a21_0x3e67,_0x16a722=_0x3697df();while(!![]){try{const _0x83b64f=parseInt(_0x3e9873(0xea))/0x1+-parseInt(_0x3e9873(0xf5))/0x2+-parseInt(_0x3e9873(0xf1))/0x3+parseInt(_0x3e9873(0xe8))/0x4*(parseInt(_0x3e9873(0xee))/0x5)+parseInt(_0x3e9873(0xf4))/0x6*(parseInt(_0x3e9873(0xf2))/0x7)+-parseInt(_0x3e9873(0xf0))/0x8*(-parseInt(_0x3e9873(0xed))/0x9)+-parseInt(_0x3e9873(0xec))/0xa;if(_0x83b64f===_0x12a498)break;else _0x16a722['push'](_0x16a722['shift']());}catch(_0x3a39f5){_0x16a722['push'](_0x16a722['shift']());}}}(a21_0x54ae,0x1c4a2));import{jsx as a21_0x49b871,jsxs as a21_0x5b8437}from'react/jsx-runtime';function a21_0x54ae(){const _0x1142d7=['96iZRPpO','205149TlXTSN','364gzOSSc','JS\x20链接:\x20','14052ttqKVj','216646JVosLZ','cyan','CSS\x20链接:\x20','283280kTOims','column','127001edIcKu','green','1103250pZPZqo','9360DyNFpq','10IluyiR','*\x20已输入的资源资源'];a21_0x54ae=function(){return _0x1142d7;};return a21_0x54ae();}import{Text,Box}from'ink';function a21_0x3e67(_0x5dab2e,_0x117b86){_0x5dab2e=_0x5dab2e-0xe6;const _0x54ae81=a21_0x54ae();let _0x3e67a3=_0x54ae81[_0x5dab2e];return _0x3e67a3;}export function InputCdnAsset(_0x3047b6){const _0x229977=a21_0x3e67,{jsCdnUrl:_0x30d7c0,cssCdnUrl:_0x4e76d4}=_0x3047b6;return a21_0x5b8437(Box,{'flexDirection':_0x229977(0xe9),'marginTop':0x1,'children':[a21_0x49b871(Text,{'color':_0x229977(0xe6),'children':_0x229977(0xef)}),a21_0x5b8437(Box,{'children':[a21_0x5b8437(Text,{'children':['\x20\x20',_0x229977(0xf3)]}),a21_0x49b871(Text,{'color':'green','children':_0x30d7c0})]}),a21_0x5b8437(Box,{'children':[a21_0x5b8437(Text,{'children':['\x20\x20',_0x229977(0xe7)]}),a21_0x49b871(Text,{'color':_0x229977(0xeb),'children':_0x4e76d4})]})]});}
@@ -1 +1 @@
1
- (function(_0x41d261,_0x33c988){const _0x3efb95=a20_0x2f24,_0x36c098=_0x41d261();while(!![]){try{const _0x170a3f=-parseInt(_0x3efb95(0x184))/0x1*(-parseInt(_0x3efb95(0x16a))/0x2)+-parseInt(_0x3efb95(0x177))/0x3*(parseInt(_0x3efb95(0x18d))/0x4)+parseInt(_0x3efb95(0x16b))/0x5+parseInt(_0x3efb95(0x18f))/0x6*(parseInt(_0x3efb95(0x168))/0x7)+parseInt(_0x3efb95(0x170))/0x8+-parseInt(_0x3efb95(0x17b))/0x9*(parseInt(_0x3efb95(0x183))/0xa)+-parseInt(_0x3efb95(0x162))/0xb;if(_0x170a3f===_0x33c988)break;else _0x36c098['push'](_0x36c098['shift']());}catch(_0x3b8420){_0x36c098['push'](_0x36c098['shift']());}}}(a20_0x4b7b,0xef16b));import{jsx as a20_0x28b694,jsxs as a20_0x4e0760,Fragment as a20_0x376c02}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';function a20_0x2f24(_0x260a6f,_0x350d53){_0x260a6f=_0x260a6f-0x15d;const _0x4b7b40=a20_0x4b7b();let _0x2f246c=_0x4b7b40[_0x260a6f];return _0x2f246c;}import{useEffect,useState}from'react';import a20_0x4a5194 from'ink-spinner';import{useGetOnlineMenuList}from'../app-menu/use-get-online-menu-list.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../app-menu/valid-url.js';import{CurrentMenuCdnContent}from'./current-content.js';import{InputCdnAsset}from'./input-cdn-asset.js';import{updateMenuCdnUrl}from'./update-menu-cdn-url.js';import.meta.main&&render(a20_0x28b694(AppMenuUpdateCdn,{}));export function AppMenuUpdateCdn(){const _0xfc8cc7=a20_0x2f24,{exit:_0xa1592c}=useApp(),{loading:_0x546ee7,menuList:_0x2747a3,error:_0x3670d5}=useGetOnlineMenuList(),[_0x12762e,_0x9a8f39]=useState('ok'),[_0x58b470,_0x43420]=useState('input-js'),[_0x1e333c,_0x381851]=useState(''),[_0x5f5bab,_0x26dcfd]=useState(''),[_0x266c3f,_0x5ca362]=useState(''),[_0x23aff8,_0x1ef62c]=useState(''),_0x486d0a=Array[_0xfc8cc7(0x17e)](new Set(_0x2747a3['map'](_0xf714e6=>_0xf714e6[_0xfc8cc7(0x16f)])['flat']()));useEffect(()=>{const _0x3da7e2=_0xfc8cc7;_0x58b470===_0x3da7e2(0x180)&&setTimeout(_0xa1592c,0x32);},[_0x58b470]),useInput(async(_0x946c9e,_0x4f1a08)=>{const _0x2f3976=_0xfc8cc7;if(_0x58b470===_0x2f3976(0x173)){if(_0x4f1a08[_0x2f3976(0x16d)]){const _0x456269=_0x266c3f[_0x2f3976(0x165)]();if(_0x456269==='')return;if(!isValidJsHttpsUrl(_0x456269)){_0x1ef62c('请输入有效的\x20JS\x20https\x20链接');return;}if(!await isUrlReachable(_0x456269)){_0x1ef62c(_0x2f3976(0x17c));return;}_0x381851(_0x456269),_0x5ca362(''),_0x1ef62c(''),_0x43420(_0x2f3976(0x15f));return;}if(_0x4f1a08[_0x2f3976(0x181)]||_0x4f1a08[_0x2f3976(0x15d)]){_0x5ca362(_0x1b3a2d=>_0x1b3a2d[_0x2f3976(0x171)](0x0,-0x1)),_0x1ef62c('');return;}_0x5ca362(_0x489988=>_0x489988+_0x946c9e);return;}if(_0x58b470==='input-css'){if(_0x4f1a08[_0x2f3976(0x16d)]){const _0x794e77=_0x266c3f[_0x2f3976(0x165)]();if(_0x794e77==='')return;if(!isValidCssHttpsUrl(_0x794e77)){_0x1ef62c(_0x2f3976(0x175));return;}if(!await isUrlReachable(_0x794e77)){_0x1ef62c(_0x2f3976(0x169));return;}_0x26dcfd(_0x794e77),_0x5ca362(''),_0x1ef62c(''),_0x43420('need-confirm');return;}if(_0x4f1a08[_0x2f3976(0x181)]||_0x4f1a08['delete']){_0x5ca362(_0xa2a91a=>_0xa2a91a[_0x2f3976(0x171)](0x0,-0x1)),_0x1ef62c('');return;}_0x5ca362(_0xf1c22=>_0xf1c22+_0x946c9e);return;}if(_0x58b470==='need-confirm'){(_0x4f1a08['upArrow']||_0x4f1a08[_0x2f3976(0x178)]||_0x4f1a08['leftArrow']||_0x4f1a08[_0x2f3976(0x193)])&&_0x9a8f39(_0x1fc05c=>_0x1fc05c==='ok'?_0x2f3976(0x182):'ok');if(_0x4f1a08[_0x2f3976(0x16d)]){_0x43420('creating');if(_0x12762e==='ok')await Promise[_0x2f3976(0x15e)](_0x2747a3[_0x2f3976(0x189)](_0x3f09bd=>{const _0x3b9fba=_0x2f3976,_0x4f5263={'id':_0x3f09bd['id'],'label':_0x3f09bd['label'],'path':_0x3f09bd['path'],'resources':[_0x1e333c,_0x5f5bab]};if(_0x3f09bd[_0x3b9fba(0x16f)][_0x3b9fba(0x176)]===0x0)return Promise[_0x3b9fba(0x187)]();return updateMenuCdnUrl(_0x4f5263);})),await new Promise(_0x26eee4=>setTimeout(_0x26eee4,0x3e8)),_0x43420('updated');else _0x12762e===_0x2f3976(0x182)&&_0xa1592c();}}});if(_0x546ee7)return a20_0x4e0760(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a20_0x28b694(Text,{}),a20_0x28b694(a20_0x4a5194,{'type':_0xfc8cc7(0x192)}),a20_0x28b694(Text,{'children':_0xfc8cc7(0x167)})]});if(_0x3670d5)return a20_0x4e0760(Box,{'flexDirection':_0xfc8cc7(0x161),'marginTop':0x1,'marginBottom':0x1,'children':[a20_0x4e0760(Text,{'color':'red','children':['✗\x20',_0x3670d5]}),a20_0x4e0760(Box,{'marginTop':0x1,'children':[a20_0x28b694(Text,{'color':_0xfc8cc7(0x16e),'children':'提示:使用\x20'}),a20_0x28b694(Text,{'color':_0xfc8cc7(0x190),'children':_0xfc8cc7(0x18b)}),a20_0x28b694(Text,{'color':'gray','children':_0xfc8cc7(0x17d)})]})]});if(_0x486d0a[_0xfc8cc7(0x176)]===0x0)return a20_0x28b694(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a20_0x28b694(Text,{'color':_0xfc8cc7(0x16c),'children':_0xfc8cc7(0x164)})});if(_0x58b470===_0xfc8cc7(0x191))return a20_0x4e0760(Box,{'flexDirection':_0xfc8cc7(0x161),'marginTop':0x1,'marginBottom':0x1,'children':[a20_0x28b694(CurrentMenuCdnContent,{'menuList':_0x2747a3}),a20_0x28b694(InputCdnAsset,{'jsCdnUrl':_0x1e333c,'cssCdnUrl':_0x5f5bab}),a20_0x28b694(Box,{'marginTop':0x1,'flexDirection':'column','children':[{'label':_0xfc8cc7(0x186),'value':'ok'},{'label':_0xfc8cc7(0x18a),'value':'cancel'}]['map'](_0x314732=>a20_0x4e0760(Text,{'color':_0x12762e===_0x314732[_0xfc8cc7(0x185)]?_0xfc8cc7(0x16c):undefined,'children':[_0x12762e===_0x314732[_0xfc8cc7(0x185)]?'>\x20':'\x20\x20',_0x314732[_0xfc8cc7(0x163)]]},_0x314732['value']))})]});if(_0x58b470===_0xfc8cc7(0x188))return a20_0x4e0760(Box,{'flexDirection':_0xfc8cc7(0x161),'marginTop':0x1,'marginBottom':0x1,'children':[a20_0x28b694(CurrentMenuCdnContent,{'menuList':_0x2747a3}),a20_0x28b694(InputCdnAsset,{'jsCdnUrl':_0x1e333c,'cssCdnUrl':_0x5f5bab}),a20_0x4e0760(Box,{'marginTop':0x1,'children':[a20_0x28b694(a20_0x4a5194,{'type':'dots'}),a20_0x28b694(Text,{'children':_0xfc8cc7(0x172)})]})]});if(_0x58b470===_0xfc8cc7(0x180))return a20_0x4e0760(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a20_0x28b694(CurrentMenuCdnContent,{'menuList':_0x2747a3}),a20_0x28b694(InputCdnAsset,{'jsCdnUrl':_0x1e333c,'cssCdnUrl':_0x5f5bab}),a20_0x28b694(Box,{'marginTop':0x1,'children':a20_0x28b694(Text,{'color':_0xfc8cc7(0x194),'children':_0xfc8cc7(0x166)})})]});return a20_0x4e0760(Box,{'flexDirection':_0xfc8cc7(0x161),'marginTop':0x1,'marginBottom':0x1,'children':[a20_0x28b694(CurrentMenuCdnContent,{'menuList':_0x2747a3}),a20_0x4e0760(Box,{'marginTop':0x1,'flexDirection':'column','children':[a20_0x28b694(Text,{'color':_0xfc8cc7(0x190),'children':_0xfc8cc7(0x17a)}),_0x1e333c?a20_0x4e0760(Box,{'children':[a20_0x4e0760(Text,{'color':'gray','children':['\x20\x20','JS\x20链接:\x20']}),a20_0x28b694(Text,{'color':_0xfc8cc7(0x194),'children':_0x1e333c})]}):_0x58b470===_0xfc8cc7(0x173)&&a20_0x4e0760(a20_0x376c02,{'children':[a20_0x4e0760(Box,{'children':[a20_0x4e0760(Text,{'children':['\x20\x20',_0xfc8cc7(0x18c)]}),a20_0x28b694(Text,{'color':_0xfc8cc7(0x194),'children':_0x266c3f}),_0x23aff8&&a20_0x4e0760(Text,{'color':_0xfc8cc7(0x179),'children':[_0xfc8cc7(0x18e),_0x23aff8]})]}),!_0x23aff8&&a20_0x28b694(Box,{'children':a20_0x4e0760(Text,{'color':'gray','children':['\x20\x20',_0xfc8cc7(0x174)]})})]}),_0x5f5bab?a20_0x4e0760(Box,{'children':[a20_0x4e0760(Text,{'children':['\x20\x20',_0xfc8cc7(0x17f)]}),a20_0x28b694(Text,{'color':'green','children':_0x5f5bab})]}):_0x58b470===_0xfc8cc7(0x15f)&&a20_0x4e0760(a20_0x376c02,{'children':[a20_0x4e0760(Box,{'children':[a20_0x4e0760(Text,{'children':['\x20\x20',_0xfc8cc7(0x17f)]}),a20_0x28b694(Text,{'color':'green','children':_0x266c3f}),_0x23aff8&&a20_0x4e0760(Text,{'color':_0xfc8cc7(0x179),'children':[_0xfc8cc7(0x18e),_0x23aff8]})]}),!_0x23aff8&&a20_0x28b694(Box,{'children':a20_0x4e0760(Text,{'color':_0xfc8cc7(0x16e),'children':['\x20\x20',_0xfc8cc7(0x160)]})})]})]})]});}function a20_0x4b7b(){const _0x590b06=['CSS\x20链接:\x20','updated','backspace','cancel','8981230yHkYrc','596wFqDqg','value','继续更新','resolve','creating','map','取消更新','lovrabet\x20auth','JS\x20链接:\x20','32FTWCmR','\x20←\x20','7610526eudftE','cyan','need-confirm','dots','rightArrow','green','delete','all','input-css','输入项目的\x20CSS\x20资源链接(https://...)','column','6760677xaLipy','label','!\x20未找到菜单资源链接','trim','√\x20更新成功','\x20正在获取线上菜单资源链接...','7IhvyPo','CSS\x20链接无法访问','284dUrDIL','5448745UyBozM','yellow','return','gray','resources','12944472EZEEWl','slice','\x20资源正在同步中...','input-js','输入项目的\x20JS\x20资源链接(https://...)','请输入有效的\x20CSS\x20https\x20链接','length','588309fHtBVv','downArrow','red','*\x20请输入新的资源链接','9RvKhkF','JS\x20链接无法访问','\x20命令重新登录','from'];a20_0x4b7b=function(){return _0x590b06;};return a20_0x4b7b();}
1
+ (function(_0xa63425,_0x2e4667){const _0x5221ac=a22_0x3a9d,_0x1ba35a=_0xa63425();while(!![]){try{const _0x1fc3a9=parseInt(_0x5221ac(0xa5))/0x1*(-parseInt(_0x5221ac(0xa1))/0x2)+-parseInt(_0x5221ac(0xb7))/0x3*(parseInt(_0x5221ac(0xa4))/0x4)+-parseInt(_0x5221ac(0x96))/0x5*(parseInt(_0x5221ac(0x99))/0x6)+-parseInt(_0x5221ac(0xc4))/0x7*(parseInt(_0x5221ac(0xb4))/0x8)+parseInt(_0x5221ac(0xa6))/0x9*(parseInt(_0x5221ac(0xbf))/0xa)+-parseInt(_0x5221ac(0xc0))/0xb+parseInt(_0x5221ac(0xb2))/0xc;if(_0x1fc3a9===_0x2e4667)break;else _0x1ba35a['push'](_0x1ba35a['shift']());}catch(_0x534b69){_0x1ba35a['push'](_0x1ba35a['shift']());}}}(a22_0x548f,0x7aacc));import{jsx as a22_0x9bb527,jsxs as a22_0x584756,Fragment as a22_0x14122f}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a22_0x5071d2 from'ink-spinner';import{useGetOnlineMenuList}from'../app-menu/use-get-online-menu-list.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../app-menu/valid-url.js';import{CurrentMenuCdnContent}from'./current-content.js';import{InputCdnAsset}from'./input-cdn-asset.js';import{updateMenuCdnUrl}from'./update-menu-cdn-url.js';function a22_0x3a9d(_0x6b588d,_0x143a67){_0x6b588d=_0x6b588d-0x92;const _0x548fbc=a22_0x548f();let _0x3a9d7d=_0x548fbc[_0x6b588d];return _0x3a9d7d;}import.meta.main&&render(a22_0x9bb527(AppMenuUpdateCdn,{}));export function AppMenuUpdateCdn(){const _0x539717=a22_0x3a9d,{exit:_0x4dff05}=useApp(),{loading:_0x5554b4,menuList:_0x4ff589,error:_0x176749}=useGetOnlineMenuList(),[_0x7262c0,_0x43e18d]=useState('ok'),[_0x5dd38d,_0x44ac34]=useState(_0x539717(0xc8)),[_0x3d90da,_0x528f6a]=useState(''),[_0x860e09,_0x3af78a]=useState(''),[_0x531325,_0x3d147f]=useState(''),[_0x4e8866,_0x2d77b9]=useState(''),_0x478205=Array[_0x539717(0x98)](new Set(_0x4ff589[_0x539717(0xab)](_0x4c34b3=>_0x4c34b3[_0x539717(0xc3)])['flat']()));useEffect(()=>{_0x5dd38d==='updated'&&setTimeout(_0x4dff05,0x32);},[_0x5dd38d]),useInput(async(_0x181607,_0x19475d)=>{const _0x46880f=_0x539717;if(_0x5dd38d===_0x46880f(0xc8)){if(_0x19475d['return']){const _0x23ef12=_0x531325['trim']();if(_0x23ef12==='')return;if(!isValidJsHttpsUrl(_0x23ef12)){_0x2d77b9(_0x46880f(0xa7));return;}if(!await isUrlReachable(_0x23ef12)){_0x2d77b9(_0x46880f(0xbb));return;}_0x528f6a(_0x23ef12),_0x3d147f(''),_0x2d77b9(''),_0x44ac34(_0x46880f(0xa9));return;}if(_0x19475d[_0x46880f(0xbd)]||_0x19475d[_0x46880f(0xc1)]){_0x3d147f(_0x372b71=>_0x372b71[_0x46880f(0xb0)](0x0,-0x1)),_0x2d77b9('');return;}_0x3d147f(_0x4d1fc7=>_0x4d1fc7+_0x181607);return;}if(_0x5dd38d===_0x46880f(0xa9)){if(_0x19475d['return']){const _0x53d5ad=_0x531325[_0x46880f(0xa8)]();if(_0x53d5ad==='')return;if(!isValidCssHttpsUrl(_0x53d5ad)){_0x2d77b9(_0x46880f(0xa3));return;}if(!await isUrlReachable(_0x53d5ad)){_0x2d77b9(_0x46880f(0xaa));return;}_0x3af78a(_0x53d5ad),_0x3d147f(''),_0x2d77b9(''),_0x44ac34(_0x46880f(0xba));return;}if(_0x19475d['backspace']||_0x19475d['delete']){_0x3d147f(_0x45d69d=>_0x45d69d[_0x46880f(0xb0)](0x0,-0x1)),_0x2d77b9('');return;}_0x3d147f(_0x357b39=>_0x357b39+_0x181607);return;}if(_0x5dd38d===_0x46880f(0xba)){(_0x19475d[_0x46880f(0xbc)]||_0x19475d[_0x46880f(0xc7)]||_0x19475d['leftArrow']||_0x19475d['rightArrow'])&&_0x43e18d(_0x45540a=>_0x45540a==='ok'?_0x46880f(0xad):'ok');if(_0x19475d[_0x46880f(0xb1)]){_0x44ac34(_0x46880f(0xb5));if(_0x7262c0==='ok')await Promise[_0x46880f(0x9b)](_0x4ff589[_0x46880f(0xab)](_0x52f879=>{const _0x1ee5d0=_0x46880f,_0x38079f={'id':_0x52f879['id'],'label':_0x52f879['label'],'path':_0x52f879[_0x1ee5d0(0xa2)],'resources':[_0x3d90da,_0x860e09]};if(_0x52f879[_0x1ee5d0(0xc3)][_0x1ee5d0(0xb3)]===0x0)return Promise[_0x1ee5d0(0x95)]();return updateMenuCdnUrl(_0x38079f);})),await new Promise(_0x9dab26=>setTimeout(_0x9dab26,0x3e8)),_0x44ac34('updated');else _0x7262c0===_0x46880f(0xad)&&_0x4dff05();}}});if(_0x5554b4)return a22_0x584756(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a22_0x9bb527(Text,{}),a22_0x9bb527(a22_0x5071d2,{'type':_0x539717(0xb8)}),a22_0x9bb527(Text,{'children':_0x539717(0x9e)})]});if(_0x176749)return a22_0x584756(Box,{'flexDirection':_0x539717(0xac),'marginTop':0x1,'marginBottom':0x1,'children':[a22_0x584756(Text,{'color':_0x539717(0x94),'children':['✗\x20',_0x176749]}),a22_0x584756(Box,{'marginTop':0x1,'children':[a22_0x9bb527(Text,{'color':_0x539717(0x9d),'children':_0x539717(0x9a)}),a22_0x9bb527(Text,{'color':_0x539717(0x9f),'children':'lovrabet\x20auth'}),a22_0x9bb527(Text,{'color':_0x539717(0x9d),'children':_0x539717(0xc2)})]})]});if(_0x478205[_0x539717(0xb3)]===0x0)return a22_0x9bb527(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a22_0x9bb527(Text,{'color':_0x539717(0xb6),'children':_0x539717(0xaf)})});if(_0x5dd38d===_0x539717(0xba))return a22_0x584756(Box,{'flexDirection':_0x539717(0xac),'marginTop':0x1,'marginBottom':0x1,'children':[a22_0x9bb527(CurrentMenuCdnContent,{'menuList':_0x4ff589}),a22_0x9bb527(InputCdnAsset,{'jsCdnUrl':_0x3d90da,'cssCdnUrl':_0x860e09}),a22_0x9bb527(Box,{'marginTop':0x1,'flexDirection':_0x539717(0xac),'children':[{'label':_0x539717(0xb9),'value':'ok'},{'label':_0x539717(0xae),'value':_0x539717(0xad)}][_0x539717(0xab)](_0x35cfc9=>a22_0x584756(Text,{'color':_0x7262c0===_0x35cfc9[_0x539717(0x97)]?'yellow':undefined,'children':[_0x7262c0===_0x35cfc9[_0x539717(0x97)]?'>\x20':'\x20\x20',_0x35cfc9['label']]},_0x35cfc9[_0x539717(0x97)]))})]});if(_0x5dd38d==='creating')return a22_0x584756(Box,{'flexDirection':_0x539717(0xac),'marginTop':0x1,'marginBottom':0x1,'children':[a22_0x9bb527(CurrentMenuCdnContent,{'menuList':_0x4ff589}),a22_0x9bb527(InputCdnAsset,{'jsCdnUrl':_0x3d90da,'cssCdnUrl':_0x860e09}),a22_0x584756(Box,{'marginTop':0x1,'children':[a22_0x9bb527(a22_0x5071d2,{'type':_0x539717(0xb8)}),a22_0x9bb527(Text,{'children':_0x539717(0x93)})]})]});if(_0x5dd38d==='updated')return a22_0x584756(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a22_0x9bb527(CurrentMenuCdnContent,{'menuList':_0x4ff589}),a22_0x9bb527(InputCdnAsset,{'jsCdnUrl':_0x3d90da,'cssCdnUrl':_0x860e09}),a22_0x9bb527(Box,{'marginTop':0x1,'children':a22_0x9bb527(Text,{'color':_0x539717(0x92),'children':_0x539717(0xa0)})})]});return a22_0x584756(Box,{'flexDirection':_0x539717(0xac),'marginTop':0x1,'marginBottom':0x1,'children':[a22_0x9bb527(CurrentMenuCdnContent,{'menuList':_0x4ff589}),a22_0x584756(Box,{'marginTop':0x1,'flexDirection':_0x539717(0xac),'children':[a22_0x9bb527(Text,{'color':_0x539717(0x9f),'children':'*\x20请输入新的资源链接'}),_0x3d90da?a22_0x584756(Box,{'children':[a22_0x584756(Text,{'color':_0x539717(0x9d),'children':['\x20\x20',_0x539717(0xc5)]}),a22_0x9bb527(Text,{'color':_0x539717(0x92),'children':_0x3d90da})]}):_0x5dd38d===_0x539717(0xc8)&&a22_0x584756(a22_0x14122f,{'children':[a22_0x584756(Box,{'children':[a22_0x584756(Text,{'children':['\x20\x20',_0x539717(0xc5)]}),a22_0x9bb527(Text,{'color':_0x539717(0x92),'children':_0x531325}),_0x4e8866&&a22_0x584756(Text,{'color':'red','children':[_0x539717(0x9c),_0x4e8866]})]}),!_0x4e8866&&a22_0x9bb527(Box,{'children':a22_0x584756(Text,{'color':_0x539717(0x9d),'children':['\x20\x20',_0x539717(0xc6)]})})]}),_0x860e09?a22_0x584756(Box,{'children':[a22_0x584756(Text,{'children':['\x20\x20','CSS\x20链接:\x20']}),a22_0x9bb527(Text,{'color':_0x539717(0x92),'children':_0x860e09})]}):_0x5dd38d==='input-css'&&a22_0x584756(a22_0x14122f,{'children':[a22_0x584756(Box,{'children':[a22_0x584756(Text,{'children':['\x20\x20','CSS\x20链接:\x20']}),a22_0x9bb527(Text,{'color':_0x539717(0x92),'children':_0x531325}),_0x4e8866&&a22_0x584756(Text,{'color':_0x539717(0x94),'children':[_0x539717(0x9c),_0x4e8866]})]}),!_0x4e8866&&a22_0x9bb527(Box,{'children':a22_0x584756(Text,{'color':'gray','children':['\x20\x20',_0x539717(0xbe)]})})]})]})]});}function a22_0x548f(){const _0x23d66f=['cyan','√\x20更新成功','6aZBCQV','path','请输入有效的\x20CSS\x20https\x20链接','3941744wksrUF','138862fQCTdy','14463Ybuemq','请输入有效的\x20JS\x20https\x20链接','trim','input-css','CSS\x20链接无法访问','map','column','cancel','取消更新','!\x20未找到菜单资源链接','slice','return','38137332vyQWbl','length','1323664feNPSZ','creating','yellow','3kYcqHA','dots','继续更新','need-confirm','JS\x20链接无法访问','upArrow','backspace','输入项目的\x20CSS\x20资源链接(https://...)','5710hzITOh','8928513MQnKnW','delete','\x20命令重新登录','resources','21CYnYmM','JS\x20链接:\x20','输入项目的\x20JS\x20资源链接(https://...)','downArrow','input-js','green','\x20资源正在同步中...','red','resolve','4415765FjGoKy','value','from','6pBnFEf','提示:使用\x20','all','\x20←\x20','gray','\x20正在获取线上菜单资源链接...'];a22_0x548f=function(){return _0x23d66f;};return a22_0x548f();}
@@ -1 +1 @@
1
- const a22_0x4e633a=a22_0x10db;(function(_0x44240b,_0x1ca858){const _0x12b08f=a22_0x10db,_0x1cf166=_0x44240b();while(!![]){try{const _0x2d4137=-parseInt(_0x12b08f(0x1fa))/0x1*(-parseInt(_0x12b08f(0x1fd))/0x2)+parseInt(_0x12b08f(0x1f6))/0x3+-parseInt(_0x12b08f(0x1eb))/0x4*(-parseInt(_0x12b08f(0x1e1))/0x5)+parseInt(_0x12b08f(0x1e9))/0x6+parseInt(_0x12b08f(0x1f0))/0x7*(parseInt(_0x12b08f(0x1dd))/0x8)+-parseInt(_0x12b08f(0x1e4))/0x9+-parseInt(_0x12b08f(0x1f5))/0xa*(parseInt(_0x12b08f(0x1e0))/0xb);if(_0x2d4137===_0x1ca858)break;else _0x1cf166['push'](_0x1cf166['shift']());}catch(_0x1746b5){_0x1cf166['push'](_0x1cf166['shift']());}}}(a22_0x13aa,0x1d55f));import{getCookie}from'../auth/get-cookie.js';function a22_0x13aa(){const _0x13d5da=['未知错误','113znynYY','未提供应用AppCode,且配置中也没有默认值','errorCode','646PBKEzK','success','https://g.yuntooai.com/dist/yt-test-app/1.0.1/assets/main.css','log','2144jhlXMm','sdk-demo','/smartapi/menu/update','1251162HjopYU','5kQTGEd','https://g.yuntooai.com/dist/yt-test-app/1.0.1/assets/main.js','json','41472OlMTBr','正在更新菜单资源链接:\x20','error','errorMsg','!\x20请使用以下方式之一:','75660aRNIlJ','application/json','547436TTxTKF','更新菜单资源失败:\x20','data','update-menu-cdn-url','appcode','3290pqHaWr','label','resources','stringify','status','30kSMYKu','462195xljsts','path','import'];a22_0x13aa=function(){return _0x13d5da;};return a22_0x13aa();}import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';function a22_0x10db(_0x42bbc8,_0x4c3562){_0x42bbc8=_0x42bbc8-0x1db;const _0x13aa4a=a22_0x13aa();let _0x10dbe5=_0x13aa4a[_0x42bbc8];return _0x10dbe5;}const config=readConfig(),logLabel=a22_0x4e633a(0x1ee);import.meta.main&&updateMenuCdnUrl({'id':0xf41e,'label':'SdkDemo1','path':a22_0x4e633a(0x1de),'resources':[a22_0x4e633a(0x1e2),a22_0x4e633a(0x1db)]});export async function updateMenuCdnUrl(_0x5de8d4){const _0x193f72=a22_0x4e633a,_0x58e708=config?.[_0x193f72(0x1ef)];if(!_0x58e708){const _0x28c088=_0x193f72(0x1fb);logger[_0x193f72(0x1e6)](logLabel,_0x28c088),console[_0x193f72(0x1e6)]('×\x20'+_0x28c088),console[_0x193f72(0x1dc)](_0x193f72(0x1e8)),console['log']('\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>'),console[_0x193f72(0x1dc)]('\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>');return;}logger['info'](logLabel,_0x193f72(0x1e5)+_0x5de8d4['label']+'\x20('+_0x5de8d4[_0x193f72(0x1f7)]+')');const _0x3f20b7={'id':_0x5de8d4['id'],'appCode':_0x58e708,'extend':{'loadScriptMode':_0x193f72(0x1f8),'resources':_0x5de8d4[_0x193f72(0x1f2)]?JSON[_0x193f72(0x1f3)](_0x5de8d4[_0x193f72(0x1f2)]):undefined}},_0xe567b6=await fetch(getApiDomain()+_0x193f72(0x1df),{'method':'POST','body':JSON[_0x193f72(0x1f3)](_0x3f20b7),'headers':{'Content-Type':_0x193f72(0x1ea),'Cookie':getCookie()}});if(!_0xe567b6['ok']){if(_0xe567b6[_0x193f72(0x1f4)]===0x191){const _0x5992c1='登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录';logger[_0x193f72(0x1e6)](logLabel,_0x5992c1,{'status':_0xe567b6['status'],'menu':_0x5de8d4[_0x193f72(0x1f1)]});throw new Error(_0x5992c1);}const _0x50ece7='创建菜单失败,HTTP状态码:\x20'+_0xe567b6[_0x193f72(0x1f4)];logger[_0x193f72(0x1e6)](logLabel,_0x50ece7,{'menu':_0x5de8d4[_0x193f72(0x1f1)]});throw new Error(_0x50ece7);}const _0x4c6e85=await _0xe567b6[_0x193f72(0x1e3)]();if(!_0x4c6e85[_0x193f72(0x1fe)]){const _0x12417d=_0x193f72(0x1ec)+(_0x4c6e85['errorMsg']||_0x193f72(0x1f9));logger[_0x193f72(0x1e6)](logLabel,_0x12417d,{'errorCode':_0x4c6e85[_0x193f72(0x1fc)],'errorMsg':_0x4c6e85[_0x193f72(0x1e7)],'menu':_0x5de8d4['label']});throw new Error(_0x12417d);}logger['info'](logLabel,'菜单资源同步成功:\x20'+_0x5de8d4[_0x193f72(0x1f1)],_0x4c6e85[_0x193f72(0x1ed)]);}
1
+ const a24_0x38a6e0=a24_0x588b;(function(_0xa1fd1e,_0x37b4b2){const _0x5c58ce=a24_0x588b,_0x4fb875=_0xa1fd1e();while(!![]){try{const _0x17906e=parseInt(_0x5c58ce(0x133))/0x1*(parseInt(_0x5c58ce(0x13d))/0x2)+parseInt(_0x5c58ce(0x123))/0x3*(parseInt(_0x5c58ce(0x124))/0x4)+-parseInt(_0x5c58ce(0x138))/0x5+-parseInt(_0x5c58ce(0x12c))/0x6*(-parseInt(_0x5c58ce(0x135))/0x7)+-parseInt(_0x5c58ce(0x127))/0x8*(-parseInt(_0x5c58ce(0x126))/0x9)+-parseInt(_0x5c58ce(0x140))/0xa+parseInt(_0x5c58ce(0x136))/0xb*(parseInt(_0x5c58ce(0x12e))/0xc);if(_0x17906e===_0x37b4b2)break;else _0x4fb875['push'](_0x4fb875['shift']());}catch(_0x4ff981){_0x4fb875['push'](_0x4fb875['shift']());}}}(a24_0x1ccd,0x801b8));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a24_0x588b(_0x15cef1,_0x32f5af){_0x15cef1=_0x15cef1-0x123;const _0x1ccd4d=a24_0x1ccd();let _0x588b09=_0x1ccd4d[_0x15cef1];return _0x588b09;}function a24_0x1ccd(){const _0x575f63=['errorMsg','error','!\x20请使用以下方式之一:','info','errorCode','774057cFxnUF','4fRkkBX','stringify','1791rCUFEU','23272yhiDQg','success','更新菜单资源失败:\x20','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','update-menu-cdn-url','18mLDBYn','resources','291708jWmTWa','未提供应用AppCode,且配置中也没有默认值','label','创建菜单失败,HTTP状态码:\x20','未知错误','103SLQmTa','data','1129303dJLByx','44fezboG','https://g.yuntooai.com/dist/yt-test-app/1.0.1/assets/main.css','430580ceWGtZ','application/json','菜单资源同步成功:\x20','正在更新菜单资源链接:\x20','status','3558qiOfWo','sdk-demo','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','9905260NJTEjf','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','log','SdkDemo1','/smartapi/menu/update','import','POST'];a24_0x1ccd=function(){return _0x575f63;};return a24_0x1ccd();}import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';const config=readConfig(),logLabel=a24_0x38a6e0(0x12b);import.meta.main&&updateMenuCdnUrl({'id':0xf41e,'label':a24_0x38a6e0(0x143),'path':a24_0x38a6e0(0x13e),'resources':['https://g.yuntooai.com/dist/yt-test-app/1.0.1/assets/main.js',a24_0x38a6e0(0x137)]});export async function updateMenuCdnUrl(_0x36cfbc){const _0x1ac989=a24_0x38a6e0,_0x2c5cff=config?.['appcode'];if(!_0x2c5cff){const _0xaeac1b=_0x1ac989(0x12f);logger[_0x1ac989(0x148)](logLabel,_0xaeac1b),console[_0x1ac989(0x148)]('×\x20'+_0xaeac1b),console[_0x1ac989(0x142)](_0x1ac989(0x149)),console['log'](_0x1ac989(0x12a)),console[_0x1ac989(0x142)](_0x1ac989(0x141));return;}logger[_0x1ac989(0x14a)](logLabel,_0x1ac989(0x13b)+_0x36cfbc[_0x1ac989(0x130)]+'\x20('+_0x36cfbc['path']+')');const _0x3ca98c={'id':_0x36cfbc['id'],'appCode':_0x2c5cff,'extend':{'loadScriptMode':_0x1ac989(0x145),'resources':_0x36cfbc['resources']?JSON[_0x1ac989(0x125)](_0x36cfbc[_0x1ac989(0x12d)]):undefined}},_0x3d7d43=await fetch(getApiDomain()+_0x1ac989(0x144),{'method':_0x1ac989(0x146),'body':JSON['stringify'](_0x3ca98c),'headers':{'Content-Type':_0x1ac989(0x139),'Cookie':getCookie()}});if(!_0x3d7d43['ok']){if(_0x3d7d43[_0x1ac989(0x13c)]===0x191){const _0x2916d0=_0x1ac989(0x13f);logger[_0x1ac989(0x148)](logLabel,_0x2916d0,{'status':_0x3d7d43[_0x1ac989(0x13c)],'menu':_0x36cfbc['label']});throw new Error(_0x2916d0);}const _0xbcdba9=_0x1ac989(0x131)+_0x3d7d43['status'];logger['error'](logLabel,_0xbcdba9,{'menu':_0x36cfbc['label']});throw new Error(_0xbcdba9);}const _0x5b1d80=await _0x3d7d43['json']();if(!_0x5b1d80[_0x1ac989(0x128)]){const _0x56825a=_0x1ac989(0x129)+(_0x5b1d80[_0x1ac989(0x147)]||_0x1ac989(0x132));logger[_0x1ac989(0x148)](logLabel,_0x56825a,{'errorCode':_0x5b1d80[_0x1ac989(0x14b)],'errorMsg':_0x5b1d80[_0x1ac989(0x147)],'menu':_0x36cfbc[_0x1ac989(0x130)]});throw new Error(_0x56825a);}logger[_0x1ac989(0x14a)](logLabel,_0x1ac989(0x13a)+_0x36cfbc[_0x1ac989(0x130)],_0x5b1d80[_0x1ac989(0x134)]);}
@@ -1 +1 @@
1
- (function(_0x51808d,_0x40bd18){const _0xe56797=a23_0x1b89,_0x3c1971=_0x51808d();while(!![]){try{const _0x3ac59e=parseInt(_0xe56797(0x1ff))/0x1*(parseInt(_0xe56797(0x1ef))/0x2)+-parseInt(_0xe56797(0x1f0))/0x3+-parseInt(_0xe56797(0x200))/0x4+-parseInt(_0xe56797(0x1fb))/0x5*(parseInt(_0xe56797(0x1fc))/0x6)+-parseInt(_0xe56797(0x1ea))/0x7+-parseInt(_0xe56797(0x1f8))/0x8*(-parseInt(_0xe56797(0x1f9))/0x9)+parseInt(_0xe56797(0x1ec))/0xa*(parseInt(_0xe56797(0x1f2))/0xb);if(_0x3ac59e===_0x40bd18)break;else _0x3c1971['push'](_0x3c1971['shift']());}catch(_0x1b2ecc){_0x3c1971['push'](_0x3c1971['shift']());}}}(a23_0x5aaf,0x7ef75));import{jsx as a23_0x2bedb2,jsxs as a23_0x2b3941}from'react/jsx-runtime';import{Text,Box,useInput,useApp}from'ink';import{useEffect,useState}from'react';import{getIsSessionValid}from'./is-session-valid.js';import{authServer}from'./auth-server.js';function a23_0x1b89(_0x2736d7,_0x4ef133){_0x2736d7=_0x2736d7-0x1ea;const _0x5aafe1=a23_0x5aaf();let _0x1b89a2=_0x5aafe1[_0x2736d7];return _0x1b89a2;}import a23_0x12f972 from'ink-spinner';export function AuthServer(){const _0x121882=a23_0x1b89,{exit:_0x367365}=useApp(),[_0x34abf4,_0x21113d]=useState(![]),[_0x339425,_0x52f0ed]=useState(!![]),[_0x36c669,_0x19a2b7]=useState(![]),[_0x360cbe,_0x598ded]=useState(![]);useEffect(()=>{const _0x3be657=a23_0x1b89;getIsSessionValid()[_0x3be657(0x1f4)](_0x21113d)[_0x3be657(0x1eb)](()=>_0x52f0ed(![]));},[]),useEffect(()=>{const _0x2a5e83=a23_0x1b89;!_0x339425&&_0x34abf4&&(console[_0x2a5e83(0x1f1)](_0x2a5e83(0x1f6)),_0x367365());},[_0x339425,_0x34abf4,_0x367365]),useEffect(()=>{const _0x3072ac=a23_0x1b89;_0x360cbe&&(console['log'](_0x3072ac(0x1fe)),_0x367365());},[_0x360cbe,_0x367365]),useInput((_0x180ac1,_0x2ae292)=>{const _0x1d473e=a23_0x1b89;_0x2ae292['return']&&(_0x19a2b7(!![]),authServer({'silent':!![]})[_0x1d473e(0x1f4)](_0x423bdf=>{_0x598ded(_0x423bdf);})),_0x180ac1==='q'&&_0x367365();});if(_0x339425)return null;if(_0x34abf4||_0x360cbe)return null;return a23_0x2bedb2(Box,{'flexDirection':_0x121882(0x1fa),'marginTop':0x1,'marginBottom':0x1,'children':_0x36c669?a23_0x2b3941(Box,{'children':[a23_0x2bedb2(Box,{'width':'1'}),a23_0x2b3941(Text,{'color':_0x121882(0x1f3),'children':[a23_0x2bedb2(a23_0x12f972,{'type':_0x121882(0x1f7)}),'\x20\x20']}),a23_0x2bedb2(Text,{'children':_0x121882(0x1ee)}),a23_0x2bedb2(Text,{'color':'gray','children':_0x121882(0x1ed)})]}):a23_0x2b3941(Box,{'children':[a23_0x2bedb2(Box,{'width':'1'}),a23_0x2bedb2(Text,{'children':_0x121882(0x1fd)}),a23_0x2bedb2(Text,{'color':'gray','children':_0x121882(0x1f5)})]})});}function a23_0x5aaf(){const _0x6eab67=['66aiGuKh','green','then','按\x20“q”\x20退出。','√\x20当前为有效会话,无需重新登录。','dots','1015832TxvEyY','72aCRBGD','column','2711765BCvACL','6AcZUXD','*\x20按回车开始登录。','*\x20登录成功!','2579CjCLAP','3615320PQnhox','2432283iAScgm','finally','2792190GucamF','请前往浏览器完成登录。','正在登录...\x20','234YlYSCp','2037552hJYLAn','log'];a23_0x5aaf=function(){return _0x6eab67;};return a23_0x5aaf();}
1
+ (function(_0x5355c9,_0x2f0814){const _0x5bd8e0=a25_0x33c6,_0x65063b=_0x5355c9();while(!![]){try{const _0x7b917a=parseInt(_0x5bd8e0(0x17c))/0x1*(-parseInt(_0x5bd8e0(0x184))/0x2)+-parseInt(_0x5bd8e0(0x175))/0x3*(-parseInt(_0x5bd8e0(0x176))/0x4)+parseInt(_0x5bd8e0(0x180))/0x5+parseInt(_0x5bd8e0(0x187))/0x6+parseInt(_0x5bd8e0(0x183))/0x7*(-parseInt(_0x5bd8e0(0x17f))/0x8)+-parseInt(_0x5bd8e0(0x17d))/0x9*(parseInt(_0x5bd8e0(0x181))/0xa)+-parseInt(_0x5bd8e0(0x17e))/0xb;if(_0x7b917a===_0x2f0814)break;else _0x65063b['push'](_0x65063b['shift']());}catch(_0x5dedd5){_0x65063b['push'](_0x65063b['shift']());}}}(a25_0x5c5e,0x1e276));function a25_0x33c6(_0x285f07,_0x13b455){_0x285f07=_0x285f07-0x175;const _0x5c5e16=a25_0x5c5e();let _0x33c62d=_0x5c5e16[_0x285f07];return _0x33c62d;}import{jsx as a25_0x191724,jsxs as a25_0x425373}from'react/jsx-runtime';import{Text,Box,useInput,useApp}from'ink';import{useEffect,useState}from'react';import{getIsSessionValid}from'./is-session-valid.js';import{authServer}from'./auth-server.js';function a25_0x5c5e(){const _0x44939b=['按\x20“q”\x20退出。','14SDHdYG','72oHJKdn','*\x20按回车开始登录。','column','904824weSjwJ','请前往浏览器完成登录。','log','39GTaCKd','41084aIFAnj','dots','正在登录...\x20','green','gray','then','4541NzRGeD','1179DuvMsd','650705cklaXT','19432zfVRHs','801685ltUPUj','7150IFrfGy'];a25_0x5c5e=function(){return _0x44939b;};return a25_0x5c5e();}import a25_0x52d6bb from'ink-spinner';export function AuthServer(){const _0x3ff66a=a25_0x33c6,{exit:_0x5a739b}=useApp(),[_0x10324d,_0x1f7125]=useState(![]),[_0x4d6a18,_0x3f6d1f]=useState(!![]),[_0x4f73c3,_0xd8766c]=useState(![]),[_0x1080a9,_0xfeda28]=useState(![]);useEffect(()=>{const _0xc75f4a=a25_0x33c6;getIsSessionValid()[_0xc75f4a(0x17b)](_0x1f7125)['finally'](()=>_0x3f6d1f(![]));},[]),useEffect(()=>{!_0x4d6a18&&_0x10324d&&(console['log']('√\x20当前为有效会话,无需重新登录。'),_0x5a739b());},[_0x4d6a18,_0x10324d,_0x5a739b]),useEffect(()=>{const _0x22eda7=a25_0x33c6;_0x1080a9&&(console[_0x22eda7(0x189)]('*\x20登录成功!'),_0x5a739b());},[_0x1080a9,_0x5a739b]),useInput((_0x1fb270,_0x5242c5)=>{const _0x1a5698=a25_0x33c6;_0x5242c5['return']&&(_0xd8766c(!![]),authServer({'silent':!![]})[_0x1a5698(0x17b)](_0x59f135=>{_0xfeda28(_0x59f135);})),_0x1fb270==='q'&&_0x5a739b();});if(_0x4d6a18)return null;if(_0x10324d||_0x1080a9)return null;return a25_0x191724(Box,{'flexDirection':_0x3ff66a(0x186),'marginTop':0x1,'marginBottom':0x1,'children':_0x4f73c3?a25_0x425373(Box,{'children':[a25_0x191724(Box,{'width':'1'}),a25_0x425373(Text,{'color':_0x3ff66a(0x179),'children':[a25_0x191724(a25_0x52d6bb,{'type':_0x3ff66a(0x177)}),'\x20\x20']}),a25_0x191724(Text,{'children':_0x3ff66a(0x178)}),a25_0x191724(Text,{'color':_0x3ff66a(0x17a),'children':_0x3ff66a(0x188)})]}):a25_0x425373(Box,{'children':[a25_0x191724(Box,{'width':'1'}),a25_0x191724(Text,{'children':_0x3ff66a(0x185)}),a25_0x191724(Text,{'color':_0x3ff66a(0x17a),'children':_0x3ff66a(0x182)})]})});}
@@ -1 +1 @@
1
- const a24_0x51a675=a24_0x36a7;(function(_0x39422b,_0xa44f8d){const _0x33c942=a24_0x36a7,_0x24b1a6=_0x39422b();while(!![]){try{const _0x308dbf=-parseInt(_0x33c942(0x11e))/0x1*(parseInt(_0x33c942(0x127))/0x2)+-parseInt(_0x33c942(0x12d))/0x3*(parseInt(_0x33c942(0x10a))/0x4)+-parseInt(_0x33c942(0x128))/0x5*(parseInt(_0x33c942(0x10b))/0x6)+-parseInt(_0x33c942(0x132))/0x7+-parseInt(_0x33c942(0x110))/0x8*(-parseInt(_0x33c942(0x124))/0x9)+-parseInt(_0x33c942(0x10e))/0xa*(parseInt(_0x33c942(0x10d))/0xb)+-parseInt(_0x33c942(0x116))/0xc*(-parseInt(_0x33c942(0x134))/0xd);if(_0x308dbf===_0xa44f8d)break;else _0x24b1a6['push'](_0x24b1a6['shift']());}catch(_0xb66231){_0x24b1a6['push'](_0x24b1a6['shift']());}}}(a24_0x20c4,0xf3543));function a24_0x20c4(){const _0x5e41d1=['127.0.0.1','🔐\x20正在启动登录服务...','<!doctype\x20html>\x0a<html>\x0a<head><meta\x20charset=\x22utf-8\x22><title>登录成功</title></head>\x0a<body>\x0a\x20\x20<div>登录成功,请返回命令行继续操作。当前窗口将在\x20<span\x20id=\x22t\x22>5</span>\x20秒内关闭。</div>\x0a\x20\x20<div\x20id=\x22manualMsg\x22\x20style=\x22display:none;margin-top:10px;color:#d00;\x22>无法自动关闭窗口,请手动关闭此标签页或窗口。</div>\x0a\x20\x20<script>\x0a\x20\x20(function(){\x0a\x20\x20\x20\x20var\x20t\x20=\x205;\x0a\x20\x20\x20\x20var\x20el\x20=\x20document.getElementById(\x27t\x27);\x0a\x20\x20\x20\x20var\x20manual\x20=\x20document.getElementById(\x27manualMsg\x27);\x0a\x20\x20\x20\x20var\x20id\x20=\x20setInterval(function(){\x0a\x20\x20\x20\x20\x20\x20t--;\x0a\x20\x20\x20\x20\x20\x20if\x20(t\x20<=\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20clearInterval(id);\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20\x270\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x20window.close();\x20}\x20catch(e)\x20{}\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20如果自动关闭无效,显示文本提示让用户手动关闭\x0a\x20\x20\x20\x20\x20\x20\x20\x20setTimeout(function(){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(!window.closed)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20manual.style.display\x20=\x20\x27block\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20},\x20300);\x0a\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20String(t);\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20},\x201000);\x0a\x20\x20})();\x0a\x20\x20</script>\x0a</body>\x0a</html>','then','257136asHNva','end','platform','writeHead','listen','✅\x20浏览器已自动打开,请在浏览器中完成登录','object','catch','1nopzJL','⚠️\x20\x20无法自动打开浏览器','address','/sign-in?redirect=','📍\x20登录地址:','darwin','9TcYTWt','win32','silent','2958094uGUocw','5PuGntA','log','isAuth','port','error','141SKZBnG','xdg-open\x20\x22','cookie','utf-8','open\x20\x22','911939xAdqjK','close','3705sGctRE','session','text/html;\x20charset=utf-8','https://dev.lovrabet.com:','🌐\x20正在尝试自动打开浏览器...','createServer','83116eGlDWD','5184228VekQjA','json','6413cKsbMT','32490mqzvPl','🔗\x20请手动复制登录地址到浏览器:','1870696bYfNds','💡\x20如果浏览器没有自动打开,请手动复制上面的登录地址到浏览器中打开'];a24_0x20c4=function(){return _0x5e41d1;};return a24_0x20c4();}import{writeFileSync}from'node:fs';function a24_0x36a7(_0x3fc96f,_0x128c3d){_0x3fc96f=_0x3fc96f-0x107;const _0x20c451=a24_0x20c4();let _0x36a711=_0x20c451[_0x3fc96f];return _0x36a711;}import a24_0x406c17 from'node:https';import{getUserDomain}from'../constant/domain.js';import{exec}from'node:child_process';import{getIsSessionValid}from'./is-session-valid.js';import{cookieFile}from'./constant.js';export async function authServer(_0x59dab4){const _0x501064=a24_0x36a7,_0x52d5ba=_0x59dab4?.[_0x501064(0x126)]||![];if(await getIsSessionValid())return!![];const _0x263fae=await(await fetch('https://g.yuntooai.com/cert/lovrabet-dev.json'))[_0x501064(0x10c)]();return new Promise(async(_0x2ef235,_0x2890f8)=>{const _0x53e843=_0x501064;let _0x2afed0=0x0;const _0x186679=a24_0x406c17[_0x53e843(0x109)](_0x263fae,async(_0x3eaed9,_0x2d32f9)=>{const _0x283e1d=_0x53e843,_0x39af6c=getUserDomain(),_0x3229a0=_0x3eaed9['headers'][_0x283e1d(0x12f)]||'',_0x408965=await fetch(_0x39af6c+'/api/auth/get-session',{'headers':{'cookie':_0x3229a0}})['then'](_0x1ae028=>_0x1ae028[_0x283e1d(0x10c)]()),_0x563163=_0x408965&&_0x408965[_0x283e1d(0x135)]&&_0x408965['user'];if(_0x563163){writeFileSync(cookieFile,_0x3229a0,_0x283e1d(0x130)),_0x2ef235(!![]);const _0x55a0b8=_0x283e1d(0x114);_0x2d32f9[_0x283e1d(0x119)](0xc8,{'Content-Type':_0x283e1d(0x136)}),_0x2d32f9[_0x283e1d(0x117)](_0x55a0b8),_0x186679[_0x283e1d(0x133)]();}else{const _0x58492d=''+encodeURIComponent(_0x283e1d(0x107)+_0x2afed0);_0x2d32f9[_0x283e1d(0x119)](0x12e,{'location':_0x39af6c+_0x283e1d(0x121)+_0x58492d}),_0x2d32f9['end']();return;}});_0x186679[_0x53e843(0x11a)](0x0,_0x53e843(0x112),()=>{const _0x1d6c95=_0x53e843,_0x4378e6=_0x186679[_0x1d6c95(0x120)]();_0x2afed0=typeof _0x4378e6===_0x1d6c95(0x11c)&&_0x4378e6?_0x4378e6[_0x1d6c95(0x12b)]:Number(_0x4378e6);const _0x4d7c90=_0x1d6c95(0x107)+_0x2afed0;!_0x52d5ba&&(console[_0x1d6c95(0x129)](_0x1d6c95(0x113)),console[_0x1d6c95(0x129)](_0x1d6c95(0x122),_0x4d7c90),console[_0x1d6c95(0x129)](_0x1d6c95(0x108)),console['log'](''),console[_0x1d6c95(0x129)](_0x1d6c95(0x111)),console[_0x1d6c95(0x129)]('')),openInBrowser(_0x4d7c90)[_0x1d6c95(0x115)](_0x333025=>{const _0x67ccde=_0x1d6c95;!_0x52d5ba&&(_0x333025?console[_0x67ccde(0x129)](_0x67ccde(0x11b)):(console['log'](_0x67ccde(0x11f)),console[_0x67ccde(0x129)](_0x67ccde(0x10f),_0x4d7c90)),console[_0x67ccde(0x129)](''));})[_0x1d6c95(0x11d)](()=>{const _0x3f9fc2=_0x1d6c95;!_0x52d5ba&&(console[_0x3f9fc2(0x129)]('⚠️\x20\x20无法自动打开浏览器'),console['log'](_0x3f9fc2(0x10f),_0x4d7c90),console[_0x3f9fc2(0x129)](''));});}),_0x186679['on'](_0x53e843(0x12c),_0xedd1ff=>{const _0x173bc3=_0x53e843;!_0x52d5ba&&console[_0x173bc3(0x12c)]('Auth\x20server\x20error:',_0xedd1ff),_0x2890f8(_0xedd1ff);});});}function openInBrowser(_0x34dfd0){return new Promise(_0x36019d=>{const _0x14353e=a24_0x36a7,_0x2930b7=process[_0x14353e(0x118)];let _0x438028;if(_0x2930b7===_0x14353e(0x125))_0x438028='start\x20\x22\x22\x20\x22'+_0x34dfd0+'\x22';else _0x2930b7===_0x14353e(0x123)?_0x438028=_0x14353e(0x131)+_0x34dfd0+'\x22':_0x438028=_0x14353e(0x12e)+_0x34dfd0+'\x22';exec(_0x438028,_0x108bfc=>{_0x108bfc?_0x36019d(![]):_0x36019d(!![]);});});}if(import.meta.main){const isAuth=await authServer();console[a24_0x51a675(0x129)](a24_0x51a675(0x12a),isAuth);}
1
+ (function(_0x1ba51f,_0x4d6d4d){const _0x34ab19=a26_0x1e65,_0x2a3859=_0x1ba51f();while(!![]){try{const _0x36aa6f=-parseInt(_0x34ab19(0xff))/0x1+parseInt(_0x34ab19(0xea))/0x2*(parseInt(_0x34ab19(0xe7))/0x3)+-parseInt(_0x34ab19(0xec))/0x4+parseInt(_0x34ab19(0xed))/0x5+-parseInt(_0x34ab19(0xdc))/0x6*(parseInt(_0x34ab19(0xf3))/0x7)+parseInt(_0x34ab19(0xfa))/0x8+-parseInt(_0x34ab19(0xdd))/0x9;if(_0x36aa6f===_0x4d6d4d)break;else _0x2a3859['push'](_0x2a3859['shift']());}catch(_0x32ae97){_0x2a3859['push'](_0x2a3859['shift']());}}}(a26_0x47ae,0x46506));import{writeFileSync}from'node:fs';function a26_0x1e65(_0x3d383a,_0x33889c){_0x3d383a=_0x3d383a-0xdc;const _0x47ae2b=a26_0x47ae();let _0x1e6540=_0x47ae2b[_0x3d383a];return _0x1e6540;}import a26_0x3a94a3 from'node:https';import{getUserDomain}from'../constant/domain.js';import{exec}from'node:child_process';import{getIsSessionValid}from'./is-session-valid.js';function a26_0x47ae(){const _0x27b70c=['125740pacbxK','12NCmAXZ','1860210VVRpvs','/sign-in?redirect=','🔐\x20正在启动登录服务...','127.0.0.1','close','end','darwin','🌐\x20正在尝试自动打开浏览器...','✅\x20浏览器已自动打开,请在浏览器中完成登录','address','1132410VYmpBQ','📍\x20登录地址:','🔗\x20请手动复制登录地址到浏览器:','2YPksDR','https://dev.lovrabet.com:','117292NWILPc','1333315ZUtNjY','cookie','then','listen','object','createServer','1084762oFYDBC','catch','log','start\x20\x22\x22\x20\x22','headers','platform','/api/auth/get-session','2524464eSHFoA','error','writeHead','https://g.yuntooai.com/cert/lovrabet-dev.json','port'];a26_0x47ae=function(){return _0x27b70c;};return a26_0x47ae();}import{cookieFile}from'./constant.js';export async function authServer(_0x255cc2){const _0x542cd0=a26_0x1e65,_0xad5ed=_0x255cc2?.['silent']||![];if(await getIsSessionValid())return!![];const _0x33d048=await(await fetch(_0x542cd0(0xfd)))['json']();return new Promise(async(_0x1bc67b,_0x5c20f0)=>{const _0x335910=_0x542cd0;let _0x245938=0x0;const _0x292e09=a26_0x3a94a3[_0x335910(0xf2)](_0x33d048,async(_0x1ff1d0,_0x4d28d5)=>{const _0x1b34ed=_0x335910,_0x4beb33=getUserDomain(),_0x12e968=_0x1ff1d0[_0x1b34ed(0xf7)][_0x1b34ed(0xee)]||'',_0x404551=await fetch(_0x4beb33+_0x1b34ed(0xf9),{'headers':{'cookie':_0x12e968}})[_0x1b34ed(0xef)](_0x9d3757=>_0x9d3757['json']()),_0x14cb71=_0x404551&&_0x404551['session']&&_0x404551['user'];if(_0x14cb71){writeFileSync(cookieFile,_0x12e968,'utf-8'),_0x1bc67b(!![]);const _0x486630='<!doctype\x20html>\x0a<html>\x0a<head><meta\x20charset=\x22utf-8\x22><title>登录成功</title></head>\x0a<body>\x0a\x20\x20<div>登录成功,请返回命令行继续操作。当前窗口将在\x20<span\x20id=\x22t\x22>5</span>\x20秒内关闭。</div>\x0a\x20\x20<div\x20id=\x22manualMsg\x22\x20style=\x22display:none;margin-top:10px;color:#d00;\x22>无法自动关闭窗口,请手动关闭此标签页或窗口。</div>\x0a\x20\x20<script>\x0a\x20\x20(function(){\x0a\x20\x20\x20\x20var\x20t\x20=\x205;\x0a\x20\x20\x20\x20var\x20el\x20=\x20document.getElementById(\x27t\x27);\x0a\x20\x20\x20\x20var\x20manual\x20=\x20document.getElementById(\x27manualMsg\x27);\x0a\x20\x20\x20\x20var\x20id\x20=\x20setInterval(function(){\x0a\x20\x20\x20\x20\x20\x20t--;\x0a\x20\x20\x20\x20\x20\x20if\x20(t\x20<=\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20clearInterval(id);\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20\x270\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x20window.close();\x20}\x20catch(e)\x20{}\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20如果自动关闭无效,显示文本提示让用户手动关闭\x0a\x20\x20\x20\x20\x20\x20\x20\x20setTimeout(function(){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(!window.closed)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20manual.style.display\x20=\x20\x27block\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20},\x20300);\x0a\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20String(t);\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20},\x201000);\x0a\x20\x20})();\x0a\x20\x20</script>\x0a</body>\x0a</html>';_0x4d28d5[_0x1b34ed(0xfc)](0xc8,{'Content-Type':'text/html;\x20charset=utf-8'}),_0x4d28d5[_0x1b34ed(0xe2)](_0x486630),_0x292e09[_0x1b34ed(0xe1)]();}else{const _0x143d98=''+encodeURIComponent(_0x1b34ed(0xeb)+_0x245938);_0x4d28d5[_0x1b34ed(0xfc)](0x12e,{'location':_0x4beb33+_0x1b34ed(0xde)+_0x143d98}),_0x4d28d5[_0x1b34ed(0xe2)]();return;}});_0x292e09[_0x335910(0xf0)](0x0,_0x335910(0xe0),()=>{const _0xdcd71d=_0x335910,_0x5b420c=_0x292e09[_0xdcd71d(0xe6)]();_0x245938=typeof _0x5b420c===_0xdcd71d(0xf1)&&_0x5b420c?_0x5b420c[_0xdcd71d(0xfe)]:Number(_0x5b420c);const _0x258e32=_0xdcd71d(0xeb)+_0x245938;!_0xad5ed&&(console['log'](_0xdcd71d(0xdf)),console['log'](_0xdcd71d(0xe8),_0x258e32),console[_0xdcd71d(0xf5)](_0xdcd71d(0xe4)),console['log'](''),console[_0xdcd71d(0xf5)]('💡\x20如果浏览器没有自动打开,请手动复制上面的登录地址到浏览器中打开'),console['log']('')),openInBrowser(_0x258e32)[_0xdcd71d(0xef)](_0x1be301=>{const _0x2e1949=_0xdcd71d;!_0xad5ed&&(_0x1be301?console['log'](_0x2e1949(0xe5)):(console[_0x2e1949(0xf5)]('⚠️\x20\x20无法自动打开浏览器'),console['log'](_0x2e1949(0xe9),_0x258e32)),console['log'](''));})[_0xdcd71d(0xf4)](()=>{const _0x242d40=_0xdcd71d;!_0xad5ed&&(console[_0x242d40(0xf5)]('⚠️\x20\x20无法自动打开浏览器'),console[_0x242d40(0xf5)](_0x242d40(0xe9),_0x258e32),console['log'](''));});}),_0x292e09['on'](_0x335910(0xfb),_0x41999b=>{!_0xad5ed&&console['error']('Auth\x20server\x20error:',_0x41999b),_0x5c20f0(_0x41999b);});});}function openInBrowser(_0x168508){return new Promise(_0x53f289=>{const _0x269a12=a26_0x1e65,_0x3b4bbd=process[_0x269a12(0xf8)];let _0x32c53e;if(_0x3b4bbd==='win32')_0x32c53e=_0x269a12(0xf6)+_0x168508+'\x22';else _0x3b4bbd===_0x269a12(0xe3)?_0x32c53e='open\x20\x22'+_0x168508+'\x22':_0x32c53e='xdg-open\x20\x22'+_0x168508+'\x22';exec(_0x32c53e,_0x5812ef=>{_0x5812ef?_0x53f289(![]):_0x53f289(!![]);});});}if(import.meta.main){const isAuth=await authServer();console['log']('isAuth',isAuth);}
@@ -1 +1 @@
1
- const a25_0x1da162=a25_0x4479;(function(_0x325b5c,_0x213539){const _0x52a568=a25_0x4479,_0x222685=_0x325b5c();while(!![]){try{const _0x25bd22=-parseInt(_0x52a568(0x19f))/0x1*(parseInt(_0x52a568(0x1a0))/0x2)+-parseInt(_0x52a568(0x19b))/0x3+-parseInt(_0x52a568(0x1a2))/0x4*(-parseInt(_0x52a568(0x1a1))/0x5)+-parseInt(_0x52a568(0x19d))/0x6*(parseInt(_0x52a568(0x197))/0x7)+-parseInt(_0x52a568(0x198))/0x8*(parseInt(_0x52a568(0x19c))/0x9)+parseInt(_0x52a568(0x195))/0xa*(-parseInt(_0x52a568(0x19e))/0xb)+parseInt(_0x52a568(0x19a))/0xc;if(_0x25bd22===_0x213539)break;else _0x222685['push'](_0x222685['shift']());}catch(_0x337185){_0x222685['push'](_0x222685['shift']());}}}(a25_0x55e9,0xabdda));function a25_0x55e9(){const _0x338289=['290aeUbix','/cookie','210KzTold','5192VhRVMm','/.lovrabet','60788748wtfRUu','1726608BuOLRt','15831bvYaTP','175158clRnlz','380699npAXsY','10iMuiRh','176242zSzKME','905sDzvZg','2564VXurnd'];a25_0x55e9=function(){return _0x338289;};return a25_0x55e9();}function a25_0x4479(_0x23ca43,_0x344c36){_0x23ca43=_0x23ca43-0x195;const _0x55e94f=a25_0x55e9();let _0x4479de=_0x55e94f[_0x23ca43];return _0x4479de;}import{mkdirSync}from'node:fs';import{homedir}from'node:os';export const configDir=homedir()+a25_0x1da162(0x199);export const cookieFile=configDir+a25_0x1da162(0x196);mkdirSync(configDir,{'recursive':!![]});
1
+ const a27_0x2ff629=a27_0x3f3b;(function(_0x4ff2ea,_0x2e63ae){const _0x4aad53=a27_0x3f3b,_0x591327=_0x4ff2ea();while(!![]){try{const _0x5ae728=parseInt(_0x4aad53(0x18d))/0x1+parseInt(_0x4aad53(0x18b))/0x2+-parseInt(_0x4aad53(0x18a))/0x3+-parseInt(_0x4aad53(0x189))/0x4+-parseInt(_0x4aad53(0x191))/0x5+-parseInt(_0x4aad53(0x18f))/0x6+-parseInt(_0x4aad53(0x18e))/0x7*(-parseInt(_0x4aad53(0x190))/0x8);if(_0x5ae728===_0x2e63ae)break;else _0x591327['push'](_0x591327['shift']());}catch(_0x3f0e94){_0x591327['push'](_0x591327['shift']());}}}(a27_0x11a1,0xd8afa));import{mkdirSync}from'node:fs';import{homedir}from'node:os';export const configDir=homedir()+a27_0x2ff629(0x18c);export const cookieFile=configDir+a27_0x2ff629(0x188);mkdirSync(configDir,{'recursive':!![]});function a27_0x3f3b(_0x5be8f2,_0x371968){_0x5be8f2=_0x5be8f2-0x188;const _0x11a101=a27_0x11a1();let _0x3f3b54=_0x11a101[_0x5be8f2];return _0x3f3b54;}function a27_0x11a1(){const _0x16cb5b=['6513385oFzNhA','/cookie','734668PyWnva','4592349AQvBTC','581320caYSxi','/.lovrabet','1260838KIryfl','6482TFxFDd','9071694INZhDC','33392iALsti'];a27_0x11a1=function(){return _0x16cb5b;};return a27_0x11a1();}
@@ -1 +1 @@
1
- (function(_0x5101dd,_0xf0c230){var _0x5c2510=a26_0x2d6b,_0x443272=_0x5101dd();while(!![]){try{var _0x4f0365=parseInt(_0x5c2510(0x11c))/0x1+parseInt(_0x5c2510(0x120))/0x2*(parseInt(_0x5c2510(0x11f))/0x3)+parseInt(_0x5c2510(0x121))/0x4*(parseInt(_0x5c2510(0x125))/0x5)+parseInt(_0x5c2510(0x11e))/0x6*(parseInt(_0x5c2510(0x122))/0x7)+-parseInt(_0x5c2510(0x11d))/0x8+-parseInt(_0x5c2510(0x126))/0x9+-parseInt(_0x5c2510(0x123))/0xa;if(_0x4f0365===_0xf0c230)break;else _0x443272['push'](_0x443272['shift']());}catch(_0x186ab8){_0x443272['push'](_0x443272['shift']());}}}(a26_0xaab8,0xe5e5c));function a26_0x2d6b(_0x302265,_0x44d3e8){_0x302265=_0x302265-0x11c;var _0xaab896=a26_0xaab8();var _0x2d6bea=_0xaab896[_0x302265];return _0x2d6bea;}import{readFileSync}from'node:fs';function a26_0xaab8(){var _0x107773=['4432872pZWENr','2071158CRIZbh','51zIZfat','107878MzDOSb','112xMuGyQ','28fSJKmw','4146340ehUpuL','utf-8','157980egBShw','13707072VIxuJQ','250988BasSNg'];a26_0xaab8=function(){return _0x107773;};return a26_0xaab8();}import{cookieFile}from'./constant.js';export function getCookie(){var _0x2c9151=a26_0x2d6b;try{return readFileSync(cookieFile,_0x2c9151(0x124));}catch{}return'';}
1
+ function a28_0x372b(_0x501512,_0x19bcdd){_0x501512=_0x501512-0x7e;var _0x378ba4=a28_0x378b();var _0x372b36=_0x378ba4[_0x501512];return _0x372b36;}function a28_0x378b(){var _0x44e778=['727450nCVABb','699419AhHPEp','9092214ztRoKk','478901USxxqm','8364bfgYjn','596YcxAEn','1848325jvnFkX','4393744jinONw','6kDVhbV'];a28_0x378b=function(){return _0x44e778;};return a28_0x378b();}(function(_0x3a10ce,_0xca9127){var _0x4f0e87=a28_0x372b,_0x47488d=_0x3a10ce();while(!![]){try{var _0x2a20f3=-parseInt(_0x4f0e87(0x7f))/0x1+parseInt(_0x4f0e87(0x85))/0x2+parseInt(_0x4f0e87(0x80))/0x3*(parseInt(_0x4f0e87(0x81))/0x4)+-parseInt(_0x4f0e87(0x82))/0x5+-parseInt(_0x4f0e87(0x84))/0x6*(parseInt(_0x4f0e87(0x86))/0x7)+-parseInt(_0x4f0e87(0x83))/0x8+parseInt(_0x4f0e87(0x7e))/0x9;if(_0x2a20f3===_0xca9127)break;else _0x47488d['push'](_0x47488d['shift']());}catch(_0x52781d){_0x47488d['push'](_0x47488d['shift']());}}}(a28_0x378b,0x47362));import{readFileSync}from'node:fs';import{cookieFile}from'./constant.js';export function getCookie(){try{return readFileSync(cookieFile,'utf-8');}catch{}return'';}
@@ -1 +1 @@
1
- function a27_0x3376(_0x3ef9bd,_0x6e4662){_0x3ef9bd=_0x3ef9bd-0x10c;const _0x1dcceb=a27_0x1dcc();let _0x3376f1=_0x1dcceb[_0x3ef9bd];return _0x3376f1;}function a27_0x1dcc(){const _0x567c15=['536JsTPYP','/api/auth/get-session','14867055QEvwiM','24UAXvbM','102lAoXSM','json','10imLKIL','11701872HXxXkk','15qOVAdK','user','session','6522EHekIk','8364565yEDcgY','200636cOOTgg','5422944AjFBIS','utf-8','129135httzlR','then'];a27_0x1dcc=function(){return _0x567c15;};return a27_0x1dcc();}(function(_0x4c9b8f,_0x3515bd){const _0x269e8b=a27_0x3376,_0x38882d=_0x4c9b8f();while(!![]){try{const _0x33eca6=parseInt(_0x269e8b(0x113))/0x1*(-parseInt(_0x269e8b(0x118))/0x2)+-parseInt(_0x269e8b(0x116))/0x3*(parseInt(_0x269e8b(0x11d))/0x4)+parseInt(_0x269e8b(0x11b))/0x5*(parseInt(_0x269e8b(0x10f))/0x6)+parseInt(_0x269e8b(0x112))/0x7+parseInt(_0x269e8b(0x119))/0x8+-parseInt(_0x269e8b(0x10d))/0x9*(parseInt(_0x269e8b(0x111))/0xa)+-parseInt(_0x269e8b(0x117))/0xb*(-parseInt(_0x269e8b(0x10e))/0xc);if(_0x33eca6===_0x3515bd)break;else _0x38882d['push'](_0x38882d['shift']());}catch(_0x441e4d){_0x38882d['push'](_0x38882d['shift']());}}}(a27_0x1dcc,0xd2520));import{existsSync,readFileSync}from'node:fs';import{getUserDomain}from'../constant/domain.js';import{cookieFile}from'./constant.js';export async function getIsSessionValid(){const _0x3bc650=a27_0x3376;try{if(!existsSync(cookieFile))return![];const _0x3f049c=readFileSync(cookieFile,_0x3bc650(0x11a)),_0x286a02=await fetch(getUserDomain()+_0x3bc650(0x10c),{'headers':{'cookie':_0x3f049c}})[_0x3bc650(0x11c)](_0x2eebaa=>_0x2eebaa[_0x3bc650(0x110)]());return _0x286a02&&_0x286a02[_0x3bc650(0x115)]&&_0x286a02[_0x3bc650(0x114)];}catch{}return![];}
1
+ (function(_0x2da2ef,_0x40f415){const _0x2f45f9=a29_0x3ec8,_0x22c920=_0x2da2ef();while(!![]){try{const _0x4c3446=-parseInt(_0x2f45f9(0x176))/0x1*(-parseInt(_0x2f45f9(0x168))/0x2)+-parseInt(_0x2f45f9(0x178))/0x3*(parseInt(_0x2f45f9(0x174))/0x4)+parseInt(_0x2f45f9(0x16f))/0x5+parseInt(_0x2f45f9(0x170))/0x6*(-parseInt(_0x2f45f9(0x169))/0x7)+parseInt(_0x2f45f9(0x16e))/0x8+parseInt(_0x2f45f9(0x171))/0x9*(parseInt(_0x2f45f9(0x177))/0xa)+parseInt(_0x2f45f9(0x172))/0xb*(-parseInt(_0x2f45f9(0x16a))/0xc);if(_0x4c3446===_0x40f415)break;else _0x22c920['push'](_0x22c920['shift']());}catch(_0x13aaf9){_0x22c920['push'](_0x22c920['shift']());}}}(a29_0x3cf4,0xb300a));import{existsSync,readFileSync}from'node:fs';import{getUserDomain}from'../constant/domain.js';import{cookieFile}from'./constant.js';export async function getIsSessionValid(){const _0x130677=a29_0x3ec8;try{if(!existsSync(cookieFile))return![];const _0x121db0=readFileSync(cookieFile,_0x130677(0x16b)),_0x29357b=await fetch(getUserDomain()+_0x130677(0x16c),{'headers':{'cookie':_0x121db0}})['then'](_0x3164cd=>_0x3164cd[_0x130677(0x173)]());return _0x29357b&&_0x29357b[_0x130677(0x175)]&&_0x29357b[_0x130677(0x16d)];}catch{}return![];}function a29_0x3ec8(_0x3f391c,_0x8a4418){_0x3f391c=_0x3f391c-0x168;const _0x3cf4ea=a29_0x3cf4();let _0x3ec876=_0x3cf4ea[_0x3f391c];return _0x3ec876;}function a29_0x3cf4(){const _0x3c0e67=['user','4677144ppkomt','1446065aXWsYH','42lsIONA','6823530eumxKX','46574Paqgiu','json','1358684qIBTCu','session','1DLQvZq','10VesiWx','12xuQbln','1723932UXzUHl','101500DPKTtq','852tjOZHc','utf-8','/api/auth/get-session'];a29_0x3cf4=function(){return _0x3c0e67;};return a29_0x3cf4();}
@@ -1 +1 @@
1
- (function(_0x5ce701,_0x3d2280){var _0x326845=a28_0x29de,_0x50e934=_0x5ce701();while(!![]){try{var _0x4fe764=parseInt(_0x326845(0x1cb))/0x1+parseInt(_0x326845(0x1c7))/0x2*(parseInt(_0x326845(0x1cc))/0x3)+parseInt(_0x326845(0x1cf))/0x4*(parseInt(_0x326845(0x1d2))/0x5)+parseInt(_0x326845(0x1d0))/0x6*(-parseInt(_0x326845(0x1cd))/0x7)+-parseInt(_0x326845(0x1ce))/0x8+parseInt(_0x326845(0x1d1))/0x9*(parseInt(_0x326845(0x1c8))/0xa)+-parseInt(_0x326845(0x1ca))/0xb;if(_0x4fe764===_0x3d2280)break;else _0x50e934['push'](_0x50e934['shift']());}catch(_0x2dae96){_0x50e934['push'](_0x50e934['shift']());}}}(a28_0x509c,0xada29));function a28_0x29de(_0x4e3aec,_0x5c9639){_0x4e3aec=_0x4e3aec-0x1c7;var _0x509cb5=a28_0x509c();var _0x29de01=_0x509cb5[_0x4e3aec];return _0x29de01;}function a28_0x509c(){var _0x7a8bd0=['7oWVEYG','919296SaqEGq','479060yyfcyz','5830518lxjfEl','2981997FodCpl','55eigwgG','341618AZvQFY','30fRGcCV','log','29712254BdJUvp','1333529GGsZcf','15Akvptq'];a28_0x509c=function(){return _0x7a8bd0;};return a28_0x509c();}import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'./constant.js';export function logout(){var _0x5d28ec=a28_0x29de;existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x5d28ec(0x1c9)]('✓\x20已退出登录')):console[_0x5d28ec(0x1c9)]('!\x20当前未登录');}
1
+ (function(_0x32bb71,_0x3646c1){var _0x290e2d=a30_0x2566,_0x394c35=_0x32bb71();while(!![]){try{var _0x1c9881=parseInt(_0x290e2d(0x70))/0x1+parseInt(_0x290e2d(0x69))/0x2*(parseInt(_0x290e2d(0x68))/0x3)+-parseInt(_0x290e2d(0x6e))/0x4*(parseInt(_0x290e2d(0x6b))/0x5)+parseInt(_0x290e2d(0x6d))/0x6*(-parseInt(_0x290e2d(0x75))/0x7)+parseInt(_0x290e2d(0x6c))/0x8*(-parseInt(_0x290e2d(0x6f))/0x9)+parseInt(_0x290e2d(0x77))/0xa*(parseInt(_0x290e2d(0x71))/0xb)+-parseInt(_0x290e2d(0x74))/0xc*(-parseInt(_0x290e2d(0x72))/0xd);if(_0x1c9881===_0x3646c1)break;else _0x394c35['push'](_0x394c35['shift']());}catch(_0x181dfe){_0x394c35['push'](_0x394c35['shift']());}}}(a30_0x196f,0x77cb5));import{unlinkSync,existsSync}from'node:fs';function a30_0x2566(_0x3f918e,_0x42cbc0){_0x3f918e=_0x3f918e-0x68;var _0x196fc2=a30_0x196f();var _0x25665a=_0x196fc2[_0x3f918e];return _0x25665a;}import{cookieFile}from'./constant.js';export function logout(){var _0x26af11=a30_0x2566;existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x26af11(0x73)](_0x26af11(0x76))):console['log'](_0x26af11(0x6a));}function a30_0x196f(){var _0x508136=['22803VsxTNz','73099sUMBvn','log','2544zyhMrq','14UhqFxR','✓\x20已退出登录','1670XPqiUi','1095RJfIxC','692AmKlxG','!\x20当前未登录','341995wahrXj','1778232drlgVd','2543094qzBaiI','20JyHPfL','9YnXlgG','238092JCyTNW'];a30_0x196f=function(){return _0x508136;};return a30_0x196f();}