@lovrabet/cli 1.3.4-beta.1 → 1.3.4
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.
- package/lib/ai-setup/AISetupUI.js +1 -1
- package/lib/ai-setup/config.js +1 -1
- package/lib/api/api-doc-ui.js +1 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-pull-ui.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/main.js +1 -1
- package/lib/api/pull-silent.js +1 -1
- package/lib/app-menu/app-menu-sync-ui.js +1 -1
- package/lib/app-menu/create-menu.js +1 -1
- package/lib/app-menu/get-local-pages.js +1 -1
- package/lib/app-menu/get-online-menu-list.js +1 -1
- package/lib/app-menu/use-get-online-menu-list.js +1 -1
- package/lib/app-menu/utils.js +1 -1
- package/lib/app-menu/valid-url.js +1 -1
- package/lib/app-menu-update-cdn/current-content.js +1 -1
- package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
- package/lib/app-menu-update-cdn/main.js +1 -1
- package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/cmd/build-watch.js +1 -1
- package/lib/cmd/build.js +1 -1
- package/lib/cmd/logs.js +1 -1
- package/lib/cmd/preview.js +1 -1
- package/lib/cmd/start-execa.js +1 -1
- package/lib/cmd/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/non-interactive.js +1 -1
- package/lib/create-app/task-finished.js +1 -1
- package/lib/create-app/task-loading.js +1 -1
- package/lib/create-app/task-running.js +1 -1
- package/lib/create-app/task-time.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/help.js +1 -1
- package/lib/i18n/I18nProvider.js +1 -1
- package/lib/i18n/hooks.js +1 -1
- package/lib/i18n/index.js +1 -1
- package/lib/i18n/locales/en-US.js +1 -1
- package/lib/i18n/locales/zh-CN.js +1 -1
- package/lib/init/main.js +1 -1
- package/lib/mcp/McpInstallUI.js +1 -1
- package/lib/mcp/claude.js +1 -1
- package/lib/mcp/cursor.js +1 -1
- package/lib/mcp/main.js +1 -1
- package/lib/mcp/mcp-install-non-interactive.js +1 -1
- package/lib/mcp/mcp-installer.js +1 -1
- package/lib/skills/SkillInstallUI.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/skill-install-non-interactive.js +1 -1
- package/lib/skills/skill-installer.js +1 -1
- package/lib/ui/IDESelector.js +1 -1
- package/lib/ui/useIDESelection.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +1 -1
- package/templates/projects/sub-app-react-demo/src/pages/index.tsx +29 -6
- package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xa61167,_0x16cf36){const _0x3745f1=a9_0x5f21,_0x2c6922=_0xa61167();while(!![]){try{const _0x5296bb=parseInt(_0x3745f1(0xed))/0x1*(-parseInt(_0x3745f1(0xb3))/0x2)+-parseInt(_0x3745f1(0xe5))/0x3*(-parseInt(_0x3745f1(0xe0))/0x4)+-parseInt(_0x3745f1(0xbf))/0x5+parseInt(_0x3745f1(0xc5))/0x6+-parseInt(_0x3745f1(0xe3))/0x7*(-parseInt(_0x3745f1(0xda))/0x8)+-parseInt(_0x3745f1(0xa9))/0x9*(-parseInt(_0x3745f1(0xdf))/0xa)+-parseInt(_0x3745f1(0xd4))/0xb;if(_0x5296bb===_0x16cf36)break;else _0x2c6922['push'](_0x2c6922['shift']());}catch(_0x58f4da){_0x2c6922['push'](_0x2c6922['shift']());}}}(a9_0x1bb6,0xe38a9));import{jsx as a9_0x405f8f,jsxs as a9_0x51dc1e,Fragment as a9_0x3ef7df}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a9_0x4c999c from'ink-spinner';function a9_0x1bb6(){const _0x105ff6=['input-js','has','add','dots','selecting','22254mPNEYA','green','[✓]','return','length','includes','[\x20]','gray','appMenu.sync.step.completed','appMenu.sync.title','value','column','1860010XmTDob','max','white','test','red','online','833670lKIKzq','label','appMenu.sync.error.authHint.suffix','appMenu.sync.error.authHint.prefix','map','input-css','filter','upArrow','appMenu.sync.input.cssUrl.label','appMenu.sync.error.cssUrlUnreachable','appMenu.sync.hotkeys','appMenu.sync.error.createMenuFailed','appMenu.sync.table.lovrabetPlatform','size','\x20←\x20','14158562pekJai','yellow','appMenu.sync.step.jsUrl','path','done','join','1754664tfTJdq','local','appMenu.sync.step.creating','appMenu.sync.input.jsUrl.label','appMenu.sync.input.cssUrl.placeholder','3150lCgLHx','1919164rJWJSR','appMenu.sync.operation.create','appMenu.sync.operation.update','49htkSCR','trim','6LgdXDR','lovrabet\x20auth','appMenu.sync.error.noMenuSelected','appMenu.sync.error.noLocalPages','appMenu.sync.table.local','appMenu.sync.error.invalidCssUrl','repeat','appMenu.sync.table.menuName','45rDCXRh','fill','cyan','delete','catch','appMenu.sync.error.jsUrlUnreachable','creating','appMenu.sync.step.cssUrl','13086sxQcYT','backspace','slice','appMenu.sync.step.selectedMenusCount','appMenu.sync.loading.fetchingMenuList'];a9_0x1bb6=function(){return _0x105ff6;};return a9_0x1bb6();}import{useGetOnlineMenuList}from'./use-get-online-menu-list.js';import{getLocalPages}from'./get-local-pages.js';import{createMenus}from'./create-menu.js';function a9_0x5f21(_0x51fbbe,_0x47e036){_0x51fbbe=_0x51fbbe-0xa3;const _0x1bb66e=a9_0x1bb6();let _0x5f21f1=_0x1bb66e[_0x51fbbe];return _0x5f21f1;}import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import{useI18n}from'../i18n/hooks.js';import.meta.main&&render(a9_0x405f8f(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x454b92=a9_0x5f21,{exit:_0x34f4b5}=useApp(),{t:_0x584786}=useI18n(),{loading:_0x507ffc,menuList:_0x2553b7,error:_0x504413}=useGetOnlineMenuList(),_0x5c9202=getLocalPages(),_0x5e9365=_0x2553b7[_0x454b92(0xc9)](_0x2b9d46=>_0x2b9d46[_0x454b92(0xd7)]),_0x42cc91=_0x584786(_0x454b92(0xec)),_0x57dd11=[_0x42cc91,..._0x5c9202['map'](_0xb06cb9=>_0xb06cb9[_0x454b92(0xc6)])],_0x1f57a7=getStringWidth(getMaxWidth(_0x57dd11,0x4)),_0x5a4f83=getStringWidth(getMaxWidth([_0x42cc91])),[_0x174d1e,_0x5877ab]=useState(_0x454b92(0xb2)),[_0x3564c2,_0x33a8f2]=useState(new Set()),[_0x2dee92,_0x1585da]=useState(0x0),[_0x8b6319,_0xc0fbc3]=useState(''),[_0x28d57d,_0x19ef2b]=useState(''),[_0x11d708,_0x5b6b86]=useState(''),[_0x187af2,_0x366488]=useState(''),[_0xdcfe21,_0x10a70a]=useState([]),_0x3f4eac=_0x5c9202[_0x454b92(0xc9)](_0x497814=>({'label':_0x497814[_0x454b92(0xc6)],'path':_0x497814[_0x454b92(0xd7)],'local':!![],'online':_0x5e9365[_0x454b92(0xb8)](_0x497814[_0x454b92(0xd7)])})),_0x2360e8=_0x5c9202[_0x454b92(0xcb)](_0x1573df=>{const _0x10d7fe=_0x454b92;return!_0x5e9365[_0x10d7fe(0xb8)](_0x1573df[_0x10d7fe(0xd7)]);});useEffect(()=>{const _0x97ec02=_0x454b92;if(!_0x507ffc&&_0x5c9202[_0x97ec02(0xb7)]>0x0&&_0x3564c2['size']===0x0){const _0x195788=new Set(_0x5c9202[_0x97ec02(0xc9)]((_0x20e295,_0xa2a039)=>({'page':_0x20e295,'index':_0xa2a039}))[_0x97ec02(0xcb)](({page:_0x2e20b0})=>!_0x5e9365[_0x97ec02(0xb8)](_0x2e20b0[_0x97ec02(0xd7)]))[_0x97ec02(0xc9)](({index:_0x4dc9aa})=>_0x4dc9aa));_0x33a8f2(_0x195788);}},[_0x507ffc,_0x5c9202[_0x454b92(0xb7)],_0x5e9365[_0x454b92(0xb7)]]),useInput(async(_0x3dce4e,_0x501a4a)=>{const _0x359c3a=_0x454b92;if(_0x174d1e===_0x359c3a(0xb2)){if(_0x501a4a[_0x359c3a(0xcc)]){_0x1585da(_0x2e964c=>_0x2e964c>0x0?_0x2e964c-0x1:_0x5c9202[_0x359c3a(0xb7)]-0x1);return;}if(_0x501a4a['downArrow']){_0x1585da(_0x5c2dd4=>_0x5c2dd4<_0x5c9202[_0x359c3a(0xb7)]-0x1?_0x5c2dd4+0x1:0x0);return;}if(_0x3dce4e==='\x20'){_0x33a8f2(_0x20270e=>{const _0x272cfa=_0x359c3a,_0x2beff4=new Set(_0x20270e);return _0x2beff4['has'](_0x2dee92)?_0x2beff4[_0x272cfa(0xa4)](_0x2dee92):_0x2beff4[_0x272cfa(0xb0)](_0x2dee92),_0x2beff4;});return;}if(_0x3dce4e==='a'||_0x3dce4e==='A'){const _0x31de37=new Set(_0x5c9202[_0x359c3a(0xc9)]((_0x1ac3dc,_0x17456a)=>_0x17456a));_0x33a8f2(_0x31de37);return;}if(_0x3dce4e==='i'||_0x3dce4e==='I'||_0x3dce4e==='r'||_0x3dce4e==='R'){_0x33a8f2(_0x25f942=>{const _0x3552ec=_0x359c3a,_0x16e9f8=new Set();for(let _0x5f3b9e=0x0;_0x5f3b9e<_0x5c9202[_0x3552ec(0xb7)];_0x5f3b9e++){!_0x25f942['has'](_0x5f3b9e)&&_0x16e9f8[_0x3552ec(0xb0)](_0x5f3b9e);}return _0x16e9f8;});return;}if(_0x3dce4e==='q'||_0x3dce4e==='Q'){_0x34f4b5();return;}if(_0x501a4a[_0x359c3a(0xb6)]){if(_0x3564c2[_0x359c3a(0xd2)]===0x0){_0x366488(_0x584786(_0x359c3a(0xe7)));return;}const _0x5be3b4=_0x5c9202[_0x359c3a(0xcb)]((_0x1ca15f,_0x38b53a)=>_0x3564c2[_0x359c3a(0xaf)](_0x38b53a)),_0x411315=_0x5be3b4[_0x359c3a(0xc9)](_0x569968=>_0x569968['label'])['join'](',\x20');_0x10a70a([{'label':_0x584786('appMenu.sync.step.selectedMenus'),'value':_0x584786(_0x359c3a(0xac),{'count':_0x3564c2[_0x359c3a(0xd2)]})}]),_0x366488(''),_0x5877ab(_0x359c3a(0xae));return;}return;}if(_0x174d1e===_0x359c3a(0xae)){if(_0x501a4a[_0x359c3a(0xb6)]){const _0x1b73ec=_0x11d708[_0x359c3a(0xe4)]();if(_0x1b73ec==='')return;if(!isValidJsHttpsUrl(_0x1b73ec)){_0x366488(_0x584786('appMenu.sync.error.invalidJsUrl'));return;}if(!await isUrlReachable(_0x1b73ec)){_0x366488(_0x584786(_0x359c3a(0xa6)));return;}_0xc0fbc3(_0x1b73ec),_0x10a70a(_0x6a442a=>[..._0x6a442a,{'label':_0x584786(_0x359c3a(0xd6)),'value':_0x1b73ec}]),_0x5b6b86(''),_0x366488(''),_0x5877ab(_0x359c3a(0xca));return;}if(_0x501a4a[_0x359c3a(0xaa)]||_0x501a4a['delete']){_0x5b6b86(_0x4f1b0b=>_0x4f1b0b[_0x359c3a(0xab)](0x0,-0x1)),_0x366488('');return;}_0x5b6b86(_0x472e64=>_0x472e64+_0x3dce4e);return;}if(_0x174d1e===_0x359c3a(0xca)){if(_0x501a4a[_0x359c3a(0xb6)]){const _0x1a47ea=_0x11d708['trim']();if(_0x1a47ea==='')return;if(!isValidCssHttpsUrl(_0x1a47ea)){_0x366488(_0x584786(_0x359c3a(0xea)));return;}if(!await isUrlReachable(_0x1a47ea)){_0x366488(_0x584786(_0x359c3a(0xce)));return;}_0x19ef2b(_0x1a47ea),_0x10a70a(_0x276d24=>[..._0x276d24,{'label':_0x584786(_0x359c3a(0xa8)),'value':_0x1a47ea}]),_0x5b6b86(''),_0x366488(''),_0x5877ab('creating');const _0x3166f2=_0x5c9202[_0x359c3a(0xcb)]((_0x58e9b4,_0x155943)=>_0x3564c2['has'](_0x155943));createMenus(_0x3166f2,[_0x8b6319,_0x1a47ea])['then'](()=>{_0x5877ab('done'),setTimeout(()=>{_0x34f4b5();},0x3e8);})[_0x359c3a(0xa5)](_0x3d639b=>{const _0x59040c=_0x359c3a;_0x366488(_0x3d639b['message']||_0x584786(_0x59040c(0xd0))),_0x5877ab(_0x59040c(0xb2));});return;}if(_0x501a4a['backspace']||_0x501a4a[_0x359c3a(0xa4)]){_0x5b6b86(_0xfa4094=>_0xfa4094['slice'](0x0,-0x1)),_0x366488('');return;}_0x5b6b86(_0x127a5f=>_0x127a5f+_0x3dce4e);return;}});if(_0x507ffc)return a9_0x51dc1e(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a9_0x405f8f(Text,{'children':'\x20\x20'}),a9_0x405f8f(a9_0x4c999c,{'type':_0x454b92(0xb1)}),a9_0x405f8f(Text,{'children':_0x584786(_0x454b92(0xad))})]});if(_0x504413)return a9_0x51dc1e(Box,{'flexDirection':_0x454b92(0xbe),'marginTop':0x1,'marginBottom':0x1,'children':[a9_0x51dc1e(Text,{'color':_0x454b92(0xc3),'children':['✗\x20',_0x504413]}),a9_0x51dc1e(Box,{'marginTop':0x1,'children':[a9_0x405f8f(Text,{'color':'gray','children':_0x584786(_0x454b92(0xc8))}),a9_0x405f8f(Text,{'color':_0x454b92(0xa3),'children':_0x454b92(0xe6)}),a9_0x405f8f(Text,{'color':'gray','children':_0x584786(_0x454b92(0xc7))})]})]});if(_0x5c9202[_0x454b92(0xb7)]===0x0)return a9_0x405f8f(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a9_0x405f8f(Text,{'color':_0x454b92(0xd5),'children':_0x584786(_0x454b92(0xe8))})});return a9_0x51dc1e(Box,{'flexDirection':_0x454b92(0xbe),'marginTop':0x1,'marginBottom':0x1,'children':[_0x174d1e===_0x454b92(0xb2)&&a9_0x51dc1e(a9_0x3ef7df,{'children':[a9_0x51dc1e(Box,{'children':[a9_0x51dc1e(Text,{'bold':!![],'children':['\x20\x20',_0x42cc91,getRemainingSpaces(_0x1f57a7,_0x42cc91)]}),a9_0x51dc1e(Text,{'bold':!![],'children':[_0x584786(_0x454b92(0xe9)),getRemainingSpaces(_0x5a4f83,_0x42cc91)]}),a9_0x51dc1e(Text,{'bold':!![],'children':[_0x584786(_0x454b92(0xd1)),getRemainingSpaces(_0x5a4f83,_0x42cc91)]})]}),_0x3f4eac[_0x454b92(0xc9)](_0xc91742=>a9_0x51dc1e(Box,{'children':[a9_0x51dc1e(Text,{'children':['\x20\x20',_0xc91742['label'],getRemainingSpaces(_0x1f57a7,_0xc91742[_0x454b92(0xc6)])]}),a9_0x51dc1e(Text,{'color':_0x454b92(0xb4),'children':[_0xc91742[_0x454b92(0xdb)]?'✓':'✗',getRemainingSpaces(_0x5a4f83,'✓')]}),a9_0x51dc1e(Text,{'color':_0xc91742[_0x454b92(0xc4)]?'green':_0x454b92(0xc3),'children':[_0xc91742[_0x454b92(0xc4)]?'✓':'✗',getRemainingSpaces(_0x5a4f83,'✓')]})]},_0xc91742[_0x454b92(0xd7)]))]}),_0x174d1e==='selecting'&&_0xdcfe21[_0x454b92(0xb7)]===0x0&&a9_0x405f8f(Box,{'marginTop':0x1,'children':a9_0x405f8f(Text,{'color':_0x454b92(0xa3),'children':_0x584786(_0x454b92(0xbc))})}),_0xdcfe21[_0x454b92(0xc9)]((_0x294e78,_0x236433)=>a9_0x51dc1e(Box,{'children':[a9_0x51dc1e(Text,{'color':_0x454b92(0xb4),'children':['√\x20',_0x294e78[_0x454b92(0xc6)],':\x20']}),a9_0x405f8f(Text,{'color':'cyan','children':_0x294e78[_0x454b92(0xbd)]})]},_0x236433)),_0x187af2&&_0x174d1e===_0x454b92(0xb2)&&a9_0x405f8f(Box,{'marginTop':0x1,'children':a9_0x51dc1e(Text,{'color':_0x454b92(0xc3),'children':['✗\x20',_0x187af2]})}),_0x174d1e===_0x454b92(0xb2)&&a9_0x405f8f(a9_0x3ef7df,{'children':a9_0x51dc1e(Box,{'marginTop':_0xdcfe21[_0x454b92(0xb7)]>0x0||_0x187af2?0x1:0x0,'flexDirection':_0x454b92(0xbe),'children':[a9_0x405f8f(Text,{'bold':!![],'children':_0x584786('appMenu.sync.step.selectMenus')}),_0x5c9202['map']((_0x142937,_0x271a14)=>{const _0x3e4f7d=_0x454b92,_0xc7b259=_0x2dee92===_0x271a14,_0x386e3f=_0x3564c2[_0x3e4f7d(0xaf)](_0x271a14),_0x3b7b83=_0x5e9365[_0x3e4f7d(0xb8)](_0x142937[_0x3e4f7d(0xd7)]),_0x442495=_0x3b7b83?_0x584786(_0x3e4f7d(0xe2)):_0x584786(_0x3e4f7d(0xe1));return a9_0x405f8f(Box,{'children':a9_0x51dc1e(Text,{'backgroundColor':_0xc7b259?'blue':undefined,'color':_0xc7b259?_0x3e4f7d(0xc1):undefined,'children':['\x20\x20',_0x386e3f?_0x3e4f7d(0xb5):_0x3e4f7d(0xb9),'\x20',_0x142937['label']]})},_0x142937[_0x3e4f7d(0xd7)]);}),a9_0x405f8f(Box,{'marginTop':0x1,'children':a9_0x51dc1e(Text,{'color':'gray','children':['\x20',_0x584786(_0x454b92(0xcf))]})})]})}),_0x174d1e==='input-js'&&a9_0x51dc1e(a9_0x3ef7df,{'children':[a9_0x51dc1e(Box,{'children':[a9_0x405f8f(Text,{'children':_0x584786(_0x454b92(0xdd))}),a9_0x405f8f(Text,{'color':_0x454b92(0xb4),'children':_0x11d708}),_0x187af2&&a9_0x51dc1e(Text,{'color':_0x454b92(0xc3),'children':[_0x454b92(0xd3),_0x187af2]})]}),!_0x187af2&&a9_0x405f8f(Box,{'children':a9_0x405f8f(Text,{'color':'gray','children':_0x584786('appMenu.sync.input.jsUrl.placeholder')})})]}),_0x174d1e===_0x454b92(0xca)&&a9_0x51dc1e(a9_0x3ef7df,{'children':[a9_0x51dc1e(Box,{'children':[a9_0x405f8f(Text,{'children':_0x584786(_0x454b92(0xcd))}),a9_0x405f8f(Text,{'color':'green','children':_0x11d708}),_0x187af2&&a9_0x51dc1e(Text,{'color':'red','children':[_0x454b92(0xd3),_0x187af2]})]}),!_0x187af2&&a9_0x405f8f(Box,{'children':a9_0x405f8f(Text,{'color':_0x454b92(0xba),'children':_0x584786(_0x454b92(0xde))})})]}),_0x174d1e===_0x454b92(0xa7)&&a9_0x405f8f(Box,{'children':a9_0x405f8f(Text,{'children':_0x584786(_0x454b92(0xdc))})}),_0x174d1e===_0x454b92(0xd8)&&a9_0x405f8f(Box,{'children':a9_0x405f8f(Text,{'color':_0x454b92(0xb4),'children':_0x584786(_0x454b92(0xbb))})})]});}function getStringWidth(_0x2b8cbf){const _0x48b257=a9_0x5f21;let _0x90e1ee=0x0;for(const _0x213d26 of _0x2b8cbf){/[\u4e00-\u9fa5]/[_0x48b257(0xc2)](_0x213d26)?_0x90e1ee+=0x2:_0x90e1ee+=0x1;}return _0x90e1ee;}function getRemainingSpaces(_0x307556,_0x40a6bc){const _0x3db6f1=a9_0x5f21,_0x616b64=getStringWidth(_0x40a6bc);return Array(Math[_0x3db6f1(0xc0)](0x0,_0x307556-_0x616b64))[_0x3db6f1(0xee)]('\x20')[_0x3db6f1(0xd9)]('');}function getMaxWidth(_0x6d507e,_0x567cdd=0x2){const _0x3050b4=a9_0x5f21;let _0x4b1a0c='',_0x5065cd=0x0;for(const _0x407a43 of _0x6d507e){const _0x461d33=getStringWidth(_0x407a43);_0x461d33>_0x5065cd&&(_0x5065cd=_0x461d33,_0x4b1a0c=_0x407a43);}return _0x4b1a0c+'\x20'[_0x3050b4(0xeb)](_0x567cdd);}
|
|
1
|
+
(function(_0x29569a,_0x26f2d2){const _0x21e23f=a9_0x2748,_0x355236=_0x29569a();while(!![]){try{const _0x17340d=parseInt(_0x21e23f(0xcc))/0x1+-parseInt(_0x21e23f(0xd0))/0x2*(parseInt(_0x21e23f(0xa3))/0x3)+-parseInt(_0x21e23f(0xa6))/0x4*(-parseInt(_0x21e23f(0xd2))/0x5)+parseInt(_0x21e23f(0xce))/0x6+parseInt(_0x21e23f(0xd4))/0x7+parseInt(_0x21e23f(0xd1))/0x8*(-parseInt(_0x21e23f(0xc4))/0x9)+-parseInt(_0x21e23f(0xe8))/0xa;if(_0x17340d===_0x26f2d2)break;else _0x355236['push'](_0x355236['shift']());}catch(_0xff78c3){_0x355236['push'](_0x355236['shift']());}}}(a9_0x4a46,0x71588));import{jsx as a9_0x321245,jsxs as a9_0x1cae30,Fragment as a9_0x4ff900}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a9_0x13f304 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';function a9_0x4a46(){const _0x2d3ed7=['appMenu.sync.step.creating','delete','dots','test','gray','column','return','appMenu.sync.loading.fetchingMenuList','online','backspace','includes','red','appMenu.sync.table.lovrabetPlatform','appMenu.sync.error.noLocalPages','appMenu.sync.input.jsUrl.label','appMenu.sync.operation.create','repeat','upArrow','appMenu.sync.input.jsUrl.placeholder','appMenu.sync.input.cssUrl.placeholder','length','slice','trim','appMenu.sync.step.jsUrl','message','9wwpqZp','[✓]','appMenu.sync.step.cssUrl','appMenu.sync.table.local','has','filter','appMenu.sync.error.authHint.prefix','creating','621334TenKBh','blue','421218whcmfs','path','14LCOLaL','2850008xiYEbT','91600brjjvQ','appMenu.sync.error.invalidCssUrl','5876115uRCwbJ','appMenu.sync.error.cssUrlUnreachable','appMenu.sync.error.createMenuFailed','label','appMenu.sync.operation.update','appMenu.sync.step.completed','[\x20]','catch','appMenu.sync.table.menuName','map','green','add','white','size','appMenu.sync.error.authHint.suffix','value','appMenu.sync.input.cssUrl.label','join','appMenu.sync.title','fill','12177250JruwZg','input-js','input-css','done','appMenu.sync.error.invalidJsUrl','selecting','25998tvRRYk','cyan','\x20←\x20','124WlOBDF','appMenu.sync.step.selectedMenusCount','max','appMenu.sync.error.jsUrlUnreachable','appMenu.sync.hotkeys'];a9_0x4a46=function(){return _0x2d3ed7;};return a9_0x4a46();}import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import{useI18n}from'../i18n/hooks.js';import.meta.main&&render(a9_0x321245(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x5886a0=a9_0x2748,{exit:_0x2e1200}=useApp(),{t:_0x429c93}=useI18n(),{loading:_0x40027e,menuList:_0x575a65,error:_0x21cb34}=useGetOnlineMenuList(),_0x49c52b=getLocalPages(),_0x130192=_0x575a65['map'](_0x572b5f=>_0x572b5f[_0x5886a0(0xcf)]),_0xe41fdf=_0x429c93(_0x5886a0(0xdc)),_0x2b8765=[_0xe41fdf,..._0x49c52b[_0x5886a0(0xdd)](_0x5794c8=>_0x5794c8['label'])],_0x5891ce=getStringWidth(getMaxWidth(_0x2b8765,0x4)),_0x3adfbf=getStringWidth(getMaxWidth([_0xe41fdf])),[_0xf67d25,_0x114cd1]=useState(_0x5886a0(0xa2)),[_0x17e92c,_0x1817a4]=useState(new Set()),[_0x28ae5c,_0x128120]=useState(0x0),[_0xeb717,_0x5bb623]=useState(''),[_0x35e591,_0x3fc806]=useState(''),[_0x30aefe,_0x51ad5a]=useState(''),[_0x25b4a9,_0x5a0bf8]=useState(''),[_0x16d2dc,_0x3ccc97]=useState([]),_0x2a3286=_0x49c52b[_0x5886a0(0xdd)](_0x17f816=>({'label':_0x17f816['label'],'path':_0x17f816['path'],'local':!![],'online':_0x130192[_0x5886a0(0xb5)](_0x17f816[_0x5886a0(0xcf)])})),_0x5188e0=_0x49c52b[_0x5886a0(0xc9)](_0x3bd73d=>{const _0x2d6d1d=_0x5886a0;return!_0x130192[_0x2d6d1d(0xb5)](_0x3bd73d[_0x2d6d1d(0xcf)]);});useEffect(()=>{const _0x51e15a=_0x5886a0;if(!_0x40027e&&_0x49c52b[_0x51e15a(0xbf)]>0x0&&_0x17e92c[_0x51e15a(0xe1)]===0x0){const _0x5f2a85=new Set(_0x49c52b['map']((_0x2947db,_0x3496e3)=>({'page':_0x2947db,'index':_0x3496e3}))[_0x51e15a(0xc9)](({page:_0x2b7553})=>!_0x130192[_0x51e15a(0xb5)](_0x2b7553[_0x51e15a(0xcf)]))[_0x51e15a(0xdd)](({index:_0x173c93})=>_0x173c93));_0x1817a4(_0x5f2a85);}},[_0x40027e,_0x49c52b['length'],_0x130192[_0x5886a0(0xbf)]]),useInput(async(_0x88986b,_0x286189)=>{const _0x1d87cf=_0x5886a0;if(_0xf67d25===_0x1d87cf(0xa2)){if(_0x286189[_0x1d87cf(0xbc)]){_0x128120(_0x57b93d=>_0x57b93d>0x0?_0x57b93d-0x1:_0x49c52b['length']-0x1);return;}if(_0x286189['downArrow']){_0x128120(_0x487e24=>_0x487e24<_0x49c52b[_0x1d87cf(0xbf)]-0x1?_0x487e24+0x1:0x0);return;}if(_0x88986b==='\x20'){_0x1817a4(_0x5a282f=>{const _0x52da9e=_0x1d87cf,_0xf217e=new Set(_0x5a282f);return _0xf217e[_0x52da9e(0xc8)](_0x28ae5c)?_0xf217e[_0x52da9e(0xac)](_0x28ae5c):_0xf217e[_0x52da9e(0xdf)](_0x28ae5c),_0xf217e;});return;}if(_0x88986b==='a'||_0x88986b==='A'){const _0x1e534d=new Set(_0x49c52b[_0x1d87cf(0xdd)]((_0x1e793b,_0x83e89a)=>_0x83e89a));_0x1817a4(_0x1e534d);return;}if(_0x88986b==='i'||_0x88986b==='I'||_0x88986b==='r'||_0x88986b==='R'){_0x1817a4(_0x3e083c=>{const _0x3e0fac=_0x1d87cf,_0x114514=new Set();for(let _0x24da92=0x0;_0x24da92<_0x49c52b[_0x3e0fac(0xbf)];_0x24da92++){!_0x3e083c[_0x3e0fac(0xc8)](_0x24da92)&&_0x114514[_0x3e0fac(0xdf)](_0x24da92);}return _0x114514;});return;}if(_0x88986b==='q'||_0x88986b==='Q'){_0x2e1200();return;}if(_0x286189[_0x1d87cf(0xb1)]){if(_0x17e92c[_0x1d87cf(0xe1)]===0x0){_0x5a0bf8(_0x429c93('appMenu.sync.error.noMenuSelected'));return;}const _0x2604ab=_0x49c52b[_0x1d87cf(0xc9)]((_0x27339d,_0x4b41a0)=>_0x17e92c[_0x1d87cf(0xc8)](_0x4b41a0)),_0x2fbf09=_0x2604ab['map'](_0x5dcf8a=>_0x5dcf8a['label'])[_0x1d87cf(0xe5)](',\x20');_0x3ccc97([{'label':_0x429c93('appMenu.sync.step.selectedMenus'),'value':_0x429c93(_0x1d87cf(0xa7),{'count':_0x17e92c[_0x1d87cf(0xe1)]})}]),_0x5a0bf8(''),_0x114cd1(_0x1d87cf(0xe9));return;}return;}if(_0xf67d25===_0x1d87cf(0xe9)){if(_0x286189['return']){const _0x31c31e=_0x30aefe[_0x1d87cf(0xc1)]();if(_0x31c31e==='')return;if(!isValidJsHttpsUrl(_0x31c31e)){_0x5a0bf8(_0x429c93(_0x1d87cf(0xa1)));return;}if(!await isUrlReachable(_0x31c31e)){_0x5a0bf8(_0x429c93(_0x1d87cf(0xa9)));return;}_0x5bb623(_0x31c31e),_0x3ccc97(_0x3cc967=>[..._0x3cc967,{'label':_0x429c93(_0x1d87cf(0xc2)),'value':_0x31c31e}]),_0x51ad5a(''),_0x5a0bf8(''),_0x114cd1(_0x1d87cf(0xea));return;}if(_0x286189[_0x1d87cf(0xb4)]||_0x286189['delete']){_0x51ad5a(_0x148af5=>_0x148af5[_0x1d87cf(0xc0)](0x0,-0x1)),_0x5a0bf8('');return;}_0x51ad5a(_0xdec1cb=>_0xdec1cb+_0x88986b);return;}if(_0xf67d25==='input-css'){if(_0x286189[_0x1d87cf(0xb1)]){const _0x10970a=_0x30aefe[_0x1d87cf(0xc1)]();if(_0x10970a==='')return;if(!isValidCssHttpsUrl(_0x10970a)){_0x5a0bf8(_0x429c93(_0x1d87cf(0xd3)));return;}if(!await isUrlReachable(_0x10970a)){_0x5a0bf8(_0x429c93(_0x1d87cf(0xd5)));return;}_0x3fc806(_0x10970a),_0x3ccc97(_0x3bb396=>[..._0x3bb396,{'label':_0x429c93(_0x1d87cf(0xc6)),'value':_0x10970a}]),_0x51ad5a(''),_0x5a0bf8(''),_0x114cd1('creating');const _0x24c066=_0x49c52b['filter']((_0x52324a,_0x34a46e)=>_0x17e92c['has'](_0x34a46e));createMenus(_0x24c066,[_0xeb717,_0x10970a])['then'](()=>{const _0xd16719=_0x1d87cf;_0x114cd1(_0xd16719(0xa0)),setTimeout(()=>{_0x2e1200();},0x3e8);})[_0x1d87cf(0xdb)](_0xe28536=>{const _0x1e397d=_0x1d87cf;_0x5a0bf8(_0xe28536[_0x1e397d(0xc3)]||_0x429c93(_0x1e397d(0xd6))),_0x114cd1(_0x1e397d(0xa2));});return;}if(_0x286189[_0x1d87cf(0xb4)]||_0x286189[_0x1d87cf(0xac)]){_0x51ad5a(_0x2b76c5=>_0x2b76c5[_0x1d87cf(0xc0)](0x0,-0x1)),_0x5a0bf8('');return;}_0x51ad5a(_0x5563b3=>_0x5563b3+_0x88986b);return;}});if(_0x40027e)return a9_0x1cae30(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a9_0x321245(Text,{'children':'\x20\x20'}),a9_0x321245(a9_0x13f304,{'type':_0x5886a0(0xad)}),a9_0x321245(Text,{'children':_0x429c93(_0x5886a0(0xb2))})]});if(_0x21cb34)return a9_0x1cae30(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a9_0x1cae30(Text,{'color':_0x5886a0(0xb6),'children':['✗\x20',_0x21cb34]}),a9_0x1cae30(Box,{'marginTop':0x1,'children':[a9_0x321245(Text,{'color':'gray','children':_0x429c93(_0x5886a0(0xca))}),a9_0x321245(Text,{'color':_0x5886a0(0xa4),'children':'lovrabet\x20auth'}),a9_0x321245(Text,{'color':_0x5886a0(0xaf),'children':_0x429c93(_0x5886a0(0xe2))})]})]});if(_0x49c52b[_0x5886a0(0xbf)]===0x0)return a9_0x321245(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a9_0x321245(Text,{'color':'yellow','children':_0x429c93(_0x5886a0(0xb8))})});return a9_0x1cae30(Box,{'flexDirection':_0x5886a0(0xb0),'marginTop':0x1,'marginBottom':0x1,'children':[_0xf67d25===_0x5886a0(0xa2)&&a9_0x1cae30(a9_0x4ff900,{'children':[a9_0x1cae30(Box,{'children':[a9_0x1cae30(Text,{'bold':!![],'children':['\x20\x20',_0xe41fdf,getRemainingSpaces(_0x5891ce,_0xe41fdf)]}),a9_0x1cae30(Text,{'bold':!![],'children':[_0x429c93(_0x5886a0(0xc7)),getRemainingSpaces(_0x3adfbf,_0xe41fdf)]}),a9_0x1cae30(Text,{'bold':!![],'children':[_0x429c93(_0x5886a0(0xb7)),getRemainingSpaces(_0x3adfbf,_0xe41fdf)]})]}),_0x2a3286['map'](_0x354a12=>a9_0x1cae30(Box,{'children':[a9_0x1cae30(Text,{'children':['\x20\x20',_0x354a12[_0x5886a0(0xd7)],getRemainingSpaces(_0x5891ce,_0x354a12['label'])]}),a9_0x1cae30(Text,{'color':_0x5886a0(0xde),'children':[_0x354a12['local']?'✓':'✗',getRemainingSpaces(_0x3adfbf,'✓')]}),a9_0x1cae30(Text,{'color':_0x354a12[_0x5886a0(0xb3)]?_0x5886a0(0xde):'red','children':[_0x354a12[_0x5886a0(0xb3)]?'✓':'✗',getRemainingSpaces(_0x3adfbf,'✓')]})]},_0x354a12[_0x5886a0(0xcf)]))]}),_0xf67d25===_0x5886a0(0xa2)&&_0x16d2dc[_0x5886a0(0xbf)]===0x0&&a9_0x321245(Box,{'marginTop':0x1,'children':a9_0x321245(Text,{'color':_0x5886a0(0xa4),'children':_0x429c93(_0x5886a0(0xe6))})}),_0x16d2dc[_0x5886a0(0xdd)]((_0x52d199,_0x5c7790)=>a9_0x1cae30(Box,{'children':[a9_0x1cae30(Text,{'color':_0x5886a0(0xde),'children':['√\x20',_0x52d199[_0x5886a0(0xd7)],':\x20']}),a9_0x321245(Text,{'color':_0x5886a0(0xa4),'children':_0x52d199[_0x5886a0(0xe3)]})]},_0x5c7790)),_0x25b4a9&&_0xf67d25===_0x5886a0(0xa2)&&a9_0x321245(Box,{'marginTop':0x1,'children':a9_0x1cae30(Text,{'color':_0x5886a0(0xb6),'children':['✗\x20',_0x25b4a9]})}),_0xf67d25===_0x5886a0(0xa2)&&a9_0x321245(a9_0x4ff900,{'children':a9_0x1cae30(Box,{'marginTop':_0x16d2dc[_0x5886a0(0xbf)]>0x0||_0x25b4a9?0x1:0x0,'flexDirection':_0x5886a0(0xb0),'children':[a9_0x321245(Text,{'bold':!![],'children':_0x429c93('appMenu.sync.step.selectMenus')}),_0x49c52b[_0x5886a0(0xdd)]((_0x2ac015,_0x555a1e)=>{const _0x17eda8=_0x5886a0,_0x4683ef=_0x28ae5c===_0x555a1e,_0x29fcb2=_0x17e92c['has'](_0x555a1e),_0x407076=_0x130192['includes'](_0x2ac015[_0x17eda8(0xcf)]),_0x197c23=_0x407076?_0x429c93(_0x17eda8(0xd8)):_0x429c93(_0x17eda8(0xba));return a9_0x321245(Box,{'children':a9_0x1cae30(Text,{'backgroundColor':_0x4683ef?_0x17eda8(0xcd):undefined,'color':_0x4683ef?_0x17eda8(0xe0):undefined,'children':['\x20\x20',_0x29fcb2?_0x17eda8(0xc5):_0x17eda8(0xda),'\x20',_0x2ac015[_0x17eda8(0xd7)]]})},_0x2ac015[_0x17eda8(0xcf)]);}),a9_0x321245(Box,{'marginTop':0x1,'children':a9_0x1cae30(Text,{'color':_0x5886a0(0xaf),'children':['\x20',_0x429c93(_0x5886a0(0xaa))]})})]})}),_0xf67d25===_0x5886a0(0xe9)&&a9_0x1cae30(a9_0x4ff900,{'children':[a9_0x1cae30(Box,{'children':[a9_0x321245(Text,{'children':_0x429c93(_0x5886a0(0xb9))}),a9_0x321245(Text,{'color':_0x5886a0(0xde),'children':_0x30aefe}),_0x25b4a9&&a9_0x1cae30(Text,{'color':_0x5886a0(0xb6),'children':[_0x5886a0(0xa5),_0x25b4a9]})]}),!_0x25b4a9&&a9_0x321245(Box,{'children':a9_0x321245(Text,{'color':'gray','children':_0x429c93(_0x5886a0(0xbd))})})]}),_0xf67d25===_0x5886a0(0xea)&&a9_0x1cae30(a9_0x4ff900,{'children':[a9_0x1cae30(Box,{'children':[a9_0x321245(Text,{'children':_0x429c93(_0x5886a0(0xe4))}),a9_0x321245(Text,{'color':_0x5886a0(0xde),'children':_0x30aefe}),_0x25b4a9&&a9_0x1cae30(Text,{'color':_0x5886a0(0xb6),'children':[_0x5886a0(0xa5),_0x25b4a9]})]}),!_0x25b4a9&&a9_0x321245(Box,{'children':a9_0x321245(Text,{'color':'gray','children':_0x429c93(_0x5886a0(0xbe))})})]}),_0xf67d25===_0x5886a0(0xcb)&&a9_0x321245(Box,{'children':a9_0x321245(Text,{'children':_0x429c93(_0x5886a0(0xab))})}),_0xf67d25==='done'&&a9_0x321245(Box,{'children':a9_0x321245(Text,{'color':'green','children':_0x429c93(_0x5886a0(0xd9))})})]});}function getStringWidth(_0x1fd551){const _0x48003b=a9_0x2748;let _0x861b89=0x0;for(const _0x2b0fe0 of _0x1fd551){/[\u4e00-\u9fa5]/[_0x48003b(0xae)](_0x2b0fe0)?_0x861b89+=0x2:_0x861b89+=0x1;}return _0x861b89;}function getRemainingSpaces(_0x49fa89,_0x1c8b7e){const _0x1fbbc8=a9_0x2748,_0x18c703=getStringWidth(_0x1c8b7e);return Array(Math[_0x1fbbc8(0xa8)](0x0,_0x49fa89-_0x18c703))[_0x1fbbc8(0xe7)]('\x20')[_0x1fbbc8(0xe5)]('');}function a9_0x2748(_0x54d9fd,_0x9916af){_0x54d9fd=_0x54d9fd-0xa0;const _0x4a46d8=a9_0x4a46();let _0x2748d4=_0x4a46d8[_0x54d9fd];return _0x2748d4;}function getMaxWidth(_0xb6bf2b,_0x128786=0x2){const _0x132436=a9_0x2748;let _0x2fb6e0='',_0x3ba82c=0x0;for(const _0x1a959b of _0xb6bf2b){const _0x2a1047=getStringWidth(_0x1a959b);_0x2a1047>_0x3ba82c&&(_0x3ba82c=_0x2a1047,_0x2fb6e0=_0x1a959b);}return _0x2fb6e0+'\x20'[_0x132436(0xbb)](_0x128786);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a10_0x52c204=a10_0x1422;(function(_0x4e0e3a,_0x42e928){const _0x3354f5=a10_0x1422,_0x4dfac2=_0x4e0e3a();while(!![]){try{const _0x10bb64=parseInt(_0x3354f5(0xdd))/0x1+parseInt(_0x3354f5(0xd5))/0x2+-parseInt(_0x3354f5(0xfc))/0x3*(parseInt(_0x3354f5(0xf5))/0x4)+-parseInt(_0x3354f5(0xf3))/0x5*(-parseInt(_0x3354f5(0xdb))/0x6)+-parseInt(_0x3354f5(0xd8))/0x7*(parseInt(_0x3354f5(0xf4))/0x8)+parseInt(_0x3354f5(0xfe))/0x9*(-parseInt(_0x3354f5(0xea))/0xa)+parseInt(_0x3354f5(0xe4))/0xb;if(_0x10bb64===_0x42e928)break;else _0x4dfac2['push'](_0x4dfac2['shift']());}catch(_0x373c15){_0x4dfac2['push'](_0x4dfac2['shift']());}}}(a10_0x839e,0x1bad3));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';import a10_0x64eba2 from'../i18n/index.js';const config=readConfig(),t=a10_0x64eba2['t'][a10_0x52c204(0xe0)](a10_0x64eba2);export async function createMenu(_0x5e1662){const _0x3c0b94=a10_0x52c204,_0x420cf4=config?.[_0x3c0b94(0xd3)];if(!_0x420cf4){const _0x54300f=t(_0x3c0b94(0xe8));logger[_0x3c0b94(0xe1)](_0x3c0b94(0xf0),_0x54300f),console[_0x3c0b94(0xe1)]('×\x20'+_0x54300f),console[_0x3c0b94(0xfd)](t(_0x3c0b94(0xee))),console[_0x3c0b94(0xfd)](t(_0x3c0b94(0xe2))),console[_0x3c0b94(0xfd)](t(_0x3c0b94(0xfa)));return;}logger['info']('create-menu',t('appMenu.creating.single',{'label':_0x5e1662[_0x3c0b94(0xed)],'path':_0x5e1662[_0x3c0b94(0xfb)]}));const _0x3ca935={'appCode':_0x420cf4,'type':'procode','sort':0x0,'extend':{'loadScriptMode':_0x3c0b94(0xde),'resources':_0x5e1662[_0x3c0b94(0xf7)]?JSON[_0x3c0b94(0xd9)](_0x5e1662[_0x3c0b94(0xf7)]):undefined},..._0x5e1662},_0x372f32=await fetch(getApiDomain()+_0x3c0b94(0xda),{'method':'POST','body':JSON[_0x3c0b94(0xd9)](_0x3ca935),'headers':{'Content-Type':_0x3c0b94(0xe7),'Cookie':getCookie()}});if(!_0x372f32['ok']){if(_0x372f32['status']===0x191){const _0x1ed793=t(_0x3c0b94(0xd2));logger['error'](_0x3c0b94(0xf0),_0x1ed793,{'status':_0x372f32[_0x3c0b94(0xd1)],'menu':_0x5e1662[_0x3c0b94(0xed)]});throw new Error(_0x1ed793);}const _0x5a08e6=t(_0x3c0b94(0xd6),{'status':_0x372f32['status']});logger[_0x3c0b94(0xe1)](_0x3c0b94(0xf0),_0x5a08e6,{'menu':_0x5e1662[_0x3c0b94(0xed)]});throw new Error(_0x5a08e6);}const _0x4f9c0a=await _0x372f32[_0x3c0b94(0xf6)]();if(!_0x4f9c0a[_0x3c0b94(0xe3)]){const _0x457948=t(_0x3c0b94(0xd7),{'error':_0x4f9c0a[_0x3c0b94(0xeb)]||t(_0x3c0b94(0xd4))});logger[_0x3c0b94(0xe1)]('create-menu',_0x457948,{'errorCode':_0x4f9c0a[_0x3c0b94(0xdc)],'errorMsg':_0x4f9c0a[_0x3c0b94(0xeb)],'menu':_0x5e1662[_0x3c0b94(0xed)]});throw new Error(_0x457948);}logger[_0x3c0b94(0xe9)](_0x3c0b94(0xf0),''+t(_0x3c0b94(0xf9))+_0x5e1662[_0x3c0b94(0xed)],_0x4f9c0a[_0x3c0b94(0xf8)]),console[_0x3c0b94(0xfd)](t(_0x3c0b94(0xf9)),_0x4f9c0a[_0x3c0b94(0xf8)]);}function a10_0x1422(_0x3fabc4,_0x54bc9c){_0x3fabc4=_0x3fabc4-0xd0;const _0x839ebe=a10_0x839e();let _0x14225e=_0x839ebe[_0x3fabc4];return _0x14225e;}function a10_0x839e(){const _0x10c785=['597822NjMLXL','log','34227txPXns','length','status','appMenu.error.authExpired','appcode','common.error','362174gEctHY','appMenu.error.createHttpStatus','appMenu.error.createFailed','7GBYJlE','stringify','/smartapi/menu/create','6JZgnWK','errorCode','56394RcWXYk','import','appMenu.error.authValidationFailed','bind','error','appMenu.error.appCodeHint.option1','success','586355uGvmOJ','0011','map','application/json','appMenu.error.missingAppCode','info','150wvbhjT','errorMsg','all','label','appMenu.error.appCodeHint.title','includes','create-menu','appMenu.creating.batch.start','POST','1068055TuOgAw','1077720nanokX','4xIefqv','json','resources','data','appMenu.success.created','appMenu.error.appCodeHint.option2','path'];a10_0x839e=function(){return _0x10c785;};return a10_0x839e();}async function _createMenu(_0x4ea4bf,_0x1f0c74){const _0x40e4b7=a10_0x52c204,_0x2cbd11=config?.[_0x40e4b7(0xd3)];if(!_0x2cbd11){const _0x3516f1=t(_0x40e4b7(0xe8));logger[_0x40e4b7(0xe1)](_0x40e4b7(0xf0),_0x3516f1),console[_0x40e4b7(0xe1)]('×\x20'+_0x3516f1),console[_0x40e4b7(0xfd)](t(_0x40e4b7(0xee))),console[_0x40e4b7(0xfd)](t(_0x40e4b7(0xe2))),console[_0x40e4b7(0xfd)](t(_0x40e4b7(0xfa)));return;}const _0x2cfb8c={'appCode':_0x2cbd11,'type':'procode','sort':0x0,'extend':{'loadScriptMode':_0x40e4b7(0xde),'resources':_0x1f0c74?JSON[_0x40e4b7(0xd9)](_0x1f0c74):undefined},'label':_0x4ea4bf[_0x40e4b7(0xed)],'path':_0x4ea4bf[_0x40e4b7(0xfb)]},_0x3d3b4f=await fetch(getApiDomain()+'/smartapi/menu/create',{'method':_0x40e4b7(0xf2),'body':JSON[_0x40e4b7(0xd9)](_0x2cfb8c),'headers':{'Content-Type':_0x40e4b7(0xe7),'Cookie':getCookie()}});if(!_0x3d3b4f['ok']){if(_0x3d3b4f[_0x40e4b7(0xd1)]===0x191){const _0x5d4d68=t(_0x40e4b7(0xd2));logger['error'](_0x40e4b7(0xf0),_0x5d4d68,{'status':_0x3d3b4f[_0x40e4b7(0xd1)],'menu':_0x4ea4bf[_0x40e4b7(0xed)]});throw new Error(_0x5d4d68);}const _0x1a5c1a=t('appMenu.error.createHttpStatus',{'status':_0x3d3b4f['status']});logger[_0x40e4b7(0xe1)](_0x40e4b7(0xf0),_0x1a5c1a,{'menu':_0x4ea4bf[_0x40e4b7(0xed)]});throw new Error(_0x1a5c1a);}const _0x2519e5=await _0x3d3b4f[_0x40e4b7(0xf6)]();if(!_0x2519e5[_0x40e4b7(0xe3)]){if(_0x2519e5[_0x40e4b7(0xdc)]===_0x40e4b7(0xe5)||_0x2519e5[_0x40e4b7(0xeb)]?.[_0x40e4b7(0xef)]('登录')){const _0x2b2ebd=t(_0x40e4b7(0xdf));logger['error'](_0x40e4b7(0xf0),_0x2b2ebd,{'errorCode':_0x2519e5[_0x40e4b7(0xdc)],'errorMsg':_0x2519e5[_0x40e4b7(0xeb)],'menu':_0x4ea4bf['label']});throw new Error(_0x2b2ebd);}const _0x3bb394=t('appMenu.error.createFailed',{'error':_0x2519e5[_0x40e4b7(0xeb)]||t(_0x40e4b7(0xd4))});logger[_0x40e4b7(0xe1)]('create-menu',_0x3bb394,{'errorCode':_0x2519e5[_0x40e4b7(0xdc)],'errorMsg':_0x2519e5[_0x40e4b7(0xeb)],'menu':_0x4ea4bf['label']});throw new Error(_0x3bb394);}logger[_0x40e4b7(0xe9)](_0x40e4b7(0xf0),''+t(_0x40e4b7(0xf9))+_0x4ea4bf[_0x40e4b7(0xed)]);}export async function createMenus(_0x14969a,_0x42d627){const _0xd3b8fe=a10_0x52c204;logger[_0xd3b8fe(0xe9)]('create-menus',t(_0xd3b8fe(0xf1),{'count':_0x14969a[_0xd3b8fe(0xd0)]})),await Promise[_0xd3b8fe(0xec)](_0x14969a[_0xd3b8fe(0xe6)](async _0x44b7f5=>{await _createMenu(_0x44b7f5,_0x42d627);})),logger[_0xd3b8fe(0xe9)]('create-menus',t('appMenu.creating.batch.completed',{'count':_0x14969a[_0xd3b8fe(0xd0)]}));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a11_0x19c511=a11_0x4ec6;function a11_0x3ac6(){const _0x4b700f=['cwd','.tsx','4898961TsTYll','match','60MdbDvv','36664XaWxgU','7570760aJyPOd','\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]','17464CmUXWb','459012QXGXZz','concat','slice','trim','src/pages','3659718QnhHLE','index.tsx','76Pnkpdx','forEach','utf-8','replace','123765bUoFkC','490eziUKe','endsWith'];a11_0x3ac6=function(){return _0x4b700f;};return a11_0x3ac6();}(function(_0x268d43,_0x3bcb00){const _0x10e9e0=a11_0x4ec6,_0x1435cf=_0x268d43();while(!![]){try{const _0x529d9f=parseInt(_0x10e9e0(0x1bd))/0x1+parseInt(_0x10e9e0(0x1bc))/0x2*(-parseInt(_0x10e9e0(0x1b8))/0x3)+parseInt(_0x10e9e0(0x1c4))/0x4*(parseInt(_0x10e9e0(0x1b1))/0x5)+parseInt(_0x10e9e0(0x1c2))/0x6+parseInt(_0x10e9e0(0x1b2))/0x7*(parseInt(_0x10e9e0(0x1b9))/0x8)+-parseInt(_0x10e9e0(0x1b6))/0x9+-parseInt(_0x10e9e0(0x1ba))/0xa;if(_0x529d9f===_0x3bcb00)break;else _0x1435cf['push'](_0x1435cf['shift']());}catch(_0x33847a){_0x1435cf['push'](_0x1435cf['shift']());}}}(a11_0x3ac6,0x5dc25));import{readdirSync,statSync,readFileSync}from'fs';import{join,relative,resolve}from'path';const pagesDir=resolve(process[a11_0x19c511(0x1b4)](),a11_0x19c511(0x1c1));export function extractTitleFromComment(_0x53523b){const _0x29ad7c=a11_0x19c511;try{const _0x4956a3=readFileSync(_0x53523b,_0x29ad7c(0x1c6)),_0x132502=_0x4956a3[_0x29ad7c(0x1b7)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x132502&&_0x132502[0x1]){const _0x1f93fb=_0x132502[0x1],_0x5b8e2e=_0x1f93fb[_0x29ad7c(0x1b7)](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x5b8e2e&&_0x5b8e2e[0x1])return _0x5b8e2e[0x1][_0x29ad7c(0x1c0)]();}let _0x3c53da=null;const _0x5e1b61=_0x4956a3[_0x29ad7c(0x1b7)](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x5e1b61&&_0x5e1b61[0x1]&&(_0x3c53da=_0x5e1b61[0x1]);if(!_0x3c53da){const _0xff5c7c=_0x4956a3[_0x29ad7c(0x1b7)](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0xff5c7c&&_0xff5c7c[0x1]&&(_0x3c53da=_0xff5c7c[0x1]);}if(_0x3c53da){const _0x29a6be=new RegExp('\x5cb'+_0x3c53da+_0x29ad7c(0x1bb)),_0xe8183e=_0x4956a3[_0x29ad7c(0x1b7)](_0x29a6be);if(_0xe8183e&&_0xe8183e[0x1])return _0xe8183e[0x1];return _0x3c53da;}return null;}catch(_0xbb631e){return null;}}function a11_0x4ec6(_0x2282b0,_0x3db0fb){_0x2282b0=_0x2282b0-0x1b0;const _0x3ac6e2=a11_0x3ac6();let _0x4ec613=_0x3ac6e2[_0x2282b0];return _0x4ec613;}export function getLocalPages(_0x5a080=pagesDir,_0xa9371f=pagesDir){const _0xc1dd0d=a11_0x19c511;let _0x10d837=[];const _0x39aa0d=readdirSync(_0x5a080);return _0x39aa0d[_0xc1dd0d(0x1c5)](_0xef633d=>{const _0x23a21f=_0xc1dd0d,_0x45816c=join(_0x5a080,_0xef633d),_0x1e01b6=statSync(_0x45816c);if(_0x1e01b6&&_0x1e01b6['isDirectory']())_0x10d837=_0x10d837[_0x23a21f(0x1be)](getLocalPages(_0x45816c,_0xa9371f));else{if(_0xef633d[_0x23a21f(0x1b3)](_0x23a21f(0x1b5))){let _0x59e335=relative(_0xa9371f,_0x45816c);_0x59e335[_0x23a21f(0x1b3)](_0x23a21f(0x1c3))?_0x59e335=_0x59e335[_0x23a21f(0x1b0)](/index\.tsx$/,''):_0x59e335=_0x59e335[_0x23a21f(0x1b0)](/\.tsx$/,'');_0x59e335['endsWith']('/')&&(_0x59e335=_0x59e335[_0x23a21f(0x1bf)](0x0,-0x1));const _0x3b0915=extractTitleFromComment(_0x45816c),_0xa7add6=_0x3b0915||_0x59e335;_0x10d837['push']({'path':_0x59e335['replaceAll']('$',':'),'label':_0xa7add6});}}}),_0x10d837['filter'](_0x3229a3=>_0x3229a3['path']!=='');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x161155,_0x53a0c1){const _0x4968d8=a12_0x146b,_0x590fc5=_0x161155();while(!![]){try{const _0x42dad2=-parseInt(_0x4968d8(0xee))/0x1*(-parseInt(_0x4968d8(0xf0))/0x2)+-parseInt(_0x4968d8(0x10a))/0x3+parseInt(_0x4968d8(0xe8))/0x4*(-parseInt(_0x4968d8(0xe9))/0x5)+-parseInt(_0x4968d8(0x109))/0x6+parseInt(_0x4968d8(0xf1))/0x7+parseInt(_0x4968d8(0x10f))/0x8*(-parseInt(_0x4968d8(0xff))/0x9)+-parseInt(_0x4968d8(0xea))/0xa*(-parseInt(_0x4968d8(0x10e))/0xb);if(_0x42dad2===_0x53a0c1)break;else _0x590fc5['push'](_0x590fc5['shift']());}catch(_0x374631){_0x590fc5['push'](_0x590fc5['shift']());}}}(a12_0x4d78,0xe7e44));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a12_0x4d78(){const _0x1347ef=['14533784zuVXhp','appMenu.fetching.online','32Sdmogy','970360rpzkIQ','590uzrQDz','map','label','log','1550597ljeiqQ','common.error','2YJLWrN','9491832VuIdgF','appcode','appMenu.error.httpStatus','errorCode','error','length','get-online-menu-list','application/json','online','path','push','appMenu.success.fetched','status','/smartapi/menu/find?appCode=','9zKKtWA','errorMsg','isArray','appMenu.error.appCodeHint.option1','children','appMenu.error.missingAppCode','GET','data','resources','parse','5694042zUvMUH','2581287uPMFQo','json','extend','info','600710HYEQrz'];a12_0x4d78=function(){return _0x1347ef;};return a12_0x4d78();}import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';import a12_0x1de3c2 from'../i18n/index.js';const config=readConfig(),t=a12_0x1de3c2['t']['bind'](a12_0x1de3c2);function a12_0x146b(_0x7c511c,_0x4b18db){_0x7c511c=_0x7c511c-0xe8;const _0x4d78ab=a12_0x4d78();let _0x146b25=_0x4d78ab[_0x7c511c];return _0x146b25;}export async function getOnlineMenuList(){const _0x33d86f=a12_0x146b,_0x58a85f=config?.[_0x33d86f(0xf2)];if(!_0x58a85f){const _0x10c591=t(_0x33d86f(0x104));return logger[_0x33d86f(0xf5)](_0x33d86f(0xf7),_0x10c591),console[_0x33d86f(0xf5)]('×\x20'+_0x10c591),console[_0x33d86f(0xed)](t('appMenu.error.appCodeHint.title')),console[_0x33d86f(0xed)](t(_0x33d86f(0x102))),console[_0x33d86f(0xed)](t('appMenu.error.appCodeHint.option2')),[];}const _0x18d991=getEnv();logger['info']('get-online-menu-list',_0x18d991===_0x33d86f(0xf9)?t(_0x33d86f(0x110),{'appCode':_0x58a85f}):t('appMenu.fetching.daily',{'appCode':_0x58a85f}));const _0x2487f6=await fetch(getApiDomain()+_0x33d86f(0xfe)+_0x58a85f,{'method':_0x33d86f(0x105),'headers':{'Content-Type':_0x33d86f(0xf8),'Cookie':getCookie()}});if(!_0x2487f6['ok']){if(_0x2487f6[_0x33d86f(0xfd)]===0x191){const _0x15fc96=t('appMenu.error.authExpired');logger[_0x33d86f(0xf5)]('get-online-menu-list',_0x15fc96,{'status':_0x2487f6[_0x33d86f(0xfd)]});throw new Error(_0x15fc96);}const _0x38ff67=t(_0x33d86f(0xf3),{'status':_0x2487f6[_0x33d86f(0xfd)]});logger[_0x33d86f(0xf5)](_0x33d86f(0xf7),_0x38ff67);throw new Error(_0x38ff67);}const _0x21b2a6=await _0x2487f6[_0x33d86f(0x10b)]();if(!_0x21b2a6['success']){const _0x12d86c=t('appMenu.error.fetchFailed',{'error':_0x21b2a6[_0x33d86f(0x100)]||t(_0x33d86f(0xef))});logger['error'](_0x33d86f(0xf7),_0x12d86c,{'errorCode':_0x21b2a6[_0x33d86f(0xf4)],'errorMsg':_0x21b2a6[_0x33d86f(0x100)]});throw new Error(_0x12d86c);}if(!_0x21b2a6[_0x33d86f(0x106)])return logger[_0x33d86f(0x10d)](_0x33d86f(0xf7),t('appMenu.info.emptyMenuList')),[];return logger[_0x33d86f(0x10d)](_0x33d86f(0xf7),t(_0x33d86f(0xfc),{'count':_0x21b2a6[_0x33d86f(0x106)][_0x33d86f(0xf6)]})),_0x21b2a6[_0x33d86f(0x106)][_0x33d86f(0xeb)](formatMenuList)['flat']();}function formatMenuList(_0x2e20d0){const _0x2411c1=a12_0x146b;let _0x489245=[];try{if(_0x2e20d0[_0x2411c1(0x10c)]?.[_0x2411c1(0x107)]){const _0x1e53c6=JSON[_0x2411c1(0x108)](_0x2e20d0[_0x2411c1(0x10c)][_0x2411c1(0x107)]);Array[_0x2411c1(0x101)](_0x1e53c6)&&(_0x489245=_0x1e53c6);}}catch(_0x3c7882){}const _0x2b2212=[{'id':_0x2e20d0['id'],'path':_0x2e20d0[_0x2411c1(0xfa)],'label':_0x2e20d0[_0x2411c1(0xec)],'resources':_0x489245}];if(_0x2e20d0[_0x2411c1(0x103)]&&_0x2e20d0[_0x2411c1(0x103)]['length']>0x0)for(const _0x195191 of _0x2e20d0['children']){_0x2b2212[_0x2411c1(0xfb)](...formatMenuList(_0x195191));}return _0x2b2212;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a14_0x561502=a14_0x20f8;function a14_0x20f8(_0x5f2a45,_0x4b70f0){_0x5f2a45=_0x5f2a45-0x14d;const _0x32d026=a14_0x32d0();let _0x20f8f5=_0x32d026[_0x5f2a45];return _0x20f8f5;}(function(_0x16b477,_0xf1bf3e){const _0x4a56fc=a14_0x20f8,_0xa9640a=_0x16b477();while(!![]){try{const _0x434779=-parseInt(_0x4a56fc(0x151))/0x1*(parseInt(_0x4a56fc(0x154))/0x2)+parseInt(_0x4a56fc(0x14e))/0x3*(-parseInt(_0x4a56fc(0x159))/0x4)+-parseInt(_0x4a56fc(0x15c))/0x5+parseInt(_0x4a56fc(0x155))/0x6+-parseInt(_0x4a56fc(0x15a))/0x7*(parseInt(_0x4a56fc(0x15b))/0x8)+parseInt(_0x4a56fc(0x152))/0x9+parseInt(_0x4a56fc(0x150))/0xa;if(_0x434779===_0xf1bf3e)break;else _0xa9640a['push'](_0xa9640a['shift']());}catch(_0x55b1a4){_0xa9640a['push'](_0xa9640a['shift']());}}}(a14_0x32d0,0xb6799));import{useEffect,useState}from'react';import{getOnlineMenuList}from'./get-online-menu-list.js';function a14_0x32d0(){const _0x4aad83=['appMenu.error.fetchFailed','39zjOLxs','catch','18554840xecTJT','61LIkagA','12088836AVpvpf','bind','39118nehrqa','7810386ngUGhp','finally','message','then','335588oQSreB','7zXoEHk','892024fhkidN','6788695YpPQuv'];a14_0x32d0=function(){return _0x4aad83;};return a14_0x32d0();}import a14_0x48381f from'../i18n/index.js';const t=a14_0x48381f['t'][a14_0x561502(0x153)](a14_0x48381f);export function useGetOnlineMenuList(){const [_0x4c2a88,_0x2dc9b2]=useState([]),[_0xa458c7,_0x57260b]=useState(!![]),[_0x2a6ca7,_0x2a04f9]=useState('');return useEffect(()=>{const _0xb13465=a14_0x20f8;_0x57260b(!![]),_0x2a04f9(''),getOnlineMenuList()[_0xb13465(0x158)](_0x2dc9b2)[_0xb13465(0x14f)](_0x2a611c=>{const _0x44cddc=_0xb13465;_0x2a04f9(_0x2a611c[_0x44cddc(0x157)]||t(_0x44cddc(0x14d),{'error':t('common.error')}));})[_0xb13465(0x156)](()=>_0x57260b(![]));},[]),{'menuList':_0x4c2a88,'loading':_0xa458c7,'error':_0x2a6ca7};}
|
package/lib/app-menu/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x31bca1,_0x354b3e){const _0x744785=a15_0x5a0a,_0x3e19f8=_0x31bca1();while(!![]){try{const _0x4ee930=-parseInt(_0x744785(0xab))/0x1+-parseInt(_0x744785(0xa8))/0x2*(parseInt(_0x744785(0xaf))/0x3)+parseInt(_0x744785(0xa5))/0x4*(parseInt(_0x744785(0xae))/0x5)+parseInt(_0x744785(0xa7))/0x6*(-parseInt(_0x744785(0xb1))/0x7)+parseInt(_0x744785(0xa6))/0x8+-parseInt(_0x744785(0xa9))/0x9+-parseInt(_0x744785(0xa4))/0xa*(-parseInt(_0x744785(0xa2))/0xb);if(_0x4ee930===_0x354b3e)break;else _0x3e19f8['push'](_0x3e19f8['shift']());}catch(_0x455132){_0x3e19f8['push'](_0x3e19f8['shift']());}}}(a15_0x14ae,0x55ad3));function a15_0x5a0a(_0x324991,_0x3e9c13){_0x324991=_0x324991-0xa2;const _0x14ae3a=a15_0x14ae();let _0x5a0a5c=_0x14ae3a[_0x324991];return _0x5a0a5c;}export function getRemainingSpaces(_0x3e9ace,_0x33e51c){const _0x23a3f1=a15_0x5a0a,_0x19c64f=getStringWidth(_0x33e51c);return Array(Math[_0x23a3f1(0xad)](0x0,_0x3e9ace-_0x19c64f))[_0x23a3f1(0xb0)]('\x20')[_0x23a3f1(0xac)]('');}export function getMaxWidth(_0xd86e2,_0x5744d6=0x2){const _0x13cba7=a15_0x5a0a;let _0x567e3e='',_0x197926=0x0;for(const _0x5a4692 of _0xd86e2){const _0x3570e6=getStringWidth(_0x5a4692);_0x3570e6>_0x197926&&(_0x197926=_0x3570e6,_0x567e3e=_0x5a4692);}return _0x567e3e+'\x20'[_0x13cba7(0xaa)](_0x5744d6);}function a15_0x14ae(){const _0x4d6aa5=['max','19230gfjPWo','3sNZbuN','fill','21baPbxP','10690207ktyhpC','test','10hHQfJU','672LKgEkE','1223168hfxyGJ','823434LEozEg','610966JkWhJM','3081528zEPTSN','repeat','360338nqRdAo','join'];a15_0x14ae=function(){return _0x4d6aa5;};return a15_0x14ae();}export function getStringWidth(_0xa351b9){const _0x4a7961=a15_0x5a0a;let _0x560688=0x0;for(const _0xb738cc of _0xa351b9){/[\u4e00-\u9fa5]/[_0x4a7961(0xa3)](_0xb738cc)?_0x560688+=0x2:_0x560688+=0x1;}return _0x560688;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x30fa1c,_0x477710){const _0x1e6faf=a16_0x1c03,_0x547280=_0x30fa1c();while(!![]){try{const _0x30bc82=parseInt(_0x1e6faf(0x152))/0x1+parseInt(_0x1e6faf(0x151))/0x2*(parseInt(_0x1e6faf(0x158))/0x3)+-parseInt(_0x1e6faf(0x15c))/0x4+parseInt(_0x1e6faf(0x15d))/0x5*(parseInt(_0x1e6faf(0x154))/0x6)+-parseInt(_0x1e6faf(0x15b))/0x7+-parseInt(_0x1e6faf(0x155))/0x8*(-parseInt(_0x1e6faf(0x153))/0x9)+-parseInt(_0x1e6faf(0x15a))/0xa;if(_0x30bc82===_0x477710)break;else _0x547280['push'](_0x547280['shift']());}catch(_0x2042e0){_0x547280['push'](_0x547280['shift']());}}}(a16_0x397c,0xc8a96));export function isValidJsHttpsUrl(_0x1842e6){const _0x400430=a16_0x1c03;return/^https:\/\/.+\.js(\?.*)?$/['test'](_0x1842e6[_0x400430(0x157)]());}function a16_0x1c03(_0x385681,_0x46b824){_0x385681=_0x385681-0x151;const _0x397c61=a16_0x397c();let _0x1c03a9=_0x397c61[_0x385681];return _0x1c03a9;}export function isValidCssHttpsUrl(_0x546f2b){const _0x598e48=a16_0x1c03;return/^https:\/\/.+\.css(\?.*)?$/[_0x598e48(0x156)](_0x546f2b[_0x598e48(0x157)]());}function a16_0x397c(){const _0x446525=['42GLuKvD','7768NmgpVm','test','trim','2121192UIXigp','HEAD','5943900NCTEZz','10224795HJNbhl','3782792qdbFyr','283585IqGFbz','4sUMQcG','662817uXaEbN','12501MZkHbh'];a16_0x397c=function(){return _0x446525;};return a16_0x397c();}export async function isUrlReachable(_0x30614e){const _0x36fe6f=a16_0x1c03;try{const _0x55e1e8=await fetch(_0x30614e,{'method':_0x36fe6f(0x159)});return _0x55e1e8['ok'];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1fb2c2,_0x50ed8f){const _0x3eac2a=a17_0x9f24,_0xa5cabb=_0x1fb2c2();while(!![]){try{const _0x27a396=parseInt(_0x3eac2a(0x13d))/0x1+parseInt(_0x3eac2a(0x12e))/0x2+parseInt(_0x3eac2a(0x134))/0x3+parseInt(_0x3eac2a(0x136))/0x4*(-parseInt(_0x3eac2a(0x13a))/0x5)+parseInt(_0x3eac2a(0x137))/0x6+-parseInt(_0x3eac2a(0x13c))/0x7*(-parseInt(_0x3eac2a(0x133))/0x8)+-parseInt(_0x3eac2a(0x132))/0x9*(parseInt(_0x3eac2a(0x130))/0xa);if(_0x27a396===_0x50ed8f)break;else _0xa5cabb['push'](_0xa5cabb['shift']());}catch(_0x278e1f){_0xa5cabb['push'](_0xa5cabb['shift']());}}}(a17_0x45c9,0xdebd3));function a17_0x9f24(_0x4d911b,_0x2cd20e){_0x4d911b=_0x4d911b-0x12a;const _0x45c956=a17_0x45c9();let _0x9f241=_0x45c956[_0x4d911b];return _0x9f241;}function a17_0x45c9(){const _0x3e4ae6=['2055928GvqBhx','8739210DfbPjf','map','column','5YCUfpS','join','7RxBWRv','1656797LONLsy','appMenu.updateCdn.preview.resourceLinks','filter','appMenu.updateCdn.preview.title','flat','2609350VkDUyU','from','18605040RQnMlo','label','18OjzcHu','38224bnXAQd','2173632IaitIu','resources'];a17_0x45c9=function(){return _0x3e4ae6;};return a17_0x45c9();}import{jsx as a17_0x11b777,jsxs as a17_0x87be7a}from'react/jsx-runtime';import{Text,Box}from'ink';import{useI18n}from'../i18n/hooks.js';export function CurrentMenuCdnContent(_0x34f5da){const _0x555e0e=a17_0x9f24,{t:_0xa13193}=useI18n(),{menuList:_0xdd6439}=_0x34f5da,_0x566713=_0xdd6439[_0x555e0e(0x12b)](_0x25f494=>_0x25f494[_0x555e0e(0x135)]['length']),_0x541194=Array[_0x555e0e(0x12f)](new Set(_0xdd6439[_0x555e0e(0x138)](_0x258a95=>_0x258a95[_0x555e0e(0x135)])[_0x555e0e(0x12d)]()));return a17_0x87be7a(Box,{'flexDirection':_0x555e0e(0x139),'children':[a17_0x11b777(Text,{'color':'cyan','children':_0xa13193(_0x555e0e(0x12c))}),a17_0x87be7a(Box,{'marginTop':0x1,'flexDirection':_0x555e0e(0x139),'children':[a17_0x87be7a(Text,{'bold':!![],'children':['\x20\x20',_0xa13193('appMenu.updateCdn.preview.menuList')]}),a17_0x87be7a(Text,{'children':['\x20\x20',_0x566713[_0x555e0e(0x138)](_0x46b48c=>_0x46b48c[_0x555e0e(0x131)])[_0x555e0e(0x13b)](',\x20')]})]}),a17_0x11b777(Box,{'marginTop':0x1,'children':a17_0x87be7a(Text,{'bold':!![],'children':['\x20\x20',_0xa13193(_0x555e0e(0x12a))]})}),_0x541194[_0x555e0e(0x138)](_0x2e228d=>a17_0x11b777(Box,{'children':a17_0x87be7a(Text,{'children':['\x20\x20',_0x2e228d]})},_0x2e228d))]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4dbb8f,_0x39c07f){const _0x2e8d33=a18_0x1870,_0x343620=_0x4dbb8f();while(!![]){try{const _0x20f06f=parseInt(_0x2e8d33(0x190))/0x1*(parseInt(_0x2e8d33(0x18b))/0x2)+-parseInt(_0x2e8d33(0x185))/0x3+-parseInt(_0x2e8d33(0x194))/0x4*(parseInt(_0x2e8d33(0x18c))/0x5)+-parseInt(_0x2e8d33(0x191))/0x6+-parseInt(_0x2e8d33(0x189))/0x7*(-parseInt(_0x2e8d33(0x18a))/0x8)+-parseInt(_0x2e8d33(0x18d))/0x9*(-parseInt(_0x2e8d33(0x193))/0xa)+-parseInt(_0x2e8d33(0x18e))/0xb*(-parseInt(_0x2e8d33(0x186))/0xc);if(_0x20f06f===_0x39c07f)break;else _0x343620['push'](_0x343620['shift']());}catch(_0x402b21){_0x343620['push'](_0x343620['shift']());}}}(a18_0xbceb,0xa0a1f));function a18_0x1870(_0x477c2c,_0x192525){_0x477c2c=_0x477c2c-0x185;const _0xbcebc5=a18_0xbceb();let _0x187069=_0xbcebc5[_0x477c2c];return _0x187069;}import{jsx as a18_0x4b457f,jsxs as a18_0x2eeb4f}from'react/jsx-runtime';import{Text,Box}from'ink';import{useI18n}from'../i18n/hooks.js';export function InputCdnAsset(_0x11064d){const _0x89cab3=a18_0x1870,{t:_0x250591}=useI18n(),{jsCdnUrl:_0x19f5bb,cssCdnUrl:_0x466853}=_0x11064d;return a18_0x2eeb4f(Box,{'flexDirection':_0x89cab3(0x187),'marginTop':0x1,'children':[a18_0x4b457f(Text,{'color':'cyan','children':_0x250591(_0x89cab3(0x192))}),a18_0x2eeb4f(Box,{'children':[a18_0x2eeb4f(Text,{'children':['\x20\x20',_0x250591(_0x89cab3(0x18f))]}),a18_0x4b457f(Text,{'color':_0x89cab3(0x188),'children':_0x19f5bb})]}),a18_0x2eeb4f(Box,{'children':[a18_0x2eeb4f(Text,{'children':['\x20\x20',_0x250591('appMenu.updateCdn.input.cssUrl.label')]}),a18_0x4b457f(Text,{'color':'green','children':_0x466853})]})]});}function a18_0xbceb(){const _0x564b8e=['116040pqOSai','column','green','4169774MrIWvl','16VgpNfy','682iEOLWy','325pnqMTk','126rEaJze','638qTSMfK','appMenu.updateCdn.input.jsUrl.label','3063rrqRFT','6721812lIlnzE','appMenu.updateCdn.input.title','322580TJhbke','18076BnGZyz','3528993HbVaqR'];a18_0xbceb=function(){return _0x564b8e;};return a18_0xbceb();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1e99dd,_0x24f186){const _0x52cd8f=a19_0x547c,_0x40a1f5=_0x1e99dd();while(!![]){try{const _0x291c0c=-parseInt(_0x52cd8f(0xab))/0x1+-parseInt(_0x52cd8f(0xb2))/0x2*(parseInt(_0x52cd8f(0xc6))/0x3)+parseInt(_0x52cd8f(0xe0))/0x4*(parseInt(_0x52cd8f(0xdc))/0x5)+-parseInt(_0x52cd8f(0xb8))/0x6*(parseInt(_0x52cd8f(0xc0))/0x7)+parseInt(_0x52cd8f(0xc9))/0x8+parseInt(_0x52cd8f(0xcf))/0x9+parseInt(_0x52cd8f(0xbc))/0xa;if(_0x291c0c===_0x24f186)break;else _0x40a1f5['push'](_0x40a1f5['shift']());}catch(_0x1d4d65){_0x40a1f5['push'](_0x40a1f5['shift']());}}}(a19_0x546b,0xa78dc));function a19_0x546b(){const _0x4d463a=['leftArrow','906UtroHS','input-css','value','3950616GPwgst','downArrow','delete','slice','green','lovrabet\x20auth','9125424IRhzbA','need-confirm','appMenu.updateCdn.success.updated','red','appMenu.updateCdn.error.invalidCssUrl','appMenu.updateCdn.loading.fetching','appMenu.updateCdn.error.invalidJsUrl','cancel','backspace','upArrow','resources','path','length','5RHRuHy','appMenu.updateCdn.error.jsUrlUnreachable','from','updated','5277484ZTbWOH','appMenu.updateCdn.error.cssUrlUnreachable','rightArrow','120300WlGBXm','flat','dots','all','return','column','input-js','7188PccKip','map','appMenu.updateCdn.action.continue','appMenu.updateCdn.input.jsUrl.placeholder','trim','yellow','66nPLNGu','gray','appMenu.updateCdn.error.noCdnLinks','appMenu.updateCdn.input.cssUrl.label','1940370thdgJs','creating','resolve','label','718571qPWrQD','appMenu.updateCdn.input.cssUrl.placeholder','cyan','appMenu.updateCdn.error.authHint.prefix','appMenu.updateCdn.input.jsUrl.label'];a19_0x546b=function(){return _0x4d463a;};return a19_0x546b();}import{jsx as a19_0x1d1acb,jsxs as a19_0x41168d,Fragment as a19_0x14bfb5}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';function a19_0x547c(_0x2dd5c1,_0xa38643){_0x2dd5c1=_0x2dd5c1-0xaa;const _0x546b73=a19_0x546b();let _0x547cad=_0x546b73[_0x2dd5c1];return _0x547cad;}import a19_0xd2c19b 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{useI18n}from'../i18n/hooks.js';import.meta.main&&render(a19_0x1d1acb(AppMenuUpdateCdn,{}));export function AppMenuUpdateCdn(){const _0x3d2ceb=a19_0x547c,{exit:_0x250d31}=useApp(),{t:_0x46f062}=useI18n(),{loading:_0x310010,menuList:_0x34ee36,error:_0x2d238d}=useGetOnlineMenuList(),[_0x1ccdfe,_0x24ae31]=useState('ok'),[_0x495150,_0x372acb]=useState(_0x3d2ceb(0xb1)),[_0x89a8f0,_0x1e3601]=useState(''),[_0x26a5ec,_0x109ec8]=useState(''),[_0x1bb21a,_0x42b200]=useState(''),[_0x1eab3e,_0x5e4353]=useState(''),_0xc8467f=Array[_0x3d2ceb(0xde)](new Set(_0x34ee36['map'](_0x4fb352=>_0x4fb352[_0x3d2ceb(0xd9)])[_0x3d2ceb(0xac)]()));useEffect(()=>{const _0x181246=_0x3d2ceb;_0x495150===_0x181246(0xdf)&&setTimeout(_0x250d31,0x32);},[_0x495150]),useInput(async(_0x234e08,_0x2c54a4)=>{const _0x36ddb7=_0x3d2ceb;if(_0x495150==='input-js'){if(_0x2c54a4[_0x36ddb7(0xaf)]){const _0xdac68c=_0x1bb21a['trim']();if(_0xdac68c==='')return;if(!isValidJsHttpsUrl(_0xdac68c)){_0x5e4353(_0x46f062(_0x36ddb7(0xd5)));return;}if(!await isUrlReachable(_0xdac68c)){_0x5e4353(_0x46f062(_0x36ddb7(0xdd)));return;}_0x1e3601(_0xdac68c),_0x42b200(''),_0x5e4353(''),_0x372acb(_0x36ddb7(0xc7));return;}if(_0x2c54a4[_0x36ddb7(0xd7)]||_0x2c54a4['delete']){_0x42b200(_0x2ca262=>_0x2ca262['slice'](0x0,-0x1)),_0x5e4353('');return;}_0x42b200(_0x16403a=>_0x16403a+_0x234e08);return;}if(_0x495150===_0x36ddb7(0xc7)){if(_0x2c54a4[_0x36ddb7(0xaf)]){const _0x128c35=_0x1bb21a[_0x36ddb7(0xb6)]();if(_0x128c35==='')return;if(!isValidCssHttpsUrl(_0x128c35)){_0x5e4353(_0x46f062(_0x36ddb7(0xd3)));return;}if(!await isUrlReachable(_0x128c35)){_0x5e4353(_0x46f062(_0x36ddb7(0xe1)));return;}_0x109ec8(_0x128c35),_0x42b200(''),_0x5e4353(''),_0x372acb(_0x36ddb7(0xd0));return;}if(_0x2c54a4[_0x36ddb7(0xd7)]||_0x2c54a4[_0x36ddb7(0xcb)]){_0x42b200(_0x25a2ee=>_0x25a2ee[_0x36ddb7(0xcc)](0x0,-0x1)),_0x5e4353('');return;}_0x42b200(_0x3f4f24=>_0x3f4f24+_0x234e08);return;}if(_0x495150===_0x36ddb7(0xd0)){(_0x2c54a4[_0x36ddb7(0xd8)]||_0x2c54a4[_0x36ddb7(0xca)]||_0x2c54a4[_0x36ddb7(0xc5)]||_0x2c54a4[_0x36ddb7(0xaa)])&&_0x24ae31(_0xf7aef4=>_0xf7aef4==='ok'?'cancel':'ok');if(_0x2c54a4[_0x36ddb7(0xaf)]){_0x372acb(_0x36ddb7(0xbd));if(_0x1ccdfe==='ok')await Promise[_0x36ddb7(0xae)](_0x34ee36[_0x36ddb7(0xb3)](_0x4c1405=>{const _0x3b72f4=_0x36ddb7,_0x2bb116={'id':_0x4c1405['id'],'label':_0x4c1405[_0x3b72f4(0xbf)],'path':_0x4c1405[_0x3b72f4(0xda)],'resources':[_0x89a8f0,_0x26a5ec]};if(_0x4c1405['resources'][_0x3b72f4(0xdb)]===0x0)return Promise[_0x3b72f4(0xbe)]();return updateMenuCdnUrl(_0x2bb116);})),await new Promise(_0x17be6c=>setTimeout(_0x17be6c,0x3e8)),_0x372acb(_0x36ddb7(0xdf));else _0x1ccdfe===_0x36ddb7(0xd6)&&_0x250d31();}}});if(_0x310010)return a19_0x41168d(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a19_0x1d1acb(Text,{}),a19_0x1d1acb(a19_0xd2c19b,{'type':_0x3d2ceb(0xad)}),a19_0x1d1acb(Text,{'children':_0x46f062(_0x3d2ceb(0xd4))})]});if(_0x2d238d)return a19_0x41168d(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a19_0x41168d(Text,{'color':_0x3d2ceb(0xd2),'children':['✗\x20',_0x2d238d]}),a19_0x41168d(Box,{'marginTop':0x1,'children':[a19_0x1d1acb(Text,{'color':_0x3d2ceb(0xb9),'children':_0x46f062(_0x3d2ceb(0xc3))}),a19_0x1d1acb(Text,{'color':_0x3d2ceb(0xc2),'children':_0x3d2ceb(0xce)}),a19_0x1d1acb(Text,{'color':'gray','children':_0x46f062('appMenu.updateCdn.error.authHint.suffix')})]})]});if(_0xc8467f['length']===0x0)return a19_0x1d1acb(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a19_0x1d1acb(Text,{'color':'yellow','children':_0x46f062(_0x3d2ceb(0xba))})});if(_0x495150===_0x3d2ceb(0xd0))return a19_0x41168d(Box,{'flexDirection':_0x3d2ceb(0xb0),'marginTop':0x1,'marginBottom':0x1,'children':[a19_0x1d1acb(CurrentMenuCdnContent,{'menuList':_0x34ee36}),a19_0x1d1acb(InputCdnAsset,{'jsCdnUrl':_0x89a8f0,'cssCdnUrl':_0x26a5ec}),a19_0x1d1acb(Box,{'marginTop':0x1,'flexDirection':_0x3d2ceb(0xb0),'children':[{'label':_0x46f062(_0x3d2ceb(0xb4)),'value':'ok'},{'label':_0x46f062('appMenu.updateCdn.action.cancel'),'value':_0x3d2ceb(0xd6)}][_0x3d2ceb(0xb3)](_0x1853dd=>a19_0x41168d(Text,{'color':_0x1ccdfe===_0x1853dd['value']?_0x3d2ceb(0xb7):undefined,'children':[_0x1ccdfe===_0x1853dd[_0x3d2ceb(0xc8)]?'>\x20':'\x20\x20',_0x1853dd['label']]},_0x1853dd['value']))})]});if(_0x495150==='creating')return a19_0x41168d(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a19_0x1d1acb(CurrentMenuCdnContent,{'menuList':_0x34ee36}),a19_0x1d1acb(InputCdnAsset,{'jsCdnUrl':_0x89a8f0,'cssCdnUrl':_0x26a5ec}),a19_0x41168d(Box,{'marginTop':0x1,'children':[a19_0x1d1acb(a19_0xd2c19b,{'type':_0x3d2ceb(0xad)}),a19_0x1d1acb(Text,{'children':_0x46f062('appMenu.updateCdn.loading.syncing')})]})]});if(_0x495150==='updated')return a19_0x41168d(Box,{'flexDirection':_0x3d2ceb(0xb0),'marginTop':0x1,'marginBottom':0x1,'children':[a19_0x1d1acb(CurrentMenuCdnContent,{'menuList':_0x34ee36}),a19_0x1d1acb(InputCdnAsset,{'jsCdnUrl':_0x89a8f0,'cssCdnUrl':_0x26a5ec}),a19_0x1d1acb(Box,{'marginTop':0x1,'children':a19_0x1d1acb(Text,{'color':'green','children':_0x46f062(_0x3d2ceb(0xd1))})})]});return a19_0x41168d(Box,{'flexDirection':_0x3d2ceb(0xb0),'marginTop':0x1,'marginBottom':0x1,'children':[a19_0x1d1acb(CurrentMenuCdnContent,{'menuList':_0x34ee36}),a19_0x41168d(Box,{'marginTop':0x1,'flexDirection':'column','children':[a19_0x1d1acb(Text,{'color':_0x3d2ceb(0xc2),'children':_0x46f062('appMenu.updateCdn.title')}),_0x89a8f0?a19_0x41168d(Box,{'children':[a19_0x41168d(Text,{'color':'gray','children':['\x20\x20',_0x46f062(_0x3d2ceb(0xc4))]}),a19_0x1d1acb(Text,{'color':_0x3d2ceb(0xcd),'children':_0x89a8f0})]}):_0x495150===_0x3d2ceb(0xb1)&&a19_0x41168d(a19_0x14bfb5,{'children':[a19_0x41168d(Box,{'children':[a19_0x41168d(Text,{'children':['\x20\x20',_0x46f062(_0x3d2ceb(0xc4))]}),a19_0x1d1acb(Text,{'color':_0x3d2ceb(0xcd),'children':_0x1bb21a}),_0x1eab3e&&a19_0x41168d(Text,{'color':_0x3d2ceb(0xd2),'children':['\x20←\x20',_0x1eab3e]})]}),!_0x1eab3e&&a19_0x1d1acb(Box,{'children':a19_0x41168d(Text,{'color':_0x3d2ceb(0xb9),'children':['\x20\x20',_0x46f062(_0x3d2ceb(0xb5))]})})]}),_0x26a5ec?a19_0x41168d(Box,{'children':[a19_0x41168d(Text,{'children':['\x20\x20',_0x46f062('appMenu.updateCdn.input.cssUrl.label')]}),a19_0x1d1acb(Text,{'color':_0x3d2ceb(0xcd),'children':_0x26a5ec})]}):_0x495150===_0x3d2ceb(0xc7)&&a19_0x41168d(a19_0x14bfb5,{'children':[a19_0x41168d(Box,{'children':[a19_0x41168d(Text,{'children':['\x20\x20',_0x46f062(_0x3d2ceb(0xbb))]}),a19_0x1d1acb(Text,{'color':_0x3d2ceb(0xcd),'children':_0x1bb21a}),_0x1eab3e&&a19_0x41168d(Text,{'color':_0x3d2ceb(0xd2),'children':['\x20←\x20',_0x1eab3e]})]}),!_0x1eab3e&&a19_0x1d1acb(Box,{'children':a19_0x41168d(Text,{'color':_0x3d2ceb(0xb9),'children':['\x20\x20',_0x46f062(_0x3d2ceb(0xc1))]})})]})]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a21_0x30521b=a21_0xb2fd;(function(_0x243df6,_0x135a1b){const _0x4837d0=a21_0xb2fd,_0x3f4c2c=_0x243df6();while(!![]){try{const _0x3c87e0=parseInt(_0x4837d0(0x159))/0x1*(-parseInt(_0x4837d0(0x166))/0x2)+-parseInt(_0x4837d0(0x150))/0x3*(parseInt(_0x4837d0(0x14e))/0x4)+parseInt(_0x4837d0(0x15d))/0x5+-parseInt(_0x4837d0(0x147))/0x6*(-parseInt(_0x4837d0(0x157))/0x7)+parseInt(_0x4837d0(0x15e))/0x8+-parseInt(_0x4837d0(0x153))/0x9*(parseInt(_0x4837d0(0x14b))/0xa)+parseInt(_0x4837d0(0x154))/0xb*(parseInt(_0x4837d0(0x169))/0xc);if(_0x3c87e0===_0x135a1b)break;else _0x3f4c2c['push'](_0x3f4c2c['shift']());}catch(_0x2da5a8){_0x3f4c2c['push'](_0x3f4c2c['shift']());}}}(a21_0x1e2c,0xd0476));import{getCookie}from'../auth/get-cookie.js';function a21_0x1e2c(){const _0x528171=['264LDwpJY','bind','appMenu.updateCdn.success.synced','2525004DdxzyD','1772683CemwAG','https://g.yuntooai.com/dist/yt-test-app/1.0.1/assets/main.css','sdk-demo','3774358MqHIMv','log','1ebkvVn','appMenu.error.missingAppCode','status','info','5049550wrvWtL','6990480SuiLPk','resources','application/json','appMenu.updateCdn.updating','appMenu.error.appCodeHint.option1','error','appMenu.error.appCodeHint.option2','update-menu-cdn-url','2489440GmUpLJ','data','appMenu.error.authExpired','48feWxLU','errorMsg','path','label','18yRGPff','stringify','import','common.error','50vdqKFw','/smartapi/menu/update','appMenu.updateCdn.error.updateFailed','29332ewsrAB','SdkDemo1'];a21_0x1e2c=function(){return _0x528171;};return a21_0x1e2c();}import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';import a21_0xf24b02 from'../i18n/index.js';const config=readConfig(),logLabel=a21_0x30521b(0x165),t=a21_0xf24b02['t'][a21_0x30521b(0x151)](a21_0xf24b02);function a21_0xb2fd(_0x10b28d,_0x45f2e1){_0x10b28d=_0x10b28d-0x147;const _0x1e2cfc=a21_0x1e2c();let _0xb2fd90=_0x1e2cfc[_0x10b28d];return _0xb2fd90;}import.meta.main&&updateMenuCdnUrl({'id':0xf41e,'label':a21_0x30521b(0x14f),'path':a21_0x30521b(0x156),'resources':['https://g.yuntooai.com/dist/yt-test-app/1.0.1/assets/main.js',a21_0x30521b(0x155)]});export async function updateMenuCdnUrl(_0x44c2dc){const _0xb41f66=a21_0x30521b,_0x350b06=config?.['appcode'];if(!_0x350b06){const _0x2c8dee=t(_0xb41f66(0x15a));logger['error'](logLabel,_0x2c8dee),console[_0xb41f66(0x163)]('×\x20'+_0x2c8dee),console[_0xb41f66(0x158)](t('appMenu.error.appCodeHint.title')),console[_0xb41f66(0x158)](t(_0xb41f66(0x162))),console[_0xb41f66(0x158)](t(_0xb41f66(0x164)));return;}logger[_0xb41f66(0x15c)](logLabel,t(_0xb41f66(0x161),{'label':_0x44c2dc[_0xb41f66(0x16c)],'path':_0x44c2dc[_0xb41f66(0x16b)]}));const _0x5ced5c={'id':_0x44c2dc['id'],'appCode':_0x350b06,'extend':{'loadScriptMode':_0xb41f66(0x149),'resources':_0x44c2dc[_0xb41f66(0x15f)]?JSON[_0xb41f66(0x148)](_0x44c2dc[_0xb41f66(0x15f)]):undefined}},_0x5767bd=await fetch(getApiDomain()+_0xb41f66(0x14c),{'method':'POST','body':JSON[_0xb41f66(0x148)](_0x5ced5c),'headers':{'Content-Type':_0xb41f66(0x160),'Cookie':getCookie()}});if(!_0x5767bd['ok']){if(_0x5767bd[_0xb41f66(0x15b)]===0x191){const _0x56141d=t(_0xb41f66(0x168));logger['error'](logLabel,_0x56141d,{'status':_0x5767bd[_0xb41f66(0x15b)],'menu':_0x44c2dc[_0xb41f66(0x16c)]});throw new Error(_0x56141d);}const _0x33f33f=t(_0xb41f66(0x14d),{'error':_0x5767bd[_0xb41f66(0x15b)]});logger[_0xb41f66(0x163)](logLabel,_0x33f33f,{'menu':_0x44c2dc[_0xb41f66(0x16c)]});throw new Error(_0x33f33f);}const _0x4848a1=await _0x5767bd['json']();if(!_0x4848a1['success']){const _0x251b7a=t('appMenu.updateCdn.error.updateFailed',{'error':_0x4848a1[_0xb41f66(0x16a)]||t(_0xb41f66(0x14a))});logger[_0xb41f66(0x163)](logLabel,_0x251b7a,{'errorCode':_0x4848a1['errorCode'],'errorMsg':_0x4848a1['errorMsg'],'menu':_0x44c2dc[_0xb41f66(0x16c)]});throw new Error(_0x251b7a);}logger['info'](logLabel,t(_0xb41f66(0x152),{'label':_0x44c2dc[_0xb41f66(0x16c)]}),_0x4848a1[_0xb41f66(0x167)]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x501a56,_0x3f8031){const _0x280c16=a22_0x4909,_0x2ea679=_0x501a56();while(!![]){try{const _0x319b45=-parseInt(_0x280c16(0x10a))/0x1+-parseInt(_0x280c16(0xff))/0x2+parseInt(_0x280c16(0x100))/0x3+-parseInt(_0x280c16(0x101))/0x4+-parseInt(_0x280c16(0xfc))/0x5*(-parseInt(_0x280c16(0x102))/0x6)+parseInt(_0x280c16(0x108))/0x7*(-parseInt(_0x280c16(0x10d))/0x8)+-parseInt(_0x280c16(0x10b))/0x9*(-parseInt(_0x280c16(0x110))/0xa);if(_0x319b45===_0x3f8031)break;else _0x2ea679['push'](_0x2ea679['shift']());}catch(_0x26ae8b){_0x2ea679['push'](_0x2ea679['shift']());}}}(a22_0x3201,0xf2322));function a22_0x4909(_0x58a93e,_0x24a518){_0x58a93e=_0x58a93e-0xfb;const _0x320145=a22_0x3201();let _0x490918=_0x320145[_0x58a93e];return _0x490918;}import{jsx as a22_0x11ce7d,jsxs as a22_0x36053b}from'react/jsx-runtime';import{Text,Box,useInput,useApp}from'ink';import{useEffect,useState}from'react';import{getIsSessionValid}from'./is-session-valid.js';function a22_0x3201(){const _0x2696f1=['auth.login.browserPrompt','then','finally','auth.login.pressQToExit','4728584VJVGdG','auth.session.valid','1277825ApqaPK','786222BLWYxf','auth.login.inProgress','8PoctqU','auth.login.pressEnter','green','460vmUhtp','auth.login.successCli','column','20SqRBwJ','gray','log','3435850diQdki','1450794jUgTGx','6687720NIFRvG','2749740LZooPf','return'];a22_0x3201=function(){return _0x2696f1;};return a22_0x3201();}import{authServer}from'./auth-server.js';import a22_0x16c4c1 from'ink-spinner';import{useI18n}from'../i18n/hooks.js';export function AuthServer(){const _0x4a02ef=a22_0x4909,{exit:_0x557c2b}=useApp(),{t:_0x410da8}=useI18n(),[_0x1cd099,_0x4cf3bd]=useState(![]),[_0x28b36c,_0x47a49a]=useState(!![]),[_0x4f65e3,_0x1b49e0]=useState(![]),[_0x1d4632,_0x3ea381]=useState(![]);useEffect(()=>{const _0x3f1eb8=a22_0x4909;getIsSessionValid()[_0x3f1eb8(0x105)](_0x4cf3bd)[_0x3f1eb8(0x106)](()=>_0x47a49a(![]));},[]),useEffect(()=>{const _0x23c048=a22_0x4909;!_0x28b36c&&_0x1cd099&&(console[_0x23c048(0xfe)](_0x410da8(_0x23c048(0x109))),_0x557c2b());},[_0x28b36c,_0x1cd099,_0x557c2b]),useEffect(()=>{const _0x5cede0=a22_0x4909;_0x1d4632&&(console[_0x5cede0(0xfe)]('*\x20'+_0x410da8(_0x5cede0(0x111))),_0x557c2b());},[_0x1d4632,_0x557c2b]),useInput((_0x333732,_0x4c8b1f)=>{const _0x46e01c=a22_0x4909;_0x4c8b1f[_0x46e01c(0x103)]&&(_0x1b49e0(!![]),authServer({'silent':!![]})[_0x46e01c(0x105)](_0x20602c=>{_0x3ea381(_0x20602c);})),_0x333732==='q'&&_0x557c2b();});if(_0x28b36c)return null;if(_0x1cd099||_0x1d4632)return null;return a22_0x11ce7d(Box,{'flexDirection':_0x4a02ef(0xfb),'marginTop':0x1,'marginBottom':0x1,'children':_0x4f65e3?a22_0x36053b(Box,{'children':[a22_0x11ce7d(Box,{'width':'1'}),a22_0x36053b(Text,{'color':_0x4a02ef(0x10f),'children':[a22_0x11ce7d(a22_0x16c4c1,{'type':'dots'}),'\x20\x20']}),a22_0x36053b(Text,{'children':[_0x410da8(_0x4a02ef(0x10c)),'\x20']}),a22_0x11ce7d(Text,{'color':'gray','children':_0x410da8(_0x4a02ef(0x104))})]}):a22_0x36053b(Box,{'children':[a22_0x11ce7d(Box,{'width':'1'}),a22_0x11ce7d(Text,{'children':_0x410da8(_0x4a02ef(0x10e))}),a22_0x11ce7d(Text,{'color':_0x4a02ef(0xfd),'children':_0x410da8(_0x4a02ef(0x107))})]})});}
|
package/lib/auth/auth-server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x3c1efc=a23_0x3799;(function(_0x42fbd2,_0x3bf7d6){const _0x2fd35d=a23_0x3799,_0x5c9509=_0x42fbd2();while(!![]){try{const _0x4e7127=parseInt(_0x2fd35d(0xca))/0x1*(parseInt(_0x2fd35d(0xb6))/0x2)+parseInt(_0x2fd35d(0xbd))/0x3*(-parseInt(_0x2fd35d(0xd5))/0x4)+-parseInt(_0x2fd35d(0xd4))/0x5*(-parseInt(_0x2fd35d(0xc0))/0x6)+-parseInt(_0x2fd35d(0xd9))/0x7+-parseInt(_0x2fd35d(0xba))/0x8*(-parseInt(_0x2fd35d(0xc8))/0x9)+-parseInt(_0x2fd35d(0xbf))/0xa*(-parseInt(_0x2fd35d(0xab))/0xb)+-parseInt(_0x2fd35d(0xce))/0xc;if(_0x4e7127===_0x3bf7d6)break;else _0x5c9509['push'](_0x5c9509['shift']());}catch(_0x63ab61){_0x5c9509['push'](_0x5c9509['shift']());}}}(a23_0x30f8,0x3856d));function a23_0x3799(_0x31a29f,_0xbc9146){_0x31a29f=_0x31a29f-0xa9;const _0x30f87f=a23_0x30f8();let _0x3799bb=_0x30f87f[_0x31a29f];return _0x3799bb;}import{writeFileSync}from'node:fs';import a23_0x1ddaab 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';import a23_0x277184 from'../i18n/index.js';const t=a23_0x277184['t'][a23_0x3c1efc(0xd7)](a23_0x277184);export async function authServer(_0x2f84c){const _0x2af8de=a23_0x3c1efc,_0x418160=_0x2f84c?.[_0x2af8de(0xac)]||![];if(await getIsSessionValid())return!![];const _0x583183=await(await fetch('https://g.yuntooai.com/cert/lovrabet-dev.json'))[_0x2af8de(0xbb)]();return new Promise(async(_0x116ee7,_0x58dd8f)=>{const _0x5c76a8=_0x2af8de;let _0x9398eb=0x0;const _0x183326=a23_0x1ddaab[_0x5c76a8(0xbc)](_0x583183,async(_0x8f5c1b,_0x46f83a)=>{const _0x4657a7=_0x5c76a8,_0x1000c9=getUserDomain(),_0x1408ab=_0x8f5c1b['headers']['cookie']||'',_0x468614=await fetch(_0x1000c9+_0x4657a7(0xaf),{'headers':{'cookie':_0x1408ab}})[_0x4657a7(0xb9)](_0x4a5bc1=>_0x4a5bc1[_0x4657a7(0xbb)]()),_0x4755b8=_0x468614&&_0x468614[_0x4657a7(0xb7)]&&_0x468614['user'];if(_0x4755b8){writeFileSync(cookieFile,_0x1408ab,'utf-8'),_0x116ee7(!![]);const _0x1f2848=t(_0x4657a7(0xcf)),_0x54c84d=t(_0x4657a7(0xc7),{'seconds':_0x4657a7(0xd2)}),_0x30dc4b=t(_0x4657a7(0xcc)),_0x35f600=_0x4657a7(0xbe)+_0x1f2848+'</title></head>\x0a<body>\x0a\x20\x20<div>'+_0x54c84d+_0x4657a7(0xc9)+_0x30dc4b+_0x4657a7(0xcb);_0x46f83a[_0x4657a7(0xda)](0xc8,{'Content-Type':_0x4657a7(0xc5)}),_0x46f83a[_0x4657a7(0xd1)](_0x35f600),_0x183326[_0x4657a7(0xad)]();}else{const _0xe3499a=''+encodeURIComponent(_0x4657a7(0xb8)+_0x9398eb);_0x46f83a[_0x4657a7(0xda)](0x12e,{'location':_0x1000c9+_0x4657a7(0xd8)+_0xe3499a}),_0x46f83a[_0x4657a7(0xd1)]();return;}});_0x183326['listen'](0x0,_0x5c76a8(0xb3),()=>{const _0x4c0784=_0x5c76a8,_0x245c4d=_0x183326[_0x4c0784(0xaa)]();_0x9398eb=typeof _0x245c4d===_0x4c0784(0xcd)&&_0x245c4d?_0x245c4d[_0x4c0784(0xd3)]:Number(_0x245c4d);const _0xd3950c=_0x4c0784(0xb8)+_0x9398eb;!_0x418160&&(console[_0x4c0784(0xc2)](t(_0x4c0784(0xb0))),console[_0x4c0784(0xc2)](t(_0x4c0784(0xc4)),_0xd3950c),console['log'](t(_0x4c0784(0xb2))),console[_0x4c0784(0xc2)](''),console['log'](t(_0x4c0784(0xa9))),console[_0x4c0784(0xc2)]('')),openInBrowser(_0xd3950c)['then'](_0x4d856e=>{const _0x3a21b6=_0x4c0784;!_0x418160&&(_0x4d856e?console[_0x3a21b6(0xc2)](t(_0x3a21b6(0xb4))):(console['log'](t('auth.server.browserOpenFailed')),console[_0x3a21b6(0xc2)](t(_0x3a21b6(0xae)),_0xd3950c)),console[_0x3a21b6(0xc2)](''));})['catch'](()=>{const _0x32c4a4=_0x4c0784;!_0x418160&&(console['log'](t('auth.server.browserOpenFailed')),console[_0x32c4a4(0xc2)](t(_0x32c4a4(0xae)),_0xd3950c),console[_0x32c4a4(0xc2)](''));});}),_0x183326['on'](_0x5c76a8(0xc3),_0x2428b2=>{!_0x418160&&console['error']('Auth\x20server\x20error:',_0x2428b2),_0x58dd8f(_0x2428b2);});});}function a23_0x30f8(){const _0x3ee02f=['open\x20\x22','end','<span\x20id=\x22t\x22>5</span>','port','5rmaPfn','650812fKnBVM','isAuth','bind','/sign-in?redirect=','1125579wyytgB','writeHead','auth.server.manualOpenHint','address','3481247RnDHqX','silent','close','auth.server.manualCopyUrl','/api/auth/get-session','auth.server.starting','start\x20\x22\x22\x20\x22','auth.server.openingBrowser','127.0.0.1','auth.server.browserOpened','platform','6uBvxaq','session','https://dev.lovrabet.com:','then','124768ZPikkf','json','createServer','3CWCAQC','<!doctype\x20html>\x0a<html>\x0a<head><meta\x20charset=\x22utf-8\x22><title>','10jPvFXm','1015542Bpqijo','xdg-open\x20\x22','log','error','auth.server.loginUrl','text/html;\x20charset=utf-8','win32','auth.login.success.message','27onHptF','</div>\x0a\x20\x20<div\x20id=\x22manualMsg\x22\x20style=\x22display:none;margin-top:10px;color:#d00;\x22>','134361QsCQJs','</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>','auth.login.success.manualClose','object','4576080ZWYpJV','auth.login.success.title'];a23_0x30f8=function(){return _0x3ee02f;};return a23_0x30f8();}function openInBrowser(_0x401b84){return new Promise(_0x22a34b=>{const _0x495775=a23_0x3799,_0x28f5cf=process[_0x495775(0xb5)];let _0x310896;if(_0x28f5cf===_0x495775(0xc6))_0x310896=_0x495775(0xb1)+_0x401b84+'\x22';else _0x28f5cf==='darwin'?_0x310896=_0x495775(0xd0)+_0x401b84+'\x22':_0x310896=_0x495775(0xc1)+_0x401b84+'\x22';exec(_0x310896,_0x23e877=>{_0x23e877?_0x22a34b(![]):_0x22a34b(!![]);});});}if(import.meta.main){const isAuth=await authServer();console['log'](a23_0x3c1efc(0xd6),isAuth);}
|
package/lib/auth/constant.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x37c96d=a24_0x509f;(function(_0x49b932,_0x39d8f0){const _0x5c974b=a24_0x509f,_0x348606=_0x49b932();while(!![]){try{const _0x93ff39=parseInt(_0x5c974b(0xb6))/0x1+-parseInt(_0x5c974b(0xb9))/0x2+parseInt(_0x5c974b(0xb3))/0x3+-parseInt(_0x5c974b(0xb4))/0x4*(-parseInt(_0x5c974b(0xb8))/0x5)+parseInt(_0x5c974b(0xba))/0x6+-parseInt(_0x5c974b(0xb7))/0x7+parseInt(_0x5c974b(0xbb))/0x8;if(_0x93ff39===_0x39d8f0)break;else _0x348606['push'](_0x348606['shift']());}catch(_0x7c4903){_0x348606['push'](_0x348606['shift']());}}}(a24_0x293d,0x5b897));import{mkdirSync}from'node:fs';function a24_0x509f(_0x24699c,_0x3bb7b3){_0x24699c=_0x24699c-0xb3;const _0x293d5f=a24_0x293d();let _0x509fa8=_0x293d5f[_0x24699c];return _0x509fa8;}import{homedir}from'node:os';import{join}from'node:path';export const configDir=join(homedir(),a24_0x37c96d(0xb5));export const cookieFile=join(configDir,a24_0x37c96d(0xbc));function a24_0x293d(){const _0x401826=['3179622ySXEvM','851512OExLjj','cookie','234660LJogeE','512ZPadyi','.lovrabet','247988WrNwGg','4222785goAqnv','15385CMYxIY','756500jkxJpW'];a24_0x293d=function(){return _0x401826;};return a24_0x293d();}mkdirSync(configDir,{'recursive':!![]});
|
package/lib/auth/get-cookie.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a25_0x1269(){var _0x2f635c=['1553031HhKHVt','2QEZCdG','29118ScFXQL','13981dJbCfS','15690240aXZNWl','utf-8','805SQckWq','1888424xzElhg','450ynKtAy','574383jIBhXo','9AEfimE','3048925LPaGsl','4nbFzpe'];a25_0x1269=function(){return _0x2f635c;};return a25_0x1269();}function a25_0x3a57(_0x1c1c69,_0x9eefb4){_0x1c1c69=_0x1c1c69-0x74;var _0x126976=a25_0x1269();var _0x3a57a3=_0x126976[_0x1c1c69];return _0x3a57a3;}(function(_0x2f1a83,_0x43878c){var _0x43d548=a25_0x3a57,_0x5ac578=_0x2f1a83();while(!![]){try{var _0x5be35a=parseInt(_0x43d548(0x7d))/0x1*(-parseInt(_0x43d548(0x75))/0x2)+parseInt(_0x43d548(0x74))/0x3*(-parseInt(_0x43d548(0x80))/0x4)+-parseInt(_0x43d548(0x7f))/0x5+-parseInt(_0x43d548(0x76))/0x6*(-parseInt(_0x43d548(0x7a))/0x7)+parseInt(_0x43d548(0x7b))/0x8*(parseInt(_0x43d548(0x7e))/0x9)+-parseInt(_0x43d548(0x7c))/0xa*(parseInt(_0x43d548(0x77))/0xb)+parseInt(_0x43d548(0x78))/0xc;if(_0x5be35a===_0x43878c)break;else _0x5ac578['push'](_0x5ac578['shift']());}catch(_0x20bd20){_0x5ac578['push'](_0x5ac578['shift']());}}}(a25_0x1269,0x53a64));import{readFileSync}from'node:fs';import{cookieFile}from'./constant.js';export function getCookie(){var _0x3125f1=a25_0x3a57;try{return readFileSync(cookieFile,_0x3125f1(0x79));}catch{}return'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a26_0x3fcf(){const _0x46968f=['1435Sssjli','json','26PKVzgS','4DYVDTu','1315378McrpwK','333BVpxbh','session','2780585VYYdyC','then','374fmDIeR','utf-8','9063whjjLM','user','/api/auth/get-session','48880krNMEh','2962302ZtMOLz','643728NdjLBF','416930vLEzJz'];a26_0x3fcf=function(){return _0x46968f;};return a26_0x3fcf();}(function(_0x3f846e,_0x59aa19){const _0x3a5e3e=a26_0x45cf,_0x2091df=_0x3f846e();while(!![]){try{const _0xbe05bf=parseInt(_0x3a5e3e(0xfe))/0x1+-parseInt(_0x3a5e3e(0x10e))/0x2*(-parseInt(_0x3a5e3e(0x105))/0x3)+-parseInt(_0x3a5e3e(0xfd))/0x4*(-parseInt(_0x3a5e3e(0x101))/0x5)+parseInt(_0x3a5e3e(0x109))/0x6+parseInt(_0x3a5e3e(0x10c))/0x7*(-parseInt(_0x3a5e3e(0x108))/0x8)+-parseInt(_0x3a5e3e(0xff))/0x9*(-parseInt(_0x3a5e3e(0x10b))/0xa)+parseInt(_0x3a5e3e(0x103))/0xb*(-parseInt(_0x3a5e3e(0x10a))/0xc);if(_0xbe05bf===_0x59aa19)break;else _0x2091df['push'](_0x2091df['shift']());}catch(_0x11ab3c){_0x2091df['push'](_0x2091df['shift']());}}}(a26_0x3fcf,0xd4918));import{existsSync,readFileSync}from'node:fs';import{getUserDomain}from'../constant/domain.js';import{cookieFile}from'./constant.js';function a26_0x45cf(_0x435b09,_0x54d88d){_0x435b09=_0x435b09-0xfd;const _0x3fcfbe=a26_0x3fcf();let _0x45cf94=_0x3fcfbe[_0x435b09];return _0x45cf94;}export async function getIsSessionValid(){const _0x5d32a4=a26_0x45cf;try{if(!existsSync(cookieFile))return![];const _0x13061f=readFileSync(cookieFile,_0x5d32a4(0x104)),_0x41f411=await fetch(getUserDomain()+_0x5d32a4(0x107),{'headers':{'cookie':_0x13061f}})[_0x5d32a4(0x102)](_0x21c172=>_0x21c172[_0x5d32a4(0x10d)]());return _0x41f411&&_0x41f411[_0x5d32a4(0x100)]&&_0x41f411[_0x5d32a4(0x106)];}catch{}return![];}
|
package/lib/auth/logout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x49d771,_0x4afa6d){const _0x35f640=a27_0x51f2,_0x52219d=_0x49d771();while(!![]){try{const _0x104616=parseInt(_0x35f640(0x1c7))/0x1*(-parseInt(_0x35f640(0x1cb))/0x2)+-parseInt(_0x35f640(0x1c9))/0x3*(-parseInt(_0x35f640(0x1c1))/0x4)+-parseInt(_0x35f640(0x1c6))/0x5*(parseInt(_0x35f640(0x1ce))/0x6)+parseInt(_0x35f640(0x1c3))/0x7+parseInt(_0x35f640(0x1cc))/0x8*(-parseInt(_0x35f640(0x1ca))/0x9)+-parseInt(_0x35f640(0x1c8))/0xa+parseInt(_0x35f640(0x1c5))/0xb;if(_0x104616===_0x4afa6d)break;else _0x52219d['push'](_0x52219d['shift']());}catch(_0x51333a){_0x52219d['push'](_0x52219d['shift']());}}}(a27_0x280d,0x5706c));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'./constant.js';import a27_0x5882d from'../i18n/index.js';const t=a27_0x5882d['t']['bind'](a27_0x5882d);function a27_0x280d(){const _0x5ae733=['2675638GSrrDQ','log','4389759oGCBQS','1964665QuDfut','48302FUYQBt','3070750xvanbU','3MGJIPd','54YgjGLw','2YLavSe','300088PvomMZ','auth.logout.notLoggedIn','6wxjYKn','2194132azFKrJ','auth.logout.success'];a27_0x280d=function(){return _0x5ae733;};return a27_0x280d();}function a27_0x51f2(_0xf1602b,_0x3abfc4){_0xf1602b=_0xf1602b-0x1c1;const _0x280d3c=a27_0x280d();let _0x51f214=_0x280d3c[_0xf1602b];return _0x51f214;}export function logout(){const _0xc7d2e1=a27_0x51f2;existsSync(cookieFile)?(unlinkSync(cookieFile),console['log'](t(_0xc7d2e1(0x1c2)))):console[_0xc7d2e1(0x1c4)](t(_0xc7d2e1(0x1cd)));}
|
package/lib/cli-flags.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a28_0x25ec6d=a28_0x4c84;function a28_0x4c84(_0x8ad6ed,_0x51e45d){_0x8ad6ed=_0x8ad6ed-0x17e;const _0x42b6f9=a28_0x42b6();let _0x4c84fd=_0x42b6f9[_0x8ad6ed];return _0x4c84fd;}(function(_0xe39311,_0xd225a2){const _0x330c73=a28_0x4c84,_0x240664=_0xe39311();while(!![]){try{const _0x502a47=-parseInt(_0x330c73(0x187))/0x1+-parseInt(_0x330c73(0x189))/0x2*(parseInt(_0x330c73(0x181))/0x3)+-parseInt(_0x330c73(0x188))/0x4*(-parseInt(_0x330c73(0x182))/0x5)+-parseInt(_0x330c73(0x17f))/0x6*(parseInt(_0x330c73(0x180))/0x7)+parseInt(_0x330c73(0x186))/0x8+parseInt(_0x330c73(0x17e))/0x9*(parseInt(_0x330c73(0x183))/0xa)+-parseInt(_0x330c73(0x185))/0xb;if(_0x502a47===_0xd225a2)break;else _0x240664['push'](_0x240664['shift']());}catch(_0x530c4d){_0x240664['push'](_0x240664['shift']());}}}(a28_0x42b6,0x695fa));export const dynamicCliFlags={'dangerouslyBffSave':{'type':a28_0x25ec6d(0x184)}};function a28_0x42b6(){const _0x31141b=['4182035lEyMPP','3746408SjmhiI','48857eDwnqX','4FAZOfm','50yqgQLw','9FSApjm','125022SEKRvu','35ZDhJKd','45636tzFLpP','3367295qtbLWL','2033770XUZlor','boolean'];a28_0x42b6=function(){return _0x31141b;};return a28_0x42b6();}
|