@ranger-testing/ranger-cli 3.1.2-alpha.b450a14-41 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/build/cli.js +1 -1
  2. package/build/commands/addEnv.js +1 -1
  3. package/build/commands/authEncrypt.js +1 -1
  4. package/build/commands/clean.js +1 -1
  5. package/build/commands/config.js +1 -1
  6. package/build/commands/deleteProfile.js +1 -1
  7. package/build/commands/env.js +1 -1
  8. package/build/commands/feature.js +1 -1
  9. package/build/commands/hook.js +1 -1
  10. package/build/commands/hooks/autoPrompt.js +1 -1
  11. package/build/commands/hooks/disable.js +1 -1
  12. package/build/commands/hooks/enable.js +1 -1
  13. package/build/commands/hooks/exitPlanMode.js +1 -1
  14. package/build/commands/hooks/index.js +1 -1
  15. package/build/commands/hooks/output.js +1 -1
  16. package/build/commands/hooks/planReminder.js +1 -1
  17. package/build/commands/hooks/planStart.js +1 -1
  18. package/build/commands/hooks/postEdit.js +1 -1
  19. package/build/commands/hooks/preCompact.js +1 -1
  20. package/build/commands/hooks/sessionEnd.js +1 -1
  21. package/build/commands/hooks/sessionStart.js +1 -1
  22. package/build/commands/hooks/stopHook.js +1 -1
  23. package/build/commands/index.js +1 -1
  24. package/build/commands/login.js +1 -1
  25. package/build/commands/mcpBootstrap.js +1 -1
  26. package/build/commands/migrateProfile.js +1 -1
  27. package/build/commands/setup/claude.js +1 -1
  28. package/build/commands/setup/opencode.js +1 -1
  29. package/build/commands/setupCi.js +1 -1
  30. package/build/commands/skillup.js +1 -1
  31. package/build/commands/start.js +1 -1
  32. package/build/commands/status.js +1 -1
  33. package/build/commands/update.js +1 -1
  34. package/build/commands/updateEnv.js +1 -1
  35. package/build/commands/useEnv.js +1 -1
  36. package/build/commands/utils/activeProfile.js +1 -1
  37. package/build/commands/utils/agentEnv.js +1 -1
  38. package/build/commands/utils/browserSessionsApi.js +1 -1
  39. package/build/commands/utils/claudeConfig.js +1 -1
  40. package/build/commands/utils/claudeOverrideSettings.js +1 -1
  41. package/build/commands/utils/claudePlugin.js +1 -1
  42. package/build/commands/utils/cloudProfile.js +1 -1
  43. package/build/commands/utils/cloudProfileSession.js +1 -1
  44. package/build/commands/utils/crypto.js +1 -1
  45. package/build/commands/utils/desirePathLog.js +1 -1
  46. package/build/commands/utils/deviceAuth.js +1 -1
  47. package/build/commands/utils/environment.js +1 -1
  48. package/build/commands/utils/featureApi.js +1 -1
  49. package/build/commands/utils/fixWebmDuration.js +1 -1
  50. package/build/commands/utils/gitTracked.js +1 -1
  51. package/build/commands/utils/keychain.js +1 -1
  52. package/build/commands/utils/legacyWarning.js +1 -1
  53. package/build/commands/utils/localAgentInstallationsApi.js +1 -1
  54. package/build/commands/utils/matchAuthEnvironment.js +1 -1
  55. package/build/commands/utils/mcpImageBase64.js +1 -1
  56. package/build/commands/utils/model.js +1 -1
  57. package/build/commands/utils/novaActCli.js +1 -1
  58. package/build/commands/utils/opencodeConfig.js +1 -1
  59. package/build/commands/utils/organizationEnvApi.js +1 -1
  60. package/build/commands/utils/playwrightCli.js +1 -1
  61. package/build/commands/utils/profileMessages.js +1 -1
  62. package/build/commands/utils/profileSetupBanner.js +1 -1
  63. package/build/commands/utils/projectsConfig.js +1 -1
  64. package/build/commands/utils/rangerConfig.js +1 -1
  65. package/build/commands/utils/rangerRoot.js +1 -1
  66. package/build/commands/utils/rangerwrightCli.js +1 -1
  67. package/build/commands/utils/resolveProfileContext.js +1 -1
  68. package/build/commands/utils/resolveProfileUrl.js +1 -1
  69. package/build/commands/utils/retry.js +1 -1
  70. package/build/commands/utils/sessionCache.js +1 -1
  71. package/build/commands/utils/settings.js +1 -1
  72. package/build/commands/utils/skillContent.js +1 -1
  73. package/build/commands/utils/skills.js +1 -1
  74. package/build/commands/utils/stitchWebmFiles.js +1 -1
  75. package/build/commands/utils/telemetry.js +1 -1
  76. package/build/commands/utils/tokenRefresh.js +1 -1
  77. package/build/commands/utils/traceSnapshotMapper.js +1 -1
  78. package/build/commands/utils/tunnelClient.js +1 -1
  79. package/build/commands/utils/userApi.js +1 -1
  80. package/build/commands/utils/version.js +1 -1
  81. package/build/commands/verifyFeature.js +1 -1
  82. package/build/commands/verifyFeatureCli.js +1 -1
  83. package/build/commands/verifyFeatureNovaCli.js +1 -1
  84. package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
  85. package/package.json +1 -1
