@ranger-testing/ranger-cli 3.1.6 → 3.1.7-alpha.62f152a-54
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/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/deleteProfile.js +1 -1
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/migrateProfile.js +1 -1
- package/build/commands/setup/claude.js +1 -1
- package/build/commands/setup/opencode.js +1 -1
- package/build/commands/setupCi.js +1 -1
- package/build/commands/skillup.js +1 -1
- package/build/commands/start.js +1 -1
- package/build/commands/status.js +1 -1
- package/build/commands/update.js +1 -1
- package/build/commands/updateEnv.js +1 -1
- package/build/commands/useEnv.js +1 -1
- package/build/commands/utils/activeProfile.js +1 -1
- package/build/commands/utils/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/cloudProfile.js +1 -1
- package/build/commands/utils/cloudProfileSession.js +1 -1
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/gitTracked.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/legacyWarning.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/matchAuthEnvironment.js +1 -1
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/novaActCli.js +1 -1
- package/build/commands/utils/opencodeConfig.js +1 -1
- package/build/commands/utils/organizationEnvApi.js +1 -1
- package/build/commands/utils/playwrightCli.js +1 -1
- package/build/commands/utils/profileMessages.js +1 -1
- package/build/commands/utils/profileSetupBanner.js +1 -1
- package/build/commands/utils/projectsConfig.js +1 -1
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/rangerwrightCli.js +1 -1
- package/build/commands/utils/resolveProfileContext.js +1 -1
- package/build/commands/utils/resolveProfileUrl.js +1 -1
- package/build/commands/utils/retry.js +1 -1
- package/build/commands/utils/scenarioOriginCheck.js +1 -1
- package/build/commands/utils/sessionCache.js +1 -1
- package/build/commands/utils/settings.js +1 -1
- package/build/commands/utils/skillContent.js +1 -1
- package/build/commands/utils/skills.js +1 -1
- package/build/commands/utils/stitchWebmFiles.js +1 -1
- package/build/commands/utils/telemetry.js +1 -1
- package/build/commands/utils/tokenRefresh.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -1
- package/build/commands/utils/tunnelClient.js +1 -1
- package/build/commands/utils/userApi.js +1 -1
- package/build/commands/utils/version.js +1 -1
- package/build/commands/verifyFeature.js +1 -1
- package/build/commands/verifyFeatureCli.js +1 -1
- package/build/commands/verifyFeatureNovaCli.js +1 -1
- package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x2bae3a=_0x1947;(function(_0x500238,_0x4633c1){const _0x3173d9=_0x1947,_0x4551ce=_0x500238();while(!![]){try{const _0x579f02=-parseInt(_0x3173d9(0x1f7))/0x1*(-parseInt(_0x3173d9(0x14e))/0x2)+-parseInt(_0x3173d9(0x200))/0x3+-parseInt(_0x3173d9(0x1bf))/0x4*(-parseInt(_0x3173d9(0x196))/0x5)+-parseInt(_0x3173d9(0x1f0))/0x6*(parseInt(_0x3173d9(0x1d3))/0x7)+-parseInt(_0x3173d9(0x170))/0x8*(parseInt(_0x3173d9(0x172))/0x9)+-parseInt(_0x3173d9(0x1a8))/0xa*(-parseInt(_0x3173d9(0x1a1))/0xb)+parseInt(_0x3173d9(0x146))/0xc;if(_0x579f02===_0x4633c1)break;else _0x4551ce['push'](_0x4551ce['shift']());}catch(_0x169fe2){_0x4551ce['push'](_0x4551ce['shift']());}}}(_0x320f,0x96b2f));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x4e34ea from'inquirer';import{chromium}from'playwright';import{getApiBaseUrl}from'./environment.js';import{getToken}from'./keychain.js';function _0x320f(){const _0x210ddf=['uFWsi','No\x20saved\x20session\x20for\x20\x22','launch','forceLogin','205475fgmXLi','tunnel_login_cleanup','tunnel_login_setup','API\x20request\x20','rpJBl','cli:manual-login','reason','split','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','status','yStzg','11WAFUtQ','RIhmL','RhiPT','\x22\x20on\x20profile\x20\x22',');\x20pass\x20--env\x20<key>\x20to\x20pick\x20one.','WRQKB','agent','7193930WVvHHB','sessionId','absWR','xRYjC','password','Tunnel\x20bridge\x20closed\x20before\x20login\x20completed\x20for\x20','setupHeaders','):\x20','about:blank','pw_endpoint','\x22\x20failed\x20validation\x20—\x20refreshing...','\x22\x20for\x20','QVkel','tuCMO','PUT','elapsedMs','FFThf','No\x20auth\x20environment\x20matches\x20the\x20local\x20target\x20\x22','environmentKey','\x22,\x20and\x20cloud\x20sessions\x20don\x27t\x20apply\x20to\x20localhost.\x0a','activeLocalConnections','effectiveBaseUrl','loginInstructions','100ojqEHd','error','NwQXb','userAgent','confirm','kDKSh','settings','tunnel_session_id','username','clientIp','HBHfw','\x22\x20not\x20found\x20in\x20your\x20org\x27s\x20config.','Mknwo','you\x27re\x20now\x20at\x20\x22','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','Auth\x20environment\x20\x22','Tyqts','length','pendingLocalConnections','kSGoH','7yiNfXc','string','Pass\x20--base-url\x20<your-app-url>\x20so\x20Ranger\x20can\x20match\x20the\x20right\x20one,\x20or\x20create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`.','aVMzA','oSUmi','some','or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.','cookies','POST','wcyNn','WAios','\x22\x20not\x20found.','assertedEnv','\x22,\x20attempting\x20login...','trackPhaseError','FUejt','invalidateOn','\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','Browser\x20login\x20timed\x20out\x20after\x20','\x20\x20Options:\x0a','catch','pwgux','environments','ugPqO','jngPP','trackPhaseEnd','uFbef','\x22\x20but\x20this\x20run\x20resolved\x20env\x20\x22','RWGGR','3697932GLrRrR','env','/session','wDSbL','ambiguous','\x20failed\x20(','RANGER_TUNNEL_LOGIN_HEADED','5901cvDHLM','\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','CbbZM','/api/v1/profiles','headers','xTwoD','\x20(declared\x20port\x20differs;\x20pass\x20--env\x20to\x20override).','log','code','2816991JLLpPO','\x22\x20matched\x20by\x20host\x20for\x20','ApiError','qIISM','telemetry','wyxWI','domains','\x20\x20No\x20live\x20session\x20for\x20\x22','invalid-url','\x20\x20Ranger\x20can\x27t\x20assume\x20your\x20org\x27s\x20default\x20login\x20flow\x20applies\x20to\x20an\x20arbitrary\x20local\x20app.\x0a','sMqxp','If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.','10740816jXIlqH','not_configured','lzMjM','newPage','defaultEnvironmentKey','DWIAe','\x20\x20Using\x20cached\x20local\x20session\x20for\x20cloud\x20profile\x20\x22','iqena','140UBnubd','stringify','WOVpH','/api/v1/profiles/','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','persistSessionState','message','WymHJ','force','organizationId','No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22','join','\x22\x20failed\x20validation\x20—\x20re-login\x20needed...','browserOptions','DELETE','szyTS','test_output','RANGER_TEST_PASSWORD','TjuLX','trackPhaseStart','akZYr','Bearer\x20','tunnel_login_request','moAIF','sessionState','GcfCL','hqTJi','auth','\x22,\x20refreshing\x20session...','KBWFs','auth_config','\x20--skip-auth`\x20for\x20an\x20unauthenticated\x20profile.','iEHUW','targetUrl','8oLyUZH','whPuH','7940916NDiAiM','key','local_ws_error','close','LhtAg','WPYsC','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','\x20\x20•\x20or\x20pass\x20--env\x20<key>\x20to\x20run\x20an\x20automated\x20login\x20for\x20this\x20target.','4|1|3|0|2','type','detail','origin','parse','\x20\x20forceLogin\x20enabled\x20for\x20\x22','pGGWg','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','sessionCheckPath','name','tunnelUrl','GJMaU','storageStatePath','url','tunnel','RANGER_TEST_USERNAME','pwEndpoint','\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.','\x20\x20-\x20pass\x20`--env\x20<key>`\x20to\x20pick\x20the\x20auth\x20environment\x20by\x20name,\x20or\x0a','session_state','\x22.\x0a','HfnJY','keys','lKKms'];_0x320f=function(){return _0x210ddf;};return _0x320f();}import{getRangerHomeDir}from'./rangerRoot.js';import{addProfileSetupBanner}from'./profileSetupBanner.js';import{duplicateCookiesForDomains,getSessionCachePath,getStorageStatePath,isBareLocalhost,isCachedSessionLive,isInteractive,needsTunnel,orderLoginDomains,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';import{matchAuthEnvironmentByHost,matchAuthEnvironmentExact}from'./matchAuthEnvironment.js';function _0x1947(_0x2615ed,_0x407aed){_0x2615ed=_0x2615ed-0x143;const _0x320f8e=_0x320f();let _0x194730=_0x320f8e[_0x2615ed];return _0x194730;}import{createTunnelBridge,launchBrowserServer}from'./tunnelClient.js';function targetHostForTelemetry(_0xc5dd64){const _0x51e106=_0x1947,_0x3dba22={'YFmht':_0x51e106(0x208)};try{return new URL(_0xc5dd64)['host'];}catch{return _0x3dba22['YFmht'];}}function errorMessageForTelemetry(_0x10b199){return _0x10b199 instanceof Error?_0x10b199['message']:undefined;}function trackBridgeEvent(_0x4c0660,_0x473d42){const _0x580155=_0x1947,_0x56ed76={'mRSKI':'tunnel_error','xBLki':_0x580155(0x174)};if(!_0x4c0660)return;const _0x5f22bd={'tunnelSessionId':_0x473d42[_0x580155(0x1a9)],'tunnelEventType':_0x473d42['type'],'connectionId':_0x473d42['connectionId'],'code':_0x473d42['code'],'reason':_0x473d42[_0x580155(0x19c)],'error':_0x473d42['error'],'elapsedMs':_0x473d42[_0x580155(0x1b7)],'activeLocalConnections':_0x473d42[_0x580155(0x1bc)],'pendingLocalConnections':_0x473d42[_0x580155(0x1d1)]};_0x4c0660[_0x580155(0x1ec)]('tunnel_bridge_event',_0x5f22bd),(_0x473d42[_0x580155(0x17b)]===_0x56ed76['mRSKI']||_0x473d42['type']===_0x56ed76['xBLki'])&&void _0x4c0660['trackPhaseError']('tunnel_bridge',new Error(_0x473d42['error']??_0x473d42['type']),_0x5f22bd);}const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0x51a174=_0x1947,_0x5c5d41={'akZYr':function(_0x3fcdc4){return _0x3fcdc4();},'ZVeHa':_0x51a174(0x152)},_0x3ddf57=await _0x5c5d41[_0x51a174(0x162)](getToken);if(!_0x3ddf57)throw new Error(_0x5c5d41['ZVeHa']);return _0x3ddf57;}async function apiRequest(_0x23527b,_0x1fdebb={}){const _0x3dba36=_0x1947,_0x102222={'moAIF':function(_0x1c4ebf){return _0x1c4ebf();},'qWriF':'application/json','xEoHC':function(_0x4aa4ed,_0x2ceebe){return _0x4aa4ed===_0x2ceebe;},'uFbef':'string','wyxWI':function(_0x143984,_0xdb9a79){return _0x143984===_0xdb9a79;}},_0x320800=await requireToken(),_0x1223cd=_0x102222[_0x3dba36(0x165)](getApiBaseUrl),_0xed8ef7=await fetch(''+_0x1223cd+_0x23527b,{..._0x1fdebb,'headers':{'Authorization':_0x3dba36(0x163)+_0x320800,'Content-Type':_0x102222['qWriF'],..._0x1fdebb[_0x3dba36(0x1fb)]??{}}});if(!_0xed8ef7['ok']){let _0x3281e8='',_0x105d9a;try{const _0x59d0de=await _0xed8ef7['json'](),_0x51c140=(_0x102222['xEoHC'](typeof _0x59d0de[_0x3dba36(0x1c0)],_0x102222[_0x3dba36(0x1ed)])?_0x59d0de['error']:undefined)??JSON['stringify'](_0x59d0de);_0x3281e8=_0x51c140;_0x102222['xEoHC'](typeof _0x59d0de['test_output'],'string')&&_0x59d0de[_0x3dba36(0x15e)]&&(_0x3281e8=_0x3281e8+'\x0a'+_0x59d0de[_0x3dba36(0x15e)]);if(typeof _0x59d0de['code']===_0x3dba36(0x1d4))_0x105d9a=_0x59d0de[_0x3dba36(0x1ff)];}catch{_0x3281e8=_0xed8ef7['statusText'];}throw new ApiError(_0x3dba36(0x199)+_0x23527b+_0x3dba36(0x1f5)+_0xed8ef7['status']+_0x3dba36(0x1af)+_0x3281e8,_0xed8ef7[_0x3dba36(0x19f)],_0x3281e8,_0x105d9a);}if(_0x102222[_0x3dba36(0x205)](_0xed8ef7[_0x3dba36(0x19f)],0xcc))return undefined;return _0xed8ef7['json']();}export class ApiError extends Error{[_0x2bae3a(0x19f)];[_0x2bae3a(0x17c)];['code'];constructor(_0x53f737,_0x4c8a62,_0x3b1d76,_0x3683e8){const _0x1df507=_0x2bae3a,_0x49edcd={'RhiPT':_0x1df507(0x17a),'DNoGb':_0x1df507(0x202)},_0x18cb74=_0x49edcd[_0x1df507(0x1a3)][_0x1df507(0x19d)]('|');let _0xd2e4e0=0x0;while(!![]){switch(_0x18cb74[_0xd2e4e0++]){case'0':this['code']=_0x3683e8;continue;case'1':this['status']=_0x4c8a62;continue;case'2':this['name']=_0x49edcd['DNoGb'];continue;case'3':this[_0x1df507(0x17c)]=_0x3b1d76;continue;case'4':super(_0x53f737);continue;}break;}}}export async function fetchCloudProfile(_0x209744){const _0x14d30f=_0x2bae3a,_0x4eeddc={'WRQKB':function(_0x4749d9,_0x35d93b){return _0x4749d9(_0x35d93b);},'gHdeE':function(_0x129d21,_0x34a7b2){return _0x129d21 instanceof _0x34a7b2;}};try{return await _0x4eeddc[_0x14d30f(0x1a6)](apiRequest,_0x14d30f(0x151)+encodeURIComponent(_0x209744));}catch(_0x58f525){if(_0x4eeddc['gHdeE'](_0x58f525,ApiError)&&_0x58f525['status']===0x194)return null;throw _0x58f525;}}export async function listCloudProfiles(){const _0x133813=_0x2bae3a,_0x86e8f5={'WymHJ':function(_0x40c17b,_0x452901){return _0x40c17b(_0x452901);}},_0x5a31d5=await _0x86e8f5[_0x133813(0x155)](apiRequest,'/api/v1/profiles');return _0x5a31d5['profiles'];}export async function deleteCloudProfile(_0x429c7c){const _0x2238ec=_0x2bae3a,_0x8f4971={'GcfCL':_0x2238ec(0x15c),'uGjsA':function(_0x18d42e,_0x1a5b2f){return _0x18d42e instanceof _0x1a5b2f;},'zaDZS':function(_0x3de6f5,_0x27f23c){return _0x3de6f5===_0x27f23c;}};try{await apiRequest(_0x2238ec(0x151)+encodeURIComponent(_0x429c7c),{'method':_0x8f4971[_0x2238ec(0x167)]});}catch(_0x192f48){if(_0x8f4971['uGjsA'](_0x192f48,ApiError)&&_0x8f4971['zaDZS'](_0x192f48['status'],0x194))throw new Error('Cloud\x20profile\x20\x22'+_0x429c7c+_0x2238ec(0x1de));throw _0x192f48;}}export async function createCloudProfile(_0x4c2221,_0x48587d,_0x4048ff={}){const _0x2b061d=_0x2bae3a,_0x1fb732={'cyYec':function(_0x553fdf,_0x49783c){return _0x553fdf>_0x49783c;},'vgYsH':function(_0x2a1529,_0x117d92,_0x279f14){return _0x2a1529(_0x117d92,_0x279f14);}},_0x4906c5={'name':_0x4c2221};if(_0x48587d)_0x4906c5['environment_key']=_0x48587d;_0x4048ff[_0x2b061d(0x1c5)]&&_0x1fb732['cyYec'](Object[_0x2b061d(0x190)](_0x4048ff[_0x2b061d(0x1c5)])[_0x2b061d(0x1d0)],0x0)&&(_0x4906c5['settings']=_0x4048ff['settings']);if(_0x4048ff['username'])_0x4906c5[_0x2b061d(0x1c7)]=_0x4048ff[_0x2b061d(0x1c7)];if(_0x4048ff['password'])_0x4906c5['password']=_0x4048ff['password'];return await _0x1fb732['vgYsH'](apiRequest,_0x2b061d(0x1fa),{'method':'POST','body':JSON['stringify'](_0x4906c5)});}export async function uploadCloudProfileSession(_0x8572b4,_0x1e05d2){const _0x304007=_0x2bae3a,_0x5136bb={'KkZLb':function(_0x461228,_0x45e777,_0x58f7c6){return _0x461228(_0x45e777,_0x58f7c6);},'Jefhg':function(_0x82c697,_0x51988c){return _0x82c697(_0x51988c);}};return await _0x5136bb['KkZLb'](apiRequest,_0x304007(0x151)+_0x5136bb['Jefhg'](encodeURIComponent,_0x8572b4)+_0x304007(0x1f2),{'method':_0x304007(0x1db),'body':JSON['stringify']({'session_state':_0x1e05d2})});}export async function saveCloudProfileCredentials(_0x32eb80,_0x4e7a64,_0x4d1e83){const _0x2e78a1=_0x2bae3a,_0x459b64={'oLWBo':function(_0xe4d3c1,_0x7620b2,_0x3ad755){return _0xe4d3c1(_0x7620b2,_0x3ad755);},'ooFHe':function(_0x2a3349,_0x5c317){return _0x2a3349(_0x5c317);},'QVkel':_0x2e78a1(0x1b6)};await _0x459b64['oLWBo'](apiRequest,_0x2e78a1(0x151)+_0x459b64['ooFHe'](encodeURIComponent,_0x32eb80),{'method':_0x459b64[_0x2e78a1(0x1b4)],'body':JSON[_0x2e78a1(0x14f)]({'username':_0x4e7a64,'password':_0x4d1e83})});}export async function fetchAuthConfig(){const _0x543d4d=_0x2bae3a,_0xa4c5cd={'RIhmL':function(_0x3357fd,_0x4287b3){return _0x3357fd(_0x4287b3);},'SPvSd':function(_0x18caea,_0x22c0dd){return _0x18caea instanceof _0x22c0dd;}};try{const _0x2b4419=await _0xa4c5cd[_0x543d4d(0x1a2)](apiRequest,'/api/v1/profiles/auth-config');return _0x2b4419[_0x543d4d(0x16c)];}catch(_0x1dfbd6){return _0xa4c5cd['SPvSd'](_0x1dfbd6,ApiError)&&_0x1dfbd6[_0x543d4d(0x19f)]!==0x194&&console[_0x543d4d(0x1c0)]('\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20'+_0x1dfbd6['message']),null;}}async function createTunnelSession(_0x26605e){const _0x491c2a=_0x2bae3a,_0x50efa9={'KBWFs':_0x491c2a(0x1a7)};return await apiRequest('/api/v1/tunnel/sessions',{'method':'POST','body':JSON['stringify']({'targetUrl':_0x26605e,'mode':_0x50efa9[_0x491c2a(0x16b)]})});}async function deleteTunnelSession(_0x47a426){const _0x2c9144=_0x2bae3a,_0x5f2155={'CfsXO':function(_0x3bac8b,_0x4d7101,_0x288b53){return _0x3bac8b(_0x4d7101,_0x288b53);}};await _0x5f2155['CfsXO'](apiRequest,'/api/v1/tunnel/sessions/'+_0x47a426,{'method':_0x2c9144(0x15c)});}export function pickAdHocEnvKey(_0x43807b,_0x525c3e,_0x3b16aa){const _0x134816=_0x2bae3a,_0x1c37d={'kDKSh':function(_0x2496c5,_0xe31abc){return _0x2496c5+_0xe31abc;},'IAFuZ':'\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','pGGWg':function(_0x3f281d,_0x44f542){return _0x3f281d in _0x44f542;},'ixLPN':_0x134816(0x173),'YIRld':'ambiguous','rvpSG':function(_0x463c6f,_0x27be8c){return _0x463c6f(_0x27be8c);},'CbbZM':function(_0xb0a5de,_0x4c7b50){return _0xb0a5de+_0x4c7b50;},'WAios':function(_0x56de11,_0x190637){return _0x56de11===_0x190637;}};if(_0x3b16aa){if(!_0x43807b?.[_0x134816(0x1e9)]?.[_0x3b16aa]){const _0x145928=Object['keys'](_0x43807b?.[_0x134816(0x1e9)]??{});throw new Error(_0x1c37d['kDKSh'](_0x134816(0x1ce)+_0x3b16aa+_0x134816(0x1ca),_0x145928['length']?'\x20Available:\x20'+_0x145928[_0x134816(0x159)](',\x20')+'.':_0x1c37d['IAFuZ'])+'\x20(If\x20you\x20meant\x20a\x20profile,\x20use\x20--profile.)');}return _0x3b16aa;}if(!_0x43807b)return null;if(_0x525c3e){const _0x312599=matchAuthEnvironmentExact(_0x525c3e,_0x43807b);if(_0x312599)return _0x312599;const _0x9695c5=matchAuthEnvironmentByHost(_0x525c3e,_0x43807b);if(_0x9695c5&&_0x1c37d[_0x134816(0x180)](_0x1c37d['ixLPN'],_0x9695c5))return console[_0x134816(0x1fe)]('\x20\x20Auth\x20env\x20\x22'+_0x9695c5['key']+_0x134816(0x201)+_0x525c3e+_0x134816(0x1fd)),_0x9695c5[_0x134816(0x173)];if(_0x9695c5&&_0x1c37d['YIRld']in _0x9695c5)throw new Error('Multiple\x20auth\x20environments\x20declare\x20this\x20host\x20('+_0x9695c5[_0x134816(0x1f4)][_0x134816(0x159)](',\x20')+_0x134816(0x1a5));if(_0x1c37d['rvpSG'](needsTunnel,_0x525c3e))throw new Error(_0x1c37d[_0x134816(0x1c4)](_0x1c37d['kDKSh'](_0x1c37d[_0x134816(0x1f9)](_0x134816(0x1b9)+_0x525c3e+_0x134816(0x18e),_0x134816(0x143)),_0x134816(0x1e6))+_0x134816(0x18c)+('\x20\x20-\x20ask\x20your\x20Ranger\x20admin\x20to\x20add\x20\x22'+_0x525c3e['replace'](/\/+$/,'')+'\x22\x20to\x20the\x20matching\x20auth\x20environment\x27s\x20domains,\x20or\x0a'),'\x20\x20-\x20run\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20'+_0x525c3e+_0x134816(0x16d)));}if(_0x43807b[_0x134816(0x14a)])return _0x43807b[_0x134816(0x14a)];const _0x2b1c5d=Object[_0x134816(0x190)](_0x43807b[_0x134816(0x1e9)]??{});if(_0x1c37d[_0x134816(0x1dd)](_0x2b1c5d[_0x134816(0x1d0)],0x1))return _0x2b1c5d[0x0];if(_0x2b1c5d[_0x134816(0x1d0)]===0x0)return null;throw new Error('Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20('+_0x2b1c5d[_0x134816(0x159)](',\x20')+').\x20'+_0x134816(0x1d5));}export function adHocProfileName(_0x40ee52,_0x212c16,_0xb400f0){const _0x38c8b9=_0x2bae3a,_0x207416={'RWGGR':function(_0x46e8bc,_0x3b6781){return _0x46e8bc===_0x3b6781;}};if(!_0x212c16||_0x207416[_0x38c8b9(0x1ef)](_0x212c16,_0xb400f0))return _0x40ee52;return _0x40ee52+':'+_0x212c16;}export async function resolveAdHocProfile(_0x4dc94c={},_0x25300c=process[_0x2bae3a(0x1f1)]){const _0x2b9bc0=_0x2bae3a,_0x18894f={'DWIAe':function(_0x5b1824){return _0x5b1824();},'fKZzk':function(_0x1d02e3,_0x434bcb){return _0x1d02e3(_0x434bcb);},'LhtAg':function(_0x49c660,_0x46953c){return _0x49c660&&_0x46953c;},'cUUlh':'none','xRYjC':function(_0x3a1c08,_0x24af4b){return _0x3a1c08??_0x24af4b;}},_0x2f0c5c=_0x25300c['RANGER_TEST_USERNAME'];if(!_0x2f0c5c)return null;const _0x35fa27=await _0x18894f[_0x2b9bc0(0x14b)](fetchAuthConfig),_0x23f966=pickAdHocEnvKey(_0x35fa27,_0x4dc94c[_0x2b9bc0(0x16f)],_0x4dc94c['envKey']);let _0x44ce02=adHocProfileName(_0x2f0c5c,_0x23f966,_0x35fa27?.['defaultEnvironmentKey']),_0x35414c=await _0x18894f['fKZzk'](fetchCloudProfile,_0x44ce02);_0x18894f[_0x2b9bc0(0x176)](_0x35414c,_0x23f966)&&_0x35414c['environmentKey']!==_0x23f966&&(console[_0x2b9bc0(0x1fe)]('\x20\x20Cloud\x20profile\x20\x22'+_0x44ce02+'\x22\x20is\x20bound\x20to\x20auth\x20env\x20\x22'+(_0x35414c[_0x2b9bc0(0x1ba)]??_0x18894f['cUUlh'])+_0x2b9bc0(0x1ee)+_0x23f966+'\x22;\x20using\x20\x22'+_0x2f0c5c+':'+_0x23f966+'\x22\x20instead.'),_0x44ce02=_0x2f0c5c+':'+_0x23f966,_0x35414c=await fetchCloudProfile(_0x44ce02));if(_0x35414c)return{'name':_0x35414c[_0x2b9bc0(0x183)],'profile':_0x35414c};const _0x5175f4=_0x25300c[_0x2b9bc0(0x15f)],_0x4b7dcd=await createCloudProfile(_0x44ce02,_0x18894f[_0x2b9bc0(0x1ab)](_0x23f966,undefined),{'username':_0x2f0c5c,'password':_0x5175f4});return console[_0x2b9bc0(0x1fe)]('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x4b7dcd['name']+_0x2b9bc0(0x1b3)+_0x2f0c5c+(_0x23f966?'\x20(auth\x20env:\x20'+_0x23f966+')':'')),{'name':_0x4b7dcd['name'],'profile':_0x4b7dcd};}export async function writeSessionToLocalCache(_0x1ecba9,_0x18c096,_0x206f03,_0x27fe32,_0x3cc13a,_0x2b513d,_0x2c322a){const _0x3f33ea=_0x2bae3a,_0x3baa73={'SEdvC':function(_0x33893d,_0x22ed40,_0x225989){return _0x33893d(_0x22ed40,_0x225989);},'lKKms':_0x3f33ea(0x169),'qHRrM':function(_0x49eaba,_0x8e1a1b){return _0x49eaba(_0x8e1a1b);},'uFWsi':function(_0x5e5fad,_0x24b49d,_0xbe0053){return _0x5e5fad(_0x24b49d,_0xbe0053);},'qWxAN':function(_0x20ebea,_0x2efbbc,_0x24e622){return _0x20ebea(_0x2efbbc,_0x24e622);},'HSVyu':function(_0x492847,_0x19dfc7){return _0x492847(_0x19dfc7);}},_0x3565b1=sessionCacheHash({'orgId':_0x18c096,'profileName':_0x1ecba9,'effectiveBaseUrl':_0x206f03,'setupHeaders':_0x27fe32,'invalidateOn':_0x2c322a?.[_0x3f33ea(0x1e3)],'userAgent':_0x2c322a?.['userAgent'],'clientIp':_0x2c322a?.[_0x3f33ea(0x1c8)]}),_0x5d2ede=getSessionCachePath(_0x3565b1,_0x1ecba9),_0x11a808=_0x3baa73['SEdvC'](join,getRangerHomeDir(),_0x3baa73[_0x3f33ea(0x191)]);!_0x3baa73['qHRrM'](existsSync,_0x11a808)&&await _0x3baa73[_0x3f33ea(0x192)](mkdir,_0x11a808,{'recursive':!![]});const _0x499c81={..._0x3cc13a};_0x2b513d&&_0x2b513d['length']>0x0&&Array['isArray'](_0x499c81[_0x3f33ea(0x1da)])&&(_0x499c81['cookies']=duplicateCookiesForDomains(_0x499c81['cookies'],_0x2b513d));const _0xd4a5b3={'cached_at':new Date()['toISOString'](),'session_state':_0x499c81};await _0x3baa73['qWxAN'](writeFile,_0x5d2ede,JSON['stringify'](_0xd4a5b3,null,0x2));const _0x41bc72=_0x3baa73['HSVyu'](getStorageStatePath,_0x5d2ede);return await writeFile(_0x41bc72,JSON['stringify'](_0x499c81,null,0x2)),_0x41bc72;}export async function checkLocalCache(_0x30b101,_0x587f30,_0x5c5270,_0x2c0d04,_0x22c79d){const _0x2f7128=_0x2bae3a,_0x49f32e={'lzMjM':function(_0x45d469,_0x305f97){return _0x45d469(_0x305f97);},'uVNNy':function(_0xcb257b,_0x391cd6,_0x69beea){return _0xcb257b(_0x391cd6,_0x69beea);},'aVMzA':function(_0x7bfb6e,_0x41ded9){return _0x7bfb6e(_0x41ded9);},'kSGoH':function(_0x58721f,_0x3851e2){return _0x58721f(_0x3851e2);},'ezupd':function(_0x196ff8,_0x3f1dce,_0x6f71bb){return _0x196ff8(_0x3f1dce,_0x6f71bb);},'iqena':'utf-8'},_0x287385=_0x49f32e[_0x2f7128(0x148)](sessionCacheHash,{'orgId':_0x587f30,'profileName':_0x30b101,'effectiveBaseUrl':_0x5c5270,'setupHeaders':_0x2c0d04,'invalidateOn':_0x22c79d?.['invalidateOn'],'userAgent':_0x22c79d?.[_0x2f7128(0x1c2)],'clientIp':_0x22c79d?.[_0x2f7128(0x1c8)]}),_0x148f7a=_0x49f32e['uVNNy'](getSessionCachePath,_0x287385,_0x30b101),_0x99fcf7=_0x49f32e[_0x2f7128(0x1d6)](getStorageStatePath,_0x148f7a);if(!_0x49f32e[_0x2f7128(0x1d2)](existsSync,_0x148f7a)||!existsSync(_0x99fcf7))return null;try{const _0x331668=await _0x49f32e['ezupd'](readFile,_0x148f7a,_0x49f32e[_0x2f7128(0x14d)]);return JSON[_0x2f7128(0x17e)](_0x331668),{'storageStatePath':_0x99fcf7};}catch{return null;}}function launchRealBrowser(){return chromium['launch']({'headless':!![]});}function emitSessionValidationHint(_0x1ed773,_0x51e2dd){const _0x53a1d2=_0x2bae3a,_0x29ba72={'rpJBl':function(_0xb16418,_0x41d3ee){return _0xb16418+_0x41d3ee;}};if(!_0x51e2dd||!_0x51e2dd['domains']?.['length'])return;let _0x34e31b;try{_0x34e31b=new URL(_0x1ed773);}catch{return;}const _0xc3246e=[];for(const _0x529867 of _0x51e2dd[_0x53a1d2(0x206)]){try{_0xc3246e['push']({'raw':_0x529867,'url':new URL(_0x529867)});}catch{}}if(_0xc3246e['length']===0x0)return;if(_0xc3246e[_0x53a1d2(0x1d8)](_0x52ab83=>_0x52ab83[_0x53a1d2(0x187)][_0x53a1d2(0x17d)]===_0x34e31b[_0x53a1d2(0x17d)]))return;const _0x21664a=_0xc3246e['map'](_0x238aaf=>'\x22'+_0x238aaf['raw']+'\x22')['join'](',\x20');console[_0x53a1d2(0x1fe)](_0x29ba72[_0x53a1d2(0x19a)]('\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20'+_0x21664a+';\x20',_0x53a1d2(0x1cc)+_0x1ed773+'\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20')+_0x53a1d2(0x145));}export async function serverSideLogin(_0x56b84e,_0x3208e3){const _0x4d476a=_0x2bae3a,_0x26622d={'xTwoD':function(_0x42572a,_0x314b6c){return _0x42572a(_0x314b6c);},'stuxo':'POST','DVJae':function(_0x280d8d,_0x563b85){return _0x280d8d instanceof _0x563b85;},'hqTJi':function(_0x105180,_0x42c503){return _0x105180===_0x42c503;},'szyTS':_0x4d476a(0x147)},_0xcb445d=process['env'][_0x4d476a(0x189)],_0x396ef6=process[_0x4d476a(0x1f1)]['RANGER_TEST_PASSWORD'],_0xf32314={};if(_0xcb445d)_0xf32314['username']=_0xcb445d;if(_0x396ef6)_0xf32314[_0x4d476a(0x1ac)]=_0x396ef6;if(_0x3208e3?.['force'])_0xf32314['force']=!![];if(_0x3208e3?.['targetUrl'])_0xf32314['target_url']=_0x3208e3['targetUrl'];if(_0x3208e3?.[_0x4d476a(0x1f1)])_0xf32314['env']=_0x3208e3['env'];_0x3208e3?.['tunnel']&&(_0xf32314[_0x4d476a(0x1c6)]=_0x3208e3[_0x4d476a(0x188)]['sessionId'],_0xf32314[_0x4d476a(0x1b1)]=_0x3208e3['tunnel'][_0x4d476a(0x18a)]);try{return await apiRequest('/api/v1/profiles/'+_0x26622d[_0x4d476a(0x1fc)](encodeURIComponent,_0x56b84e)+'/login',{'method':_0x26622d['stuxo'],'body':JSON[_0x4d476a(0x14f)](_0xf32314)});}catch(_0x2c6800){if(_0x26622d['DVJae'](_0x2c6800,ApiError)&&_0x26622d[_0x4d476a(0x168)](_0x2c6800['status'],0x190)&&_0x2c6800['code']===_0x26622d['szyTS'])return{'status':_0x26622d[_0x4d476a(0x15d)],'error':_0x2c6800[_0x4d476a(0x17c)]};throw _0x2c6800;}}async function serverSideLoginWithOptionalTunnel(_0x2f81fb,_0x5c38f3,_0x43d799={}){const _0x3c88b3=_0x2bae3a,_0x170f9a={'RBzFX':_0x3c88b3(0x164),'XUqvD':function(_0x4fdb79,_0x1250a0){return _0x4fdb79(_0x1250a0);},'HBHfw':function(_0x345d9b,_0x4f05e1){return _0x345d9b(_0x4f05e1);},'RBkch':function(_0x56ff63,_0x3897af){return _0x56ff63(_0x3897af);},'Mknwo':function(_0x51d9d1,_0x449175){return _0x51d9d1===_0x449175;},'FMvjt':function(_0x1c2afa,_0x2c0991){return _0x1c2afa(_0x2c0991);},'UbWYG':function(_0x312744,_0xc7ce12){return _0x312744(_0xc7ce12);},'ugPqO':function(_0x52cf04,_0x198998){return _0x52cf04??_0x198998;},'sMqxp':function(_0x364fe9,_0x26ae5c){return _0x364fe9||_0x26ae5c;}};if(!_0x170f9a['RBkch'](needsTunnel,_0x5c38f3))return await serverSideLogin(_0x2f81fb,{'force':_0x43d799[_0x3c88b3(0x156)],'env':_0x43d799['env']});let _0x4eae84=null,_0x215ee3=null,_0x4b76c5=null,_0xf5a4bf=null,_0x18e125=![];const _0x223b28=process[_0x3c88b3(0x1f1)][_0x3c88b3(0x1f6)]?.['toLowerCase'](),_0x2c6fb2=_0x223b28==='1'||_0x170f9a[_0x3c88b3(0x1cb)](_0x223b28,'true'),_0x3b68c6={'profileName':_0x2f81fb,'targetUrlHost':_0x170f9a['FMvjt'](targetHostForTelemetry,_0x5c38f3),'tunnelRequired':!![],'forceLogin':_0x170f9a['UbWYG'](Boolean,_0x43d799['force']),'localBrowserServerHeaded':_0x2c6fb2};try{_0x43d799['telemetry']?.['trackPhaseStart']('tunnel_login_setup',_0x3b68c6);_0x2c6fb2&&console['log']('\x20\x20Debug:\x20launching\x20tunneled\x20login\x20browser\x20headed...');_0x4eae84=await launchBrowserServer({'headless':!_0x2c6fb2}),_0x215ee3=await _0x170f9a[_0x3c88b3(0x1c9)](createTunnelSession,_0x5c38f3);const _0x4bfb68=await requireToken();_0x4b76c5=await createTunnelBridge({'localWsUrl':_0x4eae84['wsEndpoint'],'tunnelServerUrl':_0x215ee3[_0x3c88b3(0x184)],'sessionId':_0x215ee3[_0x3c88b3(0x1a9)],'apiKey':_0x4bfb68,'onError':_0x35d8e2=>{_0xf5a4bf=_0x35d8e2;},'onClose':()=>{const _0x436c8e=_0x3c88b3;_0xf5a4bf??=new Error(_0x436c8e(0x1ad)+_0x2f81fb);},'onEvent':_0x57a9dc=>trackBridgeEvent(_0x43d799[_0x3c88b3(0x204)],_0x57a9dc)}),_0x43d799['telemetry']?.[_0x3c88b3(0x1ec)]('tunnel_login_setup',{..._0x3b68c6,'tunnelSessionId':_0x215ee3[_0x3c88b3(0x1a9)],'localBrowserServer':!![],'localBrowserServerHeaded':_0x2c6fb2}),_0x18e125=!![];try{return _0x43d799['telemetry']?.['trackPhaseStart'](_0x170f9a['RBzFX'],{..._0x3b68c6,'tunnelSessionId':_0x215ee3[_0x3c88b3(0x1a9)]}),await serverSideLogin(_0x2f81fb,{'force':_0x43d799['force'],'targetUrl':_0x5c38f3,'env':_0x43d799[_0x3c88b3(0x1f1)],'tunnel':{'sessionId':_0x215ee3['sessionId'],'pwEndpoint':_0x215ee3[_0x3c88b3(0x18a)]}})['then'](_0x5ab59b=>{const _0x188f88=_0x3c88b3;return _0x43d799[_0x188f88(0x204)]?.['trackPhaseEnd'](_0x170f9a['RBzFX'],{..._0x3b68c6,'tunnelSessionId':_0x215ee3?.[_0x188f88(0x1a9)],'loginStatus':_0x5ab59b['status'],'hasSessionState':Boolean(_0x5ab59b[_0x188f88(0x18d)]),'hasTestOutput':_0x170f9a['XUqvD'](Boolean,_0x5ab59b[_0x188f88(0x15e)]),'bridgeError':_0x170f9a[_0x188f88(0x1c9)](errorMessageForTelemetry,_0xf5a4bf)}),_0x5ab59b;});}catch(_0xa00ef3){await _0x43d799['telemetry']?.[_0x3c88b3(0x1e1)](_0x3c88b3(0x164),_0xf5a4bf??_0xa00ef3,{..._0x3b68c6,'tunnelSessionId':_0x215ee3[_0x3c88b3(0x1a9)],'bridgeError':errorMessageForTelemetry(_0xf5a4bf)});throw _0x170f9a[_0x3c88b3(0x1ea)](_0xf5a4bf,_0xa00ef3);}}catch(_0x25053d){!_0x18e125&&await _0x43d799[_0x3c88b3(0x204)]?.[_0x3c88b3(0x1e1)](_0x3c88b3(0x198),_0x25053d,{..._0x3b68c6,'tunnelSessionId':_0x215ee3?.[_0x3c88b3(0x1a9)]});throw _0x25053d;}finally{(_0x170f9a[_0x3c88b3(0x144)](_0x215ee3,_0x4eae84)||_0x4b76c5)&&(_0x43d799[_0x3c88b3(0x204)]?.[_0x3c88b3(0x161)](_0x3c88b3(0x197),{..._0x3b68c6,'tunnelSessionId':_0x215ee3?.['sessionId']}),_0x4b76c5?.['close'](),_0x4eae84&&await _0x4eae84[_0x3c88b3(0x175)]()[_0x3c88b3(0x1e7)](()=>{}),_0x215ee3&&await deleteTunnelSession(_0x215ee3['sessionId'])[_0x3c88b3(0x1e7)](()=>{}),_0x43d799['telemetry']?.[_0x3c88b3(0x1ec)](_0x3c88b3(0x197),{..._0x3b68c6,'tunnelSessionId':_0x215ee3?.[_0x3c88b3(0x1a9)]}));}}export async function manualBrowserLogin(_0x5a82ca,_0x4169ef,_0xaa7d84={}){const _0x4df16=_0x2bae3a,_0x1ca7ae={'NwQXb':function(_0x4a1ed7,_0x118c23,_0x41859b){return _0x4a1ed7(_0x118c23,_0x41859b);},'vOjhL':_0x4df16(0x175),'jngPP':function(_0x2bb0f7){return _0x2bb0f7();},'WOVpH':function(_0x3e82cf,_0x265671){return _0x3e82cf+_0x265671;},'BkFaR':function(_0xa681a7,_0x2e7d93){return _0xa681a7+_0x2e7d93;},'cczrt':_0x4df16(0x1b0),'VczwK':_0x4df16(0x1f8),'GeDDs':function(_0x17f636,_0x2460d8){return _0x17f636(_0x2460d8);},'Tyqts':function(_0x3638fe,_0x1eff05){return _0x3638fe&&_0x1eff05;},'hMctJ':'Browser\x20login\x20timed\x20out\x20before\x20completion.','CyzKd':'Browser\x20closed\x20before\x20authentication\x20was\x20saved.','pwgux':function(_0x2f8540,_0x8b81ec){return _0x2f8540!==_0x8b81ec;},'NPJjw':'POST'};if(!_0x1ca7ae[_0x4df16(0x1eb)](isInteractive))throw new Error(_0x1ca7ae[_0x4df16(0x150)](_0x1ca7ae['BkFaR'](_0x4df16(0x158)+_0x5a82ca['name']+'\x22.\x0a','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20'),_0x4df16(0x1d9)));const _0x4fca90=_0x4169ef&&_0x4169ef[_0x4df16(0x206)]['length']>0x0?_0x4169ef[_0x4df16(0x206)][0x0]:_0x1ca7ae['cczrt'];console['log'](_0x1ca7ae['VczwK']),console[_0x4df16(0x1fe)](_0x4df16(0x1e4)),await new Promise(_0x441e18=>setTimeout(_0x441e18,0x7d0));const _0x48bdef=await chromium[_0x4df16(0x194)]({'headless':![]});let _0x15b53f=null;try{const _0x3dc2ac={'ignoreHTTPSErrors':!![]};_0x4169ef?.['setupHeaders']&&(_0x3dc2ac['extraHTTPHeaders']=_0x4169ef[_0x4df16(0x1ae)]);const _0xe8c999=await _0x48bdef['newContext'](_0x3dc2ac);await _0x1ca7ae['GeDDs'](addProfileSetupBanner,_0xe8c999);const _0x424cae=await _0xe8c999[_0x4df16(0x149)]();await _0x424cae['goto'](_0x4fca90);let _0x3f5173=![];await new Promise(_0x33c620=>{const _0x53d505=_0x4df16,_0x5c65cf={'verZF':function(_0x2151c0,_0x2a9185){return _0x2151c0/_0x2a9185;}},_0x271c27=_0x1ca7ae[_0x53d505(0x1c1)](setTimeout,()=>{const _0x1d3395=_0x53d505;_0x3f5173=!![],console['error'](_0x1d3395(0x1e5)+_0x5c65cf['verZF'](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+'\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.'),_0x33c620();},MANUAL_LOGIN_TIMEOUT_MS);_0x424cae['on'](_0x1ca7ae['vOjhL'],async()=>{clearTimeout(_0x271c27);try{const _0x26826f=await _0xe8c999['storageState']();_0x15b53f=_0x26826f;}catch{}_0x33c620();});});if(_0x1ca7ae[_0x4df16(0x1cf)](_0x3f5173,!_0x15b53f))throw new Error(_0x1ca7ae['hMctJ']);}finally{await _0x48bdef[_0x4df16(0x175)]()[_0x4df16(0x1e7)](()=>{});}if(!_0x15b53f)throw new Error(_0x1ca7ae['CyzKd']);return _0x1ca7ae[_0x4df16(0x1e8)](_0xaa7d84[_0x4df16(0x153)],![])&&await _0x1ca7ae['NwQXb'](apiRequest,_0x4df16(0x151)+encodeURIComponent(_0x5a82ca[_0x4df16(0x183)])+'/session',{'method':_0x1ca7ae['NPJjw'],'body':JSON[_0x4df16(0x14f)]({'session_state':_0x15b53f,'updated_by':_0x4df16(0x19b)})}),{'sessionState':_0x15b53f};}export async function promptSaveCredentials(_0x10f4bf){const _0x5a7854=_0x2bae3a,_0x2a5e90={'zFNfI':function(_0x48a923,_0x1442d0){return _0x48a923||_0x1442d0;},'haXfY':_0x5a7854(0x1c3),'vPKuR':_0x5a7854(0x178),'GJMaU':function(_0x538824,_0x2d9158,_0xdf589){return _0x538824(_0x2d9158,_0xdf589);},'Yuovk':_0x5a7854(0x1b6)},_0x212c43=process[_0x5a7854(0x1f1)]['RANGER_TEST_USERNAME'],_0x4443db=process[_0x5a7854(0x1f1)][_0x5a7854(0x15f)];if(_0x2a5e90['zFNfI'](!_0x212c43,!_0x4443db))return;if(!isInteractive())return;const {save:_0x54552b}=await _0x4e34ea['prompt']([{'type':_0x2a5e90['haXfY'],'name':'save','message':_0x2a5e90['vPKuR'],'default':![]}]);if(!_0x54552b)return;await _0x2a5e90[_0x5a7854(0x185)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x10f4bf),{'method':_0x2a5e90['Yuovk'],'body':JSON['stringify']({'username':_0x212c43,'password':_0x4443db})}),console['log'](_0x5a7854(0x18b));}export async function resolveCloudProfileSession(_0x4b2f89,_0x3b47d4={}){const _0x231d5e=_0x2bae3a,_0x547a37={'SYFlL':function(_0x158f82){return _0x158f82();},'TjuLX':function(_0x1f8bc9,_0x25f7ea,_0xd5506d){return _0x1f8bc9(_0x25f7ea,_0xd5506d);},'HfnJY':_0x231d5e(0x1d4),'wDSbL':function(_0x5dc49e,_0x3a52cf){return _0x5dc49e||_0x3a52cf;},'absWR':function(_0x4b5458,_0x3222ae){return _0x4b5458(_0x3222ae);},'tuCMO':function(_0x264fb8,_0x4fd32f){return _0x264fb8>_0x4fd32f;},'WPYsC':function(_0x215b9d,_0x57e022,_0x302c0b,_0x360f63,_0x2f2235,_0x28d632){return _0x215b9d(_0x57e022,_0x302c0b,_0x360f63,_0x2f2235,_0x28d632);},'wcyNn':function(_0x1b04aa,_0x26290d,_0x30a334,_0x7bc9ad,_0x4535cc){return _0x1b04aa(_0x26290d,_0x30a334,_0x7bc9ad,_0x4535cc);},'pDAjr':function(_0x23e2ef,_0x5b688a,_0x440232){return _0x23e2ef(_0x5b688a,_0x440232);},'RtsRm':function(_0x48279b,_0x1ebdd4){return _0x48279b(_0x1ebdd4);},'yStzg':function(_0x82129b,_0x34f3da){return _0x82129b(_0x34f3da);},'iEHUW':function(_0xa543d8,_0x29c4a0,_0xca9e13){return _0xa543d8(_0x29c4a0,_0xca9e13);},'FUejt':_0x231d5e(0x147),'mBwqj':'success','GSnPA':'\x20\x20Login\x20successful.\x20Session\x20cached.','JGbrf':function(_0x24386f,_0x512046,_0x5944c4,_0x388031,_0x2a45bc,_0x441a0c,_0x58562c,_0x3753f8){return _0x24386f(_0x512046,_0x5944c4,_0x388031,_0x2a45bc,_0x441a0c,_0x58562c,_0x3753f8);},'boZrj':'\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','qIISM':function(_0x253870,_0x4c4b74){return _0x253870 instanceof _0x4c4b74;},'VZGUe':'\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','vRdoP':function(_0x518131,_0x5f0715){return _0x518131&&_0x5f0715;},'nrZKw':function(_0x6f8afc){return _0x6f8afc();},'whPuH':function(_0x173a6f,_0x257979){return _0x173a6f+_0x257979;},'UtPUq':_0x231d5e(0x179),'FFThf':function(_0x4f8613,_0x8317e1,_0x489d0e){return _0x4f8613(_0x8317e1,_0x489d0e);},'oSUmi':function(_0x1449a3,_0x14f504,_0x42e0fc,_0x3dd579,_0x42467d,_0x522a74,_0x1a7774,_0x12f4bf){return _0x1449a3(_0x14f504,_0x42e0fc,_0x3dd579,_0x42467d,_0x522a74,_0x1a7774,_0x12f4bf);}},_0x4adb67=_0x4b2f89[_0x231d5e(0x1c5)]??{},_0xadf20a=await _0x547a37['SYFlL'](fetchAuthConfig),_0x22d822=_0xadf20a?_0x547a37[_0x231d5e(0x160)](resolveAuthEnvironmentLocally,_0xadf20a,_0x3b47d4[_0x231d5e(0x1df)]??_0x4b2f89[_0x231d5e(0x1ba)]):null,_0x3ba38e=typeof _0x22d822?.['loginInstructions']===_0x547a37['HfnJY']&&_0x22d822[_0x231d5e(0x1be)]['trim']()?_0x22d822['loginInstructions']:undefined,_0x1b6358=typeof _0x4adb67[_0x231d5e(0x1be)]===_0x547a37[_0x231d5e(0x18f)]&&_0x4adb67[_0x231d5e(0x1be)]['trim']()?_0x4adb67[_0x231d5e(0x1be)]:undefined,_0x4c8770=_0x547a37[_0x231d5e(0x1f3)](_0x1b6358,!_0x3ba38e)?_0x4adb67:{..._0x4adb67,'loginInstructions':_0x3ba38e},_0xafd180=_0x547a37[_0x231d5e(0x1aa)](Boolean,_0x4c8770['loginInstructions']?.['trim']()),_0x6f3775=Boolean(_0x4adb67[_0x231d5e(0x195)]||_0x22d822?.[_0x231d5e(0x195)]),_0x3c8e1a=_0x22d822?.[_0x231d5e(0x206)],_0x5960fa=_0x4adb67['setupHeaders'],_0x513d15=_0x5960fa??_0x22d822?.[_0x231d5e(0x1ae)],_0x462bc3=_0x3b47d4[_0x231d5e(0x1bd)]??_0x4adb67['baseUrl']??(_0x3c8e1a&&_0x547a37[_0x231d5e(0x1b5)](_0x3c8e1a['length'],0x0)?_0x3c8e1a[0x0]:''),_0x2e4451=_0x462bc3?needsTunnel(_0x462bc3):![],_0x405eec={'invalidateOn':_0x22d822?.['invalidateOn'],'userAgent':_0x22d822?.[_0x231d5e(0x15b)]?.[_0x231d5e(0x1c2)]??_0x4adb67['userAgent']};_0x6f3775&&console['log'](_0x231d5e(0x17f)+_0x4b2f89['name']+_0x231d5e(0x16a));if(!_0x6f3775){const _0x2d21ec=await _0x547a37[_0x231d5e(0x177)](checkLocalCache,_0x4b2f89['name'],_0x4b2f89['organizationId'],_0x462bc3,_0x513d15,_0x405eec);if(_0x2d21ec){if(_0x462bc3&&!_0x2e4451){const _0x114055=await isCachedSessionLive(_0x2d21ec['storageStatePath'],_0x462bc3,{'sessionCheckPath':_0x22d822?.[_0x231d5e(0x182)],'setupHeaders':_0x513d15},{'launchBrowser':launchRealBrowser});if(_0x114055)return console['log'](_0x231d5e(0x19e)+_0x4b2f89['name']+'\x22'),{'authPath':_0x2d21ec[_0x231d5e(0x186)],'settings':_0x4c8770,'resolvedEnv':_0x22d822};console['log']('\x20\x20Cached\x20session\x20for\x20\x22'+_0x4b2f89[_0x231d5e(0x183)]+_0x231d5e(0x1b2)),_0x547a37['TjuLX'](emitSessionValidationHint,_0x462bc3,_0x22d822);}else return _0x2e4451&&console[_0x231d5e(0x1fe)](_0x231d5e(0x14c)+_0x4b2f89[_0x231d5e(0x183)]+'\x22'),{'authPath':_0x2d21ec[_0x231d5e(0x186)],'settings':_0x4c8770,'resolvedEnv':_0x22d822};}}if(!_0x6f3775&&_0x4b2f89[_0x231d5e(0x166)]){const _0x37aad9=await writeSessionToLocalCache(_0x4b2f89['name'],_0x4b2f89[_0x231d5e(0x157)],_0x462bc3,_0x513d15,_0x4b2f89['sessionState'],_0x3c8e1a,_0x405eec);if(_0x462bc3){const _0x34f2d0=await _0x547a37[_0x231d5e(0x1dc)](isCachedSessionLive,_0x37aad9,_0x462bc3,{'sessionCheckPath':_0x22d822?.[_0x231d5e(0x182)],'setupHeaders':_0x513d15},{'launchBrowser':launchRealBrowser});if(_0x34f2d0)return console['log']('\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22'+_0x4b2f89['name']+'\x22,\x20cached\x20locally'),{'authPath':_0x37aad9,'settings':_0x4c8770,'resolvedEnv':_0x22d822};console['log']('\x20\x20Cloud\x20session\x20for\x20\x22'+_0x4b2f89['name']+_0x231d5e(0x15a)),_0x547a37['pDAjr'](emitSessionValidationHint,_0x462bc3,_0x22d822);}else return{'authPath':_0x37aad9,'settings':_0x4c8770,'resolvedEnv':_0x22d822};}if(_0xafd180)return console[_0x231d5e(0x1fe)](_0x231d5e(0x207)+_0x4b2f89['name']+'\x22;\x20proceeding\x20with\x20loginInstructions.'),{'authPath':undefined,'settings':_0x4c8770,'resolvedEnv':_0x22d822};console[_0x231d5e(0x1fe)]('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x4b2f89['name']+_0x231d5e(0x1e0));const _0x2088d5=_0x547a37['RtsRm'](Boolean,process['env']['RANGER_TEST_USERNAME'])&&_0x547a37['yStzg'](Boolean,process[_0x231d5e(0x1f1)][_0x231d5e(0x15f)]),_0x3ecc2d=Boolean(_0x4b2f89['username']),_0x54b0b4=Boolean(_0x3b47d4['assertedEnv']),_0x1a6cad=_0x462bc3?_0x547a37[_0x231d5e(0x1a0)](isBareLocalhost,_0x462bc3):![],_0x491d6b=(_0x2088d5||_0x3ecc2d)&&_0x547a37[_0x231d5e(0x1f3)](!_0x1a6cad,_0x54b0b4);if(_0x491d6b)try{const _0x2b9e5e=_0x462bc3?await serverSideLoginWithOptionalTunnel(_0x4b2f89[_0x231d5e(0x183)],_0x462bc3,{'force':_0x6f3775,'telemetry':_0x3b47d4['telemetry'],'env':_0x3b47d4['assertedEnv']}):await _0x547a37[_0x231d5e(0x16e)](serverSideLogin,_0x4b2f89[_0x231d5e(0x183)],{'force':_0x6f3775,'env':_0x3b47d4[_0x231d5e(0x1df)]});if(_0x2b9e5e['status']===_0x547a37[_0x231d5e(0x1e2)])console[_0x231d5e(0x1fe)](_0x231d5e(0x181));else{if(_0x2b9e5e[_0x231d5e(0x19f)]===_0x547a37['mBwqj']&&_0x2b9e5e[_0x231d5e(0x18d)]){console['log'](_0x547a37['GSnPA']);const _0x3d2da1=await _0x547a37['JGbrf'](writeSessionToLocalCache,_0x4b2f89['name'],_0x4b2f89[_0x231d5e(0x157)],_0x462bc3,_0x513d15,_0x2b9e5e['session_state'],_0x3c8e1a,_0x405eec);return _0x2088d5&&!_0x3ecc2d&&await promptSaveCredentials(_0x4b2f89[_0x231d5e(0x183)]),{'authPath':_0x3d2da1,'settings':_0x4c8770,'resolvedEnv':_0x22d822};}else _0x2b9e5e[_0x231d5e(0x15e)]&&(console[_0x231d5e(0x1fe)](_0x547a37['boZrj']),console[_0x231d5e(0x1fe)](_0x2b9e5e['test_output'])),console['log'](_0x231d5e(0x1cd));}}catch(_0xdacff3){console['log']('\x20\x20Server-side\x20login\x20error:\x20'+(_0x547a37[_0x231d5e(0x203)](_0xdacff3,Error)?_0xdacff3[_0x231d5e(0x154)]:_0x547a37['absWR'](String,_0xdacff3))),console['log'](_0x547a37['VZGUe']);}if(_0x547a37['vRdoP'](_0x1a6cad,!_0x54b0b4)&&!_0x547a37['nrZKw'](isInteractive))throw new Error(_0x547a37[_0x231d5e(0x171)](_0x231d5e(0x193)+_0x462bc3+_0x231d5e(0x1a4)+_0x4b2f89['name']+_0x231d5e(0x1bb)+('\x20\x20•\x20capture\x20one\x20(a\x20browser\x20opens):\x20ranger\x20profile\x20add\x20'+_0x4b2f89[_0x231d5e(0x183)]+'\x20--url\x20'+_0x462bc3+'\x0a'),_0x547a37['UtPUq']));const _0x41a86d=_0x22d822?{..._0x22d822,'domains':_0x547a37[_0x231d5e(0x1b8)](orderLoginDomains,_0x462bc3,_0x22d822['domains']),'setupHeaders':_0x513d15}:_0x462bc3?{'key':_0x4b2f89['environmentKey']??'','domains':[_0x462bc3],'setupHeaders':_0x513d15}:null,{sessionState:_0x38021d}=await manualBrowserLogin(_0x4b2f89,_0x41a86d,{'persistSessionState':!_0x2e4451}),_0x1c7272=await _0x547a37[_0x231d5e(0x1d7)](writeSessionToLocalCache,_0x4b2f89['name'],_0x4b2f89['organizationId'],_0x462bc3,_0x513d15,_0x38021d,_0x3c8e1a,_0x405eec);return{'authPath':_0x1c7272,'settings':_0x4c8770,'resolvedEnv':_0x22d822};}
|
|
1
|
+
const _0x128150=_0x58e3;(function(_0x4b43ea,_0x1e53b7){const _0x2a0f63=_0x58e3,_0x54f78c=_0x4b43ea();while(!![]){try{const _0x4dd997=-parseInt(_0x2a0f63(0x1db))/0x1+parseInt(_0x2a0f63(0x203))/0x2*(-parseInt(_0x2a0f63(0x1eb))/0x3)+parseInt(_0x2a0f63(0x1cb))/0x4+-parseInt(_0x2a0f63(0x21e))/0x5*(parseInt(_0x2a0f63(0x160))/0x6)+-parseInt(_0x2a0f63(0x1a7))/0x7*(-parseInt(_0x2a0f63(0x210))/0x8)+parseInt(_0x2a0f63(0x175))/0x9*(parseInt(_0x2a0f63(0x1ba))/0xa)+-parseInt(_0x2a0f63(0x1b5))/0xb*(-parseInt(_0x2a0f63(0x1de))/0xc);if(_0x4dd997===_0x1e53b7)break;else _0x54f78c['push'](_0x54f78c['shift']());}catch(_0x150dbf){_0x54f78c['push'](_0x54f78c['shift']());}}}(_0xbd30,0xacb26));function _0x58e3(_0x567f99,_0x1ef247){_0x567f99=_0x567f99-0x15f;const _0xbd3090=_0xbd30();let _0x58e3f2=_0xbd3090[_0x567f99];return _0x58e3f2;}import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x329f71 from'inquirer';import{chromium}from'playwright';import{getApiBaseUrl}from'./environment.js';import{getToken}from'./keychain.js';import{getRangerHomeDir}from'./rangerRoot.js';import{addProfileSetupBanner}from'./profileSetupBanner.js';import{duplicateCookiesForDomains,getSessionCachePath,getStorageStatePath,isBareLocalhost,isCachedSessionLive,isInteractive,needsTunnel,orderLoginDomains,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';import{matchAuthEnvironmentByHost,matchAuthEnvironmentExact}from'./matchAuthEnvironment.js';import{createTunnelBridge,launchBrowserServer}from'./tunnelClient.js';function targetHostForTelemetry(_0x41440b){const _0x3ef00e=_0x58e3,_0x4db349={'inXPV':_0x3ef00e(0x165)};try{return new URL(_0x41440b)[_0x3ef00e(0x221)];}catch{return _0x4db349[_0x3ef00e(0x1e7)];}}function errorMessageForTelemetry(_0x3ddd32){const _0xe88ed9=_0x58e3;return _0x3ddd32 instanceof Error?_0x3ddd32[_0xe88ed9(0x167)]:undefined;}function trackBridgeEvent(_0x27a57b,_0x531b82){const _0x2df7fd=_0x58e3,_0x59b5d8={'YZoZS':'tunnel_bridge_event','Rzhvy':function(_0x38a1a8,_0x5431ee){return _0x38a1a8===_0x5431ee;},'inSNX':'local_ws_error','OZNyG':'tunnel_bridge'};if(!_0x27a57b)return;const _0x4a8f5c={'tunnelSessionId':_0x531b82[_0x2df7fd(0x1f4)],'tunnelEventType':_0x531b82[_0x2df7fd(0x21b)],'connectionId':_0x531b82['connectionId'],'code':_0x531b82[_0x2df7fd(0x1ac)],'reason':_0x531b82[_0x2df7fd(0x207)],'error':_0x531b82[_0x2df7fd(0x195)],'elapsedMs':_0x531b82['elapsedMs'],'activeLocalConnections':_0x531b82['activeLocalConnections'],'pendingLocalConnections':_0x531b82[_0x2df7fd(0x1d5)]};_0x27a57b['trackPhaseEnd'](_0x59b5d8[_0x2df7fd(0x163)],_0x4a8f5c),(_0x59b5d8[_0x2df7fd(0x1e4)](_0x531b82[_0x2df7fd(0x21b)],_0x2df7fd(0x1fd))||_0x59b5d8[_0x2df7fd(0x1e4)](_0x531b82[_0x2df7fd(0x21b)],_0x59b5d8['inSNX']))&&void _0x27a57b[_0x2df7fd(0x169)](_0x59b5d8[_0x2df7fd(0x1d6)],new Error(_0x531b82['error']??_0x531b82[_0x2df7fd(0x21b)]),_0x4a8f5c);}const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0x13af7b=await getToken();if(!_0x13af7b)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');return _0x13af7b;}async function apiRequest(_0x368cbc,_0x518975={}){const _0x196cb9=_0x58e3,_0xab03c4={'igskq':function(_0x47e7e7){return _0x47e7e7();},'APVvw':function(_0x47670f,_0x5b04d6,_0x24b894){return _0x47670f(_0x5b04d6,_0x24b894);},'bzIig':function(_0x32c007,_0x5a051b){return _0x32c007===_0x5a051b;},'uYacF':_0x196cb9(0x18b)},_0x1f4b81=await _0xab03c4['igskq'](requireToken),_0x2d596f=getApiBaseUrl(),_0xe28e40=await _0xab03c4[_0x196cb9(0x20c)](fetch,''+_0x2d596f+_0x368cbc,{..._0x518975,'headers':{'Authorization':'Bearer\x20'+_0x1f4b81,'Content-Type':'application/json',..._0x518975[_0x196cb9(0x1b0)]??{}}});if(!_0xe28e40['ok']){let _0x360589='',_0xca63fd;try{const _0x352e76=await _0xe28e40[_0x196cb9(0x1f1)](),_0x266a97=(_0xab03c4[_0x196cb9(0x20b)](typeof _0x352e76[_0x196cb9(0x195)],_0x196cb9(0x18b))?_0x352e76[_0x196cb9(0x195)]:undefined)??JSON[_0x196cb9(0x18e)](_0x352e76);_0x360589=_0x266a97;typeof _0x352e76[_0x196cb9(0x1b6)]===_0xab03c4[_0x196cb9(0x1bb)]&&_0x352e76['test_output']&&(_0x360589=_0x360589+'\x0a'+_0x352e76['test_output']);if(typeof _0x352e76['code']===_0xab03c4[_0x196cb9(0x1bb)])_0xca63fd=_0x352e76['code'];}catch{_0x360589=_0xe28e40[_0x196cb9(0x1be)];}throw new ApiError('API\x20request\x20'+_0x368cbc+'\x20failed\x20('+_0xe28e40[_0x196cb9(0x1a2)]+_0x196cb9(0x1c1)+_0x360589,_0xe28e40['status'],_0x360589,_0xca63fd);}if(_0xe28e40['status']===0xcc)return undefined;return _0xe28e40[_0x196cb9(0x1f1)]();}export class ApiError extends Error{[_0x128150(0x1a2)];[_0x128150(0x1cf)];['code'];constructor(_0x48c7b2,_0x12071b,_0x4cc786,_0x47b00e){const _0x3b5e30=_0x128150,_0x508c34={'mwTlL':'ApiError'};super(_0x48c7b2),this[_0x3b5e30(0x1a2)]=_0x12071b,this[_0x3b5e30(0x1cf)]=_0x4cc786,this['code']=_0x47b00e,this['name']=_0x508c34[_0x3b5e30(0x212)];}}export async function fetchCloudProfile(_0x206433){const _0x3657ff=_0x128150,_0x4d5dc8={'otSqT':function(_0x1bb786,_0x303dbd){return _0x1bb786===_0x303dbd;}};try{return await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x206433));}catch(_0x5ee23b){if(_0x5ee23b instanceof ApiError&&_0x4d5dc8['otSqT'](_0x5ee23b[_0x3657ff(0x1a2)],0x194))return null;throw _0x5ee23b;}}export async function listCloudProfiles(){const _0x3dded2=_0x128150,_0x314b25={'KpUuZ':'/api/v1/profiles'},_0xc65e6f=await apiRequest(_0x314b25[_0x3dded2(0x179)]);return _0xc65e6f[_0x3dded2(0x172)];}export async function deleteCloudProfile(_0x51d1b2){const _0x1c9683=_0x128150,_0x522f1b={'aBqCn':function(_0x1f6c39,_0x3cf79f,_0x28bdd6){return _0x1f6c39(_0x3cf79f,_0x28bdd6);},'lEXHO':_0x1c9683(0x1dd),'UctrC':function(_0x4183da,_0x2ad822){return _0x4183da instanceof _0x2ad822;}};try{await _0x522f1b['aBqCn'](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x51d1b2),{'method':_0x522f1b['lEXHO']});}catch(_0x39e8bb){if(_0x522f1b['UctrC'](_0x39e8bb,ApiError)&&_0x39e8bb['status']===0x194)throw new Error(_0x1c9683(0x187)+_0x51d1b2+'\x22\x20not\x20found.');throw _0x39e8bb;}}export async function createCloudProfile(_0x289cf3,_0x4e20f0,_0x105d63={}){const _0x15e6b4=_0x128150,_0x35b138={'QyXRf':function(_0x5b9557,_0x5cdb14){return _0x5b9557>_0x5cdb14;},'ejswp':function(_0x9025cf,_0x177d4a,_0x256259){return _0x9025cf(_0x177d4a,_0x256259);},'TrVTm':'/api/v1/profiles'},_0x43f83c={'name':_0x289cf3};if(_0x4e20f0)_0x43f83c[_0x15e6b4(0x176)]=_0x4e20f0;_0x105d63['settings']&&_0x35b138[_0x15e6b4(0x1e1)](Object[_0x15e6b4(0x1fa)](_0x105d63[_0x15e6b4(0x20d)])['length'],0x0)&&(_0x43f83c[_0x15e6b4(0x20d)]=_0x105d63['settings']);if(_0x105d63[_0x15e6b4(0x1d8)])_0x43f83c['username']=_0x105d63[_0x15e6b4(0x1d8)];if(_0x105d63['password'])_0x43f83c['password']=_0x105d63['password'];return await _0x35b138[_0x15e6b4(0x184)](apiRequest,_0x35b138['TrVTm'],{'method':_0x15e6b4(0x1a0),'body':JSON['stringify'](_0x43f83c)});}export async function uploadCloudProfileSession(_0x5a104c,_0xaaf14d){const _0x3ca12b=_0x128150,_0x4e66d8={'oZInz':function(_0x5186b9,_0x480419,_0x50add2){return _0x5186b9(_0x480419,_0x50add2);},'nPpAN':function(_0x2f33a0,_0x1bcbe1){return _0x2f33a0(_0x1bcbe1);}};return await _0x4e66d8['oZInz'](apiRequest,'/api/v1/profiles/'+_0x4e66d8[_0x3ca12b(0x1b9)](encodeURIComponent,_0x5a104c)+'/session',{'method':'POST','body':JSON[_0x3ca12b(0x18e)]({'session_state':_0xaaf14d})});}export async function saveCloudProfileCredentials(_0x67f4b,_0x3b0ea3,_0x2a374f){const _0x29b796=_0x128150;await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x67f4b),{'method':_0x29b796(0x1a5),'body':JSON[_0x29b796(0x18e)]({'username':_0x3b0ea3,'password':_0x2a374f})});}export async function fetchAuthConfig(){const _0x40fc02=_0x128150,_0x2ef2f6={'eSule':function(_0xf4e551,_0x14d1a0){return _0xf4e551 instanceof _0x14d1a0;},'BZsSF':function(_0x457b1d,_0x143e37){return _0x457b1d!==_0x143e37;}};try{const _0x53932e=await apiRequest(_0x40fc02(0x205));return _0x53932e[_0x40fc02(0x166)];}catch(_0x32e211){return _0x2ef2f6['eSule'](_0x32e211,ApiError)&&_0x2ef2f6[_0x40fc02(0x219)](_0x32e211[_0x40fc02(0x1a2)],0x194)&&console['error']('\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20'+_0x32e211['message']),null;}}function _0xbd30(){const _0x33c408=['Browser\x20login\x20timed\x20out\x20after\x20','Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20(','PUT','vqITV','203KNpNTb','oSIaU','userAgent','\x20\x20Server-side\x20login\x20error:\x20','\x22.\x0a','code','pLOpK','toISOString','tunnel_login_request','headers','trackPhaseEnd','LCRXP','rtzLx','BzEuD','11mflGdH','test_output','/api/v1/tunnel/sessions/','log','nPpAN','2069440ycidVa','uYacF','domains','join','statusText','\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.',').\x20','):\x20','/api/v1/profiles/','XuMrQ','GpaHa','newContext','RANGER_TEST_USERNAME','tunnel','fKpda','irjPD','\x22;\x20proceeding\x20with\x20loginInstructions.','2954304NkCbXk','\x20\x20Cloud\x20session\x20for\x20\x22','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','not_configured','detail','env','target_url','force','\x20\x20No\x20live\x20session\x20for\x20\x22','toLowerCase','pendingLocalConnections','OZNyG','\x20\x20Debug:\x20launching\x20tunneled\x20login\x20browser\x20headed...','username','\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','iOPJZ','1381971vsICDt','If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.','DELETE','6474108nyaEdz',');\x20pass\x20--env\x20<key>\x20to\x20pick\x20one.','upqXP','QyXRf','browserOptions','Tunnel\x20bridge\x20closed\x20before\x20login\x20completed\x20for\x20','Rzhvy','yOaua','sessionCheckPath','inXPV','KeAvp','\x22\x20is\x20bound\x20to\x20auth\x20env\x20\x22','assertedEnv','107259EELYdM','HpDre','XgpHw','oKTpq','\x20(auth\x20env:\x20','oISff','json','idPgu','persistSessionState','sessionId','rBCyA','VAatE','\x22\x20matched\x20by\x20host\x20for\x20','\x22\x20not\x20found\x20in\x20your\x20org\x27s\x20config.','\x22;\x20using\x20\x22','keys','\x20\x20Using\x20cached\x20local\x20session\x20for\x20cloud\x20profile\x20\x22','\x20(If\x20you\x20meant\x20a\x20profile,\x20use\x20--profile.)','tunnel_error','setupHeaders','targetUrl','\x20\x20Login\x20successful.\x20Session\x20cached.','/login','NQmYQ','46WusDZi','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','/api/v1/profiles/auth-config','ambiguous','reason','\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20','or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.','4|0|2|1|3','bzIig','APVvw','settings','storageState','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','307696OKicVp','HtBsr','mwTlL','trim','environmentKey','organizationId','lyrOk','Multiple\x20auth\x20environments\x20declare\x20this\x20host\x20(','XQRad','BZsSF','\x20\x20Cached\x20session\x20for\x20\x22','type','newPage','\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','67305rngJkM','FhAxT','parse','host','Auth\x20environment\x20\x22','138mPdqUq','tunnelUrl','cookies','YZoZS','url','invalid-url','auth_config','message','clientIp','trackPhaseError','save','BYdPw','UkTVM','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','iMSfX','utf-8','\x20--skip-auth`\x20for\x20an\x20unauthenticated\x20profile.','jUZMl','profiles','\x20\x20forceLogin\x20enabled\x20for\x20\x22','replace','36dbRRMZ','environment_key','key','sessionState','KpUuZ','tunnel_login_setup','mCcPt','telemetry','QnsQE','trackPhaseStart','loginInstructions','ybGET','length','iwxYI','catch','ejswp','\x20\x20Created\x20cloud\x20profile\x20\x22','\x20\x20-\x20ask\x20your\x20Ranger\x20admin\x20to\x20add\x20\x22','Cloud\x20profile\x20\x22','aeppc','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','success','string','prompt','KfomG','stringify','baseUrl','\x22\x20instead.','defaultEnvironmentKey','hTigw','EIgUP','environments','error','\x20\x20•\x20or\x20pass\x20--env\x20<key>\x20to\x20run\x20an\x20automated\x20login\x20for\x20this\x20target.','origin','lrFkp','tunnel_session_id','\x22\x20for\x20','name','eWIEF','OECpQ','push','RANGER_TEST_PASSWORD','POST','\x22\x20on\x20profile\x20\x22','status'];_0xbd30=function(){return _0x33c408;};return _0xbd30();}async function createTunnelSession(_0x5601cf){const _0x3b8db2=_0x128150,_0xfce5b5={'iOPJZ':'/api/v1/tunnel/sessions'};return await apiRequest(_0xfce5b5[_0x3b8db2(0x1da)],{'method':_0x3b8db2(0x1a0),'body':JSON['stringify']({'targetUrl':_0x5601cf,'mode':'agent'})});}async function deleteTunnelSession(_0x29f8c7){const _0x5c5806=_0x128150;await apiRequest(_0x5c5806(0x1b7)+_0x29f8c7,{'method':'DELETE'});}export function pickAdHocEnvKey(_0xc9d2e2,_0x181afc,_0x1f8487){const _0x32eee3=_0x128150,_0x7a8023={'HpDre':function(_0x55c7f1,_0x2c7ee0){return _0x55c7f1+_0x2c7ee0;},'KeAvp':_0x32eee3(0x21d),'UkTVM':function(_0x7dd4d,_0x5097ce,_0x37c392){return _0x7dd4d(_0x5097ce,_0x37c392);},'eWIEF':'key','hTigw':function(_0x55262a,_0x41d034){return _0x55262a in _0x41d034;},'AXNZe':'ambiguous','bceVp':function(_0x46b036,_0x2bf8f5){return _0x46b036(_0x2bf8f5);},'CIWsK':function(_0x17d93c,_0x5fbd10){return _0x17d93c+_0x5fbd10;},'upqXP':function(_0x455d3c,_0x2ceb89){return _0x455d3c===_0x2ceb89;}};if(_0x1f8487){if(!_0xc9d2e2?.['environments']?.[_0x1f8487]){const _0x53b5e9=Object['keys'](_0xc9d2e2?.[_0x32eee3(0x194)]??{});throw new Error(_0x7a8023[_0x32eee3(0x1ec)](_0x32eee3(0x15f)+_0x1f8487+_0x32eee3(0x1f8),_0x53b5e9[_0x32eee3(0x181)]?'\x20Available:\x20'+_0x53b5e9['join'](',\x20')+'.':_0x7a8023[_0x32eee3(0x1e8)])+_0x32eee3(0x1fc));}return _0x1f8487;}if(!_0xc9d2e2)return null;if(_0x181afc){const _0x4604f3=_0x7a8023['UkTVM'](matchAuthEnvironmentExact,_0x181afc,_0xc9d2e2);if(_0x4604f3)return _0x4604f3;const _0x36124e=_0x7a8023[_0x32eee3(0x16c)](matchAuthEnvironmentByHost,_0x181afc,_0xc9d2e2);if(_0x36124e&&_0x7a8023[_0x32eee3(0x19c)]in _0x36124e)return console[_0x32eee3(0x1b8)]('\x20\x20Auth\x20env\x20\x22'+_0x36124e[_0x32eee3(0x177)]+_0x32eee3(0x1f7)+_0x181afc+'\x20(declared\x20port\x20differs;\x20pass\x20--env\x20to\x20override).'),_0x36124e['key'];if(_0x36124e&&_0x7a8023[_0x32eee3(0x192)](_0x7a8023['AXNZe'],_0x36124e))throw new Error(_0x32eee3(0x217)+_0x36124e[_0x32eee3(0x206)]['join'](',\x20')+_0x32eee3(0x1df));if(_0x7a8023['bceVp'](needsTunnel,_0x181afc))throw new Error(_0x7a8023['CIWsK'](_0x7a8023[_0x32eee3(0x1ec)]('No\x20auth\x20environment\x20matches\x20the\x20local\x20target\x20\x22'+_0x181afc+_0x32eee3(0x1ab)+'\x20\x20Ranger\x20can\x27t\x20assume\x20your\x20org\x27s\x20default\x20login\x20flow\x20applies\x20to\x20an\x20arbitrary\x20local\x20app.\x0a'+'\x20\x20Options:\x0a','\x20\x20-\x20pass\x20`--env\x20<key>`\x20to\x20pick\x20the\x20auth\x20environment\x20by\x20name,\x20or\x0a')+(_0x32eee3(0x186)+_0x181afc[_0x32eee3(0x174)](/\/+$/,'')+'\x22\x20to\x20the\x20matching\x20auth\x20environment\x27s\x20domains,\x20or\x0a'),'\x20\x20-\x20run\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20'+_0x181afc+_0x32eee3(0x170)));}if(_0xc9d2e2[_0x32eee3(0x191)])return _0xc9d2e2['defaultEnvironmentKey'];const _0x2b8355=Object['keys'](_0xc9d2e2[_0x32eee3(0x194)]??{});if(_0x7a8023[_0x32eee3(0x1e0)](_0x2b8355[_0x32eee3(0x181)],0x1))return _0x2b8355[0x0];if(_0x7a8023['upqXP'](_0x2b8355['length'],0x0))return null;throw new Error(_0x32eee3(0x1a4)+_0x2b8355['join'](',\x20')+_0x32eee3(0x1c0)+'Pass\x20--base-url\x20<your-app-url>\x20so\x20Ranger\x20can\x20match\x20the\x20right\x20one,\x20or\x20create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`.');}export function adHocProfileName(_0x51c33e,_0x18f6aa,_0x47722b){if(!_0x18f6aa||_0x18f6aa===_0x47722b)return _0x51c33e;return _0x51c33e+':'+_0x18f6aa;}export async function resolveAdHocProfile(_0x2c9839={},_0x398a89=process[_0x128150(0x1d0)]){const _0x56ee0f=_0x128150,_0x403496={'mCcPt':function(_0xc625ab,_0xd8f844,_0x33e52e,_0x4b8832){return _0xc625ab(_0xd8f844,_0x33e52e,_0x4b8832);},'xvGGv':function(_0x5d74a3,_0x14c9d4,_0xe935a1,_0x5b03f1){return _0x5d74a3(_0x14c9d4,_0xe935a1,_0x5b03f1);},'iwxYI':function(_0x36e29c,_0x54b498){return _0x36e29c!==_0x54b498;},'EIgUP':function(_0x5cc333,_0xb10f5){return _0x5cc333(_0xb10f5);},'EYTzw':function(_0x39fb40,_0x4ac6c4){return _0x39fb40??_0x4ac6c4;}},_0x7aafa1=_0x398a89['RANGER_TEST_USERNAME'];if(!_0x7aafa1)return null;const _0x32690a=await fetchAuthConfig(),_0x43380e=_0x403496[_0x56ee0f(0x17b)](pickAdHocEnvKey,_0x32690a,_0x2c9839['targetUrl'],_0x2c9839['envKey']);let _0x327b37=_0x403496['xvGGv'](adHocProfileName,_0x7aafa1,_0x43380e,_0x32690a?.['defaultEnvironmentKey']),_0x9df5dc=await fetchCloudProfile(_0x327b37);_0x9df5dc&&_0x43380e&&_0x403496[_0x56ee0f(0x182)](_0x9df5dc[_0x56ee0f(0x214)],_0x43380e)&&(console['log']('\x20\x20Cloud\x20profile\x20\x22'+_0x327b37+_0x56ee0f(0x1e9)+(_0x9df5dc[_0x56ee0f(0x214)]??'none')+'\x22\x20but\x20this\x20run\x20resolved\x20env\x20\x22'+_0x43380e+_0x56ee0f(0x1f9)+_0x7aafa1+':'+_0x43380e+_0x56ee0f(0x190)),_0x327b37=_0x7aafa1+':'+_0x43380e,_0x9df5dc=await _0x403496[_0x56ee0f(0x193)](fetchCloudProfile,_0x327b37));if(_0x9df5dc)return{'name':_0x9df5dc[_0x56ee0f(0x19b)],'profile':_0x9df5dc};const _0x3d279b=_0x398a89['RANGER_TEST_PASSWORD'],_0x2d4760=await _0x403496[_0x56ee0f(0x17b)](createCloudProfile,_0x327b37,_0x403496['EYTzw'](_0x43380e,undefined),{'username':_0x7aafa1,'password':_0x3d279b});return console['log'](_0x56ee0f(0x185)+_0x2d4760['name']+_0x56ee0f(0x19a)+_0x7aafa1+(_0x43380e?_0x56ee0f(0x1ef)+_0x43380e+')':'')),{'name':_0x2d4760['name'],'profile':_0x2d4760};}export async function writeSessionToLocalCache(_0x3428d1,_0x28297b,_0x3cc748,_0x1c1771,_0x13c6a2,_0x360c7c,_0x2e5701){const _0x3d5189=_0x128150,_0x20ba28={'XgpHw':function(_0x1e87f4,_0x2b7cf6){return _0x1e87f4(_0x2b7cf6);},'ybGET':function(_0x17dff0,_0x3271a3,_0x5788a5){return _0x17dff0(_0x3271a3,_0x5788a5);},'oISff':'auth','Lsnlm':function(_0x46db83,_0x380a8a,_0x288f81){return _0x46db83(_0x380a8a,_0x288f81);}},_0x2fdea9=_0x20ba28[_0x3d5189(0x1ed)](sessionCacheHash,{'orgId':_0x28297b,'profileName':_0x3428d1,'effectiveBaseUrl':_0x3cc748,'setupHeaders':_0x1c1771,'invalidateOn':_0x2e5701?.['invalidateOn'],'userAgent':_0x2e5701?.['userAgent'],'clientIp':_0x2e5701?.['clientIp']}),_0x197b3c=_0x20ba28[_0x3d5189(0x180)](getSessionCachePath,_0x2fdea9,_0x3428d1),_0x4184e2=join(getRangerHomeDir(),_0x20ba28[_0x3d5189(0x1f0)]);!existsSync(_0x4184e2)&&await mkdir(_0x4184e2,{'recursive':!![]});const _0x4972b3={..._0x13c6a2};_0x360c7c&&_0x360c7c[_0x3d5189(0x181)]>0x0&&Array['isArray'](_0x4972b3[_0x3d5189(0x162)])&&(_0x4972b3[_0x3d5189(0x162)]=duplicateCookiesForDomains(_0x4972b3['cookies'],_0x360c7c));const _0x26bf2c={'cached_at':new Date()[_0x3d5189(0x1ae)](),'session_state':_0x4972b3};await _0x20ba28['Lsnlm'](writeFile,_0x197b3c,JSON['stringify'](_0x26bf2c,null,0x2));const _0x31bb0f=getStorageStatePath(_0x197b3c);return await _0x20ba28['Lsnlm'](writeFile,_0x31bb0f,JSON[_0x3d5189(0x18e)](_0x4972b3,null,0x2)),_0x31bb0f;}export async function checkLocalCache(_0x13a50f,_0x1aa35c,_0x18aecb,_0x1ba1b5,_0x450f54){const _0x2f924f=_0x128150,_0x1c0e8b={'PDJAG':function(_0x4b9040,_0x1b661f){return _0x4b9040(_0x1b661f);},'BYdPw':function(_0x4a96d4,_0x176436,_0x3ea428){return _0x4a96d4(_0x176436,_0x3ea428);},'oQTAB':function(_0x4f64f1,_0x55ca10){return _0x4f64f1(_0x55ca10);}},_0x5a5a57=_0x1c0e8b['PDJAG'](sessionCacheHash,{'orgId':_0x1aa35c,'profileName':_0x13a50f,'effectiveBaseUrl':_0x18aecb,'setupHeaders':_0x1ba1b5,'invalidateOn':_0x450f54?.['invalidateOn'],'userAgent':_0x450f54?.['userAgent'],'clientIp':_0x450f54?.[_0x2f924f(0x168)]}),_0x59bf4f=_0x1c0e8b[_0x2f924f(0x16b)](getSessionCachePath,_0x5a5a57,_0x13a50f),_0x5614e1=_0x1c0e8b['PDJAG'](getStorageStatePath,_0x59bf4f);if(!_0x1c0e8b['oQTAB'](existsSync,_0x59bf4f)||!existsSync(_0x5614e1))return null;try{const _0x2164c3=await readFile(_0x59bf4f,_0x2f924f(0x16f));return JSON[_0x2f924f(0x220)](_0x2164c3),{'storageStatePath':_0x5614e1};}catch{return null;}}function launchRealBrowser(){return chromium['launch']({'headless':!![]});}function emitSessionValidationHint(_0x5a40f2,_0x394e9c){const _0x149b61=_0x128150,_0x895ff6={'KfomG':function(_0x56e5fe,_0x838fb6){return _0x56e5fe===_0x838fb6;},'RAbUD':function(_0x4cae9a,_0x51b797){return _0x4cae9a+_0x51b797;},'dapKE':function(_0x1ca7e7,_0x11253c){return _0x1ca7e7+_0x11253c;}};if(!_0x394e9c||!_0x394e9c['domains']?.[_0x149b61(0x181)])return;let _0x458afa;try{_0x458afa=new URL(_0x5a40f2);}catch{return;}const _0x9f8313=[];for(const _0x3ce531 of _0x394e9c[_0x149b61(0x1bc)]){try{_0x9f8313[_0x149b61(0x19e)]({'raw':_0x3ce531,'url':new URL(_0x3ce531)});}catch{}}if(_0x895ff6[_0x149b61(0x18d)](_0x9f8313['length'],0x0))return;if(_0x9f8313['some'](_0xbaeb63=>_0xbaeb63[_0x149b61(0x164)][_0x149b61(0x197)]===_0x458afa['origin']))return;const _0x47884d=_0x9f8313['map'](_0x12f8be=>'\x22'+_0x12f8be['raw']+'\x22')[_0x149b61(0x1bd)](',\x20');console[_0x149b61(0x1b8)](_0x895ff6['RAbUD'](_0x895ff6['dapKE']('\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20'+_0x47884d+';\x20','you\x27re\x20now\x20at\x20\x22'+_0x5a40f2+_0x149b61(0x208)),_0x149b61(0x1dc)));}export async function serverSideLogin(_0x37f62b,_0x18d4c4){const _0x5140a6=_0x128150,_0x351d9d={'dqJNh':function(_0x420435,_0x680722,_0x44e74f){return _0x420435(_0x680722,_0x44e74f);},'oSIaU':function(_0x30778c,_0x123e0b){return _0x30778c(_0x123e0b);},'BzEuD':function(_0x27f8c6,_0x4f9dd2){return _0x27f8c6===_0x4f9dd2;}},_0x56be3b=process[_0x5140a6(0x1d0)][_0x5140a6(0x1c6)],_0x14dfd6=process['env'][_0x5140a6(0x19f)],_0x5b322e={};if(_0x56be3b)_0x5b322e['username']=_0x56be3b;if(_0x14dfd6)_0x5b322e['password']=_0x14dfd6;if(_0x18d4c4?.['force'])_0x5b322e['force']=!![];if(_0x18d4c4?.[_0x5140a6(0x1ff)])_0x5b322e[_0x5140a6(0x1d1)]=_0x18d4c4[_0x5140a6(0x1ff)];if(_0x18d4c4?.['env'])_0x5b322e['env']=_0x18d4c4['env'];_0x18d4c4?.['tunnel']&&(_0x5b322e[_0x5140a6(0x199)]=_0x18d4c4['tunnel']['sessionId'],_0x5b322e['pw_endpoint']=_0x18d4c4[_0x5140a6(0x1c7)]['pwEndpoint']);try{return await _0x351d9d['dqJNh'](apiRequest,_0x5140a6(0x1c2)+_0x351d9d[_0x5140a6(0x1a8)](encodeURIComponent,_0x37f62b)+_0x5140a6(0x201),{'method':_0x5140a6(0x1a0),'body':JSON['stringify'](_0x5b322e)});}catch(_0x2f38b2){if(_0x2f38b2 instanceof ApiError&&_0x351d9d[_0x5140a6(0x1b4)](_0x2f38b2['status'],0x190)&&_0x351d9d[_0x5140a6(0x1b4)](_0x2f38b2['code'],'not_configured'))return{'status':_0x5140a6(0x1ce),'error':_0x2f38b2['detail']};throw _0x2f38b2;}}async function serverSideLoginWithOptionalTunnel(_0x3106c1,_0x4e2ad2,_0x4c4220={}){const _0x4a0c7b=_0x128150,_0x1bef9e={'aeppc':_0x4a0c7b(0x1af),'sQcJX':function(_0x426324,_0x3e519a){return _0x426324(_0x3e519a);},'rMcJy':function(_0x4fb3e0,_0x35ecc3){return _0x4fb3e0===_0x35ecc3;},'MTHnB':'true','FhAxT':_0x4a0c7b(0x1d7),'auiRK':function(_0x4c4905,_0x3f389d){return _0x4c4905(_0x3f389d);},'lrFkp':function(_0x4a018a,_0x3abda9){return _0x4a018a(_0x3abda9);},'BJKnS':function(_0x550724,_0x148fc5){return _0x550724(_0x148fc5);},'idPgu':function(_0x38358f,_0x408dfe,_0x7da630){return _0x38358f(_0x408dfe,_0x7da630);},'rBCyA':function(_0x456db3,_0x5186c9){return _0x456db3??_0x5186c9;},'tzKfm':function(_0x404667,_0x43c167){return _0x404667||_0x43c167;},'XuMrQ':function(_0x1178f4,_0x16c2c5){return _0x1178f4(_0x16c2c5);},'IOqbo':'tunnel_login_cleanup'};if(!needsTunnel(_0x4e2ad2))return await serverSideLogin(_0x3106c1,{'force':_0x4c4220['force'],'env':_0x4c4220[_0x4a0c7b(0x1d0)]});let _0x111476=null,_0xc71902=null,_0x5db885=null,_0x1e59f5=null,_0x21d418=![];const _0x20298b=process['env']['RANGER_TUNNEL_LOGIN_HEADED']?.[_0x4a0c7b(0x1d4)](),_0x34317f=_0x1bef9e['rMcJy'](_0x20298b,'1')||_0x20298b===_0x1bef9e['MTHnB'],_0x57c871={'profileName':_0x3106c1,'targetUrlHost':targetHostForTelemetry(_0x4e2ad2),'tunnelRequired':!![],'forceLogin':Boolean(_0x4c4220[_0x4a0c7b(0x1d2)]),'localBrowserServerHeaded':_0x34317f};try{_0x4c4220['telemetry']?.[_0x4a0c7b(0x17e)](_0x4a0c7b(0x17a),_0x57c871);_0x34317f&&console[_0x4a0c7b(0x1b8)](_0x1bef9e[_0x4a0c7b(0x21f)]);_0x111476=await _0x1bef9e['auiRK'](launchBrowserServer,{'headless':!_0x34317f}),_0xc71902=await _0x1bef9e[_0x4a0c7b(0x198)](createTunnelSession,_0x4e2ad2);const _0x1ed6b7=await requireToken();_0x5db885=await _0x1bef9e['BJKnS'](createTunnelBridge,{'localWsUrl':_0x111476['wsEndpoint'],'tunnelServerUrl':_0xc71902[_0x4a0c7b(0x161)],'sessionId':_0xc71902['sessionId'],'apiKey':_0x1ed6b7,'onError':_0x44cf32=>{_0x1e59f5=_0x44cf32;},'onClose':()=>{const _0x469245=_0x4a0c7b;_0x1e59f5??=new Error(_0x469245(0x1e3)+_0x3106c1);},'onEvent':_0x36a179=>trackBridgeEvent(_0x4c4220['telemetry'],_0x36a179)}),_0x4c4220[_0x4a0c7b(0x17c)]?.['trackPhaseEnd']('tunnel_login_setup',{..._0x57c871,'tunnelSessionId':_0xc71902['sessionId'],'localBrowserServer':!![],'localBrowserServerHeaded':_0x34317f}),_0x21d418=!![];try{return _0x4c4220['telemetry']?.['trackPhaseStart']('tunnel_login_request',{..._0x57c871,'tunnelSessionId':_0xc71902['sessionId']}),await _0x1bef9e[_0x4a0c7b(0x1f2)](serverSideLogin,_0x3106c1,{'force':_0x4c4220[_0x4a0c7b(0x1d2)],'targetUrl':_0x4e2ad2,'env':_0x4c4220['env'],'tunnel':{'sessionId':_0xc71902[_0x4a0c7b(0x1f4)],'pwEndpoint':_0xc71902['pwEndpoint']}})['then'](_0x4268b5=>{const _0x246cf5=_0x4a0c7b;return _0x4c4220['telemetry']?.[_0x246cf5(0x1b1)](_0x1bef9e[_0x246cf5(0x188)],{..._0x57c871,'tunnelSessionId':_0xc71902?.[_0x246cf5(0x1f4)],'loginStatus':_0x4268b5[_0x246cf5(0x1a2)],'hasSessionState':_0x1bef9e['sQcJX'](Boolean,_0x4268b5['session_state']),'hasTestOutput':Boolean(_0x4268b5['test_output']),'bridgeError':errorMessageForTelemetry(_0x1e59f5)}),_0x4268b5;});}catch(_0x3c6682){await _0x4c4220['telemetry']?.[_0x4a0c7b(0x169)]('tunnel_login_request',_0x1bef9e['rBCyA'](_0x1e59f5,_0x3c6682),{..._0x57c871,'tunnelSessionId':_0xc71902['sessionId'],'bridgeError':errorMessageForTelemetry(_0x1e59f5)});throw _0x1bef9e[_0x4a0c7b(0x1f5)](_0x1e59f5,_0x3c6682);}}catch(_0x4f47be){!_0x21d418&&await _0x4c4220['telemetry']?.['trackPhaseError'](_0x4a0c7b(0x17a),_0x4f47be,{..._0x57c871,'tunnelSessionId':_0xc71902?.['sessionId']});throw _0x4f47be;}finally{if(_0x1bef9e['tzKfm'](_0xc71902,_0x111476)||_0x5db885){const _0x5967bf=_0x4a0c7b(0x20a)['split']('|');let _0x531aa5=0x0;while(!![]){switch(_0x5967bf[_0x531aa5++]){case'0':_0x5db885?.['close']();continue;case'1':_0xc71902&&await _0x1bef9e[_0x4a0c7b(0x1c3)](deleteTunnelSession,_0xc71902['sessionId'])[_0x4a0c7b(0x183)](()=>{});continue;case'2':_0x111476&&await _0x111476['close']()['catch'](()=>{});continue;case'3':_0x4c4220['telemetry']?.['trackPhaseEnd'](_0x1bef9e['IOqbo'],{..._0x57c871,'tunnelSessionId':_0xc71902?.['sessionId']});continue;case'4':_0x4c4220[_0x4a0c7b(0x17c)]?.['trackPhaseStart']('tunnel_login_cleanup',{..._0x57c871,'tunnelSessionId':_0xc71902?.['sessionId']});continue;}break;}}}}export async function manualBrowserLogin(_0x4a57c8,_0xe202d6,_0x471442={}){const _0x908256=_0x128150,_0x5c28d8={'ULZPJ':function(_0x1de4a4){return _0x1de4a4();},'stApr':'close','cHHkG':function(_0x27e367,_0x4c9ebb){return _0x27e367+_0x4c9ebb;},'UxICH':_0x908256(0x1d9),'LCRXP':function(_0x3dbe1b,_0x5edeec){return _0x3dbe1b(_0x5edeec);},'vqITV':function(_0x3da7c2,_0x237147){return _0x3da7c2&&_0x237147;}};if(!isInteractive())throw new Error(_0x5c28d8['cHHkG']('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0x4a57c8['name']+_0x908256(0x1ab)+'\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20',_0x908256(0x209)));const _0x3de1f9=_0xe202d6&&_0xe202d6['domains'][_0x908256(0x181)]>0x0?_0xe202d6[_0x908256(0x1bc)][0x0]:'about:blank';console['log'](_0x908256(0x1bf)),console['log'](_0x5c28d8['UxICH']),await new Promise(_0x21c920=>setTimeout(_0x21c920,0x7d0));const _0x1d7282=await chromium['launch']({'headless':![]});let _0x408318=null;try{const _0x2a6a5f={'ignoreHTTPSErrors':!![]};_0xe202d6?.[_0x908256(0x1fe)]&&(_0x2a6a5f['extraHTTPHeaders']=_0xe202d6[_0x908256(0x1fe)]);const _0x4cd855=await _0x1d7282[_0x908256(0x1c5)](_0x2a6a5f);await _0x5c28d8[_0x908256(0x1b2)](addProfileSetupBanner,_0x4cd855);const _0x3f0c80=await _0x4cd855[_0x908256(0x21c)]();await _0x3f0c80['goto'](_0x3de1f9);let _0x401818=![];await new Promise(_0x468106=>{const _0x1469a4={'UBJpH':function(_0x27208f){return _0x27208f();},'zHDAY':function(_0xf740fc){return _0x5c28d8['ULZPJ'](_0xf740fc);}},_0x4dc606=setTimeout(()=>{const _0x34d31f=_0x58e3;_0x401818=!![],console[_0x34d31f(0x195)](_0x34d31f(0x1a3)+MANUAL_LOGIN_TIMEOUT_MS/0xea60+_0x34d31f(0x20f)),_0x1469a4['UBJpH'](_0x468106);},MANUAL_LOGIN_TIMEOUT_MS);_0x3f0c80['on'](_0x5c28d8['stApr'],async()=>{const _0x3824dd=_0x58e3;clearTimeout(_0x4dc606);try{const _0x63a573=await _0x4cd855[_0x3824dd(0x20e)]();_0x408318=_0x63a573;}catch{}_0x1469a4['zHDAY'](_0x468106);});});if(_0x5c28d8[_0x908256(0x1a6)](_0x401818,!_0x408318))throw new Error('Browser\x20login\x20timed\x20out\x20before\x20completion.');}finally{await _0x1d7282['close']()[_0x908256(0x183)](()=>{});}if(!_0x408318)throw new Error(_0x908256(0x16d));return _0x471442[_0x908256(0x1f3)]!==![]&&await apiRequest(_0x908256(0x1c2)+encodeURIComponent(_0x4a57c8['name'])+'/session',{'method':_0x908256(0x1a0),'body':JSON['stringify']({'session_state':_0x408318,'updated_by':'cli:manual-login'})}),{'sessionState':_0x408318};}export async function promptSaveCredentials(_0x3ced73){const _0x3821fb=_0x128150,_0x43f7b2={'oKTpq':function(_0x4f8a1b,_0x5b9d46){return _0x4f8a1b||_0x5b9d46;},'OECpQ':_0x3821fb(0x204),'NQmYQ':function(_0x345135,_0x35fb54,_0x309be6){return _0x345135(_0x35fb54,_0x309be6);},'EeNoT':_0x3821fb(0x1a5),'ELsKB':'\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.'},_0xf41663=process[_0x3821fb(0x1d0)]['RANGER_TEST_USERNAME'],_0x185652=process[_0x3821fb(0x1d0)]['RANGER_TEST_PASSWORD'];if(_0x43f7b2[_0x3821fb(0x1ee)](!_0xf41663,!_0x185652))return;if(!isInteractive())return;const {save:_0x32c9ba}=await _0x329f71[_0x3821fb(0x18c)]([{'type':'confirm','name':_0x3821fb(0x16a),'message':_0x43f7b2[_0x3821fb(0x19d)],'default':![]}]);if(!_0x32c9ba)return;await _0x43f7b2[_0x3821fb(0x202)](apiRequest,_0x3821fb(0x1c2)+encodeURIComponent(_0x3ced73),{'method':_0x43f7b2['EeNoT'],'body':JSON['stringify']({'username':_0xf41663,'password':_0x185652})}),console['log'](_0x43f7b2['ELsKB']);}export async function resolveCloudProfileSession(_0x2c1145,_0x10637f={}){const _0x233ec7=_0x128150,_0x451cc6={'QnsQE':function(_0x550bf8,_0x2c5876,_0x993004){return _0x550bf8(_0x2c5876,_0x993004);},'XQRad':function(_0x36d45e,_0x3fb176){return _0x36d45e||_0x3fb176;},'lyrOk':function(_0x50e97a,_0x3d7db1){return _0x50e97a(_0x3d7db1);},'GpaHa':function(_0x313ae1,_0x4e5f54,_0x4b7642,_0x1bd2ce,_0x462ed5,_0x49fd6c){return _0x313ae1(_0x4e5f54,_0x4b7642,_0x1bd2ce,_0x462ed5,_0x49fd6c);},'VAatE':function(_0x5738d3,_0x220969,_0x2de22c,_0xc7c65b,_0x5f56e0){return _0x5738d3(_0x220969,_0x2de22c,_0xc7c65b,_0x5f56e0);},'cMMYL':function(_0x44f433,_0x5570e8,_0x2bf4eb){return _0x44f433(_0x5570e8,_0x2bf4eb);},'ZiDnd':function(_0x329c3e,_0x4515de){return _0x329c3e(_0x4515de);},'cslXs':function(_0xd29e4,_0x49e779){return _0xd29e4(_0x49e779);},'yOaua':function(_0x294900,_0x55d445){return _0x294900(_0x55d445);},'irjPD':function(_0x51bb69,_0x567c79,_0x9dff0d,_0x4f9410){return _0x51bb69(_0x567c79,_0x9dff0d,_0x4f9410);},'fKpda':_0x233ec7(0x18a),'oqrfv':_0x233ec7(0x200),'pLOpK':function(_0x45f7a8,_0x1bfb3a){return _0x45f7a8&&_0x1bfb3a;},'XcrSu':function(_0x2be434,_0x507b4a){return _0x2be434(_0x507b4a);},'EzDJj':'\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','jUZMl':_0x233ec7(0x1cd),'xBtJZ':function(_0x5c064d,_0x2c080a){return _0x5c064d instanceof _0x2c080a;},'HtBsr':function(_0x1f3433){return _0x1f3433();},'rtzLx':function(_0x38e471,_0x332dfc){return _0x38e471+_0x332dfc;},'UaYHC':function(_0x1d4368,_0x4820dd){return _0x1d4368+_0x4820dd;},'iMSfX':_0x233ec7(0x196),'HDkaq':function(_0x338e37,_0x5876bd,_0x522e1d,_0x810a63,_0x844e52,_0x3e15d3,_0x18b161,_0x1dfe56){return _0x338e37(_0x5876bd,_0x522e1d,_0x810a63,_0x844e52,_0x3e15d3,_0x18b161,_0x1dfe56);}},_0x1b3a4e=_0x2c1145[_0x233ec7(0x20d)]??{},_0x412462=await fetchAuthConfig(),_0xbf54f6=_0x412462?_0x451cc6[_0x233ec7(0x17d)](resolveAuthEnvironmentLocally,_0x412462,_0x10637f[_0x233ec7(0x1ea)]??_0x2c1145[_0x233ec7(0x214)]):null,_0x2f4810=typeof _0xbf54f6?.[_0x233ec7(0x17f)]===_0x233ec7(0x18b)&&_0xbf54f6[_0x233ec7(0x17f)]['trim']()?_0xbf54f6[_0x233ec7(0x17f)]:undefined,_0x556363=typeof _0x1b3a4e[_0x233ec7(0x17f)]===_0x233ec7(0x18b)&&_0x1b3a4e[_0x233ec7(0x17f)]['trim']()?_0x1b3a4e['loginInstructions']:undefined,_0x188bbb=_0x451cc6[_0x233ec7(0x218)](_0x556363,!_0x2f4810)?_0x1b3a4e:{..._0x1b3a4e,'loginInstructions':_0x2f4810},_0x587010=_0x451cc6[_0x233ec7(0x216)](Boolean,_0x188bbb['loginInstructions']?.[_0x233ec7(0x213)]()),_0x32f896=Boolean(_0x1b3a4e['forceLogin']||_0xbf54f6?.['forceLogin']),_0xe6db56=_0xbf54f6?.[_0x233ec7(0x1bc)],_0x4acd87=_0x1b3a4e['setupHeaders'],_0x4325ac=_0x4acd87??_0xbf54f6?.[_0x233ec7(0x1fe)],_0x54072f=_0x10637f['effectiveBaseUrl']??_0x1b3a4e[_0x233ec7(0x18f)]??(_0xe6db56&&_0xe6db56['length']>0x0?_0xe6db56[0x0]:''),_0x21a66c=_0x54072f?needsTunnel(_0x54072f):![],_0x4dce12={'invalidateOn':_0xbf54f6?.['invalidateOn'],'userAgent':_0xbf54f6?.[_0x233ec7(0x1e2)]?.[_0x233ec7(0x1a9)]??_0x1b3a4e['userAgent']};_0x32f896&&console[_0x233ec7(0x1b8)](_0x233ec7(0x173)+_0x2c1145['name']+'\x22,\x20refreshing\x20session...');if(!_0x32f896){const _0x60a9e4=await _0x451cc6[_0x233ec7(0x1c4)](checkLocalCache,_0x2c1145['name'],_0x2c1145['organizationId'],_0x54072f,_0x4325ac,_0x4dce12);if(_0x60a9e4){if(_0x54072f&&!_0x21a66c){const _0x30352f=await _0x451cc6[_0x233ec7(0x1f6)](isCachedSessionLive,_0x60a9e4['storageStatePath'],_0x54072f,{'sessionCheckPath':_0xbf54f6?.[_0x233ec7(0x1e6)],'setupHeaders':_0x4325ac},{'launchBrowser':launchRealBrowser});if(_0x30352f)return console['log'](_0x233ec7(0x189)+_0x2c1145[_0x233ec7(0x19b)]+'\x22'),{'authPath':_0x60a9e4['storageStatePath'],'settings':_0x188bbb,'resolvedEnv':_0xbf54f6};console[_0x233ec7(0x1b8)](_0x233ec7(0x21a)+_0x2c1145['name']+'\x22\x20failed\x20validation\x20—\x20refreshing...'),_0x451cc6['cMMYL'](emitSessionValidationHint,_0x54072f,_0xbf54f6);}else return _0x21a66c&&console[_0x233ec7(0x1b8)](_0x233ec7(0x1fb)+_0x2c1145['name']+'\x22'),{'authPath':_0x60a9e4['storageStatePath'],'settings':_0x188bbb,'resolvedEnv':_0xbf54f6};}}if(!_0x32f896&&_0x2c1145[_0x233ec7(0x178)]){const _0x4650f1=await writeSessionToLocalCache(_0x2c1145[_0x233ec7(0x19b)],_0x2c1145[_0x233ec7(0x215)],_0x54072f,_0x4325ac,_0x2c1145['sessionState'],_0xe6db56,_0x4dce12);if(_0x54072f){const _0x1599b4=await isCachedSessionLive(_0x4650f1,_0x54072f,{'sessionCheckPath':_0xbf54f6?.['sessionCheckPath'],'setupHeaders':_0x4325ac},{'launchBrowser':launchRealBrowser});if(_0x1599b4)return console[_0x233ec7(0x1b8)]('\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22'+_0x2c1145['name']+'\x22,\x20cached\x20locally'),{'authPath':_0x4650f1,'settings':_0x188bbb,'resolvedEnv':_0xbf54f6};console['log'](_0x233ec7(0x1cc)+_0x2c1145[_0x233ec7(0x19b)]+'\x22\x20failed\x20validation\x20—\x20re-login\x20needed...'),_0x451cc6[_0x233ec7(0x17d)](emitSessionValidationHint,_0x54072f,_0xbf54f6);}else return{'authPath':_0x4650f1,'settings':_0x188bbb,'resolvedEnv':_0xbf54f6};}if(_0x587010)return console['log'](_0x233ec7(0x1d3)+_0x2c1145['name']+_0x233ec7(0x1ca)),{'authPath':undefined,'settings':_0x188bbb,'resolvedEnv':_0xbf54f6};console[_0x233ec7(0x1b8)](_0x233ec7(0x1d3)+_0x2c1145[_0x233ec7(0x19b)]+'\x22,\x20attempting\x20login...');const _0x3ff539=_0x451cc6['ZiDnd'](Boolean,process[_0x233ec7(0x1d0)][_0x233ec7(0x1c6)])&&Boolean(process['env']['RANGER_TEST_PASSWORD']),_0x25975b=Boolean(_0x2c1145['username']),_0x145526=_0x451cc6['cslXs'](Boolean,_0x10637f['assertedEnv']),_0x267ff5=_0x54072f?_0x451cc6[_0x233ec7(0x1e5)](isBareLocalhost,_0x54072f):![],_0x1f0c6b=(_0x3ff539||_0x25975b)&&(!_0x267ff5||_0x145526);if(_0x1f0c6b)try{const _0x40ce72=_0x54072f?await _0x451cc6[_0x233ec7(0x1c9)](serverSideLoginWithOptionalTunnel,_0x2c1145['name'],_0x54072f,{'force':_0x32f896,'telemetry':_0x10637f['telemetry'],'env':_0x10637f[_0x233ec7(0x1ea)]}):await serverSideLogin(_0x2c1145[_0x233ec7(0x19b)],{'force':_0x32f896,'env':_0x10637f['assertedEnv']});if(_0x40ce72[_0x233ec7(0x1a2)]===_0x233ec7(0x1ce))console['log']('\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...');else{if(_0x40ce72['status']===_0x451cc6[_0x233ec7(0x1c8)]&&_0x40ce72['session_state']){console['log'](_0x451cc6['oqrfv']);const _0x2fd663=await writeSessionToLocalCache(_0x2c1145[_0x233ec7(0x19b)],_0x2c1145['organizationId'],_0x54072f,_0x4325ac,_0x40ce72['session_state'],_0xe6db56,_0x4dce12);return _0x451cc6['pLOpK'](_0x3ff539,!_0x25975b)&&await _0x451cc6['XcrSu'](promptSaveCredentials,_0x2c1145['name']),{'authPath':_0x2fd663,'settings':_0x188bbb,'resolvedEnv':_0xbf54f6};}else _0x40ce72['test_output']&&(console['log'](_0x451cc6['EzDJj']),console['log'](_0x40ce72[_0x233ec7(0x1b6)])),console[_0x233ec7(0x1b8)](_0x451cc6['jUZMl']);}}catch(_0x4e289d){console['log'](_0x233ec7(0x1aa)+(_0x451cc6['xBtJZ'](_0x4e289d,Error)?_0x4e289d['message']:String(_0x4e289d))),console['log'](_0x451cc6[_0x233ec7(0x171)]);}if(_0x451cc6[_0x233ec7(0x1ad)](_0x267ff5,!_0x145526)&&!_0x451cc6[_0x233ec7(0x211)](isInteractive))throw new Error(_0x451cc6[_0x233ec7(0x1b3)](_0x451cc6['UaYHC']('No\x20saved\x20session\x20for\x20\x22'+_0x54072f+_0x233ec7(0x1a1)+_0x2c1145[_0x233ec7(0x19b)]+'\x22,\x20and\x20cloud\x20sessions\x20don\x27t\x20apply\x20to\x20localhost.\x0a','\x20\x20•\x20capture\x20one\x20(a\x20browser\x20opens):\x20ranger\x20profile\x20add\x20'+_0x2c1145[_0x233ec7(0x19b)]+'\x20--url\x20'+_0x54072f+'\x0a'),_0x451cc6[_0x233ec7(0x16e)]));const _0x303ce6=_0xbf54f6?{..._0xbf54f6,'domains':orderLoginDomains(_0x54072f,_0xbf54f6[_0x233ec7(0x1bc)]),'setupHeaders':_0x4325ac}:_0x54072f?{'key':_0x2c1145['environmentKey']??'','domains':[_0x54072f],'setupHeaders':_0x4325ac}:null,{sessionState:_0x5e7f7d}=await _0x451cc6[_0x233ec7(0x1c9)](manualBrowserLogin,_0x2c1145,_0x303ce6,{'persistSessionState':!_0x21a66c}),_0x398075=await _0x451cc6['HDkaq'](writeSessionToLocalCache,_0x2c1145['name'],_0x2c1145['organizationId'],_0x54072f,_0x4325ac,_0x5e7f7d,_0xe6db56,_0x4dce12);return{'authPath':_0x398075,'settings':_0x188bbb,'resolvedEnv':_0xbf54f6};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0xec4cfd=_0xca3b;(function(_0x5bf44c,_0x5ed329){const _0x8a0b8e=_0xca3b,_0x23a6f5=_0x5bf44c();while(!![]){try{const _0x59849c=parseInt(_0x8a0b8e(0x130))/0x1+-parseInt(_0x8a0b8e(0x108))/0x2+parseInt(_0x8a0b8e(0x136))/0x3*(-parseInt(_0x8a0b8e(0x122))/0x4)+parseInt(_0x8a0b8e(0x10f))/0x5+-parseInt(_0x8a0b8e(0x12a))/0x6*(-parseInt(_0x8a0b8e(0x11c))/0x7)+-parseInt(_0x8a0b8e(0x10a))/0x8*(-parseInt(_0x8a0b8e(0x124))/0x9)+parseInt(_0x8a0b8e(0x116))/0xa*(-parseInt(_0x8a0b8e(0x11a))/0xb);if(_0x59849c===_0x5ed329)break;else _0x23a6f5['push'](_0x23a6f5['shift']());}catch(_0xdcb83a){_0x23a6f5['push'](_0x23a6f5['shift']());}}}(_0x1757,0x68664));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x3dbbe4=process['env'],_0x325cf7={'stdin':process['stdin'],'stdout':process[_0xec4cfd(0x115)]}){const _0x5d1925=_0xec4cfd,_0x3936ad={'kTXBL':function(_0x5e7108,_0xf5c5d3){return _0x5e7108(_0xf5c5d3);}};if(_0x3dbbe4['CI'])return![];return Boolean(_0x325cf7[_0x5d1925(0x10e)][_0x5d1925(0x109)])&&_0x3936ad[_0x5d1925(0x121)](Boolean,_0x325cf7[_0x5d1925(0x115)][_0x5d1925(0x109)]);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x198bbf){const _0x32aaa8=_0xec4cfd,_0x352800={'QwgFw':'baseUrl','hOuex':_0x32aaa8(0x105),'eOJEO':'port','qHJpc':function(_0x187257,_0xe41488){return _0x187257(_0xe41488);},'PydKB':'userAgent','MRisd':function(_0x1804ae,_0x4aa26e){return _0x1804ae!==_0x4aa26e;},'GkpWg':'clientIp','yvRgK':'hex'},_0x5f5d5b=new Set(_0x198bbf[_0x32aaa8(0x101)]??DEFAULT_INVALIDATE_ON);_0x198bbf[_0x32aaa8(0x11e)]&&needsTunnel(_0x198bbf[_0x32aaa8(0x11e)])&&_0x5f5d5b[_0x32aaa8(0x126)](_0x352800['QwgFw']);const _0x575dcf={'orgId':_0x198bbf['orgId'],'profileName':_0x198bbf[_0x32aaa8(0x120)]};return _0x5f5d5b['has'](_0x352800['QwgFw'])&&(_0x575dcf[_0x32aaa8(0x11e)]=_0x198bbf[_0x32aaa8(0x11e)]),_0x5f5d5b[_0x32aaa8(0x107)](_0x352800['hOuex'])&&(_0x575dcf[_0x32aaa8(0x105)]=_0x198bbf[_0x32aaa8(0x105)]?sortObjectKeys(_0x198bbf['setupHeaders']):_0x198bbf['setupHeaders']),_0x5f5d5b[_0x32aaa8(0x107)](_0x352800[_0x32aaa8(0x127)])&&(_0x575dcf[_0x32aaa8(0x12d)]=_0x352800[_0x32aaa8(0x128)](extractPort,_0x198bbf['effectiveBaseUrl'])),_0x5f5d5b[_0x32aaa8(0x107)](_0x352800['PydKB'])&&_0x352800['MRisd'](_0x198bbf[_0x32aaa8(0x12c)],undefined)&&(_0x575dcf[_0x32aaa8(0x12c)]=_0x198bbf['userAgent']),_0x5f5d5b[_0x32aaa8(0x107)](_0x352800['GkpWg'])&&_0x352800[_0x32aaa8(0x117)](_0x198bbf[_0x32aaa8(0x100)],undefined)&&(_0x575dcf[_0x32aaa8(0x100)]=_0x198bbf['clientIp']),createHash(_0x32aaa8(0x119))['update'](JSON['stringify'](_0x575dcf))['digest'](_0x352800[_0x32aaa8(0x132)])['slice'](0x0,0xc);}function extractPort(_0x577c7a){const _0x114ef7=_0xec4cfd;try{return new URL(_0x577c7a)[_0x114ef7(0x12d)];}catch{return'';}}function _0xca3b(_0x36a995,_0x4ecdaf){_0x36a995=_0x36a995-0x100;const _0x1757bd=_0x1757();let _0xca3bee=_0x1757bd[_0x36a995];return _0xca3bee;}function sortObjectKeys(_0xe9cd1f){const _0x3ea7bf=_0xec4cfd,_0x2fe95f={};for(const _0x1ba0ae of Object[_0x3ea7bf(0x137)](_0xe9cd1f)[_0x3ea7bf(0x10b)]()){_0x2fe95f[_0x1ba0ae]=_0xe9cd1f[_0x1ba0ae];}return _0x2fe95f;}export function getSessionCachePath(_0x14fce1,_0x531a83){const _0xb73a21=_0xec4cfd,_0x16f034={'YRQvv':function(_0x17ca1b,_0x1afb89,_0x3125cc,_0x1f27a2){return _0x17ca1b(_0x1afb89,_0x3125cc,_0x1f27a2);},'mtHrr':_0xb73a21(0x102)};return _0x16f034[_0xb73a21(0x106)](join,getRangerHomeDir(),_0x16f034['mtHrr'],_0x14fce1+'-'+_0x531a83+_0xb73a21(0x125));}function _0x1757(){const _0x4a93fd=['1960UZfZHx','toString','effectiveBaseUrl','gGkhn','profileName','kTXBL','8SyMZzv','newPage','9SzRMwp','.json','add','eOJEO','qHJpc','fUzAd','2226zvtMqu','ArUec','userAgent','port','::1','map','98021dlgous','url','yvRgK','filter','startsWith','includes','622416GedPnI','keys','clientIp','invalidateOn','auth','localhost.','domcontentloaded','setupHeaders','YRQvv','has','136272CoFTuo','isTTY','3055432ZLndCU','sort','length','localhost','stdin','3192200hddvqb','newContext','domain','defaultEnvironmentKey','environments','replace','stdout','311570WcNsxJ','MRisd','hostname','sha256','110AlwNof','BNHWk'];_0x1757=function(){return _0x4a93fd;};return _0x1757();}export function getStorageStatePath(_0xc5910d){const _0x3a42c1=_0xec4cfd,_0x3ead53={'ageVJ':'.storageState.json'};return _0xc5910d[_0x3a42c1(0x114)](/\.json$/,_0x3ead53['ageVJ']);}export function needsTunnel(_0xadb6f4){const _0x364f29=_0xec4cfd,_0x3f631a={'ULNkS':function(_0x5ef569,_0x5b28c0){return _0x5ef569===_0x5b28c0;},'fUzAd':'.localhost','GKHMw':_0x364f29(0x103)};let _0x13e7b7;try{_0x13e7b7=new URL(_0xadb6f4)['hostname'];}catch{return![];}if(_0x3f631a['ULNkS'](_0x13e7b7,_0x364f29(0x10d))||_0x13e7b7==='127.0.0.1')return!![];if(_0x13e7b7['endsWith'](_0x3f631a[_0x364f29(0x129)]))return!![];if(_0x13e7b7[_0x364f29(0x135)](_0x3f631a['GKHMw']))return!![];return![];}export function isBareLocalhost(_0x3192c3){const _0x3dd517=_0xec4cfd,_0x41bc7b={'ArUec':function(_0x597f89,_0xdfe9cc){return _0x597f89===_0xdfe9cc;},'BNHWk':'127.0.0.1','gGkhn':_0x3dd517(0x12e)};let _0x15028b;try{_0x15028b=new URL(_0x3192c3)['hostname'];}catch{return![];}return _0x15028b==='localhost'||_0x41bc7b[_0x3dd517(0x12b)](_0x15028b,_0x41bc7b[_0x3dd517(0x11b)])||_0x15028b===_0x41bc7b[_0x3dd517(0x11f)]||_0x41bc7b['ArUec'](_0x15028b,'[::1]');}export function orderLoginDomains(_0x524f0b,_0x2a0c98){const _0x1480f1=_0xec4cfd,_0x357a19=_0x2a0c98??[];if(!_0x524f0b)return _0x357a19;return[_0x524f0b,..._0x357a19[_0x1480f1(0x133)](_0x5c5067=>_0x5c5067!==_0x524f0b)];}export function hostnameOf(_0x5e7e3e){const _0x26fd9e=_0xec4cfd;return new URL(_0x5e7e3e)[_0x26fd9e(0x118)];}export function duplicateCookiesForDomains(_0x48d56f,_0x5a40fa){const _0x59c66d=_0xec4cfd,_0x2f6776={'iZYQJ':function(_0x1f7401,_0x57de04){return _0x1f7401(_0x57de04);}},_0x2d0ec7=[..._0x48d56f],_0x4e7b70=new Set(_0x48d56f[_0x59c66d(0x12f)](_0x12b40=>_0x12b40[_0x59c66d(0x111)]));for(const _0x5cc250 of _0x5a40fa){let _0x1d0d4b;try{_0x1d0d4b=_0x2f6776['iZYQJ'](hostnameOf,_0x5cc250);}catch{continue;}if(!_0x1d0d4b)continue;const _0x612d3b=_0x1d0d4b[_0x59c66d(0x134)]('.')?_0x1d0d4b:'.'+_0x1d0d4b;if(_0x4e7b70[_0x59c66d(0x107)](_0x1d0d4b)||_0x4e7b70['has'](_0x612d3b))continue;for(const _0x1dd9d1 of _0x48d56f){_0x2d0ec7['push']({..._0x1dd9d1,'domain':_0x612d3b});}_0x4e7b70[_0x59c66d(0x126)](_0x612d3b);}return _0x2d0ec7;}export function resolveAuthEnvironmentLocally(_0x8166e4,_0x477bbc){const _0x20ffc8=_0xec4cfd,_0x250ca1={'QGpmz':function(_0x4ae093,_0xead802){return _0x4ae093===_0xead802;}},_0x24f10a=_0x8166e4[_0x20ffc8(0x113)];if(_0x477bbc){const _0x6f8244=_0x24f10a[_0x477bbc];if(!_0x6f8244)return null;return{'key':_0x477bbc,..._0x6f8244};}if(_0x8166e4[_0x20ffc8(0x112)]){const _0x2a63cb=_0x24f10a[_0x8166e4['defaultEnvironmentKey']];if(!_0x2a63cb)return null;return{'key':_0x8166e4[_0x20ffc8(0x112)],..._0x2a63cb};}const _0x1a3bfc=Object['keys'](_0x24f10a);if(_0x250ca1['QGpmz'](_0x1a3bfc[_0x20ffc8(0x10c)],0x1)){const _0x29af3f=_0x1a3bfc[0x0];return{'key':_0x29af3f,..._0x24f10a[_0x29af3f]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x1feb30,_0x254fdd){const _0x341cd4=_0xec4cfd;try{if(_0x254fdd)return new URL(_0x254fdd,_0x1feb30)[_0x341cd4(0x11d)]();return new URL(_0x1feb30)[_0x341cd4(0x11d)]();}catch{return null;}}export function looksLikeLoginUrl(_0x1db524){try{const _0xdd5a72=new URL(_0x1db524);return LOGIN_URL_PATTERN['test'](_0xdd5a72['pathname']);}catch{return LOGIN_URL_PATTERN['test'](_0x1db524);}}export async function isCachedSessionLive(_0xc89c82,_0x48eaba,_0x49ef07={},_0x3466f6={}){const _0x1638c0=_0xec4cfd,_0xb1af0e={'vGNaG':function(_0x39a81e,_0x1dbeb0){return _0x39a81e(_0x1dbeb0);}},_0x925ae4=buildSessionCheckUrl(_0x48eaba,_0x49ef07['sessionCheckPath']);if(!_0x925ae4)return!![];if(!_0x3466f6['launchBrowser'])return!![];let _0x486017=null;try{_0x486017=await _0x3466f6['launchBrowser']();const _0x31f3d0=await _0x486017[_0x1638c0(0x110)]({'storageState':_0xc89c82,'ignoreHTTPSErrors':!![],..._0x49ef07['setupHeaders']?{'extraHTTPHeaders':_0x49ef07['setupHeaders']}:{}}),_0x2a9738=await _0x31f3d0[_0x1638c0(0x123)](),_0x5977c7=await _0x2a9738['goto'](_0x925ae4,{'waitUntil':_0x1638c0(0x104),'timeout':0x3a98}),_0x360f99=_0x5977c7?.['status']();if(_0x360f99===0x191||_0x360f99===0x193)return![];const _0x4f4c0d=_0x2a9738[_0x1638c0(0x131)]();if(_0xb1af0e['vGNaG'](looksLikeLoginUrl,_0x4f4c0d))return![];return!![];}catch{return![];}finally{if(_0x486017)await _0x486017['close']()['catch'](()=>{});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x2092(_0xa1133c,_0x14bb48){_0xa1133c=_0xa1133c-0x1d2;const _0x1d0074=_0x1d00();let _0x2092db=_0x1d0074[_0xa1133c];return _0x2092db;}(function(_0x2880ad,_0x4fb14b){const _0x53361e=_0x2092,_0x5c4ae4=_0x2880ad();while(!![]){try{const _0x2b53f3=parseInt(_0x53361e(0x1de))/0x1*(parseInt(_0x53361e(0x1d5))/0x2)+-parseInt(_0x53361e(0x1d6))/0x3*(-parseInt(_0x53361e(0x1d7))/0x4)+parseInt(_0x53361e(0x1da))/0x5+parseInt(_0x53361e(0x1e2))/0x6*(-parseInt(_0x53361e(0x1dd))/0x7)+-parseInt(_0x53361e(0x1dc))/0x8*(-parseInt(_0x53361e(0x1d8))/0x9)+-parseInt(_0x53361e(0x1d2))/0xa+-parseInt(_0x53361e(0x1d9))/0xb;if(_0x2b53f3===_0x4fb14b)break;else _0x5c4ae4['push'](_0x5c4ae4['shift']());}catch(_0x52aea1){_0x5c4ae4['push'](_0x5c4ae4['shift']());}}}(_0x1d00,0x49f9a));import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';const ALGORITHM='aes-256-gcm',SALT='ranger-auth-encryption',KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;export function deriveKey(_0x51cb4b){return pbkdf2Sync(_0x51cb4b,SALT,0x186a0,KEY_LENGTH,'sha256');}export function encrypt(_0x454cf0,_0x29fbc3){const _0x58d2e8=_0x2092,_0x4bc6c9={'tFqmE':function(_0x3bf1e5,_0x32ef6d,_0x3b36bc,_0x2d24a0){return _0x3bf1e5(_0x32ef6d,_0x3b36bc,_0x2d24a0);}},_0x27cc89=deriveKey(_0x29fbc3),_0x53edaa=randomBytes(IV_LENGTH),_0x58ee76=_0x4bc6c9['tFqmE'](createCipheriv,ALGORITHM,_0x27cc89,_0x53edaa),_0x490c2b=Buffer[_0x58d2e8(0x1d4)]([_0x58ee76['update'](_0x454cf0,'utf8'),_0x58ee76[_0x58d2e8(0x1df)]()]),_0x56bf82=_0x58ee76['getAuthTag']();return Buffer['concat']([_0x53edaa,_0x56bf82,_0x490c2b]);}function _0x1d00(){const _0x4aba8f=['27TTcpQc','6285422Elrazv','2331940puMCYp','utf8','535064boYkve','133308pWGJwZ','158996GwcEvh','final','hsLsY','XOVfd','42rXEOOJ','3537990CSAfCe','subarray','concat','2ssgMpC','6dhwWjd','1070956Hlunfj'];_0x1d00=function(){return _0x4aba8f;};return _0x1d00();}export function decrypt(_0x1cf7e9,_0x2565d9){const _0x2252a9=_0x2092,_0x5499e5={'hsLsY':function(_0x1f1158,_0x240557){return _0x1f1158+_0x240557;},'XOVfd':_0x2252a9(0x1db)},_0x3b1ea1=deriveKey(_0x2565d9),_0x31ae85=_0x1cf7e9[_0x2252a9(0x1d3)](0x0,IV_LENGTH),_0x55b44d=_0x1cf7e9[_0x2252a9(0x1d3)](IV_LENGTH,_0x5499e5[_0x2252a9(0x1e0)](IV_LENGTH,TAG_LENGTH)),_0x33812a=_0x1cf7e9[_0x2252a9(0x1d3)](_0x5499e5['hsLsY'](IV_LENGTH,TAG_LENGTH)),_0x7a3a54=createDecipheriv(ALGORITHM,_0x3b1ea1,_0x31ae85);return _0x7a3a54['setAuthTag'](_0x55b44d),_0x5499e5['hsLsY'](_0x7a3a54['update'](_0x33812a),_0x7a3a54['final'](_0x5499e5[_0x2252a9(0x1e1)]));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function _0x10af(){const _0x5a5c6d=['18FbKKNu','errorType','169822ROzYHa','stringify','5486960LZtdSg','featureId','--credentials','vJmrM','Missing\x20required\x20argument','SnnXO','error','--header','3fqSlCH','qPNgG','catch','env','[desire-path]\x20Sending\x20log\x20to\x20','1268428LyKcIs','[desire-path]\x20Failed\x20to\x20send:\x20','13YRIHtL','slice','Unknown\x20argument','some','runtime_error','1355568cyltVB','Authorization','unknown_command','errorMessage','8BeYGhX','application/json','unknown','gLyYe','push','has_token','825627FdXUFP','includes','--auth','--token','lbpMm','6XSyJJr','fpGbV','3ivqdUM','28846536yUHlmc','indexOf','unknown_argument','3517235JosxSR','metadata','toLowerCase','stdout','/api/v1/mcp/desire-path-logs','mHmnO','Not\x20enough\x20non-option\x20arguments','sessionId'];_0x10af=function(){return _0x5a5c6d;};return _0x10af();}const _0xa82ba5=_0x8967;(function(_0x59948d,_0x4d8ed3){const _0x51997e=_0x8967,_0x49f777=_0x59948d();while(!![]){try{const _0x3d1768=-parseInt(_0x51997e(0x139))/0x1*(parseInt(_0x51997e(0x12f))/0x2)+-parseInt(_0x51997e(0x121))/0x3*(-parseInt(_0x51997e(0x145))/0x4)+-parseInt(_0x51997e(0x125))/0x5*(parseInt(_0x51997e(0x11f))/0x6)+parseInt(_0x51997e(0x13e))/0x7*(parseInt(_0x51997e(0x149))/0x8)+-parseInt(_0x51997e(0x12d))/0x9*(parseInt(_0x51997e(0x131))/0xa)+-parseInt(_0x51997e(0x14f))/0xb+parseInt(_0x51997e(0x122))/0xc*(parseInt(_0x51997e(0x140))/0xd);if(_0x3d1768===_0x4d8ed3)break;else _0x49f777['push'](_0x49f777['shift']());}catch(_0x4f4d6a){_0x49f777['push'](_0x49f777['shift']());}}}(_0x10af,0xc1b01));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';function _0x8967(_0x481d24,_0x3532fd){_0x481d24=_0x481d24-0x11d;const _0x10afdf=_0x10af();let _0x8967cc=_0x10afdf[_0x481d24];return _0x8967cc;}import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set([_0xa82ba5(0x11d),'-t','--secret','--api-key','--apikey','--key','--password','--pass',_0xa82ba5(0x151),'--authorization',_0xa82ba5(0x138),'--cookie',_0xa82ba5(0x133)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0x2c2765){const _0x306b41=_0xa82ba5;return TOKEN_PATTERNS[_0x306b41(0x143)](_0xb0f070=>_0xb0f070['test'](_0x2c2765));}export function sanitizeArgs(_0x2ef4cd){const _0x5b8704=_0xa82ba5,_0x246060={'qPNgG':function(_0x51f4de,_0x40a201){return _0x51f4de<_0x40a201;},'FpNMs':function(_0x48a0c5,_0x794124){return _0x48a0c5!==_0x794124;},'vJmrM':function(_0x4248b2,_0x585358){return _0x4248b2(_0x585358);}},_0x5d3d0b=[];let _0x5d7933=![];for(let _0x491a63=0x0;_0x246060[_0x5b8704(0x13a)](_0x491a63,_0x2ef4cd['length']);_0x491a63++){const _0x40866f=_0x2ef4cd[_0x491a63];if(_0x5d7933){_0x5d3d0b[_0x5b8704(0x14d)]('[REDACTED]'),_0x5d7933=![];continue;}if(_0x40866f['startsWith']('--')||_0x40866f['startsWith']('-')){const _0x4a16f2=_0x40866f[_0x5b8704(0x123)]('=');if(_0x246060['FpNMs'](_0x4a16f2,-0x1)){const _0x322be7=_0x40866f[_0x5b8704(0x141)](0x0,_0x4a16f2)[_0x5b8704(0x127)]();if(SENSITIVE_FLAGS['has'](_0x322be7)){_0x5d3d0b[_0x5b8704(0x14d)](_0x40866f['slice'](0x0,_0x4a16f2)+'=[REDACTED]');continue;}}else{const _0x2482c6=_0x40866f[_0x5b8704(0x127)]();SENSITIVE_FLAGS['has'](_0x2482c6)&&(_0x5d7933=!![]);}_0x5d3d0b['push'](_0x40866f);}else _0x246060[_0x5b8704(0x134)](looksLikeToken,_0x40866f)?_0x5d3d0b['push']('[REDACTED]'):_0x5d3d0b['push'](_0x40866f);}return _0x5d3d0b['join']('\x20');}export async function logDesirePath(_0xd9fb4e){const _0x524178=_0xa82ba5,_0x54475c={'mHmnO':function(_0x4f25a6){return _0x4f25a6();},'jCmOZ':_0x524178(0x14e),'boYbY':_0x524178(0x14a),'YobDF':_0x524178(0x146),'SnnXO':'POST'};try{const _0x3a83ca=await _0x54475c[_0x524178(0x12a)](getToken)[_0x524178(0x13b)](()=>null),_0x2cbcc2=getApiBaseUrl(),_0x21413a=_0x54475c[_0x524178(0x12a)](getCurrentVersion),_0x4e0e33=_0x3a83ca?_0x54475c['jCmOZ']:'no_token',_0x22413a={..._0xd9fb4e[_0x524178(0x126)],'authStatus':_0x4e0e33,'isTty':process[_0x524178(0x128)]['isTTY']??![]},_0x537f0c={'Content-Type':_0x54475c['boYbY']};_0x3a83ca&&(_0x537f0c[_0x54475c['YobDF']]='Bearer\x20'+_0x3a83ca);const _0x42c0ca={'rawCommand':_0xd9fb4e['rawCommand'],'errorMessage':_0xd9fb4e[_0x524178(0x148)],'errorType':_0xd9fb4e[_0x524178(0x12e)],'featureId':_0xd9fb4e[_0x524178(0x132)],'sessionId':_0xd9fb4e[_0x524178(0x12c)],'metadata':_0x22413a,'cliVersion':_0x21413a};process[_0x524178(0x13c)]['DEBUG']&&(console['error'](_0x524178(0x13d)+_0x2cbcc2+_0x524178(0x129)),console[_0x524178(0x137)]('[desire-path]\x20Payload:\x20'+JSON[_0x524178(0x130)](_0x42c0ca,null,0x2))),await fetch(_0x2cbcc2+'/api/v1/mcp/desire-path-logs',{'method':_0x54475c[_0x524178(0x136)],'headers':_0x537f0c,'body':JSON['stringify'](_0x42c0ca)});}catch(_0x2ee626){process[_0x524178(0x13c)]['DEBUG']&&console[_0x524178(0x137)](_0x524178(0x13f)+_0x2ee626);}}export function getErrorType(_0x2805b3,_0x4e1658){const _0xdd2bf2=_0xa82ba5,_0x41e3a2={'lbpMm':'Unknown\x20command','pPNbe':_0xdd2bf2(0x147),'puGFW':_0xdd2bf2(0x12b),'iQOVc':'missing_required_argument','fpGbV':'invalid_option_value','gLyYe':_0xdd2bf2(0x135),'LHzEi':'missing_option'};if(_0x4e1658)return _0xdd2bf2(0x144);if(!_0x2805b3)return _0xdd2bf2(0x14b);if(_0x2805b3['includes'](_0x41e3a2[_0xdd2bf2(0x11e)]))return _0x41e3a2['pPNbe'];if(_0x2805b3['includes'](_0xdd2bf2(0x142)))return _0xdd2bf2(0x124);if(_0x2805b3['includes'](_0x41e3a2['puGFW']))return _0x41e3a2['iQOVc'];if(_0x2805b3['includes']('Invalid\x20values'))return _0x41e3a2[_0xdd2bf2(0x120)];if(_0x2805b3[_0xdd2bf2(0x150)](_0x41e3a2[_0xdd2bf2(0x14c)]))return _0x41e3a2['LHzEi'];return'syntax_error';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x568548=_0x2e9d;(function(_0x13b141,_0x572245){const _0x4f1086=_0x2e9d,_0xaefc99=_0x13b141();while(!![]){try{const _0x352505=parseInt(_0x4f1086(0xe9))/0x1+parseInt(_0x4f1086(0xc7))/0x2*(parseInt(_0x4f1086(0xfa))/0x3)+parseInt(_0x4f1086(0xe6))/0x4+parseInt(_0x4f1086(0xb2))/0x5*(-parseInt(_0x4f1086(0xb0))/0x6)+-parseInt(_0x4f1086(0xec))/0x7*(-parseInt(_0x4f1086(0xe1))/0x8)+-parseInt(_0x4f1086(0xf2))/0x9+-parseInt(_0x4f1086(0xd0))/0xa;if(_0x352505===_0x572245)break;else _0xaefc99['push'](_0xaefc99['shift']());}catch(_0x567701){_0xaefc99['push'](_0xaefc99['shift']());}}}(_0x3a6f,0x3ddf7));import{spawn}from'child_process';import _0x53bce5 from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';function _0x3a6f(){const _0x901f6e=['refresh_token','selected','authorization_pending','write','vKTHV','mcp:write','https://api.workos.com/user_management/authenticate','Failed\x20to\x20request\x20device\x20code:\x20','JTdOL','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20','expires_in','ZXoZN','GET','264386raSIAi','thqZe','kXUaO','AZAOL','RPLej','Failed\x20to\x20create\x20organization:\x20','aJudY','aMUyZ','utf-8','6885770phtEbI','bPkwr','stdin','organizationId','workosClientId','list','Failed\x20to\x20fetch\x20memberships:\x20','\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','SrdLZ','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20','Select\x20an\x20organization:','xdg-open','json','Code:\x20','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','access_token','32JZtkWt','text','verification_uri_complete','POST','Setting\x20up\x20your\x20organization...','1969560LHwmei','/api-keys','/organization/self-serve-signup','238298mmOWLG','unref','lsmQa','576597wtufqW','/cli-auth/token','Hsoaj','ERcAE','stringify','log','2397987ioZtNv','bPYlA','length','base64url','Authentication\x20failed','JyqXW','status','Provisioning\x20CLI\x20token...','6uSqZsM','sfNCD','token','Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','YYOek','application/x-www-form-urlencoded','yLzqY','error_description','BJylm','696642psXolC','name','5fjQrjJ','prompt','QZWKk','platform','memberships','JONFu','Using\x20organization:\x20','\x27s\x20CLI\x20Key'];_0x3a6f=function(){return _0x901f6e;};return _0x3a6f();}import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL='https://api.workos.com/user_management/authorize/device',WORKOS_TOKEN_URL=_0x568548(0xc0);export async function requestDeviceCode(_0x3bab6f){const _0xb02d70=_0x568548,_0x3163fb={'aMUyZ':_0xb02d70(0xe4),'thqZe':_0xb02d70(0xff)},_0x10b79b=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x3163fb[_0xb02d70(0xce)],'headers':{'Content-Type':_0x3163fb[_0xb02d70(0xc8)]},'body':new URLSearchParams({'client_id':_0x3bab6f})});if(!_0x10b79b['ok']){const _0x49f751=await _0x10b79b[_0xb02d70(0xe2)]();throw new Error(_0xb02d70(0xc1)+_0x10b79b['status']+'\x20'+_0x49f751);}return _0x10b79b[_0xb02d70(0xdd)]();}export async function pollForTokens(_0x2d1155,_0x3ce9ae,_0xef25b0,_0x5bec49){const _0x44e8a6=_0x568548,_0x3ad099={'kcQvv':function(_0x23a381,_0x27282e){return _0x23a381*_0x27282e;},'HNvCa':function(_0x443e5f,_0x2bd509){return _0x443e5f*_0x2bd509;},'RPLej':function(_0x28fd4a,_0x2671d3,_0x4bc6cb){return _0x28fd4a(_0x2671d3,_0x4bc6cb);},'AZAOL':_0x44e8a6(0xe4),'bPkwr':'application/x-www-form-urlencoded','jpczy':'urn:ietf:params:oauth:grant-type:device_code','ERcAE':_0x44e8a6(0xbc),'QZWKk':function(_0x10f3d1,_0x18daa8){return _0x10f3d1===_0x18daa8;},'kXUaO':'slow_down','nSPqO':_0x44e8a6(0xf6)},_0x5ca702=Date['now']()+_0x3ad099['kcQvv'](_0x5bec49,0x3e8);let _0x1e9597=_0x3ad099['HNvCa'](_0xef25b0,0x3e8);while(Date['now']()<_0x5ca702){await sleep(_0x1e9597);const _0x357245=await _0x3ad099[_0x44e8a6(0xcb)](fetch,WORKOS_TOKEN_URL,{'method':_0x3ad099[_0x44e8a6(0xca)],'headers':{'Content-Type':_0x3ad099[_0x44e8a6(0xd1)]},'body':new URLSearchParams({'client_id':_0x2d1155,'device_code':_0x3ce9ae,'grant_type':_0x3ad099['jpczy']})});if(_0x357245['ok'])return _0x357245[_0x44e8a6(0xdd)]();const _0x5da898=await _0x357245[_0x44e8a6(0xdd)]();if(_0x5da898['error']===_0x3ad099[_0x44e8a6(0xef)])continue;if(_0x3ad099[_0x44e8a6(0xb4)](_0x5da898['error'],_0x3ad099[_0x44e8a6(0xc9)])){_0x1e9597+=0x3e8;continue;}throw new Error(_0x5da898[_0x44e8a6(0xae)]||_0x5da898['error']||_0x3ad099['nSPqO']);}throw new Error('Device\x20authorization\x20timed\x20out');}async function fetchUserProfile(_0x191860){const _0x5478c8=_0x568548,_0x41e137={'gURrb':'GET'},_0x380236=getApiBaseUrl();try{const _0x5d9064=await fetch(_0x380236+'/organization/me',{'method':_0x41e137['gURrb'],'headers':{'workos-token':_0x191860}});if(_0x5d9064['ok'])return _0x5d9064[_0x5478c8(0xdd)]();}catch{}return null;}function buildKeyName(_0xda7a07,_0x1e6096){const _0x20c470=_0x568548,_0x563880=_0x1e6096['filter'](_0x441467=>_0x441467[_0x20c470(0xb1)]===_0xda7a07||_0x441467[_0x20c470(0xb1)]['startsWith'](_0xda7a07+'\x20('));if(_0x563880['length']===0x0)return _0xda7a07;return _0xda7a07+'\x20('+(_0x563880[_0x20c470(0xf4)]+0x1)+')';}export async function provisionApiKey(_0x472b25){const _0x4d7583=_0x568548,_0x3da8a0={'BJylm':function(_0x39cc58){return _0x39cc58();},'JONFu':'CLI\x20Key','SrdLZ':function(_0x26e73b,_0x34e0c9,_0x3b7076){return _0x26e73b(_0x34e0c9,_0x3b7076);},'Hsoaj':_0x4d7583(0xbf)},_0x48965b=_0x3da8a0[_0x4d7583(0xaf)](getApiBaseUrl),_0x2fdde6={'Content-Type':'application/json','workos-token':_0x472b25},_0xdfabfc=await fetchUserProfile(_0x472b25),_0x5ad52b=_0xdfabfc?.['firstName']||_0xdfabfc?.['email']?.['split']('@')[0x0],_0x30934f=_0x5ad52b?_0x5ad52b+_0x4d7583(0xb9):_0x3da8a0[_0x4d7583(0xb7)];let _0x5ee91e=[];try{const _0x3f4a77=await _0x3da8a0[_0x4d7583(0xd9)](fetch,_0x48965b+'/api-keys',{'method':'GET','headers':_0x2fdde6});if(_0x3f4a77['ok']){const _0x1e8ee8=await _0x3f4a77[_0x4d7583(0xdd)]();_0x5ee91e=_0x1e8ee8['apiKeys'];}}catch{}const _0x19173c=buildKeyName(_0x30934f,_0x5ee91e),_0x1daffc=await fetch(_0x48965b+_0x4d7583(0xe7),{'method':_0x4d7583(0xe4),'headers':_0x2fdde6,'body':JSON[_0x4d7583(0xf0)]({'name':_0x19173c,'scope':_0x3da8a0[_0x4d7583(0xee)]})});if(!_0x1daffc['ok']){const _0x25eaea=await _0x1daffc[_0x4d7583(0xe2)]();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x1daffc['status']+'\x20'+_0x25eaea);}const _0x51951b=await _0x1daffc['json']();return _0x51951b['apiKey'][_0x4d7583(0xfc)];}export function openBrowser(_0x2bcc45){const _0x14af6c=_0x568548,_0x50031a={'bkPdt':function(_0x57d7a8,_0x315d6b){return _0x57d7a8===_0x315d6b;},'vKTHV':'win32','nLHJj':'cmd','yLzqY':'start','IrwVJ':'ignore','iNYva':function(_0x585d01,_0x4e6dd5){return _0x585d01===_0x4e6dd5;},'fuaVU':'darwin','PvHLN':function(_0x25d39e,_0x23b930,_0x5e2ca8,_0x138222){return _0x25d39e(_0x23b930,_0x5e2ca8,_0x138222);}};try{if(_0x50031a['bkPdt'](process[_0x14af6c(0xb5)],_0x50031a[_0x14af6c(0xbe)])){const _0x5bdb50=spawn(_0x50031a['nLHJj'],['/c',_0x50031a[_0x14af6c(0xad)],'',_0x2bcc45],{'detached':!![],'stdio':_0x50031a['IrwVJ'],'windowsHide':!![]});_0x5bdb50['unref']();return;}const _0x335aa0=_0x50031a['iNYva'](process[_0x14af6c(0xb5)],_0x50031a['fuaVU'])?'open':_0x14af6c(0xdc),_0xc96e93=_0x50031a['PvHLN'](spawn,_0x335aa0,[_0x2bcc45],{'detached':!![],'stdio':_0x50031a['IrwVJ']});_0xc96e93[_0x14af6c(0xea)]();}catch{}}function _0x2e9d(_0x30d13f,_0x303fc6){_0x30d13f=_0x30d13f-0xad;const _0x3a6f00=_0x3a6f();let _0x2e9d97=_0x3a6f00[_0x30d13f];return _0x2e9d97;}function decodeJwtPayload(_0x3ffaad){const _0x2cdf19=_0x568548,_0x1d1649={'sfNCD':'Invalid\x20JWT\x20format'},_0xe63259=_0x3ffaad['split']('.');if(_0xe63259[_0x2cdf19(0xf4)]!==0x3)throw new Error(_0x1d1649[_0x2cdf19(0xfb)]);const _0x43848c=Buffer['from'](_0xe63259[0x1],_0x2cdf19(0xf5))['toString'](_0x2cdf19(0xcf));return JSON['parse'](_0x43848c);}async function selfServeSignup(_0x2e059a){const _0x1cba2e=_0x568548,_0x111d85={'JARca':function(_0x4ef805,_0x1d00c9,_0x5514ef){return _0x4ef805(_0x1d00c9,_0x5514ef);},'JTdOL':'application/json'},_0x27f4e5=getApiBaseUrl(),_0x2efd93=await _0x111d85['JARca'](fetch,_0x27f4e5+_0x1cba2e(0xe8),{'method':_0x1cba2e(0xe4),'headers':{'Content-Type':_0x111d85[_0x1cba2e(0xc2)],'workos-token':_0x2e059a}});if(!_0x2efd93['ok']){const _0x40ef2d=await _0x2efd93['text']();throw new Error(_0x1cba2e(0xcc)+_0x2efd93['status']+'\x20'+_0x40ef2d);}return _0x2efd93['json']();}async function fetchMyMemberships(_0x494a54){const _0x3a51d9=_0x568548,_0x52a144={'bPYlA':function(_0x1ff00c){return _0x1ff00c();},'UiJCC':function(_0x43d24d,_0x5d7246,_0x1f6ee5){return _0x43d24d(_0x5d7246,_0x1f6ee5);}},_0x1b1142=_0x52a144[_0x3a51d9(0xf3)](getApiBaseUrl),_0x5196a7=await _0x52a144['UiJCC'](fetch,_0x1b1142+'/organization/my-memberships',{'method':_0x3a51d9(0xc6),'headers':{'workos-token':_0x494a54}});if(!_0x5196a7['ok']){const _0x1ee5b6=await _0x5196a7['text']();throw new Error(_0x3a51d9(0xd6)+_0x5196a7[_0x3a51d9(0xf8)]+'\x20'+_0x1ee5b6);}const _0x5c484a=await _0x5196a7[_0x3a51d9(0xdd)]();return _0x5c484a[_0x3a51d9(0xb6)];}async function refreshTokenWithOrg(_0x136047,_0x236977,_0x558106){const _0x448842=_0x568548,_0xa01bc5={'bVawm':function(_0x26a063,_0x2532de,_0x4a6f1d){return _0x26a063(_0x2532de,_0x4a6f1d);},'BgUOm':'POST'},_0x539641=await _0xa01bc5['bVawm'](fetch,WORKOS_TOKEN_URL,{'method':_0xa01bc5['BgUOm'],'headers':{'Content-Type':_0x448842(0xff)},'body':new URLSearchParams({'client_id':_0x136047,'grant_type':_0x448842(0xba),'refresh_token':_0x236977,'organization_id':_0x558106})});if(!_0x539641['ok']){const _0x395d1d=await _0x539641[_0x448842(0xe2)]();throw new Error(_0x448842(0xda)+_0x539641['status']+'\x20'+_0x395d1d);}return _0x539641[_0x448842(0xdd)]();}async function provisionCliToken(_0x41e278){const _0x5936b6=_0x568548,_0x484363={'JyqXW':'application/json'},_0x1ec298=getApiBaseUrl(),_0x4b18e1=await fetch(_0x1ec298+_0x5936b6(0xed),{'method':'POST','headers':{'Content-Type':_0x484363[_0x5936b6(0xf7)],'workos-token':_0x41e278}});if(!_0x4b18e1['ok']){const _0x47f293=await _0x4b18e1['text']();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x4b18e1[_0x5936b6(0xf8)]+'\x20'+_0x47f293);}return _0x4b18e1['json']();}export async function runDeviceAuthFlow(){const _0x47a0d6=_0x568548,_0x1e5204={'ZXoZN':_0x47a0d6(0xd7),'YYOek':function(_0xebc354,_0x587058){return _0xebc354(_0x587058);},'HLyPa':'Waiting\x20for\x20authentication...','wiSWk':function(_0x11d993,_0x231ac0,_0x3253c6,_0x14f1a5,_0x48d73f){return _0x11d993(_0x231ac0,_0x3253c6,_0x14f1a5,_0x48d73f);},'aJudY':function(_0x42119f,_0x518f28){return _0x42119f===_0x518f28;},'bWHRS':_0x47a0d6(0xfd),'LITcY':_0x47a0d6(0xd5),'lsmQa':_0x47a0d6(0xdb),'sgBsv':function(_0x469c86,_0x490027){return _0x469c86(_0x490027);}},_0x172a11=getCurrentEnvironment(),_0x3fa1ec=ENVIRONMENT_CONFIGS[_0x172a11][_0x47a0d6(0xd4)],_0x7584d3=await requestDeviceCode(_0x3fa1ec);console[_0x47a0d6(0xf1)](_0x1e5204[_0x47a0d6(0xc5)]),console['log'](_0x47a0d6(0xd8)),_0x1e5204['YYOek'](openBrowser,_0x7584d3[_0x47a0d6(0xe3)]),console[_0x47a0d6(0xf1)](_0x47a0d6(0xc3)+_0x7584d3[_0x47a0d6(0xe3)]),console['log'](_0x47a0d6(0xde)+_0x7584d3['user_code']+'\x0a'),process['stdout'][_0x47a0d6(0xbd)](_0x1e5204['HLyPa']);let _0x3a48df=await _0x1e5204['wiSWk'](pollForTokens,_0x3fa1ec,_0x7584d3['device_code'],_0x7584d3['interval'],_0x7584d3[_0x47a0d6(0xc4)]);console[_0x47a0d6(0xf1)]('\x20✓');const _0x11e182=_0x1e5204[_0x47a0d6(0xfe)](decodeJwtPayload,_0x3a48df[_0x47a0d6(0xe0)]);if(!_0x11e182['org_id']){const _0x56b12b=await fetchMyMemberships(_0x3a48df['access_token']);let _0x29833a;if(_0x56b12b[_0x47a0d6(0xf4)]===0x0){process['stdout'][_0x47a0d6(0xbd)](_0x47a0d6(0xe5));const _0x25f656=await _0x1e5204['YYOek'](selfServeSignup,_0x3a48df['access_token']);_0x29833a=_0x25f656['organizationId'],console[_0x47a0d6(0xf1)]('\x20✓');}else{if(_0x1e5204[_0x47a0d6(0xcd)](_0x56b12b['length'],0x1))_0x29833a=_0x56b12b[0x0][_0x47a0d6(0xd3)],console[_0x47a0d6(0xf1)](_0x47a0d6(0xb8)+_0x56b12b[0x0]['name']);else{const _0x387c43=process[_0x47a0d6(0xd2)]['isTTY']&&process['stdout']['isTTY'];if(!_0x387c43)throw new Error(_0x47a0d6(0xdf)+_0x1e5204['bWHRS']);const {selected:_0x587e99}=await _0x53bce5[_0x47a0d6(0xb3)]([{'type':_0x1e5204['LITcY'],'name':_0x47a0d6(0xbb),'message':_0x1e5204[_0x47a0d6(0xeb)],'choices':_0x56b12b['map'](_0x215fe2=>({'name':_0x215fe2[_0x47a0d6(0xb1)],'value':_0x215fe2['organizationId']}))}]);_0x29833a=_0x587e99;}}_0x3a48df=await refreshTokenWithOrg(_0x3fa1ec,_0x3a48df[_0x47a0d6(0xba)],_0x29833a);}process['stdout'][_0x47a0d6(0xbd)](_0x47a0d6(0xf9));const _0x3dd610=await _0x1e5204[_0x47a0d6(0xfe)](provisionCliToken,_0x3a48df[_0x47a0d6(0xe0)]);return console['log']('\x20✓'),await storeToken(_0x3dd610['token']),_0x3a48df['refresh_token']&&await _0x1e5204['sgBsv'](storeRefreshToken,_0x3a48df['refresh_token']),_0x3dd610[_0x47a0d6(0xfc)];}function sleep(_0x3561fd){return new Promise(_0x236a08=>setTimeout(_0x236a08,_0x3561fd));}
|
|
1
|
+
const _0x2a434f=_0x5462;(function(_0x179e63,_0x13ba78){const _0x37f437=_0x5462,_0x1b14e4=_0x179e63();while(!![]){try{const _0x400d33=parseInt(_0x37f437(0xaf))/0x1+parseInt(_0x37f437(0x90))/0x2*(parseInt(_0x37f437(0xa7))/0x3)+parseInt(_0x37f437(0x8c))/0x4*(-parseInt(_0x37f437(0x98))/0x5)+-parseInt(_0x37f437(0xc2))/0x6+-parseInt(_0x37f437(0x7e))/0x7*(-parseInt(_0x37f437(0xa0))/0x8)+-parseInt(_0x37f437(0xd1))/0x9*(-parseInt(_0x37f437(0xb9))/0xa)+parseInt(_0x37f437(0xa5))/0xb*(-parseInt(_0x37f437(0x8f))/0xc);if(_0x400d33===_0x13ba78)break;else _0x1b14e4['push'](_0x1b14e4['shift']());}catch(_0x46e48f){_0x1b14e4['push'](_0x1b14e4['shift']());}}}(_0x3c39,0xdfb58));import{spawn}from'child_process';import _0x333557 from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL=_0x2a434f(0xbb),WORKOS_TOKEN_URL=_0x2a434f(0x86);export async function requestDeviceCode(_0x4a48ac){const _0x1a192f=_0x2a434f,_0x301ceb=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':'POST','headers':{'Content-Type':_0x1a192f(0xd4)},'body':new URLSearchParams({'client_id':_0x4a48ac})});if(!_0x301ceb['ok']){const _0x436b9d=await _0x301ceb[_0x1a192f(0x9f)]();throw new Error('Failed\x20to\x20request\x20device\x20code:\x20'+_0x301ceb['status']+'\x20'+_0x436b9d);}return _0x301ceb[_0x1a192f(0xb6)]();}export async function pollForTokens(_0x1b595e,_0x5a9bb2,_0x2a7290,_0x394a52){const _0x1a5c0d=_0x2a434f,_0x240a5c={'SgMBe':function(_0x2b1515,_0x4b5812){return _0x2b1515<_0x4b5812;},'tGLLd':'application/x-www-form-urlencoded','ipHvV':'urn:ietf:params:oauth:grant-type:device_code','pfNAS':function(_0x14c2fc,_0x44a291){return _0x14c2fc===_0x44a291;}},_0x2a6c18=Date[_0x1a5c0d(0x93)]()+_0x394a52*0x3e8;let _0x3738d3=_0x2a7290*0x3e8;while(_0x240a5c['SgMBe'](Date[_0x1a5c0d(0x93)](),_0x2a6c18)){await sleep(_0x3738d3);const _0x2b91b5=await fetch(WORKOS_TOKEN_URL,{'method':_0x1a5c0d(0xd0),'headers':{'Content-Type':_0x240a5c[_0x1a5c0d(0xbf)]},'body':new URLSearchParams({'client_id':_0x1b595e,'device_code':_0x5a9bb2,'grant_type':_0x240a5c['ipHvV']})});if(_0x2b91b5['ok'])return _0x2b91b5[_0x1a5c0d(0xb6)]();const _0x1dffda=await _0x2b91b5['json']();if(_0x1dffda[_0x1a5c0d(0xc6)]==='authorization_pending')continue;if(_0x240a5c['pfNAS'](_0x1dffda['error'],'slow_down')){_0x3738d3+=0x3e8;continue;}throw new Error(_0x1dffda['error_description']||_0x1dffda['error']||'Authentication\x20failed');}throw new Error(_0x1a5c0d(0x81));}async function fetchUserProfile(_0x1a0ed2){const _0x49a764=_0x2a434f,_0x3e6488={'FQSJj':function(_0xec7893){return _0xec7893();},'NnIlg':function(_0x34a445,_0x46da9f,_0x209b44){return _0x34a445(_0x46da9f,_0x209b44);},'vhcJx':_0x49a764(0xba)},_0x465aba=_0x3e6488[_0x49a764(0x9e)](getApiBaseUrl);try{const _0x237fad=await _0x3e6488['NnIlg'](fetch,_0x465aba+'/organization/me',{'method':_0x3e6488['vhcJx'],'headers':{'workos-token':_0x1a0ed2}});if(_0x237fad['ok'])return _0x237fad['json']();}catch{}return null;}function _0x3c39(){const _0x347022=['win32','SsurK','now','/cli-auth/token','cJYWU','application/json','pobeD','1069755rQUovy','map','start','xdg-open','ignore','isTTY','FQSJj','text','7486216nEfwFH','mcp:write','AyvkM','fPBmo','token','2485813EMbVgD','sdVsu','6KonAtF','log','wYjcp','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20','GlGbg','Failed\x20to\x20provision\x20API\x20key:\x20','oPEKJ','\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','1323600LBmvsj','selected','VTDrW','PuOtx','apiKey','qoxhu','WYFdB','json','Failed\x20to\x20create\x20organization:\x20','gKbZb','1331690sjKSax','GET','https://api.workos.com/user_management/authorize/device','org_id','verification_uri_complete','ODqAq','tGLLd','refresh_token','email','6631248hwIUeY','Waiting\x20for\x20authentication...','/organization/my-memberships','access_token','error','parse','/api-keys','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','stdout','Setting\x20up\x20your\x20organization...','XsRMH','\x27s\x20CLI\x20Key','memberships','fhLZi','POST','99MmkgRh','user_code','length','application/x-www-form-urlencoded','XlDcy','Failed\x20to\x20provision\x20CLI\x20token:\x20','7FlKhQt','oJMUj','name','Device\x20authorization\x20timed\x20out','from','stdin','split','kmASA','https://api.workos.com/user_management/authenticate','startsWith','lWupC','organizationId','toString','filter','12nAkfTg','status','MXbKC','132DaxPSH','1424950HUWgIO'];_0x3c39=function(){return _0x347022;};return _0x3c39();}function buildKeyName(_0x532f69,_0xed4ff2){const _0x2dcce=_0x2a434f,_0x513333={'fyaYU':function(_0x529846,_0x38e829){return _0x529846===_0x38e829;}},_0x98985a=_0xed4ff2[_0x2dcce(0x8b)](_0x868dd2=>_0x868dd2[_0x2dcce(0x80)]===_0x532f69||_0x868dd2[_0x2dcce(0x80)][_0x2dcce(0x87)](_0x532f69+'\x20('));if(_0x513333['fyaYU'](_0x98985a['length'],0x0))return _0x532f69;return _0x532f69+'\x20('+(_0x98985a[_0x2dcce(0xd3)]+0x1)+')';}export async function provisionApiKey(_0x192d46){const _0x315c79=_0x2a434f,_0x59d468={'oJMUj':_0x315c79(0x96),'nmTOF':function(_0x543111,_0x5b0bfc){return _0x543111(_0x5b0bfc);},'cJYWU':function(_0x2a4821,_0x3436ae,_0x34e7b5){return _0x2a4821(_0x3436ae,_0x34e7b5);},'wYjcp':function(_0xae540f,_0x9b37cd,_0x19ceef){return _0xae540f(_0x9b37cd,_0x19ceef);},'gKbZb':_0x315c79(0xa1)},_0x175c17=getApiBaseUrl(),_0x456964={'Content-Type':_0x59d468[_0x315c79(0x7f)],'workos-token':_0x192d46},_0x267868=await _0x59d468['nmTOF'](fetchUserProfile,_0x192d46),_0x4b532c=_0x267868?.['firstName']||_0x267868?.[_0x315c79(0xc1)]?.[_0x315c79(0x84)]('@')[0x0],_0x52b4f3=_0x4b532c?_0x4b532c+_0x315c79(0xcd):'CLI\x20Key';let _0x1c8c14=[];try{const _0x4b6075=await _0x59d468[_0x315c79(0x95)](fetch,_0x175c17+'/api-keys',{'method':'GET','headers':_0x456964});if(_0x4b6075['ok']){const _0x1c539a=await _0x4b6075['json']();_0x1c8c14=_0x1c539a['apiKeys'];}}catch{}const _0x5e4be8=buildKeyName(_0x52b4f3,_0x1c8c14),_0x2ae077=await _0x59d468[_0x315c79(0xa9)](fetch,_0x175c17+_0x315c79(0xc8),{'method':_0x315c79(0xd0),'headers':_0x456964,'body':JSON['stringify']({'name':_0x5e4be8,'scope':_0x59d468[_0x315c79(0xb8)]})});if(!_0x2ae077['ok']){const _0x4165cb=await _0x2ae077['text']();throw new Error(_0x315c79(0xac)+_0x2ae077[_0x315c79(0x8d)]+'\x20'+_0x4165cb);}const _0x22458e=await _0x2ae077['json']();return _0x22458e[_0x315c79(0xb3)][_0x315c79(0xa4)];}function _0x5462(_0x1da429,_0x7bd514){_0x1da429=_0x1da429-0x7e;const _0x3c3919=_0x3c39();let _0x5462a9=_0x3c3919[_0x1da429];return _0x5462a9;}export function openBrowser(_0x5313ab){const _0x46498c=_0x2a434f,_0x40a0aa={'XsRMH':_0x46498c(0x91),'olhbR':'cmd','LYCUc':_0x46498c(0x9a),'YkMOi':function(_0x38cbb4,_0x50f318){return _0x38cbb4===_0x50f318;},'qoxhu':'darwin','sdVsu':_0x46498c(0x9c)};try{if(process['platform']===_0x40a0aa[_0x46498c(0xcc)]){const _0x3314fd=spawn(_0x40a0aa['olhbR'],['/c',_0x40a0aa['LYCUc'],'',_0x5313ab],{'detached':!![],'stdio':_0x46498c(0x9c),'windowsHide':!![]});_0x3314fd['unref']();return;}const _0x1298e3=_0x40a0aa['YkMOi'](process['platform'],_0x40a0aa[_0x46498c(0xb4)])?'open':_0x46498c(0x9b),_0x576800=spawn(_0x1298e3,[_0x5313ab],{'detached':!![],'stdio':_0x40a0aa[_0x46498c(0xa6)]});_0x576800['unref']();}catch{}}function decodeJwtPayload(_0x4b8add){const _0x4e4d25=_0x2a434f,_0x55ea3a={'pobeD':'utf-8'},_0x33d343=_0x4b8add[_0x4e4d25(0x84)]('.');if(_0x33d343['length']!==0x3)throw new Error('Invalid\x20JWT\x20format');const _0xeb33c9=Buffer[_0x4e4d25(0x82)](_0x33d343[0x1],'base64url')[_0x4e4d25(0x8a)](_0x55ea3a[_0x4e4d25(0x97)]);return JSON[_0x4e4d25(0xc7)](_0xeb33c9);}async function selfServeSignup(_0x58ab49){const _0x24009d=_0x2a434f,_0x5b852d={'oPEKJ':function(_0x391fa8){return _0x391fa8();},'MXbKC':'POST'},_0x2f80c4=_0x5b852d[_0x24009d(0xad)](getApiBaseUrl),_0x39bc92=await fetch(_0x2f80c4+'/organization/self-serve-signup',{'method':_0x5b852d[_0x24009d(0x8e)],'headers':{'Content-Type':'application/json','workos-token':_0x58ab49}});if(!_0x39bc92['ok']){const _0x57e657=await _0x39bc92[_0x24009d(0x9f)]();throw new Error(_0x24009d(0xb7)+_0x39bc92['status']+'\x20'+_0x57e657);}return _0x39bc92['json']();}async function fetchMyMemberships(_0x530f55){const _0x18f715=_0x2a434f,_0xd9d789={'JHZAe':function(_0x4cf4ae){return _0x4cf4ae();},'lYsHd':function(_0x3f02f5,_0x5001d3,_0x2f822c){return _0x3f02f5(_0x5001d3,_0x2f822c);},'JRwxt':_0x18f715(0xba)},_0x2c95c9=_0xd9d789['JHZAe'](getApiBaseUrl),_0x3cc6cc=await _0xd9d789['lYsHd'](fetch,_0x2c95c9+_0x18f715(0xc4),{'method':_0xd9d789['JRwxt'],'headers':{'workos-token':_0x530f55}});if(!_0x3cc6cc['ok']){const _0x15e031=await _0x3cc6cc['text']();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0x3cc6cc['status']+'\x20'+_0x15e031);}const _0x3aa199=await _0x3cc6cc[_0x18f715(0xb6)]();return _0x3aa199[_0x18f715(0xce)];}async function refreshTokenWithOrg(_0x302224,_0x4b8437,_0x34965c){const _0x32c031=_0x2a434f,_0x17757b={'GlGbg':'POST','VTDrW':_0x32c031(0xd4)},_0x493596=await fetch(WORKOS_TOKEN_URL,{'method':_0x17757b[_0x32c031(0xab)],'headers':{'Content-Type':_0x17757b[_0x32c031(0xb1)]},'body':new URLSearchParams({'client_id':_0x302224,'grant_type':'refresh_token','refresh_token':_0x4b8437,'organization_id':_0x34965c})});if(!_0x493596['ok']){const _0x48af29=await _0x493596['text']();throw new Error('Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'+_0x493596['status']+'\x20'+_0x48af29);}return _0x493596[_0x32c031(0xb6)]();}async function provisionCliToken(_0x5dec72){const _0x8df6cc=_0x2a434f,_0x3d5910={'PuOtx':function(_0x5f425a,_0x3ee80e,_0x214a40){return _0x5f425a(_0x3ee80e,_0x214a40);}},_0x41d643=getApiBaseUrl(),_0x29c881=await _0x3d5910[_0x8df6cc(0xb2)](fetch,_0x41d643+_0x8df6cc(0x94),{'method':'POST','headers':{'Content-Type':'application/json','workos-token':_0x5dec72}});if(!_0x29c881['ok']){const _0x4c1691=await _0x29c881['text']();throw new Error(_0x8df6cc(0xd6)+_0x29c881['status']+'\x20'+_0x4c1691);}return _0x29c881['json']();}export async function runDeviceAuthFlow(){const _0x46e02e=_0x2a434f,_0x3e3ad9={'WYFdB':_0x46e02e(0xae),'cxGTY':_0x46e02e(0xc9),'JdGFx':function(_0x4727fd,_0x23ef1d){return _0x4727fd(_0x23ef1d);},'fhLZi':_0x46e02e(0xc3),'lWupC':function(_0x454b95,_0x26f35a,_0x65574d,_0x5c3886,_0x2dc088){return _0x454b95(_0x26f35a,_0x65574d,_0x5c3886,_0x2dc088);},'SsurK':function(_0x17dc05,_0x529768){return _0x17dc05(_0x529768);},'QxTtg':function(_0x18c490,_0x4e4275){return _0x18c490(_0x4e4275);},'kmASA':function(_0x3bab3d,_0x368933){return _0x3bab3d===_0x368933;},'HWDrK':_0x46e02e(0xcb),'AyvkM':function(_0x5c36f4,_0x3eb1cf){return _0x5c36f4(_0x3eb1cf);},'XlDcy':'Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','fPBmo':'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','ODqAq':'Select\x20an\x20organization:','AvGiV':function(_0x348894,_0x21f7f1,_0x477573,_0x42c10e){return _0x348894(_0x21f7f1,_0x477573,_0x42c10e);}},_0x551f30=getCurrentEnvironment(),_0x22796a=ENVIRONMENT_CONFIGS[_0x551f30]['workosClientId'],_0x250e9d=await requestDeviceCode(_0x22796a);console['log'](_0x3e3ad9[_0x46e02e(0xb5)]),console[_0x46e02e(0xa8)](_0x3e3ad9['cxGTY']),_0x3e3ad9['JdGFx'](openBrowser,_0x250e9d[_0x46e02e(0xbd)]),console[_0x46e02e(0xa8)](_0x46e02e(0xaa)+_0x250e9d[_0x46e02e(0xbd)]),console[_0x46e02e(0xa8)]('Code:\x20'+_0x250e9d[_0x46e02e(0xd2)]+'\x0a'),process['stdout']['write'](_0x3e3ad9[_0x46e02e(0xcf)]);let _0x29af2e=await _0x3e3ad9[_0x46e02e(0x88)](pollForTokens,_0x22796a,_0x250e9d['device_code'],_0x250e9d['interval'],_0x250e9d['expires_in']);console[_0x46e02e(0xa8)]('\x20✓');const _0x316803=_0x3e3ad9[_0x46e02e(0x92)](decodeJwtPayload,_0x29af2e[_0x46e02e(0xc5)]);if(!_0x316803[_0x46e02e(0xbc)]){const _0x325a2d=await _0x3e3ad9['QxTtg'](fetchMyMemberships,_0x29af2e[_0x46e02e(0xc5)]);let _0x3e9d48;if(_0x3e3ad9[_0x46e02e(0x85)](_0x325a2d[_0x46e02e(0xd3)],0x0)){process['stdout']['write'](_0x3e3ad9['HWDrK']);const _0x2639f8=await _0x3e3ad9[_0x46e02e(0xa2)](selfServeSignup,_0x29af2e[_0x46e02e(0xc5)]);_0x3e9d48=_0x2639f8['organizationId'],console[_0x46e02e(0xa8)]('\x20✓');}else{if(_0x325a2d[_0x46e02e(0xd3)]===0x1)_0x3e9d48=_0x325a2d[0x0]['organizationId'],console[_0x46e02e(0xa8)]('Using\x20organization:\x20'+_0x325a2d[0x0][_0x46e02e(0x80)]);else{const _0x48addb=process[_0x46e02e(0x83)][_0x46e02e(0x9d)]&&process[_0x46e02e(0xca)][_0x46e02e(0x9d)];if(!_0x48addb)throw new Error(_0x3e3ad9[_0x46e02e(0xd5)]+_0x3e3ad9[_0x46e02e(0xa3)]);const {selected:_0x1400f1}=await _0x333557['prompt']([{'type':'list','name':_0x46e02e(0xb0),'message':_0x3e3ad9[_0x46e02e(0xbe)],'choices':_0x325a2d[_0x46e02e(0x99)](_0x36fd04=>({'name':_0x36fd04['name'],'value':_0x36fd04[_0x46e02e(0x89)]}))}]);_0x3e9d48=_0x1400f1;}}_0x29af2e=await _0x3e3ad9['AvGiV'](refreshTokenWithOrg,_0x22796a,_0x29af2e[_0x46e02e(0xc0)],_0x3e9d48);}process[_0x46e02e(0xca)]['write']('Provisioning\x20CLI\x20token...');const _0x2de501=await _0x3e3ad9[_0x46e02e(0x92)](provisionCliToken,_0x29af2e[_0x46e02e(0xc5)]);return console['log']('\x20✓'),await _0x3e3ad9['AyvkM'](storeToken,_0x2de501['token']),_0x29af2e[_0x46e02e(0xc0)]&&await _0x3e3ad9['JdGFx'](storeRefreshToken,_0x29af2e['refresh_token']),_0x2de501[_0x46e02e(0xa4)];}function sleep(_0x4da067){return new Promise(_0x1232b2=>setTimeout(_0x1232b2,_0x4da067));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x32d8e7=_0x4439;(function(_0x553b4e,_0x3fc29d){const _0x475c02=_0x4439,_0x2bd726=_0x553b4e();while(!![]){try{const _0xc1de6b=-parseInt(_0x475c02(0x1e3))/0x1*(parseInt(_0x475c02(0x1f9))/0x2)+-parseInt(_0x475c02(0x1e4))/0x3+parseInt(_0x475c02(0x1de))/0x4+parseInt(_0x475c02(0x1df))/0x5*(parseInt(_0x475c02(0x1dc))/0x6)+parseInt(_0x475c02(0x1db))/0x7*(-parseInt(_0x475c02(0x1f1))/0x8)+-parseInt(_0x475c02(0x1f6))/0x9*(parseInt(_0x475c02(0x1d9))/0xa)+parseInt(_0x475c02(0x1e0))/0xb;if(_0xc1de6b===_0x3fc29d)break;else _0x2bd726['push'](_0x2bd726['shift']());}catch(_0x16813f){_0x2bd726['push'](_0x2bd726['shift']());}}}(_0x1e9b,0xa3de0));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':_0x32d8e7(0x1e8),'workosClientId':_0x32d8e7(0x1e2),'aiProxyUrl':_0x32d8e7(0x1ee),'mcpAuthUrl':'https://mcp-auth.ranger.net/mcp'},'staging':{'apiBaseUrl':_0x32d8e7(0x1eb),'workosClientId':_0x32d8e7(0x1fb),'aiProxyUrl':'https://ai-proxy-301751771437.us-central1.run.app','mcpAuthUrl':'https://mcp-auth.staging.ranger.net/mcp'},'local':{'apiBaseUrl':'http://localhost:8080','workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':'http://localhost:8090','mcpAuthUrl':'http://localhost:8080/mcp'}};export const DEFAULT_ENVIRONMENT=_0x32d8e7(0x1e9);export function isValidEnvironment(_0x2957e1){const _0x43f6b6=_0x32d8e7,_0x463384={'ctIEb':'prod','BfntM':function(_0x2dbcc7,_0x42d8f6){return _0x2dbcc7===_0x42d8f6;},'rrHSl':'staging'};return _0x2957e1===_0x463384['ctIEb']||_0x463384['BfntM'](_0x2957e1,_0x463384[_0x43f6b6(0x1e7)])||_0x463384[_0x43f6b6(0x1e1)](_0x2957e1,_0x43f6b6(0x1f5));}function _0x4439(_0x496887,_0x347ead){_0x496887=_0x496887-0x1d6;const _0x1e9b1d=_0x1e9b();let _0x44391b=_0x1e9b1d[_0x496887];return _0x44391b;}export function getCurrentEnvironment(){const _0x31c174=_0x32d8e7,_0xb2d8c=process['env'][_0x31c174(0x1fa)];if(_0xb2d8c&&isValidEnvironment(_0xb2d8c))return _0xb2d8c;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){const _0x2148c4=_0x32d8e7;return ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x2148c4(0x1e6)];}export function getAiProxyUrl(){return ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['aiProxyUrl'];}export function getMcpAuthUrl(){const _0x7a035=_0x32d8e7,_0xb3ee43={'FENMo':function(_0x9cd777){return _0x9cd777();}};return process['env'][_0x7a035(0x1f2)]??ENVIRONMENT_CONFIGS[_0xb3ee43[_0x7a035(0x1ef)](getCurrentEnvironment)][_0x7a035(0x1ea)];}function _0x1e9b(){const _0x509b3a=['524111XTwYwx','72FZmaNL','playwright-cli','5245196iGpNnJ','121465PQsUGf','9636077qmEVLi','BfntM','client_01J9CBYM7M5ZETCF7G6614DXR2','1Ncgkyf','382092WhSonu','trim','apiBaseUrl','rrHSl','https://api.ranger.net','prod','mcpAuthUrl','https://api.staging.ranger.net','error','YqbHv','https://ai-proxy-716115358910.us-central1.run.app','FENMo','env','56ujhHHL','RANGER_MCP_AUTH_URL','toLowerCase','TymcU','local','36YeQlBf','Expected\x20one\x20of:\x20off,\x20on,\x20auto.\x20Defaulting\x20to\x20auto.','Invalid\x20RANGER_TRANSPORT=\x22','543598hFcOlX','RANGER_CLI_ENV','client_01J9CBYM2DKWV9HM17D95Z540K','nova-act-cli','WCsRY','jPzwt','2210870JTdFSo','find'];_0x1e9b=function(){return _0x509b3a;};return _0x1e9b();}export function isByokEnabled(){return process['env']['RANGER_BYOK']==='true';}function isVerificationTransport(_0x587386){const _0x25eb52=_0x32d8e7,_0x3b583c={'TymcU':function(_0x291214,_0x2f5f10){return _0x291214===_0x2f5f10;}};return _0x587386==='mcp'||_0x3b583c[_0x25eb52(0x1f4)](_0x587386,_0x25eb52(0x1dd))||_0x3b583c[_0x25eb52(0x1f4)](_0x587386,_0x25eb52(0x1d6))||_0x3b583c[_0x25eb52(0x1f4)](_0x587386,'rangerwright-cli');}const LEGACY_TRANSPORT_ENV_VARS=['RANGER_USE_NOVA_ACT','RANGER_DISABLE_MCP'];export function getVerificationTransport(){const _0x1c317c=_0x32d8e7,_0x18633f={'jPzwt':function(_0x43aab4,_0x3b6b6e){return _0x43aab4(_0x3b6b6e);}},_0x12d6fb=process[_0x1c317c(0x1f0)]['RANGER_TRANSPORT']?.[_0x1c317c(0x1e5)]();if(_0x12d6fb){if(_0x18633f[_0x1c317c(0x1d8)](isVerificationTransport,_0x12d6fb))return _0x12d6fb;throw new Error(_0x1c317c(0x1f8)+_0x12d6fb+'\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli,\x20rangerwright-cli.');}const _0x5ec17a=LEGACY_TRANSPORT_ENV_VARS[_0x1c317c(0x1da)](_0x939004=>process[_0x1c317c(0x1f0)][_0x939004]);if(_0x5ec17a)throw new Error(_0x5ec17a+'\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20RANGER_TRANSPORT=nova-act-cli,\x20or\x20RANGER_TRANSPORT=rangerwright-cli.');return'mcp';}export function resolveHookMode(_0x34f967=process['env']){const _0x4d818b=_0x32d8e7,_0x15d9f2={'FRwtG':'off','WCsRY':function(_0x4448c3,_0x294468){return _0x4448c3===_0x294468;},'CZtbc':function(_0x553601,_0x37dbef){return _0x553601===_0x37dbef;},'dpeDK':'auto','YqbHv':function(_0x4fb870,_0x9c3df){return _0x4fb870+_0x9c3df;}},_0x26d7b3=_0x34f967['RANGER_HOOKS']?.[_0x4d818b(0x1e5)]()[_0x4d818b(0x1f3)]();if(!_0x26d7b3)return'auto';if(_0x26d7b3===_0x15d9f2['FRwtG']||_0x15d9f2[_0x4d818b(0x1d7)](_0x26d7b3,'on')||_0x15d9f2['CZtbc'](_0x26d7b3,_0x15d9f2['dpeDK']))return _0x26d7b3;return console[_0x4d818b(0x1ec)](_0x15d9f2[_0x4d818b(0x1ed)]('[ranger]\x20Ignoring\x20invalid\x20RANGER_HOOKS=\x22'+_0x34f967['RANGER_HOOKS']+'\x22.\x20',_0x4d818b(0x1f7))),'auto';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x402791,_0x33a22f){const _0x537ea4=_0x21e5,_0x218deb=_0x402791();while(!![]){try{const _0x353fa9=-parseInt(_0x537ea4(0x1e0))/0x1*(-parseInt(_0x537ea4(0x1cc))/0x2)+parseInt(_0x537ea4(0x1ad))/0x3*(-parseInt(_0x537ea4(0x1ae))/0x4)+-parseInt(_0x537ea4(0x1bd))/0x5+-parseInt(_0x537ea4(0x1a8))/0x6*(-parseInt(_0x537ea4(0x1e5))/0x7)+parseInt(_0x537ea4(0x1df))/0x8*(-parseInt(_0x537ea4(0x1d3))/0x9)+parseInt(_0x537ea4(0x1ba))/0xa+-parseInt(_0x537ea4(0x1db))/0xb*(-parseInt(_0x537ea4(0x1d8))/0xc);if(_0x353fa9===_0x33a22f)break;else _0x218deb['push'](_0x218deb['shift']());}catch(_0x5d5c07){_0x218deb['push'](_0x218deb['shift']());}}}(_0x1c07,0xbbfa8));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';function _0x1c07(){const _0x37d6d7=['itemIds','510235GoEcMf','/report','/checklist-items/','/comments/address','164928HMlJGL','158VezSwF','Bearer\x20','toString','stringify','Failed\x20to\x20create\x20feature\x20review:\x20','7dJBfeZ','bXKSZ','limit','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','nAIdo','xGMLj','TTjXr','SJrLG','length','application/json','Failed\x20to\x20delete\x20feature\x20review:\x20','/api/v1/mcp/features','billingUrl','updateChecklistItem','Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20','yxTOp','message','5662218QKmaFl','json','\x0a\x0aUpgrade\x20your\x20plan:\x20','POST','set','43389GxnNwH','240UieFVq','offset','airBq','gitBranch','GET','/action-items','https://dashboard.ranger.net/billing','KThxK','/api/v1/mcp/features/','MAweg','TIEnx','true','5531530xRjsTJ','Failed\x20to\x20get\x20item\x20feedback:\x20','style','3116665gPLChE','sQJcT','zRRsG','/checklist','rzlYr','hjppk','Uskoy','ajpPC','uPLuT','Failed\x20to\x20update\x20scenario:\x20','ivgGT','/conclude','dIbfN','COoPP','text','6216hNohDE','Failed\x20to\x20update\x20feature\x20review:\x20','kriKF','tGmNt','/sessions/','/feedback','includeDeleted','63RJEHMX','ZrUAi','BGTPv','xjRWb','sessionId','108TANlGO','PATCH'];_0x1c07=function(){return _0x37d6d7;};return _0x1c07();}import{withRetry}from'./retry.js';export async function createFeature(_0x1a33f4){const _0x155f62=_0x21e5,_0x4b302c={'Uskoy':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','FXquW':_0x155f62(0x1ee),'TIEnx':'Feature\x20limit\x20exceeded'},_0x1c1fb3=await getToken();if(!_0x1c1fb3)throw new Error(_0x4b302c[_0x155f62(0x1c3)]);const _0x28ea26=getApiBaseUrl(),_0x53dd53=await fetch(_0x28ea26+_0x155f62(0x1f0),{'method':'POST','headers':{'Authorization':_0x155f62(0x1e1)+_0x1c1fb3,'Content-Type':_0x4b302c['FXquW']},'body':JSON[_0x155f62(0x1e3)](_0x1a33f4)});if(!_0x53dd53['ok']){if(_0x53dd53['status']===0x192){const _0x539747=await _0x53dd53['json'](),_0x160034=_0x539747[_0x155f62(0x1f1)]||_0x155f62(0x1b4);throw new Error((_0x539747[_0x155f62(0x1a7)]||_0x4b302c[_0x155f62(0x1b8)])+_0x155f62(0x1aa)+_0x160034);}const _0x2c453e=await _0x53dd53[_0x155f62(0x1cb)]();throw new Error(_0x155f62(0x1e4)+_0x2c453e);}return _0x53dd53['json']();}export async function listFeatures(_0x46be68){const _0x5e0ea3=_0x21e5,_0x4a2446={'dIbfN':function(_0x314564){return _0x314564();},'wGfSU':_0x5e0ea3(0x1b2)},_0x22b09c=await getToken();if(!_0x22b09c)throw new Error(_0x5e0ea3(0x1e8));const _0x3e1215=_0x4a2446[_0x5e0ea3(0x1c9)](getApiBaseUrl),_0x1b5c3d=new URLSearchParams();if(_0x46be68?.['gitRepoUrl'])_0x1b5c3d[_0x5e0ea3(0x1ac)]('gitRepoUrl',_0x46be68['gitRepoUrl']);if(_0x46be68?.[_0x5e0ea3(0x1b1)])_0x1b5c3d['set'](_0x5e0ea3(0x1b1),_0x46be68[_0x5e0ea3(0x1b1)]);if(_0x46be68?.[_0x5e0ea3(0x1e7)])_0x1b5c3d['set']('limit',_0x46be68['limit']['toString']());if(_0x46be68?.['offset'])_0x1b5c3d['set'](_0x5e0ea3(0x1af),_0x46be68[_0x5e0ea3(0x1af)][_0x5e0ea3(0x1e2)]());if(_0x46be68?.['includeDeleted'])_0x1b5c3d[_0x5e0ea3(0x1ac)](_0x5e0ea3(0x1d2),_0x5e0ea3(0x1b9));const _0x4647a2=_0x3e1215+'/api/v1/mcp/features'+(_0x1b5c3d['toString']()?'?'+_0x1b5c3d['toString']():''),_0x15f971=await fetch(_0x4647a2,{'method':_0x4a2446['wGfSU'],'headers':{'Authorization':_0x5e0ea3(0x1e1)+_0x22b09c}});if(!_0x15f971['ok']){const _0x319e18=await _0x15f971['text']();throw new Error('Failed\x20to\x20list\x20feature\x20reviews:\x20'+_0x319e18);}return _0x15f971[_0x5e0ea3(0x1a9)]();}export async function getFeature(_0x5e42db){const _0x9189e2=_0x21e5,_0x2a49ec={'xGMLj':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','mfvEu':_0x9189e2(0x1b2)},_0x159af6=await getToken();if(!_0x159af6)throw new Error(_0x2a49ec[_0x9189e2(0x1ea)]);const _0x44c4a0=getApiBaseUrl(),_0x42493f=await fetch(_0x44c4a0+_0x9189e2(0x1b6)+_0x5e42db,{'method':_0x2a49ec['mfvEu'],'headers':{'Authorization':_0x9189e2(0x1e1)+_0x159af6}});if(!_0x42493f['ok']){const _0x4463a0=await _0x42493f['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review:\x20'+_0x4463a0);}return _0x42493f['json']();}export async function updateFeature(_0x526e11,_0x545b69){const _0x2ca925=_0x21e5,_0x482838={'pImdc':function(_0x23b9d4){return _0x23b9d4();},'uPLuT':_0x2ca925(0x1e8),'ZrUAi':'PATCH'},_0x8284b7=await _0x482838['pImdc'](getToken);if(!_0x8284b7)throw new Error(_0x482838[_0x2ca925(0x1c5)]);const _0x58b12e=getApiBaseUrl(),_0x38a7cf=await fetch(_0x58b12e+_0x2ca925(0x1b6)+_0x526e11,{'method':_0x482838[_0x2ca925(0x1d4)],'headers':{'Authorization':_0x2ca925(0x1e1)+_0x8284b7,'Content-Type':_0x2ca925(0x1ee)},'body':JSON['stringify'](_0x545b69)});if(!_0x38a7cf['ok']){const _0x4f7fcc=await _0x38a7cf['text']();throw new Error(_0x2ca925(0x1cd)+_0x4f7fcc);}return _0x38a7cf['json']();}export async function createChecklistItem(_0x5d34e3,_0x134e9f,_0x2810ae){const _0x15ae4c=_0x21e5,_0x595208={'MAweg':_0x15ae4c(0x1e8),'OrVGB':function(_0x1f0acc){return _0x1f0acc();},'oMwYe':function(_0x3e7503,_0x5bcdbf,_0x15d03c){return _0x3e7503(_0x5bcdbf,_0x15d03c);},'yxTOp':_0x15ae4c(0x1ee)},_0xb6c9f5=await getToken();if(!_0xb6c9f5)throw new Error(_0x595208[_0x15ae4c(0x1b7)]);const _0x349d59=_0x595208['OrVGB'](getApiBaseUrl),_0x39c361=await _0x595208['oMwYe'](fetch,_0x349d59+'/api/v1/mcp/features/'+_0x5d34e3+_0x15ae4c(0x1c0),{'method':_0x15ae4c(0x1ab),'headers':{'Authorization':'Bearer\x20'+_0xb6c9f5,'Content-Type':_0x595208[_0x15ae4c(0x1a6)]},'body':JSON['stringify']({'description':_0x134e9f,'position':_0x2810ae})});if(!_0x39c361['ok']){const _0x4eb906=await _0x39c361[_0x15ae4c(0x1cb)]();throw new Error('Failed\x20to\x20create\x20scenario:\x20'+_0x4eb906);}return _0x39c361[_0x15ae4c(0x1a9)]();}export async function updateChecklistItem(_0x56475c,_0x5d1cde,_0x157f64){const _0xc8bc42=_0x21e5,_0x40b190={'oScZI':function(_0x5bb0c5){return _0x5bb0c5();},'ajpPC':_0xc8bc42(0x1d9)};return withRetry(async()=>{const _0x1fec3f=_0xc8bc42,_0x7da169=await _0x40b190['oScZI'](getToken);if(!_0x7da169)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0xa26da4=getApiBaseUrl(),_0x23efb7=await fetch(_0xa26da4+'/api/v1/mcp/features/'+_0x56475c+'/checklist/'+_0x5d1cde,{'method':_0x40b190[_0x1fec3f(0x1c4)],'headers':{'Authorization':_0x1fec3f(0x1e1)+_0x7da169,'Content-Type':'application/json'},'body':JSON[_0x1fec3f(0x1e3)](_0x157f64)});if(!_0x23efb7['ok']){const _0x2af0ec=await _0x23efb7[_0x1fec3f(0x1cb)]();throw new Error(_0x1fec3f(0x1c6)+_0x2af0ec);}return _0x23efb7[_0x1fec3f(0x1a9)]();},{'label':_0xc8bc42(0x1a4)});}export async function getFeatureReport(_0x2b654f){const _0x57081a=_0x21e5,_0x1dc6ff={'VunZc':function(_0x19fe3d){return _0x19fe3d();},'rzlYr':function(_0x5bc6ea,_0x577aee,_0x20f4ad){return _0x5bc6ea(_0x577aee,_0x20f4ad);}},_0x30401e=await _0x1dc6ff['VunZc'](getToken);if(!_0x30401e)throw new Error(_0x57081a(0x1e8));const _0x48bcff=getApiBaseUrl(),_0x2a820e=await _0x1dc6ff[_0x57081a(0x1c1)](fetch,_0x48bcff+_0x57081a(0x1b6)+_0x2b654f+_0x57081a(0x1dc),{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x30401e}});if(!_0x2a820e['ok']){const _0x34347f=await _0x2a820e['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report:\x20'+_0x34347f);}return _0x2a820e[_0x57081a(0x1a9)]();}export async function getFeatureReportMarkdown(_0x35e4fd,_0x254745){const _0x2b782b=_0x21e5,_0x3ba3f6={'EIniC':function(_0x3e7a69){return _0x3e7a69();},'kriKF':function(_0x547ff2,_0x430919){return _0x547ff2>_0x430919;},'KThxK':function(_0x461636,_0x785081){return _0x461636&&_0x785081;},'xjRWb':_0x2b782b(0x1bc),'nXXNC':_0x2b782b(0x1b2)},_0x565714=await getToken();if(!_0x565714)throw new Error(_0x2b782b(0x1e8));const _0x593518=_0x3ba3f6['EIniC'](getApiBaseUrl),_0x48ab32=new URLSearchParams(),_0x2872b8=_0x3ba3f6[_0x2b782b(0x1ce)](_0x254745?.['itemIds']?.[_0x2b782b(0x1ed)]??0x0,0x0),_0x49755c=Boolean(_0x254745?.['sessionId']);_0x2872b8&&_0x254745?.[_0x2b782b(0x1da)]&&_0x48ab32['set']('itemIds',_0x254745['itemIds']['join'](','));_0x49755c&&_0x254745?.[_0x2b782b(0x1d7)]&&_0x48ab32[_0x2b782b(0x1ac)]('sessionId',_0x254745[_0x2b782b(0x1d7)]);_0x3ba3f6[_0x2b782b(0x1b5)](!_0x2872b8,!_0x49755c)&&_0x254745?.[_0x2b782b(0x1bc)]&&_0x48ab32['set'](_0x3ba3f6[_0x2b782b(0x1d6)],_0x254745['style']);const _0x2caa10=_0x593518+'/api/v1/mcp/features/'+_0x35e4fd+'/report/markdown',_0x12c21e=''+_0x2caa10+(_0x48ab32[_0x2b782b(0x1e2)]()?'?'+_0x48ab32['toString']():''),_0xd282f7=await fetch(_0x12c21e,{'method':_0x3ba3f6['nXXNC'],'headers':{'Authorization':'Bearer\x20'+_0x565714}});if(!_0xd282f7['ok']){const _0x4e0cfb=await _0xd282f7['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20'+_0x4e0cfb);}return _0xd282f7[_0x2b782b(0x1cb)]();}export async function listFeatureSessions(_0x51ab2a){const _0x4793ed=_0x21e5,_0x30e5a4={'Yolrq':_0x4793ed(0x1e8),'btLTu':_0x4793ed(0x1b2)},_0x5be41e=await getToken();if(!_0x5be41e)throw new Error(_0x30e5a4['Yolrq']);const _0x2c1ea1=getApiBaseUrl(),_0x1a2f49=await fetch(_0x2c1ea1+'/api/v1/mcp/features/'+_0x51ab2a+'/sessions',{'method':_0x30e5a4['btLTu'],'headers':{'Authorization':_0x4793ed(0x1e1)+_0x5be41e}});if(!_0x1a2f49['ok']){const _0x9fe8f=await _0x1a2f49[_0x4793ed(0x1cb)]();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x9fe8f);}return _0x1a2f49['json']();}function _0x21e5(_0x268a9f,_0xf9c07f){_0x268a9f=_0x268a9f-0x1a4;const _0x1c0777=_0x1c07();let _0x21e5fe=_0x1c0777[_0x268a9f];return _0x21e5fe;}export async function startSession(_0x15433b,_0xd1d2dc){const _0x2caa00=_0x21e5,_0x436a2b={'COoPP':function(_0x563fbe){return _0x563fbe();},'jvqAA':function(_0x38ef48,_0x3ee2e4,_0x354610){return _0x38ef48(_0x3ee2e4,_0x354610);}},_0x4b9638=await getToken();if(!_0x4b9638)throw new Error(_0x2caa00(0x1e8));const _0x4f10c0=_0x436a2b[_0x2caa00(0x1ca)](getApiBaseUrl),_0x1b8ed9=await _0x436a2b['jvqAA'](fetch,_0x4f10c0+_0x2caa00(0x1b6)+_0x15433b+_0x2caa00(0x1d0)+_0xd1d2dc+'/start',{'method':'POST','headers':{'Authorization':_0x2caa00(0x1e1)+_0x4b9638}});if(!_0x1b8ed9['ok']){const _0x498aa0=await _0x1b8ed9[_0x2caa00(0x1cb)]();throw new Error('Failed\x20to\x20start\x20session:\x20'+_0x498aa0);}return _0x1b8ed9['json']();}export async function concludeSession(_0x239401,_0x2aeb00){const _0x5ab0a5=_0x21e5,_0x39d7a2={'Lblqg':function(_0x2dc33c){return _0x2dc33c();},'SSgYq':_0x5ab0a5(0x1e8),'dibzC':_0x5ab0a5(0x1ab)},_0x1bf6dc=await _0x39d7a2['Lblqg'](getToken);if(!_0x1bf6dc)throw new Error(_0x39d7a2['SSgYq']);const _0x37b0a4=getApiBaseUrl(),_0x1989bf=await fetch(_0x37b0a4+'/api/v1/mcp/features/'+_0x239401+'/sessions/'+_0x2aeb00+_0x5ab0a5(0x1c8),{'method':_0x39d7a2['dibzC'],'headers':{'Authorization':'Bearer\x20'+_0x1bf6dc}});if(!_0x1989bf['ok']){const _0x4d16a9=await _0x1989bf[_0x5ab0a5(0x1cb)]();throw new Error('Failed\x20to\x20conclude\x20session:\x20'+_0x4d16a9);}return _0x1989bf[_0x5ab0a5(0x1a9)]();}export async function getActionItems(_0x197fd5){const _0x5c5180=_0x21e5,_0xd94748={'PeUQT':_0x5c5180(0x1e8),'SJrLG':function(_0x33a985,_0x317412,_0xea7800){return _0x33a985(_0x317412,_0xea7800);},'SdHQe':_0x5c5180(0x1b2)},_0x3d0941=await getToken();if(!_0x3d0941)throw new Error(_0xd94748['PeUQT']);const _0x4cec78=getApiBaseUrl(),_0xb4bb3d=await _0xd94748[_0x5c5180(0x1ec)](fetch,_0x4cec78+'/api/v1/mcp/features/'+_0x197fd5+_0x5c5180(0x1b3),{'method':_0xd94748['SdHQe'],'headers':{'Authorization':'Bearer\x20'+_0x3d0941}});if(!_0xb4bb3d['ok']){const _0x2afe8a=await _0xb4bb3d[_0x5c5180(0x1cb)]();throw new Error('Failed\x20to\x20get\x20action\x20items:\x20'+_0x2afe8a);}return _0xb4bb3d['json']();}export async function getItemFeedback(_0x2629cf,_0x4d48fa){const _0x31aab9=_0x21e5,_0x130438={'airBq':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','sQJcT':function(_0x29cd98,_0x3b2e57,_0x4a23b8){return _0x29cd98(_0x3b2e57,_0x4a23b8);},'zAcFI':_0x31aab9(0x1b2)},_0x2e34c0=await getToken();if(!_0x2e34c0)throw new Error(_0x130438[_0x31aab9(0x1b0)]);const _0x4a195c=getApiBaseUrl(),_0x333fd0=await _0x130438[_0x31aab9(0x1be)](fetch,_0x4a195c+_0x31aab9(0x1b6)+_0x2629cf+_0x31aab9(0x1dd)+_0x4d48fa+_0x31aab9(0x1d1),{'method':_0x130438['zAcFI'],'headers':{'Authorization':_0x31aab9(0x1e1)+_0x2e34c0}});if(!_0x333fd0['ok']){const _0x436dfe=await _0x333fd0[_0x31aab9(0x1cb)]();throw new Error(_0x31aab9(0x1bb)+_0x436dfe);}return _0x333fd0['json']();}export async function markCommentsAddressed(_0x30e9a5,_0x20601a,_0x577c70){const _0x7be8e0=_0x21e5,_0x367f2d={'TTjXr':function(_0x3e7145){return _0x3e7145();},'zRRsG':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','wysVa':function(_0x36cf16){return _0x36cf16();},'tGmNt':_0x7be8e0(0x1ab),'bXKSZ':'application/json'},_0x1e2f8d=await _0x367f2d[_0x7be8e0(0x1eb)](getToken);if(!_0x1e2f8d)throw new Error(_0x367f2d[_0x7be8e0(0x1bf)]);const _0x527590=_0x367f2d['wysVa'](getApiBaseUrl),_0x5632a7=await fetch(_0x527590+_0x7be8e0(0x1b6)+_0x30e9a5+_0x7be8e0(0x1de),{'method':_0x367f2d[_0x7be8e0(0x1cf)],'headers':{'Authorization':_0x7be8e0(0x1e1)+_0x1e2f8d,'Content-Type':_0x367f2d[_0x7be8e0(0x1e6)]},'body':JSON['stringify']({'checklistItemId':_0x20601a,'commentIds':_0x577c70})});if(!_0x5632a7['ok']){const _0x269af8=await _0x5632a7[_0x7be8e0(0x1cb)]();throw new Error(_0x7be8e0(0x1a5)+_0x269af8);}}export async function softDeleteFeature(_0x1f27b2){const _0x490f79=_0x21e5,_0x2ec70a={'hjppk':function(_0x29967e){return _0x29967e();},'BGTPv':_0x490f79(0x1e8),'ZDMlg':function(_0x2fc43e,_0x2a70d1,_0x3b016b){return _0x2fc43e(_0x2a70d1,_0x3b016b);}},_0x34c023=await _0x2ec70a['hjppk'](getToken);if(!_0x34c023)throw new Error(_0x2ec70a[_0x490f79(0x1d5)]);const _0x1f913e=_0x2ec70a[_0x490f79(0x1c2)](getApiBaseUrl),_0x806b25=await _0x2ec70a['ZDMlg'](fetch,_0x1f913e+_0x490f79(0x1b6)+_0x1f27b2,{'method':'DELETE','headers':{'Authorization':'Bearer\x20'+_0x34c023}});if(!_0x806b25['ok']){const _0x75b251=await _0x806b25['text']();throw new Error(_0x490f79(0x1ef)+_0x75b251);}}export async function restoreFeature(_0x54988b){const _0x508c52=_0x21e5,_0x4e678e={'nAIdo':function(_0x4d51eb){return _0x4d51eb();},'ivgGT':'POST'},_0x98ab12=await _0x4e678e[_0x508c52(0x1e9)](getToken);if(!_0x98ab12)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x198c80=_0x4e678e['nAIdo'](getApiBaseUrl),_0x134f4a=await fetch(_0x198c80+'/api/v1/mcp/features/'+_0x54988b+'/restore',{'method':_0x4e678e[_0x508c52(0x1c7)],'headers':{'Authorization':'Bearer\x20'+_0x98ab12}});if(!_0x134f4a['ok']){const _0x388d0f=await _0x134f4a[_0x508c52(0x1cb)]();throw new Error('Failed\x20to\x20restore\x20feature\x20review:\x20'+_0x388d0f);}}
|
|
1
|
+
(function(_0x414551,_0x44faa1){const _0x32ce87=_0x5771,_0x193c80=_0x414551();while(!![]){try{const _0x3c448e=-parseInt(_0x32ce87(0x1b7))/0x1+-parseInt(_0x32ce87(0x1be))/0x2+parseInt(_0x32ce87(0x1b2))/0x3*(parseInt(_0x32ce87(0x1ad))/0x4)+-parseInt(_0x32ce87(0x1e1))/0x5+-parseInt(_0x32ce87(0x1af))/0x6*(parseInt(_0x32ce87(0x1cc))/0x7)+-parseInt(_0x32ce87(0x1c2))/0x8+parseInt(_0x32ce87(0x1eb))/0x9;if(_0x3c448e===_0x44faa1)break;else _0x193c80['push'](_0x193c80['shift']());}catch(_0x44c1a1){_0x193c80['push'](_0x193c80['shift']());}}}(_0x56e9,0x6a14d));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';function _0x56e9(){const _0x4e8294=['iqsLF','2339588rgJjvn','xRSse','289218JpgEJL','zdATr','/api/v1/mcp/features/','3qcGmmV','length','itemIds','Failed\x20to\x20update\x20scenario:\x20','Failed\x20to\x20list\x20feature\x20reviews:\x20','518713ucHYZt','NYixJ','QpspB','Failed\x20to\x20delete\x20feature\x20review:\x20','/comments/address','/feedback','Failed\x20to\x20get\x20feature\x20review:\x20','199704McazmJ','Failed\x20to\x20get\x20action\x20items:\x20','MKtCb','sessionId','478768qfyImI','text','Failed\x20to\x20start\x20session:\x20','QWZhS','GET','fbCTZ','stringify','sOpYj','raMoi','DnblY','7udhycI','mTjMY','XpvkL','/restore','SNJih','application/json','/start','includeDeleted','/sessions/','mTpYJ','/checklist','iqaUZ','Failed\x20to\x20restore\x20feature\x20review:\x20','Failed\x20to\x20list\x20sessions:\x20','pcqpI','POST','Failed\x20to\x20conclude\x20session:\x20','Bearer\x20','/report/markdown','limit','/api/v1/mcp/features','1436795lKkSKm','GgPeD','Failed\x20to\x20create\x20feature\x20review:\x20','style','\x0a\x0aUpgrade\x20your\x20plan:\x20','RLPhd','SMteK','gitRepoUrl','Failed\x20to\x20update\x20feature\x20review:\x20','HRsmB','7772265qQkFjS','json','UWKMZ','MHuJC','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','set','gYHWj','toString','BRCqq'];_0x56e9=function(){return _0x4e8294;};return _0x56e9();}import{withRetry}from'./retry.js';export async function createFeature(_0x3d7dd9){const _0x551d0b=_0x5771,_0x22ded3={'sOpYj':function(_0x144db0){return _0x144db0();},'iqsLF':_0x551d0b(0x1a7),'MHuJC':'application/json','gTFxV':function(_0x25b410,_0x4c51d7){return _0x25b410===_0x4c51d7;},'KDank':'https://dashboard.ranger.net/billing'},_0x4cdaf9=await _0x22ded3[_0x551d0b(0x1c9)](getToken);if(!_0x4cdaf9)throw new Error(_0x22ded3[_0x551d0b(0x1ac)]);const _0x522ee7=_0x22ded3[_0x551d0b(0x1c9)](getApiBaseUrl),_0x521d4f=await fetch(_0x522ee7+'/api/v1/mcp/features',{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x4cdaf9,'Content-Type':_0x22ded3[_0x551d0b(0x1a6)]},'body':JSON[_0x551d0b(0x1c8)](_0x3d7dd9)});if(!_0x521d4f['ok']){if(_0x22ded3['gTFxV'](_0x521d4f['status'],0x192)){const _0x1cc8f4=await _0x521d4f['json'](),_0x58f4b0=_0x1cc8f4['billingUrl']||_0x22ded3['KDank'];throw new Error((_0x1cc8f4['message']||'Feature\x20limit\x20exceeded')+_0x551d0b(0x1e5)+_0x58f4b0);}const _0xf13d7a=await _0x521d4f['text']();throw new Error(_0x551d0b(0x1e3)+_0xf13d7a);}return _0x521d4f['json']();}export async function listFeatures(_0x5286d9){const _0x41d589=_0x5771,_0x3661a6={'XqVki':function(_0x21d9ef){return _0x21d9ef();},'GgPeD':function(_0x5c2369){return _0x5c2369();}},_0xedcb5f=await _0x3661a6['XqVki'](getToken);if(!_0xedcb5f)throw new Error(_0x41d589(0x1a7));const _0x2180ef=_0x3661a6[_0x41d589(0x1e2)](getApiBaseUrl),_0x4ae1fc=new URLSearchParams();if(_0x5286d9?.[_0x41d589(0x1e8)])_0x4ae1fc['set'](_0x41d589(0x1e8),_0x5286d9['gitRepoUrl']);if(_0x5286d9?.['gitBranch'])_0x4ae1fc['set']('gitBranch',_0x5286d9['gitBranch']);if(_0x5286d9?.['limit'])_0x4ae1fc['set']('limit',_0x5286d9[_0x41d589(0x1df)]['toString']());if(_0x5286d9?.['offset'])_0x4ae1fc[_0x41d589(0x1a8)]('offset',_0x5286d9['offset']['toString']());if(_0x5286d9?.[_0x41d589(0x1d3)])_0x4ae1fc[_0x41d589(0x1a8)](_0x41d589(0x1d3),'true');const _0x41c705=_0x2180ef+_0x41d589(0x1e0)+(_0x4ae1fc['toString']()?'?'+_0x4ae1fc[_0x41d589(0x1aa)]():''),_0x212c84=await fetch(_0x41c705,{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0xedcb5f}});if(!_0x212c84['ok']){const _0x38dbb5=await _0x212c84[_0x41d589(0x1c3)]();throw new Error(_0x41d589(0x1b6)+_0x38dbb5);}return _0x212c84[_0x41d589(0x1ec)]();}export async function getFeature(_0x27c041){const _0x5a206d=_0x5771,_0x146dc2={'mTjMY':function(_0x4b76f8){return _0x4b76f8();},'khdcF':function(_0x48fd66){return _0x48fd66();},'BRCqq':function(_0x27fde0,_0xcf1753,_0x58ab8b){return _0x27fde0(_0xcf1753,_0x58ab8b);},'OcUBd':'GET'},_0x16218a=await _0x146dc2[_0x5a206d(0x1cd)](getToken);if(!_0x16218a)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x5bddc1=_0x146dc2['khdcF'](getApiBaseUrl),_0xddf49d=await _0x146dc2[_0x5a206d(0x1ab)](fetch,_0x5bddc1+_0x5a206d(0x1b1)+_0x27c041,{'method':_0x146dc2['OcUBd'],'headers':{'Authorization':_0x5a206d(0x1dd)+_0x16218a}});if(!_0xddf49d['ok']){const _0x77a17d=await _0xddf49d[_0x5a206d(0x1c3)]();throw new Error(_0x5a206d(0x1bd)+_0x77a17d);}return _0xddf49d[_0x5a206d(0x1ec)]();}export async function updateFeature(_0x2e5da3,_0x1b0fdf){const _0x31dd87=_0x5771,_0x8bc776={'gmVoB':function(_0x2e4b7d){return _0x2e4b7d();},'xPKez':'PATCH'},_0x4b0c3b=await getToken();if(!_0x4b0c3b)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x1e16e5=_0x8bc776['gmVoB'](getApiBaseUrl),_0x16739a=await fetch(_0x1e16e5+_0x31dd87(0x1b1)+_0x2e5da3,{'method':_0x8bc776['xPKez'],'headers':{'Authorization':_0x31dd87(0x1dd)+_0x4b0c3b,'Content-Type':'application/json'},'body':JSON[_0x31dd87(0x1c8)](_0x1b0fdf)});if(!_0x16739a['ok']){const _0xa733f0=await _0x16739a['text']();throw new Error(_0x31dd87(0x1e9)+_0xa733f0);}return _0x16739a['json']();}export async function createChecklistItem(_0x18fae0,_0x30663e,_0x5e65a6){const _0x478140=_0x5771,_0x106b99={'mTpYJ':function(_0x1cfbb8){return _0x1cfbb8();},'EbJLF':_0x478140(0x1a7),'XpvkL':'POST'},_0x396216=await _0x106b99[_0x478140(0x1d5)](getToken);if(!_0x396216)throw new Error(_0x106b99['EbJLF']);const _0x32fbfe=getApiBaseUrl(),_0x2c9f3b=await fetch(_0x32fbfe+_0x478140(0x1b1)+_0x18fae0+_0x478140(0x1d6),{'method':_0x106b99[_0x478140(0x1ce)],'headers':{'Authorization':'Bearer\x20'+_0x396216,'Content-Type':'application/json'},'body':JSON['stringify']({'description':_0x30663e,'position':_0x5e65a6})});if(!_0x2c9f3b['ok']){const _0x2bd247=await _0x2c9f3b[_0x478140(0x1c3)]();throw new Error('Failed\x20to\x20create\x20scenario:\x20'+_0x2bd247);}return _0x2c9f3b['json']();}export async function updateChecklistItem(_0x1699ce,_0x419b5c,_0x2edb38){const _0x2f4bec=_0x5771,_0xf462cb={'xRSse':_0x2f4bec(0x1a7),'uFxxu':'PATCH','nsUAb':'application/json','TRtrB':function(_0x3ca878,_0x3ce81c,_0x5a1044){return _0x3ca878(_0x3ce81c,_0x5a1044);}};return _0xf462cb['TRtrB'](withRetry,async()=>{const _0x17a782=_0x2f4bec,_0x1a3569=await getToken();if(!_0x1a3569)throw new Error(_0xf462cb[_0x17a782(0x1ae)]);const _0x3b1810=getApiBaseUrl(),_0x3032d4=await fetch(_0x3b1810+'/api/v1/mcp/features/'+_0x1699ce+'/checklist/'+_0x419b5c,{'method':_0xf462cb['uFxxu'],'headers':{'Authorization':'Bearer\x20'+_0x1a3569,'Content-Type':_0xf462cb['nsUAb']},'body':JSON[_0x17a782(0x1c8)](_0x2edb38)});if(!_0x3032d4['ok']){const _0x2080f2=await _0x3032d4['text']();throw new Error(_0x17a782(0x1b5)+_0x2080f2);}return _0x3032d4['json']();},{'label':'updateChecklistItem'});}export async function getFeatureReport(_0x4c62cd){const _0x5670ab=_0x5771,_0x281a51={'pcqpI':_0x5670ab(0x1a7),'RLPhd':function(_0x1925d3){return _0x1925d3();},'iqaUZ':function(_0x4deac5,_0x41e1bb,_0x36688a){return _0x4deac5(_0x41e1bb,_0x36688a);}},_0x5f0e52=await getToken();if(!_0x5f0e52)throw new Error(_0x281a51[_0x5670ab(0x1da)]);const _0x58134c=_0x281a51[_0x5670ab(0x1e6)](getApiBaseUrl),_0x2afc95=await _0x281a51[_0x5670ab(0x1d7)](fetch,_0x58134c+_0x5670ab(0x1b1)+_0x4c62cd+'/report',{'method':'GET','headers':{'Authorization':_0x5670ab(0x1dd)+_0x5f0e52}});if(!_0x2afc95['ok']){const _0x10035e=await _0x2afc95[_0x5670ab(0x1c3)]();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report:\x20'+_0x10035e);}return _0x2afc95['json']();}export async function getFeatureReportMarkdown(_0x425f3e,_0x15e109){const _0x344124=_0x5771,_0x449d68={'gYHWj':function(_0x20e4ed){return _0x20e4ed();},'DnblY':_0x344124(0x1c1),'UWKMZ':function(_0x540a94,_0x3b2c20,_0xc7a61b){return _0x540a94(_0x3b2c20,_0xc7a61b);},'fEnTJ':'GET'},_0x4d28a5=await _0x449d68[_0x344124(0x1a9)](getToken);if(!_0x4d28a5)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x466aac=getApiBaseUrl(),_0x399f68=new URLSearchParams(),_0x13860=(_0x15e109?.['itemIds']?.[_0x344124(0x1b3)]??0x0)>0x0,_0x19c862=Boolean(_0x15e109?.[_0x344124(0x1c1)]);_0x13860&&_0x15e109?.['itemIds']&&_0x399f68[_0x344124(0x1a8)](_0x344124(0x1b4),_0x15e109['itemIds']['join'](','));_0x19c862&&_0x15e109?.[_0x344124(0x1c1)]&&_0x399f68[_0x344124(0x1a8)](_0x449d68[_0x344124(0x1cb)],_0x15e109['sessionId']);!_0x13860&&!_0x19c862&&_0x15e109?.['style']&&_0x399f68[_0x344124(0x1a8)](_0x344124(0x1e4),_0x15e109[_0x344124(0x1e4)]);const _0x155b7c=_0x466aac+'/api/v1/mcp/features/'+_0x425f3e+_0x344124(0x1de),_0x3a361c=''+_0x155b7c+(_0x399f68[_0x344124(0x1aa)]()?'?'+_0x399f68['toString']():''),_0x28b3d1=await _0x449d68[_0x344124(0x1a5)](fetch,_0x3a361c,{'method':_0x449d68['fEnTJ'],'headers':{'Authorization':_0x344124(0x1dd)+_0x4d28a5}});if(!_0x28b3d1['ok']){const _0x26840c=await _0x28b3d1[_0x344124(0x1c3)]();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20'+_0x26840c);}return _0x28b3d1[_0x344124(0x1c3)]();}export async function listFeatureSessions(_0x4914dd){const _0xf13b94=_0x5771,_0xa889d2={'SNJih':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','NYixJ':function(_0xc4ec7){return _0xc4ec7();}},_0x57d8d7=await getToken();if(!_0x57d8d7)throw new Error(_0xa889d2[_0xf13b94(0x1d0)]);const _0x340191=_0xa889d2[_0xf13b94(0x1b8)](getApiBaseUrl),_0xc3176d=await fetch(_0x340191+'/api/v1/mcp/features/'+_0x4914dd+'/sessions',{'method':_0xf13b94(0x1c6),'headers':{'Authorization':_0xf13b94(0x1dd)+_0x57d8d7}});if(!_0xc3176d['ok']){const _0x397520=await _0xc3176d[_0xf13b94(0x1c3)]();throw new Error(_0xf13b94(0x1d9)+_0x397520);}return _0xc3176d[_0xf13b94(0x1ec)]();}export async function startSession(_0x555a2c,_0x3cb5e5){const _0x55fa4d=_0x5771,_0x179267=await getToken();if(!_0x179267)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x372156=getApiBaseUrl(),_0x1368f9=await fetch(_0x372156+_0x55fa4d(0x1b1)+_0x555a2c+_0x55fa4d(0x1d4)+_0x3cb5e5+_0x55fa4d(0x1d2),{'method':_0x55fa4d(0x1db),'headers':{'Authorization':'Bearer\x20'+_0x179267}});if(!_0x1368f9['ok']){const _0x353e36=await _0x1368f9[_0x55fa4d(0x1c3)]();throw new Error(_0x55fa4d(0x1c4)+_0x353e36);}return _0x1368f9[_0x55fa4d(0x1ec)]();}function _0x5771(_0x3739b1,_0x827419){_0x3739b1=_0x3739b1-0x1a5;const _0x56e93b=_0x56e9();let _0x5771e1=_0x56e93b[_0x3739b1];return _0x5771e1;}export async function concludeSession(_0x278fd3,_0x1e6c4b){const _0x17a822=_0x5771,_0x16e420={'eXQtH':function(_0x3425d3){return _0x3425d3();},'zdATr':function(_0x5d5602,_0x365513,_0x2e1de9){return _0x5d5602(_0x365513,_0x2e1de9);}},_0x522ff4=await getToken();if(!_0x522ff4)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x30cf36=_0x16e420['eXQtH'](getApiBaseUrl),_0xf17d70=await _0x16e420[_0x17a822(0x1b0)](fetch,_0x30cf36+'/api/v1/mcp/features/'+_0x278fd3+'/sessions/'+_0x1e6c4b+'/conclude',{'method':'POST','headers':{'Authorization':_0x17a822(0x1dd)+_0x522ff4}});if(!_0xf17d70['ok']){const _0xca3426=await _0xf17d70[_0x17a822(0x1c3)]();throw new Error(_0x17a822(0x1dc)+_0xca3426);}return _0xf17d70[_0x17a822(0x1ec)]();}export async function getActionItems(_0x5c390f){const _0x1aa429=_0x5771,_0x317b21={'raMoi':_0x1aa429(0x1a7),'MKtCb':_0x1aa429(0x1c6)},_0x68af11=await getToken();if(!_0x68af11)throw new Error(_0x317b21[_0x1aa429(0x1ca)]);const _0x328c27=getApiBaseUrl(),_0x56740e=await fetch(_0x328c27+'/api/v1/mcp/features/'+_0x5c390f+'/action-items',{'method':_0x317b21[_0x1aa429(0x1c0)],'headers':{'Authorization':'Bearer\x20'+_0x68af11}});if(!_0x56740e['ok']){const _0xacc914=await _0x56740e['text']();throw new Error(_0x1aa429(0x1bf)+_0xacc914);}return _0x56740e['json']();}export async function getItemFeedback(_0x16836f,_0x167af0){const _0x2f29bc=_0x5771,_0x6b8df2={'uBUiM':_0x2f29bc(0x1a7),'QWZhS':function(_0x293e50){return _0x293e50();},'XMMwv':function(_0x5e3c13,_0x12fdb0,_0x23ff0d){return _0x5e3c13(_0x12fdb0,_0x23ff0d);}},_0x3ab2cd=await getToken();if(!_0x3ab2cd)throw new Error(_0x6b8df2['uBUiM']);const _0x3c7dab=_0x6b8df2[_0x2f29bc(0x1c5)](getApiBaseUrl),_0x554ec5=await _0x6b8df2['XMMwv'](fetch,_0x3c7dab+_0x2f29bc(0x1b1)+_0x16836f+'/checklist-items/'+_0x167af0+_0x2f29bc(0x1bc),{'method':'GET','headers':{'Authorization':_0x2f29bc(0x1dd)+_0x3ab2cd}});if(!_0x554ec5['ok']){const _0x27b179=await _0x554ec5[_0x2f29bc(0x1c3)]();throw new Error('Failed\x20to\x20get\x20item\x20feedback:\x20'+_0x27b179);}return _0x554ec5[_0x2f29bc(0x1ec)]();}export async function markCommentsAddressed(_0x2dcc6f,_0x1c28be,_0x58c649){const _0x59a509=_0x5771,_0x24fe94={'QpspB':function(_0x558add){return _0x558add();},'fbCTZ':_0x59a509(0x1a7),'SMteK':'POST'},_0x26225a=await _0x24fe94[_0x59a509(0x1b9)](getToken);if(!_0x26225a)throw new Error(_0x24fe94[_0x59a509(0x1c7)]);const _0x36d461=_0x24fe94['QpspB'](getApiBaseUrl),_0x34fe92=await fetch(_0x36d461+_0x59a509(0x1b1)+_0x2dcc6f+_0x59a509(0x1bb),{'method':_0x24fe94[_0x59a509(0x1e7)],'headers':{'Authorization':'Bearer\x20'+_0x26225a,'Content-Type':_0x59a509(0x1d1)},'body':JSON['stringify']({'checklistItemId':_0x1c28be,'commentIds':_0x58c649})});if(!_0x34fe92['ok']){const _0x51b25b=await _0x34fe92[_0x59a509(0x1c3)]();throw new Error('Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20'+_0x51b25b);}}export async function softDeleteFeature(_0x3007c5){const _0x977aae=_0x5771,_0xed7960={'OmMyg':function(_0x56b777){return _0x56b777();},'HRsmB':function(_0x5210ee){return _0x5210ee();}},_0x517b5c=await _0xed7960['OmMyg'](getToken);if(!_0x517b5c)throw new Error(_0x977aae(0x1a7));const _0xf52a0a=_0xed7960[_0x977aae(0x1ea)](getApiBaseUrl),_0x2dc0dc=await fetch(_0xf52a0a+_0x977aae(0x1b1)+_0x3007c5,{'method':'DELETE','headers':{'Authorization':_0x977aae(0x1dd)+_0x517b5c}});if(!_0x2dc0dc['ok']){const _0x5316c5=await _0x2dc0dc['text']();throw new Error(_0x977aae(0x1ba)+_0x5316c5);}}export async function restoreFeature(_0x80fea0){const _0x2d1353=_0x5771,_0x3c0efc={'KbCPc':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','QiasZ':function(_0x2322b1,_0x289761,_0x183a39){return _0x2322b1(_0x289761,_0x183a39);}},_0x3cd647=await getToken();if(!_0x3cd647)throw new Error(_0x3c0efc['KbCPc']);const _0x2ac479=getApiBaseUrl(),_0x9ef00e=await _0x3c0efc['QiasZ'](fetch,_0x2ac479+'/api/v1/mcp/features/'+_0x80fea0+_0x2d1353(0x1cf),{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x3cd647}});if(!_0x9ef00e['ok']){const _0x22d642=await _0x9ef00e[_0x2d1353(0x1c3)]();throw new Error(_0x2d1353(0x1d8)+_0x22d642);}}
|