@@ -1 +1 @@
1
- const _0x236664=_0x222d;(function(_0x3d0ab5,_0x2a7566){const _0x5cf0c=_0x222d,_0x6626a8=_0x3d0ab5();while(!![]){try{const _0x15a3c2=-parseInt(_0x5cf0c(0x20c))/0x1*(-parseInt(_0x5cf0c(0x1c3))/0x2)+parseInt(_0x5cf0c(0x1b8))/0x3*(parseInt(_0x5cf0c(0x1a6))/0x4)+-parseInt(_0x5cf0c(0x1a0))/0x5+parseInt(_0x5cf0c(0x19c))/0x6*(-parseInt(_0x5cf0c(0x202))/0x7)+-parseInt(_0x5cf0c(0x1b3))/0x8*(parseInt(_0x5cf0c(0x230))/0x9)+parseInt(_0x5cf0c(0x1de))/0xa+parseInt(_0x5cf0c(0x210))/0xb;if(_0x15a3c2===_0x2a7566)break;else _0x6626a8['push'](_0x6626a8['shift']());}catch(_0x5a41bb){_0x6626a8['push'](_0x6626a8['shift']());}}}(_0x55f1,0x7b91b));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x2278a3 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,isCachedSessionLive,isInteractive,needsTunnel,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';import{createTunnelBridge,launchBrowserServer}from'./tunnelClient.js';function targetHostForTelemetry(_0x3f2ff4){try{return new URL(_0x3f2ff4)['host'];}catch{return'invalid-url';}}function errorMessageForTelemetry(_0x120efa){const _0x4c95fb=_0x222d,_0x546fba={'LxzFZ':function(_0x185a98,_0xca8a0f){return _0x185a98 instanceof _0xca8a0f;}};return _0x546fba[_0x4c95fb(0x1b4)](_0x120efa,Error)?_0x120efa[_0x4c95fb(0x1a7)]:undefined;}function trackBridgeEvent(_0xc9e1d0,_0x2b6113){const _0x254137=_0x222d,_0x222384={'jLPvG':'tunnel_bridge_event','Vjlzz':function(_0x13661b,_0x417ee6){return _0x13661b===_0x417ee6;},'xkQYi':function(_0x2c03e9,_0x4d0114){return _0x2c03e9===_0x4d0114;},'xOIUj':_0x254137(0x1fb)};if(!_0xc9e1d0)return;const _0x4ded6b={'tunnelSessionId':_0x2b6113[_0x254137(0x216)],'tunnelEventType':_0x2b6113[_0x254137(0x1b5)],'connectionId':_0x2b6113['connectionId'],'code':_0x2b6113[_0x254137(0x1ae)],'reason':_0x2b6113['reason'],'error':_0x2b6113[_0x254137(0x20b)],'elapsedMs':_0x2b6113[_0x254137(0x1f1)],'activeLocalConnections':_0x2b6113['activeLocalConnections'],'pendingLocalConnections':_0x2b6113[_0x254137(0x22f)]};_0xc9e1d0[_0x254137(0x1a1)](_0x222384['jLPvG'],_0x4ded6b),(_0x222384[_0x254137(0x1e3)](_0x2b6113['type'],'tunnel_error')||_0x222384[_0x254137(0x198)](_0x2b6113['type'],'local_ws_error'))&&void _0xc9e1d0['trackPhaseError'](_0x222384['xOIUj'],new Error(_0x2b6113['error']??_0x2b6113[_0x254137(0x1b5)]),_0x4ded6b);}const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0xcaef25=_0x222d,_0xf07598={'AkquR':_0xcaef25(0x218)},_0x35eb6f=await getToken();if(!_0x35eb6f)throw new Error(_0xf07598[_0xcaef25(0x204)]);return _0x35eb6f;}async function apiRequest(_0x353188,_0x5c80c8={}){const _0x3c3e1e=_0x222d,_0x471048={'uULDG':function(_0x22c2d0){return _0x22c2d0();},'YSwoJ':'application/json','egJPK':_0x3c3e1e(0x1e4),'tcpMQ':function(_0x21a55c,_0x1044e1){return _0x21a55c===_0x1044e1;}},_0x2ceb76=await _0x471048[_0x3c3e1e(0x22e)](requireToken),_0x580267=_0x471048[_0x3c3e1e(0x22e)](getApiBaseUrl),_0x5251d3=await fetch(''+_0x580267+_0x353188,{..._0x5c80c8,'headers':{'Authorization':'Bearer\x20'+_0x2ceb76,'Content-Type':_0x471048[_0x3c3e1e(0x1cf)],..._0x5c80c8['headers']??{}}});if(!_0x5251d3['ok']){let _0x10411d='',_0x12c81c;try{const _0x5320b4=await _0x5251d3['json']();_0x10411d=(typeof _0x5320b4[_0x3c3e1e(0x20b)]===_0x471048[_0x3c3e1e(0x19a)]?_0x5320b4[_0x3c3e1e(0x20b)]:undefined)??JSON['stringify'](_0x5320b4);if(_0x471048['tcpMQ'](typeof _0x5320b4['code'],_0x3c3e1e(0x1e4)))_0x12c81c=_0x5320b4[_0x3c3e1e(0x1ae)];}catch{_0x10411d=_0x5251d3['statusText'];}throw new ApiError(_0x3c3e1e(0x1fd)+_0x353188+_0x3c3e1e(0x229)+_0x5251d3[_0x3c3e1e(0x1e5)]+'):\x20'+_0x10411d,_0x5251d3['status'],_0x10411d,_0x12c81c);}if(_0x471048[_0x3c3e1e(0x1e6)](_0x5251d3[_0x3c3e1e(0x1e5)],0xcc))return undefined;return _0x5251d3['json']();}export class ApiError extends Error{[_0x236664(0x1e5)];['detail'];['code'];constructor(_0xd89cbb,_0x4a6067,_0x996bc3,_0x2291a8){const _0x1e4746=_0x236664,_0x11ae30='4|0|1|3|2'['split']('|');let _0x43080a=0x0;while(!![]){switch(_0x11ae30[_0x43080a++]){case'0':this[_0x1e4746(0x1e5)]=_0x4a6067;continue;case'1':this[_0x1e4746(0x195)]=_0x996bc3;continue;case'2':this[_0x1e4746(0x1e0)]='ApiError';continue;case'3':this['code']=_0x2291a8;continue;case'4':super(_0xd89cbb);continue;}break;}}}export async function fetchCloudProfile(_0xfc11a9){const _0x218240=_0x236664,_0x520cf9={'waDBi':function(_0x377a5d,_0x333c1c){return _0x377a5d instanceof _0x333c1c;}};try{return await apiRequest(_0x218240(0x1d4)+encodeURIComponent(_0xfc11a9));}catch(_0x49c264){if(_0x520cf9[_0x218240(0x1d5)](_0x49c264,ApiError)&&_0x49c264[_0x218240(0x1e5)]===0x194)return null;throw _0x49c264;}}export async function listCloudProfiles(){const _0x3aba91=_0x236664,_0x3e00f2={'TcWqf':function(_0xeff371,_0x58b28a){return _0xeff371(_0x58b28a);}},_0x4e940a=await _0x3e00f2[_0x3aba91(0x227)](apiRequest,'/api/v1/profiles');return _0x4e940a['profiles'];}function _0x55f1(){const _0x4a9ad3=['WYQiH','\x20\x20Login\x20successful.\x20Session\x20cached.','username','QtyMR','2888JOviZP','LxzFZ','type','\x20\x20Created\x20cloud\x20profile\x20\x22','akQeJ','3ODhcjJ','trackPhaseError','target_url','force','test_output','wsEndpoint','\x22.\x0a','\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20','you\x27re\x20now\x20at\x20\x22','cli:manual-login','tunnel_login_request','1910254vjCkuy','stringify','POST','TAyDK','goto','RANGER_TEST_USERNAME','\x22\x20failed\x20validation\x20—\x20refreshing...','foAXB','VWNVV','trim','agent','yKMQn','YSwoJ',').\x20','AvVjb','storageStatePath','PnVTc','/api/v1/profiles/','waDBi','sygbI','effectiveBaseUrl','session_state','pwEndpoint','jmgUp','DaYlu','bnVHl','RANGER_TEST_PASSWORD','2859900ZBnmrR','WWSOk','name','Browser\x20login\x20timed\x20out\x20after\x20','FAzaF','Vjlzz','string','status','tcpMQ','\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.','success','tVasL','Browser\x20login\x20timed\x20out\x20before\x20completion.','yzGia','settings','CjNdD','mNYtx','DELETE','/api/v1/tunnel/sessions','elapsedMs','QOKpP','newPage','MFoQi','\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','ffHRA','forceLogin','Qihji','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22','tunnel_bridge','cookies','API\x20request\x20','telemetry','UlaUr','organizationId','\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20','5622365ynoowa','\x20\x20Skipping\x20cloud\x20session\x20for\x20local\x20target\x20\x22','AkquR','oSqfn','origin','\x20\x20Cloud\x20session\x20for\x20\x22','YZnhu','defaultEnvironmentKey','\x22;\x20proceeding\x20with\x20loginInstructions.','error','1hTPzWc','length','parse','isArray','14173313HDbHWt','YfqHP','\x22,\x20refreshing\x20session...','env','\x22,\x20cached\x20locally','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','sessionId','pGolj','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','vqGLa','IZYii','prompt','jBhAR','push','\x20\x20Using\x20cached\x20local\x20session\x20for\x20cloud\x20profile\x20\x22','\x20\x20forceLogin\x20enabled\x20for\x20\x22','not_configured','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','/api/v1/profiles','gCmfA','confirm','xBvQs','invalidateOn','TcWqf','Tunnel\x20bridge\x20closed\x20before\x20login\x20completed\x20for\x20','\x20failed\x20(','\x22\x20not\x20found.','close','dcqTv','userAgent','uULDG','pendingLocalConnections','17919WFgZck','log','If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.','pw_endpoint','keys','\x22\x20for\x20','seeDZ','TofvT','targetUrl','loginInstructions','domains','detail','NThex','trackPhaseStart','xkQYi','join','egJPK','save','6JxVtct','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20','some','clientIp','4308795lRACxL','trackPhaseEnd','catch','Cloud\x20profile\x20\x22','\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20','tunnel_login_setup','1440976fbDtGr','message','environmentKey','sessionState','\x20\x20Server-side\x20login\x20error:\x20','qSYBt','GrjUJ','/api/v1/profiles/auth-config','code'];_0x55f1=function(){return _0x4a9ad3;};return _0x55f1();}export async function deleteCloudProfile(_0x53968a){const _0x3f8692=_0x236664,_0x4e4056={'DaYlu':function(_0x354844,_0x430c71,_0x598883){return _0x354844(_0x430c71,_0x598883);},'PnVTc':function(_0x199b65,_0x3dd1f7){return _0x199b65(_0x3dd1f7);},'IZYii':function(_0x36a4f1,_0x526430){return _0x36a4f1===_0x526430;}};try{await _0x4e4056[_0x3f8692(0x1db)](apiRequest,'/api/v1/profiles/'+_0x4e4056[_0x3f8692(0x1d3)](encodeURIComponent,_0x53968a),{'method':_0x3f8692(0x1ef)});}catch(_0x519cbf){if(_0x519cbf instanceof ApiError&&_0x4e4056[_0x3f8692(0x21a)](_0x519cbf[_0x3f8692(0x1e5)],0x194))throw new Error(_0x3f8692(0x1a3)+_0x53968a+_0x3f8692(0x22a));throw _0x519cbf;}}export async function createCloudProfile(_0x7ef45a,_0x251a22,_0x2df7b4={}){const _0x2cc5f6=_0x236664,_0x2a31b2={'mHyeq':_0x2cc5f6(0x222),'oSqfn':_0x2cc5f6(0x1c5)},_0x3356dd={'name':_0x7ef45a};if(_0x251a22)_0x3356dd['environment_key']=_0x251a22;_0x2df7b4[_0x2cc5f6(0x1ec)]&&Object[_0x2cc5f6(0x234)](_0x2df7b4['settings'])['length']>0x0&&(_0x3356dd[_0x2cc5f6(0x1ec)]=_0x2df7b4[_0x2cc5f6(0x1ec)]);if(_0x2df7b4['username'])_0x3356dd['username']=_0x2df7b4['username'];if(_0x2df7b4['password'])_0x3356dd['password']=_0x2df7b4['password'];return await apiRequest(_0x2a31b2['mHyeq'],{'method':_0x2a31b2[_0x2cc5f6(0x205)],'body':JSON[_0x2cc5f6(0x1c4)](_0x3356dd)});}export async function uploadCloudProfileSession(_0x587f95,_0x770732){const _0x37b44c={'LdFCn':'POST'};return await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x587f95)+'/session',{'method':_0x37b44c['LdFCn'],'body':JSON['stringify']({'session_state':_0x770732})});}export async function saveCloudProfileCredentials(_0x40d300,_0x4b867e,_0x58e5a3){const _0x34c121=_0x236664,_0x4ab837={'GrjUJ':function(_0x43930d,_0x5504cc,_0x451fb9){return _0x43930d(_0x5504cc,_0x451fb9);}};await _0x4ab837[_0x34c121(0x1ac)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x40d300),{'method':'PUT','body':JSON['stringify']({'username':_0x4b867e,'password':_0x58e5a3})});}export async function fetchAuthConfig(){const _0x43243e=_0x236664,_0x18fa83={'PFxaJ':function(_0x591040,_0x571f6b){return _0x591040 instanceof _0x571f6b;},'SSONS':function(_0x17ee65,_0x183543){return _0x17ee65!==_0x183543;}};try{const _0x5abcac=await apiRequest(_0x43243e(0x1ad));return _0x5abcac['auth_config'];}catch(_0x3fd668){return _0x18fa83['PFxaJ'](_0x3fd668,ApiError)&&_0x18fa83['SSONS'](_0x3fd668['status'],0x194)&&console['error'](_0x43243e(0x1bf)+_0x3fd668['message']),null;}}async function createTunnelSession(_0x245777){const _0x564d2a=_0x236664,_0x5c19d7={'pGolj':_0x564d2a(0x1f0),'bQtVe':_0x564d2a(0x1c5),'MFoQi':_0x564d2a(0x1cd)};return await apiRequest(_0x5c19d7[_0x564d2a(0x217)],{'method':_0x5c19d7['bQtVe'],'body':JSON['stringify']({'targetUrl':_0x245777,'mode':_0x5c19d7[_0x564d2a(0x1f4)]})});}async function deleteTunnelSession(_0x576580){await apiRequest('/api/v1/tunnel/sessions/'+_0x576580,{'method':'DELETE'});}export function pickAdHocEnvKey(_0x54b672){const _0x3a2237=_0x236664,_0x43d451={'jmgUp':function(_0x50145e,_0x46f756){return _0x50145e===_0x46f756;},'FAzaF':function(_0x21d7a6,_0x31b099){return _0x21d7a6+_0x31b099;}};if(!_0x54b672)return null;if(_0x54b672[_0x3a2237(0x209)])return _0x54b672[_0x3a2237(0x209)];const _0x4a0e04=Object[_0x3a2237(0x234)](_0x54b672['environments']??{});if(_0x43d451['jmgUp'](_0x4a0e04[_0x3a2237(0x20d)],0x1))return _0x4a0e04[0x0];if(_0x43d451[_0x3a2237(0x1da)](_0x4a0e04['length'],0x0))return null;throw new Error(_0x43d451[_0x3a2237(0x1e2)]('Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20('+_0x4a0e04[_0x3a2237(0x199)](',\x20')+_0x3a2237(0x1d0),'Create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`\x20so\x20Ranger\x20can\x20pick\x20the\x20right\x20one.'));}export async function resolveAdHocProfile(_0x3882fb=process[_0x236664(0x213)]){const _0x434d2f=_0x236664,_0x409db5={'CrIgG':function(_0x58aca5){return _0x58aca5();},'NThex':function(_0x4fe16b,_0x10256c){return _0x4fe16b(_0x10256c);},'eifUD':function(_0x42e1d6,_0x201105,_0x596dd1,_0x578575){return _0x42e1d6(_0x201105,_0x596dd1,_0x578575);},'TofvT':function(_0x3229df,_0x6fb94c){return _0x3229df??_0x6fb94c;}},_0xac3414=_0x3882fb[_0x434d2f(0x1c8)];if(!_0xac3414)return null;const _0x44807c=await fetchCloudProfile(_0xac3414);if(_0x44807c)return{'name':_0x44807c[_0x434d2f(0x1e0)],'profile':_0x44807c};const _0x57a1f7=await _0x409db5['CrIgG'](fetchAuthConfig),_0x3a05c8=_0x409db5[_0x434d2f(0x196)](pickAdHocEnvKey,_0x57a1f7),_0x56f993=_0x3882fb['RANGER_TEST_PASSWORD'],_0x1bf282=await _0x409db5['eifUD'](createCloudProfile,_0xac3414,_0x409db5[_0x434d2f(0x237)](_0x3a05c8,undefined),{'username':_0xac3414,'password':_0x56f993});return console[_0x434d2f(0x231)](_0x434d2f(0x1b6)+_0x1bf282['name']+_0x434d2f(0x235)+_0xac3414),{'name':_0x1bf282['name'],'profile':_0x1bf282};}export async function writeSessionToLocalCache(_0x2c9cac,_0x44db48,_0x28a390,_0x5bb269,_0x58d5b4,_0x4a9412,_0x260a58){const _0x4b9d37=_0x236664,_0x2bc43b={'sygbI':function(_0x449384,_0x2a13bb,_0x206e19){return _0x449384(_0x2a13bb,_0x206e19);},'jBhAR':'auth','MTCmP':function(_0x1ebe88,_0x42047e){return _0x1ebe88(_0x42047e);}},_0x32d98f=sessionCacheHash({'orgId':_0x44db48,'profileName':_0x2c9cac,'effectiveBaseUrl':_0x28a390,'setupHeaders':_0x5bb269,'invalidateOn':_0x260a58?.[_0x4b9d37(0x226)],'userAgent':_0x260a58?.[_0x4b9d37(0x22d)],'clientIp':_0x260a58?.[_0x4b9d37(0x19f)]}),_0xedd76f=getSessionCachePath(_0x32d98f,_0x2c9cac),_0x341fe3=_0x2bc43b['sygbI'](join,getRangerHomeDir(),_0x2bc43b[_0x4b9d37(0x21c)]);!_0x2bc43b['MTCmP'](existsSync,_0x341fe3)&&await mkdir(_0x341fe3,{'recursive':!![]});const _0x89c57e={..._0x58d5b4};_0x4a9412&&_0x4a9412[_0x4b9d37(0x20d)]>0x0&&Array[_0x4b9d37(0x20f)](_0x89c57e[_0x4b9d37(0x1fc)])&&(_0x89c57e[_0x4b9d37(0x1fc)]=_0x2bc43b[_0x4b9d37(0x1d6)](duplicateCookiesForDomains,_0x89c57e['cookies'],_0x4a9412));const _0x5889e6={'cached_at':new Date()['toISOString'](),'session_state':_0x89c57e};await _0x2bc43b[_0x4b9d37(0x1d6)](writeFile,_0xedd76f,JSON['stringify'](_0x5889e6,null,0x2));const _0x26a00f=getStorageStatePath(_0xedd76f);return await _0x2bc43b[_0x4b9d37(0x1d6)](writeFile,_0x26a00f,JSON['stringify'](_0x89c57e,null,0x2)),_0x26a00f;}export async function checkLocalCache(_0x48555d,_0xdbb3a7,_0x2e1f3b,_0x527294,_0x37c0a6){const _0x26348e=_0x236664,_0x384398={'cfOCB':function(_0x27f446,_0xbaec){return _0x27f446(_0xbaec);},'SYhzi':function(_0x1c2b73,_0x425e26,_0x2e8e2c){return _0x1c2b73(_0x425e26,_0x2e8e2c);},'qSYBt':'utf-8'},_0x4dc446=sessionCacheHash({'orgId':_0xdbb3a7,'profileName':_0x48555d,'effectiveBaseUrl':_0x2e1f3b,'setupHeaders':_0x527294,'invalidateOn':_0x37c0a6?.[_0x26348e(0x226)],'userAgent':_0x37c0a6?.['userAgent'],'clientIp':_0x37c0a6?.[_0x26348e(0x19f)]}),_0x5e278b=getSessionCachePath(_0x4dc446,_0x48555d),_0x3c5cde=getStorageStatePath(_0x5e278b);if(!existsSync(_0x5e278b)||!_0x384398['cfOCB'](existsSync,_0x3c5cde))return null;try{const _0x243c45=await _0x384398['SYhzi'](readFile,_0x5e278b,_0x384398[_0x26348e(0x1ab)]);return JSON[_0x26348e(0x20e)](_0x243c45),{'storageStatePath':_0x3c5cde};}catch{return null;}}function launchRealBrowser(){return chromium['launch']({'headless':!![]});}function _0x222d(_0x6a732b,_0x10f762){_0x6a732b=_0x6a732b-0x195;const _0x55f123=_0x55f1();let _0x222d75=_0x55f123[_0x6a732b];return _0x222d75;}function emitSessionValidationHint(_0x282be8,_0x18e7a4){const _0xa4317c=_0x236664,_0x2ed338={'qIday':function(_0xbf5ee1,_0x5e8b6b){return _0xbf5ee1+_0x5e8b6b;}};if(!_0x18e7a4||!_0x18e7a4['domains']?.['length'])return;let _0x487324;try{_0x487324=new URL(_0x282be8);}catch{return;}const _0x532f3b=[];for(const _0x4fbb67 of _0x18e7a4['domains']){try{_0x532f3b[_0xa4317c(0x21d)]({'raw':_0x4fbb67,'url':new URL(_0x4fbb67)});}catch{}}if(_0x532f3b[_0xa4317c(0x20d)]===0x0)return;if(_0x532f3b[_0xa4317c(0x19e)](_0x48fc48=>_0x48fc48['url']['origin']===_0x487324[_0xa4317c(0x206)]))return;const _0x3b5fe8=_0x532f3b['map'](_0x167dad=>'\x22'+_0x167dad['raw']+'\x22')['join'](',\x20');console[_0xa4317c(0x231)](_0x2ed338['qIday'](_0x2ed338['qIday'](_0xa4317c(0x201)+_0x3b5fe8+';\x20',_0xa4317c(0x1c0)+_0x282be8+_0xa4317c(0x1a4)),_0xa4317c(0x232)));}export async function serverSideLogin(_0x4bac28,_0x41cbb9){const _0x4993bd=_0x236664,_0x44de3a={'vqGLa':function(_0x1a005f,_0x45b5a3,_0x3f4571){return _0x1a005f(_0x45b5a3,_0x3f4571);},'QtyMR':function(_0x4cf301,_0x115007){return _0x4cf301(_0x115007);},'HXJAy':function(_0x392511,_0x4805e6){return _0x392511===_0x4805e6;},'IAotA':function(_0x50897d,_0x57a1a5){return _0x50897d===_0x57a1a5;}},_0x17c82c=process['env'][_0x4993bd(0x1c8)],_0x3525ba=process[_0x4993bd(0x213)][_0x4993bd(0x1dd)],_0x25af9c={};if(_0x17c82c)_0x25af9c['username']=_0x17c82c;if(_0x3525ba)_0x25af9c['password']=_0x3525ba;if(_0x41cbb9?.[_0x4993bd(0x1bb)])_0x25af9c['force']=!![];if(_0x41cbb9?.['targetUrl'])_0x25af9c[_0x4993bd(0x1ba)]=_0x41cbb9[_0x4993bd(0x238)];_0x41cbb9?.['tunnel']&&(_0x25af9c['tunnel_session_id']=_0x41cbb9['tunnel'][_0x4993bd(0x216)],_0x25af9c[_0x4993bd(0x233)]=_0x41cbb9['tunnel'][_0x4993bd(0x1d9)]);try{return await _0x44de3a[_0x4993bd(0x219)](apiRequest,'/api/v1/profiles/'+_0x44de3a[_0x4993bd(0x1b2)](encodeURIComponent,_0x4bac28)+'/login',{'method':_0x4993bd(0x1c5),'body':JSON[_0x4993bd(0x1c4)](_0x25af9c)});}catch(_0x4d949f){if(_0x4d949f instanceof ApiError&&_0x44de3a['HXJAy'](_0x4d949f['status'],0x190)&&_0x44de3a['IAotA'](_0x4d949f[_0x4993bd(0x1ae)],_0x4993bd(0x220)))return{'status':'not_configured','error':_0x4d949f[_0x4993bd(0x195)]};throw _0x4d949f;}}async function serverSideLoginWithOptionalTunnel(_0x485a0e,_0x1bc6c0,_0x4bcd83={}){const _0x521d5a=_0x236664,_0x433fe7={'Qihji':function(_0x23a042,_0x2da4a6){return _0x23a042(_0x2da4a6);},'akQeJ':function(_0x5ac346,_0x4f8723,_0x732deb){return _0x5ac346(_0x4f8723,_0x732deb);},'YZnhu':function(_0x20bdba,_0x58b957){return _0x20bdba(_0x58b957);},'AvVjb':'tunnel_login_setup','WYQiH':function(_0xf8ddaa,_0x361922){return _0xf8ddaa(_0x361922);},'NyTOl':_0x521d5a(0x1c2),'yIOJF':function(_0x2e1730,_0x5ade13){return _0x2e1730??_0x5ade13;},'VWNVV':function(_0x4ac3b8,_0x326b30){return _0x4ac3b8||_0x326b30;},'denSA':'tunnel_login_cleanup'};if(!needsTunnel(_0x1bc6c0))return await _0x433fe7[_0x521d5a(0x1b7)](serverSideLogin,_0x485a0e,{'force':_0x4bcd83[_0x521d5a(0x1bb)]});let _0x482bb4=null,_0x54cf8e=null,_0x550a28=null,_0x23c319=null,_0x268765=![];const _0x274f79={'profileName':_0x485a0e,'targetUrlHost':_0x433fe7[_0x521d5a(0x208)](targetHostForTelemetry,_0x1bc6c0),'tunnelRequired':!![],'forceLogin':_0x433fe7['YZnhu'](Boolean,_0x4bcd83['force'])};try{_0x4bcd83['telemetry']?.[_0x521d5a(0x197)](_0x433fe7[_0x521d5a(0x1d1)],_0x274f79),_0x482bb4=await launchBrowserServer({'headless':!![]}),_0x54cf8e=await _0x433fe7['WYQiH'](createTunnelSession,_0x1bc6c0);const _0x3becf8=await requireToken();_0x550a28=await createTunnelBridge({'localWsUrl':_0x482bb4[_0x521d5a(0x1bd)],'tunnelServerUrl':_0x54cf8e['tunnelUrl'],'sessionId':_0x54cf8e['sessionId'],'apiKey':_0x3becf8,'onError':_0x1767d3=>{_0x23c319=_0x1767d3;},'onClose':()=>{const _0x45e23b=_0x521d5a;_0x23c319??=new Error(_0x45e23b(0x228)+_0x485a0e);},'onEvent':_0x2684f9=>trackBridgeEvent(_0x4bcd83['telemetry'],_0x2684f9)}),_0x4bcd83[_0x521d5a(0x1fe)]?.[_0x521d5a(0x1a1)](_0x433fe7[_0x521d5a(0x1d1)],{..._0x274f79,'tunnelSessionId':_0x54cf8e[_0x521d5a(0x216)],'localBrowserServer':!![]}),_0x268765=!![];try{return _0x4bcd83[_0x521d5a(0x1fe)]?.['trackPhaseStart'](_0x433fe7['NyTOl'],{..._0x274f79,'tunnelSessionId':_0x54cf8e[_0x521d5a(0x216)]}),await _0x433fe7['akQeJ'](serverSideLogin,_0x485a0e,{'force':_0x4bcd83['force'],'targetUrl':_0x1bc6c0,'tunnel':{'sessionId':_0x54cf8e[_0x521d5a(0x216)],'pwEndpoint':_0x54cf8e['pwEndpoint']}})['then'](_0xe4b9f1=>{const _0x47a461=_0x521d5a;return _0x4bcd83['telemetry']?.[_0x47a461(0x1a1)]('tunnel_login_request',{..._0x274f79,'tunnelSessionId':_0x54cf8e?.['sessionId'],'loginStatus':_0xe4b9f1[_0x47a461(0x1e5)],'hasSessionState':Boolean(_0xe4b9f1['session_state']),'hasTestOutput':_0x433fe7[_0x47a461(0x1f8)](Boolean,_0xe4b9f1[_0x47a461(0x1bc)]),'bridgeError':_0x433fe7['Qihji'](errorMessageForTelemetry,_0x23c319)}),_0xe4b9f1;});}catch(_0x12820b){await _0x4bcd83['telemetry']?.[_0x521d5a(0x1b9)](_0x433fe7['NyTOl'],_0x23c319??_0x12820b,{..._0x274f79,'tunnelSessionId':_0x54cf8e[_0x521d5a(0x216)],'bridgeError':errorMessageForTelemetry(_0x23c319)});throw _0x433fe7['yIOJF'](_0x23c319,_0x12820b);}}catch(_0x5e6600){!_0x268765&&await _0x4bcd83[_0x521d5a(0x1fe)]?.[_0x521d5a(0x1b9)](_0x521d5a(0x1a5),_0x5e6600,{..._0x274f79,'tunnelSessionId':_0x54cf8e?.['sessionId']});throw _0x5e6600;}finally{(_0x433fe7[_0x521d5a(0x1cb)](_0x54cf8e,_0x482bb4)||_0x550a28)&&(_0x4bcd83['telemetry']?.['trackPhaseStart']('tunnel_login_cleanup',{..._0x274f79,'tunnelSessionId':_0x54cf8e?.[_0x521d5a(0x216)]}),_0x550a28?.['close'](),_0x482bb4&&await _0x482bb4['close']()['catch'](()=>{}),_0x54cf8e&&await _0x433fe7[_0x521d5a(0x1af)](deleteTunnelSession,_0x54cf8e['sessionId'])[_0x521d5a(0x1a2)](()=>{}),_0x4bcd83[_0x521d5a(0x1fe)]?.['trackPhaseEnd'](_0x433fe7['denSA'],{..._0x274f79,'tunnelSessionId':_0x54cf8e?.['sessionId']}));}}export async function manualBrowserLogin(_0x980c8a,_0x5363d6,_0x1ade7d={}){const _0x464533=_0x236664,_0x49abe0={'tVasL':function(_0x51c005){return _0x51c005();},'yzGia':_0x464533(0x22b),'CjNdD':_0x464533(0x19d),'gCmfA':'about:blank','sfnQv':'\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','SZnVA':_0x464533(0x1f5),'ffHRA':_0x464533(0x215),'kmrWs':function(_0x471460,_0x4e8293){return _0x471460!==_0x4e8293;},'mNYtx':function(_0x3414ca,_0x5eac09){return _0x3414ca(_0x5eac09);},'UlaUr':_0x464533(0x1c1)};if(!_0x49abe0['tVasL'](isInteractive))throw new Error('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0x980c8a[_0x464533(0x1e0)]+_0x464533(0x1be)+_0x49abe0[_0x464533(0x1ed)]+'or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.');const _0x34192c=_0x5363d6&&_0x5363d6['domains'][_0x464533(0x20d)]>0x0?_0x5363d6['domains'][0x0]:_0x49abe0[_0x464533(0x223)];console[_0x464533(0x231)](_0x49abe0['sfnQv']),console['log'](_0x49abe0['SZnVA']),await new Promise(_0x37dcea=>setTimeout(_0x37dcea,0x7d0));const _0x1a3ede=await chromium['launch']({'headless':![]});let _0x1180b9=null;try{const _0x172dfd={'ignoreHTTPSErrors':!![]};_0x5363d6?.['setupHeaders']&&(_0x172dfd['extraHTTPHeaders']=_0x5363d6['setupHeaders']);const _0x2c3eda=await _0x1a3ede['newContext'](_0x172dfd);await addProfileSetupBanner(_0x2c3eda);const _0x46b898=await _0x2c3eda[_0x464533(0x1f3)]();await _0x46b898[_0x464533(0x1c7)](_0x34192c);let _0x52fdca=![];await new Promise(_0x3e3c07=>{const _0x3cc105=_0x464533,_0x565ea6=setTimeout(()=>{const _0x1d9eaf=_0x222d;_0x52fdca=!![],console['error'](_0x1d9eaf(0x1e1)+MANUAL_LOGIN_TIMEOUT_MS/0xea60+'\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.'),_0x49abe0[_0x1d9eaf(0x1e9)](_0x3e3c07);},MANUAL_LOGIN_TIMEOUT_MS);_0x46b898['on'](_0x49abe0[_0x3cc105(0x1eb)],async()=>{clearTimeout(_0x565ea6);try{const _0x1c8dd8=await _0x2c3eda['storageState']();_0x1180b9=_0x1c8dd8;}catch{}_0x3e3c07();});});if(_0x52fdca&&!_0x1180b9)throw new Error(_0x464533(0x1ea));}finally{await _0x1a3ede['close']()['catch'](()=>{});}if(!_0x1180b9)throw new Error(_0x49abe0[_0x464533(0x1f6)]);return _0x49abe0['kmrWs'](_0x1ade7d['persistSessionState'],![])&&await apiRequest(_0x464533(0x1d4)+_0x49abe0[_0x464533(0x1ee)](encodeURIComponent,_0x980c8a[_0x464533(0x1e0)])+'/session',{'method':_0x464533(0x1c5),'body':JSON['stringify']({'session_state':_0x1180b9,'updated_by':_0x49abe0[_0x464533(0x1ff)]})}),{'sessionState':_0x1180b9};}export async function promptSaveCredentials(_0x33962b){const _0x55ad4e=_0x236664,_0x4b39ba={'foAXB':_0x55ad4e(0x224),'dcqTv':_0x55ad4e(0x19b),'BDaPX':function(_0x2055e1,_0x2431b0){return _0x2055e1(_0x2431b0);},'mtDXe':'PUT','XEUQS':_0x55ad4e(0x1e7)},_0x16d293=process[_0x55ad4e(0x213)]['RANGER_TEST_USERNAME'],_0x1fe6db=process[_0x55ad4e(0x213)]['RANGER_TEST_PASSWORD'];if(!_0x16d293||!_0x1fe6db)return;if(!isInteractive())return;const {save:_0x12b93d}=await _0x2278a3[_0x55ad4e(0x21b)]([{'type':_0x4b39ba[_0x55ad4e(0x1ca)],'name':_0x4b39ba[_0x55ad4e(0x22c)],'message':_0x55ad4e(0x1f9),'default':![]}]);if(!_0x12b93d)return;await apiRequest('/api/v1/profiles/'+_0x4b39ba['BDaPX'](encodeURIComponent,_0x33962b),{'method':_0x4b39ba['mtDXe'],'body':JSON['stringify']({'username':_0x16d293,'password':_0x1fe6db})}),console[_0x55ad4e(0x231)](_0x4b39ba['XEUQS']);}export async function resolveCloudProfileSession(_0x2ce6a,_0xf32924={}){const _0x38deac=_0x236664,_0x3f4be8={'QOKpP':function(_0x5ca37e){return _0x5ca37e();},'Oypno':function(_0x4bd7ed,_0x4d47c4){return _0x4bd7ed||_0x4d47c4;},'TAyDK':function(_0x53f424,_0x46f401){return _0x53f424(_0x46f401);},'WWSOk':function(_0x58f6fd,_0x80fe04){return _0x58f6fd(_0x80fe04);},'xBvQs':function(_0x4e21ee,_0x36458a){return _0x4e21ee>_0x36458a;},'bopfs':function(_0x26d7f1,_0x51ef14){return _0x26d7f1&&_0x51ef14;},'nqXcH':function(_0x1d1f17,_0x3124a0,_0x475dbc,_0x11791f,_0x9d994d,_0x2f58bd,_0x47f0a6,_0x14d3f5){return _0x1d1f17(_0x3124a0,_0x475dbc,_0x11791f,_0x9d994d,_0x2f58bd,_0x47f0a6,_0x14d3f5);},'wBpjM':function(_0x4c32be,_0x546420,_0x3c68ef,_0xc1d167,_0x6161bf){return _0x4c32be(_0x546420,_0x3c68ef,_0xc1d167,_0x6161bf);},'yKMQn':function(_0x2c5276,_0x2f3a65){return _0x2c5276(_0x2f3a65);},'bnVHl':function(_0x30ab3f,_0xeef8e9){return _0x30ab3f===_0xeef8e9;},'YfqHP':_0x38deac(0x220),'fDNdA':_0x38deac(0x1e8),'seeDZ':_0x38deac(0x1b0),'JSDSM':function(_0x41871c,_0x27d37e,_0x35a3cc,_0x3edaee,_0x22288b,_0x52ba15,_0x2475fd,_0x1d4c16){return _0x41871c(_0x27d37e,_0x35a3cc,_0x3edaee,_0x22288b,_0x52ba15,_0x2475fd,_0x1d4c16);},'fxtwq':function(_0x4d620c,_0x43916d){return _0x4d620c(_0x43916d);},'wdMyy':function(_0x430926,_0x5f0af9,_0x3b0fb2,_0x1a6219){return _0x430926(_0x5f0af9,_0x3b0fb2,_0x1a6219);},'QTiIO':function(_0x1c6e35,_0x37697f,_0x35a30d,_0x270a93,_0x5ec0d3,_0x497072,_0x566ff2,_0xa534df){return _0x1c6e35(_0x37697f,_0x35a30d,_0x270a93,_0x5ec0d3,_0x497072,_0x566ff2,_0xa534df);}},_0x5875b5=_0x2ce6a[_0x38deac(0x1ec)]??{},_0x2cda4b=await _0x3f4be8[_0x38deac(0x1f2)](fetchAuthConfig),_0x1412ef=_0x2cda4b?resolveAuthEnvironmentLocally(_0x2cda4b,_0x2ce6a[_0x38deac(0x1a8)]):null,_0x421b23=typeof _0x1412ef?.['loginInstructions']==='string'&&_0x1412ef['loginInstructions'][_0x38deac(0x1cc)]()?_0x1412ef['loginInstructions']:undefined,_0x11b801=typeof _0x5875b5[_0x38deac(0x239)]===_0x38deac(0x1e4)&&_0x5875b5[_0x38deac(0x239)]['trim']()?_0x5875b5[_0x38deac(0x239)]:undefined,_0x27fa33=_0x3f4be8['Oypno'](_0x11b801,!_0x421b23)?_0x5875b5:{..._0x5875b5,'loginInstructions':_0x421b23},_0x24ea57=_0x3f4be8[_0x38deac(0x1c6)](Boolean,_0x27fa33['loginInstructions']?.['trim']()),_0x3d4f4f=_0x3f4be8[_0x38deac(0x1df)](Boolean,_0x5875b5[_0x38deac(0x1f7)]||_0x1412ef?.['forceLogin']),_0x12fe8d=_0x1412ef?.[_0x38deac(0x23a)],_0x5e10b9=_0x5875b5['setupHeaders'],_0x181e45=_0x5e10b9??_0x1412ef?.['setupHeaders'],_0x96a4eb=_0xf32924[_0x38deac(0x1d7)]??_0x5875b5['baseUrl']??(_0x12fe8d&&_0x3f4be8[_0x38deac(0x225)](_0x12fe8d['length'],0x0)?_0x12fe8d[0x0]:''),_0x19f827=_0x96a4eb?needsTunnel(_0x96a4eb):![],_0x3ac559={'invalidateOn':_0x1412ef?.['invalidateOn'],'userAgent':_0x1412ef?.['browserOptions']?.[_0x38deac(0x22d)]??_0x5875b5[_0x38deac(0x22d)]};_0x3d4f4f&&console['log'](_0x38deac(0x21f)+_0x2ce6a[_0x38deac(0x1e0)]+_0x38deac(0x212));if(!_0x3d4f4f){const _0x27d765=await checkLocalCache(_0x2ce6a['name'],_0x2ce6a['organizationId'],_0x96a4eb,_0x181e45,_0x3ac559);if(_0x27d765){if(_0x3f4be8['bopfs'](_0x96a4eb,!_0x19f827)){const _0x5f1daa=await isCachedSessionLive(_0x27d765['storageStatePath'],_0x96a4eb,{'sessionCheckPath':_0x1412ef?.['sessionCheckPath'],'setupHeaders':_0x181e45},{'launchBrowser':launchRealBrowser});if(_0x5f1daa)return console['log']('\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22'+_0x2ce6a['name']+'\x22'),{'authPath':_0x27d765[_0x38deac(0x1d2)],'settings':_0x27fa33,'resolvedEnv':_0x1412ef};console[_0x38deac(0x231)]('\x20\x20Cached\x20session\x20for\x20\x22'+_0x2ce6a[_0x38deac(0x1e0)]+_0x38deac(0x1c9)),emitSessionValidationHint(_0x96a4eb,_0x1412ef);}else return _0x19f827&&console['log'](_0x38deac(0x21e)+_0x2ce6a['name']+'\x22'),{'authPath':_0x27d765['storageStatePath'],'settings':_0x27fa33,'resolvedEnv':_0x1412ef};}}if(!_0x3d4f4f&&_0x2ce6a[_0x38deac(0x1a9)]){if(_0x19f827)console[_0x38deac(0x231)](_0x38deac(0x203)+_0x96a4eb+'\x22\x20on\x20profile\x20\x22'+_0x2ce6a[_0x38deac(0x1e0)]+'\x22');else{const _0x1edbf9=await _0x3f4be8['nqXcH'](writeSessionToLocalCache,_0x2ce6a['name'],_0x2ce6a['organizationId'],_0x96a4eb,_0x181e45,_0x2ce6a[_0x38deac(0x1a9)],_0x12fe8d,_0x3ac559);if(_0x96a4eb){const _0x538ed8=await _0x3f4be8['wBpjM'](isCachedSessionLive,_0x1edbf9,_0x96a4eb,{'sessionCheckPath':_0x1412ef?.['sessionCheckPath'],'setupHeaders':_0x181e45},{'launchBrowser':launchRealBrowser});if(_0x538ed8)return console[_0x38deac(0x231)](_0x38deac(0x1fa)+_0x2ce6a[_0x38deac(0x1e0)]+_0x38deac(0x214)),{'authPath':_0x1edbf9,'settings':_0x27fa33,'resolvedEnv':_0x1412ef};console['log'](_0x38deac(0x207)+_0x2ce6a['name']+'\x22\x20failed\x20validation\x20—\x20re-login\x20needed...'),emitSessionValidationHint(_0x96a4eb,_0x1412ef);}else return{'authPath':_0x1edbf9,'settings':_0x27fa33,'resolvedEnv':_0x1412ef};}}if(_0x24ea57)return console['log']('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x2ce6a[_0x38deac(0x1e0)]+_0x38deac(0x20a)),{'authPath':undefined,'settings':_0x27fa33,'resolvedEnv':_0x1412ef};console[_0x38deac(0x231)]('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x2ce6a['name']+'\x22,\x20attempting\x20login...');const _0x20b2f1=_0x3f4be8[_0x38deac(0x1ce)](Boolean,process[_0x38deac(0x213)][_0x38deac(0x1c8)])&&Boolean(process['env']['RANGER_TEST_PASSWORD']),_0x71d3b7=Boolean(_0x2ce6a[_0x38deac(0x1b1)]);if(_0x20b2f1||_0x71d3b7)try{const _0x25b24d=_0x96a4eb?await serverSideLoginWithOptionalTunnel(_0x2ce6a[_0x38deac(0x1e0)],_0x96a4eb,{'force':_0x3d4f4f,'telemetry':_0xf32924['telemetry']}):await serverSideLogin(_0x2ce6a['name'],{'force':_0x3d4f4f});if(_0x3f4be8[_0x38deac(0x1dc)](_0x25b24d[_0x38deac(0x1e5)],_0x3f4be8[_0x38deac(0x211)]))console[_0x38deac(0x231)]('\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...');else{if(_0x25b24d['status']===_0x3f4be8['fDNdA']&&_0x25b24d[_0x38deac(0x1d8)]){console['log'](_0x3f4be8[_0x38deac(0x236)]);const _0xfff765=await _0x3f4be8['JSDSM'](writeSessionToLocalCache,_0x2ce6a[_0x38deac(0x1e0)],_0x2ce6a[_0x38deac(0x200)],_0x96a4eb,_0x181e45,_0x25b24d[_0x38deac(0x1d8)],_0x12fe8d,_0x3ac559);return _0x3f4be8['bopfs'](_0x20b2f1,!_0x71d3b7)&&await _0x3f4be8['fxtwq'](promptSaveCredentials,_0x2ce6a['name']),{'authPath':_0xfff765,'settings':_0x27fa33,'resolvedEnv':_0x1412ef};}else _0x25b24d['test_output']&&(console['log']('\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:'),console[_0x38deac(0x231)](_0x25b24d['test_output'])),console[_0x38deac(0x231)](_0x38deac(0x221));}}catch(_0x54883d){console['log'](_0x38deac(0x1aa)+(_0x54883d instanceof Error?_0x54883d[_0x38deac(0x1a7)]:String(_0x54883d))),console[_0x38deac(0x231)](_0x38deac(0x221));}const _0x916d26=_0x1412ef?{..._0x1412ef,'setupHeaders':_0x181e45}:_0x96a4eb?{'key':_0x2ce6a[_0x38deac(0x1a8)]??'','domains':[_0x96a4eb],'setupHeaders':_0x181e45}:null,{sessionState:_0x29b074}=await _0x3f4be8['wdMyy'](manualBrowserLogin,_0x2ce6a,_0x916d26,{'persistSessionState':!_0x19f827}),_0xd4645d=await _0x3f4be8['QTiIO'](writeSessionToLocalCache,_0x2ce6a['name'],_0x2ce6a[_0x38deac(0x200)],_0x96a4eb,_0x181e45,_0x29b074,_0x12fe8d,_0x3ac559);return{'authPath':_0xd4645d,'settings':_0x27fa33,'resolvedEnv':_0x1412ef};}
1
+ (function(_0x73f870,_0x3f4311){const _0x3c5b23=_0x359e,_0x48fa94=_0x73f870();while(!![]){try{const _0x16ee63=-parseInt(_0x3c5b23(0xb0))/0x1+parseInt(_0x3c5b23(0xd5))/0x2+-parseInt(_0x3c5b23(0xba))/0x3*(parseInt(_0x3c5b23(0xdb))/0x4)+parseInt(_0x3c5b23(0x8b))/0x5+-parseInt(_0x3c5b23(0xdd))/0x6*(-parseInt(_0x3c5b23(0xd8))/0x7)+parseInt(_0x3c5b23(0xc8))/0x8+parseInt(_0x3c5b23(0x75))/0x9*(-parseInt(_0x3c5b23(0x88))/0xa);if(_0x16ee63===_0x3f4311)break;else _0x48fa94['push'](_0x48fa94['shift']());}catch(_0x1a6d63){_0x48fa94['push'](_0x48fa94['shift']());}}}(_0x46c2,0x795bf));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x1a69e1 from'inquirer';function _0x359e(_0x29d34e,_0x3e95f3){_0x29d34e=_0x29d34e-0x6c;const _0x46c265=_0x46c2();let _0x359ee5=_0x46c265[_0x29d34e];return _0x359ee5;}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,isCachedSessionLive,isInteractive,needsTunnel,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';import{createTunnelBridge,launchBrowserServer}from'./tunnelClient.js';function targetHostForTelemetry(_0x382862){const _0x351a09=_0x359e;try{return new URL(_0x382862)['host'];}catch{return _0x351a09(0xbf);}}function errorMessageForTelemetry(_0x23a3af){const _0x1ac2ee=_0x359e,_0x1c2f76={'cnZje':function(_0xe3f0e1,_0x4aebf1){return _0xe3f0e1 instanceof _0x4aebf1;}};return _0x1c2f76[_0x1ac2ee(0xd3)](_0x23a3af,Error)?_0x23a3af['message']:undefined;}function trackBridgeEvent(_0xbe1402,_0x374204){const _0x5dd73d=_0x359e,_0x2e91e3={'QofAa':_0x5dd73d(0xf7),'RqpFb':function(_0x10d798,_0x464eb5){return _0x10d798===_0x464eb5;},'Wsznc':_0x5dd73d(0x9d)};if(!_0xbe1402)return;const _0x446c38={'tunnelSessionId':_0x374204['sessionId'],'tunnelEventType':_0x374204[_0x5dd73d(0xa6)],'connectionId':_0x374204['connectionId'],'code':_0x374204['code'],'reason':_0x374204['reason'],'error':_0x374204['error'],'elapsedMs':_0x374204[_0x5dd73d(0xcd)],'activeLocalConnections':_0x374204['activeLocalConnections'],'pendingLocalConnections':_0x374204[_0x5dd73d(0x96)]};_0xbe1402[_0x5dd73d(0x89)]('tunnel_bridge_event',_0x446c38),(_0x374204['type']===_0x2e91e3['QofAa']||_0x2e91e3['RqpFb'](_0x374204['type'],_0x5dd73d(0x93)))&&void _0xbe1402[_0x5dd73d(0xf6)](_0x2e91e3['Wsznc'],new Error(_0x374204['error']??_0x374204['type']),_0x446c38);}const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0xcfbf4b=_0x359e,_0x4f48f1={'wrnul':function(_0x5dcecb){return _0x5dcecb();}},_0x55d518=await _0x4f48f1[_0xcfbf4b(0xe5)](getToken);if(!_0x55d518)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');return _0x55d518;}async function apiRequest(_0x463313,_0x4c4d02={}){const _0x4d9e71=_0x359e,_0x1c7937={'VmGHN':function(_0x42bd55){return _0x42bd55();},'FfbLU':function(_0x5c9612,_0x17a29a){return _0x5c9612===_0x17a29a;},'oPEIy':_0x4d9e71(0xb1)},_0x524366=await _0x1c7937[_0x4d9e71(0xb7)](requireToken),_0xbf8d32=getApiBaseUrl(),_0x25d8b7=await fetch(''+_0xbf8d32+_0x463313,{..._0x4c4d02,'headers':{'Authorization':_0x4d9e71(0x8e)+_0x524366,'Content-Type':'application/json',..._0x4c4d02['headers']??{}}});if(!_0x25d8b7['ok']){let _0x39c644='',_0x40035b;try{const _0x246d48=await _0x25d8b7['json']();_0x39c644=(_0x1c7937[_0x4d9e71(0xf0)](typeof _0x246d48['error'],'string')?_0x246d48[_0x4d9e71(0xc3)]:undefined)??JSON[_0x4d9e71(0xbe)](_0x246d48);if(typeof _0x246d48['code']===_0x1c7937['oPEIy'])_0x40035b=_0x246d48[_0x4d9e71(0x70)];}catch{_0x39c644=_0x25d8b7['statusText'];}throw new ApiError('API\x20request\x20'+_0x463313+'\x20failed\x20('+_0x25d8b7['status']+_0x4d9e71(0xfc)+_0x39c644,_0x25d8b7['status'],_0x39c644,_0x40035b);}if(_0x25d8b7[_0x4d9e71(0x8a)]===0xcc)return undefined;return _0x25d8b7['json']();}export class ApiError extends Error{['status'];['detail'];['code'];constructor(_0x180ee7,_0x229556,_0x326b6f,_0x245f5c){const _0x4cc270=_0x359e,_0x1128b8='2|1|0|3|4'[_0x4cc270(0x84)]('|');let _0x33c561=0x0;while(!![]){switch(_0x1128b8[_0x33c561++]){case'0':this[_0x4cc270(0xa0)]=_0x326b6f;continue;case'1':this['status']=_0x229556;continue;case'2':super(_0x180ee7);continue;case'3':this['code']=_0x245f5c;continue;case'4':this['name']='ApiError';continue;}break;}}}export async function fetchCloudProfile(_0x4c9add){const _0x31105e=_0x359e;try{return await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x4c9add));}catch(_0xa57594){if(_0xa57594 instanceof ApiError&&_0xa57594[_0x31105e(0x8a)]===0x194)return null;throw _0xa57594;}}export async function listCloudProfiles(){const _0x2972e4=_0x359e,_0x5ab2e8={'AwdbE':function(_0x29d135,_0x13c41d){return _0x29d135(_0x13c41d);}},_0x5ec9ae=await _0x5ab2e8[_0x2972e4(0x7a)](apiRequest,'/api/v1/profiles');return _0x5ec9ae['profiles'];}export async function deleteCloudProfile(_0x419207){const _0x4bb39f=_0x359e,_0x1b6715={'WMSBq':function(_0x1753e1,_0x25ff65){return _0x1753e1(_0x25ff65);},'pvZof':_0x4bb39f(0x85)};try{await apiRequest('/api/v1/profiles/'+_0x1b6715['WMSBq'](encodeURIComponent,_0x419207),{'method':_0x1b6715['pvZof']});}catch(_0x50626e){if(_0x50626e instanceof ApiError&&_0x50626e[_0x4bb39f(0x8a)]===0x194)throw new Error('Cloud\x20profile\x20\x22'+_0x419207+_0x4bb39f(0xf9));throw _0x50626e;}}function _0x46c2(){const _0x227ce6=['target_url','mycsM','local_ws_error','\x20\x20Cached\x20session\x20for\x20\x22','toISOString','pendingLocalConnections','auth_config','aReJL','close','WkDVZ','name','log','tunnel_bridge','then','env','detail','domains','targetUrl','/api/v1/profiles/','\x20\x20Skipping\x20cloud\x20session\x20for\x20local\x20target\x20\x22','success','type','sessionId','prompt','join','organizationId','qayYO','UznxG','gpcBO','rNJXY','telemetry','69581NHqrJK','string','rsscw','username','pwEndpoint','LWtbt','cli:manual-login','VmGHN','extraHTTPHeaders','vsoTE','58413DWkDyG','cookies','tunnel_login_setup','\x22;\x20proceeding\x20with\x20loginInstructions.','stringify','invalid-url','\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','trim','uhdse','error','\x22\x20failed\x20validation\x20—\x20refreshing...','or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.','loginInstructions','aJdkD','2231312hdtvyX','\x20\x20Cloud\x20session\x20for\x20\x22','url','message','auth','elapsedMs','BVtXr','about:blank','\x20\x20No\x20live\x20session\x20for\x20\x22','catch','map','cnZje','Create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`\x20so\x20Ranger\x20can\x20pick\x20the\x20right\x20one.','941626euIKCW','\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20','tunnel_login_request','7sLxfgE','LHwnO','RANGER_TEST_USERNAME','52GYnqwZ','save','570012NbndqW','test_output','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','sessionCheckPath','XJPSl','ReNQt','VSBbB','length','wrnul','session_state','BVLiO','defaultEnvironmentKey','zcLOx','storageState','trackPhaseStart','Browser\x20login\x20timed\x20out\x20before\x20completion.','environment_key','baseUrl','wJQwh','FfbLU','force','launch','\x22,\x20attempting\x20login...','TcQOW','goto','trackPhaseError','tunnel_error','tSZgs','\x22\x20not\x20found.','xxhNP','storageStatePath','):\x20','tIkDZ',').\x20','IYwOJ','/api/v1/profiles/auth-config','tunnelUrl','xJltv','/api/v1/profiles','keys','code','tunnel','jxpZE','browserOptions','settings','259137cpLuht','userAgent','utf-8','some','password','AwdbE','GxRyV','skTRC','rlDTW','clientIp','PUT','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','vQcrv','setupHeaders','environments','split','DELETE','\x22\x20for\x20','RwoqB','270xYLBvx','trackPhaseEnd','status','3762365QTAhze','origin','isArray','Bearer\x20','agent','POST'];_0x46c2=function(){return _0x227ce6;};return _0x46c2();}export async function createCloudProfile(_0x598ba6,_0xd2ce9a,_0x2eca93={}){const _0x5582d6=_0x359e,_0x718f={'VAuxC':function(_0x4f3d08,_0xcb624c){return _0x4f3d08>_0xcb624c;},'nsEnQ':_0x5582d6(0x6e)},_0x5d7cc4={'name':_0x598ba6};if(_0xd2ce9a)_0x5d7cc4[_0x5582d6(0xed)]=_0xd2ce9a;_0x2eca93['settings']&&_0x718f['VAuxC'](Object[_0x5582d6(0x6f)](_0x2eca93['settings'])[_0x5582d6(0xe4)],0x0)&&(_0x5d7cc4[_0x5582d6(0x74)]=_0x2eca93[_0x5582d6(0x74)]);if(_0x2eca93['username'])_0x5d7cc4[_0x5582d6(0xb3)]=_0x2eca93['username'];if(_0x2eca93['password'])_0x5d7cc4['password']=_0x2eca93['password'];return await apiRequest(_0x718f['nsEnQ'],{'method':'POST','body':JSON['stringify'](_0x5d7cc4)});}export async function uploadCloudProfileSession(_0x4f5d7d,_0x1157dd){const _0x45d679=_0x359e,_0x3a2ca2={'XiYut':function(_0x579b75,_0x58e45c,_0x55c43c){return _0x579b75(_0x58e45c,_0x55c43c);},'BHCFC':function(_0x25338f,_0x55bbc4){return _0x25338f(_0x55bbc4);},'TCpjR':'POST'};return await _0x3a2ca2['XiYut'](apiRequest,_0x45d679(0xa3)+_0x3a2ca2['BHCFC'](encodeURIComponent,_0x4f5d7d)+'/session',{'method':_0x3a2ca2['TCpjR'],'body':JSON[_0x45d679(0xbe)]({'session_state':_0x1157dd})});}export async function saveCloudProfileCredentials(_0x73b1a5,_0x4a8b4b,_0x38249d){const _0x369e86=_0x359e,_0x3796a5={'puiAn':function(_0x797e7b,_0x3a2f2d,_0x498ff0){return _0x797e7b(_0x3a2f2d,_0x498ff0);}};await _0x3796a5['puiAn'](apiRequest,_0x369e86(0xa3)+encodeURIComponent(_0x73b1a5),{'method':'PUT','body':JSON[_0x369e86(0xbe)]({'username':_0x4a8b4b,'password':_0x38249d})});}export async function fetchAuthConfig(){const _0x2d64af=_0x359e,_0x313211={'tIkDZ':function(_0x597164,_0x3123d9){return _0x597164(_0x3123d9);},'cKnCc':_0x2d64af(0x100)};try{const _0x107c32=await _0x313211[_0x2d64af(0xfd)](apiRequest,_0x313211['cKnCc']);return _0x107c32[_0x2d64af(0x97)];}catch(_0x572b6b){return _0x572b6b instanceof ApiError&&_0x572b6b['status']!==0x194&&console[_0x2d64af(0xc3)]('\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20'+_0x572b6b[_0x2d64af(0xcb)]),null;}}async function createTunnelSession(_0x5c5315){const _0xc6751f=_0x359e,_0x4da567={'uhdse':function(_0x5259de,_0x26c9e6,_0x142483){return _0x5259de(_0x26c9e6,_0x142483);}};return await _0x4da567[_0xc6751f(0xc2)](apiRequest,'/api/v1/tunnel/sessions',{'method':'POST','body':JSON['stringify']({'targetUrl':_0x5c5315,'mode':_0xc6751f(0x8f)})});}async function deleteTunnelSession(_0x1692f5){const _0x1b4528=_0x359e,_0x2b2238={'TcQOW':function(_0x26c3b0,_0x48b04c,_0x59905f){return _0x26c3b0(_0x48b04c,_0x59905f);}};await _0x2b2238[_0x1b4528(0xf4)](apiRequest,'/api/v1/tunnel/sessions/'+_0x1692f5,{'method':'DELETE'});}export function pickAdHocEnvKey(_0x1cc288){const _0x196693=_0x359e,_0x52b057={'xJltv':function(_0x5c2ea7,_0x338a84){return _0x5c2ea7===_0x338a84;},'WkfoG':function(_0x226f69,_0x2cb17e){return _0x226f69+_0x2cb17e;}};if(!_0x1cc288)return null;if(_0x1cc288[_0x196693(0xe8)])return _0x1cc288[_0x196693(0xe8)];const _0xce473=Object[_0x196693(0x6f)](_0x1cc288[_0x196693(0x83)]??{});if(_0x52b057[_0x196693(0x6d)](_0xce473['length'],0x1))return _0xce473[0x0];if(_0xce473[_0x196693(0xe4)]===0x0)return null;throw new Error(_0x52b057['WkfoG']('Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20('+_0xce473[_0x196693(0xa9)](',\x20')+_0x196693(0xfe),_0x196693(0xd4)));}export async function resolveAdHocProfile(_0x29f740=process['env']){const _0x3967d5=_0x359e,_0x12afaf={'bVBAW':function(_0x3cdd20){return _0x3cdd20();},'iGdus':function(_0x2a791f,_0x6e3871,_0x2479f8,_0x4a455b){return _0x2a791f(_0x6e3871,_0x2479f8,_0x4a455b);},'ReNQt':function(_0x18f039,_0x2b1021){return _0x18f039??_0x2b1021;}},_0x28b062=_0x29f740['RANGER_TEST_USERNAME'];if(!_0x28b062)return null;const _0x143081=await fetchCloudProfile(_0x28b062);if(_0x143081)return{'name':_0x143081['name'],'profile':_0x143081};const _0x566cea=await _0x12afaf['bVBAW'](fetchAuthConfig),_0x285d36=pickAdHocEnvKey(_0x566cea),_0xa69a5c=_0x29f740['RANGER_TEST_PASSWORD'],_0x6964d3=await _0x12afaf['iGdus'](createCloudProfile,_0x28b062,_0x12afaf[_0x3967d5(0xe2)](_0x285d36,undefined),{'username':_0x28b062,'password':_0xa69a5c});return console['log']('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x6964d3[_0x3967d5(0x9b)]+_0x3967d5(0x86)+_0x28b062),{'name':_0x6964d3['name'],'profile':_0x6964d3};}export async function writeSessionToLocalCache(_0x5bc57e,_0x1a8390,_0x3fca31,_0x31cd1c,_0x5f0779,_0x5a4508,_0x2f3029){const _0x4819ad=_0x359e,_0x20f835={'xxhNP':function(_0x4542fa,_0xa35365){return _0x4542fa(_0xa35365);},'wJQwh':function(_0x5b5b9d,_0x5f2444,_0x543936){return _0x5b5b9d(_0x5f2444,_0x543936);},'RQsgq':function(_0x4a01fd){return _0x4a01fd();},'PFqFi':_0x4819ad(0xcc),'vQcrv':function(_0x1037c3,_0x154ac1){return _0x1037c3>_0x154ac1;},'VSBbB':function(_0x19ba21,_0x5e3f45,_0x4a65f4){return _0x19ba21(_0x5e3f45,_0x4a65f4);},'KfLuq':function(_0x5512c8,_0x170103){return _0x5512c8(_0x170103);},'zxBVL':function(_0x411a32,_0x2486ad,_0x520b5f){return _0x411a32(_0x2486ad,_0x520b5f);}},_0x1b56c7=_0x20f835[_0x4819ad(0xfa)](sessionCacheHash,{'orgId':_0x1a8390,'profileName':_0x5bc57e,'effectiveBaseUrl':_0x3fca31,'setupHeaders':_0x31cd1c,'invalidateOn':_0x2f3029?.['invalidateOn'],'userAgent':_0x2f3029?.[_0x4819ad(0x76)],'clientIp':_0x2f3029?.[_0x4819ad(0x7e)]}),_0x5b78b4=getSessionCachePath(_0x1b56c7,_0x5bc57e),_0x57c3be=_0x20f835[_0x4819ad(0xef)](join,_0x20f835['RQsgq'](getRangerHomeDir),_0x20f835['PFqFi']);!_0x20f835[_0x4819ad(0xfa)](existsSync,_0x57c3be)&&await mkdir(_0x57c3be,{'recursive':!![]});const _0x2adb43={..._0x5f0779};_0x5a4508&&_0x20f835[_0x4819ad(0x81)](_0x5a4508[_0x4819ad(0xe4)],0x0)&&Array[_0x4819ad(0x8d)](_0x2adb43[_0x4819ad(0xbb)])&&(_0x2adb43['cookies']=_0x20f835[_0x4819ad(0xe3)](duplicateCookiesForDomains,_0x2adb43[_0x4819ad(0xbb)],_0x5a4508));const _0x427b77={'cached_at':new Date()[_0x4819ad(0x95)](),'session_state':_0x2adb43};await writeFile(_0x5b78b4,JSON['stringify'](_0x427b77,null,0x2));const _0x5388d9=_0x20f835['KfLuq'](getStorageStatePath,_0x5b78b4);return await _0x20f835['zxBVL'](writeFile,_0x5388d9,JSON['stringify'](_0x2adb43,null,0x2)),_0x5388d9;}export async function checkLocalCache(_0x146ba2,_0x35b578,_0x3808a3,_0x5e4cae,_0x1d2565){const _0x18d97b=_0x359e,_0x51f671={'rNJXY':function(_0x365d12,_0xa6e8bf,_0x190a45){return _0x365d12(_0xa6e8bf,_0x190a45);}},_0x4e34a9=sessionCacheHash({'orgId':_0x35b578,'profileName':_0x146ba2,'effectiveBaseUrl':_0x3808a3,'setupHeaders':_0x5e4cae,'invalidateOn':_0x1d2565?.['invalidateOn'],'userAgent':_0x1d2565?.['userAgent'],'clientIp':_0x1d2565?.['clientIp']}),_0x2dadc7=_0x51f671[_0x18d97b(0xae)](getSessionCachePath,_0x4e34a9,_0x146ba2),_0x343126=getStorageStatePath(_0x2dadc7);if(!existsSync(_0x2dadc7)||!existsSync(_0x343126))return null;try{const _0x1ab461=await readFile(_0x2dadc7,_0x18d97b(0x77));return JSON['parse'](_0x1ab461),{'storageStatePath':_0x343126};}catch{return null;}}function launchRealBrowser(){const _0x4d81ab=_0x359e;return chromium[_0x4d81ab(0xf2)]({'headless':!![]});}function emitSessionValidationHint(_0x3ca5dc,_0x5c8691){const _0x38f4ca=_0x359e;if(!_0x5c8691||!_0x5c8691[_0x38f4ca(0xa1)]?.['length'])return;let _0x5d65f0;try{_0x5d65f0=new URL(_0x3ca5dc);}catch{return;}const _0x4f2eae=[];for(const _0x2eaf22 of _0x5c8691[_0x38f4ca(0xa1)]){try{_0x4f2eae['push']({'raw':_0x2eaf22,'url':new URL(_0x2eaf22)});}catch{}}if(_0x4f2eae[_0x38f4ca(0xe4)]===0x0)return;if(_0x4f2eae[_0x38f4ca(0x78)](_0xf57f56=>_0xf57f56[_0x38f4ca(0xca)][_0x38f4ca(0x8c)]===_0x5d65f0['origin']))return;const _0x1252af=_0x4f2eae[_0x38f4ca(0xd2)](_0x323d5c=>'\x22'+_0x323d5c['raw']+'\x22')[_0x38f4ca(0xa9)](',\x20');console[_0x38f4ca(0x9c)]('\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20'+_0x1252af+';\x20'+('you\x27re\x20now\x20at\x20\x22'+_0x3ca5dc+_0x38f4ca(0xd6))+'If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.');}export async function serverSideLogin(_0x529a1f,_0x5bfdad){const _0x4f730f=_0x359e,_0x53b3a9={'IYwOJ':'POST','xtzMc':function(_0x1ad6a9,_0x5956ac){return _0x1ad6a9 instanceof _0x5956ac;},'GxRyV':function(_0x5090c0,_0x2ce1e4){return _0x5090c0===_0x2ce1e4;},'OvhXz':'not_configured'},_0x5a0152=process['env']['RANGER_TEST_USERNAME'],_0x4c1630=process[_0x4f730f(0x9f)]['RANGER_TEST_PASSWORD'],_0x28ad75={};if(_0x5a0152)_0x28ad75['username']=_0x5a0152;if(_0x4c1630)_0x28ad75[_0x4f730f(0x79)]=_0x4c1630;if(_0x5bfdad?.['force'])_0x28ad75[_0x4f730f(0xf1)]=!![];if(_0x5bfdad?.[_0x4f730f(0xa2)])_0x28ad75[_0x4f730f(0x91)]=_0x5bfdad[_0x4f730f(0xa2)];_0x5bfdad?.['tunnel']&&(_0x28ad75['tunnel_session_id']=_0x5bfdad[_0x4f730f(0x71)][_0x4f730f(0xa7)],_0x28ad75['pw_endpoint']=_0x5bfdad[_0x4f730f(0x71)][_0x4f730f(0xb4)]);try{return await apiRequest(_0x4f730f(0xa3)+encodeURIComponent(_0x529a1f)+'/login',{'method':_0x53b3a9[_0x4f730f(0xff)],'body':JSON[_0x4f730f(0xbe)](_0x28ad75)});}catch(_0x4db9f3){if(_0x53b3a9['xtzMc'](_0x4db9f3,ApiError)&&_0x53b3a9[_0x4f730f(0x7b)](_0x4db9f3[_0x4f730f(0x8a)],0x190)&&_0x4db9f3['code']==='not_configured')return{'status':_0x53b3a9['OvhXz'],'error':_0x4db9f3['detail']};throw _0x4db9f3;}}async function serverSideLoginWithOptionalTunnel(_0x6c95e0,_0x1e215b,_0xea2e51={}){const _0xfc5785=_0x359e,_0x2e841a={'fCzTO':_0xfc5785(0xd7),'XJPSl':function(_0xa67397,_0x49fabb){return _0xa67397(_0x49fabb);},'LHwnO':function(_0x30291f,_0x56b231,_0x80227e){return _0x30291f(_0x56b231,_0x80227e);},'ZmUmo':function(_0x435909,_0x2071b0){return _0x435909??_0x2071b0;},'qayYO':_0xfc5785(0xbc),'skTRC':function(_0x2a6c4d,_0x1dbde2){return _0x2a6c4d||_0x1dbde2;},'RwoqB':'tunnel_login_cleanup'};if(!_0x2e841a[_0xfc5785(0xe1)](needsTunnel,_0x1e215b))return await _0x2e841a[_0xfc5785(0xd9)](serverSideLogin,_0x6c95e0,{'force':_0xea2e51[_0xfc5785(0xf1)]});let _0x57b6ca=null,_0x17ec29=null,_0x1b28c6=null,_0x37ac37=null,_0x5bbc00=![];const _0xa8404={'profileName':_0x6c95e0,'targetUrlHost':_0x2e841a[_0xfc5785(0xe1)](targetHostForTelemetry,_0x1e215b),'tunnelRequired':!![],'forceLogin':Boolean(_0xea2e51['force'])};try{_0xea2e51['telemetry']?.[_0xfc5785(0xeb)](_0xfc5785(0xbc),_0xa8404),_0x57b6ca=await launchBrowserServer({'headless':!![]}),_0x17ec29=await createTunnelSession(_0x1e215b);const _0x2fc8e0=await requireToken();_0x1b28c6=await _0x2e841a['XJPSl'](createTunnelBridge,{'localWsUrl':_0x57b6ca['wsEndpoint'],'tunnelServerUrl':_0x17ec29[_0xfc5785(0x6c)],'sessionId':_0x17ec29[_0xfc5785(0xa7)],'apiKey':_0x2fc8e0,'onError':_0x48ae0d=>{_0x37ac37=_0x48ae0d;},'onClose':()=>{_0x37ac37??=new Error('Tunnel\x20bridge\x20closed\x20before\x20login\x20completed\x20for\x20'+_0x6c95e0);},'onEvent':_0x3b4670=>trackBridgeEvent(_0xea2e51['telemetry'],_0x3b4670)}),_0xea2e51[_0xfc5785(0xaf)]?.['trackPhaseEnd'](_0xfc5785(0xbc),{..._0xa8404,'tunnelSessionId':_0x17ec29[_0xfc5785(0xa7)],'localBrowserServer':!![]}),_0x5bbc00=!![];try{return _0xea2e51['telemetry']?.[_0xfc5785(0xeb)](_0xfc5785(0xd7),{..._0xa8404,'tunnelSessionId':_0x17ec29[_0xfc5785(0xa7)]}),await serverSideLogin(_0x6c95e0,{'force':_0xea2e51['force'],'targetUrl':_0x1e215b,'tunnel':{'sessionId':_0x17ec29[_0xfc5785(0xa7)],'pwEndpoint':_0x17ec29['pwEndpoint']}})[_0xfc5785(0x9e)](_0x11c6b6=>{const _0x2f834e=_0xfc5785;return _0xea2e51['telemetry']?.['trackPhaseEnd'](_0x2e841a['fCzTO'],{..._0xa8404,'tunnelSessionId':_0x17ec29?.['sessionId'],'loginStatus':_0x11c6b6[_0x2f834e(0x8a)],'hasSessionState':Boolean(_0x11c6b6[_0x2f834e(0xe6)]),'hasTestOutput':_0x2e841a['XJPSl'](Boolean,_0x11c6b6['test_output']),'bridgeError':errorMessageForTelemetry(_0x37ac37)}),_0x11c6b6;});}catch(_0x4f494f){await _0xea2e51['telemetry']?.[_0xfc5785(0xf6)]('tunnel_login_request',_0x2e841a['ZmUmo'](_0x37ac37,_0x4f494f),{..._0xa8404,'tunnelSessionId':_0x17ec29[_0xfc5785(0xa7)],'bridgeError':errorMessageForTelemetry(_0x37ac37)});throw _0x37ac37??_0x4f494f;}}catch(_0x2ae533){!_0x5bbc00&&await _0xea2e51['telemetry']?.[_0xfc5785(0xf6)](_0x2e841a[_0xfc5785(0xab)],_0x2ae533,{..._0xa8404,'tunnelSessionId':_0x17ec29?.['sessionId']});throw _0x2ae533;}finally{(_0x2e841a[_0xfc5785(0x7c)](_0x17ec29,_0x57b6ca)||_0x1b28c6)&&(_0xea2e51['telemetry']?.['trackPhaseStart'](_0x2e841a[_0xfc5785(0x87)],{..._0xa8404,'tunnelSessionId':_0x17ec29?.[_0xfc5785(0xa7)]}),_0x1b28c6?.['close'](),_0x57b6ca&&await _0x57b6ca['close']()['catch'](()=>{}),_0x17ec29&&await _0x2e841a['XJPSl'](deleteTunnelSession,_0x17ec29['sessionId'])[_0xfc5785(0xd1)](()=>{}),_0xea2e51[_0xfc5785(0xaf)]?.['trackPhaseEnd'](_0x2e841a[_0xfc5785(0x87)],{..._0xa8404,'tunnelSessionId':_0x17ec29?.[_0xfc5785(0xa7)]}));}}export async function manualBrowserLogin(_0x54736b,_0x1d15cd,_0x227e45={}){const _0x356068=_0x359e,_0x2def={'ObjTo':function(_0x3a1ce7,_0x5f4d1a){return _0x3a1ce7/_0x5f4d1a;},'hMIWM':function(_0x47900b,_0x298e86,_0x18c816){return _0x47900b(_0x298e86,_0x18c816);},'rlDTW':_0x356068(0x99),'gpcBO':function(_0x504100,_0x209695){return _0x504100+_0x209695;},'rsscw':'\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20','hkoIi':function(_0x354ca8,_0x258623){return _0x354ca8>_0x258623;},'xKVSD':'\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','zcLOx':'Browser\x20closed\x20before\x20authentication\x20was\x20saved.','jxpZE':function(_0x5f4e98,_0x234a22){return _0x5f4e98!==_0x234a22;},'LWtbt':function(_0x54bbce,_0xfcb8c1){return _0x54bbce(_0xfcb8c1);},'vsoTE':_0x356068(0x90)};if(!isInteractive())throw new Error(_0x2def[_0x356068(0xad)]('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0x54736b[_0x356068(0x9b)]+'\x22.\x0a',_0x2def[_0x356068(0xb2)])+_0x356068(0xc5));const _0x4e4a7d=_0x1d15cd&&_0x2def['hkoIi'](_0x1d15cd['domains']['length'],0x0)?_0x1d15cd['domains'][0x0]:_0x356068(0xcf);console[_0x356068(0x9c)](_0x2def['xKVSD']),console[_0x356068(0x9c)]('\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a'),await new Promise(_0x266b21=>setTimeout(_0x266b21,0x7d0));const _0x5e9a35=await chromium['launch']({'headless':![]});let _0x35cf11=null;try{const _0x2b836c={'ignoreHTTPSErrors':!![]};_0x1d15cd?.['setupHeaders']&&(_0x2b836c[_0x356068(0xb8)]=_0x1d15cd[_0x356068(0x82)]);const _0x16e8b0=await _0x5e9a35['newContext'](_0x2b836c);await addProfileSetupBanner(_0x16e8b0);const _0x42265d=await _0x16e8b0['newPage']();await _0x42265d[_0x356068(0xf5)](_0x4e4a7d);let _0x5a6aa2=![];await new Promise(_0x3f6bc4=>{const _0x62093b=_0x356068,_0x4fc985={'Nqawf':function(_0x4e8034,_0x46375d){return _0x2def['ObjTo'](_0x4e8034,_0x46375d);},'lOfxF':function(_0x2f5db6){return _0x2f5db6();}},_0x37451c=_0x2def['hMIWM'](setTimeout,()=>{const _0x55aed8=_0x359e;_0x5a6aa2=!![],console[_0x55aed8(0xc3)]('Browser\x20login\x20timed\x20out\x20after\x20'+_0x4fc985['Nqawf'](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+'\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.'),_0x4fc985['lOfxF'](_0x3f6bc4);},MANUAL_LOGIN_TIMEOUT_MS);_0x42265d['on'](_0x2def[_0x62093b(0x7d)],async()=>{const _0x1084b5=_0x62093b;clearTimeout(_0x37451c);try{const _0x269341=await _0x16e8b0[_0x1084b5(0xea)]();_0x35cf11=_0x269341;}catch{}_0x4fc985['lOfxF'](_0x3f6bc4);});});if(_0x5a6aa2&&!_0x35cf11)throw new Error(_0x356068(0xec));}finally{await _0x5e9a35['close']()[_0x356068(0xd1)](()=>{});}if(!_0x35cf11)throw new Error(_0x2def[_0x356068(0xe9)]);return _0x2def[_0x356068(0x72)](_0x227e45['persistSessionState'],![])&&await apiRequest('/api/v1/profiles/'+_0x2def[_0x356068(0xb5)](encodeURIComponent,_0x54736b['name'])+'/session',{'method':_0x2def[_0x356068(0xb9)],'body':JSON[_0x356068(0xbe)]({'session_state':_0x35cf11,'updated_by':_0x356068(0xb6)})}),{'sessionState':_0x35cf11};}export async function promptSaveCredentials(_0xd3e92a){const _0x4bc4f5=_0x359e,_0x1a2f1d={'SnGbc':function(_0x525ecc,_0xe70cab){return _0x525ecc||_0xe70cab;},'gXKWJ':'confirm','tSZgs':_0x4bc4f5(0xdc),'UznxG':function(_0x169a34,_0x20fa0b,_0x42a88d){return _0x169a34(_0x20fa0b,_0x42a88d);}},_0x372564=process['env']['RANGER_TEST_USERNAME'],_0x5b6872=process[_0x4bc4f5(0x9f)]['RANGER_TEST_PASSWORD'];if(_0x1a2f1d['SnGbc'](!_0x372564,!_0x5b6872))return;if(!isInteractive())return;const {save:_0x6e51bd}=await _0x1a69e1[_0x4bc4f5(0xa8)]([{'type':_0x1a2f1d['gXKWJ'],'name':_0x1a2f1d[_0x4bc4f5(0xf8)],'message':'Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','default':![]}]);if(!_0x6e51bd)return;await _0x1a2f1d[_0x4bc4f5(0xac)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0xd3e92a),{'method':_0x4bc4f5(0x7f),'body':JSON[_0x4bc4f5(0xbe)]({'username':_0x372564,'password':_0x5b6872})}),console['log']('\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.');}export async function resolveCloudProfileSession(_0x4a5aa0,_0x5c3f30={}){const _0x15ca64=_0x359e,_0x4afb20={'qeHpf':function(_0x535976,_0x2c41ed){return _0x535976===_0x2c41ed;},'NBplG':_0x15ca64(0xb1),'mycsM':function(_0x3839be,_0x6a7b){return _0x3839be(_0x6a7b);},'aReJL':function(_0x59cc4d,_0x120ddf,_0x521936,_0x1f11df,_0x9d24cf){return _0x59cc4d(_0x120ddf,_0x521936,_0x1f11df,_0x9d24cf);},'aJdkD':function(_0x3af435,_0x18e471,_0x1f1abe,_0x1366ca,_0x4fe563,_0x37f167,_0x5646f1,_0x5f069c){return _0x3af435(_0x18e471,_0x1f1abe,_0x1366ca,_0x4fe563,_0x37f167,_0x5646f1,_0x5f069c);},'BVtXr':function(_0x300cb3,_0x2c4dbd,_0x4cd761,_0xf245c,_0x535238){return _0x300cb3(_0x2c4dbd,_0x4cd761,_0xf245c,_0x535238);},'CFtNU':function(_0x1eec2b,_0x40daa4,_0x1ba64d){return _0x1eec2b(_0x40daa4,_0x1ba64d);},'Exayc':function(_0x3280ae,_0x2480f,_0x5b8a01){return _0x3280ae(_0x2480f,_0x5b8a01);},'ZJExx':function(_0x4dcad5,_0x4843ab){return _0x4dcad5===_0x4843ab;},'ZLsKB':function(_0x414bd6,_0x2483c9){return _0x414bd6&&_0x2483c9;},'FNACM':function(_0x374e1a,_0x118f8f){return _0x374e1a(_0x118f8f);},'WkDVZ':_0x15ca64(0xc0),'BVLiO':function(_0x3fd9dd,_0x5ae2c9){return _0x3fd9dd instanceof _0x5ae2c9;},'GDZng':function(_0x1982da,_0x1e03f9){return _0x1982da(_0x1e03f9);}},_0x1ede94=_0x4a5aa0['settings']??{},_0x545374=await fetchAuthConfig(),_0x49bc74=_0x545374?resolveAuthEnvironmentLocally(_0x545374,_0x4a5aa0['environmentKey']):null,_0x335bed=_0x4afb20['qeHpf'](typeof _0x49bc74?.['loginInstructions'],_0x4afb20['NBplG'])&&_0x49bc74[_0x15ca64(0xc6)]['trim']()?_0x49bc74['loginInstructions']:undefined,_0x5bf8fe=typeof _0x1ede94['loginInstructions']===_0x15ca64(0xb1)&&_0x1ede94[_0x15ca64(0xc6)][_0x15ca64(0xc1)]()?_0x1ede94[_0x15ca64(0xc6)]:undefined,_0x32b776=_0x5bf8fe||!_0x335bed?_0x1ede94:{..._0x1ede94,'loginInstructions':_0x335bed},_0x42fd7a=Boolean(_0x32b776['loginInstructions']?.[_0x15ca64(0xc1)]()),_0x54579a=_0x4afb20[_0x15ca64(0x92)](Boolean,_0x1ede94['forceLogin']||_0x49bc74?.['forceLogin']),_0x207dcd=_0x49bc74?.[_0x15ca64(0xa1)],_0xaf4be8=_0x1ede94['setupHeaders'],_0x2b32c5=_0xaf4be8??_0x49bc74?.['setupHeaders'],_0x3f4fb0=_0x5c3f30['effectiveBaseUrl']??_0x1ede94[_0x15ca64(0xee)]??(_0x207dcd&&_0x207dcd[_0x15ca64(0xe4)]>0x0?_0x207dcd[0x0]:''),_0x9d8c8c=_0x3f4fb0?_0x4afb20[_0x15ca64(0x92)](needsTunnel,_0x3f4fb0):![],_0x5f05e1={'invalidateOn':_0x49bc74?.['invalidateOn'],'userAgent':_0x49bc74?.[_0x15ca64(0x73)]?.[_0x15ca64(0x76)]??_0x1ede94[_0x15ca64(0x76)]};_0x54579a&&console['log']('\x20\x20forceLogin\x20enabled\x20for\x20\x22'+_0x4a5aa0['name']+'\x22,\x20refreshing\x20session...');if(!_0x54579a){const _0x14d8d5=await checkLocalCache(_0x4a5aa0['name'],_0x4a5aa0['organizationId'],_0x3f4fb0,_0x2b32c5,_0x5f05e1);if(_0x14d8d5){if(_0x3f4fb0&&!_0x9d8c8c){const _0x1cb184=await _0x4afb20[_0x15ca64(0x98)](isCachedSessionLive,_0x14d8d5[_0x15ca64(0xfb)],_0x3f4fb0,{'sessionCheckPath':_0x49bc74?.[_0x15ca64(0xe0)],'setupHeaders':_0x2b32c5},{'launchBrowser':launchRealBrowser});if(_0x1cb184)return console[_0x15ca64(0x9c)]('\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22'+_0x4a5aa0['name']+'\x22'),{'authPath':_0x14d8d5['storageStatePath'],'settings':_0x32b776,'resolvedEnv':_0x49bc74};console['log'](_0x15ca64(0x94)+_0x4a5aa0['name']+_0x15ca64(0xc4)),emitSessionValidationHint(_0x3f4fb0,_0x49bc74);}else return _0x9d8c8c&&console[_0x15ca64(0x9c)]('\x20\x20Using\x20cached\x20local\x20session\x20for\x20cloud\x20profile\x20\x22'+_0x4a5aa0[_0x15ca64(0x9b)]+'\x22'),{'authPath':_0x14d8d5['storageStatePath'],'settings':_0x32b776,'resolvedEnv':_0x49bc74};}}if(!_0x54579a&&_0x4a5aa0['sessionState']){if(_0x9d8c8c)console[_0x15ca64(0x9c)](_0x15ca64(0xa4)+_0x3f4fb0+'\x22\x20on\x20profile\x20\x22'+_0x4a5aa0[_0x15ca64(0x9b)]+'\x22');else{const _0x4db613=await _0x4afb20['aJdkD'](writeSessionToLocalCache,_0x4a5aa0[_0x15ca64(0x9b)],_0x4a5aa0[_0x15ca64(0xaa)],_0x3f4fb0,_0x2b32c5,_0x4a5aa0['sessionState'],_0x207dcd,_0x5f05e1);if(_0x3f4fb0){const _0x22f0ec=await _0x4afb20[_0x15ca64(0xce)](isCachedSessionLive,_0x4db613,_0x3f4fb0,{'sessionCheckPath':_0x49bc74?.['sessionCheckPath'],'setupHeaders':_0x2b32c5},{'launchBrowser':launchRealBrowser});if(_0x22f0ec)return console[_0x15ca64(0x9c)]('\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22'+_0x4a5aa0['name']+'\x22,\x20cached\x20locally'),{'authPath':_0x4db613,'settings':_0x32b776,'resolvedEnv':_0x49bc74};console['log'](_0x15ca64(0xc9)+_0x4a5aa0['name']+'\x22\x20failed\x20validation\x20—\x20re-login\x20needed...'),_0x4afb20['CFtNU'](emitSessionValidationHint,_0x3f4fb0,_0x49bc74);}else return{'authPath':_0x4db613,'settings':_0x32b776,'resolvedEnv':_0x49bc74};}}if(_0x42fd7a)return console[_0x15ca64(0x9c)](_0x15ca64(0xd0)+_0x4a5aa0['name']+_0x15ca64(0xbd)),{'authPath':undefined,'settings':_0x32b776,'resolvedEnv':_0x49bc74};console[_0x15ca64(0x9c)](_0x15ca64(0xd0)+_0x4a5aa0['name']+_0x15ca64(0xf3));const _0x43e84d=Boolean(process[_0x15ca64(0x9f)][_0x15ca64(0xda)])&&_0x4afb20[_0x15ca64(0x92)](Boolean,process['env']['RANGER_TEST_PASSWORD']),_0x32ed69=_0x4afb20[_0x15ca64(0x92)](Boolean,_0x4a5aa0['username']);if(_0x43e84d||_0x32ed69)try{const _0x52a9b1=_0x3f4fb0?await serverSideLoginWithOptionalTunnel(_0x4a5aa0[_0x15ca64(0x9b)],_0x3f4fb0,{'force':_0x54579a,'telemetry':_0x5c3f30[_0x15ca64(0xaf)]}):await _0x4afb20['Exayc'](serverSideLogin,_0x4a5aa0[_0x15ca64(0x9b)],{'force':_0x54579a});if(_0x4afb20['ZJExx'](_0x52a9b1[_0x15ca64(0x8a)],'not_configured'))console[_0x15ca64(0x9c)](_0x15ca64(0xdf));else{if(_0x52a9b1['status']===_0x15ca64(0xa5)&&_0x52a9b1['session_state']){console[_0x15ca64(0x9c)]('\x20\x20Login\x20successful.\x20Session\x20cached.');const _0x396563=await writeSessionToLocalCache(_0x4a5aa0[_0x15ca64(0x9b)],_0x4a5aa0['organizationId'],_0x3f4fb0,_0x2b32c5,_0x52a9b1['session_state'],_0x207dcd,_0x5f05e1);return _0x4afb20['ZLsKB'](_0x43e84d,!_0x32ed69)&&await _0x4afb20['FNACM'](promptSaveCredentials,_0x4a5aa0[_0x15ca64(0x9b)]),{'authPath':_0x396563,'settings':_0x32b776,'resolvedEnv':_0x49bc74};}else _0x52a9b1[_0x15ca64(0xde)]&&(console[_0x15ca64(0x9c)](_0x4afb20[_0x15ca64(0x9a)]),console['log'](_0x52a9b1['test_output'])),console[_0x15ca64(0x9c)]('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}}catch(_0xc7b4ab){console['log']('\x20\x20Server-side\x20login\x20error:\x20'+(_0x4afb20[_0x15ca64(0xe7)](_0xc7b4ab,Error)?_0xc7b4ab[_0x15ca64(0xcb)]:_0x4afb20['GDZng'](String,_0xc7b4ab))),console['log'](_0x15ca64(0x80));}const _0x308cb8=_0x49bc74?{..._0x49bc74,'setupHeaders':_0x2b32c5}:_0x3f4fb0?{'key':_0x4a5aa0['environmentKey']??'','domains':[_0x3f4fb0],'setupHeaders':_0x2b32c5}:null,{sessionState:_0xd22fa3}=await manualBrowserLogin(_0x4a5aa0,_0x308cb8,{'persistSessionState':!_0x9d8c8c}),_0x1d5f03=await _0x4afb20[_0x15ca64(0xc7)](writeSessionToLocalCache,_0x4a5aa0[_0x15ca64(0x9b)],_0x4a5aa0['organizationId'],_0x3f4fb0,_0x2b32c5,_0xd22fa3,_0x207dcd,_0x5f05e1);return{'authPath':_0x1d5f03,'settings':_0x32b776,'resolvedEnv':_0x49bc74};}
@@ -1 +1 @@
1
- const _0xddaa81=_0x8d00;(function(_0x1d2bc4,_0x3eef44){const _0x33013f=_0x8d00,_0x239987=_0x1d2bc4();while(!![]){try{const _0x493e31=-parseInt(_0x33013f(0x106))/0x1+parseInt(_0x33013f(0x126))/0x2+parseInt(_0x33013f(0x12c))/0x3+parseInt(_0x33013f(0x12a))/0x4+parseInt(_0x33013f(0x12f))/0x5+-parseInt(_0x33013f(0x107))/0x6+parseInt(_0x33013f(0x11a))/0x7*(-parseInt(_0x33013f(0x11b))/0x8);if(_0x493e31===_0x3eef44)break;else _0x239987['push'](_0x239987['shift']());}catch(_0x3cfa68){_0x239987['push'](_0x239987['shift']());}}}(_0x3781,0x97e3f));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x5122d8=process['env'],_0x487c5c={'stdin':process['stdin'],'stdout':process[_0xddaa81(0x10a)]}){const _0x4c3d37=_0xddaa81;if(_0x5122d8['CI'])return![];return Boolean(_0x487c5c[_0x4c3d37(0x108)][_0x4c3d37(0x122)])&&Boolean(_0x487c5c['stdout']['isTTY']);}function _0x8d00(_0x1caedf,_0x2f5fc6){_0x1caedf=_0x1caedf-0x105;const _0x37813f=_0x3781();let _0x8d000e=_0x37813f[_0x1caedf];return _0x8d000e;}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x348804){const _0x5152a1=_0xddaa81,_0x56ce5e={'nsaEd':'baseUrl','zbdKk':'setupHeaders','LfiiO':function(_0x4db994,_0x28744e){return _0x4db994(_0x28744e);},'pFoxL':'port','hsPrS':function(_0x57e333,_0x3a24bf){return _0x57e333(_0x3a24bf);},'oLQRD':_0x5152a1(0x12e),'HbqFH':function(_0x1e70a0,_0x3f565a){return _0x1e70a0!==_0x3f565a;},'AWrkY':_0x5152a1(0x111)},_0x1492ba=new Set(_0x348804[_0x5152a1(0x10b)]??DEFAULT_INVALIDATE_ON),_0x254e0d={'orgId':_0x348804['orgId'],'profileName':_0x348804[_0x5152a1(0x10d)]};return _0x1492ba['has'](_0x56ce5e[_0x5152a1(0x113)])&&(_0x254e0d[_0x5152a1(0x119)]=_0x348804['effectiveBaseUrl']),_0x1492ba[_0x5152a1(0x11d)](_0x56ce5e['zbdKk'])&&(_0x254e0d[_0x5152a1(0x11f)]=_0x348804[_0x5152a1(0x11f)]?_0x56ce5e['LfiiO'](sortObjectKeys,_0x348804[_0x5152a1(0x11f)]):_0x348804['setupHeaders']),_0x1492ba[_0x5152a1(0x11d)](_0x56ce5e['pFoxL'])&&(_0x254e0d[_0x5152a1(0x12b)]=_0x56ce5e[_0x5152a1(0x105)](extractPort,_0x348804['effectiveBaseUrl'])),_0x1492ba['has'](_0x56ce5e['oLQRD'])&&_0x56ce5e[_0x5152a1(0x117)](_0x348804['userAgent'],undefined)&&(_0x254e0d[_0x5152a1(0x12e)]=_0x348804[_0x5152a1(0x12e)]),_0x1492ba['has'](_0x56ce5e['AWrkY'])&&_0x348804['clientIp']!==undefined&&(_0x254e0d[_0x5152a1(0x111)]=_0x348804['clientIp']),_0x56ce5e['LfiiO'](createHash,'sha256')[_0x5152a1(0x118)](JSON['stringify'](_0x254e0d))[_0x5152a1(0x11c)](_0x5152a1(0x121))['slice'](0x0,0xc);}function extractPort(_0x31b3ef){const _0xfecaa9=_0xddaa81;try{return new URL(_0x31b3ef)[_0xfecaa9(0x12b)];}catch{return'';}}function sortObjectKeys(_0x5cce53){const _0x33db48=_0xddaa81,_0xd68edb={};for(const _0x37a761 of Object['keys'](_0x5cce53)[_0x33db48(0x129)]()){_0xd68edb[_0x37a761]=_0x5cce53[_0x37a761];}return _0xd68edb;}export function getSessionCachePath(_0x1b555f,_0x55da9d){const _0x22af77=_0xddaa81,_0xd26198={'gtlzz':function(_0x458e40){return _0x458e40();}};return join(_0xd26198['gtlzz'](getRangerHomeDir),'auth',_0x1b555f+'-'+_0x55da9d+_0x22af77(0x112));}export function getStorageStatePath(_0x416ab4){const _0x3454dd=_0xddaa81;return _0x416ab4[_0x3454dd(0x130)](/\.json$/,'.storageState.json');}export function needsTunnel(_0x1dbeff){const _0x9fd5bb=_0xddaa81,_0x1d8f77={'vtxSI':function(_0xbc72c9,_0x24c3a3){return _0xbc72c9===_0x24c3a3;},'BzOxi':'.localhost','fNBcx':_0x9fd5bb(0x12d)};let _0x3b6f9b;try{_0x3b6f9b=new URL(_0x1dbeff)['hostname'];}catch{return![];}if(_0x3b6f9b===_0x9fd5bb(0x11e)||_0x1d8f77[_0x9fd5bb(0x120)](_0x3b6f9b,'127.0.0.1'))return!![];if(_0x3b6f9b['endsWith'](_0x1d8f77[_0x9fd5bb(0x124)]))return!![];if(_0x3b6f9b['includes'](_0x1d8f77['fNBcx']))return!![];return![];}export function hostnameOf(_0x1e59c1){const _0x2f0410=_0xddaa81;return new URL(_0x1e59c1)[_0x2f0410(0x115)];}export function duplicateCookiesForDomains(_0x9da026,_0x493b0f){const _0x4f9e3b=_0xddaa81,_0x28e9ab=[..._0x9da026],_0x29c2ed=new Set(_0x9da026['map'](_0x2740e2=>_0x2740e2['domain']));for(const _0x36e660 of _0x493b0f){let _0x1c7218;try{_0x1c7218=hostnameOf(_0x36e660);}catch{continue;}if(!_0x1c7218)continue;const _0x36cd71=_0x1c7218['startsWith']('.')?_0x1c7218:'.'+_0x1c7218;if(_0x29c2ed['has'](_0x1c7218)||_0x29c2ed['has'](_0x36cd71))continue;for(const _0x69d1b0 of _0x9da026){_0x28e9ab[_0x4f9e3b(0x109)]({..._0x69d1b0,'domain':_0x36cd71});}_0x29c2ed[_0x4f9e3b(0x127)](_0x36cd71);}return _0x28e9ab;}export function resolveAuthEnvironmentLocally(_0x2f80f4,_0x1bb33f){const _0x5bc402=_0xddaa81,_0x21e806={'WoShQ':function(_0x2e76fb,_0x109025){return _0x2e76fb===_0x109025;}},_0x4593d8=_0x2f80f4['environments'];if(_0x1bb33f){const _0x342192=_0x4593d8[_0x1bb33f];if(!_0x342192)return null;return{'key':_0x1bb33f,..._0x342192};}if(_0x2f80f4[_0x5bc402(0x110)]){const _0x3573f9=_0x4593d8[_0x2f80f4['defaultEnvironmentKey']];if(!_0x3573f9)return null;return{'key':_0x2f80f4[_0x5bc402(0x110)],..._0x3573f9};}const _0x5ac035=Object['keys'](_0x4593d8);if(_0x21e806['WoShQ'](_0x5ac035['length'],0x1)){const _0x175738=_0x5ac035[0x0];return{'key':_0x175738,..._0x4593d8[_0x175738]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;function _0x3781(){const _0x39b1f0=['localhost','setupHeaders','vtxSI','hex','isTTY','newContext','BzOxi','pathname','1130780ZIqylf','add','BScrJ','sort','4141292pGbxqL','port','993600UhThmz','localhost.','userAgent','3041735XidZPS','replace','hsPrS','949381cafaGn','937848REQVYL','stdin','push','stdout','invalidateOn','toString','profileName','newPage','cJpHa','defaultEnvironmentKey','clientIp','.json','nsaEd','domcontentloaded','hostname','sessionCheckPath','HbqFH','update','effectiveBaseUrl','1421749Ewbiyu','32okVclv','digest','has'];_0x3781=function(){return _0x39b1f0;};return _0x3781();}export function buildSessionCheckUrl(_0x559dc4,_0x3e73f6){const _0x310156=_0xddaa81;try{if(_0x3e73f6)return new URL(_0x3e73f6,_0x559dc4)[_0x310156(0x10c)]();return new URL(_0x559dc4)[_0x310156(0x10c)]();}catch{return null;}}export function looksLikeLoginUrl(_0x6aab7d){const _0x2bc25e=_0xddaa81;try{const _0x3f3c71=new URL(_0x6aab7d);return LOGIN_URL_PATTERN['test'](_0x3f3c71[_0x2bc25e(0x125)]);}catch{return LOGIN_URL_PATTERN['test'](_0x6aab7d);}}export async function isCachedSessionLive(_0xad5058,_0x3cec1d,_0x128377={},_0x1b6cf0={}){const _0x1353ff=_0xddaa81,_0x66c791={'cJpHa':_0x1353ff(0x114),'BScrJ':function(_0x2ff9e0,_0xef42f3){return _0x2ff9e0===_0xef42f3;}},_0x539f87=buildSessionCheckUrl(_0x3cec1d,_0x128377[_0x1353ff(0x116)]);if(!_0x539f87)return!![];if(!_0x1b6cf0['launchBrowser'])return!![];let _0x335614=null;try{_0x335614=await _0x1b6cf0['launchBrowser']();const _0x441023=await _0x335614[_0x1353ff(0x123)]({'storageState':_0xad5058,'ignoreHTTPSErrors':!![],..._0x128377['setupHeaders']?{'extraHTTPHeaders':_0x128377['setupHeaders']}:{}}),_0x37c63a=await _0x441023[_0x1353ff(0x10e)](),_0x31b507=await _0x37c63a['goto'](_0x539f87,{'waitUntil':_0x66c791[_0x1353ff(0x10f)],'timeout':0x3a98}),_0x47b8d3=_0x31b507?.['status']();if(_0x47b8d3===0x191||_0x66c791[_0x1353ff(0x128)](_0x47b8d3,0x193))return![];const _0x2cf083=_0x37c63a['url']();if(looksLikeLoginUrl(_0x2cf083))return![];return!![];}catch{return![];}finally{if(_0x335614)await _0x335614['close']()['catch'](()=>{});}}
1
+ const _0x376f92=_0x3046;(function(_0x2f0d1f,_0x7603e8){const _0x326c49=_0x3046,_0x363d80=_0x2f0d1f();while(!![]){try{const _0x3f0f72=-parseInt(_0x326c49(0x107))/0x1*(parseInt(_0x326c49(0x127))/0x2)+parseInt(_0x326c49(0x117))/0x3*(parseInt(_0x326c49(0xfb))/0x4)+parseInt(_0x326c49(0x122))/0x5*(-parseInt(_0x326c49(0xfa))/0x6)+-parseInt(_0x326c49(0x128))/0x7*(-parseInt(_0x326c49(0x111))/0x8)+-parseInt(_0x326c49(0x116))/0x9*(-parseInt(_0x326c49(0x109))/0xa)+-parseInt(_0x326c49(0xff))/0xb*(-parseInt(_0x326c49(0x101))/0xc)+-parseInt(_0x326c49(0xf9))/0xd;if(_0x3f0f72===_0x7603e8)break;else _0x363d80['push'](_0x363d80['shift']());}catch(_0x41c6f3){_0x363d80['push'](_0x363d80['shift']());}}}(_0x76a8,0x1a229));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x17c4ea=process[_0x376f92(0x10f)],_0x34ccc2={'stdin':process['stdin'],'stdout':process['stdout']}){const _0x56113f=_0x376f92,_0x1ebbaf={'yTHEt':function(_0x1f854f,_0x4c922c){return _0x1f854f(_0x4c922c);}};if(_0x17c4ea['CI'])return![];return _0x1ebbaf[_0x56113f(0x129)](Boolean,_0x34ccc2[_0x56113f(0x108)]['isTTY'])&&_0x1ebbaf[_0x56113f(0x129)](Boolean,_0x34ccc2[_0x56113f(0x12a)]['isTTY']);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x31e1cc){const _0xbc96f5=_0x376f92,_0x17daa4={'Tpfgy':'setupHeaders','uFLFZ':'userAgent','LtQmV':function(_0x235337,_0xbb6bc0){return _0x235337!==_0xbb6bc0;},'zisdG':_0xbc96f5(0x125)},_0x2be571=new Set(_0x31e1cc[_0xbc96f5(0x123)]??DEFAULT_INVALIDATE_ON),_0x1a542e={'orgId':_0x31e1cc[_0xbc96f5(0x10c)],'profileName':_0x31e1cc[_0xbc96f5(0x10d)]};return _0x2be571['has']('baseUrl')&&(_0x1a542e['effectiveBaseUrl']=_0x31e1cc[_0xbc96f5(0x103)]),_0x2be571[_0xbc96f5(0x11f)](_0x17daa4[_0xbc96f5(0xf8)])&&(_0x1a542e[_0xbc96f5(0x10b)]=_0x31e1cc[_0xbc96f5(0x10b)]?sortObjectKeys(_0x31e1cc[_0xbc96f5(0x10b)]):_0x31e1cc['setupHeaders']),_0x2be571[_0xbc96f5(0x11f)](_0xbc96f5(0x10a))&&(_0x1a542e[_0xbc96f5(0x10a)]=extractPort(_0x31e1cc[_0xbc96f5(0x103)])),_0x2be571[_0xbc96f5(0x11f)](_0x17daa4[_0xbc96f5(0x106)])&&_0x31e1cc[_0xbc96f5(0x114)]!==undefined&&(_0x1a542e[_0xbc96f5(0x114)]=_0x31e1cc[_0xbc96f5(0x114)]),_0x2be571[_0xbc96f5(0x11f)](_0xbc96f5(0x120))&&_0x17daa4[_0xbc96f5(0x10e)](_0x31e1cc[_0xbc96f5(0x120)],undefined)&&(_0x1a542e[_0xbc96f5(0x120)]=_0x31e1cc['clientIp']),createHash(_0x17daa4[_0xbc96f5(0x119)])['update'](JSON['stringify'](_0x1a542e))['digest'](_0xbc96f5(0x11d))['slice'](0x0,0xc);}function extractPort(_0x4d7527){const _0x5c8260=_0x376f92;try{return new URL(_0x4d7527)[_0x5c8260(0x10a)];}catch{return'';}}function sortObjectKeys(_0x1d6049){const _0x17bcf1=_0x376f92,_0x7c2186={};for(const _0x189498 of Object[_0x17bcf1(0xfc)](_0x1d6049)['sort']()){_0x7c2186[_0x189498]=_0x1d6049[_0x189498];}return _0x7c2186;}export function getSessionCachePath(_0x36bed6,_0xa77ad5){const _0x386c0a=_0x376f92;return join(getRangerHomeDir(),'auth',_0x36bed6+'-'+_0xa77ad5+_0x386c0a(0x110));}export function getStorageStatePath(_0x618d83){const _0x1db25d=_0x376f92;return _0x618d83[_0x1db25d(0x105)](/\.json$/,_0x1db25d(0x100));}function _0x76a8(){const _0x201e42=['newContext','userAgent','launchBrowser','784818EwBGzL','3Xnmjkg','toString','zisdG','environments','GgOGT','sessionCheckPath','hex','.localhost','has','clientIp','length','1415tDwUYV','invalidateOn','test','sha256','defaultEnvironmentKey','31852YjtpZG','329weCXwz','yTHEt','stdout','Tpfgy','1404286wmJNxR','942GiiebK','602036ZoGRfj','keys','domain','domcontentloaded','11wIAaDA','.storageState.json','431736egxHxU','PGsOv','effectiveBaseUrl','newPage','replace','uFLFZ','1kmsvva','stdin','10ZpTJkB','port','setupHeaders','orgId','profileName','LtQmV','env','.json','296pNDWDK','PKqOS'];_0x76a8=function(){return _0x201e42;};return _0x76a8();}function _0x3046(_0x406883,_0x35b521){_0x406883=_0x406883-0xf8;const _0x76a837=_0x76a8();let _0x3046eb=_0x76a837[_0x406883];return _0x3046eb;}export function needsTunnel(_0x2e2062){const _0x300561=_0x376f92,_0x3dbe7={'DeLuu':'localhost','eAgTJ':function(_0xd3b71e,_0x532fbe){return _0xd3b71e===_0x532fbe;},'mByRK':'127.0.0.1','PKqOS':_0x300561(0x11e),'GgOGT':'localhost.'};let _0x562e07;try{_0x562e07=new URL(_0x2e2062)['hostname'];}catch{return![];}if(_0x562e07===_0x3dbe7['DeLuu']||_0x3dbe7['eAgTJ'](_0x562e07,_0x3dbe7['mByRK']))return!![];if(_0x562e07['endsWith'](_0x3dbe7[_0x300561(0x112)]))return!![];if(_0x562e07['includes'](_0x3dbe7[_0x300561(0x11b)]))return!![];return![];}export function hostnameOf(_0x51addc){return new URL(_0x51addc)['hostname'];}export function duplicateCookiesForDomains(_0x106ceb,_0x1471d2){const _0x1f646c=_0x376f92,_0x32c319={'kNkQc':function(_0x5df850,_0x422cab){return _0x5df850(_0x422cab);}},_0x427d90=[..._0x106ceb],_0x5ba39b=new Set(_0x106ceb['map'](_0x50f68e=>_0x50f68e[_0x1f646c(0xfd)]));for(const _0x4f8f34 of _0x1471d2){let _0x37af13;try{_0x37af13=_0x32c319['kNkQc'](hostnameOf,_0x4f8f34);}catch{continue;}if(!_0x37af13)continue;const _0x33a86c=_0x37af13['startsWith']('.')?_0x37af13:'.'+_0x37af13;if(_0x5ba39b['has'](_0x37af13)||_0x5ba39b[_0x1f646c(0x11f)](_0x33a86c))continue;for(const _0x545c65 of _0x106ceb){_0x427d90['push']({..._0x545c65,'domain':_0x33a86c});}_0x5ba39b['add'](_0x33a86c);}return _0x427d90;}export function resolveAuthEnvironmentLocally(_0x3065da,_0xa5b3c1){const _0x3f7286=_0x376f92,_0x2e4458={'PGsOv':function(_0x463670,_0x57e963){return _0x463670===_0x57e963;}},_0x9925c6=_0x3065da[_0x3f7286(0x11a)];if(_0xa5b3c1){const _0x2f2a1f=_0x9925c6[_0xa5b3c1];if(!_0x2f2a1f)return null;return{'key':_0xa5b3c1,..._0x2f2a1f};}if(_0x3065da['defaultEnvironmentKey']){const _0x21f69a=_0x9925c6[_0x3065da[_0x3f7286(0x126)]];if(!_0x21f69a)return null;return{'key':_0x3065da['defaultEnvironmentKey'],..._0x21f69a};}const _0x4790b=Object['keys'](_0x9925c6);if(_0x2e4458[_0x3f7286(0x102)](_0x4790b[_0x3f7286(0x121)],0x1)){const _0x11b270=_0x4790b[0x0];return{'key':_0x11b270,..._0x9925c6[_0x11b270]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x50c7e8,_0x1be41d){const _0x464a68=_0x376f92;try{if(_0x1be41d)return new URL(_0x1be41d,_0x50c7e8)[_0x464a68(0x118)]();return new URL(_0x50c7e8)[_0x464a68(0x118)]();}catch{return null;}}export function looksLikeLoginUrl(_0x318c8f){const _0x41b22c=_0x376f92;try{const _0xe98e6a=new URL(_0x318c8f);return LOGIN_URL_PATTERN[_0x41b22c(0x124)](_0xe98e6a['pathname']);}catch{return LOGIN_URL_PATTERN['test'](_0x318c8f);}}export async function isCachedSessionLive(_0xf2983c,_0x18563b,_0x255dae={},_0x4da016={}){const _0x4689fb=_0x376f92,_0x139736={'KpMmy':_0x4689fb(0xfe),'sqvGW':function(_0x469bb8,_0xf005fc){return _0x469bb8===_0xf005fc;}},_0x56e9f9=buildSessionCheckUrl(_0x18563b,_0x255dae[_0x4689fb(0x11c)]);if(!_0x56e9f9)return!![];if(!_0x4da016[_0x4689fb(0x115)])return!![];let _0x23c482=null;try{_0x23c482=await _0x4da016['launchBrowser']();const _0x5d7ba5=await _0x23c482[_0x4689fb(0x113)]({'storageState':_0xf2983c,'ignoreHTTPSErrors':!![],..._0x255dae[_0x4689fb(0x10b)]?{'extraHTTPHeaders':_0x255dae[_0x4689fb(0x10b)]}:{}}),_0x11c288=await _0x5d7ba5[_0x4689fb(0x104)](),_0x281265=await _0x11c288['goto'](_0x56e9f9,{'waitUntil':_0x139736['KpMmy'],'timeout':0x3a98}),_0x494d1e=_0x281265?.['status']();if(_0x494d1e===0x191||_0x139736['sqvGW'](_0x494d1e,0x193))return![];const _0xe7f25a=_0x11c288['url']();if(looksLikeLoginUrl(_0xe7f25a))return![];return!![];}catch{return![];}finally{if(_0x23c482)await _0x23c482['close']()['catch'](()=>{});}}
@@ -1 +1 @@
1
- const _0x3c9e4e=_0x2836;(function(_0x43043b,_0x150207){const _0x37430d=_0x2836,_0x570b93=_0x43043b();while(!![]){try{const _0x222fca=-parseInt(_0x37430d(0xde))/0x1+-parseInt(_0x37430d(0xe7))/0x2+parseInt(_0x37430d(0xdd))/0x3+parseInt(_0x37430d(0xe3))/0x4+parseInt(_0x37430d(0xe1))/0x5*(-parseInt(_0x37430d(0xe8))/0x6)+-parseInt(_0x37430d(0xda))/0x7*(-parseInt(_0x37430d(0xdf))/0x8)+-parseInt(_0x37430d(0xe2))/0x9*(-parseInt(_0x37430d(0xe0))/0xa);if(_0x222fca===_0x150207)break;else _0x570b93['push'](_0x570b93['shift']());}catch(_0x547625){_0x570b93['push'](_0x570b93['shift']());}}}(_0x1838,0x1b0a9));function _0x1838(){const _0x496bbb=['984CjMuRA','8890pREQCw','2430itUAXg','153EZIGTr','521344CfgMyx','setAuthTag','utf8','sha256','70562CBznBB','1782mlWpIE','update','ranger-auth-encryption','5852fJVguC','final','concat','643194fIAVwb','172291WAhRcc'];_0x1838=function(){return _0x496bbb;};return _0x1838();}import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';const ALGORITHM='aes-256-gcm',SALT=_0x3c9e4e(0xd9),KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;function _0x2836(_0x43091f,_0x57c951){_0x43091f=_0x43091f-0xd8;const _0x18387c=_0x1838();let _0x2836a6=_0x18387c[_0x43091f];return _0x2836a6;}export function deriveKey(_0x53d57f){const _0x27e5fd=_0x3c9e4e;return pbkdf2Sync(_0x53d57f,SALT,0x186a0,KEY_LENGTH,_0x27e5fd(0xe6));}export function encrypt(_0x383bb5,_0x2bd0e0){const _0x21a871=_0x3c9e4e,_0x569246={'yQkOu':function(_0x46b5f8,_0x1ddf5e){return _0x46b5f8(_0x1ddf5e);},'RFoUT':function(_0x1ca494,_0x133f44){return _0x1ca494(_0x133f44);},'KHIAp':function(_0x4da4c6,_0x4b6d83,_0x2fff7a,_0x5e5104){return _0x4da4c6(_0x4b6d83,_0x2fff7a,_0x5e5104);}},_0x4d22f5=_0x569246['yQkOu'](deriveKey,_0x2bd0e0),_0x464ec8=_0x569246['RFoUT'](randomBytes,IV_LENGTH),_0x5ee6c9=_0x569246['KHIAp'](createCipheriv,ALGORITHM,_0x4d22f5,_0x464ec8),_0x5da576=Buffer['concat']([_0x5ee6c9['update'](_0x383bb5,'utf8'),_0x5ee6c9[_0x21a871(0xdb)]()]),_0x1615a2=_0x5ee6c9['getAuthTag']();return Buffer[_0x21a871(0xdc)]([_0x464ec8,_0x1615a2,_0x5da576]);}export function decrypt(_0x3a2382,_0x542e0a){const _0x234dea=_0x3c9e4e,_0x4c86ce={'zKGxj':function(_0x3d52ac,_0x335212){return _0x3d52ac+_0x335212;}},_0x6bf0fa=deriveKey(_0x542e0a),_0x1ea763=_0x3a2382['subarray'](0x0,IV_LENGTH),_0x5e69b6=_0x3a2382['subarray'](IV_LENGTH,IV_LENGTH+TAG_LENGTH),_0x12e3d8=_0x3a2382['subarray'](_0x4c86ce['zKGxj'](IV_LENGTH,TAG_LENGTH)),_0x4b2115=createDecipheriv(ALGORITHM,_0x6bf0fa,_0x1ea763);return _0x4b2115[_0x234dea(0xe4)](_0x5e69b6),_0x4b2115[_0x234dea(0xd8)](_0x12e3d8)+_0x4b2115[_0x234dea(0xdb)](_0x234dea(0xe5));}
1
+ const _0x2b4720=_0x2bbc;(function(_0x487473,_0x2de85e){const _0x5b9aff=_0x2bbc,_0x12151d=_0x487473();while(!![]){try{const _0x4b8fa9=-parseInt(_0x5b9aff(0xfd))/0x1*(-parseInt(_0x5b9aff(0xf4))/0x2)+-parseInt(_0x5b9aff(0xfe))/0x3*(-parseInt(_0x5b9aff(0xfc))/0x4)+parseInt(_0x5b9aff(0xfb))/0x5*(parseInt(_0x5b9aff(0xf7))/0x6)+-parseInt(_0x5b9aff(0x103))/0x7*(-parseInt(_0x5b9aff(0x109))/0x8)+parseInt(_0x5b9aff(0x10b))/0x9*(-parseInt(_0x5b9aff(0x10c))/0xa)+-parseInt(_0x5b9aff(0xfa))/0xb+parseInt(_0x5b9aff(0x105))/0xc*(-parseInt(_0x5b9aff(0x10a))/0xd);if(_0x4b8fa9===_0x2de85e)break;else _0x12151d['push'](_0x12151d['shift']());}catch(_0x3fb9fb){_0x12151d['push'](_0x12151d['shift']());}}}(_0x45da,0xe275d));import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';const ALGORITHM=_0x2b4720(0x102),SALT='ranger-auth-encryption',KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;function _0x45da(){const _0x3e7bee=['6tUUDEU','subarray','Roxnj','1035782PiMVxQ','8240290HgZXap','160kugJTa','1012289SGdQIJ','88755qaCpPl','getAuthTag','setAuthTag','iFlJY','aes-256-gcm','14ayBEiV','WYdul','28355340HoVRwD','gfpUa','FjFei','SkSlP','2879704qJVMHv','13DVmuPz','135AcMeYL','785990ogXbMR','qpMaM','2wcmjrB','vlzHv','final'];_0x45da=function(){return _0x3e7bee;};return _0x45da();}export function deriveKey(_0x11a6eb){const _0x37e667=_0x2b4720,_0x1cecb1={'iFlJY':'sha256'};return pbkdf2Sync(_0x11a6eb,SALT,0x186a0,KEY_LENGTH,_0x1cecb1[_0x37e667(0x101)]);}export function encrypt(_0x429bb9,_0x13e2c2){const _0x7712e8=_0x2b4720,_0xfbda65={'gfpUa':function(_0x3c8085,_0x48f557){return _0x3c8085(_0x48f557);},'qpMaM':function(_0x5b5502,_0x32e8c0){return _0x5b5502(_0x32e8c0);},'Roxnj':'utf8'},_0x552507=_0xfbda65[_0x7712e8(0x106)](deriveKey,_0x13e2c2),_0x3b2222=_0xfbda65[_0x7712e8(0x10d)](randomBytes,IV_LENGTH),_0x4e831f=createCipheriv(ALGORITHM,_0x552507,_0x3b2222),_0x256fe1=Buffer['concat']([_0x4e831f['update'](_0x429bb9,_0xfbda65[_0x7712e8(0xf9)]),_0x4e831f[_0x7712e8(0xf6)]()]),_0x20233c=_0x4e831f[_0x7712e8(0xff)]();return Buffer['concat']([_0x3b2222,_0x20233c,_0x256fe1]);}function _0x2bbc(_0x301e46,_0x28f303){_0x301e46=_0x301e46-0xf4;const _0x45da81=_0x45da();let _0x2bbcf2=_0x45da81[_0x301e46];return _0x2bbcf2;}export function decrypt(_0x3ef170,_0x7198c1){const _0x6edf01=_0x2b4720,_0x35f2b1={'WYdul':function(_0x4c5637,_0x31f4cc){return _0x4c5637(_0x31f4cc);},'FjFei':function(_0x2c1252,_0x29b855){return _0x2c1252+_0x29b855;},'YmbCx':function(_0x5c3c59,_0xcd9004,_0x79ed6b,_0x577989){return _0x5c3c59(_0xcd9004,_0x79ed6b,_0x577989);},'SkSlP':function(_0x13c314,_0x5728ea){return _0x13c314+_0x5728ea;},'vlzHv':'utf8'},_0x5f358b=_0x35f2b1[_0x6edf01(0x104)](deriveKey,_0x7198c1),_0x51305b=_0x3ef170[_0x6edf01(0xf8)](0x0,IV_LENGTH),_0xc2fba6=_0x3ef170[_0x6edf01(0xf8)](IV_LENGTH,_0x35f2b1[_0x6edf01(0x107)](IV_LENGTH,TAG_LENGTH)),_0x2b8e87=_0x3ef170['subarray'](IV_LENGTH+TAG_LENGTH),_0x118731=_0x35f2b1['YmbCx'](createDecipheriv,ALGORITHM,_0x5f358b,_0x51305b);return _0x118731[_0x6edf01(0x100)](_0xc2fba6),_0x35f2b1[_0x6edf01(0x108)](_0x118731['update'](_0x2b8e87),_0x118731['final'](_0x35f2b1[_0x6edf01(0xf5)]));}
@@ -1 +1 @@
1
- function _0x2bb9(){const _0x4fb6b6=['--apikey','push','split','698224bzxETu','CvNtn','211171WYaiwv','1648038FBiCbz','has','errorType','Invalid\x20values','test','mRmCE','RRdJX','--header','startsWith','26094SBHUaH','stringify','Unknown\x20argument','[desire-path]\x20Failed\x20to\x20send:\x20','[REDACTED]','--token','some','metadata','Bearer\x20','SLVZo','--password','fdKZC','795822POgJxp','/api/v1/mcp/desire-path-logs','missing_required_argument','join','toLowerCase','14745XnzaEa','error','includes','39JXbEUv','--credentials','unknown_command','[desire-path]\x20Sending\x20log\x20to\x20','[desire-path]\x20Payload:\x20','fciuE','missing_option','BVXrc','2369208PYtYfV','Unknown\x20command','POST','stdout'];_0x2bb9=function(){return _0x4fb6b6;};return _0x2bb9();}const _0x542c4f=_0x3eb6;(function(_0x116460,_0x26069d){const _0x173936=_0x3eb6,_0x512b32=_0x116460();while(!![]){try{const _0x58235c=parseInt(_0x173936(0xe7))/0x1+parseInt(_0x173936(0xf1))/0x2*(parseInt(_0x173936(0x105))/0x3)+-parseInt(_0x173936(0xe5))/0x4+-parseInt(_0x173936(0x102))/0x5+-parseInt(_0x173936(0xfd))/0x6+-parseInt(_0x173936(0xe8))/0x7+parseInt(_0x173936(0xde))/0x8;if(_0x58235c===_0x26069d)break;else _0x512b32['push'](_0x512b32['shift']());}catch(_0x14869e){_0x512b32['push'](_0x512b32['shift']());}}}(_0x2bb9,0x2011d));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set([_0x542c4f(0xf6),'-t','--secret','--api-key',_0x542c4f(0xe2),'--key',_0x542c4f(0xfb),'--pass','--auth','--authorization',_0x542c4f(0xef),'--cookie',_0x542c4f(0x106)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0x1106ff){const _0x35c604=_0x542c4f;return TOKEN_PATTERNS[_0x35c604(0xf7)](_0x1d85f3=>_0x1d85f3[_0x35c604(0xec)](_0x1106ff));}export function sanitizeArgs(_0x1a14e8){const _0x2bd26e=_0x542c4f,_0x4b5343={'CUpke':function(_0x1eb522,_0x479c66){return _0x1eb522<_0x479c66;},'eNECF':function(_0xa3d6f,_0x2018be){return _0xa3d6f(_0x2018be);},'OdvGN':_0x2bd26e(0xf5)},_0x411d79=[];let _0x3d3e71=![];for(let _0x4f53c6=0x0;_0x4b5343['CUpke'](_0x4f53c6,_0x1a14e8['length']);_0x4f53c6++){const _0x347898=_0x1a14e8[_0x4f53c6];if(_0x3d3e71){_0x411d79['push']('[REDACTED]'),_0x3d3e71=![];continue;}if(_0x347898[_0x2bd26e(0xf0)]('--')||_0x347898[_0x2bd26e(0xf0)]('-')){const _0x23aa9e=_0x347898['indexOf']('=');if(_0x23aa9e!==-0x1){const _0xa23671=_0x347898['slice'](0x0,_0x23aa9e)['toLowerCase']();if(SENSITIVE_FLAGS[_0x2bd26e(0xe9)](_0xa23671)){_0x411d79['push'](_0x347898['slice'](0x0,_0x23aa9e)+'=[REDACTED]');continue;}}else{const _0x332220=_0x347898[_0x2bd26e(0x101)]();SENSITIVE_FLAGS[_0x2bd26e(0xe9)](_0x332220)&&(_0x3d3e71=!![]);}_0x411d79[_0x2bd26e(0xe3)](_0x347898);}else _0x4b5343['eNECF'](looksLikeToken,_0x347898)?_0x411d79[_0x2bd26e(0xe3)](_0x4b5343['OdvGN']):_0x411d79['push'](_0x347898);}return _0x411d79[_0x2bd26e(0x100)]('\x20');}export async function logDesirePath(_0x3b502a){const _0x5d5a30=_0x542c4f,_0x1377eb={'SLVZo':function(_0x1c0c82){return _0x1c0c82();},'RRdJX':function(_0x538835){return _0x538835();},'PWnCH':'has_token','WUVjg':'application/json','AIMEm':'Authorization','vezgO':function(_0x351737,_0x2c8e4c,_0xa1e160){return _0x351737(_0x2c8e4c,_0xa1e160);}};try{const _0x239749=await _0x1377eb[_0x5d5a30(0xfa)](getToken)['catch'](()=>null),_0x5be27b=_0x1377eb[_0x5d5a30(0xee)](getApiBaseUrl),_0x3901cd=getCurrentVersion(),_0x47ac68=_0x239749?_0x1377eb['PWnCH']:'no_token',_0x3c0601={..._0x3b502a[_0x5d5a30(0xf8)],'authStatus':_0x47ac68,'isTty':process[_0x5d5a30(0xe1)]['isTTY']??![]},_0x433ad5={'Content-Type':_0x1377eb['WUVjg']};_0x239749&&(_0x433ad5[_0x1377eb['AIMEm']]=_0x5d5a30(0xf9)+_0x239749);const _0x327d72={'rawCommand':_0x3b502a['rawCommand'],'errorMessage':_0x3b502a['errorMessage'],'errorType':_0x3b502a[_0x5d5a30(0xea)],'featureId':_0x3b502a['featureId'],'sessionId':_0x3b502a['sessionId'],'metadata':_0x3c0601,'cliVersion':_0x3901cd};process['env']['DEBUG']&&(console['error'](_0x5d5a30(0x108)+_0x5be27b+_0x5d5a30(0xfe)),console[_0x5d5a30(0x103)](_0x5d5a30(0x109)+JSON['stringify'](_0x327d72,null,0x2))),await _0x1377eb['vezgO'](fetch,_0x5be27b+'/api/v1/mcp/desire-path-logs',{'method':_0x5d5a30(0xe0),'headers':_0x433ad5,'body':JSON[_0x5d5a30(0xf2)](_0x327d72)});}catch(_0x4bfb78){process['env']['DEBUG']&&console[_0x5d5a30(0x103)](_0x5d5a30(0xf4)+_0x4bfb78);}}function _0x3eb6(_0x5d3eed,_0x20f538){_0x5d3eed=_0x5d3eed-0xdc;const _0x2bb911=_0x2bb9();let _0x3eb6b3=_0x2bb911[_0x5d3eed];return _0x3eb6b3;}export function getErrorType(_0x5b106a,_0x137fcc){const _0x47ccc1=_0x542c4f,_0x3de3c3={'fdKZC':'3|7|1|5|6|0|4|2','fciuE':_0x47ccc1(0xeb),'ZrBbW':'invalid_option_value','DUenT':'runtime_error','LkDdQ':'Missing\x20required\x20argument','WdBpG':_0x47ccc1(0xf3),'BVXrc':'unknown_argument','CvNtn':_0x47ccc1(0xff),'mRmCE':'unknown'},_0x67511f=_0x3de3c3[_0x47ccc1(0xfc)][_0x47ccc1(0xe4)]('|');let _0x24af0e=0x0;while(!![]){switch(_0x67511f[_0x24af0e++]){case'0':if(_0x5b106a['includes'](_0x3de3c3[_0x47ccc1(0x10a)]))return _0x3de3c3['ZrBbW'];continue;case'1':if(_0x5b106a['includes'](_0x47ccc1(0xdf)))return _0x47ccc1(0x107);continue;case'2':return'syntax_error';case'3':if(_0x137fcc)return _0x3de3c3['DUenT'];continue;case'4':if(_0x5b106a[_0x47ccc1(0x104)](_0x3de3c3['LkDdQ']))return _0x47ccc1(0xdc);continue;case'5':if(_0x5b106a[_0x47ccc1(0x104)](_0x3de3c3['WdBpG']))return _0x3de3c3[_0x47ccc1(0xdd)];continue;case'6':if(_0x5b106a['includes']('Not\x20enough\x20non-option\x20arguments'))return _0x3de3c3[_0x47ccc1(0xe6)];continue;case'7':if(!_0x5b106a)return _0x3de3c3[_0x47ccc1(0xed)];continue;}break;}}
1
+ const _0x33aa9c=_0x4eca;(function(_0x13112d,_0x148d7d){const _0x2576da=_0x4eca,_0x5823ac=_0x13112d();while(!![]){try{const _0x51d8f4=parseInt(_0x2576da(0x116))/0x1*(parseInt(_0x2576da(0x108))/0x2)+-parseInt(_0x2576da(0x119))/0x3+parseInt(_0x2576da(0x12b))/0x4+-parseInt(_0x2576da(0x12c))/0x5+-parseInt(_0x2576da(0x104))/0x6*(-parseInt(_0x2576da(0x11e))/0x7)+parseInt(_0x2576da(0x107))/0x8*(parseInt(_0x2576da(0x12e))/0x9)+-parseInt(_0x2576da(0x105))/0xa;if(_0x51d8f4===_0x148d7d)break;else _0x5823ac['push'](_0x5823ac['shift']());}catch(_0x19bd5b){_0x5823ac['push'](_0x5823ac['shift']());}}}(_0x5290,0xc74a2));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set(['--token','-t','--secret','--api-key',_0x33aa9c(0x123),_0x33aa9c(0x118),'--password','--pass',_0x33aa9c(0x126),'--authorization','--header',_0x33aa9c(0x10e),_0x33aa9c(0x11f)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function _0x4eca(_0x14faba,_0x4dd1d2){_0x14faba=_0x14faba-0x103;const _0x52906a=_0x5290();let _0x4ecaa5=_0x52906a[_0x14faba];return _0x4ecaa5;}function looksLikeToken(_0x4f9af6){const _0x5559d3=_0x33aa9c;return TOKEN_PATTERNS['some'](_0x27cd96=>_0x27cd96[_0x5559d3(0x124)](_0x4f9af6));}export function sanitizeArgs(_0x1dab6a){const _0xa1e0af=_0x33aa9c,_0x48f8aa={'vCJlJ':function(_0x4db9f7,_0xb7390f){return _0x4db9f7!==_0xb7390f;},'hEdVP':_0xa1e0af(0x110)},_0x74df51=[];let _0x1b0c37=![];for(let _0xa4dde0=0x0;_0xa4dde0<_0x1dab6a['length'];_0xa4dde0++){const _0x239f66=_0x1dab6a[_0xa4dde0];if(_0x1b0c37){_0x74df51['push']('[REDACTED]'),_0x1b0c37=![];continue;}if(_0x239f66[_0xa1e0af(0x10b)]('--')||_0x239f66['startsWith']('-')){const _0x466695=_0x239f66[_0xa1e0af(0x128)]('=');if(_0x48f8aa[_0xa1e0af(0x114)](_0x466695,-0x1)){const _0x1c2c2b=_0x239f66['slice'](0x0,_0x466695)['toLowerCase']();if(SENSITIVE_FLAGS['has'](_0x1c2c2b)){_0x74df51[_0xa1e0af(0x12f)](_0x239f66['slice'](0x0,_0x466695)+_0xa1e0af(0x11d));continue;}}else{const _0x73761a=_0x239f66[_0xa1e0af(0x12a)]();SENSITIVE_FLAGS[_0xa1e0af(0x112)](_0x73761a)&&(_0x1b0c37=!![]);}_0x74df51['push'](_0x239f66);}else looksLikeToken(_0x239f66)?_0x74df51['push'](_0x48f8aa[_0xa1e0af(0x120)]):_0x74df51['push'](_0x239f66);}return _0x74df51['join']('\x20');}export async function logDesirePath(_0x8cb51f){const _0x4d2eb8=_0x33aa9c,_0x4fdb6f={'lOLLm':function(_0x388d68){return _0x388d68();},'DSqbC':'has_token','YHVcq':_0x4d2eb8(0x10a),'rIRvB':'Authorization'};try{const _0x1e59a2=await getToken()['catch'](()=>null),_0x28214f=getApiBaseUrl(),_0x620abd=_0x4fdb6f['lOLLm'](getCurrentVersion),_0xeb172e=_0x1e59a2?_0x4fdb6f[_0x4d2eb8(0x10c)]:_0x4d2eb8(0x122),_0x2d07c9={..._0x8cb51f['metadata'],'authStatus':_0xeb172e,'isTty':process['stdout']['isTTY']??![]},_0x28a201={'Content-Type':_0x4fdb6f['YHVcq']};_0x1e59a2&&(_0x28a201[_0x4fdb6f['rIRvB']]='Bearer\x20'+_0x1e59a2);const _0x23a7a4={'rawCommand':_0x8cb51f['rawCommand'],'errorMessage':_0x8cb51f['errorMessage'],'errorType':_0x8cb51f[_0x4d2eb8(0x121)],'featureId':_0x8cb51f['featureId'],'sessionId':_0x8cb51f['sessionId'],'metadata':_0x2d07c9,'cliVersion':_0x620abd};process['env'][_0x4d2eb8(0x11c)]&&(console[_0x4d2eb8(0x11b)]('[desire-path]\x20Sending\x20log\x20to\x20'+_0x28214f+_0x4d2eb8(0x125)),console['error']('[desire-path]\x20Payload:\x20'+JSON[_0x4d2eb8(0x130)](_0x23a7a4,null,0x2))),await fetch(_0x28214f+_0x4d2eb8(0x125),{'method':_0x4d2eb8(0x103),'headers':_0x28a201,'body':JSON['stringify'](_0x23a7a4)});}catch(_0x5dac9c){process['env'][_0x4d2eb8(0x11c)]&&console['error']('[desire-path]\x20Failed\x20to\x20send:\x20'+_0x5dac9c);}}export function getErrorType(_0x574fd7,_0xf6df80){const _0x32766d=_0x33aa9c,_0x475f86={'RmUba':'unknown','OzTCv':_0x32766d(0x10f),'Imhwl':_0x32766d(0x127),'loKCJ':'unknown_argument','oTqtx':_0x32766d(0x12d),'CIqTt':_0x32766d(0x106),'uNobU':'missing_option','JZkql':'syntax_error'};if(_0xf6df80)return'runtime_error';if(!_0x574fd7)return _0x475f86[_0x32766d(0x11a)];if(_0x574fd7[_0x32766d(0x115)](_0x32766d(0x111)))return _0x475f86['OzTCv'];if(_0x574fd7['includes'](_0x475f86[_0x32766d(0x117)]))return _0x475f86['loKCJ'];if(_0x574fd7[_0x32766d(0x115)]('Not\x20enough\x20non-option\x20arguments'))return _0x475f86[_0x32766d(0x129)];if(_0x574fd7['includes'](_0x475f86[_0x32766d(0x113)]))return'invalid_option_value';if(_0x574fd7['includes'](_0x32766d(0x10d)))return _0x475f86['uNobU'];return _0x475f86[_0x32766d(0x109)];}function _0x5290(){const _0x396667=['DEBUG','=[REDACTED]','364KDVowG','--credentials','hEdVP','errorType','no_token','--apikey','test','/api/v1/mcp/desire-path-logs','--auth','Unknown\x20argument','indexOf','oTqtx','toLowerCase','567216NKBhjS','2781860ulqYCA','missing_required_argument','8603343PsIaZv','push','stringify','POST','79782vVzJIe','13879270bJSdQo','Invalid\x20values','8wkMGdE','2iyNvOT','JZkql','application/json','startsWith','DSqbC','Missing\x20required\x20argument','--cookie','unknown_command','[REDACTED]','Unknown\x20command','has','CIqTt','vCJlJ','includes','1410122OsWWVd','Imhwl','--key','1316124bzCcpF','RmUba','error'];_0x5290=function(){return _0x396667;};return _0x5290();}
@@ -1 +1 @@
1
- const _0x5dd3d8=_0x1157;(function(_0x5ac544,_0x5c856b){const _0x50c739=_0x1157,_0x5f347f=_0x5ac544();while(!![]){try{const _0x40d814=-parseInt(_0x50c739(0x137))/0x1+-parseInt(_0x50c739(0x138))/0x2+parseInt(_0x50c739(0x152))/0x3+-parseInt(_0x50c739(0x164))/0x4*(parseInt(_0x50c739(0x165))/0x5)+-parseInt(_0x50c739(0x121))/0x6+-parseInt(_0x50c739(0x139))/0x7*(-parseInt(_0x50c739(0x148))/0x8)+parseInt(_0x50c739(0x131))/0x9;if(_0x40d814===_0x5c856b)break;else _0x5f347f['push'](_0x5f347f['shift']());}catch(_0x237382){_0x5f347f['push'](_0x5f347f['shift']());}}}(_0x43ea,0x4ecdc));import{spawn}from'child_process';import _0x4d586a from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';function _0x1157(_0x345277,_0x1164f2){_0x345277=_0x345277-0x114;const _0x43ea60=_0x43ea();let _0x1157f2=_0x43ea60[_0x345277];return _0x1157f2;}import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL='https://api.workos.com/user_management/authorize/device',WORKOS_TOKEN_URL=_0x5dd3d8(0x120);export async function requestDeviceCode(_0x49f8fc){const _0x17cb70=_0x5dd3d8,_0x5af82d={'XFLhF':function(_0x1fe055,_0x377601,_0x1b2920){return _0x1fe055(_0x377601,_0x1b2920);},'cXZzI':'POST','gAuWr':_0x17cb70(0x149)},_0x45513a=await _0x5af82d['XFLhF'](fetch,WORKOS_DEVICE_AUTH_URL,{'method':_0x5af82d[_0x17cb70(0x12c)],'headers':{'Content-Type':_0x5af82d['gAuWr']},'body':new URLSearchParams({'client_id':_0x49f8fc})});if(!_0x45513a['ok']){const _0x4f8cd4=await _0x45513a[_0x17cb70(0x145)]();throw new Error(_0x17cb70(0x123)+_0x45513a[_0x17cb70(0x132)]+'\x20'+_0x4f8cd4);}return _0x45513a['json']();}export async function pollForTokens(_0x62b62b,_0x594afc,_0x4dca17,_0x47253b){const _0x44ba35=_0x5dd3d8,_0x2be4a0={'KuNHP':function(_0x4dc056,_0x101b03){return _0x4dc056*_0x101b03;},'XOGPN':function(_0xae239,_0x201f45){return _0xae239(_0x201f45);},'kCGIW':function(_0x2f6fee,_0x513cac,_0x2314a3){return _0x2f6fee(_0x513cac,_0x2314a3);},'LHeTw':'POST','NDOMh':function(_0x18ac63,_0x209108){return _0x18ac63===_0x209108;},'NmlBV':'authorization_pending'},_0x526c65=Date['now']()+_0x2be4a0[_0x44ba35(0x150)](_0x47253b,0x3e8);let _0x2c0706=_0x4dca17*0x3e8;while(Date['now']()<_0x526c65){await _0x2be4a0['XOGPN'](sleep,_0x2c0706);const _0x5d8d47=await _0x2be4a0['kCGIW'](fetch,WORKOS_TOKEN_URL,{'method':_0x2be4a0[_0x44ba35(0x126)],'headers':{'Content-Type':_0x44ba35(0x149)},'body':new URLSearchParams({'client_id':_0x62b62b,'device_code':_0x594afc,'grant_type':'urn:ietf:params:oauth:grant-type:device_code'})});if(_0x5d8d47['ok'])return _0x5d8d47[_0x44ba35(0x133)]();const _0x269fb3=await _0x5d8d47[_0x44ba35(0x133)]();if(_0x2be4a0[_0x44ba35(0x114)](_0x269fb3['error'],_0x2be4a0['NmlBV']))continue;if(_0x269fb3['error']===_0x44ba35(0x122)){_0x2c0706+=0x3e8;continue;}throw new Error(_0x269fb3[_0x44ba35(0x15c)]||_0x269fb3[_0x44ba35(0x130)]||_0x44ba35(0x119));}throw new Error('Device\x20authorization\x20timed\x20out');}async function fetchUserProfile(_0x5afa6f){const _0x21be99=_0x5dd3d8,_0x5a6a86={'hzFHJ':function(_0x3a1a9e,_0xf1a23d,_0x47cda4){return _0x3a1a9e(_0xf1a23d,_0x47cda4);}},_0x32ff10=getApiBaseUrl();try{const _0x3691b7=await _0x5a6a86['hzFHJ'](fetch,_0x32ff10+_0x21be99(0x11a),{'method':'GET','headers':{'workos-token':_0x5afa6f}});if(_0x3691b7['ok'])return _0x3691b7[_0x21be99(0x133)]();}catch{}return null;}function buildKeyName(_0x38beea,_0x106361){const _0xe04e58=_0x5dd3d8,_0x432384={'OgkfH':function(_0x15ead5,_0xa133ee){return _0x15ead5===_0xa133ee;},'Pmots':function(_0x4d8a9f,_0x3a68b7){return _0x4d8a9f+_0x3a68b7;}},_0x545a39=_0x106361['filter'](_0xe58a45=>_0xe58a45['name']===_0x38beea||_0xe58a45[_0xe04e58(0x155)][_0xe04e58(0x15f)](_0x38beea+'\x20('));if(_0x432384['OgkfH'](_0x545a39['length'],0x0))return _0x38beea;return _0x38beea+'\x20('+_0x432384[_0xe04e58(0x153)](_0x545a39[_0xe04e58(0x11e)],0x1)+')';}export async function provisionApiKey(_0x37b276){const _0x32edd2=_0x5dd3d8,_0x4ad837={'dUCDE':function(_0x4ba85d){return _0x4ba85d();},'bbcLy':function(_0x2be68b,_0xcfdda){return _0x2be68b(_0xcfdda);},'HyinJ':'CLI\x20Key','XSxLt':function(_0x4364fd,_0x16fb61,_0x14e63d){return _0x4364fd(_0x16fb61,_0x14e63d);},'WdhzV':_0x32edd2(0x147),'gLLuP':'POST','ZCUKC':_0x32edd2(0x13d)},_0x220be2=_0x4ad837['dUCDE'](getApiBaseUrl),_0x49bfbe={'Content-Type':'application/json','workos-token':_0x37b276},_0x55f5c0=await _0x4ad837[_0x32edd2(0x159)](fetchUserProfile,_0x37b276),_0x4090e6=_0x55f5c0?.['firstName']||_0x55f5c0?.['email']?.[_0x32edd2(0x15d)]('@')[0x0],_0x10ef8b=_0x4090e6?_0x4090e6+_0x32edd2(0x13f):_0x4ad837['HyinJ'];let _0x12e4f7=[];try{const _0x30555e=await _0x4ad837['XSxLt'](fetch,_0x220be2+_0x32edd2(0x146),{'method':_0x4ad837['WdhzV'],'headers':_0x49bfbe});if(_0x30555e['ok']){const _0x47581c=await _0x30555e['json']();_0x12e4f7=_0x47581c['apiKeys'];}}catch{}const _0x540c20=_0x4ad837[_0x32edd2(0x140)](buildKeyName,_0x10ef8b,_0x12e4f7),_0x532915=await _0x4ad837['XSxLt'](fetch,_0x220be2+_0x32edd2(0x146),{'method':_0x4ad837[_0x32edd2(0x157)],'headers':_0x49bfbe,'body':JSON['stringify']({'name':_0x540c20,'scope':_0x4ad837[_0x32edd2(0x166)]})});if(!_0x532915['ok']){const _0x4fa79b=await _0x532915[_0x32edd2(0x145)]();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x532915['status']+'\x20'+_0x4fa79b);}const _0x4026d8=await _0x532915['json']();return _0x4026d8['apiKey']['token'];}export function openBrowser(_0x295845){const _0x5b3fa7=_0x5dd3d8,_0x35741e={'aRqrM':function(_0x3e43de,_0x38c603){return _0x3e43de===_0x38c603;},'pfwIn':function(_0x4faa7d,_0x1e1a27,_0x1a80de,_0x53beed){return _0x4faa7d(_0x1e1a27,_0x1a80de,_0x53beed);},'dKDgw':_0x5b3fa7(0x124),'UdqGh':function(_0x5550d7,_0x308257){return _0x5550d7===_0x308257;},'qQfIs':'darwin','Ndicq':'open','MmAzD':function(_0x4d414a,_0x144e04,_0x2cfb8f,_0x2a30b0){return _0x4d414a(_0x144e04,_0x2cfb8f,_0x2a30b0);},'RzDXw':_0x5b3fa7(0x136)};try{if(_0x35741e['aRqrM'](process[_0x5b3fa7(0x13a)],'win32')){const _0xc678d6=_0x35741e['pfwIn'](spawn,_0x35741e[_0x5b3fa7(0x128)],['/c','start','',_0x295845],{'detached':!![],'stdio':_0x5b3fa7(0x136),'windowsHide':!![]});_0xc678d6['unref']();return;}const _0x4da073=_0x35741e[_0x5b3fa7(0x12e)](process['platform'],_0x35741e[_0x5b3fa7(0x11f)])?_0x35741e[_0x5b3fa7(0x12a)]:'xdg-open',_0x2127f2=_0x35741e['MmAzD'](spawn,_0x4da073,[_0x295845],{'detached':!![],'stdio':_0x35741e[_0x5b3fa7(0x13e)]});_0x2127f2['unref']();}catch{}}function decodeJwtPayload(_0x467eb8){const _0x2bde53=_0x5dd3d8,_0x3c7229={'ohQQL':_0x2bde53(0x117)},_0x4da1a7=_0x467eb8[_0x2bde53(0x15d)]('.');if(_0x4da1a7[_0x2bde53(0x11e)]!==0x3)throw new Error(_0x3c7229[_0x2bde53(0x144)]);const _0x8ae6a=Buffer[_0x2bde53(0x13c)](_0x4da1a7[0x1],'base64url')['toString'](_0x2bde53(0x161));return JSON[_0x2bde53(0x14a)](_0x8ae6a);}async function selfServeSignup(_0x11f384){const _0x35de08=_0x5dd3d8,_0x43f745=getApiBaseUrl(),_0x2aab25=await fetch(_0x43f745+_0x35de08(0x143),{'method':_0x35de08(0x14c),'headers':{'Content-Type':'application/json','workos-token':_0x11f384}});if(!_0x2aab25['ok']){const _0x2383ea=await _0x2aab25['text']();throw new Error(_0x35de08(0x156)+_0x2aab25['status']+'\x20'+_0x2383ea);}return _0x2aab25[_0x35de08(0x133)]();}async function fetchMyMemberships(_0x3a98d5){const _0xd3c9d8=_0x5dd3d8,_0x12d3da={'urMAD':function(_0x48ce55){return _0x48ce55();},'QqWzA':function(_0x3bcda9,_0x5213fe,_0x3645ac){return _0x3bcda9(_0x5213fe,_0x3645ac);}},_0x103559=_0x12d3da[_0xd3c9d8(0x154)](getApiBaseUrl),_0x50aa07=await _0x12d3da[_0xd3c9d8(0x11c)](fetch,_0x103559+'/organization/my-memberships',{'method':'GET','headers':{'workos-token':_0x3a98d5}});if(!_0x50aa07['ok']){const _0x390aa9=await _0x50aa07[_0xd3c9d8(0x145)]();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0x50aa07[_0xd3c9d8(0x132)]+'\x20'+_0x390aa9);}const _0x3a40e1=await _0x50aa07['json']();return _0x3a40e1[_0xd3c9d8(0x15b)];}async function refreshTokenWithOrg(_0x53adf1,_0x39e993,_0x33d705){const _0x3b2e00=_0x5dd3d8,_0x1867bf={'ldjic':'POST','UMNmx':'refresh_token'},_0x2a899f=await fetch(WORKOS_TOKEN_URL,{'method':_0x1867bf['ldjic'],'headers':{'Content-Type':_0x3b2e00(0x149)},'body':new URLSearchParams({'client_id':_0x53adf1,'grant_type':_0x1867bf['UMNmx'],'refresh_token':_0x39e993,'organization_id':_0x33d705})});if(!_0x2a899f['ok']){const _0x502647=await _0x2a899f[_0x3b2e00(0x145)]();throw new Error('Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'+_0x2a899f[_0x3b2e00(0x132)]+'\x20'+_0x502647);}return _0x2a899f['json']();}async function provisionCliToken(_0x26af5c){const _0x2eca45=_0x5dd3d8,_0x53fccd={'vdHEZ':function(_0xd4493b){return _0xd4493b();},'tLcxv':_0x2eca45(0x14c)},_0x5ef2c1=_0x53fccd[_0x2eca45(0x12b)](getApiBaseUrl),_0x2941c1=await fetch(_0x5ef2c1+'/cli-auth/token',{'method':_0x53fccd['tLcxv'],'headers':{'Content-Type':'application/json','workos-token':_0x26af5c}});if(!_0x2941c1['ok']){const _0x43038a=await _0x2941c1['text']();throw new Error(_0x2eca45(0x141)+_0x2941c1['status']+'\x20'+_0x43038a);}return _0x2941c1['json']();}export async function runDeviceAuthFlow(){const _0x1fe4bb=_0x5dd3d8,_0x45888e={'ZQcMF':function(_0x488dd6,_0x52b6ec){return _0x488dd6(_0x52b6ec);},'aaTWJ':function(_0x80c9da,_0x3ef140,_0x467118,_0x1af6dd,_0x243c58){return _0x80c9da(_0x3ef140,_0x467118,_0x1af6dd,_0x243c58);},'xqREH':'Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','TdAhp':'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','goNKp':_0x1fe4bb(0x13b),'VYboc':_0x1fe4bb(0x162),'XPugL':'Provisioning\x20CLI\x20token...','usGZJ':function(_0x2f1522,_0x4f9fd4){return _0x2f1522(_0x4f9fd4);}},_0x44d390=getCurrentEnvironment(),_0x1a4b8f=ENVIRONMENT_CONFIGS[_0x44d390][_0x1fe4bb(0x135)],_0x10fa66=await _0x45888e[_0x1fe4bb(0x15e)](requestDeviceCode,_0x1a4b8f);console['log'](_0x1fe4bb(0x129)),console['log'](_0x1fe4bb(0x163)),openBrowser(_0x10fa66[_0x1fe4bb(0x11b)]),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x10fa66[_0x1fe4bb(0x11b)]),console['log'](_0x1fe4bb(0x118)+_0x10fa66['user_code']+'\x0a'),process['stdout'][_0x1fe4bb(0x11d)]('Waiting\x20for\x20authentication...');let _0x25a761=await _0x45888e[_0x1fe4bb(0x142)](pollForTokens,_0x1a4b8f,_0x10fa66['device_code'],_0x10fa66['interval'],_0x10fa66[_0x1fe4bb(0x125)]);console['log']('\x20✓');const _0x2628e3=decodeJwtPayload(_0x25a761[_0x1fe4bb(0x14d)]);if(!_0x2628e3[_0x1fe4bb(0x158)]){const _0x31486e=await fetchMyMemberships(_0x25a761['access_token']);let _0x364e41;if(_0x31486e[_0x1fe4bb(0x11e)]===0x0){process['stdout']['write'](_0x1fe4bb(0x14b));const _0x40fdb4=await selfServeSignup(_0x25a761['access_token']);_0x364e41=_0x40fdb4[_0x1fe4bb(0x15a)],console[_0x1fe4bb(0x116)]('\x20✓');}else{if(_0x31486e[_0x1fe4bb(0x11e)]===0x1)_0x364e41=_0x31486e[0x0]['organizationId'],console['log']('Using\x20organization:\x20'+_0x31486e[0x0]['name']);else{const _0x3f3f11=process[_0x1fe4bb(0x115)][_0x1fe4bb(0x160)]&&process[_0x1fe4bb(0x14e)]['isTTY'];if(!_0x3f3f11)throw new Error(_0x45888e[_0x1fe4bb(0x12d)]+_0x45888e[_0x1fe4bb(0x14f)]);const {selected:_0xcaa6b4}=await _0x4d586a['prompt']([{'type':'list','name':_0x45888e[_0x1fe4bb(0x12f)],'message':_0x45888e['VYboc'],'choices':_0x31486e['map'](_0x1d87f9=>({'name':_0x1d87f9['name'],'value':_0x1d87f9[_0x1fe4bb(0x15a)]}))}]);_0x364e41=_0xcaa6b4;}}_0x25a761=await refreshTokenWithOrg(_0x1a4b8f,_0x25a761['refresh_token'],_0x364e41);}process[_0x1fe4bb(0x14e)][_0x1fe4bb(0x11d)](_0x45888e[_0x1fe4bb(0x151)]);const _0x21aac4=await _0x45888e[_0x1fe4bb(0x15e)](provisionCliToken,_0x25a761[_0x1fe4bb(0x14d)]);return console['log']('\x20✓'),await _0x45888e['usGZJ'](storeToken,_0x21aac4[_0x1fe4bb(0x127)]),_0x25a761['refresh_token']&&await storeRefreshToken(_0x25a761[_0x1fe4bb(0x134)]),_0x21aac4['token'];}function _0x43ea(){const _0x5118c2=['160147vUZkIb','36816MquFhx','7qPwLcx','platform','selected','from','mcp:write','RzDXw','\x27s\x20CLI\x20Key','XSxLt','Failed\x20to\x20provision\x20CLI\x20token:\x20','aaTWJ','/organization/self-serve-signup','ohQQL','text','/api-keys','GET','2857808tlvLwA','application/x-www-form-urlencoded','parse','Setting\x20up\x20your\x20organization...','POST','access_token','stdout','TdAhp','KuNHP','XPugL','1228950jbySst','Pmots','urMAD','name','Failed\x20to\x20create\x20organization:\x20','gLLuP','org_id','bbcLy','organizationId','memberships','error_description','split','ZQcMF','startsWith','isTTY','utf-8','Select\x20an\x20organization:','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','2497564BLdFzR','5zdaaSN','ZCUKC','NDOMh','stdin','log','Invalid\x20JWT\x20format','Code:\x20','Authentication\x20failed','/organization/me','verification_uri_complete','QqWzA','write','length','qQfIs','https://api.workos.com/user_management/authenticate','343764bdinBq','slow_down','Failed\x20to\x20request\x20device\x20code:\x20','cmd','expires_in','LHeTw','token','dKDgw','\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','Ndicq','vdHEZ','cXZzI','xqREH','UdqGh','goNKp','error','3745296tucaJc','status','json','refresh_token','workosClientId','ignore'];_0x43ea=function(){return _0x5118c2;};return _0x43ea();}function sleep(_0x515122){return new Promise(_0x369b5c=>setTimeout(_0x369b5c,_0x515122));}
1
+ function _0xbfbc(_0x3d9c9a,_0x43174a){_0x3d9c9a=_0x3d9c9a-0x65;const _0x1b93a8=_0x1b93();let _0xbfbc3f=_0x1b93a8[_0x3d9c9a];return _0xbfbc3f;}const _0x40ab9a=_0xbfbc;(function(_0x2c0a02,_0xed5371){const _0x2a32b2=_0xbfbc,_0x181e41=_0x2c0a02();while(!![]){try{const _0x1f22a6=parseInt(_0x2a32b2(0xb0))/0x1+-parseInt(_0x2a32b2(0x91))/0x2+parseInt(_0x2a32b2(0x90))/0x3*(parseInt(_0x2a32b2(0xa8))/0x4)+-parseInt(_0x2a32b2(0x8a))/0x5+-parseInt(_0x2a32b2(0x79))/0x6+parseInt(_0x2a32b2(0x76))/0x7*(parseInt(_0x2a32b2(0xa9))/0x8)+parseInt(_0x2a32b2(0xa2))/0x9;if(_0x1f22a6===_0xed5371)break;else _0x181e41['push'](_0x181e41['shift']());}catch(_0x39a0bb){_0x181e41['push'](_0x181e41['shift']());}}}(_0x1b93,0x2f211));import{spawn}from'child_process';import _0x3a3130 from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL=_0x40ab9a(0xa5),WORKOS_TOKEN_URL=_0x40ab9a(0x81);function _0x1b93(){const _0x37f722=['hPgHU','jhfWV','Waiting\x20for\x20authentication...','map','MBylf','325906iybtRX','access_token','refresh_token','expires_in','MOZGg','stdin','Provisioning\x20CLI\x20token...','gIZTo','device_code','stringify','email','json','ZCqkH','unref','GET','base64url','xdg-open','gLxdY','now','Code:\x20','239603wcyHoY','nXmio','workosClientId','2283192Qjsqhr','text','CLI\x20Key','zjjbi','Setting\x20up\x20your\x20organization...','xmvvX','\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','filter','https://api.workos.com/user_management/authenticate','Invalid\x20JWT\x20format','/cli-auth/token','name','org_id','error','length','POST','Device\x20authorization\x20timed\x20out','1848590oPckiA','EGSXh','Failed\x20to\x20create\x20organization:\x20','Using\x20organization:\x20','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20','token','9jxZdDC','318416cFNuxl','organizationId','application/json','application/x-www-form-urlencoded','log','AzzRI','status','Authentication\x20failed','BLgGn','platform','list','Failed\x20to\x20fetch\x20memberships:\x20','/api-keys','/organization/me','CCuxF','darwin','write','1134135liDMfq','sLbYl','mGsOo','https://api.workos.com/user_management/authorize/device','stdout','/organization/self-serve-signup','365412ftBAWr','88voXxAD','interval'];_0x1b93=function(){return _0x37f722;};return _0x1b93();}export async function requestDeviceCode(_0x452db8){const _0x105711=_0x40ab9a,_0x5003e9={'ChZsm':_0x105711(0x88)},_0x285634=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x5003e9['ChZsm'],'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0x452db8})});if(!_0x285634['ok']){const _0x5aad4c=await _0x285634[_0x105711(0x7a)]();throw new Error('Failed\x20to\x20request\x20device\x20code:\x20'+_0x285634[_0x105711(0x97)]+'\x20'+_0x5aad4c);}return _0x285634['json']();}export async function pollForTokens(_0x2b108a,_0x1b9935,_0x31d645,_0x412861){const _0x237128=_0x40ab9a,_0x1f0d95={'uhfIQ':function(_0x29adb6,_0x104d8b){return _0x29adb6+_0x104d8b;},'kGNyF':function(_0x51bc94,_0x425d44){return _0x51bc94*_0x425d44;},'iEnuY':function(_0x5853d7,_0x1191ff){return _0x5853d7*_0x1191ff;},'eRZKj':function(_0x57573c,_0x83efab){return _0x57573c(_0x83efab);},'USFwN':function(_0x6f516,_0x46c246,_0x3a3f9f){return _0x6f516(_0x46c246,_0x3a3f9f);},'xNnTa':_0x237128(0x94),'nXmio':function(_0x2f50e6,_0x236e28){return _0x2f50e6===_0x236e28;},'BLgGn':'authorization_pending','hfFnq':_0x237128(0x98)},_0x33cffb=_0x1f0d95['uhfIQ'](Date[_0x237128(0x74)](),_0x1f0d95['kGNyF'](_0x412861,0x3e8));let _0x27bc9b=_0x1f0d95['iEnuY'](_0x31d645,0x3e8);while(Date[_0x237128(0x74)]()<_0x33cffb){await _0x1f0d95['eRZKj'](sleep,_0x27bc9b);const _0x22c774=await _0x1f0d95['USFwN'](fetch,WORKOS_TOKEN_URL,{'method':_0x237128(0x88),'headers':{'Content-Type':_0x1f0d95['xNnTa']},'body':new URLSearchParams({'client_id':_0x2b108a,'device_code':_0x1b9935,'grant_type':'urn:ietf:params:oauth:grant-type:device_code'})});if(_0x22c774['ok'])return _0x22c774['json']();const _0x534303=await _0x22c774['json']();if(_0x1f0d95['nXmio'](_0x534303[_0x237128(0x86)],_0x1f0d95[_0x237128(0x99)]))continue;if(_0x1f0d95[_0x237128(0x77)](_0x534303['error'],'slow_down')){_0x27bc9b+=0x3e8;continue;}throw new Error(_0x534303['error_description']||_0x534303['error']||_0x1f0d95['hfFnq']);}throw new Error(_0x237128(0x89));}async function fetchUserProfile(_0x1f8c70){const _0x593908=_0x40ab9a,_0x3c3033={'WBEUG':function(_0x44f32c){return _0x44f32c();}},_0x915f8d=_0x3c3033['WBEUG'](getApiBaseUrl);try{const _0x6c6a7e=await fetch(_0x915f8d+_0x593908(0x9e),{'method':'GET','headers':{'workos-token':_0x1f8c70}});if(_0x6c6a7e['ok'])return _0x6c6a7e['json']();}catch{}return null;}function buildKeyName(_0x1890d5,_0x20aa80){const _0x817b51=_0x40ab9a,_0x2f0f2b={'KWvnn':function(_0x110f3f,_0x2547bd){return _0x110f3f===_0x2547bd;},'MXJXm':function(_0x1be983,_0x5df1a3){return _0x1be983+_0x5df1a3;}},_0x12ae08=_0x20aa80[_0x817b51(0x80)](_0x5f13d=>_0x5f13d[_0x817b51(0x84)]===_0x1890d5||_0x5f13d['name']['startsWith'](_0x1890d5+'\x20('));if(_0x2f0f2b['KWvnn'](_0x12ae08['length'],0x0))return _0x1890d5;return _0x1890d5+'\x20('+_0x2f0f2b['MXJXm'](_0x12ae08['length'],0x1)+')';}export async function provisionApiKey(_0x4666f8){const _0x2b9c9c=_0x40ab9a,_0x5be967={'MBylf':_0x2b9c9c(0x93),'liZQn':'GET','xmvvX':function(_0x4b7907,_0x216a12,_0x2fb67a){return _0x4b7907(_0x216a12,_0x2fb67a);},'bSoTx':'mcp:write'},_0xca060=getApiBaseUrl(),_0x1f6bb4={'Content-Type':_0x5be967[_0x2b9c9c(0xaf)],'workos-token':_0x4666f8},_0x338f5d=await fetchUserProfile(_0x4666f8),_0xef2e1b=_0x338f5d?.['firstName']||_0x338f5d?.[_0x2b9c9c(0x6c)]?.['split']('@')[0x0],_0xdc296e=_0xef2e1b?_0xef2e1b+'\x27s\x20CLI\x20Key':_0x2b9c9c(0x7b);let _0xb25aa6=[];try{const _0x23deae=await fetch(_0xca060+'/api-keys',{'method':_0x5be967['liZQn'],'headers':_0x1f6bb4});if(_0x23deae['ok']){const _0x3ac311=await _0x23deae['json']();_0xb25aa6=_0x3ac311['apiKeys'];}}catch{}const _0x4abdae=_0x5be967[_0x2b9c9c(0x7e)](buildKeyName,_0xdc296e,_0xb25aa6),_0xa857b0=await fetch(_0xca060+_0x2b9c9c(0x9d),{'method':_0x2b9c9c(0x88),'headers':_0x1f6bb4,'body':JSON[_0x2b9c9c(0x6b)]({'name':_0x4abdae,'scope':_0x5be967['bSoTx']})});if(!_0xa857b0['ok']){const _0x2e5a1b=await _0xa857b0[_0x2b9c9c(0x7a)]();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0xa857b0['status']+'\x20'+_0x2e5a1b);}const _0x247c4f=await _0xa857b0['json']();return _0x247c4f['apiKey']['token'];}export function openBrowser(_0x505420){const _0x5932c4=_0x40ab9a,_0x46f63e={'zjjbi':function(_0x522485,_0x580d7c){return _0x522485===_0x580d7c;},'gLxdY':'ignore','VeYFW':_0x5932c4(0xa0),'sLbYl':_0x5932c4(0x72)};try{if(_0x46f63e[_0x5932c4(0x7c)](process[_0x5932c4(0x9a)],'win32')){const _0x12ec84=spawn('cmd',['/c','start','',_0x505420],{'detached':!![],'stdio':_0x46f63e['gLxdY'],'windowsHide':!![]});_0x12ec84[_0x5932c4(0x6f)]();return;}const _0x703584=_0x46f63e['zjjbi'](process[_0x5932c4(0x9a)],_0x46f63e['VeYFW'])?'open':_0x46f63e[_0x5932c4(0xa3)],_0x1852a4=spawn(_0x703584,[_0x505420],{'detached':!![],'stdio':_0x46f63e[_0x5932c4(0x73)]});_0x1852a4['unref']();}catch{}}function decodeJwtPayload(_0x3c049a){const _0x50f1a1=_0x40ab9a,_0x301658={'GOXip':function(_0x4ef102,_0x3ec6ed){return _0x4ef102!==_0x3ec6ed;},'hPgHU':_0x50f1a1(0x71),'ZCqkH':'utf-8'},_0x251bcf=_0x3c049a['split']('.');if(_0x301658['GOXip'](_0x251bcf[_0x50f1a1(0x87)],0x3))throw new Error(_0x50f1a1(0x82));const _0x2d959c=Buffer['from'](_0x251bcf[0x1],_0x301658[_0x50f1a1(0xab)])['toString'](_0x301658[_0x50f1a1(0x6e)]);return JSON['parse'](_0x2d959c);}async function selfServeSignup(_0x4832d4){const _0x542066=_0x40ab9a,_0x5b127c={'AzzRI':function(_0x5029d3,_0x8b11e9,_0x315c32){return _0x5029d3(_0x8b11e9,_0x315c32);},'jhfWV':_0x542066(0x88),'gcHSF':'application/json'},_0x441943=getApiBaseUrl(),_0x5d68eb=await _0x5b127c[_0x542066(0x96)](fetch,_0x441943+_0x542066(0xa7),{'method':_0x5b127c[_0x542066(0xac)],'headers':{'Content-Type':_0x5b127c['gcHSF'],'workos-token':_0x4832d4}});if(!_0x5d68eb['ok']){const _0x262cfb=await _0x5d68eb['text']();throw new Error(_0x542066(0x8c)+_0x5d68eb[_0x542066(0x97)]+'\x20'+_0x262cfb);}return _0x5d68eb[_0x542066(0x6d)]();}async function fetchMyMemberships(_0x138dc8){const _0x34c5c1=_0x40ab9a,_0x24ce2b={'vntlt':function(_0x418d24){return _0x418d24();},'GtHFA':function(_0x59fa62,_0xd06ab5,_0x92b1e2){return _0x59fa62(_0xd06ab5,_0x92b1e2);},'mGsOo':_0x34c5c1(0x70)},_0x45e74f=_0x24ce2b['vntlt'](getApiBaseUrl),_0x3a0d8b=await _0x24ce2b['GtHFA'](fetch,_0x45e74f+'/organization/my-memberships',{'method':_0x24ce2b[_0x34c5c1(0xa4)],'headers':{'workos-token':_0x138dc8}});if(!_0x3a0d8b['ok']){const _0x3a9062=await _0x3a0d8b['text']();throw new Error(_0x34c5c1(0x9c)+_0x3a0d8b[_0x34c5c1(0x97)]+'\x20'+_0x3a9062);}const _0x1278a5=await _0x3a0d8b[_0x34c5c1(0x6d)]();return _0x1278a5['memberships'];}async function refreshTokenWithOrg(_0x70b678,_0x22a2ff,_0x92eeb6){const _0x490565=_0x40ab9a,_0xcd0457={'XkhKB':function(_0x403b8e,_0x242aca,_0x1287d4){return _0x403b8e(_0x242aca,_0x1287d4);},'CCuxF':_0x490565(0x94)},_0x4ebf3a=await _0xcd0457['XkhKB'](fetch,WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':_0xcd0457[_0x490565(0x9f)]},'body':new URLSearchParams({'client_id':_0x70b678,'grant_type':_0x490565(0xb2),'refresh_token':_0x22a2ff,'organization_id':_0x92eeb6})});if(!_0x4ebf3a['ok']){const _0x5bf371=await _0x4ebf3a['text']();throw new Error(_0x490565(0x8e)+_0x4ebf3a[_0x490565(0x97)]+'\x20'+_0x5bf371);}return _0x4ebf3a[_0x490565(0x6d)]();}async function provisionCliToken(_0x3eb752){const _0xea5236=_0x40ab9a,_0x2da215={'fbkAu':function(_0x23d9ce){return _0x23d9ce();},'GjkFG':'POST'},_0x5d5057=_0x2da215['fbkAu'](getApiBaseUrl),_0x592cbb=await fetch(_0x5d5057+_0xea5236(0x83),{'method':_0x2da215['GjkFG'],'headers':{'Content-Type':'application/json','workos-token':_0x3eb752}});if(!_0x592cbb['ok']){const _0x859f67=await _0x592cbb['text']();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x592cbb[_0xea5236(0x97)]+'\x20'+_0x859f67);}return _0x592cbb['json']();}export async function runDeviceAuthFlow(){const _0xec8051=_0x40ab9a,_0x204155={'bbKEt':'\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','cinax':function(_0x511269,_0x13731a){return _0x511269(_0x13731a);},'gIZTo':_0xec8051(0xad),'EGSXh':function(_0x291835,_0x1f8277){return _0x291835(_0x1f8277);},'COgew':function(_0x423871,_0x22df34){return _0x423871===_0x22df34;},'vArrr':'Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','KAzNe':'selected','HQzpd':function(_0x9ef736,_0x5f08fb,_0x472605,_0x58fc66){return _0x9ef736(_0x5f08fb,_0x472605,_0x58fc66);},'MOZGg':_0xec8051(0x68)},_0xf41345=getCurrentEnvironment(),_0x1fa981=ENVIRONMENT_CONFIGS[_0xf41345][_0xec8051(0x78)],_0x2b6350=await requestDeviceCode(_0x1fa981);console[_0xec8051(0x95)](_0xec8051(0x7f)),console['log'](_0x204155['bbKEt']),_0x204155['cinax'](openBrowser,_0x2b6350['verification_uri_complete']),console[_0xec8051(0x95)]('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x2b6350['verification_uri_complete']),console['log'](_0xec8051(0x75)+_0x2b6350['user_code']+'\x0a'),process[_0xec8051(0xa6)][_0xec8051(0xa1)](_0x204155[_0xec8051(0x69)]);let _0x35d9e4=await pollForTokens(_0x1fa981,_0x2b6350[_0xec8051(0x6a)],_0x2b6350[_0xec8051(0xaa)],_0x2b6350[_0xec8051(0x65)]);console['log']('\x20✓');const _0x5b8c0f=decodeJwtPayload(_0x35d9e4[_0xec8051(0xb1)]);if(!_0x5b8c0f[_0xec8051(0x85)]){const _0x1c2edf=await _0x204155['EGSXh'](fetchMyMemberships,_0x35d9e4['access_token']);let _0x2ba1e1;if(_0x204155['COgew'](_0x1c2edf[_0xec8051(0x87)],0x0)){process[_0xec8051(0xa6)][_0xec8051(0xa1)](_0xec8051(0x7d));const _0x396756=await _0x204155[_0xec8051(0x8b)](selfServeSignup,_0x35d9e4['access_token']);_0x2ba1e1=_0x396756['organizationId'],console['log']('\x20✓');}else{if(_0x1c2edf[_0xec8051(0x87)]===0x1)_0x2ba1e1=_0x1c2edf[0x0][_0xec8051(0x92)],console[_0xec8051(0x95)](_0xec8051(0x8d)+_0x1c2edf[0x0]['name']);else{const _0xc8a290=process[_0xec8051(0x67)]['isTTY']&&process['stdout']['isTTY'];if(!_0xc8a290)throw new Error(_0x204155['vArrr']+'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.');const {selected:_0x38be6a}=await _0x3a3130['prompt']([{'type':_0xec8051(0x9b),'name':_0x204155['KAzNe'],'message':'Select\x20an\x20organization:','choices':_0x1c2edf[_0xec8051(0xae)](_0x30b512=>({'name':_0x30b512[_0xec8051(0x84)],'value':_0x30b512['organizationId']}))}]);_0x2ba1e1=_0x38be6a;}}_0x35d9e4=await _0x204155['HQzpd'](refreshTokenWithOrg,_0x1fa981,_0x35d9e4['refresh_token'],_0x2ba1e1);}process['stdout'][_0xec8051(0xa1)](_0x204155[_0xec8051(0x66)]);const _0x20a529=await provisionCliToken(_0x35d9e4['access_token']);return console[_0xec8051(0x95)]('\x20✓'),await storeToken(_0x20a529[_0xec8051(0x8f)]),_0x35d9e4[_0xec8051(0xb2)]&&await storeRefreshToken(_0x35d9e4[_0xec8051(0xb2)]),_0x20a529[_0xec8051(0x8f)];}function sleep(_0x53694f){return new Promise(_0xec4ecf=>setTimeout(_0xec4ecf,_0x53694f));}
@@ -1 +1 @@
1
- function _0x4e83(){const _0x2389b0=['nova-act-cli','\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli,\x20rangerwright-cli.','dqPJo','1712976bLdWTe','6522lxYqZq','playwright-cli','client_01J9CBYM7M5ZETCF7G6614DXR2','gSWEJ','rangerwright-cli','https://api.staging.ranger.net','56367JduHBG','231290XIgXrR','HqQzR','error','http://localhost:8090','68158AzLYhq','http://localhost:8080','mcpAuthUrl','trim','prod','RANGER_TRANSPORT','RANGER_USE_NOVA_ACT','RANGER_BYOK','true','DEdcs','44LtTqht','3812KmLdeB','Invalid\x20RANGER_TRANSPORT=\x22','RANGER_HOOKS','615753cfSdLX','https://ai-proxy-301751771437.us-central1.run.app','staging','\x22.\x20','http://localhost:8080/mcp','85wjVNCQ','10DQrDSh','find','env','413EnQQpA'];_0x4e83=function(){return _0x2389b0;};return _0x4e83();}const _0xd2d182=_0x5b96;(function(_0x25e2f2,_0x54f827){const _0x51fdfd=_0x5b96,_0x2949c0=_0x25e2f2();while(!![]){try{const _0x3bf6d2=-parseInt(_0x51fdfd(0xec))/0x1+-parseInt(_0x51fdfd(0x100))/0x2*(parseInt(_0x51fdfd(0xe7))/0x3)+-parseInt(_0x51fdfd(0xf7))/0x4*(parseInt(_0x51fdfd(0xff))/0x5)+-parseInt(_0x51fdfd(0x108))/0x6*(-parseInt(_0x51fdfd(0x103))/0x7)+parseInt(_0x51fdfd(0x107))/0x8+-parseInt(_0x51fdfd(0xfa))/0x9+-parseInt(_0x51fdfd(0xe8))/0xa*(-parseInt(_0x51fdfd(0xf6))/0xb);if(_0x3bf6d2===_0x54f827)break;else _0x2949c0['push'](_0x2949c0['shift']());}catch(_0x4d84f1){_0x2949c0['push'](_0x2949c0['shift']());}}}(_0x4e83,0x1e492));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':'https://api.ranger.net','workosClientId':_0xd2d182(0x10a),'aiProxyUrl':'https://ai-proxy-716115358910.us-central1.run.app','mcpAuthUrl':'https://mcp-auth.ranger.net/mcp'},'staging':{'apiBaseUrl':_0xd2d182(0x10d),'workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':_0xd2d182(0xfb),'mcpAuthUrl':'https://mcp-auth.staging.ranger.net/mcp'},'local':{'apiBaseUrl':_0xd2d182(0xed),'workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':_0xd2d182(0xeb),'mcpAuthUrl':_0xd2d182(0xfe)}};function _0x5b96(_0x50a2f2,_0x47e1b9){_0x50a2f2=_0x50a2f2-0xe7;const _0x4e83dd=_0x4e83();let _0x5b9628=_0x4e83dd[_0x50a2f2];return _0x5b9628;}export const DEFAULT_ENVIRONMENT='prod';export function isValidEnvironment(_0x59d69a){const _0x494b4a=_0xd2d182,_0x27bc4f={'HqQzR':function(_0x1ea79a,_0x15bb4e){return _0x1ea79a===_0x15bb4e;},'zsssI':_0x494b4a(0xf0)};return _0x27bc4f[_0x494b4a(0xe9)](_0x59d69a,_0x27bc4f['zsssI'])||_0x59d69a===_0x494b4a(0xfc)||_0x27bc4f[_0x494b4a(0xe9)](_0x59d69a,'local');}export function getCurrentEnvironment(){const _0xf648ed=_0xd2d182,_0x189523={'dqPJo':function(_0x17049f,_0x569bef){return _0x17049f(_0x569bef);}},_0x48f5cc=process['env']['RANGER_CLI_ENV'];if(_0x48f5cc&&_0x189523[_0xf648ed(0x106)](isValidEnvironment,_0x48f5cc))return _0x48f5cc;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){return ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['apiBaseUrl'];}export function getAiProxyUrl(){return ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['aiProxyUrl'];}export function getMcpAuthUrl(){const _0x5d2ab6=_0xd2d182;return process[_0x5d2ab6(0x102)]['RANGER_MCP_AUTH_URL']??ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x5d2ab6(0xee)];}export function isByokEnabled(){const _0x40ce2f=_0xd2d182;return process[_0x40ce2f(0x102)][_0x40ce2f(0xf3)]===_0x40ce2f(0xf4);}function isVerificationTransport(_0x4b7b9b){const _0x79f81b=_0xd2d182,_0x340b6e={'DEdcs':function(_0xdd293,_0x108463){return _0xdd293===_0x108463;},'WssPI':'mcp'};return _0x340b6e[_0x79f81b(0xf5)](_0x4b7b9b,_0x340b6e['WssPI'])||_0x4b7b9b===_0x79f81b(0x109)||_0x4b7b9b===_0x79f81b(0x104)||_0x4b7b9b===_0x79f81b(0x10c);}const LEGACY_TRANSPORT_ENV_VARS=[_0xd2d182(0xf2),'RANGER_DISABLE_MCP'];export function getVerificationTransport(){const _0x2d9f11=_0xd2d182,_0x45977f={'yoXFR':function(_0x1a878d,_0x47e355){return _0x1a878d(_0x47e355);},'QjRlx':'mcp'},_0x24897d=process[_0x2d9f11(0x102)][_0x2d9f11(0xf1)]?.[_0x2d9f11(0xef)]();if(_0x24897d){if(_0x45977f['yoXFR'](isVerificationTransport,_0x24897d))return _0x24897d;throw new Error(_0x2d9f11(0xf8)+_0x24897d+_0x2d9f11(0x105));}const _0x2f503c=LEGACY_TRANSPORT_ENV_VARS[_0x2d9f11(0x101)](_0x176522=>process[_0x2d9f11(0x102)][_0x176522]);if(_0x2f503c)throw new Error(_0x2f503c+'\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20RANGER_TRANSPORT=nova-act-cli,\x20or\x20RANGER_TRANSPORT=rangerwright-cli.');return _0x45977f['QjRlx'];}export function resolveHookMode(_0x730d3d=process[_0xd2d182(0x102)]){const _0x190a86=_0xd2d182,_0x1010c4={'gSWEJ':'off','LEedC':function(_0x2ea7a3,_0x4a4cee){return _0x2ea7a3===_0x4a4cee;},'WqvvB':function(_0x1dc25,_0x5aec75){return _0x1dc25+_0x5aec75;}},_0x460dea=_0x730d3d['RANGER_HOOKS']?.[_0x190a86(0xef)]()['toLowerCase']();if(!_0x460dea)return'auto';if(_0x460dea===_0x1010c4[_0x190a86(0x10b)]||_0x460dea==='on'||_0x1010c4['LEedC'](_0x460dea,'auto'))return _0x460dea;return console[_0x190a86(0xea)](_0x1010c4['WqvvB']('[ranger]\x20Ignoring\x20invalid\x20RANGER_HOOKS=\x22'+_0x730d3d[_0x190a86(0xf9)]+_0x190a86(0xfd),'Expected\x20one\x20of:\x20off,\x20on,\x20auto.\x20Defaulting\x20to\x20auto.')),'auto';}
1
+ const _0x13f10c=_0x3ba3;(function(_0x3a51ef,_0x8df186){const _0x51ee22=_0x3ba3,_0x14dc80=_0x3a51ef();while(!![]){try{const _0x2375f6=-parseInt(_0x51ee22(0xa4))/0x1+-parseInt(_0x51ee22(0x94))/0x2*(-parseInt(_0x51ee22(0x8b))/0x3)+parseInt(_0x51ee22(0x9a))/0x4+-parseInt(_0x51ee22(0xa5))/0x5*(parseInt(_0x51ee22(0x87))/0x6)+parseInt(_0x51ee22(0x8e))/0x7*(-parseInt(_0x51ee22(0x93))/0x8)+-parseInt(_0x51ee22(0x7d))/0x9+-parseInt(_0x51ee22(0x7e))/0xa*(-parseInt(_0x51ee22(0x86))/0xb);if(_0x2375f6===_0x8df186)break;else _0x14dc80['push'](_0x14dc80['shift']());}catch(_0x147d1b){_0x14dc80['push'](_0x14dc80['shift']());}}}(_0x1fbb,0x6661e));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':'https://api.ranger.net','workosClientId':'client_01J9CBYM7M5ZETCF7G6614DXR2','aiProxyUrl':'https://ai-proxy-716115358910.us-central1.run.app','mcpAuthUrl':_0x13f10c(0xa3)},'staging':{'apiBaseUrl':'https://api.staging.ranger.net','workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':_0x13f10c(0x98),'mcpAuthUrl':'https://mcp-auth.staging.ranger.net/mcp'},'local':{'apiBaseUrl':_0x13f10c(0x9f),'workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':'http://localhost:8090','mcpAuthUrl':'http://localhost:8080/mcp'}};function _0x1fbb(){const _0x13d6fd=['mcpAuthUrl','vNUTl','RANGER_HOOKS','2026184XJwuLt','26qJoAOT','\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20RANGER_TRANSPORT=nova-act-cli,\x20or\x20RANGER_TRANSPORT=rangerwright-cli.','aiProxyUrl','NXpJW','https://ai-proxy-301751771437.us-central1.run.app','env','2695364GYBRyc','auto','Invalid\x20RANGER_TRANSPORT=\x22','zNLEj','DjxsQ','http://localhost:8080','RANGER_DISABLE_MCP','RANGER_TRANSPORT','jEEbb','https://mcp-auth.ranger.net/mcp','93063HXtSoo','5clexSd','\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli,\x20rangerwright-cli.','7354575wiHDLB','1736940QVPelM','mcp','RANGER_CLI_ENV','true','TvyAj','local','staging','RANGER_BYOK','11idViAv','344670XlJyiq','Qxknn','error','nova-act-cli','182949dNuZmj','bVCBh','apiBaseUrl','7ZafMwF','RANGER_MCP_AUTH_URL'];_0x1fbb=function(){return _0x13d6fd;};return _0x1fbb();}export const DEFAULT_ENVIRONMENT='prod';export function isValidEnvironment(_0xd347c){const _0x4ecbb6=_0x13f10c,_0x14d960={'bVCBh':'prod','Qxknn':function(_0x47014f,_0x3f43d){return _0x47014f===_0x3f43d;},'ijVPg':_0x4ecbb6(0x84)};return _0xd347c===_0x14d960[_0x4ecbb6(0x8c)]||_0x14d960[_0x4ecbb6(0x88)](_0xd347c,_0x14d960['ijVPg'])||_0x14d960['Qxknn'](_0xd347c,_0x4ecbb6(0x83));}export function getCurrentEnvironment(){const _0x4796a7=_0x13f10c,_0x4bfb5f={'tNqAU':function(_0x537a3f,_0x4c3a83){return _0x537a3f(_0x4c3a83);}},_0x36571e=process['env'][_0x4796a7(0x80)];if(_0x36571e&&_0x4bfb5f['tNqAU'](isValidEnvironment,_0x36571e))return _0x36571e;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){const _0x22c406=_0x13f10c,_0x3da520={'NXpJW':function(_0x597ddf){return _0x597ddf();}};return ENVIRONMENT_CONFIGS[_0x3da520[_0x22c406(0x97)](getCurrentEnvironment)][_0x22c406(0x8d)];}export function getAiProxyUrl(){const _0x42c2db=_0x13f10c,_0x1312a4={'gkDCT':function(_0x3f0a30){return _0x3f0a30();}};return ENVIRONMENT_CONFIGS[_0x1312a4['gkDCT'](getCurrentEnvironment)][_0x42c2db(0x96)];}export function getMcpAuthUrl(){const _0x81125b=_0x13f10c,_0x101db3={'vNUTl':function(_0x11cc2b){return _0x11cc2b();}};return process['env'][_0x81125b(0x8f)]??ENVIRONMENT_CONFIGS[_0x101db3[_0x81125b(0x91)](getCurrentEnvironment)][_0x81125b(0x90)];}function _0x3ba3(_0x4b5ee2,_0x2e7196){_0x4b5ee2=_0x4b5ee2-0x7c;const _0x1fbb87=_0x1fbb();let _0x3ba352=_0x1fbb87[_0x4b5ee2];return _0x3ba352;}export function isByokEnabled(){const _0x48e306=_0x13f10c,_0xec1682={'hcXrO':function(_0x6dd39b,_0x2fe913){return _0x6dd39b===_0x2fe913;},'TvyAj':_0x48e306(0x81)};return _0xec1682['hcXrO'](process[_0x48e306(0x99)][_0x48e306(0x85)],_0xec1682[_0x48e306(0x82)]);}function isVerificationTransport(_0x4a354e){const _0x30734d=_0x13f10c,_0x18513c={'rGmZB':'playwright-cli','uApPR':function(_0x7f91ea,_0x5226f5){return _0x7f91ea===_0x5226f5;},'QXcaz':_0x30734d(0x8a),'Ghneb':'rangerwright-cli'};return _0x4a354e===_0x30734d(0x7f)||_0x4a354e===_0x18513c['rGmZB']||_0x18513c['uApPR'](_0x4a354e,_0x18513c['QXcaz'])||_0x4a354e===_0x18513c['Ghneb'];}const LEGACY_TRANSPORT_ENV_VARS=['RANGER_USE_NOVA_ACT',_0x13f10c(0xa0)];export function getVerificationTransport(){const _0x3429fd=_0x13f10c,_0x4ea67e={'zNLEj':function(_0x1f52e1,_0x9d03e){return _0x1f52e1(_0x9d03e);}},_0x2ebfe6=process['env'][_0x3429fd(0xa1)]?.['trim']();if(_0x2ebfe6){if(_0x4ea67e[_0x3429fd(0x9d)](isVerificationTransport,_0x2ebfe6))return _0x2ebfe6;throw new Error(_0x3429fd(0x9c)+_0x2ebfe6+_0x3429fd(0x7c));}const _0x52195a=LEGACY_TRANSPORT_ENV_VARS['find'](_0x3e463b=>process['env'][_0x3e463b]);if(_0x52195a)throw new Error(_0x52195a+_0x3429fd(0x95));return'mcp';}export function resolveHookMode(_0x44874f=process[_0x13f10c(0x99)]){const _0x4025b1=_0x13f10c,_0x4a7390={'jEEbb':_0x4025b1(0x9b),'DjxsQ':function(_0x5c66e5,_0x2a61e2){return _0x5c66e5===_0x2a61e2;},'MlSQT':function(_0x42310f,_0x28518d){return _0x42310f+_0x28518d;}},_0x17af81=_0x44874f[_0x4025b1(0x92)]?.['trim']()['toLowerCase']();if(!_0x17af81)return _0x4a7390[_0x4025b1(0xa2)];if(_0x17af81==='off'||_0x4a7390[_0x4025b1(0x9e)](_0x17af81,'on')||_0x4a7390[_0x4025b1(0x9e)](_0x17af81,'auto'))return _0x17af81;return console[_0x4025b1(0x89)](_0x4a7390['MlSQT']('[ranger]\x20Ignoring\x20invalid\x20RANGER_HOOKS=\x22'+_0x44874f[_0x4025b1(0x92)]+'\x22.\x20','Expected\x20one\x20of:\x20off,\x20on,\x20auto.\x20Defaulting\x20to\x20auto.')),_0x4025b1(0x9b);}
@@ -1 +1 @@
1
- (function(_0x18f771,_0xf71aae){const _0x253b9e=_0x2c7a,_0xad5e20=_0x18f771();while(!![]){try{const _0x11fa5e=-parseInt(_0x253b9e(0x9f))/0x1*(-parseInt(_0x253b9e(0xb7))/0x2)+parseInt(_0x253b9e(0xb6))/0x3+parseInt(_0x253b9e(0x9c))/0x4*(-parseInt(_0x253b9e(0xb5))/0x5)+-parseInt(_0x253b9e(0xbb))/0x6*(-parseInt(_0x253b9e(0xb8))/0x7)+-parseInt(_0x253b9e(0xa9))/0x8*(-parseInt(_0x253b9e(0xc0))/0x9)+parseInt(_0x253b9e(0x94))/0xa*(-parseInt(_0x253b9e(0xb1))/0xb)+-parseInt(_0x253b9e(0xac))/0xc*(-parseInt(_0x253b9e(0xb4))/0xd);if(_0x11fa5e===_0xf71aae)break;else _0xad5e20['push'](_0xad5e20['shift']());}catch(_0x198f26){_0xad5e20['push'](_0xad5e20['shift']());}}}(_0x4966,0xf288d));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x263a9c){const _0x44865d=_0x2c7a,_0x15d10d={'FIton':function(_0x2cb0fb){return _0x2cb0fb();},'kktXx':function(_0x34dbdf){return _0x34dbdf();},'foJlC':function(_0x1b9b92,_0x3e0625,_0x243908){return _0x1b9b92(_0x3e0625,_0x243908);},'UJtgM':function(_0x396651,_0x2eb96b){return _0x396651===_0x2eb96b;},'tYJFv':'Feature\x20limit\x20exceeded'},_0x1f3292=await _0x15d10d[_0x44865d(0x73)](getToken);if(!_0x1f3292)throw new Error(_0x44865d(0xaa));const _0x387660=_0x15d10d[_0x44865d(0x9d)](getApiBaseUrl),_0x2eae16=await _0x15d10d['foJlC'](fetch,_0x387660+'/api/v1/mcp/features',{'method':_0x44865d(0xa0),'headers':{'Authorization':_0x44865d(0xb2)+_0x1f3292,'Content-Type':_0x44865d(0x92)},'body':JSON[_0x44865d(0x88)](_0x263a9c)});if(!_0x2eae16['ok']){if(_0x15d10d['UJtgM'](_0x2eae16[_0x44865d(0x71)],0x192)){const _0x3f282d=await _0x2eae16[_0x44865d(0x8f)](),_0x4d60df=_0x3f282d['billingUrl']||_0x44865d(0xba);throw new Error((_0x3f282d['message']||_0x15d10d['tYJFv'])+'\x0a\x0aUpgrade\x20your\x20plan:\x20'+_0x4d60df);}const _0x343425=await _0x2eae16[_0x44865d(0xab)]();throw new Error(_0x44865d(0x87)+_0x343425);}return _0x2eae16[_0x44865d(0x8f)]();}export async function listFeatures(_0x4130be){const _0x104039=_0x2c7a,_0x2b9e11={'BYLZL':function(_0x20a264){return _0x20a264();},'pCiCA':function(_0x5e5ef4){return _0x5e5ef4();},'CsHLd':_0x104039(0x98),'ARapR':_0x104039(0x78),'SCoKN':_0x104039(0xae),'ZwCac':'GET'},_0x2acc5b=await _0x2b9e11[_0x104039(0x7e)](getToken);if(!_0x2acc5b)throw new Error(_0x104039(0xaa));const _0x50e74f=_0x2b9e11['pCiCA'](getApiBaseUrl),_0xe062d1=new URLSearchParams();if(_0x4130be?.[_0x104039(0x98)])_0xe062d1[_0x104039(0x8c)](_0x2b9e11['CsHLd'],_0x4130be['gitRepoUrl']);if(_0x4130be?.['gitBranch'])_0xe062d1['set']('gitBranch',_0x4130be['gitBranch']);if(_0x4130be?.['limit'])_0xe062d1['set'](_0x104039(0x86),_0x4130be['limit'][_0x104039(0x7b)]());if(_0x4130be?.['offset'])_0xe062d1[_0x104039(0x8c)](_0x2b9e11[_0x104039(0x97)],_0x4130be['offset'][_0x104039(0x7b)]());if(_0x4130be?.[_0x104039(0xa3)])_0xe062d1[_0x104039(0x8c)](_0x104039(0xa3),_0x2b9e11[_0x104039(0x8a)]);const _0x46584a=_0x50e74f+_0x104039(0x85)+(_0xe062d1[_0x104039(0x7b)]()?'?'+_0xe062d1['toString']():''),_0x680e37=await fetch(_0x46584a,{'method':_0x2b9e11[_0x104039(0x9b)],'headers':{'Authorization':'Bearer\x20'+_0x2acc5b}});if(!_0x680e37['ok']){const _0x2f452e=await _0x680e37['text']();throw new Error(_0x104039(0xbc)+_0x2f452e);}return _0x680e37['json']();}export async function getFeature(_0x4709dd){const _0x2c40a7=_0x2c7a,_0x63a822={'KsaqE':_0x2c40a7(0xaa),'eexLY':function(_0x3d035f){return _0x3d035f();},'uVfkf':function(_0x2245b9,_0x164899,_0x3aa535){return _0x2245b9(_0x164899,_0x3aa535);}},_0x41e152=await getToken();if(!_0x41e152)throw new Error(_0x63a822[_0x2c40a7(0xbf)]);const _0x3398cf=_0x63a822[_0x2c40a7(0xa1)](getApiBaseUrl),_0xc38ded=await _0x63a822[_0x2c40a7(0x6f)](fetch,_0x3398cf+_0x2c40a7(0x83)+_0x4709dd,{'method':_0x2c40a7(0xb0),'headers':{'Authorization':'Bearer\x20'+_0x41e152}});if(!_0xc38ded['ok']){const _0x374aed=await _0xc38ded[_0x2c40a7(0xab)]();throw new Error(_0x2c40a7(0xa5)+_0x374aed);}return _0xc38ded[_0x2c40a7(0x8f)]();}export async function updateFeature(_0x45447f,_0x3b543a){const _0x4d890b=_0x2c7a,_0x1b770f=await getToken();if(!_0x1b770f)throw new Error(_0x4d890b(0xaa));const _0x340bf3=getApiBaseUrl(),_0x540f02=await fetch(_0x340bf3+_0x4d890b(0x83)+_0x45447f,{'method':'PATCH','headers':{'Authorization':'Bearer\x20'+_0x1b770f,'Content-Type':_0x4d890b(0x92)},'body':JSON[_0x4d890b(0x88)](_0x3b543a)});if(!_0x540f02['ok']){const _0x4c7691=await _0x540f02['text']();throw new Error(_0x4d890b(0x93)+_0x4c7691);}return _0x540f02['json']();}function _0x2c7a(_0x5f3b4a,_0x446002){_0x5f3b4a=_0x5f3b4a-0x6f;const _0x496680=_0x4966();let _0x2c7aab=_0x496680[_0x5f3b4a];return _0x2c7aab;}export async function createChecklistItem(_0x1dcc72,_0x3b6ef5,_0x3e2bda){const _0xd677d2=_0x2c7a,_0x98b727={'rAzsG':function(_0x25aeb1){return _0x25aeb1();}},_0x33485e=await getToken();if(!_0x33485e)throw new Error(_0xd677d2(0xaa));const _0x453748=_0x98b727[_0xd677d2(0x7c)](getApiBaseUrl),_0x12a433=await fetch(_0x453748+'/api/v1/mcp/features/'+_0x1dcc72+_0xd677d2(0xa6),{'method':_0xd677d2(0xa0),'headers':{'Authorization':'Bearer\x20'+_0x33485e,'Content-Type':_0xd677d2(0x92)},'body':JSON['stringify']({'description':_0x3b6ef5,'position':_0x3e2bda})});if(!_0x12a433['ok']){const _0x591e5e=await _0x12a433['text']();throw new Error('Failed\x20to\x20create\x20scenario:\x20'+_0x591e5e);}return _0x12a433[_0xd677d2(0x8f)]();}export async function updateChecklistItem(_0x5288d9,_0x570693,_0x47d220){const _0x51af66=_0x2c7a,_0x42796d={'gsrhj':function(_0x5eaa90){return _0x5eaa90();},'oXWbw':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','AuFKP':function(_0x2c095d,_0x131266,_0x57abc9){return _0x2c095d(_0x131266,_0x57abc9);},'LudVm':_0x51af66(0xa4),'jnolX':_0x51af66(0x92),'hFrBE':_0x51af66(0x89)};return withRetry(async()=>{const _0x43ed61=_0x51af66,_0x59134c=await _0x42796d['gsrhj'](getToken);if(!_0x59134c)throw new Error(_0x42796d['oXWbw']);const _0x138824=_0x42796d[_0x43ed61(0x81)](getApiBaseUrl),_0x3cfb42=await _0x42796d[_0x43ed61(0x8d)](fetch,_0x138824+'/api/v1/mcp/features/'+_0x5288d9+_0x43ed61(0xa8)+_0x570693,{'method':_0x42796d['LudVm'],'headers':{'Authorization':'Bearer\x20'+_0x59134c,'Content-Type':_0x42796d['jnolX']},'body':JSON[_0x43ed61(0x88)](_0x47d220)});if(!_0x3cfb42['ok']){const _0x4aba3a=await _0x3cfb42['text']();throw new Error(_0x43ed61(0x77)+_0x4aba3a);}return _0x3cfb42[_0x43ed61(0x8f)]();},{'label':_0x42796d['hFrBE']});}export async function getFeatureReport(_0x2f8fac){const _0x57bf1e=_0x2c7a,_0x3496e2={'kEWYu':function(_0x4df0c3){return _0x4df0c3();},'YSGSK':_0x57bf1e(0xaa),'wmGvj':function(_0x5cce12,_0x200f35,_0x533049){return _0x5cce12(_0x200f35,_0x533049);}},_0x3b7eee=await _0x3496e2[_0x57bf1e(0x82)](getToken);if(!_0x3b7eee)throw new Error(_0x3496e2[_0x57bf1e(0x7a)]);const _0x2bb9c6=getApiBaseUrl(),_0x58c60d=await _0x3496e2[_0x57bf1e(0x80)](fetch,_0x2bb9c6+_0x57bf1e(0x83)+_0x2f8fac+_0x57bf1e(0x91),{'method':'GET','headers':{'Authorization':_0x57bf1e(0xb2)+_0x3b7eee}});if(!_0x58c60d['ok']){const _0x4b793b=await _0x58c60d[_0x57bf1e(0xab)]();throw new Error(_0x57bf1e(0x9e)+_0x4b793b);}return _0x58c60d['json']();}function _0x4966(){const _0x183d6b=['20shyhgq','kktXx','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','1NortBl','POST','eexLY','ABiVg','includeDeleted','PATCH','Failed\x20to\x20get\x20feature\x20review:\x20','/checklist','CcJQZ','/checklist/','44984SKjAMW','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','text','2916yYesMd','Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20','true','HIwSp','GET','44tEgbxL','Bearer\x20','/sessions/','32773JMmmSh','1915415ErMMBt','2861952IHkHpf','3089096SNaLHx','973bBOzTM','LLxMF','https://dashboard.ranger.net/billing','11868OsGEus','Failed\x20to\x20list\x20feature\x20reviews:\x20','ZAAZB','sessionId','KsaqE','1485jfyRWA','tLSqj','uVfkf','mmHCL','status','length','FIton','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','xXqTp','uEjCY','Failed\x20to\x20update\x20scenario:\x20','offset','Jluzg','YSGSK','toString','rAzsG','/report/markdown','BYLZL','mLERd','wmGvj','gsrhj','kEWYu','/api/v1/mcp/features/','Failed\x20to\x20get\x20action\x20items:\x20','/api/v1/mcp/features','limit','Failed\x20to\x20create\x20feature\x20review:\x20','stringify','updateChecklistItem','SCoKN','dIQWX','set','AuFKP','/comments/address','json','Failed\x20to\x20conclude\x20session:\x20','/report','application/json','Failed\x20to\x20update\x20feature\x20review:\x20','3512590gIUxKi','style','/sessions','ARapR','gitRepoUrl','/feedback','xeqZS','ZwCac'];_0x4966=function(){return _0x183d6b;};return _0x4966();}export async function getFeatureReportMarkdown(_0x3ef0be,_0x410133){const _0x37922d=_0x2c7a,_0x15b080={'CcJQZ':function(_0x47bc1e){return _0x47bc1e();},'uEjCY':_0x37922d(0xaa),'Tjdmn':'style'},_0x25f1b5=await _0x15b080[_0x37922d(0xa7)](getToken);if(!_0x25f1b5)throw new Error(_0x15b080[_0x37922d(0x76)]);const _0x11e6d6=getApiBaseUrl(),_0x4f36b9=new URLSearchParams(),_0x206b8e=(_0x410133?.['itemIds']?.[_0x37922d(0x72)]??0x0)>0x0,_0xb62bc8=Boolean(_0x410133?.[_0x37922d(0xbe)]);_0x206b8e&&_0x410133?.['itemIds']&&_0x4f36b9[_0x37922d(0x8c)]('itemIds',_0x410133['itemIds']['join'](','));_0xb62bc8&&_0x410133?.[_0x37922d(0xbe)]&&_0x4f36b9['set'](_0x37922d(0xbe),_0x410133[_0x37922d(0xbe)]);!_0x206b8e&&!_0xb62bc8&&_0x410133?.[_0x37922d(0x95)]&&_0x4f36b9['set'](_0x15b080['Tjdmn'],_0x410133['style']);const _0x25e03a=_0x11e6d6+_0x37922d(0x83)+_0x3ef0be+_0x37922d(0x7d),_0x4a06c6=''+_0x25e03a+(_0x4f36b9['toString']()?'?'+_0x4f36b9[_0x37922d(0x7b)]():''),_0x2c5ab3=await fetch(_0x4a06c6,{'method':_0x37922d(0xb0),'headers':{'Authorization':'Bearer\x20'+_0x25f1b5}});if(!_0x2c5ab3['ok']){const _0x144879=await _0x2c5ab3[_0x37922d(0xab)]();throw new Error(_0x37922d(0x74)+_0x144879);}return _0x2c5ab3[_0x37922d(0xab)]();}export async function listFeatureSessions(_0xa0b583){const _0x917979=_0x2c7a,_0x215ce0={'PYjaE':function(_0x31b3ee){return _0x31b3ee();},'kFJcU':_0x917979(0xaa),'fhfur':function(_0x1ca190){return _0x1ca190();},'mLERd':function(_0x14e4eb,_0x12fe7c,_0x38df0a){return _0x14e4eb(_0x12fe7c,_0x38df0a);}},_0x215e08=await _0x215ce0['PYjaE'](getToken);if(!_0x215e08)throw new Error(_0x215ce0['kFJcU']);const _0x2addf2=_0x215ce0['fhfur'](getApiBaseUrl),_0x4dc487=await _0x215ce0[_0x917979(0x7f)](fetch,_0x2addf2+_0x917979(0x83)+_0xa0b583+_0x917979(0x96),{'method':_0x917979(0xb0),'headers':{'Authorization':_0x917979(0xb2)+_0x215e08}});if(!_0x4dc487['ok']){const _0x442b0e=await _0x4dc487[_0x917979(0xab)]();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x442b0e);}return _0x4dc487[_0x917979(0x8f)]();}export async function startSession(_0x49f05d,_0xa61a6c){const _0x8028c6=_0x2c7a,_0x23b5cf={'yGGZP':function(_0x1ec894){return _0x1ec894();},'CbbeP':_0x8028c6(0xa0)},_0x307c8a=await getToken();if(!_0x307c8a)throw new Error(_0x8028c6(0xaa));const _0xf5538b=_0x23b5cf['yGGZP'](getApiBaseUrl),_0x170bd5=await fetch(_0xf5538b+_0x8028c6(0x83)+_0x49f05d+_0x8028c6(0xb3)+_0xa61a6c+'/start',{'method':_0x23b5cf['CbbeP'],'headers':{'Authorization':_0x8028c6(0xb2)+_0x307c8a}});if(!_0x170bd5['ok']){const _0x45f9fd=await _0x170bd5['text']();throw new Error('Failed\x20to\x20start\x20session:\x20'+_0x45f9fd);}return _0x170bd5['json']();}export async function concludeSession(_0x361df9,_0x359168){const _0x4c8ed1=_0x2c7a,_0x1b636f={'dIQWX':_0x4c8ed1(0xa0)},_0x6226ec=await getToken();if(!_0x6226ec)throw new Error(_0x4c8ed1(0xaa));const _0x43f3e4=getApiBaseUrl(),_0x39e9e7=await fetch(_0x43f3e4+'/api/v1/mcp/features/'+_0x361df9+_0x4c8ed1(0xb3)+_0x359168+'/conclude',{'method':_0x1b636f[_0x4c8ed1(0x8b)],'headers':{'Authorization':_0x4c8ed1(0xb2)+_0x6226ec}});if(!_0x39e9e7['ok']){const _0x582b24=await _0x39e9e7['text']();throw new Error(_0x4c8ed1(0x90)+_0x582b24);}return _0x39e9e7['json']();}export async function getActionItems(_0xde1aea){const _0x4aa22f=_0x2c7a,_0x4ea460={'tyJWB':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','LLxMF':function(_0x1834e0){return _0x1834e0();},'HIwSp':function(_0x2b2ee5,_0x475500,_0x2eb2e9){return _0x2b2ee5(_0x475500,_0x2eb2e9);},'xXqTp':'GET'},_0x39306f=await getToken();if(!_0x39306f)throw new Error(_0x4ea460['tyJWB']);const _0x184091=_0x4ea460[_0x4aa22f(0xb9)](getApiBaseUrl),_0x2446e6=await _0x4ea460[_0x4aa22f(0xaf)](fetch,_0x184091+_0x4aa22f(0x83)+_0xde1aea+'/action-items',{'method':_0x4ea460[_0x4aa22f(0x75)],'headers':{'Authorization':_0x4aa22f(0xb2)+_0x39306f}});if(!_0x2446e6['ok']){const _0x19c2d0=await _0x2446e6['text']();throw new Error(_0x4aa22f(0x84)+_0x19c2d0);}return _0x2446e6[_0x4aa22f(0x8f)]();}export async function getItemFeedback(_0x14e3ac,_0x427acd){const _0x5d130d=_0x2c7a,_0x2bfd1c={'wGMhx':function(_0x4f5820){return _0x4f5820();},'fBDJn':_0x5d130d(0xaa),'ABiVg':function(_0x24b391){return _0x24b391();},'dZUNG':function(_0x167ec8,_0x2772b8,_0x2c813e){return _0x167ec8(_0x2772b8,_0x2c813e);}},_0x4fa58b=await _0x2bfd1c['wGMhx'](getToken);if(!_0x4fa58b)throw new Error(_0x2bfd1c['fBDJn']);const _0x26ea8d=_0x2bfd1c[_0x5d130d(0xa2)](getApiBaseUrl),_0x338ab2=await _0x2bfd1c['dZUNG'](fetch,_0x26ea8d+_0x5d130d(0x83)+_0x14e3ac+'/checklist-items/'+_0x427acd+_0x5d130d(0x99),{'method':_0x5d130d(0xb0),'headers':{'Authorization':_0x5d130d(0xb2)+_0x4fa58b}});if(!_0x338ab2['ok']){const _0x15fa3d=await _0x338ab2['text']();throw new Error('Failed\x20to\x20get\x20item\x20feedback:\x20'+_0x15fa3d);}return _0x338ab2[_0x5d130d(0x8f)]();}export async function markCommentsAddressed(_0x403029,_0x30ea75,_0x123c53){const _0x17f330=_0x2c7a,_0x4f0995={'xeqZS':function(_0x383b1e){return _0x383b1e();},'vwOMG':_0x17f330(0xaa),'vzDWq':function(_0x394b4a,_0x494c11,_0x453f6c){return _0x394b4a(_0x494c11,_0x453f6c);},'Hfxgz':_0x17f330(0xa0)},_0x409177=await _0x4f0995['xeqZS'](getToken);if(!_0x409177)throw new Error(_0x4f0995['vwOMG']);const _0x32e8de=_0x4f0995[_0x17f330(0x9a)](getApiBaseUrl),_0x2a88c7=await _0x4f0995['vzDWq'](fetch,_0x32e8de+_0x17f330(0x83)+_0x403029+_0x17f330(0x8e),{'method':_0x4f0995['Hfxgz'],'headers':{'Authorization':'Bearer\x20'+_0x409177,'Content-Type':'application/json'},'body':JSON[_0x17f330(0x88)]({'checklistItemId':_0x30ea75,'commentIds':_0x123c53})});if(!_0x2a88c7['ok']){const _0x48c1a5=await _0x2a88c7['text']();throw new Error(_0x17f330(0xad)+_0x48c1a5);}}export async function softDeleteFeature(_0x258519){const _0x2e7c74=_0x2c7a,_0x535455={'tLSqj':function(_0x3daeb5){return _0x3daeb5();}},_0x583587=await getToken();if(!_0x583587)throw new Error(_0x2e7c74(0xaa));const _0x4939ab=_0x535455[_0x2e7c74(0xc1)](getApiBaseUrl),_0x316e41=await fetch(_0x4939ab+_0x2e7c74(0x83)+_0x258519,{'method':'DELETE','headers':{'Authorization':'Bearer\x20'+_0x583587}});if(!_0x316e41['ok']){const _0x2dc69f=await _0x316e41[_0x2e7c74(0xab)]();throw new Error('Failed\x20to\x20delete\x20feature\x20review:\x20'+_0x2dc69f);}}export async function restoreFeature(_0x127623){const _0x5cadb4=_0x2c7a,_0x583b57={'Jluzg':function(_0x54be97){return _0x54be97();},'mmHCL':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','ackUN':function(_0x544293,_0x45afb2,_0x37f0ab){return _0x544293(_0x45afb2,_0x37f0ab);},'ZAAZB':'POST'},_0x2f97c1=await _0x583b57[_0x5cadb4(0x79)](getToken);if(!_0x2f97c1)throw new Error(_0x583b57[_0x5cadb4(0x70)]);const _0x1f8f56=_0x583b57['Jluzg'](getApiBaseUrl),_0x6d5bbc=await _0x583b57['ackUN'](fetch,_0x1f8f56+_0x5cadb4(0x83)+_0x127623+'/restore',{'method':_0x583b57[_0x5cadb4(0xbd)],'headers':{'Authorization':_0x5cadb4(0xb2)+_0x2f97c1}});if(!_0x6d5bbc['ok']){const _0x3afe4e=await _0x6d5bbc[_0x5cadb4(0xab)]();throw new Error('Failed\x20to\x20restore\x20feature\x20review:\x20'+_0x3afe4e);}}
1
+ function _0x13e0(){const _0x36b6bd=['xeAav','weGmj','reXvS','/restore','sessionId','/api/v1/mcp/features','FHVmJ','WaDXI','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','31459088lyuOwQ','jmofH','style','QcYxh','WXhkm','IvNJi','YxXgA','Failed\x20to\x20create\x20scenario:\x20','Bearer\x20','/comments/address','Failed\x20to\x20get\x20feature\x20review:\x20','wXrlU','dgFJf','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','json','GET','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','forPH','Failed\x20to\x20get\x20action\x20items:\x20','uSrsw','Failed\x20to\x20get\x20item\x20feedback:\x20','ZyHwu','csTfA','4008zxszVP','1411226sTQKUk','qlQDy','BFNJP','TEJxO','gitBranch','ZuCAk','toString','/report','txuNN','/sessions/','cSClb','Failed\x20to\x20update\x20scenario:\x20','HdJsA','gitRepoUrl','qgXdm','yzoSK','itemIds','set','\x0a\x0aUpgrade\x20your\x20plan:\x20','limit','3415iXIcFq','DaIfp','3113346UgspZB','Failed\x20to\x20list\x20feature\x20reviews:\x20','tnCib','1317794NEluNy','mdDgV','/checklist','offset','uRldl','KOjPd','9556410toEwbe','/api/v1/mcp/features/','BKgnk','application/json','stringify','PATCH','QDPQw','Failed\x20to\x20conclude\x20session:\x20','TNQry','Failed\x20to\x20start\x20session:\x20','slYdx','https://dashboard.ranger.net/billing','includeDeleted','Failed\x20to\x20create\x20feature\x20review:\x20','mILaH','12046076pHbXDE','text'];_0x13e0=function(){return _0x36b6bd;};return _0x13e0();}(function(_0x42ce02,_0x10fd9b){const _0x23e394=_0xad9f,_0x20b476=_0x42ce02();while(!![]){try{const _0x543b93=parseInt(_0x23e394(0x1b3))/0x1+-parseInt(_0x23e394(0x1eb))/0x2+-parseInt(_0x23e394(0x1b0))/0x3+-parseInt(_0x23e394(0x1ea))/0x4*(-parseInt(_0x23e394(0x1ae))/0x5)+-parseInt(_0x23e394(0x1b9))/0x6+-parseInt(_0x23e394(0x1c8))/0x7+parseInt(_0x23e394(0x1d3))/0x8;if(_0x543b93===_0x10fd9b)break;else _0x20b476['push'](_0x20b476['shift']());}catch(_0x151383){_0x20b476['push'](_0x20b476['shift']());}}}(_0x13e0,0xd63ec));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x5b3177){const _0x5a5b74=_0xad9f,_0x5acb08={'xMZBb':function(_0x2f4939){return _0x2f4939();},'JiAOW':function(_0x36b978,_0x9f6ac4,_0x123120){return _0x36b978(_0x9f6ac4,_0x123120);},'KOjPd':'POST','wXrlU':_0x5a5b74(0x1bc),'tnCib':function(_0x32e533,_0x3d2e8d){return _0x32e533===_0x3d2e8d;},'BFNJP':_0x5a5b74(0x1c4)},_0x5e2daf=await getToken();if(!_0x5e2daf)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x2022d1=_0x5acb08['xMZBb'](getApiBaseUrl),_0x173cb9=await _0x5acb08['JiAOW'](fetch,_0x2022d1+_0x5a5b74(0x1cf),{'method':_0x5acb08[_0x5a5b74(0x1b8)],'headers':{'Authorization':'Bearer\x20'+_0x5e2daf,'Content-Type':_0x5acb08[_0x5a5b74(0x1de)]},'body':JSON['stringify'](_0x5b3177)});if(!_0x173cb9['ok']){if(_0x5acb08[_0x5a5b74(0x1b2)](_0x173cb9['status'],0x192)){const _0x520f36=await _0x173cb9[_0x5a5b74(0x1e1)](),_0x358032=_0x520f36['billingUrl']||_0x5acb08[_0x5a5b74(0x1ed)];throw new Error((_0x520f36['message']||'Feature\x20limit\x20exceeded')+_0x5a5b74(0x1ac)+_0x358032);}const _0x300485=await _0x173cb9[_0x5a5b74(0x1c9)]();throw new Error(_0x5a5b74(0x1c6)+_0x300485);}return _0x173cb9['json']();}export async function listFeatures(_0x26086f){const _0x512906=_0xad9f,_0x1b6097={'AlDyn':function(_0x32e8a2){return _0x32e8a2();},'txuNN':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','UNzhn':function(_0x346e1c){return _0x346e1c();},'xeAav':_0x512906(0x1a7),'mILaH':_0x512906(0x19e),'QcYxh':'offset','dgFJf':function(_0x47dcca,_0x121891,_0x2dd0ca){return _0x47dcca(_0x121891,_0x2dd0ca);}},_0x1529b4=await _0x1b6097['AlDyn'](getToken);if(!_0x1529b4)throw new Error(_0x1b6097[_0x512906(0x1a2)]);const _0xf1fd8b=_0x1b6097['UNzhn'](getApiBaseUrl),_0x2a1a32=new URLSearchParams();if(_0x26086f?.[_0x512906(0x1a7)])_0x2a1a32['set'](_0x1b6097[_0x512906(0x1ca)],_0x26086f['gitRepoUrl']);if(_0x26086f?.[_0x512906(0x19e)])_0x2a1a32['set'](_0x1b6097[_0x512906(0x1c7)],_0x26086f['gitBranch']);if(_0x26086f?.[_0x512906(0x1ad)])_0x2a1a32['set']('limit',_0x26086f[_0x512906(0x1ad)]['toString']());if(_0x26086f?.[_0x512906(0x1b6)])_0x2a1a32[_0x512906(0x1ab)](_0x1b6097[_0x512906(0x1d6)],_0x26086f[_0x512906(0x1b6)]['toString']());if(_0x26086f?.[_0x512906(0x1c5)])_0x2a1a32[_0x512906(0x1ab)]('includeDeleted','true');const _0x596bde=_0xf1fd8b+'/api/v1/mcp/features'+(_0x2a1a32[_0x512906(0x1a0)]()?'?'+_0x2a1a32[_0x512906(0x1a0)]():''),_0x3b944e=await _0x1b6097[_0x512906(0x1df)](fetch,_0x596bde,{'method':_0x512906(0x1e2),'headers':{'Authorization':_0x512906(0x1db)+_0x1529b4}});if(!_0x3b944e['ok']){const _0x3422dc=await _0x3b944e[_0x512906(0x1c9)]();throw new Error(_0x512906(0x1b1)+_0x3422dc);}return _0x3b944e['json']();}export async function getFeature(_0x9e3780){const _0x160247=_0xad9f,_0x2fa817={'FHVmJ':_0x160247(0x1e0)},_0x1d3f38=await getToken();if(!_0x1d3f38)throw new Error(_0x2fa817[_0x160247(0x1d0)]);const _0x55b31=getApiBaseUrl(),_0x99df72=await fetch(_0x55b31+'/api/v1/mcp/features/'+_0x9e3780,{'method':_0x160247(0x1e2),'headers':{'Authorization':_0x160247(0x1db)+_0x1d3f38}});if(!_0x99df72['ok']){const _0x458381=await _0x99df72[_0x160247(0x1c9)]();throw new Error(_0x160247(0x1dd)+_0x458381);}return _0x99df72[_0x160247(0x1e1)]();}export async function updateFeature(_0x18d429,_0x10e4c9){const _0x2f7c89=_0xad9f,_0x12c245={'vAKzD':function(_0x49c23f){return _0x49c23f();},'KddPj':_0x2f7c89(0x1e0),'forPH':'PATCH','IvNJi':'application/json'},_0x20fe77=await _0x12c245['vAKzD'](getToken);if(!_0x20fe77)throw new Error(_0x12c245['KddPj']);const _0x37c076=getApiBaseUrl(),_0x443f6d=await fetch(_0x37c076+_0x2f7c89(0x1ba)+_0x18d429,{'method':_0x12c245[_0x2f7c89(0x1e4)],'headers':{'Authorization':_0x2f7c89(0x1db)+_0x20fe77,'Content-Type':_0x12c245[_0x2f7c89(0x1d8)]},'body':JSON['stringify'](_0x10e4c9)});if(!_0x443f6d['ok']){const _0x5e890f=await _0x443f6d[_0x2f7c89(0x1c9)]();throw new Error('Failed\x20to\x20update\x20feature\x20review:\x20'+_0x5e890f);}return _0x443f6d['json']();}export async function createChecklistItem(_0xf69684,_0x5bbdf4,_0x2fe576){const _0x3dc815=_0xad9f,_0x48000e={'slYdx':function(_0x40d88f){return _0x40d88f();},'TEJxO':_0x3dc815(0x1bc)},_0x13138f=await _0x48000e[_0x3dc815(0x1c3)](getToken);if(!_0x13138f)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x6cb53a=_0x48000e['slYdx'](getApiBaseUrl),_0x29c27f=await fetch(_0x6cb53a+'/api/v1/mcp/features/'+_0xf69684+_0x3dc815(0x1b5),{'method':'POST','headers':{'Authorization':_0x3dc815(0x1db)+_0x13138f,'Content-Type':_0x48000e[_0x3dc815(0x19d)]},'body':JSON[_0x3dc815(0x1bd)]({'description':_0x5bbdf4,'position':_0x2fe576})});if(!_0x29c27f['ok']){const _0x4e9ea5=await _0x29c27f['text']();throw new Error(_0x3dc815(0x1da)+_0x4e9ea5);}return _0x29c27f[_0x3dc815(0x1e1)]();}export async function updateChecklistItem(_0x25ffa6,_0x13e8c7,_0x437f10){const _0xf30c2f={'YxXgA':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','weGmj':function(_0x128b74,_0x53bbfe,_0xb1f8dc){return _0x128b74(_0x53bbfe,_0xb1f8dc);},'DaIfp':'application/json'};return withRetry(async()=>{const _0x325b84=_0xad9f,_0xc3c212=await getToken();if(!_0xc3c212)throw new Error(_0xf30c2f[_0x325b84(0x1d9)]);const _0x514a25=getApiBaseUrl(),_0x20e63c=await _0xf30c2f[_0x325b84(0x1cb)](fetch,_0x514a25+'/api/v1/mcp/features/'+_0x25ffa6+'/checklist/'+_0x13e8c7,{'method':_0x325b84(0x1be),'headers':{'Authorization':_0x325b84(0x1db)+_0xc3c212,'Content-Type':_0xf30c2f[_0x325b84(0x1af)]},'body':JSON[_0x325b84(0x1bd)](_0x437f10)});if(!_0x20e63c['ok']){const _0x1b5782=await _0x20e63c[_0x325b84(0x1c9)]();throw new Error(_0x325b84(0x1a5)+_0x1b5782);}return _0x20e63c['json']();},{'label':'updateChecklistItem'});}export async function getFeatureReport(_0x4931bc){const _0x2c55ed=_0xad9f,_0x3cb9c9={'qgXdm':function(_0x16eb3c){return _0x16eb3c();},'piOKn':function(_0x5acf71,_0x2a8ae5,_0x3b8640){return _0x5acf71(_0x2a8ae5,_0x3b8640);}},_0x342f7e=await getToken();if(!_0x342f7e)throw new Error(_0x2c55ed(0x1e0));const _0x1674cc=_0x3cb9c9[_0x2c55ed(0x1a8)](getApiBaseUrl),_0x28c0e0=await _0x3cb9c9['piOKn'](fetch,_0x1674cc+_0x2c55ed(0x1ba)+_0x4931bc+_0x2c55ed(0x1a1),{'method':'GET','headers':{'Authorization':_0x2c55ed(0x1db)+_0x342f7e}});if(!_0x28c0e0['ok']){const _0x52745c=await _0x28c0e0['text']();throw new Error(_0x2c55ed(0x1e3)+_0x52745c);}return _0x28c0e0['json']();}function _0xad9f(_0x5c9727,_0x1fb148){_0x5c9727=_0x5c9727-0x19d;const _0x13e051=_0x13e0();let _0xad9f6d=_0x13e051[_0x5c9727];return _0xad9f6d;}export async function getFeatureReportMarkdown(_0x29beac,_0x38f2a4){const _0x301303=_0xad9f,_0x79b249={'cSClb':_0x301303(0x1e0),'DkZas':function(_0x34c843){return _0x34c843();},'ZyHwu':function(_0x7bc149,_0x573cb9){return _0x7bc149(_0x573cb9);},'WaDXI':function(_0x3aa263,_0x5eaf9f){return _0x3aa263&&_0x5eaf9f;},'WXhkm':_0x301303(0x1e2)},_0x440171=await getToken();if(!_0x440171)throw new Error(_0x79b249[_0x301303(0x1a4)]);const _0x3eaa08=_0x79b249['DkZas'](getApiBaseUrl),_0x362ba1=new URLSearchParams(),_0x111f7f=(_0x38f2a4?.[_0x301303(0x1aa)]?.['length']??0x0)>0x0,_0x1cc5ca=_0x79b249[_0x301303(0x1e8)](Boolean,_0x38f2a4?.['sessionId']);_0x111f7f&&_0x38f2a4?.['itemIds']&&_0x362ba1[_0x301303(0x1ab)](_0x301303(0x1aa),_0x38f2a4['itemIds']['join'](','));_0x1cc5ca&&_0x38f2a4?.['sessionId']&&_0x362ba1[_0x301303(0x1ab)](_0x301303(0x1ce),_0x38f2a4['sessionId']);_0x79b249[_0x301303(0x1d1)](!_0x111f7f,!_0x1cc5ca)&&_0x38f2a4?.[_0x301303(0x1d5)]&&_0x362ba1['set']('style',_0x38f2a4[_0x301303(0x1d5)]);const _0x189f0e=_0x3eaa08+_0x301303(0x1ba)+_0x29beac+'/report/markdown',_0x1d832b=''+_0x189f0e+(_0x362ba1['toString']()?'?'+_0x362ba1[_0x301303(0x1a0)]():''),_0x4f6c3d=await fetch(_0x1d832b,{'method':_0x79b249[_0x301303(0x1d7)],'headers':{'Authorization':'Bearer\x20'+_0x440171}});if(!_0x4f6c3d['ok']){const _0x401363=await _0x4f6c3d['text']();throw new Error(_0x301303(0x1d2)+_0x401363);}return _0x4f6c3d['text']();}export async function listFeatureSessions(_0x521347){const _0x44beb3=_0xad9f,_0x4d04dc={'reXvS':function(_0x1cfbb9){return _0x1cfbb9();},'GLXQA':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0xf27040=await _0x4d04dc[_0x44beb3(0x1cc)](getToken);if(!_0xf27040)throw new Error(_0x4d04dc['GLXQA']);const _0x29709b=_0x4d04dc['reXvS'](getApiBaseUrl),_0x1b1ce0=await fetch(_0x29709b+'/api/v1/mcp/features/'+_0x521347+'/sessions',{'method':_0x44beb3(0x1e2),'headers':{'Authorization':'Bearer\x20'+_0xf27040}});if(!_0x1b1ce0['ok']){const _0x25c6b4=await _0x1b1ce0[_0x44beb3(0x1c9)]();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x25c6b4);}return _0x1b1ce0[_0x44beb3(0x1e1)]();}export async function startSession(_0x462e56,_0x319a7b){const _0x171e76=_0xad9f,_0x5d9a0e={'zYhLN':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','AGjNU':function(_0x20d92c){return _0x20d92c();},'QDPQw':function(_0x2993ec,_0xb99131,_0x866af7){return _0x2993ec(_0xb99131,_0x866af7);}},_0x35851=await getToken();if(!_0x35851)throw new Error(_0x5d9a0e['zYhLN']);const _0x112143=_0x5d9a0e['AGjNU'](getApiBaseUrl),_0xc669d6=await _0x5d9a0e[_0x171e76(0x1bf)](fetch,_0x112143+'/api/v1/mcp/features/'+_0x462e56+'/sessions/'+_0x319a7b+'/start',{'method':'POST','headers':{'Authorization':_0x171e76(0x1db)+_0x35851}});if(!_0xc669d6['ok']){const _0x5b732b=await _0xc669d6[_0x171e76(0x1c9)]();throw new Error(_0x171e76(0x1c2)+_0x5b732b);}return _0xc669d6['json']();}export async function concludeSession(_0x49036e,_0x4e114e){const _0x305021=_0xad9f,_0xdddbc7={'mdDgV':function(_0x3bc994){return _0x3bc994();},'LvYnm':_0x305021(0x1e0),'csTfA':'POST'},_0x23150c=await _0xdddbc7[_0x305021(0x1b4)](getToken);if(!_0x23150c)throw new Error(_0xdddbc7['LvYnm']);const _0x273170=_0xdddbc7['mdDgV'](getApiBaseUrl),_0x41dfa5=await fetch(_0x273170+'/api/v1/mcp/features/'+_0x49036e+_0x305021(0x1a3)+_0x4e114e+'/conclude',{'method':_0xdddbc7[_0x305021(0x1e9)],'headers':{'Authorization':_0x305021(0x1db)+_0x23150c}});if(!_0x41dfa5['ok']){const _0x4a42c1=await _0x41dfa5['text']();throw new Error(_0x305021(0x1c0)+_0x4a42c1);}return _0x41dfa5['json']();}export async function getActionItems(_0x5749e4){const _0xe67d97=_0xad9f,_0x57aaec={'ZuCAk':function(_0xeece61){return _0xeece61();}},_0xfbff78=await _0x57aaec[_0xe67d97(0x19f)](getToken);if(!_0xfbff78)throw new Error(_0xe67d97(0x1e0));const _0x3f6f2a=getApiBaseUrl(),_0x535470=await fetch(_0x3f6f2a+'/api/v1/mcp/features/'+_0x5749e4+'/action-items',{'method':'GET','headers':{'Authorization':_0xe67d97(0x1db)+_0xfbff78}});if(!_0x535470['ok']){const _0x464e55=await _0x535470[_0xe67d97(0x1c9)]();throw new Error(_0xe67d97(0x1e5)+_0x464e55);}return _0x535470['json']();}export async function getItemFeedback(_0x4b9a7d,_0x895b3c){const _0x5867db=_0xad9f,_0x350d05={'TNQry':function(_0x5072cc){return _0x5072cc();},'jmofH':function(_0x2244ba,_0x483b73,_0x5ed9ce){return _0x2244ba(_0x483b73,_0x5ed9ce);}},_0x29f42c=await getToken();if(!_0x29f42c)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x9e362f=_0x350d05[_0x5867db(0x1c1)](getApiBaseUrl),_0x5df8ee=await _0x350d05[_0x5867db(0x1d4)](fetch,_0x9e362f+'/api/v1/mcp/features/'+_0x4b9a7d+'/checklist-items/'+_0x895b3c+'/feedback',{'method':'GET','headers':{'Authorization':_0x5867db(0x1db)+_0x29f42c}});if(!_0x5df8ee['ok']){const _0x91c57e=await _0x5df8ee['text']();throw new Error(_0x5867db(0x1e7)+_0x91c57e);}return _0x5df8ee['json']();}export async function markCommentsAddressed(_0xa2b65f,_0x1c32b4,_0x43b285){const _0x5bef9e=_0xad9f,_0x462afd={'jkTCY':'POST','BKgnk':'application/json'},_0x762f50=await getToken();if(!_0x762f50)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x28e362=getApiBaseUrl(),_0x5c921c=await fetch(_0x28e362+'/api/v1/mcp/features/'+_0xa2b65f+_0x5bef9e(0x1dc),{'method':_0x462afd['jkTCY'],'headers':{'Authorization':_0x5bef9e(0x1db)+_0x762f50,'Content-Type':_0x462afd[_0x5bef9e(0x1bb)]},'body':JSON['stringify']({'checklistItemId':_0x1c32b4,'commentIds':_0x43b285})});if(!_0x5c921c['ok']){const _0x3054d5=await _0x5c921c[_0x5bef9e(0x1c9)]();throw new Error('Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20'+_0x3054d5);}}export async function softDeleteFeature(_0x1770ff){const _0x15f519=_0xad9f,_0xe1720={'uSrsw':function(_0x5710b0){return _0x5710b0();},'yzoSK':'DELETE'},_0x5e61c2=await _0xe1720[_0x15f519(0x1e6)](getToken);if(!_0x5e61c2)throw new Error(_0x15f519(0x1e0));const _0x133066=getApiBaseUrl(),_0x4a3ece=await fetch(_0x133066+_0x15f519(0x1ba)+_0x1770ff,{'method':_0xe1720[_0x15f519(0x1a9)],'headers':{'Authorization':'Bearer\x20'+_0x5e61c2}});if(!_0x4a3ece['ok']){const _0x5abdbf=await _0x4a3ece['text']();throw new Error('Failed\x20to\x20delete\x20feature\x20review:\x20'+_0x5abdbf);}}export async function restoreFeature(_0x6f3f60){const _0x4735b0=_0xad9f,_0x54a166={'uRldl':function(_0x2a901c){return _0x2a901c();},'HdJsA':function(_0x5963e4,_0x208c6e,_0x1fad43){return _0x5963e4(_0x208c6e,_0x1fad43);},'qlQDy':'POST'},_0x172026=await getToken();if(!_0x172026)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x17e1b4=_0x54a166[_0x4735b0(0x1b7)](getApiBaseUrl),_0x4d8f09=await _0x54a166[_0x4735b0(0x1a6)](fetch,_0x17e1b4+_0x4735b0(0x1ba)+_0x6f3f60+_0x4735b0(0x1cd),{'method':_0x54a166[_0x4735b0(0x1ec)],'headers':{'Authorization':_0x4735b0(0x1db)+_0x172026}});if(!_0x4d8f09['ok']){const _0x5029cd=await _0x4d8f09[_0x4735b0(0x1c9)]();throw new Error('Failed\x20to\x20restore\x20feature\x20review:\x20'+_0x5029cd);}